diff --git a/configure.ac b/configure.ac index 919cc3a0..e30fb4d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1020,6 +1020,17 @@ if test "$shared_modules" = yes; then 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 diff --git a/src/Makefile.in b/src/Makefile.in index 561dd956..f2298b7a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -33,7 +33,7 @@ PROGS = $(IRCD_EXE) 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@ diff --git a/ssld/Makefile.in b/ssld/Makefile.in index 7d103aec..3b49f840 100644 --- a/ssld/Makefile.in +++ b/ssld/Makefile.in @@ -20,13 +20,14 @@ RM = @RM@ 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@