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 methods 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-2014 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/>.
36 # In addition, as a special exception, the copyright holders give
37 # permission to link the code of portions of this program with the
38 # OpenSSL library under certain conditions as described in each
39 # individual source file, and distribute linked combinations
41 # You must obey the GNU General Public License in all respects
42 # for all of the code used other than OpenSSL. If you modify
43 # file(s) with this exception, you may extend this exception to your
44 # version of the file(s), but you are not obligated to do so. If you
45 # do not wish to do so, delete this exception statement from your
46 # version. If you delete this exception statement from all source
47 # files in the program, then also delete it here.
67 echo "configure --help print this"
68 echo " --target=<TARGET> build target i.e. Linux (default: autodetect)"
69 echo " --prefix=<PREFIX> the installation prefix (default: /usr/local)"
70 echo " --sbindir=<DIR> the path to the sbin directory (default: $PREFIX/sbin)"
71 echo " --sysconfdir=<DIR> the path to the system configuration directory (default: $PREFIX/etc"
72 echo " --mandir=<DIR> the path to the system man pages (default: $PREFIX/share/man)"
73 echo " --no-manpage dont't install manpage"
74 echo " --examplesdir=<DIR> the path to the examples files (default: $PREFIX/share/examples)"
75 echo " --no-examples dont't install example files"
76 echo " --use-gcrypt use libgcrypt (this is the default)"
77 echo " --use-nettle use libnettle instead of libgcrypt"
78 echo " --use-ssl-crypto use openssl crypto library instead of libgcrypt"
79 echo " --no-crypto disable crypto at all (only NULL cipher)"
80 echo " --disable-passphrase disable master key and salt passphrase"
81 echo " --enable-passphrase enable master key and salt passphrase"
82 echo " --use-clang use clang/llvm as compiler/linker"
89 TARGET=${arg#--target=}
95 PREFIX=${arg#--prefix=}
98 SBINDIR=${arg#--sbindir=}
101 ETCDIR=${arg#--sysconfdir=}
104 MANDIR=${arg#--mandir=}
110 EXAMPLESDIR=${arg#--examplesdir=}
127 --disable-passphrase)
141 ERRORS="$ERRORS $arg"
146 if [ -n "$ERRORS" ] && [ $EBUILD_COMPAT -ne 1 ]; then
147 for error in $ERRORS; do
148 echo "Unknown argument: $error"
155 if [ $USE_CLANG -eq 0 ]; then
156 CFLAGS='-g -Wall -O2'
157 LDFLAGS='-g -Wall -O2'
171 echo "loading Linux specific TUN Device"
173 OpenBSD|FreeBSD|NetBSD|GNU/kFreeBSD)
176 echo "loading BSD specific TUN Device"
177 CFLAGS=$CFLAGS' -I/usr/local/include'
178 LDFLAGS=$LDFLAGS' -L/usr/local/lib'
181 echo "platform not supported"
189 CFLAGS=$CFLAGS' -DUSE_GCRYPT'
190 LDFLAGS=$LDFLAGS' -lgcrypt'
191 echo "using gcrypt library"
194 CFLAGS=$CFLAGS' -DUSE_NETTLE'
195 LDFLAGS=$LDFLAGS' -lnettle'
196 echo "using nettle library"
199 CFLAGS=$CFLAGS' -DUSE_SSL_CRYPTO'
200 LDFLAGS=$LDFLAGS' -lcrypto'
201 echo "using ssl crypto library"
204 CFLAGS=$CFLAGS' -DNO_CRYPT'
205 echo "disabling crypto"
209 if [ $PASSPHRASE -eq 0 ]; then
210 CFLAGS=$CFLAGS' -DNO_PASSPHRASE'
211 echo "disabling master key and salt passphrase"
214 if [ -z "$SBINDIR" ]; then
218 if [ -z "$ETCDIR" ]; then
222 if [ -z "$MANDIR" ]; then
223 MANDIR=$PREFIX/share/man
226 if [ -z "$EXAMPLESDIR" ]; then
227 EXAMPLESDIR=$PREFIX/share/examples
230 cat > include.mk <<EOF
231 # this file was created automatically
232 # do not edit this file directly
233 # use ./configure instead
247 if [ $CRYPTO_LIB = "none" ]; then
248 echo "NO_CRYPT_OBJ = 1" >> include.mk
251 if [ $INSTALLMANPAGE -eq 1 ]; then
252 echo "MANDIR := $MANDIR" >> include.mk
253 echo "installing manpage"
255 echo "not installing manpage"
258 if [ $INSTALLEXAMPLES -eq 1 ]; then
259 echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
260 echo "installing example files"
262 echo "not installing example files"
265 VERSION=`cat ../version`
266 if which svn >/dev/null; then
267 SVN_REV=`svn info 2> /dev/null | grep "^Revision: " | awk '{print($2)}'`
268 if [ -n "$SVN_REV" ]; then
269 VERSION="$VERSION (svn$SVN_REV)"
273 DATE=`date +"%d.%m.%Y %H:%M:%S %Z"`
275 cat > version.h <<EOF
277 * uanytun version info
279 * this file was created automatically
280 * do not edit this file directly
281 * use ./configure instead
284 #ifndef UANYTUN_version_h_INCLUDED
285 #define UANYTUN_version_h_INCLUDED
287 #define VERSION_STRING_0 "uanytun version $VERSION"
288 #define VERSION_STRING_1 "built on $HOSTNAME, $DATE"