Add more support for CPU count detection
[mplayer/kovensky.git] / configure
blob84b150bf0c53668187739ae3b0875a5f655d927c
1 #! /bin/sh
3 # Original version (C) 2000 Pontscho/fresh!mindworkz
4 # pontscho@makacs.poliod.hu
6 # History / Contributors: Check the Subversion log.
8 # Cleanups all over the place (c) 2001 pl
11 # This configure script is *not* autoconf-based and has different semantics.
12 # It attempts to autodetect all settings and options where possible. It is
13 # possible to override autodetection with the --enable-option/--disable-option
14 # command line parameters. --enable-option forces the option on skipping
15 # autodetection. Yes, this means that compilation may fail and yes, this is not
16 # how autoconf-based configure scripts behave.
18 # configure generates a series of configuration files:
19 # - config.h contains #defines that are used in the C code.
20 # - config.mak is included from the Makefiles.
22 # If you want to add a new check for $feature, here is a simple skeleton:
24 # echocheck "$feature"
25 # if test "$_feature" = auto; then
26 # cat > $TMPC << EOF
27 # #include <feature.h>
28 # int main(void) { return 0; }
29 # EOF
30 # _feature=no
31 # cc_check && _feature=yes
32 # fi
33 # if test "$_feature" = yes ; then
34 # def_feature='#define CONFIG_FEATURE 1'
35 # else
36 # def_feature='#undef CONFIG_FEATURE'
37 # fi
38 # echores "$_feature"
40 # Furthermore you need to add the variable _feature to the list of default
41 # settings and set it to one of yes/no/auto. Also add appropriate
42 # --enable-feature/--disable-feature command line options.
43 # The results of the check should be written to config.h and config.mak
44 # at the end of this script. The variable names used for this should be
45 # uniform, i.e. if the option is named 'feature':
47 # _feature : should have a value of yes/no/auto
48 # def_feature : '#define ... 1' or '#undef ...' for conditional compilation
49 # _ld_feature : '-L/path/dir -lfeature' GCC options
51 #############################################################################
53 # Prevent locale nonsense from breaking basic text processing utils
54 export LC_ALL=C
56 # Store the configure line that was used
57 _configuration="$*"
59 # Prefer these macros to full length text !
60 # These macros only return an error code - NO display is done
61 compile_check() {
62 echo >> "$TMPLOG"
63 cat "$1" >> "$TMPLOG"
64 echo >> "$TMPLOG"
65 echo "$_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
66 rm -f "$TMPEXE"
67 $_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
68 TMPRES="$?"
69 echo >> "$TMPLOG"
70 echo >> "$TMPLOG"
71 return "$TMPRES"
74 cc_check() {
75 compile_check $TMPC $@
78 cxx_check() {
79 compile_check $TMPCPP $@ -lstdc++
82 yasm_check() {
83 echo >> "$TMPLOG"
84 cat "$TMPS" >> "$TMPLOG"
85 echo >> "$TMPLOG"
86 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
87 rm -f "$TMPEXE"
88 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
89 TMPRES="$?"
90 echo >> "$TMPLOG"
91 echo >> "$TMPLOG"
92 return "$TMPRES"
95 tmp_run() {
96 "$TMPEXE" >> "$TMPLOG" 2>&1
99 # Display error message, flushes tempfile, exit
100 die () {
101 echo
102 echo "Error: $@" >&2
103 echo >&2
104 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
105 echo "Check \"$TMPLOG\" if you do not understand why it failed."
106 exit 1
109 # OS test booleans functions
110 issystem() {
111 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
113 aix() { issystem "AIX"; }
114 amigaos() { issystem "AmigaOS"; }
115 beos() { issystem "BEOS"; }
116 bsdos() { issystem "BSD/OS"; }
117 cygwin() { issystem "CYGWIN"; }
118 darwin() { issystem "Darwin"; }
119 dragonfly() { issystem "DragonFly"; }
120 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
121 gnu() { issystem "GNU"; }
122 hpux() { issystem "HP-UX"; }
123 irix() { issystem "IRIX"; }
124 linux() { issystem "Linux"; }
125 mingw32() { issystem "MINGW32"; }
126 morphos() { issystem "MorphOS"; }
127 netbsd() { issystem "NetBSD"; }
128 openbsd() { issystem "OpenBSD"; }
129 os2() { issystem "OS/2"; }
130 qnx() { issystem "QNX"; }
131 sunos() { issystem "SunOS"; }
132 win32() { cygwin || mingw32; }
134 # arch test boolean functions
135 # x86/x86pc is used by QNX
136 x86_32() {
137 case "$host_arch" in
138 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
139 *) return 1 ;;
140 esac
143 x86_64() {
144 case "$host_arch" in
145 x86_64|amd64) return 0 ;;
146 *) return 1 ;;
147 esac
150 x86() {
151 x86_32 || x86_64
154 ppc() {
155 case "$host_arch" in
156 ppc|ppc64|powerpc|powerpc64) return 0;;
157 *) return 1;;
158 esac
161 alpha() {
162 case "$host_arch" in
163 alpha*) return 0;;
164 *) return 1;;
165 esac
168 arm() {
169 case "$host_arch" in
170 arm*) return 0;;
171 *) return 1;;
172 esac
175 # Use this before starting a check
176 echocheck() {
177 echo "============ Checking for $@ ============" >> "$TMPLOG"
178 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
181 # Use this to echo the results of a check
182 echores() {
183 if test "$_res_comment" ; then
184 _res_comment="($_res_comment)"
186 echo "Result is: $@ $_res_comment" >> "$TMPLOG"
187 echo "##########################################" >> "$TMPLOG"
188 echo "" >> "$TMPLOG"
189 echo "$@ $_res_comment"
190 _res_comment=""
192 #############################################################################
194 # Check how echo works in this /bin/sh
195 case $(echo -n) in
196 -n) _echo_n= _echo_c='\c' ;; # SysV echo
197 *) _echo_n='-n ' _echo_c= ;; # BSD echo
198 esac
200 msg_lang_all=$(echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g")
201 man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
202 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
204 show_help(){
205 cat << EOF
206 Usage: $0 [OPTIONS]...
208 Configuration:
209 -h, --help display this help and exit
211 Installation directories:
212 --prefix=DIR prefix directory for installation [/usr/local]
213 --bindir=DIR directory for installing binaries [PREFIX/bin]
214 --datadir=DIR directory for installing machine independent
215 data files (skins, etc) [PREFIX/share/mplayer]
216 --mandir=DIR directory for installing man pages [PREFIX/share/man]
217 --confdir=DIR directory for installing configuration files
218 [PREFIX/etc/mplayer]
219 --libdir=DIR directory for object code libraries [PREFIX/lib]
220 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
221 --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs]
222 --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs]
223 --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs]
225 Optional features:
226 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
227 --disable-mplayer disable MPlayer compilation [enable]
228 --disable-largefiles disable support for files > 2GB [enable]
229 --enable-linux-devfs set default devices to devfs [disable]
230 --enable-termcap use termcap database for key codes [autodetect]
231 --enable-termios use termios database for key codes [autodetect]
232 --disable-iconv disable iconv for encoding conversion [autodetect]
233 --disable-langinfo do not use langinfo [autodetect]
234 --enable-lirc enable LIRC (remote control) support [autodetect]
235 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
236 --enable-joystick enable joystick support [disable]
237 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
238 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
239 --disable-vm disable X video mode extensions [autodetect]
240 --disable-xf86keysym disable support for multimedia keys [autodetect]
241 --enable-radio enable radio interface [disable]
242 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
243 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
244 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
245 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
246 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
247 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
248 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
249 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
250 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
251 --disable-network disable networking [enable]
252 --enable-winsock2_h enable winsock2_h [autodetect]
253 --enable-smb enable Samba (SMB) input [autodetect]
254 --enable-live enable LIVE555 Streaming Media [autodetect]
255 --enable-nemesi enable Nemesi Streaming Media [autodetect]
256 --disable-vcd disable VCD support [autodetect]
257 --disable-dvdnav disable libdvdnav [autodetect]
258 --disable-dvdread disable libdvdread [autodetect]
259 --disable-dvdread-internal disable internal libdvdread [autodetect]
260 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
261 --disable-cdparanoia disable cdparanoia [autodetect]
262 --disable-cddb disable cddb [autodetect]
263 --disable-bitmap-font disable bitmap font support [enable]
264 --disable-freetype disable FreeType 2 font rendering [autodetect]
265 --disable-fontconfig disable fontconfig font lookup [autodetect]
266 --disable-unrarexec disable using of UnRAR executable [enabled]
267 --enable-menu enable OSD menu (not DVD menu) [disabled]
268 --disable-sortsub disable subtitle sorting [enabled]
269 --enable-fribidi enable the FriBiDi libs [autodetect]
270 --disable-enca disable ENCA charset oracle library [autodetect]
271 --disable-maemo disable maemo specific features [autodetect]
272 --enable-macosx-finder enable Mac OS X Finder invocation parameter
273 parsing [disabled]
274 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
275 --disable-inet6 disable IPv6 support [autodetect]
276 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
277 --disable-ftp disable FTP support [enabled]
278 --disable-vstream disable TiVo vstream client support [autodetect]
279 --disable-pthreads disable Posix threads support [autodetect]
280 --disable-w32threads disable Win32 threads support [autodetect]
281 --disable-ass disable internal 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 [enabled]
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-x264 disable x264 [autodetect]
297 --disable-libnut disable libnut [autodetect]
298 --disable-libavutil disable libavutil [autodetect]
299 --disable-libavcodec disable libavcodec [autodetect]
300 --disable-libavformat disable libavformat [autodetect]
301 --disable-libpostproc disable libpostproc [autodetect]
302 --disable-libswscale disable libswscale [autodetect]
303 --disable-tremor-internal disable internal Tremor [enabled]
304 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
305 --enable-tremor enable external Tremor [autodetect]
306 --disable-libvorbis disable libvorbis support [autodetect]
307 --disable-speex disable Speex support [autodetect]
308 --enable-theora enable OggTheora libraries [autodetect]
309 --enable-faad enable external FAAD2 (AAC) [autodetect]
310 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
311 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
312 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
313 --disable-ladspa disable LADSPA plugin support [autodetect]
314 --disable-libbs2b disable libbs2b audio filter support [autodetect]
315 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
316 --disable-mad disable libmad (MPEG audio) support [autodetect]
317 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
318 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
319 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
320 --enable-xmms enable XMMS input plugin support [disabled]
321 --enable-libdca enable libdca support [autodetect]
322 --disable-mp3lib disable builtin mp3lib [autodetect]
323 --disable-liba52 disable liba52 [autodetect]
324 --enable-liba52-internal enable builtin liba52 [disabled]
325 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
326 --disable-musepack disable musepack support [autodetect]
328 Video output:
329 --disable-vidix disable VIDIX [for x86 *nix]
330 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
331 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
332 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
333 --disable-vidix-pcidb disable VIDIX PCI device name database
334 --enable-dhahelper enable VIDIX dhahelper support
335 --enable-svgalib_helper enable VIDIX svgalib_helper support
336 --enable-gl enable OpenGL video output [autodetect]
337 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
338 --enable-dga2 enable DGA 2 support [autodetect]
339 --enable-dga1 enable DGA 1 support [autodetect]
340 --enable-vesa enable VESA video output [autodetect]
341 --enable-svga enable SVGAlib video output [autodetect]
342 --enable-sdl enable SDL video output [autodetect]
343 --enable-kva enable KVA video output [autodetect]
344 --enable-aa enable AAlib video output [autodetect]
345 --enable-caca enable CACA video output [autodetect]
346 --enable-ggi enable GGI video output [autodetect]
347 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
348 --enable-direct3d enable Direct3D video output [autodetect]
349 --enable-directx enable DirectX video output [autodetect]
350 --enable-dxr2 enable DXR2 video output [autodetect]
351 --enable-dxr3 enable DXR3/H+ video output [autodetect]
352 --enable-ivtv enable IVTV TV-Out video output [autodetect]
353 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
354 --enable-dvb enable DVB video output [autodetect]
355 --enable-dvbhead enable DVB video output (HEAD version) [autodetect]
356 --enable-mga enable mga_vid video output [autodetect]
357 --enable-xmga enable mga_vid X11 video output [autodetect]
358 --enable-xv enable Xv video output [autodetect]
359 --enable-xvmc enable XvMC acceleration [disable]
360 --enable-vdpau enable VDPAU acceleration [autodetect]
361 --enable-vm enable XF86VidMode support [autodetect]
362 --enable-xinerama enable Xinerama support [autodetect]
363 --enable-x11 enable X11 video output [autodetect]
364 --enable-xshape enable XShape support [autodetect]
365 --disable-xss disable screensaver support via xss [autodetect]
366 --enable-fbdev enable FBDev video output [autodetect]
367 --enable-mlib enable mediaLib video output (Solaris) [disable]
368 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
369 --enable-tdfxfb enable tdfxfb video output [disable]
370 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
371 --enable-wii enable Nintendo Wii/GameCube video output [disable]
372 --enable-directfb enable DirectFB video output [autodetect]
373 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
374 --enable-bl enable Blinkenlights video output [disable]
375 --enable-tdfxvid enable tdfx_vid video output [disable]
376 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
377 --disable-tga disable Targa video output [enable]
378 --disable-pnm disable PNM video output [enable]
379 --disable-md5sum disable md5sum video output [enable]
380 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
381 --disable-corevideo disable CoreVideo video output [autodetect]
382 --disable-quartz disable Quartz video output [autodetect]
384 Audio output:
385 --disable-alsa disable ALSA audio output [autodetect]
386 --disable-ossaudio disable OSS audio output [autodetect]
387 --disable-arts disable aRts audio output [autodetect]
388 --disable-esd disable esd audio output [autodetect]
389 --disable-pulse disable Pulseaudio audio output [autodetect]
390 --disable-jack disable JACK audio output [autodetect]
391 --enable-openal enable OpenAL audio output [disable]
392 --disable-nas disable NAS audio output [autodetect]
393 --disable-sgiaudio disable SGI audio output [autodetect]
394 --disable-sunaudio disable Sun audio output [autodetect]
395 --disable-dart disable DART audio output [autodetect]
396 --disable-win32waveout disable Windows waveout audio output [autodetect]
397 --disable-coreaudio disable CoreAudio audio output [autodetect]
398 --disable-select disable using select() on the audio device [enable]
400 Language options:
401 --charset=charset convert the console messages to this character set
402 --language-doc=lang language to use for the documentation [en]
403 --language-man=lang language to use for the man pages [en]
404 --language-msg=lang language to use for the messages [en]
405 --language=lang default language to use [en]
406 Specific options override --language. You can pass a list of languages separated
407 by whitespace or commas instead of a single language. Nonexisting translations
408 will be dropped from each list. All documentation and man page translations
409 available in the list will be installed, for the messages the first available
410 translation will be used. The value "all" will activate all translations. The
411 LINGUAS environment variable is honored. In all cases the fallback is English.
412 Available values are: all $msg_lang_all
414 Miscellaneous options:
415 --enable-runtime-cpudetection enable runtime CPU detection [disable]
416 --enable-cross-compile enable cross-compilation [autodetect]
417 --cc=COMPILER C compiler to build MPlayer [gcc]
418 --host-cc=COMPILER C compiler for tools needed while building [gcc]
419 --as=ASSEMBLER assembler to build MPlayer [as]
420 --nm=NM nm tool to build MPlayer [nm]
421 --yasm=YASM Yasm assembler to build MPlayer [yasm]
422 --ar=AR librarian to build MPlayer [ar]
423 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
424 --windres=WINDRES windres to build MPlayer [windres]
425 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
426 --enable-static build a statically linked binary
427 --with-install=PATH path to a custom install program
429 Advanced options:
430 --enable-mmx enable MMX [autodetect]
431 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
432 --enable-3dnow enable 3DNow! [autodetect]
433 --enable-3dnowext enable extended 3DNow! [autodetect]
434 --enable-sse enable SSE [autodetect]
435 --enable-sse2 enable SSE2 [autodetect]
436 --enable-ssse3 enable SSSE3 [autodetect]
437 --enable-shm enable shm [autodetect]
438 --enable-altivec enable AltiVec (PowerPC) [autodetect]
439 --enable-armv5te enable DSP extensions (ARM) [autodetect]
440 --enable-armv6 enable ARMv6 (ARM) [autodetect]
441 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
442 --enable-armvfp enable ARM VFP (ARM) [autodetect]
443 --enable-neon enable NEON (ARM) [autodetect]
444 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
445 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
446 --enable-big-endian force byte order to big-endian [autodetect]
447 --enable-debug[=1-3] compile-in debugging information [disable]
448 --enable-profile compile-in profiling information [disable]
449 --disable-sighandler disable sighandler for crashes [enable]
450 --enable-crash-debug enable automatic gdb attach on crash [disable]
451 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
452 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
454 Use these options if autodetection fails:
455 --extra-cflags=FLAGS extra CFLAGS
456 --extra-ldflags=FLAGS extra LDFLAGS
457 --extra-libs=FLAGS extra linker flags
458 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
459 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
460 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
462 --with-freetype-config=PATH path to freetype-config
463 --with-fribidi-config=PATH path to fribidi-config
464 --with-glib-config=PATH path to glib*-config
465 --with-gtk-config=PATH path to gtk*-config
466 --with-sdl-config=PATH path to sdl*-config
467 --with-dvdnav-config=PATH path to dvdnav-config
468 --with-dvdread-config=PATH path to dvdread-config
470 This configure script is NOT autoconf-based, even though its output is similar.
471 It will try to autodetect all configuration options. If you --enable an option
472 it will be forcefully turned on, skipping autodetection. This can break
473 compilation, so you need to know what you are doing.
475 exit 0
476 } #show_help()
478 # GOTCHA: the variables below defines the default behavior for autodetection
479 # and have - unless stated otherwise - at least 2 states : yes no
480 # If autodetection is available then the third state is: auto
481 _mmx=auto
482 _3dnow=auto
483 _3dnowext=auto
484 _mmxext=auto
485 _sse=auto
486 _sse2=auto
487 _ssse3=auto
488 _cmov=auto
489 _fast_cmov=auto
490 _fast_clz=auto
491 _armv5te=auto
492 _armv6=auto
493 _armv6t2=auto
494 _armvfp=auto
495 neon=auto
496 _iwmmxt=auto
497 _mtrr=auto
498 _altivec=auto
499 _install=install
500 _ranlib=ranlib
501 _windres=windres
502 _cc=cc
503 _ar=ar
504 test "$CC" && _cc="$CC"
505 _as=auto
506 _nm=auto
507 _yasm=yasm
508 _runtime_cpudetection=no
509 _cross_compile=auto
510 _prefix="/usr/local"
511 _libavutil=auto
512 _libavcodec=auto
513 _libavformat=auto
514 _libpostproc=auto
515 _libswscale=auto
516 _libavcodec_internals=no
517 _libswscale_internals=no
518 _mencoder=yes
519 _mplayer=yes
520 _x11=auto
521 _xshape=auto
522 _xss=auto
523 _dga1=auto
524 _dga2=auto
525 _xv=auto
526 _xvmc=no #auto when complete
527 _vdpau=auto
528 _sdl=auto
529 _kva=auto
530 _direct3d=auto
531 _directx=auto
532 _win32waveout=auto
533 _nas=auto
534 _png=auto
535 _mng=auto
536 _jpeg=auto
537 _pnm=yes
538 _md5sum=yes
539 _yuv4mpeg=yes
540 _gif=auto
541 _gl=auto
542 matrixview=yes
543 _ggi=auto
544 _ggiwmh=auto
545 _aa=auto
546 _caca=auto
547 _svga=auto
548 _vesa=auto
549 _fbdev=auto
550 _dvb=auto
551 _dvbhead=auto
552 _dxr2=auto
553 _dxr3=auto
554 _ivtv=auto
555 _v4l2=auto
556 _iconv=auto
557 _langinfo=auto
558 _rtc=auto
559 _ossaudio=auto
560 _arts=auto
561 _esd=auto
562 _pulse=auto
563 _jack=auto
564 _dart=auto
565 _openal=no
566 _libcdio=auto
567 _liblzo=auto
568 _mad=auto
569 _mp3lame=auto
570 _toolame=auto
571 _twolame=auto
572 _tremor=auto
573 _tremor_internal=yes
574 _tremor_low=no
575 _libvorbis=auto
576 _speex=auto
577 _theora=auto
578 _mp3lib=auto
579 _liba52=auto
580 _liba52_internal=no
581 _libdca=auto
582 _libmpeg2=auto
583 _faad=auto
584 _faad_internal=auto
585 _faad_fixed=no
586 _faac=auto
587 _ladspa=auto
588 _libbs2b=auto
589 _xmms=no
590 _vcd=auto
591 _dvdnav=auto
592 _dvdnavconfig=dvdnav-config
593 _dvdreadconfig=dvdread-config
594 _dvdread=auto
595 _dvdread_internal=auto
596 _libdvdcss_internal=auto
597 _xanim=auto
598 _real=auto
599 _live=auto
600 _nemesi=auto
601 _native_rtsp=yes
602 _xinerama=auto
603 _mga=auto
604 _xmga=auto
605 _vm=auto
606 _xf86keysym=auto
607 _mlib=no #broken, thus disabled
608 _sgiaudio=auto
609 _sunaudio=auto
610 _alsa=auto
611 _fastmemcpy=yes
612 _unrar_exec=auto
613 _win32dll=auto
614 _select=yes
615 _radio=no
616 _radio_capture=no
617 _radio_v4l=auto
618 _radio_v4l2=auto
619 _radio_bsdbt848=auto
620 _tv=yes
621 _tv_v4l1=auto
622 _tv_v4l2=auto
623 _tv_bsdbt848=auto
624 _tv_dshow=auto
625 _pvr=auto
626 _network=yes
627 _winsock2_h=auto
628 _smb=auto
629 _vidix=auto
630 _vidix_pcidb=yes
631 _dhahelper=no
632 _svgalib_helper=no
633 _joystick=no
634 _xvid=auto
635 _x264=auto
636 _libnut=auto
637 _lirc=auto
638 _lircc=auto
639 _apple_remote=auto
640 _apple_ir=auto
641 _gui=no
642 _gtk1=no
643 _termcap=auto
644 _termios=auto
645 _3dfx=no
646 _s3fb=no
647 _wii=no
648 _tdfxfb=no
649 _tdfxvid=no
650 _xvr100=auto
651 _tga=yes
652 _directfb=auto
653 _zr=auto
654 _bl=no
655 _largefiles=yes
656 #language=en
657 _shm=auto
658 _linux_devfs=no
659 _charset="UTF-8"
660 _dynamic_plugins=no
661 _crash_debug=no
662 _sighandler=yes
663 _libdv=auto
664 _cdparanoia=auto
665 _cddb=auto
666 _big_endian=auto
667 _bitmap_font=yes
668 _freetype=auto
669 _fontconfig=auto
670 _menu=no
671 _qtx=auto
672 _maemo=auto
673 _coreaudio=auto
674 _corevideo=auto
675 _quartz=auto
676 quicktime=auto
677 _macosx_finder=no
678 _macosx_bundle=auto
679 _sortsub=yes
680 _freetypeconfig='freetype-config'
681 _fribidi=auto
682 _fribidiconfig='fribidi-config'
683 _enca=auto
684 _inet6=auto
685 _gethostbyname2=auto
686 _ftp=yes
687 _musepack=auto
688 _vstream=auto
689 _pthreads=auto
690 _w32threads=auto
691 _ass=auto
692 _rpath=no
693 _asmalign_pot=auto
694 _stream_cache=yes
695 _priority=no
696 def_dos_paths="#define HAVE_DOS_PATHS 0"
697 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
698 def_priority="#undef CONFIG_PRIORITY"
699 def_pthread_cache="#undef PTHREAD_CACHE"
700 _need_shmem=yes
701 for ac_option do
702 case "$ac_option" in
703 --help|-help|-h)
704 show_help
706 --prefix=*)
707 _prefix=$(echo $ac_option | cut -d '=' -f 2)
709 --bindir=*)
710 _bindir=$(echo $ac_option | cut -d '=' -f 2)
712 --datadir=*)
713 _datadir=$(echo $ac_option | cut -d '=' -f 2)
715 --mandir=*)
716 _mandir=$(echo $ac_option | cut -d '=' -f 2)
718 --confdir=*)
719 _confdir=$(echo $ac_option | cut -d '=' -f 2)
721 --libdir=*)
722 _libdir=$(echo $ac_option | cut -d '=' -f 2)
724 --codecsdir=*)
725 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
727 --win32codecsdir=*)
728 _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2)
730 --xanimcodecsdir=*)
731 _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
733 --realcodecsdir=*)
734 _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
737 --with-install=*)
738 _install=$(echo $ac_option | cut -d '=' -f 2 )
740 --with-xvmclib=*)
741 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
744 --with-sdl-config=*)
745 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
747 --with-freetype-config=*)
748 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
750 --with-fribidi-config=*)
751 _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2)
753 --with-gtk-config=*)
754 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
756 --with-glib-config=*)
757 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
759 --with-dvdnav-config=*)
760 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
762 --with-dvdread-config=*)
763 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
766 --extra-cflags=*)
767 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
769 --extra-ldflags=*)
770 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
772 --extra-libs=*)
773 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
775 --extra-libs-mplayer=*)
776 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
778 --extra-libs-mencoder=*)
779 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
782 --target=*)
783 _target=$(echo $ac_option | cut -d '=' -f 2)
785 --cc=*)
786 _cc=$(echo $ac_option | cut -d '=' -f 2)
788 --host-cc=*)
789 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
791 --as=*)
792 _as=$(echo $ac_option | cut -d '=' -f 2)
794 --nm=*)
795 _nm=$(echo $ac_option | cut -d '=' -f 2)
797 --yasm=*)
798 _yasm=$(echo $ac_option | cut -d '=' -f 2)
800 --ar=*)
801 _ar=$(echo $ac_option | cut -d '=' -f 2)
803 --ranlib=*)
804 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
806 --windres=*)
807 _windres=$(echo $ac_option | cut -d '=' -f 2)
809 --charset=*)
810 _charset=$(echo $ac_option | cut -d '=' -f 2)
812 --language-doc=*)
813 language_doc=$(echo $ac_option | cut -d '=' -f 2)
815 --language-man=*)
816 language_man=$(echo $ac_option | cut -d '=' -f 2)
818 --language-msg=*)
819 language_msg=$(echo $ac_option | cut -d '=' -f 2)
821 --language=*)
822 language=$(echo $ac_option | cut -d '=' -f 2)
825 --enable-static)
826 _ld_static='-static'
828 --disable-static)
829 _ld_static=''
831 --enable-profile)
832 _profile='-p'
834 --disable-profile)
835 _profile=
837 --enable-debug)
838 _debug='-g'
840 --enable-debug=*)
841 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
843 --disable-debug)
844 _debug=
846 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
847 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
848 --enable-cross-compile) _cross_compile=yes ;;
849 --disable-cross-compile) _cross_compile=no ;;
850 --enable-mencoder) _mencoder=yes ;;
851 --disable-mencoder) _mencoder=no ;;
852 --enable-mplayer) _mplayer=yes ;;
853 --disable-mplayer) _mplayer=no ;;
854 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
855 --disable-dynamic-plugins) _dynamic_plugins=no ;;
856 --enable-x11) _x11=yes ;;
857 --disable-x11) _x11=no ;;
858 --enable-xshape) _xshape=yes ;;
859 --disable-xshape) _xshape=no ;;
860 --enable-xss) _xss=yes ;;
861 --disable-xss) _xss=no ;;
862 --enable-xv) _xv=yes ;;
863 --disable-xv) _xv=no ;;
864 --enable-xvmc) _xvmc=yes ;;
865 --disable-xvmc) _xvmc=no ;;
866 --enable-vdpau) _vdpau=yes ;;
867 --disable-vdpau) _vdpau=no ;;
868 --enable-sdl) _sdl=yes ;;
869 --disable-sdl) _sdl=no ;;
870 --enable-kva) _kva=yes ;;
871 --disable-kva) _kva=no ;;
872 --enable-direct3d) _direct3d=yes ;;
873 --disable-direct3d) _direct3d=no ;;
874 --enable-directx) _directx=yes ;;
875 --disable-directx) _directx=no ;;
876 --enable-win32waveout) _win32waveout=yes ;;
877 --disable-win32waveout) _win32waveout=no ;;
878 --enable-nas) _nas=yes ;;
879 --disable-nas) _nas=no ;;
880 --enable-png) _png=yes ;;
881 --disable-png) _png=no ;;
882 --enable-mng) _mng=yes ;;
883 --disable-mng) _mng=no ;;
884 --enable-jpeg) _jpeg=yes ;;
885 --disable-jpeg) _jpeg=no ;;
886 --enable-pnm) _pnm=yes ;;
887 --disable-pnm) _pnm=no ;;
888 --enable-md5sum) _md5sum=yes ;;
889 --disable-md5sum) _md5sum=no ;;
890 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
891 --disable-yuv4mpeg) _yuv4mpeg=no ;;
892 --enable-gif) _gif=yes ;;
893 --disable-gif) _gif=no ;;
894 --enable-gl) _gl=yes ;;
895 --disable-gl) _gl=no ;;
896 --enable-matrixview) matrixview=yes ;;
897 --disable-matrixview) matrixview=no ;;
898 --enable-ggi) _ggi=yes ;;
899 --disable-ggi) _ggi=no ;;
900 --enable-ggiwmh) _ggiwmh=yes ;;
901 --disable-ggiwmh) _ggiwmh=no ;;
902 --enable-aa) _aa=yes ;;
903 --disable-aa) _aa=no ;;
904 --enable-caca) _caca=yes ;;
905 --disable-caca) _caca=no ;;
906 --enable-svga) _svga=yes ;;
907 --disable-svga) _svga=no ;;
908 --enable-vesa) _vesa=yes ;;
909 --disable-vesa) _vesa=no ;;
910 --enable-fbdev) _fbdev=yes ;;
911 --disable-fbdev) _fbdev=no ;;
912 --enable-dvb) _dvb=yes ;;
913 --disable-dvb) _dvb=no ;;
914 --enable-dvbhead) _dvbhead=yes ;;
915 --disable-dvbhead) _dvbhead=no ;;
916 --enable-dxr2) _dxr2=yes ;;
917 --disable-dxr2) _dxr2=no ;;
918 --enable-dxr3) _dxr3=yes ;;
919 --disable-dxr3) _dxr3=no ;;
920 --enable-ivtv) _ivtv=yes ;;
921 --disable-ivtv) _ivtv=no ;;
922 --enable-v4l2) _v4l2=yes ;;
923 --disable-v4l2) _v4l2=no ;;
924 --enable-iconv) _iconv=yes ;;
925 --disable-iconv) _iconv=no ;;
926 --enable-langinfo) _langinfo=yes ;;
927 --disable-langinfo) _langinfo=no ;;
928 --enable-rtc) _rtc=yes ;;
929 --disable-rtc) _rtc=no ;;
930 --enable-libdv) _libdv=yes ;;
931 --disable-libdv) _libdv=no ;;
932 --enable-ossaudio) _ossaudio=yes ;;
933 --disable-ossaudio) _ossaudio=no ;;
934 --enable-arts) _arts=yes ;;
935 --disable-arts) _arts=no ;;
936 --enable-esd) _esd=yes ;;
937 --disable-esd) _esd=no ;;
938 --enable-pulse) _pulse=yes ;;
939 --disable-pulse) _pulse=no ;;
940 --enable-jack) _jack=yes ;;
941 --disable-jack) _jack=no ;;
942 --enable-openal) _openal=yes ;;
943 --disable-openal) _openal=no ;;
944 --enable-dart) _dart=yes ;;
945 --disable-dart) _dart=no ;;
946 --enable-mad) _mad=yes ;;
947 --disable-mad) _mad=no ;;
948 --enable-mp3lame) _mp3lame=yes ;;
949 --disable-mp3lame) _mp3lame=no ;;
950 --enable-toolame) _toolame=yes ;;
951 --disable-toolame) _toolame=no ;;
952 --enable-twolame) _twolame=yes ;;
953 --disable-twolame) _twolame=no ;;
954 --enable-libcdio) _libcdio=yes ;;
955 --disable-libcdio) _libcdio=no ;;
956 --enable-liblzo) _liblzo=yes ;;
957 --disable-liblzo) _liblzo=no ;;
958 --enable-libvorbis) _libvorbis=yes ;;
959 --disable-libvorbis) _libvorbis=no ;;
960 --enable-speex) _speex=yes ;;
961 --disable-speex) _speex=no ;;
962 --enable-tremor) _tremor=yes ;;
963 --disable-tremor) _tremor=no ;;
964 --enable-tremor-internal) _tremor_internal=yes ;;
965 --disable-tremor-internal) _tremor_internal=no ;;
966 --enable-tremor-low) _tremor_low=yes ;;
967 --disable-tremor-low) _tremor_low=no ;;
968 --enable-theora) _theora=yes ;;
969 --disable-theora) _theora=no ;;
970 --enable-mp3lib) _mp3lib=yes ;;
971 --disable-mp3lib) _mp3lib=no ;;
972 --enable-liba52-internal) _liba52_internal=yes ;;
973 --disable-liba52-internal) _liba52_internal=no ;;
974 --enable-liba52) _liba52=yes ;;
975 --disable-liba52) _liba52=no ;;
976 --enable-libdca) _libdca=yes ;;
977 --disable-libdca) _libdca=no ;;
978 --enable-libmpeg2) _libmpeg2=yes ;;
979 --disable-libmpeg2) _libmpeg2=no ;;
980 --enable-musepack) _musepack=yes ;;
981 --disable-musepack) _musepack=no ;;
982 --enable-faad) _faad=yes ;;
983 --disable-faad) _faad=no ;;
984 --enable-faad-internal) _faad_internal=yes ;;
985 --disable-faad-internal) _faad_internal=no ;;
986 --enable-faad-fixed) _faad_fixed=yes ;;
987 --disable-faad-fixed) _faad_fixed=no ;;
988 --enable-faac) _faac=yes ;;
989 --disable-faac) _faac=no ;;
990 --enable-ladspa) _ladspa=yes ;;
991 --disable-ladspa) _ladspa=no ;;
992 --enable-libbs2b) _libbs2b=yes ;;
993 --disable-libbs2b) _libbs2b=no ;;
994 --enable-xmms) _xmms=yes ;;
995 --disable-xmms) _xmms=no ;;
996 --enable-vcd) _vcd=yes ;;
997 --disable-vcd) _vcd=no ;;
998 --enable-dvdread) _dvdread=yes ;;
999 --disable-dvdread) _dvdread=no ;;
1000 --enable-dvdread-internal) _dvdread_internal=yes ;;
1001 --disable-dvdread-internal) _dvdread_internal=no ;;
1002 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1003 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1004 --enable-dvdnav) _dvdnav=yes ;;
1005 --disable-dvdnav) _dvdnav=no ;;
1006 --enable-xanim) _xanim=yes ;;
1007 --disable-xanim) _xanim=no ;;
1008 --enable-real) _real=yes ;;
1009 --disable-real) _real=no ;;
1010 --enable-live) _live=yes ;;
1011 --disable-live) _live=no ;;
1012 --enable-nemesi) _nemesi=yes ;;
1013 --disable-nemesi) _nemesi=no ;;
1014 --enable-xinerama) _xinerama=yes ;;
1015 --disable-xinerama) _xinerama=no ;;
1016 --enable-mga) _mga=yes ;;
1017 --disable-mga) _mga=no ;;
1018 --enable-xmga) _xmga=yes ;;
1019 --disable-xmga) _xmga=no ;;
1020 --enable-vm) _vm=yes ;;
1021 --disable-vm) _vm=no ;;
1022 --enable-xf86keysym) _xf86keysym=yes ;;
1023 --disable-xf86keysym) _xf86keysym=no ;;
1024 --enable-mlib) _mlib=yes ;;
1025 --disable-mlib) _mlib=no ;;
1026 --enable-sunaudio) _sunaudio=yes ;;
1027 --disable-sunaudio) _sunaudio=no ;;
1028 --enable-sgiaudio) _sgiaudio=yes ;;
1029 --disable-sgiaudio) _sgiaudio=no ;;
1030 --enable-alsa) _alsa=yes ;;
1031 --disable-alsa) _alsa=no ;;
1032 --enable-tv) _tv=yes ;;
1033 --disable-tv) _tv=no ;;
1034 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1035 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1036 --enable-tv-v4l1) _tv_v4l1=yes ;;
1037 --disable-tv-v4l1) _tv_v4l1=no ;;
1038 --enable-tv-v4l2) _tv_v4l2=yes ;;
1039 --disable-tv-v4l2) _tv_v4l2=no ;;
1040 --enable-tv-dshow) _tv_dshow=yes ;;
1041 --disable-tv-dshow) _tv_dshow=no ;;
1042 --enable-radio) _radio=yes ;;
1043 --enable-radio-capture) _radio_capture=yes ;;
1044 --disable-radio-capture) _radio_capture=no ;;
1045 --disable-radio) _radio=no ;;
1046 --enable-radio-v4l) _radio_v4l=yes ;;
1047 --disable-radio-v4l) _radio_v4l=no ;;
1048 --enable-radio-v4l2) _radio_v4l2=yes ;;
1049 --disable-radio-v4l2) _radio_v4l2=no ;;
1050 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1051 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1052 --enable-pvr) _pvr=yes ;;
1053 --disable-pvr) _pvr=no ;;
1054 --enable-fastmemcpy) _fastmemcpy=yes ;;
1055 --disable-fastmemcpy) _fastmemcpy=no ;;
1056 --enable-network) _network=yes ;;
1057 --disable-network) _network=no ;;
1058 --enable-winsock2_h) _winsock2_h=yes ;;
1059 --disable-winsock2_h) _winsock2_h=no ;;
1060 --enable-smb) _smb=yes ;;
1061 --disable-smb) _smb=no ;;
1062 --enable-vidix) _vidix=yes ;;
1063 --disable-vidix) _vidix=no ;;
1064 --with-vidix-drivers=*)
1065 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1067 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1068 --enable-dhahelper) _dhahelper=yes ;;
1069 --disable-dhahelper) _dhahelper=no ;;
1070 --enable-svgalib_helper) _svgalib_helper=yes ;;
1071 --disable-svgalib_helper) _svgalib_helper=no ;;
1072 --enable-joystick) _joystick=yes ;;
1073 --disable-joystick) _joystick=no ;;
1074 --enable-xvid) _xvid=yes ;;
1075 --disable-xvid) _xvid=no ;;
1076 --enable-x264) _x264=yes ;;
1077 --disable-x264) _x264=no ;;
1078 --enable-libnut) _libnut=yes ;;
1079 --disable-libnut) _libnut=no ;;
1080 --enable-libavutil) _libavutil=yes ;;
1081 --disable-libavutil) _libavutil=no ;;
1082 --enable-libavcodec) _libavcodec=yes ;;
1083 --disable-libavcodec) _libavcodec=no ;;
1084 --enable-libavformat) _libavformat=yes ;;
1085 --disable-libavformat) _libavformat=no ;;
1086 --enable-libpostproc) _libpostproc=yes ;;
1087 --disable-libpostproc) _libpostproc=no ;;
1088 --enable-libswscale) _libswscale=yes ;;
1089 --disable-libswscale) _libswscale=no ;;
1090 --ffmpeg-source-dir=*)
1091 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1093 --enable-lirc) _lirc=yes ;;
1094 --disable-lirc) _lirc=no ;;
1095 --enable-lircc) _lircc=yes ;;
1096 --disable-lircc) _lircc=no ;;
1097 --enable-apple-remote) _apple_remote=yes ;;
1098 --disable-apple-remote) _apple_remote=no ;;
1099 --enable-apple-ir) _apple_ir=yes ;;
1100 --disable-apple-ir) _apple_ir=no ;;
1101 --enable-gui) _gui=yes ;;
1102 --disable-gui) _gui=no ;;
1103 --enable-gtk1) _gtk1=yes ;;
1104 --disable-gtk1) _gtk1=no ;;
1105 --enable-termcap) _termcap=yes ;;
1106 --disable-termcap) _termcap=no ;;
1107 --enable-termios) _termios=yes ;;
1108 --disable-termios) _termios=no ;;
1109 --enable-3dfx) _3dfx=yes ;;
1110 --disable-3dfx) _3dfx=no ;;
1111 --enable-s3fb) _s3fb=yes ;;
1112 --disable-s3fb) _s3fb=no ;;
1113 --enable-wii) _wii=yes ;;
1114 --disable-wii) _wii=no ;;
1115 --enable-tdfxfb) _tdfxfb=yes ;;
1116 --disable-tdfxfb) _tdfxfb=no ;;
1117 --disable-tdfxvid) _tdfxvid=no ;;
1118 --enable-tdfxvid) _tdfxvid=yes ;;
1119 --disable-xvr100) _xvr100=no ;;
1120 --enable-xvr100) _xvr100=yes ;;
1121 --disable-tga) _tga=no ;;
1122 --enable-tga) _tga=yes ;;
1123 --enable-directfb) _directfb=yes ;;
1124 --disable-directfb) _directfb=no ;;
1125 --enable-zr) _zr=yes ;;
1126 --disable-zr) _zr=no ;;
1127 --enable-bl) _bl=yes ;;
1128 --disable-bl) _bl=no ;;
1129 --enable-mtrr) _mtrr=yes ;;
1130 --disable-mtrr) _mtrr=no ;;
1131 --enable-largefiles) _largefiles=yes ;;
1132 --disable-largefiles) _largefiles=no ;;
1133 --enable-shm) _shm=yes ;;
1134 --disable-shm) _shm=no ;;
1135 --enable-select) _select=yes ;;
1136 --disable-select) _select=no ;;
1137 --enable-linux-devfs) _linux_devfs=yes ;;
1138 --disable-linux-devfs) _linux_devfs=no ;;
1139 --enable-cdparanoia) _cdparanoia=yes ;;
1140 --disable-cdparanoia) _cdparanoia=no ;;
1141 --enable-cddb) _cddb=yes ;;
1142 --disable-cddb) _cddb=no ;;
1143 --enable-big-endian) _big_endian=yes ;;
1144 --disable-big-endian) _big_endian=no ;;
1145 --enable-bitmap-font) _bitmap_font=yes ;;
1146 --disable-bitmap-font) _bitmap_font=no ;;
1147 --enable-freetype) _freetype=yes ;;
1148 --disable-freetype) _freetype=no ;;
1149 --enable-fontconfig) _fontconfig=yes ;;
1150 --disable-fontconfig) _fontconfig=no ;;
1151 --enable-unrarexec) _unrar_exec=yes ;;
1152 --disable-unrarexec) _unrar_exec=no ;;
1153 --enable-ftp) _ftp=yes ;;
1154 --disable-ftp) _ftp=no ;;
1155 --enable-vstream) _vstream=yes ;;
1156 --disable-vstream) _vstream=no ;;
1157 --enable-pthreads) _pthreads=yes ;;
1158 --disable-pthreads) _pthreads=no ;;
1159 --enable-w32threads) _w32threads=yes ;;
1160 --disable-w32threads) _w32threads=no ;;
1161 --enable-ass) _ass=yes ;;
1162 --disable-ass) _ass=no ;;
1163 --enable-rpath) _rpath=yes ;;
1164 --disable-rpath) _rpath=no ;;
1166 --enable-fribidi) _fribidi=yes ;;
1167 --disable-fribidi) _fribidi=no ;;
1169 --enable-enca) _enca=yes ;;
1170 --disable-enca) _enca=no ;;
1172 --enable-inet6) _inet6=yes ;;
1173 --disable-inet6) _inet6=no ;;
1175 --enable-gethostbyname2) _gethostbyname2=yes ;;
1176 --disable-gethostbyname2) _gethostbyname2=no ;;
1178 --enable-dga1) _dga1=yes ;;
1179 --disable-dga1) _dga1=no ;;
1180 --enable-dga2) _dga2=yes ;;
1181 --disable-dga2) _dga2=no ;;
1183 --enable-menu) _menu=yes ;;
1184 --disable-menu) _menu=no ;;
1186 --enable-qtx) _qtx=yes ;;
1187 --disable-qtx) _qtx=no ;;
1189 --enable-coreaudio) _coreaudio=yes ;;
1190 --disable-coreaudio) _coreaudio=no ;;
1191 --enable-corevideo) _corevideo=yes ;;
1192 --disable-corevideo) _corevideo=no ;;
1193 --enable-quartz) _quartz=yes ;;
1194 --disable-quartz) _quartz=no ;;
1195 --enable-macosx-finder) _macosx_finder=yes ;;
1196 --disable-macosx-finder) _macosx_finder=no ;;
1197 --enable-macosx-bundle) _macosx_bundle=yes ;;
1198 --disable-macosx-bundle) _macosx_bundle=no ;;
1200 --enable-maemo) _maemo=yes ;;
1201 --disable-maemo) _maemo=no ;;
1203 --enable-sortsub) _sortsub=yes ;;
1204 --disable-sortsub) _sortsub=no ;;
1206 --enable-crash-debug) _crash_debug=yes ;;
1207 --disable-crash-debug) _crash_debug=no ;;
1208 --enable-sighandler) _sighandler=yes ;;
1209 --disable-sighandler) _sighandler=no ;;
1210 --enable-win32dll) _win32dll=yes ;;
1211 --disable-win32dll) _win32dll=no ;;
1213 --enable-sse) _sse=yes ;;
1214 --disable-sse) _sse=no ;;
1215 --enable-sse2) _sse2=yes ;;
1216 --disable-sse2) _sse2=no ;;
1217 --enable-ssse3) _ssse3=yes ;;
1218 --disable-ssse3) _ssse3=no ;;
1219 --enable-mmxext) _mmxext=yes ;;
1220 --disable-mmxext) _mmxext=no ;;
1221 --enable-3dnow) _3dnow=yes ;;
1222 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1223 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1224 --disable-3dnowext) _3dnowext=no ;;
1225 --enable-cmov) _cmov=yes ;;
1226 --disable-cmov) _cmov=no ;;
1227 --enable-fast-cmov) _fast_cmov=yes ;;
1228 --disable-fast-cmov) _fast_cmov=no ;;
1229 --enable-fast-clz) _fast_clz=yes ;;
1230 --disable-fast-clz) _fast_clz=no ;;
1231 --enable-altivec) _altivec=yes ;;
1232 --disable-altivec) _altivec=no ;;
1233 --enable-armv5te) _armv5te=yes ;;
1234 --disable-armv5te) _armv5te=no ;;
1235 --enable-armv6) _armv6=yes ;;
1236 --disable-armv6) _armv6=no ;;
1237 --enable-armv6t2) _armv6t2=yes ;;
1238 --disable-armv6t2) _armv6t2=no ;;
1239 --enable-armvfp) _armvfp=yes ;;
1240 --disable-armvfp) _armvfp=no ;;
1241 --enable-neon) neon=yes ;;
1242 --disable-neon) neon=no ;;
1243 --enable-iwmmxt) _iwmmxt=yes ;;
1244 --disable-iwmmxt) _iwmmxt=no ;;
1245 --enable-mmx) _mmx=yes ;;
1246 --disable-mmx) # 3Dnow! and MMX2 require MMX
1247 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1250 echo "Unknown parameter: $ac_option"
1251 exit 1
1254 esac
1255 done
1257 if test "$_gui" = yes ; then
1258 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1259 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1262 # Atmos: moved this here, to be correct, if --prefix is specified
1263 test -z "$_bindir" && _bindir="$_prefix/bin"
1264 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1265 test -z "$_mandir" && _mandir="$_prefix/share/man"
1266 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1267 test -z "$_libdir" && _libdir="$_prefix/lib"
1269 # Determine our OS name and CPU architecture
1270 if test -z "$_target" ; then
1271 # OS name
1272 system_name=$(uname -s 2>&1)
1273 case "$system_name" in
1274 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1276 Haiku)
1277 system_name=BeOS
1279 IRIX*)
1280 system_name=IRIX
1282 GNU/kFreeBSD)
1283 system_name=FreeBSD
1285 HP-UX*)
1286 system_name=HP-UX
1288 [cC][yY][gG][wW][iI][nN]*)
1289 system_name=CYGWIN
1291 MINGW32*)
1292 system_name=MINGW32
1294 OS/2*)
1295 system_name=OS/2
1298 system_name="$system_name-UNKNOWN"
1300 esac
1303 # host's CPU/instruction set
1304 host_arch=$(uname -p 2>&1)
1305 case "$host_arch" in
1306 i386|sparc|ppc|alpha|arm|mips|vax)
1308 powerpc) # Darwin returns 'powerpc'
1309 host_arch=ppc
1311 *) # uname -p on Linux returns 'unknown' for the processor type,
1312 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1314 # Maybe uname -m (machine hardware name) returns something we
1315 # recognize.
1317 # x86/x86pc is used by QNX
1318 case "$(uname -m 2>&1)" in
1319 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 ;;
1320 ia64) host_arch=ia64 ;;
1321 macppc|ppc) host_arch=ppc ;;
1322 ppc64) host_arch=ppc64 ;;
1323 alpha) host_arch=alpha ;;
1324 sparc) host_arch=sparc ;;
1325 sparc64) host_arch=sparc64 ;;
1326 parisc*|hppa*|9000*) host_arch=hppa ;;
1327 arm*|zaurus|cats) host_arch=arm ;;
1328 sh3|sh4|sh4a) host_arch=sh ;;
1329 s390) host_arch=s390 ;;
1330 s390x) host_arch=s390x ;;
1331 *mips*) host_arch=mips ;;
1332 vax) host_arch=vax ;;
1333 xtensa*) host_arch=xtensa ;;
1334 *) host_arch=UNKNOWN ;;
1335 esac
1337 esac
1338 else # if test -z "$_target"
1339 system_name=$(echo $_target | cut -d '-' -f 2)
1340 case "$(echo $system_name | tr A-Z a-z)" in
1341 linux) system_name=Linux ;;
1342 freebsd) system_name=FreeBSD ;;
1343 gnu/kfreebsd) system_name=FreeBSD ;;
1344 netbsd) system_name=NetBSD ;;
1345 bsd/os) system_name=BSD/OS ;;
1346 openbsd) system_name=OpenBSD ;;
1347 dragonfly) system_name=DragonFly ;;
1348 sunos) system_name=SunOS ;;
1349 qnx) system_name=QNX ;;
1350 morphos) system_name=MorphOS ;;
1351 amigaos) system_name=AmigaOS ;;
1352 mingw32*) system_name=MINGW32 ;;
1353 esac
1354 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1355 host_arch=$(echo $_target | cut -d '-' -f 1)
1356 if test $(echo $host_arch) != "x86_64" ; then
1357 host_arch=$(echo $host_arch | tr '_' '-')
1361 extra_cflags="-I. $extra_cflags"
1362 _timer=timer-linux.c
1363 _getch=getch2.c
1364 if freebsd ; then
1365 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1366 extra_cflags="$extra_cflags -I/usr/local/include"
1369 if netbsd || dragonfly ; then
1370 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1371 extra_cflags="$extra_cflags -I/usr/pkg/include"
1374 if darwin; then
1375 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1376 _timer=timer-darwin.c
1379 if aix ; then
1380 extra_ldflags="$extra_ldflags -lC"
1383 if irix ; then
1384 _ranlib='ar -r'
1385 elif linux ; then
1386 _ranlib='true'
1389 if win32 ; then
1390 _exesuf=".exe"
1391 extra_cflags="$extra_cflags -fno-common"
1392 # -lwinmm is always needed for osdep/timer-win2.c
1393 extra_ldflags="$extra_ldflags -lwinmm"
1394 _pe_executable=yes
1395 _timer=timer-win2.c
1396 _priority=yes
1397 def_dos_paths="#define HAVE_DOS_PATHS 1"
1398 def_priority="#define CONFIG_PRIORITY 1"
1401 if mingw32 ; then
1402 _getch=getch2-win.c
1403 _need_shmem=no
1406 if amigaos ; then
1407 _select=no
1408 _sighandler=no
1409 _stream_cache=no
1410 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1411 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1414 if qnx ; then
1415 extra_ldflags="$extra_ldflags -lph"
1418 if os2 ; then
1419 _exesuf=".exe"
1420 _getch=getch2-os2.c
1421 _need_shmem=no
1422 _priority=yes
1423 def_dos_paths="#define HAVE_DOS_PATHS 1"
1424 def_priority="#define CONFIG_PRIORITY 1"
1427 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1428 test "$I" && break
1429 done
1432 TMPLOG="configure.log"
1433 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1434 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1435 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1436 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1437 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1439 rm -f "$TMPLOG"
1440 echo configuration: $_configuration > "$TMPLOG"
1441 echo >> "$TMPLOG"
1444 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1445 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1449 # Checking CC version...
1450 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1451 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1452 echocheck "$_cc version"
1453 cc_vendor=intel
1454 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1455 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1456 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1457 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1458 # TODO verify older icc/ecc compatibility
1459 case $cc_version in
1461 cc_version="v. ?.??, bad"
1462 cc_fail=yes
1464 10.1|11.0|11.1)
1465 cc_version="$cc_version, ok"
1468 cc_version="$cc_version, bad"
1469 cc_fail=yes
1471 esac
1472 echores "$cc_version"
1473 else
1474 for _cc in "$_cc" gcc cc ; do
1475 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1476 if test "$cc_name_tmp" = "gcc"; then
1477 cc_name=$cc_name_tmp
1478 echocheck "$_cc version"
1479 cc_vendor=gnu
1480 cc_version=$($_cc -dumpversion 2>&1)
1481 case $cc_version in
1482 2.96*)
1483 cc_fail=yes
1486 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1487 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1488 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1490 esac
1491 echores "$cc_version"
1492 break
1494 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1495 if test "$cc_name_tmp" = "Sun C"; then
1496 echocheck "$_cc version"
1497 cc_vendor=sun
1498 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1499 _res_comment="experimental support only"
1500 echores "Sun C $cc_version"
1501 break
1503 done
1504 fi # icc
1505 test "$cc_fail" = yes && die "unsupported compiler version"
1507 if test -z "$_target" && x86 ; then
1508 cat > $TMPC << EOF
1509 int main(void) {
1510 int test[(int)sizeof(char *)-7];
1511 return 0;
1514 cc_check && host_arch=x86_64 || host_arch=i386
1517 echo "Detected operating system: $system_name"
1518 echo "Detected host architecture: $host_arch"
1520 echocheck "host cc"
1521 test "$_host_cc" || _host_cc=$_cc
1522 echores $_host_cc
1524 echocheck "cross compilation"
1525 if test $_cross_compile = auto ; then
1526 cat > $TMPC << EOF
1527 int main(void) { return 0; }
1529 _cross_compile=yes
1530 cc_check && "$TMPEXE" && _cross_compile=no
1532 echores $_cross_compile
1534 if test $_cross_compile = yes; then
1535 tmp_run() {
1536 return 0
1540 # ---
1542 # now that we know what compiler should be used for compilation, try to find
1543 # out which assembler is used by the $_cc compiler
1544 if test "$_as" = auto ; then
1545 _as=$($_cc -print-prog-name=as)
1546 test -z "$_as" && _as=as
1549 if test "$_nm" = auto ; then
1550 _nm=$($_cc -print-prog-name=nm)
1551 test -z "$_nm" && _nm=nm
1554 # XXX: this should be ok..
1555 _cpuinfo="echo"
1557 if test "$_runtime_cpudetection" = no ; then
1559 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1560 # FIXME: Remove the cygwin check once AMD CPUs are supported
1561 if test -r /proc/cpuinfo && ! cygwin; then
1562 # Linux with /proc mounted, extract CPU information from it
1563 _cpuinfo="cat /proc/cpuinfo"
1564 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1565 # FreeBSD with Linux emulation /proc mounted,
1566 # extract CPU information from it
1567 # Don't use it on x86 though, it never reports 3Dnow
1568 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1569 elif darwin && ! x86 ; then
1570 # use hostinfo on Darwin
1571 _cpuinfo="hostinfo"
1572 elif aix; then
1573 # use 'lsattr' on AIX
1574 _cpuinfo="lsattr -E -l proc0 -a type"
1575 elif x86; then
1576 # all other OSes try to extract CPU information from a small helper
1577 # program cpuinfo instead
1578 $_cc -o cpuinfo$_exesuf cpuinfo.c
1579 _cpuinfo="./cpuinfo$_exesuf"
1582 if x86 ; then
1583 # gather more CPU information
1584 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1585 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1586 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1587 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1588 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1590 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1592 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1593 -e s/xmm/sse/ -e s/kni/sse/)
1595 for ext in $pparam ; do
1596 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1597 done
1599 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1600 test $_sse = kernel_check && _mmxext=kernel_check
1602 echocheck "CPU vendor"
1603 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1605 echocheck "CPU type"
1606 echores "$pname"
1609 fi # test "$_runtime_cpudetection" = no
1611 if x86 && test "$_runtime_cpudetection" = no ; then
1612 extcheck() {
1613 if test "$1" = kernel_check ; then
1614 echocheck "kernel support of $2"
1615 cat > $TMPC <<EOF
1616 #include <stdlib.h>
1617 #include <signal.h>
1618 void catch() { exit(1); }
1619 int main(void) {
1620 signal(SIGILL, catch);
1621 __asm__ volatile ("$3":::"memory"); return 0;
1625 if cc_check && tmp_run ; then
1626 eval _$2=yes
1627 echores "yes"
1628 _optimizing="$_optimizing $2"
1629 return 0
1630 else
1631 eval _$2=no
1632 echores "failed"
1633 echo "It seems that your kernel does not correctly support $2."
1634 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1635 return 1
1638 return 0
1641 extcheck $_mmx "mmx" "emms"
1642 extcheck $_mmxext "mmxext" "sfence"
1643 extcheck $_3dnow "3dnow" "femms"
1644 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1645 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1646 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1647 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1648 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1650 echocheck "mtrr support"
1651 if test "$_mtrr" = kernel_check ; then
1652 _mtrr="yes"
1653 _optimizing="$_optimizing mtrr"
1655 echores "$_mtrr"
1657 if test "$_gcc3_ext" != ""; then
1658 # if we had to disable sse/sse2 because the active kernel does not
1659 # support this instruction set extension, we also have to tell
1660 # gcc3 to not generate sse/sse2 instructions for normal C code
1661 cat > $TMPC << EOF
1662 int main(void) { return 0; }
1664 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1670 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1671 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1672 _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM AVR32 SH4 PPC PPC64 ALPHA MIPS SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC'
1673 case "$host_arch" in
1674 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1675 _arch='X86 X86_32'
1676 _target_arch="ARCH_X86 = yes"
1677 _target_subarch="ARCH_X86_32 = yes"
1678 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1679 iproc=486
1680 proc=i486
1683 if test "$_runtime_cpudetection" = no ; then
1684 case "$pvendor" in
1685 AuthenticAMD)
1686 case "$pfamily" in
1687 3) proc=i386 iproc=386 ;;
1688 4) proc=i486 iproc=486 ;;
1689 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1690 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1691 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1692 proc=k6-3
1693 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1694 proc=geode
1695 elif test "$pmodel" -ge 8; then
1696 proc=k6-2
1697 elif test "$pmodel" -ge 6; then
1698 proc=k6
1699 else
1700 proc=i586
1703 6) iproc=686
1704 # It's a bit difficult to determine the correct type of Family 6
1705 # AMD CPUs just from their signature. Instead, we check directly
1706 # whether it supports SSE.
1707 if test "$_sse" = yes; then
1708 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1709 proc=athlon-xp
1710 else
1711 # Again, gcc treats athlon and athlon-tbird similarly.
1712 proc=athlon
1715 15) iproc=686
1716 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1717 # caught and remedied in the optimization tests below.
1718 proc=k8
1721 *) proc=amdfam10 iproc=686
1722 test $_fast_clz = "auto" && _fast_clz=yes
1724 esac
1726 GenuineIntel)
1727 case "$pfamily" in
1728 3) proc=i386 iproc=386 ;;
1729 4) proc=i486 iproc=486 ;;
1730 5) iproc=586
1731 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1732 proc=pentium-mmx # 4 is desktop, 8 is mobile
1733 else
1734 proc=i586
1737 6) iproc=686
1738 if test "$pmodel" -ge 15; then
1739 proc=core2
1740 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1741 proc=pentium-m
1742 elif test "$pmodel" -ge 7; then
1743 proc=pentium3
1744 elif test "$pmodel" -ge 3; then
1745 proc=pentium2
1746 else
1747 proc=i686
1749 test $_fast_clz = "auto" && _fast_clz=yes
1751 15) iproc=686
1752 # A nocona in 32-bit mode has no more capabilities than a prescott.
1753 if test "$pmodel" -ge 3; then
1754 proc=prescott
1755 else
1756 proc=pentium4
1757 test $_fast_clz = "auto" && _fast_clz=yes
1759 test $_fast_cmov = "auto" && _fast_cmov=no
1761 *) proc=prescott iproc=686 ;;
1762 esac
1764 CentaurHauls)
1765 case "$pfamily" in
1766 5) iproc=586
1767 if test "$pmodel" -ge 8; then
1768 proc=winchip2
1769 elif test "$pmodel" -ge 4; then
1770 proc=winchip-c6
1771 else
1772 proc=i586
1775 6) iproc=686
1776 if test "$pmodel" -ge 9; then
1777 proc=c3-2
1778 else
1779 proc=c3
1780 iproc=586
1783 *) proc=i686 iproc=i686 ;;
1784 esac
1786 unknown)
1787 case "$pfamily" in
1788 3) proc=i386 iproc=386 ;;
1789 4) proc=i486 iproc=486 ;;
1790 *) proc=i586 iproc=586 ;;
1791 esac
1794 proc=i586 iproc=586 ;;
1795 esac
1796 test $_fast_clz = "auto" && _fast_clz=no
1797 fi # test "$_runtime_cpudetection" = no
1800 # check that gcc supports our CPU, if not, fall back to earlier ones
1801 # LGB: check -mcpu and -march swithing step by step with enabling
1802 # to fall back till 386.
1804 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1806 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1807 cpuopt=-mtune
1808 else
1809 cpuopt=-mcpu
1812 echocheck "GCC & CPU optimization abilities"
1813 cat > $TMPC << EOF
1814 int main(void) { return 0; }
1816 if test "$_runtime_cpudetection" = no ; then
1817 cc_check -march=native && proc=native
1818 if test "$proc" = "k8"; then
1819 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1821 if test "$proc" = "athlon-xp"; then
1822 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1824 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1825 cc_check -march=$proc $cpuopt=$proc || proc=k6
1827 if test "$proc" = "k6" || test "$proc" = "c3"; then
1828 if ! cc_check -march=$proc $cpuopt=$proc; then
1829 if cc_check -march=i586 $cpuopt=i686; then
1830 proc=i586-i686
1831 else
1832 proc=i586
1836 if test "$proc" = "prescott" ; then
1837 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1839 if test "$proc" = "core2" ; then
1840 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1842 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
1843 cc_check -march=$proc $cpuopt=$proc || proc=i686
1845 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1846 cc_check -march=$proc $cpuopt=$proc || proc=i586
1848 if test "$proc" = "i586"; then
1849 cc_check -march=$proc $cpuopt=$proc || proc=i486
1851 if test "$proc" = "i486" ; then
1852 cc_check -march=$proc $cpuopt=$proc || proc=i386
1854 if test "$proc" = "i386" ; then
1855 cc_check -march=$proc $cpuopt=$proc || proc=error
1857 if test "$proc" = "error" ; then
1858 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1859 _mcpu=""
1860 _march=""
1861 _optimizing=""
1862 elif test "$proc" = "i586-i686"; then
1863 _march="-march=i586"
1864 _mcpu="$cpuopt=i686"
1865 _optimizing="$proc"
1866 else
1867 _march="-march=$proc"
1868 _mcpu="$cpuopt=$proc"
1869 _optimizing="$proc"
1871 else # if test "$_runtime_cpudetection" = no
1872 _mcpu="$cpuopt=generic"
1873 # at least i486 required, for bswap instruction
1874 _march="-march=i486"
1875 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1876 cc_check $_mcpu || _mcpu=""
1877 cc_check $_march $_mcpu || _march=""
1880 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1881 ## autodetected mcpu/march parameters
1882 if test "$_target" ; then
1883 # TODO: it may be a good idea to check GCC and fall back in all cases
1884 if test "$host_arch" = "i586-i686"; then
1885 _march="-march=i586"
1886 _mcpu="$cpuopt=i686"
1887 else
1888 _march="-march=$host_arch"
1889 _mcpu="$cpuopt=$host_arch"
1892 proc="$host_arch"
1894 case "$proc" in
1895 i386) iproc=386 ;;
1896 i486) iproc=486 ;;
1897 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1898 i686|athlon*|pentium*) iproc=686 ;;
1899 *) iproc=586 ;;
1900 esac
1903 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1904 _fast_cmov="yes"
1905 else
1906 _fast_cmov="no"
1908 test $_fast_clz = "auto" && _fast_clz=yes
1910 echores "$proc"
1913 ia64)
1914 _arch='IA64'
1915 _target_arch='ARCH_IA64 = yes'
1916 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1917 iproc='ia64'
1920 x86_64|amd64)
1921 _arch='X86 X86_64'
1922 _target_subarch='ARCH_X86_64 = yes'
1923 _target_arch="ARCH_X86 = yes"
1924 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1925 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1926 iproc='x86_64'
1928 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1929 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1930 cpuopt=-mtune
1931 else
1932 cpuopt=-mcpu
1934 if test "$_runtime_cpudetection" = no ; then
1935 case "$pvendor" in
1936 AuthenticAMD)
1937 case "$pfamily" in
1938 15) proc=k8
1939 test $_fast_clz = "auto" && _fast_clz=no
1941 *) proc=amdfam10;;
1942 esac
1944 GenuineIntel)
1945 case "$pfamily" in
1946 6) proc=core2;;
1948 # 64-bit prescotts exist, but as far as GCC is concerned they
1949 # have the same capabilities as a nocona.
1950 proc=nocona
1951 test $_fast_cmov = "auto" && _fast_cmov=no
1952 test $_fast_clz = "auto" && _fast_clz=no
1954 esac
1957 proc=error;;
1958 esac
1959 fi # test "$_runtime_cpudetection" = no
1961 echocheck "GCC & CPU optimization abilities"
1962 cat > $TMPC << EOF
1963 int main(void) { return 0; }
1965 # This is a stripped-down version of the i386 fallback.
1966 if test "$_runtime_cpudetection" = no ; then
1967 cc_check -march=native && proc=native
1968 # --- AMD processors ---
1969 if test "$proc" = "k8"; then
1970 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1972 # This will fail if gcc version < 3.3, which is ok because earlier
1973 # versions don't really support 64-bit on amd64.
1974 # Is this a valid assumption? -Corey
1975 if test "$proc" = "athlon-xp"; then
1976 cc_check -march=$proc $cpuopt=$proc || proc=error
1978 # --- Intel processors ---
1979 if test "$proc" = "core2"; then
1980 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
1982 if test "$proc" = "x86-64"; then
1983 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1985 if test "$proc" = "nocona"; then
1986 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1988 if test "$proc" = "pentium4"; then
1989 cc_check -march=$proc $cpuopt=$proc || proc=error
1992 _march="-march=$proc"
1993 _mcpu="$cpuopt=$proc"
1994 if test "$proc" = "error" ; then
1995 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1996 _mcpu=""
1997 _march=""
1999 else # if test "$_runtime_cpudetection" = no
2000 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2001 _march="-march=x86-64"
2002 _mcpu="$cpuopt=generic"
2003 cc_check $_mcpu || _mcpu="x86-64"
2004 cc_check $_mcpu || _mcpu=""
2005 cc_check $_march $_mcpu || _march=""
2008 _optimizing="$proc"
2009 test $_fast_cmov = "auto" && _fast_cmov=yes
2010 test $_fast_clz = "auto" && _fast_clz=yes
2012 echores "$proc"
2015 sparc|sparc64)
2016 _arch='SPARC'
2017 _target_arch='ARCH_SPARC = yes'
2018 iproc='sparc'
2019 if test "$host_arch" = "sparc64" ; then
2020 _vis='yes'
2021 proc='ultrasparc'
2022 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2023 elif sunos ; then
2024 echocheck "CPU type"
2025 karch=$(uname -m)
2026 case "$(echo $karch)" in
2027 sun4) proc=v7 ;;
2028 sun4c) proc=v7 ;;
2029 sun4d) proc=v8 ;;
2030 sun4m) proc=v8 ;;
2031 sun4u) proc=ultrasparc _vis='yes' ;;
2032 sun4v) proc=v9 ;;
2033 *) proc=v8 ;;
2034 esac
2035 echores "$proc"
2036 else
2037 proc=v8
2039 _mcpu="-mcpu=$proc"
2040 _optimizing="$proc"
2043 arm*)
2044 _arch='ARM'
2045 _target_arch='ARCH_ARM = yes'
2046 iproc='arm'
2049 avr32)
2050 _arch='AVR32'
2051 _target_arch='ARCH_AVR32 = yes'
2052 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2053 iproc='avr32'
2054 test $_fast_clz = "auto" && _fast_clz=yes
2057 sh|sh4)
2058 _arch='SH4'
2059 _target_arch='ARCH_SH4 = yes'
2060 iproc='sh4'
2063 ppc|ppc64|powerpc|powerpc64)
2064 _arch='PPC'
2065 def_dcbzl='#define HAVE_DCBZL 0'
2066 _target_arch='ARCH_PPC = yes'
2067 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2068 iproc='ppc'
2070 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2071 _arch='PPC PPC64'
2072 _target_subarch='ARCH_PPC64 = yes'
2073 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2075 echocheck "CPU type"
2076 case $system_name in
2077 Linux)
2078 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2079 if test -n "$($_cpuinfo | grep altivec)"; then
2080 test $_altivec = auto && _altivec=yes
2083 Darwin)
2084 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2085 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2086 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2087 test $_altivec = auto && _altivec=yes
2090 NetBSD)
2091 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2092 case $cc_version in
2093 2*|3.0*|3.1*|3.2*|3.3*)
2096 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2097 test $_altivec = auto && _altivec=yes
2100 esac
2102 AIX)
2103 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2105 esac
2106 if test "$_altivec" = yes; then
2107 echores "$proc altivec"
2108 else
2109 _altivec=no
2110 echores "$proc"
2113 echocheck "GCC & CPU optimization abilities"
2115 if test -n "$proc"; then
2116 case "$proc" in
2117 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2118 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2119 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2120 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2121 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2122 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2123 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2124 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2125 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2126 *) ;;
2127 esac
2128 # gcc 3.1(.1) and up supports 7400 and 7450
2129 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2130 case "$proc" in
2131 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2132 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2133 *) ;;
2134 esac
2136 # gcc 3.2 and up supports 970
2137 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2138 case "$proc" in
2139 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2140 def_dcbzl='#define HAVE_DCBZL 1' ;;
2141 *) ;;
2142 esac
2144 # gcc 3.3 and up supports POWER4
2145 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2146 case "$proc" in
2147 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2148 *) ;;
2149 esac
2151 # gcc 3.4 and up supports 440*
2152 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2153 case "$proc" in
2154 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2155 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2156 *) ;;
2157 esac
2159 # gcc 4.0 and up supports POWER5
2160 if test "$_cc_major" -ge "4"; then
2161 case "$proc" in
2162 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2163 *) ;;
2164 esac
2168 if test -n "$_mcpu"; then
2169 _optimizing=$(echo $_mcpu | cut -c 8-)
2170 echores "$_optimizing"
2171 else
2172 echores "none"
2175 test $_fast_clz = "auto" && _fast_clz=yes
2179 alpha*)
2180 _arch='ALPHA'
2181 _target_arch='ARCH_ALPHA = yes'
2182 iproc='alpha'
2183 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2185 echocheck "CPU type"
2186 cat > $TMPC << EOF
2187 int main(void) {
2188 unsigned long ver, mask;
2189 __asm__ ("implver %0" : "=r" (ver));
2190 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2191 printf("%ld-%x\n", ver, ~mask);
2192 return 0;
2195 $_cc -o "$TMPEXE" "$TMPC"
2196 case $("$TMPEXE") in
2198 0-0) proc="ev4"; _mvi="0";;
2199 1-0) proc="ev5"; _mvi="0";;
2200 1-1) proc="ev56"; _mvi="0";;
2201 1-101) proc="pca56"; _mvi="1";;
2202 2-303) proc="ev6"; _mvi="1";;
2203 2-307) proc="ev67"; _mvi="1";;
2204 2-1307) proc="ev68"; _mvi="1";;
2205 esac
2206 echores "$proc"
2208 echocheck "GCC & CPU optimization abilities"
2209 if test "$proc" = "ev68" ; then
2210 cc_check -mcpu=$proc || proc=ev67
2212 if test "$proc" = "ev67" ; then
2213 cc_check -mcpu=$proc || proc=ev6
2215 _mcpu="-mcpu=$proc"
2216 echores "$proc"
2218 test $_fast_clz = "auto" && _fast_clz=yes
2220 _optimizing="$proc"
2223 mips)
2224 _arch='SGI_MIPS'
2225 _target_arch='ARCH_SGI_MIPS = yes'
2226 iproc='sgi-mips'
2228 if irix ; then
2229 echocheck "CPU type"
2230 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2231 case "$(echo $proc)" in
2232 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2233 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2234 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2235 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2236 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2237 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2238 esac
2239 # gcc < 3.x does not support -mtune.
2240 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2241 _mcpu=''
2243 echores "$proc"
2246 test $_fast_clz = "auto" && _fast_clz=yes
2250 hppa)
2251 _arch='PA_RISC'
2252 _target_arch='ARCH_PA_RISC = yes'
2253 iproc='PA-RISC'
2256 s390)
2257 _arch='S390'
2258 _target_arch='ARCH_S390 = yes'
2259 iproc='390'
2262 s390x)
2263 _arch='S390X'
2264 _target_arch='ARCH_S390X = yes'
2265 iproc='390x'
2268 vax)
2269 _arch='VAX'
2270 _target_arch='ARCH_VAX = yes'
2271 iproc='vax'
2274 xtensa)
2275 _arch='XTENSA'
2276 _target_arch='ARCH_XTENSA = yes'
2277 iproc='xtensa'
2280 generic)
2281 _arch='GENERIC'
2282 _target_arch='ARCH_GENERIC = yes'
2286 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2287 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2288 die "unsupported architecture $host_arch"
2290 esac # case "$host_arch" in
2292 if test "$_runtime_cpudetection" = yes ; then
2293 if x86 ; then
2294 test "$_cmov" != no && _cmov=yes
2295 x86_32 && _cmov=no
2296 test "$_mmx" != no && _mmx=yes
2297 test "$_3dnow" != no && _3dnow=yes
2298 test "$_3dnowext" != no && _3dnowext=yes
2299 test "$_mmxext" != no && _mmxext=yes
2300 test "$_sse" != no && _sse=yes
2301 test "$_sse2" != no && _sse2=yes
2302 test "$_ssse3" != no && _ssse3=yes
2303 test "$_mtrr" != no && _mtrr=yes
2305 if ppc; then
2306 _altivec=yes
2311 # endian testing
2312 echocheck "byte order"
2313 if test "$_big_endian" = auto ; then
2314 cat > $TMPC <<EOF
2315 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2316 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2317 int main(void) { return (int)ascii_name; }
2319 if cc_check ; then
2320 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2321 _big_endian=yes
2322 else
2323 _big_endian=no
2325 else
2326 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2329 if test "$_big_endian" = yes ; then
2330 _byte_order='big-endian'
2331 def_words_endian='#define WORDS_BIGENDIAN 1'
2332 def_bigendian='#define HAVE_BIGENDIAN 1'
2333 else
2334 _byte_order='little-endian'
2335 def_words_endian='#undef WORDS_BIGENDIAN'
2336 def_bigendian='#define HAVE_BIGENDIAN 0'
2338 echores "$_byte_order"
2341 echocheck "extern symbol prefix"
2342 cat > $TMPC << EOF
2343 int ff_extern;
2345 cc_check -c || die "Symbol mangling check failed."
2346 sym=$($_nm -P -g $TMPEXE)
2347 extern_prefix=${sym%%ff_extern*}
2348 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2349 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2350 echores $extern_prefix
2353 echocheck "assembler support of -pipe option"
2354 cat > $TMPC << EOF
2355 int main(void) { return 0; }
2357 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2358 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2361 echocheck "compiler support of named assembler arguments"
2362 _named_asm_args=yes
2363 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2364 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2365 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2366 _named_asm_args=no
2367 def_named_asm_args="#undef NAMED_ASM_ARGS"
2369 echores $_named_asm_args
2372 if darwin && test "$cc_vendor" = "gnu" ; then
2373 echocheck "GCC support of -mstackrealign"
2374 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2375 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2376 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2377 # wrong code with this flag, but this can be worked around by adding
2378 # -fno-unit-at-a-time as described in the blog post at
2379 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2380 cat > $TMPC << EOF
2381 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2382 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2384 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2385 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2386 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2387 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2388 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2391 # Checking for CFLAGS
2392 _install_strip="-s"
2393 if test "$_profile" != "" || test "$_debug" != "" ; then
2394 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2395 _install_strip=
2396 elif test -z "$CFLAGS" ; then
2397 if test "$cc_vendor" = "intel" ; then
2398 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2399 elif test "$cc_vendor" = "sun" ; then
2400 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2401 elif test "$cc_vendor" != "gnu" ; then
2402 CFLAGS="-O2 $_march $_mcpu $_pipe"
2403 else
2404 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2405 extra_ldflags="$extra_ldflags -ffast-math"
2407 else
2408 _warn_CFLAGS=yes
2411 cat > $TMPC << EOF
2412 int main(void) { return 0; }
2414 if test "$cc_vendor" = "gnu" ; then
2415 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2416 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2417 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2418 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2419 else
2420 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2423 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2426 if test -n "$LDFLAGS" ; then
2427 extra_ldflags="$extra_ldflags $LDFLAGS"
2428 _warn_CFLAGS=yes
2429 elif test "$cc_vendor" = "intel" ; then
2430 extra_ldflags="$extra_ldflags -i-static"
2432 if test -n "$CPPFLAGS" ; then
2433 extra_cflags="$extra_cflags $CPPFLAGS"
2434 _warn_CFLAGS=yes
2439 if x86_32 ; then
2440 # Checking assembler (_as) compatibility...
2441 # Added workaround for older as that reads from stdin by default - atmos
2442 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2443 echocheck "assembler ($_as $as_version)"
2445 _pref_as_version='2.9.1'
2446 echo 'nop' > $TMPS
2447 if test "$_mmx" = yes ; then
2448 echo 'emms' >> $TMPS
2450 if test "$_3dnow" = yes ; then
2451 _pref_as_version='2.10.1'
2452 echo 'femms' >> $TMPS
2454 if test "$_3dnowext" = yes ; then
2455 _pref_as_version='2.10.1'
2456 echo 'pswapd %mm0, %mm0' >> $TMPS
2458 if test "$_mmxext" = yes ; then
2459 _pref_as_version='2.10.1'
2460 echo 'movntq %mm0, (%eax)' >> $TMPS
2462 if test "$_sse" = yes ; then
2463 _pref_as_version='2.10.1'
2464 echo 'xorps %xmm0, %xmm0' >> $TMPS
2466 #if test "$_sse2" = yes ; then
2467 # _pref_as_version='2.11'
2468 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2470 if test "$_cmov" = yes ; then
2471 _pref_as_version='2.10.1'
2472 echo 'cmovb %eax, %ebx' >> $TMPS
2474 if test "$_ssse3" = yes ; then
2475 _pref_as_version='2.16.92'
2476 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2478 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2480 if test "$as_verc_fail" != yes ; then
2481 echores "ok"
2482 else
2483 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2484 echores "failed"
2485 die "obsolete binutils version"
2488 fi #if x86_32
2490 echocheck ".align is a power of two"
2491 if test "$_asmalign_pot" = auto ; then
2492 _asmalign_pot=no
2493 cat > $TMPC << EOF
2494 int main(void) { __asm__ (".align 3"); return 0; }
2496 cc_check && _asmalign_pot=yes
2498 if test "$_asmalign_pot" = "yes" ; then
2499 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2500 else
2501 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2503 echores $_asmalign_pot
2505 if x86 ; then
2506 echocheck "10 assembler operands"
2507 ten_operands=no
2508 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2509 cat > $TMPC << EOF
2510 int main(void) {
2511 int x=0;
2512 __asm__ volatile(
2514 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2516 return 0;
2519 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2520 echores $ten_operands
2522 echocheck "ebx availability"
2523 ebx_available=no
2524 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2525 cat > $TMPC << EOF
2526 int main(void) {
2527 int x;
2528 __asm__ volatile(
2529 "xor %0, %0"
2530 :"=b"(x)
2531 // just adding ebx to clobber list seems unreliable with some
2532 // compilers, e.g. Haiku's gcc 2.95
2534 // and the above check does not work for OSX 64 bit...
2535 __asm__ volatile("":::"%ebx");
2536 return 0;
2539 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2540 echores $ebx_available
2542 echocheck "PIC"
2543 pic=no
2544 cat > $TMPC << EOF
2545 int main(void) {
2546 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2547 #error PIC not enabled
2548 #endif
2549 return 0;
2552 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2553 echores $pic
2555 echocheck "yasm"
2556 if test -z "$YASMFLAGS" ; then
2557 if darwin ; then
2558 x86_64 && objformat="macho64" || objformat="macho"
2559 elif win32 ; then
2560 objformat="win32"
2561 else
2562 objformat="elf"
2564 # currently tested for Linux x86, x86_64
2565 YASMFLAGS="-f $objformat"
2566 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2567 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2568 case "$objformat" in
2569 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2570 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2571 esac
2572 else
2573 _warn_CFLAGS=yes
2576 echo "pabsw xmm0, xmm0" > $TMPS
2577 yasm_check || _yasm=""
2578 if test $_yasm ; then
2579 test "$_mmx" = "yes" && fft_mmx="yes"
2580 def_yasm='#define HAVE_YASM 1'
2581 _have_yasm="yes"
2582 echores "$_yasm"
2583 else
2584 def_yasm='#define HAVE_YASM 0'
2585 fft_mmx="no"
2586 _have_yasm="no"
2587 echores "no"
2590 echocheck "bswap"
2591 def_bswap='#define HAVE_BSWAP 0'
2592 echo 'bswap %eax' > $TMPS
2593 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2594 echores "$bswap"
2595 fi #if x86
2598 #FIXME: This should happen before the check for CFLAGS..
2599 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2600 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2602 # check if AltiVec is supported by the compiler, and how to enable it
2603 echocheck "GCC AltiVec flags"
2604 cat > $TMPC << EOF
2605 int main(void) { return 0; }
2607 if $(cc_check -maltivec -mabi=altivec) ; then
2608 _altivec_gcc_flags="-maltivec -mabi=altivec"
2609 # check if <altivec.h> should be included
2610 cat > $TMPC << EOF
2611 #include <altivec.h>
2612 int main(void) { return 0; }
2614 if $(cc_check $_altivec_gcc_flags) ; then
2615 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2616 inc_altivec_h='#include <altivec.h>'
2617 else
2618 cat > $TMPC << EOF
2619 int main(void) { return 0; }
2621 if $(cc_check -faltivec) ; then
2622 _altivec_gcc_flags="-faltivec"
2623 else
2624 _altivec=no
2625 _altivec_gcc_flags="none, AltiVec disabled"
2629 echores "$_altivec_gcc_flags"
2631 # check if the compiler supports braces for vector declarations
2632 cat > $TMPC << EOF
2633 $inc_altivec_h
2634 int main(void) { (vector int) {1}; return 0; }
2636 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2638 # Disable runtime cpudetection if we cannot generate AltiVec code or
2639 # AltiVec is disabled by the user.
2640 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2641 && _runtime_cpudetection=no
2643 # Show that we are optimizing for AltiVec (if enabled and supported).
2644 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2645 && _optimizing="$_optimizing altivec"
2647 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2648 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2651 if ppc ; then
2652 def_xform_asm='#define HAVE_XFORM_ASM 0'
2653 xform_asm=no
2654 echocheck "XFORM ASM support"
2655 cat > $TMPC << EOF
2656 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2658 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2659 echores "$xform_asm"
2662 if arm ; then
2663 echocheck "ARM pld instruction"
2664 cat > $TMPC << EOF
2665 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2667 pld=no
2668 cc_check && pld=yes
2669 echores "$pld"
2671 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2672 if test $_armv5te = "auto" ; then
2673 cat > $TMPC << EOF
2674 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2676 _armv5te=no
2677 cc_check && _armv5te=yes
2679 echores "$_armv5te"
2681 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2683 echocheck "ARMv6 (SIMD instructions)"
2684 if test $_armv6 = "auto" ; then
2685 cat > $TMPC << EOF
2686 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2688 _armv6=no
2689 cc_check && _armv6=yes
2691 echores "$_armv6"
2693 echocheck "ARMv6t2 (SIMD instructions)"
2694 if test $_armv6t2 = "auto" ; then
2695 cat > $TMPC << EOF
2696 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2698 _armv6t2=no
2699 cc_check && _armv6t2=yes
2701 echores "$_armv6"
2703 echocheck "ARM VFP"
2704 if test $_armvfp = "auto" ; then
2705 cat > $TMPC << EOF
2706 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2708 _armvfp=no
2709 cc_check && _armvfp=yes
2711 echores "$_armvfp"
2713 echocheck "ARM NEON"
2714 if test $neon = "auto" ; then
2715 cat > $TMPC << EOF
2716 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2718 neon=no
2719 cc_check && neon=yes
2721 echores "$neon"
2723 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2724 if test $_iwmmxt = "auto" ; then
2725 cat > $TMPC << EOF
2726 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2728 _iwmmxt=no
2729 cc_check && _iwmmxt=yes
2731 echores "$_iwmmxt"
2734 _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'
2735 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2736 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2737 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2738 test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts"
2739 test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts"
2740 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2741 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2742 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2743 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2744 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2745 test "$_fast_clz" = yes && _cpuexts="FAST_CLZ $_cpuexts"
2746 test "$pld" = yes && _cpuexts="PLD $_cpuexts"
2747 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2748 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2749 test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts"
2750 test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts"
2751 test "$neon" = yes && _cpuexts="NEON $_cpuexts"
2752 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2753 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2754 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2756 # Checking kernel version...
2757 if x86_32 && linux ; then
2758 _k_verc_problem=no
2759 kernel_version=$(uname -r 2>&1)
2760 echocheck "$system_name kernel version"
2761 case "$kernel_version" in
2762 '') kernel_version="?.??"; _k_verc_fail=yes;;
2763 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2764 _k_verc_problem=yes;;
2765 esac
2766 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2767 _k_verc_fail=yes
2769 if test "$_k_verc_fail" ; then
2770 echores "$kernel_version, fail"
2771 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2772 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2773 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2774 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2775 echo "2.2.x you must upgrade it to get SSE support!"
2776 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2777 else
2778 echores "$kernel_version, ok"
2782 ######################
2783 # MAIN TESTS GO HERE #
2784 ######################
2787 echocheck "-lposix"
2788 cat > $TMPC <<EOF
2789 int main(void) { return 0; }
2791 if cc_check -lposix ; then
2792 extra_ldflags="$extra_ldflags -lposix"
2793 echores "yes"
2794 else
2795 echores "no"
2798 echocheck "-lm"
2799 cat > $TMPC <<EOF
2800 int main(void) { return 0; }
2802 if cc_check -lm ; then
2803 _ld_lm="-lm"
2804 echores "yes"
2805 else
2806 _ld_lm=""
2807 echores "no"
2811 echocheck "langinfo"
2812 if test "$_langinfo" = auto ; then
2813 cat > $TMPC <<EOF
2814 #include <langinfo.h>
2815 int main(void) { nl_langinfo(CODESET); return 0; }
2817 _langinfo=no
2818 cc_check && _langinfo=yes
2820 if test "$_langinfo" = yes ; then
2821 def_langinfo='#define HAVE_LANGINFO 1'
2822 else
2823 def_langinfo='#undef HAVE_LANGINFO'
2825 echores "$_langinfo"
2828 echocheck "language"
2829 # Set preferred languages, "all" uses English as main language.
2830 test -z "$language" && language=$LINGUAS
2831 test -z "$language_doc" && language_doc=$language
2832 test -z "$language_man" && language_man=$language
2833 test -z "$language_msg" && language_msg=$language
2834 language_doc=$(echo $language_doc | tr , " ")
2835 language_man=$(echo $language_man | tr , " ")
2836 language_msg=$(echo $language_msg | tr , " ")
2838 test "$language_doc" = "all" && language_doc=$doc_lang_all
2839 test "$language_man" = "all" && language_man=$man_lang_all
2840 test "$language_msg" = "all" && language_msg=en
2842 # Prune non-existing translations from language lists.
2843 # Set message translation to the first available language.
2844 # Fall back on English.
2845 for lang in $language_doc ; do
2846 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2847 done
2848 language_doc=$tmp_language_doc
2849 test -z "$language_doc" && language_doc=en
2851 for lang in $language_man ; do
2852 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2853 done
2854 language_man=$tmp_language_man
2855 test -z "$language_man" && language_man=en
2857 for lang in $language_msg ; do
2858 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2859 done
2860 language_msg=$tmp_language_msg
2861 test -z "$language_msg" && language_msg=en
2862 _mp_help="help/help_mp-${language_msg}.h"
2863 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2866 echocheck "enable sighandler"
2867 if test "$_sighandler" = yes ; then
2868 def_sighandler='#define CONFIG_SIGHANDLER 1'
2869 else
2870 def_sighandler='#undef CONFIG_SIGHANDLER'
2872 echores "$_sighandler"
2874 echocheck "runtime cpudetection"
2875 if test "$_runtime_cpudetection" = yes ; then
2876 _optimizing="Runtime CPU-Detection enabled"
2877 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2878 else
2879 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2881 echores "$_runtime_cpudetection"
2884 echocheck "restrict keyword"
2885 for restrict_keyword in restrict __restrict __restrict__ ; do
2886 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2887 if cc_check; then
2888 def_restrict_keyword=$restrict_keyword
2889 break;
2891 done
2892 if [ -n "$def_restrict_keyword" ]; then
2893 echores "$def_restrict_keyword"
2894 else
2895 echores "none"
2897 # Avoid infinite recursion loop ("#define restrict restrict")
2898 if [ "$def_restrict_keyword" != "restrict" ]; then
2899 def_restrict_keyword="#define restrict $def_restrict_keyword"
2900 else
2901 def_restrict_keyword=""
2905 echocheck "__builtin_expect"
2906 # GCC branch prediction hint
2907 cat > $TMPC << EOF
2908 int foo(int a) {
2909 a = __builtin_expect(a, 10);
2910 return a == 10 ? 0 : 1;
2912 int main(void) { return foo(10) && foo(0); }
2914 _builtin_expect=no
2915 cc_check && _builtin_expect=yes
2916 if test "$_builtin_expect" = yes ; then
2917 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2918 else
2919 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2921 echores "$_builtin_expect"
2924 echocheck "kstat"
2925 cat > $TMPC << EOF
2926 #include <kstat.h>
2927 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2929 _kstat=no
2930 cc_check -lkstat && _kstat=yes
2931 if test "$_kstat" = yes ; then
2932 def_kstat="#define HAVE_LIBKSTAT 1"
2933 extra_ldflags="$extra_ldflags -lkstat"
2934 else
2935 def_kstat="#undef HAVE_LIBKSTAT"
2937 echores "$_kstat"
2940 echocheck "posix4"
2941 # required for nanosleep on some systems
2942 cat > $TMPC << EOF
2943 #include <time.h>
2944 int main(void) { (void) nanosleep(0, 0); return 0; }
2946 _posix4=no
2947 cc_check -lposix4 && _posix4=yes
2948 if test "$_posix4" = yes ; then
2949 extra_ldflags="$extra_ldflags -lposix4"
2951 echores "$_posix4"
2953 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2954 echocheck $func
2955 cat > $TMPC << EOF
2956 #include <math.h>
2957 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2959 eval _$func=no
2960 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2961 if eval test "x\$_$func" = "xyes"; then
2962 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2963 echores yes
2964 else
2965 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2966 echores no
2968 done
2971 echocheck "mkstemp"
2972 cat > $TMPC << EOF
2973 #include <stdlib.h>
2974 int main(void) { char a; mkstemp(&a); return 0; }
2976 _mkstemp=no
2977 cc_check && _mkstemp=yes
2978 if test "$_mkstemp" = yes ; then
2979 def_mkstemp='#define HAVE_MKSTEMP 1'
2980 else
2981 def_mkstemp='#undef HAVE_MKSTEMP'
2983 echores "$_mkstemp"
2986 echocheck "nanosleep"
2987 # also check for nanosleep
2988 cat > $TMPC << EOF
2989 #include <time.h>
2990 int main(void) { (void) nanosleep(0, 0); return 0; }
2992 _nanosleep=no
2993 cc_check && _nanosleep=yes
2994 if test "$_nanosleep" = yes ; then
2995 def_nanosleep='#define HAVE_NANOSLEEP 1'
2996 else
2997 def_nanosleep='#undef HAVE_NANOSLEEP'
2999 echores "$_nanosleep"
3002 echocheck "socklib"
3003 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3004 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3005 cat > $TMPC << EOF
3006 #include <netdb.h>
3007 #include <sys/socket.h>
3008 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3010 _socklib=no
3011 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3012 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3013 done
3014 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3015 if test $_winsock2_h = auto ; then
3016 _winsock2_h=no
3017 cat > $TMPC << EOF
3018 #include <winsock2.h>
3019 int main(void) { (void) gethostbyname(0); return 0; }
3021 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3023 test "$_ld_sock" && _res_comment="using $_ld_sock"
3024 echores "$_socklib"
3027 if test $_winsock2_h = yes ; then
3028 _ld_sock="-lws2_32"
3029 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3030 else
3031 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3035 echocheck "arpa/inet.h"
3036 arpa_inet_h=no
3037 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3038 cat > $TMPC << EOF
3039 #include <arpa/inet.h>
3040 int main(void) { return 0; }
3042 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3043 echores "$arpa_inet_h"
3046 echocheck "inet_pton()"
3047 def_inet_pton='#define HAVE_INET_PTON 0'
3048 inet_pton=no
3049 cat > $TMPC << EOF
3050 #include <sys/types.h>
3051 #include <sys/socket.h>
3052 #include <arpa/inet.h>
3053 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3055 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3056 cc_check $_ld_tmp && inet_pton=yes && break
3057 done
3058 if test $inet_pton = yes ; then
3059 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3060 def_inet_pton='#define HAVE_INET_PTON 1'
3062 echores "$inet_pton"
3065 echocheck "inet_aton()"
3066 def_inet_aton='#define HAVE_INET_ATON 0'
3067 inet_aton=no
3068 cat > $TMPC << EOF
3069 #include <sys/types.h>
3070 #include <sys/socket.h>
3071 #include <arpa/inet.h>
3072 int main(void) { (void) inet_aton(0, 0); return 0; }
3074 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3075 cc_check $_ld_tmp && inet_aton=yes && break
3076 done
3077 if test $inet_aton = yes ; then
3078 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3079 def_inet_aton='#define HAVE_INET_ATON 1'
3081 echores "$inet_aton"
3084 echocheck "socklen_t"
3085 _socklen_t=no
3086 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3087 cat > $TMPC << EOF
3088 #include <$header>
3089 int main(void) { socklen_t v = 0; return v; }
3091 cc_check && _socklen_t=yes && break
3092 done
3093 if test "$_socklen_t" = yes ; then
3094 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3095 else
3096 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3098 echores "$_socklen_t"
3101 echocheck "closesocket()"
3102 _closesocket=no
3103 cat > $TMPC << EOF
3104 #include <winsock2.h>
3105 int main(void) { closesocket(~0); return 0; }
3107 cc_check $_ld_sock && _closesocket=yes
3108 if test "$_closesocket" = yes ; then
3109 def_closesocket='#define HAVE_CLOSESOCKET 1'
3110 else
3111 def_closesocket='#define HAVE_CLOSESOCKET 0'
3113 echores "$_closesocket"
3116 echocheck "network"
3117 test $_winsock2_h = no && test $inet_pton = no &&
3118 test $inet_aton = no && _network=no
3119 if test "$_network" = yes ; then
3120 def_network='#define CONFIG_NETWORK 1'
3121 extra_ldflags="$extra_ldflags $_ld_sock"
3122 _inputmodules="network $_inputmodules"
3123 else
3124 _noinputmodules="network $_noinputmodules"
3125 def_network='#undef CONFIG_NETWORK'
3126 _ftp=no
3128 echores "$_network"
3131 echocheck "inet6"
3132 if test "$_inet6" = auto ; then
3133 cat > $TMPC << EOF
3134 #include <sys/types.h>
3135 #if !defined(_WIN32) || defined(__CYGWIN__)
3136 #include <sys/socket.h>
3137 #include <netinet/in.h>
3138 #else
3139 #include <ws2tcpip.h>
3140 #endif
3141 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3143 _inet6=no
3144 if cc_check $_ld_sock ; then
3145 _inet6=yes
3148 if test "$_inet6" = yes ; then
3149 def_inet6='#define HAVE_AF_INET6 1'
3150 else
3151 def_inet6='#undef HAVE_AF_INET6'
3153 echores "$_inet6"
3156 echocheck "gethostbyname2"
3157 if test "$_gethostbyname2" = auto ; then
3158 cat > $TMPC << EOF
3159 #include <sys/types.h>
3160 #include <sys/socket.h>
3161 #include <netdb.h>
3162 int main(void) { gethostbyname2("", AF_INET); return 0; }
3164 _gethostbyname2=no
3165 if cc_check ; then
3166 _gethostbyname2=yes
3169 if test "$_gethostbyname2" = yes ; then
3170 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3171 else
3172 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3174 echores "$_gethostbyname2"
3177 echocheck "inttypes.h (required)"
3178 cat > $TMPC << EOF
3179 #include <inttypes.h>
3180 int main(void) { return 0; }
3182 _inttypes=no
3183 cc_check && _inttypes=yes
3184 echores "$_inttypes"
3186 if test "$_inttypes" = no ; then
3187 echocheck "bitypes.h (inttypes.h predecessor)"
3188 cat > $TMPC << EOF
3189 #include <sys/bitypes.h>
3190 int main(void) { return 0; }
3192 cc_check && _inttypes=yes
3193 if test "$_inttypes" = yes ; then
3194 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."
3195 else
3196 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3201 echocheck "int_fastXY_t in inttypes.h"
3202 cat > $TMPC << EOF
3203 #include <inttypes.h>
3204 int main(void) {
3205 volatile int_fast16_t v= 0;
3206 return v; }
3208 _fast_inttypes=no
3209 cc_check && _fast_inttypes=yes
3210 if test "$_fast_inttypes" = no ; then
3211 def_fast_inttypes='
3212 typedef signed char int_fast8_t;
3213 typedef signed int int_fast16_t;
3214 typedef signed int int_fast32_t;
3215 typedef signed long long int_fast64_t;
3216 typedef unsigned char uint_fast8_t;
3217 typedef unsigned int uint_fast16_t;
3218 typedef unsigned int uint_fast32_t;
3219 typedef unsigned long long uint_fast64_t;'
3221 echores "$_fast_inttypes"
3224 echocheck "malloc.h"
3225 cat > $TMPC << EOF
3226 #include <malloc.h>
3227 int main(void) { (void) malloc(0); return 0; }
3229 _malloc=no
3230 cc_check && _malloc=yes
3231 if test "$_malloc" = yes ; then
3232 def_malloc_h='#define HAVE_MALLOC_H 1'
3233 else
3234 def_malloc_h='#define HAVE_MALLOC_H 0'
3236 # malloc.h emits a warning in FreeBSD and OpenBSD
3237 freebsd || openbsd || dragonfly && def_malloc_h='#define HAVE_MALLOC_H 0'
3238 echores "$_malloc"
3241 echocheck "memalign()"
3242 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3243 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3244 cat > $TMPC << EOF
3245 #include <malloc.h>
3246 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3248 _memalign=no
3249 cc_check && _memalign=yes
3250 if test "$_memalign" = yes ; then
3251 def_memalign='#define HAVE_MEMALIGN 1'
3252 else
3253 def_memalign='#define HAVE_MEMALIGN 0'
3254 def_map_memalign='#define memalign(a,b) malloc(b)'
3255 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3257 echores "$_memalign"
3260 echocheck "posix_memalign()"
3261 posix_memalign=no
3262 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3263 cat > $TMPC << EOF
3264 #define _XOPEN_SOURCE 600
3265 #include <stdlib.h>
3266 int main(void) { posix_memalign(NULL, 0, 0); }
3268 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3269 echores "$posix_memalign"
3272 echocheck "alloca.h"
3273 cat > $TMPC << EOF
3274 #include <alloca.h>
3275 int main(void) { (void) alloca(0); return 0; }
3277 _alloca=no
3278 cc_check && _alloca=yes
3279 if cc_check ; then
3280 def_alloca_h='#define HAVE_ALLOCA_H 1'
3281 else
3282 def_alloca_h='#undef HAVE_ALLOCA_H'
3284 echores "$_alloca"
3287 echocheck "fastmemcpy"
3288 if test "$_fastmemcpy" = yes ; then
3289 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3290 else
3291 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3293 echores "$_fastmemcpy"
3296 echocheck "mman.h"
3297 cat > $TMPC << EOF
3298 #include <sys/types.h>
3299 #include <sys/mman.h>
3300 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3302 _mman=no
3303 cc_check && _mman=yes
3304 if test "$_mman" = yes ; then
3305 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3306 else
3307 def_mman_h='#undef HAVE_SYS_MMAN_H'
3308 os2 && _need_mmap=yes
3310 echores "$_mman"
3312 cat > $TMPC << EOF
3313 #include <sys/types.h>
3314 #include <sys/mman.h>
3315 int main(void) { void *p = MAP_FAILED; return 0; }
3317 _mman_has_map_failed=no
3318 cc_check && _mman_has_map_failed=yes
3319 if test "$_mman_has_map_failed" = yes ; then
3320 def_mman_has_map_failed=''
3321 else
3322 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3325 echocheck "dynamic loader"
3326 cat > $TMPC << EOF
3327 #include <stddef.h>
3328 #include <dlfcn.h>
3329 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3331 _dl=no
3332 for _ld_tmp in "" "-ldl" ; do
3333 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3334 done
3335 if test "$_dl" = yes ; then
3336 def_dl='#define HAVE_LIBDL 1'
3337 else
3338 def_dl='#undef HAVE_LIBDL'
3340 echores "$_dl"
3343 echocheck "dynamic a/v plugins support"
3344 if test "$_dl" = no ; then
3345 _dynamic_plugins=no
3347 if test "$_dynamic_plugins" = yes ; then
3348 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3349 else
3350 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3352 echores "$_dynamic_plugins"
3355 def_threads='#define HAVE_THREADS 0'
3357 echocheck "pthread"
3358 if linux ; then
3359 THREAD_CFLAGS=-D_REENTRANT
3360 elif freebsd || netbsd || openbsd || bsdos ; then
3361 THREAD_CFLAGS=-D_THREAD_SAFE
3363 if test "$_pthreads" = auto ; then
3364 cat > $TMPC << EOF
3365 #include <pthread.h>
3366 void* func(void *arg) { return arg; }
3367 int main(void) {
3368 pthread_t tid;
3369 int res = 0;
3370 #ifdef PTW32_STATIC_LIB
3371 pthread_win32_process_attach_np();
3372 pthread_win32_thread_attach_np();
3373 #endif
3374 res = pthread_create (&tid, 0, func, 0) == 0 ? 0 : 1;
3375 return res;
3378 _pthreads=no
3379 if ! hpux ; then
3380 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3381 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3382 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3383 done
3384 # static pthreads on mingw32
3385 if test "$_pthreads" = no && mingw32 ; then
3386 _ld_tmp="-lpthreadGC2 -lws2_32"
3387 cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
3391 if test "$_pthreads" = yes ; then
3392 test -n "$_ld_pthread" && _res_comment="using $_ld_pthread"
3393 def_pthreads='#define HAVE_PTHREADS 1'
3394 def_threads='#define HAVE_THREADS 1'
3395 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3396 else
3397 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3398 def_pthreads='#undef HAVE_PTHREADS'
3399 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3400 mingw32 || _win32dll=no
3402 echores "$_pthreads"
3404 if cygwin ; then
3405 if test "$_pthreads" = yes ; then
3406 def_pthread_cache="#define PTHREAD_CACHE 1"
3407 else
3408 _stream_cache=no
3409 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3413 echocheck "w32threads"
3414 if test "$_pthreads" = yes ; then
3415 _res_comment="using pthread instead"
3416 _w32threads=no
3418 if test "$_w32threads" = auto ; then
3419 _w32threads=no
3420 mingw32 && _w32threads=yes
3422 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3423 echores "$_w32threads"
3425 echocheck "rpath"
3426 netbsd &&_rpath=yes
3427 if test "$_rpath" = yes ; then
3428 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3429 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3430 done
3431 extra_ldflags=$tmp
3433 echores "$_rpath"
3435 echocheck "iconv"
3436 if test "$_iconv" = auto ; then
3437 cat > $TMPC << EOF
3438 #include <stdio.h>
3439 #include <unistd.h>
3440 #include <iconv.h>
3441 #define INBUFSIZE 1024
3442 #define OUTBUFSIZE 4096
3444 char inbuffer[INBUFSIZE];
3445 char outbuffer[OUTBUFSIZE];
3447 int main(void) {
3448 size_t numread;
3449 iconv_t icdsc;
3450 char *tocode="UTF-8";
3451 char *fromcode="cp1250";
3452 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3453 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3454 char *iptr=inbuffer;
3455 char *optr=outbuffer;
3456 size_t inleft=numread;
3457 size_t outleft=OUTBUFSIZE;
3458 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3459 != (size_t)(-1)) {
3460 write(1, outbuffer, OUTBUFSIZE - outleft);
3463 if (iconv_close(icdsc) == -1)
3466 return 0;
3469 _iconv=no
3470 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3471 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3472 _iconv=yes && break
3473 done
3475 if test "$_iconv" = yes ; then
3476 def_iconv='#define CONFIG_ICONV 1'
3477 else
3478 def_iconv='#undef CONFIG_ICONV'
3480 echores "$_iconv"
3483 echocheck "soundcard.h"
3484 _soundcard_h=no
3485 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3486 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3487 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3488 cat > $TMPC << EOF
3489 #include <$_soundcard_header>
3490 int main(void) { return 0; }
3492 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3493 done
3495 if test "$_soundcard_h" = yes ; then
3496 if test $_soundcard_header = "sys/soundcard.h"; then
3497 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3498 else
3499 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3502 echores "$_soundcard_h"
3505 echocheck "sys/dvdio.h"
3506 cat > $TMPC << EOF
3507 #include <unistd.h>
3508 #include <sys/dvdio.h>
3509 int main(void) { return 0; }
3511 _dvdio=no
3512 cc_check && _dvdio=yes
3513 if test "$_dvdio" = yes ; then
3514 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3515 else
3516 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3518 echores "$_dvdio"
3521 echocheck "sys/cdio.h"
3522 cat > $TMPC << EOF
3523 #include <unistd.h>
3524 #include <sys/cdio.h>
3525 int main(void) { return 0; }
3527 _cdio=no
3528 cc_check && _cdio=yes
3529 if test "$_cdio" = yes ; then
3530 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3531 else
3532 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3534 echores "$_cdio"
3537 echocheck "linux/cdrom.h"
3538 cat > $TMPC << EOF
3539 #include <sys/types.h>
3540 #include <linux/cdrom.h>
3541 int main(void) { return 0; }
3543 _cdrom=no
3544 cc_check && _cdrom=yes
3545 if test "$_cdrom" = yes ; then
3546 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3547 else
3548 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3550 echores "$_cdrom"
3553 echocheck "dvd.h"
3554 cat > $TMPC << EOF
3555 #include <dvd.h>
3556 int main(void) { return 0; }
3558 _dvd=no
3559 cc_check && _dvd=yes
3560 if test "$_dvd" = yes ; then
3561 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3562 else
3563 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3565 echores "$_dvd"
3568 if bsdos; then
3569 echocheck "BSDI dvd.h"
3570 cat > $TMPC << EOF
3571 #include <dvd.h>
3572 int main(void) { return 0; }
3574 _bsdi_dvd=no
3575 cc_check && _bsdi_dvd=yes
3576 if test "$_bsdi_dvd" = yes ; then
3577 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3578 else
3579 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3581 echores "$_bsdi_dvd"
3582 fi #if bsdos
3585 if hpux; then
3586 # also used by AIX, but AIX does not support VCD and/or libdvdread
3587 echocheck "HP-UX SCSI header"
3588 cat > $TMPC << EOF
3589 #include <sys/scsi.h>
3590 int main(void) { return 0; }
3592 _hpux_scsi_h=no
3593 cc_check && _hpux_scsi_h=yes
3594 if test "$_hpux_scsi_h" = yes ; then
3595 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3596 else
3597 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3599 echores "$_hpux_scsi_h"
3600 fi #if hpux
3603 if sunos; then
3604 echocheck "userspace SCSI headers (Solaris)"
3605 cat > $TMPC << EOF
3606 #include <unistd.h>
3607 #include <stropts.h>
3608 #include <sys/scsi/scsi_types.h>
3609 #include <sys/scsi/impl/uscsi.h>
3610 int main(void) { return 0; }
3612 _sol_scsi_h=no
3613 cc_check && _sol_scsi_h=yes
3614 if test "$_sol_scsi_h" = yes ; then
3615 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3616 else
3617 def_sol_scsi_h='#undef SOLARIS_USCSI'
3619 echores "$_sol_scsi_h"
3620 fi #if sunos
3623 echocheck "termcap"
3624 if test "$_termcap" = auto ; then
3625 cat > $TMPC <<EOF
3626 #include <stddef.h>
3627 #include <term.h>
3628 int main(void) { tgetent(NULL, NULL); return 0; }
3630 _termcap=no
3631 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3632 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3633 && _termcap=yes && break
3634 done
3636 if test "$_termcap" = yes ; then
3637 def_termcap='#define HAVE_TERMCAP 1'
3638 test $_ld_tmp && _res_comment="using $_ld_tmp"
3639 else
3640 def_termcap='#undef HAVE_TERMCAP'
3642 echores "$_termcap"
3645 echocheck "termios"
3646 def_termios='#undef HAVE_TERMIOS'
3647 def_termios_h='#undef HAVE_TERMIOS_H'
3648 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3649 if test "$_termios" = auto ; then
3650 _termios=no
3651 for _termios_header in "sys/termios.h" "termios.h"; do
3652 cat > $TMPC <<EOF
3653 #include <$_termios_header>
3654 int main(void) { return 0; }
3656 cc_check && _termios=yes && _res_comment="using $_termios_header" && break
3657 done
3660 if test "$_termios" = yes ; then
3661 def_termios='#define HAVE_TERMIOS 1'
3662 if test "$_termios_header" = "termios.h" ; then
3663 def_termios_h='#define HAVE_TERMIOS_H 1'
3664 else
3665 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3668 echores "$_termios"
3671 echocheck "shm"
3672 if test "$_shm" = auto ; then
3673 cat > $TMPC << EOF
3674 #include <sys/types.h>
3675 #include <sys/shm.h>
3676 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3678 _shm=no
3679 cc_check && _shm=yes
3681 if test "$_shm" = yes ; then
3682 def_shm='#define HAVE_SHM 1'
3683 else
3684 def_shm='#undef HAVE_SHM'
3686 echores "$_shm"
3689 echocheck "strsep()"
3690 cat > $TMPC << EOF
3691 #include <string.h>
3692 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3694 _strsep=no
3695 cc_check && _strsep=yes
3696 if test "$_strsep" = yes ; then
3697 def_strsep='#define HAVE_STRSEP 1'
3698 _need_strsep=no
3699 else
3700 def_strsep='#undef HAVE_STRSEP'
3701 _need_strsep=yes
3703 echores "$_strsep"
3706 echocheck "vsscanf()"
3707 cat > $TMPC << EOF
3708 #define _ISOC99_SOURCE
3709 #include <stdarg.h>
3710 #include <stdio.h>
3711 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3713 _vsscanf=no
3714 cc_check && _vsscanf=yes
3715 if test "$_vsscanf" = yes ; then
3716 def_vsscanf='#define HAVE_VSSCANF 1'
3717 _need_vsscanf=no
3718 else
3719 def_vsscanf='#undef HAVE_VSSCANF'
3720 _need_vsscanf=yes
3722 echores "$_vsscanf"
3725 echocheck "swab()"
3726 cat > $TMPC << EOF
3727 #define _XOPEN_SOURCE 600
3728 #include <unistd.h>
3729 int main(void) { swab(0, 0, 0); return 0; }
3731 _swab=no
3732 cc_check && _swab=yes
3733 if test "$_swab" = yes ; then
3734 def_swab='#define HAVE_SWAB 1'
3735 _need_swab=no
3736 else
3737 def_swab='#undef HAVE_SWAB'
3738 _need_swab=yes
3740 echores "$_swab"
3742 echocheck "POSIX select()"
3743 cat > $TMPC << EOF
3744 #include <stdio.h>
3745 #include <stdlib.h>
3746 #include <sys/types.h>
3747 #include <string.h>
3748 #include <sys/time.h>
3749 #include <unistd.h>
3750 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3752 _posix_select=no
3753 def_posix_select='#undef HAVE_POSIX_SELECT'
3754 #select() of kLIBC (OS/2) supports socket only
3755 ! os2 && cc_check && _posix_select=yes \
3756 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3757 echores "$_posix_select"
3760 echocheck "audio select()"
3761 if test "$_select" = no ; then
3762 def_select='#undef HAVE_AUDIO_SELECT'
3763 elif test "$_select" = yes ; then
3764 def_select='#define HAVE_AUDIO_SELECT 1'
3766 echores "$_select"
3769 echocheck "gettimeofday()"
3770 cat > $TMPC << EOF
3771 #include <stdio.h>
3772 #include <sys/time.h>
3773 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3775 _gettimeofday=no
3776 cc_check && _gettimeofday=yes
3777 if test "$_gettimeofday" = yes ; then
3778 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3779 _need_gettimeofday=no
3780 else
3781 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3782 _need_gettimeofday=yes
3784 echores "$_gettimeofday"
3787 echocheck "glob()"
3788 cat > $TMPC << EOF
3789 #include <stdio.h>
3790 #include <glob.h>
3791 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3793 _glob=no
3794 cc_check && _glob=yes
3795 if test "$_glob" = yes ; then
3796 def_glob='#define HAVE_GLOB 1'
3797 _need_glob=no
3798 else
3799 def_glob='#undef HAVE_GLOB'
3800 _need_glob=yes
3802 echores "$_glob"
3805 echocheck "setenv()"
3806 cat > $TMPC << EOF
3807 #include <stdlib.h>
3808 int main(void) { setenv("","",0); return 0; }
3810 _setenv=no
3811 cc_check && _setenv=yes
3812 if test "$_setenv" = yes ; then
3813 def_setenv='#define HAVE_SETENV 1'
3814 _need_setenv=no
3815 else
3816 def_setenv='#undef HAVE_SETENV'
3817 _need_setenv=yes
3819 echores "$_setenv"
3822 if sunos; then
3823 echocheck "sysi86()"
3824 cat > $TMPC << EOF
3825 #include <sys/sysi86.h>
3826 int main(void) { sysi86(0); return 0; }
3828 _sysi86=no
3829 cc_check && _sysi86=yes
3830 if test "$_sysi86" = yes ; then
3831 def_sysi86='#define HAVE_SYSI86 1'
3832 cat > $TMPC << EOF
3833 #include <sys/sysi86.h>
3834 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3836 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3837 else
3838 def_sysi86='#undef HAVE_SYSI86'
3840 echores "$_sysi86"
3841 fi #if sunos
3844 echocheck "sys/sysinfo.h"
3845 cat > $TMPC << EOF
3846 #include <sys/sysinfo.h>
3847 int main(void) {
3848 struct sysinfo s_info;
3849 sysinfo(&s_info);
3850 return 0;
3853 _sys_sysinfo=no
3854 cc_check && _sys_sysinfo=yes
3855 if test "$_sys_sysinfo" = yes ; then
3856 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3857 else
3858 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3860 echores "$_sys_sysinfo"
3863 if darwin; then
3865 echocheck "Mac OS X Finder Support"
3866 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3867 if test "$_macosx_finder" = yes ; then
3868 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3869 extra_ldflags="$extra_ldflags -framework Carbon"
3871 echores "$_macosx_finder"
3873 echocheck "Mac OS X Bundle file locations"
3874 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3875 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3876 if test "$_macosx_bundle" = yes ; then
3877 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3878 extra_ldflags="$extra_ldflags -framework Carbon"
3880 echores "$_macosx_bundle"
3882 echocheck "Apple Remote"
3883 if test "$_apple_remote" = auto ; then
3884 _apple_remote=no
3885 cat > $TMPC <<EOF
3886 #include <stdio.h>
3887 #include <IOKit/IOCFPlugIn.h>
3888 int main(void) {
3889 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3890 CFMutableDictionaryRef hidMatchDictionary;
3891 IOReturn ioReturnValue;
3893 // Set up a matching dictionary to search the I/O Registry by class.
3894 // name for all HID class devices
3895 hidMatchDictionary = IOServiceMatching("AppleIRController");
3897 // Now search I/O Registry for matching devices.
3898 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3899 hidMatchDictionary, &hidObjectIterator);
3901 // If search is unsuccessful, return nonzero.
3902 if (ioReturnValue != kIOReturnSuccess ||
3903 !IOIteratorIsValid(hidObjectIterator)) {
3904 return 1;
3906 return 0;
3909 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3911 if test "$_apple_remote" = yes ; then
3912 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3913 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3914 else
3915 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3917 echores "$_apple_remote"
3919 fi #if darwin
3921 if linux; then
3923 echocheck "Apple IR"
3924 if test "$_apple_ir" = auto ; then
3925 _apple_ir=no
3926 cat > $TMPC <<EOF
3927 #include <linux/types.h>
3928 #include <linux/input.h>
3929 int main(void) {
3930 struct input_event ev;
3931 struct input_id id;
3932 return 0;
3935 cc_check && _apple_ir=yes
3937 if test "$_apple_ir" = yes ; then
3938 def_apple_ir='#define CONFIG_APPLE_IR 1'
3939 else
3940 def_apple_ir='#undef CONFIG_APPLE_IR'
3942 echores "$_apple_ir"
3943 fi #if linux
3945 echocheck "$_target-pkg-config"
3946 _pkg_config=$_target-pkg-config
3947 if $($_pkg_config --version > /dev/null 2>&1); then
3948 if test "$_ld_static"; then
3949 _pkg_config="$_pkg_config --static"
3951 echores "yes"
3952 else
3953 _pkg_config=pkg-config
3954 echores "no"
3956 echocheck "pkg-config"
3957 if $($_pkg_config --version > /dev/null 2>&1); then
3958 if test "$_ld_static"; then
3959 _pkg_config="$_pkg_config --static"
3961 echores "yes"
3962 else
3963 _pkg_config=false
3964 echores "no"
3969 echocheck "Samba support (libsmbclient)"
3970 if test "$_smb" = yes; then
3971 extra_ldflags="$extra_ldflags -lsmbclient"
3973 if test "$_smb" = auto; then
3974 _smb=no
3975 cat > $TMPC << EOF
3976 #include <libsmbclient.h>
3977 int main(void) { smbc_opendir("smb://"); return 0; }
3979 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3980 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3981 _smb=yes && break
3982 done
3985 if test "$_smb" = yes; then
3986 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3987 _inputmodules="smb $_inputmodules"
3988 else
3989 def_smb="#undef CONFIG_LIBSMBCLIENT"
3990 _noinputmodules="smb $_noinputmodules"
3992 echores "$_smb"
3995 #########
3996 # VIDEO #
3997 #########
4000 echocheck "tdfxfb"
4001 if test "$_tdfxfb" = yes ; then
4002 def_tdfxfb='#define CONFIG_TDFXFB 1'
4003 _vomodules="tdfxfb $_vomodules"
4004 else
4005 def_tdfxfb='#undef CONFIG_TDFXFB'
4006 _novomodules="tdfxfb $_novomodules"
4008 echores "$_tdfxfb"
4010 echocheck "s3fb"
4011 if test "$_s3fb" = yes ; then
4012 def_s3fb='#define CONFIG_S3FB 1'
4013 _vomodules="s3fb $_vomodules"
4014 else
4015 def_s3fb='#undef CONFIG_S3FB'
4016 _novomodules="s3fb $_novomodules"
4018 echores "$_s3fb"
4020 echocheck "wii"
4021 if test "$_wii" = yes ; then
4022 def_wii='#define CONFIG_WII 1'
4023 _vomodules="wii $_vomodules"
4024 else
4025 def_wii='#undef CONFIG_WII'
4026 _novomodules="wii $_novomodules"
4028 echores "$_wii"
4030 echocheck "tdfxvid"
4031 if test "$_tdfxvid" = yes ; then
4032 def_tdfxvid='#define CONFIG_TDFX_VID 1'
4033 _vomodules="tdfx_vid $_vomodules"
4034 else
4035 def_tdfxvid='#undef CONFIG_TDFX_VID'
4036 _novomodules="tdfx_vid $_novomodules"
4038 echores "$_tdfxvid"
4040 echocheck "xvr100"
4041 if test "$_xvr100" = auto ; then
4042 cat > $TMPC << EOF
4043 #include <unistd.h>
4044 #include <sys/fbio.h>
4045 #include <sys/visual_io.h>
4046 int main(void) {
4047 struct vis_identifier ident;
4048 struct fbgattr attr;
4049 ioctl(0, VIS_GETIDENTIFIER, &ident);
4050 ioctl(0, FBIOGATTR, &attr);
4051 return 0;
4054 _xvr100=no
4055 cc_check && _xvr100=yes
4057 if test "$_xvr100" = yes ; then
4058 def_xvr100='#define CONFIG_XVR100 1'
4059 _vomodules="xvr100 $_vomodules"
4060 else
4061 def_tdfxvid='#undef CONFIG_XVR100'
4062 _novomodules="xvr100 $_novomodules"
4064 echores "$_xvr100"
4066 echocheck "tga"
4067 if test "$_tga" = yes ; then
4068 def_tga='#define CONFIG_TGA 1'
4069 _vomodules="tga $_vomodules"
4070 else
4071 def_tga='#undef CONFIG_TGA'
4072 _novomodules="tga $_novomodules"
4074 echores "$_tga"
4077 echocheck "md5sum support"
4078 if test "$_md5sum" = yes; then
4079 def_md5sum="#define CONFIG_MD5SUM 1"
4080 _vomodules="md5sum $_vomodules"
4081 else
4082 def_md5sum="#undef CONFIG_MD5SUM"
4083 _novomodules="md5sum $_novomodules"
4085 echores "$_md5sum"
4088 echocheck "yuv4mpeg support"
4089 if test "$_yuv4mpeg" = yes; then
4090 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4091 _vomodules="yuv4mpeg $_vomodules"
4092 else
4093 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4094 _novomodules="yuv4mpeg $_novomodules"
4096 echores "$_yuv4mpeg"
4099 echocheck "bl"
4100 if test "$_bl" = yes ; then
4101 def_bl='#define CONFIG_BL 1'
4102 _vomodules="bl $_vomodules"
4103 else
4104 def_bl='#undef CONFIG_BL'
4105 _novomodules="bl $_novomodules"
4107 echores "$_bl"
4110 echocheck "DirectFB"
4111 if test "$_directfb" = auto ; then
4112 _directfb=no
4113 cat > $TMPC <<EOF
4114 #include <directfb.h>
4115 int main(void) { DirectFBInit(0, 0); return 0; }
4117 for _inc_tmp in "" -I/usr/local/include/directfb \
4118 -I/usr/include/directfb -I/usr/local/include; do
4119 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4120 extra_cflags="$extra_cflags $_inc_tmp" && break
4121 done
4124 dfb_version() {
4125 expr $1 \* 65536 + $2 \* 256 + $3
4128 if test "$_directfb" = yes; then
4129 cat > $TMPC << EOF
4130 #include <directfb_version.h>
4132 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4135 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4136 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4137 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4138 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4139 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4140 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4141 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4142 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4143 _res_comment="$_directfb_version"
4144 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4145 else
4146 def_directfb_version='#undef DIRECTFBVERSION'
4147 _directfb=no
4148 _res_comment="version >=0.9.13 required"
4150 else
4151 _directfb=no
4152 _res_comment="failed to get version"
4155 echores "$_directfb"
4157 if test "$_directfb" = yes ; then
4158 def_directfb='#define CONFIG_DIRECTFB 1'
4159 _vomodules="directfb $_vomodules"
4160 libs_mplayer="$libs_mplayer -ldirectfb"
4161 else
4162 def_directfb='#undef CONFIG_DIRECTFB'
4163 _novomodules="directfb $_novomodules"
4165 if test "$_dfbmga" = yes; then
4166 _vomodules="dfbmga $_vomodules"
4167 def_dfbmga='#define CONFIG_DFBMGA 1'
4168 else
4169 _novomodules="dfbmga $_novomodules"
4170 def_dfbmga='#undef CONFIG_DFBMGA'
4174 echocheck "X11 headers presence"
4175 _x11_headers="no"
4176 _res_comment="check if the dev(el) packages are installed"
4177 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4178 if test -f "$I/X11/Xlib.h" ; then
4179 _x11_headers="yes"
4180 _res_comment=""
4181 break
4183 done
4184 if test $_cross_compile = no; then
4185 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4186 /usr/include/X11R6 /usr/openwin/include ; do
4187 if test -f "$I/X11/Xlib.h" ; then
4188 extra_cflags="$extra_cflags -I$I"
4189 _x11_headers="yes"
4190 _res_comment="using $I"
4191 break
4193 done
4195 echores "$_x11_headers"
4198 echocheck "X11"
4199 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4200 cat > $TMPC <<EOF
4201 #include <X11/Xlib.h>
4202 #include <X11/Xutil.h>
4203 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4205 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4206 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4207 -L/usr/lib ; do
4208 if netbsd; then
4209 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4210 else
4211 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4213 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4214 && _x11=yes && break
4215 done
4217 if test "$_x11" = yes ; then
4218 def_x11='#define CONFIG_X11 1'
4219 _vomodules="x11 xover $_vomodules"
4220 else
4221 _x11=no
4222 def_x11='#undef CONFIG_X11'
4223 _novomodules="x11 $_novomodules"
4224 _res_comment="check if the dev(el) packages are installed"
4225 # disable stuff that depends on X
4226 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4228 echores "$_x11"
4230 echocheck "Xss screensaver extensions"
4231 if test "$_xss" = auto ; then
4232 cat > $TMPC << EOF
4233 #include <X11/Xlib.h>
4234 #include <X11/extensions/scrnsaver.h>
4235 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4237 _xss=no
4238 cc_check -lXss && _xss=yes
4240 if test "$_xss" = yes ; then
4241 def_xss='#define CONFIG_XSS 1'
4242 libs_mplayer="$libs_mplayer -lXss"
4243 else
4244 def_xss='#undef CONFIG_XSS'
4246 echores "$_xss"
4248 echocheck "DPMS"
4249 _xdpms3=no
4250 _xdpms4=no
4251 if test "$_x11" = yes ; then
4252 cat > $TMPC <<EOF
4253 #include <X11/Xmd.h>
4254 #include <X11/Xlib.h>
4255 #include <X11/Xutil.h>
4256 #include <X11/Xatom.h>
4257 #include <X11/extensions/dpms.h>
4258 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4260 cc_check -lXdpms && _xdpms3=yes
4261 cat > $TMPC <<EOF
4262 #include <X11/Xlib.h>
4263 #include <X11/extensions/dpms.h>
4264 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4266 cc_check -lXext && _xdpms4=yes
4268 if test "$_xdpms4" = yes ; then
4269 def_xdpms='#define CONFIG_XDPMS 1'
4270 _res_comment="using Xdpms 4"
4271 echores "yes"
4272 elif test "$_xdpms3" = yes ; then
4273 def_xdpms='#define CONFIG_XDPMS 1'
4274 libs_mplayer="$libs_mplayer -lXdpms"
4275 _res_comment="using Xdpms 3"
4276 echores "yes"
4277 else
4278 def_xdpms='#undef CONFIG_XDPMS'
4279 echores "no"
4283 echocheck "Xv"
4284 if test "$_xv" = auto ; then
4285 cat > $TMPC <<EOF
4286 #include <X11/Xlib.h>
4287 #include <X11/extensions/Xvlib.h>
4288 int main(void) {
4289 (void) XvGetPortAttribute(0, 0, 0, 0);
4290 (void) XvQueryPortAttributes(0, 0, 0);
4291 return 0; }
4293 _xv=no
4294 cc_check -lXv && _xv=yes
4297 if test "$_xv" = yes ; then
4298 def_xv='#define CONFIG_XV 1'
4299 libs_mplayer="$libs_mplayer -lXv"
4300 _vomodules="xv $_vomodules"
4301 else
4302 def_xv='#undef CONFIG_XV'
4303 _novomodules="xv $_novomodules"
4305 echores "$_xv"
4308 echocheck "XvMC"
4309 if test "$_xv" = yes && test "$_xvmc" != no ; then
4310 _xvmc=no
4311 cat > $TMPC <<EOF
4312 #include <X11/Xlib.h>
4313 #include <X11/extensions/Xvlib.h>
4314 #include <X11/extensions/XvMClib.h>
4315 int main(void) {
4316 (void) XvMCQueryExtension(0,0,0);
4317 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4318 return 0; }
4320 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4321 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4322 done
4324 if test "$_xvmc" = yes ; then
4325 def_xvmc='#define CONFIG_XVMC 1'
4326 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4327 _vomodules="xvmc $_vomodules"
4328 _res_comment="using $_xvmclib"
4329 else
4330 def_xvmc='#define CONFIG_XVMC 0'
4331 _novomodules="xvmc $_novomodules"
4333 echores "$_xvmc"
4336 echocheck "VDPAU"
4337 if test "$_vdpau" = auto ; then
4338 _vdpau=no
4339 if test "$_dl" = yes ; then
4340 cat > $TMPC <<EOF
4341 #include <vdpau/vdpau_x11.h>
4342 int main(void) {return VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE;}
4344 cc_check && _vdpau=yes
4347 if test "$_vdpau" = yes ; then
4348 def_vdpau='#define CONFIG_VDPAU 1'
4349 _vomodules="vdpau $_vomodules"
4350 else
4351 def_vdpau='#define CONFIG_VDPAU 0'
4352 _novomodules="vdpau $_novomodules"
4354 echores "$_vdpau"
4357 echocheck "Xinerama"
4358 if test "$_xinerama" = auto ; then
4359 cat > $TMPC <<EOF
4360 #include <X11/Xlib.h>
4361 #include <X11/extensions/Xinerama.h>
4362 int main(void) { (void) XineramaIsActive(0); return 0; }
4364 _xinerama=no
4365 cc_check -lXinerama && _xinerama=yes
4368 if test "$_xinerama" = yes ; then
4369 def_xinerama='#define CONFIG_XINERAMA 1'
4370 libs_mplayer="$libs_mplayer -lXinerama"
4371 else
4372 def_xinerama='#undef CONFIG_XINERAMA'
4374 echores "$_xinerama"
4377 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4378 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4379 # named 'X extensions' or something similar.
4380 # This check may be useful for future mplayer versions (to change resolution)
4381 # If you run into problems, remove '-lXxf86vm'.
4382 echocheck "Xxf86vm"
4383 if test "$_vm" = auto ; then
4384 cat > $TMPC <<EOF
4385 #include <X11/Xlib.h>
4386 #include <X11/extensions/xf86vmode.h>
4387 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4389 _vm=no
4390 cc_check -lXxf86vm && _vm=yes
4392 if test "$_vm" = yes ; then
4393 def_vm='#define CONFIG_XF86VM 1'
4394 libs_mplayer="$libs_mplayer -lXxf86vm"
4395 else
4396 def_vm='#undef CONFIG_XF86VM'
4398 echores "$_vm"
4400 # Check for the presence of special keycodes, like audio control buttons
4401 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4402 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4403 # have these new keycodes.
4404 echocheck "XF86keysym"
4405 if test "$_xf86keysym" = auto; then
4406 _xf86keysym=no
4407 cat > $TMPC <<EOF
4408 #include <X11/Xlib.h>
4409 #include <X11/XF86keysym.h>
4410 int main(void) { return XF86XK_AudioPause; }
4412 cc_check && _xf86keysym=yes
4414 if test "$_xf86keysym" = yes ; then
4415 def_xf86keysym='#define CONFIG_XF86XK 1'
4416 else
4417 def_xf86keysym='#undef CONFIG_XF86XK'
4419 echores "$_xf86keysym"
4421 echocheck "DGA"
4422 if test "$_dga2" = auto && test "$_x11" = yes ; then
4423 cat > $TMPC << EOF
4424 #include <X11/Xlib.h>
4425 #include <X11/extensions/xf86dga.h>
4426 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4428 _dga2=no
4429 cc_check -lXxf86dga && _dga2=yes
4431 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4432 cat > $TMPC << EOF
4433 #include <X11/Xlib.h>
4434 #include <X11/extensions/xf86dga.h>
4435 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4437 _dga1=no
4438 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4441 _dga=no
4442 def_dga='#undef CONFIG_DGA'
4443 def_dga1='#undef CONFIG_DGA1'
4444 def_dga2='#undef CONFIG_DGA2'
4445 if test "$_dga1" = yes ; then
4446 _dga=yes
4447 def_dga1='#define CONFIG_DGA1 1'
4448 _res_comment="using DGA 1.0"
4449 elif test "$_dga2" = yes ; then
4450 _dga=yes
4451 def_dga2='#define CONFIG_DGA2 1'
4452 _res_comment="using DGA 2.0"
4454 if test "$_dga" = yes ; then
4455 def_dga='#define CONFIG_DGA 1'
4456 libs_mplayer="$libs_mplayer -lXxf86dga"
4457 _vomodules="dga $_vomodules"
4458 else
4459 _novomodules="dga $_novomodules"
4461 echores "$_dga"
4464 echocheck "3dfx"
4465 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4466 def_3dfx='#define CONFIG_3DFX 1'
4467 _vomodules="3dfx $_vomodules"
4468 else
4469 def_3dfx='#undef CONFIG_3DFX'
4470 _novomodules="3dfx $_novomodules"
4472 echores "$_3dfx"
4474 echocheck "VIDIX"
4475 def_vidix='#undef CONFIG_VIDIX'
4476 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4477 _vidix_drv_cyberblade=no
4478 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4479 _vidix_drv_ivtv=no
4480 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4481 _vidix_drv_mach64=no
4482 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4483 _vidix_drv_mga=no
4484 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4485 _vidix_drv_mga_crtc2=no
4486 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4487 _vidix_drv_nvidia=no
4488 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4489 _vidix_drv_pm2=no
4490 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4491 _vidix_drv_pm3=no
4492 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4493 _vidix_drv_radeon=no
4494 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4495 _vidix_drv_rage128=no
4496 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4497 _vidix_drv_s3=no
4498 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4499 _vidix_drv_sh_veu=no
4500 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4501 _vidix_drv_sis=no
4502 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4503 _vidix_drv_unichrome=no
4504 if test "$_vidix" = auto ; then
4505 _vidix=no
4506 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4507 && _vidix=yes
4508 x86_64 && win32 && _vidix=no
4509 (ppc || alpha) && linux && _vidix=yes
4511 echores "$_vidix"
4513 if test "$_vidix" = yes ; then
4514 def_vidix='#define CONFIG_VIDIX 1'
4515 _vomodules="cvidix $_vomodules"
4516 # FIXME: ivtv driver temporarily disabled until we have a proper test
4517 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4518 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4520 # some vidix drivers are architecture and os specific, discard them elsewhere
4521 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4522 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4524 for driver in $_vidix_drivers ; do
4525 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4526 eval _vidix_drv_${driver}=yes
4527 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4528 done
4530 echocheck "VIDIX PCI device name database"
4531 echores "$_vidix_pcidb"
4532 if test "$_vidix_pcidb" = yes ; then
4533 _vidix_pcidb_val=1
4534 else
4535 _vidix_pcidb_val=0
4538 echocheck "VIDIX dhahelper support"
4539 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4540 echores "$_dhahelper"
4542 echocheck "VIDIX svgalib_helper support"
4543 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4544 echores "$_svgalib_helper"
4546 else
4547 _novomodules="cvidix $_novomodules"
4550 if test "$_vidix" = yes && win32; then
4551 winvidix=yes
4552 _vomodules="winvidix $_vomodules"
4553 libs_mplayer="$libs_mplayer -lgdi32"
4554 else
4555 _novomodules="winvidix $_novomodules"
4557 if test "$_vidix" = yes && test "$_x11" = yes; then
4558 xvidix=yes
4559 _vomodules="xvidix $_vomodules"
4560 else
4561 _novomodules="xvidix $_novomodules"
4564 echocheck "GGI"
4565 if test "$_ggi" = auto ; then
4566 cat > $TMPC << EOF
4567 #include <ggi/ggi.h>
4568 int main(void) { ggiInit(); return 0; }
4570 _ggi=no
4571 cc_check -lggi && _ggi=yes
4573 if test "$_ggi" = yes ; then
4574 def_ggi='#define CONFIG_GGI 1'
4575 libs_mplayer="$libs_mplayer -lggi"
4576 _vomodules="ggi $_vomodules"
4577 else
4578 def_ggi='#undef CONFIG_GGI'
4579 _novomodules="ggi $_novomodules"
4581 echores "$_ggi"
4583 echocheck "GGI extension: libggiwmh"
4584 if test "$_ggiwmh" = auto ; then
4585 _ggiwmh=no
4586 cat > $TMPC << EOF
4587 #include <ggi/ggi.h>
4588 #include <ggi/wmh.h>
4589 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4591 cc_check -lggi -lggiwmh && _ggiwmh=yes
4593 # needed to get right output on obscure combination
4594 # like --disable-ggi --enable-ggiwmh
4595 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4596 def_ggiwmh='#define CONFIG_GGIWMH 1'
4597 libs_mplayer="$libs_mplayer -lggiwmh"
4598 else
4599 _ggiwmh=no
4600 def_ggiwmh='#undef CONFIG_GGIWMH'
4602 echores "$_ggiwmh"
4605 echocheck "AA"
4606 if test "$_aa" = auto ; then
4607 cat > $TMPC << EOF
4608 #include <aalib.h>
4609 extern struct aa_hardware_params aa_defparams;
4610 extern struct aa_renderparams aa_defrenderparams;
4611 int main(void) {
4612 aa_context *c;
4613 aa_renderparams *p;
4614 (void) aa_init(0, 0, 0);
4615 c = aa_autoinit(&aa_defparams);
4616 p = aa_getrenderparams();
4617 aa_autoinitkbd(c,0);
4618 return 0; }
4620 _aa=no
4621 for _ld_tmp in "-laa" ; do
4622 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4623 done
4625 if test "$_aa" = yes ; then
4626 def_aa='#define CONFIG_AA 1'
4627 if cygwin ; then
4628 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4630 _vomodules="aa $_vomodules"
4631 else
4632 def_aa='#undef CONFIG_AA'
4633 _novomodules="aa $_novomodules"
4635 echores "$_aa"
4638 echocheck "CACA"
4639 if test "$_caca" = auto ; then
4640 _caca=no
4641 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4642 cat > $TMPC << EOF
4643 #include <caca.h>
4644 #ifdef CACA_API_VERSION_1
4645 #include <caca0.h>
4646 #endif
4647 int main(void) { (void) caca_init(); return 0; }
4649 cc_check $(caca-config --libs) && _caca=yes
4652 if test "$_caca" = yes ; then
4653 def_caca='#define CONFIG_CACA 1'
4654 extra_cflags="$extra_cflags $(caca-config --cflags)"
4655 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4656 _vomodules="caca $_vomodules"
4657 else
4658 def_caca='#undef CONFIG_CACA'
4659 _novomodules="caca $_novomodules"
4661 echores "$_caca"
4664 echocheck "SVGAlib"
4665 if test "$_svga" = auto ; then
4666 cat > $TMPC << EOF
4667 #include <vga.h>
4668 int main(void) { return 0; }
4670 _svga=no
4671 cc_check -lvga $_ld_lm && _svga=yes
4673 if test "$_svga" = yes ; then
4674 def_svga='#define CONFIG_SVGALIB 1'
4675 libs_mplayer="$libs_mplayer -lvga"
4676 _vomodules="svga $_vomodules"
4677 else
4678 def_svga='#undef CONFIG_SVGALIB'
4679 _novomodules="svga $_novomodules"
4681 echores "$_svga"
4684 echocheck "FBDev"
4685 if test "$_fbdev" = auto ; then
4686 _fbdev=no
4687 linux && _fbdev=yes
4689 if test "$_fbdev" = yes ; then
4690 def_fbdev='#define CONFIG_FBDEV 1'
4691 _vomodules="fbdev $_vomodules"
4692 else
4693 def_fbdev='#undef CONFIG_FBDEV'
4694 _novomodules="fbdev $_novomodules"
4696 echores "$_fbdev"
4700 echocheck "DVB"
4701 if test "$_dvb" = auto ; then
4702 _dvb=no
4703 cat >$TMPC << EOF
4704 #include <poll.h>
4705 #include <sys/ioctl.h>
4706 #include <stdio.h>
4707 #include <time.h>
4708 #include <unistd.h>
4709 #include <ost/dmx.h>
4710 #include <ost/frontend.h>
4711 #include <ost/sec.h>
4712 #include <ost/video.h>
4713 #include <ost/audio.h>
4714 int main(void) {return 0;}
4716 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4717 cc_check $_inc_tmp && _dvb=yes && \
4718 extra_cflags="$extra_cflags $_inc_tmp" && break
4719 done
4721 echores "$_dvb"
4722 if test "$_dvb" = yes ; then
4723 def_dvb='#define CONFIG_DVB 1'
4724 def_dvbin='#define CONFIG_DVBIN 1'
4725 _aomodules="mpegpes(dvb) $_aomodules"
4726 _vomodules="mpegpes(dvb) $_vomodules"
4729 echocheck "DVB HEAD"
4730 if test "$_dvbhead" = auto ; then
4731 _dvbhead=no
4733 cat >$TMPC << EOF
4734 #include <poll.h>
4735 #include <sys/ioctl.h>
4736 #include <stdio.h>
4737 #include <time.h>
4738 #include <unistd.h>
4739 #include <linux/dvb/dmx.h>
4740 #include <linux/dvb/frontend.h>
4741 #include <linux/dvb/video.h>
4742 #include <linux/dvb/audio.h>
4743 int main(void) {return 0;}
4745 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4746 cc_check $_inc_tmp && _dvbhead=yes && \
4747 extra_cflags="$extra_cflags $_inc_tmp" && break
4748 done
4750 echores "$_dvbhead"
4751 if test "$_dvbhead" = yes ; then
4752 def_dvb='#define CONFIG_DVB 1'
4753 def_dvb_head='#define CONFIG_DVB_HEAD 1'
4754 def_dvbin='#define CONFIG_DVBIN 1'
4755 _aomodules="mpegpes(dvb) $_aomodules"
4756 _vomodules="mpegpes(dvb) $_vomodules"
4759 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4760 def_dvb='#undef CONFIG_DVB'
4761 def_dvb_head='#undef CONFIG_DVB_HEAD'
4762 def_dvbin='#undef CONFIG_DVBIN '
4763 _aomodules="mpegpes(file) $_aomodules"
4764 _vomodules="mpegpes(file) $_vomodules"
4767 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4768 _dvbin=yes
4769 _inputmodules="dvb $_inputmodules"
4770 else
4771 _dvbin=no
4772 _noinputmodules="dvb $_noinputmodules"
4776 if darwin; then
4778 echocheck "QuickTime"
4779 if test "$quicktime" = auto ; then
4780 cat > $TMPC <<EOF
4781 #include <QuickTime/QuickTime.h>
4782 int main(void) {
4783 ImageDescription *desc;
4784 EnterMovies();
4785 ExitMovies();
4786 return 0;
4789 quicktime=no
4790 cc_check -framework QuickTime && quicktime=yes
4792 if test "$quicktime" = yes ; then
4793 extra_ldflags="$extra_ldflags -framework QuickTime"
4794 def_quicktime='#define CONFIG_QUICKTIME 1'
4795 else
4796 def_quicktime='#undef CONFIG_QUICKTIME'
4797 _quartz=no
4799 echores $quicktime
4801 echocheck "Quartz"
4802 if test "$_quartz" = auto ; then
4803 cat > $TMPC <<EOF
4804 #include <Carbon/Carbon.h>
4805 int main(void) {
4806 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
4807 return 0;
4810 _quartz=no
4811 cc_check -framework Carbon && _quartz=yes
4813 if test "$_quartz" = yes ; then
4814 libs_mplayer="$libs_mplayer -framework Carbon"
4815 def_quartz='#define CONFIG_QUARTZ 1'
4816 _vomodules="quartz $_vomodules"
4817 else
4818 def_quartz='#undef CONFIG_QUARTZ'
4819 _novomodules="quartz $_novomodules"
4821 echores $_quartz
4823 echocheck "CoreVideo"
4824 if test "$_corevideo" = auto ; then
4825 cat > $TMPC <<EOF
4826 #include <Carbon/Carbon.h>
4827 #include <CoreServices/CoreServices.h>
4828 #include <OpenGL/OpenGL.h>
4829 #include <QuartzCore/CoreVideo.h>
4830 int main(void) { return 0; }
4832 _corevideo=no
4833 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4835 if test "$_corevideo" = yes ; then
4836 _vomodules="corevideo $_vomodules"
4837 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4838 def_corevideo='#define CONFIG_COREVIDEO 1'
4839 else
4840 _novomodules="corevideo $_novomodules"
4841 def_corevideo='#undef CONFIG_COREVIDEO'
4843 echores "$_corevideo"
4845 fi #if darwin
4848 # make sure this stays below CoreVideo to avoid issues due to namespace
4849 # conflicts between -lGL and -framework OpenGL
4850 echocheck "OpenGL"
4851 #Note: this test is run even with --enable-gl since we autodetect linker flags
4852 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4853 cat > $TMPC << EOF
4854 #ifdef GL_WIN32
4855 #include <windows.h>
4856 #include <GL/gl.h>
4857 #else
4858 #include <GL/gl.h>
4859 #include <X11/Xlib.h>
4860 #include <GL/glx.h>
4861 #endif
4862 int main(void) {
4863 #ifdef GL_WIN32
4864 HDC dc;
4865 wglCreateContext(dc);
4866 #else
4867 glXCreateContext(NULL, NULL, NULL, True);
4868 #endif
4869 glFinish();
4870 return 0;
4873 _gl=no
4874 for _ld_tmp in -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4875 if cc_check $_ld_tmp $_ld_lm ; then
4876 _gl=yes
4877 _gl_x11=yes
4878 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4879 break
4881 done
4882 if cc_check -DGL_WIN32 -lopengl32 ; then
4883 _gl=yes
4884 _gl_win32=yes
4885 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4887 else
4888 _gl=no
4890 if test "$_gl" = yes ; then
4891 def_gl='#define CONFIG_GL 1'
4892 _res_comment="backends:"
4893 if test "$_gl_win32" = yes ; then
4894 def_gl_win32='#define CONFIG_GL_WIN32 1'
4895 _res_comment="$_res_comment win32"
4897 if test "$_gl_x11" = yes ; then
4898 def_gl_x11='#define CONFIG_GL_X11 1'
4899 _res_comment="$_res_comment x11"
4901 _vomodules="opengl $_vomodules"
4902 else
4903 def_gl='#undef CONFIG_GL'
4904 def_gl_win32='#undef CONFIG_GL_WIN32'
4905 def_gl_x11='#undef CONFIG_GL_X11'
4906 _novomodules="opengl $_novomodules"
4908 echores "$_gl"
4910 echocheck "MatrixView"
4911 if test "$_gl" = no ; then
4912 matrixview=no
4914 if test "$matrixview" = yes ; then
4915 _vomodules="matrixview $_vomodules"
4916 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4917 else
4918 _novomodules="matrixview $_novomodules"
4919 def_matrixview='#undef CONFIG_MATRIXVIEW'
4921 echores "$matrixview"
4924 echocheck "PNG support"
4925 if test "$_png" = auto ; then
4926 _png=no
4927 if irix ; then
4928 # Don't check for -lpng on irix since it has its own libpng
4929 # incompatible with the GNU libpng
4930 _res_comment="disabled on irix (not GNU libpng)"
4931 else
4932 cat > $TMPC << EOF
4933 #include <png.h>
4934 #include <string.h>
4935 int main(void) {
4936 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4937 printf("libpng: %s\n", png_libpng_ver);
4938 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4941 cc_check -lpng -lz $_ld_lm && _png=yes
4944 echores "$_png"
4945 if test "$_png" = yes ; then
4946 def_png='#define CONFIG_PNG 1'
4947 extra_ldflags="$extra_ldflags -lpng -lz"
4948 else
4949 def_png='#undef CONFIG_PNG'
4952 echocheck "MNG support"
4953 if test "$_mng" = auto ; then
4954 _mng=no
4955 cat > $TMPC << EOF
4956 #include <libmng.h>
4957 int main(void) {
4958 const char * p_ver = mng_version_text();
4959 return !p_ver || p_ver[0] == 0;
4962 if cc_check -lmng -lz $_ld_lm ; then
4963 _mng=yes
4966 echores "$_mng"
4967 if test "$_mng" = yes ; then
4968 def_mng='#define CONFIG_MNG 1'
4969 extra_ldflags="$extra_ldflags -lmng -lz"
4970 else
4971 def_mng='#undef CONFIG_MNG'
4974 echocheck "JPEG support"
4975 if test "$_jpeg" = auto ; then
4976 _jpeg=no
4977 cat > $TMPC << EOF
4978 #include <stdio.h>
4979 #include <stdlib.h>
4980 #include <setjmp.h>
4981 #include <string.h>
4982 #include <jpeglib.h>
4983 int main(void) { return 0; }
4985 cc_check -ljpeg $_ld_lm && _jpeg=yes
4987 echores "$_jpeg"
4989 if test "$_jpeg" = yes ; then
4990 def_jpeg='#define CONFIG_JPEG 1'
4991 _vomodules="jpeg $_vomodules"
4992 extra_ldflags="$extra_ldflags -ljpeg"
4993 else
4994 def_jpeg='#undef CONFIG_JPEG'
4995 _novomodules="jpeg $_novomodules"
5000 echocheck "PNM support"
5001 if test "$_pnm" = yes; then
5002 def_pnm="#define CONFIG_PNM 1"
5003 _vomodules="pnm $_vomodules"
5004 else
5005 def_pnm="#undef CONFIG_PNM"
5006 _novomodules="pnm $_novomodules"
5008 echores "$_pnm"
5012 echocheck "GIF support"
5013 # This is to appease people who want to force gif support.
5014 # If it is forced to yes, then we still do checks to determine
5015 # which gif library to use.
5016 if test "$_gif" = yes ; then
5017 _force_gif=yes
5018 _gif=auto
5021 if test "$_gif" = auto ; then
5022 _gif=no
5023 cat > $TMPC << EOF
5024 #include <gif_lib.h>
5025 int main(void) { return 0; }
5027 for _ld_gif in "-lungif" "-lgif" ; do
5028 cc_check $_ld_gif && _gif=yes && break
5029 done
5032 # If no library was found, and the user wants support forced,
5033 # then we force it on with libgif, as this is the safest
5034 # assumption IMHO. (libungif & libregif both create symbolic
5035 # links to libgif. We also assume that no x11 support is needed,
5036 # because if you are forcing this, then you _should_ know what
5037 # you are doing. [ Besides, package maintainers should never
5038 # have compiled x11 deps into libungif in the first place. ] )
5039 # </rant>
5040 # --Joey
5041 if test "$_force_gif" = yes && test "$_gif" = no ; then
5042 _gif=yes
5043 _ld_gif="-lgif"
5046 if test "$_gif" = yes ; then
5047 def_gif='#define CONFIG_GIF 1'
5048 _codecmodules="gif $_codecmodules"
5049 _vomodules="gif89a $_vomodules"
5050 _res_comment="old version, some encoding functions disabled"
5051 def_gif_4='#undef CONFIG_GIF_4'
5052 extra_ldflags="$extra_ldflags $_ld_gif"
5054 cat > $TMPC << EOF
5055 #include <signal.h>
5056 #include <gif_lib.h>
5057 void catch() { exit(1); }
5058 int main(void) {
5059 signal(SIGSEGV, catch); // catch segfault
5060 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5061 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5062 return 0;
5065 if cc_check "$_ld_gif" ; then
5066 def_gif_4='#define CONFIG_GIF_4 1'
5067 _res_comment=""
5069 else
5070 def_gif='#undef CONFIG_GIF'
5071 def_gif_4='#undef CONFIG_GIF_4'
5072 _novomodules="gif89a $_novomodules"
5073 _nocodecmodules="gif $_nocodecmodules"
5075 echores "$_gif"
5078 case "$_gif" in yes*)
5079 echocheck "broken giflib workaround"
5080 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5082 cat > $TMPC << EOF
5083 #include <gif_lib.h>
5084 int main(void) {
5085 GifFileType gif;
5086 printf("UserData is at address %p\n", gif.UserData);
5087 return 0;
5090 if cc_check "$_ld_gif" ; then
5091 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5092 echores "disabled"
5093 else
5094 echores "enabled"
5097 esac
5100 echocheck "VESA support"
5101 if test "$_vesa" = auto ; then
5102 cat > $TMPC << EOF
5103 #include <vbe.h>
5104 int main(void) { vbeVersion(); return 0; }
5106 _vesa=no
5107 cc_check -lvbe -llrmi && _vesa=yes
5109 if test "$_vesa" = yes ; then
5110 def_vesa='#define CONFIG_VESA 1'
5111 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5112 _vomodules="vesa $_vomodules"
5113 else
5114 def_vesa='#undef CONFIG_VESA'
5115 _novomodules="vesa $_novomodules"
5117 echores "$_vesa"
5119 #################
5120 # VIDEO + AUDIO #
5121 #################
5124 echocheck "SDL"
5125 _inc_tmp=""
5126 _ld_tmp=""
5127 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5128 if test -z "$_sdlconfig" ; then
5129 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5130 _sdlconfig="sdl-config"
5131 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5132 _sdlconfig="sdl11-config"
5133 else
5134 _sdlconfig=false
5137 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5138 cat > $TMPC << EOF
5139 #ifdef CONFIG_SDL_SDL_H
5140 #include <SDL/SDL.h>
5141 #else
5142 #include <SDL.h>
5143 #endif
5144 #ifndef __APPLE__
5145 // we allow SDL hacking our main() only on OSX
5146 #undef main
5147 #endif
5148 int main(int argc, char *argv[]) {
5149 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5150 return 0;
5153 _sdl=no
5154 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
5155 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5156 _sdl=yes
5157 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5158 break
5160 done
5161 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5162 _res_comment="using $_sdlconfig"
5163 if cygwin ; then
5164 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5165 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5166 elif mingw32 ; then
5167 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5168 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5169 else
5170 _inc_tmp="$($_sdlconfig --cflags)"
5171 _ld_tmp="$($_sdlconfig --libs)"
5173 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5174 _sdlversion=$($_sdlconfig --version | sed 's/[^0-9]//g')
5175 if test "$_sdlversion" -gt 116 ; then
5176 if test "$_sdlversion" -lt 121 ; then
5177 def_sdlbuggy='#define BUGGY_SDL'
5178 else
5179 def_sdlbuggy='#undef BUGGY_SDL'
5181 _sdl=yes
5186 if test "$_sdl" = yes ; then
5187 def_sdl='#define CONFIG_SDL 1'
5188 extra_cflags="$extra_cflags $_inc_tmp"
5189 libs_mplayer="$libs_mplayer $_ld_tmp"
5190 _vomodules="sdl $_vomodules"
5191 _aomodules="sdl $_aomodules"
5192 else
5193 def_sdl='#undef CONFIG_SDL'
5194 _novomodules="sdl $_novomodules"
5195 _noaomodules="sdl $_noaomodules"
5197 echores "$_sdl"
5200 if os2 ; then
5201 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5202 if test "$_kva" = auto; then
5203 cat > $TMPC << EOF
5204 #include <os2.h>
5205 #include <kva.h>
5206 int main( void ) { return 0; }
5208 _kva=no;
5209 cc_check -lkva && _kva=yes
5211 if test "$_kva" = yes ; then
5212 def_kva='#define CONFIG_KVA 1'
5213 libs_mplayer="$libs_mplayer -lkva"
5214 _vomodules="kva $_vomodules"
5215 else
5216 def_kva='#undef CONFIG_KVA'
5217 _novomodules="kva $_novomodules"
5219 echores "$_kva"
5220 fi #if os2
5223 if win32; then
5225 echocheck "Windows waveout"
5226 if test "$_win32waveout" = auto ; then
5227 cat > $TMPC << EOF
5228 #include <windows.h>
5229 #include <mmsystem.h>
5230 int main(void) { return 0; }
5232 _win32waveout=no
5233 cc_check -lwinmm && _win32waveout=yes
5235 if test "$_win32waveout" = yes ; then
5236 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5237 libs_mplayer="$libs_mplayer -lwinmm"
5238 _aomodules="win32 $_aomodules"
5239 else
5240 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5241 _noaomodules="win32 $_noaomodules"
5243 echores "$_win32waveout"
5245 echocheck "Direct3D"
5246 if test "$_direct3d" = auto ; then
5247 cat > $TMPC << EOF
5248 #include <windows.h>
5249 #include <d3d9.h>
5250 int main(void) { return 0; }
5252 _direct3d=no
5253 cc_check && _direct3d=yes
5255 if test "$_direct3d" = yes ; then
5256 def_direct3d='#define CONFIG_DIRECT3D 1'
5257 _vomodules="direct3d $_vomodules"
5258 else
5259 def_direct3d='#undef CONFIG_DIRECT3D'
5260 _novomodules="direct3d $_novomodules"
5262 echores "$_direct3d"
5264 echocheck "Directx"
5265 if test "$_directx" = auto ; then
5266 cat > $TMPC << EOF
5267 #include <windows.h>
5268 #include <ddraw.h>
5269 #include <dsound.h>
5270 int main(void) { return 0; }
5272 _directx=no
5273 cc_check -lgdi32 && _directx=yes
5275 if test "$_directx" = yes ; then
5276 def_directx='#define CONFIG_DIRECTX 1'
5277 libs_mplayer="$libs_mplayer -lgdi32"
5278 _vomodules="directx $_vomodules"
5279 _aomodules="dsound $_aomodules"
5280 else
5281 def_directx='#undef CONFIG_DIRECTX'
5282 _novomodules="directx $_novomodules"
5283 _noaomodules="dsound $_noaomodules"
5285 echores "$_directx"
5287 fi #if win32; then
5290 echocheck "DXR2"
5291 if test "$_dxr2" = auto; then
5292 _dxr2=no
5293 cat > $TMPC << EOF
5294 #include <dxr2ioctl.h>
5295 int main(void) { return 0; }
5297 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5298 cc_check $_inc_tmp && _dxr2=yes && \
5299 extra_cflags="$extra_cflags $_inc_tmp" && break
5300 done
5302 if test "$_dxr2" = yes; then
5303 def_dxr2='#define CONFIG_DXR2 1'
5304 _aomodules="dxr2 $_aomodules"
5305 _vomodules="dxr2 $_vomodules"
5306 else
5307 def_dxr2='#undef CONFIG_DXR2'
5308 _noaomodules="dxr2 $_noaomodules"
5309 _novomodules="dxr2 $_novomodules"
5311 echores "$_dxr2"
5313 echocheck "DXR3/H+"
5314 if test "$_dxr3" = auto ; then
5315 cat > $TMPC << EOF
5316 #include <linux/em8300.h>
5317 int main(void) { return 0; }
5319 _dxr3=no
5320 cc_check && _dxr3=yes
5322 if test "$_dxr3" = yes ; then
5323 def_dxr3='#define CONFIG_DXR3 1'
5324 _vomodules="dxr3 $_vomodules"
5325 else
5326 def_dxr3='#undef CONFIG_DXR3'
5327 _novomodules="dxr3 $_novomodules"
5329 echores "$_dxr3"
5332 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5333 if test "$_ivtv" = auto ; then
5334 cat > $TMPC << EOF
5335 #include <stdlib.h>
5336 #include <inttypes.h>
5337 #include <linux/types.h>
5338 #include <linux/videodev2.h>
5339 #include <linux/ivtv.h>
5340 #include <sys/ioctl.h>
5341 int main(void) {
5342 struct ivtv_cfg_stop_decode sd;
5343 struct ivtv_cfg_start_decode sd1;
5344 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5345 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5346 return 0; }
5348 _ivtv=no
5349 cc_check && _ivtv=yes
5351 if test "$_ivtv" = yes ; then
5352 def_ivtv='#define CONFIG_IVTV 1'
5353 _vomodules="ivtv $_vomodules"
5354 _aomodules="ivtv $_aomodules"
5355 else
5356 def_ivtv='#undef CONFIG_IVTV'
5357 _novomodules="ivtv $_novomodules"
5358 _noaomodules="ivtv $_noaomodules"
5360 echores "$_ivtv"
5363 echocheck "V4L2 MPEG Decoder"
5364 if test "$_v4l2" = auto ; then
5365 cat > $TMPC << EOF
5366 #include <stdlib.h>
5367 #include <inttypes.h>
5368 #include <linux/types.h>
5369 #include <linux/videodev2.h>
5370 #include <linux/version.h>
5371 int main(void) {
5372 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5373 #error kernel headers too old, need 2.6.22
5374 #endif
5375 struct v4l2_ext_controls ctrls;
5376 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5377 return 0;
5380 _v4l2=no
5381 cc_check && _v4l2=yes
5383 if test "$_v4l2" = yes ; then
5384 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5385 _vomodules="v4l2 $_vomodules"
5386 _aomodules="v4l2 $_aomodules"
5387 else
5388 def_v4l2='#undef CONFIG_V4L2_DECODER'
5389 _novomodules="v4l2 $_novomodules"
5390 _noaomodules="v4l2 $_noaomodules"
5392 echores "$_v4l2"
5396 #########
5397 # AUDIO #
5398 #########
5401 echocheck "OSS Audio"
5402 if test "$_ossaudio" = auto ; then
5403 cat > $TMPC << EOF
5404 #include <sys/ioctl.h>
5405 #include <$_soundcard_header>
5406 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5408 _ossaudio=no
5409 cc_check && _ossaudio=yes
5411 if test "$_ossaudio" = yes ; then
5412 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5413 _aomodules="oss $_aomodules"
5414 if test "$_linux_devfs" = yes; then
5415 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5416 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5417 else
5418 cat > $TMPC << EOF
5419 #include <sys/ioctl.h>
5420 #include <$_soundcard_header>
5421 #ifdef OPEN_SOUND_SYSTEM
5422 int main(void) { return 0; }
5423 #else
5424 #error Not the real thing
5425 #endif
5427 _real_ossaudio=no
5428 cc_check && _real_ossaudio=yes
5429 if test "$_real_ossaudio" = yes; then
5430 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5431 # Check for OSS4 headers (override default headers)
5432 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5433 if test -f /etc/oss.conf; then
5434 . /etc/oss.conf
5435 _ossinc="$OSSLIBDIR/include"
5436 if test -f "$_ossinc/sys/soundcard.h"; then
5437 extra_cflags="-I$_ossinc $extra_cflags"
5440 elif netbsd || openbsd ; then
5441 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5442 extra_ldflags="$extra_ldflags -lossaudio"
5443 else
5444 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5446 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5448 else
5449 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5450 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5451 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5452 _noaomodules="oss $_noaomodules"
5454 echores "$_ossaudio"
5457 echocheck "aRts"
5458 if test "$_arts" = auto ; then
5459 _arts=no
5460 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5462 cat > $TMPC << EOF
5463 #include <artsc.h>
5464 int main(void) { return 0; }
5466 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5471 if test "$_arts" = yes ; then
5472 def_arts='#define CONFIG_ARTS 1'
5473 _aomodules="arts $_aomodules"
5474 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5475 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5476 else
5477 _noaomodules="arts $_noaomodules"
5479 echores "$_arts"
5482 echocheck "EsounD"
5483 if test "$_esd" = auto ; then
5484 _esd=no
5485 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5487 cat > $TMPC << EOF
5488 #include <esd.h>
5489 int main(void) { int fd = esd_open_sound("test"); return fd; }
5491 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5495 echores "$_esd"
5497 if test "$_esd" = yes ; then
5498 def_esd='#define CONFIG_ESD 1'
5499 _aomodules="esd $_aomodules"
5500 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5501 extra_cflags="$extra_cflags $(esd-config --cflags)"
5503 echocheck "esd_get_latency()"
5504 cat > $TMPC << EOF
5505 #include <esd.h>
5506 int main(void) { return esd_get_latency(0); }
5508 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5509 echores "$_esd_latency"
5510 else
5511 def_esd='#undef CONFIG_ESD'
5512 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5513 _noaomodules="esd $_noaomodules"
5517 echocheck "NAS"
5518 if test "$_nas" = auto ; then
5519 cat > $TMPC << EOF
5520 #include <audio/audiolib.h>
5521 int main(void) { return 0; }
5523 _nas=no
5524 cc_check $_ld_lm -laudio -lXt && _nas=yes
5526 if test "$_nas" = yes ; then
5527 def_nas='#define CONFIG_NAS 1'
5528 libs_mplayer="$libs_mplayer -laudio -lXt"
5529 _aomodules="nas $_aomodules"
5530 else
5531 _noaomodules="nas $_noaomodules"
5532 def_nas='#undef CONFIG_NAS'
5534 echores "$_nas"
5537 echocheck "pulse"
5538 if test "$_pulse" = auto ; then
5539 _pulse=no
5540 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5542 cat > $TMPC << EOF
5543 #include <pulse/pulseaudio.h>
5544 int main(void) { return 0; }
5546 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5550 echores "$_pulse"
5552 if test "$_pulse" = yes ; then
5553 def_pulse='#define CONFIG_PULSE 1'
5554 _aomodules="pulse $_aomodules"
5555 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5556 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5557 else
5558 def_pulse='#undef CONFIG_PULSE'
5559 _noaomodules="pulse $_noaomodules"
5563 echocheck "JACK"
5564 if test "$_jack" = auto ; then
5565 _jack=yes
5567 cat > $TMPC << EOF
5568 #include <jack/jack.h>
5569 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5571 if cc_check -ljack ; then
5572 libs_mplayer="$libs_mplayer -ljack"
5573 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5574 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5575 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5576 else
5577 _jack=no
5581 if test "$_jack" = yes ; then
5582 def_jack='#define CONFIG_JACK 1'
5583 _aomodules="jack $_aomodules"
5584 else
5585 _noaomodules="jack $_noaomodules"
5587 echores "$_jack"
5589 echocheck "OpenAL"
5590 if test "$_openal" = auto ; then
5591 _openal=no
5592 cat > $TMPC << EOF
5593 #ifdef OPENAL_AL_H
5594 #include <OpenAL/al.h>
5595 #else
5596 #include <AL/al.h>
5597 #endif
5598 int main(void) {
5599 alSourceQueueBuffers(0, 0, 0);
5600 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5601 return 0;
5604 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5605 cc_check $I && _openal=yes && break
5606 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5607 done
5608 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5610 if test "$_openal" = yes ; then
5611 def_openal='#define CONFIG_OPENAL 1'
5612 _aomodules="openal $_aomodules"
5613 else
5614 _noaomodules="openal $_noaomodules"
5616 echores "$_openal"
5618 echocheck "ALSA audio"
5619 if test "$_alloca" != yes ; then
5620 _alsa=no
5621 _res_comment="alloca missing"
5623 if test "$_alsa" != no ; then
5624 _alsa=no
5625 cat > $TMPC << EOF
5626 #include <sys/time.h>
5627 #include <sys/asoundlib.h>
5628 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5629 #error "alsa version != 0.5.x"
5630 #endif
5631 int main(void) { return 0; }
5633 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5635 cat > $TMPC << EOF
5636 #include <sys/time.h>
5637 #include <sys/asoundlib.h>
5638 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5639 #error "alsa version != 0.9.x"
5640 #endif
5641 int main(void) { return 0; }
5643 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5644 cat > $TMPC << EOF
5645 #include <sys/time.h>
5646 #include <alsa/asoundlib.h>
5647 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5648 #error "alsa version != 0.9.x"
5649 #endif
5650 int main(void) { return 0; }
5652 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5654 cat > $TMPC << EOF
5655 #include <sys/time.h>
5656 #include <sys/asoundlib.h>
5657 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5658 #error "alsa version != 1.0.x"
5659 #endif
5660 int main(void) { return 0; }
5662 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5663 cat > $TMPC << EOF
5664 #include <sys/time.h>
5665 #include <alsa/asoundlib.h>
5666 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5667 #error "alsa version != 1.0.x"
5668 #endif
5669 int main(void) { return 0; }
5671 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5673 def_alsa='#undef CONFIG_ALSA'
5674 def_alsa5='#undef CONFIG_ALSA5'
5675 def_alsa9='#undef CONFIG_ALSA9'
5676 def_alsa1x='#undef CONFIG_ALSA1X'
5677 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5678 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5679 if test "$_alsaver" ; then
5680 _alsa=yes
5681 if test "$_alsaver" = '0.5.x' ; then
5682 _alsa5=yes
5683 _aomodules="alsa5 $_aomodules"
5684 def_alsa5='#define CONFIG_ALSA5 1'
5685 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5686 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5687 elif test "$_alsaver" = '0.9.x-sys' ; then
5688 _alsa9=yes
5689 _aomodules="alsa $_aomodules"
5690 def_alsa='#define CONFIG_ALSA 1'
5691 def_alsa9='#define CONFIG_ALSA9 1'
5692 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5693 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5694 elif test "$_alsaver" = '0.9.x-alsa' ; then
5695 _alsa9=yes
5696 _aomodules="alsa $_aomodules"
5697 def_alsa='#define CONFIG_ALSA 1'
5698 def_alsa9='#define CONFIG_ALSA9 1'
5699 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5700 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5701 elif test "$_alsaver" = '1.0.x-sys' ; then
5702 _alsa1x=yes
5703 _aomodules="alsa $_aomodules"
5704 def_alsa='#define CONFIG_ALSA 1'
5705 def_alsa1x="#define CONFIG_ALSA1X 1"
5706 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5707 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5708 elif test "$_alsaver" = '1.0.x-alsa' ; then
5709 _alsa1x=yes
5710 _aomodules="alsa $_aomodules"
5711 def_alsa='#define CONFIG_ALSA 1'
5712 def_alsa1x="#define CONFIG_ALSA1X 1"
5713 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5714 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5715 else
5716 _alsa=no
5717 _res_comment="unknown version"
5719 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5720 else
5721 _noaomodules="alsa $_noaomodules"
5723 echores "$_alsa"
5726 echocheck "Sun audio"
5727 if test "$_sunaudio" = auto ; then
5728 cat > $TMPC << EOF
5729 #include <sys/types.h>
5730 #include <sys/audioio.h>
5731 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5733 _sunaudio=no
5734 cc_check && _sunaudio=yes
5736 if test "$_sunaudio" = yes ; then
5737 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5738 _aomodules="sun $_aomodules"
5739 else
5740 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5741 _noaomodules="sun $_noaomodules"
5743 echores "$_sunaudio"
5746 def_mlib='#define CONFIG_MLIB 0'
5747 if sunos; then
5748 echocheck "Sun mediaLib"
5749 if test "$_mlib" = auto ; then
5750 _mlib=no
5751 cat > $TMPC << EOF
5752 #include <mlib.h>
5753 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5755 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5757 echores "$_mlib"
5758 fi #if sunos
5761 if darwin; then
5762 echocheck "CoreAudio"
5763 if test "$_coreaudio" = auto ; then
5764 cat > $TMPC <<EOF
5765 #include <CoreAudio/CoreAudio.h>
5766 #include <AudioToolbox/AudioToolbox.h>
5767 #include <AudioUnit/AudioUnit.h>
5768 int main(void) { return 0; }
5770 _coreaudio=no
5771 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5773 if test "$_coreaudio" = yes ; then
5774 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5775 def_coreaudio='#define CONFIG_COREAUDIO 1'
5776 _aomodules="coreaudio $_aomodules"
5777 else
5778 def_coreaudio='#undef CONFIG_COREAUDIO'
5779 _noaomodules="coreaudio $_noaomodules"
5781 echores $_coreaudio
5782 fi #if darwin
5785 if irix; then
5786 echocheck "SGI audio"
5787 if test "$_sgiaudio" = auto ; then
5788 # check for SGI audio
5789 cat > $TMPC << EOF
5790 #include <dmedia/audio.h>
5791 int main(void) { return 0; }
5793 _sgiaudio=no
5794 cc_check && _sgiaudio=yes
5796 if test "$_sgiaudio" = "yes" ; then
5797 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5798 libs_mplayer="$libs_mplayer -laudio"
5799 _aomodules="sgi $_aomodules"
5800 else
5801 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5802 _noaomodules="sgi $_noaomodules"
5804 echores "$_sgiaudio"
5805 fi #if irix
5808 if os2 ; then
5809 echocheck "DART"
5810 if test "$_dart" = auto; then
5811 cat > $TMPC << EOF
5812 #include <os2.h>
5813 #include <dart.h>
5814 int main( void ) { return 0; }
5816 _dart=no;
5817 cc_check -ldart && _dart=yes
5819 if test "$_dart" = yes ; then
5820 def_dart='#define CONFIG_DART 1'
5821 libs_mplayer="$libs_mplayer -ldart"
5822 _aomodules="dart $_aomodules"
5823 else
5824 def_dart='#undef CONFIG_DART'
5825 _noaomodules="dart $_noaomodules"
5827 echores "$_dart"
5828 fi #if os2
5831 # set default CD/DVD devices
5832 if win32 || os2 ; then
5833 default_cdrom_device="D:"
5834 elif darwin ; then
5835 default_cdrom_device="/dev/disk1"
5836 elif dragonfly ; then
5837 default_cdrom_device="/dev/cd0"
5838 elif freebsd ; then
5839 default_cdrom_device="/dev/acd0"
5840 elif openbsd ; then
5841 default_cdrom_device="/dev/rcd0a"
5842 elif sunos ; then
5843 default_cdrom_device="/vol/dev/aliases/cdrom0"
5844 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5845 # file system and the volfs service.
5846 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5847 elif amigaos ; then
5848 default_cdrom_device="a1ide.device:2"
5849 else
5850 default_cdrom_device="/dev/cdrom"
5853 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5854 default_dvd_device=$default_cdrom_device
5855 elif darwin ; then
5856 default_dvd_device="/dev/rdiskN"
5857 else
5858 default_dvd_device="/dev/dvd"
5862 echocheck "VCD support"
5863 if test "$_vcd" = auto; then
5864 _vcd=no
5865 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
5866 _vcd=yes
5867 elif mingw32; then
5868 cat > $TMPC << EOF
5869 #include <ddk/ntddcdrm.h>
5870 int main(void) { return 0; }
5872 cc_check && _vcd=yes
5875 if test "$_vcd" = yes; then
5876 _inputmodules="vcd $_inputmodules"
5877 def_vcd='#define CONFIG_VCD 1'
5878 else
5879 def_vcd='#undef CONFIG_VCD'
5880 _noinputmodules="vcd $_noinputmodules"
5881 _res_comment="not supported on this OS"
5883 echores "$_vcd"
5887 echocheck "dvdread"
5888 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5889 _dvdread_internal=no
5891 if test "$_dvdread_internal" = auto ; then
5892 _dvdread_internal=no
5893 _dvdread=no
5894 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5895 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5896 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5897 || darwin || win32 || os2; then
5898 _dvdread_internal=yes
5899 _dvdread=yes
5900 extra_cflags="-Ilibdvdread4 $extra_cflags"
5902 elif test "$_dvdread" = auto ; then
5903 _dvdread=no
5904 if test "$_dl" = yes; then
5905 cat > $TMPC << EOF
5906 #include <inttypes.h>
5907 #include <dvdread/dvd_reader.h>
5908 #include <dvdread/ifo_types.h>
5909 #include <dvdread/ifo_read.h>
5910 #include <dvdread/nav_read.h>
5911 int main(void) { return 0; }
5913 _dvdreadcflags=$($_dvdreadconfig --cflags)
5914 _dvdreadlibs=$($_dvdreadconfig --libs)
5915 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5916 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5917 _dvdread=yes
5918 extra_cflags="$extra_cflags $_dvdreadcflags"
5919 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5920 _res_comment="external"
5925 if test "$_dvdread_internal" = yes; then
5926 def_dvdread='#define CONFIG_DVDREAD 1'
5927 _inputmodules="dvdread(internal) $_inputmodules"
5928 _largefiles=yes
5929 _res_comment="internal"
5930 elif test "$_dvdread" = yes; then
5931 def_dvdread='#define CONFIG_DVDREAD 1'
5932 _largefiles=yes
5933 extra_ldflags="$extra_ldflags -ldvdread"
5934 _inputmodules="dvdread(external) $_inputmodules"
5935 _res_comment="external"
5936 else
5937 def_dvdread='#undef CONFIG_DVDREAD'
5938 _noinputmodules="dvdread $_noinputmodules"
5940 echores "$_dvdread"
5943 echocheck "internal libdvdcss"
5944 if test "$_libdvdcss_internal" = auto ; then
5945 _libdvdcss_internal=no
5946 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5947 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5949 if test "$_libdvdcss_internal" = yes ; then
5950 if linux || netbsd || openbsd || bsdos ; then
5951 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5952 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5953 elif freebsd || dragonfly ; then
5954 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5955 elif darwin ; then
5956 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5957 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5958 elif cygwin ; then
5959 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5960 elif beos ; then
5961 cflags_libdvdcss="-DSYS_BEOS"
5962 elif os2 ; then
5963 cflags_libdvdcss="-DSYS_OS2"
5965 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5966 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5967 _inputmodules="libdvdcss(internal) $_inputmodules"
5968 _largefiles=yes
5969 else
5970 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5972 echores "$_libdvdcss_internal"
5975 echocheck "cdparanoia"
5976 if test "$_cdparanoia" = auto ; then
5977 cat > $TMPC <<EOF
5978 #include <cdda_interface.h>
5979 #include <cdda_paranoia.h>
5980 // This need a better test. How ?
5981 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5983 _cdparanoia=no
5984 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5985 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5986 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5987 done
5989 if test "$_cdparanoia" = yes ; then
5990 _cdda='yes'
5991 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5992 openbsd && extra_ldflags="$extra_ldflags -lutil"
5994 echores "$_cdparanoia"
5997 echocheck "libcdio"
5998 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5999 cat > $TMPC << EOF
6000 #include <stdio.h>
6001 #include <cdio/version.h>
6002 #include <cdio/cdda.h>
6003 #include <cdio/paranoia.h>
6004 int main(void) {
6005 void *test = cdda_verbose_set;
6006 printf("%s\n", CDIO_VERSION);
6007 return test == (void *)1;
6010 _libcdio=no
6011 for _ld_tmp in "" "-lwinmm" ; do
6012 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
6013 cc_check $_ld_tmp $_ld_lm \
6014 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6015 done
6016 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
6017 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
6018 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
6019 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
6020 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6023 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
6024 _cdda='yes'
6025 def_libcdio='#define CONFIG_LIBCDIO 1'
6026 def_havelibcdio='yes'
6027 else
6028 if test "$_cdparanoia" = yes ; then
6029 _res_comment="using cdparanoia"
6031 def_libcdio='#undef CONFIG_LIBCDIO'
6032 def_havelibcdio='no'
6034 echores "$_libcdio"
6036 if test "$_cdda" = yes ; then
6037 test $_cddb = auto && test $_network = yes && _cddb=yes
6038 def_cdparanoia='#define CONFIG_CDDA 1'
6039 _inputmodules="cdda $_inputmodules"
6040 else
6041 def_cdparanoia='#undef CONFIG_CDDA'
6042 _noinputmodules="cdda $_noinputmodules"
6045 if test "$_cddb" = yes ; then
6046 def_cddb='#define CONFIG_CDDB 1'
6047 _inputmodules="cddb $_inputmodules"
6048 else
6049 _cddb=no
6050 def_cddb='#undef CONFIG_CDDB'
6051 _noinputmodules="cddb $_noinputmodules"
6054 echocheck "bitmap font support"
6055 if test "$_bitmap_font" = yes ; then
6056 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6057 else
6058 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6060 echores "$_bitmap_font"
6063 echocheck "freetype >= 2.0.9"
6065 # freetype depends on iconv
6066 if test "$_iconv" = no ; then
6067 _freetype=no
6068 _res_comment="iconv support needed"
6071 if test "$_freetype" = auto ; then
6072 if $_pkg_config --version >/dev/null 2>&1 || $_freetypeconfig --version >/dev/null 2>&1; then
6073 cat > $TMPC << EOF
6074 #include <stdio.h>
6075 #include <ft2build.h>
6076 #include FT_FREETYPE_H
6077 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6078 #error "Need FreeType 2.0.9 or newer"
6079 #endif
6080 int main(void) {
6081 FT_Library library;
6082 FT_Int major=-1,minor=-1,patch=-1;
6083 int err=FT_Init_FreeType(&library);
6084 return 0;
6087 _freetype=no
6088 if $_pkg_config --exists freetype2; then
6089 cc_check $($_pkg_config --cflags freetype2) $($_pkg_config --libs freetype2) && _freetype=yes && _res_comment="pkg-config"
6090 else
6091 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes && _res_comment="$_freetypeconfig"
6093 else
6094 _freetype=no
6097 if test "$_freetype" = yes ; then
6098 def_freetype='#define CONFIG_FREETYPE 1'
6099 if $_pkg_config --exists freetype2; then
6100 extra_cflags="$extra_cflags $($_pkg_config --cflags freetype2)"
6101 extra_ldflags="$extra_ldflags $($_pkg_config --libs freetype2)"
6102 else
6103 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6104 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6106 else
6107 def_freetype='#undef CONFIG_FREETYPE'
6109 echores "$_freetype"
6111 if test "$_freetype" = no ; then
6112 _fontconfig=no
6113 _res_comment="FreeType support needed"
6115 echocheck "fontconfig"
6116 if test "$_fontconfig" = auto ; then
6117 cat > $TMPC << EOF
6118 #include <stdio.h>
6119 #include <stdlib.h>
6120 #include <fontconfig/fontconfig.h>
6121 int main(void) {
6122 int err = FcInit();
6123 if (err == FcFalse) {
6124 printf("Couldn't initialize fontconfig lib\n");
6125 exit(err);
6127 return 0;
6130 _fontconfig=no
6131 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6132 _ld_tmp="-lfontconfig $_ld_tmp"
6133 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6134 done
6135 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6136 _inc_tmp=$($_pkg_config --cflags fontconfig)
6137 _ld_tmp=$($_pkg_config --libs fontconfig)
6138 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6139 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6142 if test "$_fontconfig" = yes ; then
6143 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6144 else
6145 def_fontconfig='#undef CONFIG_FONTCONFIG'
6147 echores "$_fontconfig"
6149 if test "$_freetype" = no; then
6150 _ass=no
6151 _res_comment="FreeType support needed"
6153 echocheck "SSA/ASS support"
6154 if test "$_ass" = auto -o "$_ass" = yes ; then
6155 if $_pkg_config libass; then
6156 _ass=yes
6157 def_ass='#define CONFIG_ASS 1'
6158 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
6159 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
6160 else
6161 _ass=no
6162 def_ass='#undef CONFIG_ASS'
6164 else
6165 def_ass='#undef CONFIG_ASS'
6167 echores "$_ass"
6170 echocheck "fribidi with charsets"
6171 _inc_tmp=""
6172 _ld_tmp=""
6173 if test "$_fribidi" = auto ; then
6174 cat > $TMPC << EOF
6175 #include <stdio.h>
6176 #include <stdlib.h>
6177 /* workaround for fribidi 0.10.4 and below */
6178 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6179 #include <fribidi/fribidi.h>
6180 int main(void) {
6181 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6182 printf("Fribidi headers are not consistents with the library!\n");
6183 exit(1);
6185 return 0;
6188 _fribidi=no
6189 _inc_tmp=""
6190 _ld_tmp="-lfribidi"
6191 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6192 if $_fribidiconfig --version > /dev/null 2>&1 &&
6193 test "$_fribidi" = no ; then
6194 _inc_tmp="$($_fribidiconfig --cflags)"
6195 _ld_tmp="$($_fribidiconfig --libs)"
6196 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6199 if test "$_fribidi" = yes ; then
6200 def_fribidi='#define CONFIG_FRIBIDI 1'
6201 extra_cflags="$extra_cflags $_inc_tmp"
6202 extra_ldflags="$extra_ldflags $_ld_tmp"
6203 else
6204 def_fribidi='#undef CONFIG_FRIBIDI'
6206 echores "$_fribidi"
6209 echocheck "ENCA"
6210 if test "$_enca" = auto ; then
6211 cat > $TMPC << EOF
6212 #include <sys/types.h>
6213 #include <enca.h>
6214 int main(void) {
6215 const char **langs;
6216 size_t langcnt;
6217 langs = enca_get_languages(&langcnt);
6218 return 0;
6221 _enca=no
6222 cc_check -lenca $_ld_lm && _enca=yes
6224 if test "$_enca" = yes ; then
6225 def_enca='#define CONFIG_ENCA 1'
6226 extra_ldflags="$extra_ldflags -lenca"
6227 else
6228 def_enca='#undef CONFIG_ENCA'
6230 echores "$_enca"
6233 echocheck "zlib"
6234 cat > $TMPC << EOF
6235 #include <zlib.h>
6236 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6238 _zlib=no
6239 cc_check -lz && _zlib=yes
6240 if test "$_zlib" = yes ; then
6241 def_zlib='#define CONFIG_ZLIB 1'
6242 extra_ldflags="$extra_ldflags -lz"
6243 else
6244 def_zlib='#define CONFIG_ZLIB 0'
6246 echores "$_zlib"
6249 echocheck "bzlib"
6250 bzlib=no
6251 def_bzlib='#define CONFIG_BZLIB 0'
6252 cat > $TMPC << EOF
6253 #include <bzlib.h>
6254 int main(void) { BZ2_bzlibVersion(); return 0; }
6256 cc_check -lbz2 && bzlib=yes
6257 if test "$bzlib" = yes ; then
6258 def_bzlib='#define CONFIG_BZLIB 1'
6259 extra_ldflags="$extra_ldflags -lbz2"
6261 echores "$bzlib"
6264 echocheck "RTC"
6265 if test "$_rtc" = auto ; then
6266 cat > $TMPC << EOF
6267 #include <sys/ioctl.h>
6268 #ifdef __linux__
6269 #include <linux/rtc.h>
6270 #else
6271 #include <rtc.h>
6272 #define RTC_PIE_ON RTCIO_PIE_ON
6273 #endif
6274 int main(void) { return RTC_PIE_ON; }
6276 _rtc=no
6277 cc_check && _rtc=yes
6278 ppc && _rtc=no
6280 if test "$_rtc" = yes ; then
6281 def_rtc='#define HAVE_RTC 1'
6282 else
6283 def_rtc='#undef HAVE_RTC'
6285 echores "$_rtc"
6288 echocheck "liblzo2 support"
6289 if test "$_liblzo" = auto ; then
6290 _liblzo=no
6291 cat > $TMPC << EOF
6292 #include <lzo/lzo1x.h>
6293 int main(void) { lzo_init();return 0; }
6295 cc_check -llzo2 && _liblzo=yes
6297 if test "$_liblzo" = yes ; then
6298 def_liblzo='#define CONFIG_LIBLZO 1'
6299 extra_ldflags="$extra_ldflags -llzo2"
6300 _codecmodules="liblzo $_codecmodules"
6301 else
6302 def_liblzo='#undef CONFIG_LIBLZO'
6303 _nocodecmodules="liblzo $_nocodecmodules"
6305 echores "$_liblzo"
6308 echocheck "mad support"
6309 if test "$_mad" = auto ; then
6310 _mad=no
6311 cat > $TMPC << EOF
6312 #include <mad.h>
6313 int main(void) { return 0; }
6315 cc_check -lmad && _mad=yes
6317 if test "$_mad" = yes ; then
6318 def_mad='#define CONFIG_LIBMAD 1'
6319 extra_ldflags="$extra_ldflags -lmad"
6320 _codecmodules="libmad $_codecmodules"
6321 else
6322 def_mad='#undef CONFIG_LIBMAD'
6323 _nocodecmodules="libmad $_nocodecmodules"
6325 echores "$_mad"
6327 echocheck "Twolame"
6328 if test "$_twolame" = auto ; then
6329 cat > $TMPC <<EOF
6330 #include <twolame.h>
6331 int main(void) { twolame_init(); return 0; }
6333 _twolame=no
6334 cc_check -ltwolame $_ld_lm && _twolame=yes
6336 if test "$_twolame" = yes ; then
6337 def_twolame='#define CONFIG_TWOLAME 1'
6338 libs_mencoder="$libs_mencoder -ltwolame"
6339 _codecmodules="twolame $_codecmodules"
6340 else
6341 def_twolame='#undef CONFIG_TWOLAME'
6342 _nocodecmodules="twolame $_nocodecmodules"
6344 echores "$_twolame"
6346 echocheck "Toolame"
6347 if test "$_toolame" = auto ; then
6348 _toolame=no
6349 if test "$_twolame" = yes ; then
6350 _res_comment="disabled by twolame"
6351 else
6352 cat > $TMPC <<EOF
6353 #include <toolame.h>
6354 int main(void) { toolame_init(); return 0; }
6356 cc_check -ltoolame $_ld_lm && _toolame=yes
6359 if test "$_toolame" = yes ; then
6360 def_toolame='#define CONFIG_TOOLAME 1'
6361 libs_mencoder="$libs_mencoder -ltoolame"
6362 _codecmodules="toolame $_codecmodules"
6363 else
6364 def_toolame='#undef CONFIG_TOOLAME'
6365 _nocodecmodules="toolame $_nocodecmodules"
6367 if test "$_toolamedir" ; then
6368 _res_comment="using $_toolamedir"
6370 echores "$_toolame"
6372 echocheck "OggVorbis support"
6373 if test "$_tremor_internal" = yes; then
6374 _libvorbis=no
6375 elif test "$_tremor" = auto; then
6376 _tremor=no
6377 cat > $TMPC << EOF
6378 #include <tremor/ivorbiscodec.h>
6379 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6381 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6383 if test "$_libvorbis" = auto; then
6384 _libvorbis=no
6385 cat > $TMPC << EOF
6386 #include <vorbis/codec.h>
6387 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6389 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6391 if test "$_tremor_internal" = yes ; then
6392 _vorbis=yes
6393 def_vorbis='#define CONFIG_OGGVORBIS 1'
6394 def_tremor='#define CONFIG_TREMOR 1'
6395 _codecmodules="tremor(internal) $_codecmodules"
6396 _res_comment="internal Tremor"
6397 if test "$_tremor_low" = yes ; then
6398 cflags_tremor_low="-D_LOW_ACCURACY_"
6399 _res_comment="internal low accuracy Tremor"
6401 elif test "$_tremor" = yes ; then
6402 _vorbis=yes
6403 def_vorbis='#define CONFIG_OGGVORBIS 1'
6404 def_tremor='#define CONFIG_TREMOR 1'
6405 _codecmodules="tremor(external) $_codecmodules"
6406 _res_comment="external Tremor"
6407 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6408 elif test "$_libvorbis" = yes ; then
6409 _vorbis=yes
6410 def_vorbis='#define CONFIG_OGGVORBIS 1'
6411 _codecmodules="libvorbis $_codecmodules"
6412 _res_comment="libvorbis"
6413 extra_ldflags="$extra_ldflags -lvorbis -logg"
6414 else
6415 _vorbis=no
6416 _nocodecmodules="libvorbis $_nocodecmodules"
6418 echores "$_vorbis"
6420 echocheck "libspeex (version >= 1.1 required)"
6421 if test "$_speex" = auto ; then
6422 _speex=no
6423 cat > $TMPC << EOF
6424 #include <speex/speex.h>
6425 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6427 cc_check -lspeex $_ld_lm && _speex=yes
6429 if test "$_speex" = yes ; then
6430 def_speex='#define CONFIG_SPEEX 1'
6431 extra_ldflags="$extra_ldflags -lspeex"
6432 _codecmodules="speex $_codecmodules"
6433 else
6434 def_speex='#undef CONFIG_SPEEX'
6435 _nocodecmodules="speex $_nocodecmodules"
6437 echores "$_speex"
6439 echocheck "OggTheora support"
6440 if test "$_theora" = auto ; then
6441 _theora=no
6442 cat > $TMPC << EOF
6443 #include <theora/theora.h>
6444 #include <string.h>
6445 int main(void) {
6446 /* Theora is in flux, make sure that all interface routines and datatypes
6447 * exist and work the way we expect it, so we don't break MPlayer. */
6448 ogg_packet op;
6449 theora_comment tc;
6450 theora_info inf;
6451 theora_state st;
6452 yuv_buffer yuv;
6453 int r;
6454 double t;
6456 theora_info_init(&inf);
6457 theora_comment_init(&tc);
6459 return 0;
6461 /* we don't want to execute this kind of nonsense; just for making sure
6462 * that compilation works... */
6463 memset(&op, 0, sizeof(op));
6464 r = theora_decode_header(&inf, &tc, &op);
6465 r = theora_decode_init(&st, &inf);
6466 t = theora_granule_time(&st, op.granulepos);
6467 r = theora_decode_packetin(&st, &op);
6468 r = theora_decode_YUVout(&st, &yuv);
6469 theora_clear(&st);
6471 return 0;
6474 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6475 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6476 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6477 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6478 if test _theora = no; then
6479 _ld_theora="-ltheora -logg"
6480 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6482 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6483 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6484 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6485 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6486 extra_ldflags="$extra_ldflags $_ld_theora" &&
6487 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6488 if test _theora = no; then
6489 _ld_theora="-ltheora -logg"
6490 cc_check tremor/bitwise.c $_ld_theora &&
6491 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6495 if test "$_theora" = yes ; then
6496 def_theora='#define CONFIG_OGGTHEORA 1'
6497 _codecmodules="libtheora $_codecmodules"
6498 # when --enable-theora is forced, we'd better provide a probably sane
6499 # $_ld_theora than nothing
6500 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6501 else
6502 def_theora='#undef CONFIG_OGGTHEORA'
6503 _nocodecmodules="libtheora $_nocodecmodules"
6505 echores "$_theora"
6507 echocheck "internal mp3lib support"
6508 if test "$_mp3lib" = auto ; then
6509 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6511 if test "$_mp3lib" = yes ; then
6512 def_mp3lib='#define CONFIG_MP3LIB 1'
6513 _codecmodules="mp3lib(internal) $_codecmodules"
6514 else
6515 def_mp3lib='#undef CONFIG_MP3LIB'
6516 _nocodecmodules="mp3lib(internal) $_nocodecmodules"
6518 echores "$_mp3lib"
6520 echocheck "liba52 support"
6521 if test "$_liba52_internal" = auto ; then
6522 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
6524 def_liba52='#undef CONFIG_LIBA52'
6525 def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6526 if test "$_liba52_internal" = yes ; then
6527 _liba52=yes
6528 def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6529 _res_comment="internal"
6530 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6531 _liba52=no
6532 cat > $TMPC << EOF
6533 #include <inttypes.h>
6534 #include <a52dec/a52.h>
6535 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6537 cc_check -la52 && _liba52=yes && _res_comment="external" && extra_ldflags="$extra_ldflags -la52"
6539 if test "$_liba52" = yes ; then
6540 def_liba52='#define CONFIG_LIBA52 1'
6541 _codecmodules="liba52($_res_comment) $_codecmodules"
6542 else
6543 _nocodecmodules="liba52 $_nocodecmodules"
6545 echores "$_liba52"
6547 echocheck "internal libmpeg2 support"
6548 if test "$_libmpeg2" = auto ; then
6549 _libmpeg2=yes
6550 if alpha && test cc_vendor=gnu; then
6551 case $cc_version in
6552 2*|3.0*|3.1*) # cannot compile MVI instructions
6553 _libmpeg2=no
6554 _res_comment="broken gcc"
6556 esac
6559 if test "$_libmpeg2" = yes ; then
6560 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6561 _codecmodules="libmpeg2(internal) $_codecmodules"
6562 else
6563 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6564 _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
6566 echores "$_libmpeg2"
6568 echocheck "libdca support"
6569 if test "$_libdca" = auto ; then
6570 _libdca=no
6571 cat > $TMPC << EOF
6572 #include <inttypes.h>
6573 #include <dts.h>
6574 int main(void) { dts_init(0); return 0; }
6576 for _ld_dca in -ldca -ldts ; do
6577 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6578 && _libdca=yes && break
6579 done
6581 if test "$_libdca" = yes ; then
6582 def_libdca='#define CONFIG_LIBDCA 1'
6583 _codecmodules="libdca $_codecmodules"
6584 else
6585 def_libdca='#undef CONFIG_LIBDCA'
6586 _nocodecmodules="libdca $_nocodecmodules"
6588 echores "$_libdca"
6590 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6591 if test "$_musepack" = auto ; then
6592 _musepack=no
6593 cat > $TMPC << EOF
6594 #include <stddef.h>
6595 #include <mpcdec/mpcdec.h>
6596 int main(void) {
6597 mpc_streaminfo info;
6598 mpc_decoder decoder;
6599 mpc_decoder_set_streaminfo(&decoder, &info);
6600 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6601 return 0;
6604 cc_check -lmpcdec $_ld_lm && _musepack=yes
6606 if test "$_musepack" = yes ; then
6607 def_musepack='#define CONFIG_MUSEPACK 1'
6608 extra_ldflags="$extra_ldflags -lmpcdec"
6609 _codecmodules="musepack $_codecmodules"
6610 else
6611 def_musepack='#undef CONFIG_MUSEPACK'
6612 _nocodecmodules="musepack $_nocodecmodules"
6614 echores "$_musepack"
6617 echocheck "FAAC support"
6618 if test "$_faac" = auto ; then
6619 cat > $TMPC <<EOF
6620 #include <inttypes.h>
6621 #include <faac.h>
6622 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6624 _faac=no
6625 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6626 cc_check -O2 $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6627 done
6629 if test "$_faac" = yes ; then
6630 def_faac="#define CONFIG_FAAC 1"
6631 _codecmodules="faac $_codecmodules"
6632 else
6633 def_faac="#undef CONFIG_FAAC"
6634 _nocodecmodules="faac $_nocodecmodules"
6636 echores "$_faac"
6639 echocheck "FAAD2 support"
6640 if test "$_faad_internal" = auto ; then
6641 if x86_32 && test cc_vendor=gnu; then
6642 case $cc_version in
6643 3.1*|3.2) # ICE/insn with these versions
6644 _faad_internal=no
6645 _res_comment="broken gcc"
6648 _faad=yes
6649 _faad_internal=yes
6651 esac
6652 else
6653 _faad=yes
6654 _faad_internal=yes
6657 if test "$_faad" = auto ; then
6658 cat > $TMPC << EOF
6659 #include <faad.h>
6660 #ifndef FAAD_MIN_STREAMSIZE
6661 #error Too old version
6662 #endif
6663 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6664 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6666 cc_check -lfaad $_ld_lm && _faad=yes
6669 def_faad='#undef CONFIG_FAAD'
6670 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6671 if test "$_faad_internal" = yes ; then
6672 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6673 _res_comment="internal floating-point"
6674 if test "$_faad_fixed" = yes ; then
6675 # The FIXED_POINT implementation of FAAD2 improves performance
6676 # on some platforms, especially for SBR files.
6677 cflags_faad_fixed="-DFIXED_POINT"
6678 _res_comment="internal fixed-point"
6680 elif test "$_faad" = yes ; then
6681 extra_ldflags="$extra_ldflags -lfaad"
6684 if test "$_faad" = yes ; then
6685 def_faad='#define CONFIG_FAAD 1'
6686 if test "$_faad_internal" = yes ; then
6687 _codecmodules="faad2(internal) $_codecmodules"
6688 else
6689 _codecmodules="faad2 $_codecmodules"
6691 else
6692 _faad=no
6693 _nocodecmodules="faad2 $_nocodecmodules"
6695 echores "$_faad"
6698 echocheck "LADSPA plugin support"
6699 if test "$_ladspa" = auto ; then
6700 cat > $TMPC <<EOF
6701 #include <stdio.h>
6702 #include <ladspa.h>
6703 int main(void) {
6704 const LADSPA_Descriptor *ld = NULL;
6705 return 0;
6708 _ladspa=no
6709 cc_check && _ladspa=yes
6711 if test "$_ladspa" = yes; then
6712 def_ladspa="#define CONFIG_LADSPA 1"
6713 else
6714 def_ladspa="#undef CONFIG_LADSPA"
6716 echores "$_ladspa"
6719 echocheck "libbs2b audio filter support"
6720 if test "$_libbs2b" = auto ; then
6721 cat > $TMPC <<EOF
6722 #include <bs2b.h>
6723 #if BS2B_VERSION_MAJOR < 3
6724 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6725 #endif
6726 int main(void) {
6727 t_bs2bdp filter;
6728 filter=bs2b_open();
6729 bs2b_close(filter);
6730 return 0;
6733 _libbs2b=no
6734 if $_pkg_config --exists libbs2b ; then
6735 _inc_tmp=$($_pkg_config --cflags libbs2b)
6736 _ld_tmp=$($_pkg_config --libs libbs2b)
6737 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6738 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6739 else
6740 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6741 -I/usr/local/include/bs2b ; do
6742 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6743 extra_ldflags="$extra_ldflags -lbs2b"
6744 extra_cflags="$extra_cflags $_inc_tmp"
6745 _libbs2b=yes
6746 break
6748 done
6751 def_libbs2b="#undef CONFIG_LIBBS2B"
6752 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6753 echores "$_libbs2b"
6756 if test -z "$_codecsdir" ; then
6757 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6758 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6759 if test -d "$dir" ; then
6760 _codecsdir="$dir"
6761 break;
6763 done
6765 # Fall back on default directory.
6766 if test -z "$_codecsdir" ; then
6767 _codecsdir="$_libdir/codecs"
6768 mingw32 && _codecsdir="codecs"
6769 os2 && _codecsdir="codecs"
6773 echocheck "Win32 codecs"
6774 if test "$_win32dll" = auto ; then
6775 _win32dll=no
6776 if x86_32 && ! qnx; then
6777 _win32dll=yes
6780 if test "$_win32dll" = yes ; then
6781 def_win32dll='#define CONFIG_WIN32DLL 1'
6782 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6783 _res_comment="using $_win32codecsdir"
6784 if ! win32 ; then
6785 def_win32_loader='#define WIN32_LOADER 1'
6786 _win32_emulation=yes
6787 else
6788 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6789 _res_comment="using native windows"
6791 _codecmodules="win32 $_codecmodules"
6792 else
6793 def_win32dll='#undef CONFIG_WIN32DLL'
6794 def_win32_loader='#undef WIN32_LOADER'
6795 _nocodecmodules="win32 $_nocodecmodules"
6797 echores "$_win32dll"
6800 echocheck "XAnim codecs"
6801 if test "$_xanim" = auto ; then
6802 _xanim=no
6803 _res_comment="dynamic loader support needed"
6804 if test "$_dl" = yes ; then
6805 _xanim=yes
6808 if test "$_xanim" = yes ; then
6809 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6810 def_xanim='#define CONFIG_XANIM 1'
6811 def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6812 _codecmodules="xanim $_codecmodules"
6813 _res_comment="using $_xanimcodecsdir"
6814 else
6815 def_xanim='#undef CONFIG_XANIM'
6816 def_xanim_path='#undef XACODEC_PATH'
6817 _nocodecmodules="xanim $_nocodecmodules"
6819 echores "$_xanim"
6822 echocheck "RealPlayer codecs"
6823 if test "$_real" = auto ; then
6824 _real=no
6825 _res_comment="dynamic loader support needed"
6826 if test "$_dl" = yes || test "$_win32dll" = yes &&
6827 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
6828 _real=yes
6831 if test "$_real" = yes ; then
6832 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6833 def_real='#define CONFIG_REALCODECS 1'
6834 def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6835 _codecmodules="real $_codecmodules"
6836 _res_comment="using $_realcodecsdir"
6837 else
6838 def_real='#undef CONFIG_REALCODECS'
6839 def_real_path="#undef REALCODEC_PATH"
6840 _nocodecmodules="real $_nocodecmodules"
6842 echores "$_real"
6845 echocheck "QuickTime codecs"
6846 _qtx_emulation=no
6847 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6848 if test "$_qtx" = auto ; then
6849 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6851 if test "$_qtx" = yes ; then
6852 def_qtx='#define CONFIG_QTX_CODECS 1'
6853 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6854 _codecmodules="qtx $_codecmodules"
6855 darwin || win32 || _qtx_emulation=yes
6856 else
6857 def_qtx='#undef CONFIG_QTX_CODECS'
6858 _nocodecmodules="qtx $_nocodecmodules"
6860 echores "$_qtx"
6862 echocheck "Nemesi Streaming Media libraries"
6863 if test "$_nemesi" = auto && test "$_network" = yes ; then
6864 _nemesi=no
6865 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6866 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6867 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6868 _nemesi=yes
6871 if test "$_nemesi" = yes; then
6872 _native_rtsp=no
6873 def_nemesi='#define CONFIG_LIBNEMESI 1'
6874 _inputmodules="nemesi $_inputmodules"
6875 else
6876 _native_rtsp="$_network"
6877 _nemesi=no
6878 def_nemesi='#undef CONFIG_LIBNEMESI'
6879 _noinputmodules="nemesi $_noinputmodules"
6881 echores "$_nemesi"
6883 echocheck "LIVE555 Streaming Media libraries"
6884 if test "$_live" = auto && test "$_network" = yes ; then
6885 cat > $TMPCPP << EOF
6886 #include <liveMedia.hh>
6887 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6888 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6889 #endif
6890 int main(void) { return 0; }
6893 _live=no
6894 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
6895 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6896 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6897 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6898 $_livelibdir/groupsock/libgroupsock.a \
6899 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6900 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6901 $extra_ldflags -lstdc++" \
6902 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6903 -I$_livelibdir/UsageEnvironment/include \
6904 -I$_livelibdir/BasicUsageEnvironment/include \
6905 -I$_livelibdir/groupsock/include" && \
6906 _live=yes && break
6907 done
6908 if test "$_live" != yes ; then
6909 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6910 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6911 _live_dist=yes
6915 if test "$_live" = yes && test "$_network" = yes; then
6916 test $_livelibdir && _res_comment="using $_livelibdir"
6917 def_live='#define CONFIG_LIVE555 1'
6918 _inputmodules="live555 $_inputmodules"
6919 elif test "$_live_dist" = yes && test "$_network" = yes; then
6920 _res_comment="using distribution version"
6921 _live="yes"
6922 def_live='#define CONFIG_LIVE555 1'
6923 extra_ldflags="$extra_ldflags $ld_tmp"
6924 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6925 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6926 _inputmodules="live555 $_inputmodules"
6927 else
6928 _live=no
6929 def_live='#undef CONFIG_LIVE555'
6930 _noinputmodules="live555 $_noinputmodules"
6932 echores "$_live"
6935 echocheck "FFmpeg libavutil"
6936 if test "$_libavutil" = auto ; then
6937 _libavutil=no
6938 cat > $TMPC << EOF
6939 #include <libavutil/common.h>
6940 int main(void) { av_gcd(1,1); return 0; }
6942 if $_pkg_config --exists libavutil ; then
6943 _inc_libavutil=$($_pkg_config --cflags libavutil)
6944 _ld_tmp=$($_pkg_config --libs libavutil)
6945 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libavutil" \
6946 && _libavutil=yes
6947 elif cc_check -lavutil $_ld_lm ; then
6948 extra_ldflags="$extra_ldflags -lavutil"
6949 _libavutil=yes
6952 def_libavutil='#undef CONFIG_LIBAVUTIL'
6953 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
6954 # libavutil is not available, but it is mandatory ...
6955 if test "$_libavutil" = no ; then
6956 die "You need libavutil, MPlayer will not compile without!"
6958 echores "$_libavutil"
6960 echocheck "FFmpeg libavcodec"
6961 if test "$_libavcodec" = auto ; then
6962 _libavcodec=no
6963 cat > $TMPC << EOF
6964 #include <libavcodec/avcodec.h>
6965 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6967 if $_pkg_config --exists libavcodec ; then
6968 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
6969 _ld_tmp=$($_pkg_config --libs libavcodec)
6970 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavcodec" \
6971 && _libavcodec=yes
6972 elif cc_check -lavcodec $_ld_lm ; then
6973 extra_ldflags="$extra_ldflags -lavcodec"
6974 _libavcodec=yes
6977 def_libavcodec='#undef CONFIG_LIBAVCODEC'
6978 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
6979 if test "$_libavcodec" = yes ; then
6980 _codecmodules="libavcodec $_codecmodules"
6981 else
6982 _nocodecmodules="libavcodec $_nocodecmodules"
6984 echores "$_libavcodec"
6986 echocheck "FFmpeg libavformat"
6987 if test "$_libavformat" = auto ; then
6988 _libavformat=no
6989 cat > $TMPC <<EOF
6990 #include <libavformat/avformat.h>
6991 #include <libavcodec/opt.h>
6992 int main(void) { av_alloc_format_context(); return 0; }
6994 if $_pkg_config --exists libavformat ; then
6995 _inc_libavformat=$($_pkg_config --cflags libavformat)
6996 _ld_tmp=$($_pkg_config --libs libavformat)
6997 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavformat" \
6998 && _libavformat=yes
6999 elif cc_check $_ld_lm -lavformat ; then
7000 extra_ldflags="$extra_ldflags -lavformat"
7001 _libavformat=yes
7004 def_libavformat='#undef CONFIG_LIBAVFORMAT'
7005 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
7006 echores "$_libavformat"
7008 echocheck "FFmpeg libpostproc"
7009 if test "$_libpostproc" = auto ; then
7010 _libpostproc=no
7011 cat > $TMPC << EOF
7012 #include <inttypes.h>
7013 #include <libpostproc/postprocess.h>
7014 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
7016 if $_pkg_config --exists libpostproc ; then
7017 _inc_libpostproc=$($_pkg_config --cflags libpostproc)
7018 _ld_tmp=$($_pkg_config --libs libpostproc)
7019 cc_check $_inc_libpostproc $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libpostproc" \
7020 && _libpostproc=yes
7021 elif cc_check -lpostproc $_ld_lm ; then
7022 extra_ldflags="$extra_ldflags -lpostproc"
7023 _libpostproc=yes
7026 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
7027 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
7028 echores "$_libpostproc"
7030 echocheck "FFmpeg libswscale"
7031 if test "$_libswscale" = auto ; then
7032 _libswscale=no
7033 cat > $TMPC << EOF
7034 #include <libswscale/swscale.h>
7035 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
7037 if $_pkg_config --exists libswscale ; then
7038 _inc_libswscale=$($_pkg_config --cflags libswscale)
7039 _ld_tmp=$($_pkg_config --libs libswscale)
7040 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libswscale" \
7041 && _libswscale=yes
7042 elif cc_check -lswscale ; then
7043 extra_ldflags="$extra_ldflags -lswscale"
7044 _libswscale=yes
7047 def_libswscale='#undef CONFIG_LIBSWSCALE'
7048 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
7049 echores "$_libswscale"
7051 def_libswscale_internals="#undef CONFIG_LIBSWSCALE_INTERNALS"
7052 if ! test -z "$_ffmpeg_source" ; then
7053 test "$_libswscale" = yes && def_libswscale_internals="#define CONFIG_LIBSWSCALE_INTERNALS 1" && _libswscale_internals=yes
7056 def_libavcodec_internals="#undef CONFIG_LIBAVCODEC_INTERNALS"
7057 if ! test -z "$_ffmpeg_source" ; then
7058 test "$_libavcodec" = yes && def_libavcodec_internals="#define CONFIG_LIBAVCODEC_INTERNALS 1" && _libavcodec_internals=yes
7061 echocheck "libdv-0.9.5+"
7062 if test "$_libdv" = auto ; then
7063 _libdv=no
7064 cat > $TMPC <<EOF
7065 #include <libdv/dv.h>
7066 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7068 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7070 if test "$_libdv" = yes ; then
7071 def_libdv='#define CONFIG_LIBDV095 1'
7072 extra_ldflags="$extra_ldflags -ldv"
7073 _codecmodules="libdv $_codecmodules"
7074 else
7075 def_libdv='#undef CONFIG_LIBDV095'
7076 _nocodecmodules="libdv $_nocodecmodules"
7078 echores "$_libdv"
7081 echocheck "Xvid"
7082 if test "$_xvid" = auto ; then
7083 _xvid=no
7084 cat > $TMPC << EOF
7085 #include <xvid.h>
7086 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7088 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7089 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7090 done
7093 if test "$_xvid" = yes ; then
7094 def_xvid='#define CONFIG_XVID4 1'
7095 _codecmodules="xvid $_codecmodules"
7096 else
7097 def_xvid='#undef CONFIG_XVID4'
7098 _nocodecmodules="xvid $_nocodecmodules"
7100 echores "$_xvid"
7102 echocheck "x264"
7103 if test "$_x264" = auto ; then
7104 cat > $TMPC << EOF
7105 #include <inttypes.h>
7106 #include <x264.h>
7107 #if X264_BUILD < 79
7108 #error We do not support old versions of x264. Get the latest from git.
7109 #endif
7110 int main(void) { x264_encoder_open((void*)0); return 0; }
7112 _x264=no
7113 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7114 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7115 done
7118 if test "$_x264" = yes ; then
7119 def_x264='#define CONFIG_X264 1'
7120 _codecmodules="x264 $_codecmodules"
7121 else
7122 def_x264='#undef CONFIG_X264'
7123 _nocodecmodules="x264 $_nocodecmodules"
7125 echores "$_x264"
7127 echocheck "libnut"
7128 if test "$_libnut" = auto ; then
7129 cat > $TMPC << EOF
7130 #include <stdio.h>
7131 #include <stdlib.h>
7132 #include <inttypes.h>
7133 #include <libnut.h>
7134 nut_context_tt * nut;
7135 int main(void) { (void)nut_error(0); return 0; }
7137 _libnut=no
7138 cc_check -lnut && _libnut=yes
7141 if test "$_libnut" = yes ; then
7142 def_libnut='#define CONFIG_LIBNUT 1'
7143 extra_ldflags="$extra_ldflags -lnut"
7144 else
7145 def_libnut='#undef CONFIG_LIBNUT'
7147 echores "$_libnut"
7149 # These VO checks must be done after libavcodec/libswscale one
7150 echocheck "/dev/mga_vid"
7151 if test "$_mga" = auto ; then
7152 _mga=no
7153 test -c /dev/mga_vid && _mga=yes
7155 if test "$_mga" = yes ; then
7156 if test "$_libswscale_internals" = yes ; then
7157 def_mga='#define CONFIG_MGA 1'
7158 _vomodules="mga $_vomodules"
7159 else
7160 _res_comment="libswscale internal headers are required by mga, sorry"
7161 def_mga='#undef CONFIG_MGA'
7162 _novomodules="mga $_novomodules"
7164 else
7165 def_mga='#undef CONFIG_MGA'
7166 _novomodules="mga $_novomodules"
7168 echores "$_mga"
7171 echocheck "xmga"
7172 if test "$_xmga" = auto ; then
7173 _xmga=no
7174 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
7176 if test "$_xmga" = yes ; then
7177 if test "$_libswscale_internals" = yes ; then
7178 def_xmga='#define CONFIG_XMGA 1'
7179 _vomodules="xmga $_vomodules"
7180 else
7181 _res_comment="libswscale internal headers are required by mga, sorry"
7182 def_xmga='#undef CONFIG_XMGA'
7183 _novomodules="xmga $_novomodules"
7185 else
7186 def_xmga='#undef CONFIG_XMGA'
7187 _novomodules="xmga $_novomodules"
7189 echores "$_xmga"
7191 echocheck "zr"
7192 if test "$_zr" = auto ; then
7193 #36067's seem to identify themselves as 36057PQC's, so the line
7194 #below should work for 36067's and 36057's.
7195 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7196 _zr=yes
7197 else
7198 _zr=no
7201 if test "$_zr" = yes ; then
7202 if test "$_libavcodec_internals" = yes ; then
7203 def_zr='#define CONFIG_ZR 1'
7204 _vomodules="zr zr2 $_vomodules"
7205 else
7206 _res_comment="libavcodec internal headers are required by zr, sorry"
7207 _novomodules="zr $_novomodules"
7208 def_zr='#undef CONFIG_ZR'
7210 else
7211 def_zr='#undef CONFIG_ZR'
7212 _novomodules="zr zr2 $_novomodules"
7214 echores "$_zr"
7216 # mencoder requires (optional) those libs: libmp3lame
7217 if test "$_mencoder" != no ; then
7219 echocheck "libmp3lame"
7220 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7221 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7222 if test "$_mp3lame" = auto ; then
7223 _mp3lame=no
7224 cat > $TMPC <<EOF
7225 #include <lame/lame.h>
7226 int main(void) { lame_version_t lv; (void) lame_init();
7227 get_lame_version_numerical(&lv);
7228 return 0; }
7230 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7232 if test "$_mp3lame" = yes ; then
7233 def_mp3lame="#define CONFIG_MP3LAME 1"
7234 _ld_mp3lame=-lmp3lame
7235 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7236 cat > $TMPC << EOF
7237 #include <lame/lame.h>
7238 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7240 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7241 cat > $TMPC << EOF
7242 #include <lame/lame.h>
7243 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7245 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7246 else
7247 def_mp3lame='#undef CONFIG_MP3LAME'
7249 echores "$_mp3lame"
7251 fi # test "$_mencoder" != no
7253 echocheck "mencoder"
7254 if test "$_mencoder" = yes ; then
7255 def_muxers='#define CONFIG_MUXERS 1'
7256 else
7257 def_muxers='#define CONFIG_MUXERS 0'
7259 echores "$_mencoder"
7262 echocheck "UnRAR executable"
7263 if test "$_unrar_exec" = auto ; then
7264 _unrar_exec="yes"
7265 mingw32 && _unrar_exec="no"
7267 if test "$_unrar_exec" = yes ; then
7268 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7269 else
7270 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7272 echores "$_unrar_exec"
7274 echocheck "TV interface"
7275 if test "$_tv" = yes ; then
7276 def_tv='#define CONFIG_TV 1'
7277 _inputmodules="tv $_inputmodules"
7278 else
7279 _noinputmodules="tv $_noinputmodules"
7280 def_tv='#undef CONFIG_TV'
7282 echores "$_tv"
7285 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7286 echocheck "*BSD BT848 bt8xx header"
7287 _ioctl_bt848_h=no
7288 for file in "machine/ioctl_bt848.h" \
7289 "dev/bktr/ioctl_bt848.h" \
7290 "dev/video/bktr/ioctl_bt848.h" \
7291 "dev/ic/bt8xx.h" ; do
7292 cat > $TMPC <<EOF
7293 #include <sys/types.h>
7294 #include <sys/ioctl.h>
7295 #include <$file>
7296 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7298 if cc_check ; then
7299 _ioctl_bt848_h=yes
7300 _ioctl_bt848_h_name="$file"
7301 break;
7303 done
7304 if test "$_ioctl_bt848_h" = yes ; then
7305 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7306 _res_comment="using $_ioctl_bt848_h_name"
7307 else
7308 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7310 echores "$_ioctl_bt848_h"
7312 echocheck "*BSD ioctl_meteor.h"
7313 _ioctl_meteor_h=no
7314 for file in "machine/ioctl_meteor.h" \
7315 "dev/bktr/ioctl_meteor.h" \
7316 "dev/video/bktr/ioctl_meteor.h" ; do
7317 cat > $TMPC <<EOF
7318 #include <sys/types.h>
7319 #include <$file>
7320 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7322 if cc_check ; then
7323 _ioctl_meteor_h=yes
7324 _ioctl_meteor_h_name="$file"
7325 break;
7327 done
7328 if test "$_ioctl_meteor_h" = yes ; then
7329 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7330 _res_comment="using $_ioctl_meteor_h_name"
7331 else
7332 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7334 echores "$_ioctl_meteor_h"
7336 echocheck "*BSD BrookTree 848 TV interface"
7337 if test "$_tv_bsdbt848" = auto ; then
7338 _tv_bsdbt848=no
7339 if test "$_tv" = yes ; then
7340 cat > $TMPC <<EOF
7341 #include <sys/types.h>
7342 $def_ioctl_meteor_h_name
7343 $def_ioctl_bt848_h_name
7344 #ifdef IOCTL_METEOR_H_NAME
7345 #include IOCTL_METEOR_H_NAME
7346 #endif
7347 #ifdef IOCTL_BT848_H_NAME
7348 #include IOCTL_BT848_H_NAME
7349 #endif
7350 int main(void) {
7351 ioctl(0, METEORSINPUT, 0);
7352 ioctl(0, TVTUNER_GETFREQ, 0);
7353 return 0;
7356 cc_check && _tv_bsdbt848=yes
7359 if test "$_tv_bsdbt848" = yes ; then
7360 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7361 _inputmodules="tv-bsdbt848 $_inputmodules"
7362 else
7363 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7364 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7366 echores "$_tv_bsdbt848"
7367 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7370 echocheck "DirectShow TV interface"
7371 if test "$_tv_dshow" = auto ; then
7372 _tv_dshow=no
7373 if test "$_tv" = yes && win32 ; then
7374 cat > $TMPC <<EOF
7375 #include <ole2.h>
7376 int main(void) {
7377 void* p;
7378 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7379 return 0;
7382 cc_check -lole32 -luuid && _tv_dshow=yes
7385 if test "$_tv_dshow" = yes ; then
7386 _inputmodules="tv-dshow $_inputmodules"
7387 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7388 extra_ldflags="$extra_ldflags -lole32 -luuid"
7389 else
7390 _noinputmodules="tv-dshow $_noinputmodules"
7391 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7393 echores "$_tv_dshow"
7396 echocheck "Video 4 Linux TV interface"
7397 if test "$_tv_v4l1" = auto ; then
7398 _tv_v4l1=no
7399 if test "$_tv" = yes && linux ; then
7400 cat > $TMPC <<EOF
7401 #include <stdlib.h>
7402 #include <linux/videodev.h>
7403 int main(void) { return 0; }
7405 cc_check && _tv_v4l1=yes
7408 if test "$_tv_v4l1" = yes ; then
7409 _audio_input=yes
7410 _tv_v4l=yes
7411 def_tv_v4l='#define CONFIG_TV_V4L 1'
7412 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7413 _inputmodules="tv-v4l $_inputmodules"
7414 else
7415 _noinputmodules="tv-v4l1 $_noinputmodules"
7416 def_tv_v4l='#undef CONFIG_TV_V4L'
7418 echores "$_tv_v4l1"
7421 echocheck "Video 4 Linux 2 TV interface"
7422 if test "$_tv_v4l2" = auto ; then
7423 _tv_v4l2=no
7424 if test "$_tv" = yes && linux ; then
7425 cat > $TMPC <<EOF
7426 #include <stdlib.h>
7427 #include <linux/types.h>
7428 #include <linux/videodev2.h>
7429 int main(void) { return 0; }
7431 cc_check && _tv_v4l2=yes
7434 if test "$_tv_v4l2" = yes ; then
7435 _audio_input=yes
7436 _tv_v4l=yes
7437 def_tv_v4l='#define CONFIG_TV_V4L 1'
7438 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7439 _inputmodules="tv-v4l2 $_inputmodules"
7440 else
7441 _noinputmodules="tv-v4l2 $_noinputmodules"
7442 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7444 echores "$_tv_v4l2"
7447 echocheck "Radio interface"
7448 if test "$_radio" = yes ; then
7449 def_radio='#define CONFIG_RADIO 1'
7450 _inputmodules="radio $_inputmodules"
7451 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7452 _radio_capture=no
7454 if test "$_radio_capture" = yes ; then
7455 _audio_input=yes
7456 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7457 else
7458 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7460 else
7461 _noinputmodules="radio $_noinputmodules"
7462 def_radio='#undef CONFIG_RADIO'
7463 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7464 _radio_capture=no
7466 echores "$_radio"
7467 echocheck "Capture for Radio interface"
7468 echores "$_radio_capture"
7470 echocheck "Video 4 Linux 2 Radio interface"
7471 if test "$_radio_v4l2" = auto ; then
7472 _radio_v4l2=no
7473 if test "$_radio" = yes && linux ; then
7474 cat > $TMPC <<EOF
7475 #include <stdlib.h>
7476 #include <linux/types.h>
7477 #include <linux/videodev2.h>
7478 int main(void) { return 0; }
7480 cc_check && _radio_v4l2=yes
7483 if test "$_radio_v4l2" = yes ; then
7484 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7485 else
7486 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7488 echores "$_radio_v4l2"
7490 echocheck "Video 4 Linux Radio interface"
7491 if test "$_radio_v4l" = auto ; then
7492 _radio_v4l=no
7493 if test "$_radio" = yes && linux ; then
7494 cat > $TMPC <<EOF
7495 #include <stdlib.h>
7496 #include <linux/videodev.h>
7497 int main(void) { return 0; }
7499 cc_check && _radio_v4l=yes
7502 if test "$_radio_v4l" = yes ; then
7503 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7504 else
7505 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7507 echores "$_radio_v4l"
7509 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7510 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7511 echocheck "*BSD BrookTree 848 Radio interface"
7512 _radio_bsdbt848=no
7513 cat > $TMPC <<EOF
7514 #include <sys/types.h>
7515 $def_ioctl_bt848_h_name
7516 #ifdef IOCTL_BT848_H_NAME
7517 #include IOCTL_BT848_H_NAME
7518 #endif
7519 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7521 cc_check && _radio_bsdbt848=yes
7522 echores "$_radio_bsdbt848"
7523 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7525 if test "$_radio_bsdbt848" = yes ; then
7526 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7527 else
7528 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7531 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7532 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7533 die "Radio driver requires BSD BT848, V4L or V4L2!"
7536 echocheck "Video 4 Linux 2 MPEG PVR interface"
7537 if test "$_pvr" = auto ; then
7538 _pvr=no
7539 if test "$_tv_v4l2" = yes && linux ; then
7540 cat > $TMPC <<EOF
7541 #include <stdlib.h>
7542 #include <inttypes.h>
7543 #include <linux/types.h>
7544 #include <linux/videodev2.h>
7545 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7547 cc_check && _pvr=yes
7550 if test "$_pvr" = yes ; then
7551 def_pvr='#define CONFIG_PVR 1'
7552 _inputmodules="pvr $_inputmodules"
7553 else
7554 _noinputmodules="pvr $_noinputmodules"
7555 def_pvr='#undef CONFIG_PVR'
7557 echores "$_pvr"
7560 echocheck "ftp"
7561 if ! beos && test "$_ftp" = yes ; then
7562 def_ftp='#define CONFIG_FTP 1'
7563 _inputmodules="ftp $_inputmodules"
7564 else
7565 _noinputmodules="ftp $_noinputmodules"
7566 def_ftp='#undef CONFIG_FTP'
7568 echores "$_ftp"
7570 echocheck "vstream client"
7571 if test "$_vstream" = auto ; then
7572 _vstream=no
7573 cat > $TMPC <<EOF
7574 #include <vstream-client.h>
7575 void vstream_error(const char *format, ... ) {}
7576 int main(void) { vstream_start(); return 0; }
7578 cc_check -lvstream-client && _vstream=yes
7580 if test "$_vstream" = yes ; then
7581 def_vstream='#define CONFIG_VSTREAM 1'
7582 _inputmodules="vstream $_inputmodules"
7583 extra_ldflags="$extra_ldflags -lvstream-client"
7584 else
7585 _noinputmodules="vstream $_noinputmodules"
7586 def_vstream='#undef CONFIG_VSTREAM'
7588 echores "$_vstream"
7591 echocheck "OSD menu"
7592 if test "$_menu" = yes ; then
7593 def_menu='#define CONFIG_MENU 1'
7594 test $_dvbin = "yes" && _menu_dvbin=yes
7595 else
7596 def_menu='#undef CONFIG_MENU'
7597 _menu_dvbin=no
7599 echores "$_menu"
7602 echocheck "Subtitles sorting"
7603 if test "$_sortsub" = yes ; then
7604 def_sortsub='#define CONFIG_SORTSUB 1'
7605 else
7606 def_sortsub='#undef CONFIG_SORTSUB'
7608 echores "$_sortsub"
7611 echocheck "XMMS inputplugin support"
7612 if test "$_xmms" = yes ; then
7613 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7614 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7615 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7616 else
7617 _xmmsplugindir=/usr/lib/xmms/Input
7618 _xmmslibdir=/usr/lib
7621 def_xmms='#define CONFIG_XMMS 1'
7622 if darwin ; then
7623 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7624 else
7625 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7627 else
7628 def_xmms='#undef CONFIG_XMMS'
7630 echores "$_xmms"
7632 if test "$_charset" != "noconv" ; then
7633 def_charset="#define MSG_CHARSET \"$_charset\""
7634 else
7635 def_charset="#undef MSG_CHARSET"
7636 _charset="UTF-8"
7639 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
7640 echocheck "iconv program"
7641 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7642 if test "$?" -ne 0 ; then
7643 echores "no"
7644 echo "No working iconv program found, use "
7645 echo "--charset=UTF-8 to continue anyway."
7646 echo "If you also have problems with iconv library functions use --charset=noconv."
7647 exit 1
7648 else
7649 echores "yes"
7653 #############################################################################
7655 echocheck "automatic gdb attach"
7656 if test "$_crash_debug" = yes ; then
7657 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
7658 else
7659 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
7660 _crash_debug=no
7662 echores "$_crash_debug"
7664 echocheck "compiler support for noexecstack"
7665 cat > $TMPC <<EOF
7666 int main(void) { return 0; }
7668 if cc_check -Wl,-z,noexecstack ; then
7669 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
7670 echores "yes"
7671 else
7672 echores "no"
7675 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
7676 if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
7677 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
7678 echores "yes"
7679 else
7680 echores "no"
7684 # Dynamic linking flags
7685 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7686 _ld_dl_dynamic=''
7687 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7688 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
7689 _ld_dl_dynamic='-rdynamic'
7692 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7693 bsdos && extra_ldflags="$extra_ldflags -ldvd"
7694 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
7696 def_debug='#undef MP_DEBUG'
7697 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
7700 echocheck "joystick"
7701 def_joystick='#undef CONFIG_JOYSTICK'
7702 if test "$_joystick" = yes ; then
7703 if linux ; then
7704 # TODO add some check
7705 def_joystick='#define CONFIG_JOYSTICK 1'
7706 else
7707 _joystick="no"
7708 _res_comment="unsupported under $system_name"
7711 echores "$_joystick"
7713 echocheck "lirc"
7714 if test "$_lirc" = auto ; then
7715 _lirc=no
7716 cat > $TMPC <<EOF
7717 #include <lirc/lirc_client.h>
7718 int main(void) { return 0; }
7720 cc_check -llirc_client && _lirc=yes
7722 if test "$_lirc" = yes ; then
7723 def_lirc='#define CONFIG_LIRC 1'
7724 libs_mplayer="$libs_mplayer -llirc_client"
7725 else
7726 def_lirc='#undef CONFIG_LIRC'
7728 echores "$_lirc"
7730 echocheck "lircc"
7731 if test "$_lircc" = auto ; then
7732 _lircc=no
7733 cat > $TMPC <<EOF
7734 #include <lirc/lircc.h>
7735 int main(void) { return 0; }
7737 cc_check -llircc && _lircc=yes
7739 if test "$_lircc" = yes ; then
7740 def_lircc='#define CONFIG_LIRCC 1'
7741 libs_mplayer="$libs_mplayer -llircc"
7742 else
7743 def_lircc='#undef CONFIG_LIRCC'
7745 echores "$_lircc"
7747 if arm; then
7748 # Detect maemo development platform libraries availability (http://www.maemo.org),
7749 # they are used when run on Nokia 770|8x0
7750 echocheck "maemo (Nokia 770|8x0)"
7751 if test "$_maemo" = auto ; then
7752 _maemo=no
7753 cat > $TMPC << EOF
7754 #include <libosso.h>
7755 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7757 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7759 if test "$_maemo" = yes ; then
7760 def_maemo='#define CONFIG_MAEMO 1'
7761 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7762 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7763 else
7764 def_maemo='#undef CONFIG_MAEMO'
7766 echores "$_maemo"
7769 #############################################################################
7771 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7772 # the OMF format needs to come after the 'extern symbol prefix' check, which
7773 # uses nm.
7774 if os2 ; then
7775 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7778 # linker paths should be the same for mencoder and mplayer
7779 _ld_tmp=""
7780 for I in $libs_mplayer ; do
7781 _tmp=$(echo $I | sed -e 's/^-L.*$//')
7782 if test -z "$_tmp" ; then
7783 extra_ldflags="$extra_ldflags $I"
7784 else
7785 _ld_tmp="$_ld_tmp $I"
7787 done
7788 libs_mplayer=$_ld_tmp
7791 #############################################################################
7792 # 64 bit file offsets?
7793 if test "$_largefiles" = yes || freebsd ; then
7794 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7795 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7796 # dvdread support requires this (for off64_t)
7797 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7801 CXXFLAGS=" $CFLAGS -Iffmpeg -D__STDC_LIMIT_MACROS"
7803 # This must be the last test to be performed. Any other tests following it
7804 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7805 # against libdvdread (to permit MPlayer to use its own copy of the library).
7806 # So any compilation using the flags added here but not linking against
7807 # libdvdread can fail.
7808 echocheck "DVD support (libdvdnav)"
7809 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7810 _dvdnav=no
7812 dvdnav_internal=no
7813 if test "$_dvdnav" = auto ; then
7814 if test "$_dvdread_internal" = yes ; then
7815 _dvdnav=yes
7816 dvdnav_internal=yes
7817 _res_comment="internal"
7818 else
7819 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7822 if test "$_dvdnav" = auto ; then
7823 cat > $TMPC <<EOF
7824 #include <inttypes.h>
7825 #include <dvdnav/dvdnav.h>
7826 int main(void) { dvdnav_t *dvd=0; return 0; }
7828 _dvdnav=no
7829 _dvdnavdir=$($_dvdnavconfig --cflags)
7830 _dvdnavlibs=$($_dvdnavconfig --libs)
7831 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7833 if test "$_dvdnav" = yes ; then
7834 _largefiles=yes
7835 def_dvdnav='#define CONFIG_DVDNAV 1'
7836 if test "$dvdnav_internal" = yes ; then
7837 cflags_libdvdnav="-Ilibdvdnav"
7838 _inputmodules="dvdnav(internal) $_inputmodules"
7839 else
7840 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7841 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7842 _inputmodules="dvdnav $_inputmodules"
7844 else
7845 def_dvdnav='#undef CONFIG_DVDNAV'
7846 _noinputmodules="dvdnav $_noinputmodules"
7848 echores "$_dvdnav"
7850 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7851 # Read dvdnav comment above.
7853 #############################################################################
7854 echo "Creating config.mak"
7855 cat > config.mak << EOF
7856 # -------- Generated by configure -----------
7858 # Ensure that locale settings do not interfere with shell commands.
7859 export LC_ALL = C
7861 CONFIGURATION = $_configuration
7863 CHARSET = $_charset
7864 DOC_LANGS = $language_doc
7865 DOC_LANG_ALL = $doc_lang_all
7866 MAN_LANGS = $language_man
7867 MAN_LANG_ALL = $man_lang_all
7869 prefix = \$(DESTDIR)$_prefix
7870 BINDIR = \$(DESTDIR)$_bindir
7871 DATADIR = \$(DESTDIR)$_datadir
7872 LIBDIR = \$(DESTDIR)$_libdir
7873 MANDIR = \$(DESTDIR)$_mandir
7874 CONFDIR = \$(DESTDIR)$_confdir
7876 AR = $_ar
7877 AS = $_cc
7878 CC = $_cc
7879 CXX = $_cc
7880 HOST_CC = $_host_cc
7881 YASM = $_yasm
7882 INSTALL = $_install
7883 INSTALLSTRIP = $_install_strip
7884 RANLIB = $_ranlib
7885 WINDRES = $_windres
7887 CFLAGS = $CFLAGS $extra_cflags
7888 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
7889 CFLAGS_DHAHELPER = $cflags_dhahelper
7890 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7891 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7892 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7893 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7894 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7895 CFLAGS_STACKREALIGN = $cflags_stackrealign
7896 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7897 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7898 YASMFLAGS = $YASMFLAGS
7900 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7901 EXTRALIBS_MPLAYER = $libs_mplayer
7902 EXTRALIBS_MENCODER = $libs_mencoder
7904 MPDEPEND_CMD = \$(CC) -MM \$(CFLAGS) \$(filter-out %.xpm,\$(filter-out %.h,$^)) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
7905 MPDEPEND_CMD_CXX = \$(CC) -MM \$(CXXFLAGS) \$(filter-out %.hh,\$(filter-out %.h,$^)) | sed -e "s,[0-9a-z._-]*: \([a-z0-9/]*/\)[^/]* ,\1&," -e "s,\(.*\)\.o: ,\1.d &,"
7907 GETCH = $_getch
7908 HELP_FILE = $_mp_help
7909 TIMER = $_timer
7911 EXESUF = $_exesuf
7912 EXESUFS_ALL = .exe
7914 $_target_arch
7915 $_target_subarch
7916 $(echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/')
7918 MENCODER = $_mencoder
7919 MPLAYER = $_mplayer
7921 NEED_GETTIMEOFDAY = $_need_gettimeofday
7922 NEED_GLOB = $_need_glob
7923 NEED_MMAP = $_need_mmap
7924 NEED_SETENV = $_need_setenv
7925 NEED_SHMEM = $_need_shmem
7926 NEED_STRSEP = $_need_strsep
7927 NEED_SWAB = $_need_swab
7928 NEED_VSSCANF = $_need_vsscanf
7930 # features
7931 3DFX = $_3dfx
7932 AA = $_aa
7933 ALSA1X = $_alsa1x
7934 ALSA9 = $_alsa9
7935 ALSA5 = $_alsa5
7936 APPLE_IR = $_apple_ir
7937 APPLE_REMOTE = $_apple_remote
7938 ARTS = $_arts
7939 AUDIO_INPUT = $_audio_input
7940 BITMAP_FONT = $_bitmap_font
7941 BL = $_bl
7942 CACA = $_caca
7943 CDDA = $_cdda
7944 CDDB = $_cddb
7945 COREAUDIO = $_coreaudio
7946 COREVIDEO = $_corevideo
7947 DART = $_dart
7948 DFBMGA = $_dfbmga
7949 DGA = $_dga
7950 DIRECT3D = $_direct3d
7951 DIRECTFB = $_directfb
7952 DIRECTX = $_directx
7953 DVBIN = $_dvbin
7954 DVDNAV = $_dvdnav
7955 DVDNAV_INTERNAL = $dvdnav_internal
7956 DVDREAD = $_dvdread
7957 DVDREAD_INTERNAL = $_dvdread_internal
7958 DXR2 = $_dxr2
7959 DXR3 = $_dxr3
7960 ESD = $_esd
7961 FAAC=$_faac
7962 FAAD = $_faad
7963 FAAD_INTERNAL = $_faad_internal
7964 FASTMEMCPY = $_fastmemcpy
7965 FBDEV = $_fbdev
7966 FREETYPE = $_freetype
7967 FTP = $_ftp
7968 GIF = $_gif
7969 GGI = $_ggi
7970 GL = $_gl
7971 GL_WIN32 = $_gl_win32
7972 GL_X11 = $_gl_x11
7973 MATRIXVIEW = $matrixview
7974 HAVE_POSIX_SELECT = $_posix_select
7975 HAVE_SYS_MMAN_H = $_mman
7976 IVTV = $_ivtv
7977 JACK = $_jack
7978 JOYSTICK = $_joystick
7979 JPEG = $_jpeg
7980 KVA = $_kva
7981 LADSPA = $_ladspa
7982 LIBA52 = $_liba52
7983 LIBA52_INTERNAL = $_liba52_internal
7984 LIBASS = $_ass
7985 LIBBS2B = $_libbs2b
7986 LIBDCA = $_libdca
7987 LIBDV = $_libdv
7988 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7989 LIBLZO = $_liblzo
7990 LIBMAD = $_mad
7991 LIBMENU = $_menu
7992 LIBMENU_DVBIN = $_menu_dvbin
7993 LIBMPEG2 = $_libmpeg2
7994 LIBNEMESI = $_nemesi
7995 LIBNUT = $_libnut
7996 LIBSMBCLIENT = $_smb
7997 LIBTHEORA = $_theora
7998 LIRC = $_lirc
7999 LIVE555 = $_live
8000 MACOSX_BUNDLE = $_macosx_bundle
8001 MACOSX_FINDER = $_macosx_finder
8002 MD5SUM = $_md5sum
8003 MGA = $_mga
8004 MNG = $_mng
8005 MP3LAME = $_mp3lame
8006 MP3LIB = $_mp3lib
8007 MUSEPACK = $_musepack
8008 NAS = $_nas
8009 NATIVE_RTSP = $_native_rtsp
8010 NETWORK = $_network
8011 OPENAL = $_openal
8012 OSS = $_ossaudio
8013 PE_EXECUTABLE = $_pe_executable
8014 PNG = $_png
8015 PNM = $_pnm
8016 PRIORITY = $_priority
8017 PULSE = $_pulse
8018 PVR = $_pvr
8019 QTX_CODECS = $_qtx
8020 QTX_CODECS_WIN32 = $_qtx_codecs_win32
8021 QTX_EMULATION = $_qtx_emulation
8022 QUARTZ = $_quartz
8023 RADIO=$_radio
8024 RADIO_CAPTURE=$_radio_capture
8025 REAL_CODECS = $_real
8026 S3FB = $_s3fb
8027 SDL = $_sdl
8028 SPEEX = $_speex
8029 STREAM_CACHE = $_stream_cache
8030 SGIAUDIO = $_sgiaudio
8031 SUNAUDIO = $_sunaudio
8032 SVGA = $_svga
8033 TDFXFB = $_tdfxfb
8034 TDFXVID = $_tdfxvid
8035 TGA = $_tga
8036 TOOLAME=$_toolame
8037 TREMOR_INTERNAL = $_tremor_internal
8038 TV = $_tv
8039 TV_BSDBT848 = $_tv_bsdbt848
8040 TV_DSHOW = $_tv_dshow
8041 TV_V4L = $_tv_v4l
8042 TV_V4L1 = $_tv_v4l1
8043 TV_V4L2 = $_tv_v4l2
8044 TWOLAME=$_twolame
8045 UNRAR_EXEC = $_unrar_exec
8046 V4L2 = $_v4l2
8047 VCD = $_vcd
8048 VDPAU = $_vdpau
8049 VESA = $_vesa
8050 VIDIX = $_vidix
8051 VIDIX_PCIDB = $_vidix_pcidb_val
8052 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
8053 VIDIX_IVTV=$_vidix_drv_ivtv
8054 VIDIX_MACH64=$_vidix_drv_mach64
8055 VIDIX_MGA=$_vidix_drv_mga
8056 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
8057 VIDIX_NVIDIA=$_vidix_drv_nvidia
8058 VIDIX_PM2=$_vidix_drv_pm2
8059 VIDIX_PM3=$_vidix_drv_pm3
8060 VIDIX_RADEON=$_vidix_drv_radeon
8061 VIDIX_RAGE128=$_vidix_drv_rage128
8062 VIDIX_S3=$_vidix_drv_s3
8063 VIDIX_SH_VEU=$_vidix_drv_sh_veu
8064 VIDIX_SIS=$_vidix_drv_sis
8065 VIDIX_UNICHROME=$_vidix_drv_unichrome
8066 VORBIS = $_vorbis
8067 VSTREAM = $_vstream
8068 WII = $_wii
8069 WIN32DLL = $_win32dll
8070 WIN32WAVEOUT = $_win32waveout
8071 WIN32_EMULATION = $_win32_emulation
8072 WINVIDIX = $winvidix
8073 X11 = $_x11
8074 X264 = $_x264
8075 XANIM_CODECS = $_xanim
8076 XMGA = $_xmga
8077 XMMS_PLUGINS = $_xmms
8078 XV = $_xv
8079 XVID4 = $_xvid
8080 XVIDIX = $xvidix
8081 XVMC = $_xvmc
8082 XVR100 = $_xvr100
8083 YUV4MPEG = $_yuv4mpeg
8084 ZR = $_zr
8086 # FFmpeg
8087 LIBAVUTIL = $_libavutil
8088 LIBAVCODEC = $_libavcodec
8089 LIBAVFORMAT = $_libavformat
8090 LIBPOSTPROC = $_libpostproc
8091 LIBSWSCALE = $_libswscale
8092 LIBAVCODEC_INTERNALS = $_libavcodec_internals
8093 LIBSWSCALE_INTERNALS = $_libswscale_internals
8094 FFMPEG_SOURCE_PATH = $_ffmpeg_source
8096 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8097 CONFIG_AANDCT=yes
8098 CONFIG_FFT=yes
8099 CONFIG_FFT_MMX=$fft_mmx
8100 CONFIG_GOLOMB=yes
8101 CONFIG_LPC=yes
8102 CONFIG_MDCT=yes
8103 CONFIG_RDFT=yes
8105 CONFIG_BZLIB=$bzlib
8106 CONFIG_ENCODERS=yes
8107 CONFIG_GPL=yes
8108 CONFIG_MLIB = $_mlib
8109 CONFIG_MUXERS=$_mencoder
8110 CONFIG_VDPAU=$_vdpau
8111 CONFIG_XVMC=$_xvmc
8112 CONFIG_ZLIB=$_zlib
8114 HAVE_PTHREADS = $_pthreads
8115 HAVE_SHM = $_shm
8116 HAVE_W32THREADS = $_w32threads
8117 HAVE_YASM = $_have_yasm
8121 #############################################################################
8123 ff_config_enable () {
8124 _nprefix=$3;
8125 test -z "$_nprefix" && _nprefix='CONFIG'
8126 for part in $1; do
8127 if $(echo $2 | grep -q -E "(^| )$part($| )"); then
8128 echo "#define ${_nprefix}_$part 1"
8129 else
8130 echo "#define ${_nprefix}_$part 0"
8132 done
8135 echo "Creating config.h"
8136 cat > $TMPH << EOF
8137 /*----------------------------------------------------------------------------
8138 ** This file has been automatically generated by configure any changes in it
8139 ** will be lost when you run configure again.
8140 ** Instead of modifying definitions here, use the --enable/--disable options
8141 ** of the configure script! See ./configure --help for details.
8142 *---------------------------------------------------------------------------*/
8144 #ifndef MPLAYER_CONFIG_H
8145 #define MPLAYER_CONFIG_H
8147 /* Undefine this if you do not want to select mono audio (left or right)
8148 with a stereo MPEG layer 2/3 audio stream. The command line option
8149 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8150 right-only), with 0 being the default.
8152 #define CONFIG_FAKE_MONO 1
8154 /* set up audio OUTBURST. Do not change this! */
8155 #define OUTBURST 512
8157 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8158 #undef FAST_OSD
8159 #undef FAST_OSD_TABLE
8161 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8162 #define MPEG12_POSTPROC 1
8163 #define ATTRIBUTE_ALIGNED_MAX 16
8167 #define CONFIGURATION "$_configuration"
8169 #define MPLAYER_DATADIR "$_datadir"
8170 #define MPLAYER_CONFDIR "$_confdir"
8171 #define MPLAYER_LIBDIR "$_libdir"
8173 /* definitions needed by included libraries */
8174 #define HAVE_INTTYPES_H 1
8175 /* libmpeg2 + FFmpeg */
8176 $def_fast_inttypes
8177 /* libdvdcss */
8178 #define HAVE_ERRNO_H 1
8179 /* libdvdcss + libdvdread */
8180 #define HAVE_LIMITS_H 1
8181 /* libdvdcss + libfaad2 */
8182 #define HAVE_UNISTD_H 1
8183 /* libfaad2 + libdvdread */
8184 #define STDC_HEADERS 1
8185 #define HAVE_MEMCPY 1
8186 /* libfaad2 */
8187 #define HAVE_STRING_H 1
8188 #define HAVE_STRINGS_H 1
8189 #define HAVE_SYS_STAT_H 1
8190 #define HAVE_SYS_TYPES_H 1
8191 /* libdvdnav */
8192 #define READ_CACHE_TRACE 0
8193 /* libdvdread */
8194 #define HAVE_DLFCN_H 1
8195 $def_dvdcss
8198 /* system headers */
8199 $def_alloca_h
8200 $def_alsa_asoundlib_h
8201 $def_altivec_h
8202 $def_malloc_h
8203 $def_mman_h
8204 $def_mman_has_map_failed
8205 $def_soundcard_h
8206 $def_sys_asoundlib_h
8207 $def_sys_soundcard_h
8208 $def_sys_sysinfo_h
8209 $def_termios_h
8210 $def_termios_sys_h
8211 $def_winsock2_h
8214 /* system functions */
8215 $def_exp2
8216 $def_exp2f
8217 $def_gethostbyname2
8218 $def_gettimeofday
8219 $def_glob
8220 $def_langinfo
8221 $def_llrint
8222 $def_log2
8223 $def_log2f
8224 $def_lrint
8225 $def_lrintf
8226 $def_map_memalign
8227 $def_memalign
8228 $def_nanosleep
8229 $def_posix_select
8230 $def_round
8231 $def_roundf
8232 $def_select
8233 $def_setenv
8234 $def_shm
8235 $def_strsep
8236 $def_swab
8237 $def_sysi86
8238 $def_sysi86_iv
8239 $def_termcap
8240 $def_termios
8241 $def_truncf
8242 $def_vsscanf
8245 /* system-specific features */
8246 $def_asmalign_pot
8247 $def_builtin_expect
8248 $def_dl
8249 $def_extern_asm
8250 $def_extern_prefix
8251 $def_iconv
8252 $def_kstat
8253 $def_macosx_bundle
8254 $def_macosx_finder
8255 $def_maemo
8256 $def_named_asm_args
8257 $def_priority
8258 $def_quicktime
8259 $def_restrict_keyword
8260 $def_rtc
8261 $def_unrar_exec
8264 /* configurable options */
8265 $def_charset
8266 $def_crash_debug
8267 $def_debug
8268 $def_dynamic_plugins
8269 $def_fastmemcpy
8270 $def_menu
8271 $def_runtime_cpudetection
8272 $def_sighandler
8273 $def_sortsub
8274 $def_stream_cache
8275 $def_pthread_cache
8278 /* CPU stuff */
8279 #define __CPU__ $iproc
8280 $def_words_endian
8281 $def_bigendian
8282 $(ff_config_enable "$_arch_all" "$_arch" "ARCH")
8283 $(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE")
8286 /* DVD/VCD/CD */
8287 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8288 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8289 $def_bsdi_dvd
8290 $def_cddb
8291 $def_cdio
8292 $def_cdparanoia
8293 $def_cdrom
8294 $def_dvd
8295 $def_dvd_bsd
8296 $def_dvd_darwin
8297 $def_dvd_linux
8298 $def_dvd_openbsd
8299 $def_dvdio
8300 $def_dvdnav
8301 $def_dvdread
8302 $def_hpux_scsi_h
8303 $def_libcdio
8304 $def_sol_scsi_h
8305 $def_vcd
8308 /* codec libraries */
8309 $def_faac
8310 $def_faad
8311 $def_faad_internal
8312 $def_liba52
8313 $def_liba52_internal
8314 $def_libdca
8315 $def_libdv
8316 $def_liblzo
8317 $def_libmpeg2
8318 $def_mad
8319 $def_mp3lame
8320 $def_mp3lame_preset
8321 $def_mp3lame_preset_medium
8322 $def_mp3lib
8323 $def_musepack
8324 $def_speex
8325 $def_theora
8326 $def_toolame
8327 $def_tremor
8328 $def_twolame
8329 $def_vorbis
8330 $def_x264
8331 $def_xvid
8332 $def_zlib
8334 $def_libnut
8337 /* binary codecs */
8338 $def_qtx
8339 $def_qtx_win32
8340 $def_real
8341 $def_real_path
8342 $def_win32_loader
8343 $def_win32dll
8344 #define WIN32_PATH "$_win32codecsdir"
8345 $def_xanim
8346 $def_xanim_path
8347 $def_xmms
8348 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8351 /* Audio output drivers */
8352 $def_alsa
8353 $def_alsa1x
8354 $def_alsa5
8355 $def_alsa9
8356 $def_arts
8357 $def_coreaudio
8358 $def_dart
8359 $def_esd
8360 $def_esd_latency
8361 $def_jack
8362 $def_nas
8363 $def_openal
8364 $def_openal_h
8365 $def_ossaudio
8366 $def_ossaudio_devdsp
8367 $def_ossaudio_devmixer
8368 $def_pulse
8369 $def_sgiaudio
8370 $def_sunaudio
8371 $def_win32waveout
8373 $def_ladspa
8374 $def_libbs2b
8377 /* input */
8378 $def_apple_ir
8379 $def_apple_remote
8380 $def_ioctl_bt848_h_name
8381 $def_ioctl_meteor_h_name
8382 $def_joystick
8383 $def_lirc
8384 $def_lircc
8385 $def_pvr
8386 $def_radio
8387 $def_radio_bsdbt848
8388 $def_radio_capture
8389 $def_radio_v4l
8390 $def_radio_v4l2
8391 $def_tv
8392 $def_tv_bsdbt848
8393 $def_tv_dshow
8394 $def_tv_v4l
8395 $def_tv_v4l1
8396 $def_tv_v4l2
8399 /* font stuff */
8400 $def_ass
8401 $def_bitmap_font
8402 $def_enca
8403 $def_fontconfig
8404 $def_freetype
8405 $def_fribidi
8408 /* networking */
8409 $def_closesocket
8410 $def_ftp
8411 $def_inet6
8412 $def_inet_aton
8413 $def_inet_pton
8414 $def_live
8415 $def_nemesi
8416 $def_network
8417 $def_smb
8418 $def_socklen_t
8419 $def_vstream
8422 /* libvo options */
8423 $def_3dfx
8424 $def_aa
8425 $def_bl
8426 $def_caca
8427 $def_corevideo
8428 $def_dfbmga
8429 $def_dga
8430 $def_dga1
8431 $def_dga2
8432 $def_direct3d
8433 $def_directfb
8434 $def_directfb_version
8435 $def_directx
8436 $def_dvb
8437 $def_dvb_head
8438 $def_dvbin
8439 $def_dxr2
8440 $def_dxr3
8441 $def_fbdev
8442 $def_ggi
8443 $def_ggiwmh
8444 $def_gif
8445 $def_gif_4
8446 $def_gif_tvt_hack
8447 $def_gl
8448 $def_gl_win32
8449 $def_gl_x11
8450 $def_matrixview
8451 $def_ivtv
8452 $def_jpeg
8453 $def_kva
8454 $def_md5sum
8455 $def_mga
8456 $def_mng
8457 $def_png
8458 $def_pnm
8459 $def_quartz
8460 $def_s3fb
8461 $def_sdl
8462 $def_sdl_sdl_h
8463 $def_sdlbuggy
8464 $def_svga
8465 $def_tdfxfb
8466 $def_tdfxvid
8467 $def_tga
8468 $def_v4l2
8469 $def_vdpau
8470 $def_vesa
8471 $def_vidix
8472 $def_vidix_drv_cyberblade
8473 $def_vidix_drv_ivtv
8474 $def_vidix_drv_mach64
8475 $def_vidix_drv_mga
8476 $def_vidix_drv_mga_crtc2
8477 $def_vidix_drv_nvidia
8478 $def_vidix_drv_pm3
8479 $def_vidix_drv_radeon
8480 $def_vidix_drv_rage128
8481 $def_vidix_drv_s3
8482 $def_vidix_drv_sh_veu
8483 $def_vidix_drv_sis
8484 $def_vidix_drv_unichrome
8485 $def_vidix_pfx
8486 $def_vm
8487 $def_wii
8488 $def_x11
8489 $def_xdpms
8490 $def_xf86keysym
8491 $def_xinerama
8492 $def_xmga
8493 $def_xss
8494 $def_xv
8495 $def_xvmc
8496 $def_xvr100
8497 $def_yuv4mpeg
8498 $def_zr
8501 /* FFmpeg */
8502 $def_libavcodec
8503 $def_libavformat
8504 $def_libavutil
8505 $def_libpostproc
8506 $def_libswscale
8507 $def_libavcodec_internals
8508 $def_libswscale_internals
8510 #define CONFIG_DECODERS 1
8511 #define CONFIG_ENCODERS 1
8512 #define CONFIG_DEMUXERS 1
8513 $def_muxers
8515 $def_arpa_inet_h
8516 $def_bswap
8517 $def_bzlib
8518 $def_dcbzl
8519 $def_dos_paths
8520 $def_fast_64bit
8521 $def_fast_unaligned
8522 $def_memalign_hack
8523 $def_mlib
8524 $def_mkstemp
8525 $def_posix_memalign
8526 $def_pthreads
8527 $def_ten_operands
8528 $def_threads
8529 $def_xform_asm
8530 $def_yasm
8532 #define CONFIG_FASTDIV 0
8533 #define CONFIG_FFSERVER 0
8534 #define CONFIG_GPL 1
8535 #define CONFIG_GRAY 0
8536 #define CONFIG_HARDCODED_TABLES 0
8537 #define CONFIG_LIBVORBIS 0
8538 #define CONFIG_POWERPC_PERF 0
8539 #define CONFIG_SMALL 0
8540 #define CONFIG_SWSCALE 1
8541 #define CONFIG_SWSCALE_ALPHA 1
8543 #define HAVE_ATTRIBUTE_PACKED 1
8544 #define HAVE_GETHRTIME 0
8545 #define HAVE_INLINE_ASM 1
8546 #define HAVE_LDBRX 0
8547 #define HAVE_POLL_H 1
8548 #define HAVE_PPC4XX 0
8549 #define HAVE_VFP_ARGS 1
8550 #define HAVE_VIRTUALALLOC 0
8552 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
8553 #define CONFIG_AANDCT 1
8554 #define CONFIG_FFT 1
8555 #define CONFIG_GOLOMB 1
8556 #define CONFIG_LPC 1
8557 #define CONFIG_MDCT 1
8558 #define CONFIG_RDFT 1
8560 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8561 $def_ebx_available
8562 #ifndef MP_DEBUG
8563 #define HAVE_EBP_AVAILABLE 1
8564 #else
8565 #define HAVE_EBP_AVAILABLE 0
8566 #endif
8568 #define CONFIG_H263_VAAPI_HWACCEL 0
8569 #define CONFIG_MPEG2_VAAPI_HWACCEL 0
8570 #define CONFIG_MPEG4_VAAPI_HWACCEL 0
8571 #define CONFIG_H264_VAAPI_HWACCEL 0
8572 #define CONFIG_VC1_VAAPI_HWACCEL 0
8573 #define CONFIG_WMV3_VAAPI_HWACCEL 0
8575 #endif /* MPLAYER_CONFIG_H */
8578 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8579 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8581 #############################################################################
8583 ./version.sh `$_cc -dumpversion`
8585 cat << EOF
8587 Config files successfully generated by ./configure $_configuration !
8589 Install prefix: $_prefix
8590 Data directory: $_datadir
8591 Config direct.: $_confdir
8593 Byte order: $_byte_order
8594 Optimizing for: $_optimizing
8596 Languages:
8597 Messages: $language_msg
8598 Manual pages: $language_man
8599 Documentation: $language_doc
8601 Enabled optional drivers:
8602 Input: $_inputmodules
8603 Codecs: $_codecmodules
8604 Audio output: $_aomodules
8605 Video output: $_vomodules
8607 Disabled optional drivers:
8608 Input: $_noinputmodules
8609 Codecs: $_nocodecmodules
8610 Audio output: $_noaomodules
8611 Video output: $_novomodules
8613 'config.h' and 'config.mak' contain your configuration options.
8614 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8615 compile *** DO NOT REPORT BUGS if you tweak these files ***
8617 'make' will now compile MPlayer and 'make install' will install it.
8618 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8623 if test "$_mtrr" = yes ; then
8624 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
8625 echo
8628 if ! x86_32; then
8629 cat <<EOF
8630 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8631 operating system ($system_name). You may encounter a few files that cannot
8632 be played due to missing open source video/audio codec support.
8638 cat <<EOF
8639 Check $TMPLOG if you wonder why an autodetection failed (make sure
8640 development headers/packages are installed).
8642 NOTE: The --enable-* parameters unconditionally force options on, completely
8643 skipping autodetection. This behavior is unlike what you may be used to from
8644 autoconf-based configure scripts that can decide to override you. This greater
8645 level of control comes at a price. You may have to provide the correct compiler
8646 and linker flags yourself.
8647 If you used one of these options (except --enable-menu and similar ones that
8648 turn on internal features) and experience a compilation or linking failure,
8649 make sure you have passed the necessary compiler/linker flags to configure.
8651 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
8655 if test "$_warn_CFLAGS" = yes; then
8656 cat <<EOF
8658 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
8659 but:
8661 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8663 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8664 To do so, execute 'CFLAGS= ./configure <options>'
8669 # Last move:
8670 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"