提交 93715b75 编写于 作者: A alanb

8142968: Module System implementation

Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282
Reviewed-by: alanb, mchung, tbell
Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, erik.joelsson@oracle.com, chris.hegarty@oracle.com, christian.tornqvist@oracle.com, harold.seigel@oracle.com, igor.ignatyev@oracle.com, james.laskey@oracle.com, jean-francois.denise@oracle.com, sundararajan.athijegannathan@oracle.com
上级 408c035b
......@@ -843,6 +843,8 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
# The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
AC_CONFIG_FILES([$OUTPUT_ROOT/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
# The compare.sh is used to compare the build output to other builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in])
# The generated Makefile knows where the spec.gmk is and where the source is.
......
......@@ -304,6 +304,18 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
# When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
BOOT_JDK_SOURCETARGET="-source 8 -target 8"
AC_SUBST(BOOT_JDK_SOURCETARGET)
ADD_JVM_ARG_IF_OK([-Xpatch:], dummy, [$JAVA])
AC_MSG_CHECKING([if Boot JDK supports modules])
if test "x$JVM_ARG_OK" = "xtrue"; then
AC_MSG_RESULT([yes])
BOOT_JDK_MODULAR="true"
else
AC_MSG_RESULT([no])
BOOT_JDK_MODULAR="false"
fi
AC_SUBST(BOOT_JDK_MODULAR)
AC_SUBST(JAVAC_FLAGS)
# Check if the boot jdk is 32 or 64 bit
......@@ -397,3 +409,100 @@ AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
done
AC_SUBST(JAVA_TOOL_FLAGS_SMALL)
])
# BUILD_JDK: the location of the latest JDK that can run
# on the host system and supports the target class file version
# generated in this JDK build. This variable should only be
# used after the launchers are built.
#
# Execute the check given as argument, and verify the result.
# If the JDK was previously found, do nothing.
# $1 A command line (typically autoconf macro) to execute
AC_DEFUN([BOOTJDK_CHECK_BUILD_JDK],
[
if test "x$BUILD_JDK_FOUND" = xno; then
# Execute the test
$1
# If previous step claimed to have found a JDK, check it to see if it seems to be valid.
if test "x$BUILD_JDK_FOUND" = xmaybe; then
# Do we have a bin/java?
if test ! -x "$BUILD_JDK/bin/java"; then
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring])
BUILD_JDK_FOUND=no
elif test ! -x "$BUILD_JDK/bin/jlink"; then
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring])
BUILD_JDK_FOUND=no
elif test ! -x "$BUILD_JDK/bin/javac"; then
# Do we have a bin/javac?
AC_MSG_NOTICE([Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring])
AC_MSG_NOTICE([(This might be a JRE instead of an JDK)])
BUILD_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | head -n 1`
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_CORRECT_VERSION=`echo $BUILD_JDK_VERSION | grep '\"1\.[9]\.'`]
if test "x$FOUND_CORRECT_VERSION" = x; then
AC_MSG_NOTICE([Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Build JDK must be version 9)])
BUILD_JDK_FOUND=no
else
# We're done!
BUILD_JDK_FOUND=yes
BASIC_FIXUP_PATH(BUILD_JDK)
AC_MSG_CHECKING([for Build JDK])
AC_MSG_RESULT([$BUILD_JDK])
AC_MSG_CHECKING([Build JDK version])
BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
AC_MSG_RESULT([$BUILD_JDK_VERSION])
fi # end check jdk version
fi # end check java
fi # end check build jdk found
fi
])
# By default the BUILD_JDK is the JDK_OUTPUTDIR. If the target architecture
# is different than the host system doing the build (e.g. cross-compilation),
# a special BUILD_JDK is built as part of the build process. An external
# prebuilt BUILD_JDK can also be supplied.
AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
[
AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk],
[path to JDK of same version as is being built@<:@the newly built JDK@:>@])])
CREATE_BUILDJDK_FOR_HOST=false
BUILD_JDK_FOUND="no"
if test "x$with_build_jdk" != "x"; then
BOOTJDK_CHECK_BUILD_JDK([
if test "x$with_build_jdk" != x; then
BUILD_JDK=$with_build_jdk
BUILD_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
fi])
else
if test "x$COMPILE_TYPE" = "xcross"; then
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
BUILD_JDK_FOUND=yes
CREATE_BUILDJDK=true
AC_MSG_CHECKING([for Build JDK])
AC_MSG_RESULT([yes, will build it for the host platform])
else
BUILD_JDK="\$(JDK_OUTPUTDIR)"
BUILD_JDK_FOUND=yes
AC_MSG_CHECKING([for Build JDK])
AC_MSG_RESULT([yes, will use output dir])
fi
fi
if test "x$BUILD_JDK_FOUND" != "xyes"; then
AC_MSG_CHECKING([for Build JDK])
AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not find a suitable Build JDK])
fi
AC_SUBST(CREATE_BUILDJDK)
AC_SUBST(BUILD_JDK)
])
......@@ -25,6 +25,8 @@
# Support for building boot cycle builds
BOOT_JDK_MODULAR := true
# First include the real base spec.gmk file
include @SPEC@
......
#
# Copyright (c) 2015, Oracle and/or its affiliates. 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. Oracle 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.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
# This spec file is used to compile a BUILD_JDK while cross compiling. The
# BUILD_JDK runs on the build/host platform and is of the same version as
# the main build.
# First include the real base spec.gmk file
include @SPEC@
CC := @BUILD_CC@
CXX := @BUILD_CXX@
LD := @BUILD_LD@
AS := @BUILD_AS@
NM := @BUILD_NM@
AR := @BUILD_AR@
OBJCOPY := @BUILD_OBJCOPY@
STRIP := @BUILD_STRIP@
SYSROOT_CFLAGS := @BUILD_SYSROOT_CFLAGS@
SYSROOT_LDFLAGS := @BUILD_SYSROOT_LDFLAGS@
# These directories should not be moved to BUILDJDK_OUTPUTDIR
HOTSPOT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_OUTPUTDIR))
HOTSPOT_DIST := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(HOTSPOT_DIST))
SUPPORT_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(SUPPORT_OUTPUTDIR))
JDK_OUTPUTDIR := $(patsubst $(BUILD_OUTPUT)%,$(BUILDJDK_OUTPUTDIR)%,$(JDK_OUTPUTDIR))
OPENJDK_BUILD_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
OPENJDK_BUILD_CPU_LEGACY_LIB := @OPENJDK_BUILD_CPU_LEGACY_LIB@
OPENJDK_BUILD_CPU_LIBDIR := @OPENJDK_BUILD_CPU_LIBDIR@
OPENJDK_TARGET_CPU_LIBDIR := @OPENJDK_BUILD_CPU_LIBDIR@
OPENJDK_TARGET_CPU := @OPENJDK_BUILD_CPU@
OPENJDK_TARGET_CPU_ARCH := @OPENJDK_BUILD_CPU_ARCH@
OPENJDK_TARGET_CPU_BITS := @OPENJDK_BUILD_CPU_BITS@
OPENJDK_TARGET_CPU_ENDIAN := @OPENJDK_BUILD_CPU_ENDIAN@
OPENJDK_TARGET_CPU_LEGACY := @OPENJDK_BUILD_CPU_LEGACY@
CFLAGS_JDKLIB := @OPENJDK_BUILD_CFLAGS_JDKLIB@
CXXFLAGS_JDKLIB := @OPENJDK_BUILD_CXXFLAGS_JDKLIB@
LDFLAGS_JDKLIB := @OPENJDK_BUILD_LDFLAGS_JDKLIB@
CFLAGS_JDKEXE := @OPENJDK_BUILD_CFLAGS_JDKEXE@
CXXFLAGS_JDKEXE := @OPENJDK_BUILD_CXXFLAGS_JDKEXE@
LDFLAGS_JDKEXE := @OPENJDK_BUILD_LDFLAGS_JDKEXE@
OPENJDK_TARGET_CPU_JLI_CFLAGS := @OPENJDK_BUILD_CPU_JLI_CFLAGS@
# The compiler for the build platform is likely not warning compatible with the official
# compiler.
WARNINGS_AS_ERRORS := false
DISABLE_WARNING_PREFIX := @BUILD_CC_DISABLE_WARNING_PREFIX@
# Save speed and disk space by not enabling debug symbols for the buildjdk
ENABLE_DEBUG_SYMBOLS := false
####################################################
#
# Legacy Hotspot support
# Legacy setting: OPT or DBG
VARIANT := OPT
# Legacy setting: true or false
FASTDEBUG := false
# Legacy setting: debugging the class files?
DEBUG_CLASSFILES := false
# Some users still set EXTRA_*FLAGS on the make command line. Must
# make sure to override that when building buildjdk.
override EXTRA_CFLAGS :=
override EXTRA_CXXFLAGS :=
override EXTRA_LDFLAGS :=
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
# compiler that produces code that can be run on the build platform.
HOSTCC := $(BUILD_CC)
HOSTCXX := $(BUILD_CXX)
# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
PLATFORM := $(OPENJDK_BUILD_OS)
# 32 or 64 bit
ARCH_DATA_MODEL := $(OPENJDK_BUILD_CPU_BITS)
ALT_BOOTDIR := $(BOOT_JDK)
# Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of x86 and x86_64.
LIBARCH := @OPENJDK_BUILD_CPU_LEGACY_LIB@
# Set the cpu architecture. Some users still set ARCH on the make command line. Must
# make sure to override that when building buildjdk.
override ARCH := $(OPENJDK_BUILD_CPU_ARCH)
# Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64 := 1
ifeq ($(OPENJDK_BUILD_CPU_BITS), 64)
_LP64 := 1
endif
ALT_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)
ALT_EXPORT_PATH := $(HOTSPOT_DIST)
JVM_INTERPRETER := @JVM_INTERPRETER@
ifeq ($(JVM_INTERPRETER), cpp)
CC_INTERP=true
endif
HOTSPOT_MAKE_ARGS := product docs export_product
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD := false
USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@
# Hotspot expects the variable FULL_DEBUG_SYMBOLS=1/0 to control debug symbols
# creation.
FULL_DEBUG_SYMBOLS := 0
ZIP_DEBUGINFO_FILES := 0
# Disable stripping
STRIP_POLICY := none
JVM_VARIANTS := server
JVM_VARIANT_SERVER := true
JVM_VARIANT_CLIENT := false
JVM_VARIANT_MINIMAL1 := false
JVM_VARIANT_KERNEL := false
JVM_VARIANT_ZERO := false
JVM_VARIANT_ZEROSHARK := false
JVM_VARIANT_CORE := false
# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
# This is needed to get the LOG setting to work properly.
include $(SRC_ROOT)/make/common/MakeBase.gmk
......@@ -134,6 +134,7 @@ BASIC_SETUP_DEFAULT_MAKE_TARGET
# We need build & target for this.
JDKOPT_SETUP_JDK_OPTIONS
JDKOPT_SETUP_JLINK_OPTIONS
HOTSPOT_SETUP_HOTSPOT_OPTIONS
JDKVER_SETUP_JDK_VERSION_NUMBERS
......@@ -144,6 +145,7 @@ JDKVER_SETUP_JDK_VERSION_NUMBERS
###############################################################################
BOOTJDK_SETUP_BOOT_JDK
BOOTJDK_SETUP_BUILD_JDK
###############################################################################
#
......@@ -155,6 +157,8 @@ SRCDIRS_SETUP_TOPDIRS
SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS
SRCDIRS_SETUP_OUTPUT_DIRS
SRCDIRS_SETUP_IMPORT_MODULES
###############################################################################
#
# Setup the toolchain (compilers etc), i.e. tools used to compile and process
......
......@@ -689,9 +689,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
;;
esac
# Setup LP64
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK $ADD_LP64"
# Set some common defines. These works for all compilers, but assume
# -D is universally accepted.
......@@ -722,7 +719,12 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -D$OPENJDK_TARGET_OS_UPPERCASE"
# Setup target CPU
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
OPENJDK_TARGET_CCXXFLAGS_JDK="$OPENJDK_TARGET_CCXXFLAGS_JDK \
$ADD_LP64 \
-DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
OPENJDK_BUILD_CCXXFLAGS_JDK="$OPENJDK_BUILD_CCXXFLAGS_JDK \
$OPENJDK_BUILD_ADD_LP64 \
-DARCH='\"$OPENJDK_BUILD_CPU_LEGACY\"' -D$OPENJDK_BUILD_CPU_LEGACY"
# Setup debug/release defines
if test "x$DEBUG_LEVEL" = xrelease; then
......@@ -766,17 +768,35 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/libjava"
# The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \
$CFLAGS_JDK $EXTRA_CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \
$CXXFLAGS_JDK $EXTRA_CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
# Executable flags
CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \
$CFLAGS_JDK $EXTRA_CFLAGS_JDK"
CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $OPENJDK_TARGET_CCXXFLAGS_JDK \
$CXXFLAGS_JDK $EXTRA_CXXFLAGS_JDK"
# The corresponding flags for building for the build platform. This is still an
# approximation, we only need something that runs on this machine when cross
# compiling the product.
OPENJDK_BUILD_CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $OPENJDK_BUILD_CCXXFLAGS_JDK \
$PICFLAG $CFLAGS_JDKLIB_EXTRA"
OPENJDK_BUILD_CXXFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $OPENJDK_BUILD_CCXXFLAGS_JDK \
$PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
OPENJDK_BUILD_CFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $OPENJDK_BUILD_CCXXFLAGS_JDK"
OPENJDK_BUILD_CXXFLAGS_JDKEXE="$COMMON_CCXXFLAGS_JDK $OPENJDK_BUILD_CCXXFLAGS_JDK"
AC_SUBST(CFLAGS_JDKLIB)
AC_SUBST(CFLAGS_JDKEXE)
AC_SUBST(CXXFLAGS_JDKLIB)
AC_SUBST(CXXFLAGS_JDKEXE)
AC_SUBST(OPENJDK_BUILD_CFLAGS_JDKLIB)
AC_SUBST(OPENJDK_BUILD_CFLAGS_JDKEXE)
AC_SUBST(OPENJDK_BUILD_CXXFLAGS_JDKLIB)
AC_SUBST(OPENJDK_BUILD_CXXFLAGS_JDKEXE)
# Flags for compiling test libraries
CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
......@@ -872,6 +892,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined"
fi
OPENJDK_BUILD_LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE}"
LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} ${EXTRA_LDFLAGS_JDK}"
# Customize LDFLAGS for libs
LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
......@@ -882,30 +905,39 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
JDKLIB_LIBS=""
else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
-L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)"
# On some platforms (mac) the linker warns about non existing -L dirs.
# Add server first if available. Linking aginst client does not always produce the same results.
# Only add client dir if client is being built. Add minimal (note not minimal1) if only building minimal1.
# Default to server for other variants.
if test "x$JVM_VARIANT_SERVER" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
elif test "x$JVM_VARIANT_CLIENT" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/client"
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/client"
elif test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/minimal"
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/minimal"
else
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}/server"
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
fi
JDKLIB_LIBS="-ljava -ljvm"
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
JDKLIB_LIBS="$JDKLIB_LIBS -lc"
fi
# When building a buildjdk, it's always only the server variant
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} \
-L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base\$(OPENJDK_TARGET_CPU_LIBDIR)/server"
fi
OPENJDK_BUILD_LDFLAGS_JDKLIB="${OPENJDK_BUILD_LDFLAGS_JDKLIB} ${LDFLAGS_JDKLIB}"
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${EXTRA_LDFLAGS_JDK}"
AC_SUBST(LDFLAGS_JDKLIB)
AC_SUBST(LDFLAGS_JDKEXE)
AC_SUBST(OPENJDK_BUILD_LDFLAGS_JDKLIB)
AC_SUBST(OPENJDK_BUILD_LDFLAGS_JDKEXE)
AC_SUBST(JDKLIB_LIBS)
AC_SUBST(JDKEXE_LIBS)
AC_SUBST(LDFLAGS_CXX_JDK)
......@@ -1075,5 +1107,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
;;
esac
AC_SUBST(DISABLE_WARNING_PREFIX)
AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
])
......@@ -405,3 +405,31 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
AC_SUBST(STATIC_BUILD)
])
################################################################################
#
# jlink options.
# We always keep packaged modules in JDK image.
#
AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
[
AC_ARG_ENABLE([keep-packaged-modules], [AS_HELP_STRING([--disable-keep-packaged-modules],
[Do not keep packaged modules in jdk image @<:@enable@:>@])])
if test "x$enable_keep_packaged_modules" = "xyes"; then
AC_MSG_CHECKING([if packaged modules are kept])
AC_MSG_RESULT([yes])
JLINK_KEEP_PACKAGED_MODULES=true
elif test "x$enable_keep_packaged_modules" = "xno"; then
AC_MSG_CHECKING([if packaged modules are kept])
AC_MSG_RESULT([no])
JLINK_KEEP_PACKAGED_MODULES=false
elif test "x$enable_keep_packaged_modules" = "x"; then
AC_MSG_RESULT([yes (default)])
JLINK_KEEP_PACKAGED_MODULES=true
else
AC_MSG_ERROR([--enable-keep-packaged-modules accepts no argument])
fi
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
])
......@@ -304,6 +304,37 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
fi
AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR)
# Now do the same for OPENJDK_BUILD_CPU...
# Also store the legacy naming of the cpu.
# Ie i586 and amd64 instead of x86 and x86_64
OPENJDK_BUILD_CPU_LEGACY="$OPENJDK_BUILD_CPU"
if test "x$OPENJDK_BUILD_CPU" = xx86; then
OPENJDK_BUILD_CPU_LEGACY="i586"
elif test "x$OPENJDK_BUILD_OS" != xmacosx && test "x$OPENJDK_BUILD_CPU" = xx86_64; then
# On all platforms except MacOSX replace x86_64 with amd64.
OPENJDK_BUILD_CPU_LEGACY="amd64"
fi
AC_SUBST(OPENJDK_BUILD_CPU_LEGACY)
# And the second legacy naming of the cpu.
# Ie i386 and amd64 instead of x86 and x86_64.
OPENJDK_BUILD_CPU_LEGACY_LIB="$OPENJDK_BUILD_CPU"
if test "x$OPENJDK_BUILD_CPU" = xx86; then
OPENJDK_BUILD_CPU_LEGACY_LIB="i386"
elif test "x$OPENJDK_BUILD_CPU" = xx86_64; then
OPENJDK_BUILD_CPU_LEGACY_LIB="amd64"
fi
AC_SUBST(OPENJDK_BUILD_CPU_LEGACY_LIB)
# This is the name of the cpu (but using i386 and amd64 instead of
# x86 and x86_64, respectively), preceeded by a /, to be used when
# locating libraries. On macosx, it's empty, though.
OPENJDK_BUILD_CPU_LIBDIR="/$OPENJDK_BUILD_CPU_LEGACY_LIB"
if test "x$OPENJDK_BUILD_OS" = xmacosx; then
OPENJDK_BUILD_CPU_LIBDIR=""
fi
AC_SUBST(OPENJDK_BUILD_CPU_LIBDIR)
# OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
# /amd64 or /sparcv9. This string is appended to some library paths, like this:
# /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so
......@@ -346,6 +377,24 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
fi
AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS)
OPENJDK_BUILD_CPU_JLI="$OPENJDK_BUILD_CPU"
if test "x$OPENJDK_BUILD_CPU" = xx86; then
OPENJDK_BUILD_CPU_JLI="i386"
elif test "x$OPENJDK_BUILD_OS" != xmacosx && test "x$OPENJDK_BUILD_CPU" = xx86_64; then
# On all platforms except macosx, we replace x86_64 with amd64.
OPENJDK_BUILD_CPU_JLI="amd64"
fi
# Now setup the -D flags for building libjli.
OPENJDK_BUILD_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_BUILD_CPU_JLI\"'"
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
if test "x$OPENJDK_BUILD_CPU_ARCH" = xsparc; then
OPENJDK_BUILD_CPU_JLI_CFLAGS="$OPENJDK_BUILD_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'"
elif test "x$OPENJDK_BUILD_CPU_ARCH" = xx86; then
OPENJDK_BUILD_CPU_JLI_CFLAGS="$OPENJDK_BUILD_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'"
fi
fi
AC_SUBST(OPENJDK_BUILD_CPU_JLI_CFLAGS)
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
OPENJDK_TARGET_OS_EXPORT_DIR=macosx
else
......@@ -362,6 +411,11 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
fi
fi
AC_SUBST(LP64,$A_LP64)
if test "x$OPENJDK_BUILD_CPU_BITS" = x64; then
if test "x$OPENJDK_BUILD_OS" = xlinux || test "x$OPENJDK_BUILD_OS" = xmacosx; then
OPENJDK_BUILD_ADD_LP64="-D_LP64=1"
fi
fi
if test "x$COMPILE_TYPE" = "xcross"; then
# FIXME: ... or should this include reduced builds..?
......
......@@ -84,3 +84,56 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
])
################################################################################
# Define a mechanism for importing extra prebuilt modules
#
AC_DEFUN_ONCE([SRCDIRS_SETUP_IMPORT_MODULES],
[
AC_ARG_WITH(import-modules, [AS_HELP_STRING([--with-import-modules],
[import a set of prebuilt modules either as a zip file or an exploded directory])])
if test "x$with_import_modules" != x \
&& test "x$with_import_modules" != "xno"; then
if test -d "$with_import_modules"; then
IMPORT_MODULES_TOPDIR="$with_import_modules"
BASIC_FIXUP_PATH([IMPORT_MODULES_TOPDIR])
elif test -e "$with_import_modules"; then
IMPORT_MODULES_TOPDIR="$CONFIGURESUPPORT_OUTPUTDIR/import-modules"
$RM -rf "$IMPORT_MODULES_TOPDIR"
$MKDIR -p "$IMPORT_MODULES_TOPDIR"
if ! $UNZIP -q "$with_import_modules" -d "$IMPORT_MODULES_TOPDIR"; then
AC_MSG_ERROR([--with-import-modules="$with_import_modules" must point to a dir or a zip file])
fi
else
AC_MSG_ERROR([--with-import-modules="$with_import_modules" must point to a dir or a zip file])
fi
fi
if test -d "$IMPORT_MODULES_TOPDIR/modules"; then
IMPORT_MODULES_CLASSES="$IMPORT_MODULES_TOPDIR/modules"
fi
if test -d "$IMPORT_MODULES_TOPDIR/modules_cmds"; then
IMPORT_MODULES_CMDS="$IMPORT_MODULES_TOPDIR/modules_cmds"
fi
if test -d "$IMPORT_MODULES_TOPDIR/modules_libs"; then
IMPORT_MODULES_LIBS="$IMPORT_MODULES_TOPDIR/modules_libs"
fi
if test -d "$IMPORT_MODULES_TOPDIR/modules_conf"; then
IMPORT_MODULES_CONF="$IMPORT_MODULES_TOPDIR/modules_conf"
fi
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi
AC_SUBST(IMPORT_MODULES_CLASSES)
AC_SUBST(IMPORT_MODULES_CMDS)
AC_SUBST(IMPORT_MODULES_LIBS)
AC_SUBST(IMPORT_MODULES_CONF)
AC_SUBST(IMPORT_MODULES_SRC)
AC_SUBST(IMPORT_MODULES_MAKE)
])
......@@ -130,6 +130,14 @@ JAXP_TOPDIR:=@JAXP_TOPDIR@
JAXWS_TOPDIR:=@JAXWS_TOPDIR@
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
NASHORN_TOPDIR:=@NASHORN_TOPDIR@
IMPORT_MODULES_CLASSES:=@IMPORT_MODULES_CLASSES@
IMPORT_MODULES_CMDS:=@IMPORT_MODULES_CMDS@
IMPORT_MODULES_LIBS:=@IMPORT_MODULES_LIBS@
IMPORT_MODULES_CONF:=@IMPORT_MODULES_CONF@
IMPORT_MODULES_SRC:=@IMPORT_MODULES_SRC@
IMPORT_MODULES_MAKE:=@IMPORT_MODULES_MAKE@
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
# New (JEP-223) version information
......@@ -246,6 +254,7 @@ TESTMAKE_OUTPUTDIR=$(BUILD_OUTPUT)/test-make
MAKESUPPORT_OUTPUTDIR=$(BUILD_OUTPUT)/make-support
# This does not get overridden in a bootcycle build
CONFIGURESUPPORT_OUTPUTDIR:=@CONFIGURESUPPORT_OUTPUTDIR@
BUILDJDK_OUTPUTDIR=$(BUILD_OUTPUT)/buildjdk
HOTSPOT_DIST=@HOTSPOT_DIST@
......@@ -255,6 +264,9 @@ BUILD_HOTSPOT=@BUILD_HOTSPOT@
# it in sync.
BOOT_JDK:=@BOOT_JDK@
BUILD_JDK:=@BUILD_JDK@
CREATE_BUILDJDK:=@CREATE_BUILDJDK@
# When compiling Java source to be run by the boot jdk
# use these extra flags, eg -source 6 -target 6
BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
......@@ -405,6 +417,8 @@ BUILD_LDCXX:=@FIXPATH@ @BUILD_LDCXX@
BUILD_AS:=@FIXPATH@ @BUILD_AS@
BUILD_AR:=@FIXPATH@ @BUILD_AR@
BUILD_NM:=@FIXPATH@ @BUILD_NM@
BUILD_OBJCOPY:=@BUILD_OBJCOPY@
BUILD_STRIP:=@BUILD_STRIP@
BUILD_SYSROOT_CFLAGS:=@BUILD_SYSROOT_CFLAGS@
BUILD_SYSROOT_LDFLAGS:=@BUILD_SYSROOT_LDFLAGS@
......@@ -502,12 +516,40 @@ SJAVAC_SERVER_JAVA=@FIXPATH@ @FIXPATH_DETACH_FLAG@ $(SJAVAC_SERVER_JAVA_CMD) \
# overriding that value by using ?=.
JAVAC_FLAGS?=@JAVAC_FLAGS@
BUILD_JAVA_FLAGS:=-Xms64M -Xmx1100M
BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS)
# Use ?= as this can be overridden from bootcycle-spec.gmk
BOOT_JDK_MODULAR ?= @BOOT_JDK_MODULAR@
ifeq ($(BOOT_JDK_MODULAR), true)
INTERIM_OVERRIDE_MODULES_ARGS = -Xpatch:$(BUILDTOOLS_OUTPUTDIR)/override_modules
INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS)
JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main
JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main
else
INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \
jdk.jdeps jdk.javadoc jdk.rmic
INTERIM_OVERRIDE_MODULES_ARGS = \
-Xbootclasspath/p:$(call PathList, \
$(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \
$(INTERIM_OVERRIDE_MODULES)))
INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) \
-cp $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.compiler
JAVAC_MAIN_CLASS = com.sun.tools.javac.Main
JAVADOC_MAIN_CLASS = jdk.javadoc.internal.tool.Main
endif
# You run the new javac using the boot jdk with $(BOOT_JDK)/bin/java $(NEW_JAVAC) ...
# Use = assignment to be able to override in bootcycle-spec.gmk
INTERIM_LANGTOOLS_JAR = $(BUILDTOOLS_OUTPUTDIR)/interim_langtools.jar
INTERIM_LANGTOOLS_ARGS = "-Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR)" -cp $(INTERIM_LANGTOOLS_JAR)
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) com.sun.tools.javac.Main
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) jdk.javadoc.internal.tool.Main
NEW_JAVAC = $(INTERIM_LANGTOOLS_ARGS) $(JAVAC_MAIN_CLASS)
NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)
# JLink/Jmod are run using the BUILD_JDK, which is normally the jdk output dir.
JLINK_KEEP_PACKAGED_MODULES:=@JLINK_KEEP_PACKAGED_MODULES@
JLINK = @FIXPATH@ $(BUILD_JDK)/bin/jlink $(JAVA_TOOL_FLAGS_SMALL)
JMOD = @FIXPATH@ $(BUILD_JDK)/bin/jmod $(JAVA_TOOL_FLAGS_SMALL)
# Base flags for RC
# Guarding this against resetting value. Legacy make files include spec multiple
......
......@@ -797,6 +797,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
BASIC_FIXUP_EXECUTABLE(BUILD_NM)
BASIC_PATH_PROGS(BUILD_AR, ar gcc-ar)
BASIC_FIXUP_EXECUTABLE(BUILD_AR)
BASIC_PATH_PROGS(BUILD_OBJCOPY, objcopy)
BASIC_FIXUP_EXECUTABLE(BUILD_OBJCOPY)
BASIC_PATH_PROGS(BUILD_STRIP, strip)
BASIC_FIXUP_EXECUTABLE(BUILD_STRIP)
# Assume the C compiler is the assembler
BUILD_AS="$BUILD_CC -c"
# Just like for the target compiler, use the compiler as linker
......@@ -813,6 +817,8 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
BUILD_LDCXX="$LDCXX"
BUILD_NM="$NM"
BUILD_AS="$AS"
BUILD_OBJCOPY="$OBJCOPY"
BUILD_STRIP="$STRIP"
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
BUILD_SYSROOT_LDFLAGS="$SYSROOT_LDFLAGS"
BUILD_AR="$AR"
......
......@@ -290,9 +290,9 @@ compare_general_files() {
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" \
! -name "*.zip" ! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
! -name "*.jimage" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
! -name "modules" ! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
! -name "*.cpl" ! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" \
! -name "*.lib" ! -name "*.war" ! -name "JavaControlPanel" ! -name "*.jmod" \
! -name "*.obj" ! -name "*.o" ! -name "JavaControlPanelHelper" \
! -name "JavaUpdater" ! -name "JavaWSApplicationStub" \
! -name "jspawnhelper" ! -name "JavawsLauncher" ! -name "*.a" \
......@@ -389,13 +389,13 @@ compare_zip_file() {
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
$MKDIR -p $THIS_UNZIPDIR
$MKDIR -p $OTHER_UNZIPDIR
if [ "$TYPE" = "jimage" ]
if [ "$TYPE" = "jar" || "$TYPE" = "war" || "$TYPE" = "zip" || "$TYPE" = "jmod"]
then
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
else
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
else
(cd $THIS_UNZIPDIR && $JIMAGE extract $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $JIMAGE extract $OTHER_ZIP)
fi
# Find all archives inside and unzip them as well to compare the contents rather than
......@@ -526,7 +526,7 @@ compare_all_jar_files() {
# TODO filter?
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" -o -name "*.war" \
-o -name "*.jimage" | $SORT | $FILTER)
-o -name "modules" -o -name "*.jmod" | $SORT | $FILTER)
if [ -n "$ZIPS" ]; then
echo Jar files...
......
......@@ -421,10 +421,10 @@ var getJibProfilesDependencies = function (input, common) {
jtreg: {
server: "javare",
revision: "4.1",
build_number: "b12",
revision: "4.2",
build_number: "b01",
checksum_file: "MD5_VALUES",
file: "jtreg_bin-4.1.zip",
file: "jtreg_bin-4.2.zip",
environment_name: "JT_HOME"
},
......
......@@ -46,6 +46,9 @@ java.base_ADD_JAVAC_FLAGS := -Xdoclint:all/protected,-reference '-Xdoclint/packa
java.base_COPY := .icu .dat .spp content-types.properties hijrah-config-islamic-umalqura.properties
java.base_CLEAN := intrinsic.properties
java.base_EXCLUDE_FILES += \
$(JDK_TOPDIR)/src/java.base/share/classes/jdk/internal/module/ModuleLoaderMap.java
java.base_EXCLUDES += java/lang/doc-files
# Exclude BreakIterator classes that are just used in compile process to generate
......@@ -359,8 +362,8 @@ jdk.charsets_COPY := .dat
################################################################################
jdk.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:-com.sun.tools.*' -XDstringConcat=inline
jdk.compiler_COPY := javax.tools.JavaCompilerTool
jdk.compiler_ADD_JAVAC_FLAGS := -Xdoclint:all/protected '-Xdoclint/package:-com.sun.tools.*' \
-XDstringConcat=inline
jdk.compiler_CLEAN_FILES := $(wildcard \
$(patsubst %, $(JDK_TOPDIR)/src/jdk.compiler/share/classes/%/*.properties, \
sun/tools/serialver/resources))
......@@ -480,31 +483,28 @@ jdk.localedata_EXCLUDE_FILES += sun/text/resources/th/BreakIteratorRules_th.java
# source before static source and platform specific source before shared.
#
GENERATED_SRC_DIRS += \
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE) \
$(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$(MODULE) \
$(SUPPORT_OUTPUTDIR)/gensrc \
#
TOP_SRC_DIRS += \
$(HOTSPOT_TOPDIR)/src \
$(CORBA_TOPDIR)/src \
$(JDK_TOPDIR)/src \
$(LANGTOOLS_TOPDIR)/src \
$(JAXP_TOPDIR)/src \
$(JAXWS_TOPDIR)/src \
$(NASHORN_TOPDIR)/src \
#
OS_SRC_DIRS += $(JDK_TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/classes
SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
OS_TYPE_SRC_DIRS += $(JDK_TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/classes
SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
endif
SRC_SUBDIRS += share/classes
SHARE_SRC_DIRS += \
$(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes \
$(JDK_TOPDIR)/src/$(MODULE)/share/classes \
$(LANGTOOLS_TOPDIR)/src/$(MODULE)/share/classes \
$(CORBA_TOPDIR)/src/$(MODULE)/share/classes \
$(JAXP_TOPDIR)/src/$(MODULE)/share/classes \
$(JAXWS_TOPDIR)/src/$(MODULE)/share/classes \
$(NASHORN_TOPDIR)/src/$(MODULE)/share/classes \
#
ALL_SRC_DIRS = \
$(GENERATED_SRC_DIRS) \
$(OS_SRC_DIRS) \
$(OS_TYPE_SRC_DIRS) \
$(SHARE_SRC_DIRS) \
#
MODULE_SRC_DIRS := $(strip \
$(addsuffix /$(MODULE), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
$(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(MODULE)/$(sub), $(TOP_SRC_DIRS))))
# The JDK_USER_DEFINED_FILTER is a poor man's incremental build: by specifying
# JDK_FILTER at the make command line, only a subset of the JDK java files will
......@@ -512,32 +512,41 @@ ALL_SRC_DIRS = \
# space separated list.
JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
# Create an empty directory to set the bootclasspath to.
EMPTY_DIR := $(SUPPORT_OUTPUTDIR)/empty-dir
$(call MakeDir, $(EMPTY_DIR))
# Rewrite the MODULE_SRC_DIRS with a wildcard for the module so that all module
# source dirs are available on the path.
MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP),$(subst $(MODULE),*,$(MODULE_SRC_DIRS)))
# Add imported modules to the moduleclasspath
MODULECLASSPATH := $(subst $(SPACE),$(PATH_SEP), $(IMPORT_MODULES_CLASSES))
# Find the module dependencies by parsing modules.list file
DEPS := $(call FindDepsForModule, $(MODULE))
ifeq ($(MODULE), jdk.vm.ci)
## WORKAROUND jdk.vm.ci source structure issue
JVMCI_MODULESOURCEPATH := $(MODULESOURCEPATH) \
$(subst /$(MODULE)/,/*/, $(filter-out %processor/src, \
$(wildcard $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes/*/src)))
MODULESOURCEPATH := $(subst $(SPACE),$(PATH_SEP), $(JVMCI_MODULESOURCEPATH))
endif
CLASSPATH := $(foreach d, $(DEPS), $(if $($d_BIN), $($d_BIN), \
$(JDK_OUTPUTDIR)/modules/$d))
# When crypto classes are prebuilt, need to look for classes already in
# output dir.
ifneq ($(BUILD_CRYPTO), true)
CLASSPATH += $(JDK_OUTPUTDIR)/modules/$(MODULE)
endif
JAVAC_FLAGS_BOOTCLASSPATH := -bootclasspath $(EMPTY_DIR) -extdirs $(EMPTY_DIR) \
-endorseddirs $(EMPTY_DIR) $($(MODULE)_ADD_JAVAC_FLAGS)
# Make sure the generated source base dirs exist. Not all modules have generated
# source in all of these directories and because of timing, all of them might not
# exist at the time this makefile gets called. Javac will complain if there are
# missing directories in the moduleclasspath.
$(call MakeDir, $(GENERATED_SRC_DIRS))
$(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
SRC := $(if $($(MODULE)_SRC), $($(MODULE)_SRC), $(wildcard $(ALL_SRC_DIRS))), \
INCLUDES := $(JDK_USER_DEFINED_FILTER),\
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules/$(MODULE)), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers/$(MODULE), \
CLASSPATH := $(CLASSPATH), \
ADD_JAVAC_FLAGS := $($(MODULE)_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS_BOOTCLASSPATH) \
MODULE := $(MODULE), \
SRC := $(wildcard $(MODULE_SRC_DIRS)), \
INCLUDES := $(JDK_USER_DEFINED_FILTER),\
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
ADD_JAVAC_FLAGS := \
$($(MODULE)_ADD_JAVAC_FLAGS) \
-modulesourcepath "$(MODULESOURCEPATH)" \
$(if $(MODULECLASSPATH), -modulepath "$(MODULECLASSPATH)") \
-system none, \
))
TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)
# Declare dependencies between java compilations of different modules.
......@@ -545,7 +554,7 @@ TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)
# use the macro to find the correct target file to depend on.
# Only the javac compilation actually depends on other modules so limit
# dependency declaration to that by using the *_COMPILE_TARGET variable.
$($(MODULE)_COMPILE_TARGET): $(foreach d, $($(MODULE)_DEPS), \
$($(MODULE)_COMPILE_TARGET): $(foreach d, $(call FindDepsForModule, $(MODULE)), \
$(call SetupJavaCompilationCompileTarget, $d, \
$(if $($d_BIN), $($d_BIN), $(JDK_OUTPUTDIR)/modules/$d)))
......@@ -568,6 +577,29 @@ ifeq ($(MODULE), java.rmi)
TARGETS += $(call CreateHkTargets, $(java.rmi_CLEAN_FILES))
endif
################################################################################
# If this is an imported module, copy the pre built classes and resources into
# the modules output dir
ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
$(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
$(call CacheFind, $(IMPORT_MODULES_CLASSES)/$(MODULE))
$(RM) -r $(@D)
$(MKDIR) -p $(@D)
$(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE)/* $(@D)/
$(TOUCH) $@
TARGETS += $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker
# Add this dependency to avoid a race between compiling module-info.java and
# importing the classes.
$($(MODULE)_COMPILE_TARGET): $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker
endif
################################################################################
$(eval $(call IncludeCustomExtension, , CompileJavaModules-post.gmk))
################################################################################
all: $(TARGETS)
......
#
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, Oracle and/or its affiliates. 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
......@@ -23,24 +23,64 @@
# questions.
#
# Default target declared first
# This makefile is called for every imported module to copy the non class
# contents into the exploded jdk image.
default: all
include $(SPEC)
include MakeBase.gmk
JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.jdeps/com/sun/tools/jdeps/resources/jdeps-modules.xml
LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
#
# Verify access across module boundaries
#
checkdeps:
$(ECHO) "Checking dependencies across JDK modules"
$(JAVA) -Xbootclasspath/p:$(INTERIM_LANGTOOLS_JAR) \
-Djdeps.modules.xml=$(JDEPS_MODULES_XML) \
com.sun.tools.jdeps.Main \
-verify:access -mp $(JDK_OUTPUTDIR)/modules
$(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR)))
ifneq ($(LIBS_DIR), )
ifeq ($(OPENJDK_TARGET_OS), windows)
TO_BIN_FILTER := %$(SHARED_LIBRARY_SUFFIX) %.diz %.pdb %.map
$(eval $(call SetupCopyFiles,COPY_LIBS_TO_BIN, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(filter $(TO_BIN_FILTER), \
$(call CacheFind, $(LIBS_DIR))) \
))
$(eval $(call SetupCopyFiles,COPY_LIBS_TO_LIB, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter-out $(TO_BIN_FILTER), \
$(call CacheFind, $(LIBS_DIR))) \
))
TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
else
$(eval $(call SetupCopyFiles, COPY_LIBS, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(call CacheFind, $(LIBS_DIR)), \
))
TARGETS += $(COPY_LIBS)
endif
endif
ifneq ($(CMDS_DIR), )
$(eval $(call SetupCopyFiles, COPY_CMDS, \
SRC := $(CMDS_DIR), \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(call CacheFind, $(CMDS_DIR)), \
))
TARGETS += $(COPY_CMDS)
endif
all: checkdeps
ifneq ($(CONF_DIR), )
$(eval $(call SetupCopyFiles, COPY_CONF, \
SRC := $(CONF_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(call CacheFind, $(CONF_DIR)), \
))
TARGETS += $(COPY_CONF)
endif
.PHONY: all
all: $(TARGETS)
#
# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, Oracle and/or its affiliates. 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
......@@ -23,42 +23,64 @@
# questions.
#
# This file is included from Main.gmk only.
default: all
include $(SRC_ROOT)/make/common/JavaCompilation.gmk
include $(SRC_ROOT)/make/common/SetupJavaCompilers.gmk
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
MODULES_TO_COPY := $(call FindTransitiveDepsForModule, jdk.jlink) jdk.jlink
################################################################################
# Copy the modules needed to run jlink and jmod. Use bulk copy instead of
# SetupCopyFiles since there are so many files.
COPY_CLASSES_TARGET := $(BUILDJDK_OUTPUTDIR)/jdk/modules/_buildjdk-copy-maker
$(COPY_CLASSES_TARGET): $(call CacheFind, $(wildcard \
$(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY))))
$(ECHO) $(LOG_INFO) "Copying java modules to buildjdk: $(MODULES_TO_COPY)"
$(RM) -r $(BUILDJDK_OUTPUTDIR)/jdk/modules
$(MKDIR) -p $(BUILDJDK_OUTPUTDIR)/jdk/modules
$(foreach m, $(MODULES_TO_COPY), \
$(CP) -R $(JDK_OUTPUTDIR)/modules/$m \
$(BUILDJDK_OUTPUTDIR)/jdk/modules/ $(NEWLINE))
$(TOUCH) $@
$(eval $(call SetupJavaCompilation, BUILD_GENMODULESLIST, \
SETUP := BOOT_JAVAC, \
SRC := $(JDK_TOPDIR)/make/src/classes, \
INCLUDES := build/tools/module, \
EXCLUDE_FILES := ImageBuilder.java ModuleArchive.java, \
BIN := $(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist, \
DISABLE_SJAVAC := true, \
TARGETS += $(COPY_CLASSES_TARGET)
#$(eval $(call SetupCopyFiles, COPY_JDK_MODULES, \
SRC := $(BUILD_OUTPUT), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(call DoubleDollar, $(call DoubleDollar, $(call CacheFind, $(wildcard \
$(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY)))))), \
))
TOOL_GENMODULESLIST = $(JAVA_SMALL) \
-cp "$(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist" \
build.tools.module.GenModulesList
#TARGETS += $(COPY_JDK_MODULES)
################################################################################
MODULES_LIST_FILE := $(MAKESUPPORT_OUTPUTDIR)/modules.list
# The module deps makefile is used from make/common/Modules.gmk
MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
$(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \
SRC := $(BUILD_OUTPUT), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(call CacheFind, $(wildcard \
$(addprefix $(SUPPORT_OUTPUTDIR)/headers/, $(MODULES_TO_COPY)))), \
))
$(MODULES_LIST_FILE): $(SRC_ROOT)/modules.xml $(BUILD_GENMODULESLIST)
$(TOOL_GENMODULESLIST) -o $@ $(filter %.xml, $^)
TARGETS += $(COPY_SUPPORT_HEADERS)
$(MODULE_DEPS_MAKEFILE): $(MODULES_LIST_FILE)
$(CAT) $^ | $(SED) -e 's/^\([^:]*\):/DEPS_\1 :=/g' > $@
################################################################################
$(eval $(call SetupCopyFiles, COPY_JDK_LIB_FILES, \
SRC := $(BUILD_OUTPUT), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(JDK_OUTPUTDIR)/lib/tzdb.dat, \
))
TARGETS += $(MODULE_DEPS_MAKEFILE)
TARGETS += $(COPY_JDK_LIB_FILES)
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, , GenerateModuleDeps.gmk))
all: $(TARGETS)
# Trigger generation of this file and restart make if it changed.
-include $(MODULE_DEPS_MAKEFILE)
.PHONY: default all
#
# Copyright (c) 2014, Oracle and/or its affiliates. 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. Oracle 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.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
default: all
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
ifeq ($(MODULE), )
$(error MODULE must be set when calling CreateJmods.gmk)
endif
################################################################################
LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_libs-stripped $(IMPORT_MODULES_LIBS))))
CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_cmds-stripped $(IMPORT_MODULES_CMDS))))
CONF_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_conf $(IMPORT_MODULES_CONF))))
CLASSES_DIR := $(wildcard $(JDK_OUTPUTDIR)/modules/$(MODULE))
$(eval $(call FillCacheFind, \
$(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
))
ifneq ($(LIBS_DIR), )
JMOD_FLAGS += --libs $(LIBS_DIR)
DEPS += $(call CacheFind, $(LIBS_DIR))
endif
ifneq ($(CMDS_DIR), )
JMOD_FLAGS += --cmds $(CMDS_DIR)
DEPS += $(call CacheFind, $(CMDS_DIR))
endif
ifneq ($(CONF_DIR), )
JMOD_FLAGS += --config $(CONF_DIR)
DEPS += $(call CacheFind, $(CONF_DIR))
endif
ifneq ($(CLASSES_DIR), )
JMOD_FLAGS += --class-path $(CLASSES_DIR)
DEPS += $(call CacheFind, $(CLASSES_DIR))
endif
# Add dependencies on other jmod files
DEPS += $(patsubst %, $(IMAGES_OUTPUTDIR)/jmods/%.jmod, \
$(call FindDepsForModule, $(MODULE)))
# TODO: What about headers?
# Create jmods in a temp dir and then move them into place to keep the
# module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
$(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod: $(DEPS)
$(call LogWarn, Creating $(notdir $@))
$(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods)
$(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
$(JMOD) create \
--module-version $(VERSION_SHORT) \
--os-name $(REQUIRED_OS_NAME) \
--os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
--os-version $(REQUIRED_OS_VERSION) \
--modulepath $(IMAGES_OUTPUTDIR)/jmods\
--hash-dependencies '.*' \
--exclude '**_the.*' \
$(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
$(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@
TARGETS += $(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod
################################################################################
all: $(TARGETS)
################################################################################
#
# Copyright (c) 2015, Oracle and/or its affiliates. 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. Oracle 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.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
################################################################################
# This file makes modifications to module-info.java files based on the build
# configuration.
#
# Depending on build platform, imported modules and optional parts of the build
# being active, some modules need to have extra exports, provides or uses
# declarations added to them. These optional extras are defined in .extra files:
#
# src/<module>/<share,platform>/classes/module-info.java.extra
#
# The contents of the .extra files are simply extra lines that could fit into
# the module-info file.
#
# This makefile is called once for each from-module with the variable
# MODULE naming the from-module.
#
# The modified module-info.java files are put in the gensrc directory where
# they will automatically override the static versions in the src tree.
#
################################################################################
default: all
include $(SPEC)
include MakeBase.gmk
include Modules.gmk
#include TextFileProcessing.gmk
################################################################################
# Define this here since jdk/make/Tools.gmk cannot be included from the top
# make directory. Should probably move some tools away from the jdk repo.
TOOL_GENMODULEINFOSOURCE = $(JAVA_SMALL) \
$(INTERIM_LANGTOOLS_ARGS) \
-cp "$(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes" \
build.tools.module.GenModuleInfoSource
################################################################################
# Name of data file. Keep module-info.java.ext until javafx has changed.
MOD_FILENAME := module-info.java.extra module-info.java.ext
# List all the possible sub directories inside a module source directory where
# data might be stored.
CLASSES_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
CLASSES_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
endif
CLASSES_SUBDIRS += share/classes
# TODO: When the deploy build is better integrated, this will get added globally
# but for now need to add it here.
ifeq ($(BUILD_DEPLOY), true)
ALL_TOP_SRC_DIRS += $(DEPLOY_TOPDIR)/src
endif
# Construct all possible src directories for the module.
MODULE_CLASSES_DIRS := $(strip \
$(foreach sub, $(CLASSES_SUBDIRS), \
$(addsuffix /$(MODULE)/$(sub), $(ALL_TOP_SRC_DIRS))) \
$(addsuffix /$(MODULE), $(IMPORT_MODULES_SRC)))
# Find all the .extra files in the src dirs.
MOD_FILES := $(wildcard $(foreach f, $(MOD_FILENAME), $(addsuffix /$(f), \
$(MODULE_CLASSES_DIRS))))
ifneq ($(MOD_FILES), )
# Only make this call if modification files are found for this module
ALL_MODULES := $(call FindAllModules)
# Read the contents of all the files into a variable. Replace space with / to
# let space represent new lines in the variable as $(shell) normalizes all
# whitespace.
$(foreach f, $(MOD_FILES), \
$(eval MOD_FILE_CONTENTS += $(shell $(GREP) -v ".\*" $f | $(TR) ' ' '/')))
# Filter the contents for modules that are actually being built
MODULES_FILTER := $(addprefix %/, $(addsuffix ;, $(ALL_MODULES)))
MODULES_FILTER += provides%
MODIFICATIONS := $(filter $(MODULES_FILTER), $(MOD_FILE_CONTENTS))
# Convert the modification lines into arguments for the modification tool.
# Filter out modifications for non existing to-modules.
$(foreach line, $(MODIFICATIONS), \
$(eval split_line := $(subst /,$(SPACE),$(line))) \
$(eval command := $(word 1, $(split_line))) \
$(eval package := $(word 2, $(split_line))) \
$(eval to_module := $(patsubst %;,%,$(word 4, $(split_line)))) \
$(eval ARGS += -$(command) $(package)/$(to_module)))
ifneq ($(ARGS), )
$(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java: \
$(firstword $(call FindAllModuleInfos, $(MODULE))) \
$(BUILD_TOOLS_JDK) \
$(call DependOnVariable, ARGS)
$(MKDIR) -p $(@D)
$(RM) $@ $@.tmp
$(TOOL_GENMODULEINFOSOURCE) $(ARGS) -o $@.tmp $<
$(MV) $@.tmp $@
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java
endif
# This doesn't work because javac only accepts one single exports line per
# exported package.
# Restore the modifications to separate lines with spaces
# MODIFICATIONS := $(subst /,$(SPACE),$(MODIFICATIONS))
# ifneq ($(MODIFICATIONS), )
# $(eval $(call SetupTextFileProcessing, PROCESS_MODULE_INFO, \
# SOURCE_FILES := $(firstword $(call FindAllModuleInfos, $(MODULE))), \
# OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java, \
# REPLACEMENTS := } => $(MODIFICATIONS) }, \
# ))
# TARGETS += $(PROCESS_MODULE_INFO)
# endif
endif
# If no modifications are found for this module, remove any module-info.java
# created by a previous build since that is no longer valid.
ifeq ($(MODIFICATIONS), )
ifneq ($(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java), )
$(shell $(RM) $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/module-info.java)
endif
endif
################################################################################
all: $(TARGETS)
......@@ -25,7 +25,10 @@
# Include the legacy hotspot-spec.gmk (which in turns includes spec.gmk)
BASE_SPEC:=$(SPEC)
include $(dir $(SPEC))hotspot-spec.gmk
# Assign to HOTSPOT_SPEC so that the variable HOTSPOT_SPEC can be
# overridden when building the buildjdk.
HOTSPOT_SPEC := $(dir $(SPEC))hotspot-spec.gmk
include $(HOTSPOT_SPEC)
include MakeBase.gmk
# Inclusion of this pseudo-target will cause make to execute this file
......@@ -45,7 +48,7 @@ HOTSPOT_FILES := $(shell $(FIND) -L \
# not doing it breaks builds on msys.
$(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp: $(HOTSPOT_FILES)
@$(MKDIR) -p $(HOTSPOT_OUTPUTDIR)
@($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(HOTSPOT_MAKE_ARGS) \
($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) $(HOTSPOT_MAKE_ARGS) \
LOG_LEVEL=$(LOG_LEVEL) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC))
$(TOUCH) $@
......
......@@ -38,7 +38,7 @@ $(eval $(call IncludeCustomExtension, , Images-pre.gmk))
############################################################################
MAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \
MAIN_MODULES += java.se.ee java.smartcardio jdk.httpserver jdk.sctp \
jdk.security.auth jdk.security.jgss jdk.pack200 jdk.xml.dom \
jdk.accessibility jdk.internal.le jdk.dynalink \
jdk.scripting.nashorn jdk.scripting.nashorn.shell \
......@@ -49,10 +49,10 @@ PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk
jdk.localedata jdk.naming.dns jdk.naming.rmi jdk.zipfs
# tools
TOOLS_MODULES += jdk.attach jdk.compiler jdk.dev \
TOOLS_MODULES += jdk.attach jdk.compiler \
jdk.javadoc jdk.jcmd jdk.jconsole jdk.hotspot.agent jdk.jartool \
jdk.jdeps jdk.jdi jdk.jdwp.agent jdk.jshell jdk.policytool jdk.rmic \
jdk.xml.bind jdk.xml.ws
jdk.jdeps jdk.jdi jdk.jdwp.agent jdk.jlink jdk.jshell \
jdk.policytool jdk.rmic jdk.xml.bind jdk.xml.ws jdk.internal.opt
ifeq ($(OPENJDK_TARGET_OS), windows)
PROVIDER_MODULES += jdk.crypto.mscapi
......@@ -65,104 +65,151 @@ endif
JRE_MODULES := $(filter-out $(MODULES_FILTER), $(MAIN_MODULES) $(PROVIDER_MODULES))
JDK_MODULES := $(filter-out $(MODULES_FILTER), $(JRE_MODULES) $(TOOLS_MODULES))
# compact3 builds have additional modules
JDK_COMPACT3_MODULES := java.compact3 java.smartcardio jdk.httpserver jdk.naming.dns \
jdk.naming.rmi jdk.sctp jdk.security.auth jdk.management
# Param 1 - Name of module
define ReadImportMetaData
ifneq ($$(wildcard $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties), )
include_in_jre :=
include_in_jdk :=
include $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties
ifeq ($$(include_in_jre), true)
JRE_MODULES += $1
endif
ifeq ($$(include_in_jdk), true)
JDK_MODULES += $1
endif
else
# Default to include in all
JRE_MODULES += $1
JDK_MODULES += $1
endif
endef
IMPORTED_MODULES := $(call FindImportedModules)
$(foreach m, $(IMPORTED_MODULES), $(eval $(call ReadImportMetaData, $m)))
# Compact builds have additional modules
COMPACT_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
JRE_COMPACT1_MODULES := $(COMPACT_EXTRA_MODULES) java.compact1
JRE_COMPACT2_MODULES := $(JRE_COMPACT1_MODULES) java.compact2 jdk.xml.dom jdk.httpserver
JRE_COMPACT3_MODULES := $(JRE_COMPACT2_MODULES) java.compact3 java.smartcardio jdk.management \
jdk.naming.dns jdk.naming.rmi jdk.sctp jdk.security.auth
# Replacing double-comma with a single comma is to workaround the issue
# with some version of make on windows that doesn't substitute spaces
# with one comma properly as with make 4.0
define SubstComma
$(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1)))
endef
SubstComma = \
$(strip \
$(subst $(COMMA)$(COMMA),$(COMMA),$(subst $(SPACE),$(COMMA),$(strip $1))) \
)
JRE_MODULES_LIST := $(call SubstComma, $(JRE_MODULES))
JDK_MODULES_LIST := $(call SubstComma, $(JDK_MODULES))
JRE_COMPACT1_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT1_MODULES))
JRE_COMPACT2_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT2_MODULES))
JRE_COMPACT3_MODULES_LIST := $(call SubstComma, $(JRE_COMPACT3_MODULES))
################################################################################
# Release file
BASE_RELEASE_FILE := $(JDK_OUTPUTDIR)/release
# Common way to emit a line into the release or info file
define info-file-item # name value
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
endef
# Param 1 - The file containing the MODULES list
define create-info-file
$(call info-file-item, "JAVA_VERSION", "$(VERSION_NUMBER)")
$(call info-file-item, "JAVA_FULL_VERSION", "$(VERSION_STRING)")
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
$(if $(JDK_ARCH_ABI_PROP_NAME), \
$(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
$(call info-file-item, "SOURCE", "$(strip $(ALL_SOURCE_TIPS))")
endef
# Param 1 - The file containing the MODULES list
define prepare-info-file
$(ECHO) $(LOG_INFO) Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
$(MKDIR) -p $(@D)
$(RM) $@
endef
define info-file
$(call prepare-info-file)
$(call create-info-file)
endef
# Create a variable dependency file common for all release info files.
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
ALL_SOURCE_TIPS = $(shell \
if [ -f $(SUPPORT_OUTPUTDIR)/source_tips ] ; then \
$(CAT) $(SUPPORT_OUTPUTDIR)/source_tips ; \
fi)
$(BASE_RELEASE_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(info-file)
################################################################################
JRE_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jre-sorted-modules
JDK_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/jdk-sorted-modules
JRE_COMPACT1_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact1-sorted-modules
JRE_COMPACT2_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact2-sorted-modules
JRE_COMPACT3_SORTED_MODULES := $(SUPPORT_OUTPUTDIR)/compact3-sorted-modules
MODULES_CMDS := $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped
MODULES_LIBS := $(SUPPORT_OUTPUTDIR)/modules_libs-stripped
MODULES_CONF := $(SUPPORT_OUTPUTDIR)/modules_conf
JIMAGE_TOOL := $(JAVA_SMALL) \
-Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes \
-cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes build.tools.module.ImageBuilder \
--cmds $(MODULES_CMDS) \
--libs $(MODULES_LIBS) \
--configs $(MODULES_CONF) \
--classes $(JDK_OUTPUTDIR)/modules \
--endian $(OPENJDK_TARGET_CPU_ENDIAN) \
#
MODULES_XML += $(SRC_ROOT)/modules.xml
DEPENDENCIES := $(call CacheFind, \
$(SUPPORT_OUTPUTDIR)/modules_cmds \
$(SUPPORT_OUTPUTDIR)/modules_conf \
$(SUPPORT_OUTPUTDIR)/modules_libs) \
$(wildcard $(JDK_OUTPUTDIR)/modules/*/_*) \
$(MODULES_XML)
#
JMODS := $(wildcard $(IMAGES_OUTPUTDIR)/jmods/*.jmod)
# Use this file inside the image as target for make rule
JIMAGE_TARGET_FILE := bin/java$(EXE_SUFFIX)
$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
$(call DependOnVariable, JDK_MODULES_LIST)
JLINK_TOOL := $(JLINK) --modulepath $(IMAGES_OUTPUTDIR)/jmods \
--endian $(OPENJDK_BUILD_CPU_ENDIAN) \
--release-info $(BASE_RELEASE_FILE)
ifeq ($(JLINK_KEEP_PACKAGED_MODULES), true)
JLINK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
endif
$(JDK_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, JDK_MODULES_LIST) $(BASE_RELEASE_FILE)
$(ECHO) Creating jdk jimage
$(RM) -r $(JDK_IMAGE_DIR) $(JDK_SORTED_MODULES)
$(JIMAGE_TOOL) --mods $(JDK_MODULES_LIST) --output $(JDK_IMAGE_DIR) \
$(MODULES_XML) > $(JDK_SORTED_MODULES)
$(RM) -r $(JDK_IMAGE_DIR)
$(JLINK_TOOL) --output $(JDK_IMAGE_DIR) \
--addmods $(JDK_MODULES_LIST) $(JLINK_EXTRA_OPTS)
$(TOUCH) $@
$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
$(call DependOnVariable, JRE_MODULES_LIST)
$(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, JRE_MODULES_LIST) $(BASE_RELEASE_FILE)
$(ECHO) Creating jre jimage
$(RM) -r $(JRE_IMAGE_DIR) $(JRE_SORTED_MODULES)
$(JIMAGE_TOOL) --mods $(JRE_MODULES_LIST) --output $(JRE_IMAGE_DIR) \
$(MODULES_XML) > $(JRE_SORTED_MODULES)
$(RM) -r $(JRE_IMAGE_DIR)
$(JLINK_TOOL) --output $(JRE_IMAGE_DIR) \
--addmods $(JRE_MODULES_LIST)
$(TOUCH) $@
JRE_COMPACT1_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact1
JRE_COMPACT2_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact2
JRE_COMPACT3_IMAGE_DIR := $(JRE_IMAGE_DIR)-compact3
COMPACT_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
$(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
$(call DependOnVariable, JRE_COMPACT1_MODULES_LIST)
$(JRE_COMPACT1_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, JRE_COMPACT1_MODULES_LIST) $(BASE_RELEASE_FILE)
$(ECHO) Creating jre compact1 jimage
$(RM) -r $(JRE_COMPACT1_IMAGE_DIR) $(JRE_COMPACT1_SORTED_MODULES)
$(JIMAGE_TOOL) \
--mods $(call SubstComma, java.compact1 $(COMPACT_EXTRA_MODULES)) \
--output $(JRE_COMPACT1_IMAGE_DIR) \
$(MODULES_XML) > $(JRE_COMPACT1_SORTED_MODULES)
$(RM) -r $(JRE_COMPACT1_IMAGE_DIR)
$(JLINK_TOOL) --addmods $(JRE_COMPACT1_MODULES_LIST) \
--output $(JRE_COMPACT1_IMAGE_DIR)
$(TOUCH) $@
$(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
$(call DependOnVariable, JRE_COMPACT2_MODULES_LIST)
$(JRE_COMPACT2_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, JRE_COMPACT2_MODULES_LIST) $(BASE_RELEASE_FILE)
$(ECHO) Creating jre compact2 jimage
$(RM) -r $(JRE_COMPACT2_IMAGE_DIR) $(JRE_COMPACT2_SORTED_MODULES)
$(JIMAGE_TOOL) \
--mods $(call SubstComma, java.compact2 $(COMPACT_EXTRA_MODULES)) \
--output $(JRE_COMPACT2_IMAGE_DIR) \
$(MODULES_XML) > $(JRE_COMPACT2_SORTED_MODULES)
$(RM) -r $(JRE_COMPACT2_IMAGE_DIR)
$(JLINK_TOOL) --addmods $(JRE_COMPACT2_MODULES_LIST) \
--output $(JRE_COMPACT2_IMAGE_DIR)
$(TOUCH) $@
$(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(DEPENDENCIES) \
$(call DependOnVariable, JRE_COMPACT3_MODULES_LIST)
$(JRE_COMPACT3_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, JRE_COMPACT3_MODULES_LIST) $(BASE_RELEASE_FILE)
$(ECHO) Creating jre compact3 jimage
$(RM) -r $(JRE_COMPACT3_IMAGE_DIR) $(JRE_COMPACT3_SORTED_MODULES)
$(JIMAGE_TOOL) \
--mods $(call SubstComma, $(JDK_COMPACT3_MODULES) $(COMPACT_EXTRA_MODULES)) \
--output $(JRE_COMPACT3_IMAGE_DIR) \
$(MODULES_XML) > $(JRE_COMPACT3_SORTED_MODULES)
$(RM) -r $(JRE_COMPACT3_IMAGE_DIR)
$(JLINK_TOOL) --addmods $(JRE_COMPACT3_MODULES_LIST) \
--output $(JRE_COMPACT3_IMAGE_DIR)
$(TOUCH) $@
TOOL_JRE_TARGETS := $(JRE_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
......@@ -345,79 +392,6 @@ $(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
JRE_TARGETS += $(JRE_DOC_TARGETS)
JDK_TARGETS += $(JDK_DOC_TARGETS)
################################################################################
# Release file
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
JRE_COMPACT1_INFO_FILE := $(JRE_COMPACT1_IMAGE_DIR)/release
JRE_COMPACT2_INFO_FILE := $(JRE_COMPACT2_IMAGE_DIR)/release
JRE_COMPACT3_INFO_FILE := $(JRE_COMPACT3_IMAGE_DIR)/release
# Common way to emit a line into the release or info file
define info-file-item # name value
$(PRINTF) '%s="%s"\n' $1 $2 >> $@
endef
# Param 1 - The file containing the MODULES list
define create-info-file
$(call info-file-item, "JAVA_VERSION", "$(VERSION_NUMBER)")
$(call info-file-item, "JAVA_FULL_VERSION", "$(VERSION_STRING)")
$(call info-file-item, "OS_NAME", "$(REQUIRED_OS_NAME)")
$(call info-file-item, "OS_VERSION", "$(REQUIRED_OS_VERSION)")
$(call info-file-item, "OS_ARCH", "$(OPENJDK_TARGET_CPU_LEGACY)")
$(if $(JDK_ARCH_ABI_PROP_NAME), \
$(call info-file-item, "SUN_ARCH_ABI", "$(JDK_ARCH_ABI_PROP_NAME)"))
$(call info-file-item, "SOURCE", "$(strip $(ALL_SOURCE_TIPS))")
$(call info-file-item, "MODULES", "`$(CAT) $1`")
endef
# Param 1 - The file containing the MODULES list
define prepare-info-file
$(call LogInfo, Generating $(patsubst $(OUTPUT_ROOT)/%,%,$@))
$(MKDIR) -p $(@D)
$(RM) $@
endef
define info-file
$(call prepare-info-file, $1)
$(call create-info-file, $1)
endef
# Create a variable dependency file common for all release info files. The
# sorted module list will only change if the image is regenerated, which will
# trigger a rebuild of these files anyway.
INFO_FILE_VARDEPS := $(call DependOnVariable, create-info-file)
ALL_SOURCE_TIPS = $(shell \
if [ -f $(SUPPORT_OUTPUTDIR)/source_tips ] ; then \
$(CAT) $(SUPPORT_OUTPUTDIR)/source_tips ; \
fi)
$(JRE_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(call info-file, $(JRE_SORTED_MODULES))
$(JDK_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(call info-file, $(JDK_SORTED_MODULES))
$(JRE_COMPACT1_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(call info-file, $(JRE_COMPACT1_SORTED_MODULES))
$(call info-file-item, "JAVA_PROFILE", "compact1")
$(JRE_COMPACT2_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(call info-file, $(JRE_COMPACT2_SORTED_MODULES))
$(call info-file-item, "JAVA_PROFILE", "compact2")
$(JRE_COMPACT3_INFO_FILE): $(INFO_FILE_VARDEPS) $(SUPPORT_OUTPUTDIR)/source_tips
$(call info-file, $(JRE_COMPACT3_SORTED_MODULES))
$(call info-file-item, "JAVA_PROFILE", "compact3")
JRE_TARGETS += $(JRE_INFO_FILE)
JDK_TARGETS += $(JDK_INFO_FILE)
JRE_COMPACT1_TARGETS += $(JRE_COMPACT1_INFO_FILE)
JRE_COMPACT2_TARGETS += $(JRE_COMPACT2_INFO_FILE)
JRE_COMPACT3_TARGETS += $(JRE_COMPACT3_INFO_FILE)
################################################################################
# src.zip
......@@ -435,7 +409,7 @@ ifneq ($(findstring images, $(MAKECMDGOALS)), )
DEST := $(JDK_IMAGE_DIR)/demo, \
FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \
$(call DoubleDollar, $(call DoubleDollar, \
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \
$(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \
-type f -a ! \( -name "_the*" -o -name "javac_state" \) )))), \
))
......@@ -445,7 +419,7 @@ endif
################################################################################
# /sample dir
$(eval $(call SetupCopyFiles, COPY_SAMPLES, \
$(eval $(call SetupCopyFiles,COPY_SAMPLES, \
SRC := $(SUPPORT_OUTPUTDIR)/sample/image, \
DEST := $(JDK_IMAGE_DIR)/sample, \
FILES := $(if $(wildcard $(SUPPORT_OUTPUTDIR)/sample/image), \
......
此差异已折叠。
......@@ -36,6 +36,10 @@ ifneq ($(CYGPATH), )
override JPRT_ARCHIVE_INSTALL_BUNDLE := \
$(shell $(CYGPATH) -u $(JPRT_ARCHIVE_INSTALL_BUNDLE))
endif
ifdef JPRT_ARCHIVE_MODULES_BUNDLE
override JPRT_ARCHIVE_MODULES_BUNDLE := \
$(shell $(CYGPATH) -u $(JPRT_ARCHIVE_MODULES_BUNDLE))
endif
ifdef JPRT_ARCHIVE_TEST_BUNDLE
override JPRT_ARCHIVE_TEST_BUNDLE := \
$(shell $(CYGPATH) -u $(JPRT_ARCHIVE_TEST_BUNDLE))
......@@ -54,6 +58,9 @@ endif
ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
endif
ifndef JPRT_ARCHIVE_MODULES_BUNDLE
JPRT_ARCHIVE_MODULES_BUNDLE=/tmp/jprt_bundles/modules.zip
endif
ifndef JPRT_ARCHIVE_TEST_BUNDLE
JPRT_ARCHIVE_TEST_BUNDLE=/tmp/jprt_bundles/test-image.zip
endif
......@@ -66,7 +73,8 @@ ifeq ($(SKIP_BOOT_CYCLE), false)
endif
# This target must be called in the context of a SPEC file
jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_TEST_BUNDLE)
jprt_bundle: $(JPRT_ARCHIVE_BUNDLE) $(JPRT_ARCHIVE_TEST_BUNDLE) \
$(JPRT_ARCHIVE_MODULES_BUNDLE)
ifeq ($(GCOV_ENABLED), true)
jprt_bundle: $(JPRT_ARCHIVE_SYMBOLS_BUNDLE)
......@@ -78,6 +86,11 @@ $(JPRT_ARCHIVE_BUNDLE): bundles
$(RM) $@
$(CP) $(BUILD_OUTPUT)/bundles/$(JDK_IMAGE_SUBDIR).zip $@
$(JPRT_ARCHIVE_MODULES_BUNDLE): bundles
$(MKDIR) -p $(@D)
$(RM) $@
$(CP) $(BUILD_OUTPUT)/bundles/modules.zip $@
$(JPRT_ARCHIVE_TEST_BUNDLE): bundles
$(MKDIR) -p $(@D)
$(RM) $@
......@@ -104,6 +117,8 @@ bundles: all
$(BUILD_OUTPUT)/bundles/$(JRE_IMAGE_SUBDIR).zip .
$(CD) $(SRC_TEST_IMAGE_DIR) && $(ZIP) -y -q -r \
$(BUILD_OUTPUT)/bundles/$(TEST_IMAGE_SUBDIR).zip .
$(CD) $(IMAGES_OUTPUTDIR)/jmods && $(ZIP) -y -q -r \
$(BUILD_OUTPUT)/bundles/modules.zip .
if [ -d $(BUILD_OUTPUT)/install/bundles ] ; then \
$(CD) $(BUILD_OUTPUT)/install/bundles && $(ZIP) -y -q -r \
$(JPRT_ARCHIVE_INSTALL_BUNDLE) . ; \
......
......@@ -28,6 +28,7 @@ default: all
include $(SPEC)
include MakeBase.gmk
include JarArchive.gmk
include SetupJavaCompilers.gmk
include TextFileProcessing.gmk
# This rule will be depended on due to the MANIFEST line
......@@ -40,10 +41,32 @@ $(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
@@COMPANY_NAME@@ => $(COMPANY_NAME) , \
))
$(eval $(call SetupJarArchive, JRTFS_JAR, \
SRCS := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
JIMAGE_PKGS := \
jdk/internal/jimage \
jdk/internal/jrtfs \
#
$(eval $(call SetupJavaCompilation,BUILD_JRTFS, \
SETUP := GENERATE_OLDBYTECODE, \
SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
EXCLUDE_FILES := module-info.java, \
INCLUDES := $(JIMAGE_PKGS), \
BIN := $(SUPPORT_OUTPUTDIR)/jrtfs_classes))
# Because of the explicit INCLUDES in the compilation setup above, the service provider
# file will not be copied unless META-INF/services would also be added to the INCLUDES.
# Adding META-INF/services would include all files in that directory when only the one
# is needed, which is why this explicit copy is defined instead.
$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
$(eval $(call SetupJarArchive,BUILD_JRTFS_JAR, \
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \
SRCS := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
JAR := $(SUPPORT_OUTPUTDIR)/jrt-fs.jar, \
MANIFEST := $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf, \
))
all: $(JRTFS_JAR)
all: $(BUILD_JRTFS_JAR)
......@@ -42,8 +42,6 @@ include $(SRC_ROOT)/make/MainSupport.gmk
# Load the vital tools for all the makefiles.
include $(SRC_ROOT)/make/common/MakeBase.gmk
# Explicitly generate module deps makefile data
include $(SRC_ROOT)/make/GenerateModuleDeps.gmk
include $(SRC_ROOT)/make/common/Modules.gmk
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
......@@ -113,6 +111,24 @@ LANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
CORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
HOTSPOT_GENSRC_TARGETS := $(filter %-gensrc-hotspot, $(GENSRC_TARGETS))
GENSRC_MODULEINFO_MODULES := $(ALL_MODULES)
GENSRC_MODULEINFO_TARGETS := $(addsuffix -gensrc-moduleinfo, \
$(GENSRC_MODULEINFO_MODULES))
GENSRC_MODULES := $(GENSRC_MODULEINFO_MODULES)
GENSRC_TARGETS += $(sort $(GENSRC_MODULEINFO_TARGETS) \
$(addsuffix -gensrc, $(GENSRC_MODULES)))
define DeclareModuleInfoRecipe
$1-gensrc-moduleinfo:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
-f GensrcModuleInfo.gmk MODULE=$1)
$1-gensrc: $1-gensrc-moduleinfo
endef
$(foreach m, $(GENSRC_MODULEINFO_MODULES), $(eval $(call DeclareModuleInfoRecipe,$m)))
ALL_TARGETS += $(GENSRC_TARGETS)
################################################################################
......@@ -136,11 +152,27 @@ $(eval $(call DeclareRecipesForPhase, COPY, \
USE_WRAPPER := true, \
MULTIPLE_MAKEFILES := true))
ALL_TARGETS += $(COPY_TARGETS)
ALL_COPY_MODULES += $(COPY_MODULES)
ALL_COPY_TARGETS += $(COPY_TARGETS)
IMPORT_COPY_MODULES := $(call FindImportedModules)
IMPORT_COPY_TARGETS := $(addsuffix -copy, $(IMPORT_COPY_MODULES))
ALL_COPY_MODULES += $(IMPORT_COPY_MODULES)
ALL_COPY_TARGETS += $(IMPORT_COPY_TARGETS)
define DeclareImportCopyRecipe
$1-copy:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) \
-f CopyImportModules.gmk MODULE=$1)
endef
$(foreach m, $(IMPORT_COPY_MODULES), $(eval $(call DeclareImportCopyRecipe,$m)))
ALL_TARGETS += $(ALL_COPY_TARGETS)
################################################################################
# Targets for compiling all java modules. Nashorn is treated separately.
JAVA_MODULES := $(call FindJavaModules)
JAVA_MODULES := $(ALL_MODULES)
JAVA_TARGETS := $(addsuffix -java, $(JAVA_MODULES))
define DeclareCompileJavaRecipe
......@@ -214,7 +246,48 @@ samples-jdk:
ALL_TARGETS += demos-jdk samples-jdk
################################################################################
# Image targets
# Jigsaw specific data and analysis targets.
generate-summary:
+($(CD) $(JDK_TOPDIR)/make && $(MAKE) -f GenerateModuleSummary.gmk)
ALL_TARGETS += generate-summary
################################################################################
# Strip binaries targets
STRIP_MODULES := $(sort $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES) \
$(GENDATA_MODULES))
STRIP_TARGETS := $(addsuffix -strip, $(STRIP_MODULES))
define DeclareStripRecipe
$1-strip:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk \
MODULE=$1)
endef
$(foreach m, $(STRIP_MODULES), $(eval $(call DeclareStripRecipe,$m)))
ALL_TARGETS += $(STRIP_TARGETS)
################################################################################
# Jmod targets
JMOD_MODULES := $(ALL_MODULES)
JMOD_TARGETS := $(addsuffix -jmod, $(JMOD_MODULES))
define DeclareJmodRecipe
$1-jmod:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateJmods.gmk \
MODULE=$1)
endef
$(foreach m, $(JMOD_MODULES), $(eval $(call DeclareJmodRecipe,$m)))
ALL_TARGETS += $(JMOD_TARGETS)
################################################################################
# Images targets
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
# used to track the exact sources used to build that image.
......@@ -236,9 +309,6 @@ zip-security:
zip-source:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
strip-binaries:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
jrtfs-jar:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
......@@ -251,7 +321,7 @@ profiles:
mac-bundles-jdk:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
ALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
ALL_TARGETS += source-tips bootcycle-images zip-security zip-source \
jrtfs-jar jimages profiles mac-bundles-jdk
################################################################################
......@@ -265,6 +335,28 @@ docs-jvmtidoc:
ALL_TARGETS += docs-javadoc docs-jvmtidoc
################################################################################
# Cross compilation support
ifeq ($(CREATE_BUILDJDK), true)
# This target is only called by the recursive call below.
create-buildjdk-compile-hotspot-helper: hotspot
create-buildjdk-compile-modules-helper: jdk.jlink-launchers java.base-copy
endif
create-buildjdk-copy:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CreateBuildJdkCopy.gmk)
create-buildjdk-compile-hotspot create-buildjdk-compile-modules:
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Main.gmk \
$@-helper \
SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
HOTSPOT_SPEC=$(dir $(SPEC))buildjdk-spec.gmk \
CREATING_BUILDJDK=true)
ALL_TARGETS += create-buildjdk-copy create-buildjdk-compile-hotspot \
create-buildjdk-compile-modules
################################################################################
# Build tests
#
......@@ -321,16 +413,6 @@ test-make:
ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \
test-hotspot-internal test-jdk-jtreg-native test-make
################################################################################
# Verification targets
verify-modules:
@$(call TargetEnter)
+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
@$(call TargetExit)
ALL_TARGETS += verify-modules
################################################################################
# Install targets
......@@ -370,6 +452,8 @@ else
$(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
$(GENSRC_MODULEINFO_TARGETS): buildtools-jdk
$(GENDATA_TARGETS): interim-langtools buildtools-jdk
interim-rmic: interim-langtools
......@@ -407,8 +491,11 @@ else
$(foreach m, $(RMIC_MODULES), $(eval $m-rmic: $m-java))
# Declare dependencies from <module>-lib to <module>-java
# Skip modules that do not have java source.
# Skip modules that do not have java source. When creating a BUILD_JDK, the
# java compilation has already been done by the normal build and copied in.
ifneq ($(CREATING_BUILDJDK), true)
$(foreach m, $(filter $(JAVA_MODULES), $(LIBS_MODULES)), $(eval $m-libs: $m-java))
endif
# Declare dependencies from all other <module>-lib to java.base-lib
$(foreach t, $(filter-out java.base-libs, $(LIBS_TARGETS)), \
......@@ -438,31 +525,57 @@ else
jdk.jdeps-gendata: java rmic
# Declare dependencies from <module>-strip to libs, launchers, gendata and copy
$(foreach m, $(LIBS_MODULES), $(eval $m-strip: $m-libs))
$(foreach m, $(LAUNCHER_MODULES), $(eval $m-strip: $m-launchers))
$(foreach m, $(GENDATA_MODULES), $(eval $m-strip: $m-gendata))
$(foreach m, $(COPY_MODULES), $(eval $m-strip: $m-copy))
# Declare dependencies between jmod targets
$(foreach m, $(JMOD_MODULES), \
$(eval $m-jmod: $(addsuffix -jmod, $(call FindDepsForModule,$m))))
# Declare dependencies from <module>-jmod to all other module targets
$(foreach m, $(STRIP_MODULES), $(eval $m-jmod: $m-strip))
$(foreach m, $(JAVA_MODULES), $(eval $m-jmod: $m-java))
$(foreach m, $(GENDATA_MODULES), $(eval $m-jmod: $m-gendata))
$(foreach m, $(RMIC_MODULES), $(eval $m-jmod: $m-rmic))
$(foreach m, $(LIBS_MODULES), $(eval $m-jmod: $m-libs))
$(foreach m, $(LAUNCHER_MODULES), $(eval $m-jmod: $m-launchers))
$(foreach m, $(COPY_MODULES), $(eval $m-jmod: $m-copy))
# Jmods cannot be created until we have the jlink tool ready to run, which requires
# all java modules to be compiled and jdk.jlink-launchers.
$(JMOD_TARGETS): java java.base-libs jdk.jlink-launchers
ifeq ($(CREATE_BUILDJDK), true)
$(JMOD_TARGETS): create-buildjdk
endif
zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
$(filter jdk.crypto%, $(JAVA_TARGETS))
zip-source: gensrc rmic
strip-binaries: libs launchers gendata copy
jrtfs-jar: buildtools-jdk
jrtfs-jar: interim-langtools
jimages: exploded-image zip-source strip-binaries source-tips demos samples \
jrtfs-jar
jimages: jmods zip-source source-tips demos samples jrtfs-jar
profiles: exploded-image strip-binaries source-tips
profiles: jmods zip-source source-tips jrtfs-jar
mac-bundles-jdk: jimages
bootcycle-images: jimages
docs-javadoc: gensrc rmic
docs-javadoc: $(GENSRC_TARGETS) rmic
docs-jvmtidoc: hotspot
test: jimages test-image
verify-modules: exploded-image
create-buildjdk-copy: jdk.jlink-java java.base-gendata
create-buildjdk-compile-modules: create-buildjdk-copy create-buildjdk-compile-hotspot
test-make: clean-test-make
......@@ -482,6 +595,8 @@ else
install: product-images
generate-summary: jmods
endif
################################################################################
......@@ -494,7 +609,7 @@ gensrc: $(GENSRC_TARGETS)
gendata: $(GENDATA_TARGETS)
copy: $(COPY_TARGETS)
copy: $(ALL_COPY_TARGETS)
java: $(JAVA_TARGETS)
......@@ -504,6 +619,10 @@ libs: $(LIBS_TARGETS)
launchers: $(LAUNCHER_TARGETS)
jmods: $(JMOD_TARGETS)
strip-binaries: $(STRIP_TARGETS)
# Explicitly declare dependency for virtual target jdk.jdwp.agent-gensrc which
# is actually handled by jdk.jdi-gensrc
jdk.jdwp.agent-gensrc: jdk.jdi-gensrc
......@@ -516,8 +635,7 @@ $(foreach m, $(GENDATA_MODULES), $(eval $m: $m-gendata))
$(foreach m, $(RMIC_MODULES), $(eval $m: $m-rmic))
$(foreach m, $(LIBS_MODULES), $(eval $m: $m-libs))
$(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
$(foreach m, $(COPY_MODULES), $(eval $m: $m-copy))
$(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy))
demos: demos-jdk
samples: samples-jdk
......@@ -525,6 +643,9 @@ samples: samples-jdk
# The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
exploded-image: $(ALL_MODULES)
create-buildjdk: create-buildjdk-compile-modules create-buildjdk-copy \
create-buildjdk-compile-hotspot
mac-bundles: mac-bundles-jdk
# The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
......@@ -532,7 +653,13 @@ mac-bundles: mac-bundles-jdk
# This target builds the product images, e.g. the JRE and JDK image
# (and possibly other, more specific versions)
product-images: jimages demos samples zip-security verify-modules
product-images: jimages demos samples zip-security exploded-image
# When cross compiling and building a partial BUILDJDK for the build host,
# the summary generation cannot be run.
ifneq ($(CREATE_BUILDJDK), true)
product-images: generate-summary
endif
ifeq ($(OPENJDK_TARGET_OS), macosx)
product-images: mac-bundles
......@@ -548,9 +675,9 @@ test-image: prepare-test-image test-image-hotspot-jtreg-native \
# all-images is the top-most target, it builds all our deliverables ("images").
all-images: product-images test-image docs-image
ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers jmods \
jdk.jdwp.agent-gensrc $(ALL_MODULES) demos samples exploded-image \
mac-bundles product-images docs-image test-image all-images
create-buildjdk mac-bundles product-images docs-image test-image all-images
################################################################################
......@@ -575,7 +702,7 @@ ALL_TARGETS += default jdk images docs all
# file.
CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
images make-support test-make bundles
images make-support test-make bundles buildjdk
CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
CLEAN_SUPPORT_DIRS += demos
CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS))
......
......@@ -67,7 +67,6 @@ define Clean-gensrc
@$(PRINTF) "Cleaning gensrc $(if $1,for $(strip $1) )..."
@$(PRINTF) "\n" $(LOG_DEBUG)
$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc/$(strip $1)
$(RM) -r $(SUPPORT_OUTPUTDIR)/gensrc_no_docs/$(strip $1)
@$(PRINTF) " done\n"
endef
......
此差异已折叠。
#
# Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2001, 2015, Oracle and/or its affiliates. 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
......@@ -99,6 +99,7 @@ CORE_PKGS = \
java.lang.instrument \
java.lang.invoke \
java.lang.management \
java.lang.module \
java.lang.ref \
java.lang.reflect \
java.math \
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册