[lttng-dev] [PATCH] Fix: configure.ac: check for possibly required libs for clock_gettime

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Feb 10 08:22:35 EST 2016


Hi,

Merged into urcu master, and stable-0.9 branches.

Please use [PATCH urcu] in the title next time for patches on lttng-dev.
it makes it easier for us to know against which project the patch should
be applied.

Thanks!

Mathieu

----- On Feb 10, 2016, at 4:39 AM, Olof Johansson olof.johansson at axis.com wrote:

> From: Olof Johansson <olof.johansson at axis.com>
> 
> On some platforms, you have to link with rt to get clock_gettime. This
> solves errors like:
> 
> undefined reference to `clock_gettime'
> 
> Fixes: #996
> 
> Signed-off-by: Olof Johansson <olof.johansson at axis.com>
> ---
> configure.ac | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 39a7777..c3cf60e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -79,7 +79,6 @@ AC_FUNC_MMAP
> AC_FUNC_FORK
> AC_CHECK_FUNCS([ \
> 	atexit \
> -	clock_gettime \
> 	getcpuid \
> 	gettid \
> 	gettimeofday \
> @@ -215,6 +214,11 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
> 	compat_futex_test=1
> ])
> 
> +# Search for clock_gettime
> +AC_SEARCH_LIBS([clock_gettime], [rt], [],
> +	[AC_MSG_ERROR([Cannot find clock_gettime function.])]
> +)
> +
> # Check for pthread
> AC_CHECK_LIB([pthread], [pthread_create],
> 	[AM_CONDITIONAL(LIBC_INCLUDES_PTHREAD, false)],
> --
> 2.1.4
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list