From 5753fa512f4cb7d18438e5685cd2ded4f7b043fc Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 26 Jun 2014 22:22:53 +0200 Subject: Allow building libmpv The tricky part is enabling PIC for all libraries if required. We don't always enable PIC, because I'm unsure about its performance or binary size impact. So play it safe. --- README.rst | 12 ++++++++++++ scripts/ffmpeg-config | 8 +++++++- scripts/fribidi-config | 6 +++++- scripts/libass-config | 6 +++++- scripts/test-libmpv | 15 +++++++++++++++ 5 files changed, 44 insertions(+), 3 deletions(-) create mode 100755 scripts/test-libmpv diff --git a/README.rst b/README.rst index 69520e1..b090498 100644 --- a/README.rst +++ b/README.rst @@ -180,6 +180,18 @@ switch per line (e.g. ``--enable-something``). But normally, you shouldn't need this. +Building libmpv +--------------- + +You can enable building libmpv by enabling the configure option: + + echo --enable-libmpv-shared > mpv_options + +Note that this will make the mpv-build scripts also enable PIC for all used +libraries. For this reason, be sure to run ``./clean`` before rebuilding. + +The Debian packaging scripts do not support libmpv yet. + Contact ======= diff --git a/scripts/ffmpeg-config b/scripts/ffmpeg-config index 163fd0f..e68ff55 100755 --- a/scripts/ffmpeg-config +++ b/scripts/ffmpeg-config @@ -7,7 +7,13 @@ USER_OPTS="$@" if test -f "$BUILD"/ffmpeg_options ; then USER_OPTS="$(cat "$BUILD"/ffmpeg_options) $USER_OPTS" fi -OPTIONS="--enable-gpl --enable-avresample --disable-debug --disable-doc $USER_OPTS" +OPTIONS="--enable-gpl --enable-avresample --disable-debug --disable-doc" + +if "$BUILD"/scripts/test-libmpv ; then + OPTIONS="$OPTIONS --enable-pic" +fi + +OPTIONS="$OPTIONS $USER_OPTS" echo Using ffmpeg options: $OPTIONS diff --git a/scripts/fribidi-config b/scripts/fribidi-config index 08d1fa0..20fa684 100755 --- a/scripts/fribidi-config +++ b/scripts/fribidi-config @@ -1,9 +1,13 @@ #!/bin/sh set -e +BUILD="$(pwd)" OPTIONS="" -BUILD="$(pwd)" +if "$BUILD"/scripts/test-libmpv ; then + OPTIONS="$OPTIONS --with-pic" +fi + cd "$BUILD"/fribidi ./bootstrap ./configure --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" --enable-static --disable-shared --without-glib $OPTIONS diff --git a/scripts/libass-config b/scripts/libass-config index 810b670..f257028 100755 --- a/scripts/libass-config +++ b/scripts/libass-config @@ -1,9 +1,13 @@ #!/bin/sh set -e +BUILD="$(pwd)" OPTIONS="$@" -BUILD="$(pwd)" +if "$BUILD"/scripts/test-libmpv ; then + OPTIONS="$OPTIONS --with-pic" +fi + cd "$BUILD"/libass # Later libass doesn't automatically run configure with autogen.sh anymore PKG_CONFIG_PATH="$BUILD"/build_libs/lib/pkgconfig ./autogen.sh --prefix="$BUILD/build_libs" --libdir="$BUILD/build_libs/lib" --enable-static --disable-shared $OPTIONS diff --git a/scripts/test-libmpv b/scripts/test-libmpv new file mode 100755 index 0000000..5ee4d22 --- /dev/null +++ b/scripts/test-libmpv @@ -0,0 +1,15 @@ +#!/bin/sh + +# This script returns whether libmpv is to be built. + +set -e + +BUILD="$(pwd)" + +USER_OPTS="$@" +if test -f "$BUILD"/mpv_options ; then + if cat "$BUILD"/mpv_options | grep -e '--enable-libmpv' > /dev/null ; then + exit 0 + fi +fi +exit 1 -- cgit v1.2.3