openbsd-ports/x11/mplayer/patches/patch-configure
ajacoutot e197aaebf5 Remove -pthread patching.
from Brad
2012-08-27 06:19:48 +00:00

292 lines
9.2 KiB
Plaintext

$OpenBSD: patch-configure,v 1.64 2012/08/27 06:19:48 ajacoutot Exp $
--- configure.orig Tue Mar 8 19:33:03 2011
+++ configure Thu Aug 16 17:53:14 2012
@@ -35,29 +35,33 @@
#
#############################################################################
-if test -e ffmpeg/.svn ; then
- echo "You have an outdated FFmpeg SVN checkout in ffmpeg/, please (re)move or replace it"
- exit 1
-fi
-if test -e ffmpeg/mp_auto_pull ; then
- if ! (cd ffmpeg && git pull --rebase --ff-only) ; then
- echo "git pull failed, (re)move ffmpeg/mp_auto_pull to disable pulling"
- exit 1
- fi
-fi
+# OpenBSD
+# Don't do anything funky with git or svn, we will provide mplayer with ffmpeg
+#
+#if test -e ffmpeg/.svn ; then
+# echo "You have an outdated FFmpeg SVN checkout in ffmpeg/, please (re)move or replace it"
+# exit 1
+#fi
+#
+#if test -e ffmpeg/mp_auto_pull ; then
+# if ! (cd ffmpeg && git pull --rebase --ff-only) ; then
+# echo "git pull failed, (re)move ffmpeg/mp_auto_pull to disable pulling"
+# exit 1
+# fi
+#fi
+#
+#if ! test -e ffmpeg ; then
+# echo "No FFmpeg checkout, press enter to download one with git or CTRL+C to abort"
+# read tmp
+# if ! git clone --depth 1 git://git.videolan.org/ffmpeg.git ffmpeg ; then
+# rm -rf ffmpeg
+# echo "Failed to get a FFmpeg checkout"
+# exit 1
+# fi
+# touch ffmpeg/mp_auto_pull
+#fi
-if ! test -e ffmpeg ; then
- echo "No FFmpeg checkout, press enter to download one with git or CTRL+C to abort"
- read tmp
- if ! git clone --depth 1 git://git.videolan.org/ffmpeg.git ffmpeg ; then
- rm -rf ffmpeg
- echo "Failed to get a FFmpeg checkout"
- exit 1
- fi
- touch ffmpeg/mp_auto_pull
-fi
-
# Prevent locale nonsense from breaking basic text processing utils
export LC_ALL=C
@@ -510,6 +514,7 @@ Audio output:
--disable-nas disable NAS audio output [autodetect]
--disable-sgiaudio disable SGI audio output [autodetect]
--disable-sunaudio disable Sun audio output [autodetect]
+ --disable-sndio disable OpenBSD sndio audio output [autodetect]
--disable-kai disable KAI audio output [autodetect]
--disable-dart disable DART audio output [autodetect]
--disable-win32waveout disable Windows waveout audio output [autodetect]
@@ -745,6 +750,7 @@ _xf86keysym=auto
_mlib=no #broken, thus disabled
_sgiaudio=auto
_sunaudio=auto
+_sndio=auto
_alsa=auto
_fastmemcpy=yes
hardcoded_tables=no
@@ -1169,6 +1175,8 @@ for ac_option do
--disable-mlib) _mlib=no ;;
--enable-sunaudio) _sunaudio=yes ;;
--disable-sunaudio) _sunaudio=no ;;
+ --enable-sndio) _sndio=yes ;;
+ --disable-sndio) _sndio=no ;;
--enable-sgiaudio) _sgiaudio=yes ;;
--disable-sgiaudio) _sgiaudio=no ;;
--enable-alsa) _alsa=yes ;;
@@ -1486,10 +1494,10 @@ if test -z "$_target" ; then
sparc64) host_arch=sparc64 ;;
parisc*|hppa*|9000*) host_arch=hppa ;;
arm*|zaurus|cats) host_arch=arm ;;
- sh3|sh4|sh4a) host_arch=sh ;;
+ sh3|sh4|sh4a|landisk) host_arch=sh ;;
s390) host_arch=s390 ;;
s390x) host_arch=s390x ;;
- *mips*) host_arch=mips ;;
+ sgi|mips*|loongson) host_arch=mips ;;
vax) host_arch=vax ;;
xtensa*) host_arch=xtensa ;;
*) host_arch=UNKNOWN ;;
@@ -2200,7 +2208,7 @@ case "$host_arch" in
arch='sparc'
iproc='sparc'
if test "$host_arch" = "sparc64" ; then
- _vis='yes'
+ # _vis='yes'
proc='ultrasparc'
def_fast_64bit='#define HAVE_FAST_64BIT 1'
elif sunos ; then
@@ -2519,7 +2527,7 @@ cat > $TMPC << EOF
int ff_extern;
EOF
cc_check -c || die "Symbol mangling check failed."
-sym=$($_nm -P -g $TMPEXE)
+sym=$($_nm -g $TMPEXE | grep ff_extern | cut -d ' ' -f 3)
extern_prefix=${sym%%ff_extern*}
def_extern_asm="#define EXTERN_ASM $extern_prefix"
def_extern_prefix="#define EXTERN_PREFIX \"$extern_prefix\""
@@ -2578,7 +2586,7 @@ elif test -z "$CFLAGS" ; then
elif test "$cc_vendor" != "gnu" ; then
CFLAGS="-O2 $_march $_mcpu $_pipe"
else
- CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+ CFLAGS="$_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
extra_ldflags="$extra_ldflags -ffast-math"
fi
@@ -2860,8 +2868,11 @@ echores "$ibm_asm"
def_gnu_as='#define HAVE_GNU_AS 0'
gnu_as=no
echocheck "GNU assembler"
-inline_asm_check '".macro m n\n\\n:.int 0\n.endm\nm x"' &&
- gnu_as=yes && def_gnu_as='#define HAVE_GNU_AS 1'
+# OpenBSD - some altivec stuff causes build failures, fix from kili
+if ! ppc; then
+ inline_asm_check '".macro m n\n\\n:.int 0\n.endm\nm x"' &&
+ gnu_as=yes && def_gnu_as='#define HAVE_GNU_AS 1'
+fi
echores "$gnu_as"
fi
@@ -3118,7 +3129,7 @@ if test "$_posix4" = yes ; then
fi
echores "$_posix4"
-for func in exp2 exp2f llrint llrintf log2 log2f lrint lrintf round roundf truncf; do
+for func in exp2 exp2f llrint llrintf log2 log2f lrint lrintf round roundf trunc truncf; do
echocheck $func
eval _$func=no
statement_check math.h "${func}(2.0)" -D_ISOC99_SOURCE $_ld_lm && eval _$func=yes
@@ -3480,7 +3491,8 @@ if test "$_memalign" = yes ; then
else
def_memalign='#define HAVE_MEMALIGN 0'
def_map_memalign='#define memalign(a, b) malloc(b)'
- darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
+ # OpenBSD - prevent CONFIG_MEMALIGN_HACK which causes exit crash
+ #darwin || def_memalign_hack='#define CONFIG_MEMALIGN_HACK 1'
fi
echores "$_memalign"
@@ -4661,6 +4673,8 @@ if test "$_aa" = yes ; then
def_aa='#define CONFIG_AA 1'
if cygwin ; then
libs_mplayer="$libs_mplayer $(aalib-config --libs | cut -d " " -f 2,5,6)"
+ else
+ libs_mplayer="$libs_mplayer $(aalib-config --libs)"
fi
vomodules="aa $vomodules"
else
@@ -4846,7 +4860,7 @@ fi
echores "$_png"
if test "$_png" = yes ; then
def_png='#define CONFIG_PNG 1'
- extra_ldflags="$extra_ldflags -lpng -lz"
+ extra_ldflags="$extra_ldflags -lpng -lz -lm"
else
def_png='#undef CONFIG_PNG'
fi
@@ -4854,12 +4868,12 @@ fi
echocheck "MNG support"
if test "$_mng" = auto ; then
_mng=no
- return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz $_ld_lm && _mng=yes
+ return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -llcms -ljpeg -lmng -lz $_ld_lm && _mng=yes
fi
echores "$_mng"
if test "$_mng" = yes ; then
def_mng='#define CONFIG_MNG 1'
- extra_ldflags="$extra_ldflags -lmng -lz"
+ extra_ldflags="$extra_ldflags -lmng -llcms -lz -ljpeg $_ld_m"
else
def_mng='#undef CONFIG_MNG'
fi
@@ -5663,6 +5677,26 @@ fi
echores "$_sunaudio"
+echocheck "sndio audio"
+if test "$_sndio" = auto ; then
+ cat > $TMPC << EOF
+#include <sndio.h>
+int main(void) { struct sio_par par; sio_initpar(&par); return 0; }
+EOF
+ _sndio=no
+ cc_check -lsndio && _sndio=yes
+fi
+if test "$_sndio" = yes ; then
+ def_sndio='#define CONFIG_SNDIO_AUDIO 1'
+ _aomodules="sndio $_aomodules"
+ extra_ldflags="$extra_ldflags -lsndio"
+else
+ def_sndio='#undef CONFIG_SNDIO_AUDIO'
+ _noaomodules="sndio $_noaomodules"
+fi
+echores "$_sndio"
+
+
def_mlib='#define CONFIG_MLIB 0'
if sunos; then
echocheck "Sun mediaLib"
@@ -5780,7 +5814,15 @@ else
default_dvd_device="/dev/dvd"
fi
+if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
+ default_bluray_device=$default_cdrom_device
+elif darwin ; then
+ default_bluray_device="/dev/rdiskN"
+else
+ default_bluray_device="/dev/dvd"
+fi
+
echocheck "VCD support"
if test "$_vcd" = auto; then
_vcd=no
@@ -5805,7 +5847,7 @@ echores "$_vcd"
echocheck "Blu-ray support"
if test "$_bluray" = auto ; then
_bluray=no
- statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
+ statement_check libbluray/bluray.h 'bd_get_title_info(0, 0, 0)' -lbluray && _bluray=yes
fi
if test "$_bluray" = yes ; then
def_bluray='#define CONFIG_LIBBLURAY 1'
@@ -6521,7 +6563,7 @@ echores "$_libmpeg2"
echocheck "libdca support"
if test "$_libdca" = auto ; then
_libdca=no
- for _ld_dca in -ldca -ldts ; do
+ for _ld_dca in -ldca; do
statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
done
@@ -7360,6 +7402,8 @@ if test "$_tv_v4l2" = auto ; then
_tv_v4l2=no
if test "$_tv" = yes && linux ; then
header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
+ elif test "$_tv" = yes && openbsd ; then
+ header_check sys/videoio.h && _tv_v4l2=yes
fi
fi
if test "$_tv_v4l2" = yes ; then
@@ -8069,6 +8113,7 @@ SPEEX = $_speex
STREAM_CACHE = $_stream_cache
SGIAUDIO = $_sgiaudio
SUNAUDIO = $_sunaudio
+SNDIO = $_sndio
SVGA = $_svga
TDFXFB = $_tdfxfb
TDFXVID = $_tdfxvid
@@ -8357,6 +8402,7 @@ $(ff_config_enable "$cpuexts_all" "$cpuexts" "#" "HAVE
/* Blu-ray/DVD/VCD/CD */
#define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
#define DEFAULT_DVD_DEVICE "$default_dvd_device"
+#define DEFAULT_BLURAY_DEVICE "$default_bluray_device"
$def_bluray
$def_bsdi_dvd
$def_cddb
@@ -8445,6 +8491,7 @@ $def_ossaudio_devmixer
$def_pulse
$def_sgiaudio
$def_sunaudio
+$def_sndio
$def_win32waveout
$def_ladspa
@@ -8622,6 +8669,7 @@ $def_round
$def_roundf
$def_ten_operands
$def_threads
+$def_trunc
$def_truncf
$def_xform_asm
$def_xmm_clobbers