-
Notifications
You must be signed in to change notification settings - Fork 37
/
make_freebsd
executable file
·46 lines (32 loc) · 3.29 KB
/
make_freebsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/local/bin/bash
export VERBOSE=3
export DNS_PARSER=OS
rm -f vlmcsd-* vlmcs-* vlmcsdmulti-* *_all.* 2>/dev/null
rm -f vlmcsdmulti vlmcsd vlmcs 2>/dev/null
MAKEFLAGS="-B -j12"
REUSEOBJFLAGS="-j12"
CF="-flto=12 -static-libgcc -pipe -fwhole-program -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
CFCLANG="-pipe -fno-common -fno-exceptions -fno-stack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fmerge-all-constants"
LF="-Wl,-z,norelro -Wl,--hash-style=gnu -Wl,--build-id=none"
LFCLANG="-Wl,-z,norelro -Wl,--hash-style=gnu"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x64-gcc CLIENT_NAME=vlmcs-FreeBSD-10.1-x64-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64-gcc CC=gcc5 CFLAGS="$CF" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.1-x64 PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.1-x64 MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x64 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CLIENT_NAME=vlmcs-FreeBSD-10.1-x86 PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm -f vlmcs.o vlmcsd.o vlmcsdmulti.o *_all.*
gmake $REUSEOBJFLAGS vlmcsdmulti-FreeBSD-10.1-x86 MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x86 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
gmake $MAKEFLAGS allmulti CAT=2 MULTI_NAME=vlmcsdmulti-FreeBSD-10.1-x86-gcc CLIENT_NAME=vlmcs-FreeBSD-10.1-x86-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86-gcc CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.1-x64-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.1-x64-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64-threads THREADS=1 CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS vlmcsd-FreeBSD-10.1-x86-threads PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86-threads THREADS=1 CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="-lpthread $LF"
gmake $MAKEFLAGS CAT=2 vlmcsd-FreeBSD-10.1-x86-threads-gcc PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86-threads-gcc THREADS=1 CC=gcc5 CFLAGS="$CF -m32 -DCOMPAT_32BIT" LDFLAGS="-lpthread -L/usr/lib32 -B/usr/lib32 $LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.1-x64-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x64-openssl1.0.1-EXPERIMENTAL CC=clang36 CFLAGS="$CFCLANG" LDFLAGS="$LF"
gmake $MAKEFLAGS CRYPTO=openssl_with_aes CLIENT_NAME=vlmcs-FreeBSD-10.1-x86-openssl1.0.1-EXPERIMENTAL PROGRAM_NAME=vlmcsd-FreeBSD-10.1-x86-openssl1.0.1-EXPERIMENTAL CC=clang36 CFLAGS="$CFCLANG -m32" LDFLAGS="$LF"
rm *.o
strip -s --strip-unneeded --remove-section=.eh_frame_hdr --remove-section=.eh_frame --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag vlmcs-* vlmcsd-* vlmcsdmulti-*
sstrip -z vlmcs-* vlmcsd-* vlmcsdmulti-*
sudo cp -af vlmcsd-FreeBSD-10.1-x86-gcc /usr/local/sbin/vlmcsd
sudo cp -af vlmcs-FreeBSD-10.1-x86-gcc /usr/local/bin/vlmcs
# Copy everything to distribution server
scp -p vlmcsdmulti-* vlmcsd-* vlmcs-* root@ubuntu64:x/binaries/FreeBSD/intel/