fi
])
+dnl Add a -R to the RUNTIME_PATH. Only if rpath is enabled and it is
+dnl an absolute path.
+dnl $1: the pathname to add.
+AC_DEFUN([ACX_RUNTIME_PATH_ADD], [
+ if test "x$enable_rpath" = xyes; then
+ if echo "$1" | grep "^/" >/dev/null; then
+ RUNTIME_PATH="$RUNTIME_PATH -R$1"
+ fi
+ fi
+])
+
dnl Check for SSL.
dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS.
dnl assume /usr is already in the lib and dynlib paths.
if test "$ssldir" != "/usr"; then
LDFLAGS="$LDFLAGS -L$ssldir/lib"
- if test "x$enable_rpath" = xyes; then
- RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib"
- fi
+ ACX_RUNTIME_PATH_ADD([$ssldir/lib])
fi
AC_MSG_CHECKING([for HMAC_CTX_init in -lcrypto])
HAVE_SSL=yes
if test "$ssldir" != "/usr"; then
LDFLAGS="$LDFLAGS -L$ssldir/lib"
- if test "x$enable_rpath" = xyes; then
- RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib"
- fi
+
+ if test "x$enable_rpath" = xyes; then
+ if echo "$ssldir/lib" | grep "^/" >/dev/null; then
+ RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib"
+ fi
+ fi
+
fi
{ $as_echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5
fi
+
+
# check for libevent
# Check whether --with-libevent was given.
{ $as_echo "$as_me:$LINENO: result: found in $thedir" >&5
$as_echo "found in $thedir" >&6; }
CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include"
+ BAK_LDFLAGS_SET="1"
BAK_LDFLAGS="$LDFLAGS"
# remove evdns from linking
mkdir build >/dev/null 2>&1
$as_echo "found in $thedir" >&6; }
if test "$thedir" != "/usr"; then
LDFLAGS="$LDFLAGS -L$thedir/lib"
- if test "x$enable_rpath" = xyes; then
- RUNTIME_PATH="$RUNTIME_PATH -R$thedir/lib"
- fi
+
+ if test "x$enable_rpath" = xyes; then
+ if echo "$thedir/lib" | grep "^/" >/dev/null; then
+ RUNTIME_PATH="$RUNTIME_PATH -R$thedir/lib"
+ fi
+ fi
+
fi
fi
-
# check for library used by libevent after 1.3c
{ $as_echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
$as_echo_n "checking for library containing clock_gettime... " >&6; }
fi
done
# only in libev. (tested on 3.51)
- if test -n "$BAK_LDFLAGS"; then
+ if test -n "$BAK_LDFLAGS_SET"; then
LDFLAGS="$BAK_LDFLAGS"
fi
else
withval=$with_ldns; specialldnsdir="$withval"
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval -L$withval/lib $LDFLAGS"
+
if test "x$enable_rpath" = xyes; then
- RUNTIME_PATH="$RUNTIME_PATH -R$withval/lib"
+ if echo "$withval/lib" | grep "^/" >/dev/null; then
+ RUNTIME_PATH="$RUNTIME_PATH -R$withval/lib"
+ fi
fi
+
ldnsdir="$withval"
AC_SEARCH_LIBS([inet_pton], [nsl])
AC_SEARCH_LIBS([socket], [socket])
+AC_SUBST(RUNTIME_PATH)
+
# check for libevent
AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
[use libevent (will check /usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr or you can specify an explicit path). Slower, but allows use of large outgoing port ranges.]),
# libevent source directory
AC_MSG_RESULT(found in $thedir)
CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include"
+ BAK_LDFLAGS_SET="1"
BAK_LDFLAGS="$LDFLAGS"
# remove evdns from linking
mkdir build >/dev/null 2>&1
dnl assume /usr is in default path.
if test "$thedir" != "/usr"; then
LDFLAGS="$LDFLAGS -L$thedir/lib"
- if test "x$enable_rpath" = xyes; then
- RUNTIME_PATH="$RUNTIME_PATH -R$thedir/lib"
- fi
+ ACX_RUNTIME_PATH_ADD([$thedir/lib])
fi
fi
- AC_SUBST(RUNTIME_PATH)
# check for library used by libevent after 1.3c
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CHECK_FUNCS([event_base_new]) # only in libevent 1.4.1 and later
AC_CHECK_FUNCS([event_base_get_method]) # only in libevent 1.4.3 and later
AC_CHECK_FUNCS([ev_loop]) # only in libev. (tested on 3.51)
- if test -n "$BAK_LDFLAGS"; then
+ if test -n "$BAK_LDFLAGS_SET"; then
LDFLAGS="$BAK_LDFLAGS"
fi
else
[ specialldnsdir="$withval"
CPPFLAGS="-I$withval/include $CPPFLAGS"
LDFLAGS="-L$withval -L$withval/lib $LDFLAGS"
- if test "x$enable_rpath" = xyes; then
- RUNTIME_PATH="$RUNTIME_PATH -R$withval/lib"
- fi
+ ACX_RUNTIME_PATH_ADD([$withval/lib])
ldnsdir="$withval"
AC_SUBST(ldnsdir)
])
+30 March 2009: Wouter
+ - Fixup LDFLAGS from libevent sourcedir compile configure restore.
+ - Fixup so no non-absolute rpaths are added.
+
27 March 2009: Wouter
- nicer -h output. report linked libraries and modules.
- prints modules in intuitive order (config file friendly).