Ticket #11652: patch-configure.in

File patch-configure.in, 1.8 KB (added by darren.bane@…, 18 years ago)

Replacement for net/tsocks/files/patch-configure.in

Line 
1--- configure.in.orig   2007-03-28 12:26:34.000000000 +0100
2+++ configure.in        2007-03-28 12:16:28.000000000 +0100
3@@ -365,7 +365,7 @@
4 dnl Find the correct poll prototype on this machine
5 AC_MSG_CHECKING(for correct poll prototype)
6 PROTO=
7-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout'
8+for testproto in 'struct pollfd *ufds, nfds_t nfds, int timeout'
9 do
10   if test "${PROTO}" = ""; then
11     AC_TRY_COMPILE([
12@@ -393,8 +393,46 @@
13 AC_DEFINE_UNQUOTED(GETIPNODEBYNAME_SIGNATURE, [${PROTO}])
14 
15 dnl Output the special librarys (libdl etc needed for tsocks)
16-SPECIALLIBS=${LIBS}
17+SPECIALLIBS="${LIBS} -lSystemStubs"
18 AC_SUBST(SPECIALLIBS)
19 LIBS=${SIMPLELIBS}
20 
21-AC_OUTPUT(Makefile)
22+dnl Check if the linker accepts -dynamiclib; necessary on Mac OS X
23+AC_MSG_CHECKING(if the linker accepts -dynamiclib)
24+OLDLDFLAGS="$LDFLAGS"
25+LDFLAGS="$LDFLAGS -dynamiclib"
26+AC_TRY_COMPILE(,,AC_MSG_RESULT(yes),[
27+   LDFLAGS="$OLDLDFLAGS"
28+   AC_MSG_RESULT(no)])
29+
30+dnl Check if the linker accepts -multiply_defined suppress; necessary on Mac OS X
31+AC_MSG_CHECKING(if the linker accepts -multiply_defined suppress)
32+OLDLDFLAGS="$LDFLAGS"
33+LDFLAGS="$LDFLAGS -multiply_defined suppress"
34+AC_TRY_COMPILE(,,AC_MSG_RESULT(yes),[
35+   LDFLAGS="$OLDLDFLAGS"
36+   AC_MSG_RESULT(no)])
37+
38+dnl Check if the linker accepts -single_module; necessary on Mac OS X
39+AC_MSG_CHECKING(if the linker accepts -single_module)
40+OLDLDFLAGS="$LDFLAGS"
41+SHLIB_EXT="so"
42+LD_PRELOAD="LD_PRELOAD"
43+LDFLAGS="$LDFLAGS -single_module"
44+AC_TRY_COMPILE(,,
45+   [
46+      SHLIB_EXT="dylib"
47+      LD_PRELOAD="DYLD_INSERT_LIBRARIES"
48+      AC_MSG_RESULT(yes)
49+   ], [
50+      LDFLAGS="$OLDLDFLAGS"
51+      AC_MSG_RESULT(no)
52+   ]
53+)
54+
55+AC_SUBST(SHLIB_EXT)
56+AC_SUBST(LD_PRELOAD)
57+AC_CONFIG_FILES([Makefile])
58+AC_CONFIG_FILES([tsocks], [chmod +x tsocks])
59+AC_OUTPUT
60+