Re: [MaraDNS list] freebsd support

Nicholas Bamber <[email protected]> Thu, 05 Jan 2012 17:51:27 +0000
Newsgroups gmane.network.dns.maradns.general
Organization Periapt Technologies
Message-ID <[email protected]>
Here is what I think the raw upstream Makefile.freebsd would be.

On 05/01/12 16:10, Sam Trenholme wrote:
> Could you make that a 'diff -u' instead of just a plain 'diff'.  Hard
> to tell which file to change.  Or, more simply, send me the
> Makefile.freebsd directly and I'll add it to the next MaraDNS 2
> release.
> 
> - Sam
> 
> On Thu, Jan 5, 2012 at 4:15 AM, Nicholas Bamber <[email protected]> wrote:
>> Sam,
>>        In the 1.4.x series maradns build perfectly well on Debian feebsd. I
>> have just verified that it continues to do so in the 2.0.x series. In
>> order to do so, of course I had to contruct a Makefile. The attached
>> file shows the post-patch diff between the 1.4 and 2.0 versions of
>> build/Makefile.linux. I applied the same changes to the 1.4 version of
>> build/Makefile.freebsd and it worked. I would appreciate it if you could
>> restore support for freebsd.
>>
>> --
>> Nicholas Bamber | http://www.periapt.co.uk/
>> PGP key 3BFFE73C from pgp.mit.edu


-- 
Nicholas Bamber | http://www.periapt.co.uk/
PGP key 3BFFE73C from pgp.mit.edu
Makefile.freebsd (text/plain, 2.5 KB)
# Server objects
SOBJECTS=server/MaraBigHash.o
# js_string library (buffer overflow resistant string library) objects
JOBJS=libs/JsStr.o libs/JsStrOS.o libs/JsStrCP.o 
# MaraHash (assosciative array) library objects
MHOBJS=libs/MaraHash.o
# Parser objects
POBJECTS=parse/ParseMaraRc.o parse/ParseCsv1.o ../parse/ParseIpAcl.o
# DNS query processing library objects
DOBJECTS=dns/Queries.o dns/Compress.o dns/bobbit.o
# Secure random number generator objects
ROBJECTS=rng/rng-api-fst.o rng/rng-alg-fst.o
OBJECTS=$(JOBJS) $(MHOBJS) $(SOBJECTS) $(DOBJECTS) $(POBJECTS) $(DOBJECTS) $(ROBJECTS)
EXECS=server/maradns

# Uncomment the following three lines to get this to compile on Solaris
# LDFLAGS=-lxnet
# CC=gcc $(LDFLAGS) -DSELECT_PROBLEM
# M="CC=$(CC)"
# These are currently unused, but will be needed again if we use flock() again
# CFLAGS=-I/usr/ucbinclude 
# L="CC=$(CC) $(CFLAGS)"
# LDFLAGS=-L/usr/ucblib -lucb -lxnet
# end the Solaris section
# Non-Solaris version of "M"
M="VERSION=$(VERSION)"
Q="DEFINES=-DSELECT_PROBLEM"

# FreeBSD needs some special flags to compile MaraDNS
CC="cc -O2 -Wall -pipe -D_THREAD_SAFE -pthread"
M=CC=$(CC) 
V="VERSION=$(VERSION)"

# Debug
D=$(M) DEBUG=-DDEBUG

FLAGS = -O2 -Wall 
#FLAGS = -g

all: 
	cd libs ; make $(M) ; cd ../dns ; make $(M) ; \
	cd ../rng ; make $(M) ; cd ../parse ; make $(M) ; \
	cd ../qual ; make $(M) ; cd ../server ; \
	make $(M) $(Q) COMPILED=\"$(COMPILED)\" $(V) ; \
	cd ../tools ; make $(M) ; \
	cd ../deadwood-*/src/ ; make FLAGS="-O2"; \
	cd ../../tcp ; make $(M) $(V) ; cat ../00README.FIRST

debug: 
	cd libs ; make $(D) DEBUG="-DDEBUG -DTHREADS" ; \
	cd ../dns ; make $(D) ; cd ../rng ; make $(D) ; \
	cd ../parse ; make $(D) ; cd ../qual ; make $(D) ; \
	cd ../server ; \
	make $(D) $(Q) COMPILED=\"$(COMPILED_DEBUG)\" ; \
	cd ../tools ; make $(D) ; \
	cd ../tcp ; make $(D) ; cat ../00README.FIRST

clean:
	rm -f $(OBJECTS) core $(EXECS) ; \
	cd dns ; make clean ; \
	cd ../libs ; make clean ; cd ../parse ; make clean ; \
	cd ../qual ; make clean ; \
	cd ../server ; make clean ; \
	cd ../test ; make clean ; \
	cd ../tools ; make clean ; \
	cd misc ; make clean ; \
	cd ../../utf8 ; make clean ; \
	cd ../tcp ; make clean ; \
	cd ../rng ; make clean ; \
	cd ../sqa ; make clean ; \
	cd ../deadwood-*/src ; make clean ; \
	# ; cd .. ; find . -type d | grep .deps | xargs rm -fr ; find . -name '*.o' | xargs rm

strip:
	cd server; strip maradns ; cd ../tcp ; \
	strip zoneserver getzone fetchzone ; \
	cd ../tools ; strip askmara

install:
	VERSION=$(VERSION) ./build/install.sh

uninstall:
	VERSION=$(VERSION) ./build/uninstall.sh