[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] configure: Fix when no libsystemd compat lib are available



commit 7dec5b0c658bea9c16a0e3c051e64d2abf57be48
Author:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
AuthorDate: Tue May 3 16:59:49 2016 +0100
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Wed May 4 16:31:16 2016 +0100

    configure: Fix when no libsystemd compat lib are available
    
    From systemd change log, since version 209, libsystemd.so contain
    everything, including libsystemd-daemon.so. Distro may, or may not provide
    the compatibility libraries which libsystemd-daemon is part of.
    
    So, if libsystemd-daemon is not available, check for the presence of
    a recent enough libsystemd.
    
    Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    [ wei: run autogen.sh ]
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
    Release-acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 m4/systemd.m4   |  10 +-
 tools/configure | 308 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 314 insertions(+), 4 deletions(-)

diff --git a/m4/systemd.m4 b/m4/systemd.m4
index e4b1aa5..112dc11 100644
--- a/m4/systemd.m4
+++ b/m4/systemd.m4
@@ -41,7 +41,9 @@ AC_DEFUN([AX_ALLOW_SYSTEMD_OPTS], [
 ])
 
 AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
-       PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon])
+       PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon],,
+               [PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209])]
+        )
        dnl pkg-config older than 0.24 does not set these for
        dnl PKG_CHECK_MODULES() worth also noting is that as of version 208
        dnl of systemd pkg-config --cflags currently yields no extra flags yet.
@@ -94,8 +96,10 @@ AC_DEFUN([AX_CHECK_SYSTEMD], [
 ])
 
 AC_DEFUN([AX_CHECK_SYSTEMD_ENABLE_AVAILABLE], [
-       PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [systemd="y"],
-                          [systemd="n"])
+       PKG_CHECK_MODULES([SYSTEMD], [libsystemd-daemon], [systemd="y"],[
+               PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209],
+                                 [systemd="y"],[systemd="n"])
+       ])
 ])
 
 dnl Enables systemd by default and requires a --disable-systemd option flag
diff --git a/tools/configure b/tools/configure
index a7d0f1a..2fde4f4 100755
--- a/tools/configure
+++ b/tools/configure
@@ -9196,6 +9196,66 @@ fi
        # Put the nasty error message in config.log where it belongs
        echo "$SYSTEMD_PKG_ERRORS" >&5
 
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+    pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+    pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "libsystemd >= 209" 2>&1`
+        else
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"libsystemd >= 209" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$SYSTEMD_PKG_ERRORS" >&5
+
        systemd="n"
 elif test $pkg_failed = untried; then
        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -9209,6 +9269,90 @@ $as_echo "yes" >&6; }
        systemd="y"
 fi
 
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+    pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+    pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "libsystemd >= 209" 2>&1`
+        else
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"libsystemd >= 209" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$SYSTEMD_PKG_ERRORS" >&5
+
+       systemd="n"
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       systemd="n"
+else
+       SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+       SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       systemd="y"
+fi
+
+else
+       SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+       SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       systemd="y"
+fi
+
 
                if test "x$enable_systemd" != "xno"; then :
 
@@ -9278,7 +9422,161 @@ fi
        # Put the nasty error message in config.log where it belongs
        echo "$SYSTEMD_PKG_ERRORS" >&5
 
-       as_fn_error $? "Package requirements (libsystemd-daemon) were not met:
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+    pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+    pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "libsystemd >= 209" 2>&1`
+        else
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"libsystemd >= 209" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$SYSTEMD_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (libsystemd >= 209) were not met:
+
+$SYSTEMD_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old.  Make 
sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+       SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+       SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+    pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+    pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists 
--print-errors \"libsystemd >= 209\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libsystemd >= 209") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "libsystemd >= 209" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors 
--cflags --libs "libsystemd >= 209" 2>&1`
+        else
+               SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs 
"libsystemd >= 209" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$SYSTEMD_PKG_ERRORS" >&5
+
+       as_fn_error $? "Package requirements (libsystemd >= 209) were not met:
 
 $SYSTEMD_PKG_ERRORS
 
@@ -9311,6 +9609,14 @@ $as_echo "yes" >&6; }
 
 fi
 
+else
+       SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+       SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
 
 
        if test "x$SYSTEMD_DIR" = x; then :
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.