Module Name: src
Committed By: pooka
Date: Wed Nov 5 01:40:30 UTC 2014
Modified Files:
src/lib/librumpuser: configure configure.ac rumpuser_config.h.in
Log Message:
check for clock_gettime from librt too
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/librumpuser/configure \
src/lib/librumpuser/configure.ac src/lib/librumpuser/rumpuser_config.h.in
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/librumpuser/configure
diff -u src/lib/librumpuser/configure:1.2 src/lib/librumpuser/configure:1.3
--- src/lib/librumpuser/configure:1.2 Wed Nov 5 00:50:17 2014
+++ src/lib/librumpuser/configure Wed Nov 5 01:40:30 2014
@@ -3793,7 +3793,7 @@ fi
for ac_func in kqueue chflags strsuftoll setprogname getprogname \
- clock_gettime getenv_r posix_memalign memalign aligned_alloc \
+ getenv_r posix_memalign memalign aligned_alloc \
arc4random_buf getsubopt fsync_range __quotactl
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -3877,6 +3877,74 @@ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} 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 clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_rt_clock_gettime=yes
+else
+ ac_cv_lib_rt_clock_gettime=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_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+else
+ 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 clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_nanosleep in -lrt" >&5
$as_echo_n "checking for clock_nanosleep in -lrt... " >&6; }
if ${ac_cv_lib_rt_clock_nanosleep+:} false; then :
Index: src/lib/librumpuser/configure.ac
diff -u src/lib/librumpuser/configure.ac:1.2 src/lib/librumpuser/configure.ac:1.3
--- src/lib/librumpuser/configure.ac:1.2 Wed Nov 5 00:50:17 2014
+++ src/lib/librumpuser/configure.ac Wed Nov 5 01:40:30 2014
@@ -27,12 +27,16 @@ AC_CANONICAL_TARGET
AC_CHECK_TYPES([clockid_t, register_t])
AC_CHECK_FUNCS([kqueue chflags strsuftoll setprogname getprogname \
- clock_gettime getenv_r posix_memalign memalign aligned_alloc \
+ getenv_r posix_memalign memalign aligned_alloc \
arc4random_buf getsubopt fsync_range __quotactl])
AC_TRY_LINK_FUNC([clock_nanosleep],,
AC_CHECK_LIB([rt], [clock_nanosleep])
)
+AC_CHECK_LIB([rt], [clock_gettime],
+ AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [clock_gettime]),
+ AC_TRY_LINK_FUNC([clock_gettime],
+ AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [clock_gettime])))
AC_CHECK_LIB([rt], [clock_nanosleep],
AC_DEFINE([HAVE_CLOCK_NANOSLEEP], 1, [clock_nanosleep]),
AC_TRY_LINK_FUNC([clock_nanosleep],
Index: src/lib/librumpuser/rumpuser_config.h.in
diff -u src/lib/librumpuser/rumpuser_config.h.in:1.2 src/lib/librumpuser/rumpuser_config.h.in:1.3
--- src/lib/librumpuser/rumpuser_config.h.in:1.2 Wed Nov 5 00:50:17 2014
+++ src/lib/librumpuser/rumpuser_config.h.in Wed Nov 5 01:40:30 2014
@@ -12,7 +12,7 @@
/* Define to 1 if the system has the type `clockid_t'. */
#undef HAVE_CLOCKID_T
-/* Define to 1 if you have the `clock_gettime' function. */
+/* clock_gettime */
#undef HAVE_CLOCK_GETTIME
/* clock_nanosleep */