2001-10-25 13:46:50 +02:00
#! /bin/sh
2001-06-04 10:07:57 +02:00
#
2001-11-17 04:53:05 +01:00
# Original version (C) 2000 Pontscho/fresh!mindworkz
# pontscho@makacs.poliod.hu
2001-05-30 22:23:20 +02:00
#
2008-10-03 23:49:25 +02:00
# History / Contributors: Check the Subversion log.
2001-07-04 12:45:20 +02:00
#
2001-11-17 04:53:05 +01:00
# Cleanups all over the place (c) 2001 pl
2001-05-22 09:45:35 +02:00
#
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.
2006-04-27 16:26:57 +02:00
#
# 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
2009-02-08 23:49:52 +01:00
# def_feature : '#define ... 1' or '#undef ...' for conditional compilation
2006-04-27 16:26:57 +02:00
# _ld_feature : '-L/path/dir -lfeature' GCC options
2001-03-24 22:37:25 +01:00
#
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"
2011-01-21 00:44:26 +01:00
echo "$_cc $WARNFLAGS $WARN_CFLAGS $CFLAGS $source $extra_cflags $_ld_static $extra_ldflags $libs_mplayer -o $TMPEXE $@" >> "$TMPLOG"
2007-08-14 16:52:22 +02:00
rm -f "$TMPEXE"
2011-01-21 00:44:26 +01:00
$_cc $WARNFLAGS $WARN_CFLAGS $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
}
2005-10-18 23:30:43 +02:00
cc_check() {
compile_check $TMPC $@
}
cxx_check() {
compile_check $TMPCPP $@ -lstdc++
}
2010-07-02 01:03:40 +02:00
cflag_check() {
cat > $TMPC << EOF
int main(void) { return 0; }
EOF
compile_check $TMPC $@
}
2011-01-20 12:21:34 +01:00
header_check() {
cat > $TMPC << EOF
#include <$1>
int main(void) { return 0; }
EOF
shift
compile_check $TMPC $@
}
return_check() {
cat > $TMPC << EOF
#include <$1>
int main(void) { return $2; }
EOF
shift 2
compile_check $TMPC $@
}
2010-09-27 02:02:59 +02:00
statement_check() {
2010-07-01 12:14:30 +02:00
cat > $TMPC << EOF
#include <$1>
2010-07-02 11:38:46 +02:00
int main(void) { $2; return 0; }
2010-07-01 12:14:30 +02:00
EOF
2010-08-27 18:19:24 +02:00
shift
2010-07-01 12:14:30 +02:00
shift
compile_check $TMPC $@
}
2011-01-05 16:59:43 +01:00
define_statement_check() {
cat > $TMPC << EOF
#define $1
#include <$2>
int main(void) { $3; return 0; }
EOF
shift 3
compile_check $TMPC $@
}
2011-01-20 12:21:34 +01:00
return_statement_check() {
2010-06-16 21:09:06 +02:00
cat > $TMPC << EOF
#include <$1>
2011-01-20 12:21:34 +01:00
int main(void) { $2; return $3; }
2010-06-16 21:09:06 +02:00
EOF
2011-01-20 12:21:34 +01:00
shift 3
2010-06-16 21:09:06 +02:00
compile_check $TMPC $@
}
2010-09-14 15:37:47 +02:00
inline_asm_check() {
cat > $TMPC << EOF
int main(void) { __asm__ volatile ($1); return 0; }
EOF
shift
compile_check $TMPC $@
}
2010-09-18 11:49:12 +02:00
# The following checks are special and should only be used with broken and
# non-selfsufficient headers that do not include all of their dependencies.
2010-07-29 10:44:44 +02:00
header_check_broken() {
cat > $TMPC << EOF
#include <$1>
#include <$2>
int main(void) { return 0; }
EOF
shift
shift
compile_check $TMPC $@
}
2010-09-27 02:02:59 +02:00
statement_check_broken() {
2010-09-18 11:49:12 +02:00
cat > $TMPC << EOF
#include <$1>
#include <$2>
int main(void) { $3; return 0; }
EOF
shift 3
compile_check $TMPC $@
}
2012-02-27 14:51:35 +01:00
pkg_config_add() {
2012-03-04 20:53:42 +01:00
unset IFS # shell should not be used for programming
2012-02-27 14:51:35 +01:00
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"
extra_ldflags="$extra_ldflags $ltmp"
}
2005-10-18 23:44:14 +02:00
tmp_run() {
2007-08-14 16:52:22 +02:00
"$TMPEXE" >> "$TMPLOG" 2>&1
2005-10-18 23:44:14 +02: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
2007-08-14 16:52:22 +02:00
rm -f "$TMPEXE" "$TMPC" "$TMPS" "$TMPCPP"
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
# OS test booleans functions
2001-12-01 18:17:32 +01:00
issystem() {
2009-04-15 22:00:26 +02:00
test "$(echo $system_name | tr A-Z a-z)" = "$(echo $1 | tr A-Z a-z)"
2001-12-01 18:17:32 +01:00
}
2009-04-15 19:08:41 +02:00
cygwin() { issystem "CYGWIN"; }
darwin() { issystem "Darwin"; }
dragonfly() { issystem "DragonFly"; }
freebsd() { issystem "FreeBSD" || issystem "GNU/kFreeBSD"; }
gnu() { issystem "GNU"; }
linux() { issystem "Linux"; }
mingw32() { issystem "MINGW32"; }
morphos() { issystem "MorphOS"; }
netbsd() { issystem "NetBSD"; }
openbsd() { issystem "OpenBSD"; }
win32() { cygwin || mingw32; }
2001-10-13 18:53:37 +02:00
2001-11-19 13:04:19 +01:00
# arch test boolean functions
2006-12-24 01:08:57 +01:00
x86_32() {
2001-11-19 13:04:19 +01:00
case "$host_arch" in
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
i[3-9]86|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686) return 0 ;;
2001-11-19 13:04:19 +01:00
*) return 1 ;;
esac
}
2005-09-05 01:02:30 +02:00
x86_64() {
case "$host_arch" in
x86_64|amd64) return 0 ;;
*) return 1 ;;
esac
}
2006-12-24 01:08:57 +01:00
x86() {
x86_32 || x86_64
}
2002-06-06 18:46:05 +02:00
ppc() {
case "$host_arch" in
2008-08-05 00:38:57 +02:00
ppc|ppc64|powerpc|powerpc64) return 0;;
2002-06-06 18:46:05 +02:00
*) return 1;;
esac
2003-10-22 20:23:28 +02:00
}
alpha() {
case "$host_arch" in
2009-02-21 23:08:50 +01:00
alpha*) return 0;;
2003-10-22 20:23:28 +02:00
*) return 1;;
esac
2002-06-06 18:46:05 +02:00
}
2006-10-08 15:49:16 +02:00
arm() {
case "$host_arch" in
2010-01-17 00:22:43 +01:00
arm*) return 0;;
2006-10-08 15:49:16 +02:00
*) return 1;;
esac
}
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() {
2010-05-09 13:20:15 +02:00
if test "$res_comment" ; then
res_comment="($res_comment)"
2005-09-12 12:05:06 +02:00
fi
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
2010-03-28 13:49:09 +02:00
msg_lang_all=''
ls po/*.po >/dev/null 2>&1 && msg_lang_all=$(echo po/*.po | sed -e 's:po/\([^[:space:]]*\)\.po:\1:g')
2009-04-15 22:00:26 +02:00
man_lang_all=$(echo DOCS/man/??/mplayer.1 DOCS/man/??_??/mplayer.1 | sed -e "s:DOCS/man/\(..\)/mplayer.1:\1:g" -e "s:DOCS/man/\(.._..\)/mplayer.1:\1:g")
doc_lang_all=$(echo DOCS/xml/??/ DOCS/xml/??_??/ | sed -e "s:DOCS/xml/\(..\)/:\1:g" -e "s:DOCS/xml/\(.._..\)/:\1:g")
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
data files (skins, etc) [PREFIX/share/mplayer]
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
2003-02-02 12:46:57 +01:00
[PREFIX/etc/mplayer]
2010-03-08 21:48:50 +01:00
--localedir=DIR directory for locale tree [PREFIX/share/locale]
2006-11-06 01:09:07 +01:00
--libdir=DIR directory for object code libraries [PREFIX/lib]
2006-10-31 15:47:34 +01:00
--codecsdir=DIR directory for binary codecs [LIBDIR/codecs]
2001-10-23 20:32:55 +02:00
Optional features:
2006-11-20 17:14:01 +01:00
--disable-mplayer disable MPlayer compilation [enable]
2012-09-14 17:51:26 +02:00
--disable-encoding disable encoding functionality [enable]
2001-11-17 10:57:54 +01:00
--enable-termcap use termcap database for key codes [autodetect]
2004-04-14 01:26:31 +02:00
--enable-termios use termios database for key codes [autodetect]
2006-11-06 01:09:07 +01:00
--disable-iconv disable iconv for encoding conversion [autodetect]
2001-11-17 12:26:26 +01:00
--enable-lirc enable LIRC (remote control) support [autodetect]
2003-05-30 20:23:55 +02:00
--enable-lircc enable LIRCCD (LIRC client daemon) input [autodetect]
2002-09-09 21:23:06 +02:00
--enable-joystick enable joystick support [disable]
2007-08-14 16:29:22 +02:00
--enable-apple-remote enable Apple Remote input (Mac OS X only) [autodetect]
2008-05-18 13:53:00 +02:00
--enable-apple-ir enable Apple IR Remote input (Linux only) [autodetect]
2006-11-06 01:09:07 +01:00
--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]
2006-11-18 07:53:33 +01:00
--disable-radio-bsdbt848 disable BSD BT848 radio interface [autodetect]
2006-11-06 01:09:07 +01:00
--disable-tv disable TV interface (TV/DVB grabbers) [enable]
--disable-tv-v4l2 disable Video4Linux2 TV interface [autodetect]
--disable-tv-bsdbt848 disable BSD BT848 interface [autodetect]
--disable-pvr disable Video4Linux2 MPEG PVR [autodetect]
2010-07-17 15:14:53 +02:00
--disable-networking disable networking [enable]
2008-08-29 22:05:08 +02:00
--enable-winsock2_h enable winsock2_h [autodetect]
2006-11-06 01:09:07 +01:00
--enable-smb enable Samba (SMB) input [autodetect]
2012-03-02 20:24:34 +01:00
--enable-libquvi enable libquvi [autodetect]
2012-03-31 01:13:38 +02:00
--enable-lcms2 enable LCMS2 support [autodetect]
2009-05-05 19:15:54 +02:00
--disable-vcd disable VCD support [autodetect]
2010-07-05 19:04:46 +02:00
--disable-bluray disable Blu-ray support [autodetect]
2006-11-06 01:09:07 +01:00
--disable-dvdread disable libdvdread [autodetect]
2006-12-04 21:20:32 +01:00
--disable-cddb disable cddb [autodetect]
2006-11-06 01:09:07 +01:00
--disable-sortsub disable subtitle sorting [enabled]
--disable-enca disable ENCA charset oracle library [autodetect]
2008-08-03 18:16:10 +02:00
--enable-macosx-finder enable Mac OS X Finder invocation parameter
parsing [disabled]
2006-11-06 01:09:07 +01:00
--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]
2011-07-06 19:41:48 +02:00
--disable-libass disable subtitle rendering with libass [autodetect]
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
--disable-libass-osd disable OSD rendering with libass [autodetect]
2006-11-06 01:09:07 +01:00
--enable-rpath enable runtime linker path for extra libs [disabled]
2012-02-27 17:18:49 +01:00
--disable-libpostproc disable postprocess filter (vf_pp) [autodetect]
2003-10-27 02:06:35 +01:00
2002-09-09 21:23:06 +02:00
Codecs:
2010-01-04 13:24:07 +01:00
--enable-gif enable GIF support [autodetect]
2012-08-06 18:49:01 +02:00
--enable-png enable PNG input support [autodetect]
2010-01-04 13:24:07 +01:00
--enable-mng enable MNG input support [autodetect]
--enable-jpeg enable JPEG input/output support [autodetect]
--enable-libcdio enable libcdio support [autodetect]
2011-12-11 06:48:26 +01:00
--enable-libav skip Libav autodetection [autodetect]
2006-11-06 01:09:07 +01:00
--disable-ladspa disable LADSPA plugin support [autodetect]
2009-04-02 21:01:23 +02:00
--disable-libbs2b disable libbs2b audio filter support [autodetect]
2010-06-30 11:55:14 +02:00
--disable-mpg123 disable libmpg123 MP3 decoding support [autodetect]
2006-11-06 01:09:07 +01:00
2002-09-09 21:23:06 +02:00
Video output:
2006-11-06 01:09:07 +01:00
--enable-gl enable OpenGL video output [autodetect]
--enable-caca enable CACA video output [autodetect]
2008-11-18 13:23:42 +01:00
--enable-direct3d enable Direct3D video output [autodetect]
2006-11-06 01:09:07 +01:00
--enable-xv enable Xv video output [autodetect]
2009-02-16 21:58:13 +01:00
--enable-vdpau enable VDPAU acceleration [autodetect]
2006-11-06 01:09:07 +01:00
--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]
2007-12-22 12:09:43 +01:00
--disable-xss disable screensaver support via xss [autodetect]
2009-04-25 19:48:48 +02:00
--disable-corevideo disable CoreVideo video output [autodetect]
2011-10-15 18:44:00 +02:00
--disable-cocoa disable Cocoa OpenGL backend [autodetect]
2006-11-06 01:09:07 +01:00
2002-09-09 21:23:06 +02:00
Audio output:
2006-11-06 01:09:07 +01:00
--disable-alsa disable ALSA audio output [autodetect]
--disable-ossaudio disable OSS audio output [autodetect]
2011-06-24 15:56:43 +02:00
--disable-rsound disable RSound audio output [autodetect]
2007-10-18 15:34:26 +02:00
--disable-pulse disable Pulseaudio audio output [autodetect]
2012-04-27 11:26:04 +02:00
--disable-portaudio disable PortAudio audio output [autodetect]
2006-11-06 01:09:07 +01:00
--disable-jack disable JACK audio output [autodetect]
2009-10-06 04:08:33 +02:00
--enable-openal enable OpenAL audio output [disable]
2009-04-25 19:48:48 +02:00
--disable-coreaudio disable CoreAudio audio output [autodetect]
2006-11-06 01:09:07 +01:00
--disable-select disable using select() on the audio device [enable]
2001-10-13 18:53:37 +02:00
2009-06-14 16:55:01 +02:00
Language options:
2010-03-08 21:48:50 +01:00
--enable-translation enable support for translated output [disable]
2009-06-14 16:55:01 +02:00
--language-doc=lang language to use for the documentation [en]
--language-man=lang language to use for the man pages [en]
2010-03-28 13:49:09 +02:00
--language-msg=lang extra languages for program messages [all]
2009-06-14 16:55:01 +02:00
--language=lang default language to use [en]
Specific options override --language. You can pass a list of languages separated
by whitespace or commas instead of a single language. Nonexisting translations
2010-03-28 13:49:09 +02:00
will be dropped from each list. All translations available in the list will be
installed. The value "all" will activate all translations. The LINGUAS
environment variable is honored. In all cases the fallback is English.
The program always supports English-language output; additional message
languages are only installed if --enable-translation is also specified.
Available values for --language-doc are: all $doc_lang_all
Available values for --language-man are: all $man_lang_all
Available values for --language-msg are: all $msg_lang_all
2009-06-14 16:55:01 +02:00
2001-10-31 19:25:28 +01:00
Miscellaneous options:
2012-01-31 19:36:16 +01:00
--enable-cross-compile enable cross-compilation [disable]
2006-11-06 01:09:07 +01:00
--cc=COMPILER C compiler to build MPlayer [gcc]
2012-01-31 08:30:09 +01:00
--pkg-config=PKGCONFIG pkg-config to find some libraries [pkg-config]
2007-12-28 11:33:22 +01:00
--windres=WINDRES windres to build MPlayer [windres]
2001-10-23 20:32:55 +02:00
--target=PLATFORM target platform (i386-linux, arm-linux, etc)
2006-11-06 01:18:06 +01:00
--enable-static build a statically linked binary
2006-11-06 01:09:07 +01:00
--with-install=PATH path to a custom install program
2001-10-23 20:32:55 +02:00
Advanced options:
2006-11-06 01:09:07 +01:00
--enable-shm enable shm [autodetect]
--enable-debug[=1-3] compile-in debugging information [disable]
--enable-profile compile-in profiling information [disable]
2001-10-23 20:32:55 +02:00
2009-03-24 10:32:35 +01:00
Use these options if autodetection fails:
2009-03-24 00:37:51 +01:00
--extra-cflags=FLAGS extra CFLAGS
2009-03-24 10:32:35 +01:00
--extra-ldflags=FLAGS extra LDFLAGS
2006-11-06 01:09:07 +01:00
--extra-libs=FLAGS extra linker flags
2006-11-21 14:18:56 +01:00
--extra-libs-mplayer=FLAGS extra linker flags for MPlayer
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
2002-12-05 00:29:41 +01:00
_install=install
2012-01-31 08:29:53 +01:00
_pkg_config=auto
_windres=auto
_cc=auto
2001-10-23 20:32:55 +02:00
test "$CC" && _cc="$CC"
2012-08-25 20:01:03 +02:00
_debug=
_opt=-O2
2012-01-31 19:36:16 +01:00
_cross_compile=no
2007-01-31 00:18:51 +01:00
_prefix="/usr/local"
2010-10-31 02:19:56 +02:00
ffmpeg=auto
ffmpeg_internals=no
2007-01-31 00:18:51 +01:00
_mplayer=yes
2012-09-14 17:51:26 +02:00
_encoding=yes
2007-01-31 00:18:51 +01:00
_x11=auto
_xshape=auto
2007-12-22 12:09:43 +01:00
_xss=auto
2007-01-31 00:18:51 +01:00
_xv=auto
2009-02-16 21:58:13 +01:00
_vdpau=auto
2008-11-18 13:23:42 +01:00
_direct3d=auto
2007-01-31 00:18:51 +01:00
_nas=auto
_png=auto
2008-11-30 14:22:34 +01:00
_mng=auto
2007-01-31 00:18:51 +01:00
_jpeg=auto
_gif=auto
_gl=auto
_aa=auto
_caca=auto
_dvb=auto
_iconv=auto
_ossaudio=auto
2011-06-24 15:56:43 +02:00
_rsound=auto
2007-10-18 15:34:26 +02:00
_pulse=auto
2012-04-27 11:26:04 +02:00
_portaudio=auto
2007-01-31 00:18:51 +01:00
_jack=auto
2009-10-06 04:08:33 +02:00
_openal=no
2007-01-31 00:18:51 +01:00
_libcdio=auto
2010-06-30 11:55:14 +02:00
_mpg123=auto
2007-01-31 00:18:51 +01:00
_ladspa=auto
2009-04-02 21:01:23 +02:00
_libbs2b=auto
2009-05-05 19:15:54 +02:00
_vcd=auto
2010-07-05 19:04:46 +02:00
_bluray=auto
2007-01-31 00:18:51 +01:00
_dvdread=auto
2012-03-31 01:13:38 +02:00
_lcms2=auto
2007-01-31 00:18:51 +01:00
_xinerama=auto
_vm=auto
_xf86keysym=auto
_alsa=auto
_select=yes
_radio=no
_radio_capture=no
_radio_v4l2=auto
_radio_bsdbt848=auto
_tv=yes
_tv_v4l2=auto
_tv_bsdbt848=auto
_pvr=auto
2010-07-17 15:14:53 +02:00
networking=yes
2008-08-29 22:05:08 +02:00
_winsock2_h=auto
2008-08-03 17:57:18 +02:00
_smb=auto
2012-03-02 20:24:34 +01:00
_libquvi=auto
2007-01-31 00:18:51 +01:00
_joystick=no
_lirc=auto
_lircc=auto
2007-08-14 16:29:22 +02:00
_apple_remote=auto
2008-05-18 13:53:00 +02:00
_apple_ir=auto
2007-01-31 00:18:51 +01:00
_termcap=auto
_termios=auto
2009-06-14 15:25:54 +02:00
#language=en
2007-01-31 00:18:51 +01:00
_shm=auto
2010-03-08 21:48:50 +01:00
_translation=no
2012-03-21 00:57:58 +01:00
_cdda=auto
2007-01-31 00:18:51 +01:00
_cddb=auto
2009-04-25 19:48:48 +02:00
_coreaudio=auto
_corevideo=auto
2011-10-15 18:44:00 +02:00
_cocoa=auto
2008-08-03 18:16:10 +02:00
_macosx_finder=no
2007-01-31 00:18:51 +01:00
_macosx_bundle=auto
_sortsub=yes
_enca=auto
_inet6=auto
_gethostbyname2=auto
2010-09-22 00:26:44 +02:00
_ftp=auto
2007-01-31 00:18:51 +01:00
_vstream=auto
_pthreads=auto
_ass=auto
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
_libass_osd=auto
2007-01-31 00:18:51 +01:00
_rpath=no
2012-02-27 17:18:49 +01:00
libpostproc=auto
2007-01-31 00:18:51 +01:00
_asmalign_pot=auto
2007-02-27 18:13:17 +01:00
_stream_cache=yes
2009-02-10 16:34:44 +01:00
_priority=no
2009-02-04 19:22:28 +01:00
def_dos_paths="#define HAVE_DOS_PATHS 0"
2009-02-08 23:49:52 +01:00
def_stream_cache="#define CONFIG_STREAM_CACHE 1"
2009-02-10 16:34:44 +01:00
def_priority="#undef CONFIG_PRIORITY"
2009-02-08 23:49:52 +01:00
def_pthread_cache="#undef PTHREAD_CACHE"
2011-01-26 20:00:17 +01:00
need_shmem=yes
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
--datadir=*)
2009-04-15 22:00:26 +02:00
_datadir=$(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
;;
2007-01-31 00:59:39 +01:00
--libdir=*)
2009-04-15 22:00:26 +02:00
_libdir=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:59:39 +01:00
;;
--codecsdir=*)
2009-04-15 22:00:26 +02:00
_codecsdir=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:59:39 +01:00
;;
2010-03-08 21:48:50 +01:00
--localedir=*)
_localedir=$(echo $ac_option | cut -d '=' -f 2)
;;
2007-01-31 00:59:39 +01:00
--with-install=*)
2009-04-15 22:00:26 +02:00
_install=$(echo $ac_option | cut -d '=' -f 2 )
2007-01-31 00:59:39 +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
extra_libs=$(echo $ac_option | cut -d '=' -f 2)
2007-01-31 00:33:25 +01:00
;;
--extra-libs-mplayer=*)
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
--target=*)
2009-04-15 22:00:26 +02:00
_target=$(echo $ac_option | cut -d '=' -f 2)
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-12-28 11:33:22 +01:00
--windres=*)
2009-04-15 22:00:26 +02:00
_windres=$(echo $ac_option | cut -d '=' -f 2)
2007-12-28 11:33:22 +01:00
;;
2009-06-14 16:55:01 +02:00
--language-doc=*)
language_doc=$(echo $ac_option | cut -d '=' -f 2)
;;
--language-man=*)
language_man=$(echo $ac_option | cut -d '=' -f 2)
;;
2010-03-28 13:49:09 +02:00
--language-msg=*)
language_msg=$(echo $ac_option | cut -d '=' -f 2)
;;
2007-01-31 00:59:39 +01:00
--language=*)
2009-06-14 15:25:54 +02:00
language=$(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
;;
--enable-profile)
_profile='-p'
;;
--disable-profile)
_profile=
;;
--enable-debug)
_debug='-g'
2012-08-25 20:01:03 +02:00
_opt=
2007-01-31 00:33:25 +01:00
;;
--enable-debug=*)
2009-04-15 22:00:26 +02:00
_debug=$(echo $_echo_n '-g'$_echo_c; echo $ac_option | cut -d '=' -f 2)
2012-08-25 20:01:03 +02:00
_opt=
2007-01-31 00:33:25 +01:00
;;
--disable-debug)
_debug=
;;
2010-03-08 21:48:50 +01:00
--enable-translation) _translation=yes ;;
--disable-translation) _translation=no ;;
2007-01-31 00:59:39 +01:00
--enable-cross-compile) _cross_compile=yes ;;
--disable-cross-compile) _cross_compile=no ;;
2010-01-04 13:24:07 +01:00
--enable-mplayer) _mplayer=yes ;;
--disable-mplayer) _mplayer=no ;;
2012-09-14 17:51:26 +02:00
--enable-encoding) _encoding=yes ;;
--disable-encoding) _encoding=no ;;
2010-01-04 13:24:07 +01:00
--enable-x11) _x11=yes ;;
--disable-x11) _x11=no ;;
--enable-xshape) _xshape=yes ;;
--disable-xshape) _xshape=no ;;
--enable-xss) _xss=yes ;;
--disable-xss) _xss=no ;;
--enable-xv) _xv=yes ;;
--disable-xv) _xv=no ;;
2009-02-16 21:58:13 +01:00
--enable-vdpau) _vdpau=yes ;;
--disable-vdpau) _vdpau=no ;;
2008-11-18 13:23:42 +01:00
--enable-direct3d) _direct3d=yes ;;
--disable-direct3d) _direct3d=no ;;
2010-01-04 13:24:07 +01:00
--enable-png) _png=yes ;;
--disable-png) _png=no ;;
--enable-mng) _mng=yes ;;
--disable-mng) _mng=no ;;
--enable-jpeg) _jpeg=yes ;;
--disable-jpeg) _jpeg=no ;;
--enable-gif) _gif=yes ;;
--disable-gif) _gif=no ;;
--enable-gl) _gl=yes ;;
--disable-gl) _gl=no ;;
--enable-caca) _caca=yes ;;
--disable-caca) _caca=no ;;
--enable-dvb) _dvb=yes ;;
--disable-dvb) _dvb=no ;;
--enable-iconv) _iconv=yes ;;
--disable-iconv) _iconv=no ;;
--enable-ossaudio) _ossaudio=yes ;;
--disable-ossaudio) _ossaudio=no ;;
2011-06-24 15:56:43 +02:00
--enable-rsound) _rsound=yes ;;
--disable-rsound) _rsound=no ;;
2010-01-04 13:24:07 +01:00
--enable-pulse) _pulse=yes ;;
--disable-pulse) _pulse=no ;;
2012-04-27 11:26:04 +02:00
--enable-portaudio) _portaudio=yes ;;
--disable-portaudio) _portaudio=no ;;
2010-01-04 13:24:07 +01:00
--enable-jack) _jack=yes ;;
--disable-jack) _jack=no ;;
2012-09-18 21:34:01 +02:00
--enable-openal) _openal=auto ;;
2010-01-04 13:24:07 +01:00
--disable-openal) _openal=no ;;
--enable-libcdio) _libcdio=yes ;;
--disable-libcdio) _libcdio=no ;;
2010-06-30 11:55:14 +02:00
--enable-mpg123) _mpg123=yes ;;
--disable-mpg123) _mpg123=no ;;
2010-01-04 13:24:07 +01:00
--enable-ladspa) _ladspa=yes ;;
--disable-ladspa) _ladspa=no ;;
--enable-libbs2b) _libbs2b=yes ;;
--disable-libbs2b) _libbs2b=no ;;
2009-05-05 19:15:54 +02:00
--enable-vcd) _vcd=yes ;;
--disable-vcd) _vcd=no ;;
2010-07-05 19:04:46 +02:00
--enable-bluray) _bluray=yes ;;
--disable-bluray) _bluray=no ;;
2010-01-04 13:24:07 +01:00
--enable-dvdread) _dvdread=yes ;;
--disable-dvdread) _dvdread=no ;;
2012-03-31 01:13:38 +02:00
--enable-lcms2) _lcms2=yes ;;
--disable-lcms2) _lcms2=no ;;
2010-01-04 13:24:07 +01:00
--enable-xinerama) _xinerama=yes ;;
--disable-xinerama) _xinerama=no ;;
--enable-vm) _vm=yes ;;
--disable-vm) _vm=no ;;
--enable-xf86keysym) _xf86keysym=yes ;;
--disable-xf86keysym) _xf86keysym=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-v4l2) _tv_v4l2=yes ;;
--disable-tv-v4l2) _tv_v4l2=no ;;
--enable-radio) _radio=yes ;;
--enable-radio-capture) _radio_capture=yes ;;
--disable-radio-capture) _radio_capture=no ;;
--disable-radio) _radio=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 ;;
2010-07-17 15:14:53 +02:00
--enable-networking) networking=yes ;;
--disable-networking) networking=no ;;
2010-01-04 13:24:07 +01:00
--enable-winsock2_h) _winsock2_h=yes ;;
--disable-winsock2_h) _winsock2_h=no ;;
--enable-smb) _smb=yes ;;
--disable-smb) _smb=no ;;
2012-03-02 20:24:34 +01:00
--enable-libquvi) _libquvi=yes ;;
--disable-libquvi) _libquvi=no ;;
2010-01-04 13:24:07 +01:00
--enable-joystick) _joystick=yes ;;
--disable-joystick) _joystick=no ;;
2011-08-20 23:36:23 +02:00
--enable-libav) ffmpeg=yes ;;
2009-07-26 04:55:40 +02:00
--ffmpeg-source-dir=*)
_ffmpeg_source=$(echo $ac_option | cut -d '=' -f 2 ) ;;
2007-01-31 00:18:51 +01:00
2010-01-04 13:24:07 +01:00
--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 ;;
2008-05-18 13:53:00 +02:00
--enable-apple-ir) _apple_ir=yes ;;
--disable-apple-ir) _apple_ir=no ;;
2010-01-04 13:24:07 +01:00
--enable-termcap) _termcap=yes ;;
--disable-termcap) _termcap=no ;;
--enable-termios) _termios=yes ;;
2007-01-31 00:18:51 +01:00
--disable-termios) _termios=no ;;
2010-01-04 13:24:07 +01:00
--enable-shm) _shm=yes ;;
--disable-shm) _shm=no ;;
--enable-select) _select=yes ;;
--disable-select) _select=no ;;
--enable-cddb) _cddb=yes ;;
--disable-cddb) _cddb=no ;;
2007-01-31 00:18:51 +01:00
--enable-ftp) _ftp=yes ;;
--disable-ftp) _ftp=no ;;
--enable-vstream) _vstream=yes ;;
--disable-vstream) _vstream=no ;;
--enable-pthreads) _pthreads=yes ;;
--disable-pthreads) _pthreads=no ;;
2011-07-06 19:41:48 +02:00
--enable-libass) _ass=yes ;;
--disable-libass) _ass=no ;;
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
--enable-libass-osd) _libass_osd=yes ;;
--disable-libass-osd) _libass_osd=no ;;
2007-01-31 00:18:51 +01:00
--enable-rpath) _rpath=yes ;;
--disable-rpath) _rpath=no ;;
2012-02-27 17:18:49 +01:00
--enable-libpostproc) libpostproc=yes ;;
--disable-libpostproc) libpostproc=no ;;
2007-01-31 00:18:51 +01:00
2010-01-04 13:24:07 +01:00
--enable-enca) _enca=yes ;;
--disable-enca) _enca=no ;;
2007-01-31 00:18:51 +01:00
2010-01-04 13:24:07 +01:00
--enable-inet6) _inet6=yes ;;
--disable-inet6) _inet6=no ;;
2007-01-31 00:18:51 +01:00
2010-01-04 13:24:07 +01:00
--enable-gethostbyname2) _gethostbyname2=yes ;;
--disable-gethostbyname2) _gethostbyname2=no ;;
2007-01-31 00:18:51 +01:00
2009-04-25 19:48:48 +02:00
--enable-coreaudio) _coreaudio=yes ;;
--disable-coreaudio) _coreaudio=no ;;
--enable-corevideo) _corevideo=yes ;;
--disable-corevideo) _corevideo=no ;;
2011-10-15 18:44:00 +02:00
--enable-cocoa) _cocoa=yes ;;
--disable-cocoa) _cocoa=no ;;
2008-08-03 18:16:10 +02:00
--enable-macosx-finder) _macosx_finder=yes ;;
--disable-macosx-finder) _macosx_finder=no ;;
2010-01-04 13:24:07 +01:00
--enable-macosx-bundle) _macosx_bundle=yes ;;
--disable-macosx-bundle) _macosx_bundle=no ;;
2007-01-31 00:18:51 +01:00
--enable-sortsub) _sortsub=yes ;;
--disable-sortsub) _sortsub=no ;;
*)
2011-02-02 01:18:51 +01:00
echo "Unknown parameter: $ac_option" >&2
2007-01-31 00:18:51 +01:00
exit 1
;;
esac
done
# Atmos: moved this here, to be correct, if --prefix is specified
2010-01-04 13:24:07 +01:00
test -z "$_bindir" && _bindir="$_prefix/bin"
2007-01-31 00:18:51 +01:00
test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
2010-01-04 13:24:07 +01:00
test -z "$_mandir" && _mandir="$_prefix/share/man"
2007-01-31 00:18:51 +01:00
test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
2010-01-04 13:24:07 +01:00
test -z "$_libdir" && _libdir="$_prefix/lib"
2010-03-08 21:48:50 +01:00
test -z "$_localedir" && _localedir="$_prefix/share/locale"
2007-01-31 00:18:51 +01:00
2012-01-31 08:29:53 +01:00
for tmpdir in "$TMPDIR" "$TEMPDIR" "/tmp" ; do
test "$tmpdir" && break
done
mplayer_tmpdir="$tmpdir/mplayer-configure-$RANDOM-$$"
mkdir $mplayer_tmpdir || die "Unable to create tmpdir."
TMPLOG="config.log"
rm -f "$TMPLOG"
echo Parameters configure was run with: > "$TMPLOG"
if test -n "$CFLAGS" ; then
echo ${_echo_n} CFLAGS="'$CFLAGS' ${_echo_c}" >> "$TMPLOG"
fi
if test -n "$PKG_CONFIG_PATH" ; then
echo ${_echo_n} PKG_CONFIG_PATH="'$PKG_CONFIG_PATH' ${_echo_c}" >> "$TMPLOG"
fi
echo ./configure $configuration >> "$TMPLOG"
echo >> "$TMPLOG"
echocheck "cross compilation"
echores $_cross_compile
if test $_cross_compile = yes; then
tmp_run() {
return 0
}
fi
tool_prefix=""
if test $_cross_compile = yes ; then
# Usually cross-compiler prefixes match with the target triplet
test -n "$_target" && tool_prefix="$_target"-
fi
test "$_windres" = auto && _windres="$tool_prefix"windres
test "$_pkg_config" = auto && _pkg_config="$tool_prefix"pkg-config
if test "$_cc" = auto ; then
if test -n "$tool_prefix" ; then
_cc="$tool_prefix"gcc
else
_cc=cc
fi
fi
2007-01-31 00:18:51 +01:00
# Determine our OS name and CPU architecture
if test -z "$_target" ; then
# OS name
2009-04-15 22:00:26 +02:00
system_name=$(uname -s 2>&1)
2007-01-31 00:18:51 +01:00
case "$system_name" in
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
Linux|FreeBSD|NetBSD|OpenBSD|DragonFly|Darwin|GNU|MorphOS)
2007-01-31 00:18:51 +01:00
;;
2009-09-19 14:56:19 +02:00
Haiku)
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
system_name=Haiku
2009-09-19 14:56:19 +02:00
;;
2007-01-31 00:18:51 +01:00
GNU/kFreeBSD)
system_name=FreeBSD
;;
[cC][yY][gG][wW][iI][nN]*)
system_name=CYGWIN
;;
MINGW32*)
system_name=MINGW32
;;
*)
system_name="$system_name-UNKNOWN"
;;
esac
# host's CPU/instruction set
2009-04-15 22:00:26 +02:00
host_arch=$(uname -p 2>&1)
2007-01-31 00:18:51 +01:00
case "$host_arch" in
2008-08-07 13:58:37 +02:00
i386|sparc|ppc|alpha|arm|mips|vax)
2007-01-31 00:18:51 +01:00
;;
powerpc) # Darwin returns 'powerpc'
host_arch=ppc
;;
*) # uname -p on Linux returns 'unknown' for the processor type,
# OpenBSD returns 'Intel Pentium/MMX ("Genuine Intel" 586-class)'
# Maybe uname -m (machine hardware name) returns something we
# recognize.
2009-04-15 22:00:26 +02:00
case "$(uname -m 2>&1)" in
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
x86_64|amd64|i[3-9]86*|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
2007-01-31 00:18:51 +01:00
ia64) host_arch=ia64 ;;
2009-06-01 11:35:16 +02:00
macppc|ppc) host_arch=ppc ;;
ppc64) host_arch=ppc64 ;;
2007-01-31 00:18:51 +01:00
alpha) host_arch=alpha ;;
sparc) host_arch=sparc ;;
2004-08-14 17:17:39 +02:00
sparc64) host_arch=sparc64 ;;
2003-12-23 23:47:11 +01:00
parisc*|hppa*|9000*) host_arch=hppa ;;
2006-02-12 15:17:39 +01:00
arm*|zaurus|cats) host_arch=arm ;;
2008-08-07 13:58:37 +02:00
sh3|sh4|sh4a) host_arch=sh ;;
2002-05-23 16:38:40 +02:00
s390) host_arch=s390 ;;
s390x) host_arch=s390x ;;
2009-08-19 10:47:46 +02:00
*mips*) host_arch=mips ;;
2004-06-11 11:58:27 +02:00
vax) host_arch=vax ;;
2007-12-11 23:37:36 +01:00
xtensa*) host_arch=xtensa ;;
2001-11-18 18:45:23 +01:00
*) host_arch=UNKNOWN ;;
2001-11-17 04:53:05 +01:00
esac
;;
esac
2005-10-23 13:26:36 +02:00
else # if test -z "$_target"
2010-08-02 06:21:51 +02:00
for i in 2 3; do
system_name=$(echo $_target | cut -d '-' -f $i)
case "$(echo $system_name | tr A-Z a-z)" in
linux) system_name=Linux ;;
freebsd) system_name=FreeBSD ;;
gnu/kfreebsd) system_name=FreeBSD ;;
netbsd) system_name=NetBSD ;;
openbsd) system_name=OpenBSD ;;
dragonfly) system_name=DragonFly ;;
morphos) system_name=MorphOS ;;
mingw32*) system_name=MINGW32 ;;
*) continue ;;
esac
break
done
2002-06-14 00:44:28 +02:00
# We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
2009-04-15 22:00:26 +02:00
host_arch=$(echo $_target | cut -d '-' -f 1)
if test $(echo $host_arch) != "x86_64" ; then
host_arch=$(echo $host_arch | tr '_' '-')
2007-09-12 08:59:36 +02:00
fi
2001-06-21 02:06:40 +02:00
fi
2009-03-25 20:48:05 +01:00
extra_cflags="-I. $extra_cflags"
2008-04-08 20:03:14 +02:00
_timer=timer-linux.c
_getch=getch2.c
2008-03-27 03:04:03 +01:00
2003-04-24 20:55:43 +02:00
if darwin; then
2010-08-03 13:46:55 +02:00
extra_cflags="-mdynamic-no-pic $extra_cflags"
2008-04-08 20:03:14 +02:00
_timer=timer-darwin.c
2003-04-24 20:55:43 +02:00
fi
2001-06-05 20:40:44 +02:00
2007-01-28 23:31:53 +01:00
if win32 ; then
_exesuf=".exe"
2010-01-15 10:31:15 +01:00
extra_cflags="$extra_cflags -fno-common"
2007-01-28 23:31:53 +01:00
# -lwinmm is always needed for osdep/timer-win2.c
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -lwinmm"
2008-04-13 09:57:35 +02:00
_pe_executable=yes
2008-04-08 20:03:14 +02:00
_timer=timer-win2.c
2009-02-10 16:34:44 +01:00
_priority=yes
2009-02-04 19:22:28 +01:00
def_dos_paths="#define HAVE_DOS_PATHS 1"
2009-02-10 16:34:44 +01:00
def_priority="#define CONFIG_PRIORITY 1"
2007-01-28 23:31:53 +01:00
fi
2007-02-27 18:13:17 +01:00
if mingw32 ; then
2008-04-08 20:03:14 +02:00
_getch=getch2-win.c
2011-01-26 20:00:17 +01:00
need_shmem=no
2012-01-31 08:31:04 +01:00
extra_cflags="$extra_cflags -D__USE_MINGW_ANSI_STDIO=1"
2012-08-07 01:09:42 +02:00
# Hack for missing BYTE_ORDER declarations in <sys/types.h>.
# (For some reason, they are in <sys/param.h>, but we don't bother switching
# the includes based on whether we're compiling for MinGW.)
extra_cflags="$extra_cflags -DBYTE_ORDER=1234 -DLITTLE_ENDIAN=1234 -DBIG_ENDIAN=4321"
2007-02-27 18:13:17 +01:00
fi
2010-07-01 11:00:54 +02:00
TMPC="$mplayer_tmpdir/tmp.c"
TMPCPP="$mplayer_tmpdir/tmp.cpp"
TMPEXE="$mplayer_tmpdir/tmp$_exesuf"
TMPH="$mplayer_tmpdir/tmp.h"
TMPS="$mplayer_tmpdir/tmp.S"
2007-09-30 00:26:35 +02:00
2001-06-05 09:10:00 +02:00
# Checking CC version...
2008-05-01 19:43:12 +02:00
# Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
2009-04-15 22:00:26 +02:00
if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then
2001-11-17 04:53:05 +01:00
echocheck "$_cc version"
2004-08-02 06:24:36 +02:00
cc_vendor=intel
2009-04-16 12:02:10 +02:00
cc_name=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 1)
cc_version=$($_cc -V 2>&1 | head -n 1 | cut -d ',' -f 2 | cut -d ' ' -f 3)
2009-04-15 22:00:26 +02:00
_cc_major=$(echo $cc_version | cut -d '.' -f 1)
_cc_minor=$(echo $cc_version | cut -d '.' -f 2)
2004-08-02 06:24:36 +02:00
# TODO verify older icc/ecc compatibility
case $cc_version in
'')
cc_version="v. ?.??, bad"
2008-05-01 19:25:19 +02:00
cc_fail=yes
2004-08-02 06:24:36 +02:00
;;
2009-03-18 22:48:35 +01:00
10.1|11.0|11.1)
2004-08-02 06:24:36 +02:00
cc_version="$cc_version, ok"
2002-06-07 00:58:18 +02:00
;;
2001-11-17 04:53:05 +01:00
*)
cc_version="$cc_version, bad"
2008-05-01 19:25:19 +02:00
cc_fail=yes
2001-11-17 04:53:05 +01:00
;;
esac
echores "$cc_version"
2001-06-04 22:12:41 +02:00
else
2010-01-12 22:16:01 +01:00
for _cc in "$_cc" gcc cc ; do
2009-04-16 12:02:10 +02:00
cc_name_tmp=$($_cc -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
2008-05-04 13:35:07 +02:00
if test "$cc_name_tmp" = "gcc"; then
2010-06-27 21:20:38 +02:00
cc_name=$cc_name_tmp
echocheck "$_cc version"
cc_vendor=gnu
cc_version=$($_cc -dumpversion 2>&1)
case $cc_version in
2.96*)
cc_fail=yes
;;
*)
_cc_major=$(echo $cc_version | cut -d '.' -f 1)
_cc_minor=$(echo $cc_version | cut -d '.' -f 2)
_cc_mini=$(echo $cc_version | cut -d '.' -f 3)
;;
esac
echores "$cc_version"
break
2008-05-04 13:35:07 +02:00
fi
2011-06-25 03:22:43 +02:00
if $_cc -v 2>&1 | grep -q "clang"; then
2010-06-27 21:07:51 +02:00
echocheck "$_cc version"
cc_vendor=clang
cc_version=$($_cc -dumpversion 2>&1)
res_comment="experimental support only"
echores "clang $cc_version"
break
fi
2010-01-12 22:16:01 +01:00
cc_name_tmp=$($_cc -V 2>&1 | head -n 1 | cut -d ' ' -f 2,3)
2008-05-01 19:43:12 +02:00
done
fi # icc
2008-05-01 19:40:38 +02:00
test "$cc_fail" = yes && die "unsupported compiler version"
2001-10-06 17:38:56 +02:00
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 ."
echo "yes"
2012-08-16 11:08:38 +02:00
echocheck "python3"
command_check python3 -c '' || die "Python 3 is not functioning correctly. Check your installation and PATH."
echo yes
2009-10-26 23:15:19 +01:00
if test -z "$_target" && x86 ; then
cat > $TMPC << EOF
int main(void) {
2009-11-05 20:05:42 +01:00
int test[(int)sizeof(char *)-7];
2009-10-26 23:15:19 +01:00
return 0;
}
EOF
cc_check && host_arch=x86_64 || host_arch=i386
fi
2012-01-31 08:29:53 +01:00
echo "Detected operating system: $system_name"
echo "Detected host architecture: $host_arch"
2001-02-24 21:28:24 +01:00
# ---
2001-07-04 12:45:20 +02:00
# now that we know what compiler should be used for compilation, try to find
# out which assembler is used by the $_cc compiler
2001-10-12 01:41:43 +02:00
if test "$_as" = auto ; then
2009-04-15 22:00:26 +02:00
_as=$($_cc -print-prog-name=as)
2001-11-17 04:53:05 +01:00
test -z "$_as" && _as=as
fi
2009-01-31 23:37:12 +01:00
def_fast_64bit='#define HAVE_FAST_64BIT 0'
2010-03-17 15:09:09 +01:00
arch_all='X86 IA64 SPARC ARM AVR32 SH4 PPC ALPHA MIPS PA_RISC S390 S390X VAX BFIN XTENSA TOMI GENERIC'
2010-03-17 14:20:06 +01:00
subarch_all='X86_32 X86_64 PPC64'
2007-01-31 00:18:51 +01:00
case "$host_arch" in
i[3-9]86|x86|x86pc|k5|k6|k6-2|k6-3|pentium*|athlon*|i586-i686)
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
arch='x86'
subarch='x86_32'
iproc=486
proc=i486
2003-12-25 13:05:28 +01:00
;;
2007-01-31 00:18:51 +01:00
ia64)
2010-03-17 14:41:54 +01:00
arch='ia64'
2008-12-02 17:40:44 +01:00
def_fast_64bit='#define HAVE_FAST_64BIT 1'
2007-01-31 00:18:51 +01:00
iproc='ia64'
2006-11-25 18:58:33 +01:00
;;
2007-01-31 00:18:51 +01:00
x86_64|amd64)
2010-03-17 14:41:54 +01:00
arch='x86'
subarch='x86_64'
2008-12-02 17:40:44 +01:00
def_fast_64bit='#define HAVE_FAST_64BIT 1'
2007-01-31 00:18:51 +01:00
iproc='x86_64'
;;
2001-08-14 16:34:27 +02:00
2008-10-04 11:38:10 +02:00
sparc|sparc64)
2010-03-17 14:41:54 +01:00
arch='sparc'
2007-01-31 00:18:51 +01:00
iproc='sparc'
;;
2010-01-17 00:22:43 +01:00
arm*)
2010-03-17 14:41:54 +01:00
arch='arm'
2007-01-31 00:18:51 +01:00
iproc='arm'
2007-07-26 10:21:42 +02:00
;;
2009-02-16 18:02:16 +01:00
avr32)
2010-03-17 14:41:54 +01:00
arch='avr32'
2009-02-16 18:02:16 +01:00
iproc='avr32'
;;
2009-01-15 16:41:29 +01:00
sh|sh4)
2010-03-17 14:41:54 +01:00
arch='sh4'
2009-01-15 16:41:29 +01:00
iproc='sh4'
2007-01-31 00:18:51 +01:00
;;
2001-11-19 01:38:41 +01:00
2008-08-05 00:38:57 +02:00
ppc|ppc64|powerpc|powerpc64)
2010-03-17 14:41:54 +01:00
arch='ppc'
2007-01-31 00:18:51 +01:00
iproc='ppc'
;;
2009-02-21 23:08:50 +01:00
alpha*)
2010-03-17 14:41:54 +01:00
arch='alpha'
2007-01-31 00:18:51 +01:00
iproc='alpha'
;;
2010-10-21 14:58:21 +02:00
mips*)
2010-03-17 15:09:09 +01:00
arch='mips'
iproc='mips'
2007-01-31 00:18:51 +01:00
;;
hppa)
2010-03-17 14:41:54 +01:00
arch='pa_risc'
2007-01-31 00:18:51 +01:00
iproc='PA-RISC'
;;
s390)
2010-03-17 14:41:54 +01:00
arch='s390'
2007-01-31 00:18:51 +01:00
iproc='390'
;;
s390x)
2010-03-17 14:41:54 +01:00
arch='s390x'
2007-01-31 00:18:51 +01:00
iproc='390x'
;;
2004-05-08 19:52:25 +02:00
2007-01-31 00:18:51 +01:00
vax)
2010-03-17 14:41:54 +01:00
arch='vax'
2007-01-31 00:18:51 +01:00
iproc='vax'
;;
2003-03-26 12:35:13 +01:00
2007-12-11 23:37:36 +01:00
xtensa)
2010-03-17 14:41:54 +01:00
arch='xtensa'
2007-12-11 23:37:36 +01:00
iproc='xtensa'
;;
2007-01-31 00:18:51 +01:00
generic)
2010-03-17 14:41:54 +01:00
arch='generic'
2007-01-31 00:18:51 +01:00
;;
2003-03-26 12:35:13 +01:00
2007-01-31 00:18:51 +01:00
*)
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
2001-07-03 16:22:23 +02:00
2007-01-31 00:18:51 +01:00
echocheck "assembler support of -pipe option"
2010-01-12 22:12:23 +01:00
# -I. helps to detect compilers that just misunderstand -pipe like Sun C
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
2007-01-31 00:18:51 +01:00
# Checking for CFLAGS
2007-02-27 18:10:11 +01:00
_install_strip="-s"
2007-01-31 00:18:51 +01:00
if test "$_profile" != "" || test "$_debug" != "" ; then
2007-02-27 18:10:11 +01:00
_install_strip=
2012-04-19 16:05:50 +02:00
fi
if test -z "$CFLAGS" ; then
2007-01-31 00:18:51 +01:00
if test "$cc_vendor" = "intel" ; then
2012-08-25 20:01:03 +02:00
CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe -fomit-frame-pointer"
2010-09-12 01:30:52 +02:00
WARNFLAGS="-wd167 -wd556 -wd144"
2010-08-01 00:15:49 +02:00
elif test "$cc_vendor" = "clang"; then
2012-08-25 20:01:03 +02:00
CFLAGS="$_opt $_debug $_profile $_march $_pipe"
2011-07-07 21:51:23 +02:00
WARNFLAGS="-Wall -Wno-switch-enum -Wno-logical-op-parentheses -Wpointer-arith -Wundef -Wno-pointer-sign -Wmissing-prototypes"
ERRORFLAGS="-Werror=implicit-function-declaration"
2007-01-31 00:18:51 +01:00
elif test "$cc_vendor" != "gnu" ; then
2012-08-25 20:01:03 +02:00
CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe"
2007-01-31 00:18:51 +01:00
else
2012-08-25 20:01:03 +02:00
CFLAGS="$_opt $_debug $_profile $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
2010-09-12 01:30:52 +02:00
WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
2011-07-06 09:53:41 +02:00
ERRORFLAGS="-Werror-implicit-function-declaration"
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -ffast-math"
2007-01-31 00:18:51 +01:00
fi
else
2010-07-02 00:19:57 +02:00
warn_cflags=yes
2007-01-31 00:18:51 +01:00
fi
2009-04-10 20:29:01 +02:00
if test "$cc_vendor" = "gnu" ; then
2010-09-12 01:30:52 +02:00
cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
# -std=gnu99 is not a warning flag but is placed in WARN_CFLAGS because
# that's the only variable specific to C now, and this option is not valid
# for C++.
cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
2009-04-10 20:29:01 +02:00
else
CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
fi
2010-10-30 19:58:37 +02:00
cflag_check -MD -MP && DEPFLAGS="-MD -MP"
2009-04-10 20:29:01 +02:00
2007-01-31 00:18:51 +01:00
if test -n "$LDFLAGS" ; then
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags $LDFLAGS"
2010-07-02 00:19:57 +02:00
warn_cflags=yes
2007-01-31 00:18:51 +01:00
elif test "$cc_vendor" = "intel" ; then
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -i-static"
2007-01-31 00:18:51 +01:00
fi
if test -n "$CPPFLAGS" ; then
2009-03-25 20:48:05 +01:00
extra_cflags="$extra_cflags $CPPFLAGS"
2010-07-02 00:19:57 +02:00
warn_cflags=yes
2007-01-31 00:18:51 +01:00
fi
2001-10-22 09:43:32 +02:00
2001-10-10 15:07:42 +02:00
2010-07-13 13:46:54 +02:00
echocheck "PIC"
pic=no
cat > $TMPC << EOF
int main(void) {
#if !(defined(__PIC__) || defined(__pic__) || defined(PIC))
#error PIC not enabled
#endif
return 0;
}
EOF
cc_check && pic=yes && extra_cflags="$extra_cflags -DPIC"
echores $pic
2009-01-11 14:33:44 +01:00
if x86 ; then
2010-09-21 15:51:33 +02:00
echocheck ".align is a power of two"
if test "$_asmalign_pot" = auto ; then
_asmalign_pot=no
inline_asm_check '".align 3"' && _asmalign_pot=yes
fi
if test "$_asmalign_pot" = "yes" ; then
def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
else
def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
fi
echores $_asmalign_pot
2009-09-19 15:18:48 +02:00
echocheck "ebx availability"
ebx_available=no
def_ebx_available='#define HAVE_EBX_AVAILABLE 0'
cat > $TMPC << EOF
int main(void) {
int x;
__asm__ volatile(
"xor %0, %0"
:"=b"(x)
// just adding ebx to clobber list seems unreliable with some
// compilers, e.g. Haiku's gcc 2.95
);
2009-09-30 20:45:02 +02:00
// and the above check does not work for OSX 64 bit...
__asm__ volatile("":::"%ebx");
2009-09-19 15:18:48 +02:00
return 0;
}
EOF
cc_check && ebx_available=yes && def_ebx_available='#define HAVE_EBX_AVAILABLE 1'
echores $ebx_available
2009-01-11 14:33:44 +01:00
fi #if x86
2001-11-17 04:53:05 +01:00
######################
# MAIN TESTS GO HERE #
######################
2001-08-25 23:05:23 +02:00
2004-10-11 21:26:13 +02:00
echocheck "-lm"
2010-07-02 01:03:40 +02:00
if cflag_check -lm ; then
2004-10-11 21:26:13 +02:00
_ld_lm="-lm"
echores "yes"
else
_ld_lm=""
echores "no"
fi
2001-08-24 18:20:04 +02:00
2002-03-15 21:48:42 +01:00
2010-03-08 21:48:50 +01:00
echocheck "translation support"
if test "$_translation" = yes; then
def_translation="#define CONFIG_TRANSLATION 1"
else
def_translation="#undef CONFIG_TRANSLATION"
fi
echores "$_translation"
2002-03-15 21:48:42 +01:00
echocheck "language"
2009-06-14 16:55:01 +02:00
# Set preferred languages, "all" uses English as main language.
2009-06-14 15:25:54 +02:00
test -z "$language" && language=$LINGUAS
2009-06-14 16:55:01 +02:00
test -z "$language_doc" && language_doc=$language
test -z "$language_man" && language_man=$language
2011-02-15 15:33:27 +01:00
test -z "$language_msg" && language_msg=$language
2010-03-28 13:49:09 +02:00
test -z "$language_msg" && language_msg="all"
2009-06-14 16:55:01 +02:00
language_doc=$(echo $language_doc | tr , " ")
language_man=$(echo $language_man | tr , " ")
2010-03-28 13:49:09 +02:00
language_msg=$(echo $language_msg | tr , " ")
2009-06-14 16:55:01 +02:00
test "$language_doc" = "all" && language_doc=$doc_lang_all
test "$language_man" = "all" && language_man=$man_lang_all
2010-03-28 13:49:09 +02:00
test "$language_msg" = "all" && language_msg=$msg_lang_all
if test "$_translation" != yes ; then
language_msg=""
fi
2009-06-14 16:55:01 +02:00
# Prune non-existing translations from language lists.
# Set message translation to the first available language.
# Fall back on English.
for lang in $language_doc ; do
test -d DOCS/xml/$lang && tmp_language_doc="$tmp_language_doc $lang"
done
language_doc=$tmp_language_doc
2009-06-14 20:51:36 +02:00
test -z "$language_doc" && language_doc=en
2009-06-14 16:55:01 +02:00
for lang in $language_man ; do
test -d DOCS/man/$lang && tmp_language_man="$tmp_language_man $lang"
done
language_man=$tmp_language_man
2009-06-14 20:51:36 +02:00
test -z "$language_man" && language_man=en
2009-06-14 16:55:01 +02:00
2010-03-28 13:49:09 +02:00
for lang in $language_msg ; do
test -f po/$lang.po && tmp_language_msg="$tmp_language_msg $lang"
done
language_msg=$tmp_language_msg
echores "messages (en+): $language_msg - man pages: $language_man - documentation: $language_doc"
2004-08-05 02:14:16 +02:00
2002-03-15 21:48:42 +01:00
2004-11-22 11:28:36 +01:00
echocheck "__builtin_expect"
# GCC branch prediction hint
cat > $TMPC << EOF
2010-09-14 11:41:32 +02:00
static int foo(int a) {
2008-12-03 15:54:04 +01:00
a = __builtin_expect(a, 10);
2004-11-22 11:28:36 +01:00
return a == 10 ? 0 : 1;
}
2007-11-21 10:17:04 +01:00
int main(void) { return foo(10) && foo(0); }
2004-11-22 11:28:36 +01:00
EOF
_builtin_expect=no
cc_check && _builtin_expect=yes
if test "$_builtin_expect" = yes ; then
2009-02-08 23:49:52 +01:00
def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
2004-11-22 11:28:36 +01:00
else
2009-02-08 23:49:52 +01:00
def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
2004-11-22 11:28:36 +01:00
fi
echores "$_builtin_expect"
2007-07-11 21:47:20 +02:00
echocheck "mkstemp"
_mkstemp=no
2011-01-05 17:01:01 +01:00
define_statement_check "_XOPEN_SOURCE 600" "stdlib.h" 'mkstemp("")' && _mkstemp=yes
2007-07-11 21:47:20 +02:00
if test "$_mkstemp" = yes ; then
2009-02-08 23:49:52 +01:00
def_mkstemp='#define HAVE_MKSTEMP 1'
2007-07-11 21:47:20 +02:00
else
2010-09-18 16:51:55 +02:00
def_mkstemp='#define HAVE_MKSTEMP 0'
2007-07-11 21:47:20 +02:00
fi
echores "$_mkstemp"
2001-11-23 19:25:09 +01:00
echocheck "nanosleep"
_nanosleep=no
2010-09-27 02:02:59 +02:00
statement_check time.h 'nanosleep(0, 0)' && _nanosleep=yes
2001-11-23 19:25:09 +01:00
if test "$_nanosleep" = yes ; then
2009-02-08 23:49:52 +01:00
def_nanosleep='#define HAVE_NANOSLEEP 1'
2001-11-23 19:25:09 +01:00
else
2009-02-08 23:49:52 +01:00
def_nanosleep='#undef HAVE_NANOSLEEP'
2001-11-23 19:25:09 +01:00
fi
echores "$_nanosleep"
2001-11-17 04:53:05 +01:00
echocheck "socklib"
# for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
cat > $TMPC << EOF
2001-11-20 17:16:47 +01:00
#include <netdb.h>
2005-10-15 12:46:24 +02:00
#include <sys/socket.h>
2010-09-14 12:05:46 +02:00
int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
2001-11-17 04:53:05 +01:00
EOF
2006-10-11 16:06:38 +02:00
_socklib=no
2006-10-11 16:09:30 +02:00
for _ld_tmp in "" "-lsocket -lbind" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
2006-10-11 16:06:38 +02:00
cc_check $_ld_tmp && _ld_sock="$_ld_tmp" && _socklib=yes && break
2005-10-03 21:36:32 +02:00
done
2009-12-09 18:55:34 +01:00
test $_socklib = yes && test $_winsock2_h = auto && _winsock2_h=no
if test $_winsock2_h = auto ; then
2008-08-29 22:05:08 +02:00
_winsock2_h=no
2010-09-27 02:02:59 +02:00
statement_check winsock2.h 'gethostbyname(0)' -lws2_32 && _ld_sock="-lws2_32" && _winsock2_h=yes
2003-06-11 18:48:09 +02:00
fi
2010-05-09 13:20:15 +02:00
test "$_ld_sock" && res_comment="using $_ld_sock"
2006-10-11 16:06:38 +02:00
echores "$_socklib"
2001-07-12 17:35:52 +02:00
2001-11-17 04:53:05 +01:00
2008-08-29 22:05:08 +02:00
if test $_winsock2_h = yes ; then
2003-06-11 18:48:09 +02:00
_ld_sock="-lws2_32"
2008-10-15 01:00:04 +02:00
def_winsock2_h='#define HAVE_WINSOCK2_H 1'
2003-06-11 18:48:09 +02:00
else
2009-02-01 14:42:27 +01:00
def_winsock2_h='#define HAVE_WINSOCK2_H 0'
2003-06-11 18:48:09 +02:00
fi
2001-12-30 20:38:28 +01:00
echocheck "inet_pton()"
2009-02-01 15:38:28 +01:00
def_inet_pton='#define HAVE_INET_PTON 0'
inet_pton=no
2009-02-01 15:57:01 +01:00
for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2010-09-27 02:02:59 +02:00
statement_check arpa/inet.h 'inet_pton(0, 0, 0)' $_ld_tmp && inet_pton=yes && break
2009-02-01 15:57:01 +01:00
done
if test $inet_pton = yes ; then
2010-05-09 13:20:15 +02:00
test "$_ld_tmp" && res_comment="using $_ld_tmp"
2009-02-01 15:38:28 +01:00
def_inet_pton='#define HAVE_INET_PTON 1'
fi
echores "$inet_pton"
2008-05-03 22:14:50 +02:00
2009-02-01 15:57:01 +01:00
2009-02-01 15:39:33 +01:00
echocheck "inet_aton()"
2009-02-01 15:38:28 +01:00
def_inet_aton='#define HAVE_INET_ATON 0'
inet_aton=no
2009-02-01 15:57:01 +01:00
for _ld_tmp in "$_ld_sock" "$_ld_sock -lresolv" ; do
2010-09-27 02:02:59 +02:00
statement_check arpa/inet.h 'inet_aton(0, 0)' $_ld_tmp && inet_aton=yes && break
2009-02-01 15:57:01 +01:00
done
if test $inet_aton = yes ; then
2010-05-09 13:20:15 +02:00
test "$_ld_tmp" && res_comment="using $_ld_tmp"
2009-02-01 15:39:33 +01:00
def_inet_aton='#define HAVE_INET_ATON 1'
2002-08-29 09:07:12 +02:00
fi
2009-02-01 15:38:28 +01:00
echores "$inet_aton"
2002-03-15 21:48:42 +01:00
2008-07-30 11:42:37 +02:00
echocheck "socklen_t"
2008-08-01 07:35:30 +02:00
_socklen_t=no
2008-11-18 10:41:31 +01:00
for header in "sys/socket.h" "ws2tcpip.h" "sys/types.h" ; do
2010-09-27 02:46:28 +02:00
statement_check $header 'socklen_t v = 0' && _socklen_t=yes && break
2008-07-30 20:16:57 +02:00
done
2008-07-30 11:42:37 +02:00
if test "$_socklen_t" = yes ; then
2009-02-08 23:49:52 +01:00
def_socklen_t='#define HAVE_SOCKLEN_T 1'
2008-07-30 11:42:37 +02:00
else
2009-02-08 23:49:52 +01:00
def_socklen_t='#define HAVE_SOCKLEN_T 0'
2008-07-30 11:42:37 +02:00
fi
echores "$_socklen_t"
2008-08-29 18:20:35 +02:00
echocheck "closesocket()"
_closesocket=no
2010-09-27 02:02:59 +02:00
statement_check winsock2.h 'closesocket(~0)' $_ld_sock && _closesocket=yes
2008-08-29 18:20:35 +02:00
if test "$_closesocket" = yes ; then
2009-02-08 23:49:52 +01:00
def_closesocket='#define HAVE_CLOSESOCKET 1'
2008-08-29 18:20:35 +02:00
else
2009-02-08 23:49:52 +01:00
def_closesocket='#define HAVE_CLOSESOCKET 0'
2008-08-29 18:20:35 +02:00
fi
echores "$_closesocket"
2010-07-17 15:14:53 +02:00
echocheck "networking"
2009-02-01 15:38:28 +01:00
test $_winsock2_h = no && test $inet_pton = no &&
2010-07-17 15:14:53 +02:00
test $inet_aton = no && networking=no
if test "$networking" = yes ; then
2009-02-08 23:49:52 +01:00
def_network='#define CONFIG_NETWORK 1'
2010-07-17 15:14:53 +02:00
def_networking='#define CONFIG_NETWORKING 1'
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags $_ld_sock"
2010-07-17 15:14:53 +02:00
inputmodules="networking $inputmodules"
2007-01-30 19:29:02 +01:00
else
2010-07-17 15:14:53 +02:00
noinputmodules="networking $noinputmodules"
2010-10-05 11:49:17 +02:00
def_network='#define CONFIG_NETWORK 0'
2010-07-17 15:14:53 +02:00
def_networking='#undef CONFIG_NETWORKING'
2007-01-30 19:29:02 +01:00
fi
2010-07-17 15:14:53 +02:00
echores "$networking"
2002-11-11 19:25:02 +01:00
2009-01-11 13:58:06 +01:00
echocheck "inet6"
if test "$_inet6" = auto ; then
cat > $TMPC << EOF
#include <sys/types.h>
2010-12-19 23:02:52 +01:00
#if !defined(_WIN32)
2009-01-11 13:58:06 +01:00
#include <sys/socket.h>
#include <netinet/in.h>
#else
#include <ws2tcpip.h>
#endif
int main(void) { struct sockaddr_in6 six; socket(AF_INET6, SOCK_STREAM, AF_INET6); return 0; }
EOF
_inet6=no
if cc_check $_ld_sock ; then
_inet6=yes
fi
fi
if test "$_inet6" = yes ; then
2009-02-08 23:49:52 +01:00
def_inet6='#define HAVE_AF_INET6 1'
2009-01-11 13:58:06 +01:00
else
2009-02-08 23:49:52 +01:00
def_inet6='#undef HAVE_AF_INET6'
2009-01-11 13:58:06 +01:00
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); return 0; }
EOF
_gethostbyname2=no
if cc_check ; then
_gethostbyname2=yes
fi
fi
if test "$_gethostbyname2" = yes ; then
2009-02-08 23:49:52 +01:00
def_gethostbyname2='#define HAVE_GETHOSTBYNAME2 1'
2009-01-11 13:58:06 +01:00
else
2009-02-08 23:49:52 +01:00
def_gethostbyname2='#undef HAVE_GETHOSTBYNAME2'
2009-01-11 13:58:06 +01:00
fi
echores "$_gethostbyname2"
2002-01-06 14:06:51 +01:00
echocheck "inttypes.h (required)"
_inttypes=no
2010-06-24 10:03:41 +02:00
header_check inttypes.h && _inttypes=yes
2006-04-04 07:09:12 +02:00
echores "$_inttypes"
if test "$_inttypes" = no ; then
2010-06-24 10:03:41 +02:00
echocheck "sys/bitypes.h (inttypes.h predecessor)"
header_check sys/bitypes.h && _inttypes=yes
2003-11-13 21:53:40 +01:00
if test "$_inttypes" = yes ; then
2004-01-30 10:07:28 +01:00
die "You don't have inttypes.h, but sys/bitypes.h is present. Please copy etc/inttypes.h into the include path, and re-run configure."
2003-11-13 21:53:40 +01:00
else
2007-08-07 18:07:52 +02:00
die "Cannot find header either inttypes.h or bitypes.h. There is no chance for compilation to succeed."
2003-11-13 21:53:40 +01:00
fi
2001-12-31 16:29:46 +01:00
fi
2002-11-11 19:25:02 +01:00
2001-11-17 04:53:05 +01:00
echocheck "mman.h"
_mman=no
2010-09-27 02:02:59 +02:00
statement_check sys/mman.h 'mmap(0, 0, 0, 0, 0, 0)' && _mman=yes
2001-11-17 04:53:05 +01:00
if test "$_mman" = yes ; then
2008-10-15 01:00:04 +02:00
def_mman_h='#define HAVE_SYS_MMAN_H 1'
2001-11-17 04:53:05 +01:00
else
2008-10-15 01:00:04 +02:00
def_mman_h='#undef HAVE_SYS_MMAN_H'
2001-11-17 04:53:05 +01:00
fi
echores "$_mman"
2001-07-12 17:35:52 +02:00
2005-01-21 22:32:15 +01:00
_mman_has_map_failed=no
2010-09-27 02:46:28 +02:00
statement_check sys/mman.h 'void *p = MAP_FAILED' && _mman_has_map_failed=yes
2005-01-21 22:32:15 +01:00
if test "$_mman_has_map_failed" = yes ; then
2009-02-08 23:49:52 +01:00
def_mman_has_map_failed=''
2005-01-21 22:32:15 +01:00
else
2009-02-08 23:49:52 +01:00
def_mman_has_map_failed='#define MAP_FAILED ((void *) -1)'
2005-01-21 22:32:15 +01:00
fi
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
2001-11-17 04:53:05 +01:00
if test "$_dl" = yes ; then
2009-02-08 23:49:52 +01:00
def_dl='#define HAVE_LIBDL 1'
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_dl='#undef HAVE_LIBDL'
2001-11-17 04:53:05 +01:00
fi
echores "$_dl"
2001-07-12 17:35:52 +02:00
2001-11-19 16:54:43 +01:00
2009-03-15 10:17:42 +01:00
def_threads='#define HAVE_THREADS 0'
2001-11-20 16:11:49 +01:00
2001-11-18 18:45:23 +01:00
echocheck "pthread"
2009-04-10 19:39:44 +02:00
if linux ; then
THREAD_CFLAGS=-D_REENTRANT
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
elif freebsd || netbsd || openbsd ; then
2009-04-10 19:39:44 +02:00
THREAD_CFLAGS=-D_THREAD_SAFE
fi
2006-08-18 18:04:16 +02:00
if test "$_pthreads" = auto ; then
2001-11-18 18:45:23 +01:00
cat > $TMPC << EOF
2001-11-19 15:11:57 +01:00
#include <pthread.h>
2010-09-14 11:41:32 +02:00
static void *func(void *arg) { return arg; }
2011-03-27 17:38:01 +02:00
int main(void) {
pthread_t tid;
#ifdef PTW32_STATIC_LIB
pthread_win32_process_attach_np();
pthread_win32_thread_attach_np();
#endif
return pthread_create (&tid, 0, func, 0) != 0;
}
2001-11-18 18:45:23 +01:00
EOF
2005-10-03 21:36:32 +02:00
_pthreads=no
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
for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
# for crosscompilation, we cannot execute the program, be happy if we can link statically
cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
done
if test "$_pthreads" = no && mingw32 ; then
_ld_tmp="-lpthreadGC2 -lws2_32"
cc_check $_ld_tmp -DPTW32_STATIC_LIB && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && CFLAGS="$CFLAGS -DPTW32_STATIC_LIB"
2001-11-18 18:45:23 +01:00
fi
2005-06-06 18:56:29 +02:00
fi
2005-10-03 21:36:32 +02:00
if test "$_pthreads" = yes ; then
2010-05-09 13:20:15 +02:00
test $_ld_pthread && res_comment="using $_ld_pthread"
2009-02-08 23:49:52 +01:00
def_pthreads='#define HAVE_PTHREADS 1'
def_threads='#define HAVE_THREADS 1'
2009-04-10 19:39:44 +02:00
extra_cflags="$extra_cflags $THREAD_CFLAGS"
2004-03-27 21:19:57 +01:00
else
2012-08-02 23:51:54 +02:00
res_comment="v4l2, ao_nas, win32 loader disabled"
2009-02-08 23:49:52 +01:00
def_pthreads='#undef HAVE_PTHREADS'
2012-08-02 23:51:54 +02:00
_nas=no ; _tv_v4l2=no
2003-10-25 22:33:51 +02:00
fi
2006-03-13 22:50:56 +01:00
echores "$_pthreads"
2001-11-18 18:45:23 +01:00
2008-11-28 18:04:36 +01:00
if cygwin ; then
if test "$_pthreads" = yes ; then
2009-02-08 23:49:52 +01:00
def_pthread_cache="#define PTHREAD_CACHE 1"
2008-11-28 18:04:36 +01:00
else
_stream_cache=no
2009-02-08 23:49:52 +01:00
def_stream_cache="#undef CONFIG_STREAM_CACHE"
2008-11-28 18:04:36 +01:00
fi
fi
2006-06-09 16:19:59 +02:00
echocheck "rpath"
if test "$_rpath" = yes ; then
2009-04-15 22:00:26 +02:00
for I in $(echo $extra_ldflags | sed 's/-L//g') ; do
tmp="$tmp $(echo $I | sed 's/.*/ -L& -Wl,-R&/')"
2006-06-09 16:19:59 +02:00
done
2009-03-25 20:48:05 +01:00
extra_ldflags=$tmp
2006-06-09 16:19:59 +02:00
fi
echores "$_rpath"
2004-03-27 21:19:57 +01:00
2005-07-30 03:07:27 +02:00
echocheck "iconv"
if test "$_iconv" = auto ; then
cat > $TMPC << EOF
#include <stdio.h>
#include <unistd.h>
2007-07-13 19:01:21 +02:00
#include <iconv.h>
2005-07-30 03:07:27 +02:00
#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";
2008-12-03 15:54:04 +01:00
if ((icdsc = iconv_open(tocode, fromcode)) != (iconv_t)(-1)) {
while ((numread = read(0, inbuffer, INBUFSIZE))) {
2005-07-30 03:07:27 +02:00
char *iptr=inbuffer;
char *optr=outbuffer;
size_t inleft=numread;
size_t outleft=OUTBUFSIZE;
2010-09-14 11:41:32 +02:00
if (iconv(icdsc, &iptr, &inleft, &optr, &outleft)
2005-07-30 03:07:27 +02:00
!= (size_t)(-1)) {
2008-12-03 15:54:04 +01:00
write(1, outbuffer, OUTBUFSIZE - outleft);
2005-07-30 03:07:27 +02:00
}
}
if (iconv_close(icdsc) == -1)
;
}
2008-07-15 10:31:43 +02:00
return 0;
2005-07-30 03:07:27 +02:00
}
EOF
_iconv=no
2005-10-03 21:36:32 +02:00
for _ld_tmp in "" "-liconv" "-liconv $_ld_dl" ; do
2011-01-02 12:49:48 +01:00
cc_check $_ld_lm $_ld_tmp && extra_ldflags="$extra_ldflags $_ld_tmp" &&
2006-11-20 01:19:43 +01:00
_iconv=yes && break
2005-10-03 21:36:32 +02:00
done
2011-04-20 20:39:53 +02:00
if test "$_iconv" != yes ; then
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."
fi
2005-07-30 03:07:27 +02:00
fi
if test "$_iconv" = yes ; then
2009-02-08 23:49:52 +01:00
def_iconv='#define CONFIG_ICONV 1'
2005-07-30 03:07:27 +02:00
else
2009-02-08 23:49:52 +01:00
def_iconv='#undef CONFIG_ICONV'
2005-07-30 03:07:27 +02:00
fi
echores "$_iconv"
2002-04-28 00:42:27 +02:00
echocheck "soundcard.h"
2007-07-11 12:43:25 +02:00
_soundcard_h=no
2008-10-15 01:00:04 +02:00
def_soundcard_h='#undef HAVE_SOUNDCARD_H'
def_sys_soundcard_h='#undef HAVE_SYS_SOUNDCARD_H'
2007-07-11 12:43:25 +02:00
for _soundcard_header in "sys/soundcard.h" "soundcard.h"; do
2010-06-24 10:03:41 +02:00
header_check $_soundcard_header && _soundcard_h=yes &&
res_comment="$_soundcard_header" && break
2007-07-11 12:43:25 +02:00
done
if test "$_soundcard_h" = yes ; then
if test $_soundcard_header = "sys/soundcard.h"; then
2008-10-15 01:00:04 +02:00
def_sys_soundcard_h='#define HAVE_SYS_SOUNDCARD_H 1'
2007-07-11 12:43:25 +02:00
else
2008-10-15 01:00:04 +02:00
def_soundcard_h='#define HAVE_SOUNDCARD_H 1'
2007-07-11 12:43:25 +02:00
fi
2002-04-28 00:42:27 +02:00
fi
2007-07-11 12:43:25 +02:00
echores "$_soundcard_h"
2001-11-17 04:53:05 +01:00
2002-11-11 19:25:02 +01:00
2011-06-29 06:19:49 +02:00
echocheck "sys/videoio.h"
sys_videoio_h=no
def_sys_videoio_h='#undef HAVE_SYS_VIDEOIO_H'
header_check sys/videoio.h && sys_videoio_h=yes &&
def_sys_videoio_h='#define HAVE_SYS_VIDEOIO_H 1'
echores "$sys_videoio_h"
2001-11-17 04:53:05 +01:00
echocheck "termcap"
2001-11-17 12:46:09 +01:00
if test "$_termcap" = auto ; then
2001-11-27 18:58:29 +01:00
_termcap=no
2005-12-25 15:00:04 +01:00
for _ld_tmp in "-lncurses" "-ltinfo" "-ltermcap"; do
2010-09-27 02:02:59 +02:00
statement_check term.h 'tgetent(0, 0)' $_ld_tmp &&
2010-09-16 13:22:30 +02:00
extra_ldflags="$extra_ldflags $_ld_tmp" && _termcap=yes && break
2005-10-03 21:36:32 +02:00
done
2001-11-17 04:53:05 +01:00
fi
if test "$_termcap" = yes ; then
2009-02-08 23:49:52 +01:00
def_termcap='#define HAVE_TERMCAP 1'
2010-05-09 13:20:15 +02:00
test $_ld_tmp && res_comment="using $_ld_tmp"
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_termcap='#undef HAVE_TERMCAP'
2001-11-17 04:53:05 +01:00
fi
2005-09-12 12:05:06 +02:00
echores "$_termcap"
2001-11-14 20:02:39 +01:00
2001-06-09 01:30:09 +02:00
2001-11-19 17:42:01 +01:00
echocheck "termios"
2009-02-08 23:49:52 +01:00
def_termios='#undef HAVE_TERMIOS'
2008-10-15 01:00:04 +02:00
def_termios_h='#undef HAVE_TERMIOS_H'
def_termios_sys_h='#undef HAVE_SYS_TERMIOS_H'
2001-11-19 17:42:01 +01:00
if test "$_termios" = auto ; then
2007-07-13 19:54:45 +02:00
_termios=no
2010-05-14 17:34:30 +02:00
for _termios_header in "termios.h" "sys/termios.h"; do
2010-06-24 10:03:41 +02:00
header_check $_termios_header && _termios=yes &&
res_comment="using $_termios_header" && break
2007-07-13 19:54:45 +02:00
done
2001-12-03 16:22:03 +01:00
fi
2001-11-19 17:42:01 +01:00
if test "$_termios" = yes ; then
2009-02-08 23:49:52 +01:00
def_termios='#define HAVE_TERMIOS 1'
2007-07-13 19:54:45 +02:00
if test "$_termios_header" = "termios.h" ; then
2008-10-15 01:00:04 +02:00
def_termios_h='#define HAVE_TERMIOS_H 1'
2007-07-13 19:54:45 +02:00
else
2008-10-15 01:00:04 +02:00
def_termios_sys_h='#define HAVE_SYS_TERMIOS_H 1'
2001-12-03 16:22:03 +01:00
fi
2001-11-19 17:42:01 +01:00
fi
2005-09-12 12:05:06 +02:00
echores "$_termios"
2001-11-19 17:42:01 +01:00
2001-11-19 16:54:43 +01:00
echocheck "shm"
2001-11-19 17:06:33 +01:00
if test "$_shm" = auto ; then
2001-11-27 18:58:29 +01:00
_shm=no
2011-01-05 16:59:43 +01:00
statement_check sys/shm.h 'shmget(0, 0, 0); shmat(0, 0, 0); shmctl(0, 0, 0)' && _shm=yes
2001-11-19 17:06:33 +01:00
fi
2001-11-19 16:54:43 +01:00
if test "$_shm" = yes ; then
2009-02-08 23:49:52 +01:00
def_shm='#define HAVE_SHM 1'
2001-11-19 16:54:43 +01:00
else
2009-02-08 23:49:52 +01:00
def_shm='#undef HAVE_SHM'
2001-11-19 16:54:43 +01:00
fi
echores "$_shm"
2002-03-15 21:48:42 +01:00
2002-03-29 22:24:36 +01:00
echocheck "strsep()"
_strsep=no
2011-01-05 16:59:43 +01:00
statement_check string.h 'char *s = "Hello, world!"; strsep(&s, ",")' && _strsep=yes
2002-03-29 22:24:36 +01:00
if test "$_strsep" = yes ; then
2009-02-08 23:49:52 +01:00
def_strsep='#define HAVE_STRSEP 1'
2011-01-26 20:00:17 +01:00
need_strsep=no
2002-03-29 22:24:36 +01:00
else
2009-02-08 23:49:52 +01:00
def_strsep='#undef HAVE_STRSEP'
2011-01-26 20:00:17 +01:00
need_strsep=yes
2002-03-29 22:24:36 +01:00
fi
echores "$_strsep"
2001-11-17 04:53:05 +01:00
echocheck "vsscanf()"
2001-06-05 12:16:32 +02:00
cat > $TMPC << EOF
2008-10-04 00:39:06 +02:00
#define _ISOC99_SOURCE
2001-11-17 04:53:05 +01:00
#include <stdarg.h>
2008-10-04 00:39:06 +02:00
#include <stdio.h>
2010-01-04 23:28:44 +01:00
int main(void) { va_list ap; vsscanf("foo", "bar", ap); return 0; }
2001-06-05 12:16:32 +02:00
EOF
2001-11-17 04:53:05 +01:00
_vsscanf=no
cc_check && _vsscanf=yes
if test "$_vsscanf" = yes ; then
2009-02-08 23:49:52 +01:00
def_vsscanf='#define HAVE_VSSCANF 1'
2011-01-26 20:00:17 +01:00
need_vsscanf=no
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_vsscanf='#undef HAVE_VSSCANF'
2011-01-26 20:00:17 +01:00
need_vsscanf=yes
2001-11-17 04:53:05 +01:00
fi
echores "$_vsscanf"
2001-06-05 12:16:32 +02:00
2003-04-04 21:15:24 +02:00
2006-05-12 11:13:05 +02:00
echocheck "POSIX select()"
2003-04-04 21:15:24 +02:00
cat > $TMPC << EOF
2003-04-11 18:33:29 +02:00
#include <stdio.h>
#include <stdlib.h>
2003-04-04 21:15:24 +02:00
#include <sys/types.h>
2003-04-11 18:33:29 +02:00
#include <string.h>
#include <sys/time.h>
2003-04-04 21:15:24 +02:00
#include <unistd.h>
2010-09-16 20:58:21 +02:00
int main(void) {int nfds = 1; fd_set readfds; struct timeval timeout; select(nfds, &readfds, NULL, NULL, &timeout); return 0; }
2003-04-04 21:15:24 +02:00
EOF
_posix_select=no
2009-02-08 23:49:52 +01:00
def_posix_select='#undef HAVE_POSIX_SELECT'
2012-04-06 15:58:39 +02:00
cc_check && _posix_select=yes &&
2011-01-02 12:49:48 +01:00
def_posix_select='#define HAVE_POSIX_SELECT 1'
2003-04-04 21:15:24 +02:00
echores "$_posix_select"
2009-01-11 13:58:06 +01:00
echocheck "audio select()"
if test "$_select" = no ; then
2009-02-08 23:49:52 +01:00
def_select='#undef HAVE_AUDIO_SELECT'
2009-01-11 13:58:06 +01:00
elif test "$_select" = yes ; then
2009-02-08 23:49:52 +01:00
def_select='#define HAVE_AUDIO_SELECT 1'
2009-01-11 13:58:06 +01:00
fi
echores "$_select"
2003-04-04 21:15:24 +02:00
echocheck "gettimeofday()"
_gettimeofday=no
2011-01-05 16:59:43 +01:00
statement_check sys/time.h 'struct timeval tv; struct timezone tz; gettimeofday(&tv, &tz)' && _gettimeofday=yes
2003-04-04 21:15:24 +02:00
if test "$_gettimeofday" = yes ; then
2009-02-08 23:49:52 +01:00
def_gettimeofday='#define HAVE_GETTIMEOFDAY 1'
2011-01-26 20:00:17 +01:00
need_gettimeofday=no
2003-04-04 21:15:24 +02:00
else
2009-02-08 23:49:52 +01:00
def_gettimeofday='#undef HAVE_GETTIMEOFDAY'
2011-01-26 20:00:17 +01:00
need_gettimeofday=yes
2003-04-04 21:15:24 +02:00
fi
echores "$_gettimeofday"
echocheck "glob()"
_glob=no
2010-09-27 02:02:59 +02:00
statement_check glob.h 'glob("filename", 0, 0, 0)' && _glob=yes
2011-06-11 18:40:10 +02:00
need_glob=no
2003-04-04 21:15:24 +02:00
if test "$_glob" = yes ; then
2009-02-08 23:49:52 +01:00
def_glob='#define HAVE_GLOB 1'
2003-04-04 21:15:24 +02:00
else
2009-02-08 23:49:52 +01:00
def_glob='#undef HAVE_GLOB'
2011-06-11 18:40:10 +02:00
# HACK! need_glob currently enables compilation of a
# win32-specific glob()-replacement.
# Other OS neither need it nor can they use it (mf:// is disabled for them).
win32 && need_glob=yes
2003-04-04 21:15:24 +02:00
fi
echores "$_glob"
2010-03-04 15:46:44 +01:00
echocheck "setmode()"
_setmode=no
def_setmode='#define HAVE_SETMODE 0'
2010-09-27 02:02:59 +02:00
statement_check io.h 'setmode(0, 0)' && _setmode=yes && def_setmode='#define HAVE_SETMODE 1'
2010-03-04 15:46:44 +01:00
echores "$_setmode"
2002-08-21 23:31:20 +02:00
echocheck "sys/sysinfo.h"
_sys_sysinfo=no
2011-06-26 16:42:35 +02:00
statement_check sys/sysinfo.h 'struct sysinfo s_info; s_info.mem_unit=0; sysinfo(&s_info)' && _sys_sysinfo=yes
2002-08-21 23:31:20 +02:00
if test "$_sys_sysinfo" = yes ; then
2008-10-15 01:00:04 +02:00
def_sys_sysinfo_h='#define HAVE_SYS_SYSINFO_H 1'
2002-08-21 23:31:20 +02:00
else
2008-10-15 01:00:04 +02:00
def_sys_sysinfo_h='#undef HAVE_SYS_SYSINFO_H'
2002-08-21 23:31:20 +02:00
fi
echores "$_sys_sysinfo"
2001-10-25 13:46:50 +02:00
2006-06-18 13:21:23 +02:00
if darwin; then
2004-11-10 17:43:40 +01:00
echocheck "Mac OS X Finder Support"
2009-05-05 10:46:37 +02:00
def_macosx_finder='#undef CONFIG_MACOSX_FINDER'
2009-05-07 23:34:56 +02:00
if test "$_macosx_finder" = yes ; then
2009-02-08 23:49:52 +01:00
def_macosx_finder='#define CONFIG_MACOSX_FINDER 1'
2012-01-11 22:29:06 +01:00
extra_ldflags="$extra_ldflags -framework Cocoa"
2008-05-03 22:14:50 +02:00
fi
2008-08-03 18:16:10 +02:00
echores "$_macosx_finder"
2003-02-19 18:26:59 +01:00
2005-04-13 13:46:35 +02:00
echocheck "Mac OS X Bundle file locations"
2009-05-05 10:46:37 +02:00
def_macosx_bundle='#undef CONFIG_MACOSX_BUNDLE'
test "$_macosx_bundle" = auto && _macosx_bundle=$_macosx_finder
2009-05-07 23:34:56 +02:00
if test "$_macosx_bundle" = yes ; then
2009-02-08 23:49:52 +01:00
def_macosx_bundle='#define CONFIG_MACOSX_BUNDLE 1'
2008-05-03 22:14:50 +02:00
fi
2005-04-13 13:46:35 +02:00
echores "$_macosx_bundle"
2007-08-14 16:29:22 +02:00
echocheck "Apple Remote"
if test "$_apple_remote" = auto ; then
_apple_remote=no
cat > $TMPC <<EOF
#include <stdio.h>
#include <IOKit/IOCFPlugIn.h>
2008-05-03 22:07:04 +02:00
int main(void) {
2007-08-14 16:29:22 +02:00
io_iterator_t hidObjectIterator = (io_iterator_t)NULL;
CFMutableDictionaryRef hidMatchDictionary;
IOReturn ioReturnValue;
// Set up a matching dictionary to search the I/O Registry by class.
// name for all HID class devices
hidMatchDictionary = IOServiceMatching("AppleIRController");
// Now search I/O Registry for matching devices.
ioReturnValue = IOServiceGetMatchingServices(kIOMasterPortDefault,
hidMatchDictionary, &hidObjectIterator);
// If search is unsuccessful, return nonzero.
if (ioReturnValue != kIOReturnSuccess ||
!IOIteratorIsValid(hidObjectIterator)) {
return 1;
}
return 0;
}
EOF
2010-09-12 02:11:26 +02:00
cc_check -framework IOKit && _apple_remote=yes
2007-08-14 16:29:22 +02:00
fi
if test "$_apple_remote" = yes ; then
2009-02-08 23:49:52 +01:00
def_apple_remote='#define CONFIG_APPLE_REMOTE 1'
2009-05-08 15:58:42 +02:00
libs_mplayer="$libs_mplayer -framework IOKit -framework Cocoa"
2007-08-14 16:29:22 +02:00
else
2009-02-08 23:49:52 +01:00
def_apple_remote='#undef CONFIG_APPLE_REMOTE'
2007-08-14 16:29:22 +02:00
fi
echores "$_apple_remote"
2006-06-18 13:21:23 +02:00
fi #if darwin
2008-05-18 13:53:00 +02:00
if linux; then
echocheck "Apple IR"
if test "$_apple_ir" = auto ; then
_apple_ir=no
2011-01-05 16:59:43 +01:00
statement_check linux/input.h 'struct input_event ev; struct input_id id' && _apple_ir=yes
2008-05-18 13:53:00 +02:00
fi
if test "$_apple_ir" = yes ; then
2009-02-08 23:49:52 +01:00
def_apple_ir='#define CONFIG_APPLE_IR 1'
2008-05-18 13:53:00 +02:00
else
2009-02-08 23:49:52 +01:00
def_apple_ir='#undef CONFIG_APPLE_IR'
2008-05-18 13:53:00 +02:00
fi
echores "$_apple_ir"
fi #if linux
2006-06-18 13:21:23 +02: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
2003-03-21 17:06:11 +01:00
echocheck "Samba support (libsmbclient)"
2008-08-03 17:57:18 +02:00
if test "$_smb" = yes; then
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -lsmbclient"
2003-11-16 10:12:03 +01:00
fi
2008-08-03 17:57:18 +02:00
if test "$_smb" = auto; then
2010-09-14 12:05:46 +02:00
_smb=no
2005-10-03 21:36:32 +02:00
for _ld_tmp in "-lsmbclient" "-lsmbclient $_ld_dl" "-lsmbclient $_ld_dl -lnsl" "-lsmbclient $_ld_dl -lssl -lnsl" ; do
2010-09-27 02:02:59 +02:00
statement_check libsmbclient.h 'smbc_opendir("smb://")' $_ld_tmp &&
2010-09-14 12:05:46 +02:00
extra_ldflags="$extra_ldflags $_ld_tmp" && _smb=yes && break
2005-10-03 21:36:32 +02:00
done
2003-03-21 17:06:11 +01:00
fi
2008-08-03 17:57:18 +02:00
if test "$_smb" = yes; then
2009-10-28 14:55:18 +01:00
def_smb="#define CONFIG_LIBSMBCLIENT 1"
2010-05-09 13:20:15 +02:00
inputmodules="smb $inputmodules"
2003-03-21 17:06:11 +01:00
else
2009-02-08 23:49:52 +01:00
def_smb="#undef CONFIG_LIBSMBCLIENT"
2010-05-29 12:43:51 +02:00
noinputmodules="smb $noinputmodules"
2003-03-21 17:06:11 +01:00
fi
2008-08-03 17:57:18 +02:00
echores "$_smb"
2003-03-21 17:06:11 +01:00
2012-03-02 20:24:34 +01:00
echocheck "libquvi support"
if test "$_libquvi" = auto ; then
_libquvi=no
2012-09-02 20:45:11 +02:00
if pkg_config_add 'libquvi >= 0.4.1' ; then
2012-03-02 20:24:34 +01:00
_libquvi=yes
fi
fi
if test "$_libquvi" = yes; then
def_libquvi="#define CONFIG_LIBQUVI 1"
else
def_libquvi="#undef CONFIG_LIBQUVI"
fi
echores "$_libquvi"
2003-03-21 17:06:11 +01:00
2001-11-17 12:26:26 +01:00
#########
# VIDEO #
#########
2002-03-15 21:48:42 +01:00
2012-04-16 08:33:42 +02:00
if darwin; then
echocheck "Cocoa"
if test "$_cocoa" = auto ; then
cat > $TMPC <<EOF
#include <CoreServices/CoreServices.h>
#include <OpenGL/OpenGL.h>
int main(void) {
NSApplicationLoad();
}
EOF
_cocoa=no
cc_check -framework Cocoa -framework OpenGL && _cocoa=yes
fi
if test "$_cocoa" = yes ; then
libs_mplayer="$libs_mplayer -framework Cocoa -framework OpenGL"
def_cocoa='#define CONFIG_COCOA 1'
else
def_cocoa='#undef CONFIG_COCOA'
fi
echores "$_cocoa"
echocheck "CoreVideo"
if test "$_cocoa" = yes && test "$_corevideo" = auto ; then
cat > $TMPC <<EOF
#include <QuartzCore/CoreVideo.h>
int main(void) { return 0; }
EOF
_corevideo=no
cc_check -framework Cocoa -framework QuartzCore -framework OpenGL && _corevideo=yes
fi
if test "$_corevideo" = yes ; then
vomodules="corevideo $vomodules"
libs_mplayer="$libs_mplayer -framework QuartzCore"
def_corevideo='#define CONFIG_COREVIDEO 1'
else
novomodules="corevideo $novomodules"
def_corevideo='#undef CONFIG_COREVIDEO'
fi
echores "$_corevideo"
depends_on_application_services(){
test "$_corevideo" = yes
}
fi #if darwin
2002-05-25 23:43:02 +02:00
echocheck "X11 headers presence"
2007-07-17 13:16:15 +02:00
_x11_headers="no"
2010-05-09 13:20:15 +02:00
res_comment="check if the dev(el) packages are installed"
2009-04-15 22:00:26 +02:00
for I in $(echo $extra_cflags | sed s/-I//g) /usr/include ; do
2006-08-05 01:57:04 +02:00
if test -f "$I/X11/Xlib.h" ; then
2007-07-17 13:16:15 +02:00
_x11_headers="yes"
2010-05-09 13:20:15 +02:00
res_comment=""
2007-07-17 13:16:15 +02:00
break
fi
done
2008-03-26 01:14:51 +01:00
if test $_cross_compile = no; then
2010-01-10 22:47:50 +01:00
for I in /usr/X11/include /usr/X11R7/include /usr/local/include /usr/X11R6/include \
2009-03-14 17:00:21 +01:00
/usr/include/X11R6 /usr/openwin/include ; do
2008-03-26 01:15:43 +01:00
if test -f "$I/X11/Xlib.h" ; then
2009-03-25 20:48:05 +01:00
extra_cflags="$extra_cflags -I$I"
2008-03-26 01:15:43 +01:00
_x11_headers="yes"
2010-05-09 13:20:15 +02:00
res_comment="using $I"
2008-03-26 01:15:43 +01:00
break
fi
done
2008-03-26 01:14:51 +01:00
fi
2006-05-07 16:00:07 +02:00
echores "$_x11_headers"
2002-05-25 23:43:02 +02:00
2001-11-17 04:53:05 +01:00
echocheck "X11"
2007-07-17 13:16:15 +02:00
if test "$_x11" = auto && test "$_x11_headers" = yes ; then
2010-01-10 22:47:50 +01:00
for I in "" -L/usr/X11R7/lib -L/usr/local/lib -L/usr/X11R6/lib -L/usr/lib/X11R6 \
-L/usr/X11/lib -L/usr/lib32 -L/usr/openwin/lib -L/usr/local/lib64 -L/usr/X11R6/lib64 \
2009-03-14 17:00:21 +01:00
-L/usr/lib ; do
2005-06-03 19:24:30 +02:00
if netbsd; then
2009-04-15 22:00:26 +02:00
_ld_tmp="$I -lXext -lX11 $_ld_pthread -Wl,-R$(echo $I | sed s/^-L//)"
2006-11-21 17:13:11 +01:00
else
2007-01-30 19:29:02 +01:00
_ld_tmp="$I -lXext -lX11 $_ld_pthread"
2005-06-03 19:24:30 +02:00
fi
2010-09-27 02:46:28 +02:00
statement_check X11/Xutil.h 'XCreateWindow(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)' $_ld_tmp &&
2012-04-16 08:33:42 +02:00
_x11=yes
# Check that there aren't conflicting headers between ApplicationServices
# and X11. On versions of Mac OSX prior to 10.7 the deprecated QuickDraw API
# is included by -framework ApplicationServices and clashes with the X11
# definition of the "Cursor" type.
if darwin && depends_on_application_services && test "$_x11" = yes ; then
_x11=no
header_check_broken ApplicationServices/ApplicationServices.h \
X11/Xutil.h $_ld_tmp && _x11=yes
fi
if test "$_x11" = yes ; then
libs_mplayer="$libs_mplayer $_ld_tmp"
break
fi
2005-06-03 19:24:30 +02:00
done
2001-11-17 04:53:05 +01:00
fi
if test "$_x11" = yes ; then
2009-02-08 23:49:52 +01:00
def_x11='#define CONFIG_X11 1'
2012-08-25 19:57:08 +02:00
vomodules="x11 $vomodules"
2001-11-17 04:53:05 +01:00
else
2005-06-03 19:24:30 +02:00
_x11=no
2009-02-08 23:49:52 +01:00
def_x11='#undef CONFIG_X11'
2010-05-09 13:20:15 +02:00
novomodules="x11 $novomodules"
res_comment="check if the dev(el) packages are installed"
2001-11-17 04:53:05 +01:00
fi
2005-09-12 12:05:06 +02:00
echores "$_x11"
2001-02-24 21:28:24 +01:00
2007-12-22 12:09:43 +01:00
echocheck "Xss screensaver extensions"
if test "$_xss" = auto ; then
_xss=no
2011-01-02 12:49:48 +01:00
statement_check "X11/extensions/scrnsaver.h" 'XScreenSaverSuspend(NULL, True)' -lXss && _xss=yes
2007-12-22 12:09:43 +01:00
fi
if test "$_xss" = yes ; then
2009-02-08 23:49:52 +01:00
def_xss='#define CONFIG_XSS 1'
2009-03-25 20:48:05 +01:00
libs_mplayer="$libs_mplayer -lXss"
2007-12-22 12:09:43 +01:00
else
2009-02-08 23:49:52 +01:00
def_xss='#undef CONFIG_XSS'
2007-12-22 12:09:43 +01:00
fi
echores "$_xss"
2001-06-05 20:40:44 +02:00
2001-11-17 10:57:54 +01:00
echocheck "DPMS"
2001-11-17 04:53:05 +01:00
_xdpms3=no
2005-10-03 21:36:32 +02:00
_xdpms4=no
2001-11-17 04:53:05 +01:00
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>
2010-09-14 12:05:46 +02:00
int main(void) { DPMSQueryExtension(0, 0, 0); return 0; }
2001-06-04 10:07:57 +02:00
EOF
2006-11-22 17:42:04 +01:00
cc_check -lXdpms && _xdpms3=yes
2010-10-03 15:49:57 +02:00
statement_check_broken X11/Xlib.h X11/extensions/dpms.h 'DPMSQueryExtension(0, 0, 0)' -lXext && _xdpms4=yes
2001-06-04 11:38:18 +02:00
fi
2001-11-17 04:53:05 +01:00
if test "$_xdpms4" = yes ; then
2009-02-08 23:49:52 +01:00
def_xdpms='#define CONFIG_XDPMS 1'
2010-05-09 13:20:15 +02:00
res_comment="using Xdpms 4"
2006-05-07 16:00:07 +02:00
echores "yes"
2001-11-17 04:53:05 +01:00
elif test "$_xdpms3" = yes ; then
2009-02-08 23:49:52 +01:00
def_xdpms='#define CONFIG_XDPMS 1'
2009-03-25 20:48:05 +01:00
libs_mplayer="$libs_mplayer -lXdpms"
2010-05-09 13:20:15 +02:00
res_comment="using Xdpms 3"
2006-05-07 16:00:07 +02:00
echores "yes"
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_xdpms='#undef CONFIG_XDPMS'
2001-11-17 04:53:05 +01:00
echores "no"
2001-06-04 10:07:57 +02:00
fi
2001-06-04 22:12:41 +02:00
2001-11-17 04:53:05 +01:00
echocheck "Xv"
2011-05-05 12:25:17 +02:00
if test "$_xv" = auto && test "$_x11" = yes ; then
2001-11-17 04:53:05 +01:00
_xv=no
2010-10-03 15:49:57 +02:00
statement_check_broken X11/Xlib.h X11/extensions/Xvlib.h 'XvGetPortAttribute(0, 0, 0, 0)' -lXv && _xv=yes
2001-06-04 10:07:57 +02:00
fi
2006-08-19 21:10:27 +02:00
2001-11-17 04:53:05 +01:00
if test "$_xv" = yes ; then
2009-02-08 23:49:52 +01:00
def_xv='#define CONFIG_XV 1'
2009-03-25 20:48:05 +01:00
libs_mplayer="$libs_mplayer -lXv"
2010-05-09 13:20:15 +02:00
vomodules="xv $vomodules"
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_xv='#undef CONFIG_XV'
2010-05-09 13:20:15 +02:00
novomodules="xv $novomodules"
2001-06-04 10:07:57 +02:00
fi
2001-11-17 04:53:05 +01:00
echores "$_xv"
2001-06-04 10:07:57 +02:00
2001-07-28 23:35:55 +02:00
2009-02-16 21:58:13 +01:00
echocheck "VDPAU"
2011-05-05 12:25:17 +02:00
if test "$_vdpau" = auto && test "$_x11" = yes ; then
2009-02-16 21:58:13 +01:00
_vdpau=no
if test "$_dl" = yes ; then
2012-05-06 18:08:33 +02:00
pkg_config_add 'vdpau >= 0.2' && _vdpau=yes
2009-02-16 21:58:13 +01:00
fi
fi
if test "$_vdpau" = yes ; then
def_vdpau='#define CONFIG_VDPAU 1'
2010-05-09 13:20:15 +02:00
vomodules="vdpau $vomodules"
2009-02-16 21:58:13 +01:00
else
def_vdpau='#define CONFIG_VDPAU 0'
2010-05-09 13:20:15 +02:00
novomodules="vdpau $novomodules"
2009-02-16 21:58:13 +01:00
fi
echores "$_vdpau"
2001-11-17 04:53:05 +01:00
echocheck "Xinerama"
2011-05-05 12:25:17 +02:00
if test "$_xinerama" = auto && test "$_x11" = yes ; then
2001-11-17 04:53:05 +01:00
_xinerama=no
2010-09-27 02:46:28 +02:00
statement_check X11/extensions/Xinerama.h 'XineramaIsActive(0)' -lXinerama && _xinerama=yes
2001-07-28 23:35:55 +02:00
fi
2006-08-19 21:10:27 +02:00
2001-11-17 04:53:05 +01:00
if test "$_xinerama" = yes ; then
2009-02-08 23:49:52 +01:00
def_xinerama='#define CONFIG_XINERAMA 1'
2009-03-25 20:48:05 +01:00
libs_mplayer="$libs_mplayer -lXinerama"
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_xinerama='#undef CONFIG_XINERAMA'
2001-07-28 23:35:55 +02:00
fi
2001-11-17 04:53:05 +01:00
echores "$_xinerama"
2001-07-28 23:35:55 +02:00
2001-06-04 10:07:57 +02:00
2001-11-17 04:53:05 +01:00
# 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"
2011-05-05 12:25:17 +02:00
if test "$_vm" = auto && test "$_x11" = yes ; then
2001-11-17 04:53:05 +01:00
_vm=no
2010-10-03 15:49:57 +02:00
statement_check_broken X11/Xlib.h X11/extensions/xf86vmode.h 'XF86VidModeQueryExtension(0, 0, 0)' -lXxf86vm && _vm=yes
2001-04-15 22:31:58 +02:00
fi
2001-11-17 04:53:05 +01:00
if test "$_vm" = yes ; then
2009-02-08 23:49:52 +01:00
def_vm='#define CONFIG_XF86VM 1'
2009-03-25 20:48:05 +01:00
libs_mplayer="$libs_mplayer -lXxf86vm"
2001-11-17 04:53:05 +01:00
else
2009-02-08 23:49:52 +01:00
def_vm='#undef CONFIG_XF86VM'
2001-11-17 04:53:05 +01:00
fi
echores "$_vm"
2001-04-15 22:31:58 +02:00
2005-02-02 15:07:13 +01:00
# 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"
2011-05-05 12:25:17 +02:00
if test "$_xf86keysym" = auto && test "$_x11" = yes ; then
2005-02-02 15:07:13 +01:00
_xf86keysym=no
2011-01-20 12:21:34 +01:00
return_check X11/XF86keysym.h XF86XK_AudioPause && _xf86keysym=yes
2005-02-02 15:07:13 +01:00
fi
if test "$_xf86keysym" = yes ; then
2009-02-08 23:49:52 +01:00
def_xf86keysym='#define CONFIG_XF86XK 1'
2005-02-02 15:07:13 +01:00
else
2009-02-08 23:49:52 +01:00
def_xf86keysym='#undef CONFIG_XF86XK'
2005-02-02 15:07:13 +01:00
fi
echores "$_xf86keysym"
2001-08-29 14:15:09 +02:00
2004-04-13 23:40:04 +02:00
2004-04-06 02:04:48 +02:00
echocheck "CACA"
if test "$_caca" = auto ; then
2004-04-13 23:40:04 +02:00
_caca=no
if ( caca-config --version ) >> "$TMPLOG" 2>&1 ; then
2004-04-06 02:04:48 +02:00
cat > $TMPC << EOF
#include <caca.h>
2006-09-27 01:43:21 +02:00
#ifdef CACA_API_VERSION_1
#include <caca0.h>
#endif
2010-09-14 12:05:46 +02:00
int main(void) { caca_init(); return 0; }
2004-04-06 02:04:48 +02:00
EOF
2009-04-15 22:00:26 +02:00
cc_check $(caca-config --libs) && _caca=yes
2004-04-13 23:40:04 +02:00
fi
2004-04-06 02:04:48 +02:00
fi
if test "$_caca" = yes ; then
2009-02-08 23:49:52 +01:00
def_caca='#define CONFIG_CACA 1'
2009-04-15 22:00:26 +02:00
extra_cflags="$extra_cflags $(caca-config --cflags)"
libs_mplayer="$libs_mplayer $(caca-config --libs)"
2010-05-09 13:20:15 +02:00
vomodules="caca $vomodules"
2004-04-06 02:04:48 +02:00
else
2009-02-08 23:49:52 +01:00
def_caca='#undef CONFIG_CACA'
2010-05-09 13:20:15 +02:00
novomodules="caca $novomodules"
2004-04-06 02:04:48 +02:00
fi
echores "$_caca"
2001-08-20 23:20:03 +02:00
2001-11-17 04:53:05 +01:00
echocheck "DVB"
2006-08-04 01:41:35 +02:00
if test "$_dvb" = auto ; then
2001-11-17 04:53:05 +01:00
_dvb=no
2002-04-04 15:21:13 +02:00
cat >$TMPC << EOF
2008-08-14 17:54:53 +02:00
#include <poll.h>
2002-04-04 15:21:13 +02:00
#include <sys/ioctl.h>
#include <stdio.h>
#include <time.h>
#include <unistd.h>
2002-12-28 13:04:58 +01:00
#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
2006-08-27 23:05:42 +02:00
for _inc_tmp in "" "-I/usr/src/DVB/include" ; do
2011-01-02 12:49:48 +01:00
cc_check $_inc_tmp && _dvb=yes &&
2009-03-25 20:48:05 +01:00
extra_cflags="$extra_cflags $_inc_tmp" && break
2006-08-05 01:57:04 +02:00
done
2006-08-04 01:43:15 +02:00
fi
2010-03-02 20:57:17 +01:00
echores "$_dvb"
if test "$_dvb" = yes ; then
_dvbin=yes
2010-05-09 13:20:15 +02:00
inputmodules="dvb $inputmodules"
2009-02-08 23:49:52 +01:00
def_dvb='#define CONFIG_DVB 1'
def_dvbin='#define CONFIG_DVBIN 1'
2010-03-02 20:57:17 +01:00
else
_dvbin=no
2010-05-29 12:43:51 +02:00
noinputmodules="dvb $noinputmodules"
2009-02-08 23:49:52 +01:00
def_dvb='#undef CONFIG_DVB'
def_dvbin='#undef CONFIG_DVBIN '
2001-11-03 22:25:55 +01:00
fi
2007-07-14 17:11:08 +02:00
2001-11-17 12:26:26 +01:00
echocheck "PNG support"
if test "$_png" = auto ; then
_png=no
2001-11-19 10:43:55 +01:00
cat > $TMPC << EOF
2010-09-16 13:22:30 +02:00
#include <stdio.h>
2002-02-01 14:10:35 +01:00
#include <string.h>
2010-09-16 13:22:30 +02:00
#include <png.h>
2002-02-01 14:10:35 +01:00
int main(void) {
printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
2002-04-29 18:24:22 +02:00
printf("libpng: %s\n", png_libpng_ver);
2008-05-16 11:42:28 +02:00
return strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver);
2002-02-01 14:10:35 +01:00
}
2001-11-19 10:43:55 +01:00
EOF
2012-05-06 17:22:34 +02:00
cc_check -lpng -lz $_ld_lm && _png=yes
2001-11-17 12:26:26 +01:00
fi
2005-09-12 12:05:06 +02:00
echores "$_png"
2001-11-17 12:26:26 +01:00
if test "$_png" = yes ; then
2009-02-08 23:49:52 +01:00
def_png='#define CONFIG_PNG 1'
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -lpng -lz"
2001-11-17 12:26:26 +01:00
else
2009-02-08 23:49:52 +01:00
def_png='#undef CONFIG_PNG'
2001-11-17 12:26:26 +01:00
fi
2008-11-30 14:22:34 +01:00
echocheck "MNG support"
if test "$_mng" = auto ; then
_mng=no
2011-01-20 12:21:34 +01:00
return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
2008-11-30 14:22:34 +01:00
fi
echores "$_mng"
if test "$_mng" = yes ; then
2009-02-08 23:49:52 +01:00
def_mng='#define CONFIG_MNG 1'
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -lmng -lz"
2008-11-30 14:22:34 +01:00
else
2009-02-08 23:49:52 +01:00
def_mng='#undef CONFIG_MNG'
2008-11-30 14:22:34 +01:00
fi
2002-03-10 23:49:18 +01:00
echocheck "JPEG support"
2006-06-16 23:17:47 +02:00
if test "$_jpeg" = auto ; then
_jpeg=no
2010-09-26 20:22:06 +02:00
header_check_broken stdio.h jpeglib.h -ljpeg $_ld_lm && _jpeg=yes
2002-03-10 23:49:18 +01:00
fi
2006-06-16 23:17:47 +02:00
echores "$_jpeg"
2002-03-11 01:13:05 +01:00
2006-06-16 23:17:47 +02:00
if test "$_jpeg" = yes ; then
2009-02-08 23:49:52 +01:00
def_jpeg='#define CONFIG_JPEG 1'
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -ljpeg"
2002-03-10 23:49:18 +01:00
else
2009-02-08 23:49:52 +01:00
def_jpeg='#undef CONFIG_JPEG'
2002-03-10 23:49:18 +01:00
fi
2002-05-13 14:28:00 +02:00
2003-01-28 01:12:23 +01:00
echocheck "GIF support"
2004-09-05 19:46:33 +02:00
# This is to appease people who want to force gif support.
# If it is forced to yes, then we still do checks to determine
# which gif library to use.
if test "$_gif" = yes ; then
_force_gif=yes
_gif=auto
fi
2002-05-12 03:07:25 +02:00
if test "$_gif" = auto ; then
_gif=no
2006-11-22 17:42:04 +01:00
for _ld_gif in "-lungif" "-lgif" ; do
2010-09-27 02:02:59 +02:00
statement_check gif_lib.h 'QuantizeBuffer(0, 0, 0, 0, 0, 0, 0, 0)' $_ld_gif && _gif=yes && break
2005-10-03 21:36:32 +02:00
done
2002-05-12 03:07:25 +02:00
fi
2004-09-05 19:46:33 +02:00
# If no library was found, and the user wants support forced,
# then we force it on with libgif, as this is the safest
# assumption IMHO. (libungif & libregif both create symbolic
# links to libgif. We also assume that no x11 support is needed,
# because if you are forcing this, then you _should_ know what
# you are doing. [ Besides, package maintainers should never
# have compiled x11 deps into libungif in the first place. ] )
# </rant>
# --Joey
if test "$_force_gif" = yes && test "$_gif" = no ; then
_gif=yes
_ld_gif="-lgif"
fi
2002-05-12 03:07:25 +02:00
if test "$_gif" = yes ; then
2009-02-08 23:49:52 +01:00
def_gif='#define CONFIG_GIF 1'
2010-05-09 13:20:15 +02:00
codecmodules="gif $codecmodules"
res_comment="old version, some encoding functions disabled"
2009-02-08 23:49:52 +01:00
def_gif_4='#undef CONFIG_GIF_4'
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags $_ld_gif"
2002-05-13 22:52:10 +02:00
cat > $TMPC << EOF
2002-05-23 22:38:27 +02:00
#include <signal.h>
2010-09-14 11:41:32 +02:00
#include <stdio.h>
#include <stdlib.h>
2002-05-13 22:52:10 +02:00
#include <gif_lib.h>
2010-09-14 11:41:32 +02:00
static void catch(int sig) { exit(1); }
2002-05-13 22:52:10 +02:00
int main(void) {
2002-05-23 22:38:27 +02:00
signal(SIGSEGV, catch); // catch segfault
2002-05-13 22:52:10 +02:00
printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);
EGifSetGifVersion("89a"); // this will segfault a buggy gif lib.
return 0;
}
EOF
2009-10-06 08:43:00 +02:00
if cc_check "$_ld_gif" ; then
2009-02-08 23:49:52 +01:00
def_gif_4='#define CONFIG_GIF_4 1'
2010-05-09 13:20:15 +02:00
res_comment=""
2002-05-13 22:52:10 +02:00
fi
2002-05-12 03:07:25 +02:00
else
2009-02-08 23:49:52 +01:00
def_gif='#undef CONFIG_GIF'
def_gif_4='#undef CONFIG_GIF_4'
2010-05-09 13:20:15 +02:00
nocodecmodules="gif $nocodecmodules"
2002-05-12 03:07:25 +02:00
fi
2002-05-13 22:52:10 +02:00
echores "$_gif"
2002-05-12 03:07:25 +02:00
2001-11-17 12:26:26 +01:00
2003-03-05 11:28:32 +01:00
case "$_gif" in yes*)
2003-02-19 17:55:14 +01:00
echocheck "broken giflib workaround"
2009-02-08 23:49:52 +01:00
def_gif_tvt_hack='#define CONFIG_GIF_TVT_HACK 1'
2003-02-19 17:55:14 +01:00
cat > $TMPC << EOF
2010-09-14 11:41:32 +02:00
#include <stdio.h>
2003-02-19 17:55:14 +01:00
#include <gif_lib.h>
int main(void) {
2010-09-14 11:41:32 +02:00
GifFileType gif = {.UserData = NULL};
2003-02-19 17:55:14 +01:00
printf("UserData is at address %p\n", gif.UserData);
return 0;
}
EOF
2009-10-06 08:43:00 +02:00
if cc_check "$_ld_gif" ; then
2009-02-08 23:49:52 +01:00
def_gif_tvt_hack='#undef CONFIG_GIF_TVT_HACK'
2003-02-19 17:55:14 +01:00
echores "disabled"
else
echores "enabled"
fi
2003-03-05 11:28:32 +01:00
;;
esac
2003-02-19 17:55:14 +01:00
2001-11-17 12:26:26 +01:00
#################
# VIDEO + AUDIO #
#################
2010-04-30 21:04:13 +02:00
# make sure this stays below CoreVideo to avoid issues due to namespace
# conflicts between -lGL and -framework OpenGL
echocheck "OpenGL"
#Note: this test is run even with --enable-gl since we autodetect linker flags
libvo, libao: remove useless video and audio output drivers
Some of these have only limited use, and some of these have no use at
all. Remove them. They make maintainance harder and nobody needs them.
It's possible that many of the removed drivers were very useful a dozen
of years ago, but now it's 2012.
Note that some of these could be added back, in case they were more
useful than I thought. But right now, they are just a burden.
Reason for removal for each module:
vo_3dfx, vo_dfbmga, vo_dxr3, vo_ivtv, vo_mga, vo_s3fb,
vo_tdfxfb, vo_xmga, vo_tdfx_vid:
All of these are for very specific and outdated hardware. Some
of them require non-standard kernel drivers or do direct HW
access.
vo_dga: the most crappy and ancient way to get fast output on X.
vo_aa: there's vo_caca for the same purpose.
vo_ggi: this never lived, and is entirely useless.
vo_mpegpes: for DVB cards, I can't test this and it's crappy.
vo_fbdev, vo_fbdev2: there's vo_directfb2
vo_bl: what is this even? But it's neither important, nor alive.
vo_svga, vo_vesa: you want to use this? You can't be serious.
vo_wii: I can't test this, and who the hell uses this?
vo_xvr100: some Sun thing.
vo_xover: only useful in connection with xvr100.
ao_nas: still alive, but I doubt it has any meaning today.
ao_sun: Sun.
ao_win32: use ao_dsound or ao_portaudio instead.
ao_ivtv: removed along vo_ivtv.
Also get rid of anything SDL related. SDL 1.x is total crap for video
output, and will be replaced with SDL 2.x soon (perhaps), so if you
want to use SDL, write output drivers for SDL 2.x.
Additionally, I accidentally damaged Sun support, which made me
completely remove Sun/Solaris support. Nobody cares about this anyway.
Some left overs from previous commits removing modules were cleaned up.
2012-07-28 20:20:17 +02:00
if (test "$_x11" = yes || test "$_cocoa" = yes || win32) && test "$_gl" != no ; then
2010-04-30 21:04:13 +02:00
cat > $TMPC << EOF
#ifdef GL_WIN32
#include <windows.h>
#include <GL/gl.h>
#else
#include <GL/gl.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
#endif
2010-06-30 11:27:03 +02:00
int main(int argc, char *argv[]) {
2010-04-30 21:04:13 +02:00
#ifdef GL_WIN32
HDC dc;
wglCreateContext(dc);
#else
glXCreateContext(NULL, NULL, NULL, True);
#endif
glFinish();
return 0;
}
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
if cc_check $_ld_tmp $_ld_lm ; then
_gl=yes
_gl_x11=yes
libs_mplayer="$libs_mplayer $_ld_tmp $_ld_dl"
break
fi
done
fi
if win32 && cc_check -DGL_WIN32 -lopengl32 ; then
2010-04-30 21:04:13 +02:00
_gl=yes
_gl_win32=yes
libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
fi
2011-10-15 18:44:00 +02:00
if test "$_cocoa" = yes ; then
_gl=yes
_gl_cocoa=yes
fi
2010-04-30 21:04:13 +02:00
else
_gl=no
fi
if test "$_gl" = yes ; then
def_gl='#define CONFIG_GL 1'
2010-05-09 13:20:15 +02:00
res_comment="backends:"
2011-10-15 18:44:00 +02:00
if test "$_gl_cocoa" = yes ; then
def_gl_cocoa='#define CONFIG_GL_COCOA 1'
res_comment="$res_comment cocoa"
fi
2010-04-30 21:04:13 +02:00
if test "$_gl_win32" = yes ; then
def_gl_win32='#define CONFIG_GL_WIN32 1'
2010-05-09 13:20:15 +02:00
res_comment="$res_comment win32"
2010-04-30 21:04:13 +02:00
fi
if test "$_gl_x11" = yes ; then
def_gl_x11='#define CONFIG_GL_X11 1'
2010-05-09 13:20:15 +02:00
res_comment="$res_comment x11"
2010-04-30 21:04:13 +02:00
fi
2010-05-09 13:20:15 +02:00
vomodules="opengl $vomodules"
2010-04-30 21:04:13 +02:00
else
def_gl='#undef CONFIG_GL'
2011-10-15 18:44:00 +02:00
def_gl_cocoa='#undef CONFIG_GL_COCOA'
2010-04-30 21:04:13 +02:00
def_gl_win32='#undef CONFIG_GL_WIN32'
def_gl_x11='#undef CONFIG_GL_X11'
2010-05-09 13:20:15 +02:00
novomodules="opengl $novomodules"
2010-04-30 21:04:13 +02:00
fi
echores "$_gl"
2006-06-18 13:21:23 +02:00
if win32; then
2008-11-18 13:23:42 +01:00
echocheck "Direct3D"
if test "$_direct3d" = auto ; then
_direct3d=no
2010-09-26 20:22:06 +02:00
header_check d3d9.h && _direct3d=yes
2008-11-18 13:23:42 +01:00
fi
if test "$_direct3d" = yes ; then
2009-02-08 23:49:52 +01:00
def_direct3d='#define CONFIG_DIRECT3D 1'
2010-05-09 13:20:15 +02:00
vomodules="direct3d $vomodules"
2008-11-18 13:23:42 +01:00
else
2009-02-08 23:49:52 +01:00
def_direct3d='#undef CONFIG_DIRECT3D'
2010-05-09 13:20:15 +02:00
novomodules="direct3d $novomodules"
2008-11-18 13:23:42 +01:00
fi
echores "$_direct3d"
2006-06-18 13:21:23 +02:00
fi #if win32; then
2001-11-17 12:26:26 +01:00
#########
# AUDIO #
#########
2001-11-17 04:53:05 +01:00
echocheck "OSS Audio"
if test "$_ossaudio" = auto ; then
_ossaudio=no
2011-01-20 12:21:34 +01:00
return_check $_soundcard_header SNDCTL_DSP_SETFRAGMENT && _ossaudio=yes
2001-11-17 04:53:05 +01:00
fi
if test "$_ossaudio" = yes ; then
2009-02-08 23:49:52 +01:00
def_ossaudio='#define CONFIG_OSS_AUDIO 1'
2010-05-09 13:20:15 +02:00
aomodules="oss $aomodules"
2010-06-14 17:19:38 +02:00
cat > $TMPC << EOF
2007-07-11 12:43:25 +02:00
#include <$_soundcard_header>
2003-01-19 16:43:12 +01:00
#ifdef OPEN_SOUND_SYSTEM
int main(void) { return 0; }
#else
#error Not the real thing
#endif
EOF
2010-06-14 17:19:38 +02:00
_real_ossaudio=no
cc_check && _real_ossaudio=yes
if test "$_real_ossaudio" = yes; then
def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
# Check for OSS4 headers (override default headers)
# Does not apply to systems where OSS4 is native (e.g. FreeBSD)
if test -f /etc/oss.conf; then
. /etc/oss.conf
_ossinc="$OSSLIBDIR/include"
if test -f "$_ossinc/sys/soundcard.h"; then
extra_cflags="-I$_ossinc $extra_cflags"
2009-06-23 06:31:13 +02:00
fi
2002-04-28 00:42:27 +02:00
fi
2010-06-14 17:19:38 +02:00
elif netbsd || openbsd ; then
def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/sound"'
extra_ldflags="$extra_ldflags -lossaudio"
else
def_ossaudio_devdsp='#define PATH_DEV_DSP "/dev/dsp"'
fi
def_ossaudio_devmixer='#define PATH_DEV_MIXER "/dev/mixer"'
2001-04-26 22:23:24 +02:00
else
2009-02-08 23:49:52 +01:00
def_ossaudio='#undef CONFIG_OSS_AUDIO'
def_ossaudio_devdsp='#define PATH_DEV_DSP ""'
def_ossaudio_devmixer='#define PATH_DEV_MIXER ""'
2010-05-09 13:20:15 +02:00
noaomodules="oss $noaomodules"
2001-04-26 22:23:24 +02:00
fi
2001-11-17 04:53:05 +01:00
echores "$_ossaudio"
2001-04-26 22:23:24 +02:00
2001-11-17 04:53:05 +01:00
2011-06-24 15:56:43 +02:00
echocheck "RSound"
if test "$_rsound" = auto ; then
_rsound=no
statement_check rsound.h 'rsd_init(NULL);' -lrsound && _rsound=yes
fi
echores "$_rsound"
if test "$_rsound" = yes ; then
def_rsound='#define CONFIG_RSOUND 1'
aomodules="rsound $aomodules"
libs_mplayer="$libs_mplayer -lrsound"
else
def_rsound='#undef CONFIG_RSOUND'
noaomodules="rsound $noaomodules"
fi
2009-01-11 13:58:06 +01:00
2007-10-18 15:34:26 +02:00
echocheck "pulse"
if test "$_pulse" = auto ; then
_pulse=no
2012-02-27 14:51:35 +01:00
if pkg_config_add 'libpulse >= 0.9' ; then
2010-06-24 10:03:41 +02:00
_pulse=yes
2004-11-06 20:35:24 +01:00
fi
fi
2007-10-18 15:34:26 +02:00
echores "$_pulse"
2004-11-06 20:35:24 +01:00
2007-10-18 15:34:26 +02:00
if test "$_pulse" = yes ; then
2009-02-08 23:49:52 +01:00
def_pulse='#define CONFIG_PULSE 1'
2010-05-09 13:20:15 +02:00
aomodules="pulse $aomodules"
2004-11-06 20:35:24 +01:00
else
2009-02-08 23:49:52 +01:00
def_pulse='#undef CONFIG_PULSE'
2010-05-09 13:20:15 +02:00
noaomodules="pulse $noaomodules"
2004-11-06 20:35:24 +01:00
fi
2004-06-25 20:11:15 +02:00
2012-04-27 11:26:04 +02:00
echocheck "PortAudio"
if test "$_portaudio" = auto && test "$_pthreads" != yes ; then
_portaudio=no
res_comment="pthreads not enabled"
fi
if test "$_portaudio" = auto ; then
_portaudio=no
if pkg_config_add 'portaudio-2.0 >= 19' ; then
_portaudio=yes
fi
fi
echores "$_portaudio"
if test "$_portaudio" = yes ; then
def_portaudio='#define CONFIG_PORTAUDIO 1'
aomodules="portaudio $aomodules"
else
def_portaudio='#undef CONFIG_PORTAUDIO'
noaomodules="portaudio $noaomodules"
fi
2004-06-25 20:11:15 +02:00
echocheck "JACK"
if test "$_jack" = auto ; then
2012-02-27 14:51:35 +01:00
_jack=no
if pkg_config_add jack ; then
_jack=yes
2005-10-03 21:36:32 +02:00
fi
2004-09-20 10:48:53 +02:00
fi
2004-06-25 20:11:15 +02:00
if test "$_jack" = yes ; then
2009-02-08 23:49:52 +01:00
def_jack='#define CONFIG_JACK 1'
2010-05-09 13:20:15 +02:00
aomodules="jack $aomodules"
2004-06-25 20:11:15 +02:00
else
2010-05-09 13:20:15 +02:00
noaomodules="jack $noaomodules"
2004-06-25 20:11:15 +02:00
fi
echores "$_jack"
2006-02-16 21:45:25 +01:00
echocheck "OpenAL"
if test "$_openal" = auto ; then
_openal=no
cat > $TMPC << EOF
2006-12-10 15:07:08 +01:00
#ifdef OPENAL_AL_H
#include <OpenAL/al.h>
#else
2006-02-16 21:45:25 +01:00
#include <AL/al.h>
2006-12-10 15:07:08 +01:00
#endif
2006-02-16 21:45:25 +01:00
int main(void) {
alSourceQueueBuffers(0, 0, 0);
// alGetSourcei(0, AL_SAMPLE_OFFSET, 0);
return 0;
}
EOF
2008-01-30 22:46:20 +01:00
for I in "-lopenal" "-lopenal32" "-framework OpenAL" ; do
2006-12-10 15:07:08 +01:00
cc_check $I && _openal=yes && break
2009-02-08 23:49:52 +01:00
cc_check -DOPENAL_AL_H=1 $I && def_openal_h='#define OPENAL_AL_H 1' && _openal=yes && break
2006-12-10 15:07:08 +01:00
done
2009-03-25 20:48:05 +01:00
test "$_openal" = yes && libs_mplayer="$libs_mplayer $I"
2006-02-16 21:45:25 +01:00
fi
if test "$_openal" = yes ; then
2009-02-08 23:49:52 +01:00
def_openal='#define CONFIG_OPENAL 1'
2010-05-09 13:20:15 +02:00
aomodules="openal $aomodules"
2006-02-16 21:45:25 +01:00
else
2010-05-09 13:20:15 +02:00
noaomodules="openal $noaomodules"
2006-02-16 21:45:25 +01:00
fi
echores "$_openal"
2004-06-25 20:11:15 +02:00
2001-11-17 04:53:05 +01:00
echocheck "ALSA audio"
2012-02-27 15:29:21 +01:00
if test "$_alsa" = auto ; then
_alsa=no
if pkg_config_add "alsa >= 1.0.9" ; then
_alsa=yes
fi
2001-02-24 21:28:24 +01:00
fi
2009-02-08 23:49:52 +01:00
def_alsa='#undef CONFIG_ALSA'
2012-02-27 15:29:21 +01:00
if test "$_alsa" = yes ; then
2010-05-09 13:20:15 +02:00
aomodules="alsa $aomodules"
2009-02-08 23:49:52 +01:00
def_alsa='#define CONFIG_ALSA 1'
2002-03-12 08:16:29 +01:00
else
2012-02-27 15:29:21 +01:00
noaomodules="alsa $noaomodules"
2001-02-24 21:28:24 +01:00
fi
2005-09-12 12:05:06 +02:00
echores "$_alsa"
2001-02-24 21:28:24 +01:00
2001-10-10 03:48:54 +02:00
2009-05-05 19:57:44 +02:00
if darwin; then
echocheck "CoreAudio"
if test "$_coreaudio" = auto ; then
cat > $TMPC <<EOF
#include <CoreAudio/CoreAudio.h>
#include <AudioToolbox/AudioToolbox.h>
#include <AudioUnit/AudioUnit.h>
int main(void) { return 0; }
EOF
_coreaudio=no
cc_check -framework CoreAudio -framework AudioUnit -framework AudioToolbox && _coreaudio=yes
fi
if test "$_coreaudio" = yes ; then
libs_mplayer="$libs_mplayer -framework CoreAudio -framework AudioUnit -framework AudioToolbox"
def_coreaudio='#define CONFIG_COREAUDIO 1'
2010-05-09 13:20:15 +02:00
aomodules="coreaudio $aomodules"
2009-05-05 19:57:44 +02:00
else
def_coreaudio='#undef CONFIG_COREAUDIO'
2010-05-09 13:20:15 +02:00
noaomodules="coreaudio $noaomodules"
2009-05-05 19:57:44 +02:00
fi
echores $_coreaudio
fi #if darwin
2008-10-21 09:02:25 +02:00
# set default CD/DVD devices
2012-04-06 15:58:39 +02:00
if win32 ; then
2008-10-21 09:02:25 +02:00
default_cdrom_device="D:"
elif darwin ; then
default_cdrom_device="/dev/disk1"
elif dragonfly ; then
default_cdrom_device="/dev/cd0"
elif freebsd ; then
default_cdrom_device="/dev/acd0"
elif openbsd ; then
2010-08-03 10:57:48 +02:00
default_cdrom_device="/dev/rcd0c"
2008-10-21 09:02:25 +02:00
else
default_cdrom_device="/dev/cdrom"
fi
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 win32 || dragonfly || freebsd || openbsd ; then
2008-10-21 09:02:25 +02:00
default_dvd_device=$default_cdrom_device
elif darwin ; then
default_dvd_device="/dev/rdiskN"
else
default_dvd_device="/dev/dvd"
fi
2001-11-28 00:17:58 +01:00
echocheck "VCD support"
2009-05-05 19:15:54 +02:00
if test "$_vcd" = auto; then
2009-05-05 19:17:17 +02:00
_vcd=no
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 linux || freebsd || netbsd || openbsd || dragonfly || darwin ; then
2009-05-05 19:17:17 +02:00
_vcd=yes
elif mingw32; then
2010-06-24 10:03:41 +02:00
header_check ddk/ntddcdrm.h && _vcd=yes
2009-05-05 19:17:17 +02:00
fi
2009-03-28 19:53:26 +01:00
fi
if test "$_vcd" = yes; then
2010-05-09 13:20:15 +02:00
inputmodules="vcd $inputmodules"
2009-02-08 23:49:52 +01:00
def_vcd='#define CONFIG_VCD 1'
2001-11-28 00:17:58 +01:00
else
2009-02-08 23:49:52 +01:00
def_vcd='#undef CONFIG_VCD'
2010-05-29 12:43:51 +02:00
noinputmodules="vcd $noinputmodules"
2010-05-09 13:20:15 +02:00
res_comment="not supported on this OS"
2001-11-28 00:17:58 +01:00
fi
2006-05-07 16:00:07 +02:00
echores "$_vcd"
2001-11-28 00:17:58 +01:00
2002-01-04 14:08:14 +01:00
2010-07-05 19:04:46 +02:00
echocheck "Blu-ray support"
if test "$_bluray" = auto ; then
_bluray=no
2012-05-06 18:08:33 +02:00
pkg_config_add 'libbluray >= 0.2.1' && _bluray=yes
2010-07-05 19:04:46 +02:00
fi
if test "$_bluray" = yes ; then
def_bluray='#define CONFIG_LIBBLURAY 1'
inputmodules="bluray $inputmodules"
else
def_bluray='#undef CONFIG_LIBBLURAY'
noinputmodules="bluray $noinputmodules"
fi
echores "$_bluray"
2012-08-12 18:40:21 +02:00
2006-11-03 23:03:58 +01:00
echocheck "dvdread"
2012-08-12 18:40:21 +02:00
if test "$_dvdread" = auto ; then
2006-11-03 23:03:58 +01:00
_dvdread=no
2012-08-12 18:40:21 +02:00
pkg_config_add 'dvdread >= 4.2.0' && _dvdread=yes
2001-11-17 04:53:05 +01:00
fi
2012-08-12 18:40:21 +02:00
if test "$_dvdread" = yes ; then
2009-02-08 23:49:52 +01:00
def_dvdread='#define CONFIG_DVDREAD 1'
2012-08-12 18:40:21 +02:00
inputmodules="dvdread $inputmodules"
2005-12-14 22:52:41 +01:00
else
2009-02-08 23:49:52 +01:00
def_dvdread='#undef CONFIG_DVDREAD'
2010-05-29 12:43:51 +02:00
noinputmodules="dvdread $noinputmodules"
2005-12-14 22:52:41 +01:00
fi
2006-11-03 23:03:58 +01:00
echores "$_dvdread"
2005-12-14 22:52:41 +01:00
2002-03-28 21:40:21 +01:00
2005-11-06 18:42:20 +01:00
echocheck "libcdio"
2012-03-21 00:57:58 +01:00
if test "$_libcdio" = auto ; then
2012-02-27 14:51:35 +01:00
_libcdio=no
if pkg_config_add libcdio_paranoia ; then
_libcdio=yes
2005-11-06 18:42:20 +01:00
fi
fi
2012-03-21 00:57:58 +01:00
if test "$_libcdio" = yes ; then
2006-07-06 15:09:45 +02:00
_cdda='yes'
2012-03-21 00:57:58 +01:00
def_cdda='#define CONFIG_CDDA 1'
2010-07-17 15:14:53 +02:00
test $_cddb = auto && test $networking = yes && _cddb=yes
2010-05-09 13:20:15 +02:00
inputmodules="cdda $inputmodules"
2006-10-29 12:38:14 +01:00
else
2012-03-21 00:57:58 +01:00
_libcdio=no
_cdda='no'
def_cdda='#undef CONFIG_CDDA'
2010-05-29 12:43:51 +02:00
noinputmodules="cdda $noinputmodules"
2006-10-29 12:38:14 +01:00
fi
2012-03-21 00:57:58 +01:00
echores "$_libcdio"
2005-11-06 18:42:20 +01:00
2006-12-04 21:20:32 +01:00
if test "$_cddb" = yes ; then
2009-10-28 14:55:18 +01:00
def_cddb='#define CONFIG_CDDB 1'
2010-05-09 13:20:15 +02:00
inputmodules="cddb $inputmodules"
2006-12-04 21:20:32 +01:00
else
_cddb=no
2009-02-08 23:49:52 +01:00
def_cddb='#undef CONFIG_CDDB'
2010-05-29 12:43:51 +02:00
noinputmodules="cddb $noinputmodules"
2006-12-04 21:20:32 +01:00
fi
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
echocheck "SSA/ASS support"
if test "$_ass" = auto ; then
if pkg_config_add libass ; then
_ass=yes
def_ass='#define CONFIG_ASS 1'
else
die "Unable to find development files for libass. Aborting. If you really mean to compile without libass support use --disable-libass."
fi
else
def_ass='#undef CONFIG_ASS'
fi
echores "$_ass"
echocheck "libass OSD support"
2012-07-28 22:00:31 +02:00
_dummy_osd=yes
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
if test "$_libass_osd" = auto ; then
_libass_osd=no
if test "$_ass" = yes ; then
_libass_osd=yes
2012-07-28 22:00:31 +02:00
_dummy_osd=no
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
fi
fi
echores "$_libass_osd"
2004-05-08 19:52:25 +02:00
echocheck "ENCA"
if test "$_enca" = auto ; then
_enca=no
2010-09-27 02:02:59 +02:00
statement_check enca.h 'enca_get_languages(NULL)' -lenca $_ld_lm && _enca=yes
2004-10-24 15:37:35 +02:00
fi
2004-05-08 19:52:25 +02:00
if test "$_enca" = yes ; then
2010-01-04 13:24:07 +01:00
def_enca='#define CONFIG_ENCA 1'
extra_ldflags="$extra_ldflags -lenca"
2004-05-08 19:52:25 +02:00
else
2010-01-04 13:24:07 +01:00
def_enca='#undef CONFIG_ENCA'
2004-05-08 19:52:25 +02:00
fi
echores "$_enca"
2001-11-17 04:53:05 +01:00
echocheck "zlib"
_zlib=no
2010-09-27 02:02:59 +02:00
statement_check zlib.h 'inflate(0, Z_NO_FLUSH)' -lz && _zlib=yes
2001-11-17 04:53:05 +01:00
if test "$_zlib" = yes ; then
2009-02-08 23:49:52 +01:00
def_zlib='#define CONFIG_ZLIB 1'
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -lz"
2001-02-24 21:28:24 +01:00
else
2009-02-08 23:49:52 +01:00
def_zlib='#define CONFIG_ZLIB 0'
2001-02-24 21:28:24 +01:00
fi
2001-11-17 04:53:05 +01:00
echores "$_zlib"
2001-02-24 21:28:24 +01:00
2001-07-03 16:22:23 +02:00
2012-05-06 18:29:14 +02:00
# Any version of libmpg123 that knows MPG123_RESYNC_LIMIT shall be fine.
# That is, 1.2.0 onwards. Recommened is 1.14 onwards, though.
2010-06-30 11:55:14 +02:00
echocheck "mpg123 support"
def_mpg123='#undef CONFIG_MPG123'
if test "$_mpg123" = auto; then
_mpg123=no
2012-05-06 18:29:14 +02:00
pkg_config_add 'libmpg123 >= 1.2.0' && _mpg123=yes
2010-06-30 11:55:14 +02:00
fi
if test "$_mpg123" = yes ; then
def_mpg123='#define CONFIG_MPG123 1'
codecmodules="mpg123 $codecmodules"
else
nocodecmodules="mpg123 $nocodecmodules"
fi
echores "$_mpg123"
2004-12-23 03:09:52 +01:00
echocheck "LADSPA plugin support"
if test "$_ladspa" = auto ; then
_ladspa=no
2010-09-27 02:46:28 +02:00
statement_check ladspa.h 'LADSPA_Descriptor ld = {0}' && _ladspa=yes
2004-12-23 03:09:52 +01:00
fi
if test "$_ladspa" = yes; then
2009-10-28 14:55:18 +01:00
def_ladspa="#define CONFIG_LADSPA 1"
2004-12-23 03:09:52 +01:00
else
2009-02-08 23:49:52 +01:00
def_ladspa="#undef CONFIG_LADSPA"
2004-12-23 03:09:52 +01:00
fi
echores "$_ladspa"
2009-04-02 21:01:23 +02:00
echocheck "libbs2b audio filter support"
if test "$_libbs2b" = auto ; then
2012-02-27 14:51:35 +01:00
_libbs2b=no
if pkg_config_add libbs2b ; then
2009-04-02 21:01:23 +02:00
_libbs2b=yes
2012-02-27 14:51:35 +01:00
fi
2009-04-02 21:01:23 +02:00
fi
def_libbs2b="#undef CONFIG_LIBBS2B"
2009-10-28 14:55:18 +01:00
test "$_libbs2b" = yes && def_libbs2b="#define CONFIG_LIBBS2B 1"
2009-04-02 21:01:23 +02:00
echores "$_libbs2b"
2006-11-01 21:31:18 +01:00
if test -z "$_codecsdir" ; then
for dir in "$_libdir/codecs" "$_libdir/win32" /usr/local/lib/codecs \
/usr/lib/codecs /usr/local/lib/win32 /usr/lib/win32 ; do
if test -d "$dir" ; then
_codecsdir="$dir"
break;
fi;
done
fi
# Fall back on default directory.
if test -z "$_codecsdir" ; then
_codecsdir="$_libdir/codecs"
2012-04-06 15:58:39 +02:00
mingw32 && _codecsdir="codecs"
2003-01-04 20:07:46 +01:00
fi
2006-11-01 21:31:18 +01:00
2012-03-31 01:13:38 +02:00
echocheck "LCMS2 support"
if test "$_lcms2" = auto ; then
_lcms2=no
if pkg_config_add lcms2 ; then
_lcms2=yes
fi
fi
if test "$_lcms2" = yes; then
def_lcms2="#define CONFIG_LCMS2 1"
else
def_lcms2="#undef CONFIG_LCMS2"
fi
echores "$_lcms2"
2001-12-30 00:34:53 +01:00
2012-01-28 12:41:36 +01:00
# Test with > against Libav 0.8 versions which will NOT work rather than
# specify minimum version, to allow (future) point releases to possibly work.
2012-02-27 17:18:49 +01:00
all_libav_libs="libavutil > 51.21.0:libavcodec > 53.34.0:libavformat > 53.20.0:libswscale >= 2.0.0"
2011-08-20 23:36:23 +02:00
echocheck "Libav ($all_libav_libs)"
2010-10-31 02:19:56 +02:00
if test "$ffmpeg" = auto ; then
2011-12-22 00:07:12 +01:00
IFS=":" # shell should not be used for programming
2012-03-04 20:53:42 +01:00
if ! pkg_config_add $all_libav_libs ; then
2011-12-11 06:48:26 +01:00
die "Unable to find development files for some of the required Libav libraries above. Aborting."
2006-01-22 19:11:35 +01:00
fi
fi
2011-12-22 00:07:12 +01:00
echores "yes"
2006-01-22 19:11:35 +01:00
2010-10-31 02:19:56 +02:00
def_ffmpeg_internals="#undef CONFIG_FFMPEG_INTERNALS"
2009-07-26 04:55:40 +02:00
if ! test -z "$_ffmpeg_source" ; then
2011-12-11 06:48:26 +01:00
def_ffmpeg_internals="#define CONFIG_FFMPEG_INTERNALS 1" && ffmpeg_internals=yes
2009-07-26 04:55:40 +02:00
fi
2012-02-27 17:18:49 +01:00
echocheck "libpostproc >= 52.0.0"
if test "$libpostproc" = auto ; then
libpostproc=no
if pkg_config_add "libpostproc >= 52.0.0" ; then
libpostproc=yes
fi
fi
if test "$libpostproc" = yes ; then
def_libpostproc='#define CONFIG_LIBPOSTPROC 1'
else
def_libpostproc='#undef CONFIG_LIBPOSTPROC'
fi
echores "$libpostproc"
2010-10-31 02:19:56 +02:00
2009-07-26 04:55:40 +02:00
2001-11-17 04:53:05 +01:00
echocheck "TV interface"
if test "$_tv" = yes ; then
2009-02-08 23:49:52 +01:00
def_tv='#define CONFIG_TV 1'
2010-05-09 13:20:15 +02:00
inputmodules="tv $inputmodules"
2001-02-24 21:28:24 +01:00
else
2010-05-29 12:43:51 +02:00
noinputmodules="tv $noinputmodules"
2009-02-08 23:49:52 +01:00
def_tv='#undef CONFIG_TV'
2001-02-24 21:28:24 +01:00
fi
2001-11-17 04:53:05 +01:00
echores "$_tv"
2001-02-24 21:28:24 +01:00
2006-06-18 13:21:23 +02:00
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 freebsd || netbsd || openbsd || dragonfly ; then
2007-08-01 11:32:37 +02:00
echocheck "*BSD BT848 bt8xx header"
_ioctl_bt848_h=no
for file in "machine/ioctl_bt848.h" \
2007-04-09 15:18:06 +02:00
"dev/bktr/ioctl_bt848.h" \
"dev/video/bktr/ioctl_bt848.h" \
"dev/ic/bt8xx.h" ; do
cat > $TMPC <<EOF
#include <sys/types.h>
2007-11-02 00:33:51 +01:00
#include <sys/ioctl.h>
2007-04-09 15:18:06 +02:00
#include <$file>
2008-05-03 22:03:36 +02:00
int main(void) { ioctl(0, TVTUNER_GETFREQ, 0); return 0; }
2007-04-09 15:18:06 +02:00
EOF
if cc_check ; then
_ioctl_bt848_h=yes
_ioctl_bt848_h_name="$file"
break;
fi
2007-08-01 11:32:37 +02:00
done
if test "$_ioctl_bt848_h" = yes ; then
2009-02-08 23:49:52 +01:00
def_ioctl_bt848_h_name="#define IOCTL_BT848_H_NAME <$_ioctl_bt848_h_name>"
2010-05-09 13:20:15 +02:00
res_comment="using $_ioctl_bt848_h_name"
2007-08-01 11:32:37 +02:00
else
2009-02-08 23:49:52 +01:00
def_ioctl_bt848_h_name="#undef IOCTL_BT848_H_NAME"
2007-08-01 11:32:37 +02:00
fi
echores "$_ioctl_bt848_h"
2007-04-09 15:18:06 +02:00
2007-08-01 11:32:37 +02:00
echocheck "*BSD ioctl_meteor.h"
_ioctl_meteor_h=no
2011-01-02 12:49:48 +01:00
for ioctl_meteor_h_path in "machine/ioctl_meteor.h" "dev/bktr/ioctl_meteor.h" "dev/video/bktr/ioctl_meteor.h" ; do
statement_check_broken "sys/types.h" "$ioctl_meteor_h_path" 'ioctl(0, METEORSINPUT, 0)' &&
_ioctl_meteor_h=yes && break
2007-08-01 11:32:37 +02:00
done
if test "$_ioctl_meteor_h" = yes ; then
2011-01-02 12:49:48 +01:00
def_ioctl_meteor_h_name="#define IOCTL_METEOR_H_NAME <$ioctl_meteor_h_path>"
res_comment="using $ioctl_meteor_h_path"
2007-08-01 11:32:37 +02:00
else
2009-02-08 23:49:52 +01:00
def_ioctl_meteor_h_name="#undef IOCTL_METEOR_H_NAME"
2007-08-01 11:32:37 +02:00
fi
echores "$_ioctl_meteor_h"
2007-04-09 15:18:06 +02:00
2007-08-01 11:32:37 +02:00
echocheck "*BSD BrookTree 848 TV interface"
if test "$_tv_bsdbt848" = auto ; then
_tv_bsdbt848=no
if test "$_tv" = yes ; then
cat > $TMPC <<EOF
2002-03-15 17:10:29 +01:00
#include <sys/types.h>
2009-02-08 23:49:52 +01:00
$def_ioctl_meteor_h_name
$def_ioctl_bt848_h_name
2007-04-09 15:18:06 +02:00
#ifdef IOCTL_METEOR_H_NAME
#include IOCTL_METEOR_H_NAME
2002-04-28 00:42:27 +02:00
#endif
2007-04-09 15:18:06 +02:00
#ifdef IOCTL_BT848_H_NAME
#include IOCTL_BT848_H_NAME
#endif
2008-05-03 22:03:36 +02:00
int main(void) {
2007-04-09 15:18:06 +02:00
ioctl(0, METEORSINPUT, 0);
ioctl(0, TVTUNER_GETFREQ, 0);
2008-05-03 22:14:50 +02:00
return 0;
2007-04-09 15:18:06 +02:00
}
2002-03-15 17:10:29 +01:00
EOF
2007-08-01 11:32:37 +02:00
cc_check && _tv_bsdbt848=yes
fi
fi
if test "$_tv_bsdbt848" = yes ; then
2009-02-08 23:49:52 +01:00
def_tv_bsdbt848='#define CONFIG_TV_BSDBT848 1'
2010-05-09 13:20:15 +02:00
inputmodules="tv-bsdbt848 $inputmodules"
2007-08-01 11:32:37 +02:00
else
2009-02-08 23:49:52 +01:00
def_tv_bsdbt848='#undef CONFIG_TV_BSDBT848'
2010-05-29 12:43:51 +02:00
noinputmodules="tv-bsdbt848 $noinputmodules"
2007-08-01 11:32:37 +02:00
fi
echores "$_tv_bsdbt848"
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
fi #if freebsd || netbsd || openbsd || dragonfly
2006-06-18 13:21:23 +02:00
2002-03-15 17:10:29 +01:00
2003-08-07 14:24:35 +02:00
echocheck "Video 4 Linux 2 TV interface"
if test "$_tv_v4l2" = auto ; then
2007-08-01 11:32:37 +02:00
_tv_v4l2=no
if test "$_tv" = yes && linux ; then
2011-01-02 12:49:48 +01:00
header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
2011-06-29 06:19:49 +02:00
elif test "$_tv" = yes && test "$sys_videoio_h" = "yes" ; then
_tv_v4l2=yes
2007-08-01 11:32:37 +02:00
fi
2003-08-07 14:24:35 +02:00
fi
if test "$_tv_v4l2" = yes ; then
2007-04-23 09:28:48 +02:00
_audio_input=yes
2009-02-08 23:49:52 +01:00
def_tv_v4l2='#define CONFIG_TV_V4L2 1'
2010-05-09 13:20:15 +02:00
inputmodules="tv-v4l2 $inputmodules"
2003-08-07 14:24:35 +02:00
else
2010-05-29 12:43:51 +02:00
noinputmodules="tv-v4l2 $noinputmodules"
2009-02-08 23:49:52 +01:00
def_tv_v4l2='#undef CONFIG_TV_V4L2'
2003-08-07 14:24:35 +02:00
fi
echores "$_tv_v4l2"
2006-08-28 19:05:18 +02:00
echocheck "Radio interface"
if test "$_radio" = yes ; then
2009-02-08 23:49:52 +01:00
def_radio='#define CONFIG_RADIO 1'
2010-05-09 13:20:15 +02:00
inputmodules="radio $inputmodules"
2012-02-27 15:29:21 +01:00
if test "$_alsa" != yes -a "$_ossaudio" != yes ; then
2006-08-28 19:05:18 +02:00
_radio_capture=no
fi
if test "$_radio_capture" = yes ; then
2007-04-22 22:43:28 +02:00
_audio_input=yes
2009-02-08 23:49:52 +01:00
def_radio_capture="#define CONFIG_RADIO_CAPTURE 1"
2006-08-28 19:05:18 +02:00
else
2009-02-08 23:49:52 +01:00
def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
2006-08-28 19:05:18 +02:00
fi
else
2010-05-29 12:43:51 +02:00
noinputmodules="radio $noinputmodules"
2009-02-08 23:49:52 +01:00
def_radio='#undef CONFIG_RADIO'
def_radio_capture="#undef CONFIG_RADIO_CAPTURE"
2006-08-28 19:05:18 +02:00
_radio_capture=no
fi
echores "$_radio"
echocheck "Capture for Radio interface"
echores "$_radio_capture"
echocheck "Video 4 Linux 2 Radio interface"
if test "$_radio_v4l2" = auto ; then
2006-08-31 20:35:32 +02:00
_radio_v4l2=no
if test "$_radio" = yes && linux ; then
2010-06-24 10:03:41 +02:00
header_check linux/videodev2.h && _radio_v4l2=yes
2006-08-31 20:35:32 +02:00
fi
2006-08-28 19:05:18 +02:00
fi
if test "$_radio_v4l2" = yes ; then
2009-02-08 23:49:52 +01:00
def_radio_v4l2='#define CONFIG_RADIO_V4L2 1'
2006-08-28 19:05:18 +02:00
else
2009-02-08 23:49:52 +01:00
def_radio_v4l2='#undef CONFIG_RADIO_V4L2'
2006-08-28 19:05:18 +02:00
fi
echores "$_radio_v4l2"
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 freebsd || netbsd || openbsd || dragonfly &&
2011-01-02 12:49:48 +01:00
test "$_radio" = yes && test "$_radio_bsdbt848" = auto ; then
2007-04-11 07:39:09 +02:00
echocheck "*BSD BrookTree 848 Radio interface"
_radio_bsdbt848=no
2006-11-18 07:53:33 +01:00
cat > $TMPC <<EOF
#include <sys/types.h>
2009-02-08 23:49:52 +01:00
$def_ioctl_bt848_h_name
2007-04-11 07:39:09 +02:00
#ifdef IOCTL_BT848_H_NAME
#include IOCTL_BT848_H_NAME
#endif
2008-05-03 22:03:36 +02:00
int main(void) { ioctl(0, RADIO_GETFREQ, 0); return 0; }
2006-11-18 07:53:33 +01:00
EOF
2007-04-11 07:39:09 +02:00
cc_check && _radio_bsdbt848=yes
echores "$_radio_bsdbt848"
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
fi #if freebsd || netbsd || openbsd || dragonfly && _radio && _radio_bsdbt848
2006-11-18 07:53:33 +01:00
2007-04-11 07:39:09 +02:00
if test "$_radio_bsdbt848" = yes ; then
2009-02-08 23:49:52 +01:00
def_radio_bsdbt848='#define CONFIG_RADIO_BSDBT848 1'
2006-11-18 07:53:33 +01:00
else
2009-02-08 23:49:52 +01:00
def_radio_bsdbt848='#undef CONFIG_RADIO_BSDBT848'
2006-11-18 07:53:33 +01:00
fi
2012-08-02 23:51:54 +02:00
if test "$_radio_v4l2" = no &&
2007-04-11 07:39:09 +02:00
test "$_radio_bsdbt848" = no && test "$_radio" = yes ; then
2012-08-02 23:51:54 +02:00
die "Radio driver requires BSD BT848 or V4L2!"
2006-08-31 21:00:09 +02:00
fi
2006-08-28 19:05:18 +02:00
2006-09-27 22:26:38 +02:00
echocheck "Video 4 Linux 2 MPEG PVR interface"
2006-07-10 23:32:19 +02:00
if test "$_pvr" = auto ; then
_pvr=no
if test "$_tv_v4l2" = yes && linux ; then
cat > $TMPC <<EOF
2011-01-02 12:49:48 +01:00
#include <sys/time.h>
2006-07-10 23:32:19 +02:00
#include <linux/videodev2.h>
2009-08-14 11:31:16 +02:00
int main(void) { struct v4l2_ext_controls ext; return ext.controls->value; }
2006-07-10 23:32:19 +02:00
EOF
cc_check && _pvr=yes
fi
fi
if test "$_pvr" = yes ; then
2009-02-08 23:49:52 +01:00
def_pvr='#define CONFIG_PVR 1'
2010-05-09 13:20:15 +02:00
inputmodules="pvr $inputmodules"
2006-07-10 23:32:19 +02:00
else
2010-05-29 12:43:51 +02:00
noinputmodules="pvr $noinputmodules"
2009-02-08 23:49:52 +01:00
def_pvr='#undef CONFIG_PVR'
2006-07-10 23:32:19 +02:00
fi
echores "$_pvr"
2003-08-15 21:13:23 +02:00
echocheck "ftp"
2010-09-22 00:26:44 +02:00
if test "$_ftp" = "auto" ; then
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
test "$networking" = "yes" && _ftp=yes
2010-09-22 00:26:44 +02:00
fi
if test "$_ftp" = yes ; then
2009-02-08 23:49:52 +01:00
def_ftp='#define CONFIG_FTP 1'
2010-05-09 13:20:15 +02:00
inputmodules="ftp $inputmodules"
2003-08-15 21:13:23 +02:00
else
2010-05-29 12:43:51 +02:00
noinputmodules="ftp $noinputmodules"
2009-02-08 23:49:52 +01:00
def_ftp='#undef CONFIG_FTP'
2003-08-15 21:13:23 +02:00
fi
echores "$_ftp"
2005-02-27 05:25:12 +01:00
echocheck "vstream client"
if test "$_vstream" = auto ; then
_vstream=no
cat > $TMPC <<EOF
#include <vstream-client.h>
void vstream_error(const char *format, ... ) {}
int main(void) { vstream_start(); return 0; }
EOF
cc_check -lvstream-client && _vstream=yes
fi
if test "$_vstream" = yes ; then
2009-02-08 23:49:52 +01:00
def_vstream='#define CONFIG_VSTREAM 1'
2010-05-09 13:20:15 +02:00
inputmodules="vstream $inputmodules"
2009-03-25 20:48:05 +01:00
extra_ldflags="$extra_ldflags -lvstream-client"
2005-02-27 05:25:12 +01:00
else
2010-05-29 12:43:51 +02:00
noinputmodules="vstream $noinputmodules"
2009-02-08 23:49:52 +01:00
def_vstream='#undef CONFIG_VSTREAM'
2005-02-27 05:25:12 +01:00
fi
echores "$_vstream"
2001-02-24 21:28:24 +01:00
2002-12-05 01:05:57 +01:00
echocheck "Subtitles sorting"
if test "$_sortsub" = yes ; then
2009-02-08 23:49:52 +01:00
def_sortsub='#define CONFIG_SORTSUB 1'
2002-12-05 01:05:57 +01:00
else
2009-02-08 23:49:52 +01:00
def_sortsub='#undef CONFIG_SORTSUB'
2002-12-05 01:05:57 +01:00
fi
echores "$_sortsub"
2012-09-14 17:51:26 +02:00
echocheck "encoding"
if test "$_encoding" = yes ; then
def_encoding="#define CONFIG_ENCODING 1"
else
def_encoding="#undef CONFIG_ENCODING"
fi
echores "$_encoding"
2002-12-22 22:01:01 +01:00
2001-11-17 04:53:05 +01:00
#############################################################################
2001-03-28 14:08:44 +02:00
2005-06-01 11:08:15 +02:00
echocheck "compiler support for noexecstack"
2010-07-02 01:03:40 +02:00
if cflag_check -Wl,-z,noexecstack ; then
2009-03-25 20:48:05 +01:00
extra_ldflags="-Wl,-z,noexecstack $extra_ldflags"
2005-06-01 11:08:15 +02:00
echores "yes"
else
echores "no"
fi
2010-01-16 17:39:46 +01:00
echocheck "linker support for --nxcompat --no-seh --dynamicbase"
2010-07-02 01:03:40 +02:00
if cflag_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then
2010-01-16 17:39:46 +01:00
extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags"
echores "yes"
else
echores "no"
fi
2002-04-12 12:40:38 +02:00
2012-08-12 15:30:21 +02:00
extra_ldflags="$extra_ldflags $_ld_pthread $_ld_dl"
2009-03-25 20:48:05 +01:00
(netbsd || openbsd) && x86_32 && extra_ldflags="$extra_ldflags -li386"
2001-11-17 04:53:05 +01:00
2007-05-18 01:20:58 +02:00
2005-11-17 12:06:38 +01:00
echocheck "joystick"
2009-02-08 23:49:52 +01:00
def_joystick='#undef CONFIG_JOYSTICK'
2002-08-28 17:55:58 +02:00
if test "$_joystick" = yes ; then
2010-11-03 09:09:31 +01:00
if linux || freebsd ; then
2002-08-28 17:55:58 +02:00
# TODO add some check
2009-02-08 23:49:52 +01:00
def_joystick='#define CONFIG_JOYSTICK 1'
2002-08-28 17:55:58 +02:00
else
2008-02-28 19:19:10 +01:00
_joystick="no"
2010-05-09 13:20:15 +02:00
res_comment="unsupported under $system_name"
2002-02-03 13:43:18 +01:00
fi
fi
2005-11-17 12:06:38 +01:00
echores "$_joystick"
2002-02-03 13:43:18 +01:00
2002-02-23 22:20:16 +01:00
echocheck "lirc"
if test "$_lirc" = auto ; then
_lirc=no
2010-06-24 10:03:41 +02:00
header_check lirc/lirc_client.h -llirc_client && _lirc=yes
2002-02-23 22:20:16 +01:00
fi
if test "$_lirc" = yes ; then
2009-02-08 23:49:52 +01:00
def_lirc='#define CONFIG_LIRC 1'
2009-05-08 18:21:03 +02:00
libs_mplayer="$libs_mplayer -llirc_client"
2002-02-23 22:20:16 +01:00
else
2009-02-08 23:49:52 +01:00
def_lirc='#undef CONFIG_LIRC'
2002-02-23 22:20:16 +01:00
fi
echores "$_lirc"
2003-05-30 20:23:55 +02:00
echocheck "lircc"
if test "$_lircc" = auto ; then
_lircc=no
2010-06-24 10:03:41 +02:00
header_check lirc/lircc.h -llircc && _lircc=yes
2003-05-30 20:23:55 +02:00
fi
if test "$_lircc" = yes ; then
2009-02-08 23:49:52 +01:00
def_lircc='#define CONFIG_LIRCC 1'
2009-05-08 18:21:03 +02:00
libs_mplayer="$libs_mplayer -llircc"
2003-05-30 20:23:55 +02:00
else
2009-02-08 23:49:52 +01:00
def_lircc='#undef CONFIG_LIRCC'
2003-05-30 20:23:55 +02:00
fi
echores "$_lircc"
2002-02-23 22:20:16 +01:00
2008-07-28 19:21:36 +02:00
#############################################################################
2008-07-28 19:33:08 +02: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
2011-10-21 17:44:56 +02:00
CXXFLAGS=" $CFLAGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
2007-03-18 22:58:28 +01:00
2009-02-23 02:39:27 +01:00
# DO NOT ADD ANY TESTS THAT USE LINKER FLAGS HERE (like cc_check).
2010-03-17 15:41:32 +01:00
mak_enable () {
list=$(echo $1 | tr '[a-z]' '[A-Z]')
item=$(echo $2 | tr '[a-z]' '[A-Z]')
nprefix=$3;
for part in $list; do
if $(echo $item | grep -q -E "(^| )$part($| )"); then
echo "${nprefix}_$part = yes"
fi
done
}
2001-11-17 04:53:05 +01:00
#############################################################################
2001-11-18 18:45:23 +01:00
echo "Creating config.mak"
cat > config.mak << EOF
# -------- Generated by configure -----------
2001-11-17 04:53:05 +01:00
2008-06-02 14:55:24 +02:00
# Ensure that locale settings do not interfere with shell commands.
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
2009-06-19 17:20:59 +02:00
DOC_LANGS = $language_doc
2008-07-19 04:00:56 +02:00
DOC_LANG_ALL = $doc_lang_all
2009-06-19 17:20:59 +02:00
MAN_LANGS = $language_man
2008-07-17 14:36:54 +02:00
MAN_LANG_ALL = $man_lang_all
2010-03-28 13:49:09 +02:00
MSG_LANGS = $language_msg
MSG_LANG_ALL = $msg_lang_all
2008-06-02 14:24:28 +02:00
2010-04-04 18:48:46 +02:00
prefix = \$(DESTDIR)$_prefix
BINDIR = \$(DESTDIR)$_bindir
2002-06-24 10:23:48 +02:00
DATADIR = \$(DESTDIR)$_datadir
2010-04-04 18:48:46 +02:00
LIBDIR = \$(DESTDIR)$_libdir
MANDIR = \$(DESTDIR)$_mandir
2002-06-24 10:23:48 +02:00
CONFDIR = \$(DESTDIR)$_confdir
2010-03-08 21:48:50 +01:00
LOCALEDIR = \$(DESTDIR)$_localedir
2008-06-02 14:24:28 +02:00
2010-04-04 18:48:46 +02:00
CC = $_cc
CXX = $_cc
2002-12-05 00:29:41 +01:00
INSTALL = $_install
2008-06-02 14:24:28 +02:00
INSTALLSTRIP = $_install_strip
2008-10-04 13:27:39 +02:00
WINDRES = $_windres
2008-06-02 14:24:28 +02:00
2011-07-06 09:53:41 +02:00
CFLAGS = $WARNFLAGS $ERRORFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
CXXFLAGS = $WARNFLAGS $ERRORFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
2010-07-02 01:18:16 +02:00
DEPFLAGS = $DEPFLAGS
2010-04-04 18:48:46 +02:00
EXTRALIBS = $extra_ldflags $_ld_static $_ld_lm $extra_libs
EXTRALIBS_MPLAYER = $libs_mplayer
2008-06-02 14:24:28 +02:00
GETCH = $_getch
TIMER = $_timer
2010-04-04 18:48:46 +02:00
EXESUF = $_exesuf
2009-02-12 13:17:50 +01:00
EXESUFS_ALL = .exe
2008-06-02 14:24:28 +02:00
2010-03-17 14:55:59 +01:00
ARCH = $arch
2010-03-17 15:41:32 +01:00
$(mak_enable "$arch_all" "$arch" ARCH)
$(mak_enable "$subarch_all" "$subarch" ARCH)
2006-10-31 13:52:05 +01:00
2010-04-04 18:48:46 +02:00
MPLAYER = $_mplayer
2007-01-10 20:07:42 +01:00
2011-01-26 20:00:17 +01:00
NEED_GETTIMEOFDAY = $need_gettimeofday
NEED_GLOB = $need_glob
NEED_SHMEM = $need_shmem
NEED_STRSEP = $need_strsep
NEED_VSSCANF = $need_vsscanf
2007-01-10 20:07:42 +01:00
2008-06-02 14:24:28 +02:00
# features
2012-02-27 15:29:21 +01:00
ALSA = $_alsa
2008-05-18 13:53:00 +02:00
APPLE_IR = $_apple_ir
2007-08-14 16:29:22 +02:00
APPLE_REMOTE = $_apple_remote
2007-04-22 22:43:28 +02:00
AUDIO_INPUT = $_audio_input
2008-12-03 15:48:31 +01:00
CACA = $_caca
2006-07-06 15:09:45 +02:00
CDDA = $_cdda
2006-11-27 23:02:06 +01:00
CDDB = $_cddb
2012-04-03 08:13:12 +02:00
COCOA = $_cocoa
2008-06-02 14:24:28 +02:00
COREAUDIO = $_coreaudio
COREVIDEO = $_corevideo
2008-12-03 15:48:31 +01:00
DIRECT3D = $_direct3d
2008-06-02 14:24:28 +02:00
DVBIN = $_dvbin
DVDREAD = $_dvdread
2008-12-03 15:48:31 +01:00
DXR3 = $_dxr3
2008-06-02 14:24:28 +02:00
FTP = $_ftp
GIF = $_gif
2008-12-03 15:48:31 +01:00
GL = $_gl
2011-10-15 18:44:00 +02:00
GL_COCOA = $_gl_cocoa
2008-12-03 15:48:31 +01:00
GL_WIN32 = $_gl_win32
2009-12-19 11:52:32 +01:00
GL_X11 = $_gl_x11
2008-10-04 13:06:50 +02:00
HAVE_POSIX_SELECT = $_posix_select
HAVE_SYS_MMAN_H = $_mman
2008-12-03 13:05:47 +01:00
JACK = $_jack
2008-06-02 14:24:28 +02:00
JOYSTICK = $_joystick
JPEG = $_jpeg
LADSPA = $_ladspa
2008-04-09 20:26:44 +02:00
LIBASS = $_ass
osd: use libass for OSD rendering
The OSD will now be rendered with libass. The old rendering code, which
used freetype/fontconfig and did text layout manually, is disabled. To
re-enable the old code, use the --disable-libass-osd configure switch.
Some switches do nothing with the new code enabled, such as -subalign,
-sub-bg-alpha, -sub-bg-color, and many more. (The reason is mostly that
the code for rendering unstyled subtitles with libass doesn't make any
attempts to support them. Some of them could be supported in theory.)
Teletext rendering is not implemented in the new OSD rendering code. I
don't have any teletext sources for testing, and since teletext is
being phased out world-wide, the need for this is questionable.
Note that rendering is extremely inefficient, mostly because the libass
output is blended with the extremely strange mplayer OSD format. This
could be improved at a later point.
Remove most OSD rendering from vo_aa.c, because that was extremely
hacky, can't be made work with osd_libass, and didn't work anyway in
my tests.
Internally, some cleanup is done. Subtitle and OSD related variable
declarations were literally all over the place. Move them to sub.h and
sub.c, which were hoarding most of these declarations already. Make the
player core in mplayer.c free of concerns like bitmap font loading.
The old OSD rendering code has been moved to osd_ft.c. The font_load.c
and font_load_ft.c are only needed and compiled if the old OSD
rendering code is configured.
2012-03-22 06:26:37 +01:00
LIBASS_OSD = $_libass_osd
2012-07-28 22:00:31 +02:00
DUMMY_OSD = $_dummy_osd
2010-07-05 19:04:46 +02:00
LIBBLURAY = $_bluray
2009-04-02 21:01:23 +02:00
LIBBS2B = $_libbs2b
2012-03-31 01:13:38 +02:00
LCMS2 = $_lcms2
2012-02-27 17:18:49 +01:00
LIBPOSTPROC = $libpostproc
2008-08-03 17:57:18 +02:00
LIBSMBCLIENT = $_smb
2012-03-02 20:24:34 +01:00
LIBQUVI = $_libquvi
2008-06-02 14:24:28 +02:00
LIBTHEORA = $_theora
LIRC = $_lirc
2008-08-03 18:16:10 +02:00
MACOSX_FINDER = $_macosx_finder
2008-11-30 14:22:34 +01:00
MNG = $_mng
2010-06-30 11:55:14 +02:00
MPG123 = $_mpg123
2010-07-17 15:14:53 +02:00
NETWORKING = $networking
2008-12-03 13:05:47 +01:00
OPENAL = $_openal
2008-10-04 13:06:50 +02:00
OSS = $_ossaudio
2008-06-02 14:24:28 +02:00
PE_EXECUTABLE = $_pe_executable
PNG = $_png
2009-02-10 16:34:44 +01:00
PRIORITY = $_priority
2008-12-03 13:05:47 +01:00
PULSE = $_pulse
2012-04-27 11:26:04 +02:00
PORTAUDIO = $_portaudio
2008-06-02 14:24:28 +02:00
PVR = $_pvr
2006-08-28 19:05:18 +02:00
RADIO=$_radio
RADIO_CAPTURE=$_radio_capture
2011-06-24 15:56:43 +02:00
RSOUND = $_rsound
2008-06-02 14:24:28 +02:00
STREAM_CACHE = $_stream_cache
TV = $_tv
TV_BSDBT848 = $_tv_bsdbt848
TV_V4L2 = $_tv_v4l2
VCD = $_vcd
2009-02-16 21:58:13 +01:00
VDPAU = $_vdpau
2008-06-02 14:24:28 +02:00
VSTREAM = $_vstream
2008-12-03 15:48:31 +01:00
X11 = $_x11
XV = $_xv
2006-07-12 19:28:14 +02:00
2008-03-31 19:04:06 +02:00
# FFmpeg
2012-09-14 17:51:26 +02:00
ENCODING = $_encoding
2010-10-31 02:19:56 +02:00
FFMPEG_INTERNALS = $ffmpeg_internals
2009-07-26 04:55:40 +02:00
FFMPEG_SOURCE_PATH = $_ffmpeg_source
2008-03-31 19:04:06 +02:00
2010-04-04 18:48:46 +02:00
CONFIG_VDPAU = $_vdpau
CONFIG_ZLIB = $_zlib
2008-03-31 19:04:06 +02:00
2010-04-04 18:48:46 +02:00
HAVE_PTHREADS = $_pthreads
HAVE_SHM = $_shm
2008-03-31 19:04:06 +02:00
2001-07-03 09:50:52 +02:00
EOF
2001-02-24 21:28:24 +01:00
2001-11-17 04:53:05 +01:00
#############################################################################
2006-12-23 03:47:38 +01:00
ff_config_enable () {
2010-03-17 14:34:33 +01:00
list=$(echo $1 | tr '[a-z]' '[A-Z]')
item=$(echo $2 | tr '[a-z]' '[A-Z]')
2007-06-19 15:54:48 +02:00
_nprefix=$3;
test -z "$_nprefix" && _nprefix='CONFIG'
2010-03-17 14:34:33 +01:00
for part in $list; do
if $(echo $item | grep -q -E "(^| )$part($| )"); then
2007-06-19 15:54:48 +02:00
echo "#define ${_nprefix}_$part 1"
2006-12-23 03:47:38 +01:00
else
2009-01-15 16:56:24 +01:00
echo "#define ${_nprefix}_$part 0"
2006-12-23 03:47:38 +01:00
fi
done
}
2001-11-18 18:45:23 +01:00
echo "Creating config.h"
2007-08-27 13:40:25 +02:00
cat > $TMPH << 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
2003-11-02 14:45:24 +01:00
#ifndef MPLAYER_CONFIG_H
2008-02-21 17:35:00 +01:00
#define MPLAYER_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_DATADIR "$_datadir"
#define MPLAYER_CONFDIR "$_confdir"
2010-03-08 21:48:50 +01:00
#define MPLAYER_LOCALEDIR "$_localedir"
$def_translation
2007-02-15 19:24:12 +01:00
2002-11-11 19:25:02 +01:00
2008-10-16 22:44:05 +02:00
/* system headers */
2008-10-15 01:00:04 +02:00
$def_mman_h
2009-02-08 23:49:52 +01:00
$def_mman_has_map_failed
2008-10-15 01:00:04 +02:00
$def_soundcard_h
2008-10-16 22:44:05 +02:00
$def_sys_soundcard_h
2008-10-15 01:00:04 +02:00
$def_sys_sysinfo_h
2011-06-29 06:19:49 +02:00
$def_sys_videoio_h
2008-10-16 22:44:05 +02:00
$def_termios_h
$def_termios_sys_h
$def_winsock2_h
2002-07-06 17:20:10 +02:00
2004-11-22 11:28:36 +01:00
2008-10-16 22:44:05 +02:00
/* system functions */
2009-02-08 23:49:52 +01:00
$def_gethostbyname2
$def_gettimeofday
$def_glob
$def_nanosleep
$def_posix_select
$def_select
2010-03-04 15:46:44 +01:00
$def_setmode
2009-02-08 23:49:52 +01:00
$def_shm
$def_strsep
$def_sysi86
$def_sysi86_iv
$def_termcap
$def_termios
$def_vsscanf
2004-04-26 11:44:06 +02:00
2008-03-18 10:09:53 +01:00
2008-10-16 22:44:05 +02:00
/* system-specific features */
2009-02-08 23:49:52 +01:00
$def_asmalign_pot
$def_builtin_expect
$def_dl
2010-02-11 09:52:15 +01:00
$def_dos_paths
2009-02-08 23:49:52 +01:00
$def_iconv
$def_macosx_bundle
$def_macosx_finder
2009-02-10 16:34:44 +01:00
$def_priority
2006-09-18 18:48:50 +02:00
2002-03-27 04:45:55 +01:00
2008-10-16 22:44:05 +02:00
/* configurable options */
2009-02-08 23:49:52 +01:00
$def_debug
$def_sortsub
$def_stream_cache
$def_pthread_cache
2001-08-17 02:38:10 +02:00
2005-11-06 18:42:20 +01:00
2008-10-16 22:44:05 +02:00
/* CPU stuff */
#define __CPU__ $iproc
2010-07-10 18:26:58 +02:00
$def_ebx_available
2010-03-17 11:10:47 +01:00
$(ff_config_enable "$arch_all" "$arch" "ARCH")
2010-03-17 14:20:06 +01:00
$(ff_config_enable "$subarch_all" "$subarch" "ARCH")
2001-08-20 23:20:03 +02:00
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
#define HAVE_MMX ARCH_X86
#define HAVE_MMX2 ARCH_X86
#define HAVE_SSE ARCH_X86
#define HAVE_SSE2 ARCH_X86
#define HAVE_SSSE3 ARCH_X86
2002-04-24 23:17:22 +02:00
2010-07-05 19:04:46 +02:00
/* Blu-ray/DVD/VCD/CD */
2008-10-21 09:02:25 +02:00
#define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
#define DEFAULT_DVD_DEVICE "$default_dvd_device"
2010-07-05 19:04:46 +02:00
$def_bluray
2009-02-08 23:49:52 +01:00
$def_bsdi_dvd
2012-03-21 00:57:58 +01:00
$def_cdda
2009-02-08 23:49:52 +01:00
$def_cddb
$def_cdio
$def_cdrom
$def_dvd
$def_dvd_bsd
$def_dvd_darwin
$def_dvd_linux
$def_dvd_openbsd
$def_dvdio
$def_dvdread
$def_vcd
2002-04-23 18:29:13 +02:00
2006-09-17 11:32:28 +02:00
2008-10-16 22:44:05 +02:00
/* codec libraries */
2010-06-30 11:55:14 +02:00
$def_mpg123
2009-02-08 23:49:52 +01:00
$def_zlib
2012-02-27 17:18:49 +01:00
$def_libpostproc
2001-02-24 21:28:24 +01:00
2004-06-26 11:54:02 +02:00
2002-01-12 22:07:17 +01:00
/* Audio output drivers */
2009-02-08 23:49:52 +01:00
$def_alsa
$def_coreaudio
$def_jack
$def_nas
$def_openal
$def_openal_h
$def_ossaudio
$def_ossaudio_devdsp
$def_ossaudio_devmixer
$def_pulse
2012-04-27 11:26:04 +02:00
$def_portaudio
2011-06-24 15:56:43 +02:00
$def_rsound
2009-02-08 23:49:52 +01:00
$def_ladspa
2009-04-02 21:01:23 +02:00
$def_libbs2b
2003-08-07 14:24:35 +02:00
2007-10-13 19:14:39 +02:00
2008-10-16 22:44:05 +02:00
/* input */
2009-02-08 23:49:52 +01:00
$def_apple_ir
$def_apple_remote
$def_ioctl_bt848_h_name
$def_ioctl_meteor_h_name
$def_joystick
$def_lirc
$def_lircc
$def_pvr
$def_radio
$def_radio_bsdbt848
$def_radio_capture
$def_radio_v4l2
$def_tv
$def_tv_bsdbt848
$def_tv_v4l2
2006-08-28 19:05:18 +02:00
2002-05-12 03:07:25 +02:00
2008-10-16 22:44:05 +02:00
/* font stuff */
2009-02-08 23:49:52 +01:00
$def_ass
$def_enca
2003-05-11 20:29:07 +02:00
2008-10-16 22:44:05 +02:00
/* networking */
2009-02-08 23:49:52 +01:00
$def_closesocket
$def_ftp
$def_inet6
2009-02-01 15:38:28 +01:00
$def_inet_aton
$def_inet_pton
2010-07-17 15:14:53 +02:00
$def_networking
2009-02-08 23:49:52 +01:00
$def_smb
2012-03-02 20:24:34 +01:00
$def_libquvi
2009-02-08 23:49:52 +01:00
$def_socklen_t
$def_vstream
2008-08-29 18:20:35 +02:00
2012-03-31 01:13:38 +02:00
$def_lcms2
2002-06-11 16:29:51 +02:00
2008-10-16 22:44:05 +02:00
/* libvo options */
2009-02-08 23:49:52 +01:00
$def_caca
$def_corevideo
2012-04-03 08:13:12 +02:00
$def_cocoa
2009-02-08 23:49:52 +01:00
$def_direct3d
2012-08-25 19:49:01 +02:00
$def_dvb
$def_dvbin
2009-02-08 23:49:52 +01:00
$def_gif
$def_gif_4
$def_gif_tvt_hack
$def_gl
2011-10-15 18:44:00 +02:00
$def_gl_cocoa
2009-02-08 23:49:52 +01:00
$def_gl_win32
2009-12-19 11:52:32 +01:00
$def_gl_x11
2009-02-08 23:49:52 +01:00
$def_jpeg
$def_mng
$def_png
$def_v4l2
2009-02-16 21:58:13 +01:00
$def_vdpau
2009-02-08 23:49:52 +01:00
$def_vm
$def_x11
$def_xdpms
$def_xf86keysym
$def_xinerama
$def_xss
$def_xv
2002-01-11 18:20:43 +01:00
2002-11-16 04:06:55 +01:00
2008-10-04 14:39:16 +02:00
/* FFmpeg */
2012-09-14 17:51:26 +02:00
$def_encoding
2010-10-31 02:19:56 +02:00
$def_ffmpeg_internals
2002-11-15 00:49:05 +01:00
2008-12-02 17:40:44 +01:00
$def_fast_64bit
2009-02-08 23:49:52 +01:00
$def_mkstemp
$def_pthreads
$def_threads
2009-04-20 02:10:09 +02:00
$def_xform_asm
2002-12-05 01:05:57 +01:00
2010-01-16 16:20:26 +01:00
#define HAVE_INLINE_ASM 1
2003-03-26 12:35:13 +01:00
2012-04-19 16:05:50 +02:00
/* Use these registers in x86 inline asm. No proper detection yet. */
2008-10-04 14:39:16 +02:00
#define HAVE_EBP_AVAILABLE 1
2003-03-26 12:35:13 +01:00
2003-11-02 14:45:24 +01:00
#endif /* MPLAYER_CONFIG_H */
2001-02-24 21:28:24 +01:00
EOF
2007-08-27 13:40:25 +02:00
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
2007-11-22 17:46:48 +01:00
cmp -s "$TMPH" config.h || mv -f "$TMPH" config.h
2007-08-27 13:40:25 +02:00
2001-11-17 04:53:05 +01:00
#############################################################################
2001-02-24 21:28:24 +01:00
cat << EOF
2010-06-09 11:27:29 +02:00
Config files successfully generated by ./configure $configuration !
2001-10-13 18:53:37 +02:00
2001-11-17 04:53:05 +01:00
Install prefix: $_prefix
Data directory: $_datadir
2001-12-25 22:58:10 +01:00
Config direct.: $_confdir
2001-11-29 02:18:05 +01:00
2003-02-21 00:32:47 +01:00
Languages:
2010-03-28 13:49:09 +02:00
Messages (in addition to English): $language_msg
2009-06-14 16:55:01 +02:00
Manual pages: $language_man
Documentation: $language_doc
2003-02-21 00:32:47 +01:00
2001-11-29 02:18:05 +01:00
Enabled optional drivers:
2010-05-09 13:20:15 +02:00
Input: $inputmodules
2012-08-25 19:57:08 +02:00
Codecs: libavcodecs $codecmodules
2010-05-09 13:20:15 +02:00
Audio output: $aomodules
Video output: $vomodules
2008-07-17 14:24:47 +02:00
2002-03-12 08:16:29 +01:00
Disabled optional drivers:
2010-05-29 12:43:51 +02:00
Input: $noinputmodules
2010-05-09 13:20:15 +02:00
Codecs: $nocodecmodules
Audio output: $noaomodules
Video output: $novomodules
2001-11-17 04:53:05 +01:00
'config.h' and 'config.mak' contain your configuration options.
2002-08-04 00:48:41 +02:00
Note: If you alter theses files (for instance CFLAGS) MPlayer may no longer
compile *** DO NOT REPORT BUGS if you tweak these files ***
2001-11-17 04:53:05 +01:00
'make' will now compile MPlayer and 'make install' will install it.
2001-10-13 18:53:37 +02:00
Note: On non-Linux systems you might need to use 'gmake' instead of 'make'.
2001-02-24 21:28:24 +01:00
EOF
2001-08-22 10:51:19 +02:00
2001-11-17 04:53:05 +01:00
cat <<EOF
2006-10-30 22:28:44 +01:00
Check $TMPLOG if you wonder why an autodetection failed (make sure
development headers/packages are installed).
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
2010-08-19 01:20:23 +02:00
If you suspect a bug, please read DOCS/HTML/$language_doc/bugreports.html.
2001-11-17 04:53:05 +01:00
EOF
2010-07-02 00:19:57 +02:00
if test "$warn_cflags" = yes; then
2005-07-10 19:01:49 +02:00
cat <<EOF
2012-07-29 00:22:13 +02:00
MPlayer compilation will use the CPPFLAGS/CFLAGS/LDFLAGS set by you,
2008-11-16 14:04:16 +01:00
but:
2005-07-10 19:01:49 +02:00
*** *** DO NOT REPORT BUGS IF IT DOES NOT COMPILE/WORK! *** ***
It is strongly recommended to let MPlayer choose the correct CFLAGS!
To do so, execute 'CFLAGS= ./configure <options>'
EOF
fi
2001-06-05 04:36:12 +02:00
# Last move:
2010-07-01 11:00:54 +02:00
rm -rf "$mplayer_tmpdir"