forked from acoustid/ffmpeg-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-linux.sh
executable file
·74 lines (62 loc) · 1.45 KB
/
build-linux.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/usr/bin/env bash
set -eu
cd $(dirname $0)
BASE_DIR=$(pwd)
source common.sh
if [ ! -e $FFMPEG_TARBALL ]
then
curl -s -L -O $FFMPEG_TARBALL_URL
fi
: ${ARCH?}
TARGET=ffmpeg-$FFMPEG_VERSION-audio-linux-$ARCH
case $ARCH in
i686)
FFMPEG_CONFIGURE_FLAGS+=(--cc="gcc -m32")
;;
arm*)
FFMPEG_CONFIGURE_FLAGS+=(
--enable-cross-compile
--cross-prefix=arm-linux-gnueabihf-
--target-os=linux
--arch=arm
)
case $ARCH in
armv7-a)
FFMPEG_CONFIGURE_FLAGS+=(
--cpu=armv7-a
)
;;
armv8-a)
FFMPEG_CONFIGURE_FLAGS+=(
--cpu=armv8-a
)
;;
armhf-rpi2)
FFMPEG_CONFIGURE_FLAGS+=(
--cpu=cortex-a7
--extra-cflags='-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad'
)
;;
armhf-rpi3)
FFMPEG_CONFIGURE_FLAGS+=(
--cpu=cortex-a53
--extra-cflags='-fPIC -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad'
)
;;
esac
;;
x86_64)
;;
*)
echo "Unknown architecture"
exit 1
esac
BUILD_DIR=$(mktemp -d -p $(pwd) build.XXXXXXXX)
trap 'rm -rf $BUILD_DIR' EXIT
cd $BUILD_DIR
tar --strip-components=1 -xf $BASE_DIR/$FFMPEG_TARBALL
FFMPEG_CONFIGURE_FLAGS+=(--prefix=$BASE_DIR/$TARGET)
./configure "${FFMPEG_CONFIGURE_FLAGS[@]}"
make
make install
chown $(stat -c '%u:%g' $BASE_DIR) -R $BASE_DIR/$TARGET