]>
Commit | Line | Data |
---|---|---|
1c3d8873 SS |
1 | diff -Nur a/configure.ac b/configure.ac |
2 | --- a/configure.ac 2012-05-04 12:13:23.000000000 +0200 | |
3 | +++ b/configure.ac 2012-10-13 17:10:49.686258971 +0200 | |
4 | @@ -162,6 +162,32 @@ | |
5 | fi | |
6 | AC_MSG_RESULT($enable_verbose_logging) | |
7 | ||
8 | +AC_MSG_CHECKING(whether we will try to link in system PolarSSL) | |
9 | +AC_ARG_WITH([system-polarssl], | |
10 | + [AC_HELP_STRING([--without-system-polarssl], [Do not use system PolarSSL])], | |
11 | + [system_polarssl=$withval], | |
12 | + [system_polarssl=yes]) | |
13 | +AC_MSG_RESULT($system_polarssl) | |
14 | +AM_CONDITIONAL(HAVE_LIBPOLARSSL, false) | |
15 | +if test x$system_polarssl = xyes; then | |
16 | + AC_MSG_CHECKING([PolarSSL version >= 1.1]) | |
17 | + AC_COMPILE_IFELSE( | |
18 | + [AC_LANG_PROGRAM( | |
19 | + [[ | |
20 | +#include <polarssl/version.h> | |
21 | + ]], | |
22 | + [[ | |
23 | +#if POLARSSL_VERSION_MAJOR < 1 || (POLARSSL_VERSION_MAJOR == 1 && POLARSSL_VERSION_MINOR < 1) | |
24 | +#error invalid version | |
25 | +#endif | |
26 | + ]] | |
27 | + )], [use_system_polarssl=yes], [use_system_polarssl=no]) | |
28 | + AC_MSG_RESULT($use_system_polarssl) | |
29 | +fi | |
30 | +if test x$use_system_polarssl = xyes; then | |
31 | + AC_CHECK_LIB([polarssl], [sha1_hmac]) | |
32 | +fi | |
33 | + | |
34 | AC_MSG_CHECKING(whether we will be linking in Botan 1.10) | |
35 | AC_ARG_ENABLE(botan1.10, | |
36 | [ --enable-botan1.10 Use Botan 1.10],enable_botan110=yes, enable_botan110=no) | |
37 | diff -Nur a/pdns/Makefile.am b/pdns/Makefile.am | |
38 | --- a/pdns/Makefile.am 2012-05-04 12:13:23.000000000 +0200 | |
39 | +++ b/pdns/Makefile.am 2012-10-13 17:11:56.293629151 +0200 | |
40 | @@ -1,4 +1,8 @@ | |
41 | -AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind @THREADFLAGS@ $(LUA_CFLAGS) $(SQLITE3_CFLAGS) -Iext/polarssl-1.1.2/include | |
42 | +if HAVE_LIBPOLARSSL | |
43 | +AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind @THREADFLAGS@ $(LUA_CFLAGS) $(SQLITE3_CFLAGS) -DPDNS_ENABLE_LUA | |
44 | +else | |
45 | +AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind @THREADFLAGS@ $(LUA_CFLAGS) $(SQLITE3_CFLAGS) -Iext/polarssl-1.1.2/include -DPDNS_ENABLE_LUA | |
46 | +endif | |
47 | AM_CPPFLAGS=-Ibackends/bind $(BOOST_CPPFLAGS) @THREADFLAGS@ | |
48 | ||
49 | EXTRA_DIST = dnslabeltext.rl dnslabeltext.cc mtasker.cc inflighter.cc docs/pdns_control.8 \ | |
50 | @@ -7,7 +11,11 @@ | |
51 | no-dnssec.schema.mysql.sql no-dnssec.schema.pgsql.sql no-dnssec.schema.sqlite3.sql \ | |
52 | bind-dnssec.schema.sqlite3.sql | |
53 | ||
54 | +if HAVE_LIBPOLARSSL | |
55 | +SUBDIRS= backends | |
56 | +else | |
57 | SUBDIRS= ext/polarssl-1.1.2 backends | |
58 | +endif | |
59 | ||
60 | BUILT_SOURCES=bind-dnssec.schema.sqlite3.sql.h | |
61 | ||
62 | @@ -130,7 +138,11 @@ | |
63 | aes/aescrypt.c aes/aes.h aes/aeskey.c aes/aes_modes.c aes/aesopt.h \ | |
64 | aes/aestab.c aes/aestab.h aes/brg_endian.h aes/brg_types.h aes/dns_random.cc \ | |
65 | randomhelper.cc dns.cc | |
66 | +if HAVE_LIBPOLARSSL | |
67 | +tsig_tests_LDFLAGS= | |
68 | +else | |
69 | tsig_tests_LDFLAGS= -Lext/polarssl-1.1.2/library | |
70 | +endif | |
71 | tsig_tests_LDADD= -lpolarssl | |
72 | ||
73 | ||
74 | diff -Nur a/pdns/backends/bind/Makefile.am b/pdns/backends/bind/Makefile.am | |
75 | --- a/pdns/backends/bind/Makefile.am 2012-05-04 12:13:23.000000000 +0200 | |
76 | +++ b/pdns/backends/bind/Makefile.am 2012-10-13 17:10:49.691259001 +0200 | |
77 | @@ -34,10 +34,18 @@ | |
78 | ../../nsecrecords.cc ../../dnssecinfra.cc ../../base32.cc ../../md5.cc # ../../dbdnsseckeeper.cc | |
79 | ||
80 | zone2ldap_LDFLAGS=@THREADFLAGS@ | |
81 | +if HAVE_LIBPOLARSSL | |
82 | +zone2ldap_LDADD= | |
83 | +else | |
84 | zone2ldap_LDADD= ../../ext/polarssl-1.1.2/library/libpolarssl.a | |
85 | +endif | |
86 | ||
87 | zone2sql_LDFLAGS=@THREADFLAGS@ | |
88 | +if HAVE_LIBPOLARSSL | |
89 | +zone2sql_LDADD= | |
90 | +else | |
91 | zone2sql_LDADD= ../../ext/polarssl-1.1.2/library/libpolarssl.a | |
92 | +endif | |
93 | ||
94 | AM_LFLAGS = -s -i | |
95 | AM_YFLAGS = -d --verbose --debug | |
96 | diff -Nur a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc | |
97 | --- a/pdns/dnssecinfra.cc 2012-05-04 12:13:23.000000000 +0200 | |
98 | +++ b/pdns/dnssecinfra.cc 2012-10-13 17:10:49.690258995 +0200 | |
99 | @@ -9,7 +9,11 @@ | |
100 | #include <boost/algorithm/string.hpp> | |
101 | #include "dnssecinfra.hh" | |
102 | #include "dnsseckeeper.hh" | |
103 | +#ifdef HAVE_LIBPOLARSSL | |
104 | +#include <polarssl/sha1.h> | |
105 | +#else | |
106 | #include "ext/polarssl-1.1.2/include/polarssl/sha1.h" | |
107 | +#endif | |
108 | #include <boost/assign/std/vector.hpp> // for 'operator+=()' | |
109 | #include <boost/assign/list_inserter.hpp> | |
110 | #include "base64.hh" | |
111 | diff -Nur a/pdns/polarrsakeyinfra.cc b/pdns/polarrsakeyinfra.cc | |
112 | --- a/pdns/polarrsakeyinfra.cc 2012-05-04 12:13:23.000000000 +0200 | |
113 | +++ b/pdns/polarrsakeyinfra.cc 2012-10-13 17:10:49.689258989 +0200 | |
114 | @@ -1,9 +1,18 @@ | |
115 | +#ifdef HAVE_LIBPOLARSSLSSL | |
116 | +#include <polarssl/rsa.h> | |
117 | +#include <polarssl/base64.h> | |
118 | +#include <polarssl/sha1.h> | |
119 | +#include <polarssl/sha2.h> | |
120 | +#include <polarssl/sha4.h> | |
121 | +#include <polarssl/havege.h> | |
122 | +#else | |
123 | #include "ext/polarssl-1.1.2/include/polarssl/rsa.h" | |
124 | #include "ext/polarssl-1.1.2/include/polarssl/base64.h" | |
125 | #include "ext/polarssl-1.1.2/include/polarssl/sha1.h" | |
126 | #include "ext/polarssl-1.1.2/include/polarssl/sha2.h" | |
127 | #include "ext/polarssl-1.1.2/include/polarssl/sha4.h" | |
128 | #include "ext/polarssl-1.1.2/include/polarssl/havege.h" | |
129 | +#endif | |
130 | #include <boost/assign/std/vector.hpp> // for 'operator+=()' | |
131 | #include <boost/foreach.hpp> | |
132 | #include "dnssecinfra.hh" |