-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.sh
executable file
·54 lines (44 loc) · 1.61 KB
/
configure.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
#!/usr/bin/env bash
set -euo pipefail
REPL_CHECK_MSG="checking for a working F# REPL..."
FSX_CHECK_MSG="checking for fsx..."
if ! which fsharpi >/dev/null 2>&1; then
echo "$REPL_CHECK_MSG" $'not found'
if ! which fsx >/dev/null 2>&1; then
echo "$FSX_CHECK_MSG" $'not found\n'
echo "$0" $'failed, please install "fsharpi" or "fsx" first'
exit 1
else
echo "$FSX_CHECK_MSG" $'found'
RUNNER=fsx
fi
else
if ! fsharpi scripts/problem.fsx >/dev/null 2>&1; then
echo "$REPL_CHECK_MSG" $'not found'
if ! which fsx >/dev/null 2>&1; then
echo "$FSX_CHECK_MSG" $'not found'
if [ ! -f scripts/fsx/configure.sh ]; then
if ! which git >/dev/null 2>&1; then
echo "checking for git... not found" $'\n'
echo "$0" $'failed, please install "git" (to populate submodule) or "fsx" first'
exit 1
fi
echo "Populating sub-fsx module..."
git submodule update --init
fi
# fsharpi is broken in Ubuntu 19.04/19.10/20.04 ( https://github.com/fsharp/fsharp/issues/740 )
BIN_DIR="`pwd`/bin/fsx"
mkdir -p $BIN_DIR
cd scripts/fsx && ./configure.sh --prefix=$BIN_DIR && make install && cd ../..
RUNNER="$BIN_DIR/bin/fsx"
else
echo "$FSX_CHECK_MSG" $'found'
RUNNER=fsx
fi
else
echo "$REPL_CHECK_MSG" $'found'
RUNNER=fsharpi
fi
fi
echo "FsxRunner=$RUNNER" > scripts/build.config
$RUNNER ./scripts/configure.fsx "$@"