-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.sh
executable file
·87 lines (74 loc) · 2.03 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
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
#!/usr/bin/env bash
set -e
if ! which make >/dev/null 2>&1; then
echo "checking for make... not found"
echo "Error: please install 'make'" >> /dev/stderr
exit 1
else
echo "checking for make... found"
fi
BUILDTOOL=invalid
SOLUTION=invalid
if ! which dotnet >/dev/null 2>&1; then
echo "checking for dotnet... not found"
if ! which fsharpc >/dev/null 2>&1; then
echo "checking for F# compiler... not found"
echo "Error: please install 'dotnet' (or legacy 'fsharpc')" >> /dev/stderr
exit 1
else
echo "checking for F# compiler... found"
fi
if ! which msbuild >/dev/null 2>&1; then
echo "checking for msbuild... not found"
if ! which xbuild >/dev/null 2>&1; then
echo "checking for xbuild... not found"
echo "Error: please install 'dotnet' (or legacy 'msbuild' or 'xbuild')" >> /dev/stderr
exit 1
else
echo "checking for xbuild... found"
BUILDTOOL=xbuild
SOLUTION=fsx-legacy.sln
fi
else
echo "checking for msbuild... found"
BUILDTOOL=msbuild
SOLUTION=fsx-legacy.sln
fi
# for downloading nuget.exe
if ! which curl >/dev/null 2>&1; then
echo "checking for curl... not found"
echo "Error: please install 'curl'" >> /dev/stderr
exit 1
else
echo "checking for curl... found"
fi
else
echo "checking for dotnet... found"
BUILDTOOL='"dotnet build"'
SOLUTION=fsx.sln
fi
DESCRIPTION="tarball"
if which git >/dev/null 2>&1; then
# https://stackoverflow.com/a/12142066/1623521
DESCRIPTION=`git rev-parse --abbrev-ref HEAD`
fi
#default:
PREFIX=/usr/local
for i in "$@"
do
case $i in
-p=*|--prefix=*)
PREFIX="${i#*=}"
;;
*)
# unknown option
;;
esac
done
source version.config
echo -e "BuildTool=$BUILDTOOL\nSolution=$SOLUTION\nPrefix=$PREFIX" > build.config
echo
echo -e "\tConfiguration summary for fsx $Version ($DESCRIPTION)"
echo
echo -e "\t* Installation prefix: $PREFIX"
echo