4
4
# LICENSE: https://github.com/markus-perl/ffmpeg-build-script/blob/master/LICENSE
5
5
6
6
PROGNAME=$( basename " $0 " )
7
- FFMPEG_VERSION=7.0
8
- SCRIPT_VERSION=1.52
7
+ FFMPEG_VERSION=7.1
8
+ SCRIPT_VERSION=1.53
9
9
CWD=$( pwd)
10
10
PACKAGES=" $CWD /packages"
11
11
WORKSPACE=" $CWD /workspace"
@@ -26,6 +26,7 @@ if [[ ("$(uname -m)" == "arm64") && ("$OSTYPE" == "darwin"*) ]]; then
26
26
# If arm64 AND darwin (macOS)
27
27
export ARCH=arm64
28
28
export MACOSX_DEPLOYMENT_TARGET=11.0
29
+ export CXX=$( which clang++)
29
30
MACOS_M1=true
30
31
fi
31
32
@@ -53,7 +54,7 @@ make_dir() {
53
54
54
55
remove_dir () {
55
56
if [ -d " $1 " ]; then
56
- rm -r " $1 "
57
+ rm -rf " $1 "
57
58
fi
58
59
}
59
60
@@ -120,7 +121,16 @@ download() {
120
121
)
121
122
}
122
123
124
+ print_flags () {
125
+ echo " Flags: CFLAGS \" $CFLAGS \" , CXXFLAGS \" $CXXFLAGS \" , LDFLAGS \" $LDFLAGS \" , LDEXEFLAGS \" $LDEXEFLAGS \" "
126
+ }
127
+
123
128
execute () {
129
+
130
+ if [[ " $1 " == * configure* ]]; then
131
+ print_flags
132
+ fi
133
+
124
134
echo " $ $* "
125
135
126
136
OUTPUT=$( " $@ " 2>&1 )
@@ -251,7 +261,9 @@ while (($# > 0)); do
251
261
echo " Error: A full static binary can only be build on Linux."
252
262
exit 1
253
263
fi
254
- LDEXEFLAGS=" -static"
264
+ LDEXEFLAGS=" -static -fPIC"
265
+ CFLAGS+=" -fPIC"
266
+ CXXFLAGS+=" -fPIC"
255
267
fi
256
268
if [[ " $1 " == " --latest" ]]; then
257
269
LATEST=true
339
351
if build " pkg-config" " 0.29.2" ; then
340
352
download " https://pkgconfig.freedesktop.org/releases/pkg-config-$CURRENT_PACKAGE_VERSION .tar.gz"
341
353
if [[ " $OSTYPE " == " darwin" * ]]; then
342
- export XXFLAGS= " -Wno-int-conversion" # pkg-config 0.29.2 has a warning that is treated as an error
343
- export CFLAGS= " -Wno-error=int-conversion"
354
+ export XXFLAGS += " -Wno-int-conversion" # pkg-config 0.29.2 has a warning that is treated as an error
355
+ export CFLAGS += " -Wno-error=int-conversion"
344
356
fi
345
357
execute ./configure --silent --prefix=" ${WORKSPACE} " --with-pc-path=" ${WORKSPACE} " /lib/pkgconfig --with-internal-glib
346
358
execute make -j $MJOBS
@@ -455,12 +467,15 @@ else
455
467
fi
456
468
fi
457
469
458
- if build " cmake" " 3.27.7" ; then
470
+ if build " cmake" " 3.31.0" ; then
471
+ CXXFLAGS_BACKUP=$CXXFLAGS
472
+ export CXXFLAGS+=" -std=c++11"
459
473
download " https://github.com/Kitware/CMake/releases/download/v$CURRENT_PACKAGE_VERSION /cmake-$CURRENT_PACKAGE_VERSION .tar.gz"
460
474
execute ./configure --prefix=" ${WORKSPACE} " --parallel=" ${MJOBS} " -- -DCMAKE_USE_OPENSSL=OFF
461
475
execute make -j $MJOBS
462
476
execute make install
463
477
build_done " cmake" $CURRENT_PACKAGE_VERSION
478
+ export CXXFLAGS=$CXXFLAGS_BACKUP
464
479
fi
465
480
466
481
# #
@@ -537,6 +552,7 @@ CONFIGURE_OPTIONS+=("--enable-libsvtav1")
537
552
if command_exists " cargo" ; then
538
553
if [[ ! " $SKIPRAV1E " == " yes" ]]; then
539
554
if build " rav1e" " 0.7.1" ; then
555
+ echo " if you get the message 'cannot be built because it requires rustc x.xx or newer, try to run 'rustup update'"
540
556
execute cargo install cargo-c
541
557
download " https://github.com/xiph/rav1e/archive/refs/tags/v$CURRENT_PACKAGE_VERSION .tar.gz"
542
558
export RUSTFLAGS=" -C target-cpu=native"
1037
1053
build " ffmpeg" " $FFMPEG_VERSION "
1038
1054
download " https://github.com/FFmpeg/FFmpeg/archive/refs/heads/release/$FFMPEG_VERSION .tar.gz" " FFmpeg-release-$FFMPEG_VERSION .tar.gz"
1039
1055
# shellcheck disable=SC2086
1040
- ./configure " ${CONFIGURE_OPTIONS[@]} " \
1056
+ execute ./configure " ${CONFIGURE_OPTIONS[@]} " \
1041
1057
--disable-debug \
1042
1058
--disable-shared \
1043
1059
--enable-pthreads \
0 commit comments