mark ffqclp as working in codecs.conf, works on all my samples
[mplayer.git] / configure
blobde0f8e33a33ec6b5dd09736d836dfc9a6a884004
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if test "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # fi
33 # if test "$_feature" = yes ; then
34 # def_feature='#define CONFIG_FEATURE 1'
35 # else
36 # def_feature='#undef CONFIG_FEATURE'
37 # fi
38 # echores "$_feature"
40 # Furthermore you need to add the variable _feature to the list of default
41 # settings and set it to one of yes/no/auto. Also add appropriate
42 # --enable-feature/--disable-feature command line options.
43 # The results of the check should be written to config.h and config.mak
44 # at the end of this script. The variable names used for this should be
45 # uniform, i.e. if the option is named 'feature':
47 # _feature : should have a value of yes/no/auto
48 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
49 # _ld_feature : '-L/path/dir -lfeature' GCC options
51 #############################################################################
53 # Prevent locale nonsense from breaking basic text processing utils
54 export LC_ALL=C
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMPRES="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMPRES"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 yasm_check() {
83 echo >> "$TMPLOG"
84 cat "$TMPS" >> "$TMPLOG"
85 echo >> "$TMPLOG"
86 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
87 rm -f "$TMPEXE"
88 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
89 TMPRES="$?"
90 echo >> "$TMPLOG"
91 echo >> "$TMPLOG"
92 return "$TMPRES"
95 tmp_run() {
96 "$TMPEXE" >> "$TMPLOG" 2>&1
99 # Display error message, flushes tempfile, exit
100 die () {
101 echo
102 echo "Error: $@" >&2
103 echo >&2
104 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
105 echo "Check \"$TMPLOG\" if you do not understand why it failed."
106 exit 1
109 # OS test booleans functions
110 issystem() {
111 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
113 aix() { issystem "AIX"; }
114 amigaos() { issystem "AmigaOS"; }
115 beos() { issystem "BEOS"; }
116 bsdos() { issystem "BSD/OS"; }
117 cygwin() { issystem "CYGWIN"; }
118 darwin() { issystem "Darwin"; }
119 dragonfly() { issystem "DragonFly"; }
120 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
121 gnu() { issystem "GNU"; }
122 hpux() { issystem "HP-UX"; }
123 irix() { issystem "IRIX"; }
124 linux() { issystem "Linux"; }
125 mingw32() { issystem "MINGW32"; }
126 morphos() { issystem "MorphOS"; }
127 netbsd() { issystem "NetBSD"; }
128 openbsd() { issystem "OpenBSD"; }
129 os2() { issystem "OS/2"; }
130 qnx() { issystem "QNX"; }
131 sunos() { issystem "SunOS"; }
132 win32() { cygwin || mingw32; }
134 # arch test boolean functions
135 # x86/x86pc is used by QNX
136 x86_32() {
137 case "$host_arch" in
138 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
139 *) return 1 ;;
140 esac
143 x86_64() {
144 case "$host_arch" in
145 x86_64|amd64) return 0 ;;
146 *) return 1 ;;
147 esac
150 x86() {
151 x86_32 || x86_64
154 ppc() {
155 case "$host_arch" in
156 ppc|ppc64|powerpc|powerpc64) return 0;;
157 *) return 1;;
158 esac
161 alpha() {
162 case "$host_arch" in
163 alpha*) return 0;;
164 *) return 1;;
165 esac
168 arm() {
169 case "$host_arch" in
170 arm) return 0;;
171 *) return 1;;
172 esac
175 # Use this before starting a check
176 echocheck() {
177 echo "============ Checking for $@ ============" >> "$TMPLOG"
178 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
181 # Use this to echo the results of a check
182 echores() {
183 if test "$_res_comment" ; then
184 _res_comment="($_res_comment)"
186 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
187 echo "##########################################" >> "$TMPLOG"
188 echo "" >> "$TMPLOG"
189 echo "$@ $_res_comment"
190 _res_comment=""
192 #############################################################################
194 # Check how echo works in this /bin/sh
195 case $(echo -n) in
196 -n) _echo_n= _echo_c='\c' ;; # SysV echo
197 *) _echo_n='-n ' _echo_c= ;; # BSD echo
198 esac
200 msg_lang_all=$(echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g")
201 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
202 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
204 show_help(){
205 cat << EOF
206 Usage: $0 [OPTIONS]...
208 Configuration:
209 -h, --help display this help and exit
211 Installation directories:
212 --prefix=DIR prefix directory for installation [/usr/local]
213 --bindir=DIR directory for installing binaries [PREFIX/bin]
214 --datadir=DIR directory for installing machine independent
215 data files (skins, etc) [PREFIX/share/mplayer]
216 --mandir=DIR directory for installing man pages [PREFIX/share/man]
217 --confdir=DIR directory for installing configuration files
218 [PREFIX/etc/mplayer]
219 --libdir=DIR directory for object code libraries [PREFIX/lib]
220 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
221 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
222 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
223 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
225 Optional features:
226 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
227 --disable-mplayer disable MPlayer compilation [enable]
228 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
229 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
230 --disable-largefiles disable support for files > 2GB [enable]
231 --enable-linux-devfs set default devices to devfs [disable]
232 --enable-termcap use termcap database for key codes [autodetect]
233 --enable-termios use termios database for key codes [autodetect]
234 --disable-iconv disable iconv for encoding conversion [autodetect]
235 --disable-langinfo do not use langinfo [autodetect]
236 --enable-lirc enable LIRC (remote control) support [autodetect]
237 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
238 --enable-joystick enable joystick support [disable]
239 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
240 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
241 --disable-vm disable X video mode extensions [autodetect]
242 --disable-xf86keysym disable support for multimedia keys [autodetect]
243 --enable-radio enable radio interface [disable]
244 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
245 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
246 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
247 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
248 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
249 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
250 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
251 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
252 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
253 --disable-network disable networking [enable]
254 --enable-winsock2_h enable winsock2_h [autodetect]
255 --enable-smb enable Samba (SMB) input [autodetect]
256 --enable-live enable LIVE555 Streaming Media [autodetect]
257 --enable-nemesi enable Nemesi Streaming Media [autodetect]
258 --disable-vcd disable VCD support [autodetect]
259 --disable-dvdnav disable libdvdnav [autodetect]
260 --disable-dvdread disable libdvdread [autodetect]
261 --disable-dvdread-internal disable internal libdvdread [autodetect]
262 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
263 --disable-cdparanoia disable cdparanoia [autodetect]
264 --disable-cddb disable cddb [autodetect]
265 --disable-bitmap-font disable bitmap font support [enable]
266 --disable-freetype disable FreeType 2 font rendering [autodetect]
267 --disable-fontconfig disable fontconfig font lookup [autodetect]
268 --disable-unrarexec disable using of UnRAR executable [enabled]
269 --enable-menu enable OSD menu (not DVD menu) [disabled]
270 --disable-sortsub disable subtitle sorting [enabled]
271 --enable-fribidi enable the FriBiDi libs [autodetect]
272 --disable-enca disable ENCA charset oracle library [autodetect]
273 --disable-maemo disable maemo specific features [autodetect]
274 --enable-macosx-finder enable Mac OS X Finder invocation parameter
275 parsing [disabled]
276 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
277 --disable-inet6 disable IPv6 support [autodetect]
278 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
279 --disable-ftp disable FTP support [enabled]
280 --disable-vstream disable TiVo vstream client support [autodetect]
281 --disable-pthreads disable Posix threads support [autodetect]
282 --disable-w32threads disable Win32 threads support [autodetect]
283 --disable-ass-internal disable internal SSA/ASS subtitle support [autodetect]
284 --disable-ass disable SSA/ASS subtitle support [autodetect]
285 --enable-rpath enable runtime linker path for extra libs [disabled]
287 Codecs:
288 --enable-gif enable GIF support [autodetect]
289 --enable-png enable PNG input/output support [autodetect]
290 --enable-mng enable MNG input support [autodetect]
291 --enable-jpeg enable JPEG input/output support [autodetect]
292 --enable-libcdio enable libcdio support [autodetect]
293 --enable-liblzo enable liblzo support [autodetect]
294 --disable-win32dll disable Win32 DLL support [enabled]
295 --disable-qtx disable QuickTime codecs support [enabled]
296 --disable-xanim disable XAnim codecs support [enabled]
297 --disable-real disable RealPlayer codecs support [enabled]
298 --disable-xvid disable Xvid [autodetect]
299 --disable-xvid-lavc disable Xvid in libavcodec [autodetect]
300 --disable-x264 disable x264 [autodetect]
301 --disable-x264-lavc disable x264 in libavcodec [autodetect]
302 --disable-libdirac-lavc disable Dirac in libavcodec [autodetect]
303 --disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger
304 decoder) [autodetect]
305 --disable-libnut disable libnut [autodetect]
306 --disable-libavutil_a disable static libavutil [autodetect]
307 --disable-libavcodec_a disable static libavcodec [autodetect]
308 --disable-libavformat_a disable static libavformat [autodetect]
309 --disable-libpostproc_a disable static libpostproc [autodetect]
310 --disable-libswscale_a disable static libswscale [autodetect]
311 --disable-libavutil_so disable shared libavutil [autodetect]
312 --disable-libavcodec_so disable shared libavcodec [autodetect]
313 --disable-libavformat_so disable shared libavformat [autodetect]
314 --disable-libpostproc_so disable shared libpostproc [autodetect]
315 --disable-libswscale_so disable shared libswscale [autodetect]
316 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
317 in libavcodec [enabled]
318 --disable-tremor-internal disable internal Tremor [enabled]
319 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
320 --enable-tremor enable external Tremor [autodetect]
321 --disable-libvorbis disable libvorbis support [autodetect]
322 --disable-speex disable Speex support [autodetect]
323 --enable-theora enable OggTheora libraries [autodetect]
324 --enable-faad enable external FAAD2 (AAC) [autodetect]
325 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
326 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
327 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
328 --disable-faac-lavc disable support for FAAC in libavcodec [autodetect]
329 --disable-ladspa disable LADSPA plugin support [autodetect]
330 --disable-libbs2b disable libbs2b audio filter support [autodetect]
331 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
332 --disable-mad disable libmad (MPEG audio) support [autodetect]
333 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
334 --disable-mp3lame-lavc disable LAME in libavcodec [autodetect]
335 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
336 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
337 --enable-xmms enable XMMS input plugin support [disabled]
338 --enable-libdca enable libdca support [autodetect]
339 --disable-mp3lib disable builtin mp3lib [autodetect]
340 --disable-liba52 disable liba52 [autodetect]
341 --disable-liba52-internal disable builtin liba52 [autodetect]
342 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
343 --disable-musepack disable musepack support [autodetect]
344 --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect]
345 --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect]
346 --disable-libopenjpeg disable OpenJPEG (JPEG2000) input/output support [autodetect]
347 --disable-decoder=DECODER disable specified FFmpeg decoder
348 --enable-decoder=DECODER enable specified FFmpeg decoder
349 --disable-encoder=ENCODER disable specified FFmpeg encoder
350 --enable-encoder=ENCODER enable specified FFmpeg encoder
351 --disable-parser=PARSER disable specified FFmpeg parser
352 --enable-parser=PARSER enable specified FFmpeg parser
353 --disable-protocol=PROTO disable specified FFmpeg protocol
354 --enable-protocol=PROTO enable specified FFmpeg protocol
355 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
356 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
357 --disable-muxer=MUXER disable specified FFmpeg muxer
358 --enable-muxer=MUXER enable specified FFmpeg muxer
360 Video output:
361 --disable-vidix disable VIDIX [for x86 *nix]
362 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
363 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
364 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
365 --disable-vidix-pcidb disable VIDIX PCI device name database
366 --enable-dhahelper enable VIDIX dhahelper support
367 --enable-svgalib_helper enable VIDIX svgalib_helper support
368 --enable-gl enable OpenGL video output [autodetect]
369 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
370 --enable-dga2 enable DGA 2 support [autodetect]
371 --enable-dga1 enable DGA 1 support [autodetect]
372 --enable-vesa enable VESA video output [autodetect]
373 --enable-svga enable SVGAlib video output [autodetect]
374 --enable-sdl enable SDL video output [autodetect]
375 --enable-kva enable KVA video output [autodetect]
376 --enable-aa enable AAlib video output [autodetect]
377 --enable-caca enable CACA video output [autodetect]
378 --enable-ggi enable GGI video output [autodetect]
379 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
380 --enable-direct3d enable Direct3D video output [autodetect]
381 --enable-directx enable DirectX video output [autodetect]
382 --enable-dxr2 enable DXR2 video output [autodetect]
383 --enable-dxr3 enable DXR3/H+ video output [autodetect]
384 --enable-ivtv enable IVTV TV-Out video output [autodetect]
385 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
386 --enable-dvb enable DVB video output [autodetect]
387 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
388 --enable-mga enable mga_vid video output [autodetect]
389 --enable-xmga enable mga_vid X11 video output [autodetect]
390 --enable-xv enable Xv video output [autodetect]
391 --enable-xvmc enable XvMC acceleration [disable]
392 --enable-vdpau enable VDPAU acceleration [autodetect]
393 --enable-vm enable XF86VidMode support [autodetect]
394 --enable-xinerama enable Xinerama support [autodetect]
395 --enable-x11 enable X11 video output [autodetect]
396 --enable-xshape enable XShape support [autodetect]
397 --disable-xss disable screensaver support via xss [autodetect]
398 --enable-fbdev enable FBDev video output [autodetect]
399 --enable-mlib enable mediaLib video output (Solaris) [disable]
400 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
401 --enable-tdfxfb enable tdfxfb video output [disable]
402 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
403 --enable-wii enable Nintendo Wii/GameCube video output [disable]
404 --enable-directfb enable DirectFB video output [autodetect]
405 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
406 --enable-bl enable Blinkenlights video output [disable]
407 --enable-tdfxvid enable tdfx_vid video output [disable]
408 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
409 --disable-tga disable Targa video output [enable]
410 --disable-pnm disable PNM video output [enable]
411 --disable-md5sum disable md5sum video output [enable]
412 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
413 --disable-corevideo disable CoreVideo video output [autodetect]
414 --disable-quartz disable Quartz video output [autodetect]
416 Audio output:
417 --disable-alsa disable ALSA audio output [autodetect]
418 --disable-ossaudio disable OSS audio output [autodetect]
419 --disable-arts disable aRts audio output [autodetect]
420 --disable-esd disable esd audio output [autodetect]
421 --disable-pulse disable Pulseaudio audio output [autodetect]
422 --disable-jack disable JACK audio output [autodetect]
423 --disable-openal disable OpenAL audio output [autodetect]
424 --disable-nas disable NAS audio output [autodetect]
425 --disable-sgiaudio disable SGI audio output [autodetect]
426 --disable-sunaudio disable Sun audio output [autodetect]
427 --disable-dart disable DART audio output [autodetect]
428 --disable-win32waveout disable Windows waveout audio output [autodetect]
429 --disable-coreaudio disable CoreAudio audio output [autodetect]
430 --disable-select disable using select() on the audio device [enable]
432 Language options:
433 --charset=charset convert the console messages to this character set
434 --language-doc=lang language to use for the documentation [en]
435 --language-man=lang language to use for the man pages [en]
436 --language-msg=lang language to use for the messages and the GUI [en]
437 --language=lang default language to use [en]
438 Specific options override --language. You can pass a list of languages separated
439 by whitespace or commas instead of a single language. Nonexisting translations
440 will be dropped from each list. All documentation and man page translations
441 available in the list will be installed, for the messages the first available
442 translation will be used. The value "all" will activate all translations. The
443 LINGUAS environment variable is honored. In all cases the fallback is English.
444 Available values are: all $msg_lang_all
446 Miscellaneous options:
447 --enable-runtime-cpudetection enable runtime CPU detection [disable]
448 --enable-cross-compile enable cross-compilation [autodetect]
449 --cc=COMPILER C compiler to build MPlayer [gcc]
450 --host-cc=COMPILER C compiler for tools needed while building [gcc]
451 --as=ASSEMBLER assembler to build MPlayer [as]
452 --nm=NM nm tool to build MPlayer [nm]
453 --yasm=YASM Yasm assembler to build MPlayer [yasm]
454 --ar=AR librarian to build MPlayer [ar]
455 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
456 --windres=WINDRES windres to build MPlayer [windres]
457 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
458 --enable-static build a statically linked binary
459 --with-install=PATH path to a custom install program
461 Advanced options:
462 --enable-mmx enable MMX [autodetect]
463 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
464 --enable-3dnow enable 3DNow! [autodetect]
465 --enable-3dnowext enable extended 3DNow! [autodetect]
466 --enable-sse enable SSE [autodetect]
467 --enable-sse2 enable SSE2 [autodetect]
468 --enable-ssse3 enable SSSE3 [autodetect]
469 --enable-shm enable shm [autodetect]
470 --enable-altivec enable AltiVec (PowerPC) [autodetect]
471 --enable-armv5te enable DSP extensions (ARM) [autodetect]
472 --enable-armv6 enable ARMv6 (ARM) [autodetect]
473 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
474 --enable-armvfp enable ARM VFP (ARM) [autodetect]
475 --enable-neon enable NEON (ARM) [autodetect]
476 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
477 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
478 --enable-big-endian force byte order to big-endian [autodetect]
479 --enable-debug[=1-3] compile-in debugging information [disable]
480 --enable-profile compile-in profiling information [disable]
481 --disable-sighandler disable sighandler for crashes [enable]
482 --enable-crash-debug enable automatic gdb attach on crash [disable]
483 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
485 Use these options if autodetection fails:
486 --extra-cflags=FLAGS extra CFLAGS
487 --extra-ldflags=FLAGS extra LDFLAGS
488 --extra-libs=FLAGS extra linker flags
489 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
490 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
491 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
493 --with-freetype-config=PATH path to freetype-config
494 --with-fribidi-config=PATH path to fribidi-config
495 --with-glib-config=PATH path to glib*-config
496 --with-gtk-config=PATH path to gtk*-config
497 --with-sdl-config=PATH path to sdl*-config
498 --with-dvdnav-config=PATH path to dvdnav-config
499 --with-dvdread-config=PATH path to dvdread-config
501 This configure script is NOT autoconf-based, even though its output is similar.
502 It will try to autodetect all configuration options. If you --enable an option
503 it will be forcefully turned on, skipping autodetection. This can break
504 compilation, so you need to know what you are doing.
506 exit 0
507 } #show_help()
509 # GOTCHA: the variables below defines the default behavior for autodetection
510 # and have - unless stated otherwise - at least 2 states : yes no
511 # If autodetection is available then the third state is: auto
512 _mmx=auto
513 _3dnow=auto
514 _3dnowext=auto
515 _mmxext=auto
516 _sse=auto
517 _sse2=auto
518 _ssse3=auto
519 _cmov=auto
520 _fast_cmov=auto
521 _armv5te=auto
522 _armv6=auto
523 _armv6t2=auto
524 _armvfp=auto
525 neon=auto
526 _iwmmxt=auto
527 _mtrr=auto
528 _altivec=auto
529 _install=install
530 _ranlib=ranlib
531 _windres=windres
532 _cc=cc
533 _ar=ar
534 test "$CC" && _cc="$CC"
535 _as=auto
536 _nm=auto
537 _yasm=yasm
538 _runtime_cpudetection=no
539 _cross_compile=auto
540 _prefix="/usr/local"
541 _libavutil_a=auto
542 _libavutil_so=auto
543 _libavcodec_a=auto
544 _libopencore_amrnb=auto
545 _libopencore_amrwb=auto
546 libopenjpeg=auto
547 _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
548 _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//)
549 _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
550 _libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//)
551 _libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
552 _libavparsers=$_libavparsers_all
553 _libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
554 _libavbsfs=$_libavbsfs_all
555 _libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
556 _libavdemuxers=$(echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/AVISYNTH_DEMUXER//)
557 _libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
558 _libavmuxers=$(echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER//)
559 _libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
560 _libavprotocols=$_libavprotocols_all
561 _libavcodec_so=auto
562 _libavformat_a=auto
563 _libavformat_so=auto
564 _libpostproc_a=auto
565 _libpostproc_so=auto
566 _libswscale_a=auto
567 _libswscale_so=auto
568 _libavcodec_mpegaudio_hp=yes
569 _mencoder=yes
570 _mplayer=yes
571 _x11=auto
572 _xshape=auto
573 _xss=auto
574 _dga1=auto
575 _dga2=auto
576 _xv=auto
577 _xvmc=no #auto when complete
578 _vdpau=auto
579 _sdl=auto
580 _kva=auto
581 _direct3d=auto
582 _directx=auto
583 _win32waveout=auto
584 _nas=auto
585 _png=auto
586 _mng=auto
587 _jpeg=auto
588 _pnm=yes
589 _md5sum=yes
590 _yuv4mpeg=yes
591 _gif=auto
592 _gl=auto
593 matrixview=yes
594 _ggi=auto
595 _ggiwmh=auto
596 _aa=auto
597 _caca=auto
598 _svga=auto
599 _vesa=auto
600 _fbdev=auto
601 _dvb=auto
602 _dvbhead=auto
603 _dxr2=auto
604 _dxr3=auto
605 _ivtv=auto
606 _v4l2=auto
607 _iconv=auto
608 _langinfo=auto
609 _rtc=auto
610 _ossaudio=auto
611 _arts=auto
612 _esd=auto
613 _pulse=auto
614 _jack=auto
615 _dart=auto
616 _openal=auto
617 _libcdio=auto
618 _liblzo=auto
619 _mad=auto
620 _mp3lame=auto
621 _mp3lame_lavc=auto
622 _toolame=auto
623 _twolame=auto
624 _tremor=auto
625 _tremor_internal=yes
626 _tremor_low=no
627 _libvorbis=auto
628 _speex=auto
629 _theora=auto
630 _mp3lib=auto
631 _liba52=auto
632 _liba52_internal=auto
633 _libdca=auto
634 _libmpeg2=auto
635 _faad=auto
636 _faad_internal=auto
637 _faad_fixed=no
638 _faac=auto
639 _faac_lavc=auto
640 _ladspa=auto
641 _libbs2b=auto
642 _xmms=no
643 _vcd=auto
644 _dvdnav=auto
645 _dvdnavconfig=dvdnav-config
646 _dvdreadconfig=dvdread-config
647 _dvdread=auto
648 _dvdread_internal=auto
649 _libdvdcss_internal=auto
650 _xanim=auto
651 _real=auto
652 _live=auto
653 _nemesi=auto
654 _native_rtsp=yes
655 _xinerama=auto
656 _mga=auto
657 _xmga=auto
658 _vm=auto
659 _xf86keysym=auto
660 _mlib=no #broken, thus disabled
661 _sgiaudio=auto
662 _sunaudio=auto
663 _alsa=auto
664 _fastmemcpy=yes
665 _unrar_exec=auto
666 _win32dll=auto
667 _select=yes
668 _radio=no
669 _radio_capture=no
670 _radio_v4l=auto
671 _radio_v4l2=auto
672 _radio_bsdbt848=auto
673 _tv=yes
674 _tv_v4l1=auto
675 _tv_v4l2=auto
676 _tv_bsdbt848=auto
677 _tv_dshow=auto
678 _pvr=auto
679 _network=yes
680 _winsock2_h=auto
681 _smb=auto
682 _vidix=auto
683 _vidix_pcidb=yes
684 _dhahelper=no
685 _svgalib_helper=no
686 _joystick=no
687 _xvid=auto
688 _xvid_lavc=auto
689 _x264=auto
690 _x264_lavc=auto
691 _libdirac_lavc=auto
692 _libschroedinger_lavc=auto
693 _libnut=auto
694 _lirc=auto
695 _lircc=auto
696 _apple_remote=auto
697 _apple_ir=auto
698 _gui=no
699 _gtk1=no
700 _termcap=auto
701 _termios=auto
702 _3dfx=no
703 _s3fb=no
704 _wii=no
705 _tdfxfb=no
706 _tdfxvid=no
707 _xvr100=auto
708 _tga=yes
709 _directfb=auto
710 _zr=auto
711 _bl=no
712 _largefiles=yes
713 #language=en
714 _shm=auto
715 _linux_devfs=no
716 _charset="UTF-8"
717 _dynamic_plugins=no
718 _crash_debug=no
719 _sighandler=yes
720 _libdv=auto
721 _cdparanoia=auto
722 _cddb=auto
723 _big_endian=auto
724 _bitmap_font=yes
725 _freetype=auto
726 _fontconfig=auto
727 _menu=no
728 _qtx=auto
729 _maemo=auto
730 _coreaudio=auto
731 _corevideo=auto
732 _quartz=auto
733 quicktime=auto
734 _macosx_finder=no
735 _macosx_bundle=auto
736 _sortsub=yes
737 _freetypeconfig='freetype-config'
738 _fribidi=auto
739 _fribidiconfig='fribidi-config'
740 _enca=auto
741 _inet6=auto
742 _gethostbyname2=auto
743 _ftp=yes
744 _musepack=auto
745 _vstream=auto
746 _pthreads=auto
747 _w32threads=auto
748 _ass=auto
749 ass_internal=yes
750 _rpath=no
751 _asmalign_pot=auto
752 _stream_cache=yes
753 _priority=no
754 def_dos_paths="#define HAVE_DOS_PATHS 0"
755 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
756 def_priority="#undef CONFIG_PRIORITY"
757 def_pthread_cache="#undef PTHREAD_CACHE"
758 _need_shmem=yes
759 for ac_option do
760 case "$ac_option" in
761 --help|-help|-h)
762 show_help
764 --prefix=*)
765 _prefix=$(echo $ac_option | cut -d '=' -f 2)
767 --bindir=*)
768 _bindir=$(echo $ac_option | cut -d '=' -f 2)
770 --datadir=*)
771 _datadir=$(echo $ac_option | cut -d '=' -f 2)
773 --mandir=*)
774 _mandir=$(echo $ac_option | cut -d '=' -f 2)
776 --confdir=*)
777 _confdir=$(echo $ac_option | cut -d '=' -f 2)
779 --libdir=*)
780 _libdir=$(echo $ac_option | cut -d '=' -f 2)
782 --codecsdir=*)
783 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
785 --win32codecsdir=*)
786 _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2)
788 --xanimcodecsdir=*)
789 _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
791 --realcodecsdir=*)
792 _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
795 --with-install=*)
796 _install=$(echo $ac_option | cut -d '=' -f 2 )
798 --with-xvmclib=*)
799 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
802 --with-sdl-config=*)
803 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
805 --with-freetype-config=*)
806 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
808 --with-fribidi-config=*)
809 _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2)
811 --with-gtk-config=*)
812 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
814 --with-glib-config=*)
815 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
817 --with-dvdnav-config=*)
818 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
820 --with-dvdread-config=*)
821 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
824 --extra-cflags=*)
825 extra_cflags=$(echo $ac_option | cut -d '=' -f 2-)
827 --extra-ldflags=*)
828 extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-)
830 --extra-libs=*)
831 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
833 --extra-libs-mplayer=*)
834 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
836 --extra-libs-mencoder=*)
837 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
840 --target=*)
841 _target=$(echo $ac_option | cut -d '=' -f 2)
843 --cc=*)
844 _cc=$(echo $ac_option | cut -d '=' -f 2)
846 --host-cc=*)
847 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
849 --as=*)
850 _as=$(echo $ac_option | cut -d '=' -f 2)
852 --nm=*)
853 _nm=$(echo $ac_option | cut -d '=' -f 2)
855 --yasm=*)
856 _yasm=$(echo $ac_option | cut -d '=' -f 2)
858 --ar=*)
859 _ar=$(echo $ac_option | cut -d '=' -f 2)
861 --ranlib=*)
862 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
864 --windres=*)
865 _windres=$(echo $ac_option | cut -d '=' -f 2)
867 --charset=*)
868 _charset=$(echo $ac_option | cut -d '=' -f 2)
870 --language-doc=*)
871 language_doc=$(echo $ac_option | cut -d '=' -f 2)
873 --language-man=*)
874 language_man=$(echo $ac_option | cut -d '=' -f 2)
876 --language-msg=*)
877 language_msg=$(echo $ac_option | cut -d '=' -f 2)
879 --language=*)
880 language=$(echo $ac_option | cut -d '=' -f 2)
883 --enable-static)
884 _ld_static='-static'
886 --disable-static)
887 _ld_static=''
889 --enable-profile)
890 _profile='-p'
892 --disable-profile)
893 _profile=
895 --enable-debug)
896 _debug='-g'
898 --enable-debug=*)
899 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
901 --disable-debug)
902 _debug=
904 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
905 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
906 --enable-cross-compile) _cross_compile=yes ;;
907 --disable-cross-compile) _cross_compile=no ;;
908 --enable-mencoder) _mencoder=yes ;;
909 --disable-mencoder) _mencoder=no ;;
910 --enable-mplayer) _mplayer=yes ;;
911 --disable-mplayer) _mplayer=no ;;
912 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
913 --disable-dynamic-plugins) _dynamic_plugins=no ;;
914 --enable-x11) _x11=yes ;;
915 --disable-x11) _x11=no ;;
916 --enable-xshape) _xshape=yes ;;
917 --disable-xshape) _xshape=no ;;
918 --enable-xss) _xss=yes ;;
919 --disable-xss) _xss=no ;;
920 --enable-xv) _xv=yes ;;
921 --disable-xv) _xv=no ;;
922 --enable-xvmc) _xvmc=yes ;;
923 --disable-xvmc) _xvmc=no ;;
924 --enable-vdpau) _vdpau=yes ;;
925 --disable-vdpau) _vdpau=no ;;
926 --enable-sdl) _sdl=yes ;;
927 --disable-sdl) _sdl=no ;;
928 --enable-kva) _kva=yes ;;
929 --disable-kva) _kva=no ;;
930 --enable-direct3d) _direct3d=yes ;;
931 --disable-direct3d) _direct3d=no ;;
932 --enable-directx) _directx=yes ;;
933 --disable-directx) _directx=no ;;
934 --enable-win32waveout) _win32waveout=yes ;;
935 --disable-win32waveout) _win32waveout=no ;;
936 --enable-nas) _nas=yes ;;
937 --disable-nas) _nas=no ;;
938 --enable-png) _png=yes ;;
939 --disable-png) _png=no ;;
940 --enable-mng) _mng=yes ;;
941 --disable-mng) _mng=no ;;
942 --enable-jpeg) _jpeg=yes ;;
943 --disable-jpeg) _jpeg=no ;;
944 --enable-libopenjpeg) libopenjpeg=yes ;;
945 --disable-libopenjpeg)libopenjpeg=no ;;
946 --enable-pnm) _pnm=yes ;;
947 --disable-pnm) _pnm=no ;;
948 --enable-md5sum) _md5sum=yes ;;
949 --disable-md5sum) _md5sum=no ;;
950 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
951 --disable-yuv4mpeg) _yuv4mpeg=no ;;
952 --enable-gif) _gif=yes ;;
953 --disable-gif) _gif=no ;;
954 --enable-gl) _gl=yes ;;
955 --disable-gl) _gl=no ;;
956 --enable-matrixview) matrixview=yes ;;
957 --disable-matrixview) matrixview=no ;;
958 --enable-ggi) _ggi=yes ;;
959 --disable-ggi) _ggi=no ;;
960 --enable-ggiwmh) _ggiwmh=yes ;;
961 --disable-ggiwmh) _ggiwmh=no ;;
962 --enable-aa) _aa=yes ;;
963 --disable-aa) _aa=no ;;
964 --enable-caca) _caca=yes ;;
965 --disable-caca) _caca=no ;;
966 --enable-svga) _svga=yes ;;
967 --disable-svga) _svga=no ;;
968 --enable-vesa) _vesa=yes ;;
969 --disable-vesa) _vesa=no ;;
970 --enable-fbdev) _fbdev=yes ;;
971 --disable-fbdev) _fbdev=no ;;
972 --enable-dvb) _dvb=yes ;;
973 --disable-dvb) _dvb=no ;;
974 --enable-dvbhead) _dvbhead=yes ;;
975 --disable-dvbhead) _dvbhead=no ;;
976 --enable-dxr2) _dxr2=yes ;;
977 --disable-dxr2) _dxr2=no ;;
978 --enable-dxr3) _dxr3=yes ;;
979 --disable-dxr3) _dxr3=no ;;
980 --enable-ivtv) _ivtv=yes ;;
981 --disable-ivtv) _ivtv=no ;;
982 --enable-v4l2) _v4l2=yes ;;
983 --disable-v4l2) _v4l2=no ;;
984 --enable-iconv) _iconv=yes ;;
985 --disable-iconv) _iconv=no ;;
986 --enable-langinfo) _langinfo=yes ;;
987 --disable-langinfo) _langinfo=no ;;
988 --enable-rtc) _rtc=yes ;;
989 --disable-rtc) _rtc=no ;;
990 --enable-libdv) _libdv=yes ;;
991 --disable-libdv) _libdv=no ;;
992 --enable-ossaudio) _ossaudio=yes ;;
993 --disable-ossaudio) _ossaudio=no ;;
994 --enable-arts) _arts=yes ;;
995 --disable-arts) _arts=no ;;
996 --enable-esd) _esd=yes ;;
997 --disable-esd) _esd=no ;;
998 --enable-pulse) _pulse=yes ;;
999 --disable-pulse) _pulse=no ;;
1000 --enable-jack) _jack=yes ;;
1001 --disable-jack) _jack=no ;;
1002 --enable-openal) _openal=yes ;;
1003 --disable-openal) _openal=no ;;
1004 --enable-dart) _dart=yes ;;
1005 --disable-dart) _dart=no ;;
1006 --enable-mad) _mad=yes ;;
1007 --disable-mad) _mad=no ;;
1008 --enable-mp3lame) _mp3lame=yes ;;
1009 --disable-mp3lame) _mp3lame=no ;;
1010 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
1011 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
1012 --enable-toolame) _toolame=yes ;;
1013 --disable-toolame) _toolame=no ;;
1014 --enable-twolame) _twolame=yes ;;
1015 --disable-twolame) _twolame=no ;;
1016 --enable-libcdio) _libcdio=yes ;;
1017 --disable-libcdio) _libcdio=no ;;
1018 --enable-liblzo) _liblzo=yes ;;
1019 --disable-liblzo) _liblzo=no ;;
1020 --enable-libvorbis) _libvorbis=yes ;;
1021 --disable-libvorbis) _libvorbis=no ;;
1022 --enable-speex) _speex=yes ;;
1023 --disable-speex) _speex=no ;;
1024 --enable-tremor) _tremor=yes ;;
1025 --disable-tremor) _tremor=no ;;
1026 --enable-tremor-internal) _tremor_internal=yes ;;
1027 --disable-tremor-internal) _tremor_internal=no ;;
1028 --enable-tremor-low) _tremor_low=yes ;;
1029 --disable-tremor-low) _tremor_low=no ;;
1030 --enable-theora) _theora=yes ;;
1031 --disable-theora) _theora=no ;;
1032 --enable-mp3lib) _mp3lib=yes ;;
1033 --disable-mp3lib) _mp3lib=no ;;
1034 --enable-liba52-internal) _liba52_internal=yes ;;
1035 --disable-liba52-internal) _liba52_internal=no ;;
1036 --enable-liba52) _liba52=yes ;;
1037 --disable-liba52) _liba52=no ;;
1038 --enable-libdca) _libdca=yes ;;
1039 --disable-libdca) _libdca=no ;;
1040 --enable-libmpeg2) _libmpeg2=yes ;;
1041 --disable-libmpeg2) _libmpeg2=no ;;
1042 --enable-musepack) _musepack=yes ;;
1043 --disable-musepack) _musepack=no ;;
1044 --enable-faad) _faad=yes ;;
1045 --disable-faad) _faad=no ;;
1046 --enable-faad-internal) _faad_internal=yes ;;
1047 --disable-faad-internal) _faad_internal=no ;;
1048 --enable-faad-fixed) _faad_fixed=yes ;;
1049 --disable-faad-fixed) _faad_fixed=no ;;
1050 --enable-faac) _faac=yes ;;
1051 --disable-faac) _faac=no ;;
1052 --enable-faac-lavc) _faac_lavc=yes ;;
1053 --disable-faac-lavc) _faac_lavc=no ;;
1054 --enable-ladspa) _ladspa=yes ;;
1055 --disable-ladspa) _ladspa=no ;;
1056 --enable-libbs2b) _libbs2b=yes ;;
1057 --disable-libbs2b) _libbs2b=no ;;
1058 --enable-xmms) _xmms=yes ;;
1059 --disable-xmms) _xmms=no ;;
1060 --enable-vcd) _vcd=yes ;;
1061 --disable-vcd) _vcd=no ;;
1062 --enable-dvdread) _dvdread=yes ;;
1063 --disable-dvdread) _dvdread=no ;;
1064 --enable-dvdread-internal) _dvdread_internal=yes ;;
1065 --disable-dvdread-internal) _dvdread_internal=no ;;
1066 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1067 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1068 --enable-dvdnav) _dvdnav=yes ;;
1069 --disable-dvdnav) _dvdnav=no ;;
1070 --enable-xanim) _xanim=yes ;;
1071 --disable-xanim) _xanim=no ;;
1072 --enable-real) _real=yes ;;
1073 --disable-real) _real=no ;;
1074 --enable-live) _live=yes ;;
1075 --disable-live) _live=no ;;
1076 --enable-nemesi) _nemesi=yes ;;
1077 --disable-nemesi) _nemesi=no ;;
1078 --enable-xinerama) _xinerama=yes ;;
1079 --disable-xinerama) _xinerama=no ;;
1080 --enable-mga) _mga=yes ;;
1081 --disable-mga) _mga=no ;;
1082 --enable-xmga) _xmga=yes ;;
1083 --disable-xmga) _xmga=no ;;
1084 --enable-vm) _vm=yes ;;
1085 --disable-vm) _vm=no ;;
1086 --enable-xf86keysym) _xf86keysym=yes ;;
1087 --disable-xf86keysym) _xf86keysym=no ;;
1088 --enable-mlib) _mlib=yes ;;
1089 --disable-mlib) _mlib=no ;;
1090 --enable-sunaudio) _sunaudio=yes ;;
1091 --disable-sunaudio) _sunaudio=no ;;
1092 --enable-sgiaudio) _sgiaudio=yes ;;
1093 --disable-sgiaudio) _sgiaudio=no ;;
1094 --enable-alsa) _alsa=yes ;;
1095 --disable-alsa) _alsa=no ;;
1096 --enable-tv) _tv=yes ;;
1097 --disable-tv) _tv=no ;;
1098 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1099 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1100 --enable-tv-v4l1) _tv_v4l1=yes ;;
1101 --disable-tv-v4l1) _tv_v4l1=no ;;
1102 --enable-tv-v4l2) _tv_v4l2=yes ;;
1103 --disable-tv-v4l2) _tv_v4l2=no ;;
1104 --enable-tv-dshow) _tv_dshow=yes ;;
1105 --disable-tv-dshow) _tv_dshow=no ;;
1106 --enable-radio) _radio=yes ;;
1107 --enable-radio-capture) _radio_capture=yes ;;
1108 --disable-radio-capture) _radio_capture=no ;;
1109 --disable-radio) _radio=no ;;
1110 --enable-radio-v4l) _radio_v4l=yes ;;
1111 --disable-radio-v4l) _radio_v4l=no ;;
1112 --enable-radio-v4l2) _radio_v4l2=yes ;;
1113 --disable-radio-v4l2) _radio_v4l2=no ;;
1114 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1115 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1116 --enable-pvr) _pvr=yes ;;
1117 --disable-pvr) _pvr=no ;;
1118 --enable-fastmemcpy) _fastmemcpy=yes ;;
1119 --disable-fastmemcpy) _fastmemcpy=no ;;
1120 --enable-network) _network=yes ;;
1121 --disable-network) _network=no ;;
1122 --enable-winsock2_h) _winsock2_h=yes ;;
1123 --disable-winsock2_h) _winsock2_h=no ;;
1124 --enable-smb) _smb=yes ;;
1125 --disable-smb) _smb=no ;;
1126 --enable-vidix) _vidix=yes ;;
1127 --disable-vidix) _vidix=no ;;
1128 --with-vidix-drivers=*)
1129 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1131 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1132 --enable-dhahelper) _dhahelper=yes ;;
1133 --disable-dhahelper) _dhahelper=no ;;
1134 --enable-svgalib_helper) _svgalib_helper=yes ;;
1135 --disable-svgalib_helper) _svgalib_helper=no ;;
1136 --enable-joystick) _joystick=yes ;;
1137 --disable-joystick) _joystick=no ;;
1138 --enable-xvid) _xvid=yes ;;
1139 --disable-xvid) _xvid=no ;;
1140 --enable-xvid-lavc) _xvid_lavc=yes ;;
1141 --disable-xvid-lavc) _xvid_lavc=no ;;
1142 --enable-x264) _x264=yes ;;
1143 --disable-x264) _x264=no ;;
1144 --enable-x264-lavc) _x264_lavc=yes ;;
1145 --disable-x264-lavc) _x264_lavc=no ;;
1146 --enable-libdirac-lavc) _libdirac_lavc=yes ;;
1147 --disable-libdirac-lavc) _libdirac_lavc=no ;;
1148 --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
1149 --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
1150 --enable-libnut) _libnut=yes ;;
1151 --disable-libnut) _libnut=no ;;
1152 --enable-libavutil_a) _libavutil_a=yes ;;
1153 --disable-libavutil_a) _libavutil_a=no ;;
1154 --enable-libavutil_so) _libavutil_so=yes ;;
1155 --disable-libavutil_so) _libavutil_so=no ;;
1156 --enable-libavcodec_a) _libavcodec_a=yes ;;
1157 --disable-libavcodec_a) _libavcodec_a=no ;;
1158 --enable-libavcodec_so) _libavcodec_so=yes ;;
1159 --disable-libavcodec_so) _libavcodec_so=no ;;
1160 --enable-libopencore_amrnb) _libopencore_amrnb=yes ;;
1161 --disable-libopencore_amrnb) _libopencore_amrnb=no ;;
1162 --enable-libopencore_amrwb) _libopencore_amrwb=yes ;;
1163 --disable-libopencore_amrwb) _libopencore_amrwb=no ;;
1164 --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1165 --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1166 --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1167 --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1168 --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1169 --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1170 --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1171 --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1172 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1173 --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1174 --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1175 --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1176 --enable-libavformat_a) _libavformat_a=yes ;;
1177 --disable-libavformat_a) _libavformat_a=no ;;
1178 --enable-libavformat_so) _libavformat_so=yes ;;
1179 --disable-libavformat_so) _libavformat_so=no ;;
1180 --enable-libpostproc_a) _libpostproc_a=yes ;;
1181 --disable-libpostproc_a) _libpostproc_a=no ;;
1182 --enable-libpostproc_so) _libpostproc_so=yes ;;
1183 --disable-libpostproc_so) _libpostproc_so=no ;;
1184 --enable-libswscale_a) _libswscale_a=yes ;;
1185 --disable-libswscale_a) _libswscale_a=no ;;
1186 --enable-libswscale_so) _libswscale_so=yes ;;
1187 --disable-libswscale_so) _libswscale_so=no ;;
1188 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1189 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1191 --enable-lirc) _lirc=yes ;;
1192 --disable-lirc) _lirc=no ;;
1193 --enable-lircc) _lircc=yes ;;
1194 --disable-lircc) _lircc=no ;;
1195 --enable-apple-remote) _apple_remote=yes ;;
1196 --disable-apple-remote) _apple_remote=no ;;
1197 --enable-apple-ir) _apple_ir=yes ;;
1198 --disable-apple-ir) _apple_ir=no ;;
1199 --enable-gui) _gui=yes ;;
1200 --disable-gui) _gui=no ;;
1201 --enable-gtk1) _gtk1=yes ;;
1202 --disable-gtk1) _gtk1=no ;;
1203 --enable-termcap) _termcap=yes ;;
1204 --disable-termcap) _termcap=no ;;
1205 --enable-termios) _termios=yes ;;
1206 --disable-termios) _termios=no ;;
1207 --enable-3dfx) _3dfx=yes ;;
1208 --disable-3dfx) _3dfx=no ;;
1209 --enable-s3fb) _s3fb=yes ;;
1210 --disable-s3fb) _s3fb=no ;;
1211 --enable-wii) _wii=yes ;;
1212 --disable-wii) _wii=no ;;
1213 --enable-tdfxfb) _tdfxfb=yes ;;
1214 --disable-tdfxfb) _tdfxfb=no ;;
1215 --disable-tdfxvid) _tdfxvid=no ;;
1216 --enable-tdfxvid) _tdfxvid=yes ;;
1217 --disable-xvr100) _xvr100=no ;;
1218 --enable-xvr100) _xvr100=yes ;;
1219 --disable-tga) _tga=no ;;
1220 --enable-tga) _tga=yes ;;
1221 --enable-directfb) _directfb=yes ;;
1222 --disable-directfb) _directfb=no ;;
1223 --enable-zr) _zr=yes ;;
1224 --disable-zr) _zr=no ;;
1225 --enable-bl) _bl=yes ;;
1226 --disable-bl) _bl=no ;;
1227 --enable-mtrr) _mtrr=yes ;;
1228 --disable-mtrr) _mtrr=no ;;
1229 --enable-largefiles) _largefiles=yes ;;
1230 --disable-largefiles) _largefiles=no ;;
1231 --enable-shm) _shm=yes ;;
1232 --disable-shm) _shm=no ;;
1233 --enable-select) _select=yes ;;
1234 --disable-select) _select=no ;;
1235 --enable-linux-devfs) _linux_devfs=yes ;;
1236 --disable-linux-devfs) _linux_devfs=no ;;
1237 --enable-cdparanoia) _cdparanoia=yes ;;
1238 --disable-cdparanoia) _cdparanoia=no ;;
1239 --enable-cddb) _cddb=yes ;;
1240 --disable-cddb) _cddb=no ;;
1241 --enable-big-endian) _big_endian=yes ;;
1242 --disable-big-endian) _big_endian=no ;;
1243 --enable-bitmap-font) _bitmap_font=yes ;;
1244 --disable-bitmap-font) _bitmap_font=no ;;
1245 --enable-freetype) _freetype=yes ;;
1246 --disable-freetype) _freetype=no ;;
1247 --enable-fontconfig) _fontconfig=yes ;;
1248 --disable-fontconfig) _fontconfig=no ;;
1249 --enable-unrarexec) _unrar_exec=yes ;;
1250 --disable-unrarexec) _unrar_exec=no ;;
1251 --enable-ftp) _ftp=yes ;;
1252 --disable-ftp) _ftp=no ;;
1253 --enable-vstream) _vstream=yes ;;
1254 --disable-vstream) _vstream=no ;;
1255 --enable-pthreads) _pthreads=yes ;;
1256 --disable-pthreads) _pthreads=no ;;
1257 --enable-w32threads) _w32threads=yes ;;
1258 --disable-w32threads) _w32threads=no ;;
1259 --enable-ass) _ass=yes ;;
1260 --disable-ass) _ass=no ;;
1261 --enable-ass-internal) ass_internal=yes ;;
1262 --disable-ass-internal) ass_internal=no ;;
1263 --enable-rpath) _rpath=yes ;;
1264 --disable-rpath) _rpath=no ;;
1266 --enable-fribidi) _fribidi=yes ;;
1267 --disable-fribidi) _fribidi=no ;;
1269 --enable-enca) _enca=yes ;;
1270 --disable-enca) _enca=no ;;
1272 --enable-inet6) _inet6=yes ;;
1273 --disable-inet6) _inet6=no ;;
1275 --enable-gethostbyname2) _gethostbyname2=yes ;;
1276 --disable-gethostbyname2) _gethostbyname2=no ;;
1278 --enable-dga1) _dga1=yes ;;
1279 --disable-dga1) _dga1=no ;;
1280 --enable-dga2) _dga2=yes ;;
1281 --disable-dga2) _dga2=no ;;
1283 --enable-menu) _menu=yes ;;
1284 --disable-menu) _menu=no ;;
1286 --enable-qtx) _qtx=yes ;;
1287 --disable-qtx) _qtx=no ;;
1289 --enable-coreaudio) _coreaudio=yes ;;
1290 --disable-coreaudio) _coreaudio=no ;;
1291 --enable-corevideo) _corevideo=yes ;;
1292 --disable-corevideo) _corevideo=no ;;
1293 --enable-quartz) _quartz=yes ;;
1294 --disable-quartz) _quartz=no ;;
1295 --enable-macosx-finder) _macosx_finder=yes ;;
1296 --disable-macosx-finder) _macosx_finder=no ;;
1297 --enable-macosx-bundle) _macosx_bundle=yes ;;
1298 --disable-macosx-bundle) _macosx_bundle=no ;;
1300 --enable-maemo) _maemo=yes ;;
1301 --disable-maemo) _maemo=no ;;
1303 --enable-sortsub) _sortsub=yes ;;
1304 --disable-sortsub) _sortsub=no ;;
1306 --enable-crash-debug) _crash_debug=yes ;;
1307 --disable-crash-debug) _crash_debug=no ;;
1308 --enable-sighandler) _sighandler=yes ;;
1309 --disable-sighandler) _sighandler=no ;;
1310 --enable-win32dll) _win32dll=yes ;;
1311 --disable-win32dll) _win32dll=no ;;
1313 --enable-sse) _sse=yes ;;
1314 --disable-sse) _sse=no ;;
1315 --enable-sse2) _sse2=yes ;;
1316 --disable-sse2) _sse2=no ;;
1317 --enable-ssse3) _ssse3=yes ;;
1318 --disable-ssse3) _ssse3=no ;;
1319 --enable-mmxext) _mmxext=yes ;;
1320 --disable-mmxext) _mmxext=no ;;
1321 --enable-3dnow) _3dnow=yes ;;
1322 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1323 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1324 --disable-3dnowext) _3dnowext=no ;;
1325 --enable-cmov) _cmov=yes ;;
1326 --disable-cmov) _cmov=no ;;
1327 --enable-fast-cmov) _fast_cmov=yes ;;
1328 --disable-fast-cmov) _fast_cmov=no ;;
1329 --enable-altivec) _altivec=yes ;;
1330 --disable-altivec) _altivec=no ;;
1331 --enable-armv5te) _armv5te=yes ;;
1332 --disable-armv5te) _armv5te=no ;;
1333 --enable-armv6) _armv6=yes ;;
1334 --disable-armv6) _armv6=no ;;
1335 --enable-armv6t2) _armv6t2=yes ;;
1336 --disable-armv6t2) _armv6t2=no ;;
1337 --enable-armvfp) _armvfp=yes ;;
1338 --disable-armvfp) _armvfp=no ;;
1339 --enable-neon) neon=yes ;;
1340 --disable-neon) neon=no ;;
1341 --enable-iwmmxt) _iwmmxt=yes ;;
1342 --disable-iwmmxt) _iwmmxt=no ;;
1343 --enable-mmx) _mmx=yes ;;
1344 --disable-mmx) # 3Dnow! and MMX2 require MMX
1345 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1348 echo "Unknown parameter: $ac_option"
1349 exit 1
1352 esac
1353 done
1355 # Atmos: moved this here, to be correct, if --prefix is specified
1356 test -z "$_bindir" && _bindir="$_prefix/bin"
1357 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1358 test -z "$_mandir" && _mandir="$_prefix/share/man"
1359 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1360 test -z "$_libdir" && _libdir="$_prefix/lib"
1362 # Determine our OS name and CPU architecture
1363 if test -z "$_target" ; then
1364 # OS name
1365 system_name=$(uname -s 2>&1)
1366 case "$system_name" in
1367 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1369 Haiku)
1370 system_name=BeOS
1372 IRIX*)
1373 system_name=IRIX
1375 GNU/kFreeBSD)
1376 system_name=FreeBSD
1378 HP-UX*)
1379 system_name=HP-UX
1381 [cC][yY][gG][wW][iI][nN]*)
1382 system_name=CYGWIN
1384 MINGW32*)
1385 system_name=MINGW32
1387 OS/2*)
1388 system_name=OS/2
1391 system_name="$system_name-UNKNOWN"
1393 esac
1396 # host's CPU/instruction set
1397 host_arch=$(uname -p 2>&1)
1398 case "$host_arch" in
1399 i386|sparc|ppc|alpha|arm|mips|vax)
1401 powerpc) # Darwin returns 'powerpc'
1402 host_arch=ppc
1404 *) # uname -p on Linux returns 'unknown' for the processor type,
1405 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1407 # Maybe uname -m (machine hardware name) returns something we
1408 # recognize.
1410 # x86/x86pc is used by QNX
1411 case "$(uname -m 2>&1)" in
1412 x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
1413 ia64) host_arch=ia64 ;;
1414 macppc|ppc) host_arch=ppc ;;
1415 ppc64) host_arch=ppc64 ;;
1416 alpha) host_arch=alpha ;;
1417 sparc) host_arch=sparc ;;
1418 sparc64) host_arch=sparc64 ;;
1419 parisc*|hppa*|9000*) host_arch=hppa ;;
1420 arm*|zaurus|cats) host_arch=arm ;;
1421 sh3|sh4|sh4a) host_arch=sh ;;
1422 s390) host_arch=s390 ;;
1423 s390x) host_arch=s390x ;;
1424 *mips*) host_arch=mips ;;
1425 vax) host_arch=vax ;;
1426 xtensa*) host_arch=xtensa ;;
1427 *) host_arch=UNKNOWN ;;
1428 esac
1430 esac
1431 else # if test -z "$_target"
1432 system_name=$(echo $_target | cut -d '-' -f 2)
1433 case "$(echo $system_name | tr A-Z a-z)" in
1434 linux) system_name=Linux ;;
1435 freebsd) system_name=FreeBSD ;;
1436 gnu/kfreebsd) system_name=FreeBSD ;;
1437 netbsd) system_name=NetBSD ;;
1438 bsd/os) system_name=BSD/OS ;;
1439 openbsd) system_name=OpenBSD ;;
1440 dragonfly) system_name=DragonFly ;;
1441 sunos) system_name=SunOS ;;
1442 qnx) system_name=QNX ;;
1443 morphos) system_name=MorphOS ;;
1444 amigaos) system_name=AmigaOS ;;
1445 mingw32*) system_name=MINGW32 ;;
1446 esac
1447 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1448 host_arch=$(echo $_target | cut -d '-' -f 1)
1449 if test $(echo $host_arch) != "x86_64" ; then
1450 host_arch=$(echo $host_arch | tr '_' '-')
1454 extra_cflags="-I. $extra_cflags"
1455 _timer=timer-linux.c
1456 _getch=getch2.c
1457 if freebsd ; then
1458 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1459 extra_cflags="$extra_cflags -I/usr/local/include"
1462 if netbsd || dragonfly ; then
1463 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1464 extra_cflags="$extra_cflags -I/usr/pkg/include"
1467 if darwin; then
1468 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1469 _timer=timer-darwin.c
1472 if aix ; then
1473 extra_ldflags="$extra_ldflags -lC"
1476 if irix ; then
1477 _ranlib='ar -r'
1478 elif linux ; then
1479 _ranlib='true'
1482 if win32 ; then
1483 _exesuf=".exe"
1484 # -lwinmm is always needed for osdep/timer-win2.c
1485 extra_ldflags="$extra_ldflags -lwinmm"
1486 _pe_executable=yes
1487 _timer=timer-win2.c
1488 _priority=yes
1489 def_dos_paths="#define HAVE_DOS_PATHS 1"
1490 def_priority="#define CONFIG_PRIORITY 1"
1493 if mingw32 ; then
1494 _getch=getch2-win.c
1495 _need_shmem=no
1498 if amigaos ; then
1499 _select=no
1500 _sighandler=no
1501 _stream_cache=no
1502 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1503 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1506 if qnx ; then
1507 extra_ldflags="$extra_ldflags -lph"
1510 if os2 ; then
1511 _exesuf=".exe"
1512 _getch=getch2-os2.c
1513 _need_shmem=no
1514 _priority=yes
1515 def_dos_paths="#define HAVE_DOS_PATHS 1"
1516 def_priority="#define CONFIG_PRIORITY 1"
1519 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1520 test "$I" && break
1521 done
1524 TMPLOG="configure.log"
1525 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1526 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1527 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1528 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1529 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1531 rm -f "$TMPLOG"
1532 echo configuration: $_configuration > "$TMPLOG"
1533 echo >> "$TMPLOG"
1536 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1537 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1541 # Checking CC version...
1542 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1543 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1544 echocheck "$_cc version"
1545 cc_vendor=intel
1546 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1547 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1548 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1549 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1550 # TODO verify older icc/ecc compatibility
1551 case $cc_version in
1553 cc_version="v. ?.??, bad"
1554 cc_fail=yes
1556 10.1|11.0|11.1)
1557 cc_version="$cc_version, ok"
1560 cc_version="$cc_version, bad"
1561 cc_fail=yes
1563 esac
1564 echores "$cc_version"
1565 else
1566 for _cc in "$_cc" cc gcc ; do
1567 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1568 if test "$cc_name_tmp" = "gcc"; then
1569 cc_name=$cc_name_tmp
1570 echocheck "$_cc version"
1571 cc_vendor=gnu
1572 cc_version=$($_cc -dumpversion 2>&1)
1573 case $cc_version in
1574 2.96*)
1575 cc_fail=yes
1578 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1579 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1580 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1582 esac
1583 echores "$cc_version"
1584 break
1586 done
1587 fi # icc
1588 test "$cc_fail" = yes && die "unsupported compiler version"
1590 if test -z "$_target" && x86 ; then
1591 cat > $TMPC << EOF
1592 int main(void) {
1593 int test[(int)sizeof(char *)-7];
1594 return 0;
1597 cc_check && host_arch=x86_64 || host_arch=i386
1600 echo "Detected operating system: $system_name"
1601 echo "Detected host architecture: $host_arch"
1603 echocheck "host cc"
1604 test "$_host_cc" || _host_cc=$_cc
1605 echores $_host_cc
1607 echocheck "cross compilation"
1608 if test $_cross_compile = auto ; then
1609 cat > $TMPC << EOF
1610 int main(void) { return 0; }
1612 _cross_compile=yes
1613 cc_check && "$TMPEXE" && _cross_compile=no
1615 echores $_cross_compile
1617 if test $_cross_compile = yes; then
1618 tmp_run() {
1619 return 0
1623 # ---
1625 # now that we know what compiler should be used for compilation, try to find
1626 # out which assembler is used by the $_cc compiler
1627 if test "$_as" = auto ; then
1628 _as=$($_cc -print-prog-name=as)
1629 test -z "$_as" && _as=as
1632 if test "$_nm" = auto ; then
1633 _nm=$($_cc -print-prog-name=nm)
1634 test -z "$_nm" && _nm=nm
1637 # XXX: this should be ok..
1638 _cpuinfo="echo"
1640 if test "$_runtime_cpudetection" = no ; then
1642 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1643 # FIXME: Remove the cygwin check once AMD CPUs are supported
1644 if test -r /proc/cpuinfo && ! cygwin; then
1645 # Linux with /proc mounted, extract CPU information from it
1646 _cpuinfo="cat /proc/cpuinfo"
1647 elif test -r /compat/linux/proc/cpuinfo && ! x86_32 ; then
1648 # FreeBSD with Linux emulation /proc mounted,
1649 # extract CPU information from it
1650 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1651 elif darwin && ! x86 ; then
1652 # use hostinfo on Darwin
1653 _cpuinfo="hostinfo"
1654 elif aix; then
1655 # use 'lsattr' on AIX
1656 _cpuinfo="lsattr -E -l proc0 -a type"
1657 elif x86; then
1658 # all other OSes try to extract CPU information from a small helper
1659 # program cpuinfo instead
1660 $_cc -o cpuinfo$_exesuf cpuinfo.c
1661 _cpuinfo="./cpuinfo$_exesuf"
1664 if x86 ; then
1665 # gather more CPU information
1666 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1667 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1668 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1669 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1670 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1672 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1674 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1675 -e s/xmm/sse/ -e s/kni/sse/)
1677 for ext in $pparam ; do
1678 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1679 done
1681 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1682 test $_sse = kernel_check && _mmxext=kernel_check
1684 echocheck "CPU vendor"
1685 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1687 echocheck "CPU type"
1688 echores "$pname"
1691 fi # test "$_runtime_cpudetection" = no
1693 if x86 && test "$_runtime_cpudetection" = no ; then
1694 extcheck() {
1695 if test "$1" = kernel_check ; then
1696 echocheck "kernel support of $2"
1697 cat > $TMPC <<EOF
1698 #include <stdlib.h>
1699 #include <signal.h>
1700 void catch() { exit(1); }
1701 int main(void) {
1702 signal(SIGILL, catch);
1703 __asm__ volatile ("$3":::"memory"); return 0;
1707 if cc_check && tmp_run ; then
1708 eval _$2=yes
1709 echores "yes"
1710 _optimizing="$_optimizing $2"
1711 return 0
1712 else
1713 eval _$2=no
1714 echores "failed"
1715 echo "It seems that your kernel does not correctly support $2."
1716 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1717 return 1
1720 return 0
1723 extcheck $_mmx "mmx" "emms"
1724 extcheck $_mmxext "mmxext" "sfence"
1725 extcheck $_3dnow "3dnow" "femms"
1726 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1727 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1728 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1729 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1730 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1732 echocheck "mtrr support"
1733 if test "$_mtrr" = kernel_check ; then
1734 _mtrr="yes"
1735 _optimizing="$_optimizing mtrr"
1737 echores "$_mtrr"
1739 if test "$_gcc3_ext" != ""; then
1740 # if we had to disable sse/sse2 because the active kernel does not
1741 # support this instruction set extension, we also have to tell
1742 # gcc3 to not generate sse/sse2 instructions for normal C code
1743 cat > $TMPC << EOF
1744 int main(void) { return 0; }
1746 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1752 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1753 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1754 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM AVR32 SH4 PPC PPC64 ALPHA MIPS SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
1755 case "$host_arch" in
1756 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1757 _arch='X86 X86_32'
1758 _target_arch="ARCH_X86 = yes"
1759 _target_subarch="ARCH_X86_32 = yes"
1760 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1761 iproc=486
1762 proc=i486
1765 if test "$_runtime_cpudetection" = no ; then
1766 case "$pvendor" in
1767 AuthenticAMD)
1768 case "$pfamily" in
1769 3) proc=i386 iproc=386 ;;
1770 4) proc=i486 iproc=486 ;;
1771 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1772 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1773 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1774 proc=k6-3
1775 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1776 proc=geode
1777 elif test "$pmodel" -ge 8; then
1778 proc=k6-2
1779 elif test "$pmodel" -ge 6; then
1780 proc=k6
1781 else
1782 proc=i586
1785 6) iproc=686
1786 # It's a bit difficult to determine the correct type of Family 6
1787 # AMD CPUs just from their signature. Instead, we check directly
1788 # whether it supports SSE.
1789 if test "$_sse" = yes; then
1790 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1791 proc=athlon-xp
1792 else
1793 # Again, gcc treats athlon and athlon-tbird similarly.
1794 proc=athlon
1797 15) iproc=686
1798 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1799 # caught and remedied in the optimization tests below.
1800 proc=k8
1803 *) proc=k8 iproc=686 ;;
1804 esac
1806 GenuineIntel)
1807 case "$pfamily" in
1808 3) proc=i386 iproc=386 ;;
1809 4) proc=i486 iproc=486 ;;
1810 5) iproc=586
1811 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1812 proc=pentium-mmx # 4 is desktop, 8 is mobile
1813 else
1814 proc=i586
1817 6) iproc=686
1818 if test "$pmodel" -ge 15; then
1819 proc=core2
1820 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1821 proc=pentium-m
1822 elif test "$pmodel" -ge 7; then
1823 proc=pentium3
1824 elif test "$pmodel" -ge 3; then
1825 proc=pentium2
1826 else
1827 proc=i686
1830 15) iproc=686
1831 # A nocona in 32-bit mode has no more capabilities than a prescott.
1832 if test "$pmodel" -ge 3; then
1833 proc=prescott
1834 else
1835 proc=pentium4
1837 test $_fast_cmov = "auto" && _fast_cmov=no
1839 *) proc=prescott iproc=686 ;;
1840 esac
1842 CentaurHauls)
1843 case "$pfamily" in
1844 5) iproc=586
1845 if test "$pmodel" -ge 8; then
1846 proc=winchip2
1847 elif test "$pmodel" -ge 4; then
1848 proc=winchip-c6
1849 else
1850 proc=i586
1853 6) iproc=686
1854 if test "$pmodel" -ge 9; then
1855 proc=c3-2
1856 else
1857 proc=c3
1858 iproc=586
1861 *) proc=i686 iproc=i686 ;;
1862 esac
1864 unknown)
1865 case "$pfamily" in
1866 3) proc=i386 iproc=386 ;;
1867 4) proc=i486 iproc=486 ;;
1868 *) proc=i586 iproc=586 ;;
1869 esac
1872 proc=i586 iproc=586 ;;
1873 esac
1874 fi # test "$_runtime_cpudetection" = no
1877 # check that gcc supports our CPU, if not, fall back to earlier ones
1878 # LGB: check -mcpu and -march swithing step by step with enabling
1879 # to fall back till 386.
1881 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1883 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1884 cpuopt=-mtune
1885 else
1886 cpuopt=-mcpu
1889 echocheck "GCC & CPU optimization abilities"
1890 cat > $TMPC << EOF
1891 int main(void) { return 0; }
1893 if test "$_runtime_cpudetection" = no ; then
1894 cc_check -march=native && proc=native
1895 if test "$proc" = "k8"; then
1896 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1898 if test "$proc" = "athlon-xp"; then
1899 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1901 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1902 cc_check -march=$proc $cpuopt=$proc || proc=k6
1904 if test "$proc" = "k6" || test "$proc" = "c3"; then
1905 if ! cc_check -march=$proc $cpuopt=$proc; then
1906 if cc_check -march=i586 $cpuopt=i686; then
1907 proc=i586-i686
1908 else
1909 proc=i586
1913 if test "$proc" = "prescott" ; then
1914 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1916 if test "$proc" = "core2" ; then
1917 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1919 if test "$proc" = "pentium4" || test "$proc" = "pentium-m" || test "$proc" = "pentium3" || test "$proc" = "pentium2" || test "$proc" = "athlon" || test "$proc" = "c3-2" || test "$proc" = "geode"; then
1920 cc_check -march=$proc $cpuopt=$proc || proc=i686
1922 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1923 cc_check -march=$proc $cpuopt=$proc || proc=i586
1925 if test "$proc" = "i586"; then
1926 cc_check -march=$proc $cpuopt=$proc || proc=i486
1928 if test "$proc" = "i486" ; then
1929 cc_check -march=$proc $cpuopt=$proc || proc=i386
1931 if test "$proc" = "i386" ; then
1932 cc_check -march=$proc $cpuopt=$proc || proc=error
1934 if test "$proc" = "error" ; then
1935 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1936 _mcpu=""
1937 _march=""
1938 _optimizing=""
1939 elif test "$proc" = "i586-i686"; then
1940 _march="-march=i586"
1941 _mcpu="$cpuopt=i686"
1942 _optimizing="$proc"
1943 else
1944 _march="-march=$proc"
1945 _mcpu="$cpuopt=$proc"
1946 _optimizing="$proc"
1948 else # if test "$_runtime_cpudetection" = no
1949 _mcpu="$cpuopt=generic"
1950 # at least i486 required, for bswap instruction
1951 _march="-march=i486"
1952 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1953 cc_check $_mcpu || _mcpu=""
1954 cc_check $_march $_mcpu || _march=""
1957 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1958 ## autodetected mcpu/march parameters
1959 if test "$_target" ; then
1960 # TODO: it may be a good idea to check GCC and fall back in all cases
1961 if test "$host_arch" = "i586-i686"; then
1962 _march="-march=i586"
1963 _mcpu="$cpuopt=i686"
1964 else
1965 _march="-march=$host_arch"
1966 _mcpu="$cpuopt=$host_arch"
1969 proc="$host_arch"
1971 case "$proc" in
1972 i386) iproc=386 ;;
1973 i486) iproc=486 ;;
1974 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1975 i686|athlon*|pentium*) iproc=686 ;;
1976 *) iproc=586 ;;
1977 esac
1980 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1981 _fast_cmov="yes"
1982 else
1983 _fast_cmov="no"
1986 echores "$proc"
1989 ia64)
1990 _arch='IA64'
1991 _target_arch='ARCH_IA64 = yes'
1992 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1993 iproc='ia64'
1996 x86_64|amd64)
1997 _arch='X86 X86_64'
1998 _target_subarch='ARCH_X86_64 = yes'
1999 _target_arch="ARCH_X86 = yes"
2000 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2001 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2002 iproc='x86_64'
2004 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2005 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
2006 cpuopt=-mtune
2007 else
2008 cpuopt=-mcpu
2010 test $_fast_cmov = "auto" && _fast_cmov=yes
2011 if test "$_runtime_cpudetection" = no ; then
2012 case "$pvendor" in
2013 AuthenticAMD)
2014 proc=k8;;
2015 GenuineIntel)
2016 case "$pfamily" in
2017 6) proc=core2;;
2019 # 64-bit prescotts exist, but as far as GCC is concerned they
2020 # have the same capabilities as a nocona.
2021 proc=nocona
2023 esac
2026 proc=error;;
2027 esac
2028 fi # test "$_runtime_cpudetection" = no
2030 echocheck "GCC & CPU optimization abilities"
2031 cat > $TMPC << EOF
2032 int main(void) { return 0; }
2034 # This is a stripped-down version of the i386 fallback.
2035 if test "$_runtime_cpudetection" = no ; then
2036 cc_check -march=native && proc=native
2037 # --- AMD processors ---
2038 if test "$proc" = "k8"; then
2039 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2041 # This will fail if gcc version < 3.3, which is ok because earlier
2042 # versions don't really support 64-bit on amd64.
2043 # Is this a valid assumption? -Corey
2044 if test "$proc" = "athlon-xp"; then
2045 cc_check -march=$proc $cpuopt=$proc || proc=error
2047 # --- Intel processors ---
2048 if test "$proc" = "core2"; then
2049 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2051 if test "$proc" = "nocona"; then
2052 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2054 if test "$proc" = "pentium4"; then
2055 cc_check -march=$proc $cpuopt=$proc || proc=error
2058 _march="-march=$proc"
2059 _mcpu="$cpuopt=$proc"
2060 if test "$proc" = "error" ; then
2061 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2062 _mcpu=""
2063 _march=""
2065 else # if test "$_runtime_cpudetection" = no
2066 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2067 _march="-march=x86-64"
2068 _mcpu="$cpuopt=generic"
2069 cc_check $_mcpu || _mcpu="x86-64"
2070 cc_check $_mcpu || _mcpu=""
2071 cc_check $_march $_mcpu || _march=""
2074 _optimizing=""
2076 echores "$proc"
2079 sparc|sparc64)
2080 _arch='SPARC'
2081 _target_arch='ARCH_SPARC = yes'
2082 iproc='sparc'
2083 if test "$host_arch" = "sparc64" ; then
2084 _vis='yes'
2085 proc='ultrasparc'
2086 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2087 elif sunos ; then
2088 echocheck "CPU type"
2089 karch=$(uname -m)
2090 case "$(echo $karch)" in
2091 sun4) proc=v7 ;;
2092 sun4c) proc=v7 ;;
2093 sun4d) proc=v8 ;;
2094 sun4m) proc=v8 ;;
2095 sun4u) proc=ultrasparc _vis='yes' ;;
2096 sun4v) proc=v9 ;;
2097 *) proc=v8 ;;
2098 esac
2099 echores "$proc"
2100 else
2101 proc=v8
2103 _mcpu="-mcpu=$proc"
2104 _optimizing="$proc"
2107 arm|armv4l|armv5tel)
2108 _arch='ARM'
2109 _target_arch='ARCH_ARM = yes'
2110 iproc='arm'
2113 avr32)
2114 _arch='AVR32'
2115 _target_arch='ARCH_AVR32 = yes'
2116 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2117 iproc='avr32'
2120 sh|sh4)
2121 _arch='SH4'
2122 _target_arch='ARCH_SH4 = yes'
2123 iproc='sh4'
2126 ppc|ppc64|powerpc|powerpc64)
2127 _arch='PPC'
2128 def_dcbzl='#define HAVE_DCBZL 0'
2129 _target_arch='ARCH_PPC = yes'
2130 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2131 iproc='ppc'
2133 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2134 _arch='PPC PPC64'
2135 _target_subarch='ARCH_PPC64 = yes'
2136 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2138 echocheck "CPU type"
2139 case $system_name in
2140 Linux)
2141 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2142 if test -n "$($_cpuinfo | grep altivec)"; then
2143 test $_altivec = auto && _altivec=yes
2146 Darwin)
2147 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2148 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2149 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2150 test $_altivec = auto && _altivec=yes
2153 NetBSD)
2154 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2155 case $cc_version in
2156 2*|3.0*|3.1*|3.2*|3.3*)
2159 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2160 test $_altivec = auto && _altivec=yes
2163 esac
2165 AIX)
2166 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2168 esac
2169 if test "$_altivec" = yes; then
2170 echores "$proc altivec"
2171 else
2172 _altivec=no
2173 echores "$proc"
2176 echocheck "GCC & CPU optimization abilities"
2178 if test -n "$proc"; then
2179 case "$proc" in
2180 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2181 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2182 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2183 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2184 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2185 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2186 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2187 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2188 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2189 *) ;;
2190 esac
2191 # gcc 3.1(.1) and up supports 7400 and 7450
2192 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2193 case "$proc" in
2194 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2195 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2196 *) ;;
2197 esac
2199 # gcc 3.2 and up supports 970
2200 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2201 case "$proc" in
2202 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2203 def_dcbzl='#define HAVE_DCBZL 1' ;;
2204 *) ;;
2205 esac
2207 # gcc 3.3 and up supports POWER4
2208 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2209 case "$proc" in
2210 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2211 *) ;;
2212 esac
2214 # gcc 3.4 and up supports 440*
2215 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2216 case "$proc" in
2217 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2218 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2219 *) ;;
2220 esac
2222 # gcc 4.0 and up supports POWER5
2223 if test "$_cc_major" -ge "4"; then
2224 case "$proc" in
2225 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2226 *) ;;
2227 esac
2231 if test -n "$_mcpu"; then
2232 _optimizing=$(echo $_mcpu | cut -c 8-)
2233 echores "$_optimizing"
2234 else
2235 echores "none"
2240 alpha*)
2241 _arch='ALPHA'
2242 _target_arch='ARCH_ALPHA = yes'
2243 iproc='alpha'
2245 echocheck "CPU type"
2246 cat > $TMPC << EOF
2247 int main(void) {
2248 unsigned long ver, mask;
2249 __asm__ ("implver %0" : "=r" (ver));
2250 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2251 printf("%ld-%x\n", ver, ~mask);
2252 return 0;
2255 $_cc -o "$TMPEXE" "$TMPC"
2256 case $("$TMPEXE") in
2258 0-0) proc="ev4"; _mvi="0";;
2259 1-0) proc="ev5"; _mvi="0";;
2260 1-1) proc="ev56"; _mvi="0";;
2261 1-101) proc="pca56"; _mvi="1";;
2262 2-303) proc="ev6"; _mvi="1";;
2263 2-307) proc="ev67"; _mvi="1";;
2264 2-1307) proc="ev68"; _mvi="1";;
2265 esac
2266 echores "$proc"
2268 echocheck "GCC & CPU optimization abilities"
2269 if test "$proc" = "ev68" ; then
2270 cc_check -mcpu=$proc || proc=ev67
2272 if test "$proc" = "ev67" ; then
2273 cc_check -mcpu=$proc || proc=ev6
2275 _mcpu="-mcpu=$proc"
2276 echores "$proc"
2278 _optimizing="$proc"
2281 mips)
2282 _arch='SGI_MIPS'
2283 _target_arch='ARCH_SGI_MIPS = yes'
2284 iproc='sgi-mips'
2286 if irix ; then
2287 echocheck "CPU type"
2288 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2289 case "$(echo $proc)" in
2290 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2291 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2292 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2293 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2294 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2295 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2296 esac
2297 # gcc < 3.x does not support -mtune.
2298 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2299 _mcpu=''
2301 echores "$proc"
2306 hppa)
2307 _arch='PA_RISC'
2308 _target_arch='ARCH_PA_RISC = yes'
2309 iproc='PA-RISC'
2312 s390)
2313 _arch='S390'
2314 _target_arch='ARCH_S390 = yes'
2315 iproc='390'
2318 s390x)
2319 _arch='S390X'
2320 _target_arch='ARCH_S390X = yes'
2321 iproc='390x'
2324 vax)
2325 _arch='VAX'
2326 _target_arch='ARCH_VAX = yes'
2327 iproc='vax'
2330 xtensa)
2331 _arch='XTENSA'
2332 _target_arch='ARCH_XTENSA = yes'
2333 iproc='xtensa'
2336 generic)
2337 _arch='GENERIC'
2338 _target_arch='ARCH_GENERIC = yes'
2342 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2343 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2344 die "unsupported architecture $host_arch"
2346 esac # case "$host_arch" in
2348 if test "$_runtime_cpudetection" = yes ; then
2349 if x86 ; then
2350 test "$_cmov" != no && _cmov=yes
2351 x86_32 && _cmov=no
2352 test "$_mmx" != no && _mmx=yes
2353 test "$_3dnow" != no && _3dnow=yes
2354 test "$_3dnowext" != no && _3dnowext=yes
2355 test "$_mmxext" != no && _mmxext=yes
2356 test "$_sse" != no && _sse=yes
2357 test "$_sse2" != no && _sse2=yes
2358 test "$_ssse3" != no && _ssse3=yes
2359 test "$_mtrr" != no && _mtrr=yes
2361 if ppc; then
2362 _altivec=yes
2367 # endian testing
2368 echocheck "byte order"
2369 if test "$_big_endian" = auto ; then
2370 cat > $TMPC <<EOF
2371 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2372 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2373 int main(void) { return (int)ascii_name; }
2375 if cc_check ; then
2376 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2377 _big_endian=yes
2378 else
2379 _big_endian=no
2381 else
2382 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2385 if test "$_big_endian" = yes ; then
2386 _byte_order='big-endian'
2387 def_words_endian='#define WORDS_BIGENDIAN 1'
2388 def_bigendian='#define HAVE_BIGENDIAN 1'
2389 else
2390 _byte_order='little-endian'
2391 def_words_endian='#undef WORDS_BIGENDIAN'
2392 def_bigendian='#define HAVE_BIGENDIAN 0'
2394 echores "$_byte_order"
2397 echocheck "extern symbol prefix"
2398 cat > $TMPC << EOF
2399 int ff_extern;
2401 cc_check -c || die "Symbol mangling check failed."
2402 sym=$($_nm -P -g $TMPEXE)
2403 extern_prefix=${sym%%ff_extern*}
2404 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2405 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2406 echores $extern_prefix
2409 echocheck "assembler support of -pipe option"
2410 cat > $TMPC << EOF
2411 int main(void) { return 0; }
2413 cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no"
2416 echocheck "compiler support of named assembler arguments"
2417 _named_asm_args=yes
2418 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2419 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2420 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2421 _named_asm_args=no
2422 def_named_asm_args="#undef NAMED_ASM_ARGS"
2424 echores $_named_asm_args
2427 if darwin && test "$cc_vendor" = "gnu" ; then
2428 echocheck "GCC support of -mstackrealign"
2429 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2430 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2431 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2432 # wrong code with this flag, but this can be worked around by adding
2433 # -fno-unit-at-a-time as described in the blog post at
2434 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2435 cat > $TMPC << EOF
2436 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2437 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2439 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2440 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2441 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2442 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2443 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2446 # Checking for CFLAGS
2447 _install_strip="-s"
2448 if test "$_profile" != "" || test "$_debug" != "" ; then
2449 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2450 _install_strip=
2451 elif test -z "$CFLAGS" ; then
2452 if test "$cc_vendor" = "intel" ; then
2453 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2454 elif test "$cc_vendor" != "gnu" ; then
2455 CFLAGS="-O2 $_march $_mcpu $_pipe"
2456 else
2457 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2458 extra_ldflags="$extra_ldflags -ffast-math"
2460 else
2461 _warn_CFLAGS=yes
2464 cat > $TMPC << EOF
2465 int main(void) { return 0; }
2467 if test "$cc_vendor" = "gnu" ; then
2468 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2469 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
2470 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2471 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2472 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2473 else
2474 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2477 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2480 if test -n "$LDFLAGS" ; then
2481 extra_ldflags="$extra_ldflags $LDFLAGS"
2482 _warn_CFLAGS=yes
2483 elif test "$cc_vendor" = "intel" ; then
2484 extra_ldflags="$extra_ldflags -i-static"
2486 if test -n "$CPPFLAGS" ; then
2487 extra_cflags="$extra_cflags $CPPFLAGS"
2488 _warn_CFLAGS=yes
2493 if x86_32 ; then
2494 # Checking assembler (_as) compatibility...
2495 # Added workaround for older as that reads from stdin by default - atmos
2496 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2497 echocheck "assembler ($_as $as_version)"
2499 _pref_as_version='2.9.1'
2500 echo 'nop' > $TMPS
2501 if test "$_mmx" = yes ; then
2502 echo 'emms' >> $TMPS
2504 if test "$_3dnow" = yes ; then
2505 _pref_as_version='2.10.1'
2506 echo 'femms' >> $TMPS
2508 if test "$_3dnowext" = yes ; then
2509 _pref_as_version='2.10.1'
2510 echo 'pswapd %mm0, %mm0' >> $TMPS
2512 if test "$_mmxext" = yes ; then
2513 _pref_as_version='2.10.1'
2514 echo 'movntq %mm0, (%eax)' >> $TMPS
2516 if test "$_sse" = yes ; then
2517 _pref_as_version='2.10.1'
2518 echo 'xorps %xmm0, %xmm0' >> $TMPS
2520 #if test "$_sse2" = yes ; then
2521 # _pref_as_version='2.11'
2522 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2524 if test "$_cmov" = yes ; then
2525 _pref_as_version='2.10.1'
2526 echo 'cmovb %eax, %ebx' >> $TMPS
2528 if test "$_ssse3" = yes ; then
2529 _pref_as_version='2.16.92'
2530 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2532 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2534 if test "$as_verc_fail" != yes ; then
2535 echores "ok"
2536 else
2537 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2538 echores "failed"
2539 die "obsolete binutils version"
2542 fi #if x86_32
2544 echocheck ".align is a power of two"
2545 if test "$_asmalign_pot" = auto ; then
2546 _asmalign_pot=no
2547 cat > $TMPC << EOF
2548 int main(void) { __asm__ (".align 3"); return 0; }
2550 cc_check && _asmalign_pot=yes
2552 if test "$_asmalign_pot" = "yes" ; then
2553 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2554 else
2555 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2557 echores $_asmalign_pot
2559 if x86 ; then
2560 echocheck "10 assembler operands"
2561 ten_operands=no
2562 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2563 cat > $TMPC << EOF
2564 int main(void) {
2565 int x=0;
2566 __asm__ volatile(
2568 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2570 return 0;
2573 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2574 echores $ten_operands
2576 echocheck "ebx availability"
2577 ebx_available=no
2578 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2579 cat > $TMPC << EOF
2580 int main(void) {
2581 int x;
2582 __asm__ volatile(
2583 "xor %0, %0"
2584 :"=b"(x)
2585 // just adding ebx to clobber list seems unreliable with some
2586 // compilers, e.g. Haiku's gcc 2.95
2588 // and the above check does not work for OSX 64 bit...
2589 __asm__ volatile("":::"%ebx");
2590 return 0;
2593 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2594 echores $ebx_available
2596 echocheck "PIC"
2597 pic=no
2598 cat > $TMPC << EOF
2599 int main(void) {
2600 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2601 #error PIC not enabled
2602 #endif
2603 return 0;
2606 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2607 echores $pic
2609 echocheck "yasm"
2610 if test -z "$YASMFLAGS" ; then
2611 if darwin ; then
2612 x86_64 && objformat="macho64" || objformat="macho"
2613 elif win32 ; then
2614 objformat="win32"
2615 else
2616 objformat="elf"
2618 # currently tested for Linux x86, x86_64
2619 YASMFLAGS="-f $objformat"
2620 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2621 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2622 case "$objformat" in
2623 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2624 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2625 esac
2626 else
2627 _warn_CFLAGS=yes
2630 echo "pabsw xmm0, xmm0" > $TMPS
2631 yasm_check || _yasm=""
2632 if test $_yasm ; then
2633 test "$_mmx" = "yes" && fft_mmx="yes"
2634 def_yasm='#define HAVE_YASM 1'
2635 _have_yasm="yes"
2636 echores "$_yasm"
2637 else
2638 def_yasm='#define HAVE_YASM 0'
2639 fft_mmx="no"
2640 _have_yasm="no"
2641 echores "no"
2644 echocheck "bswap"
2645 def_bswap='#define HAVE_BSWAP 0'
2646 echo 'bswap %eax' > $TMPS
2647 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2648 echores "$bswap"
2649 fi #if x86
2652 #FIXME: This should happen before the check for CFLAGS..
2653 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2654 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2656 # check if AltiVec is supported by the compiler, and how to enable it
2657 echocheck "GCC AltiVec flags"
2658 cat > $TMPC << EOF
2659 int main(void) { return 0; }
2661 if $(cc_check -maltivec -mabi=altivec) ; then
2662 _altivec_gcc_flags="-maltivec -mabi=altivec"
2663 # check if <altivec.h> should be included
2664 cat > $TMPC << EOF
2665 #include <altivec.h>
2666 int main(void) { return 0; }
2668 if $(cc_check $_altivec_gcc_flags) ; then
2669 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2670 inc_altivec_h='#include <altivec.h>'
2671 else
2672 cat > $TMPC << EOF
2673 int main(void) { return 0; }
2675 if $(cc_check -faltivec) ; then
2676 _altivec_gcc_flags="-faltivec"
2677 else
2678 _altivec=no
2679 _altivec_gcc_flags="none, AltiVec disabled"
2683 echores "$_altivec_gcc_flags"
2685 # check if the compiler supports braces for vector declarations
2686 cat > $TMPC << EOF
2687 $inc_altivec_h
2688 int main(void) { (vector int) {1}; return 0; }
2690 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2692 # Disable runtime cpudetection if we cannot generate AltiVec code or
2693 # AltiVec is disabled by the user.
2694 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2695 && _runtime_cpudetection=no
2697 # Show that we are optimizing for AltiVec (if enabled and supported).
2698 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2699 && _optimizing="$_optimizing altivec"
2701 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2702 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2705 if ppc ; then
2706 def_xform_asm='#define HAVE_XFORM_ASM 0'
2707 xform_asm=no
2708 echocheck "XFORM ASM support"
2709 cat > $TMPC << EOF
2710 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2712 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2713 echores "$xform_asm"
2716 if arm ; then
2717 echocheck "ARM pld instruction"
2718 cat > $TMPC << EOF
2719 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2721 pld=no
2722 cc_check && pld=yes
2723 echores "$pld"
2725 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2726 if test $_armv5te = "auto" ; then
2727 cat > $TMPC << EOF
2728 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2730 _armv5te=no
2731 cc_check && _armv5te=yes
2733 echores "$_armv5te"
2735 echocheck "ARMv6 (SIMD instructions)"
2736 if test $_armv6 = "auto" ; then
2737 cat > $TMPC << EOF
2738 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2740 _armv6=no
2741 cc_check && _armv6=yes
2743 echores "$_armv6"
2745 echocheck "ARMv6t2 (SIMD instructions)"
2746 if test $_armv6t2 = "auto" ; then
2747 cat > $TMPC << EOF
2748 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2750 _armv6t2=no
2751 cc_check && _armv6t2=yes
2753 echores "$_armv6"
2755 echocheck "ARM VFP"
2756 if test $_armvfp = "auto" ; then
2757 cat > $TMPC << EOF
2758 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2760 _armvfp=no
2761 cc_check && _armvfp=yes
2763 echores "$_armvfp"
2765 echocheck "ARM NEON"
2766 if test $neon = "auto" ; then
2767 cat > $TMPC << EOF
2768 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2770 neon=no
2771 cc_check && neon=yes
2773 echores "$neon"
2775 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2776 if test $_iwmmxt = "auto" ; then
2777 cat > $TMPC << EOF
2778 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2780 _iwmmxt=no
2781 cc_check && _iwmmxt=yes
2783 echores "$_iwmmxt"
2786 _cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2787 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2788 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2789 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2790 test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts"
2791 test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts"
2792 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2793 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2794 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2795 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2796 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2797 test "$pld" = yes && _cpuexts="PLD $_cpuexts"
2798 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2799 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2800 test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts"
2801 test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts"
2802 test "$neon" = yes && _cpuexts="NEON $_cpuexts"
2803 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2804 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2805 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2807 # Checking kernel version...
2808 if x86_32 && linux ; then
2809 _k_verc_problem=no
2810 kernel_version=$(uname -r 2>&1)
2811 echocheck "$system_name kernel version"
2812 case "$kernel_version" in
2813 '') kernel_version="?.??"; _k_verc_fail=yes;;
2814 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2815 _k_verc_problem=yes;;
2816 esac
2817 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2818 _k_verc_fail=yes
2820 if test "$_k_verc_fail" ; then
2821 echores "$kernel_version, fail"
2822 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2823 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2824 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2825 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2826 echo "2.2.x you must upgrade it to get SSE support!"
2827 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2828 else
2829 echores "$kernel_version, ok"
2833 ######################
2834 # MAIN TESTS GO HERE #
2835 ######################
2838 echocheck "-lposix"
2839 cat > $TMPC <<EOF
2840 int main(void) { return 0; }
2842 if cc_check -lposix ; then
2843 extra_ldflags="$extra_ldflags -lposix"
2844 echores "yes"
2845 else
2846 echores "no"
2849 echocheck "-lm"
2850 cat > $TMPC <<EOF
2851 int main(void) { return 0; }
2853 if cc_check -lm ; then
2854 _ld_lm="-lm"
2855 echores "yes"
2856 else
2857 _ld_lm=""
2858 echores "no"
2862 echocheck "langinfo"
2863 if test "$_langinfo" = auto ; then
2864 cat > $TMPC <<EOF
2865 #include <langinfo.h>
2866 int main(void) { nl_langinfo(CODESET); return 0; }
2868 _langinfo=no
2869 cc_check && _langinfo=yes
2871 if test "$_langinfo" = yes ; then
2872 def_langinfo='#define HAVE_LANGINFO 1'
2873 else
2874 def_langinfo='#undef HAVE_LANGINFO'
2876 echores "$_langinfo"
2879 echocheck "language"
2880 # Set preferred languages, "all" uses English as main language.
2881 test -z "$language" && language=$LINGUAS
2882 test -z "$language_doc" && language_doc=$language
2883 test -z "$language_man" && language_man=$language
2884 test -z "$language_msg" && language_msg=$language
2885 language_doc=$(echo $language_doc | tr , " ")
2886 language_man=$(echo $language_man | tr , " ")
2887 language_msg=$(echo $language_msg | tr , " ")
2889 test "$language_doc" = "all" && language_doc=$doc_lang_all
2890 test "$language_man" = "all" && language_man=$man_lang_all
2891 test "$language_msg" = "all" && language_msg=en
2893 # Prune non-existing translations from language lists.
2894 # Set message translation to the first available language.
2895 # Fall back on English.
2896 for lang in $language_doc ; do
2897 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2898 done
2899 language_doc=$tmp_language_doc
2900 test -z "$language_doc" && language_doc=en
2902 for lang in $language_man ; do
2903 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2904 done
2905 language_man=$tmp_language_man
2906 test -z "$language_man" && language_man=en
2908 for lang in $language_msg ; do
2909 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2910 done
2911 language_msg=$tmp_language_msg
2912 test -z "$language_msg" && language_msg=en
2913 _mp_help="help/help_mp-${language_msg}.h"
2914 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2917 echocheck "enable sighandler"
2918 if test "$_sighandler" = yes ; then
2919 def_sighandler='#define CONFIG_SIGHANDLER 1'
2920 else
2921 def_sighandler='#undef CONFIG_SIGHANDLER'
2923 echores "$_sighandler"
2925 echocheck "runtime cpudetection"
2926 if test "$_runtime_cpudetection" = yes ; then
2927 _optimizing="Runtime CPU-Detection enabled"
2928 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2929 else
2930 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2932 echores "$_runtime_cpudetection"
2935 echocheck "restrict keyword"
2936 for restrict_keyword in restrict __restrict __restrict__ ; do
2937 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2938 if cc_check; then
2939 def_restrict_keyword=$restrict_keyword
2940 break;
2942 done
2943 if [ -n "$def_restrict_keyword" ]; then
2944 echores "$def_restrict_keyword"
2945 else
2946 echores "none"
2948 # Avoid infinite recursion loop ("#define restrict restrict")
2949 if [ "$def_restrict_keyword" != "restrict" ]; then
2950 def_restrict_keyword="#define restrict $def_restrict_keyword"
2951 else
2952 def_restrict_keyword=""
2956 echocheck "__builtin_expect"
2957 # GCC branch prediction hint
2958 cat > $TMPC << EOF
2959 int foo(int a) {
2960 a = __builtin_expect(a, 10);
2961 return a == 10 ? 0 : 1;
2963 int main(void) { return foo(10) && foo(0); }
2965 _builtin_expect=no
2966 cc_check && _builtin_expect=yes
2967 if test "$_builtin_expect" = yes ; then
2968 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2969 else
2970 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2972 echores "$_builtin_expect"
2975 echocheck "kstat"
2976 cat > $TMPC << EOF
2977 #include <kstat.h>
2978 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2980 _kstat=no
2981 cc_check -lkstat && _kstat=yes
2982 if test "$_kstat" = yes ; then
2983 def_kstat="#define HAVE_LIBKSTAT 1"
2984 extra_ldflags="$extra_ldflags -lkstat"
2985 else
2986 def_kstat="#undef HAVE_LIBKSTAT"
2988 echores "$_kstat"
2991 echocheck "posix4"
2992 # required for nanosleep on some systems
2993 cat > $TMPC << EOF
2994 #include <time.h>
2995 int main(void) { (void) nanosleep(0, 0); return 0; }
2997 _posix4=no
2998 cc_check -lposix4 && _posix4=yes
2999 if test "$_posix4" = yes ; then
3000 extra_ldflags="$extra_ldflags -lposix4"
3002 echores "$_posix4"
3004 for func in llrint log2 lrint lrintf round roundf truncf; do
3005 echocheck $func
3006 cat > $TMPC << EOF
3007 #include <math.h>
3008 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
3010 eval _$func=no
3011 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
3012 if eval test "x\$_$func" = "xyes"; then
3013 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
3014 echores yes
3015 else
3016 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
3017 echores no
3019 done
3022 echocheck "mkstemp"
3023 cat > $TMPC << EOF
3024 #include <stdlib.h>
3025 int main(void) { char a; mkstemp(&a); return 0; }
3027 _mkstemp=no
3028 cc_check && _mkstemp=yes
3029 if test "$_mkstemp" = yes ; then
3030 def_mkstemp='#define HAVE_MKSTEMP 1'
3031 else
3032 def_mkstemp='#undef HAVE_MKSTEMP'
3034 echores "$_mkstemp"
3037 echocheck "nanosleep"
3038 # also check for nanosleep
3039 cat > $TMPC << EOF
3040 #include <time.h>
3041 int main(void) { (void) nanosleep(0, 0); return 0; }
3043 _nanosleep=no
3044 cc_check && _nanosleep=yes
3045 if test "$_nanosleep" = yes ; then
3046 def_nanosleep='#define HAVE_NANOSLEEP 1'
3047 else
3048 def_nanosleep='#undef HAVE_NANOSLEEP'
3050 echores "$_nanosleep"
3053 echocheck "socklib"
3054 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3055 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3056 cat > $TMPC << EOF
3057 #include <netdb.h>
3058 #include <sys/socket.h>
3059 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3061 _socklib=no
3062 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3063 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3064 done
3065 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3066 if test $_winsock2_h = auto ; then
3067 _winsock2_h=no
3068 cat > $TMPC << EOF
3069 #include <winsock2.h>
3070 int main(void) { (void) gethostbyname(0); return 0; }
3072 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3074 test "$_ld_sock" && _res_comment="using $_ld_sock"
3075 echores "$_socklib"
3078 if test $_winsock2_h = yes ; then
3079 _ld_sock="-lws2_32"
3080 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3081 else
3082 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3086 echocheck "arpa/inet.h"
3087 arpa_inet_h=no
3088 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3089 cat > $TMPC << EOF
3090 #include <arpa/inet.h>
3091 int main(void) { return 0; }
3093 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3094 echores "$arpa_inet_h"
3097 echocheck "inet_pton()"
3098 def_inet_pton='#define HAVE_INET_PTON 0'
3099 inet_pton=no
3100 cat > $TMPC << EOF
3101 #include <sys/types.h>
3102 #include <sys/socket.h>
3103 #include <arpa/inet.h>
3104 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3106 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3107 cc_check $_ld_tmp && inet_pton=yes && break
3108 done
3109 if test $inet_pton = yes ; then
3110 test $_ld_tmp && _res_comment="using $_ld_tmp"
3111 def_inet_pton='#define HAVE_INET_PTON 1'
3113 echores "$inet_pton"
3116 echocheck "inet_aton()"
3117 def_inet_aton='#define HAVE_INET_ATON 0'
3118 inet_aton=no
3119 cat > $TMPC << EOF
3120 #include <sys/types.h>
3121 #include <sys/socket.h>
3122 #include <arpa/inet.h>
3123 int main(void) { (void) inet_aton(0, 0); return 0; }
3125 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3126 cc_check $_ld_tmp && inet_aton=yes && break
3127 done
3128 if test $inet_aton = yes ; then
3129 test $_ld_tmp && _res_comment="using $_ld_tmp"
3130 def_inet_aton='#define HAVE_INET_ATON 1'
3132 echores "$inet_aton"
3135 echocheck "socklen_t"
3136 _socklen_t=no
3137 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3138 cat > $TMPC << EOF
3139 #include <$header>
3140 int main(void) { socklen_t v = 0; return v; }
3142 cc_check && _socklen_t=yes && break
3143 done
3144 if test "$_socklen_t" = yes ; then
3145 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3146 else
3147 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3149 echores "$_socklen_t"
3152 echocheck "closesocket()"
3153 _closesocket=no
3154 cat > $TMPC << EOF
3155 #include <winsock2.h>
3156 int main(void) { closesocket(~0); return 0; }
3158 cc_check $_ld_sock && _closesocket=yes
3159 if test "$_closesocket" = yes ; then
3160 def_closesocket='#define HAVE_CLOSESOCKET 1'
3161 else
3162 def_closesocket='#define HAVE_CLOSESOCKET 0'
3164 echores "$_closesocket"
3167 echocheck "network"
3168 test $_winsock2_h = no && test $inet_pton = no &&
3169 test $inet_aton = no && _network=no
3170 if test "$_network" = yes ; then
3171 def_network='#define CONFIG_NETWORK 1'
3172 extra_ldflags="$extra_ldflags $_ld_sock"
3173 _inputmodules="network $_inputmodules"
3174 else
3175 _noinputmodules="network $_noinputmodules"
3176 def_network='#undef CONFIG_NETWORK'
3177 _ftp=no
3179 echores "$_network"
3182 echocheck "inet6"
3183 if test "$_inet6" = auto ; then
3184 cat > $TMPC << EOF
3185 #include <sys/types.h>
3186 #if !defined(_WIN32) || defined(__CYGWIN__)
3187 #include <sys/socket.h>
3188 #include <netinet/in.h>
3189 #else
3190 #include <ws2tcpip.h>
3191 #endif
3192 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3194 _inet6=no
3195 if cc_check $_ld_sock ; then
3196 _inet6=yes
3199 if test "$_inet6" = yes ; then
3200 def_inet6='#define HAVE_AF_INET6 1'
3201 else
3202 def_inet6='#undef HAVE_AF_INET6'
3204 echores "$_inet6"
3207 echocheck "gethostbyname2"
3208 if test "$_gethostbyname2" = auto ; then
3209 cat > $TMPC << EOF
3210 #include <sys/types.h>
3211 #include <sys/socket.h>
3212 #include <netdb.h>
3213 int main(void) { gethostbyname2("", AF_INET); return 0; }
3215 _gethostbyname2=no
3216 if cc_check ; then
3217 _gethostbyname2=yes
3220 if test "$_gethostbyname2" = yes ; then
3221 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3222 else
3223 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3225 echores "$_gethostbyname2"
3228 echocheck "inttypes.h (required)"
3229 cat > $TMPC << EOF
3230 #include <inttypes.h>
3231 int main(void) { return 0; }
3233 _inttypes=no
3234 cc_check && _inttypes=yes
3235 echores "$_inttypes"
3237 if test "$_inttypes" = no ; then
3238 echocheck "bitypes.h (inttypes.h predecessor)"
3239 cat > $TMPC << EOF
3240 #include <sys/bitypes.h>
3241 int main(void) { return 0; }
3243 cc_check && _inttypes=yes
3244 if test "$_inttypes" = yes ; then
3245 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."
3246 else
3247 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3252 echocheck "int_fastXY_t in inttypes.h"
3253 cat > $TMPC << EOF
3254 #include <inttypes.h>
3255 int main(void) {
3256 volatile int_fast16_t v= 0;
3257 return v; }
3259 _fast_inttypes=no
3260 cc_check && _fast_inttypes=yes
3261 if test "$_fast_inttypes" = no ; then
3262 def_fast_inttypes='
3263 typedef signed char int_fast8_t;
3264 typedef signed int int_fast16_t;
3265 typedef signed int int_fast32_t;
3266 typedef signed long long int_fast64_t;
3267 typedef unsigned char uint_fast8_t;
3268 typedef unsigned int uint_fast16_t;
3269 typedef unsigned int uint_fast32_t;
3270 typedef unsigned long long uint_fast64_t;'
3272 echores "$_fast_inttypes"
3275 echocheck "malloc.h"
3276 cat > $TMPC << EOF
3277 #include <malloc.h>
3278 int main(void) { (void) malloc(0); return 0; }
3280 _malloc=no
3281 cc_check && _malloc=yes
3282 if test "$_malloc" = yes ; then
3283 def_malloc_h='#define HAVE_MALLOC_H 1'
3284 else
3285 def_malloc_h='#define HAVE_MALLOC_H 0'
3287 # malloc.h emits a warning in FreeBSD and OpenBSD
3288 freebsd || openbsd || dragonfly && def_malloc_h='#define HAVE_MALLOC_H 0'
3289 echores "$_malloc"
3292 echocheck "memalign()"
3293 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3294 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3295 cat > $TMPC << EOF
3296 #include <malloc.h>
3297 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3299 _memalign=no
3300 cc_check && _memalign=yes
3301 if test "$_memalign" = yes ; then
3302 def_memalign='#define HAVE_MEMALIGN 1'
3303 else
3304 def_memalign='#define HAVE_MEMALIGN 0'
3305 def_map_memalign='#define memalign(a,b) malloc(b)'
3306 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3308 echores "$_memalign"
3311 echocheck "posix_memalign()"
3312 posix_memalign=no
3313 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3314 cat > $TMPC << EOF
3315 #define _XOPEN_SOURCE 600
3316 #include <stdlib.h>
3317 int main(void) { posix_memalign(NULL, 0, 0); }
3319 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3320 echores "$posix_memalign"
3323 echocheck "alloca.h"
3324 cat > $TMPC << EOF
3325 #include <alloca.h>
3326 int main(void) { (void) alloca(0); return 0; }
3328 _alloca=no
3329 cc_check && _alloca=yes
3330 if cc_check ; then
3331 def_alloca_h='#define HAVE_ALLOCA_H 1'
3332 else
3333 def_alloca_h='#undef HAVE_ALLOCA_H'
3335 echores "$_alloca"
3338 echocheck "fastmemcpy"
3339 if test "$_fastmemcpy" = yes ; then
3340 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3341 else
3342 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3344 echores "$_fastmemcpy"
3347 echocheck "mman.h"
3348 cat > $TMPC << EOF
3349 #include <sys/types.h>
3350 #include <sys/mman.h>
3351 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3353 _mman=no
3354 cc_check && _mman=yes
3355 if test "$_mman" = yes ; then
3356 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3357 else
3358 def_mman_h='#undef HAVE_SYS_MMAN_H'
3359 os2 && _need_mmap=yes
3361 echores "$_mman"
3363 cat > $TMPC << EOF
3364 #include <sys/types.h>
3365 #include <sys/mman.h>
3366 int main(void) { void *p = MAP_FAILED; return 0; }
3368 _mman_has_map_failed=no
3369 cc_check && _mman_has_map_failed=yes
3370 if test "$_mman_has_map_failed" = yes ; then
3371 def_mman_has_map_failed=''
3372 else
3373 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3376 echocheck "dynamic loader"
3377 cat > $TMPC << EOF
3378 #include <stddef.h>
3379 #include <dlfcn.h>
3380 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3382 _dl=no
3383 for _ld_tmp in "" "-ldl" ; do
3384 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3385 done
3386 if test "$_dl" = yes ; then
3387 def_dl='#define HAVE_LIBDL 1'
3388 else
3389 def_dl='#undef HAVE_LIBDL'
3391 echores "$_dl"
3394 echocheck "dynamic a/v plugins support"
3395 if test "$_dl" = no ; then
3396 _dynamic_plugins=no
3398 if test "$_dynamic_plugins" = yes ; then
3399 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3400 else
3401 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3403 echores "$_dynamic_plugins"
3406 def_threads='#define HAVE_THREADS 0'
3408 echocheck "pthread"
3409 if linux ; then
3410 THREAD_CFLAGS=-D_REENTRANT
3411 elif freebsd || netbsd || openbsd || bsdos ; then
3412 THREAD_CFLAGS=-D_THREAD_SAFE
3414 if test "$_pthreads" = auto ; then
3415 cat > $TMPC << EOF
3416 #include <pthread.h>
3417 void* func(void *arg) { return arg; }
3418 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3420 _pthreads=no
3421 if ! hpux ; then
3422 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3423 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3424 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3425 done
3428 if test "$_pthreads" = yes ; then
3429 test $_ld_pthread && _res_comment="using $_ld_pthread"
3430 def_pthreads='#define HAVE_PTHREADS 1'
3431 def_threads='#define HAVE_THREADS 1'
3432 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3433 else
3434 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3435 def_pthreads='#undef HAVE_PTHREADS'
3436 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3437 mingw32 || _win32dll=no
3439 echores "$_pthreads"
3441 if cygwin ; then
3442 if test "$_pthreads" = yes ; then
3443 def_pthread_cache="#define PTHREAD_CACHE 1"
3444 else
3445 _stream_cache=no
3446 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3450 echocheck "w32threads"
3451 if test "$_pthreads" = yes ; then
3452 _res_comment="using pthread instead"
3453 _w32threads=no
3455 if test "$_w32threads" = auto ; then
3456 _w32threads=no
3457 mingw32 && _w32threads=yes
3459 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3460 echores "$_w32threads"
3462 echocheck "rpath"
3463 netbsd &&_rpath=yes
3464 if test "$_rpath" = yes ; then
3465 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3466 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3467 done
3468 extra_ldflags=$tmp
3470 echores "$_rpath"
3472 echocheck "iconv"
3473 if test "$_iconv" = auto ; then
3474 cat > $TMPC << EOF
3475 #include <stdio.h>
3476 #include <unistd.h>
3477 #include <iconv.h>
3478 #define INBUFSIZE 1024
3479 #define OUTBUFSIZE 4096
3481 char inbuffer[INBUFSIZE];
3482 char outbuffer[OUTBUFSIZE];
3484 int main(void) {
3485 size_t numread;
3486 iconv_t icdsc;
3487 char *tocode="UTF-8";
3488 char *fromcode="cp1250";
3489 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3490 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3491 char *iptr=inbuffer;
3492 char *optr=outbuffer;
3493 size_t inleft=numread;
3494 size_t outleft=OUTBUFSIZE;
3495 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3496 != (size_t)(-1)) {
3497 write(1, outbuffer, OUTBUFSIZE - outleft);
3500 if (iconv_close(icdsc) == -1)
3503 return 0;
3506 _iconv=no
3507 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3508 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3509 _iconv=yes && break
3510 done
3512 if test "$_iconv" = yes ; then
3513 def_iconv='#define CONFIG_ICONV 1'
3514 else
3515 def_iconv='#undef CONFIG_ICONV'
3517 echores "$_iconv"
3520 echocheck "soundcard.h"
3521 _soundcard_h=no
3522 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3523 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3524 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3525 cat > $TMPC << EOF
3526 #include <$_soundcard_header>
3527 int main(void) { return 0; }
3529 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3530 done
3532 if test "$_soundcard_h" = yes ; then
3533 if test $_soundcard_header = "sys/soundcard.h"; then
3534 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3535 else
3536 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3539 echores "$_soundcard_h"
3542 echocheck "sys/dvdio.h"
3543 cat > $TMPC << EOF
3544 #include <unistd.h>
3545 #include <sys/dvdio.h>
3546 int main(void) { return 0; }
3548 _dvdio=no
3549 cc_check && _dvdio=yes
3550 if test "$_dvdio" = yes ; then
3551 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3552 else
3553 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3555 echores "$_dvdio"
3558 echocheck "sys/cdio.h"
3559 cat > $TMPC << EOF
3560 #include <unistd.h>
3561 #include <sys/cdio.h>
3562 int main(void) { return 0; }
3564 _cdio=no
3565 cc_check && _cdio=yes
3566 if test "$_cdio" = yes ; then
3567 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3568 else
3569 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3571 echores "$_cdio"
3574 echocheck "linux/cdrom.h"
3575 cat > $TMPC << EOF
3576 #include <sys/types.h>
3577 #include <linux/cdrom.h>
3578 int main(void) { return 0; }
3580 _cdrom=no
3581 cc_check && _cdrom=yes
3582 if test "$_cdrom" = yes ; then
3583 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3584 else
3585 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3587 echores "$_cdrom"
3590 echocheck "dvd.h"
3591 cat > $TMPC << EOF
3592 #include <dvd.h>
3593 int main(void) { return 0; }
3595 _dvd=no
3596 cc_check && _dvd=yes
3597 if test "$_dvd" = yes ; then
3598 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3599 else
3600 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3602 echores "$_dvd"
3605 if bsdos; then
3606 echocheck "BSDI dvd.h"
3607 cat > $TMPC << EOF
3608 #include <dvd.h>
3609 int main(void) { return 0; }
3611 _bsdi_dvd=no
3612 cc_check && _bsdi_dvd=yes
3613 if test "$_bsdi_dvd" = yes ; then
3614 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3615 else
3616 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3618 echores "$_bsdi_dvd"
3619 fi #if bsdos
3622 if hpux; then
3623 # also used by AIX, but AIX does not support VCD and/or libdvdread
3624 echocheck "HP-UX SCSI header"
3625 cat > $TMPC << EOF
3626 #include <sys/scsi.h>
3627 int main(void) { return 0; }
3629 _hpux_scsi_h=no
3630 cc_check && _hpux_scsi_h=yes
3631 if test "$_hpux_scsi_h" = yes ; then
3632 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3633 else
3634 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3636 echores "$_hpux_scsi_h"
3637 fi #if hpux
3640 if sunos; then
3641 echocheck "userspace SCSI headers (Solaris)"
3642 cat > $TMPC << EOF
3643 #include <unistd.h>
3644 #include <stropts.h>
3645 #include <sys/scsi/scsi_types.h>
3646 #include <sys/scsi/impl/uscsi.h>
3647 int main(void) { return 0; }
3649 _sol_scsi_h=no
3650 cc_check && _sol_scsi_h=yes
3651 if test "$_sol_scsi_h" = yes ; then
3652 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3653 else
3654 def_sol_scsi_h='#undef SOLARIS_USCSI'
3656 echores "$_sol_scsi_h"
3657 fi #if sunos
3660 echocheck "termcap"
3661 if test "$_termcap" = auto ; then
3662 cat > $TMPC <<EOF
3663 #include <stddef.h>
3664 #include <term.h>
3665 int main(void) { tgetent(NULL, NULL); return 0; }
3667 _termcap=no
3668 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3669 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3670 && _termcap=yes && break
3671 done
3673 if test "$_termcap" = yes ; then
3674 def_termcap='#define HAVE_TERMCAP 1'
3675 test $_ld_tmp && _res_comment="using $_ld_tmp"
3676 else
3677 def_termcap='#undef HAVE_TERMCAP'
3679 echores "$_termcap"
3682 echocheck "termios"
3683 def_termios='#undef HAVE_TERMIOS'
3684 def_termios_h='#undef HAVE_TERMIOS_H'
3685 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3686 if test "$_termios" = auto ; then
3687 _termios=no
3688 for _termios_header in "sys/termios.h" "termios.h"; do
3689 cat > $TMPC <<EOF
3690 #include <$_termios_header>
3691 int main(void) { return 0; }
3693 cc_check && _termios=yes && _res_comment="using $_termios_header" && break
3694 done
3697 if test "$_termios" = yes ; then
3698 def_termios='#define HAVE_TERMIOS 1'
3699 if test "$_termios_header" = "termios.h" ; then
3700 def_termios_h='#define HAVE_TERMIOS_H 1'
3701 else
3702 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3705 echores "$_termios"
3708 echocheck "shm"
3709 if test "$_shm" = auto ; then
3710 cat > $TMPC << EOF
3711 #include <sys/types.h>
3712 #include <sys/shm.h>
3713 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3715 _shm=no
3716 cc_check && _shm=yes
3718 if test "$_shm" = yes ; then
3719 def_shm='#define HAVE_SHM 1'
3720 else
3721 def_shm='#undef HAVE_SHM'
3723 echores "$_shm"
3726 echocheck "strsep()"
3727 cat > $TMPC << EOF
3728 #include <string.h>
3729 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3731 _strsep=no
3732 cc_check && _strsep=yes
3733 if test "$_strsep" = yes ; then
3734 def_strsep='#define HAVE_STRSEP 1'
3735 _need_strsep=no
3736 else
3737 def_strsep='#undef HAVE_STRSEP'
3738 _need_strsep=yes
3740 echores "$_strsep"
3743 echocheck "vsscanf()"
3744 cat > $TMPC << EOF
3745 #define _ISOC99_SOURCE
3746 #include <stdarg.h>
3747 #include <stdio.h>
3748 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3750 _vsscanf=no
3751 cc_check && _vsscanf=yes
3752 if test "$_vsscanf" = yes ; then
3753 def_vsscanf='#define HAVE_VSSCANF 1'
3754 _need_vsscanf=no
3755 else
3756 def_vsscanf='#undef HAVE_VSSCANF'
3757 _need_vsscanf=yes
3759 echores "$_vsscanf"
3762 echocheck "swab()"
3763 cat > $TMPC << EOF
3764 #define _XOPEN_SOURCE 600
3765 #include <unistd.h>
3766 int main(void) { swab(0, 0, 0); return 0; }
3768 _swab=no
3769 cc_check && _swab=yes
3770 if test "$_swab" = yes ; then
3771 def_swab='#define HAVE_SWAB 1'
3772 _need_swab=no
3773 else
3774 def_swab='#undef HAVE_SWAB'
3775 _need_swab=yes
3777 echores "$_swab"
3779 echocheck "POSIX select()"
3780 cat > $TMPC << EOF
3781 #include <stdio.h>
3782 #include <stdlib.h>
3783 #include <sys/types.h>
3784 #include <string.h>
3785 #include <sys/time.h>
3786 #include <unistd.h>
3787 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3789 _posix_select=no
3790 def_posix_select='#undef HAVE_POSIX_SELECT'
3791 #select() of kLIBC (OS/2) supports socket only
3792 ! os2 && cc_check && _posix_select=yes \
3793 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3794 echores "$_posix_select"
3797 echocheck "audio select()"
3798 if test "$_select" = no ; then
3799 def_select='#undef HAVE_AUDIO_SELECT'
3800 elif test "$_select" = yes ; then
3801 def_select='#define HAVE_AUDIO_SELECT 1'
3803 echores "$_select"
3806 echocheck "gettimeofday()"
3807 cat > $TMPC << EOF
3808 #include <stdio.h>
3809 #include <sys/time.h>
3810 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3812 _gettimeofday=no
3813 cc_check && _gettimeofday=yes
3814 if test "$_gettimeofday" = yes ; then
3815 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3816 _need_gettimeofday=no
3817 else
3818 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3819 _need_gettimeofday=yes
3821 echores "$_gettimeofday"
3824 echocheck "glob()"
3825 cat > $TMPC << EOF
3826 #include <stdio.h>
3827 #include <glob.h>
3828 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3830 _glob=no
3831 cc_check && _glob=yes
3832 if test "$_glob" = yes ; then
3833 def_glob='#define HAVE_GLOB 1'
3834 _need_glob=no
3835 else
3836 def_glob='#undef HAVE_GLOB'
3837 _need_glob=yes
3839 echores "$_glob"
3842 echocheck "setenv()"
3843 cat > $TMPC << EOF
3844 #include <stdlib.h>
3845 int main(void) { setenv("","",0); return 0; }
3847 _setenv=no
3848 cc_check && _setenv=yes
3849 if test "$_setenv" = yes ; then
3850 def_setenv='#define HAVE_SETENV 1'
3851 _need_setenv=no
3852 else
3853 def_setenv='#undef HAVE_SETENV'
3854 _need_setenv=yes
3856 echores "$_setenv"
3859 if sunos; then
3860 echocheck "sysi86()"
3861 cat > $TMPC << EOF
3862 #include <sys/sysi86.h>
3863 int main(void) { sysi86(0); return 0; }
3865 _sysi86=no
3866 cc_check && _sysi86=yes
3867 if test "$_sysi86" = yes ; then
3868 def_sysi86='#define HAVE_SYSI86 1'
3869 cat > $TMPC << EOF
3870 #include <sys/sysi86.h>
3871 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3873 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3874 else
3875 def_sysi86='#undef HAVE_SYSI86'
3877 echores "$_sysi86"
3878 fi #if sunos
3881 echocheck "sys/sysinfo.h"
3882 cat > $TMPC << EOF
3883 #include <sys/sysinfo.h>
3884 int main(void) {
3885 struct sysinfo s_info;
3886 sysinfo(&s_info);
3887 return 0;
3890 _sys_sysinfo=no
3891 cc_check && _sys_sysinfo=yes
3892 if test "$_sys_sysinfo" = yes ; then
3893 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3894 else
3895 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3897 echores "$_sys_sysinfo"
3900 if darwin; then
3902 echocheck "Mac OS X Finder Support"
3903 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3904 if test "$_macosx_finder" = yes ; then
3905 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3906 extra_ldflags="$extra_ldflags -framework Carbon"
3908 echores "$_macosx_finder"
3910 echocheck "Mac OS X Bundle file locations"
3911 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3912 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3913 if test "$_macosx_bundle" = yes ; then
3914 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3915 extra_ldflags="$extra_ldflags -framework Carbon"
3917 echores "$_macosx_bundle"
3919 echocheck "Apple Remote"
3920 if test "$_apple_remote" = auto ; then
3921 _apple_remote=no
3922 cat > $TMPC <<EOF
3923 #include <stdio.h>
3924 #include <IOKit/IOCFPlugIn.h>
3925 int main(void) {
3926 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3927 CFMutableDictionaryRef hidMatchDictionary;
3928 IOReturn ioReturnValue;
3930 // Set up a matching dictionary to search the I/O Registry by class.
3931 // name for all HID class devices
3932 hidMatchDictionary = IOServiceMatching("AppleIRController");
3934 // Now search I/O Registry for matching devices.
3935 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3936 hidMatchDictionary, &hidObjectIterator);
3938 // If search is unsuccessful, return nonzero.
3939 if (ioReturnValue != kIOReturnSuccess ||
3940 !IOIteratorIsValid(hidObjectIterator)) {
3941 return 1;
3943 return 0;
3946 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3948 if test "$_apple_remote" = yes ; then
3949 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3950 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3951 else
3952 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3954 echores "$_apple_remote"
3956 fi #if darwin
3958 if linux; then
3960 echocheck "Apple IR"
3961 if test "$_apple_ir" = auto ; then
3962 _apple_ir=no
3963 cat > $TMPC <<EOF
3964 #include <linux/types.h>
3965 #include <linux/input.h>
3966 int main(void) {
3967 struct input_event ev;
3968 struct input_id id;
3969 return 0;
3972 cc_check && _apple_ir=yes
3974 if test "$_apple_ir" = yes ; then
3975 def_apple_ir='#define CONFIG_APPLE_IR 1'
3976 else
3977 def_apple_ir='#undef CONFIG_APPLE_IR'
3979 echores "$_apple_ir"
3980 fi #if linux
3982 echocheck "pkg-config"
3983 _pkg_config=pkg-config
3984 if $($_pkg_config --version > /dev/null 2>&1); then
3985 if test "$_ld_static"; then
3986 _pkg_config="$_pkg_config --static"
3988 echores "yes"
3989 else
3990 _pkg_config=false
3991 echores "no"
3995 echocheck "Samba support (libsmbclient)"
3996 if test "$_smb" = yes; then
3997 extra_ldflags="$extra_ldflags -lsmbclient"
3999 if test "$_smb" = auto; then
4000 _smb=no
4001 cat > $TMPC << EOF
4002 #include <libsmbclient.h>
4003 int main(void) { smbc_opendir("smb://"); return 0; }
4005 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4006 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
4007 _smb=yes && break
4008 done
4011 if test "$_smb" = yes; then
4012 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4013 _inputmodules="smb $_inputmodules"
4014 else
4015 def_smb="#undef CONFIG_LIBSMBCLIENT"
4016 _noinputmodules="smb $_noinputmodules"
4018 echores "$_smb"
4021 #########
4022 # VIDEO #
4023 #########
4026 echocheck "tdfxfb"
4027 if test "$_tdfxfb" = yes ; then
4028 def_tdfxfb='#define CONFIG_TDFXFB 1'
4029 _vomodules="tdfxfb $_vomodules"
4030 else
4031 def_tdfxfb='#undef CONFIG_TDFXFB'
4032 _novomodules="tdfxfb $_novomodules"
4034 echores "$_tdfxfb"
4036 echocheck "s3fb"
4037 if test "$_s3fb" = yes ; then
4038 def_s3fb='#define CONFIG_S3FB 1'
4039 _vomodules="s3fb $_vomodules"
4040 else
4041 def_s3fb='#undef CONFIG_S3FB'
4042 _novomodules="s3fb $_novomodules"
4044 echores "$_s3fb"
4046 echocheck "wii"
4047 if test "$_wii" = yes ; then
4048 def_wii='#define CONFIG_WII 1'
4049 _vomodules="wii $_vomodules"
4050 else
4051 def_wii='#undef CONFIG_WII'
4052 _novomodules="wii $_novomodules"
4054 echores "$_wii"
4056 echocheck "tdfxvid"
4057 if test "$_tdfxvid" = yes ; then
4058 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4059 _vomodules="tdfx_vid $_vomodules"
4060 else
4061 def_tdfxvid='#undef CONFIG_TDFX_VID'
4062 _novomodules="tdfx_vid $_novomodules"
4064 echores "$_tdfxvid"
4066 echocheck "xvr100"
4067 if test "$_xvr100" = auto ; then
4068 cat > $TMPC << EOF
4069 #include <unistd.h>
4070 #include <sys/fbio.h>
4071 #include <sys/visual_io.h>
4072 int main(void) {
4073 struct vis_identifier ident;
4074 struct fbgattr attr;
4075 ioctl(0, VIS_GETIDENTIFIER, &ident);
4076 ioctl(0, FBIOGATTR, &attr);
4077 return 0;
4080 _xvr100=no
4081 cc_check && _xvr100=yes
4083 if test "$_xvr100" = yes ; then
4084 def_xvr100='#define CONFIG_XVR100 1'
4085 _vomodules="xvr100 $_vomodules"
4086 else
4087 def_tdfxvid='#undef CONFIG_XVR100'
4088 _novomodules="xvr100 $_novomodules"
4090 echores "$_xvr100"
4092 echocheck "tga"
4093 if test "$_tga" = yes ; then
4094 def_tga='#define CONFIG_TGA 1'
4095 _vomodules="tga $_vomodules"
4096 else
4097 def_tga='#undef CONFIG_TGA'
4098 _novomodules="tga $_novomodules"
4100 echores "$_tga"
4103 echocheck "md5sum support"
4104 if test "$_md5sum" = yes; then
4105 def_md5sum="#define CONFIG_MD5SUM 1"
4106 _vomodules="md5sum $_vomodules"
4107 else
4108 def_md5sum="#undef CONFIG_MD5SUM"
4109 _novomodules="md5sum $_novomodules"
4111 echores "$_md5sum"
4114 echocheck "yuv4mpeg support"
4115 if test "$_yuv4mpeg" = yes; then
4116 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4117 _vomodules="yuv4mpeg $_vomodules"
4118 else
4119 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4120 _novomodules="yuv4mpeg $_novomodules"
4122 echores "$_yuv4mpeg"
4125 echocheck "bl"
4126 if test "$_bl" = yes ; then
4127 def_bl='#define CONFIG_BL 1'
4128 _vomodules="bl $_vomodules"
4129 else
4130 def_bl='#undef CONFIG_BL'
4131 _novomodules="bl $_novomodules"
4133 echores "$_bl"
4136 echocheck "DirectFB"
4137 if test "$_directfb" = auto ; then
4138 _directfb=no
4139 cat > $TMPC <<EOF
4140 #include <directfb.h>
4141 int main(void) { DirectFBInit(0, 0); return 0; }
4143 for _inc_tmp in "" -I/usr/local/include/directfb \
4144 -I/usr/include/directfb -I/usr/local/include; do
4145 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4146 extra_cflags="$extra_cflags $_inc_tmp" && break
4147 done
4150 dfb_version() {
4151 expr $1 \* 65536 + $2 \* 256 + $3
4154 if test "$_directfb" = yes; then
4155 cat > $TMPC << EOF
4156 #include <directfb_version.h>
4158 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4161 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4162 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4163 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4164 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4165 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4166 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4167 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4168 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4169 _res_comment="$_directfb_version"
4170 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4171 else
4172 def_directfb_version='#undef DIRECTFBVERSION'
4173 _directfb=no
4174 _res_comment="version >=0.9.13 required"
4176 else
4177 _directfb=no
4178 _res_comment="failed to get version"
4181 echores "$_directfb"
4183 if test "$_directfb" = yes ; then
4184 def_directfb='#define CONFIG_DIRECTFB 1'
4185 _vomodules="directfb $_vomodules"
4186 libs_mplayer="$libs_mplayer -ldirectfb"
4187 else
4188 def_directfb='#undef CONFIG_DIRECTFB'
4189 _novomodules="directfb $_novomodules"
4191 if test "$_dfbmga" = yes; then
4192 _vomodules="dfbmga $_vomodules"
4193 def_dfbmga='#define CONFIG_DFBMGA 1'
4194 else
4195 _novomodules="dfbmga $_novomodules"
4196 def_dfbmga='#undef CONFIG_DFBMGA'
4200 echocheck "X11 headers presence"
4201 _x11_headers="no"
4202 _res_comment="check if the dev(el) packages are installed"
4203 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4204 if test -f "$I/X11/Xlib.h" ; then
4205 _x11_headers="yes"
4206 _res_comment=""
4207 break
4209 done
4210 if test $_cross_compile = no; then
4211 for I in /usr/X11/include /usr/X11R7/include /usr/X11R6/include \
4212 /usr/include/X11R6 /usr/openwin/include ; do
4213 if test -f "$I/X11/Xlib.h" ; then
4214 extra_cflags="$extra_cflags -I$I"
4215 _x11_headers="yes"
4216 _res_comment="using $I"
4217 break
4219 done
4221 echores "$_x11_headers"
4224 echocheck "X11"
4225 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4226 cat > $TMPC <<EOF
4227 #include <X11/Xlib.h>
4228 #include <X11/Xutil.h>
4229 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4231 for I in "" -L/usr/X11R7/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4232 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/X11R6/lib64 \
4233 -L/usr/lib ; do
4234 if netbsd; then
4235 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4236 else
4237 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4239 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4240 && _x11=yes && break
4241 done
4243 if test "$_x11" = yes ; then
4244 def_x11='#define CONFIG_X11 1'
4245 _vomodules="x11 xover $_vomodules"
4246 else
4247 _x11=no
4248 def_x11='#undef CONFIG_X11'
4249 _novomodules="x11 $_novomodules"
4250 _res_comment="check if the dev(el) packages are installed"
4251 # disable stuff that depends on X
4252 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4254 echores "$_x11"
4256 echocheck "Xss screensaver extensions"
4257 if test "$_xss" = auto ; then
4258 cat > $TMPC << EOF
4259 #include <X11/Xlib.h>
4260 #include <X11/extensions/scrnsaver.h>
4261 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4263 _xss=no
4264 cc_check -lXss && _xss=yes
4266 if test "$_xss" = yes ; then
4267 def_xss='#define CONFIG_XSS 1'
4268 libs_mplayer="$libs_mplayer -lXss"
4269 else
4270 def_xss='#undef CONFIG_XSS'
4272 echores "$_xss"
4274 echocheck "DPMS"
4275 _xdpms3=no
4276 _xdpms4=no
4277 if test "$_x11" = yes ; then
4278 cat > $TMPC <<EOF
4279 #include <X11/Xmd.h>
4280 #include <X11/Xlib.h>
4281 #include <X11/Xutil.h>
4282 #include <X11/Xatom.h>
4283 #include <X11/extensions/dpms.h>
4284 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4286 cc_check -lXdpms && _xdpms3=yes
4287 cat > $TMPC <<EOF
4288 #include <X11/Xlib.h>
4289 #include <X11/extensions/dpms.h>
4290 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4292 cc_check -lXext && _xdpms4=yes
4294 if test "$_xdpms4" = yes ; then
4295 def_xdpms='#define CONFIG_XDPMS 1'
4296 _res_comment="using Xdpms 4"
4297 echores "yes"
4298 elif test "$_xdpms3" = yes ; then
4299 def_xdpms='#define CONFIG_XDPMS 1'
4300 libs_mplayer="$libs_mplayer -lXdpms"
4301 _res_comment="using Xdpms 3"
4302 echores "yes"
4303 else
4304 def_xdpms='#undef CONFIG_XDPMS'
4305 echores "no"
4309 echocheck "Xv"
4310 if test "$_xv" = auto ; then
4311 cat > $TMPC <<EOF
4312 #include <X11/Xlib.h>
4313 #include <X11/extensions/Xvlib.h>
4314 int main(void) {
4315 (void) XvGetPortAttribute(0, 0, 0, 0);
4316 (void) XvQueryPortAttributes(0, 0, 0);
4317 return 0; }
4319 _xv=no
4320 cc_check -lXv && _xv=yes
4323 if test "$_xv" = yes ; then
4324 def_xv='#define CONFIG_XV 1'
4325 libs_mplayer="$libs_mplayer -lXv"
4326 _vomodules="xv $_vomodules"
4327 else
4328 def_xv='#undef CONFIG_XV'
4329 _novomodules="xv $_novomodules"
4331 echores "$_xv"
4334 echocheck "XvMC"
4335 if test "$_xv" = yes && test "$_xvmc" != no ; then
4336 _xvmc=no
4337 cat > $TMPC <<EOF
4338 #include <X11/Xlib.h>
4339 #include <X11/extensions/Xvlib.h>
4340 #include <X11/extensions/XvMClib.h>
4341 int main(void) {
4342 (void) XvMCQueryExtension(0,0,0);
4343 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4344 return 0; }
4346 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4347 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4348 done
4350 if test "$_xvmc" = yes ; then
4351 def_xvmc='#define CONFIG_XVMC 1'
4352 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4353 _vomodules="xvmc $_vomodules"
4354 _res_comment="using $_xvmclib"
4355 else
4356 def_xvmc='#define CONFIG_XVMC 0'
4357 _novomodules="xvmc $_novomodules"
4358 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
4360 echores "$_xvmc"
4363 echocheck "VDPAU"
4364 if test "$_vdpau" = auto ; then
4365 _vdpau=no
4366 if test "$_dl" = yes ; then
4367 cat > $TMPC <<EOF
4368 #include <vdpau/vdpau_x11.h>
4369 int main(void) {
4370 (void) vdp_device_create_x11(0, 0, 0, 0);
4371 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4373 cc_check -lvdpau && _vdpau=yes
4376 if test "$_vdpau" = yes ; then
4377 def_vdpau='#define CONFIG_VDPAU 1'
4378 libs_mplayer="$libs_mplayer -lvdpau"
4379 _vomodules="vdpau $_vomodules"
4380 else
4381 def_vdpau='#define CONFIG_VDPAU 0'
4382 _novomodules="vdpau $_novomodules"
4383 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER// -e s/H264_VDPAU_DECODER// -e s/WMV3_VDPAU_DECODER// -e s/VC1_VDPAU_DECODER// -e s/MPEG4_VDPAU_DECODER//)
4385 echores "$_vdpau"
4388 echocheck "Xinerama"
4389 if test "$_xinerama" = auto ; then
4390 cat > $TMPC <<EOF
4391 #include <X11/Xlib.h>
4392 #include <X11/extensions/Xinerama.h>
4393 int main(void) { (void) XineramaIsActive(0); return 0; }
4395 _xinerama=no
4396 cc_check -lXinerama && _xinerama=yes
4399 if test "$_xinerama" = yes ; then
4400 def_xinerama='#define CONFIG_XINERAMA 1'
4401 libs_mplayer="$libs_mplayer -lXinerama"
4402 else
4403 def_xinerama='#undef CONFIG_XINERAMA'
4405 echores "$_xinerama"
4408 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4409 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4410 # named 'X extensions' or something similar.
4411 # This check may be useful for future mplayer versions (to change resolution)
4412 # If you run into problems, remove '-lXxf86vm'.
4413 echocheck "Xxf86vm"
4414 if test "$_vm" = auto ; then
4415 cat > $TMPC <<EOF
4416 #include <X11/Xlib.h>
4417 #include <X11/extensions/xf86vmode.h>
4418 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4420 _vm=no
4421 cc_check -lXxf86vm && _vm=yes
4423 if test "$_vm" = yes ; then
4424 def_vm='#define CONFIG_XF86VM 1'
4425 libs_mplayer="$libs_mplayer -lXxf86vm"
4426 else
4427 def_vm='#undef CONFIG_XF86VM'
4429 echores "$_vm"
4431 # Check for the presence of special keycodes, like audio control buttons
4432 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4433 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4434 # have these new keycodes.
4435 echocheck "XF86keysym"
4436 if test "$_xf86keysym" = auto; then
4437 _xf86keysym=no
4438 cat > $TMPC <<EOF
4439 #include <X11/Xlib.h>
4440 #include <X11/XF86keysym.h>
4441 int main(void) { return XF86XK_AudioPause; }
4443 cc_check && _xf86keysym=yes
4445 if test "$_xf86keysym" = yes ; then
4446 def_xf86keysym='#define CONFIG_XF86XK 1'
4447 else
4448 def_xf86keysym='#undef CONFIG_XF86XK'
4450 echores "$_xf86keysym"
4452 echocheck "DGA"
4453 if test "$_dga2" = auto && test "$_x11" = yes ; then
4454 cat > $TMPC << EOF
4455 #include <X11/Xlib.h>
4456 #include <X11/extensions/xf86dga.h>
4457 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4459 _dga2=no
4460 cc_check -lXxf86dga && _dga2=yes
4462 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4463 cat > $TMPC << EOF
4464 #include <X11/Xlib.h>
4465 #include <X11/extensions/xf86dga.h>
4466 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4468 _dga1=no
4469 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4472 _dga=no
4473 def_dga='#undef CONFIG_DGA'
4474 def_dga1='#undef CONFIG_DGA1'
4475 def_dga2='#undef CONFIG_DGA2'
4476 if test "$_dga1" = yes ; then
4477 _dga=yes
4478 def_dga1='#define CONFIG_DGA1 1'
4479 _res_comment="using DGA 1.0"
4480 elif test "$_dga2" = yes ; then
4481 _dga=yes
4482 def_dga2='#define CONFIG_DGA2 1'
4483 _res_comment="using DGA 2.0"
4485 if test "$_dga" = yes ; then
4486 def_dga='#define CONFIG_DGA 1'
4487 libs_mplayer="$libs_mplayer -lXxf86dga"
4488 _vomodules="dga $_vomodules"
4489 else
4490 _novomodules="dga $_novomodules"
4492 echores "$_dga"
4495 echocheck "3dfx"
4496 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4497 def_3dfx='#define CONFIG_3DFX 1'
4498 _vomodules="3dfx $_vomodules"
4499 else
4500 def_3dfx='#undef CONFIG_3DFX'
4501 _novomodules="3dfx $_novomodules"
4503 echores "$_3dfx"
4506 echocheck "VIDIX"
4507 def_vidix='#undef CONFIG_VIDIX'
4508 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4509 _vidix_drv_cyberblade=no
4510 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4511 _vidix_drv_ivtv=no
4512 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4513 _vidix_drv_mach64=no
4514 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4515 _vidix_drv_mga=no
4516 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4517 _vidix_drv_mga_crtc2=no
4518 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4519 _vidix_drv_nvidia=no
4520 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4521 _vidix_drv_pm2=no
4522 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4523 _vidix_drv_pm3=no
4524 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4525 _vidix_drv_radeon=no
4526 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4527 _vidix_drv_rage128=no
4528 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4529 _vidix_drv_s3=no
4530 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4531 _vidix_drv_sh_veu=no
4532 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4533 _vidix_drv_sis=no
4534 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4535 _vidix_drv_unichrome=no
4536 if test "$_vidix" = auto ; then
4537 _vidix=no
4538 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4539 && _vidix=yes
4540 x86_64 && win32 && _vidix=no
4541 (ppc || alpha) && linux && _vidix=yes
4543 echores "$_vidix"
4545 if test "$_vidix" = yes ; then
4546 def_vidix='#define CONFIG_VIDIX 1'
4547 _vomodules="cvidix $_vomodules"
4548 # FIXME: ivtv driver temporarily disabled until we have a proper test
4549 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4550 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4552 # some vidix drivers are architecture and os specific, discard them elsewhere
4553 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4554 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4556 for driver in $_vidix_drivers ; do
4557 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4558 eval _vidix_drv_${driver}=yes
4559 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4560 done
4562 echocheck "VIDIX PCI device name database"
4563 echores "$_vidix_pcidb"
4564 if test "$_vidix_pcidb" = yes ; then
4565 _vidix_pcidb_val=1
4566 else
4567 _vidix_pcidb_val=0
4570 echocheck "VIDIX dhahelper support"
4571 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4572 echores "$_dhahelper"
4574 echocheck "VIDIX svgalib_helper support"
4575 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4576 echores "$_svgalib_helper"
4578 else
4579 _novomodules="cvidix $_novomodules"
4582 if test "$_vidix" = yes && win32; then
4583 winvidix=yes
4584 _vomodules="winvidix $_vomodules"
4585 libs_mplayer="$libs_mplayer -lgdi32"
4586 else
4587 _novomodules="winvidix $_novomodules"
4589 if test "$_vidix" = yes && test "$_x11" = yes; then
4590 xvidix=yes
4591 _vomodules="xvidix $_vomodules"
4592 else
4593 _novomodules="xvidix $_novomodules"
4596 echocheck "/dev/mga_vid"
4597 if test "$_mga" = auto ; then
4598 _mga=no
4599 test -c /dev/mga_vid && _mga=yes
4601 if test "$_mga" = yes ; then
4602 def_mga='#define CONFIG_MGA 1'
4603 _vomodules="mga $_vomodules"
4604 else
4605 def_mga='#undef CONFIG_MGA'
4606 _novomodules="mga $_novomodules"
4608 echores "$_mga"
4610 echocheck "xmga"
4611 if test "$_xmga" = auto ; then
4612 _xmga=no
4613 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4615 if test "$_xmga" = yes ; then
4616 def_xmga='#define CONFIG_XMGA 1'
4617 _vomodules="xmga $_vomodules"
4618 else
4619 def_xmga='#undef CONFIG_XMGA'
4620 _novomodules="xmga $_novomodules"
4622 echores "$_xmga"
4625 echocheck "GGI"
4626 if test "$_ggi" = auto ; then
4627 cat > $TMPC << EOF
4628 #include <ggi/ggi.h>
4629 int main(void) { ggiInit(); return 0; }
4631 _ggi=no
4632 cc_check -lggi && _ggi=yes
4634 if test "$_ggi" = yes ; then
4635 def_ggi='#define CONFIG_GGI 1'
4636 libs_mplayer="$libs_mplayer -lggi"
4637 _vomodules="ggi $_vomodules"
4638 else
4639 def_ggi='#undef CONFIG_GGI'
4640 _novomodules="ggi $_novomodules"
4642 echores "$_ggi"
4644 echocheck "GGI extension: libggiwmh"
4645 if test "$_ggiwmh" = auto ; then
4646 _ggiwmh=no
4647 cat > $TMPC << EOF
4648 #include <ggi/ggi.h>
4649 #include <ggi/wmh.h>
4650 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4652 cc_check -lggi -lggiwmh && _ggiwmh=yes
4654 # needed to get right output on obscure combination
4655 # like --disable-ggi --enable-ggiwmh
4656 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4657 def_ggiwmh='#define CONFIG_GGIWMH 1'
4658 libs_mplayer="$libs_mplayer -lggiwmh"
4659 else
4660 _ggiwmh=no
4661 def_ggiwmh='#undef CONFIG_GGIWMH'
4663 echores "$_ggiwmh"
4666 echocheck "AA"
4667 if test "$_aa" = auto ; then
4668 cat > $TMPC << EOF
4669 #include <aalib.h>
4670 extern struct aa_hardware_params aa_defparams;
4671 extern struct aa_renderparams aa_defrenderparams;
4672 int main(void) {
4673 aa_context *c;
4674 aa_renderparams *p;
4675 (void) aa_init(0, 0, 0);
4676 c = aa_autoinit(&aa_defparams);
4677 p = aa_getrenderparams();
4678 aa_autoinitkbd(c,0);
4679 return 0; }
4681 _aa=no
4682 for _ld_tmp in "-laa" ; do
4683 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4684 done
4686 if test "$_aa" = yes ; then
4687 def_aa='#define CONFIG_AA 1'
4688 if cygwin ; then
4689 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4691 _vomodules="aa $_vomodules"
4692 else
4693 def_aa='#undef CONFIG_AA'
4694 _novomodules="aa $_novomodules"
4696 echores "$_aa"
4699 echocheck "CACA"
4700 if test "$_caca" = auto ; then
4701 _caca=no
4702 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4703 cat > $TMPC << EOF
4704 #include <caca.h>
4705 #ifdef CACA_API_VERSION_1
4706 #include <caca0.h>
4707 #endif
4708 int main(void) { (void) caca_init(); return 0; }
4710 cc_check $(caca-config --libs) && _caca=yes
4713 if test "$_caca" = yes ; then
4714 def_caca='#define CONFIG_CACA 1'
4715 extra_cflags="$extra_cflags $(caca-config --cflags)"
4716 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4717 _vomodules="caca $_vomodules"
4718 else
4719 def_caca='#undef CONFIG_CACA'
4720 _novomodules="caca $_novomodules"
4722 echores "$_caca"
4725 echocheck "SVGAlib"
4726 if test "$_svga" = auto ; then
4727 cat > $TMPC << EOF
4728 #include <vga.h>
4729 int main(void) { return 0; }
4731 _svga=no
4732 cc_check -lvga $_ld_lm && _svga=yes
4734 if test "$_svga" = yes ; then
4735 def_svga='#define CONFIG_SVGALIB 1'
4736 libs_mplayer="$libs_mplayer -lvga"
4737 _vomodules="svga $_vomodules"
4738 else
4739 def_svga='#undef CONFIG_SVGALIB'
4740 _novomodules="svga $_novomodules"
4742 echores "$_svga"
4745 echocheck "FBDev"
4746 if test "$_fbdev" = auto ; then
4747 _fbdev=no
4748 linux && _fbdev=yes
4750 if test "$_fbdev" = yes ; then
4751 def_fbdev='#define CONFIG_FBDEV 1'
4752 _vomodules="fbdev $_vomodules"
4753 else
4754 def_fbdev='#undef CONFIG_FBDEV'
4755 _novomodules="fbdev $_novomodules"
4757 echores "$_fbdev"
4761 echocheck "DVB"
4762 if test "$_dvb" = auto ; then
4763 _dvb=no
4764 cat >$TMPC << EOF
4765 #include <poll.h>
4766 #include <sys/ioctl.h>
4767 #include <stdio.h>
4768 #include <time.h>
4769 #include <unistd.h>
4770 #include <ost/dmx.h>
4771 #include <ost/frontend.h>
4772 #include <ost/sec.h>
4773 #include <ost/video.h>
4774 #include <ost/audio.h>
4775 int main(void) {return 0;}
4777 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4778 cc_check $_inc_tmp && _dvb=yes && \
4779 extra_cflags="$extra_cflags $_inc_tmp" && break
4780 done
4782 echores "$_dvb"
4783 if test "$_dvb" = yes ; then
4784 def_dvb='#define CONFIG_DVB 1'
4785 def_dvbin='#define CONFIG_DVBIN 1'
4786 _aomodules="mpegpes(dvb) $_aomodules"
4787 _vomodules="mpegpes(dvb) $_vomodules"
4790 echocheck "DVB HEAD"
4791 if test "$_dvbhead" = auto ; then
4792 _dvbhead=no
4794 cat >$TMPC << EOF
4795 #include <poll.h>
4796 #include <sys/ioctl.h>
4797 #include <stdio.h>
4798 #include <time.h>
4799 #include <unistd.h>
4800 #include <linux/dvb/dmx.h>
4801 #include <linux/dvb/frontend.h>
4802 #include <linux/dvb/video.h>
4803 #include <linux/dvb/audio.h>
4804 int main(void) {return 0;}
4806 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4807 cc_check $_inc_tmp && _dvbhead=yes && \
4808 extra_cflags="$extra_cflags $_inc_tmp" && break
4809 done
4811 echores "$_dvbhead"
4812 if test "$_dvbhead" = yes ; then
4813 def_dvb='#define CONFIG_DVB 1'
4814 def_dvb_head='#define CONFIG_DVB_HEAD 1'
4815 def_dvbin='#define CONFIG_DVBIN 1'
4816 _aomodules="mpegpes(dvb) $_aomodules"
4817 _vomodules="mpegpes(dvb) $_vomodules"
4820 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4821 def_dvb='#undef CONFIG_DVB'
4822 def_dvb_head='#undef CONFIG_DVB_HEAD'
4823 def_dvbin='#undef CONFIG_DVBIN '
4824 _aomodules="mpegpes(file) $_aomodules"
4825 _vomodules="mpegpes(file) $_vomodules"
4828 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4829 _dvbin=yes
4830 _inputmodules="dvb $_inputmodules"
4831 else
4832 _dvbin=no
4833 _noinputmodules="dvb $_noinputmodules"
4837 if darwin; then
4839 echocheck "QuickTime"
4840 if test "$quicktime" = auto ; then
4841 cat > $TMPC <<EOF
4842 #include <QuickTime/QuickTime.h>
4843 int main(void) {
4844 ImageDescription *desc;
4845 EnterMovies();
4846 ExitMovies();
4847 return 0;
4850 quicktime=no
4851 cc_check -framework QuickTime && quicktime=yes
4853 if test "$quicktime" = yes ; then
4854 extra_ldflags="$extra_ldflags -framework QuickTime"
4855 def_quicktime='#define CONFIG_QUICKTIME 1'
4856 else
4857 def_quicktime='#undef CONFIG_QUICKTIME'
4858 _quartz=no
4860 echores $quicktime
4862 echocheck "Quartz"
4863 if test "$_quartz" = auto ; then
4864 cat > $TMPC <<EOF
4865 #include <Carbon/Carbon.h>
4866 int main(void) {
4867 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
4868 return 0;
4871 _quartz=no
4872 cc_check -framework Carbon && _quartz=yes
4874 if test "$_quartz" = yes ; then
4875 libs_mplayer="$libs_mplayer -framework Carbon"
4876 def_quartz='#define CONFIG_QUARTZ 1'
4877 _vomodules="quartz $_vomodules"
4878 else
4879 def_quartz='#undef CONFIG_QUARTZ'
4880 _novomodules="quartz $_novomodules"
4882 echores $_quartz
4884 echocheck "CoreVideo"
4885 if test "$_corevideo" = auto ; then
4886 cat > $TMPC <<EOF
4887 #include <Carbon/Carbon.h>
4888 #include <CoreServices/CoreServices.h>
4889 #include <OpenGL/OpenGL.h>
4890 #include <QuartzCore/CoreVideo.h>
4891 int main(void) { return 0; }
4893 _corevideo=no
4894 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4896 if test "$_corevideo" = yes ; then
4897 _vomodules="corevideo $_vomodules"
4898 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4899 def_corevideo='#define CONFIG_COREVIDEO 1'
4900 else
4901 _novomodules="corevideo $_novomodules"
4902 def_corevideo='#undef CONFIG_COREVIDEO'
4904 echores "$_corevideo"
4906 fi #if darwin
4909 # make sure this stays below CoreVideo to avoid issues due to namespace
4910 # conflicts between -lGL and -framework OpenGL
4911 echocheck "OpenGL"
4912 #Note: this test is run even with --enable-gl since we autodetect linker flags
4913 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4914 cat > $TMPC << EOF
4915 #ifdef GL_WIN32
4916 #include <windows.h>
4917 #include <GL/gl.h>
4918 #else
4919 #include <GL/gl.h>
4920 #include <X11/Xlib.h>
4921 #include <GL/glx.h>
4922 #endif
4923 int main(void) {
4924 #ifdef GL_WIN32
4925 HDC dc;
4926 wglCreateContext(dc);
4927 #else
4928 glXCreateContext(NULL, NULL, NULL, True);
4929 #endif
4930 glFinish();
4931 return 0;
4934 _gl=no
4935 if cc_check -lGL $_ld_lm ; then
4936 _gl=yes
4937 _gl_x11=yes
4938 libs_mplayer="$libs_mplayer -lGL $_ld_dl"
4939 elif cc_check -lGL $_ld_lm $_ld_pthread ; then
4940 _gl=yes
4941 _gl_x11=yes
4942 libs_mplayer="$libs_mplayer -lGL $_ld_pthread $_ld_dl"
4944 if cc_check -DGL_WIN32 -lopengl32 ; then
4945 _gl=yes
4946 _gl_win32=yes
4947 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4949 else
4950 _gl=no
4952 if test "$_gl" = yes ; then
4953 def_gl='#define CONFIG_GL 1'
4954 _res_comment="backends:"
4955 if test "$_gl_win32" = yes ; then
4956 def_gl_win32='#define CONFIG_GL_WIN32 1'
4957 _res_comment="$_res_comment win32"
4959 if test "$_gl_x11" = yes ; then
4960 def_gl_x11='#define CONFIG_GL_X11 1'
4961 _res_comment="$_res_comment x11"
4963 _vomodules="opengl $_vomodules"
4964 else
4965 def_gl='#undef CONFIG_GL'
4966 def_gl_win32='#undef CONFIG_GL_WIN32'
4967 def_gl_x11='#undef CONFIG_GL_X11'
4968 _novomodules="opengl $_novomodules"
4970 echores "$_gl"
4973 echocheck "MatrixView"
4974 if test "$_gl" = no ; then
4975 matrixview=no
4977 if test "$matrixview" = yes ; then
4978 _vomodules="matrixview $_vomodules"
4979 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4980 else
4981 _novomodules="matrixview $_novomodules"
4982 def_matrixview='#undef CONFIG_MATRIXVIEW'
4984 echores "$matrixview"
4987 echocheck "PNG support"
4988 if test "$_png" = auto ; then
4989 _png=no
4990 if irix ; then
4991 # Don't check for -lpng on irix since it has its own libpng
4992 # incompatible with the GNU libpng
4993 _res_comment="disabled on irix (not GNU libpng)"
4994 else
4995 cat > $TMPC << EOF
4996 #include <png.h>
4997 #include <string.h>
4998 int main(void) {
4999 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
5000 printf("libpng: %s\n", png_libpng_ver);
5001 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
5004 cc_check -lpng -lz $_ld_lm && _png=yes
5007 echores "$_png"
5008 if test "$_png" = yes ; then
5009 def_png='#define CONFIG_PNG 1'
5010 extra_ldflags="$extra_ldflags -lpng -lz"
5011 else
5012 def_png='#undef CONFIG_PNG'
5015 echocheck "MNG support"
5016 if test "$_mng" = auto ; then
5017 _mng=no
5018 cat > $TMPC << EOF
5019 #include <libmng.h>
5020 int main(void) {
5021 const char * p_ver = mng_version_text();
5022 return !p_ver || p_ver[0] == 0;
5025 if cc_check -lmng -lz $_ld_lm ; then
5026 _mng=yes
5029 echores "$_mng"
5030 if test "$_mng" = yes ; then
5031 def_mng='#define CONFIG_MNG 1'
5032 extra_ldflags="$extra_ldflags -lmng -lz"
5033 else
5034 def_mng='#undef CONFIG_MNG'
5037 echocheck "JPEG support"
5038 if test "$_jpeg" = auto ; then
5039 _jpeg=no
5040 cat > $TMPC << EOF
5041 #include <stdio.h>
5042 #include <stdlib.h>
5043 #include <setjmp.h>
5044 #include <string.h>
5045 #include <jpeglib.h>
5046 int main(void) { return 0; }
5048 cc_check -ljpeg $_ld_lm && _jpeg=yes
5050 echores "$_jpeg"
5052 if test "$_jpeg" = yes ; then
5053 def_jpeg='#define CONFIG_JPEG 1'
5054 _vomodules="jpeg $_vomodules"
5055 extra_ldflags="$extra_ldflags -ljpeg"
5056 else
5057 def_jpeg='#undef CONFIG_JPEG'
5058 _novomodules="jpeg $_novomodules"
5062 echocheck "OpenJPEG (JPEG2000) support"
5063 if test "$libopenjpeg" = auto ; then
5064 libopenjpeg=no
5065 cat > $TMPC << EOF
5066 #define OPJ_STATIC
5067 #include <openjpeg.h>
5068 int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
5070 cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
5072 echores "$libopenjpeg"
5073 if test "$libopenjpeg" = yes ; then
5074 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
5075 extra_ldflags="$extra_ldflags -lopenjpeg"
5076 _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
5077 _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
5078 _codecmodules="OpenJPEG $_codecmodules"
5079 else
5080 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
5081 _nocodecmodules="OpenJPEG $_nocodecmodules"
5085 echocheck "PNM support"
5086 if test "$_pnm" = yes; then
5087 def_pnm="#define CONFIG_PNM 1"
5088 _vomodules="pnm $_vomodules"
5089 else
5090 def_pnm="#undef CONFIG_PNM"
5091 _novomodules="pnm $_novomodules"
5093 echores "$_pnm"
5097 echocheck "GIF support"
5098 # This is to appease people who want to force gif support.
5099 # If it is forced to yes, then we still do checks to determine
5100 # which gif library to use.
5101 if test "$_gif" = yes ; then
5102 _force_gif=yes
5103 _gif=auto
5106 if test "$_gif" = auto ; then
5107 _gif=no
5108 cat > $TMPC << EOF
5109 #include <gif_lib.h>
5110 int main(void) { return 0; }
5112 for _ld_gif in "-lungif" "-lgif" ; do
5113 cc_check $_ld_gif && _gif=yes && break
5114 done
5117 # If no library was found, and the user wants support forced,
5118 # then we force it on with libgif, as this is the safest
5119 # assumption IMHO. (libungif & libregif both create symbolic
5120 # links to libgif. We also assume that no x11 support is needed,
5121 # because if you are forcing this, then you _should_ know what
5122 # you are doing. [ Besides, package maintainers should never
5123 # have compiled x11 deps into libungif in the first place. ] )
5124 # </rant>
5125 # --Joey
5126 if test "$_force_gif" = yes && test "$_gif" = no ; then
5127 _gif=yes
5128 _ld_gif="-lgif"
5131 if test "$_gif" = yes ; then
5132 def_gif='#define CONFIG_GIF 1'
5133 _codecmodules="gif $_codecmodules"
5134 _vomodules="gif89a $_vomodules"
5135 _res_comment="old version, some encoding functions disabled"
5136 def_gif_4='#undef CONFIG_GIF_4'
5137 extra_ldflags="$extra_ldflags $_ld_gif"
5139 cat > $TMPC << EOF
5140 #include <signal.h>
5141 #include <gif_lib.h>
5142 void catch() { exit(1); }
5143 int main(void) {
5144 signal(SIGSEGV, catch); // catch segfault
5145 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5146 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5147 return 0;
5150 if cc_check "$_ld_gif" ; then
5151 def_gif_4='#define CONFIG_GIF_4 1'
5152 _res_comment=""
5154 else
5155 def_gif='#undef CONFIG_GIF'
5156 def_gif_4='#undef CONFIG_GIF_4'
5157 _novomodules="gif89a $_novomodules"
5158 _nocodecmodules="gif $_nocodecmodules"
5160 echores "$_gif"
5163 case "$_gif" in yes*)
5164 echocheck "broken giflib workaround"
5165 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5167 cat > $TMPC << EOF
5168 #include <gif_lib.h>
5169 int main(void) {
5170 GifFileType gif;
5171 printf("UserData is at address %p\n", gif.UserData);
5172 return 0;
5175 if cc_check "$_ld_gif" ; then
5176 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5177 echores "disabled"
5178 else
5179 echores "enabled"
5182 esac
5185 echocheck "VESA support"
5186 if test "$_vesa" = auto ; then
5187 cat > $TMPC << EOF
5188 #include <vbe.h>
5189 int main(void) { vbeVersion(); return 0; }
5191 _vesa=no
5192 cc_check -lvbe -llrmi && _vesa=yes
5194 if test "$_vesa" = yes ; then
5195 def_vesa='#define CONFIG_VESA 1'
5196 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5197 _vomodules="vesa $_vomodules"
5198 else
5199 def_vesa='#undef CONFIG_VESA'
5200 _novomodules="vesa $_novomodules"
5202 echores "$_vesa"
5204 #################
5205 # VIDEO + AUDIO #
5206 #################
5209 echocheck "SDL"
5210 _inc_tmp=""
5211 _ld_tmp=""
5212 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5213 if test -z "$_sdlconfig" ; then
5214 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5215 _sdlconfig="sdl-config"
5216 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5217 _sdlconfig="sdl11-config"
5218 else
5219 _sdlconfig=false
5222 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5223 cat > $TMPC << EOF
5224 #ifdef CONFIG_SDL_SDL_H
5225 #include <SDL/SDL.h>
5226 #else
5227 #include <SDL.h>
5228 #endif
5229 #ifndef __APPLE__
5230 // we allow SDL hacking our main() only on OSX
5231 #undef main
5232 #endif
5233 int main(int argc, char *argv[]) {
5234 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5235 return 0;
5238 _sdl=no
5239 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" ; do
5240 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5241 _sdl=yes
5242 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5243 break
5245 done
5246 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5247 if cygwin ; then
5248 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5249 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5250 elif mingw32 ; then
5251 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5252 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5253 else
5254 _inc_tmp="$($_sdlconfig --cflags)"
5255 _ld_tmp="$($_sdlconfig --libs)"
5257 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5258 _sdlversion=$($_sdlconfig --version | sed 's/[^0-9]//g')
5259 if test "$_sdlversion" -gt 116 ; then
5260 if test "$_sdlversion" -lt 121 ; then
5261 def_sdlbuggy='#define BUGGY_SDL'
5262 else
5263 def_sdlbuggy='#undef BUGGY_SDL'
5265 _sdl=yes
5270 if test "$_sdl" = yes ; then
5271 def_sdl='#define CONFIG_SDL 1'
5272 extra_cflags="$extra_cflags $_inc_tmp"
5273 libs_mplayer="$libs_mplayer $_ld_tmp"
5274 _vomodules="sdl $_vomodules"
5275 _aomodules="sdl $_aomodules"
5276 _res_comment="using $_sdlconfig"
5277 else
5278 def_sdl='#undef CONFIG_SDL'
5279 _novomodules="sdl $_novomodules"
5280 _noaomodules="sdl $_noaomodules"
5282 echores "$_sdl"
5285 if os2 ; then
5286 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5287 if test "$_kva" = auto; then
5288 cat > $TMPC << EOF
5289 #include <os2.h>
5290 #include <kva.h>
5291 int main( void ) { return 0; }
5293 _kva=no;
5294 cc_check -lkva && _kva=yes
5296 if test "$_kva" = yes ; then
5297 def_kva='#define CONFIG_KVA 1'
5298 libs_mplayer="$libs_mplayer -lkva"
5299 _vomodules="kva $_vomodules"
5300 else
5301 def_kva='#undef CONFIG_KVA'
5302 _novomodules="kva $_novomodules"
5304 echores "$_kva"
5305 fi #if os2
5308 if win32; then
5310 echocheck "Windows waveout"
5311 if test "$_win32waveout" = auto ; then
5312 cat > $TMPC << EOF
5313 #include <windows.h>
5314 #include <mmsystem.h>
5315 int main(void) { return 0; }
5317 _win32waveout=no
5318 cc_check -lwinmm && _win32waveout=yes
5320 if test "$_win32waveout" = yes ; then
5321 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5322 libs_mplayer="$libs_mplayer -lwinmm"
5323 _aomodules="win32 $_aomodules"
5324 else
5325 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5326 _noaomodules="win32 $_noaomodules"
5328 echores "$_win32waveout"
5330 echocheck "Direct3D"
5331 if test "$_direct3d" = auto ; then
5332 cat > $TMPC << EOF
5333 #include <windows.h>
5334 #include <d3d9.h>
5335 int main(void) { return 0; }
5337 _direct3d=no
5338 cc_check && _direct3d=yes
5340 if test "$_direct3d" = yes ; then
5341 def_direct3d='#define CONFIG_DIRECT3D 1'
5342 _vomodules="direct3d $_vomodules"
5343 else
5344 def_direct3d='#undef CONFIG_DIRECT3D'
5345 _novomodules="direct3d $_novomodules"
5347 echores "$_direct3d"
5349 echocheck "Directx"
5350 if test "$_directx" = auto ; then
5351 cat > $TMPC << EOF
5352 #include <windows.h>
5353 #include <ddraw.h>
5354 #include <dsound.h>
5355 int main(void) { return 0; }
5357 _directx=no
5358 cc_check -lgdi32 && _directx=yes
5360 if test "$_directx" = yes ; then
5361 def_directx='#define CONFIG_DIRECTX 1'
5362 libs_mplayer="$libs_mplayer -lgdi32"
5363 _vomodules="directx $_vomodules"
5364 _aomodules="dsound $_aomodules"
5365 else
5366 def_directx='#undef CONFIG_DIRECTX'
5367 _novomodules="directx $_novomodules"
5368 _noaomodules="dsound $_noaomodules"
5370 echores "$_directx"
5372 fi #if win32; then
5375 echocheck "DXR2"
5376 if test "$_dxr2" = auto; then
5377 _dxr2=no
5378 cat > $TMPC << EOF
5379 #include <dxr2ioctl.h>
5380 int main(void) { return 0; }
5382 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5383 cc_check $_inc_tmp && _dxr2=yes && \
5384 extra_cflags="$extra_cflags $_inc_tmp" && break
5385 done
5387 if test "$_dxr2" = yes; then
5388 def_dxr2='#define CONFIG_DXR2 1'
5389 _aomodules="dxr2 $_aomodules"
5390 _vomodules="dxr2 $_vomodules"
5391 else
5392 def_dxr2='#undef CONFIG_DXR2'
5393 _noaomodules="dxr2 $_noaomodules"
5394 _novomodules="dxr2 $_novomodules"
5396 echores "$_dxr2"
5398 echocheck "DXR3/H+"
5399 if test "$_dxr3" = auto ; then
5400 cat > $TMPC << EOF
5401 #include <linux/em8300.h>
5402 int main(void) { return 0; }
5404 _dxr3=no
5405 cc_check && _dxr3=yes
5407 if test "$_dxr3" = yes ; then
5408 def_dxr3='#define CONFIG_DXR3 1'
5409 _vomodules="dxr3 $_vomodules"
5410 else
5411 def_dxr3='#undef CONFIG_DXR3'
5412 _novomodules="dxr3 $_novomodules"
5414 echores "$_dxr3"
5417 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5418 if test "$_ivtv" = auto ; then
5419 cat > $TMPC << EOF
5420 #include <stdlib.h>
5421 #include <inttypes.h>
5422 #include <linux/types.h>
5423 #include <linux/videodev2.h>
5424 #include <linux/ivtv.h>
5425 #include <sys/ioctl.h>
5426 int main(void) {
5427 struct ivtv_cfg_stop_decode sd;
5428 struct ivtv_cfg_start_decode sd1;
5429 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5430 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5431 return 0; }
5433 _ivtv=no
5434 cc_check && _ivtv=yes
5436 if test "$_ivtv" = yes ; then
5437 def_ivtv='#define CONFIG_IVTV 1'
5438 _vomodules="ivtv $_vomodules"
5439 _aomodules="ivtv $_aomodules"
5440 else
5441 def_ivtv='#undef CONFIG_IVTV'
5442 _novomodules="ivtv $_novomodules"
5443 _noaomodules="ivtv $_noaomodules"
5445 echores "$_ivtv"
5448 echocheck "V4L2 MPEG Decoder"
5449 if test "$_v4l2" = auto ; then
5450 cat > $TMPC << EOF
5451 #include <stdlib.h>
5452 #include <inttypes.h>
5453 #include <linux/types.h>
5454 #include <linux/videodev2.h>
5455 #include <linux/version.h>
5456 int main(void) {
5457 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5458 #error kernel headers too old, need 2.6.22
5459 #endif
5460 struct v4l2_ext_controls ctrls;
5461 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5462 return 0;
5465 _v4l2=no
5466 cc_check && _v4l2=yes
5468 if test "$_v4l2" = yes ; then
5469 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5470 _vomodules="v4l2 $_vomodules"
5471 _aomodules="v4l2 $_aomodules"
5472 else
5473 def_v4l2='#undef CONFIG_V4L2_DECODER'
5474 _novomodules="v4l2 $_novomodules"
5475 _noaomodules="v4l2 $_noaomodules"
5477 echores "$_v4l2"
5481 #########
5482 # AUDIO #
5483 #########
5486 echocheck "OSS Audio"
5487 if test "$_ossaudio" = auto ; then
5488 cat > $TMPC << EOF
5489 #include <sys/ioctl.h>
5490 #include <$_soundcard_header>
5491 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5493 _ossaudio=no
5494 cc_check && _ossaudio=yes
5496 if test "$_ossaudio" = yes ; then
5497 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5498 _aomodules="oss $_aomodules"
5499 if test "$_linux_devfs" = yes; then
5500 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5501 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5502 else
5503 cat > $TMPC << EOF
5504 #include <sys/ioctl.h>
5505 #include <$_soundcard_header>
5506 #ifdef OPEN_SOUND_SYSTEM
5507 int main(void) { return 0; }
5508 #else
5509 #error Not the real thing
5510 #endif
5512 _real_ossaudio=no
5513 cc_check && _real_ossaudio=yes
5514 if test "$_real_ossaudio" = yes; then
5515 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5516 elif netbsd || openbsd ; then
5517 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5518 extra_ldflags="$extra_ldflags -lossaudio"
5519 else
5520 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5522 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5524 else
5525 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5526 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5527 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5528 _noaomodules="oss $_noaomodules"
5530 echores "$_ossaudio"
5533 echocheck "aRts"
5534 if test "$_arts" = auto ; then
5535 _arts=no
5536 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5538 cat > $TMPC << EOF
5539 #include <artsc.h>
5540 int main(void) { return 0; }
5542 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5547 if test "$_arts" = yes ; then
5548 def_arts='#define CONFIG_ARTS 1'
5549 _aomodules="arts $_aomodules"
5550 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5551 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5552 else
5553 _noaomodules="arts $_noaomodules"
5555 echores "$_arts"
5558 echocheck "EsounD"
5559 if test "$_esd" = auto ; then
5560 _esd=no
5561 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5563 cat > $TMPC << EOF
5564 #include <esd.h>
5565 int main(void) { int fd = esd_open_sound("test"); return fd; }
5567 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5571 echores "$_esd"
5573 if test "$_esd" = yes ; then
5574 def_esd='#define CONFIG_ESD 1'
5575 _aomodules="esd $_aomodules"
5576 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5577 extra_cflags="$extra_cflags $(esd-config --cflags)"
5579 echocheck "esd_get_latency()"
5580 cat > $TMPC << EOF
5581 #include <esd.h>
5582 int main(void) { return esd_get_latency(0); }
5584 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5585 echores "$_esd_latency"
5586 else
5587 def_esd='#undef CONFIG_ESD'
5588 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5589 _noaomodules="esd $_noaomodules"
5593 echocheck "NAS"
5594 if test "$_nas" = auto ; then
5595 cat > $TMPC << EOF
5596 #include <audio/audiolib.h>
5597 int main(void) { return 0; }
5599 _nas=no
5600 cc_check $_ld_lm -laudio -lXt && _nas=yes
5602 if test "$_nas" = yes ; then
5603 def_nas='#define CONFIG_NAS 1'
5604 libs_mplayer="$libs_mplayer -laudio -lXt"
5605 _aomodules="nas $_aomodules"
5606 else
5607 _noaomodules="nas $_noaomodules"
5608 def_nas='#undef CONFIG_NAS'
5610 echores "$_nas"
5613 echocheck "pulse"
5614 if test "$_pulse" = auto ; then
5615 _pulse=no
5616 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5618 cat > $TMPC << EOF
5619 #include <pulse/pulseaudio.h>
5620 int main(void) { return 0; }
5622 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5626 echores "$_pulse"
5628 if test "$_pulse" = yes ; then
5629 def_pulse='#define CONFIG_PULSE 1'
5630 _aomodules="pulse $_aomodules"
5631 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5632 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5633 else
5634 def_pulse='#undef CONFIG_PULSE'
5635 _noaomodules="pulse $_noaomodules"
5639 echocheck "JACK"
5640 if test "$_jack" = auto ; then
5641 _jack=yes
5643 cat > $TMPC << EOF
5644 #include <jack/jack.h>
5645 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5647 if cc_check -ljack ; then
5648 libs_mplayer="$libs_mplayer -ljack"
5649 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5650 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5651 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5652 else
5653 _jack=no
5657 if test "$_jack" = yes ; then
5658 def_jack='#define CONFIG_JACK 1'
5659 _aomodules="jack $_aomodules"
5660 else
5661 _noaomodules="jack $_noaomodules"
5663 echores "$_jack"
5665 echocheck "OpenAL"
5666 if test "$_openal" = auto ; then
5667 _openal=no
5668 cat > $TMPC << EOF
5669 #ifdef OPENAL_AL_H
5670 #include <OpenAL/al.h>
5671 #else
5672 #include <AL/al.h>
5673 #endif
5674 int main(void) {
5675 alSourceQueueBuffers(0, 0, 0);
5676 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5677 return 0;
5680 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5681 cc_check $I && _openal=yes && break
5682 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5683 done
5684 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5686 if test "$_openal" = yes ; then
5687 def_openal='#define CONFIG_OPENAL 1'
5688 _aomodules="openal $_aomodules"
5689 else
5690 _noaomodules="openal $_noaomodules"
5692 echores "$_openal"
5694 echocheck "ALSA audio"
5695 if test "$_alloca" != yes ; then
5696 _alsa=no
5697 _res_comment="alloca missing"
5699 if test "$_alsa" != no ; then
5700 _alsa=no
5701 cat > $TMPC << EOF
5702 #include <sys/time.h>
5703 #include <sys/asoundlib.h>
5704 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5705 #error "alsa version != 0.5.x"
5706 #endif
5707 int main(void) { return 0; }
5709 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5711 cat > $TMPC << EOF
5712 #include <sys/time.h>
5713 #include <sys/asoundlib.h>
5714 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5715 #error "alsa version != 0.9.x"
5716 #endif
5717 int main(void) { return 0; }
5719 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5720 cat > $TMPC << EOF
5721 #include <sys/time.h>
5722 #include <alsa/asoundlib.h>
5723 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5724 #error "alsa version != 0.9.x"
5725 #endif
5726 int main(void) { return 0; }
5728 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5730 cat > $TMPC << EOF
5731 #include <sys/time.h>
5732 #include <sys/asoundlib.h>
5733 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5734 #error "alsa version != 1.0.x"
5735 #endif
5736 int main(void) { return 0; }
5738 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5739 cat > $TMPC << EOF
5740 #include <sys/time.h>
5741 #include <alsa/asoundlib.h>
5742 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5743 #error "alsa version != 1.0.x"
5744 #endif
5745 int main(void) { return 0; }
5747 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5749 def_alsa='#undef CONFIG_ALSA'
5750 def_alsa5='#undef CONFIG_ALSA5'
5751 def_alsa9='#undef CONFIG_ALSA9'
5752 def_alsa1x='#undef CONFIG_ALSA1X'
5753 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5754 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5755 if test "$_alsaver" ; then
5756 _alsa=yes
5757 if test "$_alsaver" = '0.5.x' ; then
5758 _alsa5=yes
5759 _aomodules="alsa5 $_aomodules"
5760 def_alsa5='#define CONFIG_ALSA5 1'
5761 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5762 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5763 elif test "$_alsaver" = '0.9.x-sys' ; then
5764 _alsa9=yes
5765 _aomodules="alsa $_aomodules"
5766 def_alsa='#define CONFIG_ALSA 1'
5767 def_alsa9='#define CONFIG_ALSA9 1'
5768 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5769 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5770 elif test "$_alsaver" = '0.9.x-alsa' ; then
5771 _alsa9=yes
5772 _aomodules="alsa $_aomodules"
5773 def_alsa='#define CONFIG_ALSA 1'
5774 def_alsa9='#define CONFIG_ALSA9 1'
5775 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5776 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5777 elif test "$_alsaver" = '1.0.x-sys' ; then
5778 _alsa1x=yes
5779 _aomodules="alsa $_aomodules"
5780 def_alsa='#define CONFIG_ALSA 1'
5781 def_alsa1x="#define CONFIG_ALSA1X 1"
5782 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5783 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5784 elif test "$_alsaver" = '1.0.x-alsa' ; then
5785 _alsa1x=yes
5786 _aomodules="alsa $_aomodules"
5787 def_alsa='#define CONFIG_ALSA 1'
5788 def_alsa1x="#define CONFIG_ALSA1X 1"
5789 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5790 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5791 else
5792 _alsa=no
5793 _res_comment="unknown version"
5795 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5796 else
5797 _noaomodules="alsa $_noaomodules"
5799 echores "$_alsa"
5802 echocheck "Sun audio"
5803 if test "$_sunaudio" = auto ; then
5804 cat > $TMPC << EOF
5805 #include <sys/types.h>
5806 #include <sys/audioio.h>
5807 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5809 _sunaudio=no
5810 cc_check && _sunaudio=yes
5812 if test "$_sunaudio" = yes ; then
5813 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5814 _aomodules="sun $_aomodules"
5815 else
5816 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5817 _noaomodules="sun $_noaomodules"
5819 echores "$_sunaudio"
5822 def_mlib='#define CONFIG_MLIB 0'
5823 if sunos; then
5824 echocheck "Sun mediaLib"
5825 if test "$_mlib" = auto ; then
5826 _mlib=no
5827 cat > $TMPC << EOF
5828 #include <mlib.h>
5829 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5831 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5833 echores "$_mlib"
5834 fi #if sunos
5837 if darwin; then
5838 echocheck "CoreAudio"
5839 if test "$_coreaudio" = auto ; then
5840 cat > $TMPC <<EOF
5841 #include <CoreAudio/CoreAudio.h>
5842 #include <AudioToolbox/AudioToolbox.h>
5843 #include <AudioUnit/AudioUnit.h>
5844 int main(void) { return 0; }
5846 _coreaudio=no
5847 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5849 if test "$_coreaudio" = yes ; then
5850 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5851 def_coreaudio='#define CONFIG_COREAUDIO 1'
5852 _aomodules="coreaudio $_aomodules"
5853 else
5854 def_coreaudio='#undef CONFIG_COREAUDIO'
5855 _noaomodules="coreaudio $_noaomodules"
5857 echores $_coreaudio
5858 fi #if darwin
5861 if irix; then
5862 echocheck "SGI audio"
5863 if test "$_sgiaudio" = auto ; then
5864 # check for SGI audio
5865 cat > $TMPC << EOF
5866 #include <dmedia/audio.h>
5867 int main(void) { return 0; }
5869 _sgiaudio=no
5870 cc_check && _sgiaudio=yes
5872 if test "$_sgiaudio" = "yes" ; then
5873 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5874 libs_mplayer="$libs_mplayer -laudio"
5875 _aomodules="sgi $_aomodules"
5876 else
5877 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5878 _noaomodules="sgi $_noaomodules"
5880 echores "$_sgiaudio"
5881 fi #if irix
5884 if os2 ; then
5885 echocheck "DART"
5886 if test "$_dart" = auto; then
5887 cat > $TMPC << EOF
5888 #include <os2.h>
5889 #include <dart.h>
5890 int main( void ) { return 0; }
5892 _dart=no;
5893 cc_check -ldart && _dart=yes
5895 if test "$_dart" = yes ; then
5896 def_dart='#define CONFIG_DART 1'
5897 libs_mplayer="$libs_mplayer -ldart"
5898 _aomodules="dart $_aomodules"
5899 else
5900 def_dart='#undef CONFIG_DART'
5901 _noaomodules="dart $_noaomodules"
5903 echores "$_dart"
5904 fi #if os2
5907 # set default CD/DVD devices
5908 if win32 || os2 ; then
5909 default_cdrom_device="D:"
5910 elif darwin ; then
5911 default_cdrom_device="/dev/disk1"
5912 elif dragonfly ; then
5913 default_cdrom_device="/dev/cd0"
5914 elif freebsd ; then
5915 default_cdrom_device="/dev/acd0"
5916 elif openbsd ; then
5917 default_cdrom_device="/dev/rcd0a"
5918 elif sunos ; then
5919 default_cdrom_device="/vol/dev/aliases/cdrom0"
5920 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5921 # file system and the volfs service.
5922 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5923 elif amigaos ; then
5924 default_cdrom_device="a1ide.device:2"
5925 else
5926 default_cdrom_device="/dev/cdrom"
5929 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5930 default_dvd_device=$default_cdrom_device
5931 elif darwin ; then
5932 default_dvd_device="/dev/rdiskN"
5933 else
5934 default_dvd_device="/dev/dvd"
5938 echocheck "VCD support"
5939 if test "$_vcd" = auto; then
5940 _vcd=no
5941 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
5942 _vcd=yes
5943 elif mingw32; then
5944 cat > $TMPC << EOF
5945 #include <ddk/ntddcdrm.h>
5946 int main(void) { return 0; }
5948 cc_check && _vcd=yes
5951 if test "$_vcd" = yes; then
5952 _inputmodules="vcd $_inputmodules"
5953 def_vcd='#define CONFIG_VCD 1'
5954 else
5955 def_vcd='#undef CONFIG_VCD'
5956 _noinputmodules="vcd $_noinputmodules"
5957 _res_comment="not supported on this OS"
5959 echores "$_vcd"
5963 echocheck "dvdread"
5964 if test "$_dvdread_internal" = auto ; then
5965 _dvdread_internal=no
5966 _dvdread=no
5967 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5968 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5969 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5970 || darwin || win32 || os2; then
5971 _dvdread_internal=yes
5972 _dvdread=yes
5973 extra_cflags="-Ilibdvdread4 $extra_cflags"
5975 elif test "$_dvdread" = auto ; then
5976 _dvdread=no
5977 if test "$_dl" = yes; then
5978 cat > $TMPC << EOF
5979 #include <inttypes.h>
5980 #include <dvdread/dvd_reader.h>
5981 #include <dvdread/ifo_types.h>
5982 #include <dvdread/ifo_read.h>
5983 #include <dvdread/nav_read.h>
5984 int main(void) { return 0; }
5986 _dvdreadcflags=$($_dvdreadconfig --cflags)
5987 _dvdreadlibs=$($_dvdreadconfig --libs)
5988 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5989 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5990 _dvdread=yes
5991 extra_cflags="$extra_cflags $_dvdreadcflags"
5992 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5993 _res_comment="external"
5998 if test "$_dvdread_internal" = yes; then
5999 def_dvdread='#define CONFIG_DVDREAD 1'
6000 _inputmodules="dvdread(internal) $_inputmodules"
6001 _largefiles=yes
6002 _res_comment="internal"
6003 elif test "$_dvdread" = yes; then
6004 def_dvdread='#define CONFIG_DVDREAD 1'
6005 _largefiles=yes
6006 extra_ldflags="$extra_ldflags -ldvdread"
6007 _inputmodules="dvdread(external) $_inputmodules"
6008 _res_comment="external"
6009 else
6010 def_dvdread='#undef CONFIG_DVDREAD'
6011 _noinputmodules="dvdread $_noinputmodules"
6013 echores "$_dvdread"
6016 echocheck "internal libdvdcss"
6017 if test "$_libdvdcss_internal" = auto ; then
6018 _libdvdcss_internal=no
6019 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
6020 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
6022 if test "$_libdvdcss_internal" = yes ; then
6023 if linux || netbsd || openbsd || bsdos ; then
6024 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
6025 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
6026 elif freebsd || dragonfly ; then
6027 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
6028 elif darwin ; then
6029 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
6030 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
6031 elif cygwin ; then
6032 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
6033 elif beos ; then
6034 cflags_libdvdcss="-DSYS_BEOS"
6035 elif os2 ; then
6036 cflags_libdvdcss="-DSYS_OS2"
6038 cflags_libdvdcss_dvdread="-Ilibdvdcss"
6039 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
6040 _inputmodules="libdvdcss(internal) $_inputmodules"
6041 _largefiles=yes
6042 else
6043 _noinputmodules="libdvdcss(internal) $_noinputmodules"
6045 echores "$_libdvdcss_internal"
6048 echocheck "cdparanoia"
6049 if test "$_cdparanoia" = auto ; then
6050 cat > $TMPC <<EOF
6051 #include <cdda_interface.h>
6052 #include <cdda_paranoia.h>
6053 // This need a better test. How ?
6054 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
6056 _cdparanoia=no
6057 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
6058 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
6059 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
6060 done
6062 if test "$_cdparanoia" = yes ; then
6063 _cdda='yes'
6064 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
6065 openbsd && extra_ldflags="$extra_ldflags -lutil"
6067 echores "$_cdparanoia"
6070 echocheck "libcdio"
6071 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
6072 cat > $TMPC << EOF
6073 #include <stdio.h>
6074 #include <cdio/version.h>
6075 #include <cdio/cdda.h>
6076 #include <cdio/paranoia.h>
6077 int main(void) {
6078 void *test = cdda_verbose_set;
6079 printf("%s\n", CDIO_VERSION);
6080 return test == (void *)1;
6083 _libcdio=no
6084 for _ld_tmp in "" "-lwinmm" ; do
6085 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6086 cc_check $_ld_tmp $_ld_lm \
6087 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6088 done
6089 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6090 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6091 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6092 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6093 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6096 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6097 _cdda='yes'
6098 def_libcdio='#define CONFIG_LIBCDIO 1'
6099 def_havelibcdio='yes'
6100 else
6101 if test "$_cdparanoia" = yes ; then
6102 _res_comment="using cdparanoia"
6104 def_libcdio='#undef CONFIG_LIBCDIO'
6105 def_havelibcdio='no'
6107 echores "$_libcdio"
6109 if test "$_cdda" = yes ; then
6110 test $_cddb = auto && test $_network = yes && _cddb=yes
6111 def_cdparanoia='#define CONFIG_CDDA 1'
6112 _inputmodules="cdda $_inputmodules"
6113 else
6114 def_cdparanoia='#undef CONFIG_CDDA'
6115 _noinputmodules="cdda $_noinputmodules"
6118 if test "$_cddb" = yes ; then
6119 def_cddb='#define CONFIG_CDDB 1'
6120 _inputmodules="cddb $_inputmodules"
6121 else
6122 _cddb=no
6123 def_cddb='#undef CONFIG_CDDB'
6124 _noinputmodules="cddb $_noinputmodules"
6127 echocheck "bitmap font support"
6128 if test "$_bitmap_font" = yes ; then
6129 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6130 else
6131 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6133 echores "$_bitmap_font"
6136 echocheck "freetype >= 2.0.9"
6138 # freetype depends on iconv
6139 if test "$_iconv" = no ; then
6140 _freetype=no
6141 _res_comment="iconv support needed"
6144 if test "$_freetype" = auto ; then
6145 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6146 cat > $TMPC << EOF
6147 #include <stdio.h>
6148 #include <ft2build.h>
6149 #include FT_FREETYPE_H
6150 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6151 #error "Need FreeType 2.0.9 or newer"
6152 #endif
6153 int main(void) {
6154 FT_Library library;
6155 FT_Int major=-1,minor=-1,patch=-1;
6156 int err=FT_Init_FreeType(&library);
6157 return 0;
6160 _freetype=no
6161 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6162 else
6163 _freetype=no
6166 if test "$_freetype" = yes ; then
6167 def_freetype='#define CONFIG_FREETYPE 1'
6168 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6169 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6170 else
6171 def_freetype='#undef CONFIG_FREETYPE'
6173 echores "$_freetype"
6175 if test "$_freetype" = no ; then
6176 _fontconfig=no
6177 _res_comment="FreeType support needed"
6179 echocheck "fontconfig"
6180 if test "$_fontconfig" = auto ; then
6181 cat > $TMPC << EOF
6182 #include <stdio.h>
6183 #include <stdlib.h>
6184 #include <fontconfig/fontconfig.h>
6185 int main(void) {
6186 int err = FcInit();
6187 if (err == FcFalse) {
6188 printf("Couldn't initialize fontconfig lib\n");
6189 exit(err);
6191 return 0;
6194 _fontconfig=no
6195 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6196 _ld_tmp="-lfontconfig $_ld_tmp"
6197 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6198 done
6199 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6200 _inc_tmp=$($_pkg_config --cflags fontconfig)
6201 _ld_tmp=$($_pkg_config --libs fontconfig)
6202 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6203 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6206 if test "$_fontconfig" = yes ; then
6207 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6208 else
6209 def_fontconfig='#undef CONFIG_FONTCONFIG'
6211 echores "$_fontconfig"
6214 echocheck "SSA/ASS support"
6215 # libass depends on FreeType
6216 if test "$_freetype" = no ; then
6217 _ass=no
6218 ass_internal=no
6219 _res_comment="FreeType support needed"
6222 if test "$_ass" = auto ; then
6223 cat > $TMPC << EOF
6224 #include <ft2build.h>
6225 #include FT_FREETYPE_H
6226 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 1) || ((FREETYPE_MINOR == 1) && (FREETYPE_PATCH < 8)))
6227 #error "Need FreeType 2.1.8 or newer"
6228 #endif
6229 int main(void) { return 0; }
6231 _ass=no
6232 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
6233 if test "$_ass" = no ; then
6234 ass_internal=no
6235 _res_comment="FreeType >= 2.1.8 needed"
6236 elif test "$ass_internal" = no ; then
6237 _res_comment="external"
6238 extra_ldflags="$extra_ldflags -lass"
6241 if test "$_ass" = yes ; then
6242 def_ass='#define CONFIG_ASS 1'
6243 else
6244 def_ass='#undef CONFIG_ASS'
6246 if test "$ass_internal" = yes ; then
6247 def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
6248 else
6249 def_ass_internal='#undef CONFIG_ASS_INTERNAL'
6251 echores "$_ass"
6254 echocheck "fribidi with charsets"
6255 _inc_tmp=""
6256 _ld_tmp=""
6257 if test "$_fribidi" = auto ; then
6258 cat > $TMPC << EOF
6259 #include <stdio.h>
6260 #include <stdlib.h>
6261 /* workaround for fribidi 0.10.4 and below */
6262 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6263 #include <fribidi/fribidi.h>
6264 int main(void) {
6265 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6266 printf("Fribidi headers are not consistents with the library!\n");
6267 exit(1);
6269 return 0;
6272 _fribidi=no
6273 _inc_tmp=""
6274 _ld_tmp="-lfribidi"
6275 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6276 if $_fribidiconfig --version > /dev/null 2>&1 &&
6277 test "$_fribidi" = no ; then
6278 _inc_tmp="$($_fribidiconfig --cflags)"
6279 _ld_tmp="$($_fribidiconfig --libs)"
6280 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6283 if test "$_fribidi" = yes ; then
6284 def_fribidi='#define CONFIG_FRIBIDI 1'
6285 extra_cflags="$extra_cflags $_inc_tmp"
6286 extra_ldflags="$extra_ldflags $_ld_tmp"
6287 else
6288 def_fribidi='#undef CONFIG_FRIBIDI'
6290 echores "$_fribidi"
6293 echocheck "ENCA"
6294 if test "$_enca" = auto ; then
6295 cat > $TMPC << EOF
6296 #include <sys/types.h>
6297 #include <enca.h>
6298 int main(void) {
6299 const char **langs;
6300 size_t langcnt;
6301 langs = enca_get_languages(&langcnt);
6302 return 0;
6305 _enca=no
6306 cc_check -lenca $_ld_lm && _enca=yes
6308 if test "$_enca" = yes ; then
6309 def_enca='#define CONFIG_ENCA 1'
6310 extra_ldflags="$extra_ldflags -lenca"
6311 else
6312 def_enca='#undef CONFIG_ENCA'
6314 echores "$_enca"
6317 echocheck "zlib"
6318 cat > $TMPC << EOF
6319 #include <zlib.h>
6320 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6322 _zlib=no
6323 cc_check -lz && _zlib=yes
6324 if test "$_zlib" = yes ; then
6325 def_zlib='#define CONFIG_ZLIB 1'
6326 extra_ldflags="$extra_ldflags -lz"
6327 else
6328 def_zlib='#define CONFIG_ZLIB 0'
6329 _libavdecoders=$(echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/ZLIB_DECODER// -e s/DXA_DECODER// -e s/TSCC_DECODER//)
6330 _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
6332 echores "$_zlib"
6335 echocheck "bzlib"
6336 bzlib=no
6337 def_bzlib='#define CONFIG_BZLIB 0'
6338 cat > $TMPC << EOF
6339 #include <bzlib.h>
6340 int main(void) { BZ2_bzlibVersion(); return 0; }
6342 cc_check -lbz2 && bzlib=yes
6343 if test "$bzlib" = yes ; then
6344 def_bzlib='#define CONFIG_BZLIB 1'
6345 extra_ldflags="$extra_ldflags -lbz2"
6347 echores "$bzlib"
6350 echocheck "RTC"
6351 if test "$_rtc" = auto ; then
6352 cat > $TMPC << EOF
6353 #include <sys/ioctl.h>
6354 #ifdef __linux__
6355 #include <linux/rtc.h>
6356 #else
6357 #include <rtc.h>
6358 #define RTC_PIE_ON RTCIO_PIE_ON
6359 #endif
6360 int main(void) { return RTC_PIE_ON; }
6362 _rtc=no
6363 cc_check && _rtc=yes
6364 ppc && _rtc=no
6366 if test "$_rtc" = yes ; then
6367 def_rtc='#define HAVE_RTC 1'
6368 else
6369 def_rtc='#undef HAVE_RTC'
6371 echores "$_rtc"
6374 echocheck "liblzo2 support"
6375 if test "$_liblzo" = auto ; then
6376 _liblzo=no
6377 cat > $TMPC << EOF
6378 #include <lzo/lzo1x.h>
6379 int main(void) { lzo_init();return 0; }
6381 cc_check -llzo2 && _liblzo=yes
6383 if test "$_liblzo" = yes ; then
6384 def_liblzo='#define CONFIG_LIBLZO 1'
6385 extra_ldflags="$extra_ldflags -llzo2"
6386 _codecmodules="liblzo $_codecmodules"
6387 else
6388 def_liblzo='#undef CONFIG_LIBLZO'
6389 _nocodecmodules="liblzo $_nocodecmodules"
6391 echores "$_liblzo"
6394 echocheck "mad support"
6395 if test "$_mad" = auto ; then
6396 _mad=no
6397 cat > $TMPC << EOF
6398 #include <mad.h>
6399 int main(void) { return 0; }
6401 cc_check -lmad && _mad=yes
6403 if test "$_mad" = yes ; then
6404 def_mad='#define CONFIG_LIBMAD 1'
6405 extra_ldflags="$extra_ldflags -lmad"
6406 _codecmodules="libmad $_codecmodules"
6407 else
6408 def_mad='#undef CONFIG_LIBMAD'
6409 _nocodecmodules="libmad $_nocodecmodules"
6411 echores "$_mad"
6413 echocheck "Twolame"
6414 if test "$_twolame" = auto ; then
6415 cat > $TMPC <<EOF
6416 #include <twolame.h>
6417 int main(void) { twolame_init(); return 0; }
6419 _twolame=no
6420 cc_check -ltwolame $_ld_lm && _twolame=yes
6422 if test "$_twolame" = yes ; then
6423 def_twolame='#define CONFIG_TWOLAME 1'
6424 libs_mencoder="$libs_mencoder -ltwolame"
6425 _codecmodules="twolame $_codecmodules"
6426 else
6427 def_twolame='#undef CONFIG_TWOLAME'
6428 _nocodecmodules="twolame $_nocodecmodules"
6430 echores "$_twolame"
6432 echocheck "Toolame"
6433 if test "$_toolame" = auto ; then
6434 _toolame=no
6435 if test "$_twolame" = yes ; then
6436 _res_comment="disabled by twolame"
6437 else
6438 cat > $TMPC <<EOF
6439 #include <toolame.h>
6440 int main(void) { toolame_init(); return 0; }
6442 cc_check -ltoolame $_ld_lm && _toolame=yes
6445 if test "$_toolame" = yes ; then
6446 def_toolame='#define CONFIG_TOOLAME 1'
6447 libs_mencoder="$libs_mencoder -ltoolame"
6448 _codecmodules="toolame $_codecmodules"
6449 else
6450 def_toolame='#undef CONFIG_TOOLAME'
6451 _nocodecmodules="toolame $_nocodecmodules"
6453 if test "$_toolamedir" ; then
6454 _res_comment="using $_toolamedir"
6456 echores "$_toolame"
6458 echocheck "OggVorbis support"
6459 if test "$_tremor_internal" = yes; then
6460 _libvorbis=no
6461 elif test "$_tremor" = auto; then
6462 _tremor=no
6463 cat > $TMPC << EOF
6464 #include <tremor/ivorbiscodec.h>
6465 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6467 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6469 if test "$_libvorbis" = auto; then
6470 _libvorbis=no
6471 cat > $TMPC << EOF
6472 #include <vorbis/codec.h>
6473 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6475 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6477 if test "$_tremor_internal" = yes ; then
6478 _vorbis=yes
6479 def_vorbis='#define CONFIG_OGGVORBIS 1'
6480 def_tremor='#define CONFIG_TREMOR 1'
6481 _codecmodules="tremor(internal) $_codecmodules"
6482 _res_comment="internal Tremor"
6483 if test "$_tremor_low" = yes ; then
6484 cflags_tremor_low="-D_LOW_ACCURACY_"
6485 _res_comment="internal low accuracy Tremor"
6487 elif test "$_tremor" = yes ; then
6488 _vorbis=yes
6489 def_vorbis='#define CONFIG_OGGVORBIS 1'
6490 def_tremor='#define CONFIG_TREMOR 1'
6491 _codecmodules="tremor(external) $_codecmodules"
6492 _res_comment="external Tremor"
6493 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6494 elif test "$_libvorbis" = yes ; then
6495 _vorbis=yes
6496 def_vorbis='#define CONFIG_OGGVORBIS 1'
6497 _codecmodules="libvorbis $_codecmodules"
6498 _res_comment="libvorbis"
6499 extra_ldflags="$extra_ldflags -lvorbis -logg"
6500 else
6501 _vorbis=no
6502 _nocodecmodules="libvorbis $_nocodecmodules"
6504 echores "$_vorbis"
6506 echocheck "libspeex (version >= 1.1 required)"
6507 if test "$_speex" = auto ; then
6508 _speex=no
6509 cat > $TMPC << EOF
6510 #include <speex/speex.h>
6511 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6513 cc_check -lspeex $_ld_lm && _speex=yes
6515 if test "$_speex" = yes ; then
6516 def_speex='#define CONFIG_SPEEX 1'
6517 extra_ldflags="$extra_ldflags -lspeex"
6518 _codecmodules="speex $_codecmodules"
6519 else
6520 def_speex='#undef CONFIG_SPEEX'
6521 _nocodecmodules="speex $_nocodecmodules"
6523 echores "$_speex"
6525 echocheck "OggTheora support"
6526 if test "$_theora" = auto ; then
6527 _theora=no
6528 cat > $TMPC << EOF
6529 #include <theora/theora.h>
6530 #include <string.h>
6531 int main(void) {
6532 /* Theora is in flux, make sure that all interface routines and datatypes
6533 * exist and work the way we expect it, so we don't break MPlayer. */
6534 ogg_packet op;
6535 theora_comment tc;
6536 theora_info inf;
6537 theora_state st;
6538 yuv_buffer yuv;
6539 int r;
6540 double t;
6542 theora_info_init(&inf);
6543 theora_comment_init(&tc);
6545 return 0;
6547 /* we don't want to execute this kind of nonsense; just for making sure
6548 * that compilation works... */
6549 memset(&op, 0, sizeof(op));
6550 r = theora_decode_header(&inf, &tc, &op);
6551 r = theora_decode_init(&st, &inf);
6552 t = theora_granule_time(&st, op.granulepos);
6553 r = theora_decode_packetin(&st, &op);
6554 r = theora_decode_YUVout(&st, &yuv);
6555 theora_clear(&st);
6557 return 0;
6560 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6561 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6562 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6563 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6564 if test _theora = no; then
6565 _ld_theora="-ltheora -logg"
6566 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6568 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6569 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6570 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6571 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6572 extra_ldflags="$extra_ldflags $_ld_theora" &&
6573 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6574 if test _theora = no; then
6575 _ld_theora="-ltheora -logg"
6576 cc_check tremor/bitwise.c $_ld_theora &&
6577 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6581 if test "$_theora" = yes ; then
6582 def_theora='#define CONFIG_OGGTHEORA 1'
6583 _codecmodules="libtheora $_codecmodules"
6584 # when --enable-theora is forced, we'd better provide a probably sane
6585 # $_ld_theora than nothing
6586 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6587 else
6588 def_theora='#undef CONFIG_OGGTHEORA'
6589 _nocodecmodules="libtheora $_nocodecmodules"
6591 echores "$_theora"
6593 echocheck "internal mp3lib support"
6594 if test "$_mp3lib" = auto ; then
6595 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6597 if test "$_mp3lib" = yes ; then
6598 def_mp3lib='#define CONFIG_MP3LIB 1'
6599 _codecmodules="mp3lib(internal) $_codecmodules"
6600 else
6601 def_mp3lib='#undef CONFIG_MP3LIB'
6602 _nocodecmodules="mp3lib(internal) $_nocodecmodules"
6604 echores "$_mp3lib"
6606 echocheck "liba52 support"
6607 if test "$_liba52_internal" = auto ; then
6608 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _liba52_internal=no || _liba52_internal=yes
6610 def_liba52='#undef CONFIG_LIBA52'
6611 def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6612 if test "$_liba52_internal" = yes ; then
6613 _liba52=yes
6614 def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6615 _res_comment="internal"
6616 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6617 _liba52=no
6618 cat > $TMPC << EOF
6619 #include <inttypes.h>
6620 #include <a52dec/a52.h>
6621 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6623 cc_check -la52 && _liba52=yes && _res_comment="external" && extra_ldflags="$extra_ldflags -la52"
6625 if test "$_liba52" = yes ; then
6626 def_liba52='#define CONFIG_LIBA52 1'
6627 _codecmodules="liba52($_res_comment) $_codecmodules"
6628 else
6629 _nocodecmodules="liba52 $_nocodecmodules"
6631 echores "$_liba52"
6633 echocheck "internal libmpeg2 support"
6634 if test "$_libmpeg2" = auto ; then
6635 _libmpeg2=yes
6636 if alpha && test cc_vendor=gnu; then
6637 case $cc_version in
6638 2*|3.0*|3.1*) # cannot compile MVI instructions
6639 _libmpeg2=no
6640 _res_comment="broken gcc"
6642 esac
6645 if test "$_libmpeg2" = yes ; then
6646 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6647 _codecmodules="libmpeg2(internal) $_codecmodules"
6648 else
6649 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6650 _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
6652 echores "$_libmpeg2"
6654 echocheck "libdca support"
6655 if test "$_libdca" = auto ; then
6656 _libdca=no
6657 cat > $TMPC << EOF
6658 #include <inttypes.h>
6659 #include <dts.h>
6660 int main(void) { dts_init(0); return 0; }
6662 for _ld_dca in -ldts -ldca ; do
6663 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6664 && _libdca=yes && break
6665 done
6667 if test "$_libdca" = yes ; then
6668 def_libdca='#define CONFIG_LIBDCA 1'
6669 _codecmodules="libdca $_codecmodules"
6670 else
6671 def_libdca='#undef CONFIG_LIBDCA'
6672 _nocodecmodules="libdca $_nocodecmodules"
6674 echores "$_libdca"
6676 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6677 if test "$_musepack" = auto ; then
6678 _musepack=no
6679 cat > $TMPC << EOF
6680 #include <stddef.h>
6681 #include <mpcdec/mpcdec.h>
6682 int main(void) {
6683 mpc_streaminfo info;
6684 mpc_decoder decoder;
6685 mpc_decoder_set_streaminfo(&decoder, &info);
6686 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6687 return 0;
6690 cc_check -lmpcdec $_ld_lm && _musepack=yes
6692 if test "$_musepack" = yes ; then
6693 def_musepack='#define CONFIG_MUSEPACK 1'
6694 extra_ldflags="$extra_ldflags -lmpcdec"
6695 _codecmodules="musepack $_codecmodules"
6696 else
6697 def_musepack='#undef CONFIG_MUSEPACK'
6698 _nocodecmodules="musepack $_nocodecmodules"
6700 echores "$_musepack"
6703 echocheck "FAAC support"
6704 if test "$_faac" = auto ; then
6705 cat > $TMPC <<EOF
6706 #include <inttypes.h>
6707 #include <faac.h>
6708 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6710 _faac=no
6711 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6712 cc_check -O4 $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6713 done
6715 if test "$_faac" = yes ; then
6716 def_faac="#define CONFIG_FAAC 1"
6717 test "$_faac_lavc" = auto && _faac_lavc=yes
6718 if test "$_faac_lavc" = yes ; then
6719 def_faac_lavc="#define CONFIG_LIBFAAC 1"
6720 libs_mplayer="$libs_mplayer $_ld_faac"
6721 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6723 _codecmodules="faac $_codecmodules"
6724 else
6725 _faac_lavc=no
6726 def_faac="#undef CONFIG_FAAC"
6727 def_faac_lavc="#define CONFIG_LIBFAAC 0"
6728 _nocodecmodules="faac $_nocodecmodules"
6730 _res_comment="in libavcodec: $_faac_lavc"
6731 echores "$_faac"
6734 echocheck "FAAD2 support"
6735 if test "$_faad_internal" = auto ; then
6736 if x86_32 && test cc_vendor=gnu; then
6737 case $cc_version in
6738 3.1*|3.2) # ICE/insn with these versions
6739 _faad_internal=no
6740 _res_comment="broken gcc"
6743 _faad=yes
6744 _faad_internal=yes
6746 esac
6747 else
6748 _faad=yes
6749 _faad_internal=yes
6752 if test "$_faad" = auto ; then
6753 cat > $TMPC << EOF
6754 #include <faad.h>
6755 #ifndef FAAD_MIN_STREAMSIZE
6756 #error Too old version
6757 #endif
6758 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6759 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6761 cc_check -lfaad $_ld_lm && _faad=yes
6764 def_faad='#undef CONFIG_FAAD'
6765 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6766 if test "$_faad_internal" = yes ; then
6767 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6768 _res_comment="internal floating-point"
6769 if test "$_faad_fixed" = yes ; then
6770 # The FIXED_POINT implementation of FAAD2 improves performance
6771 # on some platforms, especially for SBR files.
6772 cflags_faad_fixed="-DFIXED_POINT"
6773 _res_comment="internal fixed-point"
6775 elif test "$_faad" = yes ; then
6776 extra_ldflags="$extra_ldflags -lfaad"
6779 if test "$_faad" = yes ; then
6780 def_faad='#define CONFIG_FAAD 1'
6781 if test "$_faad_internal" = yes ; then
6782 _codecmodules="faad2(internal) $_codecmodules"
6783 else
6784 _codecmodules="faad2 $_codecmodules"
6786 else
6787 _faad=no
6788 _nocodecmodules="faad2 $_nocodecmodules"
6790 echores "$_faad"
6793 echocheck "LADSPA plugin support"
6794 if test "$_ladspa" = auto ; then
6795 cat > $TMPC <<EOF
6796 #include <stdio.h>
6797 #include <ladspa.h>
6798 int main(void) {
6799 const LADSPA_Descriptor *ld = NULL;
6800 return 0;
6803 _ladspa=no
6804 cc_check && _ladspa=yes
6806 if test "$_ladspa" = yes; then
6807 def_ladspa="#define CONFIG_LADSPA 1"
6808 else
6809 def_ladspa="#undef CONFIG_LADSPA"
6811 echores "$_ladspa"
6814 echocheck "libbs2b audio filter support"
6815 if test "$_libbs2b" = auto ; then
6816 cat > $TMPC <<EOF
6817 #include <bs2b.h>
6818 #if BS2B_VERSION_MAJOR < 3
6819 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6820 #endif
6821 int main(void) {
6822 t_bs2bdp filter;
6823 filter=bs2b_open();
6824 bs2b_close(filter);
6825 return 0;
6828 _libbs2b=no
6829 if $_pkg_config --exists libbs2b ; then
6830 _inc_tmp=$($_pkg_config --cflags libbs2b)
6831 _ld_tmp=$($_pkg_config --libs libbs2b)
6832 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6833 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6834 else
6835 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6836 -I/usr/local/include/bs2b ; do
6837 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6838 extra_ldflags="$extra_ldflags -lbs2b"
6839 extra_cflags="$extra_cflags $_inc_tmp"
6840 _libbs2b=yes
6841 break
6843 done
6846 def_libbs2b="#undef CONFIG_LIBBS2B"
6847 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6848 echores "$_libbs2b"
6851 if test -z "$_codecsdir" ; then
6852 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6853 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6854 if test -d "$dir" ; then
6855 _codecsdir="$dir"
6856 break;
6858 done
6860 # Fall back on default directory.
6861 if test -z "$_codecsdir" ; then
6862 _codecsdir="$_libdir/codecs"
6863 mingw32 && _codecsdir="codecs"
6864 os2 && _codecsdir="codecs"
6868 echocheck "Win32 codecs"
6869 if test "$_win32dll" = auto ; then
6870 _win32dll=no
6871 if x86_32 && ! qnx; then
6872 _win32dll=yes
6875 if test "$_win32dll" = yes ; then
6876 def_win32dll='#define CONFIG_WIN32DLL 1'
6877 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6878 _res_comment="using $_win32codecsdir"
6879 if ! win32 ; then
6880 def_win32_loader='#define WIN32_LOADER 1'
6881 _win32_emulation=yes
6882 else
6883 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6884 _res_comment="using native windows"
6886 _codecmodules="win32 $_codecmodules"
6887 else
6888 def_win32dll='#undef CONFIG_WIN32DLL'
6889 def_win32_loader='#undef WIN32_LOADER'
6890 _nocodecmodules="win32 $_nocodecmodules"
6892 echores "$_win32dll"
6895 echocheck "XAnim codecs"
6896 if test "$_xanim" = auto ; then
6897 _xanim=no
6898 _res_comment="dynamic loader support needed"
6899 if test "$_dl" = yes ; then
6900 _xanim=yes
6903 if test "$_xanim" = yes ; then
6904 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6905 def_xanim='#define CONFIG_XANIM 1'
6906 def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6907 _codecmodules="xanim $_codecmodules"
6908 _res_comment="using $_xanimcodecsdir"
6909 else
6910 def_xanim='#undef CONFIG_XANIM'
6911 def_xanim_path='#undef XACODEC_PATH'
6912 _nocodecmodules="xanim $_nocodecmodules"
6914 echores "$_xanim"
6917 echocheck "RealPlayer codecs"
6918 if test "$_real" = auto ; then
6919 _real=no
6920 _res_comment="dynamic loader support needed"
6921 if test "$_dl" = yes || test "$_win32dll" = yes &&
6922 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
6923 _real=yes
6926 if test "$_real" = yes ; then
6927 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6928 def_real='#define CONFIG_REALCODECS 1'
6929 def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6930 _codecmodules="real $_codecmodules"
6931 _res_comment="using $_realcodecsdir"
6932 else
6933 def_real='#undef CONFIG_REALCODECS'
6934 def_real_path="#undef REALCODEC_PATH"
6935 _nocodecmodules="real $_nocodecmodules"
6937 echores "$_real"
6940 echocheck "QuickTime codecs"
6941 _qtx_emulation=no
6942 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6943 if test "$_qtx" = auto ; then
6944 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6946 if test "$_qtx" = yes ; then
6947 def_qtx='#define CONFIG_QTX_CODECS 1'
6948 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6949 _codecmodules="qtx $_codecmodules"
6950 darwin || win32 || _qtx_emulation=yes
6951 else
6952 def_qtx='#undef CONFIG_QTX_CODECS'
6953 _nocodecmodules="qtx $_nocodecmodules"
6955 echores "$_qtx"
6957 echocheck "Nemesi Streaming Media libraries"
6958 if test "$_nemesi" = auto && test "$_network" = yes ; then
6959 _nemesi=no
6960 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6961 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6962 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6963 _nemesi=yes
6966 if test "$_nemesi" = yes; then
6967 _native_rtsp=no
6968 def_nemesi='#define CONFIG_LIBNEMESI 1'
6969 _inputmodules="nemesi $_inputmodules"
6970 else
6971 _native_rtsp="$_network"
6972 _nemesi=no
6973 def_nemesi='#undef CONFIG_LIBNEMESI'
6974 _noinputmodules="nemesi $_noinputmodules"
6976 echores "$_nemesi"
6978 echocheck "LIVE555 Streaming Media libraries"
6979 if test "$_live" = auto && test "$_network" = yes ; then
6980 cat > $TMPCPP << EOF
6981 #include <liveMedia.hh>
6982 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6983 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6984 #endif
6985 int main(void) { return 0; }
6988 _live=no
6989 for I in $extra_cflags "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/lib64/live" "-I/usr/local/live" "-I/usr/local/lib/live" ; do
6990 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6991 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6992 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6993 $_livelibdir/groupsock/libgroupsock.a \
6994 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6995 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6996 $extra_ldflags -lstdc++" \
6997 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6998 -I$_livelibdir/UsageEnvironment/include \
6999 -I$_livelibdir/BasicUsageEnvironment/include \
7000 -I$_livelibdir/groupsock/include" && \
7001 _live=yes && break
7002 done
7003 if test "$_live" != yes ; then
7004 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
7005 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
7006 _live_dist=yes
7010 if test "$_live" = yes && test "$_network" = yes; then
7011 test $_livelibdir && _res_comment="using $_livelibdir"
7012 def_live='#define CONFIG_LIVE555 1'
7013 _inputmodules="live555 $_inputmodules"
7014 elif test "$_live_dist" = yes && test "$_network" = yes; then
7015 _res_comment="using distribution version"
7016 _live="yes"
7017 def_live='#define CONFIG_LIVE555 1'
7018 extra_ldflags="$extra_ldflags $ld_tmp"
7019 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
7020 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
7021 _inputmodules="live555 $_inputmodules"
7022 else
7023 _live=no
7024 def_live='#undef CONFIG_LIVE555'
7025 _noinputmodules="live555 $_noinputmodules"
7027 echores "$_live"
7030 echocheck "FFmpeg libavutil"
7031 if test "$_libavutil_a" = auto ; then
7032 if test -d libavutil ; then
7033 _libavutil_a=yes
7034 _res_comment="static"
7035 else
7036 die "MPlayer will not compile without libavutil in the source tree."
7038 elif test "$_libavutil_so" = auto ; then
7039 _libavutil_so=no
7040 cat > $TMPC << EOF
7041 #include <libavutil/common.h>
7042 int main(void) { av_gcd(1,1); return 0; }
7044 if $_pkg_config --exists libavutil ; then
7045 _inc_libavutil=$($_pkg_config --cflags libavutil)
7046 _ld_tmp=$($_pkg_config --libs libavutil)
7047 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7048 && _libavutil_so=yes
7049 elif cc_check -lavutil $_ld_lm ; then
7050 extra_ldflags="$extra_ldflags -lavutil"
7051 _libavutil_so=yes
7052 _res_comment="using libavutil.so, but static libavutil is recommended"
7055 _libavutil=no
7056 def_libavutil='#undef CONFIG_LIBAVUTIL'
7057 def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
7058 def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
7059 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
7060 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
7061 test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
7062 test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
7063 # neither static nor shared libavutil is available, but it is mandatory ...
7064 if test "$_libavutil" = no ; then
7065 die "You need static or shared libavutil, MPlayer will not compile without!"
7067 echores "$_libavutil"
7069 echocheck "FFmpeg libavcodec"
7070 if test "$_libavcodec_a" = auto ; then
7071 _libavcodec_a=no
7072 if test -d libavcodec && test -f libavcodec/utils.c ; then
7073 _libavcodec_a="yes"
7074 _res_comment="static"
7076 elif test "$_libavcodec_so" = auto ; then
7077 _libavcodec_so=no
7078 _res_comment="libavcodec.so is discouraged over static libavcodec"
7079 cat > $TMPC << EOF
7080 #include <libavcodec/avcodec.h>
7081 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
7083 if $_pkg_config --exists libavcodec ; then
7084 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
7085 _ld_tmp=$($_pkg_config --libs libavcodec)
7086 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7087 && _libavcodec_so=yes
7088 elif cc_check -lavcodec $_ld_lm ; then
7089 extra_ldflags="$extra_ldflags -lavcodec"
7090 _libavcodec_so=yes
7091 _res_comment="using libavcodec.so, but static libavcodec is recommended"
7094 _libavcodec=no
7095 def_libavcodec='#undef CONFIG_LIBAVCODEC'
7096 def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
7097 def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
7098 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
7099 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
7100 test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
7101 test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
7102 test "$_libavcodec_mpegaudio_hp" = yes \
7103 && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1'
7104 if test "$_libavcodec_a" = yes ; then
7105 _codecmodules="libavcodec(internal) $_codecmodules"
7106 elif test "$_libavcodec_so" = yes ; then
7107 _codecmodules="libavcodec.so $_codecmodules"
7108 else
7109 _nocodecmodules="libavcodec $_nocodecmodules"
7111 echores "$_libavcodec"
7113 echocheck "FFmpeg libavformat"
7114 if test "$_libavformat_a" = auto ; then
7115 _libavformat_a=no
7116 if test -d libavformat && test -f libavformat/utils.c ; then
7117 _libavformat_a=yes
7118 _res_comment="static"
7120 elif test "$_libavformat_so" = auto ; then
7121 _libavformat_so=no
7122 cat > $TMPC <<EOF
7123 #include <libavformat/avformat.h>
7124 #include <libavcodec/opt.h>
7125 int main(void) { av_alloc_format_context(); return 0; }
7127 if $_pkg_config --exists libavformat ; then
7128 _inc_libavformat=$($_pkg_config --cflags libavformat)
7129 _ld_tmp=$($_pkg_config --libs libavformat)
7130 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7131 && _libavformat_so=yes
7132 elif cc_check $_ld_lm -lavformat ; then
7133 extra_ldflags="$extra_ldflags -lavformat"
7134 _libavformat_so=yes
7135 _res_comment="using libavformat.so, but static libavformat is recommended"
7138 _libavformat=no
7139 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7140 def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
7141 def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
7142 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
7143 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7144 test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
7145 test "$_libavformat_so" = yes \
7146 && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
7147 echores "$_libavformat"
7149 echocheck "FFmpeg libpostproc"
7150 if test "$_libpostproc_a" = auto ; then
7151 _libpostproc_a=no
7152 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
7153 _libpostproc_a='yes'
7154 _res_comment="static"
7156 elif test "$_libpostproc_so" = auto ; then
7157 _libpostproc_so=no
7158 cat > $TMPC << EOF
7159 #include <inttypes.h>
7160 #include <libpostproc/postprocess.h>
7161 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7163 if cc_check -lpostproc $_ld_lm ; then
7164 extra_ldflags="$extra_ldflags -lpostproc"
7165 _libpostproc_so=yes
7166 _res_comment="using libpostproc.so, but static libpostproc is recommended"
7169 _libpostproc=no
7170 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7171 def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
7172 def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
7173 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
7174 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7175 test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
7176 test "$_libpostproc_so" = yes \
7177 && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
7178 echores "$_libpostproc"
7180 echocheck "FFmpeg libswscale"
7181 if test "$_libswscale_a" = auto ; then
7182 _libswscale_a=no
7183 if test -d libswscale && test -f libswscale/swscale.h ; then
7184 _libswscale_a='yes'
7185 _res_comment="static"
7187 elif test "$_libswscale_so" = auto ; then
7188 _libswscale_so=no
7189 _res_comment="using libswscale.so, but static libswscale is recommended"
7190 cat > $TMPC << EOF
7191 #include <libswscale/swscale.h>
7192 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7194 if $_pkg_config --exists libswscale ; then
7195 _inc_libswscale=$($_pkg_config --cflags libswscale)
7196 _ld_tmp=$($_pkg_config --libs libswscale)
7197 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7198 && _libswscale_so=yes
7199 elif cc_check -lswscale ; then
7200 extra_ldflags="$extra_ldflags -lswscale"
7201 _libswscale_so=yes
7204 _libswscale=no
7205 def_libswscale='#undef CONFIG_LIBSWSCALE'
7206 def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
7207 def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
7208 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
7209 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7210 test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
7211 test "$_libswscale_so" = yes \
7212 && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
7213 echores "$_libswscale"
7215 echocheck "libopencore_amr narrowband"
7216 if test "$_libopencore_amrnb" = auto ; then
7217 _libopencore_amrnb=no
7218 cat > $TMPC << EOF
7219 #include <opencore-amrnb/interf_dec.h>
7220 int main(void) { Decoder_Interface_init(); return 0; }
7222 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7223 if test "$_libavcodec_a" != yes ; then
7224 _libopencore_amrnb=no
7225 _res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
7228 if test "$_libopencore_amrnb" = yes ; then
7229 _libopencore_amr=yes
7230 extra_ldflags="$extra_ldflags -lopencore-amrnb"
7231 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
7232 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
7233 _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
7234 _codecmodules="libopencore_amrnb $_codecmodules"
7235 else
7236 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
7237 _nocodecmodules="libopencore_amrnb $_nocodecmodules"
7239 echores "$_libopencore_amrnb"
7242 echocheck "libopencore_amr wideband"
7243 if test "$_libopencore_amrwb" = auto ; then
7244 _libopencore_amrwb=no
7245 cat > $TMPC << EOF
7246 #include <opencore-amrwb/dec_if.h>
7247 int main(void) { D_IF_init(); return 0; }
7249 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7250 if test "$_libavcodec_a" != yes ; then
7251 _libopencore_amrwb=no
7252 _res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
7255 if test "$_libopencore_amrwb" = yes ; then
7256 _libopencore_amr=yes
7257 extra_ldflags="$extra_ldflags -lopencore-amrwb"
7258 def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
7259 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
7260 _libavencoders="$_libavencoders LIBOPENCORE_AMRWB_DECODER"
7261 _codecmodules="libopencore_amrwb $_codecmodules"
7262 else
7263 def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
7264 _nocodecmodules="libopencore_amrwb $_nocodecmodules"
7266 echores "$_libopencore_amrwb"
7268 echocheck "libdv-0.9.5+"
7269 if test "$_libdv" = auto ; then
7270 _libdv=no
7271 cat > $TMPC <<EOF
7272 #include <libdv/dv.h>
7273 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7275 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7277 if test "$_libdv" = yes ; then
7278 def_libdv='#define CONFIG_LIBDV095 1'
7279 extra_ldflags="$extra_ldflags -ldv"
7280 _codecmodules="libdv $_codecmodules"
7281 else
7282 def_libdv='#undef CONFIG_LIBDV095'
7283 _nocodecmodules="libdv $_nocodecmodules"
7285 echores "$_libdv"
7288 echocheck "Xvid"
7289 if test "$_xvid" = auto ; then
7290 _xvid=no
7291 cat > $TMPC << EOF
7292 #include <xvid.h>
7293 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7295 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7296 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7297 done
7300 if test "$_xvid" = yes ; then
7301 def_xvid='#define CONFIG_XVID4 1'
7302 _codecmodules="xvid $_codecmodules"
7303 else
7304 def_xvid='#undef CONFIG_XVID4'
7305 _nocodecmodules="xvid $_nocodecmodules"
7307 echores "$_xvid"
7309 echocheck "Xvid two pass plugin"
7310 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7311 cat > $TMPC << EOF
7312 #include <xvid.h>
7313 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7315 cc_check && _xvid_lavc=yes
7317 if test "$_xvid_lavc" = yes ; then
7318 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7319 _libavencoders="$_libavencoders LIBXVID_ENCODER"
7320 else
7321 _xvid_lavc=no
7322 def_xvid_lavc='#define CONFIG_LIBXVID 0'
7324 echores "$_xvid_lavc"
7327 echocheck "x264"
7328 if test "$_x264" = auto ; then
7329 cat > $TMPC << EOF
7330 #include <inttypes.h>
7331 #include <x264.h>
7332 #if X264_BUILD < 79
7333 #error We do not support old versions of x264. Get the latest from git.
7334 #endif
7335 int main(void) { x264_encoder_open((void*)0); return 0; }
7337 _x264=no
7338 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7339 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7340 done
7343 if test "$_x264" = yes ; then
7344 def_x264='#define CONFIG_X264 1'
7345 _codecmodules="x264 $_codecmodules"
7346 test "$_x264_lavc" = auto && _x264_lavc=yes
7347 if test "$_x264_lavc" = yes ; then
7348 def_x264_lavc='#define CONFIG_LIBX264 1'
7349 libs_mplayer="$libs_mplayer $_ld_x264"
7350 _libavencoders="$_libavencoders LIBX264_ENCODER"
7352 else
7353 _x264_lavc=no
7354 def_x264='#undef CONFIG_X264'
7355 def_x264_lavc='#define CONFIG_LIBX264 0'
7356 _nocodecmodules="x264 $_nocodecmodules"
7358 _res_comment="in libavcodec: $_x264_lavc"
7359 echores "$_x264"
7362 echocheck "libdirac"
7363 if test "$_libdirac_lavc" = auto; then
7364 _libdirac_lavc=no
7365 if test "$_libavcodec_a" != yes; then
7366 _res_comment="libavcodec (static) is required by libdirac, sorry"
7367 else
7368 cat > $TMPC << EOF
7369 #include <libdirac_encoder/dirac_encoder.h>
7370 #include <libdirac_decoder/dirac_parser.h>
7371 int main(void)
7373 dirac_encoder_context_t enc_ctx;
7374 dirac_decoder_t *dec_handle;
7375 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
7376 dec_handle = dirac_decoder_init(0);
7377 if (dec_handle)
7378 dirac_decoder_close(dec_handle);
7379 return 0;
7382 if $_pkg_config --exists dirac ; then
7383 _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
7384 _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
7385 cc_check $_inc_dirac $_ld_dirac &&
7386 _libdirac_lavc=yes &&
7387 extra_cflags="$extra_cflags $_inc_dirac" &&
7388 extra_ldflags="$extra_ldflags $_ld_dirac"
7392 if test "$_libdirac_lavc" = yes ; then
7393 def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
7394 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
7395 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
7396 _codecmodules="libdirac $_codecmodules"
7397 else
7398 def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
7399 _nocodecmodules="libdirac $_nocodecmodules"
7401 echores "$_libdirac_lavc"
7404 echocheck "libschroedinger"
7405 if test "$_libschroedinger_lavc" = auto ; then
7406 _libschroedinger_lavc=no
7407 if test "$_libavcodec_a" != yes; then
7408 _res_comment="libavcodec (static) is required by libschroedinger, sorry"
7409 else
7410 cat > $TMPC << EOF
7411 #include <schroedinger/schro.h>
7412 int main(void) { schro_init(); return 0; }
7414 if $_pkg_config --exists schroedinger-1.0 ; then
7415 _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
7416 _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
7417 cc_check $_inc_schroedinger $_ld_schroedinger &&
7418 _libschroedinger_lavc=yes &&
7419 extra_cflags="$extra_cflags $_inc_schroedinger" &&
7420 extra_ldflags="$extra_ldflags $_ld_schroedinger"
7424 if test "$_libschroedinger_lavc" = yes ; then
7425 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
7426 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
7427 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
7428 _codecmodules="libschroedinger $_codecmodules"
7429 else
7430 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
7431 _nocodecmodules="libschroedinger $_nocodecmodules"
7433 echores "$_libschroedinger_lavc"
7435 echocheck "libnut"
7436 if test "$_libnut" = auto ; then
7437 cat > $TMPC << EOF
7438 #include <stdio.h>
7439 #include <stdlib.h>
7440 #include <inttypes.h>
7441 #include <libnut.h>
7442 nut_context_tt * nut;
7443 int main(void) { (void)nut_error(0); return 0; }
7445 _libnut=no
7446 cc_check -lnut && _libnut=yes
7449 if test "$_libnut" = yes ; then
7450 def_libnut='#define CONFIG_LIBNUT 1'
7451 extra_ldflags="$extra_ldflags -lnut"
7452 else
7453 def_libnut='#undef CONFIG_LIBNUT'
7455 echores "$_libnut"
7457 #check must be done after libavcodec one
7458 echocheck "zr"
7459 if test "$_zr" = auto ; then
7460 #36067's seem to identify themselves as 36057PQC's, so the line
7461 #below should work for 36067's and 36057's.
7462 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7463 _zr=yes
7464 else
7465 _zr=no
7468 if test "$_zr" = yes ; then
7469 if test "$_libavcodec_a" = yes ; then
7470 def_zr='#define CONFIG_ZR 1'
7471 _vomodules="zr zr2 $_vomodules"
7472 else
7473 _res_comment="libavcodec (static) is required by zr, sorry"
7474 _novomodules="zr $_novomodules"
7475 def_zr='#undef CONFIG_ZR'
7477 else
7478 def_zr='#undef CONFIG_ZR'
7479 _novomodules="zr zr2 $_novomodules"
7481 echores "$_zr"
7483 # mencoder requires (optional) those libs: libmp3lame
7484 if test "$_mencoder" != no ; then
7486 echocheck "libmp3lame"
7487 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7488 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7489 if test "$_mp3lame" = auto ; then
7490 _mp3lame=no
7491 cat > $TMPC <<EOF
7492 #include <lame/lame.h>
7493 int main(void) { lame_version_t lv; (void) lame_init();
7494 get_lame_version_numerical(&lv);
7495 return 0; }
7497 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7499 if test "$_mp3lame" = yes ; then
7500 def_mp3lame="#define CONFIG_MP3LAME 1"
7501 _ld_mp3lame=-lmp3lame
7502 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7503 cat > $TMPC << EOF
7504 #include <lame/lame.h>
7505 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7507 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7508 cat > $TMPC << EOF
7509 #include <lame/lame.h>
7510 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7512 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7513 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7514 if test "$_mp3lame_lavc" = yes ; then
7515 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7516 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
7517 libs_mplayer="$libs_mplayer $_ld_mp3lame"
7519 else
7520 _mp3lame_lavc=no
7521 def_mp3lame='#undef CONFIG_MP3LAME'
7522 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
7524 _res_comment="in libavcodec: $_mp3lame_lavc"
7525 echores "$_mp3lame"
7527 fi # test "$_mencoder" != no
7529 echocheck "mencoder"
7530 if test "$_mencoder" = yes ; then
7531 def_muxers='#define CONFIG_MUXERS 1'
7532 else
7533 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot
7534 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
7535 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
7536 _libavmuxers=""
7537 def_muxers='#define CONFIG_MUXERS 0'
7539 echores "$_mencoder"
7542 echocheck "UnRAR executable"
7543 if test "$_unrar_exec" = auto ; then
7544 _unrar_exec="yes"
7545 mingw32 && _unrar_exec="no"
7547 if test "$_unrar_exec" = yes ; then
7548 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7549 else
7550 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7552 echores "$_unrar_exec"
7554 echocheck "TV interface"
7555 if test "$_tv" = yes ; then
7556 def_tv='#define CONFIG_TV 1'
7557 _inputmodules="tv $_inputmodules"
7558 else
7559 _noinputmodules="tv $_noinputmodules"
7560 def_tv='#undef CONFIG_TV'
7562 echores "$_tv"
7565 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7566 echocheck "*BSD BT848 bt8xx header"
7567 _ioctl_bt848_h=no
7568 for file in "machine/ioctl_bt848.h" \
7569 "dev/bktr/ioctl_bt848.h" \
7570 "dev/video/bktr/ioctl_bt848.h" \
7571 "dev/ic/bt8xx.h" ; do
7572 cat > $TMPC <<EOF
7573 #include <sys/types.h>
7574 #include <sys/ioctl.h>
7575 #include <$file>
7576 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7578 if cc_check ; then
7579 _ioctl_bt848_h=yes
7580 _ioctl_bt848_h_name="$file"
7581 break;
7583 done
7584 if test "$_ioctl_bt848_h" = yes ; then
7585 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7586 _res_comment="using $_ioctl_bt848_h_name"
7587 else
7588 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7590 echores "$_ioctl_bt848_h"
7592 echocheck "*BSD ioctl_meteor.h"
7593 _ioctl_meteor_h=no
7594 for file in "machine/ioctl_meteor.h" \
7595 "dev/bktr/ioctl_meteor.h" \
7596 "dev/video/bktr/ioctl_meteor.h" ; do
7597 cat > $TMPC <<EOF
7598 #include <sys/types.h>
7599 #include <$file>
7600 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7602 if cc_check ; then
7603 _ioctl_meteor_h=yes
7604 _ioctl_meteor_h_name="$file"
7605 break;
7607 done
7608 if test "$_ioctl_meteor_h" = yes ; then
7609 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7610 _res_comment="using $_ioctl_meteor_h_name"
7611 else
7612 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7614 echores "$_ioctl_meteor_h"
7616 echocheck "*BSD BrookTree 848 TV interface"
7617 if test "$_tv_bsdbt848" = auto ; then
7618 _tv_bsdbt848=no
7619 if test "$_tv" = yes ; then
7620 cat > $TMPC <<EOF
7621 #include <sys/types.h>
7622 $def_ioctl_meteor_h_name
7623 $def_ioctl_bt848_h_name
7624 #ifdef IOCTL_METEOR_H_NAME
7625 #include IOCTL_METEOR_H_NAME
7626 #endif
7627 #ifdef IOCTL_BT848_H_NAME
7628 #include IOCTL_BT848_H_NAME
7629 #endif
7630 int main(void) {
7631 ioctl(0, METEORSINPUT, 0);
7632 ioctl(0, TVTUNER_GETFREQ, 0);
7633 return 0;
7636 cc_check && _tv_bsdbt848=yes
7639 if test "$_tv_bsdbt848" = yes ; then
7640 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7641 _inputmodules="tv-bsdbt848 $_inputmodules"
7642 else
7643 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7644 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7646 echores "$_tv_bsdbt848"
7647 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7650 echocheck "DirectShow TV interface"
7651 if test "$_tv_dshow" = auto ; then
7652 _tv_dshow=no
7653 if test "$_tv" = yes && win32 ; then
7654 cat > $TMPC <<EOF
7655 #include <ole2.h>
7656 int main(void) {
7657 void* p;
7658 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7659 return 0;
7662 cc_check -lole32 -luuid && _tv_dshow=yes
7665 if test "$_tv_dshow" = yes ; then
7666 _inputmodules="tv-dshow $_inputmodules"
7667 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7668 extra_ldflags="$extra_ldflags -lole32 -luuid"
7669 else
7670 _noinputmodules="tv-dshow $_noinputmodules"
7671 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7673 echores "$_tv_dshow"
7676 echocheck "Video 4 Linux TV interface"
7677 if test "$_tv_v4l1" = auto ; then
7678 _tv_v4l1=no
7679 if test "$_tv" = yes && linux ; then
7680 cat > $TMPC <<EOF
7681 #include <stdlib.h>
7682 #include <linux/videodev.h>
7683 int main(void) { return 0; }
7685 cc_check && _tv_v4l1=yes
7688 if test "$_tv_v4l1" = yes ; then
7689 _audio_input=yes
7690 _tv_v4l=yes
7691 def_tv_v4l='#define CONFIG_TV_V4L 1'
7692 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7693 _inputmodules="tv-v4l $_inputmodules"
7694 else
7695 _noinputmodules="tv-v4l1 $_noinputmodules"
7696 def_tv_v4l='#undef CONFIG_TV_V4L'
7698 echores "$_tv_v4l1"
7701 echocheck "Video 4 Linux 2 TV interface"
7702 if test "$_tv_v4l2" = auto ; then
7703 _tv_v4l2=no
7704 if test "$_tv" = yes && linux ; then
7705 cat > $TMPC <<EOF
7706 #include <stdlib.h>
7707 #include <linux/types.h>
7708 #include <linux/videodev2.h>
7709 int main(void) { return 0; }
7711 cc_check && _tv_v4l2=yes
7714 if test "$_tv_v4l2" = yes ; then
7715 _audio_input=yes
7716 _tv_v4l=yes
7717 def_tv_v4l='#define CONFIG_TV_V4L 1'
7718 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7719 _inputmodules="tv-v4l2 $_inputmodules"
7720 else
7721 _noinputmodules="tv-v4l2 $_noinputmodules"
7722 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7724 echores "$_tv_v4l2"
7727 echocheck "Radio interface"
7728 if test "$_radio" = yes ; then
7729 def_radio='#define CONFIG_RADIO 1'
7730 _inputmodules="radio $_inputmodules"
7731 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7732 _radio_capture=no
7734 if test "$_radio_capture" = yes ; then
7735 _audio_input=yes
7736 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7737 else
7738 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7740 else
7741 _noinputmodules="radio $_noinputmodules"
7742 def_radio='#undef CONFIG_RADIO'
7743 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7744 _radio_capture=no
7746 echores "$_radio"
7747 echocheck "Capture for Radio interface"
7748 echores "$_radio_capture"
7750 echocheck "Video 4 Linux 2 Radio interface"
7751 if test "$_radio_v4l2" = auto ; then
7752 _radio_v4l2=no
7753 if test "$_radio" = yes && linux ; then
7754 cat > $TMPC <<EOF
7755 #include <stdlib.h>
7756 #include <linux/types.h>
7757 #include <linux/videodev2.h>
7758 int main(void) { return 0; }
7760 cc_check && _radio_v4l2=yes
7763 if test "$_radio_v4l2" = yes ; then
7764 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7765 else
7766 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7768 echores "$_radio_v4l2"
7770 echocheck "Video 4 Linux Radio interface"
7771 if test "$_radio_v4l" = auto ; then
7772 _radio_v4l=no
7773 if test "$_radio" = yes && linux ; then
7774 cat > $TMPC <<EOF
7775 #include <stdlib.h>
7776 #include <linux/videodev.h>
7777 int main(void) { return 0; }
7779 cc_check && _radio_v4l=yes
7782 if test "$_radio_v4l" = yes ; then
7783 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7784 else
7785 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7787 echores "$_radio_v4l"
7789 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7790 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7791 echocheck "*BSD BrookTree 848 Radio interface"
7792 _radio_bsdbt848=no
7793 cat > $TMPC <<EOF
7794 #include <sys/types.h>
7795 $def_ioctl_bt848_h_name
7796 #ifdef IOCTL_BT848_H_NAME
7797 #include IOCTL_BT848_H_NAME
7798 #endif
7799 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7801 cc_check && _radio_bsdbt848=yes
7802 echores "$_radio_bsdbt848"
7803 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7805 if test "$_radio_bsdbt848" = yes ; then
7806 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7807 else
7808 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7811 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7812 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7813 die "Radio driver requires BSD BT848, V4L or V4L2!"
7816 echocheck "Video 4 Linux 2 MPEG PVR interface"
7817 if test "$_pvr" = auto ; then
7818 _pvr=no
7819 if test "$_tv_v4l2" = yes && linux ; then
7820 cat > $TMPC <<EOF
7821 #include <stdlib.h>
7822 #include <inttypes.h>
7823 #include <linux/types.h>
7824 #include <linux/videodev2.h>
7825 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7827 cc_check && _pvr=yes
7830 if test "$_pvr" = yes ; then
7831 def_pvr='#define CONFIG_PVR 1'
7832 _inputmodules="pvr $_inputmodules"
7833 else
7834 _noinputmodules="pvr $_noinputmodules"
7835 def_pvr='#undef CONFIG_PVR'
7837 echores "$_pvr"
7840 echocheck "ftp"
7841 if ! beos && test "$_ftp" = yes ; then
7842 def_ftp='#define CONFIG_FTP 1'
7843 _inputmodules="ftp $_inputmodules"
7844 else
7845 _noinputmodules="ftp $_noinputmodules"
7846 def_ftp='#undef CONFIG_FTP'
7848 echores "$_ftp"
7850 echocheck "vstream client"
7851 if test "$_vstream" = auto ; then
7852 _vstream=no
7853 cat > $TMPC <<EOF
7854 #include <vstream-client.h>
7855 void vstream_error(const char *format, ... ) {}
7856 int main(void) { vstream_start(); return 0; }
7858 cc_check -lvstream-client && _vstream=yes
7860 if test "$_vstream" = yes ; then
7861 def_vstream='#define CONFIG_VSTREAM 1'
7862 _inputmodules="vstream $_inputmodules"
7863 extra_ldflags="$extra_ldflags -lvstream-client"
7864 else
7865 _noinputmodules="vstream $_noinputmodules"
7866 def_vstream='#undef CONFIG_VSTREAM'
7868 echores "$_vstream"
7871 echocheck "OSD menu"
7872 if test "$_menu" = yes ; then
7873 def_menu='#define CONFIG_MENU 1'
7874 test $_dvbin = "yes" && _menu_dvbin=yes
7875 else
7876 def_menu='#undef CONFIG_MENU'
7877 _menu_dvbin=no
7879 echores "$_menu"
7882 echocheck "Subtitles sorting"
7883 if test "$_sortsub" = yes ; then
7884 def_sortsub='#define CONFIG_SORTSUB 1'
7885 else
7886 def_sortsub='#undef CONFIG_SORTSUB'
7888 echores "$_sortsub"
7891 echocheck "XMMS inputplugin support"
7892 if test "$_xmms" = yes ; then
7893 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7894 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7895 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7896 else
7897 _xmmsplugindir=/usr/lib/xmms/Input
7898 _xmmslibdir=/usr/lib
7901 def_xmms='#define CONFIG_XMMS 1'
7902 if darwin ; then
7903 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7904 else
7905 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7907 else
7908 def_xmms='#undef CONFIG_XMMS'
7910 echores "$_xmms"
7913 # --------------- GUI specific tests begin -------------------
7914 echocheck "GUI"
7915 echo "$_gui"
7916 if test "$_gui" = yes ; then
7918 # Required libraries
7919 if test "$_libavcodec" != yes ||
7920 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
7921 die "The GUI requires libavcodec with PNG support (needs zlib)."
7923 test "$_freetype" = no && test "$_bitmap_font" = no && \
7924 die "The GUI requires either FreeType or bitmap font support."
7925 if ! win32 ; then
7926 _gui_gtk=yes
7927 test "$_x11" != yes && die "X11 support required for GUI compilation."
7929 echocheck "XShape extension"
7930 if test "$_xshape" = auto ; then
7931 _xshape=no
7932 cat > $TMPC << EOF
7933 #include <X11/Xlib.h>
7934 #include <X11/Xproto.h>
7935 #include <X11/Xutil.h>
7936 #include <X11/extensions/shape.h>
7937 #include <stdlib.h>
7938 int main(void) {
7939 char *name = ":0.0";
7940 Display *wsDisplay;
7941 int exitvar = 0;
7942 int eventbase, errorbase;
7943 if (getenv("DISPLAY"))
7944 name=getenv("DISPLAY");
7945 wsDisplay=XOpenDisplay(name);
7946 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
7947 exitvar=1;
7948 XCloseDisplay(wsDisplay);
7949 return exitvar;
7952 cc_check -lXext && _xshape=yes
7954 if test "$_xshape" = yes ; then
7955 def_xshape='#define CONFIG_XSHAPE 1'
7956 else
7957 die "The GUI requires the X11 extension XShape (which was not found)."
7959 echores "$_xshape"
7961 #Check for GTK
7962 if test "$_gtk1" = no ; then
7963 #Check for GTK2 :
7964 echocheck "GTK+ version"
7966 if $_pkg_config gtk+-2.0 --exists ; then
7967 _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
7968 extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
7969 libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
7970 echores "$_gtk"
7972 # Check for GLIB2
7973 if $_pkg_config glib-2.0 --exists ; then
7974 echocheck "glib version"
7975 _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
7976 libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
7977 echores "$_glib"
7979 def_gui='#define CONFIG_GUI 1'
7980 def_gtk2='#define CONFIG_GTK2 1'
7981 else
7982 _gtk1=yes
7983 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
7985 else
7986 echo "GTK-2 devel packages were not found, trying GTK 1.2"
7987 _gtk1=yes
7991 if test "$_gtk1" = yes ; then
7992 # Check for old GTK (1.2.x)
7993 echocheck "GTK version"
7994 if test -z "$_gtkconfig" ; then
7995 if ( gtk-config --version ) >/dev/null 2>&1 ; then
7996 _gtkconfig="gtk-config"
7997 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
7998 _gtkconfig="gtk12-config"
7999 else
8000 die "The GUI requires GTK devel packages (which were not found)."
8003 _gtk=$($_gtkconfig --version 2>&1)
8004 extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
8005 libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
8006 echores "$_gtk (using $_gtkconfig)"
8008 # Check for GLIB
8009 echocheck "glib version"
8010 if test -z "$_glibconfig" ; then
8011 if ( glib-config --version ) >/dev/null 2>&1 ; then
8012 _glibconfig="glib-config"
8013 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
8014 _glibconfig="glib12-config"
8015 else
8016 die "The GUI requires GLIB devel packages (which were not found)"
8019 _glib=$($_glibconfig --version 2>&1)
8020 libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
8021 echores "$_glib (using $_glibconfig)"
8023 def_gui='#define CONFIG_GUI 1'
8024 def_gtk2='#undef CONFIG_GTK2'
8027 else #if ! win32
8028 _gui_win32=yes
8029 libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
8030 def_gui='#define CONFIG_GUI 1'
8031 def_gtk2='#undef CONFIG_GTK2'
8032 fi #if ! win32
8034 else #if test "$_gui"
8035 def_gui='#undef CONFIG_GUI'
8036 def_gtk2='#undef CONFIG_GTK2'
8037 fi #if test "$_gui"
8038 # --------------- GUI specific tests end -------------------
8041 if test "$_charset" != "noconv" ; then
8042 def_charset="#define MSG_CHARSET \"$_charset\""
8043 else
8044 def_charset="#undef MSG_CHARSET"
8045 _charset="UTF-8"
8048 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
8049 echocheck "iconv program"
8050 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
8051 if test "$?" -ne 0 ; then
8052 echores "no"
8053 echo "No working iconv program found, use "
8054 echo "--charset=UTF-8 to continue anyway."
8055 echo "If you also have problems with iconv library functions use --charset=noconv."
8056 echo "Messages in the GTK-2 interface will be broken then."
8057 exit 1
8058 else
8059 echores "yes"
8063 #############################################################################
8065 echocheck "automatic gdb attach"
8066 if test "$_crash_debug" = yes ; then
8067 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
8068 else
8069 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
8070 _crash_debug=no
8072 echores "$_crash_debug"
8074 echocheck "compiler support for noexecstack"
8075 cat > $TMPC <<EOF
8076 int main(void) { return 0; }
8078 if cc_check -Wl,-z,noexecstack ; then
8079 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
8080 echores "yes"
8081 else
8082 echores "no"
8086 # Dynamic linking flags
8087 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
8088 _ld_dl_dynamic=''
8089 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
8090 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
8091 _ld_dl_dynamic='-rdynamic'
8094 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
8095 bsdos && extra_ldflags="$extra_ldflags -ldvd"
8096 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
8098 def_debug='#undef MP_DEBUG'
8099 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
8102 echocheck "joystick"
8103 def_joystick='#undef CONFIG_JOYSTICK'
8104 if test "$_joystick" = yes ; then
8105 if linux ; then
8106 # TODO add some check
8107 def_joystick='#define CONFIG_JOYSTICK 1'
8108 else
8109 _joystick="no"
8110 _res_comment="unsupported under $system_name"
8113 echores "$_joystick"
8115 echocheck "lirc"
8116 if test "$_lirc" = auto ; then
8117 _lirc=no
8118 cat > $TMPC <<EOF
8119 #include <lirc/lirc_client.h>
8120 int main(void) { return 0; }
8122 cc_check -llirc_client && _lirc=yes
8124 if test "$_lirc" = yes ; then
8125 def_lirc='#define CONFIG_LIRC 1'
8126 libs_mplayer="$libs_mplayer -llirc_client"
8127 else
8128 def_lirc='#undef CONFIG_LIRC'
8130 echores "$_lirc"
8132 echocheck "lircc"
8133 if test "$_lircc" = auto ; then
8134 _lircc=no
8135 cat > $TMPC <<EOF
8136 #include <lirc/lircc.h>
8137 int main(void) { return 0; }
8139 cc_check -llircc && _lircc=yes
8141 if test "$_lircc" = yes ; then
8142 def_lircc='#define CONFIG_LIRCC 1'
8143 libs_mplayer="$libs_mplayer -llircc"
8144 else
8145 def_lircc='#undef CONFIG_LIRCC'
8147 echores "$_lircc"
8149 if arm; then
8150 # Detect maemo development platform libraries availability (http://www.maemo.org),
8151 # they are used when run on Nokia 770|8x0
8152 echocheck "maemo (Nokia 770|8x0)"
8153 if test "$_maemo" = auto ; then
8154 _maemo=no
8155 cat > $TMPC << EOF
8156 #include <libosso.h>
8157 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
8159 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8161 if test "$_maemo" = yes ; then
8162 def_maemo='#define CONFIG_MAEMO 1'
8163 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8164 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
8165 else
8166 def_maemo='#undef CONFIG_MAEMO'
8168 echores "$_maemo"
8171 #############################################################################
8173 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
8174 # the OMF format needs to come after the 'extern symbol prefix' check, which
8175 # uses nm.
8176 if os2 ; then
8177 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
8180 # linker paths should be the same for mencoder and mplayer
8181 _ld_tmp=""
8182 for I in $libs_mplayer ; do
8183 _tmp=$(echo $I | sed -e 's/^-L.*$//')
8184 if test -z "$_tmp" ; then
8185 extra_ldflags="$extra_ldflags $I"
8186 else
8187 _ld_tmp="$_ld_tmp $I"
8189 done
8190 libs_mplayer=$_ld_tmp
8193 #############################################################################
8194 # 64 bit file offsets?
8195 if test "$_largefiles" = yes || freebsd ; then
8196 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
8197 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
8198 # dvdread support requires this (for off64_t)
8199 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
8203 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
8205 # This must be the last test to be performed. Any other tests following it
8206 # could fail due to linker errors. libdvdnavmini is intentionally not linked
8207 # against libdvdread (to permit MPlayer to use its own copy of the library).
8208 # So any compilation using the flags added here but not linking against
8209 # libdvdread can fail.
8210 echocheck "DVD support (libdvdnav)"
8211 dvdnav_internal=no
8212 if test "$_dvdnav" = auto ; then
8213 if test "$_dvdread_internal" = yes ; then
8214 _dvdnav=yes
8215 dvdnav_internal=yes
8216 _res_comment="internal"
8217 else
8218 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
8221 if test "$_dvdnav" = auto ; then
8222 cat > $TMPC <<EOF
8223 #include <inttypes.h>
8224 #include <dvdnav/dvdnav.h>
8225 int main(void) { dvdnav_t *dvd=0; return 0; }
8227 _dvdnav=no
8228 _dvdnavdir=$($_dvdnavconfig --cflags)
8229 _dvdnavlibs=$($_dvdnavconfig --libs)
8230 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
8232 if test "$_dvdnav" = yes ; then
8233 _largefiles=yes
8234 def_dvdnav='#define CONFIG_DVDNAV 1'
8235 if test "$dvdnav_internal" = yes ; then
8236 cflags_libdvdnav="-Ilibdvdnav"
8237 _inputmodules="dvdnav(internal) $_inputmodules"
8238 else
8239 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
8240 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
8241 _inputmodules="dvdnav $_inputmodules"
8243 else
8244 def_dvdnav='#undef CONFIG_DVDNAV'
8245 _noinputmodules="dvdnav $_noinputmodules"
8247 echores "$_dvdnav"
8249 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8250 # Read dvdnav comment above.
8252 #############################################################################
8253 echo "Creating config.mak"
8254 cat > config.mak << EOF
8255 # -------- Generated by configure -----------
8257 # Ensure that locale settings do not interfere with shell commands.
8258 export LC_ALL = C
8260 CONFIGURATION = $_configuration
8262 CHARSET = $_charset
8263 DOC_LANGS = $language_doc
8264 DOC_LANG_ALL = $doc_lang_all
8265 MAN_LANGS = $language_man
8266 MAN_LANG_ALL = $man_lang_all
8268 prefix = \$(DESTDIR)$_prefix
8269 BINDIR = \$(DESTDIR)$_bindir
8270 DATADIR = \$(DESTDIR)$_datadir
8271 LIBDIR = \$(DESTDIR)$_libdir
8272 MANDIR = \$(DESTDIR)$_mandir
8273 CONFDIR = \$(DESTDIR)$_confdir
8275 AR = $_ar
8276 AS = $_cc
8277 CC = $_cc
8278 CXX = $_cc
8279 HOST_CC = $_host_cc
8280 YASM = $_yasm
8281 INSTALL = $_install
8282 INSTALLSTRIP = $_install_strip
8283 RANLIB = $_ranlib
8284 WINDRES = $_windres
8286 CFLAGS = $CFLAGS $extra_cflags
8287 OPTFLAGS = $CFLAGS $extra_cflags
8288 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
8289 CFLAGS_DHAHELPER = $cflags_dhahelper
8290 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
8291 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
8292 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
8293 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
8294 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
8295 CFLAGS_STACKREALIGN = $cflags_stackrealign
8296 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
8297 CFLAGS_TREMOR_LOW = $cflags_tremor_low
8298 YASMFLAGS = $YASMFLAGS
8300 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
8301 EXTRALIBS_MPLAYER = $libs_mplayer
8302 EXTRALIBS_MENCODER = $libs_mencoder
8304 DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
8306 MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.xpm,\$(filter-out %.h,$^)) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
8307 MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.hh,\$(filter-out %.h,$^)) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
8309 GETCH = $_getch
8310 HELP_FILE = $_mp_help
8311 TIMER = $_timer
8313 EXESUF = $_exesuf
8314 EXESUFS_ALL = .exe
8316 $_target_arch
8317 $_target_subarch
8318 $(echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/')
8320 MENCODER = $_mencoder
8321 MPLAYER = $_mplayer
8323 NEED_GETTIMEOFDAY = $_need_gettimeofday
8324 NEED_GLOB = $_need_glob
8325 NEED_MMAP = $_need_mmap
8326 NEED_SETENV = $_need_setenv
8327 NEED_SHMEM = $_need_shmem
8328 NEED_STRSEP = $_need_strsep
8329 NEED_SWAB = $_need_swab
8330 NEED_VSSCANF = $_need_vsscanf
8332 # features
8333 3DFX = $_3dfx
8334 AA = $_aa
8335 ALSA1X = $_alsa1x
8336 ALSA9 = $_alsa9
8337 ALSA5 = $_alsa5
8338 APPLE_IR = $_apple_ir
8339 APPLE_REMOTE = $_apple_remote
8340 ARTS = $_arts
8341 AUDIO_INPUT = $_audio_input
8342 BITMAP_FONT = $_bitmap_font
8343 BL = $_bl
8344 CACA = $_caca
8345 CDDA = $_cdda
8346 CDDB = $_cddb
8347 COREAUDIO = $_coreaudio
8348 COREVIDEO = $_corevideo
8349 DART = $_dart
8350 DFBMGA = $_dfbmga
8351 DGA = $_dga
8352 DIRECT3D = $_direct3d
8353 DIRECTFB = $_directfb
8354 DIRECTX = $_directx
8355 DVBIN = $_dvbin
8356 DVDNAV = $_dvdnav
8357 DVDNAV_INTERNAL = $dvdnav_internal
8358 DVDREAD = $_dvdread
8359 DVDREAD_INTERNAL = $_dvdread_internal
8360 DXR2 = $_dxr2
8361 DXR3 = $_dxr3
8362 ESD = $_esd
8363 FAAC=$_faac
8364 FAAD = $_faad
8365 FAAD_INTERNAL = $_faad_internal
8366 FASTMEMCPY = $_fastmemcpy
8367 FBDEV = $_fbdev
8368 FREETYPE = $_freetype
8369 FTP = $_ftp
8370 GIF = $_gif
8371 GGI = $_ggi
8372 GL = $_gl
8373 GL_WIN32 = $_gl_win32
8374 GL_X11 = $_gl_x11
8375 MATRIXVIEW = $matrixview
8376 GUI = $_gui
8377 GUI_GTK = $_gui_gtk
8378 GUI_WIN32 = $_gui_win32
8379 HAVE_POSIX_SELECT = $_posix_select
8380 HAVE_SYS_MMAN_H = $_mman
8381 IVTV = $_ivtv
8382 JACK = $_jack
8383 JOYSTICK = $_joystick
8384 JPEG = $_jpeg
8385 KVA = $_kva
8386 LADSPA = $_ladspa
8387 LIBA52 = $_liba52
8388 LIBA52_INTERNAL = $_liba52_internal
8389 LIBASS = $_ass
8390 LIBASS_INTERNAL = $ass_internal
8391 LIBBS2B = $_libbs2b
8392 LIBDCA = $_libdca
8393 LIBDV = $_libdv
8394 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
8395 LIBLZO = $_liblzo
8396 LIBMAD = $_mad
8397 LIBMENU = $_menu
8398 LIBMENU_DVBIN = $_menu_dvbin
8399 LIBMPEG2 = $_libmpeg2
8400 LIBNEMESI = $_nemesi
8401 LIBNUT = $_libnut
8402 LIBSMBCLIENT = $_smb
8403 LIBTHEORA = $_theora
8404 LIRC = $_lirc
8405 LIVE555 = $_live
8406 MACOSX_BUNDLE = $_macosx_bundle
8407 MACOSX_FINDER = $_macosx_finder
8408 MD5SUM = $_md5sum
8409 MGA = $_mga
8410 MNG = $_mng
8411 MP3LAME = $_mp3lame
8412 MP3LIB = $_mp3lib
8413 MUSEPACK = $_musepack
8414 NAS = $_nas
8415 NATIVE_RTSP = $_native_rtsp
8416 NETWORK = $_network
8417 OPENAL = $_openal
8418 OSS = $_ossaudio
8419 PE_EXECUTABLE = $_pe_executable
8420 PNG = $_png
8421 PNM = $_pnm
8422 PRIORITY = $_priority
8423 PULSE = $_pulse
8424 PVR = $_pvr
8425 QTX_CODECS = $_qtx
8426 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8427 QTX_EMULATION = $_qtx_emulation
8428 QUARTZ = $_quartz
8429 RADIO=$_radio
8430 RADIO_CAPTURE=$_radio_capture
8431 REAL_CODECS = $_real
8432 S3FB = $_s3fb
8433 SDL = $_sdl
8434 SPEEX = $_speex
8435 STREAM_CACHE = $_stream_cache
8436 SGIAUDIO = $_sgiaudio
8437 SUNAUDIO = $_sunaudio
8438 SVGA = $_svga
8439 TDFXFB = $_tdfxfb
8440 TDFXVID = $_tdfxvid
8441 TGA = $_tga
8442 TOOLAME=$_toolame
8443 TREMOR_INTERNAL = $_tremor_internal
8444 TV = $_tv
8445 TV_BSDBT848 = $_tv_bsdbt848
8446 TV_DSHOW = $_tv_dshow
8447 TV_V4L = $_tv_v4l
8448 TV_V4L1 = $_tv_v4l1
8449 TV_V4L2 = $_tv_v4l2
8450 TWOLAME=$_twolame
8451 UNRAR_EXEC = $_unrar_exec
8452 V4L2 = $_v4l2
8453 VCD = $_vcd
8454 VDPAU = $_vdpau
8455 VESA = $_vesa
8456 VIDIX = $_vidix
8457 VIDIX_PCIDB = $_vidix_pcidb_val
8458 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8459 VIDIX_IVTV=$_vidix_drv_ivtv
8460 VIDIX_MACH64=$_vidix_drv_mach64
8461 VIDIX_MGA=$_vidix_drv_mga
8462 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8463 VIDIX_NVIDIA=$_vidix_drv_nvidia
8464 VIDIX_PM2=$_vidix_drv_pm2
8465 VIDIX_PM3=$_vidix_drv_pm3
8466 VIDIX_RADEON=$_vidix_drv_radeon
8467 VIDIX_RAGE128=$_vidix_drv_rage128
8468 VIDIX_S3=$_vidix_drv_s3
8469 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8470 VIDIX_SIS=$_vidix_drv_sis
8471 VIDIX_UNICHROME=$_vidix_drv_unichrome
8472 VORBIS = $_vorbis
8473 VSTREAM = $_vstream
8474 WII = $_wii
8475 WIN32DLL = $_win32dll
8476 WIN32WAVEOUT = $_win32waveout
8477 WIN32_EMULATION = $_win32_emulation
8478 WINVIDIX = $winvidix
8479 X11 = $_x11
8480 X264 = $_x264
8481 XANIM_CODECS = $_xanim
8482 XMGA = $_xmga
8483 XMMS_PLUGINS = $_xmms
8484 XV = $_xv
8485 XVID4 = $_xvid
8486 XVIDIX = $xvidix
8487 XVMC = $_xvmc
8488 XVR100 = $_xvr100
8489 YUV4MPEG = $_yuv4mpeg
8490 ZR = $_zr
8492 # FFmpeg
8493 LIBAVUTIL = $_libavutil
8494 LIBAVUTIL_A = $_libavutil_a
8495 LIBAVUTIL_SO = $_libavutil_so
8496 LIBAVCODEC = $_libavcodec
8497 LIBAVCODEC_A = $_libavcodec_a
8498 LIBAVCODEC_SO = $_libavcodec_so
8499 LIBAVFORMAT = $_libavformat
8500 LIBAVFORMAT_A = $_libavformat_a
8501 LIBAVFORMAT_SO = $_libavformat_so
8502 LIBPOSTPROC = $_libpostproc
8503 LIBPOSTPROC_A = $_libpostproc_a
8504 LIBPOSTPROC_SO = $_libpostproc_so
8505 LIBSWSCALE = $_libswscale
8506 LIBSWSCALE_A = $_libswscale_a
8507 LIBSWSCALE_SO = $_libswscale_so
8509 CC_O=-o \$@
8510 LD=gcc
8511 CONFIG_STATIC=yes
8512 SRC_PATH=..
8513 BUILD_ROOT=..
8514 LIBPREF=lib
8515 LIBSUF=.a
8516 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
8518 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8519 CONFIG_AANDCT=yes
8520 CONFIG_FFT=yes
8521 CONFIG_FFT_MMX=$fft_mmx
8522 CONFIG_GOLOMB=yes
8523 CONFIG_LPC=yes
8524 CONFIG_MDCT=yes
8525 CONFIG_RDFT=yes
8527 CONFIG_BZLIB=$bzlib
8528 CONFIG_ENCODERS=yes
8529 CONFIG_GPL=yes
8530 CONFIG_LIBDIRAC_DECODER=$_libdirac_lavc
8531 CONFIG_LIBDIRAC_ENCODER=$_libdirac_lavc
8532 CONFIG_LIBFAAC_ENCODER=$_faac_lavc
8533 CONFIG_LIBMP3LAME_ENCODER=$_mp3lame_lavc
8534 CONFIG_LIBOPENCORE_AMRNB_DECODER=$_libopencore_amrnb
8535 CONFIG_LIBOPENCORE_AMRNB_ENCODER=$_libopencore_amrnb
8536 CONFIG_LIBOPENCORE_AMRWB_DECODER=$_libopencore_amrwb
8537 OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
8538 OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
8539 CONFIG_LIBSCHROEDINGER_DECODER=$_libschroedinger_lavc
8540 CONFIG_LIBSCHROEDINGER_ENCODER=$_libschroedinger_lavc
8541 CONFIG_LIBVORBIS_ENCODER=$_libvorbis
8542 CONFIG_LIBX264_ENCODER=$_x264_lavc
8543 CONFIG_LIBXVID_ENCODER=$_xvid_lavc
8544 CONFIG_MLIB = $_mlib
8545 CONFIG_MUXERS=$_mencoder
8546 CONFIG_POSTPROC = yes
8547 # Prevent building libavcodec/imgresample.c with conflicting symbols
8548 CONFIG_SWSCALE=yes
8549 CONFIG_VDPAU=$_vdpau
8550 CONFIG_XVMC=$_xvmc
8551 CONFIG_ZLIB=$_zlib
8553 HAVE_PTHREADS = $_pthreads
8554 HAVE_SHM = $_shm
8555 HAVE_W32THREADS = $_w32threads
8556 HAVE_YASM = $_have_yasm
8558 $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8559 $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8560 $(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8561 $(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8562 $(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8563 $(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8564 $(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8567 #############################################################################
8569 ff_config_enable () {
8570 _nprefix=$3;
8571 test -z "$_nprefix" && _nprefix='CONFIG'
8572 for part in $1; do
8573 if $(echo $2 | grep -q -E "(^| )$part($| )"); then
8574 echo "#define ${_nprefix}_$part 1"
8575 else
8576 echo "#define ${_nprefix}_$part 0"
8578 done
8581 echo "Creating config.h"
8582 cat > $TMPH << EOF
8583 /*----------------------------------------------------------------------------
8584 ** This file has been automatically generated by configure any changes in it
8585 ** will be lost when you run configure again.
8586 ** Instead of modifying definitions here, use the --enable/--disable options
8587 ** of the configure script! See ./configure --help for details.
8588 *---------------------------------------------------------------------------*/
8590 #ifndef MPLAYER_CONFIG_H
8591 #define MPLAYER_CONFIG_H
8593 /* Undefine this if you do not want to select mono audio (left or right)
8594 with a stereo MPEG layer 2/3 audio stream. The command line option
8595 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8596 right-only), with 0 being the default.
8598 #define CONFIG_FAKE_MONO 1
8600 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8601 #define MAX_OUTBURST 65536
8603 /* set up audio OUTBURST. Do not change this! */
8604 #define OUTBURST 512
8606 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8607 #undef FAST_OSD
8608 #undef FAST_OSD_TABLE
8610 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8611 #define MPEG12_POSTPROC 1
8612 #define ATTRIBUTE_ALIGNED_MAX 16
8616 #define CONFIGURATION "$_configuration"
8618 #define MPLAYER_DATADIR "$_datadir"
8619 #define MPLAYER_CONFDIR "$_confdir"
8620 #define MPLAYER_LIBDIR "$_libdir"
8622 /* definitions needed by included libraries */
8623 #define HAVE_INTTYPES_H 1
8624 /* libmpeg2 + FFmpeg */
8625 $def_fast_inttypes
8626 /* libdvdcss */
8627 #define HAVE_ERRNO_H 1
8628 /* libdvdcss + libdvdread */
8629 #define HAVE_LIMITS_H 1
8630 /* libdvdcss + libfaad2 */
8631 #define HAVE_UNISTD_H 1
8632 /* libfaad2 + libdvdread */
8633 #define STDC_HEADERS 1
8634 #define HAVE_MEMCPY 1
8635 /* libfaad2 */
8636 #define HAVE_STRING_H 1
8637 #define HAVE_STRINGS_H 1
8638 #define HAVE_SYS_STAT_H 1
8639 #define HAVE_SYS_TYPES_H 1
8640 /* libdvdnav */
8641 #define READ_CACHE_TRACE 0
8642 /* libdvdread */
8643 #define HAVE_DLFCN_H 1
8644 $def_dvdcss
8647 /* system headers */
8648 $def_alloca_h
8649 $def_alsa_asoundlib_h
8650 $def_altivec_h
8651 $def_malloc_h
8652 $def_mman_h
8653 $def_mman_has_map_failed
8654 $def_soundcard_h
8655 $def_sys_asoundlib_h
8656 $def_sys_soundcard_h
8657 $def_sys_sysinfo_h
8658 $def_termios_h
8659 $def_termios_sys_h
8660 $def_winsock2_h
8663 /* system functions */
8664 $def_gethostbyname2
8665 $def_gettimeofday
8666 $def_glob
8667 $def_langinfo
8668 $def_llrint
8669 $def_log2
8670 $def_lrint
8671 $def_lrintf
8672 $def_map_memalign
8673 $def_memalign
8674 $def_nanosleep
8675 $def_posix_select
8676 $def_round
8677 $def_roundf
8678 $def_select
8679 $def_setenv
8680 $def_shm
8681 $def_strsep
8682 $def_swab
8683 $def_sysi86
8684 $def_sysi86_iv
8685 $def_termcap
8686 $def_termios
8687 $def_truncf
8688 $def_vsscanf
8691 /* system-specific features */
8692 $def_asmalign_pot
8693 $def_builtin_expect
8694 $def_dl
8695 $def_extern_asm
8696 $def_extern_prefix
8697 $def_iconv
8698 $def_kstat
8699 $def_macosx_bundle
8700 $def_macosx_finder
8701 $def_maemo
8702 $def_named_asm_args
8703 $def_priority
8704 $def_quicktime
8705 $def_restrict_keyword
8706 $def_rtc
8707 $def_unrar_exec
8710 /* configurable options */
8711 $def_charset
8712 $def_crash_debug
8713 $def_debug
8714 $def_dynamic_plugins
8715 $def_fastmemcpy
8716 $def_menu
8717 $def_runtime_cpudetection
8718 $def_sighandler
8719 $def_sortsub
8720 $def_stream_cache
8721 $def_pthread_cache
8724 /* CPU stuff */
8725 #define __CPU__ $iproc
8726 $def_words_endian
8727 $def_bigendian
8728 $(ff_config_enable "$_arch_all" "$_arch" "ARCH")
8729 $(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE")
8732 /* DVD/VCD/CD */
8733 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8734 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8735 $def_bsdi_dvd
8736 $def_cddb
8737 $def_cdio
8738 $def_cdparanoia
8739 $def_cdrom
8740 $def_dvd
8741 $def_dvd_bsd
8742 $def_dvd_darwin
8743 $def_dvd_linux
8744 $def_dvd_openbsd
8745 $def_dvdio
8746 $def_dvdnav
8747 $def_dvdread
8748 $def_hpux_scsi_h
8749 $def_libcdio
8750 $def_sol_scsi_h
8751 $def_vcd
8754 /* codec libraries */
8755 $def_faac
8756 $def_faad
8757 $def_faad_internal
8758 $def_liba52
8759 $def_liba52_internal
8760 $def_libdca
8761 $def_libdv
8762 $def_liblzo
8763 $def_libmpeg2
8764 $def_mad
8765 $def_mp3lame
8766 $def_mp3lame_preset
8767 $def_mp3lame_preset_medium
8768 $def_mp3lib
8769 $def_musepack
8770 $def_speex
8771 $def_theora
8772 $def_toolame
8773 $def_tremor
8774 $def_twolame
8775 $def_vorbis
8776 $def_x264
8777 $def_xvid
8778 $def_zlib
8780 $def_libnut
8783 /* binary codecs */
8784 $def_qtx
8785 $def_qtx_win32
8786 $def_real
8787 $def_real_path
8788 $def_win32_loader
8789 $def_win32dll
8790 #define WIN32_PATH "$_win32codecsdir"
8791 $def_xanim
8792 $def_xanim_path
8793 $def_xmms
8794 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8797 /* GUI */
8798 $def_gtk2
8799 $def_gui
8800 $def_xshape
8803 /* Audio output drivers */
8804 $def_alsa
8805 $def_alsa1x
8806 $def_alsa5
8807 $def_alsa9
8808 $def_arts
8809 $def_coreaudio
8810 $def_dart
8811 $def_esd
8812 $def_esd_latency
8813 $def_jack
8814 $def_nas
8815 $def_openal
8816 $def_openal_h
8817 $def_ossaudio
8818 $def_ossaudio_devdsp
8819 $def_ossaudio_devmixer
8820 $def_pulse
8821 $def_sgiaudio
8822 $def_sunaudio
8823 $def_win32waveout
8825 $def_ladspa
8826 $def_libbs2b
8829 /* input */
8830 $def_apple_ir
8831 $def_apple_remote
8832 $def_ioctl_bt848_h_name
8833 $def_ioctl_meteor_h_name
8834 $def_joystick
8835 $def_lirc
8836 $def_lircc
8837 $def_pvr
8838 $def_radio
8839 $def_radio_bsdbt848
8840 $def_radio_capture
8841 $def_radio_v4l
8842 $def_radio_v4l2
8843 $def_tv
8844 $def_tv_bsdbt848
8845 $def_tv_dshow
8846 $def_tv_v4l
8847 $def_tv_v4l1
8848 $def_tv_v4l2
8851 /* font stuff */
8852 $def_ass
8853 $def_ass_internal
8854 $def_bitmap_font
8855 $def_enca
8856 $def_fontconfig
8857 $def_freetype
8858 $def_fribidi
8861 /* networking */
8862 $def_closesocket
8863 $def_ftp
8864 $def_inet6
8865 $def_inet_aton
8866 $def_inet_pton
8867 $def_live
8868 $def_nemesi
8869 $def_network
8870 $def_smb
8871 $def_socklen_t
8872 $def_vstream
8875 /* libvo options */
8876 $def_3dfx
8877 $def_aa
8878 $def_bl
8879 $def_caca
8880 $def_corevideo
8881 $def_dfbmga
8882 $def_dga
8883 $def_dga1
8884 $def_dga2
8885 $def_direct3d
8886 $def_directfb
8887 $def_directfb_version
8888 $def_directx
8889 $def_dvb
8890 $def_dvb_head
8891 $def_dvbin
8892 $def_dxr2
8893 $def_dxr3
8894 $def_fbdev
8895 $def_ggi
8896 $def_ggiwmh
8897 $def_gif
8898 $def_gif_4
8899 $def_gif_tvt_hack
8900 $def_gl
8901 $def_gl_win32
8902 $def_gl_x11
8903 $def_matrixview
8904 $def_ivtv
8905 $def_jpeg
8906 $def_kva
8907 $def_md5sum
8908 $def_mga
8909 $def_mng
8910 $def_png
8911 $def_pnm
8912 $def_quartz
8913 $def_s3fb
8914 $def_sdl
8915 $def_sdl_sdl_h
8916 $def_sdlbuggy
8917 $def_svga
8918 $def_tdfxfb
8919 $def_tdfxvid
8920 $def_tga
8921 $def_v4l2
8922 $def_vdpau
8923 $def_vesa
8924 $def_vidix
8925 $def_vidix_drv_cyberblade
8926 $def_vidix_drv_ivtv
8927 $def_vidix_drv_mach64
8928 $def_vidix_drv_mga
8929 $def_vidix_drv_mga_crtc2
8930 $def_vidix_drv_nvidia
8931 $def_vidix_drv_pm3
8932 $def_vidix_drv_radeon
8933 $def_vidix_drv_rage128
8934 $def_vidix_drv_s3
8935 $def_vidix_drv_sh_veu
8936 $def_vidix_drv_sis
8937 $def_vidix_drv_unichrome
8938 $def_vidix_pfx
8939 $def_vm
8940 $def_wii
8941 $def_x11
8942 $def_xdpms
8943 $def_xf86keysym
8944 $def_xinerama
8945 $def_xmga
8946 $def_xss
8947 $def_xv
8948 $def_xvmc
8949 $def_xvr100
8950 $def_yuv4mpeg
8951 $def_zr
8954 /* FFmpeg */
8955 $def_libavcodec
8956 $def_libavcodec_a
8957 $def_libavcodec_so
8958 $def_libavformat
8959 $def_libavformat_a
8960 $def_libavformat_so
8961 $def_libavutil
8962 $def_libavutil_a
8963 $def_libavutil_so
8964 $def_libpostproc
8965 $def_libpostproc_a
8966 $def_libpostproc_so
8967 $def_libswscale
8968 $def_libswscale_a
8969 $def_libswscale_so
8971 #define CONFIG_DECODERS 1
8972 #define CONFIG_ENCODERS 1
8973 #define CONFIG_DEMUXERS 1
8974 $def_muxers
8976 $def_arpa_inet_h
8977 $def_bswap
8978 $def_bzlib
8979 $def_dcbzl
8980 $def_dos_paths
8981 $def_fast_64bit
8982 $def_fast_unaligned
8983 $def_libavcodec_mpegaudio_hp
8984 $def_memalign_hack
8985 $def_mlib
8986 $def_mkstemp
8987 $def_posix_memalign
8988 $def_pthreads
8989 $def_ten_operands
8990 $def_threads
8991 $def_xform_asm
8992 $def_yasm
8994 #define CONFIG_FASTDIV 0
8995 #define CONFIG_FFSERVER 0
8996 #define CONFIG_GPL 1
8997 #define CONFIG_GRAY 0
8998 #define CONFIG_HARDCODED_TABLES 0
8999 #define CONFIG_LIBVORBIS 0
9000 #define CONFIG_POWERPC_PERF 0
9001 #define CONFIG_SMALL 0
9002 #define CONFIG_SWSCALE 1
9003 #define CONFIG_SWSCALE_ALPHA 1
9005 #ifdef HAVE_AF_INET6
9006 #define CONFIG_IPV6 1
9007 #else
9008 #define CONFIG_IPV6 0
9009 #endif
9011 #define HAVE_ATTRIBUTE_PACKED 1
9012 #define HAVE_GETHRTIME 0
9013 #define HAVE_INLINE_ASM 0
9014 #define HAVE_LDBRX 0
9015 #define HAVE_POLL_H 1
9016 #define HAVE_PPC4XX 0
9017 #define HAVE_SETMODE 0
9018 #define HAVE_SYS_SELECT_H 0
9019 #define HAVE_VIRTUALALLOC 0
9021 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
9022 #define CONFIG_AANDCT 1
9023 #define CONFIG_FFT 1
9024 #define CONFIG_GOLOMB 1
9025 #define CONFIG_LPC 1
9026 #define CONFIG_MDCT 1
9027 #define CONFIG_RDFT 1
9029 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
9030 $def_ebx_available
9031 #ifndef MP_DEBUG
9032 #define HAVE_EBP_AVAILABLE 1
9033 #else
9034 #define HAVE_EBP_AVAILABLE 0
9035 #endif
9037 #define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
9038 #define FFMPEG_LICENSE "GPL version 2 or later"
9040 /* External libraries used through libavcodec. */
9041 $def_faac_lavc
9042 $def_libdirac_lavc
9043 $def_libopencore_amrnb
9044 $def_libopencore_amrwb
9045 $def_libopenjpeg
9046 $def_libschroedinger_lavc
9047 $def_mp3lame_lavc
9048 $def_x264_lavc
9049 $def_xvid_lavc
9051 $(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
9052 $(ff_config_enable "$_libavencoders_all" "$_libavencoders")
9053 $(ff_config_enable "$_libavparsers_all" "$_libavparsers")
9054 $(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
9055 $(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
9056 $(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
9057 $(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
9059 #define CONFIG_H263_VAAPI_HWACCEL 0
9060 #define CONFIG_MPEG2_VAAPI_HWACCEL 0
9061 #define CONFIG_MPEG4_VAAPI_HWACCEL 0
9062 #define CONFIG_H264_VAAPI_HWACCEL 0
9063 #define CONFIG_VC1_VAAPI_HWACCEL 0
9064 #define CONFIG_WMV3_VAAPI_HWACCEL 0
9066 #endif /* MPLAYER_CONFIG_H */
9069 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
9070 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
9072 #############################################################################
9074 cat << EOF
9076 Config files successfully generated by ./configure $_configuration !
9078 Install prefix: $_prefix
9079 Data directory: $_datadir
9080 Config direct.: $_confdir
9082 Byte order: $_byte_order
9083 Optimizing for: $_optimizing
9085 Languages:
9086 Messages/GUI: $language_msg
9087 Manual pages: $language_man
9088 Documentation: $language_doc
9090 Enabled optional drivers:
9091 Input: $_inputmodules
9092 Codecs: $_codecmodules
9093 Audio output: $_aomodules
9094 Video output: $_vomodules
9096 Disabled optional drivers:
9097 Input: $_noinputmodules
9098 Codecs: $_nocodecmodules
9099 Audio output: $_noaomodules
9100 Video output: $_novomodules
9102 'config.h' and 'config.mak' contain your configuration options.
9103 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
9104 compile *** DO NOT REPORT BUGS if you tweak these files ***
9106 'make' will now compile MPlayer and 'make install' will install it.
9107 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
9112 if test "$_mtrr" = yes ; then
9113 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
9114 echo
9117 if ! x86_32; then
9118 cat <<EOF
9119 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
9120 operating system ($system_name). You may encounter a few files that cannot
9121 be played due to missing open source video/audio codec support.
9127 cat <<EOF
9128 Check $TMPLOG if you wonder why an autodetection failed (make sure
9129 development headers/packages are installed).
9131 NOTE: The --enable-* parameters unconditionally force options on, completely
9132 skipping autodetection. This behavior is unlike what you may be used to from
9133 autoconf-based configure scripts that can decide to override you. This greater
9134 level of control comes at a price. You may have to provide the correct compiler
9135 and linker flags yourself.
9136 If you used one of these options (except --enable-gui and similar ones that
9137 turn on internal features) and experience a compilation or linking failure,
9138 make sure you have passed the necessary compiler/linker flags to configure.
9140 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
9144 if test "$_warn_CFLAGS" = yes; then
9145 cat <<EOF
9147 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
9148 but:
9150 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
9152 It is strongly recommended to let MPlayer choose the correct CFLAGS!
9153 To do so, execute 'CFLAGS= ./configure <options>'
9158 # Last move:
9159 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"