fix Cyberblade VidiX driver TVOUT patch by Benjamin Zores <ben@tutuxclan.org>
[mplayer.git] / configure
blobcdd8ae31ba67a7849b48a8ed4c337f4cb69f54ba
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 "$?" ; }
74 # arch test boolean functions
75 # x86/x86pc is used by QNX
76 x86() {
77 case "$host_arch" in
78 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
79 *) return 1 ;;
80 esac
83 ppc() {
84 case "$host_arch" in
85 ppc) return 0;;
86 *) return 1;;
87 esac
90 alpha() {
91 case "$host_arch" in
92 alpha) return 0;;
93 *) return 1;;
94 esac
97 # not boolean test: implement the posix shell "!" operator for a
98 # non-posix /bin/sh.
99 # usage: not {command}
100 # returns exit status "success" when the execution of "command"
101 # fails.
102 not() {
103 eval "$@"
104 test $? -ne 0
107 # Use this before starting a check
108 echocheck() {
109 echo "============ Checking for $@ ============" >> "$TMPLOG"
110 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
113 # Use this to echo the results of a check
114 echores() {
115 echo "Result is: $@" >> "$TMPLOG"
116 echo "##########################################" >> "$TMPLOG"
117 echo "" >> "$TMPLOG"
118 echo "$@"
120 #############################################################################
122 # Check how echo works in this /bin/sh
123 case `echo -n` in
124 -n) _echo_n= _echo_c='\c' ;; # SysV echo
125 *) _echo_n='-n ' _echo_c= ;; # BSD echo
126 esac
128 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"`
130 for parm in "$@" ; do
131 if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
132 cat << EOF
134 Usage: $0 [OPTIONS]...
136 Configuration:
137 -h, --help display this help and exit
139 Installation directories:
140 --prefix=DIR use this prefix for installing mplayer [/usr/local]
141 --bindir=DIR use this prefix for installing mplayer binary
142 [PREFIX/bin]
143 --datadir=DIR use this prefix for installing machine independent
144 data files (fonts, skins) [PREFIX/share/mplayer]
145 --mandir=DIR use this prefix for installing manpages [PREFIX/man]
146 --confdir=DIR use this prefix for installing configuration files
147 [PREFIX/etc/mplayer]
148 --libdir=DIR use this prefix for object code libraries [PREFIX/lib]
150 Optional features:
151 --disable-mencoder disable mencoder (a/v encoder) compilation [enable]
152 --enable-gui enable gmplayer compilation (GTK 1.2 GUI) [disable]
153 --enable-largefiles enable support for files > 2 GBytes [disable]
154 --enable-linux-devfs set default devices to devfs ones [disable]
155 --enable-termcap use termcap database for key codes [autodetect]
156 --enable-termios use termios database for key codes [autodetect]
157 --disable-iconv do not use iconv(3) function [autodetect]
158 --disable-setlocale disable setlocale using in mplayer [autodetect]
159 --disable-langinfo do not use langinfo [autodetect]
160 --enable-lirc enable LIRC (remote control) support [autodetect]
161 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
162 --enable-joystick enable joystick support [disable]
163 --disable-tv disable TV Interface (tv/dvb grabbers) [enable]
164 --disable-tv-v4l disable Video4Linux TV Interface support [autodetect]
165 --disable-tv-v4l2 disable Video4Linux2 TV Interface support [autodetect]
166 --disable-tv-bsdbt848 disable BSD BT848 Interface support [autodetect]
167 --disable-edl disable EDL (edit decision list) support [enable]
168 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
169 --disable-network disable network support (for: http/mms/rtp) [enable]
170 --enable-winsock2 enable winsock2 usage [autodetect]
171 --enable-smb enable Samba (SMB) input support [autodetect]
172 --enable-live enable LIVE.COM Streaming Media support [autodetect]
173 --disable-dvdread Disable libdvdread support [autodetect]
174 --disable-mpdvdkit Disable mpdvdkit/mpdvdkit2 support [autodetect]
175 --disable-cdparanoia Disable cdparanoia support [autodetect]
176 --disable-freetype Disable freetype2 font rendering support [autodetect]
177 --disable-fontconfig Disable fontconfig font lookup support [autodetect]
178 --disable-unrarlib Disable Unique RAR File Library [enabled]
179 --enable-menu Enable OSD menu support (NOT DVD MENU) [disabled]
180 --disable-sortsub Disable subtitles sorting [enabled]
181 --enable-fribidi Enable using the FriBiDi libs [disabled]
182 --disable-enca Disable using ENCA charset oracle library [autodetect]
183 --disable-macosx Disable Mac OS X specific features [autodetect]
184 --disable-inet6 Disable IPv6 support [autodetect]
185 --disable-gethostbyname2 gethostbyname() function is not provided by the C
186 library [autodetect]
187 --disable-ftp Disable ftp support [enabled]
189 Codecs:
190 --enable-gif enable gif support [autodetect]
191 --enable-png enable png input/output support [autodetect]
192 --enable-jpeg enable jpeg input/output support [autodetect]
193 --enable-liblzo enable external liblzo support [autodetect]
194 --disable-win32 disable Win32 DLL support [autodetect]
195 --disable-macshlb disable Mac OS X SHLB support [autodetect]
196 --disable-dshow disable Win32/DirectShow support [autodetect]
197 --disable-qtx disable Quicktime codecs [autodetect]
198 --disable-xanim disable XAnim DLL support [autodetect]
199 --disable-real disable RealPlayer DLL support [autodetect]
200 --disable-xvid disable XviD codec [autodetect]
201 --disable-x264 disable H.264 encoder [autodetect]
202 --disable-divx4linux disable DivX4linux/Divx5linux codec [autodetect]
203 --enable-opendivx enable _old_ OpenDivx codec [disable]
204 --disable-libavcodec disable libavcodec [autodetect]
205 --disable-libavformat disable libavformat [autodetect]
206 --enable-libfame enable libfame realtime encoder [autodetect]
207 --enable-vorbis build with OggVorbis support [autodetect]
208 --enable-tremor build with integer-only OggVorbis support [disabled]
209 --enable-theora build with OggTheora support [autodetect]
210 --disable-internal-matroska disable internal Matroska support [enabled]
211 --enable-external-faad build with external FAAD2 (AAC) support [autodetect]
212 --disable-internal-faad disable internal FAAD2 (AAC) support [autodetect]
213 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
214 --disable-mad disable libmad (MPEG audio) support [autodetect]
215 --disable-toolame disable Toolame (MPEG layer 2 audio) support in mencoder [autodetect]
216 --enable-xmms build with XMMS inputplugin support [disabled]
217 --disable-mp3lib disable builtin mp3lib [enabled]
218 --disable-liba52 disable builtin liba52 [enabled]
219 --enable-libdts enable libdts support [autodetect]
220 --disable-libmpeg2 disable builtin libmpeg2 [enabled]
222 Video output:
223 --disable-vidix disable VIDIX [enable on x86 *nix]
224 --enable-gl build with OpenGL render support [autodetect]
225 --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect]
226 --enable-vesa build with VESA support [autodetect]
227 --enable-svga build with SVGAlib support [autodetect]
228 --enable-sdl build with SDL render support [autodetect]
229 --enable-aa build with AAlib render support [autodetect]
230 --enable-caca build with CACA render support [autodetect]
231 --enable-ggi build with GGI render support [autodetect]
232 --enable-directx build with DirectX support [autodetect]
233 --enable-dxr2 build with DXR2 render support [autodetect]
234 --enable-dxr3 build with DXR3/H+ render support [autodetect]
235 --enable-dvb build with support for output via DVB-Card [autodetect]
236 --enable-dvbhead build with DVB support (HEAD version) [autodetect]
237 --enable-mga build with mga_vid (for Matrox G200/G4x0/G550) support
238 (check for /dev/mga_vid) [autodetect]
239 --enable-xmga build with mga_vid X Window support
240 (check for X & /dev/mga_vid) [autodetect]
241 --enable-xv build with Xv render support for X 4.x [autodetect]
242 --enable-xvmc build with XvMC acceleration for X 4.x [autodetect]
243 --enable-vm build with XF86VidMode support for X11 [autodetect]
244 --enable-xinerama build with Xinerama support for X11 [autodetect]
245 --enable-x11 build with X11 render support [autodetect]
246 --enable-fbdev build with FBDev render support [autodetect]
247 --enable-mlib build with MLIB support (Solaris only) [autodetect]
248 --enable-3dfx build with obsolete /dev/3dfx support [disable]
249 --enable-tdfxfb build with tdfxfb (Voodoo 3/banshee) support [disable]
250 --enable-directfb build with DirectFB support [autodetect]
251 --enable-zr build with ZR360[56]7/ZR36060 support [autodetect]
252 --enable-bl build with Blinkenlights support [disable]
253 --enable-tdfxvid build with tdfx_vid support [disable]
254 --disable-tga disable targa output support [enable]
256 Audio output:
257 --disable-alsa disable ALSA sound support [autodetect]
258 --disable-ossaudio disable OSS sound support [autodetect]
259 --disable-arts disable aRts sound support [autodetect]
260 --disable-esd disable esd sound support [autodetect]
261 --disable-jack disable JACK sound support [autodetect]
262 --disable-nas disable NAS sound support [autodetect]
263 --disable-sgiaudio disable SGI sound support [autodetect]
264 --disable-sunaudio disable Sun sound support [autodetect]
265 --disable-win32waveout disable Windows waveout sound support [autodetect]
266 --disable-select disable using select() on audio device [enable]
268 Miscellaneous options:
269 --enable-runtime-cpudetection Enable runtime CPU detection [disable]
270 --cc=COMPILER use this C compiler to build MPlayer [gcc]
271 --host-cc=COMPILER use this C compiler to build apps needed for the build process [gcc]
272 --as=ASSEMBLER use this assembler to build MPlayer [as]
273 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
274 --enable-static build a statically linked binary. Set further linking
275 options with --enable-static="-lslang -lncurses"
276 --language=list a white space or comma separated list of languages
277 for translated man pages, the first language is the
278 primary and therefore used for translated messages
279 and GUI (also the environment variable \$LINGUAS is
280 honored) [en]
281 (Available: $LANGUAGES all)
282 --enable-shared-pp install & use shared postprocessing lib
283 --with-install=PATH use a custom install program (useful if your OS uses
284 a GNU-incompatible install utility by default and
285 you want to use GNU version)
286 --install-path=PATH the path to a custom install program
287 this option is obsolete and will be removed soon,
288 use --with-install instead.
290 Advanced options:
291 --enable-mmx build with MMX support [autodetect]
292 --enable-mmx2 build with MMX2 support (PIII, Athlon) [autodetect]
293 --enable-3dnow build with 3DNow! support [autodetect]
294 --enable-3dnowex build with extended 3DNow! support [autodetect]
295 --enable-sse build with SSE support [autodetect]
296 --enable-sse2 build with SSE2 support [autodetect]
297 --enable-shm build with shm support [autodetect]
298 --enable-altivec build with Altivec support (PowerPC) [autodetect]
299 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy() [enable]
300 --enable-big-endian Force byte order to big-endian [autodetect]
301 --enable-debug[=1-3] compile debugging information into mplayer [disable]
302 --enable-profile compile profiling information into mplayer [disable]
303 --disable-sighandler disable sighandler for crashes [enable]
304 --enable-i18n _experimental_ gnu gettext() support [autodetect]
305 --enable-dynamic-plugins Enable support for dynamic a/v plugins [disable]
307 Hazardous options a.k.a. "DO NOT REPORT ANY BUGS!"
308 --disable-gcc-checking disable gcc version checking [enable]
310 Use these options if autodetection fails (Options marked with (*) accept
311 multiple paths separated by ':'):
312 --with-extraincdir=DIR extra headers (png, mad, sdl, ...) in DIR (*)
313 --with-extralibdir=DIR extra library files (png, mad, sdl, ...) in DIR (*)
314 --with-x11incdir=DIR X headers in DIR (*)
315 --with-x11libdir=DIR X library files in DIR (*)
316 --with-dxr2incdir=DIR DXR2 headers in DIR (*)
317 --with-dvbincdir=DIR DVB headers in DIR (*)
318 --with-madlibdir=DIR libmad (libmad shared library) in DIR (*)
319 --with-mlibdir=DIR libmlib (MLIB support) in DIR (Solaris only)
320 --with-codecsdir=DIR Binary codec files in DIR
321 --with-win32libdir=DIR W*ndows DLL files in DIR
322 --with-xanimlibdir=DIR XAnim DLL files in DIR
323 --with-reallibdir=DIR RealPlayer DLL files in DIR
324 --with-xvidlibdir=DIR libxvidcore (XviD) in DIR (*)
325 --with-xvidincdir=DIR XviD header in DIR (*)
326 --with-x264libdir=DIR libx264 in DIR
327 --with-x264incdir=DIR x264 header in DIR
328 --with-dtslibdir=DIR libdts library in DIR (*)
329 --with-dtsincdir=DIR libdts header in DIR (*)
330 --with-livelibdir=DIR LIVE.COM Streaming Media libraries in DIR
331 --with-toolamedir=DIR path to Toolame library and include file
332 --with-xmmsplugindir=DIR XMMS plugins in DIR
333 --with-xmmslibdir=DIR libxmms.so.1 in DIR
334 --with-bio2jack=DIR libbio2jack.a in DIR
335 --with-cdparanoiaincdir=DIR cdparanoia headers in DIR (*)
336 --with-cdparanoialibdir=DIR cdparanoia libraries (libcdda_*) in DIR (*)
337 --with-xvmclib=NAME name of adapter-specific library (e.g. XvMCNVIDIA)
338 --with-termcaplib=NAME name of library with termcap functionality
339 name should be given without leading "lib"
340 checks for "termcap" and "tinfo"
342 --with-freetype-config=PATH path to freetype-config
343 (e.g. /opt/bin/freetype-config)
344 --with-fribidi-config=PATH path to fribidi-config
345 (e.g. /opt/bin/fribidi-config)
346 --with-glib-config=PATH path to glib*-config (e.g. /opt/bin/glib-config)
347 --with-gtk-config=PATH path to gtk*-config (e.g. /opt/bin/gtk-config)
348 --with-sdl-config=PATH path to sdl*-config (e.g. /opt/bin/sdl-config)
350 exit 0
352 done # for parm in ...
355 # 1st pass checking for vital options
356 _install=install
357 _ranlib=ranlib
358 _cc=cc
359 test "$CC" && _cc="$CC"
360 _as=auto
361 _runtime_cpudetection=no
362 for ac_option do
363 case "$ac_option" in
364 --target=*)
365 _target=`echo $ac_option | cut -d '=' -f 2`
367 --cc=*)
368 _cc=`echo $ac_option | cut -d '=' -f 2`
370 --host-cc=*)
371 _host_cc=`echo $ac_option | cut -d '=' -f 2`
373 --as=*)
374 _as=`echo $ac_option | cut -d '=' -f 2`
376 --enable-gcc-checking)
377 _skip_cc_check=no
379 --disable-gcc-checking)
380 _skip_cc_check=yes
382 --enable-static)
383 _ld_static='-static'
385 --disable-static)
386 _ld_static=''
388 --enable-static=*)
389 _ld_static="-static `echo $ac_option | cut -d '=' -f 2`"
391 --with-extraincdir=*)
392 _inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
394 --with-extralibdir=*)
395 _ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
397 --enable-runtime-cpudetection)
398 _runtime_cpudetection=yes
400 --disable-runtime-cpudetection)
401 _runtime_cpudetection=no
403 --install-path=*)
404 _install=`echo $ac_option | cut -d '=' -f 2 | sed 's/\/$//'`"/install"
406 --with-install=*)
407 _install=`echo $ac_option | cut -d '=' -f 2 `
409 esac
410 done
412 # Determine our OS name and CPU architecture
413 if test -z "$_target" ; then
414 # OS name
415 system_name=`( uname -s ) 2>&1`
416 case "$system_name" in
417 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
419 IRIX*)
420 system_name=IRIX
422 HP-UX*)
423 system_name=HP-UX
425 [cC][yY][gG][wW][iI][nN]*)
426 system_name=CYGWIN
428 MINGW32*)
429 system_name=MINGW32
431 MorphOS)
432 system_name=MorphOS
435 system_name="$system_name-UNKNOWN"
437 esac
440 # host's CPU/instruction set
441 host_arch=`( uname -p ) 2>&1`
442 case "$host_arch" in
443 i386|sparc|ppc|alpha|arm|mips|vax)
445 powerpc) # Darwin returns 'powerpc'
446 host_arch=ppc
448 *) # uname -p on Linux returns 'unknown' for the processor type,
449 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
451 # Maybe uname -m (machine hardware name) returns something we
452 # recognize.
454 # x86/x86pc is used by QNX
455 case "`( uname -m ) 2>&1`" in
456 i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686) host_arch=i386 ;;
457 ia64) host_arch=ia64 ;;
458 x86_64|amd64) host_arch=x86_64 ;;
459 macppc|ppc) host_arch=ppc ;;
460 alpha) host_arch=alpha ;;
461 sparc) host_arch=sparc ;;
462 sparc64) host_arch=sparc64 ;;
463 parisc*|hppa*|9000*) host_arch=hppa ;;
464 arm*) host_arch=arm ;;
465 s390) host_arch=s390 ;;
466 s390x) host_arch=s390x ;;
467 mips) host_arch=mips ;;
468 vax) host_arch=vax ;;
469 *) host_arch=UNKNOWN ;;
470 esac
472 esac
473 else
474 system_name=`echo $_target | cut -d '-' -f 2`
475 case "`echo $system_name | tr A-Z a-z`" in
476 linux) system_name=Linux ;;
477 freebsd) system_name=FreeBSD ;;
478 netbsd) system_name=NetBSD ;;
479 bsd/os) system_name=BSD/OS ;;
480 openbsd) system_name=OpenBSD ;;
481 sunos) system_name=SunOS ;;
482 qnx) system_name=QNX ;;
483 morphos) system_name=MorphOS ;;
484 mingw32msvc) system_name=MINGW32 ;;
485 esac
486 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
487 host_arch=`echo $_target | cut -d '-' -f 1 | tr '_' '-'`
490 echo "Detected operating system: $system_name"
491 echo "Detected host architecture: $host_arch"
493 # LGB: temporary files
494 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
495 test "$I" && break
496 done
498 TMPLOG="configure.log"
499 rm -f "$TMPLOG"
500 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
501 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
502 TMPO="$I/mplayer-conf-$RANDOM-$$.o"
503 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
505 # config files
507 # FIXME: A lot of stuff is installed under /usr/local
508 # NK: But we should never use this stuff implicitly since we call compiler
509 # from /usr we should be sure that there no effects from other compilers
510 # (libraries) which might be installed into /usr/local. Let users use this
511 # stuff explicitly as command line argument. In other words: It would be
512 # resonable to have only /usr/include or only /usr/local/include.
514 if freebsd ; then
515 _ld_extra="$_ld_extra -L/usr/local/lib"
516 _inc_extra="$_inc_extra -I/usr/local/include"
519 if netbsd ; then
520 for I in `echo $_ld_extra | sed 's/-L//g'` ; do
521 tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
522 done
523 _ld_extra=$tmp
526 _ldd=ldd
527 if darwin; then
528 _ldd="otool -L"
531 # Checking CC version...
532 if test "$_skip_cc_check" != yes ; then
533 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
534 if test "`basename $_cc`" = "icc" || test "`basename $_cc`" = "ecc"; then
535 echocheck "$_cc version"
536 cc_vendor=intel
537 cc_name=`( $_cc -V ) 2>&1 | head -1 | cut -d ',' -f 1`
538 cc_version=`( $_cc -V ) 2>&1 | head -1 | cut -d ',' -f 2 | cut -d ' ' -f 3`
539 _cc_major=`echo $cc_version | cut -d '.' -f 1`
540 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
541 # TODO verify older icc/ecc compatibility
542 case $cc_version in
544 cc_version="v. ?.??, bad"
545 cc_verc_fail=yes
547 8.0)
548 cc_version="$cc_version, ok"
549 cc_verc_fail=no
552 cc_version="$cc_version, bad"
553 cc_verc_fail=yes
555 esac
556 echores "$cc_version"
557 else
558 for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
559 echocheck "$_cc version"
560 cc_vendor=gnu
561 cc_name=`( $_cc -v ) 2>&1 | tail -1 | cut -d ' ' -f 1`
562 cc_version=`( $_cc -dumpversion ) 2>&1`
563 if test "$?" -gt 0; then
564 cc_version="not found"
566 case $cc_version in
568 cc_version="v. ?.??, bad"
569 cc_verc_fail=yes
571 2.95.[2-9]|2.95.[2-9][-.]*|3.[0-9]|3.[0-9].[0-9])
572 _cc_major=`echo $cc_version | cut -d '.' -f 1`
573 _cc_minor=`echo $cc_version | cut -d '.' -f 2`
574 _cc_mini=`echo $cc_version | cut -d '.' -f 3`
575 cc_version="$cc_version, ok"
576 cc_verc_fail=no
578 'not found')
579 cc_verc_fail=yes
582 cc_version="$cc_version, bad"
583 cc_verc_fail=yes
585 esac
586 echores "$cc_version"
587 (test "$cc_verc_fail" = "no") && break
588 done
589 fi # icc
590 if test "$cc_verc_fail" = yes ; then
591 cat <<EOF
593 *** Please downgrade/upgrade C compiler to version gcc-2.95.x or gcc-3.x! ***
595 You are not using a supported compiler. We do not have the time to make sure
596 everything works with compilers other than the ones we use. Use either the
597 same compiler as we do, or use --disable-gcc-checking but DO *NOT* REPORT BUGS
598 unless you can reproduce them after recompiling with a 2.95.x or 3.x version!
600 Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
601 mplayer and lame (which is used for mencoder). If you get compile errors,
602 first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
603 If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
604 bugs!
606 GCC 2.96 IS NOT AND WILL NOT BE SUPPORTED BY US !
608 *** For details please read DOCS/HTML/en/users-vs-dev.html ***
611 die "Bad gcc version"
613 else
614 cat <<EOF
616 ******************************************************************************
618 Hmm. You really want to compile MPlayer with an *UNSUPPORTED* C compiler?
619 Ok. You know. Do it. Did you read DOCS/HTML/en/users-vs-dev.html???
621 DO NOT SEND BUGREPORTS OR COMPLAIN, it's *YOUR* compiler's fault!
622 Get ready for mysterious crashes, no-picture bugs, strange noises... REALLY!
623 Lame which is used by mencoder produces weird errors, too.
625 If you have any problem, install a GCC 2.95.x or 3.x version and try again.
626 If the problem _still_ exists, then read DOCS/HTML/en/bugreports.html !
628 *** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
630 ******************************************************************************
634 read _answer
637 echocheck "host cc"
638 if not test "$_host_cc" ; then
639 _host_cc=$_cc
641 echores $_host_cc
644 # ---
646 # now that we know what compiler should be used for compilation, try to find
647 # out which assembler is used by the $_cc compiler
648 if test "$_as" = auto ; then
649 _as=`$_cc -print-prog-name=as`
650 test -z "$_as" && _as=as
653 # XXX: this should be ok..
654 _cpuinfo="echo"
655 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
656 # FIXME: Remove the cygwin check once AMD CPUs are supported
657 if test -r /proc/cpuinfo && not cygwin; then
658 # Linux with /proc mounted, extract CPU information from it
659 _cpuinfo="cat /proc/cpuinfo"
660 elif test -r /compat/linux/proc/cpuinfo && not x86 ; then
661 # FreeBSD with Linux emulation /proc mounted,
662 # extract CPU information from it
663 _cpuinfo="cat /compat/linux/proc/cpuinfo"
664 elif darwin ; then
665 # use hostinfo on Darwin
666 _cpuinfo="hostinfo"
667 elif x86; then
668 # all other OSes try to extract CPU information from a small helper
669 # program TOOLS/cpuinfo instead
670 $_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
671 _cpuinfo="TOOLS/cpuinfo"
674 case "$host_arch" in
675 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
676 _def_arch="#define ARCH_X86 1"
677 _target_arch="TARGET_ARCH_X86 = yes"
679 pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -1`
680 pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
681 pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
682 pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
683 pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -1`
685 pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2 | head -1`
686 if test -z "$pparam" ; then
687 pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2 | head -1`
690 _mmx=no
691 _3dnow=no
692 _3dnowex=no
693 _mmx2=no
694 _sse=no
695 _sse2=no
696 _mtrr=no
698 for i in $pparam ; do
699 case "$i" in
700 3dnow) _3dnow=yes ;;
701 3dnowext) _3dnow=yes _3dnowex=yes ;;
702 mmx) _mmx=yes ;;
703 mmxext) _mmx2=yes ;;
704 mtrr|k6_mtrr|cyrix_arr) _mtrr=yes ;;
705 xmm|sse|kni) _sse=yes _mmx2=yes ;;
706 sse2) _sse2=yes ;;
707 esac
708 done
710 echocheck "CPU vendor"
711 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
713 echocheck "CPU type"
714 echores "$pname"
716 case "$pvendor" in
717 AuthenticAMD)
718 case "$pfamily" in
719 3) proc=i386 iproc=386 ;;
720 4) proc=i486 iproc=486 ;;
721 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
722 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
723 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
724 proc=k6-3
725 elif test "$pmodel" -ge 8; then
726 proc=k6-2
727 elif test "$pmodel" -ge 6; then
728 proc=k6
729 else
730 proc=i586
731 iproc=586
734 6) iproc=686
735 if test "$pmodel" -ge 7; then
736 proc=athlon-4
737 elif test "$pmodel" -ge 6; then
738 # only Athlon XP supports ssem MP, Duron etc not
739 # but most of them are CPUID 666, so check if sse detected
740 # btw. there is also athlon-mp opt, but we need extended
741 # CPUID to detect if CPU is SMP capable -> athlon-mp ::atmos
742 if test "$_sse" = yes && test "$pstepping" -ge 2; then
743 proc=athlon-xp
744 else
745 proc=athlon-4
747 elif test "$pmodel" -ge 4; then
748 proc=athlon-tbird
749 else
750 proc=athlon # TODO: should the Duron Spitfire be considered a Thunderbird instead?
754 *) proc=athlon-xp iproc=686 ;;
755 esac
757 GenuineIntel)
758 case "$pfamily" in
759 3) proc=i386 iproc=386 ;;
760 4) proc=i486 iproc=486 ;;
761 5) iproc=586
762 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
763 proc=pentium-mmx # 4 is desktop, 8 is mobile
764 else
765 proc=i586
768 6) iproc=686
769 if test "$pmodel" -ge 7; then
770 proc=pentium3
771 elif test "$pmodel" -ge 3; then
772 proc=pentium2
773 else
774 proc=i686
777 15) proc=pentium4 iproc=686 ;;
778 *) proc=pentium4 iproc=686 ;;
779 esac
781 unknown)
782 case "$pfamily" in
783 3) proc=i386 iproc=386 ;;
784 4) proc=i486 iproc=486 ;;
785 *) proc=i586 iproc=586 ;;
786 esac
789 proc=i586 iproc=586 ;;
790 esac
792 # check that gcc supports our CPU, if not, fall back to earlier ones
793 # LGB: check -mcpu and -march swithing step by step with enabling
794 # to fall back till 386.
796 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
798 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
799 cpuopt=-mtune
800 else
801 cpuopt=-mcpu
804 echocheck "GCC & CPU optimization abilities"
805 cat > $TMPC << EOF
806 int main(void) { return 0; }
808 if test "$_runtime_cpudetection" = no ; then
809 if test "$proc" = "athlon-xp" || test "$proc" = "athlon-4" || test "$proc" = "athlon-tbird"; then
810 cc_check -march=$proc $cpuopt=$proc || proc=athlon
812 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
813 cc_check -march=$proc $cpuopt=$proc || proc=k6
815 if test "$proc" = "k6"; then
816 if not cc_check -march=$proc $cpuopt=$proc; then
817 if cc_check -march=i586 $cpuopt=i686; then
818 proc=i586-i686
819 else
820 proc=i586
824 if test "$proc" = "pentium4" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon"; then
825 cc_check -march=$proc $cpuopt=$proc || proc=i686
827 if test "$proc" = "i686" || test "$proc" = "pentium-mmx"; then
828 cc_check -march=$proc $cpuopt=$proc || proc=i586
830 if test "$proc" = "i586" ; then
831 cc_check -march=$proc $cpuopt=$proc || proc=i486
833 if test "$proc" = "i486" ; then
834 cc_check -march=$proc $cpuopt=$proc || proc=i386
836 if test "$proc" = "i386" ; then
837 cc_check -march=$proc $cpuopt=$proc || proc=error
839 if test "$proc" = "error" ; then
840 echores "Your $_cc does not even support \"i386\" for '-march' and '$cpuopt'."
841 _mcpu=""
842 _march=""
843 _optimizing=""
844 elif test "$proc" = "i586-i686"; then
845 _march="-march=i586"
846 _mcpu="$cpuopt=i686"
847 _optimizing="$proc"
848 else
849 _march="-march=$proc"
850 _mcpu="$cpuopt=$proc"
851 _optimizing="$proc"
853 else
854 # i686 is probably the most common CPU - optimize for it
855 _mcpu="$cpuopt=i686"
856 # at least i486 required, for bswap instruction
857 _march="-march=i486"
858 cc_check $_mcpu || _mcpu=""
859 cc_check $_march $_mcpu || _march=""
862 ## Gabucino : --target takes effect here (hopefully...) by overwriting
863 ## autodetected mcpu/march parameters
864 if test "$_target" ; then
865 # TODO: it may be a good idea to check GCC and fall back in all cases
866 if test "$host_arch" = "i586-i686"; then
867 _march="-march=i586"
868 _mcpu="$cpuopt=i686"
869 else
870 _march="-march=$host_arch"
871 _mcpu="$cpuopt=$host_arch"
874 proc="$host_arch"
876 case "$proc" in
877 i386) iproc=386 ;;
878 i486) iproc=486 ;;
879 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
880 i686|athlon*|pentium*) iproc=686 ;;
881 *) iproc=586 ;;
882 esac
885 echores "$proc"
888 ia64)
889 _def_arch='#define ARCH_IA64 1'
890 _target_arch='TARGET_ARCH_IA64 = yes'
891 iproc='ia64'
892 proc=''
893 _march=''
894 _mcpu=''
895 _optimizing=''
898 x86_64|amd64)
899 _def_arch='#define ARCH_X86_64 1'
900 _target_arch='TARGET_ARCH_X86_64 = yes'
901 iproc='x86_64'
902 proc=''
903 _march=''
904 _mcpu=''
905 _optimizing=''
908 sparc)
909 _def_arch='#define ARCH_SPARC 1'
910 _target_arch='TARGET_ARCH_SPARC = yes'
911 iproc='sparc'
912 if sunos ; then
913 echocheck "CPU type"
914 karch=`uname -m`
915 case "`echo $karch`" in
916 sun4) proc=v7 ;;
917 sun4c) proc=v7 ;;
918 sun4d) proc=v8 ;;
919 sun4m) proc=v8 ;;
920 sun4u) proc=v9 _vis='yes' _def_vis='#define HAVE_VIS = yes' ;;
921 *) ;;
922 esac
923 echores "$proc"
924 else
925 proc=v8
927 _march=''
928 _mcpu="-mcpu=$proc"
929 _optimizing="$proc"
932 sparc64)
933 _def_arch='#define ARCH_SPARC 1'
934 _target_arch='TARGET_ARCH_SPARC = yes'
935 _vis='yes'
936 _def_vis='#define HAVE_VIS = yes'
937 iproc='sparc'
938 proc='v9'
939 _march=''
940 _mcpu="-mcpu=$proc"
941 _optimizing="$proc"
944 arm|armv4l|armv5tel)
945 _def_arch='#define ARCH_ARMV4L 1'
946 _target_arch='TARGET_ARCH_ARMV4L = yes'
947 iproc='arm'
948 proc=''
949 _march=''
950 _mcpu=''
951 _optimizing=''
954 ppc)
955 _def_arch='#define ARCH_POWERPC 1'
956 _target_arch='TARGET_ARCH_POWERPC = yes'
957 iproc='ppc'
958 proc=''
959 _march=''
960 _mcpu=''
961 _optimizing=''
962 _altivec=no
964 echocheck "CPU type"
965 if linux && test -n "$_cpuinfo"; then
966 proc=`$_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -1`
967 if test -n "`$_cpuinfo | grep altivec`"; then
968 _altivec=yes
971 if darwin ; then
972 proc=`$_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//'`
973 if [ `sysctl -n hw.vectorunit` -eq 1 ]; then
974 _altivec=yes
975 elif [ "`sysctl -n hw.optional.altivec 2>/dev/null`" = 1 ]; then
976 _altivec=yes
979 # only gcc 3.4 works reliably with altivec code under netbsd
980 if netbsd ; then
981 case $cc_version in
982 2*|3.0*|3.1*|3.2*|3.3*)
985 if [ `sysctl -n machdep.altivec` -eq 1 ]; then
986 _altivec=yes
989 esac
991 if test "$_altivec" = yes; then
992 echores "$proc altivec"
993 else
994 echores "$proc"
997 echocheck "GCC & CPU optimization abilities"
999 if test -n "$proc"; then
1000 case "$proc" in
1001 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
1002 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
1003 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
1004 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
1005 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
1006 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
1007 *) ;;
1008 esac
1009 # gcc 3.1(.1) and up supports 7400 and 7450
1010 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1"; then
1011 case "$proc" in
1012 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
1013 7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
1014 *) ;;
1015 esac
1017 # gcc 3.2 and up supports 970
1018 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3"; then
1019 case "$proc" in
1020 970*) _march='-mcpu=970' _mcpu='-mtune=970' ;;
1021 *) ;;
1022 esac
1026 if test -n "$_mcpu"; then
1027 _optimizing=`echo $_mcpu | cut -c 8-`
1028 echores "$_optimizing"
1029 else
1030 echores "none"
1035 alpha)
1036 _def_arch='#define ARCH_ALPHA 1'
1037 _target_arch='TARGET_ARCH_ALPHA = yes'
1038 iproc='alpha'
1039 _march=''
1041 echocheck "CPU type"
1042 cat > $TMPC << EOF
1043 int main() {
1044 unsigned long ver, mask;
1045 asm ("implver %0" : "=r" (ver));
1046 asm ("amask %1, %0" : "=r" (mask) : "r" (-1));
1047 printf("%ld-%x\n", ver, ~mask);
1048 return 0;
1051 $_cc -o "$TMPO" "$TMPC"
1052 case `"$TMPO"` in
1054 0-0) proc="ev4"; cpu_understands_mvi="0";;
1055 1-0) proc="ev5"; cpu_understands_mvi="0";;
1056 1-1) proc="ev56"; cpu_understands_mvi="0";;
1057 1-101) proc="pca56"; cpu_understands_mvi="1";;
1058 2-303) proc="ev6"; cpu_understands_mvi="1";;
1059 2-307) proc="ev67"; cpu_understands_mvi="1";;
1060 2-1307) proc="ev68"; cpu_understands_mvi="1";;
1061 esac
1062 echores "$proc"
1064 echocheck "GCC & CPU optimization abilities"
1065 if test "$proc" = "ev68" ; then
1066 cc_check -mcpu=$proc || proc=ev67
1068 if test "$proc" = "ev67" ; then
1069 cc_check -mcpu=$proc || proc=ev6
1071 _mcpu="-mcpu=$proc"
1072 echores "$proc"
1074 _optimizing="$proc"
1076 echocheck "MVI instruction support in GCC"
1077 if test "$_cc_major" -ge "3" && test "$cpu_understands_mvi" = "1" ; then
1078 _def_gcc_mvi_support="#define CAN_COMPILE_ALPHA_MVI 1"
1079 echores "yes"
1080 else
1081 _def_gcc_mvi_support="#undef CAN_COMPILE_ALPHA_MVI"
1082 echores "no, GCC = `( $_cc -dumpversion ) 2>&1` (must be >= 3), CPU = $proc (must be pca56 or later)"
1086 mips)
1087 _def_arch='#define ARCH_SGI_MIPS 1'
1088 _target_arch='TARGET_ARCH_SGI_MIPS = yes'
1089 iproc='sgi-mips'
1090 proc=''
1091 _march=''
1092 _mcpu=''
1093 _optimizing=''
1095 if irix ; then
1096 echocheck "CPU type"
1097 proc=`hinv -c processor | grep CPU | cut -d " " -f3`
1098 case "`echo $proc`" in
1099 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
1100 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
1101 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
1102 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
1103 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
1104 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
1105 esac
1106 echores "$proc"
1111 hppa)
1112 _def_arch='#define ARCH_PA_RISC 1'
1113 _target_arch='TARGET_ARCH_PA_RISC = yes'
1114 iproc='PA-RISC'
1115 proc=''
1116 _march=''
1117 _mcpu=''
1118 _optimizing=''
1121 s390)
1122 _def_arch='#define ARCH_S390 1'
1123 _target_arch='TARGET_ARCH_S390 = yes'
1124 iproc='390'
1125 proc=''
1126 _march=''
1127 _mcpu=''
1128 _optimizing=''
1131 s390x)
1132 _def_arch='#define ARCH_S390X 1'
1133 _target_arch='TARGET_ARCH_S390X = yes'
1134 iproc='390x'
1135 proc=''
1136 _march=''
1137 _mcpu=''
1138 _optimizing=''
1141 vax)
1142 _def_arch='#define ARCH_VAX 1'
1143 _target_arch='TARGET_ARCH_VAX = yes'
1144 iproc='vax'
1145 proc=''
1146 _march=''
1147 _mcpu=''
1148 _optimizing=''
1152 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
1153 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
1154 die "unsupported architecture $host_arch"
1156 esac
1158 if test "$_runtime_cpudetection" = yes ; then
1159 if x86; then
1160 _mmx=yes
1161 _3dnow=yes
1162 _3dnowex=yes
1163 _mmx2=yes
1164 _sse=yes
1165 _sse2=yes
1166 _mtrr=yes
1168 if ppc; then
1169 _altivec=yes
1173 if x86 && test "$_runtime_cpudetection" = no ; then
1174 extcheck() {
1175 if test "$1" = yes ; then
1176 echocheck "kernel support of $2"
1177 cat > $TMPC <<EOF
1178 #include <signal.h>
1179 void catch() { exit(1); }
1180 int main(void){
1181 signal(SIGILL, catch);
1182 __asm__ __volatile__ ("$3":::"memory");return(0);
1186 if ( cc_check && $TMPO ) > /dev/null 2>&1 ; then
1187 echores "yes"
1188 _optimizing="$_optimizing $2"
1189 return 0
1190 else
1191 echores "failed"
1192 echo "It seems that your kernel does not correctly support $2."
1193 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1194 return 1
1197 return 0
1200 extcheck $_mmx "mmx" "emms" || _mmx=no
1201 extcheck $_mmx2 "mmx2" "sfence" || _mmx2=no
1202 extcheck $_3dnow "3dnow" "femms" || _3dnow=no
1203 extcheck $_3dnowex "3dnowex" "pswapd %%mm0, %%mm0" || _3dnowex=no
1204 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _sse=no _gcc3_ext="$_gcc3_ext -mno-sse"
1205 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _sse2=no _gcc3_ext="$_gcc3_ext -mno-sse2"
1206 echocheck "mtrr support"
1207 echores "$_mtrr"
1209 if test "$_mtrr" = yes ; then
1210 _optimizing="$_optimizing mtrr"
1213 if test "$_gcc3_ext" != ""; then
1214 # if we had to disable sse/sse2 because the active kernel does not
1215 # support this instruction set extension, we also have to tell
1216 # gcc3 to not generate sse/sse2 instructions for normal C code
1217 cat > $TMPC << EOF
1218 int main(void) { return 0; }
1220 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1225 echocheck "assembler support of -pipe option"
1226 cat > $TMPC << EOF
1227 int main(void) { return 0; }
1229 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
1231 _prefix="/usr/local"
1232 _xvmclib="XvMCNVIDIA"
1234 # GOTCHA: the variables below defines the default behavior for autodetection
1235 # and have - unless stated otherwise - at least 2 states : yes no
1236 # If autodetection is available then the third state is: auto
1237 _libavcodec=auto
1238 _libavcodecso=auto
1239 _libavformat=auto
1240 _fame=auto
1241 _mp1e=no
1242 _mencoder=yes
1243 _x11=auto
1244 _dga=auto # 1 2 no auto
1245 _xv=auto
1246 _xvmc=no #auto when complete
1247 _sdl=auto
1248 _directx=auto
1249 _win32waveout=auto
1250 _nas=auto
1251 _png=auto
1252 _jpg=auto
1253 _gif=auto
1254 _gl=auto
1255 _ggi=auto
1256 _aa=auto
1257 _caca=auto
1258 _svga=auto
1259 _vesa=auto
1260 _fbdev=auto
1261 _dvb=auto
1262 _dvbhead=auto
1263 _dxr2=auto
1264 _dxr3=auto
1265 _iconv=auto
1266 _langinfo=auto
1267 _rtc=auto
1268 _ossaudio=auto
1269 _arts=auto
1270 _esd=auto
1271 _jack=auto
1272 _liblzo=auto
1273 _mad=auto
1274 _toolame=auto
1275 _vorbis=auto
1276 _theora=auto
1277 _mp3lib=yes
1278 _liba52=yes
1279 _libdts=auto
1280 _libmpeg2=yes
1281 _matroska_internal=yes
1282 _tremor=no
1283 _faad_internal=auto
1284 _faad_external=auto
1285 _xmms=no
1286 # dvdnav disabled, it does not work
1287 #_dvdnav=no
1288 _dvdread=auto
1289 _dvdkit=auto
1290 _xanim=auto
1291 _real=auto
1292 _live=auto
1293 _xinerama=auto
1294 _mga=auto
1295 _xmga=auto
1296 _vm=auto
1297 _mlib=auto
1298 _sgiaudio=auto
1299 _sunaudio=auto
1300 _alsa=auto
1301 _fastmemcpy=yes
1302 _unrarlib=yes
1303 _macshlb=auto
1304 _win32=auto
1305 _dshow=yes
1306 _select=yes
1307 _tv=yes
1308 _tv_v4l=auto
1309 _tv_v4l2=auto
1310 _tv_bsdbt848=auto
1311 _edl=yes
1312 _network=yes
1313 _winsock2=auto
1314 _smbsupport=auto
1315 _vidix=auto
1316 _joystick=no
1317 _xvid=auto
1318 _x264=auto
1319 _divx4linux=auto
1320 _opendivx=no
1321 _lirc=auto
1322 _lircc=auto
1323 _gui=no
1324 _termcap=auto
1325 _termios=auto
1326 _3dfx=no
1327 _tdfxfb=no
1328 _tdfxvid=no
1329 _tga=yes
1330 _directfb=auto
1331 _zr=auto
1332 _bl=no
1333 _largefiles=no
1334 #_language=en
1335 _shm=auto
1336 _linux_devfs=no
1337 _i18n=auto
1338 _dynamic_plugins=no
1339 _setlocale=auto
1340 _sighandler=yes
1341 _libdv=auto
1342 _cdparanoia=auto
1343 _big_endian=auto
1344 _freetype=auto
1345 _fontconfig=auto
1346 _shared_pp=no
1347 _menu=no
1348 _qtx=auto
1349 _macosx=auto
1350 _sortsub=yes
1351 _freetypeconfig='freetype-config'
1352 _fribidi=no
1353 _fribidiconfig='fribidi-config'
1354 _enca=auto
1355 _inet6=auto
1356 _gethostbyname2=auto
1357 _ftp=yes
1358 for ac_option do
1359 case "$ac_option" in
1360 # Skip 1st pass
1361 --target=*) ;;
1362 --cc=*) ;;
1363 --host-cc=*) ;;
1364 --as=*) ;;
1365 --enable-gcc-checking) ;;
1366 --disable-gcc-checking) ;;
1367 --enable-static*) ;;
1368 --disable-static*) ;;
1369 --with-extraincdir=*) ;;
1370 --with-extralibdir=*) ;;
1371 --enable-runtime-cpudetection) ;;
1372 --disable-runtime-cpudetection) ;;
1373 --install-path=*) ;;
1374 --with-install=*) ;;
1376 # Real 2nd pass
1377 --enable-mencoder) _mencoder=yes ;;
1378 --disable-mencoder) _mencoder=no ;;
1379 --enable-i18n) _i18n=yes ;;
1380 --disable-i18n) _i18n=no ;;
1381 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
1382 --disable-dynamic-plugins) _dynamic_plugins=no ;;
1383 --enable-setlocale) _setlocale=yes ;;
1384 --disable-setlocale) _setlocale=no ;;
1385 --enable-x11) _x11=yes ;;
1386 --disable-x11) _x11=no ;;
1387 --enable-xv) _xv=yes ;;
1388 --disable-xv) _xv=no ;;
1389 --enable-xvmc) _xvmc=yes ;;
1390 --disable-xvmc) _xvmc=no ;;
1391 --enable-sdl) _sdl=yes ;;
1392 --disable-sdl) _sdl=no ;;
1393 --enable-directx) _directx=yes ;;
1394 --disable-directx) _directx=no ;;
1395 --enable-win32waveout) _win32waveout=yes ;;
1396 --disable-win32waveout) _win32waveout=no ;;
1397 --enable-nas) _nas=yes ;;
1398 --disable-nas) _nas=no ;;
1399 --enable-png) _png=yes ;;
1400 --disable-png) _png=no ;;
1401 --enable-jpeg) _jpg=yes ;;
1402 --disable-jpeg) _jpg=no ;;
1403 --enable-gif) _gif=yes ;;
1404 --disable-gif) _gif=no ;;
1405 --enable-gl) _gl=yes ;;
1406 --disable-gl) _gl=no ;;
1407 --enable-ggi) _ggi=yes ;;
1408 --disable-ggi) _ggi=no ;;
1409 --enable-aa) _aa=yes ;;
1410 --disable-aa) _aa=no ;;
1411 --enable-caca) _caca=yes ;;
1412 --disable-caca) _caca=no ;;
1413 --enable-svga) _svga=yes ;;
1414 --disable-svga) _svga=no ;;
1415 --enable-vesa) _vesa=yes ;;
1416 --disable-vesa) _vesa=no ;;
1417 --enable-fbdev) _fbdev=yes ;;
1418 --disable-fbdev) _fbdev=no ;;
1419 --enable-dvb) _dvb=yes ;;
1420 --disable-dvb) _dvb=no ;;
1421 --enable-dvbhead) _dvbhead=yes ;;
1422 --disable-dvbhead) _dvbhead=no ;;
1423 --enable-dxr2) _dxr2=yes ;;
1424 --disable-dxr2) _dxr2=no ;;
1425 --enable-dxr3) _dxr3=yes ;;
1426 --disable-dxr3) _dxr3=no ;;
1427 --enable-iconv) _iconv=yes ;;
1428 --disable-iconv) _iconv=no ;;
1429 --enable-langinfo) _langinfo=yes ;;
1430 --disable-langinfo) _langinfo=no ;;
1431 --enable-rtc) _rtc=yes ;;
1432 --disable-rtc) _rtc=no ;;
1433 --enable-mp1e) _mp1e=yes ;;
1434 --disable-mp1e) _mp1e=no ;;
1435 --enable-libdv) _libdv=yes ;;
1436 --disable-libdv) _libdv=no ;;
1437 --enable-ossaudio) _ossaudio=yes ;;
1438 --disable-ossaudio) _ossaudio=no ;;
1439 --enable-arts) _arts=yes ;;
1440 --disable-arts) _arts=no ;;
1441 --enable-esd) _esd=yes ;;
1442 --disable-esd) _esd=no ;;
1443 --enable-jack) _jack=yes ;;
1444 --disable-jack) _jack=no ;;
1445 --enable-mad) _mad=yes ;;
1446 --disable-mad) _mad=no ;;
1447 --disable-toolame) _toolame=no ;;
1448 --enable-liblzo) _liblzo=yes ;;
1449 --disable-liblzo) _liblzo=no ;;
1450 --enable-vorbis) _vorbis=yes ;;
1451 --disable-vorbis) _vorbis=no ;;
1452 --enable-tremor) _tremor=yes ;;
1453 --disable-tremor) _tremor=no ;;
1454 --enable-theora) _theora=yes ;;
1455 --disable-theora) _theora=no ;;
1456 --enable-mp3lib) _mp3lib=yes ;;
1457 --disable-mp3lib) _mp3lib=no ;;
1458 --enable-liba52) _liba52=yes ;;
1459 --disable-liba52) _liba52=no ;;
1460 --enable-libdts) _libdts=yes ;;
1461 --disable-libdts) _libdts=no ;;
1462 --enable-libmpeg2) _libmpeg2=yes ;;
1463 --disable-libmpeg2) _libmpeg2=no ;;
1464 --enable-internal-matroska) _matroska_internal=yes ;;
1465 --disable-internal-matroska) _matroska_internal=no ;;
1466 --enable-internal-faad) _faad_internal=yes _faad_external=no ;;
1467 --disable-internal-faad) _faad_internal=no ;;
1468 --enable-external-faad) _faad_external=yes _faad_internal=no ;;
1469 --disable-external-faad) _faad_external=no ;;
1470 --enable-xmms) _xmms=yes ;;
1471 --disable-xmms) _xmms=no ;;
1472 --enable-dvdread) _dvdread=yes ;;
1473 --disable-dvdread) _dvdread=no ;;
1474 --enable-mpdvdkit) _dvdkit=yes ;;
1475 --disable-mpdvdkit) _dvdkit=no ;;
1476 # dvdnav disabled, it does not work
1477 # --enable-dvdnav) _dvdnav=yes ;;
1478 # --disable-dvdnav) _dvdnav=no ;;
1479 --enable-xanim) _xanim=yes ;;
1480 --disable-xanim) _xanim=no ;;
1481 --enable-real) _real=yes ;;
1482 --disable-real) _real=no ;;
1483 --enable-live) _live=yes ;;
1484 --disable-live) _live=no ;;
1485 --enable-xinerama) _xinerama=yes ;;
1486 --disable-xinerama) _xinerama=no ;;
1487 --enable-mga) _mga=yes ;;
1488 --disable-mga) _mga=no ;;
1489 --enable-xmga) _xmga=yes ;;
1490 --disable-xmga) _xmga=no ;;
1491 --enable-vm) _vm=yes ;;
1492 --disable-vm) _vm=no ;;
1493 --enable-mlib) _mlib=yes ;;
1494 --disable-mlib) _mlib=no ;;
1495 --enable-sunaudio) _sunaudio=yes ;;
1496 --disable-sunaudio) _sunaudio=no ;;
1497 --enable-sgiaudio) _sgiaudio=yes ;;
1498 --disable-sgiaudio) _sgiaudio=no ;;
1499 --enable-alsa) _alsa=yes ;;
1500 --disable-alsa) _alsa=no ;;
1501 --enable-tv) _tv=yes ;;
1502 --disable-tv) _tv=no ;;
1503 --enable-edl) _edl=yes ;;
1504 --disable-edl) _edl=no ;;
1505 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1506 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1507 --enable-tv-v4l) _tv_v4l=yes ;;
1508 --disable-tv-v4l) _tv_v4l=no ;;
1509 --enable-tv-v4l2) _tv_v4l2=yes ;;
1510 --disable-tv-v4l2) _tv_v4l2=no ;;
1511 --enable-fastmemcpy) _fastmemcpy=yes ;;
1512 --disable-fastmemcpy) _fastmemcpy=no ;;
1513 --enable-network) _network=yes ;;
1514 --disable-network) _network=no ;;
1515 --enable-winsock2) _winsock2=yes ;;
1516 --disable-winsock2) _winsock2=no ;;
1517 --enable-smb) _smbsupport=yes ;;
1518 --disable-smb) _smbsupport=no ;;
1519 --enable-vidix) _vidix=yes ;;
1520 --disable-vidix) _vidix=no ;;
1521 --enable-joystick) _joystick=yes ;;
1522 --disable-joystick) _joystick=no ;;
1523 --enable-xvid) _xvid=yes ;;
1524 --disable-xvid) _xvid=no ;;
1525 --enable-x264) _x264=yes ;;
1526 --disable-x264) _x264=no ;;
1527 --enable-divx4linux) _divx4linux=yes ;;
1528 --disable-divx4linux) _divx4linux=no ;;
1529 --enable-opendivx) _opendivx=yes ;;
1530 --disable-opendivx) _opendivx=no ;;
1531 --enable-libavcodec) _libavcodec=yes ;;
1532 --disable-libavcodec) _libavcodec=no ;;
1533 --enable-libavformat) _libavformat=yes;;
1534 --disable-libavformat) _libavformat=no ;;
1535 --enable-libfame) _fame=yes ;;
1536 --disable-libfame) _fame=no ;;
1537 --enable-lirc) _lirc=yes ;;
1538 --disable-lirc) _lirc=no ;;
1539 --enable-lircc) _lircc=yes ;;
1540 --disable-lircc) _lircc=no ;;
1541 --enable-gui) _gui=yes ;;
1542 --disable-gui) _gui=no ;;
1543 --enable-termcap) _termcap=yes ;;
1544 --disable-termcap) _termcap=no ;;
1545 --enable-termios) _termios=yes ;;
1546 --disable-termios) _termios=no ;;
1547 --enable-3dfx) _3dfx=yes ;;
1548 --disable-3dfx) _3dfx=no ;;
1549 --enable-tdfxfb) _tdfxfb=yes ;;
1550 --disable-tdfxvid) _tdfxvid=no ;;
1551 --enable-tdfxvid) _tdfxvid=yes ;;
1552 --disable-tga) _tga=no ;;
1553 --enable-tga) _tga=yes ;;
1554 --disable-tdfxfb) _tdfxfb=no ;;
1555 --enable-directfb) _directfb=yes ;;
1556 --disable-directfb) _directfb=no ;;
1557 --enable-zr) _zr=yes ;;
1558 --disable-zr) _zr=no ;;
1559 --enable-bl) _bl=yes ;;
1560 --disable-bl) _bl=no ;;
1561 --enable-mtrr) _mtrr=yes ;;
1562 --disable-mtrr) _mtrr=no ;;
1563 --enable-largefiles) _largefiles=yes ;;
1564 --disable-largefiles) _largefiles=no ;;
1565 --enable-shm) _shm=yes ;;
1566 --disable-shm) _shm=no ;;
1567 --enable-select) _select=yes ;;
1568 --disable-select) _select=no ;;
1569 --enable-linux-devfs) _linux_devfs=yes ;;
1570 --disable-linux-devfs) _linux_devfs=no ;;
1571 --enable-cdparanoia) _cdparanoia=yes ;;
1572 --disable-cdparanoia) _cdparanoia=no ;;
1573 --enable-big-endian) _big_endian=yes ;;
1574 --disable-big-endian) _big_endian=no ;;
1575 --enable-freetype) _freetype=yes ;;
1576 --disable-freetype) _freetype=no ;;
1577 --enable-fontconfig) _fontconfig=yes ;;
1578 --disable-fontconfig) _fontconfig=no ;;
1579 --enable-unrarlib) _unrarlib=yes ;;
1580 --disable-unrarlib) _unrarlib=no ;;
1581 --enable-ftp) _ftp=yes ;;
1582 --disable-ftp) _ftp=no ;;
1584 --enable-fribidi) _fribidi=yes ;;
1585 --disable-fribidi) _fribidi=no ;;
1587 --enable-enca) _enca=yes ;;
1588 --disable-enca) _enca=no ;;
1590 --enable-inet6) _inet6=yes ;;
1591 --disable-inet6) _inet6=no ;;
1593 --enable-gethostbyname2) _gethostbyname2=yes ;;
1594 --disable-gethostbyname2) _gethostbyname2=no ;;
1596 --enable-dga) _dga=auto ;; # as we don't know if it's 1 or 2
1597 --enable-dga=*) _dga=`echo $ac_option | cut -d '=' -f 2` ;;
1598 --disable-dga) _dga=no ;;
1600 --enable-shared-pp) _shared_pp=yes ;;
1601 --disable-shared-pp) _shared_pp=no ;;
1603 --enable-menu) _menu=yes ;;
1604 --disable-menu) _menu=no ;;
1606 --enable-qtx) _qtx=yes ;;
1607 --disable-qtx) _qtx=no ;;
1609 --enable-macosx) _macosx=yes ;;
1610 --disable-macosx) _macosx=no ;;
1612 --enable-sortsub) _sortsub=yes ;;
1613 --disable-sortsub) _sortsub=no ;;
1615 --language=*)
1616 _language=`echo $ac_option | cut -d '=' -f 2`
1618 # dvdnav disabled, it does not work
1619 # --with-libdvdnav=*)
1620 # _dvdnavdir=`echo $ac_option | cut -d '=' -f 2`
1621 # _dvdnav=yes
1622 # ;;
1624 --with-codecsdir=*)
1625 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1626 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1627 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1629 --with-win32libdir=*)
1630 _win32libdir=`echo $ac_option | cut -d '=' -f 2`
1631 _win32=yes
1633 --with-xanimlibdir=*)
1634 _xanimlibdir=`echo $ac_option | cut -d '=' -f 2`
1635 _xanim=yes
1637 --with-reallibdir=*)
1638 _reallibdir=`echo $ac_option | cut -d '=' -f 2`
1639 _real=yes
1641 --with-livelibdir=*)
1642 _livelibdir=`echo $ac_option | cut -d '=' -f 2`
1644 --with-toolamedir=*)
1645 _toolamedir=`echo $ac_option | cut -d '=' -f 2`
1647 --with-mlibdir=*)
1648 _mlibdir=`echo $ac_option | cut -d '=' -f 2`
1649 _mlib=yes
1652 --with-xmmslibdir=*)
1653 _xmmslibdir=`echo $ac_option | cut -d '=' -f 2`
1656 --with-xmmsplugindir=*)
1657 _xmmsplugindir=`echo $ac_option | cut -d '=' -f 2`
1660 --with-bio2jack=*)
1661 _bio2jackdir=`echo $ac_option | cut -d '=' -f 2`
1664 --enable-profile)
1665 _profile='-p'
1667 --disable-profile)
1668 _profile=
1670 --enable-debug)
1671 _debug='-g'
1673 --enable-debug=*)
1674 _debug=`echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2`
1676 --disable-debug)
1677 _debug=
1679 --enable-sighandler)
1680 _sighandler=yes
1682 --disable-sighandler)
1683 _sighandler=no
1686 --enable-sse) _sse=yes ;;
1687 --disable-sse) _sse=no ;;
1688 --enable-sse2) _sse2=yes ;;
1689 --disable-sse2) _sse2=no ;;
1690 --enable-mmx2) _mmx2=yes ;;
1691 --disable-mmx2) _mmx2=no ;;
1692 --enable-3dnow) _3dnow=yes ;;
1693 --disable-3dnow) _3dnow=no _3dnowex=no ;;
1694 --enable-3dnowex) _3dnow=yes _3dnowex=yes ;;
1695 --disable-3dnowex) _3dnowex=no ;;
1696 --enable-altivec) _altivec=yes ;;
1697 --disable-altivec) _altivec=no ;;
1698 --enable-mmx) _mmx=yes ;;
1699 --disable-mmx) # 3Dnow! and MMX2 require MMX
1700 _3dnow=no _3dnowex=no _mmx=no _mmx2=no ;;
1702 --enable-macshlb) _macshlb=yes ;;
1703 --disable-macshlb) _macshlb=no ;;
1704 --enable-win32) _win32=yes ;;
1705 --disable-win32) _win32=no _dshow=no ;;
1706 --enable-dshow) _win32=yes _dshow=yes ;;
1707 --disable-dshow) _dshow=no ;;
1709 --with-x11incdir=*)
1710 _inc_x11=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1712 --with-x11libdir=*)
1713 _ld_x11=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1715 --with-dxr2incdir=*)
1716 _inc_dxr2=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1718 --with-xvmclib=*)
1719 _xvmclib=`echo $ac_option | cut -d '=' -f 2`
1721 --with-dvbincdir=*)
1722 _inc_dvb=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1724 --with-xvidlibdir=*)
1725 _ld_xvid=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1727 --with-xvidincdir=*)
1728 _inc_xvid=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1730 --with-dtslibdir=*)
1731 _ld_libdts=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1733 --with-dtsincdir=*)
1734 _inc_libdts=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1736 --with-x264libdir=*)
1737 _ld_x264=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1739 --with-x264incdir=*)
1740 _inc_x264=-I`echo $ac_option | cut -d '=' -f 2 |sed 's,:, -I,g'`
1742 --with-sdl-config=*)
1743 _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
1745 --with-freetype-config=*)
1746 _freetypeconfig=`echo $ac_option | cut -d '=' -f 2`
1748 --with-fribidi-config=*)
1749 _fribidiconfig=`echo $ac_option | cut -d '=' -f 2`
1751 --with-gtk-config=*)
1752 _gtkconfig=`echo $ac_option | cut -d '=' -f 2`
1754 --with-glib-config=*)
1755 _glibconfig=`echo $ac_option | cut -d '=' -f 2`
1757 # dvdnav disabled, it does not work
1758 # --with-dvdnav-config=*)
1759 # _dvdnavconfig=`echo $ac_option | cut -d '=' -f 2`
1760 # ;;
1761 --with-madlibdir=*)
1762 _ld_mad=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1764 --with-cdparanoiaincdir=*)
1765 _inc_cdparanoia=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
1767 --with-cdparanoialibdir=*)
1768 _ld_cdparanoia=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
1770 --with-termcaplib=*)
1771 _ld_termcap=-l`echo $ac_option | cut -d '=' -f 2`
1772 _termcap=yes
1774 --prefix=*)
1775 _prefix=`echo $ac_option | cut -d '=' -f 2`
1777 --bindir=*)
1778 _bindir=`echo $ac_option | cut -d '=' -f 2`
1780 --datadir=*)
1781 _datadir=`echo $ac_option | cut -d '=' -f 2`
1783 --mandir=*)
1784 _mandir=`echo $ac_option | cut -d '=' -f 2`
1786 --confdir=*)
1787 _confdir=`echo $ac_option | cut -d '=' -f 2`
1789 --libdir=*)
1790 _libdir=`echo $ac_option | cut -d '=' -f 2`
1794 echo "Unknown parameter: $ac_option"
1795 exit 1
1798 esac
1799 done
1801 # Atmos: moved this here, to be correct, if --prefix is specified
1802 test -z "$_bindir" && _bindir="$_prefix/bin"
1803 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1804 test -z "$_mandir" && _mandir="$_prefix/man"
1805 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1806 test -z "$_libdir" && _libdir="$_prefix/lib"
1807 test -z "$_mlibdir" && _mlibdir="$MLIBHOME"
1809 if x86 ; then
1810 # Checking assembler (_as) compatibility...
1811 # Added workaround for older as that reads from stdin by default - atmos
1812 as_version=`echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p'`
1813 echocheck "assembler ($_as $as_version)"
1815 _pref_as_version='2.9.1'
1816 echo 'nop' > $TMPS
1817 if test "$_mmx" = yes ; then
1818 echo 'emms' >> $TMPS
1820 if test "$_3dnow" = yes ; then
1821 _pref_as_version='2.10.1'
1822 echo 'femms' >> $TMPS
1824 if test "$_3dnowex" = yes ; then
1825 _pref_as_version='2.10.1'
1826 echo 'pswapd %mm0, %mm0' >> $TMPS
1828 if test "$_mmx2" = yes ; then
1829 _pref_as_version='2.10.1'
1830 echo 'movntq %mm0, (%eax)' >> $TMPS
1832 if test "$_sse" = yes ; then
1833 _pref_as_version='2.10.1'
1834 echo 'xorps %xmm0, %xmm0' >> $TMPS
1836 #if test "$_sse2" = yes ; then
1837 # _pref_as_version='2.11'
1838 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
1840 $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
1842 if test "$as_verc_fail" != yes ; then
1843 echores "ok"
1844 else
1845 echores "failed"
1846 echo "Upgrade binutils to ${_pref_as_version} ..."
1847 die "obsolete binutils version"
1851 if ppc ; then
1853 # check if altivec is supported by the compiler, and how to enable it
1855 _altivec_gcc_flags=''
1857 if test "$_altivec" = yes -o "$_runtime_cpudetection" = yes ; then
1858 echocheck "GCC altivec support"
1860 p=''
1861 cat > $TMPC << EOF
1862 int main() {
1863 return 0;
1866 FSF_flags='-maltivec -mabi=altivec'
1867 Darwin_flags='-faltivec'
1869 # check for Darwin-style flags first, since
1870 # gcc-3.3 (August Update from Apple) on MacOS 10.2.8
1871 # accepts but ignores FSF-style flags...
1873 if test -z "$p"; then
1874 cc_check $Darwin_flags && p='Darwin'
1876 if test -z "$p"; then
1877 cc_check $FSF_flags && p='FSF'
1880 case $p in
1881 FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
1882 Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
1883 *) _altivec=no ;;
1884 esac
1886 if test -z "$p"; then
1887 p=none
1888 else
1889 p="$p-style ($_altivec_gcc_flags)"
1892 echores "$p"
1895 # check if <altivec.h> should be included
1897 _def_altivec_h='#undef HAVE_ALTIVEC_H'
1899 if test "$_altivec" = yes ; then
1900 echocheck "altivec.h"
1901 cat > $TMPC << EOF
1902 #include <altivec.h>
1903 int main(void) { return 0; }
1905 _have_altivec_h=no
1906 cc_check $_altivec_gcc_flags && _have_altivec_h=yes
1907 if test "$_have_altivec_h" = yes ; then
1908 _def_altivec_h='#define HAVE_ALTIVEC_H 1'
1910 echores "$_have_altivec_h"
1913 # disable runtime cpudetection if
1914 # - we cannot generate altivec code
1915 # - altivec is disabled by the user
1917 if test "$_runtime_cpudetection" = yes -a "$_altivec" = no ; then
1918 _runtime_cpudetection=no
1921 # show that we are optimizing for altivec (if enabled and supported)
1923 if test "$_runtime_cpudetection" = no -a "$_altivec" = yes ; then
1924 _optimizing="$_optimizing altivec"
1927 # if altivec is enabled, make sure the correct flags turn up in CFLAGS
1929 if test "$_altivec" = yes ; then
1930 _mcpu="$_mcpu $_altivec_gcc_flags"
1933 # setup _def_altivec correctly
1935 if test "$_altivec" = yes ; then
1936 _def_altivec='#define HAVE_ALTIVEC 1'
1937 else
1938 _def_altivec='#undef HAVE_ALTIVEC'
1942 _def_mmx='#undef HAVE_MMX'
1943 test "$_mmx" = yes && _def_mmx='#define HAVE_MMX 1'
1944 _def_mmx2='#undef HAVE_MMX2'
1945 test "$_mmx2" = yes && _def_mmx2='#define HAVE_MMX2 1'
1946 _def_3dnow='#undef HAVE_3DNOW'
1947 test "$_3dnow" = yes && _def_3dnow='#define HAVE_3DNOW 1'
1948 _def_3dnowex='#undef HAVE_3DNOWEX'
1949 test "$_3dnowex" = yes && _def_3dnowex='#define HAVE_3DNOWEX 1'
1950 _def_sse='#undef HAVE_SSE'
1951 test "$_sse" = yes && _def_sse='#define HAVE_SSE 1'
1952 _def_sse2='#undef HAVE_SSE2'
1953 test "$_sse2" = yes && _def_sse2='#define HAVE_SSE2 1'
1955 # Checking kernel version...
1956 if x86 && linux ; then
1957 _k_verc_problem=no
1958 kernel_version=`uname -r 2>&1`
1959 echocheck "$system_name kernel version"
1960 case "$kernel_version" in
1961 '') kernel_version="?.??"; _k_verc_fail=yes;;
1962 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
1963 _k_verc_problem=yes;;
1964 esac
1965 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
1966 _k_verc_fail=yes
1968 if test "$_k_verc_fail" ; then
1969 echores "$kernel_version, fail"
1970 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
1971 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
1972 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
1973 echo "supports SSE, but you have been warned! If you are using a kernel older than"
1974 echo "2.2.x you must upgrade it to get SSE support!"
1975 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
1976 else
1977 echores "$kernel_version, ok"
1981 if test "$_vidix" = auto ; then
1982 _vidix=no
1983 # should check for x86 systems supporting VIDIX (does QNX have VIDIX?)
1984 x86 && _vidix=yes
1985 ppc && linux && _vidix=yes
1986 alpha && linux && _vidix=yes
1987 qnx && _vidix=no
1988 sunos && _vidix=no
1991 echocheck "mplayer binary name"
1992 if win32 ; then
1993 _prg="mplayer.exe"
1994 _prg_mencoder="mencoder.exe"
1995 else
1996 _prg="mplayer"
1997 _prg_mencoder="mencoder"
1999 echores $_prg
2002 # On QNX we must link to libph - Gabucino
2003 if qnx ; then
2004 _ld_arch="$_ld_arch -lph"
2007 # checking for a working awk, I'm using mawk first, because it's fastest - atmos
2008 _awk=
2009 if test "$_vidix" = yes ; then
2010 _awk_verc_fail=yes
2011 echocheck "awk"
2012 for _awk in mawk gawk nawk awk; do
2013 if ( $_awk 'BEGIN{testme();}function testme(){print"";}' ) >> "$TMPLOG" 2>&1; then
2014 _awk_verc_fail=no
2015 break
2017 done
2018 test "$_awk_verc_fail" = yes && _awk=no
2019 echores "$_awk"
2020 if test "$_awk_verc_fail" = yes; then
2021 echo "VIDIX needs awk, but no working implementation was found!"
2022 echo "Try the GNU version, which can be downloaded from:"
2023 echo "ftp://ftp.gnu.org/gnu/gawk/"
2024 echo "If you don't need VIDIX, you can use configure --disable-vidix instead."
2025 die "no awk"
2029 # If IRIX we must use ar instead of ranlib (not present on IRIX systems)
2030 if irix ; then
2031 _ranlib='ar -r'
2032 elif linux ; then
2033 _ranlib='true'
2036 ######################
2037 # MAIN TESTS GO HERE #
2038 ######################
2041 echocheck "extra headers"
2042 if test "$_inc_extra" ; then
2043 echores "$_inc_extra"
2044 else
2045 echores "none"
2049 echocheck "extra libs"
2050 if test "$_ld_extra" ; then
2051 echores "$_ld_extra"
2052 else
2053 echores "none"
2057 # Checking for localization ...
2058 # CSAK EGY MARADHAT - A HEGYLAKO
2059 echocheck "i18n"
2060 if test "$_i18n" != no ; then
2061 cat > $TMPC <<EOF
2062 #include <libintl.h>
2063 int main(void) { gettext("test"); return 0; }
2065 _i18n=no
2066 _i18n_libs=""
2067 if test "$_i18n" = auto ; then
2068 cc_check && _i18n=yes
2069 else
2070 for i18n_lib in "" "-lintl"; do
2071 cc_check $i18n_lib && _i18n=yes && _i18n_libs=$i18n_lib && break
2072 done
2075 if test "$_i18n" = yes ; then
2076 _def_i18n='#define USE_I18N 1'
2077 else
2078 _def_i18n='#undef USE_I18N'
2080 if test -z "$_i18n_libs" ; then
2081 echores "$_i18n"
2082 else
2083 echores "$_i18n (using $_i18n_libs)"
2087 # Checking for setlocale() ...
2088 # CSAK EGY MARADHAT - A HEGYLAKO
2089 # Nemnem. a TV Maci !
2090 echocheck "setlocale()"
2091 if test "$_setlocale" = auto ; then
2092 cat > $TMPC <<EOF
2093 #include <locale.h>
2094 int main(void) { setlocale( LC_ALL,"" ); return 0; }
2096 _setlocale=no
2097 cc_check && _setlocale=yes
2099 if test "$_setlocale" = yes ; then
2100 _def_setlocale='#define USE_SETLOCALE 1'
2101 else
2102 _def_setlocale='#undef USE_SETLOCALE'
2104 echores "$_setlocale"
2107 echocheck "iconv"
2108 if test "$_iconv" = auto ; then
2109 _iconv_tmp='#include <iconv.h>'
2111 cat > $TMPC << EOF
2112 #include <stdio.h>
2113 #include <unistd.h>
2114 $_iconv_tmp
2115 #define INBUFSIZE 1024
2116 #define OUTBUFSIZE 4096
2118 char inbuffer[INBUFSIZE];
2119 char outbuffer[OUTBUFSIZE];
2121 int main(void) {
2122 size_t numread;
2123 iconv_t icdsc;
2124 char *tocode="UTF-8";
2125 char *fromcode="cp1250";
2126 if ((icdsc = iconv_open (tocode, fromcode)) != (iconv_t)(-1)) {
2127 while ((numread = read (0, inbuffer, INBUFSIZE))) {
2128 char *iptr=inbuffer;
2129 char *optr=outbuffer;
2130 size_t inleft=numread;
2131 size_t outleft=OUTBUFSIZE;
2132 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
2133 != (size_t)(-1)) {
2134 write (1, outbuffer, OUTBUFSIZE - outleft);
2137 if (iconv_close(icdsc) == -1)
2142 _iconv=no
2143 if cc_check -lm ; then
2144 _iconv=yes
2145 elif cc_check -lm -liconv ; then
2146 _iconv=yes
2147 _ld_iconv='-liconv'
2150 if test "$_iconv" = yes ; then
2151 _def_iconv='#define USE_ICONV 1'
2152 else
2153 _def_iconv='#undef USE_ICONV'
2155 echores "$_iconv"
2158 echocheck "langinfo"
2159 if test "$_langinfo" = auto ; then
2160 cat > $TMPC <<EOF
2161 #include <langinfo.h>
2162 int main(void) { nl_langinfo(CODESET); return 0; }
2164 _langinfo=no
2165 cc_check && _langinfo=yes
2167 if test "$_langinfo" = yes ; then
2168 _def_langinfo='#define USE_LANGINFO 1'
2169 else
2170 _def_langinfo='#undef USE_LANGINFO'
2172 echores "$_langinfo"
2175 echocheck "language"
2176 test -z "$_language" && _language=$LINGUAS
2177 _language=`echo $_language | sed 's/,/ /g'`
2178 echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
2179 for lang in $_language ; do
2180 test "$lang" = all && lang=en
2181 if test -f "help/help_mp-${lang}.h" ; then
2182 _language=$lang
2183 break
2184 else
2185 echo -n "$lang not found, "
2186 _language=`echo $_language | sed "s/$lang *//"`
2188 done
2189 test -z "$_language" && _language=en
2190 _mp_help="help/help_mp-${_language}.h"
2191 test -f $_mp_help || die "$_mp_help not found"
2192 for lang in $LANGUAGES ; do
2193 if test -f "DOCS/man/$lang/mplayer.1" ; then
2194 MAN_LANG="$MAN_LANG $lang"
2196 done
2197 _doc_lang=$_language
2198 test -d DOCS/xml/$_doc_lang || _doc_lang=en
2199 echores "using $_language (man pages: $MAN_LANG)"
2202 echocheck "enable sighandler"
2203 if test "$_sighandler" = yes ; then
2204 _def_sighandler='#define ENABLE_SIGHANDLER 1'
2205 else
2206 _def_sighandler='#undef ENABLE_SIGHANDLER'
2208 echores "$_sighandler"
2210 echocheck "runtime cpudetection"
2211 if test "$_runtime_cpudetection" = yes ; then
2212 _optimizing="Runtime CPU-Detection enabled"
2213 _def_runtime_cpudetection='#define RUNTIME_CPUDETECT 1'
2214 else
2215 _def_runtime_cpudetection='#undef RUNTIME_CPUDETECT'
2217 echores "$_runtime_cpudetection"
2220 echocheck "restrict keyword"
2221 for restrict_keyword in restrict __restrict __restrict__ ; do
2222 echo "void foo(char * $restrict_keyword p); int main(){}" > $TMPC
2223 if cc_check; then
2224 _def_restrict_keyword=$restrict_keyword
2225 break;
2227 done
2228 if [ -n "$_def_restrict_keyword" ]; then
2229 echores "$_def_restrict_keyword"
2230 else
2231 echores "none"
2235 echocheck "kstat"
2236 cat > $TMPC << EOF
2237 #include <kstat.h>
2238 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2240 _kstat=no
2241 cc_check -lkstat && _kstat=yes
2242 if test "$_kstat" = yes ; then
2243 _ld_arch="-lkstat $_ld_arch"
2245 if test "$_kstat" = yes ; then
2246 _def_kstat="#define HAVE_LIBKSTAT 1"
2247 else
2248 _def_kstat="#undef HAVE_LIBKSTAT"
2250 echores "$_kstat"
2253 echocheck "posix4"
2254 # required for nanosleep on some systems
2255 cat > $TMPC << EOF
2256 #include <time.h>
2257 int main(void) { (void) nanosleep(0, 0); return 0; }
2259 _posix4=no
2260 cc_check -lposix4 && _posix4=yes
2261 if test "$_posix4" = yes ; then
2262 _ld_arch="-lposix4 $_ld_arch"
2264 echores "$_posix4"
2267 echocheck "lrintf"
2268 cat > $TMPC << EOF
2269 #include <math.h>
2270 int main(void) { (void) lrintf(0.0); return 0; }
2272 _lrintf=no
2273 cc_check -lm && _lrintf=yes
2274 if test "$_lrintf" = yes ; then
2275 _def_lrintf="#define HAVE_LRINTF 1"
2276 else
2277 _def_lrintf="#undef HAVE_LRINTF"
2279 echores "$_lrintf"
2282 echocheck "nanosleep"
2283 # also check for nanosleep
2284 cat > $TMPC << EOF
2285 #include <time.h>
2286 int main(void) { (void) nanosleep(0, 0); return 0; }
2288 _nanosleep=no
2289 cc_check $_ld_arch && _nanosleep=yes
2290 if test "$_nanosleep" = yes ; then
2291 _def_nanosleep='#define HAVE_NANOSLEEP 1'
2292 else
2293 _def_nanosleep='#undef HAVE_NANOSLEEP'
2295 echores "$_nanosleep"
2298 echocheck "socklib"
2299 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2300 cat > $TMPC << EOF
2301 #include <netdb.h>
2302 int main(void) { (void) gethostbyname(0); return 0; }
2304 cc_check -lsocket && _ld_sock="-lsocket"
2305 cc_check -lnsl && _ld_sock="-lnsl"
2306 cc_check -lsocket -lnsl && _ld_sock="-lsocket -lnsl"
2307 cc_check -lsocket -ldnet && _ld_sock="-lsocket -ldnet"
2308 if test $_winsock2 = auto && not cygwin ; then
2309 _winsock2=no
2310 cat > $TMPC << EOF
2311 #include <winsock2.h>
2312 int main(void) { (void) gethostbyname(0); return 0; }
2314 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
2316 if test "$_ld_sock" ; then
2317 echores "yes (using $_ld_sock)"
2318 else
2319 echores "no"
2323 if test $_winsock2 = yes ; then
2324 _ld_sock="-lws2_32"
2325 _def_winsock2='#define HAVE_WINSOCK2 1'
2326 else
2327 _def_winsock2='#undef HAVE_WINSOCK2'
2331 _use_aton=no
2332 echocheck "inet_pton()"
2333 cat > $TMPC << EOF
2334 #include <sys/types.h>
2335 #include <sys/socket.h>
2336 #include <arpa/inet.h>
2337 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
2339 if test "$_winsock2" = yes ; then
2340 echores "not needed (using winsock2 functions)"
2341 elif cc_check $_ld_sock ; then
2342 # NOTE: Linux has libresolv but does not need it
2344 echores "yes (using $_ld_sock)"
2345 elif cc_check $_ld_sock -lresolv ; then
2346 # NOTE: needed for SunOS at least
2347 _ld_sock="$_ld_sock -lresolv"
2348 echores "yes (using $_ld_sock)"
2349 else
2350 echores "no (=> i'll try inet_aton next)"
2352 echocheck "inet_aton()"
2353 cat > $TMPC << EOF
2354 #include <sys/types.h>
2355 #include <sys/socket.h>
2356 #include <arpa/inet.h>
2357 int main(void) { (void) inet_aton(0, 0); return 0; }
2359 _use_aton=yes
2360 if cc_check $_ld_sock ; then
2361 # NOTE: Linux has libresolv but does not need it
2363 echores "yes (using $_ld_sock)"
2364 elif cc_check $_ld_sock -lresolv ; then
2365 # NOTE: needed for SunOS at least
2366 _ld_sock="$_ld_sock -lresolv"
2367 echores "yes (using $_ld_sock)"
2368 else
2369 _use_aton=no
2370 _network=no
2371 echores "no (=> network support disabled)"
2375 _def_use_aton='#undef USE_ATON'
2376 if test "$_use_aton" != no; then
2377 _def_use_aton='#define USE_ATON 1'
2381 echocheck "inttypes.h (required)"
2382 cat > $TMPC << EOF
2383 #include <inttypes.h>
2384 int main(void) { return 0; }
2386 _inttypes=no
2387 cc_check && _inttypes=yes
2388 if test "$_inttypes" = yes ; then
2389 # nothing to do
2391 else
2392 echores "no"
2393 echocheck "bitypes.h (inttypes.h predecessor)"
2394 cat > $TMPC << EOF
2395 #include <sys/bitypes.h>
2396 int main(void) { return 0; }
2398 _inttypes=no
2399 cc_check && _inttypes=yes
2400 if test "$_inttypes" = yes ; then
2401 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."
2402 else
2403 die "Cannot find header either inttypes.h or bitypes.h (see DOCS/HTML/$_doc_lang/faq.html)."
2406 echores "$_inttypes"
2409 echocheck "int_fastXY_t in inttypes.h"
2410 cat > $TMPC << EOF
2411 #include <inttypes.h>
2412 int main(void) {
2413 volatile int_fast16_t v= 0;
2414 return v; }
2416 _fast_inttypes=no
2417 cc_check && _fast_inttypes=yes
2418 if test "$_fast_inttypes" = yes ; then
2419 # nothing to do
2421 else
2422 _def_fast_inttypes='
2423 typedef signed char int_fast8_t;
2424 typedef signed int int_fast16_t;
2425 typedef signed int int_fast32_t;
2426 typedef unsigned char uint_fast8_t;
2427 typedef unsigned int uint_fast16_t;
2428 typedef unsigned int uint_fast32_t;'
2430 echores "$_fast_inttypes"
2433 echocheck "word size"
2434 _mp_wordsize="#undef MP_WORDSIZE"
2435 cat > $TMPC << EOF
2436 #include <stdio.h>
2437 #include <sys/types.h>
2438 int main(void) { printf("%d\n", sizeof(size_t)*8); return 0; }
2440 cc_check && _wordsize=`$TMPO` && _mp_wordsize="#define MP_WORDSIZE $_wordsize"
2441 echores "$_wordsize"
2444 echocheck "stddef.h"
2445 cat > $TMPC << EOF
2446 #include <stddef.h>
2447 int main(void) { return 0; }
2449 _stddef=no
2450 cc_check && _stddef=yes
2451 if test "$_stddef" = yes ; then
2452 _def_stddef='#define HAVE_STDDEF_H 1'
2453 else
2454 _def_stddef='#undef HAVE_STDDEF_H'
2456 echores "$_stddef"
2459 echocheck "malloc.h"
2460 cat > $TMPC << EOF
2461 #include <malloc.h>
2462 int main(void) { (void) malloc(0); return 0; }
2464 _malloc=no
2465 cc_check && _malloc=yes
2466 if test "$_malloc" = yes ; then
2467 _def_malloc='#define HAVE_MALLOC_H 1'
2468 else
2469 _def_malloc='#undef HAVE_MALLOC_H'
2471 # malloc.h emits a warning in FreeBSD and OpenBSD
2472 (freebsd || openbsd) && _def_malloc='#undef HAVE_MALLOC_H'
2473 echores "$_malloc"
2476 echocheck "memalign()"
2477 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
2478 cat > $TMPC << EOF
2479 #include <malloc.h>
2480 int main (void) { (void) memalign(64, sizeof(char)); return 0; }
2482 _memalign=no
2483 cc_check && _memalign=yes
2484 if test "$_memalign" = yes ; then
2485 _def_memalign='#define HAVE_MEMALIGN 1'
2486 else
2487 _def_memalign='#undef HAVE_MEMALIGN'
2489 echores "$_memalign"
2492 echocheck "alloca.h"
2493 cat > $TMPC << EOF
2494 #include <alloca.h>
2495 int main(void) { (void) alloca(0); return 0; }
2497 _alloca=no
2498 cc_check && _alloca=yes
2499 if cc_check ; then
2500 _def_alloca='#define HAVE_ALLOCA_H 1'
2501 else
2502 _def_alloca='#undef HAVE_ALLOCA_H'
2504 echores "$_alloca"
2507 echocheck "mman.h"
2508 cat > $TMPC << EOF
2509 #include <sys/types.h>
2510 #include <sys/mman.h>
2511 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
2513 _mman=no
2514 cc_check && _mman=yes
2515 if test "$_mman" = yes ; then
2516 _def_mman='#define HAVE_SYS_MMAN_H 1'
2517 else
2518 _def_mman='#undef HAVE_SYS_MMAN_H'
2520 echores "$_mman"
2522 echocheck "dynamic loader"
2523 cat > $TMPC << EOF
2524 #include <dlfcn.h>
2525 int main(void) { dlopen(0, 0); dlclose(0); dlsym(0, 0); return 0; }
2527 _dl=no
2528 if cc_check ; then
2529 _dl=yes
2530 elif cc_check -ldl ; then
2531 _dl=yes
2532 _ld_dl='-ldl'
2534 if test "$_dl" = yes ; then
2535 _def_dl='#define HAVE_LIBDL 1'
2536 else
2537 _def_dl='#undef HAVE_LIBDL'
2539 echores "$_dl"
2542 echocheck "dynamic a/v plugins support"
2543 if test "$_dl" = no ; then
2544 _dynamic_plugins=no
2546 if test "$_dynamic_plugins" = yes ; then
2547 _def_dynamic_plugins='#define DYNAMIC_PLUGINS 1'
2548 else
2549 _def_dynamic_plugins='#undef DYNAMIC_PLUGINS'
2551 echores "$_dynamic_plugins"
2554 #echocheck "dynamic linking"
2555 # FIXME !! make this dynamic detection work and modify at the end (search _ld_dl_dynamic)
2556 # also gcc flags are different, but ld flags aren't (-Bdynamic/-Bstatic/-Bsymbolic)
2557 #cat > $TMPC << EOF
2558 #int main(void) { return 0; }
2559 #EOF
2560 #if cc_check -rdynamic ; then
2561 # _ld_dl_dynamic='-rdynamic'
2562 #elif cc_check -Bdynamic ; then
2563 # _ld_dl_dynamic='-Bdynamic'
2564 #elif cc_check ; then
2565 # _ld_dl_dynamic=''
2567 #echores "using $_ld_dl_dynamic"
2570 echocheck "pthread"
2571 cat > $TMPC << EOF
2572 #include <pthread.h>
2573 void* func(void *arg) { return arg; }
2574 int main(void) { pthread_t tid; return pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1; }
2576 if mingw32 ; then
2577 _ld_pthread=''
2578 elif ( cc_check && $TMPO ) ; then # QNX
2579 _ld_pthread=''
2580 elif ( cc_check -lpthread && $TMPO ) ; then
2581 _ld_pthread='-lpthread'
2582 elif ( cc_check -pthread && $TMPO ) ; then
2583 _ld_pthread='-pthread'
2584 else
2585 if test "$_ld_static" ; then
2586 # for crosscompilation, we cannot execute the program, be happy if we can link statically
2587 if ( cc_check -lpthread ) ; then
2588 _ld_pthread='-lpthread'
2589 elif ( cc_check -pthread ) ; then
2590 _ld_pthread='-pthread'
2591 else
2592 echores "no static pthread found (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, Win32 loader disabled)"
2593 _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
2595 else
2596 echores "no (v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled)"
2597 _ld_pthread='' ; _nas=no ; _tv_v4l=no ; _macosx=no ; _win32=no
2600 if test "$_ld_pthread" != '' ; then
2601 echores "yes (using $_ld_pthread)"
2602 _pthreads='yes'
2603 _def_pthreads='#define HAVE_PTHREADS 1'
2604 else
2605 echores "no"
2606 _pthreads=''
2607 _def_pthreads='#undef HAVE_PTHREADS'
2611 echocheck "sys/soundcard.h"
2612 cat > $TMPC << EOF
2613 #include <sys/soundcard.h>
2614 int main(void) { return 0; }
2616 _sys_soundcard=no
2617 cc_check && _sys_soundcard=yes
2618 if test "$_sys_soundcard" = yes ; then
2619 _def_sys_soundcard='#define HAVE_SYS_SOUNDCARD_H 1'
2620 _inc_soundcard='#include <sys/soundcard.h>'
2621 else
2622 _def_sys_soundcard='#undef HAVE_SYS_SOUNDCARD_H'
2624 echores "$_sys_soundcard"
2626 if test "$_sys_soundcard" != yes ; then
2627 echocheck "soundcard.h"
2628 cat > $TMPC << EOF
2629 #include <soundcard.h>
2630 int main(void) { return 0; }
2632 _soundcard=no
2633 cc_check && _soundcard=yes
2634 if linux || test "$_ossaudio" != no ; then
2635 # use soundcard.h on Linux, or when OSS support is enabled
2636 echores "$_soundcard"
2637 else
2638 # we don't want to use soundcard.h on non-Linux if OSS support not enabled!
2639 echores "$_soundcard, but ignored!"
2640 _soundcard=no
2642 if test "$_soundcard" = yes ; then
2643 _def_soundcard='#define HAVE_SOUNDCARD_H 1'
2644 _inc_soundcard='#include <soundcard.h>'
2645 else
2646 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2648 else
2649 _def_soundcard='#undef HAVE_SOUNDCARD_H'
2653 echocheck "sys/dvdio.h"
2654 cat > $TMPC << EOF
2655 #include <unistd.h>
2656 #include <sys/dvdio.h>
2657 int main(void) { return 0; }
2659 _dvdio=no
2660 cc_check && _dvdio=yes
2661 if test "$_dvdio" = yes ; then
2662 _def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
2663 else
2664 _def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
2666 echores "$_dvdio"
2669 echocheck "sys/cdio.h"
2670 cat > $TMPC << EOF
2671 #include <unistd.h>
2672 #include <sys/cdio.h>
2673 int main(void) { return 0; }
2675 _cdio=no
2676 cc_check && _cdio=yes
2677 if test "$_cdio" = yes ; then
2678 _def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
2679 else
2680 _def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
2682 echores "$_cdio"
2685 echocheck "linux/cdrom.h"
2686 cat > $TMPC << EOF
2687 #include <sys/types.h>
2688 #include <linux/cdrom.h>
2689 int main(void) { return 0; }
2691 _cdrom=no
2692 cc_check && _cdrom=yes
2693 if test "$_cdrom" = yes ; then
2694 _def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
2695 else
2696 _def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
2698 echores "$_cdrom"
2701 echocheck "dvd.h"
2702 cat > $TMPC << EOF
2703 #include <dvd.h>
2704 int main(void) { return 0; }
2706 _dvd=no
2707 cc_check && _dvd=yes
2708 if test "$_dvd" = yes ; then
2709 _def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
2710 else
2711 _def_dvd='#undef DVD_STRUCT_IN_DVD_H'
2713 echores "$_dvd"
2716 echocheck "BSDI dvd.h"
2717 cat > $TMPC << EOF
2718 #include <dvd.h>
2719 int main(void) { return 0; }
2721 _bsdi_dvd=no
2722 cc_check && _bsdi_dvd=yes
2723 if test "$_bsdi_dvd" = yes ; then
2724 _def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
2725 else
2726 _def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
2728 echores "$_bsdi_dvd"
2731 echocheck "HPUX SCSI header"
2732 cat > $TMPC << EOF
2733 #include <sys/scsi.h>
2734 int main(void) { return 0; }
2736 _hpux_scsi_h=no
2737 cc_check && _hpux_scsi_h=yes
2738 if test "$_hpux_scsi_h" = yes ; then
2739 _def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
2740 else
2741 _def_hpux_scsi_h='#undef HPUX_SCTL_IO'
2743 echores "$_hpux_scsi_h"
2746 echocheck "userspace SCSI headers (Solaris)"
2747 cat > $TMPC << EOF
2748 # include <unistd.h>
2749 # include <stropts.h>
2750 # include <sys/scsi/scsi_types.h>
2751 # include <sys/scsi/impl/uscsi.h>
2752 int main(void) { return 0; }
2754 _sol_scsi_h=no
2755 cc_check && _sol_scsi_h=yes
2756 if test "$_sol_scsi_h" = yes ; then
2757 _def_sol_scsi_h='#define SOLARIS_USCSI 1'
2758 else
2759 _def_sol_scsi_h='#undef SOLARIS_USCSI'
2761 echores "$_sol_scsi_h"
2764 echocheck "termcap"
2765 if test "$_termcap" = auto ; then
2766 cat > $TMPC <<EOF
2767 int main(void) { return 0; }
2769 _termcap=no
2770 cc_check -ltermcap && _termcap=yes && _ld_termcap='-ltermcap'
2771 cc_check -ltinfo && _termcap=yes && _ld_termcap='-ltinfo'
2773 if test "$_termcap" = yes ; then
2774 _def_termcap='#define USE_TERMCAP 1'
2775 echores "yes (using $_ld_termcap)"
2776 else
2777 _def_termcap='#undef USE_TERMCAP'
2778 echores no
2782 echocheck "termios"
2783 if test "$_termios" = auto ; then
2784 cat > $TMPC <<EOF
2785 #include <sys/termios.h>
2786 int main(void) { return 0; }
2788 _termios=no
2789 cc_check && _termios=yes
2790 _def_termios_h_name='sys/termios.h'
2792 # second test:
2793 if test "$_termios" = no ; then
2794 cat > $TMPC <<EOF
2795 #include <termios.h>
2796 int main(void) { return 0; }
2798 _termios=no
2799 cc_check && _termios=yes
2800 _def_termios_h_name='termios.h'
2803 if test "$_termios" = yes ; then
2804 _def_termios='#define HAVE_TERMIOS 1'
2805 _def_termios_h='#undef HAVE_TERMIOS_H'
2806 _def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
2808 if test "$_def_termios_h_name" = 'sys/termios.h' ; then
2809 _def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
2810 elif test "$_def_termios_h_name" = 'termios.h' ; then
2811 _def_termios_h='#define HAVE_TERMIOS_H 1'
2813 echores "yes (using $_def_termios_h_name)"
2814 else
2815 _def_termios='#undef HAVE_TERMIOS'
2816 _def_termios_h_name=''
2817 echores "no"
2821 echocheck "shm"
2822 if test "$_shm" = auto ; then
2823 cat > $TMPC << EOF
2824 #include <sys/types.h>
2825 #include <sys/shm.h>
2826 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
2828 _shm=no
2829 cc_check && _shm=yes
2831 if test "$_shm" = yes ; then
2832 _def_shm='#define HAVE_SHM 1'
2833 else
2834 _def_shm='#undef HAVE_SHM'
2836 echores "$_shm"
2839 # XXX: FIXME, add runtime checking
2840 echocheck "linux devfs"
2841 echores "$_linux_devfs"
2844 echocheck "scandir()"
2845 cat > $TMPC << EOF
2846 int main (void) { scandir("", 0, 0, 0); alphasort(0, 0); return 0; }
2848 _scandir=no
2849 cc_check && _scandir=yes
2850 if test "$_scandir" = yes ; then
2851 _def_scandir='#define HAVE_SCANDIR 1'
2852 else
2853 _def_scandir='#undef HAVE_SCANDIR'
2855 echores "$_scandir"
2858 echocheck "strsep()"
2859 cat > $TMPC << EOF
2860 #include <string.h>
2861 int main (void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
2863 _strsep=no
2864 cc_check && _strsep=yes
2865 if test "$_strsep" = yes ; then
2866 _def_strsep='#define HAVE_STRSEP 1'
2867 else
2868 _def_strsep='#undef HAVE_STRSEP'
2870 echores "$_strsep"
2872 echocheck "strlcpy()"
2873 cat > $TMPC << EOF
2874 #include <string.h>
2875 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcpy(t, s, sizeof( t )); return 0; }
2877 _strlcpy=no
2878 cc_check && _strlcpy=yes
2879 if test "$_strlcpy" = yes ; then
2880 _def_strlcpy='#define HAVE_STRLCPY 1'
2881 else
2882 _def_strlcpy='#undef HAVE_STRLCPY'
2884 echores "$_strlcpy"
2886 echocheck "strlcat()"
2887 cat > $TMPC << EOF
2888 #include <string.h>
2889 int main (void) { char *s = "Hello, world!", t[20]; (void) strlcat(t, s, sizeof( t )); return 0; }
2891 _strlcat=no
2892 cc_check && _strlcat=yes
2893 if test "$_strlcat" = yes ; then
2894 _def_strlcat='#define HAVE_STRLCAT 1'
2895 else
2896 _def_strlcat='#undef HAVE_STRLCAT'
2898 echores "$_strlcat"
2900 echocheck "fseeko()"
2901 cat > $TMPC << EOF
2902 #include <stdio.h>
2903 int main (void) { int i; i = fseeko(stdin, 0, 0); return 0; }
2905 _fseeko=no
2906 cc_check && _fseeko=yes
2907 if test "$_fseeko" = yes ; then
2908 _def_fseeko='#define HAVE_FSEEKO 1'
2909 else
2910 _def_fseeko='#undef HAVE_FSEEKO'
2912 echores "$_fseeko"
2914 echocheck "localtime_r()"
2915 cat > $TMPC << EOF
2916 #include <time.h>
2917 int main( void ) { localtime_r(NULL, NULL); }
2919 _localtime_r=no
2920 cc_check && _localtime_r=yes
2921 if test "$_localtime_r" = yes ; then
2922 _def_localtime_r='#define HAVE_LOCALTIME_R 1'
2923 else
2924 _def_localtime_r='#undef HAVE_LOCALTIME_R'
2926 echores "$_localtime_r"
2928 echocheck "vsscanf()"
2929 cat > $TMPC << EOF
2930 #include <stdarg.h>
2931 int main(void) { vsscanf(0, 0, 0); return 0; }
2933 _vsscanf=no
2934 cc_check && _vsscanf=yes
2935 if test "$_vsscanf" = yes ; then
2936 _def_vsscanf='#define HAVE_VSSCANF 1'
2937 else
2938 _def_vsscanf='#undef HAVE_VSSCANF'
2940 echores "$_vsscanf"
2943 echocheck "posix select()"
2944 cat > $TMPC << EOF
2945 #include <stdio.h>
2946 #include <stdlib.h>
2947 #include <sys/types.h>
2948 #include <string.h>
2949 #include <sys/time.h>
2950 #include <unistd.h>
2951 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
2953 _posix_select=no
2954 cc_check && _posix_select=yes
2955 if test "$_posix_select" = no ; then
2956 _def_no_posix_select='#define HAVE_NO_POSIX_SELECT 1'
2957 else
2958 _def_no_posix_select='#undef HAVE_NO_POSIX_SELECT'
2960 echores "$_posix_select"
2963 echocheck "gettimeofday()"
2964 cat > $TMPC << EOF
2965 #include <stdio.h>
2966 #include <sys/time.h>
2967 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
2969 _gettimeofday=no
2970 cc_check && _gettimeofday=yes
2971 if test "$_gettimeofday" = yes ; then
2972 _def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
2973 else
2974 _def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
2976 echores "$_gettimeofday"
2979 echocheck "glob()"
2980 cat > $TMPC << EOF
2981 #include <stdio.h>
2982 #include <glob.h>
2983 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
2985 _glob=no
2986 cc_check && _glob=yes
2987 if test "$_glob" = yes ; then
2988 _def_glob='#define HAVE_GLOB 1'
2989 else
2990 _def_glob='#undef HAVE_GLOB'
2992 echores "$_glob"
2995 echocheck "sys/sysinfo.h"
2996 cat > $TMPC << EOF
2997 #include <sys/sysinfo.h>
2998 int main(void) {
2999 struct sysinfo s_info;
3000 sysinfo(&s_info);
3001 return 0;
3004 _sys_sysinfo=no
3005 cc_check && _sys_sysinfo=yes
3006 if test "$_sys_sysinfo" = yes ; then
3007 _def_sys_sysinfo='#define HAVE_SYS_SYSINFO_H 1'
3008 _inc_sysinfo='#include <sys/sysinfo.h>'
3009 else
3010 _def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
3012 echores "$_sys_sysinfo"
3015 echocheck "Mac OS X APIs"
3016 if test "$_macosx" = auto ; then
3017 if darwin && ppc; then
3018 _macosx=yes
3019 else
3020 _macosx=no
3021 _def_macosx='#undef MACOSX'
3022 _noaomodules="macosx $_noaomodules"
3023 _novomodules="quartz $_novomodules"
3026 if test "$_macosx" = yes ; then
3027 cat > $TMPC <<EOF
3028 #include <Carbon/Carbon.h>
3029 #include <QuickTime/QuickTime.h>
3030 #include <CoreAudio/CoreAudio.h>
3031 int main(void) {
3032 EnterMovies();
3033 ExitMovies();
3034 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
3037 if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
3038 _macosx=yes
3039 _macosx_frameworks="-framework Carbon -framework QuickTime -framework CoreAudio"
3040 _def_macosx='#define MACOSX 1'
3041 _aosrc="$_aosrc ao_macosx.c"
3042 _aomodules="macosx $_aomodules"
3043 _vosrc="$_vosrc vo_quartz.c"
3044 _vomodules="quartz $_vomodules"
3045 else
3046 _macosx=no
3047 _def_macosx='#undef MACOSX'
3048 _noaomodules="macosx $_noaomodules"
3049 _novomodules="quartz $_novomodules"
3052 echores "$_macosx"
3055 echocheck "Samba support (libsmbclient)"
3056 if test "$_smbsupport" = yes; then
3057 _ld_smb="-lsmbclient"
3059 if test "$_smbsupport" = auto; then
3060 _smbsupport=no
3061 cat > $TMPC << EOF
3062 #include <libsmbclient.h>
3063 int main(void) { smbc_opendir("smb://"); return 0; }
3065 if cc_check -lsmbclient ; then
3066 _smbsupport=yes
3067 _ld_smb="-lsmbclient"
3068 else
3069 if cc_check -lsmbclient $_ld_dl ; then
3070 _smbsupport=yes
3071 _ld_smb="-lsmbclient $_ld_dl"
3072 else
3073 if cc_check -lsmbclient $_ld_dl -lnsl ; then
3074 _smbsupport=yes
3075 _ld_smb="-lsmbclient $_ld_dl -lnsl"
3081 if test "$_smbsupport" = yes; then
3082 _def_smbsupport="#define LIBSMBCLIENT"
3083 _inputmodules="smb $_inputmodules"
3084 else
3085 _def_smbsupport="#undef LIBSMBCLIENT"
3086 _noinputmodules="smb $_noinputmodules"
3088 echores "$_smbsupport"
3091 #########
3092 # VIDEO #
3093 #########
3096 echocheck "3dfx"
3097 if test "$_3dfx" = yes ; then
3098 _def_3dfx='#define HAVE_3DFX 1'
3099 _vosrc="$_vosrc vo_3dfx.c"
3100 _vomodules="3dfx $_vomodules"
3101 else
3102 _def_3dfx='#undef HAVE_3DFX'
3103 _novomodules="3dfx $_novomodules"
3105 echores "$_3dfx"
3108 echocheck "tdfxfb"
3109 if test "$_tdfxfb" = yes ; then
3110 _def_tdfxfb='#define HAVE_TDFXFB 1'
3111 _vosrc="$_vosrc vo_tdfxfb.c"
3112 _vomodules="tdfxfb $_vomodules"
3113 else
3114 _def_tdfxfb='#undef HAVE_TDFXFB'
3115 _novomodules="tdfxfb $_novomodules"
3117 echores "$_tdfxfb"
3119 echocheck "tdfxvid"
3120 if test "$_tdfxvid" = yes ; then
3121 _def_tdfxvid='#define HAVE_TDFX_VID 1'
3122 _vosrc="$_vosrc vo_tdfx_vid.c"
3123 _vomodules="tdfx_vid $_vomodules"
3124 else
3125 _def_tdfxvid='#undef HAVE_TDFX_VID'
3126 _novomodules="tdfx_vid $_novomodules"
3128 echores "$_tdfxfb"
3130 echocheck "tga"
3131 if test "$_tga" = yes ; then
3132 _def_tga='#define HAVE_TGA 1'
3133 _vosrc="$_vosrc vo_tga.c"
3134 _vomodules="tga $_vomodules"
3135 else
3136 _def_tga='#undef HAVE_TGA'
3137 _novomodules="tga $_novomodules"
3139 echores "$_tga"
3141 echocheck "DirectFB headers presence"
3142 if test -z "$_inc_directfb" ; then
3143 for I in /usr/include /usr/local/include $_inc_extra; do
3144 if test -d "$I/directfb" && test -f "$I/directfb/directfb.h" ; then
3145 _inc_directfb="-I$I/directfb"
3146 echores "yes (using $_inc_directfb)"
3147 break
3149 if test -d "$I" && test -f "$I/directfb.h" ; then
3150 _inc_directfb="-I$I"
3151 echores "yes (using $_inc_directfb)"
3152 break
3154 done
3155 if test -z "$_inc_directfb" ; then
3156 _directfb=no
3157 echores "not found"
3159 else
3160 echores "yes (using $_inc_directfb)"
3162 if test "$_inc_directfb" = "-I/usr/include" ; then
3163 _inc_directfb=""
3166 echocheck "DirectFB"
3167 if test "$_directfb" = auto ; then
3168 _directfb=no
3169 cat > $TMPC <<EOF
3170 #include <directfb.h>
3171 int main(void) { IDirectFB *foo; return 0; }
3173 linux && test -c /dev/fb0 && cc_check $_inc_directfb -ldirectfb && _directfb=yes
3176 if test "$_directfb" = yes; then
3177 cat > $TMPC <<EOF
3178 #include <directfb.h>
3179 int main(void) {
3180 printf ("%i",(directfb_major_version*100+directfb_minor_version)*100+directfb_micro_version);
3181 return 0;
3184 if cc_check $_inc_directfb -ldirectfb && "$TMPO" >> "$TMPLOG" ; then
3185 _directfb_version=`"$TMPO"`
3186 _def_directfb_version="#define DIRECTFBVERSION $_directfb_version"
3187 echores "yes ($_directfb_version)"
3188 else
3189 _directfb=no
3190 echores "no (failed to get version)"
3192 else
3193 echores "$_directfb"
3196 if test "$_directfb" = yes ; then
3197 _def_directfb='#define HAVE_DIRECTFB 1'
3198 if test "$_directfb_version" -ge 913; then
3199 _vosrc="$_vosrc vo_directfb2.c"
3200 else
3201 _vosrc="$_vosrc vo_directfb.c"
3203 _vomodules="directfb $_vomodules"
3204 _ld_directfb='-ldirectfb'
3206 if test "$_directfb_version" -ge 915; then
3207 _vosrc="$_vosrc vo_dfbmga.c"
3208 _vomodules="dfbmga $_vomodules"
3210 else
3211 _def_directfb='#undef HAVE_DIRECTFB'
3212 _novomodules="directfb $_novomodules"
3213 _inc_directfb=""
3217 echocheck "X11 headers presence"
3218 if test -z "$_inc_x11" ; then
3219 for I in /usr/X11/include /usr/X11R6/include /usr/include/X11R6 /usr/include /usr/openwin/include ; do
3220 if test -d "$I/X11" && test -f "$I/X11/Xlib.h" ; then
3221 _inc_x11="-I$I"
3222 echores "yes (using $I)"
3223 break
3225 done
3226 if test -z "$_inc_x11" ; then
3227 _x11=no
3228 echores "not found (check if the dev(el) packages are installed)"
3230 else
3231 echores "yes (using $_inc_x11)"
3233 if test "$_inc_x11" = "-I/usr/include" ; then
3234 _inc_x11=""
3238 echocheck "X11 libs presence"
3239 if test -z "$_ld_x11" ; then
3240 for I in /usr/X11R6/lib /usr/lib/X11R6 /usr/X11/lib /usr/lib32 /usr/openwin/lib /usr/X11R6/lib64 /usr/lib ; do
3241 if test -d "$I" && ( test -f "$I/libX11.so" || test -f "$I/libX11.a" || test -f "$I/libX11.dll.a" ) ; then
3242 if netbsd; then
3243 _ld_x11="-L$I -Wl,-R$I"
3244 else
3245 _ld_x11="-L$I"
3247 echores "yes (using $I)"
3248 break;
3250 done
3251 if test -z "$_ld_x11" ; then
3252 _x11=no
3253 echores "not found (check if the dev(el) packages are installed)"
3255 else
3256 echores "yes (using $_ld_x11)"
3258 _ld_x11="$_ld_x11 -lXext -lX11 $_ld_sock"
3261 echocheck "X11"
3262 if test "$_x11" != no ; then
3263 cat > $TMPC <<EOF
3264 #include <X11/Xlib.h>
3265 #include <X11/Xutil.h>
3266 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
3268 _x11=no
3269 cc_check $_inc_x11 $_ld_x11 && _x11=yes
3271 if test "$_x11" = yes ; then
3272 _def_x11='#define HAVE_X11 1'
3273 _vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
3274 _vomodules="x11 xover $_vomodules"
3275 else
3276 _def_x11='#undef HAVE_X11'
3277 _inc_x11=''
3278 _ld_x11=''
3279 _novomodules="x11 $_novomodules"
3281 echores "$_x11"
3284 echocheck "DPMS"
3285 _xdpms3=no
3286 if test "$_x11" = yes ; then
3287 cat > $TMPC <<EOF
3288 #include <X11/Xmd.h>
3289 #include <X11/Xlib.h>
3290 #include <X11/Xutil.h>
3291 #include <X11/Xatom.h>
3292 #include <X11/extensions/dpms.h>
3293 int main(void) {
3294 (void) DPMSQueryExtension(0, 0, 0);
3297 cc_check $_inc_x11 -lXdpms $_ld_x11 && _xdpms3=yes
3299 _xdpms4=no
3300 if test "$_x11" = yes ; then
3301 cat > $TMPC <<EOF
3302 #include <X11/Xlib.h>
3303 #include <X11/extensions/dpms.h>
3304 int main(void) {
3305 (void) DPMSQueryExtension(0, 0, 0);
3308 cc_check $_inc_x11 $_ld_x11 && _xdpms4=yes
3310 if test "$_xdpms4" = yes ; then
3311 _def_xdpms='#define HAVE_XDPMS 1'
3312 echores "yes (using Xdpms 4)"
3313 elif test "$_xdpms3" = yes ; then
3314 _def_xdpms='#define HAVE_XDPMS 1'
3315 _ld_x11="-lXdpms $_ld_x11"
3316 echores "yes (using Xdpms 3)"
3317 else
3318 _def_xdpms='#undef HAVE_XDPMS'
3319 echores "no"
3323 echocheck "Xv"
3324 if test "$_x11" = yes && test "$_xv" != no ; then
3325 cat > $TMPC <<EOF
3326 #include <X11/Xlib.h>
3327 #include <X11/extensions/Xvlib.h>
3328 int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); return 0; }
3330 _xv=no
3331 cc_check $_inc_x11 -lXv $_ld_x11 && _xv=yes
3332 else
3333 _xv=no
3335 if test "$_xv" = yes ; then
3336 _def_xv='#define HAVE_XV 1'
3337 _ld_xv='-lXv'
3338 _vosrc="$_vosrc vo_xv.c"
3339 _vomodules="xv $_vomodules"
3340 else
3341 _def_xv='#undef HAVE_XV'
3342 _novomodules="xv $_novomodules"
3344 echores "$_xv"
3347 echocheck "XvMC"
3348 if test "$_x11" = yes && test "$_xv" = yes && test "$_xvmc" != no ; then
3349 _xvmc=no
3350 cat > $TMPC <<EOF
3351 #include <X11/Xlib.h>
3352 #include <X11/extensions/Xvlib.h>
3353 #include <X11/extensions/XvMClib.h>
3354 int main(void) {
3355 (void) XvMCQueryExtension(0,0,0);
3356 (void) XvMCCreateContext(0,0,0,0,0,0,0);
3357 return 0; }
3359 cc_check $_inc_x11 -lXvMC -l$_xvmclib $_ld_xv $_ld_x11 && _xvmc=yes
3361 if test "$_xvmc" = yes ; then
3362 _def_xvmc='#define HAVE_XVMC 1'
3363 _ld_xvmc="-lXvMC -l$_xvmclib"
3364 _vosrc="$_vosrc vo_xvmc.c"
3365 _vomodules="xvmc $_vomodules"
3366 else
3367 _def_xvmc='#undef HAVE_XVMC'
3368 _novomodules="xvmc $_novomodules"
3370 echores "$_xvmc"
3373 echocheck "Xinerama"
3374 if test "$_x11" = yes && test "$_xinerama" != no ; then
3375 cat > $TMPC <<EOF
3376 #include <X11/Xlib.h>
3377 #include <X11/extensions/Xinerama.h>
3378 int main(void) { (void) XineramaIsActive(0); return 0; }
3380 _xinerama=no
3381 cc_check $_inc_x11 -lXinerama $_ld_x11 && _xinerama=yes
3382 else
3383 _xinerama=no
3385 if test "$_xinerama" = yes ; then
3386 _def_xinerama='#define HAVE_XINERAMA 1'
3387 _ld_xinerama='-lXinerama'
3388 else
3389 _def_xinerama='#undef HAVE_XINERAMA'
3391 echores "$_xinerama"
3394 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
3395 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
3396 # named 'X extensions' or something similar.
3397 # This check may be useful for future mplayer versions (to change resolution)
3398 # If you run into problems, remove '-lXxf86vm'.
3399 echocheck "Xxf86vm"
3400 if test "$_x11" = yes && test "$_vm" != no ; then
3401 cat > $TMPC <<EOF
3402 #include <X11/Xlib.h>
3403 #include <X11/extensions/xf86vmode.h>
3404 #include <X11/XF86keysym.h>
3405 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
3407 _vm=no
3408 cc_check $_inc_x11 -lXxf86vm $_ld_x11 && _vm=yes
3409 else
3410 _vm=no
3412 if test "$_vm" = yes ; then
3413 _def_vm='#define HAVE_XF86VM 1'
3414 _ld_vm='-lXxf86vm'
3415 else
3416 _def_vm='#undef HAVE_XF86VM'
3418 echores "$_vm"
3421 echocheck "DGA"
3422 # Version 2 is preferred to version 1 if available
3423 if test "$_dga" = auto ; then
3424 cat > $TMPC << EOF
3425 #include <X11/Xlib.h>
3426 #include <X11/extensions/xf86dga.h>
3427 int main (void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
3429 _dga=no
3430 cc_check $_inc_x11 -lXxf86dga -lXxf86vm $_ld_x11 && _dga=1
3432 cat > $TMPC << EOF
3433 #include <X11/Xlib.h>
3434 #include <X11/extensions/xf86dga.h>
3435 int main (void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
3437 cc_check $_inc_x11 -lXxf86dga $_ld_x11 && _dga=2
3440 _def_dga='#undef HAVE_DGA'
3441 _def_dga2='#undef HAVE_DGA2'
3442 if test "$_dga" = 1 ; then
3443 _def_dga='#define HAVE_DGA 1'
3444 _ld_dga='-lXxf86dga'
3445 _vosrc="$_vosrc vo_dga.c"
3446 _vomodules="dga $_vomodules"
3447 echores "yes (using DGA 1.0)"
3448 elif test "$_dga" = 2 ; then
3449 _def_dga='#define HAVE_DGA 1'
3450 _def_dga2='#define HAVE_DGA2 1'
3451 _ld_dga='-lXxf86dga'
3452 _vosrc="$_vosrc vo_dga.c"
3453 _vomodules="dga $_vomodules"
3454 echores "yes (using DGA 2.0)"
3455 elif test "$_dga" = no ; then
3456 echores "no"
3457 _novomodules="dga $_novomodules"
3458 else
3459 die "DGA version must be 1 or 2"
3463 echocheck "OpenGL"
3464 #Note: this test is run even with --enable-gl since we autodetect $_ld_gl
3465 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
3466 cat > $TMPC << EOF
3467 #include <GL/gl.h>
3468 int main(void) { return 0; }
3470 _gl=no
3471 if cc_check $_inc_x11 $_ld_x11 -lGL -lm ; then
3472 _gl=yes
3473 _ld_gl="-lGL"
3474 elif cc_check $_inc_x11 $_ld_x11 -lGL -lm $_ld_pthread ; then
3475 _gl=yes
3476 _ld_gl="-lGL $_ld_pthread"
3477 elif cc_check -lopengl32 ; then
3478 _gl=yes
3479 _gl_win32=yes
3480 _ld_gl="-lopengl32 -lgdi32"
3482 else
3483 _gl=no
3485 if test "$_gl" = yes ; then
3486 _def_gl='#define HAVE_GL 1'
3487 if test "$_gl_win32" = yes ; then
3488 _def_gl_win32='#define GL_WIN32 1'
3489 _vosrc="$_vosrc vo_gl2.c w32_common.c"
3490 else
3491 _vosrc="$_vosrc vo_gl.c vo_gl2.c"
3493 _vomodules="opengl $_vomodules"
3494 else
3495 _def_gl='#undef HAVE_GL'
3496 _def_gl_win32='#undef GL_WIN32'
3497 _novomodules="opengl $_novomodules"
3499 echores "$_gl"
3502 echocheck "/dev/mga_vid"
3503 if test "$_mga" = auto ; then
3504 _mga=no
3505 test -c /dev/mga_vid && _mga=yes
3507 if test "$_mga" = yes ; then
3508 _def_mga='#define HAVE_MGA 1'
3509 _vosrc="$_vosrc vo_mga.c"
3510 _vomodules="mga $_vomodules"
3511 else
3512 _def_mga='#undef HAVE_MGA'
3513 _novomodules="mga $_novomodules"
3515 echores "$_mga"
3518 # echocheck "syncfb"
3519 # _syncfb=no
3520 # test "$_mga" = yes && _syncfb=yes
3521 # if test "$_syncfb" = yes ; then
3522 # _def_syncfb='#define HAVE_SYNCFB 1'
3523 # _vosrc="$_vosrc vo_syncfb.c"
3524 # else
3525 # _def_syncfb='#undef HAVE_SYNCFB'
3526 # fi
3527 # echores "$_syncfb"
3530 echocheck "xmga"
3531 if test "$_xmga" = auto ; then
3532 _xmga=no
3533 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
3535 if test "$_xmga" = yes ; then
3536 _def_xmga='#define HAVE_XMGA 1'
3537 _vosrc="$_vosrc vo_xmga.c"
3538 _vomodules="xmga $_vomodules"
3539 else
3540 _def_xmga='#undef HAVE_XMGA'
3541 _novomodules="xmga $_novomodules"
3543 echores "$_xmga"
3546 echocheck "GGI"
3547 if test "$_ggi" = auto ; then
3548 cat > $TMPC << EOF
3549 #include <ggi/ggi.h>
3550 int main(void) { return 0; }
3552 _ggi=no
3553 cc_check -lggi && _ggi=yes
3555 if test "$_ggi" = yes ; then
3556 _def_ggi='#define HAVE_GGI 1'
3557 _ld_ggi='-lggi'
3558 _vosrc="$_vosrc vo_ggi.c"
3559 _vomodules="ggi $_vomodules"
3560 else
3561 _def_ggi='#undef HAVE_GGI'
3562 _novomodules="ggi $_novomodules"
3564 echores "$_ggi"
3567 echocheck "AA"
3568 if test "$_aa" = auto ; then
3569 cat > $TMPC << EOF
3570 #include <aalib.h>
3571 int main(void) { (void) aa_init(0, 0, 0); return 0; }
3573 _aa=no
3574 cc_check -laa && _aa=yes
3576 if test "$_aa" = yes ; then
3577 _def_aa='#define HAVE_AA 1'
3578 if cygwin ; then
3579 _ld_aa=`aalib-config --libs | cut -d " " -f 2,5,6`
3580 else
3581 _ld_aa='-laa'
3583 _vosrc="$_vosrc vo_aa.c"
3584 _vomodules="aa $_vomodules"
3585 else
3586 _def_aa='#undef HAVE_AA'
3587 _novomodules="aa $_novomodules"
3589 echores "$_aa"
3592 echocheck "CACA"
3593 if test "$_caca" = auto ; then
3594 _caca=no
3595 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
3596 cat > $TMPC << EOF
3597 #include <caca.h>
3598 int main(void) { (void) caca_init(); return 0; }
3600 cc_check `caca-config --libs` && _caca=yes
3603 if test "$_caca" = yes ; then
3604 _def_caca='#define HAVE_CACA 1'
3605 _inc_caca=`caca-config --cflags`
3606 _ld_caca=`caca-config --libs`
3607 _vosrc="$_vosrc vo_caca.c"
3608 _vomodules="caca $_vomodules"
3609 else
3610 _def_caca='#undef HAVE_CACA'
3611 _novomodules="caca $_novomodules"
3613 echores "$_caca"
3616 echocheck "SVGAlib"
3617 if test "$_svga" = auto ; then
3618 cat > $TMPC << EOF
3619 #include <vga.h>
3620 #include <vgagl.h>
3621 int main(void) { return 0; }
3623 _svga=no
3624 cc_check -lvgagl -lvga -lm && _svga=yes
3626 if test "$_svga" = yes ; then
3627 _def_svga='#define HAVE_SVGALIB 1'
3628 _ld_svga='-lvgagl -lvga -lm'
3629 _vosrc="$_vosrc vo_svga.c"
3630 _vomodules="svga $_vomodules"
3631 else
3632 _def_svga='#undef HAVE_SVGALIB'
3633 _novomodules="svga $_novomodules"
3635 echores "$_svga"
3638 echocheck "FBDev"
3639 if test "$_fbdev" = auto ; then
3640 _fbdev=no
3641 linux && test -c /dev/fb0 && _fbdev=yes
3643 if test "$_fbdev" = yes ; then
3644 _def_fbdev='#define HAVE_FBDEV 1'
3645 _vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
3646 _vomodules="fbdev $_vomodules"
3647 else
3648 _def_fbdev='#undef HAVE_FBDEV'
3649 _novomodules="fbdev $_novomodules"
3651 echores "$_fbdev"
3655 echocheck "DVB"
3656 if test "$_dvb" != no ; then
3657 _dvb=no
3658 cat >$TMPC << EOF
3659 #include <sys/poll.h>
3660 #include <sys/ioctl.h>
3661 #include <stdio.h>
3662 #include <time.h>
3663 #include <unistd.h>
3665 #include <ost/dmx.h>
3666 #include <ost/frontend.h>
3667 #include <ost/sec.h>
3668 #include <ost/video.h>
3669 #include <ost/audio.h>
3670 int main(void) {return 0;}
3672 if cc_check ; then
3673 _dvb=yes
3674 echores "yes"
3675 else
3676 for I in "$_inc_dvb" "-I/usr/src/DVB/ost/include" ; do
3677 if cc_check "$I" ; then
3678 _dvb=yes
3679 _inc_dvb="$I"
3680 echores "yes (using $_inc_dvb)"
3681 break
3683 done
3684 test "$_dvb" = no && echores "no (specify path to DVB/ost/include with --with-dvbincdir=DIR)"
3686 else
3687 echores "no"
3689 if test "$_dvb" = yes ; then
3690 _def_dvb='#define HAVE_DVB 1'
3691 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
3692 _aomodules="mpegpes(dvb) $_aomodules"
3693 _vomodules="mpegpes(dvb) $_vomodules"
3695 if test "$_dvbhead" != no ; then
3696 echocheck "DVB HEAD"
3697 if test "$_dvbhead" != no ; then
3698 _dvbhead=no
3700 cat >$TMPC << EOF
3701 #include <sys/poll.h>
3702 #include <sys/ioctl.h>
3703 #include <stdio.h>
3704 #include <time.h>
3705 #include <unistd.h>
3707 #include <linux/dvb/dmx.h>
3708 #include <linux/dvb/frontend.h>
3709 #include <linux/dvb/video.h>
3710 #include <linux/dvb/audio.h>
3711 int main(void) {return 0;}
3713 if cc_check ; then
3714 _dvbhead=yes
3715 echores "yes"
3716 else
3717 for I in "$_inc_dvb" "-I/usr/src/DVB/include" ; do
3718 if cc_check "$I" ; then
3719 _dvbhead=yes
3720 _inc_dvb="$I"
3721 echores "yes (using $_inc_dvb)"
3722 break
3724 done
3725 test "$_dvbhead" = no && echores "no (specify path to DVB/include (HEAD Version) with --with-dvbincdir=DIR)"
3727 else
3728 echores "no"
3730 if test "$_dvbhead" = yes ; then
3731 _def_dvb='#define HAVE_DVB_HEAD 1'
3732 _def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
3733 _aomodules="mpegpes(dvb) $_aomodules"
3734 _vomodules="mpegpes(dvb) $_vomodules"
3737 if test "$_dvbhead" = no && test "$_dvb" = no ; then
3738 _def_dvb='#undef HAVE_DVB'
3739 _def_dvb_in='#undef HAS_DVBIN_SUPPORT '
3740 _aomodules="mpegpes(file) $_aomodules"
3741 _vomodules="mpegpes(file) $_vomodules"
3744 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
3745 _dvbin=yes
3746 _inputmodules="dvb $_inputmodules"
3747 else
3748 _dvbin=no
3749 _noinputmodules="dvb $_noinputmodules"
3752 echocheck "PNG support"
3753 if test "$_png" = auto ; then
3754 _png=no
3755 if irix ; then
3756 # Don't check for -lpng on irix since it has its own libpng
3757 # incompatible with the GNU libpng
3758 echores "disabled on irix (not GNU libpng)"
3759 else
3760 cat > $TMPC << EOF
3761 #include <png.h>
3762 #include <string.h>
3763 int main(void) {
3764 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
3765 printf("libpng: %s\n", png_libpng_ver);
3766 return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
3769 if cc_check -lpng -lz -lm ; then
3770 if "$TMPO" >> "$TMPLOG" ; then
3771 _png=yes
3772 echores yes
3773 else
3774 echores "no (mismatch of library and header versions)"
3776 else
3777 echores no
3780 else
3781 echores "$_png"
3783 if test "$_png" = yes ; then
3784 _def_png='#define HAVE_PNG 1'
3785 _ld_png='-lpng -lz'
3786 _vosrc="$_vosrc vo_png.c"
3787 _vomodules="png $_vomodules"
3788 _mkf_png="yes"
3789 else
3790 _def_png='#undef HAVE_PNG'
3791 _novomodules="png $_novomodules"
3792 _mkf_png="no"
3795 echocheck "JPEG support"
3796 if test "$_jpg" = auto ; then
3797 _jpg=no
3798 cat > $TMPC << EOF
3799 #include <stdio.h>
3800 #include <stdlib.h>
3801 #include <setjmp.h>
3802 #include <string.h>
3803 #include <jpeglib.h>
3804 int main(void) {
3805 return 0;
3808 if cc_check -ljpeg -lm ; then
3809 if "$TMPO" >> "$TMPLOG" ; then
3810 _jpg=yes
3814 echores "$_jpg"
3816 if test "$_jpg" = yes ; then
3817 _def_jpg='#define HAVE_JPEG 1'
3818 _vosrc="$_vosrc vo_jpeg.c"
3819 _vomodules="jpeg $_vomodules"
3820 _ld_jpg="-ljpeg"
3821 _mkf_jpg="yes"
3822 else
3823 _def_jpg='#undef HAVE_JPEG'
3824 _novomodules="jpeg $_novomodules"
3825 _mkf_jpg="no"
3829 echocheck "GIF support"
3830 # This is to appease people who want to force gif support.
3831 # If it is forced to yes, then we still do checks to determine
3832 # which gif library to use.
3833 if test "$_gif" = yes ; then
3834 _force_gif=yes
3835 _gif=auto
3838 if test "$_gif" = auto ; then
3839 _gif=no
3840 cat > $TMPC << EOF
3841 #include <gif_lib.h>
3842 int main(void) {
3843 return 0;
3846 if cc_check -lungif && "$TMPO" >> "$TMPLOG" ; then
3847 _gif=yes
3848 _ld_gif="-lungif"
3849 elif cc_check -lungif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
3850 _gif=yes
3851 _ld_gif="-lungif $_ld_x11"
3852 elif cc_check -lgif && "$TMPO" >> "$TMPLOG" ; then
3853 _gif=yes
3854 _ld_gif="-lgif"
3855 elif cc_check -lgif $_ld_x11 && "$TMPO" >> "$TMPLOG" ; then
3856 _gif=yes
3857 _ld_gif="-lgif $_ld_x11"
3861 # If no library was found, and the user wants support forced,
3862 # then we force it on with libgif, as this is the safest
3863 # assumption IMHO. (libungif & libregif both create symbolic
3864 # links to libgif. We also assume that no x11 support is needed,
3865 # because if you are forcing this, then you _should_ know what
3866 # you are doing. [ Besides, package maintainers should never
3867 # have compiled x11 deps into libungif in the first place. ] )
3868 # </rant>
3869 # --Joey
3870 if test "$_force_gif" = yes && test "$_gif" = no ; then
3871 _gif=yes
3872 _ld_gif="-lgif"
3875 if test "$_gif" = yes ; then
3876 _def_gif='#define HAVE_GIF 1'
3877 _vosrc="$_vosrc vo_gif89a.c"
3878 _codecmodules="gif $_codecmodules"
3879 _vomodules="gif89a $_vomodules"
3880 _mkf_gif="yes"
3881 _gif="yes (old version, some encoding functions disabled)"
3882 _def_gif_4='#undef HAVE_GIF_4'
3884 cat > $TMPC << EOF
3885 #include <signal.h>
3886 #include <gif_lib.h>
3887 void catch() { exit(1); }
3888 int main(void) {
3889 signal(SIGSEGV, catch); // catch segfault
3890 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
3891 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
3892 return 0;
3895 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
3896 _def_gif_4='#define HAVE_GIF_4 1'
3897 _gif="yes"
3899 else
3900 _def_gif='#undef HAVE_GIF'
3901 _def_gif_4='#undef HAVE_GIF_4'
3902 _novomodules="gif89a $_novomodules"
3903 _nocodecmodules="gif $_codecmodules"
3904 _mkf_gif="no"
3906 echores "$_gif"
3909 case "$_gif" in yes*)
3910 echocheck "broken giflib workaround"
3911 _def_gif_tvt_hack='#define HAVE_GIF_TVT_HACK 1'
3913 cat > $TMPC << EOF
3914 #include <gif_lib.h>
3915 int main(void) {
3916 GifFileType gif;
3917 printf("UserData is at address %p\n", gif.UserData);
3918 return 0;
3921 if cc_check "$_ld_gif" && ( "$TMPO" ) >>"$TMPLOG" 2>&1 ; then
3922 _def_gif_tvt_hack='#undef HAVE_GIF_TVT_HACK'
3923 echores "disabled"
3924 else
3925 echores "enabled"
3928 esac
3931 echocheck "VESA support"
3932 if test "$_vesa" = auto ; then
3933 if x86 && linux ; then
3934 _vesa=no
3935 cat > $TMPC << EOF
3936 #include <sys/io.h>
3937 int main(void) { return 0; }
3939 cc_check && _vesa=yes
3942 if test "$_vesa" = yes ; then
3943 _def_vesa='#define HAVE_VESA 1'
3944 _vosrc="$_vosrc vo_vesa.c vesa_lvo.c"
3945 _vomodules="vesa $_vomodules"
3946 echores "yes"
3947 else
3948 _def_vesa='#undef HAVE_VESA'
3949 echores "no (not supported on this OS/architecture)"
3950 _novomodules="vesa $_novomodules"
3953 #################
3954 # VIDEO + AUDIO #
3955 #################
3958 echocheck "SDL"
3959 if test -z "$_sdlconfig" ; then
3960 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
3961 _sdlconfig="sdl-config"
3962 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
3963 _sdlconfig="sdl11-config"
3964 else
3965 _sdlconfig=false
3968 if test "$_sdl" = auto || test "$_sdl" = yes ; then
3969 cat > $TMPC << EOF
3970 #include <SDL.h>
3971 int main(int argc, char *argv[]) { return 0; }
3973 _sdl=no
3974 if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
3975 if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$TMPLOG" 2>&1 ; then
3976 _sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
3977 if test "$_sdlversion" -gt 116 ; then
3978 if test "$_sdlversion" -lt 121 ; then
3979 _def_sdlbuggy='#define BUGGY_SDL'
3980 else
3981 _def_sdlbuggy='#undef BUGGY_SDL'
3983 _sdl=yes
3984 else
3985 _sdl=outdated
3990 if test "$_sdl" = yes ; then
3991 _def_sdl='#define HAVE_SDL 1'
3992 if cygwin ; then
3993 _ld_sdl=`$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/`
3994 _inc_sdl=`$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/`
3995 elif mingw32 ; then
3996 _ld_sdl=`$_sdlconfig --libs | sed s/-mwindows//`
3997 _inc_sdl=`$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`
3998 else
3999 _ld_sdl=`$_sdlconfig --libs`
4000 _inc_sdl=`$_sdlconfig --cflags`
4002 _vosrc="$_vosrc vo_sdl.c"
4003 _vomodules="sdl $_vomodules"
4004 _aosrc="$_aosrc ao_sdl.c"
4005 _aomodules="sdl $_aomodules"
4006 echores "yes (using $_sdlconfig)"
4007 else
4008 _def_sdl='#undef HAVE_SDL'
4009 _novomodules="sdl $_novomodules"
4010 _noaomodules="sdl $_noaomodules"
4011 echores "no"
4014 echocheck "Windows waveout"
4015 if test "$_win32waveout" = auto ; then
4016 cat > $TMPC << EOF
4017 #include <windows.h>
4018 #include <mmsystem.h>
4019 int main(void) { return 0; }
4021 _win32waveout=no
4022 cc_check -lwinmm && _win32waveout=yes
4024 if test "$_win32waveout" = yes ; then
4025 _def_win32waveout='#define HAVE_WIN32WAVEOUT 1'
4026 _ld_win32libs="-lwinmm $_ld_win32libs"
4027 _aosrc="$_aosrc ao_win32.c"
4028 _aomodules="win32 $_aomodules"
4029 else
4030 _def_win32waveout='#undef HAVE_WIN32WAVEOUT'
4031 _noaomodules="win32 $_noaomodules"
4033 echores "$_win32waveout"
4035 echocheck "Directx"
4036 if test "$_directx" = auto ; then
4037 cat > $TMPC << EOF
4038 #include <windows.h>
4039 #include <ddraw.h>
4040 #include <dsound.h>
4041 int main(void) { return 0; }
4043 _directx=no
4044 cc_check -lgdi32 && _directx=yes
4046 if test "$_directx" = yes ; then
4047 _def_directx='#define HAVE_DIRECTX 1'
4048 _ld_win32libs="-lgdi32 $_ld_win32libs"
4049 _vosrc="$_vosrc vo_directx.c"
4050 _vomodules="directx $_vomodules"
4051 _aosrc="$_aosrc ao_dsound.c"
4052 _aomodules="dsound $_aomodules"
4053 else
4054 _def_directx='#undef HAVE_DIRECTX'
4055 _novomodules="directx $_novomodules"
4056 _noaomodules="dsound $_noaomodules"
4058 echores "$_directx"
4060 echocheck "NAS"
4061 if test "$_nas" = auto || test "$_nas" = yes ; then
4062 cat > $TMPC << EOF
4063 #include <audio/audiolib.h>
4064 int main(void) { return 0; }
4066 _nas=no
4067 cc_check -laudio $_inc_x11 -lXt $_ld_x11 -lm && _nas=yes
4069 if test "$_nas" = yes ; then
4070 _def_nas='#define HAVE_NAS 1'
4071 _ld_nas="-laudio -lXt $_ld_x11"
4072 _aosrc="$_aosrc ao_nas.c"
4073 _aomodules="nas $_aomodules"
4074 else
4075 _noaomodules="nas $_noaomodules"
4076 _def_nas='#undef HAVE_NAS'
4078 echores "$_nas"
4080 echocheck "DXR2"
4081 if test "$_dxr2" = auto; then
4082 _dxr2=no
4083 for _inc_dxr2 in "$_inc_dxr2" \
4084 "-I/usr/local/include/dxr2" \
4085 "-I/usr/include/dxr2"; do
4086 cat > $TMPC << EOF
4087 #include <dxr2ioctl.h>
4088 int main(void) { return 0; }
4090 cc_check $_inc_dxr2 && _dxr2=yes && break
4091 done
4093 if test "$_dxr2" = yes; then
4094 _def_dxr2='#define HAVE_DXR2 1'
4095 _vosrc="$_vosrc vo_dxr2.c"
4096 _aosrc="$_aosrc ao_dxr2.c"
4097 _aomodules="dxr2 $_aomodules"
4098 _vomodules="dxr2 $_vomodules"
4099 echores "yes (using $_inc_dxr2)"
4100 else
4101 _def_dxr2='#undef HAVE_DXR2'
4102 _noaomodules="dxr2 $_noaomodules"
4103 _novomodules="dxr2 $_novomodules"
4104 _inc_dxr2=""
4105 echores "no"
4108 echocheck "DXR3/H+"
4109 if test "$_dxr3" = auto ; then
4110 cat > $TMPC << EOF
4111 #include <linux/em8300.h>
4112 int main(void) { return 0; }
4114 _dxr3=no
4115 cc_check && _dxr3=yes
4117 if test "$_dxr3" = yes ; then
4118 _def_dxr3='#define HAVE_DXR3 1'
4119 _vosrc="$_vosrc vo_dxr3.c"
4120 _vomodules="dxr3 $_vomodules"
4121 else
4122 _def_dxr3='#undef HAVE_DXR3'
4123 _novomodules="dxr3 $_novomodules"
4124 if test "$_mp1e" = auto ; then
4125 # we don't need mp1e
4126 _mp1e=no
4129 echores "$_dxr3"
4131 echocheck "libmp1e"
4132 if test "$_mmx" = no ; then
4133 # mp1e REQUIRES mmx!
4134 _mp1e=no
4136 if test "$_mp1e" != no ; then
4137 _mp1e=yes
4138 _def_mp1e='#define USE_MP1E'
4139 _ld_mp1e='libmp1e/libmp1e.a'
4140 _dep_mp1e='libmp1e/libmp1e.a'
4141 else
4142 _mp1e=no
4143 _def_mp1e='#undef USE_MP1E'
4144 _ld_mp1e=""
4145 _dep_mp1e=''
4147 echores "$_mp1e"
4150 echocheck "libfame"
4151 if test "$_fame" = auto ; then
4152 _fame=no
4153 test "$_dxr2" = yes && _fame=auto
4154 test "$_dxr3" = yes && _fame=auto
4155 test "$_dvb" = yes && _fame=auto
4157 if test "$_fame" = auto ; then
4158 _fame=no
4159 if test -d libfame && test -f libfame/fame.h ; then
4160 # disable fame on cygwin as no sense to port - atmos
4161 cygwin || _fame=yes
4162 echores $_fame
4163 else
4164 echores "no (no fame dir)"
4166 else
4167 echores "$_fame"
4170 _def_fame='#undef USE_LIBFAME'
4171 if test "$_fame" = yes ; then
4172 _def_fame='#define USE_LIBFAME 1'
4173 _ld_fame='libfame/libfame.a'
4177 #########
4178 # AUDIO #
4179 #########
4182 echocheck "OSS Audio"
4183 if test "$_ossaudio" = auto ; then
4184 cat > $TMPC << EOF
4185 #include <sys/ioctl.h>
4186 $_inc_soundcard
4187 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
4189 _ossaudio=no
4190 cc_check && _ossaudio=yes
4192 if test "$_ossaudio" = yes ; then
4193 _def_ossaudio='#define USE_OSS_AUDIO 1'
4194 _aosrc="$_aosrc ao_oss.c"
4195 _aomodules="oss $_aomodules"
4196 if test "$_linux_devfs" = yes; then
4197 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
4198 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
4199 else
4200 cat > $TMPC << EOF
4201 #include <sys/ioctl.h>
4202 $_inc_soundcard
4203 #ifdef OPEN_SOUND_SYSTEM
4204 int main(void) { return 0; }
4205 #else
4206 #error Not the real thing
4207 #endif
4209 _real_ossaudio=no
4210 cc_check && _real_ossaudio=yes
4211 if test "$_real_ossaudio" = yes; then
4212 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4213 elif netbsd || openbsd ; then
4214 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
4215 _ld_arch="$_ld_arch -lossaudio"
4216 else
4217 _def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
4219 _def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
4221 else
4222 _def_ossaudio='#undef USE_OSS_AUDIO'
4223 _def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
4224 _def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
4225 _noaomodules="oss $_noaomodules"
4227 echores "$_ossaudio"
4230 echocheck "aRts"
4231 if test "$_arts" = auto ; then
4232 _arts=no
4233 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
4235 cat > $TMPC << EOF
4236 #include <artsc.h>
4237 int main(void) { return 0; }
4239 cc_check `artsc-config --libs` `artsc-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _arts=yes
4244 if test "$_arts" = yes ; then
4245 _def_arts='#define USE_ARTS 1'
4246 _aosrc="$_aosrc ao_arts.c"
4247 _aomodules="arts $_aomodules"
4248 _ld_arts=`artsc-config --libs`
4249 _inc_arts=`artsc-config --cflags`
4250 else
4251 _noaomodules="arts $_noaomodules"
4253 echores "$_arts"
4256 echocheck "EsounD"
4257 if test "$_esd" = auto ; then
4258 _esd=no
4259 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
4261 cat > $TMPC << EOF
4262 #include <esd.h>
4263 int main(void) { return 0; }
4265 cc_check `esd-config --libs` `esd-config --cflags` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _esd=yes
4269 echores "$_esd"
4271 if test "$_esd" = yes ; then
4272 _def_esd='#define USE_ESD 1'
4273 _aosrc="$_aosrc ao_esd.c"
4274 _aomodules="esd $_aomodules"
4275 _ld_esd=`esd-config --libs`
4276 _inc_esd=`esd-config --cflags`
4278 echocheck "esd_get_latency()"
4279 cat > $TMPC << EOF
4280 #include <esd.h>
4281 int main(void) { return esd_get_latency(0); }
4283 cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes && _def_esd_latency='#define HAVE_ESD_LATENCY'
4284 echores "$_esd_latency"
4285 else
4286 _def_esd='#undef USE_ESD'
4287 _def_esd_latency='#undef HAVE_ESD_LATENCY'
4288 _noaomodules="esd $_noaomodules"
4292 echocheck "JACK"
4293 if test "$_jack" = auto ; then
4294 _jack=no
4295 if ( ( pkg-config --modversion jack ) > /dev/null 2>&1 ) &&
4296 ( jackd --version | grep version | awk '{ print $3 }' ) >> "$TMPLOG" 2>&1 ; then
4298 cat > $TMPC << EOF
4299 #include <jack/jack.h>
4300 int main(void) { JACK_Init(); return 0; }
4302 # This test only checks the minor version number.
4303 if ( ( test `bio2jack-config --version | cut -d '.' -f 2` -ge 3 ) ) >/dev/null 2>&1 ; then
4304 if test -z "$_bio2jackdir" ; then
4305 cc_check -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4306 else
4307 cc_check -L "$_bio2jackdir" -lbio2jack `pkg-config --libs --cflags jack` && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _jack=yes
4313 if test "$_jack" = yes ; then
4314 _def_jack='#define USE_JACK 1'
4315 _aosrc="$_aosrc ao_jack.c"
4316 _aomodules="jack $_aomodules"
4317 if test -z "$_bio2jackdir" ; then
4318 _ld_jack="-lbio2jack `pkg-config --libs jack`"
4319 else
4320 _ld_jack="-L \"$_bio2jackdir\" -lbio2jack `pkg-config --libs jack`"
4322 _inc_jack=`pkg-config --cflags jack`
4323 else
4324 _noaomodules="jack $_noaomodules"
4326 echores "$_jack"
4329 echocheck "ALSA audio"
4330 if test "$_alsa" != no ; then
4331 _alsa=no
4332 cat > $TMPC << EOF
4333 #include <sys/asoundlib.h>
4334 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==5)); }
4336 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.5.x'
4338 cat > $TMPC << EOF
4339 #include <sys/asoundlib.h>
4340 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4342 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-sys'
4343 cat > $TMPC << EOF
4344 #include <alsa/asoundlib.h>
4345 int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
4347 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='0.9.x-alsa'
4349 cat > $TMPC << EOF
4350 #include <sys/asoundlib.h>
4351 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4353 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-sys'
4354 cat > $TMPC << EOF
4355 #include <alsa/asoundlib.h>
4356 int main(void) { return (!(SND_LIB_MAJOR==1 && SND_LIB_MINOR==0)); }
4358 cc_check -lasound $_ld_dl $_ld_pthread && $TMPO && _alsaver='1.0.x-alsa'
4360 _def_alsa5='#undef HAVE_ALSA5'
4361 _def_alsa9='#undef HAVE_ALSA9'
4362 _def_alsa1x='#undef HAVE_ALSA1X'
4363 _def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
4364 _def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
4365 if test "$_alsaver" ; then
4366 if test "$_alsaver" = '0.5.x' ; then
4367 _aosrc="$_aosrc ao_alsa5.c"
4368 _aomodules="alsa5 $_aomodules"
4369 _def_alsa5='#define HAVE_ALSA5 1'
4370 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4371 echores "yes (using alsa 0.5.x and sys/asoundlib.h)"
4372 elif test "$_alsaver" = '0.9.x-sys' ; then
4373 _aosrc="$_aosrc ao_alsa.c"
4374 _aomodules="alsa $_aomodules"
4375 _def_alsa9='#define HAVE_ALSA9 1'
4376 _def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4377 echores "yes (using alsa 0.9.x and sys/asoundlib.h)"
4378 elif test "$_alsaver" = '0.9.x-alsa' ; then
4379 _aosrc="$_aosrc ao_alsa.c"
4380 _aomodules="alsa $_aomodules"
4381 _def_alsa9='#define HAVE_ALSA9 1'
4382 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4383 echores "yes (using alsa 0.9.x and alsa/asoundlib.h)"
4384 elif test "$_alsaver" = '1.0.x-sys' ; then
4385 _aosrc="$_aosrc ao_alsa.c"
4386 _aomodules="alsa $_aomodules"
4387 _def_alsa1x="#define HAVE_ALSA1X 1"
4388 _def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
4389 echores "yes (using alsa 1.0.x and sys/asoundlib.h)"
4390 elif test "$_alsaver" = '1.0.x-alsa' ; then
4391 _aosrc="$_aosrc ao_alsa.c"
4392 _aomodules="alsa $_aomodules"
4393 _def_alsa1x="#define HAVE_ALSA1X 1"
4394 _def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
4395 echores "yes (using alsa 1.0.x and alsa/asoundlib.h)"
4397 _ld_alsa="-lasound $_ld_dl $_ld_pthread"
4398 else
4399 _noaomodules="alsa $_noaomodules"
4400 echores "no"
4404 echocheck "Sun audio"
4405 if test "$_sunaudio" = auto ; then
4406 cat > $TMPC << EOF
4407 #include <sys/types.h>
4408 #include <sys/audioio.h>
4409 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
4411 _sunaudio=no
4412 cc_check && _sunaudio=yes
4414 if test "$_sunaudio" = yes ; then
4415 _def_sunaudio='#define USE_SUN_AUDIO 1'
4416 _aosrc="$_aosrc ao_sun.c"
4417 _aomodules="sun $_aomodules"
4418 else
4419 _def_sunaudio='#undef USE_SUN_AUDIO'
4420 _noaomodules="sun $_noaomodules"
4422 echores "$_sunaudio"
4425 echocheck "Sun mediaLib"
4426 if test "$_mlib" = auto ; then
4427 _mlib=no
4428 test -z "$_mlibdir" && _mlibdir=/opt/SUNWmlib
4429 cat > $TMPC << EOF
4430 #include <mlib.h>
4431 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
4433 cc_check -I${_mlibdir}/include -L${_mlibdir}/lib -lmlib && _mlib=yes
4435 if test "$_mlib" = yes ; then
4436 _def_mlib='#define HAVE_MLIB 1'
4437 _inc_mlib=" -I${_mlibdir}/include "
4438 _ld_mlib=" -L${_mlibdir}/lib -R${_mlibdir}/lib -lmlib "
4439 else
4440 _def_mlib='#undef HAVE_MLIB'
4442 echores "$_mlib"
4445 echocheck "SGI audio"
4446 if test "$_sgiaudio" = auto ; then
4447 # check for SGI audio
4448 cat > $TMPC << EOF
4449 #include <dmedia/audio.h>
4450 int main(void) { return 0; }
4452 _sgiaudio=no
4453 cc_check && _sgiaudio=yes
4455 if test "$_sgiaudio" = "yes" ; then
4456 _def_sgiaudio='#define USE_SGI_AUDIO 1'
4457 _ld_sgiaudio='-laudio'
4458 _aosrc="$_aosrc ao_sgi.c"
4459 _aomodules="sgi $_aomodules"
4460 else
4461 _def_sgiaudio='#undef USE_SGI_AUDIO'
4462 _noaomodules="sgi $_noaomodules"
4464 echores "$_sgiaudio"
4467 echocheck "VCD support"
4468 if linux || bsdos || freebsd || netbsd || sunos ; then
4469 _inputmodules="vcd $_inputmodules"
4470 _def_vcd='#define HAVE_VCD 1'
4471 echores "ok"
4472 else
4473 _def_vcd='#undef HAVE_VCD'
4474 _noinputmodules="vcd $_noinputmodules"
4475 echores "not supported on this OS"
4478 echocheck "DVD support (libmpdvdkit)"
4479 if test "$_dvdkit" = auto ; then
4480 _dvdkit=no
4481 if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux; then
4482 test -f "./libmpdvdkit2/Makefile" && _dvdkit=yes
4483 test -f "./libmpdvdkit/Makefile" && _dvdkit=yes
4486 if test "$_dvdkit" = yes ; then
4487 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
4488 if test -f "./libmpdvdkit2/Makefile" ; then
4489 _inputmodules="mpdvdkit2 $_inputmodules"
4490 _dvdread=libmpdvdkit2
4491 _dvdkit2=yes
4492 _dvdkit=no
4493 else
4494 _inputmodules="mpdvdkit $_inputmodules"
4495 _dvdread=libmpdvdkit
4497 else
4498 _noinputmodules="mpdvdkit $_noinputmodules"
4500 _def_dvd_linux='#undef HAVE_LINUX_DVD_STRUCT'
4501 _def_dvd_bsd='#undef HAVE_BSD_DVD_STRUCT'
4502 _dev_dvd_openbsd='#undef HAVE_OPENBSD_DVD_STRUCT'
4503 _def_dvd_darwin='#undef DARWIN_DVD_IOCTL'
4504 if linux || netbsd || openbsd || bsdos ; then
4505 _def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
4506 if openbsd ; then
4507 _dev_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
4509 else
4510 if freebsd ; then
4511 _def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
4512 else
4513 if darwin ; then
4514 _def_dvd_darwin='#define DARWIN_DVD_IOCTL'
4518 else
4519 _noinputmodules="mpdvdkit $_noinputmodules"
4521 if test "$_dvdkit" = yes || test "$_dvdkit2" = yes; then
4522 echores "yes"
4523 else
4524 echores "no"
4527 echocheck "DVD support (libdvdread)"
4528 if test "$_dvdread" = auto ; then
4529 cat > $TMPC << EOF
4530 #include <inttypes.h>
4531 #include <dvdread/dvd_reader.h>
4532 #include <dvdread/ifo_types.h>
4533 #include <dvdread/ifo_read.h>
4534 #include <dvdread/nav_read.h>
4535 int main(void) { return 0; }
4537 _dvdread=no
4538 if test "$_dl" = yes; then
4539 cc_check \
4540 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -ldvdread $_ld_dl && \
4541 _dvdread=yes
4544 _def_mpdvdkit="#undef USE_MPDVDKIT"
4545 case "$_dvdread" in
4546 yes)
4547 _largefiles=yes
4548 _def_dvdread='#define USE_DVDREAD 1'
4549 _ld_dvdread='-ldvdread'
4550 _inputmodules="dvdread $_inputmodules"
4551 echores "yes"
4554 _def_dvdread='#undef USE_DVDREAD'
4555 _noinputmodules="dvdread $_noinputmodules"
4556 echores "no"
4558 libmpdvdkit)
4559 _largefiles=yes
4560 _def_dvdread='#define USE_DVDREAD 1'
4561 _ld_dvdread='-Llibmpdvdkit -lmpdvdkit'
4562 _noinputmodules="dvdread $_noinputmodules"
4563 _def_mpdvdkit="#define USE_MPDVDKIT 1"
4564 echores "disabled by libmpdvdkit"
4566 libmpdvdkit2)
4567 _largefiles=yes
4568 _def_dvdread='#define USE_DVDREAD 1'
4569 _ld_dvdread='-Llibmpdvdkit2 -lmpdvdkit'
4570 _noinputmodules="dvdread $_noinputmodules"
4571 _def_mpdvdkit="#define USE_MPDVDKIT 2"
4572 echores "disabled by libmpdvdkit2"
4574 esac
4576 # dvdnav disabled, it does not work
4577 # echocheck "DVD support (libdvdnav)"
4578 # if test "$_dvdnav" = yes ; then
4579 # cat > $TMPC <<EOF
4580 # #include <dvdnav.h>
4581 # int main(void) { dvdnav_t *dvd=0; return 0; }
4582 # EOF
4583 # _dvdnav=no
4584 # test -n "$_dvdnavdir" && _legal_dvdnavdir=-L$_dvdnavdir/.libs
4585 # if test -z "$_dvdnavconfig" ; then
4586 # if ( dvdnav-config --version ) >/dev/null 2>&1 ; then
4587 # _dvdnavconfig="dvdnav-config"
4588 # fi
4589 # fi
4590 # test -z "$_dvdnavdir" && test -n "$_dvdnavconfig" && _dvdnavdir=`$_dvdnavconfig --cflags`
4591 # _used_css=
4592 # test "$_dvdkit" = no && test "$_dvdkit2" = no && _used_css=$_ld_css
4593 # cc_check $_inc_extra -I$_dvdnavdir $_legal_dvdnavdir -ldvdnav $_used_css $_ld_dl $_ld_pthread && _dvdnav=yes
4594 # fi
4595 # if test "$_dvdnav" = yes ; then
4596 # _largefiles=yes
4597 # _def_dvdnav='#define USE_DVDNAV 1'
4598 # if test -n "$_legal_dvdnavdir" ; then
4599 # _ld_css="$_ld_css $_legal_dvdnavdir -ldvdnav"
4600 # elif test -n "$_dvdnavconfig" ; then
4601 # _ld_css="$_ld_css `$_dvdnavconfig --libs`"
4602 # else
4603 # _ld_css="$_ld_css -ldvdnav"
4604 # fi
4605 # if test -n "$_dvdnavconfig" ; then
4606 # _dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
4607 # _def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
4608 # fi
4609 # if test -n "$_dvdnavdir" ; then
4610 # _inc_extra="$_inc_extra -I$_dvdnavdir"
4611 # fi
4612 # _inputmodules="dvdnav $_inputmodules"
4613 # echores "yes"
4614 # else
4615 # _def_dvdnav='#undef USE_DVDNAV'
4616 # _noinputmodules="dvdnav $_noinputmodules"
4617 # echores "no"
4618 # fi
4620 echocheck "cdparanoia"
4621 if test "$_cdparanoia" = auto ; then
4622 cat > $TMPC <<EOF
4623 #include <cdda_interface.h>
4624 #include <cdda_paranoia.h>
4625 // This need a better test. How ?
4626 int main(void) { return 1; }
4628 _cdparanoia=no
4629 if cc_check $_inc_cdparanoia $_ld_cdparanoia -lcdda_interface -lcdda_paranoia -lm ; then
4630 _cdparanoia=yes
4631 else
4632 for I in /usr/include/cdda /usr/local/include/cdda ; do
4633 if cc_check -I$I $_ld_cdparanoia -lcdda_interface -lcdda_paranoia -lm ; then
4634 _cdparanoia=yes; _inc_cdparanoia="-I$I"; break
4636 done
4639 if test "$_cdparanoia" = yes ; then
4640 _def_cdparanoia='#define HAVE_CDDA'
4641 _inputmodules="cdda $_inputmodules"
4642 _ld_cdparanoia="$_ld_cdparanoia -lcdda_interface -lcdda_paranoia"
4643 openbsd && _ld_cdparanoia="$_ld_cdparanoia -lutil"
4644 else
4645 _def_cdparanoia='#undef HAVE_CDDA'
4646 _noinputmodules="cdda $_noinputmodules"
4648 echores "$_cdparanoia"
4651 echocheck "freetype >= 2.0.9"
4653 # freetype depends on iconv
4654 if test "$_iconv" = no ; then
4655 _freetype="no (iconv support needed)"
4658 if test "$_freetype" = auto ; then
4659 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
4660 cat > $TMPC << EOF
4661 #include <stdio.h>
4662 #include <ft2build.h>
4663 #include FT_FREETYPE_H
4664 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
4665 #error "Need FreeType 2.0.9 or newer"
4666 #endif
4667 int main()
4669 FT_Library library;
4670 FT_Int major=-1,minor=-1,patch=-1;
4671 int err=FT_Init_FreeType(&library);
4672 if(err){
4673 printf("Couldn't initialize freetype2 lib, err code: %d\n",err);
4674 exit(err);
4676 FT_Library_Version(library,&major,&minor,&patch); // in v2.1.0+ only :(((
4677 printf("freetype2 header version: %d.%d.%d library version: %d.%d.%d\n",
4678 FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH,
4679 (int)major,(int)minor,(int)patch );
4680 if(major!=FREETYPE_MAJOR || minor!=FREETYPE_MINOR){
4681 printf("Library and header version mismatch! Fix it in your distribution!\n");
4682 exit(1);
4684 return 0;
4687 _freetype=no
4688 cc_check `$_freetypeconfig --cflags` `$_freetypeconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _freetype=yes
4689 else
4690 _freetype=no
4693 if test "$_freetype" = yes ; then
4694 _def_freetype='#define HAVE_FREETYPE'
4695 _inc_freetype=`$_freetypeconfig --cflags`
4696 _ld_freetype=`$_freetypeconfig --libs`
4697 else
4698 _def_freetype='#undef HAVE_FREETYPE'
4700 echores "$_freetype"
4702 if test "$_freetype" = no ; then
4703 _fontconfig=no
4705 echocheck "fontconfig"
4706 if test "$_fontconfig" = auto ; then
4707 if ( pkg-config --modversion fontconfig) > /dev/null 2>&1 ; then
4708 cat > $TMPC << EOF
4709 #include <stdio.h>
4710 #include <fontconfig/fontconfig.h>
4711 int main()
4713 int err = FcInit();
4714 if(err == FcFalse){
4715 printf("Couldn't initialize fontconfig lib\n");
4716 exit(err);
4718 return 0;
4722 _fontconfig=no
4723 cc_check `pkg-config --cflags --libs fontconfig` && ( $TMPO >> "$TMPLOG" ) && _fontconfig=yes
4724 else
4725 _fontconfig=no
4728 if test "$_fontconfig" = yes ; then
4729 _def_fontconfig='#define HAVE_FONTCONFIG'
4730 _inc_fontconfig=`pkg-config --cflags fontconfig`
4731 _ld_fontconfig=`pkg-config --libs fontconfig`
4732 else
4733 _def_fontconfig='#undef HAVE_FONTCONFIG'
4735 echores "$_fontconfig"
4737 echocheck "fribidi with charsets"
4738 if test "$_fribidi" = yes ; then
4739 if ( $_fribidiconfig --version ) >/dev/null 2>&1 ; then
4740 cat > $TMPC << EOF
4741 #include <stdio.h>
4742 #include <fribidi/fribidi.h>
4743 int main()
4745 if(fribidi_parse_charset("UTF-8") != FRIBIDI_CHARSET_UTF8) {
4746 printf("Fribidi headers are not consistents with the library!\n");
4747 exit(1);
4749 return 0;
4752 _fribidi=no
4753 cc_check `$_fribidiconfig --cflags` `$_fribidiconfig --libs` && ( $TMPO >> "$TMPLOG" ) && _fribidi=yes
4754 else
4755 _fribidi=no
4758 if test "$_fribidi" = yes ; then
4759 _def_fribidi='#define USE_FRIBIDI'
4760 _inc_fribidi=`$_fribidiconfig --cflags`
4761 _ld_fribidi=`$_fribidiconfig --libs`
4762 else
4763 _def_fribidi='#undef USE_FRIBIDI'
4765 echores "$_fribidi"
4768 echocheck "ENCA"
4769 if test "$_enca" = auto ; then
4770 cat > $TMPC << EOF
4771 #include <enca.h>
4772 int main()
4774 const char **langs;
4775 size_t langcnt;
4776 langs = enca_get_languages(&langcnt);
4777 return 0;
4780 _enca=no
4781 cc_check -lenca && _enca=yes
4782 if test "$_enca" = yes ; then
4783 _def_enca='#define HAVE_ENCA 1'
4784 _ld_enca='-lenca'
4785 else
4786 _def_enca='#undef HAVE_ENCA'
4789 echores "$_enca"
4792 echocheck "zlib"
4793 cat > $TMPC << EOF
4794 #include <zlib.h>
4795 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
4797 _zlib=no
4798 cc_check -lz && _zlib=yes
4799 if test "$_zlib" = yes ; then
4800 _def_zlib='#define HAVE_ZLIB 1'
4801 _ld_zlib='-lz'
4802 else
4803 _def_zlib='#undef HAVE_ZLIB'
4805 echores "$_zlib"
4808 echocheck "RTC"
4809 if linux ; then
4810 if test "$_rtc" = auto ; then
4811 cat > $TMPC << EOF
4812 #include <sys/ioctl.h>
4813 #include <linux/rtc.h>
4814 int main(void) { return RTC_IRQP_READ; }
4816 _rtc=no
4817 cc_check && _rtc=yes
4819 echores "$_rtc"
4820 else
4821 _rtc=no
4822 echores "no (Linux specific feature)"
4824 if test "$_rtc" = yes ; then
4825 _def_rtc='#define HAVE_RTC 1'
4826 else
4827 _def_rtc='#undef HAVE_RTC'
4831 echocheck "external liblzo support"
4832 if test "$_liblzo" = auto ; then
4833 _liblzo=no
4834 cat > $TMPC << EOF
4835 #include <lzo1x.h>
4836 int main(void) { lzo_init();return 0; }
4838 cc_check -llzo && _liblzo=yes
4840 if test "$_liblzo" = yes ; then
4841 _def_liblzo='#define USE_LIBLZO 1'
4842 _ld_liblzo='-llzo'
4843 _codecmodules="liblzo $_codecmodules"
4844 else
4845 _def_liblzo='#undef USE_LIBLZO'
4846 _nocodecmodules="liblzo $_nocodecmodules"
4848 echores "$_liblzo"
4851 echocheck "mad support"
4852 if test "$_mad" = auto ; then
4853 _mad=no
4854 cat > $TMPC << EOF
4855 #include <mad.h>
4856 int main(void) { return 0; }
4858 cc_check $_madlibdir -lmad && _mad=yes
4860 if test "$_mad" = yes ; then
4861 _def_mad='#define USE_LIBMAD 1'
4862 _ld_mad='-lmad'
4863 _codecmodules="libmad $_codecmodules"
4864 else
4865 _def_mad='#undef USE_LIBMAD'
4866 _nocodecmodules="libmad $_nocodecmodules"
4868 echores "$_mad"
4870 echocheck "Toolame"
4871 if test "$_toolame" = auto ; then
4872 cat > $TMPC <<EOF
4873 #include <toolame.h>
4874 int main(void) { toolame_init(); return 0; }
4876 _toolame=no
4877 _toolame_extraflags=""
4878 _toolame_lib="-ltoolame"
4879 if test -n "$_toolamedir"; then
4880 _toolame_extraflags="-I$_toolamedir -L$_toolamedir"
4882 cc_check $_toolame_extraflags $_toolame_lib -lm && _toolame=yes
4884 if test "$_toolame" = yes ; then
4885 _def_toolame='#define HAVE_TOOLAME 1'
4886 _codecmodules="$_codecmodules toolame"
4887 else
4888 _def_toolame='#undef HAVE_TOOLAME'
4889 _toolame_lib=""
4890 _nocodecmodules="toolame $_nocodecmodules"
4892 if test -z "$_toolamedir" ; then
4893 echores "$_toolame"
4894 else
4895 echores "$_toolame (using $_toolamedir)"
4898 echocheck "OggVorbis support"
4899 if test "$_vorbis" = auto ; then
4900 _vorbis=no
4901 cat > $TMPC << EOF
4902 #include <vorbis/codec.h>
4903 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
4905 cc_check -lvorbis -logg -lm && _vorbis=yes
4907 if test "$_vorbis" = yes ; then
4908 _def_vorbis='#define HAVE_OGGVORBIS 1'
4909 if test "$_tremor" = yes ; then
4910 _def_tremor='#define TREMOR 1'
4911 _ld_vorbis='-lvorbisidec'
4912 else
4913 _def_tremor='#undef TREMOR'
4914 _ld_vorbis='-lvorbis -logg'
4916 _codecmodules="libvorbis $_codecmodules"
4917 else
4918 _def_vorbis='#undef HAVE_OGGVORBIS'
4919 _def_tremor='#undef TREMOR'
4920 _nocodecmodules="libvorbis $_nocodecmodules"
4922 if test "$_vorbis" = yes -a "$_tremor" = yes ; then
4923 echores "$_vorbis (Tremor)"
4924 else
4925 echores "$_vorbis"
4928 echocheck "OggTheora support (only the CVS version!)"
4929 if test "$_theora" = auto ; then
4930 _theora=no
4931 cat > $TMPC << EOF
4932 #include <theora/theora.h>
4933 #include <string.h>
4934 int main(void)
4936 /* theora is in flux, make sure that all interface routines and
4937 * datatypes exist and work the way we expect it, so we don't break
4938 * mplayer */
4939 ogg_packet op;
4940 theora_comment tc;
4941 theora_info inf;
4942 theora_state st;
4943 yuv_buffer yuv;
4944 int r;
4945 double t;
4947 theora_info_init (&inf);
4948 theora_comment_init (&tc);
4950 return 0;
4952 /* we don't want to execute this kind of nonsense; just for making sure
4953 * that compilation works... */
4954 memset(&op, 0, sizeof(op));
4955 r = theora_decode_header (&inf, &tc, &op);
4956 r = theora_decode_init (&st, &inf);
4957 t = theora_granule_time (&st, op.granulepos);
4958 r = theora_decode_packetin (&st, &op);
4959 r = theora_decode_YUVout (&st, &yuv);
4960 theora_clear (&st);
4962 return 0;
4965 cc_check -ltheora -logg -lm && _theora=yes
4967 if test "$_theora" = yes ; then
4968 _def_theora='#define HAVE_OGGTHEORA 1'
4969 _codecmodules="libtheora $_codecmodules"
4970 _ld_theora="-ltheora -logg"
4971 else
4972 _def_theora='#undef HAVE_OGGTHEORA'
4973 _nocodecmodules="libtheora $_nocodecmodules"
4975 echores "$_theora"
4977 echocheck "mp3lib support"
4978 if test "$_mp3lib" = yes ; then
4979 _def_mp3lib='#define USE_MP3LIB 1'
4980 _codecmodules="mp3lib $_codecmodules"
4981 else
4982 _def_mp3lib='#undef USE_MP3LIB'
4983 _nocodecmodules="mp3lib $_nocodecmodules"
4985 echores "$_mp3lib"
4987 echocheck "liba52 support"
4988 if test "$_liba52" = yes ; then
4989 _def_liba52='#define USE_LIBA52 1'
4990 _codecmodules="liba52 $_codecmodules"
4991 else
4992 _def_liba52='#undef USE_LIBA52'
4993 _nocodecmodules="liba52 $_nocodecmodules"
4995 echores "$_liba52"
4997 echocheck "libdts support"
4998 if test "$_libdts" = auto ; then
4999 _libdts=no
5000 cat > $TMPC << EOF
5001 #include <stdint.h>
5002 #include <dts.h>
5003 int main(void) { dts_init (0); return 0; }
5005 cc_check $_inc_libdts $_ld_libdts -ldts -lm && _libdts=yes
5007 if test "$_libdts" = yes ; then
5008 _def_libdts='#define CONFIG_DTS 1'
5009 _ld_libdts="$_ld_libdts -ldts -lm"
5010 _codecmodules="libdts $_codecmodules"
5011 else
5012 _def_libdts='#undef CONFIG_DTS'
5013 _nocodecmodules="libdts $_nocodecmodules"
5015 echores "$_libdts"
5017 echocheck "libmpeg2 support"
5018 if test "$_libmpeg2" = yes ; then
5019 _def_libmpeg2='#define USE_LIBMPEG2 1'
5020 _codecmodules="libmpeg2 $_codecmodules"
5021 else
5022 _def_libmpeg2='#undef USE_LIBMPEG2'
5023 _nocodecmodules="libmpeg2 $_nocodecmodules"
5025 echores "$_libmpeg2"
5028 echocheck "Matroska support"
5029 if test "$_matroska_internal" = yes ; then
5030 _inputmodules="matroska $_inputmodules"
5031 _def_matroska='#define HAVE_MATROSKA 1'
5032 else
5033 _noinputmodules="matroska $_noinputmodules"
5034 _def_matroska='#undef HAVE_MATROSKA'
5036 echores "$_matroska_internal"
5039 echocheck "internal FAAD2 (AAC) support"
5040 _inc_faad="-I`pwd`/libfaad2"
5041 if test "$_faad_internal" = auto ; then
5042 # the faad check needs a config.h file
5043 if not test -f "config.h" ; then
5044 > config.h
5046 # internal faad: check if our dear gcc is able to compile it...
5047 cp "`pwd`/libfaad2/cfft.c" $TMPC
5048 if ( cc_check -c -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer $_inc_faad ); then
5049 _faad_internal=yes
5050 else
5051 _faad_internal="no (broken gcc)"
5054 if test "$_faad_internal" = yes ; then
5055 _def_faad_internal="#define USE_INTERNAL_FAAD 1"
5056 _faad_external=no
5057 else
5058 _def_faad_internal="#undef USE_INTERNAL_FAAD"
5059 _inc_faad=
5061 echores "$_faad_internal"
5064 echocheck "external FAAD2 (AAC) support"
5065 if test "$_faad_external" != no ; then
5066 _ld_faad='-lfaad'
5067 _inc_faad="$_inc_extra"
5068 # external faad: check if it's really faad2 :)
5069 if test "$_faad_external" = auto ; then
5070 _faad_external=no
5071 cat > $TMPC << EOF
5072 #include <faad.h>
5073 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo; testhand = faacDecOpen(); return 0; }
5075 cc_check $_inc_faad $_ld_faad -lm && _faad_external=yes
5077 echores "$_faad_external"
5078 else
5079 echores "no"
5082 if test "$_faad_internal" = yes -o "$_faad_external" = yes; then
5083 echocheck "FAAD2 version"
5084 cat > $TMPC <<EOF
5085 #include <faad.h>
5086 #ifndef FAAD_MIN_STREAMSIZE
5087 #error Too old version
5088 #endif
5089 int main(void) {
5090 #ifdef FAAD2_VERSION
5091 printf("%s\n",FAAD2_VERSION);
5092 #else
5093 printf("1.0\n");
5094 #endif
5095 return 0;
5098 if cc_check -I- $_inc_faad $_ld_faad -lm && "$TMPO" >> "$TMPLOG" ; then
5099 _faad_version=`"$TMPO"`
5100 _faad_tempversion=`"$TMPO" | sed -e 's/^\([0-9]\{1,\}\)\.\([0-9]\{1,\}\).*/\1\2/'`
5101 _def_faad_version="#define FAADVERSION $_faad_tempversion"
5102 echores "$_faad_version"
5103 else
5104 _faad_external=no
5105 _faad_internal=no
5106 echores "failed to get version"
5110 if test "$_faad_external" = yes; then
5111 _def_faad='#define HAVE_FAAD 1'
5112 _codecmodules="faad2(external) $_codecmodules"
5113 elif test "$_faad_internal" = yes; then
5114 _def_faad='#define HAVE_FAAD 1'
5115 _codecmodules="faad2(internal) $_codecmodules"
5116 else
5117 _def_faad='#undef HAVE_FAAD'
5118 _nocodecmodules="faad2 $_nocodecmodules"
5119 _ld_faad=
5122 echocheck "MacOS X SHLB (shared lib) support"
5123 if test "$_macshlb" = auto ; then
5124 if test "$_macosx" = yes ; then
5125 _macshlb=yes
5126 else
5127 _macshlb=no
5130 echores "$_macshlb"
5131 if test "$_macshlb" = yes ; then
5132 _def_macshlb='#define USE_MACSHLB 1'
5133 else
5134 _def_macshlb='#undef USE_MACSHLB'
5137 if test "$_win32" = auto ; then
5138 if x86 ; then
5139 qnx && _win32=no
5140 else
5141 _win32=no # x86 arch only
5145 if test "$_win32" != no ; then
5146 if test -z "$_win32libdir" ; then
5147 for I in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/win32 /usr/lib/win32 ; do
5148 if test -d "$I" ; then
5149 _win32libdir="$I"
5150 break;
5152 done
5156 echocheck "Win32 codec DLL support"
5157 if test "$_win32" = auto ; then
5158 _win32=no
5159 test -n "$_win32libdir" && _win32=yes
5161 if test "$_win32" = yes ; then
5162 _def_win32='#define USE_WIN32DLL 1'
5163 echores "yes (using $_win32libdir)"
5164 else
5165 _def_win32='#undef USE_WIN32DLL'
5166 _nocodecmodules="win32 $_nocodecmodules"
5167 _dshow=no
5168 echores "no"
5171 if test "$_win32" != no ; then
5172 _def_win32_loader='#undef WIN32_LOADER'
5173 echocheck "Win32 loader support"
5174 _ld_win32='loader/libloader.a'
5175 _dep_win32='loader/libloader.a'
5176 _codecmodules="win32 $_codecmodules"
5177 if openbsd ; then
5178 x86 && _ld_win32="$_ld_win32 -li386"
5180 if not win32 ; then
5181 _def_win32_loader='#define WIN32_LOADER 1'
5182 echores "yes"
5183 else
5184 _ld_win32libs="$_ld_win32libs -ladvapi32 -lole32"
5185 echores "no (using native windows)"
5189 echocheck "DirectShow"
5190 if false ; then
5192 if test "$_dshow" != no ; then
5193 _dshow=no
5194 # check if compiler supports C++ and C++-libs are installed correctly
5195 cat > "$TMPCPP" << EOF
5196 #include <string>
5197 class myclass {
5198 private: int ret;
5199 public: int myreturn(void);
5201 int myclass::myreturn(void) { ret = 0; return ret ; }
5202 int main(void) { myclass myobject; return myobject.myreturn(); }
5204 echo "------------------------------------------------" >> "$TMPLOG"
5205 cat "$TMPCPP" >> "$TMPLOG"
5206 if ( $_cc "$TMPCPP" -o "$TMPO" && "$TMPO" ) >> "$TMPLOG" 2>&1 ; then
5207 _dshow=yes
5208 echores "yes (C++ is ok)"
5209 else
5210 echores "no"
5211 cat << EOF
5213 Your C++ runtime environment is broken.
5215 Hints: Does $_cc support C++? Do you have you a C++ compiler installed?
5216 Are the C++ libraries correctly installed?
5217 Check for libstdc++ and in (/etc/)ld.so.conf.
5219 If you do not need DirectShow support, you can also use:
5220 ./configure --disable-dshow <your-normal-configure-options>
5221 to disable building the C++ based DirectShow code.
5224 die "$_cc's C++ is broken"
5230 echores "$_dshow"
5232 if test "$_dshow" = yes ; then
5233 _def_dshow='#define USE_DIRECTSHOW 1'
5234 _ld_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5235 _dep_dshow='loader/dshow/libDS_Filter.a loader/dmo/libDMO_Filter.a'
5236 _codecmodules="dshow/dmo $_codecmodules"
5237 else
5238 _def_dshow='#undef USE_DIRECTSHOW'
5239 _nocodecmodules="dshow/dmo $_nocodecmodules"
5243 echocheck "XAnim DLL"
5244 if test "$_xanim" = auto ; then
5245 _xanim=no
5246 if test "$_dl" = yes ; then
5247 if test -z "$_xanimlibdir" ; then
5248 for I in "$_libdir/codecs" /usr/local/lib/xanim/mods /usr/lib/xanim/mods /usr/lib/xanim $XANIM_MOD_DIR ; do
5249 if test -d "$I" ; then
5250 _xanimlibdir="$I"
5251 break;
5253 done
5255 test "$_xanimlibdir" && _xanim=yes
5256 if test "$_xanim" = yes ; then
5257 echores "yes (using $_xanimlibdir)"
5258 else
5259 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5261 else
5262 echores "no (dynamic loader support needed)"
5264 else
5265 echores "$_xanim (using $_xanimlibdir)"
5267 if test "$_xanim" = yes ; then
5268 _def_xanim='#define USE_XANIM 1'
5269 _def_xanim_path="#define XACODEC_PATH \"$_xanimlibdir\""
5270 _codecmodules="xanim $_codecmodules"
5271 else
5272 _def_xanim='#undef USE_XANIM'
5273 _def_xanim_path='#undef XACODEC_PATH'
5274 _nocodecmodules="xanim $_nocodecmodules"
5277 echocheck "RealPlayer DLL"
5278 if test "$_real" = auto ; then
5279 _real=no
5280 if test "$_dl" = yes || test "$_win32" = yes || test "$_macshlb" = yes ; then
5281 # if test "$_dl" = yes ; then
5282 if linux || freebsd || netbsd || win32 || darwin ; then
5283 _real=yes
5284 else
5285 echores "no (tested only on Linux/FreeBSD/NetBSD/Cygwin/MinGW/Darwin)"
5287 if test "$_real" = yes ; then
5288 if test -z "$_reallibdir" ; then
5289 for I in "$_libdir/codecs" "$_libdir/real" /usr/lib/real \
5290 /usr/lib/RealPlayer{9,8,}/Codecs /usr/local/RealPlayer{9,8,}/Codecs \
5291 /usr/local/lib/RealPlayer{9,8,}/Codecs /opt/RealPlayer{9,8,}/{Real/,}Codecs \
5292 {~,}/Applications/RealOne\ Player.app/Contents/MacOS/Library/Codecs \
5293 "$_win32libdir"; do
5294 if test -d "$I" ; then
5295 _reallibdir="$I"
5296 break
5298 done
5300 test "$_reallibdir" || _real=no
5301 if test "$_real" = yes ; then
5302 echores "yes (using $_reallibdir)"
5303 else
5304 echores "no (no suitable directory found - see DOCS/HTML/$_doc_lang/codecs.html)"
5307 else
5308 echores "no (dynamic loader support needed)"
5310 else
5311 echores "$_real (using $_reallibdir)"
5313 if test "$_real" = yes ; then
5314 _def_real='#define USE_REALCODECS 1'
5315 _def_real_path="#define REALCODEC_PATH \"$_reallibdir\""
5316 _codecmodules="real $_codecmodules"
5317 else
5318 _def_real='#undef USE_REALCODECS'
5319 _def_real_path="#undef REALCODEC_PATH"
5320 _nocodecmodules="real $_nocodecmodules"
5324 if test -z "$_livelibdir" ; then
5325 for I in $_libdir/live /usr/lib/live /usr/local/live /usr/local/lib/live; do
5326 if test -d "$I" ; then
5327 _livelibdir="$I"
5328 break;
5330 done
5333 echocheck "LIVE.COM Streaming Media libraries"
5334 if test "$_live" = auto && test "$_network" = yes ; then
5335 _TMPC=$TMPC
5336 TMPC=$TMPCPP
5337 cat >$TMPC <<EOF
5338 #include <liveMedia.hh>
5339 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1090195200)
5340 #error Please upgrade to version 2004.07.19 or later of the "LIVE.COM Streaming Media" libraries - available from <www.live.com/liveMedia/>
5341 #endif
5342 int main(void) {}
5344 if cc_check -I$_livelibdir/liveMedia/include/ -I$_livelibdir/UsageEnvironment/include -I$_livelibdir/groupsock/include; then
5345 _live=yes
5346 else
5347 _live=no
5349 TMPC=$_TMPC
5351 if test "$_live" = yes && test "$_network" = yes ; then
5352 echores "yes (using $_livelibdir)"
5353 _def_live='#define STREAMING_LIVE_DOT_COM 1'
5354 _live_libs_def="# LIVE.COM Streaming Media libraries:
5355 LIVE_LIB_DIR = $_livelibdir
5356 LIVE_LIBS = \$(LIVE_LIB_DIR)/liveMedia/libliveMedia.a
5357 LIVE_LIBS += \$(LIVE_LIB_DIR)/groupsock/libgroupsock.a
5358 LIVE_LIBS += \$(LIVE_LIB_DIR)/UsageEnvironment/libUsageEnvironment.a
5359 LIVE_LIBS += \$(LIVE_LIB_DIR)/BasicUsageEnvironment/libBasicUsageEnvironment.a
5360 LIVE_LIBS += -lstdc++"
5361 _ld_live='$(LIVE_LIBS)'
5362 _inputmodules="live.com $_inputmodules"
5363 else
5364 echores "no"
5365 _def_live='#undef STREAMING_LIVE_DOT_COM'
5366 _noinputmodules="live.com $_noinputmodules"
5370 echocheck "FFmpeg libavcodec (static)"
5371 if test "$_libavcodec" = auto ; then
5372 # Note: static linking is preferred to dynamic linking
5373 _libavcodec=no
5374 if test -d libavcodec && test -f libavcodec/utils.c ; then
5375 if grep avcodec_find_encoder_by_name libavcodec/utils.c > /dev/null 2>&1 ; then
5376 _libavcodec=yes
5377 echores "yes"
5378 else
5379 echores "no (old ffmpeg version, use CVS !)"
5381 else
5382 echores "no (see DOCS/HTML/$_doc_lang/codecs.html)"
5384 else
5385 echores "$_libavcodec"
5388 echocheck "FFmpeg libavformat (static)"
5389 if test "$_libavformat" = auto ; then
5390 # Note: static linking is preferred to dynamic linking
5391 _libavformat=no
5392 if test -d libavformat && test -f libavformat/utils.c ; then
5393 _libavformat=yes
5394 echores "yes"
5395 else
5396 echores "no"
5398 else
5399 echores "$_libavformat"
5402 _def_haveffpostprocess='no'
5403 if test -d libavcodec && test -f libavcodec/libpostproc/postprocess.h ; then
5404 _def_haveffpostprocess='yes'
5407 if test "$_libavcodec" != yes ; then
5408 echocheck "FFmpeg libavcodec (dynamic)"
5409 if test "$_libavcodecso" = auto ; then
5410 _libavcodecso=no
5411 # FIXME : check for avcodec_find_encoder_by_name() for mencoder
5412 cat > $TMPC << EOF
5413 #define FF_POSTPROCESS 1
5414 #include <ffmpeg/avcodec.h>
5415 int main(void) {
5416 avcodec_find_encoder_by_name("");
5417 return 0;
5420 if cc_check -lavcodec -lm ; then
5421 _libavcodecso=yes
5422 echores "yes (using libavcodec.so)"
5423 else
5424 echores "no (libavcodec.so is broken/obsolete)"
5426 else
5427 echores "$_libavcodecso"
5431 _def_libavcodec='#undef USE_LIBAVCODEC'
5432 _def_libavcodecso='#undef USE_LIBAVCODEC_SO'
5433 _def_ffpostprocess='#undef FF_POSTPROCESS'
5434 if test "$_libavcodec" = yes ; then
5435 _def_libavcodec='#define USE_LIBAVCODEC 1'
5436 _ld_libavcodec='libavcodec/libavcodec.a'
5437 _dep_libavcodec='libavcodec/libavcodec.a'
5438 _def_ffpostprocess='#define FF_POSTPROCESS 1'
5439 _codecmodules="libavcodec $_codecmodules"
5440 elif test "$_libavcodecso" = yes ; then
5441 _def_libavcodec='#define USE_LIBAVCODEC 1'
5442 _def_libavcodecso='#define USE_LIBAVCODEC_SO 1'
5443 _ld_libavcodec='-lavcodec'
5444 _codecmodules="libavcodec.so $_codecmodules"
5445 else
5446 _nocodecmodules="libavcodec $_nocodecmodules"
5449 _def_libavformat='#undef USE_LIBAVFORMAT'
5450 _def_libavformat_win32='#undef CONFIG_WIN32'
5451 if test "$_libavformat" = yes ; then
5452 _def_libavformat='#define USE_LIBAVFORMAT 1'
5453 _ld_libavformat='libavformat/libavformat.a'
5454 _dep_libavformat='libavformat/libavformat.a'
5455 if win32 ; then
5456 _def_libavformat_win32='#define CONFIG_WIN32 1'
5460 echocheck "libdv-0.9.5+"
5461 if test "$_libdv" = auto ; then
5462 _libdv=no
5463 cat > $TMPC <<EOF
5464 #include <libdv/dv.h>
5465 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
5467 cc_check -ldv -lm && _libdv=yes
5469 if test "$_libdv" = yes ; then
5470 _def_libdv='#define HAVE_LIBDV095 1'
5471 _ld_libdv="-ldv"
5472 _codecmodules="libdv $_codecmodules"
5473 else
5474 _def_libdv='#undef HAVE_LIBDV095'
5475 _nocodecmodules="libdv $_nocodecmodules"
5477 echores "$_libdv"
5479 echocheck "zr"
5480 if test "$_zr" = auto ; then
5481 #36067's seem to identify themselves as 36057PQC's, so the line
5482 #below should work for 36067's and 36057's.
5483 if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci > /dev/null 2>&1; then
5484 _zr=yes
5485 else
5486 _zr=no
5489 if test "$_zr" = yes ; then
5490 if test "$_libavcodec" = yes ; then
5491 _def_zr='#define HAVE_ZR 1'
5492 _vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
5493 _vomodules="zr zr2 $_vomodules"
5494 echores "$_zr"
5495 else
5496 echores "libavcodec (static) is required by zr, sorry"
5497 _novomodules="zr $_novomodules"
5498 _def_zr='#undef HAVE_ZR'
5500 else
5501 _def_zr='#undef HAVE_ZR'
5502 _novomodules="zr zr2 $_novomodules"
5503 echores "$_zr"
5506 echocheck "bl"
5507 if test "$_bl" = yes ; then
5508 _def_bl='#define HAVE_BL 1'
5509 _vosrc="$_vosrc vo_bl.c"
5510 _vomodules="bl $_vomodules"
5511 else
5512 _def_bl='#undef HAVE_BL'
5513 _novomodules="bl $_novomodules"
5515 echores "$_bl"
5517 echocheck "XviD"
5518 cat > $TMPC << EOF
5519 #include <xvid.h>
5520 int main(void) { xvid_init(0, 0, 0, 0); return 0; }
5522 _ld_xvid="$_ld_xvid -lxvidcore -lm"
5523 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
5524 _xvid=yes
5525 _def_xvid3='#define HAVE_XVID3 1'
5526 _def_xvid4='#undef HAVE_XVID4'
5527 _codecmodules="xvid $_codecmodules"
5528 else
5529 cat > $TMPC << EOF
5530 #include <xvid.h>
5531 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
5533 if test "$_xvid" != no && cc_check $_inc_xvid $_ld_xvid ; then
5534 _xvid=yes
5535 _def_xvid3='#undef HAVE_XVID3'
5536 _def_xvid4='#define HAVE_XVID4 1'
5537 _codecmodules="xvid $_codecmodules"
5538 else
5539 _xvid=no
5540 _ld_xvid=''
5541 _def_xvid3='#undef HAVE_XVID3'
5542 _def_xvid4='#undef HAVE_XVID4'
5543 _nocodecmodules="xvid $_nocodecmodules"
5546 echores "$_xvid"
5548 _xvidcompat=no
5549 _def_decore_xvid='#undef DECORE_XVID'
5550 _def_encore_xvid='#undef ENCORE_XVID'
5551 if test "$_xvid" = yes ; then
5552 echocheck "DivX4 compatibility in XviD"
5553 cat > $TMPC << EOF
5554 #include <divx4.h>
5555 int main(void) { (void) decore(0, 0, 0, 0); return 0; }
5557 cc_check -lm "$_ld_xvid" && _xvidcompat=yes
5558 echores "$_xvidcompat"
5561 echocheck "x264"
5562 cat > $TMPC << EOF
5563 #include <stdint.h>
5564 #include <stdarg.h>
5565 #include <x264.h>
5566 int main(void) { x264_encoder_open((void*)0); return 0; }
5568 _ld_x264="$_ld_x264 -lx264 -lm"
5569 if test "$_x264" != no && cc_check $_inc_x264 $_ld_x264 ; then
5570 _x264=yes
5571 _def_x264='#define HAVE_X264 1'
5572 _codecmodules="x264 $_codecmodules"
5573 else
5574 _x264=no
5575 _ld_x264=''
5576 _def_x264='#undef HAVE_X264'
5577 _nocodecmodules="x264 $_nocodecmodules"
5579 echores "$_x264"
5581 echocheck "DivX4linux/DivX5linux/OpenDivX decore"
5582 # DivX5: DEC_OPT_MEMORY_REQS - DivX4: DEC_OPT_FRAME_311
5583 cat > $TMPC << EOF
5584 #include <decore.h>
5585 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_FRAME_311; }
5587 if test "$_divx4linux" != no && cc_check -lm -ldivxdecore -lm ; then
5588 _opendivx=no
5589 _ld_decore='-ldivxdecore'
5590 _def_decore='#define NEW_DECORE 1'
5591 _def_divx='#define USE_DIVX'
5592 _def_divx5='#undef DECORE_DIVX5'
5593 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5594 _codecmodules="divx4linux $_codecmodules"
5595 echores "DivX4linux (with libdivxdecore.so)"
5596 else
5597 # if test "$_divx4linux" != no ; then
5598 # DivX5 check
5599 # OdivxPP disabled because of:
5600 # ld: Warning: type of symbol `dering' changed from 1 to 2 in opendivx/postprocess.o
5601 cat > $TMPC << EOF
5602 #include <decore.h>
5603 int main(void) { (void) decore(0, 0, 0, 0); return DEC_OPT_INIT; }
5605 if test "$_divx4linux" != no && cc_check -lm -ldivxdecore -lm ; then
5606 _opendivx=no
5607 # _ld_decore='-ldivxdecore opendivx/postprocess.o'
5608 _ld_decore='-ldivxdecore'
5609 _def_decore='#define NEW_DECORE 1'
5610 _def_divx='#define USE_DIVX'
5611 _def_divx5='#define DECORE_DIVX5 1'
5612 # _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
5613 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5614 _codecmodules="divx5linux $_codecmodules"
5615 _nocodecmodules="divx4linux $_nocodecmodules"
5616 echores "DivX5linux (with libdivxdecore.so)"
5617 elif test "$_opendivx" != no ; then
5618 _opendivx=yes
5619 _ld_decore='opendivx/libdecore.a'
5620 _def_decore='#undef NEW_DECORE'
5621 _def_divx='#define USE_DIVX'
5622 _def_divx5='#undef DECORE_DIVX5'
5623 _def_odivx_postprocess='#define HAVE_ODIVX_POSTPROCESS 1'
5624 _codecmodules="opendivx $_codecmodules"
5625 _nocodecmodules="divx5linux $_nocodecmodules"
5626 echores "OpenDivX"
5627 elif test "$_xvidcompat" = yes ; then
5628 _opendivx=no
5629 _ld_decore=''
5630 _def_decore='#define NEW_DECORE 1'
5631 _def_divx='#define USE_DIVX 1'
5632 _def_divx5='#undef DECORE_DIVX5'
5633 _def_decore_xvid='#define DECORE_XVID 1'
5634 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5635 _nocodecmodules="opendivx divx5linux divx4linux $_nocodecmodules"
5636 echores "XviD compat."
5637 else
5638 _opendivx=no
5639 _ld_decore=''
5640 _def_decore='#undef NEW_DECORE'
5641 _def_divx='#undef USE_DIVX'
5642 _def_divx5='#undef DECORE_DIVX5'
5643 _def_odivx_postprocess='#undef HAVE_ODIVX_POSTPROCESS'
5644 _nocodecmodules="opendivx $_nocodecmodules"
5645 echores "no"
5646 fi # DivX5 check
5650 # mencoder requires (optional) those libs: libmp3lame and divx4linux encore
5651 if test "$_mencoder" != no ; then
5653 echocheck "libmp3lame (for mencoder)"
5654 _mp3lame=no
5655 cat > $TMPC <<EOF
5656 #include <lame/lame.h>
5657 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; }
5659 # Note: libmp3lame usually depends on vorbis
5660 cc_check -lmp3lame $_ld_vorbis -lm && ( "$TMPO" >> "$TMPLOG" 2>&1 ) && _mp3lame=yes
5661 if test "$_mp3lame" = yes ; then
5662 _def_mp3lame="#define HAVE_MP3LAME `$TMPO`"
5663 _def_cfg_mp3lame="#define CONFIG_MP3LAME `$TMPO`"
5664 _ld_mp3lame="-lmp3lame $_ld_vorbis"
5665 else
5666 _def_mp3lame='#undef HAVE_MP3LAME'
5667 _def_cfg_mp3lame='#undef CONFIG_MP3LAME'
5669 echores "$_mp3lame"
5672 echocheck "DivX4linux encore (for mencoder)"
5673 cat > $TMPC << EOF
5674 #include <encore2.h>
5675 int main(void) { (void) encore(0, 0, 0, 0); return 0; }
5677 if test "$_divx4linux" != no && cc_check -ldivxencore -lm ; then
5678 _def_encore='#define HAVE_DIVX4ENCORE 1'
5679 _ld_encore='-ldivxencore'
5680 echores "DivX4linux (with libdivxencore.so)"
5681 elif test "$_xvidcompat" = yes ; then
5682 _def_encore='#define HAVE_DIVX4ENCORE 1'
5683 _ld_encore=''
5684 _def_encore_xvid='#define ENCORE_XVID 1'
5685 echores "XviD compat."
5686 else
5687 _def_encore='#undef HAVE_DIVX4ENCORE'
5688 echores "no"
5693 echocheck "mencoder"
5694 _mencoder_flag='#undef HAVE_MENCODER'
5695 if test "$_mencoder" = yes ; then
5696 _mencoder_flag='#define HAVE_MENCODER'
5698 echores "$_mencoder"
5700 echocheck "fastmemcpy"
5701 # fastmemcpy check is done earlier with tests of CPU & binutils features
5702 if test "$_fastmemcpy" = yes ; then
5703 _def_fastmemcpy='#define USE_FASTMEMCPY 1'
5704 else
5705 _def_fastmemcpy='#undef USE_FASTMEMCPY'
5707 echores "$_fastmemcpy"
5709 echocheck "UniquE RAR File Library"
5710 if test "$_unrarlib" = yes ; then
5711 _def_unrarlib='#define USE_UNRARLIB 1'
5712 else
5713 _def_unrarlib='#undef USE_UNRARLIB'
5715 echores "$_unrarlib"
5717 echocheck "TV interface"
5718 if test "$_tv" = yes ; then
5719 _def_tv='#define USE_TV 1'
5720 _inputmodules="tv $_inputmodules"
5721 else
5722 _noinputmodules="tv $_noinputmodules"
5723 _def_tv='#undef USE_TV'
5725 echores "$_tv"
5727 echocheck "EDL support"
5728 if test "$_edl" = yes ; then
5729 _def_edl='#define USE_EDL'
5730 _inputmodules="edl $_inputmodules"
5731 else
5732 _noinputmodules="edl $_noinputmodules"
5733 _def_edl='#undef USE_EDL'
5735 echores "$_edl"
5737 echocheck "*BSD BrookTree 848 TV interface"
5738 if test "$_tv_bsdbt848" = auto ; then
5739 _tv_bsdbt848=no
5740 if test "$_tv" = yes ; then
5741 cat > $TMPC <<EOF
5742 #include <sys/types.h>
5743 #if defined(__NetBSD__)
5744 #include <dev/ic/bt8xx.h>
5745 #else
5746 #include <machine/ioctl_bt848.h>
5747 #endif
5748 int main(void) { return 0; }
5750 cc_check && _tv_bsdbt848=yes
5753 if test "$_tv_bsdbt848" = yes ; then
5754 _def_tv_bsdbt848='#define HAVE_TV_BSDBT848 1'
5755 _inputmodules="tv-bsdbt848 $_inputmodules"
5756 else
5757 _def_tv_bsdbt848='#undef HAVE_TV_BSDBT848'
5758 _noinputmodules="tv-bsdbt848 $_noinputmodules"
5760 echores "$_tv_bsdbt848"
5762 echocheck "Video 4 Linux TV interface"
5763 if test "$_tv_v4l" = auto ; then
5764 _tv_v4l=no
5765 if test "$_tv" = yes && linux ; then
5766 for I in /dev/video /dev/video? ; do
5767 if test -c $I ; then
5768 cat > $TMPC <<EOF
5769 #include <stdlib.h>
5770 #include <linux/videodev.h>
5771 int main(void) { return 0; }
5773 cc_check && _tv_v4l=yes
5774 break
5776 done
5779 if test "$_tv_v4l" = yes ; then
5780 _def_tv_v4l='#define HAVE_TV_V4L 1'
5781 _inputmodules="tv-v4l $_inputmodules"
5782 else
5783 _noinputmodules="tv-v4l $_noinputmodules"
5784 _def_tv_v4l='#undef HAVE_TV_V4L'
5786 echores "$_tv_v4l"
5789 echocheck "Video 4 Linux 2 TV interface"
5790 if test "$_tv_v4l2" = auto ; then
5791 _tv_v4l2=no
5792 if test "$_tv" = yes && linux ; then
5793 for I in /dev/video /dev/video? ; do
5794 if test -c $I ; then
5795 _tv_v4l2=yes
5796 break
5798 done
5801 if test "$_tv_v4l2" = yes ; then
5802 _def_tv_v4l2='#define HAVE_TV_V4L2 1'
5803 _inputmodules="tv-v4l2 $_inputmodules"
5804 else
5805 _noinputmodules="tv-v4l2 $_noinputmodules"
5806 _def_tv_v4l2='#undef HAVE_TV_V4L2'
5808 echores "$_tv_v4l2"
5811 echocheck "audio select()"
5812 if test "$_select" = no ; then
5813 _def_select='#undef HAVE_AUDIO_SELECT'
5814 elif test "$_select" = yes ; then
5815 _def_select='#define HAVE_AUDIO_SELECT 1'
5817 echores "$_select"
5820 echocheck "network"
5821 # FIXME network check
5822 if test "$_network" != no ; then
5823 _def_network='#define MPLAYER_NETWORK 1'
5824 _ld_network="$_ld_sock"
5825 _inputmodules="network $_inputmodules"
5826 else
5827 _noinputmodules="network $_noinputmodules"
5828 _def_network='#undef MPLAYER_NETWORK'
5829 _ftp=no
5831 echores "$_network"
5833 echocheck "ftp"
5834 if test "$_ftp" != no ; then
5835 _def_ftp='#define HAVE_FTP 1'
5836 _inputmodules="ftp $_inputmodules"
5837 else
5838 _noinputmodules="ftp $_noinputmodules"
5839 _def_ftp='#undef HAVE_FTP'
5841 echores "$_ftp"
5843 # endian testing
5844 echocheck "byte order"
5845 if test "$_big_endian" = auto ; then
5846 cat > $TMPC <<EOF
5847 short asci_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|0)};
5848 int main(){
5849 char* s = (char*)asci_name;
5850 return 0;
5853 if cc_check ; then
5854 if test `grep -l MPlayer $TMPO` ; then
5855 _big_endian=yes
5856 else
5857 _big_endian=no
5859 else
5860 echo -n "failed to autodetect byte order, defaulting to "
5863 if test "$_big_endian" = yes ; then
5864 _byte_order='big-endian'
5865 _def_words_endian='#define WORDS_BIGENDIAN 1'
5866 else
5867 _byte_order='little-endian'
5868 _def_words_endian='#undef WORDS_BIGENDIAN'
5870 echores "$_byte_order"
5872 echocheck "shared postprocess lib"
5873 echores "$_shared_pp"
5875 echocheck "OSD menu"
5876 if test "$_menu" = yes ; then
5877 _def_menu='#define HAVE_MENU 1'
5878 else
5879 _def_menu='#undef HAVE_MENU'
5881 echores "$_menu"
5883 # Check to see if they want QTX codecs enabled
5884 echocheck "QTX codecs"
5885 if test "$_qtx" = auto ; then
5886 _qtx=$_win32
5888 if test "$_qtx" = yes ; then
5889 _def_qtx='#define USE_QTX_CODECS 1'
5890 _codecmodules="qtx $_codecmodules"
5891 else
5892 _def_qtx='#undef USE_QTX_CODECS'
5893 _nocodecmodules="qtx $_nocodecmodules"
5895 echores "$_qtx"
5898 echocheck "Subtitles sorting"
5899 if test "$_sortsub" = yes ; then
5900 _def_sortsub='#define USE_SORTSUB 1'
5901 else
5902 _def_sortsub='#undef USE_SORTSUB'
5904 echores "$_sortsub"
5907 echocheck "XMMS inputplugin support"
5908 if test "$_xmms" = yes ; then
5910 if ( xmms-config --version ) >/dev/null 2>&1 ; then
5911 if test -z "$_xmmsplugindir" ; then
5912 _xmmsplugindir=`xmms-config --input-plugin-dir`
5914 if test -z "$_xmmslibdir" ; then
5915 _xmmslibdir=`xmms-config --exec-prefix`/lib
5917 else
5918 if test -z "$_xmmsplugindir" ; then
5919 _xmmsplugindir=/usr/lib/xmms/Input
5921 if test -z "$_xmmslibdir" ; then
5922 _xmmslibdir=/usr/lib
5926 _def_xmms='#define HAVE_XMMS 1'
5927 if darwin ; then
5928 _xmms_lib="${_xmmslibdir}/libxmms.dylib"
5929 else
5930 _xmms_lib="${_xmmslibdir}/libxmms.so.1 -export-dynamic"
5932 else
5933 _def_xmms='#undef HAVE_XMMS'
5935 echores "$_xmms"
5937 echocheck "inet6"
5938 if test "$_inet6" = auto ; then
5939 cat > $TMPC << EOF
5940 #include <sys/types.h>
5941 #include <sys/socket.h>
5942 int main(void) { socket(AF_INET6, SOCK_STREAM, AF_INET6); }
5944 _inet6=no
5945 if cc_check ; then
5946 _inet6=yes
5949 if test "$_inet6" = yes ; then
5950 _def_inet6='#define HAVE_AF_INET6 1'
5951 else
5952 _def_inet6='#undef HAVE_AF_INET6'
5954 echores "$_inet6"
5957 echocheck "gethostbyname2"
5958 if test "$_gethostbyname2" = auto ; then
5959 cat > $TMPC << EOF
5960 #include <sys/types.h>
5961 #include <sys/socket.h>
5962 #include <netdb.h>
5963 int main(void) { gethostbyname2("", AF_INET); }
5965 _gethostbyname2=no
5966 if cc_check ; then
5967 _gethostbyname2=yes
5971 if test "$_gethostbyname2" = yes ; then
5972 _def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
5973 else
5974 _def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
5976 echores "$_gethostbyname2"
5978 # --------------- GUI specific tests begin -------------------
5979 echocheck "GUI"
5980 echo "$_gui"
5981 if test "$_gui" = yes ; then
5983 # Required libraries
5984 test "$_png" != yes && die "PNG support required for GUI compilation, please install libpng and libpng-dev packages."
5985 test "$_x11" != yes && die "X11 support required for GUI compilation"
5987 echocheck "XShape extension"
5988 _xshape=no
5989 if test "$_x11" = yes ; then
5990 cat > $TMPC << EOF
5991 #include <X11/Xlib.h>
5992 #include <X11/Xproto.h>
5993 #include <X11/Xutil.h>
5994 #include <X11/extensions/shape.h>
5995 #include <stdlib.h>
5996 int main(void) {
5997 char *name = ":0.0";
5998 Display *wsDisplay;
5999 int exitvar = 0;
6000 int eventbase, errorbase;
6001 if (getenv("DISPLAY"))
6002 name=getenv("DISPLAY");
6003 wsDisplay=XOpenDisplay(name);
6004 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
6005 exitvar=1;
6006 XCloseDisplay(wsDisplay);
6007 return exitvar;
6010 cc_check $_inc_x11 $_ld_x11 && _xshape=yes
6012 if test "$_xshape" = yes ; then
6013 _def_xshape='#define HAVE_XSHAPE 1'
6014 else
6015 die "The GUI requires the X11 extension XShape (which was not found)."
6017 echores "$_xshape"
6020 # Check for GTK:
6021 echocheck "GTK version"
6022 if test -z "$_gtkconfig" ; then
6023 if ( gtk-config --version ) >/dev/null 2>&1 ; then
6024 _gtkconfig="gtk-config"
6025 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
6026 _gtkconfig="gtk12-config"
6027 else
6028 die "The GUI requires GTK devel packages (which were not found)."
6031 _gtk=`$_gtkconfig --version 2>&1`
6032 _inc_gtk=`$_gtkconfig --cflags 2>&1`
6033 _ld_gtk=`$_gtkconfig --libs 2>&1`
6034 echores "$_gtk (using $_gtkconfig)"
6036 # Check for GLIB
6037 echocheck "glib version"
6038 if test -z "$_glibconfig" ; then
6039 if ( glib-config --version ) >/dev/null 2>&1 ; then
6040 _glibconfig="glib-config"
6041 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
6042 _glibconfig="glib12-config"
6043 else
6044 die "The GUI requires GLib devel packages (which were not found)"
6047 _glib=`$_glibconfig --version 2>&1`
6048 _inc_glib=`$_glibconfig --cflags 2>&1`
6049 _ld_glib=`$_glibconfig --libs 2>&1`
6050 echores "$_glib (using $_glibconfig)"
6052 _def_gui='#define HAVE_NEW_GUI 1'
6053 _ld_gui='$(GTKLIB) $(GLIBLIB)'
6055 echo "Creating Gui/config.mak"
6056 cat > Gui/config.mak << EOF
6057 # -------- Generated by configure -----------
6059 GTKINC = $_inc_gtk
6060 GTKLIBS = $_ld_gtk
6061 GLIBINC = $_inc_glib
6062 GLIBLIBS = $_ld_glib
6066 else
6067 _def_gui='#undef HAVE_NEW_GUI'
6069 # --------------- GUI specific tests end -------------------
6073 #############################################################################
6075 # Checking for CFLAGS
6076 _stripbinaries=yes
6077 if test "$_profile" != "" || test "$_debug" != "" ; then
6078 CFLAGS="-W -Wall -O2 $_march $_mcpu $_debug $_profile"
6079 if test "$_cc_major" -ge "3" ; then
6080 CFLAGS=`echo "$CFLAGS" | sed -e 's/\(-Wall\)/\1 -Wno-unused-parameter/'`
6082 _stripbinaries=no
6083 elif test -z "$CFLAGS" ; then
6084 CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
6085 # always compile with '-g' if .developer:
6086 if test -f ".developer" ; then
6087 CFLAGS="-g $CFLAGS"
6088 _stripbinaries=no
6090 else
6091 cat <<EOF
6093 MPlayer compilation will use the CFLAGS set by you, but:
6095 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
6097 It is strongly recommended to let MPlayer choose the correct CFLAGS!
6098 To do so, execute 'CFLAGS= ./configure <options>'
6102 if darwin ; then
6103 CFLAGS="$CFLAGS -DSYS_DARWIN"
6104 if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
6105 CFLAGS="$CFLAGS -no-cpp-precomp"
6108 # libavcodec (from ffmpeg) requires CONFIG_DARWIN to enable AltiVec on Darwin/MacOSX
6109 test "$_altivec" = yes && CFLAGS="$CFLAGS -DCONFIG_DARWIN"
6111 if hpux ; then
6112 # use flag for HPUX missing setenv()
6113 CFLAGS="$CFLAGS -DHPUX"
6115 # Thread support
6116 if linux ; then
6117 CFLAGS="$CFLAGS -D_REENTRANT"
6118 elif bsd ; then
6119 # FIXME bsd needs this so maybe other OS'es
6120 CFLAGS="$CFLAGS -D_THREAD_SAFE"
6122 # 64 bit file offsets?
6123 if test "$_largefiles" = yes || freebsd ; then
6124 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
6125 if test "$_dvdread" = yes ; then
6126 # dvdread support requires this (for off64_t)
6127 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
6131 echocheck "ftello()"
6132 # if we don't have ftello use the osdep/ compatibility module
6133 cat > $TMPC << EOF
6134 #include <stdio.h>
6135 #include <sys/types.h>
6136 int main (void) { ftello(stdin); return 0; }
6138 _ftello=no
6139 cc_check && _ftello=yes
6140 if test "$_ftello" = yes ; then
6141 _def_ftello='#define HAVE_FTELLO 1'
6142 else
6143 _def_ftello='#undef HAVE_FTELLO'
6145 echores "$_ftello"
6147 # Determine OS dependent libs
6148 if cygwin ; then
6149 _def_confwin32='#define WIN32'
6150 #CFLAGS="$CFLAGS -D__CYGWIN__ -D__CYGWIN_USE_BIG_TYPES__"
6151 # stat.st_size with BIG_TYPES is broken (not set) ::atmos
6152 CFLAGS="$CFLAGS -D__CYGWIN__"
6155 if win32 ; then
6156 _confwin32='TARGET_WIN32 = yes'
6157 else
6158 _confwin32='TARGET_WIN32 = no'
6161 # Dynamic linking flags
6162 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
6163 _ld_dl_dynamic=''
6164 bsd && _ld_dl_dynamic='-rdynamic'
6165 if test "$_real" = yes || test "$_xanim" = yes && not win32 && not qnx ; then
6166 _ld_dl_dynamic='-rdynamic'
6169 _ld_arch="$_ld_arch $_ld_pthread $_ld_dl $_ld_dl_dynamic"
6170 bsdos && _ld_arch="$_ld_arch -ldvd"
6171 if netbsd ; then
6172 x86 && _ld_arch="$_ld_arch -li386"
6175 _def_debug='#undef MP_DEBUG'
6176 test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
6178 _def_linux='#undef TARGET_LINUX'
6179 linux && _def_linux='#define TARGET_LINUX 1'
6181 # TODO cleanup the VIDIX stuff here
6182 _def_vidix='#define CONFIG_VIDIX 1'
6183 test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX'
6184 if test "$_vidix" = yes; then
6185 _vosrc="$_vosrc vo_cvidix.c"
6186 _vomodules="cvidix $_vomodules"
6187 else
6188 _novomodules="cvidix $_novomodules"
6190 if test "$_vidix" = yes && (win32); then
6191 _vosrc="$_vosrc vo_winvidix.c"
6192 _vomodules="winvidix $_vomodules"
6193 else
6194 _novomodules="winvidix $_novomodules"
6196 if test "$_vidix" = yes && test "$_x11" = yes; then
6197 _vosrc="$_vosrc vo_xvidix.c"
6198 _vomodules="xvidix $_vomodules"
6199 else
6200 _novomodules="xvidix $_novomodules"
6202 echo Checking for VIDIX ... "$_vidix"
6204 _def_joystick='#undef HAVE_JOYSTICK'
6205 if test "$_joystick" = yes ; then
6206 if linux ; then
6207 # TODO add some check
6208 _def_joystick='#define HAVE_JOYSTICK 1'
6209 else
6210 _joystick="no (unsupported under $system_name)"
6213 echo Checking for joystick ... "$_joystick"
6215 echocheck "lirc"
6216 if test "$_lirc" = auto ; then
6217 _lirc=no
6218 if test -c /dev/lirc -o -c /dev/lirc/0 ; then
6219 cat > $TMPC <<EOF
6220 #include <lirc/lirc_client.h>
6221 int main(void) { return 0; }
6223 cc_check -llirc_client && _lirc=yes
6226 if test "$_lirc" = yes ; then
6227 _def_lirc='#define HAVE_LIRC 1'
6228 _ld_lirc='-llirc_client'
6229 else
6230 _def_lirc='#undef HAVE_LIRC'
6232 echores "$_lirc"
6234 echocheck "lircc"
6235 if test "$_lircc" = auto ; then
6236 _lircc=no
6237 cat > $TMPC <<EOF
6238 #include <lirc/lircc.h>
6239 int main(void) { return 0; }
6241 cc_check -llircc && _lircc=yes
6243 if test "$_lircc" = yes ; then
6244 _def_lircc='#define HAVE_LIRCC 1'
6245 _ld_lircc='-llircc'
6246 else
6247 _def_lircc='#undef HAVE_LIRCC'
6249 echores "$_lircc"
6251 #############################################################################
6252 echo "Creating config.mak"
6253 cat > config.mak << EOF
6254 # -------- Generated by configure -----------
6256 LANG = C
6257 MAN_LANG = $MAN_LANG
6258 TARGET_OS = $system_name
6259 DESTDIR =
6260 prefix = \$(DESTDIR)$_prefix
6261 BINDIR = \$(DESTDIR)$_bindir
6262 DATADIR = \$(DESTDIR)$_datadir
6263 MANDIR = \$(DESTDIR)$_mandir
6264 CONFDIR = \$(DESTDIR)$_confdir
6265 LIBDIR = \$(DESTDIR)$_libdir
6266 #AR = ar
6267 CC = $_cc
6268 HOST_CC = $_host_cc
6269 AWK = $_awk
6270 RANLIB = $_ranlib
6271 INSTALL = $_install
6272 # OPTFLAGS = -O4 $_profile $_debug $_march $_mcpu $_pipe -fomit-frame-pointer -ffast-math
6273 EXTRA_INC = $_inc_extra $_inc_gtk
6274 OPTFLAGS = -I../libvo -I../../libvo $_inc_x11 $CFLAGS \$(EXTRA_INC)
6275 STRIPBINARIES = $_stripbinaries
6277 PRG = $_prg
6278 PRG_MENCODER = $_prg_mencoder
6280 $_live_libs_def
6282 MPLAYER_NETWORK = $_network
6283 STREAMING_LIVE_DOT_COM = $_live
6284 MPLAYER_NETWORK_LIB = $_ld_live $_ld_network
6285 DVBIN = $_dvbin
6286 VIDIX = $_vidix
6287 SHARED_PP = $_shared_pp
6288 CONFIG_PP = yes
6289 CONFIG_RISKY = yes
6290 CONFIG_MP3LAME = $_mp3lame
6291 LIBMENU = $_menu
6292 I18NLIBS = $_i18n_libs
6293 MATROSKA = $_matroska_internal
6295 OPENDIVX = $_opendivx
6297 MP3LIB = $_mp3lib
6298 LIBA52 = $_liba52
6299 LIBMPEG2 = $_libmpeg2
6301 UNRARLIB = $_unrarlib
6302 HAVE_FFPOSTPROCESS = $_def_haveffpostprocess
6303 PNG = $_mkf_png
6304 JPEG = $_mkf_jpg
6305 GIF = $_mkf_gif
6307 EXTRA_LIB = $_ld_extra
6308 Z_LIB = $_ld_static $_ld_zlib
6309 HAVE_MLIB = $_mlib
6310 WIN32_LIB = $_ld_win32libs
6311 STATIC_LIB = $_ld_static
6312 ENCA_LIB = $_ld_enca
6313 HAVE_PTHREADS = $_pthreads
6315 X11_INC = $_inc_x11
6316 X11DIR = $_ld_x11
6318 HAVE_XVMC_ACCEL = $_xvmc
6320 # for libavcodec:
6321 SRC_PATH=..
6322 LIBPREF=lib
6323 LIBSUF=.a
6324 SLIBPREF=lib
6325 SLIBSUF=.so
6327 # video output
6328 X_LIB = $_ld_gl $_ld_dga $_ld_xv $_ld_xvmc $_ld_vm $_ld_xinerama $_ld_x11 $_ld_sock
6329 GGI_LIB = $_ld_ggi
6330 MLIB_LIB = $_ld_mlib
6331 MLIB_INC = $_inc_mlib
6332 DXR2_INC = $_inc_dxr2
6333 DVB_INC = $_inc_dvb
6334 PNG_LIB = $_ld_png
6335 JPEG_LIB = $_ld_jpg
6336 GIF_LIB = $_ld_gif
6337 SDL_LIB = $_ld_sdl
6338 SVGA_LIB = $_ld_svga
6339 AA_LIB = $_ld_aa
6340 CACA_INC = $_inc_caca
6341 CACA_LIB = $_ld_caca
6343 # audio output
6344 ALSA_LIB = $_ld_alsa
6345 NAS_LIB = $_ld_nas
6346 ARTS_LIB = $_ld_arts
6347 ARTS_INC = $_inc_arts
6348 ESD_LIB = $_ld_esd
6349 ESD_INC = $_inc_esd
6350 JACK_LIB = $_ld_jack
6351 JACK_INC = $_inc_jack
6352 SGIAUDIO_LIB = $_ld_sgiaudio
6354 # input/demuxer/codecs
6355 TERMCAP_LIB = $_ld_termcap
6356 LIRC_LIB = $_ld_lirc
6357 LIRCC_LIB = $_ld_lircc
6358 DVDREAD_LIB = $_ld_dvdread
6359 DVDKIT = $_dvdkit
6360 DVDKIT2 = $_dvdkit2
6361 DVDKIT_SHARED = no
6362 SDL_INC = $_inc_sdl
6363 W32_DEP = $_dep_win32
6364 W32_LIB = $_ld_win32
6365 DS_DEP = $_dep_dshow
6366 DS_LIB = $_ld_dshow
6367 AV_DEP = $_dep_libavcodec $_dep_libavformat
6368 AV_LIB = $_ld_libavcodec $_ld_libavformat
6369 CONFIG_LIBAVFORMAT = $_libavformat
6370 ZORAN = $_zr
6371 FAME = $_fame
6372 FAME_LIB = $_ld_fame
6373 MP1E_DEP = $_dep_mp1e
6374 MP1E_LIB = $_ld_mp1e
6375 ARCH_LIB = $_ld_arch $_ld_iconv
6376 XVID = $_xvid
6377 XVID_INC = $_inc_xvid
6378 XVID_LIB = $_ld_xvid
6379 X264 = $_x264
6380 X264_INC = $_inc_x264
6381 X264_LIB = $_ld_x264
6382 CONFIG_DTS = $_libdts
6383 DTS_INC = $_inc_libdts
6384 DTS_LIB = $_ld_libdts
6385 DECORE_LIB = $_ld_decore $_ld_mp3lame
6386 MENCODER = $_mencoder
6387 ENCORE_LIB = $_ld_encore $_ld_mp3lame
6388 DIRECTFB_INC = $_inc_directfb
6389 DIRECTFB_LIB = $_ld_directfb
6390 CDPARANOIA_INC = $_inc_cdparanoia
6391 CDPARANOIA_LIB = $_ld_cdparanoia
6392 FREETYPE_INC = $_inc_freetype
6393 FREETYPE_LIB = $_ld_freetype
6394 FONTCONFIG_INC = $_inc_fontconfig
6395 FONTCONFIG_LIB = $_ld_fontconfig
6396 FRIBIDI_INC = $_inc_fribidi
6397 FRIBIDI_LIB = $_ld_fribidi
6398 LIBLZO_LIB= $_ld_liblzo
6399 MAD_LIB = $_ld_mad
6400 VORBIS_LIB = $_ld_vorbis $_ld_libdv
6401 THEORA_LIB = $_ld_theora
6402 FAAD_LIB = $_ld_faad
6403 INTERNAL_FAAD = $_faad_internal
6404 SMBSUPPORT_LIB = $_ld_smb
6405 XMMS_PLUGINS = $_xmms
6406 XMMS_LIB = $_xmms_lib
6407 MACOSX = $_macosx
6408 MACOSX_FRAMEWORKS = $_macosx_frameworks
6409 TOOLAME=$_toolame
6410 TOOLAME_EXTRAFLAGS=$_toolame_extraflags
6411 TOOLAME_LIB=$_toolame_lib
6413 # --- Some stuff for autoconfigure ----
6414 $_target_arch
6415 $_confwin32
6416 TARGET_CPU=$iproc
6417 TARGET_MMX = $_mmx
6418 TARGET_MMX2 = $_mmx2
6419 TARGET_3DNOW = $_3dnow
6420 TARGET_3DNOWEX = $_3dnowex
6421 TARGET_SSE = $_sse
6422 TARGET_ALTIVEC = $_altivec
6423 TARGET_VIS = $_vis
6425 # --- GUI stuff ---
6426 GTKLIB = $_ld_static $_ld_gtk
6427 GLIBLIB = $_ld_static $_ld_glib
6428 GTK_LIBS = $_ld_static $_ld_gui
6429 GUI = $_gui
6430 DEBUG = -DDEBUG
6434 #############################################################################
6435 echo "Creating config.h"
6436 cat > config.h << EOF
6437 /* -------- This file has been automatically generated by configure ---------
6438 Note: Any changes in it will be lost when you run configure again. */
6440 /* Protect against multiple inclusion */
6441 #ifndef MPLAYER_CONFIG_H
6442 #define MPLAYER_CONFIG_H 1
6444 /* use GNU internationalization */
6445 $_def_i18n
6447 /* missing mmap function on libc5 systems */
6448 #ifndef MAP_FAILED
6449 # define MAP_FAILED ((void *) -1)
6450 #endif
6452 /* use setlocale() function */
6453 $_def_setlocale
6455 /* Runtime CPU detection */
6456 $_def_runtime_cpudetection
6458 /* Dynamic a/v plugins */
6459 $_def_dynamic_plugins
6461 /* "restrict" keyword */
6462 #define restrict $_def_restrict_keyword
6464 /* attribute(used) as needed by some compilers */
6465 #if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
6466 # define attribute_used __attribute__((used))
6467 #else
6468 # define attribute_used
6469 #endif
6471 #define PREFIX "$_prefix"
6473 #define USE_OSD 1
6474 #define USE_SUB 1
6476 /* enable/disable SIGHANDLER */
6477 $_def_sighandler
6479 /* Toggles debugging informations */
6480 $_def_debug
6482 /* Indicates that Ogle's libdvdread is available for DVD playback */
6483 $_def_dvdread
6485 /* Indicates that dvdread is from libmpdvdkit */
6486 $_def_mpdvdkit
6488 /* Additional options for libmpdvdkit*/
6489 $_def_dvd
6490 $_def_cdrom
6491 $_def_cdio
6492 $_def_dvdio
6493 $_def_bsdi_dvd
6494 $_def_dvd_bsd
6495 $_def_dvd_linux
6496 $_dev_dvd_openbsd
6497 $_def_dvd_darwin
6498 $_def_sol_scsi_h
6499 $_def_hpux_scsi_h
6500 $_def_stddef
6502 /* Common data directory (for fonts, etc) */
6503 #define MPLAYER_DATADIR "$_datadir"
6504 #define MPLAYER_CONFDIR "$_confdir"
6505 #define MPLAYER_LIBDIR "$_libdir"
6507 /* Define this to compile stream-caching support, it can be enabled via
6508 -cache <kilobytes> */
6509 #define USE_STREAM_CACHE 1
6511 /* Define to include support for XviD/Divx4Linux/OpenDivx */
6512 $_def_divx
6514 /* Define to use the new XviD/DivX4Linux library instead of open source OpenDivX */
6515 /* You have to change DECORE_LIBS in config.mak, too! */
6516 $_def_decore
6518 /* Define if you are using DivX5Linux Decore library */
6519 $_def_divx5
6521 /* Define if you are using XviD library */
6522 $_def_xvid3
6523 $_def_xvid4
6524 $_def_decore_xvid
6525 $_def_encore_xvid
6527 /* Define if you are using the X.264 library */
6528 $_def_x264
6530 /* Define to include support for libdv-0.9.5 */
6531 $_def_libdv
6533 /* If build mencoder */
6534 $_mencoder_flag
6536 /* Indicates if XviD/Divx4linux encore is available
6537 Note: for mencoder */
6538 $_def_encore
6540 /* Indicates if libmp3lame is available
6541 Note: for mencoder */
6542 $_def_mp3lame
6543 $_def_cfg_mp3lame
6545 /* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
6546 $_def_mp1e
6548 /* Define this to enable avg. byte/sec-based AVI sync method by default:
6549 (use -bps or -nobps commandline option for run-time method selection)
6550 -bps gives better sync for vbr mp3 audio, it is now default */
6551 #define AVI_SYNC_BPS 1
6553 /* Undefine this if you do not want to select mono audio (left or right)
6554 with a stereo MPEG layer 2/3 audio stream. The command line option
6555 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
6556 right-only), with 0 being the default.
6558 #define USE_FAKE_MONO 1
6560 /* Undefine this if your sound card driver has no working select().
6561 If you have kernel Oops, player hangups, or just no audio, you should
6562 try to recompile MPlayer with this option disabled! */
6563 $_def_select
6565 /* define this to use iconv(3) function to codepage conversions */
6566 $_def_iconv
6568 /* define this to use nl_langinfo function */
6569 $_def_langinfo
6571 /* define this to use RTC (/dev/rtc) for video timers (LINUX only) */
6572 $_def_rtc
6574 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
6575 #define MAX_OUTBURST 65536
6577 /* set up audio OUTBURST. Do not change this! */
6578 #define OUTBURST 512
6580 /* Define this if your system has the header file for the OSS sound interface */
6581 $_def_sys_soundcard
6583 /* Define this if your system has the header file for the OSS sound interface
6584 * in /usr/include */
6585 $_def_soundcard
6587 /* Define this if your system has the sysinfo header */
6588 $_def_sys_sysinfo
6590 /* Define this if your system has ftello() */
6592 $_def_ftello
6593 #ifndef HAVE_FTELLO
6594 /* Need these for FILE and off_t an config.h is usually before other includes*/
6595 #include <stdio.h>
6596 #include <sys/types.h>
6597 off_t ftello(FILE *);
6598 #endif
6600 /* Define this if your system has the "malloc.h" header file */
6601 $_def_malloc
6603 /* memalign is mapped to malloc if unsupported */
6604 $_def_memalign
6605 #ifndef HAVE_MEMALIGN
6606 # define memalign(a,b) malloc(b)
6607 #endif
6609 /* Define this if your system has the "alloca.h" header file */
6610 $_def_alloca
6612 /* Define this if your system has the "sys/mman.h" header file */
6613 $_def_mman
6615 /* Define this if you have the elf dynamic linker -ldl library */
6616 $_def_dl
6618 /* Define this if you have the kstat kernel statistics library */
6619 $_def_kstat
6621 /* Define this if you have zlib */
6622 $_def_zlib
6623 #ifdef HAVE_ZLIB
6624 #define CONFIG_ZLIB 1
6625 #endif
6627 /* Define this if you have shm support */
6628 $_def_shm
6630 /* Define this if your system has scandir & alphasort */
6631 $_def_scandir
6633 /* Define this if your system has strsep */
6634 $_def_strsep
6636 /* Define this if your system has strlcpy */
6637 $_def_strlcpy
6638 #ifndef HAVE_STRLCPY
6639 unsigned int strlcpy (char *dest, char *src, unsigned int size);
6640 #endif
6642 /* Define this if your system has strlcat */
6643 $_def_strlcat
6644 #ifndef HAVE_STRLCAT
6645 unsigned int strlcat (char *dest, char *src, unsigned int size);
6646 #endif
6648 /* Define this if your system has fseeko */
6649 $_def_fseeko
6650 #ifndef HAVE_FSEEKO
6651 /* Need these for FILE and off_t an config.h is usually before other includes*/
6652 #include <stdio.h>
6653 #include <sys/types.h>
6654 int fseeko(FILE *, off_t, int);
6655 #endif
6657 $_def_localtime_r
6659 /* Define this if your system has vsscanf */
6660 $_def_vsscanf
6662 /* Define this if your system has no posix select */
6663 $_def_no_posix_select
6665 /* Define this if your system has gettimeofday */
6666 $_def_gettimeofday
6668 /* Define this if your system has glob */
6669 $_def_glob
6671 /* Define this if your system has pthreads */
6672 $_def_pthreads
6674 /* LIRC (remote control, see www.lirc.org) support: */
6675 $_def_lirc
6678 * LIRCCD (LIRC client daemon)
6679 * See http://www.dolda2000.cjb.net/~fredrik/lirccd/
6681 $_def_lircc
6683 /* DVD navigation support using libdvdnav */
6684 $_def_dvdnav
6685 $_def_dvdnav_version
6687 /* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
6688 #define MPEG12_POSTPROC 1
6690 /* Define this to enable image postprocessing in libavcodec (requires a FAST CPU!) */
6691 $_def_ffpostprocess
6693 /* Define to include support for OpenDivx postprocessing */
6694 $_def_odivx_postprocess
6696 /* Win32 DLL support */
6697 $_def_win32
6698 #define WIN32_PATH "$_win32libdir"
6700 /* DirectShow support */
6701 $_def_dshow
6703 /* Mac OS X specific features */
6704 $_def_macosx
6706 /* Mac OS X SHLB support */
6707 $_def_macshlb
6709 /* Build our Win32-loader */
6710 $_def_win32_loader
6712 /* ffmpeg's libavcodec support (requires libavcodec source) */
6713 $_def_libavcodec
6714 $_def_libavcodecso
6716 /* ffmpeg's libavformat support (requires libavformat source) */
6717 $_def_libavformat
6718 $_def_libavformat_win32
6720 /* risky codecs */
6721 #define CONFIG_RISKY 1
6723 /* Use libavcodec's decoders */
6724 #define CONFIG_DECODERS 1
6725 /* Use libavcodec's encoders */
6726 #define CONFIG_ENCODERS 1
6728 #define CONFIG_MPEGAUDIO_HP 1
6730 /* Use codec libs included in mplayer CVS / source dist: */
6731 $_def_mp3lib
6732 $_def_liba52
6733 $_def_libdts
6734 $_def_libmpeg2
6736 /* Use libfame encoder filter */
6737 $_def_fame
6739 /* XAnim DLL support */
6740 $_def_xanim
6741 /* Default search path */
6742 $_def_xanim_path
6744 /* RealPlayer DLL support */
6745 $_def_real
6746 /* Default search path */
6747 $_def_real_path
6749 /* LIVE.COM Streaming Media library support */
6750 $_def_live
6752 /* Use 3dnow/mmxext/sse/mmx optimized fast memcpy() [maybe buggy... signal 4]*/
6753 $_def_fastmemcpy
6755 /* Use unrarlib for Vobsubs */
6756 $_def_unrarlib
6758 /* gui support, please do not edit this option */
6759 $_def_gui
6761 /* Audio output drivers */
6762 $_def_ossaudio
6763 $_def_ossaudio_devdsp
6764 $_def_ossaudio_devmixer
6765 $_def_alsa5
6766 $_def_alsa9
6767 $_def_alsa1x
6768 $_def_arts
6769 $_def_esd
6770 $_def_esd_latency
6771 $_def_jack
6772 $_def_sys_asoundlib_h
6773 $_def_alsa_asoundlib_h
6774 $_def_sunaudio
6775 $_def_sgiaudio
6776 $_def_win32waveout
6777 $_def_nas
6779 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
6780 #undef FAST_OSD
6781 #undef FAST_OSD_TABLE
6783 /* Enable TV Interface support */
6784 $_def_tv
6786 /* Enable EDL support */
6787 $_def_edl
6789 /* Enable Video 4 Linux TV interface support */
6790 $_def_tv_v4l
6792 /* Enable Video 4 Linux 2 TV interface support */
6793 $_def_tv_v4l2
6795 /* Enable *BSD BrookTree TV interface support */
6796 $_def_tv_bsdbt848
6798 /* Define if your processor stores words with the most significant
6799 byte first (like Motorola and SPARC, unlike Intel and VAX). */
6800 $_def_words_endian
6802 $_def_arch
6804 /* libmpeg2 wants ARCH_PPC and the rest of mplayer use ARCH_POWERPC,
6805 * define ARCH_PPC if ARCH_POWERPC is set to cope with that.
6807 #ifdef ARCH_POWERPC
6808 #define ARCH_PPC 1
6809 #endif
6811 /* the same issue as with ARCH_POWERPC but with ffmpeg/libavcodec */
6812 #ifdef ARCH_ARMV4L
6813 #define ARCH_ARM 1
6814 #endif
6816 /* only gcc3 can compile mvi instructions */
6817 $_def_gcc_mvi_support
6819 /* Define this for Cygwin build for win32 */
6820 $_def_confwin32
6822 /* Define this to any prefered value from 386 up to infinity with step 100 */
6823 #define __CPU__ $iproc
6825 $_mp_wordsize
6827 $_def_linux
6829 $_def_vcd
6831 #ifdef sun
6832 #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
6833 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
6834 #elif defined(HPUX)
6835 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
6836 #define DEFAULT_DVD_DEVICE "/dev/dvd"
6837 #elif defined(WIN32)
6838 #define DEFAULT_CDROM_DEVICE "D:"
6839 #define DEFAULT_DVD_DEVICE "D:"
6840 #elif defined(SYS_DARWIN)
6841 #define DEFAULT_CDROM_DEVICE "/dev/rdiskN"
6842 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
6843 #elif defined(__OpenBSD__)
6844 #define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
6845 #define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
6846 #else
6847 #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
6848 #define DEFAULT_DVD_DEVICE "/dev/dvd"
6849 #endif
6852 /*----------------------------------------------------------------------------
6854 ** NOTE: Instead of modifying these definitions here, use the
6855 ** --enable/--disable options of the ./configure script!
6856 ** See ./configure --help for details.
6858 *---------------------------------------------------------------------------*/
6860 /* C99 lrintf function available */
6861 $_def_lrintf
6863 /* yes, we have inttypes.h */
6864 #define HAVE_INTTYPES_H 1
6866 /* int_fastXY_t emulation */
6867 $_def_fast_inttypes
6869 /* nanosleep support */
6870 $_def_nanosleep
6872 /* SMB support */
6873 $_def_smbsupport
6875 /* termcap flag for getch2.c */
6876 $_def_termcap
6878 /* termios flag for getch2.c */
6879 $_def_termios
6880 $_def_termios_h
6881 $_def_termios_sys_h
6883 /* enable PNG support */
6884 $_def_png
6886 /* enable JPEG support */
6887 $_def_jpg
6889 /* enable GIF support */
6890 $_def_gif
6891 $_def_gif_4
6892 $_def_gif_tvt_hack
6894 /* enable FreeType support */
6895 $_def_freetype
6897 /* enable Fontconfig support */
6898 $_def_fontconfig
6900 /* enable FriBiDi usage */
6901 $_def_fribidi
6903 /* enable ENCA usage */
6904 $_def_enca
6906 /* liblzo support */
6907 $_def_liblzo
6909 /* libmad support */
6910 $_def_mad
6912 /* enable OggVorbis support */
6913 $_def_vorbis
6915 /* enable Tremor as vorbis decoder */
6916 $_def_tremor
6918 /* enable OggTheora support */
6919 $_def_theora
6921 /* enable Matroska support */
6922 $_def_matroska
6924 /* enable FAAD (AAC) support */
6925 $_def_faad
6926 $_def_faad_internal
6927 $_def_faad_version
6929 /* enable network */
6930 $_def_network
6932 /* enable ftp support */
6933 $_def_ftp
6935 /* enable winsock2 instead of Unix functions*/
6936 $_def_winsock2
6938 /* define this to use inet_aton() instead of inet_pton() */
6939 $_def_use_aton
6941 /* enables / disables cdparanoia support */
6942 $_def_cdparanoia
6944 /* enables / disables VIDIX usage */
6945 $_def_vidix
6947 /* enables / disables new input joystick support */
6948 $_def_joystick
6950 /* enables / disables QTX codecs */
6951 $_def_qtx
6953 /* enables / disables osd menu */
6954 $_def_menu
6956 /* enables / disables subtitles sorting */
6957 $_def_sortsub
6959 /* XMMS input plugin support */
6960 $_def_xmms
6961 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
6963 /* enables inet6 support */
6964 $_def_inet6
6966 /* do we have gethostbyname2? */
6967 $_def_gethostbyname2
6969 /* Extension defines */
6970 $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.)
6971 $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.)
6972 $_def_mmx // only define if you have MMX (newer x86 chips, not P54C/PPro)
6973 $_def_mmx2 // only define if you have MMX2 (Athlon/PIII/4/CelII)
6974 $_def_sse // only define if you have SSE (Intel Pentium III/4 or Celeron II)
6975 $_def_sse2 // only define if you have SSE2 (Intel Pentium 4)
6976 $_def_altivec // only define if you have Altivec (G4)
6978 $_def_altivec_h // enables usage of altivec.h
6981 $_def_mlib // Sun mediaLib, available only on solaris
6982 $_def_vis // only define if you have VIS ( ultrasparc )
6984 /* libmpeg2 uses a different feature test macro for mediaLib */
6985 #ifdef HAVE_MLIB
6986 #define LIBMPEG2_MLIB 1
6987 #endif
6989 /* libvo options */
6990 #define SCREEN_SIZE_X 1
6991 #define SCREEN_SIZE_Y 1
6992 $_def_x11
6993 $_def_xv
6994 $_def_xvmc
6995 $_def_vm
6996 $_def_xinerama
6997 $_def_gl
6998 $_def_gl_win32
6999 $_def_dga
7000 $_def_dga2
7001 $_def_sdl
7002 /* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
7003 $_def_sdlbuggy
7004 $_def_directx
7005 $_def_ggi
7006 $_def_3dfx
7007 $_def_tdfxfb
7008 $_def_tdfxvid
7009 $_def_directfb
7010 $_def_directfb_version
7011 $_def_zr
7012 $_def_bl
7013 $_def_mga
7014 $_def_xmga
7015 $_def_syncfb
7016 $_def_fbdev
7017 $_def_dxr2
7018 $_def_dxr3
7019 $_def_dvb
7020 $_def_dvb_in
7021 $_def_svga
7022 $_def_vesa
7023 $_def_xdpms
7024 $_def_aa
7025 $_def_caca
7026 $_def_tga
7027 $_def_toolame
7029 /* used by GUI: */
7030 $_def_xshape
7032 #if defined(HAVE_GL) || defined(HAVE_X11) || defined(HAVE_XV)
7033 #define X11_FULLSCREEN 1
7034 #endif
7036 #endif /* MPLAYER_CONFIG_H */
7039 #############################################################################
7041 echo "Creating libvo/config.mak"
7042 _voobj=`echo $_vosrc | sed -e 's/\.c/\.o/g'`
7043 cat > libvo/config.mak << EOF
7044 include ../config.mak
7045 OPTIONAL_SRCS = $_vosrc
7046 OPTIONAL_OBJS = $_voobj
7049 #############################################################################
7051 echo "Creating libao2/config.mak"
7052 _aoobj=`echo $_aosrc | sed -e 's/\.c/\.o/g'`
7053 cat > libao2/config.mak << EOF
7054 include ../config.mak
7055 OPTIONAL_SRCS = $_aosrc
7056 OPTIONAL_OBJS = $_aoobj
7059 #############################################################################
7061 echo "Creating help_mp.h"
7062 cat > help_mp.h << EOF
7064 // WARNING! This is a generated file. Do NOT edit.
7065 // See the help/ subdir for the editable files.
7067 #include "$_mp_help"
7070 if test $_mp_help != "help/help_mp-en.h"; then
7071 echo "Adding untranslated messages to help_mp.h"
7072 echo '// untranslated messages from the english master-file:' >> help_mp.h
7073 help/help_diff.sh $_mp_help <help/help_mp-en.h >> help_mp.h
7076 #############################################################################
7078 cat << EOF
7080 Config files successfully generated by ./configure !
7082 Install prefix: $_prefix
7083 Data directory: $_datadir
7084 Config direct.: $_confdir
7086 Byte order: $_byte_order
7087 Optimizing for: $_optimizing
7089 Languages:
7090 Messages/GUI: $_language
7093 echo -n " Manual pages: $MAN_LANG"
7094 test "$LANGUAGES" = en && echo -n " (no localization selected, use --language=all)"
7095 echo
7097 cat << EOF
7099 Enabled optional drivers:
7100 Input: $_inputmodules
7101 Codecs: $_codecmodules
7102 Audio output: $_aomodules
7103 Video output: $_vomodules
7104 Disabled optional drivers:
7105 Input: $_noinputmodules
7106 Codecs: $_nocodecmodules
7107 Audio output: $_noaomodules
7108 Video output: $_novomodules
7110 'config.h' and 'config.mak' contain your configuration options.
7111 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
7112 compile *** DO NOT REPORT BUGS if you tweak these files ***
7114 'make' will now compile MPlayer and 'make install' will install it.
7115 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
7120 if test "$_mtrr" = yes ; then
7121 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$_doc_lang/devices.html#mtrr)"
7122 echo
7125 if test "$_sdl" = "outdated" ; then
7126 cat <<EOF
7127 You have an outdated version of libSDL installed (older than v1.1.7) and SDL
7128 support has therefore been disabled.
7130 Please upgrade to a more recent version (version 1.1.8 and above are known to
7131 work). You may get this library from: http://www.libsdl.org
7133 You need to rerun ./configure and recompile after updating SDL. If you are
7134 only interested in the libSDL audio drivers, then an older version might work.
7136 Use --enable-sdl to force usage of libSDL.
7141 if x86; then
7142 if test "$_win32" = no ; then
7143 if test "$_win32libdir" ; then
7144 echo "Failed to find a Win32 codecs dir at $_win32libdir!"
7145 else
7146 echo "Failed to find a Win32 codecs directory! (default: /usr/local/lib/codecs/)"
7148 cat << EOF
7149 Create it and copy the DLL files there! You can download the codecs from our
7150 homepage at http://www.mplayerhq.hu/MPlayer/releases/codecs/
7154 else
7155 cat <<EOF
7156 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
7157 operating system ($system_name). You may encounter a few files that cannot
7158 be played due to missing open source video/audio codec support.
7164 cat <<EOF
7166 Check $TMPLOG if you wonder why an autodetection failed (check whether
7167 the development headers/packages are installed).
7169 If you suspect a bug, please read DOCS/HTML/$_doc_lang/bugreports.html.
7173 if test "$_vidix" = no ; then
7174 cat <<EOF
7175 You've disabled VIDIX. Although it would be better to PORT it instead.
7176 Have a look at the documentation for supported cards!
7181 # Last move:
7182 rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"