sync with en/mplayer.1 rev. 31173
[mplayer/glamo.git] / configure
blob6308d11878ab342cb412ffb576a624bbdf595b52
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]
222 Optional features:
223 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
224 --disable-mplayer disable MPlayer compilation [enable]
225 --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable]
226 --enable-gtk1 force using GTK 1.2 for the GUI [disable]
227 --disable-largefiles disable support for files > 2GB [enable]
228 --enable-linux-devfs set default devices to devfs [disable]
229 --enable-termcap use termcap database for key codes [autodetect]
230 --enable-termios use termios database for key codes [autodetect]
231 --disable-iconv disable iconv for encoding conversion [autodetect]
232 --disable-langinfo do not use langinfo [autodetect]
233 --enable-lirc enable LIRC (remote control) support [autodetect]
234 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
235 --enable-joystick enable joystick support [disable]
236 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
237 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
238 --disable-vm disable X video mode extensions [autodetect]
239 --disable-xf86keysym disable support for multimedia keys [autodetect]
240 --enable-radio enable radio interface [disable]
241 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
242 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
243 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
244 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
245 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
246 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
247 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
248 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
249 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
250 --disable-network disable networking [enable]
251 --enable-winsock2_h enable winsock2_h [autodetect]
252 --enable-smb enable Samba (SMB) input [autodetect]
253 --enable-live enable LIVE555 Streaming Media [autodetect]
254 --enable-nemesi enable Nemesi Streaming Media [autodetect]
255 --disable-vcd disable VCD support [autodetect]
256 --disable-dvdnav disable libdvdnav [autodetect]
257 --disable-dvdread disable libdvdread [autodetect]
258 --disable-dvdread-internal disable internal libdvdread [autodetect]
259 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
260 --disable-cdparanoia disable cdparanoia [autodetect]
261 --disable-cddb disable cddb [autodetect]
262 --disable-bitmap-font disable bitmap font support [enable]
263 --disable-freetype disable FreeType 2 font rendering [autodetect]
264 --disable-fontconfig disable fontconfig font lookup [autodetect]
265 --disable-unrarexec disable using of UnRAR executable [enabled]
266 --enable-menu enable OSD menu (not DVD menu) [disabled]
267 --disable-sortsub disable subtitle sorting [enabled]
268 --enable-fribidi enable the FriBiDi libs [autodetect]
269 --disable-enca disable ENCA charset oracle library [autodetect]
270 --disable-maemo disable maemo specific features [autodetect]
271 --enable-macosx-finder enable Mac OS X Finder invocation parameter
272 parsing [disabled]
273 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
274 --disable-inet6 disable IPv6 support [autodetect]
275 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
276 --disable-ftp disable FTP support [enabled]
277 --disable-vstream disable TiVo vstream client support [autodetect]
278 --disable-pthreads disable Posix threads support [autodetect]
279 --disable-w32threads disable Win32 threads support [autodetect]
280 --disable-ass-internal disable internal SSA/ASS subtitle support [autodetect]
281 --disable-ass disable SSA/ASS subtitle support [autodetect]
282 --enable-rpath enable runtime linker path for extra libs [disabled]
284 Codecs:
285 --enable-gif enable GIF support [autodetect]
286 --enable-png enable PNG input/output support [autodetect]
287 --enable-mng enable MNG input support [autodetect]
288 --enable-jpeg enable JPEG input/output support [autodetect]
289 --enable-libcdio enable libcdio support [autodetect]
290 --enable-liblzo enable liblzo support [autodetect]
291 --disable-win32dll disable Win32 DLL support [autodetect]
292 --disable-qtx disable QuickTime codecs support [enabled]
293 --disable-xanim disable XAnim codecs support [enabled]
294 --disable-real disable RealPlayer codecs support [enabled]
295 --disable-xvid disable Xvid [autodetect]
296 --disable-xvid-lavc disable Xvid in libavcodec [autodetect]
297 --disable-x264 disable x264 [autodetect]
298 --disable-x264-lavc disable x264 in libavcodec [autodetect]
299 --disable-libdirac-lavc disable Dirac in libavcodec [autodetect]
300 --disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger
301 decoder) [autodetect]
302 --disable-libnut disable libnut [autodetect]
303 --disable-libavutil_a disable static libavutil [autodetect]
304 --disable-libavcodec_a disable static libavcodec [autodetect]
305 --disable-libavformat_a disable static libavformat [autodetect]
306 --disable-libpostproc_a disable static libpostproc [autodetect]
307 --disable-libswscale_a disable static libswscale [autodetect]
308 --disable-libavutil_so disable shared libavutil [autodetect]
309 --disable-libavcodec_so disable shared libavcodec [autodetect]
310 --disable-libavformat_so disable shared libavformat [autodetect]
311 --disable-libpostproc_so disable shared libpostproc [autodetect]
312 --disable-libswscale_so disable shared libswscale [autodetect]
313 --disable-libavcodec_mpegaudio_hp disable high precision audio decoding
314 in libavcodec [enabled]
315 --disable-tremor-internal disable internal Tremor [enabled]
316 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
317 --enable-tremor enable external Tremor [autodetect]
318 --disable-libvorbis disable libvorbis support [autodetect]
319 --disable-speex disable Speex support [autodetect]
320 --enable-theora enable OggTheora libraries [autodetect]
321 --enable-faad enable external FAAD2 (AAC) [autodetect]
322 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
323 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
324 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
325 --disable-faac-lavc disable support for FAAC in libavcodec [autodetect]
326 --disable-ladspa disable LADSPA plugin support [autodetect]
327 --disable-libbs2b disable libbs2b audio filter support [autodetect]
328 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
329 --disable-mad disable libmad (MPEG audio) support [autodetect]
330 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
331 --disable-mp3lame-lavc disable LAME in libavcodec [autodetect]
332 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
333 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
334 --enable-xmms enable XMMS input plugin support [disabled]
335 --enable-libdca enable libdca support [autodetect]
336 --disable-mp3lib disable builtin mp3lib [autodetect]
337 --disable-liba52 disable liba52 [autodetect]
338 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
339 --disable-musepack disable musepack support [autodetect]
340 --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect]
341 --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect]
342 --disable-libopenjpeg disable OpenJPEG (JPEG2000) input/output support [autodetect]
343 --disable-decoder=DECODER disable specified FFmpeg decoder
344 --enable-decoder=DECODER enable specified FFmpeg decoder
345 --disable-encoder=ENCODER disable specified FFmpeg encoder
346 --enable-encoder=ENCODER enable specified FFmpeg encoder
347 --disable-parser=PARSER disable specified FFmpeg parser
348 --enable-parser=PARSER enable specified FFmpeg parser
349 --disable-protocol=PROTO disable specified FFmpeg protocol
350 --enable-protocol=PROTO enable specified FFmpeg protocol
351 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
352 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
353 --disable-muxer=MUXER disable specified FFmpeg muxer
354 --enable-muxer=MUXER enable specified FFmpeg muxer
356 Video output:
357 --disable-vidix disable VIDIX [for x86 *nix]
358 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
359 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
360 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
361 --disable-vidix-pcidb disable VIDIX PCI device name database
362 --enable-dhahelper enable VIDIX dhahelper support
363 --enable-svgalib_helper enable VIDIX svgalib_helper support
364 --enable-gl enable OpenGL video output [autodetect]
365 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
366 --enable-dga2 enable DGA 2 support [autodetect]
367 --enable-dga1 enable DGA 1 support [autodetect]
368 --enable-vesa enable VESA video output [autodetect]
369 --enable-svga enable SVGAlib video output [autodetect]
370 --enable-sdl enable SDL video output [autodetect]
371 --enable-kva enable KVA video output [autodetect]
372 --enable-aa enable AAlib video output [autodetect]
373 --enable-caca enable CACA video output [autodetect]
374 --enable-ggi enable GGI video output [autodetect]
375 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
376 --enable-direct3d enable Direct3D video output [autodetect]
377 --enable-directx enable DirectX video output [autodetect]
378 --enable-dxr2 enable DXR2 video output [autodetect]
379 --enable-dxr3 enable DXR3/H+ video output [autodetect]
380 --enable-ivtv enable IVTV TV-Out video output [autodetect]
381 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
382 --enable-dvb enable DVB video output [autodetect]
383 --enable-mga enable mga_vid video output [autodetect]
384 --enable-xmga enable mga_vid X11 video output [autodetect]
385 --enable-xv enable Xv video output [autodetect]
386 --enable-xvmc enable XvMC acceleration [disable]
387 --enable-vdpau enable VDPAU acceleration [autodetect]
388 --enable-vm enable XF86VidMode support [autodetect]
389 --enable-xinerama enable Xinerama support [autodetect]
390 --enable-x11 enable X11 video output [autodetect]
391 --enable-xshape enable XShape support [autodetect]
392 --disable-xss disable screensaver support via xss [autodetect]
393 --enable-fbdev enable FBDev video output [autodetect]
394 --enable-mlib enable mediaLib video output (Solaris) [disable]
395 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
396 --enable-tdfxfb enable tdfxfb video output [disable]
397 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
398 --enable-wii enable Nintendo Wii/GameCube video output [disable]
399 --enable-directfb enable DirectFB video output [autodetect]
400 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
401 --enable-bl enable Blinkenlights video output [disable]
402 --enable-tdfxvid enable tdfx_vid video output [disable]
403 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
404 --disable-tga disable Targa video output [enable]
405 --disable-pnm disable PNM video output [enable]
406 --disable-md5sum disable md5sum video output [enable]
407 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
408 --disable-corevideo disable CoreVideo video output [autodetect]
409 --disable-quartz disable Quartz video output [autodetect]
411 Audio output:
412 --disable-alsa disable ALSA audio output [autodetect]
413 --disable-ossaudio disable OSS audio output [autodetect]
414 --disable-arts disable aRts audio output [autodetect]
415 --disable-esd disable esd audio output [autodetect]
416 --disable-pulse disable Pulseaudio audio output [autodetect]
417 --disable-jack disable JACK audio output [autodetect]
418 --disable-openal disable OpenAL audio output [autodetect]
419 --disable-nas disable NAS audio output [autodetect]
420 --disable-sgiaudio disable SGI audio output [autodetect]
421 --disable-sunaudio disable Sun audio output [autodetect]
422 --disable-kai disable KAI audio output [autodetect]
423 --disable-dart disable DART audio output [autodetect]
424 --disable-win32waveout disable Windows waveout audio output [autodetect]
425 --disable-coreaudio disable CoreAudio audio output [autodetect]
426 --disable-select disable using select() on the audio device [enable]
428 Language options:
429 --charset=charset convert the console messages to this character set
430 --language-doc=lang language to use for the documentation [en]
431 --language-man=lang language to use for the man pages [en]
432 --language-msg=lang language to use for the messages and the GUI [en]
433 --language=lang default language to use [en]
434 Specific options override --language. You can pass a list of languages separated
435 by whitespace or commas instead of a single language. Nonexisting translations
436 will be dropped from each list. All documentation and man page translations
437 available in the list will be installed, for the messages the first available
438 translation will be used. The value "all" will activate all translations. The
439 LINGUAS environment variable is honored. In all cases the fallback is English.
440 Available values are: all $msg_lang_all
442 Miscellaneous options:
443 --enable-runtime-cpudetection enable runtime CPU detection [disable]
444 --enable-cross-compile enable cross-compilation [autodetect]
445 --cc=COMPILER C compiler to build MPlayer [gcc]
446 --host-cc=COMPILER C compiler for tools needed while building [gcc]
447 --as=ASSEMBLER assembler to build MPlayer [as]
448 --nm=NM nm tool to build MPlayer [nm]
449 --yasm=YASM Yasm assembler to build MPlayer [yasm]
450 --ar=AR librarian to build MPlayer [ar]
451 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
452 --windres=WINDRES windres to build MPlayer [windres]
453 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
454 --enable-static build a statically linked binary
455 --with-install=PATH path to a custom install program
457 Advanced options:
458 --enable-mmx enable MMX [autodetect]
459 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
460 --enable-3dnow enable 3DNow! [autodetect]
461 --enable-3dnowext enable extended 3DNow! [autodetect]
462 --enable-sse enable SSE [autodetect]
463 --enable-sse2 enable SSE2 [autodetect]
464 --enable-ssse3 enable SSSE3 [autodetect]
465 --enable-shm enable shm [autodetect]
466 --enable-altivec enable AltiVec (PowerPC) [autodetect]
467 --enable-armv5te enable DSP extensions (ARM) [autodetect]
468 --enable-armv6 enable ARMv6 (ARM) [autodetect]
469 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
470 --enable-armvfp enable ARM VFP (ARM) [autodetect]
471 --enable-neon enable NEON (ARM) [autodetect]
472 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
473 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
474 --enable-hardcoded-tables put tables in binary instead of calculating them at startup [disable]
475 --enable-big-endian force byte order to big-endian [autodetect]
476 --enable-debug[=1-3] compile-in debugging information [disable]
477 --enable-profile compile-in profiling information [disable]
478 --disable-sighandler disable sighandler for crashes [enable]
479 --enable-crash-debug enable automatic gdb attach on crash [disable]
480 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
482 Use these options if autodetection fails:
483 --extra-cflags=FLAGS extra CFLAGS
484 --extra-ldflags=FLAGS extra LDFLAGS
485 --extra-libs=FLAGS extra linker flags
486 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
487 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
488 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
490 --with-freetype-config=PATH path to freetype-config
491 --with-fribidi-config=PATH path to fribidi-config
492 --with-glib-config=PATH path to glib*-config
493 --with-gtk-config=PATH path to gtk*-config
494 --with-sdl-config=PATH path to sdl*-config
495 --with-dvdnav-config=PATH path to dvdnav-config
496 --with-dvdread-config=PATH path to dvdread-config
498 This configure script is NOT autoconf-based, even though its output is similar.
499 It will try to autodetect all configuration options. If you --enable an option
500 it will be forcefully turned on, skipping autodetection. This can break
501 compilation, so you need to know what you are doing.
503 exit 0
504 } #show_help()
506 # GOTCHA: the variables below defines the default behavior for autodetection
507 # and have - unless stated otherwise - at least 2 states : yes no
508 # If autodetection is available then the third state is: auto
509 _mmx=auto
510 _3dnow=auto
511 _3dnowext=auto
512 _mmxext=auto
513 _sse=auto
514 _sse2=auto
515 _ssse3=auto
516 _cmov=auto
517 _fast_cmov=auto
518 _fast_clz=auto
519 _armv5te=auto
520 _armv6=auto
521 _armv6t2=auto
522 _armvfp=auto
523 neon=auto
524 _iwmmxt=auto
525 _mtrr=auto
526 _altivec=auto
527 _install=install
528 _ranlib=ranlib
529 _windres=windres
530 _cc=cc
531 _ar=ar
532 test "$CC" && _cc="$CC"
533 _as=auto
534 _nm=auto
535 _yasm=yasm
536 _runtime_cpudetection=no
537 _cross_compile=auto
538 _prefix="/usr/local"
539 _libavutil_a=auto
540 _libavutil_so=auto
541 _libavcodec_a=auto
542 _libopencore_amrnb=auto
543 _libopencore_amrwb=auto
544 libopenjpeg=auto
545 _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
546 _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//)
547 _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
548 _libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//)
549 _libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
550 _libavparsers=$_libavparsers_all
551 _libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
552 _libavbsfs=$_libavbsfs_all
553 _libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
554 # Disable all hardware accelerators for now.
555 _libavhwaccels=
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/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// -e s/RTSP_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 _dxr2=auto
604 _dxr3=auto
605 _ivtv=auto
606 _v4l2=auto
607 _iconv=auto
608 _langinfo=auto
609 _rtc=auto
610 _ossaudio=auto
611 _arts=auto
612 _esd=auto
613 _pulse=auto
614 _jack=auto
615 _kai=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 _libdca=auto
634 _libmpeg2=auto
635 _faad=auto
636 _faad_internal=auto
637 _faad_fixed=no
638 _faac=auto
639 _faac_lavc=auto
640 _ladspa=auto
641 _libbs2b=auto
642 _xmms=no
643 _vcd=auto
644 _dvdnav=auto
645 _dvdnavconfig=dvdnav-config
646 _dvdreadconfig=dvdread-config
647 _dvdread=auto
648 _dvdread_internal=auto
649 _libdvdcss_internal=auto
650 _xanim=auto
651 _real=auto
652 _live=auto
653 _nemesi=auto
654 _native_rtsp=yes
655 _xinerama=auto
656 _mga=auto
657 _xmga=auto
658 _vm=auto
659 _xf86keysym=auto
660 _mlib=no #broken, thus disabled
661 _sgiaudio=auto
662 _sunaudio=auto
663 _alsa=auto
664 _fastmemcpy=yes
665 hardcoded_tables=no
666 _unrar_exec=auto
667 _win32dll=auto
668 _select=yes
669 _radio=no
670 _radio_capture=no
671 _radio_v4l=auto
672 _radio_v4l2=auto
673 _radio_bsdbt848=auto
674 _tv=yes
675 _tv_v4l1=auto
676 _tv_v4l2=auto
677 _tv_bsdbt848=auto
678 _tv_dshow=auto
679 _pvr=auto
680 _network=yes
681 _winsock2_h=auto
682 _struct_addrinfo=auto
683 _getaddrinfo=auto
684 _struct_sockaddr_storage=auto
685 _smb=auto
686 _vidix=auto
687 _vidix_pcidb=yes
688 _dhahelper=no
689 _svgalib_helper=no
690 _joystick=no
691 _xvid=auto
692 _xvid_lavc=auto
693 _x264=auto
694 _x264_lavc=auto
695 _libdirac_lavc=auto
696 _libschroedinger_lavc=auto
697 _libnut=auto
698 _lirc=auto
699 _lircc=auto
700 _apple_remote=auto
701 _apple_ir=auto
702 _gui=no
703 _gtk1=no
704 _termcap=auto
705 _termios=auto
706 _3dfx=no
707 _s3fb=no
708 _wii=no
709 _tdfxfb=no
710 _tdfxvid=no
711 _xvr100=auto
712 _tga=yes
713 _directfb=auto
714 _zr=auto
715 _bl=no
716 _largefiles=yes
717 #language=en
718 _shm=auto
719 _linux_devfs=no
720 _charset="UTF-8"
721 _dynamic_plugins=no
722 _crash_debug=no
723 _sighandler=yes
724 _libdv=auto
725 _cdparanoia=auto
726 _cddb=auto
727 _big_endian=auto
728 _bitmap_font=yes
729 _freetype=auto
730 _fontconfig=auto
731 _menu=no
732 _qtx=auto
733 _maemo=auto
734 _coreaudio=auto
735 _corevideo=auto
736 _quartz=auto
737 quicktime=auto
738 _macosx_finder=no
739 _macosx_bundle=auto
740 _sortsub=yes
741 _freetypeconfig='freetype-config'
742 _fribidi=auto
743 _fribidiconfig='fribidi-config'
744 _enca=auto
745 _inet6=auto
746 _gethostbyname2=auto
747 _ftp=yes
748 _musepack=auto
749 _vstream=auto
750 _pthreads=auto
751 _w32threads=auto
752 _ass=auto
753 ass_internal=yes
754 _rpath=no
755 _asmalign_pot=auto
756 _stream_cache=yes
757 _priority=no
758 def_dos_paths="#define HAVE_DOS_PATHS 0"
759 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
760 def_priority="#undef CONFIG_PRIORITY"
761 def_pthread_cache="#undef PTHREAD_CACHE"
762 _need_shmem=yes
763 for ac_option do
764 case "$ac_option" in
765 --help|-help|-h)
766 show_help
768 --prefix=*)
769 _prefix=$(echo $ac_option | cut -d '=' -f 2)
771 --bindir=*)
772 _bindir=$(echo $ac_option | cut -d '=' -f 2)
774 --datadir=*)
775 _datadir=$(echo $ac_option | cut -d '=' -f 2)
777 --mandir=*)
778 _mandir=$(echo $ac_option | cut -d '=' -f 2)
780 --confdir=*)
781 _confdir=$(echo $ac_option | cut -d '=' -f 2)
783 --libdir=*)
784 _libdir=$(echo $ac_option | cut -d '=' -f 2)
786 --codecsdir=*)
787 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
790 --with-install=*)
791 _install=$(echo $ac_option | cut -d '=' -f 2 )
793 --with-xvmclib=*)
794 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
797 --with-sdl-config=*)
798 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
800 --with-freetype-config=*)
801 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
803 --with-fribidi-config=*)
804 _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2)
806 --with-gtk-config=*)
807 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
809 --with-glib-config=*)
810 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
812 --with-dvdnav-config=*)
813 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
815 --with-dvdread-config=*)
816 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
819 --extra-cflags=*)
820 extra_cflags=$(echo $ac_option | cut -d '=' -f 2-)
822 --extra-ldflags=*)
823 extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-)
825 --extra-libs=*)
826 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
828 --extra-libs-mplayer=*)
829 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
831 --extra-libs-mencoder=*)
832 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
835 --target=*)
836 _target=$(echo $ac_option | cut -d '=' -f 2)
838 --cc=*)
839 _cc=$(echo $ac_option | cut -d '=' -f 2)
841 --host-cc=*)
842 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
844 --as=*)
845 _as=$(echo $ac_option | cut -d '=' -f 2)
847 --nm=*)
848 _nm=$(echo $ac_option | cut -d '=' -f 2)
850 --yasm=*)
851 _yasm=$(echo $ac_option | cut -d '=' -f 2)
853 --ar=*)
854 _ar=$(echo $ac_option | cut -d '=' -f 2)
856 --ranlib=*)
857 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
859 --windres=*)
860 _windres=$(echo $ac_option | cut -d '=' -f 2)
862 --charset=*)
863 _charset=$(echo $ac_option | cut -d '=' -f 2)
865 --language-doc=*)
866 language_doc=$(echo $ac_option | cut -d '=' -f 2)
868 --language-man=*)
869 language_man=$(echo $ac_option | cut -d '=' -f 2)
871 --language-msg=*)
872 language_msg=$(echo $ac_option | cut -d '=' -f 2)
874 --language=*)
875 language=$(echo $ac_option | cut -d '=' -f 2)
878 --enable-static)
879 _ld_static='-static'
881 --disable-static)
882 _ld_static=''
884 --enable-profile)
885 _profile='-p'
887 --disable-profile)
888 _profile=
890 --enable-debug)
891 _debug='-g'
893 --enable-debug=*)
894 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
896 --disable-debug)
897 _debug=
899 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
900 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
901 --enable-cross-compile) _cross_compile=yes ;;
902 --disable-cross-compile) _cross_compile=no ;;
903 --enable-mencoder) _mencoder=yes ;;
904 --disable-mencoder) _mencoder=no ;;
905 --enable-mplayer) _mplayer=yes ;;
906 --disable-mplayer) _mplayer=no ;;
907 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
908 --disable-dynamic-plugins) _dynamic_plugins=no ;;
909 --enable-x11) _x11=yes ;;
910 --disable-x11) _x11=no ;;
911 --enable-xshape) _xshape=yes ;;
912 --disable-xshape) _xshape=no ;;
913 --enable-xss) _xss=yes ;;
914 --disable-xss) _xss=no ;;
915 --enable-xv) _xv=yes ;;
916 --disable-xv) _xv=no ;;
917 --enable-xvmc) _xvmc=yes ;;
918 --disable-xvmc) _xvmc=no ;;
919 --enable-vdpau) _vdpau=yes ;;
920 --disable-vdpau) _vdpau=no ;;
921 --enable-sdl) _sdl=yes ;;
922 --disable-sdl) _sdl=no ;;
923 --enable-kva) _kva=yes ;;
924 --disable-kva) _kva=no ;;
925 --enable-direct3d) _direct3d=yes ;;
926 --disable-direct3d) _direct3d=no ;;
927 --enable-directx) _directx=yes ;;
928 --disable-directx) _directx=no ;;
929 --enable-win32waveout) _win32waveout=yes ;;
930 --disable-win32waveout) _win32waveout=no ;;
931 --enable-nas) _nas=yes ;;
932 --disable-nas) _nas=no ;;
933 --enable-png) _png=yes ;;
934 --disable-png) _png=no ;;
935 --enable-mng) _mng=yes ;;
936 --disable-mng) _mng=no ;;
937 --enable-jpeg) _jpeg=yes ;;
938 --disable-jpeg) _jpeg=no ;;
939 --enable-libopenjpeg) libopenjpeg=yes ;;
940 --disable-libopenjpeg)libopenjpeg=no ;;
941 --enable-pnm) _pnm=yes ;;
942 --disable-pnm) _pnm=no ;;
943 --enable-md5sum) _md5sum=yes ;;
944 --disable-md5sum) _md5sum=no ;;
945 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
946 --disable-yuv4mpeg) _yuv4mpeg=no ;;
947 --enable-gif) _gif=yes ;;
948 --disable-gif) _gif=no ;;
949 --enable-gl) _gl=yes ;;
950 --disable-gl) _gl=no ;;
951 --enable-matrixview) matrixview=yes ;;
952 --disable-matrixview) matrixview=no ;;
953 --enable-ggi) _ggi=yes ;;
954 --disable-ggi) _ggi=no ;;
955 --enable-ggiwmh) _ggiwmh=yes ;;
956 --disable-ggiwmh) _ggiwmh=no ;;
957 --enable-aa) _aa=yes ;;
958 --disable-aa) _aa=no ;;
959 --enable-caca) _caca=yes ;;
960 --disable-caca) _caca=no ;;
961 --enable-svga) _svga=yes ;;
962 --disable-svga) _svga=no ;;
963 --enable-vesa) _vesa=yes ;;
964 --disable-vesa) _vesa=no ;;
965 --enable-fbdev) _fbdev=yes ;;
966 --disable-fbdev) _fbdev=no ;;
967 --enable-dvb) _dvb=yes ;;
968 --disable-dvb) _dvb=no ;;
969 --enable-dxr2) _dxr2=yes ;;
970 --disable-dxr2) _dxr2=no ;;
971 --enable-dxr3) _dxr3=yes ;;
972 --disable-dxr3) _dxr3=no ;;
973 --enable-ivtv) _ivtv=yes ;;
974 --disable-ivtv) _ivtv=no ;;
975 --enable-v4l2) _v4l2=yes ;;
976 --disable-v4l2) _v4l2=no ;;
977 --enable-iconv) _iconv=yes ;;
978 --disable-iconv) _iconv=no ;;
979 --enable-langinfo) _langinfo=yes ;;
980 --disable-langinfo) _langinfo=no ;;
981 --enable-rtc) _rtc=yes ;;
982 --disable-rtc) _rtc=no ;;
983 --enable-libdv) _libdv=yes ;;
984 --disable-libdv) _libdv=no ;;
985 --enable-ossaudio) _ossaudio=yes ;;
986 --disable-ossaudio) _ossaudio=no ;;
987 --enable-arts) _arts=yes ;;
988 --disable-arts) _arts=no ;;
989 --enable-esd) _esd=yes ;;
990 --disable-esd) _esd=no ;;
991 --enable-pulse) _pulse=yes ;;
992 --disable-pulse) _pulse=no ;;
993 --enable-jack) _jack=yes ;;
994 --disable-jack) _jack=no ;;
995 --enable-openal) _openal=yes ;;
996 --disable-openal) _openal=no ;;
997 --enable-kai) _kai=yes ;;
998 --disable-kai) _kai=no ;;
999 --enable-dart) _dart=yes ;;
1000 --disable-dart) _dart=no ;;
1001 --enable-mad) _mad=yes ;;
1002 --disable-mad) _mad=no ;;
1003 --enable-mp3lame) _mp3lame=yes ;;
1004 --disable-mp3lame) _mp3lame=no ;;
1005 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
1006 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
1007 --enable-toolame) _toolame=yes ;;
1008 --disable-toolame) _toolame=no ;;
1009 --enable-twolame) _twolame=yes ;;
1010 --disable-twolame) _twolame=no ;;
1011 --enable-libcdio) _libcdio=yes ;;
1012 --disable-libcdio) _libcdio=no ;;
1013 --enable-liblzo) _liblzo=yes ;;
1014 --disable-liblzo) _liblzo=no ;;
1015 --enable-libvorbis) _libvorbis=yes ;;
1016 --disable-libvorbis) _libvorbis=no ;;
1017 --enable-speex) _speex=yes ;;
1018 --disable-speex) _speex=no ;;
1019 --enable-tremor) _tremor=yes ;;
1020 --disable-tremor) _tremor=no ;;
1021 --enable-tremor-internal) _tremor_internal=yes ;;
1022 --disable-tremor-internal) _tremor_internal=no ;;
1023 --enable-tremor-low) _tremor_low=yes ;;
1024 --disable-tremor-low) _tremor_low=no ;;
1025 --enable-theora) _theora=yes ;;
1026 --disable-theora) _theora=no ;;
1027 --enable-mp3lib) _mp3lib=yes ;;
1028 --disable-mp3lib) _mp3lib=no ;;
1029 --enable-liba52) _liba52=yes ;;
1030 --disable-liba52) _liba52=no ;;
1031 --enable-libdca) _libdca=yes ;;
1032 --disable-libdca) _libdca=no ;;
1033 --enable-libmpeg2) _libmpeg2=yes ;;
1034 --disable-libmpeg2) _libmpeg2=no ;;
1035 --enable-musepack) _musepack=yes ;;
1036 --disable-musepack) _musepack=no ;;
1037 --enable-faad) _faad=yes ;;
1038 --disable-faad) _faad=no ;;
1039 --enable-faad-internal) _faad_internal=yes ;;
1040 --disable-faad-internal) _faad_internal=no ;;
1041 --enable-faad-fixed) _faad_fixed=yes ;;
1042 --disable-faad-fixed) _faad_fixed=no ;;
1043 --enable-faac) _faac=yes ;;
1044 --disable-faac) _faac=no ;;
1045 --enable-faac-lavc) _faac_lavc=yes ;;
1046 --disable-faac-lavc) _faac_lavc=no ;;
1047 --enable-ladspa) _ladspa=yes ;;
1048 --disable-ladspa) _ladspa=no ;;
1049 --enable-libbs2b) _libbs2b=yes ;;
1050 --disable-libbs2b) _libbs2b=no ;;
1051 --enable-xmms) _xmms=yes ;;
1052 --disable-xmms) _xmms=no ;;
1053 --enable-vcd) _vcd=yes ;;
1054 --disable-vcd) _vcd=no ;;
1055 --enable-dvdread) _dvdread=yes ;;
1056 --disable-dvdread) _dvdread=no ;;
1057 --enable-dvdread-internal) _dvdread_internal=yes ;;
1058 --disable-dvdread-internal) _dvdread_internal=no ;;
1059 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1060 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1061 --enable-dvdnav) _dvdnav=yes ;;
1062 --disable-dvdnav) _dvdnav=no ;;
1063 --enable-xanim) _xanim=yes ;;
1064 --disable-xanim) _xanim=no ;;
1065 --enable-real) _real=yes ;;
1066 --disable-real) _real=no ;;
1067 --enable-live) _live=yes ;;
1068 --disable-live) _live=no ;;
1069 --enable-nemesi) _nemesi=yes ;;
1070 --disable-nemesi) _nemesi=no ;;
1071 --enable-xinerama) _xinerama=yes ;;
1072 --disable-xinerama) _xinerama=no ;;
1073 --enable-mga) _mga=yes ;;
1074 --disable-mga) _mga=no ;;
1075 --enable-xmga) _xmga=yes ;;
1076 --disable-xmga) _xmga=no ;;
1077 --enable-vm) _vm=yes ;;
1078 --disable-vm) _vm=no ;;
1079 --enable-xf86keysym) _xf86keysym=yes ;;
1080 --disable-xf86keysym) _xf86keysym=no ;;
1081 --enable-mlib) _mlib=yes ;;
1082 --disable-mlib) _mlib=no ;;
1083 --enable-sunaudio) _sunaudio=yes ;;
1084 --disable-sunaudio) _sunaudio=no ;;
1085 --enable-sgiaudio) _sgiaudio=yes ;;
1086 --disable-sgiaudio) _sgiaudio=no ;;
1087 --enable-alsa) _alsa=yes ;;
1088 --disable-alsa) _alsa=no ;;
1089 --enable-tv) _tv=yes ;;
1090 --disable-tv) _tv=no ;;
1091 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1092 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1093 --enable-tv-v4l1) _tv_v4l1=yes ;;
1094 --disable-tv-v4l1) _tv_v4l1=no ;;
1095 --enable-tv-v4l2) _tv_v4l2=yes ;;
1096 --disable-tv-v4l2) _tv_v4l2=no ;;
1097 --enable-tv-dshow) _tv_dshow=yes ;;
1098 --disable-tv-dshow) _tv_dshow=no ;;
1099 --enable-radio) _radio=yes ;;
1100 --enable-radio-capture) _radio_capture=yes ;;
1101 --disable-radio-capture) _radio_capture=no ;;
1102 --disable-radio) _radio=no ;;
1103 --enable-radio-v4l) _radio_v4l=yes ;;
1104 --disable-radio-v4l) _radio_v4l=no ;;
1105 --enable-radio-v4l2) _radio_v4l2=yes ;;
1106 --disable-radio-v4l2) _radio_v4l2=no ;;
1107 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1108 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1109 --enable-pvr) _pvr=yes ;;
1110 --disable-pvr) _pvr=no ;;
1111 --enable-fastmemcpy) _fastmemcpy=yes ;;
1112 --disable-fastmemcpy) _fastmemcpy=no ;;
1113 --enable-hardcoded-tables) hardcoded_tables=yes ;;
1114 --disable-hardcoded-tables) hardcoded_tables=no ;;
1115 --enable-network) _network=yes ;;
1116 --disable-network) _network=no ;;
1117 --enable-winsock2_h) _winsock2_h=yes ;;
1118 --disable-winsock2_h) _winsock2_h=no ;;
1119 --enable-smb) _smb=yes ;;
1120 --disable-smb) _smb=no ;;
1121 --enable-vidix) _vidix=yes ;;
1122 --disable-vidix) _vidix=no ;;
1123 --with-vidix-drivers=*)
1124 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1126 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1127 --enable-dhahelper) _dhahelper=yes ;;
1128 --disable-dhahelper) _dhahelper=no ;;
1129 --enable-svgalib_helper) _svgalib_helper=yes ;;
1130 --disable-svgalib_helper) _svgalib_helper=no ;;
1131 --enable-joystick) _joystick=yes ;;
1132 --disable-joystick) _joystick=no ;;
1133 --enable-xvid) _xvid=yes ;;
1134 --disable-xvid) _xvid=no ;;
1135 --enable-xvid-lavc) _xvid_lavc=yes ;;
1136 --disable-xvid-lavc) _xvid_lavc=no ;;
1137 --enable-x264) _x264=yes ;;
1138 --disable-x264) _x264=no ;;
1139 --enable-x264-lavc) _x264_lavc=yes ;;
1140 --disable-x264-lavc) _x264_lavc=no ;;
1141 --enable-libdirac-lavc) _libdirac_lavc=yes ;;
1142 --disable-libdirac-lavc) _libdirac_lavc=no ;;
1143 --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
1144 --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
1145 --enable-libnut) _libnut=yes ;;
1146 --disable-libnut) _libnut=no ;;
1147 --enable-libavutil_a) _libavutil_a=yes ;;
1148 --disable-libavutil_a) _libavutil_a=no ;;
1149 --enable-libavutil_so) _libavutil_so=yes ;;
1150 --disable-libavutil_so) _libavutil_so=no ;;
1151 --enable-libavcodec_a) _libavcodec_a=yes ;;
1152 --disable-libavcodec_a) _libavcodec_a=no ;;
1153 --enable-libavcodec_so) _libavcodec_so=yes ;;
1154 --disable-libavcodec_so) _libavcodec_so=no ;;
1155 --enable-libopencore_amrnb) _libopencore_amrnb=yes ;;
1156 --disable-libopencore_amrnb) _libopencore_amrnb=no ;;
1157 --enable-libopencore_amrwb) _libopencore_amrwb=yes ;;
1158 --disable-libopencore_amrwb) _libopencore_amrwb=no ;;
1159 --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1160 --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1161 --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1162 --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1163 --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1164 --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1165 --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1166 --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1167 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1168 --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1169 --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1170 --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1171 --enable-libavformat_a) _libavformat_a=yes ;;
1172 --disable-libavformat_a) _libavformat_a=no ;;
1173 --enable-libavformat_so) _libavformat_so=yes ;;
1174 --disable-libavformat_so) _libavformat_so=no ;;
1175 --enable-libpostproc_a) _libpostproc_a=yes ;;
1176 --disable-libpostproc_a) _libpostproc_a=no ;;
1177 --enable-libpostproc_so) _libpostproc_so=yes ;;
1178 --disable-libpostproc_so) _libpostproc_so=no ;;
1179 --enable-libswscale_a) _libswscale_a=yes ;;
1180 --disable-libswscale_a) _libswscale_a=no ;;
1181 --enable-libswscale_so) _libswscale_so=yes ;;
1182 --disable-libswscale_so) _libswscale_so=no ;;
1183 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1184 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1186 --enable-lirc) _lirc=yes ;;
1187 --disable-lirc) _lirc=no ;;
1188 --enable-lircc) _lircc=yes ;;
1189 --disable-lircc) _lircc=no ;;
1190 --enable-apple-remote) _apple_remote=yes ;;
1191 --disable-apple-remote) _apple_remote=no ;;
1192 --enable-apple-ir) _apple_ir=yes ;;
1193 --disable-apple-ir) _apple_ir=no ;;
1194 --enable-gui) _gui=yes ;;
1195 --disable-gui) _gui=no ;;
1196 --enable-gtk1) _gtk1=yes ;;
1197 --disable-gtk1) _gtk1=no ;;
1198 --enable-termcap) _termcap=yes ;;
1199 --disable-termcap) _termcap=no ;;
1200 --enable-termios) _termios=yes ;;
1201 --disable-termios) _termios=no ;;
1202 --enable-3dfx) _3dfx=yes ;;
1203 --disable-3dfx) _3dfx=no ;;
1204 --enable-s3fb) _s3fb=yes ;;
1205 --disable-s3fb) _s3fb=no ;;
1206 --enable-wii) _wii=yes ;;
1207 --disable-wii) _wii=no ;;
1208 --enable-tdfxfb) _tdfxfb=yes ;;
1209 --disable-tdfxfb) _tdfxfb=no ;;
1210 --disable-tdfxvid) _tdfxvid=no ;;
1211 --enable-tdfxvid) _tdfxvid=yes ;;
1212 --disable-xvr100) _xvr100=no ;;
1213 --enable-xvr100) _xvr100=yes ;;
1214 --disable-tga) _tga=no ;;
1215 --enable-tga) _tga=yes ;;
1216 --enable-directfb) _directfb=yes ;;
1217 --disable-directfb) _directfb=no ;;
1218 --enable-zr) _zr=yes ;;
1219 --disable-zr) _zr=no ;;
1220 --enable-bl) _bl=yes ;;
1221 --disable-bl) _bl=no ;;
1222 --enable-mtrr) _mtrr=yes ;;
1223 --disable-mtrr) _mtrr=no ;;
1224 --enable-largefiles) _largefiles=yes ;;
1225 --disable-largefiles) _largefiles=no ;;
1226 --enable-shm) _shm=yes ;;
1227 --disable-shm) _shm=no ;;
1228 --enable-select) _select=yes ;;
1229 --disable-select) _select=no ;;
1230 --enable-linux-devfs) _linux_devfs=yes ;;
1231 --disable-linux-devfs) _linux_devfs=no ;;
1232 --enable-cdparanoia) _cdparanoia=yes ;;
1233 --disable-cdparanoia) _cdparanoia=no ;;
1234 --enable-cddb) _cddb=yes ;;
1235 --disable-cddb) _cddb=no ;;
1236 --enable-big-endian) _big_endian=yes ;;
1237 --disable-big-endian) _big_endian=no ;;
1238 --enable-bitmap-font) _bitmap_font=yes ;;
1239 --disable-bitmap-font) _bitmap_font=no ;;
1240 --enable-freetype) _freetype=yes ;;
1241 --disable-freetype) _freetype=no ;;
1242 --enable-fontconfig) _fontconfig=yes ;;
1243 --disable-fontconfig) _fontconfig=no ;;
1244 --enable-unrarexec) _unrar_exec=yes ;;
1245 --disable-unrarexec) _unrar_exec=no ;;
1246 --enable-ftp) _ftp=yes ;;
1247 --disable-ftp) _ftp=no ;;
1248 --enable-vstream) _vstream=yes ;;
1249 --disable-vstream) _vstream=no ;;
1250 --enable-pthreads) _pthreads=yes ;;
1251 --disable-pthreads) _pthreads=no ;;
1252 --enable-w32threads) _w32threads=yes ;;
1253 --disable-w32threads) _w32threads=no ;;
1254 --enable-ass) _ass=yes ;;
1255 --disable-ass) _ass=no ;;
1256 --enable-ass-internal) ass_internal=yes ;;
1257 --disable-ass-internal) ass_internal=no ;;
1258 --enable-rpath) _rpath=yes ;;
1259 --disable-rpath) _rpath=no ;;
1261 --enable-fribidi) _fribidi=yes ;;
1262 --disable-fribidi) _fribidi=no ;;
1264 --enable-enca) _enca=yes ;;
1265 --disable-enca) _enca=no ;;
1267 --enable-inet6) _inet6=yes ;;
1268 --disable-inet6) _inet6=no ;;
1270 --enable-gethostbyname2) _gethostbyname2=yes ;;
1271 --disable-gethostbyname2) _gethostbyname2=no ;;
1273 --enable-dga1) _dga1=yes ;;
1274 --disable-dga1) _dga1=no ;;
1275 --enable-dga2) _dga2=yes ;;
1276 --disable-dga2) _dga2=no ;;
1278 --enable-menu) _menu=yes ;;
1279 --disable-menu) _menu=no ;;
1281 --enable-qtx) _qtx=yes ;;
1282 --disable-qtx) _qtx=no ;;
1284 --enable-coreaudio) _coreaudio=yes ;;
1285 --disable-coreaudio) _coreaudio=no ;;
1286 --enable-corevideo) _corevideo=yes ;;
1287 --disable-corevideo) _corevideo=no ;;
1288 --enable-quartz) _quartz=yes ;;
1289 --disable-quartz) _quartz=no ;;
1290 --enable-macosx-finder) _macosx_finder=yes ;;
1291 --disable-macosx-finder) _macosx_finder=no ;;
1292 --enable-macosx-bundle) _macosx_bundle=yes ;;
1293 --disable-macosx-bundle) _macosx_bundle=no ;;
1295 --enable-maemo) _maemo=yes ;;
1296 --disable-maemo) _maemo=no ;;
1298 --enable-sortsub) _sortsub=yes ;;
1299 --disable-sortsub) _sortsub=no ;;
1301 --enable-crash-debug) _crash_debug=yes ;;
1302 --disable-crash-debug) _crash_debug=no ;;
1303 --enable-sighandler) _sighandler=yes ;;
1304 --disable-sighandler) _sighandler=no ;;
1305 --enable-win32dll) _win32dll=yes ;;
1306 --disable-win32dll) _win32dll=no ;;
1308 --enable-sse) _sse=yes ;;
1309 --disable-sse) _sse=no ;;
1310 --enable-sse2) _sse2=yes ;;
1311 --disable-sse2) _sse2=no ;;
1312 --enable-ssse3) _ssse3=yes ;;
1313 --disable-ssse3) _ssse3=no ;;
1314 --enable-mmxext) _mmxext=yes ;;
1315 --disable-mmxext) _mmxext=no ;;
1316 --enable-3dnow) _3dnow=yes ;;
1317 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1318 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1319 --disable-3dnowext) _3dnowext=no ;;
1320 --enable-cmov) _cmov=yes ;;
1321 --disable-cmov) _cmov=no ;;
1322 --enable-fast-cmov) _fast_cmov=yes ;;
1323 --disable-fast-cmov) _fast_cmov=no ;;
1324 --enable-fast-clz) _fast_clz=yes ;;
1325 --disable-fast-clz) _fast_clz=no ;;
1326 --enable-altivec) _altivec=yes ;;
1327 --disable-altivec) _altivec=no ;;
1328 --enable-armv5te) _armv5te=yes ;;
1329 --disable-armv5te) _armv5te=no ;;
1330 --enable-armv6) _armv6=yes ;;
1331 --disable-armv6) _armv6=no ;;
1332 --enable-armv6t2) _armv6t2=yes ;;
1333 --disable-armv6t2) _armv6t2=no ;;
1334 --enable-armvfp) _armvfp=yes ;;
1335 --disable-armvfp) _armvfp=no ;;
1336 --enable-neon) neon=yes ;;
1337 --disable-neon) neon=no ;;
1338 --enable-iwmmxt) _iwmmxt=yes ;;
1339 --disable-iwmmxt) _iwmmxt=no ;;
1340 --enable-mmx) _mmx=yes ;;
1341 --disable-mmx) # 3Dnow! and MMX2 require MMX
1342 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1345 echo "Unknown parameter: $ac_option"
1346 exit 1
1349 esac
1350 done
1352 # Atmos: moved this here, to be correct, if --prefix is specified
1353 test -z "$_bindir" && _bindir="$_prefix/bin"
1354 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1355 test -z "$_mandir" && _mandir="$_prefix/share/man"
1356 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1357 test -z "$_libdir" && _libdir="$_prefix/lib"
1359 # Determine our OS name and CPU architecture
1360 if test -z "$_target" ; then
1361 # OS name
1362 system_name=$(uname -s 2>&1)
1363 case "$system_name" in
1364 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1366 Haiku)
1367 system_name=BeOS
1369 IRIX*)
1370 system_name=IRIX
1372 GNU/kFreeBSD)
1373 system_name=FreeBSD
1375 HP-UX*)
1376 system_name=HP-UX
1378 [cC][yY][gG][wW][iI][nN]*)
1379 system_name=CYGWIN
1381 MINGW32*)
1382 system_name=MINGW32
1384 OS/2*)
1385 system_name=OS/2
1388 system_name="$system_name-UNKNOWN"
1390 esac
1393 # host's CPU/instruction set
1394 host_arch=$(uname -p 2>&1)
1395 case "$host_arch" in
1396 i386|sparc|ppc|alpha|arm|mips|vax)
1398 powerpc) # Darwin returns 'powerpc'
1399 host_arch=ppc
1401 *) # uname -p on Linux returns 'unknown' for the processor type,
1402 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1404 # Maybe uname -m (machine hardware name) returns something we
1405 # recognize.
1407 # x86/x86pc is used by QNX
1408 case "$(uname -m 2>&1)" in
1409 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 ;;
1410 ia64) host_arch=ia64 ;;
1411 macppc|ppc) host_arch=ppc ;;
1412 ppc64) host_arch=ppc64 ;;
1413 alpha) host_arch=alpha ;;
1414 sparc) host_arch=sparc ;;
1415 sparc64) host_arch=sparc64 ;;
1416 parisc*|hppa*|9000*) host_arch=hppa ;;
1417 arm*|zaurus|cats) host_arch=arm ;;
1418 sh3|sh4|sh4a) host_arch=sh ;;
1419 s390) host_arch=s390 ;;
1420 s390x) host_arch=s390x ;;
1421 *mips*) host_arch=mips ;;
1422 vax) host_arch=vax ;;
1423 xtensa*) host_arch=xtensa ;;
1424 *) host_arch=UNKNOWN ;;
1425 esac
1427 esac
1428 else # if test -z "$_target"
1429 system_name=$(echo $_target | cut -d '-' -f 2)
1430 case "$(echo $system_name | tr A-Z a-z)" in
1431 linux) system_name=Linux ;;
1432 freebsd) system_name=FreeBSD ;;
1433 gnu/kfreebsd) system_name=FreeBSD ;;
1434 netbsd) system_name=NetBSD ;;
1435 bsd/os) system_name=BSD/OS ;;
1436 openbsd) system_name=OpenBSD ;;
1437 dragonfly) system_name=DragonFly ;;
1438 sunos) system_name=SunOS ;;
1439 qnx) system_name=QNX ;;
1440 morphos) system_name=MorphOS ;;
1441 amigaos) system_name=AmigaOS ;;
1442 mingw32*) system_name=MINGW32 ;;
1443 esac
1444 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1445 host_arch=$(echo $_target | cut -d '-' -f 1)
1446 if test $(echo $host_arch) != "x86_64" ; then
1447 host_arch=$(echo $host_arch | tr '_' '-')
1451 extra_cflags="-I. $extra_cflags"
1452 _timer=timer-linux.c
1453 _getch=getch2.c
1454 if freebsd ; then
1455 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1456 extra_cflags="$extra_cflags -I/usr/local/include"
1459 if netbsd || dragonfly ; then
1460 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1461 extra_cflags="$extra_cflags -I/usr/pkg/include"
1464 if darwin; then
1465 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1466 _timer=timer-darwin.c
1469 if aix ; then
1470 extra_ldflags="$extra_ldflags -lC"
1473 if irix ; then
1474 _ranlib='ar -r'
1475 elif linux ; then
1476 _ranlib='true'
1479 if win32 ; then
1480 _exesuf=".exe"
1481 extra_cflags="$extra_cflags -fno-common"
1482 # -lwinmm is always needed for osdep/timer-win2.c
1483 extra_ldflags="$extra_ldflags -lwinmm"
1484 _pe_executable=yes
1485 _timer=timer-win2.c
1486 _priority=yes
1487 def_dos_paths="#define HAVE_DOS_PATHS 1"
1488 def_priority="#define CONFIG_PRIORITY 1"
1491 if mingw32 ; then
1492 _getch=getch2-win.c
1493 _need_shmem=no
1496 if amigaos ; then
1497 _select=no
1498 _sighandler=no
1499 _stream_cache=no
1500 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1501 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1504 if qnx ; then
1505 extra_ldflags="$extra_ldflags -lph"
1508 if os2 ; then
1509 _exesuf=".exe"
1510 _getch=getch2-os2.c
1511 _need_shmem=no
1512 _priority=yes
1513 def_dos_paths="#define HAVE_DOS_PATHS 1"
1514 def_priority="#define CONFIG_PRIORITY 1"
1517 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1518 test "$I" && break
1519 done
1522 TMPLOG="configure.log"
1523 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1524 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1525 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1526 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1527 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1529 rm -f "$TMPLOG"
1530 echo configuration: $_configuration > "$TMPLOG"
1531 echo >> "$TMPLOG"
1534 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1535 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1539 # Checking CC version...
1540 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1541 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1542 echocheck "$_cc version"
1543 cc_vendor=intel
1544 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1545 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1546 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1547 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1548 # TODO verify older icc/ecc compatibility
1549 case $cc_version in
1551 cc_version="v. ?.??, bad"
1552 cc_fail=yes
1554 10.1|11.0|11.1)
1555 cc_version="$cc_version, ok"
1558 cc_version="$cc_version, bad"
1559 cc_fail=yes
1561 esac
1562 echores "$cc_version"
1563 else
1564 for _cc in "$_cc" gcc cc ; do
1565 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1566 if test "$cc_name_tmp" = "gcc"; then
1567 cc_name=$cc_name_tmp
1568 echocheck "$_cc version"
1569 cc_vendor=gnu
1570 cc_version=$($_cc -dumpversion 2>&1)
1571 case $cc_version in
1572 2.96*)
1573 cc_fail=yes
1576 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1577 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1578 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1580 esac
1581 echores "$cc_version"
1582 break
1584 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1585 if test "$cc_name_tmp" = "Sun C"; then
1586 echocheck "$_cc version"
1587 cc_vendor=sun
1588 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1589 res_comment="experimental support only"
1590 echores "Sun C $cc_version"
1591 break
1593 done
1594 fi # icc
1595 test "$cc_fail" = yes && die "unsupported compiler version"
1597 if test -z "$_target" && x86 ; then
1598 cat > $TMPC << EOF
1599 int main(void) {
1600 int test[(int)sizeof(char *)-7];
1601 return 0;
1604 cc_check && host_arch=x86_64 || host_arch=i386
1607 echo "Detected operating system: $system_name"
1608 echo "Detected host architecture: $host_arch"
1610 echocheck "host cc"
1611 test "$_host_cc" || _host_cc=$_cc
1612 echores $_host_cc
1614 echocheck "cross compilation"
1615 if test $_cross_compile = auto ; then
1616 cat > $TMPC << EOF
1617 int main(void) { return 0; }
1619 _cross_compile=yes
1620 cc_check && "$TMPEXE" && _cross_compile=no
1622 echores $_cross_compile
1624 if test $_cross_compile = yes; then
1625 tmp_run() {
1626 return 0
1630 # ---
1632 # now that we know what compiler should be used for compilation, try to find
1633 # out which assembler is used by the $_cc compiler
1634 if test "$_as" = auto ; then
1635 _as=$($_cc -print-prog-name=as)
1636 test -z "$_as" && _as=as
1639 if test "$_nm" = auto ; then
1640 _nm=$($_cc -print-prog-name=nm)
1641 test -z "$_nm" && _nm=nm
1644 # XXX: this should be ok..
1645 _cpuinfo="echo"
1647 if test "$_runtime_cpudetection" = no ; then
1649 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1650 # FIXME: Remove the cygwin check once AMD CPUs are supported
1651 if test -r /proc/cpuinfo && ! cygwin; then
1652 # Linux with /proc mounted, extract CPU information from it
1653 _cpuinfo="cat /proc/cpuinfo"
1654 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1655 # FreeBSD with Linux emulation /proc mounted,
1656 # extract CPU information from it
1657 # Don't use it on x86 though, it never reports 3Dnow
1658 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1659 elif darwin && ! x86 ; then
1660 # use hostinfo on Darwin
1661 _cpuinfo="hostinfo"
1662 elif aix; then
1663 # use 'lsattr' on AIX
1664 _cpuinfo="lsattr -E -l proc0 -a type"
1665 elif x86; then
1666 # all other OSes try to extract CPU information from a small helper
1667 # program cpuinfo instead
1668 $_cc -o cpuinfo$_exesuf cpuinfo.c
1669 _cpuinfo="./cpuinfo$_exesuf"
1672 if [ "$cc_vendor" = "gnu" ] && [ "$_cc_major" = 2 ] ; then
1673 test $_sse = auto && _sse=no
1674 test $_win32dll = auto && _win32dll=no
1675 ass_internal=no
1678 if x86 ; then
1679 # gather more CPU information
1680 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1681 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1682 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1683 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1684 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1686 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1688 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1689 -e s/xmm/sse/ -e s/kni/sse/)
1691 for ext in $pparam ; do
1692 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1693 done
1695 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1696 test $_sse = kernel_check && _mmxext=kernel_check
1698 echocheck "CPU vendor"
1699 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1701 echocheck "CPU type"
1702 echores "$pname"
1705 fi # test "$_runtime_cpudetection" = no
1707 if x86 && test "$_runtime_cpudetection" = no ; then
1708 extcheck() {
1709 if test "$1" = kernel_check ; then
1710 echocheck "kernel support of $2"
1711 cat > $TMPC <<EOF
1712 #include <stdlib.h>
1713 #include <signal.h>
1714 void catch() { exit(1); }
1715 int main(void) {
1716 signal(SIGILL, catch);
1717 __asm__ volatile ("$3":::"memory"); return 0;
1721 if cc_check && tmp_run ; then
1722 eval _$2=yes
1723 echores "yes"
1724 _optimizing="$_optimizing $2"
1725 return 0
1726 else
1727 eval _$2=no
1728 echores "failed"
1729 echo "It seems that your kernel does not correctly support $2."
1730 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1731 return 1
1734 return 0
1737 extcheck $_mmx "mmx" "emms"
1738 extcheck $_mmxext "mmxext" "sfence"
1739 extcheck $_3dnow "3dnow" "femms"
1740 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1741 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1742 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1743 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1744 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1746 echocheck "mtrr support"
1747 if test "$_mtrr" = kernel_check ; then
1748 _mtrr="yes"
1749 _optimizing="$_optimizing mtrr"
1751 echores "$_mtrr"
1753 if test "$_gcc3_ext" != ""; then
1754 # if we had to disable sse/sse2 because the active kernel does not
1755 # support this instruction set extension, we also have to tell
1756 # gcc3 to not generate sse/sse2 instructions for normal C code
1757 cat > $TMPC << EOF
1758 int main(void) { return 0; }
1760 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1766 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1767 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1768 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0'
1769 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 0'
1770 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1771 subarch_all='X86_32 X86_64 PPC64'
1772 case "$host_arch" in
1773 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1774 arch='x86'
1775 subarch='x86_32'
1776 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1777 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
1778 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 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=amdfam10 iproc=686
1822 test $_fast_clz = "auto" && _fast_clz=yes
1824 esac
1826 GenuineIntel)
1827 case "$pfamily" in
1828 3) proc=i386 iproc=386 ;;
1829 4) proc=i486 iproc=486 ;;
1830 5) iproc=586
1831 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1832 proc=pentium-mmx # 4 is desktop, 8 is mobile
1833 else
1834 proc=i586
1837 6) iproc=686
1838 if test "$pmodel" -ge 15; then
1839 proc=core2
1840 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1841 proc=pentium-m
1842 elif test "$pmodel" -ge 7; then
1843 proc=pentium3
1844 elif test "$pmodel" -ge 3; then
1845 proc=pentium2
1846 else
1847 proc=i686
1849 test $_fast_clz = "auto" && _fast_clz=yes
1851 15) iproc=686
1852 # A nocona in 32-bit mode has no more capabilities than a prescott.
1853 if test "$pmodel" -ge 3; then
1854 proc=prescott
1855 else
1856 proc=pentium4
1857 test $_fast_clz = "auto" && _fast_clz=yes
1859 test $_fast_cmov = "auto" && _fast_cmov=no
1861 *) proc=prescott iproc=686 ;;
1862 esac
1864 CentaurHauls)
1865 case "$pfamily" in
1866 5) iproc=586
1867 if test "$pmodel" -ge 8; then
1868 proc=winchip2
1869 elif test "$pmodel" -ge 4; then
1870 proc=winchip-c6
1871 else
1872 proc=i586
1875 6) iproc=686
1876 if test "$pmodel" -ge 9; then
1877 proc=c3-2
1878 else
1879 proc=c3
1880 iproc=586
1883 *) proc=i686 iproc=i686 ;;
1884 esac
1886 unknown)
1887 case "$pfamily" in
1888 3) proc=i386 iproc=386 ;;
1889 4) proc=i486 iproc=486 ;;
1890 *) proc=i586 iproc=586 ;;
1891 esac
1894 proc=i586 iproc=586 ;;
1895 esac
1896 test $_fast_clz = "auto" && _fast_clz=no
1897 fi # test "$_runtime_cpudetection" = no
1900 # check that gcc supports our CPU, if not, fall back to earlier ones
1901 # LGB: check -mcpu and -march swithing step by step with enabling
1902 # to fall back till 386.
1904 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1906 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1907 cpuopt=-mtune
1908 else
1909 cpuopt=-mcpu
1912 echocheck "GCC & CPU optimization abilities"
1913 cat > $TMPC << EOF
1914 int main(void) { return 0; }
1916 if test "$_runtime_cpudetection" = no ; then
1917 if test $cc_vendor != "intel" ; then
1918 cc_check -march=native && proc=native
1920 if test "$proc" = "k8"; then
1921 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1923 if test "$proc" = "athlon-xp"; then
1924 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1926 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1927 cc_check -march=$proc $cpuopt=$proc || proc=k6
1929 if test "$proc" = "k6" || test "$proc" = "c3"; then
1930 if ! cc_check -march=$proc $cpuopt=$proc; then
1931 if cc_check -march=i586 $cpuopt=i686; then
1932 proc=i586-i686
1933 else
1934 proc=i586
1938 if test "$proc" = "prescott" ; then
1939 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1941 if test "$proc" = "core2" ; then
1942 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1944 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
1945 cc_check -march=$proc $cpuopt=$proc || proc=i686
1947 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1948 cc_check -march=$proc $cpuopt=$proc || proc=i586
1950 if test "$proc" = "i586"; then
1951 cc_check -march=$proc $cpuopt=$proc || proc=i486
1953 if test "$proc" = "i486" ; then
1954 cc_check -march=$proc $cpuopt=$proc || proc=i386
1956 if test "$proc" = "i386" ; then
1957 cc_check -march=$proc $cpuopt=$proc || proc=error
1959 if test "$proc" = "error" ; then
1960 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1961 _mcpu=""
1962 _march=""
1963 _optimizing=""
1964 elif test "$proc" = "i586-i686"; then
1965 _march="-march=i586"
1966 _mcpu="$cpuopt=i686"
1967 _optimizing="$proc"
1968 else
1969 _march="-march=$proc"
1970 _mcpu="$cpuopt=$proc"
1971 _optimizing="$proc"
1973 else # if test "$_runtime_cpudetection" = no
1974 _mcpu="$cpuopt=generic"
1975 # at least i486 required, for bswap instruction
1976 _march="-march=i486"
1977 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1978 cc_check $_mcpu || _mcpu=""
1979 cc_check $_march $_mcpu || _march=""
1982 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1983 ## autodetected mcpu/march parameters
1984 if test "$_target" ; then
1985 # TODO: it may be a good idea to check GCC and fall back in all cases
1986 if test "$host_arch" = "i586-i686"; then
1987 _march="-march=i586"
1988 _mcpu="$cpuopt=i686"
1989 else
1990 _march="-march=$host_arch"
1991 _mcpu="$cpuopt=$host_arch"
1994 proc="$host_arch"
1996 case "$proc" in
1997 i386) iproc=386 ;;
1998 i486) iproc=486 ;;
1999 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
2000 i686|athlon*|pentium*) iproc=686 ;;
2001 *) iproc=586 ;;
2002 esac
2005 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
2006 _fast_cmov="yes"
2007 else
2008 _fast_cmov="no"
2010 test $_fast_clz = "auto" && _fast_clz=yes
2012 echores "$proc"
2015 ia64)
2016 arch='ia64'
2017 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2018 iproc='ia64'
2021 x86_64|amd64)
2022 arch='x86'
2023 subarch='x86_64'
2024 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2025 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2026 iproc='x86_64'
2028 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2029 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
2030 cpuopt=-mtune
2031 else
2032 cpuopt=-mcpu
2034 if test "$_runtime_cpudetection" = no ; then
2035 case "$pvendor" in
2036 AuthenticAMD)
2037 case "$pfamily" in
2038 15) proc=k8
2039 test $_fast_clz = "auto" && _fast_clz=no
2041 *) proc=amdfam10;;
2042 esac
2044 GenuineIntel)
2045 case "$pfamily" in
2046 6) proc=core2;;
2048 # 64-bit prescotts exist, but as far as GCC is concerned they
2049 # have the same capabilities as a nocona.
2050 proc=nocona
2051 test $_fast_cmov = "auto" && _fast_cmov=no
2052 test $_fast_clz = "auto" && _fast_clz=no
2054 esac
2057 proc=error;;
2058 esac
2059 fi # test "$_runtime_cpudetection" = no
2061 echocheck "GCC & CPU optimization abilities"
2062 cat > $TMPC << EOF
2063 int main(void) { return 0; }
2065 # This is a stripped-down version of the i386 fallback.
2066 if test "$_runtime_cpudetection" = no ; then
2067 if test $cc_vendor != "intel" ; then
2068 cc_check -march=native && proc=native
2070 # --- AMD processors ---
2071 if test "$proc" = "k8"; then
2072 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2074 # This will fail if gcc version < 3.3, which is ok because earlier
2075 # versions don't really support 64-bit on amd64.
2076 # Is this a valid assumption? -Corey
2077 if test "$proc" = "athlon-xp"; then
2078 cc_check -march=$proc $cpuopt=$proc || proc=error
2080 # --- Intel processors ---
2081 if test "$proc" = "core2"; then
2082 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
2084 if test "$proc" = "x86-64"; then
2085 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2087 if test "$proc" = "nocona"; then
2088 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2090 if test "$proc" = "pentium4"; then
2091 cc_check -march=$proc $cpuopt=$proc || proc=error
2094 _march="-march=$proc"
2095 _mcpu="$cpuopt=$proc"
2096 if test "$proc" = "error" ; then
2097 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2098 _mcpu=""
2099 _march=""
2101 else # if test "$_runtime_cpudetection" = no
2102 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2103 _march="-march=x86-64"
2104 _mcpu="$cpuopt=generic"
2105 cc_check $_mcpu || _mcpu="x86-64"
2106 cc_check $_mcpu || _mcpu=""
2107 cc_check $_march $_mcpu || _march=""
2110 _optimizing="$proc"
2111 test $_fast_cmov = "auto" && _fast_cmov=yes
2112 test $_fast_clz = "auto" && _fast_clz=yes
2114 echores "$proc"
2117 sparc|sparc64)
2118 arch='sparc'
2119 iproc='sparc'
2120 if test "$host_arch" = "sparc64" ; then
2121 _vis='yes'
2122 proc='ultrasparc'
2123 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2124 elif sunos ; then
2125 echocheck "CPU type"
2126 karch=$(uname -m)
2127 case "$(echo $karch)" in
2128 sun4) proc=v7 ;;
2129 sun4c) proc=v7 ;;
2130 sun4d) proc=v8 ;;
2131 sun4m) proc=v8 ;;
2132 sun4u) proc=ultrasparc _vis='yes' ;;
2133 sun4v) proc=v9 ;;
2134 *) proc=v8 ;;
2135 esac
2136 echores "$proc"
2137 else
2138 proc=v8
2140 _mcpu="-mcpu=$proc"
2141 _optimizing="$proc"
2144 arm*)
2145 arch='arm'
2146 iproc='arm'
2149 avr32)
2150 arch='avr32'
2151 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2152 iproc='avr32'
2153 test $_fast_clz = "auto" && _fast_clz=yes
2156 sh|sh4)
2157 arch='sh4'
2158 iproc='sh4'
2161 ppc|ppc64|powerpc|powerpc64)
2162 arch='ppc'
2163 def_dcbzl='#define HAVE_DCBZL 0'
2164 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2165 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
2166 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
2167 iproc='ppc'
2169 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2170 subarch='ppc64'
2171 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2173 echocheck "CPU type"
2174 case $system_name in
2175 Linux)
2176 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2177 if test -n "$($_cpuinfo | grep altivec)"; then
2178 test $_altivec = auto && _altivec=yes
2181 Darwin)
2182 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2183 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2184 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2185 test $_altivec = auto && _altivec=yes
2188 NetBSD)
2189 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2190 case $cc_version in
2191 2*|3.0*|3.1*|3.2*|3.3*)
2194 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2195 test $_altivec = auto && _altivec=yes
2198 esac
2200 AIX)
2201 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2203 esac
2204 if test "$_altivec" = yes; then
2205 echores "$proc altivec"
2206 else
2207 _altivec=no
2208 echores "$proc"
2211 echocheck "GCC & CPU optimization abilities"
2213 if test -n "$proc"; then
2214 case "$proc" in
2215 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2216 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2217 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2218 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2219 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2220 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2221 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2222 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2223 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2224 *) ;;
2225 esac
2226 # gcc 3.1(.1) and up supports 7400 and 7450
2227 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2228 case "$proc" in
2229 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2230 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2231 *) ;;
2232 esac
2234 # gcc 3.2 and up supports 970
2235 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2236 case "$proc" in
2237 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2238 def_dcbzl='#define HAVE_DCBZL 1' ;;
2239 *) ;;
2240 esac
2242 # gcc 3.3 and up supports POWER4
2243 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2244 case "$proc" in
2245 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2246 *) ;;
2247 esac
2249 # gcc 3.4 and up supports 440*
2250 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2251 case "$proc" in
2252 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2253 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2254 *) ;;
2255 esac
2257 # gcc 4.0 and up supports POWER5
2258 if test "$_cc_major" -ge "4"; then
2259 case "$proc" in
2260 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2261 *) ;;
2262 esac
2266 if test -n "$_mcpu"; then
2267 _optimizing=$(echo $_mcpu | cut -c 8-)
2268 echores "$_optimizing"
2269 else
2270 echores "none"
2273 test $_fast_clz = "auto" && _fast_clz=yes
2277 alpha*)
2278 arch='alpha'
2279 iproc='alpha'
2281 echocheck "CPU type"
2282 cat > $TMPC << EOF
2283 int main(void) {
2284 unsigned long ver, mask;
2285 __asm__ ("implver %0" : "=r" (ver));
2286 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2287 printf("%ld-%x\n", ver, ~mask);
2288 return 0;
2291 $_cc -o "$TMPEXE" "$TMPC"
2292 case $("$TMPEXE") in
2294 0-0) proc="ev4"; _mvi="0";;
2295 1-0) proc="ev5"; _mvi="0";;
2296 1-1) proc="ev56"; _mvi="0";;
2297 1-101) proc="pca56"; _mvi="1";;
2298 2-303) proc="ev6"; _mvi="1";;
2299 2-307) proc="ev67"; _mvi="1";;
2300 2-1307) proc="ev68"; _mvi="1";;
2301 esac
2302 echores "$proc"
2304 echocheck "GCC & CPU optimization abilities"
2305 if test "$proc" = "ev68" ; then
2306 cc_check -mcpu=$proc || proc=ev67
2308 if test "$proc" = "ev67" ; then
2309 cc_check -mcpu=$proc || proc=ev6
2311 _mcpu="-mcpu=$proc"
2312 echores "$proc"
2314 test $_fast_clz = "auto" && _fast_clz=yes
2316 _optimizing="$proc"
2319 mips)
2320 arch='mips'
2321 iproc='mips'
2323 if irix ; then
2324 echocheck "CPU type"
2325 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2326 case "$(echo $proc)" in
2327 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2328 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2329 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2330 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2331 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2332 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2333 esac
2334 # gcc < 3.x does not support -mtune.
2335 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2336 _mcpu=''
2338 echores "$proc"
2341 test $_fast_clz = "auto" && _fast_clz=yes
2345 hppa)
2346 arch='pa_risc'
2347 iproc='PA-RISC'
2350 s390)
2351 arch='s390'
2352 iproc='390'
2355 s390x)
2356 arch='s390x'
2357 iproc='390x'
2360 vax)
2361 arch='vax'
2362 iproc='vax'
2365 xtensa)
2366 arch='xtensa'
2367 iproc='xtensa'
2370 generic)
2371 arch='generic'
2375 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2376 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2377 die "unsupported architecture $host_arch"
2379 esac # case "$host_arch" in
2381 if test "$_runtime_cpudetection" = yes ; then
2382 if x86 ; then
2383 test "$_cmov" != no && _cmov=yes
2384 x86_32 && _cmov=no
2385 test "$_mmx" != no && _mmx=yes
2386 test "$_3dnow" != no && _3dnow=yes
2387 test "$_3dnowext" != no && _3dnowext=yes
2388 test "$_mmxext" != no && _mmxext=yes
2389 test "$_sse" != no && _sse=yes
2390 test "$_sse2" != no && _sse2=yes
2391 test "$_ssse3" != no && _ssse3=yes
2392 test "$_mtrr" != no && _mtrr=yes
2394 if ppc; then
2395 _altivec=yes
2400 # endian testing
2401 echocheck "byte order"
2402 if test "$_big_endian" = auto ; then
2403 cat > $TMPC <<EOF
2404 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2405 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2406 int main(void) { return (int)ascii_name; }
2408 if cc_check ; then
2409 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2410 _big_endian=yes
2411 else
2412 _big_endian=no
2414 else
2415 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2418 if test "$_big_endian" = yes ; then
2419 _byte_order='big-endian'
2420 def_words_endian='#define WORDS_BIGENDIAN 1'
2421 def_bigendian='#define HAVE_BIGENDIAN 1'
2422 def_av_bigendian='#define AV_HAVE_BIGENDIAN 1'
2423 else
2424 _byte_order='little-endian'
2425 def_words_endian='#undef WORDS_BIGENDIAN'
2426 def_bigendian='#define HAVE_BIGENDIAN 0'
2427 def_av_bigendian='#define AV_HAVE_BIGENDIAN 0'
2429 echores "$_byte_order"
2432 echocheck "extern symbol prefix"
2433 cat > $TMPC << EOF
2434 int ff_extern;
2436 cc_check -c || die "Symbol mangling check failed."
2437 sym=$($_nm -P -g $TMPEXE)
2438 extern_prefix=${sym%%ff_extern*}
2439 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2440 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2441 echores $extern_prefix
2444 echocheck "assembler support of -pipe option"
2445 cat > $TMPC << EOF
2446 int main(void) { return 0; }
2448 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2449 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2452 echocheck "compiler support of named assembler arguments"
2453 _named_asm_args=yes
2454 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2455 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2456 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2457 _named_asm_args=no
2458 def_named_asm_args="#undef NAMED_ASM_ARGS"
2460 echores $_named_asm_args
2463 if darwin && test "$cc_vendor" = "gnu" ; then
2464 echocheck "GCC support of -mstackrealign"
2465 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2466 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2467 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2468 # wrong code with this flag, but this can be worked around by adding
2469 # -fno-unit-at-a-time as described in the blog post at
2470 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2471 cat > $TMPC << EOF
2472 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2473 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2475 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2476 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2477 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2478 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2479 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2482 # Checking for CFLAGS
2483 _install_strip="-s"
2484 if test "$_profile" != "" || test "$_debug" != "" ; then
2485 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2486 _install_strip=
2487 elif test -z "$CFLAGS" ; then
2488 if test "$cc_vendor" = "intel" ; then
2489 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2490 elif test "$cc_vendor" = "sun" ; then
2491 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2492 elif test "$cc_vendor" != "gnu" ; then
2493 CFLAGS="-O2 $_march $_mcpu $_pipe"
2494 else
2495 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2496 extra_ldflags="$extra_ldflags -ffast-math"
2498 else
2499 _warn_CFLAGS=yes
2502 cat > $TMPC << EOF
2503 int main(void) { return 0; }
2505 if test "$cc_vendor" = "gnu" ; then
2506 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2507 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
2508 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2509 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2510 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2511 cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
2512 cc_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
2513 else
2514 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2517 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2518 cc_check -MD -MP && CFLAGS="-MD -MP $CFLAGS"
2521 if test -n "$LDFLAGS" ; then
2522 extra_ldflags="$extra_ldflags $LDFLAGS"
2523 _warn_CFLAGS=yes
2524 elif test "$cc_vendor" = "intel" ; then
2525 extra_ldflags="$extra_ldflags -i-static"
2527 if test -n "$CPPFLAGS" ; then
2528 extra_cflags="$extra_cflags $CPPFLAGS"
2529 _warn_CFLAGS=yes
2534 if x86_32 ; then
2535 # Checking assembler (_as) compatibility...
2536 # Added workaround for older as that reads from stdin by default - atmos
2537 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2538 echocheck "assembler ($_as $as_version)"
2540 _pref_as_version='2.9.1'
2541 echo 'nop' > $TMPS
2542 if test "$_mmx" = yes ; then
2543 echo 'emms' >> $TMPS
2545 if test "$_3dnow" = yes ; then
2546 _pref_as_version='2.10.1'
2547 echo 'femms' >> $TMPS
2549 if test "$_3dnowext" = yes ; then
2550 _pref_as_version='2.10.1'
2551 echo 'pswapd %mm0, %mm0' >> $TMPS
2553 if test "$_mmxext" = yes ; then
2554 _pref_as_version='2.10.1'
2555 echo 'movntq %mm0, (%eax)' >> $TMPS
2557 if test "$_sse" = yes ; then
2558 _pref_as_version='2.10.1'
2559 echo 'xorps %xmm0, %xmm0' >> $TMPS
2561 #if test "$_sse2" = yes ; then
2562 # _pref_as_version='2.11'
2563 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2565 if test "$_cmov" = yes ; then
2566 _pref_as_version='2.10.1'
2567 echo 'cmovb %eax, %ebx' >> $TMPS
2569 if test "$_ssse3" = yes ; then
2570 _pref_as_version='2.16.92'
2571 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2573 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2575 if test "$as_verc_fail" != yes ; then
2576 echores "ok"
2577 else
2578 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2579 echores "failed"
2580 die "obsolete binutils version"
2583 fi #if x86_32
2585 echocheck ".align is a power of two"
2586 if test "$_asmalign_pot" = auto ; then
2587 _asmalign_pot=no
2588 cat > $TMPC << EOF
2589 int main(void) { __asm__ (".align 3"); return 0; }
2591 cc_check && _asmalign_pot=yes
2593 if test "$_asmalign_pot" = "yes" ; then
2594 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2595 else
2596 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2598 echores $_asmalign_pot
2600 if x86 ; then
2601 echocheck "10 assembler operands"
2602 ten_operands=no
2603 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2604 cat > $TMPC << EOF
2605 int main(void) {
2606 int x=0;
2607 __asm__ volatile(
2609 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2611 return 0;
2614 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2615 echores $ten_operands
2617 echocheck "ebx availability"
2618 ebx_available=no
2619 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2620 cat > $TMPC << EOF
2621 int main(void) {
2622 int x;
2623 __asm__ volatile(
2624 "xor %0, %0"
2625 :"=b"(x)
2626 // just adding ebx to clobber list seems unreliable with some
2627 // compilers, e.g. Haiku's gcc 2.95
2629 // and the above check does not work for OSX 64 bit...
2630 __asm__ volatile("":::"%ebx");
2631 return 0;
2634 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2635 echores $ebx_available
2637 echocheck "PIC"
2638 pic=no
2639 cat > $TMPC << EOF
2640 int main(void) {
2641 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2642 #error PIC not enabled
2643 #endif
2644 return 0;
2647 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2648 echores $pic
2650 echocheck "yasm"
2651 if test -z "$YASMFLAGS" ; then
2652 if darwin ; then
2653 x86_64 && objformat="macho64" || objformat="macho"
2654 elif win32 ; then
2655 objformat="win32"
2656 else
2657 objformat="elf"
2659 # currently tested for Linux x86, x86_64
2660 YASMFLAGS="-f $objformat"
2661 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2662 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2663 case "$objformat" in
2664 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2665 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2666 esac
2667 else
2668 _warn_CFLAGS=yes
2671 echo "pabsw xmm0, xmm0" > $TMPS
2672 yasm_check || _yasm=""
2673 if test $_yasm ; then
2674 def_yasm='#define HAVE_YASM 1'
2675 have_yasm="yes"
2676 echores "$_yasm"
2677 else
2678 def_yasm='#define HAVE_YASM 0'
2679 have_yasm="no"
2680 echores "no"
2683 echocheck "bswap"
2684 def_bswap='#define HAVE_BSWAP 0'
2685 echo 'bswap %eax' > $TMPS
2686 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2687 echores "$bswap"
2688 fi #if x86
2691 #FIXME: This should happen before the check for CFLAGS..
2692 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2693 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2695 # check if AltiVec is supported by the compiler, and how to enable it
2696 echocheck "GCC AltiVec flags"
2697 cat > $TMPC << EOF
2698 int main(void) { return 0; }
2700 if $(cc_check -maltivec -mabi=altivec) ; then
2701 _altivec_gcc_flags="-maltivec -mabi=altivec"
2702 # check if <altivec.h> should be included
2703 cat > $TMPC << EOF
2704 #include <altivec.h>
2705 int main(void) { return 0; }
2707 if $(cc_check $_altivec_gcc_flags) ; then
2708 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2709 inc_altivec_h='#include <altivec.h>'
2710 else
2711 cat > $TMPC << EOF
2712 int main(void) { return 0; }
2714 if $(cc_check -faltivec) ; then
2715 _altivec_gcc_flags="-faltivec"
2716 else
2717 _altivec=no
2718 _altivec_gcc_flags="none, AltiVec disabled"
2722 echores "$_altivec_gcc_flags"
2724 # check if the compiler supports braces for vector declarations
2725 cat > $TMPC << EOF
2726 $inc_altivec_h
2727 int main(void) { (vector int) {1}; return 0; }
2729 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2731 # Disable runtime cpudetection if we cannot generate AltiVec code or
2732 # AltiVec is disabled by the user.
2733 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2734 && _runtime_cpudetection=no
2736 # Show that we are optimizing for AltiVec (if enabled and supported).
2737 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2738 && _optimizing="$_optimizing altivec"
2740 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2741 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2744 if ppc ; then
2745 def_xform_asm='#define HAVE_XFORM_ASM 0'
2746 xform_asm=no
2747 echocheck "XFORM ASM support"
2748 cat > $TMPC << EOF
2749 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2751 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2752 echores "$xform_asm"
2755 if arm ; then
2756 echocheck "ARM pld instruction"
2757 cat > $TMPC << EOF
2758 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2760 pld=no
2761 cc_check && pld=yes
2762 echores "$pld"
2764 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2765 if test $_armv5te = "auto" ; then
2766 cat > $TMPC << EOF
2767 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2769 _armv5te=no
2770 cc_check && _armv5te=yes
2772 echores "$_armv5te"
2774 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2776 echocheck "ARMv6 (SIMD instructions)"
2777 if test $_armv6 = "auto" ; then
2778 cat > $TMPC << EOF
2779 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2781 _armv6=no
2782 cc_check && _armv6=yes
2784 echores "$_armv6"
2786 echocheck "ARMv6t2 (SIMD instructions)"
2787 if test $_armv6t2 = "auto" ; then
2788 cat > $TMPC << EOF
2789 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2791 _armv6t2=no
2792 cc_check && _armv6t2=yes
2794 echores "$_armv6"
2796 echocheck "ARM VFP"
2797 if test $_armvfp = "auto" ; then
2798 cat > $TMPC << EOF
2799 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2801 _armvfp=no
2802 cc_check && _armvfp=yes
2804 echores "$_armvfp"
2806 echocheck "ARM NEON"
2807 if test $neon = "auto" ; then
2808 cat > $TMPC << EOF
2809 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2811 neon=no
2812 cc_check && neon=yes
2814 echores "$neon"
2816 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2817 if test $_iwmmxt = "auto" ; then
2818 cat > $TMPC << EOF
2819 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2821 _iwmmxt=no
2822 cc_check && _iwmmxt=yes
2824 echores "$_iwmmxt"
2827 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2828 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2829 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2830 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2831 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2832 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2833 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2834 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2835 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2836 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2837 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2838 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2839 test "$pld" = yes && cpuexts="PLD $cpuexts"
2840 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2841 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2842 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2843 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2844 test "$neon" = yes && cpuexts="NEON $cpuexts"
2845 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2846 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2847 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2849 # Checking kernel version...
2850 if x86_32 && linux ; then
2851 _k_verc_problem=no
2852 kernel_version=$(uname -r 2>&1)
2853 echocheck "$system_name kernel version"
2854 case "$kernel_version" in
2855 '') kernel_version="?.??"; _k_verc_fail=yes;;
2856 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2857 _k_verc_problem=yes;;
2858 esac
2859 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2860 _k_verc_fail=yes
2862 if test "$_k_verc_fail" ; then
2863 echores "$kernel_version, fail"
2864 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2865 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2866 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2867 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2868 echo "2.2.x you must upgrade it to get SSE support!"
2869 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2870 else
2871 echores "$kernel_version, ok"
2875 ######################
2876 # MAIN TESTS GO HERE #
2877 ######################
2880 echocheck "-lposix"
2881 cat > $TMPC <<EOF
2882 int main(void) { return 0; }
2884 if cc_check -lposix ; then
2885 extra_ldflags="$extra_ldflags -lposix"
2886 echores "yes"
2887 else
2888 echores "no"
2891 echocheck "-lm"
2892 cat > $TMPC <<EOF
2893 int main(void) { return 0; }
2895 if cc_check -lm ; then
2896 _ld_lm="-lm"
2897 echores "yes"
2898 else
2899 _ld_lm=""
2900 echores "no"
2904 echocheck "langinfo"
2905 if test "$_langinfo" = auto ; then
2906 cat > $TMPC <<EOF
2907 #include <langinfo.h>
2908 int main(void) { nl_langinfo(CODESET); return 0; }
2910 _langinfo=no
2911 cc_check && _langinfo=yes
2913 if test "$_langinfo" = yes ; then
2914 def_langinfo='#define HAVE_LANGINFO 1'
2915 else
2916 def_langinfo='#undef HAVE_LANGINFO'
2918 echores "$_langinfo"
2921 echocheck "language"
2922 # Set preferred languages, "all" uses English as main language.
2923 test -z "$language" && language=$LINGUAS
2924 test -z "$language_doc" && language_doc=$language
2925 test -z "$language_man" && language_man=$language
2926 test -z "$language_msg" && language_msg=$language
2927 language_doc=$(echo $language_doc | tr , " ")
2928 language_man=$(echo $language_man | tr , " ")
2929 language_msg=$(echo $language_msg | tr , " ")
2931 test "$language_doc" = "all" && language_doc=$doc_lang_all
2932 test "$language_man" = "all" && language_man=$man_lang_all
2933 test "$language_msg" = "all" && language_msg=en
2935 # Prune non-existing translations from language lists.
2936 # Set message translation to the first available language.
2937 # Fall back on English.
2938 for lang in $language_doc ; do
2939 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2940 done
2941 language_doc=$tmp_language_doc
2942 test -z "$language_doc" && language_doc=en
2944 for lang in $language_man ; do
2945 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2946 done
2947 language_man=$tmp_language_man
2948 test -z "$language_man" && language_man=en
2950 for lang in $language_msg ; do
2951 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2952 done
2953 language_msg=$tmp_language_msg
2954 test -z "$language_msg" && language_msg=en
2955 _mp_help="help/help_mp-${language_msg}.h"
2956 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2959 echocheck "enable sighandler"
2960 if test "$_sighandler" = yes ; then
2961 def_sighandler='#define CONFIG_SIGHANDLER 1'
2962 else
2963 def_sighandler='#undef CONFIG_SIGHANDLER'
2965 echores "$_sighandler"
2967 echocheck "runtime cpudetection"
2968 if test "$_runtime_cpudetection" = yes ; then
2969 _optimizing="Runtime CPU-Detection enabled"
2970 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2971 else
2972 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2974 echores "$_runtime_cpudetection"
2977 echocheck "restrict keyword"
2978 for restrict_keyword in restrict __restrict __restrict__ ; do
2979 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2980 if cc_check; then
2981 def_restrict_keyword=$restrict_keyword
2982 break;
2984 done
2985 if [ -n "$def_restrict_keyword" ]; then
2986 echores "$def_restrict_keyword"
2987 else
2988 echores "none"
2990 # Avoid infinite recursion loop ("#define restrict restrict")
2991 if [ "$def_restrict_keyword" != "restrict" ]; then
2992 def_restrict_keyword="#define restrict $def_restrict_keyword"
2993 else
2994 def_restrict_keyword=""
2998 echocheck "__builtin_expect"
2999 # GCC branch prediction hint
3000 cat > $TMPC << EOF
3001 int foo(int a) {
3002 a = __builtin_expect(a, 10);
3003 return a == 10 ? 0 : 1;
3005 int main(void) { return foo(10) && foo(0); }
3007 _builtin_expect=no
3008 cc_check && _builtin_expect=yes
3009 if test "$_builtin_expect" = yes ; then
3010 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
3011 else
3012 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
3014 echores "$_builtin_expect"
3017 echocheck "kstat"
3018 cat > $TMPC << EOF
3019 #include <kstat.h>
3020 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
3022 _kstat=no
3023 cc_check -lkstat && _kstat=yes
3024 if test "$_kstat" = yes ; then
3025 def_kstat="#define HAVE_LIBKSTAT 1"
3026 extra_ldflags="$extra_ldflags -lkstat"
3027 else
3028 def_kstat="#undef HAVE_LIBKSTAT"
3030 echores "$_kstat"
3033 echocheck "posix4"
3034 # required for nanosleep on some systems
3035 cat > $TMPC << EOF
3036 #include <time.h>
3037 int main(void) { (void) nanosleep(0, 0); return 0; }
3039 _posix4=no
3040 cc_check -lposix4 && _posix4=yes
3041 if test "$_posix4" = yes ; then
3042 extra_ldflags="$extra_ldflags -lposix4"
3044 echores "$_posix4"
3046 for func in exp2 exp2f llrint llrintf log2 log2f lrint lrintf round roundf truncf; do
3047 echocheck $func
3048 cat > $TMPC << EOF
3049 #include <math.h>
3050 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
3052 eval _$func=no
3053 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
3054 if eval test "x\$_$func" = "xyes"; then
3055 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
3056 echores yes
3057 else
3058 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
3059 echores no
3061 done
3064 echocheck "mkstemp"
3065 cat > $TMPC << EOF
3066 #include <stdlib.h>
3067 int main(void) { char a; mkstemp(&a); return 0; }
3069 _mkstemp=no
3070 cc_check && _mkstemp=yes
3071 if test "$_mkstemp" = yes ; then
3072 def_mkstemp='#define HAVE_MKSTEMP 1'
3073 else
3074 def_mkstemp='#undef HAVE_MKSTEMP'
3076 echores "$_mkstemp"
3079 echocheck "nanosleep"
3080 # also check for nanosleep
3081 cat > $TMPC << EOF
3082 #include <time.h>
3083 int main(void) { (void) nanosleep(0, 0); return 0; }
3085 _nanosleep=no
3086 cc_check && _nanosleep=yes
3087 if test "$_nanosleep" = yes ; then
3088 def_nanosleep='#define HAVE_NANOSLEEP 1'
3089 else
3090 def_nanosleep='#undef HAVE_NANOSLEEP'
3092 echores "$_nanosleep"
3095 echocheck "socklib"
3096 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3097 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3098 cat > $TMPC << EOF
3099 #include <netdb.h>
3100 #include <sys/socket.h>
3101 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3103 _socklib=no
3104 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3105 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3106 done
3107 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3108 if test $_winsock2_h = auto ; then
3109 _winsock2_h=no
3110 cat > $TMPC << EOF
3111 #include <winsock2.h>
3112 int main(void) { (void) gethostbyname(0); return 0; }
3114 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3116 test "$_ld_sock" && res_comment="using $_ld_sock"
3117 echores "$_socklib"
3120 if test $_winsock2_h = yes ; then
3121 _ld_sock="-lws2_32"
3122 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3123 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1'
3124 else
3125 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3126 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0'
3130 echocheck "netdb.h, struct addrinfo"
3131 if test "$_struct_addrinfo" = auto; then
3132 _struct_addrinfo=no
3133 cat > $TMPC << EOF
3134 #if HAVE_WINSOCK2_H
3135 #include <winsock2.h>
3136 #include <ws2tcpip.h>
3137 #else
3138 #include <sys/types.h>
3139 #include <sys/socket.h>
3140 #include <netdb.h>
3141 #endif
3142 int main(void) { struct addrinfo ai; return 0; }
3144 cc_check $cc_check_winsock2_h && _struct_addrinfo=yes
3146 echores "$_struct_addrinfo"
3148 if test "$_struct_addrinfo" = yes; then
3149 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
3150 else
3151 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
3155 echocheck "netdb.h, getaddrinfo()"
3156 if test "$_getaddrinfo" = auto; then
3157 _getaddrinfo=no
3158 cat > $TMPC << EOF
3159 #if HAVE_WINSOCK2_H
3160 #include <winsock2.h>
3161 #else
3162 #include <sys/types.h>
3163 #include <sys/socket.h>
3164 #include <netdb.h>
3165 #endif
3166 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
3168 cc_check $cc_check_winsock2_h && _getaddrinfo=yes
3170 echores "$_getaddrinfo"
3172 if test "$_getaddrinfo" = yes; then
3173 def_getaddrinfo="#define HAVE_GETADDRINFO 1"
3174 else
3175 def_getaddrinfo="#define HAVE_GETADDRINFO 0"
3179 echocheck "sockaddr_storage"
3180 if test "$_struct_sockaddr_storage" = auto; then
3181 _struct_sockaddr_storage=no
3182 cat > $TMPC << EOF
3183 #if HAVE_WINSOCK2_H
3184 #include <winsock2.h>
3185 #else
3186 #include <sys/socket.h>
3187 #endif
3188 int main(void) { struct sockaddr_storage sas; return 0; }
3190 cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes
3192 echores "$_struct_sockaddr_storage"
3194 if test "$_struct_sockaddr_storage" = yes; then
3195 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
3196 else
3197 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
3201 echocheck "struct ipv6_mreq"
3202 _struct_ipv6_mreq=no
3203 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 0"
3204 for header in "netinet/in.h" "ws2tcpip.h" ; do
3205 cat > $TMPC << EOF
3206 #include <$header>
3207 int main(void) { struct ipv6_mreq mreq6; return 0; }
3209 cc_check && _struct_ipv6_mreq=yes && \
3210 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 1" && break
3211 done
3212 echores "$_struct_ipv6_mreq"
3215 echocheck "struct sockaddr_in6"
3216 _struct_sockaddr_in6=no
3217 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 0"
3218 for header in "netinet/in.h" "ws2tcpip.h" ; do
3219 cat > $TMPC << EOF
3220 #include <$header>
3221 int main(void) { struct sockaddr_in6 addr; return 0; }
3223 cc_check && _struct_sockaddr_in6=yes && \
3224 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 1" && break
3225 done
3226 echores "$_struct_sockaddr_in6"
3229 echocheck "struct sockaddr sa_len"
3230 _struct_sockaddr_sa_len=no
3231 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 0"
3232 cat > $TMPC << EOF
3233 #if HAVE_WINSOCK2_H
3234 #include <winsock2.h>
3235 #else
3236 #include <sys/types.h>
3237 #include <sys/socket.h>
3238 #endif
3239 int main(void) { const void *p = &((struct sockaddr *)0)->sa_len; return 0; }
3241 cc_check $cc_check_winsock2_h && _struct_sockaddr_sa_len=yes && \
3242 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 1"
3243 echores "$_struct_sockaddr_sa_len"
3246 echocheck "arpa/inet.h"
3247 arpa_inet_h=no
3248 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3249 cat > $TMPC << EOF
3250 #include <arpa/inet.h>
3251 int main(void) { return 0; }
3253 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3254 echores "$arpa_inet_h"
3257 echocheck "inet_pton()"
3258 def_inet_pton='#define HAVE_INET_PTON 0'
3259 inet_pton=no
3260 cat > $TMPC << EOF
3261 #include <sys/types.h>
3262 #include <sys/socket.h>
3263 #include <arpa/inet.h>
3264 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3266 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3267 cc_check $_ld_tmp && inet_pton=yes && break
3268 done
3269 if test $inet_pton = yes ; then
3270 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3271 def_inet_pton='#define HAVE_INET_PTON 1'
3273 echores "$inet_pton"
3276 echocheck "inet_aton()"
3277 def_inet_aton='#define HAVE_INET_ATON 0'
3278 inet_aton=no
3279 cat > $TMPC << EOF
3280 #include <sys/types.h>
3281 #include <sys/socket.h>
3282 #include <arpa/inet.h>
3283 int main(void) { (void) inet_aton(0, 0); return 0; }
3285 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3286 cc_check $_ld_tmp && inet_aton=yes && break
3287 done
3288 if test $inet_aton = yes ; then
3289 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3290 def_inet_aton='#define HAVE_INET_ATON 1'
3292 echores "$inet_aton"
3295 echocheck "socklen_t"
3296 _socklen_t=no
3297 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3298 cat > $TMPC << EOF
3299 #include <$header>
3300 int main(void) { socklen_t v = 0; return v; }
3302 cc_check && _socklen_t=yes && break
3303 done
3304 if test "$_socklen_t" = yes ; then
3305 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3306 else
3307 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3309 echores "$_socklen_t"
3312 echocheck "closesocket()"
3313 _closesocket=no
3314 cat > $TMPC << EOF
3315 #include <winsock2.h>
3316 int main(void) { closesocket(~0); return 0; }
3318 cc_check $_ld_sock && _closesocket=yes
3319 if test "$_closesocket" = yes ; then
3320 def_closesocket='#define HAVE_CLOSESOCKET 1'
3321 else
3322 def_closesocket='#define HAVE_CLOSESOCKET 0'
3324 echores "$_closesocket"
3327 echocheck "network"
3328 test $_winsock2_h = no && test $inet_pton = no &&
3329 test $inet_aton = no && _network=no
3330 if test "$_network" = yes ; then
3331 def_network='#define CONFIG_NETWORK 1'
3332 extra_ldflags="$extra_ldflags $_ld_sock"
3333 inputmodules="network $inputmodules"
3334 else
3335 _noinputmodules="network $_noinputmodules"
3336 def_network='#undef CONFIG_NETWORK'
3337 _ftp=no
3338 _libavprotocols=$(echo $_libavprotocols | sed -e s/GOPHER_PROTOCOL// -e s/HTTP_PROTOCOL// -e s/RTMP_PROTOCOL// -e s/RTP_PROTOCOL// -e s/TCP_PROTOCOL// -e s/UDP_PROTOCOL//)
3339 _libavdemuxers=$(echo $_libavdemuxers | sed -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER//)
3341 echores "$_network"
3344 echocheck "inet6"
3345 if test "$_inet6" = auto ; then
3346 cat > $TMPC << EOF
3347 #include <sys/types.h>
3348 #if !defined(_WIN32) || defined(__CYGWIN__)
3349 #include <sys/socket.h>
3350 #include <netinet/in.h>
3351 #else
3352 #include <ws2tcpip.h>
3353 #endif
3354 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3356 _inet6=no
3357 if cc_check $_ld_sock ; then
3358 _inet6=yes
3361 if test "$_inet6" = yes ; then
3362 def_inet6='#define HAVE_AF_INET6 1'
3363 else
3364 def_inet6='#undef HAVE_AF_INET6'
3366 echores "$_inet6"
3369 echocheck "gethostbyname2"
3370 if test "$_gethostbyname2" = auto ; then
3371 cat > $TMPC << EOF
3372 #include <sys/types.h>
3373 #include <sys/socket.h>
3374 #include <netdb.h>
3375 int main(void) { gethostbyname2("", AF_INET); return 0; }
3377 _gethostbyname2=no
3378 if cc_check ; then
3379 _gethostbyname2=yes
3382 if test "$_gethostbyname2" = yes ; then
3383 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3384 else
3385 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3387 echores "$_gethostbyname2"
3390 echocheck "inttypes.h (required)"
3391 cat > $TMPC << EOF
3392 #include <inttypes.h>
3393 int main(void) { return 0; }
3395 _inttypes=no
3396 cc_check && _inttypes=yes
3397 echores "$_inttypes"
3399 if test "$_inttypes" = no ; then
3400 echocheck "bitypes.h (inttypes.h predecessor)"
3401 cat > $TMPC << EOF
3402 #include <sys/bitypes.h>
3403 int main(void) { return 0; }
3405 cc_check && _inttypes=yes
3406 if test "$_inttypes" = yes ; then
3407 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."
3408 else
3409 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3414 echocheck "int_fastXY_t in inttypes.h"
3415 cat > $TMPC << EOF
3416 #include <inttypes.h>
3417 int main(void) {
3418 volatile int_fast16_t v= 0;
3419 return v; }
3421 _fast_inttypes=no
3422 cc_check && _fast_inttypes=yes
3423 if test "$_fast_inttypes" = no ; then
3424 def_fast_inttypes='
3425 typedef signed char int_fast8_t;
3426 typedef signed int int_fast16_t;
3427 typedef signed int int_fast32_t;
3428 typedef signed long long int_fast64_t;
3429 typedef unsigned char uint_fast8_t;
3430 typedef unsigned int uint_fast16_t;
3431 typedef unsigned int uint_fast32_t;
3432 typedef unsigned long long uint_fast64_t;'
3434 echores "$_fast_inttypes"
3437 echocheck "malloc.h"
3438 cat > $TMPC << EOF
3439 #include <malloc.h>
3440 int main(void) { (void) malloc(0); return 0; }
3442 _malloc=no
3443 cc_check && _malloc=yes
3444 if test "$_malloc" = yes ; then
3445 def_malloc_h='#define HAVE_MALLOC_H 1'
3446 else
3447 def_malloc_h='#define HAVE_MALLOC_H 0'
3449 echores "$_malloc"
3452 echocheck "memalign()"
3453 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3454 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3455 cat > $TMPC << EOF
3456 #include <malloc.h>
3457 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3459 _memalign=no
3460 cc_check && _memalign=yes
3461 if test "$_memalign" = yes ; then
3462 def_memalign='#define HAVE_MEMALIGN 1'
3463 else
3464 def_memalign='#define HAVE_MEMALIGN 0'
3465 def_map_memalign='#define memalign(a,b) malloc(b)'
3466 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3468 echores "$_memalign"
3471 echocheck "posix_memalign()"
3472 posix_memalign=no
3473 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3474 cat > $TMPC << EOF
3475 #define _XOPEN_SOURCE 600
3476 #include <stdlib.h>
3477 int main(void) { posix_memalign(NULL, 0, 0); }
3479 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3480 echores "$posix_memalign"
3483 echocheck "alloca.h"
3484 cat > $TMPC << EOF
3485 #include <alloca.h>
3486 int main(void) { (void) alloca(0); return 0; }
3488 _alloca=no
3489 cc_check && _alloca=yes
3490 if cc_check ; then
3491 def_alloca_h='#define HAVE_ALLOCA_H 1'
3492 else
3493 def_alloca_h='#undef HAVE_ALLOCA_H'
3495 echores "$_alloca"
3498 echocheck "fastmemcpy"
3499 if test "$_fastmemcpy" = yes ; then
3500 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3501 else
3502 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3504 echores "$_fastmemcpy"
3507 echocheck "hard-coded tables"
3508 if test "$hardcoded_tables" = yes ; then
3509 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1'
3510 mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes'
3511 else
3512 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0'
3514 echores "$hardcoded_tables"
3517 echocheck "mman.h"
3518 cat > $TMPC << EOF
3519 #include <sys/types.h>
3520 #include <sys/mman.h>
3521 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3523 _mman=no
3524 cc_check && _mman=yes
3525 if test "$_mman" = yes ; then
3526 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3527 else
3528 def_mman_h='#undef HAVE_SYS_MMAN_H'
3529 os2 && _need_mmap=yes
3531 echores "$_mman"
3533 cat > $TMPC << EOF
3534 #include <sys/types.h>
3535 #include <sys/mman.h>
3536 int main(void) { void *p = MAP_FAILED; return 0; }
3538 _mman_has_map_failed=no
3539 cc_check && _mman_has_map_failed=yes
3540 if test "$_mman_has_map_failed" = yes ; then
3541 def_mman_has_map_failed=''
3542 else
3543 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3546 echocheck "dynamic loader"
3547 cat > $TMPC << EOF
3548 #include <stddef.h>
3549 #include <dlfcn.h>
3550 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3552 _dl=no
3553 for _ld_tmp in "" "-ldl" ; do
3554 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3555 done
3556 if test "$_dl" = yes ; then
3557 def_dl='#define HAVE_LIBDL 1'
3558 else
3559 def_dl='#undef HAVE_LIBDL'
3561 echores "$_dl"
3564 echocheck "dynamic a/v plugins support"
3565 if test "$_dl" = no ; then
3566 _dynamic_plugins=no
3568 if test "$_dynamic_plugins" = yes ; then
3569 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3570 else
3571 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3573 echores "$_dynamic_plugins"
3576 def_threads='#define HAVE_THREADS 0'
3578 echocheck "pthread"
3579 if linux ; then
3580 THREAD_CFLAGS=-D_REENTRANT
3581 elif freebsd || netbsd || openbsd || bsdos ; then
3582 THREAD_CFLAGS=-D_THREAD_SAFE
3584 if test "$_pthreads" = auto ; then
3585 cat > $TMPC << EOF
3586 #include <pthread.h>
3587 void* func(void *arg) { return arg; }
3588 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3590 _pthreads=no
3591 if ! hpux ; then
3592 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3593 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3594 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3595 done
3598 if test "$_pthreads" = yes ; then
3599 test $_ld_pthread && res_comment="using $_ld_pthread"
3600 def_pthreads='#define HAVE_PTHREADS 1'
3601 def_threads='#define HAVE_THREADS 1'
3602 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3603 else
3604 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3605 def_pthreads='#undef HAVE_PTHREADS'
3606 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3607 mingw32 || _win32dll=no
3609 echores "$_pthreads"
3611 if cygwin ; then
3612 if test "$_pthreads" = yes ; then
3613 def_pthread_cache="#define PTHREAD_CACHE 1"
3614 else
3615 _stream_cache=no
3616 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3620 echocheck "w32threads"
3621 if test "$_pthreads" = yes ; then
3622 res_comment="using pthread instead"
3623 _w32threads=no
3625 if test "$_w32threads" = auto ; then
3626 _w32threads=no
3627 mingw32 && _w32threads=yes
3629 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3630 echores "$_w32threads"
3632 echocheck "rpath"
3633 netbsd &&_rpath=yes
3634 if test "$_rpath" = yes ; then
3635 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3636 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3637 done
3638 extra_ldflags=$tmp
3640 echores "$_rpath"
3642 echocheck "iconv"
3643 if test "$_iconv" = auto ; then
3644 cat > $TMPC << EOF
3645 #include <stdio.h>
3646 #include <unistd.h>
3647 #include <iconv.h>
3648 #define INBUFSIZE 1024
3649 #define OUTBUFSIZE 4096
3651 char inbuffer[INBUFSIZE];
3652 char outbuffer[OUTBUFSIZE];
3654 int main(void) {
3655 size_t numread;
3656 iconv_t icdsc;
3657 char *tocode="UTF-8";
3658 char *fromcode="cp1250";
3659 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3660 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3661 char *iptr=inbuffer;
3662 char *optr=outbuffer;
3663 size_t inleft=numread;
3664 size_t outleft=OUTBUFSIZE;
3665 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3666 != (size_t)(-1)) {
3667 write(1, outbuffer, OUTBUFSIZE - outleft);
3670 if (iconv_close(icdsc) == -1)
3673 return 0;
3676 _iconv=no
3677 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3678 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3679 _iconv=yes && break
3680 done
3682 if test "$_iconv" = yes ; then
3683 def_iconv='#define CONFIG_ICONV 1'
3684 else
3685 def_iconv='#undef CONFIG_ICONV'
3687 echores "$_iconv"
3690 echocheck "soundcard.h"
3691 _soundcard_h=no
3692 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3693 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3694 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3695 cat > $TMPC << EOF
3696 #include <$_soundcard_header>
3697 int main(void) { return 0; }
3699 cc_check && _soundcard_h=yes && res_comment="$_soundcard_header" && break
3700 done
3702 if test "$_soundcard_h" = yes ; then
3703 if test $_soundcard_header = "sys/soundcard.h"; then
3704 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3705 else
3706 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3709 echores "$_soundcard_h"
3712 echocheck "sys/dvdio.h"
3713 cat > $TMPC << EOF
3714 #include <unistd.h>
3715 #include <sys/dvdio.h>
3716 int main(void) { return 0; }
3718 _dvdio=no
3719 cc_check && _dvdio=yes
3720 if test "$_dvdio" = yes ; then
3721 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3722 else
3723 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3725 echores "$_dvdio"
3728 echocheck "sys/cdio.h"
3729 cat > $TMPC << EOF
3730 #include <unistd.h>
3731 #include <sys/cdio.h>
3732 int main(void) { return 0; }
3734 _cdio=no
3735 cc_check && _cdio=yes
3736 if test "$_cdio" = yes ; then
3737 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3738 else
3739 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3741 echores "$_cdio"
3744 echocheck "linux/cdrom.h"
3745 cat > $TMPC << EOF
3746 #include <sys/types.h>
3747 #include <linux/cdrom.h>
3748 int main(void) { return 0; }
3750 _cdrom=no
3751 cc_check && _cdrom=yes
3752 if test "$_cdrom" = yes ; then
3753 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3754 else
3755 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3757 echores "$_cdrom"
3760 echocheck "dvd.h"
3761 cat > $TMPC << EOF
3762 #include <dvd.h>
3763 int main(void) { return 0; }
3765 _dvd=no
3766 cc_check && _dvd=yes
3767 if test "$_dvd" = yes ; then
3768 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3769 else
3770 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3772 echores "$_dvd"
3775 if bsdos; then
3776 echocheck "BSDI dvd.h"
3777 cat > $TMPC << EOF
3778 #include <dvd.h>
3779 int main(void) { return 0; }
3781 _bsdi_dvd=no
3782 cc_check && _bsdi_dvd=yes
3783 if test "$_bsdi_dvd" = yes ; then
3784 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3785 else
3786 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3788 echores "$_bsdi_dvd"
3789 fi #if bsdos
3792 if hpux; then
3793 # also used by AIX, but AIX does not support VCD and/or libdvdread
3794 echocheck "HP-UX SCSI header"
3795 cat > $TMPC << EOF
3796 #include <sys/scsi.h>
3797 int main(void) { return 0; }
3799 _hpux_scsi_h=no
3800 cc_check && _hpux_scsi_h=yes
3801 if test "$_hpux_scsi_h" = yes ; then
3802 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3803 else
3804 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3806 echores "$_hpux_scsi_h"
3807 fi #if hpux
3810 if sunos; then
3811 echocheck "userspace SCSI headers (Solaris)"
3812 cat > $TMPC << EOF
3813 #include <unistd.h>
3814 #include <stropts.h>
3815 #include <sys/scsi/scsi_types.h>
3816 #include <sys/scsi/impl/uscsi.h>
3817 int main(void) { return 0; }
3819 _sol_scsi_h=no
3820 cc_check && _sol_scsi_h=yes
3821 if test "$_sol_scsi_h" = yes ; then
3822 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3823 else
3824 def_sol_scsi_h='#undef SOLARIS_USCSI'
3826 echores "$_sol_scsi_h"
3827 fi #if sunos
3830 echocheck "termcap"
3831 if test "$_termcap" = auto ; then
3832 cat > $TMPC <<EOF
3833 #include <stddef.h>
3834 #include <term.h>
3835 int main(void) { tgetent(NULL, NULL); return 0; }
3837 _termcap=no
3838 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3839 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3840 && _termcap=yes && break
3841 done
3843 if test "$_termcap" = yes ; then
3844 def_termcap='#define HAVE_TERMCAP 1'
3845 test $_ld_tmp && res_comment="using $_ld_tmp"
3846 else
3847 def_termcap='#undef HAVE_TERMCAP'
3849 echores "$_termcap"
3852 echocheck "termios"
3853 def_termios='#undef HAVE_TERMIOS'
3854 def_termios_h='#undef HAVE_TERMIOS_H'
3855 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3856 if test "$_termios" = auto ; then
3857 _termios=no
3858 for _termios_header in "termios.h" "sys/termios.h"; do
3859 cat > $TMPC <<EOF
3860 #include <$_termios_header>
3861 int main(void) { return 0; }
3863 cc_check && _termios=yes && res_comment="using $_termios_header" && break
3864 done
3867 if test "$_termios" = yes ; then
3868 def_termios='#define HAVE_TERMIOS 1'
3869 if test "$_termios_header" = "termios.h" ; then
3870 def_termios_h='#define HAVE_TERMIOS_H 1'
3871 else
3872 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3875 echores "$_termios"
3878 echocheck "shm"
3879 if test "$_shm" = auto ; then
3880 cat > $TMPC << EOF
3881 #include <sys/types.h>
3882 #include <sys/shm.h>
3883 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3885 _shm=no
3886 cc_check && _shm=yes
3888 if test "$_shm" = yes ; then
3889 def_shm='#define HAVE_SHM 1'
3890 else
3891 def_shm='#undef HAVE_SHM'
3893 echores "$_shm"
3896 echocheck "strsep()"
3897 cat > $TMPC << EOF
3898 #include <string.h>
3899 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3901 _strsep=no
3902 cc_check && _strsep=yes
3903 if test "$_strsep" = yes ; then
3904 def_strsep='#define HAVE_STRSEP 1'
3905 _need_strsep=no
3906 else
3907 def_strsep='#undef HAVE_STRSEP'
3908 _need_strsep=yes
3910 echores "$_strsep"
3913 echocheck "vsscanf()"
3914 cat > $TMPC << EOF
3915 #define _ISOC99_SOURCE
3916 #include <stdarg.h>
3917 #include <stdio.h>
3918 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3920 _vsscanf=no
3921 cc_check && _vsscanf=yes
3922 if test "$_vsscanf" = yes ; then
3923 def_vsscanf='#define HAVE_VSSCANF 1'
3924 _need_vsscanf=no
3925 else
3926 def_vsscanf='#undef HAVE_VSSCANF'
3927 _need_vsscanf=yes
3929 echores "$_vsscanf"
3932 echocheck "swab()"
3933 cat > $TMPC << EOF
3934 #define _XOPEN_SOURCE 600
3935 #include <unistd.h>
3936 int main(void) { swab(0, 0, 0); return 0; }
3938 _swab=no
3939 cc_check && _swab=yes
3940 if test "$_swab" = yes ; then
3941 def_swab='#define HAVE_SWAB 1'
3942 _need_swab=no
3943 else
3944 def_swab='#undef HAVE_SWAB'
3945 _need_swab=yes
3947 echores "$_swab"
3949 echocheck "POSIX select()"
3950 cat > $TMPC << EOF
3951 #include <stdio.h>
3952 #include <stdlib.h>
3953 #include <sys/types.h>
3954 #include <string.h>
3955 #include <sys/time.h>
3956 #include <unistd.h>
3957 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3959 _posix_select=no
3960 def_posix_select='#undef HAVE_POSIX_SELECT'
3961 #select() of kLIBC (OS/2) supports socket only
3962 ! os2 && cc_check && _posix_select=yes \
3963 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3964 echores "$_posix_select"
3967 echocheck "audio select()"
3968 if test "$_select" = no ; then
3969 def_select='#undef HAVE_AUDIO_SELECT'
3970 elif test "$_select" = yes ; then
3971 def_select='#define HAVE_AUDIO_SELECT 1'
3973 echores "$_select"
3976 echocheck "gettimeofday()"
3977 cat > $TMPC << EOF
3978 #include <stdio.h>
3979 #include <sys/time.h>
3980 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3982 _gettimeofday=no
3983 cc_check && _gettimeofday=yes
3984 if test "$_gettimeofday" = yes ; then
3985 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3986 _need_gettimeofday=no
3987 else
3988 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3989 _need_gettimeofday=yes
3991 echores "$_gettimeofday"
3994 echocheck "glob()"
3995 cat > $TMPC << EOF
3996 #include <stdio.h>
3997 #include <glob.h>
3998 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
4000 _glob=no
4001 cc_check && _glob=yes
4002 if test "$_glob" = yes ; then
4003 def_glob='#define HAVE_GLOB 1'
4004 _need_glob=no
4005 else
4006 def_glob='#undef HAVE_GLOB'
4007 _need_glob=yes
4009 echores "$_glob"
4012 echocheck "setenv()"
4013 cat > $TMPC << EOF
4014 #include <stdlib.h>
4015 int main(void) { setenv("","",0); return 0; }
4017 _setenv=no
4018 cc_check && _setenv=yes
4019 if test "$_setenv" = yes ; then
4020 def_setenv='#define HAVE_SETENV 1'
4021 _need_setenv=no
4022 else
4023 def_setenv='#undef HAVE_SETENV'
4024 _need_setenv=yes
4026 echores "$_setenv"
4029 echocheck "setmode()"
4030 _setmode=no
4031 def_setmode='#define HAVE_SETMODE 0'
4032 cat > $TMPC << EOF
4033 #include <io.h>
4034 int main(void) { setmode(0, 0); return 0; }
4036 cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
4037 echores "$_setmode"
4040 if sunos; then
4041 echocheck "sysi86()"
4042 cat > $TMPC << EOF
4043 #include <sys/sysi86.h>
4044 int main(void) { sysi86(0); return 0; }
4046 _sysi86=no
4047 cc_check && _sysi86=yes
4048 if test "$_sysi86" = yes ; then
4049 def_sysi86='#define HAVE_SYSI86 1'
4050 cat > $TMPC << EOF
4051 #include <sys/sysi86.h>
4052 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
4054 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
4055 else
4056 def_sysi86='#undef HAVE_SYSI86'
4058 echores "$_sysi86"
4059 fi #if sunos
4062 echocheck "sys/sysinfo.h"
4063 cat > $TMPC << EOF
4064 #include <sys/sysinfo.h>
4065 int main(void) {
4066 struct sysinfo s_info;
4067 sysinfo(&s_info);
4068 return 0;
4071 _sys_sysinfo=no
4072 cc_check && _sys_sysinfo=yes
4073 if test "$_sys_sysinfo" = yes ; then
4074 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
4075 else
4076 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
4078 echores "$_sys_sysinfo"
4081 if darwin; then
4083 echocheck "Mac OS X Finder Support"
4084 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
4085 if test "$_macosx_finder" = yes ; then
4086 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
4087 extra_ldflags="$extra_ldflags -framework Carbon"
4089 echores "$_macosx_finder"
4091 echocheck "Mac OS X Bundle file locations"
4092 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
4093 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
4094 if test "$_macosx_bundle" = yes ; then
4095 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
4096 extra_ldflags="$extra_ldflags -framework Carbon"
4098 echores "$_macosx_bundle"
4100 echocheck "Apple Remote"
4101 if test "$_apple_remote" = auto ; then
4102 _apple_remote=no
4103 cat > $TMPC <<EOF
4104 #include <stdio.h>
4105 #include <IOKit/IOCFPlugIn.h>
4106 int main(void) {
4107 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
4108 CFMutableDictionaryRef hidMatchDictionary;
4109 IOReturn ioReturnValue;
4111 // Set up a matching dictionary to search the I/O Registry by class.
4112 // name for all HID class devices
4113 hidMatchDictionary = IOServiceMatching("AppleIRController");
4115 // Now search I/O Registry for matching devices.
4116 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
4117 hidMatchDictionary, &hidObjectIterator);
4119 // If search is unsuccessful, return nonzero.
4120 if (ioReturnValue != kIOReturnSuccess ||
4121 !IOIteratorIsValid(hidObjectIterator)) {
4122 return 1;
4124 return 0;
4127 cc_check -framework IOKit && tmp_run && _apple_remote=yes
4129 if test "$_apple_remote" = yes ; then
4130 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
4131 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
4132 else
4133 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
4135 echores "$_apple_remote"
4137 fi #if darwin
4139 if linux; then
4141 echocheck "Apple IR"
4142 if test "$_apple_ir" = auto ; then
4143 _apple_ir=no
4144 cat > $TMPC <<EOF
4145 #include <linux/types.h>
4146 #include <linux/input.h>
4147 int main(void) {
4148 struct input_event ev;
4149 struct input_id id;
4150 return 0;
4153 cc_check && _apple_ir=yes
4155 if test "$_apple_ir" = yes ; then
4156 def_apple_ir='#define CONFIG_APPLE_IR 1'
4157 else
4158 def_apple_ir='#undef CONFIG_APPLE_IR'
4160 echores "$_apple_ir"
4161 fi #if linux
4163 echocheck "pkg-config"
4164 _pkg_config=pkg-config
4165 if $($_pkg_config --version > /dev/null 2>&1); then
4166 if test "$_ld_static"; then
4167 _pkg_config="$_pkg_config --static"
4169 echores "yes"
4170 else
4171 _pkg_config=false
4172 echores "no"
4176 echocheck "Samba support (libsmbclient)"
4177 if test "$_smb" = yes; then
4178 extra_ldflags="$extra_ldflags -lsmbclient"
4180 if test "$_smb" = auto; then
4181 _smb=no
4182 cat > $TMPC << EOF
4183 #include <libsmbclient.h>
4184 int main(void) { smbc_opendir("smb://"); return 0; }
4186 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4187 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
4188 _smb=yes && break
4189 done
4192 if test "$_smb" = yes; then
4193 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4194 inputmodules="smb $inputmodules"
4195 else
4196 def_smb="#undef CONFIG_LIBSMBCLIENT"
4197 _noinputmodules="smb $_noinputmodules"
4199 echores "$_smb"
4202 #########
4203 # VIDEO #
4204 #########
4207 echocheck "tdfxfb"
4208 if test "$_tdfxfb" = yes ; then
4209 def_tdfxfb='#define CONFIG_TDFXFB 1'
4210 vomodules="tdfxfb $vomodules"
4211 else
4212 def_tdfxfb='#undef CONFIG_TDFXFB'
4213 novomodules="tdfxfb $novomodules"
4215 echores "$_tdfxfb"
4217 echocheck "s3fb"
4218 if test "$_s3fb" = yes ; then
4219 def_s3fb='#define CONFIG_S3FB 1'
4220 vomodules="s3fb $vomodules"
4221 else
4222 def_s3fb='#undef CONFIG_S3FB'
4223 novomodules="s3fb $novomodules"
4225 echores "$_s3fb"
4227 echocheck "wii"
4228 if test "$_wii" = yes ; then
4229 def_wii='#define CONFIG_WII 1'
4230 vomodules="wii $vomodules"
4231 else
4232 def_wii='#undef CONFIG_WII'
4233 novomodules="wii $novomodules"
4235 echores "$_wii"
4237 echocheck "tdfxvid"
4238 if test "$_tdfxvid" = yes ; then
4239 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4240 vomodules="tdfx_vid $vomodules"
4241 else
4242 def_tdfxvid='#undef CONFIG_TDFX_VID'
4243 novomodules="tdfx_vid $novomodules"
4245 echores "$_tdfxvid"
4247 echocheck "xvr100"
4248 if test "$_xvr100" = auto ; then
4249 cat > $TMPC << EOF
4250 #include <unistd.h>
4251 #include <sys/fbio.h>
4252 #include <sys/visual_io.h>
4253 int main(void) {
4254 struct vis_identifier ident;
4255 struct fbgattr attr;
4256 ioctl(0, VIS_GETIDENTIFIER, &ident);
4257 ioctl(0, FBIOGATTR, &attr);
4258 return 0;
4261 _xvr100=no
4262 cc_check && _xvr100=yes
4264 if test "$_xvr100" = yes ; then
4265 def_xvr100='#define CONFIG_XVR100 1'
4266 vomodules="xvr100 $vomodules"
4267 else
4268 def_tdfxvid='#undef CONFIG_XVR100'
4269 novomodules="xvr100 $novomodules"
4271 echores "$_xvr100"
4273 echocheck "tga"
4274 if test "$_tga" = yes ; then
4275 def_tga='#define CONFIG_TGA 1'
4276 vomodules="tga $vomodules"
4277 else
4278 def_tga='#undef CONFIG_TGA'
4279 novomodules="tga $novomodules"
4281 echores "$_tga"
4284 echocheck "md5sum support"
4285 if test "$_md5sum" = yes; then
4286 def_md5sum="#define CONFIG_MD5SUM 1"
4287 vomodules="md5sum $vomodules"
4288 else
4289 def_md5sum="#undef CONFIG_MD5SUM"
4290 novomodules="md5sum $novomodules"
4292 echores "$_md5sum"
4295 echocheck "yuv4mpeg support"
4296 if test "$_yuv4mpeg" = yes; then
4297 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4298 vomodules="yuv4mpeg $vomodules"
4299 else
4300 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4301 novomodules="yuv4mpeg $novomodules"
4303 echores "$_yuv4mpeg"
4306 echocheck "bl"
4307 if test "$_bl" = yes ; then
4308 def_bl='#define CONFIG_BL 1'
4309 vomodules="bl $vomodules"
4310 else
4311 def_bl='#undef CONFIG_BL'
4312 novomodules="bl $novomodules"
4314 echores "$_bl"
4317 echocheck "DirectFB"
4318 if test "$_directfb" = auto ; then
4319 _directfb=no
4320 cat > $TMPC <<EOF
4321 #include <directfb.h>
4322 int main(void) { DirectFBInit(0, 0); return 0; }
4324 for _inc_tmp in "" -I/usr/local/include/directfb \
4325 -I/usr/include/directfb -I/usr/local/include; do
4326 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4327 extra_cflags="$extra_cflags $_inc_tmp" && break
4328 done
4331 dfb_version() {
4332 expr $1 \* 65536 + $2 \* 256 + $3
4335 if test "$_directfb" = yes; then
4336 cat > $TMPC << EOF
4337 #include <directfb_version.h>
4339 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4342 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4343 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4344 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4345 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4346 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4347 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4348 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4349 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4350 res_comment="$_directfb_version"
4351 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4352 else
4353 def_directfb_version='#undef DIRECTFBVERSION'
4354 _directfb=no
4355 res_comment="version >=0.9.13 required"
4357 else
4358 _directfb=no
4359 res_comment="failed to get version"
4362 echores "$_directfb"
4364 if test "$_directfb" = yes ; then
4365 def_directfb='#define CONFIG_DIRECTFB 1'
4366 vomodules="directfb $vomodules"
4367 libs_mplayer="$libs_mplayer -ldirectfb"
4368 else
4369 def_directfb='#undef CONFIG_DIRECTFB'
4370 novomodules="directfb $novomodules"
4372 if test "$_dfbmga" = yes; then
4373 vomodules="dfbmga $vomodules"
4374 def_dfbmga='#define CONFIG_DFBMGA 1'
4375 else
4376 novomodules="dfbmga $novomodules"
4377 def_dfbmga='#undef CONFIG_DFBMGA'
4381 echocheck "X11 headers presence"
4382 _x11_headers="no"
4383 res_comment="check if the dev(el) packages are installed"
4384 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4385 if test -f "$I/X11/Xlib.h" ; then
4386 _x11_headers="yes"
4387 res_comment=""
4388 break
4390 done
4391 if test $_cross_compile = no; then
4392 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4393 /usr/include/X11R6 /usr/openwin/include ; do
4394 if test -f "$I/X11/Xlib.h" ; then
4395 extra_cflags="$extra_cflags -I$I"
4396 _x11_headers="yes"
4397 res_comment="using $I"
4398 break
4400 done
4402 echores "$_x11_headers"
4405 echocheck "X11"
4406 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4407 cat > $TMPC <<EOF
4408 #include <X11/Xlib.h>
4409 #include <X11/Xutil.h>
4410 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4412 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4413 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4414 -L/usr/lib ; do
4415 if netbsd; then
4416 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4417 else
4418 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4420 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4421 && _x11=yes && break
4422 done
4424 if test "$_x11" = yes ; then
4425 def_x11='#define CONFIG_X11 1'
4426 vomodules="x11 xover $vomodules"
4427 else
4428 _x11=no
4429 def_x11='#undef CONFIG_X11'
4430 novomodules="x11 $novomodules"
4431 res_comment="check if the dev(el) packages are installed"
4432 # disable stuff that depends on X
4433 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4435 echores "$_x11"
4437 echocheck "Xss screensaver extensions"
4438 if test "$_xss" = auto ; then
4439 cat > $TMPC << EOF
4440 #include <X11/Xlib.h>
4441 #include <X11/extensions/scrnsaver.h>
4442 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4444 _xss=no
4445 cc_check -lXss && _xss=yes
4447 if test "$_xss" = yes ; then
4448 def_xss='#define CONFIG_XSS 1'
4449 libs_mplayer="$libs_mplayer -lXss"
4450 else
4451 def_xss='#undef CONFIG_XSS'
4453 echores "$_xss"
4455 echocheck "DPMS"
4456 _xdpms3=no
4457 _xdpms4=no
4458 if test "$_x11" = yes ; then
4459 cat > $TMPC <<EOF
4460 #include <X11/Xmd.h>
4461 #include <X11/Xlib.h>
4462 #include <X11/Xutil.h>
4463 #include <X11/Xatom.h>
4464 #include <X11/extensions/dpms.h>
4465 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4467 cc_check -lXdpms && _xdpms3=yes
4468 cat > $TMPC <<EOF
4469 #include <X11/Xlib.h>
4470 #include <X11/extensions/dpms.h>
4471 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4473 cc_check -lXext && _xdpms4=yes
4475 if test "$_xdpms4" = yes ; then
4476 def_xdpms='#define CONFIG_XDPMS 1'
4477 res_comment="using Xdpms 4"
4478 echores "yes"
4479 elif test "$_xdpms3" = yes ; then
4480 def_xdpms='#define CONFIG_XDPMS 1'
4481 libs_mplayer="$libs_mplayer -lXdpms"
4482 res_comment="using Xdpms 3"
4483 echores "yes"
4484 else
4485 def_xdpms='#undef CONFIG_XDPMS'
4486 echores "no"
4490 echocheck "Xv"
4491 if test "$_xv" = auto ; then
4492 cat > $TMPC <<EOF
4493 #include <X11/Xlib.h>
4494 #include <X11/extensions/Xvlib.h>
4495 int main(void) {
4496 (void) XvGetPortAttribute(0, 0, 0, 0);
4497 (void) XvQueryPortAttributes(0, 0, 0);
4498 return 0; }
4500 _xv=no
4501 cc_check -lXv && _xv=yes
4504 if test "$_xv" = yes ; then
4505 def_xv='#define CONFIG_XV 1'
4506 libs_mplayer="$libs_mplayer -lXv"
4507 vomodules="xv $vomodules"
4508 else
4509 def_xv='#undef CONFIG_XV'
4510 novomodules="xv $novomodules"
4512 echores "$_xv"
4515 echocheck "XvMC"
4516 if test "$_xv" = yes && test "$_xvmc" != no ; then
4517 _xvmc=no
4518 cat > $TMPC <<EOF
4519 #include <X11/Xlib.h>
4520 #include <X11/extensions/Xvlib.h>
4521 #include <X11/extensions/XvMClib.h>
4522 int main(void) {
4523 (void) XvMCQueryExtension(0,0,0);
4524 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4525 return 0; }
4527 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4528 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4529 done
4531 if test "$_xvmc" = yes ; then
4532 def_xvmc='#define CONFIG_XVMC 1'
4533 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4534 vomodules="xvmc $vomodules"
4535 res_comment="using $_xvmclib"
4536 else
4537 def_xvmc='#define CONFIG_XVMC 0'
4538 novomodules="xvmc $novomodules"
4539 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
4541 echores "$_xvmc"
4544 echocheck "VDPAU"
4545 if test "$_vdpau" = auto ; then
4546 _vdpau=no
4547 if test "$_dl" = yes ; then
4548 cat > $TMPC <<EOF
4549 #include <vdpau/vdpau_x11.h>
4550 int main(void) {
4551 (void) vdp_device_create_x11(0, 0, 0, 0);
4552 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4554 cc_check -lvdpau && _vdpau=yes
4557 if test "$_vdpau" = yes ; then
4558 def_vdpau='#define CONFIG_VDPAU 1'
4559 libs_mplayer="$libs_mplayer -lvdpau"
4560 vomodules="vdpau $vomodules"
4561 else
4562 def_vdpau='#define CONFIG_VDPAU 0'
4563 novomodules="vdpau $novomodules"
4564 _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//)
4566 echores "$_vdpau"
4569 echocheck "Xinerama"
4570 if test "$_xinerama" = auto ; then
4571 cat > $TMPC <<EOF
4572 #include <X11/Xlib.h>
4573 #include <X11/extensions/Xinerama.h>
4574 int main(void) { (void) XineramaIsActive(0); return 0; }
4576 _xinerama=no
4577 cc_check -lXinerama && _xinerama=yes
4580 if test "$_xinerama" = yes ; then
4581 def_xinerama='#define CONFIG_XINERAMA 1'
4582 libs_mplayer="$libs_mplayer -lXinerama"
4583 else
4584 def_xinerama='#undef CONFIG_XINERAMA'
4586 echores "$_xinerama"
4589 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4590 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4591 # named 'X extensions' or something similar.
4592 # This check may be useful for future mplayer versions (to change resolution)
4593 # If you run into problems, remove '-lXxf86vm'.
4594 echocheck "Xxf86vm"
4595 if test "$_vm" = auto ; then
4596 cat > $TMPC <<EOF
4597 #include <X11/Xlib.h>
4598 #include <X11/extensions/xf86vmode.h>
4599 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4601 _vm=no
4602 cc_check -lXxf86vm && _vm=yes
4604 if test "$_vm" = yes ; then
4605 def_vm='#define CONFIG_XF86VM 1'
4606 libs_mplayer="$libs_mplayer -lXxf86vm"
4607 else
4608 def_vm='#undef CONFIG_XF86VM'
4610 echores "$_vm"
4612 # Check for the presence of special keycodes, like audio control buttons
4613 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4614 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4615 # have these new keycodes.
4616 echocheck "XF86keysym"
4617 if test "$_xf86keysym" = auto; then
4618 _xf86keysym=no
4619 cat > $TMPC <<EOF
4620 #include <X11/Xlib.h>
4621 #include <X11/XF86keysym.h>
4622 int main(void) { return XF86XK_AudioPause; }
4624 cc_check && _xf86keysym=yes
4626 if test "$_xf86keysym" = yes ; then
4627 def_xf86keysym='#define CONFIG_XF86XK 1'
4628 else
4629 def_xf86keysym='#undef CONFIG_XF86XK'
4631 echores "$_xf86keysym"
4633 echocheck "DGA"
4634 if test "$_dga2" = auto && test "$_x11" = yes ; then
4635 cat > $TMPC << EOF
4636 #include <X11/Xlib.h>
4637 #include <X11/extensions/xf86dga.h>
4638 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4640 _dga2=no
4641 cc_check -lXxf86dga && _dga2=yes
4643 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4644 cat > $TMPC << EOF
4645 #include <X11/Xlib.h>
4646 #include <X11/extensions/xf86dga.h>
4647 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4649 _dga1=no
4650 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4653 _dga=no
4654 def_dga='#undef CONFIG_DGA'
4655 def_dga1='#undef CONFIG_DGA1'
4656 def_dga2='#undef CONFIG_DGA2'
4657 if test "$_dga1" = yes ; then
4658 _dga=yes
4659 def_dga1='#define CONFIG_DGA1 1'
4660 res_comment="using DGA 1.0"
4661 elif test "$_dga2" = yes ; then
4662 _dga=yes
4663 def_dga2='#define CONFIG_DGA2 1'
4664 res_comment="using DGA 2.0"
4666 if test "$_dga" = yes ; then
4667 def_dga='#define CONFIG_DGA 1'
4668 libs_mplayer="$libs_mplayer -lXxf86dga"
4669 vomodules="dga $vomodules"
4670 else
4671 novomodules="dga $novomodules"
4673 echores "$_dga"
4676 echocheck "3dfx"
4677 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4678 def_3dfx='#define CONFIG_3DFX 1'
4679 vomodules="3dfx $vomodules"
4680 else
4681 def_3dfx='#undef CONFIG_3DFX'
4682 novomodules="3dfx $novomodules"
4684 echores "$_3dfx"
4687 echocheck "VIDIX"
4688 def_vidix='#undef CONFIG_VIDIX'
4689 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4690 _vidix_drv_cyberblade=no
4691 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4692 _vidix_drv_ivtv=no
4693 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4694 _vidix_drv_mach64=no
4695 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4696 _vidix_drv_mga=no
4697 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4698 _vidix_drv_mga_crtc2=no
4699 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4700 _vidix_drv_nvidia=no
4701 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4702 _vidix_drv_pm2=no
4703 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4704 _vidix_drv_pm3=no
4705 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4706 _vidix_drv_radeon=no
4707 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4708 _vidix_drv_rage128=no
4709 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4710 _vidix_drv_s3=no
4711 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4712 _vidix_drv_sh_veu=no
4713 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4714 _vidix_drv_sis=no
4715 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4716 _vidix_drv_unichrome=no
4717 if test "$_vidix" = auto ; then
4718 _vidix=no
4719 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4720 && _vidix=yes
4721 x86_64 && ! linux && _vidix=no
4722 (ppc || alpha) && linux && _vidix=yes
4724 echores "$_vidix"
4726 if test "$_vidix" = yes ; then
4727 def_vidix='#define CONFIG_VIDIX 1'
4728 vomodules="cvidix $vomodules"
4729 # FIXME: ivtv driver temporarily disabled until we have a proper test
4730 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4731 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4733 # some vidix drivers are architecture and os specific, discard them elsewhere
4734 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4735 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4737 for driver in $_vidix_drivers ; do
4738 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4739 eval _vidix_drv_${driver}=yes
4740 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4741 done
4743 echocheck "VIDIX PCI device name database"
4744 echores "$_vidix_pcidb"
4745 if test "$_vidix_pcidb" = yes ; then
4746 _vidix_pcidb_val=1
4747 else
4748 _vidix_pcidb_val=0
4751 echocheck "VIDIX dhahelper support"
4752 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4753 echores "$_dhahelper"
4755 echocheck "VIDIX svgalib_helper support"
4756 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4757 echores "$_svgalib_helper"
4759 else
4760 novomodules="cvidix $novomodules"
4763 if test "$_vidix" = yes && win32; then
4764 winvidix=yes
4765 vomodules="winvidix $vomodules"
4766 libs_mplayer="$libs_mplayer -lgdi32"
4767 else
4768 novomodules="winvidix $novomodules"
4770 if test "$_vidix" = yes && test "$_x11" = yes; then
4771 xvidix=yes
4772 vomodules="xvidix $vomodules"
4773 else
4774 novomodules="xvidix $novomodules"
4777 echocheck "/dev/mga_vid"
4778 if test "$_mga" = auto ; then
4779 _mga=no
4780 test -c /dev/mga_vid && _mga=yes
4782 if test "$_mga" = yes ; then
4783 def_mga='#define CONFIG_MGA 1'
4784 vomodules="mga $vomodules"
4785 else
4786 def_mga='#undef CONFIG_MGA'
4787 novomodules="mga $novomodules"
4789 echores "$_mga"
4791 echocheck "xmga"
4792 if test "$_xmga" = auto ; then
4793 _xmga=no
4794 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4796 if test "$_xmga" = yes ; then
4797 def_xmga='#define CONFIG_XMGA 1'
4798 vomodules="xmga $vomodules"
4799 else
4800 def_xmga='#undef CONFIG_XMGA'
4801 novomodules="xmga $novomodules"
4803 echores "$_xmga"
4806 echocheck "GGI"
4807 if test "$_ggi" = auto ; then
4808 cat > $TMPC << EOF
4809 #include <ggi/ggi.h>
4810 int main(void) { ggiInit(); return 0; }
4812 _ggi=no
4813 cc_check -lggi && _ggi=yes
4815 if test "$_ggi" = yes ; then
4816 def_ggi='#define CONFIG_GGI 1'
4817 libs_mplayer="$libs_mplayer -lggi"
4818 vomodules="ggi $vomodules"
4819 else
4820 def_ggi='#undef CONFIG_GGI'
4821 novomodules="ggi $novomodules"
4823 echores "$_ggi"
4825 echocheck "GGI extension: libggiwmh"
4826 if test "$_ggiwmh" = auto ; then
4827 _ggiwmh=no
4828 cat > $TMPC << EOF
4829 #include <ggi/ggi.h>
4830 #include <ggi/wmh.h>
4831 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4833 cc_check -lggi -lggiwmh && _ggiwmh=yes
4835 # needed to get right output on obscure combination
4836 # like --disable-ggi --enable-ggiwmh
4837 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4838 def_ggiwmh='#define CONFIG_GGIWMH 1'
4839 libs_mplayer="$libs_mplayer -lggiwmh"
4840 else
4841 _ggiwmh=no
4842 def_ggiwmh='#undef CONFIG_GGIWMH'
4844 echores "$_ggiwmh"
4847 echocheck "AA"
4848 if test "$_aa" = auto ; then
4849 cat > $TMPC << EOF
4850 #include <aalib.h>
4851 extern struct aa_hardware_params aa_defparams;
4852 extern struct aa_renderparams aa_defrenderparams;
4853 int main(void) {
4854 aa_context *c;
4855 aa_renderparams *p;
4856 (void) aa_init(0, 0, 0);
4857 c = aa_autoinit(&aa_defparams);
4858 p = aa_getrenderparams();
4859 aa_autoinitkbd(c,0);
4860 return 0; }
4862 _aa=no
4863 for _ld_tmp in "-laa" ; do
4864 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4865 done
4867 if test "$_aa" = yes ; then
4868 def_aa='#define CONFIG_AA 1'
4869 if cygwin ; then
4870 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4872 vomodules="aa $vomodules"
4873 else
4874 def_aa='#undef CONFIG_AA'
4875 novomodules="aa $novomodules"
4877 echores "$_aa"
4880 echocheck "CACA"
4881 if test "$_caca" = auto ; then
4882 _caca=no
4883 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4884 cat > $TMPC << EOF
4885 #include <caca.h>
4886 #ifdef CACA_API_VERSION_1
4887 #include <caca0.h>
4888 #endif
4889 int main(void) { (void) caca_init(); return 0; }
4891 cc_check $(caca-config --libs) && _caca=yes
4894 if test "$_caca" = yes ; then
4895 def_caca='#define CONFIG_CACA 1'
4896 extra_cflags="$extra_cflags $(caca-config --cflags)"
4897 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4898 vomodules="caca $vomodules"
4899 else
4900 def_caca='#undef CONFIG_CACA'
4901 novomodules="caca $novomodules"
4903 echores "$_caca"
4906 echocheck "SVGAlib"
4907 if test "$_svga" = auto ; then
4908 cat > $TMPC << EOF
4909 #include <vga.h>
4910 int main(void) { return 0; }
4912 _svga=no
4913 cc_check -lvga $_ld_lm && _svga=yes
4915 if test "$_svga" = yes ; then
4916 def_svga='#define CONFIG_SVGALIB 1'
4917 libs_mplayer="$libs_mplayer -lvga"
4918 vomodules="svga $vomodules"
4919 else
4920 def_svga='#undef CONFIG_SVGALIB'
4921 novomodules="svga $novomodules"
4923 echores "$_svga"
4926 echocheck "FBDev"
4927 if test "$_fbdev" = auto ; then
4928 _fbdev=no
4929 linux && _fbdev=yes
4931 if test "$_fbdev" = yes ; then
4932 def_fbdev='#define CONFIG_FBDEV 1'
4933 vomodules="fbdev $vomodules"
4934 else
4935 def_fbdev='#undef CONFIG_FBDEV'
4936 novomodules="fbdev $novomodules"
4938 echores "$_fbdev"
4942 echocheck "DVB"
4943 if test "$_dvb" = auto ; then
4944 _dvb=no
4945 cat >$TMPC << EOF
4946 #include <poll.h>
4947 #include <sys/ioctl.h>
4948 #include <stdio.h>
4949 #include <time.h>
4950 #include <unistd.h>
4951 #include <linux/dvb/dmx.h>
4952 #include <linux/dvb/frontend.h>
4953 #include <linux/dvb/video.h>
4954 #include <linux/dvb/audio.h>
4955 int main(void) {return 0;}
4957 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4958 cc_check $_inc_tmp && _dvb=yes && \
4959 extra_cflags="$extra_cflags $_inc_tmp" && break
4960 done
4962 echores "$_dvb"
4963 if test "$_dvb" = yes ; then
4964 _dvbin=yes
4965 inputmodules="dvb $inputmodules"
4966 def_dvb='#define CONFIG_DVB 1'
4967 def_dvbin='#define CONFIG_DVBIN 1'
4968 aomodules="mpegpes(dvb) $aomodules"
4969 vomodules="mpegpes(dvb) $vomodules"
4970 else
4971 _dvbin=no
4972 _noinputmodules="dvb $_noinputmodules"
4973 def_dvb='#undef CONFIG_DVB'
4974 def_dvbin='#undef CONFIG_DVBIN '
4975 aomodules="mpegpes(file) $aomodules"
4976 vomodules="mpegpes(file) $vomodules"
4980 if darwin; then
4982 echocheck "QuickTime"
4983 if test "$quicktime" = auto ; then
4984 cat > $TMPC <<EOF
4985 #include <QuickTime/QuickTime.h>
4986 int main(void) {
4987 ImageDescription *desc;
4988 EnterMovies();
4989 ExitMovies();
4990 return 0;
4993 quicktime=no
4994 cc_check -framework QuickTime && quicktime=yes
4996 if test "$quicktime" = yes ; then
4997 extra_ldflags="$extra_ldflags -framework QuickTime"
4998 def_quicktime='#define CONFIG_QUICKTIME 1'
4999 else
5000 def_quicktime='#undef CONFIG_QUICKTIME'
5001 _quartz=no
5003 echores $quicktime
5005 echocheck "Quartz"
5006 if test "$_quartz" = auto ; then
5007 cat > $TMPC <<EOF
5008 #include <Carbon/Carbon.h>
5009 int main(void) {
5010 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
5011 return 0;
5014 _quartz=no
5015 cc_check -framework Carbon && _quartz=yes
5017 if test "$_quartz" = yes ; then
5018 libs_mplayer="$libs_mplayer -framework Carbon"
5019 def_quartz='#define CONFIG_QUARTZ 1'
5020 vomodules="quartz $vomodules"
5021 else
5022 def_quartz='#undef CONFIG_QUARTZ'
5023 novomodules="quartz $novomodules"
5025 echores $_quartz
5027 echocheck "CoreVideo"
5028 if test "$_corevideo" = auto ; then
5029 cat > $TMPC <<EOF
5030 #include <Carbon/Carbon.h>
5031 #include <CoreServices/CoreServices.h>
5032 #include <OpenGL/OpenGL.h>
5033 #include <QuartzCore/CoreVideo.h>
5034 int main(void) { return 0; }
5036 _corevideo=no
5037 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
5039 if test "$_corevideo" = yes ; then
5040 vomodules="corevideo $vomodules"
5041 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
5042 def_corevideo='#define CONFIG_COREVIDEO 1'
5043 else
5044 novomodules="corevideo $novomodules"
5045 def_corevideo='#undef CONFIG_COREVIDEO'
5047 echores "$_corevideo"
5049 fi #if darwin
5052 echocheck "PNG support"
5053 if test "$_png" = auto ; then
5054 _png=no
5055 if irix ; then
5056 # Don't check for -lpng on irix since it has its own libpng
5057 # incompatible with the GNU libpng
5058 res_comment="disabled on irix (not GNU libpng)"
5059 else
5060 cat > $TMPC << EOF
5061 #include <png.h>
5062 #include <string.h>
5063 int main(void) {
5064 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
5065 printf("libpng: %s\n", png_libpng_ver);
5066 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
5069 cc_check -lpng -lz $_ld_lm && _png=yes
5072 echores "$_png"
5073 if test "$_png" = yes ; then
5074 def_png='#define CONFIG_PNG 1'
5075 extra_ldflags="$extra_ldflags -lpng -lz"
5076 else
5077 def_png='#undef CONFIG_PNG'
5080 echocheck "MNG support"
5081 if test "$_mng" = auto ; then
5082 _mng=no
5083 cat > $TMPC << EOF
5084 #include <libmng.h>
5085 int main(void) {
5086 const char * p_ver = mng_version_text();
5087 return !p_ver || p_ver[0] == 0;
5090 if cc_check -lmng -lz $_ld_lm ; then
5091 _mng=yes
5094 echores "$_mng"
5095 if test "$_mng" = yes ; then
5096 def_mng='#define CONFIG_MNG 1'
5097 extra_ldflags="$extra_ldflags -lmng -lz"
5098 else
5099 def_mng='#undef CONFIG_MNG'
5102 echocheck "JPEG support"
5103 if test "$_jpeg" = auto ; then
5104 _jpeg=no
5105 cat > $TMPC << EOF
5106 #include <stdio.h>
5107 #include <stdlib.h>
5108 #include <setjmp.h>
5109 #include <string.h>
5110 #include <jpeglib.h>
5111 int main(void) { return 0; }
5113 cc_check -ljpeg $_ld_lm && _jpeg=yes
5115 echores "$_jpeg"
5117 if test "$_jpeg" = yes ; then
5118 def_jpeg='#define CONFIG_JPEG 1'
5119 vomodules="jpeg $vomodules"
5120 extra_ldflags="$extra_ldflags -ljpeg"
5121 else
5122 def_jpeg='#undef CONFIG_JPEG'
5123 novomodules="jpeg $novomodules"
5127 echocheck "OpenJPEG (JPEG2000) support"
5128 if test "$libopenjpeg" = auto ; then
5129 libopenjpeg=no
5130 cat > $TMPC << EOF
5131 #define OPJ_STATIC
5132 #include <openjpeg.h>
5133 int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
5135 cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
5137 echores "$libopenjpeg"
5138 if test "$libopenjpeg" = yes ; then
5139 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
5140 extra_ldflags="$extra_ldflags -lopenjpeg"
5141 _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
5142 _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
5143 codecmodules="OpenJPEG $codecmodules"
5144 else
5145 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
5146 nocodecmodules="OpenJPEG $nocodecmodules"
5150 echocheck "PNM support"
5151 if test "$_pnm" = yes; then
5152 def_pnm="#define CONFIG_PNM 1"
5153 vomodules="pnm $vomodules"
5154 else
5155 def_pnm="#undef CONFIG_PNM"
5156 novomodules="pnm $novomodules"
5158 echores "$_pnm"
5162 echocheck "GIF support"
5163 # This is to appease people who want to force gif support.
5164 # If it is forced to yes, then we still do checks to determine
5165 # which gif library to use.
5166 if test "$_gif" = yes ; then
5167 _force_gif=yes
5168 _gif=auto
5171 if test "$_gif" = auto ; then
5172 _gif=no
5173 cat > $TMPC << EOF
5174 #include <gif_lib.h>
5175 int main(void) { return 0; }
5177 for _ld_gif in "-lungif" "-lgif" ; do
5178 cc_check $_ld_gif && _gif=yes && break
5179 done
5182 # If no library was found, and the user wants support forced,
5183 # then we force it on with libgif, as this is the safest
5184 # assumption IMHO. (libungif & libregif both create symbolic
5185 # links to libgif. We also assume that no x11 support is needed,
5186 # because if you are forcing this, then you _should_ know what
5187 # you are doing. [ Besides, package maintainers should never
5188 # have compiled x11 deps into libungif in the first place. ] )
5189 # </rant>
5190 # --Joey
5191 if test "$_force_gif" = yes && test "$_gif" = no ; then
5192 _gif=yes
5193 _ld_gif="-lgif"
5196 if test "$_gif" = yes ; then
5197 def_gif='#define CONFIG_GIF 1'
5198 codecmodules="gif $codecmodules"
5199 vomodules="gif89a $vomodules"
5200 res_comment="old version, some encoding functions disabled"
5201 def_gif_4='#undef CONFIG_GIF_4'
5202 extra_ldflags="$extra_ldflags $_ld_gif"
5204 cat > $TMPC << EOF
5205 #include <signal.h>
5206 #include <gif_lib.h>
5207 void catch() { exit(1); }
5208 int main(void) {
5209 signal(SIGSEGV, catch); // catch segfault
5210 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5211 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5212 return 0;
5215 if cc_check "$_ld_gif" ; then
5216 def_gif_4='#define CONFIG_GIF_4 1'
5217 res_comment=""
5219 else
5220 def_gif='#undef CONFIG_GIF'
5221 def_gif_4='#undef CONFIG_GIF_4'
5222 novomodules="gif89a $novomodules"
5223 nocodecmodules="gif $nocodecmodules"
5225 echores "$_gif"
5228 case "$_gif" in yes*)
5229 echocheck "broken giflib workaround"
5230 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5232 cat > $TMPC << EOF
5233 #include <gif_lib.h>
5234 int main(void) {
5235 GifFileType gif;
5236 printf("UserData is at address %p\n", gif.UserData);
5237 return 0;
5240 if cc_check "$_ld_gif" ; then
5241 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5242 echores "disabled"
5243 else
5244 echores "enabled"
5247 esac
5250 echocheck "VESA support"
5251 if test "$_vesa" = auto ; then
5252 cat > $TMPC << EOF
5253 #include <vbe.h>
5254 int main(void) { vbeVersion(); return 0; }
5256 _vesa=no
5257 cc_check -lvbe -llrmi && _vesa=yes
5259 if test "$_vesa" = yes ; then
5260 def_vesa='#define CONFIG_VESA 1'
5261 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5262 vomodules="vesa $vomodules"
5263 else
5264 def_vesa='#undef CONFIG_VESA'
5265 novomodules="vesa $novomodules"
5267 echores "$_vesa"
5269 #################
5270 # VIDEO + AUDIO #
5271 #################
5274 echocheck "SDL"
5275 _inc_tmp=""
5276 _ld_tmp=""
5277 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5278 if test -z "$_sdlconfig" ; then
5279 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5280 _sdlconfig="sdl-config"
5281 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5282 _sdlconfig="sdl11-config"
5283 else
5284 _sdlconfig=false
5287 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5288 cat > $TMPC << EOF
5289 #ifdef CONFIG_SDL_SDL_H
5290 #include <SDL/SDL.h>
5291 #else
5292 #include <SDL.h>
5293 #endif
5294 #ifndef __APPLE__
5295 // we allow SDL hacking our main() only on OSX
5296 #undef main
5297 #endif
5298 int main(int argc, char *argv[]) {
5299 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5300 return 0;
5303 _sdl=no
5304 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
5305 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5306 _sdl=yes
5307 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5308 break
5310 done
5311 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5312 res_comment="using $_sdlconfig"
5313 if cygwin ; then
5314 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5315 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5316 elif mingw32 ; then
5317 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5318 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5319 else
5320 _inc_tmp="$($_sdlconfig --cflags)"
5321 _ld_tmp="$($_sdlconfig --libs)"
5323 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5324 _sdl=yes
5328 if test "$_sdl" = yes ; then
5329 def_sdl='#define CONFIG_SDL 1'
5330 extra_cflags="$extra_cflags $_inc_tmp"
5331 libs_mplayer="$libs_mplayer $_ld_tmp"
5332 vomodules="sdl $vomodules"
5333 aomodules="sdl $aomodules"
5334 else
5335 def_sdl='#undef CONFIG_SDL'
5336 novomodules="sdl $novomodules"
5337 noaomodules="sdl $noaomodules"
5339 echores "$_sdl"
5342 # make sure this stays below CoreVideo to avoid issues due to namespace
5343 # conflicts between -lGL and -framework OpenGL
5344 echocheck "OpenGL"
5345 #Note: this test is run even with --enable-gl since we autodetect linker flags
5346 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
5347 cat > $TMPC << EOF
5348 #ifdef GL_WIN32
5349 #include <windows.h>
5350 #include <GL/gl.h>
5351 #elif defined(GL_SDL)
5352 #include <GL/gl.h>
5353 #ifdef CONFIG_SDL_SDL_H
5354 #include <SDL/SDL.h>
5355 #else
5356 #include <SDL.h>
5357 #endif
5358 #ifndef __APPLE__
5359 // we allow SDL hacking our main() only on OSX
5360 #undef main
5361 #endif
5362 #else
5363 #include <GL/gl.h>
5364 #include <X11/Xlib.h>
5365 #include <GL/glx.h>
5366 #endif
5367 int main(void) {
5368 #ifdef GL_WIN32
5369 HDC dc;
5370 wglCreateContext(dc);
5371 #elif defined(GL_SDL)
5372 SDL_GL_SwapBuffers();
5373 #else
5374 glXCreateContext(NULL, NULL, NULL, True);
5375 #endif
5376 glFinish();
5377 return 0;
5380 _gl=no
5381 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
5382 if cc_check $_ld_tmp $_ld_lm ; then
5383 _gl=yes
5384 _gl_x11=yes
5385 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
5386 break
5388 done
5389 if cc_check -DGL_WIN32 -lopengl32 ; then
5390 _gl=yes
5391 _gl_win32=yes
5392 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
5394 # last so it can reuse any linker etc. flags detected before
5395 if test "$_sdl" = yes ; then
5396 if cc_check -DGL_SDL ||
5397 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
5398 _gl=yes
5399 _gl_sdl=yes
5400 elif cc_check -DGL_SDL -lGL ||
5401 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
5402 _gl=yes
5403 _gl_sdl=yes
5404 libs_mplayer="$libs_mplayer -lGL"
5407 else
5408 _gl=no
5410 if test "$_gl" = yes ; then
5411 def_gl='#define CONFIG_GL 1'
5412 res_comment="backends:"
5413 if test "$_gl_win32" = yes ; then
5414 def_gl_win32='#define CONFIG_GL_WIN32 1'
5415 res_comment="$res_comment win32"
5417 if test "$_gl_x11" = yes ; then
5418 def_gl_x11='#define CONFIG_GL_X11 1'
5419 res_comment="$res_comment x11"
5421 if test "$_gl_sdl" = yes ; then
5422 def_gl_sdl='#define CONFIG_GL_SDL 1'
5423 res_comment="$res_comment sdl"
5425 vomodules="opengl $vomodules"
5426 else
5427 def_gl='#undef CONFIG_GL'
5428 def_gl_win32='#undef CONFIG_GL_WIN32'
5429 def_gl_x11='#undef CONFIG_GL_X11'
5430 def_gl_sdl='#undef CONFIG_GL_SDL'
5431 novomodules="opengl $novomodules"
5433 echores "$_gl"
5436 echocheck "MatrixView"
5437 if test "$_gl" = no ; then
5438 matrixview=no
5440 if test "$matrixview" = yes ; then
5441 vomodules="matrixview $vomodules"
5442 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5443 else
5444 novomodules="matrixview $novomodules"
5445 def_matrixview='#undef CONFIG_MATRIXVIEW'
5447 echores "$matrixview"
5450 if os2 ; then
5451 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5452 if test "$_kva" = auto; then
5453 cat > $TMPC << EOF
5454 #include <os2.h>
5455 #include <kva.h>
5456 int main( void ) { return 0; }
5458 _kva=no;
5459 cc_check -lkva && _kva=yes
5461 if test "$_kva" = yes ; then
5462 def_kva='#define CONFIG_KVA 1'
5463 libs_mplayer="$libs_mplayer -lkva"
5464 vomodules="kva $vomodules"
5465 else
5466 def_kva='#undef CONFIG_KVA'
5467 novomodules="kva $novomodules"
5469 echores "$_kva"
5470 fi #if os2
5473 if win32; then
5475 echocheck "Windows waveout"
5476 if test "$_win32waveout" = auto ; then
5477 cat > $TMPC << EOF
5478 #include <windows.h>
5479 #include <mmsystem.h>
5480 int main(void) { return 0; }
5482 _win32waveout=no
5483 cc_check -lwinmm && _win32waveout=yes
5485 if test "$_win32waveout" = yes ; then
5486 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5487 libs_mplayer="$libs_mplayer -lwinmm"
5488 aomodules="win32 $aomodules"
5489 else
5490 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5491 noaomodules="win32 $noaomodules"
5493 echores "$_win32waveout"
5495 echocheck "Direct3D"
5496 if test "$_direct3d" = auto ; then
5497 cat > $TMPC << EOF
5498 #include <windows.h>
5499 #include <d3d9.h>
5500 int main(void) { return 0; }
5502 _direct3d=no
5503 cc_check && _direct3d=yes
5505 if test "$_direct3d" = yes ; then
5506 def_direct3d='#define CONFIG_DIRECT3D 1'
5507 vomodules="direct3d $vomodules"
5508 else
5509 def_direct3d='#undef CONFIG_DIRECT3D'
5510 novomodules="direct3d $novomodules"
5512 echores "$_direct3d"
5514 echocheck "Directx"
5515 if test "$_directx" = auto ; then
5516 cat > $TMPC << EOF
5517 #include <windows.h>
5518 #include <ddraw.h>
5519 #include <dsound.h>
5520 int main(void) { return 0; }
5522 _directx=no
5523 cc_check -lgdi32 && _directx=yes
5525 if test "$_directx" = yes ; then
5526 def_directx='#define CONFIG_DIRECTX 1'
5527 libs_mplayer="$libs_mplayer -lgdi32"
5528 vomodules="directx $vomodules"
5529 aomodules="dsound $aomodules"
5530 else
5531 def_directx='#undef CONFIG_DIRECTX'
5532 novomodules="directx $novomodules"
5533 noaomodules="dsound $noaomodules"
5535 echores "$_directx"
5537 fi #if win32; then
5540 echocheck "DXR2"
5541 if test "$_dxr2" = auto; then
5542 _dxr2=no
5543 cat > $TMPC << EOF
5544 #include <dxr2ioctl.h>
5545 int main(void) { return 0; }
5547 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5548 cc_check $_inc_tmp && _dxr2=yes && \
5549 extra_cflags="$extra_cflags $_inc_tmp" && break
5550 done
5552 if test "$_dxr2" = yes; then
5553 def_dxr2='#define CONFIG_DXR2 1'
5554 aomodules="dxr2 $aomodules"
5555 vomodules="dxr2 $vomodules"
5556 else
5557 def_dxr2='#undef CONFIG_DXR2'
5558 noaomodules="dxr2 $noaomodules"
5559 novomodules="dxr2 $novomodules"
5561 echores "$_dxr2"
5563 echocheck "DXR3/H+"
5564 if test "$_dxr3" = auto ; then
5565 cat > $TMPC << EOF
5566 #include <linux/em8300.h>
5567 int main(void) { return 0; }
5569 _dxr3=no
5570 cc_check && _dxr3=yes
5572 if test "$_dxr3" = yes ; then
5573 def_dxr3='#define CONFIG_DXR3 1'
5574 vomodules="dxr3 $vomodules"
5575 else
5576 def_dxr3='#undef CONFIG_DXR3'
5577 novomodules="dxr3 $novomodules"
5579 echores "$_dxr3"
5582 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5583 if test "$_ivtv" = auto ; then
5584 cat > $TMPC << EOF
5585 #include <stdlib.h>
5586 #include <inttypes.h>
5587 #include <linux/types.h>
5588 #include <linux/videodev2.h>
5589 #include <linux/ivtv.h>
5590 #include <sys/ioctl.h>
5591 int main(void) {
5592 struct ivtv_cfg_stop_decode sd;
5593 struct ivtv_cfg_start_decode sd1;
5594 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5595 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5596 return 0; }
5598 _ivtv=no
5599 cc_check && _ivtv=yes
5601 if test "$_ivtv" = yes ; then
5602 def_ivtv='#define CONFIG_IVTV 1'
5603 vomodules="ivtv $vomodules"
5604 aomodules="ivtv $aomodules"
5605 else
5606 def_ivtv='#undef CONFIG_IVTV'
5607 novomodules="ivtv $novomodules"
5608 noaomodules="ivtv $noaomodules"
5610 echores "$_ivtv"
5613 echocheck "V4L2 MPEG Decoder"
5614 if test "$_v4l2" = auto ; then
5615 cat > $TMPC << EOF
5616 #include <stdlib.h>
5617 #include <inttypes.h>
5618 #include <linux/types.h>
5619 #include <linux/videodev2.h>
5620 #include <linux/version.h>
5621 int main(void) {
5622 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5623 #error kernel headers too old, need 2.6.22
5624 #endif
5625 struct v4l2_ext_controls ctrls;
5626 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5627 return 0;
5630 _v4l2=no
5631 cc_check && _v4l2=yes
5633 if test "$_v4l2" = yes ; then
5634 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5635 vomodules="v4l2 $vomodules"
5636 aomodules="v4l2 $aomodules"
5637 else
5638 def_v4l2='#undef CONFIG_V4L2_DECODER'
5639 novomodules="v4l2 $novomodules"
5640 noaomodules="v4l2 $noaomodules"
5642 echores "$_v4l2"
5646 #########
5647 # AUDIO #
5648 #########
5651 echocheck "OSS Audio"
5652 if test "$_ossaudio" = auto ; then
5653 cat > $TMPC << EOF
5654 #include <sys/ioctl.h>
5655 #include <$_soundcard_header>
5656 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5658 _ossaudio=no
5659 cc_check && _ossaudio=yes
5661 if test "$_ossaudio" = yes ; then
5662 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5663 aomodules="oss $aomodules"
5664 if test "$_linux_devfs" = yes; then
5665 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5666 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5667 else
5668 cat > $TMPC << EOF
5669 #include <sys/ioctl.h>
5670 #include <$_soundcard_header>
5671 #ifdef OPEN_SOUND_SYSTEM
5672 int main(void) { return 0; }
5673 #else
5674 #error Not the real thing
5675 #endif
5677 _real_ossaudio=no
5678 cc_check && _real_ossaudio=yes
5679 if test "$_real_ossaudio" = yes; then
5680 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5681 elif netbsd || openbsd ; then
5682 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5683 extra_ldflags="$extra_ldflags -lossaudio"
5684 else
5685 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5687 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5689 else
5690 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5691 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5692 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5693 noaomodules="oss $noaomodules"
5695 echores "$_ossaudio"
5698 echocheck "aRts"
5699 if test "$_arts" = auto ; then
5700 _arts=no
5701 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5703 cat > $TMPC << EOF
5704 #include <artsc.h>
5705 int main(void) { return 0; }
5707 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5712 if test "$_arts" = yes ; then
5713 def_arts='#define CONFIG_ARTS 1'
5714 aomodules="arts $aomodules"
5715 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5716 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5717 else
5718 noaomodules="arts $noaomodules"
5720 echores "$_arts"
5723 echocheck "EsounD"
5724 if test "$_esd" = auto ; then
5725 _esd=no
5726 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5728 cat > $TMPC << EOF
5729 #include <esd.h>
5730 int main(void) { int fd = esd_open_sound("test"); return fd; }
5732 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5736 echores "$_esd"
5738 if test "$_esd" = yes ; then
5739 def_esd='#define CONFIG_ESD 1'
5740 aomodules="esd $aomodules"
5741 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5742 extra_cflags="$extra_cflags $(esd-config --cflags)"
5744 echocheck "esd_get_latency()"
5745 cat > $TMPC << EOF
5746 #include <esd.h>
5747 int main(void) { return esd_get_latency(0); }
5749 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5750 echores "$_esd_latency"
5751 else
5752 def_esd='#undef CONFIG_ESD'
5753 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5754 noaomodules="esd $noaomodules"
5758 echocheck "NAS"
5759 if test "$_nas" = auto ; then
5760 cat > $TMPC << EOF
5761 #include <audio/audiolib.h>
5762 int main(void) { return 0; }
5764 _nas=no
5765 cc_check $_ld_lm -laudio -lXt && _nas=yes
5767 if test "$_nas" = yes ; then
5768 def_nas='#define CONFIG_NAS 1'
5769 libs_mplayer="$libs_mplayer -laudio -lXt"
5770 aomodules="nas $aomodules"
5771 else
5772 noaomodules="nas $noaomodules"
5773 def_nas='#undef CONFIG_NAS'
5775 echores "$_nas"
5778 echocheck "pulse"
5779 if test "$_pulse" = auto ; then
5780 _pulse=no
5781 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5783 cat > $TMPC << EOF
5784 #include <pulse/pulseaudio.h>
5785 int main(void) { return 0; }
5787 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5791 echores "$_pulse"
5793 if test "$_pulse" = yes ; then
5794 def_pulse='#define CONFIG_PULSE 1'
5795 aomodules="pulse $aomodules"
5796 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5797 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5798 else
5799 def_pulse='#undef CONFIG_PULSE'
5800 noaomodules="pulse $noaomodules"
5804 echocheck "JACK"
5805 if test "$_jack" = auto ; then
5806 _jack=yes
5808 cat > $TMPC << EOF
5809 #include <jack/jack.h>
5810 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5812 if cc_check -ljack ; then
5813 libs_mplayer="$libs_mplayer -ljack"
5814 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5815 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5816 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5817 else
5818 _jack=no
5822 if test "$_jack" = yes ; then
5823 def_jack='#define CONFIG_JACK 1'
5824 aomodules="jack $aomodules"
5825 else
5826 noaomodules="jack $noaomodules"
5828 echores "$_jack"
5830 echocheck "OpenAL"
5831 if test "$_openal" = auto ; then
5832 _openal=no
5833 cat > $TMPC << EOF
5834 #ifdef OPENAL_AL_H
5835 #include <OpenAL/al.h>
5836 #else
5837 #include <AL/al.h>
5838 #endif
5839 int main(void) {
5840 alSourceQueueBuffers(0, 0, 0);
5841 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5842 return 0;
5845 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5846 cc_check $I && _openal=yes && break
5847 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5848 done
5849 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5851 if test "$_openal" = yes ; then
5852 def_openal='#define CONFIG_OPENAL 1'
5853 aomodules="openal $aomodules"
5854 else
5855 noaomodules="openal $noaomodules"
5857 echores "$_openal"
5859 echocheck "ALSA audio"
5860 if test "$_alloca" != yes ; then
5861 _alsa=no
5862 res_comment="alloca missing"
5864 if test "$_alsa" != no ; then
5865 _alsa=no
5866 cat > $TMPC << EOF
5867 #include <sys/time.h>
5868 #include <sys/asoundlib.h>
5869 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5870 #error "alsa version != 0.5.x"
5871 #endif
5872 int main(void) { return 0; }
5874 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5876 cat > $TMPC << EOF
5877 #include <sys/time.h>
5878 #include <sys/asoundlib.h>
5879 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5880 #error "alsa version != 0.9.x"
5881 #endif
5882 int main(void) { return 0; }
5884 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5885 cat > $TMPC << EOF
5886 #include <sys/time.h>
5887 #include <alsa/asoundlib.h>
5888 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5889 #error "alsa version != 0.9.x"
5890 #endif
5891 int main(void) { return 0; }
5893 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5895 cat > $TMPC << EOF
5896 #include <sys/time.h>
5897 #include <sys/asoundlib.h>
5898 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5899 #error "alsa version != 1.0.x"
5900 #endif
5901 int main(void) { return 0; }
5903 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5904 cat > $TMPC << EOF
5905 #include <sys/time.h>
5906 #include <alsa/asoundlib.h>
5907 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5908 #error "alsa version != 1.0.x"
5909 #endif
5910 int main(void) { return 0; }
5912 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5914 def_alsa='#undef CONFIG_ALSA'
5915 def_alsa5='#undef CONFIG_ALSA5'
5916 def_alsa9='#undef CONFIG_ALSA9'
5917 def_alsa1x='#undef CONFIG_ALSA1X'
5918 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5919 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5920 if test "$_alsaver" ; then
5921 _alsa=yes
5922 if test "$_alsaver" = '0.5.x' ; then
5923 _alsa5=yes
5924 aomodules="alsa5 $aomodules"
5925 def_alsa5='#define CONFIG_ALSA5 1'
5926 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5927 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5928 elif test "$_alsaver" = '0.9.x-sys' ; then
5929 _alsa9=yes
5930 aomodules="alsa $aomodules"
5931 def_alsa='#define CONFIG_ALSA 1'
5932 def_alsa9='#define CONFIG_ALSA9 1'
5933 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5934 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5935 elif test "$_alsaver" = '0.9.x-alsa' ; then
5936 _alsa9=yes
5937 aomodules="alsa $aomodules"
5938 def_alsa='#define CONFIG_ALSA 1'
5939 def_alsa9='#define CONFIG_ALSA9 1'
5940 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5941 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5942 elif test "$_alsaver" = '1.0.x-sys' ; then
5943 _alsa1x=yes
5944 aomodules="alsa $aomodules"
5945 def_alsa='#define CONFIG_ALSA 1'
5946 def_alsa1x="#define CONFIG_ALSA1X 1"
5947 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5948 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5949 elif test "$_alsaver" = '1.0.x-alsa' ; then
5950 _alsa1x=yes
5951 aomodules="alsa $aomodules"
5952 def_alsa='#define CONFIG_ALSA 1'
5953 def_alsa1x="#define CONFIG_ALSA1X 1"
5954 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5955 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5956 else
5957 _alsa=no
5958 res_comment="unknown version"
5960 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5961 else
5962 noaomodules="alsa $noaomodules"
5964 echores "$_alsa"
5967 echocheck "Sun audio"
5968 if test "$_sunaudio" = auto ; then
5969 cat > $TMPC << EOF
5970 #include <sys/types.h>
5971 #include <sys/audioio.h>
5972 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5974 _sunaudio=no
5975 cc_check && _sunaudio=yes
5977 if test "$_sunaudio" = yes ; then
5978 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5979 aomodules="sun $aomodules"
5980 else
5981 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5982 noaomodules="sun $noaomodules"
5984 echores "$_sunaudio"
5987 def_mlib='#define CONFIG_MLIB 0'
5988 if sunos; then
5989 echocheck "Sun mediaLib"
5990 if test "$_mlib" = auto ; then
5991 _mlib=no
5992 cat > $TMPC << EOF
5993 #include <mlib.h>
5994 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5996 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5998 echores "$_mlib"
5999 fi #if sunos
6002 if darwin; then
6003 echocheck "CoreAudio"
6004 if test "$_coreaudio" = auto ; then
6005 cat > $TMPC <<EOF
6006 #include <CoreAudio/CoreAudio.h>
6007 #include <AudioToolbox/AudioToolbox.h>
6008 #include <AudioUnit/AudioUnit.h>
6009 int main(void) { return 0; }
6011 _coreaudio=no
6012 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
6014 if test "$_coreaudio" = yes ; then
6015 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
6016 def_coreaudio='#define CONFIG_COREAUDIO 1'
6017 aomodules="coreaudio $aomodules"
6018 else
6019 def_coreaudio='#undef CONFIG_COREAUDIO'
6020 noaomodules="coreaudio $noaomodules"
6022 echores $_coreaudio
6023 fi #if darwin
6026 if irix; then
6027 echocheck "SGI audio"
6028 if test "$_sgiaudio" = auto ; then
6029 # check for SGI audio
6030 cat > $TMPC << EOF
6031 #include <dmedia/audio.h>
6032 int main(void) { return 0; }
6034 _sgiaudio=no
6035 cc_check && _sgiaudio=yes
6037 if test "$_sgiaudio" = "yes" ; then
6038 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
6039 libs_mplayer="$libs_mplayer -laudio"
6040 aomodules="sgi $aomodules"
6041 else
6042 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
6043 noaomodules="sgi $noaomodules"
6045 echores "$_sgiaudio"
6046 fi #if irix
6049 if os2 ; then
6050 echocheck "KAI (UNIAUD/DART)"
6051 if test "$_kai" = auto; then
6052 cat > $TMPC << EOF
6053 #include <os2.h>
6054 #include <kai.h>
6055 int main(void) { return 0; }
6057 _kai=no;
6058 cc_check -lkai && _kai=yes
6060 if test "$_kai" = yes ; then
6061 def_kai='#define CONFIG_KAI 1'
6062 libs_mplayer="$libs_mplayer -lkai"
6063 aomodules="kai $aomodules"
6064 else
6065 def_kai='#undef CONFIG_KAI'
6066 noaomodules="kai $noaomodules"
6068 echores "$_kai"
6070 echocheck "DART"
6071 if test "$_dart" = auto; then
6072 cat > $TMPC << EOF
6073 #include <os2.h>
6074 #include <dart.h>
6075 int main( void ) { return 0; }
6077 _dart=no;
6078 cc_check -ldart && _dart=yes
6080 if test "$_dart" = yes ; then
6081 def_dart='#define CONFIG_DART 1'
6082 libs_mplayer="$libs_mplayer -ldart"
6083 aomodules="dart $aomodules"
6084 else
6085 def_dart='#undef CONFIG_DART'
6086 noaomodules="dart $noaomodules"
6088 echores "$_dart"
6089 fi #if os2
6092 # set default CD/DVD devices
6093 if win32 || os2 ; then
6094 default_cdrom_device="D:"
6095 elif darwin ; then
6096 default_cdrom_device="/dev/disk1"
6097 elif dragonfly ; then
6098 default_cdrom_device="/dev/cd0"
6099 elif freebsd ; then
6100 default_cdrom_device="/dev/acd0"
6101 elif openbsd ; then
6102 default_cdrom_device="/dev/rcd0a"
6103 elif sunos ; then
6104 default_cdrom_device="/vol/dev/aliases/cdrom0"
6105 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
6106 # file system and the volfs service.
6107 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
6108 elif amigaos ; then
6109 default_cdrom_device="a1ide.device:2"
6110 else
6111 default_cdrom_device="/dev/cdrom"
6114 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
6115 default_dvd_device=$default_cdrom_device
6116 elif darwin ; then
6117 default_dvd_device="/dev/rdiskN"
6118 else
6119 default_dvd_device="/dev/dvd"
6123 echocheck "VCD support"
6124 if test "$_vcd" = auto; then
6125 _vcd=no
6126 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
6127 _vcd=yes
6128 elif mingw32; then
6129 cat > $TMPC << EOF
6130 #include <ddk/ntddcdrm.h>
6131 int main(void) { return 0; }
6133 cc_check && _vcd=yes
6136 if test "$_vcd" = yes; then
6137 inputmodules="vcd $inputmodules"
6138 def_vcd='#define CONFIG_VCD 1'
6139 else
6140 def_vcd='#undef CONFIG_VCD'
6141 _noinputmodules="vcd $_noinputmodules"
6142 res_comment="not supported on this OS"
6144 echores "$_vcd"
6148 echocheck "dvdread"
6149 if test "$_dvdread_internal" = auto ; then
6150 _dvdread_internal=no
6151 _dvdread=no
6152 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
6153 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
6154 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
6155 || darwin || win32 || os2; then
6156 _dvdread_internal=yes
6157 _dvdread=yes
6158 extra_cflags="-Ilibdvdread4 $extra_cflags"
6160 elif test "$_dvdread" = auto ; then
6161 _dvdread=no
6162 if test "$_dl" = yes; then
6163 cat > $TMPC << EOF
6164 #include <inttypes.h>
6165 #include <dvdread/dvd_reader.h>
6166 #include <dvdread/ifo_types.h>
6167 #include <dvdread/ifo_read.h>
6168 #include <dvdread/nav_read.h>
6169 int main(void) { return 0; }
6171 _dvdreadcflags=$($_dvdreadconfig --cflags)
6172 _dvdreadlibs=$($_dvdreadconfig --libs)
6173 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
6174 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
6175 _dvdread=yes
6176 extra_cflags="$extra_cflags $_dvdreadcflags"
6177 extra_ldflags="$extra_ldflags $_dvdreadlibs"
6178 res_comment="external"
6183 if test "$_dvdread_internal" = yes; then
6184 def_dvdread='#define CONFIG_DVDREAD 1'
6185 inputmodules="dvdread(internal) $inputmodules"
6186 _largefiles=yes
6187 res_comment="internal"
6188 elif test "$_dvdread" = yes; then
6189 def_dvdread='#define CONFIG_DVDREAD 1'
6190 _largefiles=yes
6191 extra_ldflags="$extra_ldflags -ldvdread"
6192 inputmodules="dvdread(external) $inputmodules"
6193 res_comment="external"
6194 else
6195 def_dvdread='#undef CONFIG_DVDREAD'
6196 _noinputmodules="dvdread $_noinputmodules"
6198 echores "$_dvdread"
6201 echocheck "internal libdvdcss"
6202 if test "$_libdvdcss_internal" = auto ; then
6203 _libdvdcss_internal=no
6204 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
6205 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
6207 if test "$_libdvdcss_internal" = yes ; then
6208 if linux || netbsd || openbsd || bsdos ; then
6209 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
6210 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
6211 elif freebsd || dragonfly ; then
6212 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
6213 elif darwin ; then
6214 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
6215 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
6216 elif cygwin ; then
6217 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
6218 elif beos ; then
6219 cflags_libdvdcss="-DSYS_BEOS"
6220 elif os2 ; then
6221 cflags_libdvdcss="-DSYS_OS2"
6223 cflags_libdvdcss_dvdread="-Ilibdvdcss"
6224 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
6225 inputmodules="libdvdcss(internal) $inputmodules"
6226 _largefiles=yes
6227 else
6228 _noinputmodules="libdvdcss(internal) $_noinputmodules"
6230 echores "$_libdvdcss_internal"
6233 echocheck "cdparanoia"
6234 if test "$_cdparanoia" = auto ; then
6235 cat > $TMPC <<EOF
6236 #include <cdda_interface.h>
6237 #include <cdda_paranoia.h>
6238 // This need a better test. How ?
6239 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
6241 _cdparanoia=no
6242 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
6243 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
6244 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
6245 done
6247 if test "$_cdparanoia" = yes ; then
6248 _cdda='yes'
6249 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
6250 openbsd && extra_ldflags="$extra_ldflags -lutil"
6252 echores "$_cdparanoia"
6255 echocheck "libcdio"
6256 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
6257 cat > $TMPC << EOF
6258 #include <stdio.h>
6259 #include <cdio/version.h>
6260 #include <cdio/cdda.h>
6261 #include <cdio/paranoia.h>
6262 int main(void) {
6263 void *test = cdda_verbose_set;
6264 printf("%s\n", CDIO_VERSION);
6265 return test == (void *)1;
6268 _libcdio=no
6269 for _ld_tmp in "" "-lwinmm" ; do
6270 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6271 cc_check $_ld_tmp $_ld_lm \
6272 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6273 done
6274 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6275 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6276 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6277 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6278 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6281 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6282 _cdda='yes'
6283 def_libcdio='#define CONFIG_LIBCDIO 1'
6284 def_havelibcdio='yes'
6285 else
6286 if test "$_cdparanoia" = yes ; then
6287 res_comment="using cdparanoia"
6289 def_libcdio='#undef CONFIG_LIBCDIO'
6290 def_havelibcdio='no'
6292 echores "$_libcdio"
6294 if test "$_cdda" = yes ; then
6295 test $_cddb = auto && test $_network = yes && _cddb=yes
6296 def_cdparanoia='#define CONFIG_CDDA 1'
6297 inputmodules="cdda $inputmodules"
6298 else
6299 def_cdparanoia='#undef CONFIG_CDDA'
6300 _noinputmodules="cdda $_noinputmodules"
6303 if test "$_cddb" = yes ; then
6304 def_cddb='#define CONFIG_CDDB 1'
6305 inputmodules="cddb $inputmodules"
6306 else
6307 _cddb=no
6308 def_cddb='#undef CONFIG_CDDB'
6309 _noinputmodules="cddb $_noinputmodules"
6312 echocheck "bitmap font support"
6313 if test "$_bitmap_font" = yes ; then
6314 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6315 else
6316 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6318 echores "$_bitmap_font"
6321 echocheck "freetype >= 2.0.9"
6323 # freetype depends on iconv
6324 if test "$_iconv" = no ; then
6325 _freetype=no
6326 res_comment="iconv support needed"
6329 if test "$_freetype" = auto ; then
6330 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6331 cat > $TMPC << EOF
6332 #include <stdio.h>
6333 #include <ft2build.h>
6334 #include FT_FREETYPE_H
6335 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6336 #error "Need FreeType 2.0.9 or newer"
6337 #endif
6338 int main(void) {
6339 FT_Library library;
6340 FT_Int major=-1,minor=-1,patch=-1;
6341 int err=FT_Init_FreeType(&library);
6342 return 0;
6345 _freetype=no
6346 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6347 else
6348 _freetype=no
6351 if test "$_freetype" = yes ; then
6352 def_freetype='#define CONFIG_FREETYPE 1'
6353 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6354 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6355 else
6356 def_freetype='#undef CONFIG_FREETYPE'
6358 echores "$_freetype"
6360 if test "$_freetype" = no ; then
6361 _fontconfig=no
6362 res_comment="FreeType support needed"
6364 echocheck "fontconfig"
6365 if test "$_fontconfig" = auto ; then
6366 cat > $TMPC << EOF
6367 #include <stdio.h>
6368 #include <stdlib.h>
6369 #include <fontconfig/fontconfig.h>
6370 #if FC_VERSION < 20402
6371 #error At least version 2.4.2 of fontconfig required
6372 #endif
6373 int main(void) {
6374 int err = FcInit();
6375 if (err == FcFalse) {
6376 printf("Couldn't initialize fontconfig lib\n");
6377 exit(err);
6379 return 0;
6382 _fontconfig=no
6383 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6384 _ld_tmp="-lfontconfig $_ld_tmp"
6385 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6386 done
6387 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6388 _inc_tmp=$($_pkg_config --cflags fontconfig)
6389 _ld_tmp=$($_pkg_config --libs fontconfig)
6390 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6391 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6394 if test "$_fontconfig" = yes ; then
6395 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6396 else
6397 def_fontconfig='#undef CONFIG_FONTCONFIG'
6399 echores "$_fontconfig"
6402 echocheck "SSA/ASS support"
6403 # libass depends on FreeType
6404 if test "$_freetype" = no ; then
6405 _ass=no
6406 ass_internal=no
6407 res_comment="FreeType support needed"
6410 if test "$_ass" = auto ; then
6411 cat > $TMPC << EOF
6412 #include <ft2build.h>
6413 #include FT_FREETYPE_H
6414 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
6415 #error "Need FreeType 2.2.1 or newer"
6416 #endif
6417 int main(void) { return 0; }
6419 _ass=no
6420 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
6421 if test "$_ass" = no ; then
6422 ass_internal=no
6423 res_comment="FreeType >= 2.2.1 needed"
6424 elif test "$ass_internal" = no ; then
6425 res_comment="external"
6426 extra_ldflags="$extra_ldflags -lass"
6429 if test "$_ass" = yes ; then
6430 def_ass='#define CONFIG_ASS 1'
6431 else
6432 def_ass='#undef CONFIG_ASS'
6434 if test "$ass_internal" = yes ; then
6435 def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
6436 else
6437 def_ass_internal='#undef CONFIG_ASS_INTERNAL'
6439 echores "$_ass"
6442 echocheck "fribidi with charsets"
6443 _inc_tmp=""
6444 _ld_tmp=""
6445 if test "$_fribidi" = auto ; then
6446 cat > $TMPC << EOF
6447 #include <stdio.h>
6448 #include <stdlib.h>
6449 /* workaround for fribidi 0.10.4 and below */
6450 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6451 #include <fribidi/fribidi.h>
6452 int main(void) {
6453 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6454 printf("Fribidi headers are not consistents with the library!\n");
6455 exit(1);
6457 return 0;
6460 _fribidi=no
6461 _inc_tmp=""
6462 _ld_tmp="-lfribidi"
6463 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6464 if $_fribidiconfig --version > /dev/null 2>&1 &&
6465 test "$_fribidi" = no ; then
6466 _inc_tmp="$($_fribidiconfig --cflags)"
6467 _ld_tmp="$($_fribidiconfig --libs)"
6468 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6471 if test "$_fribidi" = yes ; then
6472 def_fribidi='#define CONFIG_FRIBIDI 1'
6473 extra_cflags="$extra_cflags $_inc_tmp"
6474 extra_ldflags="$extra_ldflags $_ld_tmp"
6475 else
6476 def_fribidi='#undef CONFIG_FRIBIDI'
6478 echores "$_fribidi"
6481 echocheck "ENCA"
6482 if test "$_enca" = auto ; then
6483 cat > $TMPC << EOF
6484 #include <sys/types.h>
6485 #include <enca.h>
6486 int main(void) {
6487 const char **langs;
6488 size_t langcnt;
6489 langs = enca_get_languages(&langcnt);
6490 return 0;
6493 _enca=no
6494 cc_check -lenca $_ld_lm && _enca=yes
6496 if test "$_enca" = yes ; then
6497 def_enca='#define CONFIG_ENCA 1'
6498 extra_ldflags="$extra_ldflags -lenca"
6499 else
6500 def_enca='#undef CONFIG_ENCA'
6502 echores "$_enca"
6505 echocheck "zlib"
6506 cat > $TMPC << EOF
6507 #include <zlib.h>
6508 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6510 _zlib=no
6511 cc_check -lz && _zlib=yes
6512 if test "$_zlib" = yes ; then
6513 def_zlib='#define CONFIG_ZLIB 1'
6514 extra_ldflags="$extra_ldflags -lz"
6515 else
6516 def_zlib='#define CONFIG_ZLIB 0'
6517 _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//)
6518 _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
6520 echores "$_zlib"
6523 echocheck "bzlib"
6524 bzlib=no
6525 def_bzlib='#define CONFIG_BZLIB 0'
6526 cat > $TMPC << EOF
6527 #include <bzlib.h>
6528 int main(void) { BZ2_bzlibVersion(); return 0; }
6530 cc_check -lbz2 && bzlib=yes
6531 if test "$bzlib" = yes ; then
6532 def_bzlib='#define CONFIG_BZLIB 1'
6533 extra_ldflags="$extra_ldflags -lbz2"
6535 echores "$bzlib"
6538 echocheck "RTC"
6539 if test "$_rtc" = auto ; then
6540 cat > $TMPC << EOF
6541 #include <sys/ioctl.h>
6542 #ifdef __linux__
6543 #include <linux/rtc.h>
6544 #else
6545 #include <rtc.h>
6546 #define RTC_PIE_ON RTCIO_PIE_ON
6547 #endif
6548 int main(void) { return RTC_PIE_ON; }
6550 _rtc=no
6551 cc_check && _rtc=yes
6552 ppc && _rtc=no
6554 if test "$_rtc" = yes ; then
6555 def_rtc='#define HAVE_RTC 1'
6556 else
6557 def_rtc='#undef HAVE_RTC'
6559 echores "$_rtc"
6562 echocheck "liblzo2 support"
6563 if test "$_liblzo" = auto ; then
6564 _liblzo=no
6565 cat > $TMPC << EOF
6566 #include <lzo/lzo1x.h>
6567 int main(void) { lzo_init();return 0; }
6569 cc_check -llzo2 && _liblzo=yes
6571 if test "$_liblzo" = yes ; then
6572 def_liblzo='#define CONFIG_LIBLZO 1'
6573 extra_ldflags="$extra_ldflags -llzo2"
6574 codecmodules="liblzo $codecmodules"
6575 else
6576 def_liblzo='#undef CONFIG_LIBLZO'
6577 nocodecmodules="liblzo $nocodecmodules"
6579 echores "$_liblzo"
6582 echocheck "mad support"
6583 if test "$_mad" = auto ; then
6584 _mad=no
6585 cat > $TMPC << EOF
6586 #include <mad.h>
6587 int main(void) { return 0; }
6589 cc_check -lmad && _mad=yes
6591 if test "$_mad" = yes ; then
6592 def_mad='#define CONFIG_LIBMAD 1'
6593 extra_ldflags="$extra_ldflags -lmad"
6594 codecmodules="libmad $codecmodules"
6595 else
6596 def_mad='#undef CONFIG_LIBMAD'
6597 nocodecmodules="libmad $nocodecmodules"
6599 echores "$_mad"
6601 echocheck "Twolame"
6602 if test "$_twolame" = auto ; then
6603 cat > $TMPC <<EOF
6604 #include <twolame.h>
6605 int main(void) { twolame_init(); return 0; }
6607 _twolame=no
6608 cc_check -ltwolame $_ld_lm && _twolame=yes
6610 if test "$_twolame" = yes ; then
6611 def_twolame='#define CONFIG_TWOLAME 1'
6612 libs_mencoder="$libs_mencoder -ltwolame"
6613 codecmodules="twolame $codecmodules"
6614 else
6615 def_twolame='#undef CONFIG_TWOLAME'
6616 nocodecmodules="twolame $nocodecmodules"
6618 echores "$_twolame"
6620 echocheck "Toolame"
6621 if test "$_toolame" = auto ; then
6622 _toolame=no
6623 if test "$_twolame" = yes ; then
6624 res_comment="disabled by twolame"
6625 else
6626 cat > $TMPC <<EOF
6627 #include <toolame.h>
6628 int main(void) { toolame_init(); return 0; }
6630 cc_check -ltoolame $_ld_lm && _toolame=yes
6633 if test "$_toolame" = yes ; then
6634 def_toolame='#define CONFIG_TOOLAME 1'
6635 libs_mencoder="$libs_mencoder -ltoolame"
6636 codecmodules="toolame $codecmodules"
6637 else
6638 def_toolame='#undef CONFIG_TOOLAME'
6639 nocodecmodules="toolame $nocodecmodules"
6641 if test "$_toolamedir" ; then
6642 res_comment="using $_toolamedir"
6644 echores "$_toolame"
6646 echocheck "OggVorbis support"
6647 if test "$_tremor_internal" = yes; then
6648 _libvorbis=no
6649 elif test "$_tremor" = auto; then
6650 _tremor=no
6651 cat > $TMPC << EOF
6652 #include <tremor/ivorbiscodec.h>
6653 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6655 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6657 if test "$_libvorbis" = auto; then
6658 _libvorbis=no
6659 cat > $TMPC << EOF
6660 #include <vorbis/codec.h>
6661 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6663 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6665 if test "$_tremor_internal" = yes ; then
6666 _vorbis=yes
6667 def_vorbis='#define CONFIG_OGGVORBIS 1'
6668 def_tremor='#define CONFIG_TREMOR 1'
6669 codecmodules="tremor(internal) $codecmodules"
6670 res_comment="internal Tremor"
6671 if test "$_tremor_low" = yes ; then
6672 cflags_tremor_low="-D_LOW_ACCURACY_"
6673 res_comment="internal low accuracy Tremor"
6675 elif test "$_tremor" = yes ; then
6676 _vorbis=yes
6677 def_vorbis='#define CONFIG_OGGVORBIS 1'
6678 def_tremor='#define CONFIG_TREMOR 1'
6679 codecmodules="tremor(external) $codecmodules"
6680 res_comment="external Tremor"
6681 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6682 elif test "$_libvorbis" = yes ; then
6683 _vorbis=yes
6684 def_vorbis='#define CONFIG_OGGVORBIS 1'
6685 codecmodules="libvorbis $codecmodules"
6686 res_comment="libvorbis"
6687 extra_ldflags="$extra_ldflags -lvorbis -logg"
6688 else
6689 _vorbis=no
6690 nocodecmodules="libvorbis $nocodecmodules"
6692 echores "$_vorbis"
6694 echocheck "libspeex (version >= 1.1 required)"
6695 if test "$_speex" = auto ; then
6696 _speex=no
6697 cat > $TMPC << EOF
6698 #include <speex/speex.h>
6699 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6701 cc_check -lspeex $_ld_lm && _speex=yes
6703 if test "$_speex" = yes ; then
6704 def_speex='#define CONFIG_SPEEX 1'
6705 extra_ldflags="$extra_ldflags -lspeex"
6706 codecmodules="speex $codecmodules"
6707 else
6708 def_speex='#undef CONFIG_SPEEX'
6709 nocodecmodules="speex $nocodecmodules"
6711 echores "$_speex"
6713 echocheck "OggTheora support"
6714 if test "$_theora" = auto ; then
6715 _theora=no
6716 cat > $TMPC << EOF
6717 #include <theora/theora.h>
6718 #include <string.h>
6719 int main(void) {
6720 /* Theora is in flux, make sure that all interface routines and datatypes
6721 * exist and work the way we expect it, so we don't break MPlayer. */
6722 ogg_packet op;
6723 theora_comment tc;
6724 theora_info inf;
6725 theora_state st;
6726 yuv_buffer yuv;
6727 int r;
6728 double t;
6730 theora_info_init(&inf);
6731 theora_comment_init(&tc);
6733 return 0;
6735 /* we don't want to execute this kind of nonsense; just for making sure
6736 * that compilation works... */
6737 memset(&op, 0, sizeof(op));
6738 r = theora_decode_header(&inf, &tc, &op);
6739 r = theora_decode_init(&st, &inf);
6740 t = theora_granule_time(&st, op.granulepos);
6741 r = theora_decode_packetin(&st, &op);
6742 r = theora_decode_YUVout(&st, &yuv);
6743 theora_clear(&st);
6745 return 0;
6748 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6749 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6750 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6751 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6752 if test _theora = no; then
6753 _ld_theora="-ltheora -logg"
6754 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6756 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6757 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6758 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6759 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6760 extra_ldflags="$extra_ldflags $_ld_theora" &&
6761 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6762 if test _theora = no; then
6763 _ld_theora="-ltheora -logg"
6764 cc_check tremor/bitwise.c $_ld_theora &&
6765 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6769 if test "$_theora" = yes ; then
6770 def_theora='#define CONFIG_OGGTHEORA 1'
6771 codecmodules="libtheora $codecmodules"
6772 # when --enable-theora is forced, we'd better provide a probably sane
6773 # $_ld_theora than nothing
6774 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6775 else
6776 def_theora='#undef CONFIG_OGGTHEORA'
6777 nocodecmodules="libtheora $nocodecmodules"
6779 echores "$_theora"
6781 echocheck "mp3lib support"
6782 if test "$_mp3lib" = auto ; then
6783 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6785 if test "$_mp3lib" = yes ; then
6786 def_mp3lib='#define CONFIG_MP3LIB 1'
6787 codecmodules="mp3lib(internal) $codecmodules"
6788 else
6789 def_mp3lib='#undef CONFIG_MP3LIB'
6790 nocodecmodules="mp3lib(internal) $nocodecmodules"
6792 echores "$_mp3lib"
6794 echocheck "liba52 support"
6795 def_liba52='#undef CONFIG_LIBA52'
6796 if test "$_liba52" = auto ; then
6797 _liba52=no
6798 cat > $TMPC << EOF
6799 #include <inttypes.h>
6800 #include <a52dec/a52.h>
6801 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6803 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6805 if test "$_liba52" = yes ; then
6806 def_liba52='#define CONFIG_LIBA52 1'
6807 codecmodules="liba52 $codecmodules"
6808 else
6809 nocodecmodules="liba52 $nocodecmodules"
6811 echores "$_liba52"
6813 echocheck "internal libmpeg2 support"
6814 if test "$_libmpeg2" = auto ; then
6815 _libmpeg2=yes
6816 if alpha && test cc_vendor=gnu; then
6817 case $cc_version in
6818 2*|3.0*|3.1*) # cannot compile MVI instructions
6819 _libmpeg2=no
6820 res_comment="broken gcc"
6822 esac
6825 if test "$_libmpeg2" = yes ; then
6826 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6827 codecmodules="libmpeg2(internal) $codecmodules"
6828 else
6829 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6830 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6832 echores "$_libmpeg2"
6834 echocheck "libdca support"
6835 if test "$_libdca" = auto ; then
6836 _libdca=no
6837 cat > $TMPC << EOF
6838 #include <inttypes.h>
6839 #include <dts.h>
6840 int main(void) { dts_init(0); return 0; }
6842 for _ld_dca in -ldca -ldts ; do
6843 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6844 && _libdca=yes && break
6845 done
6847 if test "$_libdca" = yes ; then
6848 def_libdca='#define CONFIG_LIBDCA 1'
6849 codecmodules="libdca $codecmodules"
6850 else
6851 def_libdca='#undef CONFIG_LIBDCA'
6852 nocodecmodules="libdca $nocodecmodules"
6854 echores "$_libdca"
6856 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6857 if test "$_musepack" = auto ; then
6858 _musepack=no
6859 cat > $TMPC << EOF
6860 #include <stddef.h>
6861 #include <mpcdec/mpcdec.h>
6862 int main(void) {
6863 mpc_streaminfo info;
6864 mpc_decoder decoder;
6865 mpc_decoder_set_streaminfo(&decoder, &info);
6866 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6867 return 0;
6870 cc_check -lmpcdec $_ld_lm && _musepack=yes
6872 if test "$_musepack" = yes ; then
6873 def_musepack='#define CONFIG_MUSEPACK 1'
6874 extra_ldflags="$extra_ldflags -lmpcdec"
6875 codecmodules="musepack $codecmodules"
6876 else
6877 def_musepack='#undef CONFIG_MUSEPACK'
6878 nocodecmodules="musepack $nocodecmodules"
6880 echores "$_musepack"
6883 echocheck "FAAC support"
6884 if test "$_faac" = auto ; then
6885 cat > $TMPC <<EOF
6886 #include <inttypes.h>
6887 #include <faac.h>
6888 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6890 _faac=no
6891 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6892 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6893 done
6895 if test "$_faac" = yes ; then
6896 def_faac="#define CONFIG_FAAC 1"
6897 test "$_faac_lavc" = auto && _faac_lavc=yes
6898 if test "$_faac_lavc" = yes ; then
6899 def_faac_lavc="#define CONFIG_LIBFAAC 1"
6900 libs_mplayer="$libs_mplayer $_ld_faac"
6901 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6903 codecmodules="faac $codecmodules"
6904 else
6905 _faac_lavc=no
6906 def_faac="#undef CONFIG_FAAC"
6907 def_faac_lavc="#define CONFIG_LIBFAAC 0"
6908 nocodecmodules="faac $nocodecmodules"
6910 res_comment="in libavcodec: $_faac_lavc"
6911 echores "$_faac"
6914 echocheck "FAAD2 support"
6915 if test "$_faad_internal" = auto ; then
6916 if x86_32 && test cc_vendor=gnu; then
6917 case $cc_version in
6918 3.1*|3.2) # ICE/insn with these versions
6919 _faad_internal=no
6920 res_comment="broken gcc"
6923 _faad=yes
6924 _faad_internal=yes
6926 esac
6927 else
6928 _faad=yes
6929 _faad_internal=yes
6932 if test "$_faad" = auto ; then
6933 cat > $TMPC << EOF
6934 #include <faad.h>
6935 #ifndef FAAD_MIN_STREAMSIZE
6936 #error Too old version
6937 #endif
6938 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6939 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6941 cc_check -lfaad $_ld_lm && _faad=yes
6944 def_faad='#undef CONFIG_FAAD'
6945 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6946 if test "$_faad_internal" = yes ; then
6947 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6948 res_comment="internal floating-point"
6949 if test "$_faad_fixed" = yes ; then
6950 # The FIXED_POINT implementation of FAAD2 improves performance
6951 # on some platforms, especially for SBR files.
6952 cflags_faad_fixed="-DFIXED_POINT"
6953 res_comment="internal fixed-point"
6955 elif test "$_faad" = yes ; then
6956 extra_ldflags="$extra_ldflags -lfaad"
6959 if test "$_faad" = yes ; then
6960 def_faad='#define CONFIG_FAAD 1'
6961 if test "$_faad_internal" = yes ; then
6962 codecmodules="faad2(internal) $codecmodules"
6963 else
6964 codecmodules="faad2 $codecmodules"
6966 else
6967 _faad=no
6968 nocodecmodules="faad2 $nocodecmodules"
6970 echores "$_faad"
6973 echocheck "LADSPA plugin support"
6974 if test "$_ladspa" = auto ; then
6975 cat > $TMPC <<EOF
6976 #include <stdio.h>
6977 #include <ladspa.h>
6978 int main(void) {
6979 const LADSPA_Descriptor *ld = NULL;
6980 return 0;
6983 _ladspa=no
6984 cc_check && _ladspa=yes
6986 if test "$_ladspa" = yes; then
6987 def_ladspa="#define CONFIG_LADSPA 1"
6988 else
6989 def_ladspa="#undef CONFIG_LADSPA"
6991 echores "$_ladspa"
6994 echocheck "libbs2b audio filter support"
6995 if test "$_libbs2b" = auto ; then
6996 cat > $TMPC <<EOF
6997 #include <bs2b.h>
6998 #if BS2B_VERSION_MAJOR < 3
6999 #error Please use libbs2b >= 3.0.0, older versions are not supported.
7000 #endif
7001 int main(void) {
7002 t_bs2bdp filter;
7003 filter=bs2b_open();
7004 bs2b_close(filter);
7005 return 0;
7008 _libbs2b=no
7009 if $_pkg_config --exists libbs2b ; then
7010 _inc_tmp=$($_pkg_config --cflags libbs2b)
7011 _ld_tmp=$($_pkg_config --libs libbs2b)
7012 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
7013 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
7014 else
7015 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
7016 -I/usr/local/include/bs2b ; do
7017 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
7018 extra_ldflags="$extra_ldflags -lbs2b"
7019 extra_cflags="$extra_cflags $_inc_tmp"
7020 _libbs2b=yes
7021 break
7023 done
7026 def_libbs2b="#undef CONFIG_LIBBS2B"
7027 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
7028 echores "$_libbs2b"
7031 if test -z "$_codecsdir" ; then
7032 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
7033 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
7034 if test -d "$dir" ; then
7035 _codecsdir="$dir"
7036 break;
7038 done
7040 # Fall back on default directory.
7041 if test -z "$_codecsdir" ; then
7042 _codecsdir="$_libdir/codecs"
7043 mingw32 || os2 && _codecsdir="codecs"
7047 echocheck "Win32 codecs"
7048 if test "$_win32dll" = auto ; then
7049 _win32dll=no
7050 if x86_32 && ! qnx; then
7051 _win32dll=yes
7054 if test "$_win32dll" = yes ; then
7055 def_win32dll='#define CONFIG_WIN32DLL 1'
7056 if ! win32 ; then
7057 def_win32_loader='#define WIN32_LOADER 1'
7058 _win32_emulation=yes
7059 else
7060 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
7061 res_comment="using native windows"
7063 codecmodules="win32 $codecmodules"
7064 else
7065 def_win32dll='#undef CONFIG_WIN32DLL'
7066 def_win32_loader='#undef WIN32_LOADER'
7067 nocodecmodules="win32 $nocodecmodules"
7069 echores "$_win32dll"
7072 echocheck "XAnim codecs"
7073 if test "$_xanim" = auto ; then
7074 _xanim=no
7075 res_comment="dynamic loader support needed"
7076 if test "$_dl" = yes ; then
7077 _xanim=yes
7080 if test "$_xanim" = yes ; then
7081 def_xanim='#define CONFIG_XANIM 1'
7082 codecmodules="xanim $codecmodules"
7083 else
7084 def_xanim='#undef CONFIG_XANIM'
7085 nocodecmodules="xanim $nocodecmodules"
7087 echores "$_xanim"
7090 echocheck "RealPlayer codecs"
7091 if test "$_real" = auto ; then
7092 _real=no
7093 res_comment="dynamic loader support needed"
7094 if test "$_dl" = yes || test "$_win32dll" = yes &&
7095 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
7096 _real=yes
7099 if test "$_real" = yes ; then
7100 def_real='#define CONFIG_REALCODECS 1'
7101 codecmodules="real $codecmodules"
7102 else
7103 def_real='#undef CONFIG_REALCODECS'
7104 nocodecmodules="real $nocodecmodules"
7106 echores "$_real"
7109 echocheck "QuickTime codecs"
7110 _qtx_emulation=no
7111 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
7112 if test "$_qtx" = auto ; then
7113 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
7115 if test "$_qtx" = yes ; then
7116 def_qtx='#define CONFIG_QTX_CODECS 1'
7117 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
7118 codecmodules="qtx $codecmodules"
7119 darwin || win32 || _qtx_emulation=yes
7120 else
7121 def_qtx='#undef CONFIG_QTX_CODECS'
7122 nocodecmodules="qtx $nocodecmodules"
7124 echores "$_qtx"
7126 echocheck "Nemesi Streaming Media libraries"
7127 if test "$_nemesi" = auto && test "$_network" = yes ; then
7128 _nemesi=no
7129 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
7130 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
7131 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
7132 _nemesi=yes
7135 if test "$_nemesi" = yes; then
7136 _native_rtsp=no
7137 def_nemesi='#define CONFIG_LIBNEMESI 1'
7138 inputmodules="nemesi $inputmodules"
7139 else
7140 _native_rtsp="$_network"
7141 _nemesi=no
7142 def_nemesi='#undef CONFIG_LIBNEMESI'
7143 _noinputmodules="nemesi $_noinputmodules"
7145 echores "$_nemesi"
7147 echocheck "LIVE555 Streaming Media libraries"
7148 if test "$_live" = auto && test "$_network" = yes ; then
7149 cat > $TMPCPP << EOF
7150 #include <liveMedia.hh>
7151 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
7152 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
7153 #endif
7154 int main(void) { return 0; }
7157 _live=no
7158 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
7159 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
7160 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
7161 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
7162 $_livelibdir/groupsock/libgroupsock.a \
7163 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
7164 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
7165 $extra_ldflags -lstdc++" \
7166 extra_cxxflags="-I$_livelibdir/liveMedia/include \
7167 -I$_livelibdir/UsageEnvironment/include \
7168 -I$_livelibdir/BasicUsageEnvironment/include \
7169 -I$_livelibdir/groupsock/include" && \
7170 _live=yes && break
7171 done
7172 if test "$_live" != yes ; then
7173 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
7174 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
7175 _live_dist=yes
7179 if test "$_live" = yes && test "$_network" = yes; then
7180 test $_livelibdir && res_comment="using $_livelibdir"
7181 def_live='#define CONFIG_LIVE555 1'
7182 inputmodules="live555 $inputmodules"
7183 elif test "$_live_dist" = yes && test "$_network" = yes; then
7184 res_comment="using distribution version"
7185 _live="yes"
7186 def_live='#define CONFIG_LIVE555 1'
7187 extra_ldflags="$extra_ldflags $ld_tmp"
7188 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
7189 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
7190 inputmodules="live555 $inputmodules"
7191 else
7192 _live=no
7193 def_live='#undef CONFIG_LIVE555'
7194 _noinputmodules="live555 $_noinputmodules"
7196 echores "$_live"
7199 echocheck "FFmpeg libavutil"
7200 if test "$_libavutil_a" = auto ; then
7201 if test -d libavutil ; then
7202 _libavutil_a=yes
7203 res_comment="static"
7204 else
7205 die "MPlayer will not compile without libavutil in the source tree."
7207 elif test "$_libavutil_so" = auto ; then
7208 _libavutil_so=no
7209 cat > $TMPC << EOF
7210 #include <libavutil/common.h>
7211 int main(void) { av_clip(1, 1, 1); return 0; }
7213 if $_pkg_config --exists libavutil ; then
7214 _inc_libavutil=$($_pkg_config --cflags libavutil)
7215 _ld_tmp=$($_pkg_config --libs libavutil)
7216 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7217 && _libavutil_so=yes
7218 elif cc_check -lavutil $_ld_lm ; then
7219 extra_ldflags="$extra_ldflags -lavutil"
7220 _libavutil_so=yes
7221 res_comment="using libavutil.so, but static libavutil is recommended"
7224 _libavutil=no
7225 def_libavutil='#undef CONFIG_LIBAVUTIL'
7226 def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
7227 def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
7228 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
7229 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
7230 test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
7231 test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
7232 # neither static nor shared libavutil is available, but it is mandatory ...
7233 if test "$_libavutil" = no ; then
7234 die "You need static or shared libavutil, MPlayer will not compile without!"
7236 echores "$_libavutil"
7238 echocheck "FFmpeg libavcodec"
7239 if test "$_libavcodec_a" = auto ; then
7240 _libavcodec_a=no
7241 if test -d libavcodec && test -f libavcodec/utils.c ; then
7242 _libavcodec_a="yes"
7243 res_comment="static"
7245 elif test "$_libavcodec_so" = auto ; then
7246 _libavcodec_so=no
7247 res_comment="libavcodec.so is discouraged over static libavcodec"
7248 cat > $TMPC << EOF
7249 #include <libavcodec/avcodec.h>
7250 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
7252 if $_pkg_config --exists libavcodec ; then
7253 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
7254 _ld_tmp=$($_pkg_config --libs libavcodec)
7255 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7256 && _libavcodec_so=yes
7257 elif cc_check -lavcodec $_ld_lm ; then
7258 extra_ldflags="$extra_ldflags -lavcodec"
7259 _libavcodec_so=yes
7260 res_comment="using libavcodec.so, but static libavcodec is recommended"
7263 _libavcodec=no
7264 def_libavcodec='#undef CONFIG_LIBAVCODEC'
7265 def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
7266 def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
7267 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
7268 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
7269 test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
7270 test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
7271 test "$_libavcodec_mpegaudio_hp" = yes \
7272 && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' \
7273 && mak_libavcodec_mpegaudio_hp='CONFIG_MPEGAUDIO_HP = yes'
7274 if test "$_libavcodec_a" = yes ; then
7275 codecmodules="libavcodec(internal) $codecmodules"
7276 elif test "$_libavcodec_so" = yes ; then
7277 codecmodules="libavcodec.so $codecmodules"
7278 else
7279 nocodecmodules="libavcodec $nocodecmodules"
7281 echores "$_libavcodec"
7283 echocheck "FFmpeg libavformat"
7284 if test "$_libavformat_a" = auto ; then
7285 _libavformat_a=no
7286 if test -d libavformat && test -f libavformat/utils.c ; then
7287 _libavformat_a=yes
7288 res_comment="static"
7290 elif test "$_libavformat_so" = auto ; then
7291 _libavformat_so=no
7292 cat > $TMPC <<EOF
7293 #include <libavformat/avformat.h>
7294 #include <libavcodec/opt.h>
7295 int main(void) { av_alloc_format_context(); return 0; }
7297 if $_pkg_config --exists libavformat ; then
7298 _inc_libavformat=$($_pkg_config --cflags libavformat)
7299 _ld_tmp=$($_pkg_config --libs libavformat)
7300 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7301 && _libavformat_so=yes
7302 elif cc_check $_ld_lm -lavformat ; then
7303 extra_ldflags="$extra_ldflags -lavformat"
7304 _libavformat_so=yes
7305 res_comment="using libavformat.so, but static libavformat is recommended"
7308 _libavformat=no
7309 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7310 def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
7311 def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
7312 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
7313 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7314 test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
7315 test "$_libavformat_so" = yes \
7316 && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
7317 echores "$_libavformat"
7319 echocheck "FFmpeg libpostproc"
7320 if test "$_libpostproc_a" = auto ; then
7321 _libpostproc_a=no
7322 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
7323 _libpostproc_a='yes'
7324 res_comment="static"
7326 elif test "$_libpostproc_so" = auto ; then
7327 _libpostproc_so=no
7328 cat > $TMPC << EOF
7329 #include <inttypes.h>
7330 #include <libpostproc/postprocess.h>
7331 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7333 if cc_check -lpostproc $_ld_lm ; then
7334 extra_ldflags="$extra_ldflags -lpostproc"
7335 _libpostproc_so=yes
7336 res_comment="using libpostproc.so, but static libpostproc is recommended"
7339 _libpostproc=no
7340 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7341 def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
7342 def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
7343 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
7344 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7345 test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
7346 test "$_libpostproc_so" = yes \
7347 && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
7348 echores "$_libpostproc"
7350 echocheck "FFmpeg libswscale"
7351 if test "$_libswscale_a" = auto ; then
7352 _libswscale_a=no
7353 if test -d libswscale && test -f libswscale/swscale.h ; then
7354 _libswscale_a='yes'
7355 res_comment="static"
7357 elif test "$_libswscale_so" = auto ; then
7358 _libswscale_so=no
7359 res_comment="using libswscale.so, but static libswscale is recommended"
7360 cat > $TMPC << EOF
7361 #include <libswscale/swscale.h>
7362 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7364 if $_pkg_config --exists libswscale ; then
7365 _inc_libswscale=$($_pkg_config --cflags libswscale)
7366 _ld_tmp=$($_pkg_config --libs libswscale)
7367 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7368 && _libswscale_so=yes
7369 elif cc_check -lswscale ; then
7370 extra_ldflags="$extra_ldflags -lswscale"
7371 _libswscale_so=yes
7374 _libswscale=no
7375 def_libswscale='#undef CONFIG_LIBSWSCALE'
7376 def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
7377 def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
7378 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
7379 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7380 test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
7381 test "$_libswscale_so" = yes \
7382 && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
7383 echores "$_libswscale"
7385 echocheck "libopencore_amr narrowband"
7386 if test "$_libopencore_amrnb" = auto ; then
7387 _libopencore_amrnb=no
7388 cat > $TMPC << EOF
7389 #include <opencore-amrnb/interf_dec.h>
7390 int main(void) { Decoder_Interface_init(); return 0; }
7392 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7393 if test "$_libavcodec_a" != yes ; then
7394 _libopencore_amrnb=no
7395 res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
7398 if test "$_libopencore_amrnb" = yes ; then
7399 _libopencore_amr=yes
7400 extra_ldflags="$extra_ldflags -lopencore-amrnb"
7401 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
7402 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
7403 _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
7404 codecmodules="libopencore_amrnb $codecmodules"
7405 else
7406 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
7407 nocodecmodules="libopencore_amrnb $nocodecmodules"
7409 echores "$_libopencore_amrnb"
7412 echocheck "libopencore_amr wideband"
7413 if test "$_libopencore_amrwb" = auto ; then
7414 _libopencore_amrwb=no
7415 cat > $TMPC << EOF
7416 #include <opencore-amrwb/dec_if.h>
7417 int main(void) { D_IF_init(); return 0; }
7419 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7420 if test "$_libavcodec_a" != yes ; then
7421 _libopencore_amrwb=no
7422 res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
7425 if test "$_libopencore_amrwb" = yes ; then
7426 _libopencore_amr=yes
7427 extra_ldflags="$extra_ldflags -lopencore-amrwb"
7428 def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
7429 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
7430 codecmodules="libopencore_amrwb $codecmodules"
7431 else
7432 def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
7433 nocodecmodules="libopencore_amrwb $nocodecmodules"
7435 echores "$_libopencore_amrwb"
7437 echocheck "libdv-0.9.5+"
7438 if test "$_libdv" = auto ; then
7439 _libdv=no
7440 cat > $TMPC <<EOF
7441 #include <libdv/dv.h>
7442 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7444 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7446 if test "$_libdv" = yes ; then
7447 def_libdv='#define CONFIG_LIBDV095 1'
7448 extra_ldflags="$extra_ldflags -ldv"
7449 codecmodules="libdv $codecmodules"
7450 else
7451 def_libdv='#undef CONFIG_LIBDV095'
7452 nocodecmodules="libdv $nocodecmodules"
7454 echores "$_libdv"
7457 echocheck "Xvid"
7458 if test "$_xvid" = auto ; then
7459 _xvid=no
7460 cat > $TMPC << EOF
7461 #include <xvid.h>
7462 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7464 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7465 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7466 done
7469 if test "$_xvid" = yes ; then
7470 def_xvid='#define CONFIG_XVID4 1'
7471 codecmodules="xvid $codecmodules"
7472 else
7473 def_xvid='#undef CONFIG_XVID4'
7474 nocodecmodules="xvid $nocodecmodules"
7476 echores "$_xvid"
7478 echocheck "Xvid two pass plugin"
7479 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7480 cat > $TMPC << EOF
7481 #include <xvid.h>
7482 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7484 cc_check && _xvid_lavc=yes
7486 if test "$_xvid_lavc" = yes ; then
7487 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7488 _libavencoders="$_libavencoders LIBXVID_ENCODER"
7489 else
7490 _xvid_lavc=no
7491 def_xvid_lavc='#define CONFIG_LIBXVID 0'
7493 echores "$_xvid_lavc"
7496 echocheck "x264"
7497 if test "$_x264" = auto ; then
7498 cat > $TMPC << EOF
7499 #include <inttypes.h>
7500 #include <x264.h>
7501 #if X264_BUILD < 89
7502 #error We do not support old versions of x264. Get the latest from git.
7503 #endif
7504 int main(void) { x264_encoder_open((void*)0); return 0; }
7506 _x264=no
7507 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7508 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7509 done
7512 if test "$_x264" = yes ; then
7513 def_x264='#define CONFIG_X264 1'
7514 codecmodules="x264 $codecmodules"
7515 test "$_x264_lavc" = auto && _x264_lavc=yes
7516 if test "$_x264_lavc" = yes ; then
7517 def_x264_lavc='#define CONFIG_LIBX264 1'
7518 libs_mplayer="$libs_mplayer $_ld_x264"
7519 _libavencoders="$_libavencoders LIBX264_ENCODER"
7521 else
7522 _x264_lavc=no
7523 def_x264='#undef CONFIG_X264'
7524 def_x264_lavc='#define CONFIG_LIBX264 0'
7525 nocodecmodules="x264 $nocodecmodules"
7527 res_comment="in libavcodec: $_x264_lavc"
7528 echores "$_x264"
7531 echocheck "libdirac"
7532 if test "$_libdirac_lavc" = auto; then
7533 _libdirac_lavc=no
7534 if test "$_libavcodec_a" != yes; then
7535 res_comment="libavcodec (static) is required by libdirac, sorry"
7536 else
7537 cat > $TMPC << EOF
7538 #include <libdirac_encoder/dirac_encoder.h>
7539 #include <libdirac_decoder/dirac_parser.h>
7540 int main(void)
7542 dirac_encoder_context_t enc_ctx;
7543 dirac_decoder_t *dec_handle;
7544 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
7545 dec_handle = dirac_decoder_init(0);
7546 if (dec_handle)
7547 dirac_decoder_close(dec_handle);
7548 return 0;
7551 if $_pkg_config --exists dirac ; then
7552 _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
7553 _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
7554 cc_check $_inc_dirac $_ld_dirac &&
7555 _libdirac_lavc=yes &&
7556 extra_cflags="$extra_cflags $_inc_dirac" &&
7557 extra_ldflags="$extra_ldflags $_ld_dirac"
7561 if test "$_libdirac_lavc" = yes ; then
7562 def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
7563 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
7564 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
7565 codecmodules="libdirac $codecmodules"
7566 else
7567 def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
7568 nocodecmodules="libdirac $nocodecmodules"
7570 echores "$_libdirac_lavc"
7573 echocheck "libschroedinger"
7574 if test "$_libschroedinger_lavc" = auto ; then
7575 _libschroedinger_lavc=no
7576 if test "$_libavcodec_a" != yes; then
7577 res_comment="libavcodec (static) is required by libschroedinger, sorry"
7578 else
7579 cat > $TMPC << EOF
7580 #include <schroedinger/schro.h>
7581 int main(void) { schro_init(); return SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY; }
7583 if $_pkg_config --exists schroedinger-1.0 ; then
7584 _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
7585 _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
7586 cc_check $_inc_schroedinger $_ld_schroedinger &&
7587 _libschroedinger_lavc=yes &&
7588 extra_cflags="$extra_cflags $_inc_schroedinger" &&
7589 extra_ldflags="$extra_ldflags $_ld_schroedinger"
7593 if test "$_libschroedinger_lavc" = yes ; then
7594 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
7595 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
7596 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
7597 codecmodules="libschroedinger $codecmodules"
7598 else
7599 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
7600 nocodecmodules="libschroedinger $nocodecmodules"
7602 echores "$_libschroedinger_lavc"
7604 echocheck "libnut"
7605 if test "$_libnut" = auto ; then
7606 cat > $TMPC << EOF
7607 #include <stdio.h>
7608 #include <stdlib.h>
7609 #include <inttypes.h>
7610 #include <libnut.h>
7611 nut_context_tt * nut;
7612 int main(void) { (void)nut_error(0); return 0; }
7614 _libnut=no
7615 cc_check -lnut && _libnut=yes
7618 if test "$_libnut" = yes ; then
7619 def_libnut='#define CONFIG_LIBNUT 1'
7620 extra_ldflags="$extra_ldflags -lnut"
7621 else
7622 def_libnut='#undef CONFIG_LIBNUT'
7624 echores "$_libnut"
7626 #check must be done after libavcodec one
7627 echocheck "zr"
7628 if test "$_zr" = auto ; then
7629 #36067's seem to identify themselves as 36057PQC's, so the line
7630 #below should work for 36067's and 36057's.
7631 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7632 _zr=yes
7633 else
7634 _zr=no
7637 if test "$_zr" = yes ; then
7638 if test "$_libavcodec_a" = yes ; then
7639 def_zr='#define CONFIG_ZR 1'
7640 vomodules="zr zr2 $vomodules"
7641 else
7642 res_comment="libavcodec (static) is required by zr, sorry"
7643 novomodules="zr $novomodules"
7644 def_zr='#undef CONFIG_ZR'
7646 else
7647 def_zr='#undef CONFIG_ZR'
7648 novomodules="zr zr2 $novomodules"
7650 echores "$_zr"
7652 # mencoder requires (optional) those libs: libmp3lame
7653 if test "$_mencoder" != no ; then
7655 echocheck "libmp3lame"
7656 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7657 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7658 if test "$_mp3lame" = auto ; then
7659 _mp3lame=no
7660 cat > $TMPC <<EOF
7661 #include <lame/lame.h>
7662 int main(void) { lame_version_t lv; (void) lame_init();
7663 get_lame_version_numerical(&lv);
7664 return 0; }
7666 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7668 if test "$_mp3lame" = yes ; then
7669 def_mp3lame="#define CONFIG_MP3LAME 1"
7670 _ld_mp3lame=-lmp3lame
7671 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7672 cat > $TMPC << EOF
7673 #include <lame/lame.h>
7674 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7676 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7677 cat > $TMPC << EOF
7678 #include <lame/lame.h>
7679 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7681 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7682 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7683 if test "$_mp3lame_lavc" = yes ; then
7684 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7685 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
7686 libs_mplayer="$libs_mplayer $_ld_mp3lame"
7688 else
7689 _mp3lame_lavc=no
7690 def_mp3lame='#undef CONFIG_MP3LAME'
7691 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
7693 res_comment="in libavcodec: $_mp3lame_lavc"
7694 echores "$_mp3lame"
7696 fi # test "$_mencoder" != no
7698 echocheck "mencoder"
7699 if test "$_mencoder" = yes ; then
7700 def_muxers='#define CONFIG_MUXERS 1'
7701 else
7702 # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
7703 # png for vf_screenshot, mjpeg for zr
7704 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
7705 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
7706 test "$_zr" = yes && _libavencoders="$_libavencoders MJPEG_ENCODER"
7707 _libavmuxers=""
7708 def_muxers='#define CONFIG_MUXERS 0'
7710 echores "$_mencoder"
7713 echocheck "UnRAR executable"
7714 if test "$_unrar_exec" = auto ; then
7715 _unrar_exec="yes"
7716 mingw32 && _unrar_exec="no"
7718 if test "$_unrar_exec" = yes ; then
7719 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7720 else
7721 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7723 echores "$_unrar_exec"
7725 echocheck "TV interface"
7726 if test "$_tv" = yes ; then
7727 def_tv='#define CONFIG_TV 1'
7728 inputmodules="tv $inputmodules"
7729 else
7730 _noinputmodules="tv $_noinputmodules"
7731 def_tv='#undef CONFIG_TV'
7733 echores "$_tv"
7736 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7737 echocheck "*BSD BT848 bt8xx header"
7738 _ioctl_bt848_h=no
7739 for file in "machine/ioctl_bt848.h" \
7740 "dev/bktr/ioctl_bt848.h" \
7741 "dev/video/bktr/ioctl_bt848.h" \
7742 "dev/ic/bt8xx.h" ; do
7743 cat > $TMPC <<EOF
7744 #include <sys/types.h>
7745 #include <sys/ioctl.h>
7746 #include <$file>
7747 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7749 if cc_check ; then
7750 _ioctl_bt848_h=yes
7751 _ioctl_bt848_h_name="$file"
7752 break;
7754 done
7755 if test "$_ioctl_bt848_h" = yes ; then
7756 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7757 res_comment="using $_ioctl_bt848_h_name"
7758 else
7759 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7761 echores "$_ioctl_bt848_h"
7763 echocheck "*BSD ioctl_meteor.h"
7764 _ioctl_meteor_h=no
7765 for file in "machine/ioctl_meteor.h" \
7766 "dev/bktr/ioctl_meteor.h" \
7767 "dev/video/bktr/ioctl_meteor.h" ; do
7768 cat > $TMPC <<EOF
7769 #include <sys/types.h>
7770 #include <$file>
7771 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7773 if cc_check ; then
7774 _ioctl_meteor_h=yes
7775 _ioctl_meteor_h_name="$file"
7776 break;
7778 done
7779 if test "$_ioctl_meteor_h" = yes ; then
7780 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7781 res_comment="using $_ioctl_meteor_h_name"
7782 else
7783 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7785 echores "$_ioctl_meteor_h"
7787 echocheck "*BSD BrookTree 848 TV interface"
7788 if test "$_tv_bsdbt848" = auto ; then
7789 _tv_bsdbt848=no
7790 if test "$_tv" = yes ; then
7791 cat > $TMPC <<EOF
7792 #include <sys/types.h>
7793 $def_ioctl_meteor_h_name
7794 $def_ioctl_bt848_h_name
7795 #ifdef IOCTL_METEOR_H_NAME
7796 #include IOCTL_METEOR_H_NAME
7797 #endif
7798 #ifdef IOCTL_BT848_H_NAME
7799 #include IOCTL_BT848_H_NAME
7800 #endif
7801 int main(void) {
7802 ioctl(0, METEORSINPUT, 0);
7803 ioctl(0, TVTUNER_GETFREQ, 0);
7804 return 0;
7807 cc_check && _tv_bsdbt848=yes
7810 if test "$_tv_bsdbt848" = yes ; then
7811 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7812 inputmodules="tv-bsdbt848 $inputmodules"
7813 else
7814 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7815 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7817 echores "$_tv_bsdbt848"
7818 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7821 echocheck "DirectShow TV interface"
7822 if test "$_tv_dshow" = auto ; then
7823 _tv_dshow=no
7824 if test "$_tv" = yes && win32 ; then
7825 cat > $TMPC <<EOF
7826 #include <ole2.h>
7827 int main(void) {
7828 void* p;
7829 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7830 return 0;
7833 cc_check -lole32 -luuid && _tv_dshow=yes
7836 if test "$_tv_dshow" = yes ; then
7837 inputmodules="tv-dshow $inputmodules"
7838 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7839 extra_ldflags="$extra_ldflags -lole32 -luuid"
7840 else
7841 _noinputmodules="tv-dshow $_noinputmodules"
7842 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7844 echores "$_tv_dshow"
7847 echocheck "Video 4 Linux TV interface"
7848 if test "$_tv_v4l1" = auto ; then
7849 _tv_v4l1=no
7850 if test "$_tv" = yes && linux ; then
7851 cat > $TMPC <<EOF
7852 #include <stdlib.h>
7853 #include <linux/videodev.h>
7854 int main(void) { return 0; }
7856 cc_check && _tv_v4l1=yes
7859 if test "$_tv_v4l1" = yes ; then
7860 _audio_input=yes
7861 _tv_v4l=yes
7862 def_tv_v4l='#define CONFIG_TV_V4L 1'
7863 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7864 inputmodules="tv-v4l $inputmodules"
7865 else
7866 _noinputmodules="tv-v4l1 $_noinputmodules"
7867 def_tv_v4l='#undef CONFIG_TV_V4L'
7869 echores "$_tv_v4l1"
7872 echocheck "Video 4 Linux 2 TV interface"
7873 if test "$_tv_v4l2" = auto ; then
7874 _tv_v4l2=no
7875 if test "$_tv" = yes && linux ; then
7876 cat > $TMPC <<EOF
7877 #include <stdlib.h>
7878 #include <linux/types.h>
7879 #include <linux/videodev2.h>
7880 int main(void) { return 0; }
7882 cc_check && _tv_v4l2=yes
7885 if test "$_tv_v4l2" = yes ; then
7886 _audio_input=yes
7887 _tv_v4l=yes
7888 def_tv_v4l='#define CONFIG_TV_V4L 1'
7889 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7890 inputmodules="tv-v4l2 $inputmodules"
7891 else
7892 _noinputmodules="tv-v4l2 $_noinputmodules"
7893 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7895 echores "$_tv_v4l2"
7898 echocheck "Radio interface"
7899 if test "$_radio" = yes ; then
7900 def_radio='#define CONFIG_RADIO 1'
7901 inputmodules="radio $inputmodules"
7902 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7903 _radio_capture=no
7905 if test "$_radio_capture" = yes ; then
7906 _audio_input=yes
7907 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7908 else
7909 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7911 else
7912 _noinputmodules="radio $_noinputmodules"
7913 def_radio='#undef CONFIG_RADIO'
7914 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7915 _radio_capture=no
7917 echores "$_radio"
7918 echocheck "Capture for Radio interface"
7919 echores "$_radio_capture"
7921 echocheck "Video 4 Linux 2 Radio interface"
7922 if test "$_radio_v4l2" = auto ; then
7923 _radio_v4l2=no
7924 if test "$_radio" = yes && linux ; then
7925 cat > $TMPC <<EOF
7926 #include <stdlib.h>
7927 #include <linux/types.h>
7928 #include <linux/videodev2.h>
7929 int main(void) { return 0; }
7931 cc_check && _radio_v4l2=yes
7934 if test "$_radio_v4l2" = yes ; then
7935 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7936 else
7937 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7939 echores "$_radio_v4l2"
7941 echocheck "Video 4 Linux Radio interface"
7942 if test "$_radio_v4l" = auto ; then
7943 _radio_v4l=no
7944 if test "$_radio" = yes && linux ; then
7945 cat > $TMPC <<EOF
7946 #include <stdlib.h>
7947 #include <linux/videodev.h>
7948 int main(void) { return 0; }
7950 cc_check && _radio_v4l=yes
7953 if test "$_radio_v4l" = yes ; then
7954 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7955 else
7956 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7958 echores "$_radio_v4l"
7960 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7961 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7962 echocheck "*BSD BrookTree 848 Radio interface"
7963 _radio_bsdbt848=no
7964 cat > $TMPC <<EOF
7965 #include <sys/types.h>
7966 $def_ioctl_bt848_h_name
7967 #ifdef IOCTL_BT848_H_NAME
7968 #include IOCTL_BT848_H_NAME
7969 #endif
7970 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7972 cc_check && _radio_bsdbt848=yes
7973 echores "$_radio_bsdbt848"
7974 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7976 if test "$_radio_bsdbt848" = yes ; then
7977 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7978 else
7979 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7982 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7983 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7984 die "Radio driver requires BSD BT848, V4L or V4L2!"
7987 echocheck "Video 4 Linux 2 MPEG PVR interface"
7988 if test "$_pvr" = auto ; then
7989 _pvr=no
7990 if test "$_tv_v4l2" = yes && linux ; then
7991 cat > $TMPC <<EOF
7992 #include <stdlib.h>
7993 #include <inttypes.h>
7994 #include <linux/types.h>
7995 #include <linux/videodev2.h>
7996 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7998 cc_check && _pvr=yes
8001 if test "$_pvr" = yes ; then
8002 def_pvr='#define CONFIG_PVR 1'
8003 inputmodules="pvr $inputmodules"
8004 else
8005 _noinputmodules="pvr $_noinputmodules"
8006 def_pvr='#undef CONFIG_PVR'
8008 echores "$_pvr"
8011 echocheck "ftp"
8012 if ! beos && test "$_ftp" = yes ; then
8013 def_ftp='#define CONFIG_FTP 1'
8014 inputmodules="ftp $inputmodules"
8015 else
8016 _noinputmodules="ftp $_noinputmodules"
8017 def_ftp='#undef CONFIG_FTP'
8019 echores "$_ftp"
8021 echocheck "vstream client"
8022 if test "$_vstream" = auto ; then
8023 _vstream=no
8024 cat > $TMPC <<EOF
8025 #include <vstream-client.h>
8026 void vstream_error(const char *format, ... ) {}
8027 int main(void) { vstream_start(); return 0; }
8029 cc_check -lvstream-client && _vstream=yes
8031 if test "$_vstream" = yes ; then
8032 def_vstream='#define CONFIG_VSTREAM 1'
8033 inputmodules="vstream $inputmodules"
8034 extra_ldflags="$extra_ldflags -lvstream-client"
8035 else
8036 _noinputmodules="vstream $_noinputmodules"
8037 def_vstream='#undef CONFIG_VSTREAM'
8039 echores "$_vstream"
8042 echocheck "OSD menu"
8043 if test "$_menu" = yes ; then
8044 def_menu='#define CONFIG_MENU 1'
8045 test $_dvbin = "yes" && _menu_dvbin=yes
8046 else
8047 def_menu='#undef CONFIG_MENU'
8048 _menu_dvbin=no
8050 echores "$_menu"
8053 echocheck "Subtitles sorting"
8054 if test "$_sortsub" = yes ; then
8055 def_sortsub='#define CONFIG_SORTSUB 1'
8056 else
8057 def_sortsub='#undef CONFIG_SORTSUB'
8059 echores "$_sortsub"
8062 echocheck "XMMS inputplugin support"
8063 if test "$_xmms" = yes ; then
8064 if ( xmms-config --version ) >/dev/null 2>&1 ; then
8065 _xmmsplugindir=$(xmms-config --input-plugin-dir)
8066 _xmmslibdir=$(xmms-config --exec-prefix)/lib
8067 else
8068 _xmmsplugindir=/usr/lib/xmms/Input
8069 _xmmslibdir=/usr/lib
8072 def_xmms='#define CONFIG_XMMS 1'
8073 if darwin ; then
8074 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
8075 else
8076 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
8078 else
8079 def_xmms='#undef CONFIG_XMMS'
8081 echores "$_xmms"
8084 # --------------- GUI specific tests begin -------------------
8085 echocheck "GUI"
8086 echo "$_gui"
8087 if test "$_gui" = yes ; then
8089 # Required libraries
8090 if test "$_libavcodec" != yes ||
8091 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
8092 die "The GUI requires libavcodec with PNG support (needs zlib)."
8094 test "$_freetype" = no && test "$_bitmap_font" = no && \
8095 die "The GUI requires either FreeType or bitmap font support."
8096 if ! win32 ; then
8097 _gui_gtk=yes
8098 test "$_x11" != yes && die "X11 support required for GUI compilation."
8100 echocheck "XShape extension"
8101 if test "$_xshape" = auto ; then
8102 _xshape=no
8103 cat > $TMPC << EOF
8104 #include <X11/Xlib.h>
8105 #include <X11/Xproto.h>
8106 #include <X11/Xutil.h>
8107 #include <X11/extensions/shape.h>
8108 #include <stdlib.h>
8109 int main(void) {
8110 char *name = ":0.0";
8111 Display *wsDisplay;
8112 int exitvar = 0;
8113 int eventbase, errorbase;
8114 if (getenv("DISPLAY"))
8115 name=getenv("DISPLAY");
8116 wsDisplay=XOpenDisplay(name);
8117 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
8118 exitvar=1;
8119 XCloseDisplay(wsDisplay);
8120 return exitvar;
8123 cc_check -lXext && _xshape=yes
8125 if test "$_xshape" = yes ; then
8126 def_xshape='#define CONFIG_XSHAPE 1'
8127 else
8128 die "The GUI requires the X11 extension XShape (which was not found)."
8130 echores "$_xshape"
8132 #Check for GTK
8133 if test "$_gtk1" = no ; then
8134 #Check for GTK2 :
8135 echocheck "GTK+ version"
8137 if $_pkg_config gtk+-2.0 --exists ; then
8138 _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
8139 extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
8140 libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
8141 echores "$_gtk"
8143 # Check for GLIB2
8144 if $_pkg_config glib-2.0 --exists ; then
8145 echocheck "glib version"
8146 _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
8147 libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
8148 echores "$_glib"
8150 def_gui='#define CONFIG_GUI 1'
8151 def_gtk2='#define CONFIG_GTK2 1'
8152 else
8153 _gtk1=yes
8154 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
8156 else
8157 echo "GTK-2 devel packages were not found, trying GTK 1.2"
8158 _gtk1=yes
8162 if test "$_gtk1" = yes ; then
8163 # Check for old GTK (1.2.x)
8164 echocheck "GTK version"
8165 if test -z "$_gtkconfig" ; then
8166 if ( gtk-config --version ) >/dev/null 2>&1 ; then
8167 _gtkconfig="gtk-config"
8168 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
8169 _gtkconfig="gtk12-config"
8170 else
8171 die "The GUI requires GTK devel packages (which were not found)."
8174 _gtk=$($_gtkconfig --version 2>&1)
8175 extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
8176 libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
8177 echores "$_gtk (using $_gtkconfig)"
8179 # Check for GLIB
8180 echocheck "glib version"
8181 if test -z "$_glibconfig" ; then
8182 if ( glib-config --version ) >/dev/null 2>&1 ; then
8183 _glibconfig="glib-config"
8184 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
8185 _glibconfig="glib12-config"
8186 else
8187 die "The GUI requires GLIB devel packages (which were not found)"
8190 _glib=$($_glibconfig --version 2>&1)
8191 libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
8192 echores "$_glib (using $_glibconfig)"
8194 def_gui='#define CONFIG_GUI 1'
8195 def_gtk2='#undef CONFIG_GTK2'
8198 else #if ! win32
8199 _gui_win32=yes
8200 libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
8201 def_gui='#define CONFIG_GUI 1'
8202 def_gtk2='#undef CONFIG_GTK2'
8203 fi #if ! win32
8205 else #if test "$_gui"
8206 def_gui='#undef CONFIG_GUI'
8207 def_gtk2='#undef CONFIG_GTK2'
8208 fi #if test "$_gui"
8209 # --------------- GUI specific tests end -------------------
8212 if test "$_charset" != "noconv" ; then
8213 def_charset="#define MSG_CHARSET \"$_charset\""
8214 else
8215 def_charset="#undef MSG_CHARSET"
8216 _charset="UTF-8"
8219 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
8220 echocheck "iconv program"
8221 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
8222 if test "$?" -ne 0 ; then
8223 echores "no"
8224 echo "No working iconv program found, use "
8225 echo "--charset=UTF-8 to continue anyway."
8226 echo "If you also have problems with iconv library functions use --charset=noconv."
8227 echo "Messages in the GTK-2 interface will be broken then."
8228 exit 1
8229 else
8230 echores "yes"
8234 #############################################################################
8236 echocheck "automatic gdb attach"
8237 if test "$_crash_debug" = yes ; then
8238 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
8239 else
8240 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
8241 _crash_debug=no
8243 echores "$_crash_debug"
8245 echocheck "compiler support for noexecstack"
8246 cat > $TMPC <<EOF
8247 int main(void) { return 0; }
8249 if cc_check -Wl,-z,noexecstack ; then
8250 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
8251 echores "yes"
8252 else
8253 echores "no"
8256 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
8257 if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
8258 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
8259 echores "yes"
8260 else
8261 echores "no"
8265 # Dynamic linking flags
8266 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
8267 _ld_dl_dynamic=''
8268 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
8269 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
8270 _ld_dl_dynamic='-rdynamic'
8273 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
8274 bsdos && extra_ldflags="$extra_ldflags -ldvd"
8275 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
8277 def_debug='#undef MP_DEBUG'
8278 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
8281 echocheck "joystick"
8282 def_joystick='#undef CONFIG_JOYSTICK'
8283 if test "$_joystick" = yes ; then
8284 if linux ; then
8285 # TODO add some check
8286 def_joystick='#define CONFIG_JOYSTICK 1'
8287 else
8288 _joystick="no"
8289 res_comment="unsupported under $system_name"
8292 echores "$_joystick"
8294 echocheck "lirc"
8295 if test "$_lirc" = auto ; then
8296 _lirc=no
8297 cat > $TMPC <<EOF
8298 #include <lirc/lirc_client.h>
8299 int main(void) { return 0; }
8301 cc_check -llirc_client && _lirc=yes
8303 if test "$_lirc" = yes ; then
8304 def_lirc='#define CONFIG_LIRC 1'
8305 libs_mplayer="$libs_mplayer -llirc_client"
8306 else
8307 def_lirc='#undef CONFIG_LIRC'
8309 echores "$_lirc"
8311 echocheck "lircc"
8312 if test "$_lircc" = auto ; then
8313 _lircc=no
8314 cat > $TMPC <<EOF
8315 #include <lirc/lircc.h>
8316 int main(void) { return 0; }
8318 cc_check -llircc && _lircc=yes
8320 if test "$_lircc" = yes ; then
8321 def_lircc='#define CONFIG_LIRCC 1'
8322 libs_mplayer="$libs_mplayer -llircc"
8323 else
8324 def_lircc='#undef CONFIG_LIRCC'
8326 echores "$_lircc"
8328 if arm; then
8329 # Detect maemo development platform libraries availability (http://www.maemo.org),
8330 # they are used when run on Nokia 770|8x0
8331 echocheck "maemo (Nokia 770|8x0)"
8332 if test "$_maemo" = auto ; then
8333 _maemo=no
8334 cat > $TMPC << EOF
8335 #include <libosso.h>
8336 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
8338 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8340 if test "$_maemo" = yes ; then
8341 def_maemo='#define CONFIG_MAEMO 1'
8342 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8343 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
8344 else
8345 def_maemo='#undef CONFIG_MAEMO'
8347 echores "$_maemo"
8350 #############################################################################
8352 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
8353 # the OMF format needs to come after the 'extern symbol prefix' check, which
8354 # uses nm.
8355 if os2 ; then
8356 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
8359 # linker paths should be the same for mencoder and mplayer
8360 _ld_tmp=""
8361 for I in $libs_mplayer ; do
8362 _tmp=$(echo $I | sed -e 's/^-L.*$//')
8363 if test -z "$_tmp" ; then
8364 extra_ldflags="$extra_ldflags $I"
8365 else
8366 _ld_tmp="$_ld_tmp $I"
8368 done
8369 libs_mplayer=$_ld_tmp
8372 #############################################################################
8373 # 64 bit file offsets?
8374 if test "$_largefiles" = yes || freebsd ; then
8375 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
8376 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
8377 # dvdread support requires this (for off64_t)
8378 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
8382 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
8384 # This must be the last test to be performed. Any other tests following it
8385 # could fail due to linker errors. libdvdnavmini is intentionally not linked
8386 # against libdvdread (to permit MPlayer to use its own copy of the library).
8387 # So any compilation using the flags added here but not linking against
8388 # libdvdread can fail.
8389 echocheck "DVD support (libdvdnav)"
8390 dvdnav_internal=no
8391 if test "$_dvdnav" = auto ; then
8392 if test "$_dvdread_internal" = yes ; then
8393 _dvdnav=yes
8394 dvdnav_internal=yes
8395 res_comment="internal"
8396 else
8397 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
8400 if test "$_dvdnav" = auto ; then
8401 cat > $TMPC <<EOF
8402 #include <inttypes.h>
8403 #include <dvdnav/dvdnav.h>
8404 int main(void) { dvdnav_t *dvd=0; return 0; }
8406 _dvdnav=no
8407 _dvdnavdir=$($_dvdnavconfig --cflags)
8408 _dvdnavlibs=$($_dvdnavconfig --libs)
8409 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
8411 if test "$_dvdnav" = yes ; then
8412 _largefiles=yes
8413 def_dvdnav='#define CONFIG_DVDNAV 1'
8414 if test "$dvdnav_internal" = yes ; then
8415 cflags_libdvdnav="-Ilibdvdnav"
8416 inputmodules="dvdnav(internal) $inputmodules"
8417 else
8418 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
8419 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
8420 inputmodules="dvdnav $inputmodules"
8422 else
8423 def_dvdnav='#undef CONFIG_DVDNAV'
8424 _noinputmodules="dvdnav $_noinputmodules"
8426 echores "$_dvdnav"
8428 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8429 # Read dvdnav comment above.
8431 mak_enable () {
8432 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8433 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8434 nprefix=$3;
8435 for part in $list; do
8436 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8437 echo "${nprefix}_$part = yes"
8439 done
8442 #############################################################################
8443 echo "Creating config.mak"
8444 cat > config.mak << EOF
8445 # -------- Generated by configure -----------
8447 # Ensure that locale settings do not interfere with shell commands.
8448 export LC_ALL = C
8450 CONFIGURATION = $_configuration
8452 CHARSET = $_charset
8453 DOC_LANGS = $language_doc
8454 DOC_LANG_ALL = $doc_lang_all
8455 MAN_LANGS = $language_man
8456 MAN_LANG_ALL = $man_lang_all
8458 prefix = \$(DESTDIR)$_prefix
8459 BINDIR = \$(DESTDIR)$_bindir
8460 DATADIR = \$(DESTDIR)$_datadir
8461 LIBDIR = \$(DESTDIR)$_libdir
8462 MANDIR = \$(DESTDIR)$_mandir
8463 CONFDIR = \$(DESTDIR)$_confdir
8465 AR = $_ar
8466 AS = $_cc
8467 CC = $_cc
8468 CXX = $_cc
8469 HOST_CC = $_host_cc
8470 INSTALL = $_install
8471 INSTALLSTRIP = $_install_strip
8472 WINDRES = $_windres
8474 CFLAGS = $CFLAGS $extra_cflags
8475 ASFLAGS = \$(CFLAGS)
8476 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
8478 CFLAGS_DHAHELPER = $cflags_dhahelper
8479 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
8480 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
8481 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
8482 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
8483 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
8484 CFLAGS_STACKREALIGN = $cflags_stackrealign
8485 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
8486 CFLAGS_TREMOR_LOW = $cflags_tremor_low
8488 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
8489 EXTRALIBS_MPLAYER = $libs_mplayer
8490 EXTRALIBS_MENCODER = $libs_mencoder
8492 GETCH = $_getch
8493 HELP_FILE = $_mp_help
8494 TIMER = $_timer
8496 EXESUF = $_exesuf
8497 EXESUFS_ALL = .exe
8499 ARCH = $arch
8500 $(mak_enable "$arch_all" "$arch" ARCH)
8501 $(mak_enable "$subarch_all" "$subarch" ARCH)
8502 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
8504 MENCODER = $_mencoder
8505 MPLAYER = $_mplayer
8507 NEED_GETTIMEOFDAY = $_need_gettimeofday
8508 NEED_GLOB = $_need_glob
8509 NEED_MMAP = $_need_mmap
8510 NEED_SETENV = $_need_setenv
8511 NEED_SHMEM = $_need_shmem
8512 NEED_STRSEP = $_need_strsep
8513 NEED_SWAB = $_need_swab
8514 NEED_VSSCANF = $_need_vsscanf
8516 # features
8517 3DFX = $_3dfx
8518 AA = $_aa
8519 ALSA1X = $_alsa1x
8520 ALSA9 = $_alsa9
8521 ALSA5 = $_alsa5
8522 APPLE_IR = $_apple_ir
8523 APPLE_REMOTE = $_apple_remote
8524 ARTS = $_arts
8525 AUDIO_INPUT = $_audio_input
8526 BITMAP_FONT = $_bitmap_font
8527 BL = $_bl
8528 CACA = $_caca
8529 CDDA = $_cdda
8530 CDDB = $_cddb
8531 COREAUDIO = $_coreaudio
8532 COREVIDEO = $_corevideo
8533 DART = $_dart
8534 DFBMGA = $_dfbmga
8535 DGA = $_dga
8536 DIRECT3D = $_direct3d
8537 DIRECTFB = $_directfb
8538 DIRECTX = $_directx
8539 DVBIN = $_dvbin
8540 DVDNAV = $_dvdnav
8541 DVDNAV_INTERNAL = $dvdnav_internal
8542 DVDREAD = $_dvdread
8543 DVDREAD_INTERNAL = $_dvdread_internal
8544 DXR2 = $_dxr2
8545 DXR3 = $_dxr3
8546 ESD = $_esd
8547 FAAC=$_faac
8548 FAAD = $_faad
8549 FAAD_INTERNAL = $_faad_internal
8550 FASTMEMCPY = $_fastmemcpy
8551 FBDEV = $_fbdev
8552 FREETYPE = $_freetype
8553 FTP = $_ftp
8554 GIF = $_gif
8555 GGI = $_ggi
8556 GL = $_gl
8557 GL_WIN32 = $_gl_win32
8558 GL_X11 = $_gl_x11
8559 GL_SDL = $_gl_sdl
8560 MATRIXVIEW = $matrixview
8561 GUI = $_gui
8562 GUI_GTK = $_gui_gtk
8563 GUI_WIN32 = $_gui_win32
8564 HAVE_POSIX_SELECT = $_posix_select
8565 HAVE_SYS_MMAN_H = $_mman
8566 IVTV = $_ivtv
8567 JACK = $_jack
8568 JOYSTICK = $_joystick
8569 JPEG = $_jpeg
8570 KAI = $_kai
8571 KVA = $_kva
8572 LADSPA = $_ladspa
8573 LIBA52 = $_liba52
8574 LIBASS = $_ass
8575 LIBASS_INTERNAL = $ass_internal
8576 LIBBS2B = $_libbs2b
8577 LIBDCA = $_libdca
8578 LIBDV = $_libdv
8579 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
8580 LIBLZO = $_liblzo
8581 LIBMAD = $_mad
8582 LIBMENU = $_menu
8583 LIBMENU_DVBIN = $_menu_dvbin
8584 LIBMPEG2 = $_libmpeg2
8585 LIBNEMESI = $_nemesi
8586 LIBNUT = $_libnut
8587 LIBSMBCLIENT = $_smb
8588 LIBTHEORA = $_theora
8589 LIRC = $_lirc
8590 LIVE555 = $_live
8591 MACOSX_FINDER = $_macosx_finder
8592 MD5SUM = $_md5sum
8593 MGA = $_mga
8594 MNG = $_mng
8595 MP3LAME = $_mp3lame
8596 MP3LIB = $_mp3lib
8597 MUSEPACK = $_musepack
8598 NAS = $_nas
8599 NATIVE_RTSP = $_native_rtsp
8600 NETWORK = $_network
8601 OPENAL = $_openal
8602 OSS = $_ossaudio
8603 PE_EXECUTABLE = $_pe_executable
8604 PNG = $_png
8605 PNM = $_pnm
8606 PRIORITY = $_priority
8607 PULSE = $_pulse
8608 PVR = $_pvr
8609 QTX_CODECS = $_qtx
8610 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8611 QTX_EMULATION = $_qtx_emulation
8612 QUARTZ = $_quartz
8613 RADIO=$_radio
8614 RADIO_CAPTURE=$_radio_capture
8615 REAL_CODECS = $_real
8616 S3FB = $_s3fb
8617 SDL = $_sdl
8618 SPEEX = $_speex
8619 STREAM_CACHE = $_stream_cache
8620 SGIAUDIO = $_sgiaudio
8621 SUNAUDIO = $_sunaudio
8622 SVGA = $_svga
8623 TDFXFB = $_tdfxfb
8624 TDFXVID = $_tdfxvid
8625 TGA = $_tga
8626 TOOLAME=$_toolame
8627 TREMOR_INTERNAL = $_tremor_internal
8628 TV = $_tv
8629 TV_BSDBT848 = $_tv_bsdbt848
8630 TV_DSHOW = $_tv_dshow
8631 TV_V4L = $_tv_v4l
8632 TV_V4L1 = $_tv_v4l1
8633 TV_V4L2 = $_tv_v4l2
8634 TWOLAME=$_twolame
8635 UNRAR_EXEC = $_unrar_exec
8636 V4L2 = $_v4l2
8637 VCD = $_vcd
8638 VDPAU = $_vdpau
8639 VESA = $_vesa
8640 VIDIX = $_vidix
8641 VIDIX_PCIDB = $_vidix_pcidb_val
8642 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8643 VIDIX_IVTV=$_vidix_drv_ivtv
8644 VIDIX_MACH64=$_vidix_drv_mach64
8645 VIDIX_MGA=$_vidix_drv_mga
8646 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8647 VIDIX_NVIDIA=$_vidix_drv_nvidia
8648 VIDIX_PM2=$_vidix_drv_pm2
8649 VIDIX_PM3=$_vidix_drv_pm3
8650 VIDIX_RADEON=$_vidix_drv_radeon
8651 VIDIX_RAGE128=$_vidix_drv_rage128
8652 VIDIX_S3=$_vidix_drv_s3
8653 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8654 VIDIX_SIS=$_vidix_drv_sis
8655 VIDIX_UNICHROME=$_vidix_drv_unichrome
8656 VORBIS = $_vorbis
8657 VSTREAM = $_vstream
8658 WII = $_wii
8659 WIN32DLL = $_win32dll
8660 WIN32WAVEOUT = $_win32waveout
8661 WIN32_EMULATION = $_win32_emulation
8662 WINVIDIX = $winvidix
8663 X11 = $_x11
8664 X264 = $_x264
8665 XANIM_CODECS = $_xanim
8666 XMGA = $_xmga
8667 XMMS_PLUGINS = $_xmms
8668 XV = $_xv
8669 XVID4 = $_xvid
8670 XVIDIX = $xvidix
8671 XVMC = $_xvmc
8672 XVR100 = $_xvr100
8673 YUV4MPEG = $_yuv4mpeg
8674 ZR = $_zr
8676 # FFmpeg
8677 LIBAVUTIL = $_libavutil
8678 LIBAVUTIL_A = $_libavutil_a
8679 LIBAVUTIL_SO = $_libavutil_so
8680 LIBAVCODEC = $_libavcodec
8681 LIBAVCODEC_A = $_libavcodec_a
8682 LIBAVCODEC_SO = $_libavcodec_so
8683 LIBAVFORMAT = $_libavformat
8684 LIBAVFORMAT_A = $_libavformat_a
8685 LIBAVFORMAT_SO = $_libavformat_so
8686 LIBPOSTPROC = $_libpostproc
8687 LIBPOSTPROC_A = $_libpostproc_a
8688 LIBPOSTPROC_SO = $_libpostproc_so
8689 LIBSWSCALE = $_libswscale
8690 LIBSWSCALE_A = $_libswscale_a
8691 LIBSWSCALE_SO = $_libswscale_so
8693 HOSTCC = \$(HOST_CC)
8694 HOSTCFLAGS = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
8695 HOSTLIBS = -lm
8696 CC_O = -o \$@
8697 LD = gcc
8698 RANLIB = $_ranlib
8699 YASM = $_yasm
8700 YASMFLAGS = $YASMFLAGS
8702 CONFIG_STATIC = yes
8703 SRC_PATH = ..
8704 BUILD_ROOT = ..
8705 LIBPREF = lib
8706 LIBSUF = .a
8707 LIBNAME = \$(LIBPREF)\$(NAME)\$(LIBSUF)
8708 FULLNAME = \$(NAME)\$(BUILDSUF)
8710 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8711 CONFIG_AANDCT = yes
8712 CONFIG_DCT = yes
8713 CONFIG_DWT = yes
8714 CONFIG_FFT = yes
8715 CONFIG_GOLOMB = yes
8716 CONFIG_H264DSP = yes
8717 CONFIG_LPC = yes
8718 CONFIG_LSP = yes
8719 CONFIG_MDCT = yes
8720 CONFIG_RDFT = yes
8722 $mak_hardcoded_tables
8723 $mak_libavcodec_mpegaudio_hp
8724 !CONFIG_LIBRTMP = yes
8726 CONFIG_BZLIB = $bzlib
8727 CONFIG_ENCODERS = yes
8728 CONFIG_GPL = yes
8729 CONFIG_LIBDIRAC_DECODER = $_libdirac_lavc
8730 CONFIG_LIBDIRAC_ENCODER = $_libdirac_lavc
8731 CONFIG_LIBFAAC_ENCODER = $_faac_lavc
8732 CONFIG_LIBMP3LAME_ENCODER = $_mp3lame_lavc
8733 CONFIG_LIBOPENCORE_AMRNB_DECODER = $_libopencore_amrnb
8734 CONFIG_LIBOPENCORE_AMRNB_ENCODER = $_libopencore_amrnb
8735 CONFIG_LIBOPENCORE_AMRWB_DECODER = $_libopencore_amrwb
8736 OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
8737 OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
8738 CONFIG_LIBSCHROEDINGER_DECODER = $_libschroedinger_lavc
8739 CONFIG_LIBSCHROEDINGER_ENCODER = $_libschroedinger_lavc
8740 CONFIG_LIBVORBIS_ENCODER = $_libvorbis
8741 CONFIG_LIBX264_ENCODER = $_x264_lavc
8742 CONFIG_LIBXVID_ENCODER = $_xvid_lavc
8743 CONFIG_MLIB = $_mlib
8744 CONFIG_MUXERS = $_mencoder
8745 CONFIG_POSTPROC = yes
8746 CONFIG_VDPAU = $_vdpau
8747 CONFIG_XVMC = $_xvmc
8748 CONFIG_ZLIB = $_zlib
8750 HAVE_PTHREADS = $_pthreads
8751 HAVE_SHM = $_shm
8752 HAVE_W32THREADS = $_w32threads
8753 HAVE_YASM = $have_yasm
8755 $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8756 $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8757 $(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8758 $(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8759 $(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8760 $(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8761 $(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8762 $(echo $_libavhwaccels | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8765 #############################################################################
8767 ff_config_enable () {
8768 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8769 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8770 _nprefix=$3;
8771 test -z "$_nprefix" && _nprefix='CONFIG'
8772 for part in $list; do
8773 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8774 echo "#define ${_nprefix}_$part 1"
8775 else
8776 echo "#define ${_nprefix}_$part 0"
8778 done
8781 echo "Creating config.h"
8782 cat > $TMPH << EOF
8783 /*----------------------------------------------------------------------------
8784 ** This file has been automatically generated by configure any changes in it
8785 ** will be lost when you run configure again.
8786 ** Instead of modifying definitions here, use the --enable/--disable options
8787 ** of the configure script! See ./configure --help for details.
8788 *---------------------------------------------------------------------------*/
8790 #ifndef MPLAYER_CONFIG_H
8791 #define MPLAYER_CONFIG_H
8793 /* Undefine this if you do not want to select mono audio (left or right)
8794 with a stereo MPEG layer 2/3 audio stream. The command line option
8795 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8796 right-only), with 0 being the default.
8798 #define CONFIG_FAKE_MONO 1
8800 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8801 #define MAX_OUTBURST 65536
8803 /* set up audio OUTBURST. Do not change this! */
8804 #define OUTBURST 512
8806 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8807 #undef FAST_OSD
8808 #undef FAST_OSD_TABLE
8810 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8811 #define MPEG12_POSTPROC 1
8812 #define ATTRIBUTE_ALIGNED_MAX 16
8816 #define CONFIGURATION "$_configuration"
8818 #define MPLAYER_DATADIR "$_datadir"
8819 #define MPLAYER_CONFDIR "$_confdir"
8820 #define MPLAYER_LIBDIR "$_libdir"
8822 /* definitions needed by included libraries */
8823 #define HAVE_INTTYPES_H 1
8824 /* libmpeg2 + FFmpeg */
8825 $def_fast_inttypes
8826 /* libdvdcss */
8827 #define HAVE_ERRNO_H 1
8828 /* libdvdcss + libdvdread */
8829 #define HAVE_LIMITS_H 1
8830 /* libdvdcss + libfaad2 */
8831 #define HAVE_UNISTD_H 1
8832 /* libfaad2 + libdvdread */
8833 #define STDC_HEADERS 1
8834 #define HAVE_MEMCPY 1
8835 /* libfaad2 */
8836 #define HAVE_STRING_H 1
8837 #define HAVE_STRINGS_H 1
8838 #define HAVE_SYS_STAT_H 1
8839 #define HAVE_SYS_TYPES_H 1
8840 /* libdvdnav */
8841 #define READ_CACHE_TRACE 0
8842 /* libdvdread */
8843 #define HAVE_DLFCN_H 1
8844 $def_dvdcss
8847 /* system headers */
8848 $def_alloca_h
8849 $def_alsa_asoundlib_h
8850 $def_altivec_h
8851 $def_malloc_h
8852 $def_mman_h
8853 $def_mman_has_map_failed
8854 $def_soundcard_h
8855 $def_sys_asoundlib_h
8856 $def_sys_soundcard_h
8857 $def_sys_sysinfo_h
8858 $def_termios_h
8859 $def_termios_sys_h
8860 $def_winsock2_h
8863 /* system functions */
8864 $def_gethostbyname2
8865 $def_gettimeofday
8866 $def_glob
8867 $def_langinfo
8868 $def_lrintf
8869 $def_map_memalign
8870 $def_memalign
8871 $def_nanosleep
8872 $def_posix_select
8873 $def_select
8874 $def_setenv
8875 $def_setmode
8876 $def_shm
8877 $def_strsep
8878 $def_swab
8879 $def_sysi86
8880 $def_sysi86_iv
8881 $def_termcap
8882 $def_termios
8883 $def_vsscanf
8886 /* system-specific features */
8887 $def_asmalign_pot
8888 $def_builtin_expect
8889 $def_dl
8890 $def_dos_paths
8891 $def_extern_asm
8892 $def_extern_prefix
8893 $def_iconv
8894 $def_kstat
8895 $def_macosx_bundle
8896 $def_macosx_finder
8897 $def_maemo
8898 $def_named_asm_args
8899 $def_priority
8900 $def_quicktime
8901 $def_restrict_keyword
8902 $def_rtc
8903 $def_unrar_exec
8906 /* configurable options */
8907 $def_charset
8908 $def_crash_debug
8909 $def_debug
8910 $def_dynamic_plugins
8911 $def_fastmemcpy
8912 $def_menu
8913 $def_runtime_cpudetection
8914 $def_sighandler
8915 $def_sortsub
8916 $def_stream_cache
8917 $def_pthread_cache
8920 /* CPU stuff */
8921 #define __CPU__ $iproc
8922 $def_words_endian
8923 $def_bigendian
8924 $(ff_config_enable "$arch_all" "$arch" "ARCH")
8925 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
8926 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
8929 /* DVD/VCD/CD */
8930 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8931 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8932 $def_bsdi_dvd
8933 $def_cddb
8934 $def_cdio
8935 $def_cdparanoia
8936 $def_cdrom
8937 $def_dvd
8938 $def_dvd_bsd
8939 $def_dvd_darwin
8940 $def_dvd_linux
8941 $def_dvd_openbsd
8942 $def_dvdio
8943 $def_dvdnav
8944 $def_dvdread
8945 $def_hpux_scsi_h
8946 $def_libcdio
8947 $def_sol_scsi_h
8948 $def_vcd
8951 /* codec libraries */
8952 $def_faac
8953 $def_faad
8954 $def_faad_internal
8955 $def_liba52
8956 $def_libdca
8957 $def_libdv
8958 $def_liblzo
8959 $def_libmpeg2
8960 $def_mad
8961 $def_mp3lame
8962 $def_mp3lame_preset
8963 $def_mp3lame_preset_medium
8964 $def_mp3lib
8965 $def_musepack
8966 $def_speex
8967 $def_theora
8968 $def_toolame
8969 $def_tremor
8970 $def_twolame
8971 $def_vorbis
8972 $def_x264
8973 $def_xvid
8974 $def_zlib
8976 $def_libnut
8979 /* binary codecs */
8980 $def_qtx
8981 $def_qtx_win32
8982 $def_real
8983 $def_win32_loader
8984 $def_win32dll
8985 $def_xanim
8986 $def_xmms
8987 #define BINARY_CODECS_PATH "$_codecsdir"
8988 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8991 /* GUI */
8992 $def_gtk2
8993 $def_gui
8994 $def_xshape
8997 /* Audio output drivers */
8998 $def_alsa
8999 $def_alsa1x
9000 $def_alsa5
9001 $def_alsa9
9002 $def_arts
9003 $def_coreaudio
9004 $def_dart
9005 $def_esd
9006 $def_esd_latency
9007 $def_jack
9008 $def_kai
9009 $def_nas
9010 $def_openal
9011 $def_openal_h
9012 $def_ossaudio
9013 $def_ossaudio_devdsp
9014 $def_ossaudio_devmixer
9015 $def_pulse
9016 $def_sgiaudio
9017 $def_sunaudio
9018 $def_win32waveout
9020 $def_ladspa
9021 $def_libbs2b
9024 /* input */
9025 $def_apple_ir
9026 $def_apple_remote
9027 $def_ioctl_bt848_h_name
9028 $def_ioctl_meteor_h_name
9029 $def_joystick
9030 $def_lirc
9031 $def_lircc
9032 $def_pvr
9033 $def_radio
9034 $def_radio_bsdbt848
9035 $def_radio_capture
9036 $def_radio_v4l
9037 $def_radio_v4l2
9038 $def_tv
9039 $def_tv_bsdbt848
9040 $def_tv_dshow
9041 $def_tv_v4l
9042 $def_tv_v4l1
9043 $def_tv_v4l2
9046 /* font stuff */
9047 $def_ass
9048 $def_ass_internal
9049 $def_bitmap_font
9050 $def_enca
9051 $def_fontconfig
9052 $def_freetype
9053 $def_fribidi
9056 /* networking */
9057 $def_closesocket
9058 $def_ftp
9059 $def_inet6
9060 $def_inet_aton
9061 $def_inet_pton
9062 $def_live
9063 $def_nemesi
9064 $def_network
9065 $def_smb
9066 $def_socklen_t
9067 $def_struct_ipv6_mreq
9068 $def_struct_sockaddr_in6
9069 $def_struct_sockaddr_sa_len
9070 $def_vstream
9071 $def_addrinfo
9072 $def_getaddrinfo
9073 $def_sockaddr_storage
9076 /* libvo options */
9077 $def_3dfx
9078 $def_aa
9079 $def_bl
9080 $def_caca
9081 $def_corevideo
9082 $def_dfbmga
9083 $def_dga
9084 $def_dga1
9085 $def_dga2
9086 $def_direct3d
9087 $def_directfb
9088 $def_directfb_version
9089 $def_directx
9090 $def_dvb
9091 $def_dvbin
9092 $def_dxr2
9093 $def_dxr3
9094 $def_fbdev
9095 $def_ggi
9096 $def_ggiwmh
9097 $def_gif
9098 $def_gif_4
9099 $def_gif_tvt_hack
9100 $def_gl
9101 $def_gl_win32
9102 $def_gl_x11
9103 $def_gl_sdl
9104 $def_matrixview
9105 $def_ivtv
9106 $def_jpeg
9107 $def_kva
9108 $def_md5sum
9109 $def_mga
9110 $def_mng
9111 $def_png
9112 $def_pnm
9113 $def_quartz
9114 $def_s3fb
9115 $def_sdl
9116 $def_sdl_sdl_h
9117 $def_svga
9118 $def_tdfxfb
9119 $def_tdfxvid
9120 $def_tga
9121 $def_v4l2
9122 $def_vdpau
9123 $def_vesa
9124 $def_vidix
9125 $def_vidix_drv_cyberblade
9126 $def_vidix_drv_ivtv
9127 $def_vidix_drv_mach64
9128 $def_vidix_drv_mga
9129 $def_vidix_drv_mga_crtc2
9130 $def_vidix_drv_nvidia
9131 $def_vidix_drv_pm3
9132 $def_vidix_drv_radeon
9133 $def_vidix_drv_rage128
9134 $def_vidix_drv_s3
9135 $def_vidix_drv_sh_veu
9136 $def_vidix_drv_sis
9137 $def_vidix_drv_unichrome
9138 $def_vidix_pfx
9139 $def_vm
9140 $def_wii
9141 $def_x11
9142 $def_xdpms
9143 $def_xf86keysym
9144 $def_xinerama
9145 $def_xmga
9146 $def_xss
9147 $def_xv
9148 $def_xvmc
9149 $def_xvr100
9150 $def_yuv4mpeg
9151 $def_zr
9154 /* FFmpeg */
9155 $def_libavcodec
9156 $def_libavcodec_a
9157 $def_libavcodec_so
9158 $def_libavformat
9159 $def_libavformat_a
9160 $def_libavformat_so
9161 $def_libavutil
9162 $def_libavutil_a
9163 $def_libavutil_so
9164 $def_libpostproc
9165 $def_libpostproc_a
9166 $def_libpostproc_so
9167 $def_libswscale
9168 $def_libswscale_a
9169 $def_libswscale_so
9171 #define CONFIG_DECODERS 1
9172 #define CONFIG_ENCODERS 1
9173 #define CONFIG_DEMUXERS 1
9174 $def_muxers
9176 $def_arpa_inet_h
9177 $def_bswap
9178 $def_bzlib
9179 $def_dcbzl
9180 $def_exp2
9181 $def_exp2f
9182 $def_fast_64bit
9183 $def_fast_unaligned
9184 $def_hardcoded_tables
9185 $def_libavcodec_mpegaudio_hp
9186 $def_llrint
9187 $def_llrintf
9188 $def_local_aligned_8
9189 $def_local_aligned_16
9190 $def_log2
9191 $def_log2f
9192 $def_lrint
9193 $def_memalign_hack
9194 $def_mlib
9195 $def_mkstemp
9196 $def_posix_memalign
9197 $def_pthreads
9198 $def_round
9199 $def_roundf
9200 $def_ten_operands
9201 $def_threads
9202 $def_truncf
9203 $def_xform_asm
9204 $def_yasm
9206 #define CONFIG_FASTDIV 0
9207 #define CONFIG_FFSERVER 0
9208 #define CONFIG_GPL 1
9209 #define CONFIG_GRAY 0
9210 #define CONFIG_LIBRTMP 0
9211 #define CONFIG_LIBVORBIS 0
9212 #define CONFIG_POWERPC_PERF 0
9213 #define CONFIG_SMALL 0
9214 #define CONFIG_SWSCALE_ALPHA 1
9216 #if defined(HAVE_AF_INET6) && (!defined(_WIN32) || defined(__CYGWIN__))
9217 #define CONFIG_IPV6 1
9218 #else
9219 #define CONFIG_IPV6 0
9220 #endif
9222 #define HAVE_ATTRIBUTE_MAY_ALIAS 1
9223 #define av_alias __attribute__((may_alias))
9224 #define HAVE_ATTRIBUTE_PACKED 1
9225 #define HAVE_GETHRTIME 0
9226 #define HAVE_INLINE_ASM 1
9227 #define HAVE_LDBRX 0
9228 #define HAVE_POLL_H 1
9229 #define HAVE_PPC4XX 0
9230 #define HAVE_STRERROR_R 0
9231 #define HAVE_SYS_SELECT_H 0
9232 #define HAVE_VFP_ARGS 1
9233 #define HAVE_VIRTUALALLOC 0
9235 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
9236 #define CONFIG_AANDCT 1
9237 #define CONFIG_DCT 1
9238 #define CONFIG_DWT 1
9239 #define CONFIG_FFT 1
9240 #define CONFIG_GOLOMB 1
9241 #define CONFIG_H264DSP 1
9242 #define CONFIG_LPC 1
9243 #define CONFIG_MDCT 1
9244 #define CONFIG_RDFT 1
9246 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
9247 $def_ebx_available
9248 #ifndef MP_DEBUG
9249 #define HAVE_EBP_AVAILABLE 1
9250 #else
9251 #define HAVE_EBP_AVAILABLE 0
9252 #endif
9254 #define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
9255 #define FFMPEG_LICENSE "GPL version 2 or later"
9257 /* External libraries used through libavcodec. */
9258 $def_faac_lavc
9259 $def_libdirac_lavc
9260 $def_libopencore_amrnb
9261 $def_libopencore_amrwb
9262 $def_libopenjpeg
9263 $def_libschroedinger_lavc
9264 $def_mp3lame_lavc
9265 $def_x264_lavc
9266 $def_xvid_lavc
9268 $(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
9269 $(ff_config_enable "$_libavencoders_all" "$_libavencoders")
9270 $(ff_config_enable "$_libavparsers_all" "$_libavparsers")
9271 $(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
9272 $(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
9273 $(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
9274 $(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
9275 $(ff_config_enable "$_libavhwaccels_all" "$_libavhwaccels")
9277 #endif /* MPLAYER_CONFIG_H */
9280 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
9281 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
9283 ############################################################################
9285 # Create avconfig.h for FFmpeg.
9286 cat > "$TMPH" << EOF
9287 /* Generated by mpconfigure */
9288 #ifndef AVUTIL_AVCONFIG_H
9289 #define AVUTIL_AVCONFIG_H
9290 $def_av_bigendian
9291 #endif /* AVUTIL_AVCONFIG_H */
9294 # Do not overwrite an unchanged avconfig.h to avoid superfluous rebuilds.
9295 cmp -s "$TMPH" libavutil/avconfig.h || mv -f "$TMPH" libavutil/avconfig.h
9297 #############################################################################
9299 cat << EOF
9301 Config files successfully generated by ./configure $_configuration !
9303 Install prefix: $_prefix
9304 Data directory: $_datadir
9305 Config direct.: $_confdir
9307 Byte order: $_byte_order
9308 Optimizing for: $_optimizing
9310 Languages:
9311 Messages/GUI: $language_msg
9312 Manual pages: $language_man
9313 Documentation: $language_doc
9315 Enabled optional drivers:
9316 Input: $inputmodules
9317 Codecs: $codecmodules
9318 Audio output: $aomodules
9319 Video output: $vomodules
9321 Disabled optional drivers:
9322 Input: $_noinputmodules
9323 Codecs: $nocodecmodules
9324 Audio output: $noaomodules
9325 Video output: $novomodules
9327 'config.h' and 'config.mak' contain your configuration options.
9328 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
9329 compile *** DO NOT REPORT BUGS if you tweak these files ***
9331 'make' will now compile MPlayer and 'make install' will install it.
9332 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
9337 if test "$_mtrr" = yes ; then
9338 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
9339 echo
9342 if ! x86_32; then
9343 cat <<EOF
9344 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
9345 operating system ($system_name). You may encounter a few files that cannot
9346 be played due to missing open source video/audio codec support.
9352 cat <<EOF
9353 Check $TMPLOG if you wonder why an autodetection failed (make sure
9354 development headers/packages are installed).
9356 NOTE: The --enable-* parameters unconditionally force options on, completely
9357 skipping autodetection. This behavior is unlike what you may be used to from
9358 autoconf-based configure scripts that can decide to override you. This greater
9359 level of control comes at a price. You may have to provide the correct compiler
9360 and linker flags yourself.
9361 If you used one of these options (except --enable-menu and similar ones that
9362 turn on internal features) and experience a compilation or linking failure,
9363 make sure you have passed the necessary compiler/linker flags to configure.
9365 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
9369 if test "$_warn_CFLAGS" = yes; then
9370 cat <<EOF
9372 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
9373 but:
9375 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
9377 It is strongly recommended to let MPlayer choose the correct CFLAGS!
9378 To do so, execute 'CFLAGS= ./configure <options>'
9383 # Last move:
9384 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"