summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile.am87
-rwxr-xr-xcontrib/ffmpeg-universal.sh77
-rw-r--r--contrib/libdca/Makefile.am13
-rw-r--r--contrib/libmpcdec/Makefile.am11
-rw-r--r--contrib/libxdg-basedir/Makefile.am3
5 files changed, 126 insertions, 65 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 8433d4ce8..6e019ba62 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -2,17 +2,15 @@ SUBDIRS = libmpcdec libxdg-basedir libdca
srcdir = $(shell cd @srcdir@; pwd)
-CC = @CC@
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
-VISIBILITY_FLAG = @VISIBILITY_FLAG@
+ffmpeg_builder = $(srcdir)/ffmpeg-universal.sh
-if HAVE_DXR3
+if ENABLE_DXR3
dxr3encoder = --enable-encoder=mpeg1video
endif
if FFMPEG_DISABLE_UNCOMMON_CODECS
-disable_uncommon_codecs=--disable-decoder=aasc --disable-decoder=asv1 --disable-decoder=asv2 --disable-decoder=avs \
+disable_uncommon_codecs = \
+ --disable-decoder=aasc --disable-decoder=asv1 --disable-decoder=asv2 --disable-decoder=avs \
--disable-decoder=cscd --disable-decoder=cyuv --disable-decoder=dvvideo --disable-decoder=eightbps \
--disable-decoder=flic --disable-decoder=flv --disable-decoder=fourxm --disable-decoder=fraps \
--disable-decoder=huffyuv --disable-decoder=idcin --disable-decoder=interplay_video --disable-decoder=kmvc \
@@ -37,7 +35,8 @@ disable_uncommon_codecs=--disable-decoder=aasc --disable-decoder=asv1 --disable-
endif
if FFMPEG_DISABLE_POPULAR_CODECS
-disable_popular_codecs=--disable-decoder=cinepak --disable-decoder=flashsv --disable-decoder=h261 --disable-decoder=h263 \
+disable_popular_codecs = \
+ --disable-decoder=cinepak --disable-decoder=flashsv --disable-decoder=h261 --disable-decoder=h263 \
--disable-decoder=h263i --disable-decoder=h264 --disable-decoder=indeo2 --disable-decoder=indeo3 \
--disable-decoder=mjpeg --disable-decoder=mjpegb --disable-decoder=mpeg1video --disable-decoder=mpeg2video \
--disable-decoder=mpeg4 --disable-decoder=mpegvideo --disable-decoder=msmpeg4v1 --disable-decoder=msmpeg4v2 \
@@ -53,7 +52,26 @@ configure_options =\
--disable-shared --enable-static --disable-demuxers --disable-muxers --disable-strip \
--enable-gpl --enable-pthreads --disable-ffmpeg --disable-ffserver --disable-ffplay
-disable_decoders =\
+if DEBUG_BUILD
+configure_options += --enable-debug
+else
+configure_options += --disable-debug
+endif
+if PROFILING_BUILD
+configure_options += --enable-gprof
+endif
+if DISABLE_OPTIMIZATIONS
+configure_options += --disable-opts
+endif
+if HAVE_MLIB
+configure_options += --enable-sunmlib
+endif
+
+if !HOST_OS_DARWIN
+FFMPEG_EXTRA_CFLAGS = -fPIC -DPIC
+endif
+
+disable_decoders = \
--disable-decoder=bmp --disable-decoder=cavs --disable-decoder=cljr --disable-decoder=dsicinvideo \
--disable-decoder=ffv1 --disable-decoder=ffvhuff --disable-decoder=gif --disable-decoder=mdec \
--disable-decoder=mpeg_xvmc --disable-decoder=mszh --disable-decoder=png --disable-decoder=rawvideo \
@@ -64,31 +82,32 @@ disable_decoders =\
--disable-decoder=dvdsub --disable-decoder=theora --disable-decoder=aac --disable-decoder=mpeg4aac \
--disable-decoder=ac3 --disable-decoder=vorbis
-all_configure_options = $(configure_options) \
- --disable-encoders $(dxr3encoder) \
- --enable-encoders $(disable_uncommon_codecs) $(disable_popular_codecs) \
- $(disable_decoders) \
- --make="$(MAKE)" \
- --cc="$(CC)"
+all_configure_options = \
+ $(configure_options) --make="$(MAKE)" --cc="$(CC)" \
+ --disable-encoders $(dxr3encoder) $(disable_decoders) \
+ $(disable_uncommon_codecs) $(disable_popular_codecs)
-ffmpeg/config.mak: $(srcdir)/ffmpeg/configure Makefile
+ffmpeg/config.mak: ffmpeg/configure Makefile $(ffmpeg_builder)
if MACOSX_UNIVERSAL_BINARY
- export CFLAGS="$(VISIBILITY_FLAG)"; \
- export FFMPEG_CONFIGURE_OPTIONS="$(all_configure_options)"; \
- $(srcdir)/ffmpeg-universal.sh -configure "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
+ export CFLAGS="$(VISIBILITY_FLAG)"; \
+ export FFMPEG_CONFIGURE_OPTIONS="$(all_configure_options)"; \
+ $(ffmpeg_builder) -configure "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
else
mkdir -p ffmpeg
cd ffmpeg; \
$(srcdir)/ffmpeg/configure $(all_configure_options) \
- --extra-cflags="$(CFLAGS) $(VISIBILITY_FLAG) -fPIC -DPIC" \
- --extra-ldflags="$(LDFLAGS)"; \
+ --extra-cflags="$(VISIBILITY_FLAG) $(FFMPEG_EXTRA_CFLAGS)"; \
cd ..
+if HOST_OS_DARWIN
+ cat ffmpeg/config.mak | sed -e '/OPTFLAGS=/s/-mdynamic-no-pic//g' > ffmpeg/config.tmp
+ mv -f ffmpeg/config.tmp ffmpeg/config.mak
+endif
endif
ffmpeg/libavutil/libavutil.a: ffmpeg/config.mak
if MACOSX_UNIVERSAL_BINARY
export MAKE="$(MAKE)"; \
- $(srcdir)/ffmpeg-universal.sh -avutil "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
+ $(ffmpeg_builder) -avutil "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
else
$(MAKE) -C ffmpeg/libavutil libavutil.a
endif
@@ -96,7 +115,7 @@ endif
ffmpeg/libavcodec/libavcodec.a: ffmpeg/config.mak
if MACOSX_UNIVERSAL_BINARY
export MAKE="$(MAKE)"; \
- $(srcdir)/ffmpeg-universal.sh -avcodec "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
+ $(ffmpeg_builder) -avcodec "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
else
$(MAKE) -C ffmpeg/libavcodec libavcodec.a
endif
@@ -104,28 +123,23 @@ endif
ffmpeg/libpostproc/libpostproc.a: ffmpeg/config.mak
if MACOSX_UNIVERSAL_BINARY
export MAKE="$(MAKE)"; \
- $(srcdir)/ffmpeg-universal.sh -postproc "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
+ $(ffmpeg_builder) -postproc "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
else
$(MAKE) -C ffmpeg/libpostproc libpostproc.a
endif
clean-local:
if MACOSX_UNIVERSAL_BINARY
- for arch in $(UNIVERSAL_ARCHES); do \
- $(MAKE) -C ffmpeg/$$arch clean; \
- done
- rm -f ffmpeg/libavcodec/libavcodec.a ffmpeg/libavutil/libavutil.a ffmpeg/libpostproc/libpostproc.a
+ export MAKE="$(MAKE)"; \
+ $(ffmpeg_builder) -clean "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
else
-$(MAKE) -C ffmpeg clean
endif
distclean-local:
if MACOSX_UNIVERSAL_BINARY
- for arch in $(UNIVERSAL_ARCHES); do \
- $(MAKE) -C ffmpeg/$$arch distclean; \
- done
- rm -f ffmpeg/config.mak ffmpeg/config.h
- rm -f ffmpeg/libavcodec/libavcodec.a ffmpeg/libavutil/libavutil.a ffmpeg/libpostproc/libpostproc.a
+ export MAKE="$(MAKE)"; \
+ $(ffmpeg_builder) -distclean "$(srcdir)/ffmpeg" $(UNIVERSAL_ARCHES)
else
-$(MAKE) -C ffmpeg distclean
endif
@@ -133,10 +147,7 @@ endif
EXTRA_DIST = README.contrib ffmpeg-distfiles
dist-hook:
- while read entry; do \
- test -d $(srcdir)/$$entry && \
- mkdir -p $(distdir)/$$entry; \
- test -f $(srcdir)/$$entry && \
- cp -p $(srcdir)/$$entry $(distdir)/$$entry; \
+ while read entry; do \
+ test -d $(srcdir)/$$entry && mkdir -p $(distdir)/$$entry; \
+ test -f $(srcdir)/$$entry && cp -p $(srcdir)/$$entry $(distdir)/$$entry; \
done < $(srcdir)/ffmpeg-distfiles
-
diff --git a/contrib/ffmpeg-universal.sh b/contrib/ffmpeg-universal.sh
index 811aaa868..6e27c56b8 100755
--- a/contrib/ffmpeg-universal.sh
+++ b/contrib/ffmpeg-universal.sh
@@ -7,6 +7,8 @@ function usage {
echo " -avcodec build libavcodec.a for each architecture"
echo " -avutil build libavutil.a for each architecture"
echo " -postproc build libpostproc.a for each architecture"
+ echo " -clean clean for each architecture"
+ echo " -distclean distclean for each architecture"
echo ""
echo "Configuration must be done before any library builds. Options to be passed"
echo "to ffmpeg's configure command-line should be passed in the environment"
@@ -50,10 +52,18 @@ function run_configure {
--extra-ldflags="$EXTRA_LDFLAGS"
local retval=$?
- popd > /dev/null 2>&1
- if test $retval -ne 0; then
- exit $retval
+ # We're building ffmpeg to put it into a shared library, but ffmpeg thinks
+ # it's building to put it into a static library or program image, so it
+ # adds -mdynamic-no-pic to its list of options as an optimization. This is
+ # fine in Tiger if later linked with -Wl,-read_only_relocs,warning, but it
+ # isn't fine on other versions of Mac OS X.
+ if test -f config.mak; then
+ cat config.mak | sed -e '/OPTFLAGS=/s/-mdynamic-no-pic//g' > config.tmp
+ mv -f config.tmp config.mak
fi
+
+ popd > /dev/null 2>&1
+ `exit $retval` || exit $retval
}
if test x"$*" = x""; then
@@ -72,6 +82,12 @@ case "$1" in
-postproc)
MODE=postproc
;;
+ -clean)
+ MODE=clean
+ ;;
+ -distclean)
+ MODE=distclean
+ ;;
*)
echo "Unrecognized mode: $1"
usage
@@ -90,6 +106,19 @@ fi
SOURCE_PATH="$1"
shift
+TOP_BUILD_PATH="`pwd`/ffmpeg"
+if test -f "$TOP_BUILD_PATH/configure"; then
+ # Building in place. Create a temporary build directory and use that
+ # instead, but place the final output from lipo into the original
+ # build directory.
+ BUILD_PATH="$TOP_BUILD_PATH/build"
+else
+ BUILD_PATH="$TOP_BUILD_PATH"
+fi
+# This doesn't make sense for -configure, but it does for everything else.
+# The -configure mode won't ever use it anyway.
+OUTPUT_FILENAME="$BUILD_PATH/lib$MODE/lib$MODE.a"
+
HOST_ARCH=`arch`
UNIVERSAL_ARCHES=$*
if test x"$UNIVERSAL_ARCHES" = x""; then
@@ -97,9 +126,9 @@ if test x"$UNIVERSAL_ARCHES" = x""; then
UNIVERSAL_ARCHES=$HOST_ARCH
fi
CONFIG_FILES=
-LIPO_CMDLINE="-create -output ffmpeg/lib$MODE/lib$MODE.a"
+LIPO_CMDLINE="-create -output $OUTPUT_FILENAME"
for arch in $UNIVERSAL_ARCHES; do
- ffmpeg_topbuilddir="ffmpeg/$arch"
+ ffmpeg_topbuilddir="$BUILD_PATH/$arch"
LIPO_CMDLINE="$LIPO_CMDLINE -arch $arch $ffmpeg_topbuilddir/lib$MODE/lib$MODE.a"
case $MODE in
configure)
@@ -115,16 +144,34 @@ for arch in $UNIVERSAL_ARCHES; do
postproc)
"$MAKE" -C "$ffmpeg_topbuilddir/libpostproc" libpostproc.a || exit $?
;;
+ clean)
+ "$MAKE" -C "$ffmpeg_topbuilddir" clean || exit $?
+ ;;
+ distclean)
+ "$MAKE" -C "$ffmpeg_topbuilddir" distclean || exit $?
+ ;;
esac
done
-if test "$MODE" != "configure"; then
- mkdir -p ffmpeg/lib$MODE
- lipo $LIPO_CMDLINE
-else
- # Now that configuration is done, create config.h in the top-level ffmpeg
- # directory. Pull out only what's needed by xine-lib, removing any possible
- # platform conflicts
- grep -h "define CONFIG_.*_DECODER" $CONFIG_FILES | uniq > ffmpeg/config.h
- touch ffmpeg/config.mak
-fi
+case $MODE in
+ configure)
+ # Now that configuration is done, create config.h in the top-level
+ # ffmpeg directory. Pull out only what's needed by xine-lib, removing
+ # any possible platform conflicts
+ grep -h "define CONFIG_.*_DECODER" $CONFIG_FILES | uniq > "$BUILD_PATH/config.h"
+ touch "$BUILD_PATH/config.mak"
+ ;;
+ clean)
+ rm -f "$BUILD_PATH/libavcodec/libavcodec.a" "$BUILD_PATH/libavutil/libavutil.a" \
+ "$BUILD_PATH/libpostproc/libpostproc.a"
+ ;;
+ distclean)
+ rm -f "$BUILD_PATH/config.mak" "$BUILD_PATH/config.h"
+ rm -f "$BUILD_PATH/libavcodec/libavcodec.a" "$BUILD_PATH/libavutil/libavutil.a" \
+ "$BUILD_PATH/libpostproc/libpostproc.a"
+ ;;
+ *)
+ mkdir -p "`dirname "$OUTPUT_FILENAME"`"
+ lipo $LIPO_CMDLINE
+ ;;
+esac
diff --git a/contrib/libdca/Makefile.am b/contrib/libdca/Makefile.am
index 14206a363..faab0dd14 100644
--- a/contrib/libdca/Makefile.am
+++ b/contrib/libdca/Makefile.am
@@ -1,5 +1,9 @@
-if DTS
-if !EXTERNAL_LIBDTS
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+EXTRA_DIST = COPYING
+
+if ENABLE_DTS
+if !WITH_EXTERNAL_LIBDTS
noinst_LTLIBRARIES = libdca.la
endif
endif
@@ -8,8 +12,5 @@ libdca_la_SOURCES = dca_internal.h tables.h tables_quantization.h \
tables_huffman.h tables_fir.h tables_adpcm.h tables_vq.h \
bitstream.h bitstream.c parse.c downmix.c \
include/dca.h include/dts.h
-
-libdca_la_CFLAGS = -I$(srcdir)/include $(VISIBILITY_FLAG)
libdca_la_LIBADD = -lm
-
-EXTRA_DIST = COPYING
+libdca_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/include
diff --git a/contrib/libmpcdec/Makefile.am b/contrib/libmpcdec/Makefile.am
index 16ea80c28..24e2c0157 100644
--- a/contrib/libmpcdec/Makefile.am
+++ b/contrib/libmpcdec/Makefile.am
@@ -1,5 +1,9 @@
-if MUSEPACK
-if !EXTERNAL_MPCDEC
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+EXTRA_DIST = diff_from_libmpcdec_1.2.5.patch COPYING
+
+if ENABLE_MUSEPACK
+if !WITH_EXTERNAL_LIBMPCDEC
noinst_LTLIBRARIES = libmpcdec.la
endif
endif
@@ -9,6 +13,3 @@ libmpcdec_la_SOURCES = huffsv46.c huffsv7.c idtag.c mpc_decoder.c mpc_reader.c \
mpcdec/internal.h mpcdec/mpcdec.h mpcdec/streaminfo.h mpcdec/math.h \
mpcdec/decoder.h mpcdec/config_types.h mpcdec/requant.h mpcdec/huffman.h \
mpcdec/reader.h
-libmpcdec_la_CFLAGS = $(VISIBILITY_FLAG)
-
-EXTRA_DIST = diff_from_libmpcdec_1.2.5.patch COPYING
diff --git a/contrib/libxdg-basedir/Makefile.am b/contrib/libxdg-basedir/Makefile.am
index 68f09b0a9..420d85999 100644
--- a/contrib/libxdg-basedir/Makefile.am
+++ b/contrib/libxdg-basedir/Makefile.am
@@ -2,5 +2,6 @@ if !EXTERNAL_LIBXDG_BASEDIR
noinst_LTLIBRARIES = libxdg-basedir.la
endif
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
libxdg_basedir_la_SOURCES = basedir.c basedir.h
-libxdg_basedir_la_CFLAGS = $(VISIBILITY_FLAG)