diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index d748c4f89a1..753d170beb2 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -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. diff --git a/common/autoconf/boot-jdk.m4 b/common/autoconf/boot-jdk.m4 index 7864ea956d4..91bf548fbf8 100644 --- a/common/autoconf/boot-jdk.m4 +++ b/common/autoconf/boot-jdk.m4 @@ -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) +]) diff --git a/common/autoconf/bootcycle-spec.gmk.in b/common/autoconf/bootcycle-spec.gmk.in index 0335615795f..c37097d1b1d 100644 --- a/common/autoconf/bootcycle-spec.gmk.in +++ b/common/autoconf/bootcycle-spec.gmk.in @@ -25,6 +25,8 @@ # Support for building boot cycle builds +BOOT_JDK_MODULAR := true + # First include the real base spec.gmk file include @SPEC@ diff --git a/common/autoconf/buildjdk-spec.gmk.in b/common/autoconf/buildjdk-spec.gmk.in new file mode 100644 index 00000000000..f92602edc34 --- /dev/null +++ b/common/autoconf/buildjdk-spec.gmk.in @@ -0,0 +1,148 @@ +# +# 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 diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac index 127d9088555..c7bab7c53a8 100644 --- a/common/autoconf/configure.ac +++ b/common/autoconf/configure.ac @@ -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 diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index 6b08cbb0a4f..9ea5eaa2a9f 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -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) ]) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 58beee04e52..e4ea273f57f 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -694,6 +694,7 @@ ZIP_EXTERNAL_DEBUG_SYMBOLS COPY_DEBUG_SYMBOLS COMPILE_WITH_DEBUG_SYMBOLS CFLAGS_WARNINGS_ARE_ERRORS +BUILD_CC_DISABLE_WARNING_PREFIX DISABLE_WARNING_PREFIX HOTSPOT_SET_WARNINGS_AS_ERRORS WARNINGS_AS_ERRORS @@ -705,12 +706,18 @@ LDFLAGS_HASH_STYLE LDFLAGS_CXX_JDK JDKEXE_LIBS JDKLIB_LIBS +OPENJDK_BUILD_LDFLAGS_JDKEXE +OPENJDK_BUILD_LDFLAGS_JDKLIB LDFLAGS_JDKEXE LDFLAGS_JDKLIB CXXFLAGS_TESTEXE CXXFLAGS_TESTLIB CFLAGS_TESTEXE CFLAGS_TESTLIB +OPENJDK_BUILD_CXXFLAGS_JDKEXE +OPENJDK_BUILD_CXXFLAGS_JDKLIB +OPENJDK_BUILD_CFLAGS_JDKEXE +OPENJDK_BUILD_CFLAGS_JDKLIB CXXFLAGS_JDKEXE CXXFLAGS_JDKLIB CFLAGS_JDKEXE @@ -759,6 +766,8 @@ HOTSPOT_MT BUILD_AS BUILD_LDCXX BUILD_LD +BUILD_STRIP +BUILD_OBJCOPY BUILD_AR BUILD_NM BUILD_CXX @@ -821,6 +830,12 @@ SHARED_LIBRARY_SUFFIX LIBRARY_PREFIX TOOLCHAIN_TYPE STATIC_BUILD +IMPORT_MODULES_MAKE +IMPORT_MODULES_SRC +IMPORT_MODULES_CONF +IMPORT_MODULES_LIBS +IMPORT_MODULES_CMDS +IMPORT_MODULES_CLASSES BUILD_HOTSPOT HOTSPOT_DIST BUILD_OUTPUT @@ -831,8 +846,11 @@ JAXWS_TOPDIR JAXP_TOPDIR CORBA_TOPDIR LANGTOOLS_TOPDIR +BUILD_JDK +CREATE_BUILDJDK BOOT_JDK_BITS JAVAC_FLAGS +BOOT_JDK_MODULAR BOOT_JDK_SOURCETARGET JARSIGNER JAR @@ -862,6 +880,7 @@ PRODUCT_SUFFIX PRODUCT_NAME LAUNCHER_NAME TEST_IN_BUILD +JLINK_KEEP_PACKAGED_MODULES COPYRIGHT_YEAR COMPRESS_JARS INCLUDE_SA @@ -930,9 +949,13 @@ ZERO_ARCHDEF DEFINE_CROSS_COMPILE_ARCH LP64 OPENJDK_TARGET_OS_EXPORT_DIR +OPENJDK_BUILD_CPU_JLI_CFLAGS OPENJDK_TARGET_CPU_JLI_CFLAGS OPENJDK_TARGET_CPU_OSARCH OPENJDK_TARGET_CPU_ISADIR +OPENJDK_BUILD_CPU_LIBDIR +OPENJDK_BUILD_CPU_LEGACY_LIB +OPENJDK_BUILD_CPU_LEGACY OPENJDK_TARGET_CPU_LIBDIR OPENJDK_TARGET_CPU_LEGACY_LIB OPENJDK_TARGET_CPU_LEGACY @@ -1080,6 +1103,7 @@ enable_headful with_cacerts_file enable_unlimited_crypto with_copyright_year +enable_keep_packaged_modules enable_hotspot_test_in_build with_milestone with_update_version @@ -1094,6 +1118,7 @@ with_version_minor with_version_security with_version_patch with_boot_jdk +with_build_jdk with_add_source_root with_override_source_root with_adds_and_overrides @@ -1105,6 +1130,7 @@ with_override_hotspot with_override_nashorn with_override_jdk with_import_hotspot +with_import_modules enable_static_build with_toolchain_type with_extra_cflags @@ -1248,6 +1274,8 @@ BUILD_CC BUILD_CXX BUILD_NM BUILD_AR +BUILD_OBJCOPY +BUILD_STRIP JTREGEXE XMKMF FREETYPE_CFLAGS @@ -1890,6 +1918,8 @@ Optional Features: support) [enabled] --enable-unlimited-crypto Enable unlimited crypto policy [disabled] + --disable-keep-packaged-modules + Do not keep packaged modules in jdk image [enable] --enable-hotspot-test-in-build run the Queens test after Hotspot build [disabled] --enable-static-build enable static library build [disabled] @@ -1973,6 +2003,8 @@ Optional Packages: --with-version-patch Set version 'PATCH' field (fourth number) [not specified] --with-boot-jdk path to Boot JDK (used to bootstrap build) [probed] + --with-build-jdk path to JDK of same version as is being built[the + newly built JDK] --with-add-source-root Deprecated. Option is kept for backwards compatibility and is ignored --with-override-source-root @@ -1999,6 +2031,8 @@ Optional Packages: --with-import-hotspot import hotspot binaries from this jdk image or hotspot build dist dir instead of building from source + --with-import-modules import a set of prebuilt modules either as a zip + file or an exploded directory --with-toolchain-type the toolchain type (or family) to use, use '--help' to show possible values [platform dependent] --with-extra-cflags extra flags to be used when compiling jdk c-files @@ -2167,6 +2201,9 @@ Some influential environment variables: BUILD_CXX Override default value for BUILD_CXX BUILD_NM Override default value for BUILD_NM BUILD_AR Override default value for BUILD_AR + BUILD_OBJCOPY + Override default value for BUILD_OBJCOPY + BUILD_STRIP Override default value for BUILD_STRIP JTREGEXE Override default value for JTREGEXE XMKMF Path to xmkmf, Makefile generator for X Window System FREETYPE_CFLAGS @@ -3777,6 +3814,23 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +# 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 + + +# 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. + + # # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4192,6 +4246,13 @@ pkgadd_help() { # +################################################################################ +# +# jlink options. +# We always keep packaged modules in JDK image. +# + + # # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4628,6 +4689,12 @@ pkgadd_help() { +################################################################################ +# Define a mechanism for importing extra prebuilt modules +# + + + # # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -4862,7 +4929,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1457684806 +DATE_WHEN_GENERATED=1458008154 ############################################################################### # @@ -15157,6 +15224,37 @@ $as_echo "$COMPILE_TYPE" >&6; } fi + # 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 + + + # 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 + + + # 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 + + # 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 @@ -15199,6 +15297,24 @@ $as_echo "$COMPILE_TYPE" >&6; } fi + 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 + + if test "x$OPENJDK_TARGET_OS" = xmacosx; then OPENJDK_TARGET_OS_EXPORT_DIR=macosx else @@ -15216,6 +15332,11 @@ $as_echo "$COMPILE_TYPE" >&6; } fi 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..? @@ -16701,6 +16822,9 @@ $as_echo "$as_me: The path of OUTPUT_ROOT, which resolves as \"$path\", is inval # The bootcycle-spec.gmk file contains support for boot cycle builds. ac_config_files="$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="$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="$ac_config_files $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" @@ -23299,6 +23423,35 @@ fi + # Check whether --enable-keep-packaged-modules was given. +if test "${enable_keep_packaged_modules+set}" = set; then : + enableval=$enable_keep_packaged_modules; +fi + + + if test "x$enable_keep_packaged_modules" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if packaged modules are kept" >&5 +$as_echo_n "checking if packaged modules are kept... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + JLINK_KEEP_PACKAGED_MODULES=true + elif test "x$enable_keep_packaged_modules" = "xno"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if packaged modules are kept" >&5 +$as_echo_n "checking if packaged modules are kept... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + JLINK_KEEP_PACKAGED_MODULES=false + elif test "x$enable_keep_packaged_modules" = "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (default)" >&5 +$as_echo "yes (default)" >&6; } + JLINK_KEEP_PACKAGED_MODULES=true + else + as_fn_error $? "--enable-keep-packaged-modules accepts no argument" "$LINENO" 5 + fi + + + + # Control wether Hotspot runs Queens test after build. # Check whether --enable-hotspot-test-in-build was given. if test "${enable_hotspot_test_in_build+set}" = set; then : @@ -29596,6 +29749,35 @@ $as_echo "$tool_specified" >&6; } + $ECHO "Check if jvm arg is ok: -Xpatch:" >&5 + $ECHO "Command: $JAVA -Xpatch: -version" >&5 + OUTPUT=`$JAVA -Xpatch: -version 2>&1` + FOUND_WARN=`$ECHO "$OUTPUT" | grep -i warn` + FOUND_VERSION=`$ECHO $OUTPUT | grep " version \""` + if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then + dummy="$dummy -Xpatch:" + JVM_ARG_OK=true + else + $ECHO "Arg failed:" >&5 + $ECHO "$OUTPUT" >&5 + JVM_ARG_OK=false + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Boot JDK supports modules" >&5 +$as_echo_n "checking if Boot JDK supports modules... " >&6; } + if test "x$JVM_ARG_OK" = "xtrue"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + BOOT_JDK_MODULAR="true" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + BOOT_JDK_MODULAR="false" + fi + + + + # Check if the boot jdk is 32 or 64 bit if "$JAVA" -d64 -version > /dev/null 2>&1; then BOOT_JDK_BITS="64" @@ -29609,6 +29791,237 @@ $as_echo "$BOOT_JDK_BITS" >&6; } + +# Check whether --with-build-jdk was given. +if test "${with_build_jdk+set}" = set; then : + withval=$with_build_jdk; +fi + + + CREATE_BUILDJDK_FOR_HOST=false + BUILD_JDK_FOUND="no" + if test "x$with_build_jdk" != "x"; then + + if test "x$BUILD_JDK_FOUND" = xno; then + # Execute the test + + if test "x$with_build_jdk" != x; then + BUILD_JDK=$with_build_jdk + BUILD_JDK_FOUND=maybe + { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential Build JDK using configure arguments" >&5 +$as_echo "$as_me: Found potential Build JDK using configure arguments" >&6;} + fi + + # 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring" >&5 +$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/java; ignoring" >&6;} + BUILD_JDK_FOUND=no + elif test ! -x "$BUILD_JDK/bin/jlink"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&5 +$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/jlink; ignoring" >&6;} + BUILD_JDK_FOUND=no + elif test ! -x "$BUILD_JDK/bin/javac"; then + # Do we have a bin/javac? + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring" >&5 +$as_echo "$as_me: Potential Build JDK found at $BUILD_JDK did not contain bin/javac; ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (This might be a JRE instead of an JDK)" >&5 +$as_echo "$as_me: (This might be a JRE instead of an JDK)" >&6;} + 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 + { $as_echo "$as_me:${as_lineno-$LINENO}: Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&5 +$as_echo "$as_me: Potential Boot JDK found at $BUILD_JDK is incorrect JDK version ($BUILD_JDK_VERSION); ignoring" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: (Your Build JDK must be version 9)" >&5 +$as_echo "$as_me: (Your Build JDK must be version 9)" >&6;} + BUILD_JDK_FOUND=no + else + # We're done! + BUILD_JDK_FOUND=yes + + # Only process if variable expands to non-empty + + if test "x$BUILD_JDK" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$BUILD_JDK" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of BUILD_JDK" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + BUILD_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BUILD_JDK to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$BUILD_JDK" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + BUILD_JDK="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_JDK to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting BUILD_JDK to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a unix platform. Hooray! :) + path="$BUILD_JDK" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_JDK, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of BUILD_JDK, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + if test -d "$path"; then + BUILD_JDK="`cd "$path"; $THEPWDCMD -L`" + else + dir="`$DIRNAME "$path"`" + base="`$BASENAME "$path"`" + BUILD_JDK="`cd "$dir"; $THEPWDCMD -L`/$base" + fi + fi + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 +$as_echo_n "checking for Build JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_JDK" >&5 +$as_echo "$BUILD_JDK" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Build JDK version" >&5 +$as_echo_n "checking Build JDK version... " >&6; } + BUILD_JDK_VERSION=`"$BUILD_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_JDK_VERSION" >&5 +$as_echo "$BUILD_JDK_VERSION" >&6; } + fi # end check jdk version + fi # end check java + fi # end check build jdk found + fi + + else + if test "x$COMPILE_TYPE" = "xcross"; then + BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk" + BUILD_JDK_FOUND=yes + CREATE_BUILDJDK=true + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 +$as_echo_n "checking for Build JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, will build it for the host platform" >&5 +$as_echo "yes, will build it for the host platform" >&6; } + else + BUILD_JDK="\$(JDK_OUTPUTDIR)" + BUILD_JDK_FOUND=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 +$as_echo_n "checking for Build JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, will use output dir" >&5 +$as_echo "yes, will use output dir" >&6; } + fi + fi + + if test "x$BUILD_JDK_FOUND" != "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Build JDK" >&5 +$as_echo_n "checking for Build JDK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Could not find a suitable Build JDK" "$LINENO" 5 + fi + + + + + ############################################################################### # # Configure the sources to use. We can add or override individual directories. @@ -29758,6 +30171,189 @@ $as_echo "yes from $HOTSPOT_DIST" >&6; } JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk" + + +# Check whether --with-import-modules was given. +if test "${with_import_modules+set}" = set; then : + withval=$with_import_modules; +fi + + + 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" + + # Only process if variable expands to non-empty + + if test "x$IMPORT_MODULES_TOPDIR" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$IMPORT_MODULES_TOPDIR" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of IMPORT_MODULES_TOPDIR" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + IMPORT_MODULES_TOPDIR="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$IMPORT_MODULES_TOPDIR" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + IMPORT_MODULES_TOPDIR="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting IMPORT_MODULES_TOPDIR to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a unix platform. Hooray! :) + path="$IMPORT_MODULES_TOPDIR" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + if test -d "$path"; then + IMPORT_MODULES_TOPDIR="`cd "$path"; $THEPWDCMD -L`" + else + dir="`$DIRNAME "$path"`" + base="`$BASENAME "$path"`" + IMPORT_MODULES_TOPDIR="`cd "$dir"; $THEPWDCMD -L`/$base" + fi + fi + fi + + 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 + as_fn_error $? "--with-import-modules=\"$with_import_modules\" must point to a dir or a zip file" "$LINENO" 5 + fi + else + as_fn_error $? "--with-import-modules=\"$with_import_modules\" must point to a dir or a zip file" "$LINENO" 5 + 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 + + + + + + + + + ############################################################################### # # Setup the toolchain (compilers etc), i.e. tools used to compile and process @@ -44514,6 +45110,972 @@ $as_echo "$as_me: Rewriting BUILD_AR to \"$new_complete\"" >&6;} fi fi + + + # Publish this variable in the help. + + + if [ -z "${BUILD_OBJCOPY+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in objcopy +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_BUILD_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $BUILD_OBJCOPY in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_OBJCOPY="$BUILD_OBJCOPY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BUILD_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BUILD_OBJCOPY=$ac_cv_path_BUILD_OBJCOPY +if test -n "$BUILD_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_OBJCOPY" >&5 +$as_echo "$BUILD_OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BUILD_OBJCOPY" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !BUILD_OBJCOPY! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_OBJCOPY!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xBUILD_OBJCOPY" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_OBJCOPY from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of BUILD_OBJCOPY from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in objcopy +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_BUILD_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $BUILD_OBJCOPY in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_OBJCOPY="$BUILD_OBJCOPY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BUILD_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BUILD_OBJCOPY=$ac_cv_path_BUILD_OBJCOPY +if test -n "$BUILD_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_OBJCOPY" >&5 +$as_echo "$BUILD_OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BUILD_OBJCOPY" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$BUILD_OBJCOPY" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_OBJCOPY= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool BUILD_OBJCOPY= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_OBJCOPY" >&5 +$as_echo_n "checking for BUILD_OBJCOPY... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$BUILD_OBJCOPY" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_OBJCOPY=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool BUILD_OBJCOPY=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_BUILD_OBJCOPY+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $BUILD_OBJCOPY in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_OBJCOPY="$BUILD_OBJCOPY" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BUILD_OBJCOPY="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BUILD_OBJCOPY=$ac_cv_path_BUILD_OBJCOPY +if test -n "$BUILD_OBJCOPY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_OBJCOPY" >&5 +$as_echo "$BUILD_OBJCOPY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$BUILD_OBJCOPY" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_OBJCOPY=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool BUILD_OBJCOPY=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_OBJCOPY" >&5 +$as_echo_n "checking for BUILD_OBJCOPY... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool BUILD_OBJCOPY=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + + + # Only process if variable expands to non-empty + + if test "x$BUILD_OBJCOPY" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file presence. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in MSYS causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + fi + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_OBJCOPY" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Cannot rely on the command "which" here since it doesn't always work. + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test -z "$is_absolute_path"; then + # Path to executable is not absolute. Find it. + IFS_save="$IFS" + IFS=: + for p in $PATH; do + if test -f "$p/$path" && test -x "$p/$path"; then + new_path="$p/$path" + break + fi + done + IFS="$IFS_save" + else + # This is an absolute path, we can use it without further modifications. + new_path="$path" + fi + + if test "x$new_path" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_OBJCOPY, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_OBJCOPY" "$LINENO" 5 + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + BUILD_OBJCOPY="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_OBJCOPY to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_OBJCOPY to \"$new_complete\"" >&6;} + fi + fi + + + + # Publish this variable in the help. + + + if [ -z "${BUILD_STRIP+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_BUILD_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $BUILD_STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_STRIP="$BUILD_STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BUILD_STRIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BUILD_STRIP=$ac_cv_path_BUILD_STRIP +if test -n "$BUILD_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_STRIP" >&5 +$as_echo "$BUILD_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BUILD_STRIP" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !BUILD_STRIP! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!BUILD_STRIP!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xBUILD_STRIP" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of BUILD_STRIP from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of BUILD_STRIP from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in strip +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_BUILD_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $BUILD_STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_STRIP="$BUILD_STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BUILD_STRIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BUILD_STRIP=$ac_cv_path_BUILD_STRIP +if test -n "$BUILD_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_STRIP" >&5 +$as_echo "$BUILD_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$BUILD_STRIP" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$BUILD_STRIP" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool BUILD_STRIP= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool BUILD_STRIP= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_STRIP" >&5 +$as_echo_n "checking for BUILD_STRIP... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$BUILD_STRIP" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool BUILD_STRIP=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool BUILD_STRIP=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_BUILD_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $BUILD_STRIP in + [\\/]* | ?:[\\/]*) + ac_cv_path_BUILD_STRIP="$BUILD_STRIP" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_BUILD_STRIP="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +BUILD_STRIP=$ac_cv_path_BUILD_STRIP +if test -n "$BUILD_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILD_STRIP" >&5 +$as_echo "$BUILD_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$BUILD_STRIP" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool BUILD_STRIP=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool BUILD_STRIP=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BUILD_STRIP" >&5 +$as_echo_n "checking for BUILD_STRIP... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool BUILD_STRIP=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + + + # Only process if variable expands to non-empty + + if test "x$BUILD_STRIP" != x; then + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path=`$CYGPATH -u "$path"` + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path=`$CYGPATH -u "$path"` + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in cygwin causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path=`$CYGPATH -u "$path"` + fi + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 + fi + fi + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file presence. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + # Short path failed, file does not exist as specified. + # Try adding .exe or .cmd + if test -f "${new_path}.exe"; then + input_to_shortpath="${new_path}.exe" + elif test -f "${new_path}.cmd"; then + input_to_shortpath="${new_path}.cmd" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$new_path\", is invalid." >&5 +$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$new_path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&5 +$as_echo "$as_me: Neither \"$new_path\" nor \"$new_path.exe/cmd\" can be found" >&6;} + as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 + fi + else + input_to_shortpath="$new_path" + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + new_path="$input_to_shortpath" + + input_path="$input_to_shortpath" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-style (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $input_to_shortpath | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Input might be given as Windows format, start by converting to + # unix format. + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + # Now try to locate executable using which + new_path=`$WHICH "$new_path" 2> /dev/null` + + if test "x$new_path" = x; then + # Oops. Which didn't find the executable. + # The splitting of arguments from the executable at a space might have been incorrect, + # since paths with space are more likely in Windows. Give it another try with the whole + # argument. + path="$complete" + arguments="EOL" + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + + new_path=`$WHICH "$new_path" 2> /dev/null` + # bat and cmd files are not always considered executable in MSYS causing which + # to not find them + if test "x$new_path" = x \ + && test "x`$ECHO \"$path\" | $GREP -i -e \"\\.bat$\" -e \"\\.cmd$\"`" != x \ + && test "x`$LS \"$path\" 2>/dev/null`" != x; then + new_path="$path" + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + fi + + if test "x$new_path" = x; then + # It's still not found. Now this is an unrecoverable error. + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: You might be mixing spaces in the path and extra arguments, which is not allowed." >&5 +$as_echo "$as_me: You might be mixing spaces in the path and extra arguments, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 + fi + fi + + # Now new_path has a complete unix path to the binary + if test "x`$ECHO $new_path | $GREP ^/bin/`" != x; then + # Keep paths in /bin as-is, but remove trailing .exe if any + new_path="${new_path/%.exe/}" + # Do not save /bin paths to all_fixpath_prefixes! + else + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $new_path` + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + # Output is in $new_path + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + # remove trailing .exe if any + new_path="${new_path/%.exe/}" + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + fi + + else + # We're on a unix platform. Hooray! :) + # First separate the path from the arguments. This will split at the first + # space. + complete="$BUILD_STRIP" + path="${complete%% *}" + tmp="$complete EOL" + arguments="${tmp#* }" + + # Cannot rely on the command "which" here since it doesn't always work. + is_absolute_path=`$ECHO "$path" | $GREP ^/` + if test -z "$is_absolute_path"; then + # Path to executable is not absolute. Find it. + IFS_save="$IFS" + IFS=: + for p in $PATH; do + if test -f "$p/$path" && test -x "$p/$path"; then + new_path="$p/$path" + break + fi + done + IFS="$IFS_save" + else + # This is an absolute path, we can use it without further modifications. + new_path="$path" + fi + + if test "x$new_path" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&5 +$as_echo "$as_me: The path of BUILD_STRIP, which resolves as \"$complete\", is not found." >&6;} + has_space=`$ECHO "$complete" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: This might be caused by spaces in the path, which is not allowed." >&5 +$as_echo "$as_me: This might be caused by spaces in the path, which is not allowed." >&6;} + fi + as_fn_error $? "Cannot locate the the path of BUILD_STRIP" "$LINENO" 5 + fi + fi + + # Now join together the path and the arguments once again + if test "x$arguments" != xEOL; then + new_complete="$new_path ${arguments% *}" + else + new_complete="$new_path" + fi + + if test "x$complete" != "x$new_complete"; then + BUILD_STRIP="$new_complete" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting BUILD_STRIP to \"$new_complete\"" >&5 +$as_echo "$as_me: Rewriting BUILD_STRIP to \"$new_complete\"" >&6;} + fi + fi + # Assume the C compiler is the assembler BUILD_AS="$BUILD_CC -c" # Just like for the target compiler, use the compiler as linker @@ -44530,6 +46092,8 @@ $as_echo "$as_me: Rewriting BUILD_AR to \"$new_complete\"" >&6;} 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" @@ -46684,9 +48248,6 @@ $as_echo "$supports" >&6; } ;; 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. @@ -46717,7 +48278,12 @@ $as_echo "$supports" >&6; } 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 @@ -46761,12 +48327,30 @@ $as_echo "$supports" >&6; } -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" + + + + @@ -46867,6 +48451,9 @@ $as_echo "$supports" >&6; } 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}" @@ -46877,28 +48464,37 @@ $as_echo "$supports" >&6; } 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}" + + + @@ -47503,6 +49099,7 @@ $as_echo "$supports" >&6; } + # Setup debug symbols (need objcopy from the toolchain for that) # @@ -61205,6 +62802,7 @@ do "$OUTPUT_ROOT/spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in" ;; "$OUTPUT_ROOT/hotspot-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in" ;; "$OUTPUT_ROOT/bootcycle-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in" ;; + "$OUTPUT_ROOT/buildjdk-spec.gmk") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in" ;; "$OUTPUT_ROOT/compare.sh") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in" ;; "$OUTPUT_ROOT/Makefile") CONFIG_FILES="$CONFIG_FILES $OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in" ;; diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index a5b403b0d30..3c677d8adde 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -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) +]) diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 7553dfe0323..fe5a201ecd9 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -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..? diff --git a/common/autoconf/source-dirs.m4 b/common/autoconf/source-dirs.m4 index 56f95dcba60..fa2f74d2237 100644 --- a/common/autoconf/source-dirs.m4 +++ b/common/autoconf/source-dirs.m4 @@ -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) +]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index d8322ebce9c..66374c8f649 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -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 diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 5e26fd1e3e6..07a6f834bfc 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -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" diff --git a/common/bin/compare.sh b/common/bin/compare.sh index a629ae084eb..d073fbbda32 100644 --- a/common/bin/compare.sh +++ b/common/bin/compare.sh @@ -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... diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index 48519cfbe74..27fbe1f02cf 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -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" }, diff --git a/make/CheckModules.gmk b/make/CheckModules.gmk deleted file mode 100644 index 4872c912e49..00000000000 --- a/make/CheckModules.gmk +++ /dev/null @@ -1,46 +0,0 @@ -# -# 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 target declared first -default: all - -include $(SPEC) -include MakeBase.gmk - -JDEPS_MODULES_XML := $(JDK_OUTPUTDIR)/modules/jdk.jdeps/com/sun/tools/jdeps/resources/jdeps-modules.xml - -# -# 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 - -all: checkdeps - -.PHONY: all diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index e8928e2130d..a2650d730bb 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -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 \ # -OS_SRC_DIRS += $(JDK_TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS)/classes +TOP_SRC_DIRS += \ + $(HOTSPOT_TOPDIR)/src \ + $(CORBA_TOPDIR)/src \ + $(JDK_TOPDIR)/src \ + $(LANGTOOLS_TOPDIR)/src \ + $(JAXP_TOPDIR)/src \ + $(JAXWS_TOPDIR)/src \ + $(NASHORN_TOPDIR)/src \ + # + +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))) -# Find the module dependencies by parsing modules.list file -DEPS := $(call FindDepsForModule, $(MODULE)) +# Add imported modules to the moduleclasspath +MODULECLASSPATH := $(subst $(SPACE),$(PATH_SEP), $(IMPORT_MODULES_CLASSES)) -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) +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 + +# 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) diff --git a/make/CopyImportModules.gmk b/make/CopyImportModules.gmk new file mode 100644 index 00000000000..e79288557a1 --- /dev/null +++ b/make/CopyImportModules.gmk @@ -0,0 +1,86 @@ +# +# 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 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 + +LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS))) +CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS))) +CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF))) + +$(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 + +ifneq ($(CONF_DIR), ) + $(eval $(call SetupCopyFiles, COPY_CONF, \ + SRC := $(CONF_DIR), \ + DEST := $(JDK_OUTPUTDIR)/lib, \ + FILES := $(call CacheFind, $(CONF_DIR)), \ + )) + TARGETS += $(COPY_CONF) +endif + +all: $(TARGETS) diff --git a/make/CreateBuildJdkCopy.gmk b/make/CreateBuildJdkCopy.gmk new file mode 100644 index 00000000000..ca8b3e10491 --- /dev/null +++ b/make/CreateBuildJdkCopy.gmk @@ -0,0 +1,86 @@ +# +# 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. +# + +default: all + +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) $@ + +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)))))), \ +)) + +#TARGETS += $(COPY_JDK_MODULES) + +################################################################################ + +$(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \ + SRC := $(BUILD_OUTPUT), \ + DEST := $(BUILDJDK_OUTPUTDIR), \ + FILES := $(call CacheFind, $(wildcard \ + $(addprefix $(SUPPORT_OUTPUTDIR)/headers/, $(MODULES_TO_COPY)))), \ +)) + +TARGETS += $(COPY_SUPPORT_HEADERS) + +################################################################################ + +$(eval $(call SetupCopyFiles, COPY_JDK_LIB_FILES, \ + SRC := $(BUILD_OUTPUT), \ + DEST := $(BUILDJDK_OUTPUTDIR), \ + FILES := $(JDK_OUTPUTDIR)/lib/tzdb.dat, \ +)) + +TARGETS += $(COPY_JDK_LIB_FILES) + +################################################################################ + +all: $(TARGETS) + +.PHONY: default all diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk new file mode 100644 index 00000000000..fdfb7dc6884 --- /dev/null +++ b/make/CreateJmods.gmk @@ -0,0 +1,95 @@ +# +# 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) + +################################################################################ diff --git a/make/GenerateModuleDeps.gmk b/make/GenerateModuleDeps.gmk deleted file mode 100644 index b5427dd89a5..00000000000 --- a/make/GenerateModuleDeps.gmk +++ /dev/null @@ -1,64 +0,0 @@ -# -# 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. -# - -# This file is included from Main.gmk only. - -include $(SRC_ROOT)/make/common/JavaCompilation.gmk -include $(SRC_ROOT)/make/common/SetupJavaCompilers.gmk - -################################################################################ - -$(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, \ -)) - -TOOL_GENMODULESLIST = $(JAVA_SMALL) \ - -cp "$(MAKESUPPORT_OUTPUTDIR)/bt_classes_moduleslist" \ - build.tools.module.GenModulesList - -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 - -$(MODULES_LIST_FILE): $(SRC_ROOT)/modules.xml $(BUILD_GENMODULESLIST) - $(TOOL_GENMODULESLIST) -o $@ $(filter %.xml, $^) - -$(MODULE_DEPS_MAKEFILE): $(MODULES_LIST_FILE) - $(CAT) $^ | $(SED) -e 's/^\([^:]*\):/DEPS_\1 :=/g' > $@ - -TARGETS += $(MODULE_DEPS_MAKEFILE) - -################################################################################ - -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, , GenerateModuleDeps.gmk)) - -# Trigger generation of this file and restart make if it changed. --include $(MODULE_DEPS_MAKEFILE) diff --git a/make/GensrcModuleInfo.gmk b/make/GensrcModuleInfo.gmk new file mode 100644 index 00000000000..b53fc5a1256 --- /dev/null +++ b/make/GensrcModuleInfo.gmk @@ -0,0 +1,154 @@ +# +# 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///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) diff --git a/make/HotspotWrapper.gmk b/make/HotspotWrapper.gmk index eec08d6e129..663215525a3 100644 --- a/make/HotspotWrapper.gmk +++ b/make/HotspotWrapper.gmk @@ -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) $@ diff --git a/make/Images.gmk b/make/Images.gmk index 7fc063773d6..3aa4173b4cf 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -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), \ diff --git a/make/Javadoc.gmk b/make/Javadoc.gmk index 0e0be3fc47e..f0b170186cf 100644 --- a/make/Javadoc.gmk +++ b/make/Javadoc.gmk @@ -1,4 +1,4 @@ -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2016, 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 @@ -138,26 +138,48 @@ $(FULL_COMPANY_NAME) in the US and other countries. # to $(PATH_SEP) being interpreted as an end of # command (newline or shell ; character) ALL_SOURCE_DIRS := $(wildcard \ - $(JDK_TOPDIR)/src/*/share/classes \ + $(SUPPORT_OUTPUTDIR)/gensrc/j* \ + $(if $(IMPORT_MODULES_SRC), $(IMPORT_MODULES_SRC)/*) \ $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \ $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \ + $(JDK_TOPDIR)/src/*/share/classes \ + $(HOTSPOT_TOPDIR)/src/*/share/classes \ $(LANGTOOLS_TOPDIR)/src/*/share/classes \ $(NASHORN_TOPDIR)/src/*/share/classes \ $(CORBA_TOPDIR)/src/*/share/classes \ $(JAXP_TOPDIR)/src/*/share/classes \ $(JAXWS_TOPDIR)/src/*/share/classes \ - $(SUPPORT_OUTPUTDIR)/gensrc/j* \ $(SUPPORT_OUTPUTDIR)/rmic/j* \ $(JDK_TOPDIR)/src/*/share/doc/stub \ ) \ # +ALL_MODULE_SOURCE_DIRS := \ + $(SUPPORT_OUTPUTDIR)/gensrc/* \ + $(if $(IMPORT_MODULES_SRC), $(IMPORT_MODULES_SRC)/*) \ + $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \ + $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \ + $(JDK_TOPDIR)/src/*/share/classes \ + $(HOTSPOT_TOPDIR)/src/*/share/classes \ + $(LANGTOOLS_TOPDIR)/src/*/share/classes \ + $(NASHORN_TOPDIR)/src/*/share/classes \ + $(CORBA_TOPDIR)/src/*/share/classes \ + $(JAXP_TOPDIR)/src/*/share/classes \ + $(JAXWS_TOPDIR)/src/*/share/classes \ + $(SUPPORT_OUTPUTDIR)/rmic/* \ + $(JDK_TOPDIR)/src/*/share/doc/stub \ + # + + # List with classpath separator between them EMPTY:= SPACE:= $(EMPTY) $(EMPTY) RELEASEDOCS_SOURCEPATH = \ $(subst $(SPACE),$(PATH_SEP),$(strip $(ALL_SOURCE_DIRS))) +RELEASEDOCS_MODULESOURCEPATH = \ + $(subst $(SPACE),$(PATH_SEP),$(strip $(ALL_MODULE_SOURCE_DIRS))) + define prep-target $(MKDIR) -p $(@D) $(RM) $@ @@ -372,6 +394,9 @@ COREAPI_OVERVIEW = $(JDK_TOPDIR)/src/java.base/share/classes/overview-core.html COREAPI_OPTIONS_FILE = $(DOCSTMPDIR)/coredocs.options COREAPI_PACKAGES_FILE = $(DOCSTMPDIR)/coredocs.packages +# The modules required to be documented +COREAPI_MODULES = java.se.ee + coredocs: $(COREAPI_INDEX_FILE) # Set relative location to core api document root @@ -391,7 +416,9 @@ $(COREAPI_OPTIONS_FILE): $(COREAPI_OVERVIEW) $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:reference) ; \ $(call OptionOnly,-Xdoclint/package:-org.omg.*) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(COREAPI_MODULES)) ; \ $(call OptionPair,-encoding,ISO-8859-1) ; \ $(call OptionOnly,-splitIndex) ; \ $(call OptionPair,-overview,$(COREAPI_OVERVIEW)) ; \ @@ -431,6 +458,9 @@ DOCLETAPI_INDEX_FILE = $(DOCLETAPI_DOCDIR)/index.html DOCLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/docletapi.options DOCLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/docletapi.packages +# The modules required to be documented +DOCLETAPI_MODULES = jdk.javadoc + docletapidocs: $(DOCLETAPI_INDEX_FILE) # Set relative location to core api document root @@ -449,7 +479,9 @@ $(DOCLETAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(DOCLETAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-breakiterator) ; \ $(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE)) ; \ @@ -488,6 +520,9 @@ OLD_DOCLETAPI_INDEX_FILE = $(OLD_DOCLETAPI_DOCDIR)/index.html OLD_DOCLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/old-docletapi.options OLD_DOCLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/old-docletapi.packages +# The modules required to be documented +OLD_DOCLETAPI_MODULES = jdk.javadoc + olddocletapidocs: $(OLD_DOCLETAPI_INDEX_FILE) # Set relative location to core api document root @@ -506,7 +541,9 @@ $(OLD_DOCLETAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(OLD_DOCLETAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-breakiterator) ; \ $(call OptionPair,-doctitle,$(OLD_DOCLETAPI_DOCTITLE)) ; \ @@ -541,6 +578,9 @@ TAGLETAPI_INDEX_FILE = $(TAGLETAPI_DOCDIR)/com/sun/tools/doclets/Taglet.html TAGLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/tagletapi.options TAGLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/tagletapi.packages +# The modules required to be documented +TAGLETAPI_MODULES = jdk.javadoc + tagletapidocs: $(TAGLETAPI_INDEX_FILE) # Set relative location to core api document root @@ -564,7 +604,9 @@ $(TAGLETAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(TAGLETAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nonavbar) ; \ $(call OptionOnly,-noindex) ; \ @@ -599,6 +641,9 @@ DOMAPI_INDEX_FILE = $(DOMAPI_DOCDIR)/index.html DOMAPI_OPTIONS_FILE = $(DOCSTMPDIR)/domapi.options DOMAPI_PACKAGES_FILE = $(DOCSTMPDIR)/domapi.packages +# The modules required to be documented +DOMAPI_MODULES = java.xml,jdk.xml.dom + domapidocs: $(DOMAPI_INDEX_FILE) # Set relative location to core api document root @@ -617,7 +662,9 @@ $(DOMAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(DOMAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-splitIndex) ; \ $(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE)) ; \ @@ -663,6 +710,9 @@ JDI_INDEX_FILE = $(JDI_DOCDIR)/index.html JDI_OPTIONS_FILE = $(DOCSTMPDIR)/jdi.options JDI_PACKAGES_FILE = $(DOCSTMPDIR)/jdi.packages +# The modules required to be documented +JDI_MODULES = jdk.jdi + jdidocs: $(JDI_INDEX_FILE) # Set relative location to core api document root @@ -681,7 +731,9 @@ $(JDI_OPTIONS_FILE): $(JDI_OVERVIEW) @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JDI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-overview,$(JDI_OVERVIEW)) ; \ $(call OptionPair,-doctitle,$(JDI_DOCTITLE)) ; \ @@ -751,6 +803,9 @@ JAAS_INDEX_FILE = $(JAAS_DOCDIR)/index.html JAAS_OPTIONS_FILE = $(DOCSTMPDIR)/jaas.options JAAS_PACKAGES_FILE = $(DOCSTMPDIR)/jaas.packages +# The modules required to be documented +JAAS_MODULES = jdk.security.auth + jaasdocs: $(JAAS_INDEX_FILE) # Set relative location to core api document root @@ -769,7 +824,9 @@ $(JAAS_OPTIONS_FILE): $(JAAS_OVERVIEW) @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JAAS_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-overview,$(JAAS_OVERVIEW)) ; \ $(call OptionPair,-doctitle,$(JAAS_DOCTITLE)) ; \ @@ -805,6 +862,9 @@ JGSS_INDEX_FILE = $(JGSS_DOCDIR)/index.html JGSS_OPTIONS_FILE = $(DOCSTMPDIR)/jgss.options JGSS_PACKAGES_FILE = $(DOCSTMPDIR)/jgss.packages +# The modules required to be documented +JGSS_MODULES = jdk.security.jgss + jgssdocs: $(JGSS_INDEX_FILE) # Set relative location to core api document root @@ -823,7 +883,9 @@ $(JGSS_OPTIONS_FILE): $(JGSS_OVERVIEW) @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JGSS_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-overview,$(JGSS_OVERVIEW)) ; \ @@ -859,6 +921,9 @@ SMARTCARDIO_INDEX_FILE = $(SMARTCARDIO_DOCDIR)/index.html SMARTCARDIO_OPTIONS_FILE = $(DOCSTMPDIR)/smartcardio.options SMARTCARDIO_PACKAGES_FILE = $(DOCSTMPDIR)/smartcardio.packages +# The modules required to be documented +SMARTCARDIO_MODULES = java.smartcardio + smartcardiodocs: $(SMARTCARDIO_INDEX_FILE) # Set relative location to core api document root @@ -877,7 +942,9 @@ $(SMARTCARDIO_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(SMARTCARDIO_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE)) ; \ @@ -911,6 +978,9 @@ HTTPSERVER_INDEX_HTML = $(HTTPSERVER_DOCDIR)/index.html HTTPSERVER_OPTIONS_FILE = $(DOCSTMPDIR)/httpserver.options HTTPSERVER_PACKAGES_FILE = $(DOCSTMPDIR)/httpserver.packages +# The modules required to be documented +HTTPSERVER_MODULES = jdk.httpserver + httpserverdocs: $(HTTPSERVER_INDEX_HTML) # Set relative location to core api document root @@ -929,7 +999,9 @@ $(HTTPSERVER_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(HTTPSERVER_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE)) ; \ @@ -967,6 +1039,9 @@ MGMT_INDEX_FILE = $(MGMT_DOCDIR)/index.html MGMT_OPTIONS_FILE = $(DOCSTMPDIR)/mgmt.options MGMT_PACKAGES_FILE = $(DOCSTMPDIR)/mgmt.packages +# The modules required to be documented +MGMT_MODULES = jdk.management + mgmtdocs: $(MGMT_INDEX_FILE) # Set relative location to core api document root @@ -990,7 +1065,9 @@ $(MGMT_OPTIONS_FILE): $(MGMT_OVERVIEW) @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(MGMT_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-overview,$(MGMT_OVERVIEW)) ; \ @@ -1025,6 +1102,9 @@ ATTACH_INDEX_HTML = $(ATTACH_DOCDIR)/index.html ATTACH_OPTIONS_FILE = $(DOCSTMPDIR)/attach.options ATTACH_PACKAGES_FILE = $(DOCSTMPDIR)/attach.packages +# The modules required to be documented +ATTACH_MODULES = jdk.attach + attachdocs: $(ATTACH_INDEX_HTML) # Set relative location to core api document root @@ -1043,7 +1123,9 @@ $(ATTACH_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(ATTACH_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(ATTACH_DOCTITLE)) ; \ @@ -1077,6 +1159,9 @@ JCONSOLE_INDEX_HTML = $(JCONSOLE_DOCDIR)/index.html JCONSOLE_OPTIONS_FILE = $(DOCSTMPDIR)/jconsole.options JCONSOLE_PACKAGES_FILE = $(DOCSTMPDIR)/jconsole.packages +# The modules required to be documented +JCONSOLE_MODULES = jdk.jconsole + jconsoledocs: $(JCONSOLE_INDEX_HTML) # Set relative location to core api document root @@ -1095,7 +1180,9 @@ $(JCONSOLE_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JCONSOLE_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE)) ; \ @@ -1131,6 +1218,9 @@ TREEAPI_INDEX_HTML = $(TREEAPI_DOCDIR)/index.html TREEAPI_OPTIONS_FILE = $(DOCSTMPDIR)/treeapi.options TREEAPI_PACKAGES_FILE = $(DOCSTMPDIR)/treeapi.packages +# The modules required to be documented +TREEAPI_MODULES = jdk.compiler + treeapidocs: $(TREEAPI_INDEX_HTML) # Set relative location to core api document root @@ -1149,7 +1239,9 @@ $(TREEAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(TREEAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ @@ -1185,6 +1277,9 @@ NASHORNAPI_INDEX_HTML = $(NASHORNAPI_DOCDIR)/index.html NASHORNAPI_OPTIONS_FILE = $(DOCSTMPDIR)/nashornapi.options NASHORNAPI_PACKAGES_FILE = $(DOCSTMPDIR)/nashornapi.packages +# The modules required to be documented +NASHORNAPI_MODULES = jdk.scripting.nashorn + nashornapidocs: $(NASHORNAPI_INDEX_HTML) # Set relative location to core api document root @@ -1203,7 +1298,9 @@ $(NASHORNAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(NASHORNAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-doctitle,$(NASHORNAPI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(NASHORNAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ @@ -1239,6 +1336,9 @@ DYNALINKAPI_INDEX_HTML = $(DYNALINKAPI_DOCDIR)/index.html DYNALINKAPI_OPTIONS_FILE = $(DOCSTMPDIR)/dynalinkapi.options DYNALINKAPI_PACKAGES_FILE = $(DOCSTMPDIR)/dynalinkapi.packages +# The modules required to be documented +DYNALINKAPI_MODULES = jdk.dynalink + dynalinkapidocs: $(DYNALINKAPI_INDEX_HTML) # Set relative location to core api document root @@ -1257,7 +1357,9 @@ $(DYNALINKAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(DYNALINKAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionPair,-doctitle,$(DYNALINKAPI_DOCTITLE)) ; \ $(call OptionPair,-windowtitle,$(DYNALINKAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \ @@ -1291,6 +1393,9 @@ SCTPAPI_INDEX_HTML = $(SCTPAPI_DOCDIR)/index.html SCTPAPI_OPTIONS_FILE = $(DOCSTMPDIR)/sctp.options SCTPAPI_PACKAGES_FILE = $(DOCSTMPDIR)/sctp.packages +# The modules required to be documented +SCTPAPI_MODULES = jdk.sctp + sctpdocs: $(SCTPAPI_INDEX_HTML) # Set relative location to core api document root @@ -1309,7 +1414,9 @@ $(SCTPAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(SCTPAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE)) ; \ @@ -1343,6 +1450,9 @@ JACCESSAPI_INDEX_HTML = $(JACCESSAPI_DOCDIR)/index.html JACCESSAPI_OPTIONS_FILE = $(DOCSTMPDIR)/jaccess.options JACCESSAPI_PACKAGES_FILE = $(DOCSTMPDIR)/jaccess.packages +# The modules required to be documented +JACCESSAPI_MODULES = jdk.accessibility + jaccessdocs: $(JACCESSAPI_INDEX_HTML) # Set relative location to core api document root @@ -1361,7 +1471,9 @@ $(JACCESSAPI_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:all) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JACCESSAPI_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JACCESSAPI_DOCTITLE)) ; \ @@ -1395,6 +1507,9 @@ JDKNET_INDEX_HTML = $(JDKNET_DOCDIR)/index.html JDKNET_OPTIONS_FILE = $(DOCSTMPDIR)/jdknet.options JDKNET_PACKAGES_FILE = $(DOCSTMPDIR)/jdknet.packages +# The modules required to be documented +JDKNET_MODULES = java.base + jdknetdocs: $(JDKNET_INDEX_HTML) # Set relative location to core api document root @@ -1413,7 +1528,9 @@ $(JDKNET_OPTIONS_FILE): @($(call COMMON_JAVADOCFLAGS) ; \ $(call COMMON_JAVADOCTAGS) ; \ $(call OptionOnly,-Xdoclint:none) ; \ - $(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JDKNET_MODULES)) ; \ $(call OptionPair,-encoding,ascii) ; \ $(call OptionOnly,-nodeprecatedlist) ; \ $(call OptionPair,-doctitle,$(JDKNET_DOCTITLE)) ; \ @@ -1428,6 +1545,69 @@ $(JDKNET_PACKAGES_FILE): $(call PackageDependencies,$(JDKNET_PKGS)) $(prep-target) $(call PackageFilter,$(JDKNET_PKGS)) +############################################################# +# +# jlink plugin API docs +# +# TODO: Need to decide when the plugin API is ready to publish as experimental API. +# This target is temporarily added for internal use for now. +# + +ALL_OTHER_TARGETS += jlinkdocs + +JLINK_PLUGIN_FIRST_COPYRIGHT_YEAR = 2015 +JLINK_PLUGIN_DOCDIR := $(JDK_API_DOCSDIR)/jlink +JLINK_PLUGIN2COREAPI := ../$(JDKJRE2COREAPI) +JLINK_PLUGIN_DOCTITLE := JLink Plugin API - EXPERIMENTAL +JLINK_PLUGIN_WINDOWTITLE := JLink Plugin API - EXPERIMENTAL +JLINK_PLUGIN_HEADER := JLink Plugin API - EXPERIMENTAL +JLINK_PLUGIN_BOTTOM := $(call CommonBottom,$(JLINK_PLUGIN_FIRST_COPYRIGHT_YEAR)) +JLINK_PLUGIN_PKGS = jdk.tools.jlink \ + jdk.tools.jlink.builder \ + jdk.tools.jlink.plugin + +JLINK_PLUGIN_INDEX_HTML = $(JLINK_PLUGIN_DOCDIR)/index.html +JLINK_PLUGIN_OPTIONS_FILE = $(DOCSTMPDIR)/jlinkplugins.options +JLINK_PLUGIN_PACKAGES_FILE = $(DOCSTMPDIR)/jlinkplugins.packages + +# The modules required to be documented +JLINK_PLUGIN_MODULES = jdk.jlink + +jlinkdocs: $(JLINK_PLUGIN_INDEX_HTML) + +# Set relative location to core api document root +$(JLINK_PLUGIN_INDEX_HTML): GET2DOCSDIR=$(JLINK_PLUGIN2COREAPI)/.. + +# Run javadoc if the index file is out of date or missing +$(JLINK_PLUGIN_INDEX_HTML): $(JLINK_PLUGIN_OPTIONS_FILE) $(JLINK_PLUGIN_PACKAGES_FILE) $(COREAPI_INDEX_FILE) + $(prep-javadoc) + $(call JavadocSummary,$(JLINK_PLUGIN_OPTIONS_FILE),$(JLINK_PLUGIN_PACKAGES_FILE)) + $(JAVADOC_CMD_SMALL) -d $(@D) \ + @$(JLINK_PLUGIN_OPTIONS_FILE) @$(JLINK_PLUGIN_PACKAGES_FILE) + +# Create file with javadoc options in it +$(JLINK_PLUGIN_OPTIONS_FILE): + $(prep-target) + @($(call COMMON_JAVADOCFLAGS) ; \ + $(call COMMON_JAVADOCTAGS) ; \ + $(call OptionOnly,-Xdoclint:none) ; \ + $(call OptionPair,-system,none) ; \ + $(call OptionPair,-modulesourcepath,$(RELEASEDOCS_MODULESOURCEPATH)) ; \ + $(call OptionPair,-addmods,$(JLINK_PLUGIN_MODULES)) ; \ + $(call OptionPair,-encoding,ascii) ; \ + $(call OptionOnly,-nodeprecatedlist) ; \ + $(call OptionPair,-doctitle,$(JLINK_PLUGIN_DOCTITLE)) ; \ + $(call OptionPair,-windowtitle,$(JLINK_PLUGIN_WINDOWTITLE) $(DRAFT_WINTITLE)); \ + $(call OptionPair,-header,$(JLINK_PLUGIN_HEADER)$(DRAFT_HEADER)); \ + $(call OptionPair,-bottom,$(JLINK_PLUGIN_BOTTOM)$(DRAFT_BOTTOM)); \ + $(call OptionTrip,-linkoffline,$(JLINK_PLUGIN2COREAPI),$(COREAPI_DOCSDIR)/); \ + ) >> $@ + +# Create a file with the package names in it +$(JLINK_PLUGIN_PACKAGES_FILE): $(call PackageDependencies,$(JLINK_PLUGIN_PKGS)) + $(prep-target) + $(call PackageFilter,$(JLINK_PLUGIN_PKGS)) + otherdocs: $(ALL_OTHER_TARGETS) diff --git a/make/Jprt.gmk b/make/Jprt.gmk index 892e46cc243..6b778293d2a 100644 --- a/make/Jprt.gmk +++ b/make/Jprt.gmk @@ -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) . ; \ diff --git a/make/JrtfsJar.gmk b/make/JrtfsJar.gmk index 2f8931aee7b..ce5d5bea6c3 100644 --- a/make/JrtfsJar.gmk +++ b/make/JrtfsJar.gmk @@ -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) diff --git a/make/Main.gmk b/make/Main.gmk index 66509ddfdcb..5d8137f2b47 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -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 -lib to -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 -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 -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 -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: interim-langtools - jrtfs-jar: buildtools-jdk + jimages: jmods zip-source source-tips demos samples jrtfs-jar - jimages: exploded-image zip-source strip-binaries 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)) diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk index be697f663cf..9d5865d2b2c 100644 --- a/make/MainSupport.gmk +++ b/make/MainSupport.gmk @@ -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 diff --git a/make/StripBinaries.gmk b/make/StripBinaries.gmk index 07669bf93aa..26b3ee92338 100644 --- a/make/StripBinaries.gmk +++ b/make/StripBinaries.gmk @@ -57,25 +57,29 @@ endif NO_STRIP_CMDS_FILTER += %.cgi # Don't include debug info for executables. +ifneq ($(wildcard $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)), ) + # OS X stores symbol information in a .dylib file inside a .dSYM directory - + # that file should not be stripped, so we prune the tree at the .dSYM directory. + ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \ + $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE) \( -type f -o -type l \) \ + -print -o -name "*.dSYM" -prune)) + COPY_CMDS_SRC := $(filter $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC)) + STRIP_CMDS_SRC := $(filter-out $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC)) +endif -# OS X stores symbol information in a .dylib file inside a .dSYM directory - -# that file should not be stripped, so we prune the tree at the .dSYM directory. -ALL_CMDS_SRC := $(filter-out %.bc %.debuginfo %.diz %.map %.pdb, \ - $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_cmds \( -type f -o -type l \) \ - -print -o -name "*.dSYM" -prune)) -COPY_CMDS_SRC := $(filter $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC)) -STRIP_CMDS_SRC := $(filter-out $(NO_STRIP_CMDS_FILTER), $(ALL_CMDS_SRC)) - -# OS X stores symbol information in a .dylib file inside a .dSYM directory - -# that file should not be stripped, so we prune the tree at the .dSYM directory. -# Example: support/modules_libs/java.base/libjsig.dylib.dSYM/Contents/Resources/DWARF/libjsig.dylib -STRIP_LIBS_SRC := \ - $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs \ +ifneq ($(wildcard $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)), ) + # OS X stores symbol information in a .dylib file inside a .dSYM directory - + # that file should not be stripped, so we prune the tree at the .dSYM directory. + # Example: support/modules_libs/java.base/libjsig.dylib.dSYM/Contents/Resources/DWARF/libjsig.dylib + STRIP_LIBS_SRC := \ + $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE) \ -name '*$(SHARED_LIBRARY_SUFFIX)' -type f -print -o -name "*.dSYM" -prune) -# Make sure symbolic links are copied and not stripped. -COPY_LIBS_SRC := \ - $(filter-out $(STRIP_LIBS_SRC), \ - $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs -type f -o -type l)) + + # Make sure symbolic links are copied and not stripped. + COPY_LIBS_SRC := \ + $(filter-out $(STRIP_LIBS_SRC), \ + $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE) -type f -o -type l)) +endif $(eval $(call SetupCopyFiles,STRIP_MODULES_CMDS, \ SRC := $(SUPPORT_OUTPUTDIR)/modules_cmds, \ diff --git a/make/common/CORE_PKGS.gmk b/make/common/CORE_PKGS.gmk index eb6ac3d769e..850073385a4 100644 --- a/make/common/CORE_PKGS.gmk +++ b/make/common/CORE_PKGS.gmk @@ -1,5 +1,5 @@ # -# 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 \ diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index 29442c23151..22e9d908bfc 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -75,13 +75,13 @@ define add_file_to_copy ifneq ($$($1_COPY_$$($2_TARGET)), 1) $1_COPY_$$($2_TARGET) := 1 # Now we can setup the dependency that will trigger the copying. - $$($1_BIN)$$($2_TARGET) : $2 + $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) : $2 $(MKDIR) -p $$(@D) $(CP) $$< $$@ $(CHMOD) -f ug+w $$@ # And do not forget this target - $1_ALL_COPY_TARGETS += $$($1_BIN)$$($2_TARGET) + $1_ALL_COPY_TARGETS += $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) endif endef @@ -133,7 +133,7 @@ define add_file_to_clean $(CHMOD) -f ug+w $$@ # And do not forget this target - $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET) + $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($1_MODULE_SUBDIR)$$($2_TARGET) endif endef @@ -154,6 +154,7 @@ endef # SRC:=one or more directories to search for sources. The order of the source roots # is significant. The first found file of a certain name has priority. # BIN:=store classes here +# MODULE:=Name of module being compiled. If set, classes are put in BIN/MODULE. # CLASSPATH:=a list of additional entries to set as classpath to javac # INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages. # EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages. @@ -190,6 +191,10 @@ define SetupJavaCompilationBody $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC) + + ifneq ($$($1_MODULE), ) + $1_MODULE_SUBDIR := /$$($1_MODULE) + endif # Make sure the dirs exist. $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory >$$d<))) @@ -303,7 +308,7 @@ define SetupJavaCompilationBody $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \ $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) - $1_COMPILE_TARGET := $$($1_BIN)/_the.$1_batch + $1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) # Using sjavac to compile. @@ -336,7 +341,8 @@ define SetupJavaCompilationBody $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \ $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \ $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) - $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) + $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ + $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps) $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) $$(call MakeDir, $$(@D) $$(dir $$($1_SJAVAC_PORTFILE))) @@ -345,7 +351,7 @@ define SetupJavaCompilationBody $$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE))) endif $$(call LogWarn, Compiling $1) - $$(call ExecuteWithLog, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, \ + $$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \ $$($1_JVM) $$($1_SJAVAC) \ $$($1_REMOTE) \ -j 1 \ @@ -353,7 +359,7 @@ define SetupJavaCompilationBody --permit-sources-without-package \ --compare-found-sources $$@.tmp \ --log=$(LOG_LEVEL) \ - --state-dir=$$($1_BIN) \ + --state-dir=$$($1_BIN)$$($1_MODULE_SUBDIR) \ $$($1_SJAVAC_ARGS) \ $$($1_FLAGS) \ $$($1_HEADERS_ARG) \ @@ -362,11 +368,13 @@ define SetupJavaCompilationBody # Create a pubapi file that only changes when the pubapi changes. Dependent # compilations can use this file to only get recompiled when pubapi has changed. # Grep returns 1 if no matching lines are found. Do not fail for this. - $(GREP) -e "^I" $$($1_BIN)/javac_state > $$($1_BIN)/_the.$1_pubapi.tmp \ + $(GREP) -e "^I" $$($1_BIN)$$($1_MODULE_SUBDIR)/javac_state > $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp \ || test "$$$$?" = "1" - if [ ! -f $$($1_BIN)/_the.$1_pubapi ] \ - || [ "`$(DIFF) $$($1_BIN)/_the.$1_pubapi $$($1_BIN)/_the.$1_pubapi.tmp`" != "" ]; then \ - $(MV) $$($1_BIN)/_the.$1_pubapi.tmp $$($1_BIN)/_the.$1_pubapi; \ + if [ ! -f $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi ] \ + || [ "`$(DIFF) $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi \ + $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp`" != "" ]; then \ + $(MV) $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp \ + $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi; \ fi else @@ -380,11 +388,12 @@ define SetupJavaCompilationBody $$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET) $(MKDIR) -p $$(@D) if [ -d "$$($1_HEADERS).$1.tmp" ]; then \ - for f in `ls $$($1_HEADERS).$1.tmp`; do \ + for f in `$(CD) $$($1_HEADERS).$1.tmp && $(FIND) . -type f`; do \ if [ ! -f "$$($1_HEADERS)/$$$$f" ] \ || [ "`$(DIFF) $$($1_HEADERS)/$$$$f $$($1_HEADERS).$1.tmp/$$$$f`" != "" ]; then \ - $(CP) -f $$($1_HEADERS).$1.tmp/$$$$f $$($1_HEADERS)/$$$$f; \ - fi; \ + $(MKDIR) -p `$(DIRNAME) $$($1_HEADERS)/$$$$f`; \ + $(CP) -f $$($1_HEADERS).$1.tmp/$$$$f $$($1_HEADERS)/$$$$f; \ + fi; \ done; \ fi $(RM) -r $$($1_HEADERS).$1.tmp @@ -396,7 +405,8 @@ define SetupJavaCompilationBody $1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \ $$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \ $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) - $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps) + $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \ + $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps) ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes) $1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE) @@ -409,7 +419,7 @@ define SetupJavaCompilationBody $$(call MakeDir, $$(@D)) $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp)) $$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1) - $$(call ExecuteWithLog, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, \ + $$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \ $$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \ -implicit:none \ -d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \ @@ -431,7 +441,7 @@ define SetupJavaCompilationBody $$(eval $$(call SetupJarArchive, ARCHIVE_$1, \ DEPENDENCIES:=$$($1), \ - SRCS:=$$($1_BIN), \ + SRCS:=$$($1_BIN)$$($1_MODULE_SUBDIR), \ SUFFIXES:=$$($1_SUFFIXES), \ EXCLUDE:=$$($1_EXCLUDES), \ INCLUDES:=$$($1_INCLUDES), \ diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 6200851793c..7ed52135f28 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -247,7 +247,7 @@ REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \ $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) \ 2> /dev/null))))) -# Emit the repo:tip pairs to $@ +# Emit the repo:tip pairs to $@, but only if they changed since last time define GetSourceTips $(CD) $(SRC_ROOT) ; \ for i in $(REPO_LIST) IGNORE ; do \ @@ -260,8 +260,13 @@ define GetSourceTips $(PRINTF) " %s:%s" \ "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \ fi; \ - done >> $@ - $(PRINTF) "\n" >> $@ + done > $@.tmp + $(PRINTF) "\n" >> $@.tmp + if [ ! -f $@ ] || [ "`$(CAT) $@`" != "`$(CAT) $@.tmp`" ]; then \ + $(MV) $@.tmp $@ ; \ + else \ + $(RM) $@.tmp ; \ + fi endef # Create the HGTIP_FILENAME file. Called from closed/make/SourceBundles.gmk @@ -644,10 +649,10 @@ endif # Defines the sub directory structure to store variable value file in DependOnVariableDirName = \ - $(strip $(subst $(SRC_ROOT)/,,\ - $(if $(filter /%, $(firstword $(MAKEFILE_LIST))), \ + $(strip $(addsuffix $(if $(MODULE),/$(MODULE)), \ + $(subst $(SRC_ROOT)/,, $(if $(filter /%, $(firstword $(MAKEFILE_LIST))), \ $(firstword $(MAKEFILE_LIST)), \ - $(CURDIR)/$(firstword $(MAKEFILE_LIST))))) + $(CURDIR)/$(firstword $(MAKEFILE_LIST)))))) # Defines the name of the file to store variable value in. Generates a name # unless parameter 2 is given. diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 54f7a2b44a9..b3478f29aeb 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -26,6 +26,9 @@ ifndef _MODULES_GMK _MODULES_GMK := 1 +# Hook to include the corresponding custom file, if present. +$(eval $(call IncludeCustomExtension, , common/Modules.gmk)) + ################################################################################ # Some platforms don't have the serviceability agent ifeq ($(INCLUDE_SA), false) @@ -35,7 +38,9 @@ endif ################################################################################ # Module list macros -ALL_TOP_SRC_DIRS := \ +# Use append so that the custom extension may add to this variable + +ALL_TOP_SRC_DIRS += \ $(HOTSPOT_TOPDIR)/src \ $(JDK_TOPDIR)/src \ $(LANGTOOLS_TOPDIR)/src \ @@ -45,37 +50,74 @@ ALL_TOP_SRC_DIRS := \ $(NASHORN_TOPDIR)/src \ # -# Find all modules with java sources by looking in the source dirs -define FindJavaModules - $(filter-out $(MODULES_FILTER), $(sort $(notdir \ - $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \ - $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS)))))))))))) -endef +# Find all module-info.java files for the current build target platform and +# configuration. +# Param 1 - Module to find for, set to * for finding all +FindAllModuleInfos = \ + $(wildcard \ + $(patsubst %,%/$(strip $1)/$(OPENJDK_TARGET_OS)/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \ + $(patsubst %,%/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \ + $(patsubst %,%/$(strip $1)/share/classes/module-info.java, $(ALL_TOP_SRC_DIRS)) \ + $(patsubst %,%/$(strip $1)/module-info.java, $(IMPORT_MODULES_SRC))) -# Find all modules with source for the target platform. -define FindAllModules - $(sort $(filter-out $(MODULES_FILTER) closed demo sample, \ - $(notdir $(patsubst %/,%, $(dir \ - $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \ - $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))))) -endef +# Extract the module names from the paths of module-info.java files. The +# position of the module directory differs depending on if this is an imported +# src dir or not. +GetModuleNameFromModuleInfo = \ + $(strip $(foreach mi, $1, \ + $(if $(filter $(addsuffix %, $(IMPORT_MODULES_SRC)), $(mi)), \ + $(notdir $(patsubst %/,%, $(dir $(mi)))), \ + $(notdir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(mi))))))))))) + +# Find all modules by looking for module-info.java files and looking at parent +# directories. +FindAllModules = \ + $(sort $(filter-out $(MODULES_FILTER), \ + $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS)))) + +FindImportedModules = \ + $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))) ################################################################################ -# The module deps makefile is generated in make/GenerateModuleDeps.gmk +# Extract module dependencies from module-info.java files. + MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk + +MODULE_INFOS := $(call FindAllModuleInfos, *) + +$(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \ + $(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps) + $(MKDIR) -p $(@D) + $(RM) $@ + $(foreach m, $(MODULE_INFOS), \ + ( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) :=" && \ + $(NAWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\ + BEGIN { if (MODULE != "java.base") printf(" java.base"); } \ + /requires/ { sub(/;/, ""); \ + sub(/requires/, ""); \ + sub(/public/, ""); \ + sub(/\/\/.*/, ""); \ + sub(/\/\*.*\*\//, ""); \ + gsub(/ /, ""); \ + printf(" %s", $$0) } \ + END { printf("\n") }' $m \ + ) >> $@ $(NEWLINE)) + -include $(MODULE_DEPS_MAKEFILE) # Param 1: Module to find deps for -define FindDepsForModule +FindDepsForModule = \ $(DEPS_$(strip $1)) -endef + +# Finds transitive dependencies in 3 levels. +# Param 1: Module to find transitive deps for +FindTransitiveDepsForModule = \ + $(sort $(call FindDepsForModule, $1) \ + $(foreach m, $(call FindDepsForModule, $1), \ + $(call FindDepsForModule, $m) \ + $(foreach n, $(call FindDepsForModule, $m), \ + $(call FindDepsForModule, $n)))) ################################################################################ -# Hook to include the corresponding custom file, if present. -$(eval $(call IncludeCustomExtension, , common/Modules.gmk)) - endif # _MODULES_GMK diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk index f675790efc6..2ddd3760559 100644 --- a/make/common/NativeCompilation.gmk +++ b/make/common/NativeCompilation.gmk @@ -74,6 +74,7 @@ endef # AS - Assembler # MT - Windows MT tool # RC - Windows RC tool +# OBJCOPY - The objcopy tool for debug symbol handling # STRIP - The tool to use for stripping debug symbols # SYSROOT_CFLAGS - Compiler flags for using the specific sysroot # SYSROOT_LDFLAGS - Linker flags for using the specific sysroot @@ -90,6 +91,7 @@ define DefineNativeToolchainBody $$(call SetIfEmpty, $1_AS, $$($$($1_EXTENDS)_AS)) $$(call SetIfEmpty, $1_MT, $$($$($1_EXTENDS)_MT)) $$(call SetIfEmpty, $1_RC, $$($$($1_EXTENDS)_RC)) + $$(call SetIfEmpty, $1_OBJCOPY, $$($$($1_EXTENDS)_OBJCOPY)) $$(call SetIfEmpty, $1_STRIP, $$($$($1_EXTENDS)_STRIP)) $$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_EXTENDS)_SYSROOT_CFLAGS)) $$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_EXTENDS)_SYSROOT_LDFLAGS)) @@ -105,6 +107,7 @@ $(eval $(call DefineNativeToolchain, TOOLCHAIN_DEFAULT, \ AS := $(AS), \ MT := $(MT), \ RC := $(RC), \ + OBJCOPY := $(OBJCOPY), \ STRIP := $(STRIP), \ SYSROOT_CFLAGS := $(SYSROOT_CFLAGS), \ SYSROOT_LDFLAGS := $(SYSROOT_LDFLAGS), \ @@ -118,13 +121,14 @@ $(eval $(call DefineNativeToolchain, TOOLCHAIN_LINK_CXX, \ # Create a toolchain with the BUILD compiler, used for build tools that # are to be run during the build. -# The BUILD_SYSROOT_*FLAGS variables are empty for now. $(eval $(call DefineNativeToolchain, TOOLCHAIN_BUILD, \ CC := $(BUILD_CC), \ CXX := $(BUILD_CXX), \ LD := $(BUILD_LD), \ AR := $(BUILD_AR), \ AS := $(BUILD_AS), \ + OBJCOPY := $(BUILD_OBJCOPY), \ + STRIP := $(BUILD_STRIP), \ SYSROOT_CFLAGS := $(BUILD_SYSROOT_CFLAGS), \ SYSROOT_LDFLAGS := $(BUILD_SYSROOT_LDFLAGS), \ )) @@ -437,6 +441,7 @@ define SetupNativeCompilationBody $$(call SetIfEmpty, $1_AS, $$($$($1_TOOLCHAIN)_AS)) $$(call SetIfEmpty, $1_MT, $$($$($1_TOOLCHAIN)_MT)) $$(call SetIfEmpty, $1_RC, $$($$($1_TOOLCHAIN)_RC)) + $$(call SetIfEmpty, $1_OBJCOPY, $$($$($1_TOOLCHAIN)_OBJCOPY)) $$(call SetIfEmpty, $1_STRIP, $$($$($1_TOOLCHAIN)_STRIP)) $$(call SetIfEmpty, $1_SYSROOT_CFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_CFLAGS)) $$(call SetIfEmpty, $1_SYSROOT_LDFLAGS, $$($$($1_TOOLCHAIN)_SYSROOT_LDFLAGS)) @@ -720,9 +725,9 @@ define SetupNativeCompilationBody # Setup the command line creating debuginfo files, to be run after linking. # It cannot be run separately since it updates the original target file $1_CREATE_DEBUGINFO_CMDS := \ - $(OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \ - $(CD) $$($1_OUTPUT_DIR) && \ - $(OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) + $$($1_OBJCOPY) --only-keep-debug $$($1_TARGET) $$($1_DEBUGINFO_FILES) $$(NEWLINE) \ + $(CD) $$($1_OUTPUT_DIR) && \ + $$($1_OBJCOPY) --add-gnu-debuglink=$$($1_DEBUGINFO_FILES) $$($1_TARGET) else ifeq ($(OPENJDK_TARGET_OS), macosx) $1_DEBUGINFO_FILES := $$($1_OBJECT_DIR)/$$($1_BASENAME).dSYM diff --git a/make/common/SetupJavaCompilers.gmk b/make/common/SetupJavaCompilers.gmk index a381d1c65a4..8100cdbeccb 100644 --- a/make/common/SetupJavaCompilers.gmk +++ b/make/common/SetupJavaCompilers.gmk @@ -38,7 +38,8 @@ JAVAC_WARNINGS := -Xlint:all -Werror # and the interim javac, to be run by the boot jdk. $(eval $(call SetupJavaCompiler,BOOT_JAVAC, \ JAVAC := $(JAVAC), \ - FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror, \ + FLAGS := $(BOOT_JDK_SOURCETARGET) -XDignore.symbol.file=true -g \ + -Xlint:all$(COMMA)-deprecation$(COMMA)-options -Werror, \ DISABLE_SJAVAC := true, \ )) @@ -80,9 +81,6 @@ $(eval $(call SetupJavaCompiler,GENERATE_JDKBYTECODE_NOWARNINGS, \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) -JDK_BOOTCLASSPATH := $(call PathList, \ - $(filter-out $(JDK_OUTPUTDIR)/modules/_%, $(wildcard $(JDK_OUTPUTDIR)/modules/*))) - # After the jdk is built, we want to build demos using only the recently # generated jdk classes and nothing else, no jdk source, etc etc. # I.e. the rt.jar, but since rt.jar has not yet been generated @@ -90,7 +88,7 @@ JDK_BOOTCLASSPATH := $(call PathList, \ $(eval $(call SetupJavaCompiler,GENERATE_USINGJDKBYTECODE, \ JVM := $(JAVA_SMALL), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := -bootclasspath $(JDK_BOOTCLASSPATH) $(DISABLE_WARNINGS), \ + FLAGS := -upgrademodulepath $(JDK_OUTPUTDIR)/modules -system none $(DISABLE_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) diff --git a/modules.xml b/modules.xml deleted file mode 100644 index 7061f52301b..00000000000 --- a/modules.xml +++ /dev/null @@ -1,2139 +0,0 @@ - - - - - - - - - java.activation - java.base - java.datatransfer - java.desktop - java.logging - - javax.activation - - - - java.annotations.common - java.base - - javax.annotation - - - - java.base - - java.io - - - java.lang - - - java.lang.annotation - - - java.lang.invoke - - - java.lang.ref - - - java.lang.reflect - - - java.math - - - java.net - - - java.nio - - - java.nio.channels - - - java.nio.channels.spi - - - java.nio.charset - - - java.nio.charset.spi - - - java.nio.file - - - java.nio.file.attribute - - - java.nio.file.spi - - - java.security - - - java.security.acl - - - java.security.cert - - - java.security.interfaces - - - java.security.spec - - - java.text - - - java.text.spi - - - java.time - - - java.time.chrono - - - java.time.format - - - java.time.temporal - - - java.time.zone - - - java.util - - - java.util.concurrent - - - java.util.concurrent.atomic - - - java.util.concurrent.locks - - - java.util.function - - - java.util.jar - - - java.util.regex - - - java.util.spi - - - java.util.stream - - - java.util.zip - - - javax.crypto - - - javax.crypto.interfaces - - - javax.crypto.spec - - - javax.net - - - javax.net.ssl - - - javax.security.auth - - - javax.security.auth.callback - - - javax.security.auth.login - - - javax.security.auth.spi - - - javax.security.auth.x500 - - - javax.security.cert - - - jdk - - - jdk.net - - - com.sun.security.ntlm - java.security.sasl - - - jdk.internal.jimage - jdk.dev - - - jdk.internal.jimage.decompressor - jdk.dev - - - jdk.internal.math - java.desktop - - - jdk.internal.misc - java.corba - java.desktop - java.logging - java.management - java.naming - java.rmi - java.security.jgss - java.sql - java.xml - jdk.charsets - jdk.management.resource - jdk.jfr - jdk.net - jdk.scripting.nashorn - jdk.vm.ci - - - jdk.internal.perf - java.desktop - java.management - jdk.jvmstat - - - jdk.internal.org.xml.sax - jdk.jfr - - - jdk.internal.org.xml.sax.helpers - jdk.jfr - - - jdk.internal.util.xml - jdk.jfr - - - jdk.internal.util.xml.impl - jdk.jfr - - - jdk.internal.org.objectweb.asm - java.instrument - jdk.jfr - jdk.scripting.nashorn - jdk.vm.ci - - - jdk.internal.org.objectweb.asm.commons - java.instrument - jdk.jfr - jdk.scripting.nashorn - - - jdk.internal.org.objectweb.asm.signature - jdk.scripting.nashorn - - - jdk.internal.org.objectweb.asm.tree - java.instrument - jdk.jfr - - - jdk.internal.org.objectweb.asm.util - java.instrument - jdk.jfr - jdk.scripting.nashorn - - - jdk.internal.ref - java.desktop - - - jdk.internal - jdk.jfr - - - sun.misc - java.corba - java.desktop - java.instrument - java.logging - java.management - java.naming - java.prefs - java.rmi - java.security.jgss - java.security.sasl - java.xml - jdk.charsets - jdk.crypto.pkcs11 - jdk.httpserver - jdk.jartool - jdk.jconsole - jdk.jvmstat - jdk.management.resource - jdk.pack200 - jdk.scripting.nashorn - jdk.security.auth - jdk.security.jgss - jdk.snmp - jdk.vm.ci - jdk.zipfs - java.instrument - jdk.jfr - - - sun.net - java.httpclient - - - sun.net.dns - java.security.jgss - jdk.naming.dns - - - sun.net.sdp - jdk.net - - - sun.net.spi.nameservice - jdk.naming.dns - - - sun.net.util - java.desktop - jdk.jconsole - jdk.naming.dns - - - sun.net.www - java.desktop - jdk.compiler - jdk.jartool - - - sun.net.www.protocol.http - java.security.jgss - - - sun.nio.ch - java.management - jdk.crypto.pkcs11 - jdk.crypto.ucrypto - jdk.management.resource - jdk.net - jdk.sctp - - - sun.nio.cs - java.desktop - jdk.charsets - - - sun.reflect - java.corba - java.instrument - java.logging - java.sql - java.sql.rowset - jdk.dynalink - jdk.scripting.nashorn - jdk.vm.cds - - - sun.reflect.annotation - jdk.compiler - - - sun.reflect.generics.reflectiveObjects - java.desktop - - - sun.reflect.misc - java.corba - java.datatransfer - java.desktop - java.management - java.rmi - java.sql.rowset - java.xml - - - sun.security.action - java.desktop - java.security.jgss - jdk.crypto.ec - jdk.crypto.pkcs11 - jdk.crypto.ucrypto - - - sun.security.internal.interfaces - jdk.crypto.pkcs11 - - - sun.security.internal.spec - jdk.crypto.mscapi - jdk.crypto.pkcs11 - jdk.crypto.ucrypto - - - sun.security.jca - java.smartcardio - java.xml.crypto - jdk.crypto.ec - jdk.crypto.pkcs11 - jdk.crypto.ucrypto - jdk.naming.dns - - - sun.security.pkcs - jdk.crypto.ec - jdk.jartool - - - sun.security.provider - java.rmi - java.security.jgss - jdk.crypto.pkcs11 - jdk.jartool - jdk.policytool - jdk.security.auth - - - sun.security.provider.certpath - java.naming - - - sun.security.rsa - jdk.crypto.mscapi - jdk.crypto.pkcs11 - - - sun.security.ssl - java.security.jgss - - - sun.security.tools - jdk.jartool - - - sun.security.util - java.desktop - java.naming - java.rmi - java.security.jgss - java.security.sasl - java.smartcardio - jdk.crypto.ec - jdk.crypto.mscapi - jdk.crypto.pkcs11 - jdk.crypto.ucrypto - jdk.jartool - jdk.policytool - jdk.security.auth - jdk.security.jgss - - - sun.security.x509 - java.naming - jdk.crypto.ec - jdk.crypto.pkcs11 - jdk.jartool - jdk.security.auth - - - sun.text - java.desktop - - - sun.util - java.desktop - - - sun.util.locale.provider - java.desktop - jdk.localedata - - - jdk.internal.logger - java.logging - - - sun.util.logging - java.desktop - java.logging - java.management - java.prefs - java.httpclient - - - sun.util.resources - jdk.localedata - - - - java.compact1 - java.base - java.logging - java.scripting - - - java.compact2 - java.compact1 - java.rmi - java.sql - java.xml - - - java.compact3 - java.compact2 - java.compiler - java.instrument - java.httpclient - java.management - java.naming - java.prefs - java.security.jgss - java.security.sasl - java.sql.rowset - java.xml.crypto - - - java.compiler - java.base - java.logging - - javax.annotation.processing - - - javax.lang.model - - - javax.lang.model.element - - - javax.lang.model.type - - - javax.lang.model.util - - - javax.tools - - - - java.corba - java.base - java.desktop - java.logging - java.naming - java.rmi - java.transaction - - javax.activity - - - javax.rmi - - - javax.rmi.CORBA - - - org.omg.CORBA - - - org.omg.CORBA.DynAnyPackage - - - org.omg.CORBA.ORBPackage - - - org.omg.CORBA.TypeCodePackage - - - org.omg.CORBA.portable - - - org.omg.CORBA_2_3 - - - org.omg.CORBA_2_3.portable - - - org.omg.CosNaming - - - org.omg.CosNaming.NamingContextExtPackage - - - org.omg.CosNaming.NamingContextPackage - - - org.omg.Dynamic - - - org.omg.DynamicAny - - - org.omg.DynamicAny.DynAnyFactoryPackage - - - org.omg.DynamicAny.DynAnyPackage - - - org.omg.IOP - - - org.omg.IOP.CodecFactoryPackage - - - org.omg.IOP.CodecPackage - - - org.omg.Messaging - - - org.omg.PortableInterceptor - - - org.omg.PortableInterceptor.ORBInitInfoPackage - - - org.omg.PortableServer - - - org.omg.PortableServer.CurrentPackage - - - org.omg.PortableServer.POAManagerPackage - - - org.omg.PortableServer.POAPackage - - - org.omg.PortableServer.ServantLocatorPackage - - - org.omg.PortableServer.portable - - - org.omg.SendingContext - - - org.omg.stub.java.rmi - - - com.sun.corba.se.impl.util - jdk.rmic - - - - java.datatransfer - java.base - - java.awt.datatransfer - - - sun.datatransfer - java.desktop - - - - java.desktop - java.base - java.logging - java.prefs - java.xml - java.datatransfer - - java.applet - - - java.awt - - - java.awt.color - - - java.awt.dnd - - - java.awt.event - - - java.awt.font - - - java.awt.geom - - - java.awt.im - - - java.awt.im.spi - - - java.awt.image - - - java.awt.image.renderable - - - java.awt.print - - - java.beans - - - java.beans.beancontext - - - javax.accessibility - - - javax.imageio - - - javax.imageio.event - - - javax.imageio.metadata - - - javax.imageio.plugins.bmp - - - javax.imageio.plugins.jpeg - - - javax.imageio.spi - - - javax.imageio.stream - - - javax.print - - - javax.print.attribute - - - javax.print.attribute.standard - - - javax.print.event - - - javax.sound.midi - - - javax.sound.midi.spi - - - javax.sound.sampled - - - javax.sound.sampled.spi - - - javax.swing - - - javax.swing.border - - - javax.swing.colorchooser - - - javax.swing.event - - - javax.swing.filechooser - - - javax.swing.plaf - - - javax.swing.plaf.basic - - - javax.swing.plaf.metal - - - javax.swing.plaf.multi - - - javax.swing.plaf.nimbus - - - javax.swing.plaf.synth - - - javax.swing.table - - - javax.swing.text - - - javax.swing.text.html - - - javax.swing.text.html.parser - - - javax.swing.text.rtf - - - javax.swing.tree - - - javax.swing.undo - - - sun.awt - jdk.accessibility - - - - jdk.jshell - java.base - java.compiler - jdk.compiler - java.desktop - java.prefs - jdk.jdi - jdk.internal.le - - jdk.jshell - - - - jdk.jsobject - java.base - java.desktop - - netscape.javascript - - - jdk.internal.netscape.javascript.spi - jdk.plugin - - - - java.httpclient - java.base - - java.net.http - - - - java.instrument - java.base - - java.lang.instrument - - - jdk.internal.instrumentation - jdk.jfr - jdk.management.resource - - - - java.logging - java.base - - java.util.logging - - - - java.management - java.base - java.logging - java.naming - java.rmi - - java.lang.management - - - javax.management - - - javax.management.loading - - - javax.management.modelmbean - - - javax.management.monitor - - - javax.management.openmbean - - - javax.management.relation - - - javax.management.remote - - - javax.management.remote.rmi - - - javax.management.timer - - - sun.management - jdk.jconsole - jdk.management - - - sun.management.spi - jdk.management - jdk.management.cmm - jdk.management.jfr - - - - java.naming - java.base - java.security.sasl - - javax.naming - - - javax.naming.directory - - - javax.naming.event - - - javax.naming.ldap - - - javax.naming.spi - - - com.sun.jndi.toolkit.ctx - jdk.naming.dns - - - com.sun.jndi.toolkit.url - java.corba - jdk.naming.dns - jdk.naming.rmi - - - - java.prefs - java.base - java.xml - - java.util.prefs - - - - java.rmi - java.base - java.logging - - java.rmi - - - java.rmi.activation - - - java.rmi.dgc - - - java.rmi.registry - - - java.rmi.server - - - javax.rmi.ssl - - - sun.rmi.registry - java.management - - - sun.rmi.server - java.management - jdk.jconsole - - - sun.rmi.transport - java.management - jdk.jconsole - - - - java.scripting - java.base - - javax.script - - - - java.se - java.activation - java.compact3 - java.corba - java.datatransfer - java.desktop - java.transaction - java.xml.bind - java.xml.ws - - - java.security.jgss - java.base - java.naming - - javax.security.auth.kerberos - - - org.ietf.jgss - - - sun.security.jgss.krb5 - jdk.security.auth - - - sun.security.krb5 - jdk.security.auth - - - sun.security.krb5.internal.ktab - jdk.security.auth - - - sun.security.jgss - jdk.security.jgss - - - sun.security.krb5.internal - jdk.security.jgss - - - - java.security.sasl - java.base - java.logging - - javax.security.sasl - - - com.sun.security.sasl.util - jdk.security.jgss - - - - java.smartcardio - java.base - - javax.smartcardio - - - - java.sql - java.base - java.logging - java.xml - - java.sql - - - javax.sql - - - javax.transaction.xa - - - - java.sql.rowset - java.base - java.logging - java.naming - java.sql - java.xml - - javax.sql.rowset - - - javax.sql.rowset.serial - - - javax.sql.rowset.spi - - - - java.transaction - java.base - java.rmi - - javax.transaction - - - - java.xml - java.base - - javax.xml - - - javax.xml.catalog - - - javax.xml.datatype - - - javax.xml.namespace - - - javax.xml.parsers - - - javax.xml.stream - - - javax.xml.stream.events - - - javax.xml.stream.util - - - javax.xml.transform - - - javax.xml.transform.dom - - - javax.xml.transform.sax - - - javax.xml.transform.stax - - - javax.xml.transform.stream - - - javax.xml.validation - - - javax.xml.xpath - - - org.w3c.dom - - - org.w3c.dom.bootstrap - - - org.w3c.dom.events - - - org.w3c.dom.ls - - - org.w3c.dom.ranges - - - org.w3c.dom.traversal - - - org.w3c.dom.views - - - org.xml.sax - - - org.xml.sax.ext - - - org.xml.sax.helpers - - - com.sun.org.apache.xerces.internal.dom - java.xml.ws - - - com.sun.org.apache.xerces.internal.jaxp - java.xml.ws - - - com.sun.org.apache.xerces.internal.util - java.xml.ws - - - com.sun.org.apache.xml.internal.dtm - java.xml.crypto - - - com.sun.org.apache.xml.internal.resolver - java.xml.ws - jdk.xml.bind - - - com.sun.org.apache.xml.internal.resolver.tools - java.xml.ws - jdk.xml.bind - - - com.sun.org.apache.xml.internal.utils - java.xml.crypto - - - com.sun.org.apache.xpath.internal - java.xml.crypto - - - com.sun.org.apache.xpath.internal.compiler - java.xml.crypto - - - com.sun.org.apache.xpath.internal.functions - java.xml.crypto - - - com.sun.org.apache.xpath.internal.objects - java.xml.crypto - - - com.sun.org.apache.xpath.internal.res - java.xml.crypto - - - - java.xml.bind - java.activation - java.base - java.compiler - java.datatransfer - java.desktop - java.logging - java.xml - - javax.xml.bind - - - javax.xml.bind.annotation - - - javax.xml.bind.annotation.adapters - - - javax.xml.bind.attachment - - - javax.xml.bind.helpers - - - javax.xml.bind.util - - - com.sun.istack.internal - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.istack.internal.localization - java.xml.ws - jdk.xml.ws - - - com.sun.istack.internal.logging - java.xml.ws - jdk.xml.ws - - - com.sun.xml.internal.bind - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.annotation - jdk.xml.bind - - - com.sun.xml.internal.bind.api - java.xml.ws - jdk.xml.bind - - - com.sun.xml.internal.bind.api.impl - java.xml.ws - jdk.xml.bind - - - com.sun.xml.internal.bind.marshaller - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.unmarshaller - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.util - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.v2 - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.v2.model.annotation - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.v2.model.core - jdk.xml.bind - - - com.sun.xml.internal.bind.v2.model.impl - jdk.xml.bind - - - com.sun.xml.internal.bind.v2.model.nav - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.bind.v2.model.runtime - java.xml.ws - - - com.sun.xml.internal.bind.v2.model.util - jdk.xml.bind - - - com.sun.xml.internal.bind.v2.runtime - java.xml.ws - jdk.xml.bind - - - com.sun.xml.internal.bind.v2.runtime.unmarshaller - java.xml.ws - - - com.sun.xml.internal.bind.v2.schemagen - java.xml.ws - jdk.xml.bind - - - com.sun.xml.internal.bind.v2.schemagen.episode - jdk.xml.bind - - - com.sun.xml.internal.bind.v2.schemagen.xmlschema - java.xml.ws - - - com.sun.xml.internal.bind.v2.util - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.fastinfoset.stax - java.xml.ws - - - com.sun.xml.internal.fastinfoset.vocab - java.xml.ws - - - com.sun.xml.internal.org.jvnet.fastinfoset - java.xml.ws - - - com.sun.xml.internal.org.jvnet.mimepull - java.xml.ws - - - com.sun.xml.internal.org.jvnet.staxex - java.xml.ws - - - com.sun.xml.internal.org.jvnet.staxex.util - java.xml.ws - - - com.sun.xml.internal.txw2 - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.txw2.annotation - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - com.sun.xml.internal.txw2.output - java.xml.ws - jdk.xml.bind - jdk.xml.ws - - - - java.xml.crypto - java.base - java.logging - java.xml - - javax.xml.crypto - - - javax.xml.crypto.dom - - - javax.xml.crypto.dsig - - - javax.xml.crypto.dsig.dom - - - javax.xml.crypto.dsig.keyinfo - - - javax.xml.crypto.dsig.spec - - - - java.xml.ws - java.annotations.common - java.base - java.datatransfer - java.desktop - java.logging - java.management - java.rmi - java.activation - java.xml - java.xml.bind - jdk.httpserver - - javax.jws - - - javax.jws.soap - - - javax.xml.soap - - - javax.xml.ws - - - javax.xml.ws.handler - - - javax.xml.ws.handler.soap - - - javax.xml.ws.http - - - javax.xml.ws.soap - - - javax.xml.ws.spi - - - javax.xml.ws.spi.http - - - javax.xml.ws.wsaddressing - - - com.oracle.webservices.internal.api.databinding - jdk.xml.ws - - - com.sun.xml.internal.ws.addressing - jdk.xml.ws - - - com.sun.xml.internal.ws.addressing.v200408 - jdk.xml.ws - - - com.sun.xml.internal.ws.api - jdk.xml.ws - - - com.sun.xml.internal.ws.api.addressing - jdk.xml.ws - - - com.sun.xml.internal.ws.api.databinding - jdk.xml.ws - - - com.sun.xml.internal.ws.api.model - jdk.xml.ws - - - com.sun.xml.internal.ws.api.server - jdk.xml.ws - - - com.sun.xml.internal.ws.api.streaming - jdk.xml.ws - - - com.sun.xml.internal.ws.api.wsdl.parser - jdk.xml.ws - - - com.sun.xml.internal.ws.api.wsdl.writer - jdk.xml.ws - - - com.sun.xml.internal.ws.binding - jdk.xml.ws - - - com.sun.xml.internal.ws.db - jdk.xml.ws - - - com.sun.xml.internal.ws.model - jdk.xml.ws - - - com.sun.xml.internal.ws.policy.sourcemodel.wspolicy - jdk.xml.ws - - - com.sun.xml.internal.ws.spi.db - jdk.xml.ws - - - com.sun.xml.internal.ws.streaming - jdk.xml.ws - - - com.sun.xml.internal.ws.util - jdk.xml.ws - - - com.sun.xml.internal.ws.util.exception - jdk.xml.ws - - - com.sun.xml.internal.ws.util.xml - jdk.xml.ws - - - com.sun.xml.internal.ws.wsdl.parser - jdk.xml.ws - - - com.sun.xml.internal.ws.wsdl.writer - jdk.xml.ws - - - - jdk.attach - java.base - jdk.jvmstat - - com.sun.tools.attach - - - com.sun.tools.attach.spi - - - sun.tools.attach - jdk.jcmd - - - - jdk.charsets - java.base - - - jdk.compiler - java.base - java.compiler - - com.sun.source.doctree - - - com.sun.source.tree - - - com.sun.source.util - - - com.sun.tools.javac - - - com.sun.tools.doclint - jdk.javadoc - - - com.sun.tools.javac.api - jdk.jshell - jdk.javadoc - - - com.sun.tools.javac.code - jdk.jshell - jdk.javadoc - - - com.sun.tools.javac.comp - jdk.jshell - jdk.javadoc - - - com.sun.tools.javac.file - jdk.javadoc - jdk.jdeps - - - com.sun.tools.javac.jvm - jdk.jshell - jdk.javadoc - - - com.sun.tools.javac.main - jdk.jshell - jdk.javadoc - - - com.sun.tools.javac.nio - jdk.javadoc - - - com.sun.tools.javac.parser - jdk.jshell - - - com.sun.tools.javac.platform - jdk.javadoc - - - com.sun.tools.javac.sym - jdk.javadoc - - - com.sun.tools.javac.tree - jdk.jshell - jdk.javadoc - - - com.sun.tools.javac.util - jdk.jshell - jdk.javadoc - jdk.jdeps - - - com.sun.tools.javac.model - jdk.javadoc - - - - jdk.crypto.ec - java.base - - sun.security.ec - jdk.crypto.pkcs11 - - - - jdk.crypto.mscapi - java.base - - - jdk.crypto.pkcs11 - java.base - jdk.crypto.ec - - - jdk.crypto.ucrypto - java.base - - - jdk.dev - java.base - - - jdk.dynalink - java.base - java.logging - - jdk.dynalink - - - jdk.dynalink.beans - - - jdk.dynalink.linker - - - jdk.dynalink.linker.support - - - jdk.dynalink.support - - - - jdk.hotspot.agent - java.base - java.datatransfer - java.desktop - java.rmi - java.scripting - jdk.jdi - - - jdk.httpserver - java.base - java.logging - - com.sun.net.httpserver - - - com.sun.net.httpserver.spi - - - - jdk.internal.le - java.base - - jdk.internal.jline - jdk.jshell - jdk.scripting.nashorn.shell - - - jdk.internal.jline.console - jdk.jshell - jdk.scripting.nashorn.shell - - - jdk.internal.jline.console.completer - jdk.jshell - jdk.scripting.nashorn.shell - - - jdk.internal.jline.console.history - jdk.jshell - jdk.scripting.nashorn.shell - - - jdk.internal.jline.internal - jdk.jshell - jdk.scripting.nashorn.shell - - - - jdk.internal.opt - java.base - - - jdk.jartool - java.base - - com.sun.jarsigner - - - jdk.security.jarsigner - - - - jdk.javadoc - java.base - java.compiler - java.xml - jdk.compiler - - com.sun.javadoc - - - com.sun.tools.doclets - - - com.sun.tools.javadoc - - - jdk.javadoc.doclet - - - jdk.javadoc.doclet.taglet - - - - jdk.jcmd - java.base - jdk.attach - jdk.jvmstat - - - jdk.jconsole - java.base - java.desktop - java.logging - java.management - java.rmi - jdk.attach - jdk.jvmstat - jdk.management - - com.sun.tools.jconsole - - - - jdk.jdeps - java.base - java.compiler - java.xml - jdk.compiler - - - jdk.jdi - java.base - jdk.attach - - com.sun.jdi - - - com.sun.jdi.connect - - - com.sun.jdi.connect.spi - - - com.sun.jdi.event - - - com.sun.jdi.request - - - com.sun.tools.jdi - jdk.hotspot.agent - - - - jdk.jdwp.agent - java.base - - - jdk.jvmstat - java.base - - sun.jvmstat.monitor - jdk.attach - jdk.jcmd - jdk.jconsole - jdk.jvmstat.rmi - - - sun.jvmstat.monitor.event - jdk.jcmd - jdk.jvmstat.rmi - - - sun.jvmstat.perfdata.monitor - jdk.jvmstat.rmi - - - - jdk.jvmstat.rmi - java.base - java.rmi - jdk.jvmstat - - sun.jvmstat.monitor.remote - java.rmi - - - - jdk.localedata - java.base - - - jdk.management - java.base - java.management - - com.sun.management - - - - jdk.naming.dns - java.base - java.naming - - - jdk.naming.rmi - java.base - java.naming - java.rmi - - - jdk.pack200 - java.base - - - jdk.policytool - java.base - java.desktop - java.logging - java.management - java.security.jgss - java.sql - jdk.security.jgss - - - jdk.rmic - java.base - java.corba - jdk.compiler - jdk.javadoc - - - jdk.scripting.nashorn - java.base - java.logging - jdk.dynalink - java.scripting - - jdk.nashorn.internal.runtime - jdk.scripting.nashorn.shell - - - jdk.nashorn.internal.objects - jdk.scripting.nashorn.shell - - - jdk.nashorn.tools - jdk.scripting.nashorn.shell - - - jdk.nashorn.api.scripting - - - jdk.nashorn.api.tree - - - - jdk.scripting.nashorn.shell - java.base - jdk.scripting.nashorn - jdk.internal.le - java.desktop - java.compiler - - - jdk.sctp - java.base - - com.sun.nio.sctp - - - - jdk.security.auth - java.base - java.naming - java.security.jgss - - com.sun.security.auth - - - com.sun.security.auth.callback - - - com.sun.security.auth.login - - - com.sun.security.auth.module - - - - jdk.security.jgss - java.base - java.logging - java.security.jgss - java.security.sasl - - com.sun.security.jgss - - - - jdk.vm.ci - java.base - - jdk.vm.ci.hotspot - jdk.jfr - - - jdk.vm.ci.hotspot.events - jdk.jfr - - - - jdk.xml.bind - java.activation - java.base - java.compiler - java.datatransfer - java.desktop - java.logging - java.xml - java.xml.bind - jdk.compiler - - com.sun.codemodel.internal - jdk.xml.ws - - - com.sun.codemodel.internal.writer - jdk.xml.ws - - - com.sun.istack.internal.tools - jdk.xml.ws - - - com.sun.tools.internal.jxc.ap - jdk.xml.ws - - - com.sun.tools.internal.jxc.model.nav - jdk.xml.ws - - - com.sun.tools.internal.xjc - jdk.xml.ws - - - com.sun.tools.internal.xjc.api - jdk.xml.ws - - - com.sun.tools.internal.xjc.api.util - jdk.xml.ws - - - com.sun.tools.internal.xjc.reader - jdk.xml.ws - - - com.sun.tools.internal.xjc.reader.internalizer - jdk.xml.ws - - - com.sun.tools.internal.xjc.util - jdk.xml.ws - - - com.sun.xml.internal.xsom.parser - jdk.xml.ws - - - - jdk.xml.dom - java.base - java.xml - - org.w3c.dom.css - - - org.w3c.dom.html - - - org.w3c.dom.stylesheets - - - org.w3c.dom.xpath - - - - jdk.xml.ws - java.base - java.compiler - java.logging - java.rmi - java.xml - java.xml.bind - java.xml.ws - jdk.xml.bind - - - jdk.zipfs - java.base - - - jdk.accessibility - java.base - java.desktop - - diff --git a/test/lib/sun/hotspot/WhiteBox.java b/test/lib/sun/hotspot/WhiteBox.java index 668d2f00c1a..4eb5dfa4af3 100644 --- a/test/lib/sun/hotspot/WhiteBox.java +++ b/test/lib/sun/hotspot/WhiteBox.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2016, 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 @@ -32,7 +32,6 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.security.BasicPermission; import java.util.Objects; -import jdk.internal.HotSpotIntrinsicCandidate; import sun.hotspot.parser.DiagnosticCommand; @@ -211,8 +210,6 @@ public class WhiteBox { public native int deoptimizeFrames(boolean makeNotEntrant); public native void deoptimizeAll(); - @HotSpotIntrinsicCandidate - public void deoptimize() {} public boolean isMethodCompiled(Executable method) { return isMethodCompiled(method, false /*not osr*/); } @@ -422,6 +419,19 @@ public class WhiteBox { .findAny() .orElse(null); } + + // Jigsaw + public native void DefineModule(Object module, String version, String location, + Object[] packages); + public native void AddModuleExports(Object from_module, String pkg, Object to_module); + public native void AddReadsModule(Object from_module, Object source_module); + public native boolean CanReadModule(Object asking_module, Object source_module); + public native boolean IsExportedToModule(Object from_module, String pkg, Object to_module); + public native void AddModulePackage(Object module, String pkg); + public native void AddModuleExportsToAllUnnamed(Object module, String pkg); + public native void AddModuleExportsToAll(Object module, String pkg); + public native Object GetModuleByPackageName(Object ldr, String pkg); + public native int getOffsetForName0(String name); public int getOffsetForName(String name) throws Exception { int offset = getOffsetForName0(name); @@ -452,7 +462,7 @@ public class WhiteBox { public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue); // Sharing - public native boolean isSharedClass(Class c); public native boolean isShared(Object o); + public native boolean isSharedClass(Class c); public native boolean areSharedStringsIgnored(); }