summaryrefslogtreecommitdiffstats
path: root/build/linux/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'build/linux/configure.ac')
-rw-r--r--build/linux/configure.ac28
1 files changed, 28 insertions, 0 deletions
diff --git a/build/linux/configure.ac b/build/linux/configure.ac
index f99c4d3..cbf6016 100644
--- a/build/linux/configure.ac
+++ b/build/linux/configure.ac
@@ -31,6 +31,7 @@ LT_INIT([disable-static])
SAVED_CPPFLAGS="$CPPFLAGS"
SAVED_CXXFLAGS="$CXXFLAGS"
SAVED_LDFLAGS="$LDFLAGS"
+SAVED_LIBS="$LIBS"
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
@@ -47,6 +48,32 @@ dnl Use iostream to check if the C++ compiler works
AC_CHECK_HEADER(iostream, , AC_MSG_ERROR([No working c++ compiler found]))
+# clock_gettime
+
+AC_MSG_CHECKING([for clock_gettime])
+AC_TRY_LINK([
+#include <ctime>
+],[
+struct timespec t; clock_gettime(CLOCK_REALTIME, &t);
+],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no)
+AC_MSG_RESULT($astra_clock_gettime_ok)
+if test x$astra_clock_gettime_ok = xno; then
+ AC_MSG_CHECKING([for clock_gettime in librt])
+ LIBS="$LIBS -lrt"
+ AC_TRY_LINK([
+ #include <ctime>
+ ],[
+ struct timespec t; clock_gettime(CLOCK_REALTIME, &t);
+ ],astra_clock_gettime_ok=yes,astra_clock_gettime_ok=no)
+ AC_MSG_RESULT($astra_clock_gettime_ok)
+ if test x$astra_clock_gettime_ok = xno; then
+ AC_MSG_ERROR([No clock_gettime found])
+ else
+ SAVED_LIBS="$SAVED_LIBS -lrt"
+ fi
+fi
+
+
# boost-unit-test-framework
AC_MSG_CHECKING([for boost-unit-test-framework])
@@ -179,6 +206,7 @@ AC_SUBST(HAVEMATLAB)
AC_SUBST(SAVED_CPPFLAGS)
AC_SUBST(SAVED_CXXFLAGS)
AC_SUBST(SAVED_LDFLAGS)
+AC_SUBST(SAVED_LIBS)
AC_CONFIG_FILES([Makefile])