-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure
executable file
·71 lines (59 loc) · 1.69 KB
/
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
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
#!/usr/bin/env bash
CURDIR=$(pwd)
JAVA=$(command -v java)
if [ -z "$JAVA" ]
then
echo "You need to have java in your path."
exit 1
fi
JAVA=$(cd $(dirname $JAVA); pwd)/java
JAVA_HOME=$(cd $(dirname $JAVA)/..; pwd)
if [ ! -d "$JAVA_HOME" ]
then
echo "Error, expected $JAVA_HOME to be a directory."
exit 1
fi
mkdir -p build
M2REPO="$HOME/.m2/repository"
JAVA="$JAVA"
JAVA_HOME="$JAVA_HOME"
JAVA_VERSION="$($JAVA -version 2>&1 | tr '\n' ' ')"
GIT_ROOT="$CURDIR"
BUILD="$CURDIR/build"
BUILD_MVN_BIN="$BUILD/mvn_bin"
BUILD_JAVAC_BIN="$BUILD/javac_bin"
BUILD_GRAAL_BIN="$BUILD/graal_bin"
GEN_SRC="$BUILD/generated-sources"
GEN_ANTLR4="$GEN_SRC/antlr4"
PROJECT_DEPS="$BUILD/project-deps"
TEST_MODELS="$BUILD/test-models"
echo "# Generated $(date)" > build/spec.mk
{
echo "SPEC_MK:=$BUILD/spec.mk"
echo "M2REPO:=$M2REPO"
echo "JAVA:=$JAVA"
echo "JAVA_VERSION:='$JAVA_VERSION'"
echo "JAVA_HOME:=$JAVA_HOME"
echo "GIT_ROOT:=$CURDIR"
echo "BUILD:=$BUILD"
echo "BUILD_MVN_BIN:=$BUILD_MVN_BIN"
echo "BUILD_JAVAC_BIN:=$BUILD_JAVAC_BIN"
echo "BUILD_GRAAL_BIN:=$BUILD_GRAAL_BIN"
echo "GEN_SRC:=$GEN_SRC"
echo "GEN_ANTLR4:=$GEN_ANTLR4"
echo "PROJECT_DEPS:=$PROJECT_DEPS"
echo "TEST_MODELS:=$TEST_MODELS"
} >> build/spec.mk
cat >> build/spec.mk <<EOF
MOST_RECENT:=\$(shell ls -t \$(BUILD_MVN_BIN)/evbt \$(BUILD_JAVAC_BIN)/evbt \$(BUILD_GRAAL_BIN)/evbt 2>/dev/null | head --lines=1)
ifneq (,\$(findstring mvn_bin/evbt,\$(MOST_RECENT)))
MOST_RECENT:=mvn
endif
ifneq (,\$(findstring javac_bin/evbt,\$(MOST_RECENT)))
MOST_RECENT:=javac
endif
ifneq (,\$(findstring graal_bin/evbt,\$(MOST_RECENT)))
MOST_RECENT:=graal
endif
EVBT:=\$(BUILD)/\$(MOST_RECENT)_bin/evbt
EOF