diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2017-08-01 12:41:45 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2017-08-01 14:03:54 +0200 |
commit | 92b53a80772a5a7f18c95ac4f3154a3cd4b1ce43 (patch) | |
tree | b903a59fda3e07f9b35961c8cd5750f6b7a42e53 /configure | |
parent | a60fd5723645a56b677281007e6d5ed2493945cf (diff) | |
download | lvm2-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-x | configure | 38 |
1 files changed, 27 insertions, 11 deletions
@@ -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 |