Glibc versions older than 2.17 define clock_gettime() in librt, so add a check for this. Signed-off-by: Gustavo Zacarias <gustavo@xxxxxxxxxxxxxxx> --- Makefile.conf.in | 3 +++ Makefile.rules | 2 ++ configure.in | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/Makefile.conf.in b/Makefile.conf.in index cb53e66..2bc3202 100644 --- a/Makefile.conf.in +++ b/Makefile.conf.in @@ -11,6 +11,9 @@ DAEMON_CFLAGS = @DAEMON_CFLAGS@ DAEMON_LDFLAGS = @DAEMON_LDFLAGS@ +# Glibc < 2.17 requires librt for clock_gettime() +LIBCLOCK_GETTIME = @LIBCLOCK_GETTIME@ + # Special parameters for glibc (libc 6) LIBNSL = @LIBNSL@ LIBRESOLV = @LIBRESOLV@ diff --git a/Makefile.rules b/Makefile.rules index 6fa3e02..7d1af2e 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -56,6 +56,8 @@ endif LIBS += $(LIBNSL) +LIBS += $(LIBCLOCK_GETTIME) + # Standard rules .SUFFIXES: .c .o .s .so diff --git a/configure.in b/configure.in index 25d7c4e..a4318e8 100644 --- a/configure.in +++ b/configure.in @@ -177,6 +177,10 @@ if test "$ac_cv_search_versionsort" = "no"; then [Define if your C library does not provide versionsort]) fi +# glibc < 2.17 needs librt for clock_gettime() +AC_CHECK_LIB(rt, clock_gettime, LIBCLOCK_GETTIME="-lrt") +AC_SUBST(LIBCLOCK_GETTIME) + # # glibc/libc 6 new libraries # -- 2.7.3 -- To unsubscribe from this list: send the line "unsubscribe autofs" in