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=$CFLAGS'-g -Wall -O2'
157 LDFLAGS=$LDFLAGS'-g -Wall -O2'
160 CFLAGS=$CFLAGS'-g -O2'
161 LDFLAGS=$LDFLAGS'-g -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 CRYPTO_LIB_NAME="libgcrypt"
194 CFLAGS=$CFLAGS' -DUSE_NETTLE'
195 LDFLAGS=$LDFLAGS' -lnettle'
196 CRYPTO_LIB_NAME="Nettle"
199 CFLAGS=$CFLAGS' -DUSE_SSL_CRYPTO'
200 LDFLAGS=$LDFLAGS' -lcrypto'
201 CRYPTO_LIB_NAME="OpenSSL"
204 CFLAGS=$CFLAGS' -DNO_CRYPT'
205 CRYPTO_LIB_NAME="none"
208 echo "unknown crypto library: $$CRYPTO_LIB"
212 echo "crypto-library: $CRYPTO_LIB_NAME"
214 if [ $PASSPHRASE -eq 0 ]; then
215 CFLAGS=$CFLAGS' -DNO_PASSPHRASE'
216 echo "disabling master key and salt passphrase"
219 if [ -z "$SBINDIR" ]; then
223 if [ -z "$ETCDIR" ]; then
227 if [ -z "$MANDIR" ]; then
228 MANDIR=$PREFIX/share/man
231 if [ -z "$EXAMPLESDIR" ]; then
232 EXAMPLESDIR=$PREFIX/share/examples
235 cat > include.mk <<EOF
236 # this file was created automatically
237 # do not edit this file directly
238 # use ./configure instead
252 if [ $CRYPTO_LIB = "none" ]; then
253 echo "NO_CRYPT_OBJ = 1" >> include.mk
256 if [ $INSTALLMANPAGE -eq 1 ]; then
257 echo "MANDIR := $MANDIR" >> include.mk
258 echo "installing manpage"
260 echo "not installing manpage"
263 if [ $INSTALLEXAMPLES -eq 1 ]; then
264 echo "EXAMPLESDIR := $EXAMPLESDIR" >> include.mk
265 echo "installing example files"
267 echo "not installing example files"
270 VERSION=`cat ../version`
271 if which git >/dev/null; then
272 GIT_HASH=`git rev-parse HEAD 2> /dev/null`
273 if [ -n "$GIT_HASH" ]; then
274 VERSION="$VERSION (git $GIT_HASH)"
278 cat > version.h <<EOF
280 * uanytun version info
282 * this file was created automatically
283 * do not edit this file directly
284 * use ./configure instead
287 #ifndef UANYTUN_version_h_INCLUDED
288 #define UANYTUN_version_h_INCLUDED
290 #define VERSION_STRING "uanytun version $VERSION"
291 #define CRYPTO_LIB_NAME "$CRYPTO_LIB_NAME"