diff mbox

[for-4.7] configure: Fix when no libsystemd compat lib are available

Message ID 1462291190-20234-1-git-send-email-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anthony PERARD May 3, 2016, 3:59 p.m. UTC
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@citrix.com>
---
Please, rerun ./autogen.sh on this patch.
---
 m4/systemd.m4 | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Wei Liu May 4, 2016, 11:25 a.m. UTC | #1
On Tue, May 03, 2016 at 04:59:49PM +0100, Anthony PERARD wrote:
> 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@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

> ---
> Please, rerun ./autogen.sh on this patch.
> ---
>  m4/systemd.m4 | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 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
> -- 
> Anthony PERARD
>
Wei Liu May 4, 2016, 3:26 p.m. UTC | #2
On Wed, May 04, 2016 at 12:25:52PM +0100, Wei Liu wrote:
> On Tue, May 03, 2016 at 04:59:49PM +0100, Anthony PERARD wrote:
> > 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@citrix.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 

And release-ack, queued.
diff mbox

Patch

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