Skip to content

Commit

Permalink
[Misc] Create separate version file
Browse files Browse the repository at this point in the history
Summary: Create separate version file for dragonwell. Integrate dragonwell information into makefile.

Test Plan: Sanity test by make.sh

Reviewed-by: luchsh

Issue: #25
  • Loading branch information
mmyxym committed May 17, 2019
1 parent 9ee08a2 commit 0992a0f
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 39 deletions.
12 changes: 8 additions & 4 deletions common/autoconf/flags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -417,14 +417,18 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
[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"
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
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_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_CXXFLAGS)
Expand Down
17 changes: 12 additions & 5 deletions common/autoconf/generated-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4337,7 +4337,7 @@ VS_SDK_PLATFORM_NAME_2017=
#CUSTOM_AUTOCONF_INCLUDE

# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1539613812
DATE_WHEN_GENERATED=1558082809

###############################################################################
#
Expand Down Expand Up @@ -19777,6 +19777,7 @@ fi
MILESTONE=internal
fi

source "${SRC_ROOT}/dragonwell_version"

# Check whether --with-update-version was given.
if test "${with_update_version+set}" = set; then :
Expand All @@ -19793,6 +19794,8 @@ fi
if test "${#JDK_UPDATE_VERSION}" = "1"; then
JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
fi
else
JDK_UPDATE_VERSION=$DRAGONWELL_JDK_UPDATE_VERSION
fi


Expand Down Expand Up @@ -41398,14 +41401,18 @@ if test "${with_extra_ldflags+set}" = set; then :
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"
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
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_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags"
LEGACY_EXTRA_LDFLAGS="$LEGACY_EXTRA_LDFLAGS $with_extra_ldflags $DRAGONWELL_EXTRA_LDFLAGS"



Expand Down
3 changes: 3 additions & 0 deletions common/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
MILESTONE=internal
fi
source "${SRC_ROOT}/dragonwell_version"
AC_ARG_WITH(update-version, [AS_HELP_STRING([--with-update-version],
[Set update version value for build @<:@b00@:>@])])
if test "x$with_update_version" = xyes; then
Expand All @@ -469,6 +470,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
if test "${#JDK_UPDATE_VERSION}" = "1"; then
JDK_UPDATE_VERSION="0${JDK_UPDATE_VERSION}"
fi
else
JDK_UPDATE_VERSION=$DRAGONWELL_JDK_UPDATE_VERSION
fi
AC_ARG_WITH(user-release-suffix, [AS_HELP_STRING([--with-user-release-suffix],
Expand Down
6 changes: 6 additions & 0 deletions common/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -690,3 +690,9 @@ JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)

# Include the custom-spec.gmk file if it exists
-include $(dir @SPEC@)/custom-spec.gmk

# Include Dragonwell version information
-include @TOPDIR@/dragonwell_version
DISTRO_NAME=Dragonwell
COMPANY_NAME=Alibaba
DISTRO_VERSION=$(DRAGONWELL_VERSION)
23 changes: 23 additions & 0 deletions dragonwell_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# 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
65 changes: 35 additions & 30 deletions make.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
#!/bin/bash
# build properties
JDK_UPDATE_VERSION=202
DISTRO_NAME=Dragonwell
DISTRO_VERSION=8.0-preview

if [ $# != 1 ]; then
echo "USAGE: $0 release/debug"
#
# 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.
#

if [ ! -f "dragonwell_version" ]; then
echo "File 'dragonwell_version' doesn't exist!"
exit 1;
fi
source dragonwell_version

ps -e | grep docker
if [ $? -eq 0 ]; then
echo "We will build Dragonwell in Docker!"
sudo docker pull reg.docker.alibaba-inc.com/ajdk/8-dev.alios5
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 $?
DISTRO_VERSION=$DRAGONWELL_VERSION

if [ $# -lt 1 ]; then
echo "USAGE: $0 release/debug"
fi

source /vmfarm/tools/env.sh
LC_ALL=C
BUILD_MODE=$1

Expand Down Expand Up @@ -47,26 +62,17 @@ else
BUILD_INDEX=b$BUILD_NUMBER
fi

shift

bash ./configure --with-milestone=fcs \
--with-freetype=/vmfarm/tools/freetype/ \
--with-update-version=$JDK_UPDATE_VERSION \
--with-build-number=$BUILD_INDEX \
--with-user-release-suffix="" \
--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-debug-level=$DEBUG_LEVEL \
--with-extra-cflags="-DVENDOR='\"Alibaba\"' \
-DVENDOR_URL='\"http://www.alibabagroup.com\"' \
-DVENDOR_URL_BUG='\"mailto:dragonwell_use@googlegroups.com\"'" \
--with-zlib=system \
--with-extra-ldflags="-Wl,--build-id=sha1"
--with-zlib=system $*
make clean
make LOG=debug DISTRO_NAME=$DISTRO_NAME DISTRO_VERSION=$DISTRO_VERSION COMPANY_NAME=Alibaba images

\cp -f /vmfarm/tools/hsdis/8/amd64/hsdis-amd64.so $NEW_JAVA_HOME/jre/lib/amd64/
make LOG=debug images

# Sanity tests
JAVA_EXES=("$NEW_JAVA_HOME/bin/java" "$NEW_JAVA_HOME/jre/bin/java" "$NEW_JRE_HOME/bin/java")
Expand Down Expand Up @@ -110,14 +116,13 @@ done

# check version string
$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
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
\rm -f /tmp/version.out

ldd $NEW_JAVA_HOME/jre/lib/amd64/libzip.so|grep libz
if [ 0 != $? ]; then RET=1; fi

exit $RET

0 comments on commit 0992a0f

Please sign in to comment.