Check for WAVEFORMAT.wFormatTag overflows and allow user to override the tag with...
[mplayer/greg.git] / configure
blob6cb7dce12b6721a746042726f144897cd12d33ac
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # Guidelines:
12 # If the option is named 'opt':
13 # _opt : should have a value in yes/no/auto
14 # _def_opt : '#define ... 1' or '#undef ...' that is: some C code
15 # _ld_opt : ' -L/path/dir -lopt ' that is: some GCC option
16 # _inc_opt : ' -I/path/dir/include '
18 # In this file, a tab is 8 chars and indentation shift is 2 characters
20 # GOTCHAS:
21 # - config files are currently:
22 # config.h config.mak libvo/config.mak libao2/config.mak Gui/config.mak
24 #############################################################################
26 # Prevent locale nonsense from breaking basic text processing utils
27 LC_ALL=C
28 export LC_ALL
30 # Prefer these macros to full length text !
31 # These macros only return an error code - NO display is done
32 cc_check() {
33 echo >> "$TMPLOG"
34 cat "$TMPC" >> "$TMPLOG"
35 echo >> "$TMPLOG"
36 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $TMPC -o $TMPO $@" >> "$TMPLOG"
37 rm -f "$TMPO"
38 ( $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1
39 TMP="$?"
40 echo >> "$TMPLOG"
41 echo "ldd $TMPO" >> "$TMPLOG"
42 ( $_ldd "$TMPO" ) >> "$TMPLOG" 2>&1
43 echo >> "$TMPLOG"
44 return "$TMP"
47 # Display error message, flushes tempfile, exit
48 die () {
49 echo
50 echo "Error: $@" >&2
51 echo >&2
52 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
53 echo "Check \"$TMPLOG\" if you do not understand why it failed."
54 exit 1
57 # OS test booleans functions
58 issystem() {
59 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
61 linux() { issystem "Linux" ; return "$?" ; }
62 sunos() { issystem "SunOS" ; return "$?" ; }
63 hpux() { issystem "HP-UX" ; return "$?" ; }
64 irix() { issystem "IRIX" ; return "$?" ; }
65 cygwin() { issystem "CYGWIN" ; return "$?" ; }
66 freebsd() { issystem "FreeBSD" ; return "$?" ; }
67 netbsd() { issystem "NetBSD" ; return "$?" ; }
68 bsdos() { issystem "BSD/OS" ; return "$?" ; }
69 openbsd() { issystem "OpenBSD" ; return "$?" ; }
70 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
71 qnx() { issystem "QNX" ; return "$?" ; }
72 darwin() { issystem "Darwin" ; return "$?" ; }
73 gnu() { issystem "GNU" ; return "$?" ; }
74 mingw32() { issystem "MINGW32" ; return "$?" ; }
75 morphos() { issystem "MorphOS" ; return "$?" ; }
76 win32() { cygwin || mingw32 ; return "$?" ; }
77 beos() { issystem "BEOS" ; return "$?" ; }
79 # arch test boolean functions
80 # x86/x86pc is used by QNX
81 x86() {
82 case "$host_arch" in
83 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
84 *) return 1 ;;
85 esac
88 ppc() {
89 case "$host_arch" in
90 ppc) return 0;;
91 *) return 1;;
92 esac
95 alpha() {
96 case "$host_arch" in
97 alpha) return 0;;
98 *) return 1;;
99 esac
102 # not boolean test: implement the posix shell "!" operator for a
103 # non-posix /bin/sh.
104 # usage: not {command}
105 # returns exit status "success" when the execution of "command"
106 # fails.
107 not() {
108 eval "$@"
109 test $? -ne 0
112 # Use this before starting a check
113 echocheck() {
114 echo "============ Checking for $@ ============" >> "$TMPLOG"
115 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
118 # Use this to echo the results of a check
119 echores() {
120 echo "Result is: $@" >> "$TMPLOG"
121 echo "##########################################" >> "$TMPLOG"
122 echo "" >> "$TMPLOG"
123 echo "$@"
125 #############################################################################
127 # Check how echo works in this /bin/sh
128 case `echo -n` in
129 -n) _echo_n= _echo_c='\c' ;; # SysV echo
130 *) _echo_n='-n ' _echo_c= ;; # BSD echo
131 esac
133 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"`
135 for parm in "$@" ; do
136 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
137 cat << EOF
139 Usage: $0 [OPTIONS]...
141 Configuration:
142 -h, --help display this help and exit
144 Installation directories:
145 --prefix=DIR use this prefix for installing mplayer [/usr/local]
146 --bindir=DIR use this prefix for installing mplayer binary
147 [PREFIX/bin]
148 --datadir=DIR use this prefix for installing machine independent
149 data files (fonts, skins) [PREFIX/share/mplayer]
150 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
151 --confdir=DIR use this prefix for installing configuration files
152 [PREFIX/etc/mplayer]
153 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
155 Optional features:
156 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
157 --enable-gui enable gmplayer compilation (GTK 1.2 GUI) [disable]
158 --enable-largefiles enable support for files > 2 GBytes [disable]
159 --enable-linux-devfs set default devices to devfs ones [disable]
160 --enable-termcap use termcap database for key codes [autodetect]
161 --enable-termios use termios database for key codes [autodetect]
162 --disable-iconv do not use iconv(3) function [autodetect]
163 --disable-setlocale disable setlocale using in mplayer [autodetect]
164 --disable-langinfo do not use langinfo [autodetect]
165 --enable-lirc enable LIRC (remote control) support [autodetect]
166 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
167 --enable-joystick enable joystick support [disable]
168 --disable-vm disable support X video mode extensions [autodetect]
169 --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
170 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
171 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
172 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
173 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
174 --disable-edl disable EDL (edit decision list) support [enable]
175 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
176 --disable-network disable network support (for: http/mms/rtp) [enable]
177 --enable-winsock2 enable winsock2 usage [autodetect]
178 --enable-smb enable Samba (SMB) input support [autodetect]
179 --enable-live enable LIVE.COM Streaming Media support [autodetect]
180 --disable-dvdread Disable libdvdread support [autodetect]
181 --disable-mpdvdkit Disable mpdvdkit/mpdvdkit2 support [autodetect]
182 --disable-cdparanoia Disable cdparanoia support [autodetect]
183 --disable-freetype Disable freetype2 font rendering support [autodetect]
184 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
185 --disable-unrarlib Disable Unique RAR File Library [enabled]
186 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
187 --disable-sortsub Disable subtitles sorting [enabled]
188 --enable-fribidi Enable using the FriBiDi libs [disabled]
189 --disable-enca Disable using ENCA charset oracle library [autodetect]
190 --disable-macosx Disable Mac OS X specific features [autodetect]
191 --enable-macosx-finder-support Enable Mac OS X Finder invocation parameter parsing [disabled]
192 --enable-macosx-bundle Enable Mac OS X bundle file locations [autodetect]
193 --disable-inet6 Disable IPv6 support [autodetect]
194 --disable-gethostbyname2 gethostbyname() function is not provided by the C
195 library [autodetect]
196 --disable-ftp Disable ftp support [enabled]
197 --disable-vstream Disable tivo vstream client support [autodetect]
198 --disable-pthreads Disable Posix threads support [autodetect]
200 Codecs:
201 --enable-gif enable gif support [autodetect]
202 --enable-png enable png input/output support [autodetect]
203 --enable-jpeg enable jpeg input/output support [autodetect]
204 --enable-liblzo enable external liblzo support [autodetect]
205 --disable-win32 disable Win32 DLL support [autodetect]
206 --disable-dshow disable Win32/DirectShow support [autodetect]
207 --disable-qtx disable Quicktime codecs [autodetect]
208 --disable-xanim disable XAnim DLL support [autodetect]
209 --disable-real disable RealPlayer DLL support [autodetect]
210 --disable-xvid disable XviD codec [autodetect]
211 --disable-x264 disable H.264 encoder [autodetect]
212 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
213 --enable-opendivx enable _old_ OpenDivx codec [disable]
214 --disable-libavcodec disable libavcodec [autodetect]
215 --disable-libavformat disable libavformat [autodetect]
216 --enable-libfame enable libfame realtime encoder [autodetect]
217 --disable-internal-tremor do not build internal OggVorbis support [enabled]
218 --enable-tremor-low build with lower accuracy internal tremor [disabled]
219 --enable-external-tremor build with external tremor [disabled]
220 --disable-vorbis disable OggVorbis support entirely [autodetect]
221 --enable-theora build with OggTheora support [autodetect]
222 --disable-internal-matroska disable internal Matroska support [enabled]
223 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
224 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
225 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
226 --disable-ladspa disable LADSPA plugin support [autodetect]
227 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
228 --disable-mad disable libmad (MPEG audio) support [autodetect]
229 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
230 --disable-twolame disable Twolame (MPEG layer 2 audio) support in mencoder [autodetect]
231 --enable-xmms build with XMMS inputplugin support [disabled]
232 --disable-mp3lib disable builtin mp3lib [enabled]
233 --disable-liba52 disable builtin liba52 [enabled]
234 --enable-libdts enable libdts support [autodetect]
235 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
236 --disable-amr_nb disable amr narrowband, floating point [autodetect]
237 --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect]
238 --disable-amr_wb disable amr wideband, floating point [autodetect]
239 --disable-codec=CODEC disable specified codec
240 --enable-codec=CODEC dnable specified codec
242 Video output:
243 --disable-vidix disable VIDIX [enable on x86 *nix]
244 --enable-gl build with OpenGL render support [autodetect]
245 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
246 --enable-vesa build with VESA support [autodetect]
247 --enable-svga build with SVGAlib support [autodetect]
248 --enable-sdl build with SDL render support [autodetect]
249 --enable-aa build with AAlib render support [autodetect]
250 --enable-caca build with CACA render support [autodetect]
251 --enable-ggi build with GGI render support [autodetect]
252 --enable-ggiwmh build with GGI libggiwmh extension [autodetect]
253 --enable-directx build with DirectX support [autodetect]
254 --enable-dxr2 build with DXR2 render support [autodetect]
255 --enable-dxr3 build with DXR3/H+ render support [autodetect]
256 --enable-dvb build with support for output via DVB-Card [autodetect]
257 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
258 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
259 (check for /dev/mga_vid) [autodetect]
260 --enable-xmga build with mga_vid X Window support
261 (check for X & /dev/mga_vid) [autodetect]
262 --enable-xv build with Xv render support for X 4.x [autodetect]
263 --enable-xvmc build with XvMC acceleration for X 4.x [disable]
264 --enable-vm build with XF86VidMode support for X11 [autodetect]
265 --enable-xinerama build with Xinerama support for X11 [autodetect]
266 --enable-x11 build with X11 render support [autodetect]
267 --enable-fbdev build with FBDev render support [autodetect]
268 --enable-mlib build with MLIB support (Solaris only) [autodetect]
269 --enable-3dfx build with obsolete /dev/3dfx support [disable]
270 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
271 --enable-directfb build with DirectFB support [autodetect]
272 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
273 --enable-bl build with Blinkenlights support [disable]
274 --enable-tdfxvid build with tdfx_vid support [disable]
275 --disable-tga disable targa output support [enable]
276 --disable-pnm disable pnm output support [enable]
277 --disable-md5sum disable md5sum output support [enable]
279 Audio output:
280 --disable-alsa disable ALSA sound support [autodetect]
281 --disable-ossaudio disable OSS sound support [autodetect]
282 --disable-arts disable aRts sound support [autodetect]
283 --disable-esd disable esd sound support [autodetect]
284 --disable-polyp disable Polypaudio sound support [autodetect]
285 --disable-jack disable JACK sound support [autodetect]
286 --disable-nas disable NAS sound support [autodetect]
287 --disable-sgiaudio disable SGI sound support [autodetect]
288 --disable-sunaudio disable Sun sound support [autodetect]
289 --disable-win32waveout disable Windows waveout sound support [autodetect]
290 --disable-select disable using select() on audio device [enable]
292 Miscellaneous options:
293 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
294 --cc=COMPILER use this C compiler to build MPlayer [gcc]
295 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
296 --as=ASSEMBLER use this assembler to build MPlayer [as]
297 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
298 --enable-static build a statically linked binary. Set further linking
299 options with --enable-static="-lslang -lncurses"
300 --charset convert the help messages to this charset
301 --language=list a white space or comma separated list of languages
302 for translated man pages, the first language is the
303 primary and therefore used for translated messages
304 and GUI (also the environment variable \$LINGUAS is
305 honored) [en]
306 (Available: $LANGUAGES all)
307 --enable-shared-pp install & use shared postprocessing lib
308 --with-install=PATH use a custom install program (useful if your OS uses
309 a GNU-incompatible install utility by default and
310 you want to use GNU version)
311 --install-path=PATH the path to a custom install program
312 this option is obsolete and will be removed soon,
313 use --with-install instead.
315 Advanced options:
316 --enable-mmx build with MMX support [autodetect]
317 --enable-mmx2 build with MMX2 support (PIII, Athlon) [autodetect]
318 --enable-3dnow build with 3DNow! support [autodetect]
319 --enable-3dnowex build with extended 3DNow! support [autodetect]
320 --enable-sse build with SSE support [autodetect]
321 --enable-sse2 build with SSE2 support [autodetect]
322 --enable-shm build with shm support [autodetect]
323 --enable-altivec build with Altivec support (PowerPC) [autodetect]
324 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
325 --enable-big-endian Force byte order to big-endian [autodetect]
326 --enable-debug[=1-3] compile debugging information into mplayer [disable]
327 --enable-profile compile profiling information into mplayer [disable]
328 --disable-sighandler disable sighandler for crashes [enable]
329 --enable-crash-debug enable automatic gdb attach on crash [disable]
330 --enable-i18n _experimental_ gnu gettext() support [autodetect]
331 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
333 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
334 --disable-gcc-checking disable gcc version checking [enable]
336 Use these options if autodetection fails (Options marked with (*) accept
337 multiple paths separated by ':'):
338 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
339 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
340 --with-x11incdir=DIR X headers in DIR (*)
341 --with-x11libdir=DIR X library files in DIR (*)
342 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
343 --with-dvbincdir=DIR DVB headers in DIR (*)
344 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
345 --with-mlibdir=DIR libmlib (MLIB support) in DIR (Solaris only)
346 --with-codecsdir=DIR Binary codec files in DIR
347 --with-win32libdir=DIR W*ndows DLL files in DIR
348 --with-xanimlibdir=DIR XAnim DLL files in DIR
349 --with-reallibdir=DIR RealPlayer DLL files in DIR
350 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
351 --with-xvidincdir=DIR XviD header in DIR (*)
352 --with-x264libdir=DIR libx264 in DIR
353 --with-x264incdir=DIR x264 header in DIR
354 --with-dtslibdir=DIR libdts library in DIR (*)
355 --with-dtsincdir=DIR libdts header in DIR (*)
356 --with-livelibdir=DIR LIVE.COM Streaming Media libraries in DIR
357 --with-toolamedir=DIR path to Toolame library and include file
358 --with-xmmsplugindir=DIR XMMS plugins in DIR
359 --with-xmmslibdir=DIR libxmms.so.1 in DIR
360 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
361 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
362 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
363 --with-termcaplib=NAME name of library with termcap functionality
364 name should be given without leading "lib"
365 checks for "termcap" and "tinfo"
367 --with-freetype-config=PATH path to freetype-config
368 (e.g. /opt/bin/freetype-config)
369 --with-fribidi-config=PATH path to fribidi-config
370 (e.g. /opt/bin/fribidi-config)
371 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
372 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
373 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
375 This configure script is NOT autoconf-based, even though its output is similar.
376 It will try to autodetect all configuration options. If you --enable an option
377 it will be forcefully turned on, skipping autodetection. This can break
378 compilation, so you need to know what you are doing.
380 exit 0
382 done # for parm in ...
385 # 1st pass checking for vital options
386 _install=install
387 _ranlib=ranlib
388 _cc=cc
389 test "$CC" && _cc="$CC"
390 _as=auto
391 _runtime_cpudetection=no
392 for ac_option do
393 case "$ac_option" in
394 --target=*)
395 _target=`echo $ac_option | cut -d '=' -f 2`
397 --cc=*)
398 _cc=`echo $ac_option | cut -d '=' -f 2`
400 --host-cc=*)
401 _host_cc=`echo $ac_option | cut -d '=' -f 2`
403 --as=*)
404 _as=`echo $ac_option | cut -d '=' -f 2`
406 --enable-gcc-checking)
407 _skip_cc_check=no
409 --disable-gcc-checking)
410 _skip_cc_check=yes
412 --enable-static)
413 _ld_static='-static'
415 --disable-static)
416 _ld_static=''
418 --enable-static=*)
419 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
421 --with-extraincdir=*)
422 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
424 --with-extralibdir=*)
425 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
427 --enable-runtime-cpudetection)
428 _runtime_cpudetection=yes
430 --disable-runtime-cpudetection)
431 _runtime_cpudetection=no
433 --install-path=*)
434 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
436 --with-install=*)
437 _install=`echo $ac_option | cut -d '=' -f 2 `
439 esac
440 done
442 # Determine our OS name and CPU architecture
443 if test -z "$_target" ; then
444 # OS name
445 system_name=`( uname -s ) 2>&1`
446 case "$system_name" in
447 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
449 IRIX*)
450 system_name=IRIX
452 HP-UX*)
453 system_name=HP-UX
455 [cC][yY][gG][wW][iI][nN]*)
456 system_name=CYGWIN
458 MINGW32*)
459 system_name=MINGW32
461 MorphOS)
462 system_name=MorphOS
465 system_name="$system_name-UNKNOWN"
467 esac
470 # host's CPU/instruction set
471 host_arch=`( uname -p ) 2>&1`
472 case "$host_arch" in
473 i386|sparc|ppc|alpha|arm|mips|vax)
475 powerpc) # Darwin returns 'powerpc'
476 host_arch=ppc
478 *) # uname -p on Linux returns 'unknown' for the processor type,
479 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
481 # Maybe uname -m (machine hardware name) returns something we
482 # recognize.
484 # x86/x86pc is used by QNX
485 case "`( uname -m ) 2>&1`" in
486 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 ;;
487 ia64) host_arch=ia64 ;;
488 x86_64|amd64)
489 if [ "`$_cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
490 -z "`echo $CFLAGS | grep -- -m32`" ]; then
491 host_arch=x86_64
492 else
493 host_arch=i386
496 macppc|ppc) host_arch=ppc ;;
497 alpha) host_arch=alpha ;;
498 sparc) host_arch=sparc ;;
499 sparc64) host_arch=sparc64 ;;
500 parisc*|hppa*|9000*) host_arch=hppa ;;
501 arm*) host_arch=arm ;;
502 s390) host_arch=s390 ;;
503 s390x) host_arch=s390x ;;
504 mips) host_arch=mips ;;
505 vax) host_arch=vax ;;
506 *) host_arch=UNKNOWN ;;
507 esac
509 esac
510 else
511 system_name=`echo $_target | cut -d '-' -f 2`
512 case "`echo $system_name | tr A-Z a-z`" in
513 linux) system_name=Linux ;;
514 freebsd) system_name=FreeBSD ;;
515 netbsd) system_name=NetBSD ;;
516 bsd/os) system_name=BSD/OS ;;
517 openbsd) system_name=OpenBSD ;;
518 sunos) system_name=SunOS ;;
519 qnx) system_name=QNX ;;
520 morphos) system_name=MorphOS ;;
521 mingw32msvc) system_name=MINGW32 ;;
522 esac
523 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
524 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
527 echo "Detected operating system: $system_name"
528 echo "Detected host architecture: $host_arch"
530 # LGB: temporary files
531 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
532 test "$I" && break
533 done
535 TMPLOG="configure.log"
536 rm -f "$TMPLOG"
537 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
538 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
539 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
540 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
542 # config files
544 # FIXME: A lot of stuff is installed under /usr/local
545 # NK: But we should never use this stuff implicitly since we call compiler
546 # from /usr we should be sure that there no effects from other compilers
547 # (libraries) which might be installed into /usr/local. Let users use this
548 # stuff explicitly as command line argument. In other words: It would be
549 # resonable to have only /usr/include or only /usr/local/include.
551 if freebsd ; then
552 _ld_extra="$_ld_extra -L/usr/local/lib"
553 _inc_extra="$_inc_extra -I/usr/local/include"
556 if netbsd ; then
557 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
558 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
559 done
560 _ld_extra=$tmp
563 _ldd=ldd
564 if darwin; then
565 _ldd="otool -L"
568 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
569 # if used as 'head -1' instead of 'head -n 1', but older versions don't
570 # know about '-n'.
571 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
572 _head() { head -$1 2>/dev/null ; }
573 else
574 _head() { head -n $1 2>/dev/null ; }
576 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
577 _tail() { tail -$1 2>/dev/null ; }
578 else
579 _tail() { tail -n $1 2>/dev/null ; }
582 # Checking CC version...
583 if test "$_skip_cc_check" != yes ; then
584 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
585 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
586 echocheck "$_cc version"
587 cc_vendor=intel
588 cc_name=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 1`
589 cc_version=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
590 _cc_major=`echo $cc_version | cut -d '.' -f 1`
591 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
592 # TODO verify older icc/ecc compatibility
593 case $cc_version in
595 cc_version="v. ?.??, bad"
596 cc_verc_fail=yes
598 8.0)
599 cc_version="$cc_version, ok"
600 cc_verc_fail=no
603 cc_version="$cc_version, bad"
604 cc_verc_fail=yes
606 esac
607 echores "$cc_version"
608 else
609 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
610 echocheck "$_cc version"
611 cc_vendor=gnu
612 cc_name=`( $_cc -v ) 2>&1 | _tail 1 | cut -d ' ' -f 1`
613 cc_version=`( $_cc -dumpversion ) 2>&1`
614 if test "$?" -gt 0; then
615 cc_version="not found"
617 case $cc_version in
619 cc_version="v. ?.??, bad"
620 cc_verc_fail=yes
622 2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
623 _cc_major=`echo $cc_version | cut -d '.' -f 1`
624 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
625 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
626 cc_version="$cc_version, ok"
627 cc_verc_fail=no
629 'not found')
630 cc_verc_fail=yes
633 cc_version="$cc_version, bad"
634 cc_verc_fail=yes
636 esac
637 echores "$cc_version"
638 (test "$cc_verc_fail" = "no") && break
639 done
640 fi # icc
641 if test "$cc_verc_fail" = yes ; then
642 cat <<EOF
644 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
646 You are not using a supported compiler. We do not have the time to make sure
647 everything works with compilers other than the ones we use. Use either the
648 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
649 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
651 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
652 mplayer and lame (which is used for mencoder). If you get compile errors,
653 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
654 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
655 bugs!
657 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
659 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
662 die "Bad gcc version"
664 else
665 cat <<EOF
667 ******************************************************************************
669 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
670 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
672 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
673 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
674 Lame which is used by mencoder produces weird errors, too.
676 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
677 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
679 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
681 ******************************************************************************
685 read _answer
688 echocheck "host cc"
689 if not test "$_host_cc" ; then
690 _host_cc=$_cc
692 echores $_host_cc
695 # ---
697 # now that we know what compiler should be used for compilation, try to find
698 # out which assembler is used by the $_cc compiler
699 if test "$_as" = auto ; then
700 _as=`$_cc -print-prog-name=as`
701 test -z "$_as" && _as=as
704 # XXX: this should be ok..
705 _cpuinfo="echo"
706 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
707 # FIXME: Remove the cygwin check once AMD CPUs are supported
708 if test -r /proc/cpuinfo && not cygwin; then
709 # Linux with /proc mounted, extract CPU information from it
710 _cpuinfo="cat /proc/cpuinfo"
711 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
712 # FreeBSD with Linux emulation /proc mounted,
713 # extract CPU information from it
714 _cpuinfo="cat /compat/linux/proc/cpuinfo"
715 elif darwin ; then
716 # use hostinfo on Darwin
717 _cpuinfo="hostinfo"
718 elif x86; then
719 # all other OSes try to extract CPU information from a small helper
720 # program TOOLS/cpuinfo instead
721 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
722 _cpuinfo="TOOLS/cpuinfo"
725 x86_exts_check()
727 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | _head 1`
728 if test -z "$pparam" ; then
729 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | _head 1`
732 _mmx=no
733 _3dnow=no
734 _3dnowex=no
735 _mmx2=no
736 _sse=no
737 _sse2=no
738 _mtrr=no
740 for i in $pparam ; do
741 case "$i" in
742 3dnow) _3dnow=yes ;;
743 3dnowext) _3dnow=yes _3dnowex=yes ;;
744 mmx) _mmx=yes ;;
745 mmxext) _mmx2=yes ;;
746 mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;;
747 xmm|sse|kni) _sse=yes _mmx2=yes ;;
748 sse2) _sse2=yes ;;
749 esac
750 done
753 case "$host_arch" in
754 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
755 _def_arch="#define ARCH_X86 1"
756 _target_arch="TARGET_ARCH_X86 = yes"
758 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
759 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
760 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
761 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
762 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
764 x86_exts_check
766 echocheck "CPU vendor"
767 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
769 echocheck "CPU type"
770 echores "$pname"
772 case "$pvendor" in
773 AuthenticAMD)
774 case "$pfamily" in
775 3) proc=i386 iproc=386 ;;
776 4) proc=i486 iproc=486 ;;
777 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
778 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
779 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
780 proc=k6-3
781 elif test "$pmodel" -ge 8; then
782 proc=k6-2
783 elif test "$pmodel" -ge 6; then
784 proc=k6
785 else
786 proc=i586
787 iproc=586
790 6) iproc=686
791 if test "$pmodel" -ge 7; then
792 proc=athlon-4
793 elif test "$pmodel" -ge 6; then
794 # only Athlon XP supports ssem MP, Duron etc not
795 # but most of them are CPUID 666, so check if sse detected
796 # btw. there is also athlon-mp opt, but we need extended
797 # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos
798 if test "$_sse" = yes && test "$pstepping" -ge 2; then
799 proc=athlon-xp
800 else
801 proc=athlon-4
803 elif test "$pmodel" -ge 4; then
804 proc=athlon-tbird
805 else
806 proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead?
809 15) iproc=686
810 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
811 # caught and remedied in the optimization tests below.
812 proc=k8
815 *) proc=athlon-xp iproc=686 ;;
816 esac
818 GenuineIntel)
819 case "$pfamily" in
820 3) proc=i386 iproc=386 ;;
821 4) proc=i486 iproc=486 ;;
822 5) iproc=586
823 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
824 proc=pentium-mmx # 4 is desktop, 8 is mobile
825 else
826 proc=i586
829 6) iproc=686
830 if test "$pmodel" -ge 7; then
831 proc=pentium3
832 elif test "$pmodel" -ge 3; then
833 proc=pentium2
834 else
835 proc=i686
838 15) proc=pentium4 iproc=686 ;;
839 *) proc=pentium4 iproc=686 ;;
840 esac
842 unknown)
843 case "$pfamily" in
844 3) proc=i386 iproc=386 ;;
845 4) proc=i486 iproc=486 ;;
846 *) proc=i586 iproc=586 ;;
847 esac
850 proc=i586 iproc=586 ;;
851 esac
853 # check that gcc supports our CPU, if not, fall back to earlier ones
854 # LGB: check -mcpu and -march swithing step by step with enabling
855 # to fall back till 386.
857 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
859 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
860 cpuopt=-mtune
861 else
862 cpuopt=-mcpu
865 echocheck "GCC & CPU optimization abilities"
866 cat > $TMPC << EOF
867 int main(void) { return 0; }
869 if test "$_runtime_cpudetection" = no ; then
870 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
871 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
873 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
874 cc_check -march=$proc $cpuopt=$proc || proc=athlon
876 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
877 cc_check -march=$proc $cpuopt=$proc || proc=k6
879 if test "$proc" = "k6"; then
880 if not cc_check -march=$proc $cpuopt=$proc; then
881 if cc_check -march=i586 $cpuopt=i686; then
882 proc=i586-i686
883 else
884 proc=i586
888 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon"; then
889 cc_check -march=$proc $cpuopt=$proc || proc=i686
891 if test "$proc" = "i686" || test "$proc" = "pentium-mmx"; then
892 cc_check -march=$proc $cpuopt=$proc || proc=i586
894 if test "$proc" = "i586" ; then
895 cc_check -march=$proc $cpuopt=$proc || proc=i486
897 if test "$proc" = "i486" ; then
898 cc_check -march=$proc $cpuopt=$proc || proc=i386
900 if test "$proc" = "i386" ; then
901 cc_check -march=$proc $cpuopt=$proc || proc=error
903 if test "$proc" = "error" ; then
904 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'."
905 _mcpu=""
906 _march=""
907 _optimizing=""
908 elif test "$proc" = "i586-i686"; then
909 _march="-march=i586"
910 _mcpu="$cpuopt=i686"
911 _optimizing="$proc"
912 else
913 _march="-march=$proc"
914 _mcpu="$cpuopt=$proc"
915 _optimizing="$proc"
917 else
918 # i686 is probably the most common CPU - optimize for it
919 _mcpu="$cpuopt=i686"
920 # at least i486 required, for bswap instruction
921 _march="-march=i486"
922 cc_check $_mcpu || _mcpu=""
923 cc_check $_march $_mcpu || _march=""
926 ## Gabucino : --target takes effect here (hopefully...) by overwriting
927 ## autodetected mcpu/march parameters
928 if test "$_target" ; then
929 # TODO: it may be a good idea to check GCC and fall back in all cases
930 if test "$host_arch" = "i586-i686"; then
931 _march="-march=i586"
932 _mcpu="$cpuopt=i686"
933 else
934 _march="-march=$host_arch"
935 _mcpu="$cpuopt=$host_arch"
938 proc="$host_arch"
940 case "$proc" in
941 i386) iproc=386 ;;
942 i486) iproc=486 ;;
943 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
944 i686|athlon*|pentium*) iproc=686 ;;
945 *) iproc=586 ;;
946 esac
949 echores "$proc"
952 ia64)
953 _def_arch='#define ARCH_IA64 1'
954 _target_arch='TARGET_ARCH_IA64 = yes'
955 iproc='ia64'
956 proc=''
957 _march=''
958 _mcpu=''
959 _optimizing=''
962 x86_64|amd64)
963 _def_arch='#define ARCH_X86_64 1'
964 _target_arch='TARGET_ARCH_X86_64 = yes'
965 iproc='x86_64'
967 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
968 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
969 cpuopt=-mtune
970 else
971 cpuopt=-mcpu
973 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
974 # caught and remedied in the optimization tests below.
975 proc=k8
977 echocheck "GCC & CPU optimization abilities"
978 cat > $TMPC << EOF
979 int main(void) { return 0; }
981 # This is a stripped-down version of the i386 fallback.
982 if test "$_runtime_cpudetection" = no ; then
983 if test "$proc" = "k8" -o "$proc" = "opteron" -o "$proc" = "athlon64" -o "$proc" = "athlon-fx" ; then
984 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
986 # This will fail if gcc version < 3.3, which is ok because earlier
987 # versions don't really support 64-bit on amd64.
988 # Is this a valid assumption? -Corey
989 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" ; then
990 cc_check -march=$proc $cpuopt=$proc || proc=error
992 _march="-march=$proc"
993 _mcpu="$cpuopt=$proc"
994 if test "$proc" = "error" ; then
995 echores "Your $_cc does not even support \"athlon-xp\" for '-march' and '$cpuopt'."
996 _mcpu=""
997 _march=""
999 else
1000 _march=""
1001 _mcpu=""
1004 _optimizing=""
1006 echores "$proc"
1008 x86_exts_check
1011 sparc)
1012 _def_arch='#define ARCH_SPARC 1'
1013 _target_arch='TARGET_ARCH_SPARC = yes'
1014 iproc='sparc'
1015 if sunos ; then
1016 echocheck "CPU type"
1017 karch=`uname -m`
1018 case "`echo $karch`" in
1019 sun4) proc=v7 ;;
1020 sun4c) proc=v7 ;;
1021 sun4d) proc=v8 ;;
1022 sun4m) proc=v8 ;;
1023 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
1024 *) ;;
1025 esac
1026 echores "$proc"
1027 else
1028 proc=v8
1030 _march=''
1031 _mcpu="-mcpu=$proc"
1032 _optimizing="$proc"
1035 sparc64)
1036 _def_arch='#define ARCH_SPARC 1'
1037 _target_arch='TARGET_ARCH_SPARC = yes'
1038 _vis='yes'
1039 _def_vis='#define HAVE_VIS = yes'
1040 iproc='sparc'
1041 proc='v9'
1042 _march=''
1043 _mcpu="-mcpu=$proc"
1044 _optimizing="$proc"
1047 arm|armv4l|armv5tel)
1048 _def_arch='#define ARCH_ARMV4L 1'
1049 _target_arch='TARGET_ARCH_ARMV4L = yes'
1050 iproc='arm'
1051 proc=''
1052 _march=''
1053 _mcpu=''
1054 _optimizing=''
1057 ppc)
1058 _def_arch='#define ARCH_POWERPC 1'
1059 _def_dcbzl='#define NO_DCBZL 1'
1060 _target_arch='TARGET_ARCH_POWERPC = yes'
1061 iproc='ppc'
1062 proc=''
1063 _march=''
1064 _mcpu=''
1065 _optimizing=''
1066 _altivec=no
1068 echocheck "CPU type"
1069 if linux && test -n "$_cpuinfo"; then
1070 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1071 if test -n "`$_cpuinfo | grep altivec`"; then
1072 _altivec=yes
1075 if darwin ; then
1076 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1077 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
1078 _altivec=yes
1079 elif [ "`sysctl -n hw.optional.altivec 2>/dev/null`" = 1 ]; then
1080 _altivec=yes
1083 # only gcc 3.4 works reliably with altivec code under netbsd
1084 if netbsd ; then
1085 case $cc_version in
1086 2*|3.0*|3.1*|3.2*|3.3*)
1089 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1090 _altivec=yes
1093 esac
1095 if test "$_altivec" = yes; then
1096 echores "$proc altivec"
1097 else
1098 echores "$proc"
1101 echocheck "GCC & CPU optimization abilities"
1103 if test -n "$proc"; then
1104 case "$proc" in
1105 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1106 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1107 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1108 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1109 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1110 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1111 *) ;;
1112 esac
1113 # gcc 3.1(.1) and up supports 7400 and 7450
1114 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
1115 case "$proc" in
1116 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1117 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1118 *) ;;
1119 esac
1121 # gcc 3.2 and up supports 970
1122 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
1123 case "$proc" in
1124 970*) _march='-mcpu=970' _mcpu='-mtune=970'
1125 _def_dcbzl='#undef NO_DCBZL' ;;
1126 *) ;;
1127 esac
1131 if test -n "$_mcpu"; then
1132 _optimizing=`echo $_mcpu | cut -c 8-`
1133 echores "$_optimizing"
1134 else
1135 echores "none"
1140 alpha)
1141 _def_arch='#define ARCH_ALPHA 1'
1142 _target_arch='TARGET_ARCH_ALPHA = yes'
1143 iproc='alpha'
1144 _march=''
1146 echocheck "CPU type"
1147 cat > $TMPC << EOF
1148 int main() {
1149 unsigned long ver, mask;
1150 asm ("implver %0" : "=r" (ver));
1151 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1152 printf("%ld-%x\n", ver, ~mask);
1153 return 0;
1156 $_cc -o "$TMPO" "$TMPC"
1157 case `"$TMPO"` in
1159 0-0) proc="ev4"; cpu_understands_mvi="0";;
1160 1-0) proc="ev5"; cpu_understands_mvi="0";;
1161 1-1) proc="ev56"; cpu_understands_mvi="0";;
1162 1-101) proc="pca56"; cpu_understands_mvi="1";;
1163 2-303) proc="ev6"; cpu_understands_mvi="1";;
1164 2-307) proc="ev67"; cpu_understands_mvi="1";;
1165 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1166 esac
1167 echores "$proc"
1169 echocheck "GCC & CPU optimization abilities"
1170 if test "$proc" = "ev68" ; then
1171 cc_check -mcpu=$proc || proc=ev67
1173 if test "$proc" = "ev67" ; then
1174 cc_check -mcpu=$proc || proc=ev6
1176 _mcpu="-mcpu=$proc"
1177 echores "$proc"
1179 _optimizing="$proc"
1181 echocheck "MVI instruction support in GCC"
1182 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1183 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1184 echores "yes"
1185 else
1186 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1187 echores "no, GCC = `( $_cc -dumpversion ) 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1191 mips)
1192 _def_arch='#define ARCH_SGI_MIPS 1'
1193 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1194 iproc='sgi-mips'
1195 proc=''
1196 _march=''
1197 _mcpu=''
1198 _optimizing=''
1200 if irix ; then
1201 echocheck "CPU type"
1202 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1203 case "`echo $proc`" in
1204 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1205 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1206 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1207 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1208 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1209 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1210 esac
1211 echores "$proc"
1216 hppa)
1217 _def_arch='#define ARCH_PA_RISC 1'
1218 _target_arch='TARGET_ARCH_PA_RISC = yes'
1219 iproc='PA-RISC'
1220 proc=''
1221 _march=''
1222 _mcpu=''
1223 _optimizing=''
1226 s390)
1227 _def_arch='#define ARCH_S390 1'
1228 _target_arch='TARGET_ARCH_S390 = yes'
1229 iproc='390'
1230 proc=''
1231 _march=''
1232 _mcpu=''
1233 _optimizing=''
1236 s390x)
1237 _def_arch='#define ARCH_S390X 1'
1238 _target_arch='TARGET_ARCH_S390X = yes'
1239 iproc='390x'
1240 proc=''
1241 _march=''
1242 _mcpu=''
1243 _optimizing=''
1246 vax)
1247 _def_arch='#define ARCH_VAX 1'
1248 _target_arch='TARGET_ARCH_VAX = yes'
1249 iproc='vax'
1250 proc=''
1251 _march=''
1252 _mcpu=''
1253 _optimizing=''
1257 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1258 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1259 die "unsupported architecture $host_arch"
1261 esac
1263 if test "$_runtime_cpudetection" = yes ; then
1264 if x86; then
1265 _mmx=yes
1266 _3dnow=yes
1267 _3dnowex=yes
1268 _mmx2=yes
1269 _sse=yes
1270 _sse2=yes
1271 _mtrr=yes
1273 if ppc; then
1274 _altivec=yes
1278 if x86 && test "$_runtime_cpudetection" = no ; then
1279 extcheck() {
1280 if test "$1" = yes ; then
1281 echocheck "kernel support of $2"
1282 cat > $TMPC <<EOF
1283 #include <signal.h>
1284 void catch() { exit(1); }
1285 int main(void){
1286 signal(SIGILL, catch);
1287 __asm__ __volatile__ ("$3":::"memory");return(0);
1291 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then
1292 echores "yes"
1293 _optimizing="$_optimizing $2"
1294 return 0
1295 else
1296 echores "failed"
1297 echo "It seems that your kernel does not correctly support $2."
1298 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1299 return 1
1302 return 0
1305 extcheck $_mmx "mmx" "emms" || _mmx=no
1306 extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
1307 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1308 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
1309 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1310 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1311 echocheck "mtrr support"
1312 echores "$_mtrr"
1314 if test "$_mtrr" = yes ; then
1315 _optimizing="$_optimizing mtrr"
1318 if test "$_gcc3_ext" != ""; then
1319 # if we had to disable sse/sse2 because the active kernel does not
1320 # support this instruction set extension, we also have to tell
1321 # gcc3 to not generate sse/sse2 instructions for normal C code
1322 cat > $TMPC << EOF
1323 int main(void) { return 0; }
1325 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1330 echocheck "assembler support of -pipe option"
1331 cat > $TMPC << EOF
1332 int main(void) { return 0; }
1334 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1336 _prefix="/usr/local"
1337 _xvmclib="XvMCNVIDIA"
1339 # GOTCHA: the variables below defines the default behavior for autodetection
1340 # and have - unless stated otherwise - at least 2 states : yes no
1341 # If autodetection is available then the third state is: auto
1342 _libavcodec=auto
1343 _amr_nb=auto
1344 _amr_nb_fixed=auto
1345 _amr_wb=auto
1346 _libavcodecs=`grep 'register_avcodec(&[a-z]' libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
1347 _libavcodecso=auto
1348 _libavformat=auto
1349 _fame=auto
1350 _mp1e=no
1351 _mencoder=yes
1352 _x11=auto
1353 _dga=auto # 1 2 no auto
1354 _xv=auto
1355 _xvmc=no #auto when complete
1356 _sdl=auto
1357 _directx=auto
1358 _win32waveout=auto
1359 _nas=auto
1360 _png=auto
1361 _jpg=auto
1362 _pnm=yes
1363 _md5sum=yes
1364 _gif=auto
1365 _gl=auto
1366 _ggi=auto
1367 _ggiwmh=auto
1368 _aa=auto
1369 _caca=auto
1370 _svga=auto
1371 _vesa=auto
1372 _fbdev=auto
1373 _dvb=auto
1374 _dvbhead=auto
1375 _dxr2=auto
1376 _dxr3=auto
1377 _iconv=auto
1378 _langinfo=auto
1379 _rtc=auto
1380 _ossaudio=auto
1381 _arts=auto
1382 _esd=auto
1383 _polyp=auto
1384 _jack=auto
1385 _liblzo=auto
1386 _mad=auto
1387 _toolame=auto
1388 _twolame=auto
1389 _tremor_internal=yes
1390 _tremor_low=no
1391 _vorbis=auto
1392 _theora=auto
1393 _mp3lib=yes
1394 _liba52=yes
1395 _libdts=auto
1396 _libmpeg2=yes
1397 _matroska_internal=yes
1398 _tremor=no
1399 _faad_internal=auto
1400 _faad_external=auto
1401 _faac=auto
1402 _ladspa=auto
1403 _xmms=no
1404 # dvdnav disabled, it does not work
1405 #_dvdnav=no
1406 _dvdread=auto
1407 _dvdkit=auto
1408 _xanim=auto
1409 _real=auto
1410 _live=auto
1411 _xinerama=auto
1412 _mga=auto
1413 _xmga=auto
1414 _vm=auto
1415 _xf86keysym=auto
1416 _mlib=auto
1417 _sgiaudio=auto
1418 _sunaudio=auto
1419 _alsa=auto
1420 _fastmemcpy=yes
1421 _unrarlib=yes
1422 _win32=auto
1423 _dshow=yes
1424 _select=yes
1425 _tv=yes
1426 _tv_v4l=auto
1427 _tv_v4l2=auto
1428 _tv_bsdbt848=auto
1429 _edl=yes
1430 _network=yes
1431 _winsock2=auto
1432 _smbsupport=auto
1433 _vidix=auto
1434 _joystick=no
1435 _xvid=auto
1436 _x264=auto
1437 _divx4linux=auto
1438 _opendivx=no
1439 _lirc=auto
1440 _lircc=auto
1441 _gui=no
1442 _termcap=auto
1443 _termios=auto
1444 _3dfx=no
1445 _tdfxfb=no
1446 _tdfxvid=no
1447 _tga=yes
1448 _directfb=auto
1449 _zr=auto
1450 _bl=no
1451 _largefiles=no
1452 #_language=en
1453 _shm=auto
1454 _linux_devfs=no
1455 #_charset=utf8
1456 _i18n=auto
1457 _dynamic_plugins=no
1458 _crash_debug=auto
1459 _sighandler=yes
1460 _libdv=auto
1461 _cdparanoia=auto
1462 _big_endian=auto
1463 _freetype=auto
1464 _fontconfig=auto
1465 _shared_pp=no
1466 _menu=no
1467 _qtx=auto
1468 _macosx=auto
1469 _macosx_finder_support=no
1470 _macosx_bundle=auto
1471 _sortsub=yes
1472 _freetypeconfig='freetype-config'
1473 _fribidi=no
1474 _fribidiconfig='fribidi-config'
1475 _enca=auto
1476 _inet6=auto
1477 _gethostbyname2=auto
1478 _ftp=yes
1479 _vstream=auto
1480 _pthreads=yes
1481 for ac_option do
1482 case "$ac_option" in
1483 # Skip 1st pass
1484 --target=*) ;;
1485 --cc=*) ;;
1486 --host-cc=*) ;;
1487 --as=*) ;;
1488 --enable-gcc-checking) ;;
1489 --disable-gcc-checking) ;;
1490 --enable-static*) ;;
1491 --disable-static*) ;;
1492 --with-extraincdir=*) ;;
1493 --with-extralibdir=*) ;;
1494 --enable-runtime-cpudetection) ;;
1495 --disable-runtime-cpudetection) ;;
1496 --install-path=*) ;;
1497 --with-install=*) ;;
1499 # Real 2nd pass
1500 --enable-mencoder) _mencoder=yes ;;
1501 --disable-mencoder) _mencoder=no ;;
1502 --enable-i18n) _i18n=yes ;;
1503 --disable-i18n) _i18n=no ;;
1504 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1505 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1506 --enable-x11) _x11=yes ;;
1507 --disable-x11) _x11=no ;;
1508 --enable-xv) _xv=yes ;;
1509 --disable-xv) _xv=no ;;
1510 --enable-xvmc) _xvmc=yes ;;
1511 --disable-xvmc) _xvmc=no ;;
1512 --enable-sdl) _sdl=yes ;;
1513 --disable-sdl) _sdl=no ;;
1514 --enable-directx) _directx=yes ;;
1515 --disable-directx) _directx=no ;;
1516 --enable-win32waveout) _win32waveout=yes ;;
1517 --disable-win32waveout) _win32waveout=no ;;
1518 --enable-nas) _nas=yes ;;
1519 --disable-nas) _nas=no ;;
1520 --enable-png) _png=yes ;;
1521 --disable-png) _png=no ;;
1522 --enable-jpeg) _jpg=yes ;;
1523 --disable-jpeg) _jpg=no ;;
1524 --enable-pnm) _pnm=yes ;;
1525 --disable-pnm) _pnm=no ;;
1526 --enable-md5sum) _md5sum=yes ;;
1527 --disable-md5sum) _md5sum=no ;;
1528 --enable-gif) _gif=yes ;;
1529 --disable-gif) _gif=no ;;
1530 --enable-gl) _gl=yes ;;
1531 --disable-gl) _gl=no ;;
1532 --enable-ggi) _ggi=yes ;;
1533 --disable-ggi) _ggi=no ;;
1534 --enable-ggiwmh) _ggiwmh=yes ;;
1535 --disable-ggiwmh) _ggiwmh=no ;;
1536 --enable-aa) _aa=yes ;;
1537 --disable-aa) _aa=no ;;
1538 --enable-caca) _caca=yes ;;
1539 --disable-caca) _caca=no ;;
1540 --enable-svga) _svga=yes ;;
1541 --disable-svga) _svga=no ;;
1542 --enable-vesa) _vesa=yes ;;
1543 --disable-vesa) _vesa=no ;;
1544 --enable-fbdev) _fbdev=yes ;;
1545 --disable-fbdev) _fbdev=no ;;
1546 --enable-dvb) _dvb=yes ;;
1547 --disable-dvb) _dvb=no ;;
1548 --enable-dvbhead) _dvbhead=yes ;;
1549 --disable-dvbhead) _dvbhead=no ;;
1550 --enable-dxr2) _dxr2=yes ;;
1551 --disable-dxr2) _dxr2=no ;;
1552 --enable-dxr3) _dxr3=yes ;;
1553 --disable-dxr3) _dxr3=no ;;
1554 --enable-iconv) _iconv=yes ;;
1555 --disable-iconv) _iconv=no ;;
1556 --enable-langinfo) _langinfo=yes ;;
1557 --disable-langinfo) _langinfo=no ;;
1558 --enable-rtc) _rtc=yes ;;
1559 --disable-rtc) _rtc=no ;;
1560 --enable-mp1e) _mp1e=yes ;;
1561 --disable-mp1e) _mp1e=no ;;
1562 --enable-libdv) _libdv=yes ;;
1563 --disable-libdv) _libdv=no ;;
1564 --enable-ossaudio) _ossaudio=yes ;;
1565 --disable-ossaudio) _ossaudio=no ;;
1566 --enable-arts) _arts=yes ;;
1567 --disable-arts) _arts=no ;;
1568 --enable-esd) _esd=yes ;;
1569 --disable-esd) _esd=no ;;
1570 --enable-polyp) _polyp=yes ;;
1571 --disable-polyp) _polyp=no ;;
1572 --enable-jack) _jack=yes ;;
1573 --disable-jack) _jack=no ;;
1574 --enable-mad) _mad=yes ;;
1575 --disable-mad) _mad=no ;;
1576 --disable-toolame) _toolame=no ;;
1577 --disable-twolame) _twolame=no ;;
1578 --enable-liblzo) _liblzo=yes ;;
1579 --disable-liblzo) _liblzo=no ;;
1580 --enable-vorbis) _vorbis=yes ;;
1581 --disable-vorbis) _vorbis=no ;;
1582 --enable-internal-tremor) _tremor_internal=yes ;;
1583 --disable-internal-tremor) _tremor_internal=no ;;
1584 --enable-tremor-low) _tremor_low=yes ;;
1585 --disable-tremor-low) _tremor_low=no ;;
1586 --enable-external-tremor) _tremor=yes ;;
1587 --disable-external-tremor) _tremor=no ;;
1588 --enable-theora) _theora=yes ;;
1589 --disable-theora) _theora=no ;;
1590 --enable-mp3lib) _mp3lib=yes ;;
1591 --disable-mp3lib) _mp3lib=no ;;
1592 --enable-liba52) _liba52=yes ;;
1593 --disable-liba52) _liba52=no ;;
1594 --enable-libdts) _libdts=yes ;;
1595 --disable-libdts) _libdts=no ;;
1596 --enable-libmpeg2) _libmpeg2=yes ;;
1597 --disable-libmpeg2) _libmpeg2=no ;;
1598 --enable-internal-matroska) _matroska_internal=yes ;;
1599 --disable-internal-matroska) _matroska_internal=no ;;
1600 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1601 --disable-internal-faad) _faad_internal=no ;;
1602 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1603 --disable-external-faad) _faad_external=no ;;
1604 --enable-faac) _faac=yes ;;
1605 --disable-faac) _faac=no ;;
1606 --enable-ladspa) _ladspa=yes ;;
1607 --disable-ladspa) _ladspa=no ;;
1608 --enable-xmms) _xmms=yes ;;
1609 --disable-xmms) _xmms=no ;;
1610 --enable-dvdread) _dvdread=yes ;;
1611 --disable-dvdread) _dvdread=no ;;
1612 --enable-mpdvdkit) _dvdkit=yes ;;
1613 --disable-mpdvdkit) _dvdkit=no ;;
1614 # dvdnav disabled, it does not work
1615 # --enable-dvdnav) _dvdnav=yes ;;
1616 # --disable-dvdnav) _dvdnav=no ;;
1617 --enable-xanim) _xanim=yes ;;
1618 --disable-xanim) _xanim=no ;;
1619 --enable-real) _real=yes ;;
1620 --disable-real) _real=no ;;
1621 --enable-live) _live=yes ;;
1622 --disable-live) _live=no ;;
1623 --enable-xinerama) _xinerama=yes ;;
1624 --disable-xinerama) _xinerama=no ;;
1625 --enable-mga) _mga=yes ;;
1626 --disable-mga) _mga=no ;;
1627 --enable-xmga) _xmga=yes ;;
1628 --disable-xmga) _xmga=no ;;
1629 --enable-vm) _vm=yes ;;
1630 --disable-vm) _vm=no ;;
1631 --enable-xf86keysym) _xf86keysym=yes ;;
1632 --disable-xf86keysym) _xf86keysym=no ;;
1633 --enable-mlib) _mlib=yes ;;
1634 --disable-mlib) _mlib=no ;;
1635 --enable-sunaudio) _sunaudio=yes ;;
1636 --disable-sunaudio) _sunaudio=no ;;
1637 --enable-sgiaudio) _sgiaudio=yes ;;
1638 --disable-sgiaudio) _sgiaudio=no ;;
1639 --enable-alsa) _alsa=yes ;;
1640 --disable-alsa) _alsa=no ;;
1641 --enable-tv) _tv=yes ;;
1642 --disable-tv) _tv=no ;;
1643 --enable-edl) _edl=yes ;;
1644 --disable-edl) _edl=no ;;
1645 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1646 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1647 --enable-tv-v4l) _tv_v4l=yes ;;
1648 --disable-tv-v4l) _tv_v4l=no ;;
1649 --enable-tv-v4l2) _tv_v4l2=yes ;;
1650 --disable-tv-v4l2) _tv_v4l2=no ;;
1651 --enable-fastmemcpy) _fastmemcpy=yes ;;
1652 --disable-fastmemcpy) _fastmemcpy=no ;;
1653 --enable-network) _network=yes ;;
1654 --disable-network) _network=no ;;
1655 --enable-winsock2) _winsock2=yes ;;
1656 --disable-winsock2) _winsock2=no ;;
1657 --enable-smb) _smbsupport=yes ;;
1658 --disable-smb) _smbsupport=no ;;
1659 --enable-vidix) _vidix=yes ;;
1660 --disable-vidix) _vidix=no ;;
1661 --enable-joystick) _joystick=yes ;;
1662 --disable-joystick) _joystick=no ;;
1663 --enable-xvid) _xvid=yes ;;
1664 --disable-xvid) _xvid=no ;;
1665 --enable-x264) _x264=yes ;;
1666 --disable-x264) _x264=no ;;
1667 --enable-divx4linux) _divx4linux=yes ;;
1668 --disable-divx4linux) _divx4linux=no ;;
1669 --enable-opendivx) _opendivx=yes ;;
1670 --disable-opendivx) _opendivx=no ;;
1671 --enable-libavcodec) _libavcodec=yes ;;
1672 --disable-libavcodec) _libavcodec=no ;;
1673 --enable-amr_nb) _amr_nb=yes ;;
1674 --disable-amr_nb) _amr_nb=no ;;
1675 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1676 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1677 --enable-amr_wb) _amr_wb=yes ;;
1678 --disable-amr_wb) _amr_wb=no ;;
1679 --enable-codec=*) _libavcodecs="$_libavcodecs `echo $ac_option | cut -d '=' -f 2`" ;;
1680 --disable-codec=*) _libavcodecs=`echo $_libavcodecs | sed "s/\`echo $ac_option | cut -d '=' -f 2\`//g"` ;;
1681 --enable-libavformat) _libavformat=yes;;
1682 --disable-libavformat) _libavformat=no ;;
1683 --enable-libfame) _fame=yes ;;
1684 --disable-libfame) _fame=no ;;
1685 --enable-lirc) _lirc=yes ;;
1686 --disable-lirc) _lirc=no ;;
1687 --enable-lircc) _lircc=yes ;;
1688 --disable-lircc) _lircc=no ;;
1689 --enable-gui) _gui=yes ;;
1690 --disable-gui) _gui=no ;;
1691 --enable-termcap) _termcap=yes ;;
1692 --disable-termcap) _termcap=no ;;
1693 --enable-termios) _termios=yes ;;
1694 --disable-termios) _termios=no ;;
1695 --enable-3dfx) _3dfx=yes ;;
1696 --disable-3dfx) _3dfx=no ;;
1697 --enable-tdfxfb) _tdfxfb=yes ;;
1698 --disable-tdfxvid) _tdfxvid=no ;;
1699 --enable-tdfxvid) _tdfxvid=yes ;;
1700 --disable-tga) _tga=no ;;
1701 --enable-tga) _tga=yes ;;
1702 --disable-tdfxfb) _tdfxfb=no ;;
1703 --enable-directfb) _directfb=yes ;;
1704 --disable-directfb) _directfb=no ;;
1705 --enable-zr) _zr=yes ;;
1706 --disable-zr) _zr=no ;;
1707 --enable-bl) _bl=yes ;;
1708 --disable-bl) _bl=no ;;
1709 --enable-mtrr) _mtrr=yes ;;
1710 --disable-mtrr) _mtrr=no ;;
1711 --enable-largefiles) _largefiles=yes ;;
1712 --disable-largefiles) _largefiles=no ;;
1713 --enable-shm) _shm=yes ;;
1714 --disable-shm) _shm=no ;;
1715 --enable-select) _select=yes ;;
1716 --disable-select) _select=no ;;
1717 --enable-linux-devfs) _linux_devfs=yes ;;
1718 --disable-linux-devfs) _linux_devfs=no ;;
1719 --enable-cdparanoia) _cdparanoia=yes ;;
1720 --disable-cdparanoia) _cdparanoia=no ;;
1721 --enable-big-endian) _big_endian=yes ;;
1722 --disable-big-endian) _big_endian=no ;;
1723 --enable-freetype) _freetype=yes ;;
1724 --disable-freetype) _freetype=no ;;
1725 --enable-fontconfig) _fontconfig=yes ;;
1726 --disable-fontconfig) _fontconfig=no ;;
1727 --enable-unrarlib) _unrarlib=yes ;;
1728 --disable-unrarlib) _unrarlib=no ;;
1729 --enable-ftp) _ftp=yes ;;
1730 --disable-ftp) _ftp=no ;;
1731 --enable-vstream) _vstream=yes ;;
1732 --disable-vstream) _vstream=no ;;
1733 --enable-pthreads) _pthreads=yes ;;
1734 --disable-pthreads) _pthreads=no ;;
1736 --enable-fribidi) _fribidi=yes ;;
1737 --disable-fribidi) _fribidi=no ;;
1739 --enable-enca) _enca=yes ;;
1740 --disable-enca) _enca=no ;;
1742 --enable-inet6) _inet6=yes ;;
1743 --disable-inet6) _inet6=no ;;
1745 --enable-gethostbyname2) _gethostbyname2=yes ;;
1746 --disable-gethostbyname2) _gethostbyname2=no ;;
1748 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1749 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1750 --disable-dga) _dga=no ;;
1752 --enable-shared-pp) _shared_pp=yes ;;
1753 --disable-shared-pp) _shared_pp=no ;;
1755 --enable-menu) _menu=yes ;;
1756 --disable-menu) _menu=no ;;
1758 --enable-qtx) _qtx=yes ;;
1759 --disable-qtx) _qtx=no ;;
1761 --enable-macosx) _macosx=yes ;;
1762 --disable-macosx) _macosx=no ;;
1763 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1764 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1765 --enable-macosx-bundle) _macosx_bundle=yes;;
1766 --disable-macosx-bundle) _macosx_bundle=no;;
1768 --enable-sortsub) _sortsub=yes ;;
1769 --disable-sortsub) _sortsub=no ;;
1771 --charset=*)
1772 _charset=`echo $ac_option | cut -d '=' -f 2`
1774 --language=*)
1775 _language=`echo $ac_option | cut -d '=' -f 2`
1777 # dvdnav disabled, it does not work
1778 # --with-libdvdnav=*)
1779 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1780 # _dvdnav=yes
1781 # ;;
1783 --with-codecsdir=*)
1784 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1785 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1786 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1788 --with-win32libdir=*)
1789 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1790 _win32=yes
1792 --with-xanimlibdir=*)
1793 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1794 _xanim=yes
1796 --with-reallibdir=*)
1797 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1798 _real=yes
1800 --with-livelibdir=*)
1801 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
1803 --with-toolamedir=*)
1804 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
1806 --with-mlibdir=*)
1807 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1808 _mlib=yes
1811 --with-xmmslibdir=*)
1812 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
1815 --with-xmmsplugindir=*)
1816 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
1819 --enable-profile)
1820 _profile='-p'
1822 --disable-profile)
1823 _profile=
1825 --enable-debug)
1826 _debug='-g'
1828 --enable-debug=*)
1829 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1831 --disable-debug)
1832 _debug=
1834 --enable-crash-debug)
1835 _crash_debug=yes
1837 --disable-crash-debug)
1838 _crash_debug=no
1840 --enable-sighandler)
1841 _sighandler=yes
1843 --disable-sighandler)
1844 _sighandler=no
1847 --enable-sse) _sse=yes ;;
1848 --disable-sse) _sse=no ;;
1849 --enable-sse2) _sse2=yes ;;
1850 --disable-sse2) _sse2=no ;;
1851 --enable-mmx2) _mmx2=yes ;;
1852 --disable-mmx2) _mmx2=no ;;
1853 --enable-3dnow) _3dnow=yes ;;
1854 --disable-3dnow) _3dnow=no _3dnowex=no ;;
1855 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
1856 --disable-3dnowex) _3dnowex=no ;;
1857 --enable-altivec) _altivec=yes ;;
1858 --disable-altivec) _altivec=no ;;
1859 --enable-mmx) _mmx=yes ;;
1860 --disable-mmx) # 3Dnow! and MMX2 require MMX
1861 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
1863 --enable-win32) _win32=yes ;;
1864 --disable-win32) _win32=no _dshow=no ;;
1865 --enable-dshow) _win32=yes _dshow=yes ;;
1866 --disable-dshow) _dshow=no ;;
1868 --with-x11incdir=*)
1869 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1871 --with-x11libdir=*)
1872 _x11_paths=`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1874 --with-dxr2incdir=*)
1875 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1877 --with-xvmclib=*)
1878 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
1880 --with-dvbincdir=*)
1881 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1883 --with-xvidlibdir=*)
1884 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1886 --with-xvidincdir=*)
1887 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1889 --with-dtslibdir=*)
1890 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1892 --with-dtsincdir=*)
1893 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1895 --with-x264libdir=*)
1896 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1898 --with-x264incdir=*)
1899 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
1901 --with-sdl-config=*)
1902 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
1904 --with-freetype-config=*)
1905 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
1907 --with-fribidi-config=*)
1908 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
1910 --with-gtk-config=*)
1911 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
1913 --with-glib-config=*)
1914 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
1916 # dvdnav disabled, it does not work
1917 # --with-dvdnav-config=*)
1918 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
1919 # ;;
1920 --with-madlibdir=*)
1921 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1923 --with-cdparanoiaincdir=*)
1924 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1926 --with-cdparanoialibdir=*)
1927 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1929 --with-termcaplib=*)
1930 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
1931 _termcap=yes
1933 --prefix=*)
1934 _prefix=`echo $ac_option | cut -d '=' -f 2`
1936 --bindir=*)
1937 _bindir=`echo $ac_option | cut -d '=' -f 2`
1939 --datadir=*)
1940 _datadir=`echo $ac_option | cut -d '=' -f 2`
1942 --mandir=*)
1943 _mandir=`echo $ac_option | cut -d '=' -f 2`
1945 --confdir=*)
1946 _confdir=`echo $ac_option | cut -d '=' -f 2`
1948 --libdir=*)
1949 _libdir=`echo $ac_option | cut -d '=' -f 2`
1953 echo "Unknown parameter: $ac_option"
1954 exit 1
1957 esac
1958 done
1960 # Atmos: moved this here, to be correct, if --prefix is specified
1961 test -z "$_bindir" && _bindir="$_prefix/bin"
1962 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1963 test -z "$_mandir" && _mandir="$_prefix/man"
1964 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1965 test -z "$_libdir" && _libdir="$_prefix/lib"
1966 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
1968 if x86 ; then
1969 # Checking assembler (_as) compatibility...
1970 # Added workaround for older as that reads from stdin by default - atmos
1971 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
1972 echocheck "assembler ($_as $as_version)"
1974 _pref_as_version='2.9.1'
1975 echo 'nop' > $TMPS
1976 if test "$_mmx" = yes ; then
1977 echo 'emms' >> $TMPS
1979 if test "$_3dnow" = yes ; then
1980 _pref_as_version='2.10.1'
1981 echo 'femms' >> $TMPS
1983 if test "$_3dnowex" = yes ; then
1984 _pref_as_version='2.10.1'
1985 echo 'pswapd %mm0, %mm0' >> $TMPS
1987 if test "$_mmx2" = yes ; then
1988 _pref_as_version='2.10.1'
1989 echo 'movntq %mm0, (%eax)' >> $TMPS
1991 if test "$_sse" = yes ; then
1992 _pref_as_version='2.10.1'
1993 echo 'xorps %xmm0, %xmm0' >> $TMPS
1995 #if test "$_sse2" = yes ; then
1996 # _pref_as_version='2.11'
1997 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
1999 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
2001 if test "$as_verc_fail" != yes ; then
2002 echores "ok"
2003 else
2004 echores "failed"
2005 echo "Upgrade binutils to ${_pref_as_version} ..."
2006 die "obsolete binutils version"
2010 if ppc ; then
2012 # check if altivec is supported by the compiler, and how to enable it
2014 _altivec_gcc_flags=''
2016 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
2017 echocheck "GCC altivec support"
2019 p=''
2020 cat > $TMPC << EOF
2021 int main() {
2022 return 0;
2025 FSF_flags='-maltivec -mabi=altivec'
2026 Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
2028 # check for Darwin-style flags first, since
2029 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
2030 # accepts but ignores FSF-style flags...
2032 if test -z "$p"; then
2033 cc_check $Darwin_flags && p='Darwin'
2035 if test -z "$p"; then
2036 cc_check $FSF_flags && p='FSF'
2039 case $p in
2040 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
2041 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
2042 *) _altivec=no ;;
2043 esac
2045 if test -z "$p"; then
2046 p=none
2047 else
2048 p="$p-style ($_altivec_gcc_flags)"
2051 echores "$p"
2054 # check if <altivec.h> should be included
2056 _def_altivec_h='#undef HAVE_ALTIVEC_H'
2058 if test "$_altivec" = yes ; then
2059 echocheck "altivec.h"
2060 cat > $TMPC << EOF
2061 #include <altivec.h>
2062 int main(void) { return 0; }
2064 _have_altivec_h=no
2065 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
2066 if test "$_have_altivec_h" = yes ; then
2067 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
2069 echores "$_have_altivec_h"
2072 # disable runtime cpudetection if
2073 # - we cannot generate altivec code
2074 # - altivec is disabled by the user
2076 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2077 _runtime_cpudetection=no
2080 # show that we are optimizing for altivec (if enabled and supported)
2082 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2083 _optimizing="$_optimizing altivec"
2086 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2088 if test "$_altivec" = yes ; then
2089 _mcpu="$_mcpu $_altivec_gcc_flags"
2092 # setup _def_altivec correctly
2094 if test "$_altivec" = yes ; then
2095 _def_altivec='#define HAVE_ALTIVEC 1'
2096 else
2097 _def_altivec='#undef HAVE_ALTIVEC'
2101 _def_mmx='#undef HAVE_MMX'
2102 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2103 _def_mmx2='#undef HAVE_MMX2'
2104 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
2105 _def_3dnow='#undef HAVE_3DNOW'
2106 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2107 _def_3dnowex='#undef HAVE_3DNOWEX'
2108 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
2109 _def_sse='#undef HAVE_SSE'
2110 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2111 _def_sse2='#undef HAVE_SSE2'
2112 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2114 # Checking kernel version...
2115 if x86 && linux ; then
2116 _k_verc_problem=no
2117 kernel_version=`uname -r 2>&1`
2118 echocheck "$system_name kernel version"
2119 case "$kernel_version" in
2120 '') kernel_version="?.??"; _k_verc_fail=yes;;
2121 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2122 _k_verc_problem=yes;;
2123 esac
2124 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2125 _k_verc_fail=yes
2127 if test "$_k_verc_fail" ; then
2128 echores "$kernel_version, fail"
2129 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2130 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2131 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2132 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2133 echo "2.2.x you must upgrade it to get SSE support!"
2134 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2135 else
2136 echores "$kernel_version, ok"
2140 if test "$_vidix" = auto ; then
2141 _vidix=no
2142 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2143 x86 && _vidix=yes
2144 ppc && linux && _vidix=yes
2145 alpha && linux && _vidix=yes
2146 qnx && _vidix=no
2147 sunos && _vidix=no
2148 beos && _vidix=no
2151 echocheck "mplayer binary name"
2152 if win32 ; then
2153 _prg="mplayer.exe"
2154 _prg_mencoder="mencoder.exe"
2155 else
2156 _prg="mplayer"
2157 _prg_mencoder="mencoder"
2159 echores $_prg
2162 # On QNX we must link to libph - Gabucino
2163 if qnx ; then
2164 _ld_arch="$_ld_arch -lph"
2167 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2168 _awk=
2169 if test "$_vidix" = yes ; then
2170 _awk_verc_fail=yes
2171 echocheck "awk"
2172 for _awk in mawk gawk nawk awk; do
2173 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2174 _awk_verc_fail=no
2175 break
2177 done
2178 test "$_awk_verc_fail" = yes && _awk=no
2179 echores "$_awk"
2180 if test "$_awk_verc_fail" = yes; then
2181 echo "VIDIX needs awk, but no working implementation was found!"
2182 echo "Try the GNU version, which can be downloaded from:"
2183 echo "ftp://ftp.gnu.org/gnu/gawk/"
2184 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2185 die "no awk"
2189 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2190 if irix ; then
2191 _ranlib='ar -r'
2192 elif linux ; then
2193 _ranlib='true'
2196 ######################
2197 # MAIN TESTS GO HERE #
2198 ######################
2201 echocheck "extra headers"
2202 if test "$_inc_extra" ; then
2203 echores "$_inc_extra"
2204 else
2205 echores "none"
2209 echocheck "extra libs"
2210 if test "$_ld_extra" ; then
2211 echores "$_ld_extra"
2212 else
2213 echores "none"
2216 echocheck "-lposix"
2217 cat > $TMPC <<EOF
2218 int main(void) { return 0; }
2220 if cc_check -lposix ; then
2221 _ld_arch="$_ld_arch -lposix"
2222 echores "yes"
2223 else
2224 echores "no"
2227 echocheck "-lm"
2228 cat > $TMPC <<EOF
2229 int main(void) { return 0; }
2231 if cc_check -lm ; then
2232 _ld_lm="-lm"
2233 echores "yes"
2234 else
2235 _ld_lm=""
2236 echores "no"
2239 # Checking for localization ...
2240 # CSAK EGY MARADHAT - A HEGYLAKO
2241 echocheck "i18n"
2242 if test "$_i18n" != no ; then
2243 cat > $TMPC <<EOF
2244 #include <libintl.h>
2245 int main(void) { gettext("test"); return 0; }
2247 _i18n=no
2248 _i18n_libs=""
2249 if test "$_i18n" = auto ; then
2250 cc_check && _i18n=yes
2251 else
2252 for i18n_lib in "" "-lintl"; do
2253 cc_check $i18n_lib && _i18n=yes && _i18n_libs=$i18n_lib && break
2254 done
2257 if test "$_i18n" = yes ; then
2258 _def_i18n='#define USE_I18N 1'
2259 else
2260 _def_i18n='#undef USE_I18N'
2262 if test -z "$_i18n_libs" ; then
2263 echores "$_i18n"
2264 else
2265 echores "$_i18n (using $_i18n_libs)"
2269 echocheck "iconv"
2270 if test "$_iconv" = auto ; then
2271 _iconv_tmp='#include <iconv.h>'
2273 cat > $TMPC << EOF
2274 #include <stdio.h>
2275 #include <unistd.h>
2276 $_iconv_tmp
2277 #define INBUFSIZE 1024
2278 #define OUTBUFSIZE 4096
2280 char inbuffer[INBUFSIZE];
2281 char outbuffer[OUTBUFSIZE];
2283 int main(void) {
2284 size_t numread;
2285 iconv_t icdsc;
2286 char *tocode="UTF-8";
2287 char *fromcode="cp1250";
2288 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2289 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2290 char *iptr=inbuffer;
2291 char *optr=outbuffer;
2292 size_t inleft=numread;
2293 size_t outleft=OUTBUFSIZE;
2294 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2295 != (size_t)(-1)) {
2296 write (1, outbuffer, OUTBUFSIZE - outleft);
2299 if (iconv_close(icdsc) == -1)
2304 _iconv=no
2305 if cc_check $_ld_lm ; then
2306 _iconv=yes
2307 elif cc_check $_ld_lm -liconv ; then
2308 _iconv=yes
2309 _ld_iconv='-liconv'
2312 if test "$_iconv" = yes ; then
2313 _def_iconv='#define USE_ICONV 1'
2314 else
2315 _def_iconv='#undef USE_ICONV'
2317 echores "$_iconv"
2320 echocheck "langinfo"
2321 if test "$_langinfo" = auto ; then
2322 cat > $TMPC <<EOF
2323 #include <langinfo.h>
2324 int main(void) { nl_langinfo(CODESET); return 0; }
2326 _langinfo=no
2327 cc_check && _langinfo=yes
2329 if test "$_langinfo" = yes ; then
2330 _def_langinfo='#define USE_LANGINFO 1'
2331 else
2332 _def_langinfo='#undef USE_LANGINFO'
2334 echores "$_langinfo"
2337 echocheck "language"
2338 test -z "$_language" && _language=$LINGUAS
2339 _language=`echo $_language | sed 's/,/ /g'`
2340 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2341 for lang in $_language ; do
2342 test "$lang" = all && lang=en
2343 if test -f "help/help_mp-${lang}.h" ; then
2344 _language=$lang
2345 break
2346 else
2347 echo -n "$lang not found, "
2348 _language=`echo $_language | sed "s/$lang *//"`
2350 done
2351 test -z "$_language" && _language=en
2352 _mp_help="help/help_mp-${_language}.h"
2353 test -f $_mp_help || die "$_mp_help not found"
2354 for lang in $LANGUAGES ; do
2355 if test -f "DOCS/man/$lang/mplayer.1" ; then
2356 MAN_LANG="$MAN_LANG $lang"
2358 done
2359 _doc_lang=$_language
2360 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2361 echores "using $_language (man pages: $MAN_LANG)"
2364 echocheck "enable sighandler"
2365 if test "$_sighandler" = yes ; then
2366 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2367 else
2368 _def_sighandler='#undef ENABLE_SIGHANDLER'
2370 echores "$_sighandler"
2372 echocheck "runtime cpudetection"
2373 if test "$_runtime_cpudetection" = yes ; then
2374 _optimizing="Runtime CPU-Detection enabled"
2375 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2376 else
2377 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2379 echores "$_runtime_cpudetection"
2382 echocheck "restrict keyword"
2383 for restrict_keyword in restrict __restrict __restrict__ ; do
2384 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2385 if cc_check; then
2386 _def_restrict_keyword=$restrict_keyword
2387 break;
2389 done
2390 if [ -n "$_def_restrict_keyword" ]; then
2391 echores "$_def_restrict_keyword"
2392 else
2393 echores "none"
2395 # Avoid infinite recursion loop ("#define restrict restrict")
2396 if [ "$_def_restrict_keyword" != "restrict" ]; then
2397 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2398 else
2399 _def_restrict_keyword=""
2403 echocheck "__builtin_expect"
2404 # GCC branch prediction hint
2405 cat > $TMPC << EOF
2406 int foo (int a) {
2407 a = __builtin_expect (a, 10);
2408 return a == 10 ? 0 : 1;
2410 int main() { return foo(10) && foo(0); }
2412 _builtin_expect=no
2413 cc_check && _builtin_expect=yes
2414 if test "$_builtin_expect" = yes ; then
2415 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2416 else
2417 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2419 echores "$_builtin_expect"
2422 echocheck "kstat"
2423 cat > $TMPC << EOF
2424 #include <kstat.h>
2425 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2427 _kstat=no
2428 cc_check -lkstat && _kstat=yes
2429 if test "$_kstat" = yes ; then
2430 _ld_arch="-lkstat $_ld_arch"
2432 if test "$_kstat" = yes ; then
2433 _def_kstat="#define HAVE_LIBKSTAT 1"
2434 else
2435 _def_kstat="#undef HAVE_LIBKSTAT"
2437 echores "$_kstat"
2440 echocheck "posix4"
2441 # required for nanosleep on some systems
2442 cat > $TMPC << EOF
2443 #include <time.h>
2444 int main(void) { (void) nanosleep(0, 0); return 0; }
2446 _posix4=no
2447 cc_check -lposix4 && _posix4=yes
2448 if test "$_posix4" = yes ; then
2449 _ld_arch="-lposix4 $_ld_arch"
2451 echores "$_posix4"
2453 echocheck "-std=gnu99"
2454 cat > $TMPC << EOF
2455 int main(void) { return 0; }
2457 _gnu99=no
2458 cc_check -std=gnu99 && _gnu99=yes
2459 if test "$_gnu99" = yes ; then
2460 _opt_gnu99="-std=gnu99"
2461 else
2462 _opt_gnu99=""
2464 echores "$_gnu99"
2466 echocheck "lrintf"
2467 cat > $TMPC << EOF
2468 #include <math.h>
2469 int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
2471 _lrintf=no
2472 cc_check $_opt_gnu99 -D_GNU_SOURCE $_ld_lm && _lrintf=yes
2473 if test "$_lrintf" = yes ; then
2474 _def_lrintf="#define HAVE_LRINTF 1"
2475 else
2476 _def_lrintf="#undef HAVE_LRINTF"
2478 echores "$_lrintf"
2480 echocheck "round"
2481 cat > $TMPC << EOF
2482 #include <math.h>
2483 int main(void) { (void) round(0.0); return 0; }
2485 _round=no
2486 cc_check $_ld_lm && _round=yes
2487 if test "$_round" = yes ; then
2488 _def_round="#define HAVE_ROUND 1"
2489 else
2490 _def_round="#undef HAVE_ROUND"
2492 echores "$_round"
2494 echocheck "nanosleep"
2495 # also check for nanosleep
2496 cat > $TMPC << EOF
2497 #include <time.h>
2498 int main(void) { (void) nanosleep(0, 0); return 0; }
2500 _nanosleep=no
2501 cc_check $_ld_arch && _nanosleep=yes
2502 if test "$_nanosleep" = yes ; then
2503 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2504 else
2505 _def_nanosleep='#undef HAVE_NANOSLEEP'
2507 echores "$_nanosleep"
2510 echocheck "socklib"
2511 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2512 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2513 cat > $TMPC << EOF
2514 #include <netdb.h>
2515 int main(void) { (void) gethostbyname(0); return 0; }
2517 cc_check -lsocket && _ld_sock="-lsocket"
2518 cc_check -lnsl && _ld_sock="-lnsl"
2519 cc_check -lsocket -lnsl && _ld_sock="-lsocket -lnsl"
2520 cc_check -lsocket -ldnet && _ld_sock="-lsocket -ldnet"
2521 cc_check -lsocket -lbind && _ld_sock="-lsocket -lbind"
2522 if test $_winsock2 = auto && not cygwin ; then
2523 _winsock2=no
2524 cat > $TMPC << EOF
2525 #include <winsock2.h>
2526 int main(void) { (void) gethostbyname(0); return 0; }
2528 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2530 if test "$_ld_sock" ; then
2531 echores "yes (using $_ld_sock)"
2532 else
2533 echores "no"
2537 if test $_winsock2 = yes ; then
2538 _ld_sock="-lws2_32"
2539 _def_winsock2='#define HAVE_WINSOCK2 1'
2540 else
2541 _def_winsock2='#undef HAVE_WINSOCK2'
2545 _use_aton=no
2546 echocheck "inet_pton()"
2547 cat > $TMPC << EOF
2548 #include <sys/types.h>
2549 #include <sys/socket.h>
2550 #include <arpa/inet.h>
2551 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2553 if test "$_winsock2" = yes ; then
2554 echores "not needed (using winsock2 functions)"
2555 elif cc_check $_ld_sock ; then
2556 # NOTE: Linux has libresolv but does not need it
2558 echores "yes (using $_ld_sock)"
2559 elif cc_check $_ld_sock -lresolv ; then
2560 # NOTE: needed for SunOS at least
2561 _ld_sock="$_ld_sock -lresolv"
2562 echores "yes (using $_ld_sock)"
2563 else
2564 echores "no (=> i'll try inet_aton next)"
2566 echocheck "inet_aton()"
2567 cat > $TMPC << EOF
2568 #include <sys/types.h>
2569 #include <sys/socket.h>
2570 #include <arpa/inet.h>
2571 int main(void) { (void) inet_aton(0, 0); return 0; }
2573 _use_aton=yes
2574 if cc_check $_ld_sock ; then
2575 # NOTE: Linux has libresolv but does not need it
2577 echores "yes (using $_ld_sock)"
2578 elif cc_check $_ld_sock -lresolv ; then
2579 # NOTE: needed for SunOS at least
2580 _ld_sock="$_ld_sock -lresolv"
2581 echores "yes (using $_ld_sock)"
2582 else
2583 _use_aton=no
2584 _network=no
2585 echores "no (=> network support disabled)"
2589 _def_use_aton='#undef USE_ATON'
2590 if test "$_use_aton" != no; then
2591 _def_use_aton='#define USE_ATON 1'
2595 echocheck "inttypes.h (required)"
2596 cat > $TMPC << EOF
2597 #include <inttypes.h>
2598 int main(void) { return 0; }
2600 _inttypes=no
2601 cc_check && _inttypes=yes
2602 if test "$_inttypes" = yes ; then
2603 # nothing to do
2605 else
2606 echores "no"
2607 echocheck "bitypes.h (inttypes.h predecessor)"
2608 cat > $TMPC << EOF
2609 #include <sys/bitypes.h>
2610 int main(void) { return 0; }
2612 _inttypes=no
2613 cc_check && _inttypes=yes
2614 if test "$_inttypes" = yes ; then
2615 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."
2616 else
2617 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2620 echores "$_inttypes"
2623 echocheck "int_fastXY_t in inttypes.h"
2624 cat > $TMPC << EOF
2625 #include <inttypes.h>
2626 int main(void) {
2627 volatile int_fast16_t v= 0;
2628 return v; }
2630 _fast_inttypes=no
2631 cc_check && _fast_inttypes=yes
2632 if test "$_fast_inttypes" = yes ; then
2633 # nothing to do
2635 else
2636 _def_fast_inttypes='
2637 typedef signed char int_fast8_t;
2638 typedef signed int int_fast16_t;
2639 typedef signed int int_fast32_t;
2640 typedef unsigned char uint_fast8_t;
2641 typedef unsigned int uint_fast16_t;
2642 typedef unsigned int uint_fast32_t;'
2644 echores "$_fast_inttypes"
2647 echocheck "word size"
2648 _mp_wordsize="#undef MP_WORDSIZE"
2649 cat > $TMPC << EOF
2650 #include <stdio.h>
2651 #include <sys/types.h>
2652 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2654 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2655 echores "$_wordsize"
2658 echocheck "stddef.h"
2659 cat > $TMPC << EOF
2660 #include <stddef.h>
2661 int main(void) { return 0; }
2663 _stddef=no
2664 cc_check && _stddef=yes
2665 if test "$_stddef" = yes ; then
2666 _def_stddef='#define HAVE_STDDEF_H 1'
2667 else
2668 _def_stddef='#undef HAVE_STDDEF_H'
2670 echores "$_stddef"
2673 echocheck "malloc.h"
2674 cat > $TMPC << EOF
2675 #include <malloc.h>
2676 int main(void) { (void) malloc(0); return 0; }
2678 _malloc=no
2679 cc_check && _malloc=yes
2680 if test "$_malloc" = yes ; then
2681 _def_malloc='#define HAVE_MALLOC_H 1'
2682 else
2683 _def_malloc='#undef HAVE_MALLOC_H'
2685 # malloc.h emits a warning in FreeBSD and OpenBSD
2686 (freebsd || openbsd) && _def_malloc='#undef HAVE_MALLOC_H'
2687 echores "$_malloc"
2690 echocheck "memalign()"
2691 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2692 cat > $TMPC << EOF
2693 #include <malloc.h>
2694 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2696 _memalign=no
2697 cc_check && _memalign=yes
2698 if test "$_memalign" = yes ; then
2699 _def_memalign='#define HAVE_MEMALIGN 1'
2700 else
2701 _def_memalign='#undef HAVE_MEMALIGN'
2703 echores "$_memalign"
2706 echocheck "alloca.h"
2707 cat > $TMPC << EOF
2708 #include <alloca.h>
2709 int main(void) { (void) alloca(0); return 0; }
2711 _alloca=no
2712 cc_check && _alloca=yes
2713 if cc_check ; then
2714 _def_alloca='#define HAVE_ALLOCA_H 1'
2715 else
2716 _def_alloca='#undef HAVE_ALLOCA_H'
2718 echores "$_alloca"
2721 echocheck "mman.h"
2722 cat > $TMPC << EOF
2723 #include <sys/types.h>
2724 #include <sys/mman.h>
2725 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2727 _mman=no
2728 cc_check && _mman=yes
2729 if test "$_mman" = yes ; then
2730 _def_mman='#define HAVE_SYS_MMAN_H 1'
2731 else
2732 _def_mman='#undef HAVE_SYS_MMAN_H'
2734 echores "$_mman"
2736 cat > $TMPC << EOF
2737 #include <sys/types.h>
2738 #include <sys/mman.h>
2739 int main(void) { void *p = MAP_FAILED; return 0; }
2741 _mman_has_map_failed=no
2742 cc_check && _mman_has_map_failed=yes
2743 if test "$_mman_has_map_failed" = yes ; then
2744 _def_mman_has_map_failed=''
2745 else
2746 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2749 echocheck "dynamic loader"
2750 cat > $TMPC << EOF
2751 #include <dlfcn.h>
2752 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2754 _dl=no
2755 if cc_check ; then
2756 _dl=yes
2757 elif cc_check -ldl ; then
2758 _dl=yes
2759 _ld_dl='-ldl'
2761 if test "$_dl" = yes ; then
2762 _def_dl='#define HAVE_LIBDL 1'
2763 else
2764 _def_dl='#undef HAVE_LIBDL'
2766 echores "$_dl"
2769 echocheck "dynamic a/v plugins support"
2770 if test "$_dl" = no ; then
2771 _dynamic_plugins=no
2773 if test "$_dynamic_plugins" = yes ; then
2774 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2775 else
2776 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2778 echores "$_dynamic_plugins"
2781 #echocheck "dynamic linking"
2782 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2783 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2784 #cat > $TMPC << EOF
2785 #int main(void) { return 0; }
2786 #EOF
2787 #if cc_check -rdynamic ; then
2788 # _ld_dl_dynamic='-rdynamic'
2789 #elif cc_check -Bdynamic ; then
2790 # _ld_dl_dynamic='-Bdynamic'
2791 #elif cc_check ; then
2792 # _ld_dl_dynamic=''
2794 #echores "using $_ld_dl_dynamic"
2796 _def_threads='#undef HAVE_THREADS'
2798 echocheck "pthread"
2799 _ld_pthread=''
2800 if test "$_pthreads" != no ; then
2801 cat > $TMPC << EOF
2802 #include <pthread.h>
2803 void* func(void *arg) { return arg; }
2804 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2806 if hpux ; then
2807 _ld_pthread=''
2808 elif ( cc_check -lpthreadGC2 && $TMPO ) ; then # mingw pthreads-win32
2809 _ld_pthread='-lpthreadGC2'
2810 elif ( cc_check && $TMPO ) ; then # QNX
2811 _ld_pthread=' ' # _ld_pthread='' would disable pthreads, but the test worked
2812 elif ( cc_check -lpthread && $TMPO ) ; then
2813 _ld_pthread='-lpthread'
2814 elif ( cc_check -pthread && $TMPO ) ; then
2815 _ld_pthread='-pthread'
2816 else
2817 if test "$_ld_static" ; then
2818 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2819 if ( cc_check -lpthread ) ; then
2820 _ld_pthread='-lpthread'
2821 elif ( cc_check -pthread ) ; then
2822 _ld_pthread='-pthread'
2823 else
2824 _ld_pthread=''
2826 else
2827 _ld_pthread=''
2831 if test "$_ld_pthread" != '' ; then
2832 echores "yes (using $_ld_pthread)"
2833 _pthreads='yes'
2834 _def_pthreads='#define HAVE_PTHREADS 1'
2835 _def_threads='#define HAVE_THREADS 1'
2836 else
2837 echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
2838 _pthreads=''
2839 _def_pthreads='#undef HAVE_PTHREADS'
2840 _nas=no ; _tv_v4l=no ; _macosx=no
2841 if not mingw32 ; then
2842 _win32=no
2847 echocheck "sys/soundcard.h"
2848 cat > $TMPC << EOF
2849 #include <sys/soundcard.h>
2850 int main(void) { return 0; }
2852 _sys_soundcard=no
2853 cc_check && _sys_soundcard=yes
2854 if test "$_sys_soundcard" = yes ; then
2855 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2856 _inc_soundcard='#include <sys/soundcard.h>'
2857 else
2858 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2860 echores "$_sys_soundcard"
2862 if test "$_sys_soundcard" != yes ; then
2863 echocheck "soundcard.h"
2864 cat > $TMPC << EOF
2865 #include <soundcard.h>
2866 int main(void) { return 0; }
2868 _soundcard=no
2869 cc_check && _soundcard=yes
2870 if linux || test "$_ossaudio" != no ; then
2871 # use soundcard.h on Linux, or when OSS support is enabled
2872 echores "$_soundcard"
2873 else
2874 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
2875 echores "$_soundcard, but ignored!"
2876 _soundcard=no
2878 if test "$_soundcard" = yes ; then
2879 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
2880 _inc_soundcard='#include <soundcard.h>'
2881 else
2882 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2884 else
2885 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2889 echocheck "sys/dvdio.h"
2890 cat > $TMPC << EOF
2891 #include <unistd.h>
2892 #include <sys/dvdio.h>
2893 int main(void) { return 0; }
2895 _dvdio=no
2896 cc_check && _dvdio=yes
2897 if test "$_dvdio" = yes ; then
2898 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2899 else
2900 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2902 echores "$_dvdio"
2905 echocheck "sys/cdio.h"
2906 cat > $TMPC << EOF
2907 #include <unistd.h>
2908 #include <sys/cdio.h>
2909 int main(void) { return 0; }
2911 _cdio=no
2912 cc_check && _cdio=yes
2913 if test "$_cdio" = yes ; then
2914 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2915 else
2916 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2918 echores "$_cdio"
2921 echocheck "linux/cdrom.h"
2922 cat > $TMPC << EOF
2923 #include <sys/types.h>
2924 #include <linux/cdrom.h>
2925 int main(void) { return 0; }
2927 _cdrom=no
2928 cc_check && _cdrom=yes
2929 if test "$_cdrom" = yes ; then
2930 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2931 else
2932 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2934 echores "$_cdrom"
2937 echocheck "dvd.h"
2938 cat > $TMPC << EOF
2939 #include <dvd.h>
2940 int main(void) { return 0; }
2942 _dvd=no
2943 cc_check && _dvd=yes
2944 if test "$_dvd" = yes ; then
2945 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
2946 else
2947 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
2949 echores "$_dvd"
2952 echocheck "BSDI dvd.h"
2953 cat > $TMPC << EOF
2954 #include <dvd.h>
2955 int main(void) { return 0; }
2957 _bsdi_dvd=no
2958 cc_check && _bsdi_dvd=yes
2959 if test "$_bsdi_dvd" = yes ; then
2960 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2961 else
2962 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2964 echores "$_bsdi_dvd"
2967 echocheck "HPUX SCSI header"
2968 cat > $TMPC << EOF
2969 #include <sys/scsi.h>
2970 int main(void) { return 0; }
2972 _hpux_scsi_h=no
2973 cc_check && _hpux_scsi_h=yes
2974 if test "$_hpux_scsi_h" = yes ; then
2975 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
2976 else
2977 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
2979 echores "$_hpux_scsi_h"
2982 echocheck "userspace SCSI headers (Solaris)"
2983 cat > $TMPC << EOF
2984 # include <unistd.h>
2985 # include <stropts.h>
2986 # include <sys/scsi/scsi_types.h>
2987 # include <sys/scsi/impl/uscsi.h>
2988 int main(void) { return 0; }
2990 _sol_scsi_h=no
2991 cc_check && _sol_scsi_h=yes
2992 if test "$_sol_scsi_h" = yes ; then
2993 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
2994 else
2995 _def_sol_scsi_h='#undef SOLARIS_USCSI'
2997 echores "$_sol_scsi_h"
3000 echocheck "termcap"
3001 if test "$_termcap" = auto ; then
3002 cat > $TMPC <<EOF
3003 int main(void) { return 0; }
3005 _termcap=no
3006 cc_check -ltermcap && _termcap=yes && _ld_termcap='-ltermcap'
3007 cc_check -ltinfo && _termcap=yes && _ld_termcap='-ltinfo'
3009 if test "$_termcap" = yes ; then
3010 _def_termcap='#define USE_TERMCAP 1'
3011 echores "yes (using $_ld_termcap)"
3012 else
3013 _def_termcap='#undef USE_TERMCAP'
3014 echores no
3018 echocheck "termios"
3019 if test "$_termios" = auto ; then
3020 cat > $TMPC <<EOF
3021 #include <sys/termios.h>
3022 int main(void) { return 0; }
3024 _termios=auto
3025 cc_check && _termios=yes
3026 _def_termios_h_name='sys/termios.h'
3028 # second test:
3029 if test "$_termios" = auto ; then
3030 cat > $TMPC <<EOF
3031 #include <termios.h>
3032 int main(void) { return 0; }
3034 _termios=no
3035 cc_check && _termios=yes
3036 _def_termios_h_name='termios.h'
3039 if test "$_termios" = yes ; then
3040 _def_termios='#define HAVE_TERMIOS 1'
3041 _def_termios_h='#undef HAVE_TERMIOS_H'
3042 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3044 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
3045 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3046 elif test "$_def_termios_h_name" = 'termios.h' ; then
3047 _def_termios_h='#define HAVE_TERMIOS_H 1'
3049 echores "yes (using $_def_termios_h_name)"
3050 else
3051 _def_termios='#undef HAVE_TERMIOS'
3052 _def_termios_h_name=''
3053 echores "no"
3057 echocheck "shm"
3058 if test "$_shm" = auto ; then
3059 cat > $TMPC << EOF
3060 #include <sys/types.h>
3061 #include <sys/shm.h>
3062 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3064 _shm=no
3065 cc_check && _shm=yes
3067 if test "$_shm" = yes ; then
3068 _def_shm='#define HAVE_SHM 1'
3069 else
3070 _def_shm='#undef HAVE_SHM'
3072 echores "$_shm"
3075 # XXX: FIXME, add runtime checking
3076 echocheck "linux devfs"
3077 echores "$_linux_devfs"
3080 echocheck "scandir()"
3081 cat > $TMPC << EOF
3082 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
3084 _scandir=no
3085 cc_check && _scandir=yes
3086 if test "$_scandir" = yes ; then
3087 _def_scandir='#define HAVE_SCANDIR 1'
3088 else
3089 _def_scandir='#undef HAVE_SCANDIR'
3091 echores "$_scandir"
3094 echocheck "strsep()"
3095 cat > $TMPC << EOF
3096 #include <string.h>
3097 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3099 _strsep=no
3100 cc_check && _strsep=yes
3101 if test "$_strsep" = yes ; then
3102 _def_strsep='#define HAVE_STRSEP 1'
3103 else
3104 _def_strsep='#undef HAVE_STRSEP'
3106 echores "$_strsep"
3108 echocheck "strlcpy()"
3109 cat > $TMPC << EOF
3110 #include <string.h>
3111 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3113 _strlcpy=no
3114 cc_check && _strlcpy=yes
3115 if test "$_strlcpy" = yes ; then
3116 _def_strlcpy='#define HAVE_STRLCPY 1'
3117 else
3118 _def_strlcpy='#undef HAVE_STRLCPY'
3120 echores "$_strlcpy"
3122 echocheck "strlcat()"
3123 cat > $TMPC << EOF
3124 #include <string.h>
3125 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3127 _strlcat=no
3128 cc_check && _strlcat=yes
3129 if test "$_strlcat" = yes ; then
3130 _def_strlcat='#define HAVE_STRLCAT 1'
3131 else
3132 _def_strlcat='#undef HAVE_STRLCAT'
3134 echores "$_strlcat"
3136 echocheck "fseeko()"
3137 cat > $TMPC << EOF
3138 #include <stdio.h>
3139 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3141 _fseeko=no
3142 cc_check && _fseeko=yes
3143 if test "$_fseeko" = yes ; then
3144 _def_fseeko='#define HAVE_FSEEKO 1'
3145 else
3146 _def_fseeko='#undef HAVE_FSEEKO'
3148 echores "$_fseeko"
3150 echocheck "localtime_r()"
3151 cat > $TMPC << EOF
3152 #include <time.h>
3153 int main( void ) { localtime_r(NULL, NULL); }
3155 _localtime_r=no
3156 cc_check && _localtime_r=yes
3157 if test "$_localtime_r" = yes ; then
3158 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3159 else
3160 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3162 echores "$_localtime_r"
3164 echocheck "vsscanf()"
3165 cat > $TMPC << EOF
3166 #include <stdarg.h>
3167 int main(void) { vsscanf(0, 0, 0); return 0; }
3169 _vsscanf=no
3170 cc_check && _vsscanf=yes
3171 if test "$_vsscanf" = yes ; then
3172 _def_vsscanf='#define HAVE_VSSCANF 1'
3173 else
3174 _def_vsscanf='#undef HAVE_VSSCANF'
3176 echores "$_vsscanf"
3179 echocheck "swab()"
3180 cat > $TMPC << EOF
3181 #include <unistd.h>
3182 int main(void) { swab(0, 0, 0); return 0; }
3184 _swab=no
3185 cc_check && _swab=yes
3186 if test "$_swab" = yes ; then
3187 _def_swab='#define HAVE_SWAB 1'
3188 else
3189 _def_swab='#undef HAVE_SWAB'
3191 echores "$_swab"
3193 echocheck "posix select()"
3194 cat > $TMPC << EOF
3195 #include <stdio.h>
3196 #include <stdlib.h>
3197 #include <sys/types.h>
3198 #include <string.h>
3199 #include <sys/time.h>
3200 #include <unistd.h>
3201 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3203 _posix_select=no
3204 cc_check && _posix_select=yes
3205 if test "$_posix_select" = no ; then
3206 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3207 else
3208 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3210 echores "$_posix_select"
3213 echocheck "gettimeofday()"
3214 cat > $TMPC << EOF
3215 #include <stdio.h>
3216 #include <sys/time.h>
3217 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3219 _gettimeofday=no
3220 cc_check && _gettimeofday=yes
3221 if test "$_gettimeofday" = yes ; then
3222 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3223 else
3224 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3226 echores "$_gettimeofday"
3229 echocheck "glob()"
3230 cat > $TMPC << EOF
3231 #include <stdio.h>
3232 #include <glob.h>
3233 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3235 _glob=no
3236 cc_check && _glob=yes
3237 if test "$_glob" = yes ; then
3238 _def_glob='#define HAVE_GLOB 1'
3239 else
3240 _def_glob='#undef HAVE_GLOB'
3242 echores "$_glob"
3245 echocheck "sys/sysinfo.h"
3246 cat > $TMPC << EOF
3247 #include <sys/sysinfo.h>
3248 int main(void) {
3249 struct sysinfo s_info;
3250 sysinfo(&s_info);
3251 return 0;
3254 _sys_sysinfo=no
3255 cc_check && _sys_sysinfo=yes
3256 if test "$_sys_sysinfo" = yes ; then
3257 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3258 _inc_sysinfo='#include <sys/sysinfo.h>'
3259 else
3260 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3262 echores "$_sys_sysinfo"
3265 echocheck "Mac OS X APIs"
3266 if test "$_macosx" = auto ; then
3267 if darwin && ppc; then
3268 _macosx=yes
3269 else
3270 _macosx=no
3271 _def_macosx='#undef MACOSX'
3272 _noaomodules="macosx $_noaomodules"
3273 _novomodules="quartz $_novomodules"
3276 if test "$_macosx" = yes ; then
3277 cat > $TMPC <<EOF
3278 #include <Carbon/Carbon.h>
3279 #include <QuickTime/QuickTime.h>
3280 #include <CoreAudio/CoreAudio.h>
3281 int main(void) {
3282 EnterMovies();
3283 ExitMovies();
3284 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3287 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3288 _macosx=yes
3289 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
3290 _def_macosx='#define MACOSX 1'
3291 _aosrc="$_aosrc ao_macosx.c"
3292 _aomodules="macosx $_aomodules"
3293 _vosrc="$_vosrc vo_quartz.c"
3294 _vomodules="quartz $_vomodules"
3295 else
3296 _macosx=no
3297 _def_macosx='#undef MACOSX'
3298 _noaomodules="macosx $_noaomodules"
3299 _novomodules="quartz $_novomodules"
3301 cat > $TMPC <<EOF
3302 #include <Carbon/Carbon.h>
3303 #include <QuartzCore/CoreVideo.h>
3304 int main(void) {}
3306 if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
3307 _vosrc="$_vosrc vo_macosx.m"
3308 _vomodules="macosx $_vomodules"
3309 _macosx_frameworks="$_macosx_frameworks -framework Cocoa -framework QuartzCore -framework OpenGL"
3310 _def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
3311 _macosx_corevideo=yes
3312 else
3313 _novomodules="macosx $_novomodules"
3314 _def_macosx_corevideo='#undef MACOSX_COREVIDEO'
3315 _macosx_corevideo=no
3318 echores "$_macosx"
3320 echocheck "Mac OS X Finder Support"
3321 if test "$_macosx_finder_support" = auto ; then
3322 _macosx_finder_support=$_macosx
3324 if test "$_macosx_finder_support" = yes; then
3325 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3326 _macosx_finder_support=yes
3327 else
3328 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3329 _macosx_finder_support=no
3331 echores "$_macosx_finder_support"
3333 echocheck "Mac OS X Bundle file locations"
3334 if test "$_macosx_bundle" = auto ; then
3335 _macosx_bundle=$_macosx_finder_support
3337 if test "$_macosx_bundle" = yes; then
3338 _def_macosx_bundle='#define MACOSX_BUNDLE 1'
3339 else
3340 _def_macosx_bundle='#undef MACOSX_BUNDLE'
3341 _macosx_bundle=no
3343 echores "$_macosx_bundle"
3345 echocheck "Samba support (libsmbclient)"
3346 if test "$_smbsupport" = yes; then
3347 _ld_smb="-lsmbclient"
3349 if test "$_smbsupport" = auto; then
3350 _smbsupport=no
3351 cat > $TMPC << EOF
3352 #include <libsmbclient.h>
3353 int main(void) { smbc_opendir("smb://"); return 0; }
3355 if cc_check -lsmbclient ; then
3356 _smbsupport=yes
3357 _ld_smb="-lsmbclient"
3358 else
3359 if cc_check -lsmbclient $_ld_dl ; then
3360 _smbsupport=yes
3361 _ld_smb="-lsmbclient $_ld_dl"
3362 else
3363 if cc_check -lsmbclient $_ld_dl -lnsl ; then
3364 _smbsupport=yes
3365 _ld_smb="-lsmbclient $_ld_dl -lnsl"
3366 else
3367 if cc_check -lsmbclient $_ld_dl -lssl -lnsl ; then
3368 _smbsupport=yes
3369 _ld_smb="-lsmbclient $_ld_dl -lssl -lnsl"
3376 if test "$_smbsupport" = yes; then
3377 _def_smbsupport="#define LIBSMBCLIENT"
3378 _inputmodules="smb $_inputmodules"
3379 else
3380 _def_smbsupport="#undef LIBSMBCLIENT"
3381 _noinputmodules="smb $_noinputmodules"
3383 echores "$_smbsupport"
3386 #########
3387 # VIDEO #
3388 #########
3391 echocheck "3dfx"
3392 if test "$_3dfx" = yes ; then
3393 _def_3dfx='#define HAVE_3DFX 1'
3394 _vosrc="$_vosrc vo_3dfx.c"
3395 _vomodules="3dfx $_vomodules"
3396 else
3397 _def_3dfx='#undef HAVE_3DFX'
3398 _novomodules="3dfx $_novomodules"
3400 echores "$_3dfx"
3403 echocheck "tdfxfb"
3404 if test "$_tdfxfb" = yes ; then
3405 _def_tdfxfb='#define HAVE_TDFXFB 1'
3406 _vosrc="$_vosrc vo_tdfxfb.c"
3407 _vomodules="tdfxfb $_vomodules"
3408 else
3409 _def_tdfxfb='#undef HAVE_TDFXFB'
3410 _novomodules="tdfxfb $_novomodules"
3412 echores "$_tdfxfb"
3414 echocheck "tdfxvid"
3415 if test "$_tdfxvid" = yes ; then
3416 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3417 _vosrc="$_vosrc vo_tdfx_vid.c"
3418 _vomodules="tdfx_vid $_vomodules"
3419 else
3420 _def_tdfxvid='#undef HAVE_TDFX_VID'
3421 _novomodules="tdfx_vid $_novomodules"
3423 echores "$_tdfxfb"
3425 echocheck "tga"
3426 if test "$_tga" = yes ; then
3427 _def_tga='#define HAVE_TGA 1'
3428 _vosrc="$_vosrc vo_tga.c"
3429 _vomodules="tga $_vomodules"
3430 else
3431 _def_tga='#undef HAVE_TGA'
3432 _novomodules="tga $_novomodules"
3434 echores "$_tga"
3436 echocheck "DirectFB headers presence"
3437 if test -z "$_inc_directfb" ; then
3438 for I in /usr/include /usr/local/include $_inc_extra; do
3439 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3440 _inc_directfb="-I$I/directfb"
3441 echores "yes (using $_inc_directfb)"
3442 break
3444 if test -d "$I" && test -f "$I/directfb.h" ; then
3445 _inc_directfb="-I$I"
3446 echores "yes (using $_inc_directfb)"
3447 break
3449 done
3450 if test -z "$_inc_directfb" ; then
3451 _directfb=no
3452 echores "not found"
3454 else
3455 echores "yes (using $_inc_directfb)"
3457 if test "$_inc_directfb" = "-I/usr/include" ; then
3458 _inc_directfb=""
3461 echocheck "DirectFB"
3462 if test "$_directfb" = auto ; then
3463 _directfb=no
3464 cat > $TMPC <<EOF
3465 #include <directfb.h>
3466 int main(void) { IDirectFB *foo; return 0; }
3468 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3471 if test "$_directfb" = yes; then
3472 cat > $TMPC <<EOF
3473 #include <directfb.h>
3474 int main(void) {
3475 printf ("%i",(directfb_major_version*100+directfb_minor_version)*100+directfb_micro_version);
3476 return 0;
3479 if cc_check $_inc_directfb -ldirectfb && "$TMPO" >> "$TMPLOG" ; then
3480 _directfb_version=`"$TMPO"`
3481 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3482 if test "$_directfb_version" -ge 913; then
3483 echores "yes ($_directfb_version)"
3484 else
3485 _def_directfb_version='#undef DIRECTFBVERSION'
3486 _directfb=no
3487 echores "no (version >=0.9.13 required)"
3489 else
3490 _directfb=no
3491 echores "no (failed to get version)"
3493 else
3494 echores "$_directfb"
3497 if test "$_directfb" = yes ; then
3498 _def_directfb='#define HAVE_DIRECTFB 1'
3499 if test "$_directfb_version" -ge 913; then
3500 _vosrc="$_vosrc vo_directfb2.c"
3501 _vomodules="directfb $_vomodules"
3502 _ld_directfb='-ldirectfb'
3505 if test "$_directfb_version" -ge 915; then
3506 _vosrc="$_vosrc vo_dfbmga.c"
3507 _vomodules="dfbmga $_vomodules"
3509 else
3510 _def_directfb='#undef HAVE_DIRECTFB'
3511 _novomodules="directfb $_novomodules"
3512 _inc_directfb=""
3516 echocheck "X11 headers presence"
3517 if test -z "$_inc_x11" ; then
3518 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3519 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3520 _inc_x11="-I$I"
3521 echores "yes (using $I)"
3522 break
3524 done
3525 if test -z "$_inc_x11" ; then
3526 _x11=no
3527 echores "not found (check if the dev(el) packages are installed)"
3529 else
3530 echores "yes (using $_inc_x11)"
3532 if test "$_inc_x11" = "-I/usr/include" ; then
3533 _inc_x11=""
3537 echocheck "X11"
3538 if test "$_x11" != no ; then
3539 cat > $TMPC <<EOF
3540 #include <X11/Xlib.h>
3541 #include <X11/Xutil.h>
3542 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3544 if test -z "$_x11_paths" ; then
3545 _x11_paths="/usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib"
3547 for I in $_x11_paths ; do
3548 _ld_x11="-L$I -lXext -lX11 $_ld_sock"
3549 if netbsd; then
3550 _ld_x11="$_ld_x11 -Wl,-R$I"
3552 if test -d "$I" && cc_check $_inc_x11 $_ld_x11 ; then
3553 _x11=yes
3554 break
3556 done
3558 if test "$_x11" = yes ; then
3559 _def_x11='#define HAVE_X11 1'
3560 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3561 _vomodules="x11 xover $_vomodules"
3562 echores "yes (using $I)"
3563 else
3564 _x11=no
3565 _def_x11='#undef HAVE_X11'
3566 _inc_x11=''
3567 _ld_x11=''
3568 _novomodules="x11 $_novomodules"
3569 echores "no (check if the dev(el) packages are installed)"
3573 echocheck "DPMS"
3574 _xdpms3=no
3575 if test "$_x11" = yes ; then
3576 cat > $TMPC <<EOF
3577 #include <X11/Xmd.h>
3578 #include <X11/Xlib.h>
3579 #include <X11/Xutil.h>
3580 #include <X11/Xatom.h>
3581 #include <X11/extensions/dpms.h>
3582 int main(void) {
3583 (void) DPMSQueryExtension(0, 0, 0);
3586 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3588 _xdpms4=no
3589 if test "$_x11" = yes ; then
3590 cat > $TMPC <<EOF
3591 #include <X11/Xlib.h>
3592 #include <X11/extensions/dpms.h>
3593 int main(void) {
3594 (void) DPMSQueryExtension(0, 0, 0);
3597 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3599 if test "$_xdpms4" = yes ; then
3600 _def_xdpms='#define HAVE_XDPMS 1'
3601 echores "yes (using Xdpms 4)"
3602 elif test "$_xdpms3" = yes ; then
3603 _def_xdpms='#define HAVE_XDPMS 1'
3604 _ld_x11="-lXdpms $_ld_x11"
3605 echores "yes (using Xdpms 3)"
3606 else
3607 _def_xdpms='#undef HAVE_XDPMS'
3608 echores "no"
3612 echocheck "Xv"
3613 if test "$_x11" = yes && test "$_xv" != no ; then
3614 cat > $TMPC <<EOF
3615 #include <X11/Xlib.h>
3616 #include <X11/extensions/Xvlib.h>
3617 int main(void) {
3618 (void) XvGetPortAttribute(0, 0, 0, 0);
3619 (void) XvQueryPortAttributes(0, 0, 0);
3620 return 0; }
3622 _xv=no
3623 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3624 else
3625 _xv=no
3627 if test "$_xv" = yes ; then
3628 _def_xv='#define HAVE_XV 1'
3629 _ld_xv='-lXv'
3630 _vosrc="$_vosrc vo_xv.c"
3631 _vomodules="xv $_vomodules"
3632 else
3633 _def_xv='#undef HAVE_XV'
3634 _novomodules="xv $_novomodules"
3636 echores "$_xv"
3639 echocheck "XvMC"
3640 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3641 _xvmc=no
3642 cat > $TMPC <<EOF
3643 #include <X11/Xlib.h>
3644 #include <X11/extensions/Xvlib.h>
3645 #include <X11/extensions/XvMClib.h>
3646 int main(void) {
3647 (void) XvMCQueryExtension(0,0,0);
3648 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3649 return 0; }
3651 cc_check $_inc_x11 -lXvMC -l$_xvmclib $_ld_xv $_ld_x11 && _xvmc=yes
3653 if test "$_xvmc" = yes ; then
3654 _def_xvmc='#define HAVE_XVMC 1'
3655 _ld_xvmc="-lXvMC -l$_xvmclib"
3656 _vosrc="$_vosrc vo_xvmc.c"
3657 _vomodules="xvmc $_vomodules"
3658 else
3659 _def_xvmc='#undef HAVE_XVMC'
3660 _novomodules="xvmc $_novomodules"
3662 echores "$_xvmc"
3665 echocheck "Xinerama"
3666 if test "$_x11" = yes && test "$_xinerama" != no ; then
3667 cat > $TMPC <<EOF
3668 #include <X11/Xlib.h>
3669 #include <X11/extensions/Xinerama.h>
3670 int main(void) { (void) XineramaIsActive(0); return 0; }
3672 _xinerama=no
3673 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3674 else
3675 _xinerama=no
3677 if test "$_xinerama" = yes ; then
3678 _def_xinerama='#define HAVE_XINERAMA 1'
3679 _ld_xinerama='-lXinerama'
3680 else
3681 _def_xinerama='#undef HAVE_XINERAMA'
3683 echores "$_xinerama"
3686 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3687 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3688 # named 'X extensions' or something similar.
3689 # This check may be useful for future mplayer versions (to change resolution)
3690 # If you run into problems, remove '-lXxf86vm'.
3691 echocheck "Xxf86vm"
3692 if test "$_x11" = yes && test "$_vm" = auto ; then
3693 cat > $TMPC <<EOF
3694 #include <X11/Xlib.h>
3695 #include <X11/extensions/xf86vmode.h>
3696 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3698 _vm=no
3699 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3701 if test "$_vm" = yes ; then
3702 _def_vm='#define HAVE_XF86VM 1'
3703 _ld_vm='-lXxf86vm'
3704 else
3705 _def_vm='#undef HAVE_XF86VM'
3707 echores "$_vm"
3709 # Check for the presence of special keycodes, like audio control buttons
3710 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3711 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3712 # have these new keycodes.
3713 echocheck "XF86keysym"
3714 if test "$_xf86keysym" = auto; then
3715 _xf86keysym=no
3716 if test "$_x11" = yes ; then
3717 cat > $TMPC <<EOF
3718 #include <X11/Xlib.h>
3719 #include <X11/XF86keysym.h>
3720 int main(void) { return XF86XK_AudioPause; }
3722 cc_check $_inc_x11 $_ld_x11 && _xf86keysym=yes
3725 if test "$_xf86keysym" = yes ; then
3726 _def_xf86keysym='#define HAVE_XF86XK 1'
3727 else
3728 _def_xf86keysym='#undef HAVE_XF86XK'
3730 echores "$_xf86keysym"
3732 echocheck "DGA"
3733 if test "$_x11" = no ; then
3734 _dga=no
3736 # Version 2 is preferred to version 1 if available
3737 if test "$_dga" = auto ; then
3738 cat > $TMPC << EOF
3739 #include <X11/Xlib.h>
3740 #include <X11/extensions/xf86dga.h>
3741 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3743 _dga=no
3744 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3746 cat > $TMPC << EOF
3747 #include <X11/Xlib.h>
3748 #include <X11/extensions/xf86dga.h>
3749 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3751 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3754 _def_dga='#undef HAVE_DGA'
3755 _def_dga2='#undef HAVE_DGA2'
3756 if test "$_dga" = 1 ; then
3757 _def_dga='#define HAVE_DGA 1'
3758 _ld_dga='-lXxf86dga'
3759 _vosrc="$_vosrc vo_dga.c"
3760 _vomodules="dga $_vomodules"
3761 echores "yes (using DGA 1.0)"
3762 elif test "$_dga" = 2 ; then
3763 _def_dga='#define HAVE_DGA 1'
3764 _def_dga2='#define HAVE_DGA2 1'
3765 _ld_dga='-lXxf86dga'
3766 _vosrc="$_vosrc vo_dga.c"
3767 _vomodules="dga $_vomodules"
3768 echores "yes (using DGA 2.0)"
3769 elif test "$_dga" = no ; then
3770 echores "no"
3771 _novomodules="dga $_novomodules"
3772 else
3773 die "DGA version must be 1 or 2"
3777 echocheck "OpenGL"
3778 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3779 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3780 cat > $TMPC << EOF
3781 #include <GL/gl.h>
3782 int main(void) { return 0; }
3784 _gl=no
3785 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3786 _gl=yes
3787 _ld_gl="-lGL"
3788 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3789 _gl=yes
3790 _ld_gl="-lGL $_ld_pthread"
3791 elif cc_check -lopengl32 ; then
3792 _gl=yes
3793 _gl_win32=yes
3794 _ld_gl="-lopengl32 -lgdi32"
3796 else
3797 _gl=no
3799 if test "$_gl" = yes ; then
3800 _def_gl='#define HAVE_GL 1'
3801 if test "$_gl_win32" = yes ; then
3802 _def_gl_win32='#define GL_WIN32 1'
3803 _vosrc="$_vosrc vo_gl2.c w32_common.c gl_common.c"
3804 else
3805 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
3807 _vomodules="opengl $_vomodules"
3808 else
3809 _def_gl='#undef HAVE_GL'
3810 _def_gl_win32='#undef GL_WIN32'
3811 _novomodules="opengl $_novomodules"
3813 echores "$_gl"
3816 echocheck "/dev/mga_vid"
3817 if test "$_mga" = auto ; then
3818 _mga=no
3819 test -c /dev/mga_vid && _mga=yes
3821 if test "$_mga" = yes ; then
3822 _def_mga='#define HAVE_MGA 1'
3823 _vosrc="$_vosrc vo_mga.c"
3824 _vomodules="mga $_vomodules"
3825 else
3826 _def_mga='#undef HAVE_MGA'
3827 _novomodules="mga $_novomodules"
3829 echores "$_mga"
3832 # echocheck "syncfb"
3833 # _syncfb=no
3834 # test "$_mga" = yes && _syncfb=yes
3835 # if test "$_syncfb" = yes ; then
3836 # _def_syncfb='#define HAVE_SYNCFB 1'
3837 # _vosrc="$_vosrc vo_syncfb.c"
3838 # else
3839 # _def_syncfb='#undef HAVE_SYNCFB'
3840 # fi
3841 # echores "$_syncfb"
3844 echocheck "xmga"
3845 if test "$_xmga" = auto ; then
3846 _xmga=no
3847 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
3849 if test "$_xmga" = yes ; then
3850 _def_xmga='#define HAVE_XMGA 1'
3851 _vosrc="$_vosrc vo_xmga.c"
3852 _vomodules="xmga $_vomodules"
3853 else
3854 _def_xmga='#undef HAVE_XMGA'
3855 _novomodules="xmga $_novomodules"
3857 echores "$_xmga"
3860 echocheck "GGI"
3861 if test "$_ggi" = auto ; then
3862 cat > $TMPC << EOF
3863 #include <ggi/ggi.h>
3864 int main(void) { return 0; }
3866 _ggi=no
3867 cc_check -lggi && _ggi=yes
3869 if test "$_ggi" = yes ; then
3870 _def_ggi='#define HAVE_GGI 1'
3871 _ld_ggi='-lggi'
3872 _vosrc="$_vosrc vo_ggi.c"
3873 _vomodules="ggi $_vomodules"
3874 else
3875 _def_ggi='#undef HAVE_GGI'
3876 _novomodules="ggi $_novomodules"
3878 echores "$_ggi"
3880 echocheck "GGI extension: libggiwmh"
3881 if test "$_ggiwmh" = auto ; then
3882 _ggiwmh=no
3883 cat > $TMPC << EOF
3884 #include <ggi/ggi.h>
3885 #include <ggi/wmh.h>
3886 int main(void) { return 0; }
3888 cc_check -lggi -lggiwmh && _ggiwmh=yes
3890 # needed to get right output on obscure combination
3891 # like --disable-ggi --enable-ggiwmh
3892 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
3893 _def_ggiwmh='#define HAVE_GGIWMH 1'
3894 _ld_ggi="$_ld_ggi -lggiwmh"
3895 else
3896 _ggiwmh=no
3897 _def_ggiwmh='#undef HAVE_GGIWMH'
3899 echores "$_ggiwmh"
3902 echocheck "AA"
3903 if test "$_aa" = auto ; then
3904 cat > $TMPC << EOF
3905 #include <aalib.h>
3906 int main(void) { (void) aa_init(0, 0, 0); return 0; }
3908 _aa=no
3909 if cc_check -laa ; then
3910 _aa=yes
3911 _ld_aa="-laa"
3912 elif cc_check $_ld_x11 -laa ; then
3913 _aa=yes
3914 _ld_aa="$_ld_x11 -laa"
3917 if test "$_aa" = yes ; then
3918 _def_aa='#define HAVE_AA 1'
3919 if cygwin ; then
3920 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
3922 _vosrc="$_vosrc vo_aa.c"
3923 _vomodules="aa $_vomodules"
3924 else
3925 _def_aa='#undef HAVE_AA'
3926 _novomodules="aa $_novomodules"
3928 echores "$_aa"
3931 echocheck "CACA"
3932 if test "$_caca" = auto ; then
3933 _caca=no
3934 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3935 cat > $TMPC << EOF
3936 #include <caca.h>
3937 int main(void) { (void) caca_init(); return 0; }
3939 cc_check `caca-config --libs` && _caca=yes
3942 if test "$_caca" = yes ; then
3943 _def_caca='#define HAVE_CACA 1'
3944 _inc_caca=`caca-config --cflags`
3945 _ld_caca=`caca-config --libs`
3946 _vosrc="$_vosrc vo_caca.c"
3947 _vomodules="caca $_vomodules"
3948 else
3949 _def_caca='#undef HAVE_CACA'
3950 _novomodules="caca $_novomodules"
3952 echores "$_caca"
3955 echocheck "SVGAlib"
3956 if test "$_svga" = auto ; then
3957 cat > $TMPC << EOF
3958 #include <vga.h>
3959 #include <vgagl.h>
3960 int main(void) { return 0; }
3962 _svga=no
3963 cc_check -lvgagl -lvga $_ld_lm && _svga=yes
3965 if test "$_svga" = yes ; then
3966 _def_svga='#define HAVE_SVGALIB 1'
3967 _ld_svga="-lvgagl -lvga $_ld_lm"
3968 _vosrc="$_vosrc vo_svga.c"
3969 _vomodules="svga $_vomodules"
3970 else
3971 _def_svga='#undef HAVE_SVGALIB'
3972 _novomodules="svga $_novomodules"
3974 echores "$_svga"
3977 echocheck "FBDev"
3978 if test "$_fbdev" = auto ; then
3979 _fbdev=no
3980 linux && test -c /dev/fb0 && _fbdev=yes
3982 if test "$_fbdev" = yes ; then
3983 _def_fbdev='#define HAVE_FBDEV 1'
3984 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
3985 _vomodules="fbdev $_vomodules"
3986 else
3987 _def_fbdev='#undef HAVE_FBDEV'
3988 _novomodules="fbdev $_novomodules"
3990 echores "$_fbdev"
3994 echocheck "DVB"
3995 if test "$_dvb" != no ; then
3996 _dvb=no
3997 cat >$TMPC << EOF
3998 #include <sys/poll.h>
3999 #include <sys/ioctl.h>
4000 #include <stdio.h>
4001 #include <time.h>
4002 #include <unistd.h>
4004 #include <ost/dmx.h>
4005 #include <ost/frontend.h>
4006 #include <ost/sec.h>
4007 #include <ost/video.h>
4008 #include <ost/audio.h>
4009 int main(void) {return 0;}
4011 if cc_check ; then
4012 _dvb=yes
4013 echores "yes"
4014 else
4015 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
4016 if cc_check "$I" ; then
4017 _dvb=yes
4018 _inc_dvb="$I"
4019 echores "yes (using $_inc_dvb)"
4020 break
4022 done
4023 test "$_dvb" = no && echores "no (specify path to DVB/ost/include with --with-dvbincdir=DIR)"
4025 else
4026 echores "no"
4028 if test "$_dvb" = yes ; then
4029 _def_dvb='#define HAVE_DVB 1'
4030 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4031 _aomodules="mpegpes(dvb) $_aomodules"
4032 _vomodules="mpegpes(dvb) $_vomodules"
4034 if test "$_dvbhead" != no ; then
4035 echocheck "DVB HEAD"
4036 if test "$_dvbhead" != no ; then
4037 _dvbhead=no
4039 cat >$TMPC << EOF
4040 #include <sys/poll.h>
4041 #include <sys/ioctl.h>
4042 #include <stdio.h>
4043 #include <time.h>
4044 #include <unistd.h>
4046 #include <linux/dvb/dmx.h>
4047 #include <linux/dvb/frontend.h>
4048 #include <linux/dvb/video.h>
4049 #include <linux/dvb/audio.h>
4050 int main(void) {return 0;}
4052 if cc_check ; then
4053 _dvbhead=yes
4054 echores "yes"
4055 else
4056 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
4057 if cc_check "$I" ; then
4058 _dvbhead=yes
4059 _inc_dvb="$I"
4060 echores "yes (using $_inc_dvb)"
4061 break
4063 done
4064 test "$_dvbhead" = no && echores "no (specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR)"
4066 else
4067 echores "no"
4069 if test "$_dvbhead" = yes ; then
4070 _def_dvb='#define HAVE_DVB_HEAD 1'
4071 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
4072 _aomodules="mpegpes(dvb) $_aomodules"
4073 _vomodules="mpegpes(dvb) $_vomodules"
4076 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4077 _def_dvb='#undef HAVE_DVB'
4078 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
4079 _aomodules="mpegpes(file) $_aomodules"
4080 _vomodules="mpegpes(file) $_vomodules"
4083 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4084 _dvbin=yes
4085 _inputmodules="dvb $_inputmodules"
4086 else
4087 _dvbin=no
4088 _noinputmodules="dvb $_noinputmodules"
4091 echocheck "PNG support"
4092 if test "$_png" = auto ; then
4093 _png=no
4094 if irix ; then
4095 # Don't check for -lpng on irix since it has its own libpng
4096 # incompatible with the GNU libpng
4097 echores "disabled on irix (not GNU libpng)"
4098 else
4099 cat > $TMPC << EOF
4100 #include <png.h>
4101 #include <string.h>
4102 int main(void) {
4103 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4104 printf("libpng: %s\n", png_libpng_ver);
4105 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
4108 if cc_check -lpng -lz $_ld_lm ; then
4109 if "$TMPO" >> "$TMPLOG" ; then
4110 _png=yes
4111 echores yes
4112 else
4113 echores "no (mismatch of library and header versions)"
4115 else
4116 echores no
4119 else
4120 echores "$_png"
4122 if test "$_png" = yes ; then
4123 _def_png='#define HAVE_PNG 1'
4124 _ld_png='-lpng -lz'
4125 _vosrc="$_vosrc vo_png.c"
4126 _vomodules="png $_vomodules"
4127 _mkf_png="yes"
4128 else
4129 _def_png='#undef HAVE_PNG'
4130 _novomodules="png $_novomodules"
4131 _mkf_png="no"
4134 echocheck "JPEG support"
4135 if test "$_jpg" = auto ; then
4136 _jpg=no
4137 cat > $TMPC << EOF
4138 #include <stdio.h>
4139 #include <stdlib.h>
4140 #include <setjmp.h>
4141 #include <string.h>
4142 #include <jpeglib.h>
4143 int main(void) {
4144 return 0;
4147 if cc_check -ljpeg $_ld_lm ; then
4148 if "$TMPO" >> "$TMPLOG" ; then
4149 _jpg=yes
4153 echores "$_jpg"
4155 if test "$_jpg" = yes ; then
4156 _def_jpg='#define HAVE_JPEG 1'
4157 _vosrc="$_vosrc vo_jpeg.c"
4158 _vomodules="jpeg $_vomodules"
4159 _ld_jpg="-ljpeg"
4160 _mkf_jpg="yes"
4161 else
4162 _def_jpg='#undef HAVE_JPEG'
4163 _novomodules="jpeg $_novomodules"
4164 _mkf_jpg="no"
4169 echocheck "PNM support"
4170 if test "$_pnm" = yes; then
4171 _def_pnm="#define HAVE_PNM"
4172 _vosrc="$_vosrc vo_pnm.c"
4173 _vomodules="pnm $_vomodules"
4174 else
4175 _def_pnm="#undef HAVE_PNM"
4176 _novomodules="pnm $_novomodules"
4178 echores "$_pnm"
4182 echocheck "md5sum support"
4183 if test "$_md5sum" = yes; then
4184 _def_md5sum="#define HAVE_MD5SUM"
4185 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
4186 _vomodules="md5sum $_vomodules"
4187 else
4188 _def_md5sum="#undef HAVE_MD5SUM"
4189 _novomodules="md5sum $_novomodules"
4191 echores "$_md5sum"
4195 echocheck "GIF support"
4196 # This is to appease people who want to force gif support.
4197 # If it is forced to yes, then we still do checks to determine
4198 # which gif library to use.
4199 if test "$_gif" = yes ; then
4200 _force_gif=yes
4201 _gif=auto
4204 if test "$_gif" = auto ; then
4205 _gif=no
4206 cat > $TMPC << EOF
4207 #include <gif_lib.h>
4208 int main(void) {
4209 return 0;
4212 if cc_check -lungif && "$TMPO" >> "$TMPLOG" ; then
4213 _gif=yes
4214 _ld_gif="-lungif"
4215 elif cc_check -lungif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
4216 _gif=yes
4217 _ld_gif="-lungif $_ld_x11"
4218 elif cc_check -lgif && "$TMPO" >> "$TMPLOG" ; then
4219 _gif=yes
4220 _ld_gif="-lgif"
4221 elif cc_check -lgif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
4222 _gif=yes
4223 _ld_gif="-lgif $_ld_x11"
4227 # If no library was found, and the user wants support forced,
4228 # then we force it on with libgif, as this is the safest
4229 # assumption IMHO. (libungif & libregif both create symbolic
4230 # links to libgif. We also assume that no x11 support is needed,
4231 # because if you are forcing this, then you _should_ know what
4232 # you are doing. [ Besides, package maintainers should never
4233 # have compiled x11 deps into libungif in the first place. ] )
4234 # </rant>
4235 # --Joey
4236 if test "$_force_gif" = yes && test "$_gif" = no ; then
4237 _gif=yes
4238 _ld_gif="-lgif"
4241 if test "$_gif" = yes ; then
4242 _def_gif='#define HAVE_GIF 1'
4243 _vosrc="$_vosrc vo_gif89a.c"
4244 _codecmodules="gif $_codecmodules"
4245 _vomodules="gif89a $_vomodules"
4246 _mkf_gif="yes"
4247 _gif="yes (old version, some encoding functions disabled)"
4248 _def_gif_4='#undef HAVE_GIF_4'
4250 cat > $TMPC << EOF
4251 #include <signal.h>
4252 #include <gif_lib.h>
4253 void catch() { exit(1); }
4254 int main(void) {
4255 signal(SIGSEGV, catch); // catch segfault
4256 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4257 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4258 return 0;
4261 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
4262 _def_gif_4='#define HAVE_GIF_4 1'
4263 _gif="yes"
4265 else
4266 _def_gif='#undef HAVE_GIF'
4267 _def_gif_4='#undef HAVE_GIF_4'
4268 _novomodules="gif89a $_novomodules"
4269 _nocodecmodules="gif $_nocodecmodules"
4270 _mkf_gif="no"
4272 echores "$_gif"
4275 case "$_gif" in yes*)
4276 echocheck "broken giflib workaround"
4277 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4279 cat > $TMPC << EOF
4280 #include <gif_lib.h>
4281 int main(void) {
4282 GifFileType gif;
4283 printf("UserData is at address %p\n", gif.UserData);
4284 return 0;
4287 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
4288 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4289 echores "disabled"
4290 else
4291 echores "enabled"
4294 esac
4297 echocheck "VESA support"
4298 if test "$_vesa" = auto ; then
4299 if x86 && linux ; then
4300 _vesa=no
4301 cat > $TMPC << EOF
4302 #include <sys/io.h>
4303 int main(void) { return 0; }
4305 cc_check && _vesa=yes
4308 if test "$_vesa" = yes ; then
4309 _def_vesa='#define HAVE_VESA 1'
4310 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c"
4311 _vomodules="vesa $_vomodules"
4312 echores "yes"
4313 else
4314 _def_vesa='#undef HAVE_VESA'
4315 echores "no (not supported on this OS/architecture)"
4316 _novomodules="vesa $_novomodules"
4319 #################
4320 # VIDEO + AUDIO #
4321 #################
4324 echocheck "SDL"
4325 if test -z "$_sdlconfig" ; then
4326 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4327 _sdlconfig="sdl-config"
4328 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4329 _sdlconfig="sdl11-config"
4330 else
4331 _sdlconfig=false
4334 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4335 cat > $TMPC << EOF
4336 #include <SDL.h>
4337 int main(int argc, char *argv[]) { return 0; }
4339 _sdl=no
4340 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4341 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4342 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4343 if test "$_sdlversion" -gt 116 ; then
4344 if test "$_sdlversion" -lt 121 ; then
4345 _def_sdlbuggy='#define BUGGY_SDL'
4346 else
4347 _def_sdlbuggy='#undef BUGGY_SDL'
4349 _sdl=yes
4350 else
4351 _sdl=outdated
4356 if test "$_sdl" = yes ; then
4357 _def_sdl='#define HAVE_SDL 1'
4358 if cygwin ; then
4359 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4360 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4361 elif mingw32 ; then
4362 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4363 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4364 else
4365 _ld_sdl=`$_sdlconfig --libs`
4366 _inc_sdl=`$_sdlconfig --cflags`
4368 _vosrc="$_vosrc vo_sdl.c"
4369 _vomodules="sdl $_vomodules"
4370 _aosrc="$_aosrc ao_sdl.c"
4371 _aomodules="sdl $_aomodules"
4372 echores "yes (using $_sdlconfig)"
4373 else
4374 _def_sdl='#undef HAVE_SDL'
4375 _novomodules="sdl $_novomodules"
4376 _noaomodules="sdl $_noaomodules"
4377 echores "no"
4380 echocheck "Windows waveout"
4381 if test "$_win32waveout" = auto ; then
4382 cat > $TMPC << EOF
4383 #include <windows.h>
4384 #include <mmsystem.h>
4385 int main(void) { return 0; }
4387 _win32waveout=no
4388 cc_check -lwinmm && _win32waveout=yes
4390 if test "$_win32waveout" = yes ; then
4391 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4392 _ld_win32libs="-lwinmm $_ld_win32libs"
4393 _aosrc="$_aosrc ao_win32.c"
4394 _aomodules="win32 $_aomodules"
4395 else
4396 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4397 _noaomodules="win32 $_noaomodules"
4399 echores "$_win32waveout"
4401 echocheck "Directx"
4402 if test "$_directx" = auto ; then
4403 cat > $TMPC << EOF
4404 #include <windows.h>
4405 #include <ddraw.h>
4406 #include <dsound.h>
4407 int main(void) { return 0; }
4409 _directx=no
4410 cc_check -lgdi32 && _directx=yes
4412 if test "$_directx" = yes ; then
4413 _def_directx='#define HAVE_DIRECTX 1'
4414 _ld_win32libs="-lgdi32 $_ld_win32libs"
4415 _vosrc="$_vosrc vo_directx.c"
4416 _vomodules="directx $_vomodules"
4417 _aosrc="$_aosrc ao_dsound.c"
4418 _aomodules="dsound $_aomodules"
4419 else
4420 _def_directx='#undef HAVE_DIRECTX'
4421 _novomodules="directx $_novomodules"
4422 _noaomodules="dsound $_noaomodules"
4424 echores "$_directx"
4426 echocheck "NAS"
4427 if test "$_nas" = auto || test "$_nas" = yes ; then
4428 cat > $TMPC << EOF
4429 #include <audio/audiolib.h>
4430 int main(void) { return 0; }
4432 _nas=no
4433 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4435 if test "$_nas" = yes ; then
4436 _def_nas='#define HAVE_NAS 1'
4437 _ld_nas="-laudio -lXt $_ld_x11"
4438 _aosrc="$_aosrc ao_nas.c"
4439 _aomodules="nas $_aomodules"
4440 else
4441 _noaomodules="nas $_noaomodules"
4442 _def_nas='#undef HAVE_NAS'
4444 echores "$_nas"
4446 echocheck "DXR2"
4447 if test "$_dxr2" = auto; then
4448 _dxr2=no
4449 for _inc_dxr2 in "$_inc_dxr2" \
4450 "-I/usr/local/include/dxr2" \
4451 "-I/usr/include/dxr2"; do
4452 cat > $TMPC << EOF
4453 #include <dxr2ioctl.h>
4454 int main(void) { return 0; }
4456 cc_check $_inc_dxr2 && _dxr2=yes && break
4457 done
4459 if test "$_dxr2" = yes; then
4460 _def_dxr2='#define HAVE_DXR2 1'
4461 _vosrc="$_vosrc vo_dxr2.c"
4462 _aosrc="$_aosrc ao_dxr2.c"
4463 _aomodules="dxr2 $_aomodules"
4464 _vomodules="dxr2 $_vomodules"
4465 echores "yes (using $_inc_dxr2)"
4466 else
4467 _def_dxr2='#undef HAVE_DXR2'
4468 _noaomodules="dxr2 $_noaomodules"
4469 _novomodules="dxr2 $_novomodules"
4470 _inc_dxr2=""
4471 echores "no"
4474 echocheck "DXR3/H+"
4475 if test "$_dxr3" = auto ; then
4476 cat > $TMPC << EOF
4477 #include <linux/em8300.h>
4478 int main(void) { return 0; }
4480 _dxr3=no
4481 cc_check && _dxr3=yes
4483 if test "$_dxr3" = yes ; then
4484 _def_dxr3='#define HAVE_DXR3 1'
4485 _vosrc="$_vosrc vo_dxr3.c"
4486 _vomodules="dxr3 $_vomodules"
4487 else
4488 _def_dxr3='#undef HAVE_DXR3'
4489 _novomodules="dxr3 $_novomodules"
4490 if test "$_mp1e" = auto ; then
4491 # we don't need mp1e
4492 _mp1e=no
4495 echores "$_dxr3"
4497 echocheck "libmp1e"
4498 if test "$_mmx" = no ; then
4499 # mp1e REQUIRES mmx!
4500 _mp1e=no
4502 if test "$_mp1e" != no ; then
4503 _mp1e=yes
4504 _def_mp1e='#define USE_MP1E'
4505 _ld_mp1e='libmp1e/libmp1e.a'
4506 _dep_mp1e='libmp1e/libmp1e.a'
4507 else
4508 _mp1e=no
4509 _def_mp1e='#undef USE_MP1E'
4510 _ld_mp1e=""
4511 _dep_mp1e=''
4513 echores "$_mp1e"
4516 echocheck "libfame"
4517 if test "$_fame" = auto ; then
4518 _fame=no
4519 test "$_dxr2" = yes && _fame=auto
4520 test "$_dxr3" = yes && _fame=auto
4521 test "$_dvb" = yes && _fame=auto
4523 if test "$_fame" = auto ; then
4524 _fame=no
4525 if test -d libfame && test -f libfame/fame.h ; then
4526 # disable fame on cygwin as no sense to port - atmos
4527 cygwin || _fame=yes
4528 echores $_fame
4529 else
4530 echores "no (no fame dir)"
4532 else
4533 echores "$_fame"
4536 _def_fame='#undef USE_LIBFAME'
4537 if test "$_fame" = yes ; then
4538 _def_fame='#define USE_LIBFAME 1'
4539 _ld_fame='libfame/libfame.a'
4543 #########
4544 # AUDIO #
4545 #########
4548 echocheck "OSS Audio"
4549 if test "$_ossaudio" = auto ; then
4550 cat > $TMPC << EOF
4551 #include <sys/ioctl.h>
4552 $_inc_soundcard
4553 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4555 _ossaudio=no
4556 cc_check && _ossaudio=yes
4558 if test "$_ossaudio" = yes ; then
4559 _def_ossaudio='#define USE_OSS_AUDIO 1'
4560 _aosrc="$_aosrc ao_oss.c"
4561 _aomodules="oss $_aomodules"
4562 if test "$_linux_devfs" = yes; then
4563 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4564 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4565 else
4566 cat > $TMPC << EOF
4567 #include <sys/ioctl.h>
4568 $_inc_soundcard
4569 #ifdef OPEN_SOUND_SYSTEM
4570 int main(void) { return 0; }
4571 #else
4572 #error Not the real thing
4573 #endif
4575 _real_ossaudio=no
4576 cc_check && _real_ossaudio=yes
4577 if test "$_real_ossaudio" = yes; then
4578 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4579 elif netbsd || openbsd ; then
4580 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4581 _ld_arch="$_ld_arch -lossaudio"
4582 else
4583 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4585 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4587 else
4588 _def_ossaudio='#undef USE_OSS_AUDIO'
4589 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4590 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4591 _noaomodules="oss $_noaomodules"
4593 echores "$_ossaudio"
4596 echocheck "aRts"
4597 if test "$_arts" = auto ; then
4598 _arts=no
4599 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4601 cat > $TMPC << EOF
4602 #include <artsc.h>
4603 int main(void) { return 0; }
4605 cc_check `artsc-config --libs` `artsc-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _arts=yes
4610 if test "$_arts" = yes ; then
4611 _def_arts='#define USE_ARTS 1'
4612 _aosrc="$_aosrc ao_arts.c"
4613 _aomodules="arts $_aomodules"
4614 _ld_arts=`artsc-config --libs`
4615 _inc_arts=`artsc-config --cflags`
4616 else
4617 _noaomodules="arts $_noaomodules"
4619 echores "$_arts"
4622 echocheck "EsounD"
4623 if test "$_esd" = auto ; then
4624 _esd=no
4625 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4627 cat > $TMPC << EOF
4628 #include <esd.h>
4629 int main(void) { return 0; }
4631 cc_check `esd-config --libs` `esd-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
4635 echores "$_esd"
4637 if test "$_esd" = yes ; then
4638 _def_esd='#define USE_ESD 1'
4639 _aosrc="$_aosrc ao_esd.c"
4640 _aomodules="esd $_aomodules"
4641 _ld_esd=`esd-config --libs`
4642 _inc_esd=`esd-config --cflags`
4644 echocheck "esd_get_latency()"
4645 cat > $TMPC << EOF
4646 #include <esd.h>
4647 int main(void) { return esd_get_latency(0); }
4649 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4650 echores "$_esd_latency"
4651 else
4652 _def_esd='#undef USE_ESD'
4653 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4654 _noaomodules="esd $_noaomodules"
4657 echocheck "Polyp"
4658 if test "$_polyp" = auto ; then
4659 _polyp=no
4660 if ( pkg-config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ) >> "$TMPLOG" 2>&1 ; then
4662 cat > $TMPC << EOF
4663 #include <polyp/polyplib.h>
4664 #include <polyp/mainloop.h>
4665 #include <polyp/polyplib-error.h>
4666 int main(void) { return 0; }
4668 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _polyp=yes
4672 echores "$_polyp"
4674 if test "$_polyp" = yes ; then
4675 _def_polyp='#define USE_POLYP 1'
4676 _aosrc="$_aosrc ao_polyp.c"
4677 _aomodules="polyp $_aomodules"
4678 _ld_polyp=`pkg-config --libs polyplib polyplib-error polyplib-mainloop`
4679 _inc_polyp=`pkg-config --cflags polyplib polyplib-error polyplib-mainloop`
4680 else
4681 _def_polyp='#undef USE_POLYP'
4682 _noaomodules="polyp $_noaomodules"
4686 echocheck "JACK"
4687 if test "$_jack" = auto ; then
4688 _jack=no
4689 if ( ( pkg-config --modversion jack ) > /dev/null 2>&1 ) &&
4690 ( jackd --version | grep version | awk '{ print $3 }' ) >> "$TMPLOG" 2>&1 ; then
4692 cat > $TMPC << EOF
4693 #include <jack/jack.h>
4694 int main(void) { jack_client_new("test"); return 0; }
4696 cc_check `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4700 if test "$_jack" = yes ; then
4701 _def_jack='#define USE_JACK 1'
4702 _aosrc="$_aosrc ao_jack.c"
4703 _aomodules="jack $_aomodules"
4704 _ld_jack="`pkg-config --libs jack`"
4705 _inc_jack=`pkg-config --cflags jack`
4706 else
4707 _noaomodules="jack $_noaomodules"
4709 echores "$_jack"
4712 echocheck "ALSA audio"
4713 if test "$_alsa" != no ; then
4714 _alsa=no
4715 cat > $TMPC << EOF
4716 #include <sys/asoundlib.h>
4717 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); }
4719 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.5.x'
4721 cat > $TMPC << EOF
4722 #include <sys/asoundlib.h>
4723 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4725 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-sys'
4726 cat > $TMPC << EOF
4727 #include <alsa/asoundlib.h>
4728 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4730 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-alsa'
4732 cat > $TMPC << EOF
4733 #include <sys/asoundlib.h>
4734 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4736 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-sys'
4737 cat > $TMPC << EOF
4738 #include <alsa/asoundlib.h>
4739 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4741 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-alsa'
4743 _def_alsa5='#undef HAVE_ALSA5'
4744 _def_alsa9='#undef HAVE_ALSA9'
4745 _def_alsa1x='#undef HAVE_ALSA1X'
4746 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4747 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4748 if test "$_alsaver" ; then
4749 if test "$_alsaver" = '0.5.x' ; then
4750 _aosrc="$_aosrc ao_alsa5.c"
4751 _aomodules="alsa5 $_aomodules"
4752 _def_alsa5='#define HAVE_ALSA5 1'
4753 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4754 echores "yes (using alsa 0.5.x and sys/asoundlib.h)"
4755 elif test "$_alsaver" = '0.9.x-sys' ; then
4756 _aosrc="$_aosrc ao_alsa.c"
4757 _aomodules="alsa $_aomodules"
4758 _def_alsa9='#define HAVE_ALSA9 1'
4759 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4760 echores "yes (using alsa 0.9.x and sys/asoundlib.h)"
4761 elif test "$_alsaver" = '0.9.x-alsa' ; then
4762 _aosrc="$_aosrc ao_alsa.c"
4763 _aomodules="alsa $_aomodules"
4764 _def_alsa9='#define HAVE_ALSA9 1'
4765 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4766 echores "yes (using alsa 0.9.x and alsa/asoundlib.h)"
4767 elif test "$_alsaver" = '1.0.x-sys' ; then
4768 _aosrc="$_aosrc ao_alsa.c"
4769 _aomodules="alsa $_aomodules"
4770 _def_alsa1x="#define HAVE_ALSA1X 1"
4771 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4772 echores "yes (using alsa 1.0.x and sys/asoundlib.h)"
4773 elif test "$_alsaver" = '1.0.x-alsa' ; then
4774 _aosrc="$_aosrc ao_alsa.c"
4775 _aomodules="alsa $_aomodules"
4776 _def_alsa1x="#define HAVE_ALSA1X 1"
4777 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4778 echores "yes (using alsa 1.0.x and alsa/asoundlib.h)"
4780 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4781 else
4782 _noaomodules="alsa $_noaomodules"
4783 echores "no"
4787 echocheck "Sun audio"
4788 if test "$_sunaudio" = auto ; then
4789 cat > $TMPC << EOF
4790 #include <sys/types.h>
4791 #include <sys/audioio.h>
4792 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4794 _sunaudio=no
4795 cc_check && _sunaudio=yes
4797 if test "$_sunaudio" = yes ; then
4798 _def_sunaudio='#define USE_SUN_AUDIO 1'
4799 _aosrc="$_aosrc ao_sun.c"
4800 _aomodules="sun $_aomodules"
4801 else
4802 _def_sunaudio='#undef USE_SUN_AUDIO'
4803 _noaomodules="sun $_noaomodules"
4805 echores "$_sunaudio"
4808 echocheck "Sun mediaLib"
4809 if test "$_mlib" = auto ; then
4810 _mlib=no
4811 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4812 cat > $TMPC << EOF
4813 #include <mlib.h>
4814 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
4816 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
4818 if test "$_mlib" = yes ; then
4819 _def_mlib='#define HAVE_MLIB 1'
4820 _inc_mlib=" -I${_mlibdir}/include "
4821 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
4822 else
4823 _def_mlib='#undef HAVE_MLIB'
4825 echores "$_mlib"
4828 echocheck "SGI audio"
4829 if test "$_sgiaudio" = auto ; then
4830 # check for SGI audio
4831 cat > $TMPC << EOF
4832 #include <dmedia/audio.h>
4833 int main(void) { return 0; }
4835 _sgiaudio=no
4836 cc_check && _sgiaudio=yes
4838 if test "$_sgiaudio" = "yes" ; then
4839 _def_sgiaudio='#define USE_SGI_AUDIO 1'
4840 _ld_sgiaudio='-laudio'
4841 _aosrc="$_aosrc ao_sgi.c"
4842 _aomodules="sgi $_aomodules"
4843 else
4844 _def_sgiaudio='#undef USE_SGI_AUDIO'
4845 _noaomodules="sgi $_noaomodules"
4847 echores "$_sgiaudio"
4850 echocheck "VCD support"
4851 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
4852 _inputmodules="vcd $_inputmodules"
4853 _def_vcd='#define HAVE_VCD 1'
4854 echores "ok"
4855 else
4856 _def_vcd='#undef HAVE_VCD'
4857 _noinputmodules="vcd $_noinputmodules"
4858 echores "not supported on this OS"
4861 echocheck "DVD support (libmpdvdkit)"
4862 if test "$_dvdkit" = auto ; then
4863 _dvdkit=no
4864 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
4865 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
4866 test -f "./libmpdvdkit/Makefile" && _dvdkit=yes
4869 if test "$_dvdkit" = yes ; then
4870 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
4871 if test -f "./libmpdvdkit2/Makefile" ; then
4872 _inputmodules="mpdvdkit2 $_inputmodules"
4873 _dvdread=libmpdvdkit2
4874 _dvdkit2=yes
4875 _dvdkit=no
4876 else
4877 _inputmodules="mpdvdkit $_inputmodules"
4878 _dvdread=libmpdvdkit
4880 else
4881 _noinputmodules="mpdvdkit $_noinputmodules"
4883 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
4884 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
4885 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
4886 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
4887 if linux || netbsd || openbsd || bsdos ; then
4888 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4889 if openbsd ; then
4890 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4892 else
4893 if freebsd ; then
4894 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4895 else
4896 if darwin ; then
4897 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4901 else
4902 _noinputmodules="mpdvdkit $_noinputmodules"
4904 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
4905 echores "yes"
4906 else
4907 echores "no"
4910 echocheck "DVD support (libdvdread)"
4911 if test "$_dvdread" = auto ; then
4912 cat > $TMPC << EOF
4913 #include <inttypes.h>
4914 #include <dvdread/dvd_reader.h>
4915 #include <dvdread/ifo_types.h>
4916 #include <dvdread/ifo_read.h>
4917 #include <dvdread/nav_read.h>
4918 int main(void) { return 0; }
4920 _dvdread=no
4921 if test "$_dl" = yes; then
4922 cc_check \
4923 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
4924 _dvdread=yes
4927 _def_mpdvdkit="#undef USE_MPDVDKIT"
4928 case "$_dvdread" in
4929 yes)
4930 _largefiles=yes
4931 _def_dvdread='#define USE_DVDREAD 1'
4932 _ld_dvdread='-ldvdread'
4933 _inputmodules="dvdread $_inputmodules"
4934 echores "yes"
4937 _def_dvdread='#undef USE_DVDREAD'
4938 _noinputmodules="dvdread $_noinputmodules"
4939 echores "no"
4941 libmpdvdkit)
4942 _largefiles=yes
4943 _def_dvdread='#define USE_DVDREAD 1'
4944 _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
4945 _noinputmodules="dvdread $_noinputmodules"
4946 _def_mpdvdkit="#define USE_MPDVDKIT 1"
4947 echores "disabled by libmpdvdkit"
4949 libmpdvdkit2)
4950 _largefiles=yes
4951 _def_dvdread='#define USE_DVDREAD 1'
4952 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
4953 _noinputmodules="dvdread $_noinputmodules"
4954 _def_mpdvdkit="#define USE_MPDVDKIT 2"
4955 echores "disabled by libmpdvdkit2"
4957 esac
4959 # dvdnav disabled, it does not work
4960 # echocheck "DVD support (libdvdnav)"
4961 # if test "$_dvdnav" = yes ; then
4962 # cat > $TMPC <<EOF
4963 # #include <dvdnav.h>
4964 # int main(void) { dvdnav_t *dvd=0; return 0; }
4965 # EOF
4966 # _dvdnav=no
4967 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
4968 # if test -z "$_dvdnavconfig" ; then
4969 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
4970 # _dvdnavconfig="dvdnav-config"
4971 # fi
4972 # fi
4973 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
4974 # _used_css=
4975 # test "$_dvdkit" = no && test "$_dvdkit2" = no && _used_css=$_ld_css
4976 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
4977 # fi
4978 # if test "$_dvdnav" = yes ; then
4979 # _largefiles=yes
4980 # _def_dvdnav='#define USE_DVDNAV 1'
4981 # if test -n "$_legal_dvdnavdir" ; then
4982 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
4983 # elif test -n "$_dvdnavconfig" ; then
4984 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
4985 # else
4986 # _ld_css="$_ld_css -ldvdnav"
4987 # fi
4988 # if test -n "$_dvdnavconfig" ; then
4989 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
4990 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
4991 # fi
4992 # if test -n "$_dvdnavdir" ; then
4993 # _inc_extra="$_inc_extra -I$_dvdnavdir"
4994 # fi
4995 # _inputmodules="dvdnav $_inputmodules"
4996 # echores "yes"
4997 # else
4998 # _def_dvdnav='#undef USE_DVDNAV'
4999 # _noinputmodules="dvdnav $_noinputmodules"
5000 # echores "no"
5001 # fi
5003 echocheck "cdparanoia"
5004 if test "$_cdparanoia" = auto ; then
5005 cat > $TMPC <<EOF
5006 #include <cdda_interface.h>
5007 #include <cdda_paranoia.h>
5008 // This need a better test. How ?
5009 int main(void) { return 1; }
5011 _cdparanoia=no
5012 if cc_check $_inc_cdparanoia $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm ; then
5013 _cdparanoia=yes
5014 else
5015 for I in /usr/include/cdda /usr/local/include/cdda ; do
5016 if cc_check -I$I $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm ; then
5017 _cdparanoia=yes; _inc_cdparanoia="-I$I"; break
5019 done
5022 if test "$_cdparanoia" = yes ; then
5023 _def_cdparanoia='#define HAVE_CDDA'
5024 _inputmodules="cdda $_inputmodules"
5025 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
5026 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
5027 else
5028 _def_cdparanoia='#undef HAVE_CDDA'
5029 _noinputmodules="cdda $_noinputmodules"
5031 echores "$_cdparanoia"
5034 echocheck "freetype >= 2.0.9"
5036 # freetype depends on iconv
5037 if test "$_iconv" = no ; then
5038 _freetype="no (iconv support needed)"
5041 if test "$_freetype" = auto ; then
5042 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5043 cat > $TMPC << EOF
5044 #include <stdio.h>
5045 #include <ft2build.h>
5046 #include FT_FREETYPE_H
5047 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5048 #error "Need FreeType 2.0.9 or newer"
5049 #endif
5050 int main()
5052 FT_Library library;
5053 FT_Int major=-1,minor=-1,patch=-1;
5054 int err=FT_Init_FreeType(&library);
5055 if(err){
5056 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
5057 exit(err);
5059 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
5060 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
5061 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
5062 (int)major,(int)minor,(int)patch );
5063 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
5064 printf("Library and header version mismatch! Fix it in your distribution!\n");
5065 exit(1);
5067 return 0;
5070 _freetype=no
5071 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _freetype=yes
5072 else
5073 _freetype=no
5076 if test "$_freetype" = yes ; then
5077 _def_freetype='#define HAVE_FREETYPE'
5078 _inc_freetype=`$_freetypeconfig --cflags`
5079 _ld_freetype=`$_freetypeconfig --libs`
5080 else
5081 _def_freetype='#undef HAVE_FREETYPE'
5083 echores "$_freetype"
5085 if test "$_freetype" = no ; then
5086 _fontconfig=no
5088 echocheck "fontconfig"
5089 if test "$_fontconfig" = auto ; then
5090 if ( pkg-config --modversion fontconfig) > /dev/null 2>&1 ; then
5091 cat > $TMPC << EOF
5092 #include <stdio.h>
5093 #include <fontconfig/fontconfig.h>
5094 int main()
5096 int err = FcInit();
5097 if(err == FcFalse){
5098 printf("Couldn't initialize fontconfig lib\n");
5099 exit(err);
5101 return 0;
5105 _fontconfig=no
5106 cc_check `pkg-config --cflags --libs fontconfig` && ( $TMPO >> "$TMPLOG" ) && _fontconfig=yes
5107 else
5108 _fontconfig=no
5111 if test "$_fontconfig" = yes ; then
5112 _def_fontconfig='#define HAVE_FONTCONFIG'
5113 _inc_fontconfig=`pkg-config --cflags fontconfig`
5114 _ld_fontconfig=`pkg-config --libs fontconfig`
5115 else
5116 _def_fontconfig='#undef HAVE_FONTCONFIG'
5118 echores "$_fontconfig"
5120 echocheck "fribidi with charsets"
5121 if test "$_fribidi" = yes ; then
5122 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
5123 cat > $TMPC << EOF
5124 #include <stdio.h>
5125 /* workaround for fribidi 0.10.4 and below */
5126 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
5127 #include <fribidi/fribidi.h>
5128 int main()
5130 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
5131 printf("Fribidi headers are not consistents with the library!\n");
5132 exit(1);
5134 return 0;
5137 _fribidi=no
5138 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _fribidi=yes
5139 else
5140 _fribidi=no
5143 if test "$_fribidi" = yes ; then
5144 _def_fribidi='#define USE_FRIBIDI'
5145 _inc_fribidi=`$_fribidiconfig --cflags`
5146 _ld_fribidi=`$_fribidiconfig --libs`
5147 else
5148 _def_fribidi='#undef USE_FRIBIDI'
5150 echores "$_fribidi"
5153 echocheck "ENCA"
5154 if test "$_enca" = auto ; then
5155 cat > $TMPC << EOF
5156 #include <enca.h>
5157 int main()
5159 const char **langs;
5160 size_t langcnt;
5161 langs = enca_get_languages(&langcnt);
5162 return 0;
5165 _enca=no
5166 cc_check -lenca && _enca=yes
5168 if test "$_enca" = yes ; then
5169 _def_enca='#define HAVE_ENCA 1'
5170 _ld_enca='-lenca'
5171 else
5172 _def_enca='#undef HAVE_ENCA'
5174 echores "$_enca"
5177 echocheck "zlib"
5178 cat > $TMPC << EOF
5179 #include <zlib.h>
5180 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5182 _zlib=no
5183 cc_check -lz && _zlib=yes
5184 if test "$_zlib" = yes ; then
5185 _def_zlib='#define HAVE_ZLIB 1'
5186 _ld_zlib='-lz'
5187 else
5188 _def_zlib='#undef HAVE_ZLIB'
5190 echores "$_zlib"
5193 echocheck "RTC"
5194 if test "$_rtc" = auto ; then
5195 cat > $TMPC << EOF
5196 #include <sys/ioctl.h>
5197 #ifdef __linux__
5198 #include <linux/rtc.h>
5199 #else
5200 #include <rtc.h>
5201 #define RTC_PIE_ON RTCIO_PIE_ON
5202 #endif
5203 int main(void) { return RTC_PIE_ON; }
5205 _rtc=no
5206 cc_check && _rtc=yes
5208 if test "$_rtc" = yes ; then
5209 _def_rtc='#define HAVE_RTC 1'
5210 else
5211 _def_rtc='#undef HAVE_RTC'
5213 echores "$_rtc"
5216 echocheck "external liblzo support"
5217 if test "$_liblzo" = auto ; then
5218 _liblzo=no
5219 cat > $TMPC << EOF
5220 #include <lzo1x.h>
5221 int main(void) { lzo_init();return 0; }
5223 cc_check -llzo && _liblzo=yes
5225 if test "$_liblzo" = yes ; then
5226 _def_liblzo='#define USE_LIBLZO 1'
5227 _ld_liblzo='-llzo'
5228 _codecmodules="liblzo $_codecmodules"
5229 else
5230 _def_liblzo='#undef USE_LIBLZO'
5231 _nocodecmodules="liblzo $_nocodecmodules"
5233 echores "$_liblzo"
5236 echocheck "mad support"
5237 if test "$_mad" = auto ; then
5238 _mad=no
5239 cat > $TMPC << EOF
5240 #include <mad.h>
5241 int main(void) { return 0; }
5243 cc_check $_madlibdir -lmad && _mad=yes
5245 if test "$_mad" = yes ; then
5246 _def_mad='#define USE_LIBMAD 1'
5247 _ld_mad='-lmad'
5248 _codecmodules="libmad $_codecmodules"
5249 else
5250 _def_mad='#undef USE_LIBMAD'
5251 _nocodecmodules="libmad $_nocodecmodules"
5253 echores "$_mad"
5255 echocheck "Toolame"
5256 if test "$_toolame" = auto ; then
5257 cat > $TMPC <<EOF
5258 #include <toolame.h>
5259 int main(void) { toolame_init(); return 0; }
5261 _toolame=no
5262 _toolame_extraflags=""
5263 _toolame_lib="-ltoolame"
5264 if test -n "$_toolamedir"; then
5265 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
5267 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
5269 if test "$_toolame" = yes ; then
5270 _def_toolame='#define HAVE_TOOLAME 1'
5271 _codecmodules="$_codecmodules toolame"
5272 else
5273 _def_toolame='#undef HAVE_TOOLAME'
5274 _toolame_lib=""
5275 _nocodecmodules="toolame $_nocodecmodules"
5277 if test -z "$_toolamedir" ; then
5278 echores "$_toolame"
5279 else
5280 echores "$_toolame (using $_toolamedir)"
5283 echocheck "Twolame"
5284 if test "$_twolame" = auto ; then
5285 cat > $TMPC <<EOF
5286 #include <twolame.h>
5287 int main(void) { twolame_init(); return 0; }
5289 _twolame=no
5290 _twolame_lib="-ltwolame"
5291 cc_check $_twolame_lib $_ld_lm && _twolame=yes
5293 if test "$_twolame" = yes ; then
5294 _def_twolame='#define HAVE_TWOLAME 1'
5295 _codecmodules="$_codecmodules twolame"
5296 else
5297 _def_twolame='#undef HAVE_TWOLAME'
5298 _twolame_lib=""
5299 _nocodecmodules="twolame $_nocodecmodules"
5301 echores "$_twolame"
5303 echocheck "OggVorbis support"
5304 if test "$_tremor_internal" = yes; then
5305 _vorbis=yes
5306 elif test "$_vorbis" = auto; then
5307 _vorbis=no
5308 cat > $TMPC << EOF
5309 #include <vorbis/codec.h>
5310 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5312 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
5314 if test "$_vorbis" = yes ; then
5315 _def_vorbis='#define HAVE_OGGVORBIS 1'
5316 if test "$_tremor_internal" = yes ; then
5317 # do not set _ld_vorbis as it is resolved separately
5318 # mp3lame support for vorbis is deprecated so don't care
5319 _def_tremor='#define TREMOR 1'
5320 if test "$_tremor_low" = yes ; then
5321 _tremor_flags='-D_LOW_ACCURACY_'
5322 else
5323 _tremor_flags=''
5325 _codecmodules="tremor(internal) $_codecmodules"
5326 elif test "$_tremor" = yes ; then
5327 _def_tremor='#define TREMOR 1'
5328 _ld_vorbis='-lvorbisidec'
5329 _codecmodules="tremor $_codecmodules"
5330 else
5331 _def_tremor='#undef TREMOR'
5332 _ld_vorbis='-lvorbis -logg'
5333 _codecmodules="libvorbis $_codecmodules"
5335 else
5336 _def_vorbis='#undef HAVE_OGGVORBIS'
5337 _def_tremor='#undef TREMOR'
5338 _nocodecmodules="libvorbis $_nocodecmodules"
5340 if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
5341 echores "$_vorbis (internal low accuracy Tremor)"
5342 elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
5343 echores "$_vorbis (internal Tremor)"
5344 elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
5345 echores "$_vorbis (Tremor)"
5346 else
5347 echores "$_vorbis"
5350 echocheck "OggTheora support (only the CVS version!)"
5351 if test "$_theora" = auto ; then
5352 _theora=no
5353 cat > $TMPC << EOF
5354 #include <theora/theora.h>
5355 #include <string.h>
5356 int main(void)
5358 /* theora is in flux, make sure that all interface routines and
5359 * datatypes exist and work the way we expect it, so we don't break
5360 * mplayer */
5361 ogg_packet op;
5362 theora_comment tc;
5363 theora_info inf;
5364 theora_state st;
5365 yuv_buffer yuv;
5366 int r;
5367 double t;
5369 theora_info_init (&inf);
5370 theora_comment_init (&tc);
5372 return 0;
5374 /* we don't want to execute this kind of nonsense; just for making sure
5375 * that compilation works... */
5376 memset(&op, 0, sizeof(op));
5377 r = theora_decode_header (&inf, &tc, &op);
5378 r = theora_decode_init (&st, &inf);
5379 t = theora_granule_time (&st, op.granulepos);
5380 r = theora_decode_packetin (&st, &op);
5381 r = theora_decode_YUVout (&st, &yuv);
5382 theora_clear (&st);
5384 return 0;
5387 cc_check -ltheora -logg $_ld_lm && _theora=yes
5389 if test "$_theora" = yes ; then
5390 _def_theora='#define HAVE_OGGTHEORA 1'
5391 _codecmodules="libtheora $_codecmodules"
5392 _ld_theora="-ltheora -logg"
5393 else
5394 _def_theora='#undef HAVE_OGGTHEORA'
5395 _nocodecmodules="libtheora $_nocodecmodules"
5397 echores "$_theora"
5399 echocheck "mp3lib support"
5400 if test "$_mp3lib" = yes ; then
5401 _def_mp3lib='#define USE_MP3LIB 1'
5402 _codecmodules="mp3lib $_codecmodules"
5403 else
5404 _def_mp3lib='#undef USE_MP3LIB'
5405 _nocodecmodules="mp3lib $_nocodecmodules"
5407 echores "$_mp3lib"
5409 echocheck "liba52 support"
5410 if test "$_liba52" = yes ; then
5411 _def_liba52='#define USE_LIBA52 1'
5412 _codecmodules="liba52 $_codecmodules"
5413 else
5414 _def_liba52='#undef USE_LIBA52'
5415 _nocodecmodules="liba52 $_nocodecmodules"
5417 echores "$_liba52"
5419 echocheck "libdts support"
5420 if test "$_libdts" = auto ; then
5421 _libdts=no
5422 cat > $TMPC << EOF
5423 #include <inttypes.h>
5424 #include <dts.h>
5425 int main(void) { dts_init (0); return 0; }
5427 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5429 if test "$_libdts" = yes ; then
5430 _def_libdts='#define CONFIG_DTS 1'
5431 _ld_libdts="$_ld_libdts -ldts $_ld_lm"
5432 _codecmodules="libdts $_codecmodules"
5433 else
5434 _def_libdts='#undef CONFIG_DTS'
5435 _nocodecmodules="libdts $_nocodecmodules"
5437 echores "$_libdts"
5439 echocheck "libmpeg2 support"
5440 if test "$_libmpeg2" = yes ; then
5441 _def_libmpeg2='#define USE_LIBMPEG2 1'
5442 _codecmodules="libmpeg2 $_codecmodules"
5443 else
5444 _def_libmpeg2='#undef USE_LIBMPEG2'
5445 _nocodecmodules="libmpeg2 $_nocodecmodules"
5447 echores "$_libmpeg2"
5450 echocheck "Matroska support"
5451 if test "$_matroska_internal" = yes ; then
5452 _inputmodules="matroska $_inputmodules"
5453 _def_matroska='#define HAVE_MATROSKA 1'
5454 else
5455 _noinputmodules="matroska $_noinputmodules"
5456 _def_matroska='#undef HAVE_MATROSKA'
5458 echores "$_matroska_internal"
5460 echocheck "FAAC (AAC encoder) support"
5461 if test "$_faac" = auto ; then
5462 cat > $TMPC <<EOF
5463 #include <inttypes.h>
5464 #include <faac.h>
5465 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
5467 if ( cc_check -c -O4 -lfaac $_ld_lm ); then
5468 _faac=yes
5469 elif ( cc_check -c -O4 -lfaac -lmp4v2 -lstdc++ $_ld_lm ); then
5470 _faac=yes
5471 _ld_faac="-lmp4v2 -lstdc++"
5472 else
5473 _faac=no
5476 if test "$_faac" = yes ; then
5477 _def_faac="#define HAVE_FAAC 1"
5478 _codecmodules="$_codecmodules faac"
5479 _ld_faac="-lfaac $_ld_faac"
5480 else
5481 _def_faac="#undef HAVE_FAAC"
5482 _nocodecmodules="$_nocodecmodules faac"
5484 echores "$_faac"
5486 echocheck "internal FAAD2 (AAC) support"
5487 _inc_faad="-I`pwd`/libfaad2"
5488 if test "$_faad_internal" = auto ; then
5489 # the faad check needs a config.h file
5490 if not test -f "config.h" ; then
5491 cat > config.h << EOF
5492 /* C99 lrintf function available */
5493 $_def_lrintf
5496 # internal faad: check if our dear gcc is able to compile it...
5497 cp "`pwd`/libfaad2/cfft.c" $TMPC
5498 if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer $_opt_gnu99 -D_GNU_SOURCE $_inc_faad ); then
5499 _faad_internal=yes
5500 else
5501 _faad_internal="no (broken gcc)"
5504 if test "$_faad_internal" = yes ; then
5505 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5506 _faad_external=no
5507 else
5508 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5509 _inc_faad=
5511 echores "$_faad_internal"
5514 echocheck "external FAAD2 (AAC) support"
5515 if test "$_faad_external" != no ; then
5516 _ld_faad='-lfaad'
5517 _inc_faad="$_inc_extra"
5518 # external faad: check if it's really faad2 :)
5519 if test "$_faad_external" = auto ; then
5520 _faad_external=no
5521 cat > $TMPC << EOF
5522 #include <faad.h>
5523 #ifndef FAAD_MIN_STREAMSIZE
5524 #error Too old version
5525 #endif
5526 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5528 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5530 echores "$_faad_external"
5531 else
5532 echores "no"
5535 if test "$_faad_external" = yes; then
5536 _def_faad='#define HAVE_FAAD 1'
5537 _codecmodules="faad2(external) $_codecmodules"
5538 elif test "$_faad_internal" = yes; then
5539 _def_faad='#define HAVE_FAAD 1'
5540 _codecmodules="faad2(internal) $_codecmodules"
5541 else
5542 _def_faad='#undef HAVE_FAAD'
5543 _nocodecmodules="faad2 $_nocodecmodules"
5544 _ld_faad=
5548 echocheck "LADSPA plugin support"
5549 if test "$_ladspa" = auto ; then
5550 cat > $TMPC <<EOF
5551 #include <stdio.h>
5552 #include <ladspa.h>
5553 int main(void) {
5554 const LADSPA_Descriptor *ld = NULL;
5555 return 0;
5558 _ladspa=no
5559 cc_check && _ladspa=yes
5561 if test "$_ladspa" = yes; then
5562 _def_ladspa="#define HAVE_LADSPA"
5563 _afsrc="$_afsrc af_ladspa.c"
5564 _afmodules="ladspa $_afmodules"
5565 else
5566 _def_ladspa="#undef HAVE_LADSPA"
5567 _noafmodules="ladspa $_noafmodules"
5569 echores "$_ladspa"
5572 if test "$_win32" = auto ; then
5573 if x86 ; then
5574 qnx && _win32=no
5575 else
5576 _win32=no # x86 arch only
5580 if test "$_win32" != no ; then
5581 if test -z "$_win32libdir" ; then
5582 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5583 if test -d "$I" ; then
5584 _win32libdir="$I"
5585 break;
5587 done
5591 echocheck "Win32 codec DLL support"
5592 if test "$_win32" = auto ; then
5593 _win32=no
5594 test -n "$_win32libdir" && _win32=yes
5596 if test "$_win32" = yes ; then
5597 _def_win32='#define USE_WIN32DLL 1'
5598 echores "yes (using $_win32libdir)"
5599 else
5600 _def_win32='#undef USE_WIN32DLL'
5601 _nocodecmodules="win32 $_nocodecmodules"
5602 _dshow=no
5603 echores "no"
5606 if test "$_win32" != no ; then
5607 _def_win32_loader='#undef WIN32_LOADER'
5608 echocheck "Win32 loader support"
5609 _ld_win32='loader/libloader.a'
5610 _dep_win32='loader/libloader.a'
5611 _codecmodules="win32 $_codecmodules"
5612 if openbsd ; then
5613 x86 && _ld_win32="$_ld_win32 -li386"
5615 if not win32 ; then
5616 _def_win32_loader='#define WIN32_LOADER 1'
5617 echores "yes"
5618 else
5619 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5620 echores "no (using native windows)"
5624 echocheck "DirectShow"
5625 if false ; then
5627 if test "$_dshow" != no ; then
5628 _dshow=no
5629 # check if compiler supports C++ and C++-libs are installed correctly
5630 cat > "$TMPCPP" << EOF
5631 #include <string>
5632 class myclass {
5633 private: int ret;
5634 public: int myreturn(void);
5636 int myclass::myreturn(void) { ret = 0; return ret ; }
5637 int main(void) { myclass myobject; return myobject.myreturn(); }
5639 echo "------------------------------------------------" >> "$TMPLOG"
5640 cat "$TMPCPP" >> "$TMPLOG"
5641 if ( $_cc "$TMPCPP" -o "$TMPO" && "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
5642 _dshow=yes
5643 echores "yes (C++ is ok)"
5644 else
5645 echores "no"
5646 cat << EOF
5648 Your C++ runtime environment is broken.
5650 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5651 Are the C++ libraries correctly installed?
5652 Check for libstdc++ and in (/etc/)ld.so.conf.
5654 If you do not need DirectShow support, you can also use:
5655 ./configure --disable-dshow <your-normal-configure-options>
5656 to disable building the C++ based DirectShow code.
5659 die "$_cc's C++ is broken"
5665 echores "$_dshow"
5667 if test "$_dshow" = yes ; then
5668 _def_dshow='#define USE_DIRECTSHOW 1'
5669 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5670 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5671 _codecmodules="dshow/dmo $_codecmodules"
5672 else
5673 _def_dshow='#undef USE_DIRECTSHOW'
5674 _nocodecmodules="dshow/dmo $_nocodecmodules"
5678 echocheck "XAnim DLL"
5679 if test "$_xanim" = auto ; then
5680 _xanim=no
5681 if test "$_dl" = yes ; then
5682 if test -z "$_xanimlibdir" ; then
5683 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5684 if test -d "$I" ; then
5685 _xanimlibdir="$I"
5686 break;
5688 done
5690 test "$_xanimlibdir" && _xanim=yes
5691 if test "$_xanim" = yes ; then
5692 echores "yes (using $_xanimlibdir)"
5693 else
5694 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5696 else
5697 echores "no (dynamic loader support needed)"
5699 else
5700 echores "$_xanim (using $_xanimlibdir)"
5702 if test "$_xanim" = yes ; then
5703 _def_xanim='#define USE_XANIM 1'
5704 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5705 _codecmodules="xanim $_codecmodules"
5706 else
5707 _def_xanim='#undef USE_XANIM'
5708 _def_xanim_path='#undef XACODEC_PATH'
5709 _nocodecmodules="xanim $_nocodecmodules"
5712 echocheck "RealPlayer DLL"
5713 if test "$_real" = auto ; then
5714 _real=no
5715 if test "$_dl" = yes || test "$_win32" = yes ; then
5716 # if test "$_dl" = yes ; then
5717 if linux || freebsd || netbsd || win32 || darwin ; then
5718 _real=yes
5719 else
5720 echores "no (tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin)"
5722 if test "$_real" = yes ; then
5723 if test -z "$_reallibdir" ; then
5724 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5725 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5726 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5727 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5728 "$_win32libdir"; do
5729 if test -d "$I" ; then
5730 _reallibdir="$I"
5731 break
5733 done
5735 test "$_reallibdir" || _real=no
5736 if test "$_real" = yes ; then
5737 echores "yes (using $_reallibdir)"
5738 else
5739 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5742 else
5743 echores "no (dynamic loader support needed)"
5745 else
5746 echores "$_real (using $_reallibdir)"
5748 if test "$_real" = yes ; then
5749 _def_real='#define USE_REALCODECS 1'
5750 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5751 _codecmodules="real $_codecmodules"
5752 else
5753 _def_real='#undef USE_REALCODECS'
5754 _def_real_path="#undef REALCODEC_PATH"
5755 _nocodecmodules="real $_nocodecmodules"
5759 echocheck "LIVE.COM Streaming Media libraries"
5760 if test "$_live" = auto && test "$_network" = yes ; then
5761 _TMPC=$TMPC
5762 TMPC=$TMPCPP
5763 cat >$TMPC <<EOF
5764 #include <liveMedia.hh>
5765 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5766 #error Please upgrade to version 2004.07.19 or later of the "LIVE.COM Streaming Media" libraries - available from <www.live.com/liveMedia/>
5767 #endif
5768 int main(void) {}
5771 _live_dist=no
5772 if test -z "$_livelibdir" ; then
5773 if cc_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
5774 _live_dist=yes
5775 else
5776 for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live; do
5777 if test -d "$I" ; then
5778 _livelibdir="$I"
5779 break;
5781 done
5785 if test "$_live_dist" = no && test "$_livelibdir" && cc_check -I$_livelibdir/liveMedia/include \
5786 -I$_livelibdir/UsageEnvironment/include -I$_livelibdir/groupsock/include; then
5787 _live=yes
5788 else
5789 _live=no
5791 TMPC=$_TMPC
5793 if test "$_live" = yes && test "$_network" = yes ; then
5794 echores "yes (using $_livelibdir)"
5795 _def_live='#define STREAMING_LIVE_DOT_COM 1'
5796 _live_libs_def="# LIVE.COM Streaming Media libraries:
5797 LIVE_LIB_DIR = $_livelibdir
5798 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
5799 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
5800 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
5801 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
5802 LIVE_LIBS += -lstdc++
5803 LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include
5804 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include
5805 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
5806 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include"
5807 _ld_live='$(LIVE_LIBS)'
5808 _inputmodules="live.com $_inputmodules"
5809 elif test "$_live_dist" = yes && test "$_network" = yes ; then
5810 echores "yes (using distribution version)"
5811 _live="yes"
5812 _def_live='#define STREAMING_LIVE_DOT_COM 1'
5813 _live_libs_def="# LIVE.COM Streaming Media libraries:
5814 LIVE_LIB_DIR = $_livelibdir
5815 LIVE_LIBS = -lliveMedia
5816 LIVE_LIBS += -lgroupsock
5817 LIVE_LIBS += -lUsageEnvironment
5818 LIVE_LIBS += -lBasicUsageEnvironment
5819 LIVE_LIBS += -lstdc++
5820 LIVE_INCLUDES = -I/usr/include/liveMedia
5821 LIVE_INCLUDES += -I/usr/include/UsageEnvironment
5822 LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment
5823 LIVE_INCLUDES += -I/usr/include/groupsock"
5824 _ld_live='$(LIVE_LIBS)'
5825 _inputmodules="live.com $_inputmodules"
5826 else
5827 echores "no"
5828 _def_live='#undef STREAMING_LIVE_DOT_COM'
5829 _noinputmodules="live.com $_noinputmodules"
5833 echocheck "FFmpeg libavcodec (static)"
5834 if test "$_libavcodec" = auto ; then
5835 # Note: static linking is preferred to dynamic linking
5836 _libavcodec=no
5837 if test -d libavcodec && test -f libavcodec/utils.c ; then
5838 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
5839 _libavcodec=yes
5840 echores "yes"
5841 else
5842 echores "no (old ffmpeg version, use CVS !)"
5844 else
5845 echores "no (see DOCS/HTML/$_doc_lang/codecs.html)"
5847 else
5848 echores "$_libavcodec"
5851 echocheck "FFmpeg libavformat (static)"
5852 if test "$_libavformat" = auto ; then
5853 # Note: static linking is preferred to dynamic linking
5854 _libavformat=no
5855 if test -d libavformat && test -f libavformat/utils.c ; then
5856 _libavformat=yes
5857 echores "yes"
5858 else
5859 echores "no"
5861 else
5862 echores "$_libavformat"
5865 _def_haveffpostprocess='no'
5866 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
5867 _def_haveffpostprocess='yes'
5870 if test "$_libavcodec" != yes ; then
5871 echocheck "FFmpeg libavcodec (dynamic)"
5872 if test "$_libavcodecso" = auto ; then
5873 _libavcodecso=no
5874 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
5875 cat > $TMPC << EOF
5876 #define FF_POSTPROCESS 1
5877 #include <ffmpeg/avcodec.h>
5878 int main(void) {
5879 avcodec_find_encoder_by_name("");
5880 return 0;
5883 if cc_check -lavcodec $_ld_lm ; then
5884 _libavcodecso=yes
5885 echores "yes (using libavcodec.so)"
5886 else
5887 echores "no (libavcodec.so is broken/obsolete)"
5889 else
5890 echores "$_libavcodecso"
5894 _def_libavcodec='#undef USE_LIBAVCODEC'
5895 _def_libavcodecso='#undef USE_LIBAVCODEC_SO'
5896 _def_ffpostprocess='#undef FF_POSTPROCESS'
5897 if test "$_libavcodec" = yes ; then
5898 _def_libavcodec='#define USE_LIBAVCODEC 1'
5899 _ld_libavcodec='libavcodec/libavcodec.a'
5900 _dep_libavcodec='libavcodec/libavcodec.a'
5901 _def_ffpostprocess='#define FF_POSTPROCESS 1'
5902 _codecmodules="libavcodec $_codecmodules"
5903 elif test "$_libavcodecso" = yes ; then
5904 _def_libavcodec='#define USE_LIBAVCODEC 1'
5905 _def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
5906 _ld_libavcodec='-lavcodec'
5907 _codecmodules="libavcodec.so $_codecmodules"
5908 else
5909 _nocodecmodules="libavcodec $_nocodecmodules"
5912 _def_libavformat='#undef USE_LIBAVFORMAT'
5913 _def_libavformat_win32='#undef CONFIG_WIN32'
5914 if test "$_libavformat" = yes ; then
5915 _def_libavformat='#define USE_LIBAVFORMAT 1'
5916 _ld_libavformat='libavformat/libavformat.a'
5917 _dep_libavformat='libavformat/libavformat.a'
5918 if win32 ; then
5919 _def_libavformat_win32='#define CONFIG_WIN32 1'
5923 echocheck "amr narrowband"
5924 _echomsg=""
5925 if test "$_amr_nb" = auto ; then
5926 if test -f libavcodec/amr_float/sp_dec.c ; then
5927 if test "$_libavcodec" = yes ; then
5928 _amr_nb=yes
5929 else
5930 _amr_nb=no
5931 _echomsg "libavcodec (static) is required by amr_nb, sorry"
5933 else
5934 _amr_nb=no
5937 if test "$_amr_nb" = yes ; then
5938 _def_amr_nb='#define AMR_NB 1'
5939 else
5940 _def_amr_nb='#undef AMR_NB'
5942 echores "$_amr_nb $_echomsg"
5944 echocheck "amr narrowband, fixed point"
5945 _echomsg=""
5946 if test "$_amr_nb_fixed" = auto ; then
5947 if test -f libavcodec/amr/dtx_dec.c ; then
5948 if test "$_libavcodec" = yes ; then
5949 if test "$_amr_nb" = no ; then
5950 _amr_nb_fixed=yes
5951 else
5952 _amr_nb_fixed=no
5953 _echomsg="(disabled by amr_nb)"
5955 else
5956 _amr_nb_fixed=no
5957 _echomsg "libavcodec (static) is required by amr_nb-fixed, sorry"
5959 else
5960 _amr_nb_fixed=no
5963 if test "$_amr_nb_fixed" = yes ; then
5964 _def_amr_nb='#define AMR_NB 1'
5965 _def_amr_nb_fixed='#define AMR_NB_FIXED 1'
5966 _amr_nb=yes;
5967 else
5968 _def_amr_nb_fixed='#undef AMR_NB_FIXED'
5970 echores "$_amr_nb_fixed $_echomsg"
5972 if test "$_amr_nb" = yes ; then
5973 _codecmodules="amr_nb $_codecmodules"
5974 else
5975 _nocodecmodules="amr_nb $_nocodecmodules"
5978 echocheck "amr wideband"
5979 _echomsg=""
5980 if test "$_amr_wb" = auto ; then
5981 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
5982 if test "$_libavcodec" = yes ; then
5983 _amr_wb=yes
5984 else
5985 _amr_wb=no
5986 _echomsg="libavcodec (static) is required by amr_wb, sorry"
5988 else
5989 _amr_wb=no
5992 if test "$_amr_wb" = yes ; then
5993 _def_amr_wb='#define AMR_WB 1'
5994 _codecmodules="amr_wb $_codecmodules"
5995 else
5996 _def_amr_wb='#undef AMR_WB'
5997 _nocodecmodules="amr_wb $_nocodecmodules"
5999 echores "$_amr_wb $_echomsg"
6001 echocheck "libdv-0.9.5+"
6002 if test "$_libdv" = auto ; then
6003 _libdv=no
6004 cat > $TMPC <<EOF
6005 #include <libdv/dv.h>
6006 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6008 cc_check -ldv $_ld_lm && _libdv=yes
6010 if test "$_libdv" = yes ; then
6011 _def_libdv='#define HAVE_LIBDV095 1'
6012 _ld_libdv="-ldv"
6013 _codecmodules="libdv $_codecmodules"
6014 else
6015 _def_libdv='#undef HAVE_LIBDV095'
6016 _nocodecmodules="libdv $_nocodecmodules"
6018 echores "$_libdv"
6020 echocheck "zr"
6021 if test "$_zr" = auto ; then
6022 #36067's seem to identify themselves as 36057PQC's, so the line
6023 #below should work for 36067's and 36057's.
6024 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
6025 _zr=yes
6026 else
6027 _zr=no
6030 if test "$_zr" = yes ; then
6031 if test "$_libavcodec" = yes ; then
6032 _def_zr='#define HAVE_ZR 1'
6033 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
6034 _vomodules="zr zr2 $_vomodules"
6035 echores "$_zr"
6036 else
6037 echores "libavcodec (static) is required by zr, sorry"
6038 _novomodules="zr $_novomodules"
6039 _def_zr='#undef HAVE_ZR'
6041 else
6042 _def_zr='#undef HAVE_ZR'
6043 _novomodules="zr zr2 $_novomodules"
6044 echores "$_zr"
6047 echocheck "bl"
6048 if test "$_bl" = yes ; then
6049 _def_bl='#define HAVE_BL 1'
6050 _vosrc="$_vosrc vo_bl.c"
6051 _vomodules="bl $_vomodules"
6052 else
6053 _def_bl='#undef HAVE_BL'
6054 _novomodules="bl $_novomodules"
6056 echores "$_bl"
6058 echocheck "XviD"
6059 cat > $TMPC << EOF
6060 #include <xvid.h>
6061 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
6063 _ld_xvid="$_ld_xvid -lxvidcore $_ld_lm"
6064 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
6065 _xvid=yes
6066 _def_xvid3='#define HAVE_XVID3 1'
6067 _def_xvid4='#undef HAVE_XVID4'
6068 _codecmodules="xvid $_codecmodules"
6069 else
6070 cat > $TMPC << EOF
6071 #include <xvid.h>
6072 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6074 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
6075 _xvid=yes
6076 _def_xvid3='#undef HAVE_XVID3'
6077 _def_xvid4='#define HAVE_XVID4 1'
6078 _codecmodules="xvid $_codecmodules"
6079 else
6080 _xvid=no
6081 _ld_xvid=''
6082 _def_xvid3='#undef HAVE_XVID3'
6083 _def_xvid4='#undef HAVE_XVID4'
6084 _nocodecmodules="xvid $_nocodecmodules"
6087 echores "$_xvid"
6089 _xvidcompat=no
6090 _def_decore_xvid='#undef DECORE_XVID'
6091 _def_encore_xvid='#undef ENCORE_XVID'
6092 if test "$_xvid" = yes ; then
6093 echocheck "DivX4 compatibility in XviD"
6094 cat > $TMPC << EOF
6095 #include <divx4.h>
6096 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
6098 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
6099 echores "$_xvidcompat"
6102 echocheck "x264"
6103 cat > $TMPC << EOF
6104 #include <inttypes.h>
6105 #include <x264.h>
6106 #if X264_BUILD < 29
6107 #error We do not support old versions of x264. Get the latest from SVN.
6108 #endif
6109 int main(void) { x264_encoder_open((void*)0); return 0; }
6111 _ld_x264="$_ld_x264 -lx264 $_ld_lm $_ld_pthread"
6112 if test "$_x264" != no && cc_check $_inc_x264 $_ld_x264 ; then
6113 _x264=yes
6114 _def_x264='#define HAVE_X264 1'
6115 _codecmodules="x264 $_codecmodules"
6116 else
6117 _x264=no
6118 _ld_x264=''
6119 _def_x264='#undef HAVE_X264'
6120 _nocodecmodules="x264 $_nocodecmodules"
6122 echores "$_x264"
6124 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
6125 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
6126 cat > $TMPC << EOF
6127 #include <decore.h>
6128 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
6130 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6131 _opendivx=no
6132 _ld_decore='-ldivxdecore'
6133 _def_decore='#define NEW_DECORE 1'
6134 _def_divx='#define USE_DIVX'
6135 _def_divx5='#undef DECORE_DIVX5'
6136 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6137 _codecmodules="divx4linux $_codecmodules"
6138 echores "DivX4linux (with libdivxdecore.so)"
6139 else
6140 # if test "$_divx4linux" != no ; then
6141 # DivX5 check
6142 # OdivxPP disabled because of:
6143 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
6144 cat > $TMPC << EOF
6145 #include <decore.h>
6146 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
6148 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
6149 _opendivx=no
6150 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
6151 _ld_decore='-ldivxdecore'
6152 _def_decore='#define NEW_DECORE 1'
6153 _def_divx='#define USE_DIVX'
6154 _def_divx5='#define DECORE_DIVX5 1'
6155 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6156 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6157 _codecmodules="divx5linux $_codecmodules"
6158 _nocodecmodules="divx4linux $_nocodecmodules"
6159 echores "DivX5linux (with libdivxdecore.so)"
6160 elif test "$_opendivx" != no ; then
6161 _opendivx=yes
6162 _ld_decore='opendivx/libdecore.a'
6163 _def_decore='#undef NEW_DECORE'
6164 _def_divx='#define USE_DIVX'
6165 _def_divx5='#undef DECORE_DIVX5'
6166 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
6167 _codecmodules="opendivx $_codecmodules"
6168 _nocodecmodules="divx5linux $_nocodecmodules"
6169 echores "OpenDivX"
6170 elif test "$_xvidcompat" = yes ; then
6171 _opendivx=no
6172 _ld_decore=''
6173 _def_decore='#define NEW_DECORE 1'
6174 _def_divx='#define USE_DIVX 1'
6175 _def_divx5='#undef DECORE_DIVX5'
6176 _def_decore_xvid='#define DECORE_XVID 1'
6177 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6178 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
6179 echores "XviD compat."
6180 else
6181 _opendivx=no
6182 _ld_decore=''
6183 _def_decore='#undef NEW_DECORE'
6184 _def_divx='#undef USE_DIVX'
6185 _def_divx5='#undef DECORE_DIVX5'
6186 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6187 _nocodecmodules="opendivx $_nocodecmodules"
6188 echores "no"
6189 fi # DivX5 check
6193 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6194 if test "$_mencoder" != no ; then
6196 echocheck "libmp3lame (for mencoder)"
6197 _mp3lame=no
6198 cat > $TMPC <<EOF
6199 #include <lame/lame.h>
6200 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; }
6202 # Note: libmp3lame usually depends on vorbis
6203 cc_check -lmp3lame $_ld_vorbis $_ld_lm && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _mp3lame=yes
6204 if test "$_mp3lame" = yes ; then
6205 _def_mp3lame="#define HAVE_MP3LAME `$TMPO`"
6206 _def_cfg_mp3lame="#define CONFIG_MP3LAME `$TMPO`"
6207 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6208 else
6209 _def_mp3lame='#undef HAVE_MP3LAME'
6210 _def_cfg_mp3lame='#undef CONFIG_MP3LAME'
6212 echores "$_mp3lame"
6215 echocheck "DivX4linux encore (for mencoder)"
6216 cat > $TMPC << EOF
6217 #include <encore2.h>
6218 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
6220 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
6221 _def_encore='#define HAVE_DIVX4ENCORE 1'
6222 _ld_encore='-ldivxencore'
6223 echores "DivX4linux (with libdivxencore.so)"
6224 elif test "$_xvidcompat" = yes ; then
6225 _def_encore='#define HAVE_DIVX4ENCORE 1'
6226 _ld_encore=''
6227 _def_encore_xvid='#define ENCORE_XVID 1'
6228 echores "XviD compat."
6229 else
6230 _def_encore='#undef HAVE_DIVX4ENCORE'
6231 echores "no"
6236 echocheck "mencoder"
6237 _mencoder_flag='#undef HAVE_MENCODER'
6238 if test "$_mencoder" = yes ; then
6239 _mencoder_flag='#define HAVE_MENCODER'
6241 echores "$_mencoder"
6243 echocheck "fastmemcpy"
6244 # fastmemcpy check is done earlier with tests of CPU & binutils features
6245 if test "$_fastmemcpy" = yes ; then
6246 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6247 else
6248 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6250 echores "$_fastmemcpy"
6252 echocheck "UniquE RAR File Library"
6253 if test "$_unrarlib" = yes ; then
6254 _def_unrarlib='#define USE_UNRARLIB 1'
6255 else
6256 _def_unrarlib='#undef USE_UNRARLIB'
6258 echores "$_unrarlib"
6260 echocheck "TV interface"
6261 if test "$_tv" = yes ; then
6262 _def_tv='#define USE_TV 1'
6263 _inputmodules="tv $_inputmodules"
6264 else
6265 _noinputmodules="tv $_noinputmodules"
6266 _def_tv='#undef USE_TV'
6268 echores "$_tv"
6270 echocheck "EDL support"
6271 if test "$_edl" = yes ; then
6272 _def_edl='#define USE_EDL'
6273 _inputmodules="edl $_inputmodules"
6274 else
6275 _noinputmodules="edl $_noinputmodules"
6276 _def_edl='#undef USE_EDL'
6278 echores "$_edl"
6280 echocheck "*BSD BrookTree 848 TV interface"
6281 if test "$_tv_bsdbt848" = auto ; then
6282 _tv_bsdbt848=no
6283 if test "$_tv" = yes ; then
6284 cat > $TMPC <<EOF
6285 #include <sys/types.h>
6286 #if defined(__NetBSD__)
6287 #include <dev/ic/bt8xx.h>
6288 #else
6289 #include <machine/ioctl_bt848.h>
6290 #endif
6291 int main(void) { return 0; }
6293 cc_check && _tv_bsdbt848=yes
6296 if test "$_tv_bsdbt848" = yes ; then
6297 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6298 _inputmodules="tv-bsdbt848 $_inputmodules"
6299 else
6300 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6301 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6303 echores "$_tv_bsdbt848"
6305 echocheck "Video 4 Linux TV interface"
6306 if test "$_tv_v4l" = auto ; then
6307 _tv_v4l=no
6308 if test "$_tv" = yes && linux ; then
6309 for I in /dev/video /dev/video? ; do
6310 if test -c $I ; then
6311 cat > $TMPC <<EOF
6312 #include <stdlib.h>
6313 #include <linux/videodev.h>
6314 int main(void) { return 0; }
6316 cc_check && _tv_v4l=yes
6317 break
6319 done
6322 if test "$_tv_v4l" = yes ; then
6323 _def_tv_v4l='#define HAVE_TV_V4L 1'
6324 _inputmodules="tv-v4l $_inputmodules"
6325 else
6326 _noinputmodules="tv-v4l $_noinputmodules"
6327 _def_tv_v4l='#undef HAVE_TV_V4L'
6329 echores "$_tv_v4l"
6332 echocheck "Video 4 Linux 2 TV interface"
6333 if test "$_tv_v4l2" = auto ; then
6334 _tv_v4l2=no
6335 if test "$_tv" = yes && linux ; then
6336 for I in /dev/video /dev/video? ; do
6337 if test -c $I ; then
6338 _tv_v4l2=yes
6339 break
6341 done
6344 if test "$_tv_v4l2" = yes ; then
6345 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6346 _inputmodules="tv-v4l2 $_inputmodules"
6347 else
6348 _noinputmodules="tv-v4l2 $_noinputmodules"
6349 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6351 echores "$_tv_v4l2"
6354 echocheck "audio select()"
6355 if test "$_select" = no ; then
6356 _def_select='#undef HAVE_AUDIO_SELECT'
6357 elif test "$_select" = yes ; then
6358 _def_select='#define HAVE_AUDIO_SELECT 1'
6360 echores "$_select"
6363 echocheck "network"
6364 # FIXME network check
6365 if test "$_network" != no ; then
6366 _def_network='#define MPLAYER_NETWORK 1'
6367 _ld_network="$_ld_sock"
6368 _inputmodules="network $_inputmodules"
6369 else
6370 _noinputmodules="network $_noinputmodules"
6371 _def_network='#undef MPLAYER_NETWORK'
6372 _ftp=no
6374 echores "$_network"
6376 echocheck "ftp"
6377 if (not beos) && (test "$_ftp" != no) ; then
6378 _def_ftp='#define HAVE_FTP 1'
6379 _inputmodules="ftp $_inputmodules"
6380 else
6381 _noinputmodules="ftp $_noinputmodules"
6382 _def_ftp='#undef HAVE_FTP'
6384 echores "$_ftp"
6386 echocheck "vstream client"
6387 if test "$_vstream" = auto ; then
6388 _vstream=no
6389 cat > $TMPC <<EOF
6390 #include <vstream-client.h>
6391 void vstream_error(const char *format, ... ) {}
6392 int main(void) { vstream_start(); return 0; }
6394 cc_check -lvstream-client && _vstream=yes
6396 if test "$_vstream" = yes ; then
6397 _def_vstream='#define HAVE_VSTREAM 1'
6398 _inputmodules="vstream $_inputmodules"
6399 _ld_vstream='-lvstream-client'
6400 else
6401 _noinputmodules="vstream $_noinputmodules"
6402 _def_vstream='#undef HAVE_VSTREAM'
6404 echores "$_vstream"
6406 # endian testing
6407 echocheck "byte order"
6408 if test "$_big_endian" = auto ; then
6409 cat > $TMPC <<EOF
6410 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6411 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6412 int main(){
6413 char* s = (char*)ascii_name;
6414 return 0;
6417 if cc_check ; then
6418 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6419 _big_endian=yes
6420 else
6421 _big_endian=no
6423 else
6424 echo -n "failed to autodetect byte order, defaulting to "
6427 if test "$_big_endian" = yes ; then
6428 _byte_order='big-endian'
6429 _def_words_endian='#define WORDS_BIGENDIAN 1'
6430 else
6431 _byte_order='little-endian'
6432 _def_words_endian='#undef WORDS_BIGENDIAN'
6434 echores "$_byte_order"
6436 echocheck "shared postprocess lib"
6437 echores "$_shared_pp"
6439 echocheck "OSD menu"
6440 if test "$_menu" = yes ; then
6441 _def_menu='#define HAVE_MENU 1'
6442 else
6443 _def_menu='#undef HAVE_MENU'
6445 echores "$_menu"
6447 # Check to see if they want QTX codecs enabled
6448 echocheck "QTX codecs"
6449 if test "$_qtx" = auto ; then
6450 _qtx=$_win32
6452 if test "$_qtx" = yes ; then
6453 _def_qtx='#define USE_QTX_CODECS 1'
6454 _codecmodules="qtx $_codecmodules"
6455 else
6456 _def_qtx='#undef USE_QTX_CODECS'
6457 _nocodecmodules="qtx $_nocodecmodules"
6459 echores "$_qtx"
6462 echocheck "Subtitles sorting"
6463 if test "$_sortsub" = yes ; then
6464 _def_sortsub='#define USE_SORTSUB 1'
6465 else
6466 _def_sortsub='#undef USE_SORTSUB'
6468 echores "$_sortsub"
6471 echocheck "XMMS inputplugin support"
6472 if test "$_xmms" = yes ; then
6474 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6475 if test -z "$_xmmsplugindir" ; then
6476 _xmmsplugindir=`xmms-config --input-plugin-dir`
6478 if test -z "$_xmmslibdir" ; then
6479 _xmmslibdir=`xmms-config --exec-prefix`/lib
6481 else
6482 if test -z "$_xmmsplugindir" ; then
6483 _xmmsplugindir=/usr/lib/xmms/Input
6485 if test -z "$_xmmslibdir" ; then
6486 _xmmslibdir=/usr/lib
6490 _def_xmms='#define HAVE_XMMS 1'
6491 if darwin ; then
6492 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6493 else
6494 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6496 else
6497 _def_xmms='#undef HAVE_XMMS'
6499 echores "$_xmms"
6501 echocheck "inet6"
6502 if test "$_inet6" = auto ; then
6503 cat > $TMPC << EOF
6504 #include <sys/types.h>
6505 #include <sys/socket.h>
6506 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6508 _inet6=no
6509 if cc_check ; then
6510 _inet6=yes
6513 if test "$_inet6" = yes ; then
6514 _def_inet6='#define HAVE_AF_INET6 1'
6515 else
6516 _def_inet6='#undef HAVE_AF_INET6'
6518 echores "$_inet6"
6521 echocheck "gethostbyname2"
6522 if test "$_gethostbyname2" = auto ; then
6523 cat > $TMPC << EOF
6524 #include <sys/types.h>
6525 #include <sys/socket.h>
6526 #include <netdb.h>
6527 int main(void) { gethostbyname2("", AF_INET); }
6529 _gethostbyname2=no
6530 if cc_check ; then
6531 _gethostbyname2=yes
6535 if test "$_gethostbyname2" = yes ; then
6536 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6537 else
6538 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6540 echores "$_gethostbyname2"
6542 # --------------- GUI specific tests begin -------------------
6543 echocheck "GUI"
6544 echo "$_gui"
6545 if test "$_gui" = yes ; then
6547 # Required libraries
6548 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6549 test "$_x11" != yes && die "X11 support required for GUI compilation"
6551 echocheck "XShape extension"
6552 _xshape=no
6553 if test "$_x11" = yes ; then
6554 cat > $TMPC << EOF
6555 #include <X11/Xlib.h>
6556 #include <X11/Xproto.h>
6557 #include <X11/Xutil.h>
6558 #include <X11/extensions/shape.h>
6559 #include <stdlib.h>
6560 int main(void) {
6561 char *name = ":0.0";
6562 Display *wsDisplay;
6563 int exitvar = 0;
6564 int eventbase, errorbase;
6565 if (getenv("DISPLAY"))
6566 name=getenv("DISPLAY");
6567 wsDisplay=XOpenDisplay(name);
6568 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6569 exitvar=1;
6570 XCloseDisplay(wsDisplay);
6571 return exitvar;
6574 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6576 if test "$_xshape" = yes ; then
6577 _def_xshape='#define HAVE_XSHAPE 1'
6578 else
6579 die "The GUI requires the X11 extension XShape (which was not found)."
6581 echores "$_xshape"
6584 # Check for GTK:
6585 echocheck "GTK version"
6586 if test -z "$_gtkconfig" ; then
6587 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6588 _gtkconfig="gtk-config"
6589 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6590 _gtkconfig="gtk12-config"
6591 else
6592 die "The GUI requires GTK devel packages (which were not found)."
6595 _gtk=`$_gtkconfig --version 2>&1`
6596 _inc_gtk=`$_gtkconfig --cflags 2>&1`
6597 _ld_gtk=`$_gtkconfig --libs 2>&1`
6598 echores "$_gtk (using $_gtkconfig)"
6600 # Check for GLIB
6601 echocheck "glib version"
6602 if test -z "$_glibconfig" ; then
6603 if ( glib-config --version ) >/dev/null 2>&1 ; then
6604 _glibconfig="glib-config"
6605 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
6606 _glibconfig="glib12-config"
6607 else
6608 die "The GUI requires GLib devel packages (which were not found)"
6611 _glib=`$_glibconfig --version 2>&1`
6612 _inc_glib=`$_glibconfig --cflags 2>&1`
6613 _ld_glib=`$_glibconfig --libs 2>&1`
6614 echores "$_glib (using $_glibconfig)"
6616 _def_gui='#define HAVE_NEW_GUI 1'
6617 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6619 echo "Creating Gui/config.mak"
6620 cat > Gui/config.mak << EOF
6621 # -------- Generated by configure -----------
6623 GTKINC = $_inc_gtk
6624 GTKLIBS = $_ld_gtk
6625 GLIBINC = $_inc_glib
6626 GLIBLIBS = $_ld_glib
6630 else
6631 _def_gui='#undef HAVE_NEW_GUI'
6633 # --------------- GUI specific tests end -------------------
6637 #############################################################################
6639 # Checking for CFLAGS
6640 _stripbinaries=yes
6641 if test "$_profile" != "" || test "$_debug" != "" ; then
6642 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
6643 if test "$_cc_major" -ge "3" ; then
6644 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
6646 _stripbinaries=no
6647 elif test -z "$CFLAGS" ; then
6648 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
6649 # always compile with '-g' if .developer:
6650 if test -f ".developer" ; then
6651 CFLAGS="-g $CFLAGS"
6652 if (test "$_crash_debug" = auto) && (not mingw32) ; then
6653 _crash_debug=yes
6655 _stripbinaries=no
6657 else
6658 cat <<EOF
6660 MPlayer compilation will use the CFLAGS set by you, but:
6662 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6664 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6665 To do so, execute 'CFLAGS= ./configure <options>'
6670 echocheck "automatic gdb attach"
6671 if test "$_crash_debug" = yes ; then
6672 _def_crash_debug='#define CRASH_DEBUG 1'
6673 else
6674 _def_crash_debug='#undef CRASH_DEBUG'
6675 _crash_debug=no
6677 echores "$_crash_debug"
6679 if darwin ; then
6680 CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN"
6681 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
6682 CFLAGS="$CFLAGS -no-cpp-precomp"
6685 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
6686 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
6688 if hpux ; then
6689 # use flag for HPUX missing setenv()
6690 CFLAGS="$CFLAGS -DHPUX"
6692 # Thread support
6693 if linux ; then
6694 CFLAGS="$CFLAGS -D_REENTRANT"
6695 elif bsd ; then
6696 # FIXME bsd needs this so maybe other OS'es
6697 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6699 # 64 bit file offsets?
6700 if test "$_largefiles" = yes || freebsd ; then
6701 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6702 if test "$_dvdread" = yes ; then
6703 # dvdread support requires this (for off64_t)
6704 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6708 echocheck "compiler support for -fno-PIC"
6709 if x86; then
6710 cat > $TMPC <<EOF
6711 int main(void) { return 0; }
6713 if cc_check -fno-PIC ; then
6714 CFLAGS="-fno-PIC $CFLAGS"
6715 echores "yes"
6716 else
6717 echores "no"
6719 else
6720 echores "only used for x86"
6723 echocheck "compiler support for noexecstack"
6724 cat > $TMPC <<EOF
6725 int main(void) { return 0; }
6727 if cc_check -Wl,-z,noexecstack ; then
6728 _ld_extra="-Wl,-z,noexecstack $_ld_extra"
6729 echores "yes"
6730 else
6731 echores "no"
6734 echocheck "ftello()"
6735 # if we don't have ftello use the osdep/ compatibility module
6736 cat > $TMPC << EOF
6737 #include <stdio.h>
6738 #include <sys/types.h>
6739 int main (void) { ftello(stdin); return 0; }
6741 _ftello=no
6742 cc_check && _ftello=yes
6743 if test "$_ftello" = yes ; then
6744 _def_ftello='#define HAVE_FTELLO 1'
6745 else
6746 _def_ftello='#undef HAVE_FTELLO'
6748 echores "$_ftello"
6750 # Determine OS dependent libs
6751 if cygwin ; then
6752 _def_confwin32='#define WIN32'
6753 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
6754 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
6755 CFLAGS="$CFLAGS -D__CYGWIN__"
6758 if win32 ; then
6759 _confwin32='TARGET_WIN32 = yes'
6760 else
6761 _confwin32='TARGET_WIN32 = no'
6764 # Dynamic linking flags
6765 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6766 _ld_dl_dynamic=''
6767 bsd && _ld_dl_dynamic='-rdynamic'
6768 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx ; then
6769 _ld_dl_dynamic='-rdynamic'
6772 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6773 bsdos && _ld_arch="$_ld_arch -ldvd"
6774 if netbsd ; then
6775 x86 && _ld_arch="$_ld_arch -li386"
6778 _def_debug='#undef MP_DEBUG'
6779 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
6781 _def_linux='#undef TARGET_LINUX'
6782 linux && _def_linux='#define TARGET_LINUX 1'
6784 # TODO cleanup the VIDIX stuff here
6785 _def_vidix='#define CONFIG_VIDIX 1'
6786 test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX'
6787 if test "$_vidix" = yes; then
6788 _vosrc="$_vosrc vo_cvidix.c"
6789 _vomodules="cvidix $_vomodules"
6790 else
6791 _novomodules="cvidix $_novomodules"
6793 if test "$_vidix" = yes && (win32); then
6794 _vosrc="$_vosrc vo_winvidix.c"
6795 _vomodules="winvidix $_vomodules"
6796 _ld_win32libs="-lgdi32 $_ld_win32libs"
6797 else
6798 _novomodules="winvidix $_novomodules"
6800 if test "$_vidix" = yes && test "$_x11" = yes; then
6801 _vosrc="$_vosrc vo_xvidix.c"
6802 _vomodules="xvidix $_vomodules"
6803 else
6804 _novomodules="xvidix $_novomodules"
6806 echo Checking for VIDIX ... "$_vidix"
6808 _def_joystick='#undef HAVE_JOYSTICK'
6809 if test "$_joystick" = yes ; then
6810 if linux ; then
6811 # TODO add some check
6812 _def_joystick='#define HAVE_JOYSTICK 1'
6813 else
6814 _joystick="no (unsupported under $system_name)"
6817 echo Checking for joystick ... "$_joystick"
6819 echocheck "lirc"
6820 if test "$_lirc" = auto ; then
6821 _lirc=no
6822 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
6823 cat > $TMPC <<EOF
6824 #include <lirc/lirc_client.h>
6825 int main(void) { return 0; }
6827 cc_check -llirc_client && _lirc=yes
6830 if test "$_lirc" = yes ; then
6831 _def_lirc='#define HAVE_LIRC 1'
6832 _ld_lirc='-llirc_client'
6833 else
6834 _def_lirc='#undef HAVE_LIRC'
6836 echores "$_lirc"
6838 echocheck "lircc"
6839 if test "$_lircc" = auto ; then
6840 _lircc=no
6841 cat > $TMPC <<EOF
6842 #include <lirc/lircc.h>
6843 int main(void) { return 0; }
6845 cc_check -llircc && _lircc=yes
6847 if test "$_lircc" = yes ; then
6848 _def_lircc='#define HAVE_LIRCC 1'
6849 _ld_lircc='-llircc'
6850 else
6851 _def_lircc='#undef HAVE_LIRCC'
6853 echores "$_lircc"
6855 #############################################################################
6856 echo "Creating config.mak"
6857 cat > config.mak << EOF
6858 # -------- Generated by configure -----------
6860 LANG = C
6861 MAN_LANG = $MAN_LANG
6862 TARGET_OS = $system_name
6863 DESTDIR =
6864 prefix = \$(DESTDIR)$_prefix
6865 BINDIR = \$(DESTDIR)$_bindir
6866 DATADIR = \$(DESTDIR)$_datadir
6867 MANDIR = \$(DESTDIR)$_mandir
6868 CONFDIR = \$(DESTDIR)$_confdir
6869 LIBDIR = \$(DESTDIR)$_libdir
6870 # FFmpeg uses libdir instead of LIBDIR
6871 libdir = \$(LIBDIR)
6872 #AR = ar
6873 CC = $_cc
6874 HOST_CC = $_host_cc
6875 AWK = $_awk
6876 RANLIB = $_ranlib
6877 INSTALL = $_install
6878 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
6879 EXTRA_INC = $_inc_extra $_inc_gtk
6880 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC) $_opt_gnu99
6881 STRIPBINARIES = $_stripbinaries
6882 CHARSET = $_charset
6883 HELP_FILE = $_mp_help
6885 PRG = $_prg
6886 PRG_MENCODER = $_prg_mencoder
6888 $_live_libs_def
6890 MPLAYER_NETWORK = $_network
6891 STREAMING_LIVE_DOT_COM = $_live
6892 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
6893 DVBIN = $_dvbin
6894 VIDIX = $_vidix
6895 SHARED_PP = $_shared_pp
6896 CONFIG_PP = yes
6897 CONFIG_RISKY = yes
6898 CONFIG_MP3LAME = $_mp3lame
6899 LIBMENU = $_menu
6900 I18NLIBS = $_i18n_libs
6901 MATROSKA = $_matroska_internal
6903 OPENDIVX = $_opendivx
6905 MP3LIB = $_mp3lib
6906 LIBA52 = $_liba52
6907 LIBMPEG2 = $_libmpeg2
6908 TREMOR = $_tremor_internal
6909 TREMOR_FLAGS = $_tremor_flags
6911 UNRARLIB = $_unrarlib
6912 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
6913 PNG = $_mkf_png
6914 JPEG = $_mkf_jpg
6915 GIF = $_mkf_gif
6917 EXTRA_LIB = $_ld_extra
6918 Z_LIB = $_ld_static $_ld_zlib
6919 HAVE_MLIB = $_mlib
6920 WIN32_LIB = $_ld_win32libs
6921 STATIC_LIB = $_ld_static
6922 ENCA_LIB = $_ld_enca
6923 HAVE_PTHREADS = $_pthreads
6924 MATH_LIB = $_ld_lm
6926 X11_INC = $_inc_x11
6927 X11DIR = $_ld_x11
6929 HAVE_XVMC_ACCEL = $_xvmc
6931 # for libavcodec:
6932 SRC_PATH=..
6933 LIBPREF=lib
6934 LIBSUF=.a
6935 SLIBPREF=lib
6936 SLIBSUF=.so
6938 # video output
6939 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
6940 GGI_LIB = $_ld_ggi
6941 MLIB_LIB = $_ld_mlib
6942 MLIB_INC = $_inc_mlib
6943 DXR2_INC = $_inc_dxr2
6944 DVB_INC = $_inc_dvb
6945 PNG_LIB = $_ld_png
6946 JPEG_LIB = $_ld_jpg
6947 GIF_LIB = $_ld_gif
6948 SDL_LIB = $_ld_sdl
6949 SVGA_LIB = $_ld_svga
6950 AA_LIB = $_ld_aa
6951 CACA_INC = $_inc_caca
6952 CACA_LIB = $_ld_caca
6954 # audio output
6955 ALSA_LIB = $_ld_alsa
6956 NAS_LIB = $_ld_nas
6957 ARTS_LIB = $_ld_arts
6958 ARTS_INC = $_inc_arts
6959 ESD_LIB = $_ld_esd
6960 ESD_INC = $_inc_esd
6961 POLYP_LIB = $_ld_polyp
6962 POLYP_INC = $_inc_polyp
6963 JACK_LIB = $_ld_jack
6964 JACK_INC = $_inc_jack
6965 SGIAUDIO_LIB = $_ld_sgiaudio
6967 # input/demuxer/codecs
6968 TERMCAP_LIB = $_ld_termcap
6969 LIRC_LIB = $_ld_lirc
6970 LIRCC_LIB = $_ld_lircc
6971 DVDREAD_LIB = $_ld_dvdread
6972 DVDKIT = $_dvdkit
6973 DVDKIT2 = $_dvdkit2
6974 DVDKIT_SHARED = no
6975 SDL_INC = $_inc_sdl
6976 W32_DEP = $_dep_win32
6977 W32_LIB = $_ld_win32
6978 DS_DEP = $_dep_dshow
6979 DS_LIB = $_ld_dshow
6980 AV_DEP = $_dep_libavcodec $_dep_libavformat
6981 AV_LIB = $_ld_libavcodec $_ld_libavformat
6982 CONFIG_LIBAVCODEC = $_libavcodec
6983 CONFIG_LIBAVFORMAT = $_libavformat
6984 ZORAN = $_zr
6985 FAME = $_fame
6986 FAME_LIB = $_ld_fame
6987 MP1E_DEP = $_dep_mp1e
6988 MP1E_LIB = $_ld_mp1e
6989 ARCH_LIB = $_ld_arch $_ld_iconv
6990 XVID = $_xvid
6991 XVID_INC = $_inc_xvid
6992 XVID_LIB = $_ld_xvid
6993 X264 = $_x264
6994 X264_INC = $_inc_x264
6995 X264_LIB = $_ld_x264
6996 CONFIG_DTS = $_libdts
6997 DTS_INC = $_inc_libdts
6998 DTS_LIB = $_ld_libdts
6999 DECORE_LIB = $_ld_decore $_ld_mp3lame
7000 MENCODER = $_mencoder
7001 ENCORE_LIB = $_ld_encore $_ld_mp3lame
7002 DIRECTFB_INC = $_inc_directfb
7003 DIRECTFB_LIB = $_ld_directfb
7004 CDPARANOIA_INC = $_inc_cdparanoia
7005 CDPARANOIA_LIB = $_ld_cdparanoia
7006 FREETYPE_INC = $_inc_freetype
7007 FREETYPE_LIB = $_ld_freetype
7008 FONTCONFIG_INC = $_inc_fontconfig
7009 FONTCONFIG_LIB = $_ld_fontconfig
7010 FRIBIDI_INC = $_inc_fribidi
7011 FRIBIDI_LIB = $_ld_fribidi
7012 LIBLZO_LIB= $_ld_liblzo
7013 MAD_LIB = $_ld_mad
7014 VORBIS_LIB = $_ld_vorbis $_ld_libdv
7015 THEORA_LIB = $_ld_theora
7016 FAAD_LIB = $_ld_faad
7017 INTERNAL_FAAD = $_faad_internal
7018 SMBSUPPORT_LIB = $_ld_smb
7019 XMMS_PLUGINS = $_xmms
7020 XMMS_LIB = $_xmms_lib
7021 MACOSX = $_macosx
7022 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
7023 MACOSX_BUNDLE = $_macosx_bundle
7024 MACOSX_FRAMEWORKS = $_macosx_frameworks
7025 MACOSX_COREVIDEO = $_macosx_corevideo
7026 TOOLAME=$_toolame
7027 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
7028 TOOLAME_LIB=$_toolame_lib
7029 TWOLAME=$_twolame
7030 TWOLAME_LIB=$_twolame_lib
7031 FAAC=$_faac
7032 FAAC_LIB=$_ld_faac
7033 AMR_NB=$_amr_nb
7034 AMR_NB_FIXED=$_amr_nb_fixed
7035 AMR_WB=$_amr_wb
7036 `echo $_libavcodecs | tr 'a-z ' 'A-Z\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
7038 # --- Some stuff for autoconfigure ----
7039 $_target_arch
7040 $_confwin32
7041 TARGET_CPU=$iproc
7042 TARGET_MMX = $_mmx
7043 TARGET_MMX2 = $_mmx2
7044 TARGET_3DNOW = $_3dnow
7045 TARGET_3DNOWEX = $_3dnowex
7046 TARGET_SSE = $_sse
7047 TARGET_ALTIVEC = $_altivec
7048 TARGET_VIS = $_vis
7050 # --- GUI stuff ---
7051 GTKLIB = $_ld_static $_ld_gtk
7052 GLIBLIB = $_ld_static $_ld_glib
7053 GTK_LIBS = $_ld_static $_ld_gui
7054 GUI = $_gui
7055 DEBUG = -DDEBUG
7059 #############################################################################
7060 echo "Creating config.h"
7061 cat > config.h << EOF
7062 /* -------- This file has been automatically generated by configure ---------
7063 Note: Any changes in it will be lost when you run configure again. */
7065 /* Protect against multiple inclusion */
7066 #ifndef MPLAYER_CONFIG_H
7067 #define MPLAYER_CONFIG_H 1
7069 /* use GNU internationalization */
7070 $_def_i18n
7072 /* Runtime CPU detection */
7073 $_def_runtime_cpudetection
7075 /* Dynamic a/v plugins */
7076 $_def_dynamic_plugins
7078 /* "restrict" keyword */
7079 $_def_restrict_keyword
7081 /* __builtin_expect branch prediction hint */
7082 $_def_builtin_expect
7084 /* attribute(used) as needed by some compilers */
7085 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
7086 # define attribute_used __attribute__((used))
7087 #else
7088 # define attribute_used
7089 #endif
7091 #define PREFIX "$_prefix"
7093 #define USE_OSD 1
7094 #define USE_SUB 1
7096 /* enable/disable SIGHANDLER */
7097 $_def_sighandler
7099 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
7100 $_def_crash_debug
7102 /* Toggles debugging informations */
7103 $_def_debug
7105 /* Indicates that Ogle's libdvdread is available for DVD playback */
7106 $_def_dvdread
7108 /* Indicates that dvdread is from libmpdvdkit */
7109 $_def_mpdvdkit
7111 /* Additional options for libmpdvdkit*/
7112 $_def_dvd
7113 $_def_cdrom
7114 $_def_cdio
7115 $_def_dvdio
7116 $_def_bsdi_dvd
7117 $_def_dvd_bsd
7118 $_def_dvd_linux
7119 $_dev_dvd_openbsd
7120 $_def_dvd_darwin
7121 $_def_sol_scsi_h
7122 $_def_hpux_scsi_h
7123 $_def_stddef
7125 /* Common data directory (for fonts, etc) */
7126 #define MPLAYER_DATADIR "$_datadir"
7127 #define MPLAYER_CONFDIR "$_confdir"
7128 #define MPLAYER_LIBDIR "$_libdir"
7130 /* Define this to compile stream-caching support, it can be enabled via
7131 -cache <kilobytes> */
7132 #define USE_STREAM_CACHE 1
7134 /* Define to include support for XviD/Divx4Linux/OpenDivx */
7135 $_def_divx
7137 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
7138 /* You have to change DECORE_LIBS in config.mak, too! */
7139 $_def_decore
7141 /* Define if you are using DivX5Linux Decore library */
7142 $_def_divx5
7144 /* Define if you are using XviD library */
7145 $_def_xvid3
7146 $_def_xvid4
7147 $_def_decore_xvid
7148 $_def_encore_xvid
7150 /* Define if you are using the X.264 library */
7151 $_def_x264
7153 /* Define to include support for libdv-0.9.5 */
7154 $_def_libdv
7156 /* If build mencoder */
7157 $_mencoder_flag
7159 /* Indicates if XviD/Divx4linux encore is available
7160 Note: for mencoder */
7161 $_def_encore
7163 /* Indicates if libmp3lame is available
7164 Note: for mencoder */
7165 $_def_mp3lame
7166 $_def_cfg_mp3lame
7168 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
7169 $_def_mp1e
7171 /* Define this to enable avg. byte/sec-based AVI sync method by default:
7172 (use -bps or -nobps commandline option for run-time method selection)
7173 -bps gives better sync for vbr mp3 audio, it is now default */
7174 #define AVI_SYNC_BPS 1
7176 /* Undefine this if you do not want to select mono audio (left or right)
7177 with a stereo MPEG layer 2/3 audio stream. The command line option
7178 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7179 right-only), with 0 being the default.
7181 #define USE_FAKE_MONO 1
7183 /* Undefine this if your sound card driver has no working select().
7184 If you have kernel Oops, player hangups, or just no audio, you should
7185 try to recompile MPlayer with this option disabled! */
7186 $_def_select
7188 /* define this to use iconv(3) function to codepage conversions */
7189 $_def_iconv
7191 /* define this to use nl_langinfo function */
7192 $_def_langinfo
7194 /* define this to use RTC (/dev/rtc) for video timers */
7195 $_def_rtc
7197 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
7198 #define MAX_OUTBURST 65536
7200 /* set up audio OUTBURST. Do not change this! */
7201 #define OUTBURST 512
7203 /* Define this if your system has the header file for the OSS sound interface */
7204 $_def_sys_soundcard
7206 /* Define this if your system has the header file for the OSS sound interface
7207 * in /usr/include */
7208 $_def_soundcard
7210 /* Define this if your system has the sysinfo header */
7211 $_def_sys_sysinfo
7213 /* Define this if your system has ftello() */
7215 $_def_ftello
7216 #ifndef HAVE_FTELLO
7217 /* Need these for FILE and off_t an config.h is usually before other includes*/
7218 #include <stdio.h>
7219 #include <sys/types.h>
7220 off_t ftello(FILE *);
7221 #endif
7223 /* Define this if your system has the "malloc.h" header file */
7224 $_def_malloc
7226 /* memalign is mapped to malloc if unsupported */
7227 $_def_memalign
7228 #ifndef HAVE_MEMALIGN
7229 # define memalign(a,b) malloc(b)
7230 #define MEMALIGN_HACK 1
7231 #endif
7233 /* Define this if your system has the "alloca.h" header file */
7234 $_def_alloca
7236 /* Define this if your system has the "sys/mman.h" header file */
7237 $_def_mman
7238 $_def_mman_has_map_failed
7240 /* Define this if you have the elf dynamic linker -ldl library */
7241 $_def_dl
7243 /* Define this if you have the kstat kernel statistics library */
7244 $_def_kstat
7246 /* Define this if you have zlib */
7247 $_def_zlib
7248 #ifdef HAVE_ZLIB
7249 #define CONFIG_ZLIB 1
7250 #endif
7252 /* Define this if you have shm support */
7253 $_def_shm
7255 /* Define this if your system has scandir & alphasort */
7256 $_def_scandir
7258 /* Define this if your system has strsep */
7259 $_def_strsep
7261 /* Define this if your system has strlcpy */
7262 $_def_strlcpy
7263 #ifndef HAVE_STRLCPY
7264 unsigned int strlcpy (char *dest, const char *src, unsigned int size);
7265 #endif
7267 /* Define this if your system has strlcat */
7268 $_def_strlcat
7269 #ifndef HAVE_STRLCAT
7270 unsigned int strlcat (char *dest, const char *src, unsigned int size);
7271 #endif
7273 /* Define this if your system has fseeko */
7274 $_def_fseeko
7275 #ifndef HAVE_FSEEKO
7276 /* Need these for FILE and off_t an config.h is usually before other includes*/
7277 #include <stdio.h>
7278 #include <sys/types.h>
7279 int fseeko(FILE *, off_t, int);
7280 #endif
7282 $_def_localtime_r
7284 /* Define this if your system has vsscanf */
7285 $_def_vsscanf
7287 /* Define this if your system has swab */
7288 $_def_swab
7290 /* Define this if your system has no posix select */
7291 $_def_no_posix_select
7293 /* Define this if your system has gettimeofday */
7294 $_def_gettimeofday
7296 /* Define this if your system has glob */
7297 $_def_glob
7299 /* Define this if your system has pthreads */
7300 $_def_pthreads
7302 /* Define this if you enabled thread support for libavcodec */
7303 $_def_threads
7305 /* LIRC (remote control, see www.lirc.org) support: */
7306 $_def_lirc
7309 * LIRCCD (LIRC client daemon)
7310 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7312 $_def_lircc
7314 /* DVD navigation support using libdvdnav */
7315 $_def_dvdnav
7316 $_def_dvdnav_version
7318 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7319 #define MPEG12_POSTPROC 1
7321 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7322 $_def_ffpostprocess
7324 /* Define to include support for OpenDivx postprocessing */
7325 $_def_odivx_postprocess
7327 /* Win32 DLL support */
7328 $_def_win32
7329 #define WIN32_PATH "$_win32libdir"
7331 /* DirectShow support */
7332 $_def_dshow
7334 /* Mac OS X specific features */
7335 $_def_macosx
7336 $_def_macosx_finder_support
7337 $_def_macosx_bundle
7338 $_def_macosx_corevideo
7340 /* Build our Win32-loader */
7341 $_def_win32_loader
7343 /* ffmpeg's libavcodec support (requires libavcodec source) */
7344 $_def_libavcodec
7345 $_def_libavcodecso
7347 /* ffmpeg's libavformat support (requires libavformat source) */
7348 $_def_libavformat
7349 $_def_libavformat_win32
7351 /* risky codecs */
7352 #define CONFIG_RISKY 1
7354 /* Use libavcodec's decoders */
7355 #define CONFIG_DECODERS 1
7356 /* Use libavcodec's encoders */
7357 #define CONFIG_ENCODERS 1
7359 #define CONFIG_MPEGAUDIO_HP 1
7361 /* Use amr codecs from libavcodec (requires amr sources) */
7362 $_def_amr_nb
7363 $_def_amr_nb_fixed
7364 $_def_amr_wb
7366 /* Use specific codecs from libavcodec */
7367 `echo $_libavcodecs | tr 'a-z ' 'A-Z\n' | sed 's/^/#define CONFIG_/;s/$/ 1/'`
7369 /* Use codec libs included in mplayer CVS / source dist: */
7370 $_def_mp3lib
7371 $_def_liba52
7372 $_def_libdts
7373 $_def_libmpeg2
7375 /* Use libfame encoder filter */
7376 $_def_fame
7378 /* XAnim DLL support */
7379 $_def_xanim
7380 /* Default search path */
7381 $_def_xanim_path
7383 /* RealPlayer DLL support */
7384 $_def_real
7385 /* Default search path */
7386 $_def_real_path
7388 /* LIVE.COM Streaming Media library support */
7389 $_def_live
7391 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7392 $_def_fastmemcpy
7394 /* Use unrarlib for Vobsubs */
7395 $_def_unrarlib
7397 /* gui support, please do not edit this option */
7398 $_def_gui
7400 /* Audio output drivers */
7401 $_def_ossaudio
7402 $_def_ossaudio_devdsp
7403 $_def_ossaudio_devmixer
7404 $_def_alsa5
7405 $_def_alsa9
7406 $_def_alsa1x
7407 $_def_arts
7408 $_def_esd
7409 $_def_esd_latency
7410 $_def_polyp
7411 $_def_jack
7412 $_def_sys_asoundlib_h
7413 $_def_alsa_asoundlib_h
7414 $_def_sunaudio
7415 $_def_sgiaudio
7416 $_def_win32waveout
7417 $_def_nas
7419 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7420 #undef FAST_OSD
7421 #undef FAST_OSD_TABLE
7423 /* Enable TV Interface support */
7424 $_def_tv
7426 /* Enable EDL support */
7427 $_def_edl
7429 /* Enable Video 4 Linux TV interface support */
7430 $_def_tv_v4l
7432 /* Enable Video 4 Linux 2 TV interface support */
7433 $_def_tv_v4l2
7435 /* Enable *BSD BrookTree TV interface support */
7436 $_def_tv_bsdbt848
7438 /* Define if your processor stores words with the most significant
7439 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7440 $_def_words_endian
7442 $_def_arch
7444 /* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
7445 have the instruction. */
7446 $_def_dcbzl
7448 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7449 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7451 #ifdef ARCH_POWERPC
7452 #define ARCH_PPC 1
7453 #endif
7455 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7456 #ifdef ARCH_ARMV4L
7457 #define ARCH_ARM 1
7458 #endif
7460 /* only gcc3 can compile mvi instructions */
7461 $_def_gcc_mvi_support
7463 /* Define this for Cygwin build for win32 */
7464 $_def_confwin32
7466 /* Define this to any prefered value from 386 up to infinity with step 100 */
7467 #define __CPU__ $iproc
7469 $_mp_wordsize
7471 $_def_linux
7473 $_def_vcd
7475 #ifdef sun
7476 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7477 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7478 #elif defined(HPUX)
7479 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7480 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7481 #elif defined(WIN32)
7482 #define DEFAULT_CDROM_DEVICE "D:"
7483 #define DEFAULT_DVD_DEVICE "D:"
7484 #elif defined(SYS_DARWIN)
7485 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7486 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7487 #elif defined(__OpenBSD__)
7488 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7489 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7490 #else
7491 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7492 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7493 #endif
7496 /*----------------------------------------------------------------------------
7498 ** NOTE: Instead of modifying these definitions here, use the
7499 ** --enable/--disable options of the ./configure script!
7500 ** See ./configure --help for details.
7502 *---------------------------------------------------------------------------*/
7504 /* C99 lrintf function available */
7505 $_def_lrintf
7507 /* round function is available */
7508 $_def_round
7510 /* yes, we have inttypes.h */
7511 #define HAVE_INTTYPES_H 1
7513 /* int_fastXY_t emulation */
7514 $_def_fast_inttypes
7516 /* nanosleep support */
7517 $_def_nanosleep
7519 /* SMB support */
7520 $_def_smbsupport
7522 /* termcap flag for getch2.c */
7523 $_def_termcap
7525 /* termios flag for getch2.c */
7526 $_def_termios
7527 $_def_termios_h
7528 $_def_termios_sys_h
7530 /* enable PNG support */
7531 $_def_png
7533 /* enable JPEG support */
7534 $_def_jpg
7536 /* enable PNM support */
7537 $_def_pnm
7539 /* enable md5sum support */
7540 $_def_md5sum
7542 /* enable GIF support */
7543 $_def_gif
7544 $_def_gif_4
7545 $_def_gif_tvt_hack
7547 /* enable FreeType support */
7548 $_def_freetype
7550 /* enable Fontconfig support */
7551 $_def_fontconfig
7553 /* enable FriBiDi usage */
7554 $_def_fribidi
7556 /* enable ENCA usage */
7557 $_def_enca
7559 /* liblzo support */
7560 $_def_liblzo
7562 /* libmad support */
7563 $_def_mad
7565 /* enable OggVorbis support */
7566 $_def_vorbis
7568 /* enable Tremor as vorbis decoder */
7569 $_def_tremor
7571 /* enable OggTheora support */
7572 $_def_theora
7574 /* enable Matroska support */
7575 $_def_matroska
7577 /* enable FAAD (AAC) support */
7578 $_def_faad
7579 $_def_faad_internal
7581 /* enable FAAC (AAC encoder) support */
7582 $_def_faac
7584 /* enable LADSPA plugin support */
7585 $_def_ladspa
7587 /* enable network */
7588 $_def_network
7590 /* enable ftp support */
7591 $_def_ftp
7593 /* enable vstream support */
7594 $_def_vstream
7596 /* enable winsock2 instead of Unix functions*/
7597 $_def_winsock2
7599 /* define this to use inet_aton() instead of inet_pton() */
7600 $_def_use_aton
7602 /* enables / disables cdparanoia support */
7603 $_def_cdparanoia
7605 /* enables / disables VIDIX usage */
7606 $_def_vidix
7608 /* enables / disables new input joystick support */
7609 $_def_joystick
7611 /* enables / disables QTX codecs */
7612 $_def_qtx
7614 /* enables / disables osd menu */
7615 $_def_menu
7617 /* enables / disables subtitles sorting */
7618 $_def_sortsub
7620 /* XMMS input plugin support */
7621 $_def_xmms
7622 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7624 /* enables inet6 support */
7625 $_def_inet6
7627 /* do we have gethostbyname2? */
7628 $_def_gethostbyname2
7630 /* Extension defines */
7631 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
7632 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
7633 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
7634 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
7635 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
7636 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
7637 $_def_altivec // only define if you have Altivec (G4)
7639 $_def_altivec_h // enables usage of altivec.h
7642 $_def_mlib // Sun mediaLib, available only on solaris
7643 $_def_vis // only define if you have VIS ( ultrasparc )
7645 /* libmpeg2 uses a different feature test macro for mediaLib */
7646 #ifdef HAVE_MLIB
7647 #define LIBMPEG2_MLIB 1
7648 #endif
7650 /* libvo options */
7651 #define SCREEN_SIZE_X 1
7652 #define SCREEN_SIZE_Y 1
7653 $_def_x11
7654 $_def_xv
7655 $_def_xvmc
7656 $_def_vm
7657 $_def_xf86keysym
7658 $_def_xinerama
7659 $_def_gl
7660 $_def_gl_win32
7661 $_def_dga
7662 $_def_dga2
7663 $_def_sdl
7664 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
7665 $_def_sdlbuggy
7666 $_def_directx
7667 $_def_ggi
7668 $_def_ggiwmh
7669 $_def_3dfx
7670 $_def_tdfxfb
7671 $_def_tdfxvid
7672 $_def_directfb
7673 $_def_directfb_version
7674 $_def_zr
7675 $_def_bl
7676 $_def_mga
7677 $_def_xmga
7678 $_def_syncfb
7679 $_def_fbdev
7680 $_def_dxr2
7681 $_def_dxr3
7682 $_def_dvb
7683 $_def_dvb_in
7684 $_def_svga
7685 $_def_vesa
7686 $_def_xdpms
7687 $_def_aa
7688 $_def_caca
7689 $_def_tga
7690 $_def_toolame
7691 $_def_twolame
7693 /* used by GUI: */
7694 $_def_xshape
7696 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
7697 #define X11_FULLSCREEN 1
7698 #endif
7700 #endif /* MPLAYER_CONFIG_H */
7703 #############################################################################
7705 echo "Creating libvo/config.mak"
7706 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g;s/\.m/\.o/g'`
7707 cat > libvo/config.mak << EOF
7708 include ../config.mak
7709 OPTIONAL_SRCS = $_vosrc
7710 OPTIONAL_OBJS = $_voobj
7713 #############################################################################
7715 echo "Creating libao2/config.mak"
7716 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
7717 cat > libao2/config.mak << EOF
7718 include ../config.mak
7719 OPTIONAL_SRCS = $_aosrc
7720 OPTIONAL_OBJS = $_aoobj
7723 #############################################################################
7725 echo "Creating libaf/config.mak"
7726 _afobj=`echo $_afsrc | sed -e 's/\.c/\.o/g'`
7727 cat > libaf/config.mak << EOF
7728 include ../config.mak
7729 OPTIONAL_SRCS = $_afsrc
7730 OPTIONAL_OBJS = $_afobj
7733 #############################################################################
7735 cat << EOF
7737 Config files successfully generated by ./configure !
7739 Install prefix: $_prefix
7740 Data directory: $_datadir
7741 Config direct.: $_confdir
7743 Byte order: $_byte_order
7744 Optimizing for: $_optimizing
7746 Languages:
7747 Messages/GUI: $_language
7750 echo -n " Manual pages: $MAN_LANG"
7751 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
7752 echo
7754 cat << EOF
7756 Enabled optional drivers:
7757 Input: $_inputmodules
7758 Codecs: $_codecmodules
7759 Audio output: $_aomodules
7760 Video output: $_vomodules
7761 Audio filters: $_afmodules
7762 Disabled optional drivers:
7763 Input: $_noinputmodules
7764 Codecs: $_nocodecmodules
7765 Audio output: $_noaomodules
7766 Video output: $_novomodules
7767 Audio filters: $_noafmodules
7769 'config.h' and 'config.mak' contain your configuration options.
7770 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7771 compile *** DO NOT REPORT BUGS if you tweak these files ***
7773 'make' will now compile MPlayer and 'make install' will install it.
7774 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7779 if test "$_mtrr" = yes ; then
7780 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
7781 echo
7784 if test "$_sdl" = "outdated" ; then
7785 cat <<EOF
7786 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
7787 support has therefore been disabled.
7789 Please upgrade to a more recent version (version 1.1.8 and above are known to
7790 work). You may get this library from: http://www.libsdl.org
7792 You need to rerun ./configure and recompile after updating SDL. If you are
7793 only interested in the libSDL audio drivers, then an older version might work.
7795 Use --enable-sdl to force usage of libSDL.
7800 if x86; then
7801 if test "$_win32" = no ; then
7802 if test "$_win32libdir" ; then
7803 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
7804 else
7805 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
7807 cat << EOF
7808 Create it and copy the DLL files there! You can download the codecs from our
7809 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
7813 else
7814 cat <<EOF
7815 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7816 operating system ($system_name). You may encounter a few files that cannot
7817 be played due to missing open source video/audio codec support.
7823 cat <<EOF
7825 Check $TMPLOG if you wonder why an autodetection failed (check whether
7826 the development headers/packages are installed).
7828 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
7832 if test "$_vidix" = no ; then
7833 cat <<EOF
7834 You've disabled VIDIX. Although it would be better to PORT it instead.
7835 Have a look at the documentation for supported cards!
7840 # Last move:
7841 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"