summaryrefslogtreecommitdiff
path: root/sys-block/nbdkit/files/nbdkit-1.32.4-automagics.patch
blob: 98b734fb7eb263691ccaea529ffd8c5e212aa3cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
From acf0b5e279d7a5154c32cac5e0ca820685bd01de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Sun, 27 Nov 2022 16:08:38 +0100
Subject: [PATCH] configure: Add --with s for automagic dependencies

---
Upstreamed after release, see
https://gitlab.com/nbdkit/nbdkit/-/merge_requests/18/pipelines

configure.ac | 109 +++++++++++++++++++++++++++++++++++----------------
 1 file changed, 76 insertions(+), 33 deletions(-)

diff --git a/configure.ac b/configure.ac
index c379edfb..5a64ed88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -604,22 +604,40 @@ AC_MSG_RESULT([$is_glibc_234])
 AM_CONDITIONAL([HAVE_GLIBC_234], [test "x$is_glibc_234" = "xyes"])
 
 dnl Check for SELinux socket labelling (optional).
-PKG_CHECK_MODULES([LIBSELINUX], [libselinux], [
-    AC_SUBST([LIBSELINUX_CFLAGS])
-    AC_SUBST([LIBSELINUX_LIBS])
-    AC_DEFINE([HAVE_LIBSELINUX],[1],[libselinux found at compile time.])
-], [
-    AC_MSG_WARN([libselinux not found, SELinux socket labelling support will be disabled.])
+AC_ARG_WITH([selinux],
+    AS_HELP_STRING([--without-selinux], [disable SELinux support, used for socket labelling @<:@default=check@:>@]))
+AS_IF([test "x$with_selinux" != xno], [
+    PKG_CHECK_MODULES([LIBSELINUX], [libselinux], [
+        AC_SUBST([LIBSELINUX_CFLAGS])
+        AC_SUBST([LIBSELINUX_LIBS])
+        AC_DEFINE([HAVE_LIBSELINUX],[1],[libselinux found at compile time.])
+    ], [AC_MSG_WARN([libselinux not found, sockets will not be labeled.])])
+])
+
+AS_IF([test "x$with_selinux" = xyes && test "x$LIBSELINUX_LIBS" = x], [
+    AC_MSG_ERROR([selinux requested but not found])
 ])
 
 dnl Check for GnuTLS (optional, for TLS support).
-PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.3.0], [
-    AC_SUBST([GNUTLS_CFLAGS])
-    AC_SUBST([GNUTLS_LIBS])
-    AC_DEFINE([HAVE_GNUTLS],[1],[gnutls found at compile time.])
-], [
-    AC_MSG_WARN([gnutls not found or < 3.3.0, TLS support will be disabled.])
+AC_ARG_WITH([gnutls],
+    [AS_HELP_STRING([--without-gnutls], [disable TLS support via GnuTLS @<:@default=check@:>@])],
+    [],
+    [: m4_divert_text([DEFAULTS], [with_manpages=check])])
+
+AS_IF([test "x$with_gnutls" != xno], [
+    PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.3.0], [
+        AC_SUBST([GNUTLS_CFLAGS])
+        AC_SUBST([GNUTLS_LIBS])
+        AC_DEFINE([HAVE_GNUTLS],[1],[gnutls found at compile time.])
+    ], [
+        AC_MSG_WARN([gnutls not found or < 3.3.0, TLS support will be disabled.])
+    ])
 ])
+
+AS_IF([test "x$with_gnutls" = xyes && test x"$GNUTLS_LIBS" = x], [
+    AC_MSG_ERROR([gnutls requested but not found])
+])
+
 AM_CONDITIONAL([HAVE_GNUTLS], [test "x$GNUTLS_LIBS" != "x"])
 
 AS_IF([test "x$GNUTLS_LIBS" != "x"],[
@@ -733,34 +751,59 @@ AM_CONDITIONAL([USE_LINKER_SCRIPT],
                [test "x$use_linker_script" = "xyes"])
 
 dnl Bash completion.
-PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
-    bash_completion=yes
-    AC_MSG_CHECKING([for bash-completions directory])
-    m4_ifdef([PKG_CHECK_VAR],[
-        PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir])
+AC_ARG_WITH([bash-completions],
+    [AS_HELP_STRING([--without-bash-completions], [disable installing bash completions @<:@default=check@:>@])],
+    [],
+    [: m4_divert_text([DEFAULTS], [with_readline=check])])
+
+AS_IF([test "x$with_bash_completions" != xno], [
+    PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
+        bash_completion=yes
+        AC_MSG_CHECKING([for bash-completions directory])
+        m4_ifdef([PKG_CHECK_VAR],[
+            PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir])
+        ])
+        AS_IF([test -z "$bashcompdir"], [
+            bashcompdir="${sysconfdir}/bash_completion.d"
+        ])
+        AC_MSG_RESULT([$bashcompdir])
+        AC_SUBST([bashcompdir])
+    ],[
+        bash_completion=no
+        AC_MSG_WARN([bash-completion not installed])
     ])
-    AS_IF([test -z "$bashcompdir"], [
-        bashcompdir="${sysconfdir}/bash_completion.d"
-    ])
-    AC_MSG_RESULT([$bashcompdir])
-    AC_SUBST([bashcompdir])
-],[
-    bash_completion=no
-    AC_MSG_WARN([bash-completion not installed])
 ])
+
+AS_IF([test "x$bash_completion" = xno && test "x$with_bash_completions" = xyes], [
+    AC_MSG_ERROR([bash-completions requested but required packages not found])
+])
+
 AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
 
 dnl Check we have enough to run podwrapper.
-AC_CHECK_PROG([PERL],[perl],[perl],[no])
-AS_IF([test "x$PERL" != "xno"],[
-    AC_MSG_CHECKING([if we have perl Pod::Man and Pod::Simple])
-    AS_IF([$PERL -MPod::Man -MPod::Simple -e 1 >&AS_MESSAGE_LOG_FD 2>&1],[
-        enable_pod=yes
-    ],[
-        enable_pod=no
+
+AC_ARG_WITH([manpages],
+    [AS_HELP_STRING([--without-manpages], [Do not build man pages @<:@default=check@:>@])],
+    [],
+    [: m4_divert_text([DEFAULTS], [with_manpages=check])])
+
+enable_pod=no
+AC_CHECK_PROGS([PERL], [perl], [])
+
+AS_IF([test "x$enable_manpages" != xno], [
+    AS_IF([test "x$PERL" != "x"],[
+        AC_MSG_CHECKING([if we have perl Pod::Man and Pod::Simple])
+        AS_IF([$PERL -MPod::Man -MPod::Simple -e 1 >&AS_MESSAGE_LOG_FD 2>&1],[
+            enable_pod=yes
+        ])
+        AC_MSG_RESULT([$enable_pod])
     ])
-    AC_MSG_RESULT([$enable_pod])
 ])
+
+AS_IF([test "x$enable_pod" = xno && test "x$enable_manpages" = xyes], [
+    AC_MSG_ERROR([man-pages requested but required packages not found])
+])
+
 AM_CONDITIONAL([HAVE_POD],
                [test "x$PERL" != "xno" && test "x$enable_pod" = "xyes"])
 
-- 
2.38.1