summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2016-11-07 11:53:21 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2016-11-07 16:53:24 +0100
commit6d11fdcd8ef05000dd20b3431f8491790f99a802 (patch)
treeafa56c3e4a503f9d5fc1a016fd289369652dbeac
parentcf5357ae83cc9fe2240038b8bdccec2cb98991fc (diff)
downloadsssd-6d11fdcd8ef05000dd20b3431f8491790f99a802.tar.gz
sssd-6d11fdcd8ef05000dd20b3431f8491790f99a802.tar.xz
sssd-6d11fdcd8ef05000dd20b3431f8491790f99a802.zip
BUILD: Fix linking with librt
The posix realime extensions defines timer_* functions but it does not mention library with these functions. http://www.unix.org/version2/whatsnew/realtime.html The autoconf macro AC_SEARCH_LIBS firstly check the function timer_create with no libraries, then for each library listed in 2nd parameter. Possible libraries librt and libposix4 were used in nspr for similar detection. Reviewed-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac13
2 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 64328766e..e037930ff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -980,6 +980,7 @@ libsss_util_la_CFLAGS = \
$(SYSTEMD_LOGIN_CFLAGS) \
$(NULL)
libsss_util_la_LIBADD = \
+ $(LIBADD_TIMER) \
$(SSSD_LIBS) \
$(SYSTEMD_LOGIN_LIBS) \
$(UNICODE_LIBS) \
diff --git a/configure.ac b/configure.ac
index 3dbcf9e1f..d3ef1e162 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,19 @@ AC_CHECK_FUNCS([ pthread_mutexattr_setrobust \
pthread_mutex_consistent_np ])
LIBS=$SAVE_LIBS
+# Check library for the timer_create function
+SAVE_LIBS=$LIBS
+LIBS=
+LIBADD_TIMER=
+AC_SEARCH_LIBS([timer_create], [rt posix4],
+ [AC_DEFINE([HAVE_LIBRT], [1],
+ [Define if you have the librt library or equivalent.])
+ LIBADD_TIMER="$LIBS"],
+ [AC_MSG_ERROR([unable to find library fot the timer_create() function])])
+
+AC_SUBST([LIBADD_TIMER])
+LIBS=$SAVE_LIBS
+
# Check for presence of modern functions for setting file timestamps
AC_CHECK_FUNCS([ utimensat \
futimens ])