-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·108 lines (91 loc) · 2.44 KB
/
install
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
#!/bin/bash
show_help() {
cat << EOF
Usage: ./${0##*/} [-hf] [-m MODULE]
Generate the required source files, build and install the Interfaces libraries into $OSSIEHOME
-h display this help and exit
-f force install corba modules.
-m MODULE install specific corba module (case sensitive)
JTNC CORBA Modules dependencies
JTRS --> Packet -----> |
JTRS -------> | | Audio --> Vocoder
DevIOC -----> | DevMsgCtl --> |
DevIOS -----> | Ethernet
DevPK ------> | DevMsgCtl --> |
DevPktSig --> | DeviceIo ---> | SerialPort
JTRS --> Packet -----> |
JTRS --> Packet --> MHAL JTRS --> Gps
FreqRef TimingService
EOF
}
not_force_install=1
#Corba Modules must be in a safe order to satisfy dependency
read -r -d '' MODULES << EOM
JTRS
Packet
DevMsgCtl
Audio
Vocoder
DeviceIo
SerialPort
DevIOC
DevIOS
DevPK
DevPktSig
Ethernet
MHAL
Gps
FreqRef
TimingService
EOM
while getopts hfm: opt; do
case $opt in
h)
show_help
exit 0
;;
f) not_force_install=0
;;
m) case "$MODULES" in
*${OPTARG}*) MODULES=$OPTARG ;;
*) echo -e "\033[1mThere isn't a module named $OPTARG\033[0m"; echo "run ./install -h"; exit 1 ;;
esac
;;
*)
show_help >&2
exit 1
;;
esac
done
echo -e "\033[1mCertify that you have sudo privileges...\033[0m"
echo "$MODULES" | while read -r MODULE
do
if [[ -e "$OSSIEHOME/lib/${MODULE^^}Interfaces.jar" && $not_force_install -eq "1" ]]; then
echo -e "\033[1mModule $MODULE already installed\033[0m"
else
echo "#############################################"
echo -e "# \033[1mBuild and Installing $MODULE Module\033[0m"
echo "#############################################"
cd $MODULE/
echo -e "\033[1mConfigure...\033[0m"
if ! ./reconf; then
./reconf #try again
wait
fi
if ! ./configure; then
echo "Failed to configure $MODULE Module"
exit 1
fi
#echo -e "\033[1mBuilding...\033[0m"
#if ! make; then
# echo "Failed to build $MODULE Module"
# exit 1
#fi
echo -e "\033[1mBuilding and Installing...\033[0m"
if ! sudo make install; then
echo "Failed to install $MODULE Module"
exit 1
fi
cd ..
fi
done