Skip to content

Commit

Permalink
fixed autotools stuff wrt monotonic clock
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHabets committed Nov 20, 2010
1 parent f36dc37 commit 36ae031
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
24 changes: 24 additions & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# check for clock_gettime(CLOCK_MONOTONIC, ...)
AC_DEFUN([EL_CLOCK_MONOTONIC],
[
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_CACHE_CHECK([for CLOCK_MONOTONIC],
ac_cv_have_clock_monotonic,
[
AC_TRY_RUN(
[
#include <time.h>
int main() {
struct timespec ts;
exit(!!clock_gettime(CLOCK_MONOTONIC, &ts));
}
],
[ ac_cv_have_clock_monotonic="yes"],
[ ac_cv_have_clock_monotonic="no" ]
)
])
AM_CONDITIONAL(HAVE_CLOCK_MONOTONIC, test x$ac_cv_have_clock_monotonic = xyes)
if test x$ac_cv_have_clock_monotonic = xyes; then
AC_DEFINE([HAVE_CLOCK_MONOTONIC], 1, [Have symbol CLOCK_MONOTONIC])
fi
])
21 changes: 3 additions & 18 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_C_VOLATILE

EL_CLOCK_MONOTONIC

# Checks for library functions.
#AC_FUNC_MALLOC
AC_TYPE_SIGNAL
Expand All @@ -51,7 +53,7 @@ AC_DECL_H_ERRNO
AC_TYPE_SOCKLEN_T
AC_TYPE_IN_PORT_T
AC_CHECK_FUNCS(getaddrinfo getnameinfo)
if test "$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != yesyes ; then
if test x"$ac_cv_func_getaddrinfo$ac_cv_func_getnameinfo" != xyesyes ; then
AC_LIBOBJ(getaddrinfo)
fi

Expand Down Expand Up @@ -107,23 +109,6 @@ exit(0);
])
AM_CONDITIONAL(HAVE_MSG_ERRQUEUE, test x$ac_cv_have_msg_errqueue = xyes)

# check for CLOCK_MONOTONIC
AC_CACHE_CHECK([for CLOCK_MONOTONIC],
ac_cv_have_clock_monotonic, [
AC_TRY_RUN(
[
#include <time.h>
int main() {
struct timespec ts;
exit(!!clock_gettime(CLOCK_MONOTONIC, &ts));
}
],
[ ac_cv_have_clock_monotonic="yes" ],
[ ac_cv_have_clock_monotonic="no" ]
)
])
AM_CONDITIONAL(HAVE_CLOCK_MONOTONIC, test x$ac_cv_have_CLOCK_MONOTONIC = xyes)

AM_CONDITIONAL(HAVE_IFADDRS_H, test x$ac_cv_header_ifaddrs_h = xyes)


Expand Down

0 comments on commit 36ae031

Please sign in to comment.