Add rpath-link parameter for aarch64 build
[termux-packages] / build-package.sh
index eb04618..eb65dc5 100755 (executable)
@@ -99,6 +99,9 @@ if [ "$TERMUX_ARCH" = "arm" ]; then
 elif [ $TERMUX_ARCH = "i686" ]; then
        # From $NDK/docs/CPU-ARCH-ABIS.html:
        CFLAGS+=" -march=i686 -msse3 -mstackrealign -mfpmath=sse"
+elif [ $TERMUX_ARCH = "aarch64" ]; then
+       LDFLAGS+=" -Wl,-rpath-link,$TERMUX_PREFIX/lib"
+       LDFLAGS+=" -Wl,-rpath-link,$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib"
 fi
 
 if [ -n "$TERMUX_DEBUG" ]; then
@@ -344,12 +347,11 @@ termux_step_configure () {
        # also cause problems with e.g. malloc interceptors such as libgc:
        local AVOID_AUTOCONF_WRAPPERS="ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes"
 
-       $TERMUX_PKG_SRCDIR/configure \
+       env $AVOID_AUTOCONF_WRAPPERS $TERMUX_PKG_SRCDIR/configure \
                --disable-dependency-tracking \
                --prefix=$TERMUX_PREFIX \
                 --disable-rpath --disable-rpath-hack \
                $HOST_FLAG \
-               $AVOID_AUTOCONF_WRAPPERS \
                $TERMUX_PKG_EXTRA_CONFIGURE_ARGS \
                $DISABLE_NLS \
                $ENABLE_SHARED \