aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2011-03-30 10:03:32 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:22 +0100
commit1c3c106f4690a45eedc5304e9c7eea6ce95747e3 (patch)
tree38d545ecfb2077d866cc67afae2403a15adc2705 /configure.ac
parentcc16ae635d42789aaaf24444d0cd45cd824acebe (diff)
indexamajig: Add fallback for clock_gettime()
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 13 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 83078536..eaac7a4b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,6 +219,16 @@ AC_CHECK_LIB([pthread], [sched_setaffinity], [
])
+AC_CHECK_LIB([rt], [clock_gettime], [
+ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
+ [Define to 1 if clock_gettime is available.])
+ TIMER_LIBS="-lrt"
+], [
+ AC_MSG_WARN([Falling back on gettimeofday().])
+ AC_MSG_WARN([Time intervals may not be correct in certain circumstances.])
+])
+
+
dnl Conditionals...
AM_CONDITIONAL([HAVE_OPENCL], test x$have_opencl = xtrue)
@@ -236,9 +246,10 @@ gl_IGNORE_UNUSED_LIBRARIES
CFLAGS="$CFLAGS $HDF5_CFLAGS $GSL_CFLAGS $OPENCL_CFLAGS -pthread $GTK_CFLAGS"
CFLAGS="$CFLAGS $LIBTIFF_CFLAGS -D_GNU_SOURCE $libPNG_CFLAGS $Cairo_CFLAGS"
CFLAGS="$CFLAGS $GDK_pixbuf_CFLAGS $GDK_pixbuf_2_CFLAGS"
-LIBS="$LIBS $HDF5_LIBS -lm -lz $GSL_LIBS $GTK_LIBS $OPENCL_LIBS -pthread -lrt"
+
+LIBS="$LIBS $HDF5_LIBS -lm -lz $GSL_LIBS $GTK_LIBS $OPENCL_LIBS -pthread"
LIBS="$LIBS $LIBTIFF_LIBS $libPNG_LIBS $Cairo_LIBS $GDK_pixbuf_LIBS"
-LIBS="$LIBS $GDK_pixbuf_2_LIBS $LDFLAGS"
+LIBS="$LIBS $GDK_pixbuf_2_LIBS $TIMER_LIBS $LDFLAGS"
GTK_DOC_CHECK([1.11],[--flavour no-tmpl])