Mercurial > hg > quicktun
annotate build.sh @ 13:f7e0145d8e2a
solaris support
author | Gabor Adam Toth <tg@tgbit.net> |
---|---|
date | Sat, 08 Jan 2011 02:25:17 +0100 |
parents | 5be1ecb80cc9 |
children | d9dfeeaff7e8 |
rev | line source |
---|---|
0 | 1 #!/bin/sh |
13 | 2 |
3 tar=tar | |
4 | |
5 if [ `uname -s` == "SunOS" ]; then | |
6 echo "Detected SunOS" | |
7 tar=gtar | |
8 CFLAGS="$CFLAGS -DSOLARIS -m64" | |
9 LDFLAGS="$LDFLAGS -lnsl -lsocket" | |
10 fi | |
11 | |
0 | 12 echo Cleaning up... |
13 rm -rf out/ obj/ tmp/ | |
14 | |
15 mkdir -p out | |
16 echo Creating source archive... | |
13 | 17 $tar --transform "s,^\.,quicktun-`cat version`," -czf "out/quicktun-`cat version`.tgz" . --exclude "./out" --exclude "./lib" --exclude "./debian/data" |
0 | 18 |
19 mkdir -p obj tmp lib | |
20 | |
13 | 21 echo Checking for NaCl library... |
0 | 22 if [ ! -e lib/libnacl.a ]; then |
13 | 23 echo building... |
0 | 24 mkdir tmp/nacl |
25 cd tmp/nacl | |
26 wget -q -O- http://hyperelliptic.org/nacl/nacl-20090405.tar.bz2 | bunzip2 | tar -xf - --strip-components 1 | |
27 ./do | |
28 cd ../../ | |
29 cp tmp/nacl/build/*/lib/*/libnacl.a lib/ | |
30 cp tmp/nacl/build/*/include/*/crypto_box.h include/ | |
31 cp tmp/nacl/build/*/include/*/crypto_box_curve25519salsa20hmacsha512.h include/ | |
32 cp tmp/nacl/build/*/include/*/crypto_box_curve25519xsalsa20poly1305.h include/ | |
33 fi | |
34 echo Done. | |
35 | |
36 export CPATH=./include/ | |
7 | 37 export LIBRARY_PATH=/usr/local/lib/:./lib/ |
0 | 38 |
39 echo Building combined binary... | |
13 | 40 gcc $CFLAGS -c -DCOMBINED_BINARY src/proto.raw.c -o obj/proto.raw.o |
41 gcc $CFLAGS -c -DCOMBINED_BINARY src/crypto_scalarmult_curve25519.c -o obj/crypto_scalarmult_curve25519.o | |
42 gcc $CFLAGS -c -DCOMBINED_BINARY src/proto.nacl0.c -o obj/proto.nacl0.o | |
43 gcc $CFLAGS -c -DCOMBINED_BINARY src/proto.nacltai.c -o obj/proto.nacltai.o | |
44 gcc $CFLAGS -c -DCOMBINED_BINARY src/run.combined.c -o obj/run.combined.o | |
45 gcc $CFLAGS -c src/common.c -o obj/common.o | |
46 gcc $CFLAGS -o out/quicktun.combined obj/common.o obj/run.combined.o obj/proto.raw.o obj/proto.nacl0.o obj/proto.nacltai.o obj/crypto_scalarmult_curve25519.o -lnacl $LDFLAGS | |
0 | 47 |
48 echo Building single protocol binaries... | |
13 | 49 gcc $CFLAGS -o out/quicktun.raw src/proto.raw.c $LDFLAGS |
50 gcc $CFLAGS -o out/quicktun.nacl0 src/proto.nacl0.c -lnacl $LDFLAGS | |
51 gcc $CFLAGS -o out/quicktun.nacltai src/proto.nacltai.c src/crypto_scalarmult_curve25519.c -lnacl $LDFLAGS | |
52 gcc $CFLAGS -o out/quicktun.keypair src/keypair.c -lnacl $LDFLAGS | |
0 | 53 |
54 echo Building shared libraries... | |
13 | 55 gcc $CFLAGS -fPIC -shared -Wl,-soname,quicktun.raw -o out/libquicktun.raw src/proto.raw.c |
56 ##gcc $CFLAGS -fPIC -shared -Wl,-soname,quicktun.nacl0 -o out/libquicktun.nacl0 src/proto.nacl0.c -lnacl $LDFLAGS | |
0 | 57 |
58 ##echo Building frontends... | |
13 | 59 ##gcc $CFLAGS -o out/quicktun.debian src/run.debian.c -ldl |
0 | 60 |
11
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
61 if [ -f /etc/network/interfaces ]; then |
0 | 62 echo Building debian binary... |
13 | 63 gcc $CFLAGS -c -DCOMBINED_BINARY -DDEBIAN_BINARY src/run.combined.c -o obj/run.debian.o |
64 gcc $CFLAGS -o out/quicktun.debian obj/common.o obj/run.debian.o obj/proto.raw.o obj/proto.nacl0.o obj/proto.nacltai.o obj/crypto_scalarmult_curve25519.o -lnacl $LDFLAGS | |
11
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
65 if [ -x /usr/bin/dpkg-deb -a -x /usr/bin/fakeroot ]; then |
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
66 echo -n Building debian package... |
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
67 cd debian |
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
68 ./build.sh |
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
69 cd .. |
5be1ecb80cc9
Fixed build script for debian systems without packaging tools, removed packet logging from nacltai
root <root@Really.UFO-Net.nl>
parents:
7
diff
changeset
|
70 fi |
0 | 71 fi |