summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2017-08-01 12:41:45 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2017-08-01 14:03:54 +0200
commit92b53a80772a5a7f18c95ac4f3154a3cd4b1ce43 (patch)
treeb903a59fda3e07f9b35961c8cd5750f6b7a42e53 /configure
parenta60fd5723645a56b677281007e6d5ed2493945cf (diff)
downloadlvm2-92b53a80772a5a7f18c95ac4f3154a3cd4b1ce43.tar.gz
configure: improve test for realtime clock
Check first if we need to even link -lrt - since clock functions are normally emebeded with recent glibc (>=2.17) Use standard RT_LIBS name. Avoid duplicate test for realtime clock with lvmlockd Show better error message when realtime clock support is missing or disabled. Link RT_LIBS explicitely with lvmlockd and lvmetad.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure38
1 files changed, 27 insertions, 11 deletions
diff --git a/configure b/configure
index 8396e3ee3..6c649cf62 100755
--- a/configure
+++ b/configure
@@ -660,7 +660,7 @@ SELINUX_PC
SELINUX_LIBS
REPLICATORS
READLINE_LIBS
-RT_LIB
+RT_LIBS
RAID
PYTHON3DIR
PYTHON2DIR
@@ -14316,8 +14316,24 @@ fi
fi
################################################################################
+RT_LIBS=
+HAVE_REALTIME=no
if test "$REALTIME" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+ for ac_func in clock_gettime
+do :
+ ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
+if test "x$ac_cv_func_clock_gettime" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CLOCK_GETTIME 1
+_ACEOF
+ HAVE_REALTIME=yes
+fi
+done
+
+
+ if test "$HAVE_REALTIME" != yes; then :
+ # try again with -lrt
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
if ${ac_cv_lib_rt_clock_gettime+:} false; then :
$as_echo_n "(cached) " >&6
@@ -14354,17 +14370,15 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
- HAVE_REALTIME=yes
-else
- HAVE_REALTIME=no
+ RT_LIBS="-lrt"; HAVE_REALTIME=yes
fi
+fi
if test "$HAVE_REALTIME" = yes; then
$as_echo "#define HAVE_REALTIME 1" >>confdefs.h
- RT_LIB="-lrt"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling realtime clock" >&5
$as_echo "$as_me: WARNING: Disabling realtime clock" >&2;}
@@ -14876,13 +14890,15 @@ done
fi
if test "$BUILD_LVMLOCKD" = yes; then
- for ac_func in clock_gettime strtoull
+ if test "$HAVE_REALTIME" != yes; then :
+ as_fn_error $? "Realtime clock support is mandatory for lvmlockd." "$LINENO" 5
+fi
+ for ac_func in strtoull
do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull"
+if test "x$ac_cv_func_strtoull" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_STRTOULL 1
_ACEOF
else