mirror of
https://github.com/HandBrake/HandBrake-docs.git
synced 2025-12-10 17:47:51 -06:00
build: Use pre-made makefiles when building libpng.
This commit is contained in:
parent
f6bdd4f0d3
commit
809b488599
21
build-tools
21
build-tools
@ -7,6 +7,7 @@ SELF_DIR="${SELF_DIR:-$(pwd)}"
|
|||||||
TOOLS_DIR="${SELF_DIR}/tools"
|
TOOLS_DIR="${SELF_DIR}/tools"
|
||||||
BUILD_DIR="${TOOLS_DIR}/local/build"
|
BUILD_DIR="${TOOLS_DIR}/local/build"
|
||||||
INSTALL_DIR="${TOOLS_DIR}/local"
|
INSTALL_DIR="${TOOLS_DIR}/local"
|
||||||
|
SYS_NAME=$(uname | awk '{ print tolower($0)}')
|
||||||
TOOLS=('discount' 'zlib' 'libpng' 'pngquant' 'zopfli')
|
TOOLS=('discount' 'zlib' 'libpng' 'pngquant' 'zopfli')
|
||||||
|
|
||||||
# discount
|
# discount
|
||||||
@ -26,11 +27,15 @@ function build_zlib {
|
|||||||
|
|
||||||
# libpng
|
# libpng
|
||||||
function build_libpng {
|
function build_libpng {
|
||||||
rm -rf Makefile.in aclocal.m4 automate.cache/ compile config.guess config.h.in config.sub configure depcomp install-sh ltmain.sh missing scripts/libtool.m4 scripts/ltoptions.m4 scripts/ltsugar.m4 scripts/ltversion.m4 scripts/lt~obsolete.m4 test-driver || return 1
|
if [[ "${SYS_NAME}" == "darwin" ]]; then
|
||||||
./autogen.sh || return 1
|
cp scripts/makefile.darwin Makefile
|
||||||
CFLAGS="-I${INSTALL_DIR}/include" CPPFLAGS="-I${INSTALL_DIR}/include" LDFLAGS="-L${INSTALL_DIR}/lib -lz" ./configure --with-zlib-prefix="${INSTALL_DIR}" --prefix="${INSTALL_DIR}" --disable-shared --enable-static || return 1
|
elif [[ "${SYS_NAME}" == "linux" ]]; then
|
||||||
make || return 1
|
cp scripts/makefile.linux Makefile
|
||||||
make install || return 1
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
make libpng.a prefix="${INSTALL_DIR}" ZLIBINC="${INSTALL_DIR}/include" ZLIBLIB="${INSTALL_DIR}/lib" || return 1
|
||||||
|
make install-static prefix="${INSTALL_DIR}" || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# pngquant
|
# pngquant
|
||||||
@ -66,7 +71,11 @@ for TOOL in "${TOOLS[@]}"; do
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
rm -rf "${BUILD_DIR}"
|
|
||||||
|
# clean up
|
||||||
|
if [[ "${ERROR}" != true ]]; then
|
||||||
|
rm -rf "${BUILD_DIR}"
|
||||||
|
fi
|
||||||
|
|
||||||
# done
|
# done
|
||||||
if [[ "${ERROR}" == true ]]; then
|
if [[ "${ERROR}" == true ]]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user