Path: blob/master/android_build/gen_version_info.sh
5972 views
#!/bin/bash1cd $(dirname $0)/..23if [ -z "$COMPILER" ]; then4echo "COMPILER is not set"5exit 16fi78COMPILER_VERSION_OUTPUT=$($COMPILER --version 2>&1)9# Collapse compiler output into a single line10COMPILER_VERSION_STRING=$(echo $COMPILER_VERSION_OUTPUT)1112OPENJ9_SHA="$(git rev-parse --short HEAD)"13if [ -z "$OPENJ9_SHA" ]; then14echo "Could not determine OpenJ9 SHA"15exit 116fi1718# Find OpenJ9 tag associated with current commit (suppressing stderr in case there is no such tag).19OPENJ9_TAG="$(git describe --exact-match HEAD 2>/dev/null)"20if [ -z "$OPENJ9_TAG" ]; then21OPENJ9_BRANCH="$(git rev-parse --abbrev-ref HEAD)"22if [ -z "$OPENJ9_BRANCH" ]; then23echo "Could not determine OpenJ9 branch"24exit 125fi26OPENJ9_VERSION_STRING="$OPENJ9_BRANCH-$OPENJ9_SHA"27else28OPENJ9_VERSION_STRING="$OPENJ9_TAG"29fi3031if [ -z "$JRE_VERSION" ]; then32echo "JRE_VERSION is not set"33exit 134elif [ "$JRE_VERSION" == "8" ]; then35JRE_RELEASE_VERSION="1.8.0-internal-b??"36else37JRE_RELEASE_VERSION="$JRE_VERSION-internal-b??"38fi3940cat > build/runtime/openj9_version_info.h << EOF41/*42* ===========================================================================43* (c) Copyright IBM Corp. 2017, 2020 All Rights Reserved44* ===========================================================================45*46* This code is free software; you can redistribute it and/or modify it47* under the terms of the GNU General Public License version 2 only, as48* published by the Free Software Foundation.49*50* IBM designates this particular file as subject to the "Classpath" exception51* as provided by IBM in the LICENSE file that accompanied this code.52*53* This code is distributed in the hope that it will be useful, but WITHOUT54* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or55* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License56* version 2 for more details (a copy is included in the LICENSE file that57* accompanied this code).58*59* You should have received a copy of the GNU General Public License version60* 2 along with this work; if not, see <http://www.gnu.org/licenses/>.61* ===========================================================================62*/6364#ifndef OPENJ9_VERSION_INFO_H65#define OPENJ9_VERSION_INFO_H6667#define J9COMPILER_VERSION_STRING "$COMPILER_VERSION_STRING"68#define J9PRODUCT_NAME "OpenJDK"6970#ifdef __LP64__71#define J9TARGET_CPU_BITS "64"72#else73#define J9TARGET_CPU_BITS "32"74#endif7576#ifdef __aarch64__77#define J9TARGET_CPU_OSARCH "aarch64"78#elif defined(__arm__)79#define J9TARGET_CPU_OSARCH "arm"80#elif defined(__x86_64__)81#define J9TARGET_CPU_OSARCH "amd64"82#elif defined(__i386__)83#define J9TARGET_CPU_OSARCH "i686"84#else85# error Unspecified architecture86#endif8788// TODO: Darwin iOS89#define J9TARGET_OS "linux"90#define J9USERNAME "PojavLauncherTeam"91#define J9VERSION_STRING "$JRE_RELEASE_VERSION"92#define OPENJDK_SHA "unknown" /* @OPENJDK_SHA@ */93#define OPENJDK_TAG "unknown" /* @OPENJDK_TAG@ */94#define J9JVM_VERSION_STRING "$OPENJ9_VERSION_STRING"95#define OPENJ9_TAG "$OPENJ9_TAG"96#define J9JDK_EXT_VERSION "8.0.?.?"97#define J9JDK_EXT_NAME "Extensions for OpenJDK for Eclipse OpenJ9"98#define JAVA_VENDOR "Eclipse OpenJ9"99#define JAVA_VENDOR_URL "http://www.eclipse.org/openj9"100101#endif /* OPENJ9_VERSION_INFO_H */102EOF103104105