summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2016-10-19 14:54:05 +0200
committerFrancis Dupont <fdupont@isc.org>2016-10-19 14:54:05 +0200
commit047719bc0e959be62793296e4dfda848a8144e1d (patch)
treeca7ed04e34d506a95afc498714e0a2ff5a281177
parentfe1319546966cf456dc5a2cbda209636b36e37cf (diff)
parentf6d4c27f49cfe5c411e6388333e7db6917a60560 (diff)
downloadisc-dhcp-047719bc0e959be62793296e4dfda848a8144e1d.tar.gz
Merged rt43417 (nanosleep requires -lrt)
-rwxr-xr-xconfigure53
-rw-r--r--configure.ac10
2 files changed, 63 insertions, 0 deletions
diff --git a/configure b/configure
index 5fce52b7..6d8c1a9e 100755
--- a/configure
+++ b/configure
@@ -6686,6 +6686,59 @@ if test "$ac_res" != no; then :
fi
+# For some Solaris nanosleep is found by BIND in librt
+have_nanosleep="no"
+ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep"
+if test "x$ac_cv_func_nanosleep" = xyes; then :
+ have_nanosleep="yes"
+fi
+
+if test "$have_nanosleep" = "no"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nanosleep in -lrt" >&5
+$as_echo_n "checking for nanosleep in -lrt... " >&6; }
+if ${ac_cv_lib_rt_nanosleep+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nanosleep ();
+int
+main ()
+{
+return nanosleep ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_nanosleep=yes
+else
+ ac_cv_lib_rt_nanosleep=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_nanosleep" >&5
+$as_echo "$ac_cv_lib_rt_nanosleep" >&6; }
+if test "x$ac_cv_lib_rt_nanosleep" = xyes; then :
+ have_nanosleep="rt"
+fi
+
+fi
+if test "$have_nanosleep" = "rt"; then
+ LIBS="-lrt $LIBS"
+fi
+
# check for /dev/random (declares HAVE_DEV_RANDOM)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for random device" >&5
$as_echo_n "checking for random device... " >&6; }
diff --git a/configure.ac b/configure.ac
index 7f199a84..2a1cc150 100644
--- a/configure.ac
+++ b/configure.ac
@@ -612,6 +612,16 @@ AC_CHECK_FUNCS(strlcat)
# For HP/UX we need -lipv6 for if_nametoindex, perhaps others.
AC_SEARCH_LIBS(if_nametoindex, [ipv6])
+# For some Solaris nanosleep is found by BIND in librt
+have_nanosleep="no"
+AC_CHECK_FUNC(nanosleep, have_nanosleep="yes")
+if test "$have_nanosleep" = "no"; then
+ AC_CHECK_LIB(rt, nanosleep, have_nanosleep="rt")
+fi
+if test "$have_nanosleep" = "rt"; then
+ LIBS="-lrt $LIBS"
+fi
+
# check for /dev/random (declares HAVE_DEV_RANDOM)
AC_MSG_CHECKING(for random device)
AC_ARG_WITH(randomdev,