forked from ClioPatria/ClioPatria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·45 lines (40 loc) · 958 Bytes
/
configure
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
#!/bin/bash
#
# Prepare running ClioPatria by localizing the install scripts. The real
# work is done by the Prolog script setup.pl to maintain portability
# with Windows. Windows users should double-click win-config.exe. This
# executable performs a similar task: locate SWI-Prolog using the
# registry and open `setup.pl` with Prolog.
#
# Running (2nd variation to select a specific SWI-Prolog version)
#
# $ ./configure
# $ SWIPL=swi-prolog ./configure
#
# Author: Jan Wielemaker
# Copyright: Public Domain
findexe()
{ oldifs="$IFS"
IFS=:
for d in $PATH; do
if [ -x $d/$1 ]; then
IFS="$oldifs"
return 0
fi
done
IFS="$oldifs"
return 1
}
if [ -z "$SWIPL" ]; then
for f in swi-prolog swipl; do
if [ -z "$SWIPL" ] && findexe $f; then
SWIPL=$f
fi
done
fi
if [ -z "$SWIPL" ]; then
echo "ERROR: Cannot find SWI-Prolog."
exit 1
fi
setup="$(dirname $0)/setup.pl"
$SWIPL -q -f "$setup" -- $*