--- configure.in.orig 2007-03-28 12:26:34.000000000 +0100
+++ configure.in 2007-03-28 12:16:28.000000000 +0100
dnl Find the correct poll prototype on this machine
AC_MSG_CHECKING(for correct poll prototype)
-for testproto in 'struct pollfd *ufds, unsigned long nfds, int timeout'
+for testproto in 'struct pollfd *ufds, nfds_t nfds, int timeout'
if test "${PROTO}" = ""; then
AC_DEFINE_UNQUOTED(GETIPNODEBYNAME_SIGNATURE, [${PROTO}])
dnl Output the special librarys (libdl etc needed for tsocks)
+SPECIALLIBS="${LIBS} -lSystemStubs"
+dnl Check if the linker accepts -dynamiclib; necessary on Mac OS X
+AC_MSG_CHECKING(if the linker accepts -dynamiclib)
+LDFLAGS="$LDFLAGS -dynamiclib"
+AC_TRY_COMPILE(,,AC_MSG_RESULT(yes),[
+dnl Check if the linker accepts -multiply_defined suppress; necessary on Mac OS X
+AC_MSG_CHECKING(if the linker accepts -multiply_defined suppress)
+LDFLAGS="$LDFLAGS -multiply_defined suppress"
+AC_TRY_COMPILE(,,AC_MSG_RESULT(yes),[
+dnl Check if the linker accepts -single_module; necessary on Mac OS X
+AC_MSG_CHECKING(if the linker accepts -single_module)
+LDFLAGS="$LDFLAGS -single_module"
+ LD_PRELOAD="DYLD_INSERT_LIBRARIES"
+AC_CONFIG_FILES([Makefile])
+AC_CONFIG_FILES([tsocks], [chmod +x tsocks])