cosmetics: vertical alignment in msg module help output
[mplayer/glamo.git] / configure
blob021708e83d19290639bad0d086e833c1210570b5
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-glib-config=PATH path to glib*-config
492 --with-gtk-config=PATH path to gtk*-config
493 --with-sdl-config=PATH path to sdl*-config
494 --with-dvdnav-config=PATH path to dvdnav-config
495 --with-dvdread-config=PATH path to dvdread-config
497 This configure script is NOT autoconf-based, even though its output is similar.
498 It will try to autodetect all configuration options. If you --enable an option
499 it will be forcefully turned on, skipping autodetection. This can break
500 compilation, so you need to know what you are doing.
502 exit 0
503 } #show_help()
505 # GOTCHA: the variables below defines the default behavior for autodetection
506 # and have - unless stated otherwise - at least 2 states : yes no
507 # If autodetection is available then the third state is: auto
508 _mmx=auto
509 _3dnow=auto
510 _3dnowext=auto
511 _mmxext=auto
512 _sse=auto
513 _sse2=auto
514 _ssse3=auto
515 _cmov=auto
516 _fast_cmov=auto
517 _fast_clz=auto
518 _armv5te=auto
519 _armv6=auto
520 _armv6t2=auto
521 _armvfp=auto
522 neon=auto
523 _iwmmxt=auto
524 _mtrr=auto
525 _altivec=auto
526 _install=install
527 _ranlib=ranlib
528 _windres=windres
529 _cc=cc
530 _ar=ar
531 test "$CC" && _cc="$CC"
532 _as=auto
533 _nm=auto
534 _yasm=yasm
535 _runtime_cpudetection=no
536 _cross_compile=auto
537 _prefix="/usr/local"
538 _libavutil_a=auto
539 _libavutil_so=auto
540 _libavcodec_a=auto
541 _libopencore_amrnb=auto
542 _libopencore_amrwb=auto
543 libopenjpeg=auto
544 _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
545 _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//)
546 _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
547 _libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//)
548 _libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
549 _libavparsers=$_libavparsers_all
550 _libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
551 _libavbsfs=$_libavbsfs_all
552 _libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
553 # Disable all hardware accelerators for now.
554 _libavhwaccels=
555 _libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
556 _libavdemuxers=$(echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/AVISYNTH_DEMUXER//)
557 _libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
558 _libavmuxers=$(echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// -e s/RTSP_MUXER//)
559 _libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
560 _libavprotocols=$_libavprotocols_all
561 _libavcodec_so=auto
562 _libavformat_a=auto
563 _libavformat_so=auto
564 _libpostproc_a=auto
565 _libpostproc_so=auto
566 _libswscale_a=auto
567 _libswscale_so=auto
568 _libavcodec_mpegaudio_hp=yes
569 _mencoder=yes
570 _mplayer=yes
571 _x11=auto
572 _xshape=auto
573 _xss=auto
574 _dga1=auto
575 _dga2=auto
576 _xv=auto
577 _xvmc=no #auto when complete
578 _vdpau=auto
579 _sdl=auto
580 _kva=auto
581 _direct3d=auto
582 _directx=auto
583 _win32waveout=auto
584 _nas=auto
585 _png=auto
586 _mng=auto
587 _jpeg=auto
588 _pnm=yes
589 _md5sum=yes
590 _yuv4mpeg=yes
591 _gif=auto
592 _gl=auto
593 matrixview=yes
594 _ggi=auto
595 _ggiwmh=auto
596 _aa=auto
597 _caca=auto
598 _svga=auto
599 _vesa=auto
600 _fbdev=auto
601 _dvb=auto
602 _dxr2=auto
603 _dxr3=auto
604 _ivtv=auto
605 _v4l2=auto
606 _iconv=auto
607 _langinfo=auto
608 _rtc=auto
609 _ossaudio=auto
610 _arts=auto
611 _esd=auto
612 _pulse=auto
613 _jack=auto
614 _kai=auto
615 _dart=auto
616 _openal=auto
617 _libcdio=auto
618 _liblzo=auto
619 _mad=auto
620 _mp3lame=auto
621 _mp3lame_lavc=auto
622 _toolame=auto
623 _twolame=auto
624 _tremor=auto
625 _tremor_internal=yes
626 _tremor_low=no
627 _libvorbis=auto
628 _speex=auto
629 _theora=auto
630 _mp3lib=auto
631 _liba52=auto
632 _libdca=auto
633 _libmpeg2=auto
634 _faad=auto
635 _faad_internal=auto
636 _faad_fixed=no
637 _faac=auto
638 _faac_lavc=auto
639 _ladspa=auto
640 _libbs2b=auto
641 _xmms=no
642 _vcd=auto
643 _dvdnav=auto
644 _dvdnavconfig=dvdnav-config
645 _dvdreadconfig=dvdread-config
646 _dvdread=auto
647 _dvdread_internal=auto
648 _libdvdcss_internal=auto
649 _xanim=auto
650 _real=auto
651 _live=auto
652 _nemesi=auto
653 _native_rtsp=yes
654 _xinerama=auto
655 _mga=auto
656 _xmga=auto
657 _vm=auto
658 _xf86keysym=auto
659 _mlib=no #broken, thus disabled
660 _sgiaudio=auto
661 _sunaudio=auto
662 _alsa=auto
663 _fastmemcpy=yes
664 hardcoded_tables=no
665 _unrar_exec=auto
666 _win32dll=auto
667 _select=yes
668 _radio=no
669 _radio_capture=no
670 _radio_v4l=auto
671 _radio_v4l2=auto
672 _radio_bsdbt848=auto
673 _tv=yes
674 _tv_v4l1=auto
675 _tv_v4l2=auto
676 _tv_bsdbt848=auto
677 _tv_dshow=auto
678 _pvr=auto
679 _network=yes
680 _winsock2_h=auto
681 _struct_addrinfo=auto
682 _getaddrinfo=auto
683 _struct_sockaddr_storage=auto
684 _smb=auto
685 _vidix=auto
686 _vidix_pcidb=yes
687 _dhahelper=no
688 _svgalib_helper=no
689 _joystick=no
690 _xvid=auto
691 _xvid_lavc=auto
692 _x264=auto
693 _x264_lavc=auto
694 _libdirac_lavc=auto
695 _libschroedinger_lavc=auto
696 _libnut=auto
697 _lirc=auto
698 _lircc=auto
699 _apple_remote=auto
700 _apple_ir=auto
701 _gui=no
702 _gtk1=no
703 _termcap=auto
704 _termios=auto
705 _3dfx=no
706 _s3fb=no
707 _wii=no
708 _tdfxfb=no
709 _tdfxvid=no
710 _xvr100=auto
711 _tga=yes
712 _directfb=auto
713 _zr=auto
714 _bl=no
715 _largefiles=yes
716 #language=en
717 _shm=auto
718 _linux_devfs=no
719 _charset="UTF-8"
720 _dynamic_plugins=no
721 _crash_debug=no
722 _sighandler=yes
723 _libdv=auto
724 _cdparanoia=auto
725 _cddb=auto
726 _big_endian=auto
727 _bitmap_font=yes
728 _freetype=auto
729 _fontconfig=auto
730 _menu=no
731 _qtx=auto
732 _maemo=auto
733 _coreaudio=auto
734 _corevideo=auto
735 _quartz=auto
736 quicktime=auto
737 _macosx_finder=no
738 _macosx_bundle=auto
739 _sortsub=yes
740 _freetypeconfig='freetype-config'
741 _fribidi=auto
742 _enca=auto
743 _inet6=auto
744 _gethostbyname2=auto
745 _ftp=yes
746 _musepack=auto
747 _vstream=auto
748 _pthreads=auto
749 _w32threads=auto
750 _ass=auto
751 ass_internal=yes
752 _rpath=no
753 _asmalign_pot=auto
754 _stream_cache=yes
755 _priority=no
756 def_dos_paths="#define HAVE_DOS_PATHS 0"
757 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
758 def_priority="#undef CONFIG_PRIORITY"
759 def_pthread_cache="#undef PTHREAD_CACHE"
760 _need_shmem=yes
761 for ac_option do
762 case "$ac_option" in
763 --help|-help|-h)
764 show_help
766 --prefix=*)
767 _prefix=$(echo $ac_option | cut -d '=' -f 2)
769 --bindir=*)
770 _bindir=$(echo $ac_option | cut -d '=' -f 2)
772 --datadir=*)
773 _datadir=$(echo $ac_option | cut -d '=' -f 2)
775 --mandir=*)
776 _mandir=$(echo $ac_option | cut -d '=' -f 2)
778 --confdir=*)
779 _confdir=$(echo $ac_option | cut -d '=' -f 2)
781 --libdir=*)
782 _libdir=$(echo $ac_option | cut -d '=' -f 2)
784 --codecsdir=*)
785 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
788 --with-install=*)
789 _install=$(echo $ac_option | cut -d '=' -f 2 )
791 --with-xvmclib=*)
792 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
795 --with-sdl-config=*)
796 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
798 --with-freetype-config=*)
799 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
801 --with-gtk-config=*)
802 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
804 --with-glib-config=*)
805 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
807 --with-dvdnav-config=*)
808 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
810 --with-dvdread-config=*)
811 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
814 --extra-cflags=*)
815 extra_cflags=$(echo $ac_option | cut -d '=' -f 2-)
817 --extra-ldflags=*)
818 extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-)
820 --extra-libs=*)
821 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
823 --extra-libs-mplayer=*)
824 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
826 --extra-libs-mencoder=*)
827 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
830 --target=*)
831 _target=$(echo $ac_option | cut -d '=' -f 2)
833 --cc=*)
834 _cc=$(echo $ac_option | cut -d '=' -f 2)
836 --host-cc=*)
837 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
839 --as=*)
840 _as=$(echo $ac_option | cut -d '=' -f 2)
842 --nm=*)
843 _nm=$(echo $ac_option | cut -d '=' -f 2)
845 --yasm=*)
846 _yasm=$(echo $ac_option | cut -d '=' -f 2)
848 --ar=*)
849 _ar=$(echo $ac_option | cut -d '=' -f 2)
851 --ranlib=*)
852 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
854 --windres=*)
855 _windres=$(echo $ac_option | cut -d '=' -f 2)
857 --charset=*)
858 _charset=$(echo $ac_option | cut -d '=' -f 2)
860 --language-doc=*)
861 language_doc=$(echo $ac_option | cut -d '=' -f 2)
863 --language-man=*)
864 language_man=$(echo $ac_option | cut -d '=' -f 2)
866 --language-msg=*)
867 language_msg=$(echo $ac_option | cut -d '=' -f 2)
869 --language=*)
870 language=$(echo $ac_option | cut -d '=' -f 2)
873 --enable-static)
874 _ld_static='-static'
876 --disable-static)
877 _ld_static=''
879 --enable-profile)
880 _profile='-p'
882 --disable-profile)
883 _profile=
885 --enable-debug)
886 _debug='-g'
888 --enable-debug=*)
889 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
891 --disable-debug)
892 _debug=
894 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
895 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
896 --enable-cross-compile) _cross_compile=yes ;;
897 --disable-cross-compile) _cross_compile=no ;;
898 --enable-mencoder) _mencoder=yes ;;
899 --disable-mencoder) _mencoder=no ;;
900 --enable-mplayer) _mplayer=yes ;;
901 --disable-mplayer) _mplayer=no ;;
902 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
903 --disable-dynamic-plugins) _dynamic_plugins=no ;;
904 --enable-x11) _x11=yes ;;
905 --disable-x11) _x11=no ;;
906 --enable-xshape) _xshape=yes ;;
907 --disable-xshape) _xshape=no ;;
908 --enable-xss) _xss=yes ;;
909 --disable-xss) _xss=no ;;
910 --enable-xv) _xv=yes ;;
911 --disable-xv) _xv=no ;;
912 --enable-xvmc) _xvmc=yes ;;
913 --disable-xvmc) _xvmc=no ;;
914 --enable-vdpau) _vdpau=yes ;;
915 --disable-vdpau) _vdpau=no ;;
916 --enable-sdl) _sdl=yes ;;
917 --disable-sdl) _sdl=no ;;
918 --enable-kva) _kva=yes ;;
919 --disable-kva) _kva=no ;;
920 --enable-direct3d) _direct3d=yes ;;
921 --disable-direct3d) _direct3d=no ;;
922 --enable-directx) _directx=yes ;;
923 --disable-directx) _directx=no ;;
924 --enable-win32waveout) _win32waveout=yes ;;
925 --disable-win32waveout) _win32waveout=no ;;
926 --enable-nas) _nas=yes ;;
927 --disable-nas) _nas=no ;;
928 --enable-png) _png=yes ;;
929 --disable-png) _png=no ;;
930 --enable-mng) _mng=yes ;;
931 --disable-mng) _mng=no ;;
932 --enable-jpeg) _jpeg=yes ;;
933 --disable-jpeg) _jpeg=no ;;
934 --enable-libopenjpeg) libopenjpeg=yes ;;
935 --disable-libopenjpeg)libopenjpeg=no ;;
936 --enable-pnm) _pnm=yes ;;
937 --disable-pnm) _pnm=no ;;
938 --enable-md5sum) _md5sum=yes ;;
939 --disable-md5sum) _md5sum=no ;;
940 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
941 --disable-yuv4mpeg) _yuv4mpeg=no ;;
942 --enable-gif) _gif=yes ;;
943 --disable-gif) _gif=no ;;
944 --enable-gl) _gl=yes ;;
945 --disable-gl) _gl=no ;;
946 --enable-matrixview) matrixview=yes ;;
947 --disable-matrixview) matrixview=no ;;
948 --enable-ggi) _ggi=yes ;;
949 --disable-ggi) _ggi=no ;;
950 --enable-ggiwmh) _ggiwmh=yes ;;
951 --disable-ggiwmh) _ggiwmh=no ;;
952 --enable-aa) _aa=yes ;;
953 --disable-aa) _aa=no ;;
954 --enable-caca) _caca=yes ;;
955 --disable-caca) _caca=no ;;
956 --enable-svga) _svga=yes ;;
957 --disable-svga) _svga=no ;;
958 --enable-vesa) _vesa=yes ;;
959 --disable-vesa) _vesa=no ;;
960 --enable-fbdev) _fbdev=yes ;;
961 --disable-fbdev) _fbdev=no ;;
962 --enable-dvb) _dvb=yes ;;
963 --disable-dvb) _dvb=no ;;
964 --enable-dxr2) _dxr2=yes ;;
965 --disable-dxr2) _dxr2=no ;;
966 --enable-dxr3) _dxr3=yes ;;
967 --disable-dxr3) _dxr3=no ;;
968 --enable-ivtv) _ivtv=yes ;;
969 --disable-ivtv) _ivtv=no ;;
970 --enable-v4l2) _v4l2=yes ;;
971 --disable-v4l2) _v4l2=no ;;
972 --enable-iconv) _iconv=yes ;;
973 --disable-iconv) _iconv=no ;;
974 --enable-langinfo) _langinfo=yes ;;
975 --disable-langinfo) _langinfo=no ;;
976 --enable-rtc) _rtc=yes ;;
977 --disable-rtc) _rtc=no ;;
978 --enable-libdv) _libdv=yes ;;
979 --disable-libdv) _libdv=no ;;
980 --enable-ossaudio) _ossaudio=yes ;;
981 --disable-ossaudio) _ossaudio=no ;;
982 --enable-arts) _arts=yes ;;
983 --disable-arts) _arts=no ;;
984 --enable-esd) _esd=yes ;;
985 --disable-esd) _esd=no ;;
986 --enable-pulse) _pulse=yes ;;
987 --disable-pulse) _pulse=no ;;
988 --enable-jack) _jack=yes ;;
989 --disable-jack) _jack=no ;;
990 --enable-openal) _openal=yes ;;
991 --disable-openal) _openal=no ;;
992 --enable-kai) _kai=yes ;;
993 --disable-kai) _kai=no ;;
994 --enable-dart) _dart=yes ;;
995 --disable-dart) _dart=no ;;
996 --enable-mad) _mad=yes ;;
997 --disable-mad) _mad=no ;;
998 --enable-mp3lame) _mp3lame=yes ;;
999 --disable-mp3lame) _mp3lame=no ;;
1000 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
1001 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
1002 --enable-toolame) _toolame=yes ;;
1003 --disable-toolame) _toolame=no ;;
1004 --enable-twolame) _twolame=yes ;;
1005 --disable-twolame) _twolame=no ;;
1006 --enable-libcdio) _libcdio=yes ;;
1007 --disable-libcdio) _libcdio=no ;;
1008 --enable-liblzo) _liblzo=yes ;;
1009 --disable-liblzo) _liblzo=no ;;
1010 --enable-libvorbis) _libvorbis=yes ;;
1011 --disable-libvorbis) _libvorbis=no ;;
1012 --enable-speex) _speex=yes ;;
1013 --disable-speex) _speex=no ;;
1014 --enable-tremor) _tremor=yes ;;
1015 --disable-tremor) _tremor=no ;;
1016 --enable-tremor-internal) _tremor_internal=yes ;;
1017 --disable-tremor-internal) _tremor_internal=no ;;
1018 --enable-tremor-low) _tremor_low=yes ;;
1019 --disable-tremor-low) _tremor_low=no ;;
1020 --enable-theora) _theora=yes ;;
1021 --disable-theora) _theora=no ;;
1022 --enable-mp3lib) _mp3lib=yes ;;
1023 --disable-mp3lib) _mp3lib=no ;;
1024 --enable-liba52) _liba52=yes ;;
1025 --disable-liba52) _liba52=no ;;
1026 --enable-libdca) _libdca=yes ;;
1027 --disable-libdca) _libdca=no ;;
1028 --enable-libmpeg2) _libmpeg2=yes ;;
1029 --disable-libmpeg2) _libmpeg2=no ;;
1030 --enable-musepack) _musepack=yes ;;
1031 --disable-musepack) _musepack=no ;;
1032 --enable-faad) _faad=yes ;;
1033 --disable-faad) _faad=no ;;
1034 --enable-faad-internal) _faad_internal=yes ;;
1035 --disable-faad-internal) _faad_internal=no ;;
1036 --enable-faad-fixed) _faad_fixed=yes ;;
1037 --disable-faad-fixed) _faad_fixed=no ;;
1038 --enable-faac) _faac=yes ;;
1039 --disable-faac) _faac=no ;;
1040 --enable-faac-lavc) _faac_lavc=yes ;;
1041 --disable-faac-lavc) _faac_lavc=no ;;
1042 --enable-ladspa) _ladspa=yes ;;
1043 --disable-ladspa) _ladspa=no ;;
1044 --enable-libbs2b) _libbs2b=yes ;;
1045 --disable-libbs2b) _libbs2b=no ;;
1046 --enable-xmms) _xmms=yes ;;
1047 --disable-xmms) _xmms=no ;;
1048 --enable-vcd) _vcd=yes ;;
1049 --disable-vcd) _vcd=no ;;
1050 --enable-dvdread) _dvdread=yes ;;
1051 --disable-dvdread) _dvdread=no ;;
1052 --enable-dvdread-internal) _dvdread_internal=yes ;;
1053 --disable-dvdread-internal) _dvdread_internal=no ;;
1054 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1055 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1056 --enable-dvdnav) _dvdnav=yes ;;
1057 --disable-dvdnav) _dvdnav=no ;;
1058 --enable-xanim) _xanim=yes ;;
1059 --disable-xanim) _xanim=no ;;
1060 --enable-real) _real=yes ;;
1061 --disable-real) _real=no ;;
1062 --enable-live) _live=yes ;;
1063 --disable-live) _live=no ;;
1064 --enable-nemesi) _nemesi=yes ;;
1065 --disable-nemesi) _nemesi=no ;;
1066 --enable-xinerama) _xinerama=yes ;;
1067 --disable-xinerama) _xinerama=no ;;
1068 --enable-mga) _mga=yes ;;
1069 --disable-mga) _mga=no ;;
1070 --enable-xmga) _xmga=yes ;;
1071 --disable-xmga) _xmga=no ;;
1072 --enable-vm) _vm=yes ;;
1073 --disable-vm) _vm=no ;;
1074 --enable-xf86keysym) _xf86keysym=yes ;;
1075 --disable-xf86keysym) _xf86keysym=no ;;
1076 --enable-mlib) _mlib=yes ;;
1077 --disable-mlib) _mlib=no ;;
1078 --enable-sunaudio) _sunaudio=yes ;;
1079 --disable-sunaudio) _sunaudio=no ;;
1080 --enable-sgiaudio) _sgiaudio=yes ;;
1081 --disable-sgiaudio) _sgiaudio=no ;;
1082 --enable-alsa) _alsa=yes ;;
1083 --disable-alsa) _alsa=no ;;
1084 --enable-tv) _tv=yes ;;
1085 --disable-tv) _tv=no ;;
1086 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1087 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1088 --enable-tv-v4l1) _tv_v4l1=yes ;;
1089 --disable-tv-v4l1) _tv_v4l1=no ;;
1090 --enable-tv-v4l2) _tv_v4l2=yes ;;
1091 --disable-tv-v4l2) _tv_v4l2=no ;;
1092 --enable-tv-dshow) _tv_dshow=yes ;;
1093 --disable-tv-dshow) _tv_dshow=no ;;
1094 --enable-radio) _radio=yes ;;
1095 --enable-radio-capture) _radio_capture=yes ;;
1096 --disable-radio-capture) _radio_capture=no ;;
1097 --disable-radio) _radio=no ;;
1098 --enable-radio-v4l) _radio_v4l=yes ;;
1099 --disable-radio-v4l) _radio_v4l=no ;;
1100 --enable-radio-v4l2) _radio_v4l2=yes ;;
1101 --disable-radio-v4l2) _radio_v4l2=no ;;
1102 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1103 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1104 --enable-pvr) _pvr=yes ;;
1105 --disable-pvr) _pvr=no ;;
1106 --enable-fastmemcpy) _fastmemcpy=yes ;;
1107 --disable-fastmemcpy) _fastmemcpy=no ;;
1108 --enable-hardcoded-tables) hardcoded_tables=yes ;;
1109 --disable-hardcoded-tables) hardcoded_tables=no ;;
1110 --enable-network) _network=yes ;;
1111 --disable-network) _network=no ;;
1112 --enable-winsock2_h) _winsock2_h=yes ;;
1113 --disable-winsock2_h) _winsock2_h=no ;;
1114 --enable-smb) _smb=yes ;;
1115 --disable-smb) _smb=no ;;
1116 --enable-vidix) _vidix=yes ;;
1117 --disable-vidix) _vidix=no ;;
1118 --with-vidix-drivers=*)
1119 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1121 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1122 --enable-dhahelper) _dhahelper=yes ;;
1123 --disable-dhahelper) _dhahelper=no ;;
1124 --enable-svgalib_helper) _svgalib_helper=yes ;;
1125 --disable-svgalib_helper) _svgalib_helper=no ;;
1126 --enable-joystick) _joystick=yes ;;
1127 --disable-joystick) _joystick=no ;;
1128 --enable-xvid) _xvid=yes ;;
1129 --disable-xvid) _xvid=no ;;
1130 --enable-xvid-lavc) _xvid_lavc=yes ;;
1131 --disable-xvid-lavc) _xvid_lavc=no ;;
1132 --enable-x264) _x264=yes ;;
1133 --disable-x264) _x264=no ;;
1134 --enable-x264-lavc) _x264_lavc=yes ;;
1135 --disable-x264-lavc) _x264_lavc=no ;;
1136 --enable-libdirac-lavc) _libdirac_lavc=yes ;;
1137 --disable-libdirac-lavc) _libdirac_lavc=no ;;
1138 --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
1139 --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
1140 --enable-libnut) _libnut=yes ;;
1141 --disable-libnut) _libnut=no ;;
1142 --enable-libavutil_a) _libavutil_a=yes ;;
1143 --disable-libavutil_a) _libavutil_a=no ;;
1144 --enable-libavutil_so) _libavutil_so=yes ;;
1145 --disable-libavutil_so) _libavutil_so=no ;;
1146 --enable-libavcodec_a) _libavcodec_a=yes ;;
1147 --disable-libavcodec_a) _libavcodec_a=no ;;
1148 --enable-libavcodec_so) _libavcodec_so=yes ;;
1149 --disable-libavcodec_so) _libavcodec_so=no ;;
1150 --enable-libopencore_amrnb) _libopencore_amrnb=yes ;;
1151 --disable-libopencore_amrnb) _libopencore_amrnb=no ;;
1152 --enable-libopencore_amrwb) _libopencore_amrwb=yes ;;
1153 --disable-libopencore_amrwb) _libopencore_amrwb=no ;;
1154 --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1155 --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1156 --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1157 --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1158 --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1159 --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1160 --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1161 --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1162 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1163 --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1164 --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1165 --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1166 --enable-libavformat_a) _libavformat_a=yes ;;
1167 --disable-libavformat_a) _libavformat_a=no ;;
1168 --enable-libavformat_so) _libavformat_so=yes ;;
1169 --disable-libavformat_so) _libavformat_so=no ;;
1170 --enable-libpostproc_a) _libpostproc_a=yes ;;
1171 --disable-libpostproc_a) _libpostproc_a=no ;;
1172 --enable-libpostproc_so) _libpostproc_so=yes ;;
1173 --disable-libpostproc_so) _libpostproc_so=no ;;
1174 --enable-libswscale_a) _libswscale_a=yes ;;
1175 --disable-libswscale_a) _libswscale_a=no ;;
1176 --enable-libswscale_so) _libswscale_so=yes ;;
1177 --disable-libswscale_so) _libswscale_so=no ;;
1178 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1179 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1181 --enable-lirc) _lirc=yes ;;
1182 --disable-lirc) _lirc=no ;;
1183 --enable-lircc) _lircc=yes ;;
1184 --disable-lircc) _lircc=no ;;
1185 --enable-apple-remote) _apple_remote=yes ;;
1186 --disable-apple-remote) _apple_remote=no ;;
1187 --enable-apple-ir) _apple_ir=yes ;;
1188 --disable-apple-ir) _apple_ir=no ;;
1189 --enable-gui) _gui=yes ;;
1190 --disable-gui) _gui=no ;;
1191 --enable-gtk1) _gtk1=yes ;;
1192 --disable-gtk1) _gtk1=no ;;
1193 --enable-termcap) _termcap=yes ;;
1194 --disable-termcap) _termcap=no ;;
1195 --enable-termios) _termios=yes ;;
1196 --disable-termios) _termios=no ;;
1197 --enable-3dfx) _3dfx=yes ;;
1198 --disable-3dfx) _3dfx=no ;;
1199 --enable-s3fb) _s3fb=yes ;;
1200 --disable-s3fb) _s3fb=no ;;
1201 --enable-wii) _wii=yes ;;
1202 --disable-wii) _wii=no ;;
1203 --enable-tdfxfb) _tdfxfb=yes ;;
1204 --disable-tdfxfb) _tdfxfb=no ;;
1205 --disable-tdfxvid) _tdfxvid=no ;;
1206 --enable-tdfxvid) _tdfxvid=yes ;;
1207 --disable-xvr100) _xvr100=no ;;
1208 --enable-xvr100) _xvr100=yes ;;
1209 --disable-tga) _tga=no ;;
1210 --enable-tga) _tga=yes ;;
1211 --enable-directfb) _directfb=yes ;;
1212 --disable-directfb) _directfb=no ;;
1213 --enable-zr) _zr=yes ;;
1214 --disable-zr) _zr=no ;;
1215 --enable-bl) _bl=yes ;;
1216 --disable-bl) _bl=no ;;
1217 --enable-mtrr) _mtrr=yes ;;
1218 --disable-mtrr) _mtrr=no ;;
1219 --enable-largefiles) _largefiles=yes ;;
1220 --disable-largefiles) _largefiles=no ;;
1221 --enable-shm) _shm=yes ;;
1222 --disable-shm) _shm=no ;;
1223 --enable-select) _select=yes ;;
1224 --disable-select) _select=no ;;
1225 --enable-linux-devfs) _linux_devfs=yes ;;
1226 --disable-linux-devfs) _linux_devfs=no ;;
1227 --enable-cdparanoia) _cdparanoia=yes ;;
1228 --disable-cdparanoia) _cdparanoia=no ;;
1229 --enable-cddb) _cddb=yes ;;
1230 --disable-cddb) _cddb=no ;;
1231 --enable-big-endian) _big_endian=yes ;;
1232 --disable-big-endian) _big_endian=no ;;
1233 --enable-bitmap-font) _bitmap_font=yes ;;
1234 --disable-bitmap-font) _bitmap_font=no ;;
1235 --enable-freetype) _freetype=yes ;;
1236 --disable-freetype) _freetype=no ;;
1237 --enable-fontconfig) _fontconfig=yes ;;
1238 --disable-fontconfig) _fontconfig=no ;;
1239 --enable-unrarexec) _unrar_exec=yes ;;
1240 --disable-unrarexec) _unrar_exec=no ;;
1241 --enable-ftp) _ftp=yes ;;
1242 --disable-ftp) _ftp=no ;;
1243 --enable-vstream) _vstream=yes ;;
1244 --disable-vstream) _vstream=no ;;
1245 --enable-pthreads) _pthreads=yes ;;
1246 --disable-pthreads) _pthreads=no ;;
1247 --enable-w32threads) _w32threads=yes ;;
1248 --disable-w32threads) _w32threads=no ;;
1249 --enable-ass) _ass=yes ;;
1250 --disable-ass) _ass=no ;;
1251 --enable-ass-internal) ass_internal=yes ;;
1252 --disable-ass-internal) ass_internal=no ;;
1253 --enable-rpath) _rpath=yes ;;
1254 --disable-rpath) _rpath=no ;;
1256 --enable-fribidi) _fribidi=yes ;;
1257 --disable-fribidi) _fribidi=no ;;
1259 --enable-enca) _enca=yes ;;
1260 --disable-enca) _enca=no ;;
1262 --enable-inet6) _inet6=yes ;;
1263 --disable-inet6) _inet6=no ;;
1265 --enable-gethostbyname2) _gethostbyname2=yes ;;
1266 --disable-gethostbyname2) _gethostbyname2=no ;;
1268 --enable-dga1) _dga1=yes ;;
1269 --disable-dga1) _dga1=no ;;
1270 --enable-dga2) _dga2=yes ;;
1271 --disable-dga2) _dga2=no ;;
1273 --enable-menu) _menu=yes ;;
1274 --disable-menu) _menu=no ;;
1276 --enable-qtx) _qtx=yes ;;
1277 --disable-qtx) _qtx=no ;;
1279 --enable-coreaudio) _coreaudio=yes ;;
1280 --disable-coreaudio) _coreaudio=no ;;
1281 --enable-corevideo) _corevideo=yes ;;
1282 --disable-corevideo) _corevideo=no ;;
1283 --enable-quartz) _quartz=yes ;;
1284 --disable-quartz) _quartz=no ;;
1285 --enable-macosx-finder) _macosx_finder=yes ;;
1286 --disable-macosx-finder) _macosx_finder=no ;;
1287 --enable-macosx-bundle) _macosx_bundle=yes ;;
1288 --disable-macosx-bundle) _macosx_bundle=no ;;
1290 --enable-maemo) _maemo=yes ;;
1291 --disable-maemo) _maemo=no ;;
1293 --enable-sortsub) _sortsub=yes ;;
1294 --disable-sortsub) _sortsub=no ;;
1296 --enable-crash-debug) _crash_debug=yes ;;
1297 --disable-crash-debug) _crash_debug=no ;;
1298 --enable-sighandler) _sighandler=yes ;;
1299 --disable-sighandler) _sighandler=no ;;
1300 --enable-win32dll) _win32dll=yes ;;
1301 --disable-win32dll) _win32dll=no ;;
1303 --enable-sse) _sse=yes ;;
1304 --disable-sse) _sse=no ;;
1305 --enable-sse2) _sse2=yes ;;
1306 --disable-sse2) _sse2=no ;;
1307 --enable-ssse3) _ssse3=yes ;;
1308 --disable-ssse3) _ssse3=no ;;
1309 --enable-mmxext) _mmxext=yes ;;
1310 --disable-mmxext) _mmxext=no ;;
1311 --enable-3dnow) _3dnow=yes ;;
1312 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1313 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1314 --disable-3dnowext) _3dnowext=no ;;
1315 --enable-cmov) _cmov=yes ;;
1316 --disable-cmov) _cmov=no ;;
1317 --enable-fast-cmov) _fast_cmov=yes ;;
1318 --disable-fast-cmov) _fast_cmov=no ;;
1319 --enable-fast-clz) _fast_clz=yes ;;
1320 --disable-fast-clz) _fast_clz=no ;;
1321 --enable-altivec) _altivec=yes ;;
1322 --disable-altivec) _altivec=no ;;
1323 --enable-armv5te) _armv5te=yes ;;
1324 --disable-armv5te) _armv5te=no ;;
1325 --enable-armv6) _armv6=yes ;;
1326 --disable-armv6) _armv6=no ;;
1327 --enable-armv6t2) _armv6t2=yes ;;
1328 --disable-armv6t2) _armv6t2=no ;;
1329 --enable-armvfp) _armvfp=yes ;;
1330 --disable-armvfp) _armvfp=no ;;
1331 --enable-neon) neon=yes ;;
1332 --disable-neon) neon=no ;;
1333 --enable-iwmmxt) _iwmmxt=yes ;;
1334 --disable-iwmmxt) _iwmmxt=no ;;
1335 --enable-mmx) _mmx=yes ;;
1336 --disable-mmx) # 3Dnow! and MMX2 require MMX
1337 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1340 echo "Unknown parameter: $ac_option"
1341 exit 1
1344 esac
1345 done
1347 # Atmos: moved this here, to be correct, if --prefix is specified
1348 test -z "$_bindir" && _bindir="$_prefix/bin"
1349 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1350 test -z "$_mandir" && _mandir="$_prefix/share/man"
1351 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1352 test -z "$_libdir" && _libdir="$_prefix/lib"
1354 # Determine our OS name and CPU architecture
1355 if test -z "$_target" ; then
1356 # OS name
1357 system_name=$(uname -s 2>&1)
1358 case "$system_name" in
1359 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1361 Haiku)
1362 system_name=BeOS
1364 IRIX*)
1365 system_name=IRIX
1367 GNU/kFreeBSD)
1368 system_name=FreeBSD
1370 HP-UX*)
1371 system_name=HP-UX
1373 [cC][yY][gG][wW][iI][nN]*)
1374 system_name=CYGWIN
1376 MINGW32*)
1377 system_name=MINGW32
1379 OS/2*)
1380 system_name=OS/2
1383 system_name="$system_name-UNKNOWN"
1385 esac
1388 # host's CPU/instruction set
1389 host_arch=$(uname -p 2>&1)
1390 case "$host_arch" in
1391 i386|sparc|ppc|alpha|arm|mips|vax)
1393 powerpc) # Darwin returns 'powerpc'
1394 host_arch=ppc
1396 *) # uname -p on Linux returns 'unknown' for the processor type,
1397 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1399 # Maybe uname -m (machine hardware name) returns something we
1400 # recognize.
1402 # x86/x86pc is used by QNX
1403 case "$(uname -m 2>&1)" in
1404 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 ;;
1405 ia64) host_arch=ia64 ;;
1406 macppc|ppc) host_arch=ppc ;;
1407 ppc64) host_arch=ppc64 ;;
1408 alpha) host_arch=alpha ;;
1409 sparc) host_arch=sparc ;;
1410 sparc64) host_arch=sparc64 ;;
1411 parisc*|hppa*|9000*) host_arch=hppa ;;
1412 arm*|zaurus|cats) host_arch=arm ;;
1413 sh3|sh4|sh4a) host_arch=sh ;;
1414 s390) host_arch=s390 ;;
1415 s390x) host_arch=s390x ;;
1416 *mips*) host_arch=mips ;;
1417 vax) host_arch=vax ;;
1418 xtensa*) host_arch=xtensa ;;
1419 *) host_arch=UNKNOWN ;;
1420 esac
1422 esac
1423 else # if test -z "$_target"
1424 system_name=$(echo $_target | cut -d '-' -f 2)
1425 case "$(echo $system_name | tr A-Z a-z)" in
1426 linux) system_name=Linux ;;
1427 freebsd) system_name=FreeBSD ;;
1428 gnu/kfreebsd) system_name=FreeBSD ;;
1429 netbsd) system_name=NetBSD ;;
1430 bsd/os) system_name=BSD/OS ;;
1431 openbsd) system_name=OpenBSD ;;
1432 dragonfly) system_name=DragonFly ;;
1433 sunos) system_name=SunOS ;;
1434 qnx) system_name=QNX ;;
1435 morphos) system_name=MorphOS ;;
1436 amigaos) system_name=AmigaOS ;;
1437 mingw32*) system_name=MINGW32 ;;
1438 esac
1439 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1440 host_arch=$(echo $_target | cut -d '-' -f 1)
1441 if test $(echo $host_arch) != "x86_64" ; then
1442 host_arch=$(echo $host_arch | tr '_' '-')
1446 extra_cflags="-I. $extra_cflags"
1447 _timer=timer-linux.c
1448 _getch=getch2.c
1449 if freebsd ; then
1450 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1451 extra_cflags="$extra_cflags -I/usr/local/include"
1454 if netbsd || dragonfly ; then
1455 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1456 extra_cflags="$extra_cflags -I/usr/pkg/include"
1459 if darwin; then
1460 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1461 _timer=timer-darwin.c
1464 if aix ; then
1465 extra_ldflags="$extra_ldflags -lC"
1468 if irix ; then
1469 _ranlib='ar -r'
1470 elif linux ; then
1471 _ranlib='true'
1474 if win32 ; then
1475 _exesuf=".exe"
1476 extra_cflags="$extra_cflags -fno-common"
1477 # -lwinmm is always needed for osdep/timer-win2.c
1478 extra_ldflags="$extra_ldflags -lwinmm"
1479 _pe_executable=yes
1480 _timer=timer-win2.c
1481 _priority=yes
1482 def_dos_paths="#define HAVE_DOS_PATHS 1"
1483 def_priority="#define CONFIG_PRIORITY 1"
1486 if mingw32 ; then
1487 _getch=getch2-win.c
1488 _need_shmem=no
1491 if amigaos ; then
1492 _select=no
1493 _sighandler=no
1494 _stream_cache=no
1495 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1496 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1499 if qnx ; then
1500 extra_ldflags="$extra_ldflags -lph"
1503 if os2 ; then
1504 _exesuf=".exe"
1505 _getch=getch2-os2.c
1506 _need_shmem=no
1507 _priority=yes
1508 def_dos_paths="#define HAVE_DOS_PATHS 1"
1509 def_priority="#define CONFIG_PRIORITY 1"
1512 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1513 test "$I" && break
1514 done
1517 TMPLOG="configure.log"
1518 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1519 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1520 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1521 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1522 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1524 rm -f "$TMPLOG"
1525 echo configuration: $_configuration > "$TMPLOG"
1526 echo >> "$TMPLOG"
1529 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1530 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1534 # Checking CC version...
1535 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1536 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1537 echocheck "$_cc version"
1538 cc_vendor=intel
1539 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1540 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1541 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1542 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1543 # TODO verify older icc/ecc compatibility
1544 case $cc_version in
1546 cc_version="v. ?.??, bad"
1547 cc_fail=yes
1549 10.1|11.0|11.1)
1550 cc_version="$cc_version, ok"
1553 cc_version="$cc_version, bad"
1554 cc_fail=yes
1556 esac
1557 echores "$cc_version"
1558 else
1559 for _cc in "$_cc" gcc cc ; do
1560 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1561 if test "$cc_name_tmp" = "gcc"; then
1562 cc_name=$cc_name_tmp
1563 echocheck "$_cc version"
1564 cc_vendor=gnu
1565 cc_version=$($_cc -dumpversion 2>&1)
1566 case $cc_version in
1567 2.96*)
1568 cc_fail=yes
1571 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1572 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1573 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1575 esac
1576 echores "$cc_version"
1577 break
1579 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1580 if test "$cc_name_tmp" = "Sun C"; then
1581 echocheck "$_cc version"
1582 cc_vendor=sun
1583 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1584 res_comment="experimental support only"
1585 echores "Sun C $cc_version"
1586 break
1588 done
1589 fi # icc
1590 test "$cc_fail" = yes && die "unsupported compiler version"
1592 if test -z "$_target" && x86 ; then
1593 cat > $TMPC << EOF
1594 int main(void) {
1595 int test[(int)sizeof(char *)-7];
1596 return 0;
1599 cc_check && host_arch=x86_64 || host_arch=i386
1602 echo "Detected operating system: $system_name"
1603 echo "Detected host architecture: $host_arch"
1605 echocheck "host cc"
1606 test "$_host_cc" || _host_cc=$_cc
1607 echores $_host_cc
1609 echocheck "cross compilation"
1610 if test $_cross_compile = auto ; then
1611 cat > $TMPC << EOF
1612 int main(void) { return 0; }
1614 _cross_compile=yes
1615 cc_check && "$TMPEXE" && _cross_compile=no
1617 echores $_cross_compile
1619 if test $_cross_compile = yes; then
1620 tmp_run() {
1621 return 0
1625 # ---
1627 # now that we know what compiler should be used for compilation, try to find
1628 # out which assembler is used by the $_cc compiler
1629 if test "$_as" = auto ; then
1630 _as=$($_cc -print-prog-name=as)
1631 test -z "$_as" && _as=as
1634 if test "$_nm" = auto ; then
1635 _nm=$($_cc -print-prog-name=nm)
1636 test -z "$_nm" && _nm=nm
1639 # XXX: this should be ok..
1640 _cpuinfo="echo"
1642 if test "$_runtime_cpudetection" = no ; then
1644 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1645 # FIXME: Remove the cygwin check once AMD CPUs are supported
1646 if test -r /proc/cpuinfo && ! cygwin; then
1647 # Linux with /proc mounted, extract CPU information from it
1648 _cpuinfo="cat /proc/cpuinfo"
1649 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1650 # FreeBSD with Linux emulation /proc mounted,
1651 # extract CPU information from it
1652 # Don't use it on x86 though, it never reports 3Dnow
1653 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1654 elif darwin && ! x86 ; then
1655 # use hostinfo on Darwin
1656 _cpuinfo="hostinfo"
1657 elif aix; then
1658 # use 'lsattr' on AIX
1659 _cpuinfo="lsattr -E -l proc0 -a type"
1660 elif x86; then
1661 # all other OSes try to extract CPU information from a small helper
1662 # program cpuinfo instead
1663 $_cc -o cpuinfo$_exesuf cpuinfo.c
1664 _cpuinfo="./cpuinfo$_exesuf"
1667 if [ "$cc_vendor" = "gnu" ] && [ "$_cc_major" = 2 ] ; then
1668 test $_sse = auto && _sse=no
1669 test $_win32dll = auto && _win32dll=no
1670 ass_internal=no
1673 if x86 ; then
1674 # gather more CPU information
1675 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1676 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1677 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1678 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1679 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1681 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1683 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1684 -e s/xmm/sse/ -e s/kni/sse/)
1686 for ext in $pparam ; do
1687 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1688 done
1690 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1691 test $_sse = kernel_check && _mmxext=kernel_check
1693 echocheck "CPU vendor"
1694 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1696 echocheck "CPU type"
1697 echores "$pname"
1700 fi # test "$_runtime_cpudetection" = no
1702 if x86 && test "$_runtime_cpudetection" = no ; then
1703 extcheck() {
1704 if test "$1" = kernel_check ; then
1705 echocheck "kernel support of $2"
1706 cat > $TMPC <<EOF
1707 #include <stdlib.h>
1708 #include <signal.h>
1709 void catch() { exit(1); }
1710 int main(void) {
1711 signal(SIGILL, catch);
1712 __asm__ volatile ("$3":::"memory"); return 0;
1716 if cc_check && tmp_run ; then
1717 eval _$2=yes
1718 echores "yes"
1719 _optimizing="$_optimizing $2"
1720 return 0
1721 else
1722 eval _$2=no
1723 echores "failed"
1724 echo "It seems that your kernel does not correctly support $2."
1725 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1726 return 1
1729 return 0
1732 extcheck $_mmx "mmx" "emms"
1733 extcheck $_mmxext "mmxext" "sfence"
1734 extcheck $_3dnow "3dnow" "femms"
1735 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1736 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1737 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1738 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1739 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1741 echocheck "mtrr support"
1742 if test "$_mtrr" = kernel_check ; then
1743 _mtrr="yes"
1744 _optimizing="$_optimizing mtrr"
1746 echores "$_mtrr"
1748 if test "$_gcc3_ext" != ""; then
1749 # if we had to disable sse/sse2 because the active kernel does not
1750 # support this instruction set extension, we also have to tell
1751 # gcc3 to not generate sse/sse2 instructions for normal C code
1752 cat > $TMPC << EOF
1753 int main(void) { return 0; }
1755 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1761 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1762 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1763 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0'
1764 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 0'
1765 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1766 subarch_all='X86_32 X86_64 PPC64'
1767 case "$host_arch" in
1768 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1769 arch='x86'
1770 subarch='x86_32'
1771 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1772 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
1773 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
1774 iproc=486
1775 proc=i486
1778 if test "$_runtime_cpudetection" = no ; then
1779 case "$pvendor" in
1780 AuthenticAMD)
1781 case "$pfamily" in
1782 3) proc=i386 iproc=386 ;;
1783 4) proc=i486 iproc=486 ;;
1784 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1785 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1786 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1787 proc=k6-3
1788 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1789 proc=geode
1790 elif test "$pmodel" -ge 8; then
1791 proc=k6-2
1792 elif test "$pmodel" -ge 6; then
1793 proc=k6
1794 else
1795 proc=i586
1798 6) iproc=686
1799 # It's a bit difficult to determine the correct type of Family 6
1800 # AMD CPUs just from their signature. Instead, we check directly
1801 # whether it supports SSE.
1802 if test "$_sse" = yes; then
1803 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1804 proc=athlon-xp
1805 else
1806 # Again, gcc treats athlon and athlon-tbird similarly.
1807 proc=athlon
1810 15) iproc=686
1811 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1812 # caught and remedied in the optimization tests below.
1813 proc=k8
1816 *) proc=amdfam10 iproc=686
1817 test $_fast_clz = "auto" && _fast_clz=yes
1819 esac
1821 GenuineIntel)
1822 case "$pfamily" in
1823 3) proc=i386 iproc=386 ;;
1824 4) proc=i486 iproc=486 ;;
1825 5) iproc=586
1826 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1827 proc=pentium-mmx # 4 is desktop, 8 is mobile
1828 else
1829 proc=i586
1832 6) iproc=686
1833 if test "$pmodel" -ge 15; then
1834 proc=core2
1835 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1836 proc=pentium-m
1837 elif test "$pmodel" -ge 7; then
1838 proc=pentium3
1839 elif test "$pmodel" -ge 3; then
1840 proc=pentium2
1841 else
1842 proc=i686
1844 test $_fast_clz = "auto" && _fast_clz=yes
1846 15) iproc=686
1847 # A nocona in 32-bit mode has no more capabilities than a prescott.
1848 if test "$pmodel" -ge 3; then
1849 proc=prescott
1850 else
1851 proc=pentium4
1852 test $_fast_clz = "auto" && _fast_clz=yes
1854 test $_fast_cmov = "auto" && _fast_cmov=no
1856 *) proc=prescott iproc=686 ;;
1857 esac
1859 CentaurHauls)
1860 case "$pfamily" in
1861 5) iproc=586
1862 if test "$pmodel" -ge 8; then
1863 proc=winchip2
1864 elif test "$pmodel" -ge 4; then
1865 proc=winchip-c6
1866 else
1867 proc=i586
1870 6) iproc=686
1871 if test "$pmodel" -ge 9; then
1872 proc=c3-2
1873 else
1874 proc=c3
1875 iproc=586
1878 *) proc=i686 iproc=i686 ;;
1879 esac
1881 unknown)
1882 case "$pfamily" in
1883 3) proc=i386 iproc=386 ;;
1884 4) proc=i486 iproc=486 ;;
1885 *) proc=i586 iproc=586 ;;
1886 esac
1889 proc=i586 iproc=586 ;;
1890 esac
1891 test $_fast_clz = "auto" && _fast_clz=no
1892 fi # test "$_runtime_cpudetection" = no
1895 # check that gcc supports our CPU, if not, fall back to earlier ones
1896 # LGB: check -mcpu and -march swithing step by step with enabling
1897 # to fall back till 386.
1899 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1901 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1902 cpuopt=-mtune
1903 else
1904 cpuopt=-mcpu
1907 echocheck "GCC & CPU optimization abilities"
1908 cat > $TMPC << EOF
1909 int main(void) { return 0; }
1911 if test "$_runtime_cpudetection" = no ; then
1912 if test $cc_vendor != "intel" ; then
1913 cc_check -march=native && proc=native
1915 if test "$proc" = "k8"; then
1916 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1918 if test "$proc" = "athlon-xp"; then
1919 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1921 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1922 cc_check -march=$proc $cpuopt=$proc || proc=k6
1924 if test "$proc" = "k6" || test "$proc" = "c3"; then
1925 if ! cc_check -march=$proc $cpuopt=$proc; then
1926 if cc_check -march=i586 $cpuopt=i686; then
1927 proc=i586-i686
1928 else
1929 proc=i586
1933 if test "$proc" = "prescott" ; then
1934 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1936 if test "$proc" = "core2" ; then
1937 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1939 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
1940 cc_check -march=$proc $cpuopt=$proc || proc=i686
1942 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1943 cc_check -march=$proc $cpuopt=$proc || proc=i586
1945 if test "$proc" = "i586"; then
1946 cc_check -march=$proc $cpuopt=$proc || proc=i486
1948 if test "$proc" = "i486" ; then
1949 cc_check -march=$proc $cpuopt=$proc || proc=i386
1951 if test "$proc" = "i386" ; then
1952 cc_check -march=$proc $cpuopt=$proc || proc=error
1954 if test "$proc" = "error" ; then
1955 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1956 _mcpu=""
1957 _march=""
1958 _optimizing=""
1959 elif test "$proc" = "i586-i686"; then
1960 _march="-march=i586"
1961 _mcpu="$cpuopt=i686"
1962 _optimizing="$proc"
1963 else
1964 _march="-march=$proc"
1965 _mcpu="$cpuopt=$proc"
1966 _optimizing="$proc"
1968 else # if test "$_runtime_cpudetection" = no
1969 _mcpu="$cpuopt=generic"
1970 # at least i486 required, for bswap instruction
1971 _march="-march=i486"
1972 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1973 cc_check $_mcpu || _mcpu=""
1974 cc_check $_march $_mcpu || _march=""
1977 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1978 ## autodetected mcpu/march parameters
1979 if test "$_target" ; then
1980 # TODO: it may be a good idea to check GCC and fall back in all cases
1981 if test "$host_arch" = "i586-i686"; then
1982 _march="-march=i586"
1983 _mcpu="$cpuopt=i686"
1984 else
1985 _march="-march=$host_arch"
1986 _mcpu="$cpuopt=$host_arch"
1989 proc="$host_arch"
1991 case "$proc" in
1992 i386) iproc=386 ;;
1993 i486) iproc=486 ;;
1994 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1995 i686|athlon*|pentium*) iproc=686 ;;
1996 *) iproc=586 ;;
1997 esac
2000 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
2001 _fast_cmov="yes"
2002 else
2003 _fast_cmov="no"
2005 test $_fast_clz = "auto" && _fast_clz=yes
2007 echores "$proc"
2010 ia64)
2011 arch='ia64'
2012 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2013 iproc='ia64'
2016 x86_64|amd64)
2017 arch='x86'
2018 subarch='x86_64'
2019 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2020 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2021 iproc='x86_64'
2023 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2024 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
2025 cpuopt=-mtune
2026 else
2027 cpuopt=-mcpu
2029 if test "$_runtime_cpudetection" = no ; then
2030 case "$pvendor" in
2031 AuthenticAMD)
2032 case "$pfamily" in
2033 15) proc=k8
2034 test $_fast_clz = "auto" && _fast_clz=no
2036 *) proc=amdfam10;;
2037 esac
2039 GenuineIntel)
2040 case "$pfamily" in
2041 6) proc=core2;;
2043 # 64-bit prescotts exist, but as far as GCC is concerned they
2044 # have the same capabilities as a nocona.
2045 proc=nocona
2046 test $_fast_cmov = "auto" && _fast_cmov=no
2047 test $_fast_clz = "auto" && _fast_clz=no
2049 esac
2052 proc=error;;
2053 esac
2054 fi # test "$_runtime_cpudetection" = no
2056 echocheck "GCC & CPU optimization abilities"
2057 cat > $TMPC << EOF
2058 int main(void) { return 0; }
2060 # This is a stripped-down version of the i386 fallback.
2061 if test "$_runtime_cpudetection" = no ; then
2062 if test $cc_vendor != "intel" ; then
2063 cc_check -march=native && proc=native
2065 # --- AMD processors ---
2066 if test "$proc" = "k8"; then
2067 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2069 # This will fail if gcc version < 3.3, which is ok because earlier
2070 # versions don't really support 64-bit on amd64.
2071 # Is this a valid assumption? -Corey
2072 if test "$proc" = "athlon-xp"; then
2073 cc_check -march=$proc $cpuopt=$proc || proc=error
2075 # --- Intel processors ---
2076 if test "$proc" = "core2"; then
2077 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
2079 if test "$proc" = "x86-64"; then
2080 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2082 if test "$proc" = "nocona"; then
2083 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2085 if test "$proc" = "pentium4"; then
2086 cc_check -march=$proc $cpuopt=$proc || proc=error
2089 _march="-march=$proc"
2090 _mcpu="$cpuopt=$proc"
2091 if test "$proc" = "error" ; then
2092 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2093 _mcpu=""
2094 _march=""
2096 else # if test "$_runtime_cpudetection" = no
2097 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2098 _march="-march=x86-64"
2099 _mcpu="$cpuopt=generic"
2100 cc_check $_mcpu || _mcpu="x86-64"
2101 cc_check $_mcpu || _mcpu=""
2102 cc_check $_march $_mcpu || _march=""
2105 _optimizing="$proc"
2106 test $_fast_cmov = "auto" && _fast_cmov=yes
2107 test $_fast_clz = "auto" && _fast_clz=yes
2109 echores "$proc"
2112 sparc|sparc64)
2113 arch='sparc'
2114 iproc='sparc'
2115 if test "$host_arch" = "sparc64" ; then
2116 _vis='yes'
2117 proc='ultrasparc'
2118 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2119 elif sunos ; then
2120 echocheck "CPU type"
2121 karch=$(uname -m)
2122 case "$(echo $karch)" in
2123 sun4) proc=v7 ;;
2124 sun4c) proc=v7 ;;
2125 sun4d) proc=v8 ;;
2126 sun4m) proc=v8 ;;
2127 sun4u) proc=ultrasparc _vis='yes' ;;
2128 sun4v) proc=v9 ;;
2129 *) proc=v8 ;;
2130 esac
2131 echores "$proc"
2132 else
2133 proc=v8
2135 _mcpu="-mcpu=$proc"
2136 _optimizing="$proc"
2139 arm*)
2140 arch='arm'
2141 iproc='arm'
2144 avr32)
2145 arch='avr32'
2146 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2147 iproc='avr32'
2148 test $_fast_clz = "auto" && _fast_clz=yes
2151 sh|sh4)
2152 arch='sh4'
2153 iproc='sh4'
2156 ppc|ppc64|powerpc|powerpc64)
2157 arch='ppc'
2158 def_dcbzl='#define HAVE_DCBZL 0'
2159 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2160 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
2161 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
2162 iproc='ppc'
2164 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2165 subarch='ppc64'
2166 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2168 echocheck "CPU type"
2169 case $system_name in
2170 Linux)
2171 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2172 if test -n "$($_cpuinfo | grep altivec)"; then
2173 test $_altivec = auto && _altivec=yes
2176 Darwin)
2177 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2178 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2179 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2180 test $_altivec = auto && _altivec=yes
2183 NetBSD)
2184 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2185 case $cc_version in
2186 2*|3.0*|3.1*|3.2*|3.3*)
2189 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2190 test $_altivec = auto && _altivec=yes
2193 esac
2195 AIX)
2196 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2198 esac
2199 if test "$_altivec" = yes; then
2200 echores "$proc altivec"
2201 else
2202 _altivec=no
2203 echores "$proc"
2206 echocheck "GCC & CPU optimization abilities"
2208 if test -n "$proc"; then
2209 case "$proc" in
2210 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2211 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2212 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2213 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2214 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2215 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2216 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2217 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2218 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2219 *) ;;
2220 esac
2221 # gcc 3.1(.1) and up supports 7400 and 7450
2222 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2223 case "$proc" in
2224 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2225 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2226 *) ;;
2227 esac
2229 # gcc 3.2 and up supports 970
2230 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2231 case "$proc" in
2232 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2233 def_dcbzl='#define HAVE_DCBZL 1' ;;
2234 *) ;;
2235 esac
2237 # gcc 3.3 and up supports POWER4
2238 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2239 case "$proc" in
2240 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2241 *) ;;
2242 esac
2244 # gcc 3.4 and up supports 440*
2245 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2246 case "$proc" in
2247 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2248 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2249 *) ;;
2250 esac
2252 # gcc 4.0 and up supports POWER5
2253 if test "$_cc_major" -ge "4"; then
2254 case "$proc" in
2255 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2256 *) ;;
2257 esac
2261 if test -n "$_mcpu"; then
2262 _optimizing=$(echo $_mcpu | cut -c 8-)
2263 echores "$_optimizing"
2264 else
2265 echores "none"
2268 test $_fast_clz = "auto" && _fast_clz=yes
2272 alpha*)
2273 arch='alpha'
2274 iproc='alpha'
2276 echocheck "CPU type"
2277 cat > $TMPC << EOF
2278 int main(void) {
2279 unsigned long ver, mask;
2280 __asm__ ("implver %0" : "=r" (ver));
2281 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2282 printf("%ld-%x\n", ver, ~mask);
2283 return 0;
2286 $_cc -o "$TMPEXE" "$TMPC"
2287 case $("$TMPEXE") in
2289 0-0) proc="ev4"; _mvi="0";;
2290 1-0) proc="ev5"; _mvi="0";;
2291 1-1) proc="ev56"; _mvi="0";;
2292 1-101) proc="pca56"; _mvi="1";;
2293 2-303) proc="ev6"; _mvi="1";;
2294 2-307) proc="ev67"; _mvi="1";;
2295 2-1307) proc="ev68"; _mvi="1";;
2296 esac
2297 echores "$proc"
2299 echocheck "GCC & CPU optimization abilities"
2300 if test "$proc" = "ev68" ; then
2301 cc_check -mcpu=$proc || proc=ev67
2303 if test "$proc" = "ev67" ; then
2304 cc_check -mcpu=$proc || proc=ev6
2306 _mcpu="-mcpu=$proc"
2307 echores "$proc"
2309 test $_fast_clz = "auto" && _fast_clz=yes
2311 _optimizing="$proc"
2314 mips)
2315 arch='mips'
2316 iproc='mips'
2318 if irix ; then
2319 echocheck "CPU type"
2320 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2321 case "$(echo $proc)" in
2322 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2323 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2324 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2325 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2326 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2327 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2328 esac
2329 # gcc < 3.x does not support -mtune.
2330 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2331 _mcpu=''
2333 echores "$proc"
2336 test $_fast_clz = "auto" && _fast_clz=yes
2340 hppa)
2341 arch='pa_risc'
2342 iproc='PA-RISC'
2345 s390)
2346 arch='s390'
2347 iproc='390'
2350 s390x)
2351 arch='s390x'
2352 iproc='390x'
2355 vax)
2356 arch='vax'
2357 iproc='vax'
2360 xtensa)
2361 arch='xtensa'
2362 iproc='xtensa'
2365 generic)
2366 arch='generic'
2370 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2371 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2372 die "unsupported architecture $host_arch"
2374 esac # case "$host_arch" in
2376 if test "$_runtime_cpudetection" = yes ; then
2377 if x86 ; then
2378 test "$_cmov" != no && _cmov=yes
2379 x86_32 && _cmov=no
2380 test "$_mmx" != no && _mmx=yes
2381 test "$_3dnow" != no && _3dnow=yes
2382 test "$_3dnowext" != no && _3dnowext=yes
2383 test "$_mmxext" != no && _mmxext=yes
2384 test "$_sse" != no && _sse=yes
2385 test "$_sse2" != no && _sse2=yes
2386 test "$_ssse3" != no && _ssse3=yes
2387 test "$_mtrr" != no && _mtrr=yes
2389 if ppc; then
2390 _altivec=yes
2395 # endian testing
2396 echocheck "byte order"
2397 if test "$_big_endian" = auto ; then
2398 cat > $TMPC <<EOF
2399 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2400 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2401 int main(void) { return (int)ascii_name; }
2403 if cc_check ; then
2404 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2405 _big_endian=yes
2406 else
2407 _big_endian=no
2409 else
2410 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2413 if test "$_big_endian" = yes ; then
2414 _byte_order='big-endian'
2415 def_words_endian='#define WORDS_BIGENDIAN 1'
2416 def_bigendian='#define HAVE_BIGENDIAN 1'
2417 def_av_bigendian='#define AV_HAVE_BIGENDIAN 1'
2418 else
2419 _byte_order='little-endian'
2420 def_words_endian='#undef WORDS_BIGENDIAN'
2421 def_bigendian='#define HAVE_BIGENDIAN 0'
2422 def_av_bigendian='#define AV_HAVE_BIGENDIAN 0'
2424 echores "$_byte_order"
2427 echocheck "extern symbol prefix"
2428 cat > $TMPC << EOF
2429 int ff_extern;
2431 cc_check -c || die "Symbol mangling check failed."
2432 sym=$($_nm -P -g $TMPEXE)
2433 extern_prefix=${sym%%ff_extern*}
2434 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2435 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2436 echores $extern_prefix
2439 echocheck "assembler support of -pipe option"
2440 cat > $TMPC << EOF
2441 int main(void) { return 0; }
2443 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2444 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2447 echocheck "compiler support of named assembler arguments"
2448 _named_asm_args=yes
2449 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2450 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2451 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2452 _named_asm_args=no
2453 def_named_asm_args="#undef NAMED_ASM_ARGS"
2455 echores $_named_asm_args
2458 if darwin && test "$cc_vendor" = "gnu" ; then
2459 echocheck "GCC support of -mstackrealign"
2460 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2461 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2462 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2463 # wrong code with this flag, but this can be worked around by adding
2464 # -fno-unit-at-a-time as described in the blog post at
2465 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2466 cat > $TMPC << EOF
2467 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2468 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2470 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2471 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2472 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2473 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2474 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2477 # Checking for CFLAGS
2478 _install_strip="-s"
2479 if test "$_profile" != "" || test "$_debug" != "" ; then
2480 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2481 _install_strip=
2482 elif test -z "$CFLAGS" ; then
2483 if test "$cc_vendor" = "intel" ; then
2484 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2485 elif test "$cc_vendor" = "sun" ; then
2486 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2487 elif test "$cc_vendor" != "gnu" ; then
2488 CFLAGS="-O2 $_march $_mcpu $_pipe"
2489 else
2490 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2491 extra_ldflags="$extra_ldflags -ffast-math"
2493 else
2494 _warn_CFLAGS=yes
2497 cat > $TMPC << EOF
2498 int main(void) { return 0; }
2500 if test "$cc_vendor" = "gnu" ; then
2501 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2502 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
2503 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2504 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2505 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2506 cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
2507 cc_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
2508 else
2509 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2512 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2513 cc_check -MD -MP && CFLAGS="-MD -MP $CFLAGS"
2516 if test -n "$LDFLAGS" ; then
2517 extra_ldflags="$extra_ldflags $LDFLAGS"
2518 _warn_CFLAGS=yes
2519 elif test "$cc_vendor" = "intel" ; then
2520 extra_ldflags="$extra_ldflags -i-static"
2522 if test -n "$CPPFLAGS" ; then
2523 extra_cflags="$extra_cflags $CPPFLAGS"
2524 _warn_CFLAGS=yes
2529 if x86_32 ; then
2530 # Checking assembler (_as) compatibility...
2531 # Added workaround for older as that reads from stdin by default - atmos
2532 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2533 echocheck "assembler ($_as $as_version)"
2535 _pref_as_version='2.9.1'
2536 echo 'nop' > $TMPS
2537 if test "$_mmx" = yes ; then
2538 echo 'emms' >> $TMPS
2540 if test "$_3dnow" = yes ; then
2541 _pref_as_version='2.10.1'
2542 echo 'femms' >> $TMPS
2544 if test "$_3dnowext" = yes ; then
2545 _pref_as_version='2.10.1'
2546 echo 'pswapd %mm0, %mm0' >> $TMPS
2548 if test "$_mmxext" = yes ; then
2549 _pref_as_version='2.10.1'
2550 echo 'movntq %mm0, (%eax)' >> $TMPS
2552 if test "$_sse" = yes ; then
2553 _pref_as_version='2.10.1'
2554 echo 'xorps %xmm0, %xmm0' >> $TMPS
2556 #if test "$_sse2" = yes ; then
2557 # _pref_as_version='2.11'
2558 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2560 if test "$_cmov" = yes ; then
2561 _pref_as_version='2.10.1'
2562 echo 'cmovb %eax, %ebx' >> $TMPS
2564 if test "$_ssse3" = yes ; then
2565 _pref_as_version='2.16.92'
2566 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2568 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2570 if test "$as_verc_fail" != yes ; then
2571 echores "ok"
2572 else
2573 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2574 echores "failed"
2575 die "obsolete binutils version"
2578 fi #if x86_32
2580 echocheck ".align is a power of two"
2581 if test "$_asmalign_pot" = auto ; then
2582 _asmalign_pot=no
2583 cat > $TMPC << EOF
2584 int main(void) { __asm__ (".align 3"); return 0; }
2586 cc_check && _asmalign_pot=yes
2588 if test "$_asmalign_pot" = "yes" ; then
2589 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2590 else
2591 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2593 echores $_asmalign_pot
2595 if x86 ; then
2596 echocheck "10 assembler operands"
2597 ten_operands=no
2598 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2599 cat > $TMPC << EOF
2600 int main(void) {
2601 int x=0;
2602 __asm__ volatile(
2604 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2606 return 0;
2609 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2610 echores $ten_operands
2612 echocheck "ebx availability"
2613 ebx_available=no
2614 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2615 cat > $TMPC << EOF
2616 int main(void) {
2617 int x;
2618 __asm__ volatile(
2619 "xor %0, %0"
2620 :"=b"(x)
2621 // just adding ebx to clobber list seems unreliable with some
2622 // compilers, e.g. Haiku's gcc 2.95
2624 // and the above check does not work for OSX 64 bit...
2625 __asm__ volatile("":::"%ebx");
2626 return 0;
2629 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2630 echores $ebx_available
2632 echocheck "PIC"
2633 pic=no
2634 cat > $TMPC << EOF
2635 int main(void) {
2636 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2637 #error PIC not enabled
2638 #endif
2639 return 0;
2642 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2643 echores $pic
2645 echocheck "yasm"
2646 if test -z "$YASMFLAGS" ; then
2647 if darwin ; then
2648 x86_64 && objformat="macho64" || objformat="macho"
2649 elif win32 ; then
2650 objformat="win32"
2651 else
2652 objformat="elf"
2654 # currently tested for Linux x86, x86_64
2655 YASMFLAGS="-f $objformat"
2656 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2657 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2658 case "$objformat" in
2659 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2660 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2661 esac
2662 else
2663 _warn_CFLAGS=yes
2666 echo "pabsw xmm0, xmm0" > $TMPS
2667 yasm_check || _yasm=""
2668 if test $_yasm ; then
2669 def_yasm='#define HAVE_YASM 1'
2670 have_yasm="yes"
2671 echores "$_yasm"
2672 else
2673 def_yasm='#define HAVE_YASM 0'
2674 have_yasm="no"
2675 echores "no"
2678 echocheck "bswap"
2679 def_bswap='#define HAVE_BSWAP 0'
2680 echo 'bswap %eax' > $TMPS
2681 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2682 echores "$bswap"
2683 fi #if x86
2686 #FIXME: This should happen before the check for CFLAGS..
2687 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2688 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2690 # check if AltiVec is supported by the compiler, and how to enable it
2691 echocheck "GCC AltiVec flags"
2692 cat > $TMPC << EOF
2693 int main(void) { return 0; }
2695 if $(cc_check -maltivec -mabi=altivec) ; then
2696 _altivec_gcc_flags="-maltivec -mabi=altivec"
2697 # check if <altivec.h> should be included
2698 cat > $TMPC << EOF
2699 #include <altivec.h>
2700 int main(void) { return 0; }
2702 if $(cc_check $_altivec_gcc_flags) ; then
2703 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2704 inc_altivec_h='#include <altivec.h>'
2705 else
2706 cat > $TMPC << EOF
2707 int main(void) { return 0; }
2709 if $(cc_check -faltivec) ; then
2710 _altivec_gcc_flags="-faltivec"
2711 else
2712 _altivec=no
2713 _altivec_gcc_flags="none, AltiVec disabled"
2717 echores "$_altivec_gcc_flags"
2719 # check if the compiler supports braces for vector declarations
2720 cat > $TMPC << EOF
2721 $inc_altivec_h
2722 int main(void) { (vector int) {1}; return 0; }
2724 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2726 # Disable runtime cpudetection if we cannot generate AltiVec code or
2727 # AltiVec is disabled by the user.
2728 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2729 && _runtime_cpudetection=no
2731 # Show that we are optimizing for AltiVec (if enabled and supported).
2732 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2733 && _optimizing="$_optimizing altivec"
2735 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2736 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2739 if ppc ; then
2740 def_xform_asm='#define HAVE_XFORM_ASM 0'
2741 xform_asm=no
2742 echocheck "XFORM ASM support"
2743 cat > $TMPC << EOF
2744 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2746 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2747 echores "$xform_asm"
2750 if arm ; then
2751 echocheck "ARM pld instruction"
2752 cat > $TMPC << EOF
2753 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2755 pld=no
2756 cc_check && pld=yes
2757 echores "$pld"
2759 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2760 if test $_armv5te = "auto" ; then
2761 cat > $TMPC << EOF
2762 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2764 _armv5te=no
2765 cc_check && _armv5te=yes
2767 echores "$_armv5te"
2769 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2771 echocheck "ARMv6 (SIMD instructions)"
2772 if test $_armv6 = "auto" ; then
2773 cat > $TMPC << EOF
2774 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2776 _armv6=no
2777 cc_check && _armv6=yes
2779 echores "$_armv6"
2781 echocheck "ARMv6t2 (SIMD instructions)"
2782 if test $_armv6t2 = "auto" ; then
2783 cat > $TMPC << EOF
2784 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2786 _armv6t2=no
2787 cc_check && _armv6t2=yes
2789 echores "$_armv6"
2791 echocheck "ARM VFP"
2792 if test $_armvfp = "auto" ; then
2793 cat > $TMPC << EOF
2794 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2796 _armvfp=no
2797 cc_check && _armvfp=yes
2799 echores "$_armvfp"
2801 echocheck "ARM NEON"
2802 if test $neon = "auto" ; then
2803 cat > $TMPC << EOF
2804 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2806 neon=no
2807 cc_check && neon=yes
2809 echores "$neon"
2811 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2812 if test $_iwmmxt = "auto" ; then
2813 cat > $TMPC << EOF
2814 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2816 _iwmmxt=no
2817 cc_check && _iwmmxt=yes
2819 echores "$_iwmmxt"
2822 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'
2823 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2824 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2825 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2826 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2827 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2828 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2829 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2830 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2831 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2832 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2833 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2834 test "$pld" = yes && cpuexts="PLD $cpuexts"
2835 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2836 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2837 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2838 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2839 test "$neon" = yes && cpuexts="NEON $cpuexts"
2840 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2841 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2842 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2844 # Checking kernel version...
2845 if x86_32 && linux ; then
2846 _k_verc_problem=no
2847 kernel_version=$(uname -r 2>&1)
2848 echocheck "$system_name kernel version"
2849 case "$kernel_version" in
2850 '') kernel_version="?.??"; _k_verc_fail=yes;;
2851 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2852 _k_verc_problem=yes;;
2853 esac
2854 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2855 _k_verc_fail=yes
2857 if test "$_k_verc_fail" ; then
2858 echores "$kernel_version, fail"
2859 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2860 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2861 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2862 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2863 echo "2.2.x you must upgrade it to get SSE support!"
2864 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2865 else
2866 echores "$kernel_version, ok"
2870 ######################
2871 # MAIN TESTS GO HERE #
2872 ######################
2875 echocheck "-lposix"
2876 cat > $TMPC <<EOF
2877 int main(void) { return 0; }
2879 if cc_check -lposix ; then
2880 extra_ldflags="$extra_ldflags -lposix"
2881 echores "yes"
2882 else
2883 echores "no"
2886 echocheck "-lm"
2887 cat > $TMPC <<EOF
2888 int main(void) { return 0; }
2890 if cc_check -lm ; then
2891 _ld_lm="-lm"
2892 echores "yes"
2893 else
2894 _ld_lm=""
2895 echores "no"
2899 echocheck "langinfo"
2900 if test "$_langinfo" = auto ; then
2901 cat > $TMPC <<EOF
2902 #include <langinfo.h>
2903 int main(void) { nl_langinfo(CODESET); return 0; }
2905 _langinfo=no
2906 cc_check && _langinfo=yes
2908 if test "$_langinfo" = yes ; then
2909 def_langinfo='#define HAVE_LANGINFO 1'
2910 else
2911 def_langinfo='#undef HAVE_LANGINFO'
2913 echores "$_langinfo"
2916 echocheck "language"
2917 # Set preferred languages, "all" uses English as main language.
2918 test -z "$language" && language=$LINGUAS
2919 test -z "$language_doc" && language_doc=$language
2920 test -z "$language_man" && language_man=$language
2921 test -z "$language_msg" && language_msg=$language
2922 language_doc=$(echo $language_doc | tr , " ")
2923 language_man=$(echo $language_man | tr , " ")
2924 language_msg=$(echo $language_msg | tr , " ")
2926 test "$language_doc" = "all" && language_doc=$doc_lang_all
2927 test "$language_man" = "all" && language_man=$man_lang_all
2928 test "$language_msg" = "all" && language_msg=en
2930 # Prune non-existing translations from language lists.
2931 # Set message translation to the first available language.
2932 # Fall back on English.
2933 for lang in $language_doc ; do
2934 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2935 done
2936 language_doc=$tmp_language_doc
2937 test -z "$language_doc" && language_doc=en
2939 for lang in $language_man ; do
2940 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2941 done
2942 language_man=$tmp_language_man
2943 test -z "$language_man" && language_man=en
2945 for lang in $language_msg ; do
2946 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2947 done
2948 language_msg=$tmp_language_msg
2949 test -z "$language_msg" && language_msg=en
2950 _mp_help="help/help_mp-${language_msg}.h"
2951 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2954 echocheck "enable sighandler"
2955 if test "$_sighandler" = yes ; then
2956 def_sighandler='#define CONFIG_SIGHANDLER 1'
2957 else
2958 def_sighandler='#undef CONFIG_SIGHANDLER'
2960 echores "$_sighandler"
2962 echocheck "runtime cpudetection"
2963 if test "$_runtime_cpudetection" = yes ; then
2964 _optimizing="Runtime CPU-Detection enabled"
2965 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2966 else
2967 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2969 echores "$_runtime_cpudetection"
2972 echocheck "restrict keyword"
2973 for restrict_keyword in restrict __restrict __restrict__ ; do
2974 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2975 if cc_check; then
2976 def_restrict_keyword=$restrict_keyword
2977 break;
2979 done
2980 if [ -n "$def_restrict_keyword" ]; then
2981 echores "$def_restrict_keyword"
2982 else
2983 echores "none"
2985 # Avoid infinite recursion loop ("#define restrict restrict")
2986 if [ "$def_restrict_keyword" != "restrict" ]; then
2987 def_restrict_keyword="#define restrict $def_restrict_keyword"
2988 else
2989 def_restrict_keyword=""
2993 echocheck "__builtin_expect"
2994 # GCC branch prediction hint
2995 cat > $TMPC << EOF
2996 int foo(int a) {
2997 a = __builtin_expect(a, 10);
2998 return a == 10 ? 0 : 1;
3000 int main(void) { return foo(10) && foo(0); }
3002 _builtin_expect=no
3003 cc_check && _builtin_expect=yes
3004 if test "$_builtin_expect" = yes ; then
3005 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
3006 else
3007 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
3009 echores "$_builtin_expect"
3012 echocheck "kstat"
3013 cat > $TMPC << EOF
3014 #include <kstat.h>
3015 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
3017 _kstat=no
3018 cc_check -lkstat && _kstat=yes
3019 if test "$_kstat" = yes ; then
3020 def_kstat="#define HAVE_LIBKSTAT 1"
3021 extra_ldflags="$extra_ldflags -lkstat"
3022 else
3023 def_kstat="#undef HAVE_LIBKSTAT"
3025 echores "$_kstat"
3028 echocheck "posix4"
3029 # required for nanosleep on some systems
3030 cat > $TMPC << EOF
3031 #include <time.h>
3032 int main(void) { (void) nanosleep(0, 0); return 0; }
3034 _posix4=no
3035 cc_check -lposix4 && _posix4=yes
3036 if test "$_posix4" = yes ; then
3037 extra_ldflags="$extra_ldflags -lposix4"
3039 echores "$_posix4"
3041 for func in exp2 exp2f llrint llrintf log2 log2f lrint lrintf round roundf truncf; do
3042 echocheck $func
3043 cat > $TMPC << EOF
3044 #include <math.h>
3045 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
3047 eval _$func=no
3048 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
3049 if eval test "x\$_$func" = "xyes"; then
3050 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
3051 echores yes
3052 else
3053 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
3054 echores no
3056 done
3059 echocheck "mkstemp"
3060 cat > $TMPC << EOF
3061 #include <stdlib.h>
3062 int main(void) { char a; mkstemp(&a); return 0; }
3064 _mkstemp=no
3065 cc_check && _mkstemp=yes
3066 if test "$_mkstemp" = yes ; then
3067 def_mkstemp='#define HAVE_MKSTEMP 1'
3068 else
3069 def_mkstemp='#undef HAVE_MKSTEMP'
3071 echores "$_mkstemp"
3074 echocheck "nanosleep"
3075 # also check for nanosleep
3076 cat > $TMPC << EOF
3077 #include <time.h>
3078 int main(void) { (void) nanosleep(0, 0); return 0; }
3080 _nanosleep=no
3081 cc_check && _nanosleep=yes
3082 if test "$_nanosleep" = yes ; then
3083 def_nanosleep='#define HAVE_NANOSLEEP 1'
3084 else
3085 def_nanosleep='#undef HAVE_NANOSLEEP'
3087 echores "$_nanosleep"
3090 echocheck "socklib"
3091 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3092 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3093 cat > $TMPC << EOF
3094 #include <netdb.h>
3095 #include <sys/socket.h>
3096 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3098 _socklib=no
3099 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3100 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3101 done
3102 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3103 if test $_winsock2_h = auto ; then
3104 _winsock2_h=no
3105 cat > $TMPC << EOF
3106 #include <winsock2.h>
3107 int main(void) { (void) gethostbyname(0); return 0; }
3109 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3111 test "$_ld_sock" && res_comment="using $_ld_sock"
3112 echores "$_socklib"
3115 if test $_winsock2_h = yes ; then
3116 _ld_sock="-lws2_32"
3117 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3118 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1'
3119 else
3120 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3121 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0'
3125 echocheck "netdb.h, struct addrinfo"
3126 if test "$_struct_addrinfo" = auto; then
3127 _struct_addrinfo=no
3128 cat > $TMPC << EOF
3129 #if HAVE_WINSOCK2_H
3130 #include <winsock2.h>
3131 #include <ws2tcpip.h>
3132 #else
3133 #include <sys/types.h>
3134 #include <sys/socket.h>
3135 #include <netdb.h>
3136 #endif
3137 int main(void) { struct addrinfo ai; return 0; }
3139 cc_check $cc_check_winsock2_h && _struct_addrinfo=yes
3141 echores "$_struct_addrinfo"
3143 if test "$_struct_addrinfo" = yes; then
3144 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
3145 else
3146 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
3150 echocheck "netdb.h, getaddrinfo()"
3151 if test "$_getaddrinfo" = auto; then
3152 _getaddrinfo=no
3153 cat > $TMPC << EOF
3154 #if HAVE_WINSOCK2_H
3155 #include <winsock2.h>
3156 #else
3157 #include <sys/types.h>
3158 #include <sys/socket.h>
3159 #include <netdb.h>
3160 #endif
3161 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
3163 cc_check $cc_check_winsock2_h && _getaddrinfo=yes
3165 echores "$_getaddrinfo"
3167 if test "$_getaddrinfo" = yes; then
3168 def_getaddrinfo="#define HAVE_GETADDRINFO 1"
3169 else
3170 def_getaddrinfo="#define HAVE_GETADDRINFO 0"
3174 echocheck "sockaddr_storage"
3175 if test "$_struct_sockaddr_storage" = auto; then
3176 _struct_sockaddr_storage=no
3177 cat > $TMPC << EOF
3178 #if HAVE_WINSOCK2_H
3179 #include <winsock2.h>
3180 #else
3181 #include <sys/socket.h>
3182 #endif
3183 int main(void) { struct sockaddr_storage sas; return 0; }
3185 cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes
3187 echores "$_struct_sockaddr_storage"
3189 if test "$_struct_sockaddr_storage" = yes; then
3190 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
3191 else
3192 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
3196 echocheck "struct ipv6_mreq"
3197 _struct_ipv6_mreq=no
3198 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 0"
3199 for header in "netinet/in.h" "ws2tcpip.h" ; do
3200 cat > $TMPC << EOF
3201 #include <$header>
3202 int main(void) { struct ipv6_mreq mreq6; return 0; }
3204 cc_check && _struct_ipv6_mreq=yes && \
3205 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 1" && break
3206 done
3207 echores "$_struct_ipv6_mreq"
3210 echocheck "struct sockaddr_in6"
3211 _struct_sockaddr_in6=no
3212 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 0"
3213 for header in "netinet/in.h" "ws2tcpip.h" ; do
3214 cat > $TMPC << EOF
3215 #include <$header>
3216 int main(void) { struct sockaddr_in6 addr; return 0; }
3218 cc_check && _struct_sockaddr_in6=yes && \
3219 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 1" && break
3220 done
3221 echores "$_struct_sockaddr_in6"
3224 echocheck "struct sockaddr sa_len"
3225 _struct_sockaddr_sa_len=no
3226 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 0"
3227 cat > $TMPC << EOF
3228 #if HAVE_WINSOCK2_H
3229 #include <winsock2.h>
3230 #else
3231 #include <sys/types.h>
3232 #include <sys/socket.h>
3233 #endif
3234 int main(void) { const void *p = &((struct sockaddr *)0)->sa_len; return 0; }
3236 cc_check $cc_check_winsock2_h && _struct_sockaddr_sa_len=yes && \
3237 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 1"
3238 echores "$_struct_sockaddr_sa_len"
3241 echocheck "arpa/inet.h"
3242 arpa_inet_h=no
3243 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3244 cat > $TMPC << EOF
3245 #include <arpa/inet.h>
3246 int main(void) { return 0; }
3248 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3249 echores "$arpa_inet_h"
3252 echocheck "inet_pton()"
3253 def_inet_pton='#define HAVE_INET_PTON 0'
3254 inet_pton=no
3255 cat > $TMPC << EOF
3256 #include <sys/types.h>
3257 #include <sys/socket.h>
3258 #include <arpa/inet.h>
3259 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3261 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3262 cc_check $_ld_tmp && inet_pton=yes && break
3263 done
3264 if test $inet_pton = yes ; then
3265 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3266 def_inet_pton='#define HAVE_INET_PTON 1'
3268 echores "$inet_pton"
3271 echocheck "inet_aton()"
3272 def_inet_aton='#define HAVE_INET_ATON 0'
3273 inet_aton=no
3274 cat > $TMPC << EOF
3275 #include <sys/types.h>
3276 #include <sys/socket.h>
3277 #include <arpa/inet.h>
3278 int main(void) { (void) inet_aton(0, 0); return 0; }
3280 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3281 cc_check $_ld_tmp && inet_aton=yes && break
3282 done
3283 if test $inet_aton = yes ; then
3284 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3285 def_inet_aton='#define HAVE_INET_ATON 1'
3287 echores "$inet_aton"
3290 echocheck "socklen_t"
3291 _socklen_t=no
3292 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3293 cat > $TMPC << EOF
3294 #include <$header>
3295 int main(void) { socklen_t v = 0; return v; }
3297 cc_check && _socklen_t=yes && break
3298 done
3299 if test "$_socklen_t" = yes ; then
3300 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3301 else
3302 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3304 echores "$_socklen_t"
3307 echocheck "closesocket()"
3308 _closesocket=no
3309 cat > $TMPC << EOF
3310 #include <winsock2.h>
3311 int main(void) { closesocket(~0); return 0; }
3313 cc_check $_ld_sock && _closesocket=yes
3314 if test "$_closesocket" = yes ; then
3315 def_closesocket='#define HAVE_CLOSESOCKET 1'
3316 else
3317 def_closesocket='#define HAVE_CLOSESOCKET 0'
3319 echores "$_closesocket"
3322 echocheck "network"
3323 test $_winsock2_h = no && test $inet_pton = no &&
3324 test $inet_aton = no && _network=no
3325 if test "$_network" = yes ; then
3326 def_network='#define CONFIG_NETWORK 1'
3327 extra_ldflags="$extra_ldflags $_ld_sock"
3328 inputmodules="network $inputmodules"
3329 else
3330 _noinputmodules="network $_noinputmodules"
3331 def_network='#undef CONFIG_NETWORK'
3332 _ftp=no
3333 _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//)
3334 _libavdemuxers=$(echo $_libavdemuxers | sed -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER//)
3336 echores "$_network"
3339 echocheck "inet6"
3340 if test "$_inet6" = auto ; then
3341 cat > $TMPC << EOF
3342 #include <sys/types.h>
3343 #if !defined(_WIN32) || defined(__CYGWIN__)
3344 #include <sys/socket.h>
3345 #include <netinet/in.h>
3346 #else
3347 #include <ws2tcpip.h>
3348 #endif
3349 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3351 _inet6=no
3352 if cc_check $_ld_sock ; then
3353 _inet6=yes
3356 if test "$_inet6" = yes ; then
3357 def_inet6='#define HAVE_AF_INET6 1'
3358 else
3359 def_inet6='#undef HAVE_AF_INET6'
3361 echores "$_inet6"
3364 echocheck "gethostbyname2"
3365 if test "$_gethostbyname2" = auto ; then
3366 cat > $TMPC << EOF
3367 #include <sys/types.h>
3368 #include <sys/socket.h>
3369 #include <netdb.h>
3370 int main(void) { gethostbyname2("", AF_INET); return 0; }
3372 _gethostbyname2=no
3373 if cc_check ; then
3374 _gethostbyname2=yes
3377 if test "$_gethostbyname2" = yes ; then
3378 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3379 else
3380 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3382 echores "$_gethostbyname2"
3385 echocheck "inttypes.h (required)"
3386 cat > $TMPC << EOF
3387 #include <inttypes.h>
3388 int main(void) { return 0; }
3390 _inttypes=no
3391 cc_check && _inttypes=yes
3392 echores "$_inttypes"
3394 if test "$_inttypes" = no ; then
3395 echocheck "bitypes.h (inttypes.h predecessor)"
3396 cat > $TMPC << EOF
3397 #include <sys/bitypes.h>
3398 int main(void) { return 0; }
3400 cc_check && _inttypes=yes
3401 if test "$_inttypes" = yes ; then
3402 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."
3403 else
3404 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3409 echocheck "int_fastXY_t in inttypes.h"
3410 cat > $TMPC << EOF
3411 #include <inttypes.h>
3412 int main(void) {
3413 volatile int_fast16_t v= 0;
3414 return v; }
3416 _fast_inttypes=no
3417 cc_check && _fast_inttypes=yes
3418 if test "$_fast_inttypes" = no ; then
3419 def_fast_inttypes='
3420 typedef signed char int_fast8_t;
3421 typedef signed int int_fast16_t;
3422 typedef signed int int_fast32_t;
3423 typedef signed long long int_fast64_t;
3424 typedef unsigned char uint_fast8_t;
3425 typedef unsigned int uint_fast16_t;
3426 typedef unsigned int uint_fast32_t;
3427 typedef unsigned long long uint_fast64_t;'
3429 echores "$_fast_inttypes"
3432 echocheck "malloc.h"
3433 cat > $TMPC << EOF
3434 #include <malloc.h>
3435 int main(void) { (void) malloc(0); return 0; }
3437 _malloc=no
3438 cc_check && _malloc=yes
3439 if test "$_malloc" = yes ; then
3440 def_malloc_h='#define HAVE_MALLOC_H 1'
3441 else
3442 def_malloc_h='#define HAVE_MALLOC_H 0'
3444 echores "$_malloc"
3447 echocheck "memalign()"
3448 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3449 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3450 cat > $TMPC << EOF
3451 #include <malloc.h>
3452 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3454 _memalign=no
3455 cc_check && _memalign=yes
3456 if test "$_memalign" = yes ; then
3457 def_memalign='#define HAVE_MEMALIGN 1'
3458 else
3459 def_memalign='#define HAVE_MEMALIGN 0'
3460 def_map_memalign='#define memalign(a,b) malloc(b)'
3461 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3463 echores "$_memalign"
3466 echocheck "posix_memalign()"
3467 posix_memalign=no
3468 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3469 cat > $TMPC << EOF
3470 #define _XOPEN_SOURCE 600
3471 #include <stdlib.h>
3472 int main(void) { posix_memalign(NULL, 0, 0); }
3474 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3475 echores "$posix_memalign"
3478 echocheck "alloca.h"
3479 cat > $TMPC << EOF
3480 #include <alloca.h>
3481 int main(void) { (void) alloca(0); return 0; }
3483 _alloca=no
3484 cc_check && _alloca=yes
3485 if cc_check ; then
3486 def_alloca_h='#define HAVE_ALLOCA_H 1'
3487 else
3488 def_alloca_h='#undef HAVE_ALLOCA_H'
3490 echores "$_alloca"
3493 echocheck "fastmemcpy"
3494 if test "$_fastmemcpy" = yes ; then
3495 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3496 else
3497 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3499 echores "$_fastmemcpy"
3502 echocheck "hard-coded tables"
3503 if test "$hardcoded_tables" = yes ; then
3504 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1'
3505 mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes'
3506 else
3507 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0'
3509 echores "$hardcoded_tables"
3512 echocheck "mman.h"
3513 cat > $TMPC << EOF
3514 #include <sys/types.h>
3515 #include <sys/mman.h>
3516 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3518 _mman=no
3519 cc_check && _mman=yes
3520 if test "$_mman" = yes ; then
3521 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3522 else
3523 def_mman_h='#undef HAVE_SYS_MMAN_H'
3524 os2 && _need_mmap=yes
3526 echores "$_mman"
3528 cat > $TMPC << EOF
3529 #include <sys/types.h>
3530 #include <sys/mman.h>
3531 int main(void) { void *p = MAP_FAILED; return 0; }
3533 _mman_has_map_failed=no
3534 cc_check && _mman_has_map_failed=yes
3535 if test "$_mman_has_map_failed" = yes ; then
3536 def_mman_has_map_failed=''
3537 else
3538 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3541 echocheck "dynamic loader"
3542 cat > $TMPC << EOF
3543 #include <stddef.h>
3544 #include <dlfcn.h>
3545 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3547 _dl=no
3548 for _ld_tmp in "" "-ldl" ; do
3549 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3550 done
3551 if test "$_dl" = yes ; then
3552 def_dl='#define HAVE_LIBDL 1'
3553 else
3554 def_dl='#undef HAVE_LIBDL'
3556 echores "$_dl"
3559 echocheck "dynamic a/v plugins support"
3560 if test "$_dl" = no ; then
3561 _dynamic_plugins=no
3563 if test "$_dynamic_plugins" = yes ; then
3564 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3565 else
3566 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3568 echores "$_dynamic_plugins"
3571 def_threads='#define HAVE_THREADS 0'
3573 echocheck "pthread"
3574 if linux ; then
3575 THREAD_CFLAGS=-D_REENTRANT
3576 elif freebsd || netbsd || openbsd || bsdos ; then
3577 THREAD_CFLAGS=-D_THREAD_SAFE
3579 if test "$_pthreads" = auto ; then
3580 cat > $TMPC << EOF
3581 #include <pthread.h>
3582 void* func(void *arg) { return arg; }
3583 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3585 _pthreads=no
3586 if ! hpux ; then
3587 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3588 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3589 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3590 done
3593 if test "$_pthreads" = yes ; then
3594 test $_ld_pthread && res_comment="using $_ld_pthread"
3595 def_pthreads='#define HAVE_PTHREADS 1'
3596 def_threads='#define HAVE_THREADS 1'
3597 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3598 else
3599 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3600 def_pthreads='#undef HAVE_PTHREADS'
3601 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3602 mingw32 || _win32dll=no
3604 echores "$_pthreads"
3606 if cygwin ; then
3607 if test "$_pthreads" = yes ; then
3608 def_pthread_cache="#define PTHREAD_CACHE 1"
3609 else
3610 _stream_cache=no
3611 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3615 echocheck "w32threads"
3616 if test "$_pthreads" = yes ; then
3617 res_comment="using pthread instead"
3618 _w32threads=no
3620 if test "$_w32threads" = auto ; then
3621 _w32threads=no
3622 mingw32 && _w32threads=yes
3624 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3625 echores "$_w32threads"
3627 echocheck "rpath"
3628 netbsd &&_rpath=yes
3629 if test "$_rpath" = yes ; then
3630 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3631 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3632 done
3633 extra_ldflags=$tmp
3635 echores "$_rpath"
3637 echocheck "iconv"
3638 if test "$_iconv" = auto ; then
3639 cat > $TMPC << EOF
3640 #include <stdio.h>
3641 #include <unistd.h>
3642 #include <iconv.h>
3643 #define INBUFSIZE 1024
3644 #define OUTBUFSIZE 4096
3646 char inbuffer[INBUFSIZE];
3647 char outbuffer[OUTBUFSIZE];
3649 int main(void) {
3650 size_t numread;
3651 iconv_t icdsc;
3652 char *tocode="UTF-8";
3653 char *fromcode="cp1250";
3654 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3655 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3656 char *iptr=inbuffer;
3657 char *optr=outbuffer;
3658 size_t inleft=numread;
3659 size_t outleft=OUTBUFSIZE;
3660 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3661 != (size_t)(-1)) {
3662 write(1, outbuffer, OUTBUFSIZE - outleft);
3665 if (iconv_close(icdsc) == -1)
3668 return 0;
3671 _iconv=no
3672 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3673 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3674 _iconv=yes && break
3675 done
3677 if test "$_iconv" = yes ; then
3678 def_iconv='#define CONFIG_ICONV 1'
3679 else
3680 def_iconv='#undef CONFIG_ICONV'
3682 echores "$_iconv"
3685 echocheck "soundcard.h"
3686 _soundcard_h=no
3687 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3688 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3689 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3690 cat > $TMPC << EOF
3691 #include <$_soundcard_header>
3692 int main(void) { return 0; }
3694 cc_check && _soundcard_h=yes && res_comment="$_soundcard_header" && break
3695 done
3697 if test "$_soundcard_h" = yes ; then
3698 if test $_soundcard_header = "sys/soundcard.h"; then
3699 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3700 else
3701 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3704 echores "$_soundcard_h"
3707 echocheck "sys/dvdio.h"
3708 cat > $TMPC << EOF
3709 #include <unistd.h>
3710 #include <sys/dvdio.h>
3711 int main(void) { return 0; }
3713 _dvdio=no
3714 cc_check && _dvdio=yes
3715 if test "$_dvdio" = yes ; then
3716 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3717 else
3718 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3720 echores "$_dvdio"
3723 echocheck "sys/cdio.h"
3724 cat > $TMPC << EOF
3725 #include <unistd.h>
3726 #include <sys/cdio.h>
3727 int main(void) { return 0; }
3729 _cdio=no
3730 cc_check && _cdio=yes
3731 if test "$_cdio" = yes ; then
3732 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3733 else
3734 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3736 echores "$_cdio"
3739 echocheck "linux/cdrom.h"
3740 cat > $TMPC << EOF
3741 #include <sys/types.h>
3742 #include <linux/cdrom.h>
3743 int main(void) { return 0; }
3745 _cdrom=no
3746 cc_check && _cdrom=yes
3747 if test "$_cdrom" = yes ; then
3748 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3749 else
3750 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3752 echores "$_cdrom"
3755 echocheck "dvd.h"
3756 cat > $TMPC << EOF
3757 #include <dvd.h>
3758 int main(void) { return 0; }
3760 _dvd=no
3761 cc_check && _dvd=yes
3762 if test "$_dvd" = yes ; then
3763 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3764 else
3765 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3767 echores "$_dvd"
3770 if bsdos; then
3771 echocheck "BSDI dvd.h"
3772 cat > $TMPC << EOF
3773 #include <dvd.h>
3774 int main(void) { return 0; }
3776 _bsdi_dvd=no
3777 cc_check && _bsdi_dvd=yes
3778 if test "$_bsdi_dvd" = yes ; then
3779 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3780 else
3781 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3783 echores "$_bsdi_dvd"
3784 fi #if bsdos
3787 if hpux; then
3788 # also used by AIX, but AIX does not support VCD and/or libdvdread
3789 echocheck "HP-UX SCSI header"
3790 cat > $TMPC << EOF
3791 #include <sys/scsi.h>
3792 int main(void) { return 0; }
3794 _hpux_scsi_h=no
3795 cc_check && _hpux_scsi_h=yes
3796 if test "$_hpux_scsi_h" = yes ; then
3797 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3798 else
3799 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3801 echores "$_hpux_scsi_h"
3802 fi #if hpux
3805 if sunos; then
3806 echocheck "userspace SCSI headers (Solaris)"
3807 cat > $TMPC << EOF
3808 #include <unistd.h>
3809 #include <stropts.h>
3810 #include <sys/scsi/scsi_types.h>
3811 #include <sys/scsi/impl/uscsi.h>
3812 int main(void) { return 0; }
3814 _sol_scsi_h=no
3815 cc_check && _sol_scsi_h=yes
3816 if test "$_sol_scsi_h" = yes ; then
3817 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3818 else
3819 def_sol_scsi_h='#undef SOLARIS_USCSI'
3821 echores "$_sol_scsi_h"
3822 fi #if sunos
3825 echocheck "termcap"
3826 if test "$_termcap" = auto ; then
3827 cat > $TMPC <<EOF
3828 #include <stddef.h>
3829 #include <term.h>
3830 int main(void) { tgetent(NULL, NULL); return 0; }
3832 _termcap=no
3833 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3834 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3835 && _termcap=yes && break
3836 done
3838 if test "$_termcap" = yes ; then
3839 def_termcap='#define HAVE_TERMCAP 1'
3840 test $_ld_tmp && res_comment="using $_ld_tmp"
3841 else
3842 def_termcap='#undef HAVE_TERMCAP'
3844 echores "$_termcap"
3847 echocheck "termios"
3848 def_termios='#undef HAVE_TERMIOS'
3849 def_termios_h='#undef HAVE_TERMIOS_H'
3850 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3851 if test "$_termios" = auto ; then
3852 _termios=no
3853 for _termios_header in "termios.h" "sys/termios.h"; do
3854 cat > $TMPC <<EOF
3855 #include <$_termios_header>
3856 int main(void) { return 0; }
3858 cc_check && _termios=yes && res_comment="using $_termios_header" && break
3859 done
3862 if test "$_termios" = yes ; then
3863 def_termios='#define HAVE_TERMIOS 1'
3864 if test "$_termios_header" = "termios.h" ; then
3865 def_termios_h='#define HAVE_TERMIOS_H 1'
3866 else
3867 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3870 echores "$_termios"
3873 echocheck "shm"
3874 if test "$_shm" = auto ; then
3875 cat > $TMPC << EOF
3876 #include <sys/types.h>
3877 #include <sys/shm.h>
3878 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3880 _shm=no
3881 cc_check && _shm=yes
3883 if test "$_shm" = yes ; then
3884 def_shm='#define HAVE_SHM 1'
3885 else
3886 def_shm='#undef HAVE_SHM'
3888 echores "$_shm"
3891 echocheck "strsep()"
3892 cat > $TMPC << EOF
3893 #include <string.h>
3894 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3896 _strsep=no
3897 cc_check && _strsep=yes
3898 if test "$_strsep" = yes ; then
3899 def_strsep='#define HAVE_STRSEP 1'
3900 _need_strsep=no
3901 else
3902 def_strsep='#undef HAVE_STRSEP'
3903 _need_strsep=yes
3905 echores "$_strsep"
3908 echocheck "vsscanf()"
3909 cat > $TMPC << EOF
3910 #define _ISOC99_SOURCE
3911 #include <stdarg.h>
3912 #include <stdio.h>
3913 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3915 _vsscanf=no
3916 cc_check && _vsscanf=yes
3917 if test "$_vsscanf" = yes ; then
3918 def_vsscanf='#define HAVE_VSSCANF 1'
3919 _need_vsscanf=no
3920 else
3921 def_vsscanf='#undef HAVE_VSSCANF'
3922 _need_vsscanf=yes
3924 echores "$_vsscanf"
3927 echocheck "swab()"
3928 cat > $TMPC << EOF
3929 #define _XOPEN_SOURCE 600
3930 #include <unistd.h>
3931 int main(void) { swab(0, 0, 0); return 0; }
3933 _swab=no
3934 cc_check && _swab=yes
3935 if test "$_swab" = yes ; then
3936 def_swab='#define HAVE_SWAB 1'
3937 _need_swab=no
3938 else
3939 def_swab='#undef HAVE_SWAB'
3940 _need_swab=yes
3942 echores "$_swab"
3944 echocheck "POSIX select()"
3945 cat > $TMPC << EOF
3946 #include <stdio.h>
3947 #include <stdlib.h>
3948 #include <sys/types.h>
3949 #include <string.h>
3950 #include <sys/time.h>
3951 #include <unistd.h>
3952 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3954 _posix_select=no
3955 def_posix_select='#undef HAVE_POSIX_SELECT'
3956 #select() of kLIBC (OS/2) supports socket only
3957 ! os2 && cc_check && _posix_select=yes \
3958 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3959 echores "$_posix_select"
3962 echocheck "audio select()"
3963 if test "$_select" = no ; then
3964 def_select='#undef HAVE_AUDIO_SELECT'
3965 elif test "$_select" = yes ; then
3966 def_select='#define HAVE_AUDIO_SELECT 1'
3968 echores "$_select"
3971 echocheck "gettimeofday()"
3972 cat > $TMPC << EOF
3973 #include <stdio.h>
3974 #include <sys/time.h>
3975 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3977 _gettimeofday=no
3978 cc_check && _gettimeofday=yes
3979 if test "$_gettimeofday" = yes ; then
3980 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3981 _need_gettimeofday=no
3982 else
3983 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3984 _need_gettimeofday=yes
3986 echores "$_gettimeofday"
3989 echocheck "glob()"
3990 cat > $TMPC << EOF
3991 #include <stdio.h>
3992 #include <glob.h>
3993 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3995 _glob=no
3996 cc_check && _glob=yes
3997 if test "$_glob" = yes ; then
3998 def_glob='#define HAVE_GLOB 1'
3999 _need_glob=no
4000 else
4001 def_glob='#undef HAVE_GLOB'
4002 _need_glob=yes
4004 echores "$_glob"
4007 echocheck "setenv()"
4008 cat > $TMPC << EOF
4009 #include <stdlib.h>
4010 int main(void) { setenv("","",0); return 0; }
4012 _setenv=no
4013 cc_check && _setenv=yes
4014 if test "$_setenv" = yes ; then
4015 def_setenv='#define HAVE_SETENV 1'
4016 _need_setenv=no
4017 else
4018 def_setenv='#undef HAVE_SETENV'
4019 _need_setenv=yes
4021 echores "$_setenv"
4024 echocheck "setmode()"
4025 _setmode=no
4026 def_setmode='#define HAVE_SETMODE 0'
4027 cat > $TMPC << EOF
4028 #include <io.h>
4029 int main(void) { setmode(0, 0); return 0; }
4031 cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
4032 echores "$_setmode"
4035 if sunos; then
4036 echocheck "sysi86()"
4037 cat > $TMPC << EOF
4038 #include <sys/sysi86.h>
4039 int main(void) { sysi86(0); return 0; }
4041 _sysi86=no
4042 cc_check && _sysi86=yes
4043 if test "$_sysi86" = yes ; then
4044 def_sysi86='#define HAVE_SYSI86 1'
4045 cat > $TMPC << EOF
4046 #include <sys/sysi86.h>
4047 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
4049 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
4050 else
4051 def_sysi86='#undef HAVE_SYSI86'
4053 echores "$_sysi86"
4054 fi #if sunos
4057 echocheck "sys/sysinfo.h"
4058 cat > $TMPC << EOF
4059 #include <sys/sysinfo.h>
4060 int main(void) {
4061 struct sysinfo s_info;
4062 sysinfo(&s_info);
4063 return 0;
4066 _sys_sysinfo=no
4067 cc_check && _sys_sysinfo=yes
4068 if test "$_sys_sysinfo" = yes ; then
4069 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
4070 else
4071 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
4073 echores "$_sys_sysinfo"
4076 if darwin; then
4078 echocheck "Mac OS X Finder Support"
4079 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
4080 if test "$_macosx_finder" = yes ; then
4081 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
4082 extra_ldflags="$extra_ldflags -framework Carbon"
4084 echores "$_macosx_finder"
4086 echocheck "Mac OS X Bundle file locations"
4087 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
4088 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
4089 if test "$_macosx_bundle" = yes ; then
4090 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
4091 extra_ldflags="$extra_ldflags -framework Carbon"
4093 echores "$_macosx_bundle"
4095 echocheck "Apple Remote"
4096 if test "$_apple_remote" = auto ; then
4097 _apple_remote=no
4098 cat > $TMPC <<EOF
4099 #include <stdio.h>
4100 #include <IOKit/IOCFPlugIn.h>
4101 int main(void) {
4102 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
4103 CFMutableDictionaryRef hidMatchDictionary;
4104 IOReturn ioReturnValue;
4106 // Set up a matching dictionary to search the I/O Registry by class.
4107 // name for all HID class devices
4108 hidMatchDictionary = IOServiceMatching("AppleIRController");
4110 // Now search I/O Registry for matching devices.
4111 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
4112 hidMatchDictionary, &hidObjectIterator);
4114 // If search is unsuccessful, return nonzero.
4115 if (ioReturnValue != kIOReturnSuccess ||
4116 !IOIteratorIsValid(hidObjectIterator)) {
4117 return 1;
4119 return 0;
4122 cc_check -framework IOKit && tmp_run && _apple_remote=yes
4124 if test "$_apple_remote" = yes ; then
4125 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
4126 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
4127 else
4128 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
4130 echores "$_apple_remote"
4132 fi #if darwin
4134 if linux; then
4136 echocheck "Apple IR"
4137 if test "$_apple_ir" = auto ; then
4138 _apple_ir=no
4139 cat > $TMPC <<EOF
4140 #include <linux/types.h>
4141 #include <linux/input.h>
4142 int main(void) {
4143 struct input_event ev;
4144 struct input_id id;
4145 return 0;
4148 cc_check && _apple_ir=yes
4150 if test "$_apple_ir" = yes ; then
4151 def_apple_ir='#define CONFIG_APPLE_IR 1'
4152 else
4153 def_apple_ir='#undef CONFIG_APPLE_IR'
4155 echores "$_apple_ir"
4156 fi #if linux
4158 echocheck "pkg-config"
4159 _pkg_config=pkg-config
4160 if $($_pkg_config --version > /dev/null 2>&1); then
4161 if test "$_ld_static"; then
4162 _pkg_config="$_pkg_config --static"
4164 echores "yes"
4165 else
4166 _pkg_config=false
4167 echores "no"
4171 echocheck "Samba support (libsmbclient)"
4172 if test "$_smb" = yes; then
4173 extra_ldflags="$extra_ldflags -lsmbclient"
4175 if test "$_smb" = auto; then
4176 _smb=no
4177 cat > $TMPC << EOF
4178 #include <libsmbclient.h>
4179 int main(void) { smbc_opendir("smb://"); return 0; }
4181 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4182 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
4183 _smb=yes && break
4184 done
4187 if test "$_smb" = yes; then
4188 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4189 inputmodules="smb $inputmodules"
4190 else
4191 def_smb="#undef CONFIG_LIBSMBCLIENT"
4192 _noinputmodules="smb $_noinputmodules"
4194 echores "$_smb"
4197 #########
4198 # VIDEO #
4199 #########
4202 echocheck "tdfxfb"
4203 if test "$_tdfxfb" = yes ; then
4204 def_tdfxfb='#define CONFIG_TDFXFB 1'
4205 vomodules="tdfxfb $vomodules"
4206 else
4207 def_tdfxfb='#undef CONFIG_TDFXFB'
4208 novomodules="tdfxfb $novomodules"
4210 echores "$_tdfxfb"
4212 echocheck "s3fb"
4213 if test "$_s3fb" = yes ; then
4214 def_s3fb='#define CONFIG_S3FB 1'
4215 vomodules="s3fb $vomodules"
4216 else
4217 def_s3fb='#undef CONFIG_S3FB'
4218 novomodules="s3fb $novomodules"
4220 echores "$_s3fb"
4222 echocheck "wii"
4223 if test "$_wii" = yes ; then
4224 def_wii='#define CONFIG_WII 1'
4225 vomodules="wii $vomodules"
4226 else
4227 def_wii='#undef CONFIG_WII'
4228 novomodules="wii $novomodules"
4230 echores "$_wii"
4232 echocheck "tdfxvid"
4233 if test "$_tdfxvid" = yes ; then
4234 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4235 vomodules="tdfx_vid $vomodules"
4236 else
4237 def_tdfxvid='#undef CONFIG_TDFX_VID'
4238 novomodules="tdfx_vid $novomodules"
4240 echores "$_tdfxvid"
4242 echocheck "xvr100"
4243 if test "$_xvr100" = auto ; then
4244 cat > $TMPC << EOF
4245 #include <unistd.h>
4246 #include <sys/fbio.h>
4247 #include <sys/visual_io.h>
4248 int main(void) {
4249 struct vis_identifier ident;
4250 struct fbgattr attr;
4251 ioctl(0, VIS_GETIDENTIFIER, &ident);
4252 ioctl(0, FBIOGATTR, &attr);
4253 return 0;
4256 _xvr100=no
4257 cc_check && _xvr100=yes
4259 if test "$_xvr100" = yes ; then
4260 def_xvr100='#define CONFIG_XVR100 1'
4261 vomodules="xvr100 $vomodules"
4262 else
4263 def_tdfxvid='#undef CONFIG_XVR100'
4264 novomodules="xvr100 $novomodules"
4266 echores "$_xvr100"
4268 echocheck "tga"
4269 if test "$_tga" = yes ; then
4270 def_tga='#define CONFIG_TGA 1'
4271 vomodules="tga $vomodules"
4272 else
4273 def_tga='#undef CONFIG_TGA'
4274 novomodules="tga $novomodules"
4276 echores "$_tga"
4279 echocheck "md5sum support"
4280 if test "$_md5sum" = yes; then
4281 def_md5sum="#define CONFIG_MD5SUM 1"
4282 vomodules="md5sum $vomodules"
4283 else
4284 def_md5sum="#undef CONFIG_MD5SUM"
4285 novomodules="md5sum $novomodules"
4287 echores "$_md5sum"
4290 echocheck "yuv4mpeg support"
4291 if test "$_yuv4mpeg" = yes; then
4292 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4293 vomodules="yuv4mpeg $vomodules"
4294 else
4295 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4296 novomodules="yuv4mpeg $novomodules"
4298 echores "$_yuv4mpeg"
4301 echocheck "bl"
4302 if test "$_bl" = yes ; then
4303 def_bl='#define CONFIG_BL 1'
4304 vomodules="bl $vomodules"
4305 else
4306 def_bl='#undef CONFIG_BL'
4307 novomodules="bl $novomodules"
4309 echores "$_bl"
4312 echocheck "DirectFB"
4313 if test "$_directfb" = auto ; then
4314 _directfb=no
4315 cat > $TMPC <<EOF
4316 #include <directfb.h>
4317 int main(void) { DirectFBInit(0, 0); return 0; }
4319 for _inc_tmp in "" -I/usr/local/include/directfb \
4320 -I/usr/include/directfb -I/usr/local/include; do
4321 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4322 extra_cflags="$extra_cflags $_inc_tmp" && break
4323 done
4326 dfb_version() {
4327 expr $1 \* 65536 + $2 \* 256 + $3
4330 if test "$_directfb" = yes; then
4331 cat > $TMPC << EOF
4332 #include <directfb_version.h>
4334 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4337 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4338 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4339 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4340 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4341 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4342 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4343 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4344 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4345 res_comment="$_directfb_version"
4346 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4347 else
4348 def_directfb_version='#undef DIRECTFBVERSION'
4349 _directfb=no
4350 res_comment="version >=0.9.13 required"
4352 else
4353 _directfb=no
4354 res_comment="failed to get version"
4357 echores "$_directfb"
4359 if test "$_directfb" = yes ; then
4360 def_directfb='#define CONFIG_DIRECTFB 1'
4361 vomodules="directfb $vomodules"
4362 libs_mplayer="$libs_mplayer -ldirectfb"
4363 else
4364 def_directfb='#undef CONFIG_DIRECTFB'
4365 novomodules="directfb $novomodules"
4367 if test "$_dfbmga" = yes; then
4368 vomodules="dfbmga $vomodules"
4369 def_dfbmga='#define CONFIG_DFBMGA 1'
4370 else
4371 novomodules="dfbmga $novomodules"
4372 def_dfbmga='#undef CONFIG_DFBMGA'
4376 echocheck "X11 headers presence"
4377 _x11_headers="no"
4378 res_comment="check if the dev(el) packages are installed"
4379 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4380 if test -f "$I/X11/Xlib.h" ; then
4381 _x11_headers="yes"
4382 res_comment=""
4383 break
4385 done
4386 if test $_cross_compile = no; then
4387 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4388 /usr/include/X11R6 /usr/openwin/include ; do
4389 if test -f "$I/X11/Xlib.h" ; then
4390 extra_cflags="$extra_cflags -I$I"
4391 _x11_headers="yes"
4392 res_comment="using $I"
4393 break
4395 done
4397 echores "$_x11_headers"
4400 echocheck "X11"
4401 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4402 cat > $TMPC <<EOF
4403 #include <X11/Xlib.h>
4404 #include <X11/Xutil.h>
4405 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4407 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4408 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4409 -L/usr/lib ; do
4410 if netbsd; then
4411 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4412 else
4413 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4415 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4416 && _x11=yes && break
4417 done
4419 if test "$_x11" = yes ; then
4420 def_x11='#define CONFIG_X11 1'
4421 vomodules="x11 xover $vomodules"
4422 else
4423 _x11=no
4424 def_x11='#undef CONFIG_X11'
4425 novomodules="x11 $novomodules"
4426 res_comment="check if the dev(el) packages are installed"
4427 # disable stuff that depends on X
4428 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4430 echores "$_x11"
4432 echocheck "Xss screensaver extensions"
4433 if test "$_xss" = auto ; then
4434 cat > $TMPC << EOF
4435 #include <X11/Xlib.h>
4436 #include <X11/extensions/scrnsaver.h>
4437 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4439 _xss=no
4440 cc_check -lXss && _xss=yes
4442 if test "$_xss" = yes ; then
4443 def_xss='#define CONFIG_XSS 1'
4444 libs_mplayer="$libs_mplayer -lXss"
4445 else
4446 def_xss='#undef CONFIG_XSS'
4448 echores "$_xss"
4450 echocheck "DPMS"
4451 _xdpms3=no
4452 _xdpms4=no
4453 if test "$_x11" = yes ; then
4454 cat > $TMPC <<EOF
4455 #include <X11/Xmd.h>
4456 #include <X11/Xlib.h>
4457 #include <X11/Xutil.h>
4458 #include <X11/Xatom.h>
4459 #include <X11/extensions/dpms.h>
4460 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4462 cc_check -lXdpms && _xdpms3=yes
4463 cat > $TMPC <<EOF
4464 #include <X11/Xlib.h>
4465 #include <X11/extensions/dpms.h>
4466 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4468 cc_check -lXext && _xdpms4=yes
4470 if test "$_xdpms4" = yes ; then
4471 def_xdpms='#define CONFIG_XDPMS 1'
4472 res_comment="using Xdpms 4"
4473 echores "yes"
4474 elif test "$_xdpms3" = yes ; then
4475 def_xdpms='#define CONFIG_XDPMS 1'
4476 libs_mplayer="$libs_mplayer -lXdpms"
4477 res_comment="using Xdpms 3"
4478 echores "yes"
4479 else
4480 def_xdpms='#undef CONFIG_XDPMS'
4481 echores "no"
4485 echocheck "Xv"
4486 if test "$_xv" = auto ; then
4487 cat > $TMPC <<EOF
4488 #include <X11/Xlib.h>
4489 #include <X11/extensions/Xvlib.h>
4490 int main(void) {
4491 (void) XvGetPortAttribute(0, 0, 0, 0);
4492 (void) XvQueryPortAttributes(0, 0, 0);
4493 return 0; }
4495 _xv=no
4496 cc_check -lXv && _xv=yes
4499 if test "$_xv" = yes ; then
4500 def_xv='#define CONFIG_XV 1'
4501 libs_mplayer="$libs_mplayer -lXv"
4502 vomodules="xv $vomodules"
4503 else
4504 def_xv='#undef CONFIG_XV'
4505 novomodules="xv $novomodules"
4507 echores "$_xv"
4510 echocheck "XvMC"
4511 if test "$_xv" = yes && test "$_xvmc" != no ; then
4512 _xvmc=no
4513 cat > $TMPC <<EOF
4514 #include <X11/Xlib.h>
4515 #include <X11/extensions/Xvlib.h>
4516 #include <X11/extensions/XvMClib.h>
4517 int main(void) {
4518 (void) XvMCQueryExtension(0,0,0);
4519 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4520 return 0; }
4522 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4523 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4524 done
4526 if test "$_xvmc" = yes ; then
4527 def_xvmc='#define CONFIG_XVMC 1'
4528 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4529 vomodules="xvmc $vomodules"
4530 res_comment="using $_xvmclib"
4531 else
4532 def_xvmc='#define CONFIG_XVMC 0'
4533 novomodules="xvmc $novomodules"
4534 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
4536 echores "$_xvmc"
4539 echocheck "VDPAU"
4540 if test "$_vdpau" = auto ; then
4541 _vdpau=no
4542 if test "$_dl" = yes ; then
4543 cat > $TMPC <<EOF
4544 #include <vdpau/vdpau_x11.h>
4545 int main(void) {
4546 (void) vdp_device_create_x11(0, 0, 0, 0);
4547 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4549 cc_check -lvdpau && _vdpau=yes
4552 if test "$_vdpau" = yes ; then
4553 def_vdpau='#define CONFIG_VDPAU 1'
4554 libs_mplayer="$libs_mplayer -lvdpau"
4555 vomodules="vdpau $vomodules"
4556 else
4557 def_vdpau='#define CONFIG_VDPAU 0'
4558 novomodules="vdpau $novomodules"
4559 _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//)
4561 echores "$_vdpau"
4564 echocheck "Xinerama"
4565 if test "$_xinerama" = auto ; then
4566 cat > $TMPC <<EOF
4567 #include <X11/Xlib.h>
4568 #include <X11/extensions/Xinerama.h>
4569 int main(void) { (void) XineramaIsActive(0); return 0; }
4571 _xinerama=no
4572 cc_check -lXinerama && _xinerama=yes
4575 if test "$_xinerama" = yes ; then
4576 def_xinerama='#define CONFIG_XINERAMA 1'
4577 libs_mplayer="$libs_mplayer -lXinerama"
4578 else
4579 def_xinerama='#undef CONFIG_XINERAMA'
4581 echores "$_xinerama"
4584 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4585 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4586 # named 'X extensions' or something similar.
4587 # This check may be useful for future mplayer versions (to change resolution)
4588 # If you run into problems, remove '-lXxf86vm'.
4589 echocheck "Xxf86vm"
4590 if test "$_vm" = auto ; then
4591 cat > $TMPC <<EOF
4592 #include <X11/Xlib.h>
4593 #include <X11/extensions/xf86vmode.h>
4594 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4596 _vm=no
4597 cc_check -lXxf86vm && _vm=yes
4599 if test "$_vm" = yes ; then
4600 def_vm='#define CONFIG_XF86VM 1'
4601 libs_mplayer="$libs_mplayer -lXxf86vm"
4602 else
4603 def_vm='#undef CONFIG_XF86VM'
4605 echores "$_vm"
4607 # Check for the presence of special keycodes, like audio control buttons
4608 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4609 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4610 # have these new keycodes.
4611 echocheck "XF86keysym"
4612 if test "$_xf86keysym" = auto; then
4613 _xf86keysym=no
4614 cat > $TMPC <<EOF
4615 #include <X11/Xlib.h>
4616 #include <X11/XF86keysym.h>
4617 int main(void) { return XF86XK_AudioPause; }
4619 cc_check && _xf86keysym=yes
4621 if test "$_xf86keysym" = yes ; then
4622 def_xf86keysym='#define CONFIG_XF86XK 1'
4623 else
4624 def_xf86keysym='#undef CONFIG_XF86XK'
4626 echores "$_xf86keysym"
4628 echocheck "DGA"
4629 if test "$_dga2" = auto && test "$_x11" = yes ; then
4630 cat > $TMPC << EOF
4631 #include <X11/Xlib.h>
4632 #include <X11/extensions/xf86dga.h>
4633 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4635 _dga2=no
4636 cc_check -lXxf86dga && _dga2=yes
4638 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4639 cat > $TMPC << EOF
4640 #include <X11/Xlib.h>
4641 #include <X11/extensions/xf86dga.h>
4642 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4644 _dga1=no
4645 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4648 _dga=no
4649 def_dga='#undef CONFIG_DGA'
4650 def_dga1='#undef CONFIG_DGA1'
4651 def_dga2='#undef CONFIG_DGA2'
4652 if test "$_dga1" = yes ; then
4653 _dga=yes
4654 def_dga1='#define CONFIG_DGA1 1'
4655 res_comment="using DGA 1.0"
4656 elif test "$_dga2" = yes ; then
4657 _dga=yes
4658 def_dga2='#define CONFIG_DGA2 1'
4659 res_comment="using DGA 2.0"
4661 if test "$_dga" = yes ; then
4662 def_dga='#define CONFIG_DGA 1'
4663 libs_mplayer="$libs_mplayer -lXxf86dga"
4664 vomodules="dga $vomodules"
4665 else
4666 novomodules="dga $novomodules"
4668 echores "$_dga"
4671 echocheck "3dfx"
4672 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4673 def_3dfx='#define CONFIG_3DFX 1'
4674 vomodules="3dfx $vomodules"
4675 else
4676 def_3dfx='#undef CONFIG_3DFX'
4677 novomodules="3dfx $novomodules"
4679 echores "$_3dfx"
4682 echocheck "VIDIX"
4683 def_vidix='#undef CONFIG_VIDIX'
4684 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4685 _vidix_drv_cyberblade=no
4686 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4687 _vidix_drv_ivtv=no
4688 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4689 _vidix_drv_mach64=no
4690 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4691 _vidix_drv_mga=no
4692 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4693 _vidix_drv_mga_crtc2=no
4694 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4695 _vidix_drv_nvidia=no
4696 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4697 _vidix_drv_pm2=no
4698 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4699 _vidix_drv_pm3=no
4700 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4701 _vidix_drv_radeon=no
4702 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4703 _vidix_drv_rage128=no
4704 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4705 _vidix_drv_s3=no
4706 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4707 _vidix_drv_sh_veu=no
4708 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4709 _vidix_drv_sis=no
4710 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4711 _vidix_drv_unichrome=no
4712 if test "$_vidix" = auto ; then
4713 _vidix=no
4714 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4715 && _vidix=yes
4716 x86_64 && ! linux && _vidix=no
4717 (ppc || alpha) && linux && _vidix=yes
4719 echores "$_vidix"
4721 if test "$_vidix" = yes ; then
4722 def_vidix='#define CONFIG_VIDIX 1'
4723 vomodules="cvidix $vomodules"
4724 # FIXME: ivtv driver temporarily disabled until we have a proper test
4725 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4726 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4728 # some vidix drivers are architecture and os specific, discard them elsewhere
4729 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4730 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4732 for driver in $_vidix_drivers ; do
4733 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4734 eval _vidix_drv_${driver}=yes
4735 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4736 done
4738 echocheck "VIDIX PCI device name database"
4739 echores "$_vidix_pcidb"
4740 if test "$_vidix_pcidb" = yes ; then
4741 _vidix_pcidb_val=1
4742 else
4743 _vidix_pcidb_val=0
4746 echocheck "VIDIX dhahelper support"
4747 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4748 echores "$_dhahelper"
4750 echocheck "VIDIX svgalib_helper support"
4751 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4752 echores "$_svgalib_helper"
4754 else
4755 novomodules="cvidix $novomodules"
4758 if test "$_vidix" = yes && win32; then
4759 winvidix=yes
4760 vomodules="winvidix $vomodules"
4761 libs_mplayer="$libs_mplayer -lgdi32"
4762 else
4763 novomodules="winvidix $novomodules"
4765 if test "$_vidix" = yes && test "$_x11" = yes; then
4766 xvidix=yes
4767 vomodules="xvidix $vomodules"
4768 else
4769 novomodules="xvidix $novomodules"
4772 echocheck "/dev/mga_vid"
4773 if test "$_mga" = auto ; then
4774 _mga=no
4775 test -c /dev/mga_vid && _mga=yes
4777 if test "$_mga" = yes ; then
4778 def_mga='#define CONFIG_MGA 1'
4779 vomodules="mga $vomodules"
4780 else
4781 def_mga='#undef CONFIG_MGA'
4782 novomodules="mga $novomodules"
4784 echores "$_mga"
4786 echocheck "xmga"
4787 if test "$_xmga" = auto ; then
4788 _xmga=no
4789 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4791 if test "$_xmga" = yes ; then
4792 def_xmga='#define CONFIG_XMGA 1'
4793 vomodules="xmga $vomodules"
4794 else
4795 def_xmga='#undef CONFIG_XMGA'
4796 novomodules="xmga $novomodules"
4798 echores "$_xmga"
4801 echocheck "GGI"
4802 if test "$_ggi" = auto ; then
4803 cat > $TMPC << EOF
4804 #include <ggi/ggi.h>
4805 int main(void) { ggiInit(); return 0; }
4807 _ggi=no
4808 cc_check -lggi && _ggi=yes
4810 if test "$_ggi" = yes ; then
4811 def_ggi='#define CONFIG_GGI 1'
4812 libs_mplayer="$libs_mplayer -lggi"
4813 vomodules="ggi $vomodules"
4814 else
4815 def_ggi='#undef CONFIG_GGI'
4816 novomodules="ggi $novomodules"
4818 echores "$_ggi"
4820 echocheck "GGI extension: libggiwmh"
4821 if test "$_ggiwmh" = auto ; then
4822 _ggiwmh=no
4823 cat > $TMPC << EOF
4824 #include <ggi/ggi.h>
4825 #include <ggi/wmh.h>
4826 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4828 cc_check -lggi -lggiwmh && _ggiwmh=yes
4830 # needed to get right output on obscure combination
4831 # like --disable-ggi --enable-ggiwmh
4832 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4833 def_ggiwmh='#define CONFIG_GGIWMH 1'
4834 libs_mplayer="$libs_mplayer -lggiwmh"
4835 else
4836 _ggiwmh=no
4837 def_ggiwmh='#undef CONFIG_GGIWMH'
4839 echores "$_ggiwmh"
4842 echocheck "AA"
4843 if test "$_aa" = auto ; then
4844 cat > $TMPC << EOF
4845 #include <aalib.h>
4846 extern struct aa_hardware_params aa_defparams;
4847 extern struct aa_renderparams aa_defrenderparams;
4848 int main(void) {
4849 aa_context *c;
4850 aa_renderparams *p;
4851 (void) aa_init(0, 0, 0);
4852 c = aa_autoinit(&aa_defparams);
4853 p = aa_getrenderparams();
4854 aa_autoinitkbd(c,0);
4855 return 0; }
4857 _aa=no
4858 for _ld_tmp in "-laa" ; do
4859 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4860 done
4862 if test "$_aa" = yes ; then
4863 def_aa='#define CONFIG_AA 1'
4864 if cygwin ; then
4865 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4867 vomodules="aa $vomodules"
4868 else
4869 def_aa='#undef CONFIG_AA'
4870 novomodules="aa $novomodules"
4872 echores "$_aa"
4875 echocheck "CACA"
4876 if test "$_caca" = auto ; then
4877 _caca=no
4878 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4879 cat > $TMPC << EOF
4880 #include <caca.h>
4881 #ifdef CACA_API_VERSION_1
4882 #include <caca0.h>
4883 #endif
4884 int main(void) { (void) caca_init(); return 0; }
4886 cc_check $(caca-config --libs) && _caca=yes
4889 if test "$_caca" = yes ; then
4890 def_caca='#define CONFIG_CACA 1'
4891 extra_cflags="$extra_cflags $(caca-config --cflags)"
4892 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4893 vomodules="caca $vomodules"
4894 else
4895 def_caca='#undef CONFIG_CACA'
4896 novomodules="caca $novomodules"
4898 echores "$_caca"
4901 echocheck "SVGAlib"
4902 if test "$_svga" = auto ; then
4903 cat > $TMPC << EOF
4904 #include <vga.h>
4905 int main(void) { return 0; }
4907 _svga=no
4908 cc_check -lvga $_ld_lm && _svga=yes
4910 if test "$_svga" = yes ; then
4911 def_svga='#define CONFIG_SVGALIB 1'
4912 libs_mplayer="$libs_mplayer -lvga"
4913 vomodules="svga $vomodules"
4914 else
4915 def_svga='#undef CONFIG_SVGALIB'
4916 novomodules="svga $novomodules"
4918 echores "$_svga"
4921 echocheck "FBDev"
4922 if test "$_fbdev" = auto ; then
4923 _fbdev=no
4924 linux && _fbdev=yes
4926 if test "$_fbdev" = yes ; then
4927 def_fbdev='#define CONFIG_FBDEV 1'
4928 vomodules="fbdev $vomodules"
4929 else
4930 def_fbdev='#undef CONFIG_FBDEV'
4931 novomodules="fbdev $novomodules"
4933 echores "$_fbdev"
4937 echocheck "DVB"
4938 if test "$_dvb" = auto ; then
4939 _dvb=no
4940 cat >$TMPC << EOF
4941 #include <poll.h>
4942 #include <sys/ioctl.h>
4943 #include <stdio.h>
4944 #include <time.h>
4945 #include <unistd.h>
4946 #include <linux/dvb/dmx.h>
4947 #include <linux/dvb/frontend.h>
4948 #include <linux/dvb/video.h>
4949 #include <linux/dvb/audio.h>
4950 int main(void) {return 0;}
4952 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4953 cc_check $_inc_tmp && _dvb=yes && \
4954 extra_cflags="$extra_cflags $_inc_tmp" && break
4955 done
4957 echores "$_dvb"
4958 if test "$_dvb" = yes ; then
4959 _dvbin=yes
4960 inputmodules="dvb $inputmodules"
4961 def_dvb='#define CONFIG_DVB 1'
4962 def_dvbin='#define CONFIG_DVBIN 1'
4963 aomodules="mpegpes(dvb) $aomodules"
4964 vomodules="mpegpes(dvb) $vomodules"
4965 else
4966 _dvbin=no
4967 _noinputmodules="dvb $_noinputmodules"
4968 def_dvb='#undef CONFIG_DVB'
4969 def_dvbin='#undef CONFIG_DVBIN '
4970 aomodules="mpegpes(file) $aomodules"
4971 vomodules="mpegpes(file) $vomodules"
4975 if darwin; then
4977 echocheck "QuickTime"
4978 if test "$quicktime" = auto ; then
4979 cat > $TMPC <<EOF
4980 #include <QuickTime/QuickTime.h>
4981 int main(void) {
4982 ImageDescription *desc;
4983 EnterMovies();
4984 ExitMovies();
4985 return 0;
4988 quicktime=no
4989 cc_check -framework QuickTime && quicktime=yes
4991 if test "$quicktime" = yes ; then
4992 extra_ldflags="$extra_ldflags -framework QuickTime"
4993 def_quicktime='#define CONFIG_QUICKTIME 1'
4994 else
4995 def_quicktime='#undef CONFIG_QUICKTIME'
4996 _quartz=no
4998 echores $quicktime
5000 echocheck "Quartz"
5001 if test "$_quartz" = auto ; then
5002 cat > $TMPC <<EOF
5003 #include <Carbon/Carbon.h>
5004 int main(void) {
5005 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
5006 return 0;
5009 _quartz=no
5010 cc_check -framework Carbon && _quartz=yes
5012 if test "$_quartz" = yes ; then
5013 libs_mplayer="$libs_mplayer -framework Carbon"
5014 def_quartz='#define CONFIG_QUARTZ 1'
5015 vomodules="quartz $vomodules"
5016 else
5017 def_quartz='#undef CONFIG_QUARTZ'
5018 novomodules="quartz $novomodules"
5020 echores $_quartz
5022 echocheck "CoreVideo"
5023 if test "$_corevideo" = auto ; then
5024 cat > $TMPC <<EOF
5025 #include <Carbon/Carbon.h>
5026 #include <CoreServices/CoreServices.h>
5027 #include <OpenGL/OpenGL.h>
5028 #include <QuartzCore/CoreVideo.h>
5029 int main(void) { return 0; }
5031 _corevideo=no
5032 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
5034 if test "$_corevideo" = yes ; then
5035 vomodules="corevideo $vomodules"
5036 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
5037 def_corevideo='#define CONFIG_COREVIDEO 1'
5038 else
5039 novomodules="corevideo $novomodules"
5040 def_corevideo='#undef CONFIG_COREVIDEO'
5042 echores "$_corevideo"
5044 fi #if darwin
5047 echocheck "PNG support"
5048 if test "$_png" = auto ; then
5049 _png=no
5050 if irix ; then
5051 # Don't check for -lpng on irix since it has its own libpng
5052 # incompatible with the GNU libpng
5053 res_comment="disabled on irix (not GNU libpng)"
5054 else
5055 cat > $TMPC << EOF
5056 #include <png.h>
5057 #include <string.h>
5058 int main(void) {
5059 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
5060 printf("libpng: %s\n", png_libpng_ver);
5061 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
5064 cc_check -lpng -lz $_ld_lm && _png=yes
5067 echores "$_png"
5068 if test "$_png" = yes ; then
5069 def_png='#define CONFIG_PNG 1'
5070 extra_ldflags="$extra_ldflags -lpng -lz"
5071 else
5072 def_png='#undef CONFIG_PNG'
5075 echocheck "MNG support"
5076 if test "$_mng" = auto ; then
5077 _mng=no
5078 cat > $TMPC << EOF
5079 #include <libmng.h>
5080 int main(void) {
5081 const char * p_ver = mng_version_text();
5082 return !p_ver || p_ver[0] == 0;
5085 if cc_check -lmng -lz $_ld_lm ; then
5086 _mng=yes
5089 echores "$_mng"
5090 if test "$_mng" = yes ; then
5091 def_mng='#define CONFIG_MNG 1'
5092 extra_ldflags="$extra_ldflags -lmng -lz"
5093 else
5094 def_mng='#undef CONFIG_MNG'
5097 echocheck "JPEG support"
5098 if test "$_jpeg" = auto ; then
5099 _jpeg=no
5100 cat > $TMPC << EOF
5101 #include <stdio.h>
5102 #include <stdlib.h>
5103 #include <setjmp.h>
5104 #include <string.h>
5105 #include <jpeglib.h>
5106 int main(void) { return 0; }
5108 cc_check -ljpeg $_ld_lm && _jpeg=yes
5110 echores "$_jpeg"
5112 if test "$_jpeg" = yes ; then
5113 def_jpeg='#define CONFIG_JPEG 1'
5114 vomodules="jpeg $vomodules"
5115 extra_ldflags="$extra_ldflags -ljpeg"
5116 else
5117 def_jpeg='#undef CONFIG_JPEG'
5118 novomodules="jpeg $novomodules"
5122 echocheck "OpenJPEG (JPEG2000) support"
5123 if test "$libopenjpeg" = auto ; then
5124 libopenjpeg=no
5125 cat > $TMPC << EOF
5126 #define OPJ_STATIC
5127 #include <openjpeg.h>
5128 int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
5130 cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
5132 echores "$libopenjpeg"
5133 if test "$libopenjpeg" = yes ; then
5134 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
5135 extra_ldflags="$extra_ldflags -lopenjpeg"
5136 _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
5137 _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
5138 codecmodules="OpenJPEG $codecmodules"
5139 else
5140 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
5141 nocodecmodules="OpenJPEG $nocodecmodules"
5145 echocheck "PNM support"
5146 if test "$_pnm" = yes; then
5147 def_pnm="#define CONFIG_PNM 1"
5148 vomodules="pnm $vomodules"
5149 else
5150 def_pnm="#undef CONFIG_PNM"
5151 novomodules="pnm $novomodules"
5153 echores "$_pnm"
5157 echocheck "GIF support"
5158 # This is to appease people who want to force gif support.
5159 # If it is forced to yes, then we still do checks to determine
5160 # which gif library to use.
5161 if test "$_gif" = yes ; then
5162 _force_gif=yes
5163 _gif=auto
5166 if test "$_gif" = auto ; then
5167 _gif=no
5168 cat > $TMPC << EOF
5169 #include <gif_lib.h>
5170 int main(void) { return 0; }
5172 for _ld_gif in "-lungif" "-lgif" ; do
5173 cc_check $_ld_gif && _gif=yes && break
5174 done
5177 # If no library was found, and the user wants support forced,
5178 # then we force it on with libgif, as this is the safest
5179 # assumption IMHO. (libungif & libregif both create symbolic
5180 # links to libgif. We also assume that no x11 support is needed,
5181 # because if you are forcing this, then you _should_ know what
5182 # you are doing. [ Besides, package maintainers should never
5183 # have compiled x11 deps into libungif in the first place. ] )
5184 # </rant>
5185 # --Joey
5186 if test "$_force_gif" = yes && test "$_gif" = no ; then
5187 _gif=yes
5188 _ld_gif="-lgif"
5191 if test "$_gif" = yes ; then
5192 def_gif='#define CONFIG_GIF 1'
5193 codecmodules="gif $codecmodules"
5194 vomodules="gif89a $vomodules"
5195 res_comment="old version, some encoding functions disabled"
5196 def_gif_4='#undef CONFIG_GIF_4'
5197 extra_ldflags="$extra_ldflags $_ld_gif"
5199 cat > $TMPC << EOF
5200 #include <signal.h>
5201 #include <gif_lib.h>
5202 void catch() { exit(1); }
5203 int main(void) {
5204 signal(SIGSEGV, catch); // catch segfault
5205 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5206 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5207 return 0;
5210 if cc_check "$_ld_gif" ; then
5211 def_gif_4='#define CONFIG_GIF_4 1'
5212 res_comment=""
5214 else
5215 def_gif='#undef CONFIG_GIF'
5216 def_gif_4='#undef CONFIG_GIF_4'
5217 novomodules="gif89a $novomodules"
5218 nocodecmodules="gif $nocodecmodules"
5220 echores "$_gif"
5223 case "$_gif" in yes*)
5224 echocheck "broken giflib workaround"
5225 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5227 cat > $TMPC << EOF
5228 #include <gif_lib.h>
5229 int main(void) {
5230 GifFileType gif;
5231 printf("UserData is at address %p\n", gif.UserData);
5232 return 0;
5235 if cc_check "$_ld_gif" ; then
5236 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5237 echores "disabled"
5238 else
5239 echores "enabled"
5242 esac
5245 echocheck "VESA support"
5246 if test "$_vesa" = auto ; then
5247 cat > $TMPC << EOF
5248 #include <vbe.h>
5249 int main(void) { vbeVersion(); return 0; }
5251 _vesa=no
5252 cc_check -lvbe -llrmi && _vesa=yes
5254 if test "$_vesa" = yes ; then
5255 def_vesa='#define CONFIG_VESA 1'
5256 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5257 vomodules="vesa $vomodules"
5258 else
5259 def_vesa='#undef CONFIG_VESA'
5260 novomodules="vesa $novomodules"
5262 echores "$_vesa"
5264 #################
5265 # VIDEO + AUDIO #
5266 #################
5269 echocheck "SDL"
5270 _inc_tmp=""
5271 _ld_tmp=""
5272 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5273 if test -z "$_sdlconfig" ; then
5274 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5275 _sdlconfig="sdl-config"
5276 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5277 _sdlconfig="sdl11-config"
5278 else
5279 _sdlconfig=false
5282 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5283 cat > $TMPC << EOF
5284 #ifdef CONFIG_SDL_SDL_H
5285 #include <SDL/SDL.h>
5286 #else
5287 #include <SDL.h>
5288 #endif
5289 #ifndef __APPLE__
5290 // we allow SDL hacking our main() only on OSX
5291 #undef main
5292 #endif
5293 int main(int argc, char *argv[]) {
5294 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5295 return 0;
5298 _sdl=no
5299 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
5300 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5301 _sdl=yes
5302 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5303 break
5305 done
5306 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5307 res_comment="using $_sdlconfig"
5308 if cygwin ; then
5309 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5310 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5311 elif mingw32 ; then
5312 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5313 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5314 else
5315 _inc_tmp="$($_sdlconfig --cflags)"
5316 _ld_tmp="$($_sdlconfig --libs)"
5318 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5319 _sdl=yes
5323 if test "$_sdl" = yes ; then
5324 def_sdl='#define CONFIG_SDL 1'
5325 extra_cflags="$extra_cflags $_inc_tmp"
5326 libs_mplayer="$libs_mplayer $_ld_tmp"
5327 vomodules="sdl $vomodules"
5328 aomodules="sdl $aomodules"
5329 else
5330 def_sdl='#undef CONFIG_SDL'
5331 novomodules="sdl $novomodules"
5332 noaomodules="sdl $noaomodules"
5334 echores "$_sdl"
5337 # make sure this stays below CoreVideo to avoid issues due to namespace
5338 # conflicts between -lGL and -framework OpenGL
5339 echocheck "OpenGL"
5340 #Note: this test is run even with --enable-gl since we autodetect linker flags
5341 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
5342 cat > $TMPC << EOF
5343 #ifdef GL_WIN32
5344 #include <windows.h>
5345 #include <GL/gl.h>
5346 #elif defined(GL_SDL)
5347 #include <GL/gl.h>
5348 #ifdef CONFIG_SDL_SDL_H
5349 #include <SDL/SDL.h>
5350 #else
5351 #include <SDL.h>
5352 #endif
5353 #ifndef __APPLE__
5354 // we allow SDL hacking our main() only on OSX
5355 #undef main
5356 #endif
5357 #else
5358 #include <GL/gl.h>
5359 #include <X11/Xlib.h>
5360 #include <GL/glx.h>
5361 #endif
5362 int main(void) {
5363 #ifdef GL_WIN32
5364 HDC dc;
5365 wglCreateContext(dc);
5366 #elif defined(GL_SDL)
5367 SDL_GL_SwapBuffers();
5368 #else
5369 glXCreateContext(NULL, NULL, NULL, True);
5370 #endif
5371 glFinish();
5372 return 0;
5375 _gl=no
5376 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
5377 if cc_check $_ld_tmp $_ld_lm ; then
5378 _gl=yes
5379 _gl_x11=yes
5380 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
5381 break
5383 done
5384 if cc_check -DGL_WIN32 -lopengl32 ; then
5385 _gl=yes
5386 _gl_win32=yes
5387 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
5389 # last so it can reuse any linker etc. flags detected before
5390 if test "$_sdl" = yes ; then
5391 if cc_check -DGL_SDL ||
5392 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
5393 _gl=yes
5394 _gl_sdl=yes
5395 elif cc_check -DGL_SDL -lGL ||
5396 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
5397 _gl=yes
5398 _gl_sdl=yes
5399 libs_mplayer="$libs_mplayer -lGL"
5402 else
5403 _gl=no
5405 if test "$_gl" = yes ; then
5406 def_gl='#define CONFIG_GL 1'
5407 res_comment="backends:"
5408 if test "$_gl_win32" = yes ; then
5409 def_gl_win32='#define CONFIG_GL_WIN32 1'
5410 res_comment="$res_comment win32"
5412 if test "$_gl_x11" = yes ; then
5413 def_gl_x11='#define CONFIG_GL_X11 1'
5414 res_comment="$res_comment x11"
5416 if test "$_gl_sdl" = yes ; then
5417 def_gl_sdl='#define CONFIG_GL_SDL 1'
5418 res_comment="$res_comment sdl"
5420 vomodules="opengl $vomodules"
5421 else
5422 def_gl='#undef CONFIG_GL'
5423 def_gl_win32='#undef CONFIG_GL_WIN32'
5424 def_gl_x11='#undef CONFIG_GL_X11'
5425 def_gl_sdl='#undef CONFIG_GL_SDL'
5426 novomodules="opengl $novomodules"
5428 echores "$_gl"
5431 echocheck "MatrixView"
5432 if test "$_gl" = no ; then
5433 matrixview=no
5435 if test "$matrixview" = yes ; then
5436 vomodules="matrixview $vomodules"
5437 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5438 else
5439 novomodules="matrixview $novomodules"
5440 def_matrixview='#undef CONFIG_MATRIXVIEW'
5442 echores "$matrixview"
5445 if os2 ; then
5446 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5447 if test "$_kva" = auto; then
5448 cat > $TMPC << EOF
5449 #include <os2.h>
5450 #include <kva.h>
5451 int main( void ) { return 0; }
5453 _kva=no;
5454 cc_check -lkva && _kva=yes
5456 if test "$_kva" = yes ; then
5457 def_kva='#define CONFIG_KVA 1'
5458 libs_mplayer="$libs_mplayer -lkva"
5459 vomodules="kva $vomodules"
5460 else
5461 def_kva='#undef CONFIG_KVA'
5462 novomodules="kva $novomodules"
5464 echores "$_kva"
5465 fi #if os2
5468 if win32; then
5470 echocheck "Windows waveout"
5471 if test "$_win32waveout" = auto ; then
5472 cat > $TMPC << EOF
5473 #include <windows.h>
5474 #include <mmsystem.h>
5475 int main(void) { return 0; }
5477 _win32waveout=no
5478 cc_check -lwinmm && _win32waveout=yes
5480 if test "$_win32waveout" = yes ; then
5481 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5482 libs_mplayer="$libs_mplayer -lwinmm"
5483 aomodules="win32 $aomodules"
5484 else
5485 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5486 noaomodules="win32 $noaomodules"
5488 echores "$_win32waveout"
5490 echocheck "Direct3D"
5491 if test "$_direct3d" = auto ; then
5492 cat > $TMPC << EOF
5493 #include <windows.h>
5494 #include <d3d9.h>
5495 int main(void) { return 0; }
5497 _direct3d=no
5498 cc_check && _direct3d=yes
5500 if test "$_direct3d" = yes ; then
5501 def_direct3d='#define CONFIG_DIRECT3D 1'
5502 vomodules="direct3d $vomodules"
5503 else
5504 def_direct3d='#undef CONFIG_DIRECT3D'
5505 novomodules="direct3d $novomodules"
5507 echores "$_direct3d"
5509 echocheck "Directx"
5510 if test "$_directx" = auto ; then
5511 cat > $TMPC << EOF
5512 #include <windows.h>
5513 #include <ddraw.h>
5514 #include <dsound.h>
5515 int main(void) { return 0; }
5517 _directx=no
5518 cc_check -lgdi32 && _directx=yes
5520 if test "$_directx" = yes ; then
5521 def_directx='#define CONFIG_DIRECTX 1'
5522 libs_mplayer="$libs_mplayer -lgdi32"
5523 vomodules="directx $vomodules"
5524 aomodules="dsound $aomodules"
5525 else
5526 def_directx='#undef CONFIG_DIRECTX'
5527 novomodules="directx $novomodules"
5528 noaomodules="dsound $noaomodules"
5530 echores "$_directx"
5532 fi #if win32; then
5535 echocheck "DXR2"
5536 if test "$_dxr2" = auto; then
5537 _dxr2=no
5538 cat > $TMPC << EOF
5539 #include <dxr2ioctl.h>
5540 int main(void) { return 0; }
5542 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5543 cc_check $_inc_tmp && _dxr2=yes && \
5544 extra_cflags="$extra_cflags $_inc_tmp" && break
5545 done
5547 if test "$_dxr2" = yes; then
5548 def_dxr2='#define CONFIG_DXR2 1'
5549 aomodules="dxr2 $aomodules"
5550 vomodules="dxr2 $vomodules"
5551 else
5552 def_dxr2='#undef CONFIG_DXR2'
5553 noaomodules="dxr2 $noaomodules"
5554 novomodules="dxr2 $novomodules"
5556 echores "$_dxr2"
5558 echocheck "DXR3/H+"
5559 if test "$_dxr3" = auto ; then
5560 cat > $TMPC << EOF
5561 #include <linux/em8300.h>
5562 int main(void) { return 0; }
5564 _dxr3=no
5565 cc_check && _dxr3=yes
5567 if test "$_dxr3" = yes ; then
5568 def_dxr3='#define CONFIG_DXR3 1'
5569 vomodules="dxr3 $vomodules"
5570 else
5571 def_dxr3='#undef CONFIG_DXR3'
5572 novomodules="dxr3 $novomodules"
5574 echores "$_dxr3"
5577 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5578 if test "$_ivtv" = auto ; then
5579 cat > $TMPC << EOF
5580 #include <stdlib.h>
5581 #include <inttypes.h>
5582 #include <linux/types.h>
5583 #include <linux/videodev2.h>
5584 #include <linux/ivtv.h>
5585 #include <sys/ioctl.h>
5586 int main(void) {
5587 struct ivtv_cfg_stop_decode sd;
5588 struct ivtv_cfg_start_decode sd1;
5589 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5590 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5591 return 0; }
5593 _ivtv=no
5594 cc_check && _ivtv=yes
5596 if test "$_ivtv" = yes ; then
5597 def_ivtv='#define CONFIG_IVTV 1'
5598 vomodules="ivtv $vomodules"
5599 aomodules="ivtv $aomodules"
5600 else
5601 def_ivtv='#undef CONFIG_IVTV'
5602 novomodules="ivtv $novomodules"
5603 noaomodules="ivtv $noaomodules"
5605 echores "$_ivtv"
5608 echocheck "V4L2 MPEG Decoder"
5609 if test "$_v4l2" = auto ; then
5610 cat > $TMPC << EOF
5611 #include <stdlib.h>
5612 #include <inttypes.h>
5613 #include <linux/types.h>
5614 #include <linux/videodev2.h>
5615 #include <linux/version.h>
5616 int main(void) {
5617 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5618 #error kernel headers too old, need 2.6.22
5619 #endif
5620 struct v4l2_ext_controls ctrls;
5621 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5622 return 0;
5625 _v4l2=no
5626 cc_check && _v4l2=yes
5628 if test "$_v4l2" = yes ; then
5629 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5630 vomodules="v4l2 $vomodules"
5631 aomodules="v4l2 $aomodules"
5632 else
5633 def_v4l2='#undef CONFIG_V4L2_DECODER'
5634 novomodules="v4l2 $novomodules"
5635 noaomodules="v4l2 $noaomodules"
5637 echores "$_v4l2"
5641 #########
5642 # AUDIO #
5643 #########
5646 echocheck "OSS Audio"
5647 if test "$_ossaudio" = auto ; then
5648 cat > $TMPC << EOF
5649 #include <sys/ioctl.h>
5650 #include <$_soundcard_header>
5651 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5653 _ossaudio=no
5654 cc_check && _ossaudio=yes
5656 if test "$_ossaudio" = yes ; then
5657 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5658 aomodules="oss $aomodules"
5659 if test "$_linux_devfs" = yes; then
5660 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5661 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5662 else
5663 cat > $TMPC << EOF
5664 #include <sys/ioctl.h>
5665 #include <$_soundcard_header>
5666 #ifdef OPEN_SOUND_SYSTEM
5667 int main(void) { return 0; }
5668 #else
5669 #error Not the real thing
5670 #endif
5672 _real_ossaudio=no
5673 cc_check && _real_ossaudio=yes
5674 if test "$_real_ossaudio" = yes; then
5675 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5676 elif netbsd || openbsd ; then
5677 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5678 extra_ldflags="$extra_ldflags -lossaudio"
5679 else
5680 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5682 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5684 else
5685 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5686 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5687 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5688 noaomodules="oss $noaomodules"
5690 echores "$_ossaudio"
5693 echocheck "aRts"
5694 if test "$_arts" = auto ; then
5695 _arts=no
5696 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5698 cat > $TMPC << EOF
5699 #include <artsc.h>
5700 int main(void) { return 0; }
5702 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5707 if test "$_arts" = yes ; then
5708 def_arts='#define CONFIG_ARTS 1'
5709 aomodules="arts $aomodules"
5710 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5711 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5712 else
5713 noaomodules="arts $noaomodules"
5715 echores "$_arts"
5718 echocheck "EsounD"
5719 if test "$_esd" = auto ; then
5720 _esd=no
5721 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5723 cat > $TMPC << EOF
5724 #include <esd.h>
5725 int main(void) { int fd = esd_open_sound("test"); return fd; }
5727 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5731 echores "$_esd"
5733 if test "$_esd" = yes ; then
5734 def_esd='#define CONFIG_ESD 1'
5735 aomodules="esd $aomodules"
5736 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5737 extra_cflags="$extra_cflags $(esd-config --cflags)"
5739 echocheck "esd_get_latency()"
5740 cat > $TMPC << EOF
5741 #include <esd.h>
5742 int main(void) { return esd_get_latency(0); }
5744 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5745 echores "$_esd_latency"
5746 else
5747 def_esd='#undef CONFIG_ESD'
5748 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5749 noaomodules="esd $noaomodules"
5753 echocheck "NAS"
5754 if test "$_nas" = auto ; then
5755 cat > $TMPC << EOF
5756 #include <audio/audiolib.h>
5757 int main(void) { return 0; }
5759 _nas=no
5760 cc_check $_ld_lm -laudio -lXt && _nas=yes
5762 if test "$_nas" = yes ; then
5763 def_nas='#define CONFIG_NAS 1'
5764 libs_mplayer="$libs_mplayer -laudio -lXt"
5765 aomodules="nas $aomodules"
5766 else
5767 noaomodules="nas $noaomodules"
5768 def_nas='#undef CONFIG_NAS'
5770 echores "$_nas"
5773 echocheck "pulse"
5774 if test "$_pulse" = auto ; then
5775 _pulse=no
5776 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5778 cat > $TMPC << EOF
5779 #include <pulse/pulseaudio.h>
5780 int main(void) { return 0; }
5782 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5786 echores "$_pulse"
5788 if test "$_pulse" = yes ; then
5789 def_pulse='#define CONFIG_PULSE 1'
5790 aomodules="pulse $aomodules"
5791 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5792 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5793 else
5794 def_pulse='#undef CONFIG_PULSE'
5795 noaomodules="pulse $noaomodules"
5799 echocheck "JACK"
5800 if test "$_jack" = auto ; then
5801 _jack=yes
5803 cat > $TMPC << EOF
5804 #include <jack/jack.h>
5805 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5807 if cc_check -ljack ; then
5808 libs_mplayer="$libs_mplayer -ljack"
5809 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5810 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5811 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5812 else
5813 _jack=no
5817 if test "$_jack" = yes ; then
5818 def_jack='#define CONFIG_JACK 1'
5819 aomodules="jack $aomodules"
5820 else
5821 noaomodules="jack $noaomodules"
5823 echores "$_jack"
5825 echocheck "OpenAL"
5826 if test "$_openal" = auto ; then
5827 _openal=no
5828 cat > $TMPC << EOF
5829 #ifdef OPENAL_AL_H
5830 #include <OpenAL/al.h>
5831 #else
5832 #include <AL/al.h>
5833 #endif
5834 int main(void) {
5835 alSourceQueueBuffers(0, 0, 0);
5836 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5837 return 0;
5840 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5841 cc_check $I && _openal=yes && break
5842 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5843 done
5844 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5846 if test "$_openal" = yes ; then
5847 def_openal='#define CONFIG_OPENAL 1'
5848 aomodules="openal $aomodules"
5849 else
5850 noaomodules="openal $noaomodules"
5852 echores "$_openal"
5854 echocheck "ALSA audio"
5855 if test "$_alloca" != yes ; then
5856 _alsa=no
5857 res_comment="alloca missing"
5859 if test "$_alsa" != no ; then
5860 _alsa=no
5861 cat > $TMPC << EOF
5862 #include <sys/time.h>
5863 #include <sys/asoundlib.h>
5864 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5865 #error "alsa version != 0.5.x"
5866 #endif
5867 int main(void) { return 0; }
5869 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5871 cat > $TMPC << EOF
5872 #include <sys/time.h>
5873 #include <sys/asoundlib.h>
5874 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5875 #error "alsa version != 0.9.x"
5876 #endif
5877 int main(void) { return 0; }
5879 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5880 cat > $TMPC << EOF
5881 #include <sys/time.h>
5882 #include <alsa/asoundlib.h>
5883 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5884 #error "alsa version != 0.9.x"
5885 #endif
5886 int main(void) { return 0; }
5888 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5890 cat > $TMPC << EOF
5891 #include <sys/time.h>
5892 #include <sys/asoundlib.h>
5893 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5894 #error "alsa version != 1.0.x"
5895 #endif
5896 int main(void) { return 0; }
5898 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5899 cat > $TMPC << EOF
5900 #include <sys/time.h>
5901 #include <alsa/asoundlib.h>
5902 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5903 #error "alsa version != 1.0.x"
5904 #endif
5905 int main(void) { return 0; }
5907 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5909 def_alsa='#undef CONFIG_ALSA'
5910 def_alsa5='#undef CONFIG_ALSA5'
5911 def_alsa9='#undef CONFIG_ALSA9'
5912 def_alsa1x='#undef CONFIG_ALSA1X'
5913 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5914 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5915 if test "$_alsaver" ; then
5916 _alsa=yes
5917 if test "$_alsaver" = '0.5.x' ; then
5918 _alsa5=yes
5919 aomodules="alsa5 $aomodules"
5920 def_alsa5='#define CONFIG_ALSA5 1'
5921 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5922 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5923 elif test "$_alsaver" = '0.9.x-sys' ; then
5924 _alsa9=yes
5925 aomodules="alsa $aomodules"
5926 def_alsa='#define CONFIG_ALSA 1'
5927 def_alsa9='#define CONFIG_ALSA9 1'
5928 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5929 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5930 elif test "$_alsaver" = '0.9.x-alsa' ; then
5931 _alsa9=yes
5932 aomodules="alsa $aomodules"
5933 def_alsa='#define CONFIG_ALSA 1'
5934 def_alsa9='#define CONFIG_ALSA9 1'
5935 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5936 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5937 elif test "$_alsaver" = '1.0.x-sys' ; then
5938 _alsa1x=yes
5939 aomodules="alsa $aomodules"
5940 def_alsa='#define CONFIG_ALSA 1'
5941 def_alsa1x="#define CONFIG_ALSA1X 1"
5942 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5943 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5944 elif test "$_alsaver" = '1.0.x-alsa' ; then
5945 _alsa1x=yes
5946 aomodules="alsa $aomodules"
5947 def_alsa='#define CONFIG_ALSA 1'
5948 def_alsa1x="#define CONFIG_ALSA1X 1"
5949 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5950 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5951 else
5952 _alsa=no
5953 res_comment="unknown version"
5955 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5956 else
5957 noaomodules="alsa $noaomodules"
5959 echores "$_alsa"
5962 echocheck "Sun audio"
5963 if test "$_sunaudio" = auto ; then
5964 cat > $TMPC << EOF
5965 #include <sys/types.h>
5966 #include <sys/audioio.h>
5967 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5969 _sunaudio=no
5970 cc_check && _sunaudio=yes
5972 if test "$_sunaudio" = yes ; then
5973 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5974 aomodules="sun $aomodules"
5975 else
5976 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5977 noaomodules="sun $noaomodules"
5979 echores "$_sunaudio"
5982 def_mlib='#define CONFIG_MLIB 0'
5983 if sunos; then
5984 echocheck "Sun mediaLib"
5985 if test "$_mlib" = auto ; then
5986 _mlib=no
5987 cat > $TMPC << EOF
5988 #include <mlib.h>
5989 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5991 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5993 echores "$_mlib"
5994 fi #if sunos
5997 if darwin; then
5998 echocheck "CoreAudio"
5999 if test "$_coreaudio" = auto ; then
6000 cat > $TMPC <<EOF
6001 #include <CoreAudio/CoreAudio.h>
6002 #include <AudioToolbox/AudioToolbox.h>
6003 #include <AudioUnit/AudioUnit.h>
6004 int main(void) { return 0; }
6006 _coreaudio=no
6007 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
6009 if test "$_coreaudio" = yes ; then
6010 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
6011 def_coreaudio='#define CONFIG_COREAUDIO 1'
6012 aomodules="coreaudio $aomodules"
6013 else
6014 def_coreaudio='#undef CONFIG_COREAUDIO'
6015 noaomodules="coreaudio $noaomodules"
6017 echores $_coreaudio
6018 fi #if darwin
6021 if irix; then
6022 echocheck "SGI audio"
6023 if test "$_sgiaudio" = auto ; then
6024 # check for SGI audio
6025 cat > $TMPC << EOF
6026 #include <dmedia/audio.h>
6027 int main(void) { return 0; }
6029 _sgiaudio=no
6030 cc_check && _sgiaudio=yes
6032 if test "$_sgiaudio" = "yes" ; then
6033 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
6034 libs_mplayer="$libs_mplayer -laudio"
6035 aomodules="sgi $aomodules"
6036 else
6037 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
6038 noaomodules="sgi $noaomodules"
6040 echores "$_sgiaudio"
6041 fi #if irix
6044 if os2 ; then
6045 echocheck "KAI (UNIAUD/DART)"
6046 if test "$_kai" = auto; then
6047 cat > $TMPC << EOF
6048 #include <os2.h>
6049 #include <kai.h>
6050 int main(void) { return 0; }
6052 _kai=no;
6053 cc_check -lkai && _kai=yes
6055 if test "$_kai" = yes ; then
6056 def_kai='#define CONFIG_KAI 1'
6057 libs_mplayer="$libs_mplayer -lkai"
6058 aomodules="kai $aomodules"
6059 else
6060 def_kai='#undef CONFIG_KAI'
6061 noaomodules="kai $noaomodules"
6063 echores "$_kai"
6065 echocheck "DART"
6066 if test "$_dart" = auto; then
6067 cat > $TMPC << EOF
6068 #include <os2.h>
6069 #include <dart.h>
6070 int main( void ) { return 0; }
6072 _dart=no;
6073 cc_check -ldart && _dart=yes
6075 if test "$_dart" = yes ; then
6076 def_dart='#define CONFIG_DART 1'
6077 libs_mplayer="$libs_mplayer -ldart"
6078 aomodules="dart $aomodules"
6079 else
6080 def_dart='#undef CONFIG_DART'
6081 noaomodules="dart $noaomodules"
6083 echores "$_dart"
6084 fi #if os2
6087 # set default CD/DVD devices
6088 if win32 || os2 ; then
6089 default_cdrom_device="D:"
6090 elif darwin ; then
6091 default_cdrom_device="/dev/disk1"
6092 elif dragonfly ; then
6093 default_cdrom_device="/dev/cd0"
6094 elif freebsd ; then
6095 default_cdrom_device="/dev/acd0"
6096 elif openbsd ; then
6097 default_cdrom_device="/dev/rcd0a"
6098 elif sunos ; then
6099 default_cdrom_device="/vol/dev/aliases/cdrom0"
6100 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
6101 # file system and the volfs service.
6102 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
6103 elif amigaos ; then
6104 default_cdrom_device="a1ide.device:2"
6105 else
6106 default_cdrom_device="/dev/cdrom"
6109 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
6110 default_dvd_device=$default_cdrom_device
6111 elif darwin ; then
6112 default_dvd_device="/dev/rdiskN"
6113 else
6114 default_dvd_device="/dev/dvd"
6118 echocheck "VCD support"
6119 if test "$_vcd" = auto; then
6120 _vcd=no
6121 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
6122 _vcd=yes
6123 elif mingw32; then
6124 cat > $TMPC << EOF
6125 #include <ddk/ntddcdrm.h>
6126 int main(void) { return 0; }
6128 cc_check && _vcd=yes
6131 if test "$_vcd" = yes; then
6132 inputmodules="vcd $inputmodules"
6133 def_vcd='#define CONFIG_VCD 1'
6134 else
6135 def_vcd='#undef CONFIG_VCD'
6136 _noinputmodules="vcd $_noinputmodules"
6137 res_comment="not supported on this OS"
6139 echores "$_vcd"
6143 echocheck "dvdread"
6144 if test "$_dvdread_internal" = auto ; then
6145 _dvdread_internal=no
6146 _dvdread=no
6147 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
6148 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
6149 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
6150 || darwin || win32 || os2; then
6151 _dvdread_internal=yes
6152 _dvdread=yes
6153 extra_cflags="-Ilibdvdread4 $extra_cflags"
6155 elif test "$_dvdread" = auto ; then
6156 _dvdread=no
6157 if test "$_dl" = yes; then
6158 cat > $TMPC << EOF
6159 #include <inttypes.h>
6160 #include <dvdread/dvd_reader.h>
6161 #include <dvdread/ifo_types.h>
6162 #include <dvdread/ifo_read.h>
6163 #include <dvdread/nav_read.h>
6164 int main(void) { return 0; }
6166 _dvdreadcflags=$($_dvdreadconfig --cflags)
6167 _dvdreadlibs=$($_dvdreadconfig --libs)
6168 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
6169 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
6170 _dvdread=yes
6171 extra_cflags="$extra_cflags $_dvdreadcflags"
6172 extra_ldflags="$extra_ldflags $_dvdreadlibs"
6173 res_comment="external"
6178 if test "$_dvdread_internal" = yes; then
6179 def_dvdread='#define CONFIG_DVDREAD 1'
6180 inputmodules="dvdread(internal) $inputmodules"
6181 _largefiles=yes
6182 res_comment="internal"
6183 elif test "$_dvdread" = yes; then
6184 def_dvdread='#define CONFIG_DVDREAD 1'
6185 _largefiles=yes
6186 extra_ldflags="$extra_ldflags -ldvdread"
6187 inputmodules="dvdread(external) $inputmodules"
6188 res_comment="external"
6189 else
6190 def_dvdread='#undef CONFIG_DVDREAD'
6191 _noinputmodules="dvdread $_noinputmodules"
6193 echores "$_dvdread"
6196 echocheck "internal libdvdcss"
6197 if test "$_libdvdcss_internal" = auto ; then
6198 _libdvdcss_internal=no
6199 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
6200 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
6202 if test "$_libdvdcss_internal" = yes ; then
6203 if linux || netbsd || openbsd || bsdos ; then
6204 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
6205 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
6206 elif freebsd || dragonfly ; then
6207 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
6208 elif darwin ; then
6209 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
6210 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
6211 elif cygwin ; then
6212 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
6213 elif beos ; then
6214 cflags_libdvdcss="-DSYS_BEOS"
6215 elif os2 ; then
6216 cflags_libdvdcss="-DSYS_OS2"
6218 cflags_libdvdcss_dvdread="-Ilibdvdcss"
6219 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
6220 inputmodules="libdvdcss(internal) $inputmodules"
6221 _largefiles=yes
6222 else
6223 _noinputmodules="libdvdcss(internal) $_noinputmodules"
6225 echores "$_libdvdcss_internal"
6228 echocheck "cdparanoia"
6229 if test "$_cdparanoia" = auto ; then
6230 cat > $TMPC <<EOF
6231 #include <cdda_interface.h>
6232 #include <cdda_paranoia.h>
6233 // This need a better test. How ?
6234 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
6236 _cdparanoia=no
6237 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
6238 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
6239 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
6240 done
6242 if test "$_cdparanoia" = yes ; then
6243 _cdda='yes'
6244 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
6245 openbsd && extra_ldflags="$extra_ldflags -lutil"
6247 echores "$_cdparanoia"
6250 echocheck "libcdio"
6251 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
6252 cat > $TMPC << EOF
6253 #include <stdio.h>
6254 #include <cdio/version.h>
6255 #include <cdio/cdda.h>
6256 #include <cdio/paranoia.h>
6257 int main(void) {
6258 void *test = cdda_verbose_set;
6259 printf("%s\n", CDIO_VERSION);
6260 return test == (void *)1;
6263 _libcdio=no
6264 for _ld_tmp in "" "-lwinmm" ; do
6265 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6266 cc_check $_ld_tmp $_ld_lm \
6267 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6268 done
6269 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6270 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6271 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6272 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6273 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6276 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6277 _cdda='yes'
6278 def_libcdio='#define CONFIG_LIBCDIO 1'
6279 def_havelibcdio='yes'
6280 else
6281 if test "$_cdparanoia" = yes ; then
6282 res_comment="using cdparanoia"
6284 def_libcdio='#undef CONFIG_LIBCDIO'
6285 def_havelibcdio='no'
6287 echores "$_libcdio"
6289 if test "$_cdda" = yes ; then
6290 test $_cddb = auto && test $_network = yes && _cddb=yes
6291 def_cdparanoia='#define CONFIG_CDDA 1'
6292 inputmodules="cdda $inputmodules"
6293 else
6294 def_cdparanoia='#undef CONFIG_CDDA'
6295 _noinputmodules="cdda $_noinputmodules"
6298 if test "$_cddb" = yes ; then
6299 def_cddb='#define CONFIG_CDDB 1'
6300 inputmodules="cddb $inputmodules"
6301 else
6302 _cddb=no
6303 def_cddb='#undef CONFIG_CDDB'
6304 _noinputmodules="cddb $_noinputmodules"
6307 echocheck "bitmap font support"
6308 if test "$_bitmap_font" = yes ; then
6309 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6310 else
6311 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6313 echores "$_bitmap_font"
6316 echocheck "freetype >= 2.0.9"
6318 # freetype depends on iconv
6319 if test "$_iconv" = no ; then
6320 _freetype=no
6321 res_comment="iconv support needed"
6324 if test "$_freetype" = auto ; then
6325 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6326 cat > $TMPC << EOF
6327 #include <stdio.h>
6328 #include <ft2build.h>
6329 #include FT_FREETYPE_H
6330 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6331 #error "Need FreeType 2.0.9 or newer"
6332 #endif
6333 int main(void) {
6334 FT_Library library;
6335 FT_Int major=-1,minor=-1,patch=-1;
6336 int err=FT_Init_FreeType(&library);
6337 return 0;
6340 _freetype=no
6341 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6342 else
6343 _freetype=no
6346 if test "$_freetype" = yes ; then
6347 def_freetype='#define CONFIG_FREETYPE 1'
6348 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6349 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6350 else
6351 def_freetype='#undef CONFIG_FREETYPE'
6353 echores "$_freetype"
6355 if test "$_freetype" = no ; then
6356 _fontconfig=no
6357 res_comment="FreeType support needed"
6359 echocheck "fontconfig"
6360 if test "$_fontconfig" = auto ; then
6361 cat > $TMPC << EOF
6362 #include <stdio.h>
6363 #include <stdlib.h>
6364 #include <fontconfig/fontconfig.h>
6365 #if FC_VERSION < 20402
6366 #error At least version 2.4.2 of fontconfig required
6367 #endif
6368 int main(void) {
6369 int err = FcInit();
6370 if (err == FcFalse) {
6371 printf("Couldn't initialize fontconfig lib\n");
6372 exit(err);
6374 return 0;
6377 _fontconfig=no
6378 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6379 _ld_tmp="-lfontconfig $_ld_tmp"
6380 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6381 done
6382 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6383 _inc_tmp=$($_pkg_config --cflags fontconfig)
6384 _ld_tmp=$($_pkg_config --libs fontconfig)
6385 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6386 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6389 if test "$_fontconfig" = yes ; then
6390 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6391 else
6392 def_fontconfig='#undef CONFIG_FONTCONFIG'
6394 echores "$_fontconfig"
6397 echocheck "SSA/ASS support"
6398 # libass depends on FreeType
6399 if test "$_freetype" = no ; then
6400 _ass=no
6401 ass_internal=no
6402 res_comment="FreeType support needed"
6405 if test "$_ass" = auto ; then
6406 cat > $TMPC << EOF
6407 #include <ft2build.h>
6408 #include FT_FREETYPE_H
6409 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
6410 #error "Need FreeType 2.2.1 or newer"
6411 #endif
6412 int main(void) { return 0; }
6414 _ass=no
6415 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
6416 if test "$_ass" = no ; then
6417 ass_internal=no
6418 res_comment="FreeType >= 2.2.1 needed"
6419 elif test "$ass_internal" = no ; then
6420 res_comment="external"
6421 extra_ldflags="$extra_ldflags -lass"
6424 if test "$_ass" = yes ; then
6425 def_ass='#define CONFIG_ASS 1'
6426 else
6427 def_ass='#undef CONFIG_ASS'
6429 if test "$ass_internal" = yes ; then
6430 def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
6431 else
6432 def_ass_internal='#undef CONFIG_ASS_INTERNAL'
6434 echores "$_ass"
6437 echocheck "fribidi with charsets"
6438 _inc_tmp=""
6439 _ld_tmp=""
6440 if test "$_fribidi" = auto ; then
6441 cat > $TMPC << EOF
6442 #include <stdio.h>
6443 #include <stdlib.h>
6444 /* workaround for fribidi 0.10.4 and below */
6445 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6446 #include <fribidi/fribidi.h>
6447 int main(void) {
6448 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6449 printf("Fribidi headers are not consistents with the library!\n");
6450 exit(1);
6452 return 0;
6455 _fribidi=no
6456 _inc_tmp=""
6457 _ld_tmp="-lfribidi"
6458 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6459 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
6460 test "$_fribidi" = no ; then
6461 _inc_tmp="$($_pkg_config --cflags)"
6462 _ld_tmp="$($_pkg_config --libs)"
6463 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6466 if test "$_fribidi" = yes ; then
6467 def_fribidi='#define CONFIG_FRIBIDI 1'
6468 extra_cflags="$extra_cflags $_inc_tmp"
6469 extra_ldflags="$extra_ldflags $_ld_tmp"
6470 else
6471 def_fribidi='#undef CONFIG_FRIBIDI'
6473 echores "$_fribidi"
6476 echocheck "ENCA"
6477 if test "$_enca" = auto ; then
6478 cat > $TMPC << EOF
6479 #include <sys/types.h>
6480 #include <enca.h>
6481 int main(void) {
6482 const char **langs;
6483 size_t langcnt;
6484 langs = enca_get_languages(&langcnt);
6485 return 0;
6488 _enca=no
6489 cc_check -lenca $_ld_lm && _enca=yes
6491 if test "$_enca" = yes ; then
6492 def_enca='#define CONFIG_ENCA 1'
6493 extra_ldflags="$extra_ldflags -lenca"
6494 else
6495 def_enca='#undef CONFIG_ENCA'
6497 echores "$_enca"
6500 echocheck "zlib"
6501 cat > $TMPC << EOF
6502 #include <zlib.h>
6503 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6505 _zlib=no
6506 cc_check -lz && _zlib=yes
6507 if test "$_zlib" = yes ; then
6508 def_zlib='#define CONFIG_ZLIB 1'
6509 extra_ldflags="$extra_ldflags -lz"
6510 else
6511 def_zlib='#define CONFIG_ZLIB 0'
6512 _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//)
6513 _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
6515 echores "$_zlib"
6518 echocheck "bzlib"
6519 bzlib=no
6520 def_bzlib='#define CONFIG_BZLIB 0'
6521 cat > $TMPC << EOF
6522 #include <bzlib.h>
6523 int main(void) { BZ2_bzlibVersion(); return 0; }
6525 cc_check -lbz2 && bzlib=yes
6526 if test "$bzlib" = yes ; then
6527 def_bzlib='#define CONFIG_BZLIB 1'
6528 extra_ldflags="$extra_ldflags -lbz2"
6530 echores "$bzlib"
6533 echocheck "RTC"
6534 if test "$_rtc" = auto ; then
6535 cat > $TMPC << EOF
6536 #include <sys/ioctl.h>
6537 #ifdef __linux__
6538 #include <linux/rtc.h>
6539 #else
6540 #include <rtc.h>
6541 #define RTC_PIE_ON RTCIO_PIE_ON
6542 #endif
6543 int main(void) { return RTC_PIE_ON; }
6545 _rtc=no
6546 cc_check && _rtc=yes
6547 ppc && _rtc=no
6549 if test "$_rtc" = yes ; then
6550 def_rtc='#define HAVE_RTC 1'
6551 else
6552 def_rtc='#undef HAVE_RTC'
6554 echores "$_rtc"
6557 echocheck "liblzo2 support"
6558 if test "$_liblzo" = auto ; then
6559 _liblzo=no
6560 cat > $TMPC << EOF
6561 #include <lzo/lzo1x.h>
6562 int main(void) { lzo_init();return 0; }
6564 cc_check -llzo2 && _liblzo=yes
6566 if test "$_liblzo" = yes ; then
6567 def_liblzo='#define CONFIG_LIBLZO 1'
6568 extra_ldflags="$extra_ldflags -llzo2"
6569 codecmodules="liblzo $codecmodules"
6570 else
6571 def_liblzo='#undef CONFIG_LIBLZO'
6572 nocodecmodules="liblzo $nocodecmodules"
6574 echores "$_liblzo"
6577 echocheck "mad support"
6578 if test "$_mad" = auto ; then
6579 _mad=no
6580 cat > $TMPC << EOF
6581 #include <mad.h>
6582 int main(void) { return 0; }
6584 cc_check -lmad && _mad=yes
6586 if test "$_mad" = yes ; then
6587 def_mad='#define CONFIG_LIBMAD 1'
6588 extra_ldflags="$extra_ldflags -lmad"
6589 codecmodules="libmad $codecmodules"
6590 else
6591 def_mad='#undef CONFIG_LIBMAD'
6592 nocodecmodules="libmad $nocodecmodules"
6594 echores "$_mad"
6596 echocheck "Twolame"
6597 if test "$_twolame" = auto ; then
6598 cat > $TMPC <<EOF
6599 #include <twolame.h>
6600 int main(void) { twolame_init(); return 0; }
6602 _twolame=no
6603 cc_check -ltwolame $_ld_lm && _twolame=yes
6605 if test "$_twolame" = yes ; then
6606 def_twolame='#define CONFIG_TWOLAME 1'
6607 libs_mencoder="$libs_mencoder -ltwolame"
6608 codecmodules="twolame $codecmodules"
6609 else
6610 def_twolame='#undef CONFIG_TWOLAME'
6611 nocodecmodules="twolame $nocodecmodules"
6613 echores "$_twolame"
6615 echocheck "Toolame"
6616 if test "$_toolame" = auto ; then
6617 _toolame=no
6618 if test "$_twolame" = yes ; then
6619 res_comment="disabled by twolame"
6620 else
6621 cat > $TMPC <<EOF
6622 #include <toolame.h>
6623 int main(void) { toolame_init(); return 0; }
6625 cc_check -ltoolame $_ld_lm && _toolame=yes
6628 if test "$_toolame" = yes ; then
6629 def_toolame='#define CONFIG_TOOLAME 1'
6630 libs_mencoder="$libs_mencoder -ltoolame"
6631 codecmodules="toolame $codecmodules"
6632 else
6633 def_toolame='#undef CONFIG_TOOLAME'
6634 nocodecmodules="toolame $nocodecmodules"
6636 if test "$_toolamedir" ; then
6637 res_comment="using $_toolamedir"
6639 echores "$_toolame"
6641 echocheck "OggVorbis support"
6642 if test "$_tremor_internal" = yes; then
6643 _libvorbis=no
6644 elif test "$_tremor" = auto; then
6645 _tremor=no
6646 cat > $TMPC << EOF
6647 #include <tremor/ivorbiscodec.h>
6648 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6650 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6652 if test "$_libvorbis" = auto; then
6653 _libvorbis=no
6654 cat > $TMPC << EOF
6655 #include <vorbis/codec.h>
6656 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6658 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6660 if test "$_tremor_internal" = yes ; then
6661 _vorbis=yes
6662 def_vorbis='#define CONFIG_OGGVORBIS 1'
6663 def_tremor='#define CONFIG_TREMOR 1'
6664 codecmodules="tremor(internal) $codecmodules"
6665 res_comment="internal Tremor"
6666 if test "$_tremor_low" = yes ; then
6667 cflags_tremor_low="-D_LOW_ACCURACY_"
6668 res_comment="internal low accuracy Tremor"
6670 elif test "$_tremor" = yes ; then
6671 _vorbis=yes
6672 def_vorbis='#define CONFIG_OGGVORBIS 1'
6673 def_tremor='#define CONFIG_TREMOR 1'
6674 codecmodules="tremor(external) $codecmodules"
6675 res_comment="external Tremor"
6676 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6677 elif test "$_libvorbis" = yes ; then
6678 _vorbis=yes
6679 def_vorbis='#define CONFIG_OGGVORBIS 1'
6680 codecmodules="libvorbis $codecmodules"
6681 res_comment="libvorbis"
6682 extra_ldflags="$extra_ldflags -lvorbis -logg"
6683 else
6684 _vorbis=no
6685 nocodecmodules="libvorbis $nocodecmodules"
6687 echores "$_vorbis"
6689 echocheck "libspeex (version >= 1.1 required)"
6690 if test "$_speex" = auto ; then
6691 _speex=no
6692 cat > $TMPC << EOF
6693 #include <speex/speex.h>
6694 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6696 cc_check -lspeex $_ld_lm && _speex=yes
6698 if test "$_speex" = yes ; then
6699 def_speex='#define CONFIG_SPEEX 1'
6700 extra_ldflags="$extra_ldflags -lspeex"
6701 codecmodules="speex $codecmodules"
6702 else
6703 def_speex='#undef CONFIG_SPEEX'
6704 nocodecmodules="speex $nocodecmodules"
6706 echores "$_speex"
6708 echocheck "OggTheora support"
6709 if test "$_theora" = auto ; then
6710 _theora=no
6711 cat > $TMPC << EOF
6712 #include <theora/theora.h>
6713 #include <string.h>
6714 int main(void) {
6715 /* Theora is in flux, make sure that all interface routines and datatypes
6716 * exist and work the way we expect it, so we don't break MPlayer. */
6717 ogg_packet op;
6718 theora_comment tc;
6719 theora_info inf;
6720 theora_state st;
6721 yuv_buffer yuv;
6722 int r;
6723 double t;
6725 theora_info_init(&inf);
6726 theora_comment_init(&tc);
6728 return 0;
6730 /* we don't want to execute this kind of nonsense; just for making sure
6731 * that compilation works... */
6732 memset(&op, 0, sizeof(op));
6733 r = theora_decode_header(&inf, &tc, &op);
6734 r = theora_decode_init(&st, &inf);
6735 t = theora_granule_time(&st, op.granulepos);
6736 r = theora_decode_packetin(&st, &op);
6737 r = theora_decode_YUVout(&st, &yuv);
6738 theora_clear(&st);
6740 return 0;
6743 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6744 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6745 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6746 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6747 if test _theora = no; then
6748 _ld_theora="-ltheora -logg"
6749 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6751 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6752 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6753 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6754 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6755 extra_ldflags="$extra_ldflags $_ld_theora" &&
6756 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6757 if test _theora = no; then
6758 _ld_theora="-ltheora -logg"
6759 cc_check tremor/bitwise.c $_ld_theora &&
6760 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6764 if test "$_theora" = yes ; then
6765 def_theora='#define CONFIG_OGGTHEORA 1'
6766 codecmodules="libtheora $codecmodules"
6767 # when --enable-theora is forced, we'd better provide a probably sane
6768 # $_ld_theora than nothing
6769 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6770 else
6771 def_theora='#undef CONFIG_OGGTHEORA'
6772 nocodecmodules="libtheora $nocodecmodules"
6774 echores "$_theora"
6776 echocheck "mp3lib support"
6777 if test "$_mp3lib" = auto ; then
6778 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6780 if test "$_mp3lib" = yes ; then
6781 def_mp3lib='#define CONFIG_MP3LIB 1'
6782 codecmodules="mp3lib(internal) $codecmodules"
6783 else
6784 def_mp3lib='#undef CONFIG_MP3LIB'
6785 nocodecmodules="mp3lib(internal) $nocodecmodules"
6787 echores "$_mp3lib"
6789 echocheck "liba52 support"
6790 def_liba52='#undef CONFIG_LIBA52'
6791 if test "$_liba52" = auto ; then
6792 _liba52=no
6793 cat > $TMPC << EOF
6794 #include <inttypes.h>
6795 #include <a52dec/a52.h>
6796 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6798 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6800 if test "$_liba52" = yes ; then
6801 def_liba52='#define CONFIG_LIBA52 1'
6802 codecmodules="liba52 $codecmodules"
6803 else
6804 nocodecmodules="liba52 $nocodecmodules"
6806 echores "$_liba52"
6808 echocheck "internal libmpeg2 support"
6809 if test "$_libmpeg2" = auto ; then
6810 _libmpeg2=yes
6811 if alpha && test cc_vendor=gnu; then
6812 case $cc_version in
6813 2*|3.0*|3.1*) # cannot compile MVI instructions
6814 _libmpeg2=no
6815 res_comment="broken gcc"
6817 esac
6820 if test "$_libmpeg2" = yes ; then
6821 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6822 codecmodules="libmpeg2(internal) $codecmodules"
6823 else
6824 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6825 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6827 echores "$_libmpeg2"
6829 echocheck "libdca support"
6830 if test "$_libdca" = auto ; then
6831 _libdca=no
6832 cat > $TMPC << EOF
6833 #include <inttypes.h>
6834 #include <dts.h>
6835 int main(void) { dts_init(0); return 0; }
6837 for _ld_dca in -ldca -ldts ; do
6838 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6839 && _libdca=yes && break
6840 done
6842 if test "$_libdca" = yes ; then
6843 def_libdca='#define CONFIG_LIBDCA 1'
6844 codecmodules="libdca $codecmodules"
6845 else
6846 def_libdca='#undef CONFIG_LIBDCA'
6847 nocodecmodules="libdca $nocodecmodules"
6849 echores "$_libdca"
6851 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6852 if test "$_musepack" = auto ; then
6853 _musepack=no
6854 cat > $TMPC << EOF
6855 #include <stddef.h>
6856 #include <mpcdec/mpcdec.h>
6857 int main(void) {
6858 mpc_streaminfo info;
6859 mpc_decoder decoder;
6860 mpc_decoder_set_streaminfo(&decoder, &info);
6861 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6862 return 0;
6865 cc_check -lmpcdec $_ld_lm && _musepack=yes
6867 if test "$_musepack" = yes ; then
6868 def_musepack='#define CONFIG_MUSEPACK 1'
6869 extra_ldflags="$extra_ldflags -lmpcdec"
6870 codecmodules="musepack $codecmodules"
6871 else
6872 def_musepack='#undef CONFIG_MUSEPACK'
6873 nocodecmodules="musepack $nocodecmodules"
6875 echores "$_musepack"
6878 echocheck "FAAC support"
6879 if test "$_faac" = auto ; then
6880 cat > $TMPC <<EOF
6881 #include <inttypes.h>
6882 #include <faac.h>
6883 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6885 _faac=no
6886 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6887 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6888 done
6890 if test "$_faac" = yes ; then
6891 def_faac="#define CONFIG_FAAC 1"
6892 test "$_faac_lavc" = auto && _faac_lavc=yes
6893 if test "$_faac_lavc" = yes ; then
6894 def_faac_lavc="#define CONFIG_LIBFAAC 1"
6895 libs_mplayer="$libs_mplayer $_ld_faac"
6896 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6898 codecmodules="faac $codecmodules"
6899 else
6900 _faac_lavc=no
6901 def_faac="#undef CONFIG_FAAC"
6902 def_faac_lavc="#define CONFIG_LIBFAAC 0"
6903 nocodecmodules="faac $nocodecmodules"
6905 res_comment="in libavcodec: $_faac_lavc"
6906 echores "$_faac"
6909 echocheck "FAAD2 support"
6910 if test "$_faad_internal" = auto ; then
6911 if x86_32 && test cc_vendor=gnu; then
6912 case $cc_version in
6913 3.1*|3.2) # ICE/insn with these versions
6914 _faad_internal=no
6915 res_comment="broken gcc"
6918 _faad=yes
6919 _faad_internal=yes
6921 esac
6922 else
6923 _faad=yes
6924 _faad_internal=yes
6927 if test "$_faad" = auto ; then
6928 cat > $TMPC << EOF
6929 #include <faad.h>
6930 #ifndef FAAD_MIN_STREAMSIZE
6931 #error Too old version
6932 #endif
6933 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6934 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6936 cc_check -lfaad $_ld_lm && _faad=yes
6939 def_faad='#undef CONFIG_FAAD'
6940 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6941 if test "$_faad_internal" = yes ; then
6942 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6943 res_comment="internal floating-point"
6944 if test "$_faad_fixed" = yes ; then
6945 # The FIXED_POINT implementation of FAAD2 improves performance
6946 # on some platforms, especially for SBR files.
6947 cflags_faad_fixed="-DFIXED_POINT"
6948 res_comment="internal fixed-point"
6950 elif test "$_faad" = yes ; then
6951 extra_ldflags="$extra_ldflags -lfaad"
6954 if test "$_faad" = yes ; then
6955 def_faad='#define CONFIG_FAAD 1'
6956 if test "$_faad_internal" = yes ; then
6957 codecmodules="faad2(internal) $codecmodules"
6958 else
6959 codecmodules="faad2 $codecmodules"
6961 else
6962 _faad=no
6963 nocodecmodules="faad2 $nocodecmodules"
6965 echores "$_faad"
6968 echocheck "LADSPA plugin support"
6969 if test "$_ladspa" = auto ; then
6970 cat > $TMPC <<EOF
6971 #include <stdio.h>
6972 #include <ladspa.h>
6973 int main(void) {
6974 const LADSPA_Descriptor *ld = NULL;
6975 return 0;
6978 _ladspa=no
6979 cc_check && _ladspa=yes
6981 if test "$_ladspa" = yes; then
6982 def_ladspa="#define CONFIG_LADSPA 1"
6983 else
6984 def_ladspa="#undef CONFIG_LADSPA"
6986 echores "$_ladspa"
6989 echocheck "libbs2b audio filter support"
6990 if test "$_libbs2b" = auto ; then
6991 cat > $TMPC <<EOF
6992 #include <bs2b.h>
6993 #if BS2B_VERSION_MAJOR < 3
6994 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6995 #endif
6996 int main(void) {
6997 t_bs2bdp filter;
6998 filter=bs2b_open();
6999 bs2b_close(filter);
7000 return 0;
7003 _libbs2b=no
7004 if $_pkg_config --exists libbs2b ; then
7005 _inc_tmp=$($_pkg_config --cflags libbs2b)
7006 _ld_tmp=$($_pkg_config --libs libbs2b)
7007 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
7008 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
7009 else
7010 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
7011 -I/usr/local/include/bs2b ; do
7012 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
7013 extra_ldflags="$extra_ldflags -lbs2b"
7014 extra_cflags="$extra_cflags $_inc_tmp"
7015 _libbs2b=yes
7016 break
7018 done
7021 def_libbs2b="#undef CONFIG_LIBBS2B"
7022 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
7023 echores "$_libbs2b"
7026 if test -z "$_codecsdir" ; then
7027 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
7028 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
7029 if test -d "$dir" ; then
7030 _codecsdir="$dir"
7031 break;
7033 done
7035 # Fall back on default directory.
7036 if test -z "$_codecsdir" ; then
7037 _codecsdir="$_libdir/codecs"
7038 mingw32 || os2 && _codecsdir="codecs"
7042 echocheck "Win32 codecs"
7043 if test "$_win32dll" = auto ; then
7044 _win32dll=no
7045 if x86_32 && ! qnx; then
7046 _win32dll=yes
7049 if test "$_win32dll" = yes ; then
7050 def_win32dll='#define CONFIG_WIN32DLL 1'
7051 if ! win32 ; then
7052 def_win32_loader='#define WIN32_LOADER 1'
7053 _win32_emulation=yes
7054 else
7055 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
7056 res_comment="using native windows"
7058 codecmodules="win32 $codecmodules"
7059 else
7060 def_win32dll='#undef CONFIG_WIN32DLL'
7061 def_win32_loader='#undef WIN32_LOADER'
7062 nocodecmodules="win32 $nocodecmodules"
7064 echores "$_win32dll"
7067 echocheck "XAnim codecs"
7068 if test "$_xanim" = auto ; then
7069 _xanim=no
7070 res_comment="dynamic loader support needed"
7071 if test "$_dl" = yes ; then
7072 _xanim=yes
7075 if test "$_xanim" = yes ; then
7076 def_xanim='#define CONFIG_XANIM 1'
7077 codecmodules="xanim $codecmodules"
7078 else
7079 def_xanim='#undef CONFIG_XANIM'
7080 nocodecmodules="xanim $nocodecmodules"
7082 echores "$_xanim"
7085 echocheck "RealPlayer codecs"
7086 if test "$_real" = auto ; then
7087 _real=no
7088 res_comment="dynamic loader support needed"
7089 if test "$_dl" = yes || test "$_win32dll" = yes &&
7090 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
7091 _real=yes
7094 if test "$_real" = yes ; then
7095 def_real='#define CONFIG_REALCODECS 1'
7096 codecmodules="real $codecmodules"
7097 else
7098 def_real='#undef CONFIG_REALCODECS'
7099 nocodecmodules="real $nocodecmodules"
7101 echores "$_real"
7104 echocheck "QuickTime codecs"
7105 _qtx_emulation=no
7106 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
7107 if test "$_qtx" = auto ; then
7108 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
7110 if test "$_qtx" = yes ; then
7111 def_qtx='#define CONFIG_QTX_CODECS 1'
7112 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
7113 codecmodules="qtx $codecmodules"
7114 darwin || win32 || _qtx_emulation=yes
7115 else
7116 def_qtx='#undef CONFIG_QTX_CODECS'
7117 nocodecmodules="qtx $nocodecmodules"
7119 echores "$_qtx"
7121 echocheck "Nemesi Streaming Media libraries"
7122 if test "$_nemesi" = auto && test "$_network" = yes ; then
7123 _nemesi=no
7124 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
7125 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
7126 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
7127 _nemesi=yes
7130 if test "$_nemesi" = yes; then
7131 _native_rtsp=no
7132 def_nemesi='#define CONFIG_LIBNEMESI 1'
7133 inputmodules="nemesi $inputmodules"
7134 else
7135 _native_rtsp="$_network"
7136 _nemesi=no
7137 def_nemesi='#undef CONFIG_LIBNEMESI'
7138 _noinputmodules="nemesi $_noinputmodules"
7140 echores "$_nemesi"
7142 echocheck "LIVE555 Streaming Media libraries"
7143 if test "$_live" = auto && test "$_network" = yes ; then
7144 cat > $TMPCPP << EOF
7145 #include <liveMedia.hh>
7146 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
7147 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
7148 #endif
7149 int main(void) { return 0; }
7152 _live=no
7153 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
7154 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
7155 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
7156 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
7157 $_livelibdir/groupsock/libgroupsock.a \
7158 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
7159 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
7160 $extra_ldflags -lstdc++" \
7161 extra_cxxflags="-I$_livelibdir/liveMedia/include \
7162 -I$_livelibdir/UsageEnvironment/include \
7163 -I$_livelibdir/BasicUsageEnvironment/include \
7164 -I$_livelibdir/groupsock/include" && \
7165 _live=yes && break
7166 done
7167 if test "$_live" != yes ; then
7168 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
7169 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
7170 _live_dist=yes
7174 if test "$_live" = yes && test "$_network" = yes; then
7175 test $_livelibdir && res_comment="using $_livelibdir"
7176 def_live='#define CONFIG_LIVE555 1'
7177 inputmodules="live555 $inputmodules"
7178 elif test "$_live_dist" = yes && test "$_network" = yes; then
7179 res_comment="using distribution version"
7180 _live="yes"
7181 def_live='#define CONFIG_LIVE555 1'
7182 extra_ldflags="$extra_ldflags $ld_tmp"
7183 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
7184 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
7185 inputmodules="live555 $inputmodules"
7186 else
7187 _live=no
7188 def_live='#undef CONFIG_LIVE555'
7189 _noinputmodules="live555 $_noinputmodules"
7191 echores "$_live"
7194 echocheck "FFmpeg libavutil"
7195 if test "$_libavutil_a" = auto ; then
7196 if test -d libavutil ; then
7197 _libavutil_a=yes
7198 res_comment="static"
7199 else
7200 die "MPlayer will not compile without libavutil in the source tree."
7202 elif test "$_libavutil_so" = auto ; then
7203 _libavutil_so=no
7204 cat > $TMPC << EOF
7205 #include <libavutil/common.h>
7206 int main(void) { av_clip(1, 1, 1); return 0; }
7208 if $_pkg_config --exists libavutil ; then
7209 _inc_libavutil=$($_pkg_config --cflags libavutil)
7210 _ld_tmp=$($_pkg_config --libs libavutil)
7211 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7212 && _libavutil_so=yes
7213 elif cc_check -lavutil $_ld_lm ; then
7214 extra_ldflags="$extra_ldflags -lavutil"
7215 _libavutil_so=yes
7216 res_comment="using libavutil.so, but static libavutil is recommended"
7219 _libavutil=no
7220 def_libavutil='#undef CONFIG_LIBAVUTIL'
7221 def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
7222 def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
7223 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
7224 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
7225 test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
7226 test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
7227 # neither static nor shared libavutil is available, but it is mandatory ...
7228 if test "$_libavutil" = no ; then
7229 die "You need static or shared libavutil, MPlayer will not compile without!"
7231 echores "$_libavutil"
7233 echocheck "FFmpeg libavcodec"
7234 if test "$_libavcodec_a" = auto ; then
7235 _libavcodec_a=no
7236 if test -d libavcodec && test -f libavcodec/utils.c ; then
7237 _libavcodec_a="yes"
7238 res_comment="static"
7240 elif test "$_libavcodec_so" = auto ; then
7241 _libavcodec_so=no
7242 res_comment="libavcodec.so is discouraged over static libavcodec"
7243 cat > $TMPC << EOF
7244 #include <libavcodec/avcodec.h>
7245 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
7247 if $_pkg_config --exists libavcodec ; then
7248 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
7249 _ld_tmp=$($_pkg_config --libs libavcodec)
7250 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7251 && _libavcodec_so=yes
7252 elif cc_check -lavcodec $_ld_lm ; then
7253 extra_ldflags="$extra_ldflags -lavcodec"
7254 _libavcodec_so=yes
7255 res_comment="using libavcodec.so, but static libavcodec is recommended"
7258 _libavcodec=no
7259 def_libavcodec='#undef CONFIG_LIBAVCODEC'
7260 def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
7261 def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
7262 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
7263 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
7264 test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
7265 test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
7266 test "$_libavcodec_mpegaudio_hp" = yes \
7267 && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' \
7268 && mak_libavcodec_mpegaudio_hp='CONFIG_MPEGAUDIO_HP = yes'
7269 if test "$_libavcodec_a" = yes ; then
7270 codecmodules="libavcodec(internal) $codecmodules"
7271 elif test "$_libavcodec_so" = yes ; then
7272 codecmodules="libavcodec.so $codecmodules"
7273 else
7274 nocodecmodules="libavcodec $nocodecmodules"
7276 echores "$_libavcodec"
7278 echocheck "FFmpeg libavformat"
7279 if test "$_libavformat_a" = auto ; then
7280 _libavformat_a=no
7281 if test -d libavformat && test -f libavformat/utils.c ; then
7282 _libavformat_a=yes
7283 res_comment="static"
7285 elif test "$_libavformat_so" = auto ; then
7286 _libavformat_so=no
7287 cat > $TMPC <<EOF
7288 #include <libavformat/avformat.h>
7289 #include <libavcodec/opt.h>
7290 int main(void) { av_alloc_format_context(); return 0; }
7292 if $_pkg_config --exists libavformat ; then
7293 _inc_libavformat=$($_pkg_config --cflags libavformat)
7294 _ld_tmp=$($_pkg_config --libs libavformat)
7295 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7296 && _libavformat_so=yes
7297 elif cc_check $_ld_lm -lavformat ; then
7298 extra_ldflags="$extra_ldflags -lavformat"
7299 _libavformat_so=yes
7300 res_comment="using libavformat.so, but static libavformat is recommended"
7303 _libavformat=no
7304 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7305 def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
7306 def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
7307 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
7308 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7309 test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
7310 test "$_libavformat_so" = yes \
7311 && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
7312 echores "$_libavformat"
7314 echocheck "FFmpeg libpostproc"
7315 if test "$_libpostproc_a" = auto ; then
7316 _libpostproc_a=no
7317 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
7318 _libpostproc_a='yes'
7319 res_comment="static"
7321 elif test "$_libpostproc_so" = auto ; then
7322 _libpostproc_so=no
7323 cat > $TMPC << EOF
7324 #include <inttypes.h>
7325 #include <libpostproc/postprocess.h>
7326 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7328 if cc_check -lpostproc $_ld_lm ; then
7329 extra_ldflags="$extra_ldflags -lpostproc"
7330 _libpostproc_so=yes
7331 res_comment="using libpostproc.so, but static libpostproc is recommended"
7334 _libpostproc=no
7335 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7336 def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
7337 def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
7338 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
7339 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7340 test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
7341 test "$_libpostproc_so" = yes \
7342 && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
7343 echores "$_libpostproc"
7345 echocheck "FFmpeg libswscale"
7346 if test "$_libswscale_a" = auto ; then
7347 _libswscale_a=no
7348 if test -d libswscale && test -f libswscale/swscale.h ; then
7349 _libswscale_a='yes'
7350 res_comment="static"
7352 elif test "$_libswscale_so" = auto ; then
7353 _libswscale_so=no
7354 res_comment="using libswscale.so, but static libswscale is recommended"
7355 cat > $TMPC << EOF
7356 #include <libswscale/swscale.h>
7357 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7359 if $_pkg_config --exists libswscale ; then
7360 _inc_libswscale=$($_pkg_config --cflags libswscale)
7361 _ld_tmp=$($_pkg_config --libs libswscale)
7362 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7363 && _libswscale_so=yes
7364 elif cc_check -lswscale ; then
7365 extra_ldflags="$extra_ldflags -lswscale"
7366 _libswscale_so=yes
7369 _libswscale=no
7370 def_libswscale='#undef CONFIG_LIBSWSCALE'
7371 def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
7372 def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
7373 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
7374 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7375 test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
7376 test "$_libswscale_so" = yes \
7377 && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
7378 echores "$_libswscale"
7380 echocheck "libopencore_amr narrowband"
7381 if test "$_libopencore_amrnb" = auto ; then
7382 _libopencore_amrnb=no
7383 cat > $TMPC << EOF
7384 #include <opencore-amrnb/interf_dec.h>
7385 int main(void) { Decoder_Interface_init(); return 0; }
7387 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7388 if test "$_libavcodec_a" != yes ; then
7389 _libopencore_amrnb=no
7390 res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
7393 if test "$_libopencore_amrnb" = yes ; then
7394 _libopencore_amr=yes
7395 extra_ldflags="$extra_ldflags -lopencore-amrnb"
7396 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
7397 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
7398 _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
7399 codecmodules="libopencore_amrnb $codecmodules"
7400 else
7401 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
7402 nocodecmodules="libopencore_amrnb $nocodecmodules"
7404 echores "$_libopencore_amrnb"
7407 echocheck "libopencore_amr wideband"
7408 if test "$_libopencore_amrwb" = auto ; then
7409 _libopencore_amrwb=no
7410 cat > $TMPC << EOF
7411 #include <opencore-amrwb/dec_if.h>
7412 int main(void) { D_IF_init(); return 0; }
7414 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7415 if test "$_libavcodec_a" != yes ; then
7416 _libopencore_amrwb=no
7417 res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
7420 if test "$_libopencore_amrwb" = yes ; then
7421 _libopencore_amr=yes
7422 extra_ldflags="$extra_ldflags -lopencore-amrwb"
7423 def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
7424 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
7425 codecmodules="libopencore_amrwb $codecmodules"
7426 else
7427 def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
7428 nocodecmodules="libopencore_amrwb $nocodecmodules"
7430 echores "$_libopencore_amrwb"
7432 echocheck "libdv-0.9.5+"
7433 if test "$_libdv" = auto ; then
7434 _libdv=no
7435 cat > $TMPC <<EOF
7436 #include <libdv/dv.h>
7437 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7439 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7441 if test "$_libdv" = yes ; then
7442 def_libdv='#define CONFIG_LIBDV095 1'
7443 extra_ldflags="$extra_ldflags -ldv"
7444 codecmodules="libdv $codecmodules"
7445 else
7446 def_libdv='#undef CONFIG_LIBDV095'
7447 nocodecmodules="libdv $nocodecmodules"
7449 echores "$_libdv"
7452 echocheck "Xvid"
7453 if test "$_xvid" = auto ; then
7454 _xvid=no
7455 cat > $TMPC << EOF
7456 #include <xvid.h>
7457 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7459 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7460 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7461 done
7464 if test "$_xvid" = yes ; then
7465 def_xvid='#define CONFIG_XVID4 1'
7466 codecmodules="xvid $codecmodules"
7467 else
7468 def_xvid='#undef CONFIG_XVID4'
7469 nocodecmodules="xvid $nocodecmodules"
7471 echores "$_xvid"
7473 echocheck "Xvid two pass plugin"
7474 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7475 cat > $TMPC << EOF
7476 #include <xvid.h>
7477 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7479 cc_check && _xvid_lavc=yes
7481 if test "$_xvid_lavc" = yes ; then
7482 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7483 _libavencoders="$_libavencoders LIBXVID_ENCODER"
7484 else
7485 _xvid_lavc=no
7486 def_xvid_lavc='#define CONFIG_LIBXVID 0'
7488 echores "$_xvid_lavc"
7491 echocheck "x264"
7492 if test "$_x264" = auto ; then
7493 cat > $TMPC << EOF
7494 #include <inttypes.h>
7495 #include <x264.h>
7496 #if X264_BUILD < 89
7497 #error We do not support old versions of x264. Get the latest from git.
7498 #endif
7499 int main(void) { x264_encoder_open((void*)0); return 0; }
7501 _x264=no
7502 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7503 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7504 done
7507 if test "$_x264" = yes ; then
7508 def_x264='#define CONFIG_X264 1'
7509 codecmodules="x264 $codecmodules"
7510 test "$_x264_lavc" = auto && _x264_lavc=yes
7511 if test "$_x264_lavc" = yes ; then
7512 def_x264_lavc='#define CONFIG_LIBX264 1'
7513 libs_mplayer="$libs_mplayer $_ld_x264"
7514 _libavencoders="$_libavencoders LIBX264_ENCODER"
7516 else
7517 _x264_lavc=no
7518 def_x264='#undef CONFIG_X264'
7519 def_x264_lavc='#define CONFIG_LIBX264 0'
7520 nocodecmodules="x264 $nocodecmodules"
7522 res_comment="in libavcodec: $_x264_lavc"
7523 echores "$_x264"
7526 echocheck "libdirac"
7527 if test "$_libdirac_lavc" = auto; then
7528 _libdirac_lavc=no
7529 if test "$_libavcodec_a" != yes; then
7530 res_comment="libavcodec (static) is required by libdirac, sorry"
7531 else
7532 cat > $TMPC << EOF
7533 #include <libdirac_encoder/dirac_encoder.h>
7534 #include <libdirac_decoder/dirac_parser.h>
7535 int main(void)
7537 dirac_encoder_context_t enc_ctx;
7538 dirac_decoder_t *dec_handle;
7539 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
7540 dec_handle = dirac_decoder_init(0);
7541 if (dec_handle)
7542 dirac_decoder_close(dec_handle);
7543 return 0;
7546 if $_pkg_config --exists dirac ; then
7547 _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
7548 _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
7549 cc_check $_inc_dirac $_ld_dirac &&
7550 _libdirac_lavc=yes &&
7551 extra_cflags="$extra_cflags $_inc_dirac" &&
7552 extra_ldflags="$extra_ldflags $_ld_dirac"
7556 if test "$_libdirac_lavc" = yes ; then
7557 def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
7558 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
7559 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
7560 codecmodules="libdirac $codecmodules"
7561 else
7562 def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
7563 nocodecmodules="libdirac $nocodecmodules"
7565 echores "$_libdirac_lavc"
7568 echocheck "libschroedinger"
7569 if test "$_libschroedinger_lavc" = auto ; then
7570 _libschroedinger_lavc=no
7571 if test "$_libavcodec_a" != yes; then
7572 res_comment="libavcodec (static) is required by libschroedinger, sorry"
7573 else
7574 cat > $TMPC << EOF
7575 #include <schroedinger/schro.h>
7576 int main(void) { schro_init(); return SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY; }
7578 if $_pkg_config --exists schroedinger-1.0 ; then
7579 _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
7580 _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
7581 cc_check $_inc_schroedinger $_ld_schroedinger &&
7582 _libschroedinger_lavc=yes &&
7583 extra_cflags="$extra_cflags $_inc_schroedinger" &&
7584 extra_ldflags="$extra_ldflags $_ld_schroedinger"
7588 if test "$_libschroedinger_lavc" = yes ; then
7589 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
7590 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
7591 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
7592 codecmodules="libschroedinger $codecmodules"
7593 else
7594 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
7595 nocodecmodules="libschroedinger $nocodecmodules"
7597 echores "$_libschroedinger_lavc"
7599 echocheck "libnut"
7600 if test "$_libnut" = auto ; then
7601 cat > $TMPC << EOF
7602 #include <stdio.h>
7603 #include <stdlib.h>
7604 #include <inttypes.h>
7605 #include <libnut.h>
7606 nut_context_tt * nut;
7607 int main(void) { (void)nut_error(0); return 0; }
7609 _libnut=no
7610 cc_check -lnut && _libnut=yes
7613 if test "$_libnut" = yes ; then
7614 def_libnut='#define CONFIG_LIBNUT 1'
7615 extra_ldflags="$extra_ldflags -lnut"
7616 else
7617 def_libnut='#undef CONFIG_LIBNUT'
7619 echores "$_libnut"
7621 #check must be done after libavcodec one
7622 echocheck "zr"
7623 if test "$_zr" = auto ; then
7624 #36067's seem to identify themselves as 36057PQC's, so the line
7625 #below should work for 36067's and 36057's.
7626 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7627 _zr=yes
7628 else
7629 _zr=no
7632 if test "$_zr" = yes ; then
7633 if test "$_libavcodec_a" = yes ; then
7634 def_zr='#define CONFIG_ZR 1'
7635 vomodules="zr zr2 $vomodules"
7636 else
7637 res_comment="libavcodec (static) is required by zr, sorry"
7638 novomodules="zr $novomodules"
7639 def_zr='#undef CONFIG_ZR'
7641 else
7642 def_zr='#undef CONFIG_ZR'
7643 novomodules="zr zr2 $novomodules"
7645 echores "$_zr"
7647 # mencoder requires (optional) those libs: libmp3lame
7648 if test "$_mencoder" != no ; then
7650 echocheck "libmp3lame"
7651 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7652 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7653 if test "$_mp3lame" = auto ; then
7654 _mp3lame=no
7655 cat > $TMPC <<EOF
7656 #include <lame/lame.h>
7657 int main(void) { lame_version_t lv; (void) lame_init();
7658 get_lame_version_numerical(&lv);
7659 return 0; }
7661 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7663 if test "$_mp3lame" = yes ; then
7664 def_mp3lame="#define CONFIG_MP3LAME 1"
7665 _ld_mp3lame=-lmp3lame
7666 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7667 cat > $TMPC << EOF
7668 #include <lame/lame.h>
7669 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7671 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7672 cat > $TMPC << EOF
7673 #include <lame/lame.h>
7674 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7676 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7677 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7678 if test "$_mp3lame_lavc" = yes ; then
7679 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7680 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
7681 libs_mplayer="$libs_mplayer $_ld_mp3lame"
7683 else
7684 _mp3lame_lavc=no
7685 def_mp3lame='#undef CONFIG_MP3LAME'
7686 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
7688 res_comment="in libavcodec: $_mp3lame_lavc"
7689 echores "$_mp3lame"
7691 fi # test "$_mencoder" != no
7693 echocheck "mencoder"
7694 if test "$_mencoder" = yes ; then
7695 def_muxers='#define CONFIG_MUXERS 1'
7696 else
7697 # mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
7698 # png for vf_screenshot, mjpeg for zr
7699 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
7700 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
7701 test "$_zr" = yes && _libavencoders="$_libavencoders MJPEG_ENCODER"
7702 _libavmuxers=""
7703 def_muxers='#define CONFIG_MUXERS 0'
7705 echores "$_mencoder"
7708 echocheck "UnRAR executable"
7709 if test "$_unrar_exec" = auto ; then
7710 _unrar_exec="yes"
7711 mingw32 && _unrar_exec="no"
7713 if test "$_unrar_exec" = yes ; then
7714 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7715 else
7716 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7718 echores "$_unrar_exec"
7720 echocheck "TV interface"
7721 if test "$_tv" = yes ; then
7722 def_tv='#define CONFIG_TV 1'
7723 inputmodules="tv $inputmodules"
7724 else
7725 _noinputmodules="tv $_noinputmodules"
7726 def_tv='#undef CONFIG_TV'
7728 echores "$_tv"
7731 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7732 echocheck "*BSD BT848 bt8xx header"
7733 _ioctl_bt848_h=no
7734 for file in "machine/ioctl_bt848.h" \
7735 "dev/bktr/ioctl_bt848.h" \
7736 "dev/video/bktr/ioctl_bt848.h" \
7737 "dev/ic/bt8xx.h" ; do
7738 cat > $TMPC <<EOF
7739 #include <sys/types.h>
7740 #include <sys/ioctl.h>
7741 #include <$file>
7742 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7744 if cc_check ; then
7745 _ioctl_bt848_h=yes
7746 _ioctl_bt848_h_name="$file"
7747 break;
7749 done
7750 if test "$_ioctl_bt848_h" = yes ; then
7751 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7752 res_comment="using $_ioctl_bt848_h_name"
7753 else
7754 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7756 echores "$_ioctl_bt848_h"
7758 echocheck "*BSD ioctl_meteor.h"
7759 _ioctl_meteor_h=no
7760 for file in "machine/ioctl_meteor.h" \
7761 "dev/bktr/ioctl_meteor.h" \
7762 "dev/video/bktr/ioctl_meteor.h" ; do
7763 cat > $TMPC <<EOF
7764 #include <sys/types.h>
7765 #include <$file>
7766 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7768 if cc_check ; then
7769 _ioctl_meteor_h=yes
7770 _ioctl_meteor_h_name="$file"
7771 break;
7773 done
7774 if test "$_ioctl_meteor_h" = yes ; then
7775 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7776 res_comment="using $_ioctl_meteor_h_name"
7777 else
7778 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7780 echores "$_ioctl_meteor_h"
7782 echocheck "*BSD BrookTree 848 TV interface"
7783 if test "$_tv_bsdbt848" = auto ; then
7784 _tv_bsdbt848=no
7785 if test "$_tv" = yes ; then
7786 cat > $TMPC <<EOF
7787 #include <sys/types.h>
7788 $def_ioctl_meteor_h_name
7789 $def_ioctl_bt848_h_name
7790 #ifdef IOCTL_METEOR_H_NAME
7791 #include IOCTL_METEOR_H_NAME
7792 #endif
7793 #ifdef IOCTL_BT848_H_NAME
7794 #include IOCTL_BT848_H_NAME
7795 #endif
7796 int main(void) {
7797 ioctl(0, METEORSINPUT, 0);
7798 ioctl(0, TVTUNER_GETFREQ, 0);
7799 return 0;
7802 cc_check && _tv_bsdbt848=yes
7805 if test "$_tv_bsdbt848" = yes ; then
7806 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7807 inputmodules="tv-bsdbt848 $inputmodules"
7808 else
7809 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7810 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7812 echores "$_tv_bsdbt848"
7813 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7816 echocheck "DirectShow TV interface"
7817 if test "$_tv_dshow" = auto ; then
7818 _tv_dshow=no
7819 if test "$_tv" = yes && win32 ; then
7820 cat > $TMPC <<EOF
7821 #include <ole2.h>
7822 int main(void) {
7823 void* p;
7824 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7825 return 0;
7828 cc_check -lole32 -luuid && _tv_dshow=yes
7831 if test "$_tv_dshow" = yes ; then
7832 inputmodules="tv-dshow $inputmodules"
7833 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7834 extra_ldflags="$extra_ldflags -lole32 -luuid"
7835 else
7836 _noinputmodules="tv-dshow $_noinputmodules"
7837 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7839 echores "$_tv_dshow"
7842 echocheck "Video 4 Linux TV interface"
7843 if test "$_tv_v4l1" = auto ; then
7844 _tv_v4l1=no
7845 if test "$_tv" = yes && linux ; then
7846 cat > $TMPC <<EOF
7847 #include <stdlib.h>
7848 #include <linux/videodev.h>
7849 int main(void) { return 0; }
7851 cc_check && _tv_v4l1=yes
7854 if test "$_tv_v4l1" = yes ; then
7855 _audio_input=yes
7856 _tv_v4l=yes
7857 def_tv_v4l='#define CONFIG_TV_V4L 1'
7858 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7859 inputmodules="tv-v4l $inputmodules"
7860 else
7861 _noinputmodules="tv-v4l1 $_noinputmodules"
7862 def_tv_v4l='#undef CONFIG_TV_V4L'
7864 echores "$_tv_v4l1"
7867 echocheck "Video 4 Linux 2 TV interface"
7868 if test "$_tv_v4l2" = auto ; then
7869 _tv_v4l2=no
7870 if test "$_tv" = yes && linux ; then
7871 cat > $TMPC <<EOF
7872 #include <stdlib.h>
7873 #include <linux/types.h>
7874 #include <linux/videodev2.h>
7875 int main(void) { return 0; }
7877 cc_check && _tv_v4l2=yes
7880 if test "$_tv_v4l2" = yes ; then
7881 _audio_input=yes
7882 _tv_v4l=yes
7883 def_tv_v4l='#define CONFIG_TV_V4L 1'
7884 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7885 inputmodules="tv-v4l2 $inputmodules"
7886 else
7887 _noinputmodules="tv-v4l2 $_noinputmodules"
7888 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7890 echores "$_tv_v4l2"
7893 echocheck "Radio interface"
7894 if test "$_radio" = yes ; then
7895 def_radio='#define CONFIG_RADIO 1'
7896 inputmodules="radio $inputmodules"
7897 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7898 _radio_capture=no
7900 if test "$_radio_capture" = yes ; then
7901 _audio_input=yes
7902 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7903 else
7904 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7906 else
7907 _noinputmodules="radio $_noinputmodules"
7908 def_radio='#undef CONFIG_RADIO'
7909 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7910 _radio_capture=no
7912 echores "$_radio"
7913 echocheck "Capture for Radio interface"
7914 echores "$_radio_capture"
7916 echocheck "Video 4 Linux 2 Radio interface"
7917 if test "$_radio_v4l2" = auto ; then
7918 _radio_v4l2=no
7919 if test "$_radio" = yes && linux ; then
7920 cat > $TMPC <<EOF
7921 #include <stdlib.h>
7922 #include <linux/types.h>
7923 #include <linux/videodev2.h>
7924 int main(void) { return 0; }
7926 cc_check && _radio_v4l2=yes
7929 if test "$_radio_v4l2" = yes ; then
7930 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7931 else
7932 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7934 echores "$_radio_v4l2"
7936 echocheck "Video 4 Linux Radio interface"
7937 if test "$_radio_v4l" = auto ; then
7938 _radio_v4l=no
7939 if test "$_radio" = yes && linux ; then
7940 cat > $TMPC <<EOF
7941 #include <stdlib.h>
7942 #include <linux/videodev.h>
7943 int main(void) { return 0; }
7945 cc_check && _radio_v4l=yes
7948 if test "$_radio_v4l" = yes ; then
7949 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7950 else
7951 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7953 echores "$_radio_v4l"
7955 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7956 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7957 echocheck "*BSD BrookTree 848 Radio interface"
7958 _radio_bsdbt848=no
7959 cat > $TMPC <<EOF
7960 #include <sys/types.h>
7961 $def_ioctl_bt848_h_name
7962 #ifdef IOCTL_BT848_H_NAME
7963 #include IOCTL_BT848_H_NAME
7964 #endif
7965 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7967 cc_check && _radio_bsdbt848=yes
7968 echores "$_radio_bsdbt848"
7969 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7971 if test "$_radio_bsdbt848" = yes ; then
7972 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7973 else
7974 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7977 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7978 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7979 die "Radio driver requires BSD BT848, V4L or V4L2!"
7982 echocheck "Video 4 Linux 2 MPEG PVR interface"
7983 if test "$_pvr" = auto ; then
7984 _pvr=no
7985 if test "$_tv_v4l2" = yes && linux ; then
7986 cat > $TMPC <<EOF
7987 #include <stdlib.h>
7988 #include <inttypes.h>
7989 #include <linux/types.h>
7990 #include <linux/videodev2.h>
7991 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7993 cc_check && _pvr=yes
7996 if test "$_pvr" = yes ; then
7997 def_pvr='#define CONFIG_PVR 1'
7998 inputmodules="pvr $inputmodules"
7999 else
8000 _noinputmodules="pvr $_noinputmodules"
8001 def_pvr='#undef CONFIG_PVR'
8003 echores "$_pvr"
8006 echocheck "ftp"
8007 if ! beos && test "$_ftp" = yes ; then
8008 def_ftp='#define CONFIG_FTP 1'
8009 inputmodules="ftp $inputmodules"
8010 else
8011 _noinputmodules="ftp $_noinputmodules"
8012 def_ftp='#undef CONFIG_FTP'
8014 echores "$_ftp"
8016 echocheck "vstream client"
8017 if test "$_vstream" = auto ; then
8018 _vstream=no
8019 cat > $TMPC <<EOF
8020 #include <vstream-client.h>
8021 void vstream_error(const char *format, ... ) {}
8022 int main(void) { vstream_start(); return 0; }
8024 cc_check -lvstream-client && _vstream=yes
8026 if test "$_vstream" = yes ; then
8027 def_vstream='#define CONFIG_VSTREAM 1'
8028 inputmodules="vstream $inputmodules"
8029 extra_ldflags="$extra_ldflags -lvstream-client"
8030 else
8031 _noinputmodules="vstream $_noinputmodules"
8032 def_vstream='#undef CONFIG_VSTREAM'
8034 echores "$_vstream"
8037 echocheck "OSD menu"
8038 if test "$_menu" = yes ; then
8039 def_menu='#define CONFIG_MENU 1'
8040 test $_dvbin = "yes" && _menu_dvbin=yes
8041 else
8042 def_menu='#undef CONFIG_MENU'
8043 _menu_dvbin=no
8045 echores "$_menu"
8048 echocheck "Subtitles sorting"
8049 if test "$_sortsub" = yes ; then
8050 def_sortsub='#define CONFIG_SORTSUB 1'
8051 else
8052 def_sortsub='#undef CONFIG_SORTSUB'
8054 echores "$_sortsub"
8057 echocheck "XMMS inputplugin support"
8058 if test "$_xmms" = yes ; then
8059 if ( xmms-config --version ) >/dev/null 2>&1 ; then
8060 _xmmsplugindir=$(xmms-config --input-plugin-dir)
8061 _xmmslibdir=$(xmms-config --exec-prefix)/lib
8062 else
8063 _xmmsplugindir=/usr/lib/xmms/Input
8064 _xmmslibdir=/usr/lib
8067 def_xmms='#define CONFIG_XMMS 1'
8068 if darwin ; then
8069 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
8070 else
8071 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
8073 else
8074 def_xmms='#undef CONFIG_XMMS'
8076 echores "$_xmms"
8079 # --------------- GUI specific tests begin -------------------
8080 echocheck "GUI"
8081 echo "$_gui"
8082 if test "$_gui" = yes ; then
8084 # Required libraries
8085 if test "$_libavcodec" != yes ||
8086 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
8087 die "The GUI requires libavcodec with PNG support (needs zlib)."
8089 test "$_freetype" = no && test "$_bitmap_font" = no && \
8090 die "The GUI requires either FreeType or bitmap font support."
8091 if ! win32 ; then
8092 _gui_gtk=yes
8093 test "$_x11" != yes && die "X11 support required for GUI compilation."
8095 echocheck "XShape extension"
8096 if test "$_xshape" = auto ; then
8097 _xshape=no
8098 cat > $TMPC << EOF
8099 #include <X11/Xlib.h>
8100 #include <X11/Xproto.h>
8101 #include <X11/Xutil.h>
8102 #include <X11/extensions/shape.h>
8103 #include <stdlib.h>
8104 int main(void) {
8105 char *name = ":0.0";
8106 Display *wsDisplay;
8107 int exitvar = 0;
8108 int eventbase, errorbase;
8109 if (getenv("DISPLAY"))
8110 name=getenv("DISPLAY");
8111 wsDisplay=XOpenDisplay(name);
8112 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
8113 exitvar=1;
8114 XCloseDisplay(wsDisplay);
8115 return exitvar;
8118 cc_check -lXext && _xshape=yes
8120 if test "$_xshape" = yes ; then
8121 def_xshape='#define CONFIG_XSHAPE 1'
8122 else
8123 die "The GUI requires the X11 extension XShape (which was not found)."
8125 echores "$_xshape"
8127 #Check for GTK
8128 if test "$_gtk1" = no ; then
8129 #Check for GTK2 :
8130 echocheck "GTK+ version"
8132 if $_pkg_config gtk+-2.0 --exists ; then
8133 _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
8134 extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
8135 libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
8136 echores "$_gtk"
8138 # Check for GLIB2
8139 if $_pkg_config glib-2.0 --exists ; then
8140 echocheck "glib version"
8141 _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
8142 libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
8143 echores "$_glib"
8145 def_gui='#define CONFIG_GUI 1'
8146 def_gtk2='#define CONFIG_GTK2 1'
8147 else
8148 _gtk1=yes
8149 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
8151 else
8152 echo "GTK-2 devel packages were not found, trying GTK 1.2"
8153 _gtk1=yes
8157 if test "$_gtk1" = yes ; then
8158 # Check for old GTK (1.2.x)
8159 echocheck "GTK version"
8160 if test -z "$_gtkconfig" ; then
8161 if ( gtk-config --version ) >/dev/null 2>&1 ; then
8162 _gtkconfig="gtk-config"
8163 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
8164 _gtkconfig="gtk12-config"
8165 else
8166 die "The GUI requires GTK devel packages (which were not found)."
8169 _gtk=$($_gtkconfig --version 2>&1)
8170 extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
8171 libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
8172 echores "$_gtk (using $_gtkconfig)"
8174 # Check for GLIB
8175 echocheck "glib version"
8176 if test -z "$_glibconfig" ; then
8177 if ( glib-config --version ) >/dev/null 2>&1 ; then
8178 _glibconfig="glib-config"
8179 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
8180 _glibconfig="glib12-config"
8181 else
8182 die "The GUI requires GLIB devel packages (which were not found)"
8185 _glib=$($_glibconfig --version 2>&1)
8186 libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
8187 echores "$_glib (using $_glibconfig)"
8189 def_gui='#define CONFIG_GUI 1'
8190 def_gtk2='#undef CONFIG_GTK2'
8193 else #if ! win32
8194 _gui_win32=yes
8195 libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
8196 def_gui='#define CONFIG_GUI 1'
8197 def_gtk2='#undef CONFIG_GTK2'
8198 fi #if ! win32
8200 else #if test "$_gui"
8201 def_gui='#undef CONFIG_GUI'
8202 def_gtk2='#undef CONFIG_GTK2'
8203 fi #if test "$_gui"
8204 # --------------- GUI specific tests end -------------------
8207 if test "$_charset" != "noconv" ; then
8208 def_charset="#define MSG_CHARSET \"$_charset\""
8209 else
8210 def_charset="#undef MSG_CHARSET"
8211 _charset="UTF-8"
8214 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
8215 echocheck "iconv program"
8216 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
8217 if test "$?" -ne 0 ; then
8218 echores "no"
8219 echo "No working iconv program found, use "
8220 echo "--charset=UTF-8 to continue anyway."
8221 echo "If you also have problems with iconv library functions use --charset=noconv."
8222 echo "Messages in the GTK-2 interface will be broken then."
8223 exit 1
8224 else
8225 echores "yes"
8229 #############################################################################
8231 echocheck "automatic gdb attach"
8232 if test "$_crash_debug" = yes ; then
8233 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
8234 else
8235 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
8236 _crash_debug=no
8238 echores "$_crash_debug"
8240 echocheck "compiler support for noexecstack"
8241 cat > $TMPC <<EOF
8242 int main(void) { return 0; }
8244 if cc_check -Wl,-z,noexecstack ; then
8245 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
8246 echores "yes"
8247 else
8248 echores "no"
8251 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
8252 if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
8253 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
8254 echores "yes"
8255 else
8256 echores "no"
8260 # Dynamic linking flags
8261 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
8262 _ld_dl_dynamic=''
8263 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
8264 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
8265 _ld_dl_dynamic='-rdynamic'
8268 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
8269 bsdos && extra_ldflags="$extra_ldflags -ldvd"
8270 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
8272 def_debug='#undef MP_DEBUG'
8273 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
8276 echocheck "joystick"
8277 def_joystick='#undef CONFIG_JOYSTICK'
8278 if test "$_joystick" = yes ; then
8279 if linux ; then
8280 # TODO add some check
8281 def_joystick='#define CONFIG_JOYSTICK 1'
8282 else
8283 _joystick="no"
8284 res_comment="unsupported under $system_name"
8287 echores "$_joystick"
8289 echocheck "lirc"
8290 if test "$_lirc" = auto ; then
8291 _lirc=no
8292 cat > $TMPC <<EOF
8293 #include <lirc/lirc_client.h>
8294 int main(void) { return 0; }
8296 cc_check -llirc_client && _lirc=yes
8298 if test "$_lirc" = yes ; then
8299 def_lirc='#define CONFIG_LIRC 1'
8300 libs_mplayer="$libs_mplayer -llirc_client"
8301 else
8302 def_lirc='#undef CONFIG_LIRC'
8304 echores "$_lirc"
8306 echocheck "lircc"
8307 if test "$_lircc" = auto ; then
8308 _lircc=no
8309 cat > $TMPC <<EOF
8310 #include <lirc/lircc.h>
8311 int main(void) { return 0; }
8313 cc_check -llircc && _lircc=yes
8315 if test "$_lircc" = yes ; then
8316 def_lircc='#define CONFIG_LIRCC 1'
8317 libs_mplayer="$libs_mplayer -llircc"
8318 else
8319 def_lircc='#undef CONFIG_LIRCC'
8321 echores "$_lircc"
8323 if arm; then
8324 # Detect maemo development platform libraries availability (http://www.maemo.org),
8325 # they are used when run on Nokia 770|8x0
8326 echocheck "maemo (Nokia 770|8x0)"
8327 if test "$_maemo" = auto ; then
8328 _maemo=no
8329 cat > $TMPC << EOF
8330 #include <libosso.h>
8331 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
8333 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8335 if test "$_maemo" = yes ; then
8336 def_maemo='#define CONFIG_MAEMO 1'
8337 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8338 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
8339 else
8340 def_maemo='#undef CONFIG_MAEMO'
8342 echores "$_maemo"
8345 #############################################################################
8347 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
8348 # the OMF format needs to come after the 'extern symbol prefix' check, which
8349 # uses nm.
8350 if os2 ; then
8351 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
8354 # linker paths should be the same for mencoder and mplayer
8355 _ld_tmp=""
8356 for I in $libs_mplayer ; do
8357 _tmp=$(echo $I | sed -e 's/^-L.*$//')
8358 if test -z "$_tmp" ; then
8359 extra_ldflags="$extra_ldflags $I"
8360 else
8361 _ld_tmp="$_ld_tmp $I"
8363 done
8364 libs_mplayer=$_ld_tmp
8367 #############################################################################
8368 # 64 bit file offsets?
8369 if test "$_largefiles" = yes || freebsd ; then
8370 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
8371 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
8372 # dvdread support requires this (for off64_t)
8373 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
8377 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
8379 # This must be the last test to be performed. Any other tests following it
8380 # could fail due to linker errors. libdvdnavmini is intentionally not linked
8381 # against libdvdread (to permit MPlayer to use its own copy of the library).
8382 # So any compilation using the flags added here but not linking against
8383 # libdvdread can fail.
8384 echocheck "DVD support (libdvdnav)"
8385 dvdnav_internal=no
8386 if test "$_dvdnav" = auto ; then
8387 if test "$_dvdread_internal" = yes ; then
8388 _dvdnav=yes
8389 dvdnav_internal=yes
8390 res_comment="internal"
8391 else
8392 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
8395 if test "$_dvdnav" = auto ; then
8396 cat > $TMPC <<EOF
8397 #include <inttypes.h>
8398 #include <dvdnav/dvdnav.h>
8399 int main(void) { dvdnav_t *dvd=0; return 0; }
8401 _dvdnav=no
8402 _dvdnavdir=$($_dvdnavconfig --cflags)
8403 _dvdnavlibs=$($_dvdnavconfig --libs)
8404 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
8406 if test "$_dvdnav" = yes ; then
8407 _largefiles=yes
8408 def_dvdnav='#define CONFIG_DVDNAV 1'
8409 if test "$dvdnav_internal" = yes ; then
8410 cflags_libdvdnav="-Ilibdvdnav"
8411 inputmodules="dvdnav(internal) $inputmodules"
8412 else
8413 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
8414 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
8415 inputmodules="dvdnav $inputmodules"
8417 else
8418 def_dvdnav='#undef CONFIG_DVDNAV'
8419 _noinputmodules="dvdnav $_noinputmodules"
8421 echores "$_dvdnav"
8423 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8424 # Read dvdnav comment above.
8426 mak_enable () {
8427 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8428 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8429 nprefix=$3;
8430 for part in $list; do
8431 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8432 echo "${nprefix}_$part = yes"
8434 done
8437 #############################################################################
8438 echo "Creating config.mak"
8439 cat > config.mak << EOF
8440 # -------- Generated by configure -----------
8442 # Ensure that locale settings do not interfere with shell commands.
8443 export LC_ALL = C
8445 CONFIGURATION = $_configuration
8447 CHARSET = $_charset
8448 DOC_LANGS = $language_doc
8449 DOC_LANG_ALL = $doc_lang_all
8450 MAN_LANGS = $language_man
8451 MAN_LANG_ALL = $man_lang_all
8453 prefix = \$(DESTDIR)$_prefix
8454 BINDIR = \$(DESTDIR)$_bindir
8455 DATADIR = \$(DESTDIR)$_datadir
8456 LIBDIR = \$(DESTDIR)$_libdir
8457 MANDIR = \$(DESTDIR)$_mandir
8458 CONFDIR = \$(DESTDIR)$_confdir
8460 AR = $_ar
8461 AS = $_cc
8462 CC = $_cc
8463 CXX = $_cc
8464 HOST_CC = $_host_cc
8465 INSTALL = $_install
8466 INSTALLSTRIP = $_install_strip
8467 WINDRES = $_windres
8469 CFLAGS = $CFLAGS $extra_cflags
8470 ASFLAGS = \$(CFLAGS)
8471 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
8473 CFLAGS_DHAHELPER = $cflags_dhahelper
8474 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
8475 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
8476 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
8477 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
8478 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
8479 CFLAGS_STACKREALIGN = $cflags_stackrealign
8480 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
8481 CFLAGS_TREMOR_LOW = $cflags_tremor_low
8483 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
8484 EXTRALIBS_MPLAYER = $libs_mplayer
8485 EXTRALIBS_MENCODER = $libs_mencoder
8487 GETCH = $_getch
8488 HELP_FILE = $_mp_help
8489 TIMER = $_timer
8491 EXESUF = $_exesuf
8492 EXESUFS_ALL = .exe
8494 ARCH = $arch
8495 $(mak_enable "$arch_all" "$arch" ARCH)
8496 $(mak_enable "$subarch_all" "$subarch" ARCH)
8497 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
8499 MENCODER = $_mencoder
8500 MPLAYER = $_mplayer
8502 NEED_GETTIMEOFDAY = $_need_gettimeofday
8503 NEED_GLOB = $_need_glob
8504 NEED_MMAP = $_need_mmap
8505 NEED_SETENV = $_need_setenv
8506 NEED_SHMEM = $_need_shmem
8507 NEED_STRSEP = $_need_strsep
8508 NEED_SWAB = $_need_swab
8509 NEED_VSSCANF = $_need_vsscanf
8511 # features
8512 3DFX = $_3dfx
8513 AA = $_aa
8514 ALSA1X = $_alsa1x
8515 ALSA9 = $_alsa9
8516 ALSA5 = $_alsa5
8517 APPLE_IR = $_apple_ir
8518 APPLE_REMOTE = $_apple_remote
8519 ARTS = $_arts
8520 AUDIO_INPUT = $_audio_input
8521 BITMAP_FONT = $_bitmap_font
8522 BL = $_bl
8523 CACA = $_caca
8524 CDDA = $_cdda
8525 CDDB = $_cddb
8526 COREAUDIO = $_coreaudio
8527 COREVIDEO = $_corevideo
8528 DART = $_dart
8529 DFBMGA = $_dfbmga
8530 DGA = $_dga
8531 DIRECT3D = $_direct3d
8532 DIRECTFB = $_directfb
8533 DIRECTX = $_directx
8534 DVBIN = $_dvbin
8535 DVDNAV = $_dvdnav
8536 DVDNAV_INTERNAL = $dvdnav_internal
8537 DVDREAD = $_dvdread
8538 DVDREAD_INTERNAL = $_dvdread_internal
8539 DXR2 = $_dxr2
8540 DXR3 = $_dxr3
8541 ESD = $_esd
8542 FAAC=$_faac
8543 FAAD = $_faad
8544 FAAD_INTERNAL = $_faad_internal
8545 FASTMEMCPY = $_fastmemcpy
8546 FBDEV = $_fbdev
8547 FREETYPE = $_freetype
8548 FTP = $_ftp
8549 GIF = $_gif
8550 GGI = $_ggi
8551 GL = $_gl
8552 GL_WIN32 = $_gl_win32
8553 GL_X11 = $_gl_x11
8554 GL_SDL = $_gl_sdl
8555 MATRIXVIEW = $matrixview
8556 GUI = $_gui
8557 GUI_GTK = $_gui_gtk
8558 GUI_WIN32 = $_gui_win32
8559 HAVE_POSIX_SELECT = $_posix_select
8560 HAVE_SYS_MMAN_H = $_mman
8561 IVTV = $_ivtv
8562 JACK = $_jack
8563 JOYSTICK = $_joystick
8564 JPEG = $_jpeg
8565 KAI = $_kai
8566 KVA = $_kva
8567 LADSPA = $_ladspa
8568 LIBA52 = $_liba52
8569 LIBASS = $_ass
8570 LIBASS_INTERNAL = $ass_internal
8571 LIBBS2B = $_libbs2b
8572 LIBDCA = $_libdca
8573 LIBDV = $_libdv
8574 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
8575 LIBLZO = $_liblzo
8576 LIBMAD = $_mad
8577 LIBMENU = $_menu
8578 LIBMENU_DVBIN = $_menu_dvbin
8579 LIBMPEG2 = $_libmpeg2
8580 LIBNEMESI = $_nemesi
8581 LIBNUT = $_libnut
8582 LIBSMBCLIENT = $_smb
8583 LIBTHEORA = $_theora
8584 LIRC = $_lirc
8585 LIVE555 = $_live
8586 MACOSX_FINDER = $_macosx_finder
8587 MD5SUM = $_md5sum
8588 MGA = $_mga
8589 MNG = $_mng
8590 MP3LAME = $_mp3lame
8591 MP3LIB = $_mp3lib
8592 MUSEPACK = $_musepack
8593 NAS = $_nas
8594 NATIVE_RTSP = $_native_rtsp
8595 NETWORK = $_network
8596 OPENAL = $_openal
8597 OSS = $_ossaudio
8598 PE_EXECUTABLE = $_pe_executable
8599 PNG = $_png
8600 PNM = $_pnm
8601 PRIORITY = $_priority
8602 PULSE = $_pulse
8603 PVR = $_pvr
8604 QTX_CODECS = $_qtx
8605 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8606 QTX_EMULATION = $_qtx_emulation
8607 QUARTZ = $_quartz
8608 RADIO=$_radio
8609 RADIO_CAPTURE=$_radio_capture
8610 REAL_CODECS = $_real
8611 S3FB = $_s3fb
8612 SDL = $_sdl
8613 SPEEX = $_speex
8614 STREAM_CACHE = $_stream_cache
8615 SGIAUDIO = $_sgiaudio
8616 SUNAUDIO = $_sunaudio
8617 SVGA = $_svga
8618 TDFXFB = $_tdfxfb
8619 TDFXVID = $_tdfxvid
8620 TGA = $_tga
8621 TOOLAME=$_toolame
8622 TREMOR_INTERNAL = $_tremor_internal
8623 TV = $_tv
8624 TV_BSDBT848 = $_tv_bsdbt848
8625 TV_DSHOW = $_tv_dshow
8626 TV_V4L = $_tv_v4l
8627 TV_V4L1 = $_tv_v4l1
8628 TV_V4L2 = $_tv_v4l2
8629 TWOLAME=$_twolame
8630 UNRAR_EXEC = $_unrar_exec
8631 V4L2 = $_v4l2
8632 VCD = $_vcd
8633 VDPAU = $_vdpau
8634 VESA = $_vesa
8635 VIDIX = $_vidix
8636 VIDIX_PCIDB = $_vidix_pcidb_val
8637 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8638 VIDIX_IVTV=$_vidix_drv_ivtv
8639 VIDIX_MACH64=$_vidix_drv_mach64
8640 VIDIX_MGA=$_vidix_drv_mga
8641 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8642 VIDIX_NVIDIA=$_vidix_drv_nvidia
8643 VIDIX_PM2=$_vidix_drv_pm2
8644 VIDIX_PM3=$_vidix_drv_pm3
8645 VIDIX_RADEON=$_vidix_drv_radeon
8646 VIDIX_RAGE128=$_vidix_drv_rage128
8647 VIDIX_S3=$_vidix_drv_s3
8648 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8649 VIDIX_SIS=$_vidix_drv_sis
8650 VIDIX_UNICHROME=$_vidix_drv_unichrome
8651 VORBIS = $_vorbis
8652 VSTREAM = $_vstream
8653 WII = $_wii
8654 WIN32DLL = $_win32dll
8655 WIN32WAVEOUT = $_win32waveout
8656 WIN32_EMULATION = $_win32_emulation
8657 WINVIDIX = $winvidix
8658 X11 = $_x11
8659 X264 = $_x264
8660 XANIM_CODECS = $_xanim
8661 XMGA = $_xmga
8662 XMMS_PLUGINS = $_xmms
8663 XV = $_xv
8664 XVID4 = $_xvid
8665 XVIDIX = $xvidix
8666 XVMC = $_xvmc
8667 XVR100 = $_xvr100
8668 YUV4MPEG = $_yuv4mpeg
8669 ZR = $_zr
8671 # FFmpeg
8672 LIBAVUTIL = $_libavutil
8673 LIBAVUTIL_A = $_libavutil_a
8674 LIBAVUTIL_SO = $_libavutil_so
8675 LIBAVCODEC = $_libavcodec
8676 LIBAVCODEC_A = $_libavcodec_a
8677 LIBAVCODEC_SO = $_libavcodec_so
8678 LIBAVFORMAT = $_libavformat
8679 LIBAVFORMAT_A = $_libavformat_a
8680 LIBAVFORMAT_SO = $_libavformat_so
8681 LIBPOSTPROC = $_libpostproc
8682 LIBPOSTPROC_A = $_libpostproc_a
8683 LIBPOSTPROC_SO = $_libpostproc_so
8684 LIBSWSCALE = $_libswscale
8685 LIBSWSCALE_A = $_libswscale_a
8686 LIBSWSCALE_SO = $_libswscale_so
8688 HOSTCC = \$(HOST_CC)
8689 HOSTCFLAGS = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
8690 HOSTLIBS = -lm
8691 CC_O = -o \$@
8692 LD = gcc
8693 RANLIB = $_ranlib
8694 YASM = $_yasm
8695 YASMFLAGS = $YASMFLAGS
8697 CONFIG_STATIC = yes
8698 SRC_PATH = ..
8699 BUILD_ROOT = ..
8700 LIBPREF = lib
8701 LIBSUF = .a
8702 LIBNAME = \$(LIBPREF)\$(NAME)\$(LIBSUF)
8703 FULLNAME = \$(NAME)\$(BUILDSUF)
8705 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8706 CONFIG_AANDCT = yes
8707 CONFIG_DCT = yes
8708 CONFIG_DWT = yes
8709 CONFIG_FFT = yes
8710 CONFIG_GOLOMB = yes
8711 CONFIG_H264DSP = yes
8712 CONFIG_LPC = yes
8713 CONFIG_LSP = yes
8714 CONFIG_MDCT = yes
8715 CONFIG_RDFT = yes
8717 $mak_hardcoded_tables
8718 $mak_libavcodec_mpegaudio_hp
8719 !CONFIG_LIBRTMP = yes
8721 CONFIG_BZLIB = $bzlib
8722 CONFIG_ENCODERS = yes
8723 CONFIG_GPL = yes
8724 CONFIG_LIBDIRAC_DECODER = $_libdirac_lavc
8725 CONFIG_LIBDIRAC_ENCODER = $_libdirac_lavc
8726 CONFIG_LIBFAAC_ENCODER = $_faac_lavc
8727 CONFIG_LIBMP3LAME_ENCODER = $_mp3lame_lavc
8728 CONFIG_LIBOPENCORE_AMRNB_DECODER = $_libopencore_amrnb
8729 CONFIG_LIBOPENCORE_AMRNB_ENCODER = $_libopencore_amrnb
8730 CONFIG_LIBOPENCORE_AMRWB_DECODER = $_libopencore_amrwb
8731 OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
8732 OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
8733 CONFIG_LIBSCHROEDINGER_DECODER = $_libschroedinger_lavc
8734 CONFIG_LIBSCHROEDINGER_ENCODER = $_libschroedinger_lavc
8735 CONFIG_LIBVORBIS_ENCODER = $_libvorbis
8736 CONFIG_LIBX264_ENCODER = $_x264_lavc
8737 CONFIG_LIBXVID_ENCODER = $_xvid_lavc
8738 CONFIG_MLIB = $_mlib
8739 CONFIG_MUXERS = $_mencoder
8740 CONFIG_POSTPROC = yes
8741 CONFIG_VDPAU = $_vdpau
8742 CONFIG_XVMC = $_xvmc
8743 CONFIG_ZLIB = $_zlib
8745 HAVE_PTHREADS = $_pthreads
8746 HAVE_SHM = $_shm
8747 HAVE_W32THREADS = $_w32threads
8748 HAVE_YASM = $have_yasm
8750 $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8751 $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8752 $(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8753 $(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8754 $(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8755 $(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8756 $(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8757 $(echo $_libavhwaccels | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8760 #############################################################################
8762 ff_config_enable () {
8763 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8764 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8765 _nprefix=$3;
8766 test -z "$_nprefix" && _nprefix='CONFIG'
8767 for part in $list; do
8768 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8769 echo "#define ${_nprefix}_$part 1"
8770 else
8771 echo "#define ${_nprefix}_$part 0"
8773 done
8776 echo "Creating config.h"
8777 cat > $TMPH << EOF
8778 /*----------------------------------------------------------------------------
8779 ** This file has been automatically generated by configure any changes in it
8780 ** will be lost when you run configure again.
8781 ** Instead of modifying definitions here, use the --enable/--disable options
8782 ** of the configure script! See ./configure --help for details.
8783 *---------------------------------------------------------------------------*/
8785 #ifndef MPLAYER_CONFIG_H
8786 #define MPLAYER_CONFIG_H
8788 /* Undefine this if you do not want to select mono audio (left or right)
8789 with a stereo MPEG layer 2/3 audio stream. The command line option
8790 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8791 right-only), with 0 being the default.
8793 #define CONFIG_FAKE_MONO 1
8795 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8796 #define MAX_OUTBURST 65536
8798 /* set up audio OUTBURST. Do not change this! */
8799 #define OUTBURST 512
8801 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8802 #undef FAST_OSD
8803 #undef FAST_OSD_TABLE
8805 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8806 #define MPEG12_POSTPROC 1
8807 #define ATTRIBUTE_ALIGNED_MAX 16
8811 #define CONFIGURATION "$_configuration"
8813 #define MPLAYER_DATADIR "$_datadir"
8814 #define MPLAYER_CONFDIR "$_confdir"
8815 #define MPLAYER_LIBDIR "$_libdir"
8817 /* definitions needed by included libraries */
8818 #define HAVE_INTTYPES_H 1
8819 /* libmpeg2 + FFmpeg */
8820 $def_fast_inttypes
8821 /* libdvdcss */
8822 #define HAVE_ERRNO_H 1
8823 /* libdvdcss + libdvdread */
8824 #define HAVE_LIMITS_H 1
8825 /* libdvdcss + libfaad2 */
8826 #define HAVE_UNISTD_H 1
8827 /* libfaad2 + libdvdread */
8828 #define STDC_HEADERS 1
8829 #define HAVE_MEMCPY 1
8830 /* libfaad2 */
8831 #define HAVE_STRING_H 1
8832 #define HAVE_STRINGS_H 1
8833 #define HAVE_SYS_STAT_H 1
8834 #define HAVE_SYS_TYPES_H 1
8835 /* libdvdnav */
8836 #define READ_CACHE_TRACE 0
8837 /* libdvdread */
8838 #define HAVE_DLFCN_H 1
8839 $def_dvdcss
8842 /* system headers */
8843 $def_alloca_h
8844 $def_alsa_asoundlib_h
8845 $def_altivec_h
8846 $def_malloc_h
8847 $def_mman_h
8848 $def_mman_has_map_failed
8849 $def_soundcard_h
8850 $def_sys_asoundlib_h
8851 $def_sys_soundcard_h
8852 $def_sys_sysinfo_h
8853 $def_termios_h
8854 $def_termios_sys_h
8855 $def_winsock2_h
8858 /* system functions */
8859 $def_gethostbyname2
8860 $def_gettimeofday
8861 $def_glob
8862 $def_langinfo
8863 $def_lrintf
8864 $def_map_memalign
8865 $def_memalign
8866 $def_nanosleep
8867 $def_posix_select
8868 $def_select
8869 $def_setenv
8870 $def_setmode
8871 $def_shm
8872 $def_strsep
8873 $def_swab
8874 $def_sysi86
8875 $def_sysi86_iv
8876 $def_termcap
8877 $def_termios
8878 $def_vsscanf
8881 /* system-specific features */
8882 $def_asmalign_pot
8883 $def_builtin_expect
8884 $def_dl
8885 $def_dos_paths
8886 $def_extern_asm
8887 $def_extern_prefix
8888 $def_iconv
8889 $def_kstat
8890 $def_macosx_bundle
8891 $def_macosx_finder
8892 $def_maemo
8893 $def_named_asm_args
8894 $def_priority
8895 $def_quicktime
8896 $def_restrict_keyword
8897 $def_rtc
8898 $def_unrar_exec
8901 /* configurable options */
8902 $def_charset
8903 $def_crash_debug
8904 $def_debug
8905 $def_dynamic_plugins
8906 $def_fastmemcpy
8907 $def_menu
8908 $def_runtime_cpudetection
8909 $def_sighandler
8910 $def_sortsub
8911 $def_stream_cache
8912 $def_pthread_cache
8915 /* CPU stuff */
8916 #define __CPU__ $iproc
8917 $def_words_endian
8918 $def_bigendian
8919 $(ff_config_enable "$arch_all" "$arch" "ARCH")
8920 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
8921 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
8924 /* DVD/VCD/CD */
8925 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8926 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8927 $def_bsdi_dvd
8928 $def_cddb
8929 $def_cdio
8930 $def_cdparanoia
8931 $def_cdrom
8932 $def_dvd
8933 $def_dvd_bsd
8934 $def_dvd_darwin
8935 $def_dvd_linux
8936 $def_dvd_openbsd
8937 $def_dvdio
8938 $def_dvdnav
8939 $def_dvdread
8940 $def_hpux_scsi_h
8941 $def_libcdio
8942 $def_sol_scsi_h
8943 $def_vcd
8946 /* codec libraries */
8947 $def_faac
8948 $def_faad
8949 $def_faad_internal
8950 $def_liba52
8951 $def_libdca
8952 $def_libdv
8953 $def_liblzo
8954 $def_libmpeg2
8955 $def_mad
8956 $def_mp3lame
8957 $def_mp3lame_preset
8958 $def_mp3lame_preset_medium
8959 $def_mp3lib
8960 $def_musepack
8961 $def_speex
8962 $def_theora
8963 $def_toolame
8964 $def_tremor
8965 $def_twolame
8966 $def_vorbis
8967 $def_x264
8968 $def_xvid
8969 $def_zlib
8971 $def_libnut
8974 /* binary codecs */
8975 $def_qtx
8976 $def_qtx_win32
8977 $def_real
8978 $def_win32_loader
8979 $def_win32dll
8980 $def_xanim
8981 $def_xmms
8982 #define BINARY_CODECS_PATH "$_codecsdir"
8983 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8986 /* GUI */
8987 $def_gtk2
8988 $def_gui
8989 $def_xshape
8992 /* Audio output drivers */
8993 $def_alsa
8994 $def_alsa1x
8995 $def_alsa5
8996 $def_alsa9
8997 $def_arts
8998 $def_coreaudio
8999 $def_dart
9000 $def_esd
9001 $def_esd_latency
9002 $def_jack
9003 $def_kai
9004 $def_nas
9005 $def_openal
9006 $def_openal_h
9007 $def_ossaudio
9008 $def_ossaudio_devdsp
9009 $def_ossaudio_devmixer
9010 $def_pulse
9011 $def_sgiaudio
9012 $def_sunaudio
9013 $def_win32waveout
9015 $def_ladspa
9016 $def_libbs2b
9019 /* input */
9020 $def_apple_ir
9021 $def_apple_remote
9022 $def_ioctl_bt848_h_name
9023 $def_ioctl_meteor_h_name
9024 $def_joystick
9025 $def_lirc
9026 $def_lircc
9027 $def_pvr
9028 $def_radio
9029 $def_radio_bsdbt848
9030 $def_radio_capture
9031 $def_radio_v4l
9032 $def_radio_v4l2
9033 $def_tv
9034 $def_tv_bsdbt848
9035 $def_tv_dshow
9036 $def_tv_v4l
9037 $def_tv_v4l1
9038 $def_tv_v4l2
9041 /* font stuff */
9042 $def_ass
9043 $def_ass_internal
9044 $def_bitmap_font
9045 $def_enca
9046 $def_fontconfig
9047 $def_freetype
9048 $def_fribidi
9051 /* networking */
9052 $def_closesocket
9053 $def_ftp
9054 $def_inet6
9055 $def_inet_aton
9056 $def_inet_pton
9057 $def_live
9058 $def_nemesi
9059 $def_network
9060 $def_smb
9061 $def_socklen_t
9062 $def_struct_ipv6_mreq
9063 $def_struct_sockaddr_in6
9064 $def_struct_sockaddr_sa_len
9065 $def_vstream
9066 $def_addrinfo
9067 $def_getaddrinfo
9068 $def_sockaddr_storage
9071 /* libvo options */
9072 $def_3dfx
9073 $def_aa
9074 $def_bl
9075 $def_caca
9076 $def_corevideo
9077 $def_dfbmga
9078 $def_dga
9079 $def_dga1
9080 $def_dga2
9081 $def_direct3d
9082 $def_directfb
9083 $def_directfb_version
9084 $def_directx
9085 $def_dvb
9086 $def_dvbin
9087 $def_dxr2
9088 $def_dxr3
9089 $def_fbdev
9090 $def_ggi
9091 $def_ggiwmh
9092 $def_gif
9093 $def_gif_4
9094 $def_gif_tvt_hack
9095 $def_gl
9096 $def_gl_win32
9097 $def_gl_x11
9098 $def_gl_sdl
9099 $def_matrixview
9100 $def_ivtv
9101 $def_jpeg
9102 $def_kva
9103 $def_md5sum
9104 $def_mga
9105 $def_mng
9106 $def_png
9107 $def_pnm
9108 $def_quartz
9109 $def_s3fb
9110 $def_sdl
9111 $def_sdl_sdl_h
9112 $def_svga
9113 $def_tdfxfb
9114 $def_tdfxvid
9115 $def_tga
9116 $def_v4l2
9117 $def_vdpau
9118 $def_vesa
9119 $def_vidix
9120 $def_vidix_drv_cyberblade
9121 $def_vidix_drv_ivtv
9122 $def_vidix_drv_mach64
9123 $def_vidix_drv_mga
9124 $def_vidix_drv_mga_crtc2
9125 $def_vidix_drv_nvidia
9126 $def_vidix_drv_pm3
9127 $def_vidix_drv_radeon
9128 $def_vidix_drv_rage128
9129 $def_vidix_drv_s3
9130 $def_vidix_drv_sh_veu
9131 $def_vidix_drv_sis
9132 $def_vidix_drv_unichrome
9133 $def_vidix_pfx
9134 $def_vm
9135 $def_wii
9136 $def_x11
9137 $def_xdpms
9138 $def_xf86keysym
9139 $def_xinerama
9140 $def_xmga
9141 $def_xss
9142 $def_xv
9143 $def_xvmc
9144 $def_xvr100
9145 $def_yuv4mpeg
9146 $def_zr
9149 /* FFmpeg */
9150 $def_libavcodec
9151 $def_libavcodec_a
9152 $def_libavcodec_so
9153 $def_libavformat
9154 $def_libavformat_a
9155 $def_libavformat_so
9156 $def_libavutil
9157 $def_libavutil_a
9158 $def_libavutil_so
9159 $def_libpostproc
9160 $def_libpostproc_a
9161 $def_libpostproc_so
9162 $def_libswscale
9163 $def_libswscale_a
9164 $def_libswscale_so
9166 #define CONFIG_DECODERS 1
9167 #define CONFIG_ENCODERS 1
9168 #define CONFIG_DEMUXERS 1
9169 $def_muxers
9171 $def_arpa_inet_h
9172 $def_bswap
9173 $def_bzlib
9174 $def_dcbzl
9175 $def_exp2
9176 $def_exp2f
9177 $def_fast_64bit
9178 $def_fast_unaligned
9179 $def_hardcoded_tables
9180 $def_libavcodec_mpegaudio_hp
9181 $def_llrint
9182 $def_llrintf
9183 $def_local_aligned_8
9184 $def_local_aligned_16
9185 $def_log2
9186 $def_log2f
9187 $def_lrint
9188 $def_memalign_hack
9189 $def_mlib
9190 $def_mkstemp
9191 $def_posix_memalign
9192 $def_pthreads
9193 $def_round
9194 $def_roundf
9195 $def_ten_operands
9196 $def_threads
9197 $def_truncf
9198 $def_xform_asm
9199 $def_yasm
9201 #define CONFIG_FASTDIV 0
9202 #define CONFIG_FFSERVER 0
9203 #define CONFIG_GPL 1
9204 #define CONFIG_GRAY 0
9205 #define CONFIG_LIBRTMP 0
9206 #define CONFIG_LIBVORBIS 0
9207 #define CONFIG_POWERPC_PERF 0
9208 #define CONFIG_SMALL 0
9209 #define CONFIG_SWSCALE_ALPHA 1
9211 #if defined(HAVE_AF_INET6) && (!defined(_WIN32) || defined(__CYGWIN__))
9212 #define CONFIG_IPV6 1
9213 #else
9214 #define CONFIG_IPV6 0
9215 #endif
9217 #define HAVE_ATTRIBUTE_MAY_ALIAS 1
9218 #define av_alias __attribute__((may_alias))
9219 #define HAVE_ATTRIBUTE_PACKED 1
9220 #define HAVE_GETHRTIME 0
9221 #define HAVE_INLINE_ASM 1
9222 #define HAVE_LDBRX 0
9223 #define HAVE_POLL_H 1
9224 #define HAVE_PPC4XX 0
9225 #define HAVE_STRERROR_R 0
9226 #define HAVE_SYS_SELECT_H 0
9227 #define HAVE_VFP_ARGS 1
9228 #define HAVE_VIRTUALALLOC 0
9230 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
9231 #define CONFIG_AANDCT 1
9232 #define CONFIG_DCT 1
9233 #define CONFIG_DWT 1
9234 #define CONFIG_FFT 1
9235 #define CONFIG_GOLOMB 1
9236 #define CONFIG_H264DSP 1
9237 #define CONFIG_LPC 1
9238 #define CONFIG_MDCT 1
9239 #define CONFIG_RDFT 1
9241 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
9242 $def_ebx_available
9243 #ifndef MP_DEBUG
9244 #define HAVE_EBP_AVAILABLE 1
9245 #else
9246 #define HAVE_EBP_AVAILABLE 0
9247 #endif
9249 #define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
9250 #define FFMPEG_LICENSE "GPL version 2 or later"
9252 /* External libraries used through libavcodec. */
9253 $def_faac_lavc
9254 $def_libdirac_lavc
9255 $def_libopencore_amrnb
9256 $def_libopencore_amrwb
9257 $def_libopenjpeg
9258 $def_libschroedinger_lavc
9259 $def_mp3lame_lavc
9260 $def_x264_lavc
9261 $def_xvid_lavc
9263 $(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
9264 $(ff_config_enable "$_libavencoders_all" "$_libavencoders")
9265 $(ff_config_enable "$_libavparsers_all" "$_libavparsers")
9266 $(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
9267 $(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
9268 $(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
9269 $(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
9270 $(ff_config_enable "$_libavhwaccels_all" "$_libavhwaccels")
9272 #endif /* MPLAYER_CONFIG_H */
9275 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
9276 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
9278 ############################################################################
9280 # Create avconfig.h for FFmpeg.
9281 cat > "$TMPH" << EOF
9282 /* Generated by mpconfigure */
9283 #ifndef AVUTIL_AVCONFIG_H
9284 #define AVUTIL_AVCONFIG_H
9285 $def_av_bigendian
9286 #endif /* AVUTIL_AVCONFIG_H */
9289 # Do not overwrite an unchanged avconfig.h to avoid superfluous rebuilds.
9290 cmp -s "$TMPH" libavutil/avconfig.h || mv -f "$TMPH" libavutil/avconfig.h
9292 #############################################################################
9294 cat << EOF
9296 Config files successfully generated by ./configure $_configuration !
9298 Install prefix: $_prefix
9299 Data directory: $_datadir
9300 Config direct.: $_confdir
9302 Byte order: $_byte_order
9303 Optimizing for: $_optimizing
9305 Languages:
9306 Messages/GUI: $language_msg
9307 Manual pages: $language_man
9308 Documentation: $language_doc
9310 Enabled optional drivers:
9311 Input: $inputmodules
9312 Codecs: $codecmodules
9313 Audio output: $aomodules
9314 Video output: $vomodules
9316 Disabled optional drivers:
9317 Input: $_noinputmodules
9318 Codecs: $nocodecmodules
9319 Audio output: $noaomodules
9320 Video output: $novomodules
9322 'config.h' and 'config.mak' contain your configuration options.
9323 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
9324 compile *** DO NOT REPORT BUGS if you tweak these files ***
9326 'make' will now compile MPlayer and 'make install' will install it.
9327 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
9332 if test "$_mtrr" = yes ; then
9333 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
9334 echo
9337 if ! x86_32; then
9338 cat <<EOF
9339 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
9340 operating system ($system_name). You may encounter a few files that cannot
9341 be played due to missing open source video/audio codec support.
9347 cat <<EOF
9348 Check $TMPLOG if you wonder why an autodetection failed (make sure
9349 development headers/packages are installed).
9351 NOTE: The --enable-* parameters unconditionally force options on, completely
9352 skipping autodetection. This behavior is unlike what you may be used to from
9353 autoconf-based configure scripts that can decide to override you. This greater
9354 level of control comes at a price. You may have to provide the correct compiler
9355 and linker flags yourself.
9356 If you used one of these options (except --enable-menu and similar ones that
9357 turn on internal features) and experience a compilation or linking failure,
9358 make sure you have passed the necessary compiler/linker flags to configure.
9360 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
9364 if test "$_warn_CFLAGS" = yes; then
9365 cat <<EOF
9367 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
9368 but:
9370 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
9372 It is strongly recommended to let MPlayer choose the correct CFLAGS!
9373 To do so, execute 'CFLAGS= ./configure <options>'
9378 # Last move:
9379 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"