configure: simplify some checks
[mplayer.git] / configure
blobc9202d6e254131c81771be942f841860722ab68d
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 $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG"
68 rm -f "$TMPEXE"
69 $_cc $WARNFLAGS $WARN_CFLAGS $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 cflag_check() {
85 cat > $TMPC << EOF
86 int main(void) { return 0; }
87 EOF
88 compile_check $TMPC $@
91 function_check() {
92 cat > $TMPC << EOF
93 #include <$1>
94 int main(void) { $2; return 0; }
95 EOF
96 shift
97 shift
98 compile_check $TMPC $@
101 header_check() {
102 cat > $TMPC << EOF
103 #include <$1>
104 int main(void) { return 0; }
106 shift
107 compile_check $TMPC $@
110 # this is a special check only to be
111 # used for broken headers that do not
112 # include all dependencies
113 header_check_broken() {
114 cat > $TMPC << EOF
115 #include <$1>
116 #include <$2>
117 int main(void) { return 0; }
119 shift
120 shift
121 compile_check $TMPC $@
124 yasm_check() {
125 echo >> "$TMPLOG"
126 cat "$TMPS" >> "$TMPLOG"
127 echo >> "$TMPLOG"
128 echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG"
129 rm -f "$TMPEXE"
130 $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1
131 TMPRES="$?"
132 echo >> "$TMPLOG"
133 echo >> "$TMPLOG"
134 return "$TMPRES"
137 tmp_run() {
138 "$TMPEXE" >> "$TMPLOG" 2>&1
141 # Display error message, flushes tempfile, exit
142 die () {
143 echo
144 echo "Error: $@" >&2
145 echo >&2
146 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
147 echo "Check \"$TMPLOG\" if you do not understand why it failed."
148 exit 1
151 # OS test booleans functions
152 issystem() {
153 test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
155 aix() { issystem "AIX"; }
156 amigaos() { issystem "AmigaOS"; }
157 beos() { issystem "BEOS"; }
158 bsdos() { issystem "BSD/OS"; }
159 cygwin() { issystem "CYGWIN"; }
160 darwin() { issystem "Darwin"; }
161 dragonfly() { issystem "DragonFly"; }
162 freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
163 gnu() { issystem "GNU"; }
164 hpux() { issystem "HP-UX"; }
165 irix() { issystem "IRIX"; }
166 linux() { issystem "Linux"; }
167 mingw32() { issystem "MINGW32"; }
168 morphos() { issystem "MorphOS"; }
169 netbsd() { issystem "NetBSD"; }
170 openbsd() { issystem "OpenBSD"; }
171 os2() { issystem "OS/2"; }
172 qnx() { issystem "QNX"; }
173 sunos() { issystem "SunOS"; }
174 win32() { cygwin || mingw32; }
176 # arch test boolean functions
177 # x86/x86pc is used by QNX
178 x86_32() {
179 case "$host_arch" in
180 i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
181 *) return 1 ;;
182 esac
185 x86_64() {
186 case "$host_arch" in
187 x86_64|amd64) return 0 ;;
188 *) return 1 ;;
189 esac
192 x86() {
193 x86_32 || x86_64
196 ppc() {
197 case "$host_arch" in
198 ppc|ppc64|powerpc|powerpc64) return 0;;
199 *) return 1;;
200 esac
203 alpha() {
204 case "$host_arch" in
205 alpha*) return 0;;
206 *) return 1;;
207 esac
210 arm() {
211 case "$host_arch" in
212 arm*) return 0;;
213 *) return 1;;
214 esac
217 # Use this before starting a check
218 echocheck() {
219 echo "============ Checking for $@ ============" >> "$TMPLOG"
220 echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
223 # Use this to echo the results of a check
224 echores() {
225 if test "$res_comment" ; then
226 res_comment="($res_comment)"
228 echo "Result is: $@ $res_comment" >> "$TMPLOG"
229 echo "##########################################" >> "$TMPLOG"
230 echo "" >> "$TMPLOG"
231 echo "$@ $res_comment"
232 res_comment=""
234 #############################################################################
236 # Check how echo works in this /bin/sh
237 case $(echo -n) in
238 -n) _echo_n= _echo_c='\c' ;; # SysV echo
239 *) _echo_n='-n ' _echo_c= ;; # BSD echo
240 esac
242 msg_lang_all=''
243 ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
244 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")
245 doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
247 show_help(){
248 cat << EOF
249 Usage: $0 [OPTIONS]...
251 Configuration:
252 -h, --help display this help and exit
254 Installation directories:
255 --prefix=DIR prefix directory for installation [/usr/local]
256 --bindir=DIR directory for installing binaries [PREFIX/bin]
257 --datadir=DIR directory for installing machine independent
258 data files (skins, etc) [PREFIX/share/mplayer]
259 --mandir=DIR directory for installing man pages [PREFIX/share/man]
260 --confdir=DIR directory for installing configuration files
261 [PREFIX/etc/mplayer]
262 --localedir=DIR directory for locale tree [PREFIX/share/locale]
263 --libdir=DIR directory for object code libraries [PREFIX/lib]
264 --codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
266 Optional features:
267 --disable-mplayer disable MPlayer compilation [enable]
268 --disable-largefiles disable support for files > 2GB [enable]
269 --enable-termcap use termcap database for key codes [autodetect]
270 --enable-termios use termios database for key codes [autodetect]
271 --disable-iconv disable iconv for encoding conversion [autodetect]
272 --disable-langinfo do not use langinfo [autodetect]
273 --enable-lirc enable LIRC (remote control) support [autodetect]
274 --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
275 --enable-joystick enable joystick support [disable]
276 --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
277 --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
278 --disable-vm disable X video mode extensions [autodetect]
279 --disable-xf86keysym disable support for multimedia keys [autodetect]
280 --enable-radio enable radio interface [disable]
281 --enable-radio-capture enable radio capture (through PCI/line-in) [disable]
282 --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect]
283 --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
284 --disable-tv disable TV interface (TV/DVB grabbers) [enable]
285 --disable-tv-v4l1 disable Video4Linux TV interface [autodetect]
286 --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
287 --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
288 --disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
289 --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect]
290 --disable-networking disable networking [enable]
291 --enable-winsock2_h enable winsock2_h [autodetect]
292 --enable-smb enable Samba (SMB) input [autodetect]
293 --enable-live enable LIVE555 Streaming Media [autodetect]
294 --enable-nemesi enable Nemesi Streaming Media [autodetect]
295 --disable-vcd disable VCD support [autodetect]
296 --disable-bluray disable Blu-ray support [autodetect]
297 --disable-dvdnav disable libdvdnav [autodetect]
298 --disable-dvdread disable libdvdread [autodetect]
299 --disable-dvdread-internal disable internal libdvdread [autodetect]
300 --disable-libdvdcss-internal disable internal libdvdcss [autodetect]
301 --disable-cdparanoia disable cdparanoia [autodetect]
302 --disable-cddb disable cddb [autodetect]
303 --disable-bitmap-font disable bitmap font support [enable]
304 --disable-freetype disable FreeType 2 font rendering [autodetect]
305 --disable-fontconfig disable fontconfig font lookup [autodetect]
306 --disable-unrarexec disable using of UnRAR executable [enabled]
307 --enable-menu enable OSD menu (not DVD menu) [disabled]
308 --disable-sortsub disable subtitle sorting [enabled]
309 --enable-fribidi enable the FriBiDi libs [autodetect]
310 --disable-enca disable ENCA charset oracle library [autodetect]
311 --disable-maemo disable maemo specific features [autodetect]
312 --enable-macosx-finder enable Mac OS X Finder invocation parameter
313 parsing [disabled]
314 --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect]
315 --disable-inet6 disable IPv6 support [autodetect]
316 --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect]
317 --disable-ftp disable FTP support [enabled]
318 --disable-vstream disable TiVo vstream client support [autodetect]
319 --disable-pthreads disable Posix threads support [autodetect]
320 --disable-w32threads disable Win32 threads support [autodetect]
321 --disable-ass disable internal SSA/ASS subtitle support [autodetect]
322 --enable-rpath enable runtime linker path for extra libs [disabled]
324 Codecs:
325 --enable-gif enable GIF support [autodetect]
326 --enable-png enable PNG input/output support [autodetect]
327 --enable-mng enable MNG input support [autodetect]
328 --enable-jpeg enable JPEG input/output support [autodetect]
329 --enable-libcdio enable libcdio support [autodetect]
330 --enable-liblzo enable liblzo support [autodetect]
331 --disable-win32dll disable Win32 DLL support [autodetect]
332 --disable-qtx disable QuickTime codecs support [enabled]
333 --disable-xanim disable XAnim codecs support [enabled]
334 --disable-real disable RealPlayer codecs support [enabled]
335 --disable-xvid disable Xvid [autodetect]
336 --disable-x264 disable x264 [autodetect]
337 --disable-libnut disable libnut [autodetect]
338 --disable-ffmpeg_a disable static FFmpeg [autodetect]
339 --disable-ffmpeg_so disable shared FFmpeg [autodetect]
340 --disable-tremor-internal disable internal Tremor [enabled]
341 --enable-tremor-low enable lower accuracy internal Tremor [disabled]
342 --enable-tremor enable external Tremor [autodetect]
343 --disable-libvorbis disable libvorbis support [autodetect]
344 --disable-speex disable Speex support [autodetect]
345 --enable-theora enable OggTheora libraries [autodetect]
346 --enable-faad enable external FAAD2 (AAC) [autodetect]
347 --disable-faad-internal disable internal FAAD2 (AAC) [autodetect]
348 --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled]
349 --disable-faac disable support for FAAC (AAC encoder) [autodetect]
350 --disable-ladspa disable LADSPA plugin support [autodetect]
351 --disable-libbs2b disable libbs2b audio filter support [autodetect]
352 --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
353 --disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
354 --disable-mad disable libmad (MPEG audio) support [autodetect]
355 --disable-mp3lame disable LAME MP3 encoding support [autodetect]
356 --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect]
357 --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect]
358 --enable-xmms enable XMMS input plugin support [disabled]
359 --enable-libdca enable libdca support [autodetect]
360 --disable-mp3lib disable builtin mp3lib [autodetect]
361 --disable-liba52 disable liba52 [autodetect]
362 --disable-libmpeg2 disable builtin libmpeg2 [autodetect]
363 --disable-musepack disable musepack support [autodetect]
365 Video output:
366 --disable-vidix disable VIDIX [for x86 *nix]
367 --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in
368 Available: cyberblade,ivtv,mach64,mga,mga_crtc2,
369 nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome
370 --disable-vidix-pcidb disable VIDIX PCI device name database
371 --enable-dhahelper enable VIDIX dhahelper support
372 --enable-svgalib_helper enable VIDIX svgalib_helper support
373 --enable-gl enable OpenGL video output [autodetect]
374 --disable-matrixview disable OpenGL MatrixView video output [autodetect]
375 --enable-dga2 enable DGA 2 support [autodetect]
376 --enable-dga1 enable DGA 1 support [autodetect]
377 --enable-vesa enable VESA video output [autodetect]
378 --enable-svga enable SVGAlib video output [autodetect]
379 --enable-sdl enable SDL video output [autodetect]
380 --enable-kva enable KVA video output [autodetect]
381 --enable-aa enable AAlib video output [autodetect]
382 --enable-caca enable CACA video output [autodetect]
383 --enable-ggi enable GGI video output [autodetect]
384 --enable-ggiwmh enable GGI libggiwmh extension [autodetect]
385 --enable-direct3d enable Direct3D video output [autodetect]
386 --enable-directx enable DirectX video output [autodetect]
387 --enable-dxr2 enable DXR2 video output [autodetect]
388 --enable-dxr3 enable DXR3/H+ video output [autodetect]
389 --enable-ivtv enable IVTV TV-Out video output [autodetect]
390 --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect]
391 --enable-dvb enable DVB video output [autodetect]
392 --enable-mga enable mga_vid video output [autodetect]
393 --enable-xmga enable mga_vid X11 video output [autodetect]
394 --enable-xv enable Xv video output [autodetect]
395 --enable-xvmc enable XvMC acceleration [disable]
396 --enable-vdpau enable VDPAU acceleration [autodetect]
397 --enable-vm enable XF86VidMode support [autodetect]
398 --enable-xinerama enable Xinerama support [autodetect]
399 --enable-x11 enable X11 video output [autodetect]
400 --enable-xshape enable XShape support [autodetect]
401 --disable-xss disable screensaver support via xss [autodetect]
402 --enable-fbdev enable FBDev video output [autodetect]
403 --enable-mlib enable mediaLib video output (Solaris) [disable]
404 --enable-3dfx enable obsolete /dev/3dfx video output [disable]
405 --enable-tdfxfb enable tdfxfb video output [disable]
406 --enable-s3fb enable s3fb (S3 ViRGE) video output [disable]
407 --enable-wii enable Nintendo Wii/GameCube video output [disable]
408 --enable-directfb enable DirectFB video output [autodetect]
409 --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect]
410 --enable-bl enable Blinkenlights video output [disable]
411 --enable-tdfxvid enable tdfx_vid video output [disable]
412 --enable-xvr100 enable SUN XVR-100 video output [autodetect]
413 --disable-tga disable Targa video output [enable]
414 --disable-pnm disable PNM video output [enable]
415 --disable-md5sum disable md5sum video output [enable]
416 --disable-yuv4mpeg disable yuv4mpeg video output [enable]
417 --disable-corevideo disable CoreVideo video output [autodetect]
418 --disable-quartz disable Quartz video output [autodetect]
420 Audio output:
421 --disable-alsa disable ALSA audio output [autodetect]
422 --disable-ossaudio disable OSS audio output [autodetect]
423 --disable-arts disable aRts audio output [autodetect]
424 --disable-esd disable esd audio output [autodetect]
425 --disable-pulse disable Pulseaudio audio output [autodetect]
426 --disable-jack disable JACK audio output [autodetect]
427 --enable-openal enable OpenAL audio output [disable]
428 --disable-nas disable NAS audio output [autodetect]
429 --disable-sgiaudio disable SGI audio output [autodetect]
430 --disable-sunaudio disable Sun audio output [autodetect]
431 --disable-kai disable KAI audio output [autodetect]
432 --disable-dart disable DART audio output [autodetect]
433 --disable-win32waveout disable Windows waveout audio output [autodetect]
434 --disable-coreaudio disable CoreAudio audio output [autodetect]
435 --disable-select disable using select() on the audio device [enable]
437 Language options:
438 --enable-translation enable support for translated output [disable]
439 --charset=charset convert the console messages to this character set
440 --language-doc=lang language to use for the documentation [en]
441 --language-man=lang language to use for the man pages [en]
442 --language-msg=lang extra languages for program messages [all]
443 --language=lang default language to use [en]
444 Specific options override --language. You can pass a list of languages separated
445 by whitespace or commas instead of a single language. Nonexisting translations
446 will be dropped from each list. All translations available in the list will be
447 installed. The value "all" will activate all translations. The LINGUAS
448 environment variable is honored. In all cases the fallback is English.
449 The program always supports English-language output; additional message
450 languages are only installed if --enable-translation is also specified.
451 Available values for --language-doc are: all $doc_lang_all
452 Available values for --language-man are: all $man_lang_all
453 Available values for --language-msg are: all $msg_lang_all
455 Miscellaneous options:
456 --enable-runtime-cpudetection enable runtime CPU detection [disable]
457 --enable-cross-compile enable cross-compilation [autodetect]
458 --cc=COMPILER C compiler to build MPlayer [gcc]
459 --host-cc=COMPILER C compiler for tools needed while building [gcc]
460 --as=ASSEMBLER assembler to build MPlayer [as]
461 --nm=NM nm tool to build MPlayer [nm]
462 --yasm=YASM Yasm assembler to build MPlayer [yasm]
463 --ar=AR librarian to build MPlayer [ar]
464 --ranlib=RANLIB ranlib to build MPlayer [ranlib]
465 --windres=WINDRES windres to build MPlayer [windres]
466 --target=PLATFORM target platform (i386-linux, arm-linux, etc)
467 --enable-static build a statically linked binary
468 --with-install=PATH path to a custom install program
470 Advanced options:
471 --enable-mmx enable MMX [autodetect]
472 --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect]
473 --enable-3dnow enable 3DNow! [autodetect]
474 --enable-3dnowext enable extended 3DNow! [autodetect]
475 --enable-sse enable SSE [autodetect]
476 --enable-sse2 enable SSE2 [autodetect]
477 --enable-ssse3 enable SSSE3 [autodetect]
478 --enable-shm enable shm [autodetect]
479 --enable-altivec enable AltiVec (PowerPC) [autodetect]
480 --enable-armv5te enable DSP extensions (ARM) [autodetect]
481 --enable-armv6 enable ARMv6 (ARM) [autodetect]
482 --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect]
483 --enable-armvfp enable ARM VFP (ARM) [autodetect]
484 --enable-neon enable NEON (ARM) [autodetect]
485 --enable-iwmmxt enable iWMMXt (ARM) [autodetect]
486 --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
487 --enable-big-endian force byte order to big-endian [autodetect]
488 --enable-debug[=1-3] compile-in debugging information [disable]
489 --enable-profile compile-in profiling information [disable]
490 --disable-sighandler disable sighandler for crashes [enable]
491 --enable-crash-debug enable automatic gdb attach on crash [disable]
492 --enable-dynamic-plugins enable dynamic A/V plugins [disable]
493 --ffmpeg-source-dir=PATH enable features requiring internal FFmpeg headers
495 Use these options if autodetection fails:
496 --extra-cflags=FLAGS extra CFLAGS
497 --extra-ldflags=FLAGS extra LDFLAGS
498 --extra-libs=FLAGS extra linker flags
499 --extra-libs-mplayer=FLAGS extra linker flags for MPlayer
500 --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
502 --with-freetype-config=PATH path to freetype-config
503 --with-glib-config=PATH path to glib*-config
504 --with-gtk-config=PATH path to gtk*-config
505 --with-sdl-config=PATH path to sdl*-config
506 --with-dvdnav-config=PATH path to dvdnav-config
507 --with-dvdread-config=PATH path to dvdread-config
509 This configure script is NOT autoconf-based, even though its output is similar.
510 It will try to autodetect all configuration options. If you --enable an option
511 it will be forcefully turned on, skipping autodetection. This can break
512 compilation, so you need to know what you are doing.
514 exit 0
515 } #show_help()
517 # GOTCHA: the variables below defines the default behavior for autodetection
518 # and have - unless stated otherwise - at least 2 states : yes no
519 # If autodetection is available then the third state is: auto
520 _mmx=auto
521 _3dnow=auto
522 _3dnowext=auto
523 _mmxext=auto
524 _sse=auto
525 _sse2=auto
526 _ssse3=auto
527 _cmov=auto
528 _fast_cmov=auto
529 _fast_clz=auto
530 _armv5te=auto
531 _armv6=auto
532 _armv6t2=auto
533 _armvfp=auto
534 neon=auto
535 _iwmmxt=auto
536 _mtrr=auto
537 _altivec=auto
538 _install=install
539 _ranlib=ranlib
540 _windres=windres
541 _cc=cc
542 _ar=ar
543 test "$CC" && _cc="$CC"
544 _as=auto
545 _nm=auto
546 _yasm=yasm
547 _runtime_cpudetection=no
548 _cross_compile=auto
549 _prefix="/usr/local"
550 ffmpeg=auto
551 ffmpeg_internals=no
552 _mencoder=no
553 _mplayer=yes
554 _x11=auto
555 _xshape=auto
556 _xss=auto
557 _dga1=auto
558 _dga2=auto
559 _xv=auto
560 _xvmc=no #auto when complete
561 _vdpau=auto
562 _sdl=auto
563 _kva=auto
564 _direct3d=auto
565 _directx=auto
566 _win32waveout=auto
567 _nas=auto
568 _png=auto
569 _mng=auto
570 _jpeg=auto
571 _pnm=yes
572 _md5sum=yes
573 _yuv4mpeg=yes
574 _gif=auto
575 _gl=auto
576 matrixview=yes
577 _ggi=auto
578 _ggiwmh=auto
579 _aa=auto
580 _caca=auto
581 _svga=auto
582 _vesa=auto
583 _fbdev=auto
584 _dvb=auto
585 _dxr2=auto
586 _dxr3=auto
587 _ivtv=auto
588 _v4l2=auto
589 _iconv=auto
590 _langinfo=auto
591 _rtc=auto
592 _ossaudio=auto
593 _arts=auto
594 _esd=auto
595 _pulse=auto
596 _jack=auto
597 _kai=auto
598 _dart=auto
599 _openal=no
600 _libcdio=auto
601 _liblzo=auto
602 _mad=auto
603 _mp3lame=auto
604 _toolame=auto
605 _twolame=auto
606 _tremor=auto
607 _tremor_internal=yes
608 _tremor_low=no
609 _libvorbis=auto
610 _speex=auto
611 _theora=auto
612 _mpg123=auto
613 _mp3lib=auto
614 _liba52=auto
615 _libdca=auto
616 _libmpeg2=auto
617 _faad=auto
618 _faad_internal=auto
619 _faad_fixed=no
620 _faac=auto
621 _ladspa=auto
622 _libbs2b=auto
623 _xmms=no
624 _vcd=auto
625 _bluray=auto
626 _dvdnav=auto
627 _dvdnavconfig=dvdnav-config
628 _dvdreadconfig=dvdread-config
629 _dvdread=auto
630 _dvdread_internal=auto
631 _libdvdcss_internal=auto
632 _xanim=auto
633 _real=auto
634 _live=auto
635 _nemesi=auto
636 _native_rtsp=yes
637 _xinerama=auto
638 _mga=auto
639 _xmga=auto
640 _vm=auto
641 _xf86keysym=auto
642 _mlib=no #broken, thus disabled
643 _sgiaudio=auto
644 _sunaudio=auto
645 _alsa=auto
646 _fastmemcpy=yes
647 _unrar_exec=auto
648 _win32dll=auto
649 _select=yes
650 _radio=no
651 _radio_capture=no
652 _radio_v4l=auto
653 _radio_v4l2=auto
654 _radio_bsdbt848=auto
655 _tv=yes
656 _tv_v4l1=auto
657 _tv_v4l2=auto
658 _tv_bsdbt848=auto
659 _tv_dshow=auto
660 _pvr=auto
661 networking=yes
662 _winsock2_h=auto
663 _smb=auto
664 _vidix=auto
665 _vidix_pcidb=yes
666 _dhahelper=no
667 _svgalib_helper=no
668 _joystick=no
669 _xvid=auto
670 _x264=auto
671 _libnut=auto
672 _lirc=auto
673 _lircc=auto
674 _apple_remote=auto
675 _apple_ir=auto
676 _gui=no
677 _gtk1=no
678 _termcap=auto
679 _termios=auto
680 _3dfx=no
681 _s3fb=no
682 _wii=no
683 _tdfxfb=no
684 _tdfxvid=no
685 _xvr100=auto
686 _tga=yes
687 _directfb=auto
688 _zr=auto
689 _bl=no
690 _largefiles=yes
691 #language=en
692 _shm=auto
693 _translation=no
694 _charset="UTF-8"
695 _dynamic_plugins=no
696 _crash_debug=no
697 _sighandler=yes
698 _libdv=auto
699 _cdparanoia=auto
700 _cddb=auto
701 _big_endian=auto
702 _bitmap_font=yes
703 _freetype=auto
704 _fontconfig=auto
705 _menu=no
706 _qtx=auto
707 _maemo=auto
708 _coreaudio=auto
709 _corevideo=auto
710 _quartz=auto
711 quicktime=auto
712 _macosx_finder=no
713 _macosx_bundle=auto
714 _sortsub=yes
715 _freetypeconfig='freetype-config'
716 _fribidi=auto
717 _enca=auto
718 _inet6=auto
719 _gethostbyname2=auto
720 _ftp=yes
721 _musepack=auto
722 _vstream=auto
723 _pthreads=auto
724 _w32threads=auto
725 _ass=auto
726 _rpath=no
727 _asmalign_pot=auto
728 _stream_cache=yes
729 _priority=no
730 def_dos_paths="#define HAVE_DOS_PATHS 0"
731 def_stream_cache="#define CONFIG_STREAM_CACHE 1"
732 def_priority="#undef CONFIG_PRIORITY"
733 def_pthread_cache="#undef PTHREAD_CACHE"
734 _need_shmem=yes
735 for ac_option do
736 case "$ac_option" in
737 --help|-help|-h)
738 show_help
740 --prefix=*)
741 _prefix=$(echo $ac_option | cut -d '=' -f 2)
743 --bindir=*)
744 _bindir=$(echo $ac_option | cut -d '=' -f 2)
746 --datadir=*)
747 _datadir=$(echo $ac_option | cut -d '=' -f 2)
749 --mandir=*)
750 _mandir=$(echo $ac_option | cut -d '=' -f 2)
752 --confdir=*)
753 _confdir=$(echo $ac_option | cut -d '=' -f 2)
755 --libdir=*)
756 _libdir=$(echo $ac_option | cut -d '=' -f 2)
758 --codecsdir=*)
759 _codecsdir=$(echo $ac_option | cut -d '=' -f 2)
761 --localedir=*)
762 _localedir=$(echo $ac_option | cut -d '=' -f 2)
765 --with-install=*)
766 _install=$(echo $ac_option | cut -d '=' -f 2 )
768 --with-xvmclib=*)
769 _xvmclib=$(echo $ac_option | cut -d '=' -f 2)
772 --with-sdl-config=*)
773 _sdlconfig=$(echo $ac_option | cut -d '=' -f 2)
775 --with-freetype-config=*)
776 _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2)
778 --with-gtk-config=*)
779 _gtkconfig=$(echo $ac_option | cut -d '=' -f 2)
781 --with-glib-config=*)
782 _glibconfig=$(echo $ac_option | cut -d '=' -f 2)
784 --with-dvdnav-config=*)
785 _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2)
787 --with-dvdread-config=*)
788 _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2)
791 --extra-cflags=*)
792 extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
794 --extra-ldflags=*)
795 extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
797 --extra-libs=*)
798 extra_libs=$(echo $ac_option | cut -d '=' -f 2)
800 --extra-libs-mplayer=*)
801 libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
804 --target=*)
805 _target=$(echo $ac_option | cut -d '=' -f 2)
807 --cc=*)
808 _cc=$(echo $ac_option | cut -d '=' -f 2)
810 --host-cc=*)
811 _host_cc=$(echo $ac_option | cut -d '=' -f 2)
813 --as=*)
814 _as=$(echo $ac_option | cut -d '=' -f 2)
816 --nm=*)
817 _nm=$(echo $ac_option | cut -d '=' -f 2)
819 --yasm=*)
820 _yasm=$(echo $ac_option | cut -d '=' -f 2)
822 --ar=*)
823 _ar=$(echo $ac_option | cut -d '=' -f 2)
825 --ranlib=*)
826 _ranlib=$(echo $ac_option | cut -d '=' -f 2)
828 --windres=*)
829 _windres=$(echo $ac_option | cut -d '=' -f 2)
831 --charset=*)
832 _charset=$(echo $ac_option | cut -d '=' -f 2)
834 --language-doc=*)
835 language_doc=$(echo $ac_option | cut -d '=' -f 2)
837 --language-man=*)
838 language_man=$(echo $ac_option | cut -d '=' -f 2)
840 --language-msg=*)
841 language_msg=$(echo $ac_option | cut -d '=' -f 2)
843 --language=*)
844 language=$(echo $ac_option | cut -d '=' -f 2)
847 --enable-static)
848 _ld_static='-static'
850 --disable-static)
851 _ld_static=''
853 --enable-profile)
854 _profile='-p'
856 --disable-profile)
857 _profile=
859 --enable-debug)
860 _debug='-g'
862 --enable-debug=*)
863 _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
865 --disable-debug)
866 _debug=
868 --enable-translation) _translation=yes ;;
869 --disable-translation) _translation=no ;;
870 --enable-runtime-cpudetection) _runtime_cpudetection=yes ;;
871 --disable-runtime-cpudetection) _runtime_cpudetection=no ;;
872 --enable-cross-compile) _cross_compile=yes ;;
873 --disable-cross-compile) _cross_compile=no ;;
874 --enable-mplayer) _mplayer=yes ;;
875 --disable-mplayer) _mplayer=no ;;
876 --enable-dynamic-plugins) _dynamic_plugins=yes ;;
877 --disable-dynamic-plugins) _dynamic_plugins=no ;;
878 --enable-x11) _x11=yes ;;
879 --disable-x11) _x11=no ;;
880 --enable-xshape) _xshape=yes ;;
881 --disable-xshape) _xshape=no ;;
882 --enable-xss) _xss=yes ;;
883 --disable-xss) _xss=no ;;
884 --enable-xv) _xv=yes ;;
885 --disable-xv) _xv=no ;;
886 --enable-xvmc) _xvmc=yes ;;
887 --disable-xvmc) _xvmc=no ;;
888 --enable-vdpau) _vdpau=yes ;;
889 --disable-vdpau) _vdpau=no ;;
890 --enable-sdl) _sdl=yes ;;
891 --disable-sdl) _sdl=no ;;
892 --enable-kva) _kva=yes ;;
893 --disable-kva) _kva=no ;;
894 --enable-direct3d) _direct3d=yes ;;
895 --disable-direct3d) _direct3d=no ;;
896 --enable-directx) _directx=yes ;;
897 --disable-directx) _directx=no ;;
898 --enable-win32waveout) _win32waveout=yes ;;
899 --disable-win32waveout) _win32waveout=no ;;
900 --enable-nas) _nas=yes ;;
901 --disable-nas) _nas=no ;;
902 --enable-png) _png=yes ;;
903 --disable-png) _png=no ;;
904 --enable-mng) _mng=yes ;;
905 --disable-mng) _mng=no ;;
906 --enable-jpeg) _jpeg=yes ;;
907 --disable-jpeg) _jpeg=no ;;
908 --enable-pnm) _pnm=yes ;;
909 --disable-pnm) _pnm=no ;;
910 --enable-md5sum) _md5sum=yes ;;
911 --disable-md5sum) _md5sum=no ;;
912 --enable-yuv4mpeg) _yuv4mpeg=yes ;;
913 --disable-yuv4mpeg) _yuv4mpeg=no ;;
914 --enable-gif) _gif=yes ;;
915 --disable-gif) _gif=no ;;
916 --enable-gl) _gl=yes ;;
917 --disable-gl) _gl=no ;;
918 --enable-matrixview) matrixview=yes ;;
919 --disable-matrixview) matrixview=no ;;
920 --enable-ggi) _ggi=yes ;;
921 --disable-ggi) _ggi=no ;;
922 --enable-ggiwmh) _ggiwmh=yes ;;
923 --disable-ggiwmh) _ggiwmh=no ;;
924 --enable-aa) _aa=yes ;;
925 --disable-aa) _aa=no ;;
926 --enable-caca) _caca=yes ;;
927 --disable-caca) _caca=no ;;
928 --enable-svga) _svga=yes ;;
929 --disable-svga) _svga=no ;;
930 --enable-vesa) _vesa=yes ;;
931 --disable-vesa) _vesa=no ;;
932 --enable-fbdev) _fbdev=yes ;;
933 --disable-fbdev) _fbdev=no ;;
934 --enable-dvb) _dvb=yes ;;
935 --disable-dvb) _dvb=no ;;
936 --enable-dxr2) _dxr2=yes ;;
937 --disable-dxr2) _dxr2=no ;;
938 --enable-dxr3) _dxr3=yes ;;
939 --disable-dxr3) _dxr3=no ;;
940 --enable-ivtv) _ivtv=yes ;;
941 --disable-ivtv) _ivtv=no ;;
942 --enable-v4l2) _v4l2=yes ;;
943 --disable-v4l2) _v4l2=no ;;
944 --enable-iconv) _iconv=yes ;;
945 --disable-iconv) _iconv=no ;;
946 --enable-langinfo) _langinfo=yes ;;
947 --disable-langinfo) _langinfo=no ;;
948 --enable-rtc) _rtc=yes ;;
949 --disable-rtc) _rtc=no ;;
950 --enable-libdv) _libdv=yes ;;
951 --disable-libdv) _libdv=no ;;
952 --enable-ossaudio) _ossaudio=yes ;;
953 --disable-ossaudio) _ossaudio=no ;;
954 --enable-arts) _arts=yes ;;
955 --disable-arts) _arts=no ;;
956 --enable-esd) _esd=yes ;;
957 --disable-esd) _esd=no ;;
958 --enable-pulse) _pulse=yes ;;
959 --disable-pulse) _pulse=no ;;
960 --enable-jack) _jack=yes ;;
961 --disable-jack) _jack=no ;;
962 --enable-openal) _openal=yes ;;
963 --disable-openal) _openal=no ;;
964 --enable-kai) _kai=yes ;;
965 --disable-kai) _kai=no ;;
966 --enable-dart) _dart=yes ;;
967 --disable-dart) _dart=no ;;
968 --enable-mad) _mad=yes ;;
969 --disable-mad) _mad=no ;;
970 --enable-mp3lame) _mp3lame=yes ;;
971 --disable-mp3lame) _mp3lame=no ;;
972 --enable-toolame) _toolame=yes ;;
973 --disable-toolame) _toolame=no ;;
974 --enable-twolame) _twolame=yes ;;
975 --disable-twolame) _twolame=no ;;
976 --enable-libcdio) _libcdio=yes ;;
977 --disable-libcdio) _libcdio=no ;;
978 --enable-liblzo) _liblzo=yes ;;
979 --disable-liblzo) _liblzo=no ;;
980 --enable-libvorbis) _libvorbis=yes ;;
981 --disable-libvorbis) _libvorbis=no ;;
982 --enable-speex) _speex=yes ;;
983 --disable-speex) _speex=no ;;
984 --enable-tremor) _tremor=yes ;;
985 --disable-tremor) _tremor=no ;;
986 --enable-tremor-internal) _tremor_internal=yes ;;
987 --disable-tremor-internal) _tremor_internal=no ;;
988 --enable-tremor-low) _tremor_low=yes ;;
989 --disable-tremor-low) _tremor_low=no ;;
990 --enable-theora) _theora=yes ;;
991 --disable-theora) _theora=no ;;
992 --enable-mpg123) _mpg123=yes ;;
993 --disable-mpg123) _mpg123=no ;;
994 --enable-mp3lib) _mp3lib=yes ;;
995 --disable-mp3lib) _mp3lib=no ;;
996 --enable-liba52) _liba52=yes ;;
997 --disable-liba52) _liba52=no ;;
998 --enable-libdca) _libdca=yes ;;
999 --disable-libdca) _libdca=no ;;
1000 --enable-libmpeg2) _libmpeg2=yes ;;
1001 --disable-libmpeg2) _libmpeg2=no ;;
1002 --enable-musepack) _musepack=yes ;;
1003 --disable-musepack) _musepack=no ;;
1004 --enable-faad) _faad=yes ;;
1005 --disable-faad) _faad=no ;;
1006 --enable-faad-internal) _faad_internal=yes ;;
1007 --disable-faad-internal) _faad_internal=no ;;
1008 --enable-faad-fixed) _faad_fixed=yes ;;
1009 --disable-faad-fixed) _faad_fixed=no ;;
1010 --enable-faac) _faac=yes ;;
1011 --disable-faac) _faac=no ;;
1012 --enable-ladspa) _ladspa=yes ;;
1013 --disable-ladspa) _ladspa=no ;;
1014 --enable-libbs2b) _libbs2b=yes ;;
1015 --disable-libbs2b) _libbs2b=no ;;
1016 --enable-xmms) _xmms=yes ;;
1017 --disable-xmms) _xmms=no ;;
1018 --enable-vcd) _vcd=yes ;;
1019 --disable-vcd) _vcd=no ;;
1020 --enable-bluray) _bluray=yes ;;
1021 --disable-bluray) _bluray=no ;;
1022 --enable-dvdread) _dvdread=yes ;;
1023 --disable-dvdread) _dvdread=no ;;
1024 --enable-dvdread-internal) _dvdread_internal=yes ;;
1025 --disable-dvdread-internal) _dvdread_internal=no ;;
1026 --enable-libdvdcss-internal) _libdvdcss_internal=yes ;;
1027 --disable-libdvdcss-internal) _libdvdcss_internal=no ;;
1028 --enable-dvdnav) _dvdnav=yes ;;
1029 --disable-dvdnav) _dvdnav=no ;;
1030 --enable-xanim) _xanim=yes ;;
1031 --disable-xanim) _xanim=no ;;
1032 --enable-real) _real=yes ;;
1033 --disable-real) _real=no ;;
1034 --enable-live) _live=yes ;;
1035 --disable-live) _live=no ;;
1036 --enable-nemesi) _nemesi=yes ;;
1037 --disable-nemesi) _nemesi=no ;;
1038 --enable-xinerama) _xinerama=yes ;;
1039 --disable-xinerama) _xinerama=no ;;
1040 --enable-mga) _mga=yes ;;
1041 --disable-mga) _mga=no ;;
1042 --enable-xmga) _xmga=yes ;;
1043 --disable-xmga) _xmga=no ;;
1044 --enable-vm) _vm=yes ;;
1045 --disable-vm) _vm=no ;;
1046 --enable-xf86keysym) _xf86keysym=yes ;;
1047 --disable-xf86keysym) _xf86keysym=no ;;
1048 --enable-mlib) _mlib=yes ;;
1049 --disable-mlib) _mlib=no ;;
1050 --enable-sunaudio) _sunaudio=yes ;;
1051 --disable-sunaudio) _sunaudio=no ;;
1052 --enable-sgiaudio) _sgiaudio=yes ;;
1053 --disable-sgiaudio) _sgiaudio=no ;;
1054 --enable-alsa) _alsa=yes ;;
1055 --disable-alsa) _alsa=no ;;
1056 --enable-tv) _tv=yes ;;
1057 --disable-tv) _tv=no ;;
1058 --enable-tv-bsdbt848) _tv_bsdbt848=yes ;;
1059 --disable-tv-bsdbt848) _tv_bsdbt848=no ;;
1060 --enable-tv-v4l1) _tv_v4l1=yes ;;
1061 --disable-tv-v4l1) _tv_v4l1=no ;;
1062 --enable-tv-v4l2) _tv_v4l2=yes ;;
1063 --disable-tv-v4l2) _tv_v4l2=no ;;
1064 --enable-tv-dshow) _tv_dshow=yes ;;
1065 --disable-tv-dshow) _tv_dshow=no ;;
1066 --enable-radio) _radio=yes ;;
1067 --enable-radio-capture) _radio_capture=yes ;;
1068 --disable-radio-capture) _radio_capture=no ;;
1069 --disable-radio) _radio=no ;;
1070 --enable-radio-v4l) _radio_v4l=yes ;;
1071 --disable-radio-v4l) _radio_v4l=no ;;
1072 --enable-radio-v4l2) _radio_v4l2=yes ;;
1073 --disable-radio-v4l2) _radio_v4l2=no ;;
1074 --enable-radio-bsdbt848) _radio_bsdbt848=yes ;;
1075 --disable-radio-bsdbt848) _radio_bsdbt848=no ;;
1076 --enable-pvr) _pvr=yes ;;
1077 --disable-pvr) _pvr=no ;;
1078 --enable-fastmemcpy) _fastmemcpy=yes ;;
1079 --disable-fastmemcpy) _fastmemcpy=no ;;
1080 --enable-networking) networking=yes ;;
1081 --disable-networking) networking=no ;;
1082 --enable-winsock2_h) _winsock2_h=yes ;;
1083 --disable-winsock2_h) _winsock2_h=no ;;
1084 --enable-smb) _smb=yes ;;
1085 --disable-smb) _smb=no ;;
1086 --enable-vidix) _vidix=yes ;;
1087 --disable-vidix) _vidix=no ;;
1088 --with-vidix-drivers=*)
1089 _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2)
1091 --disable-vidix-pcidb) _vidix_pcidb=no ;;
1092 --enable-dhahelper) _dhahelper=yes ;;
1093 --disable-dhahelper) _dhahelper=no ;;
1094 --enable-svgalib_helper) _svgalib_helper=yes ;;
1095 --disable-svgalib_helper) _svgalib_helper=no ;;
1096 --enable-joystick) _joystick=yes ;;
1097 --disable-joystick) _joystick=no ;;
1098 --enable-xvid) _xvid=yes ;;
1099 --disable-xvid) _xvid=no ;;
1100 --enable-x264) _x264=yes ;;
1101 --disable-x264) _x264=no ;;
1102 --enable-libnut) _libnut=yes ;;
1103 --disable-libnut) _libnut=no ;;
1104 --enable-ffmpeg) ffmpeg=yes ;;
1105 --disable-ffmpeg) ffmpeg=no ;;
1106 --ffmpeg-source-dir=*)
1107 _ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
1109 --enable-lirc) _lirc=yes ;;
1110 --disable-lirc) _lirc=no ;;
1111 --enable-lircc) _lircc=yes ;;
1112 --disable-lircc) _lircc=no ;;
1113 --enable-apple-remote) _apple_remote=yes ;;
1114 --disable-apple-remote) _apple_remote=no ;;
1115 --enable-apple-ir) _apple_ir=yes ;;
1116 --disable-apple-ir) _apple_ir=no ;;
1117 --enable-gui) _gui=yes ;;
1118 --disable-gui) _gui=no ;;
1119 --enable-gtk1) _gtk1=yes ;;
1120 --disable-gtk1) _gtk1=no ;;
1121 --enable-termcap) _termcap=yes ;;
1122 --disable-termcap) _termcap=no ;;
1123 --enable-termios) _termios=yes ;;
1124 --disable-termios) _termios=no ;;
1125 --enable-3dfx) _3dfx=yes ;;
1126 --disable-3dfx) _3dfx=no ;;
1127 --enable-s3fb) _s3fb=yes ;;
1128 --disable-s3fb) _s3fb=no ;;
1129 --enable-wii) _wii=yes ;;
1130 --disable-wii) _wii=no ;;
1131 --enable-tdfxfb) _tdfxfb=yes ;;
1132 --disable-tdfxfb) _tdfxfb=no ;;
1133 --disable-tdfxvid) _tdfxvid=no ;;
1134 --enable-tdfxvid) _tdfxvid=yes ;;
1135 --disable-xvr100) _xvr100=no ;;
1136 --enable-xvr100) _xvr100=yes ;;
1137 --disable-tga) _tga=no ;;
1138 --enable-tga) _tga=yes ;;
1139 --enable-directfb) _directfb=yes ;;
1140 --disable-directfb) _directfb=no ;;
1141 --enable-zr) _zr=yes ;;
1142 --disable-zr) _zr=no ;;
1143 --enable-bl) _bl=yes ;;
1144 --disable-bl) _bl=no ;;
1145 --enable-mtrr) _mtrr=yes ;;
1146 --disable-mtrr) _mtrr=no ;;
1147 --enable-largefiles) _largefiles=yes ;;
1148 --disable-largefiles) _largefiles=no ;;
1149 --enable-shm) _shm=yes ;;
1150 --disable-shm) _shm=no ;;
1151 --enable-select) _select=yes ;;
1152 --disable-select) _select=no ;;
1153 --enable-cdparanoia) _cdparanoia=yes ;;
1154 --disable-cdparanoia) _cdparanoia=no ;;
1155 --enable-cddb) _cddb=yes ;;
1156 --disable-cddb) _cddb=no ;;
1157 --enable-big-endian) _big_endian=yes ;;
1158 --disable-big-endian) _big_endian=no ;;
1159 --enable-bitmap-font) _bitmap_font=yes ;;
1160 --disable-bitmap-font) _bitmap_font=no ;;
1161 --enable-freetype) _freetype=yes ;;
1162 --disable-freetype) _freetype=no ;;
1163 --enable-fontconfig) _fontconfig=yes ;;
1164 --disable-fontconfig) _fontconfig=no ;;
1165 --enable-unrarexec) _unrar_exec=yes ;;
1166 --disable-unrarexec) _unrar_exec=no ;;
1167 --enable-ftp) _ftp=yes ;;
1168 --disable-ftp) _ftp=no ;;
1169 --enable-vstream) _vstream=yes ;;
1170 --disable-vstream) _vstream=no ;;
1171 --enable-pthreads) _pthreads=yes ;;
1172 --disable-pthreads) _pthreads=no ;;
1173 --enable-w32threads) _w32threads=yes ;;
1174 --disable-w32threads) _w32threads=no ;;
1175 --enable-ass) _ass=yes ;;
1176 --disable-ass) _ass=no ;;
1177 --enable-rpath) _rpath=yes ;;
1178 --disable-rpath) _rpath=no ;;
1180 --enable-fribidi) _fribidi=yes ;;
1181 --disable-fribidi) _fribidi=no ;;
1183 --enable-enca) _enca=yes ;;
1184 --disable-enca) _enca=no ;;
1186 --enable-inet6) _inet6=yes ;;
1187 --disable-inet6) _inet6=no ;;
1189 --enable-gethostbyname2) _gethostbyname2=yes ;;
1190 --disable-gethostbyname2) _gethostbyname2=no ;;
1192 --enable-dga1) _dga1=yes ;;
1193 --disable-dga1) _dga1=no ;;
1194 --enable-dga2) _dga2=yes ;;
1195 --disable-dga2) _dga2=no ;;
1197 --enable-menu) _menu=yes ;;
1198 --disable-menu) _menu=no ;;
1200 --enable-qtx) _qtx=yes ;;
1201 --disable-qtx) _qtx=no ;;
1203 --enable-coreaudio) _coreaudio=yes ;;
1204 --disable-coreaudio) _coreaudio=no ;;
1205 --enable-corevideo) _corevideo=yes ;;
1206 --disable-corevideo) _corevideo=no ;;
1207 --enable-quartz) _quartz=yes ;;
1208 --disable-quartz) _quartz=no ;;
1209 --enable-macosx-finder) _macosx_finder=yes ;;
1210 --disable-macosx-finder) _macosx_finder=no ;;
1211 --enable-macosx-bundle) _macosx_bundle=yes ;;
1212 --disable-macosx-bundle) _macosx_bundle=no ;;
1214 --enable-maemo) _maemo=yes ;;
1215 --disable-maemo) _maemo=no ;;
1217 --enable-sortsub) _sortsub=yes ;;
1218 --disable-sortsub) _sortsub=no ;;
1220 --enable-crash-debug) _crash_debug=yes ;;
1221 --disable-crash-debug) _crash_debug=no ;;
1222 --enable-sighandler) _sighandler=yes ;;
1223 --disable-sighandler) _sighandler=no ;;
1224 --enable-win32dll) _win32dll=yes ;;
1225 --disable-win32dll) _win32dll=no ;;
1227 --enable-sse) _sse=yes ;;
1228 --disable-sse) _sse=no ;;
1229 --enable-sse2) _sse2=yes ;;
1230 --disable-sse2) _sse2=no ;;
1231 --enable-ssse3) _ssse3=yes ;;
1232 --disable-ssse3) _ssse3=no ;;
1233 --enable-mmxext) _mmxext=yes ;;
1234 --disable-mmxext) _mmxext=no ;;
1235 --enable-3dnow) _3dnow=yes ;;
1236 --disable-3dnow) _3dnow=no _3dnowext=no ;;
1237 --enable-3dnowext) _3dnow=yes _3dnowext=yes ;;
1238 --disable-3dnowext) _3dnowext=no ;;
1239 --enable-cmov) _cmov=yes ;;
1240 --disable-cmov) _cmov=no ;;
1241 --enable-fast-cmov) _fast_cmov=yes ;;
1242 --disable-fast-cmov) _fast_cmov=no ;;
1243 --enable-fast-clz) _fast_clz=yes ;;
1244 --disable-fast-clz) _fast_clz=no ;;
1245 --enable-altivec) _altivec=yes ;;
1246 --disable-altivec) _altivec=no ;;
1247 --enable-armv5te) _armv5te=yes ;;
1248 --disable-armv5te) _armv5te=no ;;
1249 --enable-armv6) _armv6=yes ;;
1250 --disable-armv6) _armv6=no ;;
1251 --enable-armv6t2) _armv6t2=yes ;;
1252 --disable-armv6t2) _armv6t2=no ;;
1253 --enable-armvfp) _armvfp=yes ;;
1254 --disable-armvfp) _armvfp=no ;;
1255 --enable-neon) neon=yes ;;
1256 --disable-neon) neon=no ;;
1257 --enable-iwmmxt) _iwmmxt=yes ;;
1258 --disable-iwmmxt) _iwmmxt=no ;;
1259 --enable-mmx) _mmx=yes ;;
1260 --disable-mmx) # 3Dnow! and MMX2 require MMX
1261 _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;;
1264 echo "Unknown parameter: $ac_option"
1265 exit 1
1268 esac
1269 done
1271 if test "$_gui" = yes ; then
1272 die "Internal GUI was removed from MPlayer. Please use one of many available\n frontends\
1273 (http://www.mplayerhq.hu/design7/projects.html#mplayer_frontends)."
1276 # Atmos: moved this here, to be correct, if --prefix is specified
1277 test -z "$_bindir" && _bindir="$_prefix/bin"
1278 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
1279 test -z "$_mandir" && _mandir="$_prefix/share/man"
1280 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
1281 test -z "$_libdir" && _libdir="$_prefix/lib"
1282 test -z "$_localedir" && _localedir="$_prefix/share/locale"
1284 # Determine our OS name and CPU architecture
1285 if test -z "$_target" ; then
1286 # OS name
1287 system_name=$(uname -s 2>&1)
1288 case "$system_name" in
1289 Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS)
1291 Haiku)
1292 system_name=BeOS
1294 IRIX*)
1295 system_name=IRIX
1297 GNU/kFreeBSD)
1298 system_name=FreeBSD
1300 HP-UX*)
1301 system_name=HP-UX
1303 [cC][yY][gG][wW][iI][nN]*)
1304 system_name=CYGWIN
1306 MINGW32*)
1307 system_name=MINGW32
1309 OS/2*)
1310 system_name=OS/2
1313 system_name="$system_name-UNKNOWN"
1315 esac
1318 # host's CPU/instruction set
1319 host_arch=$(uname -p 2>&1)
1320 case "$host_arch" in
1321 i386|sparc|ppc|alpha|arm|mips|vax)
1323 powerpc) # Darwin returns 'powerpc'
1324 host_arch=ppc
1326 *) # uname -p on Linux returns 'unknown' for the processor type,
1327 # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
1329 # Maybe uname -m (machine hardware name) returns something we
1330 # recognize.
1332 # x86/x86pc is used by QNX
1333 case "$(uname -m 2>&1)" in
1334 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 ;;
1335 ia64) host_arch=ia64 ;;
1336 macppc|ppc) host_arch=ppc ;;
1337 ppc64) host_arch=ppc64 ;;
1338 alpha) host_arch=alpha ;;
1339 sparc) host_arch=sparc ;;
1340 sparc64) host_arch=sparc64 ;;
1341 parisc*|hppa*|9000*) host_arch=hppa ;;
1342 arm*|zaurus|cats) host_arch=arm ;;
1343 sh3|sh4|sh4a) host_arch=sh ;;
1344 s390) host_arch=s390 ;;
1345 s390x) host_arch=s390x ;;
1346 *mips*) host_arch=mips ;;
1347 vax) host_arch=vax ;;
1348 xtensa*) host_arch=xtensa ;;
1349 *) host_arch=UNKNOWN ;;
1350 esac
1352 esac
1353 else # if test -z "$_target"
1354 system_name=$(echo $_target | cut -d '-' -f 2)
1355 case "$(echo $system_name | tr A-Z a-z)" in
1356 linux) system_name=Linux ;;
1357 freebsd) system_name=FreeBSD ;;
1358 gnu/kfreebsd) system_name=FreeBSD ;;
1359 netbsd) system_name=NetBSD ;;
1360 bsd/os) system_name=BSD/OS ;;
1361 openbsd) system_name=OpenBSD ;;
1362 dragonfly) system_name=DragonFly ;;
1363 sunos) system_name=SunOS ;;
1364 qnx) system_name=QNX ;;
1365 morphos) system_name=MorphOS ;;
1366 amigaos) system_name=AmigaOS ;;
1367 mingw32*) system_name=MINGW32 ;;
1368 esac
1369 # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
1370 host_arch=$(echo $_target | cut -d '-' -f 1)
1371 if test $(echo $host_arch) != "x86_64" ; then
1372 host_arch=$(echo $host_arch | tr '_' '-')
1376 extra_cflags="-I. $extra_cflags"
1377 _timer=timer-linux.c
1378 _getch=getch2.c
1379 if freebsd ; then
1380 extra_ldflags="$extra_ldflags -L/usr/local/lib"
1381 extra_cflags="$extra_cflags -I/usr/local/include"
1384 if netbsd || dragonfly ; then
1385 extra_ldflags="$extra_ldflags -L/usr/pkg/lib"
1386 extra_cflags="$extra_cflags -I/usr/pkg/include"
1389 if darwin; then
1390 extra_cflags="-mdynamic-no-pic $extra_cflags"
1391 if test "$(basename $_cc)" != "clang" ; then
1392 extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags"
1394 _timer=timer-darwin.c
1397 if aix ; then
1398 extra_ldflags="$extra_ldflags -lC"
1401 if irix ; then
1402 _ranlib='ar -r'
1403 elif linux ; then
1404 _ranlib='true'
1407 if win32 ; then
1408 _exesuf=".exe"
1409 extra_cflags="$extra_cflags -fno-common"
1410 # -lwinmm is always needed for osdep/timer-win2.c
1411 extra_ldflags="$extra_ldflags -lwinmm"
1412 _pe_executable=yes
1413 _timer=timer-win2.c
1414 _priority=yes
1415 def_dos_paths="#define HAVE_DOS_PATHS 1"
1416 def_priority="#define CONFIG_PRIORITY 1"
1419 if mingw32 ; then
1420 _getch=getch2-win.c
1421 _need_shmem=no
1424 if amigaos ; then
1425 _select=no
1426 _sighandler=no
1427 _stream_cache=no
1428 def_stream_cache="#undef CONFIG_STREAM_CACHE"
1429 extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
1432 if qnx ; then
1433 extra_ldflags="$extra_ldflags -lph"
1436 if os2 ; then
1437 _exesuf=".exe"
1438 _getch=getch2-os2.c
1439 _need_shmem=no
1440 _priority=yes
1441 def_dos_paths="#define HAVE_DOS_PATHS 1"
1442 def_priority="#define CONFIG_PRIORITY 1"
1445 for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
1446 test "$tmpdir" && break
1447 done
1449 mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
1450 mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
1452 TMPLOG="config.log"
1453 TMPC="$mplayer_tmpdir/tmp.c"
1454 TMPCPP="$mplayer_tmpdir/tmp.cpp"
1455 TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
1456 TMPH="$mplayer_tmpdir/tmp.h"
1457 TMPS="$mplayer_tmpdir/tmp.S"
1459 rm -f "$TMPLOG"
1460 echo configuration: $configuration > "$TMPLOG"
1461 echo >> "$TMPLOG"
1464 if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
1465 die "Runtime CPU detection only works for x86, x86-64 and PPC!"
1469 # Checking CC version...
1470 # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
1471 if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
1472 echocheck "$_cc version"
1473 cc_vendor=intel
1474 cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
1475 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
1476 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1477 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1478 # TODO verify older icc/ecc compatibility
1479 case $cc_version in
1481 cc_version="v. ?.??, bad"
1482 cc_fail=yes
1484 10.1|11.0|11.1)
1485 cc_version="$cc_version, ok"
1488 cc_version="$cc_version, bad"
1489 cc_fail=yes
1491 esac
1492 echores "$cc_version"
1493 else
1494 for _cc in "$_cc" gcc cc ; do
1495 cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
1496 if test "$cc_name_tmp" = "gcc"; then
1497 cc_name=$cc_name_tmp
1498 echocheck "$_cc version"
1499 cc_vendor=gnu
1500 cc_version=$($_cc -dumpversion 2>&1)
1501 case $cc_version in
1502 2.96*)
1503 cc_fail=yes
1506 _cc_major=$(echo $cc_version | cut -d '.' -f 1)
1507 _cc_minor=$(echo $cc_version | cut -d '.' -f 2)
1508 _cc_mini=$(echo $cc_version | cut -d '.' -f 3)
1510 esac
1511 echores "$cc_version"
1512 break
1514 cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
1515 if test "$cc_name_tmp" = "clang"; then
1516 echocheck "$_cc version"
1517 cc_vendor=clang
1518 cc_version=$($_cc -dumpversion 2>&1)
1519 res_comment="experimental support only"
1520 echores "clang $cc_version"
1521 break
1523 cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
1524 if test "$cc_name_tmp" = "Sun C"; then
1525 echocheck "$_cc version"
1526 cc_vendor=sun
1527 cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 4)
1528 res_comment="experimental support only"
1529 echores "Sun C $cc_version"
1530 break
1532 done
1533 fi # icc
1534 test "$cc_fail" = yes && die "unsupported compiler version"
1536 if test -z "$_target" && x86 ; then
1537 cat > $TMPC << EOF
1538 int main(void) {
1539 int test[(int)sizeof(char *)-7];
1540 return 0;
1543 cc_check && host_arch=x86_64 || host_arch=i386
1546 echo "Detected operating system: $system_name"
1547 echo "Detected host architecture: $host_arch"
1549 echocheck "host cc"
1550 test "$_host_cc" || _host_cc=$_cc
1551 echores $_host_cc
1553 echocheck "cross compilation"
1554 if test $_cross_compile = auto ; then
1555 _cross_compile=yes
1556 cflag_check "" && "$TMPEXE" && _cross_compile=no
1558 echores $_cross_compile
1560 if test $_cross_compile = yes; then
1561 tmp_run() {
1562 return 0
1566 # ---
1568 # now that we know what compiler should be used for compilation, try to find
1569 # out which assembler is used by the $_cc compiler
1570 if test "$_as" = auto ; then
1571 _as=$($_cc -print-prog-name=as)
1572 test -z "$_as" && _as=as
1575 if test "$_nm" = auto ; then
1576 _nm=$($_cc -print-prog-name=nm)
1577 test -z "$_nm" && _nm=nm
1580 # XXX: this should be ok..
1581 _cpuinfo="echo"
1583 if test "$_runtime_cpudetection" = no ; then
1585 # Cygwin has /proc/cpuinfo, but only supports Intel CPUs
1586 # FIXME: Remove the cygwin check once AMD CPUs are supported
1587 if test -r /proc/cpuinfo && ! cygwin; then
1588 # Linux with /proc mounted, extract CPU information from it
1589 _cpuinfo="cat /proc/cpuinfo"
1590 elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then
1591 # FreeBSD with Linux emulation /proc mounted,
1592 # extract CPU information from it
1593 # Don't use it on x86 though, it never reports 3Dnow
1594 _cpuinfo="cat /compat/linux/proc/cpuinfo"
1595 elif darwin && ! x86 ; then
1596 # use hostinfo on Darwin
1597 _cpuinfo="hostinfo"
1598 elif aix; then
1599 # use 'lsattr' on AIX
1600 _cpuinfo="lsattr -E -l proc0 -a type"
1601 elif x86; then
1602 # all other OSes try to extract CPU information from a small helper
1603 # program cpuinfo instead
1604 $_cc -o cpuinfo$_exesuf cpuinfo.c
1605 _cpuinfo="./cpuinfo$_exesuf"
1608 if x86 ; then
1609 # gather more CPU information
1610 pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1)
1611 pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1612 pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1613 pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1614 pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1)
1616 exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1)
1618 pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \
1619 -e s/xmm/sse/ -e s/kni/sse/)
1621 for ext in $pparam ; do
1622 eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check
1623 done
1625 # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
1626 test $_sse = kernel_check && _mmxext=kernel_check
1628 echocheck "CPU vendor"
1629 echores "$pvendor ($pfamily:$pmodel:$pstepping)"
1631 echocheck "CPU type"
1632 echores "$pname"
1635 fi # test "$_runtime_cpudetection" = no
1637 if x86 && test "$_runtime_cpudetection" = no ; then
1638 extcheck() {
1639 if test "$1" = kernel_check ; then
1640 echocheck "kernel support of $2"
1641 cat > $TMPC <<EOF
1642 #include <stdlib.h>
1643 #include <signal.h>
1644 static void catch(int sig) { exit(1); }
1645 int main(void) {
1646 signal(SIGILL, catch);
1647 __asm__ volatile ("$3":::"memory"); return 0;
1651 if cc_check && tmp_run ; then
1652 eval _$2=yes
1653 echores "yes"
1654 _optimizing="$_optimizing $2"
1655 return 0
1656 else
1657 eval _$2=no
1658 echores "failed"
1659 echo "It seems that your kernel does not correctly support $2."
1660 echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!"
1661 return 1
1664 return 0
1667 extcheck $_mmx "mmx" "emms"
1668 extcheck $_mmxext "mmxext" "sfence"
1669 extcheck $_3dnow "3dnow" "femms"
1670 extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0"
1671 extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse"
1672 extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2"
1673 extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0"
1674 extcheck $_cmov "cmov" "cmovb %%eax,%%ebx"
1676 echocheck "mtrr support"
1677 if test "$_mtrr" = kernel_check ; then
1678 _mtrr="yes"
1679 _optimizing="$_optimizing mtrr"
1681 echores "$_mtrr"
1683 if test "$_gcc3_ext" != ""; then
1684 # if we had to disable sse/sse2 because the active kernel does not
1685 # support this instruction set extension, we also have to tell
1686 # gcc3 to not generate sse/sse2 instructions for normal C code
1687 cflag_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 if test "$_runtime_cpudetection" = no ; then
1837 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1838 cflag_check -march=native && proc=native
1840 if test "$proc" = "amdfam10"; then
1841 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1843 if test "$proc" = "k8"; then
1844 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1846 if test "$proc" = "athlon-xp"; then
1847 cflag_check -march=$proc $cpuopt=$proc || proc=athlon
1849 if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then
1850 cflag_check -march=$proc $cpuopt=$proc || proc=k6
1852 if test "$proc" = "k6" || test "$proc" = "c3"; then
1853 if ! cflag_check -march=$proc $cpuopt=$proc; then
1854 if cflag_check -march=i586 $cpuopt=i686; then
1855 proc=i586-i686
1856 else
1857 proc=i586
1861 if test "$proc" = "prescott" ; then
1862 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
1864 if test "$proc" = "core2" ; then
1865 cflag_check -march=$proc $cpuopt=$proc || proc=pentium-m
1867 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
1868 cflag_check -march=$proc $cpuopt=$proc || proc=i686
1870 if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then
1871 cflag_check -march=$proc $cpuopt=$proc || proc=i586
1873 if test "$proc" = "i586"; then
1874 cflag_check -march=$proc $cpuopt=$proc || proc=i486
1876 if test "$proc" = "i486" ; then
1877 cflag_check -march=$proc $cpuopt=$proc || proc=i386
1879 if test "$proc" = "i386" ; then
1880 cflag_check -march=$proc $cpuopt=$proc || proc=error
1882 if test "$proc" = "error" ; then
1883 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
1884 _mcpu=""
1885 _march=""
1886 _optimizing=""
1887 elif test "$proc" = "i586-i686"; then
1888 _march="-march=i586"
1889 _mcpu="$cpuopt=i686"
1890 _optimizing="$proc"
1891 else
1892 _march="-march=$proc"
1893 _mcpu="$cpuopt=$proc"
1894 _optimizing="$proc"
1896 else # if test "$_runtime_cpudetection" = no
1897 _mcpu="$cpuopt=generic"
1898 # at least i486 required, for bswap instruction
1899 _march="-march=i486"
1900 cflag_check $_mcpu || _mcpu="$cpuopt=i686"
1901 cflag_check $_mcpu || _mcpu=""
1902 cflag_check $_march $_mcpu || _march=""
1905 ## Gabucino : --target takes effect here (hopefully...) by overwriting
1906 ## autodetected mcpu/march parameters
1907 if test "$_target" ; then
1908 # TODO: it may be a good idea to check GCC and fall back in all cases
1909 if test "$host_arch" = "i586-i686"; then
1910 _march="-march=i586"
1911 _mcpu="$cpuopt=i686"
1912 else
1913 _march="-march=$host_arch"
1914 _mcpu="$cpuopt=$host_arch"
1917 proc="$host_arch"
1919 case "$proc" in
1920 i386) iproc=386 ;;
1921 i486) iproc=486 ;;
1922 i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;;
1923 i686|athlon*|pentium*) iproc=686 ;;
1924 *) iproc=586 ;;
1925 esac
1928 if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then
1929 _fast_cmov="yes"
1930 else
1931 _fast_cmov="no"
1933 test $_fast_clz = "auto" && _fast_clz=yes
1935 echores "$proc"
1938 ia64)
1939 arch='ia64'
1940 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1941 iproc='ia64'
1944 x86_64|amd64)
1945 arch='x86'
1946 subarch='x86_64'
1947 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
1948 def_fast_64bit='#define HAVE_FAST_64BIT 1'
1949 iproc='x86_64'
1951 # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead
1952 if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then
1953 cpuopt=-mtune
1954 else
1955 cpuopt=-mcpu
1957 if test "$_runtime_cpudetection" = no ; then
1958 case "$pvendor" in
1959 AuthenticAMD)
1960 case "$pfamily" in
1961 15) proc=k8
1962 test $_fast_clz = "auto" && _fast_clz=no
1964 *) proc=amdfam10;;
1965 esac
1967 GenuineIntel)
1968 case "$pfamily" in
1969 6) proc=core2;;
1971 # 64-bit prescotts exist, but as far as GCC is concerned they
1972 # have the same capabilities as a nocona.
1973 proc=nocona
1974 test $_fast_cmov = "auto" && _fast_cmov=no
1975 test $_fast_clz = "auto" && _fast_clz=no
1977 esac
1980 proc=error;;
1981 esac
1982 fi # test "$_runtime_cpudetection" = no
1984 echocheck "GCC & CPU optimization abilities"
1985 # This is a stripped-down version of the i386 fallback.
1986 if test "$_runtime_cpudetection" = no ; then
1987 if test $cc_vendor != "intel" && test $cc_vendor != "clang" ; then
1988 cflag_check -march=native && proc=native
1990 # --- AMD processors ---
1991 if test "$proc" = "amdfam10"; then
1992 cflag_check -march=$proc $cpuopt=$proc || proc=k8
1994 if test "$proc" = "k8"; then
1995 cflag_check -march=$proc $cpuopt=$proc || proc=athlon-xp
1997 # This will fail if gcc version < 3.3, which is ok because earlier
1998 # versions don't really support 64-bit on amd64.
1999 # Is this a valid assumption? -Corey
2000 if test "$proc" = "athlon-xp"; then
2001 cflag_check -march=$proc $cpuopt=$proc || proc=error
2003 # --- Intel processors ---
2004 if test "$proc" = "core2"; then
2005 cflag_check -march=$proc $cpuopt=$proc || proc=x86-64
2007 if test "$proc" = "x86-64"; then
2008 cflag_check -march=$proc $cpuopt=$proc || proc=nocona
2010 if test "$proc" = "nocona"; then
2011 cflag_check -march=$proc $cpuopt=$proc || proc=pentium4
2013 if test "$proc" = "pentium4"; then
2014 cflag_check -march=$proc $cpuopt=$proc || proc=error
2017 _march="-march=$proc"
2018 _mcpu="$cpuopt=$proc"
2019 if test "$proc" = "error" ; then
2020 echores "CPU optimization disabled. CPU not recognized or your compiler is too old."
2021 _mcpu=""
2022 _march=""
2024 else # if test "$_runtime_cpudetection" = no
2025 # x86-64 is an undocumented option, an intersection of k8 and nocona.
2026 _march="-march=x86-64"
2027 _mcpu="$cpuopt=generic"
2028 cflag_check $_mcpu || _mcpu="x86-64"
2029 cflag_check $_mcpu || _mcpu=""
2030 cflag_check $_march $_mcpu || _march=""
2033 _optimizing="$proc"
2034 test $_fast_cmov = "auto" && _fast_cmov=yes
2035 test $_fast_clz = "auto" && _fast_clz=yes
2037 echores "$proc"
2040 sparc|sparc64)
2041 arch='sparc'
2042 iproc='sparc'
2043 if test "$host_arch" = "sparc64" ; then
2044 _vis='yes'
2045 proc='ultrasparc'
2046 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2047 elif sunos ; then
2048 echocheck "CPU type"
2049 karch=$(uname -m)
2050 case "$(echo $karch)" in
2051 sun4) proc=v7 ;;
2052 sun4c) proc=v7 ;;
2053 sun4d) proc=v8 ;;
2054 sun4m) proc=v8 ;;
2055 sun4u) proc=ultrasparc _vis='yes' ;;
2056 sun4v) proc=v9 ;;
2057 *) proc=v8 ;;
2058 esac
2059 echores "$proc"
2060 else
2061 proc=v8
2063 _mcpu="-mcpu=$proc"
2064 _optimizing="$proc"
2067 arm*)
2068 arch='arm'
2069 iproc='arm'
2072 avr32)
2073 arch='avr32'
2074 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2075 iproc='avr32'
2076 test $_fast_clz = "auto" && _fast_clz=yes
2079 sh|sh4)
2080 arch='sh4'
2081 iproc='sh4'
2084 ppc|ppc64|powerpc|powerpc64)
2085 arch='ppc'
2086 def_dcbzl='#define HAVE_DCBZL 0'
2087 def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1'
2088 iproc='ppc'
2090 if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then
2091 subarch='ppc64'
2092 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2094 echocheck "CPU type"
2095 case $system_name in
2096 Linux)
2097 proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1)
2098 if test -n "$($_cpuinfo | grep altivec)"; then
2099 test $_altivec = auto && _altivec=yes
2102 Darwin)
2103 proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//')
2104 if [ $(sysctl -n hw.vectorunit) -eq 1 -o \
2105 "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then
2106 test $_altivec = auto && _altivec=yes
2109 NetBSD)
2110 # only gcc 3.4 works reliably with AltiVec code under NetBSD
2111 case $cc_version in
2112 2*|3.0*|3.1*|3.2*|3.3*)
2115 if [ $(sysctl -n machdep.altivec) -eq 1 ]; then
2116 test $_altivec = auto && _altivec=yes
2119 esac
2121 AIX)
2122 proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//')
2124 esac
2125 if test "$_altivec" = yes; then
2126 echores "$proc altivec"
2127 else
2128 _altivec=no
2129 echores "$proc"
2132 echocheck "GCC & CPU optimization abilities"
2134 if test -n "$proc"; then
2135 case "$proc" in
2136 601) _march='-mcpu=601' _mcpu='-mtune=601' ;;
2137 603) _march='-mcpu=603' _mcpu='-mtune=603' ;;
2138 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;;
2139 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;;
2140 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;;
2141 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;;
2142 POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;;
2143 POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;;
2144 POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;;
2145 *) ;;
2146 esac
2147 # gcc 3.1(.1) and up supports 7400 and 7450
2148 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then
2149 case "$proc" in
2150 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;;
2151 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;;
2152 *) ;;
2153 esac
2155 # gcc 3.2 and up supports 970
2156 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2157 case "$proc" in
2158 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970'
2159 def_dcbzl='#define HAVE_DCBZL 1' ;;
2160 *) ;;
2161 esac
2163 # gcc 3.3 and up supports POWER4
2164 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then
2165 case "$proc" in
2166 POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;;
2167 *) ;;
2168 esac
2170 # gcc 3.4 and up supports 440*
2171 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then
2172 case "$proc" in
2173 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;;
2174 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;;
2175 *) ;;
2176 esac
2178 # gcc 4.0 and up supports POWER5
2179 if test "$_cc_major" -ge "4"; then
2180 case "$proc" in
2181 POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;;
2182 *) ;;
2183 esac
2187 if test -n "$_mcpu"; then
2188 _optimizing=$(echo $_mcpu | cut -c 8-)
2189 echores "$_optimizing"
2190 else
2191 echores "none"
2194 test $_fast_clz = "auto" && _fast_clz=yes
2198 alpha*)
2199 arch='alpha'
2200 iproc='alpha'
2201 def_fast_64bit='#define HAVE_FAST_64BIT 1'
2203 echocheck "CPU type"
2204 cat > $TMPC << EOF
2205 int main(void) {
2206 unsigned long ver, mask;
2207 __asm__ ("implver %0" : "=r" (ver));
2208 __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1));
2209 printf("%ld-%x\n", ver, ~mask);
2210 return 0;
2213 $_cc -o "$TMPEXE" "$TMPC"
2214 case $("$TMPEXE") in
2216 0-0) proc="ev4"; _mvi="0";;
2217 1-0) proc="ev5"; _mvi="0";;
2218 1-1) proc="ev56"; _mvi="0";;
2219 1-101) proc="pca56"; _mvi="1";;
2220 2-303) proc="ev6"; _mvi="1";;
2221 2-307) proc="ev67"; _mvi="1";;
2222 2-1307) proc="ev68"; _mvi="1";;
2223 esac
2224 echores "$proc"
2226 echocheck "GCC & CPU optimization abilities"
2227 if test "$proc" = "ev68" ; then
2228 cc_check -mcpu=$proc || proc=ev67
2230 if test "$proc" = "ev67" ; then
2231 cc_check -mcpu=$proc || proc=ev6
2233 _mcpu="-mcpu=$proc"
2234 echores "$proc"
2236 test $_fast_clz = "auto" && _fast_clz=yes
2238 _optimizing="$proc"
2241 mips)
2242 arch='mips'
2243 iproc='mips'
2245 if irix ; then
2246 echocheck "CPU type"
2247 proc=$(hinv -c processor | grep CPU | cut -d " " -f3)
2248 case "$(echo $proc)" in
2249 R3000) _march='-mips1' _mcpu='-mtune=r2000' ;;
2250 R4000) _march='-mips3' _mcpu='-mtune=r4000' ;;
2251 R4400) _march='-mips3' _mcpu='-mtune=r4400' ;;
2252 R4600) _march='-mips3' _mcpu='-mtune=r4600' ;;
2253 R5000) _march='-mips4' _mcpu='-mtune=r5000' ;;
2254 R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;;
2255 esac
2256 # gcc < 3.x does not support -mtune.
2257 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then
2258 _mcpu=''
2260 echores "$proc"
2263 test $_fast_clz = "auto" && _fast_clz=yes
2267 hppa)
2268 arch='pa_risc'
2269 iproc='PA-RISC'
2272 s390)
2273 arch='s390'
2274 iproc='390'
2277 s390x)
2278 arch='s390x'
2279 iproc='390x'
2282 vax)
2283 arch='vax'
2284 iproc='vax'
2287 xtensa)
2288 arch='xtensa'
2289 iproc='xtensa'
2292 generic)
2293 arch='generic'
2297 echo "The architecture of your CPU ($host_arch) is not supported by this configure script"
2298 echo "It seems nobody has ported MPlayer to your OS or CPU type yet."
2299 die "unsupported architecture $host_arch"
2301 esac # case "$host_arch" in
2303 if test "$_runtime_cpudetection" = yes ; then
2304 if x86 ; then
2305 test "$_cmov" != no && _cmov=yes
2306 x86_32 && _cmov=no
2307 test "$_mmx" != no && _mmx=yes
2308 test "$_3dnow" != no && _3dnow=yes
2309 test "$_3dnowext" != no && _3dnowext=yes
2310 test "$_mmxext" != no && _mmxext=yes
2311 test "$_sse" != no && _sse=yes
2312 test "$_sse2" != no && _sse2=yes
2313 test "$_ssse3" != no && _ssse3=yes
2314 test "$_mtrr" != no && _mtrr=yes
2316 if ppc; then
2317 _altivec=yes
2322 # endian testing
2323 echocheck "byte order"
2324 if test "$_big_endian" = auto ; then
2325 cat > $TMPC <<EOF
2326 short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
2327 (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
2328 int main(void) { return (long)ascii_name; }
2330 if cc_check ; then
2331 if strings $TMPEXE | grep -q -l MPlayerBigEndian ; then
2332 _big_endian=yes
2333 else
2334 _big_endian=no
2336 else
2337 echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
2340 if test "$_big_endian" = yes ; then
2341 _byte_order='big-endian'
2342 def_words_endian='#define WORDS_BIGENDIAN 1'
2343 def_bigendian='#define HAVE_BIGENDIAN 1'
2344 else
2345 _byte_order='little-endian'
2346 def_words_endian='#undef WORDS_BIGENDIAN'
2347 def_bigendian='#define HAVE_BIGENDIAN 0'
2349 echores "$_byte_order"
2352 echocheck "extern symbol prefix"
2353 cat > $TMPC << EOF
2354 int ff_extern;
2356 cc_check -c || die "Symbol mangling check failed."
2357 sym=$($_nm -P -g $TMPEXE)
2358 extern_prefix=${sym%%ff_extern*}
2359 def_extern_asm="#define EXTERN_ASM $extern_prefix"
2360 def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
2361 echores $extern_prefix
2364 echocheck "assembler support of -pipe option"
2365 # -I. helps to detect compilers that just misunderstand -pipe like Sun C
2366 cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2369 echocheck "compiler support of named assembler arguments"
2370 _named_asm_args=yes
2371 def_named_asm_args="#define NAMED_ASM_ARGS 1"
2372 if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \
2373 -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then
2374 _named_asm_args=no
2375 def_named_asm_args="#undef NAMED_ASM_ARGS"
2377 echores $_named_asm_args
2380 if darwin && test "$cc_vendor" = "gnu" ; then
2381 echocheck "GCC support of -mstackrealign"
2382 # GCC 4.2 and some earlier Apple versions support this flag on x86. Since
2383 # Mac OS X/Intel has an ABI different from Windows this is needed to avoid
2384 # crashes when loading Win32 DLLs. Unfortunately some gcc versions create
2385 # wrong code with this flag, but this can be worked around by adding
2386 # -fno-unit-at-a-time as described in the blog post at
2387 # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/
2388 cat > $TMPC << EOF
2389 __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; }
2390 int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; }
2392 cc_check -O2 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign
2393 test -z "$cflags_stackrealign" && cc_check -O2 -mstackrealign -fno-unit-at-a-time \
2394 && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time"
2395 test -n "$cflags_stackrealign" && echores "yes" || echores "no"
2396 fi # if darwin && test "$cc_vendor" = "gnu" ; then
2399 # Checking for CFLAGS
2400 _install_strip="-s"
2401 if test "$_profile" != "" || test "$_debug" != "" ; then
2402 CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
2403 WARNFLAGS="-W -Wall"
2404 _install_strip=
2405 elif test -z "$CFLAGS" ; then
2406 if test "$cc_vendor" = "intel" ; then
2407 CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
2408 WARNFLAGS="-wd167 -wd556 -wd144"
2409 elif test "$cc_vendor" = "sun" ; then
2410 CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
2411 elif test "$cc_vendor" = "clang"; then
2412 CFLAGS="-O2 $_march $_pipe"
2413 elif test "$cc_vendor" != "gnu" ; then
2414 CFLAGS="-O2 $_march $_mcpu $_pipe"
2415 else
2416 CFLAGS="-O2 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2417 WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2418 extra_ldflags="$extra_ldflags -ffast-math"
2420 else
2421 warn_cflags=yes
2424 if test "$cc_vendor" = "gnu" ; then
2425 cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
2426 # -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
2427 # that's the only variable specific to C now, and this option is not valid
2428 # for C++.
2429 cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
2430 cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
2431 cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
2432 cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
2433 cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2434 else
2435 CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
2438 cflag_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer"
2439 cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2442 if test -n "$LDFLAGS" ; then
2443 extra_ldflags="$extra_ldflags $LDFLAGS"
2444 warn_cflags=yes
2445 elif test "$cc_vendor" = "intel" ; then
2446 extra_ldflags="$extra_ldflags -i-static"
2448 if test -n "$CPPFLAGS" ; then
2449 extra_cflags="$extra_cflags $CPPFLAGS"
2450 warn_cflags=yes
2455 if x86_32 ; then
2456 # Checking assembler (_as) compatibility...
2457 # Added workaround for older as that reads from stdin by default - atmos
2458 as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p')
2459 echocheck "assembler ($_as $as_version)"
2461 _pref_as_version='2.9.1'
2462 echo 'nop' > $TMPS
2463 if test "$_mmx" = yes ; then
2464 echo 'emms' >> $TMPS
2466 if test "$_3dnow" = yes ; then
2467 _pref_as_version='2.10.1'
2468 echo 'femms' >> $TMPS
2470 if test "$_3dnowext" = yes ; then
2471 _pref_as_version='2.10.1'
2472 echo 'pswapd %mm0, %mm0' >> $TMPS
2474 if test "$_mmxext" = yes ; then
2475 _pref_as_version='2.10.1'
2476 echo 'movntq %mm0, (%eax)' >> $TMPS
2478 if test "$_sse" = yes ; then
2479 _pref_as_version='2.10.1'
2480 echo 'xorps %xmm0, %xmm0' >> $TMPS
2482 #if test "$_sse2" = yes ; then
2483 # _pref_as_version='2.11'
2484 # echo 'xorpd %xmm0, %xmm0' >> $TMPS
2486 if test "$_cmov" = yes ; then
2487 _pref_as_version='2.10.1'
2488 echo 'cmovb %eax, %ebx' >> $TMPS
2490 if test "$_ssse3" = yes ; then
2491 _pref_as_version='2.16.92'
2492 echo 'pabsd %xmm0, %xmm1' >> $TMPS
2494 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes
2496 if test "$as_verc_fail" != yes ; then
2497 echores "ok"
2498 else
2499 res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc."
2500 echores "failed"
2501 die "obsolete binutils version"
2504 fi #if x86_32
2506 echocheck ".align is a power of two"
2507 if test "$_asmalign_pot" = auto ; then
2508 _asmalign_pot=no
2509 cat > $TMPC << EOF
2510 int main(void) { __asm__ (".align 3"); return 0; }
2512 cc_check && _asmalign_pot=yes
2514 if test "$_asmalign_pot" = "yes" ; then
2515 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2516 else
2517 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2519 echores $_asmalign_pot
2522 echocheck "PIC"
2523 pic=no
2524 cat > $TMPC << EOF
2525 int main(void) {
2526 #if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
2527 #error PIC not enabled
2528 #endif
2529 return 0;
2532 cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
2533 echores $pic
2536 if x86 ; then
2537 echocheck "10 assembler operands"
2538 ten_operands=no
2539 def_ten_operands='#define HAVE_TEN_OPERANDS 0'
2540 cat > $TMPC << EOF
2541 int main(void) {
2542 int x=0;
2543 __asm__ volatile(
2545 :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
2547 return 0;
2550 cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1'
2551 echores $ten_operands
2553 echocheck "ebx availability"
2554 ebx_available=no
2555 def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
2556 cat > $TMPC << EOF
2557 int main(void) {
2558 int x;
2559 __asm__ volatile(
2560 "xor %0, %0"
2561 :"=b"(x)
2562 // just adding ebx to clobber list seems unreliable with some
2563 // compilers, e.g. Haiku's gcc 2.95
2565 // and the above check does not work for OSX 64 bit...
2566 __asm__ volatile("":::"%ebx");
2567 return 0;
2570 cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
2571 echores $ebx_available
2574 echocheck "yasm"
2575 if test -z "$YASMFLAGS" ; then
2576 if darwin ; then
2577 x86_64 && objformat="macho64" || objformat="macho"
2578 elif win32 ; then
2579 objformat="win32"
2580 else
2581 objformat="elf"
2583 # currently tested for Linux x86, x86_64
2584 YASMFLAGS="-f $objformat"
2585 x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64"
2586 test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC"
2587 case "$objformat" in
2588 elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;;
2589 *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;;
2590 esac
2591 else
2592 warn_cflags=yes
2595 echo "pabsw xmm0, xmm0" > $TMPS
2596 yasm_check || _yasm=""
2597 if test $_yasm ; then
2598 def_yasm='#define HAVE_YASM 1'
2599 have_yasm="yes"
2600 echores "$_yasm"
2601 else
2602 def_yasm='#define HAVE_YASM 0'
2603 have_yasm="no"
2604 echores "no"
2607 echocheck "bswap"
2608 def_bswap='#define HAVE_BSWAP 0'
2609 echo 'bswap %eax' > $TMPS
2610 $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no
2611 echores "$bswap"
2612 fi #if x86
2615 #FIXME: This should happen before the check for CFLAGS..
2616 def_altivec_h='#define HAVE_ALTIVEC_H 0'
2617 if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then
2619 # check if AltiVec is supported by the compiler, and how to enable it
2620 echocheck "GCC AltiVec flags"
2621 if $(cflag_check -maltivec -mabi=altivec) ; then
2622 _altivec_gcc_flags="-maltivec -mabi=altivec"
2623 # check if <altivec.h> should be included
2624 if $(header_check altivec.h $_altivec_gcc_flags) ; then
2625 def_altivec_h='#define HAVE_ALTIVEC_H 1'
2626 inc_altivec_h='#include <altivec.h>'
2627 else
2628 if $(cflag_check -faltivec) ; then
2629 _altivec_gcc_flags="-faltivec"
2630 else
2631 _altivec=no
2632 _altivec_gcc_flags="none, AltiVec disabled"
2636 echores "$_altivec_gcc_flags"
2638 # check if the compiler supports braces for vector declarations
2639 cat > $TMPC << EOF
2640 $inc_altivec_h
2641 int main(void) { (vector int) {1}; return 0; }
2643 cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations."
2645 # Disable runtime cpudetection if we cannot generate AltiVec code or
2646 # AltiVec is disabled by the user.
2647 test "$_runtime_cpudetection" = yes && test "$_altivec" = no \
2648 && _runtime_cpudetection=no
2650 # Show that we are optimizing for AltiVec (if enabled and supported).
2651 test "$_runtime_cpudetection" = no && test "$_altivec" = yes \
2652 && _optimizing="$_optimizing altivec"
2654 # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS.
2655 test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags"
2658 if ppc ; then
2659 def_xform_asm='#define HAVE_XFORM_ASM 0'
2660 xform_asm=no
2661 echocheck "XFORM ASM support"
2662 cat > $TMPC << EOF
2663 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; }
2665 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2666 echores "$xform_asm"
2669 if arm ; then
2670 echocheck "ARM pld instruction"
2671 cat > $TMPC << EOF
2672 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2674 pld=no
2675 cc_check && pld=yes
2676 echores "$pld"
2678 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2679 if test $_armv5te = "auto" ; then
2680 cat > $TMPC << EOF
2681 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2683 _armv5te=no
2684 cc_check && _armv5te=yes
2686 echores "$_armv5te"
2688 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2690 echocheck "ARMv6 (SIMD instructions)"
2691 if test $_armv6 = "auto" ; then
2692 cat > $TMPC << EOF
2693 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2695 _armv6=no
2696 cc_check && _armv6=yes
2698 echores "$_armv6"
2700 echocheck "ARMv6t2 (SIMD instructions)"
2701 if test $_armv6t2 = "auto" ; then
2702 cat > $TMPC << EOF
2703 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2705 _armv6t2=no
2706 cc_check && _armv6t2=yes
2708 echores "$_armv6"
2710 echocheck "ARM VFP"
2711 if test $_armvfp = "auto" ; then
2712 cat > $TMPC << EOF
2713 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2715 _armvfp=no
2716 cc_check && _armvfp=yes
2718 echores "$_armvfp"
2720 echocheck "ARM NEON"
2721 if test $neon = "auto" ; then
2722 cat > $TMPC << EOF
2723 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2725 neon=no
2726 cc_check && neon=yes
2728 echores "$neon"
2730 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2731 if test $_iwmmxt = "auto" ; then
2732 cat > $TMPC << EOF
2733 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2735 _iwmmxt=no
2736 cc_check && _iwmmxt=yes
2738 echores "$_iwmmxt"
2741 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'
2742 test "$_altivec" = yes && cpuexts="ALTIVEC $cpuexts"
2743 test "$_mmx" = yes && cpuexts="MMX $cpuexts"
2744 test "$_mmxext" = yes && cpuexts="MMX2 $cpuexts"
2745 test "$_3dnow" = yes && cpuexts="AMD3DNOW $cpuexts"
2746 test "$_3dnowext" = yes && cpuexts="AMD3DNOWEXT $cpuexts"
2747 test "$_sse" = yes && cpuexts="SSE $cpuexts"
2748 test "$_sse2" = yes && cpuexts="SSE2 $cpuexts"
2749 test "$_ssse3" = yes && cpuexts="SSSE3 $cpuexts"
2750 test "$_cmov" = yes && cpuexts="CMOV $cpuexts"
2751 test "$_fast_cmov" = yes && cpuexts="FAST_CMOV $cpuexts"
2752 test "$_fast_clz" = yes && cpuexts="FAST_CLZ $cpuexts"
2753 test "$pld" = yes && cpuexts="PLD $cpuexts"
2754 test "$_armv5te" = yes && cpuexts="ARMV5TE $cpuexts"
2755 test "$_armv6" = yes && cpuexts="ARMV6 $cpuexts"
2756 test "$_armv6t2" = yes && cpuexts="ARMV6T2 $cpuexts"
2757 test "$_armvfp" = yes && cpuexts="ARMVFP $cpuexts"
2758 test "$neon" = yes && cpuexts="NEON $cpuexts"
2759 test "$_iwmmxt" = yes && cpuexts="IWMMXT $cpuexts"
2760 test "$_vis" = yes && cpuexts="VIS $cpuexts"
2761 test "$_mvi" = yes && cpuexts="MVI $cpuexts"
2763 # Checking kernel version...
2764 if x86_32 && linux ; then
2765 _k_verc_problem=no
2766 kernel_version=$(uname -r 2>&1)
2767 echocheck "$system_name kernel version"
2768 case "$kernel_version" in
2769 '') kernel_version="?.??"; _k_verc_fail=yes;;
2770 [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*)
2771 _k_verc_problem=yes;;
2772 esac
2773 if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then
2774 _k_verc_fail=yes
2776 if test "$_k_verc_fail" ; then
2777 echores "$kernel_version, fail"
2778 echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!"
2779 echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you"
2780 echo "experience crashes. MPlayer tries to autodetect if your kernel correctly"
2781 echo "supports SSE, but you have been warned! If you are using a kernel older than"
2782 echo "2.2.x you must upgrade it to get SSE support!"
2783 # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test)
2784 else
2785 echores "$kernel_version, ok"
2789 ######################
2790 # MAIN TESTS GO HERE #
2791 ######################
2794 echocheck "-lposix"
2795 if cflag_check -lposix ; then
2796 extra_ldflags="$extra_ldflags -lposix"
2797 echores "yes"
2798 else
2799 echores "no"
2802 echocheck "-lm"
2803 if cflag_check -lm ; then
2804 _ld_lm="-lm"
2805 echores "yes"
2806 else
2807 _ld_lm=""
2808 echores "no"
2812 echocheck "langinfo"
2813 if test "$_langinfo" = auto ; then
2814 _langinfo=no
2815 function_check langinfo.h 'nl_langinfo(CODESET)' && _langinfo=yes
2817 if test "$_langinfo" = yes ; then
2818 def_langinfo='#define HAVE_LANGINFO 1'
2819 else
2820 def_langinfo='#undef HAVE_LANGINFO'
2822 echores "$_langinfo"
2825 echocheck "translation support"
2826 if test "$_translation" = yes; then
2827 def_translation="#define CONFIG_TRANSLATION 1"
2828 else
2829 def_translation="#undef CONFIG_TRANSLATION"
2831 echores "$_translation"
2833 echocheck "language"
2834 # Set preferred languages, "all" uses English as main language.
2835 test -z "$language" && language=$LINGUAS
2836 test -z "$language_doc" && language_doc=$language
2837 test -z "$language_man" && language_man=$language
2838 test -z "$language_msg" && language_msg="all"
2839 language_doc=$(echo $language_doc | tr , " ")
2840 language_man=$(echo $language_man | tr , " ")
2841 language_msg=$(echo $language_msg | tr , " ")
2843 test "$language_doc" = "all" && language_doc=$doc_lang_all
2844 test "$language_man" = "all" && language_man=$man_lang_all
2845 test "$language_msg" = "all" && language_msg=$msg_lang_all
2847 if test "$_translation" != yes ; then
2848 language_msg=""
2851 # Prune non-existing translations from language lists.
2852 # Set message translation to the first available language.
2853 # Fall back on English.
2854 for lang in $language_doc ; do
2855 test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
2856 done
2857 language_doc=$tmp_language_doc
2858 test -z "$language_doc" && language_doc=en
2860 for lang in $language_man ; do
2861 test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
2862 done
2863 language_man=$tmp_language_man
2864 test -z "$language_man" && language_man=en
2866 for lang in $language_msg ; do
2867 test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
2868 done
2869 language_msg=$tmp_language_msg
2871 echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2874 echocheck "enable sighandler"
2875 if test "$_sighandler" = yes ; then
2876 def_sighandler='#define CONFIG_SIGHANDLER 1'
2877 else
2878 def_sighandler='#undef CONFIG_SIGHANDLER'
2880 echores "$_sighandler"
2882 echocheck "runtime cpudetection"
2883 if test "$_runtime_cpudetection" = yes ; then
2884 _optimizing="Runtime CPU-Detection enabled"
2885 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1'
2886 else
2887 def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0'
2889 echores "$_runtime_cpudetection"
2892 echocheck "restrict keyword"
2893 for restrict_keyword in restrict __restrict __restrict__ ; do
2894 echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC
2895 if cc_check; then
2896 def_restrict_keyword=$restrict_keyword
2897 break;
2899 done
2900 if [ -n "$def_restrict_keyword" ]; then
2901 echores "$def_restrict_keyword"
2902 else
2903 echores "none"
2905 # Avoid infinite recursion loop ("#define restrict restrict")
2906 if [ "$def_restrict_keyword" != "restrict" ]; then
2907 def_restrict_keyword="#define restrict $def_restrict_keyword"
2908 else
2909 def_restrict_keyword=""
2913 echocheck "__builtin_expect"
2914 # GCC branch prediction hint
2915 cat > $TMPC << EOF
2916 static int foo(int a) {
2917 a = __builtin_expect(a, 10);
2918 return a == 10 ? 0 : 1;
2920 int main(void) { return foo(10) && foo(0); }
2922 _builtin_expect=no
2923 cc_check && _builtin_expect=yes
2924 if test "$_builtin_expect" = yes ; then
2925 def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2926 else
2927 def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2929 echores "$_builtin_expect"
2932 echocheck "kstat"
2933 _kstat=no
2934 function_check kstat.h 'kstat_open()' -lkstat && _kstat=yes
2935 if test "$_kstat" = yes ; then
2936 def_kstat="#define HAVE_LIBKSTAT 1"
2937 extra_ldflags="$extra_ldflags -lkstat"
2938 else
2939 def_kstat="#undef HAVE_LIBKSTAT"
2941 echores "$_kstat"
2944 echocheck "posix4"
2945 # required for nanosleep on some systems
2946 _posix4=no
2947 function_check time.h 'nanosleep(0, 0)' -lposix4 && _posix4=yes
2948 if test "$_posix4" = yes ; then
2949 extra_ldflags="$extra_ldflags -lposix4"
2951 echores "$_posix4"
2953 for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do
2954 echocheck $func
2955 eval _$func=no
2956 function_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
2957 if eval test "x\$_$func" = "xyes"; then
2958 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\""
2959 echores yes
2960 else
2961 eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\""
2962 echores no
2964 done
2967 echocheck "mkstemp"
2968 cat > $TMPC << EOF
2969 #include <stdlib.h>
2970 int main(void) { char a; mkstemp(&a); return 0; }
2972 _mkstemp=no
2973 cc_check && _mkstemp=yes
2974 if test "$_mkstemp" = yes ; then
2975 def_mkstemp='#define HAVE_MKSTEMP 1'
2976 else
2977 def_mkstemp='#undef HAVE_MKSTEMP'
2979 echores "$_mkstemp"
2982 echocheck "nanosleep"
2983 _nanosleep=no
2984 function_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2985 if test "$_nanosleep" = yes ; then
2986 def_nanosleep='#define HAVE_NANOSLEEP 1'
2987 else
2988 def_nanosleep='#undef HAVE_NANOSLEEP'
2990 echores "$_nanosleep"
2993 echocheck "socklib"
2994 # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
2995 # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind):
2996 cat > $TMPC << EOF
2997 #include <netdb.h>
2998 #include <sys/socket.h>
2999 int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
3001 _socklib=no
3002 for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
3003 cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
3004 done
3005 test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
3006 if test $_winsock2_h = auto ; then
3007 _winsock2_h=no
3008 function_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
3010 test "$_ld_sock" && res_comment="using $_ld_sock"
3011 echores "$_socklib"
3014 if test $_winsock2_h = yes ; then
3015 _ld_sock="-lws2_32"
3016 def_winsock2_h='#define HAVE_WINSOCK2_H 1'
3017 else
3018 def_winsock2_h='#define HAVE_WINSOCK2_H 0'
3022 echocheck "arpa/inet.h"
3023 arpa_inet_h=no
3024 def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
3025 header_check arpa/inet.h && arpa_inet_h=yes &&
3026 def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
3027 echores "$arpa_inet_h"
3030 echocheck "inet_pton()"
3031 def_inet_pton='#define HAVE_INET_PTON 0'
3032 inet_pton=no
3033 cat > $TMPC << EOF
3034 #include <sys/types.h>
3035 #include <sys/socket.h>
3036 #include <arpa/inet.h>
3037 int main(void) { inet_pton(0, 0, 0); return 0; }
3039 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3040 cc_check $_ld_tmp && inet_pton=yes && break
3041 done
3042 if test $inet_pton = yes ; then
3043 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3044 def_inet_pton='#define HAVE_INET_PTON 1'
3046 echores "$inet_pton"
3049 echocheck "inet_aton()"
3050 def_inet_aton='#define HAVE_INET_ATON 0'
3051 inet_aton=no
3052 cat > $TMPC << EOF
3053 #include <sys/types.h>
3054 #include <sys/socket.h>
3055 #include <arpa/inet.h>
3056 int main(void) { inet_aton(0, 0); return 0; }
3058 for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
3059 cc_check $_ld_tmp && inet_aton=yes && break
3060 done
3061 if test $inet_aton = yes ; then
3062 test "$_ld_tmp" && res_comment="using $_ld_tmp"
3063 def_inet_aton='#define HAVE_INET_ATON 1'
3065 echores "$inet_aton"
3068 echocheck "socklen_t"
3069 _socklen_t=no
3070 for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
3071 cat > $TMPC << EOF
3072 #include <$header>
3073 int main(void) { socklen_t v = 0; return v; }
3075 cc_check && _socklen_t=yes && break
3076 done
3077 if test "$_socklen_t" = yes ; then
3078 def_socklen_t='#define HAVE_SOCKLEN_T 1'
3079 else
3080 def_socklen_t='#define HAVE_SOCKLEN_T 0'
3082 echores "$_socklen_t"
3085 echocheck "closesocket()"
3086 _closesocket=no
3087 function_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
3088 if test "$_closesocket" = yes ; then
3089 def_closesocket='#define HAVE_CLOSESOCKET 1'
3090 else
3091 def_closesocket='#define HAVE_CLOSESOCKET 0'
3093 echores "$_closesocket"
3096 echocheck "networking"
3097 test $_winsock2_h = no && test $inet_pton = no &&
3098 test $inet_aton = no && networking=no
3099 if test "$networking" = yes ; then
3100 def_network='#define CONFIG_NETWORK 1'
3101 def_networking='#define CONFIG_NETWORKING 1'
3102 extra_ldflags="$extra_ldflags $_ld_sock"
3103 inputmodules="networking $inputmodules"
3104 else
3105 noinputmodules="networking $noinputmodules"
3106 def_network='#undef CONFIG_NETWORK'
3107 def_networking='#undef CONFIG_NETWORKING'
3108 _ftp=no
3110 echores "$networking"
3113 echocheck "inet6"
3114 if test "$_inet6" = auto ; then
3115 cat > $TMPC << EOF
3116 #include <sys/types.h>
3117 #if !defined(_WIN32) || defined(__CYGWIN__)
3118 #include <sys/socket.h>
3119 #include <netinet/in.h>
3120 #else
3121 #include <ws2tcpip.h>
3122 #endif
3123 int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
3125 _inet6=no
3126 if cc_check $_ld_sock ; then
3127 _inet6=yes
3130 if test "$_inet6" = yes ; then
3131 def_inet6='#define HAVE_AF_INET6 1'
3132 else
3133 def_inet6='#undef HAVE_AF_INET6'
3135 echores "$_inet6"
3138 echocheck "gethostbyname2"
3139 if test "$_gethostbyname2" = auto ; then
3140 cat > $TMPC << EOF
3141 #include <sys/types.h>
3142 #include <sys/socket.h>
3143 #include <netdb.h>
3144 int main(void) { gethostbyname2("", AF_INET); return 0; }
3146 _gethostbyname2=no
3147 if cc_check ; then
3148 _gethostbyname2=yes
3151 if test "$_gethostbyname2" = yes ; then
3152 def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
3153 else
3154 def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
3156 echores "$_gethostbyname2"
3159 echocheck "inttypes.h (required)"
3160 _inttypes=no
3161 header_check inttypes.h && _inttypes=yes
3162 echores "$_inttypes"
3164 if test "$_inttypes" = no ; then
3165 echocheck "sys/bitypes.h (inttypes.h predecessor)"
3166 header_check sys/bitypes.h && _inttypes=yes
3167 if test "$_inttypes" = yes ; then
3168 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."
3169 else
3170 die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
3175 echocheck "int_fastXY_t in inttypes.h"
3176 cat > $TMPC << EOF
3177 #include <inttypes.h>
3178 int main(void) {
3179 volatile int_fast16_t v= 0;
3180 return v; }
3182 _fast_inttypes=no
3183 cc_check && _fast_inttypes=yes
3184 if test "$_fast_inttypes" = no ; then
3185 def_fast_inttypes='
3186 typedef signed char int_fast8_t;
3187 typedef signed int int_fast16_t;
3188 typedef signed int int_fast32_t;
3189 typedef signed long long int_fast64_t;
3190 typedef unsigned char uint_fast8_t;
3191 typedef unsigned int uint_fast16_t;
3192 typedef unsigned int uint_fast32_t;
3193 typedef unsigned long long uint_fast64_t;'
3195 echores "$_fast_inttypes"
3198 echocheck "malloc.h"
3199 _malloc=no
3200 header_check malloc.h && _malloc=yes
3201 if test "$_malloc" = yes ; then
3202 def_malloc_h='#define HAVE_MALLOC_H 1'
3203 else
3204 def_malloc_h='#define HAVE_MALLOC_H 0'
3206 echores "$_malloc"
3209 echocheck "memalign()"
3210 # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
3211 def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0'
3212 _memalign=no
3213 function_check malloc.h 'memalign(64, sizeof(char))' && _memalign=yes
3214 if test "$_memalign" = yes ; then
3215 def_memalign='#define HAVE_MEMALIGN 1'
3216 else
3217 def_memalign='#define HAVE_MEMALIGN 0'
3218 def_map_memalign='#define memalign(a,b) malloc(b)'
3219 darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
3221 echores "$_memalign"
3224 echocheck "posix_memalign()"
3225 posix_memalign=no
3226 def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0'
3227 cat > $TMPC << EOF
3228 #define _XOPEN_SOURCE 600
3229 #include <stdlib.h>
3230 int main(void) { posix_memalign(NULL, 0, 0); }
3232 cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1'
3233 echores "$posix_memalign"
3236 echocheck "alloca.h"
3237 _alloca=no
3238 function_check alloca.h 'alloca(0)' && _alloca=yes
3239 if cc_check ; then
3240 def_alloca_h='#define HAVE_ALLOCA_H 1'
3241 else
3242 def_alloca_h='#undef HAVE_ALLOCA_H'
3244 echores "$_alloca"
3247 echocheck "fastmemcpy"
3248 if test "$_fastmemcpy" = yes ; then
3249 def_fastmemcpy='#define CONFIG_FASTMEMCPY 1'
3250 else
3251 def_fastmemcpy='#undef CONFIG_FASTMEMCPY'
3253 echores "$_fastmemcpy"
3256 echocheck "mman.h"
3257 _mman=no
3258 function_check sys/mman.h "mmap(0, 0, 0, 0, 0, 0)" && _mman=yes
3259 if test "$_mman" = yes ; then
3260 def_mman_h='#define HAVE_SYS_MMAN_H 1'
3261 else
3262 def_mman_h='#undef HAVE_SYS_MMAN_H'
3263 os2 && _need_mmap=yes
3265 echores "$_mman"
3267 cat > $TMPC << EOF
3268 #include <sys/mman.h>
3269 int main(void) { void *p = MAP_FAILED; return 0; }
3271 _mman_has_map_failed=no
3272 cc_check && _mman_has_map_failed=yes
3273 if test "$_mman_has_map_failed" = yes ; then
3274 def_mman_has_map_failed=''
3275 else
3276 def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
3279 echocheck "dynamic loader"
3280 _dl=no
3281 for _ld_tmp in "" "-ldl"; do
3282 function_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
3283 done
3284 if test "$_dl" = yes ; then
3285 def_dl='#define HAVE_LIBDL 1'
3286 else
3287 def_dl='#undef HAVE_LIBDL'
3289 echores "$_dl"
3292 echocheck "dynamic a/v plugins support"
3293 if test "$_dl" = no ; then
3294 _dynamic_plugins=no
3296 if test "$_dynamic_plugins" = yes ; then
3297 def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1'
3298 else
3299 def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS'
3301 echores "$_dynamic_plugins"
3304 def_threads='#define HAVE_THREADS 0'
3306 echocheck "pthread"
3307 if linux ; then
3308 THREAD_CFLAGS=-D_REENTRANT
3309 elif freebsd || netbsd || openbsd || bsdos ; then
3310 THREAD_CFLAGS=-D_THREAD_SAFE
3312 if test "$_pthreads" = auto ; then
3313 cat > $TMPC << EOF
3314 #include <pthread.h>
3315 static void *func(void *arg) { return arg; }
3316 int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
3318 _pthreads=no
3319 if ! hpux ; then
3320 for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
3321 # for crosscompilation, we cannot execute the program, be happy if we can link statically
3322 cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
3323 done
3326 if test "$_pthreads" = yes ; then
3327 test $_ld_pthread && res_comment="using $_ld_pthread"
3328 def_pthreads='#define HAVE_PTHREADS 1'
3329 def_threads='#define HAVE_THREADS 1'
3330 extra_cflags="$extra_cflags $THREAD_CFLAGS"
3331 else
3332 res_comment="v4l, v4l2, ao_nas, win32 loader disabled"
3333 def_pthreads='#undef HAVE_PTHREADS'
3334 _nas=no ; _tv_v4l1=no ; _tv_v4l2=no
3335 mingw32 || _win32dll=no
3337 echores "$_pthreads"
3339 if cygwin ; then
3340 if test "$_pthreads" = yes ; then
3341 def_pthread_cache="#define PTHREAD_CACHE 1"
3342 else
3343 _stream_cache=no
3344 def_stream_cache="#undef CONFIG_STREAM_CACHE"
3348 echocheck "w32threads"
3349 if test "$_pthreads" = yes ; then
3350 res_comment="using pthread instead"
3351 _w32threads=no
3353 if test "$_w32threads" = auto ; then
3354 _w32threads=no
3355 mingw32 && _w32threads=yes
3357 test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1'
3358 echores "$_w32threads"
3360 echocheck "rpath"
3361 netbsd &&_rpath=yes
3362 if test "$_rpath" = yes ; then
3363 for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
3364 tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
3365 done
3366 extra_ldflags=$tmp
3368 echores "$_rpath"
3370 echocheck "iconv"
3371 if test "$_iconv" = auto ; then
3372 cat > $TMPC << EOF
3373 #include <stdio.h>
3374 #include <unistd.h>
3375 #include <iconv.h>
3376 #define INBUFSIZE 1024
3377 #define OUTBUFSIZE 4096
3379 char inbuffer[INBUFSIZE];
3380 char outbuffer[OUTBUFSIZE];
3382 int main(void) {
3383 size_t numread;
3384 iconv_t icdsc;
3385 char *tocode="UTF-8";
3386 char *fromcode="cp1250";
3387 if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
3388 while ((numread = read(0, inbuffer, INBUFSIZE))) {
3389 char *iptr=inbuffer;
3390 char *optr=outbuffer;
3391 size_t inleft=numread;
3392 size_t outleft=OUTBUFSIZE;
3393 if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
3394 != (size_t)(-1)) {
3395 write(1, outbuffer, OUTBUFSIZE - outleft);
3398 if (iconv_close(icdsc) == -1)
3401 return 0;
3404 _iconv=no
3405 for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
3406 cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \
3407 _iconv=yes && break
3408 done
3410 if test "$_iconv" = yes ; then
3411 def_iconv='#define CONFIG_ICONV 1'
3412 else
3413 def_iconv='#undef CONFIG_ICONV'
3415 echores "$_iconv"
3418 echocheck "soundcard.h"
3419 _soundcard_h=no
3420 def_soundcard_h='#undef HAVE_SOUNDCARD_H'
3421 def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
3422 for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
3423 header_check $_soundcard_header && _soundcard_h=yes &&
3424 res_comment="$_soundcard_header" && break
3425 done
3427 if test "$_soundcard_h" = yes ; then
3428 if test $_soundcard_header = "sys/soundcard.h"; then
3429 def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
3430 else
3431 def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
3434 echores "$_soundcard_h"
3437 echocheck "sys/dvdio.h"
3438 _dvdio=no
3439 # FreeBSD 8.1 has broken dvdio.h
3440 header_check_broken sys/types.h sys/dvdio.h && _dvdio=yes
3441 if test "$_dvdio" = yes ; then
3442 def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1'
3443 else
3444 def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H'
3446 echores "$_dvdio"
3449 echocheck "sys/cdio.h"
3450 _cdio=no
3451 # at least OpenSolaris has a broken cdio.h
3452 header_check_broken sys/types.h sys/cdio.h && _cdio=yes
3453 if test "$_cdio" = yes ; then
3454 def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1'
3455 else
3456 def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H'
3458 echores "$_cdio"
3461 echocheck "linux/cdrom.h"
3462 _cdrom=no
3463 header_check linux/cdrom.h && _cdrom=yes
3464 if test "$_cdrom" = yes ; then
3465 def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1'
3466 else
3467 def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H'
3469 echores "$_cdrom"
3472 echocheck "dvd.h"
3473 _dvd=no
3474 header_check dvd.h && _dvd=yes
3475 if test "$_dvd" = yes ; then
3476 def_dvd='#define DVD_STRUCT_IN_DVD_H 1'
3477 else
3478 def_dvd='#undef DVD_STRUCT_IN_DVD_H'
3480 echores "$_dvd"
3483 if bsdos; then
3484 echocheck "BSDI dvd.h"
3485 _bsdi_dvd=no
3486 header_check dvd.h && _bsdi_dvd=yes
3487 if test "$_bsdi_dvd" = yes ; then
3488 def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1'
3489 else
3490 def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H'
3492 echores "$_bsdi_dvd"
3493 fi #if bsdos
3496 if hpux; then
3497 # also used by AIX, but AIX does not support VCD and/or libdvdread
3498 echocheck "HP-UX SCSI header"
3499 _hpux_scsi_h=no
3500 header_check sys/scsi.h && _hpux_scsi_h=yes
3501 if test "$_hpux_scsi_h" = yes ; then
3502 def_hpux_scsi_h='#define HPUX_SCTL_IO 1'
3503 else
3504 def_hpux_scsi_h='#undef HPUX_SCTL_IO'
3506 echores "$_hpux_scsi_h"
3507 fi #if hpux
3510 if sunos; then
3511 echocheck "userspace SCSI headers (Solaris)"
3512 _sol_scsi_h=no
3513 header_check sys/scsi/scsi_types.h &&
3514 header_check_broken sys/types.h sys/scsi/impl/uscsi.h &&
3515 _sol_scsi_h=yes
3516 if test "$_sol_scsi_h" = yes ; then
3517 def_sol_scsi_h='#define SOLARIS_USCSI 1'
3518 else
3519 def_sol_scsi_h='#undef SOLARIS_USCSI'
3521 echores "$_sol_scsi_h"
3522 fi #if sunos
3525 echocheck "termcap"
3526 if test "$_termcap" = auto ; then
3527 cat > $TMPC <<EOF
3528 #include <stddef.h>
3529 #include <term.h>
3530 int main(void) { tgetent(NULL, NULL); return 0; }
3532 _termcap=no
3533 for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
3534 cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \
3535 && _termcap=yes && break
3536 done
3538 if test "$_termcap" = yes ; then
3539 def_termcap='#define HAVE_TERMCAP 1'
3540 test $_ld_tmp && res_comment="using $_ld_tmp"
3541 else
3542 def_termcap='#undef HAVE_TERMCAP'
3544 echores "$_termcap"
3547 echocheck "termios"
3548 def_termios='#undef HAVE_TERMIOS'
3549 def_termios_h='#undef HAVE_TERMIOS_H'
3550 def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
3551 if test "$_termios" = auto ; then
3552 _termios=no
3553 for _termios_header in "termios.h" "sys/termios.h"; do
3554 header_check $_termios_header && _termios=yes &&
3555 res_comment="using $_termios_header" && break
3556 done
3559 if test "$_termios" = yes ; then
3560 def_termios='#define HAVE_TERMIOS 1'
3561 if test "$_termios_header" = "termios.h" ; then
3562 def_termios_h='#define HAVE_TERMIOS_H 1'
3563 else
3564 def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
3567 echores "$_termios"
3570 echocheck "shm"
3571 if test "$_shm" = auto ; then
3572 cat > $TMPC << EOF
3573 #include <sys/types.h>
3574 #include <sys/shm.h>
3575 int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; }
3577 _shm=no
3578 cc_check && _shm=yes
3580 if test "$_shm" = yes ; then
3581 def_shm='#define HAVE_SHM 1'
3582 else
3583 def_shm='#undef HAVE_SHM'
3585 echores "$_shm"
3588 echocheck "strsep()"
3589 cat > $TMPC << EOF
3590 #include <string.h>
3591 int main(void) { char *s = "Hello, world!"; strsep(&s, ","); return 0; }
3593 _strsep=no
3594 cc_check && _strsep=yes
3595 if test "$_strsep" = yes ; then
3596 def_strsep='#define HAVE_STRSEP 1'
3597 _need_strsep=no
3598 else
3599 def_strsep='#undef HAVE_STRSEP'
3600 _need_strsep=yes
3602 echores "$_strsep"
3605 echocheck "vsscanf()"
3606 cat > $TMPC << EOF
3607 #define _ISOC99_SOURCE
3608 #include <stdarg.h>
3609 #include <stdio.h>
3610 int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
3612 _vsscanf=no
3613 cc_check && _vsscanf=yes
3614 if test "$_vsscanf" = yes ; then
3615 def_vsscanf='#define HAVE_VSSCANF 1'
3616 _need_vsscanf=no
3617 else
3618 def_vsscanf='#undef HAVE_VSSCANF'
3619 _need_vsscanf=yes
3621 echores "$_vsscanf"
3624 echocheck "swab()"
3625 cat > $TMPC << EOF
3626 #define _XOPEN_SOURCE 600
3627 #include <unistd.h>
3628 int main(void) { swab(NULL, NULL, 0); return 0; }
3630 _swab=no
3631 cc_check && _swab=yes
3632 if test "$_swab" = yes ; then
3633 def_swab='#define HAVE_SWAB 1'
3634 _need_swab=no
3635 else
3636 def_swab='#undef HAVE_SWAB'
3637 _need_swab=yes
3639 echores "$_swab"
3641 echocheck "POSIX select()"
3642 cat > $TMPC << EOF
3643 #include <stdio.h>
3644 #include <stdlib.h>
3645 #include <sys/types.h>
3646 #include <string.h>
3647 #include <sys/time.h>
3648 #include <unistd.h>
3649 int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; }
3651 _posix_select=no
3652 def_posix_select='#undef HAVE_POSIX_SELECT'
3653 #select() of kLIBC (OS/2) supports socket only
3654 ! os2 && cc_check && _posix_select=yes \
3655 && def_posix_select='#define HAVE_POSIX_SELECT 1'
3656 echores "$_posix_select"
3659 echocheck "audio select()"
3660 if test "$_select" = no ; then
3661 def_select='#undef HAVE_AUDIO_SELECT'
3662 elif test "$_select" = yes ; then
3663 def_select='#define HAVE_AUDIO_SELECT 1'
3665 echores "$_select"
3668 echocheck "gettimeofday()"
3669 cat > $TMPC << EOF
3670 #include <sys/time.h>
3671 int main(void) {struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz); return 0; }
3673 _gettimeofday=no
3674 cc_check && _gettimeofday=yes
3675 if test "$_gettimeofday" = yes ; then
3676 def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
3677 _need_gettimeofday=no
3678 else
3679 def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
3680 _need_gettimeofday=yes
3682 echores "$_gettimeofday"
3685 echocheck "glob()"
3686 cat > $TMPC << EOF
3687 #include <stdio.h>
3688 #include <glob.h>
3689 int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; }
3691 _glob=no
3692 cc_check && _glob=yes
3693 if test "$_glob" = yes ; then
3694 def_glob='#define HAVE_GLOB 1'
3695 _need_glob=no
3696 else
3697 def_glob='#undef HAVE_GLOB'
3698 _need_glob=yes
3700 echores "$_glob"
3703 echocheck "setenv()"
3704 _setenv=no
3705 function_check stdlib.h 'setenv("", "", 0)' && _setenv=yes
3706 if test "$_setenv" = yes ; then
3707 def_setenv='#define HAVE_SETENV 1'
3708 _need_setenv=no
3709 else
3710 def_setenv='#undef HAVE_SETENV'
3711 _need_setenv=yes
3713 echores "$_setenv"
3716 echocheck "setmode()"
3717 _setmode=no
3718 def_setmode='#define HAVE_SETMODE 0'
3719 function_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
3720 echores "$_setmode"
3723 if sunos; then
3724 echocheck "sysi86()"
3725 _sysi86=no
3726 function_check sys/sysi86.h 'sysi86(0)' && _sysi86=yes
3727 if test "$_sysi86" = yes ; then
3728 def_sysi86='#define HAVE_SYSI86 1'
3729 cat > $TMPC << EOF
3730 #include <sys/sysi86.h>
3731 int main(void) { int sysi86(int, void*); sysi86(0); return 0; }
3733 cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1'
3734 else
3735 def_sysi86='#undef HAVE_SYSI86'
3737 echores "$_sysi86"
3738 fi #if sunos
3741 echocheck "sys/sysinfo.h"
3742 cat > $TMPC << EOF
3743 #include <sys/sysinfo.h>
3744 int main(void) {
3745 struct sysinfo s_info;
3746 sysinfo(&s_info);
3747 return 0;
3750 _sys_sysinfo=no
3751 cc_check && _sys_sysinfo=yes
3752 if test "$_sys_sysinfo" = yes ; then
3753 def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
3754 else
3755 def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
3757 echores "$_sys_sysinfo"
3760 if darwin; then
3762 echocheck "Mac OS X Finder Support"
3763 def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
3764 if test "$_macosx_finder" = yes ; then
3765 def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
3766 extra_ldflags="$extra_ldflags -framework Carbon"
3768 echores "$_macosx_finder"
3770 echocheck "Mac OS X Bundle file locations"
3771 def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
3772 test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
3773 if test "$_macosx_bundle" = yes ; then
3774 def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
3775 extra_ldflags="$extra_ldflags -framework Carbon"
3777 echores "$_macosx_bundle"
3779 echocheck "Apple Remote"
3780 if test "$_apple_remote" = auto ; then
3781 _apple_remote=no
3782 cat > $TMPC <<EOF
3783 #include <stdio.h>
3784 #include <IOKit/IOCFPlugIn.h>
3785 int main(void) {
3786 io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
3787 CFMutableDictionaryRef hidMatchDictionary;
3788 IOReturn ioReturnValue;
3790 // Set up a matching dictionary to search the I/O Registry by class.
3791 // name for all HID class devices
3792 hidMatchDictionary = IOServiceMatching("AppleIRController");
3794 // Now search I/O Registry for matching devices.
3795 ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
3796 hidMatchDictionary, &hidObjectIterator);
3798 // If search is unsuccessful, return nonzero.
3799 if (ioReturnValue != kIOReturnSuccess ||
3800 !IOIteratorIsValid(hidObjectIterator)) {
3801 return 1;
3803 return 0;
3806 cc_check -framework IOKit && _apple_remote=yes
3808 if test "$_apple_remote" = yes ; then
3809 def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
3810 libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
3811 else
3812 def_apple_remote='#undef CONFIG_APPLE_REMOTE'
3814 echores "$_apple_remote"
3816 fi #if darwin
3818 if linux; then
3820 echocheck "Apple IR"
3821 if test "$_apple_ir" = auto ; then
3822 _apple_ir=no
3823 cat > $TMPC <<EOF
3824 #include <linux/types.h>
3825 #include <linux/input.h>
3826 int main(void) {
3827 struct input_event ev;
3828 struct input_id id;
3829 return 0;
3832 cc_check && _apple_ir=yes
3834 if test "$_apple_ir" = yes ; then
3835 def_apple_ir='#define CONFIG_APPLE_IR 1'
3836 else
3837 def_apple_ir='#undef CONFIG_APPLE_IR'
3839 echores "$_apple_ir"
3840 fi #if linux
3842 echocheck "pkg-config"
3843 _pkg_config=pkg-config
3844 if $($_pkg_config --version > /dev/null 2>&1); then
3845 if test "$_ld_static"; then
3846 _pkg_config="$_pkg_config --static"
3848 echores "yes"
3849 else
3850 _pkg_config=false
3851 echores "no"
3855 echocheck "Samba support (libsmbclient)"
3856 if test "$_smb" = yes; then
3857 extra_ldflags="$extra_ldflags -lsmbclient"
3859 if test "$_smb" = auto; then
3860 _smb=no
3861 for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
3862 function_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
3863 extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
3864 done
3867 if test "$_smb" = yes; then
3868 def_smb="#define CONFIG_LIBSMBCLIENT 1"
3869 inputmodules="smb $inputmodules"
3870 else
3871 def_smb="#undef CONFIG_LIBSMBCLIENT"
3872 noinputmodules="smb $noinputmodules"
3874 echores "$_smb"
3877 #########
3878 # VIDEO #
3879 #########
3882 echocheck "tdfxfb"
3883 if test "$_tdfxfb" = yes ; then
3884 def_tdfxfb='#define CONFIG_TDFXFB 1'
3885 vomodules="tdfxfb $vomodules"
3886 else
3887 def_tdfxfb='#undef CONFIG_TDFXFB'
3888 novomodules="tdfxfb $novomodules"
3890 echores "$_tdfxfb"
3892 echocheck "s3fb"
3893 if test "$_s3fb" = yes ; then
3894 def_s3fb='#define CONFIG_S3FB 1'
3895 vomodules="s3fb $vomodules"
3896 else
3897 def_s3fb='#undef CONFIG_S3FB'
3898 novomodules="s3fb $novomodules"
3900 echores "$_s3fb"
3902 echocheck "wii"
3903 if test "$_wii" = yes ; then
3904 def_wii='#define CONFIG_WII 1'
3905 vomodules="wii $vomodules"
3906 else
3907 def_wii='#undef CONFIG_WII'
3908 novomodules="wii $novomodules"
3910 echores "$_wii"
3912 echocheck "tdfxvid"
3913 if test "$_tdfxvid" = yes ; then
3914 def_tdfxvid='#define CONFIG_TDFX_VID 1'
3915 vomodules="tdfx_vid $vomodules"
3916 else
3917 def_tdfxvid='#undef CONFIG_TDFX_VID'
3918 novomodules="tdfx_vid $novomodules"
3920 echores "$_tdfxvid"
3922 echocheck "xvr100"
3923 if test "$_xvr100" = auto ; then
3924 cat > $TMPC << EOF
3925 #include <unistd.h>
3926 #include <sys/fbio.h>
3927 #include <sys/visual_io.h>
3928 int main(void) {
3929 struct vis_identifier ident;
3930 struct fbgattr attr;
3931 ioctl(0, VIS_GETIDENTIFIER, &ident);
3932 ioctl(0, FBIOGATTR, &attr);
3933 return 0;
3936 _xvr100=no
3937 cc_check && _xvr100=yes
3939 if test "$_xvr100" = yes ; then
3940 def_xvr100='#define CONFIG_XVR100 1'
3941 vomodules="xvr100 $vomodules"
3942 else
3943 def_tdfxvid='#undef CONFIG_XVR100'
3944 novomodules="xvr100 $novomodules"
3946 echores "$_xvr100"
3948 echocheck "tga"
3949 if test "$_tga" = yes ; then
3950 def_tga='#define CONFIG_TGA 1'
3951 vomodules="tga $vomodules"
3952 else
3953 def_tga='#undef CONFIG_TGA'
3954 novomodules="tga $novomodules"
3956 echores "$_tga"
3959 echocheck "md5sum support"
3960 if test "$_md5sum" = yes; then
3961 def_md5sum="#define CONFIG_MD5SUM 1"
3962 vomodules="md5sum $vomodules"
3963 else
3964 def_md5sum="#undef CONFIG_MD5SUM"
3965 novomodules="md5sum $novomodules"
3967 echores "$_md5sum"
3970 echocheck "yuv4mpeg support"
3971 if test "$_yuv4mpeg" = yes; then
3972 def_yuv4mpeg="#define CONFIG_YUV4MPEG 1"
3973 vomodules="yuv4mpeg $vomodules"
3974 else
3975 def_yuv4mpeg="#undef CONFIG_YUV4MPEG"
3976 novomodules="yuv4mpeg $novomodules"
3978 echores "$_yuv4mpeg"
3981 echocheck "bl"
3982 if test "$_bl" = yes ; then
3983 def_bl='#define CONFIG_BL 1'
3984 vomodules="bl $vomodules"
3985 else
3986 def_bl='#undef CONFIG_BL'
3987 novomodules="bl $novomodules"
3989 echores "$_bl"
3992 echocheck "DirectFB"
3993 if test "$_directfb" = auto ; then
3994 _directfb=no
3995 for _inc_tmp in "" -I/usr/local/include/directfb -I/usr/include/directfb -I/usr/local/include; do
3996 function_check directfb.h "DirectFBInit(0, 0)" $_inc_tmp -ldirectfb &&
3997 _directfb=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
3998 done
4001 dfb_version() {
4002 expr $1 \* 65536 + $2 \* 256 + $3
4005 if test "$_directfb" = yes; then
4006 cat > $TMPC << EOF
4007 #include <directfb_version.h>
4009 dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION
4012 if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then
4013 _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()')
4014 _dfb_major=$(echo $_directfb_version | cut -d . -f 1)
4015 _dfb_minor=$(echo $_directfb_version | cut -d . -f 2)
4016 _dfb_micro=$(echo $_directfb_version | cut -d . -f 3)
4017 _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro)
4018 if test "$_dfb_version" -ge $(dfb_version 0 9 13); then
4019 def_directfb_version="#define DIRECTFBVERSION $_dfb_version"
4020 res_comment="$_directfb_version"
4021 test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes
4022 else
4023 def_directfb_version='#undef DIRECTFBVERSION'
4024 _directfb=no
4025 res_comment="version >=0.9.13 required"
4027 else
4028 _directfb=no
4029 res_comment="failed to get version"
4032 echores "$_directfb"
4034 if test "$_directfb" = yes ; then
4035 def_directfb='#define CONFIG_DIRECTFB 1'
4036 vomodules="directfb $vomodules"
4037 libs_mplayer="$libs_mplayer -ldirectfb"
4038 else
4039 def_directfb='#undef CONFIG_DIRECTFB'
4040 novomodules="directfb $novomodules"
4042 if test "$_dfbmga" = yes; then
4043 vomodules="dfbmga $vomodules"
4044 def_dfbmga='#define CONFIG_DFBMGA 1'
4045 else
4046 novomodules="dfbmga $novomodules"
4047 def_dfbmga='#undef CONFIG_DFBMGA'
4051 echocheck "X11 headers presence"
4052 _x11_headers="no"
4053 res_comment="check if the dev(el) packages are installed"
4054 for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
4055 if test -f "$I/X11/Xlib.h" ; then
4056 _x11_headers="yes"
4057 res_comment=""
4058 break
4060 done
4061 if test $_cross_compile = no; then
4062 for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
4063 /usr/include/X11R6 /usr/openwin/include ; do
4064 if test -f "$I/X11/Xlib.h" ; then
4065 extra_cflags="$extra_cflags -I$I"
4066 _x11_headers="yes"
4067 res_comment="using $I"
4068 break
4070 done
4072 echores "$_x11_headers"
4075 echocheck "X11"
4076 if test "$_x11" = auto && test "$_x11_headers" = yes ; then
4077 cat > $TMPC <<EOF
4078 #include <X11/Xlib.h>
4079 #include <X11/Xutil.h>
4080 int main(void) { XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); return 0; }
4082 for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
4083 -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
4084 -L/usr/lib ; do
4085 if netbsd; then
4086 _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
4087 else
4088 _ld_tmp="$I -lXext -lX11 $_ld_pthread"
4090 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \
4091 && _x11=yes && break
4092 done
4094 if test "$_x11" = yes ; then
4095 def_x11='#define CONFIG_X11 1'
4096 vomodules="x11 xover $vomodules"
4097 else
4098 _x11=no
4099 def_x11='#undef CONFIG_X11'
4100 novomodules="x11 $novomodules"
4101 res_comment="check if the dev(el) packages are installed"
4102 # disable stuff that depends on X
4103 _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no
4105 echores "$_x11"
4107 echocheck "Xss screensaver extensions"
4108 if test "$_xss" = auto ; then
4109 cat > $TMPC << EOF
4110 #include <X11/Xlib.h>
4111 #include <X11/extensions/scrnsaver.h>
4112 int main(void) { XScreenSaverSuspend(NULL, True); return 0; }
4114 _xss=no
4115 cc_check -lXss && _xss=yes
4117 if test "$_xss" = yes ; then
4118 def_xss='#define CONFIG_XSS 1'
4119 libs_mplayer="$libs_mplayer -lXss"
4120 else
4121 def_xss='#undef CONFIG_XSS'
4123 echores "$_xss"
4125 echocheck "DPMS"
4126 _xdpms3=no
4127 _xdpms4=no
4128 if test "$_x11" = yes ; then
4129 cat > $TMPC <<EOF
4130 #include <X11/Xmd.h>
4131 #include <X11/Xlib.h>
4132 #include <X11/Xutil.h>
4133 #include <X11/Xatom.h>
4134 #include <X11/extensions/dpms.h>
4135 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4137 cc_check -lXdpms && _xdpms3=yes
4138 cat > $TMPC <<EOF
4139 #include <X11/Xlib.h>
4140 #include <X11/extensions/dpms.h>
4141 int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
4143 cc_check -lXext && _xdpms4=yes
4145 if test "$_xdpms4" = yes ; then
4146 def_xdpms='#define CONFIG_XDPMS 1'
4147 res_comment="using Xdpms 4"
4148 echores "yes"
4149 elif test "$_xdpms3" = yes ; then
4150 def_xdpms='#define CONFIG_XDPMS 1'
4151 libs_mplayer="$libs_mplayer -lXdpms"
4152 res_comment="using Xdpms 3"
4153 echores "yes"
4154 else
4155 def_xdpms='#undef CONFIG_XDPMS'
4156 echores "no"
4160 echocheck "Xv"
4161 if test "$_xv" = auto ; then
4162 cat > $TMPC <<EOF
4163 #include <X11/Xlib.h>
4164 #include <X11/extensions/Xvlib.h>
4165 int main(void) {
4166 XvGetPortAttribute(0, 0, 0, 0);
4167 XvQueryPortAttributes(0, 0, 0);
4168 return 0; }
4170 _xv=no
4171 cc_check -lXv && _xv=yes
4174 if test "$_xv" = yes ; then
4175 def_xv='#define CONFIG_XV 1'
4176 libs_mplayer="$libs_mplayer -lXv"
4177 vomodules="xv $vomodules"
4178 else
4179 def_xv='#undef CONFIG_XV'
4180 novomodules="xv $novomodules"
4182 echores "$_xv"
4185 echocheck "XvMC"
4186 if test "$_xv" = yes && test "$_xvmc" != no ; then
4187 _xvmc=no
4188 cat > $TMPC <<EOF
4189 #include <X11/Xlib.h>
4190 #include <X11/extensions/Xvlib.h>
4191 #include <X11/extensions/XvMClib.h>
4192 int main(void) {
4193 XvMCQueryExtension(0, 0, 0);
4194 XvMCCreateContext(0, 0, 0, 0, 0, 0, 0);
4195 return 0; }
4197 for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do
4198 cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break
4199 done
4201 if test "$_xvmc" = yes ; then
4202 def_xvmc='#define CONFIG_XVMC 1'
4203 libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib"
4204 vomodules="xvmc $vomodules"
4205 res_comment="using $_xvmclib"
4206 else
4207 def_xvmc='#define CONFIG_XVMC 0'
4208 novomodules="xvmc $novomodules"
4210 echores "$_xvmc"
4213 echocheck "VDPAU"
4214 if test "$_vdpau" = auto ; then
4215 _vdpau=no
4216 if test "$_dl" = yes ; then
4217 cat > $TMPC <<EOF
4218 #include <vdpau/vdpau_x11.h>
4219 int main(void) {
4220 vdp_device_create_x11(0, 0, 0, 0);
4221 return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; }
4223 cc_check -lvdpau && _vdpau=yes
4226 if test "$_vdpau" = yes ; then
4227 def_vdpau='#define CONFIG_VDPAU 1'
4228 libs_mplayer="$libs_mplayer -lvdpau"
4229 vomodules="vdpau $vomodules"
4230 else
4231 def_vdpau='#define CONFIG_VDPAU 0'
4232 novomodules="vdpau $novomodules"
4234 echores "$_vdpau"
4237 echocheck "Xinerama"
4238 if test "$_xinerama" = auto ; then
4239 cat > $TMPC <<EOF
4240 #include <X11/Xlib.h>
4241 #include <X11/extensions/Xinerama.h>
4242 int main(void) { XineramaIsActive(0); return 0; }
4244 _xinerama=no
4245 cc_check -lXinerama && _xinerama=yes
4248 if test "$_xinerama" = yes ; then
4249 def_xinerama='#define CONFIG_XINERAMA 1'
4250 libs_mplayer="$libs_mplayer -lXinerama"
4251 else
4252 def_xinerama='#undef CONFIG_XINERAMA'
4254 echores "$_xinerama"
4257 # Note: the -lXxf86vm library is the VideoMode extension and though it's not
4258 # needed for DGA, AFAIK every distribution packages together with DGA stuffs
4259 # named 'X extensions' or something similar.
4260 # This check may be useful for future mplayer versions (to change resolution)
4261 # If you run into problems, remove '-lXxf86vm'.
4262 echocheck "Xxf86vm"
4263 if test "$_vm" = auto ; then
4264 cat > $TMPC <<EOF
4265 #include <X11/Xlib.h>
4266 #include <X11/extensions/xf86vmode.h>
4267 int main(void) { XF86VidModeQueryExtension(0, 0, 0); return 0; }
4269 _vm=no
4270 cc_check -lXxf86vm && _vm=yes
4272 if test "$_vm" = yes ; then
4273 def_vm='#define CONFIG_XF86VM 1'
4274 libs_mplayer="$libs_mplayer -lXxf86vm"
4275 else
4276 def_vm='#undef CONFIG_XF86VM'
4278 echores "$_vm"
4280 # Check for the presence of special keycodes, like audio control buttons
4281 # that XFree86 might have. Used to be bundled with the xf86vm check, but
4282 # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT
4283 # have these new keycodes.
4284 echocheck "XF86keysym"
4285 if test "$_xf86keysym" = auto; then
4286 _xf86keysym=no
4287 cat > $TMPC <<EOF
4288 #include <X11/Xlib.h>
4289 #include <X11/XF86keysym.h>
4290 int main(void) { return XF86XK_AudioPause; }
4292 cc_check && _xf86keysym=yes
4294 if test "$_xf86keysym" = yes ; then
4295 def_xf86keysym='#define CONFIG_XF86XK 1'
4296 else
4297 def_xf86keysym='#undef CONFIG_XF86XK'
4299 echores "$_xf86keysym"
4301 echocheck "DGA"
4302 if test "$_dga2" = auto && test "$_x11" = yes ; then
4303 cat > $TMPC << EOF
4304 #include <X11/Xlib.h>
4305 #include <X11/extensions/xf86dga.h>
4306 int main(void) { XDGASetViewport(0, 0, 0, 0, 0); return 0; }
4308 _dga2=no
4309 cc_check -lXxf86dga && _dga2=yes
4311 if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then
4312 cat > $TMPC << EOF
4313 #include <X11/Xlib.h>
4314 #include <X11/extensions/xf86dga.h>
4315 int main(void) { XF86DGASetViewPort(0, 0, 0, 0); return 0; }
4317 _dga1=no
4318 cc_check -lXxf86dga -lXxf86vm && _dga1=yes
4321 _dga=no
4322 def_dga='#undef CONFIG_DGA'
4323 def_dga1='#undef CONFIG_DGA1'
4324 def_dga2='#undef CONFIG_DGA2'
4325 if test "$_dga1" = yes ; then
4326 _dga=yes
4327 def_dga1='#define CONFIG_DGA1 1'
4328 res_comment="using DGA 1.0"
4329 elif test "$_dga2" = yes ; then
4330 _dga=yes
4331 def_dga2='#define CONFIG_DGA2 1'
4332 res_comment="using DGA 2.0"
4334 if test "$_dga" = yes ; then
4335 def_dga='#define CONFIG_DGA 1'
4336 libs_mplayer="$libs_mplayer -lXxf86dga"
4337 vomodules="dga $vomodules"
4338 else
4339 novomodules="dga $novomodules"
4341 echores "$_dga"
4344 echocheck "3dfx"
4345 if test "$_3dfx" = yes && test "$_dga" = yes ; then
4346 def_3dfx='#define CONFIG_3DFX 1'
4347 vomodules="3dfx $vomodules"
4348 else
4349 def_3dfx='#undef CONFIG_3DFX'
4350 novomodules="3dfx $novomodules"
4352 echores "$_3dfx"
4355 echocheck "VIDIX"
4356 def_vidix='#undef CONFIG_VIDIX'
4357 def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE'
4358 _vidix_drv_cyberblade=no
4359 def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV'
4360 _vidix_drv_ivtv=no
4361 def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64'
4362 _vidix_drv_mach64=no
4363 def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA'
4364 _vidix_drv_mga=no
4365 def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2'
4366 _vidix_drv_mga_crtc2=no
4367 def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA'
4368 _vidix_drv_nvidia=no
4369 def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2'
4370 _vidix_drv_pm2=no
4371 def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3'
4372 _vidix_drv_pm3=no
4373 def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON'
4374 _vidix_drv_radeon=no
4375 def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128'
4376 _vidix_drv_rage128=no
4377 def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3'
4378 _vidix_drv_s3=no
4379 def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU'
4380 _vidix_drv_sh_veu=no
4381 def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS'
4382 _vidix_drv_sis=no
4383 def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME'
4384 _vidix_drv_unichrome=no
4385 if test "$_vidix" = auto ; then
4386 _vidix=no
4387 x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \
4388 && _vidix=yes
4389 x86_64 && ! linux && _vidix=no
4390 (ppc || alpha) && linux && _vidix=yes
4392 echores "$_vidix"
4394 if test "$_vidix" = yes ; then
4395 def_vidix='#define CONFIG_VIDIX 1'
4396 vomodules="cvidix $vomodules"
4397 # FIXME: ivtv driver temporarily disabled until we have a proper test
4398 #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4399 test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
4401 # some vidix drivers are architecture and os specific, discard them elsewhere
4402 x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//)
4403 (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//)
4405 for driver in $_vidix_drivers ; do
4406 uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]')
4407 eval _vidix_drv_${driver}=yes
4408 eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\"
4409 done
4411 echocheck "VIDIX PCI device name database"
4412 echores "$_vidix_pcidb"
4413 if test "$_vidix_pcidb" = yes ; then
4414 _vidix_pcidb_val=1
4415 else
4416 _vidix_pcidb_val=0
4419 echocheck "VIDIX dhahelper support"
4420 test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER
4421 echores "$_dhahelper"
4423 echocheck "VIDIX svgalib_helper support"
4424 test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER
4425 echores "$_svgalib_helper"
4427 else
4428 novomodules="cvidix $novomodules"
4431 if test "$_vidix" = yes && win32; then
4432 winvidix=yes
4433 vomodules="winvidix $vomodules"
4434 libs_mplayer="$libs_mplayer -lgdi32"
4435 else
4436 novomodules="winvidix $novomodules"
4438 if test "$_vidix" = yes && test "$_x11" = yes; then
4439 xvidix=yes
4440 vomodules="xvidix $vomodules"
4441 else
4442 novomodules="xvidix $novomodules"
4445 echocheck "GGI"
4446 if test "$_ggi" = auto ; then
4447 _ggi=no
4448 function_check ggi/ggi.h 'ggiInit()' -lggi && _ggi=yes
4450 if test "$_ggi" = yes ; then
4451 def_ggi='#define CONFIG_GGI 1'
4452 libs_mplayer="$libs_mplayer -lggi"
4453 vomodules="ggi $vomodules"
4454 else
4455 def_ggi='#undef CONFIG_GGI'
4456 novomodules="ggi $novomodules"
4458 echores "$_ggi"
4460 echocheck "GGI extension: libggiwmh"
4461 if test "$_ggiwmh" = auto ; then
4462 _ggiwmh=no
4463 cat > $TMPC << EOF
4464 #include <ggi/wmh.h>
4465 int main(void) { ggiWmhInit(); return 0; }
4467 function_check ggi/wmh.h 'ggiWmhInit()' -lggi -lggiwmh && _ggiwmh=yes
4469 # needed to get right output on obscure combination
4470 # like --disable-ggi --enable-ggiwmh
4471 if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then
4472 def_ggiwmh='#define CONFIG_GGIWMH 1'
4473 libs_mplayer="$libs_mplayer -lggiwmh"
4474 else
4475 _ggiwmh=no
4476 def_ggiwmh='#undef CONFIG_GGIWMH'
4478 echores "$_ggiwmh"
4481 echocheck "AA"
4482 if test "$_aa" = auto ; then
4483 cat > $TMPC << EOF
4484 #include <aalib.h>
4485 int main(void) {
4486 aa_context *c;
4487 aa_renderparams *p;
4488 aa_init(0, 0, 0);
4489 c = aa_autoinit(&aa_defparams);
4490 p = aa_getrenderparams();
4491 aa_autoinitkbd(c,0);
4492 return 0; }
4494 _aa=no
4495 for _ld_tmp in "-laa" ; do
4496 cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break
4497 done
4499 if test "$_aa" = yes ; then
4500 def_aa='#define CONFIG_AA 1'
4501 if cygwin ; then
4502 libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
4504 vomodules="aa $vomodules"
4505 else
4506 def_aa='#undef CONFIG_AA'
4507 novomodules="aa $novomodules"
4509 echores "$_aa"
4512 echocheck "CACA"
4513 if test "$_caca" = auto ; then
4514 _caca=no
4515 if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
4516 cat > $TMPC << EOF
4517 #include <caca.h>
4518 #ifdef CACA_API_VERSION_1
4519 #include <caca0.h>
4520 #endif
4521 int main(void) { caca_init(); return 0; }
4523 cc_check $(caca-config --libs) && _caca=yes
4526 if test "$_caca" = yes ; then
4527 def_caca='#define CONFIG_CACA 1'
4528 extra_cflags="$extra_cflags $(caca-config --cflags)"
4529 libs_mplayer="$libs_mplayer $(caca-config --libs)"
4530 vomodules="caca $vomodules"
4531 else
4532 def_caca='#undef CONFIG_CACA'
4533 novomodules="caca $novomodules"
4535 echores "$_caca"
4538 echocheck "SVGAlib"
4539 if test "$_svga" = auto ; then
4540 _svga=no
4541 header_check vga.h -lvga $_ld_lm && _svga=yes
4543 if test "$_svga" = yes ; then
4544 def_svga='#define CONFIG_SVGALIB 1'
4545 libs_mplayer="$libs_mplayer -lvga"
4546 vomodules="svga $vomodules"
4547 else
4548 def_svga='#undef CONFIG_SVGALIB'
4549 novomodules="svga $novomodules"
4551 echores "$_svga"
4554 echocheck "FBDev"
4555 if test "$_fbdev" = auto ; then
4556 _fbdev=no
4557 linux && _fbdev=yes
4559 if test "$_fbdev" = yes ; then
4560 def_fbdev='#define CONFIG_FBDEV 1'
4561 vomodules="fbdev $vomodules"
4562 else
4563 def_fbdev='#undef CONFIG_FBDEV'
4564 novomodules="fbdev $novomodules"
4566 echores "$_fbdev"
4570 echocheck "DVB"
4571 if test "$_dvb" = auto ; then
4572 _dvb=no
4573 cat >$TMPC << EOF
4574 #include <poll.h>
4575 #include <sys/ioctl.h>
4576 #include <stdio.h>
4577 #include <time.h>
4578 #include <unistd.h>
4579 #include <linux/dvb/dmx.h>
4580 #include <linux/dvb/frontend.h>
4581 #include <linux/dvb/video.h>
4582 #include <linux/dvb/audio.h>
4583 int main(void) {return 0;}
4585 for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
4586 cc_check $_inc_tmp && _dvb=yes && \
4587 extra_cflags="$extra_cflags $_inc_tmp" && break
4588 done
4590 echores "$_dvb"
4591 if test "$_dvb" = yes ; then
4592 _dvbin=yes
4593 inputmodules="dvb $inputmodules"
4594 def_dvb='#define CONFIG_DVB 1'
4595 def_dvbin='#define CONFIG_DVBIN 1'
4596 aomodules="mpegpes(dvb) $aomodules"
4597 vomodules="mpegpes(dvb) $vomodules"
4598 else
4599 _dvbin=no
4600 noinputmodules="dvb $noinputmodules"
4601 def_dvb='#undef CONFIG_DVB'
4602 def_dvbin='#undef CONFIG_DVBIN '
4603 aomodules="mpegpes(file) $aomodules"
4604 vomodules="mpegpes(file) $vomodules"
4608 if darwin; then
4610 echocheck "QuickTime"
4611 if test "$quicktime" = auto ; then
4612 cat > $TMPC <<EOF
4613 #include <QuickTime/QuickTime.h>
4614 int main(void) {
4615 ImageDescription *desc;
4616 EnterMovies();
4617 ExitMovies();
4618 return 0;
4621 quicktime=no
4622 cc_check -framework QuickTime && quicktime=yes
4624 if test "$quicktime" = yes ; then
4625 extra_ldflags="$extra_ldflags -framework QuickTime"
4626 def_quicktime='#define CONFIG_QUICKTIME 1'
4627 else
4628 def_quicktime='#undef CONFIG_QUICKTIME'
4629 _quartz=no
4631 echores $quicktime
4633 echocheck "Quartz"
4634 if test "$_quartz" = auto ; then
4635 _quartz=no
4636 function_check Carbon/Carbon.h 'CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false)' -framework Carbon && _quartz=yes
4638 if test "$_quartz" = yes ; then
4639 libs_mplayer="$libs_mplayer -framework Carbon"
4640 def_quartz='#define CONFIG_QUARTZ 1'
4641 vomodules="quartz $vomodules"
4642 else
4643 def_quartz='#undef CONFIG_QUARTZ'
4644 novomodules="quartz $novomodules"
4646 echores $_quartz
4648 echocheck "CoreVideo"
4649 if test "$_corevideo" = auto ; then
4650 cat > $TMPC <<EOF
4651 #include <Carbon/Carbon.h>
4652 #include <CoreServices/CoreServices.h>
4653 #include <OpenGL/OpenGL.h>
4654 #include <QuartzCore/CoreVideo.h>
4655 int main(void) { return 0; }
4657 _corevideo=no
4658 cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
4660 if test "$_corevideo" = yes ; then
4661 vomodules="corevideo $vomodules"
4662 libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL"
4663 def_corevideo='#define CONFIG_COREVIDEO 1'
4664 else
4665 novomodules="corevideo $novomodules"
4666 def_corevideo='#undef CONFIG_COREVIDEO'
4668 echores "$_corevideo"
4670 fi #if darwin
4673 echocheck "PNG support"
4674 if test "$_png" = auto ; then
4675 _png=no
4676 if irix ; then
4677 # Don't check for -lpng on irix since it has its own libpng
4678 # incompatible with the GNU libpng
4679 res_comment="disabled on irix (not GNU libpng)"
4680 else
4681 cat > $TMPC << EOF
4682 #include <png.h>
4683 #include <string.h>
4684 int main(void) {
4685 printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
4686 printf("libpng: %s\n", png_libpng_ver);
4687 return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
4690 cc_check -lpng -lz $_ld_lm && _png=yes
4693 echores "$_png"
4694 if test "$_png" = yes ; then
4695 def_png='#define CONFIG_PNG 1'
4696 extra_ldflags="$extra_ldflags -lpng -lz"
4697 else
4698 def_png='#undef CONFIG_PNG'
4701 echocheck "MNG support"
4702 if test "$_mng" = auto ; then
4703 _mng=no
4704 cat > $TMPC << EOF
4705 #include <libmng.h>
4706 int main(void) {
4707 const char * p_ver = mng_version_text();
4708 return !p_ver || p_ver[0] == 0;
4711 if cc_check -lmng -lz $_ld_lm ; then
4712 _mng=yes
4715 echores "$_mng"
4716 if test "$_mng" = yes ; then
4717 def_mng='#define CONFIG_MNG 1'
4718 extra_ldflags="$extra_ldflags -lmng -lz"
4719 else
4720 def_mng='#undef CONFIG_MNG'
4723 echocheck "JPEG support"
4724 if test "$_jpeg" = auto ; then
4725 _jpeg=no
4726 cat > $TMPC << EOF
4727 #include <stdio.h>
4728 #include <stdlib.h>
4729 #include <setjmp.h>
4730 #include <string.h>
4731 #include <jpeglib.h>
4732 int main(void) { return 0; }
4734 cc_check -ljpeg $_ld_lm && _jpeg=yes
4736 echores "$_jpeg"
4738 if test "$_jpeg" = yes ; then
4739 def_jpeg='#define CONFIG_JPEG 1'
4740 vomodules="jpeg $vomodules"
4741 extra_ldflags="$extra_ldflags -ljpeg"
4742 else
4743 def_jpeg='#undef CONFIG_JPEG'
4744 novomodules="jpeg $novomodules"
4749 echocheck "PNM support"
4750 if test "$_pnm" = yes; then
4751 def_pnm="#define CONFIG_PNM 1"
4752 vomodules="pnm $vomodules"
4753 else
4754 def_pnm="#undef CONFIG_PNM"
4755 novomodules="pnm $novomodules"
4757 echores "$_pnm"
4761 echocheck "GIF support"
4762 # This is to appease people who want to force gif support.
4763 # If it is forced to yes, then we still do checks to determine
4764 # which gif library to use.
4765 if test "$_gif" = yes ; then
4766 _force_gif=yes
4767 _gif=auto
4770 if test "$_gif" = auto ; then
4771 _gif=no
4772 for _ld_gif in "-lungif" "-lgif" ; do
4773 function_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
4774 done
4777 # If no library was found, and the user wants support forced,
4778 # then we force it on with libgif, as this is the safest
4779 # assumption IMHO. (libungif & libregif both create symbolic
4780 # links to libgif. We also assume that no x11 support is needed,
4781 # because if you are forcing this, then you _should_ know what
4782 # you are doing. [ Besides, package maintainers should never
4783 # have compiled x11 deps into libungif in the first place. ] )
4784 # </rant>
4785 # --Joey
4786 if test "$_force_gif" = yes && test "$_gif" = no ; then
4787 _gif=yes
4788 _ld_gif="-lgif"
4791 if test "$_gif" = yes ; then
4792 def_gif='#define CONFIG_GIF 1'
4793 codecmodules="gif $codecmodules"
4794 vomodules="gif89a $vomodules"
4795 res_comment="old version, some encoding functions disabled"
4796 def_gif_4='#undef CONFIG_GIF_4'
4797 extra_ldflags="$extra_ldflags $_ld_gif"
4799 cat > $TMPC << EOF
4800 #include <signal.h>
4801 #include <stdio.h>
4802 #include <stdlib.h>
4803 #include <gif_lib.h>
4804 static void catch(int sig) { exit(1); }
4805 int main(void) {
4806 signal(SIGSEGV, catch); // catch segfault
4807 printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
4808 EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
4809 return 0;
4812 if cc_check "$_ld_gif" ; then
4813 def_gif_4='#define CONFIG_GIF_4 1'
4814 res_comment=""
4816 else
4817 def_gif='#undef CONFIG_GIF'
4818 def_gif_4='#undef CONFIG_GIF_4'
4819 novomodules="gif89a $novomodules"
4820 nocodecmodules="gif $nocodecmodules"
4822 echores "$_gif"
4825 case "$_gif" in yes*)
4826 echocheck "broken giflib workaround"
4827 def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
4829 cat > $TMPC << EOF
4830 #include <stdio.h>
4831 #include <gif_lib.h>
4832 int main(void) {
4833 GifFileType gif = {.UserData = NULL};
4834 printf("UserData is at address %p\n", gif.UserData);
4835 return 0;
4838 if cc_check "$_ld_gif" ; then
4839 def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
4840 echores "disabled"
4841 else
4842 echores "enabled"
4845 esac
4848 echocheck "VESA support"
4849 if test "$_vesa" = auto ; then
4850 _vesa=no
4851 function_check vbe.h 'vbeVersion()' -lvbe -llrmi && _vesa=yes
4853 if test "$_vesa" = yes ; then
4854 def_vesa='#define CONFIG_VESA 1'
4855 libs_mplayer="$libs_mplayer -lvbe -llrmi"
4856 vomodules="vesa $vomodules"
4857 else
4858 def_vesa='#undef CONFIG_VESA'
4859 novomodules="vesa $novomodules"
4861 echores "$_vesa"
4863 #################
4864 # VIDEO + AUDIO #
4865 #################
4868 echocheck "SDL"
4869 _inc_tmp=""
4870 _ld_tmp=""
4871 def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H"
4872 if test -z "$_sdlconfig" ; then
4873 if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then
4874 _sdlconfig="sdl-config"
4875 elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then
4876 _sdlconfig="sdl11-config"
4877 else
4878 _sdlconfig=false
4881 if test "$_sdl" = auto || test "$_sdl" = yes ; then
4882 cat > $TMPC << EOF
4883 #ifdef CONFIG_SDL_SDL_H
4884 #include <SDL/SDL.h>
4885 #else
4886 #include <SDL.h>
4887 #endif
4888 #ifndef __APPLE__
4889 // we allow SDL hacking our main() only on OSX
4890 #undef main
4891 #endif
4892 int main(int argc, char *argv[]) {
4893 SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
4894 return 0;
4897 _sdl=no
4898 for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do
4899 if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then
4900 _sdl=yes
4901 def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1"
4902 break
4904 done
4905 if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
4906 res_comment="using $_sdlconfig"
4907 if cygwin ; then
4908 _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)"
4909 _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)"
4910 elif mingw32 ; then
4911 _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//)
4912 _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//)
4913 else
4914 _inc_tmp="$($_sdlconfig --cflags)"
4915 _ld_tmp="$($_sdlconfig --libs)"
4917 if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then
4918 _sdl=yes
4919 elif cc_check $_inc_tmp $_ld_tmp -lstdc++ >>"$TMPLOG" 2>&1 ; then
4920 # HACK for BeOS/Haiku SDL
4921 _ld_tmp="$_ld_tmp -lstdc++"
4922 _sdl=yes
4926 if test "$_sdl" = yes ; then
4927 def_sdl='#define CONFIG_SDL 1'
4928 extra_cflags="$extra_cflags $_inc_tmp"
4929 libs_mplayer="$libs_mplayer $_ld_tmp"
4930 vomodules="sdl $vomodules"
4931 aomodules="sdl $aomodules"
4932 else
4933 def_sdl='#undef CONFIG_SDL'
4934 novomodules="sdl $novomodules"
4935 noaomodules="sdl $noaomodules"
4937 echores "$_sdl"
4940 # make sure this stays below CoreVideo to avoid issues due to namespace
4941 # conflicts between -lGL and -framework OpenGL
4942 echocheck "OpenGL"
4943 #Note: this test is run even with --enable-gl since we autodetect linker flags
4944 if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
4945 cat > $TMPC << EOF
4946 #ifdef GL_WIN32
4947 #include <windows.h>
4948 #include <GL/gl.h>
4949 #elif defined(GL_SDL)
4950 #include <GL/gl.h>
4951 #ifdef CONFIG_SDL_SDL_H
4952 #include <SDL/SDL.h>
4953 #else
4954 #include <SDL.h>
4955 #endif
4956 #ifndef __APPLE__
4957 // we allow SDL hacking our main() only on OSX
4958 #undef main
4959 #endif
4960 #else
4961 #include <GL/gl.h>
4962 #include <X11/Xlib.h>
4963 #include <GL/glx.h>
4964 #endif
4965 int main(int argc, char *argv[]) {
4966 #ifdef GL_WIN32
4967 HDC dc;
4968 wglCreateContext(dc);
4969 #elif defined(GL_SDL)
4970 SDL_GL_SwapBuffers();
4971 #else
4972 glXCreateContext(NULL, NULL, NULL, True);
4973 #endif
4974 glFinish();
4975 return 0;
4978 _gl=no
4979 for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
4980 if cc_check $_ld_tmp $_ld_lm ; then
4981 _gl=yes
4982 _gl_x11=yes
4983 libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
4984 break
4986 done
4987 if cc_check -DGL_WIN32 -lopengl32 ; then
4988 _gl=yes
4989 _gl_win32=yes
4990 libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
4992 # last so it can reuse any linker etc. flags detected before
4993 if test "$_sdl" = yes ; then
4994 if cc_check -DGL_SDL ||
4995 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL ; then
4996 _gl=yes
4997 _gl_sdl=yes
4998 elif cc_check -DGL_SDL -lGL ||
4999 cc_check -DCONFIG_SDL_SDL_H -DGL_SDL -lGL ; then
5000 _gl=yes
5001 _gl_sdl=yes
5002 libs_mplayer="$libs_mplayer -lGL"
5005 else
5006 _gl=no
5008 if test "$_gl" = yes ; then
5009 def_gl='#define CONFIG_GL 1'
5010 res_comment="backends:"
5011 if test "$_gl_win32" = yes ; then
5012 def_gl_win32='#define CONFIG_GL_WIN32 1'
5013 res_comment="$res_comment win32"
5015 if test "$_gl_x11" = yes ; then
5016 def_gl_x11='#define CONFIG_GL_X11 1'
5017 res_comment="$res_comment x11"
5019 if test "$_gl_sdl" = yes ; then
5020 def_gl_sdl='#define CONFIG_GL_SDL 1'
5021 res_comment="$res_comment sdl"
5023 vomodules="opengl $vomodules"
5024 else
5025 def_gl='#undef CONFIG_GL'
5026 def_gl_win32='#undef CONFIG_GL_WIN32'
5027 def_gl_x11='#undef CONFIG_GL_X11'
5028 def_gl_sdl='#undef CONFIG_GL_SDL'
5029 novomodules="opengl $novomodules"
5031 echores "$_gl"
5034 echocheck "MatrixView"
5035 if test "$_gl" = no ; then
5036 matrixview=no
5038 if test "$matrixview" = yes ; then
5039 vomodules="matrixview $vomodules"
5040 def_matrixview='#define CONFIG_MATRIXVIEW 1'
5041 else
5042 novomodules="matrixview $novomodules"
5043 def_matrixview='#undef CONFIG_MATRIXVIEW'
5045 echores "$matrixview"
5048 if os2 ; then
5049 echocheck "KVA (SNAP/WarpOverlay!/DIVE)"
5050 if test "$_kva" = auto; then
5051 cat > $TMPC << EOF
5052 #include <os2.h>
5053 #include <kva.h>
5054 int main(void) { return 0; }
5056 _kva=no;
5057 cc_check -lkva && _kva=yes
5059 if test "$_kva" = yes ; then
5060 def_kva='#define CONFIG_KVA 1'
5061 libs_mplayer="$libs_mplayer -lkva"
5062 vomodules="kva $vomodules"
5063 else
5064 def_kva='#undef CONFIG_KVA'
5065 novomodules="kva $novomodules"
5067 echores "$_kva"
5068 fi #if os2
5071 if win32; then
5073 echocheck "Windows waveout"
5074 if test "$_win32waveout" = auto ; then
5075 cat > $TMPC << EOF
5076 #include <windows.h>
5077 #include <mmsystem.h>
5078 int main(void) { return 0; }
5080 _win32waveout=no
5081 cc_check -lwinmm && _win32waveout=yes
5083 if test "$_win32waveout" = yes ; then
5084 def_win32waveout='#define CONFIG_WIN32WAVEOUT 1'
5085 libs_mplayer="$libs_mplayer -lwinmm"
5086 aomodules="win32 $aomodules"
5087 else
5088 def_win32waveout='#undef CONFIG_WIN32WAVEOUT'
5089 noaomodules="win32 $noaomodules"
5091 echores "$_win32waveout"
5093 echocheck "Direct3D"
5094 if test "$_direct3d" = auto ; then
5095 cat > $TMPC << EOF
5096 #include <windows.h>
5097 #include <d3d9.h>
5098 int main(void) { return 0; }
5100 _direct3d=no
5101 cc_check && _direct3d=yes
5103 if test "$_direct3d" = yes ; then
5104 def_direct3d='#define CONFIG_DIRECT3D 1'
5105 vomodules="direct3d $vomodules"
5106 else
5107 def_direct3d='#undef CONFIG_DIRECT3D'
5108 novomodules="direct3d $novomodules"
5110 echores "$_direct3d"
5112 echocheck "Directx"
5113 if test "$_directx" = auto ; then
5114 cat > $TMPC << EOF
5115 #include <windows.h>
5116 #include <ddraw.h>
5117 #include <dsound.h>
5118 int main(void) { return 0; }
5120 _directx=no
5121 cc_check -lgdi32 && _directx=yes
5123 if test "$_directx" = yes ; then
5124 def_directx='#define CONFIG_DIRECTX 1'
5125 libs_mplayer="$libs_mplayer -lgdi32"
5126 vomodules="directx $vomodules"
5127 aomodules="dsound $aomodules"
5128 else
5129 def_directx='#undef CONFIG_DIRECTX'
5130 novomodules="directx $novomodules"
5131 noaomodules="dsound $noaomodules"
5133 echores "$_directx"
5135 fi #if win32; then
5138 echocheck "DXR2"
5139 if test "$_dxr2" = auto; then
5140 _dxr2=no
5141 for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do
5142 header_check dxr2ioctl.h $_inc_tmp && _dxr2=yes &&
5143 extra_cflags="$extra_cflags $_inc_tmp" && break
5144 done
5146 if test "$_dxr2" = yes; then
5147 def_dxr2='#define CONFIG_DXR2 1'
5148 aomodules="dxr2 $aomodules"
5149 vomodules="dxr2 $vomodules"
5150 else
5151 def_dxr2='#undef CONFIG_DXR2'
5152 noaomodules="dxr2 $noaomodules"
5153 novomodules="dxr2 $novomodules"
5155 echores "$_dxr2"
5157 echocheck "DXR3/H+"
5158 if test "$_dxr3" = auto ; then
5159 _dxr3=no
5160 header_check linux/em8300.h && _dxr3=yes
5162 if test "$_dxr3" = yes ; then
5163 def_dxr3='#define CONFIG_DXR3 1'
5164 vomodules="dxr3 $vomodules"
5165 else
5166 def_dxr3='#undef CONFIG_DXR3'
5167 novomodules="dxr3 $novomodules"
5169 echores "$_dxr3"
5172 echocheck "IVTV TV-Out (pre linux-2.6.24)"
5173 if test "$_ivtv" = auto ; then
5174 cat > $TMPC << EOF
5175 #include <stdlib.h>
5176 #include <inttypes.h>
5177 #include <linux/types.h>
5178 #include <linux/videodev2.h>
5179 #include <linux/ivtv.h>
5180 #include <sys/ioctl.h>
5181 int main(void) {
5182 struct ivtv_cfg_stop_decode sd;
5183 struct ivtv_cfg_start_decode sd1;
5184 ioctl(0, IVTV_IOC_START_DECODE, &sd1);
5185 ioctl(0, IVTV_IOC_STOP_DECODE, &sd);
5186 return 0; }
5188 _ivtv=no
5189 cc_check && _ivtv=yes
5191 if test "$_ivtv" = yes ; then
5192 def_ivtv='#define CONFIG_IVTV 1'
5193 vomodules="ivtv $vomodules"
5194 aomodules="ivtv $aomodules"
5195 else
5196 def_ivtv='#undef CONFIG_IVTV'
5197 novomodules="ivtv $novomodules"
5198 noaomodules="ivtv $noaomodules"
5200 echores "$_ivtv"
5203 echocheck "V4L2 MPEG Decoder"
5204 if test "$_v4l2" = auto ; then
5205 cat > $TMPC << EOF
5206 #include <stdlib.h>
5207 #include <inttypes.h>
5208 #include <linux/types.h>
5209 #include <linux/videodev2.h>
5210 #include <linux/version.h>
5211 int main(void) {
5212 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
5213 #error kernel headers too old, need 2.6.22
5214 #endif
5215 struct v4l2_ext_controls ctrls;
5216 ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG;
5217 return 0;
5220 _v4l2=no
5221 cc_check && _v4l2=yes
5223 if test "$_v4l2" = yes ; then
5224 def_v4l2='#define CONFIG_V4L2_DECODER 1'
5225 vomodules="v4l2 $vomodules"
5226 aomodules="v4l2 $aomodules"
5227 else
5228 def_v4l2='#undef CONFIG_V4L2_DECODER'
5229 novomodules="v4l2 $novomodules"
5230 noaomodules="v4l2 $noaomodules"
5232 echores "$_v4l2"
5236 #########
5237 # AUDIO #
5238 #########
5241 echocheck "OSS Audio"
5242 if test "$_ossaudio" = auto ; then
5243 cat > $TMPC << EOF
5244 #include <sys/ioctl.h>
5245 #include <$_soundcard_header>
5246 int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; }
5248 _ossaudio=no
5249 cc_check && _ossaudio=yes
5251 if test "$_ossaudio" = yes ; then
5252 def_ossaudio='#define CONFIG_OSS_AUDIO 1'
5253 aomodules="oss $aomodules"
5254 cat > $TMPC << EOF
5255 #include <sys/ioctl.h>
5256 #include <$_soundcard_header>
5257 #ifdef OPEN_SOUND_SYSTEM
5258 int main(void) { return 0; }
5259 #else
5260 #error Not the real thing
5261 #endif
5263 _real_ossaudio=no
5264 cc_check && _real_ossaudio=yes
5265 if test "$_real_ossaudio" = yes; then
5266 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5267 # Check for OSS4 headers (override default headers)
5268 # Does not apply to systems where OSS4 is native (e.g. FreeBSD)
5269 if test -f /etc/oss.conf; then
5270 . /etc/oss.conf
5271 _ossinc="$OSSLIBDIR/include"
5272 if test -f "$_ossinc/sys/soundcard.h"; then
5273 extra_cflags="-I$_ossinc $extra_cflags"
5276 elif netbsd || openbsd ; then
5277 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
5278 extra_ldflags="$extra_ldflags -lossaudio"
5279 else
5280 def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
5282 def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
5283 else
5284 def_ossaudio='#undef CONFIG_OSS_AUDIO'
5285 def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
5286 def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
5287 noaomodules="oss $noaomodules"
5289 echores "$_ossaudio"
5292 echocheck "aRts"
5293 if test "$_arts" = auto ; then
5294 _arts=no
5295 if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
5296 function_check artsc.h "arts_init()" $(artsc-config --libs) $(artsc-config --cflags) &&
5297 _arts=yes
5301 if test "$_arts" = yes ; then
5302 def_arts='#define CONFIG_ARTS 1'
5303 aomodules="arts $aomodules"
5304 libs_mplayer="$libs_mplayer $(artsc-config --libs)"
5305 extra_cflags="$extra_cflags $(artsc-config --cflags)"
5306 else
5307 noaomodules="arts $noaomodules"
5309 echores "$_arts"
5312 echocheck "EsounD"
5313 if test "$_esd" = auto ; then
5314 _esd=no
5315 if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
5317 cat > $TMPC << EOF
5318 #include <esd.h>
5319 int main(void) { int fd = esd_open_sound("test"); return fd; }
5321 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes
5325 echores "$_esd"
5327 if test "$_esd" = yes ; then
5328 def_esd='#define CONFIG_ESD 1'
5329 aomodules="esd $aomodules"
5330 libs_mplayer="$libs_mplayer $(esd-config --libs)"
5331 extra_cflags="$extra_cflags $(esd-config --cflags)"
5333 echocheck "esd_get_latency()"
5334 cat > $TMPC << EOF
5335 #include <esd.h>
5336 int main(void) { return esd_get_latency(0); }
5338 cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1'
5339 echores "$_esd_latency"
5340 else
5341 def_esd='#undef CONFIG_ESD'
5342 def_esd_latency='#undef CONFIG_ESD_LATENCY'
5343 noaomodules="esd $noaomodules"
5347 echocheck "NAS"
5348 if test "$_nas" = auto ; then
5349 _nas=no
5350 header_check audio/audiolib.h $_ld_lm -laudio -lXt && _nas=yes
5352 if test "$_nas" = yes ; then
5353 def_nas='#define CONFIG_NAS 1'
5354 libs_mplayer="$libs_mplayer -laudio -lXt"
5355 aomodules="nas $aomodules"
5356 else
5357 noaomodules="nas $noaomodules"
5358 def_nas='#undef CONFIG_NAS'
5360 echores "$_nas"
5363 echocheck "pulse"
5364 if test "$_pulse" = auto ; then
5365 _pulse=no
5366 if $_pkg_config --exists 'libpulse >= 0.9' ; then
5367 header_check pulse/pulseaudio.h $($_pkg_config --libs --cflags libpulse) &&
5368 _pulse=yes
5371 echores "$_pulse"
5373 if test "$_pulse" = yes ; then
5374 def_pulse='#define CONFIG_PULSE 1'
5375 aomodules="pulse $aomodules"
5376 libs_mplayer="$libs_mplayer $($_pkg_config --libs libpulse)"
5377 extra_cflags="$extra_cflags $($_pkg_config --cflags libpulse)"
5378 else
5379 def_pulse='#undef CONFIG_PULSE'
5380 noaomodules="pulse $noaomodules"
5384 echocheck "JACK"
5385 if test "$_jack" = auto ; then
5386 _jack=yes
5387 if function_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' -ljack ; then
5388 libs_mplayer="$libs_mplayer -ljack"
5389 elif function_check jack/jack.h 'jack_client_open("test", JackUseExactName, NULL)' $($_pkg_config --libs --cflags --silence-errors jack) ; then
5390 libs_mplayer="$libs_mplayer $($_pkg_config --libs jack)"
5391 extra_cflags="$extra_cflags "$($_pkg_config --cflags jack)""
5392 else
5393 _jack=no
5397 if test "$_jack" = yes ; then
5398 def_jack='#define CONFIG_JACK 1'
5399 aomodules="jack $aomodules"
5400 else
5401 noaomodules="jack $noaomodules"
5403 echores "$_jack"
5405 echocheck "OpenAL"
5406 if test "$_openal" = auto ; then
5407 _openal=no
5408 cat > $TMPC << EOF
5409 #ifdef OPENAL_AL_H
5410 #include <OpenAL/al.h>
5411 #else
5412 #include <AL/al.h>
5413 #endif
5414 int main(void) {
5415 alSourceQueueBuffers(0, 0, 0);
5416 // alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
5417 return 0;
5420 for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
5421 cc_check $I && _openal=yes && break
5422 cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
5423 done
5424 test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
5426 if test "$_openal" = yes ; then
5427 def_openal='#define CONFIG_OPENAL 1'
5428 aomodules="openal $aomodules"
5429 else
5430 noaomodules="openal $noaomodules"
5432 echores "$_openal"
5434 echocheck "ALSA audio"
5435 if test "$_alloca" != yes ; then
5436 _alsa=no
5437 res_comment="alloca missing"
5439 if test "$_alsa" != no ; then
5440 _alsa=no
5441 cat > $TMPC << EOF
5442 #include <sys/asoundlib.h>
5443 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 5))
5444 #error "alsa version != 0.5.x"
5445 #endif
5446 int main(void) { return 0; }
5448 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.5.x'
5450 cat > $TMPC << EOF
5451 #include <sys/asoundlib.h>
5452 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5453 #error "alsa version != 0.9.x"
5454 #endif
5455 int main(void) { return 0; }
5457 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-sys'
5458 cat > $TMPC << EOF
5459 #include <alsa/asoundlib.h>
5460 #if !((SND_LIB_MAJOR == 0) && (SND_LIB_MINOR == 9))
5461 #error "alsa version != 0.9.x"
5462 #endif
5463 int main(void) { return 0; }
5465 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='0.9.x-alsa'
5467 cat > $TMPC << EOF
5468 #include <sys/asoundlib.h>
5469 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5470 #error "alsa version != 1.0.x"
5471 #endif
5472 int main(void) { return 0; }
5474 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-sys'
5475 cat > $TMPC << EOF
5476 #include <alsa/asoundlib.h>
5477 #if !((SND_LIB_MAJOR == 1) && (SND_LIB_MINOR == 0))
5478 #error "alsa version != 1.0.x"
5479 #endif
5480 int main(void) { return 0; }
5482 cc_check -lasound $_ld_dl $_ld_pthread && _alsaver='1.0.x-alsa'
5484 def_alsa='#undef CONFIG_ALSA'
5485 def_alsa5='#undef CONFIG_ALSA5'
5486 def_alsa9='#undef CONFIG_ALSA9'
5487 def_alsa1x='#undef CONFIG_ALSA1X'
5488 def_sys_asoundlib_h='#undef HAVE_SYS_ASOUNDLIB_H'
5489 def_alsa_asoundlib_h='#undef HAVE_ALSA_ASOUNDLIB_H'
5490 if test "$_alsaver" ; then
5491 _alsa=yes
5492 if test "$_alsaver" = '0.5.x' ; then
5493 _alsa5=yes
5494 aomodules="alsa5 $aomodules"
5495 def_alsa5='#define CONFIG_ALSA5 1'
5496 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5497 res_comment="using alsa 0.5.x and sys/asoundlib.h"
5498 elif test "$_alsaver" = '0.9.x-sys' ; then
5499 _alsa9=yes
5500 aomodules="alsa $aomodules"
5501 def_alsa='#define CONFIG_ALSA 1'
5502 def_alsa9='#define CONFIG_ALSA9 1'
5503 def_sys_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5504 res_comment="using alsa 0.9.x and sys/asoundlib.h"
5505 elif test "$_alsaver" = '0.9.x-alsa' ; then
5506 _alsa9=yes
5507 aomodules="alsa $aomodules"
5508 def_alsa='#define CONFIG_ALSA 1'
5509 def_alsa9='#define CONFIG_ALSA9 1'
5510 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5511 res_comment="using alsa 0.9.x and alsa/asoundlib.h"
5512 elif test "$_alsaver" = '1.0.x-sys' ; then
5513 _alsa1x=yes
5514 aomodules="alsa $aomodules"
5515 def_alsa='#define CONFIG_ALSA 1'
5516 def_alsa1x="#define CONFIG_ALSA1X 1"
5517 def_alsa_asoundlib_h='#define HAVE_SYS_ASOUNDLIB_H 1'
5518 res_comment="using alsa 1.0.x and sys/asoundlib.h"
5519 elif test "$_alsaver" = '1.0.x-alsa' ; then
5520 _alsa1x=yes
5521 aomodules="alsa $aomodules"
5522 def_alsa='#define CONFIG_ALSA 1'
5523 def_alsa1x="#define CONFIG_ALSA1X 1"
5524 def_alsa_asoundlib_h='#define HAVE_ALSA_ASOUNDLIB_H 1'
5525 res_comment="using alsa 1.0.x and alsa/asoundlib.h"
5526 else
5527 _alsa=no
5528 res_comment="unknown version"
5530 extra_ldflags="$extra_ldflags -lasound $_ld_dl $_ld_pthread"
5531 else
5532 noaomodules="alsa $noaomodules"
5534 echores "$_alsa"
5537 echocheck "Sun audio"
5538 if test "$_sunaudio" = auto ; then
5539 cat > $TMPC << EOF
5540 #include <sys/types.h>
5541 #include <sys/audioio.h>
5542 int main(void) { audio_info_t info; AUDIO_INITINFO(&info); return 0; }
5544 _sunaudio=no
5545 cc_check && _sunaudio=yes
5547 if test "$_sunaudio" = yes ; then
5548 def_sunaudio='#define CONFIG_SUN_AUDIO 1'
5549 aomodules="sun $aomodules"
5550 else
5551 def_sunaudio='#undef CONFIG_SUN_AUDIO'
5552 noaomodules="sun $noaomodules"
5554 echores "$_sunaudio"
5557 def_mlib='#define CONFIG_MLIB 0'
5558 if sunos; then
5559 echocheck "Sun mediaLib"
5560 if test "$_mlib" = auto ; then
5561 _mlib=no
5562 cc_check mlib.h "mlib_VideoColorYUV2ABGR420(0, 0, 0, 0, 0, 0, 0, 0, 0)" -lmlib &&
5563 _mlib=yes && def_mlib='#define CONFIG_MLIB 1'
5565 echores "$_mlib"
5566 fi #if sunos
5569 if darwin; then
5570 echocheck "CoreAudio"
5571 if test "$_coreaudio" = auto ; then
5572 cat > $TMPC <<EOF
5573 #include <CoreAudio/CoreAudio.h>
5574 #include <AudioToolbox/AudioToolbox.h>
5575 #include <AudioUnit/AudioUnit.h>
5576 int main(void) { return 0; }
5578 _coreaudio=no
5579 cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
5581 if test "$_coreaudio" = yes ; then
5582 libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
5583 def_coreaudio='#define CONFIG_COREAUDIO 1'
5584 aomodules="coreaudio $aomodules"
5585 else
5586 def_coreaudio='#undef CONFIG_COREAUDIO'
5587 noaomodules="coreaudio $noaomodules"
5589 echores $_coreaudio
5590 fi #if darwin
5593 if irix; then
5594 echocheck "SGI audio"
5595 if test "$_sgiaudio" = auto ; then
5596 _sgiaudio=no
5597 header_check dmedia/audio.h && _sgiaudio=yes
5599 if test "$_sgiaudio" = "yes" ; then
5600 def_sgiaudio='#define CONFIG_SGI_AUDIO 1'
5601 libs_mplayer="$libs_mplayer -laudio"
5602 aomodules="sgi $aomodules"
5603 else
5604 def_sgiaudio='#undef CONFIG_SGI_AUDIO'
5605 noaomodules="sgi $noaomodules"
5607 echores "$_sgiaudio"
5608 fi #if irix
5611 if os2 ; then
5612 echocheck "KAI (UNIAUD/DART)"
5613 if test "$_kai" = auto; then
5614 cat > $TMPC << EOF
5615 #include <os2.h>
5616 #include <kai.h>
5617 int main(void) { return 0; }
5619 _kai=no;
5620 cc_check -lkai && _kai=yes
5622 if test "$_kai" = yes ; then
5623 def_kai='#define CONFIG_KAI 1'
5624 libs_mplayer="$libs_mplayer -lkai"
5625 aomodules="kai $aomodules"
5626 else
5627 def_kai='#undef CONFIG_KAI'
5628 noaomodules="kai $noaomodules"
5630 echores "$_kai"
5632 echocheck "DART"
5633 if test "$_dart" = auto; then
5634 cat > $TMPC << EOF
5635 #include <os2.h>
5636 #include <dart.h>
5637 int main(void) { return 0; }
5639 _dart=no;
5640 cc_check -ldart && _dart=yes
5642 if test "$_dart" = yes ; then
5643 def_dart='#define CONFIG_DART 1'
5644 libs_mplayer="$libs_mplayer -ldart"
5645 aomodules="dart $aomodules"
5646 else
5647 def_dart='#undef CONFIG_DART'
5648 noaomodules="dart $noaomodules"
5650 echores "$_dart"
5651 fi #if os2
5654 # set default CD/DVD devices
5655 if win32 || os2 ; then
5656 default_cdrom_device="D:"
5657 elif darwin ; then
5658 default_cdrom_device="/dev/disk1"
5659 elif dragonfly ; then
5660 default_cdrom_device="/dev/cd0"
5661 elif freebsd ; then
5662 default_cdrom_device="/dev/acd0"
5663 elif openbsd ; then
5664 default_cdrom_device="/dev/rcd0c"
5665 elif sunos ; then
5666 default_cdrom_device="/vol/dev/aliases/cdrom0"
5667 # Modern Solaris versions use HAL instead of the vold daemon, the volfs
5668 # file system and the volfs service.
5669 test -r "/cdrom/cdrom0" && default_cdrom_device="/cdrom/cdrom0"
5670 elif amigaos ; then
5671 default_cdrom_device="a1ide.device:2"
5672 else
5673 default_cdrom_device="/dev/cdrom"
5676 if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
5677 default_dvd_device=$default_cdrom_device
5678 elif darwin ; then
5679 default_dvd_device="/dev/rdiskN"
5680 else
5681 default_dvd_device="/dev/dvd"
5685 echocheck "VCD support"
5686 if test "$_vcd" = auto; then
5687 _vcd=no
5688 if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
5689 _vcd=yes
5690 elif mingw32; then
5691 header_check ddk/ntddcdrm.h && _vcd=yes
5694 if test "$_vcd" = yes; then
5695 inputmodules="vcd $inputmodules"
5696 def_vcd='#define CONFIG_VCD 1'
5697 else
5698 def_vcd='#undef CONFIG_VCD'
5699 noinputmodules="vcd $noinputmodules"
5700 res_comment="not supported on this OS"
5702 echores "$_vcd"
5706 echocheck "Blu-ray support"
5707 if test "$_bluray" = auto ; then
5708 _bluray=no
5710 cat > $TMPC << EOF
5711 #include <stdlib.h>
5712 #include <libbluray/bluray.h>
5713 int main(void) {
5714 BLURAY_TITLE_INFO *i = bd_get_title_info(NULL, 0);
5715 return 0;
5718 compile_check $TMPC -lbluray && _bluray=yes
5720 if test "$_bluray" = yes ; then
5721 def_bluray='#define CONFIG_LIBBLURAY 1'
5722 extra_ldflags="$extra_ldflags -lbluray"
5723 inputmodules="bluray $inputmodules"
5724 else
5725 def_bluray='#undef CONFIG_LIBBLURAY'
5726 noinputmodules="bluray $noinputmodules"
5728 echores "$_bluray"
5730 echocheck "dvdread"
5731 if test "$_dvdread_internal" = auto && test ! -f "libdvdread4/dvd_reader.c" ; then
5732 _dvdread_internal=no
5734 if test "$_dvdread_internal" = auto ; then
5735 _dvdread_internal=no
5736 _dvdread=no
5737 if (linux || freebsd || netbsd || openbsd || dragonfly || sunos || hpux) \
5738 && (test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
5739 test "$_dvdio" = yes || test "$_bsdi_dvd" = yes) \
5740 || darwin || win32 || os2; then
5741 _dvdread_internal=yes
5742 _dvdread=yes
5743 extra_cflags="-Ilibdvdread4 $extra_cflags"
5745 elif test "$_dvdread" = auto ; then
5746 _dvdread=no
5747 if test "$_dl" = yes; then
5748 cat > $TMPC << EOF
5749 #include <inttypes.h>
5750 #include <dvdread/dvd_reader.h>
5751 #include <dvdread/ifo_types.h>
5752 #include <dvdread/ifo_read.h>
5753 #include <dvdread/nav_read.h>
5754 int main(void) { return 0; }
5756 _dvdreadcflags=$($_dvdreadconfig --cflags)
5757 _dvdreadlibs=$($_dvdreadconfig --libs)
5758 if cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
5759 $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
5760 _dvdread=yes
5761 extra_cflags="$extra_cflags $_dvdreadcflags"
5762 extra_ldflags="$extra_ldflags $_dvdreadlibs"
5763 res_comment="external"
5768 if test "$_dvdread_internal" = yes; then
5769 def_dvdread='#define CONFIG_DVDREAD 1'
5770 inputmodules="dvdread(internal) $inputmodules"
5771 _largefiles=yes
5772 res_comment="internal"
5773 elif test "$_dvdread" = yes; then
5774 def_dvdread='#define CONFIG_DVDREAD 1'
5775 _largefiles=yes
5776 extra_ldflags="$extra_ldflags -ldvdread"
5777 inputmodules="dvdread(external) $inputmodules"
5778 res_comment="external"
5779 else
5780 def_dvdread='#undef CONFIG_DVDREAD'
5781 noinputmodules="dvdread $noinputmodules"
5783 echores "$_dvdread"
5786 echocheck "internal libdvdcss"
5787 if test "$_libdvdcss_internal" = auto ; then
5788 _libdvdcss_internal=no
5789 test "$_dvdread_internal" = yes && _libdvdcss_internal=yes
5790 hpux && test "$_hpux_scsi_h" = no && _libdvdcss_internal=no
5792 if test "$_libdvdcss_internal" = yes ; then
5793 if linux || netbsd || openbsd || bsdos ; then
5794 def_dvd_linux='#define HAVE_LINUX_DVD_STRUCT 1'
5795 openbsd && def_dvd_openbsd='#define HAVE_OPENBSD_DVD_STRUCT 1'
5796 elif freebsd || dragonfly ; then
5797 def_dvd_bsd='#define HAVE_BSD_DVD_STRUCT 1'
5798 elif darwin ; then
5799 def_dvd_darwin='#define DARWIN_DVD_IOCTL'
5800 extra_ldflags="$extra_ldflags -framework IOKit -framework Carbon"
5801 elif cygwin ; then
5802 cflags_libdvdcss="-DSYS_CYGWIN -DWIN32"
5803 elif beos ; then
5804 cflags_libdvdcss="-DSYS_BEOS"
5805 elif os2 ; then
5806 cflags_libdvdcss="-DSYS_OS2"
5808 cflags_libdvdcss_dvdread="-Ilibdvdcss"
5809 def_dvdcss="#define HAVE_DVDCSS_DVDCSS_H 1"
5810 inputmodules="libdvdcss(internal) $inputmodules"
5811 _largefiles=yes
5812 else
5813 noinputmodules="libdvdcss(internal) $noinputmodules"
5815 echores "$_libdvdcss_internal"
5818 echocheck "cdparanoia"
5819 if test "$_cdparanoia" = auto ; then
5820 cat > $TMPC <<EOF
5821 #include <cdda_interface.h>
5822 #include <cdda_paranoia.h>
5823 // This need a better test. How ?
5824 int main(void) { void *test = cdda_verbose_set; return test == (void *)1; }
5826 _cdparanoia=no
5827 for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
5828 cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
5829 _cdparanoia=yes && extra_cflags="$extra_cflags $_inc_tmp" && break
5830 done
5832 if test "$_cdparanoia" = yes ; then
5833 _cdda='yes'
5834 extra_ldflags="$extra_ldflags -lcdda_interface -lcdda_paranoia"
5835 openbsd && extra_ldflags="$extra_ldflags -lutil"
5837 echores "$_cdparanoia"
5840 echocheck "libcdio"
5841 if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
5842 cat > $TMPC << EOF
5843 #include <stdio.h>
5844 #include <cdio/version.h>
5845 #include <cdio/cdda.h>
5846 #include <cdio/paranoia.h>
5847 int main(void) {
5848 void *test = cdda_verbose_set;
5849 printf("%s\n", CDIO_VERSION);
5850 return test == (void *)1;
5853 _libcdio=no
5854 for _ld_tmp in "" "-lwinmm" ; do
5855 _ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
5856 cc_check $_ld_tmp $_ld_lm \
5857 && _libcdio=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5858 done
5859 if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
5860 _inc_tmp=$($_pkg_config --cflags libcdio_paranoia)
5861 _ld_tmp=$($_pkg_config --libs libcdio_paranoia)
5862 cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
5863 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5866 if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
5867 _cdda='yes'
5868 def_libcdio='#define CONFIG_LIBCDIO 1'
5869 def_havelibcdio='yes'
5870 else
5871 if test "$_cdparanoia" = yes ; then
5872 res_comment="using cdparanoia"
5874 def_libcdio='#undef CONFIG_LIBCDIO'
5875 def_havelibcdio='no'
5877 echores "$_libcdio"
5879 if test "$_cdda" = yes ; then
5880 test $_cddb = auto && test $networking = yes && _cddb=yes
5881 def_cdparanoia='#define CONFIG_CDDA 1'
5882 inputmodules="cdda $inputmodules"
5883 else
5884 def_cdparanoia='#undef CONFIG_CDDA'
5885 noinputmodules="cdda $noinputmodules"
5888 if test "$_cddb" = yes ; then
5889 def_cddb='#define CONFIG_CDDB 1'
5890 inputmodules="cddb $inputmodules"
5891 else
5892 _cddb=no
5893 def_cddb='#undef CONFIG_CDDB'
5894 noinputmodules="cddb $noinputmodules"
5897 echocheck "bitmap font support"
5898 if test "$_bitmap_font" = yes ; then
5899 def_bitmap_font="#define CONFIG_BITMAP_FONT 1"
5900 else
5901 def_bitmap_font="#undef CONFIG_BITMAP_FONT"
5903 echores "$_bitmap_font"
5906 echocheck "freetype >= 2.0.9"
5908 # freetype depends on iconv
5909 if test "$_iconv" = no ; then
5910 _freetype=no
5911 res_comment="iconv support needed"
5914 if test "$_freetype" = auto ; then
5915 if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
5916 cat > $TMPC << EOF
5917 #include <stdio.h>
5918 #include <ft2build.h>
5919 #include FT_FREETYPE_H
5920 #if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
5921 #error "Need FreeType 2.0.9 or newer"
5922 #endif
5923 int main(void) {
5924 FT_Library library;
5925 FT_Init_FreeType(&library);
5926 return 0;
5929 _freetype=no
5930 cc_check $($_freetypeconfig --cflags) $($_freetypeconfig --libs) && _freetype=yes
5931 else
5932 _freetype=no
5935 if test "$_freetype" = yes ; then
5936 def_freetype='#define CONFIG_FREETYPE 1'
5937 extra_cflags="$extra_cflags $($_freetypeconfig --cflags)"
5938 extra_ldflags="$extra_ldflags $($_freetypeconfig --libs)"
5939 else
5940 def_freetype='#undef CONFIG_FREETYPE'
5942 echores "$_freetype"
5944 if test "$_freetype" = no ; then
5945 _fontconfig=no
5946 res_comment="FreeType support needed"
5948 echocheck "fontconfig"
5949 if test "$_fontconfig" = auto ; then
5950 cat > $TMPC << EOF
5951 #include <stdio.h>
5952 #include <stdlib.h>
5953 #include <fontconfig/fontconfig.h>
5954 #if FC_VERSION < 20402
5955 #error At least version 2.4.2 of fontconfig required
5956 #endif
5957 int main(void) {
5958 int err = FcInit();
5959 if (err == FcFalse) {
5960 printf("Couldn't initialize fontconfig lib\n");
5961 exit(err);
5963 return 0;
5966 _fontconfig=no
5967 for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
5968 _ld_tmp="-lfontconfig $_ld_tmp"
5969 cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
5970 done
5971 if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
5972 _inc_tmp=$($_pkg_config --cflags fontconfig)
5973 _ld_tmp=$($_pkg_config --libs fontconfig)
5974 cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
5975 && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
5978 if test "$_fontconfig" = yes ; then
5979 def_fontconfig='#define CONFIG_FONTCONFIG 1'
5980 else
5981 def_fontconfig='#undef CONFIG_FONTCONFIG'
5983 echores "$_fontconfig"
5986 echocheck "SSA/ASS support"
5987 if test "$_ass" = auto -o "$_ass" = yes ; then
5988 if $_pkg_config libass; then
5989 _ass=yes
5990 def_ass='#define CONFIG_ASS 1'
5991 extra_ldflags="$extra_ldflags $($_pkg_config --libs libass)"
5992 extra_cflags="$extra_cflags $($_pkg_config --cflags libass)"
5993 else
5994 _ass=no
5995 def_ass='#undef CONFIG_ASS'
5997 else
5998 def_ass='#undef CONFIG_ASS'
6000 echores "$_ass"
6003 echocheck "fribidi with charsets"
6004 _inc_tmp=""
6005 _ld_tmp=""
6006 if test "$_fribidi" = auto ; then
6007 cat > $TMPC << EOF
6008 #include <stdlib.h>
6009 /* workaround for fribidi 0.10.4 and below */
6010 #define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
6011 #include <fribidi/fribidi.h>
6012 int main(void) {
6013 if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
6014 exit(1);
6015 return 0;
6018 _fribidi=no
6019 _inc_tmp=""
6020 _ld_tmp="-lfribidi"
6021 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6022 if $_pkg_config --exists fribidi > /dev/null 2>&1 &&
6023 test "$_fribidi" = no ; then
6024 _inc_tmp="$($_pkg_config --cflags)"
6025 _ld_tmp="$($_pkg_config --libs)"
6026 cc_check $_inc_tmp $_ld_tmp && _fribidi=yes
6029 if test "$_fribidi" = yes ; then
6030 def_fribidi='#define CONFIG_FRIBIDI 1'
6031 extra_cflags="$extra_cflags $_inc_tmp"
6032 extra_ldflags="$extra_ldflags $_ld_tmp"
6033 else
6034 def_fribidi='#undef CONFIG_FRIBIDI'
6036 echores "$_fribidi"
6039 echocheck "ENCA"
6040 if test "$_enca" = auto ; then
6041 cat > $TMPC << EOF
6042 #include <sys/types.h>
6043 #include <enca.h>
6044 int main(void) {
6045 const char **langs;
6046 size_t langcnt;
6047 langs = enca_get_languages(&langcnt);
6048 return 0;
6051 _enca=no
6052 cc_check -lenca $_ld_lm && _enca=yes
6054 if test "$_enca" = yes ; then
6055 def_enca='#define CONFIG_ENCA 1'
6056 extra_ldflags="$extra_ldflags -lenca"
6057 else
6058 def_enca='#undef CONFIG_ENCA'
6060 echores "$_enca"
6063 echocheck "zlib"
6064 _zlib=no
6065 function_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
6066 if test "$_zlib" = yes ; then
6067 def_zlib='#define CONFIG_ZLIB 1'
6068 extra_ldflags="$extra_ldflags -lz"
6069 else
6070 def_zlib='#define CONFIG_ZLIB 0'
6072 echores "$_zlib"
6075 echocheck "bzlib"
6076 bzlib=no
6077 def_bzlib='#define CONFIG_BZLIB 0'
6078 function_check bzlib.h 'BZ2_bzlibVersion()' -lbz2 && bzlib=yes
6079 if test "$bzlib" = yes ; then
6080 def_bzlib='#define CONFIG_BZLIB 1'
6081 extra_ldflags="$extra_ldflags -lbz2"
6083 echores "$bzlib"
6086 echocheck "RTC"
6087 if test "$_rtc" = auto ; then
6088 cat > $TMPC << EOF
6089 #include <sys/ioctl.h>
6090 #ifdef __linux__
6091 #include <linux/rtc.h>
6092 #else
6093 #include <rtc.h>
6094 #define RTC_PIE_ON RTCIO_PIE_ON
6095 #endif
6096 int main(void) { return RTC_PIE_ON; }
6098 _rtc=no
6099 cc_check && _rtc=yes
6100 ppc && _rtc=no
6102 if test "$_rtc" = yes ; then
6103 def_rtc='#define HAVE_RTC 1'
6104 else
6105 def_rtc='#undef HAVE_RTC'
6107 echores "$_rtc"
6110 echocheck "liblzo2 support"
6111 if test "$_liblzo" = auto ; then
6112 _liblzo=no
6113 function_check lzo/lzo1x.h 'lzo_init()' -llzo2 && _liblzo=yes
6115 if test "$_liblzo" = yes ; then
6116 def_liblzo='#define CONFIG_LIBLZO 1'
6117 extra_ldflags="$extra_ldflags -llzo2"
6118 codecmodules="liblzo $codecmodules"
6119 else
6120 def_liblzo='#undef CONFIG_LIBLZO'
6121 nocodecmodules="liblzo $nocodecmodules"
6123 echores "$_liblzo"
6126 echocheck "mad support"
6127 if test "$_mad" = auto ; then
6128 _mad=no
6129 header_check mad.h -lmad && _mad=yes
6131 if test "$_mad" = yes ; then
6132 def_mad='#define CONFIG_LIBMAD 1'
6133 extra_ldflags="$extra_ldflags -lmad"
6134 codecmodules="libmad $codecmodules"
6135 else
6136 def_mad='#undef CONFIG_LIBMAD'
6137 nocodecmodules="libmad $nocodecmodules"
6139 echores "$_mad"
6141 echocheck "Twolame"
6142 if test "$_twolame" = auto ; then
6143 _twolame=no
6144 function_check twolame.h 'twolame_init()' -ltwolame $_ld_lm && _twolame=yes
6146 if test "$_twolame" = yes ; then
6147 def_twolame='#define CONFIG_TWOLAME 1'
6148 libs_mencoder="$libs_mencoder -ltwolame"
6149 codecmodules="twolame $codecmodules"
6150 else
6151 def_twolame='#undef CONFIG_TWOLAME'
6152 nocodecmodules="twolame $nocodecmodules"
6154 echores "$_twolame"
6156 echocheck "Toolame"
6157 if test "$_toolame" = auto ; then
6158 _toolame=no
6159 if test "$_twolame" = yes ; then
6160 res_comment="disabled by twolame"
6161 else
6162 function_check toolame.h 'toolame_init()' -ltoolame $_ld_lm && _toolame=yes
6165 if test "$_toolame" = yes ; then
6166 def_toolame='#define CONFIG_TOOLAME 1'
6167 libs_mencoder="$libs_mencoder -ltoolame"
6168 codecmodules="toolame $codecmodules"
6169 else
6170 def_toolame='#undef CONFIG_TOOLAME'
6171 nocodecmodules="toolame $nocodecmodules"
6173 if test "$_toolamedir" ; then
6174 res_comment="using $_toolamedir"
6176 echores "$_toolame"
6178 echocheck "OggVorbis support"
6179 if test "$_tremor_internal" = yes; then
6180 _libvorbis=no
6181 elif test "$_tremor" = auto; then
6182 _tremor=no
6183 function_check tremor/ivorbiscodec.h 'vorbis_packet_blocksize(0, 0)' -logg -lvorbisidec $_ld_lm && _tremor=yes && _libvorbis=no
6185 if test "$_libvorbis" = auto; then
6186 _libvorbis=no
6187 function_check vorbis/codec.h 'vorbis_packet_blocksize(0, 0)' -lvorbis -logg $_ld_lm && _libvorbis=yes
6189 if test "$_tremor_internal" = yes ; then
6190 _vorbis=yes
6191 def_vorbis='#define CONFIG_OGGVORBIS 1'
6192 def_tremor='#define CONFIG_TREMOR 1'
6193 codecmodules="tremor(internal) $codecmodules"
6194 res_comment="internal Tremor"
6195 if test "$_tremor_low" = yes ; then
6196 cflags_tremor_low="-D_LOW_ACCURACY_"
6197 res_comment="internal low accuracy Tremor"
6199 elif test "$_tremor" = yes ; then
6200 _vorbis=yes
6201 def_vorbis='#define CONFIG_OGGVORBIS 1'
6202 def_tremor='#define CONFIG_TREMOR 1'
6203 codecmodules="tremor(external) $codecmodules"
6204 res_comment="external Tremor"
6205 extra_ldflags="$extra_ldflags -logg -lvorbisidec"
6206 elif test "$_libvorbis" = yes ; then
6207 _vorbis=yes
6208 def_vorbis='#define CONFIG_OGGVORBIS 1'
6209 codecmodules="libvorbis $codecmodules"
6210 res_comment="libvorbis"
6211 extra_ldflags="$extra_ldflags -lvorbis -logg"
6212 else
6213 _vorbis=no
6214 nocodecmodules="libvorbis $nocodecmodules"
6216 echores "$_vorbis"
6218 echocheck "libspeex (version >= 1.1 required)"
6219 if test "$_speex" = auto ; then
6220 _speex=no
6221 cat > $TMPC << EOF
6222 #include <stddef.h>
6223 #include <speex/speex.h>
6224 int main(void) { SpeexBits bits; void *dec = NULL; speex_decode_int(dec, &bits, dec); return 0; }
6226 cc_check -lspeex $_ld_lm && _speex=yes
6228 if test "$_speex" = yes ; then
6229 def_speex='#define CONFIG_SPEEX 1'
6230 extra_ldflags="$extra_ldflags -lspeex"
6231 codecmodules="speex $codecmodules"
6232 else
6233 def_speex='#undef CONFIG_SPEEX'
6234 nocodecmodules="speex $nocodecmodules"
6236 echores "$_speex"
6238 echocheck "OggTheora support"
6239 if test "$_theora" = auto ; then
6240 _theora=no
6241 cat > $TMPC << EOF
6242 #include <theora/theora.h>
6243 #include <string.h>
6244 int main(void) {
6245 /* Theora is in flux, make sure that all interface routines and datatypes
6246 * exist and work the way we expect it, so we don't break MPlayer. */
6247 ogg_packet op;
6248 theora_comment tc;
6249 theora_info inf;
6250 theora_state st;
6251 yuv_buffer yuv;
6252 int r;
6253 double t;
6255 theora_info_init(&inf);
6256 theora_comment_init(&tc);
6258 return 0;
6260 /* we don't want to execute this kind of nonsense; just for making sure
6261 * that compilation works... */
6262 memset(&op, 0, sizeof(op));
6263 r = theora_decode_header(&inf, &tc, &op);
6264 r = theora_decode_init(&st, &inf);
6265 t = theora_granule_time(&st, op.granulepos);
6266 r = theora_decode_packetin(&st, &op);
6267 r = theora_decode_YUVout(&st, &yuv);
6268 theora_clear(&st);
6270 return 0;
6273 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6274 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6275 cc_check $_inc_theora $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" &&
6276 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6277 if test _theora = no; then
6278 _ld_theora="-ltheora -logg"
6279 cc_check $_ld_theora && extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6281 if test "$_theora" = no && test "$_tremor_internal" = yes; then
6282 _ld_theora=$($_pkg_config --silence-errors --libs theora)
6283 _inc_theora=$($_pkg_config --silence-errors --cflags theora)
6284 cc_check tremor/bitwise.c $_inc_theora $_ld_theora &&
6285 extra_ldflags="$extra_ldflags $_ld_theora" &&
6286 extra_cflags="$extra_cflags $_inc_theora" && _theora=yes
6287 if test _theora = no; then
6288 _ld_theora="-ltheora -logg"
6289 cc_check tremor/bitwise.c $_ld_theora &&
6290 extra_ldflags="$extra_ldflags $_ld_theora" && _theora=yes
6294 if test "$_theora" = yes ; then
6295 def_theora='#define CONFIG_OGGTHEORA 1'
6296 codecmodules="libtheora $codecmodules"
6297 # when --enable-theora is forced, we'd better provide a probably sane
6298 # $_ld_theora than nothing
6299 test -z "$_ld_theora" && extra_ldflags="$extra_ldflags -ltheora -logg"
6300 else
6301 def_theora='#undef CONFIG_OGGTHEORA'
6302 nocodecmodules="libtheora $nocodecmodules"
6304 echores "$_theora"
6306 echocheck "mp3lib support"
6307 if test "$_mp3lib" = auto ; then
6308 test "$cc_vendor" = intel && test "$_cc_major" -le 10 -o "$_cc_major" -eq 11 -a "$_cc_minor" -eq 0 && _mp3lib=no || _mp3lib=yes
6310 if test "$_mp3lib" = yes ; then
6311 def_mp3lib='#define CONFIG_MP3LIB 1'
6312 codecmodules="mp3lib(internal) $codecmodules"
6313 else
6314 def_mp3lib='#undef CONFIG_MP3LIB'
6315 nocodecmodules="mp3lib(internal) $nocodecmodules"
6317 echores "$_mp3lib"
6319 # Any version of libmpg123 shall be fine.
6320 echocheck "mpg123 support"
6321 def_mpg123='#undef CONFIG_MPG123'
6322 if test "$_mpg123" = auto; then
6323 _mpg123=no
6324 function_check mpg123.h 'mpg123_init()' -lmpg123 && _mpg123=yes && extra_ldflags="$extra_ldflags -lmpg123"
6326 if test "$_mpg123" = yes ; then
6327 def_mpg123='#define CONFIG_MPG123 1'
6328 codecmodules="mpg123 $codecmodules"
6329 else
6330 nocodecmodules="mpg123 $nocodecmodules"
6332 echores "$_mpg123"
6334 echocheck "liba52 support"
6335 def_liba52='#undef CONFIG_LIBA52'
6336 if test "$_liba52" = auto ; then
6337 _liba52=no
6338 cat > $TMPC << EOF
6339 #include <inttypes.h>
6340 #include <a52dec/a52.h>
6341 int main(void) { a52_state_t *testHand; testHand=a52_init(0); return 0; }
6343 cc_check -la52 && _liba52=yes && extra_ldflags="$extra_ldflags -la52"
6345 if test "$_liba52" = yes ; then
6346 def_liba52='#define CONFIG_LIBA52 1'
6347 codecmodules="liba52 $codecmodules"
6348 else
6349 nocodecmodules="liba52 $nocodecmodules"
6351 echores "$_liba52"
6353 echocheck "internal libmpeg2 support"
6354 if test "$_libmpeg2" = auto ; then
6355 _libmpeg2=yes
6356 if alpha && test cc_vendor=gnu; then
6357 case $cc_version in
6358 2*|3.0*|3.1*) # cannot compile MVI instructions
6359 _libmpeg2=no
6360 res_comment="broken gcc"
6362 esac
6365 if test "$_libmpeg2" = yes ; then
6366 def_libmpeg2='#define CONFIG_LIBMPEG2 1'
6367 codecmodules="libmpeg2(internal) $codecmodules"
6368 else
6369 def_libmpeg2='#undef CONFIG_LIBMPEG2'
6370 nocodecmodules="libmpeg2(internal) $nocodecmodules"
6372 echores "$_libmpeg2"
6374 echocheck "libdca support"
6375 if test "$_libdca" = auto ; then
6376 _libdca=no
6377 cat > $TMPC << EOF
6378 #include <inttypes.h>
6379 #include <dts.h>
6380 int main(void) { dts_init(0); return 0; }
6382 for _ld_dca in -ldca -ldts ; do
6383 cc_check $_ld_dca $_ld_lm && extra_ldflags="$extra_ldflags $_ld_dca" \
6384 && _libdca=yes && break
6385 done
6387 if test "$_libdca" = yes ; then
6388 def_libdca='#define CONFIG_LIBDCA 1'
6389 codecmodules="libdca $codecmodules"
6390 else
6391 def_libdca='#undef CONFIG_LIBDCA'
6392 nocodecmodules="libdca $nocodecmodules"
6394 echores "$_libdca"
6396 echocheck "libmpcdec (musepack, version >= 1.2.1 required)"
6397 if test "$_musepack" = auto ; then
6398 _musepack=no
6399 cat > $TMPC << EOF
6400 #include <stddef.h>
6401 #include <mpcdec/mpcdec.h>
6402 int main(void) {
6403 mpc_streaminfo info;
6404 mpc_decoder decoder;
6405 mpc_decoder_set_streaminfo(&decoder, &info);
6406 mpc_decoder_decode_frame(&decoder, NULL, 0, NULL);
6407 return 0;
6410 cc_check -lmpcdec $_ld_lm && _musepack=yes
6412 if test "$_musepack" = yes ; then
6413 def_musepack='#define CONFIG_MUSEPACK 1'
6414 extra_ldflags="$extra_ldflags -lmpcdec"
6415 codecmodules="musepack $codecmodules"
6416 else
6417 def_musepack='#undef CONFIG_MUSEPACK'
6418 nocodecmodules="musepack $nocodecmodules"
6420 echores "$_musepack"
6423 echocheck "FAAC support"
6424 if test "$_faac" = auto ; then
6425 cat > $TMPC <<EOF
6426 #include <inttypes.h>
6427 #include <faac.h>
6428 int main(void) { unsigned long x, y; faacEncOpen(48000, 2, &x, &y); return 0; }
6430 _faac=no
6431 for _ld_faac in "-lfaac" "-lfaac -lmp4v2 -lstdc++" ; do
6432 cc_check $_ld_faac $_ld_lm && libs_mencoder="$libs_mencoder $_ld_faac" && _faac=yes && break
6433 done
6435 if test "$_faac" = yes ; then
6436 def_faac="#define CONFIG_FAAC 1"
6437 codecmodules="faac $codecmodules"
6438 else
6439 def_faac="#undef CONFIG_FAAC"
6440 nocodecmodules="faac $nocodecmodules"
6442 echores "$_faac"
6445 echocheck "FAAD2 support"
6446 if test "$_faad_internal" = auto ; then
6447 if x86_32 && test cc_vendor=gnu; then
6448 case $cc_version in
6449 3.1*|3.2) # ICE/insn with these versions
6450 _faad_internal=no
6451 res_comment="broken gcc"
6454 _faad=yes
6455 _faad_internal=yes
6457 esac
6458 else
6459 _faad=yes
6460 _faad_internal=yes
6463 if test "$_faad" = auto ; then
6464 cat > $TMPC << EOF
6465 #include <faad.h>
6466 #ifndef FAAD_MIN_STREAMSIZE
6467 #error Too old version
6468 #endif
6469 int main(void) { faacDecHandle testhand; faacDecFrameInfo testinfo;
6470 testhand = faacDecOpen(); faacDecInit(0, 0, 0, 0, 0); return 0; }
6472 cc_check -lfaad $_ld_lm && _faad=yes
6475 def_faad='#undef CONFIG_FAAD'
6476 def_faad_internal="#undef CONFIG_FAAD_INTERNAL"
6477 if test "$_faad_internal" = yes ; then
6478 def_faad_internal="#define CONFIG_FAAD_INTERNAL 1"
6479 res_comment="internal floating-point"
6480 if test "$_faad_fixed" = yes ; then
6481 # The FIXED_POINT implementation of FAAD2 improves performance
6482 # on some platforms, especially for SBR files.
6483 cflags_faad_fixed="-DFIXED_POINT"
6484 res_comment="internal fixed-point"
6486 elif test "$_faad" = yes ; then
6487 extra_ldflags="$extra_ldflags -lfaad"
6490 if test "$_faad" = yes ; then
6491 def_faad='#define CONFIG_FAAD 1'
6492 if test "$_faad_internal" = yes ; then
6493 codecmodules="faad2(internal) $codecmodules"
6494 else
6495 codecmodules="faad2 $codecmodules"
6497 else
6498 _faad=no
6499 nocodecmodules="faad2 $nocodecmodules"
6501 echores "$_faad"
6504 echocheck "LADSPA plugin support"
6505 if test "$_ladspa" = auto ; then
6506 cat > $TMPC <<EOF
6507 #include <ladspa.h>
6508 int main(void) {
6509 LADSPA_Descriptor ld = {0};
6510 return 0;
6513 _ladspa=no
6514 cc_check && _ladspa=yes
6516 if test "$_ladspa" = yes; then
6517 def_ladspa="#define CONFIG_LADSPA 1"
6518 else
6519 def_ladspa="#undef CONFIG_LADSPA"
6521 echores "$_ladspa"
6524 echocheck "libbs2b audio filter support"
6525 if test "$_libbs2b" = auto ; then
6526 cat > $TMPC <<EOF
6527 #include <bs2b.h>
6528 #if BS2B_VERSION_MAJOR < 3
6529 #error Please use libbs2b >= 3.0.0, older versions are not supported.
6530 #endif
6531 int main(void) {
6532 t_bs2bdp filter;
6533 filter=bs2b_open();
6534 bs2b_close(filter);
6535 return 0;
6538 _libbs2b=no
6539 if $_pkg_config --exists libbs2b ; then
6540 _inc_tmp=$($_pkg_config --cflags libbs2b)
6541 _ld_tmp=$($_pkg_config --libs libbs2b)
6542 cc_check $_inc_tmp $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
6543 extra_cflags="$extra_cflags $_inc_tmp" && _libbs2b=yes
6544 else
6545 for _inc_tmp in "" -I/usr/include/bs2b -I/usr/local/include \
6546 -I/usr/local/include/bs2b ; do
6547 if cc_check $_inc_tmp $_ld_lm -lbs2b ; then
6548 extra_ldflags="$extra_ldflags -lbs2b"
6549 extra_cflags="$extra_cflags $_inc_tmp"
6550 _libbs2b=yes
6551 break
6553 done
6556 def_libbs2b="#undef CONFIG_LIBBS2B"
6557 test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
6558 echores "$_libbs2b"
6561 if test -z "$_codecsdir" ; then
6562 for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
6563 /usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
6564 if test -d "$dir" ; then
6565 _codecsdir="$dir"
6566 break;
6568 done
6570 # Fall back on default directory.
6571 if test -z "$_codecsdir" ; then
6572 _codecsdir="$_libdir/codecs"
6573 mingw32 || os2 && _codecsdir="codecs"
6577 echocheck "Win32 codecs"
6578 if test "$_win32dll" = auto ; then
6579 _win32dll=no
6580 if x86_32 && ! qnx; then
6581 _win32dll=yes
6584 if test "$_win32dll" = yes ; then
6585 def_win32dll='#define CONFIG_WIN32DLL 1'
6586 if ! win32 ; then
6587 def_win32_loader='#define WIN32_LOADER 1'
6588 _win32_emulation=yes
6589 else
6590 extra_ldflags="$extra_ldflags -ladvapi32 -lole32"
6591 res_comment="using native windows"
6593 codecmodules="win32 $codecmodules"
6594 else
6595 def_win32dll='#undef CONFIG_WIN32DLL'
6596 def_win32_loader='#undef WIN32_LOADER'
6597 nocodecmodules="win32 $nocodecmodules"
6599 echores "$_win32dll"
6602 echocheck "XAnim codecs"
6603 if test "$_xanim" = auto ; then
6604 _xanim=no
6605 res_comment="dynamic loader support needed"
6606 if test "$_dl" = yes ; then
6607 _xanim=yes
6610 if test "$_xanim" = yes ; then
6611 def_xanim='#define CONFIG_XANIM 1'
6612 codecmodules="xanim $codecmodules"
6613 else
6614 def_xanim='#undef CONFIG_XANIM'
6615 nocodecmodules="xanim $nocodecmodules"
6617 echores "$_xanim"
6620 echocheck "RealPlayer codecs"
6621 if test "$_real" = auto ; then
6622 _real=no
6623 res_comment="dynamic loader support needed"
6624 if test "$_dl" = yes || test "$_win32dll" = yes &&
6625 (linux || freebsd || netbsd || openbsd || dragonfly || darwin || win32 || os2) ; then
6626 _real=yes
6629 if test "$_real" = yes ; then
6630 def_real='#define CONFIG_REALCODECS 1'
6631 codecmodules="real $codecmodules"
6632 else
6633 def_real='#undef CONFIG_REALCODECS'
6634 nocodecmodules="real $nocodecmodules"
6636 echores "$_real"
6639 echocheck "QuickTime codecs"
6640 _qtx_emulation=no
6641 def_qtx_win32='#undef CONFIG_QTX_CODECS_WIN32'
6642 if test "$_qtx" = auto ; then
6643 test "$_win32dll" = yes || test "$quicktime" = yes && _qtx=yes
6645 if test "$_qtx" = yes ; then
6646 def_qtx='#define CONFIG_QTX_CODECS 1'
6647 win32 && _qtx_codecs_win32=yes && def_qtx_win32='#define CONFIG_QTX_CODECS_WIN32 1'
6648 codecmodules="qtx $codecmodules"
6649 darwin || win32 || _qtx_emulation=yes
6650 else
6651 def_qtx='#undef CONFIG_QTX_CODECS'
6652 nocodecmodules="qtx $nocodecmodules"
6654 echores "$_qtx"
6656 echocheck "Nemesi Streaming Media libraries"
6657 if test "$_nemesi" = auto && test "$networking" = yes ; then
6658 _nemesi=no
6659 if $_pkg_config libnemesi --atleast-version=0.6.3 ; then
6660 extra_cflags="$extra_cflags $($_pkg_config --cflags libnemesi)"
6661 extra_ldflags="$extra_ldflags $($_pkg_config --libs libnemesi)"
6662 _nemesi=yes
6665 if test "$_nemesi" = yes; then
6666 _native_rtsp=no
6667 def_nemesi='#define CONFIG_LIBNEMESI 1'
6668 inputmodules="nemesi $inputmodules"
6669 else
6670 _native_rtsp="$networking"
6671 _nemesi=no
6672 def_nemesi='#undef CONFIG_LIBNEMESI'
6673 noinputmodules="nemesi $noinputmodules"
6675 echores "$_nemesi"
6677 echocheck "LIVE555 Streaming Media libraries"
6678 if test "$_live" = auto && test "$networking" = yes ; then
6679 cat > $TMPCPP << EOF
6680 #include <liveMedia.hh>
6681 #if (LIVEMEDIA_LIBRARY_VERSION_INT < 1141257600)
6682 #error Please upgrade to version 2006.03.03 or later of the "LIVE555 Streaming Media" libraries - available from <www.live555.com/liveMedia/>
6683 #endif
6684 int main(void) { return 0; }
6687 _live=no
6688 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
6689 cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
6690 $I/groupsock/include && _livelibdir=$(echo $I| sed s/-I//) && \
6691 extra_ldflags="$_livelibdir/liveMedia/libliveMedia.a \
6692 $_livelibdir/groupsock/libgroupsock.a \
6693 $_livelibdir/UsageEnvironment/libUsageEnvironment.a \
6694 $_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
6695 $extra_ldflags -lstdc++" \
6696 extra_cxxflags="-I$_livelibdir/liveMedia/include \
6697 -I$_livelibdir/UsageEnvironment/include \
6698 -I$_livelibdir/BasicUsageEnvironment/include \
6699 -I$_livelibdir/groupsock/include" && \
6700 _live=yes && break
6701 done
6702 if test "$_live" != yes ; then
6703 ld_tmp="-lliveMedia -lgroupsock -lUsageEnvironment -lBasicUsageEnvironment -lstdc++"
6704 if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I/usr/include/groupsock $ld_tmp; then
6705 _live_dist=yes
6709 if test "$_live" = yes && test "$networking" = yes; then
6710 test $_livelibdir && res_comment="using $_livelibdir"
6711 def_live='#define CONFIG_LIVE555 1'
6712 inputmodules="live555 $inputmodules"
6713 elif test "$_live_dist" = yes && test "$networking" = yes; then
6714 res_comment="using distribution version"
6715 _live="yes"
6716 def_live='#define CONFIG_LIVE555 1'
6717 extra_ldflags="$extra_ldflags $ld_tmp"
6718 extra_cxxflags="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
6719 -I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
6720 inputmodules="live555 $inputmodules"
6721 else
6722 _live=no
6723 def_live='#undef CONFIG_LIVE555'
6724 noinputmodules="live555 $noinputmodules"
6726 echores "$_live"
6730 all_ffmpeg_libs="libavutil libavcodec libavformat libswscale libpostproc"
6731 echocheck "FFmpeg ($all_ffmpeg_libs)"
6732 if test "$ffmpeg" = auto ; then
6733 ffmpeg=no
6734 if $_pkg_config --exists $all_ffmpeg_libs ; then
6735 inc_ffmpeg=$($_pkg_config --cflags $all_ffmpeg_libs)
6736 _ld_tmp=$($_pkg_config --libs $all_ffmpeg_libs)
6737 extra_ldflags="$extra_ldflags $_ld_tmp"
6738 extra_cflags="$extra_cflags $inc_ffmpeg"
6739 ffmpeg=yes
6740 elif header_check libavcore/avutil.h -lpostproc -lswscale -lavformat -lavcodec -lavutil $_ld_lm ; then
6741 extra_ldflags="$extra_ldflags -lpostproc -lswscale -lavformat -lavcodec -lavutil -lavcore"
6742 ffmpeg=yes
6746 if test "$ffmpeg" = yes; then
6747 def_ffmpeg='#define CONFIG_FFMPEG 1'
6748 codecmodules="ffmpeg $codecmodules"
6749 else
6750 def_ffmpeg='#undef CONFIG_FFMPEG'
6751 nocodecmodules="ffmpeg $nocodecmodules"
6753 echores "$ffmpeg"
6755 def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
6756 if ! test -z "$_ffmpeg_source" ; then
6757 test "$ffmpeg" = yes && def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
6762 echocheck "libdv-0.9.5+"
6763 if test "$_libdv" = auto ; then
6764 _libdv=no
6765 function_check libdv/dv.h "dv_encoder_new(1, 1, 1)" -ldv $_ld_pthread $_ld_lm && _libdv=yes
6767 if test "$_libdv" = yes ; then
6768 def_libdv='#define CONFIG_LIBDV095 1'
6769 extra_ldflags="$extra_ldflags -ldv"
6770 codecmodules="libdv $codecmodules"
6771 else
6772 def_libdv='#undef CONFIG_LIBDV095'
6773 nocodecmodules="libdv $nocodecmodules"
6775 echores "$_libdv"
6778 echocheck "Xvid"
6779 if test "$_xvid" = auto ; then
6780 _xvid=no
6781 for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
6782 function_check xvid.h 'xvid_global(0, 0, 0, 0)' $_ld_tmp &&
6783 extra_ldflags="$extra_ldflags $_ld_tmp" && _xvid=yes && break
6784 done
6787 if test "$_xvid" = yes ; then
6788 def_xvid='#define CONFIG_XVID4 1'
6789 codecmodules="xvid $codecmodules"
6790 else
6791 def_xvid='#undef CONFIG_XVID4'
6792 nocodecmodules="xvid $nocodecmodules"
6794 echores "$_xvid"
6796 echocheck "x264"
6797 if test "$_x264" = auto ; then
6798 cat > $TMPC << EOF
6799 #include <inttypes.h>
6800 #include <x264.h>
6801 #if X264_BUILD < 98
6802 #error We do not support old versions of x264. Get the latest from git.
6803 #endif
6804 int main(void) { x264_encoder_open((void*)0); return 0; }
6806 _x264=no
6807 for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
6808 cc_check $_ld_x264 && libs_mencoder="$libs_mencoder $_ld_x264" && _x264=yes && break
6809 done
6812 if test "$_x264" = yes ; then
6813 def_x264='#define CONFIG_X264 1'
6814 codecmodules="x264 $codecmodules"
6815 else
6816 def_x264='#undef CONFIG_X264'
6817 nocodecmodules="x264 $nocodecmodules"
6819 echores "$_x264"
6821 echocheck "libnut"
6822 if test "$_libnut" = auto ; then
6823 cat > $TMPC << EOF
6824 #include <libnut.h>
6825 nut_context_tt * nut;
6826 int main(void) { nut_error(0); return 0; }
6828 _libnut=no
6829 cc_check -lnut && _libnut=yes
6832 if test "$_libnut" = yes ; then
6833 def_libnut='#define CONFIG_LIBNUT 1'
6834 extra_ldflags="$extra_ldflags -lnut"
6835 else
6836 def_libnut='#undef CONFIG_LIBNUT'
6838 echores "$_libnut"
6840 # These VO checks must be done after the FFmpeg one
6841 echocheck "/dev/mga_vid"
6842 if test "$_mga" = auto ; then
6843 _mga=no
6844 test -c /dev/mga_vid && _mga=yes
6846 if test "$_mga" = yes ; then
6847 def_mga='#define CONFIG_MGA 1'
6848 vomodules="mga $vomodules"
6849 else
6850 def_mga='#undef CONFIG_MGA'
6851 novomodules="mga $novomodules"
6853 echores "$_mga"
6856 echocheck "xmga"
6857 if test "$_xmga" = auto ; then
6858 _xmga=no
6859 test "$_x11" = yes && test "$_mga" = yes && _xmga=yes
6861 if test "$_xmga" = yes ; then
6862 def_xmga='#define CONFIG_XMGA 1'
6863 vomodules="xmga $vomodules"
6864 else
6865 def_xmga='#undef CONFIG_XMGA'
6866 novomodules="xmga $novomodules"
6868 echores "$_xmga"
6870 echocheck "zr"
6871 if test "$_zr" = auto ; then
6872 #36067's seem to identify themselves as 36057PQC's, so the line
6873 #below should work for 36067's and 36057's.
6874 if grep -q -s -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci ; then
6875 _zr=yes
6876 else
6877 _zr=no
6880 if test "$_zr" = yes ; then
6881 if test "$ffmpeg_internals" = yes ; then
6882 def_zr='#define CONFIG_ZR 1'
6883 vomodules="zr zr2 $vomodules"
6884 else
6885 res_comment="FFmpeg internal headers are required by zr, sorry"
6886 novomodules="zr $novomodules"
6887 def_zr='#undef CONFIG_ZR'
6889 else
6890 def_zr='#undef CONFIG_ZR'
6891 novomodules="zr zr2 $novomodules"
6893 echores "$_zr"
6895 # mencoder requires (optional) those libs: libmp3lame
6896 if test "$_mencoder" != no ; then
6898 echocheck "libmp3lame"
6899 def_mp3lame_preset='#undef CONFIG_MP3LAME_PRESET'
6900 def_mp3lame_preset_medium='#undef CONFIG_MP3LAME_PRESET_MEDIUM'
6901 if test "$_mp3lame" = auto ; then
6902 _mp3lame=no
6903 cat > $TMPC <<EOF
6904 #include <lame/lame.h>
6905 int main(void) { lame_version_t lv; lame_init();
6906 get_lame_version_numerical(&lv);
6907 return 0; }
6909 cc_check -lmp3lame $_ld_lm && _mp3lame=yes
6911 if test "$_mp3lame" = yes ; then
6912 def_mp3lame="#define CONFIG_MP3LAME 1"
6913 _ld_mp3lame=-lmp3lame
6914 libs_mencoder="$libs_mencoder $_ld_mp3lame"
6915 function_check lame/lame.h 'lame_set_preset(NULL, STANDARD_FAST)' $_ld_mp3lame $_ld_lm && def_mp3lame_preset="#define CONFIG_MP3LAME_PRESET 1"
6916 function_check lame/lame.h 'lame_set_preset(NULL, MEDIUM_FAST)' $_ld_mp3lame $_ld_lm && def_mp3lame_preset_medium="#define CONFIG_MP3LAME_PRESET_MEDIUM 1"
6917 else
6918 def_mp3lame='#undef CONFIG_MP3LAME'
6920 echores "$_mp3lame"
6922 fi # test "$_mencoder" != no
6924 echocheck "mencoder"
6925 if test "$_mencoder" = yes ; then
6926 def_muxers='#define CONFIG_MUXERS 1'
6927 else
6928 def_muxers='#define CONFIG_MUXERS 0'
6930 echores "$_mencoder"
6933 echocheck "UnRAR executable"
6934 if test "$_unrar_exec" = auto ; then
6935 _unrar_exec="yes"
6936 mingw32 && _unrar_exec="no"
6938 if test "$_unrar_exec" = yes ; then
6939 def_unrar_exec='#define CONFIG_UNRAR_EXEC 1'
6940 else
6941 def_unrar_exec='#undef CONFIG_UNRAR_EXEC'
6943 echores "$_unrar_exec"
6945 echocheck "TV interface"
6946 if test "$_tv" = yes ; then
6947 def_tv='#define CONFIG_TV 1'
6948 inputmodules="tv $inputmodules"
6949 else
6950 noinputmodules="tv $noinputmodules"
6951 def_tv='#undef CONFIG_TV'
6953 echores "$_tv"
6956 if freebsd || netbsd || openbsd || dragonfly || bsdos ; then
6957 echocheck "*BSD BT848 bt8xx header"
6958 _ioctl_bt848_h=no
6959 for file in "machine/ioctl_bt848.h" \
6960 "dev/bktr/ioctl_bt848.h" \
6961 "dev/video/bktr/ioctl_bt848.h" \
6962 "dev/ic/bt8xx.h" ; do
6963 cat > $TMPC <<EOF
6964 #include <sys/types.h>
6965 #include <sys/ioctl.h>
6966 #include <$file>
6967 int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
6969 if cc_check ; then
6970 _ioctl_bt848_h=yes
6971 _ioctl_bt848_h_name="$file"
6972 break;
6974 done
6975 if test "$_ioctl_bt848_h" = yes ; then
6976 def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
6977 res_comment="using $_ioctl_bt848_h_name"
6978 else
6979 def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
6981 echores "$_ioctl_bt848_h"
6983 echocheck "*BSD ioctl_meteor.h"
6984 _ioctl_meteor_h=no
6985 for file in "machine/ioctl_meteor.h" \
6986 "dev/bktr/ioctl_meteor.h" \
6987 "dev/video/bktr/ioctl_meteor.h" ; do
6988 cat > $TMPC <<EOF
6989 #include <sys/types.h>
6990 #include <$file>
6991 int main(void) { ioctl(0, METEORSINPUT, 0); return 0; }
6993 if cc_check ; then
6994 _ioctl_meteor_h=yes
6995 _ioctl_meteor_h_name="$file"
6996 break;
6998 done
6999 if test "$_ioctl_meteor_h" = yes ; then
7000 def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$_ioctl_meteor_h_name>"
7001 res_comment="using $_ioctl_meteor_h_name"
7002 else
7003 def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
7005 echores "$_ioctl_meteor_h"
7007 echocheck "*BSD BrookTree 848 TV interface"
7008 if test "$_tv_bsdbt848" = auto ; then
7009 _tv_bsdbt848=no
7010 if test "$_tv" = yes ; then
7011 cat > $TMPC <<EOF
7012 #include <sys/types.h>
7013 $def_ioctl_meteor_h_name
7014 $def_ioctl_bt848_h_name
7015 #ifdef IOCTL_METEOR_H_NAME
7016 #include IOCTL_METEOR_H_NAME
7017 #endif
7018 #ifdef IOCTL_BT848_H_NAME
7019 #include IOCTL_BT848_H_NAME
7020 #endif
7021 int main(void) {
7022 ioctl(0, METEORSINPUT, 0);
7023 ioctl(0, TVTUNER_GETFREQ, 0);
7024 return 0;
7027 cc_check && _tv_bsdbt848=yes
7030 if test "$_tv_bsdbt848" = yes ; then
7031 def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
7032 inputmodules="tv-bsdbt848 $inputmodules"
7033 else
7034 def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
7035 noinputmodules="tv-bsdbt848 $noinputmodules"
7037 echores "$_tv_bsdbt848"
7038 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos
7041 echocheck "DirectShow TV interface"
7042 if test "$_tv_dshow" = auto ; then
7043 _tv_dshow=no
7044 if test "$_tv" = yes && win32 ; then
7045 cat > $TMPC <<EOF
7046 #include <ole2.h>
7047 int main(void) {
7048 void* p;
7049 CoCreateInstance((GUID*)&GUID_NULL, NULL, CLSCTX_INPROC_SERVER, &GUID_NULL, &p);
7050 return 0;
7053 cc_check -lole32 -luuid && _tv_dshow=yes
7056 if test "$_tv_dshow" = yes ; then
7057 inputmodules="tv-dshow $inputmodules"
7058 def_tv_dshow='#define CONFIG_TV_DSHOW 1'
7059 extra_ldflags="$extra_ldflags -lole32 -luuid"
7060 else
7061 noinputmodules="tv-dshow $noinputmodules"
7062 def_tv_dshow='#undef CONFIG_TV_DSHOW'
7064 echores "$_tv_dshow"
7067 echocheck "Video 4 Linux TV interface"
7068 if test "$_tv_v4l1" = auto ; then
7069 _tv_v4l1=no
7070 if test "$_tv" = yes && linux ; then
7071 header_check linux/videodev.h && _tv_v4l1=yes
7074 if test "$_tv_v4l1" = yes ; then
7075 _audio_input=yes
7076 _tv_v4l=yes
7077 def_tv_v4l='#define CONFIG_TV_V4L 1'
7078 def_tv_v4l1='#define CONFIG_TV_V4L1 1'
7079 inputmodules="tv-v4l $inputmodules"
7080 else
7081 noinputmodules="tv-v4l1 $noinputmodules"
7082 def_tv_v4l='#undef CONFIG_TV_V4L'
7084 echores "$_tv_v4l1"
7087 echocheck "Video 4 Linux 2 TV interface"
7088 if test "$_tv_v4l2" = auto ; then
7089 _tv_v4l2=no
7090 if test "$_tv" = yes && linux ; then
7091 header_check linux/videodev2.h && _tv_v4l2=yes
7094 if test "$_tv_v4l2" = yes ; then
7095 _audio_input=yes
7096 _tv_v4l=yes
7097 def_tv_v4l='#define CONFIG_TV_V4L 1'
7098 def_tv_v4l2='#define CONFIG_TV_V4L2 1'
7099 inputmodules="tv-v4l2 $inputmodules"
7100 else
7101 noinputmodules="tv-v4l2 $noinputmodules"
7102 def_tv_v4l2='#undef CONFIG_TV_V4L2'
7104 echores "$_tv_v4l2"
7107 echocheck "Radio interface"
7108 if test "$_radio" = yes ; then
7109 def_radio='#define CONFIG_RADIO 1'
7110 inputmodules="radio $inputmodules"
7111 if test "$_alsa9" != yes -a "$_alsa1x" != yes -a "$_ossaudio" != yes ; then
7112 _radio_capture=no
7114 if test "$_radio_capture" = yes ; then
7115 _audio_input=yes
7116 def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
7117 else
7118 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7120 else
7121 noinputmodules="radio $noinputmodules"
7122 def_radio='#undef CONFIG_RADIO'
7123 def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
7124 _radio_capture=no
7126 echores "$_radio"
7127 echocheck "Capture for Radio interface"
7128 echores "$_radio_capture"
7130 echocheck "Video 4 Linux 2 Radio interface"
7131 if test "$_radio_v4l2" = auto ; then
7132 _radio_v4l2=no
7133 if test "$_radio" = yes && linux ; then
7134 header_check linux/videodev2.h && _radio_v4l2=yes
7137 if test "$_radio_v4l2" = yes ; then
7138 def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
7139 else
7140 def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
7142 echores "$_radio_v4l2"
7144 echocheck "Video 4 Linux Radio interface"
7145 if test "$_radio_v4l" = auto ; then
7146 _radio_v4l=no
7147 if test "$_radio" = yes && linux ; then
7148 header_check linux/videodev.h && _radio_v4l=yes
7151 if test "$_radio_v4l" = yes ; then
7152 def_radio_v4l='#define CONFIG_RADIO_V4L 1'
7153 else
7154 def_radio_v4l='#undef CONFIG_RADIO_V4L'
7156 echores "$_radio_v4l"
7158 if freebsd || netbsd || openbsd || dragonfly || bsdos \
7159 && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
7160 echocheck "*BSD BrookTree 848 Radio interface"
7161 _radio_bsdbt848=no
7162 cat > $TMPC <<EOF
7163 #include <sys/types.h>
7164 $def_ioctl_bt848_h_name
7165 #ifdef IOCTL_BT848_H_NAME
7166 #include IOCTL_BT848_H_NAME
7167 #endif
7168 int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
7170 cc_check && _radio_bsdbt848=yes
7171 echores "$_radio_bsdbt848"
7172 fi #if freebsd || netbsd || openbsd || dragonfly || bsdos && _radio && _radio_bsdbt848
7174 if test "$_radio_bsdbt848" = yes ; then
7175 def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
7176 else
7177 def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
7180 if test "$_radio_v4l" = no && test "$_radio_v4l2" = no && \
7181 test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
7182 die "Radio driver requires BSD BT848, V4L or V4L2!"
7185 echocheck "Video 4 Linux 2 MPEG PVR interface"
7186 if test "$_pvr" = auto ; then
7187 _pvr=no
7188 if test "$_tv_v4l2" = yes && linux ; then
7189 cat > $TMPC <<EOF
7190 #include <linux/videodev2.h>
7191 int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
7193 cc_check && _pvr=yes
7196 if test "$_pvr" = yes ; then
7197 def_pvr='#define CONFIG_PVR 1'
7198 inputmodules="pvr $inputmodules"
7199 else
7200 noinputmodules="pvr $noinputmodules"
7201 def_pvr='#undef CONFIG_PVR'
7203 echores "$_pvr"
7206 echocheck "ftp"
7207 if ! beos && test "$_ftp" = yes ; then
7208 def_ftp='#define CONFIG_FTP 1'
7209 inputmodules="ftp $inputmodules"
7210 else
7211 noinputmodules="ftp $noinputmodules"
7212 def_ftp='#undef CONFIG_FTP'
7214 echores "$_ftp"
7216 echocheck "vstream client"
7217 if test "$_vstream" = auto ; then
7218 _vstream=no
7219 cat > $TMPC <<EOF
7220 #include <vstream-client.h>
7221 void vstream_error(const char *format, ... ) {}
7222 int main(void) { vstream_start(); return 0; }
7224 cc_check -lvstream-client && _vstream=yes
7226 if test "$_vstream" = yes ; then
7227 def_vstream='#define CONFIG_VSTREAM 1'
7228 inputmodules="vstream $inputmodules"
7229 extra_ldflags="$extra_ldflags -lvstream-client"
7230 else
7231 noinputmodules="vstream $noinputmodules"
7232 def_vstream='#undef CONFIG_VSTREAM'
7234 echores "$_vstream"
7237 echocheck "OSD menu"
7238 if test "$_menu" = yes ; then
7239 def_menu='#define CONFIG_MENU 1'
7240 test $_dvbin = "yes" && _menu_dvbin=yes
7241 else
7242 def_menu='#undef CONFIG_MENU'
7243 _menu_dvbin=no
7245 echores "$_menu"
7248 echocheck "Subtitles sorting"
7249 if test "$_sortsub" = yes ; then
7250 def_sortsub='#define CONFIG_SORTSUB 1'
7251 else
7252 def_sortsub='#undef CONFIG_SORTSUB'
7254 echores "$_sortsub"
7257 echocheck "XMMS inputplugin support"
7258 if test "$_xmms" = yes ; then
7259 if ( xmms-config --version ) >/dev/null 2>&1 ; then
7260 _xmmsplugindir=$(xmms-config --input-plugin-dir)
7261 _xmmslibdir=$(xmms-config --exec-prefix)/lib
7262 else
7263 _xmmsplugindir=/usr/lib/xmms/Input
7264 _xmmslibdir=/usr/lib
7267 def_xmms='#define CONFIG_XMMS 1'
7268 if darwin ; then
7269 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.dylib"
7270 else
7271 extra_ldflags="$extra_ldflags ${_xmmslibdir}/libxmms.so.1 -export-dynamic"
7273 else
7274 def_xmms='#undef CONFIG_XMMS'
7276 echores "$_xmms"
7278 if test "$_charset" != "noconv" ; then
7279 def_charset="#define MSG_CHARSET \"$_charset\""
7280 else
7281 def_charset="#undef MSG_CHARSET"
7282 _charset="UTF-8"
7285 #############################################################################
7287 echocheck "automatic gdb attach"
7288 if test "$_crash_debug" = yes ; then
7289 def_crash_debug='#define CONFIG_CRASH_DEBUG 1'
7290 else
7291 def_crash_debug='#undef CONFIG_CRASH_DEBUG'
7292 _crash_debug=no
7294 echores "$_crash_debug"
7296 echocheck "compiler support for noexecstack"
7297 if cflag_check -Wl,-z,noexecstack ; then
7298 extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
7299 echores "yes"
7300 else
7301 echores "no"
7304 echocheck "linker support for --nxcompat --no-seh --dynamicbase"
7305 if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
7306 extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
7307 echores "yes"
7308 else
7309 echores "no"
7313 # Dynamic linking flags
7314 # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly)
7315 _ld_dl_dynamic=''
7316 freebsd || netbsd || openbsd || dragonfly || bsdos && _ld_dl_dynamic='-rdynamic'
7317 if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos; then
7318 _ld_dl_dynamic='-rdynamic'
7321 extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl $_ld_dl_dynamic"
7322 bsdos && extra_ldflags="$extra_ldflags -ldvd"
7323 (netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
7325 def_debug='#undef MP_DEBUG'
7326 test "$_debug" != "" && def_debug='#define MP_DEBUG 1'
7329 echocheck "joystick"
7330 def_joystick='#undef CONFIG_JOYSTICK'
7331 if test "$_joystick" = yes ; then
7332 if linux ; then
7333 # TODO add some check
7334 def_joystick='#define CONFIG_JOYSTICK 1'
7335 else
7336 _joystick="no"
7337 res_comment="unsupported under $system_name"
7340 echores "$_joystick"
7342 echocheck "lirc"
7343 if test "$_lirc" = auto ; then
7344 _lirc=no
7345 header_check lirc/lirc_client.h -llirc_client && _lirc=yes
7347 if test "$_lirc" = yes ; then
7348 def_lirc='#define CONFIG_LIRC 1'
7349 libs_mplayer="$libs_mplayer -llirc_client"
7350 else
7351 def_lirc='#undef CONFIG_LIRC'
7353 echores "$_lirc"
7355 echocheck "lircc"
7356 if test "$_lircc" = auto ; then
7357 _lircc=no
7358 header_check lirc/lircc.h -llircc && _lircc=yes
7360 if test "$_lircc" = yes ; then
7361 def_lircc='#define CONFIG_LIRCC 1'
7362 libs_mplayer="$libs_mplayer -llircc"
7363 else
7364 def_lircc='#undef CONFIG_LIRCC'
7366 echores "$_lircc"
7368 if arm; then
7369 # Detect maemo development platform libraries availability (http://www.maemo.org),
7370 # they are used when run on Nokia 770|8x0
7371 echocheck "maemo (Nokia 770|8x0)"
7372 if test "$_maemo" = auto ; then
7373 _maemo=no
7374 function_check libosso.h 'osso_initialize('', '', 0, NULL)' $($_pkg_config --cflags --libs libosso 2>/dev/null) && _maemo=yes
7376 if test "$_maemo" = yes ; then
7377 def_maemo='#define CONFIG_MAEMO 1'
7378 extra_cflags="$extra_cflags $($_pkg_config --cflags libosso)"
7379 extra_ldflags="$extra_ldflags $($_pkg_config --libs libosso) -lXsp"
7380 else
7381 def_maemo='#undef CONFIG_MAEMO'
7383 echores "$_maemo"
7386 #############################################################################
7388 # On OS/2 nm supports only a.out. So the -Zomf compiler option to generate
7389 # the OMF format needs to come after the 'extern symbol prefix' check, which
7390 # uses nm.
7391 if os2 ; then
7392 extra_ldflags="$extra_ldflags -Zomf -Zstack 16384 -Zbin-files -Zargs-wild"
7395 # linker paths should be the same for mencoder and mplayer
7396 _ld_tmp=""
7397 for I in $libs_mplayer ; do
7398 _tmp=$(echo $I | sed -e 's/^-L.*$//')
7399 if test -z "$_tmp" ; then
7400 extra_ldflags="$extra_ldflags $I"
7401 else
7402 _ld_tmp="$_ld_tmp $I"
7404 done
7405 libs_mplayer=$_ld_tmp
7408 #############################################################################
7409 # 64 bit file offsets?
7410 if test "$_largefiles" = yes || freebsd ; then
7411 CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
7412 if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
7413 # dvdread support requires this (for off64_t)
7414 CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
7418 CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS"
7420 # This must be the last test to be performed. Any other tests following it
7421 # could fail due to linker errors. libdvdnavmini is intentionally not linked
7422 # against libdvdread (to permit MPlayer to use its own copy of the library).
7423 # So any compilation using the flags added here but not linking against
7424 # libdvdread can fail.
7425 echocheck "DVD support (libdvdnav)"
7426 if test "$_dvdread_internal" = yes && test ! -f "libdvdnav/dvdnav.c" ; then
7427 _dvdnav=no
7429 dvdnav_internal=no
7430 if test "$_dvdnav" = auto ; then
7431 if test "$_dvdread_internal" = yes ; then
7432 _dvdnav=yes
7433 dvdnav_internal=yes
7434 res_comment="internal"
7435 else
7436 $_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
7439 if test "$_dvdnav" = auto ; then
7440 cat > $TMPC <<EOF
7441 #include <inttypes.h>
7442 #include <dvdnav/dvdnav.h>
7443 int main(void) { dvdnav_t *dvd=0; return 0; }
7445 _dvdnav=no
7446 _dvdnavdir=$($_dvdnavconfig --cflags)
7447 _dvdnavlibs=$($_dvdnavconfig --libs)
7448 cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
7450 if test "$_dvdnav" = yes ; then
7451 _largefiles=yes
7452 def_dvdnav='#define CONFIG_DVDNAV 1'
7453 if test "$dvdnav_internal" = yes ; then
7454 cflags_libdvdnav="-Ilibdvdnav"
7455 inputmodules="dvdnav(internal) $inputmodules"
7456 else
7457 extra_cflags="$extra_cflags $($_dvdnavconfig --cflags)"
7458 extra_ldflags="$extra_ldflags $($_dvdnavconfig --minilibs)"
7459 inputmodules="dvdnav $inputmodules"
7461 else
7462 def_dvdnav='#undef CONFIG_DVDNAV'
7463 noinputmodules="dvdnav $noinputmodules"
7465 echores "$_dvdnav"
7467 # DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
7468 # Read dvdnav comment above.
7470 mak_enable () {
7471 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7472 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7473 nprefix=$3;
7474 for part in $list; do
7475 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7476 echo "${nprefix}_$part = yes"
7478 done
7481 #############################################################################
7482 echo "Creating config.mak"
7483 cat > config.mak << EOF
7484 # -------- Generated by configure -----------
7486 # Ensure that locale settings do not interfere with shell commands.
7487 export LC_ALL = C
7489 CONFIGURATION = $configuration
7491 CHARSET = $_charset
7492 DOC_LANGS = $language_doc
7493 DOC_LANG_ALL = $doc_lang_all
7494 MAN_LANGS = $language_man
7495 MAN_LANG_ALL = $man_lang_all
7496 MSG_LANGS = $language_msg
7497 MSG_LANG_ALL = $msg_lang_all
7499 prefix = \$(DESTDIR)$_prefix
7500 BINDIR = \$(DESTDIR)$_bindir
7501 DATADIR = \$(DESTDIR)$_datadir
7502 LIBDIR = \$(DESTDIR)$_libdir
7503 MANDIR = \$(DESTDIR)$_mandir
7504 CONFDIR = \$(DESTDIR)$_confdir
7505 LOCALEDIR = \$(DESTDIR)$_localedir
7507 AR = $_ar
7508 AS = $_cc
7509 CC = $_cc
7510 CXX = $_cc
7511 HOST_CC = $_host_cc
7512 INSTALL = $_install
7513 INSTALLSTRIP = $_install_strip
7514 WINDRES = $_windres
7516 CFLAGS = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
7517 CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
7518 DEPFLAGS = $DEPFLAGS
7520 CFLAGS_DHAHELPER = $cflags_dhahelper
7521 CFLAGS_FAAD_FIXED = $cflags_faad_fixed
7522 CFLAGS_LIBDVDCSS = $cflags_libdvdcss
7523 CFLAGS_LIBDVDCSS_DVDREAD = $cflags_libdvdcss_dvdread
7524 CFLAGS_LIBDVDNAV = $cflags_libdvdnav
7525 CFLAGS_NO_OMIT_LEAF_FRAME_POINTER = $cflags_no_omit_leaf_frame_pointer
7526 CFLAGS_STACKREALIGN = $cflags_stackrealign
7527 CFLAGS_SVGALIB_HELPER = $cflags_svgalib_helper
7528 CFLAGS_TREMOR_LOW = $cflags_tremor_low
7530 EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
7531 EXTRALIBS_MPLAYER = $libs_mplayer
7532 EXTRALIBS_MENCODER = $libs_mencoder
7534 GETCH = $_getch
7535 TIMER = $_timer
7537 EXESUF = $_exesuf
7538 EXESUFS_ALL = .exe
7540 ARCH = $arch
7541 $(mak_enable "$arch_all" "$arch" ARCH)
7542 $(mak_enable "$subarch_all" "$subarch" ARCH)
7543 $(mak_enable "$cpuexts_all" "$cpuexts" HAVE)
7545 MENCODER = $_mencoder
7546 MPLAYER = $_mplayer
7548 NEED_GETTIMEOFDAY = $_need_gettimeofday
7549 NEED_GLOB = $_need_glob
7550 NEED_MMAP = $_need_mmap
7551 NEED_SETENV = $_need_setenv
7552 NEED_SHMEM = $_need_shmem
7553 NEED_STRSEP = $_need_strsep
7554 NEED_SWAB = $_need_swab
7555 NEED_VSSCANF = $_need_vsscanf
7557 # features
7558 3DFX = $_3dfx
7559 AA = $_aa
7560 ALSA1X = $_alsa1x
7561 ALSA9 = $_alsa9
7562 ALSA5 = $_alsa5
7563 APPLE_IR = $_apple_ir
7564 APPLE_REMOTE = $_apple_remote
7565 ARTS = $_arts
7566 AUDIO_INPUT = $_audio_input
7567 BITMAP_FONT = $_bitmap_font
7568 BL = $_bl
7569 CACA = $_caca
7570 CDDA = $_cdda
7571 CDDB = $_cddb
7572 COREAUDIO = $_coreaudio
7573 COREVIDEO = $_corevideo
7574 DART = $_dart
7575 DFBMGA = $_dfbmga
7576 DGA = $_dga
7577 DIRECT3D = $_direct3d
7578 DIRECTFB = $_directfb
7579 DIRECTX = $_directx
7580 DVBIN = $_dvbin
7581 DVDNAV = $_dvdnav
7582 DVDNAV_INTERNAL = $dvdnav_internal
7583 DVDREAD = $_dvdread
7584 DVDREAD_INTERNAL = $_dvdread_internal
7585 DXR2 = $_dxr2
7586 DXR3 = $_dxr3
7587 ESD = $_esd
7588 FAAC=$_faac
7589 FAAD = $_faad
7590 FAAD_INTERNAL = $_faad_internal
7591 FASTMEMCPY = $_fastmemcpy
7592 FBDEV = $_fbdev
7593 FREETYPE = $_freetype
7594 FTP = $_ftp
7595 GIF = $_gif
7596 GGI = $_ggi
7597 GL = $_gl
7598 GL_WIN32 = $_gl_win32
7599 GL_X11 = $_gl_x11
7600 GL_SDL = $_gl_sdl
7601 MATRIXVIEW = $matrixview
7602 HAVE_POSIX_SELECT = $_posix_select
7603 HAVE_SYS_MMAN_H = $_mman
7604 IVTV = $_ivtv
7605 JACK = $_jack
7606 JOYSTICK = $_joystick
7607 JPEG = $_jpeg
7608 KAI = $_kai
7609 KVA = $_kva
7610 LADSPA = $_ladspa
7611 LIBA52 = $_liba52
7612 LIBASS = $_ass
7613 LIBBLURAY = $_bluray
7614 LIBBS2B = $_libbs2b
7615 LIBDCA = $_libdca
7616 LIBDV = $_libdv
7617 LIBDVDCSS_INTERNAL = $_libdvdcss_internal
7618 LIBLZO = $_liblzo
7619 LIBMAD = $_mad
7620 LIBMENU = $_menu
7621 LIBMENU_DVBIN = $_menu_dvbin
7622 LIBMPEG2 = $_libmpeg2
7623 LIBNEMESI = $_nemesi
7624 LIBNUT = $_libnut
7625 LIBSMBCLIENT = $_smb
7626 LIBTHEORA = $_theora
7627 LIRC = $_lirc
7628 LIVE555 = $_live
7629 MACOSX_FINDER = $_macosx_finder
7630 MD5SUM = $_md5sum
7631 MGA = $_mga
7632 MNG = $_mng
7633 MP3LAME = $_mp3lame
7634 MP3LIB = $_mp3lib
7635 MPG123 = $_mpg123
7636 MUSEPACK = $_musepack
7637 NAS = $_nas
7638 NATIVE_RTSP = $_native_rtsp
7639 NETWORKING = $networking
7640 OPENAL = $_openal
7641 OSS = $_ossaudio
7642 PE_EXECUTABLE = $_pe_executable
7643 PNG = $_png
7644 PNM = $_pnm
7645 PRIORITY = $_priority
7646 PULSE = $_pulse
7647 PVR = $_pvr
7648 QTX_CODECS = $_qtx
7649 QTX_CODECS_WIN32 = $_qtx_codecs_win32
7650 QTX_EMULATION = $_qtx_emulation
7651 QUARTZ = $_quartz
7652 RADIO=$_radio
7653 RADIO_CAPTURE=$_radio_capture
7654 REAL_CODECS = $_real
7655 S3FB = $_s3fb
7656 SDL = $_sdl
7657 SPEEX = $_speex
7658 STREAM_CACHE = $_stream_cache
7659 SGIAUDIO = $_sgiaudio
7660 SUNAUDIO = $_sunaudio
7661 SVGA = $_svga
7662 TDFXFB = $_tdfxfb
7663 TDFXVID = $_tdfxvid
7664 TGA = $_tga
7665 TOOLAME=$_toolame
7666 TREMOR_INTERNAL = $_tremor_internal
7667 TV = $_tv
7668 TV_BSDBT848 = $_tv_bsdbt848
7669 TV_DSHOW = $_tv_dshow
7670 TV_V4L = $_tv_v4l
7671 TV_V4L1 = $_tv_v4l1
7672 TV_V4L2 = $_tv_v4l2
7673 TWOLAME=$_twolame
7674 UNRAR_EXEC = $_unrar_exec
7675 V4L2 = $_v4l2
7676 VCD = $_vcd
7677 VDPAU = $_vdpau
7678 VESA = $_vesa
7679 VIDIX = $_vidix
7680 VIDIX_PCIDB = $_vidix_pcidb_val
7681 VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
7682 VIDIX_IVTV=$_vidix_drv_ivtv
7683 VIDIX_MACH64=$_vidix_drv_mach64
7684 VIDIX_MGA=$_vidix_drv_mga
7685 VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
7686 VIDIX_NVIDIA=$_vidix_drv_nvidia
7687 VIDIX_PM2=$_vidix_drv_pm2
7688 VIDIX_PM3=$_vidix_drv_pm3
7689 VIDIX_RADEON=$_vidix_drv_radeon
7690 VIDIX_RAGE128=$_vidix_drv_rage128
7691 VIDIX_S3=$_vidix_drv_s3
7692 VIDIX_SH_VEU=$_vidix_drv_sh_veu
7693 VIDIX_SIS=$_vidix_drv_sis
7694 VIDIX_UNICHROME=$_vidix_drv_unichrome
7695 VORBIS = $_vorbis
7696 VSTREAM = $_vstream
7697 WII = $_wii
7698 WIN32DLL = $_win32dll
7699 WIN32WAVEOUT = $_win32waveout
7700 WIN32_EMULATION = $_win32_emulation
7701 WINVIDIX = $winvidix
7702 X11 = $_x11
7703 X264 = $_x264
7704 XANIM_CODECS = $_xanim
7705 XMGA = $_xmga
7706 XMMS_PLUGINS = $_xmms
7707 XV = $_xv
7708 XVID4 = $_xvid
7709 XVIDIX = $xvidix
7710 XVMC = $_xvmc
7711 XVR100 = $_xvr100
7712 YUV4MPEG = $_yuv4mpeg
7713 ZR = $_zr
7715 # FFmpeg
7716 FFMPEG = $ffmpeg
7717 FFMPEG_INTERNALS = $ffmpeg_internals
7718 FFMPEG_SOURCE_PATH = $_ffmpeg_source
7720 RANLIB = $_ranlib
7721 YASM = $_yasm
7722 YASMFLAGS = $YASMFLAGS
7724 # Some FFmpeg codecs depend on these. Enable them unconditionally for now.
7725 CONFIG_AANDCT = yes
7726 CONFIG_FFT = yes
7727 CONFIG_GOLOMB = yes
7728 CONFIG_H264DSP = yes
7729 CONFIG_LPC = yes
7730 CONFIG_MDCT = yes
7731 CONFIG_RDFT = yes
7733 CONFIG_BZLIB = $bzlib
7734 CONFIG_ENCODERS = yes
7735 CONFIG_GPL = yes
7736 CONFIG_MLIB = $_mlib
7737 CONFIG_MUXERS = $_mencoder
7738 CONFIG_VDPAU = $_vdpau
7739 CONFIG_XVMC = $_xvmc
7740 CONFIG_ZLIB = $_zlib
7742 HAVE_PTHREADS = $_pthreads
7743 HAVE_SHM = $_shm
7744 HAVE_W32THREADS = $_w32threads
7745 HAVE_YASM = $have_yasm
7749 #############################################################################
7751 ff_config_enable () {
7752 list=$(echo $1 | tr '[a-z]' '[A-Z]')
7753 item=$(echo $2 | tr '[a-z]' '[A-Z]')
7754 _nprefix=$3;
7755 test -z "$_nprefix" && _nprefix='CONFIG'
7756 for part in $list; do
7757 if $(echo $item | grep -q -E "(^| )$part($| )"); then
7758 echo "#define ${_nprefix}_$part 1"
7759 else
7760 echo "#define ${_nprefix}_$part 0"
7762 done
7765 echo "Creating config.h"
7766 cat > $TMPH << EOF
7767 /*----------------------------------------------------------------------------
7768 ** This file has been automatically generated by configure any changes in it
7769 ** will be lost when you run configure again.
7770 ** Instead of modifying definitions here, use the --enable/--disable options
7771 ** of the configure script! See ./configure --help for details.
7772 *---------------------------------------------------------------------------*/
7774 #ifndef MPLAYER_CONFIG_H
7775 #define MPLAYER_CONFIG_H
7777 /* Undefine this if you do not want to select mono audio (left or right)
7778 with a stereo MPEG layer 2/3 audio stream. The command line option
7779 -stereo has three possible values (0 for stereo, 1 for left-only, 2 for
7780 right-only), with 0 being the default.
7782 #define CONFIG_FAKE_MONO 1
7784 /* set up audio OUTBURST. Do not change this! */
7785 #define OUTBURST 512
7787 /* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
7788 #undef FAST_OSD
7789 #undef FAST_OSD_TABLE
7791 /* Define this to enable MPEG-1/2 image postprocessing in libmpeg2 */
7792 #define MPEG12_POSTPROC 1
7793 #define ATTRIBUTE_ALIGNED_MAX 16
7797 #define CONFIGURATION "$configuration"
7799 #define MPLAYER_DATADIR "$_datadir"
7800 #define MPLAYER_CONFDIR "$_confdir"
7801 #define MPLAYER_LIBDIR "$_libdir"
7802 #define MPLAYER_LOCALEDIR "$_localedir"
7804 $def_translation
7806 /* definitions needed by included libraries */
7807 #define HAVE_INTTYPES_H 1
7808 /* libmpeg2 + FFmpeg */
7809 $def_fast_inttypes
7810 /* libdvdcss */
7811 #define HAVE_ERRNO_H 1
7812 /* libdvdcss + libdvdread */
7813 #define HAVE_LIMITS_H 1
7814 /* libdvdcss + libfaad2 */
7815 #define HAVE_UNISTD_H 1
7816 /* libfaad2 + libdvdread */
7817 #define STDC_HEADERS 1
7818 #define HAVE_MEMCPY 1
7819 /* libfaad2 */
7820 #define HAVE_STRING_H 1
7821 #define HAVE_STRINGS_H 1
7822 #define HAVE_SYS_STAT_H 1
7823 #define HAVE_SYS_TYPES_H 1
7824 /* libdvdnav */
7825 #define READ_CACHE_TRACE 0
7826 /* libdvdread */
7827 #define HAVE_DLFCN_H 1
7828 $def_dvdcss
7831 /* system headers */
7832 $def_alloca_h
7833 $def_alsa_asoundlib_h
7834 $def_altivec_h
7835 $def_malloc_h
7836 $def_mman_h
7837 $def_mman_has_map_failed
7838 $def_soundcard_h
7839 $def_sys_asoundlib_h
7840 $def_sys_soundcard_h
7841 $def_sys_sysinfo_h
7842 $def_termios_h
7843 $def_termios_sys_h
7844 $def_winsock2_h
7847 /* system functions */
7848 $def_gethostbyname2
7849 $def_gettimeofday
7850 $def_glob
7851 $def_langinfo
7852 $def_lrintf
7853 $def_map_memalign
7854 $def_memalign
7855 $def_nanosleep
7856 $def_posix_select
7857 $def_select
7858 $def_setenv
7859 $def_setmode
7860 $def_shm
7861 $def_strsep
7862 $def_swab
7863 $def_sysi86
7864 $def_sysi86_iv
7865 $def_termcap
7866 $def_termios
7867 $def_vsscanf
7870 /* system-specific features */
7871 $def_asmalign_pot
7872 $def_builtin_expect
7873 $def_dl
7874 $def_dos_paths
7875 $def_extern_asm
7876 $def_extern_prefix
7877 $def_iconv
7878 $def_kstat
7879 $def_macosx_bundle
7880 $def_macosx_finder
7881 $def_maemo
7882 $def_named_asm_args
7883 $def_priority
7884 $def_quicktime
7885 $def_restrict_keyword
7886 $def_rtc
7887 $def_unrar_exec
7890 /* configurable options */
7891 $def_charset
7892 $def_crash_debug
7893 $def_debug
7894 $def_dynamic_plugins
7895 $def_fastmemcpy
7896 $def_menu
7897 $def_runtime_cpudetection
7898 $def_sighandler
7899 $def_sortsub
7900 $def_stream_cache
7901 $def_pthread_cache
7904 /* CPU stuff */
7905 #define __CPU__ $iproc
7906 $def_ebx_available
7907 $def_words_endian
7908 $def_bigendian
7909 $(ff_config_enable "$arch_all" "$arch" "ARCH")
7910 $(ff_config_enable "$subarch_all" "$subarch" "ARCH")
7911 $(ff_config_enable "$cpuexts_all" "$cpuexts" "HAVE")
7914 /* Blu-ray/DVD/VCD/CD */
7915 #define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
7916 #define DEFAULT_DVD_DEVICE "$default_dvd_device"
7917 $def_bluray
7918 $def_bsdi_dvd
7919 $def_cddb
7920 $def_cdio
7921 $def_cdparanoia
7922 $def_cdrom
7923 $def_dvd
7924 $def_dvd_bsd
7925 $def_dvd_darwin
7926 $def_dvd_linux
7927 $def_dvd_openbsd
7928 $def_dvdio
7929 $def_dvdnav
7930 $def_dvdread
7931 $def_hpux_scsi_h
7932 $def_libcdio
7933 $def_sol_scsi_h
7934 $def_vcd
7937 /* codec libraries */
7938 $def_faac
7939 $def_faad
7940 $def_faad_internal
7941 $def_liba52
7942 $def_libdca
7943 $def_libdv
7944 $def_liblzo
7945 $def_libmpeg2
7946 $def_mad
7947 $def_mp3lame
7948 $def_mp3lame_preset
7949 $def_mp3lame_preset_medium
7950 $def_mp3lib
7951 $def_mpg123
7952 $def_musepack
7953 $def_speex
7954 $def_theora
7955 $def_toolame
7956 $def_tremor
7957 $def_twolame
7958 $def_vorbis
7959 $def_x264
7960 $def_xvid
7961 $def_zlib
7963 $def_libnut
7966 /* binary codecs */
7967 $def_qtx
7968 $def_qtx_win32
7969 $def_real
7970 $def_win32_loader
7971 $def_win32dll
7972 $def_xanim
7973 $def_xmms
7974 #define BINARY_CODECS_PATH "$_codecsdir"
7975 #define XMMS_INPUT_PLUGIN_DIR "$_xmmsplugindir"
7978 /* Audio output drivers */
7979 $def_alsa
7980 $def_alsa1x
7981 $def_alsa5
7982 $def_alsa9
7983 $def_arts
7984 $def_coreaudio
7985 $def_dart
7986 $def_esd
7987 $def_esd_latency
7988 $def_jack
7989 $def_kai
7990 $def_nas
7991 $def_openal
7992 $def_openal_h
7993 $def_ossaudio
7994 $def_ossaudio_devdsp
7995 $def_ossaudio_devmixer
7996 $def_pulse
7997 $def_sgiaudio
7998 $def_sunaudio
7999 $def_win32waveout
8001 $def_ladspa
8002 $def_libbs2b
8005 /* input */
8006 $def_apple_ir
8007 $def_apple_remote
8008 $def_ioctl_bt848_h_name
8009 $def_ioctl_meteor_h_name
8010 $def_joystick
8011 $def_lirc
8012 $def_lircc
8013 $def_pvr
8014 $def_radio
8015 $def_radio_bsdbt848
8016 $def_radio_capture
8017 $def_radio_v4l
8018 $def_radio_v4l2
8019 $def_tv
8020 $def_tv_bsdbt848
8021 $def_tv_dshow
8022 $def_tv_v4l
8023 $def_tv_v4l1
8024 $def_tv_v4l2
8027 /* font stuff */
8028 $def_ass
8029 $def_bitmap_font
8030 $def_enca
8031 $def_fontconfig
8032 $def_freetype
8033 $def_fribidi
8036 /* networking */
8037 $def_closesocket
8038 $def_ftp
8039 $def_inet6
8040 $def_inet_aton
8041 $def_inet_pton
8042 $def_live
8043 $def_nemesi
8044 $def_networking
8045 $def_smb
8046 $def_socklen_t
8047 $def_vstream
8050 /* libvo options */
8051 $def_3dfx
8052 $def_aa
8053 $def_bl
8054 $def_caca
8055 $def_corevideo
8056 $def_dfbmga
8057 $def_dga
8058 $def_dga1
8059 $def_dga2
8060 $def_direct3d
8061 $def_directfb
8062 $def_directfb_version
8063 $def_directx
8064 $def_dvb
8065 $def_dvbin
8066 $def_dxr2
8067 $def_dxr3
8068 $def_fbdev
8069 $def_ggi
8070 $def_ggiwmh
8071 $def_gif
8072 $def_gif_4
8073 $def_gif_tvt_hack
8074 $def_gl
8075 $def_gl_win32
8076 $def_gl_x11
8077 $def_gl_sdl
8078 $def_matrixview
8079 $def_ivtv
8080 $def_jpeg
8081 $def_kva
8082 $def_md5sum
8083 $def_mga
8084 $def_mng
8085 $def_png
8086 $def_pnm
8087 $def_quartz
8088 $def_s3fb
8089 $def_sdl
8090 $def_sdl_sdl_h
8091 $def_svga
8092 $def_tdfxfb
8093 $def_tdfxvid
8094 $def_tga
8095 $def_v4l2
8096 $def_vdpau
8097 $def_vesa
8098 $def_vidix
8099 $def_vidix_drv_cyberblade
8100 $def_vidix_drv_ivtv
8101 $def_vidix_drv_mach64
8102 $def_vidix_drv_mga
8103 $def_vidix_drv_mga_crtc2
8104 $def_vidix_drv_nvidia
8105 $def_vidix_drv_pm3
8106 $def_vidix_drv_radeon
8107 $def_vidix_drv_rage128
8108 $def_vidix_drv_s3
8109 $def_vidix_drv_sh_veu
8110 $def_vidix_drv_sis
8111 $def_vidix_drv_unichrome
8112 $def_vidix_pfx
8113 $def_vm
8114 $def_wii
8115 $def_x11
8116 $def_xdpms
8117 $def_xf86keysym
8118 $def_xinerama
8119 $def_xmga
8120 $def_xss
8121 $def_xv
8122 $def_xvmc
8123 $def_xvr100
8124 $def_yuv4mpeg
8125 $def_zr
8128 /* FFmpeg */
8129 $def_ffmpeg
8130 $def_ffmpeg_internals
8132 #define CONFIG_DECODERS 1
8133 #define CONFIG_ENCODERS 1
8134 #define CONFIG_DEMUXERS 1
8135 $def_muxers
8137 $def_arpa_inet_h
8138 $def_bswap
8139 $def_bzlib
8140 $def_dcbzl
8141 $def_exp2
8142 $def_exp2f
8143 $def_fast_64bit
8144 $def_fast_unaligned
8145 $def_llrint
8146 $def_log2
8147 $def_log2f
8148 $def_lrint
8149 $def_memalign_hack
8150 $def_mlib
8151 $def_mkstemp
8152 $def_posix_memalign
8153 $def_pthreads
8154 $def_round
8155 $def_roundf
8156 $def_ten_operands
8157 $def_threads
8158 $def_truncf
8159 $def_xform_asm
8160 $def_yasm
8162 #define CONFIG_FASTDIV 0
8163 #define CONFIG_FFSERVER 0
8164 #define CONFIG_GPL 1
8165 #define CONFIG_GRAY 0
8166 #define CONFIG_HARDCODED_TABLES 0
8167 #define CONFIG_LIBVORBIS 0
8168 #define CONFIG_POWERPC_PERF 0
8169 #define CONFIG_SMALL 0
8170 #define CONFIG_SWSCALE_ALPHA 1
8172 #define HAVE_ATTRIBUTE_PACKED 1
8173 #define HAVE_GETHRTIME 0
8174 #define HAVE_INLINE_ASM 1
8175 #define HAVE_LDBRX 0
8176 #define HAVE_POLL_H 1
8177 #define HAVE_PPC4XX 0
8178 #define HAVE_VFP_ARGS 1
8179 #define HAVE_VIRTUALALLOC 0
8181 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */
8182 #define CONFIG_AANDCT 1
8183 #define CONFIG_DCT 1
8184 #define CONFIG_DWT 1
8185 #define CONFIG_FFT 1
8186 #define CONFIG_GOLOMB 1
8187 #define CONFIG_H264DSP 1
8188 #define CONFIG_LPC 1
8189 #define CONFIG_MDCT 1
8190 #define CONFIG_RDFT 1
8192 /* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
8193 #ifndef MP_DEBUG
8194 #define HAVE_EBP_AVAILABLE 1
8195 #else
8196 #define HAVE_EBP_AVAILABLE 0
8197 #endif
8199 #endif /* MPLAYER_CONFIG_H */
8202 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8203 cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
8205 #############################################################################
8207 ./version.sh `$_cc -dumpversion`
8209 cat << EOF
8211 Config files successfully generated by ./configure $configuration !
8213 Install prefix: $_prefix
8214 Data directory: $_datadir
8215 Config direct.: $_confdir
8217 Byte order: $_byte_order
8218 Optimizing for: $_optimizing
8220 Languages:
8221 Messages (in addition to English): $language_msg
8222 Manual pages: $language_man
8223 Documentation: $language_doc
8225 Enabled optional drivers:
8226 Input: $inputmodules
8227 Codecs: $codecmodules
8228 Audio output: $aomodules
8229 Video output: $vomodules
8231 Disabled optional drivers:
8232 Input: $noinputmodules
8233 Codecs: $nocodecmodules
8234 Audio output: $noaomodules
8235 Video output: $novomodules
8237 'config.h' and 'config.mak' contain your configuration options.
8238 Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
8239 compile *** DO NOT REPORT BUGS if you tweak these files ***
8241 'make' will now compile MPlayer and 'make install' will install it.
8242 Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
8247 if test "$_mtrr" = yes ; then
8248 echo "Please check mtrr settings at /proc/mtrr (see DOCS/HTML/$language_doc/video.html#mtrr)"
8249 echo
8252 if ! x86_32; then
8253 cat <<EOF
8254 NOTE: Win32 codec DLLs are not supported on your CPU ($host_arch) or your
8255 operating system ($system_name). You may encounter a few files that cannot
8256 be played due to missing open source video/audio codec support.
8262 cat <<EOF
8263 Check $TMPLOG if you wonder why an autodetection failed (make sure
8264 development headers/packages are installed).
8266 NOTE: The --enable-* parameters unconditionally force options on, completely
8267 skipping autodetection. This behavior is unlike what you may be used to from
8268 autoconf-based configure scripts that can decide to override you. This greater
8269 level of control comes at a price. You may have to provide the correct compiler
8270 and linker flags yourself.
8271 If you used one of these options (except --enable-menu and similar ones that
8272 turn on internal features) and experience a compilation or linking failure,
8273 make sure you have passed the necessary compiler/linker flags to configure.
8275 If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
8279 if test "$warn_cflags" = yes; then
8280 cat <<EOF
8282 MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS/YASMFLAGS set by you,
8283 but:
8285 *** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
8287 It is strongly recommended to let MPlayer choose the correct CFLAGS!
8288 To do so, execute 'CFLAGS= ./configure <options>'
8293 # Last move:
8294 rm -rf "$mplayer_tmpdir"