diff --git a/sbin/prepareWorkspace.sh b/sbin/prepareWorkspace.sh index a7af847b5..9f4ab736c 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