]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
configure fixes.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 30 Mar 2009 08:47:20 +0000 (08:47 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 30 Mar 2009 08:47:20 +0000 (08:47 +0000)
git-svn-id: file:///svn/unbound/trunk@1564 be551aaa-1e26-0410-a405-d3ace91eadb9

acx_nlnetlabs.m4
configure
configure.ac
doc/Changelog

index 0d91b16d473a0458088d11410892726fdeaeeb4c..314784ff0bfe5896bc9c3ee9f7a75a31ae9c5880 100644 (file)
@@ -539,6 +539,17 @@ if test "x$enable_rpath" = xno; then
 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. 
@@ -580,9 +591,7 @@ AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname],
            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])
index 1a154072c100c444296ba0d673e1905ecf22db8e..558df48678e312684dbedc9a47e2dfc0cc7867b2 100755 (executable)
--- a/configure
+++ b/configure
@@ -23449,9 +23449,13 @@ $as_echo "found in $ssldir" >&6; }
             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
@@ -25151,6 +25155,8 @@ if test "$ac_res" != no; then
 fi
 
 
+
+
 # check for libevent
 
 # Check whether --with-libevent was given.
@@ -25182,6 +25188,7 @@ $as_echo_n "checking for libevent... " >&6; }
                        { $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
@@ -25211,12 +25218,15 @@ large outgoing port ranges.  " >&2;}
 $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; }
@@ -25954,7 +25964,7 @@ _ACEOF
 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
@@ -29207,9 +29217,13 @@ if test "${with_ldns+set}" = set; then
   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"
 
 
index 04fb9bc0028c26ad6180c6350205b5352ed5daf0..e1ca0bdf32a2510c7e2a9a7dc7fa3129d299136e 100644 (file)
@@ -346,6 +346,8 @@ fi
 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.]),
@@ -371,6 +373,7 @@ if test x_$withval = x_yes -o x_$withval != x_no; then
                        # 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
@@ -395,12 +398,9 @@ large outgoing port ranges.  ])
            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])
 
@@ -411,7 +411,7 @@ large outgoing port ranges.  ])
        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
@@ -498,9 +498,7 @@ AC_ARG_WITH(ldns, AC_HELP_STRING([--with-ldns=PATH],
        [ 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)
 ])
index 4774dd95156b4f817d7d228f7e42a247b0603712..41e3a1221db1e8b4b6dba4521297497f73ff6121 100644 (file)
@@ -1,3 +1,7 @@
+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).