]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
no unnecessary linking with librt.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 13 May 2008 14:01:23 +0000 (14:01 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 13 May 2008 14:01:23 +0000 (14:01 +0000)
git-svn-id: file:///svn/unbound/trunk@1081 be551aaa-1e26-0410-a405-d3ace91eadb9

configure
configure.ac
doc/Changelog

index 261ea580e8a44c538a283ec57b3fd7d63d5c84ad..49666fa7287d613f28f7c05ca76225b6322672a3 100755 (executable)
--- a/configure
+++ b/configure
@@ -21932,8 +21932,71 @@ if test "$ac_res" != no; then
 
 fi
 
-# check for library used by libevent after 1.3c
-{ echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
+
+# check for libevent
+
+# Check whether --with-libevent was given.
+if test "${with_libevent+set}" = set; then
+  withval=$with_libevent;
+else
+   withval="no"
+fi
+
+if test x_$withval == x_yes -o x_$withval != x_no; then
+        { echo "$as_me:$LINENO: checking for libevent" >&5
+echo $ECHO_N "checking for libevent... $ECHO_C" >&6; }
+        if test x_$withval = x_ -o x_$withval = x_yes; then
+            withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr"
+        fi
+        for dir in $withval; do
+            thedir="$dir"
+            if test -f "$dir/include/event.h"; then
+                found_libevent="yes"
+                CPPFLAGS="$CPPFLAGS -I$thedir/include"
+                break;
+            fi
+        done
+        if test x_$found_libevent != x_yes; then
+               if test -f "$dir/event.h" -a \( -f "$dir/libevent.la" -o -f "$dir/libev.la" \) ; then
+                       # libevent source directory
+                       { echo "$as_me:$LINENO: result: found in $thedir" >&5
+echo "${ECHO_T}found in $thedir" >&6; }
+                       CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include"
+                       BAK_LDFLAGS="$LDFLAGS"
+                       # remove evdns from linking
+                       mkdir build >/dev/null 2>&1
+                       mkdir build/libevent >/dev/null 2>&1
+                       mkdir build/libevent/.libs >/dev/null 2>&1
+                       ev_files_o=`ls $thedir/*.o | grep -v evdns\.o`
+                       ev_files_lo=`ls $thedir/*.lo | grep -v evdns\.lo`
+                       ev_files_libso=`ls $thedir/.libs/*.o | grep -v evdns\.o`
+                       cp $ev_files_o build/libevent
+                       cp $ev_files_lo build/libevent
+                       cp $ev_files_libso build/libevent/.libs
+                       LATE_LDFLAGS="build/libevent/*.lo -lm"
+                       LDFLAGS="build/libevent/*.o $LDFLAGS -lm"
+               else
+                       { { echo "$as_me:$LINENO: error: Cannot find the libevent library in $withval
+You can restart ./configure --with-libevent=no to use a builtin alternative.
+Please note that this alternative is not as capable as libevent when using
+large outgoing port ranges.  " >&5
+echo "$as_me: error: Cannot find the libevent library in $withval
+You can restart ./configure --with-libevent=no to use a builtin alternative.
+Please note that this alternative is not as capable as libevent when using
+large outgoing port ranges.  " >&2;}
+   { (exit 1); exit 1; }; }
+               fi
+        else
+            { echo "$as_me:$LINENO: result: found in $thedir" >&5
+echo "${ECHO_T}found in $thedir" >&6; }
+            LDFLAGS="$LDFLAGS -L$thedir/lib"
+           if test "x$enable_rpath" = xyes; then
+               RUNTIME_PATH="$RUNTIME_PATH -R$thedir/lib"
+           fi
+        fi
+
+       # check for library used by libevent after 1.3c
+       { echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5
 echo $ECHO_N "checking for library containing clock_gettime... $ECHO_C" >&6; }
 if test "${ac_cv_search_clock_gettime+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -22017,68 +22080,6 @@ if test "$ac_res" != no; then
 fi
 
 
-# check for libevent
-
-# Check whether --with-libevent was given.
-if test "${with_libevent+set}" = set; then
-  withval=$with_libevent;
-else
-   withval="no"
-fi
-
-if test x_$withval == x_yes -o x_$withval != x_no; then
-        { echo "$as_me:$LINENO: checking for libevent" >&5
-echo $ECHO_N "checking for libevent... $ECHO_C" >&6; }
-        if test x_$withval = x_ -o x_$withval = x_yes; then
-            withval="/usr/local /opt/local /usr/lib /usr/pkg /usr/sfw /usr"
-        fi
-        for dir in $withval; do
-            thedir="$dir"
-            if test -f "$dir/include/event.h"; then
-                found_libevent="yes"
-                CPPFLAGS="$CPPFLAGS -I$thedir/include"
-                break;
-            fi
-        done
-        if test x_$found_libevent != x_yes; then
-               if test -f "$dir/event.h" -a \( -f "$dir/libevent.la" -o -f "$dir/libev.la" \) ; then
-                       # libevent source directory
-                       { echo "$as_me:$LINENO: result: found in $thedir" >&5
-echo "${ECHO_T}found in $thedir" >&6; }
-                       CPPFLAGS="$CPPFLAGS -I$thedir -I$thedir/include"
-                       BAK_LDFLAGS="$LDFLAGS"
-                       # remove evdns from linking
-                       mkdir build >/dev/null 2>&1
-                       mkdir build/libevent >/dev/null 2>&1
-                       mkdir build/libevent/.libs >/dev/null 2>&1
-                       ev_files_o=`ls $thedir/*.o | grep -v evdns\.o`
-                       ev_files_lo=`ls $thedir/*.lo | grep -v evdns\.lo`
-                       ev_files_libso=`ls $thedir/.libs/*.o | grep -v evdns\.o`
-                       cp $ev_files_o build/libevent
-                       cp $ev_files_lo build/libevent
-                       cp $ev_files_libso build/libevent/.libs
-                       LATE_LDFLAGS="build/libevent/*.lo -lm"
-                       LDFLAGS="build/libevent/*.o $LDFLAGS -lm"
-               else
-                       { { echo "$as_me:$LINENO: error: Cannot find the libevent library in $withval
-You can restart ./configure --with-libevent=no to use a builtin alternative.
-Please note that this alternative is not as capable as libevent when using
-large outgoing port ranges.  " >&5
-echo "$as_me: error: Cannot find the libevent library in $withval
-You can restart ./configure --with-libevent=no to use a builtin alternative.
-Please note that this alternative is not as capable as libevent when using
-large outgoing port ranges.  " >&2;}
-   { (exit 1); exit 1; }; }
-               fi
-        else
-            { echo "$as_me:$LINENO: result: found in $thedir" >&5
-echo "${ECHO_T}found in $thedir" >&6; }
-            LDFLAGS="$LDFLAGS -L$thedir/lib"
-           if test "x$enable_rpath" = xyes; then
-               RUNTIME_PATH="$RUNTIME_PATH -R$thedir/lib"
-           fi
-        fi
-
        { echo "$as_me:$LINENO: checking for library containing event_set" >&5
 echo $ECHO_N "checking for library containing event_set... $ECHO_C" >&6; }
 if test "${ac_cv_search_event_set+set}" = set; then
index 308677c44bc41f57a7f8b47b57315bb1ccc19ea4..1e7fabfa6ffe4f3531845f92c97f1de39ad8c0ea 100644 (file)
@@ -506,8 +506,6 @@ fi
 # check to see if libraries are needed for these functions.
 AC_SEARCH_LIBS([inet_pton], [nsl])
 AC_SEARCH_LIBS([socket], [socket])
-# check for library used by libevent after 1.3c
-AC_SEARCH_LIBS([clock_gettime], [rt])
 
 # check for libevent
 AC_ARG_WITH(libevent, AC_HELP_STRING([--with-libevent=pathname],
@@ -558,6 +556,9 @@ large outgoing port ranges.  ])
            fi
         fi
        AC_SUBST(RUNTIME_PATH)
+       # check for library used by libevent after 1.3c
+       AC_SEARCH_LIBS([clock_gettime], [rt])
+
        AC_SEARCH_LIBS(event_set, [event])
        AC_CHECK_HEADERS([event.h],,, [AC_INCLUDES_DEFAULT])
        AC_CHECK_FUNCS([event_base_free]) # only in libevent 1.2 and later
index 9e62f6d0dd0d53ee4b67af4b3eb08cec31a424aa..4577f2932385c328ac77507bd3af3b40d6094000 100644 (file)
@@ -2,6 +2,7 @@
        - Added root ipv6 addresses to builtin root hints.
        - TODO modified for post 1.0 plans.
        - trunk version set to 1.0.0.
+       - no unnecessary linking with librt (only when libevent/libev used).
 
 7 May 2008: Wouter
        - fixup no-ip4 problem with error callback in outside network.