All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] autofs: build: check for clock_gettime in librt
@ 2016-06-19  3:19 Gustavo Zacarias
  2016-06-19 10:11 ` Ian Kent
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo Zacarias @ 2016-06-19  3:19 UTC (permalink / raw)
  To: autofs; +Cc: Gustavo Zacarias

Glibc versions older than 2.17 define clock_gettime() in librt, so add a
check for this.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] autofs: build: check for clock_gettime in librt
  2016-06-19  3:19 [PATCH] autofs: build: check for clock_gettime in librt Gustavo Zacarias
@ 2016-06-19 10:11 ` Ian Kent
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Kent @ 2016-06-19 10:11 UTC (permalink / raw)
  To: Gustavo Zacarias, autofs

On Sun, 2016-06-19 at 00:19 -0300, Gustavo Zacarias wrote:
> Glibc versions older than 2.17 define clock_gettime() in librt, so add a
> check for this.

I'll include this the next time I push to the repo.

I'll check the build output before then but it doesn't look like I'll see a
problem.

Thanks
Ian
 
> 
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>  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
>  #
--
To unsubscribe from this list: send the line "unsubscribe autofs" in

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-19 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-19  3:19 [PATCH] autofs: build: check for clock_gettime in librt Gustavo Zacarias
2016-06-19 10:11 ` Ian Kent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.