5 # uAnytun is a tiny implementation of SATP. Unlike Anytun which is a full
6 # featured implementation uAnytun has no support for multiple connections
7 # or synchronisation. It is a small single threaded implementation intended
8 # to act as a client on small platforms.
9 # The secure anycast tunneling protocol (satp) defines a protocol used
10 # for communication between any combination of unicast and anycast
11 # tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
12 # mode and allows tunneling of every ETHER TYPE protocol (e.g.
13 # ethernet, ip, arp ...). satp directly includes cryptography and
14 # message authentication based on the methodes used by SRTP. It is
15 # intended to deliver a generic, scaleable and secure solution for
16 # tunneling and relaying of packets of any protocol.
19 # Copyright (C) 2007-2010 Christian Pointner <equinox@anytun.org>
21 # This file is part of uAnytun.
23 # uAnytun is free software: you can redistribute it and/or modify
24 # it under the terms of the GNU General Public License as published by
25 # the Free Software Foundation, either version 3 of the License, or
28 # uAnytun is distributed in the hope that it will be useful,
29 # but WITHOUT ANY WARRANTY; without even the implied warranty of
30 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 # GNU General Public License for more details.
33 # You should have received a copy of the GNU General Public License
34 # along with uAnytun. If not, see <http://www.gnu.org/licenses/>.
42 LDFLAGS='-g -Wall -O2'
56 echo "configure --help print this"
57 echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
58 echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
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 manpage"
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"
75 TARGET=${arg#--target=}
78 PREFIX=${arg#--prefix=}
81 SBINDIR=${arg#--sbindir=}
84 ETCDIR=${arg#--sysconfdir=}
87 MANDIR=${arg#--mandir=}
93 EXAMPLESDIR=${arg#--examplesdir=}
104 --disable-passphrase)
118 ERRORS="$ERRORS $arg"
123 if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
124 for error in $ERRORS; do
125 echo "Unknown argument: $error"
138 echo "loading Linux specific TUN Device"
140 OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD)
143 echo "loading BSD specific TUN Device"
144 CFLAGS=$CFLAGS' -I/usr/local/include'
145 LDFLAGS=$LDFLAGS' -L/usr/local/lib'
148 echo "platform not supported"
156 LDFLAGS=$LDFLAGS' -lgcrypt'
157 echo "using libgcrypt library"
160 CFLAGS=$CFLAGS' -DUSE_SSL_CRYPTO'
161 LDFLAGS=$LDFLAGS' -lcrypto'
162 echo "using ssl crypto library"
165 CFLAGS=$CFLAGS' -DNO_CRYPT'
166 echo "NO_CRYPT_OBJ = 1" >> include.mk
167 echo "disabling crypto"
171 if [ $PASSPHRASE -eq 0 ]; then
172 CFLAGS=$CFLAGS' -DNO_PASSPHRASE'
173 echo "disabling master key and salt passphrase"
176 if [ -z "$SBINDIR" ]; then
180 if [ -z "$ETCDIR" ]; then
184 if [ -z "$MANDIR" ]; then
185 MANDIR=$PREFIX/share/man
188 if [ -z "$EXAMPLESDIR" ]; then
189 EXAMPLESDIR=$PREFIX/share/examples
192 cat >> include.mk <<EOF
193 # this file was created automatically
194 # do not edit this file directly
195 # use ./configure instead
209 if [ $INSTALLMANPAGE -eq 1 ]; then
210 echo "MANDIR := $MANDIR" >> include.mk
211 echo "installing manpage"
213 echo "not installing manpage"
216 if [ $INSTALLEXAMPLES -eq 1 ]; then
217 echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
218 echo "installing example files"
220 echo "not installing example files"
223 VERSION=`cat ../version`
224 if which svn >/dev/null; then
225 SVN_REV=`svn info | grep "^Revision: " | awk '{print($2)}'`
226 if [ -n "$SVN_REV" ]; then
227 VERSION="$VERSION (svn$SVN_REV)"
231 DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
233 cat >> version.h <<EOF
235 * uanytun version info
237 * this file was created automatically
238 * do not edit this file directly
239 * use ./configure instead
242 #ifndef UANYTUN_version_h_INCLUDED
243 #define UANYTUN_version_h_INCLUDED
245 #define VERSION_STRING_0 "uanytun version $VERSION"
246 #define VERSION_STRING_1 "built on $HOSTNAME, $DATE"