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
|
#!/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
# Options: '--authonly'
if [ "$1" = '--authonly' ] ; then
AUTHONLY="yes"
elif [ -n "$1" ] ; then
echo 'Usage: ./configure [options]'
echo 'Where [options] currently only supports "--authonly" for'
echo 'making an authoritative-only 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-` != "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
if [ -f VERSION ] ; then
cp VERSION Makefile
elif [ -f $BUILDDIR/VERSION ] ; then
cp $BUILDDIR/VERSION Makefile
else
pwd | awk -F- '{print "VERSION="$NF}' > Makefile
fi
# Set up the informaiton on where and when this version of MaraDNS was
# compiled
SA="system at"
if [ -z "$AUTHONLY" ] ; then
echo COMPILED=\"$UNAME system at `date`\" >> Makefile
echo COMPILED_DEBUG=\"$UNAME system at `date`\ \(Debug\)\" >> Makefile
else
echo COMPILED=\"$UNAME system at `date` \(authonly\)\" >> Makefile
echo COMPILED_DEBUG=\"$UNAME $SA `date`\ \(Debug authonly\)\" >> Makefile
fi
# Give them a message dependent on what kind of systme 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 freebsd > /dev/null ; then
cat $BUILDDIR/Makefile.freebsd >> Makefile
echo It looks like you are using FreeBSD\; this should compile
echo fine by typing in \'make\'. There is an official port here:
echo
echo http://www.freebsd.org/cgi/cvsweb.cgi/ports/dns/maradns/
echo
echo Which may be on your system here:
echo
echo /usr/ports/dns/maradns
echo
EXITCODE=0
elif echo $UNAME | grep -i openbsd > /dev/null ; then
cat $BUILDDIR/Makefile.freebsd >> Makefile
echo It looks like you are using OpenBSD\; this should compile
echo fine by typing 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.threadsafe qual/Makefile
cp dns/Makefile.recursive 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 should compile fine
echo by typing in \'make\'.
EXITCODE=0
elif echo $UNAME | grep -i darwin > /dev/null ; then
cat $BUILDDIR/Makefile.darwin >> Makefile
cp $BUILDDIR/install.darwin $BUILDDIR/install.locations
echo It looks like you are using Darwin \(usually\; Mac OS X\)\;
#echo This should compile fine by typing in \'make\'.
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 FULLY TESTED\; USE AT YOUR OWN RISK
EXITCODE=1
# 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. If you are able to sucessfully compile
echo and install MaraDNS on this platform, please let me know
echo by contacting me. My contact info is here:
echo
echo http://www.maradns.org/contact.html
echo
echo I encourage you to make an official port of MaraDNS for this
echo platform so other users of MaraDNS do not see this obnoxious
echo warning.
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 "$AUTHONLY" ] ; then
cp server/Makefile.recursive server/Makefile
# FreeBSD uses -pthread instead of -lpthread to compile a
# Pthread program
if echo $UNAME | grep -i freebsd > /dev/null ; then
cat server/Makefile.recursive | \
sed 's/lpthread/pthread/' > server/Makefile
fi
cp qual/Makefile.threadsafe qual/Makefile
cp tcp/Makefile.recursive tcp/Makefile
cp dns/Makefile.recursive dns/Makefile
else
cp server/Makefile.authonly server/Makefile
cp qual/Makefile.nothreads qual/Makefile
cp tcp/Makefile.authonly tcp/Makefile
cp dns/Makefile.authonly dns/Makefile
fi
echo
exit $EXITCODE
|