Skip to content

Commit

Permalink
Fix build under linux-aarch64
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <[email protected]>
  • Loading branch information
falkTX committed Nov 24, 2024
1 parent b1fd593 commit ad26e68
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

env:
CACHE_VERSION: 13
CACHE_VERSION: 14
DEBIAN_FRONTEND: noninteractive
PAWPAW_SKIP_TESTS: 1

Expand Down
26 changes: 21 additions & 5 deletions bootstrap-jack2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,44 @@ 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
if [ "${WIN32}" -eq 1 ]; then
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
Expand Down
6 changes: 4 additions & 2 deletions bootstrap-plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion bootstrap-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 9 additions & 3 deletions setup/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad26e68

Please sign in to comment.