#! /bin/sh # # Original version (C) 2000 Pontscho/fresh!mindworkz # pontscho@makacs.poliod.hu # # History / Contributors: Check the Subversion log. # # Cleanups all over the place (c) 2001 pl # # # This configure script is *not* autoconf-based and has different semantics. # It attempts to autodetect all settings and options where possible. It is # possible to override autodetection with the --enable-option/--disable-option # command line parameters. --enable-option forces the option on skipping # autodetection. Yes, this means that compilation may fail and yes, this is not # how autoconf-based configure scripts behave. # # configure generates a series of configuration files: # - config.h contains #defines that are used in the C code. # - config.mak is included from the Makefiles. # # If you want to add a new check for $feature, here is a simple skeleton: # # echocheck "$feature" # if test "$_feature" = auto; then # cat > $TMPC << EOF # #include # int main(void) { return 0; } # EOF # _feature=no # cc_check && _feature=yes # fi # if test "$_feature" = yes ; then # def_feature='#define CONFIG_FEATURE 1' # else # def_feature='#undef CONFIG_FEATURE' # fi # echores "$_feature" # # Furthermore you need to add the variable _feature to the list of default # settings and set it to one of yes/no/auto. Also add appropriate # --enable-feature/--disable-feature command line options. # The results of the check should be written to config.h and config.mak # at the end of this script. The variable names used for this should be # uniform, i.e. if the option is named 'feature': # # _feature : should have a value of yes/no/auto # def_feature : '#define ... 1' or '#undef ...' for conditional compilation # _ld_feature : '-L/path/dir -lfeature' GCC options # ############################################################################# # Prevent locale nonsense from breaking basic text processing utils export LC_ALL=C # Store the configure line that was used _configuration="$*" # Prefer these macros to full length text ! # These macros only return an error code - NO display is done compile_check() { echo >> "$TMPLOG" cat "$1" >> "$TMPLOG" echo >> "$TMPLOG" echo "$_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o $TMPEXE $@" >> "$TMPLOG" rm -f "$TMPEXE" $_cc $CFLAGS $extra_cflags $_ld_static $extra_ldflags $libs_mplayer $libs_mencoder -o "$TMPEXE" "$@" >> "$TMPLOG" 2>&1 TMPRES="$?" echo >> "$TMPLOG" echo >> "$TMPLOG" return "$TMPRES" } cc_check() { compile_check $TMPC $@ } cxx_check() { compile_check $TMPCPP $@ -lstdc++ } yasm_check() { echo >> "$TMPLOG" cat "$TMPS" >> "$TMPLOG" echo >> "$TMPLOG" echo "$_yasm $YASMFLAGS -o $TMPEXE $TMPS $@" >> "$TMPLOG" rm -f "$TMPEXE" $_yasm $YASMFLAGS -o "$TMPEXE" "$TMPS" "$@" >> "$TMPLOG" 2>&1 TMPRES="$?" echo >> "$TMPLOG" echo >> "$TMPLOG" return "$TMPRES" } tmp_run() { "$TMPEXE" >> "$TMPLOG" 2>&1 } # Display error message, flushes tempfile, exit die () { echo echo "Error: $@" >&2 echo >&2 rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" echo "Check \"$TMPLOG\" if you do not understand why it failed." exit 1 } # OS test booleans functions issystem() { test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)" } aix() { issystem "AIX"; } amigaos() { issystem "AmigaOS"; } beos() { issystem "BEOS"; } bsdos() { issystem "BSD/OS"; } cygwin() { issystem "CYGWIN"; } darwin() { issystem "Darwin"; } dragonfly() { issystem "DragonFly"; } freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; } gnu() { issystem "GNU"; } hpux() { issystem "HP-UX"; } irix() { issystem "IRIX"; } linux() { issystem "Linux"; } mingw32() { issystem "MINGW32"; } morphos() { issystem "MorphOS"; } netbsd() { issystem "NetBSD"; } openbsd() { issystem "OpenBSD"; } os2() { issystem "OS/2"; } qnx() { issystem "QNX"; } sunos() { issystem "SunOS"; } win32() { cygwin || mingw32; } # arch test boolean functions # x86/x86pc is used by QNX x86_32() { case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;; *) return 1 ;; esac } x86_64() { case "$host_arch" in x86_64|amd64) return 0 ;; *) return 1 ;; esac } x86() { x86_32 || x86_64 } ppc() { case "$host_arch" in ppc|ppc64|powerpc|powerpc64) return 0;; *) return 1;; esac } alpha() { case "$host_arch" in alpha*) return 0;; *) return 1;; esac } arm() { case "$host_arch" in arm) return 0;; *) return 1;; esac } # Use this before starting a check echocheck() { echo "============ Checking for $@ ============" >> "$TMPLOG" echo ${_echo_n} "Checking for $@ ... ${_echo_c}" } # Use this to echo the results of a check echores() { if test "$_res_comment" ; then _res_comment="($_res_comment)" fi echo "Result is: $@ $_res_comment" >> "$TMPLOG" echo "##########################################" >> "$TMPLOG" echo "" >> "$TMPLOG" echo "$@ $_res_comment" _res_comment="" } ############################################################################# # Check how echo works in this /bin/sh case $(echo -n) in -n) _echo_n= _echo_c='\c' ;; # SysV echo *) _echo_n='-n ' _echo_c= ;; # BSD echo esac msg_lang_all=$(echo help/help_mp-??.h help/help_mp-??_??.h | sed -e "s:help/help_mp-\(..\).h:\1:g" -e "s:help/help_mp-\(.....\).h:\1:g") 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") doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g") show_help(){ cat << EOF Usage: $0 [OPTIONS]... Configuration: -h, --help display this help and exit Installation directories: --prefix=DIR prefix directory for installation [/usr/local] --bindir=DIR directory for installing binaries [PREFIX/bin] --datadir=DIR directory for installing machine independent data files (skins, etc) [PREFIX/share/mplayer] --mandir=DIR directory for installing man pages [PREFIX/share/man] --confdir=DIR directory for installing configuration files [PREFIX/etc/mplayer] --libdir=DIR directory for object code libraries [PREFIX/lib] --codecsdir=DIR directory for binary codecs [LIBDIR/codecs] --win32codecsdir=DIR directory for Windows DLLs [LIBDIR/codecs] --xanimcodecsdir=DIR directory for XAnim codecs [LIBDIR/codecs] --realcodecsdir=DIR directory for RealPlayer codecs [LIBDIR/codecs] Optional features: --disable-mencoder disable MEncoder (A/V encoder) compilation [enable] --disable-mplayer disable MPlayer compilation [enable] --enable-gui enable GMPlayer compilation (GTK+ GUI) [disable] --enable-gtk1 force using GTK 1.2 for the GUI [disable] --disable-largefiles disable support for files > 2GB [enable] --enable-linux-devfs set default devices to devfs [disable] --enable-termcap use termcap database for key codes [autodetect] --enable-termios use termios database for key codes [autodetect] --disable-iconv disable iconv for encoding conversion [autodetect] --disable-langinfo do not use langinfo [autodetect] --enable-lirc enable LIRC (remote control) support [autodetect] --enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect] --enable-joystick enable joystick support [disable] --enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect] --enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect] --disable-vm disable X video mode extensions [autodetect] --disable-xf86keysym disable support for multimedia keys [autodetect] --enable-radio enable radio interface [disable] --enable-radio-capture enable radio capture (through PCI/line-in) [disable] --disable-radio-v4l2 disable Video4Linux2 radio interface [autodetect] --disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect] --disable-tv disable TV interface (TV/DVB grabbers) [enable] --disable-tv-v4l1 disable Video4Linux TV interface [autodetect] --disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect] --disable-tv-bsdbt848 disable BSD BT848 interface [autodetect] --disable-pvr disable Video4Linux2 MPEG PVR [autodetect] --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect] --disable-network disable networking [enable] --enable-winsock2_h enable winsock2_h [autodetect] --enable-smb enable Samba (SMB) input [autodetect] --enable-live enable LIVE555 Streaming Media [autodetect] --enable-nemesi enable Nemesi Streaming Media [autodetect] --disable-vcd disable VCD support [autodetect] --disable-dvdnav disable libdvdnav [autodetect] --disable-dvdread disable libdvdread [autodetect] --disable-dvdread-internal disable internal libdvdread [autodetect] --disable-libdvdcss-internal disable internal libdvdcss [autodetect] --disable-cdparanoia disable cdparanoia [autodetect] --disable-cddb disable cddb [autodetect] --disable-bitmap-font disable bitmap font support [enable] --disable-freetype disable FreeType 2 font rendering [autodetect] --disable-fontconfig disable fontconfig font lookup [autodetect] --disable-unrarexec disable using of UnRAR executable [enabled] --enable-menu enable OSD menu (not DVD menu) [disabled] --disable-sortsub disable subtitle sorting [enabled] --enable-fribidi enable the FriBiDi libs [autodetect] --disable-enca disable ENCA charset oracle library [autodetect] --disable-maemo disable maemo specific features [autodetect] --enable-macosx-finder enable Mac OS X Finder invocation parameter parsing [disabled] --enable-macosx-bundle enable Mac OS X bundle file locations [autodetect] --disable-inet6 disable IPv6 support [autodetect] --disable-gethostbyname2 gethostbyname2 part of the C library [autodetect] --disable-ftp disable FTP support [enabled] --disable-vstream disable TiVo vstream client support [autodetect] --disable-pthreads disable Posix threads support [autodetect] --disable-w32threads disable Win32 threads support [autodetect] --disable-ass-internal disable internal SSA/ASS subtitle support [autodetect] --disable-ass disable SSA/ASS subtitle support [autodetect] --enable-rpath enable runtime linker path for extra libs [disabled] Codecs: --enable-gif enable GIF support [autodetect] --enable-png enable PNG input/output support [autodetect] --enable-mng enable MNG input support [autodetect] --enable-jpeg enable JPEG input/output support [autodetect] --enable-libcdio enable libcdio support [autodetect] --enable-liblzo enable liblzo support [autodetect] --disable-win32dll disable Win32 DLL support [enabled] --disable-qtx disable QuickTime codecs support [enabled] --disable-xanim disable XAnim codecs support [enabled] --disable-real disable RealPlayer codecs support [enabled] --disable-xvid disable Xvid [autodetect] --disable-xvid-lavc disable Xvid in libavcodec [autodetect] --disable-x264 disable x264 [autodetect] --disable-x264-lavc disable x264 in libavcodec [autodetect] --disable-libdirac-lavc disable Dirac in libavcodec [autodetect] --disable-libschroedinger-lavc disable Dirac in libavcodec (Schroedinger decoder) [autodetect] --disable-libnut disable libnut [autodetect] --disable-libavutil_a disable static libavutil [autodetect] --disable-libavcodec_a disable static libavcodec [autodetect] --disable-libavformat_a disable static libavformat [autodetect] --disable-libpostproc_a disable static libpostproc [autodetect] --disable-libswscale_a disable static libswscale [autodetect] --disable-libavutil_so disable shared libavutil [autodetect] --disable-libavcodec_so disable shared libavcodec [autodetect] --disable-libavformat_so disable shared libavformat [autodetect] --disable-libpostproc_so disable shared libpostproc [autodetect] --disable-libswscale_so disable shared libswscale [autodetect] --disable-libavcodec_mpegaudio_hp disable high precision audio decoding in libavcodec [enabled] --disable-tremor-internal disable internal Tremor [enabled] --enable-tremor-low enable lower accuracy internal Tremor [disabled] --enable-tremor enable external Tremor [autodetect] --disable-libvorbis disable libvorbis support [autodetect] --disable-speex disable Speex support [autodetect] --enable-theora enable OggTheora libraries [autodetect] --enable-faad enable external FAAD2 (AAC) [autodetect] --disable-faad-internal disable internal FAAD2 (AAC) [autodetect] --enable-faad-fixed enable fixed-point mode in internal FAAD2 [disabled] --disable-faac disable support for FAAC (AAC encoder) [autodetect] --disable-faac-lavc disable support for FAAC in libavcodec [autodetect] --disable-ladspa disable LADSPA plugin support [autodetect] --disable-libbs2b disable libbs2b audio filter support [autodetect] --disable-libdv disable libdv 0.9.5 en/decoding support [autodetect] --disable-mad disable libmad (MPEG audio) support [autodetect] --disable-mp3lame disable LAME MP3 encoding support [autodetect] --disable-mp3lame-lavc disable LAME in libavcodec [autodetect] --disable-toolame disable Toolame (MPEG layer 2) encoding [autodetect] --disable-twolame disable Twolame (MPEG layer 2) encoding [autodetect] --enable-xmms enable XMMS input plugin support [disabled] --enable-libdca enable libdca support [autodetect] --disable-mp3lib disable builtin mp3lib [autodetect] --disable-liba52 disable liba52 [autodetect] --enable-liba52-internal enable builtin liba52 [disabled] --disable-libmpeg2 disable builtin libmpeg2 [autodetect] --disable-musepack disable musepack support [autodetect] --disable-libopencore_amrnb disable libopencore_amr narrowband [autodetect] --disable-libopencore_amrwb disable libopencore_amr wideband [autodetect] --disable-libopenjpeg disable OpenJPEG (JPEG2000) input/output support [autodetect] --disable-decoder=DECODER disable specified FFmpeg decoder --enable-decoder=DECODER enable specified FFmpeg decoder --disable-encoder=ENCODER disable specified FFmpeg encoder --enable-encoder=ENCODER enable specified FFmpeg encoder --disable-parser=PARSER disable specified FFmpeg parser --enable-parser=PARSER enable specified FFmpeg parser --disable-protocol=PROTO disable specified FFmpeg protocol --enable-protocol=PROTO enable specified FFmpeg protocol --disable-demuxer=DEMUXER disable specified FFmpeg demuxer --enable-demuxer=DEMUXER enable specified FFmpeg demuxer --disable-muxer=MUXER disable specified FFmpeg muxer --enable-muxer=MUXER enable specified FFmpeg muxer Video output: --disable-vidix disable VIDIX [for x86 *nix] --with-vidix-drivers[=*] list of VIDIX drivers to be compiled in Available: cyberblade,ivtv,mach64,mga,mga_crtc2, nvidia,pm2,pm3,radeon,rage128,s3,sis,unichrome --disable-vidix-pcidb disable VIDIX PCI device name database --enable-dhahelper enable VIDIX dhahelper support --enable-svgalib_helper enable VIDIX svgalib_helper support --enable-gl enable OpenGL video output [autodetect] --disable-matrixview disable OpenGL MatrixView video output [autodetect] --enable-dga2 enable DGA 2 support [autodetect] --enable-dga1 enable DGA 1 support [autodetect] --enable-vesa enable VESA video output [autodetect] --enable-svga enable SVGAlib video output [autodetect] --enable-sdl enable SDL video output [autodetect] --enable-kva enable KVA video output [autodetect] --enable-aa enable AAlib video output [autodetect] --enable-caca enable CACA video output [autodetect] --enable-ggi enable GGI video output [autodetect] --enable-ggiwmh enable GGI libggiwmh extension [autodetect] --enable-direct3d enable Direct3D video output [autodetect] --enable-directx enable DirectX video output [autodetect] --enable-dxr2 enable DXR2 video output [autodetect] --enable-dxr3 enable DXR3/H+ video output [autodetect] --enable-ivtv enable IVTV TV-Out video output [autodetect] --enable-v4l2 enable V4L2 Decoder audio/video output [autodetect] --enable-dvb enable DVB video output [autodetect] --enable-dvbhead enable DVB video output (HEAD version) [autodetect] --enable-mga enable mga_vid video output [autodetect] --enable-xmga enable mga_vid X11 video output [autodetect] --enable-xv enable Xv video output [autodetect] --enable-xvmc enable XvMC acceleration [disable] --enable-vdpau enable VDPAU acceleration [autodetect] --enable-vm enable XF86VidMode support [autodetect] --enable-xinerama enable Xinerama support [autodetect] --enable-x11 enable X11 video output [autodetect] --enable-xshape enable XShape support [autodetect] --disable-xss disable screensaver support via xss [autodetect] --enable-fbdev enable FBDev video output [autodetect] --enable-mlib enable mediaLib video output (Solaris) [disable] --enable-3dfx enable obsolete /dev/3dfx video output [disable] --enable-tdfxfb enable tdfxfb video output [disable] --enable-s3fb enable s3fb (S3 ViRGE) video output [disable] --enable-wii enable Nintendo Wii/GameCube video output [disable] --enable-directfb enable DirectFB video output [autodetect] --enable-zr enable ZR360[56]7/ZR36060 video output [autodetect] --enable-bl enable Blinkenlights video output [disable] --enable-tdfxvid enable tdfx_vid video output [disable] --enable-xvr100 enable SUN XVR-100 video output [autodetect] --disable-tga disable Targa video output [enable] --disable-pnm disable PNM video output [enable] --disable-md5sum disable md5sum video output [enable] --disable-yuv4mpeg disable yuv4mpeg video output [enable] --disable-corevideo disable CoreVideo video output [autodetect] --disable-quartz disable Quartz video output [autodetect] Audio output: --disable-alsa disable ALSA audio output [autodetect] --disable-ossaudio disable OSS audio output [autodetect] --disable-arts disable aRts audio output [autodetect] --disable-esd disable esd audio output [autodetect] --disable-pulse disable Pulseaudio audio output [autodetect] --disable-jack disable JACK audio output [autodetect] --disable-openal disable OpenAL audio output [autodetect] --disable-nas disable NAS audio output [autodetect] --disable-sgiaudio disable SGI audio output [autodetect] --disable-sunaudio disable Sun audio output [autodetect] --disable-dart disable DART audio output [autodetect] --disable-win32waveout disable Windows waveout audio output [autodetect] --disable-coreaudio disable CoreAudio audio output [autodetect] --disable-select disable using select() on the audio device [enable] Language options: --charset=charset convert the console messages to this character set --language-doc=lang language to use for the documentation [en] --language-man=lang language to use for the man pages [en] --language-msg=lang language to use for the messages and the GUI [en] --language=lang default language to use [en] Specific options override --language. You can pass a list of languages separated by whitespace or commas instead of a single language. Nonexisting translations will be dropped from each list. All documentation and man page translations available in the list will be installed, for the messages the first available translation will be used. The value "all" will activate all translations. The LINGUAS environment variable is honored. In all cases the fallback is English. Available values are: all $msg_lang_all Miscellaneous options: --enable-runtime-cpudetection enable runtime CPU detection [disable] --enable-cross-compile enable cross-compilation [autodetect] --cc=COMPILER C compiler to build MPlayer [gcc] --host-cc=COMPILER C compiler for tools needed while building [gcc] --as=ASSEMBLER assembler to build MPlayer [as] --nm=NM nm tool to build MPlayer [nm] --yasm=YASM Yasm assembler to build MPlayer [yasm] --ar=AR librarian to build MPlayer [ar] --ranlib=RANLIB ranlib to build MPlayer [ranlib] --windres=WINDRES windres to build MPlayer [windres] --target=PLATFORM target platform (i386-linux, arm-linux, etc) --enable-static build a statically linked binary --with-install=PATH path to a custom install program Advanced options: --enable-mmx enable MMX [autodetect] --enable-mmxext enable MMX2 (Pentium III, Athlon) [autodetect] --enable-3dnow enable 3DNow! [autodetect] --enable-3dnowext enable extended 3DNow! [autodetect] --enable-sse enable SSE [autodetect] --enable-sse2 enable SSE2 [autodetect] --enable-ssse3 enable SSSE3 [autodetect] --enable-shm enable shm [autodetect] --enable-altivec enable AltiVec (PowerPC) [autodetect] --enable-armv5te enable DSP extensions (ARM) [autodetect] --enable-armv6 enable ARMv6 (ARM) [autodetect] --enable-armv6t2 enable ARMv6t2 (ARM) [autodetect] --enable-armvfp enable ARM VFP (ARM) [autodetect] --enable-neon enable NEON (ARM) [autodetect] --enable-iwmmxt enable iWMMXt (ARM) [autodetect] --disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable] --enable-hardcoded-tables put tables in binary instead of calculating them at startup [disable] --enable-big-endian force byte order to big-endian [autodetect] --enable-debug[=1-3] compile-in debugging information [disable] --enable-profile compile-in profiling information [disable] --disable-sighandler disable sighandler for crashes [enable] --enable-crash-debug enable automatic gdb attach on crash [disable] --enable-dynamic-plugins enable dynamic A/V plugins [disable] Use these options if autodetection fails: --extra-cflags=FLAGS extra CFLAGS --extra-ldflags=FLAGS extra LDFLAGS --extra-libs=FLAGS extra linker flags --extra-libs-mplayer=FLAGS extra linker flags for MPlayer --extra-libs-mencoder=FLAGS extra linker flags for MEncoder --with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA) --with-freetype-config=PATH path to freetype-config --with-fribidi-config=PATH path to fribidi-config --with-glib-config=PATH path to glib*-config --with-gtk-config=PATH path to gtk*-config --with-sdl-config=PATH path to sdl*-config --with-dvdnav-config=PATH path to dvdnav-config --with-dvdread-config=PATH path to dvdread-config This configure script is NOT autoconf-based, even though its output is similar. It will try to autodetect all configuration options. If you --enable an option it will be forcefully turned on, skipping autodetection. This can break compilation, so you need to know what you are doing. EOF exit 0 } #show_help() # GOTCHA: the variables below defines the default behavior for autodetection # and have - unless stated otherwise - at least 2 states : yes no # If autodetection is available then the third state is: auto _mmx=auto _3dnow=auto _3dnowext=auto _mmxext=auto _sse=auto _sse2=auto _ssse3=auto _cmov=auto _fast_cmov=auto _armv5te=auto _armv6=auto _armv6t2=auto _armvfp=auto neon=auto _iwmmxt=auto _mtrr=auto _altivec=auto _install=install _ranlib=ranlib _windres=windres _cc=cc _ar=ar test "$CC" && _cc="$CC" _as=auto _nm=auto _yasm=yasm _runtime_cpudetection=no _cross_compile=auto _prefix="/usr/local" _libavutil_a=auto _libavutil_so=auto _libavcodec_a=auto _libopencore_amrnb=auto _libopencore_amrwb=auto libopenjpeg=auto _libavdecoders_all=$(sed -n 's/^[^#]*DEC.*(.*, *\(.*\)).*/\1_decoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') _libavdecoders=$(echo $_libavdecoders_all | sed -e 's/ LIB[A-Z0-9_]*_DECODER//g' -e s/MPEG4AAC_DECODER//) _libavencoders_all=$(sed -n 's/^[^#]*ENC.*(.*, *\(.*\)).*/\1_encoder/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') _libavencoders=$(echo $_libavencoders_all | sed -e 's/ LIB[A-Z0-9_]*_ENCODER//g' -e s/AAC_ENCODER//) _libavparsers_all=$(sed -n 's/^[^#]*PARSER.*(.*, *\(.*\)).*/\1_parser/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') _libavparsers=$_libavparsers_all _libavbsfs_all=$(sed -n 's/^[^#]*BSF.*(.*, *\(.*\)).*/\1_bsf/p' libavcodec/allcodecs.c | tr '[a-z]' '[A-Z]') _libavbsfs=$_libavbsfs_all _libavdemuxers_all=$(sed -n 's/^[^#]*DEMUX.*(.*, *\(.*\)).*/\1_demuxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]') _libavdemuxers=$(echo $_libavdemuxers_all | sed -e 's/ LIB[A-Z0-9_]*_DEMUXER//g' -e s/REDIR_DEMUXER// -e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/AVISYNTH_DEMUXER//) _libavmuxers_all=$(sed -n 's/^[^#]*_MUX.*(.*, *\(.*\)).*/\1_muxer/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]') _libavmuxers=$(echo $_libavmuxers_all | sed -e 's/ LIB[A-Z0-9_]*_MUXER//g' -e s/RTP_MUXER//) _libavprotocols_all=$(sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p' libavformat/allformats.c | tr '[a-z]' '[A-Z]') _libavprotocols=$_libavprotocols_all _libavcodec_so=auto _libavformat_a=auto _libavformat_so=auto _libpostproc_a=auto _libpostproc_so=auto _libswscale_a=auto _libswscale_so=auto _libavcodec_mpegaudio_hp=yes _mencoder=yes _mplayer=yes _x11=auto _xshape=auto _xss=auto _dga1=auto _dga2=auto _xv=auto _xvmc=no #auto when complete _vdpau=auto _sdl=auto _kva=auto _direct3d=auto _directx=auto _win32waveout=auto _nas=auto _png=auto _mng=auto _jpeg=auto _pnm=yes _md5sum=yes _yuv4mpeg=yes _gif=auto _gl=auto matrixview=yes _ggi=auto _ggiwmh=auto _aa=auto _caca=auto _svga=auto _vesa=auto _fbdev=auto _dvb=auto _dvbhead=auto _dxr2=auto _dxr3=auto _ivtv=auto _v4l2=auto _iconv=auto _langinfo=auto _rtc=auto _ossaudio=auto _arts=auto _esd=auto _pulse=auto _jack=auto _dart=auto _openal=auto _libcdio=auto _liblzo=auto _mad=auto _mp3lame=auto _mp3lame_lavc=auto _toolame=auto _twolame=auto _tremor=auto _tremor_internal=yes _tremor_low=no _libvorbis=auto _speex=auto _theora=auto _mp3lib=auto _liba52=auto _liba52_internal=no _libdca=auto _libmpeg2=auto _faad=auto _faad_internal=auto _faad_fixed=no _faac=auto _faac_lavc=auto _ladspa=auto _libbs2b=auto _xmms=no _vcd=auto _dvdnav=auto _dvdnavconfig=dvdnav-config _dvdreadconfig=dvdread-config _dvdread=auto _dvdread_internal=auto _libdvdcss_internal=auto _xanim=auto _real=auto _live=auto _nemesi=auto _native_rtsp=yes _xinerama=auto _mga=auto _xmga=auto _vm=auto _xf86keysym=auto _mlib=no #broken, thus disabled _sgiaudio=auto _sunaudio=auto _alsa=auto _fastmemcpy=yes hardcoded_tables=no _unrar_exec=auto _win32dll=auto _select=yes _radio=no _radio_capture=no _radio_v4l=auto _radio_v4l2=auto _radio_bsdbt848=auto _tv=yes _tv_v4l1=auto _tv_v4l2=auto _tv_bsdbt848=auto _tv_dshow=auto _pvr=auto _network=yes _winsock2_h=auto _smb=auto _vidix=auto _vidix_pcidb=yes _dhahelper=no _svgalib_helper=no _joystick=no _xvid=auto _xvid_lavc=auto _x264=auto _x264_lavc=auto _libdirac_lavc=auto _libschroedinger_lavc=auto _libnut=auto _lirc=auto _lircc=auto _apple_remote=auto _apple_ir=auto _gui=no _gtk1=no _termcap=auto _termios=auto _3dfx=no _s3fb=no _wii=no _tdfxfb=no _tdfxvid=no _xvr100=auto _tga=yes _directfb=auto _zr=auto _bl=no _largefiles=yes #language=en _shm=auto _linux_devfs=no _charset="UTF-8" _dynamic_plugins=no _crash_debug=no _sighandler=yes _libdv=auto _cdparanoia=auto _cddb=auto _big_endian=auto _bitmap_font=yes _freetype=auto _fontconfig=auto _menu=no _qtx=auto _maemo=auto _coreaudio=auto _corevideo=auto _quartz=auto quicktime=auto _macosx_finder=no _macosx_bundle=auto _sortsub=yes _freetypeconfig='freetype-config' _fribidi=auto _fribidiconfig='fribidi-config' _enca=auto _inet6=auto _gethostbyname2=auto _ftp=yes _musepack=auto _vstream=auto _pthreads=auto _w32threads=auto _ass=auto ass_internal=yes _rpath=no _asmalign_pot=auto _stream_cache=yes _priority=no def_dos_paths="#define HAVE_DOS_PATHS 0" def_stream_cache="#define CONFIG_STREAM_CACHE 1" def_priority="#undef CONFIG_PRIORITY" def_pthread_cache="#undef PTHREAD_CACHE" _need_shmem=yes for ac_option do case "$ac_option" in --help|-help|-h) show_help ;; --prefix=*) _prefix=$(echo $ac_option | cut -d '=' -f 2) ;; --bindir=*) _bindir=$(echo $ac_option | cut -d '=' -f 2) ;; --datadir=*) _datadir=$(echo $ac_option | cut -d '=' -f 2) ;; --mandir=*) _mandir=$(echo $ac_option | cut -d '=' -f 2) ;; --confdir=*) _confdir=$(echo $ac_option | cut -d '=' -f 2) ;; --libdir=*) _libdir=$(echo $ac_option | cut -d '=' -f 2) ;; --codecsdir=*) _codecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; --win32codecsdir=*) _win32codecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; --xanimcodecsdir=*) _xanimcodecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; --realcodecsdir=*) _realcodecsdir=$(echo $ac_option | cut -d '=' -f 2) ;; --with-install=*) _install=$(echo $ac_option | cut -d '=' -f 2 ) ;; --with-xvmclib=*) _xvmclib=$(echo $ac_option | cut -d '=' -f 2) ;; --with-sdl-config=*) _sdlconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-freetype-config=*) _freetypeconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-fribidi-config=*) _fribidiconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-gtk-config=*) _gtkconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-glib-config=*) _glibconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-dvdnav-config=*) _dvdnavconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --with-dvdread-config=*) _dvdreadconfig=$(echo $ac_option | cut -d '=' -f 2) ;; --extra-cflags=*) extra_cflags=$(echo $ac_option | cut -d '=' -f 2-) ;; --extra-ldflags=*) extra_ldflags=$(echo $ac_option | cut -d '=' -f 2-) ;; --extra-libs=*) extra_libs=$(echo $ac_option | cut -d '=' -f 2) ;; --extra-libs-mplayer=*) libs_mplayer=$(echo $ac_option | cut -d '=' -f 2) ;; --extra-libs-mencoder=*) libs_mencoder=$(echo $ac_option | cut -d '=' -f 2) ;; --target=*) _target=$(echo $ac_option | cut -d '=' -f 2) ;; --cc=*) _cc=$(echo $ac_option | cut -d '=' -f 2) ;; --host-cc=*) _host_cc=$(echo $ac_option | cut -d '=' -f 2) ;; --as=*) _as=$(echo $ac_option | cut -d '=' -f 2) ;; --nm=*) _nm=$(echo $ac_option | cut -d '=' -f 2) ;; --yasm=*) _yasm=$(echo $ac_option | cut -d '=' -f 2) ;; --ar=*) _ar=$(echo $ac_option | cut -d '=' -f 2) ;; --ranlib=*) _ranlib=$(echo $ac_option | cut -d '=' -f 2) ;; --windres=*) _windres=$(echo $ac_option | cut -d '=' -f 2) ;; --charset=*) _charset=$(echo $ac_option | cut -d '=' -f 2) ;; --language-doc=*) language_doc=$(echo $ac_option | cut -d '=' -f 2) ;; --language-man=*) language_man=$(echo $ac_option | cut -d '=' -f 2) ;; --language-msg=*) language_msg=$(echo $ac_option | cut -d '=' -f 2) ;; --language=*) language=$(echo $ac_option | cut -d '=' -f 2) ;; --enable-static) _ld_static='-static' ;; --disable-static) _ld_static='' ;; --enable-profile) _profile='-p' ;; --disable-profile) _profile= ;; --enable-debug) _debug='-g' ;; --enable-debug=*) _debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2) ;; --disable-debug) _debug= ;; --enable-runtime-cpudetection) _runtime_cpudetection=yes ;; --disable-runtime-cpudetection) _runtime_cpudetection=no ;; --enable-cross-compile) _cross_compile=yes ;; --disable-cross-compile) _cross_compile=no ;; --enable-mencoder) _mencoder=yes ;; --disable-mencoder) _mencoder=no ;; --enable-mplayer) _mplayer=yes ;; --disable-mplayer) _mplayer=no ;; --enable-dynamic-plugins) _dynamic_plugins=yes ;; --disable-dynamic-plugins) _dynamic_plugins=no ;; --enable-x11) _x11=yes ;; --disable-x11) _x11=no ;; --enable-xshape) _xshape=yes ;; --disable-xshape) _xshape=no ;; --enable-xss) _xss=yes ;; --disable-xss) _xss=no ;; --enable-xv) _xv=yes ;; --disable-xv) _xv=no ;; --enable-xvmc) _xvmc=yes ;; --disable-xvmc) _xvmc=no ;; --enable-vdpau) _vdpau=yes ;; --disable-vdpau) _vdpau=no ;; --enable-sdl) _sdl=yes ;; --disable-sdl) _sdl=no ;; --enable-kva) _kva=yes ;; --disable-kva) _kva=no ;; --enable-direct3d) _direct3d=yes ;; --disable-direct3d) _direct3d=no ;; --enable-directx) _directx=yes ;; --disable-directx) _directx=no ;; --enable-win32waveout) _win32waveout=yes ;; --disable-win32waveout) _win32waveout=no ;; --enable-nas) _nas=yes ;; --disable-nas) _nas=no ;; --enable-png) _png=yes ;; --disable-png) _png=no ;; --enable-mng) _mng=yes ;; --disable-mng) _mng=no ;; --enable-jpeg) _jpeg=yes ;; --disable-jpeg) _jpeg=no ;; --enable-libopenjpeg) libopenjpeg=yes ;; --disable-libopenjpeg)libopenjpeg=no ;; --enable-pnm) _pnm=yes ;; --disable-pnm) _pnm=no ;; --enable-md5sum) _md5sum=yes ;; --disable-md5sum) _md5sum=no ;; --enable-yuv4mpeg) _yuv4mpeg=yes ;; --disable-yuv4mpeg) _yuv4mpeg=no ;; --enable-gif) _gif=yes ;; --disable-gif) _gif=no ;; --enable-gl) _gl=yes ;; --disable-gl) _gl=no ;; --enable-matrixview) matrixview=yes ;; --disable-matrixview) matrixview=no ;; --enable-ggi) _ggi=yes ;; --disable-ggi) _ggi=no ;; --enable-ggiwmh) _ggiwmh=yes ;; --disable-ggiwmh) _ggiwmh=no ;; --enable-aa) _aa=yes ;; --disable-aa) _aa=no ;; --enable-caca) _caca=yes ;; --disable-caca) _caca=no ;; --enable-svga) _svga=yes ;; --disable-svga) _svga=no ;; --enable-vesa) _vesa=yes ;; --disable-vesa) _vesa=no ;; --enable-fbdev) _fbdev=yes ;; --disable-fbdev) _fbdev=no ;; --enable-dvb) _dvb=yes ;; --disable-dvb) _dvb=no ;; --enable-dvbhead) _dvbhead=yes ;; --disable-dvbhead) _dvbhead=no ;; --enable-dxr2) _dxr2=yes ;; --disable-dxr2) _dxr2=no ;; --enable-dxr3) _dxr3=yes ;; --disable-dxr3) _dxr3=no ;; --enable-ivtv) _ivtv=yes ;; --disable-ivtv) _ivtv=no ;; --enable-v4l2) _v4l2=yes ;; --disable-v4l2) _v4l2=no ;; --enable-iconv) _iconv=yes ;; --disable-iconv) _iconv=no ;; --enable-langinfo) _langinfo=yes ;; --disable-langinfo) _langinfo=no ;; --enable-rtc) _rtc=yes ;; --disable-rtc) _rtc=no ;; --enable-libdv) _libdv=yes ;; --disable-libdv) _libdv=no ;; --enable-ossaudio) _ossaudio=yes ;; --disable-ossaudio) _ossaudio=no ;; --enable-arts) _arts=yes ;; --disable-arts) _arts=no ;; --enable-esd) _esd=yes ;; --disable-esd) _esd=no ;; --enable-pulse) _pulse=yes ;; --disable-pulse) _pulse=no ;; --enable-jack) _jack=yes ;; --disable-jack) _jack=no ;; --enable-openal) _openal=yes ;; --disable-openal) _openal=no ;; --enable-dart) _dart=yes ;; --disable-dart) _dart=no ;; --enable-mad) _mad=yes ;; --disable-mad) _mad=no ;; --enable-mp3lame) _mp3lame=yes ;; --disable-mp3lame) _mp3lame=no ;; --enable-mp3lame-lavc) _mp3lame_lavc=yes ;; --disable-mp3lame-lavc) _mp3lame_lavc=no ;; --enable-toolame) _toolame=yes ;; --disable-toolame) _toolame=no ;; --enable-twolame) _twolame=yes ;; --disable-twolame) _twolame=no ;; --enable-libcdio) _libcdio=yes ;; --disable-libcdio) _libcdio=no ;; --enable-liblzo) _liblzo=yes ;; --disable-liblzo) _liblzo=no ;; --enable-libvorbis) _libvorbis=yes ;; --disable-libvorbis) _libvorbis=no ;; --enable-speex) _speex=yes ;; --disable-speex) _speex=no ;; --enable-tremor) _tremor=yes ;; --disable-tremor) _tremor=no ;; --enable-tremor-internal) _tremor_internal=yes ;; --disable-tremor-internal) _tremor_internal=no ;; --enable-tremor-low) _tremor_low=yes ;; --disable-tremor-low) _tremor_low=no ;; --enable-theora) _theora=yes ;; --disable-theora) _theora=no ;; --enable-mp3lib) _mp3lib=yes ;; --disable-mp3lib) _mp3lib=no ;; --enable-liba52-internal) _liba52_internal=yes ;; --disable-liba52-internal) _liba52_internal=no ;; --enable-liba52) _liba52=yes ;; --disable-liba52) _liba52=no ;; --enable-libdca) _libdca=yes ;; --disable-libdca) _libdca=no ;; --enable-libmpeg2) _libmpeg2=yes ;; --disable-libmpeg2) _libmpeg2=no ;; --enable-musepack) _musepack=yes ;; --disable-musepack) _musepack=no ;; --enable-faad) _faad=yes ;; --disable-faad) _faad=no ;; --enable-faad-internal) _faad_internal=yes ;; --disable-faad-internal) _faad_internal=no ;; --enable-faad-fixed) _faad_fixed=yes ;; --disable-faad-fixed) _faad_fixed=no ;; --enable-faac) _faac=yes ;; --disable-faac) _faac=no ;; --enable-faac-lavc) _faac_lavc=yes ;; --disable-faac-lavc) _faac_lavc=no ;; --enable-ladspa) _ladspa=yes ;; --disable-ladspa) _ladspa=no ;; --enable-libbs2b) _libbs2b=yes ;; --disable-libbs2b) _libbs2b=no ;; --enable-xmms) _xmms=yes ;; --disable-xmms) _xmms=no ;; --enable-vcd) _vcd=yes ;; --disable-vcd) _vcd=no ;; --enable-dvdread) _dvdread=yes ;; --disable-dvdread) _dvdread=no ;; --enable-dvdread-internal) _dvdread_internal=yes ;; --disable-dvdread-internal) _dvdread_internal=no ;; --enable-libdvdcss-internal) _libdvdcss_internal=yes ;; --disable-libdvdcss-internal) _libdvdcss_internal=no ;; --enable-dvdnav) _dvdnav=yes ;; --disable-dvdnav) _dvdnav=no ;; --enable-xanim) _xanim=yes ;; --disable-xanim) _xanim=no ;; --enable-real) _real=yes ;; --disable-real) _real=no ;; --enable-live) _live=yes ;; --disable-live) _live=no ;; --enable-nemesi) _nemesi=yes ;; --disable-nemesi) _nemesi=no ;; --enable-xinerama) _xinerama=yes ;; --disable-xinerama) _xinerama=no ;; --enable-mga) _mga=yes ;; --disable-mga) _mga=no ;; --enable-xmga) _xmga=yes ;; --disable-xmga) _xmga=no ;; --enable-vm) _vm=yes ;; --disable-vm) _vm=no ;; --enable-xf86keysym) _xf86keysym=yes ;; --disable-xf86keysym) _xf86keysym=no ;; --enable-mlib) _mlib=yes ;; --disable-mlib) _mlib=no ;; --enable-sunaudio) _sunaudio=yes ;; --disable-sunaudio) _sunaudio=no ;; --enable-sgiaudio) _sgiaudio=yes ;; --disable-sgiaudio) _sgiaudio=no ;; --enable-alsa) _alsa=yes ;; --disable-alsa) _alsa=no ;; --enable-tv) _tv=yes ;; --disable-tv) _tv=no ;; --enable-tv-bsdbt848) _tv_bsdbt848=yes ;; --disable-tv-bsdbt848) _tv_bsdbt848=no ;; --enable-tv-v4l1) _tv_v4l1=yes ;; --disable-tv-v4l1) _tv_v4l1=no ;; --enable-tv-v4l2) _tv_v4l2=yes ;; --disable-tv-v4l2) _tv_v4l2=no ;; --enable-tv-dshow) _tv_dshow=yes ;; --disable-tv-dshow) _tv_dshow=no ;; --enable-radio) _radio=yes ;; --enable-radio-capture) _radio_capture=yes ;; --disable-radio-capture) _radio_capture=no ;; --disable-radio) _radio=no ;; --enable-radio-v4l) _radio_v4l=yes ;; --disable-radio-v4l) _radio_v4l=no ;; --enable-radio-v4l2) _radio_v4l2=yes ;; --disable-radio-v4l2) _radio_v4l2=no ;; --enable-radio-bsdbt848) _radio_bsdbt848=yes ;; --disable-radio-bsdbt848) _radio_bsdbt848=no ;; --enable-pvr) _pvr=yes ;; --disable-pvr) _pvr=no ;; --enable-fastmemcpy) _fastmemcpy=yes ;; --disable-fastmemcpy) _fastmemcpy=no ;; --enable-hardcoded-tables) hardcoded_tables=yes ;; --disable-hardcoded-tables) hardcoded_tables=no ;; --enable-network) _network=yes ;; --disable-network) _network=no ;; --enable-winsock2_h) _winsock2_h=yes ;; --disable-winsock2_h) _winsock2_h=no ;; --enable-smb) _smb=yes ;; --disable-smb) _smb=no ;; --enable-vidix) _vidix=yes ;; --disable-vidix) _vidix=no ;; --with-vidix-drivers=*) _vidix_drivers=$(echo $ac_option | cut -d '=' -f 2) ;; --disable-vidix-pcidb) _vidix_pcidb=no ;; --enable-dhahelper) _dhahelper=yes ;; --disable-dhahelper) _dhahelper=no ;; --enable-svgalib_helper) _svgalib_helper=yes ;; --disable-svgalib_helper) _svgalib_helper=no ;; --enable-joystick) _joystick=yes ;; --disable-joystick) _joystick=no ;; --enable-xvid) _xvid=yes ;; --disable-xvid) _xvid=no ;; --enable-xvid-lavc) _xvid_lavc=yes ;; --disable-xvid-lavc) _xvid_lavc=no ;; --enable-x264) _x264=yes ;; --disable-x264) _x264=no ;; --enable-x264-lavc) _x264_lavc=yes ;; --disable-x264-lavc) _x264_lavc=no ;; --enable-libdirac-lavc) _libdirac_lavc=yes ;; --disable-libdirac-lavc) _libdirac_lavc=no ;; --enable-libschroedinger-lavc) _libschroedinger_lavc=yes ;; --disable-libschroedinger-lavc) _libschroedinger_lavc=no ;; --enable-libnut) _libnut=yes ;; --disable-libnut) _libnut=no ;; --enable-libavutil_a) _libavutil_a=yes ;; --disable-libavutil_a) _libavutil_a=no ;; --enable-libavutil_so) _libavutil_so=yes ;; --disable-libavutil_so) _libavutil_so=no ;; --enable-libavcodec_a) _libavcodec_a=yes ;; --disable-libavcodec_a) _libavcodec_a=no ;; --enable-libavcodec_so) _libavcodec_so=yes ;; --disable-libavcodec_so) _libavcodec_so=no ;; --enable-libopencore_amrnb) _libopencore_amrnb=yes ;; --disable-libopencore_amrnb) _libopencore_amrnb=no ;; --enable-libopencore_amrwb) _libopencore_amrwb=yes ;; --disable-libopencore_amrwb) _libopencore_amrwb=no ;; --enable-decoder=*) _libavdecoders="$_libavdecoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; --disable-decoder=*) _libavdecoders=$(echo $_libavdecoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; --enable-encoder=*) _libavencoders="$_libavencoders $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; --disable-encoder=*) _libavencoders=$(echo $_libavencoders | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; --enable-parser=*) _libavparsers="$_libavparsers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; --disable-parser=*) _libavparsers=$(echo $_libavparsers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; --enable-protocol=*) _libavprotocols="$_libavprotocols $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; --disable-protocol=*) _libavprotocols=$(echo $_libavprotocols | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; --enable-demuxer=*) _libavdemuxers="$_libavdemuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; --disable-demuxer=*) _libavdemuxers=$(echo $_libavdemuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; --enable-muxer=*) _libavmuxers="$_libavmuxers $(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')" ;; --disable-muxer=*) _libavmuxers=$(echo $_libavmuxers | sed "s/$(echo $ac_option | cut -d '=' -f 2 | tr '[a-z]' '[A-Z]')//g") ;; --enable-libavformat_a) _libavformat_a=yes ;; --disable-libavformat_a) _libavformat_a=no ;; --enable-libavformat_so) _libavformat_so=yes ;; --disable-libavformat_so) _libavformat_so=no ;; --enable-libpostproc_a) _libpostproc_a=yes ;; --disable-libpostproc_a) _libpostproc_a=no ;; --enable-libpostproc_so) _libpostproc_so=yes ;; --disable-libpostproc_so) _libpostproc_so=no ;; --enable-libswscale_a) _libswscale_a=yes ;; --disable-libswscale_a) _libswscale_a=no ;; --enable-libswscale_so) _libswscale_so=yes ;; --disable-libswscale_so) _libswscale_so=no ;; --enable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=yes ;; --disable-libavcodec_mpegaudio_hp) _libavcodec_mpegaudio_hp=no ;; --enable-lirc) _lirc=yes ;; --disable-lirc) _lirc=no ;; --enable-lircc) _lircc=yes ;; --disable-lircc) _lircc=no ;; --enable-apple-remote) _apple_remote=yes ;; --disable-apple-remote) _apple_remote=no ;; --enable-apple-ir) _apple_ir=yes ;; --disable-apple-ir) _apple_ir=no ;; --enable-gui) _gui=yes ;; --disable-gui) _gui=no ;; --enable-gtk1) _gtk1=yes ;; --disable-gtk1) _gtk1=no ;; --enable-termcap) _termcap=yes ;; --disable-termcap) _termcap=no ;; --enable-termios) _termios=yes ;; --disable-termios) _termios=no ;; --enable-3dfx) _3dfx=yes ;; --disable-3dfx) _3dfx=no ;; --enable-s3fb) _s3fb=yes ;; --disable-s3fb) _s3fb=no ;; --enable-wii) _wii=yes ;; --disable-wii) _wii=no ;; --enable-tdfxfb) _tdfxfb=yes ;; --disable-tdfxfb) _tdfxfb=no ;; --disable-tdfxvid) _tdfxvid=no ;; --enable-tdfxvid) _tdfxvid=yes ;; --disable-xvr100) _xvr100=no ;; --enable-xvr100) _xvr100=yes ;; --disable-tga) _tga=no ;; --enable-tga) _tga=yes ;; --enable-directfb) _directfb=yes ;; --disable-directfb) _directfb=no ;; --enable-zr) _zr=yes ;; --disable-zr) _zr=no ;; --enable-bl) _bl=yes ;; --disable-bl) _bl=no ;; --enable-mtrr) _mtrr=yes ;; --disable-mtrr) _mtrr=no ;; --enable-largefiles) _largefiles=yes ;; --disable-largefiles) _largefiles=no ;; --enable-shm) _shm=yes ;; --disable-shm) _shm=no ;; --enable-select) _select=yes ;; --disable-select) _select=no ;; --enable-linux-devfs) _linux_devfs=yes ;; --disable-linux-devfs) _linux_devfs=no ;; --enable-cdparanoia) _cdparanoia=yes ;; --disable-cdparanoia) _cdparanoia=no ;; --enable-cddb) _cddb=yes ;; --disable-cddb) _cddb=no ;; --enable-big-endian) _big_endian=yes ;; --disable-big-endian) _big_endian=no ;; --enable-bitmap-font) _bitmap_font=yes ;; --disable-bitmap-font) _bitmap_font=no ;; --enable-freetype) _freetype=yes ;; --disable-freetype) _freetype=no ;; --enable-fontconfig) _fontconfig=yes ;; --disable-fontconfig) _fontconfig=no ;; --enable-unrarexec) _unrar_exec=yes ;; --disable-unrarexec) _unrar_exec=no ;; --enable-ftp) _ftp=yes ;; --disable-ftp) _ftp=no ;; --enable-vstream) _vstream=yes ;; --disable-vstream) _vstream=no ;; --enable-pthreads) _pthreads=yes ;; --disable-pthreads) _pthreads=no ;; --enable-w32threads) _w32threads=yes ;; --disable-w32threads) _w32threads=no ;; --enable-ass) _ass=yes ;; --disable-ass) _ass=no ;; --enable-ass-internal) ass_internal=yes ;; --disable-ass-internal) ass_internal=no ;; --enable-rpath) _rpath=yes ;; --disable-rpath) _rpath=no ;; --enable-fribidi) _fribidi=yes ;; --disable-fribidi) _fribidi=no ;; --enable-enca) _enca=yes ;; --disable-enca) _enca=no ;; --enable-inet6) _inet6=yes ;; --disable-inet6) _inet6=no ;; --enable-gethostbyname2) _gethostbyname2=yes ;; --disable-gethostbyname2) _gethostbyname2=no ;; --enable-dga1) _dga1=yes ;; --disable-dga1) _dga1=no ;; --enable-dga2) _dga2=yes ;; --disable-dga2) _dga2=no ;; --enable-menu) _menu=yes ;; --disable-menu) _menu=no ;; --enable-qtx) _qtx=yes ;; --disable-qtx) _qtx=no ;; --enable-coreaudio) _coreaudio=yes ;; --disable-coreaudio) _coreaudio=no ;; --enable-corevideo) _corevideo=yes ;; --disable-corevideo) _corevideo=no ;; --enable-quartz) _quartz=yes ;; --disable-quartz) _quartz=no ;; --enable-macosx-finder) _macosx_finder=yes ;; --disable-macosx-finder) _macosx_finder=no ;; --enable-macosx-bundle) _macosx_bundle=yes ;; --disable-macosx-bundle) _macosx_bundle=no ;; --enable-maemo) _maemo=yes ;; --disable-maemo) _maemo=no ;; --enable-sortsub) _sortsub=yes ;; --disable-sortsub) _sortsub=no ;; --enable-crash-debug) _crash_debug=yes ;; --disable-crash-debug) _crash_debug=no ;; --enable-sighandler) _sighandler=yes ;; --disable-sighandler) _sighandler=no ;; --enable-win32dll) _win32dll=yes ;; --disable-win32dll) _win32dll=no ;; --enable-sse) _sse=yes ;; --disable-sse) _sse=no ;; --enable-sse2) _sse2=yes ;; --disable-sse2) _sse2=no ;; --enable-ssse3) _ssse3=yes ;; --disable-ssse3) _ssse3=no ;; --enable-mmxext) _mmxext=yes ;; --disable-mmxext) _mmxext=no ;; --enable-3dnow) _3dnow=yes ;; --disable-3dnow) _3dnow=no _3dnowext=no ;; --enable-3dnowext) _3dnow=yes _3dnowext=yes ;; --disable-3dnowext) _3dnowext=no ;; --enable-cmov) _cmov=yes ;; --disable-cmov) _cmov=no ;; --enable-fast-cmov) _fast_cmov=yes ;; --disable-fast-cmov) _fast_cmov=no ;; --enable-altivec) _altivec=yes ;; --disable-altivec) _altivec=no ;; --enable-armv5te) _armv5te=yes ;; --disable-armv5te) _armv5te=no ;; --enable-armv6) _armv6=yes ;; --disable-armv6) _armv6=no ;; --enable-armv6t2) _armv6t2=yes ;; --disable-armv6t2) _armv6t2=no ;; --enable-armvfp) _armvfp=yes ;; --disable-armvfp) _armvfp=no ;; --enable-neon) neon=yes ;; --disable-neon) neon=no ;; --enable-iwmmxt) _iwmmxt=yes ;; --disable-iwmmxt) _iwmmxt=no ;; --enable-mmx) _mmx=yes ;; --disable-mmx) # 3Dnow! and MMX2 require MMX _3dnow=no _3dnowext=no _mmx=no _mmxext=no ;; *) echo "Unknown parameter: $ac_option" exit 1 ;; esac done # Atmos: moved this here, to be correct, if --prefix is specified test -z "$_bindir" && _bindir="$_prefix/bin" test -z "$_datadir" && _datadir="$_prefix/share/mplayer" test -z "$_mandir" && _mandir="$_prefix/share/man" test -z "$_confdir" && _confdir="$_prefix/etc/mplayer" test -z "$_libdir" && _libdir="$_prefix/lib" # Determine our OS name and CPU architecture if test -z "$_target" ; then # OS name system_name=$(uname -s 2>&1) case "$system_name" in Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|BSD/OS|Darwin|SunOS|QNX|GNU|BeOS|MorphOS|AIX|AmigaOS) ;; Haiku) system_name=BeOS ;; IRIX*) system_name=IRIX ;; GNU/kFreeBSD) system_name=FreeBSD ;; HP-UX*) system_name=HP-UX ;; [cC][yY][gG][wW][iI][nN]*) system_name=CYGWIN ;; MINGW32*) system_name=MINGW32 ;; OS/2*) system_name=OS/2 ;; *) system_name="$system_name-UNKNOWN" ;; esac # host's CPU/instruction set host_arch=$(uname -p 2>&1) case "$host_arch" in i386|sparc|ppc|alpha|arm|mips|vax) ;; powerpc) # Darwin returns 'powerpc' host_arch=ppc ;; *) # uname -p on Linux returns 'unknown' for the processor type, # OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)' # Maybe uname -m (machine hardware name) returns something we # recognize. # x86/x86pc is used by QNX case "$(uname -m 2>&1)" in 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 ;; ia64) host_arch=ia64 ;; macppc|ppc) host_arch=ppc ;; ppc64) host_arch=ppc64 ;; alpha) host_arch=alpha ;; sparc) host_arch=sparc ;; sparc64) host_arch=sparc64 ;; parisc*|hppa*|9000*) host_arch=hppa ;; arm*|zaurus|cats) host_arch=arm ;; sh3|sh4|sh4a) host_arch=sh ;; s390) host_arch=s390 ;; s390x) host_arch=s390x ;; *mips*) host_arch=mips ;; vax) host_arch=vax ;; xtensa*) host_arch=xtensa ;; *) host_arch=UNKNOWN ;; esac ;; esac else # if test -z "$_target" system_name=$(echo $_target | cut -d '-' -f 2) case "$(echo $system_name | tr A-Z a-z)" in linux) system_name=Linux ;; freebsd) system_name=FreeBSD ;; gnu/kfreebsd) system_name=FreeBSD ;; netbsd) system_name=NetBSD ;; bsd/os) system_name=BSD/OS ;; openbsd) system_name=OpenBSD ;; dragonfly) system_name=DragonFly ;; sunos) system_name=SunOS ;; qnx) system_name=QNX ;; morphos) system_name=MorphOS ;; amigaos) system_name=AmigaOS ;; mingw32*) system_name=MINGW32 ;; esac # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=$(echo $_target | cut -d '-' -f 1) if test $(echo $host_arch) != "x86_64" ; then host_arch=$(echo $host_arch | tr '_' '-') fi fi extra_cflags="-I. $extra_cflags" _timer=timer-linux.c _getch=getch2.c if freebsd ; then extra_ldflags="$extra_ldflags -L/usr/local/lib" extra_cflags="$extra_cflags -I/usr/local/include" fi if netbsd || dragonfly ; then extra_ldflags="$extra_ldflags -L/usr/pkg/lib" extra_cflags="$extra_cflags -I/usr/pkg/include" fi if darwin; then extra_cflags="-mdynamic-no-pic -falign-loops=16 -shared-libgcc $extra_cflags" _timer=timer-darwin.c fi if aix ; then extra_ldflags="$extra_ldflags -lC" fi if irix ; then _ranlib='ar -r' elif linux ; then _ranlib='true' fi if win32 ; then _exesuf=".exe" # -lwinmm is always needed for osdep/timer-win2.c extra_ldflags="$extra_ldflags -lwinmm" _pe_executable=yes _timer=timer-win2.c _priority=yes def_dos_paths="#define HAVE_DOS_PATHS 1" def_priority="#define CONFIG_PRIORITY 1" fi if mingw32 ; then _getch=getch2-win.c _need_shmem=no fi if amigaos ; then _select=no _sighandler=no _stream_cache=no def_stream_cache="#undef CONFIG_STREAM_CACHE" extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags" fi if qnx ; then extra_ldflags="$extra_ldflags -lph" fi if os2 ; then _exesuf=".exe" _getch=getch2-os2.c _need_shmem=no _priority=yes def_dos_paths="#define HAVE_DOS_PATHS 1" def_priority="#define CONFIG_PRIORITY 1" fi for I in "$TMPDIR" "$TEMPDIR" "/tmp" ; do test "$I" && break done TMPLOG="configure.log" TMPC="$I/mplayer-conf-$RANDOM-$$.c" TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp" TMPEXE="$I/mplayer-conf-$RANDOM-$$$_exesuf" TMPH="$I/mplayer-conf-$RANDOM-$$.h" TMPS="$I/mplayer-conf-$RANDOM-$$.S" rm -f "$TMPLOG" echo configuration: $_configuration > "$TMPLOG" echo >> "$TMPLOG" if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then die "Runtime CPU detection only works for x86, x86-64 and PPC!" fi # Checking CC version... # Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure) if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then echocheck "$_cc version" cc_vendor=intel cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1) cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3) _cc_major=$(echo $cc_version | cut -d '.' -f 1) _cc_minor=$(echo $cc_version | cut -d '.' -f 2) # TODO verify older icc/ecc compatibility case $cc_version in '') cc_version="v. ?.??, bad" cc_fail=yes ;; 10.1|11.0|11.1) cc_version="$cc_version, ok" ;; *) cc_version="$cc_version, bad" cc_fail=yes ;; esac echores "$cc_version" else for _cc in "$_cc" cc gcc ; do cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1) if test "$cc_name_tmp" = "gcc"; then cc_name=$cc_name_tmp echocheck "$_cc version" cc_vendor=gnu cc_version=$($_cc -dumpversion 2>&1) case $cc_version in 2.96*) cc_fail=yes ;; *) _cc_major=$(echo $cc_version | cut -d '.' -f 1) _cc_minor=$(echo $cc_version | cut -d '.' -f 2) _cc_mini=$(echo $cc_version | cut -d '.' -f 3) ;; esac echores "$cc_version" break fi done fi # icc test "$cc_fail" = yes && die "unsupported compiler version" if test -z "$_target" && x86 ; then cat > $TMPC << EOF int main(void) { int test[(int)sizeof(char *)-7]; return 0; } EOF cc_check && host_arch=x86_64 || host_arch=i386 fi echo "Detected operating system: $system_name" echo "Detected host architecture: $host_arch" echocheck "host cc" test "$_host_cc" || _host_cc=$_cc echores $_host_cc echocheck "cross compilation" if test $_cross_compile = auto ; then cat > $TMPC << EOF int main(void) { return 0; } EOF _cross_compile=yes cc_check && "$TMPEXE" && _cross_compile=no fi echores $_cross_compile if test $_cross_compile = yes; then tmp_run() { return 0 } fi # --- # now that we know what compiler should be used for compilation, try to find # out which assembler is used by the $_cc compiler if test "$_as" = auto ; then _as=$($_cc -print-prog-name=as) test -z "$_as" && _as=as fi if test "$_nm" = auto ; then _nm=$($_cc -print-prog-name=nm) test -z "$_nm" && _nm=nm fi # XXX: this should be ok.. _cpuinfo="echo" if test "$_runtime_cpudetection" = no ; then # Cygwin has /proc/cpuinfo, but only supports Intel CPUs # FIXME: Remove the cygwin check once AMD CPUs are supported if test -r /proc/cpuinfo && ! cygwin; then # Linux with /proc mounted, extract CPU information from it _cpuinfo="cat /proc/cpuinfo" elif test -r /compat/linux/proc/cpuinfo && ! x86 ; then # FreeBSD with Linux emulation /proc mounted, # extract CPU information from it # Don't use it on x86 though, it never reports 3Dnow _cpuinfo="cat /compat/linux/proc/cpuinfo" elif darwin && ! x86 ; then # use hostinfo on Darwin _cpuinfo="hostinfo" elif aix; then # use 'lsattr' on AIX _cpuinfo="lsattr -E -l proc0 -a type" elif x86; then # all other OSes try to extract CPU information from a small helper # program cpuinfo instead $_cc -o cpuinfo$_exesuf cpuinfo.c _cpuinfo="./cpuinfo$_exesuf" fi if x86 ; then # gather more CPU information pname=$($_cpuinfo | grep 'model name' | cut -d ':' -f 2 | head -n 1) pvendor=$($_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) pfamily=$($_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) pmodel=$($_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) pstepping=$($_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 | head -n 1) exts=$($_cpuinfo | egrep 'features|flags' | cut -d ':' -f 2 | head -n 1) pparam=$(echo $exts | sed -e s/k6_mtrr/mtrr/ -e s/cyrix_arr/mtrr/ -e s/centaur_mcr/mtrr/ \ -e s/xmm/sse/ -e s/kni/sse/) for ext in $pparam ; do eval test \"\$_$ext\" = auto 2>/dev/null && eval _$ext=kernel_check done # SSE implies MMX2, but not all SSE processors report the mmxext CPU flag. test $_sse = kernel_check && _mmxext=kernel_check echocheck "CPU vendor" echores "$pvendor ($pfamily:$pmodel:$pstepping)" echocheck "CPU type" echores "$pname" fi fi # test "$_runtime_cpudetection" = no if x86 && test "$_runtime_cpudetection" = no ; then extcheck() { if test "$1" = kernel_check ; then echocheck "kernel support of $2" cat > $TMPC < #include void catch() { exit(1); } int main(void) { signal(SIGILL, catch); __asm__ volatile ("$3":::"memory"); return 0; } EOF if cc_check && tmp_run ; then eval _$2=yes echores "yes" _optimizing="$_optimizing $2" return 0 else eval _$2=no echores "failed" echo "It seems that your kernel does not correctly support $2." echo "To use $2 extensions in MPlayer, you have to upgrade/recompile your kernel!" return 1 fi fi return 0 } extcheck $_mmx "mmx" "emms" extcheck $_mmxext "mmxext" "sfence" extcheck $_3dnow "3dnow" "femms" extcheck $_3dnowext "3dnowext" "pswapd %%mm0, %%mm0" extcheck $_sse "sse" "xorps %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse" extcheck $_sse2 "sse2" "xorpd %%xmm0, %%xmm0" || _gcc3_ext="$_gcc3_ext -mno-sse2" extcheck $_ssse3 "ssse3" "pabsd %%xmm0, %%xmm0" extcheck $_cmov "cmov" "cmovb %%eax,%%ebx" echocheck "mtrr support" if test "$_mtrr" = kernel_check ; then _mtrr="yes" _optimizing="$_optimizing mtrr" fi echores "$_mtrr" if test "$_gcc3_ext" != ""; then # if we had to disable sse/sse2 because the active kernel does not # support this instruction set extension, we also have to tell # gcc3 to not generate sse/sse2 instructions for normal C code cat > $TMPC << EOF int main(void) { return 0; } EOF cc_check $_march $_gcc3_ext && _march="$_march $_gcc3_ext" fi fi def_fast_64bit='#define HAVE_FAST_64BIT 0' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 0' _arch_all='X86 X86_32 X86_64 IA64 SPARC ARM AVR32 SH4 PPC PPC64 ALPHA MIPS SGI_MIPS PA_RISC S390 S390X VAX BFIN XTENSA GENERIC' case "$host_arch" in i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) _arch='X86 X86_32' _target_arch="ARCH_X86 = yes" _target_subarch="ARCH_X86_32 = yes" def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc=486 proc=i486 if test "$_runtime_cpudetection" = no ; then case "$pvendor" in AuthenticAMD) case "$pfamily" in 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; 5) iproc=586 # LGB: models are: K5/SSA5 K5 K5 K5 ? ? K6 K6 K6-2 K6-3 # K6 model 13 are the K6-2+ and K6-III+, only differing in cache size. if test "$pmodel" -eq 9 -o "$pmodel" -eq 13; then proc=k6-3 elif test "$pmodel" -eq 5 -o "$pmodel" -eq 10; then proc=geode elif test "$pmodel" -ge 8; then proc=k6-2 elif test "$pmodel" -ge 6; then proc=k6 else proc=i586 fi ;; 6) iproc=686 # It's a bit difficult to determine the correct type of Family 6 # AMD CPUs just from their signature. Instead, we check directly # whether it supports SSE. if test "$_sse" = yes; then # gcc treats athlon-xp, athlon-4 and athlon-mp similarly. proc=athlon-xp else # Again, gcc treats athlon and athlon-tbird similarly. proc=athlon fi ;; 15) iproc=686 # k8 cpu-type only supported in gcc >= 3.4.0, but that will be # caught and remedied in the optimization tests below. proc=k8 ;; *) proc=k8 iproc=686 ;; esac ;; GenuineIntel) case "$pfamily" in 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; 5) iproc=586 if test "$pmodel" -eq 4 || test "$pmodel" -eq 8; then proc=pentium-mmx # 4 is desktop, 8 is mobile else proc=i586 fi ;; 6) iproc=686 if test "$pmodel" -ge 15; then proc=core2 elif test "$pmodel" -eq 9 -o "$pmodel" -ge 13; then proc=pentium-m elif test "$pmodel" -ge 7; then proc=pentium3 elif test "$pmodel" -ge 3; then proc=pentium2 else proc=i686 fi ;; 15) iproc=686 # A nocona in 32-bit mode has no more capabilities than a prescott. if test "$pmodel" -ge 3; then proc=prescott else proc=pentium4 fi test $_fast_cmov = "auto" && _fast_cmov=no ;; *) proc=prescott iproc=686 ;; esac ;; CentaurHauls) case "$pfamily" in 5) iproc=586 if test "$pmodel" -ge 8; then proc=winchip2 elif test "$pmodel" -ge 4; then proc=winchip-c6 else proc=i586 fi ;; 6) iproc=686 if test "$pmodel" -ge 9; then proc=c3-2 else proc=c3 iproc=586 fi ;; *) proc=i686 iproc=i686 ;; esac ;; unknown) case "$pfamily" in 3) proc=i386 iproc=386 ;; 4) proc=i486 iproc=486 ;; *) proc=i586 iproc=586 ;; esac ;; *) proc=i586 iproc=586 ;; esac fi # test "$_runtime_cpudetection" = no # check that gcc supports our CPU, if not, fall back to earlier ones # LGB: check -mcpu and -march swithing step by step with enabling # to fall back till 386. # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead if [ "$cc_vendor" = "gnu" ] && ([ "$_cc_major" -gt 3 ] || ( [ "$_cc_major" = 3 ] && [ "$_cc_minor" -ge 4 ])) ; then cpuopt=-mtune else cpuopt=-mcpu fi echocheck "GCC & CPU optimization abilities" cat > $TMPC << EOF int main(void) { return 0; } EOF if test "$_runtime_cpudetection" = no ; then cc_check -march=native && proc=native if test "$proc" = "k8"; then cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp fi if test "$proc" = "athlon-xp"; then cc_check -march=$proc $cpuopt=$proc || proc=athlon fi if test "$proc" = "k6-3" || test "$proc" = "k6-2"; then cc_check -march=$proc $cpuopt=$proc || proc=k6 fi if test "$proc" = "k6" || test "$proc" = "c3"; then if ! cc_check -march=$proc $cpuopt=$proc; then if cc_check -march=i586 $cpuopt=i686; then proc=i586-i686 else proc=i586 fi fi fi if test "$proc" = "prescott" ; then cc_check -march=$proc $cpuopt=$proc || proc=pentium4 fi if test "$proc" = "core2" ; then cc_check -march=$proc $cpuopt=$proc || proc=pentium-m fi 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 cc_check -march=$proc $cpuopt=$proc || proc=i686 fi if test "$proc" = "i686" || test "$proc" = "pentium-mmx" || test "$proc" = "winchip-c6" || test "$proc" = "winchip2"; then cc_check -march=$proc $cpuopt=$proc || proc=i586 fi if test "$proc" = "i586"; then cc_check -march=$proc $cpuopt=$proc || proc=i486 fi if test "$proc" = "i486" ; then cc_check -march=$proc $cpuopt=$proc || proc=i386 fi if test "$proc" = "i386" ; then cc_check -march=$proc $cpuopt=$proc || proc=error fi if test "$proc" = "error" ; then echores "CPU optimization disabled. CPU not recognized or your compiler is too old." _mcpu="" _march="" _optimizing="" elif test "$proc" = "i586-i686"; then _march="-march=i586" _mcpu="$cpuopt=i686" _optimizing="$proc" else _march="-march=$proc" _mcpu="$cpuopt=$proc" _optimizing="$proc" fi else # if test "$_runtime_cpudetection" = no _mcpu="$cpuopt=generic" # at least i486 required, for bswap instruction _march="-march=i486" cc_check $_mcpu || _mcpu="$cpuopt=i686" cc_check $_mcpu || _mcpu="" cc_check $_march $_mcpu || _march="" fi ## Gabucino : --target takes effect here (hopefully...) by overwriting ## autodetected mcpu/march parameters if test "$_target" ; then # TODO: it may be a good idea to check GCC and fall back in all cases if test "$host_arch" = "i586-i686"; then _march="-march=i586" _mcpu="$cpuopt=i686" else _march="-march=$host_arch" _mcpu="$cpuopt=$host_arch" fi proc="$host_arch" case "$proc" in i386) iproc=386 ;; i486) iproc=486 ;; i586|k5|k6|k6-2|k6-3|pentium|pentium-mmx) iproc=586 ;; i686|athlon*|pentium*) iproc=686 ;; *) iproc=586 ;; esac fi if test $_cmov = "yes" && test $_fast_cmov = "auto" ; then _fast_cmov="yes" else _fast_cmov="no" fi echores "$proc" ;; ia64) _arch='IA64' _target_arch='ARCH_IA64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='ia64' ;; x86_64|amd64) _arch='X86 X86_64' _target_subarch='ARCH_X86_64 = yes' _target_arch="ARCH_X86 = yes" def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' def_fast_64bit='#define HAVE_FAST_64BIT 1' iproc='x86_64' # gcc >= 3.4.0 doesn't support -mcpu, we have to use -mtune instead if test "$cc_vendor" = "gnu" && test "$_cc_major" -gt 3 -o "$_cc_major" -eq 3 -a "$_cc_minor" -ge 4 ; then cpuopt=-mtune else cpuopt=-mcpu fi test $_fast_cmov = "auto" && _fast_cmov=yes if test "$_runtime_cpudetection" = no ; then case "$pvendor" in AuthenticAMD) proc=k8;; GenuineIntel) case "$pfamily" in 6) proc=core2;; *) # 64-bit prescotts exist, but as far as GCC is concerned they # have the same capabilities as a nocona. proc=nocona ;; esac ;; *) proc=error;; esac fi # test "$_runtime_cpudetection" = no echocheck "GCC & CPU optimization abilities" cat > $TMPC << EOF int main(void) { return 0; } EOF # This is a stripped-down version of the i386 fallback. if test "$_runtime_cpudetection" = no ; then cc_check -march=native && proc=native # --- AMD processors --- if test "$proc" = "k8"; then cc_check -march=$proc $cpuopt=$proc || proc=athlon-xp fi # This will fail if gcc version < 3.3, which is ok because earlier # versions don't really support 64-bit on amd64. # Is this a valid assumption? -Corey if test "$proc" = "athlon-xp"; then cc_check -march=$proc $cpuopt=$proc || proc=error fi # --- Intel processors --- if test "$proc" = "core2"; then cc_check -march=$proc $cpuopt=$proc || proc=nocona fi if test "$proc" = "nocona"; then cc_check -march=$proc $cpuopt=$proc || proc=pentium4 fi if test "$proc" = "pentium4"; then cc_check -march=$proc $cpuopt=$proc || proc=error fi _march="-march=$proc" _mcpu="$cpuopt=$proc" if test "$proc" = "error" ; then echores "CPU optimization disabled. CPU not recognized or your compiler is too old." _mcpu="" _march="" fi else # if test "$_runtime_cpudetection" = no # x86-64 is an undocumented option, an intersection of k8 and nocona. _march="-march=x86-64" _mcpu="$cpuopt=generic" cc_check $_mcpu || _mcpu="x86-64" cc_check $_mcpu || _mcpu="" cc_check $_march $_mcpu || _march="" fi _optimizing="" echores "$proc" ;; sparc|sparc64) _arch='SPARC' _target_arch='ARCH_SPARC = yes' iproc='sparc' if test "$host_arch" = "sparc64" ; then _vis='yes' proc='ultrasparc' def_fast_64bit='#define HAVE_FAST_64BIT 1' elif sunos ; then echocheck "CPU type" karch=$(uname -m) case "$(echo $karch)" in sun4) proc=v7 ;; sun4c) proc=v7 ;; sun4d) proc=v8 ;; sun4m) proc=v8 ;; sun4u) proc=ultrasparc _vis='yes' ;; sun4v) proc=v9 ;; *) proc=v8 ;; esac echores "$proc" else proc=v8 fi _mcpu="-mcpu=$proc" _optimizing="$proc" ;; arm|armv4l|armv5tel) _arch='ARM' _target_arch='ARCH_ARM = yes' iproc='arm' ;; avr32) _arch='AVR32' _target_arch='ARCH_AVR32 = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='avr32' ;; sh|sh4) _arch='SH4' _target_arch='ARCH_SH4 = yes' iproc='sh4' ;; ppc|ppc64|powerpc|powerpc64) _arch='PPC' def_dcbzl='#define HAVE_DCBZL 0' _target_arch='ARCH_PPC = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='ppc' if test "$host_arch" = "ppc64" -o "$host_arch" = "powerpc64" ; then _arch='PPC PPC64' _target_subarch='ARCH_PPC64 = yes' def_fast_64bit='#define HAVE_FAST_64BIT 1' fi echocheck "CPU type" case $system_name in Linux) proc=$($_cpuinfo | grep 'cpu' | cut -d ':' -f 2 | cut -d ',' -f 1 | cut -b 2- | head -n 1) if test -n "$($_cpuinfo | grep altivec)"; then test $_altivec = auto && _altivec=yes fi ;; Darwin) proc=$($_cpuinfo | grep "Processor type" | cut -f 3 -d ' ' | sed 's/ppc//') if [ $(sysctl -n hw.vectorunit) -eq 1 -o \ "$(sysctl -n hw.optional.altivec 2> /dev/null)" = "1" ]; then test $_altivec = auto && _altivec=yes fi ;; NetBSD) # only gcc 3.4 works reliably with AltiVec code under NetBSD case $cc_version in 2*|3.0*|3.1*|3.2*|3.3*) ;; *) if [ $(sysctl -n machdep.altivec) -eq 1 ]; then test $_altivec = auto && _altivec=yes fi ;; esac ;; AIX) proc=$($_cpuinfo | grep 'type' | cut -f 2 -d ' ' | sed 's/PowerPC_//') ;; esac if test "$_altivec" = yes; then echores "$proc altivec" else _altivec=no echores "$proc" fi echocheck "GCC & CPU optimization abilities" if test -n "$proc"; then case "$proc" in 601) _march='-mcpu=601' _mcpu='-mtune=601' ;; 603) _march='-mcpu=603' _mcpu='-mtune=603' ;; 603e|603ev) _march='-mcpu=603e' _mcpu='-mtune=603e' ;; 604|604e|604r|604ev) _march='-mcpu=604' _mcpu='-mtune=604' ;; 740|740/750|745/755) _march='-mcpu=740' _mcpu='-mtune=740' ;; 750|750CX) _march='-mcpu=750' _mcpu='-mtune=750' ;; POWER) _march='-mcpu=power' _mcpu='-mtune=power' ;; POWER2) _march='-mcpu=power2' _mcpu='-mtune=power2' ;; POWER3) _march='-mcpu=power3' _mcpu='-mtune=power3' ;; *) ;; esac # gcc 3.1(.1) and up supports 7400 and 7450 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "1" || test "$_cc_major" -ge "4"; then case "$proc" in 7400*|7410*) _march='-mcpu=7400' _mcpu='-mtune=7400' ;; 7447*|7450*|7455*) _march='-mcpu=7450' _mcpu='-mtune=7450' ;; *) ;; esac fi # gcc 3.2 and up supports 970 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then case "$proc" in 970*|PPC970*) _march='-mcpu=970' _mcpu='-mtune=970' def_dcbzl='#define HAVE_DCBZL 1' ;; *) ;; esac fi # gcc 3.3 and up supports POWER4 if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "3" || test "$_cc_major" -ge "4"; then case "$proc" in POWER4) _march='-mcpu=power4' _mcpu='-mtune=power4' ;; *) ;; esac fi # gcc 3.4 and up supports 440* if test "$_cc_major" -ge "3" && test "$_cc_minor" -ge "4" || test "$_cc_major" -ge "4"; then case "$proc" in 440EP*) _march='-mcpu=440fp' _mcpu='-mtune=440fp' ;; 440G* ) _march='-mcpu=440' _mcpu='-mtune=440' ;; *) ;; esac fi # gcc 4.0 and up supports POWER5 if test "$_cc_major" -ge "4"; then case "$proc" in POWER5*) _march='-mcpu=power5' _mcpu='-mtune=power5' ;; *) ;; esac fi fi if test -n "$_mcpu"; then _optimizing=$(echo $_mcpu | cut -c 8-) echores "$_optimizing" else echores "none" fi ;; alpha*) _arch='ALPHA' _target_arch='ARCH_ALPHA = yes' iproc='alpha' echocheck "CPU type" cat > $TMPC << EOF int main(void) { unsigned long ver, mask; __asm__ ("implver %0" : "=r" (ver)); __asm__ ("amask %1, %0" : "=r" (mask) : "r" (-1)); printf("%ld-%x\n", ver, ~mask); return 0; } EOF $_cc -o "$TMPEXE" "$TMPC" case $("$TMPEXE") in 0-0) proc="ev4"; _mvi="0";; 1-0) proc="ev5"; _mvi="0";; 1-1) proc="ev56"; _mvi="0";; 1-101) proc="pca56"; _mvi="1";; 2-303) proc="ev6"; _mvi="1";; 2-307) proc="ev67"; _mvi="1";; 2-1307) proc="ev68"; _mvi="1";; esac echores "$proc" echocheck "GCC & CPU optimization abilities" if test "$proc" = "ev68" ; then cc_check -mcpu=$proc || proc=ev67 fi if test "$proc" = "ev67" ; then cc_check -mcpu=$proc || proc=ev6 fi _mcpu="-mcpu=$proc" echores "$proc" _optimizing="$proc" ;; mips) _arch='SGI_MIPS' _target_arch='ARCH_SGI_MIPS = yes' iproc='sgi-mips' if irix ; then echocheck "CPU type" proc=$(hinv -c processor | grep CPU | cut -d " " -f3) case "$(echo $proc)" in R3000) _march='-mips1' _mcpu='-mtune=r2000' ;; R4000) _march='-mips3' _mcpu='-mtune=r4000' ;; R4400) _march='-mips3' _mcpu='-mtune=r4400' ;; R4600) _march='-mips3' _mcpu='-mtune=r4600' ;; R5000) _march='-mips4' _mcpu='-mtune=r5000' ;; R8000|R10000|R12000|R14000|R16000) _march='-mips4' _mcpu='-mtune=r8000' ;; esac # gcc < 3.x does not support -mtune. if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 ; then _mcpu='' fi echores "$proc" fi ;; hppa) _arch='PA_RISC' _target_arch='ARCH_PA_RISC = yes' iproc='PA-RISC' ;; s390) _arch='S390' _target_arch='ARCH_S390 = yes' iproc='390' ;; s390x) _arch='S390X' _target_arch='ARCH_S390X = yes' iproc='390x' ;; vax) _arch='VAX' _target_arch='ARCH_VAX = yes' iproc='vax' ;; xtensa) _arch='XTENSA' _target_arch='ARCH_XTENSA = yes' iproc='xtensa' ;; generic) _arch='GENERIC' _target_arch='ARCH_GENERIC = yes' ;; *) echo "The architecture of your CPU ($host_arch) is not supported by this configure script" echo "It seems nobody has ported MPlayer to your OS or CPU type yet." die "unsupported architecture $host_arch" ;; esac # case "$host_arch" in if test "$_runtime_cpudetection" = yes ; then if x86 ; then test "$_cmov" != no && _cmov=yes x86_32 && _cmov=no test "$_mmx" != no && _mmx=yes test "$_3dnow" != no && _3dnow=yes test "$_3dnowext" != no && _3dnowext=yes test "$_mmxext" != no && _mmxext=yes test "$_sse" != no && _sse=yes test "$_sse2" != no && _sse2=yes test "$_ssse3" != no && _ssse3=yes test "$_mtrr" != no && _mtrr=yes fi if ppc; then _altivec=yes fi fi # endian testing echocheck "byte order" if test "$_big_endian" = auto ; then cat > $TMPC < $TMPC << EOF int ff_extern; EOF cc_check -c || die "Symbol mangling check failed." sym=$($_nm -P -g $TMPEXE) extern_prefix=${sym%%ff_extern*} def_extern_asm="#define EXTERN_ASM $extern_prefix" def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\"" echores $extern_prefix echocheck "assembler support of -pipe option" cat > $TMPC << EOF int main(void) { return 0; } EOF cc_check -pipe && _pipe="-pipe" && echores "yes" || echores "no" echocheck "compiler support of named assembler arguments" _named_asm_args=yes def_named_asm_args="#define NAMED_ASM_ARGS 1" if test "$cc_vendor" = "gnu" && test "$_cc_major" -lt 3 \ -o "$_cc_major" -eq 3 -a "$_cc_minor" = 0 ; then _named_asm_args=no def_named_asm_args="#undef NAMED_ASM_ARGS" fi echores $_named_asm_args if darwin && test "$cc_vendor" = "gnu" ; then echocheck "GCC support of -mstackrealign" # GCC 4.2 and some earlier Apple versions support this flag on x86. Since # Mac OS X/Intel has an ABI different from Windows this is needed to avoid # crashes when loading Win32 DLLs. Unfortunately some gcc versions create # wrong code with this flag, but this can be worked around by adding # -fno-unit-at-a-time as described in the blog post at # http://www.dribin.org/dave/blog/archives/2006/12/05/missing_third_param/ cat > $TMPC << EOF __attribute__((noinline)) static int foo3(int i1, int i2, int i3) { return i3; } int main(void) { return foo3(1,2,3) == 3 ? 0 : 1; } EOF cc_check -O4 -mstackrealign && tmp_run && cflags_stackrealign=-mstackrealign test -z "$cflags_stackrealign" && cc_check -O4 -mstackrealign -fno-unit-at-a-time \ && tmp_run && cflags_stackrealign="-mstackrealign -fno-unit-at-a-time" test -n "$cflags_stackrealign" && echores "yes" || echores "no" fi # if darwin && test "$cc_vendor" = "gnu" ; then # Checking for CFLAGS _install_strip="-s" if test "$_profile" != "" || test "$_debug" != "" ; then CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile" _install_strip= elif test -z "$CFLAGS" ; then if test "$cc_vendor" = "intel" ; then CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144" elif test "$cc_vendor" != "gnu" ; then CFLAGS="-O2 $_march $_mcpu $_pipe" else CFLAGS="-Wall -Wno-switch -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer" extra_ldflags="$extra_ldflags -ffast-math" fi else _warn_CFLAGS=yes fi cat > $TMPC << EOF int main(void) { return 0; } EOF if test "$cc_vendor" = "gnu" ; then cc_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS" cc_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS" cc_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS" cc_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS" cc_check -Wundef && CFLAGS="-Wundef $CFLAGS" else CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS" fi cc_check -mno-omit-leaf-frame-pointer && cflags_no_omit_leaf_frame_pointer="-mno-omit-leaf-frame-pointer" if test -n "$LDFLAGS" ; then extra_ldflags="$extra_ldflags $LDFLAGS" _warn_CFLAGS=yes elif test "$cc_vendor" = "intel" ; then extra_ldflags="$extra_ldflags -i-static" fi if test -n "$CPPFLAGS" ; then extra_cflags="$extra_cflags $CPPFLAGS" _warn_CFLAGS=yes fi if x86_32 ; then # Checking assembler (_as) compatibility... # Added workaround for older as that reads from stdin by default - atmos as_version=$(echo '' | $_as -version 2>&1 | sed -n 's/^.*assembler \(version \)*\([0-9.]*\).*$/\2/p') echocheck "assembler ($_as $as_version)" _pref_as_version='2.9.1' echo 'nop' > $TMPS if test "$_mmx" = yes ; then echo 'emms' >> $TMPS fi if test "$_3dnow" = yes ; then _pref_as_version='2.10.1' echo 'femms' >> $TMPS fi if test "$_3dnowext" = yes ; then _pref_as_version='2.10.1' echo 'pswapd %mm0, %mm0' >> $TMPS fi if test "$_mmxext" = yes ; then _pref_as_version='2.10.1' echo 'movntq %mm0, (%eax)' >> $TMPS fi if test "$_sse" = yes ; then _pref_as_version='2.10.1' echo 'xorps %xmm0, %xmm0' >> $TMPS fi #if test "$_sse2" = yes ; then # _pref_as_version='2.11' # echo 'xorpd %xmm0, %xmm0' >> $TMPS #fi if test "$_cmov" = yes ; then _pref_as_version='2.10.1' echo 'cmovb %eax, %ebx' >> $TMPS fi if test "$_ssse3" = yes ; then _pref_as_version='2.16.92' echo 'pabsd %xmm0, %xmm1' >> $TMPS fi $_as $TMPS -o $TMPEXE > /dev/null 2>&1 || as_verc_fail=yes if test "$as_verc_fail" != yes ; then echores "ok" else _res_comment="Upgrade binutils to ${_pref_as_version} or use --disable-ssse3 etc." echores "failed" die "obsolete binutils version" fi fi #if x86_32 echocheck ".align is a power of two" if test "$_asmalign_pot" = auto ; then _asmalign_pot=no cat > $TMPC << EOF int main(void) { __asm__ (".align 3"); return 0; } EOF cc_check && _asmalign_pot=yes fi if test "$_asmalign_pot" = "yes" ; then def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"' else def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"' fi echores $_asmalign_pot if x86 ; then echocheck "10 assembler operands" ten_operands=no def_ten_operands='#define HAVE_TEN_OPERANDS 0' cat > $TMPC << EOF int main(void) { int x=0; __asm__ volatile( "" :"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x) ); return 0; } EOF cc_check && ten_operands=yes && def_ten_operands='#define HAVE_TEN_OPERANDS 1' echores $ten_operands echocheck "ebx availability" ebx_available=no def_ebx_available='#define HAVE_EBX_AVAILABLE 0' cat > $TMPC << EOF int main(void) { int x; __asm__ volatile( "xor %0, %0" :"=b"(x) // just adding ebx to clobber list seems unreliable with some // compilers, e.g. Haiku's gcc 2.95 ); // and the above check does not work for OSX 64 bit... __asm__ volatile("":::"%ebx"); return 0; } EOF cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1' echores $ebx_available echocheck "PIC" pic=no cat > $TMPC << EOF int main(void) { #if !(defined(__PIC__) || defined(__pic__) || defined(PIC)) #error PIC not enabled #endif return 0; } EOF cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC" echores $pic echocheck "yasm" if test -z "$YASMFLAGS" ; then if darwin ; then x86_64 && objformat="macho64" || objformat="macho" elif win32 ; then objformat="win32" else objformat="elf" fi # currently tested for Linux x86, x86_64 YASMFLAGS="-f $objformat" x86_64 && YASMFLAGS="$YASMFLAGS -DARCH_X86_64 -m amd64" test "$pic" = "yes" && YASMFLAGS="$YASMFLAGS -DPIC" case "$objformat" in elf) test $_debug && YASMFLAGS="$YASMFLAGS -g dwarf2" ;; *) YASMFLAGS="$YASMFLAGS -DPREFIX" ;; esac else _warn_CFLAGS=yes fi echo "pabsw xmm0, xmm0" > $TMPS yasm_check || _yasm="" if test $_yasm ; then test "$_mmx" = "yes" && fft_mmx="yes" def_yasm='#define HAVE_YASM 1' _have_yasm="yes" echores "$_yasm" else def_yasm='#define HAVE_YASM 0' fft_mmx="no" _have_yasm="no" echores "no" fi echocheck "bswap" def_bswap='#define HAVE_BSWAP 0' echo 'bswap %eax' > $TMPS $_as $TMPS -o $TMPEXE > /dev/null 2>&1 && def_bswap='#define HAVE_BSWAP 1' && bswap=yes || bswap=no echores "$bswap" fi #if x86 #FIXME: This should happen before the check for CFLAGS.. def_altivec_h='#define HAVE_ALTIVEC_H 0' if ppc && ( test "$_altivec" = yes || test "$_runtime_cpudetection" = yes ) ; then # check if AltiVec is supported by the compiler, and how to enable it echocheck "GCC AltiVec flags" cat > $TMPC << EOF int main(void) { return 0; } EOF if $(cc_check -maltivec -mabi=altivec) ; then _altivec_gcc_flags="-maltivec -mabi=altivec" # check if should be included cat > $TMPC << EOF #include int main(void) { return 0; } EOF if $(cc_check $_altivec_gcc_flags) ; then def_altivec_h='#define HAVE_ALTIVEC_H 1' inc_altivec_h='#include ' else cat > $TMPC << EOF int main(void) { return 0; } EOF if $(cc_check -faltivec) ; then _altivec_gcc_flags="-faltivec" else _altivec=no _altivec_gcc_flags="none, AltiVec disabled" fi fi fi echores "$_altivec_gcc_flags" # check if the compiler supports braces for vector declarations cat > $TMPC << EOF $inc_altivec_h int main(void) { (vector int) {1}; return 0; } EOF cc_check $_altivec_gcc_flags || die "You need a compiler that supports {} in AltiVec vector declarations." # Disable runtime cpudetection if we cannot generate AltiVec code or # AltiVec is disabled by the user. test "$_runtime_cpudetection" = yes && test "$_altivec" = no \ && _runtime_cpudetection=no # Show that we are optimizing for AltiVec (if enabled and supported). test "$_runtime_cpudetection" = no && test "$_altivec" = yes \ && _optimizing="$_optimizing altivec" # If AltiVec is enabled, make sure the correct flags turn up in CFLAGS. test "$_altivec" = yes && CFLAGS="$CFLAGS $_altivec_gcc_flags" fi if ppc ; then def_xform_asm='#define HAVE_XFORM_ASM 0' xform_asm=no echocheck "XFORM ASM support" cat > $TMPC << EOF int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; } EOF cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1' echores "$xform_asm" fi if arm ; then echocheck "ARM pld instruction" cat > $TMPC << EOF int main(void) { __asm__ volatile ("pld [r0]"); return 0; } EOF pld=no cc_check && pld=yes echores "$pld" echocheck "ARMv5TE (Enhanced DSP Extensions)" if test $_armv5te = "auto" ; then cat > $TMPC << EOF int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; } EOF _armv5te=no cc_check && _armv5te=yes fi echores "$_armv5te" echocheck "ARMv6 (SIMD instructions)" if test $_armv6 = "auto" ; then cat > $TMPC << EOF int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; } EOF _armv6=no cc_check && _armv6=yes fi echores "$_armv6" echocheck "ARMv6t2 (SIMD instructions)" if test $_armv6t2 = "auto" ; then cat > $TMPC << EOF int main(void) { __asm__ volatile ("movt r0, #0"); return 0; } EOF _armv6t2=no cc_check && _armv6t2=yes fi echores "$_armv6" echocheck "ARM VFP" if test $_armvfp = "auto" ; then cat > $TMPC << EOF int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; } EOF _armvfp=no cc_check && _armvfp=yes fi echores "$_armvfp" echocheck "ARM NEON" if test $neon = "auto" ; then cat > $TMPC << EOF int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; } EOF neon=no cc_check && neon=yes fi echores "$neon" echocheck "iWMMXt (Intel XScale SIMD instructions)" if test $_iwmmxt = "auto" ; then cat > $TMPC << EOF int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; } EOF _iwmmxt=no cc_check && _iwmmxt=yes fi echores "$_iwmmxt" fi _cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" test "$_3dnow" = yes && _cpuexts="AMD3DNOW $_cpuexts" test "$_3dnowext" = yes && _cpuexts="AMD3DNOWEXT $_cpuexts" test "$_sse" = yes && _cpuexts="SSE $_cpuexts" test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts" test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts" test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts" test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts" test "$pld" = yes && _cpuexts="PLD $_cpuexts" test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts" test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts" test "$_armv6t2" = yes && _cpuexts="ARMV6T2 $_cpuexts" test "$_armvfp" = yes && _cpuexts="ARMVFP $_cpuexts" test "$neon" = yes && _cpuexts="NEON $_cpuexts" test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts" test "$_vis" = yes && _cpuexts="VIS $_cpuexts" test "$_mvi" = yes && _cpuexts="MVI $_cpuexts" # Checking kernel version... if x86_32 && linux ; then _k_verc_problem=no kernel_version=$(uname -r 2>&1) echocheck "$system_name kernel version" case "$kernel_version" in '') kernel_version="?.??"; _k_verc_fail=yes;; [0-1].[0-9].[0-9]*|2.[0-3].[0-9]*) _k_verc_problem=yes;; esac if test "$_k_verc_problem" = yes && test "$_sse" = yes ; then _k_verc_fail=yes fi if test "$_k_verc_fail" ; then echores "$kernel_version, fail" echo "WARNING! If you want to run MPlayer on this system, get prepared for problems!" echo "2.2.x has limited SSE support. Upgrade the kernel or use --disable-sse if you" echo "experience crashes. MPlayer tries to autodetect if your kernel correctly" echo "supports SSE, but you have been warned! If you are using a kernel older than" echo "2.2.x you must upgrade it to get SSE support!" # die "Your kernel is too old for this CPU." # works fine on some 2.2.x so don't die (later check will test) else echores "$kernel_version, ok" fi fi ###################### # MAIN TESTS GO HERE # ###################### echocheck "-lposix" cat > $TMPC < $TMPC < $TMPC < int main(void) { nl_langinfo(CODESET); return 0; } EOF _langinfo=no cc_check && _langinfo=yes fi if test "$_langinfo" = yes ; then def_langinfo='#define HAVE_LANGINFO 1' else def_langinfo='#undef HAVE_LANGINFO' fi echores "$_langinfo" echocheck "language" # Set preferred languages, "all" uses English as main language. test -z "$language" && language=$LINGUAS test -z "$language_doc" && language_doc=$language test -z "$language_man" && language_man=$language test -z "$language_msg" && language_msg=$language language_doc=$(echo $language_doc | tr , " ") language_man=$(echo $language_man | tr , " ") language_msg=$(echo $language_msg | tr , " ") test "$language_doc" = "all" && language_doc=$doc_lang_all test "$language_man" = "all" && language_man=$man_lang_all test "$language_msg" = "all" && language_msg=en # Prune non-existing translations from language lists. # Set message translation to the first available language. # Fall back on English. for lang in $language_doc ; do test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang" done language_doc=$tmp_language_doc test -z "$language_doc" && language_doc=en for lang in $language_man ; do test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang" done language_man=$tmp_language_man test -z "$language_man" && language_man=en for lang in $language_msg ; do test -f "help/help_mp-${lang}.h" && tmp_language_msg=$lang && break done language_msg=$tmp_language_msg test -z "$language_msg" && language_msg=en _mp_help="help/help_mp-${language_msg}.h" echores "messages: $language_msg - man pages: $language_man - documentation: $language_doc" echocheck "enable sighandler" if test "$_sighandler" = yes ; then def_sighandler='#define CONFIG_SIGHANDLER 1' else def_sighandler='#undef CONFIG_SIGHANDLER' fi echores "$_sighandler" echocheck "runtime cpudetection" if test "$_runtime_cpudetection" = yes ; then _optimizing="Runtime CPU-Detection enabled" def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 1' else def_runtime_cpudetection='#define CONFIG_RUNTIME_CPUDETECT 0' fi echores "$_runtime_cpudetection" echocheck "restrict keyword" for restrict_keyword in restrict __restrict __restrict__ ; do echo "void foo(char * $restrict_keyword p); int main(void) { return 0; }" > $TMPC if cc_check; then def_restrict_keyword=$restrict_keyword break; fi done if [ -n "$def_restrict_keyword" ]; then echores "$def_restrict_keyword" else echores "none" fi # Avoid infinite recursion loop ("#define restrict restrict") if [ "$def_restrict_keyword" != "restrict" ]; then def_restrict_keyword="#define restrict $def_restrict_keyword" else def_restrict_keyword="" fi echocheck "__builtin_expect" # GCC branch prediction hint cat > $TMPC << EOF int foo(int a) { a = __builtin_expect(a, 10); return a == 10 ? 0 : 1; } int main(void) { return foo(10) && foo(0); } EOF _builtin_expect=no cc_check && _builtin_expect=yes if test "$_builtin_expect" = yes ; then def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1' else def_builtin_expect='#undef HAVE_BUILTIN_EXPECT' fi echores "$_builtin_expect" echocheck "kstat" cat > $TMPC << EOF #include int main(void) { (void) kstat_open(); (void) kstat_close(0); return 0; } EOF _kstat=no cc_check -lkstat && _kstat=yes if test "$_kstat" = yes ; then def_kstat="#define HAVE_LIBKSTAT 1" extra_ldflags="$extra_ldflags -lkstat" else def_kstat="#undef HAVE_LIBKSTAT" fi echores "$_kstat" echocheck "posix4" # required for nanosleep on some systems cat > $TMPC << EOF #include int main(void) { (void) nanosleep(0, 0); return 0; } EOF _posix4=no cc_check -lposix4 && _posix4=yes if test "$_posix4" = yes ; then extra_ldflags="$extra_ldflags -lposix4" fi echores "$_posix4" for func in exp2 exp2f llrint log2 log2f lrint lrintf round roundf truncf; do echocheck $func cat > $TMPC << EOF #include int main(void) { long (*foo)(float); foo = $func; (void)(*foo)(0.0); return 0; } EOF eval _$func=no cc_check -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes if eval test "x\$_$func" = "xyes"; then eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 1\"" echores yes else eval def_$func="\"#define HAVE_$(echo $func | tr '[a-z]' '[A-Z]') 0\"" echores no fi done echocheck "mkstemp" cat > $TMPC << EOF #include int main(void) { char a; mkstemp(&a); return 0; } EOF _mkstemp=no cc_check && _mkstemp=yes if test "$_mkstemp" = yes ; then def_mkstemp='#define HAVE_MKSTEMP 1' else def_mkstemp='#undef HAVE_MKSTEMP' fi echores "$_mkstemp" echocheck "nanosleep" # also check for nanosleep cat > $TMPC << EOF #include int main(void) { (void) nanosleep(0, 0); return 0; } EOF _nanosleep=no cc_check && _nanosleep=yes if test "$_nanosleep" = yes ; then def_nanosleep='#define HAVE_NANOSLEEP 1' else def_nanosleep='#undef HAVE_NANOSLEEP' fi echores "$_nanosleep" echocheck "socklib" # for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl): # for BeOS (socket stuff is in -lsocket, gethostbyname and friends in -lbind): cat > $TMPC << EOF #include #include int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; } EOF _socklib=no for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break done test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no if test $_winsock2_h = auto ; then _winsock2_h=no cat > $TMPC << EOF #include int main(void) { (void) gethostbyname(0); return 0; } EOF cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes fi test "$_ld_sock" && _res_comment="using $_ld_sock" echores "$_socklib" if test $_winsock2_h = yes ; then _ld_sock="-lws2_32" def_winsock2_h='#define HAVE_WINSOCK2_H 1' else def_winsock2_h='#define HAVE_WINSOCK2_H 0' fi echocheck "arpa/inet.h" arpa_inet_h=no def_arpa_inet_h='#define HAVE_ARPA_INET_H 0' cat > $TMPC << EOF #include int main(void) { return 0; } EOF cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1' echores "$arpa_inet_h" echocheck "inet_pton()" def_inet_pton='#define HAVE_INET_PTON 0' inet_pton=no cat > $TMPC << EOF #include #include #include int main(void) { (void) inet_pton(0, 0, 0); return 0; } EOF for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do cc_check $_ld_tmp && inet_pton=yes && break done if test $inet_pton = yes ; then test "$_ld_tmp" && _res_comment="using $_ld_tmp" def_inet_pton='#define HAVE_INET_PTON 1' fi echores "$inet_pton" echocheck "inet_aton()" def_inet_aton='#define HAVE_INET_ATON 0' inet_aton=no cat > $TMPC << EOF #include #include #include int main(void) { (void) inet_aton(0, 0); return 0; } EOF for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do cc_check $_ld_tmp && inet_aton=yes && break done if test $inet_aton = yes ; then test "$_ld_tmp" && _res_comment="using $_ld_tmp" def_inet_aton='#define HAVE_INET_ATON 1' fi echores "$inet_aton" echocheck "socklen_t" _socklen_t=no for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do cat > $TMPC << EOF #include <$header> int main(void) { socklen_t v = 0; return v; } EOF cc_check && _socklen_t=yes && break done if test "$_socklen_t" = yes ; then def_socklen_t='#define HAVE_SOCKLEN_T 1' else def_socklen_t='#define HAVE_SOCKLEN_T 0' fi echores "$_socklen_t" echocheck "closesocket()" _closesocket=no cat > $TMPC << EOF #include int main(void) { closesocket(~0); return 0; } EOF cc_check $_ld_sock && _closesocket=yes if test "$_closesocket" = yes ; then def_closesocket='#define HAVE_CLOSESOCKET 1' else def_closesocket='#define HAVE_CLOSESOCKET 0' fi echores "$_closesocket" echocheck "network" test $_winsock2_h = no && test $inet_pton = no && test $inet_aton = no && _network=no if test "$_network" = yes ; then def_network='#define CONFIG_NETWORK 1' extra_ldflags="$extra_ldflags $_ld_sock" _inputmodules="network $_inputmodules" else _noinputmodules="network $_noinputmodules" def_network='#undef CONFIG_NETWORK' _ftp=no fi echores "$_network" echocheck "inet6" if test "$_inet6" = auto ; then cat > $TMPC << EOF #include #if !defined(_WIN32) || defined(__CYGWIN__) #include #include #else #include #endif int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; } EOF _inet6=no if cc_check $_ld_sock ; then _inet6=yes fi fi if test "$_inet6" = yes ; then def_inet6='#define HAVE_AF_INET6 1' else def_inet6='#undef HAVE_AF_INET6' fi echores "$_inet6" echocheck "gethostbyname2" if test "$_gethostbyname2" = auto ; then cat > $TMPC << EOF #include #include #include int main(void) { gethostbyname2("", AF_INET); return 0; } EOF _gethostbyname2=no if cc_check ; then _gethostbyname2=yes fi fi if test "$_gethostbyname2" = yes ; then def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1' else def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2' fi echores "$_gethostbyname2" echocheck "inttypes.h (required)" cat > $TMPC << EOF #include int main(void) { return 0; } EOF _inttypes=no cc_check && _inttypes=yes echores "$_inttypes" if test "$_inttypes" = no ; then echocheck "bitypes.h (inttypes.h predecessor)" cat > $TMPC << EOF #include int main(void) { return 0; } EOF cc_check && _inttypes=yes if test "$_inttypes" = yes ; then 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." else die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed." fi fi echocheck "int_fastXY_t in inttypes.h" cat > $TMPC << EOF #include int main(void) { volatile int_fast16_t v= 0; return v; } EOF _fast_inttypes=no cc_check && _fast_inttypes=yes if test "$_fast_inttypes" = no ; then def_fast_inttypes=' typedef signed char int_fast8_t; typedef signed int int_fast16_t; typedef signed int int_fast32_t; typedef signed long long int_fast64_t; typedef unsigned char uint_fast8_t; typedef unsigned int uint_fast16_t; typedef unsigned int uint_fast32_t; typedef unsigned long long uint_fast64_t;' fi echores "$_fast_inttypes" echocheck "malloc.h" cat > $TMPC << EOF #include int main(void) { (void) malloc(0); return 0; } EOF _malloc=no cc_check && _malloc=yes if test "$_malloc" = yes ; then def_malloc_h='#define HAVE_MALLOC_H 1' else def_malloc_h='#define HAVE_MALLOC_H 0' fi # malloc.h emits a warning in FreeBSD and OpenBSD freebsd || openbsd || dragonfly && def_malloc_h='#define HAVE_MALLOC_H 0' echores "$_malloc" echocheck "memalign()" # XXX restrict to x86 ? extend to other CPUs/cacheline sizes ? def_memalign_hack='#define CONFIG_MEMALIGN_HACK 0' cat > $TMPC << EOF #include int main(void) { (void) memalign(64, sizeof(char)); return 0; } EOF _memalign=no cc_check && _memalign=yes if test "$_memalign" = yes ; then def_memalign='#define HAVE_MEMALIGN 1' else def_memalign='#define HAVE_MEMALIGN 0' def_map_memalign='#define memalign(a,b) malloc(b)' darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1' fi echores "$_memalign" echocheck "posix_memalign()" posix_memalign=no def_posix_memalign='#define HAVE_POSIX_MEMALIGN 0' cat > $TMPC << EOF #define _XOPEN_SOURCE 600 #include int main(void) { posix_memalign(NULL, 0, 0); } EOF cc_check && posix_memalign=yes && def_posix_memalign='#define HAVE_POSIX_MEMALIGN 1' echores "$posix_memalign" echocheck "alloca.h" cat > $TMPC << EOF #include int main(void) { (void) alloca(0); return 0; } EOF _alloca=no cc_check && _alloca=yes if cc_check ; then def_alloca_h='#define HAVE_ALLOCA_H 1' else def_alloca_h='#undef HAVE_ALLOCA_H' fi echores "$_alloca" echocheck "fastmemcpy" if test "$_fastmemcpy" = yes ; then def_fastmemcpy='#define CONFIG_FASTMEMCPY 1' else def_fastmemcpy='#undef CONFIG_FASTMEMCPY' fi echores "$_fastmemcpy" echocheck "hard-coded tables" if test "$hardcoded_tables" = yes ; then def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 1' mak_hardcoded_tables='CONFIG_HARDCODED_TABLES = yes' else def_hardcoded_tables='#define CONFIG_HARDCODED_TABLES 0' fi echores "$hardcoded_tables" echocheck "mman.h" cat > $TMPC << EOF #include #include int main(void) { (void) mmap(0, 0, 0, 0, 0, 0); return 0; } EOF _mman=no cc_check && _mman=yes if test "$_mman" = yes ; then def_mman_h='#define HAVE_SYS_MMAN_H 1' else def_mman_h='#undef HAVE_SYS_MMAN_H' os2 && _need_mmap=yes fi echores "$_mman" cat > $TMPC << EOF #include #include int main(void) { void *p = MAP_FAILED; return 0; } EOF _mman_has_map_failed=no cc_check && _mman_has_map_failed=yes if test "$_mman_has_map_failed" = yes ; then def_mman_has_map_failed='' else def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)' fi echocheck "dynamic loader" cat > $TMPC << EOF #include #include int main(void) { dlopen("", 0); dlclose(NULL); dlsym(NULL, ""); return 0; } EOF _dl=no for _ld_tmp in "" "-ldl" ; do cc_check $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break done if test "$_dl" = yes ; then def_dl='#define HAVE_LIBDL 1' else def_dl='#undef HAVE_LIBDL' fi echores "$_dl" echocheck "dynamic a/v plugins support" if test "$_dl" = no ; then _dynamic_plugins=no fi if test "$_dynamic_plugins" = yes ; then def_dynamic_plugins='#define CONFIG_DYNAMIC_PLUGINS 1' else def_dynamic_plugins='#undef CONFIG_DYNAMIC_PLUGINS' fi echores "$_dynamic_plugins" def_threads='#define HAVE_THREADS 0' echocheck "pthread" if linux ; then THREAD_CFLAGS=-D_REENTRANT elif freebsd || netbsd || openbsd || bsdos ; then THREAD_CFLAGS=-D_THREAD_SAFE fi if test "$_pthreads" = auto ; then cat > $TMPC << EOF #include void* func(void *arg) { return arg; } int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; } EOF _pthreads=no if ! hpux ; then for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do # for crosscompilation, we cannot execute the program, be happy if we can link statically cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break done fi fi if test "$_pthreads" = yes ; then test $_ld_pthread && _res_comment="using $_ld_pthread" def_pthreads='#define HAVE_PTHREADS 1' def_threads='#define HAVE_THREADS 1' extra_cflags="$extra_cflags $THREAD_CFLAGS" else _res_comment="v4l, v4l2, ao_nas, win32 loader disabled" def_pthreads='#undef HAVE_PTHREADS' _nas=no ; _tv_v4l1=no ; _tv_v4l2=no mingw32 || _win32dll=no fi echores "$_pthreads" if cygwin ; then if test "$_pthreads" = yes ; then def_pthread_cache="#define PTHREAD_CACHE 1" else _stream_cache=no def_stream_cache="#undef CONFIG_STREAM_CACHE" fi fi echocheck "w32threads" if test "$_pthreads" = yes ; then _res_comment="using pthread instead" _w32threads=no fi if test "$_w32threads" = auto ; then _w32threads=no mingw32 && _w32threads=yes fi test "$_w32threads" = yes && def_threads='#define HAVE_THREADS 1' echores "$_w32threads" echocheck "rpath" netbsd &&_rpath=yes if test "$_rpath" = yes ; then for I in $(echo $extra_ldflags | sed 's/-L//g') ; do tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')" done extra_ldflags=$tmp fi echores "$_rpath" echocheck "iconv" if test "$_iconv" = auto ; then cat > $TMPC << EOF #include #include #include #define INBUFSIZE 1024 #define OUTBUFSIZE 4096 char inbuffer[INBUFSIZE]; char outbuffer[OUTBUFSIZE]; int main(void) { size_t numread; iconv_t icdsc; char *tocode="UTF-8"; char *fromcode="cp1250"; if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) { while ((numread = read(0, inbuffer, INBUFSIZE))) { char *iptr=inbuffer; char *optr=outbuffer; size_t inleft=numread; size_t outleft=OUTBUFSIZE; if (iconv(icdsc, (const char **)&iptr, &inleft, &optr, &outleft) != (size_t)(-1)) { write(1, outbuffer, OUTBUFSIZE - outleft); } } if (iconv_close(icdsc) == -1) ; } return 0; } EOF _iconv=no for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \ _iconv=yes && break done fi if test "$_iconv" = yes ; then def_iconv='#define CONFIG_ICONV 1' else def_iconv='#undef CONFIG_ICONV' fi echores "$_iconv" echocheck "soundcard.h" _soundcard_h=no def_soundcard_h='#undef HAVE_SOUNDCARD_H' def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H' for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do cat > $TMPC << EOF #include <$_soundcard_header> int main(void) { return 0; } EOF cc_check && _soundcard_h=yes && _res_comment="$_soundcard_header" && break done if test "$_soundcard_h" = yes ; then if test $_soundcard_header = "sys/soundcard.h"; then def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1' else def_soundcard_h='#define HAVE_SOUNDCARD_H 1' fi fi echores "$_soundcard_h" echocheck "sys/dvdio.h" cat > $TMPC << EOF #include #include int main(void) { return 0; } EOF _dvdio=no cc_check && _dvdio=yes if test "$_dvdio" = yes ; then def_dvdio='#define DVD_STRUCT_IN_SYS_DVDIO_H 1' else def_dvdio='#undef DVD_STRUCT_IN_SYS_DVDIO_H' fi echores "$_dvdio" echocheck "sys/cdio.h" cat > $TMPC << EOF #include #include int main(void) { return 0; } EOF _cdio=no cc_check && _cdio=yes if test "$_cdio" = yes ; then def_cdio='#define DVD_STRUCT_IN_SYS_CDIO_H 1' else def_cdio='#undef DVD_STRUCT_IN_SYS_CDIO_H' fi echores "$_cdio" echocheck "linux/cdrom.h" cat > $TMPC << EOF #include #include int main(void) { return 0; } EOF _cdrom=no cc_check && _cdrom=yes if test "$_cdrom" = yes ; then def_cdrom='#define DVD_STRUCT_IN_LINUX_CDROM_H 1' else def_cdrom='#undef DVD_STRUCT_IN_LINUX_CDROM_H' fi echores "$_cdrom" echocheck "dvd.h" cat > $TMPC << EOF #include int main(void) { return 0; } EOF _dvd=no cc_check && _dvd=yes if test "$_dvd" = yes ; then def_dvd='#define DVD_STRUCT_IN_DVD_H 1' else def_dvd='#undef DVD_STRUCT_IN_DVD_H' fi echores "$_dvd" if bsdos; then echocheck "BSDI dvd.h" cat > $TMPC << EOF #include int main(void) { return 0; } EOF _bsdi_dvd=no cc_check && _bsdi_dvd=yes if test "$_bsdi_dvd" = yes ; then def_bsdi_dvd='#define DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H 1' else def_bsdi_dvd='#undef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H' fi echores "$_bsdi_dvd" fi #if bsdos if hpux; then # also used by AIX, but AIX does not support VCD and/or libdvdread echocheck "HP-UX SCSI header" cat > $TMPC << EOF #include int main(void) { return 0; } EOF _hpux_scsi_h=no cc_check && _hpux_scsi_h=yes if test "$_hpux_scsi_h" = yes ; then def_hpux_scsi_h='#define HPUX_SCTL_IO 1' else def_hpux_scsi_h='#undef HPUX_SCTL_IO' fi echores "$_hpux_scsi_h" fi #if hpux if sunos; then echocheck "userspace SCSI headers (Solaris)" cat > $TMPC << EOF #include #include #include #include int main(void) { return 0; } EOF _sol_scsi_h=no cc_check && _sol_scsi_h=yes if test "$_sol_scsi_h" = yes ; then def_sol_scsi_h='#define SOLARIS_USCSI 1' else def_sol_scsi_h='#undef SOLARIS_USCSI' fi echores "$_sol_scsi_h" fi #if sunos echocheck "termcap" if test "$_termcap" = auto ; then cat > $TMPC < #include int main(void) { tgetent(NULL, NULL); return 0; } EOF _termcap=no for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" \ && _termcap=yes && break done fi if test "$_termcap" = yes ; then def_termcap='#define HAVE_TERMCAP 1' test $_ld_tmp && _res_comment="using $_ld_tmp" else def_termcap='#undef HAVE_TERMCAP' fi echores "$_termcap" echocheck "termios" def_termios='#undef HAVE_TERMIOS' def_termios_h='#undef HAVE_TERMIOS_H' def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H' if test "$_termios" = auto ; then _termios=no for _termios_header in "sys/termios.h" "termios.h"; do cat > $TMPC < int main(void) { return 0; } EOF cc_check && _termios=yes && _res_comment="using $_termios_header" && break done fi if test "$_termios" = yes ; then def_termios='#define HAVE_TERMIOS 1' if test "$_termios_header" = "termios.h" ; then def_termios_h='#define HAVE_TERMIOS_H 1' else def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1' fi fi echores "$_termios" echocheck "shm" if test "$_shm" = auto ; then cat > $TMPC << EOF #include #include int main(void) { shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0); return 0; } EOF _shm=no cc_check && _shm=yes fi if test "$_shm" = yes ; then def_shm='#define HAVE_SHM 1' else def_shm='#undef HAVE_SHM' fi echores "$_shm" echocheck "strsep()" cat > $TMPC << EOF #include int main(void) { char *s = "Hello, world!"; (void) strsep(&s, ","); return 0; } EOF _strsep=no cc_check && _strsep=yes if test "$_strsep" = yes ; then def_strsep='#define HAVE_STRSEP 1' _need_strsep=no else def_strsep='#undef HAVE_STRSEP' _need_strsep=yes fi echores "$_strsep" echocheck "vsscanf()" cat > $TMPC << EOF #define _ISOC99_SOURCE #include #include int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; } EOF _vsscanf=no cc_check && _vsscanf=yes if test "$_vsscanf" = yes ; then def_vsscanf='#define HAVE_VSSCANF 1' _need_vsscanf=no else def_vsscanf='#undef HAVE_VSSCANF' _need_vsscanf=yes fi echores "$_vsscanf" echocheck "swab()" cat > $TMPC << EOF #define _XOPEN_SOURCE 600 #include int main(void) { swab(0, 0, 0); return 0; } EOF _swab=no cc_check && _swab=yes if test "$_swab" = yes ; then def_swab='#define HAVE_SWAB 1' _need_swab=no else def_swab='#undef HAVE_SWAB' _need_swab=yes fi echores "$_swab" echocheck "POSIX select()" cat > $TMPC << EOF #include #include #include #include #include #include int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds,&readfds,NULL,NULL,&timeout); return 0; } EOF _posix_select=no def_posix_select='#undef HAVE_POSIX_SELECT' #select() of kLIBC (OS/2) supports socket only ! os2 && cc_check && _posix_select=yes \ && def_posix_select='#define HAVE_POSIX_SELECT 1' echores "$_posix_select" echocheck "audio select()" if test "$_select" = no ; then def_select='#undef HAVE_AUDIO_SELECT' elif test "$_select" = yes ; then def_select='#define HAVE_AUDIO_SELECT 1' fi echores "$_select" echocheck "gettimeofday()" cat > $TMPC << EOF #include #include int main(void) {struct timeval tv_start; gettimeofday(&tv_start, NULL); return 0; } EOF _gettimeofday=no cc_check && _gettimeofday=yes if test "$_gettimeofday" = yes ; then def_gettimeofday='#define HAVE_GETTIMEOFDAY 1' _need_gettimeofday=no else def_gettimeofday='#undef HAVE_GETTIMEOFDAY' _need_gettimeofday=yes fi echores "$_gettimeofday" echocheck "glob()" cat > $TMPC << EOF #include #include int main(void) { glob_t gg; glob("filename",0,NULL,&gg); return 0; } EOF _glob=no cc_check && _glob=yes if test "$_glob" = yes ; then def_glob='#define HAVE_GLOB 1' _need_glob=no else def_glob='#undef HAVE_GLOB' _need_glob=yes fi echores "$_glob" echocheck "setenv()" cat > $TMPC << EOF #include int main(void) { setenv("","",0); return 0; } EOF _setenv=no cc_check && _setenv=yes if test "$_setenv" = yes ; then def_setenv='#define HAVE_SETENV 1' _need_setenv=no else def_setenv='#undef HAVE_SETENV' _need_setenv=yes fi echores "$_setenv" if sunos; then echocheck "sysi86()" cat > $TMPC << EOF #include int main(void) { sysi86(0); return 0; } EOF _sysi86=no cc_check && _sysi86=yes if test "$_sysi86" = yes ; then def_sysi86='#define HAVE_SYSI86 1' cat > $TMPC << EOF #include int main(void) { int sysi86(int, void*); sysi86(0); return 0; } EOF cc_check && def_sysi86_iv='#define HAVE_SYSI86_iv 1' else def_sysi86='#undef HAVE_SYSI86' fi echores "$_sysi86" fi #if sunos echocheck "sys/sysinfo.h" cat > $TMPC << EOF #include int main(void) { struct sysinfo s_info; sysinfo(&s_info); return 0; } EOF _sys_sysinfo=no cc_check && _sys_sysinfo=yes if test "$_sys_sysinfo" = yes ; then def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1' else def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H' fi echores "$_sys_sysinfo" if darwin; then echocheck "Mac OS X Finder Support" def_macosx_finder='#undef CONFIG_MACOSX_FINDER' if test "$_macosx_finder" = yes ; then def_macosx_finder='#define CONFIG_MACOSX_FINDER 1' extra_ldflags="$extra_ldflags -framework Carbon" fi echores "$_macosx_finder" echocheck "Mac OS X Bundle file locations" def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE' test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder if test "$_macosx_bundle" = yes ; then def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1' extra_ldflags="$extra_ldflags -framework Carbon" fi echores "$_macosx_bundle" echocheck "Apple Remote" if test "$_apple_remote" = auto ; then _apple_remote=no cat > $TMPC < #include int main(void) { io_iterator_t hidObjectIterator = (io_iterator_t)NULL; CFMutableDictionaryRef hidMatchDictionary; IOReturn ioReturnValue; // Set up a matching dictionary to search the I/O Registry by class. // name for all HID class devices hidMatchDictionary = IOServiceMatching("AppleIRController"); // Now search I/O Registry for matching devices. ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault, hidMatchDictionary, &hidObjectIterator); // If search is unsuccessful, return nonzero. if (ioReturnValue != kIOReturnSuccess || !IOIteratorIsValid(hidObjectIterator)) { return 1; } return 0; } EOF cc_check -framework IOKit && tmp_run && _apple_remote=yes fi if test "$_apple_remote" = yes ; then def_apple_remote='#define CONFIG_APPLE_REMOTE 1' libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa" else def_apple_remote='#undef CONFIG_APPLE_REMOTE' fi echores "$_apple_remote" fi #if darwin if linux; then echocheck "Apple IR" if test "$_apple_ir" = auto ; then _apple_ir=no cat > $TMPC < #include int main(void) { struct input_event ev; struct input_id id; return 0; } EOF cc_check && _apple_ir=yes fi if test "$_apple_ir" = yes ; then def_apple_ir='#define CONFIG_APPLE_IR 1' else def_apple_ir='#undef CONFIG_APPLE_IR' fi echores "$_apple_ir" fi #if linux echocheck "pkg-config" _pkg_config=pkg-config if $($_pkg_config --version > /dev/null 2>&1); then if test "$_ld_static"; then _pkg_config="$_pkg_config --static" fi echores "yes" else _pkg_config=false echores "no" fi echocheck "Samba support (libsmbclient)" if test "$_smb" = yes; then extra_ldflags="$extra_ldflags -lsmbclient" fi if test "$_smb" = auto; then _smb=no cat > $TMPC << EOF #include int main(void) { smbc_opendir("smb://"); return 0; } EOF for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do cc_check $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" && \ _smb=yes && break done fi if test "$_smb" = yes; then def_smb="#define CONFIG_LIBSMBCLIENT 1" _inputmodules="smb $_inputmodules" else def_smb="#undef CONFIG_LIBSMBCLIENT" _noinputmodules="smb $_noinputmodules" fi echores "$_smb" ######### # VIDEO # ######### echocheck "tdfxfb" if test "$_tdfxfb" = yes ; then def_tdfxfb='#define CONFIG_TDFXFB 1' _vomodules="tdfxfb $_vomodules" else def_tdfxfb='#undef CONFIG_TDFXFB' _novomodules="tdfxfb $_novomodules" fi echores "$_tdfxfb" echocheck "s3fb" if test "$_s3fb" = yes ; then def_s3fb='#define CONFIG_S3FB 1' _vomodules="s3fb $_vomodules" else def_s3fb='#undef CONFIG_S3FB' _novomodules="s3fb $_novomodules" fi echores "$_s3fb" echocheck "wii" if test "$_wii" = yes ; then def_wii='#define CONFIG_WII 1' _vomodules="wii $_vomodules" else def_wii='#undef CONFIG_WII' _novomodules="wii $_novomodules" fi echores "$_wii" echocheck "tdfxvid" if test "$_tdfxvid" = yes ; then def_tdfxvid='#define CONFIG_TDFX_VID 1' _vomodules="tdfx_vid $_vomodules" else def_tdfxvid='#undef CONFIG_TDFX_VID' _novomodules="tdfx_vid $_novomodules" fi echores "$_tdfxvid" echocheck "xvr100" if test "$_xvr100" = auto ; then cat > $TMPC << EOF #include #include #include int main(void) { struct vis_identifier ident; struct fbgattr attr; ioctl(0, VIS_GETIDENTIFIER, &ident); ioctl(0, FBIOGATTR, &attr); return 0; } EOF _xvr100=no cc_check && _xvr100=yes fi if test "$_xvr100" = yes ; then def_xvr100='#define CONFIG_XVR100 1' _vomodules="xvr100 $_vomodules" else def_tdfxvid='#undef CONFIG_XVR100' _novomodules="xvr100 $_novomodules" fi echores "$_xvr100" echocheck "tga" if test "$_tga" = yes ; then def_tga='#define CONFIG_TGA 1' _vomodules="tga $_vomodules" else def_tga='#undef CONFIG_TGA' _novomodules="tga $_novomodules" fi echores "$_tga" echocheck "md5sum support" if test "$_md5sum" = yes; then def_md5sum="#define CONFIG_MD5SUM 1" _vomodules="md5sum $_vomodules" else def_md5sum="#undef CONFIG_MD5SUM" _novomodules="md5sum $_novomodules" fi echores "$_md5sum" echocheck "yuv4mpeg support" if test "$_yuv4mpeg" = yes; then def_yuv4mpeg="#define CONFIG_YUV4MPEG 1" _vomodules="yuv4mpeg $_vomodules" else def_yuv4mpeg="#undef CONFIG_YUV4MPEG" _novomodules="yuv4mpeg $_novomodules" fi echores "$_yuv4mpeg" echocheck "bl" if test "$_bl" = yes ; then def_bl='#define CONFIG_BL 1' _vomodules="bl $_vomodules" else def_bl='#undef CONFIG_BL' _novomodules="bl $_novomodules" fi echores "$_bl" echocheck "DirectFB" if test "$_directfb" = auto ; then _directfb=no cat > $TMPC < int main(void) { DirectFBInit(0, 0); return 0; } EOF for _inc_tmp in "" -I/usr/local/include/directfb \ -I/usr/include/directfb -I/usr/local/include; do cc_check $_inc_tmp -ldirectfb && _directfb=yes && \ extra_cflags="$extra_cflags $_inc_tmp" && break done fi dfb_version() { expr $1 \* 65536 + $2 \* 256 + $3 } if test "$_directfb" = yes; then cat > $TMPC << EOF #include int dfb_ver = DIRECTFB_MAJOR_VERSION.DIRECTFB_MINOR_VERSION.DIRECTFB_MICRO_VERSION ; EOF if $_cc -E $TMPC $extra_cflags > "$TMPEXE"; then _directfb_version=$(sed -n 's/^dfb_ver[^0-9]*\(.*\)/\1/p' "$TMPEXE" | tr -d '()') _dfb_major=$(echo $_directfb_version | cut -d . -f 1) _dfb_minor=$(echo $_directfb_version | cut -d . -f 2) _dfb_micro=$(echo $_directfb_version | cut -d . -f 3) _dfb_version=$(dfb_version $_dfb_major $_dfb_minor $_dfb_micro) if test "$_dfb_version" -ge $(dfb_version 0 9 13); then def_directfb_version="#define DIRECTFBVERSION $_dfb_version" _res_comment="$_directfb_version" test "$_dfb_version" -ge $(dfb_version 0 9 15) && _dfbmga=yes else def_directfb_version='#undef DIRECTFBVERSION' _directfb=no _res_comment="version >=0.9.13 required" fi else _directfb=no _res_comment="failed to get version" fi fi echores "$_directfb" if test "$_directfb" = yes ; then def_directfb='#define CONFIG_DIRECTFB 1' _vomodules="directfb $_vomodules" libs_mplayer="$libs_mplayer -ldirectfb" else def_directfb='#undef CONFIG_DIRECTFB' _novomodules="directfb $_novomodules" fi if test "$_dfbmga" = yes; then _vomodules="dfbmga $_vomodules" def_dfbmga='#define CONFIG_DFBMGA 1' else _novomodules="dfbmga $_novomodules" def_dfbmga='#undef CONFIG_DFBMGA' fi echocheck "X11 headers presence" _x11_headers="no" _res_comment="check if the dev(el) packages are installed" for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do if test -f "$I/X11/Xlib.h" ; then _x11_headers="yes" _res_comment="" break fi done if test $_cross_compile = no; then for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \ /usr/include/X11R6 /usr/openwin/include ; do if test -f "$I/X11/Xlib.h" ; then extra_cflags="$extra_cflags -I$I" _x11_headers="yes" _res_comment="using $I" break fi done fi echores "$_x11_headers" echocheck "X11" if test "$_x11" = auto && test "$_x11_headers" = yes ; then cat > $TMPC < #include int main(void) { (void) XCreateWindow(0,0,0,0,0,0,0,0,0,0,0,0); return 0; } EOF for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \ -L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \ -L/usr/lib ; do if netbsd; then _ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)" else _ld_tmp="$I -lXext -lX11 $_ld_pthread" fi cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" \ && _x11=yes && break done fi if test "$_x11" = yes ; then def_x11='#define CONFIG_X11 1' _vomodules="x11 xover $_vomodules" else _x11=no def_x11='#undef CONFIG_X11' _novomodules="x11 $_novomodules" _res_comment="check if the dev(el) packages are installed" # disable stuff that depends on X _xv=no ; _xvmc=no ; _xinerama=no ; _vm=no ; _xf86keysym=no ; _vdpau=no fi echores "$_x11" echocheck "Xss screensaver extensions" if test "$_xss" = auto ; then cat > $TMPC << EOF #include #include int main(void) { XScreenSaverSuspend(NULL, True); return 0; } EOF _xss=no cc_check -lXss && _xss=yes fi if test "$_xss" = yes ; then def_xss='#define CONFIG_XSS 1' libs_mplayer="$libs_mplayer -lXss" else def_xss='#undef CONFIG_XSS' fi echores "$_xss" echocheck "DPMS" _xdpms3=no _xdpms4=no if test "$_x11" = yes ; then cat > $TMPC < #include #include #include #include int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; } EOF cc_check -lXdpms && _xdpms3=yes cat > $TMPC < #include int main(void) { (void) DPMSQueryExtension(0, 0, 0); return 0; } EOF cc_check -lXext && _xdpms4=yes fi if test "$_xdpms4" = yes ; then def_xdpms='#define CONFIG_XDPMS 1' _res_comment="using Xdpms 4" echores "yes" elif test "$_xdpms3" = yes ; then def_xdpms='#define CONFIG_XDPMS 1' libs_mplayer="$libs_mplayer -lXdpms" _res_comment="using Xdpms 3" echores "yes" else def_xdpms='#undef CONFIG_XDPMS' echores "no" fi echocheck "Xv" if test "$_xv" = auto ; then cat > $TMPC < #include int main(void) { (void) XvGetPortAttribute(0, 0, 0, 0); (void) XvQueryPortAttributes(0, 0, 0); return 0; } EOF _xv=no cc_check -lXv && _xv=yes fi if test "$_xv" = yes ; then def_xv='#define CONFIG_XV 1' libs_mplayer="$libs_mplayer -lXv" _vomodules="xv $_vomodules" else def_xv='#undef CONFIG_XV' _novomodules="xv $_novomodules" fi echores "$_xv" echocheck "XvMC" if test "$_xv" = yes && test "$_xvmc" != no ; then _xvmc=no cat > $TMPC < #include #include int main(void) { (void) XvMCQueryExtension(0,0,0); (void) XvMCCreateContext(0,0,0,0,0,0,0); return 0; } EOF for _ld_tmp in $_xvmclib XvMCNVIDIA XvMCW I810XvMC ; do cc_check -lXvMC -l$_ld_tmp && _xvmc=yes && _xvmclib="$_ld_tmp" && break done fi if test "$_xvmc" = yes ; then def_xvmc='#define CONFIG_XVMC 1' libs_mplayer="$libs_mplayer -lXvMC -l$_xvmclib" _vomodules="xvmc $_vomodules" _res_comment="using $_xvmclib" else def_xvmc='#define CONFIG_XVMC 0' _novomodules="xvmc $_novomodules" _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER//) fi echores "$_xvmc" echocheck "VDPAU" if test "$_vdpau" = auto ; then _vdpau=no if test "$_dl" = yes ; then cat > $TMPC < int main(void) { (void) vdp_device_create_x11(0, 0, 0, 0); return VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1; } EOF cc_check -lvdpau && _vdpau=yes fi fi if test "$_vdpau" = yes ; then def_vdpau='#define CONFIG_VDPAU 1' libs_mplayer="$libs_mplayer -lvdpau" _vomodules="vdpau $_vomodules" else def_vdpau='#define CONFIG_VDPAU 0' _novomodules="vdpau $_novomodules" _libavdecoders=$(echo $_libavdecoders | sed -e s/MPEG_VDPAU_DECODER// -e s/MPEG1_VDPAU_DECODER// -e s/H264_VDPAU_DECODER// -e s/WMV3_VDPAU_DECODER// -e s/VC1_VDPAU_DECODER// -e s/MPEG4_VDPAU_DECODER//) fi echores "$_vdpau" echocheck "Xinerama" if test "$_xinerama" = auto ; then cat > $TMPC < #include int main(void) { (void) XineramaIsActive(0); return 0; } EOF _xinerama=no cc_check -lXinerama && _xinerama=yes fi if test "$_xinerama" = yes ; then def_xinerama='#define CONFIG_XINERAMA 1' libs_mplayer="$libs_mplayer -lXinerama" else def_xinerama='#undef CONFIG_XINERAMA' fi echores "$_xinerama" # Note: the -lXxf86vm library is the VideoMode extension and though it's not # needed for DGA, AFAIK every distribution packages together with DGA stuffs # named 'X extensions' or something similar. # This check may be useful for future mplayer versions (to change resolution) # If you run into problems, remove '-lXxf86vm'. echocheck "Xxf86vm" if test "$_vm" = auto ; then cat > $TMPC < #include int main(void) { (void) XF86VidModeQueryExtension(0, 0, 0); return 0; } EOF _vm=no cc_check -lXxf86vm && _vm=yes fi if test "$_vm" = yes ; then def_vm='#define CONFIG_XF86VM 1' libs_mplayer="$libs_mplayer -lXxf86vm" else def_vm='#undef CONFIG_XF86VM' fi echores "$_vm" # Check for the presence of special keycodes, like audio control buttons # that XFree86 might have. Used to be bundled with the xf86vm check, but # has nothing to do with xf86vm and XFree 3.x has xf86vm but does NOT # have these new keycodes. echocheck "XF86keysym" if test "$_xf86keysym" = auto; then _xf86keysym=no cat > $TMPC < #include int main(void) { return XF86XK_AudioPause; } EOF cc_check && _xf86keysym=yes fi if test "$_xf86keysym" = yes ; then def_xf86keysym='#define CONFIG_XF86XK 1' else def_xf86keysym='#undef CONFIG_XF86XK' fi echores "$_xf86keysym" echocheck "DGA" if test "$_dga2" = auto && test "$_x11" = yes ; then cat > $TMPC << EOF #include #include int main(void) { (void) XDGASetViewport(0, 0, 0, 0, 0); return 0; } EOF _dga2=no cc_check -lXxf86dga && _dga2=yes fi if test "$_dga1" = auto && test "$_dga2" = no && test "$_vm" = yes ; then cat > $TMPC << EOF #include #include int main(void) { (void) XF86DGASetViewPort(0, 0, 0, 0); return 0; } EOF _dga1=no cc_check -lXxf86dga -lXxf86vm && _dga1=yes fi _dga=no def_dga='#undef CONFIG_DGA' def_dga1='#undef CONFIG_DGA1' def_dga2='#undef CONFIG_DGA2' if test "$_dga1" = yes ; then _dga=yes def_dga1='#define CONFIG_DGA1 1' _res_comment="using DGA 1.0" elif test "$_dga2" = yes ; then _dga=yes def_dga2='#define CONFIG_DGA2 1' _res_comment="using DGA 2.0" fi if test "$_dga" = yes ; then def_dga='#define CONFIG_DGA 1' libs_mplayer="$libs_mplayer -lXxf86dga" _vomodules="dga $_vomodules" else _novomodules="dga $_novomodules" fi echores "$_dga" echocheck "3dfx" if test "$_3dfx" = yes && test "$_dga" = yes ; then def_3dfx='#define CONFIG_3DFX 1' _vomodules="3dfx $_vomodules" else def_3dfx='#undef CONFIG_3DFX' _novomodules="3dfx $_novomodules" fi echores "$_3dfx" echocheck "VIDIX" def_vidix='#undef CONFIG_VIDIX' def_vidix_drv_cyberblade='#undef CONFIG_VIDIX_DRV_CYBERBLADE' _vidix_drv_cyberblade=no def_vidix_drv_ivtv='#undef CONFIG_VIDIX_DRV_IVTV' _vidix_drv_ivtv=no def_vidix_drv_mach64='#undef CONFIG_VIDIX_DRV_MACH64' _vidix_drv_mach64=no def_vidix_drv_mga='#undef CONFIG_VIDIX_DRV_MGA' _vidix_drv_mga=no def_vidix_drv_mga_crtc2='#undef CONFIG_VIDIX_DRV_MGA_CRTC2' _vidix_drv_mga_crtc2=no def_vidix_drv_nvidia='#undef CONFIG_VIDIX_DRV_NVIDIA' _vidix_drv_nvidia=no def_vidix_drv_pm2='#undef CONFIG_VIDIX_DRV_PM2' _vidix_drv_pm2=no def_vidix_drv_pm3='#undef CONFIG_VIDIX_DRV_PM3' _vidix_drv_pm3=no def_vidix_drv_radeon='#undef CONFIG_VIDIX_DRV_RADEON' _vidix_drv_radeon=no def_vidix_drv_rage128='#undef CONFIG_VIDIX_DRV_RAGE128' _vidix_drv_rage128=no def_vidix_drv_s3='#undef CONFIG_VIDIX_DRV_S3' _vidix_drv_s3=no def_vidix_drv_sh_veu='#undef CONFIG_VIDIX_DRV_SH_VEU' _vidix_drv_sh_veu=no def_vidix_drv_sis='#undef CONFIG_VIDIX_DRV_SIS' _vidix_drv_sis=no def_vidix_drv_unichrome='#undef CONFIG_VIDIX_DRV_UNICHROME' _vidix_drv_unichrome=no if test "$_vidix" = auto ; then _vidix=no x86 && (linux || freebsd || netbsd || openbsd || dragonfly || sunos || win32) \ && _vidix=yes x86_64 && win32 && _vidix=no (ppc || alpha) && linux && _vidix=yes fi echores "$_vidix" if test "$_vidix" = yes ; then def_vidix='#define CONFIG_VIDIX 1' _vomodules="cvidix $_vomodules" # FIXME: ivtv driver temporarily disabled until we have a proper test #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" # some vidix drivers are architecture and os specific, discard them elsewhere x86 || _vidix_drivers=$(echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis// -e s/unichrome// -e s/s3//) (test $host_arch = "sh" && linux) || _vidix_drivers=$(echo $_vidix_drivers | sed s/sh_veu//) for driver in $_vidix_drivers ; do uc_driver=$(echo $driver | tr '[a-z]' '[A-Z]') eval _vidix_drv_${driver}=yes eval def_vidix_drv_${driver}=\"\#define CONFIG_VIDIX_DRV_${uc_driver} 1\" done echocheck "VIDIX PCI device name database" echores "$_vidix_pcidb" if test "$_vidix_pcidb" = yes ; then _vidix_pcidb_val=1 else _vidix_pcidb_val=0 fi echocheck "VIDIX dhahelper support" test "$_dhahelper" = yes && cflags_dhahelper=-DCONFIG_DHAHELPER echores "$_dhahelper" echocheck "VIDIX svgalib_helper support" test "$_svgalib_helper" = yes && cflags_svgalib_helper=-DCONFIG_SVGAHELPER echores "$_svgalib_helper" else _novomodules="cvidix $_novomodules" fi if test "$_vidix" = yes && win32; then winvidix=yes _vomodules="winvidix $_vomodules" libs_mplayer="$libs_mplayer -lgdi32" else _novomodules="winvidix $_novomodules" fi if test "$_vidix" = yes && test "$_x11" = yes; then xvidix=yes _vomodules="xvidix $_vomodules" else _novomodules="xvidix $_novomodules" fi echocheck "/dev/mga_vid" if test "$_mga" = auto ; then _mga=no test -c /dev/mga_vid && _mga=yes fi if test "$_mga" = yes ; then def_mga='#define CONFIG_MGA 1' _vomodules="mga $_vomodules" else def_mga='#undef CONFIG_MGA' _novomodules="mga $_novomodules" fi echores "$_mga" echocheck "xmga" if test "$_xmga" = auto ; then _xmga=no test "$_x11" = yes && test "$_mga" = yes && _xmga=yes fi if test "$_xmga" = yes ; then def_xmga='#define CONFIG_XMGA 1' _vomodules="xmga $_vomodules" else def_xmga='#undef CONFIG_XMGA' _novomodules="xmga $_novomodules" fi echores "$_xmga" echocheck "GGI" if test "$_ggi" = auto ; then cat > $TMPC << EOF #include int main(void) { ggiInit(); return 0; } EOF _ggi=no cc_check -lggi && _ggi=yes fi if test "$_ggi" = yes ; then def_ggi='#define CONFIG_GGI 1' libs_mplayer="$libs_mplayer -lggi" _vomodules="ggi $_vomodules" else def_ggi='#undef CONFIG_GGI' _novomodules="ggi $_novomodules" fi echores "$_ggi" echocheck "GGI extension: libggiwmh" if test "$_ggiwmh" = auto ; then _ggiwmh=no cat > $TMPC << EOF #include #include int main(void) { ggiInit(); ggiWmhInit(); return 0; } EOF cc_check -lggi -lggiwmh && _ggiwmh=yes fi # needed to get right output on obscure combination # like --disable-ggi --enable-ggiwmh if test "$_ggi" = yes && test "$_ggiwmh" = yes ; then def_ggiwmh='#define CONFIG_GGIWMH 1' libs_mplayer="$libs_mplayer -lggiwmh" else _ggiwmh=no def_ggiwmh='#undef CONFIG_GGIWMH' fi echores "$_ggiwmh" echocheck "AA" if test "$_aa" = auto ; then cat > $TMPC << EOF #include extern struct aa_hardware_params aa_defparams; extern struct aa_renderparams aa_defrenderparams; int main(void) { aa_context *c; aa_renderparams *p; (void) aa_init(0, 0, 0); c = aa_autoinit(&aa_defparams); p = aa_getrenderparams(); aa_autoinitkbd(c,0); return 0; } EOF _aa=no for _ld_tmp in "-laa" ; do cc_check $_ld_tmp && libs_mplayer="$libs_mplayer $_ld_tmp" && _aa=yes && break done fi if test "$_aa" = yes ; then def_aa='#define CONFIG_AA 1' if cygwin ; then libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)" fi _vomodules="aa $_vomodules" else def_aa='#undef CONFIG_AA' _novomodules="aa $_novomodules" fi echores "$_aa" echocheck "CACA" if test "$_caca" = auto ; then _caca=no if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then cat > $TMPC << EOF #include #ifdef CACA_API_VERSION_1 #include #endif int main(void) { (void) caca_init(); return 0; } EOF cc_check $(caca-config --libs) && _caca=yes fi fi if test "$_caca" = yes ; then def_caca='#define CONFIG_CACA 1' extra_cflags="$extra_cflags $(caca-config --cflags)" libs_mplayer="$libs_mplayer $(caca-config --libs)" _vomodules="caca $_vomodules" else def_caca='#undef CONFIG_CACA' _novomodules="caca $_novomodules" fi echores "$_caca" echocheck "SVGAlib" if test "$_svga" = auto ; then cat > $TMPC << EOF #include int main(void) { return 0; } EOF _svga=no cc_check -lvga $_ld_lm && _svga=yes fi if test "$_svga" = yes ; then def_svga='#define CONFIG_SVGALIB 1' libs_mplayer="$libs_mplayer -lvga" _vomodules="svga $_vomodules" else def_svga='#undef CONFIG_SVGALIB' _novomodules="svga $_novomodules" fi echores "$_svga" echocheck "FBDev" if test "$_fbdev" = auto ; then _fbdev=no linux && _fbdev=yes fi if test "$_fbdev" = yes ; then def_fbdev='#define CONFIG_FBDEV 1' _vomodules="fbdev $_vomodules" else def_fbdev='#undef CONFIG_FBDEV' _novomodules="fbdev $_novomodules" fi echores "$_fbdev" echocheck "DVB" if test "$_dvb" = auto ; then _dvb=no cat >$TMPC << EOF #include #include #include #include #include #include #include #include #include #include int main(void) {return 0;} EOF for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do cc_check $_inc_tmp && _dvb=yes && \ extra_cflags="$extra_cflags $_inc_tmp" && break done fi echores "$_dvb" if test "$_dvb" = yes ; then def_dvb='#define CONFIG_DVB 1' def_dvbin='#define CONFIG_DVBIN 1' _aomodules="mpegpes(dvb) $_aomodules" _vomodules="mpegpes(dvb) $_vomodules" fi echocheck "DVB HEAD" if test "$_dvbhead" = auto ; then _dvbhead=no cat >$TMPC << EOF #include #include #include #include #include #include #include #include #include int main(void) {return 0;} EOF for _inc_tmp in "" "-I/usr/src/DVB/include" ; do cc_check $_inc_tmp && _dvbhead=yes && \ extra_cflags="$extra_cflags $_inc_tmp" && break done fi echores "$_dvbhead" if test "$_dvbhead" = yes ; then def_dvb='#define CONFIG_DVB 1' def_dvb_head='#define CONFIG_DVB_HEAD 1' def_dvbin='#define CONFIG_DVBIN 1' _aomodules="mpegpes(dvb) $_aomodules" _vomodules="mpegpes(dvb) $_vomodules" fi if test "$_dvbhead" = no && test "$_dvb" = no ; then def_dvb='#undef CONFIG_DVB' def_dvb_head='#undef CONFIG_DVB_HEAD' def_dvbin='#undef CONFIG_DVBIN ' _aomodules="mpegpes(file) $_aomodules" _vomodules="mpegpes(file) $_vomodules" fi if test "$_dvb" = yes || test "$_dvbhead" = yes ; then _dvbin=yes _inputmodules="dvb $_inputmodules" else _dvbin=no _noinputmodules="dvb $_noinputmodules" fi if darwin; then echocheck "QuickTime" if test "$quicktime" = auto ; then cat > $TMPC < int main(void) { ImageDescription *desc; EnterMovies(); ExitMovies(); return 0; } EOF quicktime=no cc_check -framework QuickTime && quicktime=yes fi if test "$quicktime" = yes ; then extra_ldflags="$extra_ldflags -framework QuickTime" def_quicktime='#define CONFIG_QUICKTIME 1' else def_quicktime='#undef CONFIG_QUICKTIME' _quartz=no fi echores $quicktime echocheck "Quartz" if test "$_quartz" = auto ; then cat > $TMPC < int main(void) { CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false); return 0; } EOF _quartz=no cc_check -framework Carbon && _quartz=yes fi if test "$_quartz" = yes ; then libs_mplayer="$libs_mplayer -framework Carbon" def_quartz='#define CONFIG_QUARTZ 1' _vomodules="quartz $_vomodules" else def_quartz='#undef CONFIG_QUARTZ' _novomodules="quartz $_novomodules" fi echores $_quartz echocheck "CoreVideo" if test "$_corevideo" = auto ; then cat > $TMPC < #include #include #include int main(void) { return 0; } EOF _corevideo=no cc_check -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes fi if test "$_corevideo" = yes ; then _vomodules="corevideo $_vomodules" libs_mplayer="$libs_mplayer -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL" def_corevideo='#define CONFIG_COREVIDEO 1' else _novomodules="corevideo $_novomodules" def_corevideo='#undef CONFIG_COREVIDEO' fi echores "$_corevideo" fi #if darwin # make sure this stays below CoreVideo to avoid issues due to namespace # conflicts between -lGL and -framework OpenGL echocheck "OpenGL" #Note: this test is run even with --enable-gl since we autodetect linker flags if (test "$_x11" = yes || win32) && test "$_gl" != no ; then cat > $TMPC << EOF #ifdef GL_WIN32 #include #include #else #include #include #include #endif int main(void) { #ifdef GL_WIN32 HDC dc; wglCreateContext(dc); #else glXCreateContext(NULL, NULL, NULL, True); #endif glFinish(); return 0; } EOF _gl=no for _ld_tmp in -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do if cc_check $_ld_tmp $_ld_lm ; then _gl=yes _gl_x11=yes libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl" break fi done if cc_check -DGL_WIN32 -lopengl32 ; then _gl=yes _gl_win32=yes libs_mplayer="$libs_mplayer -lopengl32 -lgdi32" fi else _gl=no fi if test "$_gl" = yes ; then def_gl='#define CONFIG_GL 1' _res_comment="backends:" if test "$_gl_win32" = yes ; then def_gl_win32='#define CONFIG_GL_WIN32 1' _res_comment="$_res_comment win32" fi if test "$_gl_x11" = yes ; then def_gl_x11='#define CONFIG_GL_X11 1' _res_comment="$_res_comment x11" fi _vomodules="opengl $_vomodules" else def_gl='#undef CONFIG_GL' def_gl_win32='#undef CONFIG_GL_WIN32' def_gl_x11='#undef CONFIG_GL_X11' _novomodules="opengl $_novomodules" fi echores "$_gl" echocheck "MatrixView" if test "$_gl" = no ; then matrixview=no fi if test "$matrixview" = yes ; then _vomodules="matrixview $_vomodules" def_matrixview='#define CONFIG_MATRIXVIEW 1' else _novomodules="matrixview $_novomodules" def_matrixview='#undef CONFIG_MATRIXVIEW' fi echores "$matrixview" echocheck "PNG support" if test "$_png" = auto ; then _png=no if irix ; then # Don't check for -lpng on irix since it has its own libpng # incompatible with the GNU libpng _res_comment="disabled on irix (not GNU libpng)" else cat > $TMPC << EOF #include #include int main(void) { printf("png.h : %s\n", PNG_LIBPNG_VER_STRING); printf("libpng: %s\n", png_libpng_ver); return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver); } EOF cc_check -lpng -lz $_ld_lm && _png=yes fi fi echores "$_png" if test "$_png" = yes ; then def_png='#define CONFIG_PNG 1' extra_ldflags="$extra_ldflags -lpng -lz" else def_png='#undef CONFIG_PNG' fi echocheck "MNG support" if test "$_mng" = auto ; then _mng=no cat > $TMPC << EOF #include int main(void) { const char * p_ver = mng_version_text(); return !p_ver || p_ver[0] == 0; } EOF if cc_check -lmng -lz $_ld_lm ; then _mng=yes fi fi echores "$_mng" if test "$_mng" = yes ; then def_mng='#define CONFIG_MNG 1' extra_ldflags="$extra_ldflags -lmng -lz" else def_mng='#undef CONFIG_MNG' fi echocheck "JPEG support" if test "$_jpeg" = auto ; then _jpeg=no cat > $TMPC << EOF #include #include #include #include #include int main(void) { return 0; } EOF cc_check -ljpeg $_ld_lm && _jpeg=yes fi echores "$_jpeg" if test "$_jpeg" = yes ; then def_jpeg='#define CONFIG_JPEG 1' _vomodules="jpeg $_vomodules" extra_ldflags="$extra_ldflags -ljpeg" else def_jpeg='#undef CONFIG_JPEG' _novomodules="jpeg $_novomodules" fi echocheck "OpenJPEG (JPEG2000) support" if test "$libopenjpeg" = auto ; then libopenjpeg=no cat > $TMPC << EOF #define OPJ_STATIC #include int main(void) { opj_dparameters_t dec_params; opj_set_default_decoder_parameters(&dec_params); return 0; } EOF cc_check -lopenjpeg $_ld_lm && libopenjpeg=yes fi echores "$libopenjpeg" if test "$libopenjpeg" = yes ; then def_libopenjpeg='#define CONFIG_LIBOPENJPEG 1' extra_ldflags="$extra_ldflags -lopenjpeg" _libavdecoders="$_libavdecoders LIBOPENJPEG_DECODER" _libavencoders="$_libavencoders LIBOPENJPEG_ENCODER" _codecmodules="OpenJPEG $_codecmodules" else def_libopenjpeg='#define CONFIG_LIBOPENJPEG 0' _nocodecmodules="OpenJPEG $_nocodecmodules" fi echocheck "PNM support" if test "$_pnm" = yes; then def_pnm="#define CONFIG_PNM 1" _vomodules="pnm $_vomodules" else def_pnm="#undef CONFIG_PNM" _novomodules="pnm $_novomodules" fi echores "$_pnm" echocheck "GIF support" # This is to appease people who want to force gif support. # If it is forced to yes, then we still do checks to determine # which gif library to use. if test "$_gif" = yes ; then _force_gif=yes _gif=auto fi if test "$_gif" = auto ; then _gif=no cat > $TMPC << EOF #include int main(void) { return 0; } EOF for _ld_gif in "-lungif" "-lgif" ; do cc_check $_ld_gif && _gif=yes && break done fi # If no library was found, and the user wants support forced, # then we force it on with libgif, as this is the safest # assumption IMHO. (libungif & libregif both create symbolic # links to libgif. We also assume that no x11 support is needed, # because if you are forcing this, then you _should_ know what # you are doing. [ Besides, package maintainers should never # have compiled x11 deps into libungif in the first place. ] ) # # --Joey if test "$_force_gif" = yes && test "$_gif" = no ; then _gif=yes _ld_gif="-lgif" fi if test "$_gif" = yes ; then def_gif='#define CONFIG_GIF 1' _codecmodules="gif $_codecmodules" _vomodules="gif89a $_vomodules" _res_comment="old version, some encoding functions disabled" def_gif_4='#undef CONFIG_GIF_4' extra_ldflags="$extra_ldflags $_ld_gif" cat > $TMPC << EOF #include #include void catch() { exit(1); } int main(void) { signal(SIGSEGV, catch); // catch segfault printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst); EGifSetGifVersion("89a"); // this will segfault a buggy gif lib. return 0; } EOF if cc_check "$_ld_gif" ; then def_gif_4='#define CONFIG_GIF_4 1' _res_comment="" fi else def_gif='#undef CONFIG_GIF' def_gif_4='#undef CONFIG_GIF_4' _novomodules="gif89a $_novomodules" _nocodecmodules="gif $_nocodecmodules" fi echores "$_gif" case "$_gif" in yes*) echocheck "broken giflib workaround" def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1' cat > $TMPC << EOF #include int main(void) { GifFileType gif; printf("UserData is at address %p\n", gif.UserData); return 0; } EOF if cc_check "$_ld_gif" ; then def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK' echores "disabled" else echores "enabled" fi ;; esac echocheck "VESA support" if test "$_vesa" = auto ; then cat > $TMPC << EOF #include int main(void) { vbeVersion(); return 0; } EOF _vesa=no cc_check -lvbe -llrmi && _vesa=yes fi if test "$_vesa" = yes ; then def_vesa='#define CONFIG_VESA 1' libs_mplayer="$libs_mplayer -lvbe -llrmi" _vomodules="vesa $_vomodules" else def_vesa='#undef CONFIG_VESA' _novomodules="vesa $_novomodules" fi echores "$_vesa" ################# # VIDEO + AUDIO # ################# echocheck "SDL" _inc_tmp="" _ld_tmp="" def_sdl_sdl_h="#undef CONFIG_SDL_SDL_H" if test -z "$_sdlconfig" ; then if ( sdl-config --version ) >>"$TMPLOG" 2>&1 ; then _sdlconfig="sdl-config" elif ( sdl11-config --version ) >>"$TMPLOG" 2>&1 ; then _sdlconfig="sdl11-config" else _sdlconfig=false fi fi if test "$_sdl" = auto || test "$_sdl" = yes ; then cat > $TMPC << EOF #ifdef CONFIG_SDL_SDL_H #include #else #include #endif #ifndef __APPLE__ // we allow SDL hacking our main() only on OSX #undef main #endif int main(int argc, char *argv[]) { SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE); return 0; } EOF _sdl=no for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" ; do if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then _sdl=yes def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1" break fi done if test "$_sdl" = no && "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then _res_comment="using $_sdlconfig" if cygwin ; then _inc_tmp="$($_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed s/no-cygwin/cygwin/)" _ld_tmp="$($_sdlconfig --libs | cut -d " " -f 1,4,6 | sed s/no-cygwin/cygwin/)" elif mingw32 ; then _inc_tmp=$($_sdlconfig --cflags | sed s/-Dmain=SDL_main//) _ld_tmp=$($_sdlconfig --libs | sed -e s/-mwindows// -e s/-lmingw32//) else _inc_tmp="$($_sdlconfig --cflags)" _ld_tmp="$($_sdlconfig --libs)" fi if cc_check $_inc_tmp $_ld_tmp >>"$TMPLOG" 2>&1 ; then _sdlversion=$($_sdlconfig --version | sed 's/[^0-9]//g') if test "$_sdlversion" -gt 116 ; then if test "$_sdlversion" -lt 121 ; then def_sdlbuggy='#define BUGGY_SDL' else def_sdlbuggy='#undef BUGGY_SDL' fi _sdl=yes fi fi fi fi if test "$_sdl" = yes ; then def_sdl='#define CONFIG_SDL 1' extra_cflags="$extra_cflags $_inc_tmp" libs_mplayer="$libs_mplayer $_ld_tmp" _vomodules="sdl $_vomodules" _aomodules="sdl $_aomodules" else def_sdl='#undef CONFIG_SDL' _novomodules="sdl $_novomodules" _noaomodules="sdl $_noaomodules" fi echores "$_sdl" if os2 ; then echocheck "KVA (SNAP/WarpOverlay!/DIVE)" if test "$_kva" = auto; then cat > $TMPC << EOF #include #include int main( void ) { return 0; } EOF _kva=no; cc_check -lkva && _kva=yes fi if test "$_kva" = yes ; then def_kva='#define CONFIG_KVA 1' libs_mplayer="$libs_mplayer -lkva" _vomodules="kva $_vomodules" else def_kva='#undef CONFIG_KVA' _novomodules="kva $_novomodules" fi echores "$_kva" fi #if os2 if win32; then echocheck "Windows waveout" if test "$_win32waveout" = auto ; then cat > $TMPC << EOF #include #include int main(void) { return 0; } EOF _win32waveout=no cc_check -lwinmm && _win32waveout=yes fi if test "$_win32waveout" = yes ; then def_win32waveout='#define CONFIG_WIN32WAVEOUT 1' libs_mplayer="$libs_mplayer -lwinmm" _aomodules="win32 $_aomodules" else def_win32waveout='#undef CONFIG_WIN32WAVEOUT' _noaomodules="win32 $_noaomodules" fi echores "$_win32waveout" echocheck "Direct3D" if test "$_direct3d" = auto ; then cat > $TMPC << EOF #include #include int main(void) { return 0; } EOF _direct3d=no cc_check && _direct3d=yes fi if test "$_direct3d" = yes ; then def_direct3d='#define CONFIG_DIRECT3D 1' _vomodules="direct3d $_vomodules" else def_direct3d='#undef CONFIG_DIRECT3D' _novomodules="direct3d $_novomodules" fi echores "$_direct3d" echocheck "Directx" if test "$_directx" = auto ; then cat > $TMPC << EOF #include #include #include int main(void) { return 0; } EOF _directx=no cc_check -lgdi32 && _directx=yes fi if test "$_directx" = yes ; then def_directx='#define CONFIG_DIRECTX 1' libs_mplayer="$libs_mplayer -lgdi32" _vomodules="directx $_vomodules" _aomodules="dsound $_aomodules" else def_directx='#undef CONFIG_DIRECTX' _novomodules="directx $_novomodules" _noaomodules="dsound $_noaomodules" fi echores "$_directx" fi #if win32; then echocheck "DXR2" if test "$_dxr2" = auto; then _dxr2=no cat > $TMPC << EOF #include int main(void) { return 0; } EOF for _inc_tmp in "" -I/usr/local/include/dxr2 -I/usr/include/dxr2; do cc_check $_inc_tmp && _dxr2=yes && \ extra_cflags="$extra_cflags $_inc_tmp" && break done fi if test "$_dxr2" = yes; then def_dxr2='#define CONFIG_DXR2 1' _aomodules="dxr2 $_aomodules" _vomodules="dxr2 $_vomodules" else def_dxr2='#undef CONFIG_DXR2' _noaomodules="dxr2 $_noaomodules" _novomodules="dxr2 $_novomodules" fi echores "$_dxr2" echocheck "DXR3/H+" if test "$_dxr3" = auto ; then cat > $TMPC << EOF #include int main(void) { return 0; } EOF _dxr3=no cc_check && _dxr3=yes fi if test "$_dxr3" = yes ; then def_dxr3='#define CONFIG_DXR3 1' _vomodules="dxr3 $_vomodules" else def_dxr3='#undef CONFIG_DXR3' _novomodules="dxr3 $_novomodules" fi echores "$_dxr3" echocheck "IVTV TV-Out (pre linux-2.6.24)" if test "$_ivtv" = auto ; then cat > $TMPC << EOF #include #include #include #include #include #include int main(void) { struct ivtv_cfg_stop_decode sd; struct ivtv_cfg_start_decode sd1; ioctl(0, IVTV_IOC_START_DECODE, &sd1); ioctl(0, IVTV_IOC_STOP_DECODE, &sd); return 0; } EOF _ivtv=no cc_check && _ivtv=yes fi if test "$_ivtv" = yes ; then def_ivtv='#define CONFIG_IVTV 1' _vomodules="ivtv $_vomodules" _aomodules="ivtv $_aomodules" else def_ivtv='#undef CONFIG_IVTV' _novomodules="ivtv $_novomodules" _noaomodules="ivtv $_noaomodules" fi echores "$_ivtv" echocheck "V4L2 MPEG Decoder" if test "$_v4l2" = auto ; then cat > $TMPC << EOF #include #include #include #include #include int main(void) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) #error kernel headers too old, need 2.6.22 #endif struct v4l2_ext_controls ctrls; ctrls.ctrl_class = V4L2_CTRL_CLASS_MPEG; return 0; } EOF _v4l2=no cc_check && _v4l2=yes fi if test "$_v4l2" = yes ; then def_v4l2='#define CONFIG_V4L2_DECODER 1' _vomodules="v4l2 $_vomodules" _aomodules="v4l2 $_aomodules" else def_v4l2='#undef CONFIG_V4L2_DECODER' _novomodules="v4l2 $_novomodules" _noaomodules="v4l2 $_noaomodules" fi echores "$_v4l2" ######### # AUDIO # ######### echocheck "OSS Audio" if test "$_ossaudio" = auto ; then cat > $TMPC << EOF #include #include <$_soundcard_header> int main(void) { int arg = SNDCTL_DSP_SETFRAGMENT; return 0; } EOF _ossaudio=no cc_check && _ossaudio=yes fi if test "$_ossaudio" = yes ; then def_ossaudio='#define CONFIG_OSS_AUDIO 1' _aomodules="oss $_aomodules" if test "$_linux_devfs" = yes; then def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound/dsp"' def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/sound/mixer"' else cat > $TMPC << EOF #include #include <$_soundcard_header> #ifdef OPEN_SOUND_SYSTEM int main(void) { return 0; } #else #error Not the real thing #endif EOF _real_ossaudio=no cc_check && _real_ossaudio=yes if test "$_real_ossaudio" = yes; then def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"' elif netbsd || openbsd ; then def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"' extra_ldflags="$extra_ldflags -lossaudio" else def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"' fi def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"' fi else def_ossaudio='#undef CONFIG_OSS_AUDIO' def_ossaudio_devdsp='#define PATH_DEV_DSP ""' def_ossaudio_devmixer='#define PATH_DEV_MIXER ""' _noaomodules="oss $_noaomodules" fi echores "$_ossaudio" echocheck "aRts" if test "$_arts" = auto ; then _arts=no if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then cat > $TMPC << EOF #include int main(void) { return 0; } EOF cc_check $(artsc-config --libs) $(artsc-config --cflags) && _arts=yes fi fi if test "$_arts" = yes ; then def_arts='#define CONFIG_ARTS 1' _aomodules="arts $_aomodules" libs_mplayer="$libs_mplayer $(artsc-config --libs)" extra_cflags="$extra_cflags $(artsc-config --cflags)" else _noaomodules="arts $_noaomodules" fi echores "$_arts" echocheck "EsounD" if test "$_esd" = auto ; then _esd=no if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then cat > $TMPC << EOF #include int main(void) { int fd = esd_open_sound("test"); return fd; } EOF cc_check $(esd-config --libs) $(esd-config --cflags) && _esd=yes fi fi echores "$_esd" if test "$_esd" = yes ; then def_esd='#define CONFIG_ESD 1' _aomodules="esd $_aomodules" libs_mplayer="$libs_mplayer $(esd-config --libs)" extra_cflags="$extra_cflags $(esd-config --cflags)" echocheck "esd_get_latency()" cat > $TMPC << EOF #include int main(void) { return esd_get_latency(0); } EOF cc_check $(esd-config --libs) $(esd-config --cflags) && _esd_latency=yes && def_esd_latency='#define CONFIG_ESD_LATENCY 1' echores "$_esd_latency" else def_esd='#undef CONFIG_ESD' def_esd_latency='#undef CONFIG_ESD_LATENCY' _noaomodules="esd $_noaomodules" fi echocheck "NAS" if test "$_nas" = auto ; then cat > $TMPC << EOF #include