From 49e3b25b41c934ca6945d94de98d747fa5cc9922 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 25 Nov 2001 00:22:19 +0000 Subject: [PATCH] (AC_CHECK_FUNCS): Add gettimeofday, clock_gettime. (LIB_CLOCK_GETTIME): New subst. --- configure.ac | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cf0595c..0ecf62e 100644 --- a/configure.ac +++ b/configure.ac @@ -51,7 +51,7 @@ AC_STRUCT_ST_RDEV AC_TYPE_PID_T AC_TYPE_SIGNAL -AC_CHECK_FUNCS(diraccess dup2 \ +AC_CHECK_FUNCS(diraccess dup2 gettimeofday \ sigaction sigprocmask strchr strerror tmpnam) AC_REPLACE_FUNCS(memchr mkstemp strcasecmp waitpid) if test $ac_cv_func_mkstemp != yes; then @@ -74,6 +74,16 @@ jm_PREREQ_TEMPNAME # it uses. jm_AC_PREREQ_XSTRTOUMAX +# Check for clock_gettime and its library. Solaris puts it in -lrt or +# -lposix4, but we don't want to link that library unless we have to. +diff_saved_libs=$LIBS +AC_SEARCH_LIBS(clock_gettime, [rt posix4], + [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime], + [LIB_CLOCK_GETTIME=]) +AC_SUBST([LIB_CLOCK_GETTIME]) +AC_CHECK_FUNCS(clock_gettime) +LIBS=$diff_saved_libs + # fnmatch AC_FUNC_FNMATCH if test $ac_cv_func_fnmatch_works = yes; then