Skip to content

Commit

Permalink
test build of zlib package with cross compilation enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxython committed Jan 24, 2025
1 parent fcb3e09 commit c460cad
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/zlib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ TERMUX_PKG_VERSION="1.3.1"
TERMUX_PKG_SRCURL=https://github.com/madler/zlib/releases/download/v${TERMUX_PKG_VERSION}/zlib-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32
TERMUX_PKG_AUTO_UPDATE=true
# TEST
TERMUX_PKG_BUILD32=true
TERMUX_PKG_BREAKS="ndk-sysroot (<< 19b-3), zlib-dev"
TERMUX_PKG_REPLACES="ndk-sysroot (<< 19b-3), zlib-dev"

termux_step_pre_configure() {
if [ "$TERMUX_ARCH" = "aarch64" ]; then
CFLAGS+=" -march=armv8-a+crc"
CXXFLAGS+=" -march=armv8-a+crc"
fi

# Fix relocation issues when linking with libz.a
CFLAGS+=" -fPIC"
CXXFLAGS+=" -fPIC"
Expand All @@ -24,5 +21,12 @@ termux_step_pre_configure() {
}

termux_step_configure() {
"$TERMUX_PKG_SRCDIR/configure" --prefix=$TERMUX_PREFIX --shared
local CFLAGS="${CFLAGS}"
local CXXFLAGS="${CXXFLAGS}"
if [ "$TERMUX_ARCH" = "aarch64" ]; then
CFLAGS+=" -march=armv8-a+crc"
CXXFLAGS+=" -march=armv8-a+crc"
fi

"$TERMUX_PKG_SRCDIR/configure" --prefix=$TERMUX_PREFIX --libdir=$TERMUX_LIB_PATH --shared
}

0 comments on commit c460cad

Please sign in to comment.