]> granicus.if.org Git - sudo/commitdiff
Fix clock_gettime() detection when it lives in librt.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 2 Feb 2014 15:34:53 +0000 (08:34 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 2 Feb 2014 15:34:53 +0000 (08:34 -0700)
Some systems have inet_aton() in libresolv (older Solaris).

configure
configure.ac

index 8547fa417523a1c1273e3b4b4ff0be90591c4773..d1a6def876b98f46da1bfa2caf3873e68099b0c8 100755 (executable)
--- a/configure
+++ b/configure
@@ -1703,7 +1703,7 @@ Optional Packages:
   --without-interfaces    don't try to read the ip addr of ether interfaces
   --with-stow             deprecated
   --with-askpass=PATH     Fully qualified pathname of askpass helper
-  --with-plugindir        set directory to load plugins from
+  --with-plugindir=DIR    set directory to load plugins from
   --with-man              manual pages use man macros
   --with-mdoc             manual pages use mdoc macros
   --with-selinux          enable SELinux support
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
 if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
-  SUDOERS_LIBS="${SUDOERS_LIBS} -lrt"
+
+       $as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+       SUDOERS_LIBS="${SUDOERS_LIBS} -lrt"
+
 else
   case " $LIBOBJS " in
   *" clock_gettime.$ac_objext "* ) ;;
@@ -18603,7 +18607,7 @@ if test "x$ac_cv_func_inet_aton" = xyes; then :
 
 else
 
-    for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
+    for libs in "-lsocket" "-linet" "-lsocket -lnsl" "-lresolv"; do
        _libs=
        for lib in $libs; do
            case "$NET_LIBS" in
index 091292b44a6ed2e39e5e75b91a98d9b967b111ab..4657409ef47c7b01afe99b357dcb01fa75a83c53 100644 (file)
@@ -2409,7 +2409,10 @@ SUDO_FUNC_ISBLANK
 AC_REPLACE_FUNCS(memrchr memset_s pw_dup strlcpy strlcat strtonum)
 AC_CHECK_FUNCS(clock_gettime, [], [
     # On Solaris, clock_gettime is in librt
-    AC_CHECK_LIB(rt, clock_gettime, [SUDOERS_LIBS="${SUDOERS_LIBS} -lrt"], [AC_LIBOBJ(clock_gettime)])
+    AC_CHECK_LIB(rt, clock_gettime, [
+       AC_DEFINE(HAVE_CLOCK_GETTIME)
+       SUDOERS_LIBS="${SUDOERS_LIBS} -lrt"
+    ], [AC_LIBOBJ(clock_gettime)])
 ])
 AC_CHECK_FUNCS(getopt_long, [], [AC_LIBOBJ(getopt_long)
     AC_MSG_CHECKING([for optreset])
@@ -2526,9 +2529,10 @@ AC_CHECK_FUNC(socket, [], [
 dnl
 dnl If inet_aton(3) not in libc, check -lnsl and -linet
 dnl May need to link with *both* -lnsl and -lsocket due to unresolved symbols
+dnl Some systems have inet_aton() in libresolv (older Solaris).
 dnl
 AC_CHECK_FUNC(inet_aton, [], [
-    for libs in "-lsocket" "-linet" "-lsocket -lnsl"; do
+    for libs in "-lsocket" "-linet" "-lsocket -lnsl" "-lresolv"; do
        _libs=
        for lib in $libs; do
            case "$NET_LIBS" in