Add support for 12-bit color mode on framebuffer devices.
[mplayer/glamo.git] / configure
blob4f12093119b545c075d41b2ad83496480610049b
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 [ "$cc_vendor" = "gnu" ] && [ "$_cc_major" = 2 ] ; then
1677 test $_sse = auto && _sse=no
1678 test $_win32dll = auto && _win32dll=no
1679 ass_internal=no
1682 if x86 ; then
1683 # gather more CPU information
1684 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1685 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1686 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1687 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1688 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1690 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1692 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1693 -e s/xmm/sse/ -e s/kni/sse/)
1695 for ext in $pparam ; do
1696 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1697 done
1699 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1700 test $_sse = kernel_check && _mmxext=kernel_check
1702 echocheck "CPU vendor"
1703 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1705 echocheck "CPU type"
1706 echores "$pname"
1709 fi # test "$_runtime_cpudetection" = no
1711 if x86 && test "$_runtime_cpudetection" = no ; then
1712 extcheck() {
1713 if test "$1" = kernel_check ; then
1714 echocheck "kernel support of $2"
1715 cat > $TMPC <<EOF
1716 #include <stdlib.h>
1717 #include <signal.h>
1718 void catch() { exit(1); }
1719 int main(void) {
1720 signal(SIGILL, catch);
1721 __asm__ volatile ("$3":::"memory"); return 0;
1725 if cc_check && tmp_run ; then
1726 eval _$2=yes
1727 echores "yes"
1728 _optimizing="$_optimizing $2"
1729 return 0
1730 else
1731 eval _$2=no
1732 echores "failed"
1733 echo "It seems that your kernel does not correctly support $2."
1734 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1735 return 1
1738 return 0
1741 extcheck $_mmx "mmx" "emms"
1742 extcheck $_mmxext "mmxext" "sfence"
1743 extcheck $_3dnow "3dnow" "femms"
1744 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1745 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1746 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1747 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1748 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1750 echocheck "mtrr support"
1751 if test "$_mtrr" = kernel_check ; then
1752 _mtrr="yes"
1753 _optimizing="$_optimizing mtrr"
1755 echores "$_mtrr"
1757 if test "$_gcc3_ext" != ""; then
1758 # if we had to disable sse/sse2 because the active kernel does not
1759 # support this instruction set extension, we also have to tell
1760 # gcc3 to not generate sse/sse2 instructions for normal C code
1761 cat > $TMPC << EOF
1762 int main(void) { return 0; }
1764 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1770 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1771 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1772 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 0'
1773 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 0'
1774 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1775 subarch_all='X86_32 X86_64 PPC64'
1776 case "$host_arch" in
1777 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1778 arch='x86'
1779 subarch='x86_32'
1780 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1781 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
1782 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
1783 iproc=486
1784 proc=i486
1787 if test "$_runtime_cpudetection" = no ; then
1788 case "$pvendor" in
1789 AuthenticAMD)
1790 case "$pfamily" in
1791 3) proc=i386 iproc=386 ;;
1792 4) proc=i486 iproc=486 ;;
1793 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1794 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1795 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1796 proc=k6-3
1797 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1798 proc=geode
1799 elif test "$pmodel" -ge 8; then
1800 proc=k6-2
1801 elif test "$pmodel" -ge 6; then
1802 proc=k6
1803 else
1804 proc=i586
1807 6) iproc=686
1808 # It's a bit difficult to determine the correct type of Family 6
1809 # AMD CPUs just from their signature. Instead, we check directly
1810 # whether it supports SSE.
1811 if test "$_sse" = yes; then
1812 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1813 proc=athlon-xp
1814 else
1815 # Again, gcc treats athlon and athlon-tbird similarly.
1816 proc=athlon
1819 15) iproc=686
1820 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1821 # caught and remedied in the optimization tests below.
1822 proc=k8
1825 *) proc=amdfam10 iproc=686
1826 test $_fast_clz = "auto" && _fast_clz=yes
1828 esac
1830 GenuineIntel)
1831 case "$pfamily" in
1832 3) proc=i386 iproc=386 ;;
1833 4) proc=i486 iproc=486 ;;
1834 5) iproc=586
1835 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1836 proc=pentium-mmx # 4 is desktop, 8 is mobile
1837 else
1838 proc=i586
1841 6) iproc=686
1842 if test "$pmodel" -ge 15; then
1843 proc=core2
1844 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1845 proc=pentium-m
1846 elif test "$pmodel" -ge 7; then
1847 proc=pentium3
1848 elif test "$pmodel" -ge 3; then
1849 proc=pentium2
1850 else
1851 proc=i686
1853 test $_fast_clz = "auto" && _fast_clz=yes
1855 15) iproc=686
1856 # A nocona in 32-bit mode has no more capabilities than a prescott.
1857 if test "$pmodel" -ge 3; then
1858 proc=prescott
1859 else
1860 proc=pentium4
1861 test $_fast_clz = "auto" && _fast_clz=yes
1863 test $_fast_cmov = "auto" && _fast_cmov=no
1865 *) proc=prescott iproc=686 ;;
1866 esac
1868 CentaurHauls)
1869 case "$pfamily" in
1870 5) iproc=586
1871 if test "$pmodel" -ge 8; then
1872 proc=winchip2
1873 elif test "$pmodel" -ge 4; then
1874 proc=winchip-c6
1875 else
1876 proc=i586
1879 6) iproc=686
1880 if test "$pmodel" -ge 9; then
1881 proc=c3-2
1882 else
1883 proc=c3
1884 iproc=586
1887 *) proc=i686 iproc=i686 ;;
1888 esac
1890 unknown)
1891 case "$pfamily" in
1892 3) proc=i386 iproc=386 ;;
1893 4) proc=i486 iproc=486 ;;
1894 *) proc=i586 iproc=586 ;;
1895 esac
1898 proc=i586 iproc=586 ;;
1899 esac
1900 test $_fast_clz = "auto" && _fast_clz=no
1901 fi # test "$_runtime_cpudetection" = no
1904 # check that gcc supports our CPU, if not, fall back to earlier ones
1905 # LGB: check -mcpu and -march swithing step by step with enabling
1906 # to fall back till 386.
1908 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1910 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1911 cpuopt=-mtune
1912 else
1913 cpuopt=-mcpu
1916 echocheck "GCC & CPU optimization abilities"
1917 cat > $TMPC << EOF
1918 int main(void) { return 0; }
1920 if test "$_runtime_cpudetection" = no ; then
1921 if test $cc_vendor != "intel" ; then
1922 cc_check -march=native && proc=native
1924 if test "$proc" = "k8"; then
1925 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1927 if test "$proc" = "athlon-xp"; then
1928 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1930 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1931 cc_check -march=$proc $cpuopt=$proc || proc=k6
1933 if test "$proc" = "k6" || test "$proc" = "c3"; then
1934 if ! cc_check -march=$proc $cpuopt=$proc; then
1935 if cc_check -march=i586 $cpuopt=i686; then
1936 proc=i586-i686
1937 else
1938 proc=i586
1942 if test "$proc" = "prescott" ; then
1943 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1945 if test "$proc" = "core2" ; then
1946 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1948 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
1949 cc_check -march=$proc $cpuopt=$proc || proc=i686
1951 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1952 cc_check -march=$proc $cpuopt=$proc || proc=i586
1954 if test "$proc" = "i586"; then
1955 cc_check -march=$proc $cpuopt=$proc || proc=i486
1957 if test "$proc" = "i486" ; then
1958 cc_check -march=$proc $cpuopt=$proc || proc=i386
1960 if test "$proc" = "i386" ; then
1961 cc_check -march=$proc $cpuopt=$proc || proc=error
1963 if test "$proc" = "error" ; then
1964 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1965 _mcpu=""
1966 _march=""
1967 _optimizing=""
1968 elif test "$proc" = "i586-i686"; then
1969 _march="-march=i586"
1970 _mcpu="$cpuopt=i686"
1971 _optimizing="$proc"
1972 else
1973 _march="-march=$proc"
1974 _mcpu="$cpuopt=$proc"
1975 _optimizing="$proc"
1977 else # if test "$_runtime_cpudetection" = no
1978 _mcpu="$cpuopt=generic"
1979 # at least i486 required, for bswap instruction
1980 _march="-march=i486"
1981 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1982 cc_check $_mcpu || _mcpu=""
1983 cc_check $_march $_mcpu || _march=""
1986 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1987 ## autodetected mcpu/march parameters
1988 if test "$_target" ; then
1989 # TODO: it may be a good idea to check GCC and fall back in all cases
1990 if test "$host_arch" = "i586-i686"; then
1991 _march="-march=i586"
1992 _mcpu="$cpuopt=i686"
1993 else
1994 _march="-march=$host_arch"
1995 _mcpu="$cpuopt=$host_arch"
1998 proc="$host_arch"
2000 case "$proc" in
2001 i386) iproc=386 ;;
2002 i486) iproc=486 ;;
2003 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
2004 i686|athlon*|pentium*) iproc=686 ;;
2005 *) iproc=586 ;;
2006 esac
2009 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
2010 _fast_cmov="yes"
2011 else
2012 _fast_cmov="no"
2014 test $_fast_clz = "auto" && _fast_clz=yes
2016 echores "$proc"
2019 ia64)
2020 arch='ia64'
2021 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2022 iproc='ia64'
2025 x86_64|amd64)
2026 arch='x86'
2027 subarch='x86_64'
2028 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2029 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2030 iproc='x86_64'
2032 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
2033 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
2034 cpuopt=-mtune
2035 else
2036 cpuopt=-mcpu
2038 if test "$_runtime_cpudetection" = no ; then
2039 case "$pvendor" in
2040 AuthenticAMD)
2041 case "$pfamily" in
2042 15) proc=k8
2043 test $_fast_clz = "auto" && _fast_clz=no
2045 *) proc=amdfam10;;
2046 esac
2048 GenuineIntel)
2049 case "$pfamily" in
2050 6) proc=core2;;
2052 # 64-bit prescotts exist, but as far as GCC is concerned they
2053 # have the same capabilities as a nocona.
2054 proc=nocona
2055 test $_fast_cmov = "auto" && _fast_cmov=no
2056 test $_fast_clz = "auto" && _fast_clz=no
2058 esac
2061 proc=error;;
2062 esac
2063 fi # test "$_runtime_cpudetection" = no
2065 echocheck "GCC & CPU optimization abilities"
2066 cat > $TMPC << EOF
2067 int main(void) { return 0; }
2069 # This is a stripped-down version of the i386 fallback.
2070 if test "$_runtime_cpudetection" = no ; then
2071 if test $cc_vendor != "intel" ; then
2072 cc_check -march=native && proc=native
2074 # --- AMD processors ---
2075 if test "$proc" = "k8"; then
2076 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2078 # This will fail if gcc version < 3.3, which is ok because earlier
2079 # versions don't really support 64-bit on amd64.
2080 # Is this a valid assumption? -Corey
2081 if test "$proc" = "athlon-xp"; then
2082 cc_check -march=$proc $cpuopt=$proc || proc=error
2084 # --- Intel processors ---
2085 if test "$proc" = "core2"; then
2086 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
2088 if test "$proc" = "x86-64"; then
2089 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2091 if test "$proc" = "nocona"; then
2092 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2094 if test "$proc" = "pentium4"; then
2095 cc_check -march=$proc $cpuopt=$proc || proc=error
2098 _march="-march=$proc"
2099 _mcpu="$cpuopt=$proc"
2100 if test "$proc" = "error" ; then
2101 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2102 _mcpu=""
2103 _march=""
2105 else # if test "$_runtime_cpudetection" = no
2106 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2107 _march="-march=x86-64"
2108 _mcpu="$cpuopt=generic"
2109 cc_check $_mcpu || _mcpu="x86-64"
2110 cc_check $_mcpu || _mcpu=""
2111 cc_check $_march $_mcpu || _march=""
2114 _optimizing="$proc"
2115 test $_fast_cmov = "auto" && _fast_cmov=yes
2116 test $_fast_clz = "auto" && _fast_clz=yes
2118 echores "$proc"
2121 sparc|sparc64)
2122 arch='sparc'
2123 iproc='sparc'
2124 if test "$host_arch" = "sparc64" ; then
2125 _vis='yes'
2126 proc='ultrasparc'
2127 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2128 elif sunos ; then
2129 echocheck "CPU type"
2130 karch=$(uname -m)
2131 case "$(echo $karch)" in
2132 sun4) proc=v7 ;;
2133 sun4c) proc=v7 ;;
2134 sun4d) proc=v8 ;;
2135 sun4m) proc=v8 ;;
2136 sun4u) proc=ultrasparc _vis='yes' ;;
2137 sun4v) proc=v9 ;;
2138 *) proc=v8 ;;
2139 esac
2140 echores "$proc"
2141 else
2142 proc=v8
2144 _mcpu="-mcpu=$proc"
2145 _optimizing="$proc"
2148 arm*)
2149 arch='arm'
2150 iproc='arm'
2153 avr32)
2154 arch='avr32'
2155 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2156 iproc='avr32'
2157 test $_fast_clz = "auto" && _fast_clz=yes
2160 sh|sh4)
2161 arch='sh4'
2162 iproc='sh4'
2165 ppc|ppc64|powerpc|powerpc64)
2166 arch='ppc'
2167 def_dcbzl='#define HAVE_DCBZL 0'
2168 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2169 def_local_aligned_8='#define HAVE_LOCAL_ALIGNED_8 1'
2170 def_local_aligned_16='#define HAVE_LOCAL_ALIGNED_16 1'
2171 iproc='ppc'
2173 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2174 subarch='ppc64'
2175 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2177 echocheck "CPU type"
2178 case $system_name in
2179 Linux)
2180 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2181 if test -n "$($_cpuinfo | grep altivec)"; then
2182 test $_altivec = auto && _altivec=yes
2185 Darwin)
2186 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2187 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2188 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2189 test $_altivec = auto && _altivec=yes
2192 NetBSD)
2193 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2194 case $cc_version in
2195 2*|3.0*|3.1*|3.2*|3.3*)
2198 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2199 test $_altivec = auto && _altivec=yes
2202 esac
2204 AIX)
2205 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2207 esac
2208 if test "$_altivec" = yes; then
2209 echores "$proc altivec"
2210 else
2211 _altivec=no
2212 echores "$proc"
2215 echocheck "GCC & CPU optimization abilities"
2217 if test -n "$proc"; then
2218 case "$proc" in
2219 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2220 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2221 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2222 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2223 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2224 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2225 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2226 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2227 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2228 *) ;;
2229 esac
2230 # gcc 3.1(.1) and up supports 7400 and 7450
2231 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2232 case "$proc" in
2233 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2234 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2235 *) ;;
2236 esac
2238 # gcc 3.2 and up supports 970
2239 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2240 case "$proc" in
2241 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2242 def_dcbzl='#define HAVE_DCBZL 1' ;;
2243 *) ;;
2244 esac
2246 # gcc 3.3 and up supports POWER4
2247 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2248 case "$proc" in
2249 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2250 *) ;;
2251 esac
2253 # gcc 3.4 and up supports 440*
2254 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2255 case "$proc" in
2256 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2257 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2258 *) ;;
2259 esac
2261 # gcc 4.0 and up supports POWER5
2262 if test "$_cc_major" -ge "4"; then
2263 case "$proc" in
2264 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2265 *) ;;
2266 esac
2270 if test -n "$_mcpu"; then
2271 _optimizing=$(echo $_mcpu | cut -c 8-)
2272 echores "$_optimizing"
2273 else
2274 echores "none"
2277 test $_fast_clz = "auto" && _fast_clz=yes
2281 alpha*)
2282 arch='alpha'
2283 iproc='alpha'
2285 echocheck "CPU type"
2286 cat > $TMPC << EOF
2287 int main(void) {
2288 unsigned long ver, mask;
2289 __asm__ ("implver %0" : "=r" (ver));
2290 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2291 printf("%ld-%x\n", ver, ~mask);
2292 return 0;
2295 $_cc -o "$TMPEXE" "$TMPC"
2296 case $("$TMPEXE") in
2298 0-0) proc="ev4"; _mvi="0";;
2299 1-0) proc="ev5"; _mvi="0";;
2300 1-1) proc="ev56"; _mvi="0";;
2301 1-101) proc="pca56"; _mvi="1";;
2302 2-303) proc="ev6"; _mvi="1";;
2303 2-307) proc="ev67"; _mvi="1";;
2304 2-1307) proc="ev68"; _mvi="1";;
2305 esac
2306 echores "$proc"
2308 echocheck "GCC & CPU optimization abilities"
2309 if test "$proc" = "ev68" ; then
2310 cc_check -mcpu=$proc || proc=ev67
2312 if test "$proc" = "ev67" ; then
2313 cc_check -mcpu=$proc || proc=ev6
2315 _mcpu="-mcpu=$proc"
2316 echores "$proc"
2318 test $_fast_clz = "auto" && _fast_clz=yes
2320 _optimizing="$proc"
2323 mips)
2324 arch='mips'
2325 iproc='mips'
2327 if irix ; then
2328 echocheck "CPU type"
2329 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2330 case "$(echo $proc)" in
2331 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2332 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2333 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2334 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2335 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2336 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2337 esac
2338 # gcc < 3.x does not support -mtune.
2339 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2340 _mcpu=''
2342 echores "$proc"
2345 test $_fast_clz = "auto" && _fast_clz=yes
2349 hppa)
2350 arch='pa_risc'
2351 iproc='PA-RISC'
2354 s390)
2355 arch='s390'
2356 iproc='390'
2359 s390x)
2360 arch='s390x'
2361 iproc='390x'
2364 vax)
2365 arch='vax'
2366 iproc='vax'
2369 xtensa)
2370 arch='xtensa'
2371 iproc='xtensa'
2374 generic)
2375 arch='generic'
2379 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2380 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2381 die "unsupported architecture $host_arch"
2383 esac # case "$host_arch" in
2385 if test "$_runtime_cpudetection" = yes ; then
2386 if x86 ; then
2387 test "$_cmov" != no && _cmov=yes
2388 x86_32 && _cmov=no
2389 test "$_mmx" != no && _mmx=yes
2390 test "$_3dnow" != no && _3dnow=yes
2391 test "$_3dnowext" != no && _3dnowext=yes
2392 test "$_mmxext" != no && _mmxext=yes
2393 test "$_sse" != no && _sse=yes
2394 test "$_sse2" != no && _sse2=yes
2395 test "$_ssse3" != no && _ssse3=yes
2396 test "$_mtrr" != no && _mtrr=yes
2398 if ppc; then
2399 _altivec=yes
2404 # endian testing
2405 echocheck "byte order"
2406 if test "$_big_endian" = auto ; then
2407 cat > $TMPC <<EOF
2408 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2409 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2410 int main(void) { return (int)ascii_name; }
2412 if cc_check ; then
2413 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2414 _big_endian=yes
2415 else
2416 _big_endian=no
2418 else
2419 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2422 if test "$_big_endian" = yes ; then
2423 _byte_order='big-endian'
2424 def_words_endian='#define WORDS_BIGENDIAN 1'
2425 def_bigendian='#define HAVE_BIGENDIAN 1'
2426 def_av_bigendian='#define AV_HAVE_BIGENDIAN 1'
2427 else
2428 _byte_order='little-endian'
2429 def_words_endian='#undef WORDS_BIGENDIAN'
2430 def_bigendian='#define HAVE_BIGENDIAN 0'
2431 def_av_bigendian='#define AV_HAVE_BIGENDIAN 0'
2433 echores "$_byte_order"
2436 echocheck "extern symbol prefix"
2437 cat > $TMPC << EOF
2438 int ff_extern;
2440 cc_check -c || die "Symbol mangling check failed."
2441 sym=$($_nm -P -g $TMPEXE)
2442 extern_prefix=${sym%%ff_extern*}
2443 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2444 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2445 echores $extern_prefix
2448 echocheck "assembler support of -pipe option"
2449 cat > $TMPC << EOF
2450 int main(void) { return 0; }
2452 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2453 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2456 echocheck "compiler support of named assembler arguments"
2457 _named_asm_args=yes
2458 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2459 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2460 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2461 _named_asm_args=no
2462 def_named_asm_args="#undef NAMED_ASM_ARGS"
2464 echores $_named_asm_args
2467 if darwin && test "$cc_vendor" = "gnu" ; then
2468 echocheck "GCC support of -mstackrealign"
2469 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2470 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2471 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2472 # wrong code with this flag, but this can be worked around by adding
2473 # -fno-unit-at-a-time as described in the blog post at
2474 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2475 cat > $TMPC << EOF
2476 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2477 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2479 cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2480 test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \
2481 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2482 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2483 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2486 # Checking for CFLAGS
2487 _install_strip="-s"
2488 if test "$_profile" != "" || test "$_debug" != "" ; then
2489 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2490 _install_strip=
2491 elif test -z "$CFLAGS" ; then
2492 if test "$cc_vendor" = "intel" ; then
2493 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2494 elif test "$cc_vendor" = "sun" ; then
2495 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2496 elif test "$cc_vendor" != "gnu" ; then
2497 CFLAGS="-O2 $_march $_mcpu $_pipe"
2498 else
2499 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2500 extra_ldflags="$extra_ldflags -ffast-math"
2502 else
2503 _warn_CFLAGS=yes
2506 cat > $TMPC << EOF
2507 int main(void) { return 0; }
2509 if test "$cc_vendor" = "gnu" ; then
2510 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2511 cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
2512 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2513 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2514 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2515 cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
2516 cc_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
2517 else
2518 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2521 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2522 cc_check -MD -MP && CFLAGS="-MD -MP $CFLAGS"
2525 if test -n "$LDFLAGS" ; then
2526 extra_ldflags="$extra_ldflags $LDFLAGS"
2527 _warn_CFLAGS=yes
2528 elif test "$cc_vendor" = "intel" ; then
2529 extra_ldflags="$extra_ldflags -i-static"
2531 if test -n "$CPPFLAGS" ; then
2532 extra_cflags="$extra_cflags $CPPFLAGS"
2533 _warn_CFLAGS=yes
2538 if x86_32 ; then
2539 # Checking assembler (_as) compatibility...
2540 # Added workaround for older as that reads from stdin by default - atmos
2541 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2542 echocheck "assembler ($_as $as_version)"
2544 _pref_as_version='2.9.1'
2545 echo 'nop' > $TMPS
2546 if test "$_mmx" = yes ; then
2547 echo 'emms' >> $TMPS
2549 if test "$_3dnow" = yes ; then
2550 _pref_as_version='2.10.1'
2551 echo 'femms' >> $TMPS
2553 if test "$_3dnowext" = yes ; then
2554 _pref_as_version='2.10.1'
2555 echo 'pswapd %mm0, %mm0' >> $TMPS
2557 if test "$_mmxext" = yes ; then
2558 _pref_as_version='2.10.1'
2559 echo 'movntq %mm0, (%eax)' >> $TMPS
2561 if test "$_sse" = yes ; then
2562 _pref_as_version='2.10.1'
2563 echo 'xorps %xmm0, %xmm0' >> $TMPS
2565 #if test "$_sse2" = yes ; then
2566 # _pref_as_version='2.11'
2567 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2569 if test "$_cmov" = yes ; then
2570 _pref_as_version='2.10.1'
2571 echo 'cmovb %eax, %ebx' >> $TMPS
2573 if test "$_ssse3" = yes ; then
2574 _pref_as_version='2.16.92'
2575 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2577 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2579 if test "$as_verc_fail" != yes ; then
2580 echores "ok"
2581 else
2582 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2583 echores "failed"
2584 die "obsolete binutils version"
2587 fi #if x86_32
2589 echocheck ".align is a power of two"
2590 if test "$_asmalign_pot" = auto ; then
2591 _asmalign_pot=no
2592 cat > $TMPC << EOF
2593 int main(void) { __asm__ (".align 3"); return 0; }
2595 cc_check && _asmalign_pot=yes
2597 if test "$_asmalign_pot" = "yes" ; then
2598 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2599 else
2600 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2602 echores $_asmalign_pot
2604 if x86 ; then
2605 echocheck "10 assembler operands"
2606 ten_operands=no
2607 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2608 cat > $TMPC << EOF
2609 int main(void) {
2610 int x=0;
2611 __asm__ volatile(
2613 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2615 return 0;
2618 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2619 echores $ten_operands
2621 echocheck "ebx availability"
2622 ebx_available=no
2623 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2624 cat > $TMPC << EOF
2625 int main(void) {
2626 int x;
2627 __asm__ volatile(
2628 "xor %0, %0"
2629 :"=b"(x)
2630 // just adding ebx to clobber list seems unreliable with some
2631 // compilers, e.g. Haiku's gcc 2.95
2633 // and the above check does not work for OSX 64 bit...
2634 __asm__ volatile("":::"%ebx");
2635 return 0;
2638 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2639 echores $ebx_available
2641 echocheck "PIC"
2642 pic=no
2643 cat > $TMPC << EOF
2644 int main(void) {
2645 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2646 #error PIC not enabled
2647 #endif
2648 return 0;
2651 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2652 echores $pic
2654 echocheck "yasm"
2655 if test -z "$YASMFLAGS" ; then
2656 if darwin ; then
2657 x86_64 && objformat="macho64" || objformat="macho"
2658 elif win32 ; then
2659 objformat="win32"
2660 else
2661 objformat="elf"
2663 # currently tested for Linux x86, x86_64
2664 YASMFLAGS="-f $objformat"
2665 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2666 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2667 case "$objformat" in
2668 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2669 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2670 esac
2671 else
2672 _warn_CFLAGS=yes
2675 echo "pabsw xmm0, xmm0" > $TMPS
2676 yasm_check || _yasm=""
2677 if test $_yasm ; then
2678 def_yasm='#define HAVE_YASM 1'
2679 have_yasm="yes"
2680 echores "$_yasm"
2681 else
2682 def_yasm='#define HAVE_YASM 0'
2683 have_yasm="no"
2684 echores "no"
2687 echocheck "bswap"
2688 def_bswap='#define HAVE_BSWAP 0'
2689 echo 'bswap %eax' > $TMPS
2690 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2691 echores "$bswap"
2692 fi #if x86
2695 #FIXME: This should happen before the check for CFLAGS..
2696 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2697 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2699 # check if AltiVec is supported by the compiler, and how to enable it
2700 echocheck "GCC AltiVec flags"
2701 cat > $TMPC << EOF
2702 int main(void) { return 0; }
2704 if $(cc_check -maltivec -mabi=altivec) ; then
2705 _altivec_gcc_flags="-maltivec -mabi=altivec"
2706 # check if <altivec.h> should be included
2707 cat > $TMPC << EOF
2708 #include <altivec.h>
2709 int main(void) { return 0; }
2711 if $(cc_check $_altivec_gcc_flags) ; then
2712 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2713 inc_altivec_h='#include <altivec.h>'
2714 else
2715 cat > $TMPC << EOF
2716 int main(void) { return 0; }
2718 if $(cc_check -faltivec) ; then
2719 _altivec_gcc_flags="-faltivec"
2720 else
2721 _altivec=no
2722 _altivec_gcc_flags="none, AltiVec disabled"
2726 echores "$_altivec_gcc_flags"
2728 # check if the compiler supports braces for vector declarations
2729 cat > $TMPC << EOF
2730 $inc_altivec_h
2731 int main(void) { (vector int) {1}; return 0; }
2733 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2735 # Disable runtime cpudetection if we cannot generate AltiVec code or
2736 # AltiVec is disabled by the user.
2737 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2738 && _runtime_cpudetection=no
2740 # Show that we are optimizing for AltiVec (if enabled and supported).
2741 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2742 && _optimizing="$_optimizing altivec"
2744 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2745 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2748 if ppc ; then
2749 def_xform_asm='#define HAVE_XFORM_ASM 0'
2750 xform_asm=no
2751 echocheck "XFORM ASM support"
2752 cat > $TMPC << EOF
2753 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2755 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2756 echores "$xform_asm"
2759 if arm ; then
2760 echocheck "ARM pld instruction"
2761 cat > $TMPC << EOF
2762 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2764 pld=no
2765 cc_check && pld=yes
2766 echores "$pld"
2768 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2769 if test $_armv5te = "auto" ; then
2770 cat > $TMPC << EOF
2771 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2773 _armv5te=no
2774 cc_check && _armv5te=yes
2776 echores "$_armv5te"
2778 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2780 echocheck "ARMv6 (SIMD instructions)"
2781 if test $_armv6 = "auto" ; then
2782 cat > $TMPC << EOF
2783 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2785 _armv6=no
2786 cc_check && _armv6=yes
2788 echores "$_armv6"
2790 echocheck "ARMv6t2 (SIMD instructions)"
2791 if test $_armv6t2 = "auto" ; then
2792 cat > $TMPC << EOF
2793 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2795 _armv6t2=no
2796 cc_check && _armv6t2=yes
2798 echores "$_armv6"
2800 echocheck "ARM VFP"
2801 if test $_armvfp = "auto" ; then
2802 cat > $TMPC << EOF
2803 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2805 _armvfp=no
2806 cc_check && _armvfp=yes
2808 echores "$_armvfp"
2810 echocheck "ARM NEON"
2811 if test $neon = "auto" ; then
2812 cat > $TMPC << EOF
2813 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2815 neon=no
2816 cc_check && neon=yes
2818 echores "$neon"
2820 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2821 if test $_iwmmxt = "auto" ; then
2822 cat > $TMPC << EOF
2823 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2825 _iwmmxt=no
2826 cc_check && _iwmmxt=yes
2828 echores "$_iwmmxt"
2831 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'
2832 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2833 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2834 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2835 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2836 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2837 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2838 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2839 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2840 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2841 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2842 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2843 test "$pld" = yes && cpuexts="PLD $cpuexts"
2844 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2845 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2846 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2847 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2848 test "$neon" = yes && cpuexts="NEON $cpuexts"
2849 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2850 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2851 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2853 # Checking kernel version...
2854 if x86_32 && linux ; then
2855 _k_verc_problem=no
2856 kernel_version=$(uname -r 2>&1)
2857 echocheck "$system_name kernel version"
2858 case "$kernel_version" in
2859 '') kernel_version="?.??"; _k_verc_fail=yes;;
2860 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2861 _k_verc_problem=yes;;
2862 esac
2863 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2864 _k_verc_fail=yes
2866 if test "$_k_verc_fail" ; then
2867 echores "$kernel_version, fail"
2868 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2869 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2870 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2871 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2872 echo "2.2.x you must upgrade it to get SSE support!"
2873 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2874 else
2875 echores "$kernel_version, ok"
2879 ######################
2880 # MAIN TESTS GO HERE #
2881 ######################
2884 echocheck "-lposix"
2885 cat > $TMPC <<EOF
2886 int main(void) { return 0; }
2888 if cc_check -lposix ; then
2889 extra_ldflags="$extra_ldflags -lposix"
2890 echores "yes"
2891 else
2892 echores "no"
2895 echocheck "-lm"
2896 cat > $TMPC <<EOF
2897 int main(void) { return 0; }
2899 if cc_check -lm ; then
2900 _ld_lm="-lm"
2901 echores "yes"
2902 else
2903 _ld_lm=""
2904 echores "no"
2908 echocheck "langinfo"
2909 if test "$_langinfo" = auto ; then
2910 cat > $TMPC <<EOF
2911 #include <langinfo.h>
2912 int main(void) { nl_langinfo(CODESET); return 0; }
2914 _langinfo=no
2915 cc_check && _langinfo=yes
2917 if test "$_langinfo" = yes ; then
2918 def_langinfo='#define HAVE_LANGINFO 1'
2919 else
2920 def_langinfo='#undef HAVE_LANGINFO'
2922 echores "$_langinfo"
2925 echocheck "language"
2926 # Set preferred languages, "all" uses English as main language.
2927 test -z "$language" && language=$LINGUAS
2928 test -z "$language_doc" && language_doc=$language
2929 test -z "$language_man" && language_man=$language
2930 test -z "$language_msg" && language_msg=$language
2931 language_doc=$(echo $language_doc | tr , " ")
2932 language_man=$(echo $language_man | tr , " ")
2933 language_msg=$(echo $language_msg | tr , " ")
2935 test "$language_doc" = "all" && language_doc=$doc_lang_all
2936 test "$language_man" = "all" && language_man=$man_lang_all
2937 test "$language_msg" = "all" && language_msg=en
2939 # Prune non-existing translations from language lists.
2940 # Set message translation to the first available language.
2941 # Fall back on English.
2942 for lang in $language_doc ; do
2943 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2944 done
2945 language_doc=$tmp_language_doc
2946 test -z "$language_doc" && language_doc=en
2948 for lang in $language_man ; do
2949 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2950 done
2951 language_man=$tmp_language_man
2952 test -z "$language_man" && language_man=en
2954 for lang in $language_msg ; do
2955 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2956 done
2957 language_msg=$tmp_language_msg
2958 test -z "$language_msg" && language_msg=en
2959 _mp_help="help/help_mp-${language_msg}.h"
2960 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2963 echocheck "enable sighandler"
2964 if test "$_sighandler" = yes ; then
2965 def_sighandler='#define CONFIG_SIGHANDLER 1'
2966 else
2967 def_sighandler='#undef CONFIG_SIGHANDLER'
2969 echores "$_sighandler"
2971 echocheck "runtime cpudetection"
2972 if test "$_runtime_cpudetection" = yes ; then
2973 _optimizing="Runtime CPU-Detection enabled"
2974 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2975 else
2976 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2978 echores "$_runtime_cpudetection"
2981 echocheck "restrict keyword"
2982 for restrict_keyword in restrict __restrict __restrict__ ; do
2983 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2984 if cc_check; then
2985 def_restrict_keyword=$restrict_keyword
2986 break;
2988 done
2989 if [ -n "$def_restrict_keyword" ]; then
2990 echores "$def_restrict_keyword"
2991 else
2992 echores "none"
2994 # Avoid infinite recursion loop ("#define restrict restrict")
2995 if [ "$def_restrict_keyword" != "restrict" ]; then
2996 def_restrict_keyword="#define restrict $def_restrict_keyword"
2997 else
2998 def_restrict_keyword=""
3002 echocheck "__builtin_expect"
3003 # GCC branch prediction hint
3004 cat > $TMPC << EOF
3005 int foo(int a) {
3006 a = __builtin_expect(a, 10);
3007 return a == 10 ? 0 : 1;
3009 int main(void) { return foo(10) && foo(0); }
3011 _builtin_expect=no
3012 cc_check && _builtin_expect=yes
3013 if test "$_builtin_expect" = yes ; then
3014 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
3015 else
3016 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
3018 echores "$_builtin_expect"
3021 echocheck "kstat"
3022 cat > $TMPC << EOF
3023 #include <kstat.h>
3024 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
3026 _kstat=no
3027 cc_check -lkstat && _kstat=yes
3028 if test "$_kstat" = yes ; then
3029 def_kstat="#define HAVE_LIBKSTAT 1"
3030 extra_ldflags="$extra_ldflags -lkstat"
3031 else
3032 def_kstat="#undef HAVE_LIBKSTAT"
3034 echores "$_kstat"
3037 echocheck "posix4"
3038 # required for nanosleep on some systems
3039 cat > $TMPC << EOF
3040 #include <time.h>
3041 int main(void) { (void) nanosleep(0, 0); return 0; }
3043 _posix4=no
3044 cc_check -lposix4 && _posix4=yes
3045 if test "$_posix4" = yes ; then
3046 extra_ldflags="$extra_ldflags -lposix4"
3048 echores "$_posix4"
3050 for func in exp2 exp2f llrint llrintf log2 log2f lrint lrintf round roundf truncf; do
3051 echocheck $func
3052 cat > $TMPC << EOF
3053 #include <math.h>
3054 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
3056 eval _$func=no
3057 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
3058 if eval test "x\$_$func" = "xyes"; then
3059 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
3060 echores yes
3061 else
3062 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
3063 echores no
3065 done
3068 echocheck "mkstemp"
3069 cat > $TMPC << EOF
3070 #include <stdlib.h>
3071 int main(void) { char a; mkstemp(&a); return 0; }
3073 _mkstemp=no
3074 cc_check && _mkstemp=yes
3075 if test "$_mkstemp" = yes ; then
3076 def_mkstemp='#define HAVE_MKSTEMP 1'
3077 else
3078 def_mkstemp='#undef HAVE_MKSTEMP'
3080 echores "$_mkstemp"
3083 echocheck "nanosleep"
3084 # also check for nanosleep
3085 cat > $TMPC << EOF
3086 #include <time.h>
3087 int main(void) { (void) nanosleep(0, 0); return 0; }
3089 _nanosleep=no
3090 cc_check && _nanosleep=yes
3091 if test "$_nanosleep" = yes ; then
3092 def_nanosleep='#define HAVE_NANOSLEEP 1'
3093 else
3094 def_nanosleep='#undef HAVE_NANOSLEEP'
3096 echores "$_nanosleep"
3099 echocheck "socklib"
3100 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3101 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3102 cat > $TMPC << EOF
3103 #include <netdb.h>
3104 #include <sys/socket.h>
3105 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3107 _socklib=no
3108 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3109 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3110 done
3111 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3112 if test $_winsock2_h = auto ; then
3113 _winsock2_h=no
3114 cat > $TMPC << EOF
3115 #include <winsock2.h>
3116 int main(void) { (void) gethostbyname(0); return 0; }
3118 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3120 test "$_ld_sock" && _res_comment="using $_ld_sock"
3121 echores "$_socklib"
3124 if test $_winsock2_h = yes ; then
3125 _ld_sock="-lws2_32"
3126 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3127 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=1'
3128 else
3129 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3130 cc_check_winsock2_h='-DHAVE_WINSOCK2_H=0'
3134 echocheck "netdb.h, struct addrinfo"
3135 if test "$_struct_addrinfo" = auto; then
3136 _struct_addrinfo=no
3137 cat > $TMPC << EOF
3138 #if HAVE_WINSOCK2_H
3139 #include <winsock2.h>
3140 #include <ws2tcpip.h>
3141 #else
3142 #include <sys/types.h>
3143 #include <sys/socket.h>
3144 #include <netdb.h>
3145 #endif
3146 int main(void) { struct addrinfo ai; return 0; }
3148 cc_check $cc_check_winsock2_h && _struct_addrinfo=yes
3150 echores "$_struct_addrinfo"
3152 if test "$_struct_addrinfo" = yes; then
3153 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 1"
3154 else
3155 def_addrinfo="#define HAVE_STRUCT_ADDRINFO 0"
3159 echocheck "netdb.h, getaddrinfo()"
3160 if test "$_getaddrinfo" = auto; then
3161 _getaddrinfo=no
3162 cat > $TMPC << EOF
3163 #if HAVE_WINSOCK2_H
3164 #include <winsock2.h>
3165 #else
3166 #include <sys/types.h>
3167 #include <sys/socket.h>
3168 #include <netdb.h>
3169 #endif
3170 int main(void) { (void) getaddrinfo(0, 0, 0, 0); return 0; }
3172 cc_check $cc_check_winsock2_h && _getaddrinfo=yes
3174 echores "$_getaddrinfo"
3176 if test "$_getaddrinfo" = yes; then
3177 def_getaddrinfo="#define HAVE_GETADDRINFO 1"
3178 else
3179 def_getaddrinfo="#define HAVE_GETADDRINFO 0"
3183 echocheck "sockaddr_storage"
3184 if test "$_struct_sockaddr_storage" = auto; then
3185 _struct_sockaddr_storage=no
3186 cat > $TMPC << EOF
3187 #if HAVE_WINSOCK2_H
3188 #include <winsock2.h>
3189 #else
3190 #include <sys/socket.h>
3191 #endif
3192 int main(void) { struct sockaddr_storage sas; return 0; }
3194 cc_check $cc_check_winsock2_h && _struct_sockaddr_storage=yes
3196 echores "$_struct_sockaddr_storage"
3198 if test "$_struct_sockaddr_storage" = yes; then
3199 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 1"
3200 else
3201 def_sockaddr_storage="#define HAVE_STRUCT_SOCKADDR_STORAGE 0"
3205 echocheck "struct ipv6_mreq"
3206 _struct_ipv6_mreq=no
3207 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 0"
3208 for header in "netinet/in.h" "ws2tcpip.h" ; do
3209 cat > $TMPC << EOF
3210 #include <$header>
3211 int main(void) { struct ipv6_mreq mreq6; return 0; }
3213 cc_check && _struct_ipv6_mreq=yes && \
3214 def_struct_ipv6_mreq="#define HAVE_STRUCT_IPV6_MREQ 1" && break
3215 done
3216 echores "$_struct_ipv6_mreq"
3219 echocheck "struct sockaddr_in6"
3220 _struct_sockaddr_in6=no
3221 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 0"
3222 for header in "netinet/in.h" "ws2tcpip.h" ; do
3223 cat > $TMPC << EOF
3224 #include <$header>
3225 int main(void) { struct sockaddr_in6 addr; return 0; }
3227 cc_check && _struct_sockaddr_in6=yes && \
3228 def_struct_sockaddr_in6="#define HAVE_STRUCT_SOCKADDR_IN6 1" && break
3229 done
3230 echores "$_struct_sockaddr_in6"
3233 echocheck "struct sockaddr sa_len"
3234 _struct_sockaddr_sa_len=no
3235 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 0"
3236 cat > $TMPC << EOF
3237 #if HAVE_WINSOCK2_H
3238 #include <winsock2.h>
3239 #else
3240 #include <sys/types.h>
3241 #include <sys/socket.h>
3242 #endif
3243 int main(void) { const void *p = &((struct sockaddr *)0)->sa_len; return 0; }
3245 cc_check $cc_check_winsock2_h && _struct_sockaddr_sa_len=yes && \
3246 def_struct_sockaddr_sa_len="#define HAVE_STRUCT_SOCKADDR_SA_LEN 1"
3247 echores "$_struct_sockaddr_sa_len"
3250 echocheck "arpa/inet.h"
3251 arpa_inet_h=no
3252 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3253 cat > $TMPC << EOF
3254 #include <arpa/inet.h>
3255 int main(void) { return 0; }
3257 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3258 echores "$arpa_inet_h"
3261 echocheck "inet_pton()"
3262 def_inet_pton='#define HAVE_INET_PTON 0'
3263 inet_pton=no
3264 cat > $TMPC << EOF
3265 #include <sys/types.h>
3266 #include <sys/socket.h>
3267 #include <arpa/inet.h>
3268 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3270 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3271 cc_check $_ld_tmp && inet_pton=yes && break
3272 done
3273 if test $inet_pton = yes ; then
3274 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3275 def_inet_pton='#define HAVE_INET_PTON 1'
3277 echores "$inet_pton"
3280 echocheck "inet_aton()"
3281 def_inet_aton='#define HAVE_INET_ATON 0'
3282 inet_aton=no
3283 cat > $TMPC << EOF
3284 #include <sys/types.h>
3285 #include <sys/socket.h>
3286 #include <arpa/inet.h>
3287 int main(void) { (void) inet_aton(0, 0); return 0; }
3289 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3290 cc_check $_ld_tmp && inet_aton=yes && break
3291 done
3292 if test $inet_aton = yes ; then
3293 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3294 def_inet_aton='#define HAVE_INET_ATON 1'
3296 echores "$inet_aton"
3299 echocheck "socklen_t"
3300 _socklen_t=no
3301 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3302 cat > $TMPC << EOF
3303 #include <$header>
3304 int main(void) { socklen_t v = 0; return v; }
3306 cc_check && _socklen_t=yes && break
3307 done
3308 if test "$_socklen_t" = yes ; then
3309 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3310 else
3311 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3313 echores "$_socklen_t"
3316 echocheck "closesocket()"
3317 _closesocket=no
3318 cat > $TMPC << EOF
3319 #include <winsock2.h>
3320 int main(void) { closesocket(~0); return 0; }
3322 cc_check $_ld_sock && _closesocket=yes
3323 if test "$_closesocket" = yes ; then
3324 def_closesocket='#define HAVE_CLOSESOCKET 1'
3325 else
3326 def_closesocket='#define HAVE_CLOSESOCKET 0'
3328 echores "$_closesocket"
3331 echocheck "network"
3332 test $_winsock2_h = no && test $inet_pton = no &&
3333 test $inet_aton = no && _network=no
3334 if test "$_network" = yes ; then
3335 def_network='#define CONFIG_NETWORK 1'
3336 extra_ldflags="$extra_ldflags $_ld_sock"
3337 _inputmodules="network $_inputmodules"
3338 else
3339 _noinputmodules="network $_noinputmodules"
3340 def_network='#undef CONFIG_NETWORK'
3341 _ftp=no
3342 _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//)
3343 _libavdemuxers=$(echo $_libavdemuxers | sed -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER//)
3345 echores "$_network"
3348 echocheck "inet6"
3349 if test "$_inet6" = auto ; then
3350 cat > $TMPC << EOF
3351 #include <sys/types.h>
3352 #if !defined(_WIN32) || defined(__CYGWIN__)
3353 #include <sys/socket.h>
3354 #include <netinet/in.h>
3355 #else
3356 #include <ws2tcpip.h>
3357 #endif
3358 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3360 _inet6=no
3361 if cc_check $_ld_sock ; then
3362 _inet6=yes
3365 if test "$_inet6" = yes ; then
3366 def_inet6='#define HAVE_AF_INET6 1'
3367 else
3368 def_inet6='#undef HAVE_AF_INET6'
3370 echores "$_inet6"
3373 echocheck "gethostbyname2"
3374 if test "$_gethostbyname2" = auto ; then
3375 cat > $TMPC << EOF
3376 #include <sys/types.h>
3377 #include <sys/socket.h>
3378 #include <netdb.h>
3379 int main(void) { gethostbyname2("", AF_INET); return 0; }
3381 _gethostbyname2=no
3382 if cc_check ; then
3383 _gethostbyname2=yes
3386 if test "$_gethostbyname2" = yes ; then
3387 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3388 else
3389 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3391 echores "$_gethostbyname2"
3394 echocheck "inttypes.h (required)"
3395 cat > $TMPC << EOF
3396 #include <inttypes.h>
3397 int main(void) { return 0; }
3399 _inttypes=no
3400 cc_check && _inttypes=yes
3401 echores "$_inttypes"
3403 if test "$_inttypes" = no ; then
3404 echocheck "bitypes.h (inttypes.h predecessor)"
3405 cat > $TMPC << EOF
3406 #include <sys/bitypes.h>
3407 int main(void) { return 0; }
3409 cc_check && _inttypes=yes
3410 if test "$_inttypes" = yes ; then
3411 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."
3412 else
3413 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3418 echocheck "int_fastXY_t in inttypes.h"
3419 cat > $TMPC << EOF
3420 #include <inttypes.h>
3421 int main(void) {
3422 volatile int_fast16_t v= 0;
3423 return v; }
3425 _fast_inttypes=no
3426 cc_check && _fast_inttypes=yes
3427 if test "$_fast_inttypes" = no ; then
3428 def_fast_inttypes='
3429 typedef signed char int_fast8_t;
3430 typedef signed int int_fast16_t;
3431 typedef signed int int_fast32_t;
3432 typedef signed long long int_fast64_t;
3433 typedef unsigned char uint_fast8_t;
3434 typedef unsigned int uint_fast16_t;
3435 typedef unsigned int uint_fast32_t;
3436 typedef unsigned long long uint_fast64_t;'
3438 echores "$_fast_inttypes"
3441 echocheck "malloc.h"
3442 cat > $TMPC << EOF
3443 #include <malloc.h>
3444 int main(void) { (void) malloc(0); return 0; }
3446 _malloc=no
3447 cc_check && _malloc=yes
3448 if test "$_malloc" = yes ; then
3449 def_malloc_h='#define HAVE_MALLOC_H 1'
3450 else
3451 def_malloc_h='#define HAVE_MALLOC_H 0'
3453 echores "$_malloc"
3456 echocheck "memalign()"
3457 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3458 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3459 cat > $TMPC << EOF
3460 #include <malloc.h>
3461 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3463 _memalign=no
3464 cc_check && _memalign=yes
3465 if test "$_memalign" = yes ; then
3466 def_memalign='#define HAVE_MEMALIGN 1'
3467 else
3468 def_memalign='#define HAVE_MEMALIGN 0'
3469 def_map_memalign='#define memalign(a,b) malloc(b)'
3470 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3472 echores "$_memalign"
3475 echocheck "posix_memalign()"
3476 posix_memalign=no
3477 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3478 cat > $TMPC << EOF
3479 #define _XOPEN_SOURCE 600
3480 #include <stdlib.h>
3481 int main(void) { posix_memalign(NULL, 0, 0); }
3483 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3484 echores "$posix_memalign"
3487 echocheck "alloca.h"
3488 cat > $TMPC << EOF
3489 #include <alloca.h>
3490 int main(void) { (void) alloca(0); return 0; }
3492 _alloca=no
3493 cc_check && _alloca=yes
3494 if cc_check ; then
3495 def_alloca_h='#define HAVE_ALLOCA_H 1'
3496 else
3497 def_alloca_h='#undef HAVE_ALLOCA_H'
3499 echores "$_alloca"
3502 echocheck "fastmemcpy"
3503 if test "$_fastmemcpy" = yes ; then
3504 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3505 else
3506 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3508 echores "$_fastmemcpy"
3511 echocheck "hard-coded tables"
3512 if test "$hardcoded_tables" = yes ; then
3513 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1'
3514 mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes'
3515 else
3516 def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0'
3518 echores "$hardcoded_tables"
3521 echocheck "mman.h"
3522 cat > $TMPC << EOF
3523 #include <sys/types.h>
3524 #include <sys/mman.h>
3525 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3527 _mman=no
3528 cc_check && _mman=yes
3529 if test "$_mman" = yes ; then
3530 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3531 else
3532 def_mman_h='#undef HAVE_SYS_MMAN_H'
3533 os2 && _need_mmap=yes
3535 echores "$_mman"
3537 cat > $TMPC << EOF
3538 #include <sys/types.h>
3539 #include <sys/mman.h>
3540 int main(void) { void *p = MAP_FAILED; return 0; }
3542 _mman_has_map_failed=no
3543 cc_check && _mman_has_map_failed=yes
3544 if test "$_mman_has_map_failed" = yes ; then
3545 def_mman_has_map_failed=''
3546 else
3547 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3550 echocheck "dynamic loader"
3551 cat > $TMPC << EOF
3552 #include <stddef.h>
3553 #include <dlfcn.h>
3554 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3556 _dl=no
3557 for _ld_tmp in "" "-ldl" ; do
3558 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3559 done
3560 if test "$_dl" = yes ; then
3561 def_dl='#define HAVE_LIBDL 1'
3562 else
3563 def_dl='#undef HAVE_LIBDL'
3565 echores "$_dl"
3568 echocheck "dynamic a/v plugins support"
3569 if test "$_dl" = no ; then
3570 _dynamic_plugins=no
3572 if test "$_dynamic_plugins" = yes ; then
3573 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3574 else
3575 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3577 echores "$_dynamic_plugins"
3580 def_threads='#define HAVE_THREADS 0'
3582 echocheck "pthread"
3583 if linux ; then
3584 THREAD_CFLAGS=-D_REENTRANT
3585 elif freebsd || netbsd || openbsd || bsdos ; then
3586 THREAD_CFLAGS=-D_THREAD_SAFE
3588 if test "$_pthreads" = auto ; then
3589 cat > $TMPC << EOF
3590 #include <pthread.h>
3591 void* func(void *arg) { return arg; }
3592 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3594 _pthreads=no
3595 if ! hpux ; then
3596 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3597 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3598 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3599 done
3602 if test "$_pthreads" = yes ; then
3603 test $_ld_pthread && _res_comment="using $_ld_pthread"
3604 def_pthreads='#define HAVE_PTHREADS 1'
3605 def_threads='#define HAVE_THREADS 1'
3606 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3607 else
3608 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3609 def_pthreads='#undef HAVE_PTHREADS'
3610 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3611 mingw32 || _win32dll=no
3613 echores "$_pthreads"
3615 if cygwin ; then
3616 if test "$_pthreads" = yes ; then
3617 def_pthread_cache="#define PTHREAD_CACHE 1"
3618 else
3619 _stream_cache=no
3620 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3624 echocheck "w32threads"
3625 if test "$_pthreads" = yes ; then
3626 _res_comment="using pthread instead"
3627 _w32threads=no
3629 if test "$_w32threads" = auto ; then
3630 _w32threads=no
3631 mingw32 && _w32threads=yes
3633 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3634 echores "$_w32threads"
3636 echocheck "rpath"
3637 netbsd &&_rpath=yes
3638 if test "$_rpath" = yes ; then
3639 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3640 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3641 done
3642 extra_ldflags=$tmp
3644 echores "$_rpath"
3646 echocheck "iconv"
3647 if test "$_iconv" = auto ; then
3648 cat > $TMPC << EOF
3649 #include <stdio.h>
3650 #include <unistd.h>
3651 #include <iconv.h>
3652 #define INBUFSIZE 1024
3653 #define OUTBUFSIZE 4096
3655 char inbuffer[INBUFSIZE];
3656 char outbuffer[OUTBUFSIZE];
3658 int main(void) {
3659 size_t numread;
3660 iconv_t icdsc;
3661 char *tocode="UTF-8";
3662 char *fromcode="cp1250";
3663 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3664 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3665 char *iptr=inbuffer;
3666 char *optr=outbuffer;
3667 size_t inleft=numread;
3668 size_t outleft=OUTBUFSIZE;
3669 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3670 != (size_t)(-1)) {
3671 write(1, outbuffer, OUTBUFSIZE - outleft);
3674 if (iconv_close(icdsc) == -1)
3677 return 0;
3680 _iconv=no
3681 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3682 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3683 _iconv=yes && break
3684 done
3686 if test "$_iconv" = yes ; then
3687 def_iconv='#define CONFIG_ICONV 1'
3688 else
3689 def_iconv='#undef CONFIG_ICONV'
3691 echores "$_iconv"
3694 echocheck "soundcard.h"
3695 _soundcard_h=no
3696 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3697 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3698 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3699 cat > $TMPC << EOF
3700 #include <$_soundcard_header>
3701 int main(void) { return 0; }
3703 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3704 done
3706 if test "$_soundcard_h" = yes ; then
3707 if test $_soundcard_header = "sys/soundcard.h"; then
3708 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3709 else
3710 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3713 echores "$_soundcard_h"
3716 echocheck "sys/dvdio.h"
3717 cat > $TMPC << EOF
3718 #include <unistd.h>
3719 #include <sys/dvdio.h>
3720 int main(void) { return 0; }
3722 _dvdio=no
3723 cc_check && _dvdio=yes
3724 if test "$_dvdio" = yes ; then
3725 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3726 else
3727 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3729 echores "$_dvdio"
3732 echocheck "sys/cdio.h"
3733 cat > $TMPC << EOF
3734 #include <unistd.h>
3735 #include <sys/cdio.h>
3736 int main(void) { return 0; }
3738 _cdio=no
3739 cc_check && _cdio=yes
3740 if test "$_cdio" = yes ; then
3741 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3742 else
3743 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3745 echores "$_cdio"
3748 echocheck "linux/cdrom.h"
3749 cat > $TMPC << EOF
3750 #include <sys/types.h>
3751 #include <linux/cdrom.h>
3752 int main(void) { return 0; }
3754 _cdrom=no
3755 cc_check && _cdrom=yes
3756 if test "$_cdrom" = yes ; then
3757 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3758 else
3759 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3761 echores "$_cdrom"
3764 echocheck "dvd.h"
3765 cat > $TMPC << EOF
3766 #include <dvd.h>
3767 int main(void) { return 0; }
3769 _dvd=no
3770 cc_check && _dvd=yes
3771 if test "$_dvd" = yes ; then
3772 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3773 else
3774 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3776 echores "$_dvd"
3779 if bsdos; then
3780 echocheck "BSDI dvd.h"
3781 cat > $TMPC << EOF
3782 #include <dvd.h>
3783 int main(void) { return 0; }
3785 _bsdi_dvd=no
3786 cc_check && _bsdi_dvd=yes
3787 if test "$_bsdi_dvd" = yes ; then
3788 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3789 else
3790 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3792 echores "$_bsdi_dvd"
3793 fi #if bsdos
3796 if hpux; then
3797 # also used by AIX, but AIX does not support VCD and/or libdvdread
3798 echocheck "HP-UX SCSI header"
3799 cat > $TMPC << EOF
3800 #include <sys/scsi.h>
3801 int main(void) { return 0; }
3803 _hpux_scsi_h=no
3804 cc_check && _hpux_scsi_h=yes
3805 if test "$_hpux_scsi_h" = yes ; then
3806 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3807 else
3808 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3810 echores "$_hpux_scsi_h"
3811 fi #if hpux
3814 if sunos; then
3815 echocheck "userspace SCSI headers (Solaris)"
3816 cat > $TMPC << EOF
3817 #include <unistd.h>
3818 #include <stropts.h>
3819 #include <sys/scsi/scsi_types.h>
3820 #include <sys/scsi/impl/uscsi.h>
3821 int main(void) { return 0; }
3823 _sol_scsi_h=no
3824 cc_check && _sol_scsi_h=yes
3825 if test "$_sol_scsi_h" = yes ; then
3826 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3827 else
3828 def_sol_scsi_h='#undef SOLARIS_USCSI'
3830 echores "$_sol_scsi_h"
3831 fi #if sunos
3834 echocheck "termcap"
3835 if test "$_termcap" = auto ; then
3836 cat > $TMPC <<EOF
3837 #include <stddef.h>
3838 #include <term.h>
3839 int main(void) { tgetent(NULL, NULL); return 0; }
3841 _termcap=no
3842 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3843 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3844 && _termcap=yes && break
3845 done
3847 if test "$_termcap" = yes ; then
3848 def_termcap='#define HAVE_TERMCAP 1'
3849 test $_ld_tmp && _res_comment="using $_ld_tmp"
3850 else
3851 def_termcap='#undef HAVE_TERMCAP'
3853 echores "$_termcap"
3856 echocheck "termios"
3857 def_termios='#undef HAVE_TERMIOS'
3858 def_termios_h='#undef HAVE_TERMIOS_H'
3859 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3860 if test "$_termios" = auto ; then
3861 _termios=no
3862 for _termios_header in "sys/termios.h" "termios.h"; do
3863 cat > $TMPC <<EOF
3864 #include <$_termios_header>
3865 int main(void) { return 0; }
3867 cc_check && _termios=yes && _res_comment="using $_termios_header" && break
3868 done
3871 if test "$_termios" = yes ; then
3872 def_termios='#define HAVE_TERMIOS 1'
3873 if test "$_termios_header" = "termios.h" ; then
3874 def_termios_h='#define HAVE_TERMIOS_H 1'
3875 else
3876 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3879 echores "$_termios"
3882 echocheck "shm"
3883 if test "$_shm" = auto ; then
3884 cat > $TMPC << EOF
3885 #include <sys/types.h>
3886 #include <sys/shm.h>
3887 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3889 _shm=no
3890 cc_check && _shm=yes
3892 if test "$_shm" = yes ; then
3893 def_shm='#define HAVE_SHM 1'
3894 else
3895 def_shm='#undef HAVE_SHM'
3897 echores "$_shm"
3900 echocheck "strsep()"
3901 cat > $TMPC << EOF
3902 #include <string.h>
3903 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3905 _strsep=no
3906 cc_check && _strsep=yes
3907 if test "$_strsep" = yes ; then
3908 def_strsep='#define HAVE_STRSEP 1'
3909 _need_strsep=no
3910 else
3911 def_strsep='#undef HAVE_STRSEP'
3912 _need_strsep=yes
3914 echores "$_strsep"
3917 echocheck "vsscanf()"
3918 cat > $TMPC << EOF
3919 #define _ISOC99_SOURCE
3920 #include <stdarg.h>
3921 #include <stdio.h>
3922 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3924 _vsscanf=no
3925 cc_check && _vsscanf=yes
3926 if test "$_vsscanf" = yes ; then
3927 def_vsscanf='#define HAVE_VSSCANF 1'
3928 _need_vsscanf=no
3929 else
3930 def_vsscanf='#undef HAVE_VSSCANF'
3931 _need_vsscanf=yes
3933 echores "$_vsscanf"
3936 echocheck "swab()"
3937 cat > $TMPC << EOF
3938 #define _XOPEN_SOURCE 600
3939 #include <unistd.h>
3940 int main(void) { swab(0, 0, 0); return 0; }
3942 _swab=no
3943 cc_check && _swab=yes
3944 if test "$_swab" = yes ; then
3945 def_swab='#define HAVE_SWAB 1'
3946 _need_swab=no
3947 else
3948 def_swab='#undef HAVE_SWAB'
3949 _need_swab=yes
3951 echores "$_swab"
3953 echocheck "POSIX select()"
3954 cat > $TMPC << EOF
3955 #include <stdio.h>
3956 #include <stdlib.h>
3957 #include <sys/types.h>
3958 #include <string.h>
3959 #include <sys/time.h>
3960 #include <unistd.h>
3961 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3963 _posix_select=no
3964 def_posix_select='#undef HAVE_POSIX_SELECT'
3965 #select() of kLIBC (OS/2) supports socket only
3966 ! os2 && cc_check && _posix_select=yes \
3967 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3968 echores "$_posix_select"
3971 echocheck "audio select()"
3972 if test "$_select" = no ; then
3973 def_select='#undef HAVE_AUDIO_SELECT'
3974 elif test "$_select" = yes ; then
3975 def_select='#define HAVE_AUDIO_SELECT 1'
3977 echores "$_select"
3980 echocheck "gettimeofday()"
3981 cat > $TMPC << EOF
3982 #include <stdio.h>
3983 #include <sys/time.h>
3984 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3986 _gettimeofday=no
3987 cc_check && _gettimeofday=yes
3988 if test "$_gettimeofday" = yes ; then
3989 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3990 _need_gettimeofday=no
3991 else
3992 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3993 _need_gettimeofday=yes
3995 echores "$_gettimeofday"
3998 echocheck "glob()"
3999 cat > $TMPC << EOF
4000 #include <stdio.h>
4001 #include <glob.h>
4002 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
4004 _glob=no
4005 cc_check && _glob=yes
4006 if test "$_glob" = yes ; then
4007 def_glob='#define HAVE_GLOB 1'
4008 _need_glob=no
4009 else
4010 def_glob='#undef HAVE_GLOB'
4011 _need_glob=yes
4013 echores "$_glob"
4016 echocheck "setenv()"
4017 cat > $TMPC << EOF
4018 #include <stdlib.h>
4019 int main(void) { setenv("","",0); return 0; }
4021 _setenv=no
4022 cc_check && _setenv=yes
4023 if test "$_setenv" = yes ; then
4024 def_setenv='#define HAVE_SETENV 1'
4025 _need_setenv=no
4026 else
4027 def_setenv='#undef HAVE_SETENV'
4028 _need_setenv=yes
4030 echores "$_setenv"
4033 echocheck "setmode()"
4034 _setmode=no
4035 def_setmode='#define HAVE_SETMODE 0'
4036 cat > $TMPC << EOF
4037 #include <io.h>
4038 int main(void) { setmode(0, 0); return 0; }
4040 cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
4041 echores "$_setmode"
4044 if sunos; then
4045 echocheck "sysi86()"
4046 cat > $TMPC << EOF
4047 #include <sys/sysi86.h>
4048 int main(void) { sysi86(0); return 0; }
4050 _sysi86=no
4051 cc_check && _sysi86=yes
4052 if test "$_sysi86" = yes ; then
4053 def_sysi86='#define HAVE_SYSI86 1'
4054 cat > $TMPC << EOF
4055 #include <sys/sysi86.h>
4056 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
4058 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
4059 else
4060 def_sysi86='#undef HAVE_SYSI86'
4062 echores "$_sysi86"
4063 fi #if sunos
4066 echocheck "sys/sysinfo.h"
4067 cat > $TMPC << EOF
4068 #include <sys/sysinfo.h>
4069 int main(void) {
4070 struct sysinfo s_info;
4071 sysinfo(&s_info);
4072 return 0;
4075 _sys_sysinfo=no
4076 cc_check && _sys_sysinfo=yes
4077 if test "$_sys_sysinfo" = yes ; then
4078 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
4079 else
4080 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
4082 echores "$_sys_sysinfo"
4085 if darwin; then
4087 echocheck "Mac OS X Finder Support"
4088 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
4089 if test "$_macosx_finder" = yes ; then
4090 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
4091 extra_ldflags="$extra_ldflags -framework Carbon"
4093 echores "$_macosx_finder"
4095 echocheck "Mac OS X Bundle file locations"
4096 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
4097 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
4098 if test "$_macosx_bundle" = yes ; then
4099 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
4100 extra_ldflags="$extra_ldflags -framework Carbon"
4102 echores "$_macosx_bundle"
4104 echocheck "Apple Remote"
4105 if test "$_apple_remote" = auto ; then
4106 _apple_remote=no
4107 cat > $TMPC <<EOF
4108 #include <stdio.h>
4109 #include <IOKit/IOCFPlugIn.h>
4110 int main(void) {
4111 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
4112 CFMutableDictionaryRef hidMatchDictionary;
4113 IOReturn ioReturnValue;
4115 // Set up a matching dictionary to search the I/O Registry by class.
4116 // name for all HID class devices
4117 hidMatchDictionary = IOServiceMatching("AppleIRController");
4119 // Now search I/O Registry for matching devices.
4120 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
4121 hidMatchDictionary, &hidObjectIterator);
4123 // If search is unsuccessful, return nonzero.
4124 if (ioReturnValue != kIOReturnSuccess ||
4125 !IOIteratorIsValid(hidObjectIterator)) {
4126 return 1;
4128 return 0;
4131 cc_check -framework IOKit && tmp_run && _apple_remote=yes
4133 if test "$_apple_remote" = yes ; then
4134 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
4135 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
4136 else
4137 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
4139 echores "$_apple_remote"
4141 fi #if darwin
4143 if linux; then
4145 echocheck "Apple IR"
4146 if test "$_apple_ir" = auto ; then
4147 _apple_ir=no
4148 cat > $TMPC <<EOF
4149 #include <linux/types.h>
4150 #include <linux/input.h>
4151 int main(void) {
4152 struct input_event ev;
4153 struct input_id id;
4154 return 0;
4157 cc_check && _apple_ir=yes
4159 if test "$_apple_ir" = yes ; then
4160 def_apple_ir='#define CONFIG_APPLE_IR 1'
4161 else
4162 def_apple_ir='#undef CONFIG_APPLE_IR'
4164 echores "$_apple_ir"
4165 fi #if linux
4167 echocheck "pkg-config"
4168 _pkg_config=pkg-config
4169 if $($_pkg_config --version > /dev/null 2>&1); then
4170 if test "$_ld_static"; then
4171 _pkg_config="$_pkg_config --static"
4173 echores "yes"
4174 else
4175 _pkg_config=false
4176 echores "no"
4180 echocheck "Samba support (libsmbclient)"
4181 if test "$_smb" = yes; then
4182 extra_ldflags="$extra_ldflags -lsmbclient"
4184 if test "$_smb" = auto; then
4185 _smb=no
4186 cat > $TMPC << EOF
4187 #include <libsmbclient.h>
4188 int main(void) { smbc_opendir("smb://"); return 0; }
4190 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
4191 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
4192 _smb=yes && break
4193 done
4196 if test "$_smb" = yes; then
4197 def_smb="#define CONFIG_LIBSMBCLIENT 1"
4198 _inputmodules="smb $_inputmodules"
4199 else
4200 def_smb="#undef CONFIG_LIBSMBCLIENT"
4201 _noinputmodules="smb $_noinputmodules"
4203 echores "$_smb"
4206 #########
4207 # VIDEO #
4208 #########
4211 echocheck "tdfxfb"
4212 if test "$_tdfxfb" = yes ; then
4213 def_tdfxfb='#define CONFIG_TDFXFB 1'
4214 _vomodules="tdfxfb $_vomodules"
4215 else
4216 def_tdfxfb='#undef CONFIG_TDFXFB'
4217 _novomodules="tdfxfb $_novomodules"
4219 echores "$_tdfxfb"
4221 echocheck "s3fb"
4222 if test "$_s3fb" = yes ; then
4223 def_s3fb='#define CONFIG_S3FB 1'
4224 _vomodules="s3fb $_vomodules"
4225 else
4226 def_s3fb='#undef CONFIG_S3FB'
4227 _novomodules="s3fb $_novomodules"
4229 echores "$_s3fb"
4231 echocheck "wii"
4232 if test "$_wii" = yes ; then
4233 def_wii='#define CONFIG_WII 1'
4234 _vomodules="wii $_vomodules"
4235 else
4236 def_wii='#undef CONFIG_WII'
4237 _novomodules="wii $_novomodules"
4239 echores "$_wii"
4241 echocheck "tdfxvid"
4242 if test "$_tdfxvid" = yes ; then
4243 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4244 _vomodules="tdfx_vid $_vomodules"
4245 else
4246 def_tdfxvid='#undef CONFIG_TDFX_VID'
4247 _novomodules="tdfx_vid $_novomodules"
4249 echores "$_tdfxvid"
4251 echocheck "xvr100"
4252 if test "$_xvr100" = auto ; then
4253 cat > $TMPC << EOF
4254 #include <unistd.h>
4255 #include <sys/fbio.h>
4256 #include <sys/visual_io.h>
4257 int main(void) {
4258 struct vis_identifier ident;
4259 struct fbgattr attr;
4260 ioctl(0, VIS_GETIDENTIFIER, &ident);
4261 ioctl(0, FBIOGATTR, &attr);
4262 return 0;
4265 _xvr100=no
4266 cc_check && _xvr100=yes
4268 if test "$_xvr100" = yes ; then
4269 def_xvr100='#define CONFIG_XVR100 1'
4270 _vomodules="xvr100 $_vomodules"
4271 else
4272 def_tdfxvid='#undef CONFIG_XVR100'
4273 _novomodules="xvr100 $_novomodules"
4275 echores "$_xvr100"
4277 echocheck "tga"
4278 if test "$_tga" = yes ; then
4279 def_tga='#define CONFIG_TGA 1'
4280 _vomodules="tga $_vomodules"
4281 else
4282 def_tga='#undef CONFIG_TGA'
4283 _novomodules="tga $_novomodules"
4285 echores "$_tga"
4288 echocheck "md5sum support"
4289 if test "$_md5sum" = yes; then
4290 def_md5sum="#define CONFIG_MD5SUM 1"
4291 _vomodules="md5sum $_vomodules"
4292 else
4293 def_md5sum="#undef CONFIG_MD5SUM"
4294 _novomodules="md5sum $_novomodules"
4296 echores "$_md5sum"
4299 echocheck "yuv4mpeg support"
4300 if test "$_yuv4mpeg" = yes; then
4301 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4302 _vomodules="yuv4mpeg $_vomodules"
4303 else
4304 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4305 _novomodules="yuv4mpeg $_novomodules"
4307 echores "$_yuv4mpeg"
4310 echocheck "bl"
4311 if test "$_bl" = yes ; then
4312 def_bl='#define CONFIG_BL 1'
4313 _vomodules="bl $_vomodules"
4314 else
4315 def_bl='#undef CONFIG_BL'
4316 _novomodules="bl $_novomodules"
4318 echores "$_bl"
4321 echocheck "DirectFB"
4322 if test "$_directfb" = auto ; then
4323 _directfb=no
4324 cat > $TMPC <<EOF
4325 #include <directfb.h>
4326 int main(void) { DirectFBInit(0, 0); return 0; }
4328 for _inc_tmp in "" -I/usr/local/include/directfb \
4329 -I/usr/include/directfb -I/usr/local/include; do
4330 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4331 extra_cflags="$extra_cflags $_inc_tmp" && break
4332 done
4335 dfb_version() {
4336 expr $1 \* 65536 + $2 \* 256 + $3
4339 if test "$_directfb" = yes; then
4340 cat > $TMPC << EOF
4341 #include <directfb_version.h>
4343 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4346 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4347 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4348 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4349 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4350 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4351 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4352 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4353 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4354 _res_comment="$_directfb_version"
4355 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4356 else
4357 def_directfb_version='#undef DIRECTFBVERSION'
4358 _directfb=no
4359 _res_comment="version >=0.9.13 required"
4361 else
4362 _directfb=no
4363 _res_comment="failed to get version"
4366 echores "$_directfb"
4368 if test "$_directfb" = yes ; then
4369 def_directfb='#define CONFIG_DIRECTFB 1'
4370 _vomodules="directfb $_vomodules"
4371 libs_mplayer="$libs_mplayer -ldirectfb"
4372 else
4373 def_directfb='#undef CONFIG_DIRECTFB'
4374 _novomodules="directfb $_novomodules"
4376 if test "$_dfbmga" = yes; then
4377 _vomodules="dfbmga $_vomodules"
4378 def_dfbmga='#define CONFIG_DFBMGA 1'
4379 else
4380 _novomodules="dfbmga $_novomodules"
4381 def_dfbmga='#undef CONFIG_DFBMGA'
4385 echocheck "X11 headers presence"
4386 _x11_headers="no"
4387 _res_comment="check if the dev(el) packages are installed"
4388 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4389 if test -f "$I/X11/Xlib.h" ; then
4390 _x11_headers="yes"
4391 _res_comment=""
4392 break
4394 done
4395 if test $_cross_compile = no; then
4396 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4397 /usr/include/X11R6 /usr/openwin/include ; do
4398 if test -f "$I/X11/Xlib.h" ; then
4399 extra_cflags="$extra_cflags -I$I"
4400 _x11_headers="yes"
4401 _res_comment="using $I"
4402 break
4404 done
4406 echores "$_x11_headers"
4409 echocheck "X11"
4410 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4411 cat > $TMPC <<EOF
4412 #include <X11/Xlib.h>
4413 #include <X11/Xutil.h>
4414 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4416 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4417 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4418 -L/usr/lib ; do
4419 if netbsd; then
4420 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4421 else
4422 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4424 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4425 && _x11=yes && break
4426 done
4428 if test "$_x11" = yes ; then
4429 def_x11='#define CONFIG_X11 1'
4430 _vomodules="x11 xover $_vomodules"
4431 else
4432 _x11=no
4433 def_x11='#undef CONFIG_X11'
4434 _novomodules="x11 $_novomodules"
4435 _res_comment="check if the dev(el) packages are installed"
4436 # disable stuff that depends on X
4437 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4439 echores "$_x11"
4441 echocheck "Xss screensaver extensions"
4442 if test "$_xss" = auto ; then
4443 cat > $TMPC << EOF
4444 #include <X11/Xlib.h>
4445 #include <X11/extensions/scrnsaver.h>
4446 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4448 _xss=no
4449 cc_check -lXss && _xss=yes
4451 if test "$_xss" = yes ; then
4452 def_xss='#define CONFIG_XSS 1'
4453 libs_mplayer="$libs_mplayer -lXss"
4454 else
4455 def_xss='#undef CONFIG_XSS'
4457 echores "$_xss"
4459 echocheck "DPMS"
4460 _xdpms3=no
4461 _xdpms4=no
4462 if test "$_x11" = yes ; then
4463 cat > $TMPC <<EOF
4464 #include <X11/Xmd.h>
4465 #include <X11/Xlib.h>
4466 #include <X11/Xutil.h>
4467 #include <X11/Xatom.h>
4468 #include <X11/extensions/dpms.h>
4469 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4471 cc_check -lXdpms && _xdpms3=yes
4472 cat > $TMPC <<EOF
4473 #include <X11/Xlib.h>
4474 #include <X11/extensions/dpms.h>
4475 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4477 cc_check -lXext && _xdpms4=yes
4479 if test "$_xdpms4" = yes ; then
4480 def_xdpms='#define CONFIG_XDPMS 1'
4481 _res_comment="using Xdpms 4"
4482 echores "yes"
4483 elif test "$_xdpms3" = yes ; then
4484 def_xdpms='#define CONFIG_XDPMS 1'
4485 libs_mplayer="$libs_mplayer -lXdpms"
4486 _res_comment="using Xdpms 3"
4487 echores "yes"
4488 else
4489 def_xdpms='#undef CONFIG_XDPMS'
4490 echores "no"
4494 echocheck "Xv"
4495 if test "$_xv" = auto ; then
4496 cat > $TMPC <<EOF
4497 #include <X11/Xlib.h>
4498 #include <X11/extensions/Xvlib.h>
4499 int main(void) {
4500 (void) XvGetPortAttribute(0, 0, 0, 0);
4501 (void) XvQueryPortAttributes(0, 0, 0);
4502 return 0; }
4504 _xv=no
4505 cc_check -lXv && _xv=yes
4508 if test "$_xv" = yes ; then
4509 def_xv='#define CONFIG_XV 1'
4510 libs_mplayer="$libs_mplayer -lXv"
4511 _vomodules="xv $_vomodules"
4512 else
4513 def_xv='#undef CONFIG_XV'
4514 _novomodules="xv $_novomodules"
4516 echores "$_xv"
4519 echocheck "XvMC"
4520 if test "$_xv" = yes && test "$_xvmc" != no ; then
4521 _xvmc=no
4522 cat > $TMPC <<EOF
4523 #include <X11/Xlib.h>
4524 #include <X11/extensions/Xvlib.h>
4525 #include <X11/extensions/XvMClib.h>
4526 int main(void) {
4527 (void) XvMCQueryExtension(0,0,0);
4528 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4529 return 0; }
4531 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4532 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4533 done
4535 if test "$_xvmc" = yes ; then
4536 def_xvmc='#define CONFIG_XVMC 1'
4537 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4538 _vomodules="xvmc $_vomodules"
4539 _res_comment="using $_xvmclib"
4540 else
4541 def_xvmc='#define CONFIG_XVMC 0'
4542 _novomodules="xvmc $_novomodules"
4543 _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//)
4545 echores "$_xvmc"
4548 echocheck "VDPAU"
4549 if test "$_vdpau" = auto ; then
4550 _vdpau=no
4551 if test "$_dl" = yes ; then
4552 cat > $TMPC <<EOF
4553 #include <vdpau/vdpau_x11.h>
4554 int main(void) {
4555 (void) vdp_device_create_x11(0, 0, 0, 0);
4556 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4558 cc_check -lvdpau && _vdpau=yes
4561 if test "$_vdpau" = yes ; then
4562 def_vdpau='#define CONFIG_VDPAU 1'
4563 libs_mplayer="$libs_mplayer -lvdpau"
4564 _vomodules="vdpau $_vomodules"
4565 else
4566 def_vdpau='#define CONFIG_VDPAU 0'
4567 _novomodules="vdpau $_novomodules"
4568 _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//)
4570 echores "$_vdpau"
4573 echocheck "Xinerama"
4574 if test "$_xinerama" = auto ; then
4575 cat > $TMPC <<EOF
4576 #include <X11/Xlib.h>
4577 #include <X11/extensions/Xinerama.h>
4578 int main(void) { (void) XineramaIsActive(0); return 0; }
4580 _xinerama=no
4581 cc_check -lXinerama && _xinerama=yes
4584 if test "$_xinerama" = yes ; then
4585 def_xinerama='#define CONFIG_XINERAMA 1'
4586 libs_mplayer="$libs_mplayer -lXinerama"
4587 else
4588 def_xinerama='#undef CONFIG_XINERAMA'
4590 echores "$_xinerama"
4593 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4594 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4595 # named 'X extensions' or something similar.
4596 # This check may be useful for future mplayer versions (to change resolution)
4597 # If you run into problems, remove '-lXxf86vm'.
4598 echocheck "Xxf86vm"
4599 if test "$_vm" = auto ; then
4600 cat > $TMPC <<EOF
4601 #include <X11/Xlib.h>
4602 #include <X11/extensions/xf86vmode.h>
4603 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4605 _vm=no
4606 cc_check -lXxf86vm && _vm=yes
4608 if test "$_vm" = yes ; then
4609 def_vm='#define CONFIG_XF86VM 1'
4610 libs_mplayer="$libs_mplayer -lXxf86vm"
4611 else
4612 def_vm='#undef CONFIG_XF86VM'
4614 echores "$_vm"
4616 # Check for the presence of special keycodes, like audio control buttons
4617 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4618 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4619 # have these new keycodes.
4620 echocheck "XF86keysym"
4621 if test "$_xf86keysym" = auto; then
4622 _xf86keysym=no
4623 cat > $TMPC <<EOF
4624 #include <X11/Xlib.h>
4625 #include <X11/XF86keysym.h>
4626 int main(void) { return XF86XK_AudioPause; }
4628 cc_check && _xf86keysym=yes
4630 if test "$_xf86keysym" = yes ; then
4631 def_xf86keysym='#define CONFIG_XF86XK 1'
4632 else
4633 def_xf86keysym='#undef CONFIG_XF86XK'
4635 echores "$_xf86keysym"
4637 echocheck "DGA"
4638 if test "$_dga2" = auto && test "$_x11" = yes ; then
4639 cat > $TMPC << EOF
4640 #include <X11/Xlib.h>
4641 #include <X11/extensions/xf86dga.h>
4642 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4644 _dga2=no
4645 cc_check -lXxf86dga && _dga2=yes
4647 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4648 cat > $TMPC << EOF
4649 #include <X11/Xlib.h>
4650 #include <X11/extensions/xf86dga.h>
4651 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4653 _dga1=no
4654 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4657 _dga=no
4658 def_dga='#undef CONFIG_DGA'
4659 def_dga1='#undef CONFIG_DGA1'
4660 def_dga2='#undef CONFIG_DGA2'
4661 if test "$_dga1" = yes ; then
4662 _dga=yes
4663 def_dga1='#define CONFIG_DGA1 1'
4664 _res_comment="using DGA 1.0"
4665 elif test "$_dga2" = yes ; then
4666 _dga=yes
4667 def_dga2='#define CONFIG_DGA2 1'
4668 _res_comment="using DGA 2.0"
4670 if test "$_dga" = yes ; then
4671 def_dga='#define CONFIG_DGA 1'
4672 libs_mplayer="$libs_mplayer -lXxf86dga"
4673 _vomodules="dga $_vomodules"
4674 else
4675 _novomodules="dga $_novomodules"
4677 echores "$_dga"
4680 echocheck "3dfx"
4681 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4682 def_3dfx='#define CONFIG_3DFX 1'
4683 _vomodules="3dfx $_vomodules"
4684 else
4685 def_3dfx='#undef CONFIG_3DFX'
4686 _novomodules="3dfx $_novomodules"
4688 echores "$_3dfx"
4691 echocheck "VIDIX"
4692 def_vidix='#undef CONFIG_VIDIX'
4693 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4694 _vidix_drv_cyberblade=no
4695 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4696 _vidix_drv_ivtv=no
4697 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4698 _vidix_drv_mach64=no
4699 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4700 _vidix_drv_mga=no
4701 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4702 _vidix_drv_mga_crtc2=no
4703 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4704 _vidix_drv_nvidia=no
4705 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4706 _vidix_drv_pm2=no
4707 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4708 _vidix_drv_pm3=no
4709 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4710 _vidix_drv_radeon=no
4711 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4712 _vidix_drv_rage128=no
4713 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4714 _vidix_drv_s3=no
4715 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4716 _vidix_drv_sh_veu=no
4717 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4718 _vidix_drv_sis=no
4719 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4720 _vidix_drv_unichrome=no
4721 if test "$_vidix" = auto ; then
4722 _vidix=no
4723 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4724 && _vidix=yes
4725 x86_64 && ! linux && _vidix=no
4726 (ppc || alpha) && linux && _vidix=yes
4728 echores "$_vidix"
4730 if test "$_vidix" = yes ; then
4731 def_vidix='#define CONFIG_VIDIX 1'
4732 _vomodules="cvidix $_vomodules"
4733 # FIXME: ivtv driver temporarily disabled until we have a proper test
4734 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4735 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4737 # some vidix drivers are architecture and os specific, discard them elsewhere
4738 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4739 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4741 for driver in $_vidix_drivers ; do
4742 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4743 eval _vidix_drv_${driver}=yes
4744 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4745 done
4747 echocheck "VIDIX PCI device name database"
4748 echores "$_vidix_pcidb"
4749 if test "$_vidix_pcidb" = yes ; then
4750 _vidix_pcidb_val=1
4751 else
4752 _vidix_pcidb_val=0
4755 echocheck "VIDIX dhahelper support"
4756 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4757 echores "$_dhahelper"
4759 echocheck "VIDIX svgalib_helper support"
4760 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4761 echores "$_svgalib_helper"
4763 else
4764 _novomodules="cvidix $_novomodules"
4767 if test "$_vidix" = yes && win32; then
4768 winvidix=yes
4769 _vomodules="winvidix $_vomodules"
4770 libs_mplayer="$libs_mplayer -lgdi32"
4771 else
4772 _novomodules="winvidix $_novomodules"
4774 if test "$_vidix" = yes && test "$_x11" = yes; then
4775 xvidix=yes
4776 _vomodules="xvidix $_vomodules"
4777 else
4778 _novomodules="xvidix $_novomodules"
4781 echocheck "/dev/mga_vid"
4782 if test "$_mga" = auto ; then
4783 _mga=no
4784 test -c /dev/mga_vid && _mga=yes
4786 if test "$_mga" = yes ; then
4787 def_mga='#define CONFIG_MGA 1'
4788 _vomodules="mga $_vomodules"
4789 else
4790 def_mga='#undef CONFIG_MGA'
4791 _novomodules="mga $_novomodules"
4793 echores "$_mga"
4795 echocheck "xmga"
4796 if test "$_xmga" = auto ; then
4797 _xmga=no
4798 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
4800 if test "$_xmga" = yes ; then
4801 def_xmga='#define CONFIG_XMGA 1'
4802 _vomodules="xmga $_vomodules"
4803 else
4804 def_xmga='#undef CONFIG_XMGA'
4805 _novomodules="xmga $_novomodules"
4807 echores "$_xmga"
4810 echocheck "GGI"
4811 if test "$_ggi" = auto ; then
4812 cat > $TMPC << EOF
4813 #include <ggi/ggi.h>
4814 int main(void) { ggiInit(); return 0; }
4816 _ggi=no
4817 cc_check -lggi && _ggi=yes
4819 if test "$_ggi" = yes ; then
4820 def_ggi='#define CONFIG_GGI 1'
4821 libs_mplayer="$libs_mplayer -lggi"
4822 _vomodules="ggi $_vomodules"
4823 else
4824 def_ggi='#undef CONFIG_GGI'
4825 _novomodules="ggi $_novomodules"
4827 echores "$_ggi"
4829 echocheck "GGI extension: libggiwmh"
4830 if test "$_ggiwmh" = auto ; then
4831 _ggiwmh=no
4832 cat > $TMPC << EOF
4833 #include <ggi/ggi.h>
4834 #include <ggi/wmh.h>
4835 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4837 cc_check -lggi -lggiwmh && _ggiwmh=yes
4839 # needed to get right output on obscure combination
4840 # like --disable-ggi --enable-ggiwmh
4841 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4842 def_ggiwmh='#define CONFIG_GGIWMH 1'
4843 libs_mplayer="$libs_mplayer -lggiwmh"
4844 else
4845 _ggiwmh=no
4846 def_ggiwmh='#undef CONFIG_GGIWMH'
4848 echores "$_ggiwmh"
4851 echocheck "AA"
4852 if test "$_aa" = auto ; then
4853 cat > $TMPC << EOF
4854 #include <aalib.h>
4855 extern struct aa_hardware_params aa_defparams;
4856 extern struct aa_renderparams aa_defrenderparams;
4857 int main(void) {
4858 aa_context *c;
4859 aa_renderparams *p;
4860 (void) aa_init(0, 0, 0);
4861 c = aa_autoinit(&aa_defparams);
4862 p = aa_getrenderparams();
4863 aa_autoinitkbd(c,0);
4864 return 0; }
4866 _aa=no
4867 for _ld_tmp in "-laa" ; do
4868 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4869 done
4871 if test "$_aa" = yes ; then
4872 def_aa='#define CONFIG_AA 1'
4873 if cygwin ; then
4874 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4876 _vomodules="aa $_vomodules"
4877 else
4878 def_aa='#undef CONFIG_AA'
4879 _novomodules="aa $_novomodules"
4881 echores "$_aa"
4884 echocheck "CACA"
4885 if test "$_caca" = auto ; then
4886 _caca=no
4887 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4888 cat > $TMPC << EOF
4889 #include <caca.h>
4890 #ifdef CACA_API_VERSION_1
4891 #include <caca0.h>
4892 #endif
4893 int main(void) { (void) caca_init(); return 0; }
4895 cc_check $(caca-config --libs) && _caca=yes
4898 if test "$_caca" = yes ; then
4899 def_caca='#define CONFIG_CACA 1'
4900 extra_cflags="$extra_cflags $(caca-config --cflags)"
4901 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4902 _vomodules="caca $_vomodules"
4903 else
4904 def_caca='#undef CONFIG_CACA'
4905 _novomodules="caca $_novomodules"
4907 echores "$_caca"
4910 echocheck "SVGAlib"
4911 if test "$_svga" = auto ; then
4912 cat > $TMPC << EOF
4913 #include <vga.h>
4914 int main(void) { return 0; }
4916 _svga=no
4917 cc_check -lvga $_ld_lm && _svga=yes
4919 if test "$_svga" = yes ; then
4920 def_svga='#define CONFIG_SVGALIB 1'
4921 libs_mplayer="$libs_mplayer -lvga"
4922 _vomodules="svga $_vomodules"
4923 else
4924 def_svga='#undef CONFIG_SVGALIB'
4925 _novomodules="svga $_novomodules"
4927 echores "$_svga"
4930 echocheck "FBDev"
4931 if test "$_fbdev" = auto ; then
4932 _fbdev=no
4933 linux && _fbdev=yes
4935 if test "$_fbdev" = yes ; then
4936 def_fbdev='#define CONFIG_FBDEV 1'
4937 _vomodules="fbdev $_vomodules"
4938 else
4939 def_fbdev='#undef CONFIG_FBDEV'
4940 _novomodules="fbdev $_novomodules"
4942 echores "$_fbdev"
4946 echocheck "DVB"
4947 if test "$_dvb" = auto ; then
4948 _dvb=no
4949 cat >$TMPC << EOF
4950 #include <poll.h>
4951 #include <sys/ioctl.h>
4952 #include <stdio.h>
4953 #include <time.h>
4954 #include <unistd.h>
4955 #include <linux/dvb/dmx.h>
4956 #include <linux/dvb/frontend.h>
4957 #include <linux/dvb/video.h>
4958 #include <linux/dvb/audio.h>
4959 int main(void) {return 0;}
4961 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4962 cc_check $_inc_tmp && _dvb=yes && \
4963 extra_cflags="$extra_cflags $_inc_tmp" && break
4964 done
4966 echores "$_dvb"
4967 if test "$_dvb" = yes ; then
4968 _dvbin=yes
4969 _inputmodules="dvb $_inputmodules"
4970 def_dvb='#define CONFIG_DVB 1'
4971 def_dvbin='#define CONFIG_DVBIN 1'
4972 _aomodules="mpegpes(dvb) $_aomodules"
4973 _vomodules="mpegpes(dvb) $_vomodules"
4974 else
4975 _dvbin=no
4976 _noinputmodules="dvb $_noinputmodules"
4977 def_dvb='#undef CONFIG_DVB'
4978 def_dvbin='#undef CONFIG_DVBIN '
4979 _aomodules="mpegpes(file) $_aomodules"
4980 _vomodules="mpegpes(file) $_vomodules"
4984 if darwin; then
4986 echocheck "QuickTime"
4987 if test "$quicktime" = auto ; then
4988 cat > $TMPC <<EOF
4989 #include <QuickTime/QuickTime.h>
4990 int main(void) {
4991 ImageDescription *desc;
4992 EnterMovies();
4993 ExitMovies();
4994 return 0;
4997 quicktime=no
4998 cc_check -framework QuickTime && quicktime=yes
5000 if test "$quicktime" = yes ; then
5001 extra_ldflags="$extra_ldflags -framework QuickTime"
5002 def_quicktime='#define CONFIG_QUICKTIME 1'
5003 else
5004 def_quicktime='#undef CONFIG_QUICKTIME'
5005 _quartz=no
5007 echores $quicktime
5009 echocheck "Quartz"
5010 if test "$_quartz" = auto ; then
5011 cat > $TMPC <<EOF
5012 #include <Carbon/Carbon.h>
5013 int main(void) {
5014 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
5015 return 0;
5018 _quartz=no
5019 cc_check -framework Carbon && _quartz=yes
5021 if test "$_quartz" = yes ; then
5022 libs_mplayer="$libs_mplayer -framework Carbon"
5023 def_quartz='#define CONFIG_QUARTZ 1'
5024 _vomodules="quartz $_vomodules"
5025 else
5026 def_quartz='#undef CONFIG_QUARTZ'
5027 _novomodules="quartz $_novomodules"
5029 echores $_quartz
5031 echocheck "CoreVideo"
5032 if test "$_corevideo" = auto ; then
5033 cat > $TMPC <<EOF
5034 #include <Carbon/Carbon.h>
5035 #include <CoreServices/CoreServices.h>
5036 #include <OpenGL/OpenGL.h>
5037 #include <QuartzCore/CoreVideo.h>
5038 int main(void) { return 0; }
5040 _corevideo=no
5041 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
5043 if test "$_corevideo" = yes ; then
5044 _vomodules="corevideo $_vomodules"
5045 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
5046 def_corevideo='#define CONFIG_COREVIDEO 1'
5047 else
5048 _novomodules="corevideo $_novomodules"
5049 def_corevideo='#undef CONFIG_COREVIDEO'
5051 echores "$_corevideo"
5053 fi #if darwin
5056 echocheck "PNG support"
5057 if test "$_png" = auto ; then
5058 _png=no
5059 if irix ; then
5060 # Don't check for -lpng on irix since it has its own libpng
5061 # incompatible with the GNU libpng
5062 _res_comment="disabled on irix (not GNU libpng)"
5063 else
5064 cat > $TMPC << EOF
5065 #include <png.h>
5066 #include <string.h>
5067 int main(void) {
5068 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
5069 printf("libpng: %s\n", png_libpng_ver);
5070 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
5073 cc_check -lpng -lz $_ld_lm && _png=yes
5076 echores "$_png"
5077 if test "$_png" = yes ; then
5078 def_png='#define CONFIG_PNG 1'
5079 extra_ldflags="$extra_ldflags -lpng -lz"
5080 else
5081 def_png='#undef CONFIG_PNG'
5084 echocheck "MNG support"
5085 if test "$_mng" = auto ; then
5086 _mng=no
5087 cat > $TMPC << EOF
5088 #include <libmng.h>
5089 int main(void) {
5090 const char * p_ver = mng_version_text();
5091 return !p_ver || p_ver[0] == 0;
5094 if cc_check -lmng -lz $_ld_lm ; then
5095 _mng=yes
5098 echores "$_mng"
5099 if test "$_mng" = yes ; then
5100 def_mng='#define CONFIG_MNG 1'
5101 extra_ldflags="$extra_ldflags -lmng -lz"
5102 else
5103 def_mng='#undef CONFIG_MNG'
5106 echocheck "JPEG support"
5107 if test "$_jpeg" = auto ; then
5108 _jpeg=no
5109 cat > $TMPC << EOF
5110 #include <stdio.h>
5111 #include <stdlib.h>
5112 #include <setjmp.h>
5113 #include <string.h>
5114 #include <jpeglib.h>
5115 int main(void) { return 0; }
5117 cc_check -ljpeg $_ld_lm && _jpeg=yes
5119 echores "$_jpeg"
5121 if test "$_jpeg" = yes ; then
5122 def_jpeg='#define CONFIG_JPEG 1'
5123 _vomodules="jpeg $_vomodules"
5124 extra_ldflags="$extra_ldflags -ljpeg"
5125 else
5126 def_jpeg='#undef CONFIG_JPEG'
5127 _novomodules="jpeg $_novomodules"
5131 echocheck "OpenJPEG (JPEG2000) support"
5132 if test "$libopenjpeg" = auto ; then
5133 libopenjpeg=no
5134 cat > $TMPC << EOF
5135 #define OPJ_STATIC
5136 #include <openjpeg.h>
5137 int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; }
5139 cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes
5141 echores "$libopenjpeg"
5142 if test "$libopenjpeg" = yes ; then
5143 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1'
5144 extra_ldflags="$extra_ldflags -lopenjpeg"
5145 _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER"
5146 _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER"
5147 _codecmodules="OpenJPEG $_codecmodules"
5148 else
5149 def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0'
5150 _nocodecmodules="OpenJPEG $_nocodecmodules"
5154 echocheck "PNM support"
5155 if test "$_pnm" = yes; then
5156 def_pnm="#define CONFIG_PNM 1"
5157 _vomodules="pnm $_vomodules"
5158 else
5159 def_pnm="#undef CONFIG_PNM"
5160 _novomodules="pnm $_novomodules"
5162 echores "$_pnm"
5166 echocheck "GIF support"
5167 # This is to appease people who want to force gif support.
5168 # If it is forced to yes, then we still do checks to determine
5169 # which gif library to use.
5170 if test "$_gif" = yes ; then
5171 _force_gif=yes
5172 _gif=auto
5175 if test "$_gif" = auto ; then
5176 _gif=no
5177 cat > $TMPC << EOF
5178 #include <gif_lib.h>
5179 int main(void) { return 0; }
5181 for _ld_gif in "-lungif" "-lgif" ; do
5182 cc_check $_ld_gif && _gif=yes && break
5183 done
5186 # If no library was found, and the user wants support forced,
5187 # then we force it on with libgif, as this is the safest
5188 # assumption IMHO. (libungif & libregif both create symbolic
5189 # links to libgif. We also assume that no x11 support is needed,
5190 # because if you are forcing this, then you _should_ know what
5191 # you are doing. [ Besides, package maintainers should never
5192 # have compiled x11 deps into libungif in the first place. ] )
5193 # </rant>
5194 # --Joey
5195 if test "$_force_gif" = yes && test "$_gif" = no ; then
5196 _gif=yes
5197 _ld_gif="-lgif"
5200 if test "$_gif" = yes ; then
5201 def_gif='#define CONFIG_GIF 1'
5202 _codecmodules="gif $_codecmodules"
5203 _vomodules="gif89a $_vomodules"
5204 _res_comment="old version, some encoding functions disabled"
5205 def_gif_4='#undef CONFIG_GIF_4'
5206 extra_ldflags="$extra_ldflags $_ld_gif"
5208 cat > $TMPC << EOF
5209 #include <signal.h>
5210 #include <gif_lib.h>
5211 void catch() { exit(1); }
5212 int main(void) {
5213 signal(SIGSEGV, catch); // catch segfault
5214 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5215 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5216 return 0;
5219 if cc_check "$_ld_gif" ; then
5220 def_gif_4='#define CONFIG_GIF_4 1'
5221 _res_comment=""
5223 else
5224 def_gif='#undef CONFIG_GIF'
5225 def_gif_4='#undef CONFIG_GIF_4'
5226 _novomodules="gif89a $_novomodules"
5227 _nocodecmodules="gif $_nocodecmodules"
5229 echores "$_gif"
5232 case "$_gif" in yes*)
5233 echocheck "broken giflib workaround"
5234 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5236 cat > $TMPC << EOF
5237 #include <gif_lib.h>
5238 int main(void) {
5239 GifFileType gif;
5240 printf("UserData is at address %p\n", gif.UserData);
5241 return 0;
5244 if cc_check "$_ld_gif" ; then
5245 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5246 echores "disabled"
5247 else
5248 echores "enabled"
5251 esac
5254 echocheck "VESA support"
5255 if test "$_vesa" = auto ; then
5256 cat > $TMPC << EOF
5257 #include <vbe.h>
5258 int main(void) { vbeVersion(); return 0; }
5260 _vesa=no
5261 cc_check -lvbe -llrmi && _vesa=yes
5263 if test "$_vesa" = yes ; then
5264 def_vesa='#define CONFIG_VESA 1'
5265 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5266 _vomodules="vesa $_vomodules"
5267 else
5268 def_vesa='#undef CONFIG_VESA'
5269 _novomodules="vesa $_novomodules"
5271 echores "$_vesa"
5273 #################
5274 # VIDEO + AUDIO #
5275 #################
5278 echocheck "SDL"
5279 _inc_tmp=""
5280 _ld_tmp=""
5281 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5282 if test -z "$_sdlconfig" ; then
5283 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5284 _sdlconfig="sdl-config"
5285 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5286 _sdlconfig="sdl11-config"
5287 else
5288 _sdlconfig=false
5291 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5292 cat > $TMPC << EOF
5293 #ifdef CONFIG_SDL_SDL_H
5294 #include <SDL/SDL.h>
5295 #else
5296 #include <SDL.h>
5297 #endif
5298 #ifndef __APPLE__
5299 // we allow SDL hacking our main() only on OSX
5300 #undef main
5301 #endif
5302 int main(int argc, char *argv[]) {
5303 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5304 return 0;
5307 _sdl=no
5308 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
5309 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5310 _sdl=yes
5311 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5312 break
5314 done
5315 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5316 _res_comment="using $_sdlconfig"
5317 if cygwin ; then
5318 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5319 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5320 elif mingw32 ; then
5321 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5322 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5323 else
5324 _inc_tmp="$($_sdlconfig --cflags)"
5325 _ld_tmp="$($_sdlconfig --libs)"
5327 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5328 _sdl=yes
5332 if test "$_sdl" = yes ; then
5333 def_sdl='#define CONFIG_SDL 1'
5334 extra_cflags="$extra_cflags $_inc_tmp"
5335 libs_mplayer="$libs_mplayer $_ld_tmp"
5336 _vomodules="sdl $_vomodules"
5337 _aomodules="sdl $_aomodules"
5338 else
5339 def_sdl='#undef CONFIG_SDL'
5340 _novomodules="sdl $_novomodules"
5341 _noaomodules="sdl $_noaomodules"
5343 echores "$_sdl"
5346 # make sure this stays below CoreVideo to avoid issues due to namespace
5347 # conflicts between -lGL and -framework OpenGL
5348 echocheck "OpenGL"
5349 #Note: this test is run even with --enable-gl since we autodetect linker flags
5350 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
5351 cat > $TMPC << EOF
5352 #ifdef GL_WIN32
5353 #include <windows.h>
5354 #include <GL/gl.h>
5355 #elif defined(GL_SDL)
5356 #include <GL/gl.h>
5357 #ifdef CONFIG_SDL_SDL_H
5358 #include <SDL/SDL.h>
5359 #else
5360 #include <SDL.h>
5361 #endif
5362 #ifndef __APPLE__
5363 // we allow SDL hacking our main() only on OSX
5364 #undef main
5365 #endif
5366 #else
5367 #include <GL/gl.h>
5368 #include <X11/Xlib.h>
5369 #include <GL/glx.h>
5370 #endif
5371 int main(void) {
5372 #ifdef GL_WIN32
5373 HDC dc;
5374 wglCreateContext(dc);
5375 #elif defined(GL_SDL)
5376 SDL_GL_SwapBuffers();
5377 #else
5378 glXCreateContext(NULL, NULL, NULL, True);
5379 #endif
5380 glFinish();
5381 return 0;
5384 _gl=no
5385 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
5386 if cc_check $_ld_tmp $_ld_lm ; then
5387 _gl=yes
5388 _gl_x11=yes
5389 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
5390 break
5392 done
5393 if cc_check -DGL_WIN32 -lopengl32 ; then
5394 _gl=yes
5395 _gl_win32=yes
5396 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
5398 # last so it can reuse any linker etc. flags detected before
5399 if test "$_sdl" = yes ; then
5400 if cc_check -DGL_SDL ||
5401 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
5402 _gl=yes
5403 _gl_sdl=yes
5404 elif cc_check -DGL_SDL -lGL ||
5405 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
5406 _gl=yes
5407 _gl_sdl=yes
5408 libs_mplayer="$libs_mplayer -lGL"
5411 else
5412 _gl=no
5414 if test "$_gl" = yes ; then
5415 def_gl='#define CONFIG_GL 1'
5416 _res_comment="backends:"
5417 if test "$_gl_win32" = yes ; then
5418 def_gl_win32='#define CONFIG_GL_WIN32 1'
5419 _res_comment="$_res_comment win32"
5421 if test "$_gl_x11" = yes ; then
5422 def_gl_x11='#define CONFIG_GL_X11 1'
5423 _res_comment="$_res_comment x11"
5425 if test "$_gl_sdl" = yes ; then
5426 def_gl_sdl='#define CONFIG_GL_SDL 1'
5427 _res_comment="$_res_comment sdl"
5429 _vomodules="opengl $_vomodules"
5430 else
5431 def_gl='#undef CONFIG_GL'
5432 def_gl_win32='#undef CONFIG_GL_WIN32'
5433 def_gl_x11='#undef CONFIG_GL_X11'
5434 def_gl_sdl='#undef CONFIG_GL_SDL'
5435 _novomodules="opengl $_novomodules"
5437 echores "$_gl"
5440 echocheck "MatrixView"
5441 if test "$_gl" = no ; then
5442 matrixview=no
5444 if test "$matrixview" = yes ; then
5445 _vomodules="matrixview $_vomodules"
5446 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5447 else
5448 _novomodules="matrixview $_novomodules"
5449 def_matrixview='#undef CONFIG_MATRIXVIEW'
5451 echores "$matrixview"
5454 if os2 ; then
5455 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5456 if test "$_kva" = auto; then
5457 cat > $TMPC << EOF
5458 #include <os2.h>
5459 #include <kva.h>
5460 int main( void ) { return 0; }
5462 _kva=no;
5463 cc_check -lkva && _kva=yes
5465 if test "$_kva" = yes ; then
5466 def_kva='#define CONFIG_KVA 1'
5467 libs_mplayer="$libs_mplayer -lkva"
5468 _vomodules="kva $_vomodules"
5469 else
5470 def_kva='#undef CONFIG_KVA'
5471 _novomodules="kva $_novomodules"
5473 echores "$_kva"
5474 fi #if os2
5477 if win32; then
5479 echocheck "Windows waveout"
5480 if test "$_win32waveout" = auto ; then
5481 cat > $TMPC << EOF
5482 #include <windows.h>
5483 #include <mmsystem.h>
5484 int main(void) { return 0; }
5486 _win32waveout=no
5487 cc_check -lwinmm && _win32waveout=yes
5489 if test "$_win32waveout" = yes ; then
5490 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5491 libs_mplayer="$libs_mplayer -lwinmm"
5492 _aomodules="win32 $_aomodules"
5493 else
5494 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5495 _noaomodules="win32 $_noaomodules"
5497 echores "$_win32waveout"
5499 echocheck "Direct3D"
5500 if test "$_direct3d" = auto ; then
5501 cat > $TMPC << EOF
5502 #include <windows.h>
5503 #include <d3d9.h>
5504 int main(void) { return 0; }
5506 _direct3d=no
5507 cc_check && _direct3d=yes
5509 if test "$_direct3d" = yes ; then
5510 def_direct3d='#define CONFIG_DIRECT3D 1'
5511 _vomodules="direct3d $_vomodules"
5512 else
5513 def_direct3d='#undef CONFIG_DIRECT3D'
5514 _novomodules="direct3d $_novomodules"
5516 echores "$_direct3d"
5518 echocheck "Directx"
5519 if test "$_directx" = auto ; then
5520 cat > $TMPC << EOF
5521 #include <windows.h>
5522 #include <ddraw.h>
5523 #include <dsound.h>
5524 int main(void) { return 0; }
5526 _directx=no
5527 cc_check -lgdi32 && _directx=yes
5529 if test "$_directx" = yes ; then
5530 def_directx='#define CONFIG_DIRECTX 1'
5531 libs_mplayer="$libs_mplayer -lgdi32"
5532 _vomodules="directx $_vomodules"
5533 _aomodules="dsound $_aomodules"
5534 else
5535 def_directx='#undef CONFIG_DIRECTX'
5536 _novomodules="directx $_novomodules"
5537 _noaomodules="dsound $_noaomodules"
5539 echores "$_directx"
5541 fi #if win32; then
5544 echocheck "DXR2"
5545 if test "$_dxr2" = auto; then
5546 _dxr2=no
5547 cat > $TMPC << EOF
5548 #include <dxr2ioctl.h>
5549 int main(void) { return 0; }
5551 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5552 cc_check $_inc_tmp && _dxr2=yes && \
5553 extra_cflags="$extra_cflags $_inc_tmp" && break
5554 done
5556 if test "$_dxr2" = yes; then
5557 def_dxr2='#define CONFIG_DXR2 1'
5558 _aomodules="dxr2 $_aomodules"
5559 _vomodules="dxr2 $_vomodules"
5560 else
5561 def_dxr2='#undef CONFIG_DXR2'
5562 _noaomodules="dxr2 $_noaomodules"
5563 _novomodules="dxr2 $_novomodules"
5565 echores "$_dxr2"
5567 echocheck "DXR3/H+"
5568 if test "$_dxr3" = auto ; then
5569 cat > $TMPC << EOF
5570 #include <linux/em8300.h>
5571 int main(void) { return 0; }
5573 _dxr3=no
5574 cc_check && _dxr3=yes
5576 if test "$_dxr3" = yes ; then
5577 def_dxr3='#define CONFIG_DXR3 1'
5578 _vomodules="dxr3 $_vomodules"
5579 else
5580 def_dxr3='#undef CONFIG_DXR3'
5581 _novomodules="dxr3 $_novomodules"
5583 echores "$_dxr3"
5586 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5587 if test "$_ivtv" = auto ; then
5588 cat > $TMPC << EOF
5589 #include <stdlib.h>
5590 #include <inttypes.h>
5591 #include <linux/types.h>
5592 #include <linux/videodev2.h>
5593 #include <linux/ivtv.h>
5594 #include <sys/ioctl.h>
5595 int main(void) {
5596 struct ivtv_cfg_stop_decode sd;
5597 struct ivtv_cfg_start_decode sd1;
5598 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5599 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5600 return 0; }
5602 _ivtv=no
5603 cc_check && _ivtv=yes
5605 if test "$_ivtv" = yes ; then
5606 def_ivtv='#define CONFIG_IVTV 1'
5607 _vomodules="ivtv $_vomodules"
5608 _aomodules="ivtv $_aomodules"
5609 else
5610 def_ivtv='#undef CONFIG_IVTV'
5611 _novomodules="ivtv $_novomodules"
5612 _noaomodules="ivtv $_noaomodules"
5614 echores "$_ivtv"
5617 echocheck "V4L2 MPEG Decoder"
5618 if test "$_v4l2" = auto ; then
5619 cat > $TMPC << EOF
5620 #include <stdlib.h>
5621 #include <inttypes.h>
5622 #include <linux/types.h>
5623 #include <linux/videodev2.h>
5624 #include <linux/version.h>
5625 int main(void) {
5626 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5627 #error kernel headers too old, need 2.6.22
5628 #endif
5629 struct v4l2_ext_controls ctrls;
5630 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5631 return 0;
5634 _v4l2=no
5635 cc_check && _v4l2=yes
5637 if test "$_v4l2" = yes ; then
5638 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5639 _vomodules="v4l2 $_vomodules"
5640 _aomodules="v4l2 $_aomodules"
5641 else
5642 def_v4l2='#undef CONFIG_V4L2_DECODER'
5643 _novomodules="v4l2 $_novomodules"
5644 _noaomodules="v4l2 $_noaomodules"
5646 echores "$_v4l2"
5650 #########
5651 # AUDIO #
5652 #########
5655 echocheck "OSS Audio"
5656 if test "$_ossaudio" = auto ; then
5657 cat > $TMPC << EOF
5658 #include <sys/ioctl.h>
5659 #include <$_soundcard_header>
5660 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5662 _ossaudio=no
5663 cc_check && _ossaudio=yes
5665 if test "$_ossaudio" = yes ; then
5666 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5667 _aomodules="oss $_aomodules"
5668 if test "$_linux_devfs" = yes; then
5669 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5670 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5671 else
5672 cat > $TMPC << EOF
5673 #include <sys/ioctl.h>
5674 #include <$_soundcard_header>
5675 #ifdef OPEN_SOUND_SYSTEM
5676 int main(void) { return 0; }
5677 #else
5678 #error Not the real thing
5679 #endif
5681 _real_ossaudio=no
5682 cc_check && _real_ossaudio=yes
5683 if test "$_real_ossaudio" = yes; then
5684 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5685 elif netbsd || openbsd ; then
5686 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5687 extra_ldflags="$extra_ldflags -lossaudio"
5688 else
5689 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5691 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5693 else
5694 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5695 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5696 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5697 _noaomodules="oss $_noaomodules"
5699 echores "$_ossaudio"
5702 echocheck "aRts"
5703 if test "$_arts" = auto ; then
5704 _arts=no
5705 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5707 cat > $TMPC << EOF
5708 #include <artsc.h>
5709 int main(void) { return 0; }
5711 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5716 if test "$_arts" = yes ; then
5717 def_arts='#define CONFIG_ARTS 1'
5718 _aomodules="arts $_aomodules"
5719 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5720 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5721 else
5722 _noaomodules="arts $_noaomodules"
5724 echores "$_arts"
5727 echocheck "EsounD"
5728 if test "$_esd" = auto ; then
5729 _esd=no
5730 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5732 cat > $TMPC << EOF
5733 #include <esd.h>
5734 int main(void) { int fd = esd_open_sound("test"); return fd; }
5736 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5740 echores "$_esd"
5742 if test "$_esd" = yes ; then
5743 def_esd='#define CONFIG_ESD 1'
5744 _aomodules="esd $_aomodules"
5745 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5746 extra_cflags="$extra_cflags $(esd-config --cflags)"
5748 echocheck "esd_get_latency()"
5749 cat > $TMPC << EOF
5750 #include <esd.h>
5751 int main(void) { return esd_get_latency(0); }
5753 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5754 echores "$_esd_latency"
5755 else
5756 def_esd='#undef CONFIG_ESD'
5757 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5758 _noaomodules="esd $_noaomodules"
5762 echocheck "NAS"
5763 if test "$_nas" = auto ; then
5764 cat > $TMPC << EOF
5765 #include <audio/audiolib.h>
5766 int main(void) { return 0; }
5768 _nas=no
5769 cc_check $_ld_lm -laudio -lXt && _nas=yes
5771 if test "$_nas" = yes ; then
5772 def_nas='#define CONFIG_NAS 1'
5773 libs_mplayer="$libs_mplayer -laudio -lXt"
5774 _aomodules="nas $_aomodules"
5775 else
5776 _noaomodules="nas $_noaomodules"
5777 def_nas='#undef CONFIG_NAS'
5779 echores "$_nas"
5782 echocheck "pulse"
5783 if test "$_pulse" = auto ; then
5784 _pulse=no
5785 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5787 cat > $TMPC << EOF
5788 #include <pulse/pulseaudio.h>
5789 int main(void) { return 0; }
5791 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5795 echores "$_pulse"
5797 if test "$_pulse" = yes ; then
5798 def_pulse='#define CONFIG_PULSE 1'
5799 _aomodules="pulse $_aomodules"
5800 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5801 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5802 else
5803 def_pulse='#undef CONFIG_PULSE'
5804 _noaomodules="pulse $_noaomodules"
5808 echocheck "JACK"
5809 if test "$_jack" = auto ; then
5810 _jack=yes
5812 cat > $TMPC << EOF
5813 #include <jack/jack.h>
5814 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5816 if cc_check -ljack ; then
5817 libs_mplayer="$libs_mplayer -ljack"
5818 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5819 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5820 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5821 else
5822 _jack=no
5826 if test "$_jack" = yes ; then
5827 def_jack='#define CONFIG_JACK 1'
5828 _aomodules="jack $_aomodules"
5829 else
5830 _noaomodules="jack $_noaomodules"
5832 echores "$_jack"
5834 echocheck "OpenAL"
5835 if test "$_openal" = auto ; then
5836 _openal=no
5837 cat > $TMPC << EOF
5838 #ifdef OPENAL_AL_H
5839 #include <OpenAL/al.h>
5840 #else
5841 #include <AL/al.h>
5842 #endif
5843 int main(void) {
5844 alSourceQueueBuffers(0, 0, 0);
5845 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5846 return 0;
5849 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5850 cc_check $I && _openal=yes && break
5851 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5852 done
5853 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5855 if test "$_openal" = yes ; then
5856 def_openal='#define CONFIG_OPENAL 1'
5857 _aomodules="openal $_aomodules"
5858 else
5859 _noaomodules="openal $_noaomodules"
5861 echores "$_openal"
5863 echocheck "ALSA audio"
5864 if test "$_alloca" != yes ; then
5865 _alsa=no
5866 _res_comment="alloca missing"
5868 if test "$_alsa" != no ; then
5869 _alsa=no
5870 cat > $TMPC << EOF
5871 #include <sys/time.h>
5872 #include <sys/asoundlib.h>
5873 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5874 #error "alsa version != 0.5.x"
5875 #endif
5876 int main(void) { return 0; }
5878 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5880 cat > $TMPC << EOF
5881 #include <sys/time.h>
5882 #include <sys/asoundlib.h>
5883 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5884 #error "alsa version != 0.9.x"
5885 #endif
5886 int main(void) { return 0; }
5888 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5889 cat > $TMPC << EOF
5890 #include <sys/time.h>
5891 #include <alsa/asoundlib.h>
5892 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5893 #error "alsa version != 0.9.x"
5894 #endif
5895 int main(void) { return 0; }
5897 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5899 cat > $TMPC << EOF
5900 #include <sys/time.h>
5901 #include <sys/asoundlib.h>
5902 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5903 #error "alsa version != 1.0.x"
5904 #endif
5905 int main(void) { return 0; }
5907 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5908 cat > $TMPC << EOF
5909 #include <sys/time.h>
5910 #include <alsa/asoundlib.h>
5911 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5912 #error "alsa version != 1.0.x"
5913 #endif
5914 int main(void) { return 0; }
5916 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5918 def_alsa='#undef CONFIG_ALSA'
5919 def_alsa5='#undef CONFIG_ALSA5'
5920 def_alsa9='#undef CONFIG_ALSA9'
5921 def_alsa1x='#undef CONFIG_ALSA1X'
5922 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5923 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5924 if test "$_alsaver" ; then
5925 _alsa=yes
5926 if test "$_alsaver" = '0.5.x' ; then
5927 _alsa5=yes
5928 _aomodules="alsa5 $_aomodules"
5929 def_alsa5='#define CONFIG_ALSA5 1'
5930 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5931 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5932 elif test "$_alsaver" = '0.9.x-sys' ; then
5933 _alsa9=yes
5934 _aomodules="alsa $_aomodules"
5935 def_alsa='#define CONFIG_ALSA 1'
5936 def_alsa9='#define CONFIG_ALSA9 1'
5937 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5938 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5939 elif test "$_alsaver" = '0.9.x-alsa' ; then
5940 _alsa9=yes
5941 _aomodules="alsa $_aomodules"
5942 def_alsa='#define CONFIG_ALSA 1'
5943 def_alsa9='#define CONFIG_ALSA9 1'
5944 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5945 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5946 elif test "$_alsaver" = '1.0.x-sys' ; then
5947 _alsa1x=yes
5948 _aomodules="alsa $_aomodules"
5949 def_alsa='#define CONFIG_ALSA 1'
5950 def_alsa1x="#define CONFIG_ALSA1X 1"
5951 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5952 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5953 elif test "$_alsaver" = '1.0.x-alsa' ; then
5954 _alsa1x=yes
5955 _aomodules="alsa $_aomodules"
5956 def_alsa='#define CONFIG_ALSA 1'
5957 def_alsa1x="#define CONFIG_ALSA1X 1"
5958 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5959 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5960 else
5961 _alsa=no
5962 _res_comment="unknown version"
5964 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5965 else
5966 _noaomodules="alsa $_noaomodules"
5968 echores "$_alsa"
5971 echocheck "Sun audio"
5972 if test "$_sunaudio" = auto ; then
5973 cat > $TMPC << EOF
5974 #include <sys/types.h>
5975 #include <sys/audioio.h>
5976 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5978 _sunaudio=no
5979 cc_check && _sunaudio=yes
5981 if test "$_sunaudio" = yes ; then
5982 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5983 _aomodules="sun $_aomodules"
5984 else
5985 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5986 _noaomodules="sun $_noaomodules"
5988 echores "$_sunaudio"
5991 def_mlib='#define CONFIG_MLIB 0'
5992 if sunos; then
5993 echocheck "Sun mediaLib"
5994 if test "$_mlib" = auto ; then
5995 _mlib=no
5996 cat > $TMPC << EOF
5997 #include <mlib.h>
5998 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
6000 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
6002 echores "$_mlib"
6003 fi #if sunos
6006 if darwin; then
6007 echocheck "CoreAudio"
6008 if test "$_coreaudio" = auto ; then
6009 cat > $TMPC <<EOF
6010 #include <CoreAudio/CoreAudio.h>
6011 #include <AudioToolbox/AudioToolbox.h>
6012 #include <AudioUnit/AudioUnit.h>
6013 int main(void) { return 0; }
6015 _coreaudio=no
6016 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
6018 if test "$_coreaudio" = yes ; then
6019 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
6020 def_coreaudio='#define CONFIG_COREAUDIO 1'
6021 _aomodules="coreaudio $_aomodules"
6022 else
6023 def_coreaudio='#undef CONFIG_COREAUDIO'
6024 _noaomodules="coreaudio $_noaomodules"
6026 echores $_coreaudio
6027 fi #if darwin
6030 if irix; then
6031 echocheck "SGI audio"
6032 if test "$_sgiaudio" = auto ; then
6033 # check for SGI audio
6034 cat > $TMPC << EOF
6035 #include <dmedia/audio.h>
6036 int main(void) { return 0; }
6038 _sgiaudio=no
6039 cc_check && _sgiaudio=yes
6041 if test "$_sgiaudio" = "yes" ; then
6042 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
6043 libs_mplayer="$libs_mplayer -laudio"
6044 _aomodules="sgi $_aomodules"
6045 else
6046 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
6047 _noaomodules="sgi $_noaomodules"
6049 echores "$_sgiaudio"
6050 fi #if irix
6053 if os2 ; then
6054 echocheck "KAI (UNIAUD/DART)"
6055 if test "$_kai" = auto; then
6056 cat > $TMPC << EOF
6057 #include <os2.h>
6058 #include <kai.h>
6059 int main(void) { return 0; }
6061 _kai=no;
6062 cc_check -lkai && _kai=yes
6064 if test "$_kai" = yes ; then
6065 def_kai='#define CONFIG_KAI 1'
6066 libs_mplayer="$libs_mplayer -lkai"
6067 _aomodules="kai $_aomodules"
6068 else
6069 def_kai='#undef CONFIG_KAI'
6070 _noaomodules="kai $_noaomodules"
6072 echores "$_kai"
6074 echocheck "DART"
6075 if test "$_dart" = auto; then
6076 cat > $TMPC << EOF
6077 #include <os2.h>
6078 #include <dart.h>
6079 int main( void ) { return 0; }
6081 _dart=no;
6082 cc_check -ldart && _dart=yes
6084 if test "$_dart" = yes ; then
6085 def_dart='#define CONFIG_DART 1'
6086 libs_mplayer="$libs_mplayer -ldart"
6087 _aomodules="dart $_aomodules"
6088 else
6089 def_dart='#undef CONFIG_DART'
6090 _noaomodules="dart $_noaomodules"
6092 echores "$_dart"
6093 fi #if os2
6096 # set default CD/DVD devices
6097 if win32 || os2 ; then
6098 default_cdrom_device="D:"
6099 elif darwin ; then
6100 default_cdrom_device="/dev/disk1"
6101 elif dragonfly ; then
6102 default_cdrom_device="/dev/cd0"
6103 elif freebsd ; then
6104 default_cdrom_device="/dev/acd0"
6105 elif openbsd ; then
6106 default_cdrom_device="/dev/rcd0a"
6107 elif sunos ; then
6108 default_cdrom_device="/vol/dev/aliases/cdrom0"
6109 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
6110 # file system and the volfs service.
6111 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
6112 elif amigaos ; then
6113 default_cdrom_device="a1ide.device:2"
6114 else
6115 default_cdrom_device="/dev/cdrom"
6118 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
6119 default_dvd_device=$default_cdrom_device
6120 elif darwin ; then
6121 default_dvd_device="/dev/rdiskN"
6122 else
6123 default_dvd_device="/dev/dvd"
6127 echocheck "VCD support"
6128 if test "$_vcd" = auto; then
6129 _vcd=no
6130 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
6131 _vcd=yes
6132 elif mingw32; then
6133 cat > $TMPC << EOF
6134 #include <ddk/ntddcdrm.h>
6135 int main(void) { return 0; }
6137 cc_check && _vcd=yes
6140 if test "$_vcd" = yes; then
6141 _inputmodules="vcd $_inputmodules"
6142 def_vcd='#define CONFIG_VCD 1'
6143 else
6144 def_vcd='#undef CONFIG_VCD'
6145 _noinputmodules="vcd $_noinputmodules"
6146 _res_comment="not supported on this OS"
6148 echores "$_vcd"
6152 echocheck "dvdread"
6153 if test "$_dvdread_internal" = auto ; then
6154 _dvdread_internal=no
6155 _dvdread=no
6156 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
6157 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
6158 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
6159 || darwin || win32 || os2; then
6160 _dvdread_internal=yes
6161 _dvdread=yes
6162 extra_cflags="-Ilibdvdread4 $extra_cflags"
6164 elif test "$_dvdread" = auto ; then
6165 _dvdread=no
6166 if test "$_dl" = yes; then
6167 cat > $TMPC << EOF
6168 #include <inttypes.h>
6169 #include <dvdread/dvd_reader.h>
6170 #include <dvdread/ifo_types.h>
6171 #include <dvdread/ifo_read.h>
6172 #include <dvdread/nav_read.h>
6173 int main(void) { return 0; }
6175 _dvdreadcflags=$($_dvdreadconfig --cflags)
6176 _dvdreadlibs=$($_dvdreadconfig --libs)
6177 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
6178 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
6179 _dvdread=yes
6180 extra_cflags="$extra_cflags $_dvdreadcflags"
6181 extra_ldflags="$extra_ldflags $_dvdreadlibs"
6182 _res_comment="external"
6187 if test "$_dvdread_internal" = yes; then
6188 def_dvdread='#define CONFIG_DVDREAD 1'
6189 _inputmodules="dvdread(internal) $_inputmodules"
6190 _largefiles=yes
6191 _res_comment="internal"
6192 elif test "$_dvdread" = yes; then
6193 def_dvdread='#define CONFIG_DVDREAD 1'
6194 _largefiles=yes
6195 extra_ldflags="$extra_ldflags -ldvdread"
6196 _inputmodules="dvdread(external) $_inputmodules"
6197 _res_comment="external"
6198 else
6199 def_dvdread='#undef CONFIG_DVDREAD'
6200 _noinputmodules="dvdread $_noinputmodules"
6202 echores "$_dvdread"
6205 echocheck "internal libdvdcss"
6206 if test "$_libdvdcss_internal" = auto ; then
6207 _libdvdcss_internal=no
6208 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
6209 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
6211 if test "$_libdvdcss_internal" = yes ; then
6212 if linux || netbsd || openbsd || bsdos ; then
6213 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
6214 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
6215 elif freebsd || dragonfly ; then
6216 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
6217 elif darwin ; then
6218 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
6219 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
6220 elif cygwin ; then
6221 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
6222 elif beos ; then
6223 cflags_libdvdcss="-DSYS_BEOS"
6224 elif os2 ; then
6225 cflags_libdvdcss="-DSYS_OS2"
6227 cflags_libdvdcss_dvdread="-Ilibdvdcss"
6228 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
6229 _inputmodules="libdvdcss(internal) $_inputmodules"
6230 _largefiles=yes
6231 else
6232 _noinputmodules="libdvdcss(internal) $_noinputmodules"
6234 echores "$_libdvdcss_internal"
6237 echocheck "cdparanoia"
6238 if test "$_cdparanoia" = auto ; then
6239 cat > $TMPC <<EOF
6240 #include <cdda_interface.h>
6241 #include <cdda_paranoia.h>
6242 // This need a better test. How ?
6243 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
6245 _cdparanoia=no
6246 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
6247 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
6248 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
6249 done
6251 if test "$_cdparanoia" = yes ; then
6252 _cdda='yes'
6253 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
6254 openbsd && extra_ldflags="$extra_ldflags -lutil"
6256 echores "$_cdparanoia"
6259 echocheck "libcdio"
6260 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
6261 cat > $TMPC << EOF
6262 #include <stdio.h>
6263 #include <cdio/version.h>
6264 #include <cdio/cdda.h>
6265 #include <cdio/paranoia.h>
6266 int main(void) {
6267 void *test = cdda_verbose_set;
6268 printf("%s\n", CDIO_VERSION);
6269 return test == (void *)1;
6272 _libcdio=no
6273 for _ld_tmp in "" "-lwinmm" ; do
6274 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6275 cc_check $_ld_tmp $_ld_lm \
6276 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6277 done
6278 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6279 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6280 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6281 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6282 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6285 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6286 _cdda='yes'
6287 def_libcdio='#define CONFIG_LIBCDIO 1'
6288 def_havelibcdio='yes'
6289 else
6290 if test "$_cdparanoia" = yes ; then
6291 _res_comment="using cdparanoia"
6293 def_libcdio='#undef CONFIG_LIBCDIO'
6294 def_havelibcdio='no'
6296 echores "$_libcdio"
6298 if test "$_cdda" = yes ; then
6299 test $_cddb = auto && test $_network = yes && _cddb=yes
6300 def_cdparanoia='#define CONFIG_CDDA 1'
6301 _inputmodules="cdda $_inputmodules"
6302 else
6303 def_cdparanoia='#undef CONFIG_CDDA'
6304 _noinputmodules="cdda $_noinputmodules"
6307 if test "$_cddb" = yes ; then
6308 def_cddb='#define CONFIG_CDDB 1'
6309 _inputmodules="cddb $_inputmodules"
6310 else
6311 _cddb=no
6312 def_cddb='#undef CONFIG_CDDB'
6313 _noinputmodules="cddb $_noinputmodules"
6316 echocheck "bitmap font support"
6317 if test "$_bitmap_font" = yes ; then
6318 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6319 else
6320 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6322 echores "$_bitmap_font"
6325 echocheck "freetype >= 2.0.9"
6327 # freetype depends on iconv
6328 if test "$_iconv" = no ; then
6329 _freetype=no
6330 _res_comment="iconv support needed"
6333 if test "$_freetype" = auto ; then
6334 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6335 cat > $TMPC << EOF
6336 #include <stdio.h>
6337 #include <ft2build.h>
6338 #include FT_FREETYPE_H
6339 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6340 #error "Need FreeType 2.0.9 or newer"
6341 #endif
6342 int main(void) {
6343 FT_Library library;
6344 FT_Int major=-1,minor=-1,patch=-1;
6345 int err=FT_Init_FreeType(&library);
6346 return 0;
6349 _freetype=no
6350 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6351 else
6352 _freetype=no
6355 if test "$_freetype" = yes ; then
6356 def_freetype='#define CONFIG_FREETYPE 1'
6357 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6358 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6359 else
6360 def_freetype='#undef CONFIG_FREETYPE'
6362 echores "$_freetype"
6364 if test "$_freetype" = no ; then
6365 _fontconfig=no
6366 _res_comment="FreeType support needed"
6368 echocheck "fontconfig"
6369 if test "$_fontconfig" = auto ; then
6370 cat > $TMPC << EOF
6371 #include <stdio.h>
6372 #include <stdlib.h>
6373 #include <fontconfig/fontconfig.h>
6374 #if FC_VERSION < 20402
6375 #error At least version 2.4.2 of fontconfig required
6376 #endif
6377 int main(void) {
6378 int err = FcInit();
6379 if (err == FcFalse) {
6380 printf("Couldn't initialize fontconfig lib\n");
6381 exit(err);
6383 return 0;
6386 _fontconfig=no
6387 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6388 _ld_tmp="-lfontconfig $_ld_tmp"
6389 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6390 done
6391 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6392 _inc_tmp=$($_pkg_config --cflags fontconfig)
6393 _ld_tmp=$($_pkg_config --libs fontconfig)
6394 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6395 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6398 if test "$_fontconfig" = yes ; then
6399 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6400 else
6401 def_fontconfig='#undef CONFIG_FONTCONFIG'
6403 echores "$_fontconfig"
6406 echocheck "SSA/ASS support"
6407 # libass depends on FreeType
6408 if test "$_freetype" = no ; then
6409 _ass=no
6410 ass_internal=no
6411 _res_comment="FreeType support needed"
6414 if test "$_ass" = auto ; then
6415 cat > $TMPC << EOF
6416 #include <ft2build.h>
6417 #include FT_FREETYPE_H
6418 #if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
6419 #error "Need FreeType 2.2.1 or newer"
6420 #endif
6421 int main(void) { return 0; }
6423 _ass=no
6424 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _ass=yes
6425 if test "$_ass" = no ; then
6426 ass_internal=no
6427 _res_comment="FreeType >= 2.2.1 needed"
6428 elif test "$ass_internal" = no ; then
6429 _res_comment="external"
6430 extra_ldflags="$extra_ldflags -lass"
6433 if test "$_ass" = yes ; then
6434 def_ass='#define CONFIG_ASS 1'
6435 else
6436 def_ass='#undef CONFIG_ASS'
6438 if test "$ass_internal" = yes ; then
6439 def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
6440 else
6441 def_ass_internal='#undef CONFIG_ASS_INTERNAL'
6443 echores "$_ass"
6446 echocheck "fribidi with charsets"
6447 _inc_tmp=""
6448 _ld_tmp=""
6449 if test "$_fribidi" = auto ; then
6450 cat > $TMPC << EOF
6451 #include <stdio.h>
6452 #include <stdlib.h>
6453 /* workaround for fribidi 0.10.4 and below */
6454 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6455 #include <fribidi/fribidi.h>
6456 int main(void) {
6457 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6458 printf("Fribidi headers are not consistents with the library!\n");
6459 exit(1);
6461 return 0;
6464 _fribidi=no
6465 _inc_tmp=""
6466 _ld_tmp="-lfribidi"
6467 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6468 if $_fribidiconfig --version > /dev/null 2>&1 &&
6469 test "$_fribidi" = no ; then
6470 _inc_tmp="$($_fribidiconfig --cflags)"
6471 _ld_tmp="$($_fribidiconfig --libs)"
6472 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6475 if test "$_fribidi" = yes ; then
6476 def_fribidi='#define CONFIG_FRIBIDI 1'
6477 extra_cflags="$extra_cflags $_inc_tmp"
6478 extra_ldflags="$extra_ldflags $_ld_tmp"
6479 else
6480 def_fribidi='#undef CONFIG_FRIBIDI'
6482 echores "$_fribidi"
6485 echocheck "ENCA"
6486 if test "$_enca" = auto ; then
6487 cat > $TMPC << EOF
6488 #include <sys/types.h>
6489 #include <enca.h>
6490 int main(void) {
6491 const char **langs;
6492 size_t langcnt;
6493 langs = enca_get_languages(&langcnt);
6494 return 0;
6497 _enca=no
6498 cc_check -lenca $_ld_lm && _enca=yes
6500 if test "$_enca" = yes ; then
6501 def_enca='#define CONFIG_ENCA 1'
6502 extra_ldflags="$extra_ldflags -lenca"
6503 else
6504 def_enca='#undef CONFIG_ENCA'
6506 echores "$_enca"
6509 echocheck "zlib"
6510 cat > $TMPC << EOF
6511 #include <zlib.h>
6512 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6514 _zlib=no
6515 cc_check -lz && _zlib=yes
6516 if test "$_zlib" = yes ; then
6517 def_zlib='#define CONFIG_ZLIB 1'
6518 extra_ldflags="$extra_ldflags -lz"
6519 else
6520 def_zlib='#define CONFIG_ZLIB 0'
6521 _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//)
6522 _libavencoders=$(echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e s/PNG_ENCODER// -e s/ZMBV_ENCODER// -e s/ZLIB_ENCODER//)
6524 echores "$_zlib"
6527 echocheck "bzlib"
6528 bzlib=no
6529 def_bzlib='#define CONFIG_BZLIB 0'
6530 cat > $TMPC << EOF
6531 #include <bzlib.h>
6532 int main(void) { BZ2_bzlibVersion(); return 0; }
6534 cc_check -lbz2 && bzlib=yes
6535 if test "$bzlib" = yes ; then
6536 def_bzlib='#define CONFIG_BZLIB 1'
6537 extra_ldflags="$extra_ldflags -lbz2"
6539 echores "$bzlib"
6542 echocheck "RTC"
6543 if test "$_rtc" = auto ; then
6544 cat > $TMPC << EOF
6545 #include <sys/ioctl.h>
6546 #ifdef __linux__
6547 #include <linux/rtc.h>
6548 #else
6549 #include <rtc.h>
6550 #define RTC_PIE_ON RTCIO_PIE_ON
6551 #endif
6552 int main(void) { return RTC_PIE_ON; }
6554 _rtc=no
6555 cc_check && _rtc=yes
6556 ppc && _rtc=no
6558 if test "$_rtc" = yes ; then
6559 def_rtc='#define HAVE_RTC 1'
6560 else
6561 def_rtc='#undef HAVE_RTC'
6563 echores "$_rtc"
6566 echocheck "liblzo2 support"
6567 if test "$_liblzo" = auto ; then
6568 _liblzo=no
6569 cat > $TMPC << EOF
6570 #include <lzo/lzo1x.h>
6571 int main(void) { lzo_init();return 0; }
6573 cc_check -llzo2 && _liblzo=yes
6575 if test "$_liblzo" = yes ; then
6576 def_liblzo='#define CONFIG_LIBLZO 1'
6577 extra_ldflags="$extra_ldflags -llzo2"
6578 _codecmodules="liblzo $_codecmodules"
6579 else
6580 def_liblzo='#undef CONFIG_LIBLZO'
6581 _nocodecmodules="liblzo $_nocodecmodules"
6583 echores "$_liblzo"
6586 echocheck "mad support"
6587 if test "$_mad" = auto ; then
6588 _mad=no
6589 cat > $TMPC << EOF
6590 #include <mad.h>
6591 int main(void) { return 0; }
6593 cc_check -lmad && _mad=yes
6595 if test "$_mad" = yes ; then
6596 def_mad='#define CONFIG_LIBMAD 1'
6597 extra_ldflags="$extra_ldflags -lmad"
6598 _codecmodules="libmad $_codecmodules"
6599 else
6600 def_mad='#undef CONFIG_LIBMAD'
6601 _nocodecmodules="libmad $_nocodecmodules"
6603 echores "$_mad"
6605 echocheck "Twolame"
6606 if test "$_twolame" = auto ; then
6607 cat > $TMPC <<EOF
6608 #include <twolame.h>
6609 int main(void) { twolame_init(); return 0; }
6611 _twolame=no
6612 cc_check -ltwolame $_ld_lm && _twolame=yes
6614 if test "$_twolame" = yes ; then
6615 def_twolame='#define CONFIG_TWOLAME 1'
6616 libs_mencoder="$libs_mencoder -ltwolame"
6617 _codecmodules="twolame $_codecmodules"
6618 else
6619 def_twolame='#undef CONFIG_TWOLAME'
6620 _nocodecmodules="twolame $_nocodecmodules"
6622 echores "$_twolame"
6624 echocheck "Toolame"
6625 if test "$_toolame" = auto ; then
6626 _toolame=no
6627 if test "$_twolame" = yes ; then
6628 _res_comment="disabled by twolame"
6629 else
6630 cat > $TMPC <<EOF
6631 #include <toolame.h>
6632 int main(void) { toolame_init(); return 0; }
6634 cc_check -ltoolame $_ld_lm && _toolame=yes
6637 if test "$_toolame" = yes ; then
6638 def_toolame='#define CONFIG_TOOLAME 1'
6639 libs_mencoder="$libs_mencoder -ltoolame"
6640 _codecmodules="toolame $_codecmodules"
6641 else
6642 def_toolame='#undef CONFIG_TOOLAME'
6643 _nocodecmodules="toolame $_nocodecmodules"
6645 if test "$_toolamedir" ; then
6646 _res_comment="using $_toolamedir"
6648 echores "$_toolame"
6650 echocheck "OggVorbis support"
6651 if test "$_tremor_internal" = yes; then
6652 _libvorbis=no
6653 elif test "$_tremor" = auto; then
6654 _tremor=no
6655 cat > $TMPC << EOF
6656 #include <tremor/ivorbiscodec.h>
6657 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6659 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6661 if test "$_libvorbis" = auto; then
6662 _libvorbis=no
6663 cat > $TMPC << EOF
6664 #include <vorbis/codec.h>
6665 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6667 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6669 if test "$_tremor_internal" = yes ; then
6670 _vorbis=yes
6671 def_vorbis='#define CONFIG_OGGVORBIS 1'
6672 def_tremor='#define CONFIG_TREMOR 1'
6673 _codecmodules="tremor(internal) $_codecmodules"
6674 _res_comment="internal Tremor"
6675 if test "$_tremor_low" = yes ; then
6676 cflags_tremor_low="-D_LOW_ACCURACY_"
6677 _res_comment="internal low accuracy Tremor"
6679 elif test "$_tremor" = yes ; then
6680 _vorbis=yes
6681 def_vorbis='#define CONFIG_OGGVORBIS 1'
6682 def_tremor='#define CONFIG_TREMOR 1'
6683 _codecmodules="tremor(external) $_codecmodules"
6684 _res_comment="external Tremor"
6685 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6686 elif test "$_libvorbis" = yes ; then
6687 _vorbis=yes
6688 def_vorbis='#define CONFIG_OGGVORBIS 1'
6689 _codecmodules="libvorbis $_codecmodules"
6690 _res_comment="libvorbis"
6691 extra_ldflags="$extra_ldflags -lvorbis -logg"
6692 else
6693 _vorbis=no
6694 _nocodecmodules="libvorbis $_nocodecmodules"
6696 echores "$_vorbis"
6698 echocheck "libspeex (version >= 1.1 required)"
6699 if test "$_speex" = auto ; then
6700 _speex=no
6701 cat > $TMPC << EOF
6702 #include <speex/speex.h>
6703 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6705 cc_check -lspeex $_ld_lm && _speex=yes
6707 if test "$_speex" = yes ; then
6708 def_speex='#define CONFIG_SPEEX 1'
6709 extra_ldflags="$extra_ldflags -lspeex"
6710 _codecmodules="speex $_codecmodules"
6711 else
6712 def_speex='#undef CONFIG_SPEEX'
6713 _nocodecmodules="speex $_nocodecmodules"
6715 echores "$_speex"
6717 echocheck "OggTheora support"
6718 if test "$_theora" = auto ; then
6719 _theora=no
6720 cat > $TMPC << EOF
6721 #include <theora/theora.h>
6722 #include <string.h>
6723 int main(void) {
6724 /* Theora is in flux, make sure that all interface routines and datatypes
6725 * exist and work the way we expect it, so we don't break MPlayer. */
6726 ogg_packet op;
6727 theora_comment tc;
6728 theora_info inf;
6729 theora_state st;
6730 yuv_buffer yuv;
6731 int r;
6732 double t;
6734 theora_info_init(&inf);
6735 theora_comment_init(&tc);
6737 return 0;
6739 /* we don't want to execute this kind of nonsense; just for making sure
6740 * that compilation works... */
6741 memset(&op, 0, sizeof(op));
6742 r = theora_decode_header(&inf, &tc, &op);
6743 r = theora_decode_init(&st, &inf);
6744 t = theora_granule_time(&st, op.granulepos);
6745 r = theora_decode_packetin(&st, &op);
6746 r = theora_decode_YUVout(&st, &yuv);
6747 theora_clear(&st);
6749 return 0;
6752 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6753 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6754 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6755 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6756 if test _theora = no; then
6757 _ld_theora="-ltheora -logg"
6758 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6760 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6761 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6762 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6763 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6764 extra_ldflags="$extra_ldflags $_ld_theora" &&
6765 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6766 if test _theora = no; then
6767 _ld_theora="-ltheora -logg"
6768 cc_check tremor/bitwise.c $_ld_theora &&
6769 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6773 if test "$_theora" = yes ; then
6774 def_theora='#define CONFIG_OGGTHEORA 1'
6775 _codecmodules="libtheora $_codecmodules"
6776 # when --enable-theora is forced, we'd better provide a probably sane
6777 # $_ld_theora than nothing
6778 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6779 else
6780 def_theora='#undef CONFIG_OGGTHEORA'
6781 _nocodecmodules="libtheora $_nocodecmodules"
6783 echores "$_theora"
6785 echocheck "internal mp3lib support"
6786 if test "$_mp3lib" = auto ; then
6787 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6789 if test "$_mp3lib" = yes ; then
6790 def_mp3lib='#define CONFIG_MP3LIB 1'
6791 _codecmodules="mp3lib(internal) $_codecmodules"
6792 else
6793 def_mp3lib='#undef CONFIG_MP3LIB'
6794 _nocodecmodules="mp3lib(internal) $_nocodecmodules"
6796 echores "$_mp3lib"
6798 echocheck "liba52 support"
6799 if test "$_liba52_internal" = auto ; then
6800 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
6802 def_liba52='#undef CONFIG_LIBA52'
6803 def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6804 if test "$_liba52_internal" = yes ; then
6805 _liba52=yes
6806 def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6807 _res_comment="internal"
6808 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6809 _liba52=no
6810 cat > $TMPC << EOF
6811 #include <inttypes.h>
6812 #include <a52dec/a52.h>
6813 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6815 cc_check -la52 && _liba52=yes && _res_comment="external" && extra_ldflags="$extra_ldflags -la52"
6817 if test "$_liba52" = yes ; then
6818 def_liba52='#define CONFIG_LIBA52 1'
6819 _codecmodules="liba52($_res_comment) $_codecmodules"
6820 else
6821 _nocodecmodules="liba52 $_nocodecmodules"
6823 echores "$_liba52"
6825 echocheck "internal libmpeg2 support"
6826 if test "$_libmpeg2" = auto ; then
6827 _libmpeg2=yes
6828 if alpha && test cc_vendor=gnu; then
6829 case $cc_version in
6830 2*|3.0*|3.1*) # cannot compile MVI instructions
6831 _libmpeg2=no
6832 _res_comment="broken gcc"
6834 esac
6837 if test "$_libmpeg2" = yes ; then
6838 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6839 _codecmodules="libmpeg2(internal) $_codecmodules"
6840 else
6841 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6842 _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
6844 echores "$_libmpeg2"
6846 echocheck "libdca support"
6847 if test "$_libdca" = auto ; then
6848 _libdca=no
6849 cat > $TMPC << EOF
6850 #include <inttypes.h>
6851 #include <dts.h>
6852 int main(void) { dts_init(0); return 0; }
6854 for _ld_dca in -ldca -ldts ; do
6855 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6856 && _libdca=yes && break
6857 done
6859 if test "$_libdca" = yes ; then
6860 def_libdca='#define CONFIG_LIBDCA 1'
6861 _codecmodules="libdca $_codecmodules"
6862 else
6863 def_libdca='#undef CONFIG_LIBDCA'
6864 _nocodecmodules="libdca $_nocodecmodules"
6866 echores "$_libdca"
6868 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6869 if test "$_musepack" = auto ; then
6870 _musepack=no
6871 cat > $TMPC << EOF
6872 #include <stddef.h>
6873 #include <mpcdec/mpcdec.h>
6874 int main(void) {
6875 mpc_streaminfo info;
6876 mpc_decoder decoder;
6877 mpc_decoder_set_streaminfo(&decoder, &info);
6878 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6879 return 0;
6882 cc_check -lmpcdec $_ld_lm && _musepack=yes
6884 if test "$_musepack" = yes ; then
6885 def_musepack='#define CONFIG_MUSEPACK 1'
6886 extra_ldflags="$extra_ldflags -lmpcdec"
6887 _codecmodules="musepack $_codecmodules"
6888 else
6889 def_musepack='#undef CONFIG_MUSEPACK'
6890 _nocodecmodules="musepack $_nocodecmodules"
6892 echores "$_musepack"
6895 echocheck "FAAC support"
6896 if test "$_faac" = auto ; then
6897 cat > $TMPC <<EOF
6898 #include <inttypes.h>
6899 #include <faac.h>
6900 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6902 _faac=no
6903 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6904 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6905 done
6907 if test "$_faac" = yes ; then
6908 def_faac="#define CONFIG_FAAC 1"
6909 test "$_faac_lavc" = auto && _faac_lavc=yes
6910 if test "$_faac_lavc" = yes ; then
6911 def_faac_lavc="#define CONFIG_LIBFAAC 1"
6912 libs_mplayer="$libs_mplayer $_ld_faac"
6913 _libavencoders="$_libavencoders LIBFAAC_ENCODER"
6915 _codecmodules="faac $_codecmodules"
6916 else
6917 _faac_lavc=no
6918 def_faac="#undef CONFIG_FAAC"
6919 def_faac_lavc="#define CONFIG_LIBFAAC 0"
6920 _nocodecmodules="faac $_nocodecmodules"
6922 _res_comment="in libavcodec: $_faac_lavc"
6923 echores "$_faac"
6926 echocheck "FAAD2 support"
6927 if test "$_faad_internal" = auto ; then
6928 if x86_32 && test cc_vendor=gnu; then
6929 case $cc_version in
6930 3.1*|3.2) # ICE/insn with these versions
6931 _faad_internal=no
6932 _res_comment="broken gcc"
6935 _faad=yes
6936 _faad_internal=yes
6938 esac
6939 else
6940 _faad=yes
6941 _faad_internal=yes
6944 if test "$_faad" = auto ; then
6945 cat > $TMPC << EOF
6946 #include <faad.h>
6947 #ifndef FAAD_MIN_STREAMSIZE
6948 #error Too old version
6949 #endif
6950 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6951 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6953 cc_check -lfaad $_ld_lm && _faad=yes
6956 def_faad='#undef CONFIG_FAAD'
6957 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6958 if test "$_faad_internal" = yes ; then
6959 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6960 _res_comment="internal floating-point"
6961 if test "$_faad_fixed" = yes ; then
6962 # The FIXED_POINT implementation of FAAD2 improves performance
6963 # on some platforms, especially for SBR files.
6964 cflags_faad_fixed="-DFIXED_POINT"
6965 _res_comment="internal fixed-point"
6967 elif test "$_faad" = yes ; then
6968 extra_ldflags="$extra_ldflags -lfaad"
6971 if test "$_faad" = yes ; then
6972 def_faad='#define CONFIG_FAAD 1'
6973 if test "$_faad_internal" = yes ; then
6974 _codecmodules="faad2(internal) $_codecmodules"
6975 else
6976 _codecmodules="faad2 $_codecmodules"
6978 else
6979 _faad=no
6980 _nocodecmodules="faad2 $_nocodecmodules"
6982 echores "$_faad"
6985 echocheck "LADSPA plugin support"
6986 if test "$_ladspa" = auto ; then
6987 cat > $TMPC <<EOF
6988 #include <stdio.h>
6989 #include <ladspa.h>
6990 int main(void) {
6991 const LADSPA_Descriptor *ld = NULL;
6992 return 0;
6995 _ladspa=no
6996 cc_check && _ladspa=yes
6998 if test "$_ladspa" = yes; then
6999 def_ladspa="#define CONFIG_LADSPA 1"
7000 else
7001 def_ladspa="#undef CONFIG_LADSPA"
7003 echores "$_ladspa"
7006 echocheck "libbs2b audio filter support"
7007 if test "$_libbs2b" = auto ; then
7008 cat > $TMPC <<EOF
7009 #include <bs2b.h>
7010 #if BS2B_VERSION_MAJOR < 3
7011 #error Please use libbs2b >= 3.0.0, older versions are not supported.
7012 #endif
7013 int main(void) {
7014 t_bs2bdp filter;
7015 filter=bs2b_open();
7016 bs2b_close(filter);
7017 return 0;
7020 _libbs2b=no
7021 if $_pkg_config --exists libbs2b ; then
7022 _inc_tmp=$($_pkg_config --cflags libbs2b)
7023 _ld_tmp=$($_pkg_config --libs libbs2b)
7024 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
7025 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
7026 else
7027 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
7028 -I/usr/local/include/bs2b ; do
7029 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
7030 extra_ldflags="$extra_ldflags -lbs2b"
7031 extra_cflags="$extra_cflags $_inc_tmp"
7032 _libbs2b=yes
7033 break
7035 done
7038 def_libbs2b="#undef CONFIG_LIBBS2B"
7039 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
7040 echores "$_libbs2b"
7043 if test -z "$_codecsdir" ; then
7044 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
7045 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
7046 if test -d "$dir" ; then
7047 _codecsdir="$dir"
7048 break;
7050 done
7052 # Fall back on default directory.
7053 if test -z "$_codecsdir" ; then
7054 _codecsdir="$_libdir/codecs"
7055 mingw32 || os2 && _codecsdir="codecs"
7059 echocheck "Win32 codecs"
7060 if test "$_win32dll" = auto ; then
7061 _win32dll=no
7062 if x86_32 && ! qnx; then
7063 _win32dll=yes
7066 if test "$_win32dll" = yes ; then
7067 def_win32dll='#define CONFIG_WIN32DLL 1'
7068 if ! win32 ; then
7069 def_win32_loader='#define WIN32_LOADER 1'
7070 _win32_emulation=yes
7071 else
7072 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
7073 _res_comment="using native windows"
7075 _codecmodules="win32 $_codecmodules"
7076 else
7077 def_win32dll='#undef CONFIG_WIN32DLL'
7078 def_win32_loader='#undef WIN32_LOADER'
7079 _nocodecmodules="win32 $_nocodecmodules"
7081 echores "$_win32dll"
7084 echocheck "XAnim codecs"
7085 if test "$_xanim" = auto ; then
7086 _xanim=no
7087 _res_comment="dynamic loader support needed"
7088 if test "$_dl" = yes ; then
7089 _xanim=yes
7092 if test "$_xanim" = yes ; then
7093 def_xanim='#define CONFIG_XANIM 1'
7094 _codecmodules="xanim $_codecmodules"
7095 else
7096 def_xanim='#undef CONFIG_XANIM'
7097 _nocodecmodules="xanim $_nocodecmodules"
7099 echores "$_xanim"
7102 echocheck "RealPlayer codecs"
7103 if test "$_real" = auto ; then
7104 _real=no
7105 _res_comment="dynamic loader support needed"
7106 if test "$_dl" = yes || test "$_win32dll" = yes &&
7107 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
7108 _real=yes
7111 if test "$_real" = yes ; then
7112 def_real='#define CONFIG_REALCODECS 1'
7113 _codecmodules="real $_codecmodules"
7114 else
7115 def_real='#undef CONFIG_REALCODECS'
7116 _nocodecmodules="real $_nocodecmodules"
7118 echores "$_real"
7121 echocheck "QuickTime codecs"
7122 _qtx_emulation=no
7123 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
7124 if test "$_qtx" = auto ; then
7125 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
7127 if test "$_qtx" = yes ; then
7128 def_qtx='#define CONFIG_QTX_CODECS 1'
7129 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
7130 _codecmodules="qtx $_codecmodules"
7131 darwin || win32 || _qtx_emulation=yes
7132 else
7133 def_qtx='#undef CONFIG_QTX_CODECS'
7134 _nocodecmodules="qtx $_nocodecmodules"
7136 echores "$_qtx"
7138 echocheck "Nemesi Streaming Media libraries"
7139 if test "$_nemesi" = auto && test "$_network" = yes ; then
7140 _nemesi=no
7141 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
7142 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
7143 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
7144 _nemesi=yes
7147 if test "$_nemesi" = yes; then
7148 _native_rtsp=no
7149 def_nemesi='#define CONFIG_LIBNEMESI 1'
7150 _inputmodules="nemesi $_inputmodules"
7151 else
7152 _native_rtsp="$_network"
7153 _nemesi=no
7154 def_nemesi='#undef CONFIG_LIBNEMESI'
7155 _noinputmodules="nemesi $_noinputmodules"
7157 echores "$_nemesi"
7159 echocheck "LIVE555 Streaming Media libraries"
7160 if test "$_live" = auto && test "$_network" = yes ; then
7161 cat > $TMPCPP << EOF
7162 #include <liveMedia.hh>
7163 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
7164 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
7165 #endif
7166 int main(void) { return 0; }
7169 _live=no
7170 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
7171 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
7172 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
7173 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
7174 $_livelibdir/groupsock/libgroupsock.a \
7175 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
7176 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
7177 $extra_ldflags -lstdc++" \
7178 extra_cxxflags="-I$_livelibdir/liveMedia/include \
7179 -I$_livelibdir/UsageEnvironment/include \
7180 -I$_livelibdir/BasicUsageEnvironment/include \
7181 -I$_livelibdir/groupsock/include" && \
7182 _live=yes && break
7183 done
7184 if test "$_live" != yes ; then
7185 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
7186 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
7187 _live_dist=yes
7191 if test "$_live" = yes && test "$_network" = yes; then
7192 test $_livelibdir && _res_comment="using $_livelibdir"
7193 def_live='#define CONFIG_LIVE555 1'
7194 _inputmodules="live555 $_inputmodules"
7195 elif test "$_live_dist" = yes && test "$_network" = yes; then
7196 _res_comment="using distribution version"
7197 _live="yes"
7198 def_live='#define CONFIG_LIVE555 1'
7199 extra_ldflags="$extra_ldflags $ld_tmp"
7200 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
7201 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
7202 _inputmodules="live555 $_inputmodules"
7203 else
7204 _live=no
7205 def_live='#undef CONFIG_LIVE555'
7206 _noinputmodules="live555 $_noinputmodules"
7208 echores "$_live"
7211 echocheck "FFmpeg libavutil"
7212 if test "$_libavutil_a" = auto ; then
7213 if test -d libavutil ; then
7214 _libavutil_a=yes
7215 _res_comment="static"
7216 else
7217 die "MPlayer will not compile without libavutil in the source tree."
7219 elif test "$_libavutil_so" = auto ; then
7220 _libavutil_so=no
7221 cat > $TMPC << EOF
7222 #include <libavutil/common.h>
7223 int main(void) { av_clip(1, 1, 1); return 0; }
7225 if $_pkg_config --exists libavutil ; then
7226 _inc_libavutil=$($_pkg_config --cflags libavutil)
7227 _ld_tmp=$($_pkg_config --libs libavutil)
7228 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7229 && _libavutil_so=yes
7230 elif cc_check -lavutil $_ld_lm ; then
7231 extra_ldflags="$extra_ldflags -lavutil"
7232 _libavutil_so=yes
7233 _res_comment="using libavutil.so, but static libavutil is recommended"
7236 _libavutil=no
7237 def_libavutil='#undef CONFIG_LIBAVUTIL'
7238 def_libavutil_a='#undef CONFIG_LIBAVUTIL_A'
7239 def_libavutil_so='#undef CONFIG_LIBAVUTIL_SO'
7240 test "$_libavutil_a" = yes || test "$_libavutil_so" = yes && _libavutil=yes
7241 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
7242 test "$_libavutil_a" = yes && def_libavutil_a='#define CONFIG_LIBAVUTIL_A 1'
7243 test "$_libavutil_so" = yes && def_libavutil_so='#define CONFIG_LIBAVUTIL_SO 1'
7244 # neither static nor shared libavutil is available, but it is mandatory ...
7245 if test "$_libavutil" = no ; then
7246 die "You need static or shared libavutil, MPlayer will not compile without!"
7248 echores "$_libavutil"
7250 echocheck "FFmpeg libavcodec"
7251 if test "$_libavcodec_a" = auto ; then
7252 _libavcodec_a=no
7253 if test -d libavcodec && test -f libavcodec/utils.c ; then
7254 _libavcodec_a="yes"
7255 _res_comment="static"
7257 elif test "$_libavcodec_so" = auto ; then
7258 _libavcodec_so=no
7259 _res_comment="libavcodec.so is discouraged over static libavcodec"
7260 cat > $TMPC << EOF
7261 #include <libavcodec/avcodec.h>
7262 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
7264 if $_pkg_config --exists libavcodec ; then
7265 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
7266 _ld_tmp=$($_pkg_config --libs libavcodec)
7267 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7268 && _libavcodec_so=yes
7269 elif cc_check -lavcodec $_ld_lm ; then
7270 extra_ldflags="$extra_ldflags -lavcodec"
7271 _libavcodec_so=yes
7272 _res_comment="using libavcodec.so, but static libavcodec is recommended"
7275 _libavcodec=no
7276 def_libavcodec='#undef CONFIG_LIBAVCODEC'
7277 def_libavcodec_a='#undef CONFIG_LIBAVCODEC_A'
7278 def_libavcodec_so='#undef CONFIG_LIBAVCODEC_SO'
7279 test "$_libavcodec_a" = yes || test "$_libavcodec_so" = yes && _libavcodec=yes
7280 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
7281 test "$_libavcodec_a" = yes && def_libavcodec_a='#define CONFIG_LIBAVCODEC_A 1'
7282 test "$_libavcodec_so" = yes && def_libavcodec_so='#define CONFIG_LIBAVCODEC_SO 1'
7283 test "$_libavcodec_mpegaudio_hp" = yes \
7284 && def_libavcodec_mpegaudio_hp='#define CONFIG_MPEGAUDIO_HP 1' \
7285 && mak_libavcodec_mpegaudio_hp='CONFIG_MPEGAUDIO_HP = yes'
7286 if test "$_libavcodec_a" = yes ; then
7287 _codecmodules="libavcodec(internal) $_codecmodules"
7288 elif test "$_libavcodec_so" = yes ; then
7289 _codecmodules="libavcodec.so $_codecmodules"
7290 else
7291 _nocodecmodules="libavcodec $_nocodecmodules"
7293 echores "$_libavcodec"
7295 echocheck "FFmpeg libavformat"
7296 if test "$_libavformat_a" = auto ; then
7297 _libavformat_a=no
7298 if test -d libavformat && test -f libavformat/utils.c ; then
7299 _libavformat_a=yes
7300 _res_comment="static"
7302 elif test "$_libavformat_so" = auto ; then
7303 _libavformat_so=no
7304 cat > $TMPC <<EOF
7305 #include <libavformat/avformat.h>
7306 #include <libavcodec/opt.h>
7307 int main(void) { av_alloc_format_context(); return 0; }
7309 if $_pkg_config --exists libavformat ; then
7310 _inc_libavformat=$($_pkg_config --cflags libavformat)
7311 _ld_tmp=$($_pkg_config --libs libavformat)
7312 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7313 && _libavformat_so=yes
7314 elif cc_check $_ld_lm -lavformat ; then
7315 extra_ldflags="$extra_ldflags -lavformat"
7316 _libavformat_so=yes
7317 _res_comment="using libavformat.so, but static libavformat is recommended"
7320 _libavformat=no
7321 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7322 def_libavformat_a='#undef CONFIG_LIBAVFORMAT_A'
7323 def_libavformat_so='#undef CONFIG_LIBAVFORMAT_SO'
7324 test "$_libavformat_a" = yes || test "$_libavformat_so" = yes && _libavformat=yes
7325 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7326 test "$_libavformat_a" = yes && def_libavformat_a='#define CONFIG_LIBAVFORMAT_A 1'
7327 test "$_libavformat_so" = yes \
7328 && def_libavformat_so='#define CONFIG_LIBAVFORMAT_SO 1'
7329 echores "$_libavformat"
7331 echocheck "FFmpeg libpostproc"
7332 if test "$_libpostproc_a" = auto ; then
7333 _libpostproc_a=no
7334 if test -d libpostproc && test -f libpostproc/postprocess.h ; then
7335 _libpostproc_a='yes'
7336 _res_comment="static"
7338 elif test "$_libpostproc_so" = auto ; then
7339 _libpostproc_so=no
7340 cat > $TMPC << EOF
7341 #include <inttypes.h>
7342 #include <libpostproc/postprocess.h>
7343 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7345 if cc_check -lpostproc $_ld_lm ; then
7346 extra_ldflags="$extra_ldflags -lpostproc"
7347 _libpostproc_so=yes
7348 _res_comment="using libpostproc.so, but static libpostproc is recommended"
7351 _libpostproc=no
7352 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7353 def_libpostproc_a='#undef CONFIG_LIBPOSTPROC_A'
7354 def_libpostproc_so='#undef CONFIG_LIBPOSTPROC_SO'
7355 test "$_libpostproc_a" = yes || test "$_libpostproc_so" = yes && _libpostproc=yes
7356 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7357 test "$_libpostproc_a" = yes && def_libpostproc_a='#define CONFIG_LIBPOSTPROC_A 1'
7358 test "$_libpostproc_so" = yes \
7359 && def_libpostproc_so='#define CONFIG_LIBPOSTPROC_SO 1'
7360 echores "$_libpostproc"
7362 echocheck "FFmpeg libswscale"
7363 if test "$_libswscale_a" = auto ; then
7364 _libswscale_a=no
7365 if test -d libswscale && test -f libswscale/swscale.h ; then
7366 _libswscale_a='yes'
7367 _res_comment="static"
7369 elif test "$_libswscale_so" = auto ; then
7370 _libswscale_so=no
7371 _res_comment="using libswscale.so, but static libswscale is recommended"
7372 cat > $TMPC << EOF
7373 #include <libswscale/swscale.h>
7374 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7376 if $_pkg_config --exists libswscale ; then
7377 _inc_libswscale=$($_pkg_config --cflags libswscale)
7378 _ld_tmp=$($_pkg_config --libs libswscale)
7379 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
7380 && _libswscale_so=yes
7381 elif cc_check -lswscale ; then
7382 extra_ldflags="$extra_ldflags -lswscale"
7383 _libswscale_so=yes
7386 _libswscale=no
7387 def_libswscale='#undef CONFIG_LIBSWSCALE'
7388 def_libswscale_a='#undef CONFIG_LIBSWSCALE_A'
7389 def_libswscale_so='#undef CONFIG_LIBSWSCALE_SO'
7390 test "$_libswscale_a" = yes || test "$_libswscale_so" = yes && _libswscale=yes
7391 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7392 test "$_libswscale_a" = yes && def_libswscale_a='#define CONFIG_LIBSWSCALE_A 1'
7393 test "$_libswscale_so" = yes \
7394 && def_libswscale_so='#define CONFIG_LIBSWSCALE_SO 1'
7395 echores "$_libswscale"
7397 echocheck "libopencore_amr narrowband"
7398 if test "$_libopencore_amrnb" = auto ; then
7399 _libopencore_amrnb=no
7400 cat > $TMPC << EOF
7401 #include <opencore-amrnb/interf_dec.h>
7402 int main(void) { Decoder_Interface_init(); return 0; }
7404 cc_check -lopencore-amrnb && _libopencore_amrnb=yes
7405 if test "$_libavcodec_a" != yes ; then
7406 _libopencore_amrnb=no
7407 _res_comment="libavcodec (static) is required by libopencore_amrnb, sorry"
7410 if test "$_libopencore_amrnb" = yes ; then
7411 _libopencore_amr=yes
7412 extra_ldflags="$extra_ldflags -lopencore-amrnb"
7413 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 1'
7414 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRNB_DECODER"
7415 _libavencoders="$_libavencoders LIBOPENCORE_AMRNB_ENCODER"
7416 _codecmodules="libopencore_amrnb $_codecmodules"
7417 else
7418 def_libopencore_amrnb='#define CONFIG_LIBOPENCORE_AMRNB 0'
7419 _nocodecmodules="libopencore_amrnb $_nocodecmodules"
7421 echores "$_libopencore_amrnb"
7424 echocheck "libopencore_amr wideband"
7425 if test "$_libopencore_amrwb" = auto ; then
7426 _libopencore_amrwb=no
7427 cat > $TMPC << EOF
7428 #include <opencore-amrwb/dec_if.h>
7429 int main(void) { D_IF_init(); return 0; }
7431 cc_check -lopencore-amrwb && _libopencore_amrwb=yes
7432 if test "$_libavcodec_a" != yes ; then
7433 _libopencore_amrwb=no
7434 _res_comment="libavcodec (static) is required by libopencore_amrwb, sorry"
7437 if test "$_libopencore_amrwb" = yes ; then
7438 _libopencore_amr=yes
7439 extra_ldflags="$extra_ldflags -lopencore-amrwb"
7440 def_libopencore_amrwb='#define CONFIG_LIBOPENCORE_AMRWB 1'
7441 _libavdecoders="$_libavdecoders LIBOPENCORE_AMRWB_DECODER"
7442 _libavencoders="$_libavencoders LIBOPENCORE_AMRWB_DECODER"
7443 _codecmodules="libopencore_amrwb $_codecmodules"
7444 else
7445 def_libopencore_amrwb='#define LIBOPENCORE_AMRWB 0'
7446 _nocodecmodules="libopencore_amrwb $_nocodecmodules"
7448 echores "$_libopencore_amrwb"
7450 echocheck "libdv-0.9.5+"
7451 if test "$_libdv" = auto ; then
7452 _libdv=no
7453 cat > $TMPC <<EOF
7454 #include <libdv/dv.h>
7455 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7457 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7459 if test "$_libdv" = yes ; then
7460 def_libdv='#define CONFIG_LIBDV095 1'
7461 extra_ldflags="$extra_ldflags -ldv"
7462 _codecmodules="libdv $_codecmodules"
7463 else
7464 def_libdv='#undef CONFIG_LIBDV095'
7465 _nocodecmodules="libdv $_nocodecmodules"
7467 echores "$_libdv"
7470 echocheck "Xvid"
7471 if test "$_xvid" = auto ; then
7472 _xvid=no
7473 cat > $TMPC << EOF
7474 #include <xvid.h>
7475 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7477 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7478 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7479 done
7482 if test "$_xvid" = yes ; then
7483 def_xvid='#define CONFIG_XVID4 1'
7484 _codecmodules="xvid $_codecmodules"
7485 else
7486 def_xvid='#undef CONFIG_XVID4'
7487 _nocodecmodules="xvid $_nocodecmodules"
7489 echores "$_xvid"
7491 echocheck "Xvid two pass plugin"
7492 if test "$_xvid" = yes && test "$_xvid_lavc" = auto ; then
7493 cat > $TMPC << EOF
7494 #include <xvid.h>
7495 int main(void) { xvid_plugin_2pass2_t s; s.vbv_size=0; return 0; }
7497 cc_check && _xvid_lavc=yes
7499 if test "$_xvid_lavc" = yes ; then
7500 def_xvid_lavc='#define CONFIG_LIBXVID 1'
7501 _libavencoders="$_libavencoders LIBXVID_ENCODER"
7502 else
7503 _xvid_lavc=no
7504 def_xvid_lavc='#define CONFIG_LIBXVID 0'
7506 echores "$_xvid_lavc"
7509 echocheck "x264"
7510 if test "$_x264" = auto ; then
7511 cat > $TMPC << EOF
7512 #include <inttypes.h>
7513 #include <x264.h>
7514 #if X264_BUILD < 89
7515 #error We do not support old versions of x264. Get the latest from git.
7516 #endif
7517 int main(void) { x264_encoder_open((void*)0); return 0; }
7519 _x264=no
7520 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7521 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7522 done
7525 if test "$_x264" = yes ; then
7526 def_x264='#define CONFIG_X264 1'
7527 _codecmodules="x264 $_codecmodules"
7528 test "$_x264_lavc" = auto && _x264_lavc=yes
7529 if test "$_x264_lavc" = yes ; then
7530 def_x264_lavc='#define CONFIG_LIBX264 1'
7531 libs_mplayer="$libs_mplayer $_ld_x264"
7532 _libavencoders="$_libavencoders LIBX264_ENCODER"
7534 else
7535 _x264_lavc=no
7536 def_x264='#undef CONFIG_X264'
7537 def_x264_lavc='#define CONFIG_LIBX264 0'
7538 _nocodecmodules="x264 $_nocodecmodules"
7540 _res_comment="in libavcodec: $_x264_lavc"
7541 echores "$_x264"
7544 echocheck "libdirac"
7545 if test "$_libdirac_lavc" = auto; then
7546 _libdirac_lavc=no
7547 if test "$_libavcodec_a" != yes; then
7548 _res_comment="libavcodec (static) is required by libdirac, sorry"
7549 else
7550 cat > $TMPC << EOF
7551 #include <libdirac_encoder/dirac_encoder.h>
7552 #include <libdirac_decoder/dirac_parser.h>
7553 int main(void)
7555 dirac_encoder_context_t enc_ctx;
7556 dirac_decoder_t *dec_handle;
7557 dirac_encoder_context_init(&enc_ctx, VIDEO_FORMAT_SD_576I50);
7558 dec_handle = dirac_decoder_init(0);
7559 if (dec_handle)
7560 dirac_decoder_close(dec_handle);
7561 return 0;
7564 if $_pkg_config --exists dirac ; then
7565 _inc_dirac=$($_pkg_config --silence-errors --cflags dirac)
7566 _ld_dirac=$($_pkg_config --silence-errors --libs dirac)
7567 cc_check $_inc_dirac $_ld_dirac &&
7568 _libdirac_lavc=yes &&
7569 extra_cflags="$extra_cflags $_inc_dirac" &&
7570 extra_ldflags="$extra_ldflags $_ld_dirac"
7574 if test "$_libdirac_lavc" = yes ; then
7575 def_libdirac_lavc='#define CONFIG_LIBDIRAC 1'
7576 _libavencoders="$_libavencoders LIBDIRAC_ENCODER"
7577 _libavdecoders="$_libavdecoders LIBDIRAC_DECODER"
7578 _codecmodules="libdirac $_codecmodules"
7579 else
7580 def_libdirac_lavc='#define CONFIG_LIBDIRAC 0'
7581 _nocodecmodules="libdirac $_nocodecmodules"
7583 echores "$_libdirac_lavc"
7586 echocheck "libschroedinger"
7587 if test "$_libschroedinger_lavc" = auto ; then
7588 _libschroedinger_lavc=no
7589 if test "$_libavcodec_a" != yes; then
7590 _res_comment="libavcodec (static) is required by libschroedinger, sorry"
7591 else
7592 cat > $TMPC << EOF
7593 #include <schroedinger/schro.h>
7594 int main(void) { schro_init(); return SCHRO_ENCODER_RATE_CONTROL_CONSTANT_QUALITY; }
7596 if $_pkg_config --exists schroedinger-1.0 ; then
7597 _inc_schroedinger=$($_pkg_config --silence-errors --cflags schroedinger-1.0)
7598 _ld_schroedinger=$($_pkg_config --silence-errors --libs schroedinger-1.0)
7599 cc_check $_inc_schroedinger $_ld_schroedinger &&
7600 _libschroedinger_lavc=yes &&
7601 extra_cflags="$extra_cflags $_inc_schroedinger" &&
7602 extra_ldflags="$extra_ldflags $_ld_schroedinger"
7606 if test "$_libschroedinger_lavc" = yes ; then
7607 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 1'
7608 _libavencoders="$_libavencoders LIBSCHROEDINGER_ENCODER"
7609 _libavdecoders="$_libavdecoders LIBSCHROEDINGER_DECODER"
7610 _codecmodules="libschroedinger $_codecmodules"
7611 else
7612 def_libschroedinger_lavc='#define CONFIG_LIBSCHROEDINGER 0'
7613 _nocodecmodules="libschroedinger $_nocodecmodules"
7615 echores "$_libschroedinger_lavc"
7617 echocheck "libnut"
7618 if test "$_libnut" = auto ; then
7619 cat > $TMPC << EOF
7620 #include <stdio.h>
7621 #include <stdlib.h>
7622 #include <inttypes.h>
7623 #include <libnut.h>
7624 nut_context_tt * nut;
7625 int main(void) { (void)nut_error(0); return 0; }
7627 _libnut=no
7628 cc_check -lnut && _libnut=yes
7631 if test "$_libnut" = yes ; then
7632 def_libnut='#define CONFIG_LIBNUT 1'
7633 extra_ldflags="$extra_ldflags -lnut"
7634 else
7635 def_libnut='#undef CONFIG_LIBNUT'
7637 echores "$_libnut"
7639 #check must be done after libavcodec one
7640 echocheck "zr"
7641 if test "$_zr" = auto ; then
7642 #36067's seem to identify themselves as 36057PQC's, so the line
7643 #below should work for 36067's and 36057's.
7644 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7645 _zr=yes
7646 else
7647 _zr=no
7650 if test "$_zr" = yes ; then
7651 if test "$_libavcodec_a" = yes ; then
7652 def_zr='#define CONFIG_ZR 1'
7653 _vomodules="zr zr2 $_vomodules"
7654 else
7655 _res_comment="libavcodec (static) is required by zr, sorry"
7656 _novomodules="zr $_novomodules"
7657 def_zr='#undef CONFIG_ZR'
7659 else
7660 def_zr='#undef CONFIG_ZR'
7661 _novomodules="zr zr2 $_novomodules"
7663 echores "$_zr"
7665 # mencoder requires (optional) those libs: libmp3lame
7666 if test "$_mencoder" != no ; then
7668 echocheck "libmp3lame"
7669 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7670 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7671 if test "$_mp3lame" = auto ; then
7672 _mp3lame=no
7673 cat > $TMPC <<EOF
7674 #include <lame/lame.h>
7675 int main(void) { lame_version_t lv; (void) lame_init();
7676 get_lame_version_numerical(&lv);
7677 return 0; }
7679 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7681 if test "$_mp3lame" = yes ; then
7682 def_mp3lame="#define CONFIG_MP3LAME 1"
7683 _ld_mp3lame=-lmp3lame
7684 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7685 cat > $TMPC << EOF
7686 #include <lame/lame.h>
7687 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7689 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7690 cat > $TMPC << EOF
7691 #include <lame/lame.h>
7692 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7694 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7695 test "$_mp3lame_lavc" = auto && _mp3lame_lavc=yes
7696 if test "$_mp3lame_lavc" = yes ; then
7697 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 1"
7698 _libavencoders="$_libavencoders LIBMP3LAME_ENCODER"
7699 libs_mplayer="$libs_mplayer $_ld_mp3lame"
7701 else
7702 _mp3lame_lavc=no
7703 def_mp3lame='#undef CONFIG_MP3LAME'
7704 def_mp3lame_lavc="#define CONFIG_LIBMP3LAME 0"
7706 _res_comment="in libavcodec: $_mp3lame_lavc"
7707 echores "$_mp3lame"
7709 fi # test "$_mencoder" != no
7711 echocheck "mencoder"
7712 if test "$_mencoder" = yes ; then
7713 def_muxers='#define CONFIG_MUXERS 1'
7714 else
7715 # mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint, png for vf_screenshot
7716 _libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
7717 test "$_zlib" = yes && _libavencoders="$_libavencoders PNG_ENCODER"
7718 _libavmuxers=""
7719 def_muxers='#define CONFIG_MUXERS 0'
7721 echores "$_mencoder"
7724 echocheck "UnRAR executable"
7725 if test "$_unrar_exec" = auto ; then
7726 _unrar_exec="yes"
7727 mingw32 && _unrar_exec="no"
7729 if test "$_unrar_exec" = yes ; then
7730 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7731 else
7732 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7734 echores "$_unrar_exec"
7736 echocheck "TV interface"
7737 if test "$_tv" = yes ; then
7738 def_tv='#define CONFIG_TV 1'
7739 _inputmodules="tv $_inputmodules"
7740 else
7741 _noinputmodules="tv $_noinputmodules"
7742 def_tv='#undef CONFIG_TV'
7744 echores "$_tv"
7747 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7748 echocheck "*BSD BT848 bt8xx header"
7749 _ioctl_bt848_h=no
7750 for file in "machine/ioctl_bt848.h" \
7751 "dev/bktr/ioctl_bt848.h" \
7752 "dev/video/bktr/ioctl_bt848.h" \
7753 "dev/ic/bt8xx.h" ; do
7754 cat > $TMPC <<EOF
7755 #include <sys/types.h>
7756 #include <sys/ioctl.h>
7757 #include <$file>
7758 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7760 if cc_check ; then
7761 _ioctl_bt848_h=yes
7762 _ioctl_bt848_h_name="$file"
7763 break;
7765 done
7766 if test "$_ioctl_bt848_h" = yes ; then
7767 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7768 _res_comment="using $_ioctl_bt848_h_name"
7769 else
7770 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7772 echores "$_ioctl_bt848_h"
7774 echocheck "*BSD ioctl_meteor.h"
7775 _ioctl_meteor_h=no
7776 for file in "machine/ioctl_meteor.h" \
7777 "dev/bktr/ioctl_meteor.h" \
7778 "dev/video/bktr/ioctl_meteor.h" ; do
7779 cat > $TMPC <<EOF
7780 #include <sys/types.h>
7781 #include <$file>
7782 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7784 if cc_check ; then
7785 _ioctl_meteor_h=yes
7786 _ioctl_meteor_h_name="$file"
7787 break;
7789 done
7790 if test "$_ioctl_meteor_h" = yes ; then
7791 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7792 _res_comment="using $_ioctl_meteor_h_name"
7793 else
7794 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7796 echores "$_ioctl_meteor_h"
7798 echocheck "*BSD BrookTree 848 TV interface"
7799 if test "$_tv_bsdbt848" = auto ; then
7800 _tv_bsdbt848=no
7801 if test "$_tv" = yes ; then
7802 cat > $TMPC <<EOF
7803 #include <sys/types.h>
7804 $def_ioctl_meteor_h_name
7805 $def_ioctl_bt848_h_name
7806 #ifdef IOCTL_METEOR_H_NAME
7807 #include IOCTL_METEOR_H_NAME
7808 #endif
7809 #ifdef IOCTL_BT848_H_NAME
7810 #include IOCTL_BT848_H_NAME
7811 #endif
7812 int main(void) {
7813 ioctl(0, METEORSINPUT, 0);
7814 ioctl(0, TVTUNER_GETFREQ, 0);
7815 return 0;
7818 cc_check && _tv_bsdbt848=yes
7821 if test "$_tv_bsdbt848" = yes ; then
7822 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7823 _inputmodules="tv-bsdbt848 $_inputmodules"
7824 else
7825 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7826 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7828 echores "$_tv_bsdbt848"
7829 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7832 echocheck "DirectShow TV interface"
7833 if test "$_tv_dshow" = auto ; then
7834 _tv_dshow=no
7835 if test "$_tv" = yes && win32 ; then
7836 cat > $TMPC <<EOF
7837 #include <ole2.h>
7838 int main(void) {
7839 void* p;
7840 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7841 return 0;
7844 cc_check -lole32 -luuid && _tv_dshow=yes
7847 if test "$_tv_dshow" = yes ; then
7848 _inputmodules="tv-dshow $_inputmodules"
7849 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7850 extra_ldflags="$extra_ldflags -lole32 -luuid"
7851 else
7852 _noinputmodules="tv-dshow $_noinputmodules"
7853 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7855 echores "$_tv_dshow"
7858 echocheck "Video 4 Linux TV interface"
7859 if test "$_tv_v4l1" = auto ; then
7860 _tv_v4l1=no
7861 if test "$_tv" = yes && linux ; then
7862 cat > $TMPC <<EOF
7863 #include <stdlib.h>
7864 #include <linux/videodev.h>
7865 int main(void) { return 0; }
7867 cc_check && _tv_v4l1=yes
7870 if test "$_tv_v4l1" = yes ; then
7871 _audio_input=yes
7872 _tv_v4l=yes
7873 def_tv_v4l='#define CONFIG_TV_V4L 1'
7874 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7875 _inputmodules="tv-v4l $_inputmodules"
7876 else
7877 _noinputmodules="tv-v4l1 $_noinputmodules"
7878 def_tv_v4l='#undef CONFIG_TV_V4L'
7880 echores "$_tv_v4l1"
7883 echocheck "Video 4 Linux 2 TV interface"
7884 if test "$_tv_v4l2" = auto ; then
7885 _tv_v4l2=no
7886 if test "$_tv" = yes && linux ; then
7887 cat > $TMPC <<EOF
7888 #include <stdlib.h>
7889 #include <linux/types.h>
7890 #include <linux/videodev2.h>
7891 int main(void) { return 0; }
7893 cc_check && _tv_v4l2=yes
7896 if test "$_tv_v4l2" = yes ; then
7897 _audio_input=yes
7898 _tv_v4l=yes
7899 def_tv_v4l='#define CONFIG_TV_V4L 1'
7900 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7901 _inputmodules="tv-v4l2 $_inputmodules"
7902 else
7903 _noinputmodules="tv-v4l2 $_noinputmodules"
7904 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7906 echores "$_tv_v4l2"
7909 echocheck "Radio interface"
7910 if test "$_radio" = yes ; then
7911 def_radio='#define CONFIG_RADIO 1'
7912 _inputmodules="radio $_inputmodules"
7913 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7914 _radio_capture=no
7916 if test "$_radio_capture" = yes ; then
7917 _audio_input=yes
7918 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7919 else
7920 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7922 else
7923 _noinputmodules="radio $_noinputmodules"
7924 def_radio='#undef CONFIG_RADIO'
7925 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7926 _radio_capture=no
7928 echores "$_radio"
7929 echocheck "Capture for Radio interface"
7930 echores "$_radio_capture"
7932 echocheck "Video 4 Linux 2 Radio interface"
7933 if test "$_radio_v4l2" = auto ; then
7934 _radio_v4l2=no
7935 if test "$_radio" = yes && linux ; then
7936 cat > $TMPC <<EOF
7937 #include <stdlib.h>
7938 #include <linux/types.h>
7939 #include <linux/videodev2.h>
7940 int main(void) { return 0; }
7942 cc_check && _radio_v4l2=yes
7945 if test "$_radio_v4l2" = yes ; then
7946 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7947 else
7948 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7950 echores "$_radio_v4l2"
7952 echocheck "Video 4 Linux Radio interface"
7953 if test "$_radio_v4l" = auto ; then
7954 _radio_v4l=no
7955 if test "$_radio" = yes && linux ; then
7956 cat > $TMPC <<EOF
7957 #include <stdlib.h>
7958 #include <linux/videodev.h>
7959 int main(void) { return 0; }
7961 cc_check && _radio_v4l=yes
7964 if test "$_radio_v4l" = yes ; then
7965 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7966 else
7967 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7969 echores "$_radio_v4l"
7971 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7972 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7973 echocheck "*BSD BrookTree 848 Radio interface"
7974 _radio_bsdbt848=no
7975 cat > $TMPC <<EOF
7976 #include <sys/types.h>
7977 $def_ioctl_bt848_h_name
7978 #ifdef IOCTL_BT848_H_NAME
7979 #include IOCTL_BT848_H_NAME
7980 #endif
7981 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7983 cc_check && _radio_bsdbt848=yes
7984 echores "$_radio_bsdbt848"
7985 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7987 if test "$_radio_bsdbt848" = yes ; then
7988 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7989 else
7990 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7993 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7994 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7995 die "Radio driver requires BSD BT848, V4L or V4L2!"
7998 echocheck "Video 4 Linux 2 MPEG PVR interface"
7999 if test "$_pvr" = auto ; then
8000 _pvr=no
8001 if test "$_tv_v4l2" = yes && linux ; then
8002 cat > $TMPC <<EOF
8003 #include <stdlib.h>
8004 #include <inttypes.h>
8005 #include <linux/types.h>
8006 #include <linux/videodev2.h>
8007 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
8009 cc_check && _pvr=yes
8012 if test "$_pvr" = yes ; then
8013 def_pvr='#define CONFIG_PVR 1'
8014 _inputmodules="pvr $_inputmodules"
8015 else
8016 _noinputmodules="pvr $_noinputmodules"
8017 def_pvr='#undef CONFIG_PVR'
8019 echores "$_pvr"
8022 echocheck "ftp"
8023 if ! beos && test "$_ftp" = yes ; then
8024 def_ftp='#define CONFIG_FTP 1'
8025 _inputmodules="ftp $_inputmodules"
8026 else
8027 _noinputmodules="ftp $_noinputmodules"
8028 def_ftp='#undef CONFIG_FTP'
8030 echores "$_ftp"
8032 echocheck "vstream client"
8033 if test "$_vstream" = auto ; then
8034 _vstream=no
8035 cat > $TMPC <<EOF
8036 #include <vstream-client.h>
8037 void vstream_error(const char *format, ... ) {}
8038 int main(void) { vstream_start(); return 0; }
8040 cc_check -lvstream-client && _vstream=yes
8042 if test "$_vstream" = yes ; then
8043 def_vstream='#define CONFIG_VSTREAM 1'
8044 _inputmodules="vstream $_inputmodules"
8045 extra_ldflags="$extra_ldflags -lvstream-client"
8046 else
8047 _noinputmodules="vstream $_noinputmodules"
8048 def_vstream='#undef CONFIG_VSTREAM'
8050 echores "$_vstream"
8053 echocheck "OSD menu"
8054 if test "$_menu" = yes ; then
8055 def_menu='#define CONFIG_MENU 1'
8056 test $_dvbin = "yes" && _menu_dvbin=yes
8057 else
8058 def_menu='#undef CONFIG_MENU'
8059 _menu_dvbin=no
8061 echores "$_menu"
8064 echocheck "Subtitles sorting"
8065 if test "$_sortsub" = yes ; then
8066 def_sortsub='#define CONFIG_SORTSUB 1'
8067 else
8068 def_sortsub='#undef CONFIG_SORTSUB'
8070 echores "$_sortsub"
8073 echocheck "XMMS inputplugin support"
8074 if test "$_xmms" = yes ; then
8075 if ( xmms-config --version ) >/dev/null 2>&1 ; then
8076 _xmmsplugindir=$(xmms-config --input-plugin-dir)
8077 _xmmslibdir=$(xmms-config --exec-prefix)/lib
8078 else
8079 _xmmsplugindir=/usr/lib/xmms/Input
8080 _xmmslibdir=/usr/lib
8083 def_xmms='#define CONFIG_XMMS 1'
8084 if darwin ; then
8085 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
8086 else
8087 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
8089 else
8090 def_xmms='#undef CONFIG_XMMS'
8092 echores "$_xmms"
8095 # --------------- GUI specific tests begin -------------------
8096 echocheck "GUI"
8097 echo "$_gui"
8098 if test "$_gui" = yes ; then
8100 # Required libraries
8101 if test "$_libavcodec" != yes ||
8102 ! echo $_libavdecoders | grep -q PNG_DECODER ; then
8103 die "The GUI requires libavcodec with PNG support (needs zlib)."
8105 test "$_freetype" = no && test "$_bitmap_font" = no && \
8106 die "The GUI requires either FreeType or bitmap font support."
8107 if ! win32 ; then
8108 _gui_gtk=yes
8109 test "$_x11" != yes && die "X11 support required for GUI compilation."
8111 echocheck "XShape extension"
8112 if test "$_xshape" = auto ; then
8113 _xshape=no
8114 cat > $TMPC << EOF
8115 #include <X11/Xlib.h>
8116 #include <X11/Xproto.h>
8117 #include <X11/Xutil.h>
8118 #include <X11/extensions/shape.h>
8119 #include <stdlib.h>
8120 int main(void) {
8121 char *name = ":0.0";
8122 Display *wsDisplay;
8123 int exitvar = 0;
8124 int eventbase, errorbase;
8125 if (getenv("DISPLAY"))
8126 name=getenv("DISPLAY");
8127 wsDisplay=XOpenDisplay(name);
8128 if (!XShapeQueryExtension(wsDisplay,&eventbase,&errorbase))
8129 exitvar=1;
8130 XCloseDisplay(wsDisplay);
8131 return exitvar;
8134 cc_check -lXext && _xshape=yes
8136 if test "$_xshape" = yes ; then
8137 def_xshape='#define CONFIG_XSHAPE 1'
8138 else
8139 die "The GUI requires the X11 extension XShape (which was not found)."
8141 echores "$_xshape"
8143 #Check for GTK
8144 if test "$_gtk1" = no ; then
8145 #Check for GTK2 :
8146 echocheck "GTK+ version"
8148 if $_pkg_config gtk+-2.0 --exists ; then
8149 _gtk=$($_pkg_config gtk+-2.0 --modversion 2>/dev/null)
8150 extra_cflags="$extra_cflags $($_pkg_config gtk+-2.0 --cflags 2>/dev/null)"
8151 libs_mplayer="$libs_mplayer $($_pkg_config gtk+-2.0 --libs 2>/dev/null)"
8152 echores "$_gtk"
8154 # Check for GLIB2
8155 if $_pkg_config glib-2.0 --exists ; then
8156 echocheck "glib version"
8157 _glib=$($_pkg_config glib-2.0 --modversion 2>/dev/null)
8158 libs_mplayer="$libs_mplayer $($_pkg_config glib-2.0 --libs 2>/dev/null)"
8159 echores "$_glib"
8161 def_gui='#define CONFIG_GUI 1'
8162 def_gtk2='#define CONFIG_GTK2 1'
8163 else
8164 _gtk1=yes
8165 echo "GLIB-2 devel packages were not found, trying GTK 1.2"
8167 else
8168 echo "GTK-2 devel packages were not found, trying GTK 1.2"
8169 _gtk1=yes
8173 if test "$_gtk1" = yes ; then
8174 # Check for old GTK (1.2.x)
8175 echocheck "GTK version"
8176 if test -z "$_gtkconfig" ; then
8177 if ( gtk-config --version ) >/dev/null 2>&1 ; then
8178 _gtkconfig="gtk-config"
8179 elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
8180 _gtkconfig="gtk12-config"
8181 else
8182 die "The GUI requires GTK devel packages (which were not found)."
8185 _gtk=$($_gtkconfig --version 2>&1)
8186 extra_cflags="$extra_cflags $($_gtkconfig --cflags 2>&1)"
8187 libs_mplayer="$libs_mplayer $($_gtkconfig --libs 2>&1)"
8188 echores "$_gtk (using $_gtkconfig)"
8190 # Check for GLIB
8191 echocheck "glib version"
8192 if test -z "$_glibconfig" ; then
8193 if ( glib-config --version ) >/dev/null 2>&1 ; then
8194 _glibconfig="glib-config"
8195 elif ( glib12-config --version ) >/dev/null 2>&1 ; then
8196 _glibconfig="glib12-config"
8197 else
8198 die "The GUI requires GLIB devel packages (which were not found)"
8201 _glib=$($_glibconfig --version 2>&1)
8202 libs_mplayer="$libs_mplayer $($_glibconfig --libs 2>&1)"
8203 echores "$_glib (using $_glibconfig)"
8205 def_gui='#define CONFIG_GUI 1'
8206 def_gtk2='#undef CONFIG_GTK2'
8209 else #if ! win32
8210 _gui_win32=yes
8211 libs_mplayer="$libs_mplayer -lcomdlg32 -lcomctl32 -lshell32 -lkernel32"
8212 def_gui='#define CONFIG_GUI 1'
8213 def_gtk2='#undef CONFIG_GTK2'
8214 fi #if ! win32
8216 else #if test "$_gui"
8217 def_gui='#undef CONFIG_GUI'
8218 def_gtk2='#undef CONFIG_GTK2'
8219 fi #if test "$_gui"
8220 # --------------- GUI specific tests end -------------------
8223 if test "$_charset" != "noconv" ; then
8224 def_charset="#define MSG_CHARSET \"$_charset\""
8225 else
8226 def_charset="#undef MSG_CHARSET"
8227 _charset="UTF-8"
8230 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
8231 echocheck "iconv program"
8232 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
8233 if test "$?" -ne 0 ; then
8234 echores "no"
8235 echo "No working iconv program found, use "
8236 echo "--charset=UTF-8 to continue anyway."
8237 echo "If you also have problems with iconv library functions use --charset=noconv."
8238 echo "Messages in the GTK-2 interface will be broken then."
8239 exit 1
8240 else
8241 echores "yes"
8245 #############################################################################
8247 echocheck "automatic gdb attach"
8248 if test "$_crash_debug" = yes ; then
8249 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
8250 else
8251 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
8252 _crash_debug=no
8254 echores "$_crash_debug"
8256 echocheck "compiler support for noexecstack"
8257 cat > $TMPC <<EOF
8258 int main(void) { return 0; }
8260 if cc_check -Wl,-z,noexecstack ; then
8261 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
8262 echores "yes"
8263 else
8264 echores "no"
8267 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
8268 if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
8269 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
8270 echores "yes"
8271 else
8272 echores "no"
8276 # Dynamic linking flags
8277 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
8278 _ld_dl_dynamic=''
8279 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
8280 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
8281 _ld_dl_dynamic='-rdynamic'
8284 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
8285 bsdos && extra_ldflags="$extra_ldflags -ldvd"
8286 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
8288 def_debug='#undef MP_DEBUG'
8289 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
8292 echocheck "joystick"
8293 def_joystick='#undef CONFIG_JOYSTICK'
8294 if test "$_joystick" = yes ; then
8295 if linux ; then
8296 # TODO add some check
8297 def_joystick='#define CONFIG_JOYSTICK 1'
8298 else
8299 _joystick="no"
8300 _res_comment="unsupported under $system_name"
8303 echores "$_joystick"
8305 echocheck "lirc"
8306 if test "$_lirc" = auto ; then
8307 _lirc=no
8308 cat > $TMPC <<EOF
8309 #include <lirc/lirc_client.h>
8310 int main(void) { return 0; }
8312 cc_check -llirc_client && _lirc=yes
8314 if test "$_lirc" = yes ; then
8315 def_lirc='#define CONFIG_LIRC 1'
8316 libs_mplayer="$libs_mplayer -llirc_client"
8317 else
8318 def_lirc='#undef CONFIG_LIRC'
8320 echores "$_lirc"
8322 echocheck "lircc"
8323 if test "$_lircc" = auto ; then
8324 _lircc=no
8325 cat > $TMPC <<EOF
8326 #include <lirc/lircc.h>
8327 int main(void) { return 0; }
8329 cc_check -llircc && _lircc=yes
8331 if test "$_lircc" = yes ; then
8332 def_lircc='#define CONFIG_LIRCC 1'
8333 libs_mplayer="$libs_mplayer -llircc"
8334 else
8335 def_lircc='#undef CONFIG_LIRCC'
8337 echores "$_lircc"
8339 if arm; then
8340 # Detect maemo development platform libraries availability (http://www.maemo.org),
8341 # they are used when run on Nokia 770|8x0
8342 echocheck "maemo (Nokia 770|8x0)"
8343 if test "$_maemo" = auto ; then
8344 _maemo=no
8345 cat > $TMPC << EOF
8346 #include <libosso.h>
8347 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
8349 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
8351 if test "$_maemo" = yes ; then
8352 def_maemo='#define CONFIG_MAEMO 1'
8353 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
8354 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
8355 else
8356 def_maemo='#undef CONFIG_MAEMO'
8358 echores "$_maemo"
8361 #############################################################################
8363 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
8364 # the OMF format needs to come after the 'extern symbol prefix' check, which
8365 # uses nm.
8366 if os2 ; then
8367 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
8370 # linker paths should be the same for mencoder and mplayer
8371 _ld_tmp=""
8372 for I in $libs_mplayer ; do
8373 _tmp=$(echo $I | sed -e 's/^-L.*$//')
8374 if test -z "$_tmp" ; then
8375 extra_ldflags="$extra_ldflags $I"
8376 else
8377 _ld_tmp="$_ld_tmp $I"
8379 done
8380 libs_mplayer=$_ld_tmp
8383 #############################################################################
8384 # 64 bit file offsets?
8385 if test "$_largefiles" = yes || freebsd ; then
8386 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
8387 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
8388 # dvdread support requires this (for off64_t)
8389 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
8393 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
8395 # This must be the last test to be performed. Any other tests following it
8396 # could fail due to linker errors. libdvdnavmini is intentionally not linked
8397 # against libdvdread (to permit MPlayer to use its own copy of the library).
8398 # So any compilation using the flags added here but not linking against
8399 # libdvdread can fail.
8400 echocheck "DVD support (libdvdnav)"
8401 dvdnav_internal=no
8402 if test "$_dvdnav" = auto ; then
8403 if test "$_dvdread_internal" = yes ; then
8404 _dvdnav=yes
8405 dvdnav_internal=yes
8406 _res_comment="internal"
8407 else
8408 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
8411 if test "$_dvdnav" = auto ; then
8412 cat > $TMPC <<EOF
8413 #include <inttypes.h>
8414 #include <dvdnav/dvdnav.h>
8415 int main(void) { dvdnav_t *dvd=0; return 0; }
8417 _dvdnav=no
8418 _dvdnavdir=$($_dvdnavconfig --cflags)
8419 _dvdnavlibs=$($_dvdnavconfig --libs)
8420 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
8422 if test "$_dvdnav" = yes ; then
8423 _largefiles=yes
8424 def_dvdnav='#define CONFIG_DVDNAV 1'
8425 if test "$dvdnav_internal" = yes ; then
8426 cflags_libdvdnav="-Ilibdvdnav"
8427 _inputmodules="dvdnav(internal) $_inputmodules"
8428 else
8429 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
8430 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
8431 _inputmodules="dvdnav $_inputmodules"
8433 else
8434 def_dvdnav='#undef CONFIG_DVDNAV'
8435 _noinputmodules="dvdnav $_noinputmodules"
8437 echores "$_dvdnav"
8439 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
8440 # Read dvdnav comment above.
8442 mak_enable () {
8443 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8444 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8445 nprefix=$3;
8446 for part in $list; do
8447 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8448 echo "${nprefix}_$part = yes"
8450 done
8453 #############################################################################
8454 echo "Creating config.mak"
8455 cat > config.mak << EOF
8456 # -------- Generated by configure -----------
8458 # Ensure that locale settings do not interfere with shell commands.
8459 export LC_ALL = C
8461 CONFIGURATION = $_configuration
8463 CHARSET = $_charset
8464 DOC_LANGS = $language_doc
8465 DOC_LANG_ALL = $doc_lang_all
8466 MAN_LANGS = $language_man
8467 MAN_LANG_ALL = $man_lang_all
8469 prefix = \$(DESTDIR)$_prefix
8470 BINDIR = \$(DESTDIR)$_bindir
8471 DATADIR = \$(DESTDIR)$_datadir
8472 LIBDIR = \$(DESTDIR)$_libdir
8473 MANDIR = \$(DESTDIR)$_mandir
8474 CONFDIR = \$(DESTDIR)$_confdir
8476 AR = $_ar
8477 AS = $_cc
8478 CC = $_cc
8479 CXX = $_cc
8480 HOST_CC = $_host_cc
8481 INSTALL = $_install
8482 INSTALLSTRIP = $_install_strip
8483 WINDRES = $_windres
8485 CFLAGS = $CFLAGS $extra_cflags
8486 ASFLAGS = \$(CFLAGS)
8487 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
8489 CFLAGS_DHAHELPER = $cflags_dhahelper
8490 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
8491 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
8492 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
8493 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
8494 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
8495 CFLAGS_STACKREALIGN = $cflags_stackrealign
8496 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
8497 CFLAGS_TREMOR_LOW = $cflags_tremor_low
8499 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
8500 EXTRALIBS_MPLAYER = $libs_mplayer
8501 EXTRALIBS_MENCODER = $libs_mencoder
8503 GETCH = $_getch
8504 HELP_FILE = $_mp_help
8505 TIMER = $_timer
8507 EXESUF = $_exesuf
8508 EXESUFS_ALL = .exe
8510 ARCH = $arch
8511 $(mak_enable "$arch_all" "$arch" ARCH)
8512 $(mak_enable "$subarch_all" "$subarch" ARCH)
8513 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
8515 MENCODER = $_mencoder
8516 MPLAYER = $_mplayer
8518 NEED_GETTIMEOFDAY = $_need_gettimeofday
8519 NEED_GLOB = $_need_glob
8520 NEED_MMAP = $_need_mmap
8521 NEED_SETENV = $_need_setenv
8522 NEED_SHMEM = $_need_shmem
8523 NEED_STRSEP = $_need_strsep
8524 NEED_SWAB = $_need_swab
8525 NEED_VSSCANF = $_need_vsscanf
8527 # features
8528 3DFX = $_3dfx
8529 AA = $_aa
8530 ALSA1X = $_alsa1x
8531 ALSA9 = $_alsa9
8532 ALSA5 = $_alsa5
8533 APPLE_IR = $_apple_ir
8534 APPLE_REMOTE = $_apple_remote
8535 ARTS = $_arts
8536 AUDIO_INPUT = $_audio_input
8537 BITMAP_FONT = $_bitmap_font
8538 BL = $_bl
8539 CACA = $_caca
8540 CDDA = $_cdda
8541 CDDB = $_cddb
8542 COREAUDIO = $_coreaudio
8543 COREVIDEO = $_corevideo
8544 DART = $_dart
8545 DFBMGA = $_dfbmga
8546 DGA = $_dga
8547 DIRECT3D = $_direct3d
8548 DIRECTFB = $_directfb
8549 DIRECTX = $_directx
8550 DVBIN = $_dvbin
8551 DVDNAV = $_dvdnav
8552 DVDNAV_INTERNAL = $dvdnav_internal
8553 DVDREAD = $_dvdread
8554 DVDREAD_INTERNAL = $_dvdread_internal
8555 DXR2 = $_dxr2
8556 DXR3 = $_dxr3
8557 ESD = $_esd
8558 FAAC=$_faac
8559 FAAD = $_faad
8560 FAAD_INTERNAL = $_faad_internal
8561 FASTMEMCPY = $_fastmemcpy
8562 FBDEV = $_fbdev
8563 FREETYPE = $_freetype
8564 FTP = $_ftp
8565 GIF = $_gif
8566 GGI = $_ggi
8567 GL = $_gl
8568 GL_WIN32 = $_gl_win32
8569 GL_X11 = $_gl_x11
8570 GL_SDL = $_gl_sdl
8571 MATRIXVIEW = $matrixview
8572 GUI = $_gui
8573 GUI_GTK = $_gui_gtk
8574 GUI_WIN32 = $_gui_win32
8575 HAVE_POSIX_SELECT = $_posix_select
8576 HAVE_SYS_MMAN_H = $_mman
8577 IVTV = $_ivtv
8578 JACK = $_jack
8579 JOYSTICK = $_joystick
8580 JPEG = $_jpeg
8581 KAI = $_kai
8582 KVA = $_kva
8583 LADSPA = $_ladspa
8584 LIBA52 = $_liba52
8585 LIBA52_INTERNAL = $_liba52_internal
8586 LIBASS = $_ass
8587 LIBASS_INTERNAL = $ass_internal
8588 LIBBS2B = $_libbs2b
8589 LIBDCA = $_libdca
8590 LIBDV = $_libdv
8591 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
8592 LIBLZO = $_liblzo
8593 LIBMAD = $_mad
8594 LIBMENU = $_menu
8595 LIBMENU_DVBIN = $_menu_dvbin
8596 LIBMPEG2 = $_libmpeg2
8597 LIBNEMESI = $_nemesi
8598 LIBNUT = $_libnut
8599 LIBSMBCLIENT = $_smb
8600 LIBTHEORA = $_theora
8601 LIRC = $_lirc
8602 LIVE555 = $_live
8603 MACOSX_FINDER = $_macosx_finder
8604 MD5SUM = $_md5sum
8605 MGA = $_mga
8606 MNG = $_mng
8607 MP3LAME = $_mp3lame
8608 MP3LIB = $_mp3lib
8609 MUSEPACK = $_musepack
8610 NAS = $_nas
8611 NATIVE_RTSP = $_native_rtsp
8612 NETWORK = $_network
8613 OPENAL = $_openal
8614 OSS = $_ossaudio
8615 PE_EXECUTABLE = $_pe_executable
8616 PNG = $_png
8617 PNM = $_pnm
8618 PRIORITY = $_priority
8619 PULSE = $_pulse
8620 PVR = $_pvr
8621 QTX_CODECS = $_qtx
8622 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8623 QTX_EMULATION = $_qtx_emulation
8624 QUARTZ = $_quartz
8625 RADIO=$_radio
8626 RADIO_CAPTURE=$_radio_capture
8627 REAL_CODECS = $_real
8628 S3FB = $_s3fb
8629 SDL = $_sdl
8630 SPEEX = $_speex
8631 STREAM_CACHE = $_stream_cache
8632 SGIAUDIO = $_sgiaudio
8633 SUNAUDIO = $_sunaudio
8634 SVGA = $_svga
8635 TDFXFB = $_tdfxfb
8636 TDFXVID = $_tdfxvid
8637 TGA = $_tga
8638 TOOLAME=$_toolame
8639 TREMOR_INTERNAL = $_tremor_internal
8640 TV = $_tv
8641 TV_BSDBT848 = $_tv_bsdbt848
8642 TV_DSHOW = $_tv_dshow
8643 TV_V4L = $_tv_v4l
8644 TV_V4L1 = $_tv_v4l1
8645 TV_V4L2 = $_tv_v4l2
8646 TWOLAME=$_twolame
8647 UNRAR_EXEC = $_unrar_exec
8648 V4L2 = $_v4l2
8649 VCD = $_vcd
8650 VDPAU = $_vdpau
8651 VESA = $_vesa
8652 VIDIX = $_vidix
8653 VIDIX_PCIDB = $_vidix_pcidb_val
8654 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8655 VIDIX_IVTV=$_vidix_drv_ivtv
8656 VIDIX_MACH64=$_vidix_drv_mach64
8657 VIDIX_MGA=$_vidix_drv_mga
8658 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8659 VIDIX_NVIDIA=$_vidix_drv_nvidia
8660 VIDIX_PM2=$_vidix_drv_pm2
8661 VIDIX_PM3=$_vidix_drv_pm3
8662 VIDIX_RADEON=$_vidix_drv_radeon
8663 VIDIX_RAGE128=$_vidix_drv_rage128
8664 VIDIX_S3=$_vidix_drv_s3
8665 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8666 VIDIX_SIS=$_vidix_drv_sis
8667 VIDIX_UNICHROME=$_vidix_drv_unichrome
8668 VORBIS = $_vorbis
8669 VSTREAM = $_vstream
8670 WII = $_wii
8671 WIN32DLL = $_win32dll
8672 WIN32WAVEOUT = $_win32waveout
8673 WIN32_EMULATION = $_win32_emulation
8674 WINVIDIX = $winvidix
8675 X11 = $_x11
8676 X264 = $_x264
8677 XANIM_CODECS = $_xanim
8678 XMGA = $_xmga
8679 XMMS_PLUGINS = $_xmms
8680 XV = $_xv
8681 XVID4 = $_xvid
8682 XVIDIX = $xvidix
8683 XVMC = $_xvmc
8684 XVR100 = $_xvr100
8685 YUV4MPEG = $_yuv4mpeg
8686 ZR = $_zr
8688 # FFmpeg
8689 LIBAVUTIL = $_libavutil
8690 LIBAVUTIL_A = $_libavutil_a
8691 LIBAVUTIL_SO = $_libavutil_so
8692 LIBAVCODEC = $_libavcodec
8693 LIBAVCODEC_A = $_libavcodec_a
8694 LIBAVCODEC_SO = $_libavcodec_so
8695 LIBAVFORMAT = $_libavformat
8696 LIBAVFORMAT_A = $_libavformat_a
8697 LIBAVFORMAT_SO = $_libavformat_so
8698 LIBPOSTPROC = $_libpostproc
8699 LIBPOSTPROC_A = $_libpostproc_a
8700 LIBPOSTPROC_SO = $_libpostproc_so
8701 LIBSWSCALE = $_libswscale
8702 LIBSWSCALE_A = $_libswscale_a
8703 LIBSWSCALE_SO = $_libswscale_so
8705 HOSTCC = \$(HOST_CC)
8706 HOSTCFLAGS = -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3
8707 HOSTLIBS = -lm
8708 CC_O = -o \$@
8709 LD = gcc
8710 RANLIB = $_ranlib
8711 YASM = $_yasm
8712 YASMFLAGS = $YASMFLAGS
8714 CONFIG_STATIC = yes
8715 SRC_PATH = ..
8716 BUILD_ROOT = ..
8717 LIBPREF = lib
8718 LIBSUF = .a
8719 LIBNAME = \$(LIBPREF)\$(NAME)\$(LIBSUF)
8720 FULLNAME = \$(NAME)\$(BUILDSUF)
8722 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8723 CONFIG_AANDCT = yes
8724 CONFIG_DCT = yes
8725 CONFIG_DWT = yes
8726 CONFIG_FFT = yes
8727 CONFIG_GOLOMB = yes
8728 CONFIG_H264DSP = yes
8729 CONFIG_LPC = yes
8730 CONFIG_LSP = yes
8731 CONFIG_MDCT = yes
8732 CONFIG_RDFT = yes
8734 $mak_hardcoded_tables
8735 $mak_libavcodec_mpegaudio_hp
8736 !CONFIG_LIBRTMP = yes
8738 CONFIG_BZLIB = $bzlib
8739 CONFIG_ENCODERS = yes
8740 CONFIG_GPL = yes
8741 CONFIG_LIBDIRAC_DECODER = $_libdirac_lavc
8742 CONFIG_LIBDIRAC_ENCODER = $_libdirac_lavc
8743 CONFIG_LIBFAAC_ENCODER = $_faac_lavc
8744 CONFIG_LIBMP3LAME_ENCODER = $_mp3lame_lavc
8745 CONFIG_LIBOPENCORE_AMRNB_DECODER = $_libopencore_amrnb
8746 CONFIG_LIBOPENCORE_AMRNB_ENCODER = $_libopencore_amrnb
8747 CONFIG_LIBOPENCORE_AMRWB_DECODER = $_libopencore_amrwb
8748 OCNFIG_LIBOPENJPEG_DECODER = $libopenjpeg
8749 OCNFIG_LIBOPENJPEG_ENCODER = $libopenjpeg
8750 CONFIG_LIBSCHROEDINGER_DECODER = $_libschroedinger_lavc
8751 CONFIG_LIBSCHROEDINGER_ENCODER = $_libschroedinger_lavc
8752 CONFIG_LIBVORBIS_ENCODER = $_libvorbis
8753 CONFIG_LIBX264_ENCODER = $_x264_lavc
8754 CONFIG_LIBXVID_ENCODER = $_xvid_lavc
8755 CONFIG_MLIB = $_mlib
8756 CONFIG_MUXERS = $_mencoder
8757 CONFIG_POSTPROC = yes
8758 CONFIG_VDPAU = $_vdpau
8759 CONFIG_XVMC = $_xvmc
8760 CONFIG_ZLIB = $_zlib
8762 HAVE_PTHREADS = $_pthreads
8763 HAVE_SHM = $_shm
8764 HAVE_W32THREADS = $_w32threads
8765 HAVE_YASM = $have_yasm
8767 $(echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8768 $(echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8769 $(echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8770 $(echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8771 $(echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8772 $(echo $_libavprotocols | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8773 $(echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8774 $(echo $_libavhwaccels | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/')
8777 #############################################################################
8779 ff_config_enable () {
8780 list=$(echo $1 | tr '[a-z]' '[A-Z]')
8781 item=$(echo $2 | tr '[a-z]' '[A-Z]')
8782 _nprefix=$3;
8783 test -z "$_nprefix" && _nprefix='CONFIG'
8784 for part in $list; do
8785 if $(echo $item | grep -q -E "(^| )$part($| )"); then
8786 echo "#define ${_nprefix}_$part 1"
8787 else
8788 echo "#define ${_nprefix}_$part 0"
8790 done
8793 echo "Creating config.h"
8794 cat > $TMPH << EOF
8795 /*----------------------------------------------------------------------------
8796 ** This file has been automatically generated by configure any changes in it
8797 ** will be lost when you run configure again.
8798 ** Instead of modifying definitions here, use the --enable/--disable options
8799 ** of the configure script! See ./configure --help for details.
8800 *---------------------------------------------------------------------------*/
8802 #ifndef MPLAYER_CONFIG_H
8803 #define MPLAYER_CONFIG_H
8805 /* Undefine this if you do not want to select mono audio (left or right)
8806 with a stereo MPEG layer 2/3 audio stream. The command line option
8807 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8808 right-only), with 0 being the default.
8810 #define CONFIG_FAKE_MONO 1
8812 /* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
8813 #define MAX_OUTBURST 65536
8815 /* set up audio OUTBURST. Do not change this! */
8816 #define OUTBURST 512
8818 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8819 #undef FAST_OSD
8820 #undef FAST_OSD_TABLE
8822 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8823 #define MPEG12_POSTPROC 1
8824 #define ATTRIBUTE_ALIGNED_MAX 16
8828 #define CONFIGURATION "$_configuration"
8830 #define MPLAYER_DATADIR "$_datadir"
8831 #define MPLAYER_CONFDIR "$_confdir"
8832 #define MPLAYER_LIBDIR "$_libdir"
8834 /* definitions needed by included libraries */
8835 #define HAVE_INTTYPES_H 1
8836 /* libmpeg2 + FFmpeg */
8837 $def_fast_inttypes
8838 /* libdvdcss */
8839 #define HAVE_ERRNO_H 1
8840 /* libdvdcss + libdvdread */
8841 #define HAVE_LIMITS_H 1
8842 /* libdvdcss + libfaad2 */
8843 #define HAVE_UNISTD_H 1
8844 /* libfaad2 + libdvdread */
8845 #define STDC_HEADERS 1
8846 #define HAVE_MEMCPY 1
8847 /* libfaad2 */
8848 #define HAVE_STRING_H 1
8849 #define HAVE_STRINGS_H 1
8850 #define HAVE_SYS_STAT_H 1
8851 #define HAVE_SYS_TYPES_H 1
8852 /* libdvdnav */
8853 #define READ_CACHE_TRACE 0
8854 /* libdvdread */
8855 #define HAVE_DLFCN_H 1
8856 $def_dvdcss
8859 /* system headers */
8860 $def_alloca_h
8861 $def_alsa_asoundlib_h
8862 $def_altivec_h
8863 $def_malloc_h
8864 $def_mman_h
8865 $def_mman_has_map_failed
8866 $def_soundcard_h
8867 $def_sys_asoundlib_h
8868 $def_sys_soundcard_h
8869 $def_sys_sysinfo_h
8870 $def_termios_h
8871 $def_termios_sys_h
8872 $def_winsock2_h
8875 /* system functions */
8876 $def_gethostbyname2
8877 $def_gettimeofday
8878 $def_glob
8879 $def_langinfo
8880 $def_lrintf
8881 $def_map_memalign
8882 $def_memalign
8883 $def_nanosleep
8884 $def_posix_select
8885 $def_select
8886 $def_setenv
8887 $def_setmode
8888 $def_shm
8889 $def_strsep
8890 $def_swab
8891 $def_sysi86
8892 $def_sysi86_iv
8893 $def_termcap
8894 $def_termios
8895 $def_vsscanf
8898 /* system-specific features */
8899 $def_asmalign_pot
8900 $def_builtin_expect
8901 $def_dl
8902 $def_dos_paths
8903 $def_extern_asm
8904 $def_extern_prefix
8905 $def_iconv
8906 $def_kstat
8907 $def_macosx_bundle
8908 $def_macosx_finder
8909 $def_maemo
8910 $def_named_asm_args
8911 $def_priority
8912 $def_quicktime
8913 $def_restrict_keyword
8914 $def_rtc
8915 $def_unrar_exec
8918 /* configurable options */
8919 $def_charset
8920 $def_crash_debug
8921 $def_debug
8922 $def_dynamic_plugins
8923 $def_fastmemcpy
8924 $def_menu
8925 $def_runtime_cpudetection
8926 $def_sighandler
8927 $def_sortsub
8928 $def_stream_cache
8929 $def_pthread_cache
8932 /* CPU stuff */
8933 #define __CPU__ $iproc
8934 $def_words_endian
8935 $def_bigendian
8936 $(ff_config_enable "$arch_all" "$arch" "ARCH")
8937 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
8938 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
8941 /* DVD/VCD/CD */
8942 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8943 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8944 $def_bsdi_dvd
8945 $def_cddb
8946 $def_cdio
8947 $def_cdparanoia
8948 $def_cdrom
8949 $def_dvd
8950 $def_dvd_bsd
8951 $def_dvd_darwin
8952 $def_dvd_linux
8953 $def_dvd_openbsd
8954 $def_dvdio
8955 $def_dvdnav
8956 $def_dvdread
8957 $def_hpux_scsi_h
8958 $def_libcdio
8959 $def_sol_scsi_h
8960 $def_vcd
8963 /* codec libraries */
8964 $def_faac
8965 $def_faad
8966 $def_faad_internal
8967 $def_liba52
8968 $def_liba52_internal
8969 $def_libdca
8970 $def_libdv
8971 $def_liblzo
8972 $def_libmpeg2
8973 $def_mad
8974 $def_mp3lame
8975 $def_mp3lame_preset
8976 $def_mp3lame_preset_medium
8977 $def_mp3lib
8978 $def_musepack
8979 $def_speex
8980 $def_theora
8981 $def_toolame
8982 $def_tremor
8983 $def_twolame
8984 $def_vorbis
8985 $def_x264
8986 $def_xvid
8987 $def_zlib
8989 $def_libnut
8992 /* binary codecs */
8993 $def_qtx
8994 $def_qtx_win32
8995 $def_real
8996 $def_win32_loader
8997 $def_win32dll
8998 $def_xanim
8999 $def_xmms
9000 #define BINARY_CODECS_PATH "$_codecsdir"
9001 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
9004 /* GUI */
9005 $def_gtk2
9006 $def_gui
9007 $def_xshape
9010 /* Audio output drivers */
9011 $def_alsa
9012 $def_alsa1x
9013 $def_alsa5
9014 $def_alsa9
9015 $def_arts
9016 $def_coreaudio
9017 $def_dart
9018 $def_esd
9019 $def_esd_latency
9020 $def_jack
9021 $def_kai
9022 $def_nas
9023 $def_openal
9024 $def_openal_h
9025 $def_ossaudio
9026 $def_ossaudio_devdsp
9027 $def_ossaudio_devmixer
9028 $def_pulse
9029 $def_sgiaudio
9030 $def_sunaudio
9031 $def_win32waveout
9033 $def_ladspa
9034 $def_libbs2b
9037 /* input */
9038 $def_apple_ir
9039 $def_apple_remote
9040 $def_ioctl_bt848_h_name
9041 $def_ioctl_meteor_h_name
9042 $def_joystick
9043 $def_lirc
9044 $def_lircc
9045 $def_pvr
9046 $def_radio
9047 $def_radio_bsdbt848
9048 $def_radio_capture
9049 $def_radio_v4l
9050 $def_radio_v4l2
9051 $def_tv
9052 $def_tv_bsdbt848
9053 $def_tv_dshow
9054 $def_tv_v4l
9055 $def_tv_v4l1
9056 $def_tv_v4l2
9059 /* font stuff */
9060 $def_ass
9061 $def_ass_internal
9062 $def_bitmap_font
9063 $def_enca
9064 $def_fontconfig
9065 $def_freetype
9066 $def_fribidi
9069 /* networking */
9070 $def_closesocket
9071 $def_ftp
9072 $def_inet6
9073 $def_inet_aton
9074 $def_inet_pton
9075 $def_live
9076 $def_nemesi
9077 $def_network
9078 $def_smb
9079 $def_socklen_t
9080 $def_struct_ipv6_mreq
9081 $def_struct_sockaddr_in6
9082 $def_struct_sockaddr_sa_len
9083 $def_vstream
9084 $def_addrinfo
9085 $def_getaddrinfo
9086 $def_sockaddr_storage
9089 /* libvo options */
9090 $def_3dfx
9091 $def_aa
9092 $def_bl
9093 $def_caca
9094 $def_corevideo
9095 $def_dfbmga
9096 $def_dga
9097 $def_dga1
9098 $def_dga2
9099 $def_direct3d
9100 $def_directfb
9101 $def_directfb_version
9102 $def_directx
9103 $def_dvb
9104 $def_dvbin
9105 $def_dxr2
9106 $def_dxr3
9107 $def_fbdev
9108 $def_ggi
9109 $def_ggiwmh
9110 $def_gif
9111 $def_gif_4
9112 $def_gif_tvt_hack
9113 $def_gl
9114 $def_gl_win32
9115 $def_gl_x11
9116 $def_gl_sdl
9117 $def_matrixview
9118 $def_ivtv
9119 $def_jpeg
9120 $def_kva
9121 $def_md5sum
9122 $def_mga
9123 $def_mng
9124 $def_png
9125 $def_pnm
9126 $def_quartz
9127 $def_s3fb
9128 $def_sdl
9129 $def_sdl_sdl_h
9130 $def_svga
9131 $def_tdfxfb
9132 $def_tdfxvid
9133 $def_tga
9134 $def_v4l2
9135 $def_vdpau
9136 $def_vesa
9137 $def_vidix
9138 $def_vidix_drv_cyberblade
9139 $def_vidix_drv_ivtv
9140 $def_vidix_drv_mach64
9141 $def_vidix_drv_mga
9142 $def_vidix_drv_mga_crtc2
9143 $def_vidix_drv_nvidia
9144 $def_vidix_drv_pm3
9145 $def_vidix_drv_radeon
9146 $def_vidix_drv_rage128
9147 $def_vidix_drv_s3
9148 $def_vidix_drv_sh_veu
9149 $def_vidix_drv_sis
9150 $def_vidix_drv_unichrome
9151 $def_vidix_pfx
9152 $def_vm
9153 $def_wii
9154 $def_x11
9155 $def_xdpms
9156 $def_xf86keysym
9157 $def_xinerama
9158 $def_xmga
9159 $def_xss
9160 $def_xv
9161 $def_xvmc
9162 $def_xvr100
9163 $def_yuv4mpeg
9164 $def_zr
9167 /* FFmpeg */
9168 $def_libavcodec
9169 $def_libavcodec_a
9170 $def_libavcodec_so
9171 $def_libavformat
9172 $def_libavformat_a
9173 $def_libavformat_so
9174 $def_libavutil
9175 $def_libavutil_a
9176 $def_libavutil_so
9177 $def_libpostproc
9178 $def_libpostproc_a
9179 $def_libpostproc_so
9180 $def_libswscale
9181 $def_libswscale_a
9182 $def_libswscale_so
9184 #define CONFIG_DECODERS 1
9185 #define CONFIG_ENCODERS 1
9186 #define CONFIG_DEMUXERS 1
9187 $def_muxers
9189 $def_arpa_inet_h
9190 $def_bswap
9191 $def_bzlib
9192 $def_dcbzl
9193 $def_exp2
9194 $def_exp2f
9195 $def_fast_64bit
9196 $def_fast_unaligned
9197 $def_hardcoded_tables
9198 $def_libavcodec_mpegaudio_hp
9199 $def_llrint
9200 $def_llrintf
9201 $def_local_aligned_8
9202 $def_local_aligned_16
9203 $def_log2
9204 $def_log2f
9205 $def_lrint
9206 $def_memalign_hack
9207 $def_mlib
9208 $def_mkstemp
9209 $def_posix_memalign
9210 $def_pthreads
9211 $def_round
9212 $def_roundf
9213 $def_ten_operands
9214 $def_threads
9215 $def_truncf
9216 $def_xform_asm
9217 $def_yasm
9219 #define CONFIG_FASTDIV 0
9220 #define CONFIG_FFSERVER 0
9221 #define CONFIG_GPL 1
9222 #define CONFIG_GRAY 0
9223 #define CONFIG_LIBRTMP 0
9224 #define CONFIG_LIBVORBIS 0
9225 #define CONFIG_POWERPC_PERF 0
9226 #define CONFIG_SMALL 0
9227 #define CONFIG_SWSCALE_ALPHA 1
9229 #if defined(HAVE_AF_INET6) && (!defined(_WIN32) || defined(__CYGWIN__))
9230 #define CONFIG_IPV6 1
9231 #else
9232 #define CONFIG_IPV6 0
9233 #endif
9235 #define HAVE_ATTRIBUTE_MAY_ALIAS 1
9236 #define av_alias __attribute__((may_alias))
9237 #define HAVE_ATTRIBUTE_PACKED 1
9238 #define HAVE_GETHRTIME 0
9239 #define HAVE_INLINE_ASM 1
9240 #define HAVE_LDBRX 0
9241 #define HAVE_POLL_H 1
9242 #define HAVE_PPC4XX 0
9243 #define HAVE_STRERROR_R 0
9244 #define HAVE_SYS_SELECT_H 0
9245 #define HAVE_VFP_ARGS 1
9246 #define HAVE_VIRTUALALLOC 0
9248 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
9249 #define CONFIG_AANDCT 1
9250 #define CONFIG_DCT 1
9251 #define CONFIG_DWT 1
9252 #define CONFIG_FFT 1
9253 #define CONFIG_GOLOMB 1
9254 #define CONFIG_H264DSP 1
9255 #define CONFIG_LPC 1
9256 #define CONFIG_MDCT 1
9257 #define CONFIG_RDFT 1
9259 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
9260 $def_ebx_available
9261 #ifndef MP_DEBUG
9262 #define HAVE_EBP_AVAILABLE 1
9263 #else
9264 #define HAVE_EBP_AVAILABLE 0
9265 #endif
9267 #define FFMPEG_CONFIGURATION "--enable-gpl --enable-postproc"
9268 #define FFMPEG_LICENSE "GPL version 2 or later"
9270 /* External libraries used through libavcodec. */
9271 $def_faac_lavc
9272 $def_libdirac_lavc
9273 $def_libopencore_amrnb
9274 $def_libopencore_amrwb
9275 $def_libopenjpeg
9276 $def_libschroedinger_lavc
9277 $def_mp3lame_lavc
9278 $def_x264_lavc
9279 $def_xvid_lavc
9281 $(ff_config_enable "$_libavdecoders_all" "$_libavdecoders")
9282 $(ff_config_enable "$_libavencoders_all" "$_libavencoders")
9283 $(ff_config_enable "$_libavparsers_all" "$_libavparsers")
9284 $(ff_config_enable "$_libavdemuxers_all" "$_libavdemuxers")
9285 $(ff_config_enable "$_libavmuxers_all" "$_libavmuxers")
9286 $(ff_config_enable "$_libavprotocols_all" "$_libavprotocols")
9287 $(ff_config_enable "$_libavbsfs_all" "$_libavbsfs")
9288 $(ff_config_enable "$_libavhwaccels_all" "$_libavhwaccels")
9290 #endif /* MPLAYER_CONFIG_H */
9293 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
9294 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
9296 ############################################################################
9298 # Create avconfig.h for FFmpeg.
9299 cat > "$TMPH" << EOF
9300 /* Generated by mpconfigure */
9301 #ifndef AVUTIL_AVCONFIG_H
9302 #define AVUTIL_AVCONFIG_H
9303 $def_av_bigendian
9304 #endif /* AVUTIL_AVCONFIG_H */
9307 # Do not overwrite an unchanged avconfig.h to avoid superfluous rebuilds.
9308 cmp -s "$TMPH" libavutil/avconfig.h || mv -f "$TMPH" libavutil/avconfig.h
9310 #############################################################################
9312 cat << EOF
9314 Config files successfully generated by ./configure $_configuration !
9316 Install prefix: $_prefix
9317 Data directory: $_datadir
9318 Config direct.: $_confdir
9320 Byte order: $_byte_order
9321 Optimizing for: $_optimizing
9323 Languages:
9324 Messages/GUI: $language_msg
9325 Manual pages: $language_man
9326 Documentation: $language_doc
9328 Enabled optional drivers:
9329 Input: $_inputmodules
9330 Codecs: $_codecmodules
9331 Audio output: $_aomodules
9332 Video output: $_vomodules
9334 Disabled optional drivers:
9335 Input: $_noinputmodules
9336 Codecs: $_nocodecmodules
9337 Audio output: $_noaomodules
9338 Video output: $_novomodules
9340 'config.h' and 'config.mak' contain your configuration options.
9341 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
9342 compile *** DO NOT REPORT BUGS if you tweak these files ***
9344 'make' will now compile MPlayer and 'make install' will install it.
9345 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
9350 if test "$_mtrr" = yes ; then
9351 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
9352 echo
9355 if ! x86_32; then
9356 cat <<EOF
9357 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
9358 operating system ($system_name). You may encounter a few files that cannot
9359 be played due to missing open source video/audio codec support.
9365 cat <<EOF
9366 Check $TMPLOG if you wonder why an autodetection failed (make sure
9367 development headers/packages are installed).
9369 NOTE: The --enable-* parameters unconditionally force options on, completely
9370 skipping autodetection. This behavior is unlike what you may be used to from
9371 autoconf-based configure scripts that can decide to override you. This greater
9372 level of control comes at a price. You may have to provide the correct compiler
9373 and linker flags yourself.
9374 If you used one of these options (except --enable-menu and similar ones that
9375 turn on internal features) and experience a compilation or linking failure,
9376 make sure you have passed the necessary compiler/linker flags to configure.
9378 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
9382 if test "$_warn_CFLAGS" = yes; then
9383 cat <<EOF
9385 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
9386 but:
9388 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
9390 It is strongly recommended to let MPlayer choose the correct CFLAGS!
9391 To do so, execute 'CFLAGS= ./configure <options>'
9396 # Last move:
9397 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"