From ed1c130ebced51e48b2a8c600e5f7e68fc54dd85 Mon Sep 17 00:00:00 2001 From: jin-eld Date: Mon, 26 Aug 2013 22:08:43 +0300 Subject: [PATCH] Move extra libtool options into configure This should allow to keep the libtool options all in one place and at the same time define different options depending on the host. Made sure that -no-undefined is set only on Win32. Although no side effects on Linux and OSX have been observed so far, it's probably better to play it safe; it does not seem to be needed/does not seem to matter on *nix, only required for Win32. --- configure.ac | 14 ++++++++++++++ toxcore/Makefile.inc | 5 +---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 285c3ac5..64d53dec 100644 --- a/configure.ac +++ b/configure.ac @@ -10,6 +10,17 @@ AM_INIT_AUTOMAKE([1.10 -Wall]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_MACRO_DIR([m4]) +LIBTOXCORE_LT_VERSION=0:0:0 +dnl +dnl current:revision:age +dnl +dnl current: increment if interfaces have been added, removed or changed +dnl revision: increment if source code has changed, set to zero if current is +dnl incremented +dnl age: increment if interfaces have been added, set to zero if +dnl interfaces have been removed or changed +EXTRA_LT_LDFLAGS="-version-info $LIBTOXCORE_LT_VERSION" + if test "x${prefix}" = "xNONE"; then prefix="${ac_default_prefix}" fi @@ -106,6 +117,7 @@ case $host_os in WIN32="yes" AC_MSG_WARN([nTox is not supported on $host_os yet, disabling]) BUILD_NTOX="no" + EXTRA_LT_LDFLAGS="$EXTRA_LT_LDFLAGS -no-undefined" ;; *solaris*) LIBS="$LIBS -lssp -lsocket -lnsl" @@ -118,6 +130,8 @@ case $host_os in esac AM_CONDITIONAL(WIN32, test "x$WIN32" = "xyes") +AC_SUBST(EXTRA_LT_LDFLAGS) + # Checks for libraries. LIBSODIUM_LIBS= LIBSODIUM_LDFLAGS= diff --git a/toxcore/Makefile.inc b/toxcore/Makefile.inc index 90912a59..da07db41 100644 --- a/toxcore/Makefile.inc +++ b/toxcore/Makefile.inc @@ -1,5 +1,3 @@ -LIBTOXCORE_VERSION = 0:0:0 - lib_LTLIBRARIES = libtoxcore.la libtoxcore_la_include_HEADERS = \ @@ -33,8 +31,7 @@ libtoxcore_la_CFLAGS = -I$(top_srcdir) \ -I$(top_srcdir)/toxcore \ $(LIBSODIUM_CFLAGS) -libtoxcore_la_LDFLAGS = -version-info $(LIBTOXCORE_VERSION) \ - -no-undefined \ +libtoxcore_la_LDFLAGS = $(EXTRA_LT_LDFLAGS) \ $(LIBSODIUM_LDFLAGS) \ $(WINSOCK2_LIBS)