summaryrefslogtreecommitdiffstats
path: root/devel/gps/files/gps.in
blob: 3bc4267adc9fa406357b27e9bb416f68314e243e (plain)
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
#!/bin/sh
#
# GPS wrapper written by John Marino
# It sets ADA_PROJECT_PATH in environment if unset
# It also adds the path to the default Ada toolchain if not already present
#

VIAS=$(echo ${PATH} | /usr/bin/tr ":" " ")

if [ -z "${ADA_PROJECT_PATH}" ]
then
	ADA_PROJECT_PATH=%%PREFIX%%/lib/gnat
	export ADA_PROJECT_PATH
fi

FOUND=0
for via in ${VIAS}
do
	[ "${via}" = "%%ADA_PATH%%" ] && FOUND=1;
done;

if [ ${FOUND} -eq 0 ]
then
	PATH=${PATH}:%%ADA_PATH%%
	export PATH;
fi

exec "%%PREFIX%%/bin/gps_exe" "$@"
OpenPOWER on IntegriCloud