-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathconfigure
executable file
·220 lines (203 loc) · 7.62 KB
/
configure
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#!/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: '--noipv6'
IPV6="yes"
if [ "$1" = '--ipv6' ] ; then
echo '--ipv6 enabled (Note: now default)'
elif [ "$1" = '--noipv6' ] ; then
IPV6=""
echo 'IPv6 disabled'
elif [ -z "$1" ] ; then
echo 'WARNING: ipv6 now enabled by default. Use --noipv6 to'
echo 'compile MaraDNS w/o IPv6 support'
elif [ -n "$1" ] ; then
echo 'Usage: ./configure [options]'
echo 'Where [options] currently supports "--ipv6" for'
echo 'making an ipv6-capable build of MaraDNS (default)'
echo 'and "--noipv6" for making a build *without* IPv6 support'
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 or the Git repo was pulled\)
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- )
# However, since 3.5 releases are copies of the Git tree, make sure
# we have the correct version there
if echo $USE_GIT | grep 3.5 > /dev/null ; then
echo VERSION=$USE_GIT > VERSION
elif [ -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-" substr($2,1,10)}' > 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
DEADWOOD="$( echo deadwood-*/src )"
cp ${DEADWOOD}/Makefile.ubuntu2204 ${DEADWOOD}/Makefile
echo It looks like you are using Linux\; 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 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
DEADWOOD_DIR=$( echo deadwood-* )
cp $DEADWOOD_DIR/src/Makefile.mingw342 $DEADWOOD_DIR/src/Makefile
cp COPYING 00README.FIRST
exit 0
elif echo $UNAME | grep -i cygwin > /dev/null ; then
cat $BUILDDIR/Makefile.noflock >> Makefile
DEADWOOD="$( echo deadwood-*/src )"
cp ${DEADWOOD}/Makefile.xcygwin ${DEADWOOD}/Makefile
echo It looks like you are using Cygwin\; this will compile fine
echo by typing in \'make\'.
echo
echo Note that Deadwood and coLunacyDNS may not compile\; use the
echo pre-built Windows services in the maradns-win32/ directory.
echo These services are built using mingw.
echo
echo To start MaraDNS \(authoritative\) as a service:
echo
echo cygrunsrv.exe --install MaraDNS --path /usr/local/bin/maradns.exe
echo cygrunsrv.exe -S MaraDNS
echo
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
DEADWOOD_DIR=$( echo deadwood-* )
cp $DEADWOOD_DIR/src/Makefile.noip6 $DEADWOOD_DIR/src/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
fi
# While Lunacy *could* use readline, we use the API compatible
# editline instead. Editline is available at
# https://github.com/troglobit/editline (use a release at
# https://github.com/troglobit/editline/releases/ if autoconf
# issues pop up) and is available under a BSD-like license
# (One has to add credit to documentation, but otherwise it's BSD)
# Mirror:
# maradns.samiam.org/lunacy/editline-1.17.1.tar.gz
if [ -e /usr/local/include/editline.h ] ; then
cp coLunacyDNS/Makefile.editline coLunacyDNS/Makefile
else
cp coLunacyDNS/Makefile.default coLunacyDNS/Makefile
fi
if [ -z "$CC" ] ; then
echo
echo Be sure to do this before running \'make\':
echo
echo ' 'CC=cc \# Change this to gcc/clang/tcc if desired
echo ' 'export CC
fi
echo
exit $EXITCODE