Repository navigation
Expand file tree
/
Copy pathdoinstall
More file actions
executable file
·139 lines (105 loc) · 3.19 KB
/
Copy pathdoinstall
File metadata and controls
executable file
·139 lines (105 loc) · 3.19 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/sh
prefix=""
installdir=""
# --------------------- Actual Installation of Gnatstack --------------
do_install ()
{
if [ ! -d $installdir ]; then
mkdir -p $installdir || exit 1
fi
tar cf - bin share | (cd $installdir && tar xf -)
echo " "
echo "gnatstack has been installed in $installdir"
echo "Thank you for using gnatstack !"
echo " "
}
if [ $# -eq 1 ]; then
if [ "$1" = "--help" ]; then
cat << EOF
Usage: $0 [install_dir]
When no argument is specified, runs the gnatstack installer
interactively, otherwise installs automatically under install_dir.
EOF
else
echo " installing gnatstack under $1"
installdir="$1"
do_install
fi
exit 0
fi
clear
cat << EOF
This script is provided to simplify the installation of the binary
distribution of the gnatstack static analysis tool. This includes the
gnatstack binary as well as the corresponding documentation and examples.
For more information about the commercial support of gnatstack, please
contact sales@adacore.com.
This script will ask a few questions regarding the gnatstack installation.
Running this configuration script will not modify anything anywhere
else in your system. You can break out of it or run it multiple times
before doing the actual installation.
Hit RETURN to continue.
EOF
read x
# --------------------- Select installation option --------------------
clear
cat << EOF
There are 2 options for installation:
1) Install gnatstack in the standard GNAT Pro location.
2) Install gnatstack in non-standard locations that you will
specify.
Option 1 provides simplest use of gnatstack.
EOF
while [ true ]; do
echo Type 1, or 2 "(then RETURN)" to choose an option:
read answer
case $answer in
# ------------------ Custom installation ---------------------------
2)
clear
cat << EOF
To install gnatstack in a non-standard location you need to
specify a base directory. All the files will be installed in
subdirectories that are created under this directory.
Important Note: You should not use ~ or ~username wildcards
when specifying this directory name.
Specify the base directory you want to use for installation:
EOF
read basedir
while [ true ]; do
if [ "X" = "X`echo $basedir|sed -n -e 's%^/.*%/%p'`" ]; then
basedir=`pwd`/$basedir
fi
echo " " The base directory is $basedir
echo " " To accept this choice enter RETURN.
echo " " Otherwise type a new name.
read answer
if [ "X$answer" = "X" ]; then
break
fi
basedir=$answer
done
clear
installdir=$basedir
break
;;
# ------------------ Regular installation ---------------------------
1)
prefix=`type gprbuild 2>/dev/null| cut -d' ' -f3`
prefix=`dirname $prefix 2>/dev/null`
if [ "$prefix" = "" -o "$prefix" = "." ]; then
cat << EOF
No GNAT Pro installation found on your PATH. Please add the
directory were GNAT Pro can be found on your PATH or contact
your system administrator to have it installed in a standard
location.
EOF
exit 1
else
installdir=`dirname $prefix`
break
fi
;;
esac
done
do_install