1 From 9af8ee5baceab59d46154c96da62b52935f363fe Mon Sep 17 00:00:00 2001
2 From: Nick Hainke <vincent@systemli.org>
3 Date: Mon, 27 Jun 2022 20:43:11 +0200
4 Subject: [PATCH] configure.ac: fix AC_ARG_WITH
6 In the new version the configuration no longer respects the
7 --without/--with blkid/selinux parameters. Add the tests for
8 "with_blkid" and "with_selinux" back to configure.ac as described
11 Link: https://www.gnu.org/software/autoconf/manual/autoconf-2.60/html_node/External-Software.html
13 Fixes: c48335416a09 ("configure.ac: Enable cross-compilation")
15 Signed-off-by: Nick Hainke <vincent@systemli.org>
17 configure.ac | 44 ++++++++++++++++++++++++++++++--------------
18 1 file changed, 30 insertions(+), 14 deletions(-)
22 @@ -39,12 +39,16 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign
24 # Test configure options.
25 AC_ARG_WITH([selinux],
26 - AS_HELP_STRING([--without-selinux],
27 - [Ignore presence of libselinux and disable selinux support]))
28 + [AS_HELP_STRING([--without-selinux],
29 + [Ignore presence of libselinux and disable selinux support])],
31 + [with_selinux=check])
34 - AS_HELP_STRING([--without-blkid],
35 - [Ignore presence of libblkid and disable blkid support]))
36 + [AS_HELP_STRING([--without-blkid],
37 + [Ignore presence of libblkid and disable blkid support])],
41 # Checks for programs.
43 @@ -55,11 +59,17 @@ AC_PATH_PROG([LDCONFIG], [ldconfig],
46 # Checks for libraries.
47 -AC_CHECK_LIB([blkid], [blkid_probe_all],
48 - [AC_SUBST([libblkid_LIBS], ["-lblkid"])
49 - AC_DEFINE([HAVE_LIBBLKID], [1],
50 - [Define if you have libblkid])
52 +AS_IF([test "x$with_blkid" != xno],
53 + [AC_CHECK_LIB([blkid], [blkid_probe_all],
54 + [AC_SUBST([libblkid_LIBS], ["-lblkid"])
55 + AC_DEFINE([HAVE_LIBBLKID], [1],
56 + [Define if you have libblkid])
58 + [if test "x$with_blkid" != xcheck; then
60 + [--with-blkid was given, but test for blkid failed])
64 AC_CHECK_LIB([lzo2], [main],
65 [AC_SUBST([liblzo2_LIBS], ["-llzo2"])
66 @@ -73,11 +83,17 @@ AC_CHECK_LIB([lz4], [main],
67 [Define if you have liblz4])
70 -AC_CHECK_LIB([selinux], [getcon],
71 - [AC_SUBST([libselinux_LIBS], ["-lselinux"])
72 - AC_DEFINE([HAVE_LIBSELINUX], [1],
73 - [Define if you have libselinux])
75 +AS_IF([test "x$with_selinux" != xno],
76 + [AC_CHECK_LIB([selinux], [getcon],
77 + [AC_SUBST([libselinux_LIBS], ["-lselinux"])
78 + AC_DEFINE([HAVE_LIBSELINUX], [1],
79 + [Define if you have libselinux])
81 + [if test "x$with_selinux" != xcheck; then
83 + [--with-selinux was given, but test for selinux failed])
87 AC_CHECK_LIB([uuid], [uuid_clear],
88 [AC_SUBST([libuuid_LIBS], ["-luuid"])