diff --git a/builder/scripts.d/50-libopus.sh b/builder/scripts.d/50-libopus.sh index 054570b4f9..45e559d43c 100755 --- a/builder/scripts.d/50-libopus.sh +++ b/builder/scripts.d/50-libopus.sh @@ -40,7 +40,13 @@ ffbuild_dockerbuild() { # reset CLFAGS because libopus may give up optimization if current CFLAGS contains value CFLAGS_BACKUP="$CFLAGS" - export CFLAGS="-O3" # For some reason libopus will not add optimization flag, we have to set it ourselves + + # For some reason libopus will not add optimization flag, we have to set it ourselves + if [[ $TARGET == mac* ]]; then + export CFLAGS="-O3" + else + export CFLAGS="-O3 -fPIC -DPIC" + fi ./configure "${myconf[@]}" make -j$(nproc)