vd_xanim.c: Give functions proper prototypes
[mplayer/glamo.git] / configure
blob7114df32452f221d7dd2d9cb0e09e11619fb1594
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 source="$1"
63 shift
64 echo >> "$TMPLOG"
65 cat "$source" >> "$TMPLOG"
66 echo >> "$TMPLOG"
67 echo "$_cc $source $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
68 rm -f "$TMPEXE"
69 $_cc $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1
70 TMPRES="$?"
71 echo >> "$TMPLOG"
72 echo >> "$TMPLOG"
73 return "$TMPRES"
76 cc_check() {
77 compile_check $TMPC $@
80 cxx_check() {
81 compile_check $TMPCPP $@ -lstdc++
84 function_check() {
85 cat > $TMPC << EOF
86 #include <$1>
87 int main(void) { $2; }
88 EOF
89 shift
90 compile_check $TMPC $@
93 header_check() {
94 cat > $TMPC << EOF
95 #include <$1>
96 int main(void) { return 0; }
97 EOF
98 shift
99 compile_check $TMPC $@
102 yasm_check() {
103 echo >> "$TMPLOG"
104 cat "$TMPS" >> "$TMPLOG"
105 echo >> "$TMPLOG"
106 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
107 rm -f "$TMPEXE"
108 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
109 TMPRES="$?"
110 echo >> "$TMPLOG"
111 echo >> "$TMPLOG"
112 return "$TMPRES"
115 tmp_run() {
116 "$TMPEXE" >> "$TMPLOG" 2>&1
119 # Display error message, flushes tempfile, exit
120 die () {
121 echo
122 echo "Error: $@" >&2
123 echo >&2
124 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
125 echo "Check \"$TMPLOG\" if you do not understand why it failed."
126 exit 1
129 # OS test booleans functions
130 issystem() {
131 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
133 aix() { issystem "AIX"; }
134 amigaos() { issystem "AmigaOS"; }
135 beos() { issystem "BEOS"; }
136 bsdos() { issystem "BSD/OS"; }
137 cygwin() { issystem "CYGWIN"; }
138 darwin() { issystem "Darwin"; }
139 dragonfly() { issystem "DragonFly"; }
140 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
141 gnu() { issystem "GNU"; }
142 hpux() { issystem "HP-UX"; }
143 irix() { issystem "IRIX"; }
144 linux() { issystem "Linux"; }
145 mingw32() { issystem "MINGW32"; }
146 morphos() { issystem "MorphOS"; }
147 netbsd() { issystem "NetBSD"; }
148 openbsd() { issystem "OpenBSD"; }
149 os2() { issystem "OS/2"; }
150 qnx() { issystem "QNX"; }
151 sunos() { issystem "SunOS"; }
152 win32() { cygwin || mingw32; }
154 # arch test boolean functions
155 # x86/x86pc is used by QNX
156 x86_32() {
157 case "$host_arch" in
158 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
159 *) return 1 ;;
160 esac
163 x86_64() {
164 case "$host_arch" in
165 x86_64|amd64) return 0 ;;
166 *) return 1 ;;
167 esac
170 x86() {
171 x86_32 || x86_64
174 ppc() {
175 case "$host_arch" in
176 ppc|ppc64|powerpc|powerpc64) return 0;;
177 *) return 1;;
178 esac
181 alpha() {
182 case "$host_arch" in
183 alpha*) return 0;;
184 *) return 1;;
185 esac
188 arm() {
189 case "$host_arch" in
190 arm*) return 0;;
191 *) return 1;;
192 esac
195 # Use this before starting a check
196 echocheck() {
197 echo "============ Checking for $@ ============" >> "$TMPLOG"
198 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
201 # Use this to echo the results of a check
202 echores() {
203 if test "$res_comment" ; then
204 res_comment="($res_comment)"
206 echo "Result is: $@ $res_comment" >> "$TMPLOG"
207 echo "##########################################" >> "$TMPLOG"
208 echo "" >> "$TMPLOG"
209 echo "$@ $res_comment"
210 res_comment=""
212 #############################################################################
214 # Check how echo works in this /bin/sh
215 case $(echo -n) in
216 -n) _echo_n= _echo_c='\c' ;; # SysV echo
217 *) _echo_n='-n ' _echo_c= ;; # BSD echo
218 esac
220 msg_lang_all=''
221 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
222 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")
223 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
225 show_help(){
226 cat << EOF
227 Usage: $0 [OPTIONS]...
229 Configuration:
230 -h, --help display this help and exit
232 Installation directories:
233 --prefix=DIR prefix directory for installation [/usr/local]
234 --bindir=DIR directory for installing binaries [PREFIX/bin]
235 --datadir=DIR directory for installing machine independent
236 data files (skins, etc) [PREFIX/share/mplayer]
237 --mandir=DIR directory for installing man pages [PREFIX/share/man]
238 --confdir=DIR directory for installing configuration files
239 [PREFIX/etc/mplayer]
240 --localedir=DIR directory for locale tree [PREFIX/share/locale]
241 --libdir=DIR directory for object code libraries [PREFIX/lib]
242 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
244 Optional features:
245 --disable-mencoder disable MEncoder (A/V encoder) compilation [enable]
246 --disable-mplayer disable MPlayer compilation [enable]
247 --disable-largefiles disable support for files > 2GB [enable]
248 --enable-termcap use termcap database for key codes [autodetect]
249 --enable-termios use termios database for key codes [autodetect]
250 --disable-iconv disable iconv for encoding conversion [autodetect]
251 --disable-langinfo do not use langinfo [autodetect]
252 --enable-lirc enable LIRC (remote control) support [autodetect]
253 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
254 --enable-joystick enable joystick support [disable]
255 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
256 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
257 --disable-vm disable X video mode extensions [autodetect]
258 --disable-xf86keysym disable support for multimedia keys [autodetect]
259 --enable-radio enable radio interface [disable]
260 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
261 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
262 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
263 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
264 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
265 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
266 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
267 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
268 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
269 --disable-network disable networking [enable]
270 --enable-winsock2_h enable winsock2_h [autodetect]
271 --enable-smb enable Samba (SMB) input [autodetect]
272 --enable-live enable LIVE555 Streaming Media [autodetect]
273 --enable-nemesi enable Nemesi Streaming Media [autodetect]
274 --disable-vcd disable VCD support [autodetect]
275 --disable-dvdnav disable libdvdnav [autodetect]
276 --disable-dvdread disable libdvdread [autodetect]
277 --disable-dvdread-internal disable internal libdvdread [autodetect]
278 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
279 --disable-cdparanoia disable cdparanoia [autodetect]
280 --disable-cddb disable cddb [autodetect]
281 --disable-bitmap-font disable bitmap font support [enable]
282 --disable-freetype disable FreeType 2 font rendering [autodetect]
283 --disable-fontconfig disable fontconfig font lookup [autodetect]
284 --disable-unrarexec disable using of UnRAR executable [enabled]
285 --enable-menu enable OSD menu (not DVD menu) [disabled]
286 --disable-sortsub disable subtitle sorting [enabled]
287 --enable-fribidi enable the FriBiDi libs [autodetect]
288 --disable-enca disable ENCA charset oracle library [autodetect]
289 --disable-maemo disable maemo specific features [autodetect]
290 --enable-macosx-finder enable Mac OS X Finder invocation parameter
291 parsing [disabled]
292 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
293 --disable-inet6 disable IPv6 support [autodetect]
294 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
295 --disable-ftp disable FTP support [enabled]
296 --disable-vstream disable TiVo vstream client support [autodetect]
297 --disable-pthreads disable Posix threads support [autodetect]
298 --disable-w32threads disable Win32 threads support [autodetect]
299 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
300 --enable-rpath enable runtime linker path for extra libs [disabled]
302 Codecs:
303 --enable-gif enable GIF support [autodetect]
304 --enable-png enable PNG input/output support [autodetect]
305 --enable-mng enable MNG input support [autodetect]
306 --enable-jpeg enable JPEG input/output support [autodetect]
307 --enable-libcdio enable libcdio support [autodetect]
308 --enable-liblzo enable liblzo support [autodetect]
309 --disable-win32dll disable Win32 DLL support [autodetect]
310 --disable-qtx disable QuickTime codecs support [enabled]
311 --disable-xanim disable XAnim codecs support [enabled]
312 --disable-real disable RealPlayer codecs support [enabled]
313 --disable-xvid disable Xvid [autodetect]
314 --disable-x264 disable x264 [autodetect]
315 --disable-libnut disable libnut [autodetect]
316 --disable-libavutil disable libavutil [autodetect]
317 --disable-libavcodec disable libavcodec [autodetect]
318 --disable-libavformat disable libavformat [autodetect]
319 --disable-libpostproc disable libpostproc [autodetect]
320 --disable-libswscale disable libswscale [autodetect]
321 --disable-tremor-internal disable internal Tremor [enabled]
322 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
323 --enable-tremor enable external Tremor [autodetect]
324 --disable-libvorbis disable libvorbis support [autodetect]
325 --disable-speex disable Speex support [autodetect]
326 --enable-theora enable OggTheora libraries [autodetect]
327 --enable-faad enable external FAAD2 (AAC) [autodetect]
328 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
329 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
330 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
331 --disable-ladspa disable LADSPA plugin support [autodetect]
332 --disable-libbs2b disable libbs2b audio filter support [autodetect]
333 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
334 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
335 --disable-mad disable libmad (MPEG audio) support [autodetect]
336 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
337 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
338 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
339 --enable-xmms enable XMMS input plugin support [disabled]
340 --enable-libdca enable libdca support [autodetect]
341 --disable-mp3lib disable builtin mp3lib [autodetect]
342 --disable-liba52 disable liba52 [autodetect]
343 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
344 --disable-musepack disable musepack support [autodetect]
346 Video output:
347 --disable-vidix disable VIDIX [for x86 *nix]
348 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
349 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
350 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
351 --disable-vidix-pcidb disable VIDIX PCI device name database
352 --enable-dhahelper enable VIDIX dhahelper support
353 --enable-svgalib_helper enable VIDIX svgalib_helper support
354 --enable-gl enable OpenGL video output [autodetect]
355 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
356 --enable-dga2 enable DGA 2 support [autodetect]
357 --enable-dga1 enable DGA 1 support [autodetect]
358 --enable-vesa enable VESA video output [autodetect]
359 --enable-svga enable SVGAlib video output [autodetect]
360 --enable-sdl enable SDL video output [autodetect]
361 --enable-kva enable KVA video output [autodetect]
362 --enable-aa enable AAlib video output [autodetect]
363 --enable-caca enable CACA video output [autodetect]
364 --enable-ggi enable GGI video output [autodetect]
365 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
366 --enable-direct3d enable Direct3D video output [autodetect]
367 --enable-directx enable DirectX video output [autodetect]
368 --enable-dxr2 enable DXR2 video output [autodetect]
369 --enable-dxr3 enable DXR3/H+ video output [autodetect]
370 --enable-ivtv enable IVTV TV-Out video output [autodetect]
371 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
372 --enable-dvb enable DVB video output [autodetect]
373 --enable-mga enable mga_vid video output [autodetect]
374 --enable-xmga enable mga_vid X11 video output [autodetect]
375 --enable-xv enable Xv video output [autodetect]
376 --enable-xvmc enable XvMC acceleration [disable]
377 --enable-vdpau enable VDPAU acceleration [autodetect]
378 --enable-vm enable XF86VidMode support [autodetect]
379 --enable-xinerama enable Xinerama support [autodetect]
380 --enable-x11 enable X11 video output [autodetect]
381 --enable-xshape enable XShape support [autodetect]
382 --disable-xss disable screensaver support via xss [autodetect]
383 --enable-fbdev enable FBDev video output [autodetect]
384 --enable-mlib enable mediaLib video output (Solaris) [disable]
385 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
386 --enable-tdfxfb enable tdfxfb video output [disable]
387 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
388 --enable-wii enable Nintendo Wii/GameCube video output [disable]
389 --enable-directfb enable DirectFB video output [autodetect]
390 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
391 --enable-bl enable Blinkenlights video output [disable]
392 --enable-tdfxvid enable tdfx_vid video output [disable]
393 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
394 --disable-tga disable Targa video output [enable]
395 --disable-pnm disable PNM video output [enable]
396 --disable-md5sum disable md5sum video output [enable]
397 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
398 --disable-corevideo disable CoreVideo video output [autodetect]
399 --disable-quartz disable Quartz video output [autodetect]
401 Audio output:
402 --disable-alsa disable ALSA audio output [autodetect]
403 --disable-ossaudio disable OSS audio output [autodetect]
404 --disable-arts disable aRts audio output [autodetect]
405 --disable-esd disable esd audio output [autodetect]
406 --disable-pulse disable Pulseaudio audio output [autodetect]
407 --disable-jack disable JACK audio output [autodetect]
408 --enable-openal enable OpenAL audio output [disable]
409 --disable-nas disable NAS audio output [autodetect]
410 --disable-sgiaudio disable SGI audio output [autodetect]
411 --disable-sunaudio disable Sun audio output [autodetect]
412 --disable-kai disable KAI audio output [autodetect]
413 --disable-dart disable DART audio output [autodetect]
414 --disable-win32waveout disable Windows waveout audio output [autodetect]
415 --disable-coreaudio disable CoreAudio audio output [autodetect]
416 --disable-select disable using select() on the audio device [enable]
418 Language options:
419 --enable-translation enable support for translated output [disable]
420 --charset=charset convert the console messages to this character set
421 --language-doc=lang language to use for the documentation [en]
422 --language-man=lang language to use for the man pages [en]
423 --language-msg=lang extra languages for program messages [all]
424 --language=lang default language to use [en]
425 Specific options override --language. You can pass a list of languages separated
426 by whitespace or commas instead of a single language. Nonexisting translations
427 will be dropped from each list. All translations available in the list will be
428 installed. The value "all" will activate all translations. The LINGUAS
429 environment variable is honored. In all cases the fallback is English.
430 The program always supports English-language output; additional message
431 languages are only installed if --enable-translation is also specified.
432 Available values for --language-doc are: all $doc_lang_all
433 Available values for --language-man are: all $man_lang_all
434 Available values for --language-msg are: all $msg_lang_all
436 Miscellaneous options:
437 --enable-runtime-cpudetection enable runtime CPU detection [disable]
438 --enable-cross-compile enable cross-compilation [autodetect]
439 --cc=COMPILER C compiler to build MPlayer [gcc]
440 --host-cc=COMPILER C compiler for tools needed while building [gcc]
441 --as=ASSEMBLER assembler to build MPlayer [as]
442 --nm=NM nm tool to build MPlayer [nm]
443 --yasm=YASM Yasm assembler to build MPlayer [yasm]
444 --ar=AR librarian to build MPlayer [ar]
445 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
446 --windres=WINDRES windres to build MPlayer [windres]
447 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
448 --enable-static build a statically linked binary
449 --with-install=PATH path to a custom install program
451 Advanced options:
452 --enable-mmx enable MMX [autodetect]
453 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
454 --enable-3dnow enable 3DNow! [autodetect]
455 --enable-3dnowext enable extended 3DNow! [autodetect]
456 --enable-sse enable SSE [autodetect]
457 --enable-sse2 enable SSE2 [autodetect]
458 --enable-ssse3 enable SSSE3 [autodetect]
459 --enable-shm enable shm [autodetect]
460 --enable-altivec enable AltiVec (PowerPC) [autodetect]
461 --enable-armv5te enable DSP extensions (ARM) [autodetect]
462 --enable-armv6 enable ARMv6 (ARM) [autodetect]
463 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
464 --enable-armvfp enable ARM VFP (ARM) [autodetect]
465 --enable-neon enable NEON (ARM) [autodetect]
466 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
467 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
468 --enable-big-endian force byte order to big-endian [autodetect]
469 --enable-debug[=1-3] compile-in debugging information [disable]
470 --enable-profile compile-in profiling information [disable]
471 --disable-sighandler disable sighandler for crashes [enable]
472 --enable-crash-debug enable automatic gdb attach on crash [disable]
473 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
474 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
476 Use these options if autodetection fails:
477 --extra-cflags=FLAGS extra CFLAGS
478 --extra-ldflags=FLAGS extra LDFLAGS
479 --extra-libs=FLAGS extra linker flags
480 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
481 --extra-libs-mencoder=FLAGS extra linker flags for MEncoder
482 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
484 --with-freetype-config=PATH path to freetype-config
485 --with-glib-config=PATH path to glib*-config
486 --with-gtk-config=PATH path to gtk*-config
487 --with-sdl-config=PATH path to sdl*-config
488 --with-dvdnav-config=PATH path to dvdnav-config
489 --with-dvdread-config=PATH path to dvdread-config
491 This configure script is NOT autoconf-based, even though its output is similar.
492 It will try to autodetect all configuration options. If you --enable an option
493 it will be forcefully turned on, skipping autodetection. This can break
494 compilation, so you need to know what you are doing.
496 exit 0
497 } #show_help()
499 # GOTCHA: the variables below defines the default behavior for autodetection
500 # and have - unless stated otherwise - at least 2 states : yes no
501 # If autodetection is available then the third state is: auto
502 _mmx=auto
503 _3dnow=auto
504 _3dnowext=auto
505 _mmxext=auto
506 _sse=auto
507 _sse2=auto
508 _ssse3=auto
509 _cmov=auto
510 _fast_cmov=auto
511 _fast_clz=auto
512 _armv5te=auto
513 _armv6=auto
514 _armv6t2=auto
515 _armvfp=auto
516 neon=auto
517 _iwmmxt=auto
518 _mtrr=auto
519 _altivec=auto
520 _install=install
521 _ranlib=ranlib
522 _windres=windres
523 _cc=cc
524 _ar=ar
525 test "$CC" && _cc="$CC"
526 _as=auto
527 _nm=auto
528 _yasm=yasm
529 _runtime_cpudetection=no
530 _cross_compile=auto
531 _prefix="/usr/local"
532 _libavutil=auto
533 _libavcodec=auto
534 _libavformat=auto
535 _libpostproc=auto
536 _libswscale=auto
537 _libavcodec_internals=no
538 _libswscale_internals=no
539 _mencoder=yes
540 _mplayer=yes
541 _x11=auto
542 _xshape=auto
543 _xss=auto
544 _dga1=auto
545 _dga2=auto
546 _xv=auto
547 _xvmc=no #auto when complete
548 _vdpau=auto
549 _sdl=auto
550 _kva=auto
551 _direct3d=auto
552 _directx=auto
553 _win32waveout=auto
554 _nas=auto
555 _png=auto
556 _mng=auto
557 _jpeg=auto
558 _pnm=yes
559 _md5sum=yes
560 _yuv4mpeg=yes
561 _gif=auto
562 _gl=auto
563 matrixview=yes
564 _ggi=auto
565 _ggiwmh=auto
566 _aa=auto
567 _caca=auto
568 _svga=auto
569 _vesa=auto
570 _fbdev=auto
571 _dvb=auto
572 _dxr2=auto
573 _dxr3=auto
574 _ivtv=auto
575 _v4l2=auto
576 _iconv=auto
577 _langinfo=auto
578 _rtc=auto
579 _ossaudio=auto
580 _arts=auto
581 _esd=auto
582 _pulse=auto
583 _jack=auto
584 _kai=auto
585 _dart=auto
586 _openal=no
587 _libcdio=auto
588 _liblzo=auto
589 _mad=auto
590 _mp3lame=auto
591 _toolame=auto
592 _twolame=auto
593 _tremor=auto
594 _tremor_internal=yes
595 _tremor_low=no
596 _libvorbis=auto
597 _speex=auto
598 _theora=auto
599 _mpg123=auto
600 _mp3lib=auto
601 _liba52=auto
602 _libdca=auto
603 _libmpeg2=auto
604 _faad=auto
605 _faad_internal=auto
606 _faad_fixed=no
607 _faac=auto
608 _ladspa=auto
609 _libbs2b=auto
610 _xmms=no
611 _vcd=auto
612 _dvdnav=auto
613 _dvdnavconfig=dvdnav-config
614 _dvdreadconfig=dvdread-config
615 _dvdread=auto
616 _dvdread_internal=auto
617 _libdvdcss_internal=auto
618 _xanim=auto
619 _real=auto
620 _live=auto
621 _nemesi=auto
622 _native_rtsp=yes
623 _xinerama=auto
624 _mga=auto
625 _xmga=auto
626 _vm=auto
627 _xf86keysym=auto
628 _mlib=no #broken, thus disabled
629 _sgiaudio=auto
630 _sunaudio=auto
631 _alsa=auto
632 _fastmemcpy=yes
633 _unrar_exec=auto
634 _win32dll=auto
635 _select=yes
636 _radio=no
637 _radio_capture=no
638 _radio_v4l=auto
639 _radio_v4l2=auto
640 _radio_bsdbt848=auto
641 _tv=yes
642 _tv_v4l1=auto
643 _tv_v4l2=auto
644 _tv_bsdbt848=auto
645 _tv_dshow=auto
646 _pvr=auto
647 _network=yes
648 _winsock2_h=auto
649 _smb=auto
650 _vidix=auto
651 _vidix_pcidb=yes
652 _dhahelper=no
653 _svgalib_helper=no
654 _joystick=no
655 _xvid=auto
656 _x264=auto
657 _libnut=auto
658 _lirc=auto
659 _lircc=auto
660 _apple_remote=auto
661 _apple_ir=auto
662 _gui=no
663 _gtk1=no
664 _termcap=auto
665 _termios=auto
666 _3dfx=no
667 _s3fb=no
668 _wii=no
669 _tdfxfb=no
670 _tdfxvid=no
671 _xvr100=auto
672 _tga=yes
673 _directfb=auto
674 _zr=auto
675 _bl=no
676 _largefiles=yes
677 #language=en
678 _shm=auto
679 _translation=no
680 _charset="UTF-8"
681 _dynamic_plugins=no
682 _crash_debug=no
683 _sighandler=yes
684 _libdv=auto
685 _cdparanoia=auto
686 _cddb=auto
687 _big_endian=auto
688 _bitmap_font=yes
689 _freetype=auto
690 _fontconfig=auto
691 _menu=no
692 _qtx=auto
693 _maemo=auto
694 _coreaudio=auto
695 _corevideo=auto
696 _quartz=auto
697 quicktime=auto
698 _macosx_finder=no
699 _macosx_bundle=auto
700 _sortsub=yes
701 _freetypeconfig='freetype-config'
702 _fribidi=auto
703 _enca=auto
704 _inet6=auto
705 _gethostbyname2=auto
706 _ftp=yes
707 _musepack=auto
708 _vstream=auto
709 _pthreads=auto
710 _w32threads=auto
711 _ass=auto
712 _rpath=no
713 _asmalign_pot=auto
714 _stream_cache=yes
715 _priority=no
716 def_dos_paths="#define HAVE_DOS_PATHS 0"
717 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
718 def_priority="#undef CONFIG_PRIORITY"
719 def_pthread_cache="#undef PTHREAD_CACHE"
720 _need_shmem=yes
721 for ac_option do
722 case "$ac_option" in
723 --help|-help|-h)
724 show_help
726 --prefix=*)
727 _prefix=$(echo $ac_option | cut -d '=' -f 2)
729 --bindir=*)
730 _bindir=$(echo $ac_option | cut -d '=' -f 2)
732 --datadir=*)
733 _datadir=$(echo $ac_option | cut -d '=' -f 2)
735 --mandir=*)
736 _mandir=$(echo $ac_option | cut -d '=' -f 2)
738 --confdir=*)
739 _confdir=$(echo $ac_option | cut -d '=' -f 2)
741 --libdir=*)
742 _libdir=$(echo $ac_option | cut -d '=' -f 2)
744 --codecsdir=*)
745 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
747 --localedir=*)
748 _localedir=$(echo $ac_option | cut -d '=' -f 2)
751 --with-install=*)
752 _install=$(echo $ac_option | cut -d '=' -f 2 )
754 --with-xvmclib=*)
755 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
758 --with-sdl-config=*)
759 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
761 --with-freetype-config=*)
762 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
764 --with-gtk-config=*)
765 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
767 --with-glib-config=*)
768 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
770 --with-dvdnav-config=*)
771 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
773 --with-dvdread-config=*)
774 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
777 --extra-cflags=*)
778 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
780 --extra-ldflags=*)
781 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
783 --extra-libs=*)
784 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
786 --extra-libs-mplayer=*)
787 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
789 --extra-libs-mencoder=*)
790 libs_mencoder=$(echo $ac_option | cut -d '=' -f 2)
793 --target=*)
794 _target=$(echo $ac_option | cut -d '=' -f 2)
796 --cc=*)
797 _cc=$(echo $ac_option | cut -d '=' -f 2)
799 --host-cc=*)
800 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
802 --as=*)
803 _as=$(echo $ac_option | cut -d '=' -f 2)
805 --nm=*)
806 _nm=$(echo $ac_option | cut -d '=' -f 2)
808 --yasm=*)
809 _yasm=$(echo $ac_option | cut -d '=' -f 2)
811 --ar=*)
812 _ar=$(echo $ac_option | cut -d '=' -f 2)
814 --ranlib=*)
815 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
817 --windres=*)
818 _windres=$(echo $ac_option | cut -d '=' -f 2)
820 --charset=*)
821 _charset=$(echo $ac_option | cut -d '=' -f 2)
823 --language-doc=*)
824 language_doc=$(echo $ac_option | cut -d '=' -f 2)
826 --language-man=*)
827 language_man=$(echo $ac_option | cut -d '=' -f 2)
829 --language-msg=*)
830 language_msg=$(echo $ac_option | cut -d '=' -f 2)
832 --language=*)
833 language=$(echo $ac_option | cut -d '=' -f 2)
836 --enable-static)
837 _ld_static='-static'
839 --disable-static)
840 _ld_static=''
842 --enable-profile)
843 _profile='-p'
845 --disable-profile)
846 _profile=
848 --enable-debug)
849 _debug='-g'
851 --enable-debug=*)
852 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
854 --disable-debug)
855 _debug=
857 --enable-translation) _translation=yes ;;
858 --disable-translation) _translation=no ;;
859 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
860 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
861 --enable-cross-compile) _cross_compile=yes ;;
862 --disable-cross-compile) _cross_compile=no ;;
863 --enable-mencoder) _mencoder=yes ;;
864 --disable-mencoder) _mencoder=no ;;
865 --enable-mplayer) _mplayer=yes ;;
866 --disable-mplayer) _mplayer=no ;;
867 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
868 --disable-dynamic-plugins) _dynamic_plugins=no ;;
869 --enable-x11) _x11=yes ;;
870 --disable-x11) _x11=no ;;
871 --enable-xshape) _xshape=yes ;;
872 --disable-xshape) _xshape=no ;;
873 --enable-xss) _xss=yes ;;
874 --disable-xss) _xss=no ;;
875 --enable-xv) _xv=yes ;;
876 --disable-xv) _xv=no ;;
877 --enable-xvmc) _xvmc=yes ;;
878 --disable-xvmc) _xvmc=no ;;
879 --enable-vdpau) _vdpau=yes ;;
880 --disable-vdpau) _vdpau=no ;;
881 --enable-sdl) _sdl=yes ;;
882 --disable-sdl) _sdl=no ;;
883 --enable-kva) _kva=yes ;;
884 --disable-kva) _kva=no ;;
885 --enable-direct3d) _direct3d=yes ;;
886 --disable-direct3d) _direct3d=no ;;
887 --enable-directx) _directx=yes ;;
888 --disable-directx) _directx=no ;;
889 --enable-win32waveout) _win32waveout=yes ;;
890 --disable-win32waveout) _win32waveout=no ;;
891 --enable-nas) _nas=yes ;;
892 --disable-nas) _nas=no ;;
893 --enable-png) _png=yes ;;
894 --disable-png) _png=no ;;
895 --enable-mng) _mng=yes ;;
896 --disable-mng) _mng=no ;;
897 --enable-jpeg) _jpeg=yes ;;
898 --disable-jpeg) _jpeg=no ;;
899 --enable-pnm) _pnm=yes ;;
900 --disable-pnm) _pnm=no ;;
901 --enable-md5sum) _md5sum=yes ;;
902 --disable-md5sum) _md5sum=no ;;
903 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
904 --disable-yuv4mpeg) _yuv4mpeg=no ;;
905 --enable-gif) _gif=yes ;;
906 --disable-gif) _gif=no ;;
907 --enable-gl) _gl=yes ;;
908 --disable-gl) _gl=no ;;
909 --enable-matrixview) matrixview=yes ;;
910 --disable-matrixview) matrixview=no ;;
911 --enable-ggi) _ggi=yes ;;
912 --disable-ggi) _ggi=no ;;
913 --enable-ggiwmh) _ggiwmh=yes ;;
914 --disable-ggiwmh) _ggiwmh=no ;;
915 --enable-aa) _aa=yes ;;
916 --disable-aa) _aa=no ;;
917 --enable-caca) _caca=yes ;;
918 --disable-caca) _caca=no ;;
919 --enable-svga) _svga=yes ;;
920 --disable-svga) _svga=no ;;
921 --enable-vesa) _vesa=yes ;;
922 --disable-vesa) _vesa=no ;;
923 --enable-fbdev) _fbdev=yes ;;
924 --disable-fbdev) _fbdev=no ;;
925 --enable-dvb) _dvb=yes ;;
926 --disable-dvb) _dvb=no ;;
927 --enable-dxr2) _dxr2=yes ;;
928 --disable-dxr2) _dxr2=no ;;
929 --enable-dxr3) _dxr3=yes ;;
930 --disable-dxr3) _dxr3=no ;;
931 --enable-ivtv) _ivtv=yes ;;
932 --disable-ivtv) _ivtv=no ;;
933 --enable-v4l2) _v4l2=yes ;;
934 --disable-v4l2) _v4l2=no ;;
935 --enable-iconv) _iconv=yes ;;
936 --disable-iconv) _iconv=no ;;
937 --enable-langinfo) _langinfo=yes ;;
938 --disable-langinfo) _langinfo=no ;;
939 --enable-rtc) _rtc=yes ;;
940 --disable-rtc) _rtc=no ;;
941 --enable-libdv) _libdv=yes ;;
942 --disable-libdv) _libdv=no ;;
943 --enable-ossaudio) _ossaudio=yes ;;
944 --disable-ossaudio) _ossaudio=no ;;
945 --enable-arts) _arts=yes ;;
946 --disable-arts) _arts=no ;;
947 --enable-esd) _esd=yes ;;
948 --disable-esd) _esd=no ;;
949 --enable-pulse) _pulse=yes ;;
950 --disable-pulse) _pulse=no ;;
951 --enable-jack) _jack=yes ;;
952 --disable-jack) _jack=no ;;
953 --enable-openal) _openal=yes ;;
954 --disable-openal) _openal=no ;;
955 --enable-kai) _kai=yes ;;
956 --disable-kai) _kai=no ;;
957 --enable-dart) _dart=yes ;;
958 --disable-dart) _dart=no ;;
959 --enable-mad) _mad=yes ;;
960 --disable-mad) _mad=no ;;
961 --enable-mp3lame) _mp3lame=yes ;;
962 --disable-mp3lame) _mp3lame=no ;;
963 --enable-toolame) _toolame=yes ;;
964 --disable-toolame) _toolame=no ;;
965 --enable-twolame) _twolame=yes ;;
966 --disable-twolame) _twolame=no ;;
967 --enable-libcdio) _libcdio=yes ;;
968 --disable-libcdio) _libcdio=no ;;
969 --enable-liblzo) _liblzo=yes ;;
970 --disable-liblzo) _liblzo=no ;;
971 --enable-libvorbis) _libvorbis=yes ;;
972 --disable-libvorbis) _libvorbis=no ;;
973 --enable-speex) _speex=yes ;;
974 --disable-speex) _speex=no ;;
975 --enable-tremor) _tremor=yes ;;
976 --disable-tremor) _tremor=no ;;
977 --enable-tremor-internal) _tremor_internal=yes ;;
978 --disable-tremor-internal) _tremor_internal=no ;;
979 --enable-tremor-low) _tremor_low=yes ;;
980 --disable-tremor-low) _tremor_low=no ;;
981 --enable-theora) _theora=yes ;;
982 --disable-theora) _theora=no ;;
983 --enable-mpg123) _mpg123=yes ;;
984 --disable-mpg123) _mpg123=no ;;
985 --enable-mp3lib) _mp3lib=yes ;;
986 --disable-mp3lib) _mp3lib=no ;;
987 --enable-liba52) _liba52=yes ;;
988 --disable-liba52) _liba52=no ;;
989 --enable-libdca) _libdca=yes ;;
990 --disable-libdca) _libdca=no ;;
991 --enable-libmpeg2) _libmpeg2=yes ;;
992 --disable-libmpeg2) _libmpeg2=no ;;
993 --enable-musepack) _musepack=yes ;;
994 --disable-musepack) _musepack=no ;;
995 --enable-faad) _faad=yes ;;
996 --disable-faad) _faad=no ;;
997 --enable-faad-internal) _faad_internal=yes ;;
998 --disable-faad-internal) _faad_internal=no ;;
999 --enable-faad-fixed) _faad_fixed=yes ;;
1000 --disable-faad-fixed) _faad_fixed=no ;;
1001 --enable-faac) _faac=yes ;;
1002 --disable-faac) _faac=no ;;
1003 --enable-ladspa) _ladspa=yes ;;
1004 --disable-ladspa) _ladspa=no ;;
1005 --enable-libbs2b) _libbs2b=yes ;;
1006 --disable-libbs2b) _libbs2b=no ;;
1007 --enable-xmms) _xmms=yes ;;
1008 --disable-xmms) _xmms=no ;;
1009 --enable-vcd) _vcd=yes ;;
1010 --disable-vcd) _vcd=no ;;
1011 --enable-dvdread) _dvdread=yes ;;
1012 --disable-dvdread) _dvdread=no ;;
1013 --enable-dvdread-internal) _dvdread_internal=yes ;;
1014 --disable-dvdread-internal) _dvdread_internal=no ;;
1015 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1016 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1017 --enable-dvdnav) _dvdnav=yes ;;
1018 --disable-dvdnav) _dvdnav=no ;;
1019 --enable-xanim) _xanim=yes ;;
1020 --disable-xanim) _xanim=no ;;
1021 --enable-real) _real=yes ;;
1022 --disable-real) _real=no ;;
1023 --enable-live) _live=yes ;;
1024 --disable-live) _live=no ;;
1025 --enable-nemesi) _nemesi=yes ;;
1026 --disable-nemesi) _nemesi=no ;;
1027 --enable-xinerama) _xinerama=yes ;;
1028 --disable-xinerama) _xinerama=no ;;
1029 --enable-mga) _mga=yes ;;
1030 --disable-mga) _mga=no ;;
1031 --enable-xmga) _xmga=yes ;;
1032 --disable-xmga) _xmga=no ;;
1033 --enable-vm) _vm=yes ;;
1034 --disable-vm) _vm=no ;;
1035 --enable-xf86keysym) _xf86keysym=yes ;;
1036 --disable-xf86keysym) _xf86keysym=no ;;
1037 --enable-mlib) _mlib=yes ;;
1038 --disable-mlib) _mlib=no ;;
1039 --enable-sunaudio) _sunaudio=yes ;;
1040 --disable-sunaudio) _sunaudio=no ;;
1041 --enable-sgiaudio) _sgiaudio=yes ;;
1042 --disable-sgiaudio) _sgiaudio=no ;;
1043 --enable-alsa) _alsa=yes ;;
1044 --disable-alsa) _alsa=no ;;
1045 --enable-tv) _tv=yes ;;
1046 --disable-tv) _tv=no ;;
1047 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1048 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1049 --enable-tv-v4l1) _tv_v4l1=yes ;;
1050 --disable-tv-v4l1) _tv_v4l1=no ;;
1051 --enable-tv-v4l2) _tv_v4l2=yes ;;
1052 --disable-tv-v4l2) _tv_v4l2=no ;;
1053 --enable-tv-dshow) _tv_dshow=yes ;;
1054 --disable-tv-dshow) _tv_dshow=no ;;
1055 --enable-radio) _radio=yes ;;
1056 --enable-radio-capture) _radio_capture=yes ;;
1057 --disable-radio-capture) _radio_capture=no ;;
1058 --disable-radio) _radio=no ;;
1059 --enable-radio-v4l) _radio_v4l=yes ;;
1060 --disable-radio-v4l) _radio_v4l=no ;;
1061 --enable-radio-v4l2) _radio_v4l2=yes ;;
1062 --disable-radio-v4l2) _radio_v4l2=no ;;
1063 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1064 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1065 --enable-pvr) _pvr=yes ;;
1066 --disable-pvr) _pvr=no ;;
1067 --enable-fastmemcpy) _fastmemcpy=yes ;;
1068 --disable-fastmemcpy) _fastmemcpy=no ;;
1069 --enable-network) _network=yes ;;
1070 --disable-network) _network=no ;;
1071 --enable-winsock2_h) _winsock2_h=yes ;;
1072 --disable-winsock2_h) _winsock2_h=no ;;
1073 --enable-smb) _smb=yes ;;
1074 --disable-smb) _smb=no ;;
1075 --enable-vidix) _vidix=yes ;;
1076 --disable-vidix) _vidix=no ;;
1077 --with-vidix-drivers=*)
1078 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1080 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1081 --enable-dhahelper) _dhahelper=yes ;;
1082 --disable-dhahelper) _dhahelper=no ;;
1083 --enable-svgalib_helper) _svgalib_helper=yes ;;
1084 --disable-svgalib_helper) _svgalib_helper=no ;;
1085 --enable-joystick) _joystick=yes ;;
1086 --disable-joystick) _joystick=no ;;
1087 --enable-xvid) _xvid=yes ;;
1088 --disable-xvid) _xvid=no ;;
1089 --enable-x264) _x264=yes ;;
1090 --disable-x264) _x264=no ;;
1091 --enable-libnut) _libnut=yes ;;
1092 --disable-libnut) _libnut=no ;;
1093 --enable-libavutil) _libavutil=yes ;;
1094 --disable-libavutil) _libavutil=no ;;
1095 --enable-libavcodec) _libavcodec=yes ;;
1096 --disable-libavcodec) _libavcodec=no ;;
1097 --enable-libavformat) _libavformat=yes ;;
1098 --disable-libavformat) _libavformat=no ;;
1099 --enable-libpostproc) _libpostproc=yes ;;
1100 --disable-libpostproc) _libpostproc=no ;;
1101 --enable-libswscale) _libswscale=yes ;;
1102 --disable-libswscale) _libswscale=no ;;
1103 --ffmpeg-source-dir=*)
1104 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1106 --enable-lirc) _lirc=yes ;;
1107 --disable-lirc) _lirc=no ;;
1108 --enable-lircc) _lircc=yes ;;
1109 --disable-lircc) _lircc=no ;;
1110 --enable-apple-remote) _apple_remote=yes ;;
1111 --disable-apple-remote) _apple_remote=no ;;
1112 --enable-apple-ir) _apple_ir=yes ;;
1113 --disable-apple-ir) _apple_ir=no ;;
1114 --enable-gui) _gui=yes ;;
1115 --disable-gui) _gui=no ;;
1116 --enable-gtk1) _gtk1=yes ;;
1117 --disable-gtk1) _gtk1=no ;;
1118 --enable-termcap) _termcap=yes ;;
1119 --disable-termcap) _termcap=no ;;
1120 --enable-termios) _termios=yes ;;
1121 --disable-termios) _termios=no ;;
1122 --enable-3dfx) _3dfx=yes ;;
1123 --disable-3dfx) _3dfx=no ;;
1124 --enable-s3fb) _s3fb=yes ;;
1125 --disable-s3fb) _s3fb=no ;;
1126 --enable-wii) _wii=yes ;;
1127 --disable-wii) _wii=no ;;
1128 --enable-tdfxfb) _tdfxfb=yes ;;
1129 --disable-tdfxfb) _tdfxfb=no ;;
1130 --disable-tdfxvid) _tdfxvid=no ;;
1131 --enable-tdfxvid) _tdfxvid=yes ;;
1132 --disable-xvr100) _xvr100=no ;;
1133 --enable-xvr100) _xvr100=yes ;;
1134 --disable-tga) _tga=no ;;
1135 --enable-tga) _tga=yes ;;
1136 --enable-directfb) _directfb=yes ;;
1137 --disable-directfb) _directfb=no ;;
1138 --enable-zr) _zr=yes ;;
1139 --disable-zr) _zr=no ;;
1140 --enable-bl) _bl=yes ;;
1141 --disable-bl) _bl=no ;;
1142 --enable-mtrr) _mtrr=yes ;;
1143 --disable-mtrr) _mtrr=no ;;
1144 --enable-largefiles) _largefiles=yes ;;
1145 --disable-largefiles) _largefiles=no ;;
1146 --enable-shm) _shm=yes ;;
1147 --disable-shm) _shm=no ;;
1148 --enable-select) _select=yes ;;
1149 --disable-select) _select=no ;;
1150 --enable-cdparanoia) _cdparanoia=yes ;;
1151 --disable-cdparanoia) _cdparanoia=no ;;
1152 --enable-cddb) _cddb=yes ;;
1153 --disable-cddb) _cddb=no ;;
1154 --enable-big-endian) _big_endian=yes ;;
1155 --disable-big-endian) _big_endian=no ;;
1156 --enable-bitmap-font) _bitmap_font=yes ;;
1157 --disable-bitmap-font) _bitmap_font=no ;;
1158 --enable-freetype) _freetype=yes ;;
1159 --disable-freetype) _freetype=no ;;
1160 --enable-fontconfig) _fontconfig=yes ;;
1161 --disable-fontconfig) _fontconfig=no ;;
1162 --enable-unrarexec) _unrar_exec=yes ;;
1163 --disable-unrarexec) _unrar_exec=no ;;
1164 --enable-ftp) _ftp=yes ;;
1165 --disable-ftp) _ftp=no ;;
1166 --enable-vstream) _vstream=yes ;;
1167 --disable-vstream) _vstream=no ;;
1168 --enable-pthreads) _pthreads=yes ;;
1169 --disable-pthreads) _pthreads=no ;;
1170 --enable-w32threads) _w32threads=yes ;;
1171 --disable-w32threads) _w32threads=no ;;
1172 --enable-ass) _ass=yes ;;
1173 --disable-ass) _ass=no ;;
1174 --enable-rpath) _rpath=yes ;;
1175 --disable-rpath) _rpath=no ;;
1177 --enable-fribidi) _fribidi=yes ;;
1178 --disable-fribidi) _fribidi=no ;;
1180 --enable-enca) _enca=yes ;;
1181 --disable-enca) _enca=no ;;
1183 --enable-inet6) _inet6=yes ;;
1184 --disable-inet6) _inet6=no ;;
1186 --enable-gethostbyname2) _gethostbyname2=yes ;;
1187 --disable-gethostbyname2) _gethostbyname2=no ;;
1189 --enable-dga1) _dga1=yes ;;
1190 --disable-dga1) _dga1=no ;;
1191 --enable-dga2) _dga2=yes ;;
1192 --disable-dga2) _dga2=no ;;
1194 --enable-menu) _menu=yes ;;
1195 --disable-menu) _menu=no ;;
1197 --enable-qtx) _qtx=yes ;;
1198 --disable-qtx) _qtx=no ;;
1200 --enable-coreaudio) _coreaudio=yes ;;
1201 --disable-coreaudio) _coreaudio=no ;;
1202 --enable-corevideo) _corevideo=yes ;;
1203 --disable-corevideo) _corevideo=no ;;
1204 --enable-quartz) _quartz=yes ;;
1205 --disable-quartz) _quartz=no ;;
1206 --enable-macosx-finder) _macosx_finder=yes ;;
1207 --disable-macosx-finder) _macosx_finder=no ;;
1208 --enable-macosx-bundle) _macosx_bundle=yes ;;
1209 --disable-macosx-bundle) _macosx_bundle=no ;;
1211 --enable-maemo) _maemo=yes ;;
1212 --disable-maemo) _maemo=no ;;
1214 --enable-sortsub) _sortsub=yes ;;
1215 --disable-sortsub) _sortsub=no ;;
1217 --enable-crash-debug) _crash_debug=yes ;;
1218 --disable-crash-debug) _crash_debug=no ;;
1219 --enable-sighandler) _sighandler=yes ;;
1220 --disable-sighandler) _sighandler=no ;;
1221 --enable-win32dll) _win32dll=yes ;;
1222 --disable-win32dll) _win32dll=no ;;
1224 --enable-sse) _sse=yes ;;
1225 --disable-sse) _sse=no ;;
1226 --enable-sse2) _sse2=yes ;;
1227 --disable-sse2) _sse2=no ;;
1228 --enable-ssse3) _ssse3=yes ;;
1229 --disable-ssse3) _ssse3=no ;;
1230 --enable-mmxext) _mmxext=yes ;;
1231 --disable-mmxext) _mmxext=no ;;
1232 --enable-3dnow) _3dnow=yes ;;
1233 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1234 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1235 --disable-3dnowext) _3dnowext=no ;;
1236 --enable-cmov) _cmov=yes ;;
1237 --disable-cmov) _cmov=no ;;
1238 --enable-fast-cmov) _fast_cmov=yes ;;
1239 --disable-fast-cmov) _fast_cmov=no ;;
1240 --enable-fast-clz) _fast_clz=yes ;;
1241 --disable-fast-clz) _fast_clz=no ;;
1242 --enable-altivec) _altivec=yes ;;
1243 --disable-altivec) _altivec=no ;;
1244 --enable-armv5te) _armv5te=yes ;;
1245 --disable-armv5te) _armv5te=no ;;
1246 --enable-armv6) _armv6=yes ;;
1247 --disable-armv6) _armv6=no ;;
1248 --enable-armv6t2) _armv6t2=yes ;;
1249 --disable-armv6t2) _armv6t2=no ;;
1250 --enable-armvfp) _armvfp=yes ;;
1251 --disable-armvfp) _armvfp=no ;;
1252 --enable-neon) neon=yes ;;
1253 --disable-neon) neon=no ;;
1254 --enable-iwmmxt) _iwmmxt=yes ;;
1255 --disable-iwmmxt) _iwmmxt=no ;;
1256 --enable-mmx) _mmx=yes ;;
1257 --disable-mmx) # 3Dnow! and MMX2 require MMX
1258 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1261 echo "Unknown parameter: $ac_option"
1262 exit 1
1265 esac
1266 done
1268 if test "$_gui" = yes ; then
1269 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1270 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1273 # Atmos: moved this here, to be correct, if --prefix is specified
1274 test -z "$_bindir" && _bindir="$_prefix/bin"
1275 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1276 test -z "$_mandir" && _mandir="$_prefix/share/man"
1277 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1278 test -z "$_libdir" && _libdir="$_prefix/lib"
1279 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1281 # Determine our OS name and CPU architecture
1282 if test -z "$_target" ; then
1283 # OS name
1284 system_name=$(uname -s 2>&1)
1285 case "$system_name" in
1286 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1288 Haiku)
1289 system_name=BeOS
1291 IRIX*)
1292 system_name=IRIX
1294 GNU/kFreeBSD)
1295 system_name=FreeBSD
1297 HP-UX*)
1298 system_name=HP-UX
1300 [cC][yY][gG][wW][iI][nN]*)
1301 system_name=CYGWIN
1303 MINGW32*)
1304 system_name=MINGW32
1306 OS/2*)
1307 system_name=OS/2
1310 system_name="$system_name-UNKNOWN"
1312 esac
1315 # host's CPU/instruction set
1316 host_arch=$(uname -p 2>&1)
1317 case "$host_arch" in
1318 i386|sparc|ppc|alpha|arm|mips|vax)
1320 powerpc) # Darwin returns 'powerpc'
1321 host_arch=ppc
1323 *) # uname -p on Linux returns 'unknown' for the processor type,
1324 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1326 # Maybe uname -m (machine hardware name) returns something we
1327 # recognize.
1329 # x86/x86pc is used by QNX
1330 case "$(uname -m 2>&1)" in
1331 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 ;;
1332 ia64) host_arch=ia64 ;;
1333 macppc|ppc) host_arch=ppc ;;
1334 ppc64) host_arch=ppc64 ;;
1335 alpha) host_arch=alpha ;;
1336 sparc) host_arch=sparc ;;
1337 sparc64) host_arch=sparc64 ;;
1338 parisc*|hppa*|9000*) host_arch=hppa ;;
1339 arm*|zaurus|cats) host_arch=arm ;;
1340 sh3|sh4|sh4a) host_arch=sh ;;
1341 s390) host_arch=s390 ;;
1342 s390x) host_arch=s390x ;;
1343 *mips*) host_arch=mips ;;
1344 vax) host_arch=vax ;;
1345 xtensa*) host_arch=xtensa ;;
1346 *) host_arch=UNKNOWN ;;
1347 esac
1349 esac
1350 else # if test -z "$_target"
1351 system_name=$(echo $_target | cut -d '-' -f 2)
1352 case "$(echo $system_name | tr A-Z a-z)" in
1353 linux) system_name=Linux ;;
1354 freebsd) system_name=FreeBSD ;;
1355 gnu/kfreebsd) system_name=FreeBSD ;;
1356 netbsd) system_name=NetBSD ;;
1357 bsd/os) system_name=BSD/OS ;;
1358 openbsd) system_name=OpenBSD ;;
1359 dragonfly) system_name=DragonFly ;;
1360 sunos) system_name=SunOS ;;
1361 qnx) system_name=QNX ;;
1362 morphos) system_name=MorphOS ;;
1363 amigaos) system_name=AmigaOS ;;
1364 mingw32*) system_name=MINGW32 ;;
1365 esac
1366 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1367 host_arch=$(echo $_target | cut -d '-' -f 1)
1368 if test $(echo $host_arch) != "x86_64" ; then
1369 host_arch=$(echo $host_arch | tr '_' '-')
1373 extra_cflags="-I. $extra_cflags"
1374 _timer=timer-linux.c
1375 _getch=getch2.c
1376 if freebsd ; then
1377 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1378 extra_cflags="$extra_cflags -I/usr/local/include"
1381 if netbsd || dragonfly ; then
1382 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1383 extra_cflags="$extra_cflags -I/usr/pkg/include"
1386 if darwin; then
1387 extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags"
1388 _timer=timer-darwin.c
1391 if aix ; then
1392 extra_ldflags="$extra_ldflags -lC"
1395 if irix ; then
1396 _ranlib='ar -r'
1397 elif linux ; then
1398 _ranlib='true'
1401 if win32 ; then
1402 _exesuf=".exe"
1403 extra_cflags="$extra_cflags -fno-common"
1404 # -lwinmm is always needed for osdep/timer-win2.c
1405 extra_ldflags="$extra_ldflags -lwinmm"
1406 _pe_executable=yes
1407 _timer=timer-win2.c
1408 _priority=yes
1409 def_dos_paths="#define HAVE_DOS_PATHS 1"
1410 def_priority="#define CONFIG_PRIORITY 1"
1413 if mingw32 ; then
1414 _getch=getch2-win.c
1415 _need_shmem=no
1418 if amigaos ; then
1419 _select=no
1420 _sighandler=no
1421 _stream_cache=no
1422 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1423 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1426 if qnx ; then
1427 extra_ldflags="$extra_ldflags -lph"
1430 if os2 ; then
1431 _exesuf=".exe"
1432 _getch=getch2-os2.c
1433 _need_shmem=no
1434 _priority=yes
1435 def_dos_paths="#define HAVE_DOS_PATHS 1"
1436 def_priority="#define CONFIG_PRIORITY 1"
1439 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1440 test "$tmpdir" && break
1441 done
1443 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1444 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1446 TMPLOG="config.log"
1447 TMPC="$mplayer_tmpdir/tmp.c"
1448 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1449 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1450 TMPH="$mplayer_tmpdir/tmp.h"
1451 TMPS="$mplayer_tmpdir/tmp.S"
1453 rm -f "$TMPLOG"
1454 echo configuration: $configuration > "$TMPLOG"
1455 echo >> "$TMPLOG"
1458 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1459 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1463 # Checking CC version...
1464 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1465 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1466 echocheck "$_cc version"
1467 cc_vendor=intel
1468 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1469 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1470 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1471 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1472 # TODO verify older icc/ecc compatibility
1473 case $cc_version in
1475 cc_version="v. ?.??, bad"
1476 cc_fail=yes
1478 10.1|11.0|11.1)
1479 cc_version="$cc_version, ok"
1482 cc_version="$cc_version, bad"
1483 cc_fail=yes
1485 esac
1486 echores "$cc_version"
1487 else
1488 for _cc in "$_cc" gcc cc ; do
1489 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1490 if test "$cc_name_tmp" = "gcc"; then
1491 cc_name=$cc_name_tmp
1492 echocheck "$_cc version"
1493 cc_vendor=gnu
1494 cc_version=$($_cc -dumpversion 2>&1)
1495 case $cc_version in
1496 2.96*)
1497 cc_fail=yes
1500 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1501 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1502 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1504 esac
1505 echores "$cc_version"
1506 break
1508 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1509 if test "$cc_name_tmp" = "clang"; then
1510 echocheck "$_cc version"
1511 cc_vendor=clang
1512 cc_version=$($_cc -dumpversion 2>&1)
1513 res_comment="experimental support only"
1514 echores "clang $cc_version"
1515 break
1517 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1518 if test "$cc_name_tmp" = "Sun C"; then
1519 echocheck "$_cc version"
1520 cc_vendor=sun
1521 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1522 res_comment="experimental support only"
1523 echores "Sun C $cc_version"
1524 break
1526 done
1527 fi # icc
1528 test "$cc_fail" = yes && die "unsupported compiler version"
1530 if test -z "$_target" && x86 ; then
1531 cat > $TMPC << EOF
1532 int main(void) {
1533 int test[(int)sizeof(char *)-7];
1534 return 0;
1537 cc_check && host_arch=x86_64 || host_arch=i386
1540 echo "Detected operating system: $system_name"
1541 echo "Detected host architecture: $host_arch"
1543 echocheck "host cc"
1544 test "$_host_cc" || _host_cc=$_cc
1545 echores $_host_cc
1547 echocheck "cross compilation"
1548 if test $_cross_compile = auto ; then
1549 cat > $TMPC << EOF
1550 int main(void) { return 0; }
1552 _cross_compile=yes
1553 cc_check && "$TMPEXE" && _cross_compile=no
1555 echores $_cross_compile
1557 if test $_cross_compile = yes; then
1558 tmp_run() {
1559 return 0
1563 # ---
1565 # now that we know what compiler should be used for compilation, try to find
1566 # out which assembler is used by the $_cc compiler
1567 if test "$_as" = auto ; then
1568 _as=$($_cc -print-prog-name=as)
1569 test -z "$_as" && _as=as
1572 if test "$_nm" = auto ; then
1573 _nm=$($_cc -print-prog-name=nm)
1574 test -z "$_nm" && _nm=nm
1577 # XXX: this should be ok..
1578 _cpuinfo="echo"
1580 if test "$_runtime_cpudetection" = no ; then
1582 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1583 # FIXME: Remove the cygwin check once AMD CPUs are supported
1584 if test -r /proc/cpuinfo && ! cygwin; then
1585 # Linux with /proc mounted, extract CPU information from it
1586 _cpuinfo="cat /proc/cpuinfo"
1587 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1588 # FreeBSD with Linux emulation /proc mounted,
1589 # extract CPU information from it
1590 # Don't use it on x86 though, it never reports 3Dnow
1591 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1592 elif darwin && ! x86 ; then
1593 # use hostinfo on Darwin
1594 _cpuinfo="hostinfo"
1595 elif aix; then
1596 # use 'lsattr' on AIX
1597 _cpuinfo="lsattr -E -l proc0 -a type"
1598 elif x86; then
1599 # all other OSes try to extract CPU information from a small helper
1600 # program cpuinfo instead
1601 $_cc -o cpuinfo$_exesuf cpuinfo.c
1602 _cpuinfo="./cpuinfo$_exesuf"
1605 if x86 ; then
1606 # gather more CPU information
1607 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1608 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1609 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1610 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1611 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1613 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1615 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1616 -e s/xmm/sse/ -e s/kni/sse/)
1618 for ext in $pparam ; do
1619 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1620 done
1622 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1623 test $_sse = kernel_check && _mmxext=kernel_check
1625 echocheck "CPU vendor"
1626 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1628 echocheck "CPU type"
1629 echores "$pname"
1632 fi # test "$_runtime_cpudetection" = no
1634 if x86 && test "$_runtime_cpudetection" = no ; then
1635 extcheck() {
1636 if test "$1" = kernel_check ; then
1637 echocheck "kernel support of $2"
1638 cat > $TMPC <<EOF
1639 #include <stdlib.h>
1640 #include <signal.h>
1641 void catch(void) { exit(1); }
1642 int main(void) {
1643 signal(SIGILL, catch);
1644 __asm__ volatile ("$3":::"memory"); return 0;
1648 if cc_check && tmp_run ; then
1649 eval _$2=yes
1650 echores "yes"
1651 _optimizing="$_optimizing $2"
1652 return 0
1653 else
1654 eval _$2=no
1655 echores "failed"
1656 echo "It seems that your kernel does not correctly support $2."
1657 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1658 return 1
1661 return 0
1664 extcheck $_mmx "mmx" "emms"
1665 extcheck $_mmxext "mmxext" "sfence"
1666 extcheck $_3dnow "3dnow" "femms"
1667 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1668 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1669 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1670 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1671 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1673 echocheck "mtrr support"
1674 if test "$_mtrr" = kernel_check ; then
1675 _mtrr="yes"
1676 _optimizing="$_optimizing mtrr"
1678 echores "$_mtrr"
1680 if test "$_gcc3_ext" != ""; then
1681 # if we had to disable sse/sse2 because the active kernel does not
1682 # support this instruction set extension, we also have to tell
1683 # gcc3 to not generate sse/sse2 instructions for normal C code
1684 cat > $TMPC << EOF
1685 int main(void) { return 0; }
1687 cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext"
1693 def_fast_64bit='#define HAVE_FAST_64BIT 0'
1694 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0'
1695 arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
1696 subarch_all='X86_32 X86_64 PPC64'
1697 case "$host_arch" in
1698 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
1699 arch='x86'
1700 subarch='x86_32'
1701 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1702 iproc=486
1703 proc=i486
1706 if test "$_runtime_cpudetection" = no ; then
1707 case "$pvendor" in
1708 AuthenticAMD)
1709 case "$pfamily" in
1710 3) proc=i386 iproc=386 ;;
1711 4) proc=i486 iproc=486 ;;
1712 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3
1713 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size.
1714 if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then
1715 proc=k6-3
1716 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then
1717 proc=geode
1718 elif test "$pmodel" -ge 8; then
1719 proc=k6-2
1720 elif test "$pmodel" -ge 6; then
1721 proc=k6
1722 else
1723 proc=i586
1726 6) iproc=686
1727 # It's a bit difficult to determine the correct type of Family 6
1728 # AMD CPUs just from their signature. Instead, we check directly
1729 # whether it supports SSE.
1730 if test "$_sse" = yes; then
1731 # gcc treats athlon-xp, athlon-4 and athlon-mp similarly.
1732 proc=athlon-xp
1733 else
1734 # Again, gcc treats athlon and athlon-tbird similarly.
1735 proc=athlon
1738 15) iproc=686
1739 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be
1740 # caught and remedied in the optimization tests below.
1741 proc=k8
1744 *) proc=amdfam10 iproc=686
1745 test $_fast_clz = "auto" && _fast_clz=yes
1747 esac
1749 GenuineIntel)
1750 case "$pfamily" in
1751 3) proc=i386 iproc=386 ;;
1752 4) proc=i486 iproc=486 ;;
1753 5) iproc=586
1754 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then
1755 proc=pentium-mmx # 4 is desktop, 8 is mobile
1756 else
1757 proc=i586
1760 6) iproc=686
1761 if test "$pmodel" -ge 15; then
1762 proc=core2
1763 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then
1764 proc=pentium-m
1765 elif test "$pmodel" -ge 7; then
1766 proc=pentium3
1767 elif test "$pmodel" -ge 3; then
1768 proc=pentium2
1769 else
1770 proc=i686
1772 test $_fast_clz = "auto" && _fast_clz=yes
1774 15) iproc=686
1775 # A nocona in 32-bit mode has no more capabilities than a prescott.
1776 if test "$pmodel" -ge 3; then
1777 proc=prescott
1778 else
1779 proc=pentium4
1780 test $_fast_clz = "auto" && _fast_clz=yes
1782 test $_fast_cmov = "auto" && _fast_cmov=no
1784 *) proc=prescott iproc=686 ;;
1785 esac
1787 CentaurHauls)
1788 case "$pfamily" in
1789 5) iproc=586
1790 if test "$pmodel" -ge 8; then
1791 proc=winchip2
1792 elif test "$pmodel" -ge 4; then
1793 proc=winchip-c6
1794 else
1795 proc=i586
1798 6) iproc=686
1799 if test "$pmodel" -ge 9; then
1800 proc=c3-2
1801 else
1802 proc=c3
1803 iproc=586
1806 *) proc=i686 iproc=i686 ;;
1807 esac
1809 unknown)
1810 case "$pfamily" in
1811 3) proc=i386 iproc=386 ;;
1812 4) proc=i486 iproc=486 ;;
1813 *) proc=i586 iproc=586 ;;
1814 esac
1817 proc=i586 iproc=586 ;;
1818 esac
1819 test $_fast_clz = "auto" && _fast_clz=no
1820 fi # test "$_runtime_cpudetection" = no
1823 # check that gcc supports our CPU, if not, fall back to earlier ones
1824 # LGB: check -mcpu and -march swithing step by step with enabling
1825 # to fall back till 386.
1827 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1829 if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then
1830 cpuopt=-mtune
1831 else
1832 cpuopt=-mcpu
1835 echocheck "GCC & CPU optimization abilities"
1836 cat > $TMPC << EOF
1837 int main(void) { return 0; }
1839 if test "$_runtime_cpudetection" = no ; then
1840 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1841 cc_check -march=native && proc=native
1843 if test "$proc" = "amdfam10"; then
1844 cc_check -march=$proc $cpuopt=$proc || proc=k8
1846 if test "$proc" = "k8"; then
1847 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1849 if test "$proc" = "athlon-xp"; then
1850 cc_check -march=$proc $cpuopt=$proc || proc=athlon
1852 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1853 cc_check -march=$proc $cpuopt=$proc || proc=k6
1855 if test "$proc" = "k6" || test "$proc" = "c3"; then
1856 if ! cc_check -march=$proc $cpuopt=$proc; then
1857 if cc_check -march=i586 $cpuopt=i686; then
1858 proc=i586-i686
1859 else
1860 proc=i586
1864 if test "$proc" = "prescott" ; then
1865 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
1867 if test "$proc" = "core2" ; then
1868 cc_check -march=$proc $cpuopt=$proc || proc=pentium-m
1870 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
1871 cc_check -march=$proc $cpuopt=$proc || proc=i686
1873 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1874 cc_check -march=$proc $cpuopt=$proc || proc=i586
1876 if test "$proc" = "i586"; then
1877 cc_check -march=$proc $cpuopt=$proc || proc=i486
1879 if test "$proc" = "i486" ; then
1880 cc_check -march=$proc $cpuopt=$proc || proc=i386
1882 if test "$proc" = "i386" ; then
1883 cc_check -march=$proc $cpuopt=$proc || proc=error
1885 if test "$proc" = "error" ; then
1886 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1887 _mcpu=""
1888 _march=""
1889 _optimizing=""
1890 elif test "$proc" = "i586-i686"; then
1891 _march="-march=i586"
1892 _mcpu="$cpuopt=i686"
1893 _optimizing="$proc"
1894 else
1895 _march="-march=$proc"
1896 _mcpu="$cpuopt=$proc"
1897 _optimizing="$proc"
1899 else # if test "$_runtime_cpudetection" = no
1900 _mcpu="$cpuopt=generic"
1901 # at least i486 required, for bswap instruction
1902 _march="-march=i486"
1903 cc_check $_mcpu || _mcpu="$cpuopt=i686"
1904 cc_check $_mcpu || _mcpu=""
1905 cc_check $_march $_mcpu || _march=""
1908 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1909 ## autodetected mcpu/march parameters
1910 if test "$_target" ; then
1911 # TODO: it may be a good idea to check GCC and fall back in all cases
1912 if test "$host_arch" = "i586-i686"; then
1913 _march="-march=i586"
1914 _mcpu="$cpuopt=i686"
1915 else
1916 _march="-march=$host_arch"
1917 _mcpu="$cpuopt=$host_arch"
1920 proc="$host_arch"
1922 case "$proc" in
1923 i386) iproc=386 ;;
1924 i486) iproc=486 ;;
1925 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1926 i686|athlon*|pentium*) iproc=686 ;;
1927 *) iproc=586 ;;
1928 esac
1931 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1932 _fast_cmov="yes"
1933 else
1934 _fast_cmov="no"
1936 test $_fast_clz = "auto" && _fast_clz=yes
1938 echores "$proc"
1941 ia64)
1942 arch='ia64'
1943 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1944 iproc='ia64'
1947 x86_64|amd64)
1948 arch='x86'
1949 subarch='x86_64'
1950 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1951 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1952 iproc='x86_64'
1954 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1955 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1956 cpuopt=-mtune
1957 else
1958 cpuopt=-mcpu
1960 if test "$_runtime_cpudetection" = no ; then
1961 case "$pvendor" in
1962 AuthenticAMD)
1963 case "$pfamily" in
1964 15) proc=k8
1965 test $_fast_clz = "auto" && _fast_clz=no
1967 *) proc=amdfam10;;
1968 esac
1970 GenuineIntel)
1971 case "$pfamily" in
1972 6) proc=core2;;
1974 # 64-bit prescotts exist, but as far as GCC is concerned they
1975 # have the same capabilities as a nocona.
1976 proc=nocona
1977 test $_fast_cmov = "auto" && _fast_cmov=no
1978 test $_fast_clz = "auto" && _fast_clz=no
1980 esac
1983 proc=error;;
1984 esac
1985 fi # test "$_runtime_cpudetection" = no
1987 echocheck "GCC & CPU optimization abilities"
1988 cat > $TMPC << EOF
1989 int main(void) { return 0; }
1991 # This is a stripped-down version of the i386 fallback.
1992 if test "$_runtime_cpudetection" = no ; then
1993 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1994 cc_check -march=native && proc=native
1996 # --- AMD processors ---
1997 if test "$proc" = "amdfam10"; then
1998 cc_check -march=$proc $cpuopt=$proc || proc=k8
2000 if test "$proc" = "k8"; then
2001 cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp
2003 # This will fail if gcc version < 3.3, which is ok because earlier
2004 # versions don't really support 64-bit on amd64.
2005 # Is this a valid assumption? -Corey
2006 if test "$proc" = "athlon-xp"; then
2007 cc_check -march=$proc $cpuopt=$proc || proc=error
2009 # --- Intel processors ---
2010 if test "$proc" = "core2"; then
2011 cc_check -march=$proc $cpuopt=$proc || proc=x86-64
2013 if test "$proc" = "x86-64"; then
2014 cc_check -march=$proc $cpuopt=$proc || proc=nocona
2016 if test "$proc" = "nocona"; then
2017 cc_check -march=$proc $cpuopt=$proc || proc=pentium4
2019 if test "$proc" = "pentium4"; then
2020 cc_check -march=$proc $cpuopt=$proc || proc=error
2023 _march="-march=$proc"
2024 _mcpu="$cpuopt=$proc"
2025 if test "$proc" = "error" ; then
2026 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2027 _mcpu=""
2028 _march=""
2030 else # if test "$_runtime_cpudetection" = no
2031 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2032 _march="-march=x86-64"
2033 _mcpu="$cpuopt=generic"
2034 cc_check $_mcpu || _mcpu="x86-64"
2035 cc_check $_mcpu || _mcpu=""
2036 cc_check $_march $_mcpu || _march=""
2039 _optimizing="$proc"
2040 test $_fast_cmov = "auto" && _fast_cmov=yes
2041 test $_fast_clz = "auto" && _fast_clz=yes
2043 echores "$proc"
2046 sparc|sparc64)
2047 arch='sparc'
2048 iproc='sparc'
2049 if test "$host_arch" = "sparc64" ; then
2050 _vis='yes'
2051 proc='ultrasparc'
2052 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2053 elif sunos ; then
2054 echocheck "CPU type"
2055 karch=$(uname -m)
2056 case "$(echo $karch)" in
2057 sun4) proc=v7 ;;
2058 sun4c) proc=v7 ;;
2059 sun4d) proc=v8 ;;
2060 sun4m) proc=v8 ;;
2061 sun4u) proc=ultrasparc _vis='yes' ;;
2062 sun4v) proc=v9 ;;
2063 *) proc=v8 ;;
2064 esac
2065 echores "$proc"
2066 else
2067 proc=v8
2069 _mcpu="-mcpu=$proc"
2070 _optimizing="$proc"
2073 arm*)
2074 arch='arm'
2075 iproc='arm'
2078 avr32)
2079 arch='avr32'
2080 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2081 iproc='avr32'
2082 test $_fast_clz = "auto" && _fast_clz=yes
2085 sh|sh4)
2086 arch='sh4'
2087 iproc='sh4'
2090 ppc|ppc64|powerpc|powerpc64)
2091 arch='ppc'
2092 def_dcbzl='#define HAVE_DCBZL 0'
2093 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2094 iproc='ppc'
2096 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2097 subarch='ppc64'
2098 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2100 echocheck "CPU type"
2101 case $system_name in
2102 Linux)
2103 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2104 if test -n "$($_cpuinfo | grep altivec)"; then
2105 test $_altivec = auto && _altivec=yes
2108 Darwin)
2109 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2110 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2111 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2112 test $_altivec = auto && _altivec=yes
2115 NetBSD)
2116 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2117 case $cc_version in
2118 2*|3.0*|3.1*|3.2*|3.3*)
2121 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2122 test $_altivec = auto && _altivec=yes
2125 esac
2127 AIX)
2128 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2130 esac
2131 if test "$_altivec" = yes; then
2132 echores "$proc altivec"
2133 else
2134 _altivec=no
2135 echores "$proc"
2138 echocheck "GCC & CPU optimization abilities"
2140 if test -n "$proc"; then
2141 case "$proc" in
2142 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2143 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2144 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2145 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2146 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2147 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2148 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2149 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2150 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2151 *) ;;
2152 esac
2153 # gcc 3.1(.1) and up supports 7400 and 7450
2154 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2155 case "$proc" in
2156 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2157 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2158 *) ;;
2159 esac
2161 # gcc 3.2 and up supports 970
2162 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2163 case "$proc" in
2164 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2165 def_dcbzl='#define HAVE_DCBZL 1' ;;
2166 *) ;;
2167 esac
2169 # gcc 3.3 and up supports POWER4
2170 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2171 case "$proc" in
2172 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2173 *) ;;
2174 esac
2176 # gcc 3.4 and up supports 440*
2177 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2178 case "$proc" in
2179 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2180 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2181 *) ;;
2182 esac
2184 # gcc 4.0 and up supports POWER5
2185 if test "$_cc_major" -ge "4"; then
2186 case "$proc" in
2187 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2188 *) ;;
2189 esac
2193 if test -n "$_mcpu"; then
2194 _optimizing=$(echo $_mcpu | cut -c 8-)
2195 echores "$_optimizing"
2196 else
2197 echores "none"
2200 test $_fast_clz = "auto" && _fast_clz=yes
2204 alpha*)
2205 arch='alpha'
2206 iproc='alpha'
2207 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2209 echocheck "CPU type"
2210 cat > $TMPC << EOF
2211 int main(void) {
2212 unsigned long ver, mask;
2213 __asm__ ("implver %0" : "=r" (ver));
2214 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2215 printf("%ld-%x\n", ver, ~mask);
2216 return 0;
2219 $_cc -o "$TMPEXE" "$TMPC"
2220 case $("$TMPEXE") in
2222 0-0) proc="ev4"; _mvi="0";;
2223 1-0) proc="ev5"; _mvi="0";;
2224 1-1) proc="ev56"; _mvi="0";;
2225 1-101) proc="pca56"; _mvi="1";;
2226 2-303) proc="ev6"; _mvi="1";;
2227 2-307) proc="ev67"; _mvi="1";;
2228 2-1307) proc="ev68"; _mvi="1";;
2229 esac
2230 echores "$proc"
2232 echocheck "GCC & CPU optimization abilities"
2233 if test "$proc" = "ev68" ; then
2234 cc_check -mcpu=$proc || proc=ev67
2236 if test "$proc" = "ev67" ; then
2237 cc_check -mcpu=$proc || proc=ev6
2239 _mcpu="-mcpu=$proc"
2240 echores "$proc"
2242 test $_fast_clz = "auto" && _fast_clz=yes
2244 _optimizing="$proc"
2247 mips)
2248 arch='mips'
2249 iproc='mips'
2251 if irix ; then
2252 echocheck "CPU type"
2253 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2254 case "$(echo $proc)" in
2255 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2256 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2257 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2258 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2259 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2260 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2261 esac
2262 # gcc < 3.x does not support -mtune.
2263 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2264 _mcpu=''
2266 echores "$proc"
2269 test $_fast_clz = "auto" && _fast_clz=yes
2273 hppa)
2274 arch='pa_risc'
2275 iproc='PA-RISC'
2278 s390)
2279 arch='s390'
2280 iproc='390'
2283 s390x)
2284 arch='s390x'
2285 iproc='390x'
2288 vax)
2289 arch='vax'
2290 iproc='vax'
2293 xtensa)
2294 arch='xtensa'
2295 iproc='xtensa'
2298 generic)
2299 arch='generic'
2303 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2304 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2305 die "unsupported architecture $host_arch"
2307 esac # case "$host_arch" in
2309 if test "$_runtime_cpudetection" = yes ; then
2310 if x86 ; then
2311 test "$_cmov" != no && _cmov=yes
2312 x86_32 && _cmov=no
2313 test "$_mmx" != no && _mmx=yes
2314 test "$_3dnow" != no && _3dnow=yes
2315 test "$_3dnowext" != no && _3dnowext=yes
2316 test "$_mmxext" != no && _mmxext=yes
2317 test "$_sse" != no && _sse=yes
2318 test "$_sse2" != no && _sse2=yes
2319 test "$_ssse3" != no && _ssse3=yes
2320 test "$_mtrr" != no && _mtrr=yes
2322 if ppc; then
2323 _altivec=yes
2328 # endian testing
2329 echocheck "byte order"
2330 if test "$_big_endian" = auto ; then
2331 cat > $TMPC <<EOF
2332 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2333 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2334 int main(void) { return (int)ascii_name; }
2336 if cc_check ; then
2337 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2338 _big_endian=yes
2339 else
2340 _big_endian=no
2342 else
2343 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2346 if test "$_big_endian" = yes ; then
2347 _byte_order='big-endian'
2348 def_words_endian='#define WORDS_BIGENDIAN 1'
2349 def_bigendian='#define HAVE_BIGENDIAN 1'
2350 else
2351 _byte_order='little-endian'
2352 def_words_endian='#undef WORDS_BIGENDIAN'
2353 def_bigendian='#define HAVE_BIGENDIAN 0'
2355 echores "$_byte_order"
2358 echocheck "extern symbol prefix"
2359 cat > $TMPC << EOF
2360 int ff_extern;
2362 cc_check -c || die "Symbol mangling check failed."
2363 sym=$($_nm -P -g $TMPEXE)
2364 extern_prefix=${sym%%ff_extern*}
2365 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2366 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2367 echores $extern_prefix
2370 echocheck "assembler support of -pipe option"
2371 cat > $TMPC << EOF
2372 int main(void) { return 0; }
2374 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2375 cc_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2378 echocheck "compiler support of named assembler arguments"
2379 _named_asm_args=yes
2380 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2381 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2382 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2383 _named_asm_args=no
2384 def_named_asm_args="#undef NAMED_ASM_ARGS"
2386 echores $_named_asm_args
2389 if darwin && test "$cc_vendor" = "gnu" ; then
2390 echocheck "GCC support of -mstackrealign"
2391 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2392 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2393 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2394 # wrong code with this flag, but this can be worked around by adding
2395 # -fno-unit-at-a-time as described in the blog post at
2396 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2397 cat > $TMPC << EOF
2398 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2399 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2401 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2402 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2403 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2404 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2405 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2408 # Checking for CFLAGS
2409 _install_strip="-s"
2410 if test "$_profile" != "" || test "$_debug" != "" ; then
2411 CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
2412 _install_strip=
2413 elif test -z "$CFLAGS" ; then
2414 if test "$cc_vendor" = "intel" ; then
2415 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
2416 elif test "$cc_vendor" = "sun" ; then
2417 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2418 elif test "$cc_vendor" != "gnu" ; then
2419 CFLAGS="-O2 $_march $_mcpu $_pipe"
2420 else
2421 CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2422 extra_ldflags="$extra_ldflags -ffast-math"
2424 else
2425 _warn_CFLAGS=yes
2428 cat > $TMPC << EOF
2429 int main(void) { return 0; }
2431 if test "$cc_vendor" = "gnu" ; then
2432 cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
2433 cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
2434 cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
2435 cc_check -Wundef && CFLAGS="-Wundef $CFLAGS"
2436 cc_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
2437 cc_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
2438 else
2439 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2442 cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2443 cc_check -MD -MP && CFLAGS="-MD -MP $CFLAGS"
2446 if test -n "$LDFLAGS" ; then
2447 extra_ldflags="$extra_ldflags $LDFLAGS"
2448 _warn_CFLAGS=yes
2449 elif test "$cc_vendor" = "intel" ; then
2450 extra_ldflags="$extra_ldflags -i-static"
2452 if test -n "$CPPFLAGS" ; then
2453 extra_cflags="$extra_cflags $CPPFLAGS"
2454 _warn_CFLAGS=yes
2459 if x86_32 ; then
2460 # Checking assembler (_as) compatibility...
2461 # Added workaround for older as that reads from stdin by default - atmos
2462 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2463 echocheck "assembler ($_as $as_version)"
2465 _pref_as_version='2.9.1'
2466 echo 'nop' > $TMPS
2467 if test "$_mmx" = yes ; then
2468 echo 'emms' >> $TMPS
2470 if test "$_3dnow" = yes ; then
2471 _pref_as_version='2.10.1'
2472 echo 'femms' >> $TMPS
2474 if test "$_3dnowext" = yes ; then
2475 _pref_as_version='2.10.1'
2476 echo 'pswapd %mm0, %mm0' >> $TMPS
2478 if test "$_mmxext" = yes ; then
2479 _pref_as_version='2.10.1'
2480 echo 'movntq %mm0, (%eax)' >> $TMPS
2482 if test "$_sse" = yes ; then
2483 _pref_as_version='2.10.1'
2484 echo 'xorps %xmm0, %xmm0' >> $TMPS
2486 #if test "$_sse2" = yes ; then
2487 # _pref_as_version='2.11'
2488 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2490 if test "$_cmov" = yes ; then
2491 _pref_as_version='2.10.1'
2492 echo 'cmovb %eax, %ebx' >> $TMPS
2494 if test "$_ssse3" = yes ; then
2495 _pref_as_version='2.16.92'
2496 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2498 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2500 if test "$as_verc_fail" != yes ; then
2501 echores "ok"
2502 else
2503 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2504 echores "failed"
2505 die "obsolete binutils version"
2508 fi #if x86_32
2510 echocheck ".align is a power of two"
2511 if test "$_asmalign_pot" = auto ; then
2512 _asmalign_pot=no
2513 cat > $TMPC << EOF
2514 int main(void) { __asm__ (".align 3"); return 0; }
2516 cc_check && _asmalign_pot=yes
2518 if test "$_asmalign_pot" = "yes" ; then
2519 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2520 else
2521 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2523 echores $_asmalign_pot
2525 if x86 ; then
2526 echocheck "10 assembler operands"
2527 ten_operands=no
2528 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2529 cat > $TMPC << EOF
2530 int main(void) {
2531 int x=0;
2532 __asm__ volatile(
2534 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2536 return 0;
2539 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2540 echores $ten_operands
2542 echocheck "ebx availability"
2543 ebx_available=no
2544 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2545 cat > $TMPC << EOF
2546 int main(void) {
2547 int x;
2548 __asm__ volatile(
2549 "xor %0, %0"
2550 :"=b"(x)
2551 // just adding ebx to clobber list seems unreliable with some
2552 // compilers, e.g. Haiku's gcc 2.95
2554 // and the above check does not work for OSX 64 bit...
2555 __asm__ volatile("":::"%ebx");
2556 return 0;
2559 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2560 echores $ebx_available
2562 echocheck "PIC"
2563 pic=no
2564 cat > $TMPC << EOF
2565 int main(void) {
2566 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2567 #error PIC not enabled
2568 #endif
2569 return 0;
2572 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2573 echores $pic
2575 echocheck "yasm"
2576 if test -z "$YASMFLAGS" ; then
2577 if darwin ; then
2578 x86_64 && objformat="macho64" || objformat="macho"
2579 elif win32 ; then
2580 objformat="win32"
2581 else
2582 objformat="elf"
2584 # currently tested for Linux x86, x86_64
2585 YASMFLAGS="-f $objformat"
2586 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2587 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2588 case "$objformat" in
2589 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2590 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2591 esac
2592 else
2593 _warn_CFLAGS=yes
2596 echo "pabsw xmm0, xmm0" > $TMPS
2597 yasm_check || _yasm=""
2598 if test $_yasm ; then
2599 def_yasm='#define HAVE_YASM 1'
2600 have_yasm="yes"
2601 echores "$_yasm"
2602 else
2603 def_yasm='#define HAVE_YASM 0'
2604 have_yasm="no"
2605 echores "no"
2608 echocheck "bswap"
2609 def_bswap='#define HAVE_BSWAP 0'
2610 echo 'bswap %eax' > $TMPS
2611 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2612 echores "$bswap"
2613 fi #if x86
2616 #FIXME: This should happen before the check for CFLAGS..
2617 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2618 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2620 # check if AltiVec is supported by the compiler, and how to enable it
2621 echocheck "GCC AltiVec flags"
2622 cat > $TMPC << EOF
2623 int main(void) { return 0; }
2625 if $(cc_check -maltivec -mabi=altivec) ; then
2626 _altivec_gcc_flags="-maltivec -mabi=altivec"
2627 # check if <altivec.h> should be included
2628 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2629 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2630 inc_altivec_h='#include <altivec.h>'
2631 else
2632 cat > $TMPC << EOF
2633 int main(void) { return 0; }
2635 if $(cc_check -faltivec) ; then
2636 _altivec_gcc_flags="-faltivec"
2637 else
2638 _altivec=no
2639 _altivec_gcc_flags="none, AltiVec disabled"
2643 echores "$_altivec_gcc_flags"
2645 # check if the compiler supports braces for vector declarations
2646 cat > $TMPC << EOF
2647 $inc_altivec_h
2648 int main(void) { (vector int) {1}; return 0; }
2650 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2652 # Disable runtime cpudetection if we cannot generate AltiVec code or
2653 # AltiVec is disabled by the user.
2654 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2655 && _runtime_cpudetection=no
2657 # Show that we are optimizing for AltiVec (if enabled and supported).
2658 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2659 && _optimizing="$_optimizing altivec"
2661 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2662 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2665 if ppc ; then
2666 def_xform_asm='#define HAVE_XFORM_ASM 0'
2667 xform_asm=no
2668 echocheck "XFORM ASM support"
2669 cat > $TMPC << EOF
2670 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2672 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2673 echores "$xform_asm"
2676 if arm ; then
2677 echocheck "ARM pld instruction"
2678 cat > $TMPC << EOF
2679 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2681 pld=no
2682 cc_check && pld=yes
2683 echores "$pld"
2685 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2686 if test $_armv5te = "auto" ; then
2687 cat > $TMPC << EOF
2688 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2690 _armv5te=no
2691 cc_check && _armv5te=yes
2693 echores "$_armv5te"
2695 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2697 echocheck "ARMv6 (SIMD instructions)"
2698 if test $_armv6 = "auto" ; then
2699 cat > $TMPC << EOF
2700 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2702 _armv6=no
2703 cc_check && _armv6=yes
2705 echores "$_armv6"
2707 echocheck "ARMv6t2 (SIMD instructions)"
2708 if test $_armv6t2 = "auto" ; then
2709 cat > $TMPC << EOF
2710 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2712 _armv6t2=no
2713 cc_check && _armv6t2=yes
2715 echores "$_armv6"
2717 echocheck "ARM VFP"
2718 if test $_armvfp = "auto" ; then
2719 cat > $TMPC << EOF
2720 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2722 _armvfp=no
2723 cc_check && _armvfp=yes
2725 echores "$_armvfp"
2727 echocheck "ARM NEON"
2728 if test $neon = "auto" ; then
2729 cat > $TMPC << EOF
2730 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2732 neon=no
2733 cc_check && neon=yes
2735 echores "$neon"
2737 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2738 if test $_iwmmxt = "auto" ; then
2739 cat > $TMPC << EOF
2740 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2742 _iwmmxt=no
2743 cc_check && _iwmmxt=yes
2745 echores "$_iwmmxt"
2748 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'
2749 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2750 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2751 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2752 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2753 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2754 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2755 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2756 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2757 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2758 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2759 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2760 test "$pld" = yes && cpuexts="PLD $cpuexts"
2761 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2762 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2763 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2764 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2765 test "$neon" = yes && cpuexts="NEON $cpuexts"
2766 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2767 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2768 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2770 # Checking kernel version...
2771 if x86_32 && linux ; then
2772 _k_verc_problem=no
2773 kernel_version=$(uname -r 2>&1)
2774 echocheck "$system_name kernel version"
2775 case "$kernel_version" in
2776 '') kernel_version="?.??"; _k_verc_fail=yes;;
2777 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2778 _k_verc_problem=yes;;
2779 esac
2780 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2781 _k_verc_fail=yes
2783 if test "$_k_verc_fail" ; then
2784 echores "$kernel_version, fail"
2785 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2786 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2787 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2788 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2789 echo "2.2.x you must upgrade it to get SSE support!"
2790 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2791 else
2792 echores "$kernel_version, ok"
2796 ######################
2797 # MAIN TESTS GO HERE #
2798 ######################
2801 echocheck "-lposix"
2802 cat > $TMPC <<EOF
2803 int main(void) { return 0; }
2805 if cc_check -lposix ; then
2806 extra_ldflags="$extra_ldflags -lposix"
2807 echores "yes"
2808 else
2809 echores "no"
2812 echocheck "-lm"
2813 cat > $TMPC <<EOF
2814 int main(void) { return 0; }
2816 if cc_check -lm ; then
2817 _ld_lm="-lm"
2818 echores "yes"
2819 else
2820 _ld_lm=""
2821 echores "no"
2825 echocheck "langinfo"
2826 if test "$_langinfo" = auto ; then
2827 cat > $TMPC <<EOF
2828 #include <langinfo.h>
2829 int main(void) { nl_langinfo(CODESET); return 0; }
2831 _langinfo=no
2832 cc_check && _langinfo=yes
2834 if test "$_langinfo" = yes ; then
2835 def_langinfo='#define HAVE_LANGINFO 1'
2836 else
2837 def_langinfo='#undef HAVE_LANGINFO'
2839 echores "$_langinfo"
2842 echocheck "translation support"
2843 if test "$_translation" = yes; then
2844 def_translation="#define CONFIG_TRANSLATION 1"
2845 else
2846 def_translation="#undef CONFIG_TRANSLATION"
2848 echores "$_translation"
2850 echocheck "language"
2851 # Set preferred languages, "all" uses English as main language.
2852 test -z "$language" && language=$LINGUAS
2853 test -z "$language_doc" && language_doc=$language
2854 test -z "$language_man" && language_man=$language
2855 test -z "$language_msg" && language_msg="all"
2856 language_doc=$(echo $language_doc | tr , " ")
2857 language_man=$(echo $language_man | tr , " ")
2858 language_msg=$(echo $language_msg | tr , " ")
2860 test "$language_doc" = "all" && language_doc=$doc_lang_all
2861 test "$language_man" = "all" && language_man=$man_lang_all
2862 test "$language_msg" = "all" && language_msg=$msg_lang_all
2864 if test "$_translation" != yes ; then
2865 language_msg=""
2868 # Prune non-existing translations from language lists.
2869 # Set message translation to the first available language.
2870 # Fall back on English.
2871 for lang in $language_doc ; do
2872 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2873 done
2874 language_doc=$tmp_language_doc
2875 test -z "$language_doc" && language_doc=en
2877 for lang in $language_man ; do
2878 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2879 done
2880 language_man=$tmp_language_man
2881 test -z "$language_man" && language_man=en
2883 for lang in $language_msg ; do
2884 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2885 done
2886 language_msg=$tmp_language_msg
2888 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2891 echocheck "enable sighandler"
2892 if test "$_sighandler" = yes ; then
2893 def_sighandler='#define CONFIG_SIGHANDLER 1'
2894 else
2895 def_sighandler='#undef CONFIG_SIGHANDLER'
2897 echores "$_sighandler"
2899 echocheck "runtime cpudetection"
2900 if test "$_runtime_cpudetection" = yes ; then
2901 _optimizing="Runtime CPU-Detection enabled"
2902 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2903 else
2904 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2906 echores "$_runtime_cpudetection"
2909 echocheck "restrict keyword"
2910 for restrict_keyword in restrict __restrict __restrict__ ; do
2911 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2912 if cc_check; then
2913 def_restrict_keyword=$restrict_keyword
2914 break;
2916 done
2917 if [ -n "$def_restrict_keyword" ]; then
2918 echores "$def_restrict_keyword"
2919 else
2920 echores "none"
2922 # Avoid infinite recursion loop ("#define restrict restrict")
2923 if [ "$def_restrict_keyword" != "restrict" ]; then
2924 def_restrict_keyword="#define restrict $def_restrict_keyword"
2925 else
2926 def_restrict_keyword=""
2930 echocheck "__builtin_expect"
2931 # GCC branch prediction hint
2932 cat > $TMPC << EOF
2933 int foo(int a) {
2934 a = __builtin_expect(a, 10);
2935 return a == 10 ? 0 : 1;
2937 int main(void) { return foo(10) && foo(0); }
2939 _builtin_expect=no
2940 cc_check && _builtin_expect=yes
2941 if test "$_builtin_expect" = yes ; then
2942 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2943 else
2944 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2946 echores "$_builtin_expect"
2949 echocheck "kstat"
2950 cat > $TMPC << EOF
2951 #include <kstat.h>
2952 int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; }
2954 _kstat=no
2955 cc_check -lkstat && _kstat=yes
2956 if test "$_kstat" = yes ; then
2957 def_kstat="#define HAVE_LIBKSTAT 1"
2958 extra_ldflags="$extra_ldflags -lkstat"
2959 else
2960 def_kstat="#undef HAVE_LIBKSTAT"
2962 echores "$_kstat"
2965 echocheck "posix4"
2966 # required for nanosleep on some systems
2967 cat > $TMPC << EOF
2968 #include <time.h>
2969 int main(void) { (void) nanosleep(0, 0); return 0; }
2971 _posix4=no
2972 cc_check -lposix4 && _posix4=yes
2973 if test "$_posix4" = yes ; then
2974 extra_ldflags="$extra_ldflags -lposix4"
2976 echores "$_posix4"
2978 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2979 echocheck $func
2980 cat > $TMPC << EOF
2981 #include <math.h>
2982 int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; }
2984 eval _$func=no
2985 cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2986 if eval test "x\$_$func" = "xyes"; then
2987 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2988 echores yes
2989 else
2990 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2991 echores no
2993 done
2996 echocheck "mkstemp"
2997 cat > $TMPC << EOF
2998 #include <stdlib.h>
2999 int main(void) { char a; mkstemp(&a); return 0; }
3001 _mkstemp=no
3002 cc_check && _mkstemp=yes
3003 if test "$_mkstemp" = yes ; then
3004 def_mkstemp='#define HAVE_MKSTEMP 1'
3005 else
3006 def_mkstemp='#undef HAVE_MKSTEMP'
3008 echores "$_mkstemp"
3011 echocheck "nanosleep"
3012 # also check for nanosleep
3013 cat > $TMPC << EOF
3014 #include <time.h>
3015 int main(void) { (void) nanosleep(0, 0); return 0; }
3017 _nanosleep=no
3018 cc_check && _nanosleep=yes
3019 if test "$_nanosleep" = yes ; then
3020 def_nanosleep='#define HAVE_NANOSLEEP 1'
3021 else
3022 def_nanosleep='#undef HAVE_NANOSLEEP'
3024 echores "$_nanosleep"
3027 echocheck "socklib"
3028 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
3029 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
3030 cat > $TMPC << EOF
3031 #include <netdb.h>
3032 #include <sys/socket.h>
3033 int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
3035 _socklib=no
3036 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3037 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3038 done
3039 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3040 if test $_winsock2_h = auto ; then
3041 _winsock2_h=no
3042 cat > $TMPC << EOF
3043 #include <winsock2.h>
3044 int main(void) { (void) gethostbyname(0); return 0; }
3046 cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3048 test "$_ld_sock" && res_comment="using $_ld_sock"
3049 echores "$_socklib"
3052 if test $_winsock2_h = yes ; then
3053 _ld_sock="-lws2_32"
3054 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3055 else
3056 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3060 echocheck "arpa/inet.h"
3061 arpa_inet_h=no
3062 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3063 header_check arpa/inet.h && arpa_inet_h=yes &&
3064 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3065 echores "$arpa_inet_h"
3068 echocheck "inet_pton()"
3069 def_inet_pton='#define HAVE_INET_PTON 0'
3070 inet_pton=no
3071 cat > $TMPC << EOF
3072 #include <sys/types.h>
3073 #include <sys/socket.h>
3074 #include <arpa/inet.h>
3075 int main(void) { (void) inet_pton(0, 0, 0); return 0; }
3077 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3078 cc_check $_ld_tmp && inet_pton=yes && break
3079 done
3080 if test $inet_pton = yes ; then
3081 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3082 def_inet_pton='#define HAVE_INET_PTON 1'
3084 echores "$inet_pton"
3087 echocheck "inet_aton()"
3088 def_inet_aton='#define HAVE_INET_ATON 0'
3089 inet_aton=no
3090 cat > $TMPC << EOF
3091 #include <sys/types.h>
3092 #include <sys/socket.h>
3093 #include <arpa/inet.h>
3094 int main(void) { (void) inet_aton(0, 0); return 0; }
3096 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3097 cc_check $_ld_tmp && inet_aton=yes && break
3098 done
3099 if test $inet_aton = yes ; then
3100 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3101 def_inet_aton='#define HAVE_INET_ATON 1'
3103 echores "$inet_aton"
3106 echocheck "socklen_t"
3107 _socklen_t=no
3108 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3109 cat > $TMPC << EOF
3110 #include <$header>
3111 int main(void) { socklen_t v = 0; return v; }
3113 cc_check && _socklen_t=yes && break
3114 done
3115 if test "$_socklen_t" = yes ; then
3116 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3117 else
3118 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3120 echores "$_socklen_t"
3123 echocheck "closesocket()"
3124 _closesocket=no
3125 cat > $TMPC << EOF
3126 #include <winsock2.h>
3127 int main(void) { closesocket(~0); return 0; }
3129 cc_check $_ld_sock && _closesocket=yes
3130 if test "$_closesocket" = yes ; then
3131 def_closesocket='#define HAVE_CLOSESOCKET 1'
3132 else
3133 def_closesocket='#define HAVE_CLOSESOCKET 0'
3135 echores "$_closesocket"
3138 echocheck "network"
3139 test $_winsock2_h = no && test $inet_pton = no &&
3140 test $inet_aton = no && _network=no
3141 if test "$_network" = yes ; then
3142 def_network='#define CONFIG_NETWORK 1'
3143 extra_ldflags="$extra_ldflags $_ld_sock"
3144 inputmodules="network $inputmodules"
3145 else
3146 noinputmodules="network $noinputmodules"
3147 def_network='#undef CONFIG_NETWORK'
3148 _ftp=no
3150 echores "$_network"
3153 echocheck "inet6"
3154 if test "$_inet6" = auto ; then
3155 cat > $TMPC << EOF
3156 #include <sys/types.h>
3157 #if !defined(_WIN32) || defined(__CYGWIN__)
3158 #include <sys/socket.h>
3159 #include <netinet/in.h>
3160 #else
3161 #include <ws2tcpip.h>
3162 #endif
3163 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3165 _inet6=no
3166 if cc_check $_ld_sock ; then
3167 _inet6=yes
3170 if test "$_inet6" = yes ; then
3171 def_inet6='#define HAVE_AF_INET6 1'
3172 else
3173 def_inet6='#undef HAVE_AF_INET6'
3175 echores "$_inet6"
3178 echocheck "gethostbyname2"
3179 if test "$_gethostbyname2" = auto ; then
3180 cat > $TMPC << EOF
3181 #include <sys/types.h>
3182 #include <sys/socket.h>
3183 #include <netdb.h>
3184 int main(void) { gethostbyname2("", AF_INET); return 0; }
3186 _gethostbyname2=no
3187 if cc_check ; then
3188 _gethostbyname2=yes
3191 if test "$_gethostbyname2" = yes ; then
3192 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3193 else
3194 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3196 echores "$_gethostbyname2"
3199 echocheck "inttypes.h (required)"
3200 _inttypes=no
3201 header_check inttypes.h && _inttypes=yes
3202 echores "$_inttypes"
3204 if test "$_inttypes" = no ; then
3205 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3206 header_check sys/bitypes.h && _inttypes=yes
3207 if test "$_inttypes" = yes ; then
3208 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."
3209 else
3210 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3215 echocheck "int_fastXY_t in inttypes.h"
3216 cat > $TMPC << EOF
3217 #include <inttypes.h>
3218 int main(void) {
3219 volatile int_fast16_t v= 0;
3220 return v; }
3222 _fast_inttypes=no
3223 cc_check && _fast_inttypes=yes
3224 if test "$_fast_inttypes" = no ; then
3225 def_fast_inttypes='
3226 typedef signed char int_fast8_t;
3227 typedef signed int int_fast16_t;
3228 typedef signed int int_fast32_t;
3229 typedef signed long long int_fast64_t;
3230 typedef unsigned char uint_fast8_t;
3231 typedef unsigned int uint_fast16_t;
3232 typedef unsigned int uint_fast32_t;
3233 typedef unsigned long long uint_fast64_t;'
3235 echores "$_fast_inttypes"
3238 echocheck "malloc.h"
3239 _malloc=no
3240 header_check malloc.h && _malloc=yes
3241 if test "$_malloc" = yes ; then
3242 def_malloc_h='#define HAVE_MALLOC_H 1'
3243 else
3244 def_malloc_h='#define HAVE_MALLOC_H 0'
3246 echores "$_malloc"
3249 echocheck "memalign()"
3250 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3251 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3252 cat > $TMPC << EOF
3253 #include <malloc.h>
3254 int main(void) { (void) memalign(64, sizeof(char)); return 0; }
3256 _memalign=no
3257 cc_check && _memalign=yes
3258 if test "$_memalign" = yes ; then
3259 def_memalign='#define HAVE_MEMALIGN 1'
3260 else
3261 def_memalign='#define HAVE_MEMALIGN 0'
3262 def_map_memalign='#define memalign(a,b) malloc(b)'
3263 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3265 echores "$_memalign"
3268 echocheck "posix_memalign()"
3269 posix_memalign=no
3270 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3271 cat > $TMPC << EOF
3272 #define _XOPEN_SOURCE 600
3273 #include <stdlib.h>
3274 int main(void) { posix_memalign(NULL, 0, 0); }
3276 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3277 echores "$posix_memalign"
3280 echocheck "alloca.h"
3281 cat > $TMPC << EOF
3282 #include <alloca.h>
3283 int main(void) { (void) alloca(0); return 0; }
3285 _alloca=no
3286 cc_check && _alloca=yes
3287 if cc_check ; then
3288 def_alloca_h='#define HAVE_ALLOCA_H 1'
3289 else
3290 def_alloca_h='#undef HAVE_ALLOCA_H'
3292 echores "$_alloca"
3295 echocheck "fastmemcpy"
3296 if test "$_fastmemcpy" = yes ; then
3297 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3298 else
3299 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3301 echores "$_fastmemcpy"
3304 echocheck "mman.h"
3305 cat > $TMPC << EOF
3306 #include <sys/types.h>
3307 #include <sys/mman.h>
3308 int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; }
3310 _mman=no
3311 cc_check && _mman=yes
3312 if test "$_mman" = yes ; then
3313 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3314 else
3315 def_mman_h='#undef HAVE_SYS_MMAN_H'
3316 os2 && _need_mmap=yes
3318 echores "$_mman"
3320 cat > $TMPC << EOF
3321 #include <sys/types.h>
3322 #include <sys/mman.h>
3323 int main(void) { void *p = MAP_FAILED; return 0; }
3325 _mman_has_map_failed=no
3326 cc_check && _mman_has_map_failed=yes
3327 if test "$_mman_has_map_failed" = yes ; then
3328 def_mman_has_map_failed=''
3329 else
3330 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3333 echocheck "dynamic loader"
3334 cat > $TMPC << EOF
3335 #include <stddef.h>
3336 #include <dlfcn.h>
3337 int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; }
3339 _dl=no
3340 for _ld_tmp in "" "-ldl" ; do
3341 cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3342 done
3343 if test "$_dl" = yes ; then
3344 def_dl='#define HAVE_LIBDL 1'
3345 else
3346 def_dl='#undef HAVE_LIBDL'
3348 echores "$_dl"
3351 echocheck "dynamic a/v plugins support"
3352 if test "$_dl" = no ; then
3353 _dynamic_plugins=no
3355 if test "$_dynamic_plugins" = yes ; then
3356 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3357 else
3358 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3360 echores "$_dynamic_plugins"
3363 def_threads='#define HAVE_THREADS 0'
3365 echocheck "pthread"
3366 if linux ; then
3367 THREAD_CFLAGS=-D_REENTRANT
3368 elif freebsd || netbsd || openbsd || bsdos ; then
3369 THREAD_CFLAGS=-D_THREAD_SAFE
3371 if test "$_pthreads" = auto ; then
3372 cat > $TMPC << EOF
3373 #include <pthread.h>
3374 void* func(void *arg) { return arg; }
3375 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3377 _pthreads=no
3378 if ! hpux ; then
3379 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3380 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3381 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3382 done
3385 if test "$_pthreads" = yes ; then
3386 test $_ld_pthread && res_comment="using $_ld_pthread"
3387 def_pthreads='#define HAVE_PTHREADS 1'
3388 def_threads='#define HAVE_THREADS 1'
3389 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3390 else
3391 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3392 def_pthreads='#undef HAVE_PTHREADS'
3393 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3394 mingw32 || _win32dll=no
3396 echores "$_pthreads"
3398 if cygwin ; then
3399 if test "$_pthreads" = yes ; then
3400 def_pthread_cache="#define PTHREAD_CACHE 1"
3401 else
3402 _stream_cache=no
3403 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3407 echocheck "w32threads"
3408 if test "$_pthreads" = yes ; then
3409 res_comment="using pthread instead"
3410 _w32threads=no
3412 if test "$_w32threads" = auto ; then
3413 _w32threads=no
3414 mingw32 && _w32threads=yes
3416 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3417 echores "$_w32threads"
3419 echocheck "rpath"
3420 netbsd &&_rpath=yes
3421 if test "$_rpath" = yes ; then
3422 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3423 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3424 done
3425 extra_ldflags=$tmp
3427 echores "$_rpath"
3429 echocheck "iconv"
3430 if test "$_iconv" = auto ; then
3431 cat > $TMPC << EOF
3432 #include <stdio.h>
3433 #include <unistd.h>
3434 #include <iconv.h>
3435 #define INBUFSIZE 1024
3436 #define OUTBUFSIZE 4096
3438 char inbuffer[INBUFSIZE];
3439 char outbuffer[OUTBUFSIZE];
3441 int main(void) {
3442 size_t numread;
3443 iconv_t icdsc;
3444 char *tocode="UTF-8";
3445 char *fromcode="cp1250";
3446 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3447 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3448 char *iptr=inbuffer;
3449 char *optr=outbuffer;
3450 size_t inleft=numread;
3451 size_t outleft=OUTBUFSIZE;
3452 if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft)
3453 != (size_t)(-1)) {
3454 write(1, outbuffer, OUTBUFSIZE - outleft);
3457 if (iconv_close(icdsc) == -1)
3460 return 0;
3463 _iconv=no
3464 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3465 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3466 _iconv=yes && break
3467 done
3469 if test "$_iconv" = yes ; then
3470 def_iconv='#define CONFIG_ICONV 1'
3471 else
3472 def_iconv='#undef CONFIG_ICONV'
3474 echores "$_iconv"
3477 echocheck "soundcard.h"
3478 _soundcard_h=no
3479 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3480 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3481 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3482 header_check $_soundcard_header && _soundcard_h=yes &&
3483 res_comment="$_soundcard_header" && break
3484 done
3486 if test "$_soundcard_h" = yes ; then
3487 if test $_soundcard_header = "sys/soundcard.h"; then
3488 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3489 else
3490 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3493 echores "$_soundcard_h"
3496 echocheck "sys/dvdio.h"
3497 _dvdio=no
3498 header_check sys/dvdio.h && _dvdio=yes
3499 if test "$_dvdio" = yes ; then
3500 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3501 else
3502 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3504 echores "$_dvdio"
3507 echocheck "sys/cdio.h"
3508 _cdio=no
3509 header_check sys/cdio.h && _cdio=yes
3510 if test "$_cdio" = yes ; then
3511 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3512 else
3513 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3515 echores "$_cdio"
3518 echocheck "linux/cdrom.h"
3519 _cdrom=no
3520 header_check linux/cdrom.h && _cdrom=yes
3521 if test "$_cdrom" = yes ; then
3522 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3523 else
3524 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3526 echores "$_cdrom"
3529 echocheck "dvd.h"
3530 _dvd=no
3531 header_check dvd.h && _dvd=yes
3532 if test "$_dvd" = yes ; then
3533 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3534 else
3535 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3537 echores "$_dvd"
3540 if bsdos; then
3541 echocheck "BSDI dvd.h"
3542 _bsdi_dvd=no
3543 header_check dvd.h && _bsdi_dvd=yes
3544 if test "$_bsdi_dvd" = yes ; then
3545 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3546 else
3547 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3549 echores "$_bsdi_dvd"
3550 fi #if bsdos
3553 if hpux; then
3554 # also used by AIX, but AIX does not support VCD and/or libdvdread
3555 echocheck "HP-UX SCSI header"
3556 _hpux_scsi_h=no
3557 header_check sys/scsi.h && _hpux_scsi_h=yes
3558 if test "$_hpux_scsi_h" = yes ; then
3559 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3560 else
3561 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3563 echores "$_hpux_scsi_h"
3564 fi #if hpux
3567 if sunos; then
3568 echocheck "userspace SCSI headers (Solaris)"
3569 _sol_scsi_h=no
3570 header_check sys/scsi/scsi_types.h && header_check sys/scsi/impl/uscsi.h &&
3571 _sol_scsi_h=yes
3572 if test "$_sol_scsi_h" = yes ; then
3573 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3574 else
3575 def_sol_scsi_h='#undef SOLARIS_USCSI'
3577 echores "$_sol_scsi_h"
3578 fi #if sunos
3581 echocheck "termcap"
3582 if test "$_termcap" = auto ; then
3583 cat > $TMPC <<EOF
3584 #include <stddef.h>
3585 #include <term.h>
3586 int main(void) { tgetent(NULL, NULL); return 0; }
3588 _termcap=no
3589 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3590 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3591 && _termcap=yes && break
3592 done
3594 if test "$_termcap" = yes ; then
3595 def_termcap='#define HAVE_TERMCAP 1'
3596 test $_ld_tmp && res_comment="using $_ld_tmp"
3597 else
3598 def_termcap='#undef HAVE_TERMCAP'
3600 echores "$_termcap"
3603 echocheck "termios"
3604 def_termios='#undef HAVE_TERMIOS'
3605 def_termios_h='#undef HAVE_TERMIOS_H'
3606 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3607 if test "$_termios" = auto ; then
3608 _termios=no
3609 for _termios_header in "termios.h" "sys/termios.h"; do
3610 header_check $_termios_header && _termios=yes &&
3611 res_comment="using $_termios_header" && break
3612 done
3615 if test "$_termios" = yes ; then
3616 def_termios='#define HAVE_TERMIOS 1'
3617 if test "$_termios_header" = "termios.h" ; then
3618 def_termios_h='#define HAVE_TERMIOS_H 1'
3619 else
3620 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3623 echores "$_termios"
3626 echocheck "shm"
3627 if test "$_shm" = auto ; then
3628 cat > $TMPC << EOF
3629 #include <sys/types.h>
3630 #include <sys/shm.h>
3631 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3633 _shm=no
3634 cc_check && _shm=yes
3636 if test "$_shm" = yes ; then
3637 def_shm='#define HAVE_SHM 1'
3638 else
3639 def_shm='#undef HAVE_SHM'
3641 echores "$_shm"
3644 echocheck "strsep()"
3645 cat > $TMPC << EOF
3646 #include <string.h>
3647 int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; }
3649 _strsep=no
3650 cc_check && _strsep=yes
3651 if test "$_strsep" = yes ; then
3652 def_strsep='#define HAVE_STRSEP 1'
3653 _need_strsep=no
3654 else
3655 def_strsep='#undef HAVE_STRSEP'
3656 _need_strsep=yes
3658 echores "$_strsep"
3661 echocheck "vsscanf()"
3662 cat > $TMPC << EOF
3663 #define _ISOC99_SOURCE
3664 #include <stdarg.h>
3665 #include <stdio.h>
3666 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3668 _vsscanf=no
3669 cc_check && _vsscanf=yes
3670 if test "$_vsscanf" = yes ; then
3671 def_vsscanf='#define HAVE_VSSCANF 1'
3672 _need_vsscanf=no
3673 else
3674 def_vsscanf='#undef HAVE_VSSCANF'
3675 _need_vsscanf=yes
3677 echores "$_vsscanf"
3680 echocheck "swab()"
3681 cat > $TMPC << EOF
3682 #define _XOPEN_SOURCE 600
3683 #include <unistd.h>
3684 int main(void) { swab(0, 0, 0); return 0; }
3686 _swab=no
3687 cc_check && _swab=yes
3688 if test "$_swab" = yes ; then
3689 def_swab='#define HAVE_SWAB 1'
3690 _need_swab=no
3691 else
3692 def_swab='#undef HAVE_SWAB'
3693 _need_swab=yes
3695 echores "$_swab"
3697 echocheck "POSIX select()"
3698 cat > $TMPC << EOF
3699 #include <stdio.h>
3700 #include <stdlib.h>
3701 #include <sys/types.h>
3702 #include <string.h>
3703 #include <sys/time.h>
3704 #include <unistd.h>
3705 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3707 _posix_select=no
3708 def_posix_select='#undef HAVE_POSIX_SELECT'
3709 #select() of kLIBC (OS/2) supports socket only
3710 ! os2 && cc_check && _posix_select=yes \
3711 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3712 echores "$_posix_select"
3715 echocheck "audio select()"
3716 if test "$_select" = no ; then
3717 def_select='#undef HAVE_AUDIO_SELECT'
3718 elif test "$_select" = yes ; then
3719 def_select='#define HAVE_AUDIO_SELECT 1'
3721 echores "$_select"
3724 echocheck "gettimeofday()"
3725 cat > $TMPC << EOF
3726 #include <sys/time.h>
3727 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3729 _gettimeofday=no
3730 cc_check && _gettimeofday=yes
3731 if test "$_gettimeofday" = yes ; then
3732 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3733 _need_gettimeofday=no
3734 else
3735 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3736 _need_gettimeofday=yes
3738 echores "$_gettimeofday"
3741 echocheck "glob()"
3742 cat > $TMPC << EOF
3743 #include <stdio.h>
3744 #include <glob.h>
3745 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3747 _glob=no
3748 cc_check && _glob=yes
3749 if test "$_glob" = yes ; then
3750 def_glob='#define HAVE_GLOB 1'
3751 _need_glob=no
3752 else
3753 def_glob='#undef HAVE_GLOB'
3754 _need_glob=yes
3756 echores "$_glob"
3759 echocheck "setenv()"
3760 cat > $TMPC << EOF
3761 #include <stdlib.h>
3762 int main(void) { setenv("","",0); return 0; }
3764 _setenv=no
3765 cc_check && _setenv=yes
3766 if test "$_setenv" = yes ; then
3767 def_setenv='#define HAVE_SETENV 1'
3768 _need_setenv=no
3769 else
3770 def_setenv='#undef HAVE_SETENV'
3771 _need_setenv=yes
3773 echores "$_setenv"
3776 echocheck "setmode()"
3777 _setmode=no
3778 def_setmode='#define HAVE_SETMODE 0'
3779 cat > $TMPC << EOF
3780 #include <io.h>
3781 int main(void) { setmode(0, 0); return 0; }
3783 cc_check && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3784 echores "$_setmode"
3787 if sunos; then
3788 echocheck "sysi86()"
3789 cat > $TMPC << EOF
3790 #include <sys/sysi86.h>
3791 int main(void) { sysi86(0); return 0; }
3793 _sysi86=no
3794 cc_check && _sysi86=yes
3795 if test "$_sysi86" = yes ; then
3796 def_sysi86='#define HAVE_SYSI86 1'
3797 cat > $TMPC << EOF
3798 #include <sys/sysi86.h>
3799 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3801 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3802 else
3803 def_sysi86='#undef HAVE_SYSI86'
3805 echores "$_sysi86"
3806 fi #if sunos
3809 echocheck "sys/sysinfo.h"
3810 cat > $TMPC << EOF
3811 #include <sys/sysinfo.h>
3812 int main(void) {
3813 struct sysinfo s_info;
3814 sysinfo(&s_info);
3815 return 0;
3818 _sys_sysinfo=no
3819 cc_check && _sys_sysinfo=yes
3820 if test "$_sys_sysinfo" = yes ; then
3821 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3822 else
3823 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3825 echores "$_sys_sysinfo"
3828 if darwin; then
3830 echocheck "Mac OS X Finder Support"
3831 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3832 if test "$_macosx_finder" = yes ; then
3833 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3834 extra_ldflags="$extra_ldflags -framework Carbon"
3836 echores "$_macosx_finder"
3838 echocheck "Mac OS X Bundle file locations"
3839 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3840 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3841 if test "$_macosx_bundle" = yes ; then
3842 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3843 extra_ldflags="$extra_ldflags -framework Carbon"
3845 echores "$_macosx_bundle"
3847 echocheck "Apple Remote"
3848 if test "$_apple_remote" = auto ; then
3849 _apple_remote=no
3850 cat > $TMPC <<EOF
3851 #include <stdio.h>
3852 #include <IOKit/IOCFPlugIn.h>
3853 int main(void) {
3854 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3855 CFMutableDictionaryRef hidMatchDictionary;
3856 IOReturn ioReturnValue;
3858 // Set up a matching dictionary to search the I/O Registry by class.
3859 // name for all HID class devices
3860 hidMatchDictionary = IOServiceMatching("AppleIRController");
3862 // Now search I/O Registry for matching devices.
3863 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3864 hidMatchDictionary, &hidObjectIterator);
3866 // If search is unsuccessful, return nonzero.
3867 if (ioReturnValue != kIOReturnSuccess ||
3868 !IOIteratorIsValid(hidObjectIterator)) {
3869 return 1;
3871 return 0;
3874 cc_check -framework IOKit && tmp_run && _apple_remote=yes
3876 if test "$_apple_remote" = yes ; then
3877 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3878 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3879 else
3880 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3882 echores "$_apple_remote"
3884 fi #if darwin
3886 if linux; then
3888 echocheck "Apple IR"
3889 if test "$_apple_ir" = auto ; then
3890 _apple_ir=no
3891 cat > $TMPC <<EOF
3892 #include <linux/types.h>
3893 #include <linux/input.h>
3894 int main(void) {
3895 struct input_event ev;
3896 struct input_id id;
3897 return 0;
3900 cc_check && _apple_ir=yes
3902 if test "$_apple_ir" = yes ; then
3903 def_apple_ir='#define CONFIG_APPLE_IR 1'
3904 else
3905 def_apple_ir='#undef CONFIG_APPLE_IR'
3907 echores "$_apple_ir"
3908 fi #if linux
3910 echocheck "pkg-config"
3911 _pkg_config=pkg-config
3912 if $($_pkg_config --version > /dev/null 2>&1); then
3913 if test "$_ld_static"; then
3914 _pkg_config="$_pkg_config --static"
3916 echores "yes"
3917 else
3918 _pkg_config=false
3919 echores "no"
3923 echocheck "Samba support (libsmbclient)"
3924 if test "$_smb" = yes; then
3925 extra_ldflags="$extra_ldflags -lsmbclient"
3927 if test "$_smb" = auto; then
3928 _smb=no
3929 cat > $TMPC << EOF
3930 #include <libsmbclient.h>
3931 int main(void) { smbc_opendir("smb://"); return 0; }
3933 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3934 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3935 _smb=yes && break
3936 done
3939 if test "$_smb" = yes; then
3940 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3941 inputmodules="smb $inputmodules"
3942 else
3943 def_smb="#undef CONFIG_LIBSMBCLIENT"
3944 noinputmodules="smb $noinputmodules"
3946 echores "$_smb"
3949 #########
3950 # VIDEO #
3951 #########
3954 echocheck "tdfxfb"
3955 if test "$_tdfxfb" = yes ; then
3956 def_tdfxfb='#define CONFIG_TDFXFB 1'
3957 vomodules="tdfxfb $vomodules"
3958 else
3959 def_tdfxfb='#undef CONFIG_TDFXFB'
3960 novomodules="tdfxfb $novomodules"
3962 echores "$_tdfxfb"
3964 echocheck "s3fb"
3965 if test "$_s3fb" = yes ; then
3966 def_s3fb='#define CONFIG_S3FB 1'
3967 vomodules="s3fb $vomodules"
3968 else
3969 def_s3fb='#undef CONFIG_S3FB'
3970 novomodules="s3fb $novomodules"
3972 echores "$_s3fb"
3974 echocheck "wii"
3975 if test "$_wii" = yes ; then
3976 def_wii='#define CONFIG_WII 1'
3977 vomodules="wii $vomodules"
3978 else
3979 def_wii='#undef CONFIG_WII'
3980 novomodules="wii $novomodules"
3982 echores "$_wii"
3984 echocheck "tdfxvid"
3985 if test "$_tdfxvid" = yes ; then
3986 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3987 vomodules="tdfx_vid $vomodules"
3988 else
3989 def_tdfxvid='#undef CONFIG_TDFX_VID'
3990 novomodules="tdfx_vid $novomodules"
3992 echores "$_tdfxvid"
3994 echocheck "xvr100"
3995 if test "$_xvr100" = auto ; then
3996 cat > $TMPC << EOF
3997 #include <unistd.h>
3998 #include <sys/fbio.h>
3999 #include <sys/visual_io.h>
4000 int main(void) {
4001 struct vis_identifier ident;
4002 struct fbgattr attr;
4003 ioctl(0, VIS_GETIDENTIFIER, &ident);
4004 ioctl(0, FBIOGATTR, &attr);
4005 return 0;
4008 _xvr100=no
4009 cc_check && _xvr100=yes
4011 if test "$_xvr100" = yes ; then
4012 def_xvr100='#define CONFIG_XVR100 1'
4013 vomodules="xvr100 $vomodules"
4014 else
4015 def_tdfxvid='#undef CONFIG_XVR100'
4016 novomodules="xvr100 $novomodules"
4018 echores "$_xvr100"
4020 echocheck "tga"
4021 if test "$_tga" = yes ; then
4022 def_tga='#define CONFIG_TGA 1'
4023 vomodules="tga $vomodules"
4024 else
4025 def_tga='#undef CONFIG_TGA'
4026 novomodules="tga $novomodules"
4028 echores "$_tga"
4031 echocheck "md5sum support"
4032 if test "$_md5sum" = yes; then
4033 def_md5sum="#define CONFIG_MD5SUM 1"
4034 vomodules="md5sum $vomodules"
4035 else
4036 def_md5sum="#undef CONFIG_MD5SUM"
4037 novomodules="md5sum $novomodules"
4039 echores "$_md5sum"
4042 echocheck "yuv4mpeg support"
4043 if test "$_yuv4mpeg" = yes; then
4044 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
4045 vomodules="yuv4mpeg $vomodules"
4046 else
4047 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
4048 novomodules="yuv4mpeg $novomodules"
4050 echores "$_yuv4mpeg"
4053 echocheck "bl"
4054 if test "$_bl" = yes ; then
4055 def_bl='#define CONFIG_BL 1'
4056 vomodules="bl $vomodules"
4057 else
4058 def_bl='#undef CONFIG_BL'
4059 novomodules="bl $novomodules"
4061 echores "$_bl"
4064 echocheck "DirectFB"
4065 if test "$_directfb" = auto ; then
4066 _directfb=no
4067 cat > $TMPC <<EOF
4068 #include <directfb.h>
4069 int main(void) { DirectFBInit(0, 0); return 0; }
4071 for _inc_tmp in "" -I/usr/local/include/directfb \
4072 -I/usr/include/directfb -I/usr/local/include; do
4073 cc_check $_inc_tmp -ldirectfb && _directfb=yes && \
4074 extra_cflags="$extra_cflags $_inc_tmp" && break
4075 done
4078 dfb_version() {
4079 expr $1 \* 65536 + $2 \* 256 + $3
4082 if test "$_directfb" = yes; then
4083 cat > $TMPC << EOF
4084 #include <directfb_version.h>
4086 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4089 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4090 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4091 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4092 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4093 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4094 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4095 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4096 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4097 res_comment="$_directfb_version"
4098 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4099 else
4100 def_directfb_version='#undef DIRECTFBVERSION'
4101 _directfb=no
4102 res_comment="version >=0.9.13 required"
4104 else
4105 _directfb=no
4106 res_comment="failed to get version"
4109 echores "$_directfb"
4111 if test "$_directfb" = yes ; then
4112 def_directfb='#define CONFIG_DIRECTFB 1'
4113 vomodules="directfb $vomodules"
4114 libs_mplayer="$libs_mplayer -ldirectfb"
4115 else
4116 def_directfb='#undef CONFIG_DIRECTFB'
4117 novomodules="directfb $novomodules"
4119 if test "$_dfbmga" = yes; then
4120 vomodules="dfbmga $vomodules"
4121 def_dfbmga='#define CONFIG_DFBMGA 1'
4122 else
4123 novomodules="dfbmga $novomodules"
4124 def_dfbmga='#undef CONFIG_DFBMGA'
4128 echocheck "X11 headers presence"
4129 _x11_headers="no"
4130 res_comment="check if the dev(el) packages are installed"
4131 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4132 if test -f "$I/X11/Xlib.h" ; then
4133 _x11_headers="yes"
4134 res_comment=""
4135 break
4137 done
4138 if test $_cross_compile = no; then
4139 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4140 /usr/include/X11R6 /usr/openwin/include ; do
4141 if test -f "$I/X11/Xlib.h" ; then
4142 extra_cflags="$extra_cflags -I$I"
4143 _x11_headers="yes"
4144 res_comment="using $I"
4145 break
4147 done
4149 echores "$_x11_headers"
4152 echocheck "X11"
4153 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4154 cat > $TMPC <<EOF
4155 #include <X11/Xlib.h>
4156 #include <X11/Xutil.h>
4157 int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; }
4159 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4160 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4161 -L/usr/lib ; do
4162 if netbsd; then
4163 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4164 else
4165 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4167 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4168 && _x11=yes && break
4169 done
4171 if test "$_x11" = yes ; then
4172 def_x11='#define CONFIG_X11 1'
4173 vomodules="x11 xover $vomodules"
4174 else
4175 _x11=no
4176 def_x11='#undef CONFIG_X11'
4177 novomodules="x11 $novomodules"
4178 res_comment="check if the dev(el) packages are installed"
4179 # disable stuff that depends on X
4180 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4182 echores "$_x11"
4184 echocheck "Xss screensaver extensions"
4185 if test "$_xss" = auto ; then
4186 cat > $TMPC << EOF
4187 #include <X11/Xlib.h>
4188 #include <X11/extensions/scrnsaver.h>
4189 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4191 _xss=no
4192 cc_check -lXss && _xss=yes
4194 if test "$_xss" = yes ; then
4195 def_xss='#define CONFIG_XSS 1'
4196 libs_mplayer="$libs_mplayer -lXss"
4197 else
4198 def_xss='#undef CONFIG_XSS'
4200 echores "$_xss"
4202 echocheck "DPMS"
4203 _xdpms3=no
4204 _xdpms4=no
4205 if test "$_x11" = yes ; then
4206 cat > $TMPC <<EOF
4207 #include <X11/Xmd.h>
4208 #include <X11/Xlib.h>
4209 #include <X11/Xutil.h>
4210 #include <X11/Xatom.h>
4211 #include <X11/extensions/dpms.h>
4212 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4214 cc_check -lXdpms && _xdpms3=yes
4215 cat > $TMPC <<EOF
4216 #include <X11/Xlib.h>
4217 #include <X11/extensions/dpms.h>
4218 int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; }
4220 cc_check -lXext && _xdpms4=yes
4222 if test "$_xdpms4" = yes ; then
4223 def_xdpms='#define CONFIG_XDPMS 1'
4224 res_comment="using Xdpms 4"
4225 echores "yes"
4226 elif test "$_xdpms3" = yes ; then
4227 def_xdpms='#define CONFIG_XDPMS 1'
4228 libs_mplayer="$libs_mplayer -lXdpms"
4229 res_comment="using Xdpms 3"
4230 echores "yes"
4231 else
4232 def_xdpms='#undef CONFIG_XDPMS'
4233 echores "no"
4237 echocheck "Xv"
4238 if test "$_xv" = auto ; then
4239 cat > $TMPC <<EOF
4240 #include <X11/Xlib.h>
4241 #include <X11/extensions/Xvlib.h>
4242 int main(void) {
4243 (void) XvGetPortAttribute(0, 0, 0, 0);
4244 (void) XvQueryPortAttributes(0, 0, 0);
4245 return 0; }
4247 _xv=no
4248 cc_check -lXv && _xv=yes
4251 if test "$_xv" = yes ; then
4252 def_xv='#define CONFIG_XV 1'
4253 libs_mplayer="$libs_mplayer -lXv"
4254 vomodules="xv $vomodules"
4255 else
4256 def_xv='#undef CONFIG_XV'
4257 novomodules="xv $novomodules"
4259 echores "$_xv"
4262 echocheck "XvMC"
4263 if test "$_xv" = yes && test "$_xvmc" != no ; then
4264 _xvmc=no
4265 cat > $TMPC <<EOF
4266 #include <X11/Xlib.h>
4267 #include <X11/extensions/Xvlib.h>
4268 #include <X11/extensions/XvMClib.h>
4269 int main(void) {
4270 (void) XvMCQueryExtension(0,0,0);
4271 (void) XvMCCreateContext(0,0,0,0,0,0,0);
4272 return 0; }
4274 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4275 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4276 done
4278 if test "$_xvmc" = yes ; then
4279 def_xvmc='#define CONFIG_XVMC 1'
4280 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4281 vomodules="xvmc $vomodules"
4282 res_comment="using $_xvmclib"
4283 else
4284 def_xvmc='#define CONFIG_XVMC 0'
4285 novomodules="xvmc $novomodules"
4287 echores "$_xvmc"
4290 echocheck "VDPAU"
4291 if test "$_vdpau" = auto ; then
4292 _vdpau=no
4293 if test "$_dl" = yes ; then
4294 cat > $TMPC <<EOF
4295 #include <vdpau/vdpau_x11.h>
4296 int main(void) {
4297 (void) vdp_device_create_x11(0, 0, 0, 0);
4298 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4300 cc_check -lvdpau && _vdpau=yes
4303 if test "$_vdpau" = yes ; then
4304 def_vdpau='#define CONFIG_VDPAU 1'
4305 libs_mplayer="$libs_mplayer -lvdpau"
4306 vomodules="vdpau $vomodules"
4307 else
4308 def_vdpau='#define CONFIG_VDPAU 0'
4309 novomodules="vdpau $novomodules"
4311 echores "$_vdpau"
4314 echocheck "Xinerama"
4315 if test "$_xinerama" = auto ; then
4316 cat > $TMPC <<EOF
4317 #include <X11/Xlib.h>
4318 #include <X11/extensions/Xinerama.h>
4319 int main(void) { (void) XineramaIsActive(0); return 0; }
4321 _xinerama=no
4322 cc_check -lXinerama && _xinerama=yes
4325 if test "$_xinerama" = yes ; then
4326 def_xinerama='#define CONFIG_XINERAMA 1'
4327 libs_mplayer="$libs_mplayer -lXinerama"
4328 else
4329 def_xinerama='#undef CONFIG_XINERAMA'
4331 echores "$_xinerama"
4334 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4335 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4336 # named 'X extensions' or something similar.
4337 # This check may be useful for future mplayer versions (to change resolution)
4338 # If you run into problems, remove '-lXxf86vm'.
4339 echocheck "Xxf86vm"
4340 if test "$_vm" = auto ; then
4341 cat > $TMPC <<EOF
4342 #include <X11/Xlib.h>
4343 #include <X11/extensions/xf86vmode.h>
4344 int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; }
4346 _vm=no
4347 cc_check -lXxf86vm && _vm=yes
4349 if test "$_vm" = yes ; then
4350 def_vm='#define CONFIG_XF86VM 1'
4351 libs_mplayer="$libs_mplayer -lXxf86vm"
4352 else
4353 def_vm='#undef CONFIG_XF86VM'
4355 echores "$_vm"
4357 # Check for the presence of special keycodes, like audio control buttons
4358 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4359 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4360 # have these new keycodes.
4361 echocheck "XF86keysym"
4362 if test "$_xf86keysym" = auto; then
4363 _xf86keysym=no
4364 cat > $TMPC <<EOF
4365 #include <X11/Xlib.h>
4366 #include <X11/XF86keysym.h>
4367 int main(void) { return XF86XK_AudioPause; }
4369 cc_check && _xf86keysym=yes
4371 if test "$_xf86keysym" = yes ; then
4372 def_xf86keysym='#define CONFIG_XF86XK 1'
4373 else
4374 def_xf86keysym='#undef CONFIG_XF86XK'
4376 echores "$_xf86keysym"
4378 echocheck "DGA"
4379 if test "$_dga2" = auto && test "$_x11" = yes ; then
4380 cat > $TMPC << EOF
4381 #include <X11/Xlib.h>
4382 #include <X11/extensions/xf86dga.h>
4383 int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4385 _dga2=no
4386 cc_check -lXxf86dga && _dga2=yes
4388 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4389 cat > $TMPC << EOF
4390 #include <X11/Xlib.h>
4391 #include <X11/extensions/xf86dga.h>
4392 int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4394 _dga1=no
4395 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4398 _dga=no
4399 def_dga='#undef CONFIG_DGA'
4400 def_dga1='#undef CONFIG_DGA1'
4401 def_dga2='#undef CONFIG_DGA2'
4402 if test "$_dga1" = yes ; then
4403 _dga=yes
4404 def_dga1='#define CONFIG_DGA1 1'
4405 res_comment="using DGA 1.0"
4406 elif test "$_dga2" = yes ; then
4407 _dga=yes
4408 def_dga2='#define CONFIG_DGA2 1'
4409 res_comment="using DGA 2.0"
4411 if test "$_dga" = yes ; then
4412 def_dga='#define CONFIG_DGA 1'
4413 libs_mplayer="$libs_mplayer -lXxf86dga"
4414 vomodules="dga $vomodules"
4415 else
4416 novomodules="dga $novomodules"
4418 echores "$_dga"
4421 echocheck "3dfx"
4422 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4423 def_3dfx='#define CONFIG_3DFX 1'
4424 vomodules="3dfx $vomodules"
4425 else
4426 def_3dfx='#undef CONFIG_3DFX'
4427 novomodules="3dfx $novomodules"
4429 echores "$_3dfx"
4432 echocheck "VIDIX"
4433 def_vidix='#undef CONFIG_VIDIX'
4434 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4435 _vidix_drv_cyberblade=no
4436 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4437 _vidix_drv_ivtv=no
4438 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4439 _vidix_drv_mach64=no
4440 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4441 _vidix_drv_mga=no
4442 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4443 _vidix_drv_mga_crtc2=no
4444 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4445 _vidix_drv_nvidia=no
4446 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4447 _vidix_drv_pm2=no
4448 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4449 _vidix_drv_pm3=no
4450 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4451 _vidix_drv_radeon=no
4452 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4453 _vidix_drv_rage128=no
4454 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4455 _vidix_drv_s3=no
4456 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4457 _vidix_drv_sh_veu=no
4458 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4459 _vidix_drv_sis=no
4460 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4461 _vidix_drv_unichrome=no
4462 if test "$_vidix" = auto ; then
4463 _vidix=no
4464 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4465 && _vidix=yes
4466 x86_64 && ! linux && _vidix=no
4467 (ppc || alpha) && linux && _vidix=yes
4469 echores "$_vidix"
4471 if test "$_vidix" = yes ; then
4472 def_vidix='#define CONFIG_VIDIX 1'
4473 vomodules="cvidix $vomodules"
4474 # FIXME: ivtv driver temporarily disabled until we have a proper test
4475 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4476 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4478 # some vidix drivers are architecture and os specific, discard them elsewhere
4479 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4480 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4482 for driver in $_vidix_drivers ; do
4483 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4484 eval _vidix_drv_${driver}=yes
4485 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4486 done
4488 echocheck "VIDIX PCI device name database"
4489 echores "$_vidix_pcidb"
4490 if test "$_vidix_pcidb" = yes ; then
4491 _vidix_pcidb_val=1
4492 else
4493 _vidix_pcidb_val=0
4496 echocheck "VIDIX dhahelper support"
4497 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4498 echores "$_dhahelper"
4500 echocheck "VIDIX svgalib_helper support"
4501 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4502 echores "$_svgalib_helper"
4504 else
4505 novomodules="cvidix $novomodules"
4508 if test "$_vidix" = yes && win32; then
4509 winvidix=yes
4510 vomodules="winvidix $vomodules"
4511 libs_mplayer="$libs_mplayer -lgdi32"
4512 else
4513 novomodules="winvidix $novomodules"
4515 if test "$_vidix" = yes && test "$_x11" = yes; then
4516 xvidix=yes
4517 vomodules="xvidix $vomodules"
4518 else
4519 novomodules="xvidix $novomodules"
4522 echocheck "GGI"
4523 if test "$_ggi" = auto ; then
4524 cat > $TMPC << EOF
4525 #include <ggi/ggi.h>
4526 int main(void) { ggiInit(); return 0; }
4528 _ggi=no
4529 cc_check -lggi && _ggi=yes
4531 if test "$_ggi" = yes ; then
4532 def_ggi='#define CONFIG_GGI 1'
4533 libs_mplayer="$libs_mplayer -lggi"
4534 vomodules="ggi $vomodules"
4535 else
4536 def_ggi='#undef CONFIG_GGI'
4537 novomodules="ggi $novomodules"
4539 echores "$_ggi"
4541 echocheck "GGI extension: libggiwmh"
4542 if test "$_ggiwmh" = auto ; then
4543 _ggiwmh=no
4544 cat > $TMPC << EOF
4545 #include <ggi/ggi.h>
4546 #include <ggi/wmh.h>
4547 int main(void) { ggiInit(); ggiWmhInit(); return 0; }
4549 cc_check -lggi -lggiwmh && _ggiwmh=yes
4551 # needed to get right output on obscure combination
4552 # like --disable-ggi --enable-ggiwmh
4553 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4554 def_ggiwmh='#define CONFIG_GGIWMH 1'
4555 libs_mplayer="$libs_mplayer -lggiwmh"
4556 else
4557 _ggiwmh=no
4558 def_ggiwmh='#undef CONFIG_GGIWMH'
4560 echores "$_ggiwmh"
4563 echocheck "AA"
4564 if test "$_aa" = auto ; then
4565 cat > $TMPC << EOF
4566 #include <aalib.h>
4567 extern struct aa_hardware_params aa_defparams;
4568 extern struct aa_renderparams aa_defrenderparams;
4569 int main(void) {
4570 aa_context *c;
4571 aa_renderparams *p;
4572 (void) aa_init(0, 0, 0);
4573 c = aa_autoinit(&aa_defparams);
4574 p = aa_getrenderparams();
4575 aa_autoinitkbd(c,0);
4576 return 0; }
4578 _aa=no
4579 for _ld_tmp in "-laa" ; do
4580 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4581 done
4583 if test "$_aa" = yes ; then
4584 def_aa='#define CONFIG_AA 1'
4585 if cygwin ; then
4586 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4588 vomodules="aa $vomodules"
4589 else
4590 def_aa='#undef CONFIG_AA'
4591 novomodules="aa $novomodules"
4593 echores "$_aa"
4596 echocheck "CACA"
4597 if test "$_caca" = auto ; then
4598 _caca=no
4599 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4600 cat > $TMPC << EOF
4601 #include <caca.h>
4602 #ifdef CACA_API_VERSION_1
4603 #include <caca0.h>
4604 #endif
4605 int main(void) { (void) caca_init(); return 0; }
4607 cc_check $(caca-config --libs) && _caca=yes
4610 if test "$_caca" = yes ; then
4611 def_caca='#define CONFIG_CACA 1'
4612 extra_cflags="$extra_cflags $(caca-config --cflags)"
4613 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4614 vomodules="caca $vomodules"
4615 else
4616 def_caca='#undef CONFIG_CACA'
4617 novomodules="caca $novomodules"
4619 echores "$_caca"
4622 echocheck "SVGAlib"
4623 if test "$_svga" = auto ; then
4624 _svga=no
4625 header_check vga.h -lvga $_ld_lm && _svga=yes
4627 if test "$_svga" = yes ; then
4628 def_svga='#define CONFIG_SVGALIB 1'
4629 libs_mplayer="$libs_mplayer -lvga"
4630 vomodules="svga $vomodules"
4631 else
4632 def_svga='#undef CONFIG_SVGALIB'
4633 novomodules="svga $novomodules"
4635 echores "$_svga"
4638 echocheck "FBDev"
4639 if test "$_fbdev" = auto ; then
4640 _fbdev=no
4641 linux && _fbdev=yes
4643 if test "$_fbdev" = yes ; then
4644 def_fbdev='#define CONFIG_FBDEV 1'
4645 vomodules="fbdev $vomodules"
4646 else
4647 def_fbdev='#undef CONFIG_FBDEV'
4648 novomodules="fbdev $novomodules"
4650 echores "$_fbdev"
4654 echocheck "DVB"
4655 if test "$_dvb" = auto ; then
4656 _dvb=no
4657 cat >$TMPC << EOF
4658 #include <poll.h>
4659 #include <sys/ioctl.h>
4660 #include <stdio.h>
4661 #include <time.h>
4662 #include <unistd.h>
4663 #include <linux/dvb/dmx.h>
4664 #include <linux/dvb/frontend.h>
4665 #include <linux/dvb/video.h>
4666 #include <linux/dvb/audio.h>
4667 int main(void) {return 0;}
4669 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4670 cc_check $_inc_tmp && _dvb=yes && \
4671 extra_cflags="$extra_cflags $_inc_tmp" && break
4672 done
4674 echores "$_dvb"
4675 if test "$_dvb" = yes ; then
4676 _dvbin=yes
4677 inputmodules="dvb $inputmodules"
4678 def_dvb='#define CONFIG_DVB 1'
4679 def_dvbin='#define CONFIG_DVBIN 1'
4680 aomodules="mpegpes(dvb) $aomodules"
4681 vomodules="mpegpes(dvb) $vomodules"
4682 else
4683 _dvbin=no
4684 noinputmodules="dvb $noinputmodules"
4685 def_dvb='#undef CONFIG_DVB'
4686 def_dvbin='#undef CONFIG_DVBIN '
4687 aomodules="mpegpes(file) $aomodules"
4688 vomodules="mpegpes(file) $vomodules"
4692 if darwin; then
4694 echocheck "QuickTime"
4695 if test "$quicktime" = auto ; then
4696 cat > $TMPC <<EOF
4697 #include <QuickTime/QuickTime.h>
4698 int main(void) {
4699 ImageDescription *desc;
4700 EnterMovies();
4701 ExitMovies();
4702 return 0;
4705 quicktime=no
4706 cc_check -framework QuickTime && quicktime=yes
4708 if test "$quicktime" = yes ; then
4709 extra_ldflags="$extra_ldflags -framework QuickTime"
4710 def_quicktime='#define CONFIG_QUICKTIME 1'
4711 else
4712 def_quicktime='#undef CONFIG_QUICKTIME'
4713 _quartz=no
4715 echores $quicktime
4717 echocheck "Quartz"
4718 if test "$_quartz" = auto ; then
4719 cat > $TMPC <<EOF
4720 #include <Carbon/Carbon.h>
4721 int main(void) {
4722 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
4723 return 0;
4726 _quartz=no
4727 cc_check -framework Carbon && _quartz=yes
4729 if test "$_quartz" = yes ; then
4730 libs_mplayer="$libs_mplayer -framework Carbon"
4731 def_quartz='#define CONFIG_QUARTZ 1'
4732 vomodules="quartz $vomodules"
4733 else
4734 def_quartz='#undef CONFIG_QUARTZ'
4735 novomodules="quartz $novomodules"
4737 echores $_quartz
4739 echocheck "CoreVideo"
4740 if test "$_corevideo" = auto ; then
4741 cat > $TMPC <<EOF
4742 #include <Carbon/Carbon.h>
4743 #include <CoreServices/CoreServices.h>
4744 #include <OpenGL/OpenGL.h>
4745 #include <QuartzCore/CoreVideo.h>
4746 int main(void) { return 0; }
4748 _corevideo=no
4749 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4751 if test "$_corevideo" = yes ; then
4752 vomodules="corevideo $vomodules"
4753 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4754 def_corevideo='#define CONFIG_COREVIDEO 1'
4755 else
4756 novomodules="corevideo $novomodules"
4757 def_corevideo='#undef CONFIG_COREVIDEO'
4759 echores "$_corevideo"
4761 fi #if darwin
4764 echocheck "PNG support"
4765 if test "$_png" = auto ; then
4766 _png=no
4767 if irix ; then
4768 # Don't check for -lpng on irix since it has its own libpng
4769 # incompatible with the GNU libpng
4770 res_comment="disabled on irix (not GNU libpng)"
4771 else
4772 cat > $TMPC << EOF
4773 #include <png.h>
4774 #include <string.h>
4775 int main(void) {
4776 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4777 printf("libpng: %s\n", png_libpng_ver);
4778 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4781 cc_check -lpng -lz $_ld_lm && _png=yes
4784 echores "$_png"
4785 if test "$_png" = yes ; then
4786 def_png='#define CONFIG_PNG 1'
4787 extra_ldflags="$extra_ldflags -lpng -lz"
4788 else
4789 def_png='#undef CONFIG_PNG'
4792 echocheck "MNG support"
4793 if test "$_mng" = auto ; then
4794 _mng=no
4795 cat > $TMPC << EOF
4796 #include <libmng.h>
4797 int main(void) {
4798 const char * p_ver = mng_version_text();
4799 return !p_ver || p_ver[0] == 0;
4802 if cc_check -lmng -lz $_ld_lm ; then
4803 _mng=yes
4806 echores "$_mng"
4807 if test "$_mng" = yes ; then
4808 def_mng='#define CONFIG_MNG 1'
4809 extra_ldflags="$extra_ldflags -lmng -lz"
4810 else
4811 def_mng='#undef CONFIG_MNG'
4814 echocheck "JPEG support"
4815 if test "$_jpeg" = auto ; then
4816 _jpeg=no
4817 cat > $TMPC << EOF
4818 #include <stdio.h>
4819 #include <stdlib.h>
4820 #include <setjmp.h>
4821 #include <string.h>
4822 #include <jpeglib.h>
4823 int main(void) { return 0; }
4825 cc_check -ljpeg $_ld_lm && _jpeg=yes
4827 echores "$_jpeg"
4829 if test "$_jpeg" = yes ; then
4830 def_jpeg='#define CONFIG_JPEG 1'
4831 vomodules="jpeg $vomodules"
4832 extra_ldflags="$extra_ldflags -ljpeg"
4833 else
4834 def_jpeg='#undef CONFIG_JPEG'
4835 novomodules="jpeg $novomodules"
4840 echocheck "PNM support"
4841 if test "$_pnm" = yes; then
4842 def_pnm="#define CONFIG_PNM 1"
4843 vomodules="pnm $vomodules"
4844 else
4845 def_pnm="#undef CONFIG_PNM"
4846 novomodules="pnm $novomodules"
4848 echores "$_pnm"
4852 echocheck "GIF support"
4853 # This is to appease people who want to force gif support.
4854 # If it is forced to yes, then we still do checks to determine
4855 # which gif library to use.
4856 if test "$_gif" = yes ; then
4857 _force_gif=yes
4858 _gif=auto
4861 if test "$_gif" = auto ; then
4862 _gif=no
4863 cat > $TMPC << EOF
4864 #include <gif_lib.h>
4865 int main(void) { QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0); return 0; }
4867 for _ld_gif in "-lungif" "-lgif" ; do
4868 cc_check $_ld_gif && _gif=yes && break
4869 done
4872 # If no library was found, and the user wants support forced,
4873 # then we force it on with libgif, as this is the safest
4874 # assumption IMHO. (libungif & libregif both create symbolic
4875 # links to libgif. We also assume that no x11 support is needed,
4876 # because if you are forcing this, then you _should_ know what
4877 # you are doing. [ Besides, package maintainers should never
4878 # have compiled x11 deps into libungif in the first place. ] )
4879 # </rant>
4880 # --Joey
4881 if test "$_force_gif" = yes && test "$_gif" = no ; then
4882 _gif=yes
4883 _ld_gif="-lgif"
4886 if test "$_gif" = yes ; then
4887 def_gif='#define CONFIG_GIF 1'
4888 codecmodules="gif $codecmodules"
4889 vomodules="gif89a $vomodules"
4890 res_comment="old version, some encoding functions disabled"
4891 def_gif_4='#undef CONFIG_GIF_4'
4892 extra_ldflags="$extra_ldflags $_ld_gif"
4894 cat > $TMPC << EOF
4895 #include <signal.h>
4896 #include <gif_lib.h>
4897 void catch(void) { exit(1); }
4898 int main(void) {
4899 signal(SIGSEGV, catch); // catch segfault
4900 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4901 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4902 return 0;
4905 if cc_check "$_ld_gif" ; then
4906 def_gif_4='#define CONFIG_GIF_4 1'
4907 res_comment=""
4909 else
4910 def_gif='#undef CONFIG_GIF'
4911 def_gif_4='#undef CONFIG_GIF_4'
4912 novomodules="gif89a $novomodules"
4913 nocodecmodules="gif $nocodecmodules"
4915 echores "$_gif"
4918 case "$_gif" in yes*)
4919 echocheck "broken giflib workaround"
4920 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4922 cat > $TMPC << EOF
4923 #include <gif_lib.h>
4924 int main(void) {
4925 GifFileType gif;
4926 printf("UserData is at address %p\n", gif.UserData);
4927 return 0;
4930 if cc_check "$_ld_gif" ; then
4931 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4932 echores "disabled"
4933 else
4934 echores "enabled"
4937 esac
4940 echocheck "VESA support"
4941 if test "$_vesa" = auto ; then
4942 cat > $TMPC << EOF
4943 #include <vbe.h>
4944 int main(void) { vbeVersion(); return 0; }
4946 _vesa=no
4947 cc_check -lvbe -llrmi && _vesa=yes
4949 if test "$_vesa" = yes ; then
4950 def_vesa='#define CONFIG_VESA 1'
4951 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4952 vomodules="vesa $vomodules"
4953 else
4954 def_vesa='#undef CONFIG_VESA'
4955 novomodules="vesa $novomodules"
4957 echores "$_vesa"
4959 #################
4960 # VIDEO + AUDIO #
4961 #################
4964 echocheck "SDL"
4965 _inc_tmp=""
4966 _ld_tmp=""
4967 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4968 if test -z "$_sdlconfig" ; then
4969 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4970 _sdlconfig="sdl-config"
4971 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4972 _sdlconfig="sdl11-config"
4973 else
4974 _sdlconfig=false
4977 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4978 cat > $TMPC << EOF
4979 #ifdef CONFIG_SDL_SDL_H
4980 #include <SDL/SDL.h>
4981 #else
4982 #include <SDL.h>
4983 #endif
4984 #ifndef __APPLE__
4985 // we allow SDL hacking our main() only on OSX
4986 #undef main
4987 #endif
4988 int main(int argc, char *argv[]) {
4989 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4990 return 0;
4993 _sdl=no
4994 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4995 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4996 _sdl=yes
4997 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4998 break
5000 done
5001 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
5002 res_comment="using $_sdlconfig"
5003 if cygwin ; then
5004 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
5005 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
5006 elif mingw32 ; then
5007 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
5008 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
5009 else
5010 _inc_tmp="$($_sdlconfig --cflags)"
5011 _ld_tmp="$($_sdlconfig --libs)"
5013 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
5014 _sdl=yes
5018 if test "$_sdl" = yes ; then
5019 def_sdl='#define CONFIG_SDL 1'
5020 extra_cflags="$extra_cflags $_inc_tmp"
5021 libs_mplayer="$libs_mplayer $_ld_tmp"
5022 vomodules="sdl $vomodules"
5023 aomodules="sdl $aomodules"
5024 else
5025 def_sdl='#undef CONFIG_SDL'
5026 novomodules="sdl $novomodules"
5027 noaomodules="sdl $noaomodules"
5029 echores "$_sdl"
5032 # make sure this stays below CoreVideo to avoid issues due to namespace
5033 # conflicts between -lGL and -framework OpenGL
5034 echocheck "OpenGL"
5035 #Note: this test is run even with --enable-gl since we autodetect linker flags
5036 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
5037 cat > $TMPC << EOF
5038 #ifdef GL_WIN32
5039 #include <windows.h>
5040 #include <GL/gl.h>
5041 #elif defined(GL_SDL)
5042 #include <GL/gl.h>
5043 #ifdef CONFIG_SDL_SDL_H
5044 #include <SDL/SDL.h>
5045 #else
5046 #include <SDL.h>
5047 #endif
5048 #ifndef __APPLE__
5049 // we allow SDL hacking our main() only on OSX
5050 #undef main
5051 #endif
5052 #else
5053 #include <GL/gl.h>
5054 #include <X11/Xlib.h>
5055 #include <GL/glx.h>
5056 #endif
5057 int main(int argc, char *argv[]) {
5058 #ifdef GL_WIN32
5059 HDC dc;
5060 wglCreateContext(dc);
5061 #elif defined(GL_SDL)
5062 SDL_GL_SwapBuffers();
5063 #else
5064 glXCreateContext(NULL, NULL, NULL, True);
5065 #endif
5066 glFinish();
5067 return 0;
5070 _gl=no
5071 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
5072 if cc_check $_ld_tmp $_ld_lm ; then
5073 _gl=yes
5074 _gl_x11=yes
5075 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
5076 break
5078 done
5079 if cc_check -DGL_WIN32 -lopengl32 ; then
5080 _gl=yes
5081 _gl_win32=yes
5082 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
5084 # last so it can reuse any linker etc. flags detected before
5085 if test "$_sdl" = yes ; then
5086 if cc_check -DGL_SDL ||
5087 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
5088 _gl=yes
5089 _gl_sdl=yes
5090 elif cc_check -DGL_SDL -lGL ||
5091 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
5092 _gl=yes
5093 _gl_sdl=yes
5094 libs_mplayer="$libs_mplayer -lGL"
5097 else
5098 _gl=no
5100 if test "$_gl" = yes ; then
5101 def_gl='#define CONFIG_GL 1'
5102 res_comment="backends:"
5103 if test "$_gl_win32" = yes ; then
5104 def_gl_win32='#define CONFIG_GL_WIN32 1'
5105 res_comment="$res_comment win32"
5107 if test "$_gl_x11" = yes ; then
5108 def_gl_x11='#define CONFIG_GL_X11 1'
5109 res_comment="$res_comment x11"
5111 if test "$_gl_sdl" = yes ; then
5112 def_gl_sdl='#define CONFIG_GL_SDL 1'
5113 res_comment="$res_comment sdl"
5115 vomodules="opengl $vomodules"
5116 else
5117 def_gl='#undef CONFIG_GL'
5118 def_gl_win32='#undef CONFIG_GL_WIN32'
5119 def_gl_x11='#undef CONFIG_GL_X11'
5120 def_gl_sdl='#undef CONFIG_GL_SDL'
5121 novomodules="opengl $novomodules"
5123 echores "$_gl"
5126 echocheck "MatrixView"
5127 if test "$_gl" = no ; then
5128 matrixview=no
5130 if test "$matrixview" = yes ; then
5131 vomodules="matrixview $vomodules"
5132 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5133 else
5134 novomodules="matrixview $novomodules"
5135 def_matrixview='#undef CONFIG_MATRIXVIEW'
5137 echores "$matrixview"
5140 if os2 ; then
5141 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5142 if test "$_kva" = auto; then
5143 cat > $TMPC << EOF
5144 #include <os2.h>
5145 #include <kva.h>
5146 int main(void) { return 0; }
5148 _kva=no;
5149 cc_check -lkva && _kva=yes
5151 if test "$_kva" = yes ; then
5152 def_kva='#define CONFIG_KVA 1'
5153 libs_mplayer="$libs_mplayer -lkva"
5154 vomodules="kva $vomodules"
5155 else
5156 def_kva='#undef CONFIG_KVA'
5157 novomodules="kva $novomodules"
5159 echores "$_kva"
5160 fi #if os2
5163 if win32; then
5165 echocheck "Windows waveout"
5166 if test "$_win32waveout" = auto ; then
5167 cat > $TMPC << EOF
5168 #include <windows.h>
5169 #include <mmsystem.h>
5170 int main(void) { return 0; }
5172 _win32waveout=no
5173 cc_check -lwinmm && _win32waveout=yes
5175 if test "$_win32waveout" = yes ; then
5176 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5177 libs_mplayer="$libs_mplayer -lwinmm"
5178 aomodules="win32 $aomodules"
5179 else
5180 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5181 noaomodules="win32 $noaomodules"
5183 echores "$_win32waveout"
5185 echocheck "Direct3D"
5186 if test "$_direct3d" = auto ; then
5187 cat > $TMPC << EOF
5188 #include <windows.h>
5189 #include <d3d9.h>
5190 int main(void) { return 0; }
5192 _direct3d=no
5193 cc_check && _direct3d=yes
5195 if test "$_direct3d" = yes ; then
5196 def_direct3d='#define CONFIG_DIRECT3D 1'
5197 vomodules="direct3d $vomodules"
5198 else
5199 def_direct3d='#undef CONFIG_DIRECT3D'
5200 novomodules="direct3d $novomodules"
5202 echores "$_direct3d"
5204 echocheck "Directx"
5205 if test "$_directx" = auto ; then
5206 cat > $TMPC << EOF
5207 #include <windows.h>
5208 #include <ddraw.h>
5209 #include <dsound.h>
5210 int main(void) { return 0; }
5212 _directx=no
5213 cc_check -lgdi32 && _directx=yes
5215 if test "$_directx" = yes ; then
5216 def_directx='#define CONFIG_DIRECTX 1'
5217 libs_mplayer="$libs_mplayer -lgdi32"
5218 vomodules="directx $vomodules"
5219 aomodules="dsound $aomodules"
5220 else
5221 def_directx='#undef CONFIG_DIRECTX'
5222 novomodules="directx $novomodules"
5223 noaomodules="dsound $noaomodules"
5225 echores "$_directx"
5227 fi #if win32; then
5230 echocheck "DXR2"
5231 if test "$_dxr2" = auto; then
5232 _dxr2=no
5233 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5234 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
5235 extra_cflags="$extra_cflags $_inc_tmp" && break
5236 done
5238 if test "$_dxr2" = yes; then
5239 def_dxr2='#define CONFIG_DXR2 1'
5240 aomodules="dxr2 $aomodules"
5241 vomodules="dxr2 $vomodules"
5242 else
5243 def_dxr2='#undef CONFIG_DXR2'
5244 noaomodules="dxr2 $noaomodules"
5245 novomodules="dxr2 $novomodules"
5247 echores "$_dxr2"
5249 echocheck "DXR3/H+"
5250 if test "$_dxr3" = auto ; then
5251 _dxr3=no
5252 header_check linux/em8300.h && _dxr3=yes
5254 if test "$_dxr3" = yes ; then
5255 def_dxr3='#define CONFIG_DXR3 1'
5256 vomodules="dxr3 $vomodules"
5257 else
5258 def_dxr3='#undef CONFIG_DXR3'
5259 novomodules="dxr3 $novomodules"
5261 echores "$_dxr3"
5264 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5265 if test "$_ivtv" = auto ; then
5266 cat > $TMPC << EOF
5267 #include <stdlib.h>
5268 #include <inttypes.h>
5269 #include <linux/types.h>
5270 #include <linux/videodev2.h>
5271 #include <linux/ivtv.h>
5272 #include <sys/ioctl.h>
5273 int main(void) {
5274 struct ivtv_cfg_stop_decode sd;
5275 struct ivtv_cfg_start_decode sd1;
5276 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5277 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5278 return 0; }
5280 _ivtv=no
5281 cc_check && _ivtv=yes
5283 if test "$_ivtv" = yes ; then
5284 def_ivtv='#define CONFIG_IVTV 1'
5285 vomodules="ivtv $vomodules"
5286 aomodules="ivtv $aomodules"
5287 else
5288 def_ivtv='#undef CONFIG_IVTV'
5289 novomodules="ivtv $novomodules"
5290 noaomodules="ivtv $noaomodules"
5292 echores "$_ivtv"
5295 echocheck "V4L2 MPEG Decoder"
5296 if test "$_v4l2" = auto ; then
5297 cat > $TMPC << EOF
5298 #include <stdlib.h>
5299 #include <inttypes.h>
5300 #include <linux/types.h>
5301 #include <linux/videodev2.h>
5302 #include <linux/version.h>
5303 int main(void) {
5304 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5305 #error kernel headers too old, need 2.6.22
5306 #endif
5307 struct v4l2_ext_controls ctrls;
5308 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5309 return 0;
5312 _v4l2=no
5313 cc_check && _v4l2=yes
5315 if test "$_v4l2" = yes ; then
5316 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5317 vomodules="v4l2 $vomodules"
5318 aomodules="v4l2 $aomodules"
5319 else
5320 def_v4l2='#undef CONFIG_V4L2_DECODER'
5321 novomodules="v4l2 $novomodules"
5322 noaomodules="v4l2 $noaomodules"
5324 echores "$_v4l2"
5328 #########
5329 # AUDIO #
5330 #########
5333 echocheck "OSS Audio"
5334 if test "$_ossaudio" = auto ; then
5335 cat > $TMPC << EOF
5336 #include <sys/ioctl.h>
5337 #include <$_soundcard_header>
5338 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5340 _ossaudio=no
5341 cc_check && _ossaudio=yes
5343 if test "$_ossaudio" = yes ; then
5344 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5345 aomodules="oss $aomodules"
5346 cat > $TMPC << EOF
5347 #include <sys/ioctl.h>
5348 #include <$_soundcard_header>
5349 #ifdef OPEN_SOUND_SYSTEM
5350 int main(void) { return 0; }
5351 #else
5352 #error Not the real thing
5353 #endif
5355 _real_ossaudio=no
5356 cc_check && _real_ossaudio=yes
5357 if test "$_real_ossaudio" = yes; then
5358 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5359 # Check for OSS4 headers (override default headers)
5360 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5361 if test -f /etc/oss.conf; then
5362 . /etc/oss.conf
5363 _ossinc="$OSSLIBDIR/include"
5364 if test -f "$_ossinc/sys/soundcard.h"; then
5365 extra_cflags="-I$_ossinc $extra_cflags"
5368 elif netbsd || openbsd ; then
5369 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5370 extra_ldflags="$extra_ldflags -lossaudio"
5371 else
5372 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5374 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5375 else
5376 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5377 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5378 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5379 noaomodules="oss $noaomodules"
5381 echores "$_ossaudio"
5384 echocheck "aRts"
5385 if test "$_arts" = auto ; then
5386 _arts=no
5387 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5388 header_check artsc.h $(artsc-config --libs) $(artsc-config --cflags) &&
5389 _arts=yes
5393 if test "$_arts" = yes ; then
5394 def_arts='#define CONFIG_ARTS 1'
5395 aomodules="arts $aomodules"
5396 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5397 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5398 else
5399 noaomodules="arts $noaomodules"
5401 echores "$_arts"
5404 echocheck "EsounD"
5405 if test "$_esd" = auto ; then
5406 _esd=no
5407 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5409 cat > $TMPC << EOF
5410 #include <esd.h>
5411 int main(void) { int fd = esd_open_sound("test"); return fd; }
5413 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5417 echores "$_esd"
5419 if test "$_esd" = yes ; then
5420 def_esd='#define CONFIG_ESD 1'
5421 aomodules="esd $aomodules"
5422 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5423 extra_cflags="$extra_cflags $(esd-config --cflags)"
5425 echocheck "esd_get_latency()"
5426 cat > $TMPC << EOF
5427 #include <esd.h>
5428 int main(void) { return esd_get_latency(0); }
5430 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5431 echores "$_esd_latency"
5432 else
5433 def_esd='#undef CONFIG_ESD'
5434 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5435 noaomodules="esd $noaomodules"
5439 echocheck "NAS"
5440 if test "$_nas" = auto ; then
5441 _nas=no
5442 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5444 if test "$_nas" = yes ; then
5445 def_nas='#define CONFIG_NAS 1'
5446 libs_mplayer="$libs_mplayer -laudio -lXt"
5447 aomodules="nas $aomodules"
5448 else
5449 noaomodules="nas $noaomodules"
5450 def_nas='#undef CONFIG_NAS'
5452 echores "$_nas"
5455 echocheck "pulse"
5456 if test "$_pulse" = auto ; then
5457 _pulse=no
5458 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5459 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5460 _pulse=yes
5463 echores "$_pulse"
5465 if test "$_pulse" = yes ; then
5466 def_pulse='#define CONFIG_PULSE 1'
5467 aomodules="pulse $aomodules"
5468 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5469 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5470 else
5471 def_pulse='#undef CONFIG_PULSE'
5472 noaomodules="pulse $noaomodules"
5476 echocheck "JACK"
5477 if test "$_jack" = auto ; then
5478 _jack=yes
5480 cat > $TMPC << EOF
5481 #include <jack/jack.h>
5482 int main(void) { jack_client_open("test", JackUseExactName, NULL); return 0; }
5484 if cc_check -ljack ; then
5485 libs_mplayer="$libs_mplayer -ljack"
5486 elif cc_check $($_pkg_config --libs --cflags --silence-errors jack) ; then
5487 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5488 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5489 else
5490 _jack=no
5494 if test "$_jack" = yes ; then
5495 def_jack='#define CONFIG_JACK 1'
5496 aomodules="jack $aomodules"
5497 else
5498 noaomodules="jack $noaomodules"
5500 echores "$_jack"
5502 echocheck "OpenAL"
5503 if test "$_openal" = auto ; then
5504 _openal=no
5505 cat > $TMPC << EOF
5506 #ifdef OPENAL_AL_H
5507 #include <OpenAL/al.h>
5508 #else
5509 #include <AL/al.h>
5510 #endif
5511 int main(void) {
5512 alSourceQueueBuffers(0, 0, 0);
5513 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5514 return 0;
5517 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5518 cc_check $I && _openal=yes && break
5519 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5520 done
5521 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5523 if test "$_openal" = yes ; then
5524 def_openal='#define CONFIG_OPENAL 1'
5525 aomodules="openal $aomodules"
5526 else
5527 noaomodules="openal $noaomodules"
5529 echores "$_openal"
5531 echocheck "ALSA audio"
5532 if test "$_alloca" != yes ; then
5533 _alsa=no
5534 res_comment="alloca missing"
5536 if test "$_alsa" != no ; then
5537 _alsa=no
5538 cat > $TMPC << EOF
5539 #include <sys/asoundlib.h>
5540 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5541 #error "alsa version != 0.5.x"
5542 #endif
5543 int main(void) { return 0; }
5545 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5547 cat > $TMPC << EOF
5548 #include <sys/asoundlib.h>
5549 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5550 #error "alsa version != 0.9.x"
5551 #endif
5552 int main(void) { return 0; }
5554 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5555 cat > $TMPC << EOF
5556 #include <alsa/asoundlib.h>
5557 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5558 #error "alsa version != 0.9.x"
5559 #endif
5560 int main(void) { return 0; }
5562 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5564 cat > $TMPC << EOF
5565 #include <sys/asoundlib.h>
5566 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5567 #error "alsa version != 1.0.x"
5568 #endif
5569 int main(void) { return 0; }
5571 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5572 cat > $TMPC << EOF
5573 #include <alsa/asoundlib.h>
5574 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5575 #error "alsa version != 1.0.x"
5576 #endif
5577 int main(void) { return 0; }
5579 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5581 def_alsa='#undef CONFIG_ALSA'
5582 def_alsa5='#undef CONFIG_ALSA5'
5583 def_alsa9='#undef CONFIG_ALSA9'
5584 def_alsa1x='#undef CONFIG_ALSA1X'
5585 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5586 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5587 if test "$_alsaver" ; then
5588 _alsa=yes
5589 if test "$_alsaver" = '0.5.x' ; then
5590 _alsa5=yes
5591 aomodules="alsa5 $aomodules"
5592 def_alsa5='#define CONFIG_ALSA5 1'
5593 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5594 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5595 elif test "$_alsaver" = '0.9.x-sys' ; then
5596 _alsa9=yes
5597 aomodules="alsa $aomodules"
5598 def_alsa='#define CONFIG_ALSA 1'
5599 def_alsa9='#define CONFIG_ALSA9 1'
5600 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5601 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5602 elif test "$_alsaver" = '0.9.x-alsa' ; then
5603 _alsa9=yes
5604 aomodules="alsa $aomodules"
5605 def_alsa='#define CONFIG_ALSA 1'
5606 def_alsa9='#define CONFIG_ALSA9 1'
5607 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5608 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5609 elif test "$_alsaver" = '1.0.x-sys' ; then
5610 _alsa1x=yes
5611 aomodules="alsa $aomodules"
5612 def_alsa='#define CONFIG_ALSA 1'
5613 def_alsa1x="#define CONFIG_ALSA1X 1"
5614 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5615 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5616 elif test "$_alsaver" = '1.0.x-alsa' ; then
5617 _alsa1x=yes
5618 aomodules="alsa $aomodules"
5619 def_alsa='#define CONFIG_ALSA 1'
5620 def_alsa1x="#define CONFIG_ALSA1X 1"
5621 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5622 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5623 else
5624 _alsa=no
5625 res_comment="unknown version"
5627 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5628 else
5629 noaomodules="alsa $noaomodules"
5631 echores "$_alsa"
5634 echocheck "Sun audio"
5635 if test "$_sunaudio" = auto ; then
5636 cat > $TMPC << EOF
5637 #include <sys/types.h>
5638 #include <sys/audioio.h>
5639 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5641 _sunaudio=no
5642 cc_check && _sunaudio=yes
5644 if test "$_sunaudio" = yes ; then
5645 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5646 aomodules="sun $aomodules"
5647 else
5648 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5649 noaomodules="sun $noaomodules"
5651 echores "$_sunaudio"
5654 def_mlib='#define CONFIG_MLIB 0'
5655 if sunos; then
5656 echocheck "Sun mediaLib"
5657 if test "$_mlib" = auto ; then
5658 _mlib=no
5659 cat > $TMPC << EOF
5660 #include <mlib.h>
5661 int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
5663 cc_check -lmlib && _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5665 echores "$_mlib"
5666 fi #if sunos
5669 if darwin; then
5670 echocheck "CoreAudio"
5671 if test "$_coreaudio" = auto ; then
5672 cat > $TMPC <<EOF
5673 #include <CoreAudio/CoreAudio.h>
5674 #include <AudioToolbox/AudioToolbox.h>
5675 #include <AudioUnit/AudioUnit.h>
5676 int main(void) { return 0; }
5678 _coreaudio=no
5679 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5681 if test "$_coreaudio" = yes ; then
5682 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5683 def_coreaudio='#define CONFIG_COREAUDIO 1'
5684 aomodules="coreaudio $aomodules"
5685 else
5686 def_coreaudio='#undef CONFIG_COREAUDIO'
5687 noaomodules="coreaudio $noaomodules"
5689 echores $_coreaudio
5690 fi #if darwin
5693 if irix; then
5694 echocheck "SGI audio"
5695 if test "$_sgiaudio" = auto ; then
5696 _sgiaudio=no
5697 header_check dmedia/audio.h && _sgiaudio=yes
5699 if test "$_sgiaudio" = "yes" ; then
5700 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5701 libs_mplayer="$libs_mplayer -laudio"
5702 aomodules="sgi $aomodules"
5703 else
5704 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5705 noaomodules="sgi $noaomodules"
5707 echores "$_sgiaudio"
5708 fi #if irix
5711 if os2 ; then
5712 echocheck "KAI (UNIAUD/DART)"
5713 if test "$_kai" = auto; then
5714 cat > $TMPC << EOF
5715 #include <os2.h>
5716 #include <kai.h>
5717 int main(void) { return 0; }
5719 _kai=no;
5720 cc_check -lkai && _kai=yes
5722 if test "$_kai" = yes ; then
5723 def_kai='#define CONFIG_KAI 1'
5724 libs_mplayer="$libs_mplayer -lkai"
5725 aomodules="kai $aomodules"
5726 else
5727 def_kai='#undef CONFIG_KAI'
5728 noaomodules="kai $noaomodules"
5730 echores "$_kai"
5732 echocheck "DART"
5733 if test "$_dart" = auto; then
5734 cat > $TMPC << EOF
5735 #include <os2.h>
5736 #include <dart.h>
5737 int main(void) { return 0; }
5739 _dart=no;
5740 cc_check -ldart && _dart=yes
5742 if test "$_dart" = yes ; then
5743 def_dart='#define CONFIG_DART 1'
5744 libs_mplayer="$libs_mplayer -ldart"
5745 aomodules="dart $aomodules"
5746 else
5747 def_dart='#undef CONFIG_DART'
5748 noaomodules="dart $noaomodules"
5750 echores "$_dart"
5751 fi #if os2
5754 # set default CD/DVD devices
5755 if win32 || os2 ; then
5756 default_cdrom_device="D:"
5757 elif darwin ; then
5758 default_cdrom_device="/dev/disk1"
5759 elif dragonfly ; then
5760 default_cdrom_device="/dev/cd0"
5761 elif freebsd ; then
5762 default_cdrom_device="/dev/acd0"
5763 elif openbsd ; then
5764 default_cdrom_device="/dev/rcd0a"
5765 elif sunos ; then
5766 default_cdrom_device="/vol/dev/aliases/cdrom0"
5767 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5768 # file system and the volfs service.
5769 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5770 elif amigaos ; then
5771 default_cdrom_device="a1ide.device:2"
5772 else
5773 default_cdrom_device="/dev/cdrom"
5776 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5777 default_dvd_device=$default_cdrom_device
5778 elif darwin ; then
5779 default_dvd_device="/dev/rdiskN"
5780 else
5781 default_dvd_device="/dev/dvd"
5785 echocheck "VCD support"
5786 if test "$_vcd" = auto; then
5787 _vcd=no
5788 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5789 _vcd=yes
5790 elif mingw32; then
5791 header_check ddk/ntddcdrm.h && _vcd=yes
5794 if test "$_vcd" = yes; then
5795 inputmodules="vcd $inputmodules"
5796 def_vcd='#define CONFIG_VCD 1'
5797 else
5798 def_vcd='#undef CONFIG_VCD'
5799 noinputmodules="vcd $noinputmodules"
5800 res_comment="not supported on this OS"
5802 echores "$_vcd"
5806 echocheck "dvdread"
5807 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5808 _dvdread_internal=no
5810 if test "$_dvdread_internal" = auto ; then
5811 _dvdread_internal=no
5812 _dvdread=no
5813 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5814 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5815 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5816 || darwin || win32 || os2; then
5817 _dvdread_internal=yes
5818 _dvdread=yes
5819 extra_cflags="-Ilibdvdread4 $extra_cflags"
5821 elif test "$_dvdread" = auto ; then
5822 _dvdread=no
5823 if test "$_dl" = yes; then
5824 cat > $TMPC << EOF
5825 #include <inttypes.h>
5826 #include <dvdread/dvd_reader.h>
5827 #include <dvdread/ifo_types.h>
5828 #include <dvdread/ifo_read.h>
5829 #include <dvdread/nav_read.h>
5830 int main(void) { return 0; }
5832 _dvdreadcflags=$($_dvdreadconfig --cflags)
5833 _dvdreadlibs=$($_dvdreadconfig --libs)
5834 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5835 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5836 _dvdread=yes
5837 extra_cflags="$extra_cflags $_dvdreadcflags"
5838 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5839 res_comment="external"
5844 if test "$_dvdread_internal" = yes; then
5845 def_dvdread='#define CONFIG_DVDREAD 1'
5846 inputmodules="dvdread(internal) $inputmodules"
5847 _largefiles=yes
5848 res_comment="internal"
5849 elif test "$_dvdread" = yes; then
5850 def_dvdread='#define CONFIG_DVDREAD 1'
5851 _largefiles=yes
5852 extra_ldflags="$extra_ldflags -ldvdread"
5853 inputmodules="dvdread(external) $inputmodules"
5854 res_comment="external"
5855 else
5856 def_dvdread='#undef CONFIG_DVDREAD'
5857 noinputmodules="dvdread $noinputmodules"
5859 echores "$_dvdread"
5862 echocheck "internal libdvdcss"
5863 if test "$_libdvdcss_internal" = auto ; then
5864 _libdvdcss_internal=no
5865 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5866 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5868 if test "$_libdvdcss_internal" = yes ; then
5869 if linux || netbsd || openbsd || bsdos ; then
5870 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5871 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5872 elif freebsd || dragonfly ; then
5873 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5874 elif darwin ; then
5875 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5876 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5877 elif cygwin ; then
5878 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5879 elif beos ; then
5880 cflags_libdvdcss="-DSYS_BEOS"
5881 elif os2 ; then
5882 cflags_libdvdcss="-DSYS_OS2"
5884 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5885 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5886 inputmodules="libdvdcss(internal) $inputmodules"
5887 _largefiles=yes
5888 else
5889 noinputmodules="libdvdcss(internal) $noinputmodules"
5891 echores "$_libdvdcss_internal"
5894 echocheck "cdparanoia"
5895 if test "$_cdparanoia" = auto ; then
5896 cat > $TMPC <<EOF
5897 #include <cdda_interface.h>
5898 #include <cdda_paranoia.h>
5899 // This need a better test. How ?
5900 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5902 _cdparanoia=no
5903 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5904 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5905 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5906 done
5908 if test "$_cdparanoia" = yes ; then
5909 _cdda='yes'
5910 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5911 openbsd && extra_ldflags="$extra_ldflags -lutil"
5913 echores "$_cdparanoia"
5916 echocheck "libcdio"
5917 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5918 cat > $TMPC << EOF
5919 #include <stdio.h>
5920 #include <cdio/version.h>
5921 #include <cdio/cdda.h>
5922 #include <cdio/paranoia.h>
5923 int main(void) {
5924 void *test = cdda_verbose_set;
5925 printf("%s\n", CDIO_VERSION);
5926 return test == (void *)1;
5929 _libcdio=no
5930 for _ld_tmp in "" "-lwinmm" ; do
5931 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5932 cc_check $_ld_tmp $_ld_lm \
5933 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5934 done
5935 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5936 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5937 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5938 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5939 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5942 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5943 _cdda='yes'
5944 def_libcdio='#define CONFIG_LIBCDIO 1'
5945 def_havelibcdio='yes'
5946 else
5947 if test "$_cdparanoia" = yes ; then
5948 res_comment="using cdparanoia"
5950 def_libcdio='#undef CONFIG_LIBCDIO'
5951 def_havelibcdio='no'
5953 echores "$_libcdio"
5955 if test "$_cdda" = yes ; then
5956 test $_cddb = auto && test $_network = yes && _cddb=yes
5957 def_cdparanoia='#define CONFIG_CDDA 1'
5958 inputmodules="cdda $inputmodules"
5959 else
5960 def_cdparanoia='#undef CONFIG_CDDA'
5961 noinputmodules="cdda $noinputmodules"
5964 if test "$_cddb" = yes ; then
5965 def_cddb='#define CONFIG_CDDB 1'
5966 inputmodules="cddb $inputmodules"
5967 else
5968 _cddb=no
5969 def_cddb='#undef CONFIG_CDDB'
5970 noinputmodules="cddb $noinputmodules"
5973 echocheck "bitmap font support"
5974 if test "$_bitmap_font" = yes ; then
5975 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5976 else
5977 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5979 echores "$_bitmap_font"
5982 echocheck "freetype >= 2.0.9"
5984 # freetype depends on iconv
5985 if test "$_iconv" = no ; then
5986 _freetype=no
5987 res_comment="iconv support needed"
5990 if test "$_freetype" = auto ; then
5991 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5992 cat > $TMPC << EOF
5993 #include <stdio.h>
5994 #include <ft2build.h>
5995 #include FT_FREETYPE_H
5996 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5997 #error "Need FreeType 2.0.9 or newer"
5998 #endif
5999 int main(void) {
6000 FT_Library library;
6001 FT_Int major=-1,minor=-1,patch=-1;
6002 int err=FT_Init_FreeType(&library);
6003 return 0;
6006 _freetype=no
6007 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
6008 else
6009 _freetype=no
6012 if test "$_freetype" = yes ; then
6013 def_freetype='#define CONFIG_FREETYPE 1'
6014 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
6015 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
6016 else
6017 def_freetype='#undef CONFIG_FREETYPE'
6019 echores "$_freetype"
6021 if test "$_freetype" = no ; then
6022 _fontconfig=no
6023 res_comment="FreeType support needed"
6025 echocheck "fontconfig"
6026 if test "$_fontconfig" = auto ; then
6027 cat > $TMPC << EOF
6028 #include <stdio.h>
6029 #include <stdlib.h>
6030 #include <fontconfig/fontconfig.h>
6031 #if FC_VERSION < 20402
6032 #error At least version 2.4.2 of fontconfig required
6033 #endif
6034 int main(void) {
6035 int err = FcInit();
6036 if (err == FcFalse) {
6037 printf("Couldn't initialize fontconfig lib\n");
6038 exit(err);
6040 return 0;
6043 _fontconfig=no
6044 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
6045 _ld_tmp="-lfontconfig $_ld_tmp"
6046 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
6047 done
6048 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
6049 _inc_tmp=$($_pkg_config --cflags fontconfig)
6050 _ld_tmp=$($_pkg_config --libs fontconfig)
6051 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
6052 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
6055 if test "$_fontconfig" = yes ; then
6056 def_fontconfig='#define CONFIG_FONTCONFIG 1'
6057 else
6058 def_fontconfig='#undef CONFIG_FONTCONFIG'
6060 echores "$_fontconfig"
6063 echocheck "SSA/ASS support"
6064 if test "$_ass" = auto -o "$_ass" = yes ; then
6065 if $_pkg_config libass; then
6066 _ass=yes
6067 def_ass='#define CONFIG_ASS 1'
6068 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
6069 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
6070 else
6071 _ass=no
6072 def_ass='#undef CONFIG_ASS'
6074 else
6075 def_ass='#undef CONFIG_ASS'
6077 echores "$_ass"
6080 echocheck "fribidi with charsets"
6081 _inc_tmp=""
6082 _ld_tmp=""
6083 if test "$_fribidi" = auto ; then
6084 cat > $TMPC << EOF
6085 #include <stdlib.h>
6086 /* workaround for fribidi 0.10.4 and below */
6087 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6088 #include <fribidi/fribidi.h>
6089 int main(void) {
6090 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
6091 exit(1);
6092 return 0;
6095 _fribidi=no
6096 _inc_tmp=""
6097 _ld_tmp="-lfribidi"
6098 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6099 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
6100 test "$_fribidi" = no ; then
6101 _inc_tmp="$($_pkg_config --cflags)"
6102 _ld_tmp="$($_pkg_config --libs)"
6103 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6106 if test "$_fribidi" = yes ; then
6107 def_fribidi='#define CONFIG_FRIBIDI 1'
6108 extra_cflags="$extra_cflags $_inc_tmp"
6109 extra_ldflags="$extra_ldflags $_ld_tmp"
6110 else
6111 def_fribidi='#undef CONFIG_FRIBIDI'
6113 echores "$_fribidi"
6116 echocheck "ENCA"
6117 if test "$_enca" = auto ; then
6118 cat > $TMPC << EOF
6119 #include <sys/types.h>
6120 #include <enca.h>
6121 int main(void) {
6122 const char **langs;
6123 size_t langcnt;
6124 langs = enca_get_languages(&langcnt);
6125 return 0;
6128 _enca=no
6129 cc_check -lenca $_ld_lm && _enca=yes
6131 if test "$_enca" = yes ; then
6132 def_enca='#define CONFIG_ENCA 1'
6133 extra_ldflags="$extra_ldflags -lenca"
6134 else
6135 def_enca='#undef CONFIG_ENCA'
6137 echores "$_enca"
6140 echocheck "zlib"
6141 cat > $TMPC << EOF
6142 #include <zlib.h>
6143 int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
6145 _zlib=no
6146 cc_check -lz && _zlib=yes
6147 if test "$_zlib" = yes ; then
6148 def_zlib='#define CONFIG_ZLIB 1'
6149 extra_ldflags="$extra_ldflags -lz"
6150 else
6151 def_zlib='#define CONFIG_ZLIB 0'
6153 echores "$_zlib"
6156 echocheck "bzlib"
6157 bzlib=no
6158 def_bzlib='#define CONFIG_BZLIB 0'
6159 cat > $TMPC << EOF
6160 #include <bzlib.h>
6161 int main(void) { BZ2_bzlibVersion(); return 0; }
6163 cc_check -lbz2 && bzlib=yes
6164 if test "$bzlib" = yes ; then
6165 def_bzlib='#define CONFIG_BZLIB 1'
6166 extra_ldflags="$extra_ldflags -lbz2"
6168 echores "$bzlib"
6171 echocheck "RTC"
6172 if test "$_rtc" = auto ; then
6173 cat > $TMPC << EOF
6174 #include <sys/ioctl.h>
6175 #ifdef __linux__
6176 #include <linux/rtc.h>
6177 #else
6178 #include <rtc.h>
6179 #define RTC_PIE_ON RTCIO_PIE_ON
6180 #endif
6181 int main(void) { return RTC_PIE_ON; }
6183 _rtc=no
6184 cc_check && _rtc=yes
6185 ppc && _rtc=no
6187 if test "$_rtc" = yes ; then
6188 def_rtc='#define HAVE_RTC 1'
6189 else
6190 def_rtc='#undef HAVE_RTC'
6192 echores "$_rtc"
6195 echocheck "liblzo2 support"
6196 if test "$_liblzo" = auto ; then
6197 _liblzo=no
6198 cat > $TMPC << EOF
6199 #include <lzo/lzo1x.h>
6200 int main(void) { lzo_init(); return 0; }
6202 cc_check -llzo2 && _liblzo=yes
6204 if test "$_liblzo" = yes ; then
6205 def_liblzo='#define CONFIG_LIBLZO 1'
6206 extra_ldflags="$extra_ldflags -llzo2"
6207 codecmodules="liblzo $codecmodules"
6208 else
6209 def_liblzo='#undef CONFIG_LIBLZO'
6210 nocodecmodules="liblzo $nocodecmodules"
6212 echores "$_liblzo"
6215 echocheck "mad support"
6216 if test "$_mad" = auto ; then
6217 _mad=no
6218 header_check mad.h -lmad && _mad=yes
6220 if test "$_mad" = yes ; then
6221 def_mad='#define CONFIG_LIBMAD 1'
6222 extra_ldflags="$extra_ldflags -lmad"
6223 codecmodules="libmad $codecmodules"
6224 else
6225 def_mad='#undef CONFIG_LIBMAD'
6226 nocodecmodules="libmad $nocodecmodules"
6228 echores "$_mad"
6230 echocheck "Twolame"
6231 if test "$_twolame" = auto ; then
6232 cat > $TMPC <<EOF
6233 #include <twolame.h>
6234 int main(void) { twolame_init(); return 0; }
6236 _twolame=no
6237 cc_check -ltwolame $_ld_lm && _twolame=yes
6239 if test "$_twolame" = yes ; then
6240 def_twolame='#define CONFIG_TWOLAME 1'
6241 libs_mencoder="$libs_mencoder -ltwolame"
6242 codecmodules="twolame $codecmodules"
6243 else
6244 def_twolame='#undef CONFIG_TWOLAME'
6245 nocodecmodules="twolame $nocodecmodules"
6247 echores "$_twolame"
6249 echocheck "Toolame"
6250 if test "$_toolame" = auto ; then
6251 _toolame=no
6252 if test "$_twolame" = yes ; then
6253 res_comment="disabled by twolame"
6254 else
6255 cat > $TMPC <<EOF
6256 #include <toolame.h>
6257 int main(void) { toolame_init(); return 0; }
6259 cc_check -ltoolame $_ld_lm && _toolame=yes
6262 if test "$_toolame" = yes ; then
6263 def_toolame='#define CONFIG_TOOLAME 1'
6264 libs_mencoder="$libs_mencoder -ltoolame"
6265 codecmodules="toolame $codecmodules"
6266 else
6267 def_toolame='#undef CONFIG_TOOLAME'
6268 nocodecmodules="toolame $nocodecmodules"
6270 if test "$_toolamedir" ; then
6271 res_comment="using $_toolamedir"
6273 echores "$_toolame"
6275 echocheck "OggVorbis support"
6276 if test "$_tremor_internal" = yes; then
6277 _libvorbis=no
6278 elif test "$_tremor" = auto; then
6279 _tremor=no
6280 cat > $TMPC << EOF
6281 #include <tremor/ivorbiscodec.h>
6282 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6284 cc_check -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6286 if test "$_libvorbis" = auto; then
6287 _libvorbis=no
6288 cat > $TMPC << EOF
6289 #include <vorbis/codec.h>
6290 int main(void) { vorbis_packet_blocksize(0,0); return 0; }
6292 cc_check -lvorbis -logg $_ld_lm && _libvorbis=yes
6294 if test "$_tremor_internal" = yes ; then
6295 _vorbis=yes
6296 def_vorbis='#define CONFIG_OGGVORBIS 1'
6297 def_tremor='#define CONFIG_TREMOR 1'
6298 codecmodules="tremor(internal) $codecmodules"
6299 res_comment="internal Tremor"
6300 if test "$_tremor_low" = yes ; then
6301 cflags_tremor_low="-D_LOW_ACCURACY_"
6302 res_comment="internal low accuracy Tremor"
6304 elif test "$_tremor" = yes ; then
6305 _vorbis=yes
6306 def_vorbis='#define CONFIG_OGGVORBIS 1'
6307 def_tremor='#define CONFIG_TREMOR 1'
6308 codecmodules="tremor(external) $codecmodules"
6309 res_comment="external Tremor"
6310 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6311 elif test "$_libvorbis" = yes ; then
6312 _vorbis=yes
6313 def_vorbis='#define CONFIG_OGGVORBIS 1'
6314 codecmodules="libvorbis $codecmodules"
6315 res_comment="libvorbis"
6316 extra_ldflags="$extra_ldflags -lvorbis -logg"
6317 else
6318 _vorbis=no
6319 nocodecmodules="libvorbis $nocodecmodules"
6321 echores "$_vorbis"
6323 echocheck "libspeex (version >= 1.1 required)"
6324 if test "$_speex" = auto ; then
6325 _speex=no
6326 cat > $TMPC << EOF
6327 #include <speex/speex.h>
6328 int main(void) { SpeexBits bits; void *dec; speex_decode_int(dec, &bits, dec); return 0; }
6330 cc_check -lspeex $_ld_lm && _speex=yes
6332 if test "$_speex" = yes ; then
6333 def_speex='#define CONFIG_SPEEX 1'
6334 extra_ldflags="$extra_ldflags -lspeex"
6335 codecmodules="speex $codecmodules"
6336 else
6337 def_speex='#undef CONFIG_SPEEX'
6338 nocodecmodules="speex $nocodecmodules"
6340 echores "$_speex"
6342 echocheck "OggTheora support"
6343 if test "$_theora" = auto ; then
6344 _theora=no
6345 cat > $TMPC << EOF
6346 #include <theora/theora.h>
6347 #include <string.h>
6348 int main(void) {
6349 /* Theora is in flux, make sure that all interface routines and datatypes
6350 * exist and work the way we expect it, so we don't break MPlayer. */
6351 ogg_packet op;
6352 theora_comment tc;
6353 theora_info inf;
6354 theora_state st;
6355 yuv_buffer yuv;
6356 int r;
6357 double t;
6359 theora_info_init(&inf);
6360 theora_comment_init(&tc);
6362 return 0;
6364 /* we don't want to execute this kind of nonsense; just for making sure
6365 * that compilation works... */
6366 memset(&op, 0, sizeof(op));
6367 r = theora_decode_header(&inf, &tc, &op);
6368 r = theora_decode_init(&st, &inf);
6369 t = theora_granule_time(&st, op.granulepos);
6370 r = theora_decode_packetin(&st, &op);
6371 r = theora_decode_YUVout(&st, &yuv);
6372 theora_clear(&st);
6374 return 0;
6377 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6378 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6379 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6380 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6381 if test _theora = no; then
6382 _ld_theora="-ltheora -logg"
6383 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6385 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6386 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6387 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6388 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6389 extra_ldflags="$extra_ldflags $_ld_theora" &&
6390 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6391 if test _theora = no; then
6392 _ld_theora="-ltheora -logg"
6393 cc_check tremor/bitwise.c $_ld_theora &&
6394 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6398 if test "$_theora" = yes ; then
6399 def_theora='#define CONFIG_OGGTHEORA 1'
6400 codecmodules="libtheora $codecmodules"
6401 # when --enable-theora is forced, we'd better provide a probably sane
6402 # $_ld_theora than nothing
6403 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6404 else
6405 def_theora='#undef CONFIG_OGGTHEORA'
6406 nocodecmodules="libtheora $nocodecmodules"
6408 echores "$_theora"
6410 echocheck "mp3lib support"
6411 if test "$_mp3lib" = auto ; then
6412 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6414 if test "$_mp3lib" = yes ; then
6415 def_mp3lib='#define CONFIG_MP3LIB 1'
6416 codecmodules="mp3lib(internal) $codecmodules"
6417 else
6418 def_mp3lib='#undef CONFIG_MP3LIB'
6419 nocodecmodules="mp3lib(internal) $nocodecmodules"
6421 echores "$_mp3lib"
6423 # Any version of libmpg123 shall be fine.
6424 echocheck "mpg123 support"
6425 def_mpg123='#undef CONFIG_MPG123'
6426 if test "$_mpg123" = auto; then
6427 _mpg123=no
6428 cat > $TMPC <<EOF
6429 #include <mpg123.h>
6430 int main(void){ mpg123_init(); return 0; }
6432 cc_check -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6434 if test "$_mpg123" = yes ; then
6435 def_mpg123='#define CONFIG_MPG123 1'
6436 codecmodules="mpg123 $codecmodules"
6437 else
6438 nocodecmodules="mpg123 $nocodecmodules"
6440 echores "$_mpg123"
6442 echocheck "liba52 support"
6443 def_liba52='#undef CONFIG_LIBA52'
6444 if test "$_liba52" = auto ; then
6445 _liba52=no
6446 cat > $TMPC << EOF
6447 #include <inttypes.h>
6448 #include <a52dec/a52.h>
6449 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6451 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6453 if test "$_liba52" = yes ; then
6454 def_liba52='#define CONFIG_LIBA52 1'
6455 codecmodules="liba52 $codecmodules"
6456 else
6457 nocodecmodules="liba52 $nocodecmodules"
6459 echores "$_liba52"
6461 echocheck "internal libmpeg2 support"
6462 if test "$_libmpeg2" = auto ; then
6463 _libmpeg2=yes
6464 if alpha && test cc_vendor=gnu; then
6465 case $cc_version in
6466 2*|3.0*|3.1*) # cannot compile MVI instructions
6467 _libmpeg2=no
6468 res_comment="broken gcc"
6470 esac
6473 if test "$_libmpeg2" = yes ; then
6474 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6475 codecmodules="libmpeg2(internal) $codecmodules"
6476 else
6477 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6478 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6480 echores "$_libmpeg2"
6482 echocheck "libdca support"
6483 if test "$_libdca" = auto ; then
6484 _libdca=no
6485 cat > $TMPC << EOF
6486 #include <inttypes.h>
6487 #include <dts.h>
6488 int main(void) { dts_init(0); return 0; }
6490 for _ld_dca in -ldca -ldts ; do
6491 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6492 && _libdca=yes && break
6493 done
6495 if test "$_libdca" = yes ; then
6496 def_libdca='#define CONFIG_LIBDCA 1'
6497 codecmodules="libdca $codecmodules"
6498 else
6499 def_libdca='#undef CONFIG_LIBDCA'
6500 nocodecmodules="libdca $nocodecmodules"
6502 echores "$_libdca"
6504 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6505 if test "$_musepack" = auto ; then
6506 _musepack=no
6507 cat > $TMPC << EOF
6508 #include <stddef.h>
6509 #include <mpcdec/mpcdec.h>
6510 int main(void) {
6511 mpc_streaminfo info;
6512 mpc_decoder decoder;
6513 mpc_decoder_set_streaminfo(&decoder, &info);
6514 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6515 return 0;
6518 cc_check -lmpcdec $_ld_lm && _musepack=yes
6520 if test "$_musepack" = yes ; then
6521 def_musepack='#define CONFIG_MUSEPACK 1'
6522 extra_ldflags="$extra_ldflags -lmpcdec"
6523 codecmodules="musepack $codecmodules"
6524 else
6525 def_musepack='#undef CONFIG_MUSEPACK'
6526 nocodecmodules="musepack $nocodecmodules"
6528 echores "$_musepack"
6531 echocheck "FAAC support"
6532 if test "$_faac" = auto ; then
6533 cat > $TMPC <<EOF
6534 #include <inttypes.h>
6535 #include <faac.h>
6536 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6538 _faac=no
6539 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6540 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6541 done
6543 if test "$_faac" = yes ; then
6544 def_faac="#define CONFIG_FAAC 1"
6545 codecmodules="faac $codecmodules"
6546 else
6547 def_faac="#undef CONFIG_FAAC"
6548 nocodecmodules="faac $nocodecmodules"
6550 echores "$_faac"
6553 echocheck "FAAD2 support"
6554 if test "$_faad_internal" = auto ; then
6555 if x86_32 && test cc_vendor=gnu; then
6556 case $cc_version in
6557 3.1*|3.2) # ICE/insn with these versions
6558 _faad_internal=no
6559 res_comment="broken gcc"
6562 _faad=yes
6563 _faad_internal=yes
6565 esac
6566 else
6567 _faad=yes
6568 _faad_internal=yes
6571 if test "$_faad" = auto ; then
6572 cat > $TMPC << EOF
6573 #include <faad.h>
6574 #ifndef FAAD_MIN_STREAMSIZE
6575 #error Too old version
6576 #endif
6577 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6578 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6580 cc_check -lfaad $_ld_lm && _faad=yes
6583 def_faad='#undef CONFIG_FAAD'
6584 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6585 if test "$_faad_internal" = yes ; then
6586 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6587 res_comment="internal floating-point"
6588 if test "$_faad_fixed" = yes ; then
6589 # The FIXED_POINT implementation of FAAD2 improves performance
6590 # on some platforms, especially for SBR files.
6591 cflags_faad_fixed="-DFIXED_POINT"
6592 res_comment="internal fixed-point"
6594 elif test "$_faad" = yes ; then
6595 extra_ldflags="$extra_ldflags -lfaad"
6598 if test "$_faad" = yes ; then
6599 def_faad='#define CONFIG_FAAD 1'
6600 if test "$_faad_internal" = yes ; then
6601 codecmodules="faad2(internal) $codecmodules"
6602 else
6603 codecmodules="faad2 $codecmodules"
6605 else
6606 _faad=no
6607 nocodecmodules="faad2 $nocodecmodules"
6609 echores "$_faad"
6612 echocheck "LADSPA plugin support"
6613 if test "$_ladspa" = auto ; then
6614 cat > $TMPC <<EOF
6615 #include <ladspa.h>
6616 int main(void) {
6617 const LADSPA_Descriptor *ld = NULL;
6618 return 0;
6621 _ladspa=no
6622 cc_check && _ladspa=yes
6624 if test "$_ladspa" = yes; then
6625 def_ladspa="#define CONFIG_LADSPA 1"
6626 else
6627 def_ladspa="#undef CONFIG_LADSPA"
6629 echores "$_ladspa"
6632 echocheck "libbs2b audio filter support"
6633 if test "$_libbs2b" = auto ; then
6634 cat > $TMPC <<EOF
6635 #include <bs2b.h>
6636 #if BS2B_VERSION_MAJOR < 3
6637 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6638 #endif
6639 int main(void) {
6640 t_bs2bdp filter;
6641 filter=bs2b_open();
6642 bs2b_close(filter);
6643 return 0;
6646 _libbs2b=no
6647 if $_pkg_config --exists libbs2b ; then
6648 _inc_tmp=$($_pkg_config --cflags libbs2b)
6649 _ld_tmp=$($_pkg_config --libs libbs2b)
6650 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6651 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6652 else
6653 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6654 -I/usr/local/include/bs2b ; do
6655 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6656 extra_ldflags="$extra_ldflags -lbs2b"
6657 extra_cflags="$extra_cflags $_inc_tmp"
6658 _libbs2b=yes
6659 break
6661 done
6664 def_libbs2b="#undef CONFIG_LIBBS2B"
6665 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6666 echores "$_libbs2b"
6669 if test -z "$_codecsdir" ; then
6670 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6671 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6672 if test -d "$dir" ; then
6673 _codecsdir="$dir"
6674 break;
6676 done
6678 # Fall back on default directory.
6679 if test -z "$_codecsdir" ; then
6680 _codecsdir="$_libdir/codecs"
6681 mingw32 || os2 && _codecsdir="codecs"
6685 echocheck "Win32 codecs"
6686 if test "$_win32dll" = auto ; then
6687 _win32dll=no
6688 if x86_32 && ! qnx; then
6689 _win32dll=yes
6692 if test "$_win32dll" = yes ; then
6693 def_win32dll='#define CONFIG_WIN32DLL 1'
6694 if ! win32 ; then
6695 def_win32_loader='#define WIN32_LOADER 1'
6696 _win32_emulation=yes
6697 else
6698 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6699 res_comment="using native windows"
6701 codecmodules="win32 $codecmodules"
6702 else
6703 def_win32dll='#undef CONFIG_WIN32DLL'
6704 def_win32_loader='#undef WIN32_LOADER'
6705 nocodecmodules="win32 $nocodecmodules"
6707 echores "$_win32dll"
6710 echocheck "XAnim codecs"
6711 if test "$_xanim" = auto ; then
6712 _xanim=no
6713 res_comment="dynamic loader support needed"
6714 if test "$_dl" = yes ; then
6715 _xanim=yes
6718 if test "$_xanim" = yes ; then
6719 def_xanim='#define CONFIG_XANIM 1'
6720 codecmodules="xanim $codecmodules"
6721 else
6722 def_xanim='#undef CONFIG_XANIM'
6723 nocodecmodules="xanim $nocodecmodules"
6725 echores "$_xanim"
6728 echocheck "RealPlayer codecs"
6729 if test "$_real" = auto ; then
6730 _real=no
6731 res_comment="dynamic loader support needed"
6732 if test "$_dl" = yes || test "$_win32dll" = yes &&
6733 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6734 _real=yes
6737 if test "$_real" = yes ; then
6738 def_real='#define CONFIG_REALCODECS 1'
6739 codecmodules="real $codecmodules"
6740 else
6741 def_real='#undef CONFIG_REALCODECS'
6742 nocodecmodules="real $nocodecmodules"
6744 echores "$_real"
6747 echocheck "QuickTime codecs"
6748 _qtx_emulation=no
6749 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6750 if test "$_qtx" = auto ; then
6751 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6753 if test "$_qtx" = yes ; then
6754 def_qtx='#define CONFIG_QTX_CODECS 1'
6755 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6756 codecmodules="qtx $codecmodules"
6757 darwin || win32 || _qtx_emulation=yes
6758 else
6759 def_qtx='#undef CONFIG_QTX_CODECS'
6760 nocodecmodules="qtx $nocodecmodules"
6762 echores "$_qtx"
6764 echocheck "Nemesi Streaming Media libraries"
6765 if test "$_nemesi" = auto && test "$_network" = yes ; then
6766 _nemesi=no
6767 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6768 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6769 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6770 _nemesi=yes
6773 if test "$_nemesi" = yes; then
6774 _native_rtsp=no
6775 def_nemesi='#define CONFIG_LIBNEMESI 1'
6776 inputmodules="nemesi $inputmodules"
6777 else
6778 _native_rtsp="$_network"
6779 _nemesi=no
6780 def_nemesi='#undef CONFIG_LIBNEMESI'
6781 noinputmodules="nemesi $noinputmodules"
6783 echores "$_nemesi"
6785 echocheck "LIVE555 Streaming Media libraries"
6786 if test "$_live" = auto && test "$_network" = yes ; then
6787 cat > $TMPCPP << EOF
6788 #include <liveMedia.hh>
6789 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6790 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6791 #endif
6792 int main(void) { return 0; }
6795 _live=no
6796 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
6797 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6798 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6799 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6800 $_livelibdir/groupsock/libgroupsock.a \
6801 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6802 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6803 $extra_ldflags -lstdc++" \
6804 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6805 -I$_livelibdir/UsageEnvironment/include \
6806 -I$_livelibdir/BasicUsageEnvironment/include \
6807 -I$_livelibdir/groupsock/include" && \
6808 _live=yes && break
6809 done
6810 if test "$_live" != yes ; then
6811 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6812 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6813 _live_dist=yes
6817 if test "$_live" = yes && test "$_network" = yes; then
6818 test $_livelibdir && res_comment="using $_livelibdir"
6819 def_live='#define CONFIG_LIVE555 1'
6820 inputmodules="live555 $inputmodules"
6821 elif test "$_live_dist" = yes && test "$_network" = yes; then
6822 res_comment="using distribution version"
6823 _live="yes"
6824 def_live='#define CONFIG_LIVE555 1'
6825 extra_ldflags="$extra_ldflags $ld_tmp"
6826 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6827 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6828 inputmodules="live555 $inputmodules"
6829 else
6830 _live=no
6831 def_live='#undef CONFIG_LIVE555'
6832 noinputmodules="live555 $noinputmodules"
6834 echores "$_live"
6837 echocheck "FFmpeg libavutil"
6838 if test "$_libavutil" = auto ; then
6839 _libavutil=no
6840 cat > $TMPC << EOF
6841 #include <libavutil/common.h>
6842 int main(void) { av_clip(1, 1, 1); return 0; }
6844 if $_pkg_config --exists libavutil ; then
6845 _inc_libavutil=$($_pkg_config --cflags libavutil)
6846 _ld_tmp=$($_pkg_config --libs libavutil)
6847 cc_check $_inc_libavutil $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libavutil" \
6848 && _libavutil=yes
6849 elif cc_check -lavutil $_ld_lm ; then
6850 extra_ldflags="$extra_ldflags -lavutil"
6851 _libavutil=yes
6854 def_libavutil='#undef CONFIG_LIBAVUTIL'
6855 test "$_libavutil" = yes && def_libavutil='#define CONFIG_LIBAVUTIL 1'
6856 # libavutil is not available, but it is mandatory ...
6857 if test "$_libavutil" = no ; then
6858 die "You need libavutil, MPlayer will not compile without!"
6860 echores "$_libavutil"
6862 echocheck "FFmpeg libavcodec"
6863 if test "$_libavcodec" = auto ; then
6864 _libavcodec=no
6865 cat > $TMPC << EOF
6866 #include <libavcodec/avcodec.h>
6867 int main(void) { avcodec_find_encoder_by_name(""); return 0; }
6869 if $_pkg_config --exists libavcodec ; then
6870 _inc_libavcodec=$($_pkg_config --cflags libavcodec)
6871 _ld_tmp=$($_pkg_config --libs libavcodec)
6872 cc_check $_inc_libavcodec $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavcodec" \
6873 && _libavcodec=yes
6874 elif cc_check -lavcodec $_ld_lm ; then
6875 extra_ldflags="$extra_ldflags -lavcodec"
6876 _libavcodec=yes
6879 def_libavcodec='#undef CONFIG_LIBAVCODEC'
6880 test "$_libavcodec" = yes && def_libavcodec='#define CONFIG_LIBAVCODEC 1'
6881 if test "$_libavcodec" = yes ; then
6882 codecmodules="libavcodec $codecmodules"
6883 else
6884 nocodecmodules="libavcodec $nocodecmodules"
6886 echores "$_libavcodec"
6888 echocheck "FFmpeg libavformat"
6889 if test "$_libavformat" = auto ; then
6890 _libavformat=no
6891 cat > $TMPC <<EOF
6892 #include <libavformat/avformat.h>
6893 int main(void) { av_alloc_format_context(); return 0; }
6895 if $_pkg_config --exists libavformat ; then
6896 _inc_libavformat=$($_pkg_config --cflags libavformat)
6897 _ld_tmp=$($_pkg_config --libs libavformat)
6898 cc_check $_inc_libavformat $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libavformat" \
6899 && _libavformat=yes
6900 elif cc_check $_ld_lm -lavformat ; then
6901 extra_ldflags="$extra_ldflags -lavformat"
6902 _libavformat=yes
6905 def_libavformat='#undef CONFIG_LIBAVFORMAT'
6906 test "$_libavformat" = yes && def_libavformat='#define CONFIG_LIBAVFORMAT 1'
6907 echores "$_libavformat"
6909 echocheck "FFmpeg libpostproc"
6910 if test "$_libpostproc" = auto ; then
6911 _libpostproc=no
6912 cat > $TMPC << EOF
6913 #include <libpostproc/postprocess.h>
6914 int main(void) { pp_get_mode_by_name_and_quality("de", 0); return 0; }
6916 if $_pkg_config --exists libpostproc ; then
6917 _inc_libpostproc=$($_pkg_config --cflags libpostproc)
6918 _ld_tmp=$($_pkg_config --libs libpostproc)
6919 cc_check $_inc_libpostproc $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_libpostproc" \
6920 && _libpostproc=yes
6921 elif cc_check -lpostproc $_ld_lm ; then
6922 extra_ldflags="$extra_ldflags -lpostproc"
6923 _libpostproc=yes
6926 def_libpostproc='#undef CONFIG_LIBPOSTPROC'
6927 test "$_libpostproc" = yes && def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
6928 echores "$_libpostproc"
6930 echocheck "FFmpeg libswscale"
6931 if test "$_libswscale" = auto ; then
6932 _libswscale=no
6933 cat > $TMPC << EOF
6934 #include <libswscale/swscale.h>
6935 int main(void) { sws_scale(0, 0, 0, 0, 0, 0, 0); return 0; }
6937 if $_pkg_config --exists libswscale ; then
6938 _inc_libswscale=$($_pkg_config --cflags libswscale)
6939 _ld_tmp=$($_pkg_config --libs libswscale)
6940 cc_check $_inc_libswscale $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" extra_cflags="$extra_cflags $_inc_libswscale" \
6941 && _libswscale=yes
6942 elif cc_check -lswscale ; then
6943 extra_ldflags="$extra_ldflags -lswscale"
6944 _libswscale=yes
6947 def_libswscale='#undef CONFIG_LIBSWSCALE'
6948 test "$_libswscale" = yes && def_libswscale='#define CONFIG_LIBSWSCALE 1'
6949 echores "$_libswscale"
6951 def_libswscale_internals="#undef CONFIG_LIBSWSCALE_INTERNALS"
6952 if ! test -z "$_ffmpeg_source" ; then
6953 test "$_libswscale" = yes && def_libswscale_internals="#define CONFIG_LIBSWSCALE_INTERNALS 1" && _libswscale_internals=yes
6956 def_libavcodec_internals="#undef CONFIG_LIBAVCODEC_INTERNALS"
6957 if ! test -z "$_ffmpeg_source" ; then
6958 test "$_libavcodec" = yes && def_libavcodec_internals="#define CONFIG_LIBAVCODEC_INTERNALS 1" && _libavcodec_internals=yes
6961 echocheck "libdv-0.9.5+"
6962 if test "$_libdv" = auto ; then
6963 _libdv=no
6964 cat > $TMPC <<EOF
6965 #include <libdv/dv.h>
6966 int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
6968 cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
6970 if test "$_libdv" = yes ; then
6971 def_libdv='#define CONFIG_LIBDV095 1'
6972 extra_ldflags="$extra_ldflags -ldv"
6973 codecmodules="libdv $codecmodules"
6974 else
6975 def_libdv='#undef CONFIG_LIBDV095'
6976 nocodecmodules="libdv $nocodecmodules"
6978 echores "$_libdv"
6981 echocheck "Xvid"
6982 if test "$_xvid" = auto ; then
6983 _xvid=no
6984 cat > $TMPC << EOF
6985 #include <xvid.h>
6986 int main(void) { xvid_global(0, 0, 0, 0); return 0; }
6988 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6989 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6990 done
6993 if test "$_xvid" = yes ; then
6994 def_xvid='#define CONFIG_XVID4 1'
6995 codecmodules="xvid $codecmodules"
6996 else
6997 def_xvid='#undef CONFIG_XVID4'
6998 nocodecmodules="xvid $nocodecmodules"
7000 echores "$_xvid"
7002 echocheck "x264"
7003 if test "$_x264" = auto ; then
7004 cat > $TMPC << EOF
7005 #include <inttypes.h>
7006 #include <x264.h>
7007 #if X264_BUILD < 98
7008 #error We do not support old versions of x264. Get the latest from git.
7009 #endif
7010 int main(void) { x264_encoder_open((void*)0); return 0; }
7012 _x264=no
7013 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
7014 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
7015 done
7018 if test "$_x264" = yes ; then
7019 def_x264='#define CONFIG_X264 1'
7020 codecmodules="x264 $codecmodules"
7021 else
7022 def_x264='#undef CONFIG_X264'
7023 nocodecmodules="x264 $nocodecmodules"
7025 echores "$_x264"
7027 echocheck "libnut"
7028 if test "$_libnut" = auto ; then
7029 cat > $TMPC << EOF
7030 #include <libnut.h>
7031 nut_context_tt * nut;
7032 int main(void) { (void)nut_error(0); return 0; }
7034 _libnut=no
7035 cc_check -lnut && _libnut=yes
7038 if test "$_libnut" = yes ; then
7039 def_libnut='#define CONFIG_LIBNUT 1'
7040 extra_ldflags="$extra_ldflags -lnut"
7041 else
7042 def_libnut='#undef CONFIG_LIBNUT'
7044 echores "$_libnut"
7046 # These VO checks must be done after libavcodec/libswscale one
7047 echocheck "/dev/mga_vid"
7048 if test "$_mga" = auto ; then
7049 _mga=no
7050 test -c /dev/mga_vid && _mga=yes
7052 if test "$_mga" = yes ; then
7053 if test "$_libswscale_internals" = yes ; then
7054 def_mga='#define CONFIG_MGA 1'
7055 vomodules="mga $vomodules"
7056 else
7057 res_comment="libswscale internal headers are required by mga, sorry"
7058 _mga=no
7059 def_mga='#undef CONFIG_MGA'
7060 novomodules="mga $novomodules"
7062 else
7063 def_mga='#undef CONFIG_MGA'
7064 novomodules="mga $novomodules"
7066 echores "$_mga"
7069 echocheck "xmga"
7070 if test "$_xmga" = auto ; then
7071 _xmga=no
7072 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
7074 if test "$_xmga" = yes ; then
7075 if test "$_libswscale_internals" = yes ; then
7076 def_xmga='#define CONFIG_XMGA 1'
7077 vomodules="xmga $vomodules"
7078 else
7079 res_comment="libswscale internal headers are required by xmga, sorry"
7080 _xmga=no
7081 def_xmga='#undef CONFIG_XMGA'
7082 novomodules="xmga $novomodules"
7084 else
7085 def_xmga='#undef CONFIG_XMGA'
7086 novomodules="xmga $novomodules"
7088 echores "$_xmga"
7090 echocheck "zr"
7091 if test "$_zr" = auto ; then
7092 #36067's seem to identify themselves as 36057PQC's, so the line
7093 #below should work for 36067's and 36057's.
7094 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
7095 _zr=yes
7096 else
7097 _zr=no
7100 if test "$_zr" = yes ; then
7101 if test "$_libavcodec_internals" = yes ; then
7102 def_zr='#define CONFIG_ZR 1'
7103 vomodules="zr zr2 $vomodules"
7104 else
7105 res_comment="libavcodec internal headers are required by zr, sorry"
7106 novomodules="zr $novomodules"
7107 def_zr='#undef CONFIG_ZR'
7109 else
7110 def_zr='#undef CONFIG_ZR'
7111 novomodules="zr zr2 $novomodules"
7113 echores "$_zr"
7115 # mencoder requires (optional) those libs: libmp3lame
7116 if test "$_mencoder" != no ; then
7118 echocheck "libmp3lame"
7119 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
7120 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
7121 if test "$_mp3lame" = auto ; then
7122 _mp3lame=no
7123 cat > $TMPC <<EOF
7124 #include <lame/lame.h>
7125 int main(void) { lame_version_t lv; (void) lame_init();
7126 get_lame_version_numerical(&lv);
7127 return 0; }
7129 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
7131 if test "$_mp3lame" = yes ; then
7132 def_mp3lame="#define CONFIG_MP3LAME 1"
7133 _ld_mp3lame=-lmp3lame
7134 libs_mencoder="$libs_mencoder $_ld_mp3lame"
7135 cat > $TMPC << EOF
7136 #include <lame/lame.h>
7137 int main(void) { lame_set_preset(NULL, STANDARD_FAST); return 0; }
7139 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
7140 cat > $TMPC << EOF
7141 #include <lame/lame.h>
7142 int main(void) { lame_set_preset(NULL, MEDIUM_FAST); return 0; }
7144 cc_check $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
7145 else
7146 def_mp3lame='#undef CONFIG_MP3LAME'
7148 echores "$_mp3lame"
7150 fi # test "$_mencoder" != no
7152 echocheck "mencoder"
7153 if test "$_mencoder" = yes ; then
7154 def_muxers='#define CONFIG_MUXERS 1'
7155 else
7156 def_muxers='#define CONFIG_MUXERS 0'
7158 echores "$_mencoder"
7161 echocheck "UnRAR executable"
7162 if test "$_unrar_exec" = auto ; then
7163 _unrar_exec="yes"
7164 mingw32 && _unrar_exec="no"
7166 if test "$_unrar_exec" = yes ; then
7167 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
7168 else
7169 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
7171 echores "$_unrar_exec"
7173 echocheck "TV interface"
7174 if test "$_tv" = yes ; then
7175 def_tv='#define CONFIG_TV 1'
7176 inputmodules="tv $inputmodules"
7177 else
7178 noinputmodules="tv $noinputmodules"
7179 def_tv='#undef CONFIG_TV'
7181 echores "$_tv"
7184 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
7185 echocheck "*BSD BT848 bt8xx header"
7186 _ioctl_bt848_h=no
7187 for file in "machine/ioctl_bt848.h" \
7188 "dev/bktr/ioctl_bt848.h" \
7189 "dev/video/bktr/ioctl_bt848.h" \
7190 "dev/ic/bt8xx.h" ; do
7191 cat > $TMPC <<EOF
7192 #include <sys/types.h>
7193 #include <sys/ioctl.h>
7194 #include <$file>
7195 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
7197 if cc_check ; then
7198 _ioctl_bt848_h=yes
7199 _ioctl_bt848_h_name="$file"
7200 break;
7202 done
7203 if test "$_ioctl_bt848_h" = yes ; then
7204 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
7205 res_comment="using $_ioctl_bt848_h_name"
7206 else
7207 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
7209 echores "$_ioctl_bt848_h"
7211 echocheck "*BSD ioctl_meteor.h"
7212 _ioctl_meteor_h=no
7213 for file in "machine/ioctl_meteor.h" \
7214 "dev/bktr/ioctl_meteor.h" \
7215 "dev/video/bktr/ioctl_meteor.h" ; do
7216 cat > $TMPC <<EOF
7217 #include <sys/types.h>
7218 #include <$file>
7219 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
7221 if cc_check ; then
7222 _ioctl_meteor_h=yes
7223 _ioctl_meteor_h_name="$file"
7224 break;
7226 done
7227 if test "$_ioctl_meteor_h" = yes ; then
7228 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7229 res_comment="using $_ioctl_meteor_h_name"
7230 else
7231 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7233 echores "$_ioctl_meteor_h"
7235 echocheck "*BSD BrookTree 848 TV interface"
7236 if test "$_tv_bsdbt848" = auto ; then
7237 _tv_bsdbt848=no
7238 if test "$_tv" = yes ; then
7239 cat > $TMPC <<EOF
7240 #include <sys/types.h>
7241 $def_ioctl_meteor_h_name
7242 $def_ioctl_bt848_h_name
7243 #ifdef IOCTL_METEOR_H_NAME
7244 #include IOCTL_METEOR_H_NAME
7245 #endif
7246 #ifdef IOCTL_BT848_H_NAME
7247 #include IOCTL_BT848_H_NAME
7248 #endif
7249 int main(void) {
7250 ioctl(0, METEORSINPUT, 0);
7251 ioctl(0, TVTUNER_GETFREQ, 0);
7252 return 0;
7255 cc_check && _tv_bsdbt848=yes
7258 if test "$_tv_bsdbt848" = yes ; then
7259 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7260 inputmodules="tv-bsdbt848 $inputmodules"
7261 else
7262 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7263 noinputmodules="tv-bsdbt848 $noinputmodules"
7265 echores "$_tv_bsdbt848"
7266 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7269 echocheck "DirectShow TV interface"
7270 if test "$_tv_dshow" = auto ; then
7271 _tv_dshow=no
7272 if test "$_tv" = yes && win32 ; then
7273 cat > $TMPC <<EOF
7274 #include <ole2.h>
7275 int main(void) {
7276 void* p;
7277 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7278 return 0;
7281 cc_check -lole32 -luuid && _tv_dshow=yes
7284 if test "$_tv_dshow" = yes ; then
7285 inputmodules="tv-dshow $inputmodules"
7286 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7287 extra_ldflags="$extra_ldflags -lole32 -luuid"
7288 else
7289 noinputmodules="tv-dshow $noinputmodules"
7290 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7292 echores "$_tv_dshow"
7295 echocheck "Video 4 Linux TV interface"
7296 if test "$_tv_v4l1" = auto ; then
7297 _tv_v4l1=no
7298 if test "$_tv" = yes && linux ; then
7299 header_check linux/videodev.h && _tv_v4l1=yes
7302 if test "$_tv_v4l1" = yes ; then
7303 _audio_input=yes
7304 _tv_v4l=yes
7305 def_tv_v4l='#define CONFIG_TV_V4L 1'
7306 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7307 inputmodules="tv-v4l $inputmodules"
7308 else
7309 noinputmodules="tv-v4l1 $noinputmodules"
7310 def_tv_v4l='#undef CONFIG_TV_V4L'
7312 echores "$_tv_v4l1"
7315 echocheck "Video 4 Linux 2 TV interface"
7316 if test "$_tv_v4l2" = auto ; then
7317 _tv_v4l2=no
7318 if test "$_tv" = yes && linux ; then
7319 header_check linux/videodev2.h && _tv_v4l2=yes
7322 if test "$_tv_v4l2" = yes ; then
7323 _audio_input=yes
7324 _tv_v4l=yes
7325 def_tv_v4l='#define CONFIG_TV_V4L 1'
7326 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7327 inputmodules="tv-v4l2 $inputmodules"
7328 else
7329 noinputmodules="tv-v4l2 $noinputmodules"
7330 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7332 echores "$_tv_v4l2"
7335 echocheck "Radio interface"
7336 if test "$_radio" = yes ; then
7337 def_radio='#define CONFIG_RADIO 1'
7338 inputmodules="radio $inputmodules"
7339 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7340 _radio_capture=no
7342 if test "$_radio_capture" = yes ; then
7343 _audio_input=yes
7344 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7345 else
7346 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7348 else
7349 noinputmodules="radio $noinputmodules"
7350 def_radio='#undef CONFIG_RADIO'
7351 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7352 _radio_capture=no
7354 echores "$_radio"
7355 echocheck "Capture for Radio interface"
7356 echores "$_radio_capture"
7358 echocheck "Video 4 Linux 2 Radio interface"
7359 if test "$_radio_v4l2" = auto ; then
7360 _radio_v4l2=no
7361 if test "$_radio" = yes && linux ; then
7362 header_check linux/videodev2.h && _radio_v4l2=yes
7365 if test "$_radio_v4l2" = yes ; then
7366 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7367 else
7368 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7370 echores "$_radio_v4l2"
7372 echocheck "Video 4 Linux Radio interface"
7373 if test "$_radio_v4l" = auto ; then
7374 _radio_v4l=no
7375 if test "$_radio" = yes && linux ; then
7376 header_check linux/videodev.h && _radio_v4l=yes
7379 if test "$_radio_v4l" = yes ; then
7380 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7381 else
7382 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7384 echores "$_radio_v4l"
7386 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7387 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7388 echocheck "*BSD BrookTree 848 Radio interface"
7389 _radio_bsdbt848=no
7390 cat > $TMPC <<EOF
7391 #include <sys/types.h>
7392 $def_ioctl_bt848_h_name
7393 #ifdef IOCTL_BT848_H_NAME
7394 #include IOCTL_BT848_H_NAME
7395 #endif
7396 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7398 cc_check && _radio_bsdbt848=yes
7399 echores "$_radio_bsdbt848"
7400 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7402 if test "$_radio_bsdbt848" = yes ; then
7403 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7404 else
7405 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7408 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7409 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7410 die "Radio driver requires BSD BT848, V4L or V4L2!"
7413 echocheck "Video 4 Linux 2 MPEG PVR interface"
7414 if test "$_pvr" = auto ; then
7415 _pvr=no
7416 if test "$_tv_v4l2" = yes && linux ; then
7417 cat > $TMPC <<EOF
7418 #include <linux/videodev2.h>
7419 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7421 cc_check && _pvr=yes
7424 if test "$_pvr" = yes ; then
7425 def_pvr='#define CONFIG_PVR 1'
7426 inputmodules="pvr $inputmodules"
7427 else
7428 noinputmodules="pvr $noinputmodules"
7429 def_pvr='#undef CONFIG_PVR'
7431 echores "$_pvr"
7434 echocheck "ftp"
7435 if ! beos && test "$_ftp" = yes ; then
7436 def_ftp='#define CONFIG_FTP 1'
7437 inputmodules="ftp $inputmodules"
7438 else
7439 noinputmodules="ftp $noinputmodules"
7440 def_ftp='#undef CONFIG_FTP'
7442 echores "$_ftp"
7444 echocheck "vstream client"
7445 if test "$_vstream" = auto ; then
7446 _vstream=no
7447 cat > $TMPC <<EOF
7448 #include <vstream-client.h>
7449 void vstream_error(const char *format, ... ) {}
7450 int main(void) { vstream_start(); return 0; }
7452 cc_check -lvstream-client && _vstream=yes
7454 if test "$_vstream" = yes ; then
7455 def_vstream='#define CONFIG_VSTREAM 1'
7456 inputmodules="vstream $inputmodules"
7457 extra_ldflags="$extra_ldflags -lvstream-client"
7458 else
7459 noinputmodules="vstream $noinputmodules"
7460 def_vstream='#undef CONFIG_VSTREAM'
7462 echores "$_vstream"
7465 echocheck "OSD menu"
7466 if test "$_menu" = yes ; then
7467 def_menu='#define CONFIG_MENU 1'
7468 test $_dvbin = "yes" && _menu_dvbin=yes
7469 else
7470 def_menu='#undef CONFIG_MENU'
7471 _menu_dvbin=no
7473 echores "$_menu"
7476 echocheck "Subtitles sorting"
7477 if test "$_sortsub" = yes ; then
7478 def_sortsub='#define CONFIG_SORTSUB 1'
7479 else
7480 def_sortsub='#undef CONFIG_SORTSUB'
7482 echores "$_sortsub"
7485 echocheck "XMMS inputplugin support"
7486 if test "$_xmms" = yes ; then
7487 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7488 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7489 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7490 else
7491 _xmmsplugindir=/usr/lib/xmms/Input
7492 _xmmslibdir=/usr/lib
7495 def_xmms='#define CONFIG_XMMS 1'
7496 if darwin ; then
7497 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7498 else
7499 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7501 else
7502 def_xmms='#undef CONFIG_XMMS'
7504 echores "$_xmms"
7506 if test "$_charset" != "noconv" ; then
7507 def_charset="#define MSG_CHARSET \"$_charset\""
7508 else
7509 def_charset="#undef MSG_CHARSET"
7510 _charset="UTF-8"
7513 #############################################################################
7515 echocheck "automatic gdb attach"
7516 if test "$_crash_debug" = yes ; then
7517 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
7518 else
7519 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
7520 _crash_debug=no
7522 echores "$_crash_debug"
7524 echocheck "compiler support for noexecstack"
7525 cat > $TMPC <<EOF
7526 int main(void) { return 0; }
7528 if cc_check -Wl,-z,noexecstack ; then
7529 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
7530 echores "yes"
7531 else
7532 echores "no"
7535 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
7536 if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
7537 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
7538 echores "yes"
7539 else
7540 echores "no"
7544 # Dynamic linking flags
7545 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7546 _ld_dl_dynamic=''
7547 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7548 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
7549 _ld_dl_dynamic='-rdynamic'
7552 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7553 bsdos && extra_ldflags="$extra_ldflags -ldvd"
7554 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
7556 def_debug='#undef MP_DEBUG'
7557 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
7560 echocheck "joystick"
7561 def_joystick='#undef CONFIG_JOYSTICK'
7562 if test "$_joystick" = yes ; then
7563 if linux ; then
7564 # TODO add some check
7565 def_joystick='#define CONFIG_JOYSTICK 1'
7566 else
7567 _joystick="no"
7568 res_comment="unsupported under $system_name"
7571 echores "$_joystick"
7573 echocheck "lirc"
7574 if test "$_lirc" = auto ; then
7575 _lirc=no
7576 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
7578 if test "$_lirc" = yes ; then
7579 def_lirc='#define CONFIG_LIRC 1'
7580 libs_mplayer="$libs_mplayer -llirc_client"
7581 else
7582 def_lirc='#undef CONFIG_LIRC'
7584 echores "$_lirc"
7586 echocheck "lircc"
7587 if test "$_lircc" = auto ; then
7588 _lircc=no
7589 header_check lirc/lircc.h -llircc && _lircc=yes
7591 if test "$_lircc" = yes ; then
7592 def_lircc='#define CONFIG_LIRCC 1'
7593 libs_mplayer="$libs_mplayer -llircc"
7594 else
7595 def_lircc='#undef CONFIG_LIRCC'
7597 echores "$_lircc"
7599 if arm; then
7600 # Detect maemo development platform libraries availability (http://www.maemo.org),
7601 # they are used when run on Nokia 770|8x0
7602 echocheck "maemo (Nokia 770|8x0)"
7603 if test "$_maemo" = auto ; then
7604 _maemo=no
7605 cat > $TMPC << EOF
7606 #include <libosso.h>
7607 int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
7609 cc_check $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7611 if test "$_maemo" = yes ; then
7612 def_maemo='#define CONFIG_MAEMO 1'
7613 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7614 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7615 else
7616 def_maemo='#undef CONFIG_MAEMO'
7618 echores "$_maemo"
7621 #############################################################################
7623 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7624 # the OMF format needs to come after the 'extern symbol prefix' check, which
7625 # uses nm.
7626 if os2 ; then
7627 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7630 # linker paths should be the same for mencoder and mplayer
7631 _ld_tmp=""
7632 for I in $libs_mplayer ; do
7633 _tmp=$(echo $I | sed -e 's/^-L.*$//')
7634 if test -z "$_tmp" ; then
7635 extra_ldflags="$extra_ldflags $I"
7636 else
7637 _ld_tmp="$_ld_tmp $I"
7639 done
7640 libs_mplayer=$_ld_tmp
7643 #############################################################################
7644 # 64 bit file offsets?
7645 if test "$_largefiles" = yes || freebsd ; then
7646 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7647 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7648 # dvdread support requires this (for off64_t)
7649 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7653 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
7655 # This must be the last test to be performed. Any other tests following it
7656 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7657 # against libdvdread (to permit MPlayer to use its own copy of the library).
7658 # So any compilation using the flags added here but not linking against
7659 # libdvdread can fail.
7660 echocheck "DVD support (libdvdnav)"
7661 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7662 _dvdnav=no
7664 dvdnav_internal=no
7665 if test "$_dvdnav" = auto ; then
7666 if test "$_dvdread_internal" = yes ; then
7667 _dvdnav=yes
7668 dvdnav_internal=yes
7669 res_comment="internal"
7670 else
7671 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7674 if test "$_dvdnav" = auto ; then
7675 cat > $TMPC <<EOF
7676 #include <inttypes.h>
7677 #include <dvdnav/dvdnav.h>
7678 int main(void) { dvdnav_t *dvd=0; return 0; }
7680 _dvdnav=no
7681 _dvdnavdir=$($_dvdnavconfig --cflags)
7682 _dvdnavlibs=$($_dvdnavconfig --libs)
7683 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7685 if test "$_dvdnav" = yes ; then
7686 _largefiles=yes
7687 def_dvdnav='#define CONFIG_DVDNAV 1'
7688 if test "$dvdnav_internal" = yes ; then
7689 cflags_libdvdnav="-Ilibdvdnav"
7690 inputmodules="dvdnav(internal) $inputmodules"
7691 else
7692 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7693 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7694 inputmodules="dvdnav $inputmodules"
7696 else
7697 def_dvdnav='#undef CONFIG_DVDNAV'
7698 noinputmodules="dvdnav $noinputmodules"
7700 echores "$_dvdnav"
7702 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7703 # Read dvdnav comment above.
7705 mak_enable () {
7706 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7707 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7708 nprefix=$3;
7709 for part in $list; do
7710 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7711 echo "${nprefix}_$part = yes"
7713 done
7716 #############################################################################
7717 echo "Creating config.mak"
7718 cat > config.mak << EOF
7719 # -------- Generated by configure -----------
7721 # Ensure that locale settings do not interfere with shell commands.
7722 export LC_ALL = C
7724 CONFIGURATION = $configuration
7726 CHARSET = $_charset
7727 DOC_LANGS = $language_doc
7728 DOC_LANG_ALL = $doc_lang_all
7729 MAN_LANGS = $language_man
7730 MAN_LANG_ALL = $man_lang_all
7731 MSG_LANGS = $language_msg
7732 MSG_LANG_ALL = $msg_lang_all
7734 prefix = \$(DESTDIR)$_prefix
7735 BINDIR = \$(DESTDIR)$_bindir
7736 DATADIR = \$(DESTDIR)$_datadir
7737 LIBDIR = \$(DESTDIR)$_libdir
7738 MANDIR = \$(DESTDIR)$_mandir
7739 CONFDIR = \$(DESTDIR)$_confdir
7740 LOCALEDIR = \$(DESTDIR)$_localedir
7742 AR = $_ar
7743 AS = $_cc
7744 CC = $_cc
7745 CXX = $_cc
7746 HOST_CC = $_host_cc
7747 INSTALL = $_install
7748 INSTALLSTRIP = $_install_strip
7749 WINDRES = $_windres
7751 CFLAGS = $CFLAGS $extra_cflags
7752 CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
7754 CFLAGS_DHAHELPER = $cflags_dhahelper
7755 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7756 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7757 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7758 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7759 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7760 CFLAGS_STACKREALIGN = $cflags_stackrealign
7761 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7762 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7764 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7765 EXTRALIBS_MPLAYER = $libs_mplayer
7766 EXTRALIBS_MENCODER = $libs_mencoder
7768 GETCH = $_getch
7769 TIMER = $_timer
7771 EXESUF = $_exesuf
7772 EXESUFS_ALL = .exe
7774 ARCH = $arch
7775 $(mak_enable "$arch_all" "$arch" ARCH)
7776 $(mak_enable "$subarch_all" "$subarch" ARCH)
7777 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7779 MENCODER = $_mencoder
7780 MPLAYER = $_mplayer
7782 NEED_GETTIMEOFDAY = $_need_gettimeofday
7783 NEED_GLOB = $_need_glob
7784 NEED_MMAP = $_need_mmap
7785 NEED_SETENV = $_need_setenv
7786 NEED_SHMEM = $_need_shmem
7787 NEED_STRSEP = $_need_strsep
7788 NEED_SWAB = $_need_swab
7789 NEED_VSSCANF = $_need_vsscanf
7791 # features
7792 3DFX = $_3dfx
7793 AA = $_aa
7794 ALSA1X = $_alsa1x
7795 ALSA9 = $_alsa9
7796 ALSA5 = $_alsa5
7797 APPLE_IR = $_apple_ir
7798 APPLE_REMOTE = $_apple_remote
7799 ARTS = $_arts
7800 AUDIO_INPUT = $_audio_input
7801 BITMAP_FONT = $_bitmap_font
7802 BL = $_bl
7803 CACA = $_caca
7804 CDDA = $_cdda
7805 CDDB = $_cddb
7806 COREAUDIO = $_coreaudio
7807 COREVIDEO = $_corevideo
7808 DART = $_dart
7809 DFBMGA = $_dfbmga
7810 DGA = $_dga
7811 DIRECT3D = $_direct3d
7812 DIRECTFB = $_directfb
7813 DIRECTX = $_directx
7814 DVBIN = $_dvbin
7815 DVDNAV = $_dvdnav
7816 DVDNAV_INTERNAL = $dvdnav_internal
7817 DVDREAD = $_dvdread
7818 DVDREAD_INTERNAL = $_dvdread_internal
7819 DXR2 = $_dxr2
7820 DXR3 = $_dxr3
7821 ESD = $_esd
7822 FAAC=$_faac
7823 FAAD = $_faad
7824 FAAD_INTERNAL = $_faad_internal
7825 FASTMEMCPY = $_fastmemcpy
7826 FBDEV = $_fbdev
7827 FREETYPE = $_freetype
7828 FTP = $_ftp
7829 GIF = $_gif
7830 GGI = $_ggi
7831 GL = $_gl
7832 GL_WIN32 = $_gl_win32
7833 GL_X11 = $_gl_x11
7834 GL_SDL = $_gl_sdl
7835 MATRIXVIEW = $matrixview
7836 HAVE_POSIX_SELECT = $_posix_select
7837 HAVE_SYS_MMAN_H = $_mman
7838 IVTV = $_ivtv
7839 JACK = $_jack
7840 JOYSTICK = $_joystick
7841 JPEG = $_jpeg
7842 KAI = $_kai
7843 KVA = $_kva
7844 LADSPA = $_ladspa
7845 LIBA52 = $_liba52
7846 LIBASS = $_ass
7847 LIBBS2B = $_libbs2b
7848 LIBDCA = $_libdca
7849 LIBDV = $_libdv
7850 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7851 LIBLZO = $_liblzo
7852 LIBMAD = $_mad
7853 LIBMENU = $_menu
7854 LIBMENU_DVBIN = $_menu_dvbin
7855 LIBMPEG2 = $_libmpeg2
7856 LIBNEMESI = $_nemesi
7857 LIBNUT = $_libnut
7858 LIBSMBCLIENT = $_smb
7859 LIBTHEORA = $_theora
7860 LIRC = $_lirc
7861 LIVE555 = $_live
7862 MACOSX_FINDER = $_macosx_finder
7863 MD5SUM = $_md5sum
7864 MGA = $_mga
7865 MNG = $_mng
7866 MP3LAME = $_mp3lame
7867 MP3LIB = $_mp3lib
7868 MPG123 = $_mpg123
7869 MUSEPACK = $_musepack
7870 NAS = $_nas
7871 NATIVE_RTSP = $_native_rtsp
7872 NETWORK = $_network
7873 OPENAL = $_openal
7874 OSS = $_ossaudio
7875 PE_EXECUTABLE = $_pe_executable
7876 PNG = $_png
7877 PNM = $_pnm
7878 PRIORITY = $_priority
7879 PULSE = $_pulse
7880 PVR = $_pvr
7881 QTX_CODECS = $_qtx
7882 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7883 QTX_EMULATION = $_qtx_emulation
7884 QUARTZ = $_quartz
7885 RADIO=$_radio
7886 RADIO_CAPTURE=$_radio_capture
7887 REAL_CODECS = $_real
7888 S3FB = $_s3fb
7889 SDL = $_sdl
7890 SPEEX = $_speex
7891 STREAM_CACHE = $_stream_cache
7892 SGIAUDIO = $_sgiaudio
7893 SUNAUDIO = $_sunaudio
7894 SVGA = $_svga
7895 TDFXFB = $_tdfxfb
7896 TDFXVID = $_tdfxvid
7897 TGA = $_tga
7898 TOOLAME=$_toolame
7899 TREMOR_INTERNAL = $_tremor_internal
7900 TV = $_tv
7901 TV_BSDBT848 = $_tv_bsdbt848
7902 TV_DSHOW = $_tv_dshow
7903 TV_V4L = $_tv_v4l
7904 TV_V4L1 = $_tv_v4l1
7905 TV_V4L2 = $_tv_v4l2
7906 TWOLAME=$_twolame
7907 UNRAR_EXEC = $_unrar_exec
7908 V4L2 = $_v4l2
7909 VCD = $_vcd
7910 VDPAU = $_vdpau
7911 VESA = $_vesa
7912 VIDIX = $_vidix
7913 VIDIX_PCIDB = $_vidix_pcidb_val
7914 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7915 VIDIX_IVTV=$_vidix_drv_ivtv
7916 VIDIX_MACH64=$_vidix_drv_mach64
7917 VIDIX_MGA=$_vidix_drv_mga
7918 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7919 VIDIX_NVIDIA=$_vidix_drv_nvidia
7920 VIDIX_PM2=$_vidix_drv_pm2
7921 VIDIX_PM3=$_vidix_drv_pm3
7922 VIDIX_RADEON=$_vidix_drv_radeon
7923 VIDIX_RAGE128=$_vidix_drv_rage128
7924 VIDIX_S3=$_vidix_drv_s3
7925 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7926 VIDIX_SIS=$_vidix_drv_sis
7927 VIDIX_UNICHROME=$_vidix_drv_unichrome
7928 VORBIS = $_vorbis
7929 VSTREAM = $_vstream
7930 WII = $_wii
7931 WIN32DLL = $_win32dll
7932 WIN32WAVEOUT = $_win32waveout
7933 WIN32_EMULATION = $_win32_emulation
7934 WINVIDIX = $winvidix
7935 X11 = $_x11
7936 X264 = $_x264
7937 XANIM_CODECS = $_xanim
7938 XMGA = $_xmga
7939 XMMS_PLUGINS = $_xmms
7940 XV = $_xv
7941 XVID4 = $_xvid
7942 XVIDIX = $xvidix
7943 XVMC = $_xvmc
7944 XVR100 = $_xvr100
7945 YUV4MPEG = $_yuv4mpeg
7946 ZR = $_zr
7948 # FFmpeg
7949 LIBAVUTIL = $_libavutil
7950 LIBAVCODEC = $_libavcodec
7951 LIBAVFORMAT = $_libavformat
7952 LIBPOSTPROC = $_libpostproc
7953 LIBSWSCALE = $_libswscale
7954 LIBAVCODEC_INTERNALS = $_libavcodec_internals
7955 LIBSWSCALE_INTERNALS = $_libswscale_internals
7956 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7958 RANLIB = $_ranlib
7959 YASM = $_yasm
7960 YASMFLAGS = $YASMFLAGS
7962 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
7963 CONFIG_AANDCT = yes
7964 CONFIG_FFT = yes
7965 CONFIG_GOLOMB = yes
7966 CONFIG_H264DSP = yes
7967 CONFIG_LPC = yes
7968 CONFIG_MDCT = yes
7969 CONFIG_RDFT = yes
7971 CONFIG_BZLIB = $bzlib
7972 CONFIG_ENCODERS = yes
7973 CONFIG_GPL = yes
7974 CONFIG_MLIB = $_mlib
7975 CONFIG_MUXERS = $_mencoder
7976 CONFIG_VDPAU = $_vdpau
7977 CONFIG_XVMC = $_xvmc
7978 CONFIG_ZLIB = $_zlib
7980 HAVE_PTHREADS = $_pthreads
7981 HAVE_SHM = $_shm
7982 HAVE_W32THREADS = $_w32threads
7983 HAVE_YASM = $have_yasm
7987 #############################################################################
7989 ff_config_enable () {
7990 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7991 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7992 _nprefix=$3;
7993 test -z "$_nprefix" && _nprefix='CONFIG'
7994 for part in $list; do
7995 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7996 echo "#define ${_nprefix}_$part 1"
7997 else
7998 echo "#define ${_nprefix}_$part 0"
8000 done
8003 echo "Creating config.h"
8004 cat > $TMPH << EOF
8005 /*----------------------------------------------------------------------------
8006 ** This file has been automatically generated by configure any changes in it
8007 ** will be lost when you run configure again.
8008 ** Instead of modifying definitions here, use the --enable/--disable options
8009 ** of the configure script! See ./configure --help for details.
8010 *---------------------------------------------------------------------------*/
8012 #ifndef MPLAYER_CONFIG_H
8013 #define MPLAYER_CONFIG_H
8015 /* Undefine this if you do not want to select mono audio (left or right)
8016 with a stereo MPEG layer 2/3 audio stream. The command line option
8017 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
8018 right-only), with 0 being the default.
8020 #define CONFIG_FAKE_MONO 1
8022 /* set up audio OUTBURST. Do not change this! */
8023 #define OUTBURST 512
8025 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
8026 #undef FAST_OSD
8027 #undef FAST_OSD_TABLE
8029 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
8030 #define MPEG12_POSTPROC 1
8031 #define ATTRIBUTE_ALIGNED_MAX 16
8035 #define CONFIGURATION "$configuration"
8037 #define MPLAYER_DATADIR "$_datadir"
8038 #define MPLAYER_CONFDIR "$_confdir"
8039 #define MPLAYER_LIBDIR "$_libdir"
8040 #define MPLAYER_LOCALEDIR "$_localedir"
8042 $def_translation
8044 /* definitions needed by included libraries */
8045 #define HAVE_INTTYPES_H 1
8046 /* libmpeg2 + FFmpeg */
8047 $def_fast_inttypes
8048 /* libdvdcss */
8049 #define HAVE_ERRNO_H 1
8050 /* libdvdcss + libdvdread */
8051 #define HAVE_LIMITS_H 1
8052 /* libdvdcss + libfaad2 */
8053 #define HAVE_UNISTD_H 1
8054 /* libfaad2 + libdvdread */
8055 #define STDC_HEADERS 1
8056 #define HAVE_MEMCPY 1
8057 /* libfaad2 */
8058 #define HAVE_STRING_H 1
8059 #define HAVE_STRINGS_H 1
8060 #define HAVE_SYS_STAT_H 1
8061 #define HAVE_SYS_TYPES_H 1
8062 /* libdvdnav */
8063 #define READ_CACHE_TRACE 0
8064 /* libdvdread */
8065 #define HAVE_DLFCN_H 1
8066 $def_dvdcss
8069 /* system headers */
8070 $def_alloca_h
8071 $def_alsa_asoundlib_h
8072 $def_altivec_h
8073 $def_malloc_h
8074 $def_mman_h
8075 $def_mman_has_map_failed
8076 $def_soundcard_h
8077 $def_sys_asoundlib_h
8078 $def_sys_soundcard_h
8079 $def_sys_sysinfo_h
8080 $def_termios_h
8081 $def_termios_sys_h
8082 $def_winsock2_h
8085 /* system functions */
8086 $def_gethostbyname2
8087 $def_gettimeofday
8088 $def_glob
8089 $def_langinfo
8090 $def_lrintf
8091 $def_map_memalign
8092 $def_memalign
8093 $def_nanosleep
8094 $def_posix_select
8095 $def_select
8096 $def_setenv
8097 $def_setmode
8098 $def_shm
8099 $def_strsep
8100 $def_swab
8101 $def_sysi86
8102 $def_sysi86_iv
8103 $def_termcap
8104 $def_termios
8105 $def_vsscanf
8108 /* system-specific features */
8109 $def_asmalign_pot
8110 $def_builtin_expect
8111 $def_dl
8112 $def_dos_paths
8113 $def_extern_asm
8114 $def_extern_prefix
8115 $def_iconv
8116 $def_kstat
8117 $def_macosx_bundle
8118 $def_macosx_finder
8119 $def_maemo
8120 $def_named_asm_args
8121 $def_priority
8122 $def_quicktime
8123 $def_restrict_keyword
8124 $def_rtc
8125 $def_unrar_exec
8128 /* configurable options */
8129 $def_charset
8130 $def_crash_debug
8131 $def_debug
8132 $def_dynamic_plugins
8133 $def_fastmemcpy
8134 $def_menu
8135 $def_runtime_cpudetection
8136 $def_sighandler
8137 $def_sortsub
8138 $def_stream_cache
8139 $def_pthread_cache
8142 /* CPU stuff */
8143 #define __CPU__ $iproc
8144 $def_words_endian
8145 $def_bigendian
8146 $(ff_config_enable "$arch_all" "$arch" "ARCH")
8147 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
8148 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
8151 /* DVD/VCD/CD */
8152 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
8153 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
8154 $def_bsdi_dvd
8155 $def_cddb
8156 $def_cdio
8157 $def_cdparanoia
8158 $def_cdrom
8159 $def_dvd
8160 $def_dvd_bsd
8161 $def_dvd_darwin
8162 $def_dvd_linux
8163 $def_dvd_openbsd
8164 $def_dvdio
8165 $def_dvdnav
8166 $def_dvdread
8167 $def_hpux_scsi_h
8168 $def_libcdio
8169 $def_sol_scsi_h
8170 $def_vcd
8173 /* codec libraries */
8174 $def_faac
8175 $def_faad
8176 $def_faad_internal
8177 $def_liba52
8178 $def_libdca
8179 $def_libdv
8180 $def_liblzo
8181 $def_libmpeg2
8182 $def_mad
8183 $def_mp3lame
8184 $def_mp3lame_preset
8185 $def_mp3lame_preset_medium
8186 $def_mp3lib
8187 $def_mpg123
8188 $def_musepack
8189 $def_speex
8190 $def_theora
8191 $def_toolame
8192 $def_tremor
8193 $def_twolame
8194 $def_vorbis
8195 $def_x264
8196 $def_xvid
8197 $def_zlib
8199 $def_libnut
8202 /* binary codecs */
8203 $def_qtx
8204 $def_qtx_win32
8205 $def_real
8206 $def_win32_loader
8207 $def_win32dll
8208 $def_xanim
8209 $def_xmms
8210 #define BINARY_CODECS_PATH "$_codecsdir"
8211 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
8214 /* Audio output drivers */
8215 $def_alsa
8216 $def_alsa1x
8217 $def_alsa5
8218 $def_alsa9
8219 $def_arts
8220 $def_coreaudio
8221 $def_dart
8222 $def_esd
8223 $def_esd_latency
8224 $def_jack
8225 $def_kai
8226 $def_nas
8227 $def_openal
8228 $def_openal_h
8229 $def_ossaudio
8230 $def_ossaudio_devdsp
8231 $def_ossaudio_devmixer
8232 $def_pulse
8233 $def_sgiaudio
8234 $def_sunaudio
8235 $def_win32waveout
8237 $def_ladspa
8238 $def_libbs2b
8241 /* input */
8242 $def_apple_ir
8243 $def_apple_remote
8244 $def_ioctl_bt848_h_name
8245 $def_ioctl_meteor_h_name
8246 $def_joystick
8247 $def_lirc
8248 $def_lircc
8249 $def_pvr
8250 $def_radio
8251 $def_radio_bsdbt848
8252 $def_radio_capture
8253 $def_radio_v4l
8254 $def_radio_v4l2
8255 $def_tv
8256 $def_tv_bsdbt848
8257 $def_tv_dshow
8258 $def_tv_v4l
8259 $def_tv_v4l1
8260 $def_tv_v4l2
8263 /* font stuff */
8264 $def_ass
8265 $def_bitmap_font
8266 $def_enca
8267 $def_fontconfig
8268 $def_freetype
8269 $def_fribidi
8272 /* networking */
8273 $def_closesocket
8274 $def_ftp
8275 $def_inet6
8276 $def_inet_aton
8277 $def_inet_pton
8278 $def_live
8279 $def_nemesi
8280 $def_network
8281 $def_smb
8282 $def_socklen_t
8283 $def_vstream
8286 /* libvo options */
8287 $def_3dfx
8288 $def_aa
8289 $def_bl
8290 $def_caca
8291 $def_corevideo
8292 $def_dfbmga
8293 $def_dga
8294 $def_dga1
8295 $def_dga2
8296 $def_direct3d
8297 $def_directfb
8298 $def_directfb_version
8299 $def_directx
8300 $def_dvb
8301 $def_dvbin
8302 $def_dxr2
8303 $def_dxr3
8304 $def_fbdev
8305 $def_ggi
8306 $def_ggiwmh
8307 $def_gif
8308 $def_gif_4
8309 $def_gif_tvt_hack
8310 $def_gl
8311 $def_gl_win32
8312 $def_gl_x11
8313 $def_gl_sdl
8314 $def_matrixview
8315 $def_ivtv
8316 $def_jpeg
8317 $def_kva
8318 $def_md5sum
8319 $def_mga
8320 $def_mng
8321 $def_png
8322 $def_pnm
8323 $def_quartz
8324 $def_s3fb
8325 $def_sdl
8326 $def_sdl_sdl_h
8327 $def_svga
8328 $def_tdfxfb
8329 $def_tdfxvid
8330 $def_tga
8331 $def_v4l2
8332 $def_vdpau
8333 $def_vesa
8334 $def_vidix
8335 $def_vidix_drv_cyberblade
8336 $def_vidix_drv_ivtv
8337 $def_vidix_drv_mach64
8338 $def_vidix_drv_mga
8339 $def_vidix_drv_mga_crtc2
8340 $def_vidix_drv_nvidia
8341 $def_vidix_drv_pm3
8342 $def_vidix_drv_radeon
8343 $def_vidix_drv_rage128
8344 $def_vidix_drv_s3
8345 $def_vidix_drv_sh_veu
8346 $def_vidix_drv_sis
8347 $def_vidix_drv_unichrome
8348 $def_vidix_pfx
8349 $def_vm
8350 $def_wii
8351 $def_x11
8352 $def_xdpms
8353 $def_xf86keysym
8354 $def_xinerama
8355 $def_xmga
8356 $def_xss
8357 $def_xv
8358 $def_xvmc
8359 $def_xvr100
8360 $def_yuv4mpeg
8361 $def_zr
8364 /* FFmpeg */
8365 $def_libavcodec
8366 $def_libavformat
8367 $def_libavutil
8368 $def_libpostproc
8369 $def_libswscale
8370 $def_libavcodec_internals
8371 $def_libswscale_internals
8373 #define CONFIG_DECODERS 1
8374 #define CONFIG_ENCODERS 1
8375 #define CONFIG_DEMUXERS 1
8376 $def_muxers
8378 $def_arpa_inet_h
8379 $def_bswap
8380 $def_bzlib
8381 $def_dcbzl
8382 $def_exp2
8383 $def_exp2f
8384 $def_fast_64bit
8385 $def_fast_unaligned
8386 $def_llrint
8387 $def_log2
8388 $def_log2f
8389 $def_lrint
8390 $def_memalign_hack
8391 $def_mlib
8392 $def_mkstemp
8393 $def_posix_memalign
8394 $def_pthreads
8395 $def_round
8396 $def_roundf
8397 $def_ten_operands
8398 $def_threads
8399 $def_truncf
8400 $def_xform_asm
8401 $def_yasm
8403 #define CONFIG_FASTDIV 0
8404 #define CONFIG_FFSERVER 0
8405 #define CONFIG_GPL 1
8406 #define CONFIG_GRAY 0
8407 #define CONFIG_HARDCODED_TABLES 0
8408 #define CONFIG_LIBVORBIS 0
8409 #define CONFIG_POWERPC_PERF 0
8410 #define CONFIG_SMALL 0
8411 #define CONFIG_SWSCALE_ALPHA 1
8413 #define HAVE_ATTRIBUTE_PACKED 1
8414 #define HAVE_GETHRTIME 0
8415 #define HAVE_INLINE_ASM 1
8416 #define HAVE_LDBRX 0
8417 #define HAVE_POLL_H 1
8418 #define HAVE_PPC4XX 0
8419 #define HAVE_VFP_ARGS 1
8420 #define HAVE_VIRTUALALLOC 0
8422 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
8423 #define CONFIG_AANDCT 1
8424 #define CONFIG_DCT 1
8425 #define CONFIG_DWT 1
8426 #define CONFIG_FFT 1
8427 #define CONFIG_GOLOMB 1
8428 #define CONFIG_H264DSP 1
8429 #define CONFIG_LPC 1
8430 #define CONFIG_MDCT 1
8431 #define CONFIG_RDFT 1
8433 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8434 $def_ebx_available
8435 #ifndef MP_DEBUG
8436 #define HAVE_EBP_AVAILABLE 1
8437 #else
8438 #define HAVE_EBP_AVAILABLE 0
8439 #endif
8441 #define CONFIG_H263_VAAPI_HWACCEL 0
8442 #define CONFIG_MPEG2_VAAPI_HWACCEL 0
8443 #define CONFIG_MPEG4_VAAPI_HWACCEL 0
8444 #define CONFIG_H264_VAAPI_HWACCEL 0
8445 #define CONFIG_VC1_VAAPI_HWACCEL 0
8446 #define CONFIG_WMV3_VAAPI_HWACCEL 0
8448 #endif /* MPLAYER_CONFIG_H */
8451 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8452 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8454 #############################################################################
8456 ./version.sh `$_cc -dumpversion`
8458 cat << EOF
8460 Config files successfully generated by ./configure $configuration !
8462 Install prefix: $_prefix
8463 Data directory: $_datadir
8464 Config direct.: $_confdir
8466 Byte order: $_byte_order
8467 Optimizing for: $_optimizing
8469 Languages:
8470 Messages (in addition to English): $language_msg
8471 Manual pages: $language_man
8472 Documentation: $language_doc
8474 Enabled optional drivers:
8475 Input: $inputmodules
8476 Codecs: $codecmodules
8477 Audio output: $aomodules
8478 Video output: $vomodules
8480 Disabled optional drivers:
8481 Input: $noinputmodules
8482 Codecs: $nocodecmodules
8483 Audio output: $noaomodules
8484 Video output: $novomodules
8486 'config.h' and 'config.mak' contain your configuration options.
8487 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8488 compile *** DO NOT REPORT BUGS if you tweak these files ***
8490 'make' will now compile MPlayer and 'make install' will install it.
8491 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8496 if test "$_mtrr" = yes ; then
8497 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$doc_lang/video.html#mtrr)"
8498 echo
8501 if ! x86_32; then
8502 cat <<EOF
8503 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8504 operating system ($system_name). You may encounter a few files that cannot
8505 be played due to missing open source video/audio codec support.
8511 cat <<EOF
8512 Check $TMPLOG if you wonder why an autodetection failed (make sure
8513 development headers/packages are installed).
8515 NOTE: The --enable-* parameters unconditionally force options on, completely
8516 skipping autodetection. This behavior is unlike what you may be used to from
8517 autoconf-based configure scripts that can decide to override you. This greater
8518 level of control comes at a price. You may have to provide the correct compiler
8519 and linker flags yourself.
8520 If you used one of these options (except --enable-menu and similar ones that
8521 turn on internal features) and experience a compilation or linking failure,
8522 make sure you have passed the necessary compiler/linker flags to configure.
8524 If you suspect a bug, please read DOCS/HTML/$doc_lang/bugreports.html.
8528 if test "$_warn_CFLAGS" = yes; then
8529 cat <<EOF
8531 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
8532 but:
8534 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8536 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8537 To do so, execute 'CFLAGS= ./configure <options>'
8542 # Last move:
8543 rm -rf "$mplayer_tmpdir"