mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-09 03:08:38 +01:00
build: Support clock_gettime() provided in librt
In older glibc versions (< 2.17) clock_gettime() is in librt. Add a check for this to avoid build breakage for programs/libraries that use libbsd on such systems. Based-on-patch-by: Gustavo Zacarias <gustavo@zacarias.com.ar> Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
parent
ed84bec5aa
commit
b7ce33cf51
10
configure.ac
10
configure.ac
@ -44,6 +44,16 @@ AC_SUBST([TESTU01_LIBS])
|
|||||||
AM_CONDITIONAL([HAVE_LIBTESTU01],
|
AM_CONDITIONAL([HAVE_LIBTESTU01],
|
||||||
[test "x$ac_cv_lib_testu01_unif01_CreateExternGenBits" = "xyes"])
|
[test "x$ac_cv_lib_testu01_unif01_CreateExternGenBits" = "xyes"])
|
||||||
|
|
||||||
|
# In old glibc versions (< 2.17) clock_gettime() is in librt.
|
||||||
|
AS_CASE([$host_os],
|
||||||
|
[*-gnu], [
|
||||||
|
saved_LIBS="$LIBS"
|
||||||
|
AC_SEARCH_LIBS([clock_gettime], [rt], [CLOCK_GETTIME_LIBS="-lrt"])
|
||||||
|
AC_SUBST([CLOCK_GETTIME_LIBS])
|
||||||
|
LIBS="$saved_LIBS"
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
# Checks for header files.
|
# Checks for header files.
|
||||||
AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h])
|
AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h])
|
||||||
|
|
||||||
|
@ -52,6 +52,8 @@ hash/md5hl.c: $(srcdir)/hash/helper.c
|
|||||||
libbsd_la_DEPENDENCIES = \
|
libbsd_la_DEPENDENCIES = \
|
||||||
$(libbsd_la_included_sources) \
|
$(libbsd_la_included_sources) \
|
||||||
libbsd.map
|
libbsd.map
|
||||||
|
libbsd_la_LIBADD = \
|
||||||
|
$(CLOCK_GETTIME_LIBS)
|
||||||
libbsd_la_LDFLAGS = \
|
libbsd_la_LDFLAGS = \
|
||||||
-Wl,--version-script=$(srcdir)/libbsd.map \
|
-Wl,--version-script=$(srcdir)/libbsd.map \
|
||||||
-version-number $(LIBBSD_ABI)
|
-version-number $(LIBBSD_ABI)
|
||||||
|
Loading…
Reference in New Issue
Block a user