~samiam/MaraDNS

ref: 3.5.0002 MaraDNS/configure -rwxr-xr-x 5.9 KiB View raw
db09084f — Sam Trenholme MaraDNS release 3.5.0002 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/sh

EXITCODE=0

if [ $0 != "./configure" ] ; then
	echo This script needs to be executed in the directory that
	echo contains this script.
	exit 1
fi

# MaraDNS 2.0 is AUTHONLY
AUTHONLY="yes"
export AUTHONLY

# Options: '--ipv6'
if [ "$1" = '--ipv6' ] ; then
	IPV6="yes"
elif [ -n "$1" ] ; then
	echo 'Usage: ./configure [options]'
	echo 'Where [options] currently only supports "--ipv6" for'
	echo 'making an ipv6-capable build of MaraDNS'
	exit 1
fi

# Make sure we are running this script from the maradns base directory
if [ $( pwd | awk -F/ '{print $NF}' | cut -f1 -d- | tr '[A-Z]' '[a-z]' ) \
		 != "maradns" ] ; then
	echo This script needs to be run from the MaraDNS base
	echo directory \(the top-level directory created when the
	echo MaraDNS tar file was extracted\)
	exit 1
fi

# Set the directory for the build files
BUILDDIR=build
export BUILDDIR

# Show them the disclaimer
cat 00README.FIRST
echo -----
echo

# Try to determine what kind of system we are running
UNAME=`uname -s`

# Make sure the Makefile has the current version number of MaraDNS
# VERSION is a one line file in the form "VERSION=0.1.23" (without the
# quotes

# Now that this is in github, pull the version number from the git log
USE_GIT=$( pwd | cut -f2 -d- )
if [ -e .git ] || [ "$USE_GIT" = "master" ] ; then
	git log -1 > git.commit 2> /dev/null || echo unknown > git.commit
        head -1 git.commit | awk '
                {print "VERSION=git-"$NF}' > VERSION
fi
# Looks like github sometimes scrubs symlinks
if [ ! -e server/MaraDNS_locale.h ] ; then
	cp server/MaraDNS_en.h server/MaraDNS_locale.h
	cp server/MaraBigHash_en.h server/MaraBigHash_locale.h
	cp tcp/getzone_en.h tcp/getzone_locale.h
fi

if [ -f VERSION ] ; then
	cp VERSION Makefile
elif [ -f $BUILDDIR/VERSION ] ; then
	cp $BUILDDIR/VERSION Makefile
else
	pwd | awk -F- '{if($2 ~ /Q/){print "VERSION="$2 "-" $3 "-" $4}
		else{print "VERSION="$NF}}' > Makefile
fi

# Set up the informaiton on where and when this version of MaraDNS was
# compiled
SA="system at"
if [ -z "$IPV6" ] ; then
	echo COMPILED=\"$UNAME system at `date`\" >> Makefile
	echo COMPILED_DEBUG=\"$UNAME system at `date`\ \(Debug\)\" >> Makefile
else
	echo COMPILED=\"$UNAME system at `date` \(IPv6\)\" >> Makefile
      echo COMPILED_DEBUG=\"$UNAME $SA `date`\ \(Debug IPv6\)\" >> Makefile
fi

# Give them a message dependent on what kind of system they have
if echo $UNAME | grep -i linux > /dev/null ; then
	cat $BUILDDIR/Makefile.linux >> Makefile
	echo It looks like you are using Linux\; just type in \'make\'
	EXITCODE=0
elif echo $UNAME | grep -i mingw32 > /dev/null ; then
	cat $BUILDDIR/Makefile.mingw32 >> Makefile
	echo It looks like you are using MinGW32 \; this is only a partial
	echo port of MaraDNS and does not have all of the security features
	echo of other ports of MaraDNS.  Only MaraDNS and Askmara will
	echo compile.  You need mingw32 and pthreads to compile this.
	echo You have been warned.
	# We don't support --authonly for the mingw32 port
	# Other Makefile changes
	cp server/Makefile.mingw32 server/Makefile
	cp tools/Makefile.mingw32 tools/Makefile
	cp qual/Makefile.nothreads qual/Makefile
	cp dns/Makefile.authonly dns/Makefile
	# Mingw32 doesn't support symlinks
	cp server/MaraBigHash_en.h server/MaraBigHash_locale.h
	cp server/MaraDNS_en.h server/MaraDNS_locale.h
	cp COPYING 00README.FIRST
	exit 0
elif echo $UNAME | grep -i cygwin > /dev/null ; then
	cat $BUILDDIR/Makefile.noflock >> Makefile
	echo It looks like you are using Cygwin\; this might compile fine
	echo by typing in \'make\'.
	echo ' '
	echo THIS IS NOT A SUPPORTED PLATFORM.
	echo DO NOT WASTE MY TIME FILING GITHUB ISSUES ABOUT THIS PLATFORM.
	echo
	echo To install Deadwood by hand, please read 
	echo deadwood-github/INSTALL.txt
	EXITCODE=0
# This is a a template for adding support to a new OS for MaraDNS.
# Some points: If you port MaraDNS, make sure the underlying OS has
# /dev/urandom support or have the default mararc have a
# random_seed_file mararc variable pointing to a file with good
# randomness.  Make sure this port compiles and installs.  Take
# responsibility for people who have problems with this port.
elif echo $UNAME | grep -i SomeNewPortOfMaradns > /dev/null ; then
	cat $BUILDDIR/Makefile.SomeNewPort >> Makefile
	echo It looks like you are using NAME OF OS HERE\; this port has
        echo been done by YOUR NAME AND CONTACT INFO HERE\; this should
 	echo compile fine by typing in \'make\'.  If you encounter any
	echo problems with this port, please contact the person who has
	echo done the port before trying to contact the MaraDNS	
	echo developer.
	# The next line is technically optional, but should be here
	EXITCODE=0
else
	cat $BUILDDIR/Makefile.noflock >> Makefile
	echo WARNING WARNING WARNING
	echo
	echo This is an unknown platform.  MaraDNS may or may not compile
	echo on this platform.  THIS IS NOT A SUPPORTED PLATFORM.
	echo DO NOT WASTE MY TIME FILING GITHUB ISSUES ABOUT THIS PLATFORM.
	echo
	echo To install Deadwood by hand, please read 
	echo deadwood-github/INSTALL.txt 
	echo
	echo I encourage you to make a fork of MaraDNS for this
	echo platform so other users may not see this obnoxious
	echo warning.
	echo
	echo I ask that any fork of MaraDNS not be called \"MaraDNS\"
	echo
	echo You might be able to compile MaraDNS by typing \"make\"
	echo \(if you typed in \"make\" before, just type it again\)
	echo
	echo THIS PORT HAS NOT BEEN TESTED\; USE AT YOUR OWN RISK
	EXITCODE=1
fi

# Set up recursive and authoritative name serving
if [ -z "$IPV6" ] ; then
	cp server/Makefile.authonly server/Makefile
	cp qual/Makefile.nothreads qual/Makefile
	cp tcp/Makefile.authonly tcp/Makefile
	cp dns/Makefile.authonly dns/Makefile
	cp tools/Makefile.authonly tools/Makefile
else
	cp server/Makefile.ipv6 server/Makefile
	cp qual/Makefile.nothreads qual/Makefile
	cp tcp/Makefile.ipv6 tcp/Makefile
	cp dns/Makefile.authonly dns/Makefile
	cp tools/Makefile.ipv6 tools/Makefile
	cp deadwood-*/src/Makefile.ipv6 deadwood-*/src/Makefile
fi

echo
exit $EXITCODE