Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
Optimize build scripts to reduce build time
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromewu committed May 17, 2021
1 parent cc8a08e commit 3afe847
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 29 deletions.
5 changes: 3 additions & 2 deletions wasm/build-scripts/build-fdk-aac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ CONF_FLAGS=(
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
--host=i686-linux # use i686 linux
--disable-shared # disable shared library
--disable-dependency-tracking # speedup one-time build
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-freetype2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ CONF_FLAGS=(
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-fribidi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ CONF_FLAGS=(
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-harfbuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ CONF_FLAGS=(
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 3 additions & 1 deletion wasm/build-scripts/build-lame.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ CONF_FLAGS=(
--disable-shared # disable shared library
--disable-frontend # exclude lame executable
--disable-analyzer-hooks # exclude analyzer hooks
--disable-dependency-tracking # speed up one-time build
--disable-gtktest
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-libass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ CONF_FLAGS=(
--disable-require-system-font-provider
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && ./autogen.sh && EM_PKG_CONFIG_PATH=$EM_PKG_CONFIG_PATH emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
(cd $LIB_PATH && ./autogen.sh && EM_PKG_CONFIG_PATH=$EM_PKG_CONFIG_PATH emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
3 changes: 2 additions & 1 deletion wasm/build-scripts/build-libvpx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ CONF_FLAGS=(
--disable-tools # not to build tools
--disable-docs # not to build docs
--disable-unit-tests # not to do unit tests
--disable-dependency-tracking # speed up one-time build
--extra-cflags="$FLAGS" # flags to use pthread and code optimization
--extra-cxxflags="$FLAGS" # flags to use pthread and code optimization
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && LDFLAGS="$FLAGS" STRIP="llvm-strip" emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
2 changes: 1 addition & 1 deletion wasm/build-scripts/build-libwebp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ cd $LIB_PATH
mkdir -p build
cd build
emmake cmake .. -DCMAKE_C_FLAGS="$CXXFLAGS" ${CM_FLAGS[@]}
emmake make clean
emmake make install
emmake make clean
cd $ROOT_DIR
6 changes: 4 additions & 2 deletions wasm/build-scripts/build-ogg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ CONF_FLAGS=(
--prefix=$BUILD_DIR # install library in a build directory for FFmpeg to include
--host=i686-linux # use i686 linux
--disable-shared # disable shared library
--disable-dependency-tracking # speed up one-time build
--disable-maintainer-mode
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-opus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ CONF_FLAGS=(
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-theora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ CONF_FLAGS=(
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS emconfigure ./autogen.sh "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS emconfigure ./autogen.sh -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
7 changes: 3 additions & 4 deletions wasm/build-scripts/build-vorbis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ CONF_FLAGS=(
--enable-examples=no
--enable-fast-install=no
--disable-oggtest # disable oggtests
--disable-dependency-tracking # speed up one-time build
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && \
emconfigure ./autogen.sh && \
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS emconfigure ./configure "${CONF_FLAGS[@]}")
# (cd $LIB_PATH && \
# CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS emconfigure ./autogen.sh "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
6 changes: 4 additions & 2 deletions wasm/build-scripts/build-wavpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ CONF_FLAGS=(
--disable-dsd # disalbe legacy
--enable-legacy # enable compability for old version of wav
--disable-shared # enable building static library
--disable-dependency-tracking # speed up one-time build
--disable-maintainer-mode
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && CFLAGS=$CFLAGS emconfigure ./autogen.sh "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
(cd $LIB_PATH && CFLAGS=$CFLAGS emconfigure ./autogen.sh -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install -j
emmake make -C $LIB_PATH clean
4 changes: 2 additions & 2 deletions wasm/build-scripts/build-x264.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ CONF_FLAGS=(
--extra-cflags="-c -s USE_PTHREADS=1 $OPTIM_FLAGS" # flags to use pthread and code optimization
)
echo "CONF_FLAGS=${CONF_FLAGS[@]}"
(cd $LIB_PATH && emconfigure ./configure "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH clean
(cd $LIB_PATH && emconfigure ./configure -C "${CONF_FLAGS[@]}")
emmake make -C $LIB_PATH install-lib-static -j
emmake make -C $LIB_PATH clean
4 changes: 4 additions & 0 deletions wasm/build-scripts/build-x265.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,8 @@ EOF

cp libx265.a $BUILD_DIR/lib

emmake make -C . clean
emmake make -C ../10bit clean
emmake make -C ../12bit clean

cd $ROOT_DIR
3 changes: 2 additions & 1 deletion wasm/build-scripts/build-zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CM_FLAGS=(
-DCMAKE_INSTALL_PREFIX=$BUILD_DIR
-DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_FILE
-DBUILD_SHARED_LIBS=OFF
-DSKIP_INSTALL_FILES=ON
)
echo "CM_FLAGS=${CM_FLAGS[@]}"

Expand All @@ -17,6 +18,6 @@ rm -rf build zconf.h
mkdir -p build
cd build
emmake cmake .. -DCMAKE_C_FLAGS="$CXXFLAGS" ${CM_FLAGS[@]}
emmake make clean
emmake make install
emmake make clean
cd $ROOT_DIR
1 change: 0 additions & 1 deletion wasm/build-scripts/configure-ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ FLAGS=(
--enable-libwebp # enable libwebp
--enable-libass # enable libass
--enable-libfribidi # enable libfribidi
# --enable-filter=subtitles,overlay
# --enable-libaom # enable libaom
)
echo "FFMPEG_CONFIG_FLAGS=${FLAGS[@]}"
Expand Down

0 comments on commit 3afe847

Please sign in to comment.