Commit d6771ba9 authored by Eddie Kohler's avatar Eddie Kohler

Configury: Check for clock_gettime function as well as declaration.

Hopefully this helps Roberto Riggio.
parent 72ec9152
......@@ -7507,7 +7507,7 @@ _ACEOF
fi
have_clock_gettime=no; POSIX_CLOCK_LIBS=
have_clock_gettime=yes; POSIX_CLOCK_LIBS=
ac_fn_cxx_check_decl "$LINENO" "clock_gettime" "ac_cv_have_decl_clock_gettime" "#ifdef HAVE_TIME_H
# include <time.h>
#endif
......@@ -7576,17 +7576,28 @@ $as_echo "$ac_cv_search_clock_gettime" >&6; }
ac_res=$ac_cv_search_clock_gettime
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
have_clock_gettime=yes
:
else
have_clock_gettime=no
fi
if test "x$have_clock_gettime" = xyes; then
$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
POSIX_CLOCK_LIBS="$LIBS"
fi
ac_fn_cxx_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
if test "x$ac_cv_func_clock_gettime" = x""yes; then :
:
else
have_clock_gettime=no
fi
LIBS="$SAVELIBS"
if test "x$have_clock_gettime" = xyes; then
$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
fi
# Check whether --enable-nanotimestamp was given.
......
......@@ -797,16 +797,19 @@ dnl POSIX_CLOCK_LIBS.
dnl
AC_DEFUN([CLICK_CHECK_POSIX_CLOCKS], [
have_clock_gettime=no; POSIX_CLOCK_LIBS=
have_clock_gettime=yes; POSIX_CLOCK_LIBS=
AC_CHECK_DECLS([clock_gettime], [], [], [#ifdef HAVE_TIME_H
# include <time.h>
#endif])
SAVELIBS="$LIBS"
AC_SEARCH_LIBS([clock_gettime], [rt], [have_clock_gettime=yes])
AC_SEARCH_LIBS([clock_gettime], [rt], [:], [have_clock_gettime=no])
if test "x$have_clock_gettime" = xyes; then
AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have the clock_gettime function.])
POSIX_CLOCK_LIBS="$LIBS"
fi
AC_SUBST(POSIX_CLOCK_LIBS)
AC_CHECK_FUNC([clock_gettime], [:], [have_clock_gettime=no])
LIBS="$SAVELIBS"
if test "x$have_clock_gettime" = xyes; then
AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Define if you have the clock_gettime function.])
fi
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment