/bin/sh
#
# Original version (C) 2000 Pontscho/fresh!mindworkz
# pontscho@makacs.poliod.hu
#
# History / Contributors: check the cvs 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 "$_feature" = auto; then
# cat > $TMPC << EOF
# #include <feature.h>
# int main(void) { return 0; }
# EOF
# _feature=no
# cc_check && _feature=yes
# if test "$_feature" = yes ; then
# _def_feature='#define HAVE_FEATURE 1'
# else
# _def_feature='#undef HAVE_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
#
#############################################################################
cc_check() {
compile_check $TMPC $@
}
cxx_check() {
compile_check $TMPCPP $@ -lstdc++
}
tmp_run() {
"$TMPEXE" >> "$TMPLOG" 2>&1
}
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|powerpc) 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
}
sh3() {
case "$host_arch" in
sh3) return 0;;
*) return 1;;
esac
}
# not boolean test: implement the posix shell "!" operator for a
# non-posix /bin/sh.
# usage: not {command}
# returns exit status "success" when the execution of "command"
# fails.
not() {
eval "$@"
test $? -ne 0
}
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]
--enable-largefiles enable support for files > 2GB [disable]
--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]
--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-tv-teletext disable TV teletext 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 enable winsock2 [autodetect]
--enable-smb enable Samba (SMB) input [autodetect]
--enable-live enable LIVE555 Streaming Media [autodetect]
--enable-nemesi enable Nemesi Streaming Media [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-unrarlib disable Unique RAR File Library [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-macosx disable Mac OS X specific features [autodetect]
--disable-maemo disable maemo specific features [autodetect]
--enable-macosx-finder-support 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 disable internal 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-jpeg enable JPEG input/output support [autodetect]
--enable-libcdio enable external libcdio [autodetect]
--enable-liblzo enable external liblzo [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-x264 disable x264 [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-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-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-external enable external Tremor [autodetect]
--disable-libvorbis disable libvorbis support [autodetect]
--disable-speex disable Speex support [autodetect]
--enable-theora enable OggTheora libraries [autodetect]
--enable-faad-external 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-ladspa disable LADSPA plugin support [autodetect]
--disable-libdv disable libdv 0.9.5 en/decoding support [autodetect]
--disable-mad disable libmad (MPEG audio) support [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 [enabled]
--disable-liba52 disable builtin liba52 [enabled]
--disable-libmpeg2 disable builtin libmpeg2 [enabled]
--disable-musepack disable musepack support [autodetect]
--disable-libamr_nb disable libamr narrowband [autodetect]
--disable-libamr_wb disable libamr wideband [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-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-internal disable internal VIDIX [for x86 *nix]
--disable-vidix-external disable external 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,savage,sis,unichrome
--enable-gl enable OpenGL 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-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-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-vm enable XF86VidMode support [autodetect]
--enable-xinerama enable Xinerama support [autodetect]
--enable-x11 enable X11 video output [autodetect]
--enable-xshape enable XShape support [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-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]
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-polyp disable Polypaudio 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-win32waveout disable Windows waveout audio output [autodetect]
--disable-select disable using select() on the audio device [enable]
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]
--ar=AR librarian to build MPlayer [ar]
--ranlib=RANLIB ranlib to build MPlayer [ranlib]
--target=PLATFORM target platform (i386-linux, arm-linux, etc)
--enable-static build a statically linked binary
--charset=charset convert the console messages to this character set
--language=list a white space or comma separated list of languages for
translated man pages, the first language is used for
messages and the GUI (the environment variable
\$LINGUAS is also honored) [en]
(Available: $LANGUAGES all)
--with-install=PATH path to a custom install program
--enable-color-console enable color console output (UNSUPPORTED) [disable]
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-iwmmxt enable iWMMXt (ARM) [autodetect]
--disable-fastmemcpy disable 3DNow!/SSE/MMX optimized memcpy [enable]
--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 (Options marked with (*) accept
multiple paths separated by ':'):
--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-extraincdir=DIR extra header search paths in DIR (*)
--with-extralibdir=DIR extra linker search paths in DIR (*)
--with-xvmclib=NAME adapter-specific library name (e.g. XvMCNVIDIA)
# 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
_iwmmxt=auto
_mtrr=auto
_altivec=auto
_install=ginstall
_ranlib=ranlib
_ldconfig=ldconfig
_cc=cc
_ar=ar
test "$CC" && _cc="$CC"
_gcc_check=yes
_as=auto
_runtime_cpudetection=no
_cross_compile=auto
_prefix="/usr/local"
_libavutil_a=auto
_libavutil_so=auto
_libavcodec_a=auto
_libamr_nb=auto
_libamr_wb=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/LIBFAAD_DECODER// -e
s/MPEG4AAC_DECODER// -e s/LIBA52_DECODER// -e s/LIBGSM_DECODER// -e
s/LIBGSM_MS_DECODER// -e s/LIBVORBIS_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/LIBGSM_ENCODER// -e
s/LIBGSM_MS_ENCODER// -e s/LIBTHEORA_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/AUDIO_BEOS_DEMUXER// -e
s/OSS_DEMUXER// -e s/DC1394_DEMUXER// -e s/DV1394_DEMUXER// -e s/REDIR_DEMUXER//
-e s/RTSP_DEMUXER// -e s/SDP_DEMUXER// -e s/V4L_DEMUXER// -e s/BKTR_DEMUXER// -e
s/X11_GRAB_DEVICE_DEMUXER// -e s/V4L2_DEMUXER// -e s/LIBNUT_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/AUDIO_BEOS_MUXER// -e
s/OSS_MUXER// -e s/RTP_MUXER// `
_libavprotocols_all=`sed -n 's/^[^#]*PROTOCOL.*(.*, *\(.*\)).*/\1_protocol/p'
libavformat/allformats.c | tr '[a-z]' '[A-Z]'`
_libavcodec_so=auto
_libavformat_a=auto
_libavformat_so=auto
_libpostproc_a=auto
_libpostproc_so=auto
_libavcodec_mpegaudio_hp=yes
_mencoder=yes
_mplayer=yes
_x11=auto
_xshape=auto
_dga1=auto
_dga2=auto
_xv=auto
_xvmc=no #auto when complete
_sdl=auto
_directx=auto
_win32waveout=auto
_nas=auto
_png=auto
_jpeg=auto
_pnm=yes
_md5sum=yes
_gif=auto
_gl=auto
_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
_polyp=auto
_jack=auto
_openal=auto
_libcdio=auto
_liblzo=auto
_mad=auto
_toolame=auto
_twolame=auto
_tremor_internal=yes
_tremor_low=no
_tremor_external=auto
_libvorbis=auto
_speex=auto
_theora=auto
_mp3lib=yes
_liba52=yes
_libdca=auto
_libmpeg2=yes
_faad_internal=auto
_faad_external=auto
_faad_fixed=no
_faac=auto
_ladspa=auto
_xmms=no
_dvdnav=auto
_dvdnavconfig=dvdnav-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
_unrarlib=yes
_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_teletext=auto
_pvr=auto
_network=yes
_winsock2=auto
_smbsupport=auto
_vidix_internal=auto
_vidix_external=auto
_joystick=no
_xvid=auto
_x264=auto
_libnut=auto
_lirc=auto
_lircc=auto
_apple_remote=auto
_gui=no
_gtk1=no
_termcap=auto
_termios=auto
_3dfx=no
_s3fb=no
_tdfxfb=no
_tdfxvid=no
_xvr100=auto
_tga=yes
_directfb=auto
_zr=auto
_bl=no
_largefiles=no
#_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
_macosx=auto
_maemo=auto
_macosx_finder_support=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
_rpath=no
_asmalign_pot=auto
_color_console=no
_stream_cache=yes
_def_stream_cache="#define USE_STREAM_CACHE 1"
_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-extraincdir=*)
_inc_extra=-I`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -I,g'`
;;
--with-extralibdir=*)
_ld_extra=-L`echo $ac_option | cut -d '=' -f 2 | sed 's,:, -L,g'`
;;
--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`
;;
--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`
;;
--ar=*)
_ar=`echo $ac_option | cut -d '=' -f 2`
;;
--ranlib=*)
_ranlib=`echo $ac_option | cut -d '=' -f 2`
;;
--charset=*)
_charset=`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-gcc-check) _gcc_check=yes ;;
--disable-gcc-check) _gcc_check=no ;;
--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-xv) _xv=yes ;;
--disable-xv) _xv=no ;;
--enable-xvmc) _xvmc=yes ;;
--disable-xvmc) _xvmc=no ;;
--enable-sdl) _sdl=yes ;;
--disable-sdl) _sdl=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-jpeg) _jpeg=yes ;;
--disable-jpeg) _jpeg=no ;;
--enable-pnm) _pnm=yes ;;
--disable-pnm) _pnm=no ;;
--enable-md5sum) _md5sum=yes ;;
--disable-md5sum) _md5sum=no ;;
--enable-gif) _gif=yes ;;
--disable-gif) _gif=no ;;
--enable-gl) _gl=yes ;;
--disable-gl) _gl=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-polyp) _polyp=yes ;;
--disable-polyp) _polyp=no ;;
--enable-jack) _jack=yes ;;
--disable-jack) _jack=no ;;
--enable-openal) _openal=yes ;;
--disable-openal) _openal=no ;;
--enable-mad) _mad=yes ;;
--disable-mad) _mad=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-internal) _tremor_internal=yes ;;
--disable-tremor-internal) _tremor_internal=no ;;
--enable-tremor-low) _tremor_low=yes ;;
--disable-tremor-low) _tremor_low=no ;;
--enable-tremor-external) _tremor_external=yes ;;
--disable-tremor-external) _tremor_external=no ;;
--enable-theora) _theora=yes ;;
--disable-theora) _theora=no ;;
--enable-mp3lib) _mp3lib=yes ;;
--disable-mp3lib) _mp3lib=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-internal) _faad_internal=yes ;;
--disable-faad-internal) _faad_internal=no ;;
--enable-faad-external) _faad_external=yes ;;
--disable-faad-external) _faad_external=no ;;
--enable-faad-fixed) _faad_fixed=yes ;;
--disable-faad-fixed) _faad_fixed=no ;;
--enable-faac) _faac=yes ;;
--disable-faac) _faac=no ;;
--enable-ladspa) _ladspa=yes ;;
--disable-ladspa) _ladspa=no ;;
--enable-xmms) _xmms=yes ;;
--disable-xmms) _xmms=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-teletext) _tv_teletext=yes ;;
--disable-tv-teletext) _tv_teletext=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-network) _network=yes ;;
--disable-network) _network=no ;;
--enable-winsock2) _winsock2=yes ;;
--disable-winsock2) _winsock2=no ;;
--enable-smb) _smbsupport=yes ;;
--disable-smb) _smbsupport=no ;;
--enable-vidix-internal) _vidix_internal=yes ;;
--disable-vidix-internal) _vidix_internal=no ;;
--enable-vidix-external) _vidix_external=yes ;;
--disable-vidix-external) _vidix_external=no ;;
--with-vidix-drivers=*)
_vidix_drivers=`echo $ac_option | cut -d '=' -f 2`
;;
--enable-joystick) _joystick=yes ;;
--disable-joystick) _joystick=no ;;
--enable-xvid) _xvid=yes ;;
--disable-xvid) _xvid=no ;;
--enable-x264) _x264=yes ;;
--disable-x264) _x264=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-libamr_nb) _libamr_nb=yes ;;
--disable-libamr_nb) _libamr_nb=no ;;
--enable-libamr_wb) _libamr_wb=yes ;;
--disable-libamr_wb) _libamr_wb=no ;;
--enable-decoder=*) _libavdecoders="$_libavdecoders `echo $ac_option | cut -d
'=' -f 2`" ;;
--disable-decoder=*) _libavdecoders=`echo $_libavdecoders | sed "s/\`echo
$ac_option | cut -d '=' -f 2\`//g"` ;;
--enable-encoder=*) _libavencoders="$_libavencoders `echo $ac_option | cut -d
'=' -f 2`" ;;
--disable-encoder=*) _libavencoders=`echo $_libavencoders | sed "s/\`echo
$ac_option | cut -d '=' -f 2\`//g"` ;;
--enable-parser=*) _libavparsers="$_libavparsers `echo $ac_option | cut -d '='
-f 2`" ;;
--disable-parser=*) _libavparsers=`echo $_libavparsers | sed "s/\`echo
$ac_option | cut -d '=' -f 2\`//g"` ;;
--enable-demuxer=*) _libavdemuxers="$_libavdemuxers `echo $ac_option | cut -d
'=' -f 2`" ;;
--disable-demuxer=*) _libavdemuxers=`echo $_libavdemuxers | sed "s/\`echo
$ac_option | cut -d '=' -f 2\`//g"` ;;
--enable-muxer=*) _libavmuxers="$_libavmuxers `echo $ac_option | cut -d '='
-f 2`" ;;
--disable-muxer=*) _libavmuxers=`echo $_libavmuxers | sed "s/\`echo $ac_option
| cut -d '=' -f 2\`//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-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-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-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-unrarlib) _unrarlib=yes ;;
--disable-unrarlib) _unrarlib=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-rpath) _rpath=yes ;;
--disable-rpath) _rpath=no ;;
--enable-color-console) _color_console=yes ;;
--disable-color-console) _color_console=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-macosx) _macosx=yes ;;
--disable-macosx) _macosx=no ;;
--enable-macosx-finder-support) _macosx_finder_support=yes ;;
--disable-macosx-finder-support) _macosx_finder_support=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-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
if test "$_runtime_cpudetection" = yes && not x86 && not ppc; then
die "Runtime CPU detection only works for x86, x86-64 and PPC!"
fi
if openbsd ; then
_ldconfig="ldconfig -R"
fi
if freebsd ; then
_ld_extra="$_ld_extra -L/usr/local/lib"
_inc_extra="$_inc_extra -I/usr/local/include"
fi
if darwin; then
_ld_extra="$_ld_extra -L/usr/local/lib"
_inc_extra="$_inc_extra -I/usr/local/include"
fi
if aix ; then
_ld_extra="$_ld_extra -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
_ld_extra="$_ld_extra -lwinmm"
_confwin32='TARGET_WIN32 = yes'
else
_confwin32='TARGET_WIN32 = no'
fi
if mingw32 ; then
_need_shmem=no
fi
if cygwin ; then
_def_confwin32='#define WIN32'
fi
if amigaos ; then
_select=no
_sighandler=no
_stream_cache=no
_def_stream_cache="#undef USE_STREAM_CACHE"
fi
if qnx ; then
_ld_extra="$_ld_extra -lph"
fi
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"
# Check how to call 'head' and 'tail'. Newer versions spit out warnings
# if used as 'head -1' instead of 'head -n 1', but older versions don't
# know about '-n'.
if test "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ; then
_head() { head -$1 2>/dev/null ; }
else
_head() { head -n $1 2>/dev/null ; }
fi
if test "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ; then
_tail() { tail -$1 2>/dev/null ; }
else
_tail() { tail -n $1 2>/dev/null ; }
fi
# Checking CC version...
if test "$_gcc_check" = yes ; then
# 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 1 | cut -d ',' -f 1`
cc_version=`$_cc -V 2>&1 | _head 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_verc_fail=yes
;;
8.0|9.1|10.0)
cc_version="$cc_version, ok"
cc_verc_fail=no
;;
*)
cc_version="$cc_version, bad"
cc_verc_fail=yes
;;
esac
echores "$cc_version"
else
for _cc in "$_cc" gcc gcc-3.4 gcc-3.3 gcc-3.2 gcc-3.1 gcc3 gcc-3.0 cc ; do
echocheck "$_cc version"
cc_vendor=gnu
cc_name=`$_cc -v 2>&1 | _tail 1 | cut -d ' ' -f 1`
cc_version=`$_cc -dumpversion 2>&1`
if test "$?" -gt 0; then
cc_version="not found"
fi
case $cc_version in
'')
cc_version="v. ?.??, bad"
cc_verc_fail=yes
;;
2.95.[2-9]|2.95.[2-9][-.]*|[3-4].*)
_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`
cc_version="$cc_version, ok"
cc_verc_fail=no
;;
'not found')
cc_verc_fail=yes
;;
*)
cc_version="$cc_version, bad"
cc_verc_fail=yes
;;
esac
echores "$cc_version"
test "$cc_verc_fail" = "no" && break
done
fi # icc
if test "$cc_verc_fail" = yes ; then
cat <<EOF
You are not using a supported compiler. We do not have the time to make sure
everything works with compilers other than the ones we use. Use either the
same compiler as we do, or use --disable-gcc-check but DO *NOT* REPORT BUGS
unless you can reproduce them after recompiling with a 2.95.x or 3/4.x version!
Note for gcc 2.96 users: Some versions of this compiler are known to miscompile
mplayer and lame (which is used for mencoder). If you get compile errors,
first upgrade to the latest 2.96 release (minimum 2.96-85) and try again.
If the problem still exists, try with gcc 3.x (or 2.95.x) *BEFORE* reporting
bugs!
EOF
die "Bad gcc version"
fi
else
cat <<EOF
******************************************************************************
*** DO NOT SEND BUG REPORTS OR COMPLAIN it's *YOUR* compiler's fault! ***
******************************************************************************
EOF
read _answer
fi
echocheck "host cc"
test "$_host_cc" || _host_cc=$_cc
echores $_host_cc
# ---
# 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 x86 ; then
# gather more CPU information
pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2 | _head 1`
pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2 | cut -d ' ' -f 2 |
_head 1`
pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2 |
_head 1`
pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut
-d ' ' -f 2 | _head 1`
pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2 |
_head 1`
# SSE implies MMX2, but not all SSE processors report the mmxext CPU flag.
test $_sse = kernel_check && _mmxext=kernel_check
fi # test "$_runtime_cpudetection" = no
fi
_arch_all='X86 X86_32 X86_64 IA64 SPARC ARM ARMV4L SH3 POWERPC PPC ALPHA SGI_MIPS
PA_RISC S390 S390X VAX BFIN 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_x86="ARCH_X86 = yes"
_target_arch="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
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
echores "$proc"
;;
ia64)
_arch='IA64'
_target_arch='ARCH_IA64 = yes'
iproc='ia64'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
x86_64|amd64)
_arch='X86 X86_64'
_target_arch='ARCH_X86_64 = yes'
_target_arch_x86="ARCH_X86 = yes"
_def_fast_unaligned='#define HAVE_FAST_UNALIGNED 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
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
test $_fast_cmov = "auto" && _fast_cmov=no
;;
esac
;;
*)
proc=error;;
esac
fi # test "$_runtime_cpudetection" = no
_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)
_arch='SPARC'
_target_arch='ARCH_SPARC = yes'
iproc='sparc'
if 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
_march=''
_mcpu="-mcpu=$proc"
_optimizing="$proc"
;;
sparc64)
_arch='SPARC'
_target_arch='ARCH_SPARC = yes'
_vis='yes'
iproc='sparc'
proc='ultrasparc'
_march=''
_mcpu="-mcpu=$proc"
_optimizing="$proc"
;;
arm|armv4l|armv5tel)
_arch='ARM ARMV4L'
_target_arch='ARCH_ARMV4L = yes'
iproc='arm'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
sh3)
_arch='SH3'
_target_arch='ARCH_SH3 = yes'
iproc='sh3'
proc=''
_march='-m3'
_mcpu='-ml'
_optimizing=''
;;
ppc|powerpc)
_arch='POWERPC PPC'
_def_dcbzl='#define NO_DCBZL 1'
_target_arch='ARCH_POWERPC = yes'
iproc='ppc'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
alpha)
_arch='ALPHA'
_target_arch='ARCH_ALPHA = yes'
iproc='alpha'
_march=''
_optimizing="$proc"
mips)
_arch='SGI_MIPS'
_target_arch='ARCH_SGI_MIPS = yes'
iproc='sgi-mips'
proc=''
_march=''
_mcpu=''
_optimizing=''
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'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
s390)
_arch='S390'
_target_arch='ARCH_S390 = yes'
iproc='390'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
s390x)
_arch='S390X'
_target_arch='ARCH_S390X = yes'
iproc='390x'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
vax)
_arch='VAX'
_target_arch='ARCH_VAX = yes'
iproc='vax'
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
generic)
_arch='GENERIC'
_target_arch='ARCH_GENERIC = yes'
iproc=''
proc=''
_march=''
_mcpu=''
_optimizing=''
;;
*)
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
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
fi #if x86_32
_altivec_gcc_flags=''
p=''
cat > $TMPC << EOF
int main() {
return 0;
}
EOF
FSF_flags='-maltivec -mabi=altivec'
Darwin_flags='-faltivec -D__APPLE_ALTIVEC__'
# check for Darwin-style flags first, since
# gcc-3.3 (August Update from Apple) on MacOS 10.2.8
# accepts but ignores FSF-style flags...
case $p in
FSF) _altivec_gcc_flags="$FSF_flags" _altivec=yes ;;
Darwin) _altivec_gcc_flags="$Darwin_flags" _altivec=yes ;;
*) _altivec=no ;;
esac
echores "$p"
fi
_def_altivec_h='#undef HAVE_ALTIVEC_H'
# show that we are optimizing for altivec (if enabled and supported)
if arm ; then
echocheck "ARMv5TE (Enhanced DSP Extensions)"
if test $_armv5te = "auto" ; then
cat > $TMPC << EOF
int main(void) {
__asm__ __volatile__ ("qadd r0, r0, r0");
}
EOF
_armv5te=no
cc_check && _armv5te=yes
fi
echores "$_armv5te"
_cpuexts_all='ALTIVEC MMX MMX2 3DNOW 3DNOWEX SSE SSE2 SSSE3 FAST_CMOV CMOV ARMV5TE
ARMV6 IWMMXT MLIB MMI SH4 VIS MVI'
test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts"
test "$_mmx" = yes && _cpuexts="MMX $_cpuexts"
test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts"
test "$_3dnow" = yes && _cpuexts="3DNOW $_cpuexts"
test "$_3dnowext" = yes && _cpuexts="3DNOWEX $_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 "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts"
test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts"
test "$_iwmmxt" = yes && _cpuexts="IWMMXT $_cpuexts"
test "$_vis" = yes && _cpuexts="VIS $_cpuexts"
test "$_mvi" = yes && _cpuexts="MVI $_cpuexts"
######################
# MAIN TESTS GO HERE #
######################
echocheck "-lposix"
cat > $TMPC <<EOF
int main(void) { return 0; }
EOF
if cc_check -lposix ; then
_ld_extra="$_ld_extra -lposix"
echores "yes"
else
echores "no"
fi
echocheck "-lm"
cat > $TMPC <<EOF
int main(void) { return 0; }
EOF
if cc_check -lm ; then
_ld_lm="-lm"
echores "yes"
else
_ld_lm=""
echores "no"
fi
echocheck "langinfo"
if test "$_langinfo" = auto ; then
cat > $TMPC <<EOF
#include <langinfo.h>
int main(void) { nl_langinfo(CODESET); return 0; }
EOF
_langinfo=no
cc_check && _langinfo=yes
fi
if test "$_langinfo" = yes ; then
_def_langinfo='#define USE_LANGINFO 1'
else
_def_langinfo='#undef USE_LANGINFO'
fi
echores "$_langinfo"
echocheck "language"
test -z "$_language" && _language=$LINGUAS
_language=`echo $_language | sed 's/,/ /g'`
echo $_language | grep all > /dev/null || LANGUAGES="$_language en"
for lang in $_language ; do
test "$lang" = all && lang=en
if test -f "help/help_mp-${lang}.h" ; then
_language=$lang
break
else
echo ${_echo_n} "$lang not found, ${_echo_c}"
_language=`echo $_language | sed "s/$lang *//"`
fi
done
test -z "$_language" && _language=en
_mp_help="help/help_mp-${_language}.h"
test -f $_mp_help || die "$_mp_help not found"
for lang in $LANGUAGES ; do
if test -f "DOCS/man/$lang/mplayer.1" ; then
MAN_LANG="$lang $MAN_LANG"
fi
done
_doc_lang=$_language
test -d DOCS/xml/$_doc_lang || _doc_lang=en
echores "using $_language (man pages: $MAN_LANG)"
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() { 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 <kstat.h>
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"
_ld_extra="$_ld_extra -lkstat"
else
_def_kstat="#undef HAVE_LIBKSTAT"
fi
echores "$_kstat"
echocheck "posix4"
# required for nanosleep on some systems
cat > $TMPC << EOF
#include <time.h>
int main(void) { (void) nanosleep(0, 0); return 0; }
EOF
_posix4=no
cc_check -lposix4 && _posix4=yes
if test "$_posix4" = yes ; then
_ld_extra="$_ld_extra -lposix4"
fi
echores "$_posix4"
echocheck "lrintf"
cat > $TMPC << EOF
#include <math.h>
int main(void) { long (*foo)(float); foo = lrintf; (void)(*foo)(0.0); return 0; }
EOF
_lrintf=no
cc_check -D_GNU_SOURCE $_ld_lm && _lrintf=yes
if test "$_lrintf" = yes ; then
_def_lrintf="#define HAVE_LRINTF 1"
else
_def_lrintf="#undef HAVE_LRINTF"
fi
echores "$_lrintf"
echocheck "mkstemp"
cat > $TMPC << EOF
#include <stdlib.h>
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 <time.h>
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 <netdb.h>
#include <sys/socket.h>
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
if test $_winsock2 = auto && not cygwin ; then
_winsock2=no
cat > $TMPC << EOF
#include <winsock2.h>
int main(void) { (void) gethostbyname(0); return 0; }
EOF
cc_check -lws2_32 && _ld_sock="-lws2_32" && _winsock2=yes
fi
test "$_ld_sock" && _res_comment="using $_ld_sock"
echores "$_socklib"
_use_aton=no
echocheck "inet_pton()"
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int main(void) { (void) inet_pton(0, 0, 0); return 0; }
EOF
if test "$_winsock2" = yes ; then
_res_comment="using winsock2 functions instead"
echores "no"
elif cc_check $_ld_sock ; then
# NOTE: Linux has libresolv but does not need it
:
_res_comment="using $_ld_sock"
echores "yes"
elif cc_check $_ld_sock -lresolv ; then
# NOTE: needed for SunOS at least
_ld_sock="$_ld_sock -lresolv"
_res_comment="using $_ld_sock"
echores "yes"
else
_res_comment="trying inet_aton next"
echores "no"
echocheck "inet_aton()"
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int main(void) { (void) inet_aton(0, 0); return 0; }
EOF
_use_aton=yes
if cc_check $_ld_sock ; then
# NOTE: Linux has libresolv but does not need it
:
_res_comment="using $_ld_sock"
elif cc_check $_ld_sock -lresolv ; then
# NOTE: needed for SunOS at least
_ld_sock="$_ld_sock -lresolv"
_res_comment="using $_ld_sock"
else
_use_aton=no
_network=no
_res_comment="network support disabled"
fi
echores "$_use_aton"
fi
_def_use_aton='#undef USE_ATON'
if test "$_use_aton" = yes; then
_def_use_aton='#define USE_ATON 1'
fi
echocheck "network"
# FIXME network check
if test "$_network" = yes ; then
_def_network='#define MPLAYER_NETWORK 1'
_ld_extra="$_ld_extra $_ld_sock"
_inputmodules="network $_inputmodules"
else
_noinputmodules="network $_noinputmodules"
_def_network='#undef MPLAYER_NETWORK'
_ftp=no
fi
echores "$_network"
echocheck "memalign()"
# XXX restrict to x86 ? extend to other CPUs/cacheline sizes ?
cat > $TMPC << EOF
#include <malloc.h>
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='#undef HAVE_MEMALIGN'
_def_map_memalign='#define memalign(a,b) malloc(b)'
not darwin && _def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
fi
echores "$_memalign"
echocheck "alloca.h"
cat > $TMPC << EOF
#include <alloca.h>
int main(void) { (void) alloca(0); return 0; }
EOF
_alloca=no
cc_check && _alloca=yes
if cc_check ; then
_def_alloca='#define HAVE_ALLOCA_H 1'
else
_def_alloca='#undef HAVE_ALLOCA_H'
fi
echores "$_alloca"
echocheck "mman.h"
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/mman.h>
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='#define HAVE_SYS_MMAN_H 1'
else
_def_mman='#undef HAVE_SYS_MMAN_H'
fi
echores "$_mman"
_def_threads='#undef HAVE_THREADS'
echocheck "pthread"
if test "$_pthreads" = auto ; then
cat > $TMPC << EOF
#include <pthread.h>
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 not 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 $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp"
&& _pthreads=yes && break
done
fi
fi
if test "$_pthreads" = yes ; then
_res_comment="using $_ld_pthread"
_def_pthreads='#define HAVE_PTHREADS 1'
_def_threads='#define HAVE_THREADS 1'
else
_res_comment="v4l, vo_gl, ao_alsa, ao_nas, ao_macosx, win32 loader disabled"
_def_pthreads='#undef HAVE_PTHREADS'
_nas=no ; _tv_v4l1=no ; _macosx=no
if not mingw32 ; then
_win32dll=no
fi
fi
echores "$_pthreads"
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 $_ld_extra | sed 's/-L//g'` ; do
tmp="$tmp ` echo $I | sed 's/.*/ -L& -Wl,-R&/'`"
done
_ld_extra=$tmp
fi
echores "$_rpath"
echocheck "iconv"
if test "$_iconv" = auto ; then
cat > $TMPC << EOF
#include <stdio.h>
#include <unistd.h>
#include <iconv.h>
#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)
;
}
}
EOF
_iconv=no
for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
cc_check $_ld_lm $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && \
_iconv=yes && break
done
fi
if test "$_iconv" = yes ; then
_def_iconv='#define USE_ICONV 1'
else
_def_iconv='#undef USE_ICONV'
fi
echores "$_iconv"
echocheck "soundcard.h"
_soundcard_h=no
_def_soundcard='#undef HAVE_SOUNDCARD_H'
_def_sys_soundcard='#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
echocheck "sys/cdio.h"
cat > $TMPC << EOF
#include <unistd.h>
#include <sys/cdio.h>
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 <sys/types.h>
#include <linux/cdrom.h>
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 <dvd.h>
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 <dvd.h>
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 <sys/scsi.h>
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 <unistd.h>
# include <stropts.h>
# include <sys/scsi/scsi_types.h>
# include <sys/scsi/impl/uscsi.h>
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 <<EOF
int main(void) { tgetent(); return 0; }
EOF
_termcap=no
for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" \
&& _termcap=yes && break
done
fi
if test "$_termcap" = yes ; then
_def_termcap='#define USE_TERMCAP 1'
_res_comment="using $_ld_tmp"
else
_def_termcap='#undef USE_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 <<EOF
#include <$_termios_header>
int main(void) { return 0; }
EOF
cc_check && _termios=yes && _res_comment="$_termios_header" && break
done
fi
echocheck "shm"
if test "$_shm" = auto ; then
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/shm.h>
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 <string.h>
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
#include <stdarg.h>
int main(void) { vsscanf(0, 0, 0); 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
#include <unistd.h>
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 <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
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'
cc_check && _posix_select=yes \
&& _def_posix_select='#define HAVE_POSIX_SELECT 1'
echores "$_posix_select"
echocheck "gettimeofday()"
cat > $TMPC << EOF
#include <stdio.h>
#include <sys/time.h>
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 <stdio.h>
#include <glob.h>
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 <stdlib.h>
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 <sys/sysi86.h>
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 <sys/sysi86.h>
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 <sys/sysinfo.h>
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='#define HAVE_SYS_SYSINFO_H 1'
else
_def_sys_sysinfo='#undef HAVE_SYS_SYSINFO_H'
fi
echores "$_sys_sysinfo"
if darwin; then
echocheck "Mac OS X APIs"
if test "$_macosx" = auto ; then
productName=`/usr/bin/sw_vers -productName`
if test "$productName" = "Mac OS X" ||
test "$productName" = "Mac OS X Server" ; then
_macosx=yes
else
_macosx=no
_def_macosx='#undef MACOSX'
_noaomodules="macosx $_noaomodules"
_novomodules="quartz $_novomodules"
fi
fi
if test "$_macosx" = yes ; then
cat > $TMPC <<EOF
#include <Carbon/Carbon.h>
#include <QuickTime/QuickTime.h>
#include <CoreAudio/CoreAudio.h>
int main(void) {
EnterMovies();
ExitMovies();
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, false);
}
EOF
if cc_check -framework Carbon -framework QuickTime -framework CoreAudio; then
_ld_extra="$_ld_extra -framework Carbon -framework QuickTime -framework
CoreAudio -framework AudioUnit -framework AudioToolbox"
_def_macosx='#define MACOSX 1'
_aosrc="$_aosrc ao_macosx.c"
_aomodules="macosx $_aomodules"
_vosrc="$_vosrc vo_quartz.c"
_vomodules="quartz $_vomodules"
else
_macosx=no
_def_macosx='#undef MACOSX'
_noaomodules="macosx $_noaomodules"
_novomodules="quartz $_novomodules"
fi
cat > $TMPC <<EOF
#include <Carbon/Carbon.h>
#include <QuartzCore/CoreVideo.h>
int main(void) {}
EOF
if cc_check -framework Carbon -framework QuartzCore -framework OpenGL; then
_vosrc="$_vosrc vo_macosx.m"
_vomodules="macosx $_vomodules"
_ld_extra="$_ld_extra -framework Cocoa -framework QuartzCore -framework
OpenGL"
_def_macosx_corevideo='#define MACOSX_COREVIDEO 1'
_macosx_corevideo=yes
else
_novomodules="macosx $_novomodules"
_def_macosx_corevideo='#undef MACOSX_COREVIDEO'
_macosx_corevideo=no
fi
fi
echores "$_macosx"
echocheck "Mac OS X Finder Support"
if test "$_macosx_finder_support" = auto ; then
_macosx_finder_support=$_macosx
fi
if test "$_macosx_finder_support" = yes; then
_def_macosx_finder_support='#define MACOSX_FINDER_SUPPORT 1'
_macosx_finder_support=yes
else
_def_macosx_finder_support='#undef MACOSX_FINDER_SUPPORT'
_macosx_finder_support=no
fi
echores "$_macosx_finder_support"
fi #if darwin
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
#########
# VIDEO #
#########
echocheck "tdfxfb"
if test "$_tdfxfb" = yes ; then
_def_tdfxfb='#define HAVE_TDFXFB 1'
_vosrc="$_vosrc vo_tdfxfb.c"
_vomodules="tdfxfb $_vomodules"
else
_def_tdfxfb='#undef HAVE_TDFXFB'
_novomodules="tdfxfb $_novomodules"
fi
echores "$_tdfxfb"
echocheck "s3fb"
if test "$_s3fb" = yes ; then
_def_s3fb='#define HAVE_S3FB 1'
_vosrc="$_vosrc vo_s3fb.c"
_vomodules="s3fb $_vomodules"
else
_def_s3fb='#undef HAVE_S3FB'
_novomodules="s3fb $_novomodules"
fi
echores "$_s3fb"
echocheck "tdfxvid"
if test "$_tdfxvid" = yes ; then
_def_tdfxvid='#define HAVE_TDFX_VID 1'
_vosrc="$_vosrc vo_tdfx_vid.c"
_vomodules="tdfx_vid $_vomodules"
else
_def_tdfxvid='#undef HAVE_TDFX_VID'
_novomodules="tdfx_vid $_novomodules"
fi
echores "$_tdfxvid"
echocheck "xvr100"
if test "$_xvr100" = auto ; then
cat > $TMPC << EOF
#include <unistd.h>
#include <sys/fbio.h>
#include <sys/visual_io.h>
int main(void) {
struct vis_identifier ident;
struct fbgattr attr;
echocheck "tga"
if test "$_tga" = yes ; then
_def_tga='#define HAVE_TGA 1'
_vosrc="$_vosrc vo_tga.c"
_vomodules="tga $_vomodules"
else
_def_tga='#undef HAVE_TGA'
_novomodules="tga $_novomodules"
fi
echores "$_tga"
echocheck "bl"
if test "$_bl" = yes ; then
_def_bl='#define HAVE_BL 1'
_vosrc="$_vosrc vo_bl.c"
_vomodules="bl $_vomodules"
else
_def_bl='#undef HAVE_BL'
_novomodules="bl $_novomodules"
fi
echores "$_bl"
echocheck "DirectFB"
if test "$_directfb" = auto ; then
_directfb=no
cat > $TMPC <<EOF
#include <directfb.h>
int main(void) { IDirectFB *foo; 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 && \
_inc_extra="$_inc_extra $_inc_tmp" && break
done
fi
dfb_version() {
expr $1 \* 65536 + $2 \* 256 + $3
}
echocheck "X11"
if test "$_x11" = auto && test "$_x11_headers" = yes ; then
cat > $TMPC <<EOF
#include <X11/Xlib.h>
#include <X11/Xutil.h>
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/X11R6/lib -L/usr/lib/X11R6 -L/usr/X11/lib \
-L/usr/lib32 -L/usr/openwin/lib -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 HAVE_X11 1'
_vosrc="$_vosrc x11_common.c vo_x11.c vo_xover.c"
_vomodules="x11 xover $_vomodules"
else
_x11=no
_def_x11='#undef HAVE_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
fi
echores "$_x11"
echocheck "DPMS"
_xdpms3=no
_xdpms4=no
if test "$_x11" = yes ; then
cat > $TMPC <<EOF
#include <X11/Xmd.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/dpms.h>
int main(void) {
(void) DPMSQueryExtension(0, 0, 0);
}
EOF
cc_check -lXdpms && _xdpms3=yes
cat > $TMPC <<EOF
#include <X11/Xlib.h>
#include <X11/extensions/dpms.h>
int main(void) {
(void) DPMSQueryExtension(0, 0, 0);
}
EOF
cc_check -lXext && _xdpms4=yes
fi
if test "$_xdpms4" = yes ; then
_def_xdpms='#define HAVE_XDPMS 1'
_res_comment="using Xdpms 4"
echores "yes"
elif test "$_xdpms3" = yes ; then
_def_xdpms='#define HAVE_XDPMS 1'
_libs_mplayer="$_libs_mplayer -lXdpms"
_res_comment="using Xdpms 3"
echores "yes"
else
_def_xdpms='#undef HAVE_XDPMS'
echores "no"
fi
echocheck "Xv"
if test "$_xv" = auto ; then
cat > $TMPC <<EOF
#include <X11/Xlib.h>
#include <X11/extensions/Xvlib.h>
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
echocheck "XvMC"
if test "$_xv" = yes && test "$_xvmc" != no ; then
_xvmc=no
cat > $TMPC <<EOF
#include <X11/Xlib.h>
#include <X11/extensions/Xvlib.h>
#include <X11/extensions/XvMClib.h>
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 HAVE_XVMC 1'
_libs_mplayer="$_libs_mplayer -lXvMC -l$_xvmclib"
_vosrc="$_vosrc vo_xvmc.c"
_vomodules="xvmc $_vomodules"
_res_comment="using $_xvmclib"
else
_def_xvmc='#undef HAVE_XVMC'
_novomodules="xvmc $_novomodules"
_libavdecoders=`echo $_libavdecoders | sed -e s/MPEG_XVMC_DECODER// `
fi
echores "$_xvmc"
echocheck "Xinerama"
if test "$_xinerama" = auto ; then
cat > $TMPC <<EOF
#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
int main(void) { (void) XineramaIsActive(0); return 0; }
EOF
_xinerama=no
cc_check -lXinerama && _xinerama=yes
fi
# 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 <<EOF
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>
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 HAVE_XF86VM 1'
_libs_mplayer="$_libs_mplayer -lXxf86vm"
else
_def_vm='#undef HAVE_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 <<EOF
#include <X11/Xlib.h>
#include <X11/XF86keysym.h>
int main(void) { return XF86XK_AudioPause; }
EOF
cc_check && _xf86keysym=yes
fi
if test "$_xf86keysym" = yes ; then
_def_xf86keysym='#define HAVE_XF86XK 1'
else
_def_xf86keysym='#undef HAVE_XF86XK'
fi
echores "$_xf86keysym"
echocheck "DGA"
if test "$_dga2" = auto && test "$_x11" = yes ; then
cat > $TMPC << EOF
#include <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
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 <X11/Xlib.h>
#include <X11/extensions/xf86dga.h>
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 HAVE_DGA'
_def_dga1='#undef HAVE_DGA1'
_def_dga2='#undef HAVE_DGA2'
if test "$_dga1" = yes ; then
_dga=yes
_def_dga1='#define HAVE_DGA1 1'
_res_comment="using DGA 1.0"
elif test "$_dga2" = yes ; then
_dga=yes
_def_dga2='#define HAVE_DGA2 1'
_res_comment="using DGA 2.0"
fi
if test "$_dga" = yes ; then
_def_dga='#define HAVE_DGA 1'
_libs_mplayer="$_libs_mplayer -lXxf86dga"
_vosrc="$_vosrc vo_dga.c"
_vomodules="dga $_vomodules"
else
_novomodules="dga $_novomodules"
fi
echores "$_dga"
echocheck "3dfx"
if test "$_3dfx" = yes && test "$_dga" = yes ; then
_def_3dfx='#define HAVE_3DFX 1'
_vosrc="$_vosrc vo_3dfx.c"
_vomodules="3dfx $_vomodules"
else
_def_3dfx='#undef HAVE_3DFX'
_novomodules="3dfx $_novomodules"
fi
echores "$_3dfx"
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
#include <GL/gl.h>
#ifdef GL_WIN32
#include <windows.h>
#include <GL/glext.h>
#else
#include <X11/Xlib.h>
#include <GL/glx.h>
#endif
int main(void) {
#ifdef GL_WIN32
HDC dc;
wglCreateContext(dc);
#else
glXCreateContext(NULL, NULL, NULL, True);
#endif
glFinish();
return 0;
}
EOF
_gl=no
if cc_check -lGL $_ld_lm ; then
_gl=yes
_libs_mplayer="$_libs_mplayer -lGL $_ld_dl"
elif cc_check -lGL $_ld_lm $_ld_pthread ; then
_gl=yes
_libs_mplayer="$_libs_mplayer -lGL $_ld_pthread $_ld_dl"
elif 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 HAVE_GL 1'
_vosrc="$_vosrc vo_gl.c vo_gl2.c gl_common.c"
if test "$_gl_win32" = yes ; then
_def_gl_win32='#define GL_WIN32 1'
_vosrc="$_vosrc w32_common.c"
_res_comment="win32 version"
fi
_vomodules="opengl $_vomodules"
else
_def_gl='#undef HAVE_GL'
_def_gl_win32='#undef GL_WIN32'
_novomodules="opengl $_novomodules"
fi
echores "$_gl"
echocheck "VIDIX"
_vidix=no
_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_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_savage='#undef CONFIG_VIDIX_DRV_SAVAGE'
_vidix_drv_savage=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_internal" = auto ; then
_vidix_internal=no
x86 && _vidix_internal=yes
ppc && linux && _vidix_internal=yes
alpha && linux && _vidix_internal=yes
qnx || beos || darwin && _vidix_internal=no
fi
if test "$_vidix_internal" = yes; then
_res_comment="internal"
_vidix_external=no
_vidix=yes
elif test "$_vidix_external" = auto; then
_vidix_external=no
cat > $TMPC <<EOF
#include <vidix/vidix.h>
int main(void) { return 0; }
EOF
cc_check -lvidix && _vidix_external=yes && _res_comment="external" \
&& _vidix=yes
fi
echores "$_vidix"
# some vidix drivers are not meant to work on powerpc, discard them
ppc && _vidix_drivers=`echo $_vidix_drivers | sed -e s/cyberblade// -e s/sis//
-e s/unichrome//`
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 HAVE_MGA 1'
_vosrc="$_vosrc vo_mga.c"
_vomodules="mga $_vomodules"
else
_def_mga='#undef HAVE_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 HAVE_XMGA 1'
_vosrc="$_vosrc vo_xmga.c"
_vomodules="xmga $_vomodules"
else
_def_xmga='#undef HAVE_XMGA'
_novomodules="xmga $_novomodules"
fi
echores "$_xmga"
echocheck "GGI"
if test "$_ggi" = auto ; then
cat > $TMPC << EOF
#include <ggi/ggi.h>
int main(void) { ggiInit(); return 0; }
EOF
_ggi=no
cc_check -lggi && _ggi=yes
fi
if test "$_ggi" = yes ; then
_def_ggi='#define HAVE_GGI 1'
_libs_mplayer="$_libs_mplayer -lggi"
_vosrc="$_vosrc vo_ggi.c"
_vomodules="ggi $_vomodules"
else
_def_ggi='#undef HAVE_GGI'
_novomodules="ggi $_novomodules"
fi
echores "$_ggi"
echocheck "AA"
if test "$_aa" = auto ; then
cat > $TMPC << EOF
#include <aalib.h>
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 HAVE_AA 1'
if cygwin ; then
_libs_mplayer="$_libs_mplayer `aalib-config --libs | cut -d " " -f 2,5,6`"
fi
_vosrc="$_vosrc vo_aa.c"
_vomodules="aa $_vomodules"
else
_def_aa='#undef HAVE_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 <caca.h>
#ifdef CACA_API_VERSION_1
#include <caca0.h>
#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 HAVE_CACA 1'
_inc_extra="$_inc_extra `caca-config --cflags`"
_libs_mplayer="$_libs_mplayer `caca-config --libs`"
_vosrc="$_vosrc vo_caca.c"
_vomodules="caca $_vomodules"
else
_def_caca='#undef HAVE_CACA'
_novomodules="caca $_novomodules"
fi
echores "$_caca"
echocheck "SVGAlib"
if test "$_svga" = auto ; then
cat > $TMPC << EOF
#include <vga.h>
int main(void) { return 0; }
EOF
_svga=no
cc_check -lvga $_ld_lm && _svga=yes
fi
if test "$_svga" = yes ; then
_def_svga='#define HAVE_SVGALIB 1'
_libs_mplayer="$_libs_mplayer -lvga"
_vosrc="$_vosrc vo_svga.c"
_vomodules="svga $_vomodules"
else
_def_svga='#undef HAVE_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 HAVE_FBDEV 1'
_vosrc="$_vosrc vo_fbdev.c vo_fbdev2.c"
_vomodules="fbdev $_vomodules"
else
_def_fbdev='#undef HAVE_FBDEV'
_novomodules="fbdev $_novomodules"
fi
echores "$_fbdev"
echocheck "DVB"
if test "$_dvb" = auto ; then
_dvb=no
cat >$TMPC << EOF
#include <sys/poll.h>
#include <sys/ioctl.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <ost/dmx.h>
#include <ost/frontend.h>
#include <ost/sec.h>
#include <ost/video.h>
#include <ost/audio.h>
int main(void) {return 0;}
EOF
for _inc_tmp in "" "-I/usr/src/DVB/ost/include" ; do
cc_check $_inc_tmp && _dvb=yes && \
_inc_extra="$_inc_extra $_inc_tmp" && break
done
fi
echores "$_dvb"
if test "$_dvb" = yes ; then
_def_dvb='#define HAVE_DVB 1'
_def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
_aomodules="mpegpes(dvb) $_aomodules"
_vomodules="mpegpes(dvb) $_vomodules"
fi
#include <linux/dvb/dmx.h>
#include <linux/dvb/frontend.h>
#include <linux/dvb/video.h>
#include <linux/dvb/audio.h>
int main(void) {return 0;}
EOF
for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
cc_check $_inc_tmp && _dvbhead=yes && \
_inc_extra="$_inc_extra $_inc_tmp" && break
done
fi
echores "$_dvbhead"
if test "$_dvbhead" = yes ; then
_def_dvb='#define HAVE_DVB_HEAD 1'
_def_dvb_in='#define HAS_DVBIN_SUPPORT 1'
_aomodules="mpegpes(dvb) $_aomodules"
_vomodules="mpegpes(dvb) $_vomodules"
fi
echocheck "zr"
if test "$_zr" = auto ; then
#36067's seem to identify themselves as 36057PQC's, so the line
#below should work for 36067's and 36057's.
if grep -e "Multimedia video controller: Zoran Corporation ZR36057" /proc/pci >
/dev/null 2>&1; then
_zr=yes
else
_zr=no
fi
fi
if test "$_zr" = yes ; then
if test "$_libavcodec_a" = yes ; then
_def_zr='#define HAVE_ZR 1'
_vosrc="$_vosrc vo_zr2.c vo_zr.c jpeg_enc.c"
_vomodules="zr zr2 $_vomodules"
else
_res_comment="libavcodec (static) is required by zr, sorry"
_novomodules="zr $_novomodules"
_def_zr='#undef HAVE_ZR'
fi
else
_def_zr='#undef HAVE_ZR'
_novomodules="zr zr2 $_novomodules"
fi
echores "$_zr"
#################
# VIDEO + AUDIO #
#################
echocheck "SDL"
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
#include <SDL.h>
int main(int argc, char *argv[]) {
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE);
return 0;
}
EOF
_sdl=no
if "$_sdlconfig" --version >>"$TMPLOG" 2>&1 ; then
if cc_check `$_sdlconfig --cflags` `$_sdlconfig --libs` >>"$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 HAVE_SDL 1'
if cygwin ; then
_libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | cut -d " " -f 1,4,6 | sed
s/no-cygwin/cygwin/`"
_inc_extra="$_inc_extra `$_sdlconfig --cflags | cut -d " " -f 1,5,6 | sed
s/no-cygwin/cygwin/`"
elif mingw32 ; then
_libs_mplayer="$_libs_mplayer `$_sdlconfig --libs | sed -e s/-mwindows// -e
s/-lmingw32//`"
_inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-Dmain=SDL_main//`"
else
_libs_mplayer="$_libs_mplayer `$_sdlconfig --libs`"
_inc_extra="$_inc_extra `$_sdlconfig --cflags | sed s/-D_GNU_SOURCE=1//`"
fi
_vosrc="$_vosrc vo_sdl.c"
_vomodules="sdl $_vomodules"
_aosrc="$_aosrc ao_sdl.c"
_aomodules="sdl $_aomodules"
_res_comment="using $_sdlconfig"
else
_def_sdl='#undef HAVE_SDL'
_novomodules="sdl $_novomodules"
_noaomodules="sdl $_noaomodules"
fi
echores "$_sdl"
if win32; then
echocheck "Directx"
if test "$_directx" = auto ; then
cat > $TMPC << EOF
#include <windows.h>
#include <ddraw.h>
#include <dsound.h>
int main(void) { return 0; }
EOF
_directx=no
cc_check -lgdi32 && _directx=yes
fi
if test "$_directx" = yes ; then
_def_directx='#define HAVE_DIRECTX 1'
_libs_mplayer="$_libs_mplayer -lgdi32"
_vosrc="$_vosrc vo_directx.c"
_vomodules="directx $_vomodules"
_aosrc="$_aosrc ao_dsound.c"
_aomodules="dsound $_aomodules"
else
_def_directx='#undef HAVE_DIRECTX'
_novomodules="directx $_novomodules"
_noaomodules="dsound $_noaomodules"
fi
echores "$_directx"
echocheck "NAS"
if test "$_nas" = auto ; then
cat > $TMPC << EOF
#include <audio/audiolib.h>
int main(void) { return 0; }
EOF
_nas=no
cc_check $_ld_lm -laudio -lXt && _nas=yes
fi
if test "$_nas" = yes ; then
_def_nas='#define HAVE_NAS 1'
_libs_mplayer="$_libs_mplayer -laudio -lXt"
_aosrc="$_aosrc ao_nas.c"
_aomodules="nas $_aomodules"
else
_noaomodules="nas $_noaomodules"
_def_nas='#undef HAVE_NAS'
fi
echores "$_nas"
echocheck "DXR2"
if test "$_dxr2" = auto; then
_dxr2=no
cat > $TMPC << EOF
#include <dxr2ioctl.h>
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 && \
_inc_extra="$_inc_extra $_inc_tmp" && break
done
fi
if test "$_dxr2" = yes; then
_def_dxr2='#define HAVE_DXR2 1'
_vosrc="$_vosrc vo_dxr2.c"
_aosrc="$_aosrc ao_dxr2.c"
_aomodules="dxr2 $_aomodules"
_vomodules="dxr2 $_vomodules"
else
_def_dxr2='#undef HAVE_DXR2'
_noaomodules="dxr2 $_noaomodules"
_novomodules="dxr2 $_novomodules"
fi
echores "$_dxr2"
echocheck "DXR3/H+"
if test "$_dxr3" = auto ; then
cat > $TMPC << EOF
#include <linux/em8300.h>
int main(void) { return 0; }
EOF
_dxr3=no
cc_check && _dxr3=yes
fi
if test "$_dxr3" = yes ; then
_def_dxr3='#define HAVE_DXR3 1'
_vosrc="$_vosrc vo_dxr3.c"
_vomodules="dxr3 $_vomodules"
else
_def_dxr3='#undef HAVE_DXR3'
_novomodules="dxr3 $_novomodules"
fi
echores "$_dxr3"
#########
# AUDIO #
#########
echocheck "aRts"
if test "$_arts" = auto ; then
_arts=no
if ( artsc-config --version ) >> "$TMPLOG" 2>&1 ; then
fi
fi
echocheck "EsounD"
if test "$_esd" = auto ; then
_esd=no
if ( esd-config --version ) >> "$TMPLOG" 2>&1 ; then
fi
fi
echores "$_esd"
echocheck "esd_get_latency()"
cat > $TMPC << EOF
#include <esd.h>
int main(void) { return esd_get_latency(0); }
EOF
cc_check `esd-config --libs` `esd-config --cflags` && _esd_latency=yes &&
_def_esd_latency='#define HAVE_ESD_LATENCY'
echores "$_esd_latency"
else
_def_esd='#undef USE_ESD'
_def_esd_latency='#undef HAVE_ESD_LATENCY'
_noaomodules="esd $_noaomodules"
fi
echocheck "Polyp"
if test "$_polyp" = auto ; then
_polyp=no
if $_pkg_config --exists 'polyplib >= 0.6 polyplib-error >= 0.6 polyplib-
mainloop >= 0.6' ; then
fi
fi
echores "$_polyp"
echocheck "JACK"
if test "$_jack" = auto ; then
_jack=yes
echocheck "OpenAL"
if test "$_openal" = auto ; then
_openal=no
cat > $TMPC << EOF
#ifdef OPENAL_AL_H
#include <OpenAL/al.h>
#else
#include <AL/al.h>
#endif
int main(void) {
alSourceQueueBuffers(0, 0, 0);
// alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
return 0;
}
EOF
for I in "-lopenal" "-framework OpenAL" ; do
cc_check $I && _openal=yes && break
cc_check -DOPENAL_AL_H=1 $I && _def_openal_h='#define OPENAL_AL_H 1' &&
_openal=yes && break
done
test "$_openal" = yes && _libs_mplayer="$_libs_mplayer $I"
fi
if test "$_openal" = yes ; then
_def_openal='#define USE_OPENAL 1'
_aosrc="$_aosrc ao_openal.c"
_aomodules="openal $_aomodules"
else
_noaomodules="openal $_noaomodules"
fi
echores "$_openal"
if sunos; then
echocheck "Sun mediaLib"
if test "$_mlib" = auto ; then
_mlib=no
cat > $TMPC << EOF
#include <mlib.h>
int main(void) { mlib_VideoColorYUV2ABGR420(0,0,0,0,0,0,0,0,0); return 0; }
EOF
cc_check -lmlib && _mlib=yes
fi
test "$_mlib" = yes && _cpuexts="MLIB $_cpuexts"
echores "$_mlib"
fi #if sunos
if irix; then
echocheck "SGI audio"
if test "$_sgiaudio" = auto ; then
# check for SGI audio
cat > $TMPC << EOF
#include <dmedia/audio.h>
int main(void) { return 0; }
EOF
_sgiaudio=no
cc_check && _sgiaudio=yes
fi
if test "$_sgiaudio" = "yes" ; then
_def_sgiaudio='#define USE_SGI_AUDIO 1'
_libs_mplayer="$_libs_mplayer -laudio"
_aosrc="$_aosrc ao_sgi.c"
_aomodules="sgi $_aomodules"
else
_def_sgiaudio='#undef USE_SGI_AUDIO'
_noaomodules="sgi $_noaomodules"
fi
echores "$_sgiaudio"
fi #if irix
echocheck "dvdread"
if test "$_dvdread_internal" = auto ; then
_dvdread_internal=no
if linux || freebsd || netbsd || darwin || openbsd || win32 || sunos || hpux &&
\
test "$_dvd" = yes || test "$_cdrom" = yes || test "$_cdio" = yes || \
test "$_dvdio" = yes || test "$_bsdi_dvd" = yes || \
test "$_hpux_scsi_h" = yes || darwin || win32 ; then
_dvdread_internal=yes
_dvdread=yes
fi
elif test "$_dvdread" = auto ; then
_dvdread=no
if test "$_dl" = yes; then
cat > $TMPC << EOF
#include <inttypes.h>
#include <dvdread/dvd_reader.h>
#include <dvdread/ifo_types.h>
#include <dvdread/ifo_read.h>
#include <dvdread/nav_read.h>
int main(void) { return 0; }
EOF
cc_check -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE \
-ldvdread $_ld_dl && _dvdread=yes && _res_comment="external"
fi
fi
echocheck "cdparanoia"
if test "$_cdparanoia" = auto ; then
cat > $TMPC <<EOF
#include <cdda_interface.h>
#include <cdda_paranoia.h>
// This need a better test. How ?
int main(void) {
void *test = cdda_verbose_set;
return test == (void *)1;
}
EOF
_cdparanoia=no
for _inc_tmp in "" "-I/usr/include/cdda" "-I/usr/local/include/cdda" ; do
cc_check $_inc_tmp -lcdda_interface -lcdda_paranoia $_ld_lm && \
_cdparanoia=yes && _inc_extra="$_inc_extra $_inc_tmp" && break
done
fi
if test "$_cdparanoia" = yes ; then
_cdda='yes'
_ld_extra="$_ld_extra -lcdda_interface -lcdda_paranoia"
openbsd && _ld_extra="$_ld_extra -lutil"
fi
echores "$_cdparanoia"
echocheck "libcdio"
if test "$_libcdio" = auto && test "$_cdparanoia" = no ; then
cat > $TMPC << EOF
#include <stdio.h>
#include <cdio/version.h>
#include <cdio/cdda.h>
#include <cdio/paranoia.h>
int main()
{
void *test = cdda_verbose_set;
printf("%s\n", CDIO_VERSION);
return test == (void *)1;
}
EOF
_libcdio=no
for _ld_tmp in "" "-lwinmm" ; do
_ld_tmp="-lcdio_cdda -lcdio -lcdio_paranoia $_ld_tmp"
cc_check $_ld_tmp $_ld_lm \
&& _libcdio=yes && _ld_extra="$_ld_extra $_ld_tmp" && break
done
if test "$_libcdio" = no && $_pkg_config --exists libcdio_paranoia ; then
_inc_tmp=`$_pkg_config --cflags libcdio_paranoia`
_ld_tmp=`$_pkg_config --libs libcdio_paranoia`
cc_check $_inc_tmp $_ld_tmp $_ld_lm && _libcdio=yes \
&& _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
fi
fi
if test "$_libcdio" = yes && test "$_cdparanoia" = no ; then
_cdda='yes'
_def_libcdio='#define HAVE_LIBCDIO'
_def_havelibcdio='yes'
else
if test "$_cdparanoia" = yes ; then
_res_comment="using cdparanoia"
fi
_def_libcdio='#undef HAVE_LIBCDIO'
_def_havelibcdio='no'
fi
echores "$_libcdio"
}
EOF
_fontconfig=no
for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" ; do
_ld_tmp="-lfontconfig $_ld_tmp"
cc_check $_ld_tmp && _fontconfig=yes && _ld_extra="$_ld_extra $_ld_tmp" &&
break
done
if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
_inc_tmp=`$_pkg_config --cflags fontconfig`
_ld_tmp=`$_pkg_config --libs fontconfig`
cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
&& _ld_extra="$_ld_extra $_ld_tmp" && _inc_extra="$_inc_extra $_inc_tmp"
fi
fi
if test "$_fontconfig" = yes ; then
_def_fontconfig='#define HAVE_FONTCONFIG'
else
_def_fontconfig='#undef HAVE_FONTCONFIG'
fi
echores "$_fontconfig"
echocheck "ENCA"
if test "$_enca" = auto ; then
cat > $TMPC << EOF
#include <enca.h>
int main()
{
const char **langs;
size_t langcnt;
langs = enca_get_languages(&langcnt);
return 0;
}
EOF
_enca=no
cc_check -lenca $_ld_lm && _enca=yes
fi
if test "$_enca" = yes ; then
_def_enca='#define HAVE_ENCA 1'
_ld_extra="$_ld_extra -lenca"
else
_def_enca='#undef HAVE_ENCA'
fi
echores "$_enca"
echocheck "zlib"
cat > $TMPC << EOF
#include <zlib.h>
int main(void) { (void) inflate(0, Z_NO_FLUSH); return 0; }
EOF
_zlib=no
cc_check -lz && _zlib=yes
if test "$_zlib" = yes ; then
_def_zlib='#define HAVE_ZLIB 1'
_ld_extra="$_ld_extra -lz"
else
_def_zlib='#undef HAVE_ZLIB'
_libavdecoders=`echo $_libavdecoders | sed -e s/FLASHSV_DECODER// -e
s/PNG_DECODER// -e s/ZMBV_DECODER// -e s/DXA_DECODER// `
_libavencoders=`echo $_libavencoders | sed -e s/FLASHSV_ENCODER// -e
s/PNG_ENCODER// -e s/ZMBV_ENCODER// `
fi
echores "$_zlib"
echocheck "RTC"
if test "$_rtc" = auto ; then
cat > $TMPC << EOF
#include <sys/ioctl.h>
#ifdef __linux__
#include <linux/rtc.h>
#else
#include <rtc.h>
#define RTC_PIE_ON RTCIO_PIE_ON
#endif
int main(void) { return RTC_PIE_ON; }
EOF
_rtc=no
cc_check && _rtc=yes
ppc && _rtc=no
fi
if test "$_rtc" = yes ; then
_def_rtc='#define HAVE_RTC 1'
else
_def_rtc='#undef HAVE_RTC'
fi
echores "$_rtc"
echocheck "Twolame"
if test "$_twolame" = auto ; then
cat > $TMPC <<EOF
#include <twolame.h>
int main(void) { twolame_init(); return 0; }
EOF
_twolame=no
cc_check -ltwolame $_ld_lm && _twolame=yes
fi
if test "$_twolame" = yes ; then
_def_twolame='#define HAVE_TWOLAME 1'
_libs_mencoder="$_libs_mencoder -ltwolame"
_codecmodules="twolame $_codecmodules"
else
_def_twolame='#undef HAVE_TWOLAME'
_nocodecmodules="twolame $_nocodecmodules"
fi
echores "$_twolame"
echocheck "Toolame"
if test "$_toolame" = auto ; then
_toolame=no
if test "$_twolame" = yes ; then
_res_comment="disabled by twolame"
else
cat > $TMPC <<EOF
#include <toolame.h>
int main(void) { toolame_init(); return 0; }
EOF
cc_check -ltoolame $_ld_lm && _toolame=yes
fi
fi
if test "$_toolame" = yes ; then
_def_toolame='#define HAVE_TOOLAME 1'
_libs_mencoder="$_libs_mencoder -ltoolame"
_codecmodules="toolame $_codecmodules"
else
_def_toolame='#undef HAVE_TOOLAME'
_nocodecmodules="toolame $_nocodecmodules"
fi
if test "$_toolamedir" ; then
_res_comment="using $_toolamedir"
fi
echores "$_toolame"
theora_info_init (&inf);
theora_comment_init (&tc);
return 0;
/* we don't want to execute this kind of nonsense; just for making sure
* that compilation works... */
memset(&op, 0, sizeof(op));
r = theora_decode_header (&inf, &tc, &op);
r = theora_decode_init (&st, &inf);
t = theora_granule_time (&st, op.granulepos);
r = theora_decode_packetin (&st, &op);
r = theora_decode_YUVout (&st, &yuv);
theora_clear (&st);
return 0;
}
EOF
for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`"
"-ltheora -logg"; do
cc_check $_ld_theora && _ld_extra="$_ld_extra $_ld_theora" \
&& _theora=yes && break
done
if test "$_theora" = no && test "$_tremor_internal" = yes; then
for _ld_theora in "`$_pkg_config --silence-errors --libs --cflags theora`"
"-ltheora -logg"; do
cc_check -I. tremor/bitwise.c $_ld_theora \
&& _ld_extra="$_ld_extra $_ld_theora" && theora=yes && break
done
fi
fi
if test "$_theora" = yes ; then
_def_theora='#define HAVE_OGGTHEORA 1'
_codecmodules="libtheora $_codecmodules"
# when --enable-theora is forced, we'd better provide a probably sane
# $_ld_theora than nothing
test -z "$_ld_theora" && _ld_extra="$_ld_extra -ltheora -logg"
else
_def_theora='#undef HAVE_OGGTHEORA'
_nocodecmodules="libtheora $_nocodecmodules"
fi
echores "$_theora"
_live=no
for I in $_inc_extra "-I$_libdir/live" "-I/usr/lib/live" "-I/usr/local/live" "-I
/usr/local/lib/live" ; do
cxx_check $I/liveMedia/include $I/UsageEnvironment/include \
$I/groupsock/include && _livelibdir=`echo $I| sed s/-I//` && \
_ld_extra="$_livelibdir/liveMedia/libliveMedia.a \
$_livelibdir/groupsock/libgroupsock.a \
$_livelibdir/UsageEnvironment/libUsageEnvironment.a \
$_livelibdir/BasicUsageEnvironment/libBasicUsageEnvironment.a \
$_ld_extra -lstdc++" \
_inc_extraxx="-I$_livelibdir/liveMedia/include \
-I$_livelibdir/UsageEnvironment/include \
-I$_livelibdir/BasicUsageEnvironment/include \
-I$_livelibdir/groupsock/include" && \
_live=yes && break
done
if test "$_live" != yes ; then
if cxx_check -I/usr/include/liveMedia -I/usr/include/UsageEnvironment -I
/usr/include/groupsock; then
_live_dist=yes
fi
fi
fi
if test "$_live" = yes && test "$_network" = yes && test "$_nemesi" = no; then
_res_comment="using $_livelibdir"
_def_live='#define STREAMING_LIVE555 1'
_inputmodules="live555 $_inputmodules"
elif test "$_live_dist" = yes && test "$_network" = yes && test "$_nemesi" = no;
then
_res_comment="using distribution version"
_live="yes"
_def_live='#define STREAMING_LIVE555 1'
_ld_extra="$_ld_extra -lliveMedia -lgroupsock -lUsageEnvironment
-lBasicUsageEnvironment -lstdc++"
_inc_extraxx="-I/usr/include/liveMedia -I/usr/include/UsageEnvironment \
-I/usr/include/BasicUsageEnvironment -I/usr/include/groupsock"
_inputmodules="live555 $_inputmodules"
else
_live=no
_def_live='#undef STREAMING_LIVE555'
_noinputmodules="live555 $_noinputmodules"
fi
echores "$_live"
echocheck "libdv-0.9.5+"
if test "$_libdv" = auto ; then
_libdv=no
cat > $TMPC <<EOF
#include <libdv/dv.h>
int main(void) { dv_encoder_t* enc=dv_encoder_new(1,1,1); return 0; }
EOF
cc_check -ldv $_ld_pthread $_ld_lm && _libdv=yes
fi
if test "$_libdv" = yes ; then
_def_libdv='#define HAVE_LIBDV095 1'
_ld_extra="$_ld_extra -ldv"
_codecmodules="libdv $_codecmodules"
else
_def_libdv='#undef HAVE_LIBDV095'
_nocodecmodules="libdv $_nocodecmodules"
fi
echores "$_libdv"
echocheck "XviD"
if test "$_xvid" = auto ; then
_xvid=no
cat > $TMPC << EOF
#include <xvid.h>
int main(void) { xvid_global(0, 0, 0, 0); return 0; }
EOF
for _ld_tmp in "-lxvidcore $_ld_lm" "-lxvidcore $_ld_lm $_ld_pthread" ; do
cc_check $_ld_tmp && _ld_extra="$_ld_extra $_ld_tmp" && _xvid=yes && break
done
fi
echocheck "x264"
if test "$_x264" = auto ; then
cat > $TMPC << EOF
#include <inttypes.h>
#include <x264.h>
#if X264_BUILD < 53
#error We do not support old versions of x264. Get the latest from SVN.
#endif
int main(void) { x264_encoder_open((void*)0); return 0; }
EOF
_x264=no
for _ld_x264 in "-lx264 $_ld_pthread" "-lx264 $_ld_pthread $_ld_lm" ; do
cc_check $_ld_x264 && _libs_mencoder="$_libs_mencoder $_ld_x264" && _x264=yes
&& break
done
fi
echocheck "libnut"
if test "$_libnut" = auto ; then
cat > $TMPC << EOF
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <libnut.h>
int main(void) { (void)nut_error(0); return 0; }
EOF
_libnut=no
cc_check -lnut && _libnut=yes
fi
fi
echocheck "mencoder"
_mencoder_flag='#undef HAVE_MENCODER'
if test "$_mencoder" = yes ; then
_mencoder_flag='#define HAVE_MENCODER'
_def_muxers='#define CONFIG_MUXERS 1'
else
# mpeg1video for vf_lavc, snow for vf_uspp and vf_mcdeint
_libavencoders="MPEG1VIDEO_ENCODER SNOW_ENCODER"
_libavmuxers=""
fi
echores "$_mencoder"
echocheck "fastmemcpy"
# fastmemcpy check is done earlier with tests of CPU & binutils features
if test "$_fastmemcpy" = yes ; then
_def_fastmemcpy='#define USE_FASTMEMCPY 1'
else
_def_fastmemcpy='#undef USE_FASTMEMCPY'
fi
echores "$_fastmemcpy"
if bsd; then
echocheck "*BSD BT848 bt8xx header"
_ioctl_bt848_h=no
for file in "machine/ioctl_bt848.h" \
"dev/bktr/ioctl_bt848.h" \
"dev/video/bktr/ioctl_bt848.h" \
"dev/ic/bt8xx.h" ; do
cat > $TMPC <<EOF
#include <sys/types.h>
#include <$file>
int main(void) {
ioctl(0, TVTUNER_GETFREQ, 0);
return 0;
}
EOF
if cc_check ; then
_ioctl_bt848_h=yes
_ioctl_bt848_h_name="$file"
break;
fi
done
if test "$_ioctl_bt848_h" = yes ; then
_def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
_res_comment="using $_ioctl_bt848_h_name"
else
_def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
fi
echores "$_ioctl_bt848_h"
if bsd && test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
echocheck "*BSD BrookTree 848 Radio interface"
_radio_bsdbt848=no
cat > $TMPC <<EOF
#include <sys/types.h>
$_def_ioctl_bt848_h_name
#ifdef IOCTL_BT848_H_NAME
#include IOCTL_BT848_H_NAME
#endif
int main(void){
ioctl(0, RADIO_GETFREQ, 0);
return 0;
}
EOF
cc_check && _radio_bsdbt848=yes
echores "$_radio_bsdbt848"
fi #if bsd && radio && radio_bsdbt848
echocheck "ftp"
if not beos && test "$_ftp" = yes ; then
_def_ftp='#define HAVE_FTP 1'
_inputmodules="ftp $_inputmodules"
else
_noinputmodules="ftp $_noinputmodules"
_def_ftp='#undef HAVE_FTP'
fi
echores "$_ftp"
# endian testing
echocheck "byte order"
if test "$_big_endian" = auto ; then
cat > $TMPC <<EOF
short ascii_name[] =
{ (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
(('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),
0};
int main(){
return (int)ascii_name;
}
EOF
if cc_check ; then
if strings $TMPEXE | grep -l MPlayerBigEndian >/dev/null ; then
_big_endian=yes
else
_big_endian=no
fi
else
echo ${_echo_n} "failed to autodetect byte order, defaulting to ${_echo_c}"
fi
fi
if test "$_big_endian" = yes ; then
_byte_order='big-endian'
_def_words_endian='#define WORDS_BIGENDIAN 1'
else
_byte_order='little-endian'
_def_words_endian='#undef WORDS_BIGENDIAN'
fi
echores "$_byte_order"
echocheck "inet6"
if test "$_inet6" = auto ; then
cat > $TMPC << EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6);
}
EOF
_inet6=no
if cc_check ; 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 <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
int main(void) { gethostbyname2("", AF_INET); }
EOF
_gethostbyname2=no
if cc_check ; then
_gethostbyname2=yes
fi
fi
# Required libraries
if test "$_libavcodec" != yes ||
not "echo $_libavdecoders | grep PNG_DECODER >/dev/null 2>&1" ; then
die "The GUI requires libavcodec with PNG support (needs zlib)."
fi
if not win32 ; then
test "$_x11" != yes && die "X11 support required for GUI compilation."
#############################################################################
_def_debug='#undef MP_DEBUG'
test "$_debug" != "" && _def_debug='#define MP_DEBUG 1'
_def_linux='#undef TARGET_LINUX'
linux && _def_linux='#define TARGET_LINUX 1'
echocheck "joystick"
_def_joystick='#undef HAVE_JOYSTICK'
if test "$_joystick" = yes ; then
if linux ; then
# TODO add some check
_def_joystick='#define HAVE_JOYSTICK 1'
else
_joystick="no (unsupported under $system_name)"
fi
fi
echores "$_joystick"
echocheck "lirc"
if test "$_lirc" = auto ; then
_lirc=no
cat > $TMPC <<EOF
#include <lirc/lirc_client.h>
int main(void) { return 0; }
EOF
cc_check -llirc_client && _lirc=yes
fi
if test "$_lirc" = yes ; then
_def_lirc='#define HAVE_LIRC 1'
_ld_extra="$_ld_extra -llirc_client"
else
_def_lirc='#undef HAVE_LIRC'
fi
echores "$_lirc"
echocheck "lircc"
if test "$_lircc" = auto ; then
_lircc=no
cat > $TMPC <<EOF
#include <lirc/lircc.h>
int main(void) { return 0; }
EOF
cc_check -llircc && _lircc=yes
fi
if test "$_lircc" = yes ; then
_def_lircc='#define HAVE_LIRCC 1'
_ld_extra="$_ld_extra -llircc"
else
_def_lircc='#undef HAVE_LIRCC'
fi
echores "$_lircc"
if arm; then
# Detect maemo development platform libraries availability (http://www.maemo.org),
# they are used when run on Nokia 770
echocheck "maemo (Nokia 770)"
if test "$_maemo" = auto ; then
_maemo=no
cat > $TMPC << EOF
#include <libosso.h>
int main(void) { (void) osso_initialize("", "", 0, NULL); return 0; }
EOF
cc_check `$_pkg_config --cflags --libs libosso 2>/dev/null` && _maemo=yes
fi
if test "$_maemo" = yes ; then
_def_maemo='#define HAVE_MAEMO 1'
_inc_extra="$_inc_extra `$_pkg_config --cflags libosso`"
_ld_extra="$_ld_extra `$_pkg_config --libs libosso` -lXsp"
else
_def_maemo='#undef HAVE_MAEMO'
fi
echores "$_maemo"
fi
#############################################################################
if darwin ; then
CFLAGS="$CFLAGS -mdynamic-no-pic -falign-loops=16 -DSYS_DARWIN -shared-libgcc"
if [ "$_cc_major" = 3 ] && [ "$_cc_minor" -lt 1 ]; then
CFLAGS="$CFLAGS -no-cpp-precomp"
fi
fi
if amigaos ; then
CFLAGS="$CFLAGS -DNEWLIB -D__USE_INLINE__ -DSYS_AMIGAOS4"
fi
if hpux ; then
# use flag for HPUX missing setenv()
CFLAGS="$CFLAGS -DHPUX"
fi
# Thread support
if linux ; then
CFLAGS="$CFLAGS -D_REENTRANT"
elif bsd ; then
# FIXME bsd needs this so maybe other OS'es
CFLAGS="$CFLAGS -D_THREAD_SAFE"
fi
if cygwin ; then
CFLAGS="$CFLAGS -D__CYGWIN__"
fi
# 64 bit file offsets?
if test "$_largefiles" = yes || freebsd ; then
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
if test "$_dvdread" = yes || test "$_libdvdcss_internal" = yes ; then
# dvdread support requires this (for off64_t)
CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
cygwin && CFLAGS="$CFLAGS -DSYS_CYGWIN"
fi
fi
#this must be the last test to be performed or the ones following it will likely
fail
#because libdvdnavmini is intentionally not linked against libdvdread (to permit
mplayer
# to use its own copy of the library)
echocheck "DVD support (libdvdnav)"
if test "$_dvdnav" = auto ; then
$_dvdnavconfig --version --minilibs >> $TMPLOG 2>&1 || _dvdnav=no
fi
if test "$_dvdnav" = auto ; then
cat > $TMPC <<EOF
#include <inttypes.h>
#include <dvdnav.h>
int main(void) { dvdnav_t *dvd=0; return 0; }
EOF
_dvdnav=no
_dvdnavdir=`$_dvdnavconfig --cflags`
_dvdnavlibs=`$_dvdnavconfig --libs`
_dvdnavvsn=`$_dvdnavconfig --version | sed "s/\.//g"`
_dvdnavmajor=`echo $_dvdnavvsn | cut -d. -f2`
test "$_dvdnavmajor" -ge 2 -o "$_dvdnavvsn" -ge 0110 && \
cc_check $_dvdnavdir $_dvdnavlibs $_ld_dl $_ld_pthread && _dvdnav=yes
fi
if test "$_dvdnav" = yes ; then
_largefiles=yes
_def_dvdnav='#define USE_DVDNAV 1'
_dvdnav_version=`$_dvdnavconfig --version | sed "s/\.//g"`
_def_dvdnav_version="#define DVDNAVVERSION $_dvdnav_version"
_inc_extra="$_inc_extra `$_dvdnavconfig --cflags`"
_ld_extra="$_ld_extra `$_dvdnavconfig --minilibs`"
_inputmodules="dvdnav $_inputmodules"
else
_def_dvdnav='#undef USE_DVDNAV'
_noinputmodules="dvdnav $_noinputmodules"
fi
echores "$_dvdnav"
#############################################################################
echo "Creating config.mak"
cat > config.mak << EOF
# -------- Generated by configure -----------
LANG = C
MAN_LANG = $MAN_LANG
TARGET_OS = $system_name
DESTDIR =
prefix = \$(DESTDIR)$_prefix
BINDIR = \$(DESTDIR)$_bindir
DATADIR = \$(DESTDIR)$_datadir
MANDIR = \$(DESTDIR)$_mandir
CONFDIR = \$(DESTDIR)$_confdir
LIBDIR = \$(DESTDIR)$_libdir
# FFmpeg uses libdir instead of LIBDIR
libdir = \$(LIBDIR)
AR = $_ar
CC = $_cc
CXX = $_cc
HOST_CC = $_host_cc
RANLIB = $_ranlib
LDCONFIG = $_ldconfig
INSTALL = $_install
EXTRA_INC = $_inc_extra
EXTRAXX_INC = $_inc_extra $_inc_extraxx
OPTFLAGS = $CFLAGS \$(EXTRA_INC)
CXXFLAGS = $CXXFLAGS \$(EXTRAXX_INC)
CFLAG_STACKREALIGN = $_stackrealign
INSTALLSTRIP = $_install_strip
CHARSET = $_charset
HELP_FILE = $_mp_help
EXESUF = $_exesuf
MPLAYER_NETWORK = $_network
FTP = $_ftp
STREAMING_LIVE555 = $_live
LIBNEMESI = $_nemesi
NATIVE_RTSP = $_native_rtsp
VSTREAM = $_vstream
STREAM_CACHE = $_stream_cache
DVBIN = $_dvbin
VIDIX = $_vidix
VIDIX_INTERNAL = $_vidix_internal
VIDIX_EXTERNAL = $_vidix_external
CONFIG_PP = yes
MP3LAME = $_mp3lame
LIBMENU = $_menu
MP3LIB = $_mp3lib
LIBA52 = $_liba52
LIBMPEG2 = $_libmpeg2
TREMOR_INTERNAL = $_tremor_internal
TREMOR_LOW = $_tremor_low
FAAD = $_faad
SPEEX = $_speex
MUSEPACK = $_musepack
UNRARLIB = $_unrarlib
PNG = $_png
JPEG = $_jpeg
GIF = $_gif
EXTRALIBS = $_extra_libs
EXTRA_LIB = $_ld_extra $_ld_static $_ld_lm
EXTRALIBS_MPLAYER = $_libs_mplayer
EXTRALIBS_MENCODER = $_libs_mencoder
HAVE_MLIB = $_mlib
HAVE_PTHREADS = $_pthreads
HAVE_W32THREADS = $_w32threads
HAVE_XVMC_ACCEL = $_xvmc
HAVE_SYS_MMAN_H = $_mman
HAVE_POSIX_SELECT = $_posix_select
NEED_GETTIMEOFDAY = $_need_gettimeofday
NEED_GLOB = $_need_glob
NEED_SETENV = $_need_setenv
NEED_SHMEM = $_need_shmem
NEED_STRSEP = $_need_strsep
NEED_SWAB = $_need_swab
NEED_VSSCANF = $_need_vsscanf
# for FFmpeg
SRC_PATH=..
BUILD_ROOT=..
LIBPREF=lib
LIBSUF=.a
LIB=\$(LIBPREF)\$(NAME)\$(LIBSUF)
# audio output
OSS = $_ossaudio
ALSA = $_alsa
ALSA5 = $_alsa5
ALSA9 = $_alsa9
ALSA1X = $_alsa1x
# input/demuxer/codecs
JOYSTICK = $_joystick
LIRC = $_lirc
APPLE_REMOTE = $_apple_remote
TV = $_tv
TV_V4L = $_tv_v4l
TV_V4L1 = $_tv_v4l1
TV_V4L2 = $_tv_v4l2
TV_BSDBT848 = $_tv_bsdbt848
TV_TELETEXT = $_tv_teletext
AUDIO_INPUT = $_audio_input
PVR = $_pvr
VCD = $_vcd
DVDREAD = $_dvdread
DVDREAD_INTERNAL = $_dvdread_internal
DVDCSS_INTERNAL = $_libdvdcss_internal
DVDNAV = $_dvdnav
WIN32DLL = $_win32dll
QTX_CODECS = $_qtx
REAL_CODECS = $_real
XANIM_CODECS = $_xanim
LIBAVUTIL = $_libavutil
LIBAVUTIL_A = $_libavutil_a
LIBAVUTIL_SO = $_libavutil_so
LIBAVCODEC = $_libavcodec
LIBAVCODEC_A = $_libavcodec_a
LIBAVCODEC_SO = $_libavcodec_so
LIBAVFORMAT = $_libavformat
LIBAVFORMAT_A = $_libavformat_a
LIBAVFORMAT_SO = $_libavformat_so
LIBPOSTPROC = $_libpostproc
LIBPOSTPROC_A = $_libpostproc_a
LIBPOSTPROC_SO = $_libpostproc_so
ZORAN = $_zr
LIBLZO = $_liblzo
LIBDV = $_libdv
XVID4 = $_xvid
X264 = $_x264
LIBNUT = $_libnut
LIBDCA = $_libdca
MPLAYER = $_mplayer
MENCODER = $_mencoder
CDDA = $_cdda
CDDB = $_cddb
BITMAP_FONT = $_bitmap_font
FREETYPE = $_freetype
ASS = $_ass
LIBMAD = $_mad
LIBVORBIS = $_vorbis
LIBTHEORA = $_theora
FAAD_INTERNAL = $_faad_internal
FAAD_FIXED = $_faad_fixed
LIBSMBCLIENT = $_smbsupport
XMMS_PLUGINS = $_xmms
MACOSX = $_macosx
MACOSX_FINDER_SUPPORT = $_macosx_finder_support
MACOSX_BUNDLE = $_macosx_bundle
MACOSX_COREVIDEO = $_macosx_corevideo
TOOLAME=$_toolame
TWOLAME=$_twolame
FAAC=$_faac
CONFIG_LIBAMR=$_libamr
CONFIG_LIBAMR_NB=$_libamr_nb
CONFIG_LIBAMR_WB=$_libamr_wb
`echo $_libavdecoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
`echo $_libavencoders | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
`echo $_libavparsers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
`echo $_libavdemuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
`echo $_libavmuxers | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
`echo $_libavbsfs | tr '[a-z] ' '[A-Z]\n' | sed 's/^/CONFIG_/;s/$/=yes/'`
CONFIG_LIBFAAC=$_lavc_faac
CONFIG_LIBMP3LAME=$_lavc_mp3lame
CONFIG_LIBXVID=$_lavc_xvid
CONFIG_LIBX264=$_lavc_x264
CONFIG_ZLIB=$_zlib
CONFIG_GPL=yes
CONFIG_ENCODERS=$_mencoder
CONFIG_MUXERS=$_mencoder
RADIO=$_radio
RADIO_CAPTURE=$_radio_capture
VIDIX_CYBERBLADE=$_vidix_drv_cyberblade
VIDIX_IVTV=$_vidix_drv_ivtv
VIDIX_MACH64=$_vidix_drv_mach64
VIDIX_MGA=$_vidix_drv_mga
VIDIX_MGA_CRTC2=$_vidix_drv_mga_crtc2
VIDIX_NVIDIA=$_vidix_drv_nvidia
VIDIX_PM2=$_vidix_drv_pm2
VIDIX_PM3=$_vidix_drv_pm3
VIDIX_RADEON=$_vidix_drv_radeon
VIDIX_RAGE128=$_vidix_drv_rage128
VIDIX_SAVAGE=$_vidix_drv_savage
VIDIX_SIS=$_vidix_drv_sis
VIDIX_UNICHROME=$_vidix_drv_unichrome
EOF
#############################################################################
ff_config_enable () {
_nprefix=$3;
test -z "$_nprefix" && _nprefix='CONFIG'
for part in $1; do
if ` echo $2 | grep -E "(^| )$part($| )" > /dev/null `; then
echo "#define ${_nprefix}_$part 1"
echo "#define ENABLE_$part 1"
else
echo "#define ENABLE_$part 0"
fi
done
}
/* make sure we never get lavformat's poll() emulation, the results are
horrible if the X libs try to actually use it, see MPlayer-users
Message-ID: <45D49541.8060101@infernix.net>
Date: Thu, 15 Feb 2007 18:15:45 +0100
Subject: [MPlayer-users] Crash with backtrace when playing back demuxed...
*/
#define HAVE_SYS_POLL_H 1
/* int_fastXY_t emulation */
$_def_fast_inttypes
/* libdvdcss */
#define HAVE_ERRNO_H 1
/* libdvdcss + libdvdread */
#define HAVE_LIMITS_H 1
/* libdvdcss + libfaad2 */
#define HAVE_UNISTD_H 1
/* libfaad2 + libdvdread */
#define STDC_HEADERS 1
/* libfaad2 */
#define HAVE_MEMCPY 1
#define HAVE_STRCHR 1
/* libdvdread */
#define HAVE_UINTPTR_T 1
/* "restrict" keyword */
$_def_restrict_keyword
/* enable/disable SIGHANDLER */
$_def_sighandler
/* If build mencoder */
$_mencoder_flag
/* Undefine this if you do not want to select mono audio (left or right)
with a stereo MPEG layer 2/3 audio stream. The command line option
-stereo has three possible values (0 for stereo, 1 for left-only, 2 for
right-only), with 0 being the default.
*/
#define USE_FAKE_MONO 1
/* set up max. outburst. use 65536 for ALSA 0.5, for others 16384 is enough */
#define MAX_OUTBURST 65536
/* Define this if your system has the header file for the OSS sound interface */
$_def_sys_soundcard
/* Define this if your system has the header file for the OSS sound interface
* in /usr/include */
$_def_soundcard
/* Define this if you have the elf dynamic linker -ldl library */
$_def_dl
/*
* LIRCCD (LIRC client daemon)
* See http://www.dolda2000.cjb.net/~fredrik/lirccd/
*/
$_def_lircc
/* Define this to enable MPEG 1/2 image postprocessing (requires a FAST CPU!) */
#define MPEG12_POSTPROC 1
$_def_libavutil
$_def_libavutil_a
$_def_libavutil_so
/* Use these registers in FFmpeg x86 inline asm. No proper detection yet. */
#define HAVE_EBX_AVAILABLE 1
#ifndef MP_DEBUG
#define HAVE_EBP_AVAILABLE 1
#endif
#define CONFIG_GPL 1
#define ENABLE_SMALL 0
$_def_lavc_faac
$_def_lavc_xvid
$_def_lavc_mp3lame
$_def_lavc_x264
/* Enable fast OSD/SUB renderer (looks ugly, but uses less CPU power) */
#undef FAST_OSD
#undef FAST_OSD_TABLE
/* For the PPC. G5 has the dcbzl when in 64bit mode but G4s and earlier do not
have the instruction. */
$_def_dcbzl
/* Define this to any prefered value from 386 up to infinity with step 100 */
#define __CPU__ $iproc
$_mp_wordsize
$_def_linux
$_def_vcd
#ifdef sun
#define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
#define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
#elif defined(HPUX)
#define DEFAULT_CDROM_DEVICE "/dev/cdrom"
#define DEFAULT_DVD_DEVICE "/dev/dvd"
#elif defined(WIN32)
#define DEFAULT_CDROM_DEVICE "D:"
#define DEFAULT_DVD_DEVICE "D:"
#elif defined(SYS_DARWIN)
#define DEFAULT_CDROM_DEVICE "/dev/disk1"
#define DEFAULT_DVD_DEVICE "/dev/rdiskN"
#elif defined(__OpenBSD__)
#define DEFAULT_CDROM_DEVICE "/dev/rcd0a"
#define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#define DEFAULT_CDROM_DEVICE "/dev/acd0"
#define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
#elif defined(SYS_AMIGAOS4)
#define DEFAULT_CDROM_DEVICE "a1ide.device:2"
#define DEFAULT_DVD_DEVICE DEFAULT_CDROM_DEVICE
#else
#define DEFAULT_CDROM_DEVICE "/dev/cdrom"
#define DEFAULT_DVD_DEVICE "/dev/dvd"
#endif
/*----------------------------------------------------------------------------
**
** NOTE: Instead of modifying these definitions here, use the
** --enable/--disable options of the ./configure script!
** See ./configure --help for details.
**
*---------------------------------------------------------------------------*/
/* mkstemp support */
$_def_mkstemp
/* nanosleep support */
$_def_nanosleep
/* SMB support */
$_def_smbsupport
/* liblzo support */
$_def_liblzo
#ifdef USE_LIBLZO
#define CONFIG_LZO 1
#endif
/* libmad support */
$_def_mad
/* enable network */
$_def_network
/* do we have gethostbyname2? */
$_def_gethostbyname2
/* Extension defines */
`ff_config_enable "$_cpuexts_all" "$_cpuexts" "HAVE"`
/* libvo options */
#define SCREEN_SIZE_X 1
#define SCREEN_SIZE_Y 1
$_def_x11
$_def_xv
$_def_xvmc
$_def_vm
$_def_xf86keysym
$_def_xinerama
$_def_gl
$_def_gl_win32
$_def_dga
$_def_dga1
$_def_dga2
$_def_sdl
/* defined for SDLlib with keyrepeat bugs (before 1.2.1) */
$_def_sdlbuggy
$_def_directx
$_def_ggi
$_def_ggiwmh
$_def_3dfx
$_def_s3fb
$_def_tdfxfb
$_def_tdfxvid
$_def_xvr100
$_def_directfb
$_def_directfb_version
$_def_dfbmga
$_def_zr
$_def_bl
$_def_mga
$_def_xmga
$_def_fbdev
$_def_dxr2
$_def_dxr3
$_def_ivtv
$_def_v4l2
$_def_dvb
$_def_dvb_in
$_def_svga
$_def_vesa
$_def_xdpms
$_def_aa
$_def_caca
$_def_tga
$_def_toolame
$_def_twolame
/* used by GUI: */
$_def_xshape
#endif /* MPLAYER_CONFIG_H */
EOF
#############################################################################
Languages:
Messages/GUI: $_language
EOF
'make' will now compile MPlayer and 'make install' will install it.
Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
EOF
EOF
fi
cat <<EOF
Check $TMPLOG if you wonder why an autodetection failed (make sure
development headers/packages are installed).
EOF
*** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
EOF
fi
# Last move:
rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP" "$TMPH"