diff options
author | Thomas Habets <thomas@habets.se> | 2011-10-31 23:57:00 +0000 |
---|---|---|
committer | Thomas Habets <thomas@habets.se> | 2011-11-01 00:02:25 +0000 |
commit | 1e01eb02c67122c5113afc164c97772a6054456c (patch) | |
tree | adb69b62798a0b0966d6adfd28496082eb5ad2d9 /configure.ac | |
parent | 8e4a0717bcaa7c8d45e2065220736ac4053d3c99 (diff) | |
parent | 91e1da907d9024dd2be06151fc23f3542d896f05 (diff) | |
download | arping-1e01eb02c67122c5113afc164c97772a6054456c.tar.gz |
Merge from mainline
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 0f43c28..843c9fb 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,7 @@ AC_CHECK_LIB([net], [libnet_name_resolve], [AC_MSG_ERROR([libnet 1.0.x found. Arping 2.x requires libnet 1.1.x])]) AC_CHECK_LIB([net], [libnet_init], ,[AC_MSG_ERROR([libnet 1.1.x not found])]) AC_CHECK_LIB([pcap], [pcap_open_live], ,[AC_MSG_ERROR([libpcap not found])]) +AC_SEARCH_LIBS([clock_gettime], [rt]) # Checks for header files. AC_HEADER_STDC @@ -31,6 +32,7 @@ arpa/inet.h \ netinet/in.h \ stdlib.h \ sys/socket.h \ +time.h \ sys/time.h \ sys/types.h \ stdint.h \ @@ -64,13 +66,36 @@ case "$target_os" in *linux*) AC_LIBOBJ([findif_linux]) ;; - *freebsd*|*openbsd*|*solaris*) + *freebsd*|*openbsd*|*solaris*|*darwin*) AC_LIBOBJ([findif_bsd]) ;; *) AC_LIBOBJ([findif_other]) ;; esac + + + +# 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) +if test x$ac_cv_have_clock_monotonic = xyes; then + AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1], [Monotonic clock]) +fi + AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([src/Makefile]) AC_CONFIG_FILES([doc/Makefile]) |