diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/linux/Makefile.in | 3 | ||||
-rw-r--r-- | build/linux/configure.ac | 28 |
2 files changed, 30 insertions, 1 deletions
diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 685e1e5..5b4c9fa 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -19,10 +19,11 @@ VPATH=../.. CPPFLAGS=@SAVED_CPPFLAGS@ CXXFLAGS=@SAVED_CXXFLAGS@ LDFLAGS=@SAVED_LDFLAGS@ +LIBS=@SAVED_LIBS@ CPPFLAGS+=-I../.. -I../../include -I../../lib/include/rapidxml CXXFLAGS+=-g -O3 -Wall -Wshadow -LIBS=-lpthread -lrt +LIBS+=-lpthread LDFLAGS+=-g ifeq ($(cuda),yes) 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]) |