2001-10-25 13:46:50 +02:00
#! /bin/sh
2001-06-04 10:07:57 +02:00
#
2014-05-14 20:29:00 +02:00
# Original version (C) 2000 Pontscho/fresh!mindworkz pontscho@makacs.poliod.hu
2001-11-17 04:53:05 +01:00
# Cleanups all over the place (c) 2001 pl
2014-05-14 20:29:00 +02:00
# Rewritten for mpv in 2014.
2001-04-18 00:04:44 +02:00
#
2006-04-27 16:26:57 +02:00
# 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.
2006-07-12 19:28:14 +02:00
# - config.mak is included from the Makefiles.
2006-04-27 16:26:57 +02:00
#
2010-09-26 21:33:48 +02:00
# If you want to add a new check for $feature, look at the existing checks
# and try to use helper functions where you can.
2001-11-17 04:53:05 +01:00
#############################################################################
2001-02-24 21:28:24 +01:00
2005-05-09 23:39:17 +02:00
# Prevent locale nonsense from breaking basic text processing utils
2008-10-04 19:15:39 +02:00
export LC_ALL=C
2005-05-09 23:39:17 +02:00
2006-11-28 19:29:24 +01:00
# Store the configure line that was used
2010-06-09 11:27:29 +02:00
configuration="$*"
2006-11-28 19:29:24 +01:00
2001-11-17 04:53:05 +01:00
# Prefer these macros to full length text !
# These macros only return an error code - NO display is done
2012-08-16 11:08:38 +02:00
command_check() {
echo >> "$TMPLOG"
echo "$@" >> "$TMPLOG"
"$@" >> "$TMPLOG" 2>&1
TMPRES="$?"
echo >> "$TMPLOG"
return "$TMPRES"
}
2005-10-18 23:30:43 +02:00
compile_check() {
2010-05-30 14:14:40 +02:00
source="$1"
shift
2001-11-19 01:38:41 +01:00
echo >> "$TMPLOG"
2010-05-30 14:14:40 +02:00
cat "$source" >> "$TMPLOG"
2001-11-17 04:53:05 +01:00
echo >> "$TMPLOG"
2014-05-14 20:29:00 +02:00
echo "$_cc $OURCFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
2007-08-14 16:52:22 +02:00
rm -f "$TMPEXE"
2014-05-14 20:29:00 +02:00
$_cc $OURCFLAGS $CFLAGS "$source" $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o "$TMPEXE" $@ >> "$TMPLOG" 2>&1
2009-03-27 18:14:58 +01:00
TMPRES="$?"
2001-11-19 01:38:41 +01:00
echo >> "$TMPLOG"
echo >> "$TMPLOG"
2009-03-27 18:14:58 +01:00
return "$TMPRES"
2001-10-13 18:53:37 +02:00
}
2010-07-02 01:03:40 +02:00
cflag_check() {
2014-05-14 20:29:00 +02:00
echo "int main(void) { return 0; }" > $TMPC
compile_check $TMPC $@
2011-01-20 12:21:34 +01:00
}
2010-09-27 02:02:59 +02:00
statement_check() {
2014-05-14 20:29:00 +02:00
echo "" > $TMPC
for _header in $1 ; do echo "#include <$_header>" >> $TMPC ; done
echo "int main(void) { $2; return 0; }" >> $TMPC
shift 2
compile_check $TMPC $@
2010-09-18 11:49:12 +02:00
}
2012-02-27 14:51:35 +01:00
pkg_config_add() {
echo >> "$TMPLOG"
echo "$_pkg_config --cflags $@" >> "$TMPLOG"
ctmp=$($_pkg_config --cflags "$@" 2>> "$TMPLOG") || return $?
echo >> "$TMPLOG"
echo "$_pkg_config --libs $@" >> "$TMPLOG"
ltmp=$($_pkg_config --libs "$@" 2>> "$TMPLOG") || return $?
echo >> "$TMPLOG"
echo "cflags: $ctmp" >> "$TMPLOG"
echo "libs: $ltmp" >> "$TMPLOG"
echo >> "$TMPLOG"
extra_cflags="$extra_cflags $ctmp"
2012-12-19 13:01:56 +01:00
libs_mplayer="$libs_mplayer $ltmp"
2012-02-27 14:51:35 +01:00
}
2001-11-17 04:53:05 +01:00
# Display error message, flushes tempfile, exit
2001-10-13 22:14:05 +02:00
die () {
2001-11-17 04:53:05 +01:00
echo
echo "Error: $@" >&2
echo >&2
2014-05-14 20:29:00 +02:00
rm -f "$TMPEXE" "$TMPC"
2003-01-18 06:41:41 +01:00
echo "Check \"$TMPLOG\" if you do not understand why it failed."
2001-11-17 04:53:05 +01:00
exit 1
2001-10-13 18:53:37 +02:00
}
2001-11-17 04:53:05 +01:00
# Use this before starting a check
echocheck() {
echo "============ Checking for $@ ============" >> "$TMPLOG"
2002-02-05 23:57:17 +01:00
echo ${_echo_n} "Checking for $@ ... ${_echo_c}"
2001-11-17 04:53:05 +01:00
}
# Use this to echo the results of a check
echores() {
2014-05-14 20:29:00 +02:00
test "$res_comment" && res_comment="($res_comment)"
2010-05-09 13:20:15 +02:00
echo "Result is: $@ $res_comment" >> "$TMPLOG"
2001-11-17 04:53:05 +01:00
echo "##########################################" >> "$TMPLOG"
echo "" >> "$TMPLOG"
2010-05-09 13:20:15 +02:00
echo "$@ $res_comment"
res_comment=""
2001-11-17 04:53:05 +01:00
}
2001-02-24 21:28:24 +01:00
2001-06-05 20:40:44 +02:00
# Check how echo works in this /bin/sh
2009-04-15 22:00:26 +02:00
case $(echo -n) in
2010-01-04 13:24:07 +01:00
-n) _echo_n= _echo_c='\c' ;; # SysV echo
*) _echo_n='-n ' _echo_c= ;; # BSD echo
2001-06-05 20:40:44 +02:00
esac
2014-05-14 20:29:00 +02:00
# setind $a b sets the variable named by the value of the variable a to b
setind() { eval "$1=\"\$2\"" ; }
# Generate --enable-NAME/--disable-NAME options, set $1 to the option value.
# Since shell has no data structures, do a weird statemachine thing.
# Arguments: "_name"($1) "description"($2) "default"($3)
# If "default"($3) is empty, use "auto"
# Option name: a leading "_" in name is stripped, further "_" are changed to "-"
opt_yes_no() {
_name=$(echo "$1" | sed 's/^_//' | tr _ -)
_defval="$3"
test -z "$_defval" && _defval=auto
case "$_opt_state_mode" in
init)
setind "$1" "$_defval"
;;
help)
if test "$_defval" = yes || test "$_defval" = auto ; then
_defdesc=enable
test "$_defval" = auto && _defdesc=auto
printf " %-21s disable $2 [$_defdesc]\n" "--disable-$_name"
unset _defdesc
else
printf " %-21s enable $2 [disable]\n" "--enable-$_name"
fi
;;
parse)
if test "$_opt_state_name" = "--enable-$_name" ; then
setind "$1" yes
_opt_state_known=yes
elif test "$_opt_state_name" = "--disable-$_name" ; then
setind "$1" no
_opt_state_known=yes
elif test "$_opt_state_name" = "--auto-$_name" ; then
setind "$1" auto
_opt_state_known=yes
fi
;;
esac
unset _name
unset _defval
}
options_state_machine() {
_opt_state_mode=$1
_opt_state_name=$2
_opt_state_known=no
opt_yes_no _gl "OpenGL video output"
opt_yes_no _libguess "libguess"
2014-08-21 22:24:43 +02:00
opt_yes_no _terminfo "terminfo database for key codes" no
opt_yes_no _termcap "termcap database for key codes" no
2014-05-14 20:29:00 +02:00
opt_yes_no _termios "termios database for key codes"
opt_yes_no _iconv "iconv for encoding conversion"
opt_yes_no _lirc "LIRC (remote control) support"
opt_yes_no _joystick "joystick support" no
opt_yes_no _vm "X video mode extensions"
opt_yes_no _dvb "DVB input"
opt_yes_no _tv "TV interface (TV/DVB grabbers)" yes
opt_yes_no _tv_v4l2 "Video4Linux2 TV interface"
opt_yes_no _libv4l2 "libv4l2"
opt_yes_no _pvr "Video4Linux2 MPEG PVR"
opt_yes_no _smb "Samba (SMB) input"
opt_yes_no _libquvi4 "libquvi 0.4.x"
opt_yes_no _libquvi9 "libquvi 0.9.x"
opt_yes_no _lcms2 "LCMS2 support"
2014-07-15 01:49:02 +02:00
opt_yes_no _bluray "Blu-ray support"
opt_yes_no _dvdread "libdvdread"
opt_yes_no _dvdnav "libdvdnav"
2014-05-14 20:29:00 +02:00
opt_yes_no _enca "ENCA charset oracle library"
opt_yes_no _libass "subtitle rendering with libass"
opt_yes_no _libpostproc "postprocess filter (vf_pp)"
opt_yes_no _libavdevice "libavdevice demuxers"
opt_yes_no _libavfilter "libavfilter"
opt_yes_no _vapoursynth "VapourSynth filter bridge"
opt_yes_no _jpeg "support for writing JPEG screenshots"
opt_yes_no _libcdio "libcdio support"
opt_yes_no _ffmpeg "skip FFmpeg/Libav autodetection"
opt_yes_no _ladspa "LADSPA plugin support"
opt_yes_no _libbs2b "libbs2b audio filter support"
opt_yes_no _mpg123 " libmpg123 MP3 decoding support"
opt_yes_no _libavresample "libavresample (preferred over libswresample)"
opt_yes_no _libswresample "libswresample"
opt_yes_no _caca "CACA video output"
opt_yes_no _sdl2 "SDL2 video and audio outputs" no
opt_yes_no _xv "Xv video output"
opt_yes_no _vdpau "VDPAU acceleration"
opt_yes_no _vaapi "VAAPI acceleration"
2014-08-16 21:43:13 +02:00
opt_yes_no _xrandr "Xrandr support (used for monitor FPS detection)"
2014-05-14 20:29:00 +02:00
opt_yes_no _xinerama "Xinerama support"
opt_yes_no _x11 "X11 video output"
opt_yes_no _wayland "Wayland video output"
opt_yes_no _xss "support for disabling screensaver via xss"
opt_yes_no _alsa "ALSA audio output"
opt_yes_no _ossaudio "OSS audio output"
opt_yes_no _rsound "RSound audio output"
opt_yes_no _sndio "sndio audio output"
opt_yes_no _pulse "Pulseaudio audio output"
opt_yes_no _portaudio "PortAudio audio output"
opt_yes_no _jack "JACK audio output"
opt_yes_no _openal "OpenAL audio output"
opt_yes_no _shm "X11/Xv shared memory"
opt_yes_no _lua "Lua scripting"
opt_yes_no _encoding "encoding functionality" yes
opt_yes_no _build_man "building manpage"
}
2001-06-05 20:40:44 +02:00
2006-06-16 20:38:35 +02:00
show_help(){
cat << EOF
2001-11-17 04:53:05 +01:00
Usage: $0 [OPTIONS]...
2001-02-24 21:28:24 +01:00
2001-10-23 20:32:55 +02:00
Configuration:
-h, --help display this help and exit
Installation directories:
2006-11-06 01:09:07 +01:00
--prefix=DIR prefix directory for installation [/usr/local]
--bindir=DIR directory for installing binaries [PREFIX/bin]
--datadir=DIR directory for installing machine independent
2012-10-11 02:04:08 +02:00
data files (skins, etc) [PREFIX/share/mpv]
2007-09-16 19:48:20 +02:00
--mandir=DIR directory for installing man pages [PREFIX/share/man]
2006-11-06 01:09:07 +01:00
--confdir=DIR directory for installing configuration files
2012-10-11 02:04:08 +02:00
[PREFIX/etc/mpv]
2001-10-23 20:32:55 +02:00
2014-05-14 20:29:00 +02:00
Compilation options:
2012-10-11 02:04:08 +02:00
--cc=COMPILER C compiler to build mpv [gcc]
2012-01-31 08:30:09 +01:00
--pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
2006-11-06 01:18:06 +01:00
--enable-static build a statically linked binary
2014-05-14 20:29:00 +02:00
--disable-debug compile-in debugging information [enable]
--disable-optimization compile without -O2 [enable]
2001-10-23 20:32:55 +02:00
2009-03-24 10:32:35 +01:00
Use these options if autodetection fails:
2014-05-14 20:29:00 +02:00
--extra-cflags=FLAGS extra CFLAGS
--extra-ldflags=FLAGS extra LDFLAGS
--extra-libs=FLAGS extra linker flags
Features:
EOF
options_state_machine help
cat << EOF
2006-08-26 22:55:53 +02:00
2005-06-05 16:30:16 +02:00
This configure script is NOT autoconf-based, even though its output is similar.
It will try to autodetect all configuration options. If you --enable an option
it will be forcefully turned on, skipping autodetection. This can break
compilation, so you need to know what you are doing.
2001-02-24 21:28:24 +01:00
EOF
2006-06-16 20:38:35 +02:00
exit 0
} #show_help()
2001-02-24 21:28:24 +01:00
2007-01-31 00:33:25 +01:00
# 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
2012-01-31 08:29:53 +01:00
_pkg_config=auto
_cc=auto
2014-05-21 01:04:47 +02:00
test -n "$CC" && _cc="$CC"
2012-08-25 20:01:03 +02:00
_opt=-O2
2007-01-31 00:18:51 +01:00
_prefix="/usr/local"
2014-05-14 20:29:00 +02:00
options_state_machine init
2007-01-31 00:18:51 +01:00
for ac_option do
case "$ac_option" in
2007-01-31 00:35:52 +01:00
--help|-help|-h)
show_help
;;
2007-01-31 00:59:39 +01:00
--prefix=*)
2009-04-15 22:00:26 +02:00
_prefix=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:33:25 +01:00
;;
2007-01-31 00:59:39 +01:00
--bindir=*)
2009-04-15 22:00:26 +02:00
_bindir=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:33:25 +01:00
;;
2007-01-31 00:59:39 +01:00
--mandir=*)
2009-04-15 22:00:26 +02:00
_mandir=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:33:25 +01:00
;;
2007-01-31 00:59:39 +01:00
--confdir=*)
2009-04-15 22:00:26 +02:00
_confdir=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:33:25 +01:00
;;
2009-03-24 00:37:51 +01:00
--extra-cflags=*)
2009-07-25 06:33:52 +02:00
extra_cflags="$extra_cflags $(echo $ac_option | cut -d '=' -f 2-)"
2009-03-24 00:37:51 +01:00
;;
2009-03-24 01:22:51 +01:00
--extra-ldflags=*)
2009-07-25 06:33:52 +02:00
extra_ldflags="$extra_ldflags $(echo $ac_option | cut -d '=' -f 2-)"
2009-03-24 01:22:51 +01:00
;;
2007-01-31 00:33:25 +01:00
--extra-libs=*)
2009-04-15 22:00:26 +02:00
libs_mplayer=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:33:25 +01:00
;;
2007-01-31 00:59:39 +01:00
--cc=*)
2009-04-15 22:00:26 +02:00
_cc=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:59:39 +01:00
;;
2012-01-31 08:30:09 +01:00
--pkg-config=*)
_pkg_config=$(echo $ac_option | cut -d '=' -f 2)
;;
2007-01-31 00:59:39 +01:00
--enable-static)
_ld_static='-static'
;;
--disable-static)
_ld_static=''
2007-01-31 00:33:25 +01:00
;;
2012-11-20 13:45:35 +01:00
--enable-optimization)
_opt='-O2'
;;
--enable-optimization=*)
_opt=$(echo $_echo_n '-O'$_echo_c; echo $ac_option | cut -d '=' -f 2)
;;
--disable-optimization)
_opt=
;;
2007-01-31 00:18:51 +01:00
*)
2014-05-14 20:29:00 +02:00
options_state_machine parse "$ac_option"
if test "$_opt_state_known" != yes ; then
echo "Unknown parameter: $ac_option" >&2
exit 1
fi
2007-01-31 00:18:51 +01:00
;;
esac
done
2010-01-04 13:24:07 +01:00
test -z "$_bindir" && _bindir="$_prefix/bin"
test -z "$_mandir" && _mandir="$_prefix/share/man"
2012-10-11 02:04:08 +02:00
test -z "$_confdir" && _confdir="$_prefix/etc/mpv"
2007-01-31 00:18:51 +01:00
2014-05-14 20:29:00 +02:00
mplayer_tmpdir=$(mktemp -d --tmpdir mpv-configure-XXXX)
test -n "$mplayer_tmpdir" || die "Unable to create tmpdir."
2012-01-31 08:29:53 +01:00
TMPLOG="config.log"
rm -f "$TMPLOG"
echo Parameters configure was run with: > "$TMPLOG"
2014-05-14 20:29:00 +02:00
echo CFLAGS="'$CFLAGS'" PKG_CONFIG_PATH="'$PKG_CONFIG_PATH'" ./configure $configuration >> "$TMPLOG"
2012-01-31 08:29:53 +01:00
echo >> "$TMPLOG"
2014-05-14 20:29:00 +02:00
TMPC="$mplayer_tmpdir/tmp.c"
TMPEXE="$mplayer_tmpdir/tmp"
CONFIG_MAK="$mplayer_tmpdir/config.mak"
CONFIG_H="$mplayer_tmpdir/config.h"
2012-01-31 08:29:53 +01:00
2014-05-14 20:29:00 +02:00
echo > $CONFIG_MAK
echo > $CONFIG_H
2012-01-31 08:29:53 +01:00
2014-05-14 20:29:00 +02:00
test "$_pkg_config" = auto && _pkg_config=pkg-config
test "$_cc" = auto && _cc=cc
2012-01-31 08:29:53 +01:00
configure: add _GNU_SOURCE to CFLAGS by default
In theory, projects have to define feature test macros to enable various
system functionality in system headers. (This is done so to ensure new
identifiers can be added to system headers, without breaking old
programs by causing name conflicts.) This includes macros like
_GNU_SOURCE, _BSD_SOURCE, _POSIX_C_SOURCE etc.
Traditionally, gcc as well as glibc headers implicitly assumed
_GNU_SOURCE if no feature test macros were defined by the user.
clang did this too to ensure compatibility with gcc centric programs
(which in practice includes most Linux programs).
However, it appears recent clang versions started to prefer BSD
traditional function over the POSIX, which switches the definition
of a function used by mp_msg.c:
pid_t getpgrp(void); /* POSIX.1 version */
pid_t getpgrp(pid_t pid); /* BSD version */
mp_msg.c expects the POSIX version, while clang gives us the BSD
version, resulting in a compilation failure.
Solve this by defining _GNU_SOURCE. This requests most features from
system headers, and explicitly prefers POSIX definitions over BSD,
which should fix the compilation issue.
2013-03-11 01:05:19 +01:00
extra_cflags="-I. -D_GNU_SOURCE $extra_cflags"
2012-09-30 14:47:54 +02:00
2012-11-02 14:37:02 +01:00
_rst2man=rst2man
2014-05-14 20:29:00 +02:00
test -f "$(which rst2man.py)" && _rst2man=rst2man.py
2012-11-02 14:37:02 +01:00
2012-11-14 00:43:55 +01:00
echocheck "whether to build manpages with rst2man"
if test "$_build_man" = auto ; then
_build_man=no
command_check "$_rst2man" --version && _build_man=yes
fi
echores "$_build_man"
2011-05-31 23:15:14 +02:00
echocheck "working compiler"
cflag_check "" || die "Compiler is not functioning correctly. Check your installation and custom CFLAGS $CFLAGS ."
2014-05-14 20:29:00 +02:00
echores "yes"
2011-05-31 23:15:14 +02:00
2012-11-07 15:49:44 +01:00
echocheck "perl"
command_check perl -Mv5.8 -e';' || die "Perl is not functioning correctly or is ancient. Install the latest perl available."
2014-05-14 20:29:00 +02:00
echores yes
2001-02-24 21:28:24 +01:00
2014-04-19 17:09:24 +02:00
echocheck "compiler support of -pipe option"
2010-07-02 01:03:40 +02:00
cflag_check -pipe -I. && _pipe="-pipe" && echores "yes" || echores "no"
2001-11-17 04:53:05 +01:00
2014-05-14 20:29:00 +02:00
addcflags() { cflag_check "$@" && OURCFLAGS="$OURCFLAGS $@" ; }
2009-04-10 20:29:01 +02:00
2014-05-14 20:29:00 +02:00
OURCFLAGS="-std=c99 -Wall $_opt"
2009-04-10 20:29:01 +02:00
2014-05-14 20:29:00 +02:00
addcflags -g -g3 -ggdb
addcflags -Wundef -Wmissing-prototypes -Wshadow -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Werror=implicit-function-declaration -Wno-error=deprecated-declarations -Wno-error=unused-function -Wempty-body
2014-05-14 20:28:25 +02:00
# clang
2014-05-14 20:29:00 +02:00
addcflags -Wno-logical-op-parentheses -fcolor-diagnostics -Wno-tautological-compare -Wno-tautological-constant-out-of-range-compare
2009-04-10 20:29:01 +02:00
2014-05-14 20:28:25 +02:00
cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2014-05-14 20:29:00 +02:00
cflag_check -lm && _ld_lm="-lm"
2001-10-22 09:43:32 +02:00
2014-05-14 20:28:25 +02:00
extra_ldflags="$extra_ldflags $LDFLAGS"
extra_cflags="$extra_cflags $CPPFLAGS"
2001-10-10 15:07:42 +02:00
2014-05-14 20:29:00 +02:00
# If $1 is "yes", define $2 as 1 in config.h, else define it as 0
define_yes_no() {
if test "$1" = yes ; then
echo "#define $2 1" >> $CONFIG_H
else
echo "#define $2 0" >> $CONFIG_H
fi
}
2001-08-25 23:05:23 +02:00
2014-05-14 20:29:00 +02:00
# Write the results of a check to config.mak/.h.
# Arguments: "yes/no"($1) "name"($2)
check_yes_no() {
define_yes_no $1 "HAVE_$2"
echo "$2 = $1" >> $CONFIG_MAK
}
2001-08-25 23:05:23 +02:00
2014-05-14 20:29:00 +02:00
check_trivial() {
echocheck "$1"
check_yes_no $2 $3
echores "$2"
}
2001-08-24 18:20:04 +02:00
2014-05-14 20:29:00 +02:00
# Arguments: "message"($1) "setting"($2) "name"($3) "code"($4)
# Also, $5 - $N can be libraries needed - it'll try each separately.
# Use " " as first entry if you want to try with no libraries too.
check_compile() {
_res="$2"
_name="$3"
_code="$4"
echocheck "$1"
if test $_res = auto ; then
_res=no
2014-05-22 20:54:57 +02:00
if test $# -gt 4 ; then
shift 4
else
shift $#
fi
2014-05-14 20:29:00 +02:00
while true ; do
compile_check "$_code" "$1" && libs_mplayer="$libs_mplayer $1" && _res=yes && break
test -z "$1" && break
shift
done
fi
check_yes_no $_res $_name
echores $_res
test $_res = yes && return 0 || return 1
}
2002-03-15 21:48:42 +01:00
2014-05-14 20:29:00 +02:00
# Arguments: "message"($1) "setting"($2) "name"($3) "include"($4) "statement"($5)
# Also, $6 - $N can be libraries needed - it'll try each separately.
# Use " " as first entry if you want to try with no libraries too.
check_statement_libs() {
_res="$2"
_name="$3"
_inc="$4"
_st="$5"
echocheck "$1"
if test $_res = auto ; then
_res=no
2014-05-22 20:54:57 +02:00
if test $# -gt 5 ; then
shift 5
else
shift $#
fi
2014-05-14 20:29:00 +02:00
while true ; do
statement_check "$_inc" "$_st" "$1" && libs_mplayer="$libs_mplayer $1" && _res=yes && break
test -z "$1" && break
shift
done
fi
check_yes_no $_res $_name
echores $_res
test $_res = yes && return 0 || return 1
}
2001-11-23 19:25:09 +01:00
2014-05-14 20:29:00 +02:00
# Print "yes" if previous command succeeded, else "no"
defretval() { # shell is retarded?
2014-05-22 20:54:57 +02:00
if test $? = 0 ; then
2014-05-14 20:29:00 +02:00
echo "yes"
else
echo "no"
fi
}
2001-11-23 19:25:09 +01:00
2001-11-18 18:45:23 +01:00
echocheck "dynamic loader"
2001-11-17 04:53:05 +01:00
_dl=no
2010-09-14 12:05:46 +02:00
for _ld_tmp in "" "-ldl"; do
2010-09-27 02:02:59 +02:00
statement_check dlfcn.h 'dlopen("", 0)' $_ld_tmp && _ld_dl="$_ld_tmp" && _dl=yes && break
2005-10-03 21:36:32 +02:00
done
2014-05-14 20:29:00 +02:00
define_yes_no $_dl HAVE_LIBDL
2001-11-17 04:53:05 +01:00
echores "$_dl"
2001-07-12 17:35:52 +02:00
2001-11-18 18:45:23 +01:00
echocheck "pthread"
2014-05-14 20:28:25 +02:00
cflag_check -pthread && _ld_pthread="$_ld_pthread -pthread"
cflag_check -lpthread && _ld_pthread="$_ld_pthread -lpthread"
2014-05-14 20:29:00 +02:00
cflag_check -lrt && _ld_pthread="$_ld_pthread -lrt"
2014-05-14 20:28:25 +02:00
extra_cflags="$extra_cflags -D_REENTRANT -D_THREAD_SAFE"
2014-05-14 20:29:00 +02:00
compile_check waftools/fragments/pthreads.c "$_ld_pthread" || die "Unable to find pthreads support."
echores "yes"
2013-11-28 19:28:38 +01:00
2014-05-21 01:04:47 +02:00
check_statement_libs "support for stdatomic.h" auto STDATOMIC \
2014-06-17 20:03:19 +02:00
stdatomic.h 'atomic_int_least64_t test = ATOMIC_VAR_INIT(123); int test2 = atomic_load(&test)' \
" " "-latomic"
2014-05-21 01:04:47 +02:00
_stdatomic=$(defretval)
_atomic=auto
test "$_stdatomic" = yes && _atomic=no
check_statement_libs "compiler support for __atomic built-ins" $_atomic ATOMIC_BUILTINS \
2014-05-14 20:29:00 +02:00
stdint.h 'int64_t test = 0; test = __atomic_add_fetch(&test, 1, __ATOMIC_SEQ_CST)' \
" " "-latomic"
_atomic=$(defretval)
2013-12-30 16:30:30 +01:00
2014-05-14 20:29:00 +02:00
_sync=auto
2014-05-21 01:04:47 +02:00
(test "$_atomic" = yes || test "$_stdatomic" = yes ) && _sync=no
2014-05-14 20:29:00 +02:00
check_statement_libs "compiler support for __sync built-ins" $_sync SYNC_BUILTINS \
stdint.h 'int64_t test = 0; test = __sync_add_and_fetch(&test, 1)'
_sync=$(defretval)
2014-01-01 20:42:13 +01:00
2014-05-21 01:04:47 +02:00
if test "$_atomic" = no && test "$_sync" = no && test "$_stdatomic" = no ; then
die "your compiler must support either stdatomic.h, or __atomic, or __sync built-ins."
2014-01-01 20:42:13 +01:00
fi
2013-12-30 16:30:30 +01:00
2014-05-14 20:29:00 +02:00
check_compile "iconv" $_iconv ICONV waftools/fragments/iconv.c " " "-liconv" "-liconv $_ld_dl"
_iconv=$(defretval)
if test "$_iconv" != yes ; then
2011-04-20 20:39:53 +02:00
die "Unable to find iconv which should be part of standard compilation environment. Aborting. If you really mean to compile without iconv support use --disable-iconv."
2001-12-03 16:22:03 +01:00
fi
2014-05-14 20:29:00 +02:00
_soundcard_header=sys/soundcard.h
_check_snd=yes
check_statement_libs "sys/soundcard.h" auto SYS_SOUNDCARD_H sys/soundcard.h
test $(defretval) = yes && _soundcard_header=sys/soundcard.h && _check_snd=no
check_statement_libs "soundcard.h" $_check_snd SOUNDCARD_H soundcard.h
test $(defretval) = yes && _soundcard_header=soundcard.h
2001-11-19 17:42:01 +01:00
2014-05-14 20:29:00 +02:00
check_statement_libs "sys/videoio.h" auto SYS_VIDEOIO_H sys/videoio.h
2001-11-19 17:42:01 +01:00
2014-05-14 20:29:00 +02:00
check_statement_libs "terminfo" $_terminfo TERMINFO term.h 'setupterm(0, 1, 0)' "-lncurses" "-lncursesw"
2001-11-19 16:54:43 +01:00
2014-05-14 20:29:00 +02:00
check_statement_libs "termcap" $_termcap TERMCAP term.h 'tgetent(0, 0)' " " "-lncurses" "-ltinfo" "-ltermcap"
2002-03-15 21:48:42 +01:00
2014-05-14 20:29:00 +02:00
_termios_ok=no
check_statement_libs "termios.h" $_termios TERMIOS_H termios.h
test $(defretval) = yes && _termios_ok=yes && _termios=no
check_statement_libs "sys/termios.h" $_termios SYS_TERMIOS_H 'sys/termios.h'
test $(defretval) = yes && _termios_ok=yes
define_yes_no $_termios_ok HAVE_TERMIOS
2009-01-11 13:58:06 +01:00
2014-05-14 20:29:00 +02:00
check_statement_libs "shm" $_shm SHM "sys/types.h sys/ipc.h sys/shm.h" \
"shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0);"
2009-01-11 13:58:06 +01:00
2006-10-31 10:25:40 +01:00
echocheck "pkg-config"
2009-04-15 22:00:26 +02:00
if $($_pkg_config --version > /dev/null 2>&1); then
2007-07-20 23:57:59 +02:00
if test "$_ld_static"; then
_pkg_config="$_pkg_config --static"
fi
2006-10-31 10:25:40 +01:00
echores "yes"
else
_pkg_config=false
echores "no"
fi
2014-05-14 20:29:00 +02:00
# Arguments: "message"($1) "setting"($2) "name"($3) "pkg-config string"($4)
# The name will be used as "#define HAVE_$name 1/0" in config.h, and as
# "$name = yes/no" in config.mak
# "setting"($2) is yes/no/auto and represents the --enable/--disable option
check_pkg_config() {
echocheck "$1"
_res=$2
if test "$2" = auto ; then
_res=no
if pkg_config_add "$4" ; then
_res=yes
fi
2013-10-19 13:32:30 +02:00
fi
2014-05-14 20:29:00 +02:00
check_yes_no $_res $3
echores "$_res"
test $_res = yes && return 0 || return 1
}
2003-03-21 17:06:11 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "libguess support" $_libguess LIBGUESS 'libguess >= 1.0'
2013-06-27 18:21:07 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "Samba support (libsmbclient)" $_smb LIBSMBCLIENT 'smbclient >= 0.2.0'
2003-03-21 17:06:11 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "libquvi 0.4.x support" $_libquvi4 LIBQUVI4 'libquvi >= 0.4.1'
_libquvi4=$(defretval)
2013-11-28 18:15:11 +01:00
2014-05-14 20:29:00 +02:00
test $_libquvi4 = yes && _libquvi9=no
check_pkg_config "libquvi 0.9.x support" $_libquvi9 LIBQUVI9 'libquvi-0.9 >= 0.9.0'
_libquvi9=$(defretval)
2013-06-28 15:46:38 +02:00
2014-05-14 20:29:00 +02:00
_libquvi=no
2014-05-23 16:04:17 +02:00
(test "$_libquvi9" = yes || test "$_libquvi4" = yes) && _libquvi=yes
2014-05-14 20:29:00 +02:00
define_yes_no $_libquvi HAVE_LIBQUVI
2001-11-17 12:26:26 +01:00
2014-09-19 17:40:26 +02:00
_wlver="1.6.0"
2014-05-14 20:29:00 +02:00
check_pkg_config "Wayland" $_wayland WAYLAND "wayland-client >= $_wlver wayland-cursor >= $_wlver xkbcommon >= 0.3.0"
_wayland=$(defretval)
2012-04-16 08:33:42 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "X11" $_x11 X11 "x11"
_x11=$(defretval)
2001-02-24 21:28:24 +01:00
2014-05-14 20:29:00 +02:00
# Disable X11 dependencies
_xext=auto
if test "$_x11" = no ; then
_xss=no
_xext=no
_xv=no
_vdpau=no
_vaapi=no
_xinerama=no
_vm=no
2007-12-22 12:09:43 +01:00
fi
2001-06-05 20:40:44 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "Xss screensaver extensions" $_xss XSS "xscrnsaver"
2001-06-04 22:12:41 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "X extensions" $_xext XEXT "xext"
2006-08-19 21:10:27 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "Xv" $_xv XV "xv"
2001-06-04 10:07:57 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "VDPAU" $_vdpau VDPAU "vdpau >= 0.2"
_vdpau=$(defretval)
define_yes_no $_vdpau HAVE_VDPAU_HWACCEL
2001-07-28 23:35:55 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "VAAPI" $_vaapi VAAPI 'libva >= 0.32.0 libva-x11 >= 0.32.0'
_vaapi=$(defretval)
define_yes_no $_vaapi HAVE_VAAPI_HWACCEL
video: add vaapi decode and output support
This is based on the MPlayer VA API patches. To be exact it's based on
a very stripped down version of commit f1ad459a263f8537f6c from
git://gitorious.org/vaapi/mplayer.git.
This doesn't contain useless things like benchmarking hacks and the
demo code for GLX interop. Also, unlike in the original patch, decoding
and video output are split into separate source files (the separation
between decoding and display also makes pixel format hacks unnecessary).
On the other hand, some features not present in the original patch were
added, like screenshot support.
VA API is rather bad for actual video output. Dealing with older libva
versions or the completely broken vdpau backend doesn't help. OSD is
low quality and should be rather slow. In some cases, only either OSD
or subtitles can be shown at the same time (because OSD is drawn first,
OSD is prefered).
Also, libva can't decide whether it accepts straight or premultiplied
alpha for OSD sub-pictures: the vdpau backend seems to assume
premultiplied, while a native vaapi driver uses straight. So I picked
straight alpha. It doesn't matter much, because the blending code for
straight alpha I added to img_convert.c is probably buggy, and ASS
subtitles might be blended incorrectly.
Really good video output with VA API would probably use OpenGL and the
GL interop features, but at this point you might just use vo_opengl.
(Patches for making HW decoding with vo_opengl have a chance of being
accepted.)
Despite these issues, decoding seems to work ok. I still got tearing
on the Intel system I tested (Intel(R) Core(TM) i3-2350M). It was also
tested with the vdpau vaapi wrapper on a nvidia system; however this
was rather broken. (Fortunately, there is no reason to use mpv's VAAPI
support over native VDPAU.)
2013-08-09 14:01:30 +02:00
2013-09-20 15:55:13 +02:00
if test "$_vaapi" = yes ; then
2014-05-14 20:29:00 +02:00
check_pkg_config "VAAPI VPP" auto VAAPI_VPP 'libva >= 0.34.0'
video: add vaapi decode and output support
This is based on the MPlayer VA API patches. To be exact it's based on
a very stripped down version of commit f1ad459a263f8537f6c from
git://gitorious.org/vaapi/mplayer.git.
This doesn't contain useless things like benchmarking hacks and the
demo code for GLX interop. Also, unlike in the original patch, decoding
and video output are split into separate source files (the separation
between decoding and display also makes pixel format hacks unnecessary).
On the other hand, some features not present in the original patch were
added, like screenshot support.
VA API is rather bad for actual video output. Dealing with older libva
versions or the completely broken vdpau backend doesn't help. OSD is
low quality and should be rather slow. In some cases, only either OSD
or subtitles can be shown at the same time (because OSD is drawn first,
OSD is prefered).
Also, libva can't decide whether it accepts straight or premultiplied
alpha for OSD sub-pictures: the vdpau backend seems to assume
premultiplied, while a native vaapi driver uses straight. So I picked
straight alpha. It doesn't matter much, because the blending code for
straight alpha I added to img_convert.c is probably buggy, and ASS
subtitles might be blended incorrectly.
Really good video output with VA API would probably use OpenGL and the
GL interop features, but at this point you might just use vo_opengl.
(Patches for making HW decoding with vo_opengl have a chance of being
accepted.)
Despite these issues, decoding seems to work ok. I still got tearing
on the Intel system I tested (Intel(R) Core(TM) i3-2350M). It was also
tested with the vdpau vaapi wrapper on a nvidia system; however this
was rather broken. (Fortunately, there is no reason to use mpv's VAAPI
support over native VDPAU.)
2013-08-09 14:01:30 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "VAAPI GLX" auto VAAPI_GLX 'libva-glx >= 0.32.0'
_vaapi_glx=$(defretval)
2001-11-17 04:53:05 +01:00
else
2014-05-14 20:29:00 +02:00
check_yes_no no VAAPI_VPP
check_yes_no no VAAPI_GLX
_vaapi_glx=no
2001-11-17 04:53:05 +01:00
fi
2014-05-14 20:29:00 +02:00
check_pkg_config "Xinerama" $_xinerama XINERAMA 'xinerama'
2014-08-17 15:38:47 +02:00
check_pkg_config "Xrandr" $_xrandr XRANDR 'xrandr >= 1.2.0'
2001-04-15 22:31:58 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "CACA" $_caca CACA 'caca >= 0.99.beta18'
2002-03-10 23:49:18 +01:00
2014-05-14 20:29:00 +02:00
check_compile "DVB" $_dvb DVB waftools/fragments/dvb.c
_dvbin=$(defretval)
check_yes_no $_dvbin DVBIN
2002-05-13 14:28:00 +02:00
2014-05-14 20:29:00 +02:00
check_statement_libs "JPEG support" $_jpeg JPEG "stdio.h jpeglib.h" "" "-ljpeg $_ld_lm"
2001-11-17 12:26:26 +01:00
2014-05-14 20:29:00 +02:00
(test "$_x11" = no && test "$_wayland" = no) && _gl=no
2010-04-30 21:04:13 +02:00
echocheck "OpenGL"
#Note: this test is run even with --enable-gl since we autodetect linker flags
2014-05-14 20:29:00 +02:00
if test "$_gl" != no ; then
2010-04-30 21:04:13 +02:00
cat > $TMPC << EOF
2014-05-14 20:28:25 +02:00
#if defined(GL_WAYLAND)
2013-02-28 19:55:02 +01:00
#include <EGL/egl.h>
2010-04-30 21:04:13 +02:00
#else
#include <X11/Xlib.h>
#include <GL/glx.h>
#endif
2013-02-28 19:55:02 +01:00
#include <GL/gl.h>
2014-05-14 20:29:00 +02:00
#include <GL/glext.h>
2010-06-30 11:27:03 +02:00
int main(int argc, char *argv[]) {
2014-05-14 20:28:25 +02:00
#if defined(GL_WAYLAND)
2013-02-28 19:55:02 +01:00
eglCreateContext(NULL, NULL, EGL_NO_CONTEXT, NULL);
2010-04-30 21:04:13 +02:00
#else
glXCreateContext(NULL, NULL, NULL, True);
#endif
glFinish();
2014-05-14 20:29:00 +02:00
return !GL_INVALID_FRAMEBUFFER_OPERATION; // check correct glext.h
2010-04-30 21:04:13 +02:00
}
EOF
_gl=no
2012-05-01 12:39:14 +02:00
if test "$_x11" = yes ; then
for _ld_tmp in "" -lGL "-lGL -lXdamage" "-lGL $_ld_pthread" ; do
2014-05-14 20:29:00 +02:00
if compile_check $TMPC $_ld_tmp $_ld_lm ; then
2012-05-01 12:39:14 +02:00
_gl=yes
_gl_x11=yes
libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
2014-05-14 20:29:00 +02:00
test "$_gl_x11" = yes && res_comment="$res_comment x11"
2012-05-01 12:39:14 +02:00
break
fi
done
fi
2014-05-14 20:29:00 +02:00
if test "$_wayland" = yes && compile_check $TMPC -DGL_WAYLAND -lGL -lEGL &&
2013-08-26 17:20:44 +02:00
pkg_config_add "wayland-egl >= 9.0.0"; then
2013-02-28 19:55:02 +01:00
_gl=yes
_gl_wayland=yes
libs_mplayer="$libs_mplayer -lGL -lEGL"
2014-05-14 20:29:00 +02:00
test "$_gl_wayland" = yes && res_comment="$res_comment wayland"
2013-03-23 20:17:46 +01:00
fi
2010-04-30 21:04:13 +02:00
else
_gl=no
fi
2013-07-16 13:28:28 +02:00
2014-05-14 20:29:00 +02:00
if test "$_gl" = no ; then
_gl_x11=no
_gl_wayland=no
2010-04-30 21:04:13 +02:00
fi
2014-05-14 20:29:00 +02:00
check_yes_no $_gl GL
check_yes_no $_gl_x11 GL_X11
check_yes_no $_gl_wayland GL_WAYLAND
2010-04-30 21:04:13 +02:00
echores "$_gl"
2013-11-05 22:06:48 +01:00
echocheck "VDPAU with OpenGL/X11"
2014-05-14 20:29:00 +02:00
_vdpau_gl_x11=no
(test "$_gl_x11" = yes && test "$_vdpau" = yes) && _vdpau_gl_x11=yes
check_yes_no $_vdpau_gl_x11 VDPAU_GL_X11
2013-11-05 22:06:48 +01:00
echores "$_vdpau_gl_x11"
2014-05-14 20:29:00 +02:00
check_pkg_config "SDL 2.0" $_sdl2 SDL2 'sdl2'
2013-07-16 13:28:28 +02:00
2014-05-14 20:29:00 +02:00
check_statement_libs "OSS Audio" $_ossaudio OSS_AUDIO $_soundcard_header "int x = SNDCTL_DSP_SETFRAGMENT;"
2012-12-28 08:07:14 +01:00
2014-05-14 20:29:00 +02:00
check_statement_libs "RSound" $_rsound RSOUND rsound.h 'rsd_init(NULL);' -lrsound
2012-12-28 08:07:14 +01:00
2014-05-14 20:29:00 +02:00
check_statement_libs "sndio" $_sndio SNDIO sndio.h 'struct sio_par par; sio_initpar(&par); const char *s = SIO_DEVANY' -lsndio
2012-12-28 08:07:14 +01:00
2014-07-26 22:40:27 +02:00
check_pkg_config "PulseAudio" $_pulse PULSE 'libpulse >= 1.0'
2012-12-28 08:07:14 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "PortAudio" $_portaudio PORTAUDIO 'portaudio-2.0 >= 19'
2001-11-17 12:26:26 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "JACK" $_jack JACK 'jack'
2001-11-17 12:26:26 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "OpenAL" $_openal OPENAL 'openal >= 1.13'
2001-04-26 22:23:24 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "ALSA audio" $_alsa ALSA 'alsa >= 1.0.9'
2001-11-17 04:53:05 +01:00
2014-07-15 01:49:02 +02:00
check_pkg_config "Blu-ray support" $_bluray LIBBLURAY 'libbluray >= 0.2.1'
check_pkg_config "dvdread" $_dvdread DVDREAD 'dvdread >= 4.1.0'
check_pkg_config "dvdnav" $_dvdnav DVDNAV 'dvdnav >= 4.2.0'
2014-05-14 20:29:00 +02:00
check_pkg_config "libcdio" $_libcdio CDDA 'libcdio_paranoia'
2013-09-28 18:01:12 +02:00
2014-05-14 20:29:00 +02:00
_oldass=$_libass
check_pkg_config "SSA/ASS support" $_libass LIBASS 'libass'
_libass=$(defretval)
if test $_oldass != no && test $_libass = no ; then
die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
2004-11-06 20:35:24 +01:00
fi
2012-04-27 11:26:04 +02:00
2012-07-28 22:00:31 +02:00
_dummy_osd=yes
2014-05-14 20:29:00 +02:00
test $_libass = yes && _dummy_osd=no
echo "LIBASS_OSD = $_libass" >> $CONFIG_MAK
echo "DUMMY_OSD = $_dummy_osd" >> $CONFIG_MAK
2012-03-31 01:13:38 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "ENCA" $_enca ENCA 'enca'
2001-12-30 00:34:53 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "zlib" auto ZLIB 'zlib'
test $(defretval) = no && die "Unable to find development files for zlib."
2014-04-12 17:51:19 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "mpg123 support" $_mpg123 MPG123 'libmpg123 >= 1.14.0'
2014-04-12 17:51:19 +02:00
2014-05-14 20:29:00 +02:00
test "$_dl" = no && _ladspa=no
check_statement_libs "LADSPA plugin support" $_ladspa LADSPA ladspa.h 'LADSPA_Descriptor ld = {0}'
2009-07-26 04:55:40 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "libbs2b audio filter support" $_libbs2b LIBBS2B 'libbs2b'
2013-05-13 00:38:35 +02:00
2014-06-16 16:57:19 +02:00
check_pkg_config "LCMS2 support" $_lcms2 LCMS2 'lcms2 >= 2.6'
2013-07-16 13:28:28 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "VapourSynth support" $_vapoursynth VAPOURSYNTH 'vapoursynth >= 23 vapoursynth-script >= 23'
2013-03-09 09:30:26 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "FFmpeg/Libav" $_ffmpeg FFMPEG \
"libavutil >= 52.48.101 libavcodec >= 55.34.1 libavformat >= 55.12.0 libswscale >= 2.1.2"
test $(defretval) = no && die "Unable to find development files for some of the required Libav libraries above. Aborting."
2013-03-09 09:30:26 +01:00
2014-05-14 20:29:00 +02:00
check_pkg_config "Libavresample" $_libavresample LIBAVRESAMPLE 'libavresample >= 1.1.0'
_libavresample=$(defretval)
2013-03-09 09:30:26 +01:00
2014-05-14 20:29:00 +02:00
_libswresample=auto
test $_libavresample = yes && _libswresample=no
check_pkg_config "Libswresample" $_libswresample LIBSWRESAMPLE 'libswresample >= 0.17.104'
_libswresample=$(defretval)
2013-05-13 00:38:35 +02:00
2014-05-14 20:29:00 +02:00
if test "$_libswresample" = no && test "$_libavresample" = no ; then
2013-03-09 09:30:26 +01:00
die "No resampler found. Install libavresample or libswresample (FFmpeg)."
fi
2014-05-14 20:29:00 +02:00
# Arguments: "message"($1) "define"($2) "header"($3) "code"($4)
api_statement_check() {
echocheck "$1"
_res=no
statement_check "$3" "$4" && _res=yes
define_yes_no $_res "$2"
echores "$_res"
}
vdpau: split off decoder parts, use "new" libavcodec vdpau hwaccel API
Move the decoder parts from vo_vdpau.c to a new file vdpau_old.c. This
file is named so because because it's written against the "old"
libavcodec vdpau pseudo-decoder (e.g. "h264_vdpau").
Add support for the "new" libavcodec vdpau support. This was recently
added and replaces the "old" vdpau parts. (In fact, Libav is about to
deprecate and remove the "old" API without deprecation grace period,
so we have to support it now. Moreover, there will probably be no Libav
release which supports both, so the transition is even less smooth than
we could hope, and we have to support both the old and new API.)
Whether the old or new API is used is checked by a configure test: if
the new API is found, it is used, otherwise the old API is assumed.
Some details might be handled differently. Especially display preemption
is a bit problematic with the "new" libavcodec vdpau support: it wants
to keep a pointer to a specific vdpau API function (which can be driver
specific, because preemption might switch drivers). Also, surface IDs
are now directly stored in AVFrames (and mp_images), so they can't be
forced to VDP_INVALID_HANDLE on preemption. (This changes even with
older libavcodec versions, because mp_image always uses the newer
representation to make vo_vdpau.c simpler.)
Decoder initialization in the new code tries to deal with codec
profiles, while the old code always uses the highest profile per codec.
Surface allocation changes. Since the decoder won't call config() in
vo_vdpau.c on video size change anymore, we allow allocating surfaces
of arbitrary size instead of locking it to what the VO was configured.
The non-hwdec code also has slightly different allocation behavior now.
Enabling the old vdpau special decoders via e.g. --vd=lavc:h264_vdpau
doesn't work anymore (a warning suggesting the --hwdec option is
printed instead).
2013-07-28 01:49:45 +02:00
2014-05-14 20:29:00 +02:00
api_statement_check \
"libavcodec avcodec_enum_to_chroma_pos API" \
HAVE_AVCODEC_CHROMA_POS_API \
libavcodec/avcodec.h \
'int x, y; avcodec_enum_to_chroma_pos(&x, &y, AVCHROMA_LOC_UNSPECIFIED)'
2013-03-15 14:21:42 +01:00
2014-03-25 18:45:08 +01:00
api_statement_check \
"libavcodec avcol_spc_bt2020 available" \
HAVE_AVCOL_SPC_BT2020 \
libavcodec/avcodec.h \
'int x = AVCOL_SPC_BT2020_NCL'
2014-05-14 20:29:00 +02:00
api_statement_check \
"libavcodec metadata update side data" \
HAVE_AVCODEC_METADATA_UPDATE_SIDE_DATA \
libavcodec/avcodec.h \
'enum AVPacketSideDataType type = AV_PKT_DATA_METADATA_UPDATE'
demux_lavf: add support for libavdevice
libavdevice supports various "special" video and audio inputs, such
as screen-capture or libavfilter filter graphs.
libavdevice inputs are implemented as demuxers. They don't use the
custom stream callbacks (in AVFormatContext.pb). Instead, input
parameters are passed as filename. This means the mpv stream layer has
to be disabled. Do this by adding the pseudo stream handler avdevice://,
whose only purpose is passing the filename to demux_lavf, without
actually doing anything.
Change the logic how the filename is passed to libavformat. Remove
handling of the filename from demux_open_lavf() and move it to
lavf_check_file(). (This also fixes a possible bug when skipping the
"lavf://" prefix.)
libavdevice now can be invoked by specifying demuxer and args as in:
mpv avdevice://demuxer:args
The args are passed as filename to libavformat. When using libavdevice
demuxers, their actual meaning is highly implementation specific. They
don't refer to actual filenames.
Note:
libavdevice is disabled by default. There is one problem: libavdevice
pulls in libavfilter, which in turn causes symbol clashes with mpv
internals. The problem is that libavfilter includes a mplayer filter
bridge, which is used to interface with a set of nearly unmodified
mplayer filters copied into libavfilter. This filter bridge uses the
same symbol names as mplayer/mpv's filter chain, which results in symbol
clashes at link-time.
This can be prevented by building ffmpeg with --disable-filter=mp, but
unfortunately this is not the default.
This means linking to libavdevice (which in turn forces linking with
libavfilter by default) must be disabled. We try doing this by compiling
a test file that defines one of the clashing symbols (vf_mpi_clear).
To enable libavdevice input, ffmpeg should be built with the options:
--disable-filter=mp
and mpv with:
--enable-libavdevice
Originally, I tried to auto-detect it. But the resulting complications
in configure did't seem worth the trouble.
2012-11-30 18:41:04 +01:00
2014-08-14 01:18:18 +02:00
api_statement_check \
"libavformat metadata update flags" \
HAVE_AVFORMAT_METADATA_UPDATE_FLAG \
libavformat/avformat.h \
'int x = AVFMT_EVENT_FLAG_METADATA_UPDATED'
2014-05-14 20:29:00 +02:00
api_statement_check \
"libavcodec replaygain side data" \
HAVE_AVCODEC_REPLAYGAIN_SIDE_DATA \
libavcodec/avcodec.h \
'enum AVPacketSideDataType type = AV_PKT_DATA_REPLAYGAIN'
demux_lavf: add support for libavdevice
libavdevice supports various "special" video and audio inputs, such
as screen-capture or libavfilter filter graphs.
libavdevice inputs are implemented as demuxers. They don't use the
custom stream callbacks (in AVFormatContext.pb). Instead, input
parameters are passed as filename. This means the mpv stream layer has
to be disabled. Do this by adding the pseudo stream handler avdevice://,
whose only purpose is passing the filename to demux_lavf, without
actually doing anything.
Change the logic how the filename is passed to libavformat. Remove
handling of the filename from demux_open_lavf() and move it to
lavf_check_file(). (This also fixes a possible bug when skipping the
"lavf://" prefix.)
libavdevice now can be invoked by specifying demuxer and args as in:
mpv avdevice://demuxer:args
The args are passed as filename to libavformat. When using libavdevice
demuxers, their actual meaning is highly implementation specific. They
don't refer to actual filenames.
Note:
libavdevice is disabled by default. There is one problem: libavdevice
pulls in libavfilter, which in turn causes symbol clashes with mpv
internals. The problem is that libavfilter includes a mplayer filter
bridge, which is used to interface with a set of nearly unmodified
mplayer filters copied into libavfilter. This filter bridge uses the
same symbol names as mplayer/mpv's filter chain, which results in symbol
clashes at link-time.
This can be prevented by building ffmpeg with --disable-filter=mp, but
unfortunately this is not the default.
This means linking to libavdevice (which in turn forces linking with
libavfilter by default) must be disabled. We try doing this by compiling
a test file that defines one of the clashing symbols (vf_mpi_clear).
To enable libavdevice input, ffmpeg should be built with the options:
--disable-filter=mp
and mpv with:
--enable-libavdevice
Originally, I tried to auto-detect it. But the resulting complications
in configure did't seem worth the trouble.
2012-11-30 18:41:04 +01:00
2014-06-01 17:56:10 +02:00
api_statement_check \
"libavutil/libavcodec display matrix side data" \
HAVE_AV_DISPLAYMATRIX \
libavutil/frame.h \
'enum AVFrameSideDataType type = AV_FRAME_DATA_DISPLAYMATRIX'
2014-05-14 20:29:00 +02:00
api_statement_check \
"libavutil AVFrame metadata" \
HAVE_AVFRAME_METADATA \
libavutil/frame.h \
'av_frame_get_metadata(NULL)'
demux_lavf: add support for libavdevice
libavdevice supports various "special" video and audio inputs, such
as screen-capture or libavfilter filter graphs.
libavdevice inputs are implemented as demuxers. They don't use the
custom stream callbacks (in AVFormatContext.pb). Instead, input
parameters are passed as filename. This means the mpv stream layer has
to be disabled. Do this by adding the pseudo stream handler avdevice://,
whose only purpose is passing the filename to demux_lavf, without
actually doing anything.
Change the logic how the filename is passed to libavformat. Remove
handling of the filename from demux_open_lavf() and move it to
lavf_check_file(). (This also fixes a possible bug when skipping the
"lavf://" prefix.)
libavdevice now can be invoked by specifying demuxer and args as in:
mpv avdevice://demuxer:args
The args are passed as filename to libavformat. When using libavdevice
demuxers, their actual meaning is highly implementation specific. They
don't refer to actual filenames.
Note:
libavdevice is disabled by default. There is one problem: libavdevice
pulls in libavfilter, which in turn causes symbol clashes with mpv
internals. The problem is that libavfilter includes a mplayer filter
bridge, which is used to interface with a set of nearly unmodified
mplayer filters copied into libavfilter. This filter bridge uses the
same symbol names as mplayer/mpv's filter chain, which results in symbol
clashes at link-time.
This can be prevented by building ffmpeg with --disable-filter=mp, but
unfortunately this is not the default.
This means linking to libavdevice (which in turn forces linking with
libavfilter by default) must be disabled. We try doing this by compiling
a test file that defines one of the clashing symbols (vf_mpi_clear).
To enable libavdevice input, ffmpeg should be built with the options:
--disable-filter=mp
and mpv with:
--enable-libavdevice
Originally, I tried to auto-detect it. But the resulting complications
in configure did't seem worth the trouble.
2012-11-30 18:41:04 +01:00
2014-05-14 20:29:00 +02:00
api_statement_check \
"libavutil QP API" \
HAVE_AVUTIL_QP_API \
libavutil/frame.h \
'av_frame_get_qp_table(NULL, NULL, NULL)'
demux_lavf: add support for libavdevice
libavdevice supports various "special" video and audio inputs, such
as screen-capture or libavfilter filter graphs.
libavdevice inputs are implemented as demuxers. They don't use the
custom stream callbacks (in AVFormatContext.pb). Instead, input
parameters are passed as filename. This means the mpv stream layer has
to be disabled. Do this by adding the pseudo stream handler avdevice://,
whose only purpose is passing the filename to demux_lavf, without
actually doing anything.
Change the logic how the filename is passed to libavformat. Remove
handling of the filename from demux_open_lavf() and move it to
lavf_check_file(). (This also fixes a possible bug when skipping the
"lavf://" prefix.)
libavdevice now can be invoked by specifying demuxer and args as in:
mpv avdevice://demuxer:args
The args are passed as filename to libavformat. When using libavdevice
demuxers, their actual meaning is highly implementation specific. They
don't refer to actual filenames.
Note:
libavdevice is disabled by default. There is one problem: libavdevice
pulls in libavfilter, which in turn causes symbol clashes with mpv
internals. The problem is that libavfilter includes a mplayer filter
bridge, which is used to interface with a set of nearly unmodified
mplayer filters copied into libavfilter. This filter bridge uses the
same symbol names as mplayer/mpv's filter chain, which results in symbol
clashes at link-time.
This can be prevented by building ffmpeg with --disable-filter=mp, but
unfortunately this is not the default.
This means linking to libavdevice (which in turn forces linking with
libavfilter by default) must be disabled. We try doing this by compiling
a test file that defines one of the clashing symbols (vf_mpi_clear).
To enable libavdevice input, ffmpeg should be built with the options:
--disable-filter=mp
and mpv with:
--enable-libavdevice
Originally, I tried to auto-detect it. But the resulting complications
in configure did't seem worth the trouble.
2012-11-30 18:41:04 +01:00
2014-09-04 23:07:56 +02:00
api_statement_check \
"libavcodec av_vdpau_alloc_context()" \
HAVE_AVCODEC_VDPAU_ALLOC_CONTEXT \
libavcodec/vdpau.h \
'AVVDPAUContext *x = av_vdpau_alloc_context()'
2014-05-14 20:29:00 +02:00
check_pkg_config "libavfilter" $_libavfilter LIBAVFILTER 'libavfilter >= 3.90.100'
2010-10-31 02:19:56 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "libavdevice" $_libavdevice LIBAVDEVICE 'libavdevice >= 54.0.0'
2013-08-14 15:47:18 +02:00
2014-05-14 20:29:00 +02:00
check_pkg_config "libpostproc" $_libpostproc LIBPOSTPROC 'libpostproc >= 52.0.0'
2001-02-24 21:28:24 +01:00
2014-05-14 20:29:00 +02:00
check_trivial "TV interface" $_tv TV
2006-06-18 13:21:23 +02:00
2014-05-14 20:29:00 +02:00
check_statement_libs "Video 4 Linux 2 TV interface" $_tv_v4l2 TV_V4L2 \
"sys/time.h linux/videodev2.h"
_tv_v4l2=$(defretval)
check_trivial "TV audio input" $_tv_v4l2 AUDIO_INPUT
2003-08-07 14:24:35 +02:00
2014-05-14 20:29:00 +02:00
test $_tv_v4l2 = no && _libv4l2=no
check_pkg_config "libv4l2 support" $_libv4l2 LIBV4L2 'libv4l2'
2006-08-28 19:05:18 +02:00
2014-05-14 20:29:00 +02:00
test "$_tv_v4l2" = no && _pvr=no
check_compile "Video 4 Linux 2 MPEG PVR interface" $_pvr PVR waftools/fragments/pvr.c
2006-07-10 23:32:19 +02:00
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 00:41:14 +02:00
# Note: Lua has no official .pc file, so there are different OS-specific ones.
# Also, we support luajit, which is compatible to 5.1.
test_lua() {
2014-05-14 20:29:00 +02:00
if test "$_lua" = auto && $_pkg_config "$1" ; then
check_pkg_config "Lua ($1)" $_lua LUA "$1"
2014-07-07 17:02:26 +02:00
_lua=$(defretval)
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 00:41:14 +02:00
fi
}
2014-05-14 20:29:00 +02:00
test_lua "lua >= 5.1.0 lua < 5.2.0"
test_lua "lua5.1 >= 5.1.0" # debian
test_lua "luajit >= 2.0.0"
test_lua "lua >= 5.2.0"
test_lua "lua5.2 >= 5.2.0" # debian
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 00:41:14 +02:00
2014-07-07 17:02:26 +02:00
test "$_lua" != yes && check_yes_no no LUA
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 00:41:14 +02:00
2014-05-14 20:29:00 +02:00
check_trivial "joystick" $_joystick JOYSTICK
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-26 00:41:14 +02:00
2014-05-14 20:29:00 +02:00
check_statement_libs "lirc" $_lirc LIRC lirc/lirc_client.h "" -llirc_client
2012-09-14 17:51:26 +02:00
2014-05-14 20:29:00 +02:00
check_trivial "encoding" $_encoding ENCODING
2002-12-22 22:01:01 +01:00
2014-05-14 20:28:25 +02:00
# needs dlopen on unix
2013-07-12 18:33:39 +02:00
_dlopen="$_dl"
2014-05-14 20:29:00 +02:00
check_yes_no $_dlopen DLOPEN
2005-06-01 11:08:15 +02:00
2012-12-19 13:01:56 +01:00
extra_ldflags="$extra_ldflags $_ld_pthread"
libs_mplayer="$libs_mplayer $_ld_dl"
2001-11-17 04:53:05 +01:00
2011-04-23 17:00:43 +02:00
CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
2007-03-18 21:33:20 +01:00
2013-07-16 13:28:28 +02:00
# This is done so waf builds won't conflict with this. In fact, waf and old
# build system can coexist in parallel, at the same time. This is because
# waf always does out-of-tree builds, while this build system does always
# in-tree builds.
if test ! -f Makefile ; then
ln -s old-makefile Makefile
fi
2014-05-14 20:29:00 +02:00
mkdir old_build 2> /dev/null
2010-03-17 15:41:32 +01:00
2013-07-16 13:28:28 +02:00
cat > old_build/config.mak << EOF
2001-11-18 18:45:23 +01:00
# -------- Generated by configure -----------
2008-06-07 15:54:49 +02:00
export LC_ALL = C
2008-06-02 14:55:24 +02:00
2010-06-09 11:27:29 +02:00
CONFIGURATION = $configuration
2009-05-04 13:44:36 +02:00
2010-04-04 18:48:46 +02:00
prefix = \$(DESTDIR)$_prefix
BINDIR = \$(DESTDIR)$_bindir
MANDIR = \$(DESTDIR)$_mandir
2002-06-24 10:23:48 +02:00
CONFDIR = \$(DESTDIR)$_confdir
2008-06-02 14:24:28 +02:00
2010-04-04 18:48:46 +02:00
CC = $_cc
2014-05-14 20:29:00 +02:00
INSTALL = install
2008-06-02 14:24:28 +02:00
2014-05-14 20:29:00 +02:00
CFLAGS = -Iold_build $OURCFLAGS $CFLAGS $extra_cflags
2010-07-02 01:18:16 +02:00
DEPFLAGS = $DEPFLAGS
2010-04-04 18:48:46 +02:00
2014-05-14 20:29:00 +02:00
EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $libs_mplayer $end_ldflags
2008-06-02 14:24:28 +02:00
2012-11-02 14:37:02 +01:00
RST2MAN = $_rst2man
2012-11-14 00:43:55 +01:00
BUILD_MAN = $_build_man
2008-06-02 14:24:28 +02:00
# features
2001-07-03 09:50:52 +02:00
EOF
2014-05-14 20:29:00 +02:00
cat $CONFIG_MAK >> old_build/config.mak
2001-02-24 21:28:24 +01:00
2014-05-14 20:29:00 +02:00
cat > $TMPC << EOF
2008-10-04 15:07:31 +02:00
/*----------------------------------------------------------------------------
** This file has been automatically generated by configure any changes in it
** will be lost when you run configure again.
** Instead of modifying definitions here, use the --enable/--disable options
** of the configure script! See ./configure --help for details.
*---------------------------------------------------------------------------*/
2001-02-24 21:28:24 +01:00
2014-05-14 20:29:00 +02:00
#ifndef MPV_CONFIG_H
#define MPV_CONFIG_H
2003-11-02 14:45:24 +01:00
2010-06-09 11:27:29 +02:00
#define CONFIGURATION "$configuration"
2006-11-28 19:29:24 +01:00
2008-10-04 15:07:31 +02:00
#define MPLAYER_CONFDIR "$_confdir"
2007-02-15 19:24:12 +01:00
2014-05-14 20:28:25 +02:00
/* we didn't bother to add actual config checks for this, or they are
for platforms not supported by this configure script */
2014-02-23 17:41:58 +01:00
#define HAVE_BSD_FSTATFS 0
2014-03-11 20:27:50 +01:00
#define HAVE_LINUX_FSTATFS 0
2014-05-13 01:09:53 +02:00
#define HAVE_VDA_AV_VDA_ALLOC_CONTEXT 0
2014-05-14 20:28:25 +02:00
#define HAVE_VDA_HWACCEL 0
#define HAVE_VDA_LIBAVCODEC_REFCOUNTING 0
#define HAVE_VDA_GL 0
#define HAVE_GL_COCOA 0
#define HAVE_COCOA 0
2014-08-06 20:31:25 +02:00
#define HAVE_COCOA_APPLICATION 0
2014-05-14 20:28:25 +02:00
#define HAVE_COREVIDEO 0
#define HAVE_COREAUDIO 0
#define HAVE_GL_WIN32 0
#define HAVE_DIRECT3D 0
#define HAVE_DSOUND 0
#define HAVE_WASAPI 0
#define HAVE_DOS_PATHS 0
#define HAVE_PRIORITY 0
#define HAVE_GLOB 1
#define HAVE_SYS_MMAN_H 1
2014-05-14 20:29:00 +02:00
#define HAVE_NANOSLEEP 1
#define HAVE_SDL1 0
2014-09-14 16:21:04 +02:00
#define HAVE_WAIO 0
2002-11-11 19:25:02 +01:00
2014-05-14 20:29:00 +02:00
#define DEFAULT_CDROM_DEVICE "/dev/cdrom"
2014-07-15 01:49:02 +02:00
#define DEFAULT_DVD_DEVICE "/dev/dvd"
2014-05-14 20:29:00 +02:00
#define PATH_DEV_DSP "/dev/dsp"
#define PATH_DEV_MIXER "/dev/mixer"
2001-02-24 21:28:24 +01:00
EOF
2014-05-14 20:29:00 +02:00
cat $CONFIG_H >> $TMPC
echo '#endif /* MPV_CONFIG_H */' >> $TMPC
2001-02-24 21:28:24 +01:00
2014-05-14 20:29:00 +02:00
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
cmp -s "$TMPC" old_build/config.h || mv -f "$TMPC" old_build/config.h
2001-08-22 10:51:19 +02:00
2001-11-17 04:53:05 +01:00
cat <<EOF
2014-05-14 20:29:00 +02:00
Configuration successful. See $TMPLOG for details.
2006-10-30 22:28:44 +01:00
NOTE: The --enable-* parameters unconditionally force options on, completely
skipping autodetection. This behavior is unlike what you may be used to from
autoconf-based configure scripts that can decide to override you. This greater
level of control comes at a price. You may have to provide the correct compiler
and linker flags yourself.
Remove compile time/runtime CPU detection, and drop some platforms
mplayer had three ways of enabling CPU specific assembler routines:
a) Enable them at compile time; crash if the CPU can't handle it.
b) Enable them at compile time, but let the configure script detect
your CPU. Your binary will only crash if you try to run it on a
different system that has less features than yours.
This was the default, I think.
c) Runtime detection.
The implementation of b) and c) suck. a) is not really feasible (it
sucks for users). Remove all code related to this, and use libav's CPU
detection instead. Now the configure script will always enable CPU
specific features, and disable them at runtime if libav reports them
not as available.
One implication is that now the compiler is always expected to handle
SSE (etc.) inline assembly at runtime, unless it's explicitly disabled.
Only checks for x86 CPU specific features are kept, the rest is either
unused or barely used.
Get rid of all the dump -mpcu, -march etc. flags. Trust the compiler
to select decent settings.
Get rid of support for the following operating systems:
- BSD/OS (some ancient BSD fork)
- QNX (don't care)
- BeOS (dead, Haiku support is still welcome)
- AIX (don't care)
- HP-UX (don't care)
- OS/2 (dead, actual support has been removed a while ago)
Remove the configure code for detecting the endianness. Instead, use
the standard header <endian.h>, which can be used if _GNU_SOURCE or
_BSD_SOURCE is defined. (Maybe these changes should have been in a
separate commit.)
Since this is a quite violent code removal orgy, and I'm testing only
on x86 32 bit Linux, expect regressions.
2012-07-29 17:20:57 +02:00
If you used one of these options and experience a compilation or
2011-10-25 06:05:47 +02:00
linking failure, make sure you have passed the necessary compiler/linker flags
to configure.
2002-01-07 13:17:21 +01:00
2013-07-16 13:28:28 +02:00
WARNING: The ./old-configure + make build system you are using is deprecated in
favour of waf and will be removed in a future version of mpv. Check the
README for instructions on how to build mpv with the new build system.
2014-05-14 20:29:00 +02:00
This will not work correctly on MinGW, Cygwin, OSX, and other systems.
2013-07-16 13:28:28 +02:00
2001-11-17 04:53:05 +01:00
EOF
2001-06-05 04:36:12 +02:00
# Last move:
2010-07-01 11:00:54 +02:00
rm -rf "$mplayer_tmpdir"