1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-17 08:01:36 +00:00
freebsd-ports/multimedia/mplayer/files/patch-configure
Rene Ladan 6fc4d28358 Fix build with clang: in contrast to lang/clang, the one from base adds
"FreeBSD" in front of it which broke the detection of the compiler name.
If the operating system name is added, use the second word as the compiler
name.

PR:		ports/159250
Submitted by:	Test Rat (ttsestt gmail.com)
Approved by:	maintainer (in private mail)
2011-08-09 06:39:25 +00:00

124 lines
3.7 KiB
Plaintext

--- configure.orig 2011-03-13 01:32:55.000000000 +0100
+++ configure 2011-03-18 17:05:13.932557908 +0100
@@ -614,7 +614,7 @@
_iwmmxt=auto
_mtrr=auto
_altivec=auto
-_install=install
+_install=@${BSD_INSTALL_PROGRAM}
_ranlib=ranlib
_windres=windres
_cc=cc
@@ -1416,7 +1416,6 @@
*)
echo "Unknown parameter: $ac_option"
- exit 1
;;
esac
@@ -1525,8 +1524,8 @@
_timer=timer-linux.c
_getch=getch2.c
if freebsd ; then
- extra_ldflags="$extra_ldflags -L/usr/local/lib"
- extra_cflags="$extra_cflags -I/usr/local/include"
+ extra_ldflags="$extra_ldflags -L$_prefix/lib"
+ extra_cflags="$extra_cflags -I$_prefix/include"
fi
if netbsd || dragonfly ; then
@@ -1661,7 +1660,7 @@ else
echores "$cc_version"
break
fi
- cc_name_tmp=$($_cc -v 2>&1 | head -n 1 | cut -d ' ' -f 1)
+ cc_name_tmp=$($_cc -v 2>&1 | awk "NR == 1 { if(\$1 == \"$system_name\") print \$2; else print \$1 }")
if test "$cc_name_tmp" = "clang"; then
echocheck "$_cc version"
cc_vendor=clang
@@ -3577,22 +3576,10 @@
if linux ; then
THREAD_CFLAGS=-D_REENTRANT
elif freebsd || netbsd || openbsd || bsdos ; then
- THREAD_CFLAGS=-D_THREAD_SAFE
-fi
-if test "$_pthreads" = auto ; then
-cat > $TMPC << EOF
-#include <pthread.h>
-static void *func(void *arg) { return arg; }
-int main(void) { pthread_t tid; return pthread_create(&tid, 0, func, 0) == 0 ? 0 : 1; }
-EOF
-_pthreads=no
-if ! hpux ; then
- for _ld_tmp in "-lpthreadGC2" "" "-lpthread" "-pthread" ; do
- # for crosscompilation, we cannot execute the program, be happy if we can link statically
- cc_check $THREAD_CFLAGS $_ld_tmp && (tmp_run || test "$_ld_static") && _ld_pthread="$_ld_tmp" && _pthreads=yes && break
- done
-fi
+ THREAD_CFLAGS=${PTHREAD_CFLAGS}
fi
+_pthreads=yes
+_ld_pthread="${PTHREAD_LIBS}"
if test "$_pthreads" = yes ; then
test $_ld_pthread && res_comment="using $_ld_pthread"
def_pthreads='#define HAVE_PTHREADS 1'
@@ -6354,7 +6341,7 @@
echocheck "libgsm"
if test "$_libgsm" = auto ; then
_libgsm=no
- statement_check gsm/gsm.h 'gsm_create()' -lgsm && _libgsm=yes
+ statement_check gsm.h 'gsm_create()' -lgsm && _libgsm=yes
fi
if test "$_libgsm" = yes ; then
def_libgsm='#define CONFIG_LIBGSM 1'
@@ -6852,6 +6839,16 @@
nolibrtmp=no
def_librtmp='#define CONFIG_LIBRTMP 1'
inputmodules="librtmp $inputmodules"
+
+ if $_pkg_config --exists librtmp; then
+ _inc_tmp=$($_pkg_config --cflags librtmp)
+ _ld_tmp=$($_pkg_config --libs librtmp)
+ else
+ _inc_tmp="-I${LOCALBASE}/include"
+ _ld_tmp="-L${LOCALBASE}/lib -lrtmp -lz -lssl -lcrypto"
+ fi
+ extra_ldflags="$extra_ldflags $_ld_tmp"
+ extra_cflags="$extra_cflags $_inc_tmp"
else
nolibrtmp=yes
_librtmp=no
@@ -7214,7 +7211,7 @@
def_muxers='#define CONFIG_MUXERS 1'
else
# mpeg1video for vf_lavc, snow for vf_uspp / vf_mcdeint,
- libavencoders="$mplayer_encoders MPEG1VIDEO_ENCODER SNOW_ENCODER"
+ libavencoders="$mplayer_encoders MPEG1VIDEO_ENCODER H263_ENCODER SNOW_ENCODER"
libavmuxers=""
def_muxers='#define CONFIG_MUXERS 0'
fi
@@ -7559,8 +7556,11 @@
if test "$_gui" = yes ; then
# Required libraries
- if test "$ffmpeg" != yes ||
- ! echo $libavdecoders | grep -q PNG_DECODER ; then
+ # Work around a sh bug in FreeBSD < 8
+ if test "$ffmpeg" != yes ; then
+ die "The GUI requires libavcodec with PNG support (needs zlib)."
+ fi
+ if ! echo $libavdecoders | grep -q PNG_DECODER ; then
die "The GUI requires libavcodec with PNG support (needs zlib)."
fi
test "$_freetype" = no && test "$_bitmap_font" = no &&
@@ -7947,7 +7947,7 @@
EXESUF = $_exesuf
EXESUFS_ALL = .exe
-ARCH = $arch
+MPLAYER_ARCH = $arch
$(mak_enable "$arch_all" "$arch" ARCH)
$(mak_enable "$subarch_all" "$subarch" ARCH)
$(mak_enable "$cpuexts_all" "$cpuexts" HAVE)