Fix compilation with live555 after libavutil r22965.
[mplayer.git] / configure
blobad81bdfe2100cf44deca14e2c31c78b332b9ba51
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 --enable-liba52-internal enable builtin liba52 [disabled]
339 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
340 --disable-musepack disable musepack support [autodetect]
341 --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect]
342 --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect]
343 --disable-libopenjpeg disable OpenJPEG (JPEG2000) input/output support [autodetect]
344 --disable-decoder=DECODER disable specified FFmpeg decoder
345 --enable-decoder=DECODER enable specified FFmpeg decoder
346 --disable-encoder=ENCODER disable specified FFmpeg encoder
347 --enable-encoder=ENCODER enable specified FFmpeg encoder
348 --disable-parser=PARSER disable specified FFmpeg parser
349 --enable-parser=PARSER enable specified FFmpeg parser
350 --disable-protocol=PROTO disable specified FFmpeg protocol
351 --enable-protocol=PROTO enable specified FFmpeg protocol
352 --disable-demuxer=DEMUXER disable specified FFmpeg demuxer
353 --enable-demuxer=DEMUXER enable specified FFmpeg demuxer
354 --disable-muxer=MUXER disable specified FFmpeg muxer
355 --enable-muxer=MUXER enable specified FFmpeg muxer
357 Video output:
358 --disable-vidix disable VIDIX [for x86 *nix]
359 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
360 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
361 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
362 --disable-vidix-pcidb disable VIDIX PCI device name database
363 --enable-dhahelper enable VIDIX dhahelper support
364 --enable-svgalib_helper enable VIDIX svgalib_helper support
365 --enable-gl enable OpenGL video output [autodetect]
366 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
367 --enable-dga2 enable DGA 2 support [autodetect]
368 --enable-dga1 enable DGA 1 support [autodetect]
369 --enable-vesa enable VESA video output [autodetect]
370 --enable-svga enable SVGAlib video output [autodetect]
371 --enable-sdl enable SDL video output [autodetect]
372 --enable-kva enable KVA video output [autodetect]
373 --enable-aa enable AAlib video output [autodetect]
374 --enable-caca enable CACA video output [autodetect]
375 --enable-ggi enable GGI video output [autodetect]
376 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
377 --enable-direct3d enable Direct3D video output [autodetect]
378 --enable-directx enable DirectX video output [autodetect]
379 --enable-dxr2 enable DXR2 video output [autodetect]
380 --enable-dxr3 enable DXR3/H+ video output [autodetect]
381 --enable-ivtv enable IVTV TV-Out video output [autodetect]
382 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
383 --enable-dvb enable DVB video output [autodetect]
384 --enable-mga enable mga_vid video output [autodetect]
385 --enable-xmga enable mga_vid X11 video output [autodetect]
386 --enable-xv enable Xv video output [autodetect]
387 --enable-xvmc enable XvMC acceleration [disable]
388 --enable-vdpau enable VDPAU acceleration [autodetect]
389 --enable-vm enable XF86VidMode support [autodetect]
390 --enable-xinerama enable Xinerama support [autodetect]
391 --enable-x11 enable X11 video output [autodetect]
392 --enable-xshape enable XShape support [autodetect]
393 --disable-xss disable screensaver support via xss [autodetect]
394 --enable-fbdev enable FBDev video output [autodetect]
395 --enable-mlib enable mediaLib video output (Solaris) [disable]
396 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
397 --enable-tdfxfb enable tdfxfb video output [disable]
398 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
399 --enable-wii enable Nintendo Wii/GameCube video output [disable]
400 --enable-directfb enable DirectFB video output [autodetect]
401 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
402 --enable-bl enable Blinkenlights video output [disable]
403 --enable-tdfxvid enable tdfx_vid video output [disable]
404 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
405 --disable-tga disable Targa video output [enable]
406 --disable-pnm disable PNM video output [enable]
407 --disable-md5sum disable md5sum video output [enable]
408 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
409 --disable-corevideo disable CoreVideo video output [autodetect]
410 --disable-quartz disable Quartz video output [autodetect]
412 Audio output:
413 --disable-alsa disable ALSA audio output [autodetect]
414 --disable-ossaudio disable OSS audio output [autodetect]
415 --disable-arts disable aRts audio output [autodetect]
416 --disable-esd disable esd audio output [autodetect]
417 --disable-pulse disable Pulseaudio audio output [autodetect]
418 --disable-jack disable JACK audio output [autodetect]
419 --disable-openal disable OpenAL audio output [autodetect]
420 --disable-nas disable NAS audio output [autodetect]
421 --disable-sgiaudio disable SGI audio output [autodetect]
422 --disable-sunaudio disable Sun audio output [autodetect]
423 --disable-kai disable KAI audio output [autodetect]
424 --disable-dart disable DART audio output [autodetect]
425 --disable-win32waveout disable Windows waveout audio output [autodetect]
426 --disable-coreaudio disable CoreAudio audio output [autodetect]
427 --disable-select disable using select() on the audio device [enable]
429 Language options:
430 --charset=charset convert the console messages to this character set
431 --language-doc=lang language to use for the documentation [en]
432 --language-man=lang language to use for the man pages [en]
433 --language-msg=lang language to use for the messages and the GUI [en]
434 --language=lang default language to use [en]
435 Specific options override --language. You can pass a list of languages separated
436 by whitespace or commas instead of a single language. Nonexisting translations
437 will be dropped from each list. All documentation and man page translations
438 available in the list will be installed, for the messages the first available
439 translation will be used. The value "all" will activate all translations. The
440 LINGUAS environment variable is honored. In all cases the fallback is English.
441 Available values are: all $msg_lang_all
443 Miscellaneous options:
444 --enable-runtime-cpudetection enable runtime CPU detection [disable]
445 --enable-cross-compile enable cross-compilation [autodetect]
446 --cc=COMPILER C compiler to build MPlayer [gcc]
447 --host-cc=COMPILER C compiler for tools needed while building [gcc]
448 --as=ASSEMBLER assembler to build MPlayer [as]
449 --nm=NM nm tool to build MPlayer [nm]
450 --yasm=YASM Yasm assembler to build MPlayer [yasm]
451 --ar=AR librarian to build MPlayer [ar]
452 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
453 --windres=WINDRES windres to build MPlayer [windres]
454 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
455 --enable-static build a statically linked binary
456 --with-install=PATH path to a custom install program
458 Advanced options:
459 --enable-mmx enable MMX [autodetect]
460 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
461 --enable-3dnow enable 3DNow! [autodetect]
462 --enable-3dnowext enable extended 3DNow! [autodetect]
463 --enable-sse enable SSE [autodetect]
464 --enable-sse2 enable SSE2 [autodetect]
465 --enable-ssse3 enable SSSE3 [autodetect]
466 --enable-shm enable shm [autodetect]
467 --enable-altivec enable AltiVec (PowerPC) [autodetect]
468 --enable-armv5te enable DSP extensions (ARM) [autodetect]
469 --enable-armv6 enable ARMv6 (ARM) [autodetect]
470 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
471 --enable-armvfp enable ARM VFP (ARM) [autodetect]
472 --enable-neon enable NEON (ARM) [autodetect]
473 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
474 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
475 --enable-hardcoded-tables put tables in binary instead of calculating them at startup [disable]
476 --enable-big-endian force byte order to big-endian [autodetect]
477 --enable-debug[=1-3] compile-in debugging information [disable]
478 --enable-profile compile-in profiling information [disable]
479 --disable-sighandler disable sighandler for crashes [enable]
480 --enable-crash-debug enable automatic gdb attach on crash [disable]
481 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
483 Use these options if autodetection fails:
484 --extra-cflags=FLAGS extra CFLAGS
485 --extra-ldflags=FLAGS extra LDFLAGS
486 --extra-libs=FLAGS extra linker flags
487 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
488 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
489 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
491 --with-freetype-config=PATH path to freetype-config
492 --with-fribidi-config=PATH path to fribidi-config
493 --with-glib-config=PATH path to glib*-config
494 --with-gtk-config=PATH path to gtk*-config
495 --with-sdl-config=PATH path to sdl*-config
496 --with-dvdnav-config=PATH path to dvdnav-config
497 --with-dvdread-config=PATH path to dvdread-config
499 This configure script is NOT autoconf-based, even though its output is similar.
500 It will try to autodetect all configuration options. If you --enable an option
501 it will be forcefully turned on, skipping autodetection. This can break
502 compilation, so you need to know what you are doing.
504 exit 0
505 } #show_help()
507 # GOTCHA: the variables below defines the default behavior for autodetection
508 # and have - unless stated otherwise - at least 2 states : yes no
509 # If autodetection is available then the third state is: auto
510 _mmx=auto
511 _3dnow=auto
512 _3dnowext=auto
513 _mmxext=auto
514 _sse=auto
515 _sse2=auto
516 _ssse3=auto
517 _cmov=auto
518 _fast_cmov=auto
519 _fast_clz=auto
520 _armv5te=auto
521 _armv6=auto
522 _armv6t2=auto
523 _armvfp=auto
524 neon=auto
525 _iwmmxt=auto
526 _mtrr=auto
527 _altivec=auto
528 _install=install
529 _ranlib=ranlib
530 _windres=windres
531 _cc=cc
532 _ar=ar
533 test "$CC" && _cc="$CC"
534 _as=auto
535 _nm=auto
536 _yasm=yasm
537 _runtime_cpudetection=no
538 _cross_compile=auto
539 _prefix="/usr/local"
540 _libavutil_a=auto
541 _libavutil_so=auto
542 _libavcodec_a=auto
543 _libopencore_amrnb=auto
544 _libopencore_amrwb=auto
545 libopenjpeg=auto
546 _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
547 _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//)
548 _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
549 _libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//)
550 _libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
551 _libavparsers=$_libavparsers_all
552 _libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
553 _libavbsfs=$_libavbsfs_all
554 _libavhwaccels_all=$(sed -n 's/^[^#]*HWACCEL.*(.*, *\(.*\)).*/\1_hwaccel/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]')
555 # Disable all hardware accelerators for now.
556 _libavhwaccels=
557 _libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
558 _libavdemuxers=$(echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/AVISYNTH_DEMUXER//)
559 _libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
560 _libavmuxers=$(echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER// -e s/RTSP_MUXER//)
561 _libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]')
562 _libavprotocols=$_libavprotocols_all
563 _libavcodec_so=auto
564 _libavformat_a=auto
565 _libavformat_so=auto
566 _libpostproc_a=auto
567 _libpostproc_so=auto
568 _libswscale_a=auto
569 _libswscale_so=auto
570 _libavcodec_mpegaudio_hp=yes
571 _mencoder=yes
572 _mplayer=yes
573 _x11=auto
574 _xshape=auto
575 _xss=auto
576 _dga1=auto
577 _dga2=auto
578 _xv=auto
579 _xvmc=no #auto when complete
580 _vdpau=auto
581 _sdl=auto
582 _kva=auto
583 _direct3d=auto
584 _directx=auto
585 _win32waveout=auto
586 _nas=auto
587 _png=auto
588 _mng=auto
589 _jpeg=auto
590 _pnm=yes
591 _md5sum=yes
592 _yuv4mpeg=yes
593 _gif=auto
594 _gl=auto
595 matrixview=yes
596 _ggi=auto
597 _ggiwmh=auto
598 _aa=auto
599 _caca=auto
600 _svga=auto
601 _vesa=auto
602 _fbdev=auto
603 _dvb=auto
604 _dxr2=auto
605 _dxr3=auto
606 _ivtv=auto
607 _v4l2=auto
608 _iconv=auto
609 _langinfo=auto
610 _rtc=auto
611 _ossaudio=auto
612 _arts=auto
613 _esd=auto
614 _pulse=auto
615 _jack=auto
616 _kai=auto
617 _dart=auto
618 _openal=auto
619 _libcdio=auto
620 _liblzo=auto
621 _mad=auto
622 _mp3lame=auto
623 _mp3lame_lavc=auto
624 _toolame=auto
625 _twolame=auto
626 _tremor=auto
627 _tremor_internal=yes
628 _tremor_low=no
629 _libvorbis=auto
630 _speex=auto
631 _theora=auto
632 _mp3lib=auto
633 _liba52=auto
634 _liba52_internal=no
635 _libdca=auto
636 _libmpeg2=auto
637 _faad=auto
638 _faad_internal=auto
639 _faad_fixed=no
640 _faac=auto
641 _faac_lavc=auto
642 _ladspa=auto
643 _libbs2b=auto
644 _xmms=no
645 _vcd=auto
646 _dvdnav=auto
647 _dvdnavconfig=dvdnav-config
648 _dvdreadconfig=dvdread-config
649 _dvdread=auto
650 _dvdread_internal=auto
651 _libdvdcss_internal=auto
652 _xanim=auto
653 _real=auto
654 _live=auto
655 _nemesi=auto
656 _native_rtsp=yes
657 _xinerama=auto
658 _mga=auto
659 _xmga=auto
660 _vm=auto
661 _xf86keysym=auto
662 _mlib=no #broken, thus disabled
663 _sgiaudio=auto
664 _sunaudio=auto
665 _alsa=auto
666 _fastmemcpy=yes
667 hardcoded_tables=no
668 _unrar_exec=auto
669 _win32dll=auto
670 _select=yes
671 _radio=no
672 _radio_capture=no
673 _radio_v4l=auto
674 _radio_v4l2=auto
675 _radio_bsdbt848=auto
676 _tv=yes
677 _tv_v4l1=auto
678 _tv_v4l2=auto
679 _tv_bsdbt848=auto
680 _tv_dshow=auto
681 _pvr=auto
682 _network=yes
683 _winsock2_h=auto
684 _struct_addrinfo=auto
685 _getaddrinfo=auto
686 _struct_sockaddr_storage=auto
687 _smb=auto
688 _vidix=auto
689 _vidix_pcidb=yes
690 _dhahelper=no
691 _svgalib_helper=no
692 _joystick=no
693 _xvid=auto
694 _xvid_lavc=auto
695 _x264=auto
696 _x264_lavc=auto
697 _libdirac_lavc=auto
698 _libschroedinger_lavc=auto
699 _libnut=auto
700 _lirc=auto
701 _lircc=auto
702 _apple_remote=auto
703 _apple_ir=auto
704 _gui=no
705 _gtk1=no
706 _termcap=auto
707 _termios=auto
708 _3dfx=no
709 _s3fb=no
710 _wii=no
711 _tdfxfb=no
712 _tdfxvid=no
713 _xvr100=auto
714 _tga=yes
715 _directfb=auto
716 _zr=auto
717 _bl=no
718 _largefiles=yes
719 #language=en
720 _shm=auto
721 _linux_devfs=no
722 _charset="UTF-8"
723 _dynamic_plugins=no
724 _crash_debug=no
725 _sighandler=yes
726 _libdv=auto
727 _cdparanoia=auto
728 _cddb=auto
729 _big_endian=auto
730 _bitmap_font=yes
731 _freetype=auto
732 _fontconfig=auto
733 _menu=no
734 _qtx=auto
735 _maemo=auto
736 _coreaudio=auto
737 _corevideo=auto
738 _quartz=auto
739 quicktime=auto
740 _macosx_finder=no
741 _macosx_bundle=auto
742 _sortsub=yes
743 _freetypeconfig='freetype-config'
744 _fribidi=auto
745 _fribidiconfig='fribidi-config'
746 _enca=auto
747 _inet6=auto
748 _gethostbyname2=auto
749 _ftp=yes
750 _musepack=auto
751 _vstream=auto
752 _pthreads=auto
753 _w32threads=auto
754 _ass=auto
755 ass_internal=yes
756 _rpath=no
757 _asmalign_pot=auto
758 _stream_cache=yes
759 _priority=no
760 def_dos_paths="#define HAVE_DOS_PATHS 0"
761 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
762 def_priority="#undef CONFIG_PRIORITY"
763 def_pthread_cache="#undef PTHREAD_CACHE"
764 _need_shmem=yes
765 for ac_option do
766 case "$ac_option" in
767 --help|-help|-h)
768 show_help
770 --prefix=*)
771 _prefix=$(echo $ac_option | cut -d '=' -f 2)
773 --bindir=*)
774 _bindir=$(echo $ac_option | cut -d '=' -f 2)
776 --datadir=*)
777 _datadir=$(echo $ac_option | cut -d '=' -f 2)
779 --mandir=*)
780 _mandir=$(echo $ac_option | cut -d '=' -f 2)
782 --confdir=*)
783 _confdir=$(echo $ac_option | cut -d '=' -f 2)
785 --libdir=*)
786 _libdir=$(echo $ac_option | cut -d '=' -f 2)
788 --codecsdir=*)
789 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
792 --with-install=*)
793 _install=$(echo $ac_option | cut -d '=' -f 2 )
795 --with-xvmclib=*)
796 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
799 --with-sdl-config=*)
800 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
802 --with-freetype-config=*)
803 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
805 --with-fribidi-config=*)
806 _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2)
808 --with-gtk-config=*)
809 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
811 --with-glib-config=*)
812 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
814 --with-dvdnav-config=*)
815 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
817 --with-dvdread-config=*)
818 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
821 --extra-cflags=*)
822 extra_cflags=$(echo $ac_option | cut -d '=' -f 2-)
824 --extra-ldflags=*)
825 extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-)
827 --extra-libs=*)
828 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
830 --extra-libs-mplayer=*)
831 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
833 --extra-libs-mencoder=*)
834 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
837 --target=*)
838 _target=$(echo $ac_option | cut -d '=' -f 2)
840 --cc=*)
841 _cc=$(echo $ac_option | cut -d '=' -f 2)
843 --host-cc=*)
844 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
846 --as=*)
847 _as=$(echo $ac_option | cut -d '=' -f 2)
849 --nm=*)
850 _nm=$(echo $ac_option | cut -d '=' -f 2)
852 --yasm=*)
853 _yasm=$(echo $ac_option | cut -d '=' -f 2)
855 --ar=*)
856 _ar=$(echo $ac_option | cut -d '=' -f 2)
858 --ranlib=*)
859 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
861 --windres=*)
862 _windres=$(echo $ac_option | cut -d '=' -f 2)
864 --charset=*)
865 _charset=$(echo $ac_option | cut -d '=' -f 2)
867 --language-doc=*)
868 language_doc=$(echo $ac_option | cut -d '=' -f 2)
870 --language-man=*)
871 language_man=$(echo $ac_option | cut -d '=' -f 2)
873 --language-msg=*)
874 language_msg=$(echo $ac_option | cut -d '=' -f 2)
876 --language=*)
877 language=$(echo $ac_option | cut -d '=' -f 2)
880 --enable-static)
881 _ld_static='-static'
883 --disable-static)
884 _ld_static=''
886 --enable-profile)
887 _profile='-p'
889 --disable-profile)
890 _profile=
892 --enable-debug)
893 _debug='-g'
895 --enable-debug=*)
896 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
898 --disable-debug)
899 _debug=
901 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
902 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
903 --enable-cross-compile) _cross_compile=yes ;;
904 --disable-cross-compile) _cross_compile=no ;;
905 --enable-mencoder) _mencoder=yes ;;
906 --disable-mencoder) _mencoder=no ;;
907 --enable-mplayer) _mplayer=yes ;;
908 --disable-mplayer) _mplayer=no ;;
909 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
910 --disable-dynamic-plugins) _dynamic_plugins=no ;;
911 --enable-x11) _x11=yes ;;
912 --disable-x11) _x11=no ;;
913 --enable-xshape) _xshape=yes ;;
914 --disable-xshape) _xshape=no ;;
915 --enable-xss) _xss=yes ;;
916 --disable-xss) _xss=no ;;
917 --enable-xv) _xv=yes ;;
918 --disable-xv) _xv=no ;;
919 --enable-xvmc) _xvmc=yes ;;
920 --disable-xvmc) _xvmc=no ;;
921 --enable-vdpau) _vdpau=yes ;;
922 --disable-vdpau) _vdpau=no ;;
923 --enable-sdl) _sdl=yes ;;
924 --disable-sdl) _sdl=no ;;
925 --enable-kva) _kva=yes ;;
926 --disable-kva) _kva=no ;;
927 --enable-direct3d) _direct3d=yes ;;
928 --disable-direct3d) _direct3d=no ;;
929 --enable-directx) _directx=yes ;;
930 --disable-directx) _directx=no ;;
931 --enable-win32waveout) _win32waveout=yes ;;
932 --disable-win32waveout) _win32waveout=no ;;
933 --enable-nas) _nas=yes ;;
934 --disable-nas) _nas=no ;;
935 --enable-png) _png=yes ;;
936 --disable-png) _png=no ;;
937 --enable-mng) _mng=yes ;;
938 --disable-mng) _mng=no ;;
939 --enable-jpeg) _jpeg=yes ;;
940 --disable-jpeg) _jpeg=no ;;
941 --enable-libopenjpeg) libopenjpeg=yes ;;
942 --disable-libopenjpeg)libopenjpeg=no ;;
943 --enable-pnm) _pnm=yes ;;
944 --disable-pnm) _pnm=no ;;
945 --enable-md5sum) _md5sum=yes ;;
946 --disable-md5sum) _md5sum=no ;;
947 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
948 --disable-yuv4mpeg) _yuv4mpeg=no ;;
949 --enable-gif) _gif=yes ;;
950 --disable-gif) _gif=no ;;
951 --enable-gl) _gl=yes ;;
952 --disable-gl) _gl=no ;;
953 --enable-matrixview) matrixview=yes ;;
954 --disable-matrixview) matrixview=no ;;
955 --enable-ggi) _ggi=yes ;;
956 --disable-ggi) _ggi=no ;;
957 --enable-ggiwmh) _ggiwmh=yes ;;
958 --disable-ggiwmh) _ggiwmh=no ;;
959 --enable-aa) _aa=yes ;;
960 --disable-aa) _aa=no ;;
961 --enable-caca) _caca=yes ;;
962 --disable-caca) _caca=no ;;
963 --enable-svga) _svga=yes ;;
964 --disable-svga) _svga=no ;;
965 --enable-vesa) _vesa=yes ;;
966 --disable-vesa) _vesa=no ;;
967 --enable-fbdev) _fbdev=yes ;;
968 --disable-fbdev) _fbdev=no ;;
969 --enable-dvb) _dvb=yes ;;
970 --disable-dvb) _dvb=no ;;
971 --enable-dxr2) _dxr2=yes ;;
972 --disable-dxr2) _dxr2=no ;;
973 --enable-dxr3) _dxr3=yes ;;
974 --disable-dxr3) _dxr3=no ;;
975 --enable-ivtv) _ivtv=yes ;;
976 --disable-ivtv) _ivtv=no ;;
977 --enable-v4l2) _v4l2=yes ;;
978 --disable-v4l2) _v4l2=no ;;
979 --enable-iconv) _iconv=yes ;;
980 --disable-iconv) _iconv=no ;;
981 --enable-langinfo) _langinfo=yes ;;
982 --disable-langinfo) _langinfo=no ;;
983 --enable-rtc) _rtc=yes ;;
984 --disable-rtc) _rtc=no ;;
985 --enable-libdv) _libdv=yes ;;
986 --disable-libdv) _libdv=no ;;
987 --enable-ossaudio) _ossaudio=yes ;;
988 --disable-ossaudio) _ossaudio=no ;;
989 --enable-arts) _arts=yes ;;
990 --disable-arts) _arts=no ;;
991 --enable-esd) _esd=yes ;;
992 --disable-esd) _esd=no ;;
993 --enable-pulse) _pulse=yes ;;
994 --disable-pulse) _pulse=no ;;
995 --enable-jack) _jack=yes ;;
996 --disable-jack) _jack=no ;;
997 --enable-openal) _openal=yes ;;
998 --disable-openal) _openal=no ;;
999 --enable-kai) _kai=yes ;;
1000 --disable-kai) _kai=no ;;
1001 --enable-dart) _dart=yes ;;
1002 --disable-dart) _dart=no ;;
1003 --enable-mad) _mad=yes ;;
1004 --disable-mad) _mad=no ;;
1005 --enable-mp3lame) _mp3lame=yes ;;
1006 --disable-mp3lame) _mp3lame=no ;;
1007 --enable-mp3lame-lavc) _mp3lame_lavc=yes ;;
1008 --disable-mp3lame-lavc) _mp3lame_lavc=no ;;
1009 --enable-toolame) _toolame=yes ;;
1010 --disable-toolame) _toolame=no ;;
1011 --enable-twolame) _twolame=yes ;;
1012 --disable-twolame) _twolame=no ;;
1013 --enable-libcdio) _libcdio=yes ;;
1014 --disable-libcdio) _libcdio=no ;;
1015 --enable-liblzo) _liblzo=yes ;;
1016 --disable-liblzo) _liblzo=no ;;
1017 --enable-libvorbis) _libvorbis=yes ;;
1018 --disable-libvorbis) _libvorbis=no ;;
1019 --enable-speex) _speex=yes ;;
1020 --disable-speex) _speex=no ;;
1021 --enable-tremor) _tremor=yes ;;
1022 --disable-tremor) _tremor=no ;;
1023 --enable-tremor-internal) _tremor_internal=yes ;;
1024 --disable-tremor-internal) _tremor_internal=no ;;
1025 --enable-tremor-low) _tremor_low=yes ;;
1026 --disable-tremor-low) _tremor_low=no ;;
1027 --enable-theora) _theora=yes ;;
1028 --disable-theora) _theora=no ;;
1029 --enable-mp3lib) _mp3lib=yes ;;
1030 --disable-mp3lib) _mp3lib=no ;;
1031 --enable-liba52-internal) _liba52_internal=yes ;;
1032 --disable-liba52-internal) _liba52_internal=no ;;
1033 --enable-liba52) _liba52=yes ;;
1034 --disable-liba52) _liba52=no ;;
1035 --enable-libdca) _libdca=yes ;;
1036 --disable-libdca) _libdca=no ;;
1037 --enable-libmpeg2) _libmpeg2=yes ;;
1038 --disable-libmpeg2) _libmpeg2=no ;;
1039 --enable-musepack) _musepack=yes ;;
1040 --disable-musepack) _musepack=no ;;
1041 --enable-faad) _faad=yes ;;
1042 --disable-faad) _faad=no ;;
1043 --enable-faad-internal) _faad_internal=yes ;;
1044 --disable-faad-internal) _faad_internal=no ;;
1045 --enable-faad-fixed) _faad_fixed=yes ;;
1046 --disable-faad-fixed) _faad_fixed=no ;;
1047 --enable-faac) _faac=yes ;;
1048 --disable-faac) _faac=no ;;
1049 --enable-faac-lavc) _faac_lavc=yes ;;
1050 --disable-faac-lavc) _faac_lavc=no ;;
1051 --enable-ladspa) _ladspa=yes ;;
1052 --disable-ladspa) _ladspa=no ;;
1053 --enable-libbs2b) _libbs2b=yes ;;
1054 --disable-libbs2b) _libbs2b=no ;;
1055 --enable-xmms) _xmms=yes ;;
1056 --disable-xmms) _xmms=no ;;
1057 --enable-vcd) _vcd=yes ;;
1058 --disable-vcd) _vcd=no ;;
1059 --enable-dvdread) _dvdread=yes ;;
1060 --disable-dvdread) _dvdread=no ;;
1061 --enable-dvdread-internal) _dvdread_internal=yes ;;
1062 --disable-dvdread-internal) _dvdread_internal=no ;;
1063 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1064 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1065 --enable-dvdnav) _dvdnav=yes ;;
1066 --disable-dvdnav) _dvdnav=no ;;
1067 --enable-xanim) _xanim=yes ;;
1068 --disable-xanim) _xanim=no ;;
1069 --enable-real) _real=yes ;;
1070 --disable-real) _real=no ;;
1071 --enable-live) _live=yes ;;
1072 --disable-live) _live=no ;;
1073 --enable-nemesi) _nemesi=yes ;;
1074 --disable-nemesi) _nemesi=no ;;
1075 --enable-xinerama) _xinerama=yes ;;
1076 --disable-xinerama) _xinerama=no ;;
1077 --enable-mga) _mga=yes ;;
1078 --disable-mga) _mga=no ;;
1079 --enable-xmga) _xmga=yes ;;
1080 --disable-xmga) _xmga=no ;;
1081 --enable-vm) _vm=yes ;;
1082 --disable-vm) _vm=no ;;
1083 --enable-xf86keysym) _xf86keysym=yes ;;
1084 --disable-xf86keysym) _xf86keysym=no ;;
1085 --enable-mlib) _mlib=yes ;;
1086 --disable-mlib) _mlib=no ;;
1087 --enable-sunaudio) _sunaudio=yes ;;
1088 --disable-sunaudio) _sunaudio=no ;;
1089 --enable-sgiaudio) _sgiaudio=yes ;;
1090 --disable-sgiaudio) _sgiaudio=no ;;
1091 --enable-alsa) _alsa=yes ;;
1092 --disable-alsa) _alsa=no ;;
1093 --enable-tv) _tv=yes ;;
1094 --disable-tv) _tv=no ;;
1095 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1096 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1097 --enable-tv-v4l1) _tv_v4l1=yes ;;
1098 --disable-tv-v4l1) _tv_v4l1=no ;;
1099 --enable-tv-v4l2) _tv_v4l2=yes ;;
1100 --disable-tv-v4l2) _tv_v4l2=no ;;
1101 --enable-tv-dshow) _tv_dshow=yes ;;
1102 --disable-tv-dshow) _tv_dshow=no ;;
1103 --enable-radio) _radio=yes ;;
1104 --enable-radio-capture) _radio_capture=yes ;;
1105 --disable-radio-capture) _radio_capture=no ;;
1106 --disable-radio) _radio=no ;;
1107 --enable-radio-v4l) _radio_v4l=yes ;;
1108 --disable-radio-v4l) _radio_v4l=no ;;
1109 --enable-radio-v4l2) _radio_v4l2=yes ;;
1110 --disable-radio-v4l2) _radio_v4l2=no ;;
1111 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1112 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1113 --enable-pvr) _pvr=yes ;;
1114 --disable-pvr) _pvr=no ;;
1115 --enable-fastmemcpy) _fastmemcpy=yes ;;
1116 --disable-fastmemcpy) _fastmemcpy=no ;;
1117 --enable-hardcoded-tables) hardcoded_tables=yes ;;
1118 --disable-hardcoded-tables) hardcoded_tables=no ;;
1119 --enable-network) _network=yes ;;
1120 --disable-network) _network=no ;;
1121 --enable-winsock2_h) _winsock2_h=yes ;;
1122 --disable-winsock2_h) _winsock2_h=no ;;
1123 --enable-smb) _smb=yes ;;
1124 --disable-smb) _smb=no ;;
1125 --enable-vidix) _vidix=yes ;;
1126 --disable-vidix) _vidix=no ;;
1127 --with-vidix-drivers=*)
1128 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1130 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1131 --enable-dhahelper) _dhahelper=yes ;;
1132 --disable-dhahelper) _dhahelper=no ;;
1133 --enable-svgalib_helper) _svgalib_helper=yes ;;
1134 --disable-svgalib_helper) _svgalib_helper=no ;;
1135 --enable-joystick) _joystick=yes ;;
1136 --disable-joystick) _joystick=no ;;
1137 --enable-xvid) _xvid=yes ;;
1138 --disable-xvid) _xvid=no ;;
1139 --enable-xvid-lavc) _xvid_lavc=yes ;;
1140 --disable-xvid-lavc) _xvid_lavc=no ;;
1141 --enable-x264) _x264=yes ;;
1142 --disable-x264) _x264=no ;;
1143 --enable-x264-lavc) _x264_lavc=yes ;;
1144 --disable-x264-lavc) _x264_lavc=no ;;
1145 --enable-libdirac-lavc) _libdirac_lavc=yes ;;
1146 --disable-libdirac-lavc) _libdirac_lavc=no ;;
1147 --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;;
1148 --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;;
1149 --enable-libnut) _libnut=yes ;;
1150 --disable-libnut) _libnut=no ;;
1151 --enable-libavutil_a) _libavutil_a=yes ;;
1152 --disable-libavutil_a) _libavutil_a=no ;;
1153 --enable-libavutil_so) _libavutil_so=yes ;;
1154 --disable-libavutil_so) _libavutil_so=no ;;
1155 --enable-libavcodec_a) _libavcodec_a=yes ;;
1156 --disable-libavcodec_a) _libavcodec_a=no ;;
1157 --enable-libavcodec_so) _libavcodec_so=yes ;;
1158 --disable-libavcodec_so) _libavcodec_so=no ;;
1159 --enable-libopencore_amrnb) _libopencore_amrnb=yes ;;
1160 --disable-libopencore_amrnb) _libopencore_amrnb=no ;;
1161 --enable-libopencore_amrwb) _libopencore_amrwb=yes ;;
1162 --disable-libopencore_amrwb) _libopencore_amrwb=no ;;
1163 --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1164 --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1165 --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1166 --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1167 --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1168 --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1169 --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1170 --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1171 --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1172 --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1173 --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;;
1174 --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;;
1175 --enable-libavformat_a) _libavformat_a=yes ;;
1176 --disable-libavformat_a) _libavformat_a=no ;;
1177 --enable-libavformat_so) _libavformat_so=yes ;;
1178 --disable-libavformat_so) _libavformat_so=no ;;
1179 --enable-libpostproc_a) _libpostproc_a=yes ;;
1180 --disable-libpostproc_a) _libpostproc_a=no ;;
1181 --enable-libpostproc_so) _libpostproc_so=yes ;;
1182 --disable-libpostproc_so) _libpostproc_so=no ;;
1183 --enable-libswscale_a) _libswscale_a=yes ;;
1184 --disable-libswscale_a) _libswscale_a=no ;;
1185 --enable-libswscale_so) _libswscale_so=yes ;;
1186 --disable-libswscale_so) _libswscale_so=no ;;
1187 --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;;
1188 --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;;
1190 --enable-lirc) _lirc=yes ;;
1191 --disable-lirc) _lirc=no ;;
1192 --enable-lircc) _lircc=yes ;;
1193 --disable-lircc) _lircc=no ;;
1194 --enable-apple-remote) _apple_remote=yes ;;
1195 --disable-apple-remote) _apple_remote=no ;;
1196 --enable-apple-ir) _apple_ir=yes ;;
1197 --disable-apple-ir) _apple_ir=no ;;
1198 --enable-gui) _gui=yes ;;
1199 --disable-gui) _gui=no ;;
1200 --enable-gtk1) _gtk1=yes ;;
1201 --disable-gtk1) _gtk1=no ;;
1202 --enable-termcap) _termcap=yes ;;
1203 --disable-termcap) _termcap=no ;;
1204 --enable-termios) _termios=yes ;;
1205 --disable-termios) _termios=no ;;
1206 --enable-3dfx) _3dfx=yes ;;
1207 --disable-3dfx) _3dfx=no ;;
1208 --enable-s3fb) _s3fb=yes ;;
1209 --disable-s3fb) _s3fb=no ;;
1210 --enable-wii) _wii=yes ;;
1211 --disable-wii) _wii=no ;;
1212 --enable-tdfxfb) _tdfxfb=yes ;;
1213 --disable-tdfxfb) _tdfxfb=no ;;
1214 --disable-tdfxvid) _tdfxvid=no ;;
1215 --enable-tdfxvid) _tdfxvid=yes ;;
1216 --disable-xvr100) _xvr100=no ;;
1217 --enable-xvr100) _xvr100=yes ;;
1218 --disable-tga) _tga=no ;;
1219 --enable-tga) _tga=yes ;;
1220 --enable-directfb) _directfb=yes ;;
1221 --disable-directfb) _directfb=no ;;
1222 --enable-zr) _zr=yes ;;
1223 --disable-zr) _zr=no ;;
1224 --enable-bl) _bl=yes ;;
1225 --disable-bl) _bl=no ;;
1226 --enable-mtrr) _mtrr=yes ;;
1227 --disable-mtrr) _mtrr=no ;;
1228 --enable-largefiles) _largefiles=yes ;;
1229 --disable-largefiles) _largefiles=no ;;
1230 --enable-shm) _shm=yes ;;
1231 --disable-shm) _shm=no ;;
1232 --enable-select) _select=yes ;;
1233 --disable-select) _select=no ;;
1234 --enable-linux-devfs) _linux_devfs=yes ;;
1235 --disable-linux-devfs) _linux_devfs=no ;;
1236 --enable-cdparanoia) _cdparanoia=yes ;;
1237 --disable-cdparanoia) _cdparanoia=no ;;
1238 --enable-cddb) _cddb=yes ;;
1239 --disable-cddb) _cddb=no ;;
1240 --enable-big-endian) _big_endian=yes ;;
1241 --disable-big-endian) _big_endian=no ;;
1242 --enable-bitmap-font) _bitmap_font=yes ;;
1243 --disable-bitmap-font) _bitmap_font=no ;;
1244 --enable-freetype) _freetype=yes ;;
1245 --disable-freetype) _freetype=no ;;
1246 --enable-fontconfig) _fontconfig=yes ;;
1247 --disable-fontconfig) _fontconfig=no ;;
1248 --enable-unrarexec) _unrar_exec=yes ;;
1249 --disable-unrarexec) _unrar_exec=no ;;
1250 --enable-ftp) _ftp=yes ;;
1251 --disable-ftp) _ftp=no ;;
1252 --enable-vstream) _vstream=yes ;;
1253 --disable-vstream) _vstream=no ;;
1254 --enable-pthreads) _pthreads=yes ;;
1255 --disable-pthreads) _pthreads=no ;;
1256 --enable-w32threads) _w32threads=yes ;;
1257 --disable-w32threads) _w32threads=no ;;
1258 --enable-ass) _ass=yes ;;
1259 --disable-ass) _ass=no ;;
1260 --enable-ass-internal) ass_internal=yes ;;
1261 --disable-ass-internal) ass_internal=no ;;
1262 --enable-rpath) _rpath=yes ;;
1263 --disable-rpath) _rpath=no ;;
1265 --enable-fribidi) _fribidi=yes ;;
1266 --disable-fribidi) _fribidi=no ;;
1268 --enable-enca) _enca=yes ;;
1269 --disable-enca) _enca=no ;;
1271 --enable-inet6) _inet6=yes ;;
1272 --disable-inet6) _inet6=no ;;
1274 --enable-gethostbyname2) _gethostbyname2=yes ;;
1275 --disable-gethostbyname2) _gethostbyname2=no ;;
1277 --enable-dga1) _dga1=yes ;;
1278 --disable-dga1) _dga1=no ;;
1279 --enable-dga2) _dga2=yes ;;
1280 --disable-dga2) _dga2=no ;;
1282 --enable-menu) _menu=yes ;;
1283 --disable-menu) _menu=no ;;
1285 --enable-qtx) _qtx=yes ;;
1286 --disable-qtx) _qtx=no ;;
1288 --enable-coreaudio) _coreaudio=yes ;;
1289 --disable-coreaudio) _coreaudio=no ;;
1290 --enable-corevideo) _corevideo=yes ;;
1291 --disable-corevideo) _corevideo=no ;;
1292 --enable-quartz) _quartz=yes ;;
1293 --disable-quartz) _quartz=no ;;
1294 --enable-macosx-finder) _macosx_finder=yes ;;
1295 --disable-macosx-finder) _macosx_finder=no ;;
1296 --enable-macosx-bundle) _macosx_bundle=yes ;;
1297 --disable-macosx-bundle) _macosx_bundle=no ;;
1299 --enable-maemo) _maemo=yes ;;
1300 --disable-maemo) _maemo=no ;;
1302 --enable-sortsub) _sortsub=yes ;;
1303 --disable-sortsub) _sortsub=no ;;
1305 --enable-crash-debug) _crash_debug=yes ;;
1306 --disable-crash-debug) _crash_debug=no ;;
1307 --enable-sighandler) _sighandler=yes ;;
1308 --disable-sighandler) _sighandler=no ;;
1309 --enable-win32dll) _win32dll=yes ;;
1310 --disable-win32dll) _win32dll=no ;;
1312 --enable-sse) _sse=yes ;;
1313 --disable-sse) _sse=no ;;
1314 --enable-sse2) _sse2=yes ;;
1315 --disable-sse2) _sse2=no ;;
1316 --enable-ssse3) _ssse3=yes ;;
1317 --disable-ssse3) _ssse3=no ;;
1318 --enable-mmxext) _mmxext=yes ;;
1319 --disable-mmxext) _mmxext=no ;;
1320 --enable-3dnow) _3dnow=yes ;;
1321 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1322 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1323 --disable-3dnowext) _3dnowext=no ;;
1324 --enable-cmov) _cmov=yes ;;
1325 --disable-cmov) _cmov=no ;;
1326 --enable-fast-cmov) _fast_cmov=yes ;;
1327 --disable-fast-cmov) _fast_cmov=no ;;
1328 --enable-fast-clz) _fast_clz=yes ;;
1329 --disable-fast-clz) _fast_clz=no ;;
1330 --enable-altivec) _altivec=yes ;;
1331 --disable-altivec) _altivec=no ;;
1332 --enable-armv5te) _armv5te=yes ;;
1333 --disable-armv5te) _armv5te=no ;;
1334 --enable-armv6) _armv6=yes ;;
1335 --disable-armv6) _armv6=no ;;
1336 --enable-armv6t2) _armv6t2=yes ;;
1337 --disable-armv6t2) _armv6t2=no ;;
1338 --enable-armvfp) _armvfp=yes ;;
1339 --disable-armvfp) _armvfp=no ;;
1340 --enable-neon) neon=yes ;;
1341 --disable-neon) neon=no ;;
1342 --enable-iwmmxt) _iwmmxt=yes ;;
1343 --disable-iwmmxt) _iwmmxt=no ;;
1344 --enable-mmx) _mmx=yes ;;
1345 --disable-mmx) # 3Dnow! and MMX2 require MMX
1346 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1349 echo "Unknown parameter: $ac_option"
1350 exit 1
1353 esac
1354 done
1356 # Atmos: moved this here, to be correct, if --prefix is specified
1357 test -z "$_bindir" && _bindir="$_prefix/bin"
1358 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1359 test -z "$_mandir" && _mandir="$_prefix/share/man"
1360 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1361 test -z "$_libdir" && _libdir="$_prefix/lib"
1363 # Determine our OS name and CPU architecture
1364 if test -z "$_target" ; then
1365 # OS name
1366 system_name=$(uname -s 2>&1)
1367 case "$system_name" in
1368 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1370 Haiku)
1371 system_name=BeOS
1373 IRIX*)
1374 system_name=IRIX
1376 GNU/kFreeBSD)
1377 system_name=FreeBSD
1379 HP-UX*)
1380 system_name=HP-UX
1382 [cC][yY][gG][wW][iI][nN]*)
1383 system_name=CYGWIN
1385 MINGW32*)
1386 system_name=MINGW32
1388 OS/2*)
1389 system_name=OS/2
1392 system_name="$system_name-UNKNOWN"
1394 esac
1397 # host's CPU/instruction set
1398 host_arch=$(uname -p 2>&1)
1399 case "$host_arch" in
1400 i386|sparc|ppc|alpha|arm|mips|vax)
1402 powerpc) # Darwin returns 'powerpc'
1403 host_arch=ppc
1405 *) # uname -p on Linux returns 'unknown' for the processor type,
1406 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1408 # Maybe uname -m (machine hardware name) returns something we
1409 # recognize.
1411 # x86/x86pc is used by QNX
1412 case "$(uname -m 2>&1)" in
1413 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 ;;
1414 ia64) host_arch=ia64 ;;
1415 macppc|ppc) host_arch=ppc ;;
1416 ppc64) host_arch=ppc64 ;;
1417 alpha) host_arch=alpha ;;
1418 sparc) host_arch=sparc ;;
1419 sparc64) host_arch=sparc64 ;;
1420 parisc*|hppa*|9000*) host_arch=hppa ;;
1421 arm*|zaurus|cats) host_arch=arm ;;
1422 sh3|sh4|sh4a) host_arch=sh ;;
1423 s390) host_arch=s390 ;;
1424 s390x) host_arch=s390x ;;
1425 *mips*) host_arch=mips ;;
1426 vax) host_arch=vax ;;
1427 xtensa*) host_arch=xtensa ;;
1428 *) host_arch=UNKNOWN ;;
1429 esac
1431 esac
1432 else # if test -z "$_target"
1433 system_name=$(echo $_target | cut -d '-' -f 2)
1434 case "$(echo $system_name | tr A-Z a-z)" in
1435 linux) system_name=Linux ;;
1436 freebsd) system_name=FreeBSD ;;
1437 gnu/kfreebsd) system_name=FreeBSD ;;
1438 netbsd) system_name=NetBSD ;;
1439 bsd/os) system_name=BSD/OS ;;
1440 openbsd) system_name=OpenBSD ;;
1441 dragonfly) system_name=DragonFly ;;
1442 sunos) system_name=SunOS ;;
1443 qnx) system_name=QNX ;;
1444 morphos) system_name=MorphOS ;;
1445 amigaos) system_name=AmigaOS ;;
1446 mingw32*) system_name=MINGW32 ;;
1447 esac
1448 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1449 host_arch=$(echo $_target | cut -d '-' -f 1)
1450 if test $(echo $host_arch) != "x86_64" ; then
1451 host_arch=$(echo $host_arch | tr '_' '-')
1455 extra_cflags="-I. $extra_cflags"
1456 _timer=timer-linux.c
1457 _getch=getch2.c
1458 if freebsd ; then
1459 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1460 extra_cflags="$extra_cflags -I/usr/local/include"
1463 if netbsd || dragonfly ; then
1464 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1465 extra_cflags="$extra_cflags -I/usr/pkg/include"
1468 if darwin; then
1469 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1470 _timer=timer-darwin.c
1473 if aix ; then
1474 extra_ldflags="$extra_ldflags -lC"
1477 if irix ; then
1478 _ranlib='ar -r'
1479 elif linux ; then
1480 _ranlib='true'
1483 if win32 ; then
1484 _exesuf=".exe"
1485 extra_cflags="$extra_cflags -fno-common"
1486 # -lwinmm is always needed for osdep/timer-win2.c
1487 extra_ldflags="$extra_ldflags -lwinmm"
1488 _pe_executable=yes
1489 _timer=timer-win2.c
1490 _priority=yes
1491 def_dos_paths="#define HAVE_DOS_PATHS 1"
1492 def_priority="#define CONFIG_PRIORITY 1"
1495 if mingw32 ; then
1496 _getch=getch2-win.c
1497 _need_shmem=no
1500 if amigaos ; then
1501 _select=no
1502 _sighandler=no
1503 _stream_cache=no
1504 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1505 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1508 if qnx ; then
1509 extra_ldflags="$extra_ldflags -lph"
1512 if os2 ; then
1513 _exesuf=".exe"
1514 _getch=getch2-os2.c
1515 _need_shmem=no
1516 _priority=yes
1517 def_dos_paths="#define HAVE_DOS_PATHS 1"
1518 def_priority="#define CONFIG_PRIORITY 1"
1521 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1522 test "$I" && break
1523 done
1526 TMPLOG="configure.log"
1527 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1528 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1529 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1530 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1531 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1533 rm -f "$TMPLOG"
1534 echo configuration: $_configuration > "$TMPLOG"
1535 echo >> "$TMPLOG"
1538 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1539 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1543 # Checking CC version...
1544 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1545 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1546 echocheck "$_cc version"
1547 cc_vendor=intel
1548 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1549 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1550 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1551 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1552 # TODO verify older icc/ecc compatibility
1553 case $cc_version in
1555 cc_version="v. ?.??, bad"
1556 cc_fail=yes
1558 10.1|11.0|11.1)
1559 cc_version="$cc_version, ok"
1562 cc_version="$cc_version, bad"
1563 cc_fail=yes
1565 esac
1566 echores "$cc_version"
1567 else
1568 for _cc in "$_cc" gcc cc ; do
1569 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1570 if test "$cc_name_tmp" = "gcc"; then
1571 cc_name=$cc_name_tmp
1572 echocheck "$_cc version"
1573 cc_vendor=gnu
1574 cc_version=$($_cc -dumpversion 2>&1)
1575 case $cc_version in
1576 2.96*)
1577 cc_fail=yes
1580 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1581 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1582 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1584 esac
1585 echores "$cc_version"
1586 break
1588 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1589 if test "$cc_name_tmp" = "Sun C"; then
1590 echocheck "$_cc version"
1591 cc_vendor=sun
1592 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1593 _res_comment="experimental support only"
1594 echores "Sun C $cc_version"
1595 break
1597 done
1598 fi # icc
1599 test "$cc_fail" = yes && die "unsupported compiler version"
1601 if test -z "$_target" && x86 ; then
1602 cat > $TMPC << EOF
1603 int main(void) {
1604 int test[(int)sizeof(char *)-7];
1605 return 0;
1608 cc_check && host_arch=x86_64 || host_arch=i386
1611 echo "Detected operating system: $system_name"
1612 echo "Detected host architecture: $host_arch"
1614 echocheck "host cc"
1615 test "$_host_cc" || _host_cc=$_cc
1616 echores $_host_cc
1618 echocheck "cross compilation"
1619 if test $_cross_compile = auto ; then
1620 cat > $TMPC << EOF
1621 int main(void) { return 0; }
1623 _cross_compile=yes
1624 cc_check && "$TMPEXE" && _cross_compile=no
1626 echores $_cross_compile
1628 if test $_cross_compile = yes; then
1629 tmp_run() {
1630 return 0
1634 # ---
1636 # now that we know what compiler should be used for compilation, try to find
1637 # out which assembler is used by the $_cc compiler
1638 if test "$_as" = auto ; then
1639 _as=$($_cc -print-prog-name=as)
1640 test -z "$_as" && _as=as
1643 if test "$_nm" = auto ; then
1644 _nm=$($_cc -print-prog-name=nm)
1645 test -z "$_nm" && _nm=nm
1648 # XXX: this should be ok..
1649 _cpuinfo="echo"
1651 if test "$_runtime_cpudetection" = no ; then
1653 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1654 # FIXME: Remove the cygwin check once AMD CPUs are supported
1655 if test -r /proc/cpuinfo && ! cygwin; then
1656 # Linux with /proc mounted, extract CPU information from it
1657 _cpuinfo="cat /proc/cpuinfo"
1658 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1659 # FreeBSD with Linux emulation /proc mounted,
1660 # extract CPU information from it
1661 # Don't use it on x86 though, it never reports 3Dnow
1662 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1663 elif darwin && ! x86 ; then
1664 # use hostinfo on Darwin
1665 _cpuinfo="hostinfo"
1666 elif aix; then
1667 # use 'lsattr' on AIX
1668 _cpuinfo="lsattr -E -l proc0 -a type"
1669 elif x86; then
1670 # all other OSes try to extract CPU information from a small helper
1671 # program cpuinfo instead
1672 $_cc -o cpuinfo$_exesuf cpuinfo.c
1673 _cpuinfo="./cpuinfo$_exesuf"
1676 if x86 ; then
1677 # gather more CPU information
1678 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1679 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1680 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1681 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1682 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1684 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1686 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1687 -e s/xmm/sse/ -e s/kni/sse/)
1689 for ext in $pparam ; do
1690 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1691 done
1693 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1694 test $_sse = kernel_check && _mmxext=kernel_check
1696 echocheck "CPU vendor"
1697 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1699 echocheck "CPU type"
1700 echores "$pname"
1703 fi # test "$_runtime_cpudetection" = no
1705 if x86 && test "$_runtime_cpudetection" = no ; then
1706 extcheck() {
1707 if test "$1" = kernel_check ; then
1708 echocheck "kernel support of $2"
1709 cat > $TMPC <<EOF
1710 #include <stdlib.h>
1711 #include <signal.h>
1712 void catch() { exit(1); }
1713 int main(void) {
1714 signal(SIGILL, catch);
1715 __asm__ volatile ("$3":::"memory"); return 0;
1719 if cc_check && tmp_run ; then
1720 eval _$2=yes
1721 echores "yes"
1722 _optimizing="$_optimizing $2"
1723 return 0
1724 else
1725 eval _$2=no
1726 echores "failed"
1727 echo "It seems that your kernel does not correctly support $2."
1728 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1729 return 1
1732 return 0
1735 extcheck $_mmx "mmx" "emms"
1736 extcheck $_mmxext "mmxext" "sfence"
1737 extcheck $_3dnow "3dnow" "femms"
1738 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1739 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1740 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1741 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1742 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1744 echocheck "mtrr support"
1745 if test "$_mtrr" = kernel_check ; then
1746 _mtrr="yes"
1747 _optimizing="$_optimizing mtrr"
1749 echores "$_mtrr"
1751 if test "$_gcc3_ext" != ""; then
1752 # if we had to disable sse/sse2 because the active kernel does not
1753 # support this instruction set extension, we also have to tell
1754 # gcc3 to not generate sse/sse2 instructions for normal C code
1755 cat > $TMPC << EOF
1756 int main(void) { return 0; }
1758 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1764 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1765 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1766 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0'
1767 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 0'
1768 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1769 subarch_all='X86_32 X86_64 PPC64'
1770 case "$host_arch" in
1771 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1772 arch='x86'
1773 subarch='x86_32'
1774 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1775 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
1776 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
1777 iproc=486
1778 proc=i486
1781 if test "$_runtime_cpudetection" = no ; then
1782 case "$pvendor" in
1783 AuthenticAMD)
1784 case "$pfamily" in
1785 3) proc=i386 iproc=386 ;;
1786 4) proc=i486 iproc=486 ;;
1787 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1788 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1789 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1790 proc=k6-3
1791 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1792 proc=geode
1793 elif test "$pmodel" -ge 8; then
1794 proc=k6-2
1795 elif test "$pmodel" -ge 6; then
1796 proc=k6
1797 else
1798 proc=i586
1801 6) iproc=686
1802 # It's a bit difficult to determine the correct type of Family 6
1803 # AMD CPUs just from their signature. Instead, we check directly
1804 # whether it supports SSE.
1805 if test "$_sse" = yes; then
1806 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1807 proc=athlon-xp
1808 else
1809 # Again, gcc treats athlon and athlon-tbird similarly.
1810 proc=athlon
1813 15) iproc=686
1814 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1815 # caught and remedied in the optimization tests below.
1816 proc=k8
1819 *) proc=amdfam10 iproc=686
1820 test $_fast_clz = "auto" && _fast_clz=yes
1822 esac
1824 GenuineIntel)
1825 case "$pfamily" in
1826 3) proc=i386 iproc=386 ;;
1827 4) proc=i486 iproc=486 ;;
1828 5) iproc=586
1829 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1830 proc=pentium-mmx # 4 is desktop, 8 is mobile
1831 else
1832 proc=i586
1835 6) iproc=686
1836 if test "$pmodel" -ge 15; then
1837 proc=core2
1838 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1839 proc=pentium-m
1840 elif test "$pmodel" -ge 7; then
1841 proc=pentium3
1842 elif test "$pmodel" -ge 3; then
1843 proc=pentium2
1844 else
1845 proc=i686
1847 test $_fast_clz = "auto" && _fast_clz=yes
1849 15) iproc=686
1850 # A nocona in 32-bit mode has no more capabilities than a prescott.
1851 if test "$pmodel" -ge 3; then
1852 proc=prescott
1853 else
1854 proc=pentium4
1855 test $_fast_clz = "auto" && _fast_clz=yes
1857 test $_fast_cmov = "auto" && _fast_cmov=no
1859 *) proc=prescott iproc=686 ;;
1860 esac
1862 CentaurHauls)
1863 case "$pfamily" in
1864 5) iproc=586
1865 if test "$pmodel" -ge 8; then
1866 proc=winchip2
1867 elif test "$pmodel" -ge 4; then
1868 proc=winchip-c6
1869 else
1870 proc=i586
1873 6) iproc=686
1874 if test "$pmodel" -ge 9; then
1875 proc=c3-2
1876 else
1877 proc=c3
1878 iproc=586
1881 *) proc=i686 iproc=i686 ;;
1882 esac
1884 unknown)
1885 case "$pfamily" in
1886 3) proc=i386 iproc=386 ;;
1887 4) proc=i486 iproc=486 ;;
1888 *) proc=i586 iproc=586 ;;
1889 esac
1892 proc=i586 iproc=586 ;;
1893 esac
1894 test $_fast_clz = "auto" && _fast_clz=no
1895 fi # test "$_runtime_cpudetection" = no
1898 # check that gcc supports our CPU, if not, fall back to earlier ones
1899 # LGB: check -mcpu and -march swithing step by step with enabling
1900 # to fall back till 386.
1902 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1904 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1905 cpuopt=-mtune
1906 else
1907 cpuopt=-mcpu
1910 echocheck "GCC & CPU optimization abilities"
1911 cat > $TMPC << EOF
1912 int main(void) { return 0; }
1914 if test "$_runtime_cpudetection" = no ; then
1915 if test $cc_vendor != "intel" ; then
1916 cc_check -march=native && proc=native
1918 if test "$proc" = "k8"; then
1919 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1921 if test "$proc" = "athlon-xp"; then
1922 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1924 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1925 cc_check -march=$proc $cpuopt=$proc || proc=k6
1927 if test "$proc" = "k6" || test "$proc" = "c3"; then
1928 if ! cc_check -march=$proc $cpuopt=$proc; then
1929 if cc_check -march=i586 $cpuopt=i686; then
1930 proc=i586-i686
1931 else
1932 proc=i586
1936 if test "$proc" = "prescott" ; then
1937 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1939 if test "$proc" = "core2" ; then
1940 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1942 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
1943 cc_check -march=$proc $cpuopt=$proc || proc=i686
1945 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1946 cc_check -march=$proc $cpuopt=$proc || proc=i586
1948 if test "$proc" = "i586"; then
1949 cc_check -march=$proc $cpuopt=$proc || proc=i486
1951 if test "$proc" = "i486" ; then
1952 cc_check -march=$proc $cpuopt=$proc || proc=i386
1954 if test "$proc" = "i386" ; then
1955 cc_check -march=$proc $cpuopt=$proc || proc=error
1957 if test "$proc" = "error" ; then
1958 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1959 _mcpu=""
1960 _march=""
1961 _optimizing=""
1962 elif test "$proc" = "i586-i686"; then
1963 _march="-march=i586"
1964 _mcpu="$cpuopt=i686"
1965 _optimizing="$proc"
1966 else
1967 _march="-march=$proc"
1968 _mcpu="$cpuopt=$proc"
1969 _optimizing="$proc"
1971 else # if test "$_runtime_cpudetection" = no
1972 _mcpu="$cpuopt=generic"
1973 # at least i486 required, for bswap instruction
1974 _march="-march=i486"
1975 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1976 cc_check $_mcpu || _mcpu=""
1977 cc_check $_march $_mcpu || _march=""
1980 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1981 ## autodetected mcpu/march parameters
1982 if test "$_target" ; then
1983 # TODO: it may be a good idea to check GCC and fall back in all cases
1984 if test "$host_arch" = "i586-i686"; then
1985 _march="-march=i586"
1986 _mcpu="$cpuopt=i686"
1987 else
1988 _march="-march=$host_arch"
1989 _mcpu="$cpuopt=$host_arch"
1992 proc="$host_arch"
1994 case "$proc" in
1995 i386) iproc=386 ;;
1996 i486) iproc=486 ;;
1997 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1998 i686|athlon*|pentium*) iproc=686 ;;
1999 *) iproc=586 ;;
2000 esac
2003 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
2004 _fast_cmov="yes"
2005 else
2006 _fast_cmov="no"
2008 test $_fast_clz = "auto" && _fast_clz=yes
2010 echores "$proc"
2013 ia64)
2014 arch='ia64'
2015 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2016 iproc='ia64'
2019 x86_64|amd64)
2020 arch='x86'
2021 subarch='x86_64'
2022 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2023 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2024 iproc='x86_64'
2026 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2027 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
2028 cpuopt=-mtune
2029 else
2030 cpuopt=-mcpu
2032 if test "$_runtime_cpudetection" = no ; then
2033 case "$pvendor" in
2034 AuthenticAMD)
2035 case "$pfamily" in
2036 15) proc=k8
2037 test $_fast_clz = "auto" && _fast_clz=no
2039 *) proc=amdfam10;;
2040 esac
2042 GenuineIntel)
2043 case "$pfamily" in
2044 6) proc=core2;;
2046 # 64-bit prescotts exist, but as far as GCC is concerned they
2047 # have the same capabilities as a nocona.
2048 proc=nocona
2049 test $_fast_cmov = "auto" && _fast_cmov=no
2050 test $_fast_clz = "auto" && _fast_clz=no
2052 esac
2055 proc=error;;
2056 esac
2057 fi # test "$_runtime_cpudetection" = no
2059 echocheck "GCC & CPU optimization abilities"
2060 cat > $TMPC << EOF
2061 int main(void) { return 0; }
2063 # This is a stripped-down version of the i386 fallback.
2064 if test "$_runtime_cpudetection" = no ; then
2065 if test $cc_vendor != "intel" ; then
2066 cc_check -march=native && proc=native
2068 # --- AMD processors ---
2069 if test "$proc" = "k8"; then
2070 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2072 # This will fail if gcc version < 3.3, which is ok because earlier
2073 # versions don't really support 64-bit on amd64.
2074 # Is this a valid assumption? -Corey
2075 if test "$proc" = "athlon-xp"; then
2076 cc_check -march=$proc $cpuopt=$proc || proc=error
2078 # --- Intel processors ---
2079 if test "$proc" = "core2"; then
2080 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
2082 if test "$proc" = "x86-64"; then
2083 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2085 if test "$proc" = "nocona"; then
2086 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2088 if test "$proc" = "pentium4"; then
2089 cc_check -march=$proc $cpuopt=$proc || proc=error
2092 _march="-march=$proc"
2093 _mcpu="$cpuopt=$proc"
2094 if test "$proc" = "error" ; then
2095 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2096 _mcpu=""
2097 _march=""
2099 else # if test "$_runtime_cpudetection" = no
2100 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2101 _march="-march=x86-64"
2102 _mcpu="$cpuopt=generic"
2103 cc_check $_mcpu || _mcpu="x86-64"
2104 cc_check $_mcpu || _mcpu=""
2105 cc_check $_march $_mcpu || _march=""
2108 _optimizing="$proc"
2109 test $_fast_cmov = "auto" && _fast_cmov=yes
2110 test $_fast_clz = "auto" && _fast_clz=yes
2112 echores "$proc"
2115 sparc|sparc64)
2116 arch='sparc'
2117 iproc='sparc'
2118 if test "$host_arch" = "sparc64" ; then
2119 _vis='yes'
2120 proc='ultrasparc'
2121 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2122 elif sunos ; then
2123 echocheck "CPU type"
2124 karch=$(uname -m)
2125 case "$(echo $karch)" in
2126 sun4) proc=v7 ;;
2127 sun4c) proc=v7 ;;
2128 sun4d) proc=v8 ;;
2129 sun4m) proc=v8 ;;
2130 sun4u) proc=ultrasparc _vis='yes' ;;
2131 sun4v) proc=v9 ;;
2132 *) proc=v8 ;;
2133 esac
2134 echores "$proc"
2135 else
2136 proc=v8
2138 _mcpu="-mcpu=$proc"
2139 _optimizing="$proc"
2142 arm*)
2143 arch='arm'
2144 iproc='arm'
2147 avr32)
2148 arch='avr32'
2149 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2150 iproc='avr32'
2151 test $_fast_clz = "auto" && _fast_clz=yes
2154 sh|sh4)
2155 arch='sh4'
2156 iproc='sh4'
2159 ppc|ppc64|powerpc|powerpc64)
2160 arch='ppc'
2161 def_dcbzl='#define HAVE_DCBZL 0'
2162 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2163 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
2164 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
2165 iproc='ppc'
2167 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2168 subarch='ppc64'
2169 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2171 echocheck "CPU type"
2172 case $system_name in
2173 Linux)
2174 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2175 if test -n "$($_cpuinfo | grep altivec)"; then
2176 test $_altivec = auto && _altivec=yes
2179 Darwin)
2180 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2181 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2182 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2183 test $_altivec = auto && _altivec=yes
2186 NetBSD)
2187 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2188 case $cc_version in
2189 2*|3.0*|3.1*|3.2*|3.3*)
2192 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2193 test $_altivec = auto && _altivec=yes
2196 esac
2198 AIX)
2199 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2201 esac
2202 if test "$_altivec" = yes; then
2203 echores "$proc altivec"
2204 else
2205 _altivec=no
2206 echores "$proc"
2209 echocheck "GCC & CPU optimization abilities"
2211 if test -n "$proc"; then
2212 case "$proc" in
2213 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2214 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2215 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2216 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2217 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2218 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2219 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2220 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2221 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2222 *) ;;
2223 esac
2224 # gcc 3.1(.1) and up supports 7400 and 7450
2225 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2226 case "$proc" in
2227 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2228 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2229 *) ;;
2230 esac
2232 # gcc 3.2 and up supports 970
2233 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2234 case "$proc" in
2235 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2236 def_dcbzl='#define HAVE_DCBZL 1' ;;
2237 *) ;;
2238 esac
2240 # gcc 3.3 and up supports POWER4
2241 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2242 case "$proc" in
2243 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2244 *) ;;
2245 esac
2247 # gcc 3.4 and up supports 440*
2248 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2249 case "$proc" in
2250 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2251 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2252 *) ;;
2253 esac
2255 # gcc 4.0 and up supports POWER5
2256 if test "$_cc_major" -ge "4"; then
2257 case "$proc" in
2258 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2259 *) ;;
2260 esac
2264 if test -n "$_mcpu"; then
2265 _optimizing=$(echo $_mcpu | cut -c 8-)
2266 echores "$_optimizing"
2267 else
2268 echores "none"
2271 test $_fast_clz = "auto" && _fast_clz=yes
2275 alpha*)
2276 arch='alpha'
2277 iproc='alpha'
2279 echocheck "CPU type"
2280 cat > $TMPC << EOF
2281 int main(void) {
2282 unsigned long ver, mask;
2283 __asm__ ("implver %0" : "=r" (ver));
2284 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2285 printf("%ld-%x\n", ver, ~mask);
2286 return 0;
2289 $_cc -o "$TMPEXE" "$TMPC"
2290 case $("$TMPEXE") in
2292 0-0) proc="ev4"; _mvi="0";;
2293 1-0) proc="ev5"; _mvi="0";;
2294 1-1) proc="ev56"; _mvi="0";;
2295 1-101) proc="pca56"; _mvi="1";;
2296 2-303) proc="ev6"; _mvi="1";;
2297 2-307) proc="ev67"; _mvi="1";;
2298 2-1307) proc="ev68"; _mvi="1";;
2299 esac
2300 echores "$proc"
2302 echocheck "GCC & CPU optimization abilities"
2303 if test "$proc" = "ev68" ; then
2304 cc_check -mcpu=$proc || proc=ev67
2306 if test "$proc" = "ev67" ; then
2307 cc_check -mcpu=$proc || proc=ev6
2309 _mcpu="-mcpu=$proc"
2310 echores "$proc"
2312 test $_fast_clz = "auto" && _fast_clz=yes
2314 _optimizing="$proc"
2317 mips)
2318 arch='mips'
2319 iproc='mips'
2321 if irix ; then
2322 echocheck "CPU type"
2323 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2324 case "$(echo $proc)" in
2325 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2326 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2327 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2328 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2329 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2330 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2331 esac
2332 # gcc < 3.x does not support -mtune.
2333 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2334 _mcpu=''
2336 echores "$proc"
2339 test $_fast_clz = "auto" && _fast_clz=yes
2343 hppa)
2344 arch='pa_risc'
2345 iproc='PA-RISC'
2348 s390)
2349 arch='s390'
2350 iproc='390'
2353 s390x)
2354 arch='s390x'
2355 iproc='390x'
2358 vax)
2359 arch='vax'
2360 iproc='vax'
2363 xtensa)
2364 arch='xtensa'
2365 iproc='xtensa'
2368 generic)
2369 arch='generic'
2373 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2374 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2375 die "unsupported architecture $host_arch"
2377 esac # case "$host_arch" in
2379 if test "$_runtime_cpudetection" = yes ; then
2380 if x86 ; then
2381 test "$_cmov" != no && _cmov=yes
2382 x86_32 && _cmov=no
2383 test "$_mmx" != no && _mmx=yes
2384 test "$_3dnow" != no && _3dnow=yes
2385 test "$_3dnowext" != no && _3dnowext=yes
2386 test "$_mmxext" != no && _mmxext=yes
2387 test "$_sse" != no && _sse=yes
2388 test "$_sse2" != no && _sse2=yes
2389 test "$_ssse3" != no && _ssse3=yes
2390 test "$_mtrr" != no && _mtrr=yes
2392 if ppc; then
2393 _altivec=yes
2398 # endian testing
2399 echocheck "byte order"
2400 if test "$_big_endian" = auto ; then
2401 cat > $TMPC <<EOF
2402 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2403 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2404 int main(void) { return (int)ascii_name; }
2406 if cc_check ; then
2407 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2408 _big_endian=yes
2409 else
2410 _big_endian=no
2412 else
2413 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2416 if test "$_big_endian" = yes ; then
2417 _byte_order='big-endian'
2418 def_words_endian='#define WORDS_BIGENDIAN 1'
2419 def_bigendian='#define HAVE_BIGENDIAN 1'
2420 def_av_bigendian='#define AV_HAVE_BIGENDIAN 1'
2421 else
2422 _byte_order='little-endian'
2423 def_words_endian='#undef WORDS_BIGENDIAN'
2424 def_bigendian='#define HAVE_BIGENDIAN 0'
2425 def_av_bigendian='#define AV_HAVE_BIGENDIAN 0'
2427 echores "$_byte_order"
2430 echocheck "extern symbol prefix"
2431 cat > $TMPC << EOF
2432 int ff_extern;
2434 cc_check -c || die "Symbol mangling check failed."
2435 sym=$($_nm -P -g $TMPEXE)
2436 extern_prefix=${sym%%ff_extern*}
2437 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2438 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2439 echores $extern_prefix
2442 echocheck "assembler support of -pipe option"
2443 cat > $TMPC << EOF
2444 int main(void) { return 0; }
2446 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2447 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2450 echocheck "compiler support of named assembler arguments"
2451 _named_asm_args=yes
2452 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2453 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2454 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2455 _named_asm_args=no
2456 def_named_asm_args="#undef NAMED_ASM_ARGS"
2458 echores $_named_asm_args
2461 if darwin && test "$cc_vendor" = "gnu" ; then
2462 echocheck "GCC support of -mstackrealign"
2463 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2464 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2465 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2466 # wrong code with this flag, but this can be worked around by adding
2467 # -fno-unit-at-a-time as described in the blog post at
2468 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2469 cat > $TMPC << EOF
2470 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2471 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2473 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2474 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2475 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2476 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2477 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2480 # Checking for CFLAGS
2481 _install_strip="-s"
2482 if test "$_profile" != "" || test "$_debug" != "" ; then
2483 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2484 _install_strip=
2485 elif test -z "$CFLAGS" ; then
2486 if test "$cc_vendor" = "intel" ; then
2487 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2488 elif test "$cc_vendor" = "sun" ; then
2489 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2490 elif test "$cc_vendor" != "gnu" ; then
2491 CFLAGS="-O2 $_march $_mcpu $_pipe"
2492 else
2493 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2494 extra_ldflags="$extra_ldflags -ffast-math"
2496 else
2497 _warn_CFLAGS=yes
2500 cat > $TMPC << EOF
2501 int main(void) { return 0; }
2503 if test "$cc_vendor" = "gnu" ; then
2504 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2505 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
2506 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2507 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2508 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2509 cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
2510 cc_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
2511 else
2512 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2515 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2516 cc_check -MD -MP && CFLAGS="-MD -MP $CFLAGS"
2519 if test -n "$LDFLAGS" ; then
2520 extra_ldflags="$extra_ldflags $LDFLAGS"
2521 _warn_CFLAGS=yes
2522 elif test "$cc_vendor" = "intel" ; then
2523 extra_ldflags="$extra_ldflags -i-static"
2525 if test -n "$CPPFLAGS" ; then
2526 extra_cflags="$extra_cflags $CPPFLAGS"
2527 _warn_CFLAGS=yes
2532 if x86_32 ; then
2533 # Checking assembler (_as) compatibility...
2534 # Added workaround for older as that reads from stdin by default - atmos
2535 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2536 echocheck "assembler ($_as $as_version)"
2538 _pref_as_version='2.9.1'
2539 echo 'nop' > $TMPS
2540 if test "$_mmx" = yes ; then
2541 echo 'emms' >> $TMPS
2543 if test "$_3dnow" = yes ; then
2544 _pref_as_version='2.10.1'
2545 echo 'femms' >> $TMPS
2547 if test "$_3dnowext" = yes ; then
2548 _pref_as_version='2.10.1'
2549 echo 'pswapd %mm0, %mm0' >> $TMPS
2551 if test "$_mmxext" = yes ; then
2552 _pref_as_version='2.10.1'
2553 echo 'movntq %mm0, (%eax)' >> $TMPS
2555 if test "$_sse" = yes ; then
2556 _pref_as_version='2.10.1'
2557 echo 'xorps %xmm0, %xmm0' >> $TMPS
2559 #if test "$_sse2" = yes ; then
2560 # _pref_as_version='2.11'
2561 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2563 if test "$_cmov" = yes ; then
2564 _pref_as_version='2.10.1'
2565 echo 'cmovb %eax, %ebx' >> $TMPS
2567 if test "$_ssse3" = yes ; then
2568 _pref_as_version='2.16.92'
2569 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2571 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2573 if test "$as_verc_fail" != yes ; then
2574 echores "ok"
2575 else
2576 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2577 echores "failed"
2578 die "obsolete binutils version"
2581 fi #if x86_32
2583 echocheck ".align is a power of two"
2584 if test "$_asmalign_pot" = auto ; then
2585 _asmalign_pot=no
2586 cat > $TMPC << EOF
2587 int main(void) { __asm__ (".align 3"); return 0; }
2589 cc_check && _asmalign_pot=yes
2591 if test "$_asmalign_pot" = "yes" ; then
2592 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2593 else
2594 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2596 echores $_asmalign_pot
2598 if x86 ; then
2599 echocheck "10 assembler operands"
2600 ten_operands=no
2601 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2602 cat > $TMPC << EOF
2603 int main(void) {
2604 int x=0;
2605 __asm__ volatile(
2607 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2609 return 0;
2612 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2613 echores $ten_operands
2615 echocheck "ebx availability"
2616 ebx_available=no
2617 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2618 cat > $TMPC << EOF
2619 int main(void) {
2620 int x;
2621 __asm__ volatile(
2622 "xor %0, %0"
2623 :"=b"(x)
2624 // just adding ebx to clobber list seems unreliable with some
2625 // compilers, e.g. Haiku's gcc 2.95
2627 // and the above check does not work for OSX 64 bit...
2628 __asm__ volatile("":::"%ebx");
2629 return 0;
2632 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2633 echores $ebx_available
2635 echocheck "PIC"
2636 pic=no
2637 cat > $TMPC << EOF
2638 int main(void) {
2639 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2640 #error PIC not enabled
2641 #endif
2642 return 0;
2645 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2646 echores $pic
2648 echocheck "yasm"
2649 if test -z "$YASMFLAGS" ; then
2650 if darwin ; then
2651 x86_64 && objformat="macho64" || objformat="macho"
2652 elif win32 ; then
2653 objformat="win32"
2654 else
2655 objformat="elf"
2657 # currently tested for Linux x86, x86_64
2658 YASMFLAGS="-f $objformat"
2659 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2660 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2661 case "$objformat" in
2662 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2663 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2664 esac
2665 else
2666 _warn_CFLAGS=yes
2669 echo "pabsw xmm0, xmm0" > $TMPS
2670 yasm_check || _yasm=""
2671 if test $_yasm ; then
2672 def_yasm='#define HAVE_YASM 1'
2673 have_yasm="yes"
2674 echores "$_yasm"
2675 else
2676 def_yasm='#define HAVE_YASM 0'
2677 have_yasm="no"
2678 echores "no"
2681 echocheck "bswap"
2682 def_bswap='#define HAVE_BSWAP 0'
2683 echo 'bswap %eax' > $TMPS
2684 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2685 echores "$bswap"
2686 fi #if x86
2689 #FIXME: This should happen before the check for CFLAGS..
2690 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2691 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2693 # check if AltiVec is supported by the compiler, and how to enable it
2694 echocheck "GCC AltiVec flags"
2695 cat > $TMPC << EOF
2696 int main(void) { return 0; }
2698 if $(cc_check -maltivec -mabi=altivec) ; then
2699 _altivec_gcc_flags="-maltivec -mabi=altivec"
2700 # check if <altivec.h> should be included
2701 cat > $TMPC << EOF
2702 #include <altivec.h>
2703 int main(void) { return 0; }
2705 if $(cc_check $_altivec_gcc_flags) ; then
2706 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2707 inc_altivec_h='#include <altivec.h>'
2708 else
2709 cat > $TMPC << EOF
2710 int main(void) { return 0; }
2712 if $(cc_check -faltivec) ; then
2713 _altivec_gcc_flags="-faltivec"
2714 else
2715 _altivec=no
2716 _altivec_gcc_flags="none, AltiVec disabled"
2720 echores "$_altivec_gcc_flags"
2722 # check if the compiler supports braces for vector declarations
2723 cat > $TMPC << EOF
2724 $inc_altivec_h
2725 int main(void) { (vector int) {1}; return 0; }
2727 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2729 # Disable runtime cpudetection if we cannot generate AltiVec code or
2730 # AltiVec is disabled by the user.
2731 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2732 && _runtime_cpudetection=no
2734 # Show that we are optimizing for AltiVec (if enabled and supported).
2735 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2736 && _optimizing="$_optimizing altivec"
2738 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2739 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2742 if ppc ; then
2743 def_xform_asm='#define HAVE_XFORM_ASM 0'
2744 xform_asm=no
2745 echocheck "XFORM ASM support"
2746 cat > $TMPC << EOF
2747 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2749 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2750 echores "$xform_asm"
2753 if arm ; then
2754 echocheck "ARM pld instruction"
2755 cat > $TMPC << EOF
2756 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2758 pld=no
2759 cc_check && pld=yes
2760 echores "$pld"
2762 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2763 if test $_armv5te = "auto" ; then
2764 cat > $TMPC << EOF
2765 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2767 _armv5te=no
2768 cc_check && _armv5te=yes
2770 echores "$_armv5te"
2772 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2774 echocheck "ARMv6 (SIMD instructions)"
2775 if test $_armv6 = "auto" ; then
2776 cat > $TMPC << EOF
2777 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2779 _armv6=no
2780 cc_check && _armv6=yes
2782 echores "$_armv6"
2784 echocheck "ARMv6t2 (SIMD instructions)"
2785 if test $_armv6t2 = "auto" ; then
2786 cat > $TMPC << EOF
2787 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2789 _armv6t2=no
2790 cc_check && _armv6t2=yes
2792 echores "$_armv6"
2794 echocheck "ARM VFP"
2795 if test $_armvfp = "auto" ; then
2796 cat > $TMPC << EOF
2797 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2799 _armvfp=no
2800 cc_check && _armvfp=yes
2802 echores "$_armvfp"
2804 echocheck "ARM NEON"
2805 if test $neon = "auto" ; then
2806 cat > $TMPC << EOF
2807 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2809 neon=no
2810 cc_check && neon=yes
2812 echores "$neon"
2814 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2815 if test $_iwmmxt = "auto" ; then
2816 cat > $TMPC << EOF
2817 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2819 _iwmmxt=no
2820 cc_check && _iwmmxt=yes
2822 echores "$_iwmmxt"
2825 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'
2826 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2827 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2828 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2829 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2830 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2831 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2832 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2833 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2834 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2835 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2836 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2837 test "$pld" = yes && cpuexts="PLD $cpuexts"
2838 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2839 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2840 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2841 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2842 test "$neon" = yes && cpuexts="NEON $cpuexts"
2843 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2844 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2845 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2847 # Checking kernel version...
2848 if x86_32 && linux ; then
2849 _k_verc_problem=no
2850 kernel_version=$(uname -r 2>&1)
2851 echocheck "$system_name kernel version"
2852 case "$kernel_version" in
2853 '') kernel_version="?.??"; _k_verc_fail=yes;;
2854 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2855 _k_verc_problem=yes;;
2856 esac
2857 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2858 _k_verc_fail=yes
2860 if test "$_k_verc_fail" ; then
2861 echores "$kernel_version, fail"
2862 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2863 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2864 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2865 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2866 echo "2.2.x you must upgrade it to get SSE support!"
2867 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2868 else
2869 echores "$kernel_version, ok"
2873 ######################
2874 # MAIN TESTS GO HERE #
2875 ######################
2878 echocheck "-lposix"
2879 cat > $TMPC <<EOF
2880 int main(void) { return 0; }
2882 if cc_check -lposix ; then
2883 extra_ldflags="$extra_ldflags -lposix"
2884 echores "yes"
2885 else
2886 echores "no"
2889 echocheck "-lm"
2890 cat > $TMPC <<EOF
2891 int main(void) { return 0; }
2893 if cc_check -lm ; then
2894 _ld_lm="-lm"
2895 echores "yes"
2896 else
2897 _ld_lm=""
2898 echores "no"
2902 echocheck "langinfo"
2903 if test "$_langinfo" = auto ; then
2904 cat > $TMPC <<EOF
2905 #include <langinfo.h>
2906 int main(void) { nl_langinfo(CODESET); return 0; }
2908 _langinfo=no
2909 cc_check && _langinfo=yes
2911 if test "$_langinfo" = yes ; then
2912 def_langinfo='#define HAVE_LANGINFO 1'
2913 else
2914 def_langinfo='#undef HAVE_LANGINFO'
2916 echores "$_langinfo"
2919 echocheck "language"
2920 # Set preferred languages, "all" uses English as main language.
2921 test -z "$language" && language=$LINGUAS
2922 test -z "$language_doc" && language_doc=$language
2923 test -z "$language_man" && language_man=$language
2924 test -z "$language_msg" && language_msg=$language
2925 language_doc=$(echo $language_doc | tr , " ")
2926 language_man=$(echo $language_man | tr , " ")
2927 language_msg=$(echo $language_msg | tr , " ")
2929 test "$language_doc" = "all" && language_doc=$doc_lang_all
2930 test "$language_man" = "all" && language_man=$man_lang_all
2931 test "$language_msg" = "all" && language_msg=en
2933 # Prune non-existing translations from language lists.
2934 # Set message translation to the first available language.
2935 # Fall back on English.
2936 for lang in $language_doc ; do
2937 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2938 done
2939 language_doc=$tmp_language_doc
2940 test -z "$language_doc" && language_doc=en
2942 for lang in $language_man ; do
2943 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2944 done
2945 language_man=$tmp_language_man
2946 test -z "$language_man" && language_man=en
2948 for lang in $language_msg ; do
2949 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2950 done
2951 language_msg=$tmp_language_msg
2952 test -z "$language_msg" && language_msg=en
2953 _mp_help="help/help_mp-${language_msg}.h"
2954 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2957 echocheck "enable sighandler"
2958 if test "$_sighandler" = yes ; then
2959 def_sighandler='#define CONFIG_SIGHANDLER 1'
2960 else
2961 def_sighandler='#undef CONFIG_SIGHANDLER'
2963 echores "$_sighandler"
2965 echocheck "runtime cpudetection"
2966 if test "$_runtime_cpudetection" = yes ; then
2967 _optimizing="Runtime CPU-Detection enabled"
2968 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2969 else
2970 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2972 echores "$_runtime_cpudetection"
2975 echocheck "restrict keyword"
2976 for restrict_keyword in restrict __restrict __restrict__ ; do
2977 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2978 if cc_check; then
2979 def_restrict_keyword=$restrict_keyword
2980 break;
2982 done
2983 if [ -n "$def_restrict_keyword" ]; then
2984 echores "$def_restrict_keyword"
2985 else
2986 echores "none"
2988 # Avoid infinite recursion loop ("#define restrict restrict")
2989 if [ "$def_restrict_keyword" != "restrict" ]; then
2990 def_restrict_keyword="#define restrict $def_restrict_keyword"
2991 else
2992 def_restrict_keyword=""
2996 echocheck "__builtin_expect"
2997 # GCC branch prediction hint
2998 cat > $TMPC << EOF
2999 int foo(int a) {
3000 a = __builtin_expect(a, 10);
3001 return a == 10 ? 0 : 1;
3003 int main(void) { return foo(10) && foo(0); }
3005 _builtin_expect=no
3006 cc_check && _builtin_expect=yes
3007 if test "$_builtin_expect" = yes ; then
3008 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
3009 else
3010 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
3012 echores "$_builtin_expect"
3015 echocheck "kstat"
3016 cat > $TMPC << EOF
3017 #include <kstat.h>
3018 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
3020 _kstat=no
3021 cc_check -lkstat && _kstat=yes
3022 if test "$_kstat" = yes ; then
3023 def_kstat="#define HAVE_LIBKSTAT 1"
3024 extra_ldflags="$extra_ldflags -lkstat"
3025 else
3026 def_kstat="#undef HAVE_LIBKSTAT"
3028 echores "$_kstat"
3031 echocheck "posix4"
3032 # required for nanosleep on some systems
3033 cat > $TMPC << EOF
3034 #include <time.h>
3035 int main(void) { (void) nanosleep(0, 0); return 0; }
3037 _posix4=no
3038 cc_check -lposix4 && _posix4=yes
3039 if test "$_posix4" = yes ; then
3040 extra_ldflags="$extra_ldflags -lposix4"
3042 echores "$_posix4"
3044 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
3045 echocheck $func
3046 cat > $TMPC << EOF
3047 #include <math.h>
3048 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
3050 eval _$func=no
3051 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
3052 if eval test "x\$_$func" = "xyes"; then
3053 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
3054 echores yes
3055 else
3056 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
3057 echores no
3059 done
3062 echocheck "mkstemp"
3063 cat > $TMPC << EOF
3064 #include <stdlib.h>
3065 int main(void) { char a; mkstemp(&a); return 0; }
3067 _mkstemp=no
3068 cc_check && _mkstemp=yes
3069 if test "$_mkstemp" = yes ; then
3070 def_mkstemp='#define HAVE_MKSTEMP 1'
3071 else
3072 def_mkstemp='#undef HAVE_MKSTEMP'
3074 echores "$_mkstemp"
3077 echocheck "nanosleep"
3078 # also check for nanosleep
3079 cat > $TMPC << EOF
3080 #include <time.h>
3081 int main(void) { (void) nanosleep(0, 0); return 0; }
3083 _nanosleep=no
3084 cc_check && _nanosleep=yes
3085 if test "$_nanosleep" = yes ; then
3086 def_nanosleep='#define HAVE_NANOSLEEP 1'
3087 else
3088 def_nanosleep='#undef HAVE_NANOSLEEP'
3090 echores "$_nanosleep"
3093 echocheck "socklib"
3094 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3095 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3096 cat > $TMPC << EOF
3097 #include <netdb.h>
3098 #include <sys/socket.h>
3099 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3101 _socklib=no
3102 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3103 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3104 done
3105 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3106 if test $_winsock2_h = auto ; then
3107 _winsock2_h=no
3108 cat > $TMPC << EOF
3109 #include <winsock2.h>
3110 int main(void) { (void) gethostbyname(0); return 0; }
3112 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3114 test "$_ld_sock" && _res_comment="using $_ld_sock"
3115 echores "$_socklib"
3118 if test $_winsock2_h = yes ; then
3119 _ld_sock="-lws2_32"
3120 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3121 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1'
3122 else
3123 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3124 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0'
3128 echocheck "netdb.h, struct addrinfo"
3129 if test "$_struct_addrinfo" = auto; then
3130 _struct_addrinfo=no
3131 cat > $TMPC << EOF
3132 #if HAVE_WINSOCK2_H
3133 #include <winsock2.h>
3134 #include <ws2tcpip.h>
3135 #else
3136 #include <sys/types.h>
3137 #include <sys/socket.h>
3138 #include <netdb.h>
3139 #endif
3140 int main(void) { struct addrinfo ai; return 0; }
3142 cc_check $cc_check_winsock2_h && _struct_addrinfo=yes
3144 echores "$_struct_addrinfo"
3146 if test "$_struct_addrinfo" = yes; then
3147 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
3148 else
3149 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
3153 echocheck "netdb.h, getaddrinfo()"
3154 if test "$_getaddrinfo" = auto; then
3155 _getaddrinfo=no
3156 cat > $TMPC << EOF
3157 #if HAVE_WINSOCK2_H
3158 #include <winsock2.h>
3159 #else
3160 #include <sys/types.h>
3161 #include <sys/socket.h>
3162 #include <netdb.h>
3163 #endif
3164 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
3166 cc_check $cc_check_winsock2_h && _getaddrinfo=yes
3168 echores "$_getaddrinfo"
3170 if test "$_getaddrinfo" = yes; then
3171 def_getaddrinfo="#define HAVE_GETADDRINFO 1"
3172 else
3173 def_getaddrinfo="#define HAVE_GETADDRINFO 0"
3177 echocheck "sockaddr_storage"
3178 if test "$_struct_sockaddr_storage" = auto; then
3179 _struct_sockaddr_storage=no
3180 cat > $TMPC << EOF
3181 #if HAVE_WINSOCK2_H
3182 #include <winsock2.h>
3183 #else
3184 #include <sys/socket.h>
3185 #endif
3186 int main(void) { struct sockaddr_storage sas; return 0; }
3188 cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes
3190 echores "$_struct_sockaddr_storage"
3192 if test "$_struct_sockaddr_storage" = yes; then
3193 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
3194 else
3195 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
3199 echocheck "struct ipv6_mreq"
3200 _struct_ipv6_mreq=no
3201 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 0"
3202 for header in "netinet/in.h" "ws2tcpip.h" ; do
3203 cat > $TMPC << EOF
3204 #include <$header>
3205 int main(void) { struct ipv6_mreq mreq6; return 0; }
3207 cc_check && _struct_ipv6_mreq=yes && \
3208 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 1" && break
3209 done
3210 echores "$_struct_ipv6_mreq"
3213 echocheck "struct sockaddr_in6"
3214 _struct_sockaddr_in6=no
3215 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 0"
3216 for header in "netinet/in.h" "ws2tcpip.h" ; do
3217 cat > $TMPC << EOF
3218 #include <$header>
3219 int main(void) { struct sockaddr_in6 addr; return 0; }
3221 cc_check && _struct_sockaddr_in6=yes && \
3222 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 1" && break
3223 done
3224 echores "$_struct_sockaddr_in6"
3227 echocheck "struct sockaddr sa_len"
3228 _struct_sockaddr_sa_len=no
3229 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 0"
3230 cat > $TMPC << EOF
3231 #if HAVE_WINSOCK2_H
3232 #include <winsock2.h>
3233 #else
3234 #include <sys/types.h>
3235 #include <sys/socket.h>
3236 #endif
3237 int main(void) { const void *p = &((struct sockaddr *)0)->sa_len; return 0; }
3239 cc_check $cc_check_winsock2_h && _struct_sockaddr_sa_len=yes && \
3240 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 1"
3241 echores "$_struct_sockaddr_sa_len"
3244 echocheck "arpa/inet.h"
3245 arpa_inet_h=no
3246 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3247 cat > $TMPC << EOF
3248 #include <arpa/inet.h>
3249 int main(void) { return 0; }
3251 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3252 echores "$arpa_inet_h"
3255 echocheck "inet_pton()"
3256 def_inet_pton='#define HAVE_INET_PTON 0'
3257 inet_pton=no
3258 cat > $TMPC << EOF
3259 #include <sys/types.h>
3260 #include <sys/socket.h>
3261 #include <arpa/inet.h>
3262 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3264 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3265 cc_check $_ld_tmp && inet_pton=yes && break
3266 done
3267 if test $inet_pton = yes ; then
3268 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3269 def_inet_pton='#define HAVE_INET_PTON 1'
3271 echores "$inet_pton"
3274 echocheck "inet_aton()"
3275 def_inet_aton='#define HAVE_INET_ATON 0'
3276 inet_aton=no
3277 cat > $TMPC << EOF
3278 #include <sys/types.h>
3279 #include <sys/socket.h>
3280 #include <arpa/inet.h>
3281 int main(void) { (void) inet_aton(0, 0); return 0; }
3283 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3284 cc_check $_ld_tmp && inet_aton=yes && break
3285 done
3286 if test $inet_aton = yes ; then
3287 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3288 def_inet_aton='#define HAVE_INET_ATON 1'
3290 echores "$inet_aton"
3293 echocheck "socklen_t"
3294 _socklen_t=no
3295 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3296 cat > $TMPC << EOF
3297 #include <$header>
3298 int main(void) { socklen_t v = 0; return v; }
3300 cc_check && _socklen_t=yes && break
3301 done
3302 if test "$_socklen_t" = yes ; then
3303 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3304 else
3305 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3307 echores "$_socklen_t"
3310 echocheck "closesocket()"
3311 _closesocket=no
3312 cat > $TMPC << EOF
3313 #include <winsock2.h>
3314 int main(void) { closesocket(~0); return 0; }
3316 cc_check $_ld_sock && _closesocket=yes
3317 if test "$_closesocket" = yes ; then
3318 def_closesocket='#define HAVE_CLOSESOCKET 1'
3319 else
3320 def_closesocket='#define HAVE_CLOSESOCKET 0'
3322 echores "$_closesocket"
3325 echocheck "network"
3326 test $_winsock2_h = no && test $inet_pton = no &&
3327 test $inet_aton = no && _network=no
3328 if test "$_network" = yes ; then
3329 def_network='#define CONFIG_NETWORK 1'
3330 extra_ldflags="$extra_ldflags $_ld_sock"
3331 _inputmodules="network $_inputmodules"
3332 else
3333 _noinputmodules="network $_noinputmodules"
3334 def_network='#undef CONFIG_NETWORK'
3335 _ftp=no
3336 _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//)
3337 _libavdemuxers=$(echo $_libavdemuxers | sed -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER//)
3339 echores "$_network"
3342 echocheck "inet6"
3343 if test "$_inet6" = auto ; then
3344 cat > $TMPC << EOF
3345 #include <sys/types.h>
3346 #if !defined(_WIN32) || defined(__CYGWIN__)
3347 #include <sys/socket.h>
3348 #include <netinet/in.h>
3349 #else
3350 #include <ws2tcpip.h>
3351 #endif
3352 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3354 _inet6=no
3355 if cc_check $_ld_sock ; then
3356 _inet6=yes
3359 if test "$_inet6" = yes ; then
3360 def_inet6='#define HAVE_AF_INET6 1'
3361 else
3362 def_inet6='#undef HAVE_AF_INET6'
3364 echores "$_inet6"
3367 echocheck "gethostbyname2"
3368 if test "$_gethostbyname2" = auto ; then
3369 cat > $TMPC << EOF
3370 #include <sys/types.h>
3371 #include <sys/socket.h>
3372 #include <netdb.h>
3373 int main(void) { gethostbyname2("", AF_INET); return 0; }
3375 _gethostbyname2=no
3376 if cc_check ; then
3377 _gethostbyname2=yes
3380 if test "$_gethostbyname2" = yes ; then
3381 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3382 else
3383 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3385 echores "$_gethostbyname2"
3388 echocheck "inttypes.h (required)"
3389 cat > $TMPC << EOF
3390 #include <inttypes.h>
3391 int main(void) { return 0; }
3393 _inttypes=no
3394 cc_check && _inttypes=yes
3395 echores "$_inttypes"
3397 if test "$_inttypes" = no ; then
3398 echocheck "bitypes.h (inttypes.h predecessor)"
3399 cat > $TMPC << EOF
3400 #include <sys/bitypes.h>
3401 int main(void) { return 0; }
3403 cc_check && _inttypes=yes
3404 if test "$_inttypes" = yes ; then
3405 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."
3406 else
3407 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3412 echocheck "int_fastXY_t in inttypes.h"
3413 cat > $TMPC << EOF
3414 #include <inttypes.h>
3415 int main(void) {
3416 volatile int_fast16_t v= 0;
3417 return v; }
3419 _fast_inttypes=no
3420 cc_check && _fast_inttypes=yes
3421 if test "$_fast_inttypes" = no ; then
3422 def_fast_inttypes='
3423 typedef signed char int_fast8_t;
3424 typedef signed int int_fast16_t;
3425 typedef signed int int_fast32_t;
3426 typedef signed long long int_fast64_t;
3427 typedef unsigned char uint_fast8_t;
3428 typedef unsigned int uint_fast16_t;
3429 typedef unsigned int uint_fast32_t;
3430 typedef unsigned long long uint_fast64_t;'
3432 echores "$_fast_inttypes"
3435 echocheck "malloc.h"
3436 cat > $TMPC << EOF
3437 #include <malloc.h>
3438 int main(void) { (void) malloc(0); return 0; }
3440 _malloc=no
3441 cc_check && _malloc=yes
3442 if test "$_malloc" = yes ; then
3443 def_malloc_h='#define HAVE_MALLOC_H 1'
3444 else
3445 def_malloc_h='#define HAVE_MALLOC_H 0'
3447 echores "$_malloc"
3450 echocheck "memalign()"
3451 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3452 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3453 cat > $TMPC << EOF
3454 #include <malloc.h>
3455 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3457 _memalign=no
3458 cc_check && _memalign=yes
3459 if test "$_memalign" = yes ; then
3460 def_memalign='#define HAVE_MEMALIGN 1'
3461 else
3462 def_memalign='#define HAVE_MEMALIGN 0'
3463 def_map_memalign='#define memalign(a,b) malloc(b)'
3464 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3466 echores "$_memalign"
3469 echocheck "posix_memalign()"
3470 posix_memalign=no
3471 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3472 cat > $TMPC << EOF
3473 #define _XOPEN_SOURCE 600
3474 #include <stdlib.h>
3475 int main(void) { posix_memalign(NULL, 0, 0); }
3477 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3478 echores "$posix_memalign"
3481 echocheck "alloca.h"
3482 cat > $TMPC << EOF
3483 #include <alloca.h>
3484 int main(void) { (void) alloca(0); return 0; }
3486 _alloca=no
3487 cc_check && _alloca=yes
3488 if cc_check ; then
3489 def_alloca_h='#define HAVE_ALLOCA_H 1'
3490 else
3491 def_alloca_h='#undef HAVE_ALLOCA_H'
3493 echores "$_alloca"
3496 echocheck "fastmemcpy"
3497 if test "$_fastmemcpy" = yes ; then
3498 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3499 else
3500 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3502 echores "$_fastmemcpy"
3505 echocheck "hard-coded tables"
3506 if test "$hardcoded_tables" = yes ; then
3507 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1'
3508 mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes'
3509 else
3510 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0'
3512 echores "$hardcoded_tables"
3515 echocheck "mman.h"
3516 cat > $TMPC << EOF
3517 #include <sys/types.h>
3518 #include <sys/mman.h>
3519 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3521 _mman=no
3522 cc_check && _mman=yes
3523 if test "$_mman" = yes ; then
3524 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3525 else
3526 def_mman_h='#undef HAVE_SYS_MMAN_H'
3527 os2 && _need_mmap=yes
3529 echores "$_mman"
3531 cat > $TMPC << EOF
3532 #include <sys/types.h>
3533 #include <sys/mman.h>
3534 int main(void) { void *p = MAP_FAILED; return 0; }
3536 _mman_has_map_failed=no
3537 cc_check && _mman_has_map_failed=yes
3538 if test "$_mman_has_map_failed" = yes ; then
3539 def_mman_has_map_failed=''
3540 else
3541 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3544 echocheck "dynamic loader"
3545 cat > $TMPC << EOF
3546 #include <stddef.h>
3547 #include <dlfcn.h>
3548 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3550 _dl=no
3551 for _ld_tmp in "" "-ldl" ; do
3552 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3553 done
3554 if test "$_dl" = yes ; then
3555 def_dl='#define HAVE_LIBDL 1'
3556 else
3557 def_dl='#undef HAVE_LIBDL'
3559 echores "$_dl"
3562 echocheck "dynamic a/v plugins support"
3563 if test "$_dl" = no ; then
3564 _dynamic_plugins=no
3566 if test "$_dynamic_plugins" = yes ; then
3567 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3568 else
3569 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3571 echores "$_dynamic_plugins"
3574 def_threads='#define HAVE_THREADS 0'
3576 echocheck "pthread"
3577 if linux ; then
3578 THREAD_CFLAGS=-D_REENTRANT
3579 elif freebsd || netbsd || openbsd || bsdos ; then
3580 THREAD_CFLAGS=-D_THREAD_SAFE
3582 if test "$_pthreads" = auto ; then
3583 cat > $TMPC << EOF
3584 #include <pthread.h>
3585 void* func(void *arg) { return arg; }
3586 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3588 _pthreads=no
3589 if ! hpux ; then
3590 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3591 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3592 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3593 done
3596 if test "$_pthreads" = yes ; then
3597 test $_ld_pthread && _res_comment="using $_ld_pthread"
3598 def_pthreads='#define HAVE_PTHREADS 1'
3599 def_threads='#define HAVE_THREADS 1'
3600 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3601 else
3602 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3603 def_pthreads='#undef HAVE_PTHREADS'
3604 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3605 mingw32 || _win32dll=no
3607 echores "$_pthreads"
3609 if cygwin ; then
3610 if test "$_pthreads" = yes ; then
3611 def_pthread_cache="#define PTHREAD_CACHE 1"
3612 else
3613 _stream_cache=no
3614 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3618 echocheck "w32threads"
3619 if test "$_pthreads" = yes ; then
3620 _res_comment="using pthread instead"
3621 _w32threads=no
3623 if test "$_w32threads" = auto ; then
3624 _w32threads=no
3625 mingw32 && _w32threads=yes
3627 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3628 echores "$_w32threads"
3630 echocheck "rpath"
3631 netbsd &&_rpath=yes
3632 if test "$_rpath" = yes ; then
3633 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3634 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3635 done
3636 extra_ldflags=$tmp
3638 echores "$_rpath"
3640 echocheck "iconv"
3641 if test "$_iconv" = auto ; then
3642 cat > $TMPC << EOF
3643 #include <stdio.h>
3644 #include <unistd.h>
3645 #include <iconv.h>
3646 #define INBUFSIZE 1024
3647 #define OUTBUFSIZE 4096
3649 char inbuffer[INBUFSIZE];
3650 char outbuffer[OUTBUFSIZE];
3652 int main(void) {
3653 size_t numread;
3654 iconv_t icdsc;
3655 char *tocode="UTF-8";
3656 char *fromcode="cp1250";
3657 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3658 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3659 char *iptr=inbuffer;
3660 char *optr=outbuffer;
3661 size_t inleft=numread;
3662 size_t outleft=OUTBUFSIZE;
3663 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3664 != (size_t)(-1)) {
3665 write(1, outbuffer, OUTBUFSIZE - outleft);
3668 if (iconv_close(icdsc) == -1)
3671 return 0;
3674 _iconv=no
3675 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3676 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3677 _iconv=yes && break
3678 done
3680 if test "$_iconv" = yes ; then
3681 def_iconv='#define CONFIG_ICONV 1'
3682 else
3683 def_iconv='#undef CONFIG_ICONV'
3685 echores "$_iconv"
3688 echocheck "soundcard.h"
3689 _soundcard_h=no
3690 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3691 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3692 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3693 cat > $TMPC << EOF
3694 #include <$_soundcard_header>
3695 int main(void) { return 0; }
3697 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3698 done
3700 if test "$_soundcard_h" = yes ; then
3701 if test $_soundcard_header = "sys/soundcard.h"; then
3702 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3703 else
3704 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3707 echores "$_soundcard_h"
3710 echocheck "sys/dvdio.h"
3711 cat > $TMPC << EOF
3712 #include <unistd.h>
3713 #include <sys/dvdio.h>
3714 int main(void) { return 0; }
3716 _dvdio=no
3717 cc_check && _dvdio=yes
3718 if test "$_dvdio" = yes ; then
3719 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3720 else
3721 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3723 echores "$_dvdio"
3726 echocheck "sys/cdio.h"
3727 cat > $TMPC << EOF
3728 #include <unistd.h>
3729 #include <sys/cdio.h>
3730 int main(void) { return 0; }
3732 _cdio=no
3733 cc_check && _cdio=yes
3734 if test "$_cdio" = yes ; then
3735 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3736 else
3737 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3739 echores "$_cdio"
3742 echocheck "linux/cdrom.h"
3743 cat > $TMPC << EOF
3744 #include <sys/types.h>
3745 #include <linux/cdrom.h>
3746 int main(void) { return 0; }
3748 _cdrom=no
3749 cc_check && _cdrom=yes
3750 if test "$_cdrom" = yes ; then
3751 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3752 else
3753 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3755 echores "$_cdrom"
3758 echocheck "dvd.h"
3759 cat > $TMPC << EOF
3760 #include <dvd.h>
3761 int main(void) { return 0; }
3763 _dvd=no
3764 cc_check && _dvd=yes
3765 if test "$_dvd" = yes ; then
3766 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3767 else
3768 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3770 echores "$_dvd"
3773 if bsdos; then
3774 echocheck "BSDI dvd.h"
3775 cat > $TMPC << EOF
3776 #include <dvd.h>
3777 int main(void) { return 0; }
3779 _bsdi_dvd=no
3780 cc_check && _bsdi_dvd=yes
3781 if test "$_bsdi_dvd" = yes ; then
3782 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3783 else
3784 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3786 echores "$_bsdi_dvd"
3787 fi #if bsdos
3790 if hpux; then
3791 # also used by AIX, but AIX does not support VCD and/or libdvdread
3792 echocheck "HP-UX SCSI header"
3793 cat > $TMPC << EOF
3794 #include <sys/scsi.h>
3795 int main(void) { return 0; }
3797 _hpux_scsi_h=no
3798 cc_check && _hpux_scsi_h=yes
3799 if test "$_hpux_scsi_h" = yes ; then
3800 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3801 else
3802 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3804 echores "$_hpux_scsi_h"
3805 fi #if hpux
3808 if sunos; then
3809 echocheck "userspace SCSI headers (Solaris)"
3810 cat > $TMPC << EOF
3811 #include <unistd.h>
3812 #include <stropts.h>
3813 #include <sys/scsi/scsi_types.h>
3814 #include <sys/scsi/impl/uscsi.h>
3815 int main(void) { return 0; }
3817 _sol_scsi_h=no
3818 cc_check && _sol_scsi_h=yes
3819 if test "$_sol_scsi_h" = yes ; then
3820 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3821 else
3822 def_sol_scsi_h='#undef SOLARIS_USCSI'
3824 echores "$_sol_scsi_h"
3825 fi #if sunos
3828 echocheck "termcap"
3829 if test "$_termcap" = auto ; then
3830 cat > $TMPC <<EOF
3831 #include <stddef.h>
3832 #include <term.h>
3833 int main(void) { tgetent(NULL, NULL); return 0; }
3835 _termcap=no
3836 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3837 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3838 && _termcap=yes && break
3839 done
3841 if test "$_termcap" = yes ; then
3842 def_termcap='#define HAVE_TERMCAP 1'
3843 test $_ld_tmp && _res_comment="using $_ld_tmp"
3844 else
3845 def_termcap='#undef HAVE_TERMCAP'
3847 echores "$_termcap"
3850 echocheck "termios"
3851 def_termios='#undef HAVE_TERMIOS'
3852 def_termios_h='#undef HAVE_TERMIOS_H'
3853 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3854 if test "$_termios" = auto ; then
3855 _termios=no
3856 for _termios_header in "sys/termios.h" "termios.h"; do
3857 cat > $TMPC <<EOF
3858 #include <$_termios_header>
3859 int main(void) { return 0; }
3861 cc_check && _termios=yes && _res_comment="using $_termios_header" && break
3862 done
3865 if test "$_termios" = yes ; then
3866 def_termios='#define HAVE_TERMIOS 1'
3867 if test "$_termios_header" = "termios.h" ; then
3868 def_termios_h='#define HAVE_TERMIOS_H 1'
3869 else
3870 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3873 echores "$_termios"
3876 echocheck "shm"
3877 if test "$_shm" = auto ; then
3878 cat > $TMPC << EOF
3879 #include <sys/types.h>
3880 #include <sys/shm.h>
3881 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3883 _shm=no
3884 cc_check && _shm=yes
3886 if test "$_shm" = yes ; then
3887 def_shm='#define HAVE_SHM 1'
3888 else
3889 def_shm='#undef HAVE_SHM'
3891 echores "$_shm"
3894 echocheck "strsep()"
3895 cat > $TMPC << EOF
3896 #include <string.h>
3897 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3899 _strsep=no
3900 cc_check && _strsep=yes
3901 if test "$_strsep" = yes ; then
3902 def_strsep='#define HAVE_STRSEP 1'
3903 _need_strsep=no
3904 else
3905 def_strsep='#undef HAVE_STRSEP'
3906 _need_strsep=yes
3908 echores "$_strsep"
3911 echocheck "vsscanf()"
3912 cat > $TMPC << EOF
3913 #define _ISOC99_SOURCE
3914 #include <stdarg.h>
3915 #include <stdio.h>
3916 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3918 _vsscanf=no
3919 cc_check && _vsscanf=yes
3920 if test "$_vsscanf" = yes ; then
3921 def_vsscanf='#define HAVE_VSSCANF 1'
3922 _need_vsscanf=no
3923 else
3924 def_vsscanf='#undef HAVE_VSSCANF'
3925 _need_vsscanf=yes
3927 echores "$_vsscanf"
3930 echocheck "swab()"
3931 cat > $TMPC << EOF
3932 #define _XOPEN_SOURCE 600
3933 #include <unistd.h>
3934 int main(void) { swab(0, 0, 0); return 0; }
3936 _swab=no
3937 cc_check && _swab=yes
3938 if test "$_swab" = yes ; then
3939 def_swab='#define HAVE_SWAB 1'
3940 _need_swab=no
3941 else
3942 def_swab='#undef HAVE_SWAB'
3943 _need_swab=yes
3945 echores "$_swab"
3947 echocheck "POSIX select()"
3948 cat > $TMPC << EOF
3949 #include <stdio.h>
3950 #include <stdlib.h>
3951 #include <sys/types.h>
3952 #include <string.h>
3953 #include <sys/time.h>
3954 #include <unistd.h>
3955 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3957 _posix_select=no
3958 def_posix_select='#undef HAVE_POSIX_SELECT'
3959 #select() of kLIBC (OS/2) supports socket only
3960 ! os2 && cc_check && _posix_select=yes \
3961 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3962 echores "$_posix_select"
3965 echocheck "audio select()"
3966 if test "$_select" = no ; then
3967 def_select='#undef HAVE_AUDIO_SELECT'
3968 elif test "$_select" = yes ; then
3969 def_select='#define HAVE_AUDIO_SELECT 1'
3971 echores "$_select"
3974 echocheck "gettimeofday()"
3975 cat > $TMPC << EOF
3976 #include <stdio.h>
3977 #include <sys/time.h>
3978 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3980 _gettimeofday=no
3981 cc_check && _gettimeofday=yes
3982 if test "$_gettimeofday" = yes ; then
3983 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3984 _need_gettimeofday=no
3985 else
3986 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3987 _need_gettimeofday=yes
3989 echores "$_gettimeofday"
3992 echocheck "glob()"
3993 cat > $TMPC << EOF
3994 #include <stdio.h>
3995 #include <glob.h>
3996 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3998 _glob=no
3999 cc_check && _glob=yes
4000 if test "$_glob" = yes ; then
4001 def_glob='#define HAVE_GLOB 1'
4002 _need_glob=no
4003 else
4004 def_glob='#undef HAVE_GLOB'
4005 _need_glob=yes
4007 echores "$_glob"
4010 echocheck "setenv()"
4011 cat > $TMPC << EOF
4012 #include <stdlib.h>
4013 int main(void) { setenv("","",0); return 0; }
4015 _setenv=no
4016 cc_check && _setenv=yes
4017 if test "$_setenv" = yes ; then
4018 def_setenv='#define HAVE_SETENV 1'
4019 _need_setenv=no
4020 else
4021 def_setenv='#undef HAVE_SETENV'
4022 _need_setenv=yes
4024 echores "$_setenv"
4027 echocheck "setmode()"
4028 _setmode=no
4029 def_setmode='#define HAVE_SETMODE 0'
4030 cat > $TMPC << EOF
4031 #include <io.h>
4032 int main(void) { setmode(0, 0); return 0; }
4034 cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
4035 echores "$_setmode"
4038 if sunos; then
4039 echocheck "sysi86()"
4040 cat > $TMPC << EOF
4041 #include <sys/sysi86.h>
4042 int main(void) { sysi86(0); return 0; }
4044 _sysi86=no
4045 cc_check && _sysi86=yes
4046 if test "$_sysi86" = yes ; then
4047 def_sysi86='#define HAVE_SYSI86 1'
4048 cat > $TMPC << EOF
4049 #include <sys/sysi86.h>
4050 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
4052 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
4053 else
4054 def_sysi86='#undef HAVE_SYSI86'
4056 echores "$_sysi86"
4057 fi #if sunos
4060 echocheck "sys/sysinfo.h"
4061 cat > $TMPC << EOF
4062 #include <sys/sysinfo.h>
4063 int main(void) {
4064 struct sysinfo s_info;
4065 sysinfo(&s_info);
4066 return 0;
4069 _sys_sysinfo=no
4070 cc_check && _sys_sysinfo=yes
4071 if test "$_sys_sysinfo" = yes ; then
4072 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
4073 else
4074 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
4076 echores "$_sys_sysinfo"
4079 if darwin; then
4081 echocheck "Mac OS X Finder Support"
4082 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
4083 if test "$_macosx_finder" = yes ; then
4084 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
4085 extra_ldflags="$extra_ldflags -framework Carbon"
4087 echores "$_macosx_finder"
4089 echocheck "Mac OS X Bundle file locations"
4090 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
4091 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
4092 if test "$_macosx_bundle" = yes ; then
4093 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
4094 extra_ldflags="$extra_ldflags -framework Carbon"
4096 echores "$_macosx_bundle"
4098 echocheck "Apple Remote"
4099 if test "$_apple_remote" = auto ; then
4100 _apple_remote=no
4101 cat > $TMPC <<EOF
4102 #include <stdio.h>
4103 #include <IOKit/IOCFPlugIn.h>
4104 int main(void) {
4105 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
4106 CFMutableDictionaryRef hidMatchDictionary;
4107 IOReturn ioReturnValue;
4109 // Set up a matching dictionary to search the I/O Registry by class.
4110 // name for all HID class devices
4111 hidMatchDictionary = IOServiceMatching("AppleIRController");
4113 // Now search I/O Registry for matching devices.
4114 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
4115 hidMatchDictionary, &hidObjectIterator);
4117 // If search is unsuccessful, return nonzero.
4118 if (ioReturnValue != kIOReturnSuccess ||
4119 !IOIteratorIsValid(hidObjectIterator)) {
4120 return 1;
4122 return 0;
4125 cc_check -framework IOKit && tmp_run && _apple_remote=yes
4127 if test "$_apple_remote" = yes ; then
4128 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
4129 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
4130 else
4131 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
4133 echores "$_apple_remote"
4135 fi #if darwin
4137 if linux; then
4139 echocheck "Apple IR"
4140 if test "$_apple_ir" = auto ; then
4141 _apple_ir=no
4142 cat > $TMPC <<EOF
4143 #include <linux/types.h>
4144 #include <linux/input.h>
4145 int main(void) {
4146 struct input_event ev;
4147 struct input_id id;
4148 return 0;
4151 cc_check && _apple_ir=yes
4153 if test "$_apple_ir" = yes ; then
4154 def_apple_ir='#define CONFIG_APPLE_IR 1'
4155 else
4156 def_apple_ir='#undef CONFIG_APPLE_IR'
4158 echores "$_apple_ir"
4159 fi #if linux
4161 echocheck "pkg-config"
4162 _pkg_config=pkg-config
4163 if $($_pkg_config --version > /dev/null 2>&1); then
4164 if test "$_ld_static"; then
4165 _pkg_config="$_pkg_config --static"
4167 echores "yes"
4168 else
4169 _pkg_config=false
4170 echores "no"
4174 echocheck "Samba support (libsmbclient)"
4175 if test "$_smb" = yes; then
4176 extra_ldflags="$extra_ldflags -lsmbclient"
4178 if test "$_smb" = auto; then
4179 _smb=no
4180 cat > $TMPC << EOF
4181 #include <libsmbclient.h>
4182 int main(void) { smbc_opendir("smb://"); return 0; }
4184 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4185 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
4186 _smb=yes && break
4187 done
4190 if test "$_smb" = yes; then
4191 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4192 _inputmodules="smb $_inputmodules"
4193 else
4194 def_smb="#undef CONFIG_LIBSMBCLIENT"
4195 _noinputmodules="smb $_noinputmodules"
4197 echores "$_smb"
4200 #########
4201 # VIDEO #
4202 #########
4205 echocheck "tdfxfb"
4206 if test "$_tdfxfb" = yes ; then
4207 def_tdfxfb='#define CONFIG_TDFXFB 1'
4208 _vomodules="tdfxfb $_vomodules"
4209 else
4210 def_tdfxfb='#undef CONFIG_TDFXFB'
4211 _novomodules="tdfxfb $_novomodules"
4213 echores "$_tdfxfb"
4215 echocheck "s3fb"
4216 if test "$_s3fb" = yes ; then
4217 def_s3fb='#define CONFIG_S3FB 1'
4218 _vomodules="s3fb $_vomodules"
4219 else
4220 def_s3fb='#undef CONFIG_S3FB'
4221 _novomodules="s3fb $_novomodules"
4223 echores "$_s3fb"
4225 echocheck "wii"
4226 if test "$_wii" = yes ; then
4227 def_wii='#define CONFIG_WII 1'
4228 _vomodules="wii $_vomodules"
4229 else
4230 def_wii='#undef CONFIG_WII'
4231 _novomodules="wii $_novomodules"
4233 echores "$_wii"
4235 echocheck "tdfxvid"
4236 if test "$_tdfxvid" = yes ; then
4237 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4238 _vomodules="tdfx_vid $_vomodules"
4239 else
4240 def_tdfxvid='#undef CONFIG_TDFX_VID'
4241 _novomodules="tdfx_vid $_novomodules"
4243 echores "$_tdfxvid"
4245 echocheck "xvr100"
4246 if test "$_xvr100" = auto ; then
4247 cat > $TMPC << EOF
4248 #include <unistd.h>
4249 #include <sys/fbio.h>
4250 #include <sys/visual_io.h>
4251 int main(void) {
4252 struct vis_identifier ident;
4253 struct fbgattr attr;
4254 ioctl(0, VIS_GETIDENTIFIER, &ident);
4255 ioctl(0, FBIOGATTR, &attr);
4256 return 0;
4259 _xvr100=no
4260 cc_check && _xvr100=yes
4262 if test "$_xvr100" = yes ; then
4263 def_xvr100='#define CONFIG_XVR100 1'
4264 _vomodules="xvr100 $_vomodules"
4265 else
4266 def_tdfxvid='#undef CONFIG_XVR100'
4267 _novomodules="xvr100 $_novomodules"
4269 echores "$_xvr100"
4271 echocheck "tga"
4272 if test "$_tga" = yes ; then
4273 def_tga='#define CONFIG_TGA 1'
4274 _vomodules="tga $_vomodules"
4275 else
4276 def_tga='#undef CONFIG_TGA'
4277 _novomodules="tga $_novomodules"
4279 echores "$_tga"
4282 echocheck "md5sum support"
4283 if test "$_md5sum" = yes; then
4284 def_md5sum="#define CONFIG_MD5SUM 1"
4285 _vomodules="md5sum $_vomodules"
4286 else
4287 def_md5sum="#undef CONFIG_MD5SUM"
4288 _novomodules="md5sum $_novomodules"
4290 echores "$_md5sum"
4293 echocheck "yuv4mpeg support"
4294 if test "$_yuv4mpeg" = yes; then
4295 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4296 _vomodules="yuv4mpeg $_vomodules"
4297 else
4298 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4299 _novomodules="yuv4mpeg $_novomodules"
4301 echores "$_yuv4mpeg"
4304 echocheck "bl"
4305 if test "$_bl" = yes ; then
4306 def_bl='#define CONFIG_BL 1'
4307 _vomodules="bl $_vomodules"
4308 else
4309 def_bl='#undef CONFIG_BL'
4310 _novomodules="bl $_novomodules"
4312 echores "$_bl"
4315 echocheck "DirectFB"
4316 if test "$_directfb" = auto ; then
4317 _directfb=no
4318 cat > $TMPC <<EOF
4319 #include <directfb.h>
4320 int main(void) { DirectFBInit(0, 0); return 0; }
4322 for _inc_tmp in "" -I/usr/local/include/directfb \
4323 -I/usr/include/directfb -I/usr/local/include; do
4324 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4325 extra_cflags="$extra_cflags $_inc_tmp" && break
4326 done
4329 dfb_version() {
4330 expr $1 \* 65536 + $2 \* 256 + $3
4333 if test "$_directfb" = yes; then
4334 cat > $TMPC << EOF
4335 #include <directfb_version.h>
4337 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4340 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4341 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4342 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4343 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4344 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4345 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4346 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4347 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4348 _res_comment="$_directfb_version"
4349 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4350 else
4351 def_directfb_version='#undef DIRECTFBVERSION'
4352 _directfb=no
4353 _res_comment="version >=0.9.13 required"
4355 else
4356 _directfb=no
4357 _res_comment="failed to get version"
4360 echores "$_directfb"
4362 if test "$_directfb" = yes ; then
4363 def_directfb='#define CONFIG_DIRECTFB 1'
4364 _vomodules="directfb $_vomodules"
4365 libs_mplayer="$libs_mplayer -ldirectfb"
4366 else
4367 def_directfb='#undef CONFIG_DIRECTFB'
4368 _novomodules="directfb $_novomodules"
4370 if test "$_dfbmga" = yes; then
4371 _vomodules="dfbmga $_vomodules"
4372 def_dfbmga='#define CONFIG_DFBMGA 1'
4373 else
4374 _novomodules="dfbmga $_novomodules"
4375 def_dfbmga='#undef CONFIG_DFBMGA'
4379 echocheck "X11 headers presence"
4380 _x11_headers="no"
4381 _res_comment="check if the dev(el) packages are installed"
4382 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4383 if test -f "$I/X11/Xlib.h" ; then
4384 _x11_headers="yes"
4385 _res_comment=""
4386 break
4388 done
4389 if test $_cross_compile = no; then
4390 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4391 /usr/include/X11R6 /usr/openwin/include ; do
4392 if test -f "$I/X11/Xlib.h" ; then
4393 extra_cflags="$extra_cflags -I$I"
4394 _x11_headers="yes"
4395 _res_comment="using $I"
4396 break
4398 done
4400 echores "$_x11_headers"
4403 echocheck "X11"
4404 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4405 cat > $TMPC <<EOF
4406 #include <X11/Xlib.h>
4407 #include <X11/Xutil.h>
4408 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4410 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4411 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4412 -L/usr/lib ; do
4413 if netbsd; then
4414 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4415 else
4416 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4418 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4419 && _x11=yes && break
4420 done
4422 if test "$_x11" = yes ; then
4423 def_x11='#define CONFIG_X11 1'
4424 _vomodules="x11 xover $_vomodules"
4425 else
4426 _x11=no
4427 def_x11='#undef CONFIG_X11'
4428 _novomodules="x11 $_novomodules"
4429 _res_comment="check if the dev(el) packages are installed"
4430 # disable stuff that depends on X
4431 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4433 echores "$_x11"
4435 echocheck "Xss screensaver extensions"
4436 if test "$_xss" = auto ; then
4437 cat > $TMPC << EOF
4438 #include <X11/Xlib.h>
4439 #include <X11/extensions/scrnsaver.h>
4440 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4442 _xss=no
4443 cc_check -lXss && _xss=yes
4445 if test "$_xss" = yes ; then
4446 def_xss='#define CONFIG_XSS 1'
4447 libs_mplayer="$libs_mplayer -lXss"
4448 else
4449 def_xss='#undef CONFIG_XSS'
4451 echores "$_xss"
4453 echocheck "DPMS"
4454 _xdpms3=no
4455 _xdpms4=no
4456 if test "$_x11" = yes ; then
4457 cat > $TMPC <<EOF
4458 #include <X11/Xmd.h>
4459 #include <X11/Xlib.h>
4460 #include <X11/Xutil.h>
4461 #include <X11/Xatom.h>
4462 #include <X11/extensions/dpms.h>
4463 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4465 cc_check -lXdpms && _xdpms3=yes
4466 cat > $TMPC <<EOF
4467 #include <X11/Xlib.h>
4468 #include <X11/extensions/dpms.h>
4469 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4471 cc_check -lXext && _xdpms4=yes
4473 if test "$_xdpms4" = yes ; then
4474 def_xdpms='#define CONFIG_XDPMS 1'
4475 _res_comment="using Xdpms 4"
4476 echores "yes"
4477 elif test "$_xdpms3" = yes ; then
4478 def_xdpms='#define CONFIG_XDPMS 1'
4479 libs_mplayer="$libs_mplayer -lXdpms"
4480 _res_comment="using Xdpms 3"
4481 echores "yes"
4482 else
4483 def_xdpms='#undef CONFIG_XDPMS'
4484 echores "no"
4488 echocheck "Xv"
4489 if test "$_xv" = auto ; then
4490 cat > $TMPC <<EOF
4491 #include <X11/Xlib.h>
4492 #include <X11/extensions/Xvlib.h>
4493 int main(void) {
4494 (void) XvGetPortAttribute(0, 0, 0, 0);
4495 (void) XvQueryPortAttributes(0, 0, 0);
4496 return 0; }
4498 _xv=no
4499 cc_check -lXv && _xv=yes
4502 if test "$_xv" = yes ; then
4503 def_xv='#define CONFIG_XV 1'
4504 libs_mplayer="$libs_mplayer -lXv"
4505 _vomodules="xv $_vomodules"
4506 else
4507 def_xv='#undef CONFIG_XV'
4508 _novomodules="xv $_novomodules"
4510 echores "$_xv"
4513 echocheck "XvMC"
4514 if test "$_xv" = yes && test "$_xvmc" != no ; then
4515 _xvmc=no
4516 cat > $TMPC <<EOF
4517 #include <X11/Xlib.h>
4518 #include <X11/extensions/Xvlib.h>
4519 #include <X11/extensions/XvMClib.h>
4520 int main(void) {
4521 (void) XvMCQueryExtension(0,0,0);
4522 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4523 return 0; }
4525 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4526 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4527 done
4529 if test "$_xvmc" = yes ; then
4530 def_xvmc='#define CONFIG_XVMC 1'
4531 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4532 _vomodules="xvmc $_vomodules"
4533 _res_comment="using $_xvmclib"
4534 else
4535 def_xvmc='#define CONFIG_XVMC 0'
4536 _novomodules="xvmc $_novomodules"
4537 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
4539 echores "$_xvmc"
4542 echocheck "VDPAU"
4543 if test "$_vdpau" = auto ; then
4544 _vdpau=no
4545 if test "$_dl" = yes ; then
4546 cat > $TMPC <<EOF
4547 #include <vdpau/vdpau_x11.h>
4548 int main(void) {
4549 (void) vdp_device_create_x11(0, 0, 0, 0);
4550 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4552 cc_check -lvdpau && _vdpau=yes
4555 if test "$_vdpau" = yes ; then
4556 def_vdpau='#define CONFIG_VDPAU 1'
4557 libs_mplayer="$libs_mplayer -lvdpau"
4558 _vomodules="vdpau $_vomodules"
4559 else
4560 def_vdpau='#define CONFIG_VDPAU 0'
4561 _novomodules="vdpau $_novomodules"
4562 _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//)
4564 echores "$_vdpau"
4567 echocheck "Xinerama"
4568 if test "$_xinerama" = auto ; then
4569 cat > $TMPC <<EOF
4570 #include <X11/Xlib.h>
4571 #include <X11/extensions/Xinerama.h>
4572 int main(void) { (void) XineramaIsActive(0); return 0; }
4574 _xinerama=no
4575 cc_check -lXinerama && _xinerama=yes
4578 if test "$_xinerama" = yes ; then
4579 def_xinerama='#define CONFIG_XINERAMA 1'
4580 libs_mplayer="$libs_mplayer -lXinerama"
4581 else
4582 def_xinerama='#undef CONFIG_XINERAMA'
4584 echores "$_xinerama"
4587 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4588 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4589 # named 'X extensions' or something similar.
4590 # This check may be useful for future mplayer versions (to change resolution)
4591 # If you run into problems, remove '-lXxf86vm'.
4592 echocheck "Xxf86vm"
4593 if test "$_vm" = auto ; then
4594 cat > $TMPC <<EOF
4595 #include <X11/Xlib.h>
4596 #include <X11/extensions/xf86vmode.h>
4597 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4599 _vm=no
4600 cc_check -lXxf86vm && _vm=yes
4602 if test "$_vm" = yes ; then
4603 def_vm='#define CONFIG_XF86VM 1'
4604 libs_mplayer="$libs_mplayer -lXxf86vm"
4605 else
4606 def_vm='#undef CONFIG_XF86VM'
4608 echores "$_vm"
4610 # Check for the presence of special keycodes, like audio control buttons
4611 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4612 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4613 # have these new keycodes.
4614 echocheck "XF86keysym"
4615 if test "$_xf86keysym" = auto; then
4616 _xf86keysym=no
4617 cat > $TMPC <<EOF
4618 #include <X11/Xlib.h>
4619 #include <X11/XF86keysym.h>
4620 int main(void) { return XF86XK_AudioPause; }
4622 cc_check && _xf86keysym=yes
4624 if test "$_xf86keysym" = yes ; then
4625 def_xf86keysym='#define CONFIG_XF86XK 1'
4626 else
4627 def_xf86keysym='#undef CONFIG_XF86XK'
4629 echores "$_xf86keysym"
4631 echocheck "DGA"
4632 if test "$_dga2" = auto && test "$_x11" = yes ; then
4633 cat > $TMPC << EOF
4634 #include <X11/Xlib.h>
4635 #include <X11/extensions/xf86dga.h>
4636 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4638 _dga2=no
4639 cc_check -lXxf86dga && _dga2=yes
4641 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4642 cat > $TMPC << EOF
4643 #include <X11/Xlib.h>
4644 #include <X11/extensions/xf86dga.h>
4645 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4647 _dga1=no
4648 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4651 _dga=no
4652 def_dga='#undef CONFIG_DGA'
4653 def_dga1='#undef CONFIG_DGA1'
4654 def_dga2='#undef CONFIG_DGA2'
4655 if test "$_dga1" = yes ; then
4656 _dga=yes
4657 def_dga1='#define CONFIG_DGA1 1'
4658 _res_comment="using DGA 1.0"
4659 elif test "$_dga2" = yes ; then
4660 _dga=yes
4661 def_dga2='#define CONFIG_DGA2 1'
4662 _res_comment="using DGA 2.0"
4664 if test "$_dga" = yes ; then
4665 def_dga='#define CONFIG_DGA 1'
4666 libs_mplayer="$libs_mplayer -lXxf86dga"
4667 _vomodules="dga $_vomodules"
4668 else
4669 _novomodules="dga $_novomodules"
4671 echores "$_dga"
4674 echocheck "3dfx"
4675 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4676 def_3dfx='#define CONFIG_3DFX 1'
4677 _vomodules="3dfx $_vomodules"
4678 else
4679 def_3dfx='#undef CONFIG_3DFX'
4680 _novomodules="3dfx $_novomodules"
4682 echores "$_3dfx"
4685 echocheck "VIDIX"
4686 def_vidix='#undef CONFIG_VIDIX'
4687 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4688 _vidix_drv_cyberblade=no
4689 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4690 _vidix_drv_ivtv=no
4691 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4692 _vidix_drv_mach64=no
4693 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4694 _vidix_drv_mga=no
4695 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4696 _vidix_drv_mga_crtc2=no
4697 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4698 _vidix_drv_nvidia=no
4699 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4700 _vidix_drv_pm2=no
4701 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4702 _vidix_drv_pm3=no
4703 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4704 _vidix_drv_radeon=no
4705 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4706 _vidix_drv_rage128=no
4707 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4708 _vidix_drv_s3=no
4709 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4710 _vidix_drv_sh_veu=no
4711 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4712 _vidix_drv_sis=no
4713 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4714 _vidix_drv_unichrome=no
4715 if test "$_vidix" = auto ; then
4716 _vidix=no
4717 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4718 && _vidix=yes
4719 x86_64 && ! linux && _vidix=no
4720 (ppc || alpha) && linux && _vidix=yes
4722 echores "$_vidix"
4724 if test "$_vidix" = yes ; then
4725 def_vidix='#define CONFIG_VIDIX 1'
4726 _vomodules="cvidix $_vomodules"
4727 # FIXME: ivtv driver temporarily disabled until we have a proper test
4728 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4729 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4731 # some vidix drivers are architecture and os specific, discard them elsewhere
4732 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4733 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4735 for driver in $_vidix_drivers ; do
4736 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4737 eval _vidix_drv_${driver}=yes
4738 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4739 done
4741 echocheck "VIDIX PCI device name database"
4742 echores "$_vidix_pcidb"
4743 if test "$_vidix_pcidb" = yes ; then
4744 _vidix_pcidb_val=1
4745 else
4746 _vidix_pcidb_val=0
4749 echocheck "VIDIX dhahelper support"
4750 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4751 echores "$_dhahelper"
4753 echocheck "VIDIX svgalib_helper support"
4754 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4755 echores "$_svgalib_helper"
4757 else
4758 _novomodules="cvidix $_novomodules"
4761 if test "$_vidix" = yes && win32; then
4762 winvidix=yes
4763 _vomodules="winvidix $_vomodules"
4764 libs_mplayer="$libs_mplayer -lgdi32"
4765 else
4766 _novomodules="winvidix $_novomodules"
4768 if test "$_vidix" = yes && test "$_x11" = yes; then
4769 xvidix=yes
4770 _vomodules="xvidix $_vomodules"
4771 else
4772 _novomodules="xvidix $_novomodules"
4775 echocheck "/dev/mga_vid"
4776 if test "$_mga" = auto ; then
4777 _mga=no
4778 test -c /dev/mga_vid && _mga=yes
4780 if test "$_mga" = yes ; then
4781 def_mga='#define CONFIG_MGA 1'
4782 _vomodules="mga $_vomodules"
4783 else
4784 def_mga='#undef CONFIG_MGA'
4785 _novomodules="mga $_novomodules"
4787 echores "$_mga"
4789 echocheck "xmga"
4790 if test "$_xmga" = auto ; then
4791 _xmga=no
4792 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4794 if test "$_xmga" = yes ; then
4795 def_xmga='#define CONFIG_XMGA 1'
4796 _vomodules="xmga $_vomodules"
4797 else
4798 def_xmga='#undef CONFIG_XMGA'
4799 _novomodules="xmga $_novomodules"
4801 echores "$_xmga"
4804 echocheck "GGI"
4805 if test "$_ggi" = auto ; then
4806 cat > $TMPC << EOF
4807 #include <ggi/ggi.h>
4808 int main(void) { ggiInit(); return 0; }
4810 _ggi=no
4811 cc_check -lggi && _ggi=yes
4813 if test "$_ggi" = yes ; then
4814 def_ggi='#define CONFIG_GGI 1'
4815 libs_mplayer="$libs_mplayer -lggi"
4816 _vomodules="ggi $_vomodules"
4817 else
4818 def_ggi='#undef CONFIG_GGI'
4819 _novomodules="ggi $_novomodules"
4821 echores "$_ggi"
4823 echocheck "GGI extension: libggiwmh"
4824 if test "$_ggiwmh" = auto ; then
4825 _ggiwmh=no
4826 cat > $TMPC << EOF
4827 #include <ggi/ggi.h>
4828 #include <ggi/wmh.h>
4829 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4831 cc_check -lggi -lggiwmh && _ggiwmh=yes
4833 # needed to get right output on obscure combination
4834 # like --disable-ggi --enable-ggiwmh
4835 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4836 def_ggiwmh='#define CONFIG_GGIWMH 1'
4837 libs_mplayer="$libs_mplayer -lggiwmh"
4838 else
4839 _ggiwmh=no
4840 def_ggiwmh='#undef CONFIG_GGIWMH'
4842 echores "$_ggiwmh"
4845 echocheck "AA"
4846 if test "$_aa" = auto ; then
4847 cat > $TMPC << EOF
4848 #include <aalib.h>
4849 extern struct aa_hardware_params aa_defparams;
4850 extern struct aa_renderparams aa_defrenderparams;
4851 int main(void) {
4852 aa_context *c;
4853 aa_renderparams *p;
4854 (void) aa_init(0, 0, 0);
4855 c = aa_autoinit(&aa_defparams);
4856 p = aa_getrenderparams();
4857 aa_autoinitkbd(c,0);
4858 return 0; }
4860 _aa=no
4861 for _ld_tmp in "-laa" ; do
4862 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4863 done
4865 if test "$_aa" = yes ; then
4866 def_aa='#define CONFIG_AA 1'
4867 if cygwin ; then
4868 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4870 _vomodules="aa $_vomodules"
4871 else
4872 def_aa='#undef CONFIG_AA'
4873 _novomodules="aa $_novomodules"
4875 echores "$_aa"
4878 echocheck "CACA"
4879 if test "$_caca" = auto ; then
4880 _caca=no
4881 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4882 cat > $TMPC << EOF
4883 #include <caca.h>
4884 #ifdef CACA_API_VERSION_1
4885 #include <caca0.h>
4886 #endif
4887 int main(void) { (void) caca_init(); return 0; }
4889 cc_check $(caca-config --libs) && _caca=yes
4892 if test "$_caca" = yes ; then
4893 def_caca='#define CONFIG_CACA 1'
4894 extra_cflags="$extra_cflags $(caca-config --cflags)"
4895 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4896 _vomodules="caca $_vomodules"
4897 else
4898 def_caca='#undef CONFIG_CACA'
4899 _novomodules="caca $_novomodules"
4901 echores "$_caca"
4904 echocheck "SVGAlib"
4905 if test "$_svga" = auto ; then
4906 cat > $TMPC << EOF
4907 #include <vga.h>
4908 int main(void) { return 0; }
4910 _svga=no
4911 cc_check -lvga $_ld_lm && _svga=yes
4913 if test "$_svga" = yes ; then
4914 def_svga='#define CONFIG_SVGALIB 1'
4915 libs_mplayer="$libs_mplayer -lvga"
4916 _vomodules="svga $_vomodules"
4917 else
4918 def_svga='#undef CONFIG_SVGALIB'
4919 _novomodules="svga $_novomodules"
4921 echores "$_svga"
4924 echocheck "FBDev"
4925 if test "$_fbdev" = auto ; then
4926 _fbdev=no
4927 linux && _fbdev=yes
4929 if test "$_fbdev" = yes ; then
4930 def_fbdev='#define CONFIG_FBDEV 1'
4931 _vomodules="fbdev $_vomodules"
4932 else
4933 def_fbdev='#undef CONFIG_FBDEV'
4934 _novomodules="fbdev $_novomodules"
4936 echores "$_fbdev"
4940 echocheck "DVB"
4941 if test "$_dvb" = auto ; then
4942 _dvb=no
4943 cat >$TMPC << EOF
4944 #include <poll.h>
4945 #include <sys/ioctl.h>
4946 #include <stdio.h>
4947 #include <time.h>
4948 #include <unistd.h>
4949 #include <linux/dvb/dmx.h>
4950 #include <linux/dvb/frontend.h>
4951 #include <linux/dvb/video.h>
4952 #include <linux/dvb/audio.h>
4953 int main(void) {return 0;}
4955 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4956 cc_check $_inc_tmp && _dvb=yes && \
4957 extra_cflags="$extra_cflags $_inc_tmp" && break
4958 done
4960 echores "$_dvb"
4961 if test "$_dvb" = yes ; then
4962 _dvbin=yes
4963 _inputmodules="dvb $_inputmodules"
4964 def_dvb='#define CONFIG_DVB 1'
4965 def_dvbin='#define CONFIG_DVBIN 1'
4966 _aomodules="mpegpes(dvb) $_aomodules"
4967 _vomodules="mpegpes(dvb) $_vomodules"
4968 else
4969 _dvbin=no
4970 _noinputmodules="dvb $_noinputmodules"
4971 def_dvb='#undef CONFIG_DVB'
4972 def_dvbin='#undef CONFIG_DVBIN '
4973 _aomodules="mpegpes(file) $_aomodules"
4974 _vomodules="mpegpes(file) $_vomodules"
4978 if darwin; then
4980 echocheck "QuickTime"
4981 if test "$quicktime" = auto ; then
4982 cat > $TMPC <<EOF
4983 #include <QuickTime/QuickTime.h>
4984 int main(void) {
4985 ImageDescription *desc;
4986 EnterMovies();
4987 ExitMovies();
4988 return 0;
4991 quicktime=no
4992 cc_check -framework QuickTime && quicktime=yes
4994 if test "$quicktime" = yes ; then
4995 extra_ldflags="$extra_ldflags -framework QuickTime"
4996 def_quicktime='#define CONFIG_QUICKTIME 1'
4997 else
4998 def_quicktime='#undef CONFIG_QUICKTIME'
4999 _quartz=no
5001 echores $quicktime
5003 echocheck "Quartz"
5004 if test "$_quartz" = auto ; then
5005 cat > $TMPC <<EOF
5006 #include <Carbon/Carbon.h>
5007 int main(void) {
5008 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
5009 return 0;
5012 _quartz=no
5013 cc_check -framework Carbon && _quartz=yes
5015 if test "$_quartz" = yes ; then
5016 libs_mplayer="$libs_mplayer -framework Carbon"
5017 def_quartz='#define CONFIG_QUARTZ 1'
5018 _vomodules="quartz $_vomodules"
5019 else
5020 def_quartz='#undef CONFIG_QUARTZ'
5021 _novomodules="quartz $_novomodules"
5023 echores $_quartz
5025 echocheck "CoreVideo"
5026 if test "$_corevideo" = auto ; then
5027 cat > $TMPC <<EOF
5028 #include <Carbon/Carbon.h>
5029 #include <CoreServices/CoreServices.h>
5030 #include <OpenGL/OpenGL.h>
5031 #include <QuartzCore/CoreVideo.h>
5032 int main(void) { return 0; }
5034 _corevideo=no
5035 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
5037 if test "$_corevideo" = yes ; then
5038 _vomodules="corevideo $_vomodules"
5039 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
5040 def_corevideo='#define CONFIG_COREVIDEO 1'
5041 else
5042 _novomodules="corevideo $_novomodules"
5043 def_corevideo='#undef CONFIG_COREVIDEO'
5045 echores "$_corevideo"
5047 fi #if darwin
5050 # make sure this stays below CoreVideo to avoid issues due to namespace
5051 # conflicts between -lGL and -framework OpenGL
5052 echocheck "OpenGL"
5053 #Note: this test is run even with --enable-gl since we autodetect linker flags
5054 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
5055 cat > $TMPC << EOF
5056 #ifdef GL_WIN32
5057 #include <windows.h>
5058 #include <GL/gl.h>
5059 #else
5060 #include <GL/gl.h>
5061 #include <X11/Xlib.h>
5062 #include <GL/glx.h>
5063 #endif
5064 int main(void) {
5065 #ifdef GL_WIN32
5066 HDC dc;
5067 wglCreateContext(dc);
5068 #else
5069 glXCreateContext(NULL, NULL, NULL, True);
5070 #endif
5071 glFinish();
5072 return 0;
5075 _gl=no
5076 for _ld_tmp in -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
5077 if cc_check $_ld_tmp $_ld_lm ; then
5078 _gl=yes
5079 _gl_x11=yes
5080 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
5081 break
5083 done
5084 if cc_check -DGL_WIN32 -lopengl32 ; then
5085 _gl=yes
5086 _gl_win32=yes
5087 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
5089 else
5090 _gl=no
5092 if test "$_gl" = yes ; then
5093 def_gl='#define CONFIG_GL 1'
5094 _res_comment="backends:"
5095 if test "$_gl_win32" = yes ; then
5096 def_gl_win32='#define CONFIG_GL_WIN32 1'
5097 _res_comment="$_res_comment win32"
5099 if test "$_gl_x11" = yes ; then
5100 def_gl_x11='#define CONFIG_GL_X11 1'
5101 _res_comment="$_res_comment x11"
5103 _vomodules="opengl $_vomodules"
5104 else
5105 def_gl='#undef CONFIG_GL'
5106 def_gl_win32='#undef CONFIG_GL_WIN32'
5107 def_gl_x11='#undef CONFIG_GL_X11'
5108 _novomodules="opengl $_novomodules"
5110 echores "$_gl"
5113 echocheck "MatrixView"
5114 if test "$_gl" = no ; then
5115 matrixview=no
5117 if test "$matrixview" = yes ; then
5118 _vomodules="matrixview $_vomodules"
5119 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5120 else
5121 _novomodules="matrixview $_novomodules"
5122 def_matrixview='#undef CONFIG_MATRIXVIEW'
5124 echores "$matrixview"
5127 echocheck "PNG support"
5128 if test "$_png" = auto ; then
5129 _png=no
5130 if irix ; then
5131 # Don't check for -lpng on irix since it has its own libpng
5132 # incompatible with the GNU libpng
5133 _res_comment="disabled on irix (not GNU libpng)"
5134 else
5135 cat > $TMPC << EOF
5136 #include <png.h>
5137 #include <string.h>
5138 int main(void) {
5139 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
5140 printf("libpng: %s\n", png_libpng_ver);
5141 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
5144 cc_check -lpng -lz $_ld_lm && _png=yes
5147 echores "$_png"
5148 if test "$_png" = yes ; then
5149 def_png='#define CONFIG_PNG 1'
5150 extra_ldflags="$extra_ldflags -lpng -lz"
5151 else
5152 def_png='#undef CONFIG_PNG'
5155 echocheck "MNG support"
5156 if test "$_mng" = auto ; then
5157 _mng=no
5158 cat > $TMPC << EOF
5159 #include <libmng.h>
5160 int main(void) {
5161 const char * p_ver = mng_version_text();
5162 return !p_ver || p_ver[0] == 0;
5165 if cc_check -lmng -lz $_ld_lm ; then
5166 _mng=yes
5169 echores "$_mng"
5170 if test "$_mng" = yes ; then
5171 def_mng='#define CONFIG_MNG 1'
5172 extra_ldflags="$extra_ldflags -lmng -lz"
5173 else
5174 def_mng='#undef CONFIG_MNG'
5177 echocheck "JPEG support"
5178 if test "$_jpeg" = auto ; then
5179 _jpeg=no
5180 cat > $TMPC << EOF
5181 #include <stdio.h>
5182 #include <stdlib.h>
5183 #include <setjmp.h>
5184 #include <string.h>
5185 #include <jpeglib.h>
5186 int main(void) { return 0; }
5188 cc_check -ljpeg $_ld_lm && _jpeg=yes
5190 echores "$_jpeg"
5192 if test "$_jpeg" = yes ; then
5193 def_jpeg='#define CONFIG_JPEG 1'
5194 _vomodules="jpeg $_vomodules"
5195 extra_ldflags="$extra_ldflags -ljpeg"
5196 else
5197 def_jpeg='#undef CONFIG_JPEG'
5198 _novomodules="jpeg $_novomodules"
5202 echocheck "OpenJPEG (JPEG2000) support"
5203 if test "$libopenjpeg" = auto ; then
5204 libopenjpeg=no
5205 cat > $TMPC << EOF
5206 #define OPJ_STATIC
5207 #include <openjpeg.h>
5208 int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
5210 cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
5212 echores "$libopenjpeg"
5213 if test "$libopenjpeg" = yes ; then
5214 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
5215 extra_ldflags="$extra_ldflags -lopenjpeg"
5216 _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
5217 _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
5218 _codecmodules="OpenJPEG $_codecmodules"
5219 else
5220 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
5221 _nocodecmodules="OpenJPEG $_nocodecmodules"
5225 echocheck "PNM support"
5226 if test "$_pnm" = yes; then
5227 def_pnm="#define CONFIG_PNM 1"
5228 _vomodules="pnm $_vomodules"
5229 else
5230 def_pnm="#undef CONFIG_PNM"
5231 _novomodules="pnm $_novomodules"
5233 echores "$_pnm"
5237 echocheck "GIF support"
5238 # This is to appease people who want to force gif support.
5239 # If it is forced to yes, then we still do checks to determine
5240 # which gif library to use.
5241 if test "$_gif" = yes ; then
5242 _force_gif=yes
5243 _gif=auto
5246 if test "$_gif" = auto ; then
5247 _gif=no
5248 cat > $TMPC << EOF
5249 #include <gif_lib.h>
5250 int main(void) { return 0; }
5252 for _ld_gif in "-lungif" "-lgif" ; do
5253 cc_check $_ld_gif && _gif=yes && break
5254 done
5257 # If no library was found, and the user wants support forced,
5258 # then we force it on with libgif, as this is the safest
5259 # assumption IMHO. (libungif & libregif both create symbolic
5260 # links to libgif. We also assume that no x11 support is needed,
5261 # because if you are forcing this, then you _should_ know what
5262 # you are doing. [ Besides, package maintainers should never
5263 # have compiled x11 deps into libungif in the first place. ] )
5264 # </rant>
5265 # --Joey
5266 if test "$_force_gif" = yes && test "$_gif" = no ; then
5267 _gif=yes
5268 _ld_gif="-lgif"
5271 if test "$_gif" = yes ; then
5272 def_gif='#define CONFIG_GIF 1'
5273 _codecmodules="gif $_codecmodules"
5274 _vomodules="gif89a $_vomodules"
5275 _res_comment="old version, some encoding functions disabled"
5276 def_gif_4='#undef CONFIG_GIF_4'
5277 extra_ldflags="$extra_ldflags $_ld_gif"
5279 cat > $TMPC << EOF
5280 #include <signal.h>
5281 #include <gif_lib.h>
5282 void catch() { exit(1); }
5283 int main(void) {
5284 signal(SIGSEGV, catch); // catch segfault
5285 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5286 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5287 return 0;
5290 if cc_check "$_ld_gif" ; then
5291 def_gif_4='#define CONFIG_GIF_4 1'
5292 _res_comment=""
5294 else
5295 def_gif='#undef CONFIG_GIF'
5296 def_gif_4='#undef CONFIG_GIF_4'
5297 _novomodules="gif89a $_novomodules"
5298 _nocodecmodules="gif $_nocodecmodules"
5300 echores "$_gif"
5303 case "$_gif" in yes*)
5304 echocheck "broken giflib workaround"
5305 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5307 cat > $TMPC << EOF
5308 #include <gif_lib.h>
5309 int main(void) {
5310 GifFileType gif;
5311 printf("UserData is at address %p\n", gif.UserData);
5312 return 0;
5315 if cc_check "$_ld_gif" ; then
5316 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5317 echores "disabled"
5318 else
5319 echores "enabled"
5322 esac
5325 echocheck "VESA support"
5326 if test "$_vesa" = auto ; then
5327 cat > $TMPC << EOF
5328 #include <vbe.h>
5329 int main(void) { vbeVersion(); return 0; }
5331 _vesa=no
5332 cc_check -lvbe -llrmi && _vesa=yes
5334 if test "$_vesa" = yes ; then
5335 def_vesa='#define CONFIG_VESA 1'
5336 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5337 _vomodules="vesa $_vomodules"
5338 else
5339 def_vesa='#undef CONFIG_VESA'
5340 _novomodules="vesa $_novomodules"
5342 echores "$_vesa"
5344 #################
5345 # VIDEO + AUDIO #
5346 #################
5349 echocheck "SDL"
5350 _inc_tmp=""
5351 _ld_tmp=""
5352 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5353 if test -z "$_sdlconfig" ; then
5354 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5355 _sdlconfig="sdl-config"
5356 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5357 _sdlconfig="sdl11-config"
5358 else
5359 _sdlconfig=false
5362 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5363 cat > $TMPC << EOF
5364 #ifdef CONFIG_SDL_SDL_H
5365 #include <SDL/SDL.h>
5366 #else
5367 #include <SDL.h>
5368 #endif
5369 #ifndef __APPLE__
5370 // we allow SDL hacking our main() only on OSX
5371 #undef main
5372 #endif
5373 int main(int argc, char *argv[]) {
5374 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5375 return 0;
5378 _sdl=no
5379 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
5380 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5381 _sdl=yes
5382 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5383 break
5385 done
5386 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5387 _res_comment="using $_sdlconfig"
5388 if cygwin ; then
5389 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5390 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5391 elif mingw32 ; then
5392 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5393 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5394 else
5395 _inc_tmp="$($_sdlconfig --cflags)"
5396 _ld_tmp="$($_sdlconfig --libs)"
5398 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5399 _sdl=yes
5403 if test "$_sdl" = yes ; then
5404 def_sdl='#define CONFIG_SDL 1'
5405 extra_cflags="$extra_cflags $_inc_tmp"
5406 libs_mplayer="$libs_mplayer $_ld_tmp"
5407 _vomodules="sdl $_vomodules"
5408 _aomodules="sdl $_aomodules"
5409 else
5410 def_sdl='#undef CONFIG_SDL'
5411 _novomodules="sdl $_novomodules"
5412 _noaomodules="sdl $_noaomodules"
5414 echores "$_sdl"
5417 if os2 ; then
5418 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5419 if test "$_kva" = auto; then
5420 cat > $TMPC << EOF
5421 #include <os2.h>
5422 #include <kva.h>
5423 int main( void ) { return 0; }
5425 _kva=no;
5426 cc_check -lkva && _kva=yes
5428 if test "$_kva" = yes ; then
5429 def_kva='#define CONFIG_KVA 1'
5430 libs_mplayer="$libs_mplayer -lkva"
5431 _vomodules="kva $_vomodules"
5432 else
5433 def_kva='#undef CONFIG_KVA'
5434 _novomodules="kva $_novomodules"
5436 echores "$_kva"
5437 fi #if os2
5440 if win32; then
5442 echocheck "Windows waveout"
5443 if test "$_win32waveout" = auto ; then
5444 cat > $TMPC << EOF
5445 #include <windows.h>
5446 #include <mmsystem.h>
5447 int main(void) { return 0; }
5449 _win32waveout=no
5450 cc_check -lwinmm && _win32waveout=yes
5452 if test "$_win32waveout" = yes ; then
5453 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5454 libs_mplayer="$libs_mplayer -lwinmm"
5455 _aomodules="win32 $_aomodules"
5456 else
5457 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5458 _noaomodules="win32 $_noaomodules"
5460 echores "$_win32waveout"
5462 echocheck "Direct3D"
5463 if test "$_direct3d" = auto ; then
5464 cat > $TMPC << EOF
5465 #include <windows.h>
5466 #include <d3d9.h>
5467 int main(void) { return 0; }
5469 _direct3d=no
5470 cc_check && _direct3d=yes
5472 if test "$_direct3d" = yes ; then
5473 def_direct3d='#define CONFIG_DIRECT3D 1'
5474 _vomodules="direct3d $_vomodules"
5475 else
5476 def_direct3d='#undef CONFIG_DIRECT3D'
5477 _novomodules="direct3d $_novomodules"
5479 echores "$_direct3d"
5481 echocheck "Directx"
5482 if test "$_directx" = auto ; then
5483 cat > $TMPC << EOF
5484 #include <windows.h>
5485 #include <ddraw.h>
5486 #include <dsound.h>
5487 int main(void) { return 0; }
5489 _directx=no
5490 cc_check -lgdi32 && _directx=yes
5492 if test "$_directx" = yes ; then
5493 def_directx='#define CONFIG_DIRECTX 1'
5494 libs_mplayer="$libs_mplayer -lgdi32"
5495 _vomodules="directx $_vomodules"
5496 _aomodules="dsound $_aomodules"
5497 else
5498 def_directx='#undef CONFIG_DIRECTX'
5499 _novomodules="directx $_novomodules"
5500 _noaomodules="dsound $_noaomodules"
5502 echores "$_directx"
5504 fi #if win32; then
5507 echocheck "DXR2"
5508 if test "$_dxr2" = auto; then
5509 _dxr2=no
5510 cat > $TMPC << EOF
5511 #include <dxr2ioctl.h>
5512 int main(void) { return 0; }
5514 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5515 cc_check $_inc_tmp && _dxr2=yes && \
5516 extra_cflags="$extra_cflags $_inc_tmp" && break
5517 done
5519 if test "$_dxr2" = yes; then
5520 def_dxr2='#define CONFIG_DXR2 1'
5521 _aomodules="dxr2 $_aomodules"
5522 _vomodules="dxr2 $_vomodules"
5523 else
5524 def_dxr2='#undef CONFIG_DXR2'
5525 _noaomodules="dxr2 $_noaomodules"
5526 _novomodules="dxr2 $_novomodules"
5528 echores "$_dxr2"
5530 echocheck "DXR3/H+"
5531 if test "$_dxr3" = auto ; then
5532 cat > $TMPC << EOF
5533 #include <linux/em8300.h>
5534 int main(void) { return 0; }
5536 _dxr3=no
5537 cc_check && _dxr3=yes
5539 if test "$_dxr3" = yes ; then
5540 def_dxr3='#define CONFIG_DXR3 1'
5541 _vomodules="dxr3 $_vomodules"
5542 else
5543 def_dxr3='#undef CONFIG_DXR3'
5544 _novomodules="dxr3 $_novomodules"
5546 echores "$_dxr3"
5549 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5550 if test "$_ivtv" = auto ; then
5551 cat > $TMPC << EOF
5552 #include <stdlib.h>
5553 #include <inttypes.h>
5554 #include <linux/types.h>
5555 #include <linux/videodev2.h>
5556 #include <linux/ivtv.h>
5557 #include <sys/ioctl.h>
5558 int main(void) {
5559 struct ivtv_cfg_stop_decode sd;
5560 struct ivtv_cfg_start_decode sd1;
5561 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5562 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5563 return 0; }
5565 _ivtv=no
5566 cc_check && _ivtv=yes
5568 if test "$_ivtv" = yes ; then
5569 def_ivtv='#define CONFIG_IVTV 1'
5570 _vomodules="ivtv $_vomodules"
5571 _aomodules="ivtv $_aomodules"
5572 else
5573 def_ivtv='#undef CONFIG_IVTV'
5574 _novomodules="ivtv $_novomodules"
5575 _noaomodules="ivtv $_noaomodules"
5577 echores "$_ivtv"
5580 echocheck "V4L2 MPEG Decoder"
5581 if test "$_v4l2" = auto ; then
5582 cat > $TMPC << EOF
5583 #include <stdlib.h>
5584 #include <inttypes.h>
5585 #include <linux/types.h>
5586 #include <linux/videodev2.h>
5587 #include <linux/version.h>
5588 int main(void) {
5589 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5590 #error kernel headers too old, need 2.6.22
5591 #endif
5592 struct v4l2_ext_controls ctrls;
5593 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5594 return 0;
5597 _v4l2=no
5598 cc_check && _v4l2=yes
5600 if test "$_v4l2" = yes ; then
5601 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5602 _vomodules="v4l2 $_vomodules"
5603 _aomodules="v4l2 $_aomodules"
5604 else
5605 def_v4l2='#undef CONFIG_V4L2_DECODER'
5606 _novomodules="v4l2 $_novomodules"
5607 _noaomodules="v4l2 $_noaomodules"
5609 echores "$_v4l2"
5613 #########
5614 # AUDIO #
5615 #########
5618 echocheck "OSS Audio"
5619 if test "$_ossaudio" = auto ; then
5620 cat > $TMPC << EOF
5621 #include <sys/ioctl.h>
5622 #include <$_soundcard_header>
5623 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5625 _ossaudio=no
5626 cc_check && _ossaudio=yes
5628 if test "$_ossaudio" = yes ; then
5629 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5630 _aomodules="oss $_aomodules"
5631 if test "$_linux_devfs" = yes; then
5632 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5633 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5634 else
5635 cat > $TMPC << EOF
5636 #include <sys/ioctl.h>
5637 #include <$_soundcard_header>
5638 #ifdef OPEN_SOUND_SYSTEM
5639 int main(void) { return 0; }
5640 #else
5641 #error Not the real thing
5642 #endif
5644 _real_ossaudio=no
5645 cc_check && _real_ossaudio=yes
5646 if test "$_real_ossaudio" = yes; then
5647 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5648 elif netbsd || openbsd ; then
5649 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5650 extra_ldflags="$extra_ldflags -lossaudio"
5651 else
5652 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5654 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5656 else
5657 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5658 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5659 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5660 _noaomodules="oss $_noaomodules"
5662 echores "$_ossaudio"
5665 echocheck "aRts"
5666 if test "$_arts" = auto ; then
5667 _arts=no
5668 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5670 cat > $TMPC << EOF
5671 #include <artsc.h>
5672 int main(void) { return 0; }
5674 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5679 if test "$_arts" = yes ; then
5680 def_arts='#define CONFIG_ARTS 1'
5681 _aomodules="arts $_aomodules"
5682 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5683 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5684 else
5685 _noaomodules="arts $_noaomodules"
5687 echores "$_arts"
5690 echocheck "EsounD"
5691 if test "$_esd" = auto ; then
5692 _esd=no
5693 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5695 cat > $TMPC << EOF
5696 #include <esd.h>
5697 int main(void) { int fd = esd_open_sound("test"); return fd; }
5699 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5703 echores "$_esd"
5705 if test "$_esd" = yes ; then
5706 def_esd='#define CONFIG_ESD 1'
5707 _aomodules="esd $_aomodules"
5708 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5709 extra_cflags="$extra_cflags $(esd-config --cflags)"
5711 echocheck "esd_get_latency()"
5712 cat > $TMPC << EOF
5713 #include <esd.h>
5714 int main(void) { return esd_get_latency(0); }
5716 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5717 echores "$_esd_latency"
5718 else
5719 def_esd='#undef CONFIG_ESD'
5720 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5721 _noaomodules="esd $_noaomodules"
5725 echocheck "NAS"
5726 if test "$_nas" = auto ; then
5727 cat > $TMPC << EOF
5728 #include <audio/audiolib.h>
5729 int main(void) { return 0; }
5731 _nas=no
5732 cc_check $_ld_lm -laudio -lXt && _nas=yes
5734 if test "$_nas" = yes ; then
5735 def_nas='#define CONFIG_NAS 1'
5736 libs_mplayer="$libs_mplayer -laudio -lXt"
5737 _aomodules="nas $_aomodules"
5738 else
5739 _noaomodules="nas $_noaomodules"
5740 def_nas='#undef CONFIG_NAS'
5742 echores "$_nas"
5745 echocheck "pulse"
5746 if test "$_pulse" = auto ; then
5747 _pulse=no
5748 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5750 cat > $TMPC << EOF
5751 #include <pulse/pulseaudio.h>
5752 int main(void) { return 0; }
5754 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5758 echores "$_pulse"
5760 if test "$_pulse" = yes ; then
5761 def_pulse='#define CONFIG_PULSE 1'
5762 _aomodules="pulse $_aomodules"
5763 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5764 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5765 else
5766 def_pulse='#undef CONFIG_PULSE'
5767 _noaomodules="pulse $_noaomodules"
5771 echocheck "JACK"
5772 if test "$_jack" = auto ; then
5773 _jack=yes
5775 cat > $TMPC << EOF
5776 #include <jack/jack.h>
5777 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5779 if cc_check -ljack ; then
5780 libs_mplayer="$libs_mplayer -ljack"
5781 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5782 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5783 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5784 else
5785 _jack=no
5789 if test "$_jack" = yes ; then
5790 def_jack='#define CONFIG_JACK 1'
5791 _aomodules="jack $_aomodules"
5792 else
5793 _noaomodules="jack $_noaomodules"
5795 echores "$_jack"
5797 echocheck "OpenAL"
5798 if test "$_openal" = auto ; then
5799 _openal=no
5800 cat > $TMPC << EOF
5801 #ifdef OPENAL_AL_H
5802 #include <OpenAL/al.h>
5803 #else
5804 #include <AL/al.h>
5805 #endif
5806 int main(void) {
5807 alSourceQueueBuffers(0, 0, 0);
5808 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5809 return 0;
5812 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5813 cc_check $I && _openal=yes && break
5814 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5815 done
5816 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5818 if test "$_openal" = yes ; then
5819 def_openal='#define CONFIG_OPENAL 1'
5820 _aomodules="openal $_aomodules"
5821 else
5822 _noaomodules="openal $_noaomodules"
5824 echores "$_openal"
5826 echocheck "ALSA audio"
5827 if test "$_alloca" != yes ; then
5828 _alsa=no
5829 _res_comment="alloca missing"
5831 if test "$_alsa" != no ; then
5832 _alsa=no
5833 cat > $TMPC << EOF
5834 #include <sys/time.h>
5835 #include <sys/asoundlib.h>
5836 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5837 #error "alsa version != 0.5.x"
5838 #endif
5839 int main(void) { return 0; }
5841 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5843 cat > $TMPC << EOF
5844 #include <sys/time.h>
5845 #include <sys/asoundlib.h>
5846 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5847 #error "alsa version != 0.9.x"
5848 #endif
5849 int main(void) { return 0; }
5851 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5852 cat > $TMPC << EOF
5853 #include <sys/time.h>
5854 #include <alsa/asoundlib.h>
5855 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5856 #error "alsa version != 0.9.x"
5857 #endif
5858 int main(void) { return 0; }
5860 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5862 cat > $TMPC << EOF
5863 #include <sys/time.h>
5864 #include <sys/asoundlib.h>
5865 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5866 #error "alsa version != 1.0.x"
5867 #endif
5868 int main(void) { return 0; }
5870 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5871 cat > $TMPC << EOF
5872 #include <sys/time.h>
5873 #include <alsa/asoundlib.h>
5874 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5875 #error "alsa version != 1.0.x"
5876 #endif
5877 int main(void) { return 0; }
5879 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5881 def_alsa='#undef CONFIG_ALSA'
5882 def_alsa5='#undef CONFIG_ALSA5'
5883 def_alsa9='#undef CONFIG_ALSA9'
5884 def_alsa1x='#undef CONFIG_ALSA1X'
5885 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5886 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5887 if test "$_alsaver" ; then
5888 _alsa=yes
5889 if test "$_alsaver" = '0.5.x' ; then
5890 _alsa5=yes
5891 _aomodules="alsa5 $_aomodules"
5892 def_alsa5='#define CONFIG_ALSA5 1'
5893 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5894 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5895 elif test "$_alsaver" = '0.9.x-sys' ; then
5896 _alsa9=yes
5897 _aomodules="alsa $_aomodules"
5898 def_alsa='#define CONFIG_ALSA 1'
5899 def_alsa9='#define CONFIG_ALSA9 1'
5900 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5901 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5902 elif test "$_alsaver" = '0.9.x-alsa' ; then
5903 _alsa9=yes
5904 _aomodules="alsa $_aomodules"
5905 def_alsa='#define CONFIG_ALSA 1'
5906 def_alsa9='#define CONFIG_ALSA9 1'
5907 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5908 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5909 elif test "$_alsaver" = '1.0.x-sys' ; then
5910 _alsa1x=yes
5911 _aomodules="alsa $_aomodules"
5912 def_alsa='#define CONFIG_ALSA 1'
5913 def_alsa1x="#define CONFIG_ALSA1X 1"
5914 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5915 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5916 elif test "$_alsaver" = '1.0.x-alsa' ; then
5917 _alsa1x=yes
5918 _aomodules="alsa $_aomodules"
5919 def_alsa='#define CONFIG_ALSA 1'
5920 def_alsa1x="#define CONFIG_ALSA1X 1"
5921 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5922 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5923 else
5924 _alsa=no
5925 _res_comment="unknown version"
5927 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5928 else
5929 _noaomodules="alsa $_noaomodules"
5931 echores "$_alsa"
5934 echocheck "Sun audio"
5935 if test "$_sunaudio" = auto ; then
5936 cat > $TMPC << EOF
5937 #include <sys/types.h>
5938 #include <sys/audioio.h>
5939 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5941 _sunaudio=no
5942 cc_check && _sunaudio=yes
5944 if test "$_sunaudio" = yes ; then
5945 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5946 _aomodules="sun $_aomodules"
5947 else
5948 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5949 _noaomodules="sun $_noaomodules"
5951 echores "$_sunaudio"
5954 def_mlib='#define CONFIG_MLIB 0'
5955 if sunos; then
5956 echocheck "Sun mediaLib"
5957 if test "$_mlib" = auto ; then
5958 _mlib=no
5959 cat > $TMPC << EOF
5960 #include <mlib.h>
5961 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5963 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5965 echores "$_mlib"
5966 fi #if sunos
5969 if darwin; then
5970 echocheck "CoreAudio"
5971 if test "$_coreaudio" = auto ; then
5972 cat > $TMPC <<EOF
5973 #include <CoreAudio/CoreAudio.h>
5974 #include <AudioToolbox/AudioToolbox.h>
5975 #include <AudioUnit/AudioUnit.h>
5976 int main(void) { return 0; }
5978 _coreaudio=no
5979 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5981 if test "$_coreaudio" = yes ; then
5982 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5983 def_coreaudio='#define CONFIG_COREAUDIO 1'
5984 _aomodules="coreaudio $_aomodules"
5985 else
5986 def_coreaudio='#undef CONFIG_COREAUDIO'
5987 _noaomodules="coreaudio $_noaomodules"
5989 echores $_coreaudio
5990 fi #if darwin
5993 if irix; then
5994 echocheck "SGI audio"
5995 if test "$_sgiaudio" = auto ; then
5996 # check for SGI audio
5997 cat > $TMPC << EOF
5998 #include <dmedia/audio.h>
5999 int main(void) { return 0; }
6001 _sgiaudio=no
6002 cc_check && _sgiaudio=yes
6004 if test "$_sgiaudio" = "yes" ; then
6005 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
6006 libs_mplayer="$libs_mplayer -laudio"
6007 _aomodules="sgi $_aomodules"
6008 else
6009 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
6010 _noaomodules="sgi $_noaomodules"
6012 echores "$_sgiaudio"
6013 fi #if irix
6016 if os2 ; then
6017 echocheck "KAI (UNIAUD/DART)"
6018 if test "$_kai" = auto; then
6019 cat > $TMPC << EOF
6020 #include <os2.h>
6021 #include <kai.h>
6022 int main(void) { return 0; }
6024 _kai=no;
6025 cc_check -lkai && _kai=yes
6027 if test "$_kai" = yes ; then
6028 def_kai='#define CONFIG_KAI 1'
6029 libs_mplayer="$libs_mplayer -lkai"
6030 _aomodules="kai $_aomodules"
6031 else
6032 def_kai='#undef CONFIG_KAI'
6033 _noaomodules="kai $_noaomodules"
6035 echores "$_kai"
6037 echocheck "DART"
6038 if test "$_dart" = auto; then
6039 cat > $TMPC << EOF
6040 #include <os2.h>
6041 #include <dart.h>
6042 int main( void ) { return 0; }
6044 _dart=no;
6045 cc_check -ldart && _dart=yes
6047 if test "$_dart" = yes ; then
6048 def_dart='#define CONFIG_DART 1'
6049 libs_mplayer="$libs_mplayer -ldart"
6050 _aomodules="dart $_aomodules"
6051 else
6052 def_dart='#undef CONFIG_DART'
6053 _noaomodules="dart $_noaomodules"
6055 echores "$_dart"
6056 fi #if os2
6059 # set default CD/DVD devices
6060 if win32 || os2 ; then
6061 default_cdrom_device="D:"
6062 elif darwin ; then
6063 default_cdrom_device="/dev/disk1"
6064 elif dragonfly ; then
6065 default_cdrom_device="/dev/cd0"
6066 elif freebsd ; then
6067 default_cdrom_device="/dev/acd0"
6068 elif openbsd ; then
6069 default_cdrom_device="/dev/rcd0a"
6070 elif sunos ; then
6071 default_cdrom_device="/vol/dev/aliases/cdrom0"
6072 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
6073 # file system and the volfs service.
6074 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
6075 elif amigaos ; then
6076 default_cdrom_device="a1ide.device:2"
6077 else
6078 default_cdrom_device="/dev/cdrom"
6081 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
6082 default_dvd_device=$default_cdrom_device
6083 elif darwin ; then
6084 default_dvd_device="/dev/rdiskN"
6085 else
6086 default_dvd_device="/dev/dvd"
6090 echocheck "VCD support"
6091 if test "$_vcd" = auto; then
6092 _vcd=no
6093 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
6094 _vcd=yes
6095 elif mingw32; then
6096 cat > $TMPC << EOF
6097 #include <ddk/ntddcdrm.h>
6098 int main(void) { return 0; }
6100 cc_check && _vcd=yes
6103 if test "$_vcd" = yes; then
6104 _inputmodules="vcd $_inputmodules"
6105 def_vcd='#define CONFIG_VCD 1'
6106 else
6107 def_vcd='#undef CONFIG_VCD'
6108 _noinputmodules="vcd $_noinputmodules"
6109 _res_comment="not supported on this OS"
6111 echores "$_vcd"
6115 echocheck "dvdread"
6116 if test "$_dvdread_internal" = auto ; then
6117 _dvdread_internal=no
6118 _dvdread=no
6119 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
6120 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
6121 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
6122 || darwin || win32 || os2; then
6123 _dvdread_internal=yes
6124 _dvdread=yes
6125 extra_cflags="-Ilibdvdread4 $extra_cflags"
6127 elif test "$_dvdread" = auto ; then
6128 _dvdread=no
6129 if test "$_dl" = yes; then
6130 cat > $TMPC << EOF
6131 #include <inttypes.h>
6132 #include <dvdread/dvd_reader.h>
6133 #include <dvdread/ifo_types.h>
6134 #include <dvdread/ifo_read.h>
6135 #include <dvdread/nav_read.h>
6136 int main(void) { return 0; }
6138 _dvdreadcflags=$($_dvdreadconfig --cflags)
6139 _dvdreadlibs=$($_dvdreadconfig --libs)
6140 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
6141 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
6142 _dvdread=yes
6143 extra_cflags="$extra_cflags $_dvdreadcflags"
6144 extra_ldflags="$extra_ldflags $_dvdreadlibs"
6145 _res_comment="external"
6150 if test "$_dvdread_internal" = yes; then
6151 def_dvdread='#define CONFIG_DVDREAD 1'
6152 _inputmodules="dvdread(internal) $_inputmodules"
6153 _largefiles=yes
6154 _res_comment="internal"
6155 elif test "$_dvdread" = yes; then
6156 def_dvdread='#define CONFIG_DVDREAD 1'
6157 _largefiles=yes
6158 extra_ldflags="$extra_ldflags -ldvdread"
6159 _inputmodules="dvdread(external) $_inputmodules"
6160 _res_comment="external"
6161 else
6162 def_dvdread='#undef CONFIG_DVDREAD'
6163 _noinputmodules="dvdread $_noinputmodules"
6165 echores "$_dvdread"
6168 echocheck "internal libdvdcss"
6169 if test "$_libdvdcss_internal" = auto ; then
6170 _libdvdcss_internal=no
6171 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
6172 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
6174 if test "$_libdvdcss_internal" = yes ; then
6175 if linux || netbsd || openbsd || bsdos ; then
6176 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
6177 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
6178 elif freebsd || dragonfly ; then
6179 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
6180 elif darwin ; then
6181 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
6182 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
6183 elif cygwin ; then
6184 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
6185 elif beos ; then
6186 cflags_libdvdcss="-DSYS_BEOS"
6187 elif os2 ; then
6188 cflags_libdvdcss="-DSYS_OS2"
6190 cflags_libdvdcss_dvdread="-Ilibdvdcss"
6191 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
6192 _inputmodules="libdvdcss(internal) $_inputmodules"
6193 _largefiles=yes
6194 else
6195 _noinputmodules="libdvdcss(internal) $_noinputmodules"
6197 echores "$_libdvdcss_internal"
6200 echocheck "cdparanoia"
6201 if test "$_cdparanoia" = auto ; then
6202 cat > $TMPC <<EOF
6203 #include <cdda_interface.h>
6204 #include <cdda_paranoia.h>
6205 // This need a better test. How ?
6206 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
6208 _cdparanoia=no
6209 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
6210 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
6211 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
6212 done
6214 if test "$_cdparanoia" = yes ; then
6215 _cdda='yes'
6216 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
6217 openbsd && extra_ldflags="$extra_ldflags -lutil"
6219 echores "$_cdparanoia"
6222 echocheck "libcdio"
6223 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
6224 cat > $TMPC << EOF
6225 #include <stdio.h>
6226 #include <cdio/version.h>
6227 #include <cdio/cdda.h>
6228 #include <cdio/paranoia.h>
6229 int main(void) {
6230 void *test = cdda_verbose_set;
6231 printf("%s\n", CDIO_VERSION);
6232 return test == (void *)1;
6235 _libcdio=no
6236 for _ld_tmp in "" "-lwinmm" ; do
6237 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6238 cc_check $_ld_tmp $_ld_lm \
6239 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6240 done
6241 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6242 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6243 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6244 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6245 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6248 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6249 _cdda='yes'
6250 def_libcdio='#define CONFIG_LIBCDIO 1'
6251 def_havelibcdio='yes'
6252 else
6253 if test "$_cdparanoia" = yes ; then
6254 _res_comment="using cdparanoia"
6256 def_libcdio='#undef CONFIG_LIBCDIO'
6257 def_havelibcdio='no'
6259 echores "$_libcdio"
6261 if test "$_cdda" = yes ; then
6262 test $_cddb = auto && test $_network = yes && _cddb=yes
6263 def_cdparanoia='#define CONFIG_CDDA 1'
6264 _inputmodules="cdda $_inputmodules"
6265 else
6266 def_cdparanoia='#undef CONFIG_CDDA'
6267 _noinputmodules="cdda $_noinputmodules"
6270 if test "$_cddb" = yes ; then
6271 def_cddb='#define CONFIG_CDDB 1'
6272 _inputmodules="cddb $_inputmodules"
6273 else
6274 _cddb=no
6275 def_cddb='#undef CONFIG_CDDB'
6276 _noinputmodules="cddb $_noinputmodules"
6279 echocheck "bitmap font support"
6280 if test "$_bitmap_font" = yes ; then
6281 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6282 else
6283 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6285 echores "$_bitmap_font"
6288 echocheck "freetype >= 2.0.9"
6290 # freetype depends on iconv
6291 if test "$_iconv" = no ; then
6292 _freetype=no
6293 _res_comment="iconv support needed"
6296 if test "$_freetype" = auto ; then
6297 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6298 cat > $TMPC << EOF
6299 #include <stdio.h>
6300 #include <ft2build.h>
6301 #include FT_FREETYPE_H
6302 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6303 #error "Need FreeType 2.0.9 or newer"
6304 #endif
6305 int main(void) {
6306 FT_Library library;
6307 FT_Int major=-1,minor=-1,patch=-1;
6308 int err=FT_Init_FreeType(&library);
6309 return 0;
6312 _freetype=no
6313 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6314 else
6315 _freetype=no
6318 if test "$_freetype" = yes ; then
6319 def_freetype='#define CONFIG_FREETYPE 1'
6320 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6321 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6322 else
6323 def_freetype='#undef CONFIG_FREETYPE'
6325 echores "$_freetype"
6327 if test "$_freetype" = no ; then
6328 _fontconfig=no
6329 _res_comment="FreeType support needed"
6331 echocheck "fontconfig"
6332 if test "$_fontconfig" = auto ; then
6333 cat > $TMPC << EOF
6334 #include <stdio.h>
6335 #include <stdlib.h>
6336 #include <fontconfig/fontconfig.h>
6337 #if FC_VERSION < 20402
6338 #error At least version 2.4.2 of fontconfig required
6339 #endif
6340 int main(void) {
6341 int err = FcInit();
6342 if (err == FcFalse) {
6343 printf("Couldn't initialize fontconfig lib\n");
6344 exit(err);
6346 return 0;
6349 _fontconfig=no
6350 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6351 _ld_tmp="-lfontconfig $_ld_tmp"
6352 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6353 done
6354 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6355 _inc_tmp=$($_pkg_config --cflags fontconfig)
6356 _ld_tmp=$($_pkg_config --libs fontconfig)
6357 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6358 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6361 if test "$_fontconfig" = yes ; then
6362 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6363 else
6364 def_fontconfig='#undef CONFIG_FONTCONFIG'
6366 echores "$_fontconfig"
6369 echocheck "SSA/ASS support"
6370 # libass depends on FreeType
6371 if test "$_freetype" = no ; then
6372 _ass=no
6373 ass_internal=no
6374 _res_comment="FreeType support needed"
6377 if test "$_ass" = auto ; then
6378 cat > $TMPC << EOF
6379 #include <ft2build.h>
6380 #include FT_FREETYPE_H
6381 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
6382 #error "Need FreeType 2.2.1 or newer"
6383 #endif
6384 int main(void) { return 0; }
6386 _ass=no
6387 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
6388 if test "$_ass" = no ; then
6389 ass_internal=no
6390 _res_comment="FreeType >= 2.2.1 needed"
6391 elif test "$ass_internal" = no ; then
6392 _res_comment="external"
6393 extra_ldflags="$extra_ldflags -lass"
6396 if test "$_ass" = yes ; then
6397 def_ass='#define CONFIG_ASS 1'
6398 else
6399 def_ass='#undef CONFIG_ASS'
6401 if test "$ass_internal" = yes ; then
6402 def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
6403 else
6404 def_ass_internal='#undef CONFIG_ASS_INTERNAL'
6406 echores "$_ass"
6409 echocheck "fribidi with charsets"
6410 _inc_tmp=""
6411 _ld_tmp=""
6412 if test "$_fribidi" = auto ; then
6413 cat > $TMPC << EOF
6414 #include <stdio.h>
6415 #include <stdlib.h>
6416 /* workaround for fribidi 0.10.4 and below */
6417 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6418 #include <fribidi/fribidi.h>
6419 int main(void) {
6420 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6421 printf("Fribidi headers are not consistents with the library!\n");
6422 exit(1);
6424 return 0;
6427 _fribidi=no
6428 _inc_tmp=""
6429 _ld_tmp="-lfribidi"
6430 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6431 if $_fribidiconfig --version > /dev/null 2>&1 &&
6432 test "$_fribidi" = no ; then
6433 _inc_tmp="$($_fribidiconfig --cflags)"
6434 _ld_tmp="$($_fribidiconfig --libs)"
6435 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6438 if test "$_fribidi" = yes ; then
6439 def_fribidi='#define CONFIG_FRIBIDI 1'
6440 extra_cflags="$extra_cflags $_inc_tmp"
6441 extra_ldflags="$extra_ldflags $_ld_tmp"
6442 else
6443 def_fribidi='#undef CONFIG_FRIBIDI'
6445 echores "$_fribidi"
6448 echocheck "ENCA"
6449 if test "$_enca" = auto ; then
6450 cat > $TMPC << EOF
6451 #include <sys/types.h>
6452 #include <enca.h>
6453 int main(void) {
6454 const char **langs;
6455 size_t langcnt;
6456 langs = enca_get_languages(&langcnt);
6457 return 0;
6460 _enca=no
6461 cc_check -lenca $_ld_lm && _enca=yes
6463 if test "$_enca" = yes ; then
6464 def_enca='#define CONFIG_ENCA 1'
6465 extra_ldflags="$extra_ldflags -lenca"
6466 else
6467 def_enca='#undef CONFIG_ENCA'
6469 echores "$_enca"
6472 echocheck "zlib"
6473 cat > $TMPC << EOF
6474 #include <zlib.h>
6475 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6477 _zlib=no
6478 cc_check -lz && _zlib=yes
6479 if test "$_zlib" = yes ; then
6480 def_zlib='#define CONFIG_ZLIB 1'
6481 extra_ldflags="$extra_ldflags -lz"
6482 else
6483 def_zlib='#define CONFIG_ZLIB 0'
6484 _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//)
6485 _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
6487 echores "$_zlib"
6490 echocheck "bzlib"
6491 bzlib=no
6492 def_bzlib='#define CONFIG_BZLIB 0'
6493 cat > $TMPC << EOF
6494 #include <bzlib.h>
6495 int main(void) { BZ2_bzlibVersion(); return 0; }
6497 cc_check -lbz2 && bzlib=yes
6498 if test "$bzlib" = yes ; then
6499 def_bzlib='#define CONFIG_BZLIB 1'
6500 extra_ldflags="$extra_ldflags -lbz2"
6502 echores "$bzlib"
6505 echocheck "RTC"
6506 if test "$_rtc" = auto ; then
6507 cat > $TMPC << EOF
6508 #include <sys/ioctl.h>
6509 #ifdef __linux__
6510 #include <linux/rtc.h>
6511 #else
6512 #include <rtc.h>
6513 #define RTC_PIE_ON RTCIO_PIE_ON
6514 #endif
6515 int main(void) { return RTC_PIE_ON; }
6517 _rtc=no
6518 cc_check && _rtc=yes
6519 ppc && _rtc=no
6521 if test "$_rtc" = yes ; then
6522 def_rtc='#define HAVE_RTC 1'
6523 else
6524 def_rtc='#undef HAVE_RTC'
6526 echores "$_rtc"
6529 echocheck "liblzo2 support"
6530 if test "$_liblzo" = auto ; then
6531 _liblzo=no
6532 cat > $TMPC << EOF
6533 #include <lzo/lzo1x.h>
6534 int main(void) { lzo_init();return 0; }
6536 cc_check -llzo2 && _liblzo=yes
6538 if test "$_liblzo" = yes ; then
6539 def_liblzo='#define CONFIG_LIBLZO 1'
6540 extra_ldflags="$extra_ldflags -llzo2"
6541 _codecmodules="liblzo $_codecmodules"
6542 else
6543 def_liblzo='#undef CONFIG_LIBLZO'
6544 _nocodecmodules="liblzo $_nocodecmodules"
6546 echores "$_liblzo"
6549 echocheck "mad support"
6550 if test "$_mad" = auto ; then
6551 _mad=no
6552 cat > $TMPC << EOF
6553 #include <mad.h>
6554 int main(void) { return 0; }
6556 cc_check -lmad && _mad=yes
6558 if test "$_mad" = yes ; then
6559 def_mad='#define CONFIG_LIBMAD 1'
6560 extra_ldflags="$extra_ldflags -lmad"
6561 _codecmodules="libmad $_codecmodules"
6562 else
6563 def_mad='#undef CONFIG_LIBMAD'
6564 _nocodecmodules="libmad $_nocodecmodules"
6566 echores "$_mad"
6568 echocheck "Twolame"
6569 if test "$_twolame" = auto ; then
6570 cat > $TMPC <<EOF
6571 #include <twolame.h>
6572 int main(void) { twolame_init(); return 0; }
6574 _twolame=no
6575 cc_check -ltwolame $_ld_lm && _twolame=yes
6577 if test "$_twolame" = yes ; then
6578 def_twolame='#define CONFIG_TWOLAME 1'
6579 libs_mencoder="$libs_mencoder -ltwolame"
6580 _codecmodules="twolame $_codecmodules"
6581 else
6582 def_twolame='#undef CONFIG_TWOLAME'
6583 _nocodecmodules="twolame $_nocodecmodules"
6585 echores "$_twolame"
6587 echocheck "Toolame"
6588 if test "$_toolame" = auto ; then
6589 _toolame=no
6590 if test "$_twolame" = yes ; then
6591 _res_comment="disabled by twolame"
6592 else
6593 cat > $TMPC <<EOF
6594 #include <toolame.h>
6595 int main(void) { toolame_init(); return 0; }
6597 cc_check -ltoolame $_ld_lm && _toolame=yes
6600 if test "$_toolame" = yes ; then
6601 def_toolame='#define CONFIG_TOOLAME 1'
6602 libs_mencoder="$libs_mencoder -ltoolame"
6603 _codecmodules="toolame $_codecmodules"
6604 else
6605 def_toolame='#undef CONFIG_TOOLAME'
6606 _nocodecmodules="toolame $_nocodecmodules"
6608 if test "$_toolamedir" ; then
6609 _res_comment="using $_toolamedir"
6611 echores "$_toolame"
6613 echocheck "OggVorbis support"
6614 if test "$_tremor_internal" = yes; then
6615 _libvorbis=no
6616 elif test "$_tremor" = auto; then
6617 _tremor=no
6618 cat > $TMPC << EOF
6619 #include <tremor/ivorbiscodec.h>
6620 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6622 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6624 if test "$_libvorbis" = auto; then
6625 _libvorbis=no
6626 cat > $TMPC << EOF
6627 #include <vorbis/codec.h>
6628 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6630 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6632 if test "$_tremor_internal" = yes ; then
6633 _vorbis=yes
6634 def_vorbis='#define CONFIG_OGGVORBIS 1'
6635 def_tremor='#define CONFIG_TREMOR 1'
6636 _codecmodules="tremor(internal) $_codecmodules"
6637 _res_comment="internal Tremor"
6638 if test "$_tremor_low" = yes ; then
6639 cflags_tremor_low="-D_LOW_ACCURACY_"
6640 _res_comment="internal low accuracy Tremor"
6642 elif test "$_tremor" = yes ; then
6643 _vorbis=yes
6644 def_vorbis='#define CONFIG_OGGVORBIS 1'
6645 def_tremor='#define CONFIG_TREMOR 1'
6646 _codecmodules="tremor(external) $_codecmodules"
6647 _res_comment="external Tremor"
6648 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6649 elif test "$_libvorbis" = yes ; then
6650 _vorbis=yes
6651 def_vorbis='#define CONFIG_OGGVORBIS 1'
6652 _codecmodules="libvorbis $_codecmodules"
6653 _res_comment="libvorbis"
6654 extra_ldflags="$extra_ldflags -lvorbis -logg"
6655 else
6656 _vorbis=no
6657 _nocodecmodules="libvorbis $_nocodecmodules"
6659 echores "$_vorbis"
6661 echocheck "libspeex (version >= 1.1 required)"
6662 if test "$_speex" = auto ; then
6663 _speex=no
6664 cat > $TMPC << EOF
6665 #include <speex/speex.h>
6666 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6668 cc_check -lspeex $_ld_lm && _speex=yes
6670 if test "$_speex" = yes ; then
6671 def_speex='#define CONFIG_SPEEX 1'
6672 extra_ldflags="$extra_ldflags -lspeex"
6673 _codecmodules="speex $_codecmodules"
6674 else
6675 def_speex='#undef CONFIG_SPEEX'
6676 _nocodecmodules="speex $_nocodecmodules"
6678 echores "$_speex"
6680 echocheck "OggTheora support"
6681 if test "$_theora" = auto ; then
6682 _theora=no
6683 cat > $TMPC << EOF
6684 #include <theora/theora.h>
6685 #include <string.h>
6686 int main(void) {
6687 /* Theora is in flux, make sure that all interface routines and datatypes
6688 * exist and work the way we expect it, so we don't break MPlayer. */
6689 ogg_packet op;
6690 theora_comment tc;
6691 theora_info inf;
6692 theora_state st;
6693 yuv_buffer yuv;
6694 int r;
6695 double t;
6697 theora_info_init(&inf);
6698 theora_comment_init(&tc);
6700 return 0;
6702 /* we don't want to execute this kind of nonsense; just for making sure
6703 * that compilation works... */
6704 memset(&op, 0, sizeof(op));
6705 r = theora_decode_header(&inf, &tc, &op);
6706 r = theora_decode_init(&st, &inf);
6707 t = theora_granule_time(&st, op.granulepos);
6708 r = theora_decode_packetin(&st, &op);
6709 r = theora_decode_YUVout(&st, &yuv);
6710 theora_clear(&st);
6712 return 0;
6715 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6716 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6717 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6718 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6719 if test _theora = no; then
6720 _ld_theora="-ltheora -logg"
6721 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6723 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6724 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6725 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6726 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6727 extra_ldflags="$extra_ldflags $_ld_theora" &&
6728 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6729 if test _theora = no; then
6730 _ld_theora="-ltheora -logg"
6731 cc_check tremor/bitwise.c $_ld_theora &&
6732 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6736 if test "$_theora" = yes ; then
6737 def_theora='#define CONFIG_OGGTHEORA 1'
6738 _codecmodules="libtheora $_codecmodules"
6739 # when --enable-theora is forced, we'd better provide a probably sane
6740 # $_ld_theora than nothing
6741 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6742 else
6743 def_theora='#undef CONFIG_OGGTHEORA'
6744 _nocodecmodules="libtheora $_nocodecmodules"
6746 echores "$_theora"
6748 echocheck "internal mp3lib support"
6749 if test "$_mp3lib" = auto ; then
6750 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6752 if test "$_mp3lib" = yes ; then
6753 def_mp3lib='#define CONFIG_MP3LIB 1'
6754 _codecmodules="mp3lib(internal) $_codecmodules"
6755 else
6756 def_mp3lib='#undef CONFIG_MP3LIB'
6757 _nocodecmodules="mp3lib(internal) $_nocodecmodules"
6759 echores "$_mp3lib"
6761 echocheck "liba52 support"
6762 if test "$_liba52_internal" = auto ; then
6763 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _liba52_internal=no || _liba52_internal=yes
6765 def_liba52='#undef CONFIG_LIBA52'
6766 def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6767 if test "$_liba52_internal" = yes ; then
6768 _liba52=yes
6769 def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6770 _res_comment="internal"
6771 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6772 _liba52=no
6773 cat > $TMPC << EOF
6774 #include <inttypes.h>
6775 #include <a52dec/a52.h>
6776 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6778 cc_check -la52 && _liba52=yes && _res_comment="external" && extra_ldflags="$extra_ldflags -la52"
6780 if test "$_liba52" = yes ; then
6781 def_liba52='#define CONFIG_LIBA52 1'
6782 _codecmodules="liba52($_res_comment) $_codecmodules"
6783 else
6784 _nocodecmodules="liba52 $_nocodecmodules"
6786 echores "$_liba52"
6788 echocheck "internal libmpeg2 support"
6789 if test "$_libmpeg2" = auto ; then
6790 _libmpeg2=yes
6791 if alpha && test cc_vendor=gnu; then
6792 case $cc_version in
6793 2*|3.0*|3.1*) # cannot compile MVI instructions
6794 _libmpeg2=no
6795 _res_comment="broken gcc"
6797 esac
6800 if test "$_libmpeg2" = yes ; then
6801 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6802 _codecmodules="libmpeg2(internal) $_codecmodules"
6803 else
6804 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6805 _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
6807 echores "$_libmpeg2"
6809 echocheck "libdca support"
6810 if test "$_libdca" = auto ; then
6811 _libdca=no
6812 cat > $TMPC << EOF
6813 #include <inttypes.h>
6814 #include <dts.h>
6815 int main(void) { dts_init(0); return 0; }
6817 for _ld_dca in -ldca -ldts ; do
6818 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6819 && _libdca=yes && break
6820 done
6822 if test "$_libdca" = yes ; then
6823 def_libdca='#define CONFIG_LIBDCA 1'
6824 _codecmodules="libdca $_codecmodules"
6825 else
6826 def_libdca='#undef CONFIG_LIBDCA'
6827 _nocodecmodules="libdca $_nocodecmodules"
6829 echores "$_libdca"
6831 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6832 if test "$_musepack" = auto ; then
6833 _musepack=no
6834 cat > $TMPC << EOF
6835 #include <stddef.h>
6836 #include <mpcdec/mpcdec.h>
6837 int main(void) {
6838 mpc_streaminfo info;
6839 mpc_decoder decoder;
6840 mpc_decoder_set_streaminfo(&decoder, &info);
6841 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6842 return 0;
6845 cc_check -lmpcdec $_ld_lm && _musepack=yes
6847 if test "$_musepack" = yes ; then
6848 def_musepack='#define CONFIG_MUSEPACK 1'
6849 extra_ldflags="$extra_ldflags -lmpcdec"
6850 _codecmodules="musepack $_codecmodules"
6851 else
6852 def_musepack='#undef CONFIG_MUSEPACK'
6853 _nocodecmodules="musepack $_nocodecmodules"
6855 echores "$_musepack"
6858 echocheck "FAAC support"
6859 if test "$_faac" = auto ; then
6860 cat > $TMPC <<EOF
6861 #include <inttypes.h>
6862 #include <faac.h>
6863 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6865 _faac=no
6866 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6867 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6868 done
6870 if test "$_faac" = yes ; then
6871 def_faac="#define CONFIG_FAAC 1"
6872 test "$_faac_lavc" = auto && _faac_lavc=yes
6873 if test "$_faac_lavc" = yes ; then
6874 def_faac_lavc="#define CONFIG_LIBFAAC 1"
6875 libs_mplayer="$libs_mplayer $_ld_faac"
6876 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6878 _codecmodules="faac $_codecmodules"
6879 else
6880 _faac_lavc=no
6881 def_faac="#undef CONFIG_FAAC"
6882 def_faac_lavc="#define CONFIG_LIBFAAC 0"
6883 _nocodecmodules="faac $_nocodecmodules"
6885 _res_comment="in libavcodec: $_faac_lavc"
6886 echores "$_faac"
6889 echocheck "FAAD2 support"
6890 if test "$_faad_internal" = auto ; then
6891 if x86_32 && test cc_vendor=gnu; then
6892 case $cc_version in
6893 3.1*|3.2) # ICE/insn with these versions
6894 _faad_internal=no
6895 _res_comment="broken gcc"
6898 _faad=yes
6899 _faad_internal=yes
6901 esac
6902 else
6903 _faad=yes
6904 _faad_internal=yes
6907 if test "$_faad" = auto ; then
6908 cat > $TMPC << EOF
6909 #include <faad.h>
6910 #ifndef FAAD_MIN_STREAMSIZE
6911 #error Too old version
6912 #endif
6913 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6914 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6916 cc_check -lfaad $_ld_lm && _faad=yes
6919 def_faad='#undef CONFIG_FAAD'
6920 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6921 if test "$_faad_internal" = yes ; then
6922 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6923 _res_comment="internal floating-point"
6924 if test "$_faad_fixed" = yes ; then
6925 # The FIXED_POINT implementation of FAAD2 improves performance
6926 # on some platforms, especially for SBR files.
6927 cflags_faad_fixed="-DFIXED_POINT"
6928 _res_comment="internal fixed-point"
6930 elif test "$_faad" = yes ; then
6931 extra_ldflags="$extra_ldflags -lfaad"
6934 if test "$_faad" = yes ; then
6935 def_faad='#define CONFIG_FAAD 1'
6936 if test "$_faad_internal" = yes ; then
6937 _codecmodules="faad2(internal) $_codecmodules"
6938 else
6939 _codecmodules="faad2 $_codecmodules"
6941 else
6942 _faad=no
6943 _nocodecmodules="faad2 $_nocodecmodules"
6945 echores "$_faad"
6948 echocheck "LADSPA plugin support"
6949 if test "$_ladspa" = auto ; then
6950 cat > $TMPC <<EOF
6951 #include <stdio.h>
6952 #include <ladspa.h>
6953 int main(void) {
6954 const LADSPA_Descriptor *ld = NULL;
6955 return 0;
6958 _ladspa=no
6959 cc_check && _ladspa=yes
6961 if test "$_ladspa" = yes; then
6962 def_ladspa="#define CONFIG_LADSPA 1"
6963 else
6964 def_ladspa="#undef CONFIG_LADSPA"
6966 echores "$_ladspa"
6969 echocheck "libbs2b audio filter support"
6970 if test "$_libbs2b" = auto ; then
6971 cat > $TMPC <<EOF
6972 #include <bs2b.h>
6973 #if BS2B_VERSION_MAJOR < 3
6974 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6975 #endif
6976 int main(void) {
6977 t_bs2bdp filter;
6978 filter=bs2b_open();
6979 bs2b_close(filter);
6980 return 0;
6983 _libbs2b=no
6984 if $_pkg_config --exists libbs2b ; then
6985 _inc_tmp=$($_pkg_config --cflags libbs2b)
6986 _ld_tmp=$($_pkg_config --libs libbs2b)
6987 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6988 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6989 else
6990 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6991 -I/usr/local/include/bs2b ; do
6992 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6993 extra_ldflags="$extra_ldflags -lbs2b"
6994 extra_cflags="$extra_cflags $_inc_tmp"
6995 _libbs2b=yes
6996 break
6998 done
7001 def_libbs2b="#undef CONFIG_LIBBS2B"
7002 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
7003 echores "$_libbs2b"
7006 if test -z "$_codecsdir" ; then
7007 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
7008 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
7009 if test -d "$dir" ; then
7010 _codecsdir="$dir"
7011 break;
7013 done
7015 # Fall back on default directory.
7016 if test -z "$_codecsdir" ; then
7017 _codecsdir="$_libdir/codecs"
7018 mingw32 || os2 && _codecsdir="codecs"
7022 echocheck "Win32 codecs"
7023 if test "$_win32dll" = auto ; then
7024 _win32dll=no
7025 if x86_32 && ! qnx; then
7026 _win32dll=yes
7029 if test "$_win32dll" = yes ; then
7030 def_win32dll='#define CONFIG_WIN32DLL 1'
7031 if ! win32 ; then
7032 def_win32_loader='#define WIN32_LOADER 1'
7033 _win32_emulation=yes
7034 else
7035 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
7036 _res_comment="using native windows"
7038 _codecmodules="win32 $_codecmodules"
7039 else
7040 def_win32dll='#undef CONFIG_WIN32DLL'
7041 def_win32_loader='#undef WIN32_LOADER'
7042 _nocodecmodules="win32 $_nocodecmodules"
7044 echores "$_win32dll"
7047 echocheck "XAnim codecs"
7048 if test "$_xanim" = auto ; then
7049 _xanim=no
7050 _res_comment="dynamic loader support needed"
7051 if test "$_dl" = yes ; then
7052 _xanim=yes
7055 if test "$_xanim" = yes ; then
7056 def_xanim='#define CONFIG_XANIM 1'
7057 _codecmodules="xanim $_codecmodules"
7058 else
7059 def_xanim='#undef CONFIG_XANIM'
7060 _nocodecmodules="xanim $_nocodecmodules"
7062 echores "$_xanim"
7065 echocheck "RealPlayer codecs"
7066 if test "$_real" = auto ; then
7067 _real=no
7068 _res_comment="dynamic loader support needed"
7069 if test "$_dl" = yes || test "$_win32dll" = yes &&
7070 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
7071 _real=yes
7074 if test "$_real" = yes ; then
7075 def_real='#define CONFIG_REALCODECS 1'
7076 _codecmodules="real $_codecmodules"
7077 else
7078 def_real='#undef CONFIG_REALCODECS'
7079 _nocodecmodules="real $_nocodecmodules"
7081 echores "$_real"
7084 echocheck "QuickTime codecs"
7085 _qtx_emulation=no
7086 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
7087 if test "$_qtx" = auto ; then
7088 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
7090 if test "$_qtx" = yes ; then
7091 def_qtx='#define CONFIG_QTX_CODECS 1'
7092 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
7093 _codecmodules="qtx $_codecmodules"
7094 darwin || win32 || _qtx_emulation=yes
7095 else
7096 def_qtx='#undef CONFIG_QTX_CODECS'
7097 _nocodecmodules="qtx $_nocodecmodules"
7099 echores "$_qtx"
7101 echocheck "Nemesi Streaming Media libraries"
7102 if test "$_nemesi" = auto && test "$_network" = yes ; then
7103 _nemesi=no
7104 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
7105 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
7106 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
7107 _nemesi=yes
7110 if test "$_nemesi" = yes; then
7111 _native_rtsp=no
7112 def_nemesi='#define CONFIG_LIBNEMESI 1'
7113 _inputmodules="nemesi $_inputmodules"
7114 else
7115 _native_rtsp="$_network"
7116 _nemesi=no
7117 def_nemesi='#undef CONFIG_LIBNEMESI'
7118 _noinputmodules="nemesi $_noinputmodules"
7120 echores "$_nemesi"
7122 echocheck "LIVE555 Streaming Media libraries"
7123 if test "$_live" = auto && test "$_network" = yes ; then
7124 cat > $TMPCPP << EOF
7125 #include <liveMedia.hh>
7126 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
7127 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
7128 #endif
7129 int main(void) { return 0; }
7132 _live=no
7133 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
7134 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
7135 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
7136 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
7137 $_livelibdir/groupsock/libgroupsock.a \
7138 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
7139 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
7140 $extra_ldflags -lstdc++" \
7141 extra_cxxflags="-I$_livelibdir/liveMedia/include \
7142 -I$_livelibdir/UsageEnvironment/include \
7143 -I$_livelibdir/BasicUsageEnvironment/include \
7144 -I$_livelibdir/groupsock/include" && \
7145 _live=yes && break
7146 done
7147 if test "$_live" != yes ; then
7148 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
7149 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
7150 _live_dist=yes
7154 if test "$_live" = yes && test "$_network" = yes; then
7155 test $_livelibdir && _res_comment="using $_livelibdir"
7156 def_live='#define CONFIG_LIVE555 1'
7157 _inputmodules="live555 $_inputmodules"
7158 elif test "$_live_dist" = yes && test "$_network" = yes; then
7159 _res_comment="using distribution version"
7160 _live="yes"
7161 def_live='#define CONFIG_LIVE555 1'
7162 extra_ldflags="$extra_ldflags $ld_tmp"
7163 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
7164 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
7165 _inputmodules="live555 $_inputmodules"
7166 else
7167 _live=no
7168 def_live='#undef CONFIG_LIVE555'
7169 _noinputmodules="live555 $_noinputmodules"
7171 echores "$_live"
7174 echocheck "FFmpeg libavutil"
7175 if test "$_libavutil_a" = auto ; then
7176 if test -d libavutil ; then
7177 _libavutil_a=yes
7178 _res_comment="static"
7179 else
7180 die "MPlayer will not compile without libavutil in the source tree."
7182 elif test "$_libavutil_so" = auto ; then
7183 _libavutil_so=no
7184 cat > $TMPC << EOF
7185 #include <libavutil/common.h>
7186 int main(void) { av_clip(1, 1, 1); return 0; }
7188 if $_pkg_config --exists libavutil ; then
7189 _inc_libavutil=$($_pkg_config --cflags libavutil)
7190 _ld_tmp=$($_pkg_config --libs libavutil)
7191 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7192 && _libavutil_so=yes
7193 elif cc_check -lavutil $_ld_lm ; then
7194 extra_ldflags="$extra_ldflags -lavutil"
7195 _libavutil_so=yes
7196 _res_comment="using libavutil.so, but static libavutil is recommended"
7199 _libavutil=no
7200 def_libavutil='#undef CONFIG_LIBAVUTIL'
7201 def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
7202 def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
7203 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
7204 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
7205 test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
7206 test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
7207 # neither static nor shared libavutil is available, but it is mandatory ...
7208 if test "$_libavutil" = no ; then
7209 die "You need static or shared libavutil, MPlayer will not compile without!"
7211 echores "$_libavutil"
7213 echocheck "FFmpeg libavcodec"
7214 if test "$_libavcodec_a" = auto ; then
7215 _libavcodec_a=no
7216 if test -d libavcodec && test -f libavcodec/utils.c ; then
7217 _libavcodec_a="yes"
7218 _res_comment="static"
7220 elif test "$_libavcodec_so" = auto ; then
7221 _libavcodec_so=no
7222 _res_comment="libavcodec.so is discouraged over static libavcodec"
7223 cat > $TMPC << EOF
7224 #include <libavcodec/avcodec.h>
7225 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
7227 if $_pkg_config --exists libavcodec ; then
7228 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
7229 _ld_tmp=$($_pkg_config --libs libavcodec)
7230 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7231 && _libavcodec_so=yes
7232 elif cc_check -lavcodec $_ld_lm ; then
7233 extra_ldflags="$extra_ldflags -lavcodec"
7234 _libavcodec_so=yes
7235 _res_comment="using libavcodec.so, but static libavcodec is recommended"
7238 _libavcodec=no
7239 def_libavcodec='#undef CONFIG_LIBAVCODEC'
7240 def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
7241 def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
7242 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
7243 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
7244 test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
7245 test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
7246 test "$_libavcodec_mpegaudio_hp" = yes \
7247 && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' \
7248 && mak_libavcodec_mpegaudio_hp='CONFIG_MPEGAUDIO_HP = yes'
7249 if test "$_libavcodec_a" = yes ; then
7250 _codecmodules="libavcodec(internal) $_codecmodules"
7251 elif test "$_libavcodec_so" = yes ; then
7252 _codecmodules="libavcodec.so $_codecmodules"
7253 else
7254 _nocodecmodules="libavcodec $_nocodecmodules"
7256 echores "$_libavcodec"
7258 echocheck "FFmpeg libavformat"
7259 if test "$_libavformat_a" = auto ; then
7260 _libavformat_a=no
7261 if test -d libavformat && test -f libavformat/utils.c ; then
7262 _libavformat_a=yes
7263 _res_comment="static"
7265 elif test "$_libavformat_so" = auto ; then
7266 _libavformat_so=no
7267 cat > $TMPC <<EOF
7268 #include <libavformat/avformat.h>
7269 #include <libavcodec/opt.h>
7270 int main(void) { av_alloc_format_context(); return 0; }
7272 if $_pkg_config --exists libavformat ; then
7273 _inc_libavformat=$($_pkg_config --cflags libavformat)
7274 _ld_tmp=$($_pkg_config --libs libavformat)
7275 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7276 && _libavformat_so=yes
7277 elif cc_check $_ld_lm -lavformat ; then
7278 extra_ldflags="$extra_ldflags -lavformat"
7279 _libavformat_so=yes
7280 _res_comment="using libavformat.so, but static libavformat is recommended"
7283 _libavformat=no
7284 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7285 def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
7286 def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
7287 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
7288 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7289 test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
7290 test "$_libavformat_so" = yes \
7291 && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
7292 echores "$_libavformat"
7294 echocheck "FFmpeg libpostproc"
7295 if test "$_libpostproc_a" = auto ; then
7296 _libpostproc_a=no
7297 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
7298 _libpostproc_a='yes'
7299 _res_comment="static"
7301 elif test "$_libpostproc_so" = auto ; then
7302 _libpostproc_so=no
7303 cat > $TMPC << EOF
7304 #include <inttypes.h>
7305 #include <libpostproc/postprocess.h>
7306 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7308 if cc_check -lpostproc $_ld_lm ; then
7309 extra_ldflags="$extra_ldflags -lpostproc"
7310 _libpostproc_so=yes
7311 _res_comment="using libpostproc.so, but static libpostproc is recommended"
7314 _libpostproc=no
7315 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7316 def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
7317 def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
7318 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
7319 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7320 test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
7321 test "$_libpostproc_so" = yes \
7322 && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
7323 echores "$_libpostproc"
7325 echocheck "FFmpeg libswscale"
7326 if test "$_libswscale_a" = auto ; then
7327 _libswscale_a=no
7328 if test -d libswscale && test -f libswscale/swscale.h ; then
7329 _libswscale_a='yes'
7330 _res_comment="static"
7332 elif test "$_libswscale_so" = auto ; then
7333 _libswscale_so=no
7334 _res_comment="using libswscale.so, but static libswscale is recommended"
7335 cat > $TMPC << EOF
7336 #include <libswscale/swscale.h>
7337 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7339 if $_pkg_config --exists libswscale ; then
7340 _inc_libswscale=$($_pkg_config --cflags libswscale)
7341 _ld_tmp=$($_pkg_config --libs libswscale)
7342 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7343 && _libswscale_so=yes
7344 elif cc_check -lswscale ; then
7345 extra_ldflags="$extra_ldflags -lswscale"
7346 _libswscale_so=yes
7349 _libswscale=no
7350 def_libswscale='#undef CONFIG_LIBSWSCALE'
7351 def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
7352 def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
7353 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
7354 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7355 test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
7356 test "$_libswscale_so" = yes \
7357 && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
7358 echores "$_libswscale"
7360 echocheck "libopencore_amr narrowband"
7361 if test "$_libopencore_amrnb" = auto ; then
7362 _libopencore_amrnb=no
7363 cat > $TMPC << EOF
7364 #include <opencore-amrnb/interf_dec.h>
7365 int main(void) { Decoder_Interface_init(); return 0; }
7367 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7368 if test "$_libavcodec_a" != yes ; then
7369 _libopencore_amrnb=no
7370 _res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
7373 if test "$_libopencore_amrnb" = yes ; then
7374 _libopencore_amr=yes
7375 extra_ldflags="$extra_ldflags -lopencore-amrnb"
7376 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
7377 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
7378 _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
7379 _codecmodules="libopencore_amrnb $_codecmodules"
7380 else
7381 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
7382 _nocodecmodules="libopencore_amrnb $_nocodecmodules"
7384 echores "$_libopencore_amrnb"
7387 echocheck "libopencore_amr wideband"
7388 if test "$_libopencore_amrwb" = auto ; then
7389 _libopencore_amrwb=no
7390 cat > $TMPC << EOF
7391 #include <opencore-amrwb/dec_if.h>
7392 int main(void) { D_IF_init(); return 0; }
7394 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7395 if test "$_libavcodec_a" != yes ; then
7396 _libopencore_amrwb=no
7397 _res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
7400 if test "$_libopencore_amrwb" = yes ; then
7401 _libopencore_amr=yes
7402 extra_ldflags="$extra_ldflags -lopencore-amrwb"
7403 def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
7404 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
7405 _libavencoders="$_libavencoders LIBOPENCORE_AMRWB_DECODER"
7406 _codecmodules="libopencore_amrwb $_codecmodules"
7407 else
7408 def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
7409 _nocodecmodules="libopencore_amrwb $_nocodecmodules"
7411 echores "$_libopencore_amrwb"
7413 echocheck "libdv-0.9.5+"
7414 if test "$_libdv" = auto ; then
7415 _libdv=no
7416 cat > $TMPC <<EOF
7417 #include <libdv/dv.h>
7418 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7420 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7422 if test "$_libdv" = yes ; then
7423 def_libdv='#define CONFIG_LIBDV095 1'
7424 extra_ldflags="$extra_ldflags -ldv"
7425 _codecmodules="libdv $_codecmodules"
7426 else
7427 def_libdv='#undef CONFIG_LIBDV095'
7428 _nocodecmodules="libdv $_nocodecmodules"
7430 echores "$_libdv"
7433 echocheck "Xvid"
7434 if test "$_xvid" = auto ; then
7435 _xvid=no
7436 cat > $TMPC << EOF
7437 #include <xvid.h>
7438 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7440 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7441 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7442 done
7445 if test "$_xvid" = yes ; then
7446 def_xvid='#define CONFIG_XVID4 1'
7447 _codecmodules="xvid $_codecmodules"
7448 else
7449 def_xvid='#undef CONFIG_XVID4'
7450 _nocodecmodules="xvid $_nocodecmodules"
7452 echores "$_xvid"
7454 echocheck "Xvid two pass plugin"
7455 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7456 cat > $TMPC << EOF
7457 #include <xvid.h>
7458 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7460 cc_check && _xvid_lavc=yes
7462 if test "$_xvid_lavc" = yes ; then
7463 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7464 _libavencoders="$_libavencoders LIBXVID_ENCODER"
7465 else
7466 _xvid_lavc=no
7467 def_xvid_lavc='#define CONFIG_LIBXVID 0'
7469 echores "$_xvid_lavc"
7472 echocheck "x264"
7473 if test "$_x264" = auto ; then
7474 cat > $TMPC << EOF
7475 #include <inttypes.h>
7476 #include <x264.h>
7477 #if X264_BUILD < 89
7478 #error We do not support old versions of x264. Get the latest from git.
7479 #endif
7480 int main(void) { x264_encoder_open((void*)0); return 0; }
7482 _x264=no
7483 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7484 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7485 done
7488 if test "$_x264" = yes ; then
7489 def_x264='#define CONFIG_X264 1'
7490 _codecmodules="x264 $_codecmodules"
7491 test "$_x264_lavc" = auto && _x264_lavc=yes
7492 if test "$_x264_lavc" = yes ; then
7493 def_x264_lavc='#define CONFIG_LIBX264 1'
7494 libs_mplayer="$libs_mplayer $_ld_x264"
7495 _libavencoders="$_libavencoders LIBX264_ENCODER"
7497 else
7498 _x264_lavc=no
7499 def_x264='#undef CONFIG_X264'
7500 def_x264_lavc='#define CONFIG_LIBX264 0'
7501 _nocodecmodules="x264 $_nocodecmodules"
7503 _res_comment="in libavcodec: $_x264_lavc"
7504 echores "$_x264"
7507 echocheck "libdirac"
7508 if test "$_libdirac_lavc" = auto; then
7509 _libdirac_lavc=no
7510 if test "$_libavcodec_a" != yes; then
7511 _res_comment="libavcodec (static) is required by libdirac, sorry"
7512 else
7513 cat > $TMPC << EOF
7514 #include <libdirac_encoder/dirac_encoder.h>
7515 #include <libdirac_decoder/dirac_parser.h>
7516 int main(void)
7518 dirac_encoder_context_t enc_ctx;
7519 dirac_decoder_t *dec_handle;
7520 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
7521 dec_handle = dirac_decoder_init(0);
7522 if (dec_handle)
7523 dirac_decoder_close(dec_handle);
7524 return 0;
7527 if $_pkg_config --exists dirac ; then
7528 _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
7529 _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
7530 cc_check $_inc_dirac $_ld_dirac &&
7531 _libdirac_lavc=yes &&
7532 extra_cflags="$extra_cflags $_inc_dirac" &&
7533 extra_ldflags="$extra_ldflags $_ld_dirac"
7537 if test "$_libdirac_lavc" = yes ; then
7538 def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
7539 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
7540 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
7541 _codecmodules="libdirac $_codecmodules"
7542 else
7543 def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
7544 _nocodecmodules="libdirac $_nocodecmodules"
7546 echores "$_libdirac_lavc"
7549 echocheck "libschroedinger"
7550 if test "$_libschroedinger_lavc" = auto ; then
7551 _libschroedinger_lavc=no
7552 if test "$_libavcodec_a" != yes; then
7553 _res_comment="libavcodec (static) is required by libschroedinger, sorry"
7554 else
7555 cat > $TMPC << EOF
7556 #include <schroedinger/schro.h>
7557 int main(void) { schro_init(); return 0; }
7559 if $_pkg_config --exists schroedinger-1.0 ; then
7560 _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
7561 _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
7562 cc_check $_inc_schroedinger $_ld_schroedinger &&
7563 _libschroedinger_lavc=yes &&
7564 extra_cflags="$extra_cflags $_inc_schroedinger" &&
7565 extra_ldflags="$extra_ldflags $_ld_schroedinger"
7569 if test "$_libschroedinger_lavc" = yes ; then
7570 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
7571 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
7572 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
7573 _codecmodules="libschroedinger $_codecmodules"
7574 else
7575 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
7576 _nocodecmodules="libschroedinger $_nocodecmodules"
7578 echores "$_libschroedinger_lavc"
7580 echocheck "libnut"
7581 if test "$_libnut" = auto ; then
7582 cat > $TMPC << EOF
7583 #include <stdio.h>
7584 #include <stdlib.h>
7585 #include <inttypes.h>
7586 #include <libnut.h>
7587 nut_context_tt * nut;
7588 int main(void) { (void)nut_error(0); return 0; }
7590 _libnut=no
7591 cc_check -lnut && _libnut=yes
7594 if test "$_libnut" = yes ; then
7595 def_libnut='#define CONFIG_LIBNUT 1'
7596 extra_ldflags="$extra_ldflags -lnut"
7597 else
7598 def_libnut='#undef CONFIG_LIBNUT'
7600 echores "$_libnut"
7602 #check must be done after libavcodec one
7603 echocheck "zr"
7604 if test "$_zr" = auto ; then
7605 #36067's seem to identify themselves as 36057PQC's, so the line
7606 #below should work for 36067's and 36057's.
7607 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7608 _zr=yes
7609 else
7610 _zr=no
7613 if test "$_zr" = yes ; then
7614 if test "$_libavcodec_a" = yes ; then
7615 def_zr='#define CONFIG_ZR 1'
7616 _vomodules="zr zr2 $_vomodules"
7617 else
7618 _res_comment="libavcodec (static) is required by zr, sorry"
7619 _novomodules="zr $_novomodules"
7620 def_zr='#undef CONFIG_ZR'
7622 else
7623 def_zr='#undef CONFIG_ZR'
7624 _novomodules="zr zr2 $_novomodules"
7626 echores "$_zr"
7628 # mencoder requires (optional) those libs: libmp3lame
7629 if test "$_mencoder" != no ; then
7631 echocheck "libmp3lame"
7632 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7633 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7634 if test "$_mp3lame" = auto ; then
7635 _mp3lame=no
7636 cat > $TMPC <<EOF
7637 #include <lame/lame.h>
7638 int main(void) { lame_version_t lv; (void) lame_init();
7639 get_lame_version_numerical(&lv);
7640 return 0; }
7642 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7644 if test "$_mp3lame" = yes ; then
7645 def_mp3lame="#define CONFIG_MP3LAME 1"
7646 _ld_mp3lame=-lmp3lame
7647 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7648 cat > $TMPC << EOF
7649 #include <lame/lame.h>
7650 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7652 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7653 cat > $TMPC << EOF
7654 #include <lame/lame.h>
7655 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7657 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7658 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7659 if test "$_mp3lame_lavc" = yes ; then
7660 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7661 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
7662 libs_mplayer="$libs_mplayer $_ld_mp3lame"
7664 else
7665 _mp3lame_lavc=no
7666 def_mp3lame='#undef CONFIG_MP3LAME'
7667 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
7669 _res_comment="in libavcodec: $_mp3lame_lavc"
7670 echores "$_mp3lame"
7672 fi # test "$_mencoder" != no
7674 echocheck "mencoder"
7675 if test "$_mencoder" = yes ; then
7676 def_muxers='#define CONFIG_MUXERS 1'
7677 else
7678 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot
7679 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
7680 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
7681 _libavmuxers=""
7682 def_muxers='#define CONFIG_MUXERS 0'
7684 echores "$_mencoder"
7687 echocheck "UnRAR executable"
7688 if test "$_unrar_exec" = auto ; then
7689 _unrar_exec="yes"
7690 mingw32 && _unrar_exec="no"
7692 if test "$_unrar_exec" = yes ; then
7693 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7694 else
7695 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7697 echores "$_unrar_exec"
7699 echocheck "TV interface"
7700 if test "$_tv" = yes ; then
7701 def_tv='#define CONFIG_TV 1'
7702 _inputmodules="tv $_inputmodules"
7703 else
7704 _noinputmodules="tv $_noinputmodules"
7705 def_tv='#undef CONFIG_TV'
7707 echores "$_tv"
7710 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7711 echocheck "*BSD BT848 bt8xx header"
7712 _ioctl_bt848_h=no
7713 for file in "machine/ioctl_bt848.h" \
7714 "dev/bktr/ioctl_bt848.h" \
7715 "dev/video/bktr/ioctl_bt848.h" \
7716 "dev/ic/bt8xx.h" ; do
7717 cat > $TMPC <<EOF
7718 #include <sys/types.h>
7719 #include <sys/ioctl.h>
7720 #include <$file>
7721 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7723 if cc_check ; then
7724 _ioctl_bt848_h=yes
7725 _ioctl_bt848_h_name="$file"
7726 break;
7728 done
7729 if test "$_ioctl_bt848_h" = yes ; then
7730 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7731 _res_comment="using $_ioctl_bt848_h_name"
7732 else
7733 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7735 echores "$_ioctl_bt848_h"
7737 echocheck "*BSD ioctl_meteor.h"
7738 _ioctl_meteor_h=no
7739 for file in "machine/ioctl_meteor.h" \
7740 "dev/bktr/ioctl_meteor.h" \
7741 "dev/video/bktr/ioctl_meteor.h" ; do
7742 cat > $TMPC <<EOF
7743 #include <sys/types.h>
7744 #include <$file>
7745 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7747 if cc_check ; then
7748 _ioctl_meteor_h=yes
7749 _ioctl_meteor_h_name="$file"
7750 break;
7752 done
7753 if test "$_ioctl_meteor_h" = yes ; then
7754 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7755 _res_comment="using $_ioctl_meteor_h_name"
7756 else
7757 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7759 echores "$_ioctl_meteor_h"
7761 echocheck "*BSD BrookTree 848 TV interface"
7762 if test "$_tv_bsdbt848" = auto ; then
7763 _tv_bsdbt848=no
7764 if test "$_tv" = yes ; then
7765 cat > $TMPC <<EOF
7766 #include <sys/types.h>
7767 $def_ioctl_meteor_h_name
7768 $def_ioctl_bt848_h_name
7769 #ifdef IOCTL_METEOR_H_NAME
7770 #include IOCTL_METEOR_H_NAME
7771 #endif
7772 #ifdef IOCTL_BT848_H_NAME
7773 #include IOCTL_BT848_H_NAME
7774 #endif
7775 int main(void) {
7776 ioctl(0, METEORSINPUT, 0);
7777 ioctl(0, TVTUNER_GETFREQ, 0);
7778 return 0;
7781 cc_check && _tv_bsdbt848=yes
7784 if test "$_tv_bsdbt848" = yes ; then
7785 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7786 _inputmodules="tv-bsdbt848 $_inputmodules"
7787 else
7788 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7789 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7791 echores "$_tv_bsdbt848"
7792 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7795 echocheck "DirectShow TV interface"
7796 if test "$_tv_dshow" = auto ; then
7797 _tv_dshow=no
7798 if test "$_tv" = yes && win32 ; then
7799 cat > $TMPC <<EOF
7800 #include <ole2.h>
7801 int main(void) {
7802 void* p;
7803 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7804 return 0;
7807 cc_check -lole32 -luuid && _tv_dshow=yes
7810 if test "$_tv_dshow" = yes ; then
7811 _inputmodules="tv-dshow $_inputmodules"
7812 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7813 extra_ldflags="$extra_ldflags -lole32 -luuid"
7814 else
7815 _noinputmodules="tv-dshow $_noinputmodules"
7816 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7818 echores "$_tv_dshow"
7821 echocheck "Video 4 Linux TV interface"
7822 if test "$_tv_v4l1" = auto ; then
7823 _tv_v4l1=no
7824 if test "$_tv" = yes && linux ; then
7825 cat > $TMPC <<EOF
7826 #include <stdlib.h>
7827 #include <linux/videodev.h>
7828 int main(void) { return 0; }
7830 cc_check && _tv_v4l1=yes
7833 if test "$_tv_v4l1" = yes ; then
7834 _audio_input=yes
7835 _tv_v4l=yes
7836 def_tv_v4l='#define CONFIG_TV_V4L 1'
7837 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7838 _inputmodules="tv-v4l $_inputmodules"
7839 else
7840 _noinputmodules="tv-v4l1 $_noinputmodules"
7841 def_tv_v4l='#undef CONFIG_TV_V4L'
7843 echores "$_tv_v4l1"
7846 echocheck "Video 4 Linux 2 TV interface"
7847 if test "$_tv_v4l2" = auto ; then
7848 _tv_v4l2=no
7849 if test "$_tv" = yes && linux ; then
7850 cat > $TMPC <<EOF
7851 #include <stdlib.h>
7852 #include <linux/types.h>
7853 #include <linux/videodev2.h>
7854 int main(void) { return 0; }
7856 cc_check && _tv_v4l2=yes
7859 if test "$_tv_v4l2" = yes ; then
7860 _audio_input=yes
7861 _tv_v4l=yes
7862 def_tv_v4l='#define CONFIG_TV_V4L 1'
7863 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7864 _inputmodules="tv-v4l2 $_inputmodules"
7865 else
7866 _noinputmodules="tv-v4l2 $_noinputmodules"
7867 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7869 echores "$_tv_v4l2"
7872 echocheck "Radio interface"
7873 if test "$_radio" = yes ; then
7874 def_radio='#define CONFIG_RADIO 1'
7875 _inputmodules="radio $_inputmodules"
7876 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7877 _radio_capture=no
7879 if test "$_radio_capture" = yes ; then
7880 _audio_input=yes
7881 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7882 else
7883 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7885 else
7886 _noinputmodules="radio $_noinputmodules"
7887 def_radio='#undef CONFIG_RADIO'
7888 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7889 _radio_capture=no
7891 echores "$_radio"
7892 echocheck "Capture for Radio interface"
7893 echores "$_radio_capture"
7895 echocheck "Video 4 Linux 2 Radio interface"
7896 if test "$_radio_v4l2" = auto ; then
7897 _radio_v4l2=no
7898 if test "$_radio" = yes && linux ; then
7899 cat > $TMPC <<EOF
7900 #include <stdlib.h>
7901 #include <linux/types.h>
7902 #include <linux/videodev2.h>
7903 int main(void) { return 0; }
7905 cc_check && _radio_v4l2=yes
7908 if test "$_radio_v4l2" = yes ; then
7909 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7910 else
7911 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7913 echores "$_radio_v4l2"
7915 echocheck "Video 4 Linux Radio interface"
7916 if test "$_radio_v4l" = auto ; then
7917 _radio_v4l=no
7918 if test "$_radio" = yes && linux ; then
7919 cat > $TMPC <<EOF
7920 #include <stdlib.h>
7921 #include <linux/videodev.h>
7922 int main(void) { return 0; }
7924 cc_check && _radio_v4l=yes
7927 if test "$_radio_v4l" = yes ; then
7928 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7929 else
7930 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7932 echores "$_radio_v4l"
7934 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7935 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7936 echocheck "*BSD BrookTree 848 Radio interface"
7937 _radio_bsdbt848=no
7938 cat > $TMPC <<EOF
7939 #include <sys/types.h>
7940 $def_ioctl_bt848_h_name
7941 #ifdef IOCTL_BT848_H_NAME
7942 #include IOCTL_BT848_H_NAME
7943 #endif
7944 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7946 cc_check && _radio_bsdbt848=yes
7947 echores "$_radio_bsdbt848"
7948 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7950 if test "$_radio_bsdbt848" = yes ; then
7951 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7952 else
7953 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7956 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7957 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7958 die "Radio driver requires BSD BT848, V4L or V4L2!"
7961 echocheck "Video 4 Linux 2 MPEG PVR interface"
7962 if test "$_pvr" = auto ; then
7963 _pvr=no
7964 if test "$_tv_v4l2" = yes && linux ; then
7965 cat > $TMPC <<EOF
7966 #include <stdlib.h>
7967 #include <inttypes.h>
7968 #include <linux/types.h>
7969 #include <linux/videodev2.h>
7970 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7972 cc_check && _pvr=yes
7975 if test "$_pvr" = yes ; then
7976 def_pvr='#define CONFIG_PVR 1'
7977 _inputmodules="pvr $_inputmodules"
7978 else
7979 _noinputmodules="pvr $_noinputmodules"
7980 def_pvr='#undef CONFIG_PVR'
7982 echores "$_pvr"
7985 echocheck "ftp"
7986 if ! beos && test "$_ftp" = yes ; then
7987 def_ftp='#define CONFIG_FTP 1'
7988 _inputmodules="ftp $_inputmodules"
7989 else
7990 _noinputmodules="ftp $_noinputmodules"
7991 def_ftp='#undef CONFIG_FTP'
7993 echores "$_ftp"
7995 echocheck "vstream client"
7996 if test "$_vstream" = auto ; then
7997 _vstream=no
7998 cat > $TMPC <<EOF
7999 #include <vstream-client.h>
8000 void vstream_error(const char *format, ... ) {}
8001 int main(void) { vstream_start(); return 0; }
8003 cc_check -lvstream-client && _vstream=yes
8005 if test "$_vstream" = yes ; then
8006 def_vstream='#define CONFIG_VSTREAM 1'
8007 _inputmodules="vstream $_inputmodules"
8008 extra_ldflags="$extra_ldflags -lvstream-client"
8009 else
8010 _noinputmodules="vstream $_noinputmodules"
8011 def_vstream='#undef CONFIG_VSTREAM'
8013 echores "$_vstream"
8016 echocheck "OSD menu"
8017 if test "$_menu" = yes ; then
8018 def_menu='#define CONFIG_MENU 1'
8019 test $_dvbin = "yes" && _menu_dvbin=yes
8020 else
8021 def_menu='#undef CONFIG_MENU'
8022 _menu_dvbin=no
8024 echores "$_menu"
8027 echocheck "Subtitles sorting"
8028 if test "$_sortsub" = yes ; then
8029 def_sortsub='#define CONFIG_SORTSUB 1'
8030 else
8031 def_sortsub='#undef CONFIG_SORTSUB'
8033 echores "$_sortsub"
8036 echocheck "XMMS inputplugin support"
8037 if test "$_xmms" = yes ; then
8038 if ( xmms-config --version ) >/dev/null 2>&1 ; then
8039 _xmmsplugindir=$(xmms-config --input-plugin-dir)
8040 _xmmslibdir=$(xmms-config --exec-prefix)/lib
8041 else
8042 _xmmsplugindir=/usr/lib/xmms/Input
8043 _xmmslibdir=/usr/lib
8046 def_xmms='#define CONFIG_XMMS 1'
8047 if darwin ; then
8048 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
8049 else
8050 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
8052 else
8053 def_xmms='#undef CONFIG_XMMS'
8055 echores "$_xmms"
8058 # --------------- GUI specific tests begin -------------------
8059 echocheck "GUI"
8060 echo "$_gui"
8061 if test "$_gui" = yes ; then
8063 # Required libraries
8064 if test "$_libavcodec" != yes ||
8065 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
8066 die "The GUI requires libavcodec with PNG support (needs zlib)."
8068 test "$_freetype" = no && test "$_bitmap_font" = no && \
8069 die "The GUI requires either FreeType or bitmap font support."
8070 if ! win32 ; then
8071 _gui_gtk=yes
8072 test "$_x11" != yes && die "X11 support required for GUI compilation."
8074 echocheck "XShape extension"
8075 if test "$_xshape" = auto ; then
8076 _xshape=no
8077 cat > $TMPC << EOF
8078 #include <X11/Xlib.h>
8079 #include <X11/Xproto.h>
8080 #include <X11/Xutil.h>
8081 #include <X11/extensions/shape.h>
8082 #include <stdlib.h>
8083 int main(void) {
8084 char *name = ":0.0";
8085 Display *wsDisplay;
8086 int exitvar = 0;
8087 int eventbase, errorbase;
8088 if (getenv("DISPLAY"))
8089 name=getenv("DISPLAY");
8090 wsDisplay=XOpenDisplay(name);
8091 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
8092 exitvar=1;
8093 XCloseDisplay(wsDisplay);
8094 return exitvar;
8097 cc_check -lXext && _xshape=yes
8099 if test "$_xshape" = yes ; then
8100 def_xshape='#define CONFIG_XSHAPE 1'
8101 else
8102 die "The GUI requires the X11 extension XShape (which was not found)."
8104 echores "$_xshape"
8106 #Check for GTK
8107 if test "$_gtk1" = no ; then
8108 #Check for GTK2 :
8109 echocheck "GTK+ version"
8111 if $_pkg_config gtk+-2.0 --exists ; then
8112 _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
8113 extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
8114 libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
8115 echores "$_gtk"
8117 # Check for GLIB2
8118 if $_pkg_config glib-2.0 --exists ; then
8119 echocheck "glib version"
8120 _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
8121 libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
8122 echores "$_glib"
8124 def_gui='#define CONFIG_GUI 1'
8125 def_gtk2='#define CONFIG_GTK2 1'
8126 else
8127 _gtk1=yes
8128 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
8130 else
8131 echo "GTK-2 devel packages were not found, trying GTK 1.2"
8132 _gtk1=yes
8136 if test "$_gtk1" = yes ; then
8137 # Check for old GTK (1.2.x)
8138 echocheck "GTK version"
8139 if test -z "$_gtkconfig" ; then
8140 if ( gtk-config --version ) >/dev/null 2>&1 ; then
8141 _gtkconfig="gtk-config"
8142 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
8143 _gtkconfig="gtk12-config"
8144 else
8145 die "The GUI requires GTK devel packages (which were not found)."
8148 _gtk=$($_gtkconfig --version 2>&1)
8149 extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
8150 libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
8151 echores "$_gtk (using $_gtkconfig)"
8153 # Check for GLIB
8154 echocheck "glib version"
8155 if test -z "$_glibconfig" ; then
8156 if ( glib-config --version ) >/dev/null 2>&1 ; then
8157 _glibconfig="glib-config"
8158 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
8159 _glibconfig="glib12-config"
8160 else
8161 die "The GUI requires GLIB devel packages (which were not found)"
8164 _glib=$($_glibconfig --version 2>&1)
8165 libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
8166 echores "$_glib (using $_glibconfig)"
8168 def_gui='#define CONFIG_GUI 1'
8169 def_gtk2='#undef CONFIG_GTK2'
8172 else #if ! win32
8173 _gui_win32=yes
8174 libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
8175 def_gui='#define CONFIG_GUI 1'
8176 def_gtk2='#undef CONFIG_GTK2'
8177 fi #if ! win32
8179 else #if test "$_gui"
8180 def_gui='#undef CONFIG_GUI'
8181 def_gtk2='#undef CONFIG_GTK2'
8182 fi #if test "$_gui"
8183 # --------------- GUI specific tests end -------------------
8186 if test "$_charset" != "noconv" ; then
8187 def_charset="#define MSG_CHARSET \"$_charset\""
8188 else
8189 def_charset="#undef MSG_CHARSET"
8190 _charset="UTF-8"
8193 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
8194 echocheck "iconv program"
8195 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
8196 if test "$?" -ne 0 ; then
8197 echores "no"
8198 echo "No working iconv program found, use "
8199 echo "--charset=UTF-8 to continue anyway."
8200 echo "If you also have problems with iconv library functions use --charset=noconv."
8201 echo "Messages in the GTK-2 interface will be broken then."
8202 exit 1
8203 else
8204 echores "yes"
8208 #############################################################################
8210 echocheck "automatic gdb attach"
8211 if test "$_crash_debug" = yes ; then
8212 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
8213 else
8214 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
8215 _crash_debug=no
8217 echores "$_crash_debug"
8219 echocheck "compiler support for noexecstack"
8220 cat > $TMPC <<EOF
8221 int main(void) { return 0; }
8223 if cc_check -Wl,-z,noexecstack ; then
8224 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
8225 echores "yes"
8226 else
8227 echores "no"
8230 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
8231 if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
8232 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
8233 echores "yes"
8234 else
8235 echores "no"
8239 # Dynamic linking flags
8240 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
8241 _ld_dl_dynamic=''
8242 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
8243 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
8244 _ld_dl_dynamic='-rdynamic'
8247 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
8248 bsdos && extra_ldflags="$extra_ldflags -ldvd"
8249 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
8251 def_debug='#undef MP_DEBUG'
8252 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
8255 echocheck "joystick"
8256 def_joystick='#undef CONFIG_JOYSTICK'
8257 if test "$_joystick" = yes ; then
8258 if linux ; then
8259 # TODO add some check
8260 def_joystick='#define CONFIG_JOYSTICK 1'
8261 else
8262 _joystick="no"
8263 _res_comment="unsupported under $system_name"
8266 echores "$_joystick"
8268 echocheck "lirc"
8269 if test "$_lirc" = auto ; then
8270 _lirc=no
8271 cat > $TMPC <<EOF
8272 #include <lirc/lirc_client.h>
8273 int main(void) { return 0; }
8275 cc_check -llirc_client && _lirc=yes
8277 if test "$_lirc" = yes ; then
8278 def_lirc='#define CONFIG_LIRC 1'
8279 libs_mplayer="$libs_mplayer -llirc_client"
8280 else
8281 def_lirc='#undef CONFIG_LIRC'
8283 echores "$_lirc"
8285 echocheck "lircc"
8286 if test "$_lircc" = auto ; then
8287 _lircc=no
8288 cat > $TMPC <<EOF
8289 #include <lirc/lircc.h>
8290 int main(void) { return 0; }
8292 cc_check -llircc && _lircc=yes
8294 if test "$_lircc" = yes ; then
8295 def_lircc='#define CONFIG_LIRCC 1'
8296 libs_mplayer="$libs_mplayer -llircc"
8297 else
8298 def_lircc='#undef CONFIG_LIRCC'
8300 echores "$_lircc"
8302 if arm; then
8303 # Detect maemo development platform libraries availability (http://www.maemo.org),
8304 # they are used when run on Nokia 770|8x0
8305 echocheck "maemo (Nokia 770|8x0)"
8306 if test "$_maemo" = auto ; then
8307 _maemo=no
8308 cat > $TMPC << EOF
8309 #include <libosso.h>
8310 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
8312 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8314 if test "$_maemo" = yes ; then
8315 def_maemo='#define CONFIG_MAEMO 1'
8316 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8317 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
8318 else
8319 def_maemo='#undef CONFIG_MAEMO'
8321 echores "$_maemo"
8324 #############################################################################
8326 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
8327 # the OMF format needs to come after the 'extern symbol prefix' check, which
8328 # uses nm.
8329 if os2 ; then
8330 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
8333 # linker paths should be the same for mencoder and mplayer
8334 _ld_tmp=""
8335 for I in $libs_mplayer ; do
8336 _tmp=$(echo $I | sed -e 's/^-L.*$//')
8337 if test -z "$_tmp" ; then
8338 extra_ldflags="$extra_ldflags $I"
8339 else
8340 _ld_tmp="$_ld_tmp $I"
8342 done
8343 libs_mplayer=$_ld_tmp
8346 #############################################################################
8347 # 64 bit file offsets?
8348 if test "$_largefiles" = yes || freebsd ; then
8349 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
8350 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
8351 # dvdread support requires this (for off64_t)
8352 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
8356 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
8358 # This must be the last test to be performed. Any other tests following it
8359 # could fail due to linker errors. libdvdnavmini is intentionally not linked
8360 # against libdvdread (to permit MPlayer to use its own copy of the library).
8361 # So any compilation using the flags added here but not linking against
8362 # libdvdread can fail.
8363 echocheck "DVD support (libdvdnav)"
8364 dvdnav_internal=no
8365 if test "$_dvdnav" = auto ; then
8366 if test "$_dvdread_internal" = yes ; then
8367 _dvdnav=yes
8368 dvdnav_internal=yes
8369 _res_comment="internal"
8370 else
8371 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
8374 if test "$_dvdnav" = auto ; then
8375 cat > $TMPC <<EOF
8376 #include <inttypes.h>
8377 #include <dvdnav/dvdnav.h>
8378 int main(void) { dvdnav_t *dvd=0; return 0; }
8380 _dvdnav=no
8381 _dvdnavdir=$($_dvdnavconfig --cflags)
8382 _dvdnavlibs=$($_dvdnavconfig --libs)
8383 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
8385 if test "$_dvdnav" = yes ; then
8386 _largefiles=yes
8387 def_dvdnav='#define CONFIG_DVDNAV 1'
8388 if test "$dvdnav_internal" = yes ; then
8389 cflags_libdvdnav="-Ilibdvdnav"
8390 _inputmodules="dvdnav(internal) $_inputmodules"
8391 else
8392 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
8393 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
8394 _inputmodules="dvdnav $_inputmodules"
8396 else
8397 def_dvdnav='#undef CONFIG_DVDNAV'
8398 _noinputmodules="dvdnav $_noinputmodules"
8400 echores "$_dvdnav"
8402 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8403 # Read dvdnav comment above.
8405 mak_enable () {
8406 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8407 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8408 nprefix=$3;
8409 for part in $list; do
8410 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8411 echo "${nprefix}_$part = yes"
8413 done
8416 #############################################################################
8417 echo "Creating config.mak"
8418 cat > config.mak << EOF
8419 # -------- Generated by configure -----------
8421 # Ensure that locale settings do not interfere with shell commands.
8422 export LC_ALL = C
8424 CONFIGURATION = $_configuration
8426 CHARSET = $_charset
8427 DOC_LANGS = $language_doc
8428 DOC_LANG_ALL = $doc_lang_all
8429 MAN_LANGS = $language_man
8430 MAN_LANG_ALL = $man_lang_all
8432 prefix = \$(DESTDIR)$_prefix
8433 BINDIR = \$(DESTDIR)$_bindir
8434 DATADIR = \$(DESTDIR)$_datadir
8435 LIBDIR = \$(DESTDIR)$_libdir
8436 MANDIR = \$(DESTDIR)$_mandir
8437 CONFDIR = \$(DESTDIR)$_confdir
8439 AR = $_ar
8440 AS = $_cc
8441 CC = $_cc
8442 CXX = $_cc
8443 HOST_CC = $_host_cc
8444 INSTALL = $_install
8445 INSTALLSTRIP = $_install_strip
8446 WINDRES = $_windres
8448 CFLAGS = $CFLAGS $extra_cflags
8449 ASFLAGS = \$(CFLAGS)
8450 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
8452 CFLAGS_DHAHELPER = $cflags_dhahelper
8453 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
8454 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
8455 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
8456 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
8457 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
8458 CFLAGS_STACKREALIGN = $cflags_stackrealign
8459 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
8460 CFLAGS_TREMOR_LOW = $cflags_tremor_low
8462 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
8463 EXTRALIBS_MPLAYER = $libs_mplayer
8464 EXTRALIBS_MENCODER = $libs_mencoder
8466 GETCH = $_getch
8467 HELP_FILE = $_mp_help
8468 TIMER = $_timer
8470 EXESUF = $_exesuf
8471 EXESUFS_ALL = .exe
8473 ARCH = $arch
8474 $(mak_enable "$arch_all" "$arch" ARCH)
8475 $(mak_enable "$subarch_all" "$subarch" ARCH)
8476 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
8478 MENCODER = $_mencoder
8479 MPLAYER = $_mplayer
8481 NEED_GETTIMEOFDAY = $_need_gettimeofday
8482 NEED_GLOB = $_need_glob
8483 NEED_MMAP = $_need_mmap
8484 NEED_SETENV = $_need_setenv
8485 NEED_SHMEM = $_need_shmem
8486 NEED_STRSEP = $_need_strsep
8487 NEED_SWAB = $_need_swab
8488 NEED_VSSCANF = $_need_vsscanf
8490 # features
8491 3DFX = $_3dfx
8492 AA = $_aa
8493 ALSA1X = $_alsa1x
8494 ALSA9 = $_alsa9
8495 ALSA5 = $_alsa5
8496 APPLE_IR = $_apple_ir
8497 APPLE_REMOTE = $_apple_remote
8498 ARTS = $_arts
8499 AUDIO_INPUT = $_audio_input
8500 BITMAP_FONT = $_bitmap_font
8501 BL = $_bl
8502 CACA = $_caca
8503 CDDA = $_cdda
8504 CDDB = $_cddb
8505 COREAUDIO = $_coreaudio
8506 COREVIDEO = $_corevideo
8507 DART = $_dart
8508 DFBMGA = $_dfbmga
8509 DGA = $_dga
8510 DIRECT3D = $_direct3d
8511 DIRECTFB = $_directfb
8512 DIRECTX = $_directx
8513 DVBIN = $_dvbin
8514 DVDNAV = $_dvdnav
8515 DVDNAV_INTERNAL = $dvdnav_internal
8516 DVDREAD = $_dvdread
8517 DVDREAD_INTERNAL = $_dvdread_internal
8518 DXR2 = $_dxr2
8519 DXR3 = $_dxr3
8520 ESD = $_esd
8521 FAAC=$_faac
8522 FAAD = $_faad
8523 FAAD_INTERNAL = $_faad_internal
8524 FASTMEMCPY = $_fastmemcpy
8525 FBDEV = $_fbdev
8526 FREETYPE = $_freetype
8527 FTP = $_ftp
8528 GIF = $_gif
8529 GGI = $_ggi
8530 GL = $_gl
8531 GL_WIN32 = $_gl_win32
8532 GL_X11 = $_gl_x11
8533 MATRIXVIEW = $matrixview
8534 GUI = $_gui
8535 GUI_GTK = $_gui_gtk
8536 GUI_WIN32 = $_gui_win32
8537 HAVE_POSIX_SELECT = $_posix_select
8538 HAVE_SYS_MMAN_H = $_mman
8539 IVTV = $_ivtv
8540 JACK = $_jack
8541 JOYSTICK = $_joystick
8542 JPEG = $_jpeg
8543 KAI = $_kai
8544 KVA = $_kva
8545 LADSPA = $_ladspa
8546 LIBA52 = $_liba52
8547 LIBA52_INTERNAL = $_liba52_internal
8548 LIBASS = $_ass
8549 LIBASS_INTERNAL = $ass_internal
8550 LIBBS2B = $_libbs2b
8551 LIBDCA = $_libdca
8552 LIBDV = $_libdv
8553 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
8554 LIBLZO = $_liblzo
8555 LIBMAD = $_mad
8556 LIBMENU = $_menu
8557 LIBMENU_DVBIN = $_menu_dvbin
8558 LIBMPEG2 = $_libmpeg2
8559 LIBNEMESI = $_nemesi
8560 LIBNUT = $_libnut
8561 LIBSMBCLIENT = $_smb
8562 LIBTHEORA = $_theora
8563 LIRC = $_lirc
8564 LIVE555 = $_live
8565 MACOSX_FINDER = $_macosx_finder
8566 MD5SUM = $_md5sum
8567 MGA = $_mga
8568 MNG = $_mng
8569 MP3LAME = $_mp3lame
8570 MP3LIB = $_mp3lib
8571 MUSEPACK = $_musepack
8572 NAS = $_nas
8573 NATIVE_RTSP = $_native_rtsp
8574 NETWORK = $_network
8575 OPENAL = $_openal
8576 OSS = $_ossaudio
8577 PE_EXECUTABLE = $_pe_executable
8578 PNG = $_png
8579 PNM = $_pnm
8580 PRIORITY = $_priority
8581 PULSE = $_pulse
8582 PVR = $_pvr
8583 QTX_CODECS = $_qtx
8584 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8585 QTX_EMULATION = $_qtx_emulation
8586 QUARTZ = $_quartz
8587 RADIO=$_radio
8588 RADIO_CAPTURE=$_radio_capture
8589 REAL_CODECS = $_real
8590 S3FB = $_s3fb
8591 SDL = $_sdl
8592 SPEEX = $_speex
8593 STREAM_CACHE = $_stream_cache
8594 SGIAUDIO = $_sgiaudio
8595 SUNAUDIO = $_sunaudio
8596 SVGA = $_svga
8597 TDFXFB = $_tdfxfb
8598 TDFXVID = $_tdfxvid
8599 TGA = $_tga
8600 TOOLAME=$_toolame
8601 TREMOR_INTERNAL = $_tremor_internal
8602 TV = $_tv
8603 TV_BSDBT848 = $_tv_bsdbt848
8604 TV_DSHOW = $_tv_dshow
8605 TV_V4L = $_tv_v4l
8606 TV_V4L1 = $_tv_v4l1
8607 TV_V4L2 = $_tv_v4l2
8608 TWOLAME=$_twolame
8609 UNRAR_EXEC = $_unrar_exec
8610 V4L2 = $_v4l2
8611 VCD = $_vcd
8612 VDPAU = $_vdpau
8613 VESA = $_vesa
8614 VIDIX = $_vidix
8615 VIDIX_PCIDB = $_vidix_pcidb_val
8616 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8617 VIDIX_IVTV=$_vidix_drv_ivtv
8618 VIDIX_MACH64=$_vidix_drv_mach64
8619 VIDIX_MGA=$_vidix_drv_mga
8620 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8621 VIDIX_NVIDIA=$_vidix_drv_nvidia
8622 VIDIX_PM2=$_vidix_drv_pm2
8623 VIDIX_PM3=$_vidix_drv_pm3
8624 VIDIX_RADEON=$_vidix_drv_radeon
8625 VIDIX_RAGE128=$_vidix_drv_rage128
8626 VIDIX_S3=$_vidix_drv_s3
8627 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8628 VIDIX_SIS=$_vidix_drv_sis
8629 VIDIX_UNICHROME=$_vidix_drv_unichrome
8630 VORBIS = $_vorbis
8631 VSTREAM = $_vstream
8632 WII = $_wii
8633 WIN32DLL = $_win32dll
8634 WIN32WAVEOUT = $_win32waveout
8635 WIN32_EMULATION = $_win32_emulation
8636 WINVIDIX = $winvidix
8637 X11 = $_x11
8638 X264 = $_x264
8639 XANIM_CODECS = $_xanim
8640 XMGA = $_xmga
8641 XMMS_PLUGINS = $_xmms
8642 XV = $_xv
8643 XVID4 = $_xvid
8644 XVIDIX = $xvidix
8645 XVMC = $_xvmc
8646 XVR100 = $_xvr100
8647 YUV4MPEG = $_yuv4mpeg
8648 ZR = $_zr
8650 # FFmpeg
8651 LIBAVUTIL = $_libavutil
8652 LIBAVUTIL_A = $_libavutil_a
8653 LIBAVUTIL_SO = $_libavutil_so
8654 LIBAVCODEC = $_libavcodec
8655 LIBAVCODEC_A = $_libavcodec_a
8656 LIBAVCODEC_SO = $_libavcodec_so
8657 LIBAVFORMAT = $_libavformat
8658 LIBAVFORMAT_A = $_libavformat_a
8659 LIBAVFORMAT_SO = $_libavformat_so
8660 LIBPOSTPROC = $_libpostproc
8661 LIBPOSTPROC_A = $_libpostproc_a
8662 LIBPOSTPROC_SO = $_libpostproc_so
8663 LIBSWSCALE = $_libswscale
8664 LIBSWSCALE_A = $_libswscale_a
8665 LIBSWSCALE_SO = $_libswscale_so
8667 HOSTCC = \$(HOST_CC)
8668 HOSTCFLAGS = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
8669 HOSTLIBS = -lm
8670 CC_O = -o \$@
8671 LD = gcc
8672 RANLIB = $_ranlib
8673 YASM = $_yasm
8674 YASMFLAGS = $YASMFLAGS
8676 CONFIG_STATIC = yes
8677 SRC_PATH = ..
8678 BUILD_ROOT = ..
8679 LIBPREF = lib
8680 LIBSUF = .a
8681 LIBNAME = \$(LIBPREF)\$(NAME)\$(LIBSUF)
8682 FULLNAME = \$(NAME)\$(BUILDSUF)
8684 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8685 CONFIG_AANDCT = yes
8686 CONFIG_DCT = yes
8687 CONFIG_DWT = yes
8688 CONFIG_FFT = yes
8689 CONFIG_GOLOMB = yes
8690 CONFIG_H264DSP = yes
8691 CONFIG_LPC = yes
8692 CONFIG_LSP = yes
8693 CONFIG_MDCT = yes
8694 CONFIG_RDFT = yes
8696 $mak_hardcoded_tables
8697 $mak_libavcodec_mpegaudio_hp
8698 !CONFIG_LIBRTMP = yes
8700 CONFIG_BZLIB = $bzlib
8701 CONFIG_ENCODERS = yes
8702 CONFIG_GPL = yes
8703 CONFIG_LIBDIRAC_DECODER = $_libdirac_lavc
8704 CONFIG_LIBDIRAC_ENCODER = $_libdirac_lavc
8705 CONFIG_LIBFAAC_ENCODER = $_faac_lavc
8706 CONFIG_LIBMP3LAME_ENCODER = $_mp3lame_lavc
8707 CONFIG_LIBOPENCORE_AMRNB_DECODER = $_libopencore_amrnb
8708 CONFIG_LIBOPENCORE_AMRNB_ENCODER = $_libopencore_amrnb
8709 CONFIG_LIBOPENCORE_AMRWB_DECODER = $_libopencore_amrwb
8710 OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
8711 OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
8712 CONFIG_LIBSCHROEDINGER_DECODER = $_libschroedinger_lavc
8713 CONFIG_LIBSCHROEDINGER_ENCODER = $_libschroedinger_lavc
8714 CONFIG_LIBVORBIS_ENCODER = $_libvorbis
8715 CONFIG_LIBX264_ENCODER = $_x264_lavc
8716 CONFIG_LIBXVID_ENCODER = $_xvid_lavc
8717 CONFIG_MLIB = $_mlib
8718 CONFIG_MUXERS = $_mencoder
8719 CONFIG_POSTPROC = yes
8720 CONFIG_VDPAU = $_vdpau
8721 CONFIG_XVMC = $_xvmc
8722 CONFIG_ZLIB = $_zlib
8724 HAVE_PTHREADS = $_pthreads
8725 HAVE_SHM = $_shm
8726 HAVE_W32THREADS = $_w32threads
8727 HAVE_YASM = $have_yasm
8729 $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8730 $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8731 $(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8732 $(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8733 $(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8734 $(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8735 $(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8736 $(echo $_libavhwaccels | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8739 #############################################################################
8741 ff_config_enable () {
8742 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8743 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8744 _nprefix=$3;
8745 test -z "$_nprefix" && _nprefix='CONFIG'
8746 for part in $list; do
8747 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8748 echo "#define ${_nprefix}_$part 1"
8749 else
8750 echo "#define ${_nprefix}_$part 0"
8752 done
8755 echo "Creating config.h"
8756 cat > $TMPH << EOF
8757 /*----------------------------------------------------------------------------
8758 ** This file has been automatically generated by configure any changes in it
8759 ** will be lost when you run configure again.
8760 ** Instead of modifying definitions here, use the --enable/--disable options
8761 ** of the configure script! See ./configure --help for details.
8762 *---------------------------------------------------------------------------*/
8764 #ifndef MPLAYER_CONFIG_H
8765 #define MPLAYER_CONFIG_H
8767 /* Undefine this if you do not want to select mono audio (left or right)
8768 with a stereo MPEG layer 2/3 audio stream. The command line option
8769 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8770 right-only), with 0 being the default.
8772 #define CONFIG_FAKE_MONO 1
8774 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8775 #define MAX_OUTBURST 65536
8777 /* set up audio OUTBURST. Do not change this! */
8778 #define OUTBURST 512
8780 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8781 #undef FAST_OSD
8782 #undef FAST_OSD_TABLE
8784 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8785 #define MPEG12_POSTPROC 1
8786 #define ATTRIBUTE_ALIGNED_MAX 16
8790 #define CONFIGURATION "$_configuration"
8792 #define MPLAYER_DATADIR "$_datadir"
8793 #define MPLAYER_CONFDIR "$_confdir"
8794 #define MPLAYER_LIBDIR "$_libdir"
8796 /* definitions needed by included libraries */
8797 #define HAVE_INTTYPES_H 1
8798 /* libmpeg2 + FFmpeg */
8799 $def_fast_inttypes
8800 /* libdvdcss */
8801 #define HAVE_ERRNO_H 1
8802 /* libdvdcss + libdvdread */
8803 #define HAVE_LIMITS_H 1
8804 /* libdvdcss + libfaad2 */
8805 #define HAVE_UNISTD_H 1
8806 /* libfaad2 + libdvdread */
8807 #define STDC_HEADERS 1
8808 #define HAVE_MEMCPY 1
8809 /* libfaad2 */
8810 #define HAVE_STRING_H 1
8811 #define HAVE_STRINGS_H 1
8812 #define HAVE_SYS_STAT_H 1
8813 #define HAVE_SYS_TYPES_H 1
8814 /* libdvdnav */
8815 #define READ_CACHE_TRACE 0
8816 /* libdvdread */
8817 #define HAVE_DLFCN_H 1
8818 $def_dvdcss
8821 /* system headers */
8822 $def_alloca_h
8823 $def_alsa_asoundlib_h
8824 $def_altivec_h
8825 $def_malloc_h
8826 $def_mman_h
8827 $def_mman_has_map_failed
8828 $def_soundcard_h
8829 $def_sys_asoundlib_h
8830 $def_sys_soundcard_h
8831 $def_sys_sysinfo_h
8832 $def_termios_h
8833 $def_termios_sys_h
8834 $def_winsock2_h
8837 /* system functions */
8838 $def_gethostbyname2
8839 $def_gettimeofday
8840 $def_glob
8841 $def_langinfo
8842 $def_lrintf
8843 $def_map_memalign
8844 $def_memalign
8845 $def_nanosleep
8846 $def_posix_select
8847 $def_select
8848 $def_setenv
8849 $def_setmode
8850 $def_shm
8851 $def_strsep
8852 $def_swab
8853 $def_sysi86
8854 $def_sysi86_iv
8855 $def_termcap
8856 $def_termios
8857 $def_vsscanf
8860 /* system-specific features */
8861 $def_asmalign_pot
8862 $def_builtin_expect
8863 $def_dl
8864 $def_dos_paths
8865 $def_extern_asm
8866 $def_extern_prefix
8867 $def_iconv
8868 $def_kstat
8869 $def_macosx_bundle
8870 $def_macosx_finder
8871 $def_maemo
8872 $def_named_asm_args
8873 $def_priority
8874 $def_quicktime
8875 $def_restrict_keyword
8876 $def_rtc
8877 $def_unrar_exec
8880 /* configurable options */
8881 $def_charset
8882 $def_crash_debug
8883 $def_debug
8884 $def_dynamic_plugins
8885 $def_fastmemcpy
8886 $def_menu
8887 $def_runtime_cpudetection
8888 $def_sighandler
8889 $def_sortsub
8890 $def_stream_cache
8891 $def_pthread_cache
8894 /* CPU stuff */
8895 #define __CPU__ $iproc
8896 $def_words_endian
8897 $def_bigendian
8898 $(ff_config_enable "$arch_all" "$arch" "ARCH")
8899 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
8900 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
8903 /* DVD/VCD/CD */
8904 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8905 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8906 $def_bsdi_dvd
8907 $def_cddb
8908 $def_cdio
8909 $def_cdparanoia
8910 $def_cdrom
8911 $def_dvd
8912 $def_dvd_bsd
8913 $def_dvd_darwin
8914 $def_dvd_linux
8915 $def_dvd_openbsd
8916 $def_dvdio
8917 $def_dvdnav
8918 $def_dvdread
8919 $def_hpux_scsi_h
8920 $def_libcdio
8921 $def_sol_scsi_h
8922 $def_vcd
8925 /* codec libraries */
8926 $def_faac
8927 $def_faad
8928 $def_faad_internal
8929 $def_liba52
8930 $def_liba52_internal
8931 $def_libdca
8932 $def_libdv
8933 $def_liblzo
8934 $def_libmpeg2
8935 $def_mad
8936 $def_mp3lame
8937 $def_mp3lame_preset
8938 $def_mp3lame_preset_medium
8939 $def_mp3lib
8940 $def_musepack
8941 $def_speex
8942 $def_theora
8943 $def_toolame
8944 $def_tremor
8945 $def_twolame
8946 $def_vorbis
8947 $def_x264
8948 $def_xvid
8949 $def_zlib
8951 $def_libnut
8954 /* binary codecs */
8955 $def_qtx
8956 $def_qtx_win32
8957 $def_real
8958 $def_win32_loader
8959 $def_win32dll
8960 $def_xanim
8961 $def_xmms
8962 #define BINARY_CODECS_PATH "$_codecsdir"
8963 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8966 /* GUI */
8967 $def_gtk2
8968 $def_gui
8969 $def_xshape
8972 /* Audio output drivers */
8973 $def_alsa
8974 $def_alsa1x
8975 $def_alsa5
8976 $def_alsa9
8977 $def_arts
8978 $def_coreaudio
8979 $def_dart
8980 $def_esd
8981 $def_esd_latency
8982 $def_jack
8983 $def_kai
8984 $def_nas
8985 $def_openal
8986 $def_openal_h
8987 $def_ossaudio
8988 $def_ossaudio_devdsp
8989 $def_ossaudio_devmixer
8990 $def_pulse
8991 $def_sgiaudio
8992 $def_sunaudio
8993 $def_win32waveout
8995 $def_ladspa
8996 $def_libbs2b
8999 /* input */
9000 $def_apple_ir
9001 $def_apple_remote
9002 $def_ioctl_bt848_h_name
9003 $def_ioctl_meteor_h_name
9004 $def_joystick
9005 $def_lirc
9006 $def_lircc
9007 $def_pvr
9008 $def_radio
9009 $def_radio_bsdbt848
9010 $def_radio_capture
9011 $def_radio_v4l
9012 $def_radio_v4l2
9013 $def_tv
9014 $def_tv_bsdbt848
9015 $def_tv_dshow
9016 $def_tv_v4l
9017 $def_tv_v4l1
9018 $def_tv_v4l2
9021 /* font stuff */
9022 $def_ass
9023 $def_ass_internal
9024 $def_bitmap_font
9025 $def_enca
9026 $def_fontconfig
9027 $def_freetype
9028 $def_fribidi
9031 /* networking */
9032 $def_closesocket
9033 $def_ftp
9034 $def_inet6
9035 $def_inet_aton
9036 $def_inet_pton
9037 $def_live
9038 $def_nemesi
9039 $def_network
9040 $def_smb
9041 $def_socklen_t
9042 $def_struct_ipv6_mreq
9043 $def_struct_sockaddr_in6
9044 $def_struct_sockaddr_sa_len
9045 $def_vstream
9046 $def_addrinfo
9047 $def_getaddrinfo
9048 $def_sockaddr_storage
9051 /* libvo options */
9052 $def_3dfx
9053 $def_aa
9054 $def_bl
9055 $def_caca
9056 $def_corevideo
9057 $def_dfbmga
9058 $def_dga
9059 $def_dga1
9060 $def_dga2
9061 $def_direct3d
9062 $def_directfb
9063 $def_directfb_version
9064 $def_directx
9065 $def_dvb
9066 $def_dvbin
9067 $def_dxr2
9068 $def_dxr3
9069 $def_fbdev
9070 $def_ggi
9071 $def_ggiwmh
9072 $def_gif
9073 $def_gif_4
9074 $def_gif_tvt_hack
9075 $def_gl
9076 $def_gl_win32
9077 $def_gl_x11
9078 $def_matrixview
9079 $def_ivtv
9080 $def_jpeg
9081 $def_kva
9082 $def_md5sum
9083 $def_mga
9084 $def_mng
9085 $def_png
9086 $def_pnm
9087 $def_quartz
9088 $def_s3fb
9089 $def_sdl
9090 $def_sdl_sdl_h
9091 $def_svga
9092 $def_tdfxfb
9093 $def_tdfxvid
9094 $def_tga
9095 $def_v4l2
9096 $def_vdpau
9097 $def_vesa
9098 $def_vidix
9099 $def_vidix_drv_cyberblade
9100 $def_vidix_drv_ivtv
9101 $def_vidix_drv_mach64
9102 $def_vidix_drv_mga
9103 $def_vidix_drv_mga_crtc2
9104 $def_vidix_drv_nvidia
9105 $def_vidix_drv_pm3
9106 $def_vidix_drv_radeon
9107 $def_vidix_drv_rage128
9108 $def_vidix_drv_s3
9109 $def_vidix_drv_sh_veu
9110 $def_vidix_drv_sis
9111 $def_vidix_drv_unichrome
9112 $def_vidix_pfx
9113 $def_vm
9114 $def_wii
9115 $def_x11
9116 $def_xdpms
9117 $def_xf86keysym
9118 $def_xinerama
9119 $def_xmga
9120 $def_xss
9121 $def_xv
9122 $def_xvmc
9123 $def_xvr100
9124 $def_yuv4mpeg
9125 $def_zr
9128 /* FFmpeg */
9129 $def_libavcodec
9130 $def_libavcodec_a
9131 $def_libavcodec_so
9132 $def_libavformat
9133 $def_libavformat_a
9134 $def_libavformat_so
9135 $def_libavutil
9136 $def_libavutil_a
9137 $def_libavutil_so
9138 $def_libpostproc
9139 $def_libpostproc_a
9140 $def_libpostproc_so
9141 $def_libswscale
9142 $def_libswscale_a
9143 $def_libswscale_so
9145 #define CONFIG_DECODERS 1
9146 #define CONFIG_ENCODERS 1
9147 #define CONFIG_DEMUXERS 1
9148 $def_muxers
9150 $def_arpa_inet_h
9151 $def_bswap
9152 $def_bzlib
9153 $def_dcbzl
9154 $def_exp2
9155 $def_exp2f
9156 $def_fast_64bit
9157 $def_fast_unaligned
9158 $def_hardcoded_tables
9159 $def_libavcodec_mpegaudio_hp
9160 $def_llrint
9161 $def_local_aligned_8
9162 $def_local_aligned_16
9163 $def_log2
9164 $def_log2f
9165 $def_lrint
9166 $def_memalign_hack
9167 $def_mlib
9168 $def_mkstemp
9169 $def_posix_memalign
9170 $def_pthreads
9171 $def_round
9172 $def_roundf
9173 $def_ten_operands
9174 $def_threads
9175 $def_truncf
9176 $def_xform_asm
9177 $def_yasm
9179 #define CONFIG_FASTDIV 0
9180 #define CONFIG_FFSERVER 0
9181 #define CONFIG_GPL 1
9182 #define CONFIG_GRAY 0
9183 #define CONFIG_LIBRTMP 0
9184 #define CONFIG_LIBVORBIS 0
9185 #define CONFIG_POWERPC_PERF 0
9186 #define CONFIG_SMALL 0
9187 #define CONFIG_SWSCALE_ALPHA 1
9189 #if defined(HAVE_AF_INET6) && (!defined(_WIN32) || defined(__CYGWIN__))
9190 #define CONFIG_IPV6 1
9191 #else
9192 #define CONFIG_IPV6 0
9193 #endif
9195 #define HAVE_ATTRIBUTE_MAY_ALIAS 1
9196 #define av_alias __attribute__((may_alias))
9197 #define HAVE_ATTRIBUTE_PACKED 1
9198 #define HAVE_GETHRTIME 0
9199 #define HAVE_INLINE_ASM 1
9200 #define HAVE_LDBRX 0
9201 #define HAVE_POLL_H 1
9202 #define HAVE_PPC4XX 0
9203 #define HAVE_STRERROR_R 0
9204 #define HAVE_SYS_SELECT_H 0
9205 #define HAVE_VFP_ARGS 1
9206 #define HAVE_VIRTUALALLOC 0
9208 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
9209 #define CONFIG_AANDCT 1
9210 #define CONFIG_DCT 1
9211 #define CONFIG_DWT 1
9212 #define CONFIG_FFT 1
9213 #define CONFIG_GOLOMB 1
9214 #define CONFIG_H264DSP 1
9215 #define CONFIG_LPC 1
9216 #define CONFIG_MDCT 1
9217 #define CONFIG_RDFT 1
9219 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
9220 $def_ebx_available
9221 #ifndef MP_DEBUG
9222 #define HAVE_EBP_AVAILABLE 1
9223 #else
9224 #define HAVE_EBP_AVAILABLE 0
9225 #endif
9227 #define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
9228 #define FFMPEG_LICENSE "GPL version 2 or later"
9230 /* External libraries used through libavcodec. */
9231 $def_faac_lavc
9232 $def_libdirac_lavc
9233 $def_libopencore_amrnb
9234 $def_libopencore_amrwb
9235 $def_libopenjpeg
9236 $def_libschroedinger_lavc
9237 $def_mp3lame_lavc
9238 $def_x264_lavc
9239 $def_xvid_lavc
9241 $(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
9242 $(ff_config_enable "$_libavencoders_all" "$_libavencoders")
9243 $(ff_config_enable "$_libavparsers_all" "$_libavparsers")
9244 $(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
9245 $(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
9246 $(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
9247 $(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
9248 $(ff_config_enable "$_libavhwaccels_all" "$_libavhwaccels")
9250 #endif /* MPLAYER_CONFIG_H */
9253 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
9254 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
9256 ############################################################################
9258 # Create avconfig.h for FFmpeg.
9259 cat > "$TMPH" << EOF
9260 /* Generated by mpconfigure */
9261 #ifndef AVUTIL_AVCONFIG_H
9262 #define AVUTIL_AVCONFIG_H
9263 $def_av_bigendian
9264 #endif /* AVUTIL_AVCONFIG_H */
9267 # Do not overwrite an unchanged avconfig.h to avoid superfluous rebuilds.
9268 cmp -s "$TMPH" libavutil/avconfig.h || mv -f "$TMPH" libavutil/avconfig.h
9270 #############################################################################
9272 cat << EOF
9274 Config files successfully generated by ./configure $_configuration !
9276 Install prefix: $_prefix
9277 Data directory: $_datadir
9278 Config direct.: $_confdir
9280 Byte order: $_byte_order
9281 Optimizing for: $_optimizing
9283 Languages:
9284 Messages/GUI: $language_msg
9285 Manual pages: $language_man
9286 Documentation: $language_doc
9288 Enabled optional drivers:
9289 Input: $_inputmodules
9290 Codecs: $_codecmodules
9291 Audio output: $_aomodules
9292 Video output: $_vomodules
9294 Disabled optional drivers:
9295 Input: $_noinputmodules
9296 Codecs: $_nocodecmodules
9297 Audio output: $_noaomodules
9298 Video output: $_novomodules
9300 'config.h' and 'config.mak' contain your configuration options.
9301 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
9302 compile *** DO NOT REPORT BUGS if you tweak these files ***
9304 'make' will now compile MPlayer and 'make install' will install it.
9305 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
9310 if test "$_mtrr" = yes ; then
9311 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
9312 echo
9315 if ! x86_32; then
9316 cat <<EOF
9317 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
9318 operating system ($system_name). You may encounter a few files that cannot
9319 be played due to missing open source video/audio codec support.
9325 cat <<EOF
9326 Check $TMPLOG if you wonder why an autodetection failed (make sure
9327 development headers/packages are installed).
9329 NOTE: The --enable-* parameters unconditionally force options on, completely
9330 skipping autodetection. This behavior is unlike what you may be used to from
9331 autoconf-based configure scripts that can decide to override you. This greater
9332 level of control comes at a price. You may have to provide the correct compiler
9333 and linker flags yourself.
9334 If you used one of these options (except --enable-menu and similar ones that
9335 turn on internal features) and experience a compilation or linking failure,
9336 make sure you have passed the necessary compiler/linker flags to configure.
9338 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
9342 if test "$_warn_CFLAGS" = yes; then
9343 cat <<EOF
9345 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
9346 but:
9348 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
9350 It is strongly recommended to let MPlayer choose the correct CFLAGS!
9351 To do so, execute 'CFLAGS= ./configure <options>'
9356 # Last move:
9357 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"