blob: 126e197f3ceb579225509b89f9d06e3b76e0de8b [file] [log] [blame]
Andrew Geisslerd1d22e62020-10-16 10:14:32 -05001Configure does not work with OE pkg-config for the ldns option
2
3Upstream-Status: OE specific
4
5Signed-off-by: Armin Kuster <akuster808@gmail.com>
6
7Index: opendnssec-2.1.6/m4/acx_ldns.m4
8===================================================================
9--- opendnssec-2.1.6.orig/m4/acx_ldns.m4
10+++ opendnssec-2.1.6/m4/acx_ldns.m4
11@@ -1,128 +1,65 @@
12-AC_DEFUN([ACX_LDNS],[
13- AC_ARG_WITH(ldns,
14- [AC_HELP_STRING([--with-ldns=PATH],[specify prefix of path of ldns library to use])],
15- [
16- LDNS_PATH="$withval"
17- AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $LDNS_PATH/bin)
18- ],[
19- LDNS_PATH="/usr/local"
20- AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $PATH)
21- ])
22-
23- if test -x "$LDNS_CONFIG"
24- then
25- AC_MSG_CHECKING(what are the ldns includes)
26- LDNS_INCLUDES="`$LDNS_CONFIG --cflags`"
27- AC_MSG_RESULT($LDNS_INCLUDES)
28-
29- AC_MSG_CHECKING(what are the ldns libs)
30- LDNS_LIBS="`$LDNS_CONFIG --libs`"
31- AC_MSG_RESULT($LDNS_LIBS)
32- else
33- AC_MSG_CHECKING(what are the ldns includes)
34- LDNS_INCLUDES="-I$LDNS_PATH/include"
35- AC_MSG_RESULT($LDNS_INCLUDES)
36-
37- AC_MSG_CHECKING(what are the ldns libs)
38- LDNS_LIBS="-L$LDNS_PATH/lib -lldns"
39- AC_MSG_RESULT($LDNS_LIBS)
40- fi
41-
42- tmp_CPPFLAGS=$CPPFLAGS
43- tmp_LIBS=$LIBS
44-
45- CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES"
46- LIBS="$LIBS $LDNS_LIBS"
47-
48- AC_CHECK_LIB(ldns, ldns_rr_new,,[AC_MSG_ERROR([Can't find ldns library])])
49- LIBS=$tmp_LIBS
50-
51- AC_MSG_CHECKING([for ldns version])
52- CHECK_LDNS_VERSION=m4_format(0x%02x%02x%02x, $1, $2, $3)
53- AC_LANG_PUSH([C])
54- AC_RUN_IFELSE([
55- AC_LANG_SOURCE([[
56- #include <ldns/ldns.h>
57- int main()
58- {
59- #ifdef LDNS_REVISION
60- if (LDNS_REVISION >= $CHECK_LDNS_VERSION)
61- return 0;
62- #endif
63- return 1;
64- }
65- ]])
66- ],[
67- AC_MSG_RESULT([>= $1.$2.$3])
68- ],[
69- AC_MSG_RESULT([< $1.$2.$3])
70- AC_MSG_ERROR([ldns library too old ($1.$2.$3 or later required)])
71- ],[])
72- AC_LANG_POP([C])
73+#serial 11
74
75- CPPFLAGS=$tmp_CPPFLAGS
76-
77- AC_SUBST(LDNS_INCLUDES)
78- AC_SUBST(LDNS_LIBS)
79-])
80-
81-
82-AC_DEFUN([ACX_LDNS_NOT],[
83- AC_ARG_WITH(ldns,
84- [AC_HELP_STRING([--with-ldns=PATH],[specify prefix of path of ldns library to use])],
85- [
86- LDNS_PATH="$withval"
87- AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $LDNS_PATH/bin)
88- ],[
89- LDNS_PATH="/usr/local"
90- AC_PATH_PROGS(LDNS_CONFIG, ldns-config, ldns-config, $PATH)
91- ])
92-
93- if test -x "$LDNS_CONFIG"
94- then
95- AC_MSG_CHECKING(what are the ldns includes)
96- LDNS_INCLUDES="`$LDNS_CONFIG --cflags`"
97- AC_MSG_RESULT($LDNS_INCLUDES)
98-
99- AC_MSG_CHECKING(what are the ldns libs)
100- LDNS_LIBS="`$LDNS_CONFIG --libs`"
101- AC_MSG_RESULT($LDNS_LIBS)
102- else
103- AC_MSG_CHECKING(what are the ldns includes)
104- LDNS_INCLUDES="-I$LDNS_PATH/include"
105- AC_MSG_RESULT($LDNS_INCLUDES)
106-
107- AC_MSG_CHECKING(what are the ldns libs)
108- LDNS_LIBS="-L$LDNS_PATH/lib -lldns"
109- AC_MSG_RESULT($LDNS_LIBS)
110- fi
111-
112- tmp_CPPFLAGS=$CPPFLAGS
113-
114- CPPFLAGS="$CPPFLAGS $LDNS_INCLUDES"
115-
116- AC_MSG_CHECKING([for ldns version not $1.$2.$3])
117- CHECK_LDNS_VERSION=m4_format(0x%02x%02x%02x, $1, $2, $3)
118- AC_LANG_PUSH([C])
119- AC_RUN_IFELSE([
120- AC_LANG_SOURCE([[
121- #include <ldns/ldns.h>
122- int main()
123- {
124- #ifdef LDNS_REVISION
125- if (LDNS_REVISION != $CHECK_LDNS_VERSION)
126- return 0;
127- #endif
128- return 1;
129- }
130- ]])
131- ],[
132- AC_MSG_RESULT([ok])
133- ],[
134- AC_MSG_RESULT([no])
135- AC_MSG_ERROR([ldns version $1.$2.$3 is not compatible due to $4])
136- ],[])
137- AC_LANG_POP([C])
138-
139- CPPFLAGS=$tmp_CPPFLAGS
140+AU_ALIAS([CHECK_LDNS], [ACX_LDNS])
141+AC_DEFUN([ACX_LDNS], [
142+ found=false
143+ AC_ARG_WITH([ldns],
144+ [AS_HELP_STRING([--with-ldns=DIR],
145+ [root of the lnds directory])],
146+ [
147+ case "$withval" in
148+ "" | y | ye | yes | n | no)
149+ AC_MSG_ERROR([Invalid --with-lnds value])
150+ ;;
151+ *) ldnsdirs="$withval"
152+ ;;
153+ esac
154+ ], [
155+ # if pkg-config is installed and lnds has installed a .pc file,
156+ # then use that information and don't search ldnsdirs
157+ AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
158+ if test x"$PKG_CONFIG" != x""; then
159+ OPENSSL_LDFLAGS=`$PKG_CONFIG ldns --libs-only-L 2>/dev/null`
160+ if test $? = 0; then
161+ LDNS_LIBS=`$PKG_CONFIG ldns --libs-only-l 2>/dev/null`
162+ LDNS_INCLUDES=`$PKG_CONFIG ldns --cflags-only-I 2>/dev/null`
163+ found=true
164+ fi
165+ fi
166+
167+ # no such luck; use some default ldnsdirs
168+ if ! $found; then
169+ ldnsdirs="/usr/local/ldns /usr/lib/ldns /usr/ldns /usr/local /usr"
170+ fi
171+ ]
172+ )
173+
174+
175+ if ! $found; then
176+ LDNS_INCLUDES=
177+ for ldnsdir in $ldnsdirs; do
178+ AC_MSG_CHECKING([for LDNS in $ldnsdir])
179+ if test -f "$ldnsdir/include/ldns/dnssec.h"; then
180+ LDNS_INCLUDES="-I$ldnsdir/include"
181+ LDNS_LDFLAGS="-L$ldnsdir/lib"
182+ LDNS_LIBS="-lldns"
183+ found=true
184+ AC_MSG_RESULT([yes])
185+ break
186+ else
187+ AC_MSG_RESULT([no])
188+ fi
189+ done
190+
191+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
192+ # it will just work!
193+ fi
194+
195+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
196+ LIBS="$LDNS_LIBS $LIBS"
197+ CPPFLAGS="$LDNS_INCLUDES $CPPFLAGS"
198+
199+ AC_SUBST([LDNS_INCLUDES])
200+ AC_SUBST([LDNS_LIBS])
201+ AC_SUBST([LDNS_LDFLAGS])
202 ])
203Index: opendnssec-2.1.6/configure.ac
204===================================================================
205--- opendnssec-2.1.6.orig/configure.ac
206+++ opendnssec-2.1.6/configure.ac
207@@ -138,9 +138,7 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_
208
209 # common dependencies
210 ACX_LIBXML2
211-ACX_LDNS(1,6,17)
212-ACX_LDNS_NOT(1,6,14, [binary incompatibility, see http://open.nlnetlabs.nl/pipermail/ldns-users/2012-October/000564.html])
213-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])
214+ACX_LDNS(1.6.17)
215 ACX_PKCS11_MODULES
216 ACX_RT
217 ACX_LIBC