diff options
author | wm4 <wm4@nowhere> | 2014-06-26 22:22:53 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-26 22:22:53 +0200 |
commit | 5753fa512f4cb7d18438e5685cd2ded4f7b043fc (patch) | |
tree | c66c8e01ceed3b3f36e79aadc1a95955aef5e1c4 | |
parent | f2a85954159b7e5af087ad185dbb5201e87d4765 (diff) | |
download | mpv-build-5753fa512f4cb7d18438e5685cd2ded4f7b043fc.tar.bz2 mpv-build-5753fa512f4cb7d18438e5685cd2ded4f7b043fc.tar.xz |
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.
-rw-r--r-- | README.rst | 12 | ||||
-rwxr-xr-x | scripts/ffmpeg-config | 8 | ||||
-rwxr-xr-x | scripts/fribidi-config | 6 | ||||
-rwxr-xr-x | scripts/libass-config | 6 | ||||
-rwxr-xr-x | scripts/test-libmpv | 15 |
5 files changed, 44 insertions, 3 deletions
@@ -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 |