Skip to content

Commit

Permalink
use external libevent library.
Browse files Browse the repository at this point in the history
  • Loading branch information
cofyc committed Sep 29, 2013
1 parent dae5b57 commit 06527e5
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "dnscrypt-proxy"]
path = dnscrypt-proxy
url = https://github.com/jedisct1/dnscrypt-proxy
[submodule "argparse"]
path = argparse
url = https://github.com/Cofyc/argparse
18 changes: 3 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ BINDIR = $(PREFIX)/bin

uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')

FINAL_CFLAGS = $(CFLAGS) -O2 -std=c99 -pedantic -Wall -Idnscrypt-proxy/src/libevent-modified/include
FINAL_LDFLAGS = $(LDFLAGS) -lm -lsodium
FINAL_CFLAGS = $(CFLAGS) -O2 -std=c99 -pedantic -Wall
FINAL_LDFLAGS = $(LDFLAGS) -lm -lsodium -levent

ifeq ($(uname_S),Linux)
FINAL_LDFLAGS += -lrt
endif

LIB_H = dnscrypt.h udp_request.h edns.h logger.h dnscrypt-proxy/src/libevent-modified/include/event2/event.h
LIB_H = dnscrypt.h udp_request.h edns.h logger.h

LIB_OBJS += dnscrypt.o
LIB_OBJS += udp_request.o
Expand All @@ -31,25 +31,13 @@ LIB_OBJS += cert.o
LIB_OBJS += pidfile.o

LDADD += argparse/libargparse.a
LDADD += dnscrypt-proxy/src/libevent-modified/.libs/libevent.a

argparse/libargparse.a: argparse/argparse.h
@make -C argparse libargparse.a

argparse/argparse.h:
git submodule update --init argparse

dnscrypt-proxy/src/libevent-modified/include/event2/event.h: dnscrypt-proxy/src/libevent-modified/.libs/libevent.a

dnscrypt-proxy/configure: dnscrypt-proxy/autogen.sh
cd dnscrypt-proxy && ./autogen.sh && ./configure

dnscrypt-proxy/src/libevent-modified/.libs/libevent.a: dnscrypt-proxy/configure
make -C dnscrypt-proxy/src/libevent-modified

dnscrypt-proxy/autogen.sh:
git submodule update --init dnscrypt-proxy

$(LIB_OBJS): $(LIB_H)

all:: dnscrypt-wrapper
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ This software is modified from
Installation
============

Install [libsodium](https://github.com/jedisct1/libsodium).
Install [libsodium](https://github.com/jedisct1/libsodium) and libevent first.

On Linux, don't forget to run `ldconfig` if you installed it from
source.

Expand Down
1 change: 0 additions & 1 deletion dnscrypt-proxy
Submodule dnscrypt-proxy deleted from 64c8ed
3 changes: 1 addition & 2 deletions udp_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ self_serve_cert_file(struct context *c, struct dns_header *header, size_t dns_qu
unsigned char *p;
unsigned char *ansp;
int q;
int qtype, qclass;
int qtype;
unsigned int nameoffset;
p = (unsigned char *)(header + 1);
int anscount = 0;
Expand All @@ -216,7 +216,6 @@ self_serve_cert_file(struct context *c, struct dns_header *header, size_t dns_qu
return -1;
}
GETSHORT(qtype, p);
GETSHORT(qclass, p);
if (qtype == T_TXT && strcasecmp(c->provider_name, c->namebuff) == 0) {
// reply with signed certificate
size_t size = 1 + sizeof(struct SignedCert);
Expand Down

0 comments on commit 06527e5

Please sign in to comment.