summarylogtreecommitdiffstats
path: root/configure.ac.patch
blob: 4afb59f62771022de09db285464a13a845c690c9 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
--- configure.ac	2024-04-11 20:37:54.617501223 +0200
+++ configure.ac.new	2024-04-11 20:36:34.224776417 +0200
@@ -12,8 +12,8 @@
 #
 # Package version
 #
-m4_define([VERSION_RELEASE], 0)
-m4_define([VERSION_MAJOR_REV], 1)
+m4_define([VERSION_RELEASE], 1)
+m4_define([VERSION_MAJOR_REV], 0)
 m4_define([VERSION_MINOR_REV], 0)
 m4_define([VERSION_PATCH], 0)
 
@@ -36,15 +36,13 @@
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE(
   1.11.1
-  dnl Automake version before 1.13 (when the serial-tests option was
-  dnl still the default) still defined the badly obsolete macro
-  dnl 'AM_PROG_INSTALL'.
-  m4_ifndef([AM_PROG_INSTALL], [serial-tests])
 )
 AC_CONFIG_HEADERS([build-config.h])
 
 AC_CONFIG_MACRO_DIR([m4])
 
+LT_INIT
+
 #
 # Hexadecimal version, for use in generating dkim.h
 # 
@@ -61,9 +59,9 @@
 # Checks for programs
 #
 AC_PROG_CC
-AC_PROG_CC_C99
+# autoconf 2.70 deprecated this, but it might still be necessary on old versions
+m4_version_prereq([2.70], [:], [AC_PROG_CC_C99])
 AM_PROG_CC_C_O
-AC_PROG_LIBTOOL
 
 PKG_PROG_PKG_CONFIG
 
@@ -666,6 +664,7 @@
 	CPPFLAGS="$saved_CPPFLAGS"
 	LDFLAGS="$saved_LDFLAGS"
 	LIBS="$saved_LIBS"
+
 fi
 
 AC_SUBST(LIBCRYPTO_CFLAGS)
@@ -795,6 +794,82 @@
 AC_SUBST(LIBMILTER_LIBDIRS)
 AC_SUBST(LIBMILTER_LIBS)
 
+#
+# header filtering requires libjansson
+# 
+
+AC_ARG_WITH([libjansson],
+            AS_HELP_STRING([--with-libjansson],
+                           [location of jansson includes and library]),
+            [janssonpath="$withval"], [janssonpath="auto"])
+
+LIBJANSSON_CPPFLAGS=""
+LIBJANSSON_LDFLAGS=""
+LIBJANSSON_LIBS=""
+
+jansson_found="no"
+if test \( x"$janssonpath" = x"auto" -o x"$janssonpath" = x"yes" \) -a \
+	x"$PKG_CONFIG" != x""
+then
+        PKG_CHECK_MODULES([LIBJANSSON], [jansson >= 2.2.1],
+	[
+		jansson_found="yes"
+		LIBJANSSON_CPPFLAGS="$LIBJANSSON_CFLAGS"
+		LIBJANSSON_LIBS="$LIBJANSSON_LIBS"
+	],
+	[
+	        jansson_found="no"
+        	AC_MSG_WARN([pkg-config for libjansson not found, trying manual
+		            search...])
+        ])
+fi
+
+if test x"$janssonpath" != x"no" -a x"$jansson_found" = x"no"
+then
+	AC_MSG_CHECKING([for libjansson])
+	if test x"$janssonpath" != x"auto" -a x"$janssonpath" != x"yes"
+	then
+		if test -f $janssonpath/include/jansson.h
+		then
+			AC_MSG_RESULT($janssonpath)
+		        jansson_found="yes"
+			LIBJANSSON_CPPFLAGS="-I$janssonpath/include"
+			LIBJANSSON_LDFLAGS="-L$janssonpath/lib"
+			LIBJANSSON_LIBS="-ljansson"
+		else
+			AC_MSG_ERROR(not found at $janssonpath)
+		fi
+	else
+		janssondirs="/usr /usr/local"
+		for d in $janssondirs
+		do
+			if test -f $d/include/jansson.h
+			then
+				janssonpath=$d
+				AC_MSG_RESULT($d)
+		        	jansson_found="yes"
+				LIBJANSSON_CPPFLAGS="-I$janssonpath/include"
+				LIBJANSSON_LDFLAGS="-L$janssonpath/lib"
+				LIBJANSSON_LIBS="-ljansson"
+				break
+			fi
+		done
+	fi
+	if test x"$jansson_found" != x"yes"
+	then
+		AC_MSG_RESULT([no])
+	fi
+fi
+AC_SUBST(LIBJANSSON_CPPFLAGS)
+AC_SUBST(LIBJANSSON_LDFLAGS)
+AC_SUBST(LIBJANSSON_LIBS)
+AM_CONDITIONAL(JANSSON, test x"$LIBJANSSON_LIBS" != x"")
+
+if test x"$jansson_found" == x"yes"
+then
+	AC_DEFINE(USE_JANSSON, 1, [use libjansson to provide header field checks])
+fi
+
 # This (below) is just for the pkg-config file openarc.pc.in
 LIBOPENARC_LIBS_PKG="$LIBOPENARC_LIBS"
 LIBOPENARC_INC="$LIBCRYPTO_CPPFLAGS $LIBCRYPTO_CFLAGS $LIBTRE_CPPFLAGS"
@@ -887,23 +962,26 @@
 # Finish up
 #
 
-AC_OUTPUT([	Makefile
-		docs/Makefile
-		contrib/Makefile
-			contrib/docs/Makefile
-			contrib/init/Makefile
-			contrib/init/generic/Makefile
-			contrib/init/redhat/Makefile
-			contrib/init/redhat/openarc
-			contrib/init/solaris/Makefile
-			contrib/spec/Makefile
-			contrib/spec/openarc.spec
-			contrib/systemd/Makefile
-			contrib/systemd/openarc.service
-		libopenarc/openarc.pc libopenarc/Makefile
-		libopenarc/docs/Makefile
-		openarc/Makefile openarc/openarc.8 openarc/openarc.conf.5
-			openarc/openarc.conf.simple
+AC_CONFIG_FILES([
+    Makefile
+    docs/Makefile
+    contrib/Makefile
+    contrib/docs/Makefile
+    contrib/init/Makefile
+    contrib/init/generic/Makefile
+    contrib/init/redhat/Makefile
+    contrib/init/redhat/openarc
+    contrib/init/solaris/Makefile
+    contrib/spec/Makefile
+    contrib/spec/openarc.spec
+    contrib/systemd/Makefile
+    contrib/systemd/openarc.service
+    libopenarc/openarc.pc
+    libopenarc/Makefile
+    libopenarc/docs/Makefile
+    openarc/Makefile
+    openarc/openarc.8
+    openarc/openarc.conf.5
+    openarc/openarc.conf.simple
 ])
-		#libopenarc/tests/Makefile
-		#openarc/tests/Makefile
+AC_OUTPUT