get_space fix by Florian Dietrich <flodt8 at yahoo.de>
[mplayer.git] / configure
bloba53c8d06fdc913c7f19356e46eaf948c5c02d301
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: check the cvs log !
8 # Cleanups all over the place (c) 2001 pl
11 # Guidelines:
12 # If the option is named 'opt':
13 # _opt : should have a value in yes/no/auto
14 # _def_opt : '#define ... 1' or '#undef ...' that is: some C code
15 # _ld_opt : ' -L/path/dir -lopt ' that is: some GCC option
16 # _inc_opt : ' -I/path/dir/include '
18 # In this file, a tab is 8 chars and indentation shift is 2 characters
20 # GOTCHAS:
21 # - config files are currently:
22 # config.h config.mak libvo/config.mak libao2/config.mak Gui/config.mak
24 #############################################################################
26 # Prefer these macros to full length text !
27 # These macros only return an error code - NO display is done
28 cc_check() {
29 echo >> "$TMPLOG"
30 cat "$TMPC" >> "$TMPLOG"
31 echo >> "$TMPLOG"
32 echo "$_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra $TMPC -o $TMPO $@" >> "$TMPLOG"
33 rm -f "$TMPO"
34 ( $_cc $CFLAGS $_inc_extra $_ld_static $_ld_extra "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1
35 TMP="$?"
36 echo >> "$TMPLOG"
37 echo "ldd $TMPO" >> "$TMPLOG"
38 ( $_ldd "$TMPO" ) >> "$TMPLOG" 2>&1
39 echo >> "$TMPLOG"
40 return "$TMP"
43 # Display error message, flushes tempfile, exit
44 die () {
45 echo
46 echo "Error: $@" >&2
47 echo >&2
48 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
49 echo "Check \"$TMPLOG\" if you do not understand why it failed."
50 exit 1
53 # OS test booleans functions
54 issystem() {
55 test "`echo $system_name | tr A-Z a-z`" = "`echo $1 | tr A-Z a-z`"
57 linux() { issystem "Linux" ; return "$?" ; }
58 sunos() { issystem "SunOS" ; return "$?" ; }
59 hpux() { issystem "HP-UX" ; return "$?" ; }
60 irix() { issystem "IRIX" ; return "$?" ; }
61 cygwin() { issystem "CYGWIN" ; return "$?" ; }
62 freebsd() { issystem "FreeBSD" ; return "$?" ; }
63 netbsd() { issystem "NetBSD" ; return "$?" ; }
64 bsdos() { issystem "BSD/OS" ; return "$?" ; }
65 openbsd() { issystem "OpenBSD" ; return "$?" ; }
66 bsd() { freebsd || netbsd || bsdos || openbsd ; return "$?" ; }
67 qnx() { issystem "QNX" ; return "$?" ; }
68 darwin() { issystem "Darwin" ; return "$?" ; }
69 gnu() { issystem "GNU" ; return "$?" ; }
70 mingw32() { issystem "MINGW32" ; return "$?" ; }
71 morphos() { issystem "MorphOS" ; return "$?" ; }
72 win32() { cygwin || mingw32 ; return "$?" ; }
73 beos() { issystem "BEOS" ; return "$?" ; }
75 # arch test boolean functions
76 # x86/x86pc is used by QNX
77 x86() {
78 case "$host_arch" in
79 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
80 *) return 1 ;;
81 esac
84 ppc() {
85 case "$host_arch" in
86 ppc) return 0;;
87 *) return 1;;
88 esac
91 alpha() {
92 case "$host_arch" in
93 alpha) return 0;;
94 *) return 1;;
95 esac
98 # not boolean test: implement the posix shell "!" operator for a
99 # non-posix /bin/sh.
100 # usage: not {command}
101 # returns exit status "success" when the execution of "command"
102 # fails.
103 not() {
104 eval "$@"
105 test $? -ne 0
108 # Use this before starting a check
109 echocheck() {
110 echo "============ Checking for $@ ============" >> "$TMPLOG"
111 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
114 # Use this to echo the results of a check
115 echores() {
116 echo "Result is: $@" >> "$TMPLOG"
117 echo "##########################################" >> "$TMPLOG"
118 echo "" >> "$TMPLOG"
119 echo "$@"
121 #############################################################################
123 # Check how echo works in this /bin/sh
124 case `echo -n` in
125 -n) _echo_n= _echo_c='\c' ;; # SysV echo
126 *) _echo_n='-n ' _echo_c= ;; # BSD echo
127 esac
129 LANGUAGES=`echo help/help_mp-??.h help/help_mp-??_??.h | sed "s:help/help_mp-\(..\).h:\1:g" | sed "s:help/help_mp-\(.....\).h:\1:g"`
131 for parm in "$@" ; do
132 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
133 cat << EOF
135 Usage: $0 [OPTIONS]...
137 Configuration:
138 -h, --help display this help and exit
140 Installation directories:
141 --prefix=DIR use this prefix for installing mplayer [/usr/local]
142 --bindir=DIR use this prefix for installing mplayer binary
143 [PREFIX/bin]
144 --datadir=DIR use this prefix for installing machine independent
145 data files (fonts, skins) [PREFIX/share/mplayer]
146 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
147 --confdir=DIR use this prefix for installing configuration files
148 [PREFIX/etc/mplayer]
149 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
151 Optional features:
152 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
153 --enable-gui enable gmplayer compilation (GTK 1.2 GUI) [disable]
154 --enable-largefiles enable support for files > 2 GBytes [disable]
155 --enable-linux-devfs set default devices to devfs ones [disable]
156 --enable-termcap use termcap database for key codes [autodetect]
157 --enable-termios use termios database for key codes [autodetect]
158 --disable-iconv do not use iconv(3) function [autodetect]
159 --disable-setlocale disable setlocale using in mplayer [autodetect]
160 --disable-langinfo do not use langinfo [autodetect]
161 --enable-lirc enable LIRC (remote control) support [autodetect]
162 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
163 --enable-joystick enable joystick support [disable]
164 --disable-vm disable support X video mode extensions [autodetect]
165 --disable-xf86keysym disable support for 'multimedia' keys [autodetect]
166 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
167 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
168 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
169 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
170 --disable-edl disable EDL (edit decision list) support [enable]
171 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
172 --disable-network disable network support (for: http/mms/rtp) [enable]
173 --enable-winsock2 enable winsock2 usage [autodetect]
174 --enable-smb enable Samba (SMB) input support [autodetect]
175 --enable-live enable LIVE.COM Streaming Media support [autodetect]
176 --disable-dvdread Disable libdvdread support [autodetect]
177 --disable-mpdvdkit Disable mpdvdkit/mpdvdkit2 support [autodetect]
178 --disable-cdparanoia Disable cdparanoia support [autodetect]
179 --disable-freetype Disable freetype2 font rendering support [autodetect]
180 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
181 --disable-unrarlib Disable Unique RAR File Library [enabled]
182 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
183 --disable-sortsub Disable subtitles sorting [enabled]
184 --enable-fribidi Enable using the FriBiDi libs [disabled]
185 --disable-enca Disable using ENCA charset oracle library [autodetect]
186 --disable-macosx Disable Mac OS X specific features [autodetect]
187 --enable-macosx-finder-support Enable Mac OS X Finder invocation parameter parsing [disabled]
188 --disable-inet6 Disable IPv6 support [autodetect]
189 --disable-gethostbyname2 gethostbyname() function is not provided by the C
190 library [autodetect]
191 --disable-ftp Disable ftp support [enabled]
192 --disable-vstream Disable tivo vstream client support [autodetect]
194 Codecs:
195 --enable-gif enable gif support [autodetect]
196 --enable-png enable png input/output support [autodetect]
197 --enable-jpeg enable jpeg input/output support [autodetect]
198 --enable-liblzo enable external liblzo support [autodetect]
199 --disable-win32 disable Win32 DLL support [autodetect]
200 --disable-dshow disable Win32/DirectShow support [autodetect]
201 --disable-qtx disable Quicktime codecs [autodetect]
202 --disable-xanim disable XAnim DLL support [autodetect]
203 --disable-real disable RealPlayer DLL support [autodetect]
204 --disable-xvid disable XviD codec [autodetect]
205 --disable-x264 disable H.264 encoder [autodetect]
206 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
207 --enable-opendivx enable _old_ OpenDivx codec [disable]
208 --disable-libavcodec disable libavcodec [autodetect]
209 --disable-libavformat disable libavformat [autodetect]
210 --enable-libfame enable libfame realtime encoder [autodetect]
211 --disable-internal-tremor do not build internal OggVorbis support [enabled]
212 --enable-tremor-low build with lower accuracy internal tremor [disabled]
213 --enable-external-tremor build with external tremor [disabled]
214 --disable-vorbis disable OggVorbis support entirely [autodetect]
215 --enable-theora build with OggTheora support [autodetect]
216 --disable-internal-matroska disable internal Matroska support [enabled]
217 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
218 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
219 --disable-ladspa disable LADSPA plugin support [autodetect]
220 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
221 --disable-mad disable libmad (MPEG audio) support [autodetect]
222 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
223 --enable-xmms build with XMMS inputplugin support [disabled]
224 --disable-mp3lib disable builtin mp3lib [enabled]
225 --disable-liba52 disable builtin liba52 [enabled]
226 --enable-libdts enable libdts support [autodetect]
227 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
228 --disable-amr_nb disable amr narrowband, floating point [autodetect]
229 --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect]
230 --disable-amr_wb disable amr wideband, floating point [autodetect]
232 Video output:
233 --disable-vidix disable VIDIX [enable on x86 *nix]
234 --enable-gl build with OpenGL render support [autodetect]
235 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
236 --enable-vesa build with VESA support [autodetect]
237 --enable-svga build with SVGAlib support [autodetect]
238 --enable-sdl build with SDL render support [autodetect]
239 --enable-aa build with AAlib render support [autodetect]
240 --enable-caca build with CACA render support [autodetect]
241 --enable-ggi build with GGI render support [autodetect]
242 --enable-directx build with DirectX support [autodetect]
243 --enable-dxr2 build with DXR2 render support [autodetect]
244 --enable-dxr3 build with DXR3/H+ render support [autodetect]
245 --enable-dvb build with support for output via DVB-Card [autodetect]
246 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
247 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
248 (check for /dev/mga_vid) [autodetect]
249 --enable-xmga build with mga_vid X Window support
250 (check for X & /dev/mga_vid) [autodetect]
251 --enable-xv build with Xv render support for X 4.x [autodetect]
252 --enable-xvmc build with XvMC acceleration for X 4.x [disable]
253 --enable-vm build with XF86VidMode support for X11 [autodetect]
254 --enable-xinerama build with Xinerama support for X11 [autodetect]
255 --enable-x11 build with X11 render support [autodetect]
256 --enable-fbdev build with FBDev render support [autodetect]
257 --enable-mlib build with MLIB support (Solaris only) [autodetect]
258 --enable-3dfx build with obsolete /dev/3dfx support [disable]
259 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
260 --enable-directfb build with DirectFB support [autodetect]
261 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
262 --enable-bl build with Blinkenlights support [disable]
263 --enable-tdfxvid build with tdfx_vid support [disable]
264 --disable-tga disable targa output support [enable]
265 --disable-pnm disable pnm output support [enable]
266 --disable-md5sum disable md5sum output support [enable]
268 Audio output:
269 --disable-alsa disable ALSA sound support [autodetect]
270 --disable-ossaudio disable OSS sound support [autodetect]
271 --disable-arts disable aRts sound support [autodetect]
272 --disable-esd disable esd sound support [autodetect]
273 --disable-polyp disable Polypaudio sound support [autodetect]
274 --disable-jack disable JACK sound support [autodetect]
275 --disable-nas disable NAS sound support [autodetect]
276 --disable-sgiaudio disable SGI sound support [autodetect]
277 --disable-sunaudio disable Sun sound support [autodetect]
278 --disable-win32waveout disable Windows waveout sound support [autodetect]
279 --disable-select disable using select() on audio device [enable]
281 Miscellaneous options:
282 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
283 --cc=COMPILER use this C compiler to build MPlayer [gcc]
284 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
285 --as=ASSEMBLER use this assembler to build MPlayer [as]
286 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
287 --enable-static build a statically linked binary. Set further linking
288 options with --enable-static="-lslang -lncurses"
289 --charset convert the help messages to this charset
290 --language=list a white space or comma separated list of languages
291 for translated man pages, the first language is the
292 primary and therefore used for translated messages
293 and GUI (also the environment variable \$LINGUAS is
294 honored) [en]
295 (Available: $LANGUAGES all)
296 --enable-shared-pp install & use shared postprocessing lib
297 --with-install=PATH use a custom install program (useful if your OS uses
298 a GNU-incompatible install utility by default and
299 you want to use GNU version)
300 --install-path=PATH the path to a custom install program
301 this option is obsolete and will be removed soon,
302 use --with-install instead.
304 Advanced options:
305 --enable-mmx build with MMX support [autodetect]
306 --enable-mmx2 build with MMX2 support (PIII, Athlon) [autodetect]
307 --enable-3dnow build with 3DNow! support [autodetect]
308 --enable-3dnowex build with extended 3DNow! support [autodetect]
309 --enable-sse build with SSE support [autodetect]
310 --enable-sse2 build with SSE2 support [autodetect]
311 --enable-shm build with shm support [autodetect]
312 --enable-altivec build with Altivec support (PowerPC) [autodetect]
313 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
314 --enable-big-endian Force byte order to big-endian [autodetect]
315 --enable-debug[=1-3] compile debugging information into mplayer [disable]
316 --enable-profile compile profiling information into mplayer [disable]
317 --disable-sighandler disable sighandler for crashes [enable]
318 --enable-crash-debug enable automatic gdb attach on crash [disable]
319 --enable-i18n _experimental_ gnu gettext() support [autodetect]
320 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
322 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
323 --disable-gcc-checking disable gcc version checking [enable]
325 Use these options if autodetection fails (Options marked with (*) accept
326 multiple paths separated by ':'):
327 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
328 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
329 --with-x11incdir=DIR X headers in DIR (*)
330 --with-x11libdir=DIR X library files in DIR (*)
331 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
332 --with-dvbincdir=DIR DVB headers in DIR (*)
333 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
334 --with-mlibdir=DIR libmlib (MLIB support) in DIR (Solaris only)
335 --with-codecsdir=DIR Binary codec files in DIR
336 --with-win32libdir=DIR W*ndows DLL files in DIR
337 --with-xanimlibdir=DIR XAnim DLL files in DIR
338 --with-reallibdir=DIR RealPlayer DLL files in DIR
339 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
340 --with-xvidincdir=DIR XviD header in DIR (*)
341 --with-x264libdir=DIR libx264 in DIR
342 --with-x264incdir=DIR x264 header in DIR
343 --with-dtslibdir=DIR libdts library in DIR (*)
344 --with-dtsincdir=DIR libdts header in DIR (*)
345 --with-livelibdir=DIR LIVE.COM Streaming Media libraries in DIR
346 --with-toolamedir=DIR path to Toolame library and include file
347 --with-xmmsplugindir=DIR XMMS plugins in DIR
348 --with-xmmslibdir=DIR libxmms.so.1 in DIR
349 --with-bio2jack=DIR libbio2jack.a in DIR
350 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
351 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
352 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
353 --with-termcaplib=NAME name of library with termcap functionality
354 name should be given without leading "lib"
355 checks for "termcap" and "tinfo"
357 --with-freetype-config=PATH path to freetype-config
358 (e.g. /opt/bin/freetype-config)
359 --with-fribidi-config=PATH path to fribidi-config
360 (e.g. /opt/bin/fribidi-config)
361 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
362 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
363 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
365 exit 0
367 done # for parm in ...
370 # 1st pass checking for vital options
371 _install=install
372 _ranlib=ranlib
373 _cc=cc
374 test "$CC" && _cc="$CC"
375 _as=auto
376 _runtime_cpudetection=no
377 for ac_option do
378 case "$ac_option" in
379 --target=*)
380 _target=`echo $ac_option | cut -d '=' -f 2`
382 --cc=*)
383 _cc=`echo $ac_option | cut -d '=' -f 2`
385 --host-cc=*)
386 _host_cc=`echo $ac_option | cut -d '=' -f 2`
388 --as=*)
389 _as=`echo $ac_option | cut -d '=' -f 2`
391 --enable-gcc-checking)
392 _skip_cc_check=no
394 --disable-gcc-checking)
395 _skip_cc_check=yes
397 --enable-static)
398 _ld_static='-static'
400 --disable-static)
401 _ld_static=''
403 --enable-static=*)
404 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
406 --with-extraincdir=*)
407 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
409 --with-extralibdir=*)
410 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
412 --enable-runtime-cpudetection)
413 _runtime_cpudetection=yes
415 --disable-runtime-cpudetection)
416 _runtime_cpudetection=no
418 --install-path=*)
419 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
421 --with-install=*)
422 _install=`echo $ac_option | cut -d '=' -f 2 `
424 esac
425 done
427 # Determine our OS name and CPU architecture
428 if test -z "$_target" ; then
429 # OS name
430 system_name=`( uname -s ) 2>&1`
431 case "$system_name" in
432 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
434 IRIX*)
435 system_name=IRIX
437 HP-UX*)
438 system_name=HP-UX
440 [cC][yY][gG][wW][iI][nN]*)
441 system_name=CYGWIN
443 MINGW32*)
444 system_name=MINGW32
446 MorphOS)
447 system_name=MorphOS
450 system_name="$system_name-UNKNOWN"
452 esac
455 # host's CPU/instruction set
456 host_arch=`( uname -p ) 2>&1`
457 case "$host_arch" in
458 i386|sparc|ppc|alpha|arm|mips|vax)
460 powerpc) # Darwin returns 'powerpc'
461 host_arch=ppc
463 *) # uname -p on Linux returns 'unknown' for the processor type,
464 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
466 # Maybe uname -m (machine hardware name) returns something we
467 # recognize.
469 # x86/x86pc is used by QNX
470 case "`( uname -m ) 2>&1`" in
471 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 ;;
472 ia64) host_arch=ia64 ;;
473 x86_64|amd64)
474 if [ "`$_cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
475 -z "`echo $CFLAGS | grep -- -m32`" ]; then
476 host_arch=x86_64
477 else
478 host_arch=i386
481 macppc|ppc) host_arch=ppc ;;
482 alpha) host_arch=alpha ;;
483 sparc) host_arch=sparc ;;
484 sparc64) host_arch=sparc64 ;;
485 parisc*|hppa*|9000*) host_arch=hppa ;;
486 arm*) host_arch=arm ;;
487 s390) host_arch=s390 ;;
488 s390x) host_arch=s390x ;;
489 mips) host_arch=mips ;;
490 vax) host_arch=vax ;;
491 *) host_arch=UNKNOWN ;;
492 esac
494 esac
495 else
496 system_name=`echo $_target | cut -d '-' -f 2`
497 case "`echo $system_name | tr A-Z a-z`" in
498 linux) system_name=Linux ;;
499 freebsd) system_name=FreeBSD ;;
500 netbsd) system_name=NetBSD ;;
501 bsd/os) system_name=BSD/OS ;;
502 openbsd) system_name=OpenBSD ;;
503 sunos) system_name=SunOS ;;
504 qnx) system_name=QNX ;;
505 morphos) system_name=MorphOS ;;
506 mingw32msvc) system_name=MINGW32 ;;
507 esac
508 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
509 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
512 echo "Detected operating system: $system_name"
513 echo "Detected host architecture: $host_arch"
515 # LGB: temporary files
516 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
517 test "$I" && break
518 done
520 TMPLOG="configure.log"
521 rm -f "$TMPLOG"
522 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
523 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
524 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
525 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
527 # config files
529 # FIXME: A lot of stuff is installed under /usr/local
530 # NK: But we should never use this stuff implicitly since we call compiler
531 # from /usr we should be sure that there no effects from other compilers
532 # (libraries) which might be installed into /usr/local. Let users use this
533 # stuff explicitly as command line argument. In other words: It would be
534 # resonable to have only /usr/include or only /usr/local/include.
536 if freebsd ; then
537 _ld_extra="$_ld_extra -L/usr/local/lib"
538 _inc_extra="$_inc_extra -I/usr/local/include"
541 if netbsd ; then
542 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
543 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
544 done
545 _ld_extra=$tmp
548 _ldd=ldd
549 if darwin; then
550 _ldd="otool -L"
553 # Check how to call 'head' and 'tail'. Newer versions spit out warnings
554 # if used as 'head -1' instead of 'head -n 1', but older versions don't
555 # know about '-n'.
556 if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
557 _head() { head -$1 2>/dev/null ; }
558 else
559 _head() { head -n $1 2>/dev/null ; }
561 if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
562 _tail() { tail -$1 2>/dev/null ; }
563 else
564 _tail() { tail -n $1 2>/dev/null ; }
567 # Checking CC version...
568 if test "$_skip_cc_check" != yes ; then
569 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
570 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
571 echocheck "$_cc version"
572 cc_vendor=intel
573 cc_name=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 1`
574 cc_version=`( $_cc -V ) 2>&1 | _head 1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
575 _cc_major=`echo $cc_version | cut -d '.' -f 1`
576 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
577 # TODO verify older icc/ecc compatibility
578 case $cc_version in
580 cc_version="v. ?.??, bad"
581 cc_verc_fail=yes
583 8.0)
584 cc_version="$cc_version, ok"
585 cc_verc_fail=no
588 cc_version="$cc_version, bad"
589 cc_verc_fail=yes
591 esac
592 echores "$cc_version"
593 else
594 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
595 echocheck "$_cc version"
596 cc_vendor=gnu
597 cc_name=`( $_cc -v ) 2>&1 | _tail 1 | cut -d ' ' -f 1`
598 cc_version=`( $_cc -dumpversion ) 2>&1`
599 if test "$?" -gt 0; then
600 cc_version="not found"
602 case $cc_version in
604 cc_version="v. ?.??, bad"
605 cc_verc_fail=yes
607 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9])
608 _cc_major=`echo $cc_version | cut -d '.' -f 1`
609 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
610 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
611 cc_version="$cc_version, ok"
612 cc_verc_fail=no
614 'not found')
615 cc_verc_fail=yes
618 cc_version="$cc_version, bad"
619 cc_verc_fail=yes
621 esac
622 echores "$cc_version"
623 (test "$cc_verc_fail" = "no") && break
624 done
625 fi # icc
626 if test "$cc_verc_fail" = yes ; then
627 cat <<EOF
629 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
631 You are not using a supported compiler. We do not have the time to make sure
632 everything works with compilers other than the ones we use. Use either the
633 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
634 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
636 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
637 mplayer and lame (which is used for mencoder). If you get compile errors,
638 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
639 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
640 bugs!
642 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
644 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
647 die "Bad gcc version"
649 else
650 cat <<EOF
652 ******************************************************************************
654 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
655 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
657 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
658 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
659 Lame which is used by mencoder produces weird errors, too.
661 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
662 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
664 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
666 ******************************************************************************
670 read _answer
673 echocheck "host cc"
674 if not test "$_host_cc" ; then
675 _host_cc=$_cc
677 echores $_host_cc
680 # ---
682 # now that we know what compiler should be used for compilation, try to find
683 # out which assembler is used by the $_cc compiler
684 if test "$_as" = auto ; then
685 _as=`$_cc -print-prog-name=as`
686 test -z "$_as" && _as=as
689 # XXX: this should be ok..
690 _cpuinfo="echo"
691 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
692 # FIXME: Remove the cygwin check once AMD CPUs are supported
693 if test -r /proc/cpuinfo && not cygwin; then
694 # Linux with /proc mounted, extract CPU information from it
695 _cpuinfo="cat /proc/cpuinfo"
696 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
697 # FreeBSD with Linux emulation /proc mounted,
698 # extract CPU information from it
699 _cpuinfo="cat /compat/linux/proc/cpuinfo"
700 elif darwin ; then
701 # use hostinfo on Darwin
702 _cpuinfo="hostinfo"
703 elif x86; then
704 # all other OSes try to extract CPU information from a small helper
705 # program TOOLS/cpuinfo instead
706 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
707 _cpuinfo="TOOLS/cpuinfo"
710 x86_exts_check()
712 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | _head 1`
713 if test -z "$pparam" ; then
714 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | _head 1`
717 _mmx=no
718 _3dnow=no
719 _3dnowex=no
720 _mmx2=no
721 _sse=no
722 _sse2=no
723 _mtrr=no
725 for i in $pparam ; do
726 case "$i" in
727 3dnow) _3dnow=yes ;;
728 3dnowext) _3dnow=yes _3dnowex=yes ;;
729 mmx) _mmx=yes ;;
730 mmxext) _mmx2=yes ;;
731 mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;;
732 xmm|sse|kni) _sse=yes _mmx2=yes ;;
733 sse2) _sse2=yes ;;
734 esac
735 done
738 case "$host_arch" in
739 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
740 _def_arch="#define ARCH_X86 1"
741 _target_arch="TARGET_ARCH_X86 = yes"
743 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
744 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
745 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
746 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
747 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | _head 1`
749 x86_exts_check
751 echocheck "CPU vendor"
752 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
754 echocheck "CPU type"
755 echores "$pname"
757 case "$pvendor" in
758 AuthenticAMD)
759 case "$pfamily" in
760 3) proc=i386 iproc=386 ;;
761 4) proc=i486 iproc=486 ;;
762 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
763 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
764 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
765 proc=k6-3
766 elif test "$pmodel" -ge 8; then
767 proc=k6-2
768 elif test "$pmodel" -ge 6; then
769 proc=k6
770 else
771 proc=i586
772 iproc=586
775 6) iproc=686
776 if test "$pmodel" -ge 7; then
777 proc=athlon-4
778 elif test "$pmodel" -ge 6; then
779 # only Athlon XP supports ssem MP, Duron etc not
780 # but most of them are CPUID 666, so check if sse detected
781 # btw. there is also athlon-mp opt, but we need extended
782 # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos
783 if test "$_sse" = yes && test "$pstepping" -ge 2; then
784 proc=athlon-xp
785 else
786 proc=athlon-4
788 elif test "$pmodel" -ge 4; then
789 proc=athlon-tbird
790 else
791 proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead?
795 *) proc=athlon-xp iproc=686 ;;
796 esac
798 GenuineIntel)
799 case "$pfamily" in
800 3) proc=i386 iproc=386 ;;
801 4) proc=i486 iproc=486 ;;
802 5) iproc=586
803 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
804 proc=pentium-mmx # 4 is desktop, 8 is mobile
805 else
806 proc=i586
809 6) iproc=686
810 if test "$pmodel" -ge 7; then
811 proc=pentium3
812 elif test "$pmodel" -ge 3; then
813 proc=pentium2
814 else
815 proc=i686
818 15) proc=pentium4 iproc=686 ;;
819 *) proc=pentium4 iproc=686 ;;
820 esac
822 unknown)
823 case "$pfamily" in
824 3) proc=i386 iproc=386 ;;
825 4) proc=i486 iproc=486 ;;
826 *) proc=i586 iproc=586 ;;
827 esac
830 proc=i586 iproc=586 ;;
831 esac
833 # check that gcc supports our CPU, if not, fall back to earlier ones
834 # LGB: check -mcpu and -march swithing step by step with enabling
835 # to fall back till 386.
837 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
839 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
840 cpuopt=-mtune
841 else
842 cpuopt=-mcpu
845 echocheck "GCC & CPU optimization abilities"
846 cat > $TMPC << EOF
847 int main(void) { return 0; }
849 if test "$_runtime_cpudetection" = no ; then
850 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
851 cc_check -march=$proc $cpuopt=$proc || proc=athlon
853 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
854 cc_check -march=$proc $cpuopt=$proc || proc=k6
856 if test "$proc" = "k6"; then
857 if not cc_check -march=$proc $cpuopt=$proc; then
858 if cc_check -march=i586 $cpuopt=i686; then
859 proc=i586-i686
860 else
861 proc=i586
865 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon"; then
866 cc_check -march=$proc $cpuopt=$proc || proc=i686
868 if test "$proc" = "i686" || test "$proc" = "pentium-mmx"; then
869 cc_check -march=$proc $cpuopt=$proc || proc=i586
871 if test "$proc" = "i586" ; then
872 cc_check -march=$proc $cpuopt=$proc || proc=i486
874 if test "$proc" = "i486" ; then
875 cc_check -march=$proc $cpuopt=$proc || proc=i386
877 if test "$proc" = "i386" ; then
878 cc_check -march=$proc $cpuopt=$proc || proc=error
880 if test "$proc" = "error" ; then
881 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'."
882 _mcpu=""
883 _march=""
884 _optimizing=""
885 elif test "$proc" = "i586-i686"; then
886 _march="-march=i586"
887 _mcpu="$cpuopt=i686"
888 _optimizing="$proc"
889 else
890 _march="-march=$proc"
891 _mcpu="$cpuopt=$proc"
892 _optimizing="$proc"
894 else
895 # i686 is probably the most common CPU - optimize for it
896 _mcpu="$cpuopt=i686"
897 # at least i486 required, for bswap instruction
898 _march="-march=i486"
899 cc_check $_mcpu || _mcpu=""
900 cc_check $_march $_mcpu || _march=""
903 ## Gabucino : --target takes effect here (hopefully...) by overwriting
904 ## autodetected mcpu/march parameters
905 if test "$_target" ; then
906 # TODO: it may be a good idea to check GCC and fall back in all cases
907 if test "$host_arch" = "i586-i686"; then
908 _march="-march=i586"
909 _mcpu="$cpuopt=i686"
910 else
911 _march="-march=$host_arch"
912 _mcpu="$cpuopt=$host_arch"
915 proc="$host_arch"
917 case "$proc" in
918 i386) iproc=386 ;;
919 i486) iproc=486 ;;
920 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
921 i686|athlon*|pentium*) iproc=686 ;;
922 *) iproc=586 ;;
923 esac
926 echores "$proc"
929 ia64)
930 _def_arch='#define ARCH_IA64 1'
931 _target_arch='TARGET_ARCH_IA64 = yes'
932 iproc='ia64'
933 proc=''
934 _march=''
935 _mcpu=''
936 _optimizing=''
939 x86_64|amd64)
940 _def_arch='#define ARCH_X86_64 1'
941 _target_arch='TARGET_ARCH_X86_64 = yes'
942 iproc='x86_64'
943 proc=''
944 _march=''
945 _mcpu=''
946 _optimizing=''
947 x86_exts_check
950 sparc)
951 _def_arch='#define ARCH_SPARC 1'
952 _target_arch='TARGET_ARCH_SPARC = yes'
953 iproc='sparc'
954 if sunos ; then
955 echocheck "CPU type"
956 karch=`uname -m`
957 case "`echo $karch`" in
958 sun4) proc=v7 ;;
959 sun4c) proc=v7 ;;
960 sun4d) proc=v8 ;;
961 sun4m) proc=v8 ;;
962 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
963 *) ;;
964 esac
965 echores "$proc"
966 else
967 proc=v8
969 _march=''
970 _mcpu="-mcpu=$proc"
971 _optimizing="$proc"
974 sparc64)
975 _def_arch='#define ARCH_SPARC 1'
976 _target_arch='TARGET_ARCH_SPARC = yes'
977 _vis='yes'
978 _def_vis='#define HAVE_VIS = yes'
979 iproc='sparc'
980 proc='v9'
981 _march=''
982 _mcpu="-mcpu=$proc"
983 _optimizing="$proc"
986 arm|armv4l|armv5tel)
987 _def_arch='#define ARCH_ARMV4L 1'
988 _target_arch='TARGET_ARCH_ARMV4L = yes'
989 iproc='arm'
990 proc=''
991 _march=''
992 _mcpu=''
993 _optimizing=''
996 ppc)
997 _def_arch='#define ARCH_POWERPC 1'
998 _target_arch='TARGET_ARCH_POWERPC = yes'
999 iproc='ppc'
1000 proc=''
1001 _march=''
1002 _mcpu=''
1003 _optimizing=''
1004 _altivec=no
1006 echocheck "CPU type"
1007 if linux && test -n "$_cpuinfo"; then
1008 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | _head 1`
1009 if test -n "`$_cpuinfo | grep altivec`"; then
1010 _altivec=yes
1013 if darwin ; then
1014 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
1015 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
1016 _altivec=yes
1017 elif [ "`sysctl -n hw.optional.altivec 2>/dev/null`" = 1 ]; then
1018 _altivec=yes
1021 # only gcc 3.4 works reliably with altivec code under netbsd
1022 if netbsd ; then
1023 case $cc_version in
1024 2*|3.0*|3.1*|3.2*|3.3*)
1027 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
1028 _altivec=yes
1031 esac
1033 if test "$_altivec" = yes; then
1034 echores "$proc altivec"
1035 else
1036 echores "$proc"
1039 echocheck "GCC & CPU optimization abilities"
1041 if test -n "$proc"; then
1042 case "$proc" in
1043 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1044 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1045 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1046 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1047 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1048 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1049 *) ;;
1050 esac
1051 # gcc 3.1(.1) and up supports 7400 and 7450
1052 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1"; then
1053 case "$proc" in
1054 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1055 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1056 *) ;;
1057 esac
1059 # gcc 3.2 and up supports 970
1060 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3"; then
1061 case "$proc" in
1062 970*) _march='-mcpu=970' _mcpu='-mtune=970' ;;
1063 *) ;;
1064 esac
1068 if test -n "$_mcpu"; then
1069 _optimizing=`echo $_mcpu | cut -c 8-`
1070 echores "$_optimizing"
1071 else
1072 echores "none"
1077 alpha)
1078 _def_arch='#define ARCH_ALPHA 1'
1079 _target_arch='TARGET_ARCH_ALPHA = yes'
1080 iproc='alpha'
1081 _march=''
1083 echocheck "CPU type"
1084 cat > $TMPC << EOF
1085 int main() {
1086 unsigned long ver, mask;
1087 asm ("implver %0" : "=r" (ver));
1088 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1089 printf("%ld-%x\n", ver, ~mask);
1090 return 0;
1093 $_cc -o "$TMPO" "$TMPC"
1094 case `"$TMPO"` in
1096 0-0) proc="ev4"; cpu_understands_mvi="0";;
1097 1-0) proc="ev5"; cpu_understands_mvi="0";;
1098 1-1) proc="ev56"; cpu_understands_mvi="0";;
1099 1-101) proc="pca56"; cpu_understands_mvi="1";;
1100 2-303) proc="ev6"; cpu_understands_mvi="1";;
1101 2-307) proc="ev67"; cpu_understands_mvi="1";;
1102 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1103 esac
1104 echores "$proc"
1106 echocheck "GCC & CPU optimization abilities"
1107 if test "$proc" = "ev68" ; then
1108 cc_check -mcpu=$proc || proc=ev67
1110 if test "$proc" = "ev67" ; then
1111 cc_check -mcpu=$proc || proc=ev6
1113 _mcpu="-mcpu=$proc"
1114 echores "$proc"
1116 _optimizing="$proc"
1118 echocheck "MVI instruction support in GCC"
1119 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1120 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1121 echores "yes"
1122 else
1123 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1124 echores "no, GCC = `( $_cc -dumpversion ) 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1128 mips)
1129 _def_arch='#define ARCH_SGI_MIPS 1'
1130 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1131 iproc='sgi-mips'
1132 proc=''
1133 _march=''
1134 _mcpu=''
1135 _optimizing=''
1137 if irix ; then
1138 echocheck "CPU type"
1139 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1140 case "`echo $proc`" in
1141 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1142 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1143 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1144 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1145 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1146 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1147 esac
1148 echores "$proc"
1153 hppa)
1154 _def_arch='#define ARCH_PA_RISC 1'
1155 _target_arch='TARGET_ARCH_PA_RISC = yes'
1156 iproc='PA-RISC'
1157 proc=''
1158 _march=''
1159 _mcpu=''
1160 _optimizing=''
1163 s390)
1164 _def_arch='#define ARCH_S390 1'
1165 _target_arch='TARGET_ARCH_S390 = yes'
1166 iproc='390'
1167 proc=''
1168 _march=''
1169 _mcpu=''
1170 _optimizing=''
1173 s390x)
1174 _def_arch='#define ARCH_S390X 1'
1175 _target_arch='TARGET_ARCH_S390X = yes'
1176 iproc='390x'
1177 proc=''
1178 _march=''
1179 _mcpu=''
1180 _optimizing=''
1183 vax)
1184 _def_arch='#define ARCH_VAX 1'
1185 _target_arch='TARGET_ARCH_VAX = yes'
1186 iproc='vax'
1187 proc=''
1188 _march=''
1189 _mcpu=''
1190 _optimizing=''
1194 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1195 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1196 die "unsupported architecture $host_arch"
1198 esac
1200 if test "$_runtime_cpudetection" = yes ; then
1201 if x86; then
1202 _mmx=yes
1203 _3dnow=yes
1204 _3dnowex=yes
1205 _mmx2=yes
1206 _sse=yes
1207 _sse2=yes
1208 _mtrr=yes
1210 if ppc; then
1211 _altivec=yes
1215 if x86 && test "$_runtime_cpudetection" = no ; then
1216 extcheck() {
1217 if test "$1" = yes ; then
1218 echocheck "kernel support of $2"
1219 cat > $TMPC <<EOF
1220 #include <signal.h>
1221 void catch() { exit(1); }
1222 int main(void){
1223 signal(SIGILL, catch);
1224 __asm__ __volatile__ ("$3":::"memory");return(0);
1228 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then
1229 echores "yes"
1230 _optimizing="$_optimizing $2"
1231 return 0
1232 else
1233 echores "failed"
1234 echo "It seems that your kernel does not correctly support $2."
1235 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1236 return 1
1239 return 0
1242 extcheck $_mmx "mmx" "emms" || _mmx=no
1243 extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
1244 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1245 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
1246 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1247 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1248 echocheck "mtrr support"
1249 echores "$_mtrr"
1251 if test "$_mtrr" = yes ; then
1252 _optimizing="$_optimizing mtrr"
1255 if test "$_gcc3_ext" != ""; then
1256 # if we had to disable sse/sse2 because the active kernel does not
1257 # support this instruction set extension, we also have to tell
1258 # gcc3 to not generate sse/sse2 instructions for normal C code
1259 cat > $TMPC << EOF
1260 int main(void) { return 0; }
1262 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1267 echocheck "assembler support of -pipe option"
1268 cat > $TMPC << EOF
1269 int main(void) { return 0; }
1271 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1273 _prefix="/usr/local"
1274 _xvmclib="XvMCNVIDIA"
1276 # GOTCHA: the variables below defines the default behavior for autodetection
1277 # and have - unless stated otherwise - at least 2 states : yes no
1278 # If autodetection is available then the third state is: auto
1279 _libavcodec=auto
1280 _amr_nb=auto
1281 _amr_nb_fixed=auto
1282 _amr_wb=auto
1283 _libavcodecso=auto
1284 _libavformat=auto
1285 _fame=auto
1286 _mp1e=no
1287 _mencoder=yes
1288 _x11=auto
1289 _dga=auto # 1 2 no auto
1290 _xv=auto
1291 _xvmc=no #auto when complete
1292 _sdl=auto
1293 _directx=auto
1294 _win32waveout=auto
1295 _nas=auto
1296 _png=auto
1297 _jpg=auto
1298 _pnm=yes
1299 _md5sum=yes
1300 _gif=auto
1301 _gl=auto
1302 _ggi=auto
1303 _aa=auto
1304 _caca=auto
1305 _svga=auto
1306 _vesa=auto
1307 _fbdev=auto
1308 _dvb=auto
1309 _dvbhead=auto
1310 _dxr2=auto
1311 _dxr3=auto
1312 _iconv=auto
1313 _langinfo=auto
1314 _rtc=auto
1315 _ossaudio=auto
1316 _arts=auto
1317 _esd=auto
1318 _polyp=auto
1319 _jack=auto
1320 _liblzo=auto
1321 _mad=auto
1322 _toolame=auto
1323 _tremor_internal=yes
1324 _tremor_low=no
1325 _vorbis=auto
1326 _theora=auto
1327 _mp3lib=yes
1328 _liba52=yes
1329 _libdts=auto
1330 _libmpeg2=yes
1331 _matroska_internal=yes
1332 _tremor=no
1333 _faad_internal=auto
1334 _faad_external=auto
1335 _ladspa=auto
1336 _xmms=no
1337 # dvdnav disabled, it does not work
1338 #_dvdnav=no
1339 _dvdread=auto
1340 _dvdkit=auto
1341 _xanim=auto
1342 _real=auto
1343 _live=auto
1344 _xinerama=auto
1345 _mga=auto
1346 _xmga=auto
1347 _vm=auto
1348 _xf86keysym=auto
1349 _mlib=auto
1350 _sgiaudio=auto
1351 _sunaudio=auto
1352 _alsa=auto
1353 _fastmemcpy=yes
1354 _unrarlib=yes
1355 _win32=auto
1356 _dshow=yes
1357 _select=yes
1358 _tv=yes
1359 _tv_v4l=auto
1360 _tv_v4l2=auto
1361 _tv_bsdbt848=auto
1362 _edl=yes
1363 _network=yes
1364 _winsock2=auto
1365 _smbsupport=auto
1366 _vidix=auto
1367 _joystick=no
1368 _xvid=auto
1369 _x264=auto
1370 _divx4linux=auto
1371 _opendivx=no
1372 _lirc=auto
1373 _lircc=auto
1374 _gui=no
1375 _termcap=auto
1376 _termios=auto
1377 _3dfx=no
1378 _tdfxfb=no
1379 _tdfxvid=no
1380 _tga=yes
1381 _directfb=auto
1382 _zr=auto
1383 _bl=no
1384 _largefiles=no
1385 #_language=en
1386 _shm=auto
1387 _linux_devfs=no
1388 #_charset=utf8
1389 _i18n=auto
1390 _dynamic_plugins=no
1391 _crash_debug=auto
1392 _sighandler=yes
1393 _libdv=auto
1394 _cdparanoia=auto
1395 _big_endian=auto
1396 _freetype=auto
1397 _fontconfig=auto
1398 _shared_pp=no
1399 _menu=no
1400 _qtx=auto
1401 _macosx=auto
1402 _macosx_finder_support=no
1403 _sortsub=yes
1404 _freetypeconfig='freetype-config'
1405 _fribidi=no
1406 _fribidiconfig='fribidi-config'
1407 _enca=auto
1408 _inet6=auto
1409 _gethostbyname2=auto
1410 _ftp=yes
1411 _vstream=auto
1412 for ac_option do
1413 case "$ac_option" in
1414 # Skip 1st pass
1415 --target=*) ;;
1416 --cc=*) ;;
1417 --host-cc=*) ;;
1418 --as=*) ;;
1419 --enable-gcc-checking) ;;
1420 --disable-gcc-checking) ;;
1421 --enable-static*) ;;
1422 --disable-static*) ;;
1423 --with-extraincdir=*) ;;
1424 --with-extralibdir=*) ;;
1425 --enable-runtime-cpudetection) ;;
1426 --disable-runtime-cpudetection) ;;
1427 --install-path=*) ;;
1428 --with-install=*) ;;
1430 # Real 2nd pass
1431 --enable-mencoder) _mencoder=yes ;;
1432 --disable-mencoder) _mencoder=no ;;
1433 --enable-i18n) _i18n=yes ;;
1434 --disable-i18n) _i18n=no ;;
1435 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1436 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1437 --enable-x11) _x11=yes ;;
1438 --disable-x11) _x11=no ;;
1439 --enable-xv) _xv=yes ;;
1440 --disable-xv) _xv=no ;;
1441 --enable-xvmc) _xvmc=yes ;;
1442 --disable-xvmc) _xvmc=no ;;
1443 --enable-sdl) _sdl=yes ;;
1444 --disable-sdl) _sdl=no ;;
1445 --enable-directx) _directx=yes ;;
1446 --disable-directx) _directx=no ;;
1447 --enable-win32waveout) _win32waveout=yes ;;
1448 --disable-win32waveout) _win32waveout=no ;;
1449 --enable-nas) _nas=yes ;;
1450 --disable-nas) _nas=no ;;
1451 --enable-png) _png=yes ;;
1452 --disable-png) _png=no ;;
1453 --enable-jpeg) _jpg=yes ;;
1454 --disable-jpeg) _jpg=no ;;
1455 --enable-pnm) _pnm=yes ;;
1456 --disable-pnm) _pnm=no ;;
1457 --enable-md5sum) _md5sum=yes ;;
1458 --disable-md5sum) _md5sum=no ;;
1459 --enable-gif) _gif=yes ;;
1460 --disable-gif) _gif=no ;;
1461 --enable-gl) _gl=yes ;;
1462 --disable-gl) _gl=no ;;
1463 --enable-ggi) _ggi=yes ;;
1464 --disable-ggi) _ggi=no ;;
1465 --enable-aa) _aa=yes ;;
1466 --disable-aa) _aa=no ;;
1467 --enable-caca) _caca=yes ;;
1468 --disable-caca) _caca=no ;;
1469 --enable-svga) _svga=yes ;;
1470 --disable-svga) _svga=no ;;
1471 --enable-vesa) _vesa=yes ;;
1472 --disable-vesa) _vesa=no ;;
1473 --enable-fbdev) _fbdev=yes ;;
1474 --disable-fbdev) _fbdev=no ;;
1475 --enable-dvb) _dvb=yes ;;
1476 --disable-dvb) _dvb=no ;;
1477 --enable-dvbhead) _dvbhead=yes ;;
1478 --disable-dvbhead) _dvbhead=no ;;
1479 --enable-dxr2) _dxr2=yes ;;
1480 --disable-dxr2) _dxr2=no ;;
1481 --enable-dxr3) _dxr3=yes ;;
1482 --disable-dxr3) _dxr3=no ;;
1483 --enable-iconv) _iconv=yes ;;
1484 --disable-iconv) _iconv=no ;;
1485 --enable-langinfo) _langinfo=yes ;;
1486 --disable-langinfo) _langinfo=no ;;
1487 --enable-rtc) _rtc=yes ;;
1488 --disable-rtc) _rtc=no ;;
1489 --enable-mp1e) _mp1e=yes ;;
1490 --disable-mp1e) _mp1e=no ;;
1491 --enable-libdv) _libdv=yes ;;
1492 --disable-libdv) _libdv=no ;;
1493 --enable-ossaudio) _ossaudio=yes ;;
1494 --disable-ossaudio) _ossaudio=no ;;
1495 --enable-arts) _arts=yes ;;
1496 --disable-arts) _arts=no ;;
1497 --enable-esd) _esd=yes ;;
1498 --disable-esd) _esd=no ;;
1499 --enable-polyp) _polyp=yes ;;
1500 --disable-polyp) _polyp=no ;;
1501 --enable-jack) _jack=yes ;;
1502 --disable-jack) _jack=no ;;
1503 --enable-mad) _mad=yes ;;
1504 --disable-mad) _mad=no ;;
1505 --disable-toolame) _toolame=no ;;
1506 --enable-liblzo) _liblzo=yes ;;
1507 --disable-liblzo) _liblzo=no ;;
1508 --enable-vorbis) _vorbis=yes ;;
1509 --disable-vorbis) _vorbis=no ;;
1510 --enable-internal-tremor) _tremor_internal=yes ;;
1511 --disable-internal-tremor) _tremor_internal=no ;;
1512 --enable-tremor-low) _tremor_low=yes ;;
1513 --disable-tremor-low) _tremor_low=no ;;
1514 --enable-external-tremor) _tremor=yes ;;
1515 --disable-external-tremor) _tremor=no ;;
1516 --enable-theora) _theora=yes ;;
1517 --disable-theora) _theora=no ;;
1518 --enable-mp3lib) _mp3lib=yes ;;
1519 --disable-mp3lib) _mp3lib=no ;;
1520 --enable-liba52) _liba52=yes ;;
1521 --disable-liba52) _liba52=no ;;
1522 --enable-libdts) _libdts=yes ;;
1523 --disable-libdts) _libdts=no ;;
1524 --enable-libmpeg2) _libmpeg2=yes ;;
1525 --disable-libmpeg2) _libmpeg2=no ;;
1526 --enable-internal-matroska) _matroska_internal=yes ;;
1527 --disable-internal-matroska) _matroska_internal=no ;;
1528 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1529 --disable-internal-faad) _faad_internal=no ;;
1530 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1531 --disable-external-faad) _faad_external=no ;;
1532 --enable-ladspa) _ladspa=yes ;;
1533 --disable-ladspa) _ladspa=no ;;
1534 --enable-xmms) _xmms=yes ;;
1535 --disable-xmms) _xmms=no ;;
1536 --enable-dvdread) _dvdread=yes ;;
1537 --disable-dvdread) _dvdread=no ;;
1538 --enable-mpdvdkit) _dvdkit=yes ;;
1539 --disable-mpdvdkit) _dvdkit=no ;;
1540 # dvdnav disabled, it does not work
1541 # --enable-dvdnav) _dvdnav=yes ;;
1542 # --disable-dvdnav) _dvdnav=no ;;
1543 --enable-xanim) _xanim=yes ;;
1544 --disable-xanim) _xanim=no ;;
1545 --enable-real) _real=yes ;;
1546 --disable-real) _real=no ;;
1547 --enable-live) _live=yes ;;
1548 --disable-live) _live=no ;;
1549 --enable-xinerama) _xinerama=yes ;;
1550 --disable-xinerama) _xinerama=no ;;
1551 --enable-mga) _mga=yes ;;
1552 --disable-mga) _mga=no ;;
1553 --enable-xmga) _xmga=yes ;;
1554 --disable-xmga) _xmga=no ;;
1555 --enable-vm) _vm=yes ;;
1556 --disable-vm) _vm=no ;;
1557 --enable-xf86keysym) _xf86keysym=yes ;;
1558 --disable-xf86keysym) _xf86keysym=no ;;
1559 --enable-mlib) _mlib=yes ;;
1560 --disable-mlib) _mlib=no ;;
1561 --enable-sunaudio) _sunaudio=yes ;;
1562 --disable-sunaudio) _sunaudio=no ;;
1563 --enable-sgiaudio) _sgiaudio=yes ;;
1564 --disable-sgiaudio) _sgiaudio=no ;;
1565 --enable-alsa) _alsa=yes ;;
1566 --disable-alsa) _alsa=no ;;
1567 --enable-tv) _tv=yes ;;
1568 --disable-tv) _tv=no ;;
1569 --enable-edl) _edl=yes ;;
1570 --disable-edl) _edl=no ;;
1571 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1572 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1573 --enable-tv-v4l) _tv_v4l=yes ;;
1574 --disable-tv-v4l) _tv_v4l=no ;;
1575 --enable-tv-v4l2) _tv_v4l2=yes ;;
1576 --disable-tv-v4l2) _tv_v4l2=no ;;
1577 --enable-fastmemcpy) _fastmemcpy=yes ;;
1578 --disable-fastmemcpy) _fastmemcpy=no ;;
1579 --enable-network) _network=yes ;;
1580 --disable-network) _network=no ;;
1581 --enable-winsock2) _winsock2=yes ;;
1582 --disable-winsock2) _winsock2=no ;;
1583 --enable-smb) _smbsupport=yes ;;
1584 --disable-smb) _smbsupport=no ;;
1585 --enable-vidix) _vidix=yes ;;
1586 --disable-vidix) _vidix=no ;;
1587 --enable-joystick) _joystick=yes ;;
1588 --disable-joystick) _joystick=no ;;
1589 --enable-xvid) _xvid=yes ;;
1590 --disable-xvid) _xvid=no ;;
1591 --enable-x264) _x264=yes ;;
1592 --disable-x264) _x264=no ;;
1593 --enable-divx4linux) _divx4linux=yes ;;
1594 --disable-divx4linux) _divx4linux=no ;;
1595 --enable-opendivx) _opendivx=yes ;;
1596 --disable-opendivx) _opendivx=no ;;
1597 --enable-libavcodec) _libavcodec=yes ;;
1598 --disable-libavcodec) _libavcodec=no ;;
1599 --enable-amr_nb) _amr_nb=yes ;;
1600 --disable-amr_nb) _amr_nb=no ;;
1601 --enable-amr_nb-fixed) _amr_nb_fixed=yes ;;
1602 --disable-amr_nb-fixed) _amr_nb_fixed=no ;;
1603 --enable-amr_wb) _amr_wb=yes ;;
1604 --disable-amr_wb) _amr_wb=no ;;
1605 --enable-libavformat) _libavformat=yes;;
1606 --disable-libavformat) _libavformat=no ;;
1607 --enable-libfame) _fame=yes ;;
1608 --disable-libfame) _fame=no ;;
1609 --enable-lirc) _lirc=yes ;;
1610 --disable-lirc) _lirc=no ;;
1611 --enable-lircc) _lircc=yes ;;
1612 --disable-lircc) _lircc=no ;;
1613 --enable-gui) _gui=yes ;;
1614 --disable-gui) _gui=no ;;
1615 --enable-termcap) _termcap=yes ;;
1616 --disable-termcap) _termcap=no ;;
1617 --enable-termios) _termios=yes ;;
1618 --disable-termios) _termios=no ;;
1619 --enable-3dfx) _3dfx=yes ;;
1620 --disable-3dfx) _3dfx=no ;;
1621 --enable-tdfxfb) _tdfxfb=yes ;;
1622 --disable-tdfxvid) _tdfxvid=no ;;
1623 --enable-tdfxvid) _tdfxvid=yes ;;
1624 --disable-tga) _tga=no ;;
1625 --enable-tga) _tga=yes ;;
1626 --disable-tdfxfb) _tdfxfb=no ;;
1627 --enable-directfb) _directfb=yes ;;
1628 --disable-directfb) _directfb=no ;;
1629 --enable-zr) _zr=yes ;;
1630 --disable-zr) _zr=no ;;
1631 --enable-bl) _bl=yes ;;
1632 --disable-bl) _bl=no ;;
1633 --enable-mtrr) _mtrr=yes ;;
1634 --disable-mtrr) _mtrr=no ;;
1635 --enable-largefiles) _largefiles=yes ;;
1636 --disable-largefiles) _largefiles=no ;;
1637 --enable-shm) _shm=yes ;;
1638 --disable-shm) _shm=no ;;
1639 --enable-select) _select=yes ;;
1640 --disable-select) _select=no ;;
1641 --enable-linux-devfs) _linux_devfs=yes ;;
1642 --disable-linux-devfs) _linux_devfs=no ;;
1643 --enable-cdparanoia) _cdparanoia=yes ;;
1644 --disable-cdparanoia) _cdparanoia=no ;;
1645 --enable-big-endian) _big_endian=yes ;;
1646 --disable-big-endian) _big_endian=no ;;
1647 --enable-freetype) _freetype=yes ;;
1648 --disable-freetype) _freetype=no ;;
1649 --enable-fontconfig) _fontconfig=yes ;;
1650 --disable-fontconfig) _fontconfig=no ;;
1651 --enable-unrarlib) _unrarlib=yes ;;
1652 --disable-unrarlib) _unrarlib=no ;;
1653 --enable-ftp) _ftp=yes ;;
1654 --disable-ftp) _ftp=no ;;
1655 --enable-vstream) _vstream=yes ;;
1656 --disable-vstream) _vstream=no ;;
1658 --enable-fribidi) _fribidi=yes ;;
1659 --disable-fribidi) _fribidi=no ;;
1661 --enable-enca) _enca=yes ;;
1662 --disable-enca) _enca=no ;;
1664 --enable-inet6) _inet6=yes ;;
1665 --disable-inet6) _inet6=no ;;
1667 --enable-gethostbyname2) _gethostbyname2=yes ;;
1668 --disable-gethostbyname2) _gethostbyname2=no ;;
1670 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1671 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1672 --disable-dga) _dga=no ;;
1674 --enable-shared-pp) _shared_pp=yes ;;
1675 --disable-shared-pp) _shared_pp=no ;;
1677 --enable-menu) _menu=yes ;;
1678 --disable-menu) _menu=no ;;
1680 --enable-qtx) _qtx=yes ;;
1681 --disable-qtx) _qtx=no ;;
1683 --enable-macosx) _macosx=yes ;;
1684 --disable-macosx) _macosx=no ;;
1685 --enable-macosx-finder-support) _macosx_finder_support=yes ;;
1686 --disable-macosx-finder-support) _macosx_finder_support=no ;;
1688 --enable-sortsub) _sortsub=yes ;;
1689 --disable-sortsub) _sortsub=no ;;
1691 --charset=*)
1692 _charset=`echo $ac_option | cut -d '=' -f 2`
1694 --language=*)
1695 _language=`echo $ac_option | cut -d '=' -f 2`
1697 # dvdnav disabled, it does not work
1698 # --with-libdvdnav=*)
1699 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1700 # _dvdnav=yes
1701 # ;;
1703 --with-codecsdir=*)
1704 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1705 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1706 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1708 --with-win32libdir=*)
1709 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1710 _win32=yes
1712 --with-xanimlibdir=*)
1713 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1714 _xanim=yes
1716 --with-reallibdir=*)
1717 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1718 _real=yes
1720 --with-livelibdir=*)
1721 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
1723 --with-toolamedir=*)
1724 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
1726 --with-mlibdir=*)
1727 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1728 _mlib=yes
1731 --with-xmmslibdir=*)
1732 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
1735 --with-xmmsplugindir=*)
1736 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
1739 --with-bio2jack=*)
1740 _bio2jackdir=`echo $ac_option | cut -d '=' -f 2`
1743 --enable-profile)
1744 _profile='-p'
1746 --disable-profile)
1747 _profile=
1749 --enable-debug)
1750 _debug='-g'
1752 --enable-debug=*)
1753 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1755 --disable-debug)
1756 _debug=
1758 --enable-crash-debug)
1759 _crash_debug=yes
1761 --disable-crash-debug)
1762 _crash_debug=no
1764 --enable-sighandler)
1765 _sighandler=yes
1767 --disable-sighandler)
1768 _sighandler=no
1771 --enable-sse) _sse=yes ;;
1772 --disable-sse) _sse=no ;;
1773 --enable-sse2) _sse2=yes ;;
1774 --disable-sse2) _sse2=no ;;
1775 --enable-mmx2) _mmx2=yes ;;
1776 --disable-mmx2) _mmx2=no ;;
1777 --enable-3dnow) _3dnow=yes ;;
1778 --disable-3dnow) _3dnow=no _3dnowex=no ;;
1779 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
1780 --disable-3dnowex) _3dnowex=no ;;
1781 --enable-altivec) _altivec=yes ;;
1782 --disable-altivec) _altivec=no ;;
1783 --enable-mmx) _mmx=yes ;;
1784 --disable-mmx) # 3Dnow! and MMX2 require MMX
1785 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
1787 --enable-win32) _win32=yes ;;
1788 --disable-win32) _win32=no _dshow=no ;;
1789 --enable-dshow) _win32=yes _dshow=yes ;;
1790 --disable-dshow) _dshow=no ;;
1792 --with-x11incdir=*)
1793 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1795 --with-x11libdir=*)
1796 _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1798 --with-dxr2incdir=*)
1799 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1801 --with-xvmclib=*)
1802 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
1804 --with-dvbincdir=*)
1805 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1807 --with-xvidlibdir=*)
1808 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1810 --with-xvidincdir=*)
1811 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1813 --with-dtslibdir=*)
1814 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1816 --with-dtsincdir=*)
1817 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1819 --with-x264libdir=*)
1820 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1822 --with-x264incdir=*)
1823 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
1825 --with-sdl-config=*)
1826 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
1828 --with-freetype-config=*)
1829 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
1831 --with-fribidi-config=*)
1832 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
1834 --with-gtk-config=*)
1835 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
1837 --with-glib-config=*)
1838 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
1840 # dvdnav disabled, it does not work
1841 # --with-dvdnav-config=*)
1842 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
1843 # ;;
1844 --with-madlibdir=*)
1845 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1847 --with-cdparanoiaincdir=*)
1848 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1850 --with-cdparanoialibdir=*)
1851 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1853 --with-termcaplib=*)
1854 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
1855 _termcap=yes
1857 --prefix=*)
1858 _prefix=`echo $ac_option | cut -d '=' -f 2`
1860 --bindir=*)
1861 _bindir=`echo $ac_option | cut -d '=' -f 2`
1863 --datadir=*)
1864 _datadir=`echo $ac_option | cut -d '=' -f 2`
1866 --mandir=*)
1867 _mandir=`echo $ac_option | cut -d '=' -f 2`
1869 --confdir=*)
1870 _confdir=`echo $ac_option | cut -d '=' -f 2`
1872 --libdir=*)
1873 _libdir=`echo $ac_option | cut -d '=' -f 2`
1877 echo "Unknown parameter: $ac_option"
1878 exit 1
1881 esac
1882 done
1884 # Atmos: moved this here, to be correct, if --prefix is specified
1885 test -z "$_bindir" && _bindir="$_prefix/bin"
1886 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1887 test -z "$_mandir" && _mandir="$_prefix/man"
1888 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1889 test -z "$_libdir" && _libdir="$_prefix/lib"
1890 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
1892 if x86 ; then
1893 # Checking assembler (_as) compatibility...
1894 # Added workaround for older as that reads from stdin by default - atmos
1895 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
1896 echocheck "assembler ($_as $as_version)"
1898 _pref_as_version='2.9.1'
1899 echo 'nop' > $TMPS
1900 if test "$_mmx" = yes ; then
1901 echo 'emms' >> $TMPS
1903 if test "$_3dnow" = yes ; then
1904 _pref_as_version='2.10.1'
1905 echo 'femms' >> $TMPS
1907 if test "$_3dnowex" = yes ; then
1908 _pref_as_version='2.10.1'
1909 echo 'pswapd %mm0, %mm0' >> $TMPS
1911 if test "$_mmx2" = yes ; then
1912 _pref_as_version='2.10.1'
1913 echo 'movntq %mm0, (%eax)' >> $TMPS
1915 if test "$_sse" = yes ; then
1916 _pref_as_version='2.10.1'
1917 echo 'xorps %xmm0, %xmm0' >> $TMPS
1919 #if test "$_sse2" = yes ; then
1920 # _pref_as_version='2.11'
1921 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
1923 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
1925 if test "$as_verc_fail" != yes ; then
1926 echores "ok"
1927 else
1928 echores "failed"
1929 echo "Upgrade binutils to ${_pref_as_version} ..."
1930 die "obsolete binutils version"
1934 if ppc ; then
1936 # check if altivec is supported by the compiler, and how to enable it
1938 _altivec_gcc_flags=''
1940 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
1941 echocheck "GCC altivec support"
1943 p=''
1944 cat > $TMPC << EOF
1945 int main() {
1946 return 0;
1949 FSF_flags='-maltivec -mabi=altivec'
1950 Darwin_flags='-faltivec'
1952 # check for Darwin-style flags first, since
1953 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
1954 # accepts but ignores FSF-style flags...
1956 if test -z "$p"; then
1957 cc_check $Darwin_flags && p='Darwin'
1959 if test -z "$p"; then
1960 cc_check $FSF_flags && p='FSF'
1963 case $p in
1964 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
1965 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
1966 *) _altivec=no ;;
1967 esac
1969 if test -z "$p"; then
1970 p=none
1971 else
1972 p="$p-style ($_altivec_gcc_flags)"
1975 echores "$p"
1978 # check if <altivec.h> should be included
1980 _def_altivec_h='#undef HAVE_ALTIVEC_H'
1982 if test "$_altivec" = yes ; then
1983 echocheck "altivec.h"
1984 cat > $TMPC << EOF
1985 #include <altivec.h>
1986 int main(void) { return 0; }
1988 _have_altivec_h=no
1989 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
1990 if test "$_have_altivec_h" = yes ; then
1991 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
1993 echores "$_have_altivec_h"
1996 # disable runtime cpudetection if
1997 # - we cannot generate altivec code
1998 # - altivec is disabled by the user
2000 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
2001 _runtime_cpudetection=no
2004 # show that we are optimizing for altivec (if enabled and supported)
2006 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
2007 _optimizing="$_optimizing altivec"
2010 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
2012 if test "$_altivec" = yes ; then
2013 _mcpu="$_mcpu $_altivec_gcc_flags"
2016 # setup _def_altivec correctly
2018 if test "$_altivec" = yes ; then
2019 _def_altivec='#define HAVE_ALTIVEC 1'
2020 else
2021 _def_altivec='#undef HAVE_ALTIVEC'
2025 _def_mmx='#undef HAVE_MMX'
2026 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
2027 _def_mmx2='#undef HAVE_MMX2'
2028 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
2029 _def_3dnow='#undef HAVE_3DNOW'
2030 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
2031 _def_3dnowex='#undef HAVE_3DNOWEX'
2032 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
2033 _def_sse='#undef HAVE_SSE'
2034 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
2035 _def_sse2='#undef HAVE_SSE2'
2036 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
2038 # Checking kernel version...
2039 if x86 && linux ; then
2040 _k_verc_problem=no
2041 kernel_version=`uname -r 2>&1`
2042 echocheck "$system_name kernel version"
2043 case "$kernel_version" in
2044 '') kernel_version="?.??"; _k_verc_fail=yes;;
2045 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2046 _k_verc_problem=yes;;
2047 esac
2048 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2049 _k_verc_fail=yes
2051 if test "$_k_verc_fail" ; then
2052 echores "$kernel_version, fail"
2053 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2054 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2055 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2056 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2057 echo "2.2.x you must upgrade it to get SSE support!"
2058 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2059 else
2060 echores "$kernel_version, ok"
2064 if test "$_vidix" = auto ; then
2065 _vidix=no
2066 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
2067 x86 && _vidix=yes
2068 ppc && linux && _vidix=yes
2069 alpha && linux && _vidix=yes
2070 qnx && _vidix=no
2071 sunos && _vidix=no
2072 beos && _vidix=no
2075 echocheck "mplayer binary name"
2076 if win32 ; then
2077 _prg="mplayer.exe"
2078 _prg_mencoder="mencoder.exe"
2079 else
2080 _prg="mplayer"
2081 _prg_mencoder="mencoder"
2083 echores $_prg
2086 # On QNX we must link to libph - Gabucino
2087 if qnx ; then
2088 _ld_arch="$_ld_arch -lph"
2091 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2092 _awk=
2093 if test "$_vidix" = yes ; then
2094 _awk_verc_fail=yes
2095 echocheck "awk"
2096 for _awk in mawk gawk nawk awk; do
2097 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2098 _awk_verc_fail=no
2099 break
2101 done
2102 test "$_awk_verc_fail" = yes && _awk=no
2103 echores "$_awk"
2104 if test "$_awk_verc_fail" = yes; then
2105 echo "VIDIX needs awk, but no working implementation was found!"
2106 echo "Try the GNU version, which can be downloaded from:"
2107 echo "ftp://ftp.gnu.org/gnu/gawk/"
2108 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2109 die "no awk"
2113 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2114 if irix ; then
2115 _ranlib='ar -r'
2116 elif linux ; then
2117 _ranlib='true'
2120 ######################
2121 # MAIN TESTS GO HERE #
2122 ######################
2125 echocheck "extra headers"
2126 if test "$_inc_extra" ; then
2127 echores "$_inc_extra"
2128 else
2129 echores "none"
2133 echocheck "extra libs"
2134 if test "$_ld_extra" ; then
2135 echores "$_ld_extra"
2136 else
2137 echores "none"
2140 echocheck "-lposix"
2141 cat > $TMPC <<EOF
2142 int main(void) { return 0; }
2144 if cc_check -lposix ; then
2145 _ld_arch="$_ld_arch -lposix"
2146 echores "yes"
2147 else
2148 echores "no"
2151 echocheck "-lm"
2152 cat > $TMPC <<EOF
2153 int main(void) { return 0; }
2155 if cc_check -lm ; then
2156 _ld_lm="-lm"
2157 echores "yes"
2158 else
2159 _ld_lm=""
2160 echores "no"
2163 # Checking for localization ...
2164 # CSAK EGY MARADHAT - A HEGYLAKO
2165 echocheck "i18n"
2166 if test "$_i18n" != no ; then
2167 cat > $TMPC <<EOF
2168 #include <libintl.h>
2169 int main(void) { gettext("test"); return 0; }
2171 _i18n=no
2172 _i18n_libs=""
2173 if test "$_i18n" = auto ; then
2174 cc_check && _i18n=yes
2175 else
2176 for i18n_lib in "" "-lintl"; do
2177 cc_check $i18n_lib && _i18n=yes && _i18n_libs=$i18n_lib && break
2178 done
2181 if test "$_i18n" = yes ; then
2182 _def_i18n='#define USE_I18N 1'
2183 else
2184 _def_i18n='#undef USE_I18N'
2186 if test -z "$_i18n_libs" ; then
2187 echores "$_i18n"
2188 else
2189 echores "$_i18n (using $_i18n_libs)"
2193 echocheck "iconv"
2194 if test "$_iconv" = auto ; then
2195 _iconv_tmp='#include <iconv.h>'
2197 cat > $TMPC << EOF
2198 #include <stdio.h>
2199 #include <unistd.h>
2200 $_iconv_tmp
2201 #define INBUFSIZE 1024
2202 #define OUTBUFSIZE 4096
2204 char inbuffer[INBUFSIZE];
2205 char outbuffer[OUTBUFSIZE];
2207 int main(void) {
2208 size_t numread;
2209 iconv_t icdsc;
2210 char *tocode="UTF-8";
2211 char *fromcode="cp1250";
2212 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2213 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2214 char *iptr=inbuffer;
2215 char *optr=outbuffer;
2216 size_t inleft=numread;
2217 size_t outleft=OUTBUFSIZE;
2218 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2219 != (size_t)(-1)) {
2220 write (1, outbuffer, OUTBUFSIZE - outleft);
2223 if (iconv_close(icdsc) == -1)
2228 _iconv=no
2229 if cc_check $_ld_lm ; then
2230 _iconv=yes
2231 elif cc_check $_ld_lm -liconv ; then
2232 _iconv=yes
2233 _ld_iconv='-liconv'
2236 if test "$_iconv" = yes ; then
2237 _def_iconv='#define USE_ICONV 1'
2238 else
2239 _def_iconv='#undef USE_ICONV'
2241 echores "$_iconv"
2244 echocheck "langinfo"
2245 if test "$_langinfo" = auto ; then
2246 cat > $TMPC <<EOF
2247 #include <langinfo.h>
2248 int main(void) { nl_langinfo(CODESET); return 0; }
2250 _langinfo=no
2251 cc_check && _langinfo=yes
2253 if test "$_langinfo" = yes ; then
2254 _def_langinfo='#define USE_LANGINFO 1'
2255 else
2256 _def_langinfo='#undef USE_LANGINFO'
2258 echores "$_langinfo"
2261 echocheck "language"
2262 test -z "$_language" && _language=$LINGUAS
2263 _language=`echo $_language | sed 's/,/ /g'`
2264 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2265 for lang in $_language ; do
2266 test "$lang" = all && lang=en
2267 if test -f "help/help_mp-${lang}.h" ; then
2268 _language=$lang
2269 break
2270 else
2271 echo -n "$lang not found, "
2272 _language=`echo $_language | sed "s/$lang *//"`
2274 done
2275 test -z "$_language" && _language=en
2276 _mp_help="help/help_mp-${_language}.h"
2277 test -f $_mp_help || die "$_mp_help not found"
2278 for lang in $LANGUAGES ; do
2279 if test -f "DOCS/man/$lang/mplayer.1" ; then
2280 MAN_LANG="$MAN_LANG $lang"
2282 done
2283 _doc_lang=$_language
2284 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2285 echores "using $_language (man pages: $MAN_LANG)"
2288 echocheck "enable sighandler"
2289 if test "$_sighandler" = yes ; then
2290 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2291 else
2292 _def_sighandler='#undef ENABLE_SIGHANDLER'
2294 echores "$_sighandler"
2296 echocheck "runtime cpudetection"
2297 if test "$_runtime_cpudetection" = yes ; then
2298 _optimizing="Runtime CPU-Detection enabled"
2299 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2300 else
2301 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2303 echores "$_runtime_cpudetection"
2306 echocheck "restrict keyword"
2307 for restrict_keyword in restrict __restrict __restrict__ ; do
2308 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2309 if cc_check; then
2310 _def_restrict_keyword=$restrict_keyword
2311 break;
2313 done
2314 if [ -n "$_def_restrict_keyword" ]; then
2315 echores "$_def_restrict_keyword"
2316 else
2317 echores "none"
2319 # Avoid infinite recursion loop ("#define restrict restrict")
2320 if [ "$_def_restrict_keyword" != "restrict" ]; then
2321 _def_restrict_keyword="#define restrict $_def_restrict_keyword"
2322 else
2323 _def_restrict_keyword=""
2327 echocheck "__builtin_expect"
2328 # GCC branch prediction hint
2329 cat > $TMPC << EOF
2330 int foo (int a) {
2331 a = __builtin_expect (a, 10);
2332 return a == 10 ? 0 : 1;
2334 int main() { return foo(10) && foo(0); }
2336 _builtin_expect=no
2337 cc_check && _builtin_expect=yes
2338 if test "$_builtin_expect" = yes ; then
2339 _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2340 else
2341 _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2343 echores "$_builtin_expect"
2346 echocheck "kstat"
2347 cat > $TMPC << EOF
2348 #include <kstat.h>
2349 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2351 _kstat=no
2352 cc_check -lkstat && _kstat=yes
2353 if test "$_kstat" = yes ; then
2354 _ld_arch="-lkstat $_ld_arch"
2356 if test "$_kstat" = yes ; then
2357 _def_kstat="#define HAVE_LIBKSTAT 1"
2358 else
2359 _def_kstat="#undef HAVE_LIBKSTAT"
2361 echores "$_kstat"
2364 echocheck "posix4"
2365 # required for nanosleep on some systems
2366 cat > $TMPC << EOF
2367 #include <time.h>
2368 int main(void) { (void) nanosleep(0, 0); return 0; }
2370 _posix4=no
2371 cc_check -lposix4 && _posix4=yes
2372 if test "$_posix4" = yes ; then
2373 _ld_arch="-lposix4 $_ld_arch"
2375 echores "$_posix4"
2378 echocheck "lrintf"
2379 cat > $TMPC << EOF
2380 #include <math.h>
2381 int main(void) { (void) lrintf(0.0); return 0; }
2383 _lrintf=no
2384 cc_check $_ld_lm && _lrintf=yes
2385 if test "$_lrintf" = yes ; then
2386 _def_lrintf="#define HAVE_LRINTF 1"
2387 else
2388 _def_lrintf="#undef HAVE_LRINTF"
2390 echores "$_lrintf"
2393 echocheck "nanosleep"
2394 # also check for nanosleep
2395 cat > $TMPC << EOF
2396 #include <time.h>
2397 int main(void) { (void) nanosleep(0, 0); return 0; }
2399 _nanosleep=no
2400 cc_check $_ld_arch && _nanosleep=yes
2401 if test "$_nanosleep" = yes ; then
2402 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2403 else
2404 _def_nanosleep='#undef HAVE_NANOSLEEP'
2406 echores "$_nanosleep"
2409 echocheck "socklib"
2410 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2411 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2412 cat > $TMPC << EOF
2413 #include <netdb.h>
2414 int main(void) { (void) gethostbyname(0); return 0; }
2416 cc_check -lsocket && _ld_sock="-lsocket"
2417 cc_check -lnsl && _ld_sock="-lnsl"
2418 cc_check -lsocket -lnsl && _ld_sock="-lsocket -lnsl"
2419 cc_check -lsocket -ldnet && _ld_sock="-lsocket -ldnet"
2420 cc_check -lsocket -lbind && _ld_sock="-lsocket -lbind"
2421 if test $_winsock2 = auto && not cygwin ; then
2422 _winsock2=no
2423 cat > $TMPC << EOF
2424 #include <winsock2.h>
2425 int main(void) { (void) gethostbyname(0); return 0; }
2427 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2429 if test "$_ld_sock" ; then
2430 echores "yes (using $_ld_sock)"
2431 else
2432 echores "no"
2436 if test $_winsock2 = yes ; then
2437 _ld_sock="-lws2_32"
2438 _def_winsock2='#define HAVE_WINSOCK2 1'
2439 else
2440 _def_winsock2='#undef HAVE_WINSOCK2'
2444 _use_aton=no
2445 echocheck "inet_pton()"
2446 cat > $TMPC << EOF
2447 #include <sys/types.h>
2448 #include <sys/socket.h>
2449 #include <arpa/inet.h>
2450 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2452 if test "$_winsock2" = yes ; then
2453 echores "not needed (using winsock2 functions)"
2454 elif cc_check $_ld_sock ; then
2455 # NOTE: Linux has libresolv but does not need it
2457 echores "yes (using $_ld_sock)"
2458 elif cc_check $_ld_sock -lresolv ; then
2459 # NOTE: needed for SunOS at least
2460 _ld_sock="$_ld_sock -lresolv"
2461 echores "yes (using $_ld_sock)"
2462 else
2463 echores "no (=> i'll try inet_aton next)"
2465 echocheck "inet_aton()"
2466 cat > $TMPC << EOF
2467 #include <sys/types.h>
2468 #include <sys/socket.h>
2469 #include <arpa/inet.h>
2470 int main(void) { (void) inet_aton(0, 0); return 0; }
2472 _use_aton=yes
2473 if cc_check $_ld_sock ; then
2474 # NOTE: Linux has libresolv but does not need it
2476 echores "yes (using $_ld_sock)"
2477 elif cc_check $_ld_sock -lresolv ; then
2478 # NOTE: needed for SunOS at least
2479 _ld_sock="$_ld_sock -lresolv"
2480 echores "yes (using $_ld_sock)"
2481 else
2482 _use_aton=no
2483 _network=no
2484 echores "no (=> network support disabled)"
2488 _def_use_aton='#undef USE_ATON'
2489 if test "$_use_aton" != no; then
2490 _def_use_aton='#define USE_ATON 1'
2494 echocheck "inttypes.h (required)"
2495 cat > $TMPC << EOF
2496 #include <inttypes.h>
2497 int main(void) { return 0; }
2499 _inttypes=no
2500 cc_check && _inttypes=yes
2501 if test "$_inttypes" = yes ; then
2502 # nothing to do
2504 else
2505 echores "no"
2506 echocheck "bitypes.h (inttypes.h predecessor)"
2507 cat > $TMPC << EOF
2508 #include <sys/bitypes.h>
2509 int main(void) { return 0; }
2511 _inttypes=no
2512 cc_check && _inttypes=yes
2513 if test "$_inttypes" = yes ; then
2514 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."
2515 else
2516 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2519 echores "$_inttypes"
2522 echocheck "int_fastXY_t in inttypes.h"
2523 cat > $TMPC << EOF
2524 #include <inttypes.h>
2525 int main(void) {
2526 volatile int_fast16_t v= 0;
2527 return v; }
2529 _fast_inttypes=no
2530 cc_check && _fast_inttypes=yes
2531 if test "$_fast_inttypes" = yes ; then
2532 # nothing to do
2534 else
2535 _def_fast_inttypes='
2536 typedef signed char int_fast8_t;
2537 typedef signed int int_fast16_t;
2538 typedef signed int int_fast32_t;
2539 typedef unsigned char uint_fast8_t;
2540 typedef unsigned int uint_fast16_t;
2541 typedef unsigned int uint_fast32_t;'
2543 echores "$_fast_inttypes"
2546 echocheck "word size"
2547 _mp_wordsize="#undef MP_WORDSIZE"
2548 cat > $TMPC << EOF
2549 #include <stdio.h>
2550 #include <sys/types.h>
2551 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2553 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2554 echores "$_wordsize"
2557 echocheck "stddef.h"
2558 cat > $TMPC << EOF
2559 #include <stddef.h>
2560 int main(void) { return 0; }
2562 _stddef=no
2563 cc_check && _stddef=yes
2564 if test "$_stddef" = yes ; then
2565 _def_stddef='#define HAVE_STDDEF_H 1'
2566 else
2567 _def_stddef='#undef HAVE_STDDEF_H'
2569 echores "$_stddef"
2572 echocheck "malloc.h"
2573 cat > $TMPC << EOF
2574 #include <malloc.h>
2575 int main(void) { (void) malloc(0); return 0; }
2577 _malloc=no
2578 cc_check && _malloc=yes
2579 if test "$_malloc" = yes ; then
2580 _def_malloc='#define HAVE_MALLOC_H 1'
2581 else
2582 _def_malloc='#undef HAVE_MALLOC_H'
2584 # malloc.h emits a warning in FreeBSD and OpenBSD
2585 (freebsd || openbsd) && _def_malloc='#undef HAVE_MALLOC_H'
2586 echores "$_malloc"
2589 echocheck "memalign()"
2590 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2591 cat > $TMPC << EOF
2592 #include <malloc.h>
2593 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2595 _memalign=no
2596 cc_check && _memalign=yes
2597 if test "$_memalign" = yes ; then
2598 _def_memalign='#define HAVE_MEMALIGN 1'
2599 else
2600 _def_memalign='#undef HAVE_MEMALIGN'
2602 echores "$_memalign"
2605 echocheck "alloca.h"
2606 cat > $TMPC << EOF
2607 #include <alloca.h>
2608 int main(void) { (void) alloca(0); return 0; }
2610 _alloca=no
2611 cc_check && _alloca=yes
2612 if cc_check ; then
2613 _def_alloca='#define HAVE_ALLOCA_H 1'
2614 else
2615 _def_alloca='#undef HAVE_ALLOCA_H'
2617 echores "$_alloca"
2620 echocheck "mman.h"
2621 cat > $TMPC << EOF
2622 #include <sys/types.h>
2623 #include <sys/mman.h>
2624 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2626 _mman=no
2627 cc_check && _mman=yes
2628 if test "$_mman" = yes ; then
2629 _def_mman='#define HAVE_SYS_MMAN_H 1'
2630 else
2631 _def_mman='#undef HAVE_SYS_MMAN_H'
2633 echores "$_mman"
2635 cat > $TMPC << EOF
2636 #include <sys/types.h>
2637 #include <sys/mman.h>
2638 int main(void) { void *p = MAP_FAILED; return 0; }
2640 _mman_has_map_failed=no
2641 cc_check && _mman_has_map_failed=yes
2642 if test "$_mman_has_map_failed" = yes ; then
2643 _def_mman_has_map_failed=''
2644 else
2645 _def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2648 echocheck "dynamic loader"
2649 cat > $TMPC << EOF
2650 #include <dlfcn.h>
2651 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2653 _dl=no
2654 if cc_check ; then
2655 _dl=yes
2656 elif cc_check -ldl ; then
2657 _dl=yes
2658 _ld_dl='-ldl'
2660 if test "$_dl" = yes ; then
2661 _def_dl='#define HAVE_LIBDL 1'
2662 else
2663 _def_dl='#undef HAVE_LIBDL'
2665 echores "$_dl"
2668 echocheck "dynamic a/v plugins support"
2669 if test "$_dl" = no ; then
2670 _dynamic_plugins=no
2672 if test "$_dynamic_plugins" = yes ; then
2673 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2674 else
2675 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2677 echores "$_dynamic_plugins"
2680 #echocheck "dynamic linking"
2681 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2682 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2683 #cat > $TMPC << EOF
2684 #int main(void) { return 0; }
2685 #EOF
2686 #if cc_check -rdynamic ; then
2687 # _ld_dl_dynamic='-rdynamic'
2688 #elif cc_check -Bdynamic ; then
2689 # _ld_dl_dynamic='-Bdynamic'
2690 #elif cc_check ; then
2691 # _ld_dl_dynamic=''
2693 #echores "using $_ld_dl_dynamic"
2695 _def_threads='#undef HAVE_THREADS'
2697 echocheck "pthread"
2698 cat > $TMPC << EOF
2699 #include <pthread.h>
2700 void* func(void *arg) { return arg; }
2701 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2703 if mingw32 ; then
2704 _ld_pthread=''
2705 elif hpux ; then
2706 _ld_pthread=''
2707 elif ( cc_check && $TMPO ) ; then # QNX
2708 _ld_pthread=' ' # _ld_pthread='' would disable pthreads, but the test worked
2709 elif ( cc_check -lpthread && $TMPO ) ; then
2710 _ld_pthread='-lpthread'
2711 elif ( cc_check -pthread && $TMPO ) ; then
2712 _ld_pthread='-pthread'
2713 else
2714 if test "$_ld_static" ; then
2715 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2716 if ( cc_check -lpthread ) ; then
2717 _ld_pthread='-lpthread'
2718 elif ( cc_check -pthread ) ; then
2719 _ld_pthread='-pthread'
2720 else
2721 echores "no static pthread found (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, Win32 loader disabled)"
2722 _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
2724 else
2725 echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
2726 _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
2729 if test "$_ld_pthread" != '' ; then
2730 echores "yes (using $_ld_pthread)"
2731 _pthreads='yes'
2732 _def_pthreads='#define HAVE_PTHREADS 1'
2733 _def_threads='#define HAVE_THREADS 1'
2734 else
2735 echores "no"
2736 _pthreads=''
2737 _def_pthreads='#undef HAVE_PTHREADS'
2741 echocheck "sys/soundcard.h"
2742 cat > $TMPC << EOF
2743 #include <sys/soundcard.h>
2744 int main(void) { return 0; }
2746 _sys_soundcard=no
2747 cc_check && _sys_soundcard=yes
2748 if test "$_sys_soundcard" = yes ; then
2749 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2750 _inc_soundcard='#include <sys/soundcard.h>'
2751 else
2752 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2754 echores "$_sys_soundcard"
2756 if test "$_sys_soundcard" != yes ; then
2757 echocheck "soundcard.h"
2758 cat > $TMPC << EOF
2759 #include <soundcard.h>
2760 int main(void) { return 0; }
2762 _soundcard=no
2763 cc_check && _soundcard=yes
2764 if linux || test "$_ossaudio" != no ; then
2765 # use soundcard.h on Linux, or when OSS support is enabled
2766 echores "$_soundcard"
2767 else
2768 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
2769 echores "$_soundcard, but ignored!"
2770 _soundcard=no
2772 if test "$_soundcard" = yes ; then
2773 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
2774 _inc_soundcard='#include <soundcard.h>'
2775 else
2776 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2778 else
2779 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2783 echocheck "sys/dvdio.h"
2784 cat > $TMPC << EOF
2785 #include <unistd.h>
2786 #include <sys/dvdio.h>
2787 int main(void) { return 0; }
2789 _dvdio=no
2790 cc_check && _dvdio=yes
2791 if test "$_dvdio" = yes ; then
2792 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2793 else
2794 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2796 echores "$_dvdio"
2799 echocheck "sys/cdio.h"
2800 cat > $TMPC << EOF
2801 #include <unistd.h>
2802 #include <sys/cdio.h>
2803 int main(void) { return 0; }
2805 _cdio=no
2806 cc_check && _cdio=yes
2807 if test "$_cdio" = yes ; then
2808 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2809 else
2810 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2812 echores "$_cdio"
2815 echocheck "linux/cdrom.h"
2816 cat > $TMPC << EOF
2817 #include <sys/types.h>
2818 #include <linux/cdrom.h>
2819 int main(void) { return 0; }
2821 _cdrom=no
2822 cc_check && _cdrom=yes
2823 if test "$_cdrom" = yes ; then
2824 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2825 else
2826 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2828 echores "$_cdrom"
2831 echocheck "dvd.h"
2832 cat > $TMPC << EOF
2833 #include <dvd.h>
2834 int main(void) { return 0; }
2836 _dvd=no
2837 cc_check && _dvd=yes
2838 if test "$_dvd" = yes ; then
2839 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
2840 else
2841 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
2843 echores "$_dvd"
2846 echocheck "BSDI dvd.h"
2847 cat > $TMPC << EOF
2848 #include <dvd.h>
2849 int main(void) { return 0; }
2851 _bsdi_dvd=no
2852 cc_check && _bsdi_dvd=yes
2853 if test "$_bsdi_dvd" = yes ; then
2854 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2855 else
2856 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2858 echores "$_bsdi_dvd"
2861 echocheck "HPUX SCSI header"
2862 cat > $TMPC << EOF
2863 #include <sys/scsi.h>
2864 int main(void) { return 0; }
2866 _hpux_scsi_h=no
2867 cc_check && _hpux_scsi_h=yes
2868 if test "$_hpux_scsi_h" = yes ; then
2869 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
2870 else
2871 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
2873 echores "$_hpux_scsi_h"
2876 echocheck "userspace SCSI headers (Solaris)"
2877 cat > $TMPC << EOF
2878 # include <unistd.h>
2879 # include <stropts.h>
2880 # include <sys/scsi/scsi_types.h>
2881 # include <sys/scsi/impl/uscsi.h>
2882 int main(void) { return 0; }
2884 _sol_scsi_h=no
2885 cc_check && _sol_scsi_h=yes
2886 if test "$_sol_scsi_h" = yes ; then
2887 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
2888 else
2889 _def_sol_scsi_h='#undef SOLARIS_USCSI'
2891 echores "$_sol_scsi_h"
2894 echocheck "termcap"
2895 if test "$_termcap" = auto ; then
2896 cat > $TMPC <<EOF
2897 int main(void) { return 0; }
2899 _termcap=no
2900 cc_check -ltermcap && _termcap=yes && _ld_termcap='-ltermcap'
2901 cc_check -ltinfo && _termcap=yes && _ld_termcap='-ltinfo'
2903 if test "$_termcap" = yes ; then
2904 _def_termcap='#define USE_TERMCAP 1'
2905 echores "yes (using $_ld_termcap)"
2906 else
2907 _def_termcap='#undef USE_TERMCAP'
2908 echores no
2912 echocheck "termios"
2913 if test "$_termios" = auto ; then
2914 cat > $TMPC <<EOF
2915 #include <sys/termios.h>
2916 int main(void) { return 0; }
2918 _termios=auto
2919 cc_check && _termios=yes
2920 _def_termios_h_name='sys/termios.h'
2922 # second test:
2923 if test "$_termios" = auto ; then
2924 cat > $TMPC <<EOF
2925 #include <termios.h>
2926 int main(void) { return 0; }
2928 _termios=no
2929 cc_check && _termios=yes
2930 _def_termios_h_name='termios.h'
2933 if test "$_termios" = yes ; then
2934 _def_termios='#define HAVE_TERMIOS 1'
2935 _def_termios_h='#undef HAVE_TERMIOS_H'
2936 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
2938 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
2939 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
2940 elif test "$_def_termios_h_name" = 'termios.h' ; then
2941 _def_termios_h='#define HAVE_TERMIOS_H 1'
2943 echores "yes (using $_def_termios_h_name)"
2944 else
2945 _def_termios='#undef HAVE_TERMIOS'
2946 _def_termios_h_name=''
2947 echores "no"
2951 echocheck "shm"
2952 if test "$_shm" = auto ; then
2953 cat > $TMPC << EOF
2954 #include <sys/types.h>
2955 #include <sys/shm.h>
2956 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
2958 _shm=no
2959 cc_check && _shm=yes
2961 if test "$_shm" = yes ; then
2962 _def_shm='#define HAVE_SHM 1'
2963 else
2964 _def_shm='#undef HAVE_SHM'
2966 echores "$_shm"
2969 # XXX: FIXME, add runtime checking
2970 echocheck "linux devfs"
2971 echores "$_linux_devfs"
2974 echocheck "scandir()"
2975 cat > $TMPC << EOF
2976 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
2978 _scandir=no
2979 cc_check && _scandir=yes
2980 if test "$_scandir" = yes ; then
2981 _def_scandir='#define HAVE_SCANDIR 1'
2982 else
2983 _def_scandir='#undef HAVE_SCANDIR'
2985 echores "$_scandir"
2988 echocheck "strsep()"
2989 cat > $TMPC << EOF
2990 #include <string.h>
2991 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
2993 _strsep=no
2994 cc_check && _strsep=yes
2995 if test "$_strsep" = yes ; then
2996 _def_strsep='#define HAVE_STRSEP 1'
2997 else
2998 _def_strsep='#undef HAVE_STRSEP'
3000 echores "$_strsep"
3002 echocheck "strlcpy()"
3003 cat > $TMPC << EOF
3004 #include <string.h>
3005 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
3007 _strlcpy=no
3008 cc_check && _strlcpy=yes
3009 if test "$_strlcpy" = yes ; then
3010 _def_strlcpy='#define HAVE_STRLCPY 1'
3011 else
3012 _def_strlcpy='#undef HAVE_STRLCPY'
3014 echores "$_strlcpy"
3016 echocheck "strlcat()"
3017 cat > $TMPC << EOF
3018 #include <string.h>
3019 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
3021 _strlcat=no
3022 cc_check && _strlcat=yes
3023 if test "$_strlcat" = yes ; then
3024 _def_strlcat='#define HAVE_STRLCAT 1'
3025 else
3026 _def_strlcat='#undef HAVE_STRLCAT'
3028 echores "$_strlcat"
3030 echocheck "fseeko()"
3031 cat > $TMPC << EOF
3032 #include <stdio.h>
3033 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
3035 _fseeko=no
3036 cc_check && _fseeko=yes
3037 if test "$_fseeko" = yes ; then
3038 _def_fseeko='#define HAVE_FSEEKO 1'
3039 else
3040 _def_fseeko='#undef HAVE_FSEEKO'
3042 echores "$_fseeko"
3044 echocheck "localtime_r()"
3045 cat > $TMPC << EOF
3046 #include <time.h>
3047 int main( void ) { localtime_r(NULL, NULL); }
3049 _localtime_r=no
3050 cc_check && _localtime_r=yes
3051 if test "$_localtime_r" = yes ; then
3052 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
3053 else
3054 _def_localtime_r='#undef HAVE_LOCALTIME_R'
3056 echores "$_localtime_r"
3058 echocheck "vsscanf()"
3059 cat > $TMPC << EOF
3060 #include <stdarg.h>
3061 int main(void) { vsscanf(0, 0, 0); return 0; }
3063 _vsscanf=no
3064 cc_check && _vsscanf=yes
3065 if test "$_vsscanf" = yes ; then
3066 _def_vsscanf='#define HAVE_VSSCANF 1'
3067 else
3068 _def_vsscanf='#undef HAVE_VSSCANF'
3070 echores "$_vsscanf"
3073 echocheck "swab()"
3074 cat > $TMPC << EOF
3075 #include <unistd.h>
3076 int main(void) { swab(0, 0, 0); return 0; }
3078 _swab=no
3079 cc_check && _swab=yes
3080 if test "$_swab" = yes ; then
3081 _def_swab='#define HAVE_SWAB 1'
3082 else
3083 _def_swab='#undef HAVE_SWAB'
3085 echores "$_swab"
3087 echocheck "posix select()"
3088 cat > $TMPC << EOF
3089 #include <stdio.h>
3090 #include <stdlib.h>
3091 #include <sys/types.h>
3092 #include <string.h>
3093 #include <sys/time.h>
3094 #include <unistd.h>
3095 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3097 _posix_select=no
3098 cc_check && _posix_select=yes
3099 if test "$_posix_select" = no ; then
3100 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
3101 else
3102 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
3104 echores "$_posix_select"
3107 echocheck "gettimeofday()"
3108 cat > $TMPC << EOF
3109 #include <stdio.h>
3110 #include <sys/time.h>
3111 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3113 _gettimeofday=no
3114 cc_check && _gettimeofday=yes
3115 if test "$_gettimeofday" = yes ; then
3116 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3117 else
3118 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3120 echores "$_gettimeofday"
3123 echocheck "glob()"
3124 cat > $TMPC << EOF
3125 #include <stdio.h>
3126 #include <glob.h>
3127 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3129 _glob=no
3130 cc_check && _glob=yes
3131 if test "$_glob" = yes ; then
3132 _def_glob='#define HAVE_GLOB 1'
3133 else
3134 _def_glob='#undef HAVE_GLOB'
3136 echores "$_glob"
3139 echocheck "sys/sysinfo.h"
3140 cat > $TMPC << EOF
3141 #include <sys/sysinfo.h>
3142 int main(void) {
3143 struct sysinfo s_info;
3144 sysinfo(&s_info);
3145 return 0;
3148 _sys_sysinfo=no
3149 cc_check && _sys_sysinfo=yes
3150 if test "$_sys_sysinfo" = yes ; then
3151 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3152 _inc_sysinfo='#include <sys/sysinfo.h>'
3153 else
3154 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3156 echores "$_sys_sysinfo"
3159 echocheck "Mac OS X APIs"
3160 if test "$_macosx" = auto ; then
3161 if darwin && ppc; then
3162 _macosx=yes
3163 else
3164 _macosx=no
3165 _def_macosx='#undef MACOSX'
3166 _noaomodules="macosx $_noaomodules"
3167 _novomodules="quartz $_novomodules"
3170 if test "$_macosx" = yes ; then
3171 cat > $TMPC <<EOF
3172 #include <Carbon/Carbon.h>
3173 #include <QuickTime/QuickTime.h>
3174 #include <CoreAudio/CoreAudio.h>
3175 int main(void) {
3176 EnterMovies();
3177 ExitMovies();
3178 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3181 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3182 _macosx=yes
3183 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio"
3184 _def_macosx='#define MACOSX 1'
3185 _aosrc="$_aosrc ao_macosx.c"
3186 _aomodules="macosx $_aomodules"
3187 _vosrc="$_vosrc vo_quartz.c"
3188 _vomodules="quartz $_vomodules"
3189 else
3190 _macosx=no
3191 _def_macosx='#undef MACOSX'
3192 _noaomodules="macosx $_noaomodules"
3193 _novomodules="quartz $_novomodules"
3196 echores "$_macosx"
3198 echocheck "Mac OS X Finder Support"
3199 if test "$_macosx_finder_support" = auto ; then
3200 _macosx_finder_support=$_macosx
3202 if test "$_macosx_finder_support" = yes; then
3203 _def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
3204 _macosx_finder_support=yes
3205 else
3206 _def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
3207 _macosx_finder_support=no
3209 echores "$_macosx_finder_support"
3211 echocheck "Samba support (libsmbclient)"
3212 if test "$_smbsupport" = yes; then
3213 _ld_smb="-lsmbclient"
3215 if test "$_smbsupport" = auto; then
3216 _smbsupport=no
3217 cat > $TMPC << EOF
3218 #include <libsmbclient.h>
3219 int main(void) { smbc_opendir("smb://"); return 0; }
3221 if cc_check -lsmbclient ; then
3222 _smbsupport=yes
3223 _ld_smb="-lsmbclient"
3224 else
3225 if cc_check -lsmbclient $_ld_dl ; then
3226 _smbsupport=yes
3227 _ld_smb="-lsmbclient $_ld_dl"
3228 else
3229 if cc_check -lsmbclient $_ld_dl -lnsl ; then
3230 _smbsupport=yes
3231 _ld_smb="-lsmbclient $_ld_dl -lnsl"
3232 else
3233 if cc_check -lsmbclient $_ld_dl -lssl -lnsl ; then
3234 _smbsupport=yes
3235 _ld_smb="-lsmbclient $_ld_dl -lssl -lnsl"
3242 if test "$_smbsupport" = yes; then
3243 _def_smbsupport="#define LIBSMBCLIENT"
3244 _inputmodules="smb $_inputmodules"
3245 else
3246 _def_smbsupport="#undef LIBSMBCLIENT"
3247 _noinputmodules="smb $_noinputmodules"
3249 echores "$_smbsupport"
3252 #########
3253 # VIDEO #
3254 #########
3257 echocheck "3dfx"
3258 if test "$_3dfx" = yes ; then
3259 _def_3dfx='#define HAVE_3DFX 1'
3260 _vosrc="$_vosrc vo_3dfx.c"
3261 _vomodules="3dfx $_vomodules"
3262 else
3263 _def_3dfx='#undef HAVE_3DFX'
3264 _novomodules="3dfx $_novomodules"
3266 echores "$_3dfx"
3269 echocheck "tdfxfb"
3270 if test "$_tdfxfb" = yes ; then
3271 _def_tdfxfb='#define HAVE_TDFXFB 1'
3272 _vosrc="$_vosrc vo_tdfxfb.c"
3273 _vomodules="tdfxfb $_vomodules"
3274 else
3275 _def_tdfxfb='#undef HAVE_TDFXFB'
3276 _novomodules="tdfxfb $_novomodules"
3278 echores "$_tdfxfb"
3280 echocheck "tdfxvid"
3281 if test "$_tdfxvid" = yes ; then
3282 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3283 _vosrc="$_vosrc vo_tdfx_vid.c"
3284 _vomodules="tdfx_vid $_vomodules"
3285 else
3286 _def_tdfxvid='#undef HAVE_TDFX_VID'
3287 _novomodules="tdfx_vid $_novomodules"
3289 echores "$_tdfxfb"
3291 echocheck "tga"
3292 if test "$_tga" = yes ; then
3293 _def_tga='#define HAVE_TGA 1'
3294 _vosrc="$_vosrc vo_tga.c"
3295 _vomodules="tga $_vomodules"
3296 else
3297 _def_tga='#undef HAVE_TGA'
3298 _novomodules="tga $_novomodules"
3300 echores "$_tga"
3302 echocheck "DirectFB headers presence"
3303 if test -z "$_inc_directfb" ; then
3304 for I in /usr/include /usr/local/include $_inc_extra; do
3305 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3306 _inc_directfb="-I$I/directfb"
3307 echores "yes (using $_inc_directfb)"
3308 break
3310 if test -d "$I" && test -f "$I/directfb.h" ; then
3311 _inc_directfb="-I$I"
3312 echores "yes (using $_inc_directfb)"
3313 break
3315 done
3316 if test -z "$_inc_directfb" ; then
3317 _directfb=no
3318 echores "not found"
3320 else
3321 echores "yes (using $_inc_directfb)"
3323 if test "$_inc_directfb" = "-I/usr/include" ; then
3324 _inc_directfb=""
3327 echocheck "DirectFB"
3328 if test "$_directfb" = auto ; then
3329 _directfb=no
3330 cat > $TMPC <<EOF
3331 #include <directfb.h>
3332 int main(void) { IDirectFB *foo; return 0; }
3334 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3337 if test "$_directfb" = yes; then
3338 cat > $TMPC <<EOF
3339 #include <directfb.h>
3340 int main(void) {
3341 printf ("%i",(directfb_major_version*100+directfb_minor_version)*100+directfb_micro_version);
3342 return 0;
3345 if cc_check $_inc_directfb -ldirectfb && "$TMPO" >> "$TMPLOG" ; then
3346 _directfb_version=`"$TMPO"`
3347 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3348 if test "$_directfb_version" -ge 913; then
3349 echores "yes ($_directfb_version)"
3350 else
3351 _def_directfb_version='#undef DIRECTFBVERSION'
3352 _directfb=no
3353 echores "no (version >=0.9.13 required)"
3355 else
3356 _directfb=no
3357 echores "no (failed to get version)"
3359 else
3360 echores "$_directfb"
3363 if test "$_directfb" = yes ; then
3364 _def_directfb='#define HAVE_DIRECTFB 1'
3365 if test "$_directfb_version" -ge 913; then
3366 _vosrc="$_vosrc vo_directfb2.c"
3367 _vomodules="directfb $_vomodules"
3368 _ld_directfb='-ldirectfb'
3371 if test "$_directfb_version" -ge 915; then
3372 _vosrc="$_vosrc vo_dfbmga.c"
3373 _vomodules="dfbmga $_vomodules"
3375 else
3376 _def_directfb='#undef HAVE_DIRECTFB'
3377 _novomodules="directfb $_novomodules"
3378 _inc_directfb=""
3382 echocheck "X11 headers presence"
3383 if test -z "$_inc_x11" ; then
3384 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3385 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3386 _inc_x11="-I$I"
3387 echores "yes (using $I)"
3388 break
3390 done
3391 if test -z "$_inc_x11" ; then
3392 _x11=no
3393 echores "not found (check if the dev(el) packages are installed)"
3395 else
3396 echores "yes (using $_inc_x11)"
3398 if test "$_inc_x11" = "-I/usr/include" ; then
3399 _inc_x11=""
3403 echocheck "X11 libs presence"
3404 if test -z "$_ld_x11" ; then
3405 for I in /usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib ; do
3406 if test -d "$I" && ( test -f "$I/libX11.so" || test -f "$I/libX11.a" || test -f "$I/libX11.dll.a" ) ; then
3407 if netbsd; then
3408 _ld_x11="-L$I -Wl,-R$I"
3409 else
3410 _ld_x11="-L$I"
3412 echores "yes (using $I)"
3413 break;
3415 done
3416 if test -z "$_ld_x11" ; then
3417 _x11=no
3418 echores "not found (check if the dev(el) packages are installed)"
3420 else
3421 echores "yes (using $_ld_x11)"
3423 _ld_x11="$_ld_x11 -lXext -lX11 $_ld_sock"
3426 echocheck "X11"
3427 if test "$_x11" != no ; then
3428 cat > $TMPC <<EOF
3429 #include <X11/Xlib.h>
3430 #include <X11/Xutil.h>
3431 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3433 _x11=no
3434 cc_check $_inc_x11 $_ld_x11 && _x11=yes
3436 if test "$_x11" = yes ; then
3437 _def_x11='#define HAVE_X11 1'
3438 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3439 _vomodules="x11 xover $_vomodules"
3440 else
3441 _def_x11='#undef HAVE_X11'
3442 _inc_x11=''
3443 _ld_x11=''
3444 _novomodules="x11 $_novomodules"
3446 echores "$_x11"
3449 echocheck "DPMS"
3450 _xdpms3=no
3451 if test "$_x11" = yes ; then
3452 cat > $TMPC <<EOF
3453 #include <X11/Xmd.h>
3454 #include <X11/Xlib.h>
3455 #include <X11/Xutil.h>
3456 #include <X11/Xatom.h>
3457 #include <X11/extensions/dpms.h>
3458 int main(void) {
3459 (void) DPMSQueryExtension(0, 0, 0);
3462 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3464 _xdpms4=no
3465 if test "$_x11" = yes ; then
3466 cat > $TMPC <<EOF
3467 #include <X11/Xlib.h>
3468 #include <X11/extensions/dpms.h>
3469 int main(void) {
3470 (void) DPMSQueryExtension(0, 0, 0);
3473 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3475 if test "$_xdpms4" = yes ; then
3476 _def_xdpms='#define HAVE_XDPMS 1'
3477 echores "yes (using Xdpms 4)"
3478 elif test "$_xdpms3" = yes ; then
3479 _def_xdpms='#define HAVE_XDPMS 1'
3480 _ld_x11="-lXdpms $_ld_x11"
3481 echores "yes (using Xdpms 3)"
3482 else
3483 _def_xdpms='#undef HAVE_XDPMS'
3484 echores "no"
3488 echocheck "Xv"
3489 if test "$_x11" = yes && test "$_xv" != no ; then
3490 cat > $TMPC <<EOF
3491 #include <X11/Xlib.h>
3492 #include <X11/extensions/Xvlib.h>
3493 int main(void) {
3494 (void) XvGetPortAttribute(0, 0, 0, 0);
3495 (void) XvQueryPortAttributes(0, 0, 0);
3496 return 0; }
3498 _xv=no
3499 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3500 else
3501 _xv=no
3503 if test "$_xv" = yes ; then
3504 _def_xv='#define HAVE_XV 1'
3505 _ld_xv='-lXv'
3506 _vosrc="$_vosrc vo_xv.c"
3507 _vomodules="xv $_vomodules"
3508 else
3509 _def_xv='#undef HAVE_XV'
3510 _novomodules="xv $_novomodules"
3512 echores "$_xv"
3515 echocheck "XvMC"
3516 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3517 _xvmc=no
3518 cat > $TMPC <<EOF
3519 #include <X11/Xlib.h>
3520 #include <X11/extensions/Xvlib.h>
3521 #include <X11/extensions/XvMClib.h>
3522 int main(void) {
3523 (void) XvMCQueryExtension(0,0,0);
3524 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3525 return 0; }
3527 cc_check $_inc_x11 -lXvMC -l$_xvmclib $_ld_xv $_ld_x11 && _xvmc=yes
3529 if test "$_xvmc" = yes ; then
3530 _def_xvmc='#define HAVE_XVMC 1'
3531 _ld_xvmc="-lXvMC -l$_xvmclib"
3532 _vosrc="$_vosrc vo_xvmc.c"
3533 _vomodules="xvmc $_vomodules"
3534 else
3535 _def_xvmc='#undef HAVE_XVMC'
3536 _novomodules="xvmc $_novomodules"
3538 echores "$_xvmc"
3541 echocheck "Xinerama"
3542 if test "$_x11" = yes && test "$_xinerama" != no ; then
3543 cat > $TMPC <<EOF
3544 #include <X11/Xlib.h>
3545 #include <X11/extensions/Xinerama.h>
3546 int main(void) { (void) XineramaIsActive(0); return 0; }
3548 _xinerama=no
3549 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3550 else
3551 _xinerama=no
3553 if test "$_xinerama" = yes ; then
3554 _def_xinerama='#define HAVE_XINERAMA 1'
3555 _ld_xinerama='-lXinerama'
3556 else
3557 _def_xinerama='#undef HAVE_XINERAMA'
3559 echores "$_xinerama"
3562 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3563 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3564 # named 'X extensions' or something similar.
3565 # This check may be useful for future mplayer versions (to change resolution)
3566 # If you run into problems, remove '-lXxf86vm'.
3567 echocheck "Xxf86vm"
3568 if test "$_x11" = yes && test "$_vm" = auto ; then
3569 cat > $TMPC <<EOF
3570 #include <X11/Xlib.h>
3571 #include <X11/extensions/xf86vmode.h>
3572 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3574 _vm=no
3575 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3577 if test "$_vm" = yes ; then
3578 _def_vm='#define HAVE_XF86VM 1'
3579 _ld_vm='-lXxf86vm'
3580 else
3581 _def_vm='#undef HAVE_XF86VM'
3583 echores "$_vm"
3585 # Check for the presence of special keycodes, like audio control buttons
3586 # that XFree86 might have. Used to be bundled with the xf86vm check, but
3587 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
3588 # have these new keycodes.
3589 echocheck "XF86keysym"
3590 if test "$_xf86keysym" = auto; then
3591 _xf86keysym=no
3592 if test "$_x11" = yes ; then
3593 cat > $TMPC <<EOF
3594 #include <X11/Xlib.h>
3595 #include <X11/XF86keysym.h>
3596 int main(void) { return XF86XK_AudioPause; }
3598 cc_check $_inc_x11 $_ld_x11 && _xf86keysym=yes
3601 if test "$_xf86keysym" = yes ; then
3602 _def_xf86keysym='#define HAVE_XF86XK 1'
3603 else
3604 _def_xf86keysym='#undef HAVE_XF86XK'
3606 echores "$_xf86keysym"
3608 echocheck "DGA"
3609 if test "$_x11" = no ; then
3610 _dga=no
3612 # Version 2 is preferred to version 1 if available
3613 if test "$_dga" = auto ; then
3614 cat > $TMPC << EOF
3615 #include <X11/Xlib.h>
3616 #include <X11/extensions/xf86dga.h>
3617 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3619 _dga=no
3620 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3622 cat > $TMPC << EOF
3623 #include <X11/Xlib.h>
3624 #include <X11/extensions/xf86dga.h>
3625 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3627 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3630 _def_dga='#undef HAVE_DGA'
3631 _def_dga2='#undef HAVE_DGA2'
3632 if test "$_dga" = 1 ; then
3633 _def_dga='#define HAVE_DGA 1'
3634 _ld_dga='-lXxf86dga'
3635 _vosrc="$_vosrc vo_dga.c"
3636 _vomodules="dga $_vomodules"
3637 echores "yes (using DGA 1.0)"
3638 elif test "$_dga" = 2 ; then
3639 _def_dga='#define HAVE_DGA 1'
3640 _def_dga2='#define HAVE_DGA2 1'
3641 _ld_dga='-lXxf86dga'
3642 _vosrc="$_vosrc vo_dga.c"
3643 _vomodules="dga $_vomodules"
3644 echores "yes (using DGA 2.0)"
3645 elif test "$_dga" = no ; then
3646 echores "no"
3647 _novomodules="dga $_novomodules"
3648 else
3649 die "DGA version must be 1 or 2"
3653 echocheck "OpenGL"
3654 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3655 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3656 cat > $TMPC << EOF
3657 #include <GL/gl.h>
3658 int main(void) { return 0; }
3660 _gl=no
3661 if cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm ; then
3662 _gl=yes
3663 _ld_gl="-lGL"
3664 elif cc_check $_inc_x11 $_ld_x11 -lGL $_ld_lm $_ld_pthread ; then
3665 _gl=yes
3666 _ld_gl="-lGL $_ld_pthread"
3667 elif cc_check -lopengl32 ; then
3668 _gl=yes
3669 _gl_win32=yes
3670 _ld_gl="-lopengl32 -lgdi32"
3672 else
3673 _gl=no
3675 if test "$_gl" = yes ; then
3676 _def_gl='#define HAVE_GL 1'
3677 if test "$_gl_win32" = yes ; then
3678 _def_gl_win32='#define GL_WIN32 1'
3679 _vosrc="$_vosrc vo_gl2.c w32_common.c gl_common.c"
3680 else
3681 _vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
3683 _vomodules="opengl $_vomodules"
3684 else
3685 _def_gl='#undef HAVE_GL'
3686 _def_gl_win32='#undef GL_WIN32'
3687 _novomodules="opengl $_novomodules"
3689 echores "$_gl"
3692 echocheck "/dev/mga_vid"
3693 if test "$_mga" = auto ; then
3694 _mga=no
3695 test -c /dev/mga_vid && _mga=yes
3697 if test "$_mga" = yes ; then
3698 _def_mga='#define HAVE_MGA 1'
3699 _vosrc="$_vosrc vo_mga.c"
3700 _vomodules="mga $_vomodules"
3701 else
3702 _def_mga='#undef HAVE_MGA'
3703 _novomodules="mga $_novomodules"
3705 echores "$_mga"
3708 # echocheck "syncfb"
3709 # _syncfb=no
3710 # test "$_mga" = yes && _syncfb=yes
3711 # if test "$_syncfb" = yes ; then
3712 # _def_syncfb='#define HAVE_SYNCFB 1'
3713 # _vosrc="$_vosrc vo_syncfb.c"
3714 # else
3715 # _def_syncfb='#undef HAVE_SYNCFB'
3716 # fi
3717 # echores "$_syncfb"
3720 echocheck "xmga"
3721 if test "$_xmga" = auto ; then
3722 _xmga=no
3723 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
3725 if test "$_xmga" = yes ; then
3726 _def_xmga='#define HAVE_XMGA 1'
3727 _vosrc="$_vosrc vo_xmga.c"
3728 _vomodules="xmga $_vomodules"
3729 else
3730 _def_xmga='#undef HAVE_XMGA'
3731 _novomodules="xmga $_novomodules"
3733 echores "$_xmga"
3736 echocheck "GGI"
3737 if test "$_ggi" = auto ; then
3738 cat > $TMPC << EOF
3739 #include <ggi/ggi.h>
3740 int main(void) { return 0; }
3742 _ggi=no
3743 cc_check -lggi && _ggi=yes
3745 if test "$_ggi" = yes ; then
3746 _def_ggi='#define HAVE_GGI 1'
3747 _ld_ggi='-lggi'
3748 _vosrc="$_vosrc vo_ggi.c"
3749 _vomodules="ggi $_vomodules"
3750 else
3751 _def_ggi='#undef HAVE_GGI'
3752 _novomodules="ggi $_novomodules"
3754 echores "$_ggi"
3757 echocheck "AA"
3758 if test "$_aa" = auto ; then
3759 cat > $TMPC << EOF
3760 #include <aalib.h>
3761 int main(void) { (void) aa_init(0, 0, 0); return 0; }
3763 _aa=no
3764 if cc_check -laa ; then
3765 _aa=yes
3766 _ld_aa="-laa"
3767 elif cc_check $_ld_x11 -laa ; then
3768 _aa=yes
3769 _ld_aa="$_ld_x11 -laa"
3772 if test "$_aa" = yes ; then
3773 _def_aa='#define HAVE_AA 1'
3774 if cygwin ; then
3775 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
3777 _vosrc="$_vosrc vo_aa.c"
3778 _vomodules="aa $_vomodules"
3779 else
3780 _def_aa='#undef HAVE_AA'
3781 _novomodules="aa $_novomodules"
3783 echores "$_aa"
3786 echocheck "CACA"
3787 if test "$_caca" = auto ; then
3788 _caca=no
3789 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3790 cat > $TMPC << EOF
3791 #include <caca.h>
3792 int main(void) { (void) caca_init(); return 0; }
3794 cc_check `caca-config --libs` && _caca=yes
3797 if test "$_caca" = yes ; then
3798 _def_caca='#define HAVE_CACA 1'
3799 _inc_caca=`caca-config --cflags`
3800 _ld_caca=`caca-config --libs`
3801 _vosrc="$_vosrc vo_caca.c"
3802 _vomodules="caca $_vomodules"
3803 else
3804 _def_caca='#undef HAVE_CACA'
3805 _novomodules="caca $_novomodules"
3807 echores "$_caca"
3810 echocheck "SVGAlib"
3811 if test "$_svga" = auto ; then
3812 cat > $TMPC << EOF
3813 #include <vga.h>
3814 #include <vgagl.h>
3815 int main(void) { return 0; }
3817 _svga=no
3818 cc_check -lvgagl -lvga $_ld_lm && _svga=yes
3820 if test "$_svga" = yes ; then
3821 _def_svga='#define HAVE_SVGALIB 1'
3822 _ld_svga="-lvgagl -lvga $_ld_lm"
3823 _vosrc="$_vosrc vo_svga.c"
3824 _vomodules="svga $_vomodules"
3825 else
3826 _def_svga='#undef HAVE_SVGALIB'
3827 _novomodules="svga $_novomodules"
3829 echores "$_svga"
3832 echocheck "FBDev"
3833 if test "$_fbdev" = auto ; then
3834 _fbdev=no
3835 linux && test -c /dev/fb0 && _fbdev=yes
3837 if test "$_fbdev" = yes ; then
3838 _def_fbdev='#define HAVE_FBDEV 1'
3839 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
3840 _vomodules="fbdev $_vomodules"
3841 else
3842 _def_fbdev='#undef HAVE_FBDEV'
3843 _novomodules="fbdev $_novomodules"
3845 echores "$_fbdev"
3849 echocheck "DVB"
3850 if test "$_dvb" != no ; then
3851 _dvb=no
3852 cat >$TMPC << EOF
3853 #include <sys/poll.h>
3854 #include <sys/ioctl.h>
3855 #include <stdio.h>
3856 #include <time.h>
3857 #include <unistd.h>
3859 #include <ost/dmx.h>
3860 #include <ost/frontend.h>
3861 #include <ost/sec.h>
3862 #include <ost/video.h>
3863 #include <ost/audio.h>
3864 int main(void) {return 0;}
3866 if cc_check ; then
3867 _dvb=yes
3868 echores "yes"
3869 else
3870 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
3871 if cc_check "$I" ; then
3872 _dvb=yes
3873 _inc_dvb="$I"
3874 echores "yes (using $_inc_dvb)"
3875 break
3877 done
3878 test "$_dvb" = no && echores "no (specify path to DVB/ost/include with --with-dvbincdir=DIR)"
3880 else
3881 echores "no"
3883 if test "$_dvb" = yes ; then
3884 _def_dvb='#define HAVE_DVB 1'
3885 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
3886 _aomodules="mpegpes(dvb) $_aomodules"
3887 _vomodules="mpegpes(dvb) $_vomodules"
3889 if test "$_dvbhead" != no ; then
3890 echocheck "DVB HEAD"
3891 if test "$_dvbhead" != no ; then
3892 _dvbhead=no
3894 cat >$TMPC << EOF
3895 #include <sys/poll.h>
3896 #include <sys/ioctl.h>
3897 #include <stdio.h>
3898 #include <time.h>
3899 #include <unistd.h>
3901 #include <linux/dvb/dmx.h>
3902 #include <linux/dvb/frontend.h>
3903 #include <linux/dvb/video.h>
3904 #include <linux/dvb/audio.h>
3905 int main(void) {return 0;}
3907 if cc_check ; then
3908 _dvbhead=yes
3909 echores "yes"
3910 else
3911 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
3912 if cc_check "$I" ; then
3913 _dvbhead=yes
3914 _inc_dvb="$I"
3915 echores "yes (using $_inc_dvb)"
3916 break
3918 done
3919 test "$_dvbhead" = no && echores "no (specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR)"
3921 else
3922 echores "no"
3924 if test "$_dvbhead" = yes ; then
3925 _def_dvb='#define HAVE_DVB_HEAD 1'
3926 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
3927 _aomodules="mpegpes(dvb) $_aomodules"
3928 _vomodules="mpegpes(dvb) $_vomodules"
3931 if test "$_dvbhead" = no && test "$_dvb" = no ; then
3932 _def_dvb='#undef HAVE_DVB'
3933 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
3934 _aomodules="mpegpes(file) $_aomodules"
3935 _vomodules="mpegpes(file) $_vomodules"
3938 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
3939 _dvbin=yes
3940 _inputmodules="dvb $_inputmodules"
3941 else
3942 _dvbin=no
3943 _noinputmodules="dvb $_noinputmodules"
3946 echocheck "PNG support"
3947 if test "$_png" = auto ; then
3948 _png=no
3949 if irix ; then
3950 # Don't check for -lpng on irix since it has its own libpng
3951 # incompatible with the GNU libpng
3952 echores "disabled on irix (not GNU libpng)"
3953 else
3954 cat > $TMPC << EOF
3955 #include <png.h>
3956 #include <string.h>
3957 int main(void) {
3958 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3959 printf("libpng: %s\n", png_libpng_ver);
3960 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
3963 if cc_check -lpng -lz $_ld_lm ; then
3964 if "$TMPO" >> "$TMPLOG" ; then
3965 _png=yes
3966 echores yes
3967 else
3968 echores "no (mismatch of library and header versions)"
3970 else
3971 echores no
3974 else
3975 echores "$_png"
3977 if test "$_png" = yes ; then
3978 _def_png='#define HAVE_PNG 1'
3979 _ld_png='-lpng -lz'
3980 _vosrc="$_vosrc vo_png.c"
3981 _vomodules="png $_vomodules"
3982 _mkf_png="yes"
3983 else
3984 _def_png='#undef HAVE_PNG'
3985 _novomodules="png $_novomodules"
3986 _mkf_png="no"
3989 echocheck "JPEG support"
3990 if test "$_jpg" = auto ; then
3991 _jpg=no
3992 cat > $TMPC << EOF
3993 #include <stdio.h>
3994 #include <stdlib.h>
3995 #include <setjmp.h>
3996 #include <string.h>
3997 #include <jpeglib.h>
3998 int main(void) {
3999 return 0;
4002 if cc_check -ljpeg $_ld_lm ; then
4003 if "$TMPO" >> "$TMPLOG" ; then
4004 _jpg=yes
4008 echores "$_jpg"
4010 if test "$_jpg" = yes ; then
4011 _def_jpg='#define HAVE_JPEG 1'
4012 _vosrc="$_vosrc vo_jpeg.c"
4013 _vomodules="jpeg $_vomodules"
4014 _ld_jpg="-ljpeg"
4015 _mkf_jpg="yes"
4016 else
4017 _def_jpg='#undef HAVE_JPEG'
4018 _novomodules="jpeg $_novomodules"
4019 _mkf_jpg="no"
4024 echocheck "PNM support"
4025 if test "$_pnm" = yes; then
4026 _def_pnm="#define HAVE_PNM"
4027 _vosrc="$_vosrc vo_pnm.c"
4028 _vomodules="pnm $_vomodules"
4029 else
4030 _def_pnm="#undef HAVE_PNM"
4031 _novomodules="pnm $_novomodules"
4033 echores "$_pnm"
4037 echocheck "md5sum support"
4038 if test "$_md5sum" = yes; then
4039 _def_md5sum="#define HAVE_MD5SUM"
4040 _vosrc="$_vosrc vo_md5sum.c md5sum.c"
4041 _vomodules="md5sum $_vomodules"
4042 else
4043 _def_md5sum="#undef HAVE_MD5SUM"
4044 _novomodules="md5sum $_novomodules"
4046 echores "$_md5sum"
4050 echocheck "GIF support"
4051 # This is to appease people who want to force gif support.
4052 # If it is forced to yes, then we still do checks to determine
4053 # which gif library to use.
4054 if test "$_gif" = yes ; then
4055 _force_gif=yes
4056 _gif=auto
4059 if test "$_gif" = auto ; then
4060 _gif=no
4061 cat > $TMPC << EOF
4062 #include <gif_lib.h>
4063 int main(void) {
4064 return 0;
4067 if cc_check -lungif && "$TMPO" >> "$TMPLOG" ; then
4068 _gif=yes
4069 _ld_gif="-lungif"
4070 elif cc_check -lungif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
4071 _gif=yes
4072 _ld_gif="-lungif $_ld_x11"
4073 elif cc_check -lgif && "$TMPO" >> "$TMPLOG" ; then
4074 _gif=yes
4075 _ld_gif="-lgif"
4076 elif cc_check -lgif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
4077 _gif=yes
4078 _ld_gif="-lgif $_ld_x11"
4082 # If no library was found, and the user wants support forced,
4083 # then we force it on with libgif, as this is the safest
4084 # assumption IMHO. (libungif & libregif both create symbolic
4085 # links to libgif. We also assume that no x11 support is needed,
4086 # because if you are forcing this, then you _should_ know what
4087 # you are doing. [ Besides, package maintainers should never
4088 # have compiled x11 deps into libungif in the first place. ] )
4089 # </rant>
4090 # --Joey
4091 if test "$_force_gif" = yes && test "$_gif" = no ; then
4092 _gif=yes
4093 _ld_gif="-lgif"
4096 if test "$_gif" = yes ; then
4097 _def_gif='#define HAVE_GIF 1'
4098 _vosrc="$_vosrc vo_gif89a.c"
4099 _codecmodules="gif $_codecmodules"
4100 _vomodules="gif89a $_vomodules"
4101 _mkf_gif="yes"
4102 _gif="yes (old version, some encoding functions disabled)"
4103 _def_gif_4='#undef HAVE_GIF_4'
4105 cat > $TMPC << EOF
4106 #include <signal.h>
4107 #include <gif_lib.h>
4108 void catch() { exit(1); }
4109 int main(void) {
4110 signal(SIGSEGV, catch); // catch segfault
4111 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4112 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4113 return 0;
4116 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
4117 _def_gif_4='#define HAVE_GIF_4 1'
4118 _gif="yes"
4120 else
4121 _def_gif='#undef HAVE_GIF'
4122 _def_gif_4='#undef HAVE_GIF_4'
4123 _novomodules="gif89a $_novomodules"
4124 _nocodecmodules="gif $_nocodecmodules"
4125 _mkf_gif="no"
4127 echores "$_gif"
4130 case "$_gif" in yes*)
4131 echocheck "broken giflib workaround"
4132 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
4134 cat > $TMPC << EOF
4135 #include <gif_lib.h>
4136 int main(void) {
4137 GifFileType gif;
4138 printf("UserData is at address %p\n", gif.UserData);
4139 return 0;
4142 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
4143 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
4144 echores "disabled"
4145 else
4146 echores "enabled"
4149 esac
4152 echocheck "VESA support"
4153 if test "$_vesa" = auto ; then
4154 if x86 && linux ; then
4155 _vesa=no
4156 cat > $TMPC << EOF
4157 #include <sys/io.h>
4158 int main(void) { return 0; }
4160 cc_check && _vesa=yes
4163 if test "$_vesa" = yes ; then
4164 _def_vesa='#define HAVE_VESA 1'
4165 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c"
4166 _vomodules="vesa $_vomodules"
4167 echores "yes"
4168 else
4169 _def_vesa='#undef HAVE_VESA'
4170 echores "no (not supported on this OS/architecture)"
4171 _novomodules="vesa $_novomodules"
4174 #################
4175 # VIDEO + AUDIO #
4176 #################
4179 echocheck "SDL"
4180 if test -z "$_sdlconfig" ; then
4181 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4182 _sdlconfig="sdl-config"
4183 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4184 _sdlconfig="sdl11-config"
4185 else
4186 _sdlconfig=false
4189 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4190 cat > $TMPC << EOF
4191 #include <SDL.h>
4192 int main(int argc, char *argv[]) { return 0; }
4194 _sdl=no
4195 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4196 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
4197 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
4198 if test "$_sdlversion" -gt 116 ; then
4199 if test "$_sdlversion" -lt 121 ; then
4200 _def_sdlbuggy='#define BUGGY_SDL'
4201 else
4202 _def_sdlbuggy='#undef BUGGY_SDL'
4204 _sdl=yes
4205 else
4206 _sdl=outdated
4211 if test "$_sdl" = yes ; then
4212 _def_sdl='#define HAVE_SDL 1'
4213 if cygwin ; then
4214 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
4215 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
4216 elif mingw32 ; then
4217 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
4218 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
4219 else
4220 _ld_sdl=`$_sdlconfig --libs`
4221 _inc_sdl=`$_sdlconfig --cflags`
4223 _vosrc="$_vosrc vo_sdl.c"
4224 _vomodules="sdl $_vomodules"
4225 _aosrc="$_aosrc ao_sdl.c"
4226 _aomodules="sdl $_aomodules"
4227 echores "yes (using $_sdlconfig)"
4228 else
4229 _def_sdl='#undef HAVE_SDL'
4230 _novomodules="sdl $_novomodules"
4231 _noaomodules="sdl $_noaomodules"
4232 echores "no"
4235 echocheck "Windows waveout"
4236 if test "$_win32waveout" = auto ; then
4237 cat > $TMPC << EOF
4238 #include <windows.h>
4239 #include <mmsystem.h>
4240 int main(void) { return 0; }
4242 _win32waveout=no
4243 cc_check -lwinmm && _win32waveout=yes
4245 if test "$_win32waveout" = yes ; then
4246 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4247 _ld_win32libs="-lwinmm $_ld_win32libs"
4248 _aosrc="$_aosrc ao_win32.c"
4249 _aomodules="win32 $_aomodules"
4250 else
4251 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4252 _noaomodules="win32 $_noaomodules"
4254 echores "$_win32waveout"
4256 echocheck "Directx"
4257 if test "$_directx" = auto ; then
4258 cat > $TMPC << EOF
4259 #include <windows.h>
4260 #include <ddraw.h>
4261 #include <dsound.h>
4262 int main(void) { return 0; }
4264 _directx=no
4265 cc_check -lgdi32 && _directx=yes
4267 if test "$_directx" = yes ; then
4268 _def_directx='#define HAVE_DIRECTX 1'
4269 _ld_win32libs="-lgdi32 $_ld_win32libs"
4270 _vosrc="$_vosrc vo_directx.c"
4271 _vomodules="directx $_vomodules"
4272 _aosrc="$_aosrc ao_dsound.c"
4273 _aomodules="dsound $_aomodules"
4274 else
4275 _def_directx='#undef HAVE_DIRECTX'
4276 _novomodules="directx $_novomodules"
4277 _noaomodules="dsound $_noaomodules"
4279 echores "$_directx"
4281 echocheck "NAS"
4282 if test "$_nas" = auto || test "$_nas" = yes ; then
4283 cat > $TMPC << EOF
4284 #include <audio/audiolib.h>
4285 int main(void) { return 0; }
4287 _nas=no
4288 cc_check -laudio $_inc_x11 -lXt $_ld_x11 $_ld_lm && _nas=yes
4290 if test "$_nas" = yes ; then
4291 _def_nas='#define HAVE_NAS 1'
4292 _ld_nas="-laudio -lXt $_ld_x11"
4293 _aosrc="$_aosrc ao_nas.c"
4294 _aomodules="nas $_aomodules"
4295 else
4296 _noaomodules="nas $_noaomodules"
4297 _def_nas='#undef HAVE_NAS'
4299 echores "$_nas"
4301 echocheck "DXR2"
4302 if test "$_dxr2" = auto; then
4303 _dxr2=no
4304 for _inc_dxr2 in "$_inc_dxr2" \
4305 "-I/usr/local/include/dxr2" \
4306 "-I/usr/include/dxr2"; do
4307 cat > $TMPC << EOF
4308 #include <dxr2ioctl.h>
4309 int main(void) { return 0; }
4311 cc_check $_inc_dxr2 && _dxr2=yes && break
4312 done
4314 if test "$_dxr2" = yes; then
4315 _def_dxr2='#define HAVE_DXR2 1'
4316 _vosrc="$_vosrc vo_dxr2.c"
4317 _aosrc="$_aosrc ao_dxr2.c"
4318 _aomodules="dxr2 $_aomodules"
4319 _vomodules="dxr2 $_vomodules"
4320 echores "yes (using $_inc_dxr2)"
4321 else
4322 _def_dxr2='#undef HAVE_DXR2'
4323 _noaomodules="dxr2 $_noaomodules"
4324 _novomodules="dxr2 $_novomodules"
4325 _inc_dxr2=""
4326 echores "no"
4329 echocheck "DXR3/H+"
4330 if test "$_dxr3" = auto ; then
4331 cat > $TMPC << EOF
4332 #include <linux/em8300.h>
4333 int main(void) { return 0; }
4335 _dxr3=no
4336 cc_check && _dxr3=yes
4338 if test "$_dxr3" = yes ; then
4339 _def_dxr3='#define HAVE_DXR3 1'
4340 _vosrc="$_vosrc vo_dxr3.c"
4341 _vomodules="dxr3 $_vomodules"
4342 else
4343 _def_dxr3='#undef HAVE_DXR3'
4344 _novomodules="dxr3 $_novomodules"
4345 if test "$_mp1e" = auto ; then
4346 # we don't need mp1e
4347 _mp1e=no
4350 echores "$_dxr3"
4352 echocheck "libmp1e"
4353 if test "$_mmx" = no ; then
4354 # mp1e REQUIRES mmx!
4355 _mp1e=no
4357 if test "$_mp1e" != no ; then
4358 _mp1e=yes
4359 _def_mp1e='#define USE_MP1E'
4360 _ld_mp1e='libmp1e/libmp1e.a'
4361 _dep_mp1e='libmp1e/libmp1e.a'
4362 else
4363 _mp1e=no
4364 _def_mp1e='#undef USE_MP1E'
4365 _ld_mp1e=""
4366 _dep_mp1e=''
4368 echores "$_mp1e"
4371 echocheck "libfame"
4372 if test "$_fame" = auto ; then
4373 _fame=no
4374 test "$_dxr2" = yes && _fame=auto
4375 test "$_dxr3" = yes && _fame=auto
4376 test "$_dvb" = yes && _fame=auto
4378 if test "$_fame" = auto ; then
4379 _fame=no
4380 if test -d libfame && test -f libfame/fame.h ; then
4381 # disable fame on cygwin as no sense to port - atmos
4382 cygwin || _fame=yes
4383 echores $_fame
4384 else
4385 echores "no (no fame dir)"
4387 else
4388 echores "$_fame"
4391 _def_fame='#undef USE_LIBFAME'
4392 if test "$_fame" = yes ; then
4393 _def_fame='#define USE_LIBFAME 1'
4394 _ld_fame='libfame/libfame.a'
4398 #########
4399 # AUDIO #
4400 #########
4403 echocheck "OSS Audio"
4404 if test "$_ossaudio" = auto ; then
4405 cat > $TMPC << EOF
4406 #include <sys/ioctl.h>
4407 $_inc_soundcard
4408 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4410 _ossaudio=no
4411 cc_check && _ossaudio=yes
4413 if test "$_ossaudio" = yes ; then
4414 _def_ossaudio='#define USE_OSS_AUDIO 1'
4415 _aosrc="$_aosrc ao_oss.c"
4416 _aomodules="oss $_aomodules"
4417 if test "$_linux_devfs" = yes; then
4418 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4419 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4420 else
4421 cat > $TMPC << EOF
4422 #include <sys/ioctl.h>
4423 $_inc_soundcard
4424 #ifdef OPEN_SOUND_SYSTEM
4425 int main(void) { return 0; }
4426 #else
4427 #error Not the real thing
4428 #endif
4430 _real_ossaudio=no
4431 cc_check && _real_ossaudio=yes
4432 if test "$_real_ossaudio" = yes; then
4433 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4434 elif netbsd || openbsd ; then
4435 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4436 _ld_arch="$_ld_arch -lossaudio"
4437 else
4438 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4440 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4442 else
4443 _def_ossaudio='#undef USE_OSS_AUDIO'
4444 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4445 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4446 _noaomodules="oss $_noaomodules"
4448 echores "$_ossaudio"
4451 echocheck "aRts"
4452 if test "$_arts" = auto ; then
4453 _arts=no
4454 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4456 cat > $TMPC << EOF
4457 #include <artsc.h>
4458 int main(void) { return 0; }
4460 cc_check `artsc-config --libs` `artsc-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _arts=yes
4465 if test "$_arts" = yes ; then
4466 _def_arts='#define USE_ARTS 1'
4467 _aosrc="$_aosrc ao_arts.c"
4468 _aomodules="arts $_aomodules"
4469 _ld_arts=`artsc-config --libs`
4470 _inc_arts=`artsc-config --cflags`
4471 else
4472 _noaomodules="arts $_noaomodules"
4474 echores "$_arts"
4477 echocheck "EsounD"
4478 if test "$_esd" = auto ; then
4479 _esd=no
4480 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4482 cat > $TMPC << EOF
4483 #include <esd.h>
4484 int main(void) { return 0; }
4486 cc_check `esd-config --libs` `esd-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
4490 echores "$_esd"
4492 if test "$_esd" = yes ; then
4493 _def_esd='#define USE_ESD 1'
4494 _aosrc="$_aosrc ao_esd.c"
4495 _aomodules="esd $_aomodules"
4496 _ld_esd=`esd-config --libs`
4497 _inc_esd=`esd-config --cflags`
4499 echocheck "esd_get_latency()"
4500 cat > $TMPC << EOF
4501 #include <esd.h>
4502 int main(void) { return esd_get_latency(0); }
4504 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4505 echores "$_esd_latency"
4506 else
4507 _def_esd='#undef USE_ESD'
4508 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4509 _noaomodules="esd $_noaomodules"
4512 echocheck "Polyp"
4513 if test "$_polyp" = auto ; then
4514 _polyp=no
4515 if ( pkg-config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-mainloop >= 0.6' ) >> "$TMPLOG" 2>&1 ; then
4517 cat > $TMPC << EOF
4518 #include <polyp/polyplib.h>
4519 #include <polyp/mainloop.h>
4520 #include <polyp/polyplib-error.h>
4521 int main(void) { return 0; }
4523 cc_check `pkg-config --libs --cflags polyplib polyplib-error polyplib-mainloop` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _polyp=yes
4527 echores "$_polyp"
4529 if test "$_polyp" = yes ; then
4530 _def_polyp='#define USE_POLYP 1'
4531 _aosrc="$_aosrc ao_polyp.c"
4532 _aomodules="polyp $_aomodules"
4533 _ld_polyp=`pkg-config --libs polyplib polyplib-error polyplib-mainloop`
4534 _inc_polyp=`pkg-config --cflags polyplib polyplib-error polyplib-mainloop`
4535 else
4536 _def_polyp='#undef USE_POLYP'
4537 _noaomodules="polyp $_noaomodules"
4541 echocheck "JACK"
4542 if test "$_jack" = auto ; then
4543 _jack=no
4544 if ( ( pkg-config --modversion jack ) > /dev/null 2>&1 ) &&
4545 ( jackd --version | grep version | awk '{ print $3 }' ) >> "$TMPLOG" 2>&1 ; then
4547 cat > $TMPC << EOF
4548 #include <jack/jack.h>
4549 int main(void) { JACK_Init(); return 0; }
4551 # This test only checks the minor version number.
4552 if ( ( test `bio2jack-config --version | cut -d '.' -f 2` -ge 3 ) ) >/dev/null 2>&1 ; then
4553 if test -z "$_bio2jackdir" ; then
4554 cc_check -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4555 else
4556 cc_check -L "$_bio2jackdir" -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4562 if test "$_jack" = yes ; then
4563 _def_jack='#define USE_JACK 1'
4564 _aosrc="$_aosrc ao_jack.c"
4565 _aomodules="jack $_aomodules"
4566 if test -z "$_bio2jackdir" ; then
4567 _ld_jack="-lbio2jack `pkg-config --libs jack`"
4568 else
4569 _ld_jack="-L \"$_bio2jackdir\" -lbio2jack `pkg-config --libs jack`"
4571 _inc_jack=`pkg-config --cflags jack`
4572 else
4573 _noaomodules="jack $_noaomodules"
4575 echores "$_jack"
4578 echocheck "ALSA audio"
4579 if test "$_alsa" != no ; then
4580 _alsa=no
4581 cat > $TMPC << EOF
4582 #include <sys/asoundlib.h>
4583 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); }
4585 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.5.x'
4587 cat > $TMPC << EOF
4588 #include <sys/asoundlib.h>
4589 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4591 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-sys'
4592 cat > $TMPC << EOF
4593 #include <alsa/asoundlib.h>
4594 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4596 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-alsa'
4598 cat > $TMPC << EOF
4599 #include <sys/asoundlib.h>
4600 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4602 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-sys'
4603 cat > $TMPC << EOF
4604 #include <alsa/asoundlib.h>
4605 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4607 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-alsa'
4609 _def_alsa5='#undef HAVE_ALSA5'
4610 _def_alsa9='#undef HAVE_ALSA9'
4611 _def_alsa1x='#undef HAVE_ALSA1X'
4612 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4613 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4614 if test "$_alsaver" ; then
4615 if test "$_alsaver" = '0.5.x' ; then
4616 _aosrc="$_aosrc ao_alsa5.c"
4617 _aomodules="alsa5 $_aomodules"
4618 _def_alsa5='#define HAVE_ALSA5 1'
4619 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4620 echores "yes (using alsa 0.5.x and sys/asoundlib.h)"
4621 elif test "$_alsaver" = '0.9.x-sys' ; then
4622 _aosrc="$_aosrc ao_alsa.c"
4623 _aomodules="alsa $_aomodules"
4624 _def_alsa9='#define HAVE_ALSA9 1'
4625 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4626 echores "yes (using alsa 0.9.x and sys/asoundlib.h)"
4627 elif test "$_alsaver" = '0.9.x-alsa' ; then
4628 _aosrc="$_aosrc ao_alsa.c"
4629 _aomodules="alsa $_aomodules"
4630 _def_alsa9='#define HAVE_ALSA9 1'
4631 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4632 echores "yes (using alsa 0.9.x and alsa/asoundlib.h)"
4633 elif test "$_alsaver" = '1.0.x-sys' ; then
4634 _aosrc="$_aosrc ao_alsa.c"
4635 _aomodules="alsa $_aomodules"
4636 _def_alsa1x="#define HAVE_ALSA1X 1"
4637 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4638 echores "yes (using alsa 1.0.x and sys/asoundlib.h)"
4639 elif test "$_alsaver" = '1.0.x-alsa' ; then
4640 _aosrc="$_aosrc ao_alsa.c"
4641 _aomodules="alsa $_aomodules"
4642 _def_alsa1x="#define HAVE_ALSA1X 1"
4643 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4644 echores "yes (using alsa 1.0.x and alsa/asoundlib.h)"
4646 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4647 else
4648 _noaomodules="alsa $_noaomodules"
4649 echores "no"
4653 echocheck "Sun audio"
4654 if test "$_sunaudio" = auto ; then
4655 cat > $TMPC << EOF
4656 #include <sys/types.h>
4657 #include <sys/audioio.h>
4658 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4660 _sunaudio=no
4661 cc_check && _sunaudio=yes
4663 if test "$_sunaudio" = yes ; then
4664 _def_sunaudio='#define USE_SUN_AUDIO 1'
4665 _aosrc="$_aosrc ao_sun.c"
4666 _aomodules="sun $_aomodules"
4667 else
4668 _def_sunaudio='#undef USE_SUN_AUDIO'
4669 _noaomodules="sun $_noaomodules"
4671 echores "$_sunaudio"
4674 echocheck "Sun mediaLib"
4675 if test "$_mlib" = auto ; then
4676 _mlib=no
4677 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4678 cat > $TMPC << EOF
4679 #include <mlib.h>
4680 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
4682 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
4684 if test "$_mlib" = yes ; then
4685 _def_mlib='#define HAVE_MLIB 1'
4686 _inc_mlib=" -I${_mlibdir}/include "
4687 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
4688 else
4689 _def_mlib='#undef HAVE_MLIB'
4691 echores "$_mlib"
4694 echocheck "SGI audio"
4695 if test "$_sgiaudio" = auto ; then
4696 # check for SGI audio
4697 cat > $TMPC << EOF
4698 #include <dmedia/audio.h>
4699 int main(void) { return 0; }
4701 _sgiaudio=no
4702 cc_check && _sgiaudio=yes
4704 if test "$_sgiaudio" = "yes" ; then
4705 _def_sgiaudio='#define USE_SGI_AUDIO 1'
4706 _ld_sgiaudio='-laudio'
4707 _aosrc="$_aosrc ao_sgi.c"
4708 _aomodules="sgi $_aomodules"
4709 else
4710 _def_sgiaudio='#undef USE_SGI_AUDIO'
4711 _noaomodules="sgi $_noaomodules"
4713 echores "$_sgiaudio"
4716 echocheck "VCD support"
4717 if linux || bsdos || freebsd || netbsd || sunos || darwin ; then
4718 _inputmodules="vcd $_inputmodules"
4719 _def_vcd='#define HAVE_VCD 1'
4720 echores "ok"
4721 else
4722 _def_vcd='#undef HAVE_VCD'
4723 _noinputmodules="vcd $_noinputmodules"
4724 echores "not supported on this OS"
4727 echocheck "DVD support (libmpdvdkit)"
4728 if test "$_dvdkit" = auto ; then
4729 _dvdkit=no
4730 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
4731 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
4732 test -f "./libmpdvdkit/Makefile" && _dvdkit=yes
4735 if test "$_dvdkit" = yes ; then
4736 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
4737 if test -f "./libmpdvdkit2/Makefile" ; then
4738 _inputmodules="mpdvdkit2 $_inputmodules"
4739 _dvdread=libmpdvdkit2
4740 _dvdkit2=yes
4741 _dvdkit=no
4742 else
4743 _inputmodules="mpdvdkit $_inputmodules"
4744 _dvdread=libmpdvdkit
4746 else
4747 _noinputmodules="mpdvdkit $_noinputmodules"
4749 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
4750 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
4751 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
4752 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
4753 if linux || netbsd || openbsd || bsdos ; then
4754 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4755 if openbsd ; then
4756 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4758 else
4759 if freebsd ; then
4760 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4761 else
4762 if darwin ; then
4763 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4767 else
4768 _noinputmodules="mpdvdkit $_noinputmodules"
4770 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
4771 echores "yes"
4772 else
4773 echores "no"
4776 echocheck "DVD support (libdvdread)"
4777 if test "$_dvdread" = auto ; then
4778 cat > $TMPC << EOF
4779 #include <inttypes.h>
4780 #include <dvdread/dvd_reader.h>
4781 #include <dvdread/ifo_types.h>
4782 #include <dvdread/ifo_read.h>
4783 #include <dvdread/nav_read.h>
4784 int main(void) { return 0; }
4786 _dvdread=no
4787 if test "$_dl" = yes; then
4788 cc_check \
4789 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
4790 _dvdread=yes
4793 _def_mpdvdkit="#undef USE_MPDVDKIT"
4794 case "$_dvdread" in
4795 yes)
4796 _largefiles=yes
4797 _def_dvdread='#define USE_DVDREAD 1'
4798 _ld_dvdread='-ldvdread'
4799 _inputmodules="dvdread $_inputmodules"
4800 echores "yes"
4803 _def_dvdread='#undef USE_DVDREAD'
4804 _noinputmodules="dvdread $_noinputmodules"
4805 echores "no"
4807 libmpdvdkit)
4808 _largefiles=yes
4809 _def_dvdread='#define USE_DVDREAD 1'
4810 _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
4811 _noinputmodules="dvdread $_noinputmodules"
4812 _def_mpdvdkit="#define USE_MPDVDKIT 1"
4813 echores "disabled by libmpdvdkit"
4815 libmpdvdkit2)
4816 _largefiles=yes
4817 _def_dvdread='#define USE_DVDREAD 1'
4818 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
4819 _noinputmodules="dvdread $_noinputmodules"
4820 _def_mpdvdkit="#define USE_MPDVDKIT 2"
4821 echores "disabled by libmpdvdkit2"
4823 esac
4825 # dvdnav disabled, it does not work
4826 # echocheck "DVD support (libdvdnav)"
4827 # if test "$_dvdnav" = yes ; then
4828 # cat > $TMPC <<EOF
4829 # #include <dvdnav.h>
4830 # int main(void) { dvdnav_t *dvd=0; return 0; }
4831 # EOF
4832 # _dvdnav=no
4833 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
4834 # if test -z "$_dvdnavconfig" ; then
4835 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
4836 # _dvdnavconfig="dvdnav-config"
4837 # fi
4838 # fi
4839 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
4840 # _used_css=
4841 # test "$_dvdkit" = no && test "$_dvdkit2" = no && _used_css=$_ld_css
4842 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
4843 # fi
4844 # if test "$_dvdnav" = yes ; then
4845 # _largefiles=yes
4846 # _def_dvdnav='#define USE_DVDNAV 1'
4847 # if test -n "$_legal_dvdnavdir" ; then
4848 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
4849 # elif test -n "$_dvdnavconfig" ; then
4850 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
4851 # else
4852 # _ld_css="$_ld_css -ldvdnav"
4853 # fi
4854 # if test -n "$_dvdnavconfig" ; then
4855 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
4856 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
4857 # fi
4858 # if test -n "$_dvdnavdir" ; then
4859 # _inc_extra="$_inc_extra -I$_dvdnavdir"
4860 # fi
4861 # _inputmodules="dvdnav $_inputmodules"
4862 # echores "yes"
4863 # else
4864 # _def_dvdnav='#undef USE_DVDNAV'
4865 # _noinputmodules="dvdnav $_noinputmodules"
4866 # echores "no"
4867 # fi
4869 echocheck "cdparanoia"
4870 if test "$_cdparanoia" = auto ; then
4871 cat > $TMPC <<EOF
4872 #include <cdda_interface.h>
4873 #include <cdda_paranoia.h>
4874 // This need a better test. How ?
4875 int main(void) { return 1; }
4877 _cdparanoia=no
4878 if cc_check $_inc_cdparanoia $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm ; then
4879 _cdparanoia=yes
4880 else
4881 for I in /usr/include/cdda /usr/local/include/cdda ; do
4882 if cc_check -I$I $_ld_cdparanoia -lcdda_interface -lcdda_paranoia $_ld_lm ; then
4883 _cdparanoia=yes; _inc_cdparanoia="-I$I"; break
4885 done
4888 if test "$_cdparanoia" = yes ; then
4889 _def_cdparanoia='#define HAVE_CDDA'
4890 _inputmodules="cdda $_inputmodules"
4891 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
4892 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
4893 else
4894 _def_cdparanoia='#undef HAVE_CDDA'
4895 _noinputmodules="cdda $_noinputmodules"
4897 echores "$_cdparanoia"
4900 echocheck "freetype >= 2.0.9"
4902 # freetype depends on iconv
4903 if test "$_iconv" = no ; then
4904 _freetype="no (iconv support needed)"
4907 if test "$_freetype" = auto ; then
4908 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
4909 cat > $TMPC << EOF
4910 #include <stdio.h>
4911 #include <ft2build.h>
4912 #include FT_FREETYPE_H
4913 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
4914 #error "Need FreeType 2.0.9 or newer"
4915 #endif
4916 int main()
4918 FT_Library library;
4919 FT_Int major=-1,minor=-1,patch=-1;
4920 int err=FT_Init_FreeType(&library);
4921 if(err){
4922 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
4923 exit(err);
4925 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
4926 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
4927 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
4928 (int)major,(int)minor,(int)patch );
4929 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
4930 printf("Library and header version mismatch! Fix it in your distribution!\n");
4931 exit(1);
4933 return 0;
4936 _freetype=no
4937 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _freetype=yes
4938 else
4939 _freetype=no
4942 if test "$_freetype" = yes ; then
4943 _def_freetype='#define HAVE_FREETYPE'
4944 _inc_freetype=`$_freetypeconfig --cflags`
4945 _ld_freetype=`$_freetypeconfig --libs`
4946 else
4947 _def_freetype='#undef HAVE_FREETYPE'
4949 echores "$_freetype"
4951 if test "$_freetype" = no ; then
4952 _fontconfig=no
4954 echocheck "fontconfig"
4955 if test "$_fontconfig" = auto ; then
4956 if ( pkg-config --modversion fontconfig) > /dev/null 2>&1 ; then
4957 cat > $TMPC << EOF
4958 #include <stdio.h>
4959 #include <fontconfig/fontconfig.h>
4960 int main()
4962 int err = FcInit();
4963 if(err == FcFalse){
4964 printf("Couldn't initialize fontconfig lib\n");
4965 exit(err);
4967 return 0;
4971 _fontconfig=no
4972 cc_check `pkg-config --cflags --libs fontconfig` && ( $TMPO >> "$TMPLOG" ) && _fontconfig=yes
4973 else
4974 _fontconfig=no
4977 if test "$_fontconfig" = yes ; then
4978 _def_fontconfig='#define HAVE_FONTCONFIG'
4979 _inc_fontconfig=`pkg-config --cflags fontconfig`
4980 _ld_fontconfig=`pkg-config --libs fontconfig`
4981 else
4982 _def_fontconfig='#undef HAVE_FONTCONFIG'
4984 echores "$_fontconfig"
4986 echocheck "fribidi with charsets"
4987 if test "$_fribidi" = yes ; then
4988 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
4989 cat > $TMPC << EOF
4990 #include <stdio.h>
4991 #include <fribidi/fribidi.h>
4992 int main()
4994 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHARSET_UTF8) {
4995 printf("Fribidi headers are not consistents with the library!\n");
4996 exit(1);
4998 return 0;
5001 _fribidi=no
5002 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _fribidi=yes
5003 else
5004 _fribidi=no
5007 if test "$_fribidi" = yes ; then
5008 _def_fribidi='#define USE_FRIBIDI'
5009 _inc_fribidi=`$_fribidiconfig --cflags`
5010 _ld_fribidi=`$_fribidiconfig --libs`
5011 else
5012 _def_fribidi='#undef USE_FRIBIDI'
5014 echores "$_fribidi"
5017 echocheck "ENCA"
5018 if test "$_enca" = auto ; then
5019 cat > $TMPC << EOF
5020 #include <enca.h>
5021 int main()
5023 const char **langs;
5024 size_t langcnt;
5025 langs = enca_get_languages(&langcnt);
5026 return 0;
5029 _enca=no
5030 cc_check -lenca && _enca=yes
5032 if test "$_enca" = yes ; then
5033 _def_enca='#define HAVE_ENCA 1'
5034 _ld_enca='-lenca'
5035 else
5036 _def_enca='#undef HAVE_ENCA'
5038 echores "$_enca"
5041 echocheck "zlib"
5042 cat > $TMPC << EOF
5043 #include <zlib.h>
5044 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
5046 _zlib=no
5047 cc_check -lz && _zlib=yes
5048 if test "$_zlib" = yes ; then
5049 _def_zlib='#define HAVE_ZLIB 1'
5050 _ld_zlib='-lz'
5051 else
5052 _def_zlib='#undef HAVE_ZLIB'
5054 echores "$_zlib"
5057 echocheck "RTC"
5058 if test "$_rtc" = auto ; then
5059 cat > $TMPC << EOF
5060 #include <sys/ioctl.h>
5061 #ifdef __linux__
5062 #include <linux/rtc.h>
5063 #else
5064 #include <rtc.h>
5065 #define RTC_PIE_ON RTCIO_PIE_ON
5066 #endif
5067 int main(void) { return RTC_PIE_ON; }
5069 _rtc=no
5070 cc_check && _rtc=yes
5072 if test "$_rtc" = yes ; then
5073 _def_rtc='#define HAVE_RTC 1'
5074 else
5075 _def_rtc='#undef HAVE_RTC'
5077 echores "$_rtc"
5080 echocheck "external liblzo support"
5081 if test "$_liblzo" = auto ; then
5082 _liblzo=no
5083 cat > $TMPC << EOF
5084 #include <lzo1x.h>
5085 int main(void) { lzo_init();return 0; }
5087 cc_check -llzo && _liblzo=yes
5089 if test "$_liblzo" = yes ; then
5090 _def_liblzo='#define USE_LIBLZO 1'
5091 _ld_liblzo='-llzo'
5092 _codecmodules="liblzo $_codecmodules"
5093 else
5094 _def_liblzo='#undef USE_LIBLZO'
5095 _nocodecmodules="liblzo $_nocodecmodules"
5097 echores "$_liblzo"
5100 echocheck "mad support"
5101 if test "$_mad" = auto ; then
5102 _mad=no
5103 cat > $TMPC << EOF
5104 #include <mad.h>
5105 int main(void) { return 0; }
5107 cc_check $_madlibdir -lmad && _mad=yes
5109 if test "$_mad" = yes ; then
5110 _def_mad='#define USE_LIBMAD 1'
5111 _ld_mad='-lmad'
5112 _codecmodules="libmad $_codecmodules"
5113 else
5114 _def_mad='#undef USE_LIBMAD'
5115 _nocodecmodules="libmad $_nocodecmodules"
5117 echores "$_mad"
5119 echocheck "Toolame"
5120 if test "$_toolame" = auto ; then
5121 cat > $TMPC <<EOF
5122 #include <toolame.h>
5123 int main(void) { toolame_init(); return 0; }
5125 _toolame=no
5126 _toolame_extraflags=""
5127 _toolame_lib="-ltoolame"
5128 if test -n "$_toolamedir"; then
5129 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
5131 cc_check $_toolame_extraflags $_toolame_lib $_ld_lm && _toolame=yes
5133 if test "$_toolame" = yes ; then
5134 _def_toolame='#define HAVE_TOOLAME 1'
5135 _codecmodules="$_codecmodules toolame"
5136 else
5137 _def_toolame='#undef HAVE_TOOLAME'
5138 _toolame_lib=""
5139 _nocodecmodules="toolame $_nocodecmodules"
5141 if test -z "$_toolamedir" ; then
5142 echores "$_toolame"
5143 else
5144 echores "$_toolame (using $_toolamedir)"
5147 echocheck "OggVorbis support"
5148 if test "$_tremor_internal" = yes; then
5149 _vorbis=yes
5150 elif test "$_vorbis" = auto; then
5151 _vorbis=no
5152 cat > $TMPC << EOF
5153 #include <vorbis/codec.h>
5154 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
5156 cc_check -lvorbis -logg $_ld_lm && _vorbis=yes
5158 if test "$_vorbis" = yes ; then
5159 _def_vorbis='#define HAVE_OGGVORBIS 1'
5160 if test "$_tremor_internal" = yes ; then
5161 # do not set _ld_vorbis as it is resolved separately
5162 # mp3lame support for vorbis is deprecated so don't care
5163 _def_tremor='#define TREMOR 1'
5164 if test "$_tremor_low" = yes ; then
5165 _tremor_flags='-D_LOW_ACCURACY_'
5166 else
5167 _tremor_flags=''
5169 _codecmodules="tremor(internal) $_codecmodules"
5170 elif test "$_tremor" = yes ; then
5171 _def_tremor='#define TREMOR 1'
5172 _ld_vorbis='-lvorbisidec'
5173 _codecmodules="tremor $_codecmodules"
5174 else
5175 _def_tremor='#undef TREMOR'
5176 _ld_vorbis='-lvorbis -logg'
5177 _codecmodules="libvorbis $_codecmodules"
5179 else
5180 _def_vorbis='#undef HAVE_OGGVORBIS'
5181 _def_tremor='#undef TREMOR'
5182 _nocodecmodules="libvorbis $_nocodecmodules"
5184 if test "$_vorbis" = yes -a "$_tremor_internal" = yes -a "$_tremor_low" = yes ; then
5185 echores "$_vorbis (internal low accuracy Tremor)"
5186 elif test "$_vorbis" = yes -a "$_tremor_internal" = yes ; then
5187 echores "$_vorbis (internal Tremor)"
5188 elif test "$_vorbis" = yes -a "$_tremor" = yes ; then
5189 echores "$_vorbis (Tremor)"
5190 else
5191 echores "$_vorbis"
5194 echocheck "OggTheora support (only the CVS version!)"
5195 if test "$_theora" = auto ; then
5196 _theora=no
5197 cat > $TMPC << EOF
5198 #include <theora/theora.h>
5199 #include <string.h>
5200 int main(void)
5202 /* theora is in flux, make sure that all interface routines and
5203 * datatypes exist and work the way we expect it, so we don't break
5204 * mplayer */
5205 ogg_packet op;
5206 theora_comment tc;
5207 theora_info inf;
5208 theora_state st;
5209 yuv_buffer yuv;
5210 int r;
5211 double t;
5213 theora_info_init (&inf);
5214 theora_comment_init (&tc);
5216 return 0;
5218 /* we don't want to execute this kind of nonsense; just for making sure
5219 * that compilation works... */
5220 memset(&op, 0, sizeof(op));
5221 r = theora_decode_header (&inf, &tc, &op);
5222 r = theora_decode_init (&st, &inf);
5223 t = theora_granule_time (&st, op.granulepos);
5224 r = theora_decode_packetin (&st, &op);
5225 r = theora_decode_YUVout (&st, &yuv);
5226 theora_clear (&st);
5228 return 0;
5231 cc_check -ltheora -logg $_ld_lm && _theora=yes
5233 if test "$_theora" = yes ; then
5234 _def_theora='#define HAVE_OGGTHEORA 1'
5235 _codecmodules="libtheora $_codecmodules"
5236 _ld_theora="-ltheora -logg"
5237 else
5238 _def_theora='#undef HAVE_OGGTHEORA'
5239 _nocodecmodules="libtheora $_nocodecmodules"
5241 echores "$_theora"
5243 echocheck "mp3lib support"
5244 if test "$_mp3lib" = yes ; then
5245 _def_mp3lib='#define USE_MP3LIB 1'
5246 _codecmodules="mp3lib $_codecmodules"
5247 else
5248 _def_mp3lib='#undef USE_MP3LIB'
5249 _nocodecmodules="mp3lib $_nocodecmodules"
5251 echores "$_mp3lib"
5253 echocheck "liba52 support"
5254 if test "$_liba52" = yes ; then
5255 _def_liba52='#define USE_LIBA52 1'
5256 _codecmodules="liba52 $_codecmodules"
5257 else
5258 _def_liba52='#undef USE_LIBA52'
5259 _nocodecmodules="liba52 $_nocodecmodules"
5261 echores "$_liba52"
5263 echocheck "libdts support"
5264 if test "$_libdts" = auto ; then
5265 _libdts=no
5266 cat > $TMPC << EOF
5267 #include <inttypes.h>
5268 #include <dts.h>
5269 int main(void) { dts_init (0); return 0; }
5271 cc_check $_inc_libdts $_ld_libdts -ldts $_ld_lm && _libdts=yes
5273 if test "$_libdts" = yes ; then
5274 _def_libdts='#define CONFIG_DTS 1'
5275 _ld_libdts="$_ld_libdts -ldts $_ld_lm"
5276 _codecmodules="libdts $_codecmodules"
5277 else
5278 _def_libdts='#undef CONFIG_DTS'
5279 _nocodecmodules="libdts $_nocodecmodules"
5281 echores "$_libdts"
5283 echocheck "libmpeg2 support"
5284 if test "$_libmpeg2" = yes ; then
5285 _def_libmpeg2='#define USE_LIBMPEG2 1'
5286 _codecmodules="libmpeg2 $_codecmodules"
5287 else
5288 _def_libmpeg2='#undef USE_LIBMPEG2'
5289 _nocodecmodules="libmpeg2 $_nocodecmodules"
5291 echores "$_libmpeg2"
5294 echocheck "Matroska support"
5295 if test "$_matroska_internal" = yes ; then
5296 _inputmodules="matroska $_inputmodules"
5297 _def_matroska='#define HAVE_MATROSKA 1'
5298 else
5299 _noinputmodules="matroska $_noinputmodules"
5300 _def_matroska='#undef HAVE_MATROSKA'
5302 echores "$_matroska_internal"
5305 echocheck "internal FAAD2 (AAC) support"
5306 _inc_faad="-I`pwd`/libfaad2"
5307 if test "$_faad_internal" = auto ; then
5308 # the faad check needs a config.h file
5309 if not test -f "config.h" ; then
5310 > config.h
5312 # internal faad: check if our dear gcc is able to compile it...
5313 cp "`pwd`/libfaad2/cfft.c" $TMPC
5314 if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer $_inc_faad ); then
5315 _faad_internal=yes
5316 else
5317 _faad_internal="no (broken gcc)"
5320 if test "$_faad_internal" = yes ; then
5321 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5322 _faad_external=no
5323 else
5324 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5325 _inc_faad=
5327 echores "$_faad_internal"
5330 echocheck "external FAAD2 (AAC) support"
5331 if test "$_faad_external" != no ; then
5332 _ld_faad='-lfaad'
5333 _inc_faad="$_inc_extra"
5334 # external faad: check if it's really faad2 :)
5335 if test "$_faad_external" = auto ; then
5336 _faad_external=no
5337 cat > $TMPC << EOF
5338 #include <faad.h>
5339 #ifndef FAAD_MIN_STREAMSIZE
5340 #error Too old version
5341 #endif
5342 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
5344 cc_check $_inc_faad $_ld_faad $_ld_lm && _faad_external=yes
5346 echores "$_faad_external"
5347 else
5348 echores "no"
5351 if test "$_faad_external" = yes; then
5352 _def_faad='#define HAVE_FAAD 1'
5353 _codecmodules="faad2(external) $_codecmodules"
5354 elif test "$_faad_internal" = yes; then
5355 _def_faad='#define HAVE_FAAD 1'
5356 _codecmodules="faad2(internal) $_codecmodules"
5357 else
5358 _def_faad='#undef HAVE_FAAD'
5359 _nocodecmodules="faad2 $_nocodecmodules"
5360 _ld_faad=
5364 echocheck "LADSPA plugin support"
5365 if test "$_ladspa" = auto ; then
5366 cat > $TMPC <<EOF
5367 #include <stdio.h>
5368 #include <ladspa.h>
5369 int main(void) {
5370 const LADSPA_Descriptor *ld = NULL;
5371 return 0;
5374 _ladspa=no
5375 cc_check && _ladspa=yes
5377 if test "$_ladspa" = yes; then
5378 _def_ladspa="#define HAVE_LADSPA"
5379 _afsrc="$_afsrc af_ladspa.c"
5380 _afmodules="ladspa $_afmodules"
5381 else
5382 _def_ladspa="#undef HAVE_LADSPA"
5383 _noafmodules="ladspa $_noafmodules"
5385 echores "$_ladspa"
5388 if test "$_win32" = auto ; then
5389 if x86 ; then
5390 qnx && _win32=no
5391 else
5392 _win32=no # x86 arch only
5396 if test "$_win32" != no ; then
5397 if test -z "$_win32libdir" ; then
5398 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
5399 if test -d "$I" ; then
5400 _win32libdir="$I"
5401 break;
5403 done
5407 echocheck "Win32 codec DLL support"
5408 if test "$_win32" = auto ; then
5409 _win32=no
5410 test -n "$_win32libdir" && _win32=yes
5412 if test "$_win32" = yes ; then
5413 _def_win32='#define USE_WIN32DLL 1'
5414 echores "yes (using $_win32libdir)"
5415 else
5416 _def_win32='#undef USE_WIN32DLL'
5417 _nocodecmodules="win32 $_nocodecmodules"
5418 _dshow=no
5419 echores "no"
5422 if test "$_win32" != no ; then
5423 _def_win32_loader='#undef WIN32_LOADER'
5424 echocheck "Win32 loader support"
5425 _ld_win32='loader/libloader.a'
5426 _dep_win32='loader/libloader.a'
5427 _codecmodules="win32 $_codecmodules"
5428 if openbsd ; then
5429 x86 && _ld_win32="$_ld_win32 -li386"
5431 if not win32 ; then
5432 _def_win32_loader='#define WIN32_LOADER 1'
5433 echores "yes"
5434 else
5435 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5436 echores "no (using native windows)"
5440 echocheck "DirectShow"
5441 if false ; then
5443 if test "$_dshow" != no ; then
5444 _dshow=no
5445 # check if compiler supports C++ and C++-libs are installed correctly
5446 cat > "$TMPCPP" << EOF
5447 #include <string>
5448 class myclass {
5449 private: int ret;
5450 public: int myreturn(void);
5452 int myclass::myreturn(void) { ret = 0; return ret ; }
5453 int main(void) { myclass myobject; return myobject.myreturn(); }
5455 echo "------------------------------------------------" >> "$TMPLOG"
5456 cat "$TMPCPP" >> "$TMPLOG"
5457 if ( $_cc "$TMPCPP" -o "$TMPO" && "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
5458 _dshow=yes
5459 echores "yes (C++ is ok)"
5460 else
5461 echores "no"
5462 cat << EOF
5464 Your C++ runtime environment is broken.
5466 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5467 Are the C++ libraries correctly installed?
5468 Check for libstdc++ and in (/etc/)ld.so.conf.
5470 If you do not need DirectShow support, you can also use:
5471 ./configure --disable-dshow <your-normal-configure-options>
5472 to disable building the C++ based DirectShow code.
5475 die "$_cc's C++ is broken"
5481 echores "$_dshow"
5483 if test "$_dshow" = yes ; then
5484 _def_dshow='#define USE_DIRECTSHOW 1'
5485 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5486 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5487 _codecmodules="dshow/dmo $_codecmodules"
5488 else
5489 _def_dshow='#undef USE_DIRECTSHOW'
5490 _nocodecmodules="dshow/dmo $_nocodecmodules"
5494 echocheck "XAnim DLL"
5495 if test "$_xanim" = auto ; then
5496 _xanim=no
5497 if test "$_dl" = yes ; then
5498 if test -z "$_xanimlibdir" ; then
5499 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5500 if test -d "$I" ; then
5501 _xanimlibdir="$I"
5502 break;
5504 done
5506 test "$_xanimlibdir" && _xanim=yes
5507 if test "$_xanim" = yes ; then
5508 echores "yes (using $_xanimlibdir)"
5509 else
5510 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5512 else
5513 echores "no (dynamic loader support needed)"
5515 else
5516 echores "$_xanim (using $_xanimlibdir)"
5518 if test "$_xanim" = yes ; then
5519 _def_xanim='#define USE_XANIM 1'
5520 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5521 _codecmodules="xanim $_codecmodules"
5522 else
5523 _def_xanim='#undef USE_XANIM'
5524 _def_xanim_path='#undef XACODEC_PATH'
5525 _nocodecmodules="xanim $_nocodecmodules"
5528 echocheck "RealPlayer DLL"
5529 if test "$_real" = auto ; then
5530 _real=no
5531 if test "$_dl" = yes || test "$_win32" = yes ; then
5532 # if test "$_dl" = yes ; then
5533 if linux || freebsd || netbsd || win32 || darwin ; then
5534 _real=yes
5535 else
5536 echores "no (tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin)"
5538 if test "$_real" = yes ; then
5539 if test -z "$_reallibdir" ; then
5540 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5541 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5542 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5543 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5544 "$_win32libdir"; do
5545 if test -d "$I" ; then
5546 _reallibdir="$I"
5547 break
5549 done
5551 test "$_reallibdir" || _real=no
5552 if test "$_real" = yes ; then
5553 echores "yes (using $_reallibdir)"
5554 else
5555 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5558 else
5559 echores "no (dynamic loader support needed)"
5561 else
5562 echores "$_real (using $_reallibdir)"
5564 if test "$_real" = yes ; then
5565 _def_real='#define USE_REALCODECS 1'
5566 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5567 _codecmodules="real $_codecmodules"
5568 else
5569 _def_real='#undef USE_REALCODECS'
5570 _def_real_path="#undef REALCODEC_PATH"
5571 _nocodecmodules="real $_nocodecmodules"
5575 echocheck "LIVE.COM Streaming Media libraries"
5576 if test "$_live" = auto && test "$_network" = yes ; then
5577 _TMPC=$TMPC
5578 TMPC=$TMPCPP
5579 cat >$TMPC <<EOF
5580 #include <liveMedia.hh>
5581 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5582 #error Please upgrade to version 2004.07.19 or later of the "LIVE.COM Streaming Media" libraries - available from <www.live.com/liveMedia/>
5583 #endif
5584 int main(void) {}
5587 _live_dist=no
5588 if test -z "$_livelibdir" ; then
5589 if cc_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock; then
5590 _live_dist=yes
5591 else
5592 for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live; do
5593 if test -d "$I" ; then
5594 _livelibdir="$I"
5595 break;
5597 done
5601 if test "$_live_dist" = no && test "$_livelibdir" && cc_check -I$_livelibdir/liveMedia/include/ \
5602 -I$_livelibdir/UsageEnvironment/include -I$_livelibdir/groupsock/include; then
5603 _live=yes
5604 else
5605 _live=no
5607 TMPC=$_TMPC
5609 if test "$_live" = yes && test "$_network" = yes ; then
5610 echores "yes (using $_livelibdir)"
5611 _def_live='#define STREAMING_LIVE_DOT_COM 1'
5612 _live_libs_def="# LIVE.COM Streaming Media libraries:
5613 LIVE_LIB_DIR = $_livelibdir
5614 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
5615 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
5616 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
5617 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
5618 LIVE_LIBS += -lstdc++
5619 LIVE_INCLUDES = -I\$(LIVE_LIB_DIR)/liveMedia/include
5620 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/UsageEnvironment/include
5621 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/BasicUsageEnvironment/include
5622 LIVE_INCLUDES += -I\$(LIVE_LIB_DIR)/groupsock/include"
5623 _ld_live='$(LIVE_LIBS)'
5624 _inputmodules="live.com $_inputmodules"
5625 elif test "$_live_dist" = yes && test "$_network" = yes ; then
5626 echores "yes (using distribution version)"
5627 _live="yes"
5628 _def_live='#define STREAMING_LIVE_DOT_COM 1'
5629 _live_libs_def="# LIVE.COM Streaming Media libraries:
5630 LIVE_LIB_DIR = $_livelibdir
5631 LIVE_LIBS = -lliveMedia
5632 LIVE_LIBS += -lgroupsock
5633 LIVE_LIBS += -lUsageEnvironment
5634 LIVE_LIBS += -lBasicUsageEnvironment
5635 LIVE_LIBS += -lstdc++
5636 LIVE_INCLUDES = -I/usr/include/liveMedia
5637 LIVE_INCLUDES += -I/usr/include/UsageEnvironment
5638 LIVE_INCLUDES += -I/usr/include/BasicUsageEnvironment
5639 LIVE_INCLUDES += -I/usr/include/groupsock"
5640 _ld_live='$(LIVE_LIBS)'
5641 _inputmodules="live.com $_inputmodules"
5642 else
5643 echores "no"
5644 _def_live='#undef STREAMING_LIVE_DOT_COM'
5645 _noinputmodules="live.com $_noinputmodules"
5649 echocheck "FFmpeg libavcodec (static)"
5650 if test "$_libavcodec" = auto ; then
5651 # Note: static linking is preferred to dynamic linking
5652 _libavcodec=no
5653 if test -d libavcodec && test -f libavcodec/utils.c ; then
5654 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
5655 _libavcodec=yes
5656 echores "yes"
5657 else
5658 echores "no (old ffmpeg version, use CVS !)"
5660 else
5661 echores "no (see DOCS/HTML/$_doc_lang/codecs.html)"
5663 else
5664 echores "$_libavcodec"
5667 echocheck "FFmpeg libavformat (static)"
5668 if test "$_libavformat" = auto ; then
5669 # Note: static linking is preferred to dynamic linking
5670 _libavformat=no
5671 if test -d libavformat && test -f libavformat/utils.c ; then
5672 _libavformat=yes
5673 echores "yes"
5674 else
5675 echores "no"
5677 else
5678 echores "$_libavformat"
5681 _def_haveffpostprocess='no'
5682 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
5683 _def_haveffpostprocess='yes'
5686 if test "$_libavcodec" != yes ; then
5687 echocheck "FFmpeg libavcodec (dynamic)"
5688 if test "$_libavcodecso" = auto ; then
5689 _libavcodecso=no
5690 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
5691 cat > $TMPC << EOF
5692 #define FF_POSTPROCESS 1
5693 #include <ffmpeg/avcodec.h>
5694 int main(void) {
5695 avcodec_find_encoder_by_name("");
5696 return 0;
5699 if cc_check -lavcodec $_ld_lm ; then
5700 _libavcodecso=yes
5701 echores "yes (using libavcodec.so)"
5702 else
5703 echores "no (libavcodec.so is broken/obsolete)"
5705 else
5706 echores "$_libavcodecso"
5710 _def_libavcodec='#undef USE_LIBAVCODEC'
5711 _def_libavcodecso='#undef USE_LIBAVCODEC_SO'
5712 _def_ffpostprocess='#undef FF_POSTPROCESS'
5713 if test "$_libavcodec" = yes ; then
5714 _def_libavcodec='#define USE_LIBAVCODEC 1'
5715 _ld_libavcodec='libavcodec/libavcodec.a'
5716 _dep_libavcodec='libavcodec/libavcodec.a'
5717 _def_ffpostprocess='#define FF_POSTPROCESS 1'
5718 _codecmodules="libavcodec $_codecmodules"
5719 elif test "$_libavcodecso" = yes ; then
5720 _def_libavcodec='#define USE_LIBAVCODEC 1'
5721 _def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
5722 _ld_libavcodec='-lavcodec'
5723 _codecmodules="libavcodec.so $_codecmodules"
5724 else
5725 _nocodecmodules="libavcodec $_nocodecmodules"
5728 _def_libavformat='#undef USE_LIBAVFORMAT'
5729 _def_libavformat_win32='#undef CONFIG_WIN32'
5730 if test "$_libavformat" = yes ; then
5731 _def_libavformat='#define USE_LIBAVFORMAT 1'
5732 _ld_libavformat='libavformat/libavformat.a'
5733 _dep_libavformat='libavformat/libavformat.a'
5734 if win32 ; then
5735 _def_libavformat_win32='#define CONFIG_WIN32 1'
5739 echocheck "amr narrowband"
5740 _echomsg=""
5741 if test "$_amr_nb" = auto ; then
5742 if test -f libavcodec/amr_float/sp_dec.c ; then
5743 if test "$_libavcodec" = yes ; then
5744 _amr_nb=yes
5745 else
5746 _amr_nb=no
5747 _echomsg "libavcodec (static) is required by amr_nb, sorry"
5749 else
5750 _amr_nb=no
5753 if test "$_amr_nb" = yes ; then
5754 _def_amr_nb='#define AMR_NB 1'
5755 else
5756 _def_amr_nb='#undef AMR_NB'
5758 echores "$_amr_nb $_echomsg"
5760 echocheck "amr narrowband, fixed point"
5761 _echomsg=""
5762 if test "$_amr_nb_fixed" = auto ; then
5763 if test -f libavcodec/amr/dtx_dec.c ; then
5764 if test "$_libavcodec" = yes ; then
5765 if test "$_amr_nb" = no ; then
5766 _amr_nb_fixed=yes
5767 else
5768 _amr_nb_fixed=no
5769 _echomsg="(disabled by amr_nb)"
5771 else
5772 _amr_nb_fixed=no
5773 _echomsg "libavcodec (static) is required by amr_nb-fixed, sorry"
5775 else
5776 _amr_nb_fixed=no
5779 if test "$_amr_nb_fixed" = yes ; then
5780 _def_amr_nb='#define AMR_NB 1'
5781 _def_amr_nb_fixed='#define AMR_NB_FIXED 1'
5782 _amr_nb=yes;
5783 else
5784 _def_amr_nb_fixed='#undef AMR_NB_FIXED'
5786 echores "$_amr_nb_fixed $_echomsg"
5788 if test "$_amr_nb" = yes ; then
5789 _codecmodules="amr_nb $_codecmodules"
5790 else
5791 _nocodecmodules="amr_nb $_nocodecmodules"
5794 echocheck "amr wideband"
5795 _echomsg=""
5796 if test "$_amr_wb" = auto ; then
5797 if test -f libavcodec/amrwb_float/dec_dtx.c ; then
5798 if test "$_libavcodec" = yes ; then
5799 _amr_wb=yes
5800 else
5801 _amr_wb=no
5802 _echomsg="libavcodec (static) is required by amr_wb, sorry"
5804 else
5805 _amr_wb=no
5808 if test "$_amr_wb" = yes ; then
5809 _def_amr_wb='#define AMR_WB 1'
5810 _codecmodules="amr_wb $_codecmodules"
5811 else
5812 _def_amr_wb='#undef AMR_WB'
5813 _nocodecmodules="amr_wb $_nocodecmodules"
5815 echores "$_amr_wb $_echomsg"
5817 echocheck "libdv-0.9.5+"
5818 if test "$_libdv" = auto ; then
5819 _libdv=no
5820 cat > $TMPC <<EOF
5821 #include <libdv/dv.h>
5822 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
5824 cc_check -ldv $_ld_lm && _libdv=yes
5826 if test "$_libdv" = yes ; then
5827 _def_libdv='#define HAVE_LIBDV095 1'
5828 _ld_libdv="-ldv"
5829 _codecmodules="libdv $_codecmodules"
5830 else
5831 _def_libdv='#undef HAVE_LIBDV095'
5832 _nocodecmodules="libdv $_nocodecmodules"
5834 echores "$_libdv"
5836 echocheck "zr"
5837 if test "$_zr" = auto ; then
5838 #36067's seem to identify themselves as 36057PQC's, so the line
5839 #below should work for 36067's and 36057's.
5840 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
5841 _zr=yes
5842 else
5843 _zr=no
5846 if test "$_zr" = yes ; then
5847 if test "$_libavcodec" = yes ; then
5848 _def_zr='#define HAVE_ZR 1'
5849 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
5850 _vomodules="zr zr2 $_vomodules"
5851 echores "$_zr"
5852 else
5853 echores "libavcodec (static) is required by zr, sorry"
5854 _novomodules="zr $_novomodules"
5855 _def_zr='#undef HAVE_ZR'
5857 else
5858 _def_zr='#undef HAVE_ZR'
5859 _novomodules="zr zr2 $_novomodules"
5860 echores "$_zr"
5863 echocheck "bl"
5864 if test "$_bl" = yes ; then
5865 _def_bl='#define HAVE_BL 1'
5866 _vosrc="$_vosrc vo_bl.c"
5867 _vomodules="bl $_vomodules"
5868 else
5869 _def_bl='#undef HAVE_BL'
5870 _novomodules="bl $_novomodules"
5872 echores "$_bl"
5874 echocheck "XviD"
5875 cat > $TMPC << EOF
5876 #include <xvid.h>
5877 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
5879 _ld_xvid="$_ld_xvid -lxvidcore $_ld_lm"
5880 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
5881 _xvid=yes
5882 _def_xvid3='#define HAVE_XVID3 1'
5883 _def_xvid4='#undef HAVE_XVID4'
5884 _codecmodules="xvid $_codecmodules"
5885 else
5886 cat > $TMPC << EOF
5887 #include <xvid.h>
5888 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
5890 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
5891 _xvid=yes
5892 _def_xvid3='#undef HAVE_XVID3'
5893 _def_xvid4='#define HAVE_XVID4 1'
5894 _codecmodules="xvid $_codecmodules"
5895 else
5896 _xvid=no
5897 _ld_xvid=''
5898 _def_xvid3='#undef HAVE_XVID3'
5899 _def_xvid4='#undef HAVE_XVID4'
5900 _nocodecmodules="xvid $_nocodecmodules"
5903 echores "$_xvid"
5905 _xvidcompat=no
5906 _def_decore_xvid='#undef DECORE_XVID'
5907 _def_encore_xvid='#undef ENCORE_XVID'
5908 if test "$_xvid" = yes ; then
5909 echocheck "DivX4 compatibility in XviD"
5910 cat > $TMPC << EOF
5911 #include <divx4.h>
5912 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
5914 cc_check $_ld_lm "$_ld_xvid" && _xvidcompat=yes
5915 echores "$_xvidcompat"
5918 echocheck "x264"
5919 cat > $TMPC << EOF
5920 #include <inttypes.h>
5921 #include <x264.h>
5922 #if X264_BUILD < 22
5923 #error We do not support old versions of x264. Get the latest from SVN.
5924 #endif
5925 int main(void) { x264_encoder_open((void*)0); return 0; }
5927 _ld_x264="$_ld_x264 -lx264 $_ld_lm"
5928 if test "$_x264" != no && cc_check $_inc_x264 $_ld_x264 ; then
5929 _x264=yes
5930 _def_x264='#define HAVE_X264 1'
5931 _codecmodules="x264 $_codecmodules"
5932 else
5933 _x264=no
5934 _ld_x264=''
5935 _def_x264='#undef HAVE_X264'
5936 _nocodecmodules="x264 $_nocodecmodules"
5938 echores "$_x264"
5940 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
5941 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
5942 cat > $TMPC << EOF
5943 #include <decore.h>
5944 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
5946 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
5947 _opendivx=no
5948 _ld_decore='-ldivxdecore'
5949 _def_decore='#define NEW_DECORE 1'
5950 _def_divx='#define USE_DIVX'
5951 _def_divx5='#undef DECORE_DIVX5'
5952 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5953 _codecmodules="divx4linux $_codecmodules"
5954 echores "DivX4linux (with libdivxdecore.so)"
5955 else
5956 # if test "$_divx4linux" != no ; then
5957 # DivX5 check
5958 # OdivxPP disabled because of:
5959 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
5960 cat > $TMPC << EOF
5961 #include <decore.h>
5962 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
5964 if test "$_divx4linux" != no && cc_check $_ld_lm -ldivxdecore ; then
5965 _opendivx=no
5966 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
5967 _ld_decore='-ldivxdecore'
5968 _def_decore='#define NEW_DECORE 1'
5969 _def_divx='#define USE_DIVX'
5970 _def_divx5='#define DECORE_DIVX5 1'
5971 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
5972 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5973 _codecmodules="divx5linux $_codecmodules"
5974 _nocodecmodules="divx4linux $_nocodecmodules"
5975 echores "DivX5linux (with libdivxdecore.so)"
5976 elif test "$_opendivx" != no ; then
5977 _opendivx=yes
5978 _ld_decore='opendivx/libdecore.a'
5979 _def_decore='#undef NEW_DECORE'
5980 _def_divx='#define USE_DIVX'
5981 _def_divx5='#undef DECORE_DIVX5'
5982 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
5983 _codecmodules="opendivx $_codecmodules"
5984 _nocodecmodules="divx5linux $_nocodecmodules"
5985 echores "OpenDivX"
5986 elif test "$_xvidcompat" = yes ; then
5987 _opendivx=no
5988 _ld_decore=''
5989 _def_decore='#define NEW_DECORE 1'
5990 _def_divx='#define USE_DIVX 1'
5991 _def_divx5='#undef DECORE_DIVX5'
5992 _def_decore_xvid='#define DECORE_XVID 1'
5993 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5994 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
5995 echores "XviD compat."
5996 else
5997 _opendivx=no
5998 _ld_decore=''
5999 _def_decore='#undef NEW_DECORE'
6000 _def_divx='#undef USE_DIVX'
6001 _def_divx5='#undef DECORE_DIVX5'
6002 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
6003 _nocodecmodules="opendivx $_nocodecmodules"
6004 echores "no"
6005 fi # DivX5 check
6009 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
6010 if test "$_mencoder" != no ; then
6012 echocheck "libmp3lame (for mencoder)"
6013 _mp3lame=no
6014 cat > $TMPC <<EOF
6015 #include <lame/lame.h>
6016 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; }
6018 # Note: libmp3lame usually depends on vorbis
6019 cc_check -lmp3lame $_ld_vorbis $_ld_lm && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _mp3lame=yes
6020 if test "$_mp3lame" = yes ; then
6021 _def_mp3lame="#define HAVE_MP3LAME `$TMPO`"
6022 _def_cfg_mp3lame="#define CONFIG_MP3LAME `$TMPO`"
6023 _ld_mp3lame="-lmp3lame $_ld_vorbis"
6024 else
6025 _def_mp3lame='#undef HAVE_MP3LAME'
6026 _def_cfg_mp3lame='#undef CONFIG_MP3LAME'
6028 echores "$_mp3lame"
6031 echocheck "DivX4linux encore (for mencoder)"
6032 cat > $TMPC << EOF
6033 #include <encore2.h>
6034 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
6036 if test "$_divx4linux" != no && cc_check -ldivxencore $_ld_lm ; then
6037 _def_encore='#define HAVE_DIVX4ENCORE 1'
6038 _ld_encore='-ldivxencore'
6039 echores "DivX4linux (with libdivxencore.so)"
6040 elif test "$_xvidcompat" = yes ; then
6041 _def_encore='#define HAVE_DIVX4ENCORE 1'
6042 _ld_encore=''
6043 _def_encore_xvid='#define ENCORE_XVID 1'
6044 echores "XviD compat."
6045 else
6046 _def_encore='#undef HAVE_DIVX4ENCORE'
6047 echores "no"
6052 echocheck "mencoder"
6053 _mencoder_flag='#undef HAVE_MENCODER'
6054 if test "$_mencoder" = yes ; then
6055 _mencoder_flag='#define HAVE_MENCODER'
6057 echores "$_mencoder"
6059 echocheck "fastmemcpy"
6060 # fastmemcpy check is done earlier with tests of CPU & binutils features
6061 if test "$_fastmemcpy" = yes ; then
6062 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
6063 else
6064 _def_fastmemcpy='#undef USE_FASTMEMCPY'
6066 echores "$_fastmemcpy"
6068 echocheck "UniquE RAR File Library"
6069 if test "$_unrarlib" = yes ; then
6070 _def_unrarlib='#define USE_UNRARLIB 1'
6071 else
6072 _def_unrarlib='#undef USE_UNRARLIB'
6074 echores "$_unrarlib"
6076 echocheck "TV interface"
6077 if test "$_tv" = yes ; then
6078 _def_tv='#define USE_TV 1'
6079 _inputmodules="tv $_inputmodules"
6080 else
6081 _noinputmodules="tv $_noinputmodules"
6082 _def_tv='#undef USE_TV'
6084 echores "$_tv"
6086 echocheck "EDL support"
6087 if test "$_edl" = yes ; then
6088 _def_edl='#define USE_EDL'
6089 _inputmodules="edl $_inputmodules"
6090 else
6091 _noinputmodules="edl $_noinputmodules"
6092 _def_edl='#undef USE_EDL'
6094 echores "$_edl"
6096 echocheck "*BSD BrookTree 848 TV interface"
6097 if test "$_tv_bsdbt848" = auto ; then
6098 _tv_bsdbt848=no
6099 if test "$_tv" = yes ; then
6100 cat > $TMPC <<EOF
6101 #include <sys/types.h>
6102 #if defined(__NetBSD__)
6103 #include <dev/ic/bt8xx.h>
6104 #else
6105 #include <machine/ioctl_bt848.h>
6106 #endif
6107 int main(void) { return 0; }
6109 cc_check && _tv_bsdbt848=yes
6112 if test "$_tv_bsdbt848" = yes ; then
6113 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
6114 _inputmodules="tv-bsdbt848 $_inputmodules"
6115 else
6116 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
6117 _noinputmodules="tv-bsdbt848 $_noinputmodules"
6119 echores "$_tv_bsdbt848"
6121 echocheck "Video 4 Linux TV interface"
6122 if test "$_tv_v4l" = auto ; then
6123 _tv_v4l=no
6124 if test "$_tv" = yes && linux ; then
6125 for I in /dev/video /dev/video? ; do
6126 if test -c $I ; then
6127 cat > $TMPC <<EOF
6128 #include <stdlib.h>
6129 #include <linux/videodev.h>
6130 int main(void) { return 0; }
6132 cc_check && _tv_v4l=yes
6133 break
6135 done
6138 if test "$_tv_v4l" = yes ; then
6139 _def_tv_v4l='#define HAVE_TV_V4L 1'
6140 _inputmodules="tv-v4l $_inputmodules"
6141 else
6142 _noinputmodules="tv-v4l $_noinputmodules"
6143 _def_tv_v4l='#undef HAVE_TV_V4L'
6145 echores "$_tv_v4l"
6148 echocheck "Video 4 Linux 2 TV interface"
6149 if test "$_tv_v4l2" = auto ; then
6150 _tv_v4l2=no
6151 if test "$_tv" = yes && linux ; then
6152 for I in /dev/video /dev/video? ; do
6153 if test -c $I ; then
6154 _tv_v4l2=yes
6155 break
6157 done
6160 if test "$_tv_v4l2" = yes ; then
6161 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
6162 _inputmodules="tv-v4l2 $_inputmodules"
6163 else
6164 _noinputmodules="tv-v4l2 $_noinputmodules"
6165 _def_tv_v4l2='#undef HAVE_TV_V4L2'
6167 echores "$_tv_v4l2"
6170 echocheck "audio select()"
6171 if test "$_select" = no ; then
6172 _def_select='#undef HAVE_AUDIO_SELECT'
6173 elif test "$_select" = yes ; then
6174 _def_select='#define HAVE_AUDIO_SELECT 1'
6176 echores "$_select"
6179 echocheck "network"
6180 # FIXME network check
6181 if test "$_network" != no ; then
6182 _def_network='#define MPLAYER_NETWORK 1'
6183 _ld_network="$_ld_sock"
6184 _inputmodules="network $_inputmodules"
6185 else
6186 _noinputmodules="network $_noinputmodules"
6187 _def_network='#undef MPLAYER_NETWORK'
6188 _ftp=no
6190 echores "$_network"
6192 echocheck "ftp"
6193 if (not beos) && (test "$_ftp" != no) ; then
6194 _def_ftp='#define HAVE_FTP 1'
6195 _inputmodules="ftp $_inputmodules"
6196 else
6197 _noinputmodules="ftp $_noinputmodules"
6198 _def_ftp='#undef HAVE_FTP'
6200 echores "$_ftp"
6202 echocheck "vstream client"
6203 if test "$_vstream" = auto ; then
6204 _vstream=no
6205 cat > $TMPC <<EOF
6206 #include <vstream-client.h>
6207 void vstream_error(const char *format, ... ) {}
6208 int main(void) { vstream_start(); return 0; }
6210 cc_check -lvstream-client && _vstream=yes
6212 if test "$_vstream" = yes ; then
6213 _def_vstream='#define HAVE_VSTREAM 1'
6214 _inputmodules="vstream $_inputmodules"
6215 _ld_vstream='-lvstream-client'
6216 else
6217 _noinputmodules="vstream $_noinputmodules"
6218 _def_vstream='#undef HAVE_VSTREAM'
6220 echores "$_vstream"
6222 # endian testing
6223 echocheck "byte order"
6224 if test "$_big_endian" = auto ; then
6225 cat > $TMPC <<EOF
6226 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
6227 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
6228 int main(){
6229 char* s = (char*)ascii_name;
6230 return 0;
6233 if cc_check ; then
6234 if strings $TMPO | grep -l MPlayerBigEndian >/dev/null ; then
6235 _big_endian=yes
6236 else
6237 _big_endian=no
6239 else
6240 echo -n "failed to autodetect byte order, defaulting to "
6243 if test "$_big_endian" = yes ; then
6244 _byte_order='big-endian'
6245 _def_words_endian='#define WORDS_BIGENDIAN 1'
6246 else
6247 _byte_order='little-endian'
6248 _def_words_endian='#undef WORDS_BIGENDIAN'
6250 echores "$_byte_order"
6252 echocheck "shared postprocess lib"
6253 echores "$_shared_pp"
6255 echocheck "OSD menu"
6256 if test "$_menu" = yes ; then
6257 _def_menu='#define HAVE_MENU 1'
6258 else
6259 _def_menu='#undef HAVE_MENU'
6261 echores "$_menu"
6263 # Check to see if they want QTX codecs enabled
6264 echocheck "QTX codecs"
6265 if test "$_qtx" = auto ; then
6266 _qtx=$_win32
6268 if test "$_qtx" = yes ; then
6269 _def_qtx='#define USE_QTX_CODECS 1'
6270 _codecmodules="qtx $_codecmodules"
6271 else
6272 _def_qtx='#undef USE_QTX_CODECS'
6273 _nocodecmodules="qtx $_nocodecmodules"
6275 echores "$_qtx"
6278 echocheck "Subtitles sorting"
6279 if test "$_sortsub" = yes ; then
6280 _def_sortsub='#define USE_SORTSUB 1'
6281 else
6282 _def_sortsub='#undef USE_SORTSUB'
6284 echores "$_sortsub"
6287 echocheck "XMMS inputplugin support"
6288 if test "$_xmms" = yes ; then
6290 if ( xmms-config --version ) >/dev/null 2>&1 ; then
6291 if test -z "$_xmmsplugindir" ; then
6292 _xmmsplugindir=`xmms-config --input-plugin-dir`
6294 if test -z "$_xmmslibdir" ; then
6295 _xmmslibdir=`xmms-config --exec-prefix`/lib
6297 else
6298 if test -z "$_xmmsplugindir" ; then
6299 _xmmsplugindir=/usr/lib/xmms/Input
6301 if test -z "$_xmmslibdir" ; then
6302 _xmmslibdir=/usr/lib
6306 _def_xmms='#define HAVE_XMMS 1'
6307 if darwin ; then
6308 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
6309 else
6310 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
6312 else
6313 _def_xmms='#undef HAVE_XMMS'
6315 echores "$_xmms"
6317 echocheck "inet6"
6318 if test "$_inet6" = auto ; then
6319 cat > $TMPC << EOF
6320 #include <sys/types.h>
6321 #include <sys/socket.h>
6322 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
6324 _inet6=no
6325 if cc_check ; then
6326 _inet6=yes
6329 if test "$_inet6" = yes ; then
6330 _def_inet6='#define HAVE_AF_INET6 1'
6331 else
6332 _def_inet6='#undef HAVE_AF_INET6'
6334 echores "$_inet6"
6337 echocheck "gethostbyname2"
6338 if test "$_gethostbyname2" = auto ; then
6339 cat > $TMPC << EOF
6340 #include <sys/types.h>
6341 #include <sys/socket.h>
6342 #include <netdb.h>
6343 int main(void) { gethostbyname2("", AF_INET); }
6345 _gethostbyname2=no
6346 if cc_check ; then
6347 _gethostbyname2=yes
6351 if test "$_gethostbyname2" = yes ; then
6352 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
6353 else
6354 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
6356 echores "$_gethostbyname2"
6358 # --------------- GUI specific tests begin -------------------
6359 echocheck "GUI"
6360 echo "$_gui"
6361 if test "$_gui" = yes ; then
6363 # Required libraries
6364 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
6365 test "$_x11" != yes && die "X11 support required for GUI compilation"
6367 echocheck "XShape extension"
6368 _xshape=no
6369 if test "$_x11" = yes ; then
6370 cat > $TMPC << EOF
6371 #include <X11/Xlib.h>
6372 #include <X11/Xproto.h>
6373 #include <X11/Xutil.h>
6374 #include <X11/extensions/shape.h>
6375 #include <stdlib.h>
6376 int main(void) {
6377 char *name = ":0.0";
6378 Display *wsDisplay;
6379 int exitvar = 0;
6380 int eventbase, errorbase;
6381 if (getenv("DISPLAY"))
6382 name=getenv("DISPLAY");
6383 wsDisplay=XOpenDisplay(name);
6384 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6385 exitvar=1;
6386 XCloseDisplay(wsDisplay);
6387 return exitvar;
6390 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6392 if test "$_xshape" = yes ; then
6393 _def_xshape='#define HAVE_XSHAPE 1'
6394 else
6395 die "The GUI requires the X11 extension XShape (which was not found)."
6397 echores "$_xshape"
6400 # Check for GTK:
6401 echocheck "GTK version"
6402 if test -z "$_gtkconfig" ; then
6403 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6404 _gtkconfig="gtk-config"
6405 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6406 _gtkconfig="gtk12-config"
6407 else
6408 die "The GUI requires GTK devel packages (which were not found)."
6411 _gtk=`$_gtkconfig --version 2>&1`
6412 _inc_gtk=`$_gtkconfig --cflags 2>&1`
6413 _ld_gtk=`$_gtkconfig --libs 2>&1`
6414 echores "$_gtk (using $_gtkconfig)"
6416 # Check for GLIB
6417 echocheck "glib version"
6418 if test -z "$_glibconfig" ; then
6419 if ( glib-config --version ) >/dev/null 2>&1 ; then
6420 _glibconfig="glib-config"
6421 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
6422 _glibconfig="glib12-config"
6423 else
6424 die "The GUI requires GLib devel packages (which were not found)"
6427 _glib=`$_glibconfig --version 2>&1`
6428 _inc_glib=`$_glibconfig --cflags 2>&1`
6429 _ld_glib=`$_glibconfig --libs 2>&1`
6430 echores "$_glib (using $_glibconfig)"
6432 _def_gui='#define HAVE_NEW_GUI 1'
6433 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6435 echo "Creating Gui/config.mak"
6436 cat > Gui/config.mak << EOF
6437 # -------- Generated by configure -----------
6439 GTKINC = $_inc_gtk
6440 GTKLIBS = $_ld_gtk
6441 GLIBINC = $_inc_glib
6442 GLIBLIBS = $_ld_glib
6446 else
6447 _def_gui='#undef HAVE_NEW_GUI'
6449 # --------------- GUI specific tests end -------------------
6453 #############################################################################
6455 # Checking for CFLAGS
6456 _stripbinaries=yes
6457 if test "$_profile" != "" || test "$_debug" != "" ; then
6458 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
6459 if test "$_cc_major" -ge "3" ; then
6460 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
6462 _stripbinaries=no
6463 elif test -z "$CFLAGS" ; then
6464 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
6465 # always compile with '-g' if .developer:
6466 if test -f ".developer" ; then
6467 CFLAGS="-g $CFLAGS"
6468 if (test "$_crash_debug" = auto) && (not mingw32) ; then
6469 _crash_debug=yes
6471 _stripbinaries=no
6473 else
6474 cat <<EOF
6476 MPlayer compilation will use the CFLAGS set by you, but:
6478 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6480 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6481 To do so, execute 'CFLAGS= ./configure <options>'
6486 echocheck "automatic gdb attach"
6487 if test "$_crash_debug" = yes ; then
6488 _def_crash_debug='#define CRASH_DEBUG 1'
6489 else
6490 _def_crash_debug='#undef CRASH_DEBUG'
6491 _crash_debug=no
6493 echores "$_crash_debug"
6495 if darwin ; then
6496 CFLAGS="$CFLAGS -DSYS_DARWIN"
6497 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
6498 CFLAGS="$CFLAGS -no-cpp-precomp"
6501 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
6502 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
6504 if hpux ; then
6505 # use flag for HPUX missing setenv()
6506 CFLAGS="$CFLAGS -DHPUX"
6508 # Thread support
6509 if linux ; then
6510 CFLAGS="$CFLAGS -D_REENTRANT"
6511 elif bsd ; then
6512 # FIXME bsd needs this so maybe other OS'es
6513 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6515 # 64 bit file offsets?
6516 if test "$_largefiles" = yes || freebsd ; then
6517 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6518 if test "$_dvdread" = yes ; then
6519 # dvdread support requires this (for off64_t)
6520 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6524 echocheck "compiler support for -fno-PIC"
6525 if x86; then
6526 cat > $TMPC <<EOF
6527 int main(void) { return 0; }
6529 if cc_check -fno-PIC ; then
6530 CFLAGS="-fno-PIC $CFLAGS"
6531 echores "yes"
6532 else
6533 echores "no"
6535 else
6536 echores "only used for x86"
6539 echocheck "ftello()"
6540 # if we don't have ftello use the osdep/ compatibility module
6541 cat > $TMPC << EOF
6542 #include <stdio.h>
6543 #include <sys/types.h>
6544 int main (void) { ftello(stdin); return 0; }
6546 _ftello=no
6547 cc_check && _ftello=yes
6548 if test "$_ftello" = yes ; then
6549 _def_ftello='#define HAVE_FTELLO 1'
6550 else
6551 _def_ftello='#undef HAVE_FTELLO'
6553 echores "$_ftello"
6555 # Determine OS dependent libs
6556 if cygwin ; then
6557 _def_confwin32='#define WIN32'
6558 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
6559 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
6560 CFLAGS="$CFLAGS -D__CYGWIN__"
6563 if win32 ; then
6564 _confwin32='TARGET_WIN32 = yes'
6565 else
6566 _confwin32='TARGET_WIN32 = no'
6569 # Dynamic linking flags
6570 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6571 _ld_dl_dynamic=''
6572 bsd && _ld_dl_dynamic='-rdynamic'
6573 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx ; then
6574 _ld_dl_dynamic='-rdynamic'
6577 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6578 bsdos && _ld_arch="$_ld_arch -ldvd"
6579 if netbsd ; then
6580 x86 && _ld_arch="$_ld_arch -li386"
6583 _def_debug='#undef MP_DEBUG'
6584 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
6586 _def_linux='#undef TARGET_LINUX'
6587 linux && _def_linux='#define TARGET_LINUX 1'
6589 # TODO cleanup the VIDIX stuff here
6590 _def_vidix='#define CONFIG_VIDIX 1'
6591 test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX'
6592 if test "$_vidix" = yes; then
6593 _vosrc="$_vosrc vo_cvidix.c"
6594 _vomodules="cvidix $_vomodules"
6595 else
6596 _novomodules="cvidix $_novomodules"
6598 if test "$_vidix" = yes && (win32); then
6599 _vosrc="$_vosrc vo_winvidix.c"
6600 _vomodules="winvidix $_vomodules"
6601 _ld_win32libs="-lgdi32 $_ld_win32libs"
6602 else
6603 _novomodules="winvidix $_novomodules"
6605 if test "$_vidix" = yes && test "$_x11" = yes; then
6606 _vosrc="$_vosrc vo_xvidix.c"
6607 _vomodules="xvidix $_vomodules"
6608 else
6609 _novomodules="xvidix $_novomodules"
6611 echo Checking for VIDIX ... "$_vidix"
6613 _def_joystick='#undef HAVE_JOYSTICK'
6614 if test "$_joystick" = yes ; then
6615 if linux ; then
6616 # TODO add some check
6617 _def_joystick='#define HAVE_JOYSTICK 1'
6618 else
6619 _joystick="no (unsupported under $system_name)"
6622 echo Checking for joystick ... "$_joystick"
6624 echocheck "lirc"
6625 if test "$_lirc" = auto ; then
6626 _lirc=no
6627 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
6628 cat > $TMPC <<EOF
6629 #include <lirc/lirc_client.h>
6630 int main(void) { return 0; }
6632 cc_check -llirc_client && _lirc=yes
6635 if test "$_lirc" = yes ; then
6636 _def_lirc='#define HAVE_LIRC 1'
6637 _ld_lirc='-llirc_client'
6638 else
6639 _def_lirc='#undef HAVE_LIRC'
6641 echores "$_lirc"
6643 echocheck "lircc"
6644 if test "$_lircc" = auto ; then
6645 _lircc=no
6646 cat > $TMPC <<EOF
6647 #include <lirc/lircc.h>
6648 int main(void) { return 0; }
6650 cc_check -llircc && _lircc=yes
6652 if test "$_lircc" = yes ; then
6653 _def_lircc='#define HAVE_LIRCC 1'
6654 _ld_lircc='-llircc'
6655 else
6656 _def_lircc='#undef HAVE_LIRCC'
6658 echores "$_lircc"
6660 #############################################################################
6661 echo "Creating config.mak"
6662 cat > config.mak << EOF
6663 # -------- Generated by configure -----------
6665 LANG = C
6666 MAN_LANG = $MAN_LANG
6667 TARGET_OS = $system_name
6668 DESTDIR =
6669 prefix = \$(DESTDIR)$_prefix
6670 BINDIR = \$(DESTDIR)$_bindir
6671 DATADIR = \$(DESTDIR)$_datadir
6672 MANDIR = \$(DESTDIR)$_mandir
6673 CONFDIR = \$(DESTDIR)$_confdir
6674 LIBDIR = \$(DESTDIR)$_libdir
6675 #AR = ar
6676 CC = $_cc
6677 HOST_CC = $_host_cc
6678 AWK = $_awk
6679 RANLIB = $_ranlib
6680 INSTALL = $_install
6681 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
6682 EXTRA_INC = $_inc_extra $_inc_gtk
6683 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
6684 STRIPBINARIES = $_stripbinaries
6685 CHARSET = $_charset
6686 HELP_FILE = $_mp_help
6688 PRG = $_prg
6689 PRG_MENCODER = $_prg_mencoder
6691 $_live_libs_def
6693 MPLAYER_NETWORK = $_network
6694 STREAMING_LIVE_DOT_COM = $_live
6695 MPLAYER_NETWORK_LIB = $_ld_live $_ld_vstream $_ld_network
6696 DVBIN = $_dvbin
6697 VIDIX = $_vidix
6698 SHARED_PP = $_shared_pp
6699 CONFIG_PP = yes
6700 CONFIG_RISKY = yes
6701 CONFIG_MP3LAME = $_mp3lame
6702 LIBMENU = $_menu
6703 I18NLIBS = $_i18n_libs
6704 MATROSKA = $_matroska_internal
6706 OPENDIVX = $_opendivx
6708 MP3LIB = $_mp3lib
6709 LIBA52 = $_liba52
6710 LIBMPEG2 = $_libmpeg2
6711 TREMOR = $_tremor_internal
6712 TREMOR_FLAGS = $_tremor_flags
6714 UNRARLIB = $_unrarlib
6715 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
6716 PNG = $_mkf_png
6717 JPEG = $_mkf_jpg
6718 GIF = $_mkf_gif
6720 EXTRA_LIB = $_ld_extra
6721 Z_LIB = $_ld_static $_ld_zlib
6722 HAVE_MLIB = $_mlib
6723 WIN32_LIB = $_ld_win32libs
6724 STATIC_LIB = $_ld_static
6725 ENCA_LIB = $_ld_enca
6726 HAVE_PTHREADS = $_pthreads
6727 MATH_LIB = $_ld_lm
6729 X11_INC = $_inc_x11
6730 X11DIR = $_ld_x11
6732 HAVE_XVMC_ACCEL = $_xvmc
6734 # for libavcodec:
6735 SRC_PATH=..
6736 LIBPREF=lib
6737 LIBSUF=.a
6738 SLIBPREF=lib
6739 SLIBSUF=.so
6741 # video output
6742 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
6743 GGI_LIB = $_ld_ggi
6744 MLIB_LIB = $_ld_mlib
6745 MLIB_INC = $_inc_mlib
6746 DXR2_INC = $_inc_dxr2
6747 DVB_INC = $_inc_dvb
6748 PNG_LIB = $_ld_png
6749 JPEG_LIB = $_ld_jpg
6750 GIF_LIB = $_ld_gif
6751 SDL_LIB = $_ld_sdl
6752 SVGA_LIB = $_ld_svga
6753 AA_LIB = $_ld_aa
6754 CACA_INC = $_inc_caca
6755 CACA_LIB = $_ld_caca
6757 # audio output
6758 ALSA_LIB = $_ld_alsa
6759 NAS_LIB = $_ld_nas
6760 ARTS_LIB = $_ld_arts
6761 ARTS_INC = $_inc_arts
6762 ESD_LIB = $_ld_esd
6763 ESD_INC = $_inc_esd
6764 POLYP_LIB = $_ld_polyp
6765 POLYP_INC = $_inc_polyp
6766 JACK_LIB = $_ld_jack
6767 JACK_INC = $_inc_jack
6768 SGIAUDIO_LIB = $_ld_sgiaudio
6770 # input/demuxer/codecs
6771 TERMCAP_LIB = $_ld_termcap
6772 LIRC_LIB = $_ld_lirc
6773 LIRCC_LIB = $_ld_lircc
6774 DVDREAD_LIB = $_ld_dvdread
6775 DVDKIT = $_dvdkit
6776 DVDKIT2 = $_dvdkit2
6777 DVDKIT_SHARED = no
6778 SDL_INC = $_inc_sdl
6779 W32_DEP = $_dep_win32
6780 W32_LIB = $_ld_win32
6781 DS_DEP = $_dep_dshow
6782 DS_LIB = $_ld_dshow
6783 AV_DEP = $_dep_libavcodec $_dep_libavformat
6784 AV_LIB = $_ld_libavcodec $_ld_libavformat
6785 CONFIG_LIBAVFORMAT = $_libavformat
6786 ZORAN = $_zr
6787 FAME = $_fame
6788 FAME_LIB = $_ld_fame
6789 MP1E_DEP = $_dep_mp1e
6790 MP1E_LIB = $_ld_mp1e
6791 ARCH_LIB = $_ld_arch $_ld_iconv
6792 XVID = $_xvid
6793 XVID_INC = $_inc_xvid
6794 XVID_LIB = $_ld_xvid
6795 X264 = $_x264
6796 X264_INC = $_inc_x264
6797 X264_LIB = $_ld_x264
6798 CONFIG_DTS = $_libdts
6799 DTS_INC = $_inc_libdts
6800 DTS_LIB = $_ld_libdts
6801 DECORE_LIB = $_ld_decore $_ld_mp3lame
6802 MENCODER = $_mencoder
6803 ENCORE_LIB = $_ld_encore $_ld_mp3lame
6804 DIRECTFB_INC = $_inc_directfb
6805 DIRECTFB_LIB = $_ld_directfb
6806 CDPARANOIA_INC = $_inc_cdparanoia
6807 CDPARANOIA_LIB = $_ld_cdparanoia
6808 FREETYPE_INC = $_inc_freetype
6809 FREETYPE_LIB = $_ld_freetype
6810 FONTCONFIG_INC = $_inc_fontconfig
6811 FONTCONFIG_LIB = $_ld_fontconfig
6812 FRIBIDI_INC = $_inc_fribidi
6813 FRIBIDI_LIB = $_ld_fribidi
6814 LIBLZO_LIB= $_ld_liblzo
6815 MAD_LIB = $_ld_mad
6816 VORBIS_LIB = $_ld_vorbis $_ld_libdv
6817 THEORA_LIB = $_ld_theora
6818 FAAD_LIB = $_ld_faad
6819 INTERNAL_FAAD = $_faad_internal
6820 SMBSUPPORT_LIB = $_ld_smb
6821 XMMS_PLUGINS = $_xmms
6822 XMMS_LIB = $_xmms_lib
6823 MACOSX = $_macosx
6824 MACOSX_FINDER_SUPPORT = $_macosx_finder_support
6825 MACOSX_FRAMEWORKS = $_macosx_frameworks
6826 TOOLAME=$_toolame
6827 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
6828 TOOLAME_LIB=$_toolame_lib
6829 AMR_NB=$_amr_nb
6830 AMR_NB_FIXED=$_amr_nb_fixed
6831 AMR_WB=$_amr_wb
6833 # --- Some stuff for autoconfigure ----
6834 $_target_arch
6835 $_confwin32
6836 TARGET_CPU=$iproc
6837 TARGET_MMX = $_mmx
6838 TARGET_MMX2 = $_mmx2
6839 TARGET_3DNOW = $_3dnow
6840 TARGET_3DNOWEX = $_3dnowex
6841 TARGET_SSE = $_sse
6842 TARGET_ALTIVEC = $_altivec
6843 TARGET_VIS = $_vis
6845 # --- GUI stuff ---
6846 GTKLIB = $_ld_static $_ld_gtk
6847 GLIBLIB = $_ld_static $_ld_glib
6848 GTK_LIBS = $_ld_static $_ld_gui
6849 GUI = $_gui
6850 DEBUG = -DDEBUG
6854 #############################################################################
6855 echo "Creating config.h"
6856 cat > config.h << EOF
6857 /* -------- This file has been automatically generated by configure ---------
6858 Note: Any changes in it will be lost when you run configure again. */
6860 /* Protect against multiple inclusion */
6861 #ifndef MPLAYER_CONFIG_H
6862 #define MPLAYER_CONFIG_H 1
6864 /* use GNU internationalization */
6865 $_def_i18n
6867 /* Runtime CPU detection */
6868 $_def_runtime_cpudetection
6870 /* Dynamic a/v plugins */
6871 $_def_dynamic_plugins
6873 /* "restrict" keyword */
6874 $_def_restrict_keyword
6876 /* __builtin_expect branch prediction hint */
6877 $_def_builtin_expect
6879 /* attribute(used) as needed by some compilers */
6880 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
6881 # define attribute_used __attribute__((used))
6882 #else
6883 # define attribute_used
6884 #endif
6886 #define PREFIX "$_prefix"
6888 #define USE_OSD 1
6889 #define USE_SUB 1
6891 /* enable/disable SIGHANDLER */
6892 $_def_sighandler
6894 /* enable/disable automatic gdb attach on crash, requires SIGHANDLER */
6895 $_def_crash_debug
6897 /* Toggles debugging informations */
6898 $_def_debug
6900 /* Indicates that Ogle's libdvdread is available for DVD playback */
6901 $_def_dvdread
6903 /* Indicates that dvdread is from libmpdvdkit */
6904 $_def_mpdvdkit
6906 /* Additional options for libmpdvdkit*/
6907 $_def_dvd
6908 $_def_cdrom
6909 $_def_cdio
6910 $_def_dvdio
6911 $_def_bsdi_dvd
6912 $_def_dvd_bsd
6913 $_def_dvd_linux
6914 $_dev_dvd_openbsd
6915 $_def_dvd_darwin
6916 $_def_sol_scsi_h
6917 $_def_hpux_scsi_h
6918 $_def_stddef
6920 /* Common data directory (for fonts, etc) */
6921 #define MPLAYER_DATADIR "$_datadir"
6922 #define MPLAYER_CONFDIR "$_confdir"
6923 #define MPLAYER_LIBDIR "$_libdir"
6925 /* Define this to compile stream-caching support, it can be enabled via
6926 -cache <kilobytes> */
6927 #define USE_STREAM_CACHE 1
6929 /* Define to include support for XviD/Divx4Linux/OpenDivx */
6930 $_def_divx
6932 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
6933 /* You have to change DECORE_LIBS in config.mak, too! */
6934 $_def_decore
6936 /* Define if you are using DivX5Linux Decore library */
6937 $_def_divx5
6939 /* Define if you are using XviD library */
6940 $_def_xvid3
6941 $_def_xvid4
6942 $_def_decore_xvid
6943 $_def_encore_xvid
6945 /* Define if you are using the X.264 library */
6946 $_def_x264
6948 /* Define to include support for libdv-0.9.5 */
6949 $_def_libdv
6951 /* If build mencoder */
6952 $_mencoder_flag
6954 /* Indicates if XviD/Divx4linux encore is available
6955 Note: for mencoder */
6956 $_def_encore
6958 /* Indicates if libmp3lame is available
6959 Note: for mencoder */
6960 $_def_mp3lame
6961 $_def_cfg_mp3lame
6963 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
6964 $_def_mp1e
6966 /* Define this to enable avg. byte/sec-based AVI sync method by default:
6967 (use -bps or -nobps commandline option for run-time method selection)
6968 -bps gives better sync for vbr mp3 audio, it is now default */
6969 #define AVI_SYNC_BPS 1
6971 /* Undefine this if you do not want to select mono audio (left or right)
6972 with a stereo MPEG layer 2/3 audio stream. The command line option
6973 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6974 right-only), with 0 being the default.
6976 #define USE_FAKE_MONO 1
6978 /* Undefine this if your sound card driver has no working select().
6979 If you have kernel Oops, player hangups, or just no audio, you should
6980 try to recompile MPlayer with this option disabled! */
6981 $_def_select
6983 /* define this to use iconv(3) function to codepage conversions */
6984 $_def_iconv
6986 /* define this to use nl_langinfo function */
6987 $_def_langinfo
6989 /* define this to use RTC (/dev/rtc) for video timers */
6990 $_def_rtc
6992 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
6993 #define MAX_OUTBURST 65536
6995 /* set up audio OUTBURST. Do not change this! */
6996 #define OUTBURST 512
6998 /* Define this if your system has the header file for the OSS sound interface */
6999 $_def_sys_soundcard
7001 /* Define this if your system has the header file for the OSS sound interface
7002 * in /usr/include */
7003 $_def_soundcard
7005 /* Define this if your system has the sysinfo header */
7006 $_def_sys_sysinfo
7008 /* Define this if your system has ftello() */
7010 $_def_ftello
7011 #ifndef HAVE_FTELLO
7012 /* Need these for FILE and off_t an config.h is usually before other includes*/
7013 #include <stdio.h>
7014 #include <sys/types.h>
7015 off_t ftello(FILE *);
7016 #endif
7018 /* Define this if your system has the "malloc.h" header file */
7019 $_def_malloc
7021 /* memalign is mapped to malloc if unsupported */
7022 $_def_memalign
7023 #ifndef HAVE_MEMALIGN
7024 # define memalign(a,b) malloc(b)
7025 #define MEMALIGN_HACK 1
7026 #endif
7028 /* Define this if your system has the "alloca.h" header file */
7029 $_def_alloca
7031 /* Define this if your system has the "sys/mman.h" header file */
7032 $_def_mman
7033 $_def_mman_has_map_failed
7035 /* Define this if you have the elf dynamic linker -ldl library */
7036 $_def_dl
7038 /* Define this if you have the kstat kernel statistics library */
7039 $_def_kstat
7041 /* Define this if you have zlib */
7042 $_def_zlib
7043 #ifdef HAVE_ZLIB
7044 #define CONFIG_ZLIB 1
7045 #endif
7047 /* Define this if you have shm support */
7048 $_def_shm
7050 /* Define this if your system has scandir & alphasort */
7051 $_def_scandir
7053 /* Define this if your system has strsep */
7054 $_def_strsep
7056 /* Define this if your system has strlcpy */
7057 $_def_strlcpy
7058 #ifndef HAVE_STRLCPY
7059 unsigned int strlcpy (char *dest, char *src, unsigned int size);
7060 #endif
7062 /* Define this if your system has strlcat */
7063 $_def_strlcat
7064 #ifndef HAVE_STRLCAT
7065 unsigned int strlcat (char *dest, char *src, unsigned int size);
7066 #endif
7068 /* Define this if your system has fseeko */
7069 $_def_fseeko
7070 #ifndef HAVE_FSEEKO
7071 /* Need these for FILE and off_t an config.h is usually before other includes*/
7072 #include <stdio.h>
7073 #include <sys/types.h>
7074 int fseeko(FILE *, off_t, int);
7075 #endif
7077 $_def_localtime_r
7079 /* Define this if your system has vsscanf */
7080 $_def_vsscanf
7082 /* Define this if your system has swab */
7083 $_def_swab
7085 /* Define this if your system has no posix select */
7086 $_def_no_posix_select
7088 /* Define this if your system has gettimeofday */
7089 $_def_gettimeofday
7091 /* Define this if your system has glob */
7092 $_def_glob
7094 /* Define this if your system has pthreads */
7095 $_def_pthreads
7097 /* Define this if you enabled thread support for libavcodec */
7098 $_def_threads
7100 /* LIRC (remote control, see www.lirc.org) support: */
7101 $_def_lirc
7104 * LIRCCD (LIRC client daemon)
7105 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
7107 $_def_lircc
7109 /* DVD navigation support using libdvdnav */
7110 $_def_dvdnav
7111 $_def_dvdnav_version
7113 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
7114 #define MPEG12_POSTPROC 1
7116 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
7117 $_def_ffpostprocess
7119 /* Define to include support for OpenDivx postprocessing */
7120 $_def_odivx_postprocess
7122 /* Win32 DLL support */
7123 $_def_win32
7124 #define WIN32_PATH "$_win32libdir"
7126 /* DirectShow support */
7127 $_def_dshow
7129 /* Mac OS X specific features */
7130 $_def_macosx
7131 $_def_macosx_finder_support
7133 /* Build our Win32-loader */
7134 $_def_win32_loader
7136 /* ffmpeg's libavcodec support (requires libavcodec source) */
7137 $_def_libavcodec
7138 $_def_libavcodecso
7140 /* ffmpeg's libavformat support (requires libavformat source) */
7141 $_def_libavformat
7142 $_def_libavformat_win32
7144 /* risky codecs */
7145 #define CONFIG_RISKY 1
7147 /* Use libavcodec's decoders */
7148 #define CONFIG_DECODERS 1
7149 /* Use libavcodec's encoders */
7150 #define CONFIG_ENCODERS 1
7152 #define CONFIG_MPEGAUDIO_HP 1
7154 /* Use amr codecs from libavcodec (requires amr sources) */
7155 $_def_amr_nb
7156 $_def_amr_nb_fixed
7157 $_def_amr_wb
7159 /* Use codec libs included in mplayer CVS / source dist: */
7160 $_def_mp3lib
7161 $_def_liba52
7162 $_def_libdts
7163 $_def_libmpeg2
7165 /* Use libfame encoder filter */
7166 $_def_fame
7168 /* XAnim DLL support */
7169 $_def_xanim
7170 /* Default search path */
7171 $_def_xanim_path
7173 /* RealPlayer DLL support */
7174 $_def_real
7175 /* Default search path */
7176 $_def_real_path
7178 /* LIVE.COM Streaming Media library support */
7179 $_def_live
7181 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
7182 $_def_fastmemcpy
7184 /* Use unrarlib for Vobsubs */
7185 $_def_unrarlib
7187 /* gui support, please do not edit this option */
7188 $_def_gui
7190 /* Audio output drivers */
7191 $_def_ossaudio
7192 $_def_ossaudio_devdsp
7193 $_def_ossaudio_devmixer
7194 $_def_alsa5
7195 $_def_alsa9
7196 $_def_alsa1x
7197 $_def_arts
7198 $_def_esd
7199 $_def_esd_latency
7200 $_def_polyp
7201 $_def_jack
7202 $_def_sys_asoundlib_h
7203 $_def_alsa_asoundlib_h
7204 $_def_sunaudio
7205 $_def_sgiaudio
7206 $_def_win32waveout
7207 $_def_nas
7209 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7210 #undef FAST_OSD
7211 #undef FAST_OSD_TABLE
7213 /* Enable TV Interface support */
7214 $_def_tv
7216 /* Enable EDL support */
7217 $_def_edl
7219 /* Enable Video 4 Linux TV interface support */
7220 $_def_tv_v4l
7222 /* Enable Video 4 Linux 2 TV interface support */
7223 $_def_tv_v4l2
7225 /* Enable *BSD BrookTree TV interface support */
7226 $_def_tv_bsdbt848
7228 /* Define if your processor stores words with the most significant
7229 byte first (like Motorola and SPARC, unlike Intel and VAX). */
7230 $_def_words_endian
7232 $_def_arch
7234 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
7235 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
7237 #ifdef ARCH_POWERPC
7238 #define ARCH_PPC 1
7239 #endif
7241 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
7242 #ifdef ARCH_ARMV4L
7243 #define ARCH_ARM 1
7244 #endif
7246 /* only gcc3 can compile mvi instructions */
7247 $_def_gcc_mvi_support
7249 /* Define this for Cygwin build for win32 */
7250 $_def_confwin32
7252 /* Define this to any prefered value from 386 up to infinity with step 100 */
7253 #define __CPU__ $iproc
7255 $_mp_wordsize
7257 $_def_linux
7259 $_def_vcd
7261 #ifdef sun
7262 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
7263 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7264 #elif defined(HPUX)
7265 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7266 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7267 #elif defined(WIN32)
7268 #define DEFAULT_CDROM_DEVICE "D:"
7269 #define DEFAULT_DVD_DEVICE "D:"
7270 #elif defined(SYS_DARWIN)
7271 #define DEFAULT_CDROM_DEVICE "/dev/disk1"
7272 #define DEFAULT_DVD_DEVICE "/dev/rdiskN"
7273 #elif defined(__OpenBSD__)
7274 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
7275 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
7276 #else
7277 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
7278 #define DEFAULT_DVD_DEVICE "/dev/dvd"
7279 #endif
7282 /*----------------------------------------------------------------------------
7284 ** NOTE: Instead of modifying these definitions here, use the
7285 ** --enable/--disable options of the ./configure script!
7286 ** See ./configure --help for details.
7288 *---------------------------------------------------------------------------*/
7290 /* C99 lrintf function available */
7291 $_def_lrintf
7293 /* yes, we have inttypes.h */
7294 #define HAVE_INTTYPES_H 1
7296 /* int_fastXY_t emulation */
7297 $_def_fast_inttypes
7299 /* nanosleep support */
7300 $_def_nanosleep
7302 /* SMB support */
7303 $_def_smbsupport
7305 /* termcap flag for getch2.c */
7306 $_def_termcap
7308 /* termios flag for getch2.c */
7309 $_def_termios
7310 $_def_termios_h
7311 $_def_termios_sys_h
7313 /* enable PNG support */
7314 $_def_png
7316 /* enable JPEG support */
7317 $_def_jpg
7319 /* enable PNM support */
7320 $_def_pnm
7322 /* enable md5sum support */
7323 $_def_md5sum
7325 /* enable GIF support */
7326 $_def_gif
7327 $_def_gif_4
7328 $_def_gif_tvt_hack
7330 /* enable FreeType support */
7331 $_def_freetype
7333 /* enable Fontconfig support */
7334 $_def_fontconfig
7336 /* enable FriBiDi usage */
7337 $_def_fribidi
7339 /* enable ENCA usage */
7340 $_def_enca
7342 /* liblzo support */
7343 $_def_liblzo
7345 /* libmad support */
7346 $_def_mad
7348 /* enable OggVorbis support */
7349 $_def_vorbis
7351 /* enable Tremor as vorbis decoder */
7352 $_def_tremor
7354 /* enable OggTheora support */
7355 $_def_theora
7357 /* enable Matroska support */
7358 $_def_matroska
7360 /* enable FAAD (AAC) support */
7361 $_def_faad
7362 $_def_faad_internal
7364 /* enable LADSPA plugin support */
7365 $_def_ladspa
7367 /* enable network */
7368 $_def_network
7370 /* enable ftp support */
7371 $_def_ftp
7373 /* enable vstream support */
7374 $_def_vstream
7376 /* enable winsock2 instead of Unix functions*/
7377 $_def_winsock2
7379 /* define this to use inet_aton() instead of inet_pton() */
7380 $_def_use_aton
7382 /* enables / disables cdparanoia support */
7383 $_def_cdparanoia
7385 /* enables / disables VIDIX usage */
7386 $_def_vidix
7388 /* enables / disables new input joystick support */
7389 $_def_joystick
7391 /* enables / disables QTX codecs */
7392 $_def_qtx
7394 /* enables / disables osd menu */
7395 $_def_menu
7397 /* enables / disables subtitles sorting */
7398 $_def_sortsub
7400 /* XMMS input plugin support */
7401 $_def_xmms
7402 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7404 /* enables inet6 support */
7405 $_def_inet6
7407 /* do we have gethostbyname2? */
7408 $_def_gethostbyname2
7410 /* Extension defines */
7411 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
7412 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
7413 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
7414 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
7415 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
7416 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
7417 $_def_altivec // only define if you have Altivec (G4)
7419 $_def_altivec_h // enables usage of altivec.h
7422 $_def_mlib // Sun mediaLib, available only on solaris
7423 $_def_vis // only define if you have VIS ( ultrasparc )
7425 /* libmpeg2 uses a different feature test macro for mediaLib */
7426 #ifdef HAVE_MLIB
7427 #define LIBMPEG2_MLIB 1
7428 #endif
7430 /* libvo options */
7431 #define SCREEN_SIZE_X 1
7432 #define SCREEN_SIZE_Y 1
7433 $_def_x11
7434 $_def_xv
7435 $_def_xvmc
7436 $_def_vm
7437 $_def_xf86keysym
7438 $_def_xinerama
7439 $_def_gl
7440 $_def_gl_win32
7441 $_def_dga
7442 $_def_dga2
7443 $_def_sdl
7444 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
7445 $_def_sdlbuggy
7446 $_def_directx
7447 $_def_ggi
7448 $_def_3dfx
7449 $_def_tdfxfb
7450 $_def_tdfxvid
7451 $_def_directfb
7452 $_def_directfb_version
7453 $_def_zr
7454 $_def_bl
7455 $_def_mga
7456 $_def_xmga
7457 $_def_syncfb
7458 $_def_fbdev
7459 $_def_dxr2
7460 $_def_dxr3
7461 $_def_dvb
7462 $_def_dvb_in
7463 $_def_svga
7464 $_def_vesa
7465 $_def_xdpms
7466 $_def_aa
7467 $_def_caca
7468 $_def_tga
7469 $_def_toolame
7471 /* used by GUI: */
7472 $_def_xshape
7474 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
7475 #define X11_FULLSCREEN 1
7476 #endif
7478 #endif /* MPLAYER_CONFIG_H */
7481 #############################################################################
7483 echo "Creating libvo/config.mak"
7484 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'`
7485 cat > libvo/config.mak << EOF
7486 include ../config.mak
7487 OPTIONAL_SRCS = $_vosrc
7488 OPTIONAL_OBJS = $_voobj
7491 #############################################################################
7493 echo "Creating libao2/config.mak"
7494 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
7495 cat > libao2/config.mak << EOF
7496 include ../config.mak
7497 OPTIONAL_SRCS = $_aosrc
7498 OPTIONAL_OBJS = $_aoobj
7501 #############################################################################
7503 echo "Creating libaf/config.mak"
7504 _afobj=`echo $_afsrc | sed -e 's/\.c/\.o/g'`
7505 cat > libaf/config.mak << EOF
7506 include ../config.mak
7507 OPTIONAL_SRCS = $_afsrc
7508 OPTIONAL_OBJS = $_afobj
7511 #############################################################################
7513 cat << EOF
7515 Config files successfully generated by ./configure !
7517 Install prefix: $_prefix
7518 Data directory: $_datadir
7519 Config direct.: $_confdir
7521 Byte order: $_byte_order
7522 Optimizing for: $_optimizing
7524 Languages:
7525 Messages/GUI: $_language
7528 echo -n " Manual pages: $MAN_LANG"
7529 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
7530 echo
7532 cat << EOF
7534 Enabled optional drivers:
7535 Input: $_inputmodules
7536 Codecs: $_codecmodules
7537 Audio output: $_aomodules
7538 Video output: $_vomodules
7539 Audio filters: $_afmodules
7540 Disabled optional drivers:
7541 Input: $_noinputmodules
7542 Codecs: $_nocodecmodules
7543 Audio output: $_noaomodules
7544 Video output: $_novomodules
7545 Audio filters: $_noafmodules
7547 'config.h' and 'config.mak' contain your configuration options.
7548 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7549 compile *** DO NOT REPORT BUGS if you tweak these files ***
7551 'make' will now compile MPlayer and 'make install' will install it.
7552 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7557 if test "$_mtrr" = yes ; then
7558 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/video.html#mtrr)"
7559 echo
7562 if test "$_sdl" = "outdated" ; then
7563 cat <<EOF
7564 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
7565 support has therefore been disabled.
7567 Please upgrade to a more recent version (version 1.1.8 and above are known to
7568 work). You may get this library from: http://www.libsdl.org
7570 You need to rerun ./configure and recompile after updating SDL. If you are
7571 only interested in the libSDL audio drivers, then an older version might work.
7573 Use --enable-sdl to force usage of libSDL.
7578 if x86; then
7579 if test "$_win32" = no ; then
7580 if test "$_win32libdir" ; then
7581 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
7582 else
7583 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
7585 cat << EOF
7586 Create it and copy the DLL files there! You can download the codecs from our
7587 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
7591 else
7592 cat <<EOF
7593 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7594 operating system ($system_name). You may encounter a few files that cannot
7595 be played due to missing open source video/audio codec support.
7601 cat <<EOF
7603 Check $TMPLOG if you wonder why an autodetection failed (check whether
7604 the development headers/packages are installed).
7606 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
7610 if test "$_vidix" = no ; then
7611 cat <<EOF
7612 You've disabled VIDIX. Although it would be better to PORT it instead.
7613 Have a look at the documentation for supported cards!
7618 # Last move:
7619 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"