summaryrefslogtreecommitdiffstats
path: root/scripts/ffmpeg-config
blob: 7ff138f50ad6ec59e0930b3fcfa6c6faae576a56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -e

BUILD="$(pwd)"

USER_OPTS="$@"
if test -f "$BUILD"/ffmpeg_options ; then
    USER_OPTS="$(cat "$BUILD"/ffmpeg_options) $USER_OPTS"
fi
OPTIONS="--enable-gpl --enable-nonfree --disable-debug --disable-doc"

if "$BUILD"/scripts/test-libmpv ; then
    OPTIONS="$OPTIONS --enable-pic"
fi

OPTIONS="$OPTIONS $USER_OPTS"

# Do FFmpeg's job.
if ! ( echo "$OPTIONS" | grep -e --enable-openssl ) &&
   ! ( echo "$OPTIONS" | grep -e --enable-gnutls ) ;
then
    if pkg-config openssl ; then
        OPTIONS="$OPTIONS --enable-openssl"
        echo "Auto-enabling OpenSSL (creates a non-redistributable binary)."
    elif pkg-config gnutls ; then
        OPTIONS="$OPTIONS --enable-gnutls"
        echo "Auto-enabling GnuTLS."
    fi
fi

echo Using ffmpeg options: $OPTIONS

mkdir -p "$BUILD"/ffmpeg_build
cd "$BUILD"/ffmpeg_build
PKG_CONFIG_PATH="$BUILD"/build_libs/lib/pkgconfig "$BUILD"/ffmpeg/configure --prefix="$BUILD"/build_libs --enable-static --disable-shared $OPTIONS