Ignore svn changes up to r30324
[mplayer/glamo.git] / configure
blob995dee56db9287a07aae7b995af6407baaee6915
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 _armv5te=auto
491 _armv6=auto
492 _armv6t2=auto
493 _armvfp=auto
494 neon=auto
495 _iwmmxt=auto
496 _mtrr=auto
497 _altivec=auto
498 _install=install
499 _ranlib=ranlib
500 _windres=windres
501 _cc=cc
502 _ar=ar
503 test "$CC" && _cc="$CC"
504 _as=auto
505 _nm=auto
506 _yasm=yasm
507 _runtime_cpudetection=no
508 _cross_compile=auto
509 _prefix="/usr/local"
510 _libavutil=auto
511 _libavcodec=auto
512 _libavformat=auto
513 _libpostproc=auto
514 _libswscale=auto
515 _libavcodec_internals=no
516 _libswscale_internals=no
517 _mencoder=yes
518 _mplayer=yes
519 _x11=auto
520 _xshape=auto
521 _xss=auto
522 _dga1=auto
523 _dga2=auto
524 _xv=auto
525 _xvmc=no #auto when complete
526 _vdpau=auto
527 _sdl=auto
528 _kva=auto
529 _direct3d=auto
530 _directx=auto
531 _win32waveout=auto
532 _nas=auto
533 _png=auto
534 _mng=auto
535 _jpeg=auto
536 _pnm=yes
537 _md5sum=yes
538 _yuv4mpeg=yes
539 _gif=auto
540 _gl=auto
541 matrixview=yes
542 _ggi=auto
543 _ggiwmh=auto
544 _aa=auto
545 _caca=auto
546 _svga=auto
547 _vesa=auto
548 _fbdev=auto
549 _dvb=auto
550 _dvbhead=auto
551 _dxr2=auto
552 _dxr3=auto
553 _ivtv=auto
554 _v4l2=auto
555 _iconv=auto
556 _langinfo=auto
557 _rtc=auto
558 _ossaudio=auto
559 _arts=auto
560 _esd=auto
561 _pulse=auto
562 _jack=auto
563 _dart=auto
564 _openal=no
565 _libcdio=auto
566 _liblzo=auto
567 _mad=auto
568 _mp3lame=auto
569 _toolame=auto
570 _twolame=auto
571 _tremor=auto
572 _tremor_internal=yes
573 _tremor_low=no
574 _libvorbis=auto
575 _speex=auto
576 _theora=auto
577 _mp3lib=auto
578 _liba52=auto
579 _liba52_internal=no
580 _libdca=auto
581 _libmpeg2=auto
582 _faad=auto
583 _faad_internal=auto
584 _faad_fixed=no
585 _faac=auto
586 _ladspa=auto
587 _libbs2b=auto
588 _xmms=no
589 _vcd=auto
590 _dvdnav=auto
591 _dvdnavconfig=dvdnav-config
592 _dvdreadconfig=dvdread-config
593 _dvdread=auto
594 _dvdread_internal=auto
595 _libdvdcss_internal=auto
596 _xanim=auto
597 _real=auto
598 _live=auto
599 _nemesi=auto
600 _native_rtsp=yes
601 _xinerama=auto
602 _mga=auto
603 _xmga=auto
604 _vm=auto
605 _xf86keysym=auto
606 _mlib=no #broken, thus disabled
607 _sgiaudio=auto
608 _sunaudio=auto
609 _alsa=auto
610 _fastmemcpy=yes
611 _unrar_exec=auto
612 _win32dll=auto
613 _select=yes
614 _radio=no
615 _radio_capture=no
616 _radio_v4l=auto
617 _radio_v4l2=auto
618 _radio_bsdbt848=auto
619 _tv=yes
620 _tv_v4l1=auto
621 _tv_v4l2=auto
622 _tv_bsdbt848=auto
623 _tv_dshow=auto
624 _pvr=auto
625 _network=yes
626 _winsock2_h=auto
627 _smb=auto
628 _vidix=auto
629 _vidix_pcidb=yes
630 _dhahelper=no
631 _svgalib_helper=no
632 _joystick=no
633 _xvid=auto
634 _x264=auto
635 _libnut=auto
636 _lirc=auto
637 _lircc=auto
638 _apple_remote=auto
639 _apple_ir=auto
640 _gui=no
641 _gtk1=no
642 _termcap=auto
643 _termios=auto
644 _3dfx=no
645 _s3fb=no
646 _wii=no
647 _tdfxfb=no
648 _tdfxvid=no
649 _xvr100=auto
650 _tga=yes
651 _directfb=auto
652 _zr=auto
653 _bl=no
654 _largefiles=yes
655 #language=en
656 _shm=auto
657 _linux_devfs=no
658 _charset="UTF-8"
659 _dynamic_plugins=no
660 _crash_debug=no
661 _sighandler=yes
662 _libdv=auto
663 _cdparanoia=auto
664 _cddb=auto
665 _big_endian=auto
666 _bitmap_font=yes
667 _freetype=auto
668 _fontconfig=auto
669 _menu=no
670 _qtx=auto
671 _maemo=auto
672 _coreaudio=auto
673 _corevideo=auto
674 _quartz=auto
675 quicktime=auto
676 _macosx_finder=no
677 _macosx_bundle=auto
678 _sortsub=yes
679 _freetypeconfig='freetype-config'
680 _fribidi=auto
681 _fribidiconfig='fribidi-config'
682 _enca=auto
683 _inet6=auto
684 _gethostbyname2=auto
685 _ftp=yes
686 _musepack=auto
687 _vstream=auto
688 _pthreads=auto
689 _w32threads=auto
690 _ass=auto
691 _rpath=no
692 _asmalign_pot=auto
693 _stream_cache=yes
694 _priority=no
695 def_dos_paths="#define HAVE_DOS_PATHS 0"
696 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
697 def_priority="#undef CONFIG_PRIORITY"
698 def_pthread_cache="#undef PTHREAD_CACHE"
699 _need_shmem=yes
700 for ac_option do
701 case "$ac_option" in
702 --help|-help|-h)
703 show_help
705 --prefix=*)
706 _prefix=$(echo $ac_option | cut -d '=' -f 2)
708 --bindir=*)
709 _bindir=$(echo $ac_option | cut -d '=' -f 2)
711 --datadir=*)
712 _datadir=$(echo $ac_option | cut -d '=' -f 2)
714 --mandir=*)
715 _mandir=$(echo $ac_option | cut -d '=' -f 2)
717 --confdir=*)
718 _confdir=$(echo $ac_option | cut -d '=' -f 2)
720 --libdir=*)
721 _libdir=$(echo $ac_option | cut -d '=' -f 2)
723 --codecsdir=*)
724 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
726 --win32codecsdir=*)
727 _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2)
729 --xanimcodecsdir=*)
730 _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
732 --realcodecsdir=*)
733 _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2)
736 --with-install=*)
737 _install=$(echo $ac_option | cut -d '=' -f 2 )
739 --with-xvmclib=*)
740 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
743 --with-sdl-config=*)
744 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
746 --with-freetype-config=*)
747 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
749 --with-fribidi-config=*)
750 _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2)
752 --with-gtk-config=*)
753 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
755 --with-glib-config=*)
756 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
758 --with-dvdnav-config=*)
759 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
761 --with-dvdread-config=*)
762 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
765 --extra-cflags=*)
766 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
768 --extra-ldflags=*)
769 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
771 --extra-libs=*)
772 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
774 --extra-libs-mplayer=*)
775 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
777 --extra-libs-mencoder=*)
778 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
781 --target=*)
782 _target=$(echo $ac_option | cut -d '=' -f 2)
784 --cc=*)
785 _cc=$(echo $ac_option | cut -d '=' -f 2)
787 --host-cc=*)
788 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
790 --as=*)
791 _as=$(echo $ac_option | cut -d '=' -f 2)
793 --nm=*)
794 _nm=$(echo $ac_option | cut -d '=' -f 2)
796 --yasm=*)
797 _yasm=$(echo $ac_option | cut -d '=' -f 2)
799 --ar=*)
800 _ar=$(echo $ac_option | cut -d '=' -f 2)
802 --ranlib=*)
803 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
805 --windres=*)
806 _windres=$(echo $ac_option | cut -d '=' -f 2)
808 --charset=*)
809 _charset=$(echo $ac_option | cut -d '=' -f 2)
811 --language-doc=*)
812 language_doc=$(echo $ac_option | cut -d '=' -f 2)
814 --language-man=*)
815 language_man=$(echo $ac_option | cut -d '=' -f 2)
817 --language-msg=*)
818 language_msg=$(echo $ac_option | cut -d '=' -f 2)
820 --language=*)
821 language=$(echo $ac_option | cut -d '=' -f 2)
824 --enable-static)
825 _ld_static='-static'
827 --disable-static)
828 _ld_static=''
830 --enable-profile)
831 _profile='-p'
833 --disable-profile)
834 _profile=
836 --enable-debug)
837 _debug='-g'
839 --enable-debug=*)
840 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
842 --disable-debug)
843 _debug=
845 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
846 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
847 --enable-cross-compile) _cross_compile=yes ;;
848 --disable-cross-compile) _cross_compile=no ;;
849 --enable-mencoder) _mencoder=yes ;;
850 --disable-mencoder) _mencoder=no ;;
851 --enable-mplayer) _mplayer=yes ;;
852 --disable-mplayer) _mplayer=no ;;
853 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
854 --disable-dynamic-plugins) _dynamic_plugins=no ;;
855 --enable-x11) _x11=yes ;;
856 --disable-x11) _x11=no ;;
857 --enable-xshape) _xshape=yes ;;
858 --disable-xshape) _xshape=no ;;
859 --enable-xss) _xss=yes ;;
860 --disable-xss) _xss=no ;;
861 --enable-xv) _xv=yes ;;
862 --disable-xv) _xv=no ;;
863 --enable-xvmc) _xvmc=yes ;;
864 --disable-xvmc) _xvmc=no ;;
865 --enable-vdpau) _vdpau=yes ;;
866 --disable-vdpau) _vdpau=no ;;
867 --enable-sdl) _sdl=yes ;;
868 --disable-sdl) _sdl=no ;;
869 --enable-kva) _kva=yes ;;
870 --disable-kva) _kva=no ;;
871 --enable-direct3d) _direct3d=yes ;;
872 --disable-direct3d) _direct3d=no ;;
873 --enable-directx) _directx=yes ;;
874 --disable-directx) _directx=no ;;
875 --enable-win32waveout) _win32waveout=yes ;;
876 --disable-win32waveout) _win32waveout=no ;;
877 --enable-nas) _nas=yes ;;
878 --disable-nas) _nas=no ;;
879 --enable-png) _png=yes ;;
880 --disable-png) _png=no ;;
881 --enable-mng) _mng=yes ;;
882 --disable-mng) _mng=no ;;
883 --enable-jpeg) _jpeg=yes ;;
884 --disable-jpeg) _jpeg=no ;;
885 --enable-pnm) _pnm=yes ;;
886 --disable-pnm) _pnm=no ;;
887 --enable-md5sum) _md5sum=yes ;;
888 --disable-md5sum) _md5sum=no ;;
889 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
890 --disable-yuv4mpeg) _yuv4mpeg=no ;;
891 --enable-gif) _gif=yes ;;
892 --disable-gif) _gif=no ;;
893 --enable-gl) _gl=yes ;;
894 --disable-gl) _gl=no ;;
895 --enable-matrixview) matrixview=yes ;;
896 --disable-matrixview) matrixview=no ;;
897 --enable-ggi) _ggi=yes ;;
898 --disable-ggi) _ggi=no ;;
899 --enable-ggiwmh) _ggiwmh=yes ;;
900 --disable-ggiwmh) _ggiwmh=no ;;
901 --enable-aa) _aa=yes ;;
902 --disable-aa) _aa=no ;;
903 --enable-caca) _caca=yes ;;
904 --disable-caca) _caca=no ;;
905 --enable-svga) _svga=yes ;;
906 --disable-svga) _svga=no ;;
907 --enable-vesa) _vesa=yes ;;
908 --disable-vesa) _vesa=no ;;
909 --enable-fbdev) _fbdev=yes ;;
910 --disable-fbdev) _fbdev=no ;;
911 --enable-dvb) _dvb=yes ;;
912 --disable-dvb) _dvb=no ;;
913 --enable-dvbhead) _dvbhead=yes ;;
914 --disable-dvbhead) _dvbhead=no ;;
915 --enable-dxr2) _dxr2=yes ;;
916 --disable-dxr2) _dxr2=no ;;
917 --enable-dxr3) _dxr3=yes ;;
918 --disable-dxr3) _dxr3=no ;;
919 --enable-ivtv) _ivtv=yes ;;
920 --disable-ivtv) _ivtv=no ;;
921 --enable-v4l2) _v4l2=yes ;;
922 --disable-v4l2) _v4l2=no ;;
923 --enable-iconv) _iconv=yes ;;
924 --disable-iconv) _iconv=no ;;
925 --enable-langinfo) _langinfo=yes ;;
926 --disable-langinfo) _langinfo=no ;;
927 --enable-rtc) _rtc=yes ;;
928 --disable-rtc) _rtc=no ;;
929 --enable-libdv) _libdv=yes ;;
930 --disable-libdv) _libdv=no ;;
931 --enable-ossaudio) _ossaudio=yes ;;
932 --disable-ossaudio) _ossaudio=no ;;
933 --enable-arts) _arts=yes ;;
934 --disable-arts) _arts=no ;;
935 --enable-esd) _esd=yes ;;
936 --disable-esd) _esd=no ;;
937 --enable-pulse) _pulse=yes ;;
938 --disable-pulse) _pulse=no ;;
939 --enable-jack) _jack=yes ;;
940 --disable-jack) _jack=no ;;
941 --enable-openal) _openal=yes ;;
942 --disable-openal) _openal=no ;;
943 --enable-dart) _dart=yes ;;
944 --disable-dart) _dart=no ;;
945 --enable-mad) _mad=yes ;;
946 --disable-mad) _mad=no ;;
947 --enable-mp3lame) _mp3lame=yes ;;
948 --disable-mp3lame) _mp3lame=no ;;
949 --enable-toolame) _toolame=yes ;;
950 --disable-toolame) _toolame=no ;;
951 --enable-twolame) _twolame=yes ;;
952 --disable-twolame) _twolame=no ;;
953 --enable-libcdio) _libcdio=yes ;;
954 --disable-libcdio) _libcdio=no ;;
955 --enable-liblzo) _liblzo=yes ;;
956 --disable-liblzo) _liblzo=no ;;
957 --enable-libvorbis) _libvorbis=yes ;;
958 --disable-libvorbis) _libvorbis=no ;;
959 --enable-speex) _speex=yes ;;
960 --disable-speex) _speex=no ;;
961 --enable-tremor) _tremor=yes ;;
962 --disable-tremor) _tremor=no ;;
963 --enable-tremor-internal) _tremor_internal=yes ;;
964 --disable-tremor-internal) _tremor_internal=no ;;
965 --enable-tremor-low) _tremor_low=yes ;;
966 --disable-tremor-low) _tremor_low=no ;;
967 --enable-theora) _theora=yes ;;
968 --disable-theora) _theora=no ;;
969 --enable-mp3lib) _mp3lib=yes ;;
970 --disable-mp3lib) _mp3lib=no ;;
971 --enable-liba52-internal) _liba52_internal=yes ;;
972 --disable-liba52-internal) _liba52_internal=no ;;
973 --enable-liba52) _liba52=yes ;;
974 --disable-liba52) _liba52=no ;;
975 --enable-libdca) _libdca=yes ;;
976 --disable-libdca) _libdca=no ;;
977 --enable-libmpeg2) _libmpeg2=yes ;;
978 --disable-libmpeg2) _libmpeg2=no ;;
979 --enable-musepack) _musepack=yes ;;
980 --disable-musepack) _musepack=no ;;
981 --enable-faad) _faad=yes ;;
982 --disable-faad) _faad=no ;;
983 --enable-faad-internal) _faad_internal=yes ;;
984 --disable-faad-internal) _faad_internal=no ;;
985 --enable-faad-fixed) _faad_fixed=yes ;;
986 --disable-faad-fixed) _faad_fixed=no ;;
987 --enable-faac) _faac=yes ;;
988 --disable-faac) _faac=no ;;
989 --enable-ladspa) _ladspa=yes ;;
990 --disable-ladspa) _ladspa=no ;;
991 --enable-libbs2b) _libbs2b=yes ;;
992 --disable-libbs2b) _libbs2b=no ;;
993 --enable-xmms) _xmms=yes ;;
994 --disable-xmms) _xmms=no ;;
995 --enable-vcd) _vcd=yes ;;
996 --disable-vcd) _vcd=no ;;
997 --enable-dvdread) _dvdread=yes ;;
998 --disable-dvdread) _dvdread=no ;;
999 --enable-dvdread-internal) _dvdread_internal=yes ;;
1000 --disable-dvdread-internal) _dvdread_internal=no ;;
1001 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1002 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1003 --enable-dvdnav) _dvdnav=yes ;;
1004 --disable-dvdnav) _dvdnav=no ;;
1005 --enable-xanim) _xanim=yes ;;
1006 --disable-xanim) _xanim=no ;;
1007 --enable-real) _real=yes ;;
1008 --disable-real) _real=no ;;
1009 --enable-live) _live=yes ;;
1010 --disable-live) _live=no ;;
1011 --enable-nemesi) _nemesi=yes ;;
1012 --disable-nemesi) _nemesi=no ;;
1013 --enable-xinerama) _xinerama=yes ;;
1014 --disable-xinerama) _xinerama=no ;;
1015 --enable-mga) _mga=yes ;;
1016 --disable-mga) _mga=no ;;
1017 --enable-xmga) _xmga=yes ;;
1018 --disable-xmga) _xmga=no ;;
1019 --enable-vm) _vm=yes ;;
1020 --disable-vm) _vm=no ;;
1021 --enable-xf86keysym) _xf86keysym=yes ;;
1022 --disable-xf86keysym) _xf86keysym=no ;;
1023 --enable-mlib) _mlib=yes ;;
1024 --disable-mlib) _mlib=no ;;
1025 --enable-sunaudio) _sunaudio=yes ;;
1026 --disable-sunaudio) _sunaudio=no ;;
1027 --enable-sgiaudio) _sgiaudio=yes ;;
1028 --disable-sgiaudio) _sgiaudio=no ;;
1029 --enable-alsa) _alsa=yes ;;
1030 --disable-alsa) _alsa=no ;;
1031 --enable-tv) _tv=yes ;;
1032 --disable-tv) _tv=no ;;
1033 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1034 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1035 --enable-tv-v4l1) _tv_v4l1=yes ;;
1036 --disable-tv-v4l1) _tv_v4l1=no ;;
1037 --enable-tv-v4l2) _tv_v4l2=yes ;;
1038 --disable-tv-v4l2) _tv_v4l2=no ;;
1039 --enable-tv-dshow) _tv_dshow=yes ;;
1040 --disable-tv-dshow) _tv_dshow=no ;;
1041 --enable-radio) _radio=yes ;;
1042 --enable-radio-capture) _radio_capture=yes ;;
1043 --disable-radio-capture) _radio_capture=no ;;
1044 --disable-radio) _radio=no ;;
1045 --enable-radio-v4l) _radio_v4l=yes ;;
1046 --disable-radio-v4l) _radio_v4l=no ;;
1047 --enable-radio-v4l2) _radio_v4l2=yes ;;
1048 --disable-radio-v4l2) _radio_v4l2=no ;;
1049 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1050 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1051 --enable-pvr) _pvr=yes ;;
1052 --disable-pvr) _pvr=no ;;
1053 --enable-fastmemcpy) _fastmemcpy=yes ;;
1054 --disable-fastmemcpy) _fastmemcpy=no ;;
1055 --enable-network) _network=yes ;;
1056 --disable-network) _network=no ;;
1057 --enable-winsock2_h) _winsock2_h=yes ;;
1058 --disable-winsock2_h) _winsock2_h=no ;;
1059 --enable-smb) _smb=yes ;;
1060 --disable-smb) _smb=no ;;
1061 --enable-vidix) _vidix=yes ;;
1062 --disable-vidix) _vidix=no ;;
1063 --with-vidix-drivers=*)
1064 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1066 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1067 --enable-dhahelper) _dhahelper=yes ;;
1068 --disable-dhahelper) _dhahelper=no ;;
1069 --enable-svgalib_helper) _svgalib_helper=yes ;;
1070 --disable-svgalib_helper) _svgalib_helper=no ;;
1071 --enable-joystick) _joystick=yes ;;
1072 --disable-joystick) _joystick=no ;;
1073 --enable-xvid) _xvid=yes ;;
1074 --disable-xvid) _xvid=no ;;
1075 --enable-x264) _x264=yes ;;
1076 --disable-x264) _x264=no ;;
1077 --enable-libnut) _libnut=yes ;;
1078 --disable-libnut) _libnut=no ;;
1079 --enable-libavutil) _libavutil=yes ;;
1080 --disable-libavutil) _libavutil=no ;;
1081 --enable-libavcodec) _libavcodec=yes ;;
1082 --disable-libavcodec) _libavcodec=no ;;
1083 --enable-libavformat) _libavformat=yes ;;
1084 --disable-libavformat) _libavformat=no ;;
1085 --enable-libpostproc) _libpostproc=yes ;;
1086 --disable-libpostproc) _libpostproc=no ;;
1087 --enable-libswscale) _libswscale=yes ;;
1088 --disable-libswscale) _libswscale=no ;;
1089 --ffmpeg-source-dir=*)
1090 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1092 --enable-lirc) _lirc=yes ;;
1093 --disable-lirc) _lirc=no ;;
1094 --enable-lircc) _lircc=yes ;;
1095 --disable-lircc) _lircc=no ;;
1096 --enable-apple-remote) _apple_remote=yes ;;
1097 --disable-apple-remote) _apple_remote=no ;;
1098 --enable-apple-ir) _apple_ir=yes ;;
1099 --disable-apple-ir) _apple_ir=no ;;
1100 --enable-gui) _gui=yes ;;
1101 --disable-gui) _gui=no ;;
1102 --enable-gtk1) _gtk1=yes ;;
1103 --disable-gtk1) _gtk1=no ;;
1104 --enable-termcap) _termcap=yes ;;
1105 --disable-termcap) _termcap=no ;;
1106 --enable-termios) _termios=yes ;;
1107 --disable-termios) _termios=no ;;
1108 --enable-3dfx) _3dfx=yes ;;
1109 --disable-3dfx) _3dfx=no ;;
1110 --enable-s3fb) _s3fb=yes ;;
1111 --disable-s3fb) _s3fb=no ;;
1112 --enable-wii) _wii=yes ;;
1113 --disable-wii) _wii=no ;;
1114 --enable-tdfxfb) _tdfxfb=yes ;;
1115 --disable-tdfxfb) _tdfxfb=no ;;
1116 --disable-tdfxvid) _tdfxvid=no ;;
1117 --enable-tdfxvid) _tdfxvid=yes ;;
1118 --disable-xvr100) _xvr100=no ;;
1119 --enable-xvr100) _xvr100=yes ;;
1120 --disable-tga) _tga=no ;;
1121 --enable-tga) _tga=yes ;;
1122 --enable-directfb) _directfb=yes ;;
1123 --disable-directfb) _directfb=no ;;
1124 --enable-zr) _zr=yes ;;
1125 --disable-zr) _zr=no ;;
1126 --enable-bl) _bl=yes ;;
1127 --disable-bl) _bl=no ;;
1128 --enable-mtrr) _mtrr=yes ;;
1129 --disable-mtrr) _mtrr=no ;;
1130 --enable-largefiles) _largefiles=yes ;;
1131 --disable-largefiles) _largefiles=no ;;
1132 --enable-shm) _shm=yes ;;
1133 --disable-shm) _shm=no ;;
1134 --enable-select) _select=yes ;;
1135 --disable-select) _select=no ;;
1136 --enable-linux-devfs) _linux_devfs=yes ;;
1137 --disable-linux-devfs) _linux_devfs=no ;;
1138 --enable-cdparanoia) _cdparanoia=yes ;;
1139 --disable-cdparanoia) _cdparanoia=no ;;
1140 --enable-cddb) _cddb=yes ;;
1141 --disable-cddb) _cddb=no ;;
1142 --enable-big-endian) _big_endian=yes ;;
1143 --disable-big-endian) _big_endian=no ;;
1144 --enable-bitmap-font) _bitmap_font=yes ;;
1145 --disable-bitmap-font) _bitmap_font=no ;;
1146 --enable-freetype) _freetype=yes ;;
1147 --disable-freetype) _freetype=no ;;
1148 --enable-fontconfig) _fontconfig=yes ;;
1149 --disable-fontconfig) _fontconfig=no ;;
1150 --enable-unrarexec) _unrar_exec=yes ;;
1151 --disable-unrarexec) _unrar_exec=no ;;
1152 --enable-ftp) _ftp=yes ;;
1153 --disable-ftp) _ftp=no ;;
1154 --enable-vstream) _vstream=yes ;;
1155 --disable-vstream) _vstream=no ;;
1156 --enable-pthreads) _pthreads=yes ;;
1157 --disable-pthreads) _pthreads=no ;;
1158 --enable-w32threads) _w32threads=yes ;;
1159 --disable-w32threads) _w32threads=no ;;
1160 --enable-ass) _ass=yes ;;
1161 --disable-ass) _ass=no ;;
1162 --enable-rpath) _rpath=yes ;;
1163 --disable-rpath) _rpath=no ;;
1165 --enable-fribidi) _fribidi=yes ;;
1166 --disable-fribidi) _fribidi=no ;;
1168 --enable-enca) _enca=yes ;;
1169 --disable-enca) _enca=no ;;
1171 --enable-inet6) _inet6=yes ;;
1172 --disable-inet6) _inet6=no ;;
1174 --enable-gethostbyname2) _gethostbyname2=yes ;;
1175 --disable-gethostbyname2) _gethostbyname2=no ;;
1177 --enable-dga1) _dga1=yes ;;
1178 --disable-dga1) _dga1=no ;;
1179 --enable-dga2) _dga2=yes ;;
1180 --disable-dga2) _dga2=no ;;
1182 --enable-menu) _menu=yes ;;
1183 --disable-menu) _menu=no ;;
1185 --enable-qtx) _qtx=yes ;;
1186 --disable-qtx) _qtx=no ;;
1188 --enable-coreaudio) _coreaudio=yes ;;
1189 --disable-coreaudio) _coreaudio=no ;;
1190 --enable-corevideo) _corevideo=yes ;;
1191 --disable-corevideo) _corevideo=no ;;
1192 --enable-quartz) _quartz=yes ;;
1193 --disable-quartz) _quartz=no ;;
1194 --enable-macosx-finder) _macosx_finder=yes ;;
1195 --disable-macosx-finder) _macosx_finder=no ;;
1196 --enable-macosx-bundle) _macosx_bundle=yes ;;
1197 --disable-macosx-bundle) _macosx_bundle=no ;;
1199 --enable-maemo) _maemo=yes ;;
1200 --disable-maemo) _maemo=no ;;
1202 --enable-sortsub) _sortsub=yes ;;
1203 --disable-sortsub) _sortsub=no ;;
1205 --enable-crash-debug) _crash_debug=yes ;;
1206 --disable-crash-debug) _crash_debug=no ;;
1207 --enable-sighandler) _sighandler=yes ;;
1208 --disable-sighandler) _sighandler=no ;;
1209 --enable-win32dll) _win32dll=yes ;;
1210 --disable-win32dll) _win32dll=no ;;
1212 --enable-sse) _sse=yes ;;
1213 --disable-sse) _sse=no ;;
1214 --enable-sse2) _sse2=yes ;;
1215 --disable-sse2) _sse2=no ;;
1216 --enable-ssse3) _ssse3=yes ;;
1217 --disable-ssse3) _ssse3=no ;;
1218 --enable-mmxext) _mmxext=yes ;;
1219 --disable-mmxext) _mmxext=no ;;
1220 --enable-3dnow) _3dnow=yes ;;
1221 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1222 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1223 --disable-3dnowext) _3dnowext=no ;;
1224 --enable-cmov) _cmov=yes ;;
1225 --disable-cmov) _cmov=no ;;
1226 --enable-fast-cmov) _fast_cmov=yes ;;
1227 --disable-fast-cmov) _fast_cmov=no ;;
1228 --enable-altivec) _altivec=yes ;;
1229 --disable-altivec) _altivec=no ;;
1230 --enable-armv5te) _armv5te=yes ;;
1231 --disable-armv5te) _armv5te=no ;;
1232 --enable-armv6) _armv6=yes ;;
1233 --disable-armv6) _armv6=no ;;
1234 --enable-armv6t2) _armv6t2=yes ;;
1235 --disable-armv6t2) _armv6t2=no ;;
1236 --enable-armvfp) _armvfp=yes ;;
1237 --disable-armvfp) _armvfp=no ;;
1238 --enable-neon) neon=yes ;;
1239 --disable-neon) neon=no ;;
1240 --enable-iwmmxt) _iwmmxt=yes ;;
1241 --disable-iwmmxt) _iwmmxt=no ;;
1242 --enable-mmx) _mmx=yes ;;
1243 --disable-mmx) # 3Dnow! and MMX2 require MMX
1244 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1247 echo "Unknown parameter: $ac_option"
1248 exit 1
1251 esac
1252 done
1254 if test "$_gui" = yes ; then
1255 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1256 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1259 # Atmos: moved this here, to be correct, if --prefix is specified
1260 test -z "$_bindir" && _bindir="$_prefix/bin"
1261 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1262 test -z "$_mandir" && _mandir="$_prefix/share/man"
1263 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1264 test -z "$_libdir" && _libdir="$_prefix/lib"
1266 # Determine our OS name and CPU architecture
1267 if test -z "$_target" ; then
1268 # OS name
1269 system_name=$(uname -s 2>&1)
1270 case "$system_name" in
1271 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1273 Haiku)
1274 system_name=BeOS
1276 IRIX*)
1277 system_name=IRIX
1279 GNU/kFreeBSD)
1280 system_name=FreeBSD
1282 HP-UX*)
1283 system_name=HP-UX
1285 [cC][yY][gG][wW][iI][nN]*)
1286 system_name=CYGWIN
1288 MINGW32*)
1289 system_name=MINGW32
1291 OS/2*)
1292 system_name=OS/2
1295 system_name="$system_name-UNKNOWN"
1297 esac
1300 # host's CPU/instruction set
1301 host_arch=$(uname -p 2>&1)
1302 case "$host_arch" in
1303 i386|sparc|ppc|alpha|arm|mips|vax)
1305 powerpc) # Darwin returns 'powerpc'
1306 host_arch=ppc
1308 *) # uname -p on Linux returns 'unknown' for the processor type,
1309 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1311 # Maybe uname -m (machine hardware name) returns something we
1312 # recognize.
1314 # x86/x86pc is used by QNX
1315 case "$(uname -m 2>&1)" in
1316 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 ;;
1317 ia64) host_arch=ia64 ;;
1318 macppc|ppc) host_arch=ppc ;;
1319 ppc64) host_arch=ppc64 ;;
1320 alpha) host_arch=alpha ;;
1321 sparc) host_arch=sparc ;;
1322 sparc64) host_arch=sparc64 ;;
1323 parisc*|hppa*|9000*) host_arch=hppa ;;
1324 arm*|zaurus|cats) host_arch=arm ;;
1325 sh3|sh4|sh4a) host_arch=sh ;;
1326 s390) host_arch=s390 ;;
1327 s390x) host_arch=s390x ;;
1328 *mips*) host_arch=mips ;;
1329 vax) host_arch=vax ;;
1330 xtensa*) host_arch=xtensa ;;
1331 *) host_arch=UNKNOWN ;;
1332 esac
1334 esac
1335 else # if test -z "$_target"
1336 system_name=$(echo $_target | cut -d '-' -f 2)
1337 case "$(echo $system_name | tr A-Z a-z)" in
1338 linux) system_name=Linux ;;
1339 freebsd) system_name=FreeBSD ;;
1340 gnu/kfreebsd) system_name=FreeBSD ;;
1341 netbsd) system_name=NetBSD ;;
1342 bsd/os) system_name=BSD/OS ;;
1343 openbsd) system_name=OpenBSD ;;
1344 dragonfly) system_name=DragonFly ;;
1345 sunos) system_name=SunOS ;;
1346 qnx) system_name=QNX ;;
1347 morphos) system_name=MorphOS ;;
1348 amigaos) system_name=AmigaOS ;;
1349 mingw32*) system_name=MINGW32 ;;
1350 esac
1351 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1352 host_arch=$(echo $_target | cut -d '-' -f 1)
1353 if test $(echo $host_arch) != "x86_64" ; then
1354 host_arch=$(echo $host_arch | tr '_' '-')
1358 extra_cflags="-I. $extra_cflags"
1359 _timer=timer-linux.c
1360 _getch=getch2.c
1361 if freebsd ; then
1362 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1363 extra_cflags="$extra_cflags -I/usr/local/include"
1366 if netbsd || dragonfly ; then
1367 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1368 extra_cflags="$extra_cflags -I/usr/pkg/include"
1371 if darwin; then
1372 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1373 _timer=timer-darwin.c
1376 if aix ; then
1377 extra_ldflags="$extra_ldflags -lC"
1380 if irix ; then
1381 _ranlib='ar -r'
1382 elif linux ; then
1383 _ranlib='true'
1386 if win32 ; then
1387 _exesuf=".exe"
1388 extra_cflags="$extra_cflags -fno-common"
1389 # -lwinmm is always needed for osdep/timer-win2.c
1390 extra_ldflags="$extra_ldflags -lwinmm"
1391 _pe_executable=yes
1392 _timer=timer-win2.c
1393 _priority=yes
1394 def_dos_paths="#define HAVE_DOS_PATHS 1"
1395 def_priority="#define CONFIG_PRIORITY 1"
1398 if mingw32 ; then
1399 _getch=getch2-win.c
1400 _need_shmem=no
1403 if amigaos ; then
1404 _select=no
1405 _sighandler=no
1406 _stream_cache=no
1407 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1408 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1411 if qnx ; then
1412 extra_ldflags="$extra_ldflags -lph"
1415 if os2 ; then
1416 _exesuf=".exe"
1417 _getch=getch2-os2.c
1418 _need_shmem=no
1419 _priority=yes
1420 def_dos_paths="#define HAVE_DOS_PATHS 1"
1421 def_priority="#define CONFIG_PRIORITY 1"
1424 for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1425 test "$I" && break
1426 done
1429 TMPLOG="configure.log"
1430 TMPC="$I/mplayer-conf-$RANDOM-$$.c"
1431 TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp"
1432 TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf"
1433 TMPH="$I/mplayer-conf-$RANDOM-$$.h"
1434 TMPS="$I/mplayer-conf-$RANDOM-$$.S"
1436 rm -f "$TMPLOG"
1437 echo configuration: $_configuration > "$TMPLOG"
1438 echo >> "$TMPLOG"
1441 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1442 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1446 # Checking CC version...
1447 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1448 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1449 echocheck "$_cc version"
1450 cc_vendor=intel
1451 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1452 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1453 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1454 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1455 # TODO verify older icc/ecc compatibility
1456 case $cc_version in
1458 cc_version="v. ?.??, bad"
1459 cc_fail=yes
1461 10.1|11.0|11.1)
1462 cc_version="$cc_version, ok"
1465 cc_version="$cc_version, bad"
1466 cc_fail=yes
1468 esac
1469 echores "$cc_version"
1470 else
1471 for _cc in "$_cc" gcc cc ; do
1472 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1473 if test "$cc_name_tmp" = "gcc"; then
1474 cc_name=$cc_name_tmp
1475 echocheck "$_cc version"
1476 cc_vendor=gnu
1477 cc_version=$($_cc -dumpversion 2>&1)
1478 case $cc_version in
1479 2.96*)
1480 cc_fail=yes
1483 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1484 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1485 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1487 esac
1488 echores "$cc_version"
1489 break
1491 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1492 if test "$cc_name_tmp" = "Sun C"; then
1493 echocheck "$_cc version"
1494 cc_vendor=sun
1495 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1496 _res_comment="experimental support only"
1497 echores "Sun C $cc_version"
1498 break
1500 done
1501 fi # icc
1502 test "$cc_fail" = yes && die "unsupported compiler version"
1504 if test -z "$_target" && x86 ; then
1505 cat > $TMPC << EOF
1506 int main(void) {
1507 int test[(int)sizeof(char *)-7];
1508 return 0;
1511 cc_check && host_arch=x86_64 || host_arch=i386
1514 echo "Detected operating system: $system_name"
1515 echo "Detected host architecture: $host_arch"
1517 echocheck "host cc"
1518 test "$_host_cc" || _host_cc=$_cc
1519 echores $_host_cc
1521 echocheck "cross compilation"
1522 if test $_cross_compile = auto ; then
1523 cat > $TMPC << EOF
1524 int main(void) { return 0; }
1526 _cross_compile=yes
1527 cc_check && "$TMPEXE" && _cross_compile=no
1529 echores $_cross_compile
1531 if test $_cross_compile = yes; then
1532 tmp_run() {
1533 return 0
1537 # ---
1539 # now that we know what compiler should be used for compilation, try to find
1540 # out which assembler is used by the $_cc compiler
1541 if test "$_as" = auto ; then
1542 _as=$($_cc -print-prog-name=as)
1543 test -z "$_as" && _as=as
1546 if test "$_nm" = auto ; then
1547 _nm=$($_cc -print-prog-name=nm)
1548 test -z "$_nm" && _nm=nm
1551 # XXX: this should be ok..
1552 _cpuinfo="echo"
1554 if test "$_runtime_cpudetection" = no ; then
1556 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1557 # FIXME: Remove the cygwin check once AMD CPUs are supported
1558 if test -r /proc/cpuinfo && ! cygwin; then
1559 # Linux with /proc mounted, extract CPU information from it
1560 _cpuinfo="cat /proc/cpuinfo"
1561 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1562 # FreeBSD with Linux emulation /proc mounted,
1563 # extract CPU information from it
1564 # Don't use it on x86 though, it never reports 3Dnow
1565 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1566 elif darwin && ! x86 ; then
1567 # use hostinfo on Darwin
1568 _cpuinfo="hostinfo"
1569 elif aix; then
1570 # use 'lsattr' on AIX
1571 _cpuinfo="lsattr -E -l proc0 -a type"
1572 elif x86; then
1573 # all other OSes try to extract CPU information from a small helper
1574 # program cpuinfo instead
1575 $_cc -o cpuinfo$_exesuf cpuinfo.c
1576 _cpuinfo="./cpuinfo$_exesuf"
1579 if x86 ; then
1580 # gather more CPU information
1581 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1582 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1583 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1584 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1585 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1587 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1589 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1590 -e s/xmm/sse/ -e s/kni/sse/)
1592 for ext in $pparam ; do
1593 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1594 done
1596 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1597 test $_sse = kernel_check && _mmxext=kernel_check
1599 echocheck "CPU vendor"
1600 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1602 echocheck "CPU type"
1603 echores "$pname"
1606 fi # test "$_runtime_cpudetection" = no
1608 if x86 && test "$_runtime_cpudetection" = no ; then
1609 extcheck() {
1610 if test "$1" = kernel_check ; then
1611 echocheck "kernel support of $2"
1612 cat > $TMPC <<EOF
1613 #include <stdlib.h>
1614 #include <signal.h>
1615 void catch() { exit(1); }
1616 int main(void) {
1617 signal(SIGILL, catch);
1618 __asm__ volatile ("$3":::"memory"); return 0;
1622 if cc_check && tmp_run ; then
1623 eval _$2=yes
1624 echores "yes"
1625 _optimizing="$_optimizing $2"
1626 return 0
1627 else
1628 eval _$2=no
1629 echores "failed"
1630 echo "It seems that your kernel does not correctly support $2."
1631 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1632 return 1
1635 return 0
1638 extcheck $_mmx "mmx" "emms"
1639 extcheck $_mmxext "mmxext" "sfence"
1640 extcheck $_3dnow "3dnow" "femms"
1641 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1642 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1643 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1644 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1645 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1647 echocheck "mtrr support"
1648 if test "$_mtrr" = kernel_check ; then
1649 _mtrr="yes"
1650 _optimizing="$_optimizing mtrr"
1652 echores "$_mtrr"
1654 if test "$_gcc3_ext" != ""; then
1655 # if we had to disable sse/sse2 because the active kernel does not
1656 # support this instruction set extension, we also have to tell
1657 # gcc3 to not generate sse/sse2 instructions for normal C code
1658 cat > $TMPC << EOF
1659 int main(void) { return 0; }
1661 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1667 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1668 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1669 _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'
1670 case "$host_arch" in
1671 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1672 _arch='X86 X86_32'
1673 _target_arch="ARCH_X86 = yes"
1674 _target_subarch="ARCH_X86_32 = yes"
1675 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1676 iproc=486
1677 proc=i486
1680 if test "$_runtime_cpudetection" = no ; then
1681 case "$pvendor" in
1682 AuthenticAMD)
1683 case "$pfamily" in
1684 3) proc=i386 iproc=386 ;;
1685 4) proc=i486 iproc=486 ;;
1686 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1687 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1688 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1689 proc=k6-3
1690 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1691 proc=geode
1692 elif test "$pmodel" -ge 8; then
1693 proc=k6-2
1694 elif test "$pmodel" -ge 6; then
1695 proc=k6
1696 else
1697 proc=i586
1700 6) iproc=686
1701 # It's a bit difficult to determine the correct type of Family 6
1702 # AMD CPUs just from their signature. Instead, we check directly
1703 # whether it supports SSE.
1704 if test "$_sse" = yes; then
1705 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1706 proc=athlon-xp
1707 else
1708 # Again, gcc treats athlon and athlon-tbird similarly.
1709 proc=athlon
1712 15) iproc=686
1713 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1714 # caught and remedied in the optimization tests below.
1715 proc=k8
1718 *) proc=k8 iproc=686 ;;
1719 esac
1721 GenuineIntel)
1722 case "$pfamily" in
1723 3) proc=i386 iproc=386 ;;
1724 4) proc=i486 iproc=486 ;;
1725 5) iproc=586
1726 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1727 proc=pentium-mmx # 4 is desktop, 8 is mobile
1728 else
1729 proc=i586
1732 6) iproc=686
1733 if test "$pmodel" -ge 15; then
1734 proc=core2
1735 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1736 proc=pentium-m
1737 elif test "$pmodel" -ge 7; then
1738 proc=pentium3
1739 elif test "$pmodel" -ge 3; then
1740 proc=pentium2
1741 else
1742 proc=i686
1745 15) iproc=686
1746 # A nocona in 32-bit mode has no more capabilities than a prescott.
1747 if test "$pmodel" -ge 3; then
1748 proc=prescott
1749 else
1750 proc=pentium4
1752 test $_fast_cmov = "auto" && _fast_cmov=no
1754 *) proc=prescott iproc=686 ;;
1755 esac
1757 CentaurHauls)
1758 case "$pfamily" in
1759 5) iproc=586
1760 if test "$pmodel" -ge 8; then
1761 proc=winchip2
1762 elif test "$pmodel" -ge 4; then
1763 proc=winchip-c6
1764 else
1765 proc=i586
1768 6) iproc=686
1769 if test "$pmodel" -ge 9; then
1770 proc=c3-2
1771 else
1772 proc=c3
1773 iproc=586
1776 *) proc=i686 iproc=i686 ;;
1777 esac
1779 unknown)
1780 case "$pfamily" in
1781 3) proc=i386 iproc=386 ;;
1782 4) proc=i486 iproc=486 ;;
1783 *) proc=i586 iproc=586 ;;
1784 esac
1787 proc=i586 iproc=586 ;;
1788 esac
1789 fi # test "$_runtime_cpudetection" = no
1792 # check that gcc supports our CPU, if not, fall back to earlier ones
1793 # LGB: check -mcpu and -march swithing step by step with enabling
1794 # to fall back till 386.
1796 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1798 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1799 cpuopt=-mtune
1800 else
1801 cpuopt=-mcpu
1804 echocheck "GCC & CPU optimization abilities"
1805 cat > $TMPC << EOF
1806 int main(void) { return 0; }
1808 if test "$_runtime_cpudetection" = no ; then
1809 cc_check -march=native && proc=native
1810 if test "$proc" = "k8"; then
1811 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1813 if test "$proc" = "athlon-xp"; then
1814 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1816 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1817 cc_check -march=$proc $cpuopt=$proc || proc=k6
1819 if test "$proc" = "k6" || test "$proc" = "c3"; then
1820 if ! cc_check -march=$proc $cpuopt=$proc; then
1821 if cc_check -march=i586 $cpuopt=i686; then
1822 proc=i586-i686
1823 else
1824 proc=i586
1828 if test "$proc" = "prescott" ; then
1829 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1831 if test "$proc" = "core2" ; then
1832 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1834 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
1835 cc_check -march=$proc $cpuopt=$proc || proc=i686
1837 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1838 cc_check -march=$proc $cpuopt=$proc || proc=i586
1840 if test "$proc" = "i586"; then
1841 cc_check -march=$proc $cpuopt=$proc || proc=i486
1843 if test "$proc" = "i486" ; then
1844 cc_check -march=$proc $cpuopt=$proc || proc=i386
1846 if test "$proc" = "i386" ; then
1847 cc_check -march=$proc $cpuopt=$proc || proc=error
1849 if test "$proc" = "error" ; then
1850 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1851 _mcpu=""
1852 _march=""
1853 _optimizing=""
1854 elif test "$proc" = "i586-i686"; then
1855 _march="-march=i586"
1856 _mcpu="$cpuopt=i686"
1857 _optimizing="$proc"
1858 else
1859 _march="-march=$proc"
1860 _mcpu="$cpuopt=$proc"
1861 _optimizing="$proc"
1863 else # if test "$_runtime_cpudetection" = no
1864 _mcpu="$cpuopt=generic"
1865 # at least i486 required, for bswap instruction
1866 _march="-march=i486"
1867 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1868 cc_check $_mcpu || _mcpu=""
1869 cc_check $_march $_mcpu || _march=""
1872 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1873 ## autodetected mcpu/march parameters
1874 if test "$_target" ; then
1875 # TODO: it may be a good idea to check GCC and fall back in all cases
1876 if test "$host_arch" = "i586-i686"; then
1877 _march="-march=i586"
1878 _mcpu="$cpuopt=i686"
1879 else
1880 _march="-march=$host_arch"
1881 _mcpu="$cpuopt=$host_arch"
1884 proc="$host_arch"
1886 case "$proc" in
1887 i386) iproc=386 ;;
1888 i486) iproc=486 ;;
1889 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1890 i686|athlon*|pentium*) iproc=686 ;;
1891 *) iproc=586 ;;
1892 esac
1895 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1896 _fast_cmov="yes"
1897 else
1898 _fast_cmov="no"
1901 echores "$proc"
1904 ia64)
1905 _arch='IA64'
1906 _target_arch='ARCH_IA64 = yes'
1907 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1908 iproc='ia64'
1911 x86_64|amd64)
1912 _arch='X86 X86_64'
1913 _target_subarch='ARCH_X86_64 = yes'
1914 _target_arch="ARCH_X86 = yes"
1915 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1916 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1917 iproc='x86_64'
1919 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1920 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1921 cpuopt=-mtune
1922 else
1923 cpuopt=-mcpu
1925 if test "$_runtime_cpudetection" = no ; then
1926 case "$pvendor" in
1927 AuthenticAMD)
1928 proc=k8;;
1929 GenuineIntel)
1930 case "$pfamily" in
1931 6) proc=core2;;
1933 # 64-bit prescotts exist, but as far as GCC is concerned they
1934 # have the same capabilities as a nocona.
1935 proc=nocona
1936 test $_fast_cmov = "auto" && _fast_cmov=no
1938 esac
1941 proc=error;;
1942 esac
1943 fi # test "$_runtime_cpudetection" = no
1945 echocheck "GCC & CPU optimization abilities"
1946 cat > $TMPC << EOF
1947 int main(void) { return 0; }
1949 # This is a stripped-down version of the i386 fallback.
1950 if test "$_runtime_cpudetection" = no ; then
1951 cc_check -march=native && proc=native
1952 # --- AMD processors ---
1953 if test "$proc" = "k8"; then
1954 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1956 # This will fail if gcc version < 3.3, which is ok because earlier
1957 # versions don't really support 64-bit on amd64.
1958 # Is this a valid assumption? -Corey
1959 if test "$proc" = "athlon-xp"; then
1960 cc_check -march=$proc $cpuopt=$proc || proc=error
1962 # --- Intel processors ---
1963 if test "$proc" = "core2"; then
1964 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
1966 if test "$proc" = "x86-64"; then
1967 cc_check -march=$proc $cpuopt=$proc || proc=nocona
1969 if test "$proc" = "nocona"; then
1970 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1972 if test "$proc" = "pentium4"; then
1973 cc_check -march=$proc $cpuopt=$proc || proc=error
1976 _march="-march=$proc"
1977 _mcpu="$cpuopt=$proc"
1978 if test "$proc" = "error" ; then
1979 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1980 _mcpu=""
1981 _march=""
1983 else # if test "$_runtime_cpudetection" = no
1984 # x86-64 is an undocumented option, an intersection of k8 and nocona.
1985 _march="-march=x86-64"
1986 _mcpu="$cpuopt=generic"
1987 cc_check $_mcpu || _mcpu="x86-64"
1988 cc_check $_mcpu || _mcpu=""
1989 cc_check $_march $_mcpu || _march=""
1992 _optimizing="$proc"
1993 test $_fast_cmov = "auto" && _fast_cmov=yes
1995 echores "$proc"
1998 sparc|sparc64)
1999 _arch='SPARC'
2000 _target_arch='ARCH_SPARC = yes'
2001 iproc='sparc'
2002 if test "$host_arch" = "sparc64" ; then
2003 _vis='yes'
2004 proc='ultrasparc'
2005 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2006 elif sunos ; then
2007 echocheck "CPU type"
2008 karch=$(uname -m)
2009 case "$(echo $karch)" in
2010 sun4) proc=v7 ;;
2011 sun4c) proc=v7 ;;
2012 sun4d) proc=v8 ;;
2013 sun4m) proc=v8 ;;
2014 sun4u) proc=ultrasparc _vis='yes' ;;
2015 sun4v) proc=v9 ;;
2016 *) proc=v8 ;;
2017 esac
2018 echores "$proc"
2019 else
2020 proc=v8
2022 _mcpu="-mcpu=$proc"
2023 _optimizing="$proc"
2026 arm|armv4l|armv5tel)
2027 _arch='ARM'
2028 _target_arch='ARCH_ARM = yes'
2029 iproc='arm'
2032 avr32)
2033 _arch='AVR32'
2034 _target_arch='ARCH_AVR32 = yes'
2035 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2036 iproc='avr32'
2039 sh|sh4)
2040 _arch='SH4'
2041 _target_arch='ARCH_SH4 = yes'
2042 iproc='sh4'
2045 ppc|ppc64|powerpc|powerpc64)
2046 _arch='PPC'
2047 def_dcbzl='#define HAVE_DCBZL 0'
2048 _target_arch='ARCH_PPC = yes'
2049 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2050 iproc='ppc'
2052 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2053 _arch='PPC PPC64'
2054 _target_subarch='ARCH_PPC64 = yes'
2055 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2057 echocheck "CPU type"
2058 case $system_name in
2059 Linux)
2060 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2061 if test -n "$($_cpuinfo | grep altivec)"; then
2062 test $_altivec = auto && _altivec=yes
2065 Darwin)
2066 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2067 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2068 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2069 test $_altivec = auto && _altivec=yes
2072 NetBSD)
2073 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2074 case $cc_version in
2075 2*|3.0*|3.1*|3.2*|3.3*)
2078 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2079 test $_altivec = auto && _altivec=yes
2082 esac
2084 AIX)
2085 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2087 esac
2088 if test "$_altivec" = yes; then
2089 echores "$proc altivec"
2090 else
2091 _altivec=no
2092 echores "$proc"
2095 echocheck "GCC & CPU optimization abilities"
2097 if test -n "$proc"; then
2098 case "$proc" in
2099 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2100 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2101 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2102 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2103 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2104 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2105 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2106 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2107 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2108 *) ;;
2109 esac
2110 # gcc 3.1(.1) and up supports 7400 and 7450
2111 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2112 case "$proc" in
2113 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2114 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2115 *) ;;
2116 esac
2118 # gcc 3.2 and up supports 970
2119 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2120 case "$proc" in
2121 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2122 def_dcbzl='#define HAVE_DCBZL 1' ;;
2123 *) ;;
2124 esac
2126 # gcc 3.3 and up supports POWER4
2127 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2128 case "$proc" in
2129 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2130 *) ;;
2131 esac
2133 # gcc 3.4 and up supports 440*
2134 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2135 case "$proc" in
2136 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2137 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2138 *) ;;
2139 esac
2141 # gcc 4.0 and up supports POWER5
2142 if test "$_cc_major" -ge "4"; then
2143 case "$proc" in
2144 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2145 *) ;;
2146 esac
2150 if test -n "$_mcpu"; then
2151 _optimizing=$(echo $_mcpu | cut -c 8-)
2152 echores "$_optimizing"
2153 else
2154 echores "none"
2159 alpha*)
2160 _arch='ALPHA'
2161 _target_arch='ARCH_ALPHA = yes'
2162 iproc='alpha'
2163 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2165 echocheck "CPU type"
2166 cat > $TMPC << EOF
2167 int main(void) {
2168 unsigned long ver, mask;
2169 __asm__ ("implver %0" : "=r" (ver));
2170 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2171 printf("%ld-%x\n", ver, ~mask);
2172 return 0;
2175 $_cc -o "$TMPEXE" "$TMPC"
2176 case $("$TMPEXE") in
2178 0-0) proc="ev4"; _mvi="0";;
2179 1-0) proc="ev5"; _mvi="0";;
2180 1-1) proc="ev56"; _mvi="0";;
2181 1-101) proc="pca56"; _mvi="1";;
2182 2-303) proc="ev6"; _mvi="1";;
2183 2-307) proc="ev67"; _mvi="1";;
2184 2-1307) proc="ev68"; _mvi="1";;
2185 esac
2186 echores "$proc"
2188 echocheck "GCC & CPU optimization abilities"
2189 if test "$proc" = "ev68" ; then
2190 cc_check -mcpu=$proc || proc=ev67
2192 if test "$proc" = "ev67" ; then
2193 cc_check -mcpu=$proc || proc=ev6
2195 _mcpu="-mcpu=$proc"
2196 echores "$proc"
2198 _optimizing="$proc"
2201 mips)
2202 _arch='SGI_MIPS'
2203 _target_arch='ARCH_SGI_MIPS = yes'
2204 iproc='sgi-mips'
2206 if irix ; then
2207 echocheck "CPU type"
2208 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2209 case "$(echo $proc)" in
2210 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2211 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2212 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2213 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2214 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2215 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2216 esac
2217 # gcc < 3.x does not support -mtune.
2218 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2219 _mcpu=''
2221 echores "$proc"
2226 hppa)
2227 _arch='PA_RISC'
2228 _target_arch='ARCH_PA_RISC = yes'
2229 iproc='PA-RISC'
2232 s390)
2233 _arch='S390'
2234 _target_arch='ARCH_S390 = yes'
2235 iproc='390'
2238 s390x)
2239 _arch='S390X'
2240 _target_arch='ARCH_S390X = yes'
2241 iproc='390x'
2244 vax)
2245 _arch='VAX'
2246 _target_arch='ARCH_VAX = yes'
2247 iproc='vax'
2250 xtensa)
2251 _arch='XTENSA'
2252 _target_arch='ARCH_XTENSA = yes'
2253 iproc='xtensa'
2256 generic)
2257 _arch='GENERIC'
2258 _target_arch='ARCH_GENERIC = yes'
2262 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2263 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2264 die "unsupported architecture $host_arch"
2266 esac # case "$host_arch" in
2268 if test "$_runtime_cpudetection" = yes ; then
2269 if x86 ; then
2270 test "$_cmov" != no && _cmov=yes
2271 x86_32 && _cmov=no
2272 test "$_mmx" != no && _mmx=yes
2273 test "$_3dnow" != no && _3dnow=yes
2274 test "$_3dnowext" != no && _3dnowext=yes
2275 test "$_mmxext" != no && _mmxext=yes
2276 test "$_sse" != no && _sse=yes
2277 test "$_sse2" != no && _sse2=yes
2278 test "$_ssse3" != no && _ssse3=yes
2279 test "$_mtrr" != no && _mtrr=yes
2281 if ppc; then
2282 _altivec=yes
2287 # endian testing
2288 echocheck "byte order"
2289 if test "$_big_endian" = auto ; then
2290 cat > $TMPC <<EOF
2291 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2292 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2293 int main(void) { return (int)ascii_name; }
2295 if cc_check ; then
2296 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2297 _big_endian=yes
2298 else
2299 _big_endian=no
2301 else
2302 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2305 if test "$_big_endian" = yes ; then
2306 _byte_order='big-endian'
2307 def_words_endian='#define WORDS_BIGENDIAN 1'
2308 def_bigendian='#define HAVE_BIGENDIAN 1'
2309 else
2310 _byte_order='little-endian'
2311 def_words_endian='#undef WORDS_BIGENDIAN'
2312 def_bigendian='#define HAVE_BIGENDIAN 0'
2314 echores "$_byte_order"
2317 echocheck "extern symbol prefix"
2318 cat > $TMPC << EOF
2319 int ff_extern;
2321 cc_check -c || die "Symbol mangling check failed."
2322 sym=$($_nm -P -g $TMPEXE)
2323 extern_prefix=${sym%%ff_extern*}
2324 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2325 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2326 echores $extern_prefix
2329 echocheck "assembler support of -pipe option"
2330 cat > $TMPC << EOF
2331 int main(void) { return 0; }
2333 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2334 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2337 echocheck "compiler support of named assembler arguments"
2338 _named_asm_args=yes
2339 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2340 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2341 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2342 _named_asm_args=no
2343 def_named_asm_args="#undef NAMED_ASM_ARGS"
2345 echores $_named_asm_args
2348 if darwin && test "$cc_vendor" = "gnu" ; then
2349 echocheck "GCC support of -mstackrealign"
2350 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2351 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2352 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2353 # wrong code with this flag, but this can be worked around by adding
2354 # -fno-unit-at-a-time as described in the blog post at
2355 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2356 cat > $TMPC << EOF
2357 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2358 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2360 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2361 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2362 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2363 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2364 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2367 # Checking for CFLAGS
2368 _install_strip="-s"
2369 if test "$_profile" != "" || test "$_debug" != "" ; then
2370 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2371 _install_strip=
2372 elif test -z "$CFLAGS" ; then
2373 if test "$cc_vendor" = "intel" ; then
2374 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2375 elif test "$cc_vendor" = "sun" ; then
2376 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2377 elif test "$cc_vendor" != "gnu" ; then
2378 CFLAGS="-O2 $_march $_mcpu $_pipe"
2379 else
2380 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2381 extra_ldflags="$extra_ldflags -ffast-math"
2383 else
2384 _warn_CFLAGS=yes
2387 cat > $TMPC << EOF
2388 int main(void) { return 0; }
2390 if test "$cc_vendor" = "gnu" ; then
2391 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2392 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2393 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2394 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2395 else
2396 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2399 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2402 if test -n "$LDFLAGS" ; then
2403 extra_ldflags="$extra_ldflags $LDFLAGS"
2404 _warn_CFLAGS=yes
2405 elif test "$cc_vendor" = "intel" ; then
2406 extra_ldflags="$extra_ldflags -i-static"
2408 if test -n "$CPPFLAGS" ; then
2409 extra_cflags="$extra_cflags $CPPFLAGS"
2410 _warn_CFLAGS=yes
2415 if x86_32 ; then
2416 # Checking assembler (_as) compatibility...
2417 # Added workaround for older as that reads from stdin by default - atmos
2418 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2419 echocheck "assembler ($_as $as_version)"
2421 _pref_as_version='2.9.1'
2422 echo 'nop' > $TMPS
2423 if test "$_mmx" = yes ; then
2424 echo 'emms' >> $TMPS
2426 if test "$_3dnow" = yes ; then
2427 _pref_as_version='2.10.1'
2428 echo 'femms' >> $TMPS
2430 if test "$_3dnowext" = yes ; then
2431 _pref_as_version='2.10.1'
2432 echo 'pswapd %mm0, %mm0' >> $TMPS
2434 if test "$_mmxext" = yes ; then
2435 _pref_as_version='2.10.1'
2436 echo 'movntq %mm0, (%eax)' >> $TMPS
2438 if test "$_sse" = yes ; then
2439 _pref_as_version='2.10.1'
2440 echo 'xorps %xmm0, %xmm0' >> $TMPS
2442 #if test "$_sse2" = yes ; then
2443 # _pref_as_version='2.11'
2444 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2446 if test "$_cmov" = yes ; then
2447 _pref_as_version='2.10.1'
2448 echo 'cmovb %eax, %ebx' >> $TMPS
2450 if test "$_ssse3" = yes ; then
2451 _pref_as_version='2.16.92'
2452 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2454 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2456 if test "$as_verc_fail" != yes ; then
2457 echores "ok"
2458 else
2459 _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2460 echores "failed"
2461 die "obsolete binutils version"
2464 fi #if x86_32
2466 echocheck ".align is a power of two"
2467 if test "$_asmalign_pot" = auto ; then
2468 _asmalign_pot=no
2469 cat > $TMPC << EOF
2470 int main(void) { __asm__ (".align 3"); return 0; }
2472 cc_check && _asmalign_pot=yes
2474 if test "$_asmalign_pot" = "yes" ; then
2475 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2476 else
2477 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2479 echores $_asmalign_pot
2481 if x86 ; then
2482 echocheck "10 assembler operands"
2483 ten_operands=no
2484 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2485 cat > $TMPC << EOF
2486 int main(void) {
2487 int x=0;
2488 __asm__ volatile(
2490 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2492 return 0;
2495 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2496 echores $ten_operands
2498 echocheck "ebx availability"
2499 ebx_available=no
2500 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2501 cat > $TMPC << EOF
2502 int main(void) {
2503 int x;
2504 __asm__ volatile(
2505 "xor %0, %0"
2506 :"=b"(x)
2507 // just adding ebx to clobber list seems unreliable with some
2508 // compilers, e.g. Haiku's gcc 2.95
2510 // and the above check does not work for OSX 64 bit...
2511 __asm__ volatile("":::"%ebx");
2512 return 0;
2515 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2516 echores $ebx_available
2518 echocheck "PIC"
2519 pic=no
2520 cat > $TMPC << EOF
2521 int main(void) {
2522 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2523 #error PIC not enabled
2524 #endif
2525 return 0;
2528 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2529 echores $pic
2531 echocheck "yasm"
2532 if test -z "$YASMFLAGS" ; then
2533 if darwin ; then
2534 x86_64 && objformat="macho64" || objformat="macho"
2535 elif win32 ; then
2536 objformat="win32"
2537 else
2538 objformat="elf"
2540 # currently tested for Linux x86, x86_64
2541 YASMFLAGS="-f $objformat"
2542 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2543 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2544 case "$objformat" in
2545 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2546 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2547 esac
2548 else
2549 _warn_CFLAGS=yes
2552 echo "pabsw xmm0, xmm0" > $TMPS
2553 yasm_check || _yasm=""
2554 if test $_yasm ; then
2555 test "$_mmx" = "yes" && fft_mmx="yes"
2556 def_yasm='#define HAVE_YASM 1'
2557 _have_yasm="yes"
2558 echores "$_yasm"
2559 else
2560 def_yasm='#define HAVE_YASM 0'
2561 fft_mmx="no"
2562 _have_yasm="no"
2563 echores "no"
2566 echocheck "bswap"
2567 def_bswap='#define HAVE_BSWAP 0'
2568 echo 'bswap %eax' > $TMPS
2569 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2570 echores "$bswap"
2571 fi #if x86
2574 #FIXME: This should happen before the check for CFLAGS..
2575 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2576 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2578 # check if AltiVec is supported by the compiler, and how to enable it
2579 echocheck "GCC AltiVec flags"
2580 cat > $TMPC << EOF
2581 int main(void) { return 0; }
2583 if $(cc_check -maltivec -mabi=altivec) ; then
2584 _altivec_gcc_flags="-maltivec -mabi=altivec"
2585 # check if <altivec.h> should be included
2586 cat > $TMPC << EOF
2587 #include <altivec.h>
2588 int main(void) { return 0; }
2590 if $(cc_check $_altivec_gcc_flags) ; then
2591 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2592 inc_altivec_h='#include <altivec.h>'
2593 else
2594 cat > $TMPC << EOF
2595 int main(void) { return 0; }
2597 if $(cc_check -faltivec) ; then
2598 _altivec_gcc_flags="-faltivec"
2599 else
2600 _altivec=no
2601 _altivec_gcc_flags="none, AltiVec disabled"
2605 echores "$_altivec_gcc_flags"
2607 # check if the compiler supports braces for vector declarations
2608 cat > $TMPC << EOF
2609 $inc_altivec_h
2610 int main(void) { (vector int) {1}; return 0; }
2612 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2614 # Disable runtime cpudetection if we cannot generate AltiVec code or
2615 # AltiVec is disabled by the user.
2616 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2617 && _runtime_cpudetection=no
2619 # Show that we are optimizing for AltiVec (if enabled and supported).
2620 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2621 && _optimizing="$_optimizing altivec"
2623 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2624 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2627 if ppc ; then
2628 def_xform_asm='#define HAVE_XFORM_ASM 0'
2629 xform_asm=no
2630 echocheck "XFORM ASM support"
2631 cat > $TMPC << EOF
2632 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2634 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2635 echores "$xform_asm"
2638 if arm ; then
2639 echocheck "ARM pld instruction"
2640 cat > $TMPC << EOF
2641 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2643 pld=no
2644 cc_check && pld=yes
2645 echores "$pld"
2647 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2648 if test $_armv5te = "auto" ; then
2649 cat > $TMPC << EOF
2650 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2652 _armv5te=no
2653 cc_check && _armv5te=yes
2655 echores "$_armv5te"
2657 echocheck "ARMv6 (SIMD instructions)"
2658 if test $_armv6 = "auto" ; then
2659 cat > $TMPC << EOF
2660 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2662 _armv6=no
2663 cc_check && _armv6=yes
2665 echores "$_armv6"
2667 echocheck "ARMv6t2 (SIMD instructions)"
2668 if test $_armv6t2 = "auto" ; then
2669 cat > $TMPC << EOF
2670 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2672 _armv6t2=no
2673 cc_check && _armv6t2=yes
2675 echores "$_armv6"
2677 echocheck "ARM VFP"
2678 if test $_armvfp = "auto" ; then
2679 cat > $TMPC << EOF
2680 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2682 _armvfp=no
2683 cc_check && _armvfp=yes
2685 echores "$_armvfp"
2687 echocheck "ARM NEON"
2688 if test $neon = "auto" ; then
2689 cat > $TMPC << EOF
2690 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2692 neon=no
2693 cc_check && neon=yes
2695 echores "$neon"
2697 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2698 if test $_iwmmxt = "auto" ; then
2699 cat > $TMPC << EOF
2700 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2702 _iwmmxt=no
2703 cc_check && _iwmmxt=yes
2705 echores "$_iwmmxt"
2708 _cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2709 test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
2710 test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
2711 test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
2712 test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts"
2713 test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts"
2714 test "$_sse" = yes && _cpuexts="SSE $_cpuexts"
2715 test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts"
2716 test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts"
2717 test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts"
2718 test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts"
2719 test "$pld" = yes && _cpuexts="PLD $_cpuexts"
2720 test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
2721 test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
2722 test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts"
2723 test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts"
2724 test "$neon" = yes && _cpuexts="NEON $_cpuexts"
2725 test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
2726 test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
2727 test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
2729 # Checking kernel version...
2730 if x86_32 && linux ; then
2731 _k_verc_problem=no
2732 kernel_version=$(uname -r 2>&1)
2733 echocheck "$system_name kernel version"
2734 case "$kernel_version" in
2735 '') kernel_version="?.??"; _k_verc_fail=yes;;
2736 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2737 _k_verc_problem=yes;;
2738 esac
2739 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2740 _k_verc_fail=yes
2742 if test "$_k_verc_fail" ; then
2743 echores "$kernel_version, fail"
2744 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2745 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2746 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2747 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2748 echo "2.2.x you must upgrade it to get SSE support!"
2749 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2750 else
2751 echores "$kernel_version, ok"
2755 ######################
2756 # MAIN TESTS GO HERE #
2757 ######################
2760 echocheck "-lposix"
2761 cat > $TMPC <<EOF
2762 int main(void) { return 0; }
2764 if cc_check -lposix ; then
2765 extra_ldflags="$extra_ldflags -lposix"
2766 echores "yes"
2767 else
2768 echores "no"
2771 echocheck "-lm"
2772 cat > $TMPC <<EOF
2773 int main(void) { return 0; }
2775 if cc_check -lm ; then
2776 _ld_lm="-lm"
2777 echores "yes"
2778 else
2779 _ld_lm=""
2780 echores "no"
2784 echocheck "langinfo"
2785 if test "$_langinfo" = auto ; then
2786 cat > $TMPC <<EOF
2787 #include <langinfo.h>
2788 int main(void) { nl_langinfo(CODESET); return 0; }
2790 _langinfo=no
2791 cc_check && _langinfo=yes
2793 if test "$_langinfo" = yes ; then
2794 def_langinfo='#define HAVE_LANGINFO 1'
2795 else
2796 def_langinfo='#undef HAVE_LANGINFO'
2798 echores "$_langinfo"
2801 echocheck "language"
2802 # Set preferred languages, "all" uses English as main language.
2803 test -z "$language" && language=$LINGUAS
2804 test -z "$language_doc" && language_doc=$language
2805 test -z "$language_man" && language_man=$language
2806 test -z "$language_msg" && language_msg=$language
2807 language_doc=$(echo $language_doc | tr , " ")
2808 language_man=$(echo $language_man | tr , " ")
2809 language_msg=$(echo $language_msg | tr , " ")
2811 test "$language_doc" = "all" && language_doc=$doc_lang_all
2812 test "$language_man" = "all" && language_man=$man_lang_all
2813 test "$language_msg" = "all" && language_msg=en
2815 # Prune non-existing translations from language lists.
2816 # Set message translation to the first available language.
2817 # Fall back on English.
2818 for lang in $language_doc ; do
2819 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2820 done
2821 language_doc=$tmp_language_doc
2822 test -z "$language_doc" && language_doc=en
2824 for lang in $language_man ; do
2825 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2826 done
2827 language_man=$tmp_language_man
2828 test -z "$language_man" && language_man=en
2830 for lang in $language_msg ; do
2831 test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break
2832 done
2833 language_msg=$tmp_language_msg
2834 test -z "$language_msg" && language_msg=en
2835 _mp_help="help/help_mp-${language_msg}.h"
2836 echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc"
2839 echocheck "enable sighandler"
2840 if test "$_sighandler" = yes ; then
2841 def_sighandler='#define CONFIG_SIGHANDLER 1'
2842 else
2843 def_sighandler='#undef CONFIG_SIGHANDLER'
2845 echores "$_sighandler"
2847 echocheck "runtime cpudetection"
2848 if test "$_runtime_cpudetection" = yes ; then
2849 _optimizing="Runtime CPU-Detection enabled"
2850 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2851 else
2852 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2854 echores "$_runtime_cpudetection"
2857 echocheck "restrict keyword"
2858 for restrict_keyword in restrict __restrict __restrict__ ; do
2859 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2860 if cc_check; then
2861 def_restrict_keyword=$restrict_keyword
2862 break;
2864 done
2865 if [ -n "$def_restrict_keyword" ]; then
2866 echores "$def_restrict_keyword"
2867 else
2868 echores "none"
2870 # Avoid infinite recursion loop ("#define restrict restrict")
2871 if [ "$def_restrict_keyword" != "restrict" ]; then
2872 def_restrict_keyword="#define restrict $def_restrict_keyword"
2873 else
2874 def_restrict_keyword=""
2878 echocheck "__builtin_expect"
2879 # GCC branch prediction hint
2880 cat > $TMPC << EOF
2881 int foo(int a) {
2882 a = __builtin_expect(a, 10);
2883 return a == 10 ? 0 : 1;
2885 int main(void) { return foo(10) && foo(0); }
2887 _builtin_expect=no
2888 cc_check && _builtin_expect=yes
2889 if test "$_builtin_expect" = yes ; then
2890 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2891 else
2892 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2894 echores "$_builtin_expect"
2897 echocheck "kstat"
2898 cat > $TMPC << EOF
2899 #include <kstat.h>
2900 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2902 _kstat=no
2903 cc_check -lkstat && _kstat=yes
2904 if test "$_kstat" = yes ; then
2905 def_kstat="#define HAVE_LIBKSTAT 1"
2906 extra_ldflags="$extra_ldflags -lkstat"
2907 else
2908 def_kstat="#undef HAVE_LIBKSTAT"
2910 echores "$_kstat"
2913 echocheck "posix4"
2914 # required for nanosleep on some systems
2915 cat > $TMPC << EOF
2916 #include <time.h>
2917 int main(void) { (void) nanosleep(0, 0); return 0; }
2919 _posix4=no
2920 cc_check -lposix4 && _posix4=yes
2921 if test "$_posix4" = yes ; then
2922 extra_ldflags="$extra_ldflags -lposix4"
2924 echores "$_posix4"
2926 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2927 echocheck $func
2928 cat > $TMPC << EOF
2929 #include <math.h>
2930 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2932 eval _$func=no
2933 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2934 if eval test "x\$_$func" = "xyes"; then
2935 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2936 echores yes
2937 else
2938 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2939 echores no
2941 done
2944 echocheck "mkstemp"
2945 cat > $TMPC << EOF
2946 #include <stdlib.h>
2947 int main(void) { char a; mkstemp(&a); return 0; }
2949 _mkstemp=no
2950 cc_check && _mkstemp=yes
2951 if test "$_mkstemp" = yes ; then
2952 def_mkstemp='#define HAVE_MKSTEMP 1'
2953 else
2954 def_mkstemp='#undef HAVE_MKSTEMP'
2956 echores "$_mkstemp"
2959 echocheck "nanosleep"
2960 # also check for nanosleep
2961 cat > $TMPC << EOF
2962 #include <time.h>
2963 int main(void) { (void) nanosleep(0, 0); return 0; }
2965 _nanosleep=no
2966 cc_check && _nanosleep=yes
2967 if test "$_nanosleep" = yes ; then
2968 def_nanosleep='#define HAVE_NANOSLEEP 1'
2969 else
2970 def_nanosleep='#undef HAVE_NANOSLEEP'
2972 echores "$_nanosleep"
2975 echocheck "socklib"
2976 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2977 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2978 cat > $TMPC << EOF
2979 #include <netdb.h>
2980 #include <sys/socket.h>
2981 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
2983 _socklib=no
2984 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2985 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2986 done
2987 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
2988 if test $_winsock2_h = auto ; then
2989 _winsock2_h=no
2990 cat > $TMPC << EOF
2991 #include <winsock2.h>
2992 int main(void) { (void) gethostbyname(0); return 0; }
2994 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2996 test "$_ld_sock" && _res_comment="using $_ld_sock"
2997 echores "$_socklib"
3000 if test $_winsock2_h = yes ; then
3001 _ld_sock="-lws2_32"
3002 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3003 else
3004 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3008 echocheck "arpa/inet.h"
3009 arpa_inet_h=no
3010 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3011 cat > $TMPC << EOF
3012 #include <arpa/inet.h>
3013 int main(void) { return 0; }
3015 cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3016 echores "$arpa_inet_h"
3019 echocheck "inet_pton()"
3020 def_inet_pton='#define HAVE_INET_PTON 0'
3021 inet_pton=no
3022 cat > $TMPC << EOF
3023 #include <sys/types.h>
3024 #include <sys/socket.h>
3025 #include <arpa/inet.h>
3026 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3028 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3029 cc_check $_ld_tmp && inet_pton=yes && break
3030 done
3031 if test $inet_pton = yes ; then
3032 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3033 def_inet_pton='#define HAVE_INET_PTON 1'
3035 echores "$inet_pton"
3038 echocheck "inet_aton()"
3039 def_inet_aton='#define HAVE_INET_ATON 0'
3040 inet_aton=no
3041 cat > $TMPC << EOF
3042 #include <sys/types.h>
3043 #include <sys/socket.h>
3044 #include <arpa/inet.h>
3045 int main(void) { (void) inet_aton(0, 0); return 0; }
3047 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3048 cc_check $_ld_tmp && inet_aton=yes && break
3049 done
3050 if test $inet_aton = yes ; then
3051 test "$_ld_tmp" && _res_comment="using $_ld_tmp"
3052 def_inet_aton='#define HAVE_INET_ATON 1'
3054 echores "$inet_aton"
3057 echocheck "socklen_t"
3058 _socklen_t=no
3059 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3060 cat > $TMPC << EOF
3061 #include <$header>
3062 int main(void) { socklen_t v = 0; return v; }
3064 cc_check && _socklen_t=yes && break
3065 done
3066 if test "$_socklen_t" = yes ; then
3067 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3068 else
3069 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3071 echores "$_socklen_t"
3074 echocheck "closesocket()"
3075 _closesocket=no
3076 cat > $TMPC << EOF
3077 #include <winsock2.h>
3078 int main(void) { closesocket(~0); return 0; }
3080 cc_check $_ld_sock && _closesocket=yes
3081 if test "$_closesocket" = yes ; then
3082 def_closesocket='#define HAVE_CLOSESOCKET 1'
3083 else
3084 def_closesocket='#define HAVE_CLOSESOCKET 0'
3086 echores "$_closesocket"
3089 echocheck "network"
3090 test $_winsock2_h = no && test $inet_pton = no &&
3091 test $inet_aton = no && _network=no
3092 if test "$_network" = yes ; then
3093 def_network='#define CONFIG_NETWORK 1'
3094 extra_ldflags="$extra_ldflags $_ld_sock"
3095 _inputmodules="network $_inputmodules"
3096 else
3097 _noinputmodules="network $_noinputmodules"
3098 def_network='#undef CONFIG_NETWORK'
3099 _ftp=no
3101 echores "$_network"
3104 echocheck "inet6"
3105 if test "$_inet6" = auto ; then
3106 cat > $TMPC << EOF
3107 #include <sys/types.h>
3108 #if !defined(_WIN32) || defined(__CYGWIN__)
3109 #include <sys/socket.h>
3110 #include <netinet/in.h>
3111 #else
3112 #include <ws2tcpip.h>
3113 #endif
3114 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3116 _inet6=no
3117 if cc_check $_ld_sock ; then
3118 _inet6=yes
3121 if test "$_inet6" = yes ; then
3122 def_inet6='#define HAVE_AF_INET6 1'
3123 else
3124 def_inet6='#undef HAVE_AF_INET6'
3126 echores "$_inet6"
3129 echocheck "gethostbyname2"
3130 if test "$_gethostbyname2" = auto ; then
3131 cat > $TMPC << EOF
3132 #include <sys/types.h>
3133 #include <sys/socket.h>
3134 #include <netdb.h>
3135 int main(void) { gethostbyname2("", AF_INET); return 0; }
3137 _gethostbyname2=no
3138 if cc_check ; then
3139 _gethostbyname2=yes
3142 if test "$_gethostbyname2" = yes ; then
3143 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3144 else
3145 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3147 echores "$_gethostbyname2"
3150 echocheck "inttypes.h (required)"
3151 cat > $TMPC << EOF
3152 #include <inttypes.h>
3153 int main(void) { return 0; }
3155 _inttypes=no
3156 cc_check && _inttypes=yes
3157 echores "$_inttypes"
3159 if test "$_inttypes" = no ; then
3160 echocheck "bitypes.h (inttypes.h predecessor)"
3161 cat > $TMPC << EOF
3162 #include <sys/bitypes.h>
3163 int main(void) { return 0; }
3165 cc_check && _inttypes=yes
3166 if test "$_inttypes" = yes ; then
3167 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."
3168 else
3169 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3174 echocheck "int_fastXY_t in inttypes.h"
3175 cat > $TMPC << EOF
3176 #include <inttypes.h>
3177 int main(void) {
3178 volatile int_fast16_t v= 0;
3179 return v; }
3181 _fast_inttypes=no
3182 cc_check && _fast_inttypes=yes
3183 if test "$_fast_inttypes" = no ; then
3184 def_fast_inttypes='
3185 typedef signed char int_fast8_t;
3186 typedef signed int int_fast16_t;
3187 typedef signed int int_fast32_t;
3188 typedef signed long long int_fast64_t;
3189 typedef unsigned char uint_fast8_t;
3190 typedef unsigned int uint_fast16_t;
3191 typedef unsigned int uint_fast32_t;
3192 typedef unsigned long long uint_fast64_t;'
3194 echores "$_fast_inttypes"
3197 echocheck "malloc.h"
3198 cat > $TMPC << EOF
3199 #include <malloc.h>
3200 int main(void) { (void) malloc(0); return 0; }
3202 _malloc=no
3203 cc_check && _malloc=yes
3204 if test "$_malloc" = yes ; then
3205 def_malloc_h='#define HAVE_MALLOC_H 1'
3206 else
3207 def_malloc_h='#define HAVE_MALLOC_H 0'
3209 # malloc.h emits a warning in FreeBSD and OpenBSD
3210 freebsd || openbsd || dragonfly && def_malloc_h='#define HAVE_MALLOC_H 0'
3211 echores "$_malloc"
3214 echocheck "memalign()"
3215 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3216 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3217 cat > $TMPC << EOF
3218 #include <malloc.h>
3219 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3221 _memalign=no
3222 cc_check && _memalign=yes
3223 if test "$_memalign" = yes ; then
3224 def_memalign='#define HAVE_MEMALIGN 1'
3225 else
3226 def_memalign='#define HAVE_MEMALIGN 0'
3227 def_map_memalign='#define memalign(a,b) malloc(b)'
3228 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3230 echores "$_memalign"
3233 echocheck "posix_memalign()"
3234 posix_memalign=no
3235 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3236 cat > $TMPC << EOF
3237 #define _XOPEN_SOURCE 600
3238 #include <stdlib.h>
3239 int main(void) { posix_memalign(NULL, 0, 0); }
3241 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3242 echores "$posix_memalign"
3245 echocheck "alloca.h"
3246 cat > $TMPC << EOF
3247 #include <alloca.h>
3248 int main(void) { (void) alloca(0); return 0; }
3250 _alloca=no
3251 cc_check && _alloca=yes
3252 if cc_check ; then
3253 def_alloca_h='#define HAVE_ALLOCA_H 1'
3254 else
3255 def_alloca_h='#undef HAVE_ALLOCA_H'
3257 echores "$_alloca"
3260 echocheck "fastmemcpy"
3261 if test "$_fastmemcpy" = yes ; then
3262 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3263 else
3264 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3266 echores "$_fastmemcpy"
3269 echocheck "mman.h"
3270 cat > $TMPC << EOF
3271 #include <sys/types.h>
3272 #include <sys/mman.h>
3273 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3275 _mman=no
3276 cc_check && _mman=yes
3277 if test "$_mman" = yes ; then
3278 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3279 else
3280 def_mman_h='#undef HAVE_SYS_MMAN_H'
3281 os2 && _need_mmap=yes
3283 echores "$_mman"
3285 cat > $TMPC << EOF
3286 #include <sys/types.h>
3287 #include <sys/mman.h>
3288 int main(void) { void *p = MAP_FAILED; return 0; }
3290 _mman_has_map_failed=no
3291 cc_check && _mman_has_map_failed=yes
3292 if test "$_mman_has_map_failed" = yes ; then
3293 def_mman_has_map_failed=''
3294 else
3295 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3298 echocheck "dynamic loader"
3299 cat > $TMPC << EOF
3300 #include <stddef.h>
3301 #include <dlfcn.h>
3302 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3304 _dl=no
3305 for _ld_tmp in "" "-ldl" ; do
3306 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3307 done
3308 if test "$_dl" = yes ; then
3309 def_dl='#define HAVE_LIBDL 1'
3310 else
3311 def_dl='#undef HAVE_LIBDL'
3313 echores "$_dl"
3316 echocheck "dynamic a/v plugins support"
3317 if test "$_dl" = no ; then
3318 _dynamic_plugins=no
3320 if test "$_dynamic_plugins" = yes ; then
3321 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3322 else
3323 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3325 echores "$_dynamic_plugins"
3328 def_threads='#define HAVE_THREADS 0'
3330 echocheck "pthread"
3331 if linux ; then
3332 THREAD_CFLAGS=-D_REENTRANT
3333 elif freebsd || netbsd || openbsd || bsdos ; then
3334 THREAD_CFLAGS=-D_THREAD_SAFE
3336 if test "$_pthreads" = auto ; then
3337 cat > $TMPC << EOF
3338 #include <pthread.h>
3339 void* func(void *arg) { return arg; }
3340 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3342 _pthreads=no
3343 if ! hpux ; then
3344 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3345 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3346 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3347 done
3350 if test "$_pthreads" = yes ; then
3351 test $_ld_pthread && _res_comment="using $_ld_pthread"
3352 def_pthreads='#define HAVE_PTHREADS 1'
3353 def_threads='#define HAVE_THREADS 1'
3354 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3355 else
3356 _res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3357 def_pthreads='#undef HAVE_PTHREADS'
3358 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3359 mingw32 || _win32dll=no
3361 echores "$_pthreads"
3363 if cygwin ; then
3364 if test "$_pthreads" = yes ; then
3365 def_pthread_cache="#define PTHREAD_CACHE 1"
3366 else
3367 _stream_cache=no
3368 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3372 echocheck "w32threads"
3373 if test "$_pthreads" = yes ; then
3374 _res_comment="using pthread instead"
3375 _w32threads=no
3377 if test "$_w32threads" = auto ; then
3378 _w32threads=no
3379 mingw32 && _w32threads=yes
3381 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3382 echores "$_w32threads"
3384 echocheck "rpath"
3385 netbsd &&_rpath=yes
3386 if test "$_rpath" = yes ; then
3387 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3388 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3389 done
3390 extra_ldflags=$tmp
3392 echores "$_rpath"
3394 echocheck "iconv"
3395 if test "$_iconv" = auto ; then
3396 cat > $TMPC << EOF
3397 #include <stdio.h>
3398 #include <unistd.h>
3399 #include <iconv.h>
3400 #define INBUFSIZE 1024
3401 #define OUTBUFSIZE 4096
3403 char inbuffer[INBUFSIZE];
3404 char outbuffer[OUTBUFSIZE];
3406 int main(void) {
3407 size_t numread;
3408 iconv_t icdsc;
3409 char *tocode="UTF-8";
3410 char *fromcode="cp1250";
3411 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3412 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3413 char *iptr=inbuffer;
3414 char *optr=outbuffer;
3415 size_t inleft=numread;
3416 size_t outleft=OUTBUFSIZE;
3417 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3418 != (size_t)(-1)) {
3419 write(1, outbuffer, OUTBUFSIZE - outleft);
3422 if (iconv_close(icdsc) == -1)
3425 return 0;
3428 _iconv=no
3429 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3430 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3431 _iconv=yes && break
3432 done
3434 if test "$_iconv" = yes ; then
3435 def_iconv='#define CONFIG_ICONV 1'
3436 else
3437 def_iconv='#undef CONFIG_ICONV'
3439 echores "$_iconv"
3442 echocheck "soundcard.h"
3443 _soundcard_h=no
3444 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3445 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3446 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3447 cat > $TMPC << EOF
3448 #include <$_soundcard_header>
3449 int main(void) { return 0; }
3451 cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break
3452 done
3454 if test "$_soundcard_h" = yes ; then
3455 if test $_soundcard_header = "sys/soundcard.h"; then
3456 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3457 else
3458 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3461 echores "$_soundcard_h"
3464 echocheck "sys/dvdio.h"
3465 cat > $TMPC << EOF
3466 #include <unistd.h>
3467 #include <sys/dvdio.h>
3468 int main(void) { return 0; }
3470 _dvdio=no
3471 cc_check && _dvdio=yes
3472 if test "$_dvdio" = yes ; then
3473 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3474 else
3475 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3477 echores "$_dvdio"
3480 echocheck "sys/cdio.h"
3481 cat > $TMPC << EOF
3482 #include <unistd.h>
3483 #include <sys/cdio.h>
3484 int main(void) { return 0; }
3486 _cdio=no
3487 cc_check && _cdio=yes
3488 if test "$_cdio" = yes ; then
3489 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3490 else
3491 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3493 echores "$_cdio"
3496 echocheck "linux/cdrom.h"
3497 cat > $TMPC << EOF
3498 #include <sys/types.h>
3499 #include <linux/cdrom.h>
3500 int main(void) { return 0; }
3502 _cdrom=no
3503 cc_check && _cdrom=yes
3504 if test "$_cdrom" = yes ; then
3505 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3506 else
3507 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3509 echores "$_cdrom"
3512 echocheck "dvd.h"
3513 cat > $TMPC << EOF
3514 #include <dvd.h>
3515 int main(void) { return 0; }
3517 _dvd=no
3518 cc_check && _dvd=yes
3519 if test "$_dvd" = yes ; then
3520 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3521 else
3522 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3524 echores "$_dvd"
3527 if bsdos; then
3528 echocheck "BSDI dvd.h"
3529 cat > $TMPC << EOF
3530 #include <dvd.h>
3531 int main(void) { return 0; }
3533 _bsdi_dvd=no
3534 cc_check && _bsdi_dvd=yes
3535 if test "$_bsdi_dvd" = yes ; then
3536 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3537 else
3538 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3540 echores "$_bsdi_dvd"
3541 fi #if bsdos
3544 if hpux; then
3545 # also used by AIX, but AIX does not support VCD and/or libdvdread
3546 echocheck "HP-UX SCSI header"
3547 cat > $TMPC << EOF
3548 #include <sys/scsi.h>
3549 int main(void) { return 0; }
3551 _hpux_scsi_h=no
3552 cc_check && _hpux_scsi_h=yes
3553 if test "$_hpux_scsi_h" = yes ; then
3554 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3555 else
3556 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3558 echores "$_hpux_scsi_h"
3559 fi #if hpux
3562 if sunos; then
3563 echocheck "userspace SCSI headers (Solaris)"
3564 cat > $TMPC << EOF
3565 #include <unistd.h>
3566 #include <stropts.h>
3567 #include <sys/scsi/scsi_types.h>
3568 #include <sys/scsi/impl/uscsi.h>
3569 int main(void) { return 0; }
3571 _sol_scsi_h=no
3572 cc_check && _sol_scsi_h=yes
3573 if test "$_sol_scsi_h" = yes ; then
3574 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3575 else
3576 def_sol_scsi_h='#undef SOLARIS_USCSI'
3578 echores "$_sol_scsi_h"
3579 fi #if sunos
3582 echocheck "termcap"
3583 if test "$_termcap" = auto ; then
3584 cat > $TMPC <<EOF
3585 #include <stddef.h>
3586 #include <term.h>
3587 int main(void) { tgetent(NULL, NULL); return 0; }
3589 _termcap=no
3590 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3591 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3592 && _termcap=yes && break
3593 done
3595 if test "$_termcap" = yes ; then
3596 def_termcap='#define HAVE_TERMCAP 1'
3597 test $_ld_tmp && _res_comment="using $_ld_tmp"
3598 else
3599 def_termcap='#undef HAVE_TERMCAP'
3601 echores "$_termcap"
3604 echocheck "termios"
3605 def_termios='#undef HAVE_TERMIOS'
3606 def_termios_h='#undef HAVE_TERMIOS_H'
3607 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3608 if test "$_termios" = auto ; then
3609 _termios=no
3610 for _termios_header in "sys/termios.h" "termios.h"; do
3611 cat > $TMPC <<EOF
3612 #include <$_termios_header>
3613 int main(void) { return 0; }
3615 cc_check && _termios=yes && _res_comment="using $_termios_header" && break
3616 done
3619 if test "$_termios" = yes ; then
3620 def_termios='#define HAVE_TERMIOS 1'
3621 if test "$_termios_header" = "termios.h" ; then
3622 def_termios_h='#define HAVE_TERMIOS_H 1'
3623 else
3624 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3627 echores "$_termios"
3630 echocheck "shm"
3631 if test "$_shm" = auto ; then
3632 cat > $TMPC << EOF
3633 #include <sys/types.h>
3634 #include <sys/shm.h>
3635 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3637 _shm=no
3638 cc_check && _shm=yes
3640 if test "$_shm" = yes ; then
3641 def_shm='#define HAVE_SHM 1'
3642 else
3643 def_shm='#undef HAVE_SHM'
3645 echores "$_shm"
3648 echocheck "strsep()"
3649 cat > $TMPC << EOF
3650 #include <string.h>
3651 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3653 _strsep=no
3654 cc_check && _strsep=yes
3655 if test "$_strsep" = yes ; then
3656 def_strsep='#define HAVE_STRSEP 1'
3657 _need_strsep=no
3658 else
3659 def_strsep='#undef HAVE_STRSEP'
3660 _need_strsep=yes
3662 echores "$_strsep"
3665 echocheck "vsscanf()"
3666 cat > $TMPC << EOF
3667 #define _ISOC99_SOURCE
3668 #include <stdarg.h>
3669 #include <stdio.h>
3670 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3672 _vsscanf=no
3673 cc_check && _vsscanf=yes
3674 if test "$_vsscanf" = yes ; then
3675 def_vsscanf='#define HAVE_VSSCANF 1'
3676 _need_vsscanf=no
3677 else
3678 def_vsscanf='#undef HAVE_VSSCANF'
3679 _need_vsscanf=yes
3681 echores "$_vsscanf"
3684 echocheck "swab()"
3685 cat > $TMPC << EOF
3686 #define _XOPEN_SOURCE 600
3687 #include <unistd.h>
3688 int main(void) { swab(0, 0, 0); return 0; }
3690 _swab=no
3691 cc_check && _swab=yes
3692 if test "$_swab" = yes ; then
3693 def_swab='#define HAVE_SWAB 1'
3694 _need_swab=no
3695 else
3696 def_swab='#undef HAVE_SWAB'
3697 _need_swab=yes
3699 echores "$_swab"
3701 echocheck "POSIX select()"
3702 cat > $TMPC << EOF
3703 #include <stdio.h>
3704 #include <stdlib.h>
3705 #include <sys/types.h>
3706 #include <string.h>
3707 #include <sys/time.h>
3708 #include <unistd.h>
3709 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3711 _posix_select=no
3712 def_posix_select='#undef HAVE_POSIX_SELECT'
3713 #select() of kLIBC (OS/2) supports socket only
3714 ! os2 && cc_check && _posix_select=yes \
3715 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3716 echores "$_posix_select"
3719 echocheck "audio select()"
3720 if test "$_select" = no ; then
3721 def_select='#undef HAVE_AUDIO_SELECT'
3722 elif test "$_select" = yes ; then
3723 def_select='#define HAVE_AUDIO_SELECT 1'
3725 echores "$_select"
3728 echocheck "gettimeofday()"
3729 cat > $TMPC << EOF
3730 #include <stdio.h>
3731 #include <sys/time.h>
3732 int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; }
3734 _gettimeofday=no
3735 cc_check && _gettimeofday=yes
3736 if test "$_gettimeofday" = yes ; then
3737 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3738 _need_gettimeofday=no
3739 else
3740 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3741 _need_gettimeofday=yes
3743 echores "$_gettimeofday"
3746 echocheck "glob()"
3747 cat > $TMPC << EOF
3748 #include <stdio.h>
3749 #include <glob.h>
3750 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3752 _glob=no
3753 cc_check && _glob=yes
3754 if test "$_glob" = yes ; then
3755 def_glob='#define HAVE_GLOB 1'
3756 _need_glob=no
3757 else
3758 def_glob='#undef HAVE_GLOB'
3759 _need_glob=yes
3761 echores "$_glob"
3764 echocheck "setenv()"
3765 cat > $TMPC << EOF
3766 #include <stdlib.h>
3767 int main(void) { setenv("","",0); return 0; }
3769 _setenv=no
3770 cc_check && _setenv=yes
3771 if test "$_setenv" = yes ; then
3772 def_setenv='#define HAVE_SETENV 1'
3773 _need_setenv=no
3774 else
3775 def_setenv='#undef HAVE_SETENV'
3776 _need_setenv=yes
3778 echores "$_setenv"
3781 if sunos; then
3782 echocheck "sysi86()"
3783 cat > $TMPC << EOF
3784 #include <sys/sysi86.h>
3785 int main(void) { sysi86(0); return 0; }
3787 _sysi86=no
3788 cc_check && _sysi86=yes
3789 if test "$_sysi86" = yes ; then
3790 def_sysi86='#define HAVE_SYSI86 1'
3791 cat > $TMPC << EOF
3792 #include <sys/sysi86.h>
3793 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3795 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3796 else
3797 def_sysi86='#undef HAVE_SYSI86'
3799 echores "$_sysi86"
3800 fi #if sunos
3803 echocheck "sys/sysinfo.h"
3804 cat > $TMPC << EOF
3805 #include <sys/sysinfo.h>
3806 int main(void) {
3807 struct sysinfo s_info;
3808 sysinfo(&s_info);
3809 return 0;
3812 _sys_sysinfo=no
3813 cc_check && _sys_sysinfo=yes
3814 if test "$_sys_sysinfo" = yes ; then
3815 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3816 else
3817 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3819 echores "$_sys_sysinfo"
3822 if darwin; then
3824 echocheck "Mac OS X Finder Support"
3825 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3826 if test "$_macosx_finder" = yes ; then
3827 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3828 extra_ldflags="$extra_ldflags -framework Carbon"
3830 echores "$_macosx_finder"
3832 echocheck "Mac OS X Bundle file locations"
3833 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3834 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3835 if test "$_macosx_bundle" = yes ; then
3836 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3837 extra_ldflags="$extra_ldflags -framework Carbon"
3839 echores "$_macosx_bundle"
3841 echocheck "Apple Remote"
3842 if test "$_apple_remote" = auto ; then
3843 _apple_remote=no
3844 cat > $TMPC <<EOF
3845 #include <stdio.h>
3846 #include <IOKit/IOCFPlugIn.h>
3847 int main(void) {
3848 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3849 CFMutableDictionaryRef hidMatchDictionary;
3850 IOReturn ioReturnValue;
3852 // Set up a matching dictionary to search the I/O Registry by class.
3853 // name for all HID class devices
3854 hidMatchDictionary = IOServiceMatching("AppleIRController");
3856 // Now search I/O Registry for matching devices.
3857 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3858 hidMatchDictionary, &hidObjectIterator);
3860 // If search is unsuccessful, return nonzero.
3861 if (ioReturnValue != kIOReturnSuccess ||
3862 !IOIteratorIsValid(hidObjectIterator)) {
3863 return 1;
3865 return 0;
3868 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3870 if test "$_apple_remote" = yes ; then
3871 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3872 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3873 else
3874 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3876 echores "$_apple_remote"
3878 fi #if darwin
3880 if linux; then
3882 echocheck "Apple IR"
3883 if test "$_apple_ir" = auto ; then
3884 _apple_ir=no
3885 cat > $TMPC <<EOF
3886 #include <linux/types.h>
3887 #include <linux/input.h>
3888 int main(void) {
3889 struct input_event ev;
3890 struct input_id id;
3891 return 0;
3894 cc_check && _apple_ir=yes
3896 if test "$_apple_ir" = yes ; then
3897 def_apple_ir='#define CONFIG_APPLE_IR 1'
3898 else
3899 def_apple_ir='#undef CONFIG_APPLE_IR'
3901 echores "$_apple_ir"
3902 fi #if linux
3904 echocheck "pkg-config"
3905 _pkg_config=pkg-config
3906 if $($_pkg_config --version > /dev/null 2>&1); then
3907 if test "$_ld_static"; then
3908 _pkg_config="$_pkg_config --static"
3910 echores "yes"
3911 else
3912 _pkg_config=false
3913 echores "no"
3917 echocheck "Samba support (libsmbclient)"
3918 if test "$_smb" = yes; then
3919 extra_ldflags="$extra_ldflags -lsmbclient"
3921 if test "$_smb" = auto; then
3922 _smb=no
3923 cat > $TMPC << EOF
3924 #include <libsmbclient.h>
3925 int main(void) { smbc_opendir("smb://"); return 0; }
3927 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3928 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3929 _smb=yes && break
3930 done
3933 if test "$_smb" = yes; then
3934 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3935 _inputmodules="smb $_inputmodules"
3936 else
3937 def_smb="#undef CONFIG_LIBSMBCLIENT"
3938 _noinputmodules="smb $_noinputmodules"
3940 echores "$_smb"
3943 #########
3944 # VIDEO #
3945 #########
3948 echocheck "tdfxfb"
3949 if test "$_tdfxfb" = yes ; then
3950 def_tdfxfb='#define CONFIG_TDFXFB 1'
3951 _vomodules="tdfxfb $_vomodules"
3952 else
3953 def_tdfxfb='#undef CONFIG_TDFXFB'
3954 _novomodules="tdfxfb $_novomodules"
3956 echores "$_tdfxfb"
3958 echocheck "s3fb"
3959 if test "$_s3fb" = yes ; then
3960 def_s3fb='#define CONFIG_S3FB 1'
3961 _vomodules="s3fb $_vomodules"
3962 else
3963 def_s3fb='#undef CONFIG_S3FB'
3964 _novomodules="s3fb $_novomodules"
3966 echores "$_s3fb"
3968 echocheck "wii"
3969 if test "$_wii" = yes ; then
3970 def_wii='#define CONFIG_WII 1'
3971 _vomodules="wii $_vomodules"
3972 else
3973 def_wii='#undef CONFIG_WII'
3974 _novomodules="wii $_novomodules"
3976 echores "$_wii"
3978 echocheck "tdfxvid"
3979 if test "$_tdfxvid" = yes ; then
3980 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3981 _vomodules="tdfx_vid $_vomodules"
3982 else
3983 def_tdfxvid='#undef CONFIG_TDFX_VID'
3984 _novomodules="tdfx_vid $_novomodules"
3986 echores "$_tdfxvid"
3988 echocheck "xvr100"
3989 if test "$_xvr100" = auto ; then
3990 cat > $TMPC << EOF
3991 #include <unistd.h>
3992 #include <sys/fbio.h>
3993 #include <sys/visual_io.h>
3994 int main(void) {
3995 struct vis_identifier ident;
3996 struct fbgattr attr;
3997 ioctl(0, VIS_GETIDENTIFIER, &ident);
3998 ioctl(0, FBIOGATTR, &attr);
3999 return 0;
4002 _xvr100=no
4003 cc_check && _xvr100=yes
4005 if test "$_xvr100" = yes ; then
4006 def_xvr100='#define CONFIG_XVR100 1'
4007 _vomodules="xvr100 $_vomodules"
4008 else
4009 def_tdfxvid='#undef CONFIG_XVR100'
4010 _novomodules="xvr100 $_novomodules"
4012 echores "$_xvr100"
4014 echocheck "tga"
4015 if test "$_tga" = yes ; then
4016 def_tga='#define CONFIG_TGA 1'
4017 _vomodules="tga $_vomodules"
4018 else
4019 def_tga='#undef CONFIG_TGA'
4020 _novomodules="tga $_novomodules"
4022 echores "$_tga"
4025 echocheck "md5sum support"
4026 if test "$_md5sum" = yes; then
4027 def_md5sum="#define CONFIG_MD5SUM 1"
4028 _vomodules="md5sum $_vomodules"
4029 else
4030 def_md5sum="#undef CONFIG_MD5SUM"
4031 _novomodules="md5sum $_novomodules"
4033 echores "$_md5sum"
4036 echocheck "yuv4mpeg support"
4037 if test "$_yuv4mpeg" = yes; then
4038 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4039 _vomodules="yuv4mpeg $_vomodules"
4040 else
4041 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4042 _novomodules="yuv4mpeg $_novomodules"
4044 echores "$_yuv4mpeg"
4047 echocheck "bl"
4048 if test "$_bl" = yes ; then
4049 def_bl='#define CONFIG_BL 1'
4050 _vomodules="bl $_vomodules"
4051 else
4052 def_bl='#undef CONFIG_BL'
4053 _novomodules="bl $_novomodules"
4055 echores "$_bl"
4058 echocheck "DirectFB"
4059 if test "$_directfb" = auto ; then
4060 _directfb=no
4061 cat > $TMPC <<EOF
4062 #include <directfb.h>
4063 int main(void) { DirectFBInit(0, 0); return 0; }
4065 for _inc_tmp in "" -I/usr/local/include/directfb \
4066 -I/usr/include/directfb -I/usr/local/include; do
4067 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4068 extra_cflags="$extra_cflags $_inc_tmp" && break
4069 done
4072 dfb_version() {
4073 expr $1 \* 65536 + $2 \* 256 + $3
4076 if test "$_directfb" = yes; then
4077 cat > $TMPC << EOF
4078 #include <directfb_version.h>
4080 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4083 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4084 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4085 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4086 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4087 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4088 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4089 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4090 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4091 _res_comment="$_directfb_version"
4092 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4093 else
4094 def_directfb_version='#undef DIRECTFBVERSION'
4095 _directfb=no
4096 _res_comment="version >=0.9.13 required"
4098 else
4099 _directfb=no
4100 _res_comment="failed to get version"
4103 echores "$_directfb"
4105 if test "$_directfb" = yes ; then
4106 def_directfb='#define CONFIG_DIRECTFB 1'
4107 _vomodules="directfb $_vomodules"
4108 libs_mplayer="$libs_mplayer -ldirectfb"
4109 else
4110 def_directfb='#undef CONFIG_DIRECTFB'
4111 _novomodules="directfb $_novomodules"
4113 if test "$_dfbmga" = yes; then
4114 _vomodules="dfbmga $_vomodules"
4115 def_dfbmga='#define CONFIG_DFBMGA 1'
4116 else
4117 _novomodules="dfbmga $_novomodules"
4118 def_dfbmga='#undef CONFIG_DFBMGA'
4122 echocheck "X11 headers presence"
4123 _x11_headers="no"
4124 _res_comment="check if the dev(el) packages are installed"
4125 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4126 if test -f "$I/X11/Xlib.h" ; then
4127 _x11_headers="yes"
4128 _res_comment=""
4129 break
4131 done
4132 if test $_cross_compile = no; then
4133 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4134 /usr/include/X11R6 /usr/openwin/include ; do
4135 if test -f "$I/X11/Xlib.h" ; then
4136 extra_cflags="$extra_cflags -I$I"
4137 _x11_headers="yes"
4138 _res_comment="using $I"
4139 break
4141 done
4143 echores "$_x11_headers"
4146 echocheck "X11"
4147 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4148 cat > $TMPC <<EOF
4149 #include <X11/Xlib.h>
4150 #include <X11/Xutil.h>
4151 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4153 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4154 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4155 -L/usr/lib ; do
4156 if netbsd; then
4157 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4158 else
4159 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4161 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4162 && _x11=yes && break
4163 done
4165 if test "$_x11" = yes ; then
4166 def_x11='#define CONFIG_X11 1'
4167 _vomodules="x11 xover $_vomodules"
4168 else
4169 _x11=no
4170 def_x11='#undef CONFIG_X11'
4171 _novomodules="x11 $_novomodules"
4172 _res_comment="check if the dev(el) packages are installed"
4173 # disable stuff that depends on X
4174 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4176 echores "$_x11"
4178 echocheck "Xss screensaver extensions"
4179 if test "$_xss" = auto ; then
4180 cat > $TMPC << EOF
4181 #include <X11/Xlib.h>
4182 #include <X11/extensions/scrnsaver.h>
4183 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4185 _xss=no
4186 cc_check -lXss && _xss=yes
4188 if test "$_xss" = yes ; then
4189 def_xss='#define CONFIG_XSS 1'
4190 libs_mplayer="$libs_mplayer -lXss"
4191 else
4192 def_xss='#undef CONFIG_XSS'
4194 echores "$_xss"
4196 echocheck "DPMS"
4197 _xdpms3=no
4198 _xdpms4=no
4199 if test "$_x11" = yes ; then
4200 cat > $TMPC <<EOF
4201 #include <X11/Xmd.h>
4202 #include <X11/Xlib.h>
4203 #include <X11/Xutil.h>
4204 #include <X11/Xatom.h>
4205 #include <X11/extensions/dpms.h>
4206 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4208 cc_check -lXdpms && _xdpms3=yes
4209 cat > $TMPC <<EOF
4210 #include <X11/Xlib.h>
4211 #include <X11/extensions/dpms.h>
4212 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4214 cc_check -lXext && _xdpms4=yes
4216 if test "$_xdpms4" = yes ; then
4217 def_xdpms='#define CONFIG_XDPMS 1'
4218 _res_comment="using Xdpms 4"
4219 echores "yes"
4220 elif test "$_xdpms3" = yes ; then
4221 def_xdpms='#define CONFIG_XDPMS 1'
4222 libs_mplayer="$libs_mplayer -lXdpms"
4223 _res_comment="using Xdpms 3"
4224 echores "yes"
4225 else
4226 def_xdpms='#undef CONFIG_XDPMS'
4227 echores "no"
4231 echocheck "Xv"
4232 if test "$_xv" = auto ; then
4233 cat > $TMPC <<EOF
4234 #include <X11/Xlib.h>
4235 #include <X11/extensions/Xvlib.h>
4236 int main(void) {
4237 (void) XvGetPortAttribute(0, 0, 0, 0);
4238 (void) XvQueryPortAttributes(0, 0, 0);
4239 return 0; }
4241 _xv=no
4242 cc_check -lXv && _xv=yes
4245 if test "$_xv" = yes ; then
4246 def_xv='#define CONFIG_XV 1'
4247 libs_mplayer="$libs_mplayer -lXv"
4248 _vomodules="xv $_vomodules"
4249 else
4250 def_xv='#undef CONFIG_XV'
4251 _novomodules="xv $_novomodules"
4253 echores "$_xv"
4256 echocheck "XvMC"
4257 if test "$_xv" = yes && test "$_xvmc" != no ; then
4258 _xvmc=no
4259 cat > $TMPC <<EOF
4260 #include <X11/Xlib.h>
4261 #include <X11/extensions/Xvlib.h>
4262 #include <X11/extensions/XvMClib.h>
4263 int main(void) {
4264 (void) XvMCQueryExtension(0,0,0);
4265 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4266 return 0; }
4268 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4269 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4270 done
4272 if test "$_xvmc" = yes ; then
4273 def_xvmc='#define CONFIG_XVMC 1'
4274 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4275 _vomodules="xvmc $_vomodules"
4276 _res_comment="using $_xvmclib"
4277 else
4278 def_xvmc='#define CONFIG_XVMC 0'
4279 _novomodules="xvmc $_novomodules"
4281 echores "$_xvmc"
4284 echocheck "VDPAU"
4285 if test "$_vdpau" = auto ; then
4286 _vdpau=no
4287 if test "$_dl" = yes ; then
4288 cat > $TMPC <<EOF
4289 #include <vdpau/vdpau_x11.h>
4290 int main(void) {return VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE;}
4292 cc_check && _vdpau=yes
4295 if test "$_vdpau" = yes ; then
4296 def_vdpau='#define CONFIG_VDPAU 1'
4297 _vomodules="vdpau $_vomodules"
4298 else
4299 def_vdpau='#define CONFIG_VDPAU 0'
4300 _novomodules="vdpau $_novomodules"
4302 echores "$_vdpau"
4305 echocheck "Xinerama"
4306 if test "$_xinerama" = auto ; then
4307 cat > $TMPC <<EOF
4308 #include <X11/Xlib.h>
4309 #include <X11/extensions/Xinerama.h>
4310 int main(void) { (void) XineramaIsActive(0); return 0; }
4312 _xinerama=no
4313 cc_check -lXinerama && _xinerama=yes
4316 if test "$_xinerama" = yes ; then
4317 def_xinerama='#define CONFIG_XINERAMA 1'
4318 libs_mplayer="$libs_mplayer -lXinerama"
4319 else
4320 def_xinerama='#undef CONFIG_XINERAMA'
4322 echores "$_xinerama"
4325 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4326 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4327 # named 'X extensions' or something similar.
4328 # This check may be useful for future mplayer versions (to change resolution)
4329 # If you run into problems, remove '-lXxf86vm'.
4330 echocheck "Xxf86vm"
4331 if test "$_vm" = auto ; then
4332 cat > $TMPC <<EOF
4333 #include <X11/Xlib.h>
4334 #include <X11/extensions/xf86vmode.h>
4335 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4337 _vm=no
4338 cc_check -lXxf86vm && _vm=yes
4340 if test "$_vm" = yes ; then
4341 def_vm='#define CONFIG_XF86VM 1'
4342 libs_mplayer="$libs_mplayer -lXxf86vm"
4343 else
4344 def_vm='#undef CONFIG_XF86VM'
4346 echores "$_vm"
4348 # Check for the presence of special keycodes, like audio control buttons
4349 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4350 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4351 # have these new keycodes.
4352 echocheck "XF86keysym"
4353 if test "$_xf86keysym" = auto; then
4354 _xf86keysym=no
4355 cat > $TMPC <<EOF
4356 #include <X11/Xlib.h>
4357 #include <X11/XF86keysym.h>
4358 int main(void) { return XF86XK_AudioPause; }
4360 cc_check && _xf86keysym=yes
4362 if test "$_xf86keysym" = yes ; then
4363 def_xf86keysym='#define CONFIG_XF86XK 1'
4364 else
4365 def_xf86keysym='#undef CONFIG_XF86XK'
4367 echores "$_xf86keysym"
4369 echocheck "DGA"
4370 if test "$_dga2" = auto && test "$_x11" = yes ; then
4371 cat > $TMPC << EOF
4372 #include <X11/Xlib.h>
4373 #include <X11/extensions/xf86dga.h>
4374 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4376 _dga2=no
4377 cc_check -lXxf86dga && _dga2=yes
4379 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4380 cat > $TMPC << EOF
4381 #include <X11/Xlib.h>
4382 #include <X11/extensions/xf86dga.h>
4383 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4385 _dga1=no
4386 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4389 _dga=no
4390 def_dga='#undef CONFIG_DGA'
4391 def_dga1='#undef CONFIG_DGA1'
4392 def_dga2='#undef CONFIG_DGA2'
4393 if test "$_dga1" = yes ; then
4394 _dga=yes
4395 def_dga1='#define CONFIG_DGA1 1'
4396 _res_comment="using DGA 1.0"
4397 elif test "$_dga2" = yes ; then
4398 _dga=yes
4399 def_dga2='#define CONFIG_DGA2 1'
4400 _res_comment="using DGA 2.0"
4402 if test "$_dga" = yes ; then
4403 def_dga='#define CONFIG_DGA 1'
4404 libs_mplayer="$libs_mplayer -lXxf86dga"
4405 _vomodules="dga $_vomodules"
4406 else
4407 _novomodules="dga $_novomodules"
4409 echores "$_dga"
4412 echocheck "3dfx"
4413 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4414 def_3dfx='#define CONFIG_3DFX 1'
4415 _vomodules="3dfx $_vomodules"
4416 else
4417 def_3dfx='#undef CONFIG_3DFX'
4418 _novomodules="3dfx $_novomodules"
4420 echores "$_3dfx"
4423 echocheck "VIDIX"
4424 def_vidix='#undef CONFIG_VIDIX'
4425 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4426 _vidix_drv_cyberblade=no
4427 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4428 _vidix_drv_ivtv=no
4429 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4430 _vidix_drv_mach64=no
4431 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4432 _vidix_drv_mga=no
4433 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4434 _vidix_drv_mga_crtc2=no
4435 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4436 _vidix_drv_nvidia=no
4437 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4438 _vidix_drv_pm2=no
4439 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4440 _vidix_drv_pm3=no
4441 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4442 _vidix_drv_radeon=no
4443 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4444 _vidix_drv_rage128=no
4445 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4446 _vidix_drv_s3=no
4447 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4448 _vidix_drv_sh_veu=no
4449 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4450 _vidix_drv_sis=no
4451 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4452 _vidix_drv_unichrome=no
4453 if test "$_vidix" = auto ; then
4454 _vidix=no
4455 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4456 && _vidix=yes
4457 x86_64 && win32 && _vidix=no
4458 (ppc || alpha) && linux && _vidix=yes
4460 echores "$_vidix"
4462 if test "$_vidix" = yes ; then
4463 def_vidix='#define CONFIG_VIDIX 1'
4464 _vomodules="cvidix $_vomodules"
4465 # FIXME: ivtv driver temporarily disabled until we have a proper test
4466 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4467 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4469 # some vidix drivers are architecture and os specific, discard them elsewhere
4470 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4471 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4473 for driver in $_vidix_drivers ; do
4474 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4475 eval _vidix_drv_${driver}=yes
4476 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4477 done
4479 echocheck "VIDIX PCI device name database"
4480 echores "$_vidix_pcidb"
4481 if test "$_vidix_pcidb" = yes ; then
4482 _vidix_pcidb_val=1
4483 else
4484 _vidix_pcidb_val=0
4487 echocheck "VIDIX dhahelper support"
4488 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4489 echores "$_dhahelper"
4491 echocheck "VIDIX svgalib_helper support"
4492 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4493 echores "$_svgalib_helper"
4495 else
4496 _novomodules="cvidix $_novomodules"
4499 if test "$_vidix" = yes && win32; then
4500 winvidix=yes
4501 _vomodules="winvidix $_vomodules"
4502 libs_mplayer="$libs_mplayer -lgdi32"
4503 else
4504 _novomodules="winvidix $_novomodules"
4506 if test "$_vidix" = yes && test "$_x11" = yes; then
4507 xvidix=yes
4508 _vomodules="xvidix $_vomodules"
4509 else
4510 _novomodules="xvidix $_novomodules"
4513 echocheck "GGI"
4514 if test "$_ggi" = auto ; then
4515 cat > $TMPC << EOF
4516 #include <ggi/ggi.h>
4517 int main(void) { ggiInit(); return 0; }
4519 _ggi=no
4520 cc_check -lggi && _ggi=yes
4522 if test "$_ggi" = yes ; then
4523 def_ggi='#define CONFIG_GGI 1'
4524 libs_mplayer="$libs_mplayer -lggi"
4525 _vomodules="ggi $_vomodules"
4526 else
4527 def_ggi='#undef CONFIG_GGI'
4528 _novomodules="ggi $_novomodules"
4530 echores "$_ggi"
4532 echocheck "GGI extension: libggiwmh"
4533 if test "$_ggiwmh" = auto ; then
4534 _ggiwmh=no
4535 cat > $TMPC << EOF
4536 #include <ggi/ggi.h>
4537 #include <ggi/wmh.h>
4538 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4540 cc_check -lggi -lggiwmh && _ggiwmh=yes
4542 # needed to get right output on obscure combination
4543 # like --disable-ggi --enable-ggiwmh
4544 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4545 def_ggiwmh='#define CONFIG_GGIWMH 1'
4546 libs_mplayer="$libs_mplayer -lggiwmh"
4547 else
4548 _ggiwmh=no
4549 def_ggiwmh='#undef CONFIG_GGIWMH'
4551 echores "$_ggiwmh"
4554 echocheck "AA"
4555 if test "$_aa" = auto ; then
4556 cat > $TMPC << EOF
4557 #include <aalib.h>
4558 extern struct aa_hardware_params aa_defparams;
4559 extern struct aa_renderparams aa_defrenderparams;
4560 int main(void) {
4561 aa_context *c;
4562 aa_renderparams *p;
4563 (void) aa_init(0, 0, 0);
4564 c = aa_autoinit(&aa_defparams);
4565 p = aa_getrenderparams();
4566 aa_autoinitkbd(c,0);
4567 return 0; }
4569 _aa=no
4570 for _ld_tmp in "-laa" ; do
4571 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4572 done
4574 if test "$_aa" = yes ; then
4575 def_aa='#define CONFIG_AA 1'
4576 if cygwin ; then
4577 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4579 _vomodules="aa $_vomodules"
4580 else
4581 def_aa='#undef CONFIG_AA'
4582 _novomodules="aa $_novomodules"
4584 echores "$_aa"
4587 echocheck "CACA"
4588 if test "$_caca" = auto ; then
4589 _caca=no
4590 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4591 cat > $TMPC << EOF
4592 #include <caca.h>
4593 #ifdef CACA_API_VERSION_1
4594 #include <caca0.h>
4595 #endif
4596 int main(void) { (void) caca_init(); return 0; }
4598 cc_check $(caca-config --libs) && _caca=yes
4601 if test "$_caca" = yes ; then
4602 def_caca='#define CONFIG_CACA 1'
4603 extra_cflags="$extra_cflags $(caca-config --cflags)"
4604 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4605 _vomodules="caca $_vomodules"
4606 else
4607 def_caca='#undef CONFIG_CACA'
4608 _novomodules="caca $_novomodules"
4610 echores "$_caca"
4613 echocheck "SVGAlib"
4614 if test "$_svga" = auto ; then
4615 cat > $TMPC << EOF
4616 #include <vga.h>
4617 int main(void) { return 0; }
4619 _svga=no
4620 cc_check -lvga $_ld_lm && _svga=yes
4622 if test "$_svga" = yes ; then
4623 def_svga='#define CONFIG_SVGALIB 1'
4624 libs_mplayer="$libs_mplayer -lvga"
4625 _vomodules="svga $_vomodules"
4626 else
4627 def_svga='#undef CONFIG_SVGALIB'
4628 _novomodules="svga $_novomodules"
4630 echores "$_svga"
4633 echocheck "FBDev"
4634 if test "$_fbdev" = auto ; then
4635 _fbdev=no
4636 linux && _fbdev=yes
4638 if test "$_fbdev" = yes ; then
4639 def_fbdev='#define CONFIG_FBDEV 1'
4640 _vomodules="fbdev $_vomodules"
4641 else
4642 def_fbdev='#undef CONFIG_FBDEV'
4643 _novomodules="fbdev $_novomodules"
4645 echores "$_fbdev"
4649 echocheck "DVB"
4650 if test "$_dvb" = auto ; then
4651 _dvb=no
4652 cat >$TMPC << EOF
4653 #include <poll.h>
4654 #include <sys/ioctl.h>
4655 #include <stdio.h>
4656 #include <time.h>
4657 #include <unistd.h>
4658 #include <ost/dmx.h>
4659 #include <ost/frontend.h>
4660 #include <ost/sec.h>
4661 #include <ost/video.h>
4662 #include <ost/audio.h>
4663 int main(void) {return 0;}
4665 for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
4666 cc_check $_inc_tmp && _dvb=yes && \
4667 extra_cflags="$extra_cflags $_inc_tmp" && break
4668 done
4670 echores "$_dvb"
4671 if test "$_dvb" = yes ; then
4672 def_dvb='#define CONFIG_DVB 1'
4673 def_dvbin='#define CONFIG_DVBIN 1'
4674 _aomodules="mpegpes(dvb) $_aomodules"
4675 _vomodules="mpegpes(dvb) $_vomodules"
4678 echocheck "DVB HEAD"
4679 if test "$_dvbhead" = auto ; then
4680 _dvbhead=no
4682 cat >$TMPC << EOF
4683 #include <poll.h>
4684 #include <sys/ioctl.h>
4685 #include <stdio.h>
4686 #include <time.h>
4687 #include <unistd.h>
4688 #include <linux/dvb/dmx.h>
4689 #include <linux/dvb/frontend.h>
4690 #include <linux/dvb/video.h>
4691 #include <linux/dvb/audio.h>
4692 int main(void) {return 0;}
4694 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4695 cc_check $_inc_tmp && _dvbhead=yes && \
4696 extra_cflags="$extra_cflags $_inc_tmp" && break
4697 done
4699 echores "$_dvbhead"
4700 if test "$_dvbhead" = yes ; then
4701 def_dvb='#define CONFIG_DVB 1'
4702 def_dvb_head='#define CONFIG_DVB_HEAD 1'
4703 def_dvbin='#define CONFIG_DVBIN 1'
4704 _aomodules="mpegpes(dvb) $_aomodules"
4705 _vomodules="mpegpes(dvb) $_vomodules"
4708 if test "$_dvbhead" = no && test "$_dvb" = no ; then
4709 def_dvb='#undef CONFIG_DVB'
4710 def_dvb_head='#undef CONFIG_DVB_HEAD'
4711 def_dvbin='#undef CONFIG_DVBIN '
4712 _aomodules="mpegpes(file) $_aomodules"
4713 _vomodules="mpegpes(file) $_vomodules"
4716 if test "$_dvb" = yes || test "$_dvbhead" = yes ; then
4717 _dvbin=yes
4718 _inputmodules="dvb $_inputmodules"
4719 else
4720 _dvbin=no
4721 _noinputmodules="dvb $_noinputmodules"
4725 if darwin; then
4727 echocheck "QuickTime"
4728 if test "$quicktime" = auto ; then
4729 cat > $TMPC <<EOF
4730 #include <QuickTime/QuickTime.h>
4731 int main(void) {
4732 ImageDescription *desc;
4733 EnterMovies();
4734 ExitMovies();
4735 return 0;
4738 quicktime=no
4739 cc_check -framework QuickTime && quicktime=yes
4741 if test "$quicktime" = yes ; then
4742 extra_ldflags="$extra_ldflags -framework QuickTime"
4743 def_quicktime='#define CONFIG_QUICKTIME 1'
4744 else
4745 def_quicktime='#undef CONFIG_QUICKTIME'
4746 _quartz=no
4748 echores $quicktime
4750 echocheck "Quartz"
4751 if test "$_quartz" = auto ; then
4752 cat > $TMPC <<EOF
4753 #include <Carbon/Carbon.h>
4754 int main(void) {
4755 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
4756 return 0;
4759 _quartz=no
4760 cc_check -framework Carbon && _quartz=yes
4762 if test "$_quartz" = yes ; then
4763 libs_mplayer="$libs_mplayer -framework Carbon"
4764 def_quartz='#define CONFIG_QUARTZ 1'
4765 _vomodules="quartz $_vomodules"
4766 else
4767 def_quartz='#undef CONFIG_QUARTZ'
4768 _novomodules="quartz $_novomodules"
4770 echores $_quartz
4772 echocheck "CoreVideo"
4773 if test "$_corevideo" = auto ; then
4774 cat > $TMPC <<EOF
4775 #include <Carbon/Carbon.h>
4776 #include <CoreServices/CoreServices.h>
4777 #include <OpenGL/OpenGL.h>
4778 #include <QuartzCore/CoreVideo.h>
4779 int main(void) { return 0; }
4781 _corevideo=no
4782 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4784 if test "$_corevideo" = yes ; then
4785 _vomodules="corevideo $_vomodules"
4786 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4787 def_corevideo='#define CONFIG_COREVIDEO 1'
4788 else
4789 _novomodules="corevideo $_novomodules"
4790 def_corevideo='#undef CONFIG_COREVIDEO'
4792 echores "$_corevideo"
4794 fi #if darwin
4797 # make sure this stays below CoreVideo to avoid issues due to namespace
4798 # conflicts between -lGL and -framework OpenGL
4799 echocheck "OpenGL"
4800 #Note: this test is run even with --enable-gl since we autodetect linker flags
4801 if (test "$_x11" = yes || win32) && test "$_gl" != no ; then
4802 cat > $TMPC << EOF
4803 #ifdef GL_WIN32
4804 #include <windows.h>
4805 #include <GL/gl.h>
4806 #else
4807 #include <GL/gl.h>
4808 #include <X11/Xlib.h>
4809 #include <GL/glx.h>
4810 #endif
4811 int main(void) {
4812 #ifdef GL_WIN32
4813 HDC dc;
4814 wglCreateContext(dc);
4815 #else
4816 glXCreateContext(NULL, NULL, NULL, True);
4817 #endif
4818 glFinish();
4819 return 0;
4822 _gl=no
4823 for _ld_tmp in -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4824 if cc_check $_ld_tmp $_ld_lm ; then
4825 _gl=yes
4826 _gl_x11=yes
4827 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4828 break
4830 done
4831 if cc_check -DGL_WIN32 -lopengl32 ; then
4832 _gl=yes
4833 _gl_win32=yes
4834 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4836 else
4837 _gl=no
4839 if test "$_gl" = yes ; then
4840 def_gl='#define CONFIG_GL 1'
4841 _res_comment="backends:"
4842 if test "$_gl_win32" = yes ; then
4843 def_gl_win32='#define CONFIG_GL_WIN32 1'
4844 _res_comment="$_res_comment win32"
4846 if test "$_gl_x11" = yes ; then
4847 def_gl_x11='#define CONFIG_GL_X11 1'
4848 _res_comment="$_res_comment x11"
4850 _vomodules="opengl $_vomodules"
4851 else
4852 def_gl='#undef CONFIG_GL'
4853 def_gl_win32='#undef CONFIG_GL_WIN32'
4854 def_gl_x11='#undef CONFIG_GL_X11'
4855 _novomodules="opengl $_novomodules"
4857 echores "$_gl"
4860 echocheck "MatrixView"
4861 if test "$_gl" = no ; then
4862 matrixview=no
4864 if test "$matrixview" = yes ; then
4865 _vomodules="matrixview $_vomodules"
4866 def_matrixview='#define CONFIG_MATRIXVIEW 1'
4867 else
4868 _novomodules="matrixview $_novomodules"
4869 def_matrixview='#undef CONFIG_MATRIXVIEW'
4871 echores "$matrixview"
4874 echocheck "PNG support"
4875 if test "$_png" = auto ; then
4876 _png=no
4877 if irix ; then
4878 # Don't check for -lpng on irix since it has its own libpng
4879 # incompatible with the GNU libpng
4880 _res_comment="disabled on irix (not GNU libpng)"
4881 else
4882 cat > $TMPC << EOF
4883 #include <png.h>
4884 #include <string.h>
4885 int main(void) {
4886 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4887 printf("libpng: %s\n", png_libpng_ver);
4888 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4891 cc_check -lpng -lz $_ld_lm && _png=yes
4894 echores "$_png"
4895 if test "$_png" = yes ; then
4896 def_png='#define CONFIG_PNG 1'
4897 extra_ldflags="$extra_ldflags -lpng -lz"
4898 else
4899 def_png='#undef CONFIG_PNG'
4902 echocheck "MNG support"
4903 if test "$_mng" = auto ; then
4904 _mng=no
4905 cat > $TMPC << EOF
4906 #include <libmng.h>
4907 int main(void) {
4908 const char * p_ver = mng_version_text();
4909 return !p_ver || p_ver[0] == 0;
4912 if cc_check -lmng -lz $_ld_lm ; then
4913 _mng=yes
4916 echores "$_mng"
4917 if test "$_mng" = yes ; then
4918 def_mng='#define CONFIG_MNG 1'
4919 extra_ldflags="$extra_ldflags -lmng -lz"
4920 else
4921 def_mng='#undef CONFIG_MNG'
4924 echocheck "JPEG support"
4925 if test "$_jpeg" = auto ; then
4926 _jpeg=no
4927 cat > $TMPC << EOF
4928 #include <stdio.h>
4929 #include <stdlib.h>
4930 #include <setjmp.h>
4931 #include <string.h>
4932 #include <jpeglib.h>
4933 int main(void) { return 0; }
4935 cc_check -ljpeg $_ld_lm && _jpeg=yes
4937 echores "$_jpeg"
4939 if test "$_jpeg" = yes ; then
4940 def_jpeg='#define CONFIG_JPEG 1'
4941 _vomodules="jpeg $_vomodules"
4942 extra_ldflags="$extra_ldflags -ljpeg"
4943 else
4944 def_jpeg='#undef CONFIG_JPEG'
4945 _novomodules="jpeg $_novomodules"
4950 echocheck "PNM support"
4951 if test "$_pnm" = yes; then
4952 def_pnm="#define CONFIG_PNM 1"
4953 _vomodules="pnm $_vomodules"
4954 else
4955 def_pnm="#undef CONFIG_PNM"
4956 _novomodules="pnm $_novomodules"
4958 echores "$_pnm"
4962 echocheck "GIF support"
4963 # This is to appease people who want to force gif support.
4964 # If it is forced to yes, then we still do checks to determine
4965 # which gif library to use.
4966 if test "$_gif" = yes ; then
4967 _force_gif=yes
4968 _gif=auto
4971 if test "$_gif" = auto ; then
4972 _gif=no
4973 cat > $TMPC << EOF
4974 #include <gif_lib.h>
4975 int main(void) { return 0; }
4977 for _ld_gif in "-lungif" "-lgif" ; do
4978 cc_check $_ld_gif && _gif=yes && break
4979 done
4982 # If no library was found, and the user wants support forced,
4983 # then we force it on with libgif, as this is the safest
4984 # assumption IMHO. (libungif & libregif both create symbolic
4985 # links to libgif. We also assume that no x11 support is needed,
4986 # because if you are forcing this, then you _should_ know what
4987 # you are doing. [ Besides, package maintainers should never
4988 # have compiled x11 deps into libungif in the first place. ] )
4989 # </rant>
4990 # --Joey
4991 if test "$_force_gif" = yes && test "$_gif" = no ; then
4992 _gif=yes
4993 _ld_gif="-lgif"
4996 if test "$_gif" = yes ; then
4997 def_gif='#define CONFIG_GIF 1'
4998 _codecmodules="gif $_codecmodules"
4999 _vomodules="gif89a $_vomodules"
5000 _res_comment="old version, some encoding functions disabled"
5001 def_gif_4='#undef CONFIG_GIF_4'
5002 extra_ldflags="$extra_ldflags $_ld_gif"
5004 cat > $TMPC << EOF
5005 #include <signal.h>
5006 #include <gif_lib.h>
5007 void catch() { exit(1); }
5008 int main(void) {
5009 signal(SIGSEGV, catch); // catch segfault
5010 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
5011 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
5012 return 0;
5015 if cc_check "$_ld_gif" ; then
5016 def_gif_4='#define CONFIG_GIF_4 1'
5017 _res_comment=""
5019 else
5020 def_gif='#undef CONFIG_GIF'
5021 def_gif_4='#undef CONFIG_GIF_4'
5022 _novomodules="gif89a $_novomodules"
5023 _nocodecmodules="gif $_nocodecmodules"
5025 echores "$_gif"
5028 case "$_gif" in yes*)
5029 echocheck "broken giflib workaround"
5030 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
5032 cat > $TMPC << EOF
5033 #include <gif_lib.h>
5034 int main(void) {
5035 GifFileType gif;
5036 printf("UserData is at address %p\n", gif.UserData);
5037 return 0;
5040 if cc_check "$_ld_gif" ; then
5041 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
5042 echores "disabled"
5043 else
5044 echores "enabled"
5047 esac
5050 echocheck "VESA support"
5051 if test "$_vesa" = auto ; then
5052 cat > $TMPC << EOF
5053 #include <vbe.h>
5054 int main(void) { vbeVersion(); return 0; }
5056 _vesa=no
5057 cc_check -lvbe -llrmi && _vesa=yes
5059 if test "$_vesa" = yes ; then
5060 def_vesa='#define CONFIG_VESA 1'
5061 libs_mplayer="$libs_mplayer -lvbe -llrmi"
5062 _vomodules="vesa $_vomodules"
5063 else
5064 def_vesa='#undef CONFIG_VESA'
5065 _novomodules="vesa $_novomodules"
5067 echores "$_vesa"
5069 #################
5070 # VIDEO + AUDIO #
5071 #################
5074 echocheck "SDL"
5075 _inc_tmp=""
5076 _ld_tmp=""
5077 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
5078 if test -z "$_sdlconfig" ; then
5079 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
5080 _sdlconfig="sdl-config"
5081 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
5082 _sdlconfig="sdl11-config"
5083 else
5084 _sdlconfig=false
5087 if test "$_sdl" = auto || test "$_sdl" = yes ; then
5088 cat > $TMPC << EOF
5089 #ifdef CONFIG_SDL_SDL_H
5090 #include <SDL/SDL.h>
5091 #else
5092 #include <SDL.h>
5093 #endif
5094 #ifndef __APPLE__
5095 // we allow SDL hacking our main() only on OSX
5096 #undef main
5097 #endif
5098 int main(int argc, char *argv[]) {
5099 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
5100 return 0;
5103 _sdl=no
5104 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" ; do
5105 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
5106 _sdl=yes
5107 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
5108 break
5110 done
5111 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5112 _res_comment="using $_sdlconfig"
5113 if cygwin ; then
5114 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5115 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5116 elif mingw32 ; then
5117 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5118 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5119 else
5120 _inc_tmp="$($_sdlconfig --cflags)"
5121 _ld_tmp="$($_sdlconfig --libs)"
5123 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5124 _sdlversion=$($_sdlconfig --version | sed 's/[^0-9]//g')
5125 if test "$_sdlversion" -gt 116 ; then
5126 if test "$_sdlversion" -lt 121 ; then
5127 def_sdlbuggy='#define BUGGY_SDL'
5128 else
5129 def_sdlbuggy='#undef BUGGY_SDL'
5131 _sdl=yes
5136 if test "$_sdl" = yes ; then
5137 def_sdl='#define CONFIG_SDL 1'
5138 extra_cflags="$extra_cflags $_inc_tmp"
5139 libs_mplayer="$libs_mplayer $_ld_tmp"
5140 _vomodules="sdl $_vomodules"
5141 _aomodules="sdl $_aomodules"
5142 else
5143 def_sdl='#undef CONFIG_SDL'
5144 _novomodules="sdl $_novomodules"
5145 _noaomodules="sdl $_noaomodules"
5147 echores "$_sdl"
5150 if os2 ; then
5151 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5152 if test "$_kva" = auto; then
5153 cat > $TMPC << EOF
5154 #include <os2.h>
5155 #include <kva.h>
5156 int main( void ) { return 0; }
5158 _kva=no;
5159 cc_check -lkva && _kva=yes
5161 if test "$_kva" = yes ; then
5162 def_kva='#define CONFIG_KVA 1'
5163 libs_mplayer="$libs_mplayer -lkva"
5164 _vomodules="kva $_vomodules"
5165 else
5166 def_kva='#undef CONFIG_KVA'
5167 _novomodules="kva $_novomodules"
5169 echores "$_kva"
5170 fi #if os2
5173 if win32; then
5175 echocheck "Windows waveout"
5176 if test "$_win32waveout" = auto ; then
5177 cat > $TMPC << EOF
5178 #include <windows.h>
5179 #include <mmsystem.h>
5180 int main(void) { return 0; }
5182 _win32waveout=no
5183 cc_check -lwinmm && _win32waveout=yes
5185 if test "$_win32waveout" = yes ; then
5186 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5187 libs_mplayer="$libs_mplayer -lwinmm"
5188 _aomodules="win32 $_aomodules"
5189 else
5190 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5191 _noaomodules="win32 $_noaomodules"
5193 echores "$_win32waveout"
5195 echocheck "Direct3D"
5196 if test "$_direct3d" = auto ; then
5197 cat > $TMPC << EOF
5198 #include <windows.h>
5199 #include <d3d9.h>
5200 int main(void) { return 0; }
5202 _direct3d=no
5203 cc_check && _direct3d=yes
5205 if test "$_direct3d" = yes ; then
5206 def_direct3d='#define CONFIG_DIRECT3D 1'
5207 _vomodules="direct3d $_vomodules"
5208 else
5209 def_direct3d='#undef CONFIG_DIRECT3D'
5210 _novomodules="direct3d $_novomodules"
5212 echores "$_direct3d"
5214 echocheck "Directx"
5215 if test "$_directx" = auto ; then
5216 cat > $TMPC << EOF
5217 #include <windows.h>
5218 #include <ddraw.h>
5219 #include <dsound.h>
5220 int main(void) { return 0; }
5222 _directx=no
5223 cc_check -lgdi32 && _directx=yes
5225 if test "$_directx" = yes ; then
5226 def_directx='#define CONFIG_DIRECTX 1'
5227 libs_mplayer="$libs_mplayer -lgdi32"
5228 _vomodules="directx $_vomodules"
5229 _aomodules="dsound $_aomodules"
5230 else
5231 def_directx='#undef CONFIG_DIRECTX'
5232 _novomodules="directx $_novomodules"
5233 _noaomodules="dsound $_noaomodules"
5235 echores "$_directx"
5237 fi #if win32; then
5240 echocheck "DXR2"
5241 if test "$_dxr2" = auto; then
5242 _dxr2=no
5243 cat > $TMPC << EOF
5244 #include <dxr2ioctl.h>
5245 int main(void) { return 0; }
5247 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5248 cc_check $_inc_tmp && _dxr2=yes && \
5249 extra_cflags="$extra_cflags $_inc_tmp" && break
5250 done
5252 if test "$_dxr2" = yes; then
5253 def_dxr2='#define CONFIG_DXR2 1'
5254 _aomodules="dxr2 $_aomodules"
5255 _vomodules="dxr2 $_vomodules"
5256 else
5257 def_dxr2='#undef CONFIG_DXR2'
5258 _noaomodules="dxr2 $_noaomodules"
5259 _novomodules="dxr2 $_novomodules"
5261 echores "$_dxr2"
5263 echocheck "DXR3/H+"
5264 if test "$_dxr3" = auto ; then
5265 cat > $TMPC << EOF
5266 #include <linux/em8300.h>
5267 int main(void) { return 0; }
5269 _dxr3=no
5270 cc_check && _dxr3=yes
5272 if test "$_dxr3" = yes ; then
5273 def_dxr3='#define CONFIG_DXR3 1'
5274 _vomodules="dxr3 $_vomodules"
5275 else
5276 def_dxr3='#undef CONFIG_DXR3'
5277 _novomodules="dxr3 $_novomodules"
5279 echores "$_dxr3"
5282 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5283 if test "$_ivtv" = auto ; then
5284 cat > $TMPC << EOF
5285 #include <stdlib.h>
5286 #include <inttypes.h>
5287 #include <linux/types.h>
5288 #include <linux/videodev2.h>
5289 #include <linux/ivtv.h>
5290 #include <sys/ioctl.h>
5291 int main(void) {
5292 struct ivtv_cfg_stop_decode sd;
5293 struct ivtv_cfg_start_decode sd1;
5294 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5295 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5296 return 0; }
5298 _ivtv=no
5299 cc_check && _ivtv=yes
5301 if test "$_ivtv" = yes ; then
5302 def_ivtv='#define CONFIG_IVTV 1'
5303 _vomodules="ivtv $_vomodules"
5304 _aomodules="ivtv $_aomodules"
5305 else
5306 def_ivtv='#undef CONFIG_IVTV'
5307 _novomodules="ivtv $_novomodules"
5308 _noaomodules="ivtv $_noaomodules"
5310 echores "$_ivtv"
5313 echocheck "V4L2 MPEG Decoder"
5314 if test "$_v4l2" = auto ; then
5315 cat > $TMPC << EOF
5316 #include <stdlib.h>
5317 #include <inttypes.h>
5318 #include <linux/types.h>
5319 #include <linux/videodev2.h>
5320 #include <linux/version.h>
5321 int main(void) {
5322 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5323 #error kernel headers too old, need 2.6.22
5324 #endif
5325 struct v4l2_ext_controls ctrls;
5326 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5327 return 0;
5330 _v4l2=no
5331 cc_check && _v4l2=yes
5333 if test "$_v4l2" = yes ; then
5334 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5335 _vomodules="v4l2 $_vomodules"
5336 _aomodules="v4l2 $_aomodules"
5337 else
5338 def_v4l2='#undef CONFIG_V4L2_DECODER'
5339 _novomodules="v4l2 $_novomodules"
5340 _noaomodules="v4l2 $_noaomodules"
5342 echores "$_v4l2"
5346 #########
5347 # AUDIO #
5348 #########
5351 echocheck "OSS Audio"
5352 if test "$_ossaudio" = auto ; then
5353 cat > $TMPC << EOF
5354 #include <sys/ioctl.h>
5355 #include <$_soundcard_header>
5356 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5358 _ossaudio=no
5359 cc_check && _ossaudio=yes
5361 if test "$_ossaudio" = yes ; then
5362 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5363 _aomodules="oss $_aomodules"
5364 if test "$_linux_devfs" = yes; then
5365 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"'
5366 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"'
5367 else
5368 cat > $TMPC << EOF
5369 #include <sys/ioctl.h>
5370 #include <$_soundcard_header>
5371 #ifdef OPEN_SOUND_SYSTEM
5372 int main(void) { return 0; }
5373 #else
5374 #error Not the real thing
5375 #endif
5377 _real_ossaudio=no
5378 cc_check && _real_ossaudio=yes
5379 if test "$_real_ossaudio" = yes; then
5380 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5381 # Check for OSS4 headers (override default headers)
5382 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5383 if test -f /etc/oss.conf; then
5384 . /etc/oss.conf
5385 _ossinc="$OSSLIBDIR/include"
5386 if test -f "$_ossinc/sys/soundcard.h"; then
5387 extra_cflags="-I$_ossinc $extra_cflags"
5390 elif netbsd || openbsd ; then
5391 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5392 extra_ldflags="$extra_ldflags -lossaudio"
5393 else
5394 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5396 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5398 else
5399 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5400 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5401 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5402 _noaomodules="oss $_noaomodules"
5404 echores "$_ossaudio"
5407 echocheck "aRts"
5408 if test "$_arts" = auto ; then
5409 _arts=no
5410 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5412 cat > $TMPC << EOF
5413 #include <artsc.h>
5414 int main(void) { return 0; }
5416 cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes
5421 if test "$_arts" = yes ; then
5422 def_arts='#define CONFIG_ARTS 1'
5423 _aomodules="arts $_aomodules"
5424 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5425 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5426 else
5427 _noaomodules="arts $_noaomodules"
5429 echores "$_arts"
5432 echocheck "EsounD"
5433 if test "$_esd" = auto ; then
5434 _esd=no
5435 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5437 cat > $TMPC << EOF
5438 #include <esd.h>
5439 int main(void) { int fd = esd_open_sound("test"); return fd; }
5441 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5445 echores "$_esd"
5447 if test "$_esd" = yes ; then
5448 def_esd='#define CONFIG_ESD 1'
5449 _aomodules="esd $_aomodules"
5450 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5451 extra_cflags="$extra_cflags $(esd-config --cflags)"
5453 echocheck "esd_get_latency()"
5454 cat > $TMPC << EOF
5455 #include <esd.h>
5456 int main(void) { return esd_get_latency(0); }
5458 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5459 echores "$_esd_latency"
5460 else
5461 def_esd='#undef CONFIG_ESD'
5462 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5463 _noaomodules="esd $_noaomodules"
5467 echocheck "NAS"
5468 if test "$_nas" = auto ; then
5469 cat > $TMPC << EOF
5470 #include <audio/audiolib.h>
5471 int main(void) { return 0; }
5473 _nas=no
5474 cc_check $_ld_lm -laudio -lXt && _nas=yes
5476 if test "$_nas" = yes ; then
5477 def_nas='#define CONFIG_NAS 1'
5478 libs_mplayer="$libs_mplayer -laudio -lXt"
5479 _aomodules="nas $_aomodules"
5480 else
5481 _noaomodules="nas $_noaomodules"
5482 def_nas='#undef CONFIG_NAS'
5484 echores "$_nas"
5487 echocheck "pulse"
5488 if test "$_pulse" = auto ; then
5489 _pulse=no
5490 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5492 cat > $TMPC << EOF
5493 #include <pulse/pulseaudio.h>
5494 int main(void) { return 0; }
5496 cc_check $($_pkg_config --libs --cflags libpulse) && _pulse=yes
5500 echores "$_pulse"
5502 if test "$_pulse" = yes ; then
5503 def_pulse='#define CONFIG_PULSE 1'
5504 _aomodules="pulse $_aomodules"
5505 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5506 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5507 else
5508 def_pulse='#undef CONFIG_PULSE'
5509 _noaomodules="pulse $_noaomodules"
5513 echocheck "JACK"
5514 if test "$_jack" = auto ; then
5515 _jack=yes
5517 cat > $TMPC << EOF
5518 #include <jack/jack.h>
5519 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5521 if cc_check -ljack ; then
5522 libs_mplayer="$libs_mplayer -ljack"
5523 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5524 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5525 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5526 else
5527 _jack=no
5531 if test "$_jack" = yes ; then
5532 def_jack='#define CONFIG_JACK 1'
5533 _aomodules="jack $_aomodules"
5534 else
5535 _noaomodules="jack $_noaomodules"
5537 echores "$_jack"
5539 echocheck "OpenAL"
5540 if test "$_openal" = auto ; then
5541 _openal=no
5542 cat > $TMPC << EOF
5543 #ifdef OPENAL_AL_H
5544 #include <OpenAL/al.h>
5545 #else
5546 #include <AL/al.h>
5547 #endif
5548 int main(void) {
5549 alSourceQueueBuffers(0, 0, 0);
5550 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5551 return 0;
5554 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5555 cc_check $I && _openal=yes && break
5556 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5557 done
5558 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5560 if test "$_openal" = yes ; then
5561 def_openal='#define CONFIG_OPENAL 1'
5562 _aomodules="openal $_aomodules"
5563 else
5564 _noaomodules="openal $_noaomodules"
5566 echores "$_openal"
5568 echocheck "ALSA audio"
5569 if test "$_alloca" != yes ; then
5570 _alsa=no
5571 _res_comment="alloca missing"
5573 if test "$_alsa" != no ; then
5574 _alsa=no
5575 cat > $TMPC << EOF
5576 #include <sys/time.h>
5577 #include <sys/asoundlib.h>
5578 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5579 #error "alsa version != 0.5.x"
5580 #endif
5581 int main(void) { return 0; }
5583 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5585 cat > $TMPC << EOF
5586 #include <sys/time.h>
5587 #include <sys/asoundlib.h>
5588 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5589 #error "alsa version != 0.9.x"
5590 #endif
5591 int main(void) { return 0; }
5593 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5594 cat > $TMPC << EOF
5595 #include <sys/time.h>
5596 #include <alsa/asoundlib.h>
5597 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5598 #error "alsa version != 0.9.x"
5599 #endif
5600 int main(void) { return 0; }
5602 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5604 cat > $TMPC << EOF
5605 #include <sys/time.h>
5606 #include <sys/asoundlib.h>
5607 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5608 #error "alsa version != 1.0.x"
5609 #endif
5610 int main(void) { return 0; }
5612 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5613 cat > $TMPC << EOF
5614 #include <sys/time.h>
5615 #include <alsa/asoundlib.h>
5616 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5617 #error "alsa version != 1.0.x"
5618 #endif
5619 int main(void) { return 0; }
5621 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5623 def_alsa='#undef CONFIG_ALSA'
5624 def_alsa5='#undef CONFIG_ALSA5'
5625 def_alsa9='#undef CONFIG_ALSA9'
5626 def_alsa1x='#undef CONFIG_ALSA1X'
5627 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5628 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5629 if test "$_alsaver" ; then
5630 _alsa=yes
5631 if test "$_alsaver" = '0.5.x' ; then
5632 _alsa5=yes
5633 _aomodules="alsa5 $_aomodules"
5634 def_alsa5='#define CONFIG_ALSA5 1'
5635 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5636 _res_comment="using alsa 0.5.x and sys/asoundlib.h"
5637 elif test "$_alsaver" = '0.9.x-sys' ; then
5638 _alsa9=yes
5639 _aomodules="alsa $_aomodules"
5640 def_alsa='#define CONFIG_ALSA 1'
5641 def_alsa9='#define CONFIG_ALSA9 1'
5642 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5643 _res_comment="using alsa 0.9.x and sys/asoundlib.h"
5644 elif test "$_alsaver" = '0.9.x-alsa' ; then
5645 _alsa9=yes
5646 _aomodules="alsa $_aomodules"
5647 def_alsa='#define CONFIG_ALSA 1'
5648 def_alsa9='#define CONFIG_ALSA9 1'
5649 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5650 _res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5651 elif test "$_alsaver" = '1.0.x-sys' ; then
5652 _alsa1x=yes
5653 _aomodules="alsa $_aomodules"
5654 def_alsa='#define CONFIG_ALSA 1'
5655 def_alsa1x="#define CONFIG_ALSA1X 1"
5656 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5657 _res_comment="using alsa 1.0.x and sys/asoundlib.h"
5658 elif test "$_alsaver" = '1.0.x-alsa' ; then
5659 _alsa1x=yes
5660 _aomodules="alsa $_aomodules"
5661 def_alsa='#define CONFIG_ALSA 1'
5662 def_alsa1x="#define CONFIG_ALSA1X 1"
5663 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5664 _res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5665 else
5666 _alsa=no
5667 _res_comment="unknown version"
5669 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5670 else
5671 _noaomodules="alsa $_noaomodules"
5673 echores "$_alsa"
5676 echocheck "Sun audio"
5677 if test "$_sunaudio" = auto ; then
5678 cat > $TMPC << EOF
5679 #include <sys/types.h>
5680 #include <sys/audioio.h>
5681 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5683 _sunaudio=no
5684 cc_check && _sunaudio=yes
5686 if test "$_sunaudio" = yes ; then
5687 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5688 _aomodules="sun $_aomodules"
5689 else
5690 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5691 _noaomodules="sun $_noaomodules"
5693 echores "$_sunaudio"
5696 def_mlib='#define CONFIG_MLIB 0'
5697 if sunos; then
5698 echocheck "Sun mediaLib"
5699 if test "$_mlib" = auto ; then
5700 _mlib=no
5701 cat > $TMPC << EOF
5702 #include <mlib.h>
5703 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5705 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5707 echores "$_mlib"
5708 fi #if sunos
5711 if darwin; then
5712 echocheck "CoreAudio"
5713 if test "$_coreaudio" = auto ; then
5714 cat > $TMPC <<EOF
5715 #include <CoreAudio/CoreAudio.h>
5716 #include <AudioToolbox/AudioToolbox.h>
5717 #include <AudioUnit/AudioUnit.h>
5718 int main(void) { return 0; }
5720 _coreaudio=no
5721 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5723 if test "$_coreaudio" = yes ; then
5724 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5725 def_coreaudio='#define CONFIG_COREAUDIO 1'
5726 _aomodules="coreaudio $_aomodules"
5727 else
5728 def_coreaudio='#undef CONFIG_COREAUDIO'
5729 _noaomodules="coreaudio $_noaomodules"
5731 echores $_coreaudio
5732 fi #if darwin
5735 if irix; then
5736 echocheck "SGI audio"
5737 if test "$_sgiaudio" = auto ; then
5738 # check for SGI audio
5739 cat > $TMPC << EOF
5740 #include <dmedia/audio.h>
5741 int main(void) { return 0; }
5743 _sgiaudio=no
5744 cc_check && _sgiaudio=yes
5746 if test "$_sgiaudio" = "yes" ; then
5747 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5748 libs_mplayer="$libs_mplayer -laudio"
5749 _aomodules="sgi $_aomodules"
5750 else
5751 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5752 _noaomodules="sgi $_noaomodules"
5754 echores "$_sgiaudio"
5755 fi #if irix
5758 if os2 ; then
5759 echocheck "DART"
5760 if test "$_dart" = auto; then
5761 cat > $TMPC << EOF
5762 #include <os2.h>
5763 #include <dart.h>
5764 int main( void ) { return 0; }
5766 _dart=no;
5767 cc_check -ldart && _dart=yes
5769 if test "$_dart" = yes ; then
5770 def_dart='#define CONFIG_DART 1'
5771 libs_mplayer="$libs_mplayer -ldart"
5772 _aomodules="dart $_aomodules"
5773 else
5774 def_dart='#undef CONFIG_DART'
5775 _noaomodules="dart $_noaomodules"
5777 echores "$_dart"
5778 fi #if os2
5781 # set default CD/DVD devices
5782 if win32 || os2 ; then
5783 default_cdrom_device="D:"
5784 elif darwin ; then
5785 default_cdrom_device="/dev/disk1"
5786 elif dragonfly ; then
5787 default_cdrom_device="/dev/cd0"
5788 elif freebsd ; then
5789 default_cdrom_device="/dev/acd0"
5790 elif openbsd ; then
5791 default_cdrom_device="/dev/rcd0a"
5792 elif sunos ; then
5793 default_cdrom_device="/vol/dev/aliases/cdrom0"
5794 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5795 # file system and the volfs service.
5796 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5797 elif amigaos ; then
5798 default_cdrom_device="a1ide.device:2"
5799 else
5800 default_cdrom_device="/dev/cdrom"
5803 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5804 default_dvd_device=$default_cdrom_device
5805 elif darwin ; then
5806 default_dvd_device="/dev/rdiskN"
5807 else
5808 default_dvd_device="/dev/dvd"
5812 echocheck "VCD support"
5813 if test "$_vcd" = auto; then
5814 _vcd=no
5815 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos; then
5816 _vcd=yes
5817 elif mingw32; then
5818 cat > $TMPC << EOF
5819 #include <ddk/ntddcdrm.h>
5820 int main(void) { return 0; }
5822 cc_check && _vcd=yes
5825 if test "$_vcd" = yes; then
5826 _inputmodules="vcd $_inputmodules"
5827 def_vcd='#define CONFIG_VCD 1'
5828 else
5829 def_vcd='#undef CONFIG_VCD'
5830 _noinputmodules="vcd $_noinputmodules"
5831 _res_comment="not supported on this OS"
5833 echores "$_vcd"
5837 echocheck "dvdread"
5838 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5839 _dvdread_internal=no
5841 if test "$_dvdread_internal" = auto ; then
5842 _dvdread_internal=no
5843 _dvdread=no
5844 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5845 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5846 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5847 || darwin || win32 || os2; then
5848 _dvdread_internal=yes
5849 _dvdread=yes
5850 extra_cflags="-Ilibdvdread4 $extra_cflags"
5852 elif test "$_dvdread" = auto ; then
5853 _dvdread=no
5854 if test "$_dl" = yes; then
5855 cat > $TMPC << EOF
5856 #include <inttypes.h>
5857 #include <dvdread/dvd_reader.h>
5858 #include <dvdread/ifo_types.h>
5859 #include <dvdread/ifo_read.h>
5860 #include <dvdread/nav_read.h>
5861 int main(void) { return 0; }
5863 _dvdreadcflags=$($_dvdreadconfig --cflags)
5864 _dvdreadlibs=$($_dvdreadconfig --libs)
5865 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5866 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5867 _dvdread=yes
5868 extra_cflags="$extra_cflags $_dvdreadcflags"
5869 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5870 _res_comment="external"
5875 if test "$_dvdread_internal" = yes; then
5876 def_dvdread='#define CONFIG_DVDREAD 1'
5877 _inputmodules="dvdread(internal) $_inputmodules"
5878 _largefiles=yes
5879 _res_comment="internal"
5880 elif test "$_dvdread" = yes; then
5881 def_dvdread='#define CONFIG_DVDREAD 1'
5882 _largefiles=yes
5883 extra_ldflags="$extra_ldflags -ldvdread"
5884 _inputmodules="dvdread(external) $_inputmodules"
5885 _res_comment="external"
5886 else
5887 def_dvdread='#undef CONFIG_DVDREAD'
5888 _noinputmodules="dvdread $_noinputmodules"
5890 echores "$_dvdread"
5893 echocheck "internal libdvdcss"
5894 if test "$_libdvdcss_internal" = auto ; then
5895 _libdvdcss_internal=no
5896 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5897 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5899 if test "$_libdvdcss_internal" = yes ; then
5900 if linux || netbsd || openbsd || bsdos ; then
5901 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5902 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5903 elif freebsd || dragonfly ; then
5904 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5905 elif darwin ; then
5906 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5907 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5908 elif cygwin ; then
5909 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5910 elif beos ; then
5911 cflags_libdvdcss="-DSYS_BEOS"
5912 elif os2 ; then
5913 cflags_libdvdcss="-DSYS_OS2"
5915 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5916 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5917 _inputmodules="libdvdcss(internal) $_inputmodules"
5918 _largefiles=yes
5919 else
5920 _noinputmodules="libdvdcss(internal) $_noinputmodules"
5922 echores "$_libdvdcss_internal"
5925 echocheck "cdparanoia"
5926 if test "$_cdparanoia" = auto ; then
5927 cat > $TMPC <<EOF
5928 #include <cdda_interface.h>
5929 #include <cdda_paranoia.h>
5930 // This need a better test. How ?
5931 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5933 _cdparanoia=no
5934 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5935 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5936 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5937 done
5939 if test "$_cdparanoia" = yes ; then
5940 _cdda='yes'
5941 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5942 openbsd && extra_ldflags="$extra_ldflags -lutil"
5944 echores "$_cdparanoia"
5947 echocheck "libcdio"
5948 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5949 cat > $TMPC << EOF
5950 #include <stdio.h>
5951 #include <cdio/version.h>
5952 #include <cdio/cdda.h>
5953 #include <cdio/paranoia.h>
5954 int main(void) {
5955 void *test = cdda_verbose_set;
5956 printf("%s\n", CDIO_VERSION);
5957 return test == (void *)1;
5960 _libcdio=no
5961 for _ld_tmp in "" "-lwinmm" ; do
5962 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5963 cc_check $_ld_tmp $_ld_lm \
5964 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5965 done
5966 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5967 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5968 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5969 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5970 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5973 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5974 _cdda='yes'
5975 def_libcdio='#define CONFIG_LIBCDIO 1'
5976 def_havelibcdio='yes'
5977 else
5978 if test "$_cdparanoia" = yes ; then
5979 _res_comment="using cdparanoia"
5981 def_libcdio='#undef CONFIG_LIBCDIO'
5982 def_havelibcdio='no'
5984 echores "$_libcdio"
5986 if test "$_cdda" = yes ; then
5987 test $_cddb = auto && test $_network = yes && _cddb=yes
5988 def_cdparanoia='#define CONFIG_CDDA 1'
5989 _inputmodules="cdda $_inputmodules"
5990 else
5991 def_cdparanoia='#undef CONFIG_CDDA'
5992 _noinputmodules="cdda $_noinputmodules"
5995 if test "$_cddb" = yes ; then
5996 def_cddb='#define CONFIG_CDDB 1'
5997 _inputmodules="cddb $_inputmodules"
5998 else
5999 _cddb=no
6000 def_cddb='#undef CONFIG_CDDB'
6001 _noinputmodules="cddb $_noinputmodules"
6004 echocheck "bitmap font support"
6005 if test "$_bitmap_font" = yes ; then
6006 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
6007 else
6008 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
6010 echores "$_bitmap_font"
6013 echocheck "freetype >= 2.0.9"
6015 # freetype depends on iconv
6016 if test "$_iconv" = no ; then
6017 _freetype=no
6018 _res_comment="iconv support needed"
6021 if test "$_freetype" = auto ; then
6022 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
6023 cat > $TMPC << EOF
6024 #include <stdio.h>
6025 #include <ft2build.h>
6026 #include FT_FREETYPE_H
6027 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
6028 #error "Need FreeType 2.0.9 or newer"
6029 #endif
6030 int main(void) {
6031 FT_Library library;
6032 FT_Int major=-1,minor=-1,patch=-1;
6033 int err=FT_Init_FreeType(&library);
6034 return 0;
6037 _freetype=no
6038 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6039 else
6040 _freetype=no
6043 if test "$_freetype" = yes ; then
6044 def_freetype='#define CONFIG_FREETYPE 1'
6045 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6046 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6047 else
6048 def_freetype='#undef CONFIG_FREETYPE'
6050 echores "$_freetype"
6052 if test "$_freetype" = no ; then
6053 _fontconfig=no
6054 _res_comment="FreeType support needed"
6056 echocheck "fontconfig"
6057 if test "$_fontconfig" = auto ; then
6058 cat > $TMPC << EOF
6059 #include <stdio.h>
6060 #include <stdlib.h>
6061 #include <fontconfig/fontconfig.h>
6062 int main(void) {
6063 int err = FcInit();
6064 if (err == FcFalse) {
6065 printf("Couldn't initialize fontconfig lib\n");
6066 exit(err);
6068 return 0;
6071 _fontconfig=no
6072 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6073 _ld_tmp="-lfontconfig $_ld_tmp"
6074 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6075 done
6076 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6077 _inc_tmp=$($_pkg_config --cflags fontconfig)
6078 _ld_tmp=$($_pkg_config --libs fontconfig)
6079 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6080 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6083 if test "$_fontconfig" = yes ; then
6084 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6085 else
6086 def_fontconfig='#undef CONFIG_FONTCONFIG'
6088 echores "$_fontconfig"
6091 echocheck "SSA/ASS support"
6092 if test "$_ass" = auto -o "$_ass" = yes ; then
6093 if $_pkg_config libass; then
6094 _ass=yes
6095 def_ass='#define CONFIG_ASS 1'
6096 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
6097 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
6098 else
6099 _ass=no
6100 def_ass='#undef CONFIG_ASS'
6102 else
6103 def_ass='#undef CONFIG_ASS'
6105 echores "$_ass"
6108 echocheck "fribidi with charsets"
6109 _inc_tmp=""
6110 _ld_tmp=""
6111 if test "$_fribidi" = auto ; then
6112 cat > $TMPC << EOF
6113 #include <stdio.h>
6114 #include <stdlib.h>
6115 /* workaround for fribidi 0.10.4 and below */
6116 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6117 #include <fribidi/fribidi.h>
6118 int main(void) {
6119 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8) {
6120 printf("Fribidi headers are not consistents with the library!\n");
6121 exit(1);
6123 return 0;
6126 _fribidi=no
6127 _inc_tmp=""
6128 _ld_tmp="-lfribidi"
6129 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6130 if $_fribidiconfig --version > /dev/null 2>&1 &&
6131 test "$_fribidi" = no ; then
6132 _inc_tmp="$($_fribidiconfig --cflags)"
6133 _ld_tmp="$($_fribidiconfig --libs)"
6134 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6137 if test "$_fribidi" = yes ; then
6138 def_fribidi='#define CONFIG_FRIBIDI 1'
6139 extra_cflags="$extra_cflags $_inc_tmp"
6140 extra_ldflags="$extra_ldflags $_ld_tmp"
6141 else
6142 def_fribidi='#undef CONFIG_FRIBIDI'
6144 echores "$_fribidi"
6147 echocheck "ENCA"
6148 if test "$_enca" = auto ; then
6149 cat > $TMPC << EOF
6150 #include <sys/types.h>
6151 #include <enca.h>
6152 int main(void) {
6153 const char **langs;
6154 size_t langcnt;
6155 langs = enca_get_languages(&langcnt);
6156 return 0;
6159 _enca=no
6160 cc_check -lenca $_ld_lm && _enca=yes
6162 if test "$_enca" = yes ; then
6163 def_enca='#define CONFIG_ENCA 1'
6164 extra_ldflags="$extra_ldflags -lenca"
6165 else
6166 def_enca='#undef CONFIG_ENCA'
6168 echores "$_enca"
6171 echocheck "zlib"
6172 cat > $TMPC << EOF
6173 #include <zlib.h>
6174 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6176 _zlib=no
6177 cc_check -lz && _zlib=yes
6178 if test "$_zlib" = yes ; then
6179 def_zlib='#define CONFIG_ZLIB 1'
6180 extra_ldflags="$extra_ldflags -lz"
6181 else
6182 def_zlib='#define CONFIG_ZLIB 0'
6184 echores "$_zlib"
6187 echocheck "bzlib"
6188 bzlib=no
6189 def_bzlib='#define CONFIG_BZLIB 0'
6190 cat > $TMPC << EOF
6191 #include <bzlib.h>
6192 int main(void) { BZ2_bzlibVersion(); return 0; }
6194 cc_check -lbz2 && bzlib=yes
6195 if test "$bzlib" = yes ; then
6196 def_bzlib='#define CONFIG_BZLIB 1'
6197 extra_ldflags="$extra_ldflags -lbz2"
6199 echores "$bzlib"
6202 echocheck "RTC"
6203 if test "$_rtc" = auto ; then
6204 cat > $TMPC << EOF
6205 #include <sys/ioctl.h>
6206 #ifdef __linux__
6207 #include <linux/rtc.h>
6208 #else
6209 #include <rtc.h>
6210 #define RTC_PIE_ON RTCIO_PIE_ON
6211 #endif
6212 int main(void) { return RTC_PIE_ON; }
6214 _rtc=no
6215 cc_check && _rtc=yes
6216 ppc && _rtc=no
6218 if test "$_rtc" = yes ; then
6219 def_rtc='#define HAVE_RTC 1'
6220 else
6221 def_rtc='#undef HAVE_RTC'
6223 echores "$_rtc"
6226 echocheck "liblzo2 support"
6227 if test "$_liblzo" = auto ; then
6228 _liblzo=no
6229 cat > $TMPC << EOF
6230 #include <lzo/lzo1x.h>
6231 int main(void) { lzo_init();return 0; }
6233 cc_check -llzo2 && _liblzo=yes
6235 if test "$_liblzo" = yes ; then
6236 def_liblzo='#define CONFIG_LIBLZO 1'
6237 extra_ldflags="$extra_ldflags -llzo2"
6238 _codecmodules="liblzo $_codecmodules"
6239 else
6240 def_liblzo='#undef CONFIG_LIBLZO'
6241 _nocodecmodules="liblzo $_nocodecmodules"
6243 echores "$_liblzo"
6246 echocheck "mad support"
6247 if test "$_mad" = auto ; then
6248 _mad=no
6249 cat > $TMPC << EOF
6250 #include <mad.h>
6251 int main(void) { return 0; }
6253 cc_check -lmad && _mad=yes
6255 if test "$_mad" = yes ; then
6256 def_mad='#define CONFIG_LIBMAD 1'
6257 extra_ldflags="$extra_ldflags -lmad"
6258 _codecmodules="libmad $_codecmodules"
6259 else
6260 def_mad='#undef CONFIG_LIBMAD'
6261 _nocodecmodules="libmad $_nocodecmodules"
6263 echores "$_mad"
6265 echocheck "Twolame"
6266 if test "$_twolame" = auto ; then
6267 cat > $TMPC <<EOF
6268 #include <twolame.h>
6269 int main(void) { twolame_init(); return 0; }
6271 _twolame=no
6272 cc_check -ltwolame $_ld_lm && _twolame=yes
6274 if test "$_twolame" = yes ; then
6275 def_twolame='#define CONFIG_TWOLAME 1'
6276 libs_mencoder="$libs_mencoder -ltwolame"
6277 _codecmodules="twolame $_codecmodules"
6278 else
6279 def_twolame='#undef CONFIG_TWOLAME'
6280 _nocodecmodules="twolame $_nocodecmodules"
6282 echores "$_twolame"
6284 echocheck "Toolame"
6285 if test "$_toolame" = auto ; then
6286 _toolame=no
6287 if test "$_twolame" = yes ; then
6288 _res_comment="disabled by twolame"
6289 else
6290 cat > $TMPC <<EOF
6291 #include <toolame.h>
6292 int main(void) { toolame_init(); return 0; }
6294 cc_check -ltoolame $_ld_lm && _toolame=yes
6297 if test "$_toolame" = yes ; then
6298 def_toolame='#define CONFIG_TOOLAME 1'
6299 libs_mencoder="$libs_mencoder -ltoolame"
6300 _codecmodules="toolame $_codecmodules"
6301 else
6302 def_toolame='#undef CONFIG_TOOLAME'
6303 _nocodecmodules="toolame $_nocodecmodules"
6305 if test "$_toolamedir" ; then
6306 _res_comment="using $_toolamedir"
6308 echores "$_toolame"
6310 echocheck "OggVorbis support"
6311 if test "$_tremor_internal" = yes; then
6312 _libvorbis=no
6313 elif test "$_tremor" = auto; then
6314 _tremor=no
6315 cat > $TMPC << EOF
6316 #include <tremor/ivorbiscodec.h>
6317 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6319 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6321 if test "$_libvorbis" = auto; then
6322 _libvorbis=no
6323 cat > $TMPC << EOF
6324 #include <vorbis/codec.h>
6325 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6327 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6329 if test "$_tremor_internal" = yes ; then
6330 _vorbis=yes
6331 def_vorbis='#define CONFIG_OGGVORBIS 1'
6332 def_tremor='#define CONFIG_TREMOR 1'
6333 _codecmodules="tremor(internal) $_codecmodules"
6334 _res_comment="internal Tremor"
6335 if test "$_tremor_low" = yes ; then
6336 cflags_tremor_low="-D_LOW_ACCURACY_"
6337 _res_comment="internal low accuracy Tremor"
6339 elif test "$_tremor" = yes ; then
6340 _vorbis=yes
6341 def_vorbis='#define CONFIG_OGGVORBIS 1'
6342 def_tremor='#define CONFIG_TREMOR 1'
6343 _codecmodules="tremor(external) $_codecmodules"
6344 _res_comment="external Tremor"
6345 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6346 elif test "$_libvorbis" = yes ; then
6347 _vorbis=yes
6348 def_vorbis='#define CONFIG_OGGVORBIS 1'
6349 _codecmodules="libvorbis $_codecmodules"
6350 _res_comment="libvorbis"
6351 extra_ldflags="$extra_ldflags -lvorbis -logg"
6352 else
6353 _vorbis=no
6354 _nocodecmodules="libvorbis $_nocodecmodules"
6356 echores "$_vorbis"
6358 echocheck "libspeex (version >= 1.1 required)"
6359 if test "$_speex" = auto ; then
6360 _speex=no
6361 cat > $TMPC << EOF
6362 #include <speex/speex.h>
6363 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6365 cc_check -lspeex $_ld_lm && _speex=yes
6367 if test "$_speex" = yes ; then
6368 def_speex='#define CONFIG_SPEEX 1'
6369 extra_ldflags="$extra_ldflags -lspeex"
6370 _codecmodules="speex $_codecmodules"
6371 else
6372 def_speex='#undef CONFIG_SPEEX'
6373 _nocodecmodules="speex $_nocodecmodules"
6375 echores "$_speex"
6377 echocheck "OggTheora support"
6378 if test "$_theora" = auto ; then
6379 _theora=no
6380 cat > $TMPC << EOF
6381 #include <theora/theora.h>
6382 #include <string.h>
6383 int main(void) {
6384 /* Theora is in flux, make sure that all interface routines and datatypes
6385 * exist and work the way we expect it, so we don't break MPlayer. */
6386 ogg_packet op;
6387 theora_comment tc;
6388 theora_info inf;
6389 theora_state st;
6390 yuv_buffer yuv;
6391 int r;
6392 double t;
6394 theora_info_init(&inf);
6395 theora_comment_init(&tc);
6397 return 0;
6399 /* we don't want to execute this kind of nonsense; just for making sure
6400 * that compilation works... */
6401 memset(&op, 0, sizeof(op));
6402 r = theora_decode_header(&inf, &tc, &op);
6403 r = theora_decode_init(&st, &inf);
6404 t = theora_granule_time(&st, op.granulepos);
6405 r = theora_decode_packetin(&st, &op);
6406 r = theora_decode_YUVout(&st, &yuv);
6407 theora_clear(&st);
6409 return 0;
6412 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6413 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6414 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6415 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6416 if test _theora = no; then
6417 _ld_theora="-ltheora -logg"
6418 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6420 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6421 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6422 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6423 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6424 extra_ldflags="$extra_ldflags $_ld_theora" &&
6425 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6426 if test _theora = no; then
6427 _ld_theora="-ltheora -logg"
6428 cc_check tremor/bitwise.c $_ld_theora &&
6429 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6433 if test "$_theora" = yes ; then
6434 def_theora='#define CONFIG_OGGTHEORA 1'
6435 _codecmodules="libtheora $_codecmodules"
6436 # when --enable-theora is forced, we'd better provide a probably sane
6437 # $_ld_theora than nothing
6438 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6439 else
6440 def_theora='#undef CONFIG_OGGTHEORA'
6441 _nocodecmodules="libtheora $_nocodecmodules"
6443 echores "$_theora"
6445 echocheck "internal mp3lib support"
6446 if test "$_mp3lib" = auto ; then
6447 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6449 if test "$_mp3lib" = yes ; then
6450 def_mp3lib='#define CONFIG_MP3LIB 1'
6451 _codecmodules="mp3lib(internal) $_codecmodules"
6452 else
6453 def_mp3lib='#undef CONFIG_MP3LIB'
6454 _nocodecmodules="mp3lib(internal) $_nocodecmodules"
6456 echores "$_mp3lib"
6458 echocheck "liba52 support"
6459 if test "$_liba52_internal" = auto ; then
6460 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
6462 def_liba52='#undef CONFIG_LIBA52'
6463 def_liba52_internal="#undef CONFIG_LIBA52_INTERNAL"
6464 if test "$_liba52_internal" = yes ; then
6465 _liba52=yes
6466 def_liba52_internal="#define CONFIG_LIBA52_INTERNAL 1"
6467 _res_comment="internal"
6468 elif test "$_liba52_internal" = no && test "$_liba52" = auto ; then
6469 _liba52=no
6470 cat > $TMPC << EOF
6471 #include <inttypes.h>
6472 #include <a52dec/a52.h>
6473 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6475 cc_check -la52 && _liba52=yes && _res_comment="external" && extra_ldflags="$extra_ldflags -la52"
6477 if test "$_liba52" = yes ; then
6478 def_liba52='#define CONFIG_LIBA52 1'
6479 _codecmodules="liba52($_res_comment) $_codecmodules"
6480 else
6481 _nocodecmodules="liba52 $_nocodecmodules"
6483 echores "$_liba52"
6485 echocheck "internal libmpeg2 support"
6486 if test "$_libmpeg2" = auto ; then
6487 _libmpeg2=yes
6488 if alpha && test cc_vendor=gnu; then
6489 case $cc_version in
6490 2*|3.0*|3.1*) # cannot compile MVI instructions
6491 _libmpeg2=no
6492 _res_comment="broken gcc"
6494 esac
6497 if test "$_libmpeg2" = yes ; then
6498 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6499 _codecmodules="libmpeg2(internal) $_codecmodules"
6500 else
6501 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6502 _nocodecmodules="libmpeg2(internal) $_nocodecmodules"
6504 echores "$_libmpeg2"
6506 echocheck "libdca support"
6507 if test "$_libdca" = auto ; then
6508 _libdca=no
6509 cat > $TMPC << EOF
6510 #include <inttypes.h>
6511 #include <dts.h>
6512 int main(void) { dts_init(0); return 0; }
6514 for _ld_dca in -ldca -ldts ; do
6515 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6516 && _libdca=yes && break
6517 done
6519 if test "$_libdca" = yes ; then
6520 def_libdca='#define CONFIG_LIBDCA 1'
6521 _codecmodules="libdca $_codecmodules"
6522 else
6523 def_libdca='#undef CONFIG_LIBDCA'
6524 _nocodecmodules="libdca $_nocodecmodules"
6526 echores "$_libdca"
6528 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6529 if test "$_musepack" = auto ; then
6530 _musepack=no
6531 cat > $TMPC << EOF
6532 #include <stddef.h>
6533 #include <mpcdec/mpcdec.h>
6534 int main(void) {
6535 mpc_streaminfo info;
6536 mpc_decoder decoder;
6537 mpc_decoder_set_streaminfo(&decoder, &info);
6538 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6539 return 0;
6542 cc_check -lmpcdec $_ld_lm && _musepack=yes
6544 if test "$_musepack" = yes ; then
6545 def_musepack='#define CONFIG_MUSEPACK 1'
6546 extra_ldflags="$extra_ldflags -lmpcdec"
6547 _codecmodules="musepack $_codecmodules"
6548 else
6549 def_musepack='#undef CONFIG_MUSEPACK'
6550 _nocodecmodules="musepack $_nocodecmodules"
6552 echores "$_musepack"
6555 echocheck "FAAC support"
6556 if test "$_faac" = auto ; then
6557 cat > $TMPC <<EOF
6558 #include <inttypes.h>
6559 #include <faac.h>
6560 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6562 _faac=no
6563 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6564 cc_check -O2 $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6565 done
6567 if test "$_faac" = yes ; then
6568 def_faac="#define CONFIG_FAAC 1"
6569 _codecmodules="faac $_codecmodules"
6570 else
6571 def_faac="#undef CONFIG_FAAC"
6572 _nocodecmodules="faac $_nocodecmodules"
6574 echores "$_faac"
6577 echocheck "FAAD2 support"
6578 if test "$_faad_internal" = auto ; then
6579 if x86_32 && test cc_vendor=gnu; then
6580 case $cc_version in
6581 3.1*|3.2) # ICE/insn with these versions
6582 _faad_internal=no
6583 _res_comment="broken gcc"
6586 _faad=yes
6587 _faad_internal=yes
6589 esac
6590 else
6591 _faad=yes
6592 _faad_internal=yes
6595 if test "$_faad" = auto ; then
6596 cat > $TMPC << EOF
6597 #include <faad.h>
6598 #ifndef FAAD_MIN_STREAMSIZE
6599 #error Too old version
6600 #endif
6601 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6602 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6604 cc_check -lfaad $_ld_lm && _faad=yes
6607 def_faad='#undef CONFIG_FAAD'
6608 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6609 if test "$_faad_internal" = yes ; then
6610 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6611 _res_comment="internal floating-point"
6612 if test "$_faad_fixed" = yes ; then
6613 # The FIXED_POINT implementation of FAAD2 improves performance
6614 # on some platforms, especially for SBR files.
6615 cflags_faad_fixed="-DFIXED_POINT"
6616 _res_comment="internal fixed-point"
6618 elif test "$_faad" = yes ; then
6619 extra_ldflags="$extra_ldflags -lfaad"
6622 if test "$_faad" = yes ; then
6623 def_faad='#define CONFIG_FAAD 1'
6624 if test "$_faad_internal" = yes ; then
6625 _codecmodules="faad2(internal) $_codecmodules"
6626 else
6627 _codecmodules="faad2 $_codecmodules"
6629 else
6630 _faad=no
6631 _nocodecmodules="faad2 $_nocodecmodules"
6633 echores "$_faad"
6636 echocheck "LADSPA plugin support"
6637 if test "$_ladspa" = auto ; then
6638 cat > $TMPC <<EOF
6639 #include <stdio.h>
6640 #include <ladspa.h>
6641 int main(void) {
6642 const LADSPA_Descriptor *ld = NULL;
6643 return 0;
6646 _ladspa=no
6647 cc_check && _ladspa=yes
6649 if test "$_ladspa" = yes; then
6650 def_ladspa="#define CONFIG_LADSPA 1"
6651 else
6652 def_ladspa="#undef CONFIG_LADSPA"
6654 echores "$_ladspa"
6657 echocheck "libbs2b audio filter support"
6658 if test "$_libbs2b" = auto ; then
6659 cat > $TMPC <<EOF
6660 #include <bs2b.h>
6661 #if BS2B_VERSION_MAJOR < 3
6662 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6663 #endif
6664 int main(void) {
6665 t_bs2bdp filter;
6666 filter=bs2b_open();
6667 bs2b_close(filter);
6668 return 0;
6671 _libbs2b=no
6672 if $_pkg_config --exists libbs2b ; then
6673 _inc_tmp=$($_pkg_config --cflags libbs2b)
6674 _ld_tmp=$($_pkg_config --libs libbs2b)
6675 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6676 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6677 else
6678 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6679 -I/usr/local/include/bs2b ; do
6680 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6681 extra_ldflags="$extra_ldflags -lbs2b"
6682 extra_cflags="$extra_cflags $_inc_tmp"
6683 _libbs2b=yes
6684 break
6686 done
6689 def_libbs2b="#undef CONFIG_LIBBS2B"
6690 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6691 echores "$_libbs2b"
6694 if test -z "$_codecsdir" ; then
6695 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6696 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6697 if test -d "$dir" ; then
6698 _codecsdir="$dir"
6699 break;
6701 done
6703 # Fall back on default directory.
6704 if test -z "$_codecsdir" ; then
6705 _codecsdir="$_libdir/codecs"
6706 mingw32 && _codecsdir="codecs"
6707 os2 && _codecsdir="codecs"
6711 echocheck "Win32 codecs"
6712 if test "$_win32dll" = auto ; then
6713 _win32dll=no
6714 if x86_32 && ! qnx; then
6715 _win32dll=yes
6718 if test "$_win32dll" = yes ; then
6719 def_win32dll='#define CONFIG_WIN32DLL 1'
6720 test -z "$_win32codecsdir" && _win32codecsdir=$_codecsdir
6721 _res_comment="using $_win32codecsdir"
6722 if ! win32 ; then
6723 def_win32_loader='#define WIN32_LOADER 1'
6724 _win32_emulation=yes
6725 else
6726 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6727 _res_comment="using native windows"
6729 _codecmodules="win32 $_codecmodules"
6730 else
6731 def_win32dll='#undef CONFIG_WIN32DLL'
6732 def_win32_loader='#undef WIN32_LOADER'
6733 _nocodecmodules="win32 $_nocodecmodules"
6735 echores "$_win32dll"
6738 echocheck "XAnim codecs"
6739 if test "$_xanim" = auto ; then
6740 _xanim=no
6741 _res_comment="dynamic loader support needed"
6742 if test "$_dl" = yes ; then
6743 _xanim=yes
6746 if test "$_xanim" = yes ; then
6747 test -z "$_xanimcodecsdir" && _xanimcodecsdir=$_codecsdir
6748 def_xanim='#define CONFIG_XANIM 1'
6749 def_xanim_path="#define XACODEC_PATH \"$_xanimcodecsdir\""
6750 _codecmodules="xanim $_codecmodules"
6751 _res_comment="using $_xanimcodecsdir"
6752 else
6753 def_xanim='#undef CONFIG_XANIM'
6754 def_xanim_path='#undef XACODEC_PATH'
6755 _nocodecmodules="xanim $_nocodecmodules"
6757 echores "$_xanim"
6760 echocheck "RealPlayer codecs"
6761 if test "$_real" = auto ; then
6762 _real=no
6763 _res_comment="dynamic loader support needed"
6764 if test "$_dl" = yes || test "$_win32dll" = yes &&
6765 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32) ; then
6766 _real=yes
6769 if test "$_real" = yes ; then
6770 test -z "$_realcodecsdir" && _realcodecsdir="$_codecsdir"
6771 def_real='#define CONFIG_REALCODECS 1'
6772 def_real_path="#define REALCODEC_PATH \"$_realcodecsdir\""
6773 _codecmodules="real $_codecmodules"
6774 _res_comment="using $_realcodecsdir"
6775 else
6776 def_real='#undef CONFIG_REALCODECS'
6777 def_real_path="#undef REALCODEC_PATH"
6778 _nocodecmodules="real $_nocodecmodules"
6780 echores "$_real"
6783 echocheck "QuickTime codecs"
6784 _qtx_emulation=no
6785 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6786 if test "$_qtx" = auto ; then
6787 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6789 if test "$_qtx" = yes ; then
6790 def_qtx='#define CONFIG_QTX_CODECS 1'
6791 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6792 _codecmodules="qtx $_codecmodules"
6793 darwin || win32 || _qtx_emulation=yes
6794 else
6795 def_qtx='#undef CONFIG_QTX_CODECS'
6796 _nocodecmodules="qtx $_nocodecmodules"
6798 echores "$_qtx"
6800 echocheck "Nemesi Streaming Media libraries"
6801 if test "$_nemesi" = auto && test "$_network" = yes ; then
6802 _nemesi=no
6803 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6804 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6805 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6806 _nemesi=yes
6809 if test "$_nemesi" = yes; then
6810 _native_rtsp=no
6811 def_nemesi='#define CONFIG_LIBNEMESI 1'
6812 _inputmodules="nemesi $_inputmodules"
6813 else
6814 _native_rtsp="$_network"
6815 _nemesi=no
6816 def_nemesi='#undef CONFIG_LIBNEMESI'
6817 _noinputmodules="nemesi $_noinputmodules"
6819 echores "$_nemesi"
6821 echocheck "LIVE555 Streaming Media libraries"
6822 if test "$_live" = auto && test "$_network" = yes ; then
6823 cat > $TMPCPP << EOF
6824 #include <liveMedia.hh>
6825 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6826 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6827 #endif
6828 int main(void) { return 0; }
6831 _live=no
6832 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
6833 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6834 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6835 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6836 $_livelibdir/groupsock/libgroupsock.a \
6837 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6838 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6839 $extra_ldflags -lstdc++" \
6840 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6841 -I$_livelibdir/UsageEnvironment/include \
6842 -I$_livelibdir/BasicUsageEnvironment/include \
6843 -I$_livelibdir/groupsock/include" && \
6844 _live=yes && break
6845 done
6846 if test "$_live" != yes ; then
6847 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6848 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6849 _live_dist=yes
6853 if test "$_live" = yes && test "$_network" = yes; then
6854 test $_livelibdir && _res_comment="using $_livelibdir"
6855 def_live='#define CONFIG_LIVE555 1'
6856 _inputmodules="live555 $_inputmodules"
6857 elif test "$_live_dist" = yes && test "$_network" = yes; then
6858 _res_comment="using distribution version"
6859 _live="yes"
6860 def_live='#define CONFIG_LIVE555 1'
6861 extra_ldflags="$extra_ldflags $ld_tmp"
6862 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6863 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6864 _inputmodules="live555 $_inputmodules"
6865 else
6866 _live=no
6867 def_live='#undef CONFIG_LIVE555'
6868 _noinputmodules="live555 $_noinputmodules"
6870 echores "$_live"
6873 echocheck "FFmpeg libavutil"
6874 if test "$_libavutil" = auto ; then
6875 _libavutil=no
6876 cat > $TMPC << EOF
6877 #include <libavutil/common.h>
6878 int main(void) { av_gcd(1,1); return 0; }
6880 if $_pkg_config --exists libavutil ; then
6881 _inc_libavutil=$($_pkg_config --cflags libavutil)
6882 _ld_tmp=$($_pkg_config --libs libavutil)
6883 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libavutil" \
6884 && _libavutil=yes
6885 elif cc_check -lavutil $_ld_lm ; then
6886 extra_ldflags="$extra_ldflags -lavutil"
6887 _libavutil=yes
6890 def_libavutil='#undef CONFIG_LIBAVUTIL'
6891 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
6892 # libavutil is not available, but it is mandatory ...
6893 if test "$_libavutil" = no ; then
6894 die "You need libavutil, MPlayer will not compile without!"
6896 echores "$_libavutil"
6898 echocheck "FFmpeg libavcodec"
6899 if test "$_libavcodec" = auto ; then
6900 _libavcodec=no
6901 cat > $TMPC << EOF
6902 #include <libavcodec/avcodec.h>
6903 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6905 if $_pkg_config --exists libavcodec ; then
6906 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
6907 _ld_tmp=$($_pkg_config --libs libavcodec)
6908 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavcodec" \
6909 && _libavcodec=yes
6910 elif cc_check -lavcodec $_ld_lm ; then
6911 extra_ldflags="$extra_ldflags -lavcodec"
6912 _libavcodec=yes
6915 def_libavcodec='#undef CONFIG_LIBAVCODEC'
6916 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
6917 if test "$_libavcodec" = yes ; then
6918 _codecmodules="libavcodec $_codecmodules"
6919 else
6920 _nocodecmodules="libavcodec $_nocodecmodules"
6922 echores "$_libavcodec"
6924 echocheck "FFmpeg libavformat"
6925 if test "$_libavformat" = auto ; then
6926 _libavformat=no
6927 cat > $TMPC <<EOF
6928 #include <libavformat/avformat.h>
6929 #include <libavcodec/opt.h>
6930 int main(void) { av_alloc_format_context(); return 0; }
6932 if $_pkg_config --exists libavformat ; then
6933 _inc_libavformat=$($_pkg_config --cflags libavformat)
6934 _ld_tmp=$($_pkg_config --libs libavformat)
6935 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavformat" \
6936 && _libavformat=yes
6937 elif cc_check $_ld_lm -lavformat ; then
6938 extra_ldflags="$extra_ldflags -lavformat"
6939 _libavformat=yes
6942 def_libavformat='#undef CONFIG_LIBAVFORMAT'
6943 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
6944 echores "$_libavformat"
6946 echocheck "FFmpeg libpostproc"
6947 if test "$_libpostproc" = auto ; then
6948 _libpostproc=no
6949 cat > $TMPC << EOF
6950 #include <inttypes.h>
6951 #include <libpostproc/postprocess.h>
6952 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6954 if $_pkg_config --exists libpostproc ; then
6955 _inc_libpostproc=$($_pkg_config --cflags libpostproc)
6956 _ld_tmp=$($_pkg_config --libs libpostproc)
6957 cc_check $_inc_libpostproc $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libpostproc" \
6958 && _libpostproc=yes
6959 elif cc_check -lpostproc $_ld_lm ; then
6960 extra_ldflags="$extra_ldflags -lpostproc"
6961 _libpostproc=yes
6964 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
6965 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
6966 echores "$_libpostproc"
6968 echocheck "FFmpeg libswscale"
6969 if test "$_libswscale" = auto ; then
6970 _libswscale=no
6971 cat > $TMPC << EOF
6972 #include <libswscale/swscale.h>
6973 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
6975 if $_pkg_config --exists libswscale ; then
6976 _inc_libswscale=$($_pkg_config --cflags libswscale)
6977 _ld_tmp=$($_pkg_config --libs libswscale)
6978 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libswscale" \
6979 && _libswscale=yes
6980 elif cc_check -lswscale ; then
6981 extra_ldflags="$extra_ldflags -lswscale"
6982 _libswscale=yes
6985 def_libswscale='#undef CONFIG_LIBSWSCALE'
6986 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
6987 echores "$_libswscale"
6989 def_libswscale_internals="#undef CONFIG_LIBSWSCALE_INTERNALS"
6990 if ! test -z "$_ffmpeg_source" ; then
6991 test "$_libswscale" = yes && def_libswscale_internals="#define CONFIG_LIBSWSCALE_INTERNALS 1" && _libswscale_internals=yes
6994 def_libavcodec_internals="#undef CONFIG_LIBAVCODEC_INTERNALS"
6995 if ! test -z "$_ffmpeg_source" ; then
6996 test "$_libavcodec" = yes && def_libavcodec_internals="#define CONFIG_LIBAVCODEC_INTERNALS 1" && _libavcodec_internals=yes
6999 echocheck "libdv-0.9.5+"
7000 if test "$_libdv" = auto ; then
7001 _libdv=no
7002 cat > $TMPC <<EOF
7003 #include <libdv/dv.h>
7004 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
7006 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
7008 if test "$_libdv" = yes ; then
7009 def_libdv='#define CONFIG_LIBDV095 1'
7010 extra_ldflags="$extra_ldflags -ldv"
7011 _codecmodules="libdv $_codecmodules"
7012 else
7013 def_libdv='#undef CONFIG_LIBDV095'
7014 _nocodecmodules="libdv $_nocodecmodules"
7016 echores "$_libdv"
7019 echocheck "Xvid"
7020 if test "$_xvid" = auto ; then
7021 _xvid=no
7022 cat > $TMPC << EOF
7023 #include <xvid.h>
7024 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
7026 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
7027 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
7028 done
7031 if test "$_xvid" = yes ; then
7032 def_xvid='#define CONFIG_XVID4 1'
7033 _codecmodules="xvid $_codecmodules"
7034 else
7035 def_xvid='#undef CONFIG_XVID4'
7036 _nocodecmodules="xvid $_nocodecmodules"
7038 echores "$_xvid"
7040 echocheck "x264"
7041 if test "$_x264" = auto ; then
7042 cat > $TMPC << EOF
7043 #include <inttypes.h>
7044 #include <x264.h>
7045 #if X264_BUILD < 79
7046 #error We do not support old versions of x264. Get the latest from git.
7047 #endif
7048 int main(void) { x264_encoder_open((void*)0); return 0; }
7050 _x264=no
7051 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7052 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7053 done
7056 if test "$_x264" = yes ; then
7057 def_x264='#define CONFIG_X264 1'
7058 _codecmodules="x264 $_codecmodules"
7059 else
7060 def_x264='#undef CONFIG_X264'
7061 _nocodecmodules="x264 $_nocodecmodules"
7063 echores "$_x264"
7065 echocheck "libnut"
7066 if test "$_libnut" = auto ; then
7067 cat > $TMPC << EOF
7068 #include <stdio.h>
7069 #include <stdlib.h>
7070 #include <inttypes.h>
7071 #include <libnut.h>
7072 nut_context_tt * nut;
7073 int main(void) { (void)nut_error(0); return 0; }
7075 _libnut=no
7076 cc_check -lnut && _libnut=yes
7079 if test "$_libnut" = yes ; then
7080 def_libnut='#define CONFIG_LIBNUT 1'
7081 extra_ldflags="$extra_ldflags -lnut"
7082 else
7083 def_libnut='#undef CONFIG_LIBNUT'
7085 echores "$_libnut"
7087 # These VO checks must be done after libavcodec/libswscale one
7088 echocheck "/dev/mga_vid"
7089 if test "$_mga" = auto ; then
7090 _mga=no
7091 test -c /dev/mga_vid && _mga=yes
7093 if test "$_mga" = yes ; then
7094 if test "$_libswscale_internals" = yes ; then
7095 def_mga='#define CONFIG_MGA 1'
7096 _vomodules="mga $_vomodules"
7097 else
7098 _res_comment="libswscale internal headers are required by mga, sorry"
7099 def_mga='#undef CONFIG_MGA'
7100 _novomodules="mga $_novomodules"
7102 else
7103 def_mga='#undef CONFIG_MGA'
7104 _novomodules="mga $_novomodules"
7106 echores "$_mga"
7109 echocheck "xmga"
7110 if test "$_xmga" = auto ; then
7111 _xmga=no
7112 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
7114 if test "$_xmga" = yes ; then
7115 if test "$_libswscale_internals" = yes ; then
7116 def_xmga='#define CONFIG_XMGA 1'
7117 _vomodules="xmga $_vomodules"
7118 else
7119 _res_comment="libswscale internal headers are required by mga, sorry"
7120 def_xmga='#undef CONFIG_XMGA'
7121 _novomodules="xmga $_novomodules"
7123 else
7124 def_xmga='#undef CONFIG_XMGA'
7125 _novomodules="xmga $_novomodules"
7127 echores "$_xmga"
7129 echocheck "zr"
7130 if test "$_zr" = auto ; then
7131 #36067's seem to identify themselves as 36057PQC's, so the line
7132 #below should work for 36067's and 36057's.
7133 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7134 _zr=yes
7135 else
7136 _zr=no
7139 if test "$_zr" = yes ; then
7140 if test "$_libavcodec_internals" = yes ; then
7141 def_zr='#define CONFIG_ZR 1'
7142 _vomodules="zr zr2 $_vomodules"
7143 else
7144 _res_comment="libavcodec internal headers are required by zr, sorry"
7145 _novomodules="zr $_novomodules"
7146 def_zr='#undef CONFIG_ZR'
7148 else
7149 def_zr='#undef CONFIG_ZR'
7150 _novomodules="zr zr2 $_novomodules"
7152 echores "$_zr"
7154 # mencoder requires (optional) those libs: libmp3lame
7155 if test "$_mencoder" != no ; then
7157 echocheck "libmp3lame"
7158 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7159 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7160 if test "$_mp3lame" = auto ; then
7161 _mp3lame=no
7162 cat > $TMPC <<EOF
7163 #include <lame/lame.h>
7164 int main(void) { lame_version_t lv; (void) lame_init();
7165 get_lame_version_numerical(&lv);
7166 return 0; }
7168 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7170 if test "$_mp3lame" = yes ; then
7171 def_mp3lame="#define CONFIG_MP3LAME 1"
7172 _ld_mp3lame=-lmp3lame
7173 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7174 cat > $TMPC << EOF
7175 #include <lame/lame.h>
7176 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7178 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7179 cat > $TMPC << EOF
7180 #include <lame/lame.h>
7181 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7183 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7184 else
7185 def_mp3lame='#undef CONFIG_MP3LAME'
7187 echores "$_mp3lame"
7189 fi # test "$_mencoder" != no
7191 echocheck "mencoder"
7192 if test "$_mencoder" = yes ; then
7193 def_muxers='#define CONFIG_MUXERS 1'
7194 else
7195 def_muxers='#define CONFIG_MUXERS 0'
7197 echores "$_mencoder"
7200 echocheck "UnRAR executable"
7201 if test "$_unrar_exec" = auto ; then
7202 _unrar_exec="yes"
7203 mingw32 && _unrar_exec="no"
7205 if test "$_unrar_exec" = yes ; then
7206 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7207 else
7208 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7210 echores "$_unrar_exec"
7212 echocheck "TV interface"
7213 if test "$_tv" = yes ; then
7214 def_tv='#define CONFIG_TV 1'
7215 _inputmodules="tv $_inputmodules"
7216 else
7217 _noinputmodules="tv $_noinputmodules"
7218 def_tv='#undef CONFIG_TV'
7220 echores "$_tv"
7223 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7224 echocheck "*BSD BT848 bt8xx header"
7225 _ioctl_bt848_h=no
7226 for file in "machine/ioctl_bt848.h" \
7227 "dev/bktr/ioctl_bt848.h" \
7228 "dev/video/bktr/ioctl_bt848.h" \
7229 "dev/ic/bt8xx.h" ; do
7230 cat > $TMPC <<EOF
7231 #include <sys/types.h>
7232 #include <sys/ioctl.h>
7233 #include <$file>
7234 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7236 if cc_check ; then
7237 _ioctl_bt848_h=yes
7238 _ioctl_bt848_h_name="$file"
7239 break;
7241 done
7242 if test "$_ioctl_bt848_h" = yes ; then
7243 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7244 _res_comment="using $_ioctl_bt848_h_name"
7245 else
7246 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7248 echores "$_ioctl_bt848_h"
7250 echocheck "*BSD ioctl_meteor.h"
7251 _ioctl_meteor_h=no
7252 for file in "machine/ioctl_meteor.h" \
7253 "dev/bktr/ioctl_meteor.h" \
7254 "dev/video/bktr/ioctl_meteor.h" ; do
7255 cat > $TMPC <<EOF
7256 #include <sys/types.h>
7257 #include <$file>
7258 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7260 if cc_check ; then
7261 _ioctl_meteor_h=yes
7262 _ioctl_meteor_h_name="$file"
7263 break;
7265 done
7266 if test "$_ioctl_meteor_h" = yes ; then
7267 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7268 _res_comment="using $_ioctl_meteor_h_name"
7269 else
7270 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7272 echores "$_ioctl_meteor_h"
7274 echocheck "*BSD BrookTree 848 TV interface"
7275 if test "$_tv_bsdbt848" = auto ; then
7276 _tv_bsdbt848=no
7277 if test "$_tv" = yes ; then
7278 cat > $TMPC <<EOF
7279 #include <sys/types.h>
7280 $def_ioctl_meteor_h_name
7281 $def_ioctl_bt848_h_name
7282 #ifdef IOCTL_METEOR_H_NAME
7283 #include IOCTL_METEOR_H_NAME
7284 #endif
7285 #ifdef IOCTL_BT848_H_NAME
7286 #include IOCTL_BT848_H_NAME
7287 #endif
7288 int main(void) {
7289 ioctl(0, METEORSINPUT, 0);
7290 ioctl(0, TVTUNER_GETFREQ, 0);
7291 return 0;
7294 cc_check && _tv_bsdbt848=yes
7297 if test "$_tv_bsdbt848" = yes ; then
7298 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7299 _inputmodules="tv-bsdbt848 $_inputmodules"
7300 else
7301 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7302 _noinputmodules="tv-bsdbt848 $_noinputmodules"
7304 echores "$_tv_bsdbt848"
7305 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7308 echocheck "DirectShow TV interface"
7309 if test "$_tv_dshow" = auto ; then
7310 _tv_dshow=no
7311 if test "$_tv" = yes && win32 ; then
7312 cat > $TMPC <<EOF
7313 #include <ole2.h>
7314 int main(void) {
7315 void* p;
7316 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7317 return 0;
7320 cc_check -lole32 -luuid && _tv_dshow=yes
7323 if test "$_tv_dshow" = yes ; then
7324 _inputmodules="tv-dshow $_inputmodules"
7325 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7326 extra_ldflags="$extra_ldflags -lole32 -luuid"
7327 else
7328 _noinputmodules="tv-dshow $_noinputmodules"
7329 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7331 echores "$_tv_dshow"
7334 echocheck "Video 4 Linux TV interface"
7335 if test "$_tv_v4l1" = auto ; then
7336 _tv_v4l1=no
7337 if test "$_tv" = yes && linux ; then
7338 cat > $TMPC <<EOF
7339 #include <stdlib.h>
7340 #include <linux/videodev.h>
7341 int main(void) { return 0; }
7343 cc_check && _tv_v4l1=yes
7346 if test "$_tv_v4l1" = yes ; then
7347 _audio_input=yes
7348 _tv_v4l=yes
7349 def_tv_v4l='#define CONFIG_TV_V4L 1'
7350 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7351 _inputmodules="tv-v4l $_inputmodules"
7352 else
7353 _noinputmodules="tv-v4l1 $_noinputmodules"
7354 def_tv_v4l='#undef CONFIG_TV_V4L'
7356 echores "$_tv_v4l1"
7359 echocheck "Video 4 Linux 2 TV interface"
7360 if test "$_tv_v4l2" = auto ; then
7361 _tv_v4l2=no
7362 if test "$_tv" = yes && linux ; then
7363 cat > $TMPC <<EOF
7364 #include <stdlib.h>
7365 #include <linux/types.h>
7366 #include <linux/videodev2.h>
7367 int main(void) { return 0; }
7369 cc_check && _tv_v4l2=yes
7372 if test "$_tv_v4l2" = yes ; then
7373 _audio_input=yes
7374 _tv_v4l=yes
7375 def_tv_v4l='#define CONFIG_TV_V4L 1'
7376 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7377 _inputmodules="tv-v4l2 $_inputmodules"
7378 else
7379 _noinputmodules="tv-v4l2 $_noinputmodules"
7380 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7382 echores "$_tv_v4l2"
7385 echocheck "Radio interface"
7386 if test "$_radio" = yes ; then
7387 def_radio='#define CONFIG_RADIO 1'
7388 _inputmodules="radio $_inputmodules"
7389 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7390 _radio_capture=no
7392 if test "$_radio_capture" = yes ; then
7393 _audio_input=yes
7394 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7395 else
7396 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7398 else
7399 _noinputmodules="radio $_noinputmodules"
7400 def_radio='#undef CONFIG_RADIO'
7401 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7402 _radio_capture=no
7404 echores "$_radio"
7405 echocheck "Capture for Radio interface"
7406 echores "$_radio_capture"
7408 echocheck "Video 4 Linux 2 Radio interface"
7409 if test "$_radio_v4l2" = auto ; then
7410 _radio_v4l2=no
7411 if test "$_radio" = yes && linux ; then
7412 cat > $TMPC <<EOF
7413 #include <stdlib.h>
7414 #include <linux/types.h>
7415 #include <linux/videodev2.h>
7416 int main(void) { return 0; }
7418 cc_check && _radio_v4l2=yes
7421 if test "$_radio_v4l2" = yes ; then
7422 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7423 else
7424 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7426 echores "$_radio_v4l2"
7428 echocheck "Video 4 Linux Radio interface"
7429 if test "$_radio_v4l" = auto ; then
7430 _radio_v4l=no
7431 if test "$_radio" = yes && linux ; then
7432 cat > $TMPC <<EOF
7433 #include <stdlib.h>
7434 #include <linux/videodev.h>
7435 int main(void) { return 0; }
7437 cc_check && _radio_v4l=yes
7440 if test "$_radio_v4l" = yes ; then
7441 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7442 else
7443 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7445 echores "$_radio_v4l"
7447 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7448 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7449 echocheck "*BSD BrookTree 848 Radio interface"
7450 _radio_bsdbt848=no
7451 cat > $TMPC <<EOF
7452 #include <sys/types.h>
7453 $def_ioctl_bt848_h_name
7454 #ifdef IOCTL_BT848_H_NAME
7455 #include IOCTL_BT848_H_NAME
7456 #endif
7457 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7459 cc_check && _radio_bsdbt848=yes
7460 echores "$_radio_bsdbt848"
7461 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7463 if test "$_radio_bsdbt848" = yes ; then
7464 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7465 else
7466 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7469 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7470 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7471 die "Radio driver requires BSD BT848, V4L or V4L2!"
7474 echocheck "Video 4 Linux 2 MPEG PVR interface"
7475 if test "$_pvr" = auto ; then
7476 _pvr=no
7477 if test "$_tv_v4l2" = yes && linux ; then
7478 cat > $TMPC <<EOF
7479 #include <stdlib.h>
7480 #include <inttypes.h>
7481 #include <linux/types.h>
7482 #include <linux/videodev2.h>
7483 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7485 cc_check && _pvr=yes
7488 if test "$_pvr" = yes ; then
7489 def_pvr='#define CONFIG_PVR 1'
7490 _inputmodules="pvr $_inputmodules"
7491 else
7492 _noinputmodules="pvr $_noinputmodules"
7493 def_pvr='#undef CONFIG_PVR'
7495 echores "$_pvr"
7498 echocheck "ftp"
7499 if ! beos && test "$_ftp" = yes ; then
7500 def_ftp='#define CONFIG_FTP 1'
7501 _inputmodules="ftp $_inputmodules"
7502 else
7503 _noinputmodules="ftp $_noinputmodules"
7504 def_ftp='#undef CONFIG_FTP'
7506 echores "$_ftp"
7508 echocheck "vstream client"
7509 if test "$_vstream" = auto ; then
7510 _vstream=no
7511 cat > $TMPC <<EOF
7512 #include <vstream-client.h>
7513 void vstream_error(const char *format, ... ) {}
7514 int main(void) { vstream_start(); return 0; }
7516 cc_check -lvstream-client && _vstream=yes
7518 if test "$_vstream" = yes ; then
7519 def_vstream='#define CONFIG_VSTREAM 1'
7520 _inputmodules="vstream $_inputmodules"
7521 extra_ldflags="$extra_ldflags -lvstream-client"
7522 else
7523 _noinputmodules="vstream $_noinputmodules"
7524 def_vstream='#undef CONFIG_VSTREAM'
7526 echores "$_vstream"
7529 echocheck "OSD menu"
7530 if test "$_menu" = yes ; then
7531 def_menu='#define CONFIG_MENU 1'
7532 test $_dvbin = "yes" && _menu_dvbin=yes
7533 else
7534 def_menu='#undef CONFIG_MENU'
7535 _menu_dvbin=no
7537 echores "$_menu"
7540 echocheck "Subtitles sorting"
7541 if test "$_sortsub" = yes ; then
7542 def_sortsub='#define CONFIG_SORTSUB 1'
7543 else
7544 def_sortsub='#undef CONFIG_SORTSUB'
7546 echores "$_sortsub"
7549 echocheck "XMMS inputplugin support"
7550 if test "$_xmms" = yes ; then
7551 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7552 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7553 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7554 else
7555 _xmmsplugindir=/usr/lib/xmms/Input
7556 _xmmslibdir=/usr/lib
7559 def_xmms='#define CONFIG_XMMS 1'
7560 if darwin ; then
7561 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7562 else
7563 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7565 else
7566 def_xmms='#undef CONFIG_XMMS'
7568 echores "$_xmms"
7570 if test "$_charset" != "noconv" ; then
7571 def_charset="#define MSG_CHARSET \"$_charset\""
7572 else
7573 def_charset="#undef MSG_CHARSET"
7574 _charset="UTF-8"
7577 if test -n "$_charset" && test "$_charset" != "UTF-8" ; then
7578 echocheck "iconv program"
7579 iconv -f UTF-8 -t $_charset ${_mp_help} > /dev/null 2>> "$TMPLOG"
7580 if test "$?" -ne 0 ; then
7581 echores "no"
7582 echo "No working iconv program found, use "
7583 echo "--charset=UTF-8 to continue anyway."
7584 echo "If you also have problems with iconv library functions use --charset=noconv."
7585 exit 1
7586 else
7587 echores "yes"
7591 #############################################################################
7593 echocheck "automatic gdb attach"
7594 if test "$_crash_debug" = yes ; then
7595 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
7596 else
7597 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
7598 _crash_debug=no
7600 echores "$_crash_debug"
7602 echocheck "compiler support for noexecstack"
7603 cat > $TMPC <<EOF
7604 int main(void) { return 0; }
7606 if cc_check -Wl,-z,noexecstack ; then
7607 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
7608 echores "yes"
7609 else
7610 echores "no"
7614 # Dynamic linking flags
7615 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7616 _ld_dl_dynamic=''
7617 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7618 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
7619 _ld_dl_dynamic='-rdynamic'
7622 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7623 bsdos && extra_ldflags="$extra_ldflags -ldvd"
7624 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
7626 def_debug='#undef MP_DEBUG'
7627 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
7630 echocheck "joystick"
7631 def_joystick='#undef CONFIG_JOYSTICK'
7632 if test "$_joystick" = yes ; then
7633 if linux ; then
7634 # TODO add some check
7635 def_joystick='#define CONFIG_JOYSTICK 1'
7636 else
7637 _joystick="no"
7638 _res_comment="unsupported under $system_name"
7641 echores "$_joystick"
7643 echocheck "lirc"
7644 if test "$_lirc" = auto ; then
7645 _lirc=no
7646 cat > $TMPC <<EOF
7647 #include <lirc/lirc_client.h>
7648 int main(void) { return 0; }
7650 cc_check -llirc_client && _lirc=yes
7652 if test "$_lirc" = yes ; then
7653 def_lirc='#define CONFIG_LIRC 1'
7654 libs_mplayer="$libs_mplayer -llirc_client"
7655 else
7656 def_lirc='#undef CONFIG_LIRC'
7658 echores "$_lirc"
7660 echocheck "lircc"
7661 if test "$_lircc" = auto ; then
7662 _lircc=no
7663 cat > $TMPC <<EOF
7664 #include <lirc/lircc.h>
7665 int main(void) { return 0; }
7667 cc_check -llircc && _lircc=yes
7669 if test "$_lircc" = yes ; then
7670 def_lircc='#define CONFIG_LIRCC 1'
7671 libs_mplayer="$libs_mplayer -llircc"
7672 else
7673 def_lircc='#undef CONFIG_LIRCC'
7675 echores "$_lircc"
7677 if arm; then
7678 # Detect maemo development platform libraries availability (http://www.maemo.org),
7679 # they are used when run on Nokia 770|8x0
7680 echocheck "maemo (Nokia 770|8x0)"
7681 if test "$_maemo" = auto ; then
7682 _maemo=no
7683 cat > $TMPC << EOF
7684 #include <libosso.h>
7685 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7687 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7689 if test "$_maemo" = yes ; then
7690 def_maemo='#define CONFIG_MAEMO 1'
7691 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7692 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7693 else
7694 def_maemo='#undef CONFIG_MAEMO'
7696 echores "$_maemo"
7699 #############################################################################
7701 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7702 # the OMF format needs to come after the 'extern symbol prefix' check, which
7703 # uses nm.
7704 if os2 ; then
7705 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7708 # linker paths should be the same for mencoder and mplayer
7709 _ld_tmp=""
7710 for I in $libs_mplayer ; do
7711 _tmp=$(echo $I | sed -e 's/^-L.*$//')
7712 if test -z "$_tmp" ; then
7713 extra_ldflags="$extra_ldflags $I"
7714 else
7715 _ld_tmp="$_ld_tmp $I"
7717 done
7718 libs_mplayer=$_ld_tmp
7721 #############################################################################
7722 # 64 bit file offsets?
7723 if test "$_largefiles" = yes || freebsd ; then
7724 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7725 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7726 # dvdread support requires this (for off64_t)
7727 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7731 CXXFLAGS=" $CFLAGS -Iffmpeg -D__STDC_LIMIT_MACROS"
7733 # This must be the last test to be performed. Any other tests following it
7734 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7735 # against libdvdread (to permit MPlayer to use its own copy of the library).
7736 # So any compilation using the flags added here but not linking against
7737 # libdvdread can fail.
7738 echocheck "DVD support (libdvdnav)"
7739 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7740 _dvdnav=no
7742 dvdnav_internal=no
7743 if test "$_dvdnav" = auto ; then
7744 if test "$_dvdread_internal" = yes ; then
7745 _dvdnav=yes
7746 dvdnav_internal=yes
7747 _res_comment="internal"
7748 else
7749 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7752 if test "$_dvdnav" = auto ; then
7753 cat > $TMPC <<EOF
7754 #include <inttypes.h>
7755 #include <dvdnav/dvdnav.h>
7756 int main(void) { dvdnav_t *dvd=0; return 0; }
7758 _dvdnav=no
7759 _dvdnavdir=$($_dvdnavconfig --cflags)
7760 _dvdnavlibs=$($_dvdnavconfig --libs)
7761 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7763 if test "$_dvdnav" = yes ; then
7764 _largefiles=yes
7765 def_dvdnav='#define CONFIG_DVDNAV 1'
7766 if test "$dvdnav_internal" = yes ; then
7767 cflags_libdvdnav="-Ilibdvdnav"
7768 _inputmodules="dvdnav(internal) $_inputmodules"
7769 else
7770 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7771 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7772 _inputmodules="dvdnav $_inputmodules"
7774 else
7775 def_dvdnav='#undef CONFIG_DVDNAV'
7776 _noinputmodules="dvdnav $_noinputmodules"
7778 echores "$_dvdnav"
7780 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7781 # Read dvdnav comment above.
7783 #############################################################################
7784 echo "Creating config.mak"
7785 cat > config.mak << EOF
7786 # -------- Generated by configure -----------
7788 # Ensure that locale settings do not interfere with shell commands.
7789 export LC_ALL = C
7791 CONFIGURATION = $_configuration
7793 CHARSET = $_charset
7794 DOC_LANGS = $language_doc
7795 DOC_LANG_ALL = $doc_lang_all
7796 MAN_LANGS = $language_man
7797 MAN_LANG_ALL = $man_lang_all
7799 prefix = \$(DESTDIR)$_prefix
7800 BINDIR = \$(DESTDIR)$_bindir
7801 DATADIR = \$(DESTDIR)$_datadir
7802 LIBDIR = \$(DESTDIR)$_libdir
7803 MANDIR = \$(DESTDIR)$_mandir
7804 CONFDIR = \$(DESTDIR)$_confdir
7806 AR = $_ar
7807 AS = $_cc
7808 CC = $_cc
7809 CXX = $_cc
7810 HOST_CC = $_host_cc
7811 YASM = $_yasm
7812 INSTALL = $_install
7813 INSTALLSTRIP = $_install_strip
7814 RANLIB = $_ranlib
7815 WINDRES = $_windres
7817 CFLAGS = $CFLAGS $extra_cflags
7818 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
7819 CFLAGS_DHAHELPER = $cflags_dhahelper
7820 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7821 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7822 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7823 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7824 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7825 CFLAGS_STACKREALIGN = $cflags_stackrealign
7826 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7827 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7828 YASMFLAGS = $YASMFLAGS
7830 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7831 EXTRALIBS_MPLAYER = $libs_mplayer
7832 EXTRALIBS_MENCODER = $libs_mencoder
7834 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 &,"
7835 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 &,"
7837 GETCH = $_getch
7838 HELP_FILE = $_mp_help
7839 TIMER = $_timer
7841 EXESUF = $_exesuf
7842 EXESUFS_ALL = .exe
7844 $_target_arch
7845 $_target_subarch
7846 $(echo $_cpuexts | tr '[a-z] ' '[A-Z]\n' | sed 's/^/HAVE_/;s/$/=yes/')
7848 MENCODER = $_mencoder
7849 MPLAYER = $_mplayer
7851 NEED_GETTIMEOFDAY = $_need_gettimeofday
7852 NEED_GLOB = $_need_glob
7853 NEED_MMAP = $_need_mmap
7854 NEED_SETENV = $_need_setenv
7855 NEED_SHMEM = $_need_shmem
7856 NEED_STRSEP = $_need_strsep
7857 NEED_SWAB = $_need_swab
7858 NEED_VSSCANF = $_need_vsscanf
7860 # features
7861 3DFX = $_3dfx
7862 AA = $_aa
7863 ALSA1X = $_alsa1x
7864 ALSA9 = $_alsa9
7865 ALSA5 = $_alsa5
7866 APPLE_IR = $_apple_ir
7867 APPLE_REMOTE = $_apple_remote
7868 ARTS = $_arts
7869 AUDIO_INPUT = $_audio_input
7870 BITMAP_FONT = $_bitmap_font
7871 BL = $_bl
7872 CACA = $_caca
7873 CDDA = $_cdda
7874 CDDB = $_cddb
7875 COREAUDIO = $_coreaudio
7876 COREVIDEO = $_corevideo
7877 DART = $_dart
7878 DFBMGA = $_dfbmga
7879 DGA = $_dga
7880 DIRECT3D = $_direct3d
7881 DIRECTFB = $_directfb
7882 DIRECTX = $_directx
7883 DVBIN = $_dvbin
7884 DVDNAV = $_dvdnav
7885 DVDNAV_INTERNAL = $dvdnav_internal
7886 DVDREAD = $_dvdread
7887 DVDREAD_INTERNAL = $_dvdread_internal
7888 DXR2 = $_dxr2
7889 DXR3 = $_dxr3
7890 ESD = $_esd
7891 FAAC=$_faac
7892 FAAD = $_faad
7893 FAAD_INTERNAL = $_faad_internal
7894 FASTMEMCPY = $_fastmemcpy
7895 FBDEV = $_fbdev
7896 FREETYPE = $_freetype
7897 FTP = $_ftp
7898 GIF = $_gif
7899 GGI = $_ggi
7900 GL = $_gl
7901 GL_WIN32 = $_gl_win32
7902 GL_X11 = $_gl_x11
7903 MATRIXVIEW = $matrixview
7904 HAVE_POSIX_SELECT = $_posix_select
7905 HAVE_SYS_MMAN_H = $_mman
7906 IVTV = $_ivtv
7907 JACK = $_jack
7908 JOYSTICK = $_joystick
7909 JPEG = $_jpeg
7910 KVA = $_kva
7911 LADSPA = $_ladspa
7912 LIBA52 = $_liba52
7913 LIBA52_INTERNAL = $_liba52_internal
7914 LIBASS = $_ass
7915 LIBBS2B = $_libbs2b
7916 LIBDCA = $_libdca
7917 LIBDV = $_libdv
7918 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7919 LIBLZO = $_liblzo
7920 LIBMAD = $_mad
7921 LIBMENU = $_menu
7922 LIBMENU_DVBIN = $_menu_dvbin
7923 LIBMPEG2 = $_libmpeg2
7924 LIBNEMESI = $_nemesi
7925 LIBNUT = $_libnut
7926 LIBSMBCLIENT = $_smb
7927 LIBTHEORA = $_theora
7928 LIRC = $_lirc
7929 LIVE555 = $_live
7930 MACOSX_BUNDLE = $_macosx_bundle
7931 MACOSX_FINDER = $_macosx_finder
7932 MD5SUM = $_md5sum
7933 MGA = $_mga
7934 MNG = $_mng
7935 MP3LAME = $_mp3lame
7936 MP3LIB = $_mp3lib
7937 MUSEPACK = $_musepack
7938 NAS = $_nas
7939 NATIVE_RTSP = $_native_rtsp
7940 NETWORK = $_network
7941 OPENAL = $_openal
7942 OSS = $_ossaudio
7943 PE_EXECUTABLE = $_pe_executable
7944 PNG = $_png
7945 PNM = $_pnm
7946 PRIORITY = $_priority
7947 PULSE = $_pulse
7948 PVR = $_pvr
7949 QTX_CODECS = $_qtx
7950 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7951 QTX_EMULATION = $_qtx_emulation
7952 QUARTZ = $_quartz
7953 RADIO=$_radio
7954 RADIO_CAPTURE=$_radio_capture
7955 REAL_CODECS = $_real
7956 S3FB = $_s3fb
7957 SDL = $_sdl
7958 SPEEX = $_speex
7959 STREAM_CACHE = $_stream_cache
7960 SGIAUDIO = $_sgiaudio
7961 SUNAUDIO = $_sunaudio
7962 SVGA = $_svga
7963 TDFXFB = $_tdfxfb
7964 TDFXVID = $_tdfxvid
7965 TGA = $_tga
7966 TOOLAME=$_toolame
7967 TREMOR_INTERNAL = $_tremor_internal
7968 TV = $_tv
7969 TV_BSDBT848 = $_tv_bsdbt848
7970 TV_DSHOW = $_tv_dshow
7971 TV_V4L = $_tv_v4l
7972 TV_V4L1 = $_tv_v4l1
7973 TV_V4L2 = $_tv_v4l2
7974 TWOLAME=$_twolame
7975 UNRAR_EXEC = $_unrar_exec
7976 V4L2 = $_v4l2
7977 VCD = $_vcd
7978 VDPAU = $_vdpau
7979 VESA = $_vesa
7980 VIDIX = $_vidix
7981 VIDIX_PCIDB = $_vidix_pcidb_val
7982 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7983 VIDIX_IVTV=$_vidix_drv_ivtv
7984 VIDIX_MACH64=$_vidix_drv_mach64
7985 VIDIX_MGA=$_vidix_drv_mga
7986 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7987 VIDIX_NVIDIA=$_vidix_drv_nvidia
7988 VIDIX_PM2=$_vidix_drv_pm2
7989 VIDIX_PM3=$_vidix_drv_pm3
7990 VIDIX_RADEON=$_vidix_drv_radeon
7991 VIDIX_RAGE128=$_vidix_drv_rage128
7992 VIDIX_S3=$_vidix_drv_s3
7993 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7994 VIDIX_SIS=$_vidix_drv_sis
7995 VIDIX_UNICHROME=$_vidix_drv_unichrome
7996 VORBIS = $_vorbis
7997 VSTREAM = $_vstream
7998 WII = $_wii
7999 WIN32DLL = $_win32dll
8000 WIN32WAVEOUT = $_win32waveout
8001 WIN32_EMULATION = $_win32_emulation
8002 WINVIDIX = $winvidix
8003 X11 = $_x11
8004 X264 = $_x264
8005 XANIM_CODECS = $_xanim
8006 XMGA = $_xmga
8007 XMMS_PLUGINS = $_xmms
8008 XV = $_xv
8009 XVID4 = $_xvid
8010 XVIDIX = $xvidix
8011 XVMC = $_xvmc
8012 XVR100 = $_xvr100
8013 YUV4MPEG = $_yuv4mpeg
8014 ZR = $_zr
8016 # FFmpeg
8017 LIBAVUTIL = $_libavutil
8018 LIBAVCODEC = $_libavcodec
8019 LIBAVFORMAT = $_libavformat
8020 LIBPOSTPROC = $_libpostproc
8021 LIBSWSCALE = $_libswscale
8022 LIBAVCODEC_INTERNALS = $_libavcodec_internals
8023 LIBSWSCALE_INTERNALS = $_libswscale_internals
8024 FFMPEG_SOURCE_PATH = $_ffmpeg_source
8026 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
8027 CONFIG_AANDCT=yes
8028 CONFIG_FFT=yes
8029 CONFIG_FFT_MMX=$fft_mmx
8030 CONFIG_GOLOMB=yes
8031 CONFIG_LPC=yes
8032 CONFIG_MDCT=yes
8033 CONFIG_RDFT=yes
8035 CONFIG_BZLIB=$bzlib
8036 CONFIG_ENCODERS=yes
8037 CONFIG_GPL=yes
8038 CONFIG_MLIB = $_mlib
8039 CONFIG_MUXERS=$_mencoder
8040 CONFIG_VDPAU=$_vdpau
8041 CONFIG_XVMC=$_xvmc
8042 CONFIG_ZLIB=$_zlib
8044 HAVE_PTHREADS = $_pthreads
8045 HAVE_SHM = $_shm
8046 HAVE_W32THREADS = $_w32threads
8047 HAVE_YASM = $_have_yasm
8051 #############################################################################
8053 ff_config_enable () {
8054 _nprefix=$3;
8055 test -z "$_nprefix" && _nprefix='CONFIG'
8056 for part in $1; do
8057 if $(echo $2 | grep -q -E "(^| )$part($| )"); then
8058 echo "#define ${_nprefix}_$part 1"
8059 else
8060 echo "#define ${_nprefix}_$part 0"
8062 done
8065 echo "Creating config.h"
8066 cat > $TMPH << EOF
8067 /*----------------------------------------------------------------------------
8068 ** This file has been automatically generated by configure any changes in it
8069 ** will be lost when you run configure again.
8070 ** Instead of modifying definitions here, use the --enable/--disable options
8071 ** of the configure script! See ./configure --help for details.
8072 *---------------------------------------------------------------------------*/
8074 #ifndef MPLAYER_CONFIG_H
8075 #define MPLAYER_CONFIG_H
8077 /* Undefine this if you do not want to select mono audio (left or right)
8078 with a stereo MPEG layer 2/3 audio stream. The command line option
8079 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8080 right-only), with 0 being the default.
8082 #define CONFIG_FAKE_MONO 1
8084 /* set up audio OUTBURST. Do not change this! */
8085 #define OUTBURST 512
8087 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8088 #undef FAST_OSD
8089 #undef FAST_OSD_TABLE
8091 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8092 #define MPEG12_POSTPROC 1
8093 #define ATTRIBUTE_ALIGNED_MAX 16
8097 #define CONFIGURATION "$_configuration"
8099 #define MPLAYER_DATADIR "$_datadir"
8100 #define MPLAYER_CONFDIR "$_confdir"
8101 #define MPLAYER_LIBDIR "$_libdir"
8103 /* definitions needed by included libraries */
8104 #define HAVE_INTTYPES_H 1
8105 /* libmpeg2 + FFmpeg */
8106 $def_fast_inttypes
8107 /* libdvdcss */
8108 #define HAVE_ERRNO_H 1
8109 /* libdvdcss + libdvdread */
8110 #define HAVE_LIMITS_H 1
8111 /* libdvdcss + libfaad2 */
8112 #define HAVE_UNISTD_H 1
8113 /* libfaad2 + libdvdread */
8114 #define STDC_HEADERS 1
8115 #define HAVE_MEMCPY 1
8116 /* libfaad2 */
8117 #define HAVE_STRING_H 1
8118 #define HAVE_STRINGS_H 1
8119 #define HAVE_SYS_STAT_H 1
8120 #define HAVE_SYS_TYPES_H 1
8121 /* libdvdnav */
8122 #define READ_CACHE_TRACE 0
8123 /* libdvdread */
8124 #define HAVE_DLFCN_H 1
8125 $def_dvdcss
8128 /* system headers */
8129 $def_alloca_h
8130 $def_alsa_asoundlib_h
8131 $def_altivec_h
8132 $def_malloc_h
8133 $def_mman_h
8134 $def_mman_has_map_failed
8135 $def_soundcard_h
8136 $def_sys_asoundlib_h
8137 $def_sys_soundcard_h
8138 $def_sys_sysinfo_h
8139 $def_termios_h
8140 $def_termios_sys_h
8141 $def_winsock2_h
8144 /* system functions */
8145 $def_exp2
8146 $def_exp2f
8147 $def_gethostbyname2
8148 $def_gettimeofday
8149 $def_glob
8150 $def_langinfo
8151 $def_llrint
8152 $def_log2
8153 $def_log2f
8154 $def_lrint
8155 $def_lrintf
8156 $def_map_memalign
8157 $def_memalign
8158 $def_nanosleep
8159 $def_posix_select
8160 $def_round
8161 $def_roundf
8162 $def_select
8163 $def_setenv
8164 $def_shm
8165 $def_strsep
8166 $def_swab
8167 $def_sysi86
8168 $def_sysi86_iv
8169 $def_termcap
8170 $def_termios
8171 $def_truncf
8172 $def_vsscanf
8175 /* system-specific features */
8176 $def_asmalign_pot
8177 $def_builtin_expect
8178 $def_dl
8179 $def_extern_asm
8180 $def_extern_prefix
8181 $def_iconv
8182 $def_kstat
8183 $def_macosx_bundle
8184 $def_macosx_finder
8185 $def_maemo
8186 $def_named_asm_args
8187 $def_priority
8188 $def_quicktime
8189 $def_restrict_keyword
8190 $def_rtc
8191 $def_unrar_exec
8194 /* configurable options */
8195 $def_charset
8196 $def_crash_debug
8197 $def_debug
8198 $def_dynamic_plugins
8199 $def_fastmemcpy
8200 $def_menu
8201 $def_runtime_cpudetection
8202 $def_sighandler
8203 $def_sortsub
8204 $def_stream_cache
8205 $def_pthread_cache
8208 /* CPU stuff */
8209 #define __CPU__ $iproc
8210 $def_words_endian
8211 $def_bigendian
8212 $(ff_config_enable "$_arch_all" "$_arch" "ARCH")
8213 $(ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE")
8216 /* DVD/VCD/CD */
8217 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8218 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8219 $def_bsdi_dvd
8220 $def_cddb
8221 $def_cdio
8222 $def_cdparanoia
8223 $def_cdrom
8224 $def_dvd
8225 $def_dvd_bsd
8226 $def_dvd_darwin
8227 $def_dvd_linux
8228 $def_dvd_openbsd
8229 $def_dvdio
8230 $def_dvdnav
8231 $def_dvdread
8232 $def_hpux_scsi_h
8233 $def_libcdio
8234 $def_sol_scsi_h
8235 $def_vcd
8238 /* codec libraries */
8239 $def_faac
8240 $def_faad
8241 $def_faad_internal
8242 $def_liba52
8243 $def_liba52_internal
8244 $def_libdca
8245 $def_libdv
8246 $def_liblzo
8247 $def_libmpeg2
8248 $def_mad
8249 $def_mp3lame
8250 $def_mp3lame_preset
8251 $def_mp3lame_preset_medium
8252 $def_mp3lib
8253 $def_musepack
8254 $def_speex
8255 $def_theora
8256 $def_toolame
8257 $def_tremor
8258 $def_twolame
8259 $def_vorbis
8260 $def_x264
8261 $def_xvid
8262 $def_zlib
8264 $def_libnut
8267 /* binary codecs */
8268 $def_qtx
8269 $def_qtx_win32
8270 $def_real
8271 $def_real_path
8272 $def_win32_loader
8273 $def_win32dll
8274 #define WIN32_PATH "$_win32codecsdir"
8275 $def_xanim
8276 $def_xanim_path
8277 $def_xmms
8278 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8281 /* Audio output drivers */
8282 $def_alsa
8283 $def_alsa1x
8284 $def_alsa5
8285 $def_alsa9
8286 $def_arts
8287 $def_coreaudio
8288 $def_dart
8289 $def_esd
8290 $def_esd_latency
8291 $def_jack
8292 $def_nas
8293 $def_openal
8294 $def_openal_h
8295 $def_ossaudio
8296 $def_ossaudio_devdsp
8297 $def_ossaudio_devmixer
8298 $def_pulse
8299 $def_sgiaudio
8300 $def_sunaudio
8301 $def_win32waveout
8303 $def_ladspa
8304 $def_libbs2b
8307 /* input */
8308 $def_apple_ir
8309 $def_apple_remote
8310 $def_ioctl_bt848_h_name
8311 $def_ioctl_meteor_h_name
8312 $def_joystick
8313 $def_lirc
8314 $def_lircc
8315 $def_pvr
8316 $def_radio
8317 $def_radio_bsdbt848
8318 $def_radio_capture
8319 $def_radio_v4l
8320 $def_radio_v4l2
8321 $def_tv
8322 $def_tv_bsdbt848
8323 $def_tv_dshow
8324 $def_tv_v4l
8325 $def_tv_v4l1
8326 $def_tv_v4l2
8329 /* font stuff */
8330 $def_ass
8331 $def_bitmap_font
8332 $def_enca
8333 $def_fontconfig
8334 $def_freetype
8335 $def_fribidi
8338 /* networking */
8339 $def_closesocket
8340 $def_ftp
8341 $def_inet6
8342 $def_inet_aton
8343 $def_inet_pton
8344 $def_live
8345 $def_nemesi
8346 $def_network
8347 $def_smb
8348 $def_socklen_t
8349 $def_vstream
8352 /* libvo options */
8353 $def_3dfx
8354 $def_aa
8355 $def_bl
8356 $def_caca
8357 $def_corevideo
8358 $def_dfbmga
8359 $def_dga
8360 $def_dga1
8361 $def_dga2
8362 $def_direct3d
8363 $def_directfb
8364 $def_directfb_version
8365 $def_directx
8366 $def_dvb
8367 $def_dvb_head
8368 $def_dvbin
8369 $def_dxr2
8370 $def_dxr3
8371 $def_fbdev
8372 $def_ggi
8373 $def_ggiwmh
8374 $def_gif
8375 $def_gif_4
8376 $def_gif_tvt_hack
8377 $def_gl
8378 $def_gl_win32
8379 $def_gl_x11
8380 $def_matrixview
8381 $def_ivtv
8382 $def_jpeg
8383 $def_kva
8384 $def_md5sum
8385 $def_mga
8386 $def_mng
8387 $def_png
8388 $def_pnm
8389 $def_quartz
8390 $def_s3fb
8391 $def_sdl
8392 $def_sdl_sdl_h
8393 $def_sdlbuggy
8394 $def_svga
8395 $def_tdfxfb
8396 $def_tdfxvid
8397 $def_tga
8398 $def_v4l2
8399 $def_vdpau
8400 $def_vesa
8401 $def_vidix
8402 $def_vidix_drv_cyberblade
8403 $def_vidix_drv_ivtv
8404 $def_vidix_drv_mach64
8405 $def_vidix_drv_mga
8406 $def_vidix_drv_mga_crtc2
8407 $def_vidix_drv_nvidia
8408 $def_vidix_drv_pm3
8409 $def_vidix_drv_radeon
8410 $def_vidix_drv_rage128
8411 $def_vidix_drv_s3
8412 $def_vidix_drv_sh_veu
8413 $def_vidix_drv_sis
8414 $def_vidix_drv_unichrome
8415 $def_vidix_pfx
8416 $def_vm
8417 $def_wii
8418 $def_x11
8419 $def_xdpms
8420 $def_xf86keysym
8421 $def_xinerama
8422 $def_xmga
8423 $def_xss
8424 $def_xv
8425 $def_xvmc
8426 $def_xvr100
8427 $def_yuv4mpeg
8428 $def_zr
8431 /* FFmpeg */
8432 $def_libavcodec
8433 $def_libavformat
8434 $def_libavutil
8435 $def_libpostproc
8436 $def_libswscale
8437 $def_libavcodec_internals
8438 $def_libswscale_internals
8440 #define CONFIG_DECODERS 1
8441 #define CONFIG_ENCODERS 1
8442 #define CONFIG_DEMUXERS 1
8443 $def_muxers
8445 $def_arpa_inet_h
8446 $def_bswap
8447 $def_bzlib
8448 $def_dcbzl
8449 $def_dos_paths
8450 $def_fast_64bit
8451 $def_fast_unaligned
8452 $def_memalign_hack
8453 $def_mlib
8454 $def_mkstemp
8455 $def_posix_memalign
8456 $def_pthreads
8457 $def_ten_operands
8458 $def_threads
8459 $def_xform_asm
8460 $def_yasm
8462 #define CONFIG_FASTDIV 0
8463 #define CONFIG_FFSERVER 0
8464 #define CONFIG_GPL 1
8465 #define CONFIG_GRAY 0
8466 #define CONFIG_HARDCODED_TABLES 0
8467 #define CONFIG_LIBVORBIS 0
8468 #define CONFIG_POWERPC_PERF 0
8469 #define CONFIG_SMALL 0
8470 #define CONFIG_SWSCALE 1
8471 #define CONFIG_SWSCALE_ALPHA 1
8473 #define HAVE_ATTRIBUTE_PACKED 1
8474 #define HAVE_FAST_CLZ 0
8475 #define HAVE_GETHRTIME 0
8476 #define HAVE_INLINE_ASM 1
8477 #define HAVE_LDBRX 0
8478 #define HAVE_POLL_H 1
8479 #define HAVE_PPC4XX 0
8480 #define HAVE_VIRTUALALLOC 0
8482 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
8483 #define CONFIG_AANDCT 1
8484 #define CONFIG_FFT 1
8485 #define CONFIG_GOLOMB 1
8486 #define CONFIG_LPC 1
8487 #define CONFIG_MDCT 1
8488 #define CONFIG_RDFT 1
8490 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8491 $def_ebx_available
8492 #ifndef MP_DEBUG
8493 #define HAVE_EBP_AVAILABLE 1
8494 #else
8495 #define HAVE_EBP_AVAILABLE 0
8496 #endif
8498 #define CONFIG_H263_VAAPI_HWACCEL 0
8499 #define CONFIG_MPEG2_VAAPI_HWACCEL 0
8500 #define CONFIG_MPEG4_VAAPI_HWACCEL 0
8501 #define CONFIG_H264_VAAPI_HWACCEL 0
8502 #define CONFIG_VC1_VAAPI_HWACCEL 0
8503 #define CONFIG_WMV3_VAAPI_HWACCEL 0
8505 #endif /* MPLAYER_CONFIG_H */
8508 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8509 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8511 #############################################################################
8513 ./version.sh `$_cc -dumpversion`
8515 cat << EOF
8517 Config files successfully generated by ./configure $_configuration !
8519 Install prefix: $_prefix
8520 Data directory: $_datadir
8521 Config direct.: $_confdir
8523 Byte order: $_byte_order
8524 Optimizing for: $_optimizing
8526 Languages:
8527 Messages: $language_msg
8528 Manual pages: $language_man
8529 Documentation: $language_doc
8531 Enabled optional drivers:
8532 Input: $_inputmodules
8533 Codecs: $_codecmodules
8534 Audio output: $_aomodules
8535 Video output: $_vomodules
8537 Disabled optional drivers:
8538 Input: $_noinputmodules
8539 Codecs: $_nocodecmodules
8540 Audio output: $_noaomodules
8541 Video output: $_novomodules
8543 'config.h' and 'config.mak' contain your configuration options.
8544 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8545 compile *** DO NOT REPORT BUGS if you tweak these files ***
8547 'make' will now compile MPlayer and 'make install' will install it.
8548 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8553 if test "$_mtrr" = yes ; then
8554 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
8555 echo
8558 if ! x86_32; then
8559 cat <<EOF
8560 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8561 operating system ($system_name). You may encounter a few files that cannot
8562 be played due to missing open source video/audio codec support.
8568 cat <<EOF
8569 Check $TMPLOG if you wonder why an autodetection failed (make sure
8570 development headers/packages are installed).
8572 NOTE: The --enable-* parameters unconditionally force options on, completely
8573 skipping autodetection. This behavior is unlike what you may be used to from
8574 autoconf-based configure scripts that can decide to override you. This greater
8575 level of control comes at a price. You may have to provide the correct compiler
8576 and linker flags yourself.
8577 If you used one of these options (except --enable-menu and similar ones that
8578 turn on internal features) and experience a compilation or linking failure,
8579 make sure you have passed the necessary compiler/linker flags to configure.
8581 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
8585 if test "$_warn_CFLAGS" = yes; then
8586 cat <<EOF
8588 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
8589 but:
8591 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8593 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8594 To do so, execute 'CFLAGS= ./configure <options>'
8599 # Last move:
8600 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"