dcc1b1f0edf6becb87358d7291ca4b3ce0c353a5
[openwrt/svn-archive/archive.git] / package / network / services / dnsmasq / patches / 001-Build-config-add-DNO_GMP-for-use-with-nettle-mini-gm.patch
1 From 063efb330a3f341c2548e2cf1f67f83e49cd6395 Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Tue, 17 Jun 2014 19:49:31 +0100
4 Subject: [PATCH] Build config: add -DNO_GMP for use with nettle/mini-gmp
5
6 ---
7 Makefile | 2 +-
8 bld/pkg-wrapper | 9 +++++++--
9 src/config.h | 7 +++++++
10 src/dnssec.c | 3 ++-
11 4 files changed, 17 insertions(+), 4 deletions(-)
12
13 --- a/Makefile
14 +++ b/Makefile
15 @@ -61,7 +61,7 @@ lua_cflags = `echo $(COPTS) | $(top)/
16 lua_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_LUASCRIPT $(PKG_CONFIG) --libs lua5.1`
17 nettle_cflags = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --cflags nettle hogweed`
18 nettle_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --libs nettle hogweed`
19 -gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC $(PKG_CONFIG) --copy -lgmp`
20 +gmp_libs = `echo $(COPTS) | $(top)/bld/pkg-wrapper HAVE_DNSSEC NO_GMP --copy -lgmp`
21 sunos_libs = `if uname | grep SunOS >/dev/null 2>&1; then echo -lsocket -lnsl -lposix4; fi`
22 version = -DVERSION='\"`$(top)/bld/get-version $(top)`\"'
23
24 --- a/bld/pkg-wrapper
25 +++ b/bld/pkg-wrapper
26 @@ -11,9 +11,14 @@ in=`cat`
27
28 if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \
29 echo $in | grep $search >/dev/null 2>&1; then
30 -
31 +# Nasty, nasty, in --copy, arg 2 is another config to search for, use with NO_GMP
32 if [ $op = "--copy" ]; then
33 - pkg="$*"
34 + if grep "^\#[[:space:]]*define[[:space:]]*$pkg" config.h >/dev/null 2>&1 || \
35 + echo $in | grep $pkg >/dev/null 2>&1; then
36 + pkg=""
37 + else
38 + pkg="$*"
39 + fi
40 elif grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \
41 echo $in | grep ${search}_STATIC >/dev/null 2>&1; then
42 pkg=`$pkg --static $op $*`
43 --- a/src/config.h
44 +++ b/src/config.h
45 @@ -105,6 +105,8 @@ HAVE_AUTH
46 define this to include the facility to act as an authoritative DNS
47 server for one or more zones.
48
49 +HAVE_DNSSEC
50 + include DNSSEC validator.
51
52 NO_IPV6
53 NO_TFTP
54 @@ -118,6 +120,11 @@ NO_AUTH
55 which are enabled by default in the distributed source tree. Building dnsmasq
56 with something like "make COPTS=-DNO_SCRIPT" will do the trick.
57
58 +NO_NETTLE_ECC
59 + Don't include the ECDSA cypher in DNSSEC validation. Needed for older Nettle versions.
60 +NO_GMP
61 + Don't use and link against libgmp, Useful if nettle is built with --enable-mini-gmp.
62 +
63 LEASEFILE
64 CONFFILE
65 RESOLVFILE
66 --- a/src/dnssec.c
67 +++ b/src/dnssec.c
68 @@ -26,7 +26,8 @@
69 # include <nettle/ecc-curve.h>
70 #endif
71 #include <nettle/nettle-meta.h>
72 -#include <gmp.h>
73 +#include <nettle/bignum.h>
74 +
75
76 #define SERIAL_UNDEF -100
77 #define SERIAL_EQ 0