Skip to content

Commit de8c41d

Browse files
committed
isolate librt dependency, minor script correcttion.
1 parent 9bb4200 commit de8c41d

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

config.h.in

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
/* define if the Boost::Unit_Test_Framework library is available */
2828
#undef HAVE_BOOST_UNIT_TEST_FRAMEWORK
2929

30+
/* Define to 1 if you have the `clock_gettime' function. */
31+
#undef HAVE_CLOCK_GETTIME
32+
3033
/* Define to 1 if you have the <dlfcn.h> header file. */
3134
#undef HAVE_DLFCN_H
3235

configure.ac

+8-2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ AC_CONFIG_HEADERS([config.h])
6464
# Checks for libraries.
6565

6666
AC_CHECK_LIB(pthread, pthread_create)
67+
68+
AC_CHECK_FUNCS(clock_gettime, [], [
69+
AC_CHECK_LIB(rt, clock_gettime, [
70+
RTLIB="-lrt"
71+
AC_SUBST([RTLIB])
72+
])
73+
])
74+
6775
AX_BOOST_BASE([1.47.0], [], [AC_MSG_ERROR("BOOST library version >= 1.47.0 not found!")])
6876
AX_BOOST_SYSTEM
6977
AX_BOOST_ASIO
@@ -75,8 +83,6 @@ LDFLAGS="$LDFLAGS $BOOST_LDFLAGS $BOOST_SYSTEM_LIB"
7583
AX_BOOST_THREAD
7684
AX_BOOST_CHRONO
7785
LDFLAGS=$LDFLAGS_SAVED_1
78-
# chrono.hpp depends on ::clock_gettime, which is in rt
79-
BOOST_CHRONO_LIB="$BOOST_CHRONO_LIB -lrt"
8086

8187
AX_BOOST_FILESYSTEM
8288
AX_BOOST_UNIT_TEST_FRAMEWORK

test.sh.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ else
2222
fi
2323
fi
2424

25-
LD_LIBRARY_PATH=@BOOST_LIBDIR@ test/test_util $tests $*
25+
LD_LIBRARY_PATH=@BOOST_LIBDIR@ test/test_utxx $tests $*

test/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ test_utxx_LDADD = $(srcdir)/../src/.libs/libutxx.la \
7777
$(BOOST_TIMER_LIB) \
7878
$(BOOST_CHRONO_LIB) \
7979
$(BOOST_FILESYSTEM_LIB) \
80-
$(BOOST_UNIT_TEST_FRAMEWORK_LIB)
80+
$(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
81+
$(RTLIB)
8182

8283
test_utxx_DATA = test_config_validator.xml
8384

0 commit comments

Comments
 (0)