From d8894921734f9ca7c9f70dfbf843ab5e04491912 Mon Sep 17 00:00:00 2001 From: Simon Levermann Date: Thu, 20 Feb 2014 17:54:05 +0100 Subject: [PATCH 1/2] Add ./configure option to disable toggle versions I consider this way cleaner than setting some environment variable in the build script. Per default, sonames are generated. If ./configure is run with "--disable-soname-versions", no soname versions will be generated. This is mainly useful for android, but it might find some use for other environments without soname versioning --- configure.ac | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a94abbe6..c39f9eb8 100644 --- a/configure.ac +++ b/configure.ac @@ -151,7 +151,16 @@ AX_CHECK_COMPILE_FLAG([-fwrapv], [CFLAGS="$CFLAGS -fwrapv"]) AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [CFLAGS="$CFLAGS -fno-strict-aliasing"]) AX_CHECK_COMPILE_FLAG([-fno-strict-overflow], [CFLAGS="$CFLAGS -fno-strict-overflow"]) -LIBTOOL_EXTRA_FLAGS="$LIBTOOL_EXTRA_FLAGS -version-info $SODIUM_LIBRARY_VERSION" +AC_ARG_ENABLE(soname-versions, + [AC_HELP_STRING([--enable-soname-versions], [enable soname versions (must be disabled for android) (default: enabled)])], + [ + AS_IF([test "x$enableval" = "xno"], [ + LIBTOOL_EXTRA_FLAGS="$LIBTOOL_EXTRA_FLAGS -avoid-version" + ], [ + LIBTOOL_EXTRA_FLAGS="$LIBTOOL_EXTRA_FLAGS -version-info $SODIUM_LIBRARY_VERSION" + ]) + ] +) AS_CASE([$host_os], [cygwin* | mingw* | pw32* | cegcc*], [ From c62bbd0b6f06f1394f740520e76876f5a0c73c8e Mon Sep 17 00:00:00 2001 From: Simon Levermann Date: Thu, 20 Feb 2014 17:56:54 +0100 Subject: [PATCH 2/2] Update android build script Use the --disable-soname-versions option for android --- dist-build/android-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh index 53578baf..b75af90f 100755 --- a/dist-build/android-build.sh +++ b/dist-build/android-build.sh @@ -21,7 +21,6 @@ export MAKE_TOOLCHAIN="${ANDROID_NDK_HOME}/build/tools/make-standalone-toolchain export PREFIX="$(pwd)/libsodium-android-${TARGET_ARCH}" export TOOLCHAIN_DIR="$(pwd)/android-toolchain-${TARGET_ARCH}" export PATH="${PATH}:${TOOLCHAIN_DIR}/bin" -export LIBTOOL_EXTRA_FLAGS="-avoid-version" # Clean up before build rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}" @@ -32,7 +31,8 @@ $MAKE_TOOLCHAIN --platform="${NDK_PLATFORM:-android-14}" \ ./configure --host="${HOST_COMPILER}" \ --with-sysroot="${TOOLCHAIN_DIR}/sysroot" \ - --prefix="${PREFIX}" && \ + --prefix="${PREFIX}" \ + --disable-soname-versions && \ make clean && \ make -j3 install && \