From 54ce3026110ece089a8d120a157b1e190b737a16 Mon Sep 17 00:00:00 2001 From: Haroon Khel <34969545+Haroon-Khel@users.noreply.github.com> Date: Wed, 8 Nov 2023 21:35:50 +0800 Subject: [PATCH] Freetype: run bash autogen.sh before any ./configure commands (#3523) * move autogen command before libpng check * debug * remove debug * exit if autogen fails * exit code 1 --- sbin/prepareWorkspace.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index bca1a0a73..2c0c12e36 100644 --- a/sbin/prepareWorkspace.sh +++ b/sbin/prepareWorkspace.sh @@ -477,19 +477,21 @@ checkingAndDownloadingFreeType() { return fi - local pngArg="" - if ./configure --help | grep "with-png"; then - pngArg="--with-png=no" - fi - local freetypeEnv="" if [[ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "i686" ]] || [[ "${BUILD_CONFIG[OS_ARCHITECTURE]}" == "i386" ]]; then freetypeEnv="export CC=\"gcc -m32\"" fi + eval "${freetypeEnv}" && bash ./autogen.sh || exit 1 + + local pngArg="" + if ./configure --help | grep "with-png"; then + pngArg="--with-png=no" + fi + # We get the files we need at $WORKING_DIR/installedfreetype # shellcheck disable=SC2046 - if ! (eval "${freetypeEnv}" && bash ./autogen.sh && bash ./configure --prefix="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"/installedfreetype "${pngArg}" "${BUILD_CONFIG[FREETYPE_FONT_BUILD_TYPE_PARAM]}" && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} all && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} install); then + if ! (bash ./configure --prefix="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"/installedfreetype "${pngArg}" "${BUILD_CONFIG[FREETYPE_FONT_BUILD_TYPE_PARAM]}" && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} all && ${BUILD_CONFIG[MAKE_COMMAND_NAME]} install); then # shellcheck disable=SC2154 echo "Failed to configure and build libfreetype, exiting" exit