Commits

Anonymous committed a493dba

Check for the -rpath linker flag.
This makes it build on MacOS X which neither
supports nor needs this flag.

  • Participants
  • Parent commits 35e4750

Comments (0)

Files changed (3)

 	fi
 fi
 
+# rpath, for finding libratbox.so at run time
+hold_ldflags=$LDFLAGS
+AC_MSG_CHECKING(for the ld -rpath flag)
+LDFLAGS="${LDFLAGS} -Wl,-rpath=${libdir}"
+AC_LINK_IFELSE(AC_LANG_PROGRAM([],[int i;]), found=yes, found=no)
+LDFLAGS=$hold_ldflags
+AC_MSG_RESULT($found)
+if test "$found" = yes; then
+	LDFLAGS="${LDFLAGS} -Wl,-rpath=\${libdir}"
+fi
+
 # This must be down here, or it will mess up checks like the ones
 # for -Wl,-export-dynamic
 # -- jilles
 SSL_LIBS	= @SSL_LIBS@
 SSL_INCLUDES	= @SSL_INCLUDES@
 
-IRCDLIBS	= @MODULES_LIBS@ -Wl,-rpath=@libdir@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS)
+IRCDLIBS	= @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS)
 
 INCLUDES	= -I../include -I../libratbox/include $(SSL_INCLUDES)
 CPPFLAGS	= ${INCLUDES} @CPPFLAGS@
 prefix          = @prefix@
 exec_prefix     = @exec_prefix@
 bindir          = @bindir@
+libdir		= @libdir@
 libexecdir      = @libexecdir@
 confdir         = @confdir@
 localstatedir   = @localstatedir@
 
 ZIP_LIB		= @ZLIB_LD@
 
-IRCDLIBS	= @MODULES_LIBS@ -Wl,-rpath=@libdir@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $(ZIP_LIB)
+IRCDLIBS	= @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS) $(ZIP_LIB)
 
 INCLUDES        = -I. -I../include -I../libratbox/include $(SSL_INCLUDES)
 CPPFLAGS        = ${INCLUDES} @CPPFLAGS@