5 # The secure anycast tunneling protocol (satp) defines a protocol used
6 # for communication between any combination of unicast and anycast
7 # tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
8 # mode and allows tunneling of every ETHER TYPE protocol (e.g.
9 # ethernet, ip, arp ...). satp directly includes cryptography and
10 # message authentication based on the methodes used by SRTP. It is
11 # intended to deliver a generic, scaleable and secure solution for
12 # tunneling and relaying of packets of any protocol.
15 # Copyright (C) 2007-2009 Othmar Gsenger, Erwin Nindl,
16 # Christian Pointner <satp@wirdorange.org>
18 # This file is part of Anytun.
20 # Anytun is free software: you can redistribute it and/or modify
21 # it under the terms of the GNU General Public License as published by
22 # the Free Software Foundation, either version 3 of the License, or
25 # Anytun is distributed in the hope that it will be useful,
26 # but WITHOUT ANY WARRANTY; without even the implied warranty of
27 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 # GNU General Public License for more details.
30 # You should have received a copy of the GNU General Public License
31 # along with anytun. If not, see <http://www.gnu.org/licenses/>.
38 CXXFLAGS='-g -Wall -O2 -DLOG_SYSLOG -DLOG_FILE -DLOG_STDOUT'
39 LDFLAGS='-g -Wall -O2 -lboost_thread -lboost_serialization -lboost_system -lboost_date_time -lpthread'
55 echo "configure --help print this"
56 echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
57 echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
58 echo " --bindir=<DIR> the path to the bin directory (default: $PREFIX/bin)"
59 echo " --sbindir=<DIR> the path to the sbin directory (default: $PREFIX/sbin)"
60 echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc"
61 echo " --mandir=<DIR> the path to the system man pages (default: $PREFIX/share/man)"
62 echo " --no-manpage dont't install manpages"
63 echo " --examplesdir=<DIR> the path to the examples files (default: $PREFIX/share/examples)"
64 echo " --no-examples dont't install example files"
65 echo " --use-ssl-crypto use ssl crypto library instead of libgcrypt"
66 echo " --no-crypto disable crypto at all (only NULL cipher)"
67 echo " --disable-passphrase disable master key and salt passphrase"
68 echo " --enable-passphrase enable master key and salt passphrase"
69 echo " --disable-routing disable built-in routing capability"
70 echo " --enable-routing enable built-in routing capability"
77 TARGET=${arg#--target=}
80 PREFIX=${arg#--prefix=}
83 SBINDIR=${arg#--bindir=}
86 SBINDIR=${arg#--sbindir=}
89 ETCDIR=${arg#--sysconfdir=}
92 MANDIR=${arg#--mandir=}
98 EXAMPLESDIR=${arg#--examplesdir=}
112 --disable-passphrase)
129 ERRORS="$ERRORS $arg"
134 if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
135 for error in $ERRORS; do
136 echo "Unknown argument: $error"
149 ln -sf linux/tunDevice.cpp
150 rm -f signalHandler.hpp
151 ln -sf posix/signalHandler.hpp
153 ln -sf posix/sysExec.hpp
154 rm -f daemonService.h daemonService.cpp
155 ln -sf posix/posixDaemon.h daemonService.h
156 ln -sf posix/posixDaemon.cpp daemonService.cpp
157 echo "loading Linux specific TUN Device"
159 OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD)
161 ln -sf bsd/tunDevice.cpp
162 rm -f signalHandler.hpp
163 ln -sf posix/signalHandler.hpp
165 ln -sf posix/sysExec.hpp
166 rm -f daemonService.h daemonService.cpp
167 ln -sf posix/posixDaemon.h daemonService.h
168 ln -sf posix/posixDaemon.cpp daemonService.cpp
169 echo "loading BSD specific TUN Device"
170 CXXFLAGS=$CXXFLAGS' -I/usr/local/include'
171 LDFLAGS=$LDFLAGS' -L/usr/local/lib'
174 echo "platform not supported"
181 LDFLAGS=$LDFLAGS' -lgcrypt -lgpg-error'
182 echo "using libgcrypt library"
185 CXXFLAGS=$CXXFLAGS' -DUSE_SSL_CRYPTO'
186 LDFLAGS=$LDFLAGS' -lcrypto'
187 echo "using ssl crypto library"
190 CXXFLAGS=$CXXFLAGS' -DNO_CRYPT'
191 echo "disabling crypto"
195 if [ $PASSPHRASE -eq 0 ]; then
196 CXXFLAGS=$CXXFLAGS' -DNO_PASSPHRASE'
197 echo "disabling master key and salt passphrase"
200 if [ $ROUTING -eq 0 ]; then
201 CXXFLAGS=$CXXFLAGS' -DNO_ROUTING'
202 echo "disabling built-in routing capability"
205 if [ -z "$BINDIR" ]; then
209 if [ -z "$SBINDIR" ]; then
213 if [ -z "$ETCDIR" ]; then
217 if [ -z "$MANDIR" ]; then
218 MANDIR=$PREFIX/share/man
221 if [ -z "$EXAMPLESDIR" ]; then
222 EXAMPLESDIR=$PREFIX/share/examples
225 cat > include.mk <<EOF
226 # this file was created automatically
227 # do not edit this file directly
228 # use ./configure instead
244 if [ $CRYPTO_LIB = "none" ]; then
245 echo "NO_CRYPT_OBJ = 1" >> include.mk
248 if [ $INSTALLMANPAGE -eq 1 ]; then
249 echo "MANDIR := $MANDIR" >> include.mk
250 echo "installing manpage"
252 echo "not installing manpage"
255 if [ $INSTALLEXAMPLES -eq 1 ]; then
256 echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
257 echo "installing example files"
259 echo "not installing example files"
262 VERSION=`cat ../version`
263 if which svn >/dev/null; then
264 SVN_REV=`svn info 2> /dev/null | grep "^Revision: " | awk '{print($2)}'`
265 if [ -n "$SVN_REV" ]; then
266 VERSION="$VERSION (svn$SVN_REV)"
270 DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
272 cat > version.h <<EOF
274 * anytun version info
276 * this file was created automatically
277 * do not edit this file directly
278 * use ./configure instead
281 #ifndef ANYTUN_version_h_INCLUDED
282 #define ANYTUN_version_h_INCLUDED
284 #define VERSION_STRING_0 " version $VERSION"
285 #define VERSION_STRING_1 "built on $HOSTNAME, $DATE"