commit 2c126fe090e7402f68275855e1abbf2f74550818
Author: Robert Hogan <robert(a)roberthogan.net>
Date: Wed Mar 2 20:23:02 2011 +0000
Fix breakage from previous commit
Use $TORSOCKSLDFLAGS for libtorsocks and $TESTLDFLAGS
for test/test_torsocks.
---
configure.in | 20 +++++++++++---------
src/Makefile.am | 1 +
test/Makefile.am | 1 +
3 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/configure.in b/configure.in
index 4bc0e7b..75d5e1c 100644
--- a/configure.in
+++ b/configure.in
@@ -548,9 +548,10 @@ AC_DEFINE_UNQUOTED([SENDMSG_ARGNAMES],[${NAMES}],[Argument names])
# This variable is used for the LDFLAGS in test/Makefile.am
TESTLDFLAGS="$LDFLAGS"
+AC_SUBST(TESTLDFLAGS)
# Version information for libtorsocks
-LDFLAGS="$LDFLAGS -version-info 1:0:0"
+TORSOCKSLDFLAGS="$LDFLAGS -version-info 1:0:0"
dnl Linker checks for Mac OSX, which uses DYLD_INSERT_LIBRARIES
dnl instead of LD_PRELOAD
@@ -558,10 +559,10 @@ case "$host_os" in
darwin*)
dnl Check if the linker accepts -dynamiclib; necessary on Mac OS X
AC_MSG_CHECKING(if the linker accepts -dynamiclib)
- OLDLDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -dynamiclib"
+ OLDLDFLAGS="$TORSOCKSLDFLAGS"
+ TORSOCKSLDFLAGS="$TORSOCKSLDFLAGS -dynamiclib"
AC_TRY_COMPILE(,,AC_MSG_RESULT(yes),[
- LDFLAGS="$OLDLDFLAGS"
+ TORSOCKSLDFLAGS="$OLDLDFLAGS"
AC_MSG_RESULT(no)])
# dnl Check if the linker accepts -multiply_defined suppress; necessary on Mac OS X
@@ -574,17 +575,17 @@ darwin*)
dnl Check if the linker accepts -single_module; necessary on Mac OS X
AC_MSG_CHECKING(if the linker accepts -single_module)
- OLDLDFLAGS="$LDFLAGS"
+ OLDLDFLAGS="$TORSOCKSLDFLAGS"
SHLIB_EXT="so"
LD_PRELOAD="LD_PRELOAD"
- LDFLAGS="$LDFLAGS -single_module"
+ TORSOCKSLDFLAGS="$TORSOCKSLDFLAGS -single_module"
AC_TRY_COMPILE(,,
[
SHLIB_EXT="dylib"
LD_PRELOAD="DYLD_INSERT_LIBRARIES"
AC_MSG_RESULT(yes)
], [
- LDFLAGS="$OLDLDFLAGS"
+ TORSOCKSLDFLAGS="$OLDLDFLAGS"
AC_MSG_RESULT(no)
]
)
@@ -598,6 +599,7 @@ esac
AC_SUBST(SHLIB_EXT)
AC_SUBST(LD_PRELOAD)
+AC_SUBST(TORSOCKSLDFLAGS)
##############################################################################
# 7. Determine where the install should write the default configuration
@@ -639,5 +641,5 @@ AC_ENABLE_SHARED
AC_ENABLE_STATIC
AC_CONFIG_FILES([src/usewithtor src/torsocks doc/torsocks.conf.5 doc/torsocks.8 doc/usewithtor.1 doc/torsocks.1])
-AC_CONFIG_FILES(Makefile src/Makefile doc/Makefile)
-#AC_OUTPUT
+AC_CONFIG_FILES(Makefile src/Makefile doc/Makefile test/Makefile)
+AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 8d47fb6..5f13f47 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ libdir = @libdir@/torsocks
bin_SCRIPTS = torsocks usewithtor
INSTALL_SCRIPT = $(install_sh) -c -m 755
+libtorsocks_la_LDFLAGS= $(TORSOCKSLDFLAGS)
# Install main library to $(prefix)/lib/tor (must match torsocks.in)
lib_LTLIBRARIES = libtorsocks.la
libtorsocks_la_SOURCES = torsocks.c common.c parser.c dead_pool.c darwin_warts.c socks.c
diff --git a/test/Makefile.am b/test/Makefile.am
index c04e5ea..159e3c9 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,6 @@
noinst_PROGRAMS= test_torsocks
test_torsocks_SOURCES= test_torsocks.c
+AM_LDFLAGS=
test_torsocks_LDFLAGS= $(TESTLDFLAGS)
CLEANFILES= test_torsocks