-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathstep_1_make_gcc_dtnme.sh
118 lines (93 loc) · 2.53 KB
/
step_1_make_gcc_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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#/bin/bash
MAKE=make
JOBS=1
re='^[0-9]+$'
if [ $# -gt 2 ]; then
printf "\nUsage: $0 [make_executable_name [num_jobs]]\n"
printf "\n\t[make_executable_name] allows for compatibility with systems\n\tthat use a different naming convention such as 'make' vs 'gmake' \n\n"
exit 1
fi
if [ $# -gt 0 ]; then
if ! [[ $1 =~ $re ]]; then
MAKE=$1
else
if [ $1 -gt 0 ]; then
JOBS=$1
fi
fi
fi
if [ $# -eq 2 ]; then
if ! [[ $2 =~ $re ]]; then
printf "\nUsage: $0 [make_executable_name [num_jobs]]\n"
printf "\n\t[make_executable_name] allows for compatibility with systems\n\tthat use a different naming convention such as 'make' vs 'gmake' \n\n"
exit 1
else
if [ $2 -gt 0 ]; then
JOBS=$2
fi
fi
fi
cd third_party/oasys
chmod +x tools/extract-version
chmod +x tools/subst-version
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
#autoheader must have this generated to work
touch oasys-version.h
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 --disable-atomic-asm
./configure
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
#autoheader must have this generated to work
touch dtn-version.h
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
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to configure dtnme\n"
exit 1
fi
if [ $JOBS -gt 0 ]
then
$MAKE -j $JOBS
else
$MAKE
fi
printf $?
if [ $? -ne 0 ]
then
printf "Uh Oh, something went wrong\nAn error occured while trying to make dtnme\n"
fi