From ad26e682a25ba0a22ca2b0162667884d3f9cbf2a Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Nov 2024 18:51:04 +0100 Subject: [PATCH] Fix build under linux-aarch64 Signed-off-by: falkTX --- .github/workflows/bootstrap.yml | 2 +- bootstrap-jack2.sh | 26 +++++++++++++++++++++----- bootstrap-plugins.sh | 6 ++++-- bootstrap-python.sh | 2 +- setup/functions.sh | 12 +++++++++--- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 83c22f3..a8f8e97 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -4,7 +4,7 @@ on: push: env: - CACHE_VERSION: 13 + CACHE_VERSION: 14 DEBIAN_FRONTEND: noninteractive PAWPAW_SKIP_TESTS: 1 diff --git a/bootstrap-jack2.sh b/bootstrap-jack2.sh index a4583af..8bfee51 100755 --- a/bootstrap-jack2.sh +++ b/bootstrap-jack2.sh @@ -56,16 +56,32 @@ download db "${DB_VERSION}" "${DB_URL}" # based on build_autoconf function build_custom_db() { - local name="${1}" + local pkgname="${1}" local version="${2}" local extraconfrules="${3}" - local pkgdir="${PAWPAW_BUILDDIR}/${name}-${version}" + local pkgdir="${PAWPAW_BUILDDIR}/${pkgname}-${version}" - if [ "${CROSS_COMPILING}" -eq 1 ]; then + if [ "${LINUX}" -eq 1 ] || [ "${WASM}" -eq 1 ]; then extraconfrules+=" --build=$(uname -m)-linux-gnu ac_cv_build=$(uname -m)-linux-gnu" + fi + + if [ "${LINUX}" -eq 1 ] && [ "$(uname -m)" != "x86_64" ]; then + extraconfrules+=" --host=$(uname -m)-linux-gnu ac_cv_host=$(uname -m)-linux-gnu" + elif [ "${WASM}" -eq 1 ]; then + extraconfrules+=" --host=i686-linux-gnu ac_cv_host=i686-linux-gnu" + elif [ -n "${TOOLCHAIN_PREFIX}" ]; then extraconfrules+=" --host=${TOOLCHAIN_PREFIX} ac_cv_host=${TOOLCHAIN_PREFIX}" fi + + if echo "${extraconfrules}" | grep -q -e '--enable-debug' -e '--disable-debug'; then + true + elif [ -n "${PAWPAW_DEBUG}" ] && [ "${PAWPAW_DEBUG}" -eq 1 ]; then + extraconfrules+=" --enable-debug" + else + extraconfrules+=" --disable-debug" + fi + if [ "${MACOS}" -eq 1 ]; then extraconfrules+=" --with-mutex=x86_64/gcc-assembly db_cv_atomic=x86/gcc-assembly" fi @@ -73,11 +89,11 @@ function build_custom_db() { extraconfrules+=" --enable-mingw" fi - _prebuild "${name}" "${pkgdir}" + _prebuild "${pkgname}" "${pkgdir}" if [ ! -f "${pkgdir}/.stamp_configured" ]; then pushd "${pkgdir}/build_unix" - ../dist/configure --enable-static --disable-shared --disable-debug --disable-doc --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules} + ../dist/configure --enable-static --disable-shared --disable-doc --disable-maintainer-mode --prefix="${PAWPAW_PREFIX}" ${extraconfrules} touch ../.stamp_configured popd fi diff --git a/bootstrap-plugins.sh b/bootstrap-plugins.sh index ebe9de0..cad3c8f 100755 --- a/bootstrap-plugins.sh +++ b/bootstrap-plugins.sh @@ -385,8 +385,9 @@ fi if [ -z "${PAWPAW_SKIP_GLIB}" ] || [ "${PAWPAW_SKIP_GLIB}" -eq 0 ]; then if [ "${MACOS}" -eq 1 ] || [ "${WASM}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then - GLIB_EXTRAFLAGS="--disable-rebuilds" - GLIB_EXTRAFLAGS="--disable-profile" + GLIB_EXTRAFLAGS="" + GLIB_EXTRAFLAGS+=" --disable-rebuilds" + GLIB_EXTRAFLAGS+=" --disable-profile" if [ "${WIN32}" -eq 1 ]; then GLIB_EXTRAFLAGS+=" --with-threads=win32" @@ -413,6 +414,7 @@ if [ "${MACOS}" -eq 1 ] || [ "${WASM}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_ARM/__aarch64__/' patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_X86_64/__SSE2__/' elif [ "${WASM}" -eq 1 ]; then + patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_I486/_G_ATOMIC_NOT_I486/' patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_X86_64/_G_ATOMIC_NOT_X86_64/' fi diff --git a/bootstrap-python.sh b/bootstrap-python.sh index 15611fd..284d403 100755 --- a/bootstrap-python.sh +++ b/bootstrap-python.sh @@ -80,7 +80,7 @@ function build_conf_openssl() { fi export RELEASE="whatever" export BUILD="unknown" - elif [ "${MACOS_UNIVERSAL}" -eq 0 ] && [ "$(uname -m)" != "x86_64" ]; then + elif [ "${MACOS_UNIVERSAL}" -eq 0 ] && [ "$(uname -m)" = "x86_64" ]; then export MACHINE="x86_64" fi diff --git a/setup/functions.sh b/setup/functions.sh index 617788a..f70de75 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -221,10 +221,16 @@ function build_autoconf() { local pkgdir="${PAWPAW_BUILDDIR}/${pkgname}-${version}" - if [ "${WASM}" -eq 1 ]; then - extraconfrules+=" --host=$(uname -m)-linux-gnu" + if [ "${LINUX}" -eq 1 ] || [ "${WASM}" -eq 1 ]; then + extraconfrules+=" --build=$(uname -m)-linux-gnu ac_cv_build=$(uname -m)-linux-gnu" + fi + + if [ "${LINUX}" -eq 1 ] && [ "$(uname -m)" != "x86_64" ]; then + extraconfrules+=" --host=$(uname -m)-linux-gnu ac_cv_host=$(uname -m)-linux-gnu" + elif [ "${WASM}" -eq 1 ]; then + extraconfrules+=" --host=i686-linux-gnu ac_cv_host=i686-linux-gnu" elif [ -n "${TOOLCHAIN_PREFIX}" ]; then - extraconfrules+=" --host=${TOOLCHAIN_PREFIX} ac_cv_build=$(uname -m)-linux-gnu ac_cv_host=${TOOLCHAIN_PREFIX}" + extraconfrules+=" --host=${TOOLCHAIN_PREFIX} ac_cv_host=${TOOLCHAIN_PREFIX}" fi if echo "${extraconfrules}" | grep -q -e '--enable-debug' -e '--disable-debug'; then