forked from nasa/DTNME
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_clang_dtnme.sh
83 lines (66 loc) · 2.44 KB
/
make_clang_dtnme.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#/bin/bash
cd third_party/oasys
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to change directory to the oasys_source directory\n"
exit 1
fi
sh build-configure.sh
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to run build-configure.sh for oasys\n"
exit 1
fi
# The OASYS default configuration is usually sufficient for DTNME.
./configure \
--with-cc=/usr/local/clang+llvm/bin/clang --with-cxx=/usr/local/clang+llvm/bin/clang++ \
--with-extra-ldflags="-L/usr/local/clang+llvm/lib" \
--with-extra-cflags="-fsanitize=address -fno-omit-frame-pointer -fno-common -fsanitize-address-use-after-scope -fno-optimize-sibling-calls -std=c11" \
--with-extra-cxxflags="-fsanitize=address -fno-omit-frame-pointer -fno-common -std=c++14 -g -fstandalone-debug -fsanitize-address-use-after-scope -fno-optimize-sibling-calls -Wno-undefined-var-template"
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to configure oasys\n"
exit 1
fi
make
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to make oasys\n"
exit 1
fi
cd ../../
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to change directory back to the dtnme base directory\n"
exit 1
fi
sh build-configure.sh
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to run 'build-configure.sh' for dtnme\n"
exit 1
fi
# The DTNME default configuration is usually sufficient for DTNME
# add --without-dtpc if you do not want to enable DTPC
# add --with-wolfssl if you want to use TLS secourity in TCP CLv4 (and install wolfssl in third_party directory)
./configure \
--with-cc=/usr/local/clang+llvm/bin/clang --with-cxx=/usr/local/clang+llvm/bin/clang++ \
--with-extra-ldflags="-L/usr/local/clang+llvm/lib" \
--with-extra-cflags="-fsanitize=address -fno-omit-frame-pointer -fno-common -fno-optimize-sibling-calls -std=c11" \
--with-extra-cxxflags="-fsanitize=address -fno-omit-frame-pointer -fno-common -std=c++14 -g -fsanitize-address-use-after-scope -fno-optimize-sibling-calls -fstandalone-debug -Wno-undefined-var-template"
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to configure dtnme\n"
exit 1
fi
if [ $1 -gt 0 ]
then
make -j $1
else
make
fi
printf $?
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to make dtnme\n"
fi