提交 7229a9b7 编写于 作者: M maoliang.ml 提交者: 云矅

[Misc] Create separate version file

Summary: Create separate version file for dragonwell. Integrate dragonwell information into makefile.

Test Plan: Sanity test by make.sh

Reviewed-by: luchsh

Issue: https://github.com/alibaba/dragonwell8/issues/25
上级 0f42eb02
...@@ -423,14 +423,18 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], ...@@ -423,14 +423,18 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags], AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
[extra flags to be used when linking jdk])]) [extra flags to be used when linking jdk])])
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" DRAGONWELL_EXTRA_CFLAGS="-DVENDOR='\"Alibaba\"' \
-DVENDOR_URL='\"http://www.alibabagroup.com\"' \
-DVENDOR_URL_BUG='\"mailto:dragonwell_use@googlegroups.com\"'"
DRAGONWELL_EXTRA_LDFLAGS="-Wl,--build-id=sha"
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags $DRAGONWELL_EXTRA_CFLAGS"
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags $DRAGONWELL_EXTRA_LDFLAGS"
# Hotspot needs these set in their legacy form # Hotspot needs these set in their legacy form
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags" LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags $DRAGONWELL_EXTRA_CFLAGS"
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags" LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags" LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags $DRAGONWELL_EXTRA_LDFLAGS"
AC_SUBST(LEGACY_EXTRA_CFLAGS) AC_SUBST(LEGACY_EXTRA_CFLAGS)
AC_SUBST(LEGACY_EXTRA_CXXFLAGS) AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
......
...@@ -19822,6 +19822,7 @@ fi ...@@ -19822,6 +19822,7 @@ fi
MILESTONE=internal MILESTONE=internal
fi fi
source "${SRC_ROOT}/dragonwell_version"
# Check whether --with-update-version was given. # Check whether --with-update-version was given.
if test "${with_update_version+set}" = set; then : if test "${with_update_version+set}" = set; then :
...@@ -19838,6 +19839,8 @@ fi ...@@ -19838,6 +19839,8 @@ fi
if test "${#JDK_UPDATE_VERSION}" = "1"; then if test "${#JDK_UPDATE_VERSION}" = "1"; then
JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}" JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
fi fi
else
JDK_UPDATE_VERSION=$DRAGONWELL_JDK_UPDATE_VERSION
fi fi
...@@ -41519,14 +41522,18 @@ if test "${with_extra_ldflags+set}" = set; then : ...@@ -41519,14 +41522,18 @@ if test "${with_extra_ldflags+set}" = set; then :
fi fi
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" DRAGONWELL_EXTRA_CFLAGS="-DVENDOR='\"Alibaba\"' \
-DVENDOR_URL='\"http://www.alibabagroup.com\"' \
-DVENDOR_URL_BUG='\"mailto:dragonwell_use@googlegroups.com\"'"
DRAGONWELL_EXTRA_LDFLAGS="-Wl,--build-id=sha"
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags $DRAGONWELL_EXTRA_CFLAGS"
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags $DRAGONWELL_EXTRA_LDFLAGS"
# Hotspot needs these set in their legacy form # Hotspot needs these set in their legacy form
LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags" LEGACY_EXTRA_CFLAGS="$LEGACY_EXTRA_CFLAGS $with_extra_cflags $DRAGONWELL_EXTRA_CFLAGS"
LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags" LEGACY_EXTRA_CXXFLAGS="$LEGACY_EXTRA_CXXFLAGS $with_extra_cxxflags"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags" LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags $DRAGONWELL_EXTRA_LDFLAGS"
...@@ -457,6 +457,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], ...@@ -457,6 +457,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
MILESTONE=internal MILESTONE=internal
fi fi
source "${SRC_ROOT}/dragonwell_version"
AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version], AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
[Set update version value for build @<:@b00@:>@])]) [Set update version value for build @<:@b00@:>@])])
if test "x$with_update_version" = xyes; then if test "x$with_update_version" = xyes; then
...@@ -469,6 +470,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], ...@@ -469,6 +470,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
if test "${#JDK_UPDATE_VERSION}" = "1"; then if test "${#JDK_UPDATE_VERSION}" = "1"; then
JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}" JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
fi fi
else
JDK_UPDATE_VERSION=$DRAGONWELL_JDK_UPDATE_VERSION
fi fi
AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix], AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],
......
...@@ -723,3 +723,9 @@ JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR) ...@@ -723,3 +723,9 @@ JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)
# Include the custom-spec.gmk file if it exists # Include the custom-spec.gmk file if it exists
-include $(dir @SPEC@)/custom-spec.gmk -include $(dir @SPEC@)/custom-spec.gmk
# Include Dragonwell version information
-include @TOPDIR@/dragonwell_version
DISTRO_NAME=Dragonwell
COMPANY_NAME=Alibaba
DISTRO_VERSION=$(DRAGONWELL_VERSION)
#
# Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Alibaba designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
DRAGONWELL_VERSION=8.0-preview
DRAGONWELL_JDK_UPDATE_VERSION=202
#!/bin/bash #!/bin/bash
# build properties # build properties
JDK_UPDATE_VERSION=202 #
DISTRO_NAME=Dragonwell # Copyright (c) 2019 Alibaba Group Holding Limited. All Rights Reserved.
DISTRO_VERSION=8.0-preview # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
if [ $# != 1 ]; then # This code is free software; you can redistribute it and/or modify it
echo "USAGE: $0 release/debug" # under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Alibaba designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
if [ ! -f "dragonwell_version" ]; then
echo "File 'dragonwell_version' doesn't exist!"
exit 1;
fi fi
source dragonwell_version
ps -e | grep docker DISTRO_VERSION=$DRAGONWELL_VERSION
if [ $? -eq 0 ]; then
echo "We will build Dragonwell in Docker!" if [ $# -lt 1 ]; then
sudo docker pull reg.docker.alibaba-inc.com/ajdk/8-dev.alios5 echo "USAGE: $0 release/debug"
docker run -u admin -i --rm -e BUILD_NUMBER=$BUILD_NUMBER -v `pwd`:`pwd` -w `pwd` \
--entrypoint=bash reg.docker.alibaba-inc.com/ajdk/8-dev.alios5 `pwd`/make.sh $1
exit $?
fi fi
source /vmfarm/tools/env.sh
LC_ALL=C LC_ALL=C
BUILD_MODE=$1 BUILD_MODE=$1
...@@ -47,26 +62,17 @@ else ...@@ -47,26 +62,17 @@ else
BUILD_INDEX=b$BUILD_NUMBER BUILD_INDEX=b$BUILD_NUMBER
fi fi
shift
bash ./configure --with-milestone=fcs \ bash ./configure --with-milestone=fcs \
--with-freetype=/vmfarm/tools/freetype/ \
--with-update-version=$JDK_UPDATE_VERSION \
--with-build-number=$BUILD_INDEX \ --with-build-number=$BUILD_INDEX \
--with-user-release-suffix="" \ --with-user-release-suffix="" \
--enable-unlimited-crypto \ --enable-unlimited-crypto \
--with-cacerts-file=/vmfarm/security/cacerts \
--with-jtreg=/vmfarm/tools/jtreg4.1 \
--with-tools-dir=/vmfarm/tools/install/gcc-4.4.7/bin \
--with-jvm-variants=server \ --with-jvm-variants=server \
--with-debug-level=$DEBUG_LEVEL \ --with-debug-level=$DEBUG_LEVEL \
--with-extra-cflags="-DVENDOR='\"Alibaba\"' \ --with-zlib=system $*
-DVENDOR_URL='\"http://www.alibabagroup.com\"' \
-DVENDOR_URL_BUG='\"mailto:dragonwell_use@googlegroups.com\"'" \
--with-zlib=system \
--with-extra-ldflags="-Wl,--build-id=sha1"
make clean make clean
make LOG=debug DISTRO_NAME=$DISTRO_NAME DISTRO_VERSION=$DISTRO_VERSION COMPANY_NAME=Alibaba images make LOG=debug images
\cp -f /vmfarm/tools/hsdis/8/amd64/hsdis-amd64.so $NEW_JAVA_HOME/jre/lib/amd64/
# Sanity tests # Sanity tests
JAVA_EXES=("$NEW_JAVA_HOME/bin/java" "$NEW_JAVA_HOME/jre/bin/java" "$NEW_JRE_HOME/bin/java") JAVA_EXES=("$NEW_JAVA_HOME/bin/java" "$NEW_JAVA_HOME/jre/bin/java" "$NEW_JRE_HOME/bin/java")
...@@ -110,9 +116,9 @@ done ...@@ -110,9 +116,9 @@ done
# check version string # check version string
$NEW_JAVA_HOME/bin/java -version > /tmp/version.out 2>&1 $NEW_JAVA_HOME/bin/java -version > /tmp/version.out 2>&1
grep "^OpenJDK Runtime" /tmp/version.out | grep "($DISTRO_NAME $DISTRO_VERSION)" grep "^OpenJDK Runtime" /tmp/version.out | grep "(Dragonwell $DISTRO_VERSION)"
if [ 0 != $? ]; then RET=1; fi if [ 0 != $? ]; then RET=1; fi
grep "^OpenJDK .*VM" /tmp/version.out | grep "($DISTRO_NAME $DISTRO_VERSION)" grep "^OpenJDK .*VM" /tmp/version.out | grep "(Dragonwell $DISTRO_VERSION)"
if [ 0 != $? ]; then RET=1; fi if [ 0 != $? ]; then RET=1; fi
\rm -f /tmp/version.out \rm -f /tmp/version.out
...@@ -120,4 +126,3 @@ ldd $NEW_JAVA_HOME/jre/lib/amd64/libzip.so|grep libz ...@@ -120,4 +126,3 @@ ldd $NEW_JAVA_HOME/jre/lib/amd64/libzip.so|grep libz
if [ 0 != $? ]; then RET=1; fi if [ 0 != $? ]; then RET=1; fi
exit $RET exit $RET
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册