Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/android_build/gen_version_info.sh
5972 views
1
#!/bin/bash
2
cd $(dirname $0)/..
3
4
if [ -z "$COMPILER" ]; then
5
echo "COMPILER is not set"
6
exit 1
7
fi
8
9
COMPILER_VERSION_OUTPUT=$($COMPILER --version 2>&1)
10
# Collapse compiler output into a single line
11
COMPILER_VERSION_STRING=$(echo $COMPILER_VERSION_OUTPUT)
12
13
OPENJ9_SHA="$(git rev-parse --short HEAD)"
14
if [ -z "$OPENJ9_SHA" ]; then
15
echo "Could not determine OpenJ9 SHA"
16
exit 1
17
fi
18
19
# Find OpenJ9 tag associated with current commit (suppressing stderr in case there is no such tag).
20
OPENJ9_TAG="$(git describe --exact-match HEAD 2>/dev/null)"
21
if [ -z "$OPENJ9_TAG" ]; then
22
OPENJ9_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
23
if [ -z "$OPENJ9_BRANCH" ]; then
24
echo "Could not determine OpenJ9 branch"
25
exit 1
26
fi
27
OPENJ9_VERSION_STRING="$OPENJ9_BRANCH-$OPENJ9_SHA"
28
else
29
OPENJ9_VERSION_STRING="$OPENJ9_TAG"
30
fi
31
32
if [ -z "$JRE_VERSION" ]; then
33
echo "JRE_VERSION is not set"
34
exit 1
35
elif [ "$JRE_VERSION" == "8" ]; then
36
JRE_RELEASE_VERSION="1.8.0-internal-b??"
37
else
38
JRE_RELEASE_VERSION="$JRE_VERSION-internal-b??"
39
fi
40
41
cat > build/runtime/openj9_version_info.h << EOF
42
/*
43
* ===========================================================================
44
* (c) Copyright IBM Corp. 2017, 2020 All Rights Reserved
45
* ===========================================================================
46
*
47
* This code is free software; you can redistribute it and/or modify it
48
* under the terms of the GNU General Public License version 2 only, as
49
* published by the Free Software Foundation.
50
*
51
* IBM designates this particular file as subject to the "Classpath" exception
52
* as provided by IBM in the LICENSE file that accompanied this code.
53
*
54
* This code is distributed in the hope that it will be useful, but WITHOUT
55
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
56
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
57
* version 2 for more details (a copy is included in the LICENSE file that
58
* accompanied this code).
59
*
60
* You should have received a copy of the GNU General Public License version
61
* 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
62
* ===========================================================================
63
*/
64
65
#ifndef OPENJ9_VERSION_INFO_H
66
#define OPENJ9_VERSION_INFO_H
67
68
#define J9COMPILER_VERSION_STRING "$COMPILER_VERSION_STRING"
69
#define J9PRODUCT_NAME "OpenJDK"
70
71
#ifdef __LP64__
72
#define J9TARGET_CPU_BITS "64"
73
#else
74
#define J9TARGET_CPU_BITS "32"
75
#endif
76
77
#ifdef __aarch64__
78
#define J9TARGET_CPU_OSARCH "aarch64"
79
#elif defined(__arm__)
80
#define J9TARGET_CPU_OSARCH "arm"
81
#elif defined(__x86_64__)
82
#define J9TARGET_CPU_OSARCH "amd64"
83
#elif defined(__i386__)
84
#define J9TARGET_CPU_OSARCH "i686"
85
#else
86
# error Unspecified architecture
87
#endif
88
89
// TODO: Darwin iOS
90
#define J9TARGET_OS "linux"
91
#define J9USERNAME "PojavLauncherTeam"
92
#define J9VERSION_STRING "$JRE_RELEASE_VERSION"
93
#define OPENJDK_SHA "unknown" /* @OPENJDK_SHA@ */
94
#define OPENJDK_TAG "unknown" /* @OPENJDK_TAG@ */
95
#define J9JVM_VERSION_STRING "$OPENJ9_VERSION_STRING"
96
#define OPENJ9_TAG "$OPENJ9_TAG"
97
#define J9JDK_EXT_VERSION "8.0.?.?"
98
#define J9JDK_EXT_NAME "Extensions for OpenJDK for Eclipse OpenJ9"
99
#define JAVA_VENDOR "Eclipse OpenJ9"
100
#define JAVA_VENDOR_URL "http://www.eclipse.org/openj9"
101
102
#endif /* OPENJ9_VERSION_INFO_H */
103
EOF
104
105