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-2008 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'
57 echo "configure --help print this"
58 echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
59 echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
60 echo " --sbindir=<DIR> the path to the sbin directory (default: $PREFIX/sbin)"
61 echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc"
62 echo " --mandir=<DIR> the path to the system man pages (default: $PREFIX/share/man)"
63 echo " --no-manpage dont't install manpage"
64 echo " --examplesdir=<DIR> the path to the examples files (default: $PREFIX/share/examples)"
65 echo " --no-examples dont't install example files"
66 echo " --use-ssl-crypto use ssl crypto library instead of libgcrypt"
67 echo " --no-crypto disable crypto at all (only NULL cipher)"
68 echo " --disable-passphrase disable master key and salt passphrase"
69 echo " --enable-passphrase enable master key and salt passphrase"
70 echo " --disable-v4-mapped disable V4-Mapped addresses (this means to disable"
71 echo " simultanious use of IPv4 and IPv6)"
72 echo " --enable-v4-mapped enable V4-Mapped addresses"
79 TARGET=${arg#--target=}
82 PREFIX=${arg#--prefix=}
85 SBINDIR=${arg#--sbindir=}
88 ETCDIR=${arg#--sysconfdir=}
91 MANDIR=${arg#--mandir=}
97 EXAMPLESDIR=${arg#--examplesdir=}
108 --disable-passphrase)
128 ERRORS="$ERRORS $arg"
133 if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
134 for error in $ERRORS; do
135 echo "Unknown argument: $error"
148 echo "loading Linux specific TUN Device"
150 OpenBSD|FreeBSD|NetBSD)
153 echo "loading BSD specific TUN Device"
154 CFLAGS=$CFLAGS' -I/usr/local/include'
155 LDFLAGS=$LDFLAGS' -L/usr/local/lib'
156 if [ $V4_MAPPED -ne 2 ]; then
161 echo "Plattform not supported"
169 LDFLAGS=$LDFLAGS' -lgcrypt'
170 echo "using libgcrypt library"
173 CFLAGS=$CFLAGS' -DUSE_SSL_CRYPTO'
174 LDFLAGS=$LDFLAGS' -lcrypto'
175 echo "using ssl crypto library"
178 CFLAGS=$CFLAGS' -DNO_CRYPT'
179 echo "NO_CRYPT_OBJ = 1" >> include.mk
180 echo "disabling crypto"
184 if [ $PASSPHRASE -eq 0 ]; then
185 CFLAGS=$CFLAGS' -DNO_PASSPHRASE'
186 echo "disabling master key and salt passphrase"
189 if [ $V4_MAPPED -eq 0 ]; then
190 CFLAGS=$CFLAGS' -DNO_V4MAPPED'
191 echo "WARNING: disabling V4 mapped addresses, this prevents uanytun from using IPv6 and IPv4 Sockets at the same time"
194 if [ -z "$SBINDIR" ]; then
198 if [ -z "$ETCDIR" ]; then
202 if [ -z "$MANDIR" ]; then
203 MANDIR=$PREFIX/share/man
206 if [ -z "$EXAMPLESDIR" ]; then
207 EXAMPLESDIR=$PREFIX/share/examples
210 cat >> include.mk <<EOF
211 # this file was created automatically
212 # do not edit this file directly
213 # use ./configure instead
227 if [ $INSTALLMANPAGE -eq 1 ]; then
228 echo "MANDIR := $MANDIR" >> include.mk
229 echo "installing manpage"
231 echo "not installing manpage"
234 if [ $INSTALLEXAMPLES -eq 1 ]; then
235 echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
236 echo "installing example files"
238 echo "not installing example files"