added a missing full stop
[mplayer.git] / configure
blob57466c0ce5a0d388337fbcaacc782f62a66a4d68
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 --enable-liba52-internal enable builtin liba52 [disabled]
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-hardcoded-tables put tables in binary instead of calculating them at startup [disable]
479 --enable-big-endian force byte order to big-endian [autodetect]
480 --enable-debug[=1-3] compile-in debugging information [disable]
481 --enable-profile compile-in profiling information [disable]
482 --disable-sighandler disable sighandler for crashes [enable]
483 --enable-crash-debug enable automatic gdb attach on crash [disable]
484 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
486 Use these options if autodetection fails:
487 --extra-cflags=FLAGS extra CFLAGS
488 --extra-ldflags=FLAGS extra LDFLAGS
489 --extra-libs=FLAGS extra linker flags
490 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
491 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
492 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
494 --with-freetype-config=PATH path to freetype-config
495 --with-fribidi-config=PATH path to fribidi-config
496 --with-glib-config=PATH path to glib*-config
497 --with-gtk-config=PATH path to gtk*-config
498 --with-sdl-config=PATH path to sdl*-config
499 --with-dvdnav-config=PATH path to dvdnav-config
500 --with-dvdread-config=PATH path to dvdread-config
502 This configure script is NOT autoconf-based, even though its output is similar.
503 It will try to autodetect all configuration options. If you --enable an option
504 it will be forcefully turned on, skipping autodetection. This can break
505 compilation, so you need to know what you are doing.
507 exit 0
508 } #show_help()
510 # GOTCHA: the variables below defines the default behavior for autodetection
511 # and have - unless stated otherwise - at least 2 states : yes no
512 # If autodetection is available then the third state is: auto
513 _mmx=auto
514 _3dnow=auto
515 _3dnowext=auto
516 _mmxext=auto
517 _sse=auto
518 _sse2=auto
519 _ssse3=auto
520 _cmov=auto
521 _fast_cmov=auto
522 _armv5te=auto
523 _armv6=auto
524 _armv6t2=auto
525 _armvfp=auto
526 neon=auto
527 _iwmmxt=auto
528 _mtrr=auto
529 _altivec=auto
530 _install=install
531 _ranlib=ranlib
532 _windres=windres
533 _cc=cc
534 _ar=ar
535 test "$CC" && _cc="$CC"
536 _as=auto
537 _nm=auto
538 _yasm=yasm
539 _runtime_cpudetection=no
540 _cross_compile=auto
541 _prefix="/usr/local"
542 _libavutil_a=auto
543 _libavutil_so=auto
544 _libavcodec_a=auto
545 _libopencore_amrnb=auto
546 _libopencore_amrwb=auto
547 libopenjpeg=auto
548 _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
549 _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//)
550 _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
551 _libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//)
552 _libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
553 _libavparsers=$_libavparsers_all
554 _libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
555 _libavbsfs=$_libavbsfs_all
556 _libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
557 _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//)
558 _libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
559 _libavmuxers=$(echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER//)
560 _libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
561 _libavprotocols=$_libavprotocols_all
562 _libavcodec_so=auto
563 _libavformat_a=auto
564 _libavformat_so=auto
565 _libpostproc_a=auto
566 _libpostproc_so=auto
567 _libswscale_a=auto
568 _libswscale_so=auto
569 _libavcodec_mpegaudio_hp=yes
570 _mencoder=yes
571 _mplayer=yes
572 _x11=auto
573 _xshape=auto
574 _xss=auto
575 _dga1=auto
576 _dga2=auto
577 _xv=auto
578 _xvmc=no #auto when complete
579 _vdpau=auto
580 _sdl=auto
581 _kva=auto
582 _direct3d=auto
583 _directx=auto
584 _win32waveout=auto
585 _nas=auto
586 _png=auto
587 _mng=auto
588 _jpeg=auto
589 _pnm=yes
590 _md5sum=yes
591 _yuv4mpeg=yes
592 _gif=auto
593 _gl=auto
594 matrixview=yes
595 _ggi=auto
596 _ggiwmh=auto
597 _aa=auto
598 _caca=auto
599 _svga=auto
600 _vesa=auto
601 _fbdev=auto
602 _dvb=auto
603 _dvbhead=auto
604 _dxr2=auto
605 _dxr3=auto
606 _ivtv=auto
607 _v4l2=auto
608 _iconv=auto
609 _langinfo=auto
610 _rtc=auto
611 _ossaudio=auto
612 _arts=auto
613 _esd=auto
614 _pulse=auto
615 _jack=auto
616 _dart=auto
617 _openal=auto
618 _libcdio=auto
619 _liblzo=auto
620 _mad=auto
621 _mp3lame=auto
622 _mp3lame_lavc=auto
623 _toolame=auto
624 _twolame=auto
625 _tremor=auto
626 _tremor_internal=yes
627 _tremor_low=no
628 _libvorbis=auto
629 _speex=auto
630 _theora=auto
631 _mp3lib=auto
632 _liba52=auto
633 _liba52_internal=no
634 _libdca=auto
635 _libmpeg2=auto
636 _faad=auto
637 _faad_internal=auto
638 _faad_fixed=no
639 _faac=auto
640 _faac_lavc=auto
641 _ladspa=auto
642 _libbs2b=auto
643 _xmms=no
644 _vcd=auto
645 _dvdnav=auto
646 _dvdnavconfig=dvdnav-config
647 _dvdreadconfig=dvdread-config
648 _dvdread=auto
649 _dvdread_internal=auto
650 _libdvdcss_internal=auto
651 _xanim=auto
652 _real=auto
653 _live=auto
654 _nemesi=auto
655 _native_rtsp=yes
656 _xinerama=auto
657 _mga=auto
658 _xmga=auto
659 _vm=auto
660 _xf86keysym=auto
661 _mlib=no #broken, thus disabled
662 _sgiaudio=auto
663 _sunaudio=auto
664 _alsa=auto
665 _fastmemcpy=yes
666 hardcoded_tables=no
667 _unrar_exec=auto
668 _win32dll=auto
669 _select=yes
670 _radio=no
671 _radio_capture=no
672 _radio_v4l=auto
673 _radio_v4l2=auto
674 _radio_bsdbt848=auto
675 _tv=yes
676 _tv_v4l1=auto
677 _tv_v4l2=auto
678 _tv_bsdbt848=auto
679 _tv_dshow=auto
680 _pvr=auto
681 _network=yes
682 _winsock2_h=auto
683 _struct_addrinfo=auto
684 _getaddrinfo=auto
685 _struct_sockaddr_storage=auto
686 _smb=auto
687 _vidix=auto
688 _vidix_pcidb=yes
689 _dhahelper=no
690 _svgalib_helper=no
691 _joystick=no
692 _xvid=auto
693 _xvid_lavc=auto
694 _x264=auto
695 _x264_lavc=auto
696 _libdirac_lavc=auto
697 _libschroedinger_lavc=auto
698 _libnut=auto
699 _lirc=auto
700 _lircc=auto
701 _apple_remote=auto
702 _apple_ir=auto
703 _gui=no
704 _gtk1=no
705 _termcap=auto
706 _termios=auto
707 _3dfx=no
708 _s3fb=no
709 _wii=no
710 _tdfxfb=no
711 _tdfxvid=no
712 _xvr100=auto
713 _tga=yes
714 _directfb=auto
715 _zr=auto
716 _bl=no
717 _largefiles=yes
718 #language=en
719 _shm=auto
720 _linux_devfs=no
721 _charset="UTF-8"
722 _dynamic_plugins=no
723 _crash_debug=no
724 _sighandler=yes
725 _libdv=auto
726 _cdparanoia=auto
727 _cddb=auto
728 _big_endian=auto
729 _bitmap_font=yes
730 _freetype=auto
731 _fontconfig=auto
732 _menu=no
733 _qtx=auto
734 _maemo=auto
735 _coreaudio=auto
736 _corevideo=auto
737 _quartz=auto
738 quicktime=auto
739 _macosx_finder=no
740 _macosx_bundle=auto
741 _sortsub=yes
742 _freetypeconfig='freetype-config'
743 _fribidi=auto
744 _fribidiconfig='fribidi-config'
745 _enca=auto
746 _inet6=auto
747 _gethostbyname2=auto
748 _ftp=yes
749 _musepack=auto
750 _vstream=auto
751 _pthreads=auto
752 _w32threads=auto
753 _ass=auto
754 ass_internal=yes
755 _rpath=no
756 _asmalign_pot=auto
757 _stream_cache=yes
758 _priority=no
759 def_dos_paths="#define HAVE_DOS_PATHS 0"
760 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
761 def_priority="#undef CONFIG_PRIORITY"
762 def_pthread_cache="#undef PTHREAD_CACHE"
763 _need_shmem=yes
764 for ac_option do
765 case "$ac_option" in
766 --help|-help|-h)
767 show_help
769 --prefix=*)
770 _prefix=$(echo $ac_option | cut -d '=' -f 2)
772 --bindir=*)
773 _bindir=$(echo $ac_option | cut -d '=' -f 2)
775 --datadir=*)
776 _datadir=$(echo $ac_option | cut -d '=' -f 2)
778 --mandir=*)
779 _mandir=$(echo $ac_option | cut -d '=' -f 2)
781 --confdir=*)
782 _confdir=$(echo $ac_option | cut -d '=' -f 2)
784 --libdir=*)
785 _libdir=$(echo $ac_option | cut -d '=' -f 2)
787 --codecsdir=*)
788 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
790 --win32codecsdir=*)
791 _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2)
793 --xanimcodecsdir=*)
794 _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
796 --realcodecsdir=*)
797 _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
800 --with-install=*)
801 _install=$(echo $ac_option | cut -d '=' -f 2 )
803 --with-xvmclib=*)
804 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
807 --with-sdl-config=*)
808 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
810 --with-freetype-config=*)
811 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
813 --with-fribidi-config=*)
814 _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2)
816 --with-gtk-config=*)
817 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
819 --with-glib-config=*)
820 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
822 --with-dvdnav-config=*)
823 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
825 --with-dvdread-config=*)
826 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
829 --extra-cflags=*)
830 extra_cflags=$(echo $ac_option | cut -d '=' -f 2-)
832 --extra-ldflags=*)
833 extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-)
835 --extra-libs=*)
836 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
838 --extra-libs-mplayer=*)
839 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
841 --extra-libs-mencoder=*)
842 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
845 --target=*)
846 _target=$(echo $ac_option | cut -d '=' -f 2)
848 --cc=*)
849 _cc=$(echo $ac_option | cut -d '=' -f 2)
851 --host-cc=*)
852 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
854 --as=*)
855 _as=$(echo $ac_option | cut -d '=' -f 2)
857 --nm=*)
858 _nm=$(echo $ac_option | cut -d '=' -f 2)
860 --yasm=*)
861 _yasm=$(echo $ac_option | cut -d '=' -f 2)
863 --ar=*)
864 _ar=$(echo $ac_option | cut -d '=' -f 2)
866 --ranlib=*)
867 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
869 --windres=*)
870 _windres=$(echo $ac_option | cut -d '=' -f 2)
872 --charset=*)
873 _charset=$(echo $ac_option | cut -d '=' -f 2)
875 --language-doc=*)
876 language_doc=$(echo $ac_option | cut -d '=' -f 2)
878 --language-man=*)
879 language_man=$(echo $ac_option | cut -d '=' -f 2)
881 --language-msg=*)
882 language_msg=$(echo $ac_option | cut -d '=' -f 2)
884 --language=*)
885 language=$(echo $ac_option | cut -d '=' -f 2)
888 --enable-static)
889 _ld_static='-static'
891 --disable-static)
892 _ld_static=''
894 --enable-profile)
895 _profile='-p'
897 --disable-profile)
898 _profile=
900 --enable-debug)
901 _debug='-g'
903 --enable-debug=*)
904 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
906 --disable-debug)
907 _debug=
909 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
910 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
911 --enable-cross-compile) _cross_compile=yes ;;
912 --disable-cross-compile) _cross_compile=no ;;
913 --enable-mencoder) _mencoder=yes ;;
914 --disable-mencoder) _mencoder=no ;;
915 --enable-mplayer) _mplayer=yes ;;
916 --disable-mplayer) _mplayer=no ;;
917 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
918 --disable-dynamic-plugins) _dynamic_plugins=no ;;
919 --enable-x11) _x11=yes ;;
920 --disable-x11) _x11=no ;;
921 --enable-xshape) _xshape=yes ;;
922 --disable-xshape) _xshape=no ;;
923 --enable-xss) _xss=yes ;;
924 --disable-xss) _xss=no ;;
925 --enable-xv) _xv=yes ;;
926 --disable-xv) _xv=no ;;
927 --enable-xvmc) _xvmc=yes ;;
928 --disable-xvmc) _xvmc=no ;;
929 --enable-vdpau) _vdpau=yes ;;
930 --disable-vdpau) _vdpau=no ;;
931 --enable-sdl) _sdl=yes ;;
932 --disable-sdl) _sdl=no ;;
933 --enable-kva) _kva=yes ;;
934 --disable-kva) _kva=no ;;
935 --enable-direct3d) _direct3d=yes ;;
936 --disable-direct3d) _direct3d=no ;;
937 --enable-directx) _directx=yes ;;
938 --disable-directx) _directx=no ;;
939 --enable-win32waveout) _win32waveout=yes ;;
940 --disable-win32waveout) _win32waveout=no ;;
941 --enable-nas) _nas=yes ;;
942 --disable-nas) _nas=no ;;
943 --enable-png) _png=yes ;;
944 --disable-png) _png=no ;;
945 --enable-mng) _mng=yes ;;
946 --disable-mng) _mng=no ;;
947 --enable-jpeg) _jpeg=yes ;;
948 --disable-jpeg) _jpeg=no ;;
949 --enable-libopenjpeg) libopenjpeg=yes ;;
950 --disable-libopenjpeg)libopenjpeg=no ;;
951 --enable-pnm) _pnm=yes ;;
952 --disable-pnm) _pnm=no ;;
953 --enable-md5sum) _md5sum=yes ;;
954 --disable-md5sum) _md5sum=no ;;
955 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
956 --disable-yuv4mpeg) _yuv4mpeg=no ;;
957 --enable-gif) _gif=yes ;;
958 --disable-gif) _gif=no ;;
959 --enable-gl) _gl=yes ;;
960 --disable-gl) _gl=no ;;
961 --enable-matrixview) matrixview=yes ;;
962 --disable-matrixview) matrixview=no ;;
963 --enable-ggi) _ggi=yes ;;
964 --disable-ggi) _ggi=no ;;
965 --enable-ggiwmh) _ggiwmh=yes ;;
966 --disable-ggiwmh) _ggiwmh=no ;;
967 --enable-aa) _aa=yes ;;
968 --disable-aa) _aa=no ;;
969 --enable-caca) _caca=yes ;;
970 --disable-caca) _caca=no ;;
971 --enable-svga) _svga=yes ;;
972 --disable-svga) _svga=no ;;
973 --enable-vesa) _vesa=yes ;;
974 --disable-vesa) _vesa=no ;;
975 --enable-fbdev) _fbdev=yes ;;
976 --disable-fbdev) _fbdev=no ;;
977 --enable-dvb) _dvb=yes ;;
978 --disable-dvb) _dvb=no ;;
979 --enable-dvbhead) _dvbhead=yes ;;
980 --disable-dvbhead) _dvbhead=no ;;
981 --enable-dxr2) _dxr2=yes ;;
982 --disable-dxr2) _dxr2=no ;;
983 --enable-dxr3) _dxr3=yes ;;
984 --disable-dxr3) _dxr3=no ;;
985 --enable-ivtv) _ivtv=yes ;;
986 --disable-ivtv) _ivtv=no ;;
987 --enable-v4l2) _v4l2=yes ;;
988 --disable-v4l2) _v4l2=no ;;
989 --enable-iconv) _iconv=yes ;;
990 --disable-iconv) _iconv=no ;;
991 --enable-langinfo) _langinfo=yes ;;
992 --disable-langinfo) _langinfo=no ;;
993 --enable-rtc) _rtc=yes ;;
994 --disable-rtc) _rtc=no ;;
995 --enable-libdv) _libdv=yes ;;
996 --disable-libdv) _libdv=no ;;
997 --enable-ossaudio) _ossaudio=yes ;;
998 --disable-ossaudio) _ossaudio=no ;;
999 --enable-arts) _arts=yes ;;
1000 --disable-arts) _arts=no ;;
1001 --enable-esd) _esd=yes ;;
1002 --disable-esd) _esd=no ;;
1003 --enable-pulse) _pulse=yes ;;
1004 --disable-pulse) _pulse=no ;;
1005 --enable-jack) _jack=yes ;;
1006 --disable-jack) _jack=no ;;
1007 --enable-openal) _openal=yes ;;
1008 --disable-openal) _openal=no ;;
1009 --enable-dart) _dart=yes ;;
1010 --disable-dart) _dart=no ;;
1011 --enable-mad) _mad=yes ;;
1012 --disable-mad) _mad=no ;;
1013 --enable-mp3lame) _mp3lame=yes ;;
1014 --disable-mp3lame) _mp3lame=no ;;
1015 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
1016 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
1017 --enable-toolame) _toolame=yes ;;
1018 --disable-toolame) _toolame=no ;;
1019 --enable-twolame) _twolame=yes ;;
1020 --disable-twolame) _twolame=no ;;
1021 --enable-libcdio) _libcdio=yes ;;
1022 --disable-libcdio) _libcdio=no ;;
1023 --enable-liblzo) _liblzo=yes ;;
1024 --disable-liblzo) _liblzo=no ;;
1025 --enable-libvorbis) _libvorbis=yes ;;
1026 --disable-libvorbis) _libvorbis=no ;;
1027 --enable-speex) _speex=yes ;;
1028 --disable-speex) _speex=no ;;
1029 --enable-tremor) _tremor=yes ;;
1030 --disable-tremor) _tremor=no ;;
1031 --enable-tremor-internal) _tremor_internal=yes ;;
1032 --disable-tremor-internal) _tremor_internal=no ;;
1033 --enable-tremor-low) _tremor_low=yes ;;
1034 --disable-tremor-low) _tremor_low=no ;;
1035 --enable-theora) _theora=yes ;;
1036 --disable-theora) _theora=no ;;
1037 --enable-mp3lib) _mp3lib=yes ;;
1038 --disable-mp3lib) _mp3lib=no ;;
1039 --enable-liba52-internal) _liba52_internal=yes ;;
1040 --disable-liba52-internal) _liba52_internal=no ;;
1041 --enable-liba52) _liba52=yes ;;
1042 --disable-liba52) _liba52=no ;;
1043 --enable-libdca) _libdca=yes ;;
1044 --disable-libdca) _libdca=no ;;
1045 --enable-libmpeg2) _libmpeg2=yes ;;
1046 --disable-libmpeg2) _libmpeg2=no ;;
1047 --enable-musepack) _musepack=yes ;;
1048 --disable-musepack) _musepack=no ;;
1049 --enable-faad) _faad=yes ;;
1050 --disable-faad) _faad=no ;;
1051 --enable-faad-internal) _faad_internal=yes ;;
1052 --disable-faad-internal) _faad_internal=no ;;
1053 --enable-faad-fixed) _faad_fixed=yes ;;
1054 --disable-faad-fixed) _faad_fixed=no ;;
1055 --enable-faac) _faac=yes ;;
1056 --disable-faac) _faac=no ;;
1057 --enable-faac-lavc) _faac_lavc=yes ;;
1058 --disable-faac-lavc) _faac_lavc=no ;;
1059 --enable-ladspa) _ladspa=yes ;;
1060 --disable-ladspa) _ladspa=no ;;
1061 --enable-libbs2b) _libbs2b=yes ;;
1062 --disable-libbs2b) _libbs2b=no ;;
1063 --enable-xmms) _xmms=yes ;;
1064 --disable-xmms) _xmms=no ;;
1065 --enable-vcd) _vcd=yes ;;
1066 --disable-vcd) _vcd=no ;;
1067 --enable-dvdread) _dvdread=yes ;;
1068 --disable-dvdread) _dvdread=no ;;
1069 --enable-dvdread-internal) _dvdread_internal=yes ;;
1070 --disable-dvdread-internal) _dvdread_internal=no ;;
1071 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1072 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1073 --enable-dvdnav) _dvdnav=yes ;;
1074 --disable-dvdnav) _dvdnav=no ;;
1075 --enable-xanim) _xanim=yes ;;
1076 --disable-xanim) _xanim=no ;;
1077 --enable-real) _real=yes ;;
1078 --disable-real) _real=no ;;
1079 --enable-live) _live=yes ;;
1080 --disable-live) _live=no ;;
1081 --enable-nemesi) _nemesi=yes ;;
1082 --disable-nemesi) _nemesi=no ;;
1083 --enable-xinerama) _xinerama=yes ;;
1084 --disable-xinerama) _xinerama=no ;;
1085 --enable-mga) _mga=yes ;;
1086 --disable-mga) _mga=no ;;
1087 --enable-xmga) _xmga=yes ;;
1088 --disable-xmga) _xmga=no ;;
1089 --enable-vm) _vm=yes ;;
1090 --disable-vm) _vm=no ;;
1091 --enable-xf86keysym) _xf86keysym=yes ;;
1092 --disable-xf86keysym) _xf86keysym=no ;;
1093 --enable-mlib) _mlib=yes ;;
1094 --disable-mlib) _mlib=no ;;
1095 --enable-sunaudio) _sunaudio=yes ;;
1096 --disable-sunaudio) _sunaudio=no ;;
1097 --enable-sgiaudio) _sgiaudio=yes ;;
1098 --disable-sgiaudio) _sgiaudio=no ;;
1099 --enable-alsa) _alsa=yes ;;
1100 --disable-alsa) _alsa=no ;;
1101 --enable-tv) _tv=yes ;;
1102 --disable-tv) _tv=no ;;
1103 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1104 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1105 --enable-tv-v4l1) _tv_v4l1=yes ;;
1106 --disable-tv-v4l1) _tv_v4l1=no ;;
1107 --enable-tv-v4l2) _tv_v4l2=yes ;;
1108 --disable-tv-v4l2) _tv_v4l2=no ;;
1109 --enable-tv-dshow) _tv_dshow=yes ;;
1110 --disable-tv-dshow) _tv_dshow=no ;;
1111 --enable-radio) _radio=yes ;;
1112 --enable-radio-capture) _radio_capture=yes ;;
1113 --disable-radio-capture) _radio_capture=no ;;
1114 --disable-radio) _radio=no ;;
1115 --enable-radio-v4l) _radio_v4l=yes ;;
1116 --disable-radio-v4l) _radio_v4l=no ;;
1117 --enable-radio-v4l2) _radio_v4l2=yes ;;
1118 --disable-radio-v4l2) _radio_v4l2=no ;;
1119 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1120 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1121 --enable-pvr) _pvr=yes ;;
1122 --disable-pvr) _pvr=no ;;
1123 --enable-fastmemcpy) _fastmemcpy=yes ;;
1124 --disable-fastmemcpy) _fastmemcpy=no ;;
1125 --enable-hardcoded-tables) hardcoded_tables=yes ;;
1126 --disable-hardcoded-tables) hardcoded_tables=no ;;
1127 --enable-network) _network=yes ;;
1128 --disable-network) _network=no ;;
1129 --enable-winsock2_h) _winsock2_h=yes ;;
1130 --disable-winsock2_h) _winsock2_h=no ;;
1131 --enable-smb) _smb=yes ;;
1132 --disable-smb) _smb=no ;;
1133 --enable-vidix) _vidix=yes ;;
1134 --disable-vidix) _vidix=no ;;
1135 --with-vidix-drivers=*)
1136 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1138 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1139 --enable-dhahelper) _dhahelper=yes ;;
1140 --disable-dhahelper) _dhahelper=no ;;
1141 --enable-svgalib_helper) _svgalib_helper=yes ;;
1142 --disable-svgalib_helper) _svgalib_helper=no ;;
1143 --enable-joystick) _joystick=yes ;;
1144 --disable-joystick) _joystick=no ;;
1145 --enable-xvid) _xvid=yes ;;
1146 --disable-xvid) _xvid=no ;;
1147 --enable-xvid-lavc) _xvid_lavc=yes ;;
1148 --disable-xvid-lavc) _xvid_lavc=no ;;
1149 --enable-x264) _x264=yes ;;
1150 --disable-x264) _x264=no ;;
1151 --enable-x264-lavc) _x264_lavc=yes ;;
1152 --disable-x264-lavc) _x264_lavc=no ;;
1153 --enable-libdirac-lavc) _libdirac_lavc=yes ;;
1154 --disable-libdirac-lavc) _libdirac_lavc=no ;;
1155 --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
1156 --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
1157 --enable-libnut) _libnut=yes ;;
1158 --disable-libnut) _libnut=no ;;
1159 --enable-libavutil_a) _libavutil_a=yes ;;
1160 --disable-libavutil_a) _libavutil_a=no ;;
1161 --enable-libavutil_so) _libavutil_so=yes ;;
1162 --disable-libavutil_so) _libavutil_so=no ;;
1163 --enable-libavcodec_a) _libavcodec_a=yes ;;
1164 --disable-libavcodec_a) _libavcodec_a=no ;;
1165 --enable-libavcodec_so) _libavcodec_so=yes ;;
1166 --disable-libavcodec_so) _libavcodec_so=no ;;
1167 --enable-libopencore_amrnb) _libopencore_amrnb=yes ;;
1168 --disable-libopencore_amrnb) _libopencore_amrnb=no ;;
1169 --enable-libopencore_amrwb) _libopencore_amrwb=yes ;;
1170 --disable-libopencore_amrwb) _libopencore_amrwb=no ;;
1171 --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1172 --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1173 --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1174 --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1175 --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1176 --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1177 --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1178 --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1179 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1180 --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1181 --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1182 --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1183 --enable-libavformat_a) _libavformat_a=yes ;;
1184 --disable-libavformat_a) _libavformat_a=no ;;
1185 --enable-libavformat_so) _libavformat_so=yes ;;
1186 --disable-libavformat_so) _libavformat_so=no ;;
1187 --enable-libpostproc_a) _libpostproc_a=yes ;;
1188 --disable-libpostproc_a) _libpostproc_a=no ;;
1189 --enable-libpostproc_so) _libpostproc_so=yes ;;
1190 --disable-libpostproc_so) _libpostproc_so=no ;;
1191 --enable-libswscale_a) _libswscale_a=yes ;;
1192 --disable-libswscale_a) _libswscale_a=no ;;
1193 --enable-libswscale_so) _libswscale_so=yes ;;
1194 --disable-libswscale_so) _libswscale_so=no ;;
1195 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1196 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1198 --enable-lirc) _lirc=yes ;;
1199 --disable-lirc) _lirc=no ;;
1200 --enable-lircc) _lircc=yes ;;
1201 --disable-lircc) _lircc=no ;;
1202 --enable-apple-remote) _apple_remote=yes ;;
1203 --disable-apple-remote) _apple_remote=no ;;
1204 --enable-apple-ir) _apple_ir=yes ;;
1205 --disable-apple-ir) _apple_ir=no ;;
1206 --enable-gui) _gui=yes ;;
1207 --disable-gui) _gui=no ;;
1208 --enable-gtk1) _gtk1=yes ;;
1209 --disable-gtk1) _gtk1=no ;;
1210 --enable-termcap) _termcap=yes ;;
1211 --disable-termcap) _termcap=no ;;
1212 --enable-termios) _termios=yes ;;
1213 --disable-termios) _termios=no ;;
1214 --enable-3dfx) _3dfx=yes ;;
1215 --disable-3dfx) _3dfx=no ;;
1216 --enable-s3fb) _s3fb=yes ;;
1217 --disable-s3fb) _s3fb=no ;;
1218 --enable-wii) _wii=yes ;;
1219 --disable-wii) _wii=no ;;
1220 --enable-tdfxfb) _tdfxfb=yes ;;
1221 --disable-tdfxfb) _tdfxfb=no ;;
1222 --disable-tdfxvid) _tdfxvid=no ;;
1223 --enable-tdfxvid) _tdfxvid=yes ;;
1224 --disable-xvr100) _xvr100=no ;;
1225 --enable-xvr100) _xvr100=yes ;;
1226 --disable-tga) _tga=no ;;
1227 --enable-tga) _tga=yes ;;
1228 --enable-directfb) _directfb=yes ;;
1229 --disable-directfb) _directfb=no ;;
1230 --enable-zr) _zr=yes ;;
1231 --disable-zr) _zr=no ;;
1232 --enable-bl) _bl=yes ;;
1233 --disable-bl) _bl=no ;;
1234 --enable-mtrr) _mtrr=yes ;;
1235 --disable-mtrr) _mtrr=no ;;
1236 --enable-largefiles) _largefiles=yes ;;
1237 --disable-largefiles) _largefiles=no ;;
1238 --enable-shm) _shm=yes ;;
1239 --disable-shm) _shm=no ;;
1240 --enable-select) _select=yes ;;
1241 --disable-select) _select=no ;;
1242 --enable-linux-devfs) _linux_devfs=yes ;;
1243 --disable-linux-devfs) _linux_devfs=no ;;
1244 --enable-cdparanoia) _cdparanoia=yes ;;
1245 --disable-cdparanoia) _cdparanoia=no ;;
1246 --enable-cddb) _cddb=yes ;;
1247 --disable-cddb) _cddb=no ;;
1248 --enable-big-endian) _big_endian=yes ;;
1249 --disable-big-endian) _big_endian=no ;;
1250 --enable-bitmap-font) _bitmap_font=yes ;;
1251 --disable-bitmap-font) _bitmap_font=no ;;
1252 --enable-freetype) _freetype=yes ;;
1253 --disable-freetype) _freetype=no ;;
1254 --enable-fontconfig) _fontconfig=yes ;;
1255 --disable-fontconfig) _fontconfig=no ;;
1256 --enable-unrarexec) _unrar_exec=yes ;;
1257 --disable-unrarexec) _unrar_exec=no ;;
1258 --enable-ftp) _ftp=yes ;;
1259 --disable-ftp) _ftp=no ;;
1260 --enable-vstream) _vstream=yes ;;
1261 --disable-vstream) _vstream=no ;;
1262 --enable-pthreads) _pthreads=yes ;;
1263 --disable-pthreads) _pthreads=no ;;
1264 --enable-w32threads) _w32threads=yes ;;
1265 --disable-w32threads) _w32threads=no ;;
1266 --enable-ass) _ass=yes ;;
1267 --disable-ass) _ass=no ;;
1268 --enable-ass-internal) ass_internal=yes ;;
1269 --disable-ass-internal) ass_internal=no ;;
1270 --enable-rpath) _rpath=yes ;;
1271 --disable-rpath) _rpath=no ;;
1273 --enable-fribidi) _fribidi=yes ;;
1274 --disable-fribidi) _fribidi=no ;;
1276 --enable-enca) _enca=yes ;;
1277 --disable-enca) _enca=no ;;
1279 --enable-inet6) _inet6=yes ;;
1280 --disable-inet6) _inet6=no ;;
1282 --enable-gethostbyname2) _gethostbyname2=yes ;;
1283 --disable-gethostbyname2) _gethostbyname2=no ;;
1285 --enable-dga1) _dga1=yes ;;
1286 --disable-dga1) _dga1=no ;;
1287 --enable-dga2) _dga2=yes ;;
1288 --disable-dga2) _dga2=no ;;
1290 --enable-menu) _menu=yes ;;
1291 --disable-menu) _menu=no ;;
1293 --enable-qtx) _qtx=yes ;;
1294 --disable-qtx) _qtx=no ;;
1296 --enable-coreaudio) _coreaudio=yes ;;
1297 --disable-coreaudio) _coreaudio=no ;;
1298 --enable-corevideo) _corevideo=yes ;;
1299 --disable-corevideo) _corevideo=no ;;
1300 --enable-quartz) _quartz=yes ;;
1301 --disable-quartz) _quartz=no ;;
1302 --enable-macosx-finder) _macosx_finder=yes ;;
1303 --disable-macosx-finder) _macosx_finder=no ;;
1304 --enable-macosx-bundle) _macosx_bundle=yes ;;
1305 --disable-macosx-bundle) _macosx_bundle=no ;;
1307 --enable-maemo) _maemo=yes ;;
1308 --disable-maemo) _maemo=no ;;
1310 --enable-sortsub) _sortsub=yes ;;
1311 --disable-sortsub) _sortsub=no ;;
1313 --enable-crash-debug) _crash_debug=yes ;;
1314 --disable-crash-debug) _crash_debug=no ;;
1315 --enable-sighandler) _sighandler=yes ;;
1316 --disable-sighandler) _sighandler=no ;;
1317 --enable-win32dll) _win32dll=yes ;;
1318 --disable-win32dll) _win32dll=no ;;
1320 --enable-sse) _sse=yes ;;
1321 --disable-sse) _sse=no ;;
1322 --enable-sse2) _sse2=yes ;;
1323 --disable-sse2) _sse2=no ;;
1324 --enable-ssse3) _ssse3=yes ;;
1325 --disable-ssse3) _ssse3=no ;;
1326 --enable-mmxext) _mmxext=yes ;;
1327 --disable-mmxext) _mmxext=no ;;
1328 --enable-3dnow) _3dnow=yes ;;
1329 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1330 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1331 --disable-3dnowext) _3dnowext=no ;;
1332 --enable-cmov) _cmov=yes ;;
1333 --disable-cmov) _cmov=no ;;
1334 --enable-fast-cmov) _fast_cmov=yes ;;
1335 --disable-fast-cmov) _fast_cmov=no ;;
1336 --enable-altivec) _altivec=yes ;;
1337 --disable-altivec) _altivec=no ;;
1338 --enable-armv5te) _armv5te=yes ;;
1339 --disable-armv5te) _armv5te=no ;;
1340 --enable-armv6) _armv6=yes ;;
1341 --disable-armv6) _armv6=no ;;
1342 --enable-armv6t2) _armv6t2=yes ;;
1343 --disable-armv6t2) _armv6t2=no ;;
1344 --enable-armvfp) _armvfp=yes ;;
1345 --disable-armvfp) _armvfp=no ;;
1346 --enable-neon) neon=yes ;;
1347 --disable-neon) neon=no ;;
1348 --enable-iwmmxt) _iwmmxt=yes ;;
1349 --disable-iwmmxt) _iwmmxt=no ;;
1350 --enable-mmx) _mmx=yes ;;
1351 --disable-mmx) # 3Dnow! and MMX2 require MMX
1352 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1355 echo "Unknown parameter: $ac_option"
1356 exit 1
1359 esac
1360 done
1362 # Atmos: moved this here, to be correct, if --prefix is specified
1363 test -z "$_bindir" && _bindir="$_prefix/bin"
1364 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1365 test -z "$_mandir" && _mandir="$_prefix/share/man"
1366 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1367 test -z "$_libdir" && _libdir="$_prefix/lib"
1369 # Determine our OS name and CPU architecture
1370 if test -z "$_target" ; then
1371 # OS name
1372 system_name=$(uname -s 2>&1)
1373 case "$system_name" in
1374 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1376 Haiku)
1377 system_name=BeOS
1379 IRIX*)
1380 system_name=IRIX
1382 GNU/kFreeBSD)
1383 system_name=FreeBSD
1385 HP-UX*)
1386 system_name=HP-UX
1388 [cC][yY][gG][wW][iI][nN]*)
1389 system_name=CYGWIN
1391 MINGW32*)
1392 system_name=MINGW32
1394 OS/2*)
1395 system_name=OS/2
1398 system_name="$system_name-UNKNOWN"
1400 esac
1403 # host's CPU/instruction set
1404 host_arch=$(uname -p 2>&1)
1405 case "$host_arch" in
1406 i386|sparc|ppc|alpha|arm|mips|vax)
1408 powerpc) # Darwin returns 'powerpc'
1409 host_arch=ppc
1411 *) # uname -p on Linux returns 'unknown' for the processor type,
1412 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1414 # Maybe uname -m (machine hardware name) returns something we
1415 # recognize.
1417 # x86/x86pc is used by QNX
1418 case "$(uname -m 2>&1)" in
1419 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 ;;
1420 ia64) host_arch=ia64 ;;
1421 macppc|ppc) host_arch=ppc ;;
1422 ppc64) host_arch=ppc64 ;;
1423 alpha) host_arch=alpha ;;
1424 sparc) host_arch=sparc ;;
1425 sparc64) host_arch=sparc64 ;;
1426 parisc*|hppa*|9000*) host_arch=hppa ;;
1427 arm*|zaurus|cats) host_arch=arm ;;
1428 sh3|sh4|sh4a) host_arch=sh ;;
1429 s390) host_arch=s390 ;;
1430 s390x) host_arch=s390x ;;
1431 *mips*) host_arch=mips ;;
1432 vax) host_arch=vax ;;
1433 xtensa*) host_arch=xtensa ;;
1434 *) host_arch=UNKNOWN ;;
1435 esac
1437 esac
1438 else # if test -z "$_target"
1439 system_name=$(echo $_target | cut -d '-' -f 2)
1440 case "$(echo $system_name | tr A-Z a-z)" in
1441 linux) system_name=Linux ;;
1442 freebsd) system_name=FreeBSD ;;
1443 gnu/kfreebsd) system_name=FreeBSD ;;
1444 netbsd) system_name=NetBSD ;;
1445 bsd/os) system_name=BSD/OS ;;
1446 openbsd) system_name=OpenBSD ;;
1447 dragonfly) system_name=DragonFly ;;
1448 sunos) system_name=SunOS ;;
1449 qnx) system_name=QNX ;;
1450 morphos) system_name=MorphOS ;;
1451 amigaos) system_name=AmigaOS ;;
1452 mingw32*) system_name=MINGW32 ;;
1453 esac
1454 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1455 host_arch=$(echo $_target | cut -d '-' -f 1)
1456 if test $(echo $host_arch) != "x86_64" ; then
1457 host_arch=$(echo $host_arch | tr '_' '-')
1461 extra_cflags="-I. $extra_cflags"
1462 _timer=timer-linux.c
1463 _getch=getch2.c
1464 if freebsd ; then
1465 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1466 extra_cflags="$extra_cflags -I/usr/local/include"
1469 if netbsd || dragonfly ; then
1470 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1471 extra_cflags="$extra_cflags -I/usr/pkg/include"
1474 if darwin; then
1475 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1476 _timer=timer-darwin.c
1479 if aix ; then
1480 extra_ldflags="$extra_ldflags -lC"
1483 if irix ; then
1484 _ranlib='ar -r'
1485 elif linux ; then
1486 _ranlib='true'
1489 if win32 ; then
1490 _exesuf=".exe"
1491 extra_cflags="$extra_cflags -fno-common"
1492 # -lwinmm is always needed for osdep/timer-win2.c
1493 extra_ldflags="$extra_ldflags -lwinmm"
1494 _pe_executable=yes
1495 _timer=timer-win2.c
1496 _priority=yes
1497 def_dos_paths="#define HAVE_DOS_PATHS 1"
1498 def_priority="#define CONFIG_PRIORITY 1"
1501 if mingw32 ; then
1502 _getch=getch2-win.c
1503 _need_shmem=no
1506 if amigaos ; then
1507 _select=no
1508 _sighandler=no
1509 _stream_cache=no
1510 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1511 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1514 if qnx ; then
1515 extra_ldflags="$extra_ldflags -lph"
1518 if os2 ; then
1519 _exesuf=".exe"
1520 _getch=getch2-os2.c
1521 _need_shmem=no
1522 _priority=yes
1523 def_dos_paths="#define HAVE_DOS_PATHS 1"
1524 def_priority="#define CONFIG_PRIORITY 1"
1527 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1528 test "$I" && break
1529 done
1532 TMPLOG="configure.log"
1533 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1534 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1535 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1536 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1537 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1539 rm -f "$TMPLOG"
1540 echo configuration: $_configuration > "$TMPLOG"
1541 echo >> "$TMPLOG"
1544 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1545 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1549 # Checking CC version...
1550 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1551 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1552 echocheck "$_cc version"
1553 cc_vendor=intel
1554 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1555 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1556 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1557 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1558 # TODO verify older icc/ecc compatibility
1559 case $cc_version in
1561 cc_version="v. ?.??, bad"
1562 cc_fail=yes
1564 10.1|11.0|11.1)
1565 cc_version="$cc_version, ok"
1568 cc_version="$cc_version, bad"
1569 cc_fail=yes
1571 esac
1572 echores "$cc_version"
1573 else
1574 for _cc in "$_cc" gcc cc ; do
1575 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1576 if test "$cc_name_tmp" = "gcc"; then
1577 cc_name=$cc_name_tmp
1578 echocheck "$_cc version"
1579 cc_vendor=gnu
1580 cc_version=$($_cc -dumpversion 2>&1)
1581 case $cc_version in
1582 2.96*)
1583 cc_fail=yes
1586 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1587 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1588 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1590 esac
1591 echores "$cc_version"
1592 break
1594 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1595 if test "$cc_name_tmp" = "Sun C"; then
1596 echocheck "$_cc version"
1597 cc_vendor=sun
1598 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1599 _res_comment="experimental support only"
1600 echores "Sun C $cc_version"
1601 break
1603 done
1604 fi # icc
1605 test "$cc_fail" = yes && die "unsupported compiler version"
1607 if test -z "$_target" && x86 ; then
1608 cat > $TMPC << EOF
1609 int main(void) {
1610 int test[(int)sizeof(char *)-7];
1611 return 0;
1614 cc_check && host_arch=x86_64 || host_arch=i386
1617 echo "Detected operating system: $system_name"
1618 echo "Detected host architecture: $host_arch"
1620 echocheck "host cc"
1621 test "$_host_cc" || _host_cc=$_cc
1622 echores $_host_cc
1624 echocheck "cross compilation"
1625 if test $_cross_compile = auto ; then
1626 cat > $TMPC << EOF
1627 int main(void) { return 0; }
1629 _cross_compile=yes
1630 cc_check && "$TMPEXE" && _cross_compile=no
1632 echores $_cross_compile
1634 if test $_cross_compile = yes; then
1635 tmp_run() {
1636 return 0
1640 # ---
1642 # now that we know what compiler should be used for compilation, try to find
1643 # out which assembler is used by the $_cc compiler
1644 if test "$_as" = auto ; then
1645 _as=$($_cc -print-prog-name=as)
1646 test -z "$_as" && _as=as
1649 if test "$_nm" = auto ; then
1650 _nm=$($_cc -print-prog-name=nm)
1651 test -z "$_nm" && _nm=nm
1654 # XXX: this should be ok..
1655 _cpuinfo="echo"
1657 if test "$_runtime_cpudetection" = no ; then
1659 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1660 # FIXME: Remove the cygwin check once AMD CPUs are supported
1661 if test -r /proc/cpuinfo && ! cygwin; then
1662 # Linux with /proc mounted, extract CPU information from it
1663 _cpuinfo="cat /proc/cpuinfo"
1664 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1665 # FreeBSD with Linux emulation /proc mounted,
1666 # extract CPU information from it
1667 # Don't use it on x86 though, it never reports 3Dnow
1668 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1669 elif darwin && ! x86 ; then
1670 # use hostinfo on Darwin
1671 _cpuinfo="hostinfo"
1672 elif aix; then
1673 # use 'lsattr' on AIX
1674 _cpuinfo="lsattr -E -l proc0 -a type"
1675 elif x86; then
1676 # all other OSes try to extract CPU information from a small helper
1677 # program cpuinfo instead
1678 $_cc -o cpuinfo$_exesuf cpuinfo.c
1679 _cpuinfo="./cpuinfo$_exesuf"
1682 if x86 ; then
1683 # gather more CPU information
1684 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1685 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1686 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1687 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1688 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1690 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1692 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1693 -e s/xmm/sse/ -e s/kni/sse/)
1695 for ext in $pparam ; do
1696 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1697 done
1699 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1700 test $_sse = kernel_check && _mmxext=kernel_check
1702 echocheck "CPU vendor"
1703 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1705 echocheck "CPU type"
1706 echores "$pname"
1709 fi # test "$_runtime_cpudetection" = no
1711 if x86 && test "$_runtime_cpudetection" = no ; then
1712 extcheck() {
1713 if test "$1" = kernel_check ; then
1714 echocheck "kernel support of $2"
1715 cat > $TMPC <<EOF
1716 #include <stdlib.h>
1717 #include <signal.h>
1718 void catch() { exit(1); }
1719 int main(void) {
1720 signal(SIGILL, catch);
1721 __asm__ volatile ("$3":::"memory"); return 0;
1725 if cc_check && tmp_run ; then
1726 eval _$2=yes
1727 echores "yes"
1728 _optimizing="$_optimizing $2"
1729 return 0
1730 else
1731 eval _$2=no
1732 echores "failed"
1733 echo "It seems that your kernel does not correctly support $2."
1734 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1735 return 1
1738 return 0
1741 extcheck $_mmx "mmx" "emms"
1742 extcheck $_mmxext "mmxext" "sfence"
1743 extcheck $_3dnow "3dnow" "femms"
1744 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1745 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1746 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1747 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1748 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1750 echocheck "mtrr support"
1751 if test "$_mtrr" = kernel_check ; then
1752 _mtrr="yes"
1753 _optimizing="$_optimizing mtrr"
1755 echores "$_mtrr"
1757 if test "$_gcc3_ext" != ""; then
1758 # if we had to disable sse/sse2 because the active kernel does not
1759 # support this instruction set extension, we also have to tell
1760 # gcc3 to not generate sse/sse2 instructions for normal C code
1761 cat > $TMPC << EOF
1762 int main(void) { return 0; }
1764 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1770 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1771 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1772 _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'
1773 case "$host_arch" in
1774 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1775 _arch='X86 X86_32'
1776 _target_arch="ARCH_X86 = yes"
1777 _target_subarch="ARCH_X86_32 = yes"
1778 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1779 iproc=486
1780 proc=i486
1783 if test "$_runtime_cpudetection" = no ; then
1784 case "$pvendor" in
1785 AuthenticAMD)
1786 case "$pfamily" in
1787 3) proc=i386 iproc=386 ;;
1788 4) proc=i486 iproc=486 ;;
1789 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1790 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1791 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1792 proc=k6-3
1793 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1794 proc=geode
1795 elif test "$pmodel" -ge 8; then
1796 proc=k6-2
1797 elif test "$pmodel" -ge 6; then
1798 proc=k6
1799 else
1800 proc=i586
1803 6) iproc=686
1804 # It's a bit difficult to determine the correct type of Family 6
1805 # AMD CPUs just from their signature. Instead, we check directly
1806 # whether it supports SSE.
1807 if test "$_sse" = yes; then
1808 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1809 proc=athlon-xp
1810 else
1811 # Again, gcc treats athlon and athlon-tbird similarly.
1812 proc=athlon
1815 15) iproc=686
1816 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1817 # caught and remedied in the optimization tests below.
1818 proc=k8
1821 *) proc=k8 iproc=686 ;;
1822 esac
1824 GenuineIntel)
1825 case "$pfamily" in
1826 3) proc=i386 iproc=386 ;;
1827 4) proc=i486 iproc=486 ;;
1828 5) iproc=586
1829 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1830 proc=pentium-mmx # 4 is desktop, 8 is mobile
1831 else
1832 proc=i586
1835 6) iproc=686
1836 if test "$pmodel" -ge 15; then
1837 proc=core2
1838 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1839 proc=pentium-m
1840 elif test "$pmodel" -ge 7; then
1841 proc=pentium3
1842 elif test "$pmodel" -ge 3; then
1843 proc=pentium2
1844 else
1845 proc=i686
1848 15) iproc=686
1849 # A nocona in 32-bit mode has no more capabilities than a prescott.
1850 if test "$pmodel" -ge 3; then
1851 proc=prescott
1852 else
1853 proc=pentium4
1855 test $_fast_cmov = "auto" && _fast_cmov=no
1857 *) proc=prescott iproc=686 ;;
1858 esac
1860 CentaurHauls)
1861 case "$pfamily" in
1862 5) iproc=586
1863 if test "$pmodel" -ge 8; then
1864 proc=winchip2
1865 elif test "$pmodel" -ge 4; then
1866 proc=winchip-c6
1867 else
1868 proc=i586
1871 6) iproc=686
1872 if test "$pmodel" -ge 9; then
1873 proc=c3-2
1874 else
1875 proc=c3
1876 iproc=586
1879 *) proc=i686 iproc=i686 ;;
1880 esac
1882 unknown)
1883 case "$pfamily" in
1884 3) proc=i386 iproc=386 ;;
1885 4) proc=i486 iproc=486 ;;
1886 *) proc=i586 iproc=586 ;;
1887 esac
1890 proc=i586 iproc=586 ;;
1891 esac
1892 fi # test "$_runtime_cpudetection" = no
1895 # check that gcc supports our CPU, if not, fall back to earlier ones
1896 # LGB: check -mcpu and -march swithing step by step with enabling
1897 # to fall back till 386.
1899 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1901 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1902 cpuopt=-mtune
1903 else
1904 cpuopt=-mcpu
1907 echocheck "GCC & CPU optimization abilities"
1908 cat > $TMPC << EOF
1909 int main(void) { return 0; }
1911 if test "$_runtime_cpudetection" = no ; then
1912 cc_check -march=native && proc=native
1913 if test "$proc" = "k8"; then
1914 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1916 if test "$proc" = "athlon-xp"; then
1917 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1919 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1920 cc_check -march=$proc $cpuopt=$proc || proc=k6
1922 if test "$proc" = "k6" || test "$proc" = "c3"; then
1923 if ! cc_check -march=$proc $cpuopt=$proc; then
1924 if cc_check -march=i586 $cpuopt=i686; then
1925 proc=i586-i686
1926 else
1927 proc=i586
1931 if test "$proc" = "prescott" ; then
1932 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1934 if test "$proc" = "core2" ; then
1935 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1937 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
1938 cc_check -march=$proc $cpuopt=$proc || proc=i686
1940 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1941 cc_check -march=$proc $cpuopt=$proc || proc=i586
1943 if test "$proc" = "i586"; then
1944 cc_check -march=$proc $cpuopt=$proc || proc=i486
1946 if test "$proc" = "i486" ; then
1947 cc_check -march=$proc $cpuopt=$proc || proc=i386
1949 if test "$proc" = "i386" ; then
1950 cc_check -march=$proc $cpuopt=$proc || proc=error
1952 if test "$proc" = "error" ; then
1953 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1954 _mcpu=""
1955 _march=""
1956 _optimizing=""
1957 elif test "$proc" = "i586-i686"; then
1958 _march="-march=i586"
1959 _mcpu="$cpuopt=i686"
1960 _optimizing="$proc"
1961 else
1962 _march="-march=$proc"
1963 _mcpu="$cpuopt=$proc"
1964 _optimizing="$proc"
1966 else # if test "$_runtime_cpudetection" = no
1967 _mcpu="$cpuopt=generic"
1968 # at least i486 required, for bswap instruction
1969 _march="-march=i486"
1970 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1971 cc_check $_mcpu || _mcpu=""
1972 cc_check $_march $_mcpu || _march=""
1975 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1976 ## autodetected mcpu/march parameters
1977 if test "$_target" ; then
1978 # TODO: it may be a good idea to check GCC and fall back in all cases
1979 if test "$host_arch" = "i586-i686"; then
1980 _march="-march=i586"
1981 _mcpu="$cpuopt=i686"
1982 else
1983 _march="-march=$host_arch"
1984 _mcpu="$cpuopt=$host_arch"
1987 proc="$host_arch"
1989 case "$proc" in
1990 i386) iproc=386 ;;
1991 i486) iproc=486 ;;
1992 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1993 i686|athlon*|pentium*) iproc=686 ;;
1994 *) iproc=586 ;;
1995 esac
1998 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1999 _fast_cmov="yes"
2000 else
2001 _fast_cmov="no"
2004 echores "$proc"
2007 ia64)
2008 _arch='IA64'
2009 _target_arch='ARCH_IA64 = yes'
2010 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2011 iproc='ia64'
2014 x86_64|amd64)
2015 _arch='X86 X86_64'
2016 _target_subarch='ARCH_X86_64 = yes'
2017 _target_arch="ARCH_X86 = yes"
2018 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2019 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2020 iproc='x86_64'
2022 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2023 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
2024 cpuopt=-mtune
2025 else
2026 cpuopt=-mcpu
2028 if test "$_runtime_cpudetection" = no ; then
2029 case "$pvendor" in
2030 AuthenticAMD)
2031 proc=k8;;
2032 GenuineIntel)
2033 case "$pfamily" in
2034 6) proc=core2;;
2036 # 64-bit prescotts exist, but as far as GCC is concerned they
2037 # have the same capabilities as a nocona.
2038 proc=nocona
2039 test $_fast_cmov = "auto" && _fast_cmov=no
2041 esac
2044 proc=error;;
2045 esac
2046 fi # test "$_runtime_cpudetection" = no
2048 echocheck "GCC & CPU optimization abilities"
2049 cat > $TMPC << EOF
2050 int main(void) { return 0; }
2052 # This is a stripped-down version of the i386 fallback.
2053 if test "$_runtime_cpudetection" = no ; then
2054 cc_check -march=native && proc=native
2055 # --- AMD processors ---
2056 if test "$proc" = "k8"; then
2057 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2059 # This will fail if gcc version < 3.3, which is ok because earlier
2060 # versions don't really support 64-bit on amd64.
2061 # Is this a valid assumption? -Corey
2062 if test "$proc" = "athlon-xp"; then
2063 cc_check -march=$proc $cpuopt=$proc || proc=error
2065 # --- Intel processors ---
2066 if test "$proc" = "core2"; then
2067 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
2069 if test "$proc" = "x86-64"; then
2070 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2072 if test "$proc" = "nocona"; then
2073 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2075 if test "$proc" = "pentium4"; then
2076 cc_check -march=$proc $cpuopt=$proc || proc=error
2079 _march="-march=$proc"
2080 _mcpu="$cpuopt=$proc"
2081 if test "$proc" = "error" ; then
2082 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2083 _mcpu=""
2084 _march=""
2086 else # if test "$_runtime_cpudetection" = no
2087 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2088 _march="-march=x86-64"
2089 _mcpu="$cpuopt=generic"
2090 cc_check $_mcpu || _mcpu="x86-64"
2091 cc_check $_mcpu || _mcpu=""
2092 cc_check $_march $_mcpu || _march=""
2095 _optimizing="$proc"
2096 test $_fast_cmov = "auto" && _fast_cmov=yes
2098 echores "$proc"
2101 sparc|sparc64)
2102 _arch='SPARC'
2103 _target_arch='ARCH_SPARC = yes'
2104 iproc='sparc'
2105 if test "$host_arch" = "sparc64" ; then
2106 _vis='yes'
2107 proc='ultrasparc'
2108 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2109 elif sunos ; then
2110 echocheck "CPU type"
2111 karch=$(uname -m)
2112 case "$(echo $karch)" in
2113 sun4) proc=v7 ;;
2114 sun4c) proc=v7 ;;
2115 sun4d) proc=v8 ;;
2116 sun4m) proc=v8 ;;
2117 sun4u) proc=ultrasparc _vis='yes' ;;
2118 sun4v) proc=v9 ;;
2119 *) proc=v8 ;;
2120 esac
2121 echores "$proc"
2122 else
2123 proc=v8
2125 _mcpu="-mcpu=$proc"
2126 _optimizing="$proc"
2129 arm|armv4l|armv5tel)
2130 _arch='ARM'
2131 _target_arch='ARCH_ARM = yes'
2132 iproc='arm'
2135 avr32)
2136 _arch='AVR32'
2137 _target_arch='ARCH_AVR32 = yes'
2138 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2139 iproc='avr32'
2142 sh|sh4)
2143 _arch='SH4'
2144 _target_arch='ARCH_SH4 = yes'
2145 iproc='sh4'
2148 ppc|ppc64|powerpc|powerpc64)
2149 _arch='PPC'
2150 def_dcbzl='#define HAVE_DCBZL 0'
2151 _target_arch='ARCH_PPC = yes'
2152 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2153 iproc='ppc'
2155 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2156 _arch='PPC PPC64'
2157 _target_subarch='ARCH_PPC64 = yes'
2158 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2160 echocheck "CPU type"
2161 case $system_name in
2162 Linux)
2163 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2164 if test -n "$($_cpuinfo | grep altivec)"; then
2165 test $_altivec = auto && _altivec=yes
2168 Darwin)
2169 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2170 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2171 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2172 test $_altivec = auto && _altivec=yes
2175 NetBSD)
2176 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2177 case $cc_version in
2178 2*|3.0*|3.1*|3.2*|3.3*)
2181 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2182 test $_altivec = auto && _altivec=yes
2185 esac
2187 AIX)
2188 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2190 esac
2191 if test "$_altivec" = yes; then
2192 echores "$proc altivec"
2193 else
2194 _altivec=no
2195 echores "$proc"
2198 echocheck "GCC & CPU optimization abilities"
2200 if test -n "$proc"; then
2201 case "$proc" in
2202 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2203 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2204 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2205 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2206 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2207 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2208 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2209 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2210 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2211 *) ;;
2212 esac
2213 # gcc 3.1(.1) and up supports 7400 and 7450
2214 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2215 case "$proc" in
2216 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2217 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2218 *) ;;
2219 esac
2221 # gcc 3.2 and up supports 970
2222 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2223 case "$proc" in
2224 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2225 def_dcbzl='#define HAVE_DCBZL 1' ;;
2226 *) ;;
2227 esac
2229 # gcc 3.3 and up supports POWER4
2230 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2231 case "$proc" in
2232 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2233 *) ;;
2234 esac
2236 # gcc 3.4 and up supports 440*
2237 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2238 case "$proc" in
2239 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2240 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2241 *) ;;
2242 esac
2244 # gcc 4.0 and up supports POWER5
2245 if test "$_cc_major" -ge "4"; then
2246 case "$proc" in
2247 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2248 *) ;;
2249 esac
2253 if test -n "$_mcpu"; then
2254 _optimizing=$(echo $_mcpu | cut -c 8-)
2255 echores "$_optimizing"
2256 else
2257 echores "none"
2262 alpha*)
2263 _arch='ALPHA'
2264 _target_arch='ARCH_ALPHA = yes'
2265 iproc='alpha'
2267 echocheck "CPU type"
2268 cat > $TMPC << EOF
2269 int main(void) {
2270 unsigned long ver, mask;
2271 __asm__ ("implver %0" : "=r" (ver));
2272 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2273 printf("%ld-%x\n", ver, ~mask);
2274 return 0;
2277 $_cc -o "$TMPEXE" "$TMPC"
2278 case $("$TMPEXE") in
2280 0-0) proc="ev4"; _mvi="0";;
2281 1-0) proc="ev5"; _mvi="0";;
2282 1-1) proc="ev56"; _mvi="0";;
2283 1-101) proc="pca56"; _mvi="1";;
2284 2-303) proc="ev6"; _mvi="1";;
2285 2-307) proc="ev67"; _mvi="1";;
2286 2-1307) proc="ev68"; _mvi="1";;
2287 esac
2288 echores "$proc"
2290 echocheck "GCC & CPU optimization abilities"
2291 if test "$proc" = "ev68" ; then
2292 cc_check -mcpu=$proc || proc=ev67
2294 if test "$proc" = "ev67" ; then
2295 cc_check -mcpu=$proc || proc=ev6
2297 _mcpu="-mcpu=$proc"
2298 echores "$proc"
2300 _optimizing="$proc"
2303 mips)
2304 _arch='SGI_MIPS'
2305 _target_arch='ARCH_SGI_MIPS = yes'
2306 iproc='sgi-mips'
2308 if irix ; then
2309 echocheck "CPU type"
2310 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2311 case "$(echo $proc)" in
2312 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2313 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2314 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2315 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2316 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2317 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2318 esac
2319 # gcc < 3.x does not support -mtune.
2320 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2321 _mcpu=''
2323 echores "$proc"
2328 hppa)
2329 _arch='PA_RISC'
2330 _target_arch='ARCH_PA_RISC = yes'
2331 iproc='PA-RISC'
2334 s390)
2335 _arch='S390'
2336 _target_arch='ARCH_S390 = yes'
2337 iproc='390'
2340 s390x)
2341 _arch='S390X'
2342 _target_arch='ARCH_S390X = yes'
2343 iproc='390x'
2346 vax)
2347 _arch='VAX'
2348 _target_arch='ARCH_VAX = yes'
2349 iproc='vax'
2352 xtensa)
2353 _arch='XTENSA'
2354 _target_arch='ARCH_XTENSA = yes'
2355 iproc='xtensa'
2358 generic)
2359 _arch='GENERIC'
2360 _target_arch='ARCH_GENERIC = yes'
2364 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2365 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2366 die "unsupported architecture $host_arch"
2368 esac # case "$host_arch" in
2370 if test "$_runtime_cpudetection" = yes ; then
2371 if x86 ; then
2372 test "$_cmov" != no && _cmov=yes
2373 x86_32 && _cmov=no
2374 test "$_mmx" != no && _mmx=yes
2375 test "$_3dnow" != no && _3dnow=yes
2376 test "$_3dnowext" != no && _3dnowext=yes
2377 test "$_mmxext" != no && _mmxext=yes
2378 test "$_sse" != no && _sse=yes
2379 test "$_sse2" != no && _sse2=yes
2380 test "$_ssse3" != no && _ssse3=yes
2381 test "$_mtrr" != no && _mtrr=yes
2383 if ppc; then
2384 _altivec=yes
2389 # endian testing
2390 echocheck "byte order"
2391 if test "$_big_endian" = auto ; then
2392 cat > $TMPC <<EOF
2393 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2394 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2395 int main(void) { return (int)ascii_name; }
2397 if cc_check ; then
2398 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2399 _big_endian=yes
2400 else
2401 _big_endian=no
2403 else
2404 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2407 if test "$_big_endian" = yes ; then
2408 _byte_order='big-endian'
2409 def_words_endian='#define WORDS_BIGENDIAN 1'
2410 def_bigendian='#define HAVE_BIGENDIAN 1'
2411 else
2412 _byte_order='little-endian'
2413 def_words_endian='#undef WORDS_BIGENDIAN'
2414 def_bigendian='#define HAVE_BIGENDIAN 0'
2416 echores "$_byte_order"
2419 echocheck "extern symbol prefix"
2420 cat > $TMPC << EOF
2421 int ff_extern;
2423 cc_check -c || die "Symbol mangling check failed."
2424 sym=$($_nm -P -g $TMPEXE)
2425 extern_prefix=${sym%%ff_extern*}
2426 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2427 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2428 echores $extern_prefix
2431 echocheck "assembler support of -pipe option"
2432 cat > $TMPC << EOF
2433 int main(void) { return 0; }
2435 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2436 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2439 echocheck "compiler support of named assembler arguments"
2440 _named_asm_args=yes
2441 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2442 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2443 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2444 _named_asm_args=no
2445 def_named_asm_args="#undef NAMED_ASM_ARGS"
2447 echores $_named_asm_args
2450 if darwin && test "$cc_vendor" = "gnu" ; then
2451 echocheck "GCC support of -mstackrealign"
2452 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2453 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2454 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2455 # wrong code with this flag, but this can be worked around by adding
2456 # -fno-unit-at-a-time as described in the blog post at
2457 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2458 cat > $TMPC << EOF
2459 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2460 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2462 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2463 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2464 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2465 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2466 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2469 # Checking for CFLAGS
2470 _install_strip="-s"
2471 if test "$_profile" != "" || test "$_debug" != "" ; then
2472 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2473 _install_strip=
2474 elif test -z "$CFLAGS" ; then
2475 if test "$cc_vendor" = "intel" ; then
2476 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2477 elif test "$cc_vendor" = "sun" ; then
2478 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2479 elif test "$cc_vendor" != "gnu" ; then
2480 CFLAGS="-O2 $_march $_mcpu $_pipe"
2481 else
2482 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2483 extra_ldflags="$extra_ldflags -ffast-math"
2485 else
2486 _warn_CFLAGS=yes
2489 cat > $TMPC << EOF
2490 int main(void) { return 0; }
2492 if test "$cc_vendor" = "gnu" ; then
2493 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2494 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
2495 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2496 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2497 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2498 else
2499 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2502 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2505 if test -n "$LDFLAGS" ; then
2506 extra_ldflags="$extra_ldflags $LDFLAGS"
2507 _warn_CFLAGS=yes
2508 elif test "$cc_vendor" = "intel" ; then
2509 extra_ldflags="$extra_ldflags -i-static"
2511 if test -n "$CPPFLAGS" ; then
2512 extra_cflags="$extra_cflags $CPPFLAGS"
2513 _warn_CFLAGS=yes
2518 if x86_32 ; then
2519 # Checking assembler (_as) compatibility...
2520 # Added workaround for older as that reads from stdin by default - atmos
2521 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2522 echocheck "assembler ($_as $as_version)"
2524 _pref_as_version='2.9.1'
2525 echo 'nop' > $TMPS
2526 if test "$_mmx" = yes ; then
2527 echo 'emms' >> $TMPS
2529 if test "$_3dnow" = yes ; then
2530 _pref_as_version='2.10.1'
2531 echo 'femms' >> $TMPS
2533 if test "$_3dnowext" = yes ; then
2534 _pref_as_version='2.10.1'
2535 echo 'pswapd %mm0, %mm0' >> $TMPS
2537 if test "$_mmxext" = yes ; then
2538 _pref_as_version='2.10.1'
2539 echo 'movntq %mm0, (%eax)' >> $TMPS
2541 if test "$_sse" = yes ; then
2542 _pref_as_version='2.10.1'
2543 echo 'xorps %xmm0, %xmm0' >> $TMPS
2545 #if test "$_sse2" = yes ; then
2546 # _pref_as_version='2.11'
2547 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2549 if test "$_cmov" = yes ; then
2550 _pref_as_version='2.10.1'
2551 echo 'cmovb %eax, %ebx' >> $TMPS
2553 if test "$_ssse3" = yes ; then
2554 _pref_as_version='2.16.92'
2555 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2557 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2559 if test "$as_verc_fail" != yes ; then
2560 echores "ok"
2561 else
2562 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2563 echores "failed"
2564 die "obsolete binutils version"
2567 fi #if x86_32
2569 echocheck ".align is a power of two"
2570 if test "$_asmalign_pot" = auto ; then
2571 _asmalign_pot=no
2572 cat > $TMPC << EOF
2573 int main(void) { __asm__ (".align 3"); return 0; }
2575 cc_check && _asmalign_pot=yes
2577 if test "$_asmalign_pot" = "yes" ; then
2578 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2579 else
2580 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2582 echores $_asmalign_pot
2584 if x86 ; then
2585 echocheck "10 assembler operands"
2586 ten_operands=no
2587 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2588 cat > $TMPC << EOF
2589 int main(void) {
2590 int x=0;
2591 __asm__ volatile(
2593 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2595 return 0;
2598 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2599 echores $ten_operands
2601 echocheck "ebx availability"
2602 ebx_available=no
2603 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2604 cat > $TMPC << EOF
2605 int main(void) {
2606 int x;
2607 __asm__ volatile(
2608 "xor %0, %0"
2609 :"=b"(x)
2610 // just adding ebx to clobber list seems unreliable with some
2611 // compilers, e.g. Haiku's gcc 2.95
2613 // and the above check does not work for OSX 64 bit...
2614 __asm__ volatile("":::"%ebx");
2615 return 0;
2618 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2619 echores $ebx_available
2621 echocheck "PIC"
2622 pic=no
2623 cat > $TMPC << EOF
2624 int main(void) {
2625 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2626 #error PIC not enabled
2627 #endif
2628 return 0;
2631 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2632 echores $pic
2634 echocheck "yasm"
2635 if test -z "$YASMFLAGS" ; then
2636 if darwin ; then
2637 x86_64 && objformat="macho64" || objformat="macho"
2638 elif win32 ; then
2639 objformat="win32"
2640 else
2641 objformat="elf"
2643 # currently tested for Linux x86, x86_64
2644 YASMFLAGS="-f $objformat"
2645 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2646 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2647 case "$objformat" in
2648 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2649 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2650 esac
2651 else
2652 _warn_CFLAGS=yes
2655 echo "pabsw xmm0, xmm0" > $TMPS
2656 yasm_check || _yasm=""
2657 if test $_yasm ; then
2658 test "$_mmx" = "yes" && fft_mmx="yes"
2659 def_yasm='#define HAVE_YASM 1'
2660 _have_yasm="yes"
2661 echores "$_yasm"
2662 else
2663 def_yasm='#define HAVE_YASM 0'
2664 fft_mmx="no"
2665 _have_yasm="no"
2666 echores "no"
2669 echocheck "bswap"
2670 def_bswap='#define HAVE_BSWAP 0'
2671 echo 'bswap %eax' > $TMPS
2672 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2673 echores "$bswap"
2674 fi #if x86
2677 #FIXME: This should happen before the check for CFLAGS..
2678 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2679 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2681 # check if AltiVec is supported by the compiler, and how to enable it
2682 echocheck "GCC AltiVec flags"
2683 cat > $TMPC << EOF
2684 int main(void) { return 0; }
2686 if $(cc_check -maltivec -mabi=altivec) ; then
2687 _altivec_gcc_flags="-maltivec -mabi=altivec"
2688 # check if <altivec.h> should be included
2689 cat > $TMPC << EOF
2690 #include <altivec.h>
2691 int main(void) { return 0; }
2693 if $(cc_check $_altivec_gcc_flags) ; then
2694 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2695 inc_altivec_h='#include <altivec.h>'
2696 else
2697 cat > $TMPC << EOF
2698 int main(void) { return 0; }
2700 if $(cc_check -faltivec) ; then
2701 _altivec_gcc_flags="-faltivec"
2702 else
2703 _altivec=no
2704 _altivec_gcc_flags="none, AltiVec disabled"
2708 echores "$_altivec_gcc_flags"
2710 # check if the compiler supports braces for vector declarations
2711 cat > $TMPC << EOF
2712 $inc_altivec_h
2713 int main(void) { (vector int) {1}; return 0; }
2715 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2717 # Disable runtime cpudetection if we cannot generate AltiVec code or
2718 # AltiVec is disabled by the user.
2719 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2720 && _runtime_cpudetection=no
2722 # Show that we are optimizing for AltiVec (if enabled and supported).
2723 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2724 && _optimizing="$_optimizing altivec"
2726 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2727 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2730 if ppc ; then
2731 def_xform_asm='#define HAVE_XFORM_ASM 0'
2732 xform_asm=no
2733 echocheck "XFORM ASM support"
2734 cat > $TMPC << EOF
2735 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2737 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2738 echores "$xform_asm"
2741 if arm ; then
2742 echocheck "ARM pld instruction"
2743 cat > $TMPC << EOF
2744 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2746 pld=no
2747 cc_check && pld=yes
2748 echores "$pld"
2750 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2751 if test $_armv5te = "auto" ; then
2752 cat > $TMPC << EOF
2753 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2755 _armv5te=no
2756 cc_check && _armv5te=yes
2758 echores "$_armv5te"
2760 echocheck "ARMv6 (SIMD instructions)"
2761 if test $_armv6 = "auto" ; then
2762 cat > $TMPC << EOF
2763 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2765 _armv6=no
2766 cc_check && _armv6=yes
2768 echores "$_armv6"
2770 echocheck "ARMv6t2 (SIMD instructions)"
2771 if test $_armv6t2 = "auto" ; then
2772 cat > $TMPC << EOF
2773 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2775 _armv6t2=no
2776 cc_check && _armv6t2=yes
2778 echores "$_armv6"
2780 echocheck "ARM VFP"
2781 if test $_armvfp = "auto" ; then
2782 cat > $TMPC << EOF
2783 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2785 _armvfp=no
2786 cc_check && _armvfp=yes
2788 echores "$_armvfp"
2790 echocheck "ARM NEON"
2791 if test $neon = "auto" ; then
2792 cat > $TMPC << EOF
2793 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2795 neon=no
2796 cc_check && neon=yes
2798 echores "$neon"
2800 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2801 if test $_iwmmxt = "auto" ; then
2802 cat > $TMPC << EOF
2803 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2805 _iwmmxt=no
2806 cc_check && _iwmmxt=yes
2808 echores "$_iwmmxt"
2811 _cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2812 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2813 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2814 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2815 test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts"
2816 test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts"
2817 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2818 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2819 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2820 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2821 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2822 test "$pld" = yes && _cpuexts="PLD $_cpuexts"
2823 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2824 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2825 test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts"
2826 test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts"
2827 test "$neon" = yes && _cpuexts="NEON $_cpuexts"
2828 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2829 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2830 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2832 # Checking kernel version...
2833 if x86_32 && linux ; then
2834 _k_verc_problem=no
2835 kernel_version=$(uname -r 2>&1)
2836 echocheck "$system_name kernel version"
2837 case "$kernel_version" in
2838 '') kernel_version="?.??"; _k_verc_fail=yes;;
2839 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2840 _k_verc_problem=yes;;
2841 esac
2842 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2843 _k_verc_fail=yes
2845 if test "$_k_verc_fail" ; then
2846 echores "$kernel_version, fail"
2847 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2848 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2849 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2850 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2851 echo "2.2.x you must upgrade it to get SSE support!"
2852 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2853 else
2854 echores "$kernel_version, ok"
2858 ######################
2859 # MAIN TESTS GO HERE #
2860 ######################
2863 echocheck "-lposix"
2864 cat > $TMPC <<EOF
2865 int main(void) { return 0; }
2867 if cc_check -lposix ; then
2868 extra_ldflags="$extra_ldflags -lposix"
2869 echores "yes"
2870 else
2871 echores "no"
2874 echocheck "-lm"
2875 cat > $TMPC <<EOF
2876 int main(void) { return 0; }
2878 if cc_check -lm ; then
2879 _ld_lm="-lm"
2880 echores "yes"
2881 else
2882 _ld_lm=""
2883 echores "no"
2887 echocheck "langinfo"
2888 if test "$_langinfo" = auto ; then
2889 cat > $TMPC <<EOF
2890 #include <langinfo.h>
2891 int main(void) { nl_langinfo(CODESET); return 0; }
2893 _langinfo=no
2894 cc_check && _langinfo=yes
2896 if test "$_langinfo" = yes ; then
2897 def_langinfo='#define HAVE_LANGINFO 1'
2898 else
2899 def_langinfo='#undef HAVE_LANGINFO'
2901 echores "$_langinfo"
2904 echocheck "language"
2905 # Set preferred languages, "all" uses English as main language.
2906 test -z "$language" && language=$LINGUAS
2907 test -z "$language_doc" && language_doc=$language
2908 test -z "$language_man" && language_man=$language
2909 test -z "$language_msg" && language_msg=$language
2910 language_doc=$(echo $language_doc | tr , " ")
2911 language_man=$(echo $language_man | tr , " ")
2912 language_msg=$(echo $language_msg | tr , " ")
2914 test "$language_doc" = "all" && language_doc=$doc_lang_all
2915 test "$language_man" = "all" && language_man=$man_lang_all
2916 test "$language_msg" = "all" && language_msg=en
2918 # Prune non-existing translations from language lists.
2919 # Set message translation to the first available language.
2920 # Fall back on English.
2921 for lang in $language_doc ; do
2922 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2923 done
2924 language_doc=$tmp_language_doc
2925 test -z "$language_doc" && language_doc=en
2927 for lang in $language_man ; do
2928 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2929 done
2930 language_man=$tmp_language_man
2931 test -z "$language_man" && language_man=en
2933 for lang in $language_msg ; do
2934 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2935 done
2936 language_msg=$tmp_language_msg
2937 test -z "$language_msg" && language_msg=en
2938 _mp_help="help/help_mp-${language_msg}.h"
2939 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2942 echocheck "enable sighandler"
2943 if test "$_sighandler" = yes ; then
2944 def_sighandler='#define CONFIG_SIGHANDLER 1'
2945 else
2946 def_sighandler='#undef CONFIG_SIGHANDLER'
2948 echores "$_sighandler"
2950 echocheck "runtime cpudetection"
2951 if test "$_runtime_cpudetection" = yes ; then
2952 _optimizing="Runtime CPU-Detection enabled"
2953 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2954 else
2955 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2957 echores "$_runtime_cpudetection"
2960 echocheck "restrict keyword"
2961 for restrict_keyword in restrict __restrict __restrict__ ; do
2962 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2963 if cc_check; then
2964 def_restrict_keyword=$restrict_keyword
2965 break;
2967 done
2968 if [ -n "$def_restrict_keyword" ]; then
2969 echores "$def_restrict_keyword"
2970 else
2971 echores "none"
2973 # Avoid infinite recursion loop ("#define restrict restrict")
2974 if [ "$def_restrict_keyword" != "restrict" ]; then
2975 def_restrict_keyword="#define restrict $def_restrict_keyword"
2976 else
2977 def_restrict_keyword=""
2981 echocheck "__builtin_expect"
2982 # GCC branch prediction hint
2983 cat > $TMPC << EOF
2984 int foo(int a) {
2985 a = __builtin_expect(a, 10);
2986 return a == 10 ? 0 : 1;
2988 int main(void) { return foo(10) && foo(0); }
2990 _builtin_expect=no
2991 cc_check && _builtin_expect=yes
2992 if test "$_builtin_expect" = yes ; then
2993 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2994 else
2995 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2997 echores "$_builtin_expect"
3000 echocheck "kstat"
3001 cat > $TMPC << EOF
3002 #include <kstat.h>
3003 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
3005 _kstat=no
3006 cc_check -lkstat && _kstat=yes
3007 if test "$_kstat" = yes ; then
3008 def_kstat="#define HAVE_LIBKSTAT 1"
3009 extra_ldflags="$extra_ldflags -lkstat"
3010 else
3011 def_kstat="#undef HAVE_LIBKSTAT"
3013 echores "$_kstat"
3016 echocheck "posix4"
3017 # required for nanosleep on some systems
3018 cat > $TMPC << EOF
3019 #include <time.h>
3020 int main(void) { (void) nanosleep(0, 0); return 0; }
3022 _posix4=no
3023 cc_check -lposix4 && _posix4=yes
3024 if test "$_posix4" = yes ; then
3025 extra_ldflags="$extra_ldflags -lposix4"
3027 echores "$_posix4"
3029 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
3030 echocheck $func
3031 cat > $TMPC << EOF
3032 #include <math.h>
3033 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
3035 eval _$func=no
3036 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
3037 if eval test "x\$_$func" = "xyes"; then
3038 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
3039 echores yes
3040 else
3041 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
3042 echores no
3044 done
3047 echocheck "mkstemp"
3048 cat > $TMPC << EOF
3049 #include <stdlib.h>
3050 int main(void) { char a; mkstemp(&a); return 0; }
3052 _mkstemp=no
3053 cc_check && _mkstemp=yes
3054 if test "$_mkstemp" = yes ; then
3055 def_mkstemp='#define HAVE_MKSTEMP 1'
3056 else
3057 def_mkstemp='#undef HAVE_MKSTEMP'
3059 echores "$_mkstemp"
3062 echocheck "nanosleep"
3063 # also check for nanosleep
3064 cat > $TMPC << EOF
3065 #include <time.h>
3066 int main(void) { (void) nanosleep(0, 0); return 0; }
3068 _nanosleep=no
3069 cc_check && _nanosleep=yes
3070 if test "$_nanosleep" = yes ; then
3071 def_nanosleep='#define HAVE_NANOSLEEP 1'
3072 else
3073 def_nanosleep='#undef HAVE_NANOSLEEP'
3075 echores "$_nanosleep"
3078 echocheck "socklib"
3079 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3080 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3081 cat > $TMPC << EOF
3082 #include <netdb.h>
3083 #include <sys/socket.h>
3084 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3086 _socklib=no
3087 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3088 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3089 done
3090 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3091 if test $_winsock2_h = auto ; then
3092 _winsock2_h=no
3093 cat > $TMPC << EOF
3094 #include <winsock2.h>
3095 int main(void) { (void) gethostbyname(0); return 0; }
3097 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3099 test "$_ld_sock" && _res_comment="using $_ld_sock"
3100 echores "$_socklib"
3103 if test $_winsock2_h = yes ; then
3104 _ld_sock="-lws2_32"
3105 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3106 else
3107 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3111 echocheck "netdb.h, struct addrinfo"
3112 if test "$_struct_addrinfo" = auto; then
3113 _struct_addrinfo=no
3114 cat > $TMPC << EOF
3115 #include <sys/types.h>
3116 #include <sys/socket.h>
3117 #include <netdb.h>
3118 int main(void) { struct addrinfo ai; return 0; }
3120 cc_check && _struct_addrinfo=yes
3122 echores "$_struct_addrinfo"
3124 if test "$_struct_addrinfo" = yes; then
3125 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
3126 else
3127 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
3131 echocheck "netdb.h, getaddrinfo()"
3132 if test "$_getaddrinfo" = auto; then
3133 _getaddrinfo=no
3134 cat > $TMPC << EOF
3135 #include <sys/types.h>
3136 #include <sys/socket.h>
3137 #include <netdb.h>
3138 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
3140 cc_check && _getaddrinfo=yes
3142 echores "$_getaddrinfo"
3144 if test "$_getaddrinfo" = yes; then
3145 def_getaddrinfo="#define HAVE_GETADDRINFO 1"
3146 else
3147 def_getaddrinfo="#define HAVE_GETADDRINFO 0"
3151 echocheck "sockaddr_storage"
3152 if test "$_struct_sockaddr_storage" = auto; then
3153 _struct_sockaddr_storage=no
3154 cat > $TMPC << EOF
3155 #include <sys/socket.h>
3156 int main(void) { struct sockaddr_storage sas; return 0; }
3158 cc_check && _struct_sockaddr_storage=yes
3160 echores "$_struct_sockaddr_storage"
3162 if test "$_struct_sockaddr_storage" = yes; then
3163 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
3164 else
3165 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
3169 echocheck "arpa/inet.h"
3170 arpa_inet_h=no
3171 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3172 cat > $TMPC << EOF
3173 #include <arpa/inet.h>
3174 int main(void) { return 0; }
3176 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3177 echores "$arpa_inet_h"
3180 echocheck "inet_pton()"
3181 def_inet_pton='#define HAVE_INET_PTON 0'
3182 inet_pton=no
3183 cat > $TMPC << EOF
3184 #include <sys/types.h>
3185 #include <sys/socket.h>
3186 #include <arpa/inet.h>
3187 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3189 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3190 cc_check $_ld_tmp && inet_pton=yes && break
3191 done
3192 if test $inet_pton = yes ; then
3193 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3194 def_inet_pton='#define HAVE_INET_PTON 1'
3196 echores "$inet_pton"
3199 echocheck "inet_aton()"
3200 def_inet_aton='#define HAVE_INET_ATON 0'
3201 inet_aton=no
3202 cat > $TMPC << EOF
3203 #include <sys/types.h>
3204 #include <sys/socket.h>
3205 #include <arpa/inet.h>
3206 int main(void) { (void) inet_aton(0, 0); return 0; }
3208 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3209 cc_check $_ld_tmp && inet_aton=yes && break
3210 done
3211 if test $inet_aton = yes ; then
3212 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3213 def_inet_aton='#define HAVE_INET_ATON 1'
3215 echores "$inet_aton"
3218 echocheck "socklen_t"
3219 _socklen_t=no
3220 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3221 cat > $TMPC << EOF
3222 #include <$header>
3223 int main(void) { socklen_t v = 0; return v; }
3225 cc_check && _socklen_t=yes && break
3226 done
3227 if test "$_socklen_t" = yes ; then
3228 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3229 else
3230 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3232 echores "$_socklen_t"
3235 echocheck "closesocket()"
3236 _closesocket=no
3237 cat > $TMPC << EOF
3238 #include <winsock2.h>
3239 int main(void) { closesocket(~0); return 0; }
3241 cc_check $_ld_sock && _closesocket=yes
3242 if test "$_closesocket" = yes ; then
3243 def_closesocket='#define HAVE_CLOSESOCKET 1'
3244 else
3245 def_closesocket='#define HAVE_CLOSESOCKET 0'
3247 echores "$_closesocket"
3250 echocheck "network"
3251 test $_winsock2_h = no && test $inet_pton = no &&
3252 test $inet_aton = no && _network=no
3253 if test "$_network" = yes ; then
3254 def_network='#define CONFIG_NETWORK 1'
3255 extra_ldflags="$extra_ldflags $_ld_sock"
3256 _inputmodules="network $_inputmodules"
3257 else
3258 _noinputmodules="network $_noinputmodules"
3259 def_network='#undef CONFIG_NETWORK'
3260 _ftp=no
3262 echores "$_network"
3265 echocheck "inet6"
3266 if test "$_inet6" = auto ; then
3267 cat > $TMPC << EOF
3268 #include <sys/types.h>
3269 #if !defined(_WIN32) || defined(__CYGWIN__)
3270 #include <sys/socket.h>
3271 #include <netinet/in.h>
3272 #else
3273 #include <ws2tcpip.h>
3274 #endif
3275 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3277 _inet6=no
3278 if cc_check $_ld_sock ; then
3279 _inet6=yes
3282 if test "$_inet6" = yes ; then
3283 def_inet6='#define HAVE_AF_INET6 1'
3284 else
3285 def_inet6='#undef HAVE_AF_INET6'
3287 echores "$_inet6"
3290 echocheck "gethostbyname2"
3291 if test "$_gethostbyname2" = auto ; then
3292 cat > $TMPC << EOF
3293 #include <sys/types.h>
3294 #include <sys/socket.h>
3295 #include <netdb.h>
3296 int main(void) { gethostbyname2("", AF_INET); return 0; }
3298 _gethostbyname2=no
3299 if cc_check ; then
3300 _gethostbyname2=yes
3303 if test "$_gethostbyname2" = yes ; then
3304 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3305 else
3306 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3308 echores "$_gethostbyname2"
3311 echocheck "inttypes.h (required)"
3312 cat > $TMPC << EOF
3313 #include <inttypes.h>
3314 int main(void) { return 0; }
3316 _inttypes=no
3317 cc_check && _inttypes=yes
3318 echores "$_inttypes"
3320 if test "$_inttypes" = no ; then
3321 echocheck "bitypes.h (inttypes.h predecessor)"
3322 cat > $TMPC << EOF
3323 #include <sys/bitypes.h>
3324 int main(void) { return 0; }
3326 cc_check && _inttypes=yes
3327 if test "$_inttypes" = yes ; then
3328 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."
3329 else
3330 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3335 echocheck "int_fastXY_t in inttypes.h"
3336 cat > $TMPC << EOF
3337 #include <inttypes.h>
3338 int main(void) {
3339 volatile int_fast16_t v= 0;
3340 return v; }
3342 _fast_inttypes=no
3343 cc_check && _fast_inttypes=yes
3344 if test "$_fast_inttypes" = no ; then
3345 def_fast_inttypes='
3346 typedef signed char int_fast8_t;
3347 typedef signed int int_fast16_t;
3348 typedef signed int int_fast32_t;
3349 typedef signed long long int_fast64_t;
3350 typedef unsigned char uint_fast8_t;
3351 typedef unsigned int uint_fast16_t;
3352 typedef unsigned int uint_fast32_t;
3353 typedef unsigned long long uint_fast64_t;'
3355 echores "$_fast_inttypes"
3358 echocheck "malloc.h"
3359 cat > $TMPC << EOF
3360 #include <malloc.h>
3361 int main(void) { (void) malloc(0); return 0; }
3363 _malloc=no
3364 cc_check && _malloc=yes
3365 if test "$_malloc" = yes ; then
3366 def_malloc_h='#define HAVE_MALLOC_H 1'
3367 else
3368 def_malloc_h='#define HAVE_MALLOC_H 0'
3370 # malloc.h emits a warning in FreeBSD and OpenBSD
3371 freebsd || openbsd || dragonfly && def_malloc_h='#define HAVE_MALLOC_H 0'
3372 echores "$_malloc"
3375 echocheck "memalign()"
3376 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3377 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3378 cat > $TMPC << EOF
3379 #include <malloc.h>
3380 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3382 _memalign=no
3383 cc_check && _memalign=yes
3384 if test "$_memalign" = yes ; then
3385 def_memalign='#define HAVE_MEMALIGN 1'
3386 else
3387 def_memalign='#define HAVE_MEMALIGN 0'
3388 def_map_memalign='#define memalign(a,b) malloc(b)'
3389 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3391 echores "$_memalign"
3394 echocheck "posix_memalign()"
3395 posix_memalign=no
3396 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3397 cat > $TMPC << EOF
3398 #define _XOPEN_SOURCE 600
3399 #include <stdlib.h>
3400 int main(void) { posix_memalign(NULL, 0, 0); }
3402 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3403 echores "$posix_memalign"
3406 echocheck "alloca.h"
3407 cat > $TMPC << EOF
3408 #include <alloca.h>
3409 int main(void) { (void) alloca(0); return 0; }
3411 _alloca=no
3412 cc_check && _alloca=yes
3413 if cc_check ; then
3414 def_alloca_h='#define HAVE_ALLOCA_H 1'
3415 else
3416 def_alloca_h='#undef HAVE_ALLOCA_H'
3418 echores "$_alloca"
3421 echocheck "fastmemcpy"
3422 if test "$_fastmemcpy" = yes ; then
3423 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3424 else
3425 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3427 echores "$_fastmemcpy"
3430 echocheck "hard-coded tables"
3431 if test "$hardcoded_tables" = yes ; then
3432 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1'
3433 mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes'
3434 else
3435 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0'
3437 echores "$hardcoded_tables"
3440 echocheck "mman.h"
3441 cat > $TMPC << EOF
3442 #include <sys/types.h>
3443 #include <sys/mman.h>
3444 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3446 _mman=no
3447 cc_check && _mman=yes
3448 if test "$_mman" = yes ; then
3449 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3450 else
3451 def_mman_h='#undef HAVE_SYS_MMAN_H'
3452 os2 && _need_mmap=yes
3454 echores "$_mman"
3456 cat > $TMPC << EOF
3457 #include <sys/types.h>
3458 #include <sys/mman.h>
3459 int main(void) { void *p = MAP_FAILED; return 0; }
3461 _mman_has_map_failed=no
3462 cc_check && _mman_has_map_failed=yes
3463 if test "$_mman_has_map_failed" = yes ; then
3464 def_mman_has_map_failed=''
3465 else
3466 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3469 echocheck "dynamic loader"
3470 cat > $TMPC << EOF
3471 #include <stddef.h>
3472 #include <dlfcn.h>
3473 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3475 _dl=no
3476 for _ld_tmp in "" "-ldl" ; do
3477 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3478 done
3479 if test "$_dl" = yes ; then
3480 def_dl='#define HAVE_LIBDL 1'
3481 else
3482 def_dl='#undef HAVE_LIBDL'
3484 echores "$_dl"
3487 echocheck "dynamic a/v plugins support"
3488 if test "$_dl" = no ; then
3489 _dynamic_plugins=no
3491 if test "$_dynamic_plugins" = yes ; then
3492 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3493 else
3494 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3496 echores "$_dynamic_plugins"
3499 def_threads='#define HAVE_THREADS 0'
3501 echocheck "pthread"
3502 if linux ; then
3503 THREAD_CFLAGS=-D_REENTRANT
3504 elif freebsd || netbsd || openbsd || bsdos ; then
3505 THREAD_CFLAGS=-D_THREAD_SAFE
3507 if test "$_pthreads" = auto ; then
3508 cat > $TMPC << EOF
3509 #include <pthread.h>
3510 void* func(void *arg) { return arg; }
3511 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3513 _pthreads=no
3514 if ! hpux ; then
3515 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3516 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3517 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3518 done
3521 if test "$_pthreads" = yes ; then
3522 test $_ld_pthread && _res_comment="using $_ld_pthread"
3523 def_pthreads='#define HAVE_PTHREADS 1'
3524 def_threads='#define HAVE_THREADS 1'
3525 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3526 else
3527 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3528 def_pthreads='#undef HAVE_PTHREADS'
3529 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3530 mingw32 || _win32dll=no
3532 echores "$_pthreads"
3534 if cygwin ; then
3535 if test "$_pthreads" = yes ; then
3536 def_pthread_cache="#define PTHREAD_CACHE 1"
3537 else
3538 _stream_cache=no
3539 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3543 echocheck "w32threads"
3544 if test "$_pthreads" = yes ; then
3545 _res_comment="using pthread instead"
3546 _w32threads=no
3548 if test "$_w32threads" = auto ; then
3549 _w32threads=no
3550 mingw32 && _w32threads=yes
3552 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3553 echores "$_w32threads"
3555 echocheck "rpath"
3556 netbsd &&_rpath=yes
3557 if test "$_rpath" = yes ; then
3558 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3559 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3560 done
3561 extra_ldflags=$tmp
3563 echores "$_rpath"
3565 echocheck "iconv"
3566 if test "$_iconv" = auto ; then
3567 cat > $TMPC << EOF
3568 #include <stdio.h>
3569 #include <unistd.h>
3570 #include <iconv.h>
3571 #define INBUFSIZE 1024
3572 #define OUTBUFSIZE 4096
3574 char inbuffer[INBUFSIZE];
3575 char outbuffer[OUTBUFSIZE];
3577 int main(void) {
3578 size_t numread;
3579 iconv_t icdsc;
3580 char *tocode="UTF-8";
3581 char *fromcode="cp1250";
3582 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3583 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3584 char *iptr=inbuffer;
3585 char *optr=outbuffer;
3586 size_t inleft=numread;
3587 size_t outleft=OUTBUFSIZE;
3588 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3589 != (size_t)(-1)) {
3590 write(1, outbuffer, OUTBUFSIZE - outleft);
3593 if (iconv_close(icdsc) == -1)
3596 return 0;
3599 _iconv=no
3600 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3601 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3602 _iconv=yes && break
3603 done
3605 if test "$_iconv" = yes ; then
3606 def_iconv='#define CONFIG_ICONV 1'
3607 else
3608 def_iconv='#undef CONFIG_ICONV'
3610 echores "$_iconv"
3613 echocheck "soundcard.h"
3614 _soundcard_h=no
3615 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3616 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3617 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3618 cat > $TMPC << EOF
3619 #include <$_soundcard_header>
3620 int main(void) { return 0; }
3622 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3623 done
3625 if test "$_soundcard_h" = yes ; then
3626 if test $_soundcard_header = "sys/soundcard.h"; then
3627 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3628 else
3629 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3632 echores "$_soundcard_h"
3635 echocheck "sys/dvdio.h"
3636 cat > $TMPC << EOF
3637 #include <unistd.h>
3638 #include <sys/dvdio.h>
3639 int main(void) { return 0; }
3641 _dvdio=no
3642 cc_check && _dvdio=yes
3643 if test "$_dvdio" = yes ; then
3644 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3645 else
3646 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3648 echores "$_dvdio"
3651 echocheck "sys/cdio.h"
3652 cat > $TMPC << EOF
3653 #include <unistd.h>
3654 #include <sys/cdio.h>
3655 int main(void) { return 0; }
3657 _cdio=no
3658 cc_check && _cdio=yes
3659 if test "$_cdio" = yes ; then
3660 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3661 else
3662 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3664 echores "$_cdio"
3667 echocheck "linux/cdrom.h"
3668 cat > $TMPC << EOF
3669 #include <sys/types.h>
3670 #include <linux/cdrom.h>
3671 int main(void) { return 0; }
3673 _cdrom=no
3674 cc_check && _cdrom=yes
3675 if test "$_cdrom" = yes ; then
3676 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3677 else
3678 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3680 echores "$_cdrom"
3683 echocheck "dvd.h"
3684 cat > $TMPC << EOF
3685 #include <dvd.h>
3686 int main(void) { return 0; }
3688 _dvd=no
3689 cc_check && _dvd=yes
3690 if test "$_dvd" = yes ; then
3691 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3692 else
3693 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3695 echores "$_dvd"
3698 if bsdos; then
3699 echocheck "BSDI dvd.h"
3700 cat > $TMPC << EOF
3701 #include <dvd.h>
3702 int main(void) { return 0; }
3704 _bsdi_dvd=no
3705 cc_check && _bsdi_dvd=yes
3706 if test "$_bsdi_dvd" = yes ; then
3707 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3708 else
3709 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3711 echores "$_bsdi_dvd"
3712 fi #if bsdos
3715 if hpux; then
3716 # also used by AIX, but AIX does not support VCD and/or libdvdread
3717 echocheck "HP-UX SCSI header"
3718 cat > $TMPC << EOF
3719 #include <sys/scsi.h>
3720 int main(void) { return 0; }
3722 _hpux_scsi_h=no
3723 cc_check && _hpux_scsi_h=yes
3724 if test "$_hpux_scsi_h" = yes ; then
3725 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3726 else
3727 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3729 echores "$_hpux_scsi_h"
3730 fi #if hpux
3733 if sunos; then
3734 echocheck "userspace SCSI headers (Solaris)"
3735 cat > $TMPC << EOF
3736 #include <unistd.h>
3737 #include <stropts.h>
3738 #include <sys/scsi/scsi_types.h>
3739 #include <sys/scsi/impl/uscsi.h>
3740 int main(void) { return 0; }
3742 _sol_scsi_h=no
3743 cc_check && _sol_scsi_h=yes
3744 if test "$_sol_scsi_h" = yes ; then
3745 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3746 else
3747 def_sol_scsi_h='#undef SOLARIS_USCSI'
3749 echores "$_sol_scsi_h"
3750 fi #if sunos
3753 echocheck "termcap"
3754 if test "$_termcap" = auto ; then
3755 cat > $TMPC <<EOF
3756 #include <stddef.h>
3757 #include <term.h>
3758 int main(void) { tgetent(NULL, NULL); return 0; }
3760 _termcap=no
3761 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3762 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3763 && _termcap=yes && break
3764 done
3766 if test "$_termcap" = yes ; then
3767 def_termcap='#define HAVE_TERMCAP 1'
3768 test $_ld_tmp && _res_comment="using $_ld_tmp"
3769 else
3770 def_termcap='#undef HAVE_TERMCAP'
3772 echores "$_termcap"
3775 echocheck "termios"
3776 def_termios='#undef HAVE_TERMIOS'
3777 def_termios_h='#undef HAVE_TERMIOS_H'
3778 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3779 if test "$_termios" = auto ; then
3780 _termios=no
3781 for _termios_header in "sys/termios.h" "termios.h"; do
3782 cat > $TMPC <<EOF
3783 #include <$_termios_header>
3784 int main(void) { return 0; }
3786 cc_check && _termios=yes && _res_comment="using $_termios_header" && break
3787 done
3790 if test "$_termios" = yes ; then
3791 def_termios='#define HAVE_TERMIOS 1'
3792 if test "$_termios_header" = "termios.h" ; then
3793 def_termios_h='#define HAVE_TERMIOS_H 1'
3794 else
3795 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3798 echores "$_termios"
3801 echocheck "shm"
3802 if test "$_shm" = auto ; then
3803 cat > $TMPC << EOF
3804 #include <sys/types.h>
3805 #include <sys/shm.h>
3806 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3808 _shm=no
3809 cc_check && _shm=yes
3811 if test "$_shm" = yes ; then
3812 def_shm='#define HAVE_SHM 1'
3813 else
3814 def_shm='#undef HAVE_SHM'
3816 echores "$_shm"
3819 echocheck "strsep()"
3820 cat > $TMPC << EOF
3821 #include <string.h>
3822 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3824 _strsep=no
3825 cc_check && _strsep=yes
3826 if test "$_strsep" = yes ; then
3827 def_strsep='#define HAVE_STRSEP 1'
3828 _need_strsep=no
3829 else
3830 def_strsep='#undef HAVE_STRSEP'
3831 _need_strsep=yes
3833 echores "$_strsep"
3836 echocheck "vsscanf()"
3837 cat > $TMPC << EOF
3838 #define _ISOC99_SOURCE
3839 #include <stdarg.h>
3840 #include <stdio.h>
3841 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3843 _vsscanf=no
3844 cc_check && _vsscanf=yes
3845 if test "$_vsscanf" = yes ; then
3846 def_vsscanf='#define HAVE_VSSCANF 1'
3847 _need_vsscanf=no
3848 else
3849 def_vsscanf='#undef HAVE_VSSCANF'
3850 _need_vsscanf=yes
3852 echores "$_vsscanf"
3855 echocheck "swab()"
3856 cat > $TMPC << EOF
3857 #define _XOPEN_SOURCE 600
3858 #include <unistd.h>
3859 int main(void) { swab(0, 0, 0); return 0; }
3861 _swab=no
3862 cc_check && _swab=yes
3863 if test "$_swab" = yes ; then
3864 def_swab='#define HAVE_SWAB 1'
3865 _need_swab=no
3866 else
3867 def_swab='#undef HAVE_SWAB'
3868 _need_swab=yes
3870 echores "$_swab"
3872 echocheck "POSIX select()"
3873 cat > $TMPC << EOF
3874 #include <stdio.h>
3875 #include <stdlib.h>
3876 #include <sys/types.h>
3877 #include <string.h>
3878 #include <sys/time.h>
3879 #include <unistd.h>
3880 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3882 _posix_select=no
3883 def_posix_select='#undef HAVE_POSIX_SELECT'
3884 #select() of kLIBC (OS/2) supports socket only
3885 ! os2 && cc_check && _posix_select=yes \
3886 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3887 echores "$_posix_select"
3890 echocheck "audio select()"
3891 if test "$_select" = no ; then
3892 def_select='#undef HAVE_AUDIO_SELECT'
3893 elif test "$_select" = yes ; then
3894 def_select='#define HAVE_AUDIO_SELECT 1'
3896 echores "$_select"
3899 echocheck "gettimeofday()"
3900 cat > $TMPC << EOF
3901 #include <stdio.h>
3902 #include <sys/time.h>
3903 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3905 _gettimeofday=no
3906 cc_check && _gettimeofday=yes
3907 if test "$_gettimeofday" = yes ; then
3908 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3909 _need_gettimeofday=no
3910 else
3911 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3912 _need_gettimeofday=yes
3914 echores "$_gettimeofday"
3917 echocheck "glob()"
3918 cat > $TMPC << EOF
3919 #include <stdio.h>
3920 #include <glob.h>
3921 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3923 _glob=no
3924 cc_check && _glob=yes
3925 if test "$_glob" = yes ; then
3926 def_glob='#define HAVE_GLOB 1'
3927 _need_glob=no
3928 else
3929 def_glob='#undef HAVE_GLOB'
3930 _need_glob=yes
3932 echores "$_glob"
3935 echocheck "setenv()"
3936 cat > $TMPC << EOF
3937 #include <stdlib.h>
3938 int main(void) { setenv("","",0); return 0; }
3940 _setenv=no
3941 cc_check && _setenv=yes
3942 if test "$_setenv" = yes ; then
3943 def_setenv='#define HAVE_SETENV 1'
3944 _need_setenv=no
3945 else
3946 def_setenv='#undef HAVE_SETENV'
3947 _need_setenv=yes
3949 echores "$_setenv"
3952 if sunos; then
3953 echocheck "sysi86()"
3954 cat > $TMPC << EOF
3955 #include <sys/sysi86.h>
3956 int main(void) { sysi86(0); return 0; }
3958 _sysi86=no
3959 cc_check && _sysi86=yes
3960 if test "$_sysi86" = yes ; then
3961 def_sysi86='#define HAVE_SYSI86 1'
3962 cat > $TMPC << EOF
3963 #include <sys/sysi86.h>
3964 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3966 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3967 else
3968 def_sysi86='#undef HAVE_SYSI86'
3970 echores "$_sysi86"
3971 fi #if sunos
3974 echocheck "sys/sysinfo.h"
3975 cat > $TMPC << EOF
3976 #include <sys/sysinfo.h>
3977 int main(void) {
3978 struct sysinfo s_info;
3979 sysinfo(&s_info);
3980 return 0;
3983 _sys_sysinfo=no
3984 cc_check && _sys_sysinfo=yes
3985 if test "$_sys_sysinfo" = yes ; then
3986 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3987 else
3988 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3990 echores "$_sys_sysinfo"
3993 if darwin; then
3995 echocheck "Mac OS X Finder Support"
3996 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3997 if test "$_macosx_finder" = yes ; then
3998 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3999 extra_ldflags="$extra_ldflags -framework Carbon"
4001 echores "$_macosx_finder"
4003 echocheck "Mac OS X Bundle file locations"
4004 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
4005 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
4006 if test "$_macosx_bundle" = yes ; then
4007 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
4008 extra_ldflags="$extra_ldflags -framework Carbon"
4010 echores "$_macosx_bundle"
4012 echocheck "Apple Remote"
4013 if test "$_apple_remote" = auto ; then
4014 _apple_remote=no
4015 cat > $TMPC <<EOF
4016 #include <stdio.h>
4017 #include <IOKit/IOCFPlugIn.h>
4018 int main(void) {
4019 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
4020 CFMutableDictionaryRef hidMatchDictionary;
4021 IOReturn ioReturnValue;
4023 // Set up a matching dictionary to search the I/O Registry by class.
4024 // name for all HID class devices
4025 hidMatchDictionary = IOServiceMatching("AppleIRController");
4027 // Now search I/O Registry for matching devices.
4028 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
4029 hidMatchDictionary, &hidObjectIterator);
4031 // If search is unsuccessful, return nonzero.
4032 if (ioReturnValue != kIOReturnSuccess ||
4033 !IOIteratorIsValid(hidObjectIterator)) {
4034 return 1;
4036 return 0;
4039 cc_check -framework IOKit && tmp_run && _apple_remote=yes
4041 if test "$_apple_remote" = yes ; then
4042 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
4043 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
4044 else
4045 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
4047 echores "$_apple_remote"
4049 fi #if darwin
4051 if linux; then
4053 echocheck "Apple IR"
4054 if test "$_apple_ir" = auto ; then
4055 _apple_ir=no
4056 cat > $TMPC <<EOF
4057 #include <linux/types.h>
4058 #include <linux/input.h>
4059 int main(void) {
4060 struct input_event ev;
4061 struct input_id id;
4062 return 0;
4065 cc_check && _apple_ir=yes
4067 if test "$_apple_ir" = yes ; then
4068 def_apple_ir='#define CONFIG_APPLE_IR 1'
4069 else
4070 def_apple_ir='#undef CONFIG_APPLE_IR'
4072 echores "$_apple_ir"
4073 fi #if linux
4075 echocheck "pkg-config"
4076 _pkg_config=pkg-config
4077 if $($_pkg_config --version > /dev/null 2>&1); then
4078 if test "$_ld_static"; then
4079 _pkg_config="$_pkg_config --static"
4081 echores "yes"
4082 else
4083 _pkg_config=false
4084 echores "no"
4088 echocheck "Samba support (libsmbclient)"
4089 if test "$_smb" = yes; then
4090 extra_ldflags="$extra_ldflags -lsmbclient"
4092 if test "$_smb" = auto; then
4093 _smb=no
4094 cat > $TMPC << EOF
4095 #include <libsmbclient.h>
4096 int main(void) { smbc_opendir("smb://"); return 0; }
4098 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4099 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
4100 _smb=yes && break
4101 done
4104 if test "$_smb" = yes; then
4105 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4106 _inputmodules="smb $_inputmodules"
4107 else
4108 def_smb="#undef CONFIG_LIBSMBCLIENT"
4109 _noinputmodules="smb $_noinputmodules"
4111 echores "$_smb"
4114 #########
4115 # VIDEO #
4116 #########
4119 echocheck "tdfxfb"
4120 if test "$_tdfxfb" = yes ; then
4121 def_tdfxfb='#define CONFIG_TDFXFB 1'
4122 _vomodules="tdfxfb $_vomodules"
4123 else
4124 def_tdfxfb='#undef CONFIG_TDFXFB'
4125 _novomodules="tdfxfb $_novomodules"
4127 echores "$_tdfxfb"
4129 echocheck "s3fb"
4130 if test "$_s3fb" = yes ; then
4131 def_s3fb='#define CONFIG_S3FB 1'
4132 _vomodules="s3fb $_vomodules"
4133 else
4134 def_s3fb='#undef CONFIG_S3FB'
4135 _novomodules="s3fb $_novomodules"
4137 echores "$_s3fb"
4139 echocheck "wii"
4140 if test "$_wii" = yes ; then
4141 def_wii='#define CONFIG_WII 1'
4142 _vomodules="wii $_vomodules"
4143 else
4144 def_wii='#undef CONFIG_WII'
4145 _novomodules="wii $_novomodules"
4147 echores "$_wii"
4149 echocheck "tdfxvid"
4150 if test "$_tdfxvid" = yes ; then
4151 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4152 _vomodules="tdfx_vid $_vomodules"
4153 else
4154 def_tdfxvid='#undef CONFIG_TDFX_VID'
4155 _novomodules="tdfx_vid $_novomodules"
4157 echores "$_tdfxvid"
4159 echocheck "xvr100"
4160 if test "$_xvr100" = auto ; then
4161 cat > $TMPC << EOF
4162 #include <unistd.h>
4163 #include <sys/fbio.h>
4164 #include <sys/visual_io.h>
4165 int main(void) {
4166 struct vis_identifier ident;
4167 struct fbgattr attr;
4168 ioctl(0, VIS_GETIDENTIFIER, &ident);
4169 ioctl(0, FBIOGATTR, &attr);
4170 return 0;
4173 _xvr100=no
4174 cc_check && _xvr100=yes
4176 if test "$_xvr100" = yes ; then
4177 def_xvr100='#define CONFIG_XVR100 1'
4178 _vomodules="xvr100 $_vomodules"
4179 else
4180 def_tdfxvid='#undef CONFIG_XVR100'
4181 _novomodules="xvr100 $_novomodules"
4183 echores "$_xvr100"
4185 echocheck "tga"
4186 if test "$_tga" = yes ; then
4187 def_tga='#define CONFIG_TGA 1'
4188 _vomodules="tga $_vomodules"
4189 else
4190 def_tga='#undef CONFIG_TGA'
4191 _novomodules="tga $_novomodules"
4193 echores "$_tga"
4196 echocheck "md5sum support"
4197 if test "$_md5sum" = yes; then
4198 def_md5sum="#define CONFIG_MD5SUM 1"
4199 _vomodules="md5sum $_vomodules"
4200 else
4201 def_md5sum="#undef CONFIG_MD5SUM"
4202 _novomodules="md5sum $_novomodules"
4204 echores "$_md5sum"
4207 echocheck "yuv4mpeg support"
4208 if test "$_yuv4mpeg" = yes; then
4209 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4210 _vomodules="yuv4mpeg $_vomodules"
4211 else
4212 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4213 _novomodules="yuv4mpeg $_novomodules"
4215 echores "$_yuv4mpeg"
4218 echocheck "bl"
4219 if test "$_bl" = yes ; then
4220 def_bl='#define CONFIG_BL 1'
4221 _vomodules="bl $_vomodules"
4222 else
4223 def_bl='#undef CONFIG_BL'
4224 _novomodules="bl $_novomodules"
4226 echores "$_bl"
4229 echocheck "DirectFB"
4230 if test "$_directfb" = auto ; then
4231 _directfb=no
4232 cat > $TMPC <<EOF
4233 #include <directfb.h>
4234 int main(void) { DirectFBInit(0, 0); return 0; }
4236 for _inc_tmp in "" -I/usr/local/include/directfb \
4237 -I/usr/include/directfb -I/usr/local/include; do
4238 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4239 extra_cflags="$extra_cflags $_inc_tmp" && break
4240 done
4243 dfb_version() {
4244 expr $1 \* 65536 + $2 \* 256 + $3
4247 if test "$_directfb" = yes; then
4248 cat > $TMPC << EOF
4249 #include <directfb_version.h>
4251 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4254 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4255 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4256 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4257 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4258 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4259 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4260 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4261 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4262 _res_comment="$_directfb_version"
4263 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4264 else
4265 def_directfb_version='#undef DIRECTFBVERSION'
4266 _directfb=no
4267 _res_comment="version >=0.9.13 required"
4269 else
4270 _directfb=no
4271 _res_comment="failed to get version"
4274 echores "$_directfb"
4276 if test "$_directfb" = yes ; then
4277 def_directfb='#define CONFIG_DIRECTFB 1'
4278 _vomodules="directfb $_vomodules"
4279 libs_mplayer="$libs_mplayer -ldirectfb"
4280 else
4281 def_directfb='#undef CONFIG_DIRECTFB'
4282 _novomodules="directfb $_novomodules"
4284 if test "$_dfbmga" = yes; then
4285 _vomodules="dfbmga $_vomodules"
4286 def_dfbmga='#define CONFIG_DFBMGA 1'
4287 else
4288 _novomodules="dfbmga $_novomodules"
4289 def_dfbmga='#undef CONFIG_DFBMGA'
4293 echocheck "X11 headers presence"
4294 _x11_headers="no"
4295 _res_comment="check if the dev(el) packages are installed"
4296 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4297 if test -f "$I/X11/Xlib.h" ; then
4298 _x11_headers="yes"
4299 _res_comment=""
4300 break
4302 done
4303 if test $_cross_compile = no; then
4304 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4305 /usr/include/X11R6 /usr/openwin/include ; do
4306 if test -f "$I/X11/Xlib.h" ; then
4307 extra_cflags="$extra_cflags -I$I"
4308 _x11_headers="yes"
4309 _res_comment="using $I"
4310 break
4312 done
4314 echores "$_x11_headers"
4317 echocheck "X11"
4318 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4319 cat > $TMPC <<EOF
4320 #include <X11/Xlib.h>
4321 #include <X11/Xutil.h>
4322 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4324 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4325 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4326 -L/usr/lib ; do
4327 if netbsd; then
4328 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4329 else
4330 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4332 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4333 && _x11=yes && break
4334 done
4336 if test "$_x11" = yes ; then
4337 def_x11='#define CONFIG_X11 1'
4338 _vomodules="x11 xover $_vomodules"
4339 else
4340 _x11=no
4341 def_x11='#undef CONFIG_X11'
4342 _novomodules="x11 $_novomodules"
4343 _res_comment="check if the dev(el) packages are installed"
4344 # disable stuff that depends on X
4345 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4347 echores "$_x11"
4349 echocheck "Xss screensaver extensions"
4350 if test "$_xss" = auto ; then
4351 cat > $TMPC << EOF
4352 #include <X11/Xlib.h>
4353 #include <X11/extensions/scrnsaver.h>
4354 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4356 _xss=no
4357 cc_check -lXss && _xss=yes
4359 if test "$_xss" = yes ; then
4360 def_xss='#define CONFIG_XSS 1'
4361 libs_mplayer="$libs_mplayer -lXss"
4362 else
4363 def_xss='#undef CONFIG_XSS'
4365 echores "$_xss"
4367 echocheck "DPMS"
4368 _xdpms3=no
4369 _xdpms4=no
4370 if test "$_x11" = yes ; then
4371 cat > $TMPC <<EOF
4372 #include <X11/Xmd.h>
4373 #include <X11/Xlib.h>
4374 #include <X11/Xutil.h>
4375 #include <X11/Xatom.h>
4376 #include <X11/extensions/dpms.h>
4377 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4379 cc_check -lXdpms && _xdpms3=yes
4380 cat > $TMPC <<EOF
4381 #include <X11/Xlib.h>
4382 #include <X11/extensions/dpms.h>
4383 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4385 cc_check -lXext && _xdpms4=yes
4387 if test "$_xdpms4" = yes ; then
4388 def_xdpms='#define CONFIG_XDPMS 1'
4389 _res_comment="using Xdpms 4"
4390 echores "yes"
4391 elif test "$_xdpms3" = yes ; then
4392 def_xdpms='#define CONFIG_XDPMS 1'
4393 libs_mplayer="$libs_mplayer -lXdpms"
4394 _res_comment="using Xdpms 3"
4395 echores "yes"
4396 else
4397 def_xdpms='#undef CONFIG_XDPMS'
4398 echores "no"
4402 echocheck "Xv"
4403 if test "$_xv" = auto ; then
4404 cat > $TMPC <<EOF
4405 #include <X11/Xlib.h>
4406 #include <X11/extensions/Xvlib.h>
4407 int main(void) {
4408 (void) XvGetPortAttribute(0, 0, 0, 0);
4409 (void) XvQueryPortAttributes(0, 0, 0);
4410 return 0; }
4412 _xv=no
4413 cc_check -lXv && _xv=yes
4416 if test "$_xv" = yes ; then
4417 def_xv='#define CONFIG_XV 1'
4418 libs_mplayer="$libs_mplayer -lXv"
4419 _vomodules="xv $_vomodules"
4420 else
4421 def_xv='#undef CONFIG_XV'
4422 _novomodules="xv $_novomodules"
4424 echores "$_xv"
4427 echocheck "XvMC"
4428 if test "$_xv" = yes && test "$_xvmc" != no ; then
4429 _xvmc=no
4430 cat > $TMPC <<EOF
4431 #include <X11/Xlib.h>
4432 #include <X11/extensions/Xvlib.h>
4433 #include <X11/extensions/XvMClib.h>
4434 int main(void) {
4435 (void) XvMCQueryExtension(0,0,0);
4436 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4437 return 0; }
4439 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4440 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4441 done
4443 if test "$_xvmc" = yes ; then
4444 def_xvmc='#define CONFIG_XVMC 1'
4445 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4446 _vomodules="xvmc $_vomodules"
4447 _res_comment="using $_xvmclib"
4448 else
4449 def_xvmc='#define CONFIG_XVMC 0'
4450 _novomodules="xvmc $_novomodules"
4451 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
4453 echores "$_xvmc"
4456 echocheck "VDPAU"
4457 if test "$_vdpau" = auto ; then
4458 _vdpau=no
4459 if test "$_dl" = yes ; then
4460 cat > $TMPC <<EOF
4461 #include <vdpau/vdpau_x11.h>
4462 int main(void) {
4463 (void) vdp_device_create_x11(0, 0, 0, 0);
4464 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4466 cc_check -lvdpau && _vdpau=yes
4469 if test "$_vdpau" = yes ; then
4470 def_vdpau='#define CONFIG_VDPAU 1'
4471 libs_mplayer="$libs_mplayer -lvdpau"
4472 _vomodules="vdpau $_vomodules"
4473 else
4474 def_vdpau='#define CONFIG_VDPAU 0'
4475 _novomodules="vdpau $_novomodules"
4476 _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//)
4478 echores "$_vdpau"
4481 echocheck "Xinerama"
4482 if test "$_xinerama" = auto ; then
4483 cat > $TMPC <<EOF
4484 #include <X11/Xlib.h>
4485 #include <X11/extensions/Xinerama.h>
4486 int main(void) { (void) XineramaIsActive(0); return 0; }
4488 _xinerama=no
4489 cc_check -lXinerama && _xinerama=yes
4492 if test "$_xinerama" = yes ; then
4493 def_xinerama='#define CONFIG_XINERAMA 1'
4494 libs_mplayer="$libs_mplayer -lXinerama"
4495 else
4496 def_xinerama='#undef CONFIG_XINERAMA'
4498 echores "$_xinerama"
4501 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4502 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4503 # named 'X extensions' or something similar.
4504 # This check may be useful for future mplayer versions (to change resolution)
4505 # If you run into problems, remove '-lXxf86vm'.
4506 echocheck "Xxf86vm"
4507 if test "$_vm" = auto ; then
4508 cat > $TMPC <<EOF
4509 #include <X11/Xlib.h>
4510 #include <X11/extensions/xf86vmode.h>
4511 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4513 _vm=no
4514 cc_check -lXxf86vm && _vm=yes
4516 if test "$_vm" = yes ; then
4517 def_vm='#define CONFIG_XF86VM 1'
4518 libs_mplayer="$libs_mplayer -lXxf86vm"
4519 else
4520 def_vm='#undef CONFIG_XF86VM'
4522 echores "$_vm"
4524 # Check for the presence of special keycodes, like audio control buttons
4525 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4526 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4527 # have these new keycodes.
4528 echocheck "XF86keysym"
4529 if test "$_xf86keysym" = auto; then
4530 _xf86keysym=no
4531 cat > $TMPC <<EOF
4532 #include <X11/Xlib.h>
4533 #include <X11/XF86keysym.h>
4534 int main(void) { return XF86XK_AudioPause; }
4536 cc_check && _xf86keysym=yes
4538 if test "$_xf86keysym" = yes ; then
4539 def_xf86keysym='#define CONFIG_XF86XK 1'
4540 else
4541 def_xf86keysym='#undef CONFIG_XF86XK'
4543 echores "$_xf86keysym"
4545 echocheck "DGA"
4546 if test "$_dga2" = auto && test "$_x11" = yes ; then
4547 cat > $TMPC << EOF
4548 #include <X11/Xlib.h>
4549 #include <X11/extensions/xf86dga.h>
4550 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4552 _dga2=no
4553 cc_check -lXxf86dga && _dga2=yes
4555 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4556 cat > $TMPC << EOF
4557 #include <X11/Xlib.h>
4558 #include <X11/extensions/xf86dga.h>
4559 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4561 _dga1=no
4562 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4565 _dga=no
4566 def_dga='#undef CONFIG_DGA'
4567 def_dga1='#undef CONFIG_DGA1'
4568 def_dga2='#undef CONFIG_DGA2'
4569 if test "$_dga1" = yes ; then
4570 _dga=yes
4571 def_dga1='#define CONFIG_DGA1 1'
4572 _res_comment="using DGA 1.0"
4573 elif test "$_dga2" = yes ; then
4574 _dga=yes
4575 def_dga2='#define CONFIG_DGA2 1'
4576 _res_comment="using DGA 2.0"
4578 if test "$_dga" = yes ; then
4579 def_dga='#define CONFIG_DGA 1'
4580 libs_mplayer="$libs_mplayer -lXxf86dga"
4581 _vomodules="dga $_vomodules"
4582 else
4583 _novomodules="dga $_novomodules"
4585 echores "$_dga"
4588 echocheck "3dfx"
4589 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4590 def_3dfx='#define CONFIG_3DFX 1'
4591 _vomodules="3dfx $_vomodules"
4592 else
4593 def_3dfx='#undef CONFIG_3DFX'
4594 _novomodules="3dfx $_novomodules"
4596 echores "$_3dfx"
4599 echocheck "VIDIX"
4600 def_vidix='#undef CONFIG_VIDIX'
4601 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4602 _vidix_drv_cyberblade=no
4603 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4604 _vidix_drv_ivtv=no
4605 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4606 _vidix_drv_mach64=no
4607 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4608 _vidix_drv_mga=no
4609 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4610 _vidix_drv_mga_crtc2=no
4611 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4612 _vidix_drv_nvidia=no
4613 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4614 _vidix_drv_pm2=no
4615 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4616 _vidix_drv_pm3=no
4617 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4618 _vidix_drv_radeon=no
4619 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4620 _vidix_drv_rage128=no
4621 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4622 _vidix_drv_s3=no
4623 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4624 _vidix_drv_sh_veu=no
4625 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4626 _vidix_drv_sis=no
4627 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4628 _vidix_drv_unichrome=no
4629 if test "$_vidix" = auto ; then
4630 _vidix=no
4631 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4632 && _vidix=yes
4633 x86_64 && win32 && _vidix=no
4634 (ppc || alpha) && linux && _vidix=yes
4636 echores "$_vidix"
4638 if test "$_vidix" = yes ; then
4639 def_vidix='#define CONFIG_VIDIX 1'
4640 _vomodules="cvidix $_vomodules"
4641 # FIXME: ivtv driver temporarily disabled until we have a proper test
4642 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4643 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4645 # some vidix drivers are architecture and os specific, discard them elsewhere
4646 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4647 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4649 for driver in $_vidix_drivers ; do
4650 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4651 eval _vidix_drv_${driver}=yes
4652 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4653 done
4655 echocheck "VIDIX PCI device name database"
4656 echores "$_vidix_pcidb"
4657 if test "$_vidix_pcidb" = yes ; then
4658 _vidix_pcidb_val=1
4659 else
4660 _vidix_pcidb_val=0
4663 echocheck "VIDIX dhahelper support"
4664 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4665 echores "$_dhahelper"
4667 echocheck "VIDIX svgalib_helper support"
4668 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4669 echores "$_svgalib_helper"
4671 else
4672 _novomodules="cvidix $_novomodules"
4675 if test "$_vidix" = yes && win32; then
4676 winvidix=yes
4677 _vomodules="winvidix $_vomodules"
4678 libs_mplayer="$libs_mplayer -lgdi32"
4679 else
4680 _novomodules="winvidix $_novomodules"
4682 if test "$_vidix" = yes && test "$_x11" = yes; then
4683 xvidix=yes
4684 _vomodules="xvidix $_vomodules"
4685 else
4686 _novomodules="xvidix $_novomodules"
4689 echocheck "/dev/mga_vid"
4690 if test "$_mga" = auto ; then
4691 _mga=no
4692 test -c /dev/mga_vid && _mga=yes
4694 if test "$_mga" = yes ; then
4695 def_mga='#define CONFIG_MGA 1'
4696 _vomodules="mga $_vomodules"
4697 else
4698 def_mga='#undef CONFIG_MGA'
4699 _novomodules="mga $_novomodules"
4701 echores "$_mga"
4703 echocheck "xmga"
4704 if test "$_xmga" = auto ; then
4705 _xmga=no
4706 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4708 if test "$_xmga" = yes ; then
4709 def_xmga='#define CONFIG_XMGA 1'
4710 _vomodules="xmga $_vomodules"
4711 else
4712 def_xmga='#undef CONFIG_XMGA'
4713 _novomodules="xmga $_novomodules"
4715 echores "$_xmga"
4718 echocheck "GGI"
4719 if test "$_ggi" = auto ; then
4720 cat > $TMPC << EOF
4721 #include <ggi/ggi.h>
4722 int main(void) { ggiInit(); return 0; }
4724 _ggi=no
4725 cc_check -lggi && _ggi=yes
4727 if test "$_ggi" = yes ; then
4728 def_ggi='#define CONFIG_GGI 1'
4729 libs_mplayer="$libs_mplayer -lggi"
4730 _vomodules="ggi $_vomodules"
4731 else
4732 def_ggi='#undef CONFIG_GGI'
4733 _novomodules="ggi $_novomodules"
4735 echores "$_ggi"
4737 echocheck "GGI extension: libggiwmh"
4738 if test "$_ggiwmh" = auto ; then
4739 _ggiwmh=no
4740 cat > $TMPC << EOF
4741 #include <ggi/ggi.h>
4742 #include <ggi/wmh.h>
4743 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4745 cc_check -lggi -lggiwmh && _ggiwmh=yes
4747 # needed to get right output on obscure combination
4748 # like --disable-ggi --enable-ggiwmh
4749 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4750 def_ggiwmh='#define CONFIG_GGIWMH 1'
4751 libs_mplayer="$libs_mplayer -lggiwmh"
4752 else
4753 _ggiwmh=no
4754 def_ggiwmh='#undef CONFIG_GGIWMH'
4756 echores "$_ggiwmh"
4759 echocheck "AA"
4760 if test "$_aa" = auto ; then
4761 cat > $TMPC << EOF
4762 #include <aalib.h>
4763 extern struct aa_hardware_params aa_defparams;
4764 extern struct aa_renderparams aa_defrenderparams;
4765 int main(void) {
4766 aa_context *c;
4767 aa_renderparams *p;
4768 (void) aa_init(0, 0, 0);
4769 c = aa_autoinit(&aa_defparams);
4770 p = aa_getrenderparams();
4771 aa_autoinitkbd(c,0);
4772 return 0; }
4774 _aa=no
4775 for _ld_tmp in "-laa" ; do
4776 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4777 done
4779 if test "$_aa" = yes ; then
4780 def_aa='#define CONFIG_AA 1'
4781 if cygwin ; then
4782 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4784 _vomodules="aa $_vomodules"
4785 else
4786 def_aa='#undef CONFIG_AA'
4787 _novomodules="aa $_novomodules"
4789 echores "$_aa"
4792 echocheck "CACA"
4793 if test "$_caca" = auto ; then
4794 _caca=no
4795 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4796 cat > $TMPC << EOF
4797 #include <caca.h>
4798 #ifdef CACA_API_VERSION_1
4799 #include <caca0.h>
4800 #endif
4801 int main(void) { (void) caca_init(); return 0; }
4803 cc_check $(caca-config --libs) && _caca=yes
4806 if test "$_caca" = yes ; then
4807 def_caca='#define CONFIG_CACA 1'
4808 extra_cflags="$extra_cflags $(caca-config --cflags)"
4809 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4810 _vomodules="caca $_vomodules"
4811 else
4812 def_caca='#undef CONFIG_CACA'
4813 _novomodules="caca $_novomodules"
4815 echores "$_caca"
4818 echocheck "SVGAlib"
4819 if test "$_svga" = auto ; then
4820 cat > $TMPC << EOF
4821 #include <vga.h>
4822 int main(void) { return 0; }
4824 _svga=no
4825 cc_check -lvga $_ld_lm && _svga=yes
4827 if test "$_svga" = yes ; then
4828 def_svga='#define CONFIG_SVGALIB 1'
4829 libs_mplayer="$libs_mplayer -lvga"
4830 _vomodules="svga $_vomodules"
4831 else
4832 def_svga='#undef CONFIG_SVGALIB'
4833 _novomodules="svga $_novomodules"
4835 echores "$_svga"
4838 echocheck "FBDev"
4839 if test "$_fbdev" = auto ; then
4840 _fbdev=no
4841 linux && _fbdev=yes
4843 if test "$_fbdev" = yes ; then
4844 def_fbdev='#define CONFIG_FBDEV 1'
4845 _vomodules="fbdev $_vomodules"
4846 else
4847 def_fbdev='#undef CONFIG_FBDEV'
4848 _novomodules="fbdev $_novomodules"
4850 echores "$_fbdev"
4854 echocheck "DVB"
4855 if test "$_dvb" = auto ; then
4856 _dvb=no
4857 cat >$TMPC << EOF
4858 #include <poll.h>
4859 #include <sys/ioctl.h>
4860 #include <stdio.h>
4861 #include <time.h>
4862 #include <unistd.h>
4863 #include <ost/dmx.h>
4864 #include <ost/frontend.h>
4865 #include <ost/sec.h>
4866 #include <ost/video.h>
4867 #include <ost/audio.h>
4868 int main(void) {return 0;}
4870 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4871 cc_check $_inc_tmp && _dvb=yes && \
4872 extra_cflags="$extra_cflags $_inc_tmp" && break
4873 done
4875 echores "$_dvb"
4876 if test "$_dvb" = yes ; then
4877 def_dvb='#define CONFIG_DVB 1'
4878 def_dvbin='#define CONFIG_DVBIN 1'
4879 _aomodules="mpegpes(dvb) $_aomodules"
4880 _vomodules="mpegpes(dvb) $_vomodules"
4883 echocheck "DVB HEAD"
4884 if test "$_dvbhead" = auto ; then
4885 _dvbhead=no
4887 cat >$TMPC << EOF
4888 #include <poll.h>
4889 #include <sys/ioctl.h>
4890 #include <stdio.h>
4891 #include <time.h>
4892 #include <unistd.h>
4893 #include <linux/dvb/dmx.h>
4894 #include <linux/dvb/frontend.h>
4895 #include <linux/dvb/video.h>
4896 #include <linux/dvb/audio.h>
4897 int main(void) {return 0;}
4899 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4900 cc_check $_inc_tmp && _dvbhead=yes && \
4901 extra_cflags="$extra_cflags $_inc_tmp" && break
4902 done
4904 echores "$_dvbhead"
4905 if test "$_dvbhead" = yes ; then
4906 def_dvb='#define CONFIG_DVB 1'
4907 def_dvb_head='#define CONFIG_DVB_HEAD 1'
4908 def_dvbin='#define CONFIG_DVBIN 1'
4909 _aomodules="mpegpes(dvb) $_aomodules"
4910 _vomodules="mpegpes(dvb) $_vomodules"
4913 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4914 def_dvb='#undef CONFIG_DVB'
4915 def_dvb_head='#undef CONFIG_DVB_HEAD'
4916 def_dvbin='#undef CONFIG_DVBIN '
4917 _aomodules="mpegpes(file) $_aomodules"
4918 _vomodules="mpegpes(file) $_vomodules"
4921 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4922 _dvbin=yes
4923 _inputmodules="dvb $_inputmodules"
4924 else
4925 _dvbin=no
4926 _noinputmodules="dvb $_noinputmodules"
4930 if darwin; then
4932 echocheck "QuickTime"
4933 if test "$quicktime" = auto ; then
4934 cat > $TMPC <<EOF
4935 #include <QuickTime/QuickTime.h>
4936 int main(void) {
4937 ImageDescription *desc;
4938 EnterMovies();
4939 ExitMovies();
4940 return 0;
4943 quicktime=no
4944 cc_check -framework QuickTime && quicktime=yes
4946 if test "$quicktime" = yes ; then
4947 extra_ldflags="$extra_ldflags -framework QuickTime"
4948 def_quicktime='#define CONFIG_QUICKTIME 1'
4949 else
4950 def_quicktime='#undef CONFIG_QUICKTIME'
4951 _quartz=no
4953 echores $quicktime
4955 echocheck "Quartz"
4956 if test "$_quartz" = auto ; then
4957 cat > $TMPC <<EOF
4958 #include <Carbon/Carbon.h>
4959 int main(void) {
4960 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
4961 return 0;
4964 _quartz=no
4965 cc_check -framework Carbon && _quartz=yes
4967 if test "$_quartz" = yes ; then
4968 libs_mplayer="$libs_mplayer -framework Carbon"
4969 def_quartz='#define CONFIG_QUARTZ 1'
4970 _vomodules="quartz $_vomodules"
4971 else
4972 def_quartz='#undef CONFIG_QUARTZ'
4973 _novomodules="quartz $_novomodules"
4975 echores $_quartz
4977 echocheck "CoreVideo"
4978 if test "$_corevideo" = auto ; then
4979 cat > $TMPC <<EOF
4980 #include <Carbon/Carbon.h>
4981 #include <CoreServices/CoreServices.h>
4982 #include <OpenGL/OpenGL.h>
4983 #include <QuartzCore/CoreVideo.h>
4984 int main(void) { return 0; }
4986 _corevideo=no
4987 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4989 if test "$_corevideo" = yes ; then
4990 _vomodules="corevideo $_vomodules"
4991 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4992 def_corevideo='#define CONFIG_COREVIDEO 1'
4993 else
4994 _novomodules="corevideo $_novomodules"
4995 def_corevideo='#undef CONFIG_COREVIDEO'
4997 echores "$_corevideo"
4999 fi #if darwin
5002 # make sure this stays below CoreVideo to avoid issues due to namespace
5003 # conflicts between -lGL and -framework OpenGL
5004 echocheck "OpenGL"
5005 #Note: this test is run even with --enable-gl since we autodetect linker flags
5006 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
5007 cat > $TMPC << EOF
5008 #ifdef GL_WIN32
5009 #include <windows.h>
5010 #include <GL/gl.h>
5011 #else
5012 #include <GL/gl.h>
5013 #include <X11/Xlib.h>
5014 #include <GL/glx.h>
5015 #endif
5016 int main(void) {
5017 #ifdef GL_WIN32
5018 HDC dc;
5019 wglCreateContext(dc);
5020 #else
5021 glXCreateContext(NULL, NULL, NULL, True);
5022 #endif
5023 glFinish();
5024 return 0;
5027 _gl=no
5028 for _ld_tmp in -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
5029 if cc_check $_ld_tmp $_ld_lm ; then
5030 _gl=yes
5031 _gl_x11=yes
5032 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
5033 break
5035 done
5036 if cc_check -DGL_WIN32 -lopengl32 ; then
5037 _gl=yes
5038 _gl_win32=yes
5039 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
5041 else
5042 _gl=no
5044 if test "$_gl" = yes ; then
5045 def_gl='#define CONFIG_GL 1'
5046 _res_comment="backends:"
5047 if test "$_gl_win32" = yes ; then
5048 def_gl_win32='#define CONFIG_GL_WIN32 1'
5049 _res_comment="$_res_comment win32"
5051 if test "$_gl_x11" = yes ; then
5052 def_gl_x11='#define CONFIG_GL_X11 1'
5053 _res_comment="$_res_comment x11"
5055 _vomodules="opengl $_vomodules"
5056 else
5057 def_gl='#undef CONFIG_GL'
5058 def_gl_win32='#undef CONFIG_GL_WIN32'
5059 def_gl_x11='#undef CONFIG_GL_X11'
5060 _novomodules="opengl $_novomodules"
5062 echores "$_gl"
5065 echocheck "MatrixView"
5066 if test "$_gl" = no ; then
5067 matrixview=no
5069 if test "$matrixview" = yes ; then
5070 _vomodules="matrixview $_vomodules"
5071 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5072 else
5073 _novomodules="matrixview $_novomodules"
5074 def_matrixview='#undef CONFIG_MATRIXVIEW'
5076 echores "$matrixview"
5079 echocheck "PNG support"
5080 if test "$_png" = auto ; then
5081 _png=no
5082 if irix ; then
5083 # Don't check for -lpng on irix since it has its own libpng
5084 # incompatible with the GNU libpng
5085 _res_comment="disabled on irix (not GNU libpng)"
5086 else
5087 cat > $TMPC << EOF
5088 #include <png.h>
5089 #include <string.h>
5090 int main(void) {
5091 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
5092 printf("libpng: %s\n", png_libpng_ver);
5093 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
5096 cc_check -lpng -lz $_ld_lm && _png=yes
5099 echores "$_png"
5100 if test "$_png" = yes ; then
5101 def_png='#define CONFIG_PNG 1'
5102 extra_ldflags="$extra_ldflags -lpng -lz"
5103 else
5104 def_png='#undef CONFIG_PNG'
5107 echocheck "MNG support"
5108 if test "$_mng" = auto ; then
5109 _mng=no
5110 cat > $TMPC << EOF
5111 #include <libmng.h>
5112 int main(void) {
5113 const char * p_ver = mng_version_text();
5114 return !p_ver || p_ver[0] == 0;
5117 if cc_check -lmng -lz $_ld_lm ; then
5118 _mng=yes
5121 echores "$_mng"
5122 if test "$_mng" = yes ; then
5123 def_mng='#define CONFIG_MNG 1'
5124 extra_ldflags="$extra_ldflags -lmng -lz"
5125 else
5126 def_mng='#undef CONFIG_MNG'
5129 echocheck "JPEG support"
5130 if test "$_jpeg" = auto ; then
5131 _jpeg=no
5132 cat > $TMPC << EOF
5133 #include <stdio.h>
5134 #include <stdlib.h>
5135 #include <setjmp.h>
5136 #include <string.h>
5137 #include <jpeglib.h>
5138 int main(void) { return 0; }
5140 cc_check -ljpeg $_ld_lm && _jpeg=yes
5142 echores "$_jpeg"
5144 if test "$_jpeg" = yes ; then
5145 def_jpeg='#define CONFIG_JPEG 1'
5146 _vomodules="jpeg $_vomodules"
5147 extra_ldflags="$extra_ldflags -ljpeg"
5148 else
5149 def_jpeg='#undef CONFIG_JPEG'
5150 _novomodules="jpeg $_novomodules"
5154 echocheck "OpenJPEG (JPEG2000) support"
5155 if test "$libopenjpeg" = auto ; then
5156 libopenjpeg=no
5157 cat > $TMPC << EOF
5158 #define OPJ_STATIC
5159 #include <openjpeg.h>
5160 int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
5162 cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
5164 echores "$libopenjpeg"
5165 if test "$libopenjpeg" = yes ; then
5166 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
5167 extra_ldflags="$extra_ldflags -lopenjpeg"
5168 _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
5169 _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
5170 _codecmodules="OpenJPEG $_codecmodules"
5171 else
5172 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
5173 _nocodecmodules="OpenJPEG $_nocodecmodules"
5177 echocheck "PNM support"
5178 if test "$_pnm" = yes; then
5179 def_pnm="#define CONFIG_PNM 1"
5180 _vomodules="pnm $_vomodules"
5181 else
5182 def_pnm="#undef CONFIG_PNM"
5183 _novomodules="pnm $_novomodules"
5185 echores "$_pnm"
5189 echocheck "GIF support"
5190 # This is to appease people who want to force gif support.
5191 # If it is forced to yes, then we still do checks to determine
5192 # which gif library to use.
5193 if test "$_gif" = yes ; then
5194 _force_gif=yes
5195 _gif=auto
5198 if test "$_gif" = auto ; then
5199 _gif=no
5200 cat > $TMPC << EOF
5201 #include <gif_lib.h>
5202 int main(void) { return 0; }
5204 for _ld_gif in "-lungif" "-lgif" ; do
5205 cc_check $_ld_gif && _gif=yes && break
5206 done
5209 # If no library was found, and the user wants support forced,
5210 # then we force it on with libgif, as this is the safest
5211 # assumption IMHO. (libungif & libregif both create symbolic
5212 # links to libgif. We also assume that no x11 support is needed,
5213 # because if you are forcing this, then you _should_ know what
5214 # you are doing. [ Besides, package maintainers should never
5215 # have compiled x11 deps into libungif in the first place. ] )
5216 # </rant>
5217 # --Joey
5218 if test "$_force_gif" = yes && test "$_gif" = no ; then
5219 _gif=yes
5220 _ld_gif="-lgif"
5223 if test "$_gif" = yes ; then
5224 def_gif='#define CONFIG_GIF 1'
5225 _codecmodules="gif $_codecmodules"
5226 _vomodules="gif89a $_vomodules"
5227 _res_comment="old version, some encoding functions disabled"
5228 def_gif_4='#undef CONFIG_GIF_4'
5229 extra_ldflags="$extra_ldflags $_ld_gif"
5231 cat > $TMPC << EOF
5232 #include <signal.h>
5233 #include <gif_lib.h>
5234 void catch() { exit(1); }
5235 int main(void) {
5236 signal(SIGSEGV, catch); // catch segfault
5237 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5238 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5239 return 0;
5242 if cc_check "$_ld_gif" ; then
5243 def_gif_4='#define CONFIG_GIF_4 1'
5244 _res_comment=""
5246 else
5247 def_gif='#undef CONFIG_GIF'
5248 def_gif_4='#undef CONFIG_GIF_4'
5249 _novomodules="gif89a $_novomodules"
5250 _nocodecmodules="gif $_nocodecmodules"
5252 echores "$_gif"
5255 case "$_gif" in yes*)
5256 echocheck "broken giflib workaround"
5257 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5259 cat > $TMPC << EOF
5260 #include <gif_lib.h>
5261 int main(void) {
5262 GifFileType gif;
5263 printf("UserData is at address %p\n", gif.UserData);
5264 return 0;
5267 if cc_check "$_ld_gif" ; then
5268 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5269 echores "disabled"
5270 else
5271 echores "enabled"
5274 esac
5277 echocheck "VESA support"
5278 if test "$_vesa" = auto ; then
5279 cat > $TMPC << EOF
5280 #include <vbe.h>
5281 int main(void) { vbeVersion(); return 0; }
5283 _vesa=no
5284 cc_check -lvbe -llrmi && _vesa=yes
5286 if test "$_vesa" = yes ; then
5287 def_vesa='#define CONFIG_VESA 1'
5288 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5289 _vomodules="vesa $_vomodules"
5290 else
5291 def_vesa='#undef CONFIG_VESA'
5292 _novomodules="vesa $_novomodules"
5294 echores "$_vesa"
5296 #################
5297 # VIDEO + AUDIO #
5298 #################
5301 echocheck "SDL"
5302 _inc_tmp=""
5303 _ld_tmp=""
5304 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5305 if test -z "$_sdlconfig" ; then
5306 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5307 _sdlconfig="sdl-config"
5308 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5309 _sdlconfig="sdl11-config"
5310 else
5311 _sdlconfig=false
5314 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5315 cat > $TMPC << EOF
5316 #ifdef CONFIG_SDL_SDL_H
5317 #include <SDL/SDL.h>
5318 #else
5319 #include <SDL.h>
5320 #endif
5321 #ifndef __APPLE__
5322 // we allow SDL hacking our main() only on OSX
5323 #undef main
5324 #endif
5325 int main(int argc, char *argv[]) {
5326 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5327 return 0;
5330 _sdl=no
5331 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" ; do
5332 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5333 _sdl=yes
5334 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5335 break
5337 done
5338 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5339 _res_comment="using $_sdlconfig"
5340 if cygwin ; then
5341 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5342 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5343 elif mingw32 ; then
5344 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5345 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5346 else
5347 _inc_tmp="$($_sdlconfig --cflags)"
5348 _ld_tmp="$($_sdlconfig --libs)"
5350 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5351 _sdlversion=$($_sdlconfig --version | sed 's/[^0-9]//g')
5352 if test "$_sdlversion" -gt 116 ; then
5353 if test "$_sdlversion" -lt 121 ; then
5354 def_sdlbuggy='#define BUGGY_SDL'
5355 else
5356 def_sdlbuggy='#undef BUGGY_SDL'
5358 _sdl=yes
5363 if test "$_sdl" = yes ; then
5364 def_sdl='#define CONFIG_SDL 1'
5365 extra_cflags="$extra_cflags $_inc_tmp"
5366 libs_mplayer="$libs_mplayer $_ld_tmp"
5367 _vomodules="sdl $_vomodules"
5368 _aomodules="sdl $_aomodules"
5369 else
5370 def_sdl='#undef CONFIG_SDL'
5371 _novomodules="sdl $_novomodules"
5372 _noaomodules="sdl $_noaomodules"
5374 echores "$_sdl"
5377 if os2 ; then
5378 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5379 if test "$_kva" = auto; then
5380 cat > $TMPC << EOF
5381 #include <os2.h>
5382 #include <kva.h>
5383 int main( void ) { return 0; }
5385 _kva=no;
5386 cc_check -lkva && _kva=yes
5388 if test "$_kva" = yes ; then
5389 def_kva='#define CONFIG_KVA 1'
5390 libs_mplayer="$libs_mplayer -lkva"
5391 _vomodules="kva $_vomodules"
5392 else
5393 def_kva='#undef CONFIG_KVA'
5394 _novomodules="kva $_novomodules"
5396 echores "$_kva"
5397 fi #if os2
5400 if win32; then
5402 echocheck "Windows waveout"
5403 if test "$_win32waveout" = auto ; then
5404 cat > $TMPC << EOF
5405 #include <windows.h>
5406 #include <mmsystem.h>
5407 int main(void) { return 0; }
5409 _win32waveout=no
5410 cc_check -lwinmm && _win32waveout=yes
5412 if test "$_win32waveout" = yes ; then
5413 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5414 libs_mplayer="$libs_mplayer -lwinmm"
5415 _aomodules="win32 $_aomodules"
5416 else
5417 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5418 _noaomodules="win32 $_noaomodules"
5420 echores "$_win32waveout"
5422 echocheck "Direct3D"
5423 if test "$_direct3d" = auto ; then
5424 cat > $TMPC << EOF
5425 #include <windows.h>
5426 #include <d3d9.h>
5427 int main(void) { return 0; }
5429 _direct3d=no
5430 cc_check && _direct3d=yes
5432 if test "$_direct3d" = yes ; then
5433 def_direct3d='#define CONFIG_DIRECT3D 1'
5434 _vomodules="direct3d $_vomodules"
5435 else
5436 def_direct3d='#undef CONFIG_DIRECT3D'
5437 _novomodules="direct3d $_novomodules"
5439 echores "$_direct3d"
5441 echocheck "Directx"
5442 if test "$_directx" = auto ; then
5443 cat > $TMPC << EOF
5444 #include <windows.h>
5445 #include <ddraw.h>
5446 #include <dsound.h>
5447 int main(void) { return 0; }
5449 _directx=no
5450 cc_check -lgdi32 && _directx=yes
5452 if test "$_directx" = yes ; then
5453 def_directx='#define CONFIG_DIRECTX 1'
5454 libs_mplayer="$libs_mplayer -lgdi32"
5455 _vomodules="directx $_vomodules"
5456 _aomodules="dsound $_aomodules"
5457 else
5458 def_directx='#undef CONFIG_DIRECTX'
5459 _novomodules="directx $_novomodules"
5460 _noaomodules="dsound $_noaomodules"
5462 echores "$_directx"
5464 fi #if win32; then
5467 echocheck "DXR2"
5468 if test "$_dxr2" = auto; then
5469 _dxr2=no
5470 cat > $TMPC << EOF
5471 #include <dxr2ioctl.h>
5472 int main(void) { return 0; }
5474 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5475 cc_check $_inc_tmp && _dxr2=yes && \
5476 extra_cflags="$extra_cflags $_inc_tmp" && break
5477 done
5479 if test "$_dxr2" = yes; then
5480 def_dxr2='#define CONFIG_DXR2 1'
5481 _aomodules="dxr2 $_aomodules"
5482 _vomodules="dxr2 $_vomodules"
5483 else
5484 def_dxr2='#undef CONFIG_DXR2'
5485 _noaomodules="dxr2 $_noaomodules"
5486 _novomodules="dxr2 $_novomodules"
5488 echores "$_dxr2"
5490 echocheck "DXR3/H+"
5491 if test "$_dxr3" = auto ; then
5492 cat > $TMPC << EOF
5493 #include <linux/em8300.h>
5494 int main(void) { return 0; }
5496 _dxr3=no
5497 cc_check && _dxr3=yes
5499 if test "$_dxr3" = yes ; then
5500 def_dxr3='#define CONFIG_DXR3 1'
5501 _vomodules="dxr3 $_vomodules"
5502 else
5503 def_dxr3='#undef CONFIG_DXR3'
5504 _novomodules="dxr3 $_novomodules"
5506 echores "$_dxr3"
5509 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5510 if test "$_ivtv" = auto ; then
5511 cat > $TMPC << EOF
5512 #include <stdlib.h>
5513 #include <inttypes.h>
5514 #include <linux/types.h>
5515 #include <linux/videodev2.h>
5516 #include <linux/ivtv.h>
5517 #include <sys/ioctl.h>
5518 int main(void) {
5519 struct ivtv_cfg_stop_decode sd;
5520 struct ivtv_cfg_start_decode sd1;
5521 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5522 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5523 return 0; }
5525 _ivtv=no
5526 cc_check && _ivtv=yes
5528 if test "$_ivtv" = yes ; then
5529 def_ivtv='#define CONFIG_IVTV 1'
5530 _vomodules="ivtv $_vomodules"
5531 _aomodules="ivtv $_aomodules"
5532 else
5533 def_ivtv='#undef CONFIG_IVTV'
5534 _novomodules="ivtv $_novomodules"
5535 _noaomodules="ivtv $_noaomodules"
5537 echores "$_ivtv"
5540 echocheck "V4L2 MPEG Decoder"
5541 if test "$_v4l2" = auto ; then
5542 cat > $TMPC << EOF
5543 #include <stdlib.h>
5544 #include <inttypes.h>
5545 #include <linux/types.h>
5546 #include <linux/videodev2.h>
5547 #include <linux/version.h>
5548 int main(void) {
5549 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5550 #error kernel headers too old, need 2.6.22
5551 #endif
5552 struct v4l2_ext_controls ctrls;
5553 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5554 return 0;
5557 _v4l2=no
5558 cc_check && _v4l2=yes
5560 if test "$_v4l2" = yes ; then
5561 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5562 _vomodules="v4l2 $_vomodules"
5563 _aomodules="v4l2 $_aomodules"
5564 else
5565 def_v4l2='#undef CONFIG_V4L2_DECODER'
5566 _novomodules="v4l2 $_novomodules"
5567 _noaomodules="v4l2 $_noaomodules"
5569 echores "$_v4l2"
5573 #########
5574 # AUDIO #
5575 #########
5578 echocheck "OSS Audio"
5579 if test "$_ossaudio" = auto ; then
5580 cat > $TMPC << EOF
5581 #include <sys/ioctl.h>
5582 #include <$_soundcard_header>
5583 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5585 _ossaudio=no
5586 cc_check && _ossaudio=yes
5588 if test "$_ossaudio" = yes ; then
5589 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5590 _aomodules="oss $_aomodules"
5591 if test "$_linux_devfs" = yes; then
5592 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5593 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5594 else
5595 cat > $TMPC << EOF
5596 #include <sys/ioctl.h>
5597 #include <$_soundcard_header>
5598 #ifdef OPEN_SOUND_SYSTEM
5599 int main(void) { return 0; }
5600 #else
5601 #error Not the real thing
5602 #endif
5604 _real_ossaudio=no
5605 cc_check && _real_ossaudio=yes
5606 if test "$_real_ossaudio" = yes; then
5607 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5608 elif netbsd || openbsd ; then
5609 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5610 extra_ldflags="$extra_ldflags -lossaudio"
5611 else
5612 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5614 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5616 else
5617 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5618 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5619 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5620 _noaomodules="oss $_noaomodules"
5622 echores "$_ossaudio"
5625 echocheck "aRts"
5626 if test "$_arts" = auto ; then
5627 _arts=no
5628 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5630 cat > $TMPC << EOF
5631 #include <artsc.h>
5632 int main(void) { return 0; }
5634 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5639 if test "$_arts" = yes ; then
5640 def_arts='#define CONFIG_ARTS 1'
5641 _aomodules="arts $_aomodules"
5642 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5643 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5644 else
5645 _noaomodules="arts $_noaomodules"
5647 echores "$_arts"
5650 echocheck "EsounD"
5651 if test "$_esd" = auto ; then
5652 _esd=no
5653 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5655 cat > $TMPC << EOF
5656 #include <esd.h>
5657 int main(void) { int fd = esd_open_sound("test"); return fd; }
5659 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5663 echores "$_esd"
5665 if test "$_esd" = yes ; then
5666 def_esd='#define CONFIG_ESD 1'
5667 _aomodules="esd $_aomodules"
5668 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5669 extra_cflags="$extra_cflags $(esd-config --cflags)"
5671 echocheck "esd_get_latency()"
5672 cat > $TMPC << EOF
5673 #include <esd.h>
5674 int main(void) { return esd_get_latency(0); }
5676 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5677 echores "$_esd_latency"
5678 else
5679 def_esd='#undef CONFIG_ESD'
5680 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5681 _noaomodules="esd $_noaomodules"
5685 echocheck "NAS"
5686 if test "$_nas" = auto ; then
5687 cat > $TMPC << EOF
5688 #include <audio/audiolib.h>
5689 int main(void) { return 0; }
5691 _nas=no
5692 cc_check $_ld_lm -laudio -lXt && _nas=yes
5694 if test "$_nas" = yes ; then
5695 def_nas='#define CONFIG_NAS 1'
5696 libs_mplayer="$libs_mplayer -laudio -lXt"
5697 _aomodules="nas $_aomodules"
5698 else
5699 _noaomodules="nas $_noaomodules"
5700 def_nas='#undef CONFIG_NAS'
5702 echores "$_nas"
5705 echocheck "pulse"
5706 if test "$_pulse" = auto ; then
5707 _pulse=no
5708 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5710 cat > $TMPC << EOF
5711 #include <pulse/pulseaudio.h>
5712 int main(void) { return 0; }
5714 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5718 echores "$_pulse"
5720 if test "$_pulse" = yes ; then
5721 def_pulse='#define CONFIG_PULSE 1'
5722 _aomodules="pulse $_aomodules"
5723 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5724 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5725 else
5726 def_pulse='#undef CONFIG_PULSE'
5727 _noaomodules="pulse $_noaomodules"
5731 echocheck "JACK"
5732 if test "$_jack" = auto ; then
5733 _jack=yes
5735 cat > $TMPC << EOF
5736 #include <jack/jack.h>
5737 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5739 if cc_check -ljack ; then
5740 libs_mplayer="$libs_mplayer -ljack"
5741 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5742 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5743 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5744 else
5745 _jack=no
5749 if test "$_jack" = yes ; then
5750 def_jack='#define CONFIG_JACK 1'
5751 _aomodules="jack $_aomodules"
5752 else
5753 _noaomodules="jack $_noaomodules"
5755 echores "$_jack"
5757 echocheck "OpenAL"
5758 if test "$_openal" = auto ; then
5759 _openal=no
5760 cat > $TMPC << EOF
5761 #ifdef OPENAL_AL_H
5762 #include <OpenAL/al.h>
5763 #else
5764 #include <AL/al.h>
5765 #endif
5766 int main(void) {
5767 alSourceQueueBuffers(0, 0, 0);
5768 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5769 return 0;
5772 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5773 cc_check $I && _openal=yes && break
5774 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5775 done
5776 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5778 if test "$_openal" = yes ; then
5779 def_openal='#define CONFIG_OPENAL 1'
5780 _aomodules="openal $_aomodules"
5781 else
5782 _noaomodules="openal $_noaomodules"
5784 echores "$_openal"
5786 echocheck "ALSA audio"
5787 if test "$_alloca" != yes ; then
5788 _alsa=no
5789 _res_comment="alloca missing"
5791 if test "$_alsa" != no ; then
5792 _alsa=no
5793 cat > $TMPC << EOF
5794 #include <sys/time.h>
5795 #include <sys/asoundlib.h>
5796 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5797 #error "alsa version != 0.5.x"
5798 #endif
5799 int main(void) { return 0; }
5801 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5803 cat > $TMPC << EOF
5804 #include <sys/time.h>
5805 #include <sys/asoundlib.h>
5806 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5807 #error "alsa version != 0.9.x"
5808 #endif
5809 int main(void) { return 0; }
5811 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5812 cat > $TMPC << EOF
5813 #include <sys/time.h>
5814 #include <alsa/asoundlib.h>
5815 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5816 #error "alsa version != 0.9.x"
5817 #endif
5818 int main(void) { return 0; }
5820 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5822 cat > $TMPC << EOF
5823 #include <sys/time.h>
5824 #include <sys/asoundlib.h>
5825 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5826 #error "alsa version != 1.0.x"
5827 #endif
5828 int main(void) { return 0; }
5830 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5831 cat > $TMPC << EOF
5832 #include <sys/time.h>
5833 #include <alsa/asoundlib.h>
5834 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5835 #error "alsa version != 1.0.x"
5836 #endif
5837 int main(void) { return 0; }
5839 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5841 def_alsa='#undef CONFIG_ALSA'
5842 def_alsa5='#undef CONFIG_ALSA5'
5843 def_alsa9='#undef CONFIG_ALSA9'
5844 def_alsa1x='#undef CONFIG_ALSA1X'
5845 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5846 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5847 if test "$_alsaver" ; then
5848 _alsa=yes
5849 if test "$_alsaver" = '0.5.x' ; then
5850 _alsa5=yes
5851 _aomodules="alsa5 $_aomodules"
5852 def_alsa5='#define CONFIG_ALSA5 1'
5853 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5854 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5855 elif test "$_alsaver" = '0.9.x-sys' ; then
5856 _alsa9=yes
5857 _aomodules="alsa $_aomodules"
5858 def_alsa='#define CONFIG_ALSA 1'
5859 def_alsa9='#define CONFIG_ALSA9 1'
5860 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5861 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5862 elif test "$_alsaver" = '0.9.x-alsa' ; then
5863 _alsa9=yes
5864 _aomodules="alsa $_aomodules"
5865 def_alsa='#define CONFIG_ALSA 1'
5866 def_alsa9='#define CONFIG_ALSA9 1'
5867 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5868 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5869 elif test "$_alsaver" = '1.0.x-sys' ; then
5870 _alsa1x=yes
5871 _aomodules="alsa $_aomodules"
5872 def_alsa='#define CONFIG_ALSA 1'
5873 def_alsa1x="#define CONFIG_ALSA1X 1"
5874 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5875 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5876 elif test "$_alsaver" = '1.0.x-alsa' ; then
5877 _alsa1x=yes
5878 _aomodules="alsa $_aomodules"
5879 def_alsa='#define CONFIG_ALSA 1'
5880 def_alsa1x="#define CONFIG_ALSA1X 1"
5881 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5882 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5883 else
5884 _alsa=no
5885 _res_comment="unknown version"
5887 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5888 else
5889 _noaomodules="alsa $_noaomodules"
5891 echores "$_alsa"
5894 echocheck "Sun audio"
5895 if test "$_sunaudio" = auto ; then
5896 cat > $TMPC << EOF
5897 #include <sys/types.h>
5898 #include <sys/audioio.h>
5899 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5901 _sunaudio=no
5902 cc_check && _sunaudio=yes
5904 if test "$_sunaudio" = yes ; then
5905 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5906 _aomodules="sun $_aomodules"
5907 else
5908 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5909 _noaomodules="sun $_noaomodules"
5911 echores "$_sunaudio"
5914 def_mlib='#define CONFIG_MLIB 0'
5915 if sunos; then
5916 echocheck "Sun mediaLib"
5917 if test "$_mlib" = auto ; then
5918 _mlib=no
5919 cat > $TMPC << EOF
5920 #include <mlib.h>
5921 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5923 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5925 echores "$_mlib"
5926 fi #if sunos
5929 if darwin; then
5930 echocheck "CoreAudio"
5931 if test "$_coreaudio" = auto ; then
5932 cat > $TMPC <<EOF
5933 #include <CoreAudio/CoreAudio.h>
5934 #include <AudioToolbox/AudioToolbox.h>
5935 #include <AudioUnit/AudioUnit.h>
5936 int main(void) { return 0; }
5938 _coreaudio=no
5939 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5941 if test "$_coreaudio" = yes ; then
5942 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5943 def_coreaudio='#define CONFIG_COREAUDIO 1'
5944 _aomodules="coreaudio $_aomodules"
5945 else
5946 def_coreaudio='#undef CONFIG_COREAUDIO'
5947 _noaomodules="coreaudio $_noaomodules"
5949 echores $_coreaudio
5950 fi #if darwin
5953 if irix; then
5954 echocheck "SGI audio"
5955 if test "$_sgiaudio" = auto ; then
5956 # check for SGI audio
5957 cat > $TMPC << EOF
5958 #include <dmedia/audio.h>
5959 int main(void) { return 0; }
5961 _sgiaudio=no
5962 cc_check && _sgiaudio=yes
5964 if test "$_sgiaudio" = "yes" ; then
5965 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5966 libs_mplayer="$libs_mplayer -laudio"
5967 _aomodules="sgi $_aomodules"
5968 else
5969 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5970 _noaomodules="sgi $_noaomodules"
5972 echores "$_sgiaudio"
5973 fi #if irix
5976 if os2 ; then
5977 echocheck "DART"
5978 if test "$_dart" = auto; then
5979 cat > $TMPC << EOF
5980 #include <os2.h>
5981 #include <dart.h>
5982 int main( void ) { return 0; }
5984 _dart=no;
5985 cc_check -ldart && _dart=yes
5987 if test "$_dart" = yes ; then
5988 def_dart='#define CONFIG_DART 1'
5989 libs_mplayer="$libs_mplayer -ldart"
5990 _aomodules="dart $_aomodules"
5991 else
5992 def_dart='#undef CONFIG_DART'
5993 _noaomodules="dart $_noaomodules"
5995 echores "$_dart"
5996 fi #if os2
5999 # set default CD/DVD devices
6000 if win32 || os2 ; then
6001 default_cdrom_device="D:"
6002 elif darwin ; then
6003 default_cdrom_device="/dev/disk1"
6004 elif dragonfly ; then
6005 default_cdrom_device="/dev/cd0"
6006 elif freebsd ; then
6007 default_cdrom_device="/dev/acd0"
6008 elif openbsd ; then
6009 default_cdrom_device="/dev/rcd0a"
6010 elif sunos ; then
6011 default_cdrom_device="/vol/dev/aliases/cdrom0"
6012 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
6013 # file system and the volfs service.
6014 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
6015 elif amigaos ; then
6016 default_cdrom_device="a1ide.device:2"
6017 else
6018 default_cdrom_device="/dev/cdrom"
6021 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
6022 default_dvd_device=$default_cdrom_device
6023 elif darwin ; then
6024 default_dvd_device="/dev/rdiskN"
6025 else
6026 default_dvd_device="/dev/dvd"
6030 echocheck "VCD support"
6031 if test "$_vcd" = auto; then
6032 _vcd=no
6033 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
6034 _vcd=yes
6035 elif mingw32; then
6036 cat > $TMPC << EOF
6037 #include <ddk/ntddcdrm.h>
6038 int main(void) { return 0; }
6040 cc_check && _vcd=yes
6043 if test "$_vcd" = yes; then
6044 _inputmodules="vcd $_inputmodules"
6045 def_vcd='#define CONFIG_VCD 1'
6046 else
6047 def_vcd='#undef CONFIG_VCD'
6048 _noinputmodules="vcd $_noinputmodules"
6049 _res_comment="not supported on this OS"
6051 echores "$_vcd"
6055 echocheck "dvdread"
6056 if test "$_dvdread_internal" = auto ; then
6057 _dvdread_internal=no
6058 _dvdread=no
6059 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
6060 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
6061 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
6062 || darwin || win32 || os2; then
6063 _dvdread_internal=yes
6064 _dvdread=yes
6065 extra_cflags="-Ilibdvdread4 $extra_cflags"
6067 elif test "$_dvdread" = auto ; then
6068 _dvdread=no
6069 if test "$_dl" = yes; then
6070 cat > $TMPC << EOF
6071 #include <inttypes.h>
6072 #include <dvdread/dvd_reader.h>
6073 #include <dvdread/ifo_types.h>
6074 #include <dvdread/ifo_read.h>
6075 #include <dvdread/nav_read.h>
6076 int main(void) { return 0; }
6078 _dvdreadcflags=$($_dvdreadconfig --cflags)
6079 _dvdreadlibs=$($_dvdreadconfig --libs)
6080 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
6081 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
6082 _dvdread=yes
6083 extra_cflags="$extra_cflags $_dvdreadcflags"
6084 extra_ldflags="$extra_ldflags $_dvdreadlibs"
6085 _res_comment="external"
6090 if test "$_dvdread_internal" = yes; then
6091 def_dvdread='#define CONFIG_DVDREAD 1'
6092 _inputmodules="dvdread(internal) $_inputmodules"
6093 _largefiles=yes
6094 _res_comment="internal"
6095 elif test "$_dvdread" = yes; then
6096 def_dvdread='#define CONFIG_DVDREAD 1'
6097 _largefiles=yes
6098 extra_ldflags="$extra_ldflags -ldvdread"
6099 _inputmodules="dvdread(external) $_inputmodules"
6100 _res_comment="external"
6101 else
6102 def_dvdread='#undef CONFIG_DVDREAD'
6103 _noinputmodules="dvdread $_noinputmodules"
6105 echores "$_dvdread"
6108 echocheck "internal libdvdcss"
6109 if test "$_libdvdcss_internal" = auto ; then
6110 _libdvdcss_internal=no
6111 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
6112 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
6114 if test "$_libdvdcss_internal" = yes ; then
6115 if linux || netbsd || openbsd || bsdos ; then
6116 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
6117 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
6118 elif freebsd || dragonfly ; then
6119 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
6120 elif darwin ; then
6121 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
6122 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
6123 elif cygwin ; then
6124 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
6125 elif beos ; then
6126 cflags_libdvdcss="-DSYS_BEOS"
6127 elif os2 ; then
6128 cflags_libdvdcss="-DSYS_OS2"
6130 cflags_libdvdcss_dvdread="-Ilibdvdcss"
6131 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
6132 _inputmodules="libdvdcss(internal) $_inputmodules"
6133 _largefiles=yes
6134 else
6135 _noinputmodules="libdvdcss(internal) $_noinputmodules"
6137 echores "$_libdvdcss_internal"
6140 echocheck "cdparanoia"
6141 if test "$_cdparanoia" = auto ; then
6142 cat > $TMPC <<EOF
6143 #include <cdda_interface.h>
6144 #include <cdda_paranoia.h>
6145 // This need a better test. How ?
6146 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
6148 _cdparanoia=no
6149 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
6150 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
6151 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
6152 done
6154 if test "$_cdparanoia" = yes ; then
6155 _cdda='yes'
6156 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
6157 openbsd && extra_ldflags="$extra_ldflags -lutil"
6159 echores "$_cdparanoia"
6162 echocheck "libcdio"
6163 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
6164 cat > $TMPC << EOF
6165 #include <stdio.h>
6166 #include <cdio/version.h>
6167 #include <cdio/cdda.h>
6168 #include <cdio/paranoia.h>
6169 int main(void) {
6170 void *test = cdda_verbose_set;
6171 printf("%s\n", CDIO_VERSION);
6172 return test == (void *)1;
6175 _libcdio=no
6176 for _ld_tmp in "" "-lwinmm" ; do
6177 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6178 cc_check $_ld_tmp $_ld_lm \
6179 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6180 done
6181 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6182 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6183 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6184 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6185 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6188 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6189 _cdda='yes'
6190 def_libcdio='#define CONFIG_LIBCDIO 1'
6191 def_havelibcdio='yes'
6192 else
6193 if test "$_cdparanoia" = yes ; then
6194 _res_comment="using cdparanoia"
6196 def_libcdio='#undef CONFIG_LIBCDIO'
6197 def_havelibcdio='no'
6199 echores "$_libcdio"
6201 if test "$_cdda" = yes ; then
6202 test $_cddb = auto && test $_network = yes && _cddb=yes
6203 def_cdparanoia='#define CONFIG_CDDA 1'
6204 _inputmodules="cdda $_inputmodules"
6205 else
6206 def_cdparanoia='#undef CONFIG_CDDA'
6207 _noinputmodules="cdda $_noinputmodules"
6210 if test "$_cddb" = yes ; then
6211 def_cddb='#define CONFIG_CDDB 1'
6212 _inputmodules="cddb $_inputmodules"
6213 else
6214 _cddb=no
6215 def_cddb='#undef CONFIG_CDDB'
6216 _noinputmodules="cddb $_noinputmodules"
6219 echocheck "bitmap font support"
6220 if test "$_bitmap_font" = yes ; then
6221 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6222 else
6223 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6225 echores "$_bitmap_font"
6228 echocheck "freetype >= 2.0.9"
6230 # freetype depends on iconv
6231 if test "$_iconv" = no ; then
6232 _freetype=no
6233 _res_comment="iconv support needed"
6236 if test "$_freetype" = auto ; then
6237 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6238 cat > $TMPC << EOF
6239 #include <stdio.h>
6240 #include <ft2build.h>
6241 #include FT_FREETYPE_H
6242 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6243 #error "Need FreeType 2.0.9 or newer"
6244 #endif
6245 int main(void) {
6246 FT_Library library;
6247 FT_Int major=-1,minor=-1,patch=-1;
6248 int err=FT_Init_FreeType(&library);
6249 return 0;
6252 _freetype=no
6253 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6254 else
6255 _freetype=no
6258 if test "$_freetype" = yes ; then
6259 def_freetype='#define CONFIG_FREETYPE 1'
6260 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6261 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6262 else
6263 def_freetype='#undef CONFIG_FREETYPE'
6265 echores "$_freetype"
6267 if test "$_freetype" = no ; then
6268 _fontconfig=no
6269 _res_comment="FreeType support needed"
6271 echocheck "fontconfig"
6272 if test "$_fontconfig" = auto ; then
6273 cat > $TMPC << EOF
6274 #include <stdio.h>
6275 #include <stdlib.h>
6276 #include <fontconfig/fontconfig.h>
6277 int main(void) {
6278 int err = FcInit();
6279 if (err == FcFalse) {
6280 printf("Couldn't initialize fontconfig lib\n");
6281 exit(err);
6283 return 0;
6286 _fontconfig=no
6287 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6288 _ld_tmp="-lfontconfig $_ld_tmp"
6289 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6290 done
6291 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6292 _inc_tmp=$($_pkg_config --cflags fontconfig)
6293 _ld_tmp=$($_pkg_config --libs fontconfig)
6294 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6295 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6298 if test "$_fontconfig" = yes ; then
6299 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6300 else
6301 def_fontconfig='#undef CONFIG_FONTCONFIG'
6303 echores "$_fontconfig"
6306 echocheck "SSA/ASS support"
6307 # libass depends on FreeType
6308 if test "$_freetype" = no ; then
6309 _ass=no
6310 ass_internal=no
6311 _res_comment="FreeType support needed"
6314 if test "$_ass" = auto ; then
6315 cat > $TMPC << EOF
6316 #include <ft2build.h>
6317 #include FT_FREETYPE_H
6318 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
6319 #error "Need FreeType 2.2.1 or newer"
6320 #endif
6321 int main(void) { return 0; }
6323 _ass=no
6324 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
6325 if test "$_ass" = no ; then
6326 ass_internal=no
6327 _res_comment="FreeType >= 2.2.1 needed"
6328 elif test "$ass_internal" = no ; then
6329 _res_comment="external"
6330 extra_ldflags="$extra_ldflags -lass"
6333 if test "$_ass" = yes ; then
6334 def_ass='#define CONFIG_ASS 1'
6335 else
6336 def_ass='#undef CONFIG_ASS'
6338 if test "$ass_internal" = yes ; then
6339 def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
6340 else
6341 def_ass_internal='#undef CONFIG_ASS_INTERNAL'
6343 echores "$_ass"
6346 echocheck "fribidi with charsets"
6347 _inc_tmp=""
6348 _ld_tmp=""
6349 if test "$_fribidi" = auto ; then
6350 cat > $TMPC << EOF
6351 #include <stdio.h>
6352 #include <stdlib.h>
6353 /* workaround for fribidi 0.10.4 and below */
6354 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6355 #include <fribidi/fribidi.h>
6356 int main(void) {
6357 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6358 printf("Fribidi headers are not consistents with the library!\n");
6359 exit(1);
6361 return 0;
6364 _fribidi=no
6365 _inc_tmp=""
6366 _ld_tmp="-lfribidi"
6367 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6368 if $_fribidiconfig --version > /dev/null 2>&1 &&
6369 test "$_fribidi" = no ; then
6370 _inc_tmp="$($_fribidiconfig --cflags)"
6371 _ld_tmp="$($_fribidiconfig --libs)"
6372 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6375 if test "$_fribidi" = yes ; then
6376 def_fribidi='#define CONFIG_FRIBIDI 1'
6377 extra_cflags="$extra_cflags $_inc_tmp"
6378 extra_ldflags="$extra_ldflags $_ld_tmp"
6379 else
6380 def_fribidi='#undef CONFIG_FRIBIDI'
6382 echores "$_fribidi"
6385 echocheck "ENCA"
6386 if test "$_enca" = auto ; then
6387 cat > $TMPC << EOF
6388 #include <sys/types.h>
6389 #include <enca.h>
6390 int main(void) {
6391 const char **langs;
6392 size_t langcnt;
6393 langs = enca_get_languages(&langcnt);
6394 return 0;
6397 _enca=no
6398 cc_check -lenca $_ld_lm && _enca=yes
6400 if test "$_enca" = yes ; then
6401 def_enca='#define CONFIG_ENCA 1'
6402 extra_ldflags="$extra_ldflags -lenca"
6403 else
6404 def_enca='#undef CONFIG_ENCA'
6406 echores "$_enca"
6409 echocheck "zlib"
6410 cat > $TMPC << EOF
6411 #include <zlib.h>
6412 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6414 _zlib=no
6415 cc_check -lz && _zlib=yes
6416 if test "$_zlib" = yes ; then
6417 def_zlib='#define CONFIG_ZLIB 1'
6418 extra_ldflags="$extra_ldflags -lz"
6419 else
6420 def_zlib='#define CONFIG_ZLIB 0'
6421 _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//)
6422 _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
6424 echores "$_zlib"
6427 echocheck "bzlib"
6428 bzlib=no
6429 def_bzlib='#define CONFIG_BZLIB 0'
6430 cat > $TMPC << EOF
6431 #include <bzlib.h>
6432 int main(void) { BZ2_bzlibVersion(); return 0; }
6434 cc_check -lbz2 && bzlib=yes
6435 if test "$bzlib" = yes ; then
6436 def_bzlib='#define CONFIG_BZLIB 1'
6437 extra_ldflags="$extra_ldflags -lbz2"
6439 echores "$bzlib"
6442 echocheck "RTC"
6443 if test "$_rtc" = auto ; then
6444 cat > $TMPC << EOF
6445 #include <sys/ioctl.h>
6446 #ifdef __linux__
6447 #include <linux/rtc.h>
6448 #else
6449 #include <rtc.h>
6450 #define RTC_PIE_ON RTCIO_PIE_ON
6451 #endif
6452 int main(void) { return RTC_PIE_ON; }
6454 _rtc=no
6455 cc_check && _rtc=yes
6456 ppc && _rtc=no
6458 if test "$_rtc" = yes ; then
6459 def_rtc='#define HAVE_RTC 1'
6460 else
6461 def_rtc='#undef HAVE_RTC'
6463 echores "$_rtc"
6466 echocheck "liblzo2 support"
6467 if test "$_liblzo" = auto ; then
6468 _liblzo=no
6469 cat > $TMPC << EOF
6470 #include <lzo/lzo1x.h>
6471 int main(void) { lzo_init();return 0; }
6473 cc_check -llzo2 && _liblzo=yes
6475 if test "$_liblzo" = yes ; then
6476 def_liblzo='#define CONFIG_LIBLZO 1'
6477 extra_ldflags="$extra_ldflags -llzo2"
6478 _codecmodules="liblzo $_codecmodules"
6479 else
6480 def_liblzo='#undef CONFIG_LIBLZO'
6481 _nocodecmodules="liblzo $_nocodecmodules"
6483 echores "$_liblzo"
6486 echocheck "mad support"
6487 if test "$_mad" = auto ; then
6488 _mad=no
6489 cat > $TMPC << EOF
6490 #include <mad.h>
6491 int main(void) { return 0; }
6493 cc_check -lmad && _mad=yes
6495 if test "$_mad" = yes ; then
6496 def_mad='#define CONFIG_LIBMAD 1'
6497 extra_ldflags="$extra_ldflags -lmad"
6498 _codecmodules="libmad $_codecmodules"
6499 else
6500 def_mad='#undef CONFIG_LIBMAD'
6501 _nocodecmodules="libmad $_nocodecmodules"
6503 echores "$_mad"
6505 echocheck "Twolame"
6506 if test "$_twolame" = auto ; then
6507 cat > $TMPC <<EOF
6508 #include <twolame.h>
6509 int main(void) { twolame_init(); return 0; }
6511 _twolame=no
6512 cc_check -ltwolame $_ld_lm && _twolame=yes
6514 if test "$_twolame" = yes ; then
6515 def_twolame='#define CONFIG_TWOLAME 1'
6516 libs_mencoder="$libs_mencoder -ltwolame"
6517 _codecmodules="twolame $_codecmodules"
6518 else
6519 def_twolame='#undef CONFIG_TWOLAME'
6520 _nocodecmodules="twolame $_nocodecmodules"
6522 echores "$_twolame"
6524 echocheck "Toolame"
6525 if test "$_toolame" = auto ; then
6526 _toolame=no
6527 if test "$_twolame" = yes ; then
6528 _res_comment="disabled by twolame"
6529 else
6530 cat > $TMPC <<EOF
6531 #include <toolame.h>
6532 int main(void) { toolame_init(); return 0; }
6534 cc_check -ltoolame $_ld_lm && _toolame=yes
6537 if test "$_toolame" = yes ; then
6538 def_toolame='#define CONFIG_TOOLAME 1'
6539 libs_mencoder="$libs_mencoder -ltoolame"
6540 _codecmodules="toolame $_codecmodules"
6541 else
6542 def_toolame='#undef CONFIG_TOOLAME'
6543 _nocodecmodules="toolame $_nocodecmodules"
6545 if test "$_toolamedir" ; then
6546 _res_comment="using $_toolamedir"
6548 echores "$_toolame"
6550 echocheck "OggVorbis support"
6551 if test "$_tremor_internal" = yes; then
6552 _libvorbis=no
6553 elif test "$_tremor" = auto; then
6554 _tremor=no
6555 cat > $TMPC << EOF
6556 #include <tremor/ivorbiscodec.h>
6557 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6559 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6561 if test "$_libvorbis" = auto; then
6562 _libvorbis=no
6563 cat > $TMPC << EOF
6564 #include <vorbis/codec.h>
6565 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6567 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6569 if test "$_tremor_internal" = yes ; then
6570 _vorbis=yes
6571 def_vorbis='#define CONFIG_OGGVORBIS 1'
6572 def_tremor='#define CONFIG_TREMOR 1'
6573 _codecmodules="tremor(internal) $_codecmodules"
6574 _res_comment="internal Tremor"
6575 if test "$_tremor_low" = yes ; then
6576 cflags_tremor_low="-D_LOW_ACCURACY_"
6577 _res_comment="internal low accuracy Tremor"
6579 elif test "$_tremor" = yes ; then
6580 _vorbis=yes
6581 def_vorbis='#define CONFIG_OGGVORBIS 1'
6582 def_tremor='#define CONFIG_TREMOR 1'
6583 _codecmodules="tremor(external) $_codecmodules"
6584 _res_comment="external Tremor"
6585 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6586 elif test "$_libvorbis" = yes ; then
6587 _vorbis=yes
6588 def_vorbis='#define CONFIG_OGGVORBIS 1'
6589 _codecmodules="libvorbis $_codecmodules"
6590 _res_comment="libvorbis"
6591 extra_ldflags="$extra_ldflags -lvorbis -logg"
6592 else
6593 _vorbis=no
6594 _nocodecmodules="libvorbis $_nocodecmodules"
6596 echores "$_vorbis"
6598 echocheck "libspeex (version >= 1.1 required)"
6599 if test "$_speex" = auto ; then
6600 _speex=no
6601 cat > $TMPC << EOF
6602 #include <speex/speex.h>
6603 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6605 cc_check -lspeex $_ld_lm && _speex=yes
6607 if test "$_speex" = yes ; then
6608 def_speex='#define CONFIG_SPEEX 1'
6609 extra_ldflags="$extra_ldflags -lspeex"
6610 _codecmodules="speex $_codecmodules"
6611 else
6612 def_speex='#undef CONFIG_SPEEX'
6613 _nocodecmodules="speex $_nocodecmodules"
6615 echores "$_speex"
6617 echocheck "OggTheora support"
6618 if test "$_theora" = auto ; then
6619 _theora=no
6620 cat > $TMPC << EOF
6621 #include <theora/theora.h>
6622 #include <string.h>
6623 int main(void) {
6624 /* Theora is in flux, make sure that all interface routines and datatypes
6625 * exist and work the way we expect it, so we don't break MPlayer. */
6626 ogg_packet op;
6627 theora_comment tc;
6628 theora_info inf;
6629 theora_state st;
6630 yuv_buffer yuv;
6631 int r;
6632 double t;
6634 theora_info_init(&inf);
6635 theora_comment_init(&tc);
6637 return 0;
6639 /* we don't want to execute this kind of nonsense; just for making sure
6640 * that compilation works... */
6641 memset(&op, 0, sizeof(op));
6642 r = theora_decode_header(&inf, &tc, &op);
6643 r = theora_decode_init(&st, &inf);
6644 t = theora_granule_time(&st, op.granulepos);
6645 r = theora_decode_packetin(&st, &op);
6646 r = theora_decode_YUVout(&st, &yuv);
6647 theora_clear(&st);
6649 return 0;
6652 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6653 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6654 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6655 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6656 if test _theora = no; then
6657 _ld_theora="-ltheora -logg"
6658 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6660 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6661 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6662 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6663 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6664 extra_ldflags="$extra_ldflags $_ld_theora" &&
6665 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6666 if test _theora = no; then
6667 _ld_theora="-ltheora -logg"
6668 cc_check tremor/bitwise.c $_ld_theora &&
6669 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6673 if test "$_theora" = yes ; then
6674 def_theora='#define CONFIG_OGGTHEORA 1'
6675 _codecmodules="libtheora $_codecmodules"
6676 # when --enable-theora is forced, we'd better provide a probably sane
6677 # $_ld_theora than nothing
6678 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6679 else
6680 def_theora='#undef CONFIG_OGGTHEORA'
6681 _nocodecmodules="libtheora $_nocodecmodules"
6683 echores "$_theora"
6685 echocheck "internal mp3lib support"
6686 if test "$_mp3lib" = auto ; then
6687 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6689 if test "$_mp3lib" = yes ; then
6690 def_mp3lib='#define CONFIG_MP3LIB 1'
6691 _codecmodules="mp3lib(internal) $_codecmodules"
6692 else
6693 def_mp3lib='#undef CONFIG_MP3LIB'
6694 _nocodecmodules="mp3lib(internal) $_nocodecmodules"
6696 echores "$_mp3lib"
6698 echocheck "liba52 support"
6699 if test "$_liba52_internal" = auto ; then
6700 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
6702 def_liba52='#undef CONFIG_LIBA52'
6703 def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6704 if test "$_liba52_internal" = yes ; then
6705 _liba52=yes
6706 def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6707 _res_comment="internal"
6708 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6709 _liba52=no
6710 cat > $TMPC << EOF
6711 #include <inttypes.h>
6712 #include <a52dec/a52.h>
6713 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6715 cc_check -la52 && _liba52=yes && _res_comment="external" && extra_ldflags="$extra_ldflags -la52"
6717 if test "$_liba52" = yes ; then
6718 def_liba52='#define CONFIG_LIBA52 1'
6719 _codecmodules="liba52($_res_comment) $_codecmodules"
6720 else
6721 _nocodecmodules="liba52 $_nocodecmodules"
6723 echores "$_liba52"
6725 echocheck "internal libmpeg2 support"
6726 if test "$_libmpeg2" = auto ; then
6727 _libmpeg2=yes
6728 if alpha && test cc_vendor=gnu; then
6729 case $cc_version in
6730 2*|3.0*|3.1*) # cannot compile MVI instructions
6731 _libmpeg2=no
6732 _res_comment="broken gcc"
6734 esac
6737 if test "$_libmpeg2" = yes ; then
6738 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6739 _codecmodules="libmpeg2(internal) $_codecmodules"
6740 else
6741 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6742 _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
6744 echores "$_libmpeg2"
6746 echocheck "libdca support"
6747 if test "$_libdca" = auto ; then
6748 _libdca=no
6749 cat > $TMPC << EOF
6750 #include <inttypes.h>
6751 #include <dts.h>
6752 int main(void) { dts_init(0); return 0; }
6754 for _ld_dca in -ldca -ldts ; do
6755 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6756 && _libdca=yes && break
6757 done
6759 if test "$_libdca" = yes ; then
6760 def_libdca='#define CONFIG_LIBDCA 1'
6761 _codecmodules="libdca $_codecmodules"
6762 else
6763 def_libdca='#undef CONFIG_LIBDCA'
6764 _nocodecmodules="libdca $_nocodecmodules"
6766 echores "$_libdca"
6768 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6769 if test "$_musepack" = auto ; then
6770 _musepack=no
6771 cat > $TMPC << EOF
6772 #include <stddef.h>
6773 #include <mpcdec/mpcdec.h>
6774 int main(void) {
6775 mpc_streaminfo info;
6776 mpc_decoder decoder;
6777 mpc_decoder_set_streaminfo(&decoder, &info);
6778 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6779 return 0;
6782 cc_check -lmpcdec $_ld_lm && _musepack=yes
6784 if test "$_musepack" = yes ; then
6785 def_musepack='#define CONFIG_MUSEPACK 1'
6786 extra_ldflags="$extra_ldflags -lmpcdec"
6787 _codecmodules="musepack $_codecmodules"
6788 else
6789 def_musepack='#undef CONFIG_MUSEPACK'
6790 _nocodecmodules="musepack $_nocodecmodules"
6792 echores "$_musepack"
6795 echocheck "FAAC support"
6796 if test "$_faac" = auto ; then
6797 cat > $TMPC <<EOF
6798 #include <inttypes.h>
6799 #include <faac.h>
6800 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6802 _faac=no
6803 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6804 cc_check -O4 $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6805 done
6807 if test "$_faac" = yes ; then
6808 def_faac="#define CONFIG_FAAC 1"
6809 test "$_faac_lavc" = auto && _faac_lavc=yes
6810 if test "$_faac_lavc" = yes ; then
6811 def_faac_lavc="#define CONFIG_LIBFAAC 1"
6812 libs_mplayer="$libs_mplayer $_ld_faac"
6813 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6815 _codecmodules="faac $_codecmodules"
6816 else
6817 _faac_lavc=no
6818 def_faac="#undef CONFIG_FAAC"
6819 def_faac_lavc="#define CONFIG_LIBFAAC 0"
6820 _nocodecmodules="faac $_nocodecmodules"
6822 _res_comment="in libavcodec: $_faac_lavc"
6823 echores "$_faac"
6826 echocheck "FAAD2 support"
6827 if test "$_faad_internal" = auto ; then
6828 if x86_32 && test cc_vendor=gnu; then
6829 case $cc_version in
6830 3.1*|3.2) # ICE/insn with these versions
6831 _faad_internal=no
6832 _res_comment="broken gcc"
6835 _faad=yes
6836 _faad_internal=yes
6838 esac
6839 else
6840 _faad=yes
6841 _faad_internal=yes
6844 if test "$_faad" = auto ; then
6845 cat > $TMPC << EOF
6846 #include <faad.h>
6847 #ifndef FAAD_MIN_STREAMSIZE
6848 #error Too old version
6849 #endif
6850 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6851 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6853 cc_check -lfaad $_ld_lm && _faad=yes
6856 def_faad='#undef CONFIG_FAAD'
6857 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6858 if test "$_faad_internal" = yes ; then
6859 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6860 _res_comment="internal floating-point"
6861 if test "$_faad_fixed" = yes ; then
6862 # The FIXED_POINT implementation of FAAD2 improves performance
6863 # on some platforms, especially for SBR files.
6864 cflags_faad_fixed="-DFIXED_POINT"
6865 _res_comment="internal fixed-point"
6867 elif test "$_faad" = yes ; then
6868 extra_ldflags="$extra_ldflags -lfaad"
6871 if test "$_faad" = yes ; then
6872 def_faad='#define CONFIG_FAAD 1'
6873 if test "$_faad_internal" = yes ; then
6874 _codecmodules="faad2(internal) $_codecmodules"
6875 else
6876 _codecmodules="faad2 $_codecmodules"
6878 else
6879 _faad=no
6880 _nocodecmodules="faad2 $_nocodecmodules"
6882 echores "$_faad"
6885 echocheck "LADSPA plugin support"
6886 if test "$_ladspa" = auto ; then
6887 cat > $TMPC <<EOF
6888 #include <stdio.h>
6889 #include <ladspa.h>
6890 int main(void) {
6891 const LADSPA_Descriptor *ld = NULL;
6892 return 0;
6895 _ladspa=no
6896 cc_check && _ladspa=yes
6898 if test "$_ladspa" = yes; then
6899 def_ladspa="#define CONFIG_LADSPA 1"
6900 else
6901 def_ladspa="#undef CONFIG_LADSPA"
6903 echores "$_ladspa"
6906 echocheck "libbs2b audio filter support"
6907 if test "$_libbs2b" = auto ; then
6908 cat > $TMPC <<EOF
6909 #include <bs2b.h>
6910 #if BS2B_VERSION_MAJOR < 3
6911 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6912 #endif
6913 int main(void) {
6914 t_bs2bdp filter;
6915 filter=bs2b_open();
6916 bs2b_close(filter);
6917 return 0;
6920 _libbs2b=no
6921 if $_pkg_config --exists libbs2b ; then
6922 _inc_tmp=$($_pkg_config --cflags libbs2b)
6923 _ld_tmp=$($_pkg_config --libs libbs2b)
6924 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6925 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6926 else
6927 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6928 -I/usr/local/include/bs2b ; do
6929 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6930 extra_ldflags="$extra_ldflags -lbs2b"
6931 extra_cflags="$extra_cflags $_inc_tmp"
6932 _libbs2b=yes
6933 break
6935 done
6938 def_libbs2b="#undef CONFIG_LIBBS2B"
6939 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6940 echores "$_libbs2b"
6943 if test -z "$_codecsdir" ; then
6944 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6945 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6946 if test -d "$dir" ; then
6947 _codecsdir="$dir"
6948 break;
6950 done
6952 # Fall back on default directory.
6953 if test -z "$_codecsdir" ; then
6954 _codecsdir="$_libdir/codecs"
6955 mingw32 && _codecsdir="codecs"
6956 os2 && _codecsdir="codecs"
6960 echocheck "Win32 codecs"
6961 if test "$_win32dll" = auto ; then
6962 _win32dll=no
6963 if x86_32 && ! qnx; then
6964 _win32dll=yes
6967 if test "$_win32dll" = yes ; then
6968 def_win32dll='#define CONFIG_WIN32DLL 1'
6969 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6970 _res_comment="using $_win32codecsdir"
6971 if ! win32 ; then
6972 def_win32_loader='#define WIN32_LOADER 1'
6973 _win32_emulation=yes
6974 else
6975 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6976 _res_comment="using native windows"
6978 _codecmodules="win32 $_codecmodules"
6979 else
6980 def_win32dll='#undef CONFIG_WIN32DLL'
6981 def_win32_loader='#undef WIN32_LOADER'
6982 _nocodecmodules="win32 $_nocodecmodules"
6984 echores "$_win32dll"
6987 echocheck "XAnim codecs"
6988 if test "$_xanim" = auto ; then
6989 _xanim=no
6990 _res_comment="dynamic loader support needed"
6991 if test "$_dl" = yes ; then
6992 _xanim=yes
6995 if test "$_xanim" = yes ; then
6996 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6997 def_xanim='#define CONFIG_XANIM 1'
6998 def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6999 _codecmodules="xanim $_codecmodules"
7000 _res_comment="using $_xanimcodecsdir"
7001 else
7002 def_xanim='#undef CONFIG_XANIM'
7003 def_xanim_path='#undef XACODEC_PATH'
7004 _nocodecmodules="xanim $_nocodecmodules"
7006 echores "$_xanim"
7009 echocheck "RealPlayer codecs"
7010 if test "$_real" = auto ; then
7011 _real=no
7012 _res_comment="dynamic loader support needed"
7013 if test "$_dl" = yes || test "$_win32dll" = yes &&
7014 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
7015 _real=yes
7018 if test "$_real" = yes ; then
7019 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
7020 def_real='#define CONFIG_REALCODECS 1'
7021 def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
7022 _codecmodules="real $_codecmodules"
7023 _res_comment="using $_realcodecsdir"
7024 else
7025 def_real='#undef CONFIG_REALCODECS'
7026 def_real_path="#undef REALCODEC_PATH"
7027 _nocodecmodules="real $_nocodecmodules"
7029 echores "$_real"
7032 echocheck "QuickTime codecs"
7033 _qtx_emulation=no
7034 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
7035 if test "$_qtx" = auto ; then
7036 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
7038 if test "$_qtx" = yes ; then
7039 def_qtx='#define CONFIG_QTX_CODECS 1'
7040 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
7041 _codecmodules="qtx $_codecmodules"
7042 darwin || win32 || _qtx_emulation=yes
7043 else
7044 def_qtx='#undef CONFIG_QTX_CODECS'
7045 _nocodecmodules="qtx $_nocodecmodules"
7047 echores "$_qtx"
7049 echocheck "Nemesi Streaming Media libraries"
7050 if test "$_nemesi" = auto && test "$_network" = yes ; then
7051 _nemesi=no
7052 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
7053 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
7054 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
7055 _nemesi=yes
7058 if test "$_nemesi" = yes; then
7059 _native_rtsp=no
7060 def_nemesi='#define CONFIG_LIBNEMESI 1'
7061 _inputmodules="nemesi $_inputmodules"
7062 else
7063 _native_rtsp="$_network"
7064 _nemesi=no
7065 def_nemesi='#undef CONFIG_LIBNEMESI'
7066 _noinputmodules="nemesi $_noinputmodules"
7068 echores "$_nemesi"
7070 echocheck "LIVE555 Streaming Media libraries"
7071 if test "$_live" = auto && test "$_network" = yes ; then
7072 cat > $TMPCPP << EOF
7073 #include <liveMedia.hh>
7074 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
7075 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
7076 #endif
7077 int main(void) { return 0; }
7080 _live=no
7081 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
7082 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
7083 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
7084 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
7085 $_livelibdir/groupsock/libgroupsock.a \
7086 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
7087 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
7088 $extra_ldflags -lstdc++" \
7089 extra_cxxflags="-I$_livelibdir/liveMedia/include \
7090 -I$_livelibdir/UsageEnvironment/include \
7091 -I$_livelibdir/BasicUsageEnvironment/include \
7092 -I$_livelibdir/groupsock/include" && \
7093 _live=yes && break
7094 done
7095 if test "$_live" != yes ; then
7096 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
7097 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
7098 _live_dist=yes
7102 if test "$_live" = yes && test "$_network" = yes; then
7103 test $_livelibdir && _res_comment="using $_livelibdir"
7104 def_live='#define CONFIG_LIVE555 1'
7105 _inputmodules="live555 $_inputmodules"
7106 elif test "$_live_dist" = yes && test "$_network" = yes; then
7107 _res_comment="using distribution version"
7108 _live="yes"
7109 def_live='#define CONFIG_LIVE555 1'
7110 extra_ldflags="$extra_ldflags $ld_tmp"
7111 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
7112 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
7113 _inputmodules="live555 $_inputmodules"
7114 else
7115 _live=no
7116 def_live='#undef CONFIG_LIVE555'
7117 _noinputmodules="live555 $_noinputmodules"
7119 echores "$_live"
7122 echocheck "FFmpeg libavutil"
7123 if test "$_libavutil_a" = auto ; then
7124 if test -d libavutil ; then
7125 _libavutil_a=yes
7126 _res_comment="static"
7127 else
7128 die "MPlayer will not compile without libavutil in the source tree."
7130 elif test "$_libavutil_so" = auto ; then
7131 _libavutil_so=no
7132 cat > $TMPC << EOF
7133 #include <libavutil/common.h>
7134 int main(void) { av_gcd(1,1); return 0; }
7136 if $_pkg_config --exists libavutil ; then
7137 _inc_libavutil=$($_pkg_config --cflags libavutil)
7138 _ld_tmp=$($_pkg_config --libs libavutil)
7139 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7140 && _libavutil_so=yes
7141 elif cc_check -lavutil $_ld_lm ; then
7142 extra_ldflags="$extra_ldflags -lavutil"
7143 _libavutil_so=yes
7144 _res_comment="using libavutil.so, but static libavutil is recommended"
7147 _libavutil=no
7148 def_libavutil='#undef CONFIG_LIBAVUTIL'
7149 def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
7150 def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
7151 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
7152 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
7153 test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
7154 test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
7155 # neither static nor shared libavutil is available, but it is mandatory ...
7156 if test "$_libavutil" = no ; then
7157 die "You need static or shared libavutil, MPlayer will not compile without!"
7159 echores "$_libavutil"
7161 echocheck "FFmpeg libavcodec"
7162 if test "$_libavcodec_a" = auto ; then
7163 _libavcodec_a=no
7164 if test -d libavcodec && test -f libavcodec/utils.c ; then
7165 _libavcodec_a="yes"
7166 _res_comment="static"
7168 elif test "$_libavcodec_so" = auto ; then
7169 _libavcodec_so=no
7170 _res_comment="libavcodec.so is discouraged over static libavcodec"
7171 cat > $TMPC << EOF
7172 #include <libavcodec/avcodec.h>
7173 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
7175 if $_pkg_config --exists libavcodec ; then
7176 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
7177 _ld_tmp=$($_pkg_config --libs libavcodec)
7178 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7179 && _libavcodec_so=yes
7180 elif cc_check -lavcodec $_ld_lm ; then
7181 extra_ldflags="$extra_ldflags -lavcodec"
7182 _libavcodec_so=yes
7183 _res_comment="using libavcodec.so, but static libavcodec is recommended"
7186 _libavcodec=no
7187 def_libavcodec='#undef CONFIG_LIBAVCODEC'
7188 def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
7189 def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
7190 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
7191 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
7192 test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
7193 test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
7194 test "$_libavcodec_mpegaudio_hp" = yes \
7195 && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' \
7196 && mak_libavcodec_mpegaudio_hp='CONFIG_MPEGAUDIO_HP = yes'
7197 if test "$_libavcodec_a" = yes ; then
7198 _codecmodules="libavcodec(internal) $_codecmodules"
7199 elif test "$_libavcodec_so" = yes ; then
7200 _codecmodules="libavcodec.so $_codecmodules"
7201 else
7202 _nocodecmodules="libavcodec $_nocodecmodules"
7204 echores "$_libavcodec"
7206 echocheck "FFmpeg libavformat"
7207 if test "$_libavformat_a" = auto ; then
7208 _libavformat_a=no
7209 if test -d libavformat && test -f libavformat/utils.c ; then
7210 _libavformat_a=yes
7211 _res_comment="static"
7213 elif test "$_libavformat_so" = auto ; then
7214 _libavformat_so=no
7215 cat > $TMPC <<EOF
7216 #include <libavformat/avformat.h>
7217 #include <libavcodec/opt.h>
7218 int main(void) { av_alloc_format_context(); return 0; }
7220 if $_pkg_config --exists libavformat ; then
7221 _inc_libavformat=$($_pkg_config --cflags libavformat)
7222 _ld_tmp=$($_pkg_config --libs libavformat)
7223 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7224 && _libavformat_so=yes
7225 elif cc_check $_ld_lm -lavformat ; then
7226 extra_ldflags="$extra_ldflags -lavformat"
7227 _libavformat_so=yes
7228 _res_comment="using libavformat.so, but static libavformat is recommended"
7231 _libavformat=no
7232 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7233 def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
7234 def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
7235 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
7236 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7237 test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
7238 test "$_libavformat_so" = yes \
7239 && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
7240 echores "$_libavformat"
7242 echocheck "FFmpeg libpostproc"
7243 if test "$_libpostproc_a" = auto ; then
7244 _libpostproc_a=no
7245 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
7246 _libpostproc_a='yes'
7247 _res_comment="static"
7249 elif test "$_libpostproc_so" = auto ; then
7250 _libpostproc_so=no
7251 cat > $TMPC << EOF
7252 #include <inttypes.h>
7253 #include <libpostproc/postprocess.h>
7254 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7256 if cc_check -lpostproc $_ld_lm ; then
7257 extra_ldflags="$extra_ldflags -lpostproc"
7258 _libpostproc_so=yes
7259 _res_comment="using libpostproc.so, but static libpostproc is recommended"
7262 _libpostproc=no
7263 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7264 def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
7265 def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
7266 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
7267 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7268 test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
7269 test "$_libpostproc_so" = yes \
7270 && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
7271 echores "$_libpostproc"
7273 echocheck "FFmpeg libswscale"
7274 if test "$_libswscale_a" = auto ; then
7275 _libswscale_a=no
7276 if test -d libswscale && test -f libswscale/swscale.h ; then
7277 _libswscale_a='yes'
7278 _res_comment="static"
7280 elif test "$_libswscale_so" = auto ; then
7281 _libswscale_so=no
7282 _res_comment="using libswscale.so, but static libswscale is recommended"
7283 cat > $TMPC << EOF
7284 #include <libswscale/swscale.h>
7285 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7287 if $_pkg_config --exists libswscale ; then
7288 _inc_libswscale=$($_pkg_config --cflags libswscale)
7289 _ld_tmp=$($_pkg_config --libs libswscale)
7290 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7291 && _libswscale_so=yes
7292 elif cc_check -lswscale ; then
7293 extra_ldflags="$extra_ldflags -lswscale"
7294 _libswscale_so=yes
7297 _libswscale=no
7298 def_libswscale='#undef CONFIG_LIBSWSCALE'
7299 def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
7300 def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
7301 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
7302 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7303 test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
7304 test "$_libswscale_so" = yes \
7305 && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
7306 echores "$_libswscale"
7308 echocheck "libopencore_amr narrowband"
7309 if test "$_libopencore_amrnb" = auto ; then
7310 _libopencore_amrnb=no
7311 cat > $TMPC << EOF
7312 #include <opencore-amrnb/interf_dec.h>
7313 int main(void) { Decoder_Interface_init(); return 0; }
7315 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7316 if test "$_libavcodec_a" != yes ; then
7317 _libopencore_amrnb=no
7318 _res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
7321 if test "$_libopencore_amrnb" = yes ; then
7322 _libopencore_amr=yes
7323 extra_ldflags="$extra_ldflags -lopencore-amrnb"
7324 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
7325 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
7326 _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
7327 _codecmodules="libopencore_amrnb $_codecmodules"
7328 else
7329 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
7330 _nocodecmodules="libopencore_amrnb $_nocodecmodules"
7332 echores "$_libopencore_amrnb"
7335 echocheck "libopencore_amr wideband"
7336 if test "$_libopencore_amrwb" = auto ; then
7337 _libopencore_amrwb=no
7338 cat > $TMPC << EOF
7339 #include <opencore-amrwb/dec_if.h>
7340 int main(void) { D_IF_init(); return 0; }
7342 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7343 if test "$_libavcodec_a" != yes ; then
7344 _libopencore_amrwb=no
7345 _res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
7348 if test "$_libopencore_amrwb" = yes ; then
7349 _libopencore_amr=yes
7350 extra_ldflags="$extra_ldflags -lopencore-amrwb"
7351 def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
7352 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
7353 _libavencoders="$_libavencoders LIBOPENCORE_AMRWB_DECODER"
7354 _codecmodules="libopencore_amrwb $_codecmodules"
7355 else
7356 def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
7357 _nocodecmodules="libopencore_amrwb $_nocodecmodules"
7359 echores "$_libopencore_amrwb"
7361 echocheck "libdv-0.9.5+"
7362 if test "$_libdv" = auto ; then
7363 _libdv=no
7364 cat > $TMPC <<EOF
7365 #include <libdv/dv.h>
7366 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7368 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7370 if test "$_libdv" = yes ; then
7371 def_libdv='#define CONFIG_LIBDV095 1'
7372 extra_ldflags="$extra_ldflags -ldv"
7373 _codecmodules="libdv $_codecmodules"
7374 else
7375 def_libdv='#undef CONFIG_LIBDV095'
7376 _nocodecmodules="libdv $_nocodecmodules"
7378 echores "$_libdv"
7381 echocheck "Xvid"
7382 if test "$_xvid" = auto ; then
7383 _xvid=no
7384 cat > $TMPC << EOF
7385 #include <xvid.h>
7386 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7388 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7389 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7390 done
7393 if test "$_xvid" = yes ; then
7394 def_xvid='#define CONFIG_XVID4 1'
7395 _codecmodules="xvid $_codecmodules"
7396 else
7397 def_xvid='#undef CONFIG_XVID4'
7398 _nocodecmodules="xvid $_nocodecmodules"
7400 echores "$_xvid"
7402 echocheck "Xvid two pass plugin"
7403 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7404 cat > $TMPC << EOF
7405 #include <xvid.h>
7406 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7408 cc_check && _xvid_lavc=yes
7410 if test "$_xvid_lavc" = yes ; then
7411 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7412 _libavencoders="$_libavencoders LIBXVID_ENCODER"
7413 else
7414 _xvid_lavc=no
7415 def_xvid_lavc='#define CONFIG_LIBXVID 0'
7417 echores "$_xvid_lavc"
7420 echocheck "x264"
7421 if test "$_x264" = auto ; then
7422 cat > $TMPC << EOF
7423 #include <inttypes.h>
7424 #include <x264.h>
7425 #if X264_BUILD < 79
7426 #error We do not support old versions of x264. Get the latest from git.
7427 #endif
7428 int main(void) { x264_encoder_open((void*)0); return 0; }
7430 _x264=no
7431 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7432 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7433 done
7436 if test "$_x264" = yes ; then
7437 def_x264='#define CONFIG_X264 1'
7438 _codecmodules="x264 $_codecmodules"
7439 test "$_x264_lavc" = auto && _x264_lavc=yes
7440 if test "$_x264_lavc" = yes ; then
7441 def_x264_lavc='#define CONFIG_LIBX264 1'
7442 libs_mplayer="$libs_mplayer $_ld_x264"
7443 _libavencoders="$_libavencoders LIBX264_ENCODER"
7445 else
7446 _x264_lavc=no
7447 def_x264='#undef CONFIG_X264'
7448 def_x264_lavc='#define CONFIG_LIBX264 0'
7449 _nocodecmodules="x264 $_nocodecmodules"
7451 _res_comment="in libavcodec: $_x264_lavc"
7452 echores "$_x264"
7455 echocheck "libdirac"
7456 if test "$_libdirac_lavc" = auto; then
7457 _libdirac_lavc=no
7458 if test "$_libavcodec_a" != yes; then
7459 _res_comment="libavcodec (static) is required by libdirac, sorry"
7460 else
7461 cat > $TMPC << EOF
7462 #include <libdirac_encoder/dirac_encoder.h>
7463 #include <libdirac_decoder/dirac_parser.h>
7464 int main(void)
7466 dirac_encoder_context_t enc_ctx;
7467 dirac_decoder_t *dec_handle;
7468 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
7469 dec_handle = dirac_decoder_init(0);
7470 if (dec_handle)
7471 dirac_decoder_close(dec_handle);
7472 return 0;
7475 if $_pkg_config --exists dirac ; then
7476 _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
7477 _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
7478 cc_check $_inc_dirac $_ld_dirac &&
7479 _libdirac_lavc=yes &&
7480 extra_cflags="$extra_cflags $_inc_dirac" &&
7481 extra_ldflags="$extra_ldflags $_ld_dirac"
7485 if test "$_libdirac_lavc" = yes ; then
7486 def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
7487 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
7488 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
7489 _codecmodules="libdirac $_codecmodules"
7490 else
7491 def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
7492 _nocodecmodules="libdirac $_nocodecmodules"
7494 echores "$_libdirac_lavc"
7497 echocheck "libschroedinger"
7498 if test "$_libschroedinger_lavc" = auto ; then
7499 _libschroedinger_lavc=no
7500 if test "$_libavcodec_a" != yes; then
7501 _res_comment="libavcodec (static) is required by libschroedinger, sorry"
7502 else
7503 cat > $TMPC << EOF
7504 #include <schroedinger/schro.h>
7505 int main(void) { schro_init(); return 0; }
7507 if $_pkg_config --exists schroedinger-1.0 ; then
7508 _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
7509 _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
7510 cc_check $_inc_schroedinger $_ld_schroedinger &&
7511 _libschroedinger_lavc=yes &&
7512 extra_cflags="$extra_cflags $_inc_schroedinger" &&
7513 extra_ldflags="$extra_ldflags $_ld_schroedinger"
7517 if test "$_libschroedinger_lavc" = yes ; then
7518 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
7519 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
7520 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
7521 _codecmodules="libschroedinger $_codecmodules"
7522 else
7523 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
7524 _nocodecmodules="libschroedinger $_nocodecmodules"
7526 echores "$_libschroedinger_lavc"
7528 echocheck "libnut"
7529 if test "$_libnut" = auto ; then
7530 cat > $TMPC << EOF
7531 #include <stdio.h>
7532 #include <stdlib.h>
7533 #include <inttypes.h>
7534 #include <libnut.h>
7535 nut_context_tt * nut;
7536 int main(void) { (void)nut_error(0); return 0; }
7538 _libnut=no
7539 cc_check -lnut && _libnut=yes
7542 if test "$_libnut" = yes ; then
7543 def_libnut='#define CONFIG_LIBNUT 1'
7544 extra_ldflags="$extra_ldflags -lnut"
7545 else
7546 def_libnut='#undef CONFIG_LIBNUT'
7548 echores "$_libnut"
7550 #check must be done after libavcodec one
7551 echocheck "zr"
7552 if test "$_zr" = auto ; then
7553 #36067's seem to identify themselves as 36057PQC's, so the line
7554 #below should work for 36067's and 36057's.
7555 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7556 _zr=yes
7557 else
7558 _zr=no
7561 if test "$_zr" = yes ; then
7562 if test "$_libavcodec_a" = yes ; then
7563 def_zr='#define CONFIG_ZR 1'
7564 _vomodules="zr zr2 $_vomodules"
7565 else
7566 _res_comment="libavcodec (static) is required by zr, sorry"
7567 _novomodules="zr $_novomodules"
7568 def_zr='#undef CONFIG_ZR'
7570 else
7571 def_zr='#undef CONFIG_ZR'
7572 _novomodules="zr zr2 $_novomodules"
7574 echores "$_zr"
7576 # mencoder requires (optional) those libs: libmp3lame
7577 if test "$_mencoder" != no ; then
7579 echocheck "libmp3lame"
7580 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7581 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7582 if test "$_mp3lame" = auto ; then
7583 _mp3lame=no
7584 cat > $TMPC <<EOF
7585 #include <lame/lame.h>
7586 int main(void) { lame_version_t lv; (void) lame_init();
7587 get_lame_version_numerical(&lv);
7588 return 0; }
7590 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7592 if test "$_mp3lame" = yes ; then
7593 def_mp3lame="#define CONFIG_MP3LAME 1"
7594 _ld_mp3lame=-lmp3lame
7595 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7596 cat > $TMPC << EOF
7597 #include <lame/lame.h>
7598 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7600 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7601 cat > $TMPC << EOF
7602 #include <lame/lame.h>
7603 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7605 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7606 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7607 if test "$_mp3lame_lavc" = yes ; then
7608 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7609 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
7610 libs_mplayer="$libs_mplayer $_ld_mp3lame"
7612 else
7613 _mp3lame_lavc=no
7614 def_mp3lame='#undef CONFIG_MP3LAME'
7615 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
7617 _res_comment="in libavcodec: $_mp3lame_lavc"
7618 echores "$_mp3lame"
7620 fi # test "$_mencoder" != no
7622 echocheck "mencoder"
7623 if test "$_mencoder" = yes ; then
7624 def_muxers='#define CONFIG_MUXERS 1'
7625 else
7626 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot
7627 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
7628 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
7629 _libavmuxers=""
7630 def_muxers='#define CONFIG_MUXERS 0'
7632 echores "$_mencoder"
7635 echocheck "UnRAR executable"
7636 if test "$_unrar_exec" = auto ; then
7637 _unrar_exec="yes"
7638 mingw32 && _unrar_exec="no"
7640 if test "$_unrar_exec" = yes ; then
7641 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7642 else
7643 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7645 echores "$_unrar_exec"
7647 echocheck "TV interface"
7648 if test "$_tv" = yes ; then
7649 def_tv='#define CONFIG_TV 1'
7650 _inputmodules="tv $_inputmodules"
7651 else
7652 _noinputmodules="tv $_noinputmodules"
7653 def_tv='#undef CONFIG_TV'
7655 echores "$_tv"
7658 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7659 echocheck "*BSD BT848 bt8xx header"
7660 _ioctl_bt848_h=no
7661 for file in "machine/ioctl_bt848.h" \
7662 "dev/bktr/ioctl_bt848.h" \
7663 "dev/video/bktr/ioctl_bt848.h" \
7664 "dev/ic/bt8xx.h" ; do
7665 cat > $TMPC <<EOF
7666 #include <sys/types.h>
7667 #include <sys/ioctl.h>
7668 #include <$file>
7669 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7671 if cc_check ; then
7672 _ioctl_bt848_h=yes
7673 _ioctl_bt848_h_name="$file"
7674 break;
7676 done
7677 if test "$_ioctl_bt848_h" = yes ; then
7678 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7679 _res_comment="using $_ioctl_bt848_h_name"
7680 else
7681 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7683 echores "$_ioctl_bt848_h"
7685 echocheck "*BSD ioctl_meteor.h"
7686 _ioctl_meteor_h=no
7687 for file in "machine/ioctl_meteor.h" \
7688 "dev/bktr/ioctl_meteor.h" \
7689 "dev/video/bktr/ioctl_meteor.h" ; do
7690 cat > $TMPC <<EOF
7691 #include <sys/types.h>
7692 #include <$file>
7693 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7695 if cc_check ; then
7696 _ioctl_meteor_h=yes
7697 _ioctl_meteor_h_name="$file"
7698 break;
7700 done
7701 if test "$_ioctl_meteor_h" = yes ; then
7702 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7703 _res_comment="using $_ioctl_meteor_h_name"
7704 else
7705 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7707 echores "$_ioctl_meteor_h"
7709 echocheck "*BSD BrookTree 848 TV interface"
7710 if test "$_tv_bsdbt848" = auto ; then
7711 _tv_bsdbt848=no
7712 if test "$_tv" = yes ; then
7713 cat > $TMPC <<EOF
7714 #include <sys/types.h>
7715 $def_ioctl_meteor_h_name
7716 $def_ioctl_bt848_h_name
7717 #ifdef IOCTL_METEOR_H_NAME
7718 #include IOCTL_METEOR_H_NAME
7719 #endif
7720 #ifdef IOCTL_BT848_H_NAME
7721 #include IOCTL_BT848_H_NAME
7722 #endif
7723 int main(void) {
7724 ioctl(0, METEORSINPUT, 0);
7725 ioctl(0, TVTUNER_GETFREQ, 0);
7726 return 0;
7729 cc_check && _tv_bsdbt848=yes
7732 if test "$_tv_bsdbt848" = yes ; then
7733 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7734 _inputmodules="tv-bsdbt848 $_inputmodules"
7735 else
7736 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7737 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7739 echores "$_tv_bsdbt848"
7740 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7743 echocheck "DirectShow TV interface"
7744 if test "$_tv_dshow" = auto ; then
7745 _tv_dshow=no
7746 if test "$_tv" = yes && win32 ; then
7747 cat > $TMPC <<EOF
7748 #include <ole2.h>
7749 int main(void) {
7750 void* p;
7751 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7752 return 0;
7755 cc_check -lole32 -luuid && _tv_dshow=yes
7758 if test "$_tv_dshow" = yes ; then
7759 _inputmodules="tv-dshow $_inputmodules"
7760 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7761 extra_ldflags="$extra_ldflags -lole32 -luuid"
7762 else
7763 _noinputmodules="tv-dshow $_noinputmodules"
7764 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7766 echores "$_tv_dshow"
7769 echocheck "Video 4 Linux TV interface"
7770 if test "$_tv_v4l1" = auto ; then
7771 _tv_v4l1=no
7772 if test "$_tv" = yes && linux ; then
7773 cat > $TMPC <<EOF
7774 #include <stdlib.h>
7775 #include <linux/videodev.h>
7776 int main(void) { return 0; }
7778 cc_check && _tv_v4l1=yes
7781 if test "$_tv_v4l1" = yes ; then
7782 _audio_input=yes
7783 _tv_v4l=yes
7784 def_tv_v4l='#define CONFIG_TV_V4L 1'
7785 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7786 _inputmodules="tv-v4l $_inputmodules"
7787 else
7788 _noinputmodules="tv-v4l1 $_noinputmodules"
7789 def_tv_v4l='#undef CONFIG_TV_V4L'
7791 echores "$_tv_v4l1"
7794 echocheck "Video 4 Linux 2 TV interface"
7795 if test "$_tv_v4l2" = auto ; then
7796 _tv_v4l2=no
7797 if test "$_tv" = yes && linux ; then
7798 cat > $TMPC <<EOF
7799 #include <stdlib.h>
7800 #include <linux/types.h>
7801 #include <linux/videodev2.h>
7802 int main(void) { return 0; }
7804 cc_check && _tv_v4l2=yes
7807 if test "$_tv_v4l2" = yes ; then
7808 _audio_input=yes
7809 _tv_v4l=yes
7810 def_tv_v4l='#define CONFIG_TV_V4L 1'
7811 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7812 _inputmodules="tv-v4l2 $_inputmodules"
7813 else
7814 _noinputmodules="tv-v4l2 $_noinputmodules"
7815 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7817 echores "$_tv_v4l2"
7820 echocheck "Radio interface"
7821 if test "$_radio" = yes ; then
7822 def_radio='#define CONFIG_RADIO 1'
7823 _inputmodules="radio $_inputmodules"
7824 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7825 _radio_capture=no
7827 if test "$_radio_capture" = yes ; then
7828 _audio_input=yes
7829 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7830 else
7831 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7833 else
7834 _noinputmodules="radio $_noinputmodules"
7835 def_radio='#undef CONFIG_RADIO'
7836 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7837 _radio_capture=no
7839 echores "$_radio"
7840 echocheck "Capture for Radio interface"
7841 echores "$_radio_capture"
7843 echocheck "Video 4 Linux 2 Radio interface"
7844 if test "$_radio_v4l2" = auto ; then
7845 _radio_v4l2=no
7846 if test "$_radio" = yes && linux ; then
7847 cat > $TMPC <<EOF
7848 #include <stdlib.h>
7849 #include <linux/types.h>
7850 #include <linux/videodev2.h>
7851 int main(void) { return 0; }
7853 cc_check && _radio_v4l2=yes
7856 if test "$_radio_v4l2" = yes ; then
7857 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7858 else
7859 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7861 echores "$_radio_v4l2"
7863 echocheck "Video 4 Linux Radio interface"
7864 if test "$_radio_v4l" = auto ; then
7865 _radio_v4l=no
7866 if test "$_radio" = yes && linux ; then
7867 cat > $TMPC <<EOF
7868 #include <stdlib.h>
7869 #include <linux/videodev.h>
7870 int main(void) { return 0; }
7872 cc_check && _radio_v4l=yes
7875 if test "$_radio_v4l" = yes ; then
7876 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7877 else
7878 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7880 echores "$_radio_v4l"
7882 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7883 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7884 echocheck "*BSD BrookTree 848 Radio interface"
7885 _radio_bsdbt848=no
7886 cat > $TMPC <<EOF
7887 #include <sys/types.h>
7888 $def_ioctl_bt848_h_name
7889 #ifdef IOCTL_BT848_H_NAME
7890 #include IOCTL_BT848_H_NAME
7891 #endif
7892 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7894 cc_check && _radio_bsdbt848=yes
7895 echores "$_radio_bsdbt848"
7896 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7898 if test "$_radio_bsdbt848" = yes ; then
7899 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7900 else
7901 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7904 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7905 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7906 die "Radio driver requires BSD BT848, V4L or V4L2!"
7909 echocheck "Video 4 Linux 2 MPEG PVR interface"
7910 if test "$_pvr" = auto ; then
7911 _pvr=no
7912 if test "$_tv_v4l2" = yes && linux ; then
7913 cat > $TMPC <<EOF
7914 #include <stdlib.h>
7915 #include <inttypes.h>
7916 #include <linux/types.h>
7917 #include <linux/videodev2.h>
7918 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7920 cc_check && _pvr=yes
7923 if test "$_pvr" = yes ; then
7924 def_pvr='#define CONFIG_PVR 1'
7925 _inputmodules="pvr $_inputmodules"
7926 else
7927 _noinputmodules="pvr $_noinputmodules"
7928 def_pvr='#undef CONFIG_PVR'
7930 echores "$_pvr"
7933 echocheck "ftp"
7934 if ! beos && test "$_ftp" = yes ; then
7935 def_ftp='#define CONFIG_FTP 1'
7936 _inputmodules="ftp $_inputmodules"
7937 else
7938 _noinputmodules="ftp $_noinputmodules"
7939 def_ftp='#undef CONFIG_FTP'
7941 echores "$_ftp"
7943 echocheck "vstream client"
7944 if test "$_vstream" = auto ; then
7945 _vstream=no
7946 cat > $TMPC <<EOF
7947 #include <vstream-client.h>
7948 void vstream_error(const char *format, ... ) {}
7949 int main(void) { vstream_start(); return 0; }
7951 cc_check -lvstream-client && _vstream=yes
7953 if test "$_vstream" = yes ; then
7954 def_vstream='#define CONFIG_VSTREAM 1'
7955 _inputmodules="vstream $_inputmodules"
7956 extra_ldflags="$extra_ldflags -lvstream-client"
7957 else
7958 _noinputmodules="vstream $_noinputmodules"
7959 def_vstream='#undef CONFIG_VSTREAM'
7961 echores "$_vstream"
7964 echocheck "OSD menu"
7965 if test "$_menu" = yes ; then
7966 def_menu='#define CONFIG_MENU 1'
7967 test $_dvbin = "yes" && _menu_dvbin=yes
7968 else
7969 def_menu='#undef CONFIG_MENU'
7970 _menu_dvbin=no
7972 echores "$_menu"
7975 echocheck "Subtitles sorting"
7976 if test "$_sortsub" = yes ; then
7977 def_sortsub='#define CONFIG_SORTSUB 1'
7978 else
7979 def_sortsub='#undef CONFIG_SORTSUB'
7981 echores "$_sortsub"
7984 echocheck "XMMS inputplugin support"
7985 if test "$_xmms" = yes ; then
7986 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7987 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7988 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7989 else
7990 _xmmsplugindir=/usr/lib/xmms/Input
7991 _xmmslibdir=/usr/lib
7994 def_xmms='#define CONFIG_XMMS 1'
7995 if darwin ; then
7996 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7997 else
7998 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
8000 else
8001 def_xmms='#undef CONFIG_XMMS'
8003 echores "$_xmms"
8006 # --------------- GUI specific tests begin -------------------
8007 echocheck "GUI"
8008 echo "$_gui"
8009 if test "$_gui" = yes ; then
8011 # Required libraries
8012 if test "$_libavcodec" != yes ||
8013 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
8014 die "The GUI requires libavcodec with PNG support (needs zlib)."
8016 test "$_freetype" = no && test "$_bitmap_font" = no && \
8017 die "The GUI requires either FreeType or bitmap font support."
8018 if ! win32 ; then
8019 _gui_gtk=yes
8020 test "$_x11" != yes && die "X11 support required for GUI compilation."
8022 echocheck "XShape extension"
8023 if test "$_xshape" = auto ; then
8024 _xshape=no
8025 cat > $TMPC << EOF
8026 #include <X11/Xlib.h>
8027 #include <X11/Xproto.h>
8028 #include <X11/Xutil.h>
8029 #include <X11/extensions/shape.h>
8030 #include <stdlib.h>
8031 int main(void) {
8032 char *name = ":0.0";
8033 Display *wsDisplay;
8034 int exitvar = 0;
8035 int eventbase, errorbase;
8036 if (getenv("DISPLAY"))
8037 name=getenv("DISPLAY");
8038 wsDisplay=XOpenDisplay(name);
8039 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
8040 exitvar=1;
8041 XCloseDisplay(wsDisplay);
8042 return exitvar;
8045 cc_check -lXext && _xshape=yes
8047 if test "$_xshape" = yes ; then
8048 def_xshape='#define CONFIG_XSHAPE 1'
8049 else
8050 die "The GUI requires the X11 extension XShape (which was not found)."
8052 echores "$_xshape"
8054 #Check for GTK
8055 if test "$_gtk1" = no ; then
8056 #Check for GTK2 :
8057 echocheck "GTK+ version"
8059 if $_pkg_config gtk+-2.0 --exists ; then
8060 _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
8061 extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
8062 libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
8063 echores "$_gtk"
8065 # Check for GLIB2
8066 if $_pkg_config glib-2.0 --exists ; then
8067 echocheck "glib version"
8068 _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
8069 libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
8070 echores "$_glib"
8072 def_gui='#define CONFIG_GUI 1'
8073 def_gtk2='#define CONFIG_GTK2 1'
8074 else
8075 _gtk1=yes
8076 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
8078 else
8079 echo "GTK-2 devel packages were not found, trying GTK 1.2"
8080 _gtk1=yes
8084 if test "$_gtk1" = yes ; then
8085 # Check for old GTK (1.2.x)
8086 echocheck "GTK version"
8087 if test -z "$_gtkconfig" ; then
8088 if ( gtk-config --version ) >/dev/null 2>&1 ; then
8089 _gtkconfig="gtk-config"
8090 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
8091 _gtkconfig="gtk12-config"
8092 else
8093 die "The GUI requires GTK devel packages (which were not found)."
8096 _gtk=$($_gtkconfig --version 2>&1)
8097 extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
8098 libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
8099 echores "$_gtk (using $_gtkconfig)"
8101 # Check for GLIB
8102 echocheck "glib version"
8103 if test -z "$_glibconfig" ; then
8104 if ( glib-config --version ) >/dev/null 2>&1 ; then
8105 _glibconfig="glib-config"
8106 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
8107 _glibconfig="glib12-config"
8108 else
8109 die "The GUI requires GLIB devel packages (which were not found)"
8112 _glib=$($_glibconfig --version 2>&1)
8113 libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
8114 echores "$_glib (using $_glibconfig)"
8116 def_gui='#define CONFIG_GUI 1'
8117 def_gtk2='#undef CONFIG_GTK2'
8120 else #if ! win32
8121 _gui_win32=yes
8122 libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
8123 def_gui='#define CONFIG_GUI 1'
8124 def_gtk2='#undef CONFIG_GTK2'
8125 fi #if ! win32
8127 else #if test "$_gui"
8128 def_gui='#undef CONFIG_GUI'
8129 def_gtk2='#undef CONFIG_GTK2'
8130 fi #if test "$_gui"
8131 # --------------- GUI specific tests end -------------------
8134 if test "$_charset" != "noconv" ; then
8135 def_charset="#define MSG_CHARSET \"$_charset\""
8136 else
8137 def_charset="#undef MSG_CHARSET"
8138 _charset="UTF-8"
8141 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
8142 echocheck "iconv program"
8143 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
8144 if test "$?" -ne 0 ; then
8145 echores "no"
8146 echo "No working iconv program found, use "
8147 echo "--charset=UTF-8 to continue anyway."
8148 echo "If you also have problems with iconv library functions use --charset=noconv."
8149 echo "Messages in the GTK-2 interface will be broken then."
8150 exit 1
8151 else
8152 echores "yes"
8156 #############################################################################
8158 echocheck "automatic gdb attach"
8159 if test "$_crash_debug" = yes ; then
8160 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
8161 else
8162 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
8163 _crash_debug=no
8165 echores "$_crash_debug"
8167 echocheck "compiler support for noexecstack"
8168 cat > $TMPC <<EOF
8169 int main(void) { return 0; }
8171 if cc_check -Wl,-z,noexecstack ; then
8172 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
8173 echores "yes"
8174 else
8175 echores "no"
8179 # Dynamic linking flags
8180 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
8181 _ld_dl_dynamic=''
8182 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
8183 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
8184 _ld_dl_dynamic='-rdynamic'
8187 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
8188 bsdos && extra_ldflags="$extra_ldflags -ldvd"
8189 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
8191 def_debug='#undef MP_DEBUG'
8192 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
8195 echocheck "joystick"
8196 def_joystick='#undef CONFIG_JOYSTICK'
8197 if test "$_joystick" = yes ; then
8198 if linux ; then
8199 # TODO add some check
8200 def_joystick='#define CONFIG_JOYSTICK 1'
8201 else
8202 _joystick="no"
8203 _res_comment="unsupported under $system_name"
8206 echores "$_joystick"
8208 echocheck "lirc"
8209 if test "$_lirc" = auto ; then
8210 _lirc=no
8211 cat > $TMPC <<EOF
8212 #include <lirc/lirc_client.h>
8213 int main(void) { return 0; }
8215 cc_check -llirc_client && _lirc=yes
8217 if test "$_lirc" = yes ; then
8218 def_lirc='#define CONFIG_LIRC 1'
8219 libs_mplayer="$libs_mplayer -llirc_client"
8220 else
8221 def_lirc='#undef CONFIG_LIRC'
8223 echores "$_lirc"
8225 echocheck "lircc"
8226 if test "$_lircc" = auto ; then
8227 _lircc=no
8228 cat > $TMPC <<EOF
8229 #include <lirc/lircc.h>
8230 int main(void) { return 0; }
8232 cc_check -llircc && _lircc=yes
8234 if test "$_lircc" = yes ; then
8235 def_lircc='#define CONFIG_LIRCC 1'
8236 libs_mplayer="$libs_mplayer -llircc"
8237 else
8238 def_lircc='#undef CONFIG_LIRCC'
8240 echores "$_lircc"
8242 if arm; then
8243 # Detect maemo development platform libraries availability (http://www.maemo.org),
8244 # they are used when run on Nokia 770|8x0
8245 echocheck "maemo (Nokia 770|8x0)"
8246 if test "$_maemo" = auto ; then
8247 _maemo=no
8248 cat > $TMPC << EOF
8249 #include <libosso.h>
8250 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
8252 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8254 if test "$_maemo" = yes ; then
8255 def_maemo='#define CONFIG_MAEMO 1'
8256 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8257 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
8258 else
8259 def_maemo='#undef CONFIG_MAEMO'
8261 echores "$_maemo"
8264 #############################################################################
8266 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
8267 # the OMF format needs to come after the 'extern symbol prefix' check, which
8268 # uses nm.
8269 if os2 ; then
8270 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
8273 # linker paths should be the same for mencoder and mplayer
8274 _ld_tmp=""
8275 for I in $libs_mplayer ; do
8276 _tmp=$(echo $I | sed -e 's/^-L.*$//')
8277 if test -z "$_tmp" ; then
8278 extra_ldflags="$extra_ldflags $I"
8279 else
8280 _ld_tmp="$_ld_tmp $I"
8282 done
8283 libs_mplayer=$_ld_tmp
8286 #############################################################################
8287 # 64 bit file offsets?
8288 if test "$_largefiles" = yes || freebsd ; then
8289 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
8290 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
8291 # dvdread support requires this (for off64_t)
8292 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
8296 CXXFLAGS=" $CFLAGS -D__STDC_LIMIT_MACROS"
8298 # This must be the last test to be performed. Any other tests following it
8299 # could fail due to linker errors. libdvdnavmini is intentionally not linked
8300 # against libdvdread (to permit MPlayer to use its own copy of the library).
8301 # So any compilation using the flags added here but not linking against
8302 # libdvdread can fail.
8303 echocheck "DVD support (libdvdnav)"
8304 dvdnav_internal=no
8305 if test "$_dvdnav" = auto ; then
8306 if test "$_dvdread_internal" = yes ; then
8307 _dvdnav=yes
8308 dvdnav_internal=yes
8309 _res_comment="internal"
8310 else
8311 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
8314 if test "$_dvdnav" = auto ; then
8315 cat > $TMPC <<EOF
8316 #include <inttypes.h>
8317 #include <dvdnav/dvdnav.h>
8318 int main(void) { dvdnav_t *dvd=0; return 0; }
8320 _dvdnav=no
8321 _dvdnavdir=$($_dvdnavconfig --cflags)
8322 _dvdnavlibs=$($_dvdnavconfig --libs)
8323 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
8325 if test "$_dvdnav" = yes ; then
8326 _largefiles=yes
8327 def_dvdnav='#define CONFIG_DVDNAV 1'
8328 if test "$dvdnav_internal" = yes ; then
8329 cflags_libdvdnav="-Ilibdvdnav"
8330 _inputmodules="dvdnav(internal) $_inputmodules"
8331 else
8332 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
8333 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
8334 _inputmodules="dvdnav $_inputmodules"
8336 else
8337 def_dvdnav='#undef CONFIG_DVDNAV'
8338 _noinputmodules="dvdnav $_noinputmodules"
8340 echores "$_dvdnav"
8342 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8343 # Read dvdnav comment above.
8345 #############################################################################
8346 echo "Creating config.mak"
8347 cat > config.mak << EOF
8348 # -------- Generated by configure -----------
8350 # Ensure that locale settings do not interfere with shell commands.
8351 export LC_ALL = C
8353 CONFIGURATION = $_configuration
8355 CHARSET = $_charset
8356 DOC_LANGS = $language_doc
8357 DOC_LANG_ALL = $doc_lang_all
8358 MAN_LANGS = $language_man
8359 MAN_LANG_ALL = $man_lang_all
8361 prefix = \$(DESTDIR)$_prefix
8362 BINDIR = \$(DESTDIR)$_bindir
8363 DATADIR = \$(DESTDIR)$_datadir
8364 LIBDIR = \$(DESTDIR)$_libdir
8365 MANDIR = \$(DESTDIR)$_mandir
8366 CONFDIR = \$(DESTDIR)$_confdir
8368 AR = $_ar
8369 AS = $_cc
8370 CC = $_cc
8371 CXX = $_cc
8372 HOST_CC = $_host_cc
8373 YASM = $_yasm
8374 INSTALL = $_install
8375 INSTALLSTRIP = $_install_strip
8376 RANLIB = $_ranlib
8377 WINDRES = $_windres
8379 CFLAGS = $CFLAGS $extra_cflags
8380 OPTFLAGS = $CFLAGS $extra_cflags
8381 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
8382 CFLAGS_DHAHELPER = $cflags_dhahelper
8383 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
8384 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
8385 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
8386 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
8387 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
8388 CFLAGS_STACKREALIGN = $cflags_stackrealign
8389 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
8390 CFLAGS_TREMOR_LOW = $cflags_tremor_low
8391 YASMFLAGS = $YASMFLAGS
8393 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
8394 EXTRALIBS_MPLAYER = $libs_mplayer
8395 EXTRALIBS_MENCODER = $libs_mencoder
8397 DEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.h,\$^) | sed "s,[0-9a-z._-]*: \(\$(SRC_DIR)/\)*\([a-z0-9]*/\)[^/]* ,\\2&,"
8399 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 &,"
8400 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 &,"
8402 GETCH = $_getch
8403 HELP_FILE = $_mp_help
8404 TIMER = $_timer
8406 EXESUF = $_exesuf
8407 EXESUFS_ALL = .exe
8409 $_target_arch
8410 $_target_subarch
8411 $(echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/')
8413 MENCODER = $_mencoder
8414 MPLAYER = $_mplayer
8416 NEED_GETTIMEOFDAY = $_need_gettimeofday
8417 NEED_GLOB = $_need_glob
8418 NEED_MMAP = $_need_mmap
8419 NEED_SETENV = $_need_setenv
8420 NEED_SHMEM = $_need_shmem
8421 NEED_STRSEP = $_need_strsep
8422 NEED_SWAB = $_need_swab
8423 NEED_VSSCANF = $_need_vsscanf
8425 # features
8426 3DFX = $_3dfx
8427 AA = $_aa
8428 ALSA1X = $_alsa1x
8429 ALSA9 = $_alsa9
8430 ALSA5 = $_alsa5
8431 APPLE_IR = $_apple_ir
8432 APPLE_REMOTE = $_apple_remote
8433 ARTS = $_arts
8434 AUDIO_INPUT = $_audio_input
8435 BITMAP_FONT = $_bitmap_font
8436 BL = $_bl
8437 CACA = $_caca
8438 CDDA = $_cdda
8439 CDDB = $_cddb
8440 COREAUDIO = $_coreaudio
8441 COREVIDEO = $_corevideo
8442 DART = $_dart
8443 DFBMGA = $_dfbmga
8444 DGA = $_dga
8445 DIRECT3D = $_direct3d
8446 DIRECTFB = $_directfb
8447 DIRECTX = $_directx
8448 DVBIN = $_dvbin
8449 DVDNAV = $_dvdnav
8450 DVDNAV_INTERNAL = $dvdnav_internal
8451 DVDREAD = $_dvdread
8452 DVDREAD_INTERNAL = $_dvdread_internal
8453 DXR2 = $_dxr2
8454 DXR3 = $_dxr3
8455 ESD = $_esd
8456 FAAC=$_faac
8457 FAAD = $_faad
8458 FAAD_INTERNAL = $_faad_internal
8459 FASTMEMCPY = $_fastmemcpy
8460 $mak_hardcoded_tables
8461 $mak_libavcodec_mpegaudio_hp
8462 FBDEV = $_fbdev
8463 FREETYPE = $_freetype
8464 FTP = $_ftp
8465 GIF = $_gif
8466 GGI = $_ggi
8467 GL = $_gl
8468 GL_WIN32 = $_gl_win32
8469 GL_X11 = $_gl_x11
8470 MATRIXVIEW = $matrixview
8471 GUI = $_gui
8472 GUI_GTK = $_gui_gtk
8473 GUI_WIN32 = $_gui_win32
8474 HAVE_POSIX_SELECT = $_posix_select
8475 HAVE_SYS_MMAN_H = $_mman
8476 IVTV = $_ivtv
8477 JACK = $_jack
8478 JOYSTICK = $_joystick
8479 JPEG = $_jpeg
8480 KVA = $_kva
8481 LADSPA = $_ladspa
8482 LIBA52 = $_liba52
8483 LIBA52_INTERNAL = $_liba52_internal
8484 LIBASS = $_ass
8485 LIBASS_INTERNAL = $ass_internal
8486 LIBBS2B = $_libbs2b
8487 LIBDCA = $_libdca
8488 LIBDV = $_libdv
8489 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
8490 LIBLZO = $_liblzo
8491 LIBMAD = $_mad
8492 LIBMENU = $_menu
8493 LIBMENU_DVBIN = $_menu_dvbin
8494 LIBMPEG2 = $_libmpeg2
8495 LIBNEMESI = $_nemesi
8496 LIBNUT = $_libnut
8497 LIBSMBCLIENT = $_smb
8498 LIBTHEORA = $_theora
8499 LIRC = $_lirc
8500 LIVE555 = $_live
8501 MACOSX_BUNDLE = $_macosx_bundle
8502 MACOSX_FINDER = $_macosx_finder
8503 MD5SUM = $_md5sum
8504 MGA = $_mga
8505 MNG = $_mng
8506 MP3LAME = $_mp3lame
8507 MP3LIB = $_mp3lib
8508 MUSEPACK = $_musepack
8509 NAS = $_nas
8510 NATIVE_RTSP = $_native_rtsp
8511 NETWORK = $_network
8512 OPENAL = $_openal
8513 OSS = $_ossaudio
8514 PE_EXECUTABLE = $_pe_executable
8515 PNG = $_png
8516 PNM = $_pnm
8517 PRIORITY = $_priority
8518 PULSE = $_pulse
8519 PVR = $_pvr
8520 QTX_CODECS = $_qtx
8521 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8522 QTX_EMULATION = $_qtx_emulation
8523 QUARTZ = $_quartz
8524 RADIO=$_radio
8525 RADIO_CAPTURE=$_radio_capture
8526 REAL_CODECS = $_real
8527 S3FB = $_s3fb
8528 SDL = $_sdl
8529 SPEEX = $_speex
8530 STREAM_CACHE = $_stream_cache
8531 SGIAUDIO = $_sgiaudio
8532 SUNAUDIO = $_sunaudio
8533 SVGA = $_svga
8534 TDFXFB = $_tdfxfb
8535 TDFXVID = $_tdfxvid
8536 TGA = $_tga
8537 TOOLAME=$_toolame
8538 TREMOR_INTERNAL = $_tremor_internal
8539 TV = $_tv
8540 TV_BSDBT848 = $_tv_bsdbt848
8541 TV_DSHOW = $_tv_dshow
8542 TV_V4L = $_tv_v4l
8543 TV_V4L1 = $_tv_v4l1
8544 TV_V4L2 = $_tv_v4l2
8545 TWOLAME=$_twolame
8546 UNRAR_EXEC = $_unrar_exec
8547 V4L2 = $_v4l2
8548 VCD = $_vcd
8549 VDPAU = $_vdpau
8550 VESA = $_vesa
8551 VIDIX = $_vidix
8552 VIDIX_PCIDB = $_vidix_pcidb_val
8553 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8554 VIDIX_IVTV=$_vidix_drv_ivtv
8555 VIDIX_MACH64=$_vidix_drv_mach64
8556 VIDIX_MGA=$_vidix_drv_mga
8557 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8558 VIDIX_NVIDIA=$_vidix_drv_nvidia
8559 VIDIX_PM2=$_vidix_drv_pm2
8560 VIDIX_PM3=$_vidix_drv_pm3
8561 VIDIX_RADEON=$_vidix_drv_radeon
8562 VIDIX_RAGE128=$_vidix_drv_rage128
8563 VIDIX_S3=$_vidix_drv_s3
8564 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8565 VIDIX_SIS=$_vidix_drv_sis
8566 VIDIX_UNICHROME=$_vidix_drv_unichrome
8567 VORBIS = $_vorbis
8568 VSTREAM = $_vstream
8569 WII = $_wii
8570 WIN32DLL = $_win32dll
8571 WIN32WAVEOUT = $_win32waveout
8572 WIN32_EMULATION = $_win32_emulation
8573 WINVIDIX = $winvidix
8574 X11 = $_x11
8575 X264 = $_x264
8576 XANIM_CODECS = $_xanim
8577 XMGA = $_xmga
8578 XMMS_PLUGINS = $_xmms
8579 XV = $_xv
8580 XVID4 = $_xvid
8581 XVIDIX = $xvidix
8582 XVMC = $_xvmc
8583 XVR100 = $_xvr100
8584 YUV4MPEG = $_yuv4mpeg
8585 ZR = $_zr
8587 # FFmpeg
8588 LIBAVUTIL = $_libavutil
8589 LIBAVUTIL_A = $_libavutil_a
8590 LIBAVUTIL_SO = $_libavutil_so
8591 LIBAVCODEC = $_libavcodec
8592 LIBAVCODEC_A = $_libavcodec_a
8593 LIBAVCODEC_SO = $_libavcodec_so
8594 LIBAVFORMAT = $_libavformat
8595 LIBAVFORMAT_A = $_libavformat_a
8596 LIBAVFORMAT_SO = $_libavformat_so
8597 LIBPOSTPROC = $_libpostproc
8598 LIBPOSTPROC_A = $_libpostproc_a
8599 LIBPOSTPROC_SO = $_libpostproc_so
8600 LIBSWSCALE = $_libswscale
8601 LIBSWSCALE_A = $_libswscale_a
8602 LIBSWSCALE_SO = $_libswscale_so
8604 HOSTCC=\$(HOST_CC)
8605 HOSTCFLAGS=-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
8606 HOSTLIBS=-lm
8607 CC_O=-o \$@
8608 LD=gcc
8609 CONFIG_STATIC=yes
8610 SRC_PATH=..
8611 BUILD_ROOT=..
8612 LIBPREF=lib
8613 LIBSUF=.a
8614 LIBNAME=\$(LIBPREF)\$(NAME)\$(LIBSUF)
8615 FULLNAME=\$(NAME)\$(BUILDSUF)
8617 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8618 CONFIG_AANDCT=yes
8619 CONFIG_FFT=yes
8620 CONFIG_FFT_MMX=$fft_mmx
8621 CONFIG_GOLOMB=yes
8622 CONFIG_LPC=yes
8623 CONFIG_MDCT=yes
8624 CONFIG_RDFT=yes
8626 CONFIG_BZLIB=$bzlib
8627 CONFIG_ENCODERS=yes
8628 CONFIG_GPL=yes
8629 CONFIG_LIBDIRAC_DECODER=$_libdirac_lavc
8630 CONFIG_LIBDIRAC_ENCODER=$_libdirac_lavc
8631 CONFIG_LIBFAAC_ENCODER=$_faac_lavc
8632 CONFIG_LIBMP3LAME_ENCODER=$_mp3lame_lavc
8633 CONFIG_LIBOPENCORE_AMRNB_DECODER=$_libopencore_amrnb
8634 CONFIG_LIBOPENCORE_AMRNB_ENCODER=$_libopencore_amrnb
8635 CONFIG_LIBOPENCORE_AMRWB_DECODER=$_libopencore_amrwb
8636 OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
8637 OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
8638 CONFIG_LIBSCHROEDINGER_DECODER=$_libschroedinger_lavc
8639 CONFIG_LIBSCHROEDINGER_ENCODER=$_libschroedinger_lavc
8640 CONFIG_LIBVORBIS_ENCODER=$_libvorbis
8641 CONFIG_LIBX264_ENCODER=$_x264_lavc
8642 CONFIG_LIBXVID_ENCODER=$_xvid_lavc
8643 CONFIG_MLIB = $_mlib
8644 CONFIG_MUXERS=$_mencoder
8645 CONFIG_POSTPROC = yes
8646 # Prevent building libavcodec/imgresample.c with conflicting symbols
8647 CONFIG_SWSCALE=yes
8648 CONFIG_VDPAU=$_vdpau
8649 CONFIG_XVMC=$_xvmc
8650 CONFIG_ZLIB=$_zlib
8652 HAVE_PTHREADS = $_pthreads
8653 HAVE_SHM = $_shm
8654 HAVE_W32THREADS = $_w32threads
8655 HAVE_YASM = $_have_yasm
8657 $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8658 $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8659 $(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8660 $(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8661 $(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8662 $(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8663 $(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8666 #############################################################################
8668 ff_config_enable () {
8669 _nprefix=$3;
8670 test -z "$_nprefix" && _nprefix='CONFIG'
8671 for part in $1; do
8672 if $(echo $2 | grep -q -E "(^| )$part($| )"); then
8673 echo "#define ${_nprefix}_$part 1"
8674 else
8675 echo "#define ${_nprefix}_$part 0"
8677 done
8680 echo "Creating config.h"
8681 cat > $TMPH << EOF
8682 /*----------------------------------------------------------------------------
8683 ** This file has been automatically generated by configure any changes in it
8684 ** will be lost when you run configure again.
8685 ** Instead of modifying definitions here, use the --enable/--disable options
8686 ** of the configure script! See ./configure --help for details.
8687 *---------------------------------------------------------------------------*/
8689 #ifndef MPLAYER_CONFIG_H
8690 #define MPLAYER_CONFIG_H
8692 /* Undefine this if you do not want to select mono audio (left or right)
8693 with a stereo MPEG layer 2/3 audio stream. The command line option
8694 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8695 right-only), with 0 being the default.
8697 #define CONFIG_FAKE_MONO 1
8699 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8700 #define MAX_OUTBURST 65536
8702 /* set up audio OUTBURST. Do not change this! */
8703 #define OUTBURST 512
8705 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8706 #undef FAST_OSD
8707 #undef FAST_OSD_TABLE
8709 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8710 #define MPEG12_POSTPROC 1
8711 #define ATTRIBUTE_ALIGNED_MAX 16
8715 #define CONFIGURATION "$_configuration"
8717 #define MPLAYER_DATADIR "$_datadir"
8718 #define MPLAYER_CONFDIR "$_confdir"
8719 #define MPLAYER_LIBDIR "$_libdir"
8721 /* definitions needed by included libraries */
8722 #define HAVE_INTTYPES_H 1
8723 /* libmpeg2 + FFmpeg */
8724 $def_fast_inttypes
8725 /* libdvdcss */
8726 #define HAVE_ERRNO_H 1
8727 /* libdvdcss + libdvdread */
8728 #define HAVE_LIMITS_H 1
8729 /* libdvdcss + libfaad2 */
8730 #define HAVE_UNISTD_H 1
8731 /* libfaad2 + libdvdread */
8732 #define STDC_HEADERS 1
8733 #define HAVE_MEMCPY 1
8734 /* libfaad2 */
8735 #define HAVE_STRING_H 1
8736 #define HAVE_STRINGS_H 1
8737 #define HAVE_SYS_STAT_H 1
8738 #define HAVE_SYS_TYPES_H 1
8739 /* libdvdnav */
8740 #define READ_CACHE_TRACE 0
8741 /* libdvdread */
8742 #define HAVE_DLFCN_H 1
8743 $def_dvdcss
8746 /* system headers */
8747 $def_alloca_h
8748 $def_alsa_asoundlib_h
8749 $def_altivec_h
8750 $def_malloc_h
8751 $def_mman_h
8752 $def_mman_has_map_failed
8753 $def_soundcard_h
8754 $def_sys_asoundlib_h
8755 $def_sys_soundcard_h
8756 $def_sys_sysinfo_h
8757 $def_termios_h
8758 $def_termios_sys_h
8759 $def_winsock2_h
8762 /* system functions */
8763 $def_exp2
8764 $def_exp2f
8765 $def_gethostbyname2
8766 $def_gettimeofday
8767 $def_glob
8768 $def_langinfo
8769 $def_llrint
8770 $def_log2
8771 $def_log2f
8772 $def_lrint
8773 $def_lrintf
8774 $def_map_memalign
8775 $def_memalign
8776 $def_nanosleep
8777 $def_posix_select
8778 $def_round
8779 $def_roundf
8780 $def_select
8781 $def_setenv
8782 $def_shm
8783 $def_strsep
8784 $def_swab
8785 $def_sysi86
8786 $def_sysi86_iv
8787 $def_termcap
8788 $def_termios
8789 $def_truncf
8790 $def_vsscanf
8793 /* system-specific features */
8794 $def_asmalign_pot
8795 $def_builtin_expect
8796 $def_dl
8797 $def_extern_asm
8798 $def_extern_prefix
8799 $def_iconv
8800 $def_kstat
8801 $def_macosx_bundle
8802 $def_macosx_finder
8803 $def_maemo
8804 $def_named_asm_args
8805 $def_priority
8806 $def_quicktime
8807 $def_restrict_keyword
8808 $def_rtc
8809 $def_unrar_exec
8812 /* configurable options */
8813 $def_charset
8814 $def_crash_debug
8815 $def_debug
8816 $def_dynamic_plugins
8817 $def_fastmemcpy
8818 $def_hardcoded_tables
8819 $def_menu
8820 $def_runtime_cpudetection
8821 $def_sighandler
8822 $def_sortsub
8823 $def_stream_cache
8824 $def_pthread_cache
8827 /* CPU stuff */
8828 #define __CPU__ $iproc
8829 $def_words_endian
8830 $def_bigendian
8831 $(ff_config_enable "$_arch_all" "$_arch" "ARCH")
8832 $(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE")
8835 /* DVD/VCD/CD */
8836 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8837 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8838 $def_bsdi_dvd
8839 $def_cddb
8840 $def_cdio
8841 $def_cdparanoia
8842 $def_cdrom
8843 $def_dvd
8844 $def_dvd_bsd
8845 $def_dvd_darwin
8846 $def_dvd_linux
8847 $def_dvd_openbsd
8848 $def_dvdio
8849 $def_dvdnav
8850 $def_dvdread
8851 $def_hpux_scsi_h
8852 $def_libcdio
8853 $def_sol_scsi_h
8854 $def_vcd
8857 /* codec libraries */
8858 $def_faac
8859 $def_faad
8860 $def_faad_internal
8861 $def_liba52
8862 $def_liba52_internal
8863 $def_libdca
8864 $def_libdv
8865 $def_liblzo
8866 $def_libmpeg2
8867 $def_mad
8868 $def_mp3lame
8869 $def_mp3lame_preset
8870 $def_mp3lame_preset_medium
8871 $def_mp3lib
8872 $def_musepack
8873 $def_speex
8874 $def_theora
8875 $def_toolame
8876 $def_tremor
8877 $def_twolame
8878 $def_vorbis
8879 $def_x264
8880 $def_xvid
8881 $def_zlib
8883 $def_libnut
8886 /* binary codecs */
8887 $def_qtx
8888 $def_qtx_win32
8889 $def_real
8890 $def_real_path
8891 $def_win32_loader
8892 $def_win32dll
8893 #define WIN32_PATH "$_win32codecsdir"
8894 $def_xanim
8895 $def_xanim_path
8896 $def_xmms
8897 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8900 /* GUI */
8901 $def_gtk2
8902 $def_gui
8903 $def_xshape
8906 /* Audio output drivers */
8907 $def_alsa
8908 $def_alsa1x
8909 $def_alsa5
8910 $def_alsa9
8911 $def_arts
8912 $def_coreaudio
8913 $def_dart
8914 $def_esd
8915 $def_esd_latency
8916 $def_jack
8917 $def_nas
8918 $def_openal
8919 $def_openal_h
8920 $def_ossaudio
8921 $def_ossaudio_devdsp
8922 $def_ossaudio_devmixer
8923 $def_pulse
8924 $def_sgiaudio
8925 $def_sunaudio
8926 $def_win32waveout
8928 $def_ladspa
8929 $def_libbs2b
8932 /* input */
8933 $def_apple_ir
8934 $def_apple_remote
8935 $def_ioctl_bt848_h_name
8936 $def_ioctl_meteor_h_name
8937 $def_joystick
8938 $def_lirc
8939 $def_lircc
8940 $def_pvr
8941 $def_radio
8942 $def_radio_bsdbt848
8943 $def_radio_capture
8944 $def_radio_v4l
8945 $def_radio_v4l2
8946 $def_tv
8947 $def_tv_bsdbt848
8948 $def_tv_dshow
8949 $def_tv_v4l
8950 $def_tv_v4l1
8951 $def_tv_v4l2
8954 /* font stuff */
8955 $def_ass
8956 $def_ass_internal
8957 $def_bitmap_font
8958 $def_enca
8959 $def_fontconfig
8960 $def_freetype
8961 $def_fribidi
8964 /* networking */
8965 $def_closesocket
8966 $def_ftp
8967 $def_inet6
8968 $def_inet_aton
8969 $def_inet_pton
8970 $def_live
8971 $def_nemesi
8972 $def_network
8973 $def_smb
8974 $def_socklen_t
8975 $def_vstream
8976 $def_addrinfo
8977 $def_getaddrinfo
8978 $def_sockaddr_storage
8981 /* libvo options */
8982 $def_3dfx
8983 $def_aa
8984 $def_bl
8985 $def_caca
8986 $def_corevideo
8987 $def_dfbmga
8988 $def_dga
8989 $def_dga1
8990 $def_dga2
8991 $def_direct3d
8992 $def_directfb
8993 $def_directfb_version
8994 $def_directx
8995 $def_dvb
8996 $def_dvb_head
8997 $def_dvbin
8998 $def_dxr2
8999 $def_dxr3
9000 $def_fbdev
9001 $def_ggi
9002 $def_ggiwmh
9003 $def_gif
9004 $def_gif_4
9005 $def_gif_tvt_hack
9006 $def_gl
9007 $def_gl_win32
9008 $def_gl_x11
9009 $def_matrixview
9010 $def_ivtv
9011 $def_jpeg
9012 $def_kva
9013 $def_md5sum
9014 $def_mga
9015 $def_mng
9016 $def_png
9017 $def_pnm
9018 $def_quartz
9019 $def_s3fb
9020 $def_sdl
9021 $def_sdl_sdl_h
9022 $def_sdlbuggy
9023 $def_svga
9024 $def_tdfxfb
9025 $def_tdfxvid
9026 $def_tga
9027 $def_v4l2
9028 $def_vdpau
9029 $def_vesa
9030 $def_vidix
9031 $def_vidix_drv_cyberblade
9032 $def_vidix_drv_ivtv
9033 $def_vidix_drv_mach64
9034 $def_vidix_drv_mga
9035 $def_vidix_drv_mga_crtc2
9036 $def_vidix_drv_nvidia
9037 $def_vidix_drv_pm3
9038 $def_vidix_drv_radeon
9039 $def_vidix_drv_rage128
9040 $def_vidix_drv_s3
9041 $def_vidix_drv_sh_veu
9042 $def_vidix_drv_sis
9043 $def_vidix_drv_unichrome
9044 $def_vidix_pfx
9045 $def_vm
9046 $def_wii
9047 $def_x11
9048 $def_xdpms
9049 $def_xf86keysym
9050 $def_xinerama
9051 $def_xmga
9052 $def_xss
9053 $def_xv
9054 $def_xvmc
9055 $def_xvr100
9056 $def_yuv4mpeg
9057 $def_zr
9060 /* FFmpeg */
9061 $def_libavcodec
9062 $def_libavcodec_a
9063 $def_libavcodec_so
9064 $def_libavformat
9065 $def_libavformat_a
9066 $def_libavformat_so
9067 $def_libavutil
9068 $def_libavutil_a
9069 $def_libavutil_so
9070 $def_libpostproc
9071 $def_libpostproc_a
9072 $def_libpostproc_so
9073 $def_libswscale
9074 $def_libswscale_a
9075 $def_libswscale_so
9077 #define CONFIG_DECODERS 1
9078 #define CONFIG_ENCODERS 1
9079 #define CONFIG_DEMUXERS 1
9080 $def_muxers
9082 $def_arpa_inet_h
9083 $def_bswap
9084 $def_bzlib
9085 $def_dcbzl
9086 $def_dos_paths
9087 $def_fast_64bit
9088 $def_fast_unaligned
9089 $def_libavcodec_mpegaudio_hp
9090 $def_memalign_hack
9091 $def_mlib
9092 $def_mkstemp
9093 $def_posix_memalign
9094 $def_pthreads
9095 $def_ten_operands
9096 $def_threads
9097 $def_xform_asm
9098 $def_yasm
9100 #define CONFIG_FASTDIV 0
9101 #define CONFIG_FFSERVER 0
9102 #define CONFIG_GPL 1
9103 #define CONFIG_GRAY 0
9104 #define CONFIG_LIBVORBIS 0
9105 #define CONFIG_POWERPC_PERF 0
9106 #define CONFIG_SMALL 0
9107 #define CONFIG_SWSCALE 1
9108 #define CONFIG_SWSCALE_ALPHA 1
9110 #if defined(HAVE_AF_INET6) && (!defined(_WIN32) || defined(__CYGWIN__))
9111 #define CONFIG_IPV6 1
9112 #else
9113 #define CONFIG_IPV6 0
9114 #endif
9116 #define HAVE_ATTRIBUTE_PACKED 1
9117 #define HAVE_GETHRTIME 0
9118 #define HAVE_INLINE_ASM 0
9119 #define HAVE_LDBRX 0
9120 #define HAVE_POLL_H 1
9121 #define HAVE_PPC4XX 0
9122 #define HAVE_SETMODE 0
9123 #define HAVE_SYS_SELECT_H 0
9124 #define HAVE_VIRTUALALLOC 0
9126 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
9127 #define CONFIG_AANDCT 1
9128 #define CONFIG_FFT 1
9129 #define CONFIG_GOLOMB 1
9130 #define CONFIG_LPC 1
9131 #define CONFIG_MDCT 1
9132 #define CONFIG_RDFT 1
9134 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
9135 $def_ebx_available
9136 #ifndef MP_DEBUG
9137 #define HAVE_EBP_AVAILABLE 1
9138 #else
9139 #define HAVE_EBP_AVAILABLE 0
9140 #endif
9142 #define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
9143 #define FFMPEG_LICENSE "GPL version 2 or later"
9145 /* External libraries used through libavcodec. */
9146 $def_faac_lavc
9147 $def_libdirac_lavc
9148 $def_libopencore_amrnb
9149 $def_libopencore_amrwb
9150 $def_libopenjpeg
9151 $def_libschroedinger_lavc
9152 $def_mp3lame_lavc
9153 $def_x264_lavc
9154 $def_xvid_lavc
9156 $(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
9157 $(ff_config_enable "$_libavencoders_all" "$_libavencoders")
9158 $(ff_config_enable "$_libavparsers_all" "$_libavparsers")
9159 $(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
9160 $(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
9161 $(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
9162 $(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
9164 #define CONFIG_H263_VAAPI_HWACCEL 0
9165 #define CONFIG_MPEG2_VAAPI_HWACCEL 0
9166 #define CONFIG_MPEG4_VAAPI_HWACCEL 0
9167 #define CONFIG_H264_VAAPI_HWACCEL 0
9168 #define CONFIG_VC1_VAAPI_HWACCEL 0
9169 #define CONFIG_WMV3_VAAPI_HWACCEL 0
9171 #endif /* MPLAYER_CONFIG_H */
9174 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
9175 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
9177 #############################################################################
9179 cat << EOF
9181 Config files successfully generated by ./configure $_configuration !
9183 Install prefix: $_prefix
9184 Data directory: $_datadir
9185 Config direct.: $_confdir
9187 Byte order: $_byte_order
9188 Optimizing for: $_optimizing
9190 Languages:
9191 Messages/GUI: $language_msg
9192 Manual pages: $language_man
9193 Documentation: $language_doc
9195 Enabled optional drivers:
9196 Input: $_inputmodules
9197 Codecs: $_codecmodules
9198 Audio output: $_aomodules
9199 Video output: $_vomodules
9201 Disabled optional drivers:
9202 Input: $_noinputmodules
9203 Codecs: $_nocodecmodules
9204 Audio output: $_noaomodules
9205 Video output: $_novomodules
9207 'config.h' and 'config.mak' contain your configuration options.
9208 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
9209 compile *** DO NOT REPORT BUGS if you tweak these files ***
9211 'make' will now compile MPlayer and 'make install' will install it.
9212 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
9217 if test "$_mtrr" = yes ; then
9218 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
9219 echo
9222 if ! x86_32; then
9223 cat <<EOF
9224 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
9225 operating system ($system_name). You may encounter a few files that cannot
9226 be played due to missing open source video/audio codec support.
9232 cat <<EOF
9233 Check $TMPLOG if you wonder why an autodetection failed (make sure
9234 development headers/packages are installed).
9236 NOTE: The --enable-* parameters unconditionally force options on, completely
9237 skipping autodetection. This behavior is unlike what you may be used to from
9238 autoconf-based configure scripts that can decide to override you. This greater
9239 level of control comes at a price. You may have to provide the correct compiler
9240 and linker flags yourself.
9241 If you used one of these options (except --enable-gui and similar ones that
9242 turn on internal features) and experience a compilation or linking failure,
9243 make sure you have passed the necessary compiler/linker flags to configure.
9245 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
9249 if test "$_warn_CFLAGS" = yes; then
9250 cat <<EOF
9252 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
9253 but:
9255 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
9257 It is strongly recommended to let MPlayer choose the correct CFLAGS!
9258 To do so, execute 'CFLAGS= ./configure <options>'
9263 # Last move:
9264 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"