-
Notifications
You must be signed in to change notification settings - Fork 3
/
localinstall.sh
executable file
·59 lines (48 loc) · 1.04 KB
/
localinstall.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
#!/bin/sh
echo "#"
echo "#"
echo "# Small install script"
echo "# This program is distributed in the hope that it will be useful,"
echo "# but WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
echo "#"
echo "#"
make -j2 || exit 1;
strip -s ccbuild;
function binDir()
{
#Determine BINDIR
#Find another installation directory
IFS=":"
for path in $PATH;
do
if [ -d "$path" ];
then if [ -w "$path" ];
then echo $path;
return 0;
fi;
fi
done;
return 1;
}
BINDIR=`binDir || echo /usr/local/bin`
PROGRAM="src/ccbuild"
DEFCONF="./tools/ccResolutions.d"
CONFDIR="$HOME/.ccbuild"
echo
echo Install directory: $BINDIR
echo Config directory: $CONFDIR
echo
echo "Do you want to continue with installation? (yes/no)"
read REPLY
if [[ "x$REPLY" != "xyes" ]];
then
echo Reply "\"$REPLY\"" isn\'t \"yes\"
echo EXIT
exit 1;
fi;
mkdir -p $CONFDIR
echo cp -r $DEFCONF $CONFDIR
cp -r $DEFCONF $CONFDIR
echo cp $PROGRAM $BINDIR
cp $PROGRAM $BINDIR