forked from System233/ffmpeg-msvc-prebuilt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-ffmpeg.sh
More file actions
executable file
·31 lines (27 loc) · 822 Bytes
/
Copy pathbuild-ffmpeg.sh
File metadata and controls
executable file
·31 lines (27 loc) · 822 Bytes
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
#!/bin/bash
# Copyright (c) 2024 System233
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
set -e
echo -e "\n[Build $1]"
SRC_DIR=$(pwd)/$1
shift 1
cd $SRC_DIR
if [ $BUILD_TYPE == "static" ]; then
TYPE_ARGS="--enable-static --pkg-config-flags=--static"
else
TYPE_ARGS="--enable-shared"
fi
if [[ $BUILD_ARCH =~ arm ]]; then
CROSS_ARGS="--enable-cross-compile --disable-asm"
fi
if [ $BUILD_LICENSE == "gpl" ]; then
LICENSE_ARGS="--enable-gpl --enable-version3"
fi
CFLAGS="$CFLAGS -I${SRC_DIR}/compat/stdbit"
EX_BUILD_ARGS="$TYPE_ARGS $CROSS_ARGS $LICENSE_ARGS"
CFLAGS="$CFLAGS" ./configure --toolchain=msvc --arch=$BUILD_ARCH $EX_BUILD_ARGS $@
# iconv -f gbk config.h >config.h.tmp && mv config.h.tmp config.h
make -j$(nproc)
make install prefix=$INSTALL_PREFIX