aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-security/opendnssec/files/libdns_conf_fix.patch
blob: 31d7252dc67721f7ca0ce51fb92f86fc577fe678 (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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
Configure does not work with OE pkg-config for the ldns option

Upstream-Status: OE specific

Signed-off-by: Armin Kuster <akuster808@gmail.com>

Index: opendnssec-2.1.8/configure.ac
===================================================================
--- opendnssec-2.1.8.orig/configure.ac
+++ opendnssec-2.1.8/configure.ac
@@ -133,9 +133,7 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_
 
 # common dependencies
 ACX_LIBXML2
-ACX_LDNS(1,6,17)
-ACX_LDNS_NOT(1,6,14, [binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html])
-ACX_LDNS_NOT(1,6,15, [fail to create NSEC3 bitmap for empty non-terminals, see http://www.nlnetlabs.nl/pipermail/ldns-users/2012-November/000565.html])
+ACX_LDNS(1.6.17)
 ACX_PKCS11_MODULES
 ACX_RT
 ACX_LIBC
Index: opendnssec-2.1.8/m4/acx_ldns.m4
===================================================================
--- opendnssec-2.1.8.orig/m4/acx_ldns.m4
+++ opendnssec-2.1.8/m4/acx_ldns.m4
@@ -1,128 +1,63 @@
-AC_DEFUN([ACX_LDNS],[
-	AC_ARG_WITH(ldns, 
-		[AS_HELP_STRING([--with-ldns=PATH],[specify prefix of path of ldns library to use])],
-        	[
-			LDNS_PATH="$withval"
-			AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $LDNS_PATH/bin)
-		],[
-			LDNS_PATH="/usr/local"
-			AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $PATH)
-		])
-
-	if test -x "$LDNS_CONFIG"
-	then
-		AC_MSG_CHECKING(what are the ldns includes)
-		LDNS_INCLUDES="`$LDNS_CONFIG --cflags`"
-		AC_MSG_RESULT($LDNS_INCLUDES)
-
-		AC_MSG_CHECKING(what are the ldns libs)
-		LDNS_LIBS="`$LDNS_CONFIG --libs`"
-		AC_MSG_RESULT($LDNS_LIBS)
-	else
-		AC_MSG_CHECKING(what are the ldns includes)
-		LDNS_INCLUDES="-I$LDNS_PATH/include"
-		AC_MSG_RESULT($LDNS_INCLUDES)
-
-		AC_MSG_CHECKING(what are the ldns libs)
-		LDNS_LIBS="-L$LDNS_PATH/lib -lldns"
-		AC_MSG_RESULT($LDNS_LIBS)
-	fi
-
-	tmp_CPPFLAGS=$CPPFLAGS
-	tmp_LIBS=$LIBS
-
-	CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES"
-	LIBS="$LIBS $LDNS_LIBS"
-
-	AC_CHECK_LIB(ldns, ldns_rr_new,,[AC_MSG_ERROR([Can't find ldns library])])
-	LIBS=$tmp_LIBS
-
-	AC_MSG_CHECKING([for ldns version])
-	CHECK_LDNS_VERSION=m4_format(0x%02x%02x%02x, $1, $2, $3)
-	AC_LANG_PUSH([C])
-	AC_RUN_IFELSE([
-		AC_LANG_SOURCE([[
-			#include <ldns/ldns.h>
-			int main()
-			{
-			#ifdef LDNS_REVISION
-				if (LDNS_REVISION >= $CHECK_LDNS_VERSION)
-					return 0;
-			#endif
-				return 1;
-			}
-		]])
-	],[
-		AC_MSG_RESULT([>= $1.$2.$3])
-	],[
-		AC_MSG_RESULT([< $1.$2.$3])
-		AC_MSG_ERROR([ldns library too old ($1.$2.$3 or later required)])
-	],[])
-	AC_LANG_POP([C])
-
-	CPPFLAGS=$tmp_CPPFLAGS
-
-	AC_SUBST(LDNS_INCLUDES)
-	AC_SUBST(LDNS_LIBS)
-])
-
-
-AC_DEFUN([ACX_LDNS_NOT],[
-	AC_ARG_WITH(ldns, 
-		[AS_HELP_STRING([--with-ldns=PATH],[specify prefix of path of ldns library to use])],
-        	[
-			LDNS_PATH="$withval"
-			AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $LDNS_PATH/bin)
-		],[
-			LDNS_PATH="/usr/local"
-			AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $PATH)
-		])
-
-	if test -x "$LDNS_CONFIG"
-	then
-		AC_MSG_CHECKING(what are the ldns includes)
-		LDNS_INCLUDES="`$LDNS_CONFIG --cflags`"
-		AC_MSG_RESULT($LDNS_INCLUDES)
-
-		AC_MSG_CHECKING(what are the ldns libs)
-		LDNS_LIBS="`$LDNS_CONFIG --libs`"
-		AC_MSG_RESULT($LDNS_LIBS)
-	else
-		AC_MSG_CHECKING(what are the ldns includes)
-		LDNS_INCLUDES="-I$LDNS_PATH/include"
-		AC_MSG_RESULT($LDNS_INCLUDES)
-
-		AC_MSG_CHECKING(what are the ldns libs)
-		LDNS_LIBS="-L$LDNS_PATH/lib -lldns"
-		AC_MSG_RESULT($LDNS_LIBS)
-	fi
-
-	tmp_CPPFLAGS=$CPPFLAGS
-
-	CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES"
-
-	AC_MSG_CHECKING([for ldns version not $1.$2.$3])
-	CHECK_LDNS_VERSION=m4_format(0x%02x%02x%02x, $1, $2, $3)
-	AC_LANG_PUSH([C])
-	AC_RUN_IFELSE([
-	AC_LANG_SOURCE([[
-		#include <ldns/ldns.h>
-		int main()
-		{
-		#ifdef LDNS_REVISION
-			if (LDNS_REVISION != $CHECK_LDNS_VERSION)
-				return 0;
-		#endif
-			return 1;
-		}
-		]])
-	],[
-		AC_MSG_RESULT([ok])
-	],[
-		AC_MSG_RESULT([no])
-		AC_MSG_ERROR([ldns version $1.$2.$3 is not compatible due to $4])
-	],[])
-	AC_LANG_POP([C])
-
-	CPPFLAGS=$tmp_CPPFLAGS
+AU_ALIAS([CHECK_LDNS], [ACX_LDNS])
+AC_DEFUN([ACX_LDNS], [
+    found=false
+    AC_ARG_WITH([ldns],
+        [AS_HELP_STRING([--with-ldns=DIR],
+            [root of the lnds directory])],
+        [
+            case "$withval" in
+            "" | y | ye | yes | n | no)
+            AC_MSG_ERROR([Invalid --with-lnds value])
+              ;;
+            *) ldnsdirs="$withval"
+              ;;
+            esac
+        ], [
+            # if pkg-config is installed and lnds has installed a .pc file,
+            # then use that information and don't search ldnsdirs
+            AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
+            if test x"$PKG_CONFIG" != x""; then
+                OPENSSL_LDFLAGS=`$PKG_CONFIG ldns --libs-only-L 2>/dev/null`
+                if test $? = 0; then
+                    LDNS_LIBS=`$PKG_CONFIG ldns --libs-only-l 2>/dev/null`
+                    LDNS_INCLUDES=`$PKG_CONFIG ldns --cflags-only-I 2>/dev/null`
+                    found=true
+                fi
+            fi
+
+            # no such luck; use some default ldnsdirs
+            if ! $found; then
+                ldnsdirs="/usr/local/ldns /usr/lib/ldns /usr/ldns  /usr/local /usr"
+            fi
+        ]
+        )
+
+
+    if ! $found; then
+        LDNS_INCLUDES=
+        for ldnsdir in $ldnsdirs; do
+            AC_MSG_CHECKING([for LDNS in $ldnsdir])
+            if test -f "$ldnsdir/include/ldns/dnssec.h"; then
+                LDNS_INCLUDES="-I$ldnsdir/include"
+                LDNS_LDFLAGS="-L$ldnsdir/lib"
+                LDNS_LIBS="-lldns"
+                found=true
+                AC_MSG_RESULT([yes])
+                break
+            else
+                AC_MSG_RESULT([no])
+            fi
+        done
+
+        # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+        # it will just work!
+    fi
+
+    LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+    LIBS="$LDNS_LIBS $LIBS"
+    CPPFLAGS="$LDNS_INCLUDES $CPPFLAGS"
+
+    AC_SUBST([LDNS_INCLUDES])
+    AC_SUBST([LDNS_LIBS])
+    AC_SUBST([LDNS_LDFLAGS])
 ])