mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-21 15:21:05 -05:00
- Fix windows compile to compile with sldns.
git-svn-id: file:///svn/unbound/trunk@3024 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
ce71d4dedf
commit
cdaa9995e8
6 changed files with 22 additions and 44 deletions
2
configure
vendored
2
configure
vendored
|
|
@ -16955,7 +16955,7 @@ else
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
/* routine to load gost (from ldns) */
|
/* routine to load gost (from sldns) */
|
||||||
int load_gost_id(void)
|
int load_gost_id(void)
|
||||||
{
|
{
|
||||||
static int gost_id = 0;
|
static int gost_id = 0;
|
||||||
|
|
|
||||||
|
|
@ -614,7 +614,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
#include <openssl/engine.h>
|
#include <openssl/engine.h>
|
||||||
#include <openssl/conf.h>
|
#include <openssl/conf.h>
|
||||||
/* routine to load gost (from ldns) */
|
/* routine to load gost (from sldns) */
|
||||||
int load_gost_id(void)
|
int load_gost_id(void)
|
||||||
{
|
{
|
||||||
static int gost_id = 0;
|
static int gost_id = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
3 Dec 2013: Wouter
|
3 Dec 2013: Wouter
|
||||||
- Fix sldns to use sldns_ prefix for all ldns_ variables.
|
- Fix sldns to use sldns_ prefix for all ldns_ variables.
|
||||||
|
- Fix windows compile to compile with sldns.
|
||||||
|
|
||||||
30 Nov 2013: Wouter
|
30 Nov 2013: Wouter
|
||||||
- Fix sldns to make globals use sldns_ prefix. This fixes
|
- Fix sldns to make globals use sldns_ prefix. This fixes
|
||||||
|
|
|
||||||
|
|
@ -10,14 +10,11 @@ This software is under BSD license, see LICENSE for details.
|
||||||
http://unbound.net/svn/
|
http://unbound.net/svn/
|
||||||
|
|
||||||
* Uses the following libraries;
|
* Uses the following libraries;
|
||||||
* ldns http://www.nlnetlabs.nl/ldns/ (BSD license)
|
|
||||||
(required) can use ldns build directory directly with --with-ldns=path.
|
|
||||||
* libevent http://www.monkey.org/~provos/libevent/ (BSD license)
|
* libevent http://www.monkey.org/~provos/libevent/ (BSD license)
|
||||||
(optional) can use builtin alternative instead.
|
(optional) can use builtin alternative instead.
|
||||||
|
* libexpat (for the unbound-anchor helper program) (MIT license)
|
||||||
|
|
||||||
* Make and install: ./configure; make; make install
|
* Make and install: ./configure; make; make install
|
||||||
* --with-ldns=/path/to/ldns
|
|
||||||
It will dynamically link against it.
|
|
||||||
* --with-libevent=/path/to/libevent
|
* --with-libevent=/path/to/libevent
|
||||||
Can be set to either the system install or the build directory.
|
Can be set to either the system install or the build directory.
|
||||||
--with-libevent=no (default) gives a builtin alternative
|
--with-libevent=no (default) gives a builtin alternative
|
||||||
|
|
@ -36,8 +33,8 @@ This software is under BSD license, see LICENSE for details.
|
||||||
programming errors, among which buffer overflows. The program exits
|
programming errors, among which buffer overflows. The program exits
|
||||||
with an error if an assertion fails (but the buffer did not overflow).
|
with an error if an assertion fails (but the buffer did not overflow).
|
||||||
* --enable-static-exe
|
* --enable-static-exe
|
||||||
This enables a debug option to statically link, against ldns and
|
This enables a debug option to statically link against the
|
||||||
libevent libraries.
|
libevent library.
|
||||||
* --enable-lock-checks
|
* --enable-lock-checks
|
||||||
This enables a debug option to check lock and unlock calls. It needs
|
This enables a debug option to check lock and unlock calls. It needs
|
||||||
a recent pthreads library to work.
|
a recent pthreads library to work.
|
||||||
|
|
|
||||||
|
|
@ -43,28 +43,18 @@ Note, if your username contains a space, create a directory
|
||||||
C:\msys\...\home\user to work in (click on MSYS; type: mkdir /home/user ).
|
C:\msys\...\home\user to work in (click on MSYS; type: mkdir /home/user ).
|
||||||
|
|
||||||
2. Install openssl, or compile it yourself. http://www.openssl.org
|
2. Install openssl, or compile it yourself. http://www.openssl.org
|
||||||
Ldns and unbound need the header files and libraries. Static linking makes
|
Unbounds need the header files and libraries. Static linking makes
|
||||||
things easier. This is an open source library for cryptographic functions.
|
things easier. This is an open source library for cryptographic functions.
|
||||||
|
And libexpat is needed.
|
||||||
|
|
||||||
3. Compile LDNS
|
3. Compile Unbound
|
||||||
Get the source code tarball http://nlnetlabs.nl/ldns
|
|
||||||
Move it into the C:\msys\...\home\user directory.
|
|
||||||
Double click on the MSYS icon and give these commands
|
|
||||||
$ cd /home/user
|
|
||||||
$ tar xzvf ldns-xxx.tar.gz
|
|
||||||
$ cd ldns-xxx
|
|
||||||
$ ./configure
|
|
||||||
If you compiled openssl yourself, pass --with-ssl=../openssl-xxx
|
|
||||||
$ make
|
|
||||||
|
|
||||||
4. Compile Unbound
|
|
||||||
Get the source code tarball http://unbound.net
|
Get the source code tarball http://unbound.net
|
||||||
Move it into the C:\msys\...\home\user directory.
|
Move it into the C:\msys\...\home\user directory.
|
||||||
Double click on the MSYS icon and give these commands
|
Double click on the MSYS icon and give these commands
|
||||||
$ cd /home/user
|
$ cd /home/user
|
||||||
$ tar xzvf unbound-xxx.tar.gz
|
$ tar xzvf unbound-xxx.tar.gz
|
||||||
$ cd unbound-xxx
|
$ cd unbound-xxx
|
||||||
$ ./configure --enable-static-exe --with-ldns=../ldns-xxx
|
$ ./configure --enable-static-exe
|
||||||
If you compiled openssl yourself, pass --with-ssl=../openssl-xxx too.
|
If you compiled openssl yourself, pass --with-ssl=../openssl-xxx too.
|
||||||
If you compiled libexpat yourself, pass --with-libexpat=../expat-install too.
|
If you compiled libexpat yourself, pass --with-libexpat=../expat-install too.
|
||||||
The configure options for libevent or threads are not applicable for
|
The configure options for libevent or threads are not applicable for
|
||||||
|
|
|
||||||
|
|
@ -79,37 +79,27 @@ do_lookup(struct ub_ctx* ctx, char* domain)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** get answer into ldns rr list */
|
|
||||||
static sldns_rr_list*
|
|
||||||
result2answer(struct ub_result* result)
|
|
||||||
{
|
|
||||||
sldns_pkt* p = NULL;
|
|
||||||
sldns_rr_list* a;
|
|
||||||
if(sldns_wire2pkt(&p, result->answer_packet, (size_t)result->answer_len)
|
|
||||||
!= LDNS_STATUS_OK)
|
|
||||||
return NULL;
|
|
||||||
a = sldns_pkt_answer(p);
|
|
||||||
sldns_pkt_set_answer(p, NULL);
|
|
||||||
sldns_pkt_free(p);
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** print result to file */
|
/** print result to file */
|
||||||
static void
|
static void
|
||||||
do_print(struct ub_result* result, char* file)
|
do_print(struct ub_result* result, char* file)
|
||||||
{
|
{
|
||||||
FILE* out;
|
FILE* out = fopen(file, "w");
|
||||||
sldns_rr_list* list = result2answer(result);
|
char s[65535], t[32];
|
||||||
if(!list) fatal("result2answer failed");
|
int i;
|
||||||
|
|
||||||
out = fopen(file, "w");
|
|
||||||
if(!out) {
|
if(!out) {
|
||||||
perror(file);
|
perror(file);
|
||||||
fatal("fopen failed");
|
fatal("fopen failed");
|
||||||
}
|
}
|
||||||
sldns_rr_list_print(out, list);
|
i = 0;
|
||||||
|
while(result->data[i]) {
|
||||||
|
sldns_wire2str_rdata_buf((uint8_t*)result->data[i],
|
||||||
|
(size_t)result->len[i], s, sizeof(s),
|
||||||
|
(uint16_t)result->qtype)
|
||||||
|
sldns_wire2str_type_buf((uint16_t)result->qtype, t, sizeof(t));
|
||||||
|
fprintf(out, "%s\t%s\t%s\n", result->qname, t, s);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
sldns_rr_list_deep_free(list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** update domain to file */
|
/** update domain to file */
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue