Merge branch 'master' into 8044609-ssl

This commit is contained in:
Seán Coffey 2024-09-04 08:15:53 +00:00
commit 902453c63d
1947 changed files with 48637 additions and 26701 deletions

View File

@ -41,6 +41,6 @@ runs:
id: read-config
run: |
# Extract value from configuration file
value="$(grep -h ${{ inputs.var }}= make/conf/github-actions.conf | cut -d '=' -f 2-)"
value="$(grep -h '^${{ inputs.var }}'= make/conf/github-actions.conf | cut -d '=' -f 2-)"
echo "value=$value" >> $GITHUB_OUTPUT
shell: bash

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, 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
@ -45,6 +45,7 @@ runs:
jdk_bundle_tar_gz="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
symbols_bundle="$(ls build/*/bundles/jdk-*_bin${{ inputs.debug-suffix }}-symbols.tar.gz 2> /dev/null || true)"
tests_bundle="$(ls build/*/bundles/jdk-*_bin-tests${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
static_libs_bundle="$(ls build/*/bundles/jdk-*_bin-static-libs${{ inputs.debug-suffix }}.tar.gz 2> /dev/null || true)"
mkdir bundles
@ -60,8 +61,11 @@ runs:
if [[ "$tests_bundle" != "" ]]; then
mv "$tests_bundle" "bundles/tests-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
fi
if [[ "$static_libs_bundle" != "" ]]; then
mv "$static_libs_bundle" "bundles/static-libs-${{ inputs.platform }}${{ inputs.debug-suffix }}.tar.gz"
fi
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle" != "" ]]; then
if [[ "$jdk_bundle_zip$jdk_bundle_tar_gz$symbols_bundle$tests_bundle$static_libs_bundle" != "" ]]; then
echo 'bundles-found=true' >> $GITHUB_OUTPUT
else
echo 'bundles-found=false' >> $GITHUB_OUTPUT

112
.github/workflows/build-alpine-linux.yml vendored Normal file
View File

@ -0,0 +1,112 @@
#
# Copyright (c) 2024, 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.
#
name: 'Build (alpine-linux)'
on:
workflow_call:
inputs:
platform:
required: true
type: string
extra-conf-options:
required: false
type: string
make-target:
required: false
type: string
default: 'product-bundles test-bundles'
debug-levels:
required: false
type: string
default: '[ "debug", "release" ]'
apk-extra-packages:
required: false
type: string
configure-arguments:
required: false
type: string
make-arguments:
required: false
type: string
jobs:
build-linux:
name: build
runs-on: ubuntu-22.04
container:
image: alpine:3.20
strategy:
fail-fast: false
matrix:
debug-level: ${{ fromJSON(inputs.debug-levels) }}
include:
- debug-level: debug
flags: --with-debug-level=fastdebug
suffix: -debug+
steps:
- name: 'Checkout the JDK source'
uses: actions/checkout@v4
- name: 'Install toolchain and dependencies'
run: |
apk update
apk add alpine-sdk alsa-lib-dev autoconf bash cups-dev cups-libs fontconfig-dev freetype-dev grep libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev libxtst-dev linux-headers wget zip ${{ inputs.apk-extra-packages }}
- name: 'Get the BootJDK'
id: bootjdk
uses: ./.github/actions/get-bootjdk
with:
platform: alpine-linux-x64
- name: 'Configure'
run: >
bash configure
--with-conf-name=${{ inputs.platform }}
${{ matrix.flags }}
--with-version-opt=${GITHUB_ACTOR}-${GITHUB_SHA}
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
--with-zlib=system
--with-jmod-compress=zip-1
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
echo "Dumping config.log:" &&
cat config.log &&
exit 1)
- name: 'Build'
id: build
uses: ./.github/actions/do-build
with:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
- name: 'Upload bundles'
uses: ./.github/actions/upload-bundles
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 2024, 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
@ -133,8 +133,12 @@ jobs:
- name: 'Build'
id: build
uses: ./.github/actions/do-build
env:
# Only build static-libs-bundles for release builds.
# For debug builds, building static-libs often exceeds disk space.
STATIC_LIBS: ${{ matrix.debug-level == 'release' && 'static-libs-bundles' }}
with:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
make-target: '${{ inputs.make-target }} ${STATIC_LIBS} ${{ inputs.make-arguments }}'
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

View File

@ -36,7 +36,7 @@ on:
platforms:
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
required: true
default: 'linux-x64, linux-x86, linux-x64-variants, linux-cross-compile, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
default: 'linux-x64, linux-x86-hs, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
configure-arguments:
description: 'Additional configure arguments'
required: false
@ -57,11 +57,15 @@ jobs:
select:
name: 'Select platforms'
runs-on: ubuntu-22.04
env:
# List of platforms to exclude by default
EXCLUDED_PLATFORMS: 'alpine-linux-x64'
outputs:
linux-x64: ${{ steps.include.outputs.linux-x64 }}
linux-x86: ${{ steps.include.outputs.linux-x86 }}
linux-x86-hs: ${{ steps.include.outputs.linux-x86-hs }}
linux-x64-variants: ${{ steps.include.outputs.linux-x64-variants }}
linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
alpine-linux-x64: ${{ steps.include.outputs.alpine-linux-x64 }}
macos-x64: ${{ steps.include.outputs.macos-x64 }}
macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
windows-x64: ${{ steps.include.outputs.windows-x64 }}
@ -78,6 +82,10 @@ jobs:
# Returns 'true' if the input platform list matches any of the platform monikers given as argument,
# 'false' otherwise.
# arg $1: platform name or names to look for
# Convert EXCLUDED_PLATFORMS from a comma-separated string to an array
IFS=',' read -r -a excluded_array <<< "$EXCLUDED_PLATFORMS"
function check_platform() {
if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
input='${{ github.event.inputs.platforms }}'
@ -94,7 +102,13 @@ jobs:
normalized_input="$(echo ,$input, | tr -d ' ')"
if [[ "$normalized_input" == ",," ]]; then
# For an empty input, assume all platforms should run
# For an empty input, assume all platforms should run, except those in the EXCLUDED_PLATFORMS list
for excluded in "${excluded_array[@]}"; do
if [[ "$1" == "$excluded" ]]; then
echo 'false'
return
fi
done
echo 'true'
return
else
@ -105,15 +119,24 @@ jobs:
return
fi
done
# If not explicitly included, check against the EXCLUDED_PLATFORMS list
for excluded in "${excluded_array[@]}"; do
if [[ "$1" == "$excluded" ]]; then
echo 'false'
return
fi
done
fi
echo 'false'
}
echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
echo "linux-x86-hs=$(check_platform linux-x86-hs linux x86)" >> $GITHUB_OUTPUT
echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
echo "alpine-linux-x64=$(check_platform alpine-linux-x64 alpine-linux x64)" >> $GITHUB_OUTPUT
echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
@ -135,12 +158,13 @@ jobs:
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x64 == 'true'
build-linux-x86:
name: linux-x86
build-linux-x86-hs:
name: linux-x86-hs
needs: select
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x86
make-target: 'hotspot'
gcc-major-version: '10'
gcc-package-suffix: '-multilib'
apt-architecture: 'i386'
@ -150,7 +174,7 @@ jobs:
extra-conf-options: '--with-target-bits=32 --enable-fallback-linker --enable-libffi-bundling'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-x86 == 'true'
if: needs.select.outputs.linux-x86-hs == 'true'
build-linux-x64-hs-nopch:
name: linux-x64-hs-nopch
@ -220,6 +244,16 @@ jobs:
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.linux-cross-compile == 'true'
build-alpine-linux-x64:
name: alpine-linux-x64
needs: select
uses: ./.github/workflows/build-alpine-linux.yml
with:
platform: alpine-linux-x64
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
if: needs.select.outputs.alpine-linux-x64 == 'true'
build-macos-x64:
name: macos-x64
needs: select
@ -300,16 +334,6 @@ jobs:
bootjdk-platform: linux-x64
runs-on: ubuntu-22.04
test-linux-x86:
name: linux-x86
needs:
- build-linux-x86
uses: ./.github/workflows/test.yml
with:
platform: linux-x86
bootjdk-platform: linux-x64
runs-on: ubuntu-22.04
test-macos-x64:
name: macos-x64
needs:
@ -347,42 +371,39 @@ jobs:
if: always()
needs:
- build-linux-x64
- build-linux-x86
- build-linux-x86-hs
- build-linux-x64-hs-nopch
- build-linux-x64-hs-zero
- build-linux-x64-hs-minimal
- build-linux-x64-hs-optimized
- build-linux-cross-compile
- build-alpine-linux-x64
- build-macos-x64
- build-macos-aarch64
- build-windows-x64
- build-windows-aarch64
- test-linux-x64
- test-linux-x86
- test-macos-x64
- test-windows-x64
steps:
# Hack to get hold of the api environment variables that are only defined for actions
- name: 'Get API configuration'
id: api
uses: actions/github-script@v7
with:
script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
- name: 'Remove bundle artifacts'
run: |
# Find and remove all bundle artifacts
ALL_ARTIFACT_URLS="$(curl -s \
-H 'Accept: application/json;api-version=6.0-preview' \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
'${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
for url in $BUNDLE_ARTIFACT_URLS; do
echo "Removing $url"
curl -s \
-H 'Accept: application/json;api-version=6.0-preview' \
-H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
-X DELETE "$url" \
# See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28
ALL_ARTIFACT_IDS="$(curl -sL \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ${{ github.token }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
'${{ github.api_url }}/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts?per_page=100')"
BUNDLE_ARTIFACT_IDS="$(echo "$ALL_ARTIFACT_IDS" | jq -r -c '.artifacts | map(select(.name|startswith("bundles-"))) | .[].id')"
for id in $BUNDLE_ARTIFACT_IDS; do
echo "Removing $id"
curl -sL \
-X DELETE \
-H 'Accept: application/vnd.github+json' \
-H 'Authorization: Bearer ${{ github.token }}' \
-H 'X-GitHub-Api-Version: 2022-11-28' \
"${{ github.api_url }}/repos/${{ github.repository }}/actions/artifacts/$id" \
|| echo "Failed to remove bundle"
done

View File

@ -284,7 +284,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
ifeq ($(MACOSX_CODESIGN_MODE), hardened)
# Macosx release build and code signing available.
################################################################################
############################################################################
# JDK bundle
$(eval $(call SetupCopyFiles, CREATE_JDK_BUNDLE_DIR_SIGNED, \
SRC := $(JDK_IMAGE_DIR), \
@ -313,7 +313,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), )
PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
################################################################################
############################################################################
# JRE bundle
$(eval $(call SetupCopyFiles, CREATE_JRE_BUNDLE_DIR_SIGNED, \
SRC := $(JRE_IMAGE_DIR), \

View File

@ -65,7 +65,7 @@ $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.ja
$(SED) $(INTERIM_TOOL_PROVIDER_PATTERN) $< > $@
java.compiler.interim_EXTRA_FILES := \
$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java
TARGETS += $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.compiler.interim/javax/tools/ToolProvider.java

View File

@ -75,12 +75,12 @@ $(JDK_OUTPUTDIR)/modules/%_zh_HK.properties: $(JDK_OUTPUTDIR)/modules/%_zh_TW.pr
CreateHkTargets = \
$(call FilterExcludedTranslations, \
$(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
$(subst /share/classes,, \
$(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)) \
) \
), \
.properties \
$(patsubst $(TOPDIR)/src/%, $(JDK_OUTPUTDIR)/modules/%, \
$(subst /share/classes,, \
$(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $1)) \
) \
), \
.properties \
)
################################################################################

View File

@ -52,8 +52,7 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
build/tools/deps \
build/tools/docs \
build/tools/jigsaw \
build/tools/depend \
, \
build/tools/depend, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes, \
DISABLED_WARNINGS := dangling-doc-comments options, \
JAVAC_FLAGS := \
@ -66,17 +65,19 @@ $(eval $(call SetupJavaCompilation, BUILD_TOOLS_JDK, \
TARGETS += $(BUILD_TOOLS_JDK)
$(eval $(call SetupCopyFiles,COPY_NIMBUS_TEMPLATES, \
$(eval $(call SetupCopyFiles, COPY_NIMBUS_TEMPLATES, \
SRC := $(TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/generatenimbus/resources, \
FILES := $(wildcard $(TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template)))
FILES := $(wildcard $(TOPDIR)/src/java.desktop/share/classes/javax/swing/plaf/nimbus/*.template), \
))
TARGETS += $(COPY_NIMBUS_TEMPLATES)
$(eval $(call SetupCopyFiles,COPY_CLDRCONVERTER_PROPERTIES, \
$(eval $(call SetupCopyFiles, COPY_CLDRCONVERTER_PROPERTIES, \
SRC := $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes/build/tools/cldrconverter, \
FILES := $(wildcard $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter/*.properties)))
FILES := $(wildcard $(TOPDIR)/make/jdk/src/classes/build/tools/cldrconverter/*.properties), \
))
TARGETS += $(COPY_CLDRCONVERTER_PROPERTIES)

View File

@ -30,7 +30,7 @@ include MakeBase.gmk
include CopyFiles.gmk
##########################################################################################
################################################################################
### TZDB tool needs files from java.time.zone package
@ -41,12 +41,13 @@ define tzdb_copyfiles
< $(<) > $@
endef
$(eval $(call SetupCopyFiles,COPY_INTERIM_TZDB, \
$(eval $(call SetupCopyFiles, COPY_INTERIM_TZDB, \
SRC := $(TOPDIR)/src/java.base/share/classes/java/time/zone, \
DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_tzdb_classes/build/tools/tzdb, \
FILES := ZoneRules.java ZoneOffsetTransition.java ZoneOffsetTransitionRule.java Ser.java, \
MACRO := tzdb_copyfiles))
MACRO := tzdb_copyfiles, \
))
##########################################################################################
################################################################################
all: $(COPY_INTERIM_TZDB)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2024, 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
@ -229,8 +229,21 @@ ifeq ($(INTERIM_JMOD), true)
# Interim JMODs are not shipped anywhere, so there is no reason
# to compress them at all.
JMOD_FLAGS += --compress zip-0
JMOD_TARGET_OS := $(OPENJDK_BUILD_OS)
ifeq ($(JMOD_TARGET_OS), macosx)
JMOD_TARGET_OS := macos
endif
JMOD_TARGET_CPU := $(OPENJDK_BUILD_CPU)
ifeq ($(JMOD_TARGET_CPU), x86_64)
JMOD_TARGET_CPU := amd64
endif
JMOD_TARGET_PLATFORM := $(JMOD_TARGET_OS)-$(JMOD_TARGET_CPU)
else
JMOD_FLAGS += --compress $(JMOD_COMPRESS)
JMOD_TARGET_PLATFORM := $(OPENJDK_MODULE_TARGET_PLATFORM)
endif
# Create jmods in the support dir and then move them into place to keep the
@ -242,7 +255,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
--target-platform '$(JMOD_TARGET_PLATFORM)' \
--module-path $(JMODS_DIR) $(JMOD_FLAGS) \
--date $(SOURCE_DATE_ISO_8601) \
$(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \

View File

@ -1,4 +1,4 @@
# Copyright (c) 1997, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2024, 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
@ -247,7 +247,7 @@ define create_overview_file
<!DOCTYPE html> \
<html><head></head><body> \
#
ifneq ($$($1_GROUPS),)
ifneq ($$($1_GROUPS), )
$1_OVERVIEW_TEXT += \
<p>This document is divided into \
$$(subst 2,two,$$(subst 3,three,$$(words $$($1_GROUPS)))) sections:</p> \
@ -714,7 +714,7 @@ SPEC_HEADER_BLOCK := \
<div class="navbar"> \
<div>$(HEADER_RIGHT_SIDE_INFO)</div> \
<nav><ul><li><a href="PATH_TO_SPECS/../api/index.html">API</a> \
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS \
<li><a href="PATH_TO_SPECS/index.html">OTHER SPECIFICATIONS</a> \
<li><a href="PATH_TO_SPECS/man/index.html">TOOL GUIDES</a></ul></nav> \
</div> \
</header>

View File

@ -28,7 +28,7 @@
###
# Helper macro to allow $(info) to properly print strings beginning with spaces.
_:=
_ :=
help:
$(info )
@ -108,7 +108,7 @@ help:
$(info $(_) TEST_OPTS="OPT1=x;..." # Generic control of all test harnesses)
$(info $(_) TEST_VM_OPTS="ARG ..." # Same as setting TEST_OPTS to VM_OPTIONS="ARG ...")
$(info )
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))),\
$(if $(all_confs), $(info Available configurations in $(build_dir):) $(foreach var,$(all_confs),$(info * $(var))), \
$(info No configurations were found in $(build_dir).) $(info Run 'bash configure' to create a configuration.))
# We need a dummy rule otherwise make will complain
@true

View File

@ -134,11 +134,11 @@ CDS_DUMP_FLAGS = -Xmx128M -Xms128M
# Param1 - VM variant (e.g., server, client, zero, ...)
# Param2 - _nocoops, or empty
define CreateCDSArchive
$1_$2_DUMP_EXTRA_ARG := $(if $(filter _nocoops, $2),-XX:-UseCompressedOops,)
$1_$2_DUMP_TYPE := $(if $(filter _nocoops, $2),-NOCOOPS,)
$1_$2_DUMP_EXTRA_ARG := $(if $(filter _nocoops, $2), -XX:-UseCompressedOops, )
$1_$2_DUMP_TYPE := $(if $(filter _nocoops, $2), -NOCOOPS, )
# Only G1 supports dumping the shared heap, so explicitly use G1 if the JVM supports it.
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)),-XX:+UseG1GC)
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)), -XX:+UseG1GC)
ifeq ($(OPENJDK_TARGET_OS), windows)
$1_$2_CDS_ARCHIVE := bin/$1/classes$2.jsa
@ -235,7 +235,7 @@ endif
ifeq ($(GCOV_ENABLED), true)
$(eval $(call SetupCopyFiles,COPY_GCOV_GCNO, \
$(eval $(call SetupCopyFiles, COPY_GCOV_GCNO, \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \

View File

@ -37,7 +37,7 @@ default:
# serially, regardless of -j.
.NOTPARALLEL:
ifeq ($(HAS_SPEC),)
ifeq ($(HAS_SPEC), )
##############################################################################
# This is the default mode. We have not been recursively called with a SPEC.
##############################################################################
@ -168,7 +168,7 @@ ifeq ($(HAS_SPEC),)
endif
make-info:
ifneq ($(findstring $(LOG_LEVEL),info debug trace),)
ifneq ($(findstring $(LOG_LEVEL), info debug trace), )
$(info Running make as '$(strip $(MAKE) $(MFLAGS) \
$(COMMAND_LINE_VARIABLES) $(MAKECMDGOALS))')
endif

View File

@ -32,7 +32,7 @@
ifndef _INITSUPPORT_GMK
_INITSUPPORT_GMK := 1
ifeq ($(HAS_SPEC),)
ifeq ($(HAS_SPEC), )
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
@ -74,13 +74,13 @@ ifeq ($(HAS_SPEC),)
# Setup information about available configurations, if any.
ifneq ($(CUSTOM_ROOT), )
build_dir=$(CUSTOM_ROOT)/build
build_dir = $(CUSTOM_ROOT)/build
else
build_dir=$(topdir)/build
build_dir = $(topdir)/build
endif
all_spec_files=$(wildcard $(build_dir)/*/spec.gmk)
all_spec_files = $(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path
all_confs=$(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
all_confs = $(patsubst %/spec.gmk, %, $(patsubst $(build_dir)/%, %, $(all_spec_files)))
# Check for unknown command-line variables
define CheckControlVariables
@ -128,7 +128,7 @@ ifeq ($(HAS_SPEC),)
ifeq ($$(CONF_CHECK), )
# Default behavior is fail
CONF_CHECK := fail
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)),)
else ifneq ($$(filter-out auto fail ignore, $$(CONF_CHECK)), )
$$(info Error: CONF_CHECK must be one of: auto, fail or ignore.)
$$(error Cannot continue)
endif
@ -147,11 +147,11 @@ ifeq ($(HAS_SPEC),)
$$(info Error: Cannot use CONF_NAME=$$(CONF_NAME) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(error Cannot continue)
endif
ifeq ($$(wildcard $$(SPEC)),)
ifeq ($$(wildcard $$(SPEC)), )
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
$$(error Cannot continue)
endif
ifeq ($$(filter /%, $$(SPEC)),)
ifeq ($$(filter /%, $$(SPEC)), )
# If given with relative path, make it absolute
SPECS := $$(CURDIR)/$$(strip $$(SPEC))
else
@ -162,7 +162,7 @@ ifeq ($(HAS_SPEC),)
override SPEC :=
else
# Use spec.gmk files in the build output directory
ifeq ($$(all_spec_files),)
ifeq ($$(all_spec_files), )
ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else
@ -180,7 +180,7 @@ ifeq ($(HAS_SPEC),)
$$(error Cannot continue)
endif
matching_conf := $$(strip $$(filter $$(CONF_NAME), $$(all_confs)))
ifeq ($$(matching_conf),)
ifeq ($$(matching_conf), )
$$(info Error: No configurations found matching CONF_NAME=$$(CONF_NAME).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
@ -197,15 +197,15 @@ ifeq ($(HAS_SPEC),)
SPECS := $$(build_dir)/$$(matching_conf)/spec.gmk
else ifneq ($$(origin CONF), undefined)
# User have given a CONF= argument.
ifeq ($$(CONF),)
ifeq ($$(CONF), )
# If given CONF=, match all configurations
matching_confs := $$(strip $$(all_confs))
else
# Otherwise select those that contain the given CONF string
ifeq ($$(patsubst !%,,$$(CONF)),)
ifeq ($$(patsubst !%,,$$(CONF)), )
# A CONF starting with ! means we should negate the search term
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
$$(if $$(findstring $$(subst !,,$$(CONF)), $$(var)), ,$$(var))))
else
matching_confs := $$(strip $$(foreach var, $$(all_confs), \
$$(if $$(findstring $$(CONF), $$(var)), $$(var))))
@ -215,12 +215,12 @@ ifeq ($(HAS_SPEC),)
matching_confs := $$(CONF)
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS),)
ifeq ($$(MAKE_RESTARTS), )
$$(info Using exact match for CONF=$$(CONF) (other matches are possible))
endif
endif
endif
ifeq ($$(matching_confs),)
ifeq ($$(matching_confs), )
$$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations in $$(build_dir):)
$$(foreach var, $$(all_confs), $$(info * $$(var)))
@ -228,9 +228,9 @@ ifeq ($(HAS_SPEC),)
else
# Don't repeat this output on make restarts caused by including
# generated files.
ifeq ($$(MAKE_RESTARTS),)
ifeq ($$(MAKE_RESTARTS), )
ifeq ($$(words $$(matching_confs)), 1)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
$$(info Building configuration '$$(matching_confs)' (matching CONF=$$(CONF)))
endif
else
@ -272,7 +272,7 @@ ifeq ($(HAS_SPEC),)
# count.
main_targets_file := $$(dir $(strip $2))make-support/main-targets.gmk
ifeq ($$(MAKE_RESTARTS),)
ifeq ($$(MAKE_RESTARTS), )
# Only do this if make has not been restarted, and if we do not force it.
ifeq ($(strip $1), FORCE)
$$(shell rm -f $$(main_targets_file))
@ -316,9 +316,9 @@ else # $(HAS_SPEC)=true
BUILD_LOG_PIPE_SIMPLE := | $(TEE) -a $(BUILD_LOG)
ifneq ($(CUSTOM_ROOT), )
topdir=$(CUSTOM_ROOT)
topdir = $(CUSTOM_ROOT)
else
topdir=$(TOPDIR)
topdir = $(TOPDIR)
endif
# Setup the build environment to match the requested specification on
@ -349,39 +349,39 @@ else # $(HAS_SPEC)=true
ifneq ($$(findstring :, $$(COMPARE_BUILD)), )
$$(foreach part, $$(subst :, , $$(COMPARE_BUILD)), \
$$(if $$(filter PATCH=%, $$(part)), \
$$(eval COMPARE_BUILD_PATCH=$$(strip $$(patsubst PATCH=%, %, $$(part)))) \
$$(eval COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(part)))) \
) \
$$(if $$(filter CONF=%, $$(part)), \
$$(eval COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
$$(eval COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(part))))) \
) \
$$(if $$(filter MAKE=%, $$(part)), \
$$(eval COMPARE_BUILD_MAKE=$$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
$$(eval COMPARE_BUILD_MAKE = $$(strip $$(subst +, , $$(patsubst MAKE=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_OPTS=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_OPTS=$$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
$$(eval COMPARE_BUILD_COMP_OPTS = $$(strip $$(subst +, , $$(patsubst COMP_OPTS=%, %, $$(part))))) \
) \
$$(if $$(filter COMP_DIR=%, $$(part)), \
$$(eval COMPARE_BUILD_COMP_DIR=$$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
$$(eval COMPARE_BUILD_COMP_DIR = $$(strip $$(subst +, , $$(patsubst COMP_DIR=%, %, $$(part))))) \
) \
$$(if $$(filter FAIL=%, $$(part)), \
$$(eval COMPARE_BUILD_FAIL=$$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
$$(eval COMPARE_BUILD_FAIL = $$(strip $$(subst +, , $$(patsubst FAIL=%, %, $$(part))))) \
) \
$$(if $$(filter NODRYRUN=%, $$(part)), \
$$(eval COMPARE_BUILD_NODRYRUN=$$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
$$(eval COMPARE_BUILD_NODRYRUN = $$(strip $$(subst +, , $$(patsubst NODRYRUN=%, %, $$(part))))) \
) \
)
else
# Separate handling for single field case, to allow for spaces in values.
ifneq ($$(filter PATCH=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_PATCH=$$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
COMPARE_BUILD_PATCH = $$(strip $$(patsubst PATCH=%, %, $$(COMPARE_BUILD)))
else ifneq ($$(filter CONF=%, $$(COMPARE_BUILD)), )
COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(patsubst CONF=%, %, $$(COMPARE_BUILD))))
else ifneq ($$(filter --%, $$(COMPARE_BUILD)), )
# Assume CONF if value begins with --
COMPARE_BUILD_CONF=$$(strip $$(subst +, , $$(COMPARE_BUILD)))
COMPARE_BUILD_CONF = $$(strip $$(subst +, , $$(COMPARE_BUILD)))
else
# Otherwise assume patch file
COMPARE_BUILD_PATCH=$$(strip $$(COMPARE_BUILD))
COMPARE_BUILD_PATCH = $$(strip $$(COMPARE_BUILD))
endif
endif
ifneq ($$(COMPARE_BUILD_PATCH), )
@ -531,7 +531,7 @@ else # $(HAS_SPEC)=true
# used by build comparisons.
define WaitForJavacServerFinish
$(if $(JAVAC_SERVER_DIR), \
sleep 5\
sleep 5 \
)
endef
else
@ -544,7 +544,7 @@ else # $(HAS_SPEC)=true
##############################################################################
# Store the build times in this directory.
BUILDTIMESDIR=$(OUTPUTDIR)/make-support/build-times
BUILDTIMESDIR = $(OUTPUTDIR)/make-support/build-times
# Record starting time for build of a sub repository.
define RecordStartTime
@ -605,7 +605,7 @@ endif # HAS_SPEC
# $1: The option to look for
# $2: The variable to set to "true" if the option is found
define ParseLogOption
ifneq ($$(findstring $1, $$(LOG)),)
ifneq ($$(findstring $1, $$(LOG)), )
override $2 := true
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
@ -620,7 +620,7 @@ endef
# $1: The option to look for
# $2: The variable to set to the value of the option, if found
define ParseLogValue
ifneq ($$(findstring $1=, $$(LOG)),)
ifneq ($$(findstring $1=, $$(LOG)), )
# Make words of out comma-separated list and find the one with opt=val
value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
override $2 := $$(value)
@ -673,7 +673,7 @@ define ParseLogLevel
override LOG_LEVEL := $$(LOG)
ifeq ($$(LOG_LEVEL),)
ifeq ($$(LOG_LEVEL), )
# Set LOG to "warn" as default if not set
override LOG_LEVEL := warn
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
@ -46,10 +46,12 @@ $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, INTERIM_MODULES_LIST)
$(call LogWarn, Creating interim jimage)
$(RM) -r $(INTERIM_IMAGE_DIR)
$(JLINK_TOOL) \
$(call MakeDir, $(INTERIM_IMAGE_DIR))
$(call ExecuteWithLog, $(INTERIM_IMAGE_DIR)/jlink, \
$(JLINK_TOOL) \
--output $(INTERIM_IMAGE_DIR) \
--disable-plugin generate-jli-classes \
--add-modules $(INTERIM_MODULES_LIST)
--add-modules $(INTERIM_MODULES_LIST))
$(TOUCH) $@
TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)

View File

@ -67,7 +67,8 @@ $(eval $(call SetupJavaCompilation, BUILD_JRTFS, \
$(eval $(call SetupCopyFiles, COPY_JIMAGE_SERVICE_PROVIDER, \
SRC := $(TOPDIR)/src/java.base/share/classes, \
DEST := $(SUPPORT_OUTPUTDIR)/jrtfs_classes, \
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
FILES := META-INF/services/java.nio.file.spi.FileSystemProvider, \
))
$(eval $(call SetupJarArchive, BUILD_JRTFS_JAR, \
DEPENDENCIES := $(BUILD_JRTFS) $(COPY_JIMAGE_SERVICE_PROVIDER), \

View File

@ -31,7 +31,7 @@
# Declare default target
default:
ifeq ($(wildcard $(SPEC)),)
ifeq ($(wildcard $(SPEC)), )
$(error Main.gmk needs SPEC set to a proper spec.gmk)
endif
@ -278,6 +278,18 @@ $(eval $(call SetupTarget, eclipse-mixed-env, \
ARGS := --always-make, \
))
$(eval $(call SetupTarget, hotspot-xcode-project, \
MAKEFILE := ide/xcode/hotspot/CreateXcodeProject, \
TARGET := build, \
DEPS := hotspot compile-commands-hotspot jdk-image, \
))
$(eval $(call SetupTarget, open-hotspot-xcode-project, \
MAKEFILE := ide/xcode/hotspot/CreateXcodeProject, \
TARGET := open, \
DEPS := hotspot-xcode-project, \
))
ALL_TARGETS += $(HOTSPOT_VARIANT_TARGETS) $(HOTSPOT_VARIANT_GENSRC_TARGETS) \
$(HOTSPOT_VARIANT_LIBS_TARGETS) $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS)
@ -1402,7 +1414,7 @@ dist-clean: clean
($(CD) $(OUTPUTDIR) && \
$(RM) -r *spec.gmk $(CONFIGURESUPPORT_OUTPUTDIR) Makefile compare.sh ide \
configure.log* build.log*)
$(if $(filter $(CONF_NAME),$(notdir $(OUTPUTDIR))), \
$(if $(filter $(CONF_NAME), $(notdir $(OUTPUTDIR))), \
if test "x`$(LS) $(OUTPUTDIR)`" != x; then \
$(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
else \

View File

@ -175,7 +175,7 @@ define DeclareRecipesForPhaseAndModule
$$(foreach d, $$($1_$2_TOPDIRS), \
$$(eval $1 += $2-$$($1_TARGET_SUFFIX)-$$(notdir $$d)))
endif
ifeq ($(NO_RECIPES),)
ifeq ($(NO_RECIPES), )
$$(eval $$(call DeclareRecipeForModuleMakefile,$1,$2))
endif
$1 += $2-$$($1_TARGET_SUFFIX)
@ -197,8 +197,8 @@ endef
# $1_MODULES : All modules that had rules generated
# $1_TARGETS : All targets generated
define DeclareRecipesForPhase
$(foreach i,2 3 4 5 6 7 8, $(if $(strip $($i)),$(strip $1)_$(strip $($i)))$(NEWLINE))
$(if $(9),$(error Internal makefile error: Too many arguments to \
$(foreach i, 2 3 4 5 6 7 8, $(if $(strip $($i)),$(strip $1)_$(strip $($i)))$(NEWLINE))
$(if $(9), $(error Internal makefile error: Too many arguments to \
DeclareRecipesForPhase, please update MakeHelper.gmk))
$$(foreach m, $$($(strip $1)_CHECK_MODULES), \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
@ -104,7 +104,8 @@ ifneq ($(wildcard $(JTREG_FAILURE_HANDLER)), )
-observerDir:$(JTREG_FAILURE_HANDLER) \
-timeoutHandler:jdk.test.failurehandler.jtreg.GatherProcessInfoTimeoutHandler \
-observer:jdk.test.failurehandler.jtreg.GatherDiagnosticInfoObserver \
-timeoutHandlerTimeout:$(JTREG_FAILURE_HANDLER_TIMEOUT)
-timeoutHandlerTimeout:$(JTREG_FAILURE_HANDLER_TIMEOUT) \
#
endif
GTEST_LAUNCHER_DIRS := $(patsubst %/gtestLauncher, %, \
@ -500,7 +501,7 @@ define SetupRunGtestTestBody
endif
ifneq ($$(GTEST_REPEAT), )
$1_GTEST_REPEAT :=--gtest_repeat=$$(GTEST_REPEAT)
$1_GTEST_REPEAT := --gtest_repeat=$$(GTEST_REPEAT)
endif
run-test-$1: pre-run-test
@ -748,8 +749,6 @@ define SetupRunJtregTestBody
# we may end up with a lot of JVM's
$1_JTREG_MAX_RAM_PERCENTAGE := $$(shell $(AWK) 'BEGIN { print 25 / $$($1_JTREG_JOBS); }')
JTREG_TIMEOUT_FACTOR ?= 4
JTREG_VERBOSE ?= fail,error,summary
JTREG_RETAIN ?= fail,error
JTREG_TEST_THREAD_FACTORY ?=
@ -837,6 +836,24 @@ define SetupRunJtregTestBody
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$($1_JTREG_PROBLEM_LIST))
endif
JTREG_ALL_OPTIONS := $$(JTREG_JAVA_OPTIONS) $$(JTREG_VM_OPTIONS)
JTREG_AUTO_PROBLEM_LISTS :=
JTREG_AUTO_TIMEOUT_FACTOR := 4
ifneq ($$(findstring -Xcomp, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-Xcomp.txt
JTREG_AUTO_TIMEOUT_FACTOR := 10
endif
ifneq ($$(findstring -XX:+UseZGC, $$(JTREG_ALL_OPTIONS)), )
ifneq ($$(findstring -XX:-ZGenerational, $$(JTREG_ALL_OPTIONS)), )
JTREG_AUTO_PROBLEM_LISTS += ProblemList-zgc.txt
else
JTREG_AUTO_PROBLEM_LISTS += ProblemList-generational-zgc.txt
endif
endif
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
@ -868,6 +885,18 @@ define SetupRunJtregTestBody
$$(eval $$(call SetupRunJtregTestCustom, $1))
# SetupRunJtregTestCustom might also adjust JTREG_AUTO_ variables
# so set the final results after setting values from custom setup
ifneq ($$(JTREG_AUTO_PROBLEM_LISTS), )
# Accept both absolute paths as well as relative to the current test root.
$1_JTREG_BASIC_OPTIONS += $$(addprefix $$(JTREG_PROBLEM_LIST_PREFIX), $$(wildcard \
$$(JTREG_AUTO_PROBLEM_LISTS) \
$$(addprefix $$($1_TEST_ROOT)/, $$(JTREG_AUTO_PROBLEM_LISTS)) \
))
endif
JTREG_TIMEOUT_FACTOR ?= $$(JTREG_AUTO_TIMEOUT_FACTOR)
clean-outputdirs-$1:
$$(RM) -r $$($1_TEST_SUPPORT_DIR)
$$(RM) -r $$($1_TEST_RESULTS_DIR)

View File

@ -34,7 +34,7 @@ ifneq ($(findstring :, $(MAKE)), )
endif
# Locate this Makefile
ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
else
makefile_path := $(lastword $(MAKEFILE_LIST))
@ -67,7 +67,7 @@ define SetupVariable
ifneq ($$(findstring $$(LOG), info debug trace), )
$$(info Prebuilt variable $1=$2 (default value))
endif
$1:=$2
$1 := $2
endif
else
ifneq ($$(findstring $$(LOG), info debug trace), )
@ -163,7 +163,7 @@ else ifeq ($(UNAME_OS), MINGW64)
OPENJDK_TARGET_OS_TYPE := windows
OPENJDK_TARGET_OS_ENV := windows.msys2
else
OPENJDK_TARGET_OS_TYPE:=unix
OPENJDK_TARGET_OS_TYPE := unix
ifeq ($(UNAME_OS), Linux)
OPENJDK_TARGET_OS := linux
else ifeq ($(UNAME_OS), Darwin)

View File

@ -70,9 +70,9 @@ BUILD_JAVA_FLAGS := $(JAVA_FLAGS_BIG)
################################################################################
# Hard-coded values copied from spec.gmk.in.
X:=
SPACE:=$(X) $(X)
COMMA:=,
X :=
SPACE := $(X) $(X)
COMMA := ,
MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \
MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" LOG_LEVEL=$(LOG_LEVEL)
BASH_ARGS := -o pipefail -e

View File

@ -64,7 +64,7 @@ ifeq ($(USE_SCM), true)
# Verify that the entire forest is consistent
$(foreach repo, $(call FindAllReposRel), \
$(if $(wildcard $(TOPDIR)/$(repo)/$(SCM_DIR)),, \
$(if $(wildcard $(TOPDIR)/$(repo)/$(SCM_DIR)), , \
$(error Inconsistent revision control: $(repo) is missing $(SCM_DIR) directory)) \
)
@ -72,7 +72,7 @@ ifeq ($(USE_SCM), true)
MakeFilenameFromRepo = \
$(strip $(subst .,top, $(subst /,-, $1)))
################################################################################
##############################################################################
# SetupGetRevisionForRepo defines a make rule for creating a file containing
# the name of the repository and the output of the scm command for that
# repository.

View File

@ -41,9 +41,9 @@ ALL_MODULES = $(call FindAllModules)
TARGETS :=
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
IMAGE_DEST_DIR=$(STATIC_LIBS_IMAGE_DIR)/lib
IMAGE_DEST_DIR = $(STATIC_LIBS_IMAGE_DIR)/lib
else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), )
IMAGE_DEST_DIR=$(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib
IMAGE_DEST_DIR = $(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib
endif
# Copy JDK static libs to the image.

View File

@ -31,7 +31,7 @@ include MakeBase.gmk
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, TestImage-pre.gmk))
############################################################################
################################################################################
BUILD_INFO_PROPERTIES := $(TEST_IMAGE_DIR)/build-info.properties

View File

@ -42,6 +42,6 @@ BUILD_TOOLS_HOTSPOT := $(call SetupJavaCompilationCompileTarget, \
TOOL_JFR_GEN := $(JAVA_SMALL) -cp $(HOTSPOT_TOOLS_OUTPUTDIR) \
build.tools.jfr.GenerateJfrFiles
##########################################################################################
################################################################################
endif # _TOOLS_HOTSPOT_GMK

View File

@ -128,14 +128,14 @@ TOOL_PUBLICSUFFIXLIST = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_clas
TOOL_FIXUPPANDOC = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
build.tools.fixuppandoc.Main
##########################################################################################
################################################################################
# Executable javascript filter for man page generation using pandoc.
PANDOC_TROFF_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-troff-manpage-filter
PANDOC_HTML_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpage-filter
##########################################################################################
################################################################################
# Hook to include the corresponding custom post file, if present.
$(eval $(call IncludeCustomExtension, ToolsJdk-post.gmk))

View File

@ -29,11 +29,11 @@ include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
##########################################################################################
################################################################################
#
# sec-bin.zip is used by builds where the corresponding sources are not available
#
$(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
$(eval $(call SetupZipArchive, BUILD_SEC_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \
INCLUDES := \
modules/java.base/javax/crypto \
@ -60,20 +60,22 @@ $(eval $(call SetupZipArchive,BUILD_SEC_BIN_ZIP, \
modules/java.security.jgss/sun/security/krb5/internal/util, \
INCLUDE_FILES := modules/java.security.jgss/sun/security/jgss/spi/GSSContextSpi.class, \
EXCLUDES := modules/java.security.jgss/sun/security/krb5/internal/tools, \
ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip))
ZIP := $(IMAGES_OUTPUTDIR)/sec-bin.zip, \
))
TARGETS += $(IMAGES_OUTPUTDIR)/sec-bin.zip
##########################################################################################
################################################################################
#
# Windows specific binary security packages.
#
ifeq ($(call isTargetOs, windows), true)
# sec-windows-bin.zip is used by builds where the corresponding sources are not available
$(eval $(call SetupZipArchive,BUILD_SEC_WINDOWS_BIN_ZIP, \
$(eval $(call SetupZipArchive, BUILD_SEC_WINDOWS_BIN_ZIP, \
SRC := $(JDK_OUTPUTDIR), \
INCLUDES := modules/java.security.jgss/sun/security/krb5/internal/tools, \
ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip))
ZIP := $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip, \
))
TARGETS += $(IMAGES_OUTPUTDIR)/sec-windows-bin.zip
@ -84,18 +86,19 @@ ifeq ($(call isTargetOs, windows), true)
JGSS_ZIP_NAME = jgss-windows-i586-bin.zip
endif
$(eval $(call SetupZipArchive,BUILD_JGSS_BIN_ZIP, \
$(eval $(call SetupZipArchive, BUILD_JGSS_BIN_ZIP, \
SRC := $(SUPPORT_OUTPUTDIR), \
INCLUDE_FILES := modules_libs/java.security.jgss/w2k_lsa_auth.dll \
modules_libs/java.security.jgss/w2k_lsa_auth.dll.diz \
modules_libs/java.security.jgss/w2k_lsa_auth.dll.map \
modules_libs/java.security.jgss/w2k_lsa_auth.dll.pdb, \
ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)))
ZIP := $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME), \
))
TARGETS += $(IMAGES_OUTPUTDIR)/$(JGSS_ZIP_NAME)
endif
##########################################################################################
################################################################################
all: $(TARGETS)

View File

@ -23,5 +23,5 @@
# This Makefile was generated by configure @DATE_WHEN_CONFIGURED@
# GENERATED FILE, DO NOT EDIT
SPEC:=@OUTPUTDIR@/spec.gmk
SPEC := @OUTPUTDIR@/spec.gmk
include @WORKSPACE_ROOT@/Makefile

View File

@ -26,7 +26,7 @@
m4_include([basic_tools.m4])
m4_include([basic_windows.m4])
###############################################################################
################################################################################
AC_DEFUN_ONCE([BASIC_INIT],
[
# Save the original command line. This is passed to us by the wrapper configure script.
@ -46,7 +46,7 @@ AC_DEFUN_ONCE([BASIC_INIT],
AC_MSG_NOTICE([Configuration created at $DATE_WHEN_CONFIGURED.])
])
###############################################################################
################################################################################
# Check that there are no unprocessed overridden variables left.
# If so, they are an incorrect argument and we will exit with an error.
AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
@ -58,7 +58,7 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
fi
])
###############################################################################
################################################################################
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
# Make sure to only use tools set up in BASIC_SETUP_FUNDAMENTAL_TOOLS.
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
@ -102,7 +102,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
AUTOCONF_DIR=$TOPDIR/make/autoconf
])
###############################################################################
################################################################################
# Setup what kind of build environment type we have (CI or local developer)
AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
[
@ -141,7 +141,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_BUILD_ENV],
AC_SUBST(LOCALE_USED)
])
###############################################################################
################################################################################
# Evaluates platform specific overrides for devkit variables.
# $1: Name of variable
AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
@ -151,7 +151,7 @@ AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
fi
])
###############################################################################
################################################################################
# Evaluates platform specific overrides for build devkit variables.
# $1: Name of variable
AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
@ -161,7 +161,7 @@ AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
fi
])
###############################################################################
################################################################################
AC_DEFUN([BASIC_SETUP_XCODE_SYSROOT],
[
AC_MSG_CHECKING([for sdk name])
@ -246,7 +246,7 @@ AC_DEFUN([BASIC_SETUP_XCODE_SYSROOT],
fi
])
###############################################################################
################################################################################
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
[
AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
@ -380,7 +380,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
AC_MSG_RESULT([$EXTRA_PATH])
])
###############################################################################
################################################################################
AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
[
@ -477,7 +477,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.template])
])
###############################################################################
################################################################################
# Check if build directory is on local disk. If not possible to determine,
# we prefer to claim it's local.
# Argument 1: directory to test
@ -514,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
fi
])
###############################################################################
################################################################################
# Check that source files have basic read permissions set. This might
# not be the case in cygwin in certain conditions.
AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
@ -529,7 +529,7 @@ AC_DEFUN_ONCE([BASIC_CHECK_SRC_PERMS],
fi
])
###############################################################################
################################################################################
AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
[
AC_MSG_CHECKING([if build directory is on local disk])
@ -572,7 +572,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_MAKE_TARGET],
AC_SUBST(DEFAULT_MAKE_TARGET)
])
###############################################################################
################################################################################
# Setup the default value for LOG=
#
AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_LOG],
@ -591,7 +591,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEFAULT_LOG],
AC_SUBST(DEFAULT_LOG)
])
###############################################################################
################################################################################
# Code to run after AC_OUTPUT
AC_DEFUN_ONCE([BASIC_POST_CONFIG_OUTPUT],
[

View File

@ -23,12 +23,12 @@
# questions.
#
###############################################################################
################################################################################
# It is recommended to use exactly this version of pandoc, especially for
# re-generating checked in html files
RECOMMENDED_PANDOC_VERSION=2.19.2
###############################################################################
################################################################################
# Setup the most fundamental tools, used for setting up build platform and
# path handling.
AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
@ -59,7 +59,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS],
UTIL_LOOKUP_PROGS(CMD, cmd.exe, $PATH:/cygdrive/c/windows/system32:/mnt/c/windows/system32:/c/windows/system32)
])
###############################################################################
################################################################################
# Setup further tools that should be resolved early but after setting up
# build platform and path handling.
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
@ -116,7 +116,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
RM="$RM -f"
])
###############################################################################
################################################################################
# Check if we have found a usable version of make
# $1: the path to a potential make binary (or empty)
# $2: the description on how we found this
@ -129,7 +129,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
MAKE_VERSION_EXPR="-e 4\."
MAKE_REQUIRED_VERSION="4.0"
else
else
MAKE_VERSION_EXPR="-e 3\.8[[12]] -e 4\."
MAKE_REQUIRED_VERSION="3.81"
fi
@ -176,7 +176,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
fi
])
###############################################################################
################################################################################
AC_DEFUN([BASIC_CHECK_MAKE_OUTPUT_SYNC],
[
# Check if make supports the output sync option and if so, setup using it.
@ -201,7 +201,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_OUTPUT_SYNC],
AC_SUBST(OUTPUT_SYNC)
])
###############################################################################
################################################################################
# Goes looking for a usable version of GNU make.
AC_DEFUN([BASIC_CHECK_GNU_MAKE],
[
@ -249,7 +249,7 @@ AC_DEFUN([BASIC_CHECK_GNU_MAKE],
BASIC_CHECK_MAKE_OUTPUT_SYNC
])
###############################################################################
################################################################################
AC_DEFUN([BASIC_CHECK_FIND_DELETE],
[
# Test if find supports -delete
@ -278,7 +278,7 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE],
AC_SUBST(FIND_DELETE)
])
###############################################################################
################################################################################
AC_DEFUN([BASIC_CHECK_TAR],
[
# Test which kind of tar was found
@ -316,7 +316,7 @@ AC_DEFUN([BASIC_CHECK_TAR],
AC_SUBST(TAR_SUPPORTS_TRANSFORM)
])
###############################################################################
################################################################################
AC_DEFUN([BASIC_CHECK_GREP],
[
# Test that grep supports -Fx with a list of pattern which includes null pattern.
@ -340,7 +340,7 @@ AC_DEFUN([BASIC_CHECK_GREP],
fi
])
###############################################################################
################################################################################
AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
[
BASIC_CHECK_GNU_MAKE
@ -412,7 +412,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS],
fi
])
###############################################################################
################################################################################
# Check for support for specific options in bash
AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS],
[

View File

@ -23,7 +23,7 @@
# questions.
#
########################################################################
################################################################################
# This file handles detection of the Boot JDK. The Boot JDK detection
# process has been developed as a response to solve a complex real-world
# problem. Initially, it was simple, but it has grown as platform after
@ -49,7 +49,7 @@
# JDK, and if one is found, check if it is acceptable. If not, we print
# our reasons for rejecting it (useful when debugging non-working
# configure situations) and continue checking the next one.
########################################################################
################################################################################
# Execute the check given as argument, and verify the result
# If the Boot JDK was previously found, do nothing
@ -322,7 +322,7 @@ AC_DEFUN([BOOTJDK_SETUP_CLASSPATH],
AC_SUBST(CLASSPATH)
])
###############################################################################
################################################################################
#
# We need a Boot JDK to bootstrap the build.
#
@ -602,11 +602,12 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
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])
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
])
EXTERNAL_BUILDJDK=true
else
if test "x$COMPILE_TYPE" = "xcross"; then

View File

@ -34,10 +34,10 @@ include @SPEC@
BOOT_JDK := $(JDK_IMAGE_DIR)
# The bootcycle build has a different output directory
OLD_OUTPUTDIR:=@OUTPUTDIR@
OUTPUTDIR:=$(OLD_OUTPUTDIR)/bootcycle-build
OLD_OUTPUTDIR := @OUTPUTDIR@
OUTPUTDIR := $(OLD_OUTPUTDIR)/bootcycle-build
# No spaces in patsubst to avoid leading space in variable
JAVAC_SERVER_DIR:=$(patsubst $(OLD_OUTPUTDIR)%,$(OUTPUTDIR)%,$(JAVAC_SERVER_DIR))
JAVAC_SERVER_DIR := $(patsubst $(OLD_OUTPUTDIR)%,$(OUTPUTDIR)%,$(JAVAC_SERVER_DIR))
JAVA_CMD := $(FIXPATH) $(BOOT_JDK)/bin/java
JAVAC_CMD := $(FIXPATH) $(BOOT_JDK)/bin/javac
@ -48,4 +48,3 @@ JAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@
# By filtering out those JVM args, the bootcycle JVM will use its default
# settings for CDS.
JAVA_FLAGS := $(filter-out -XX:SharedArchiveFile% -Xshare%, $(JAVA_FLAGS))

View File

@ -26,7 +26,7 @@
# the root of the build directory.
##########################################################################################
################################################################################
# Substitutions from autoconf
export LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@

View File

@ -23,11 +23,11 @@
# questions.
#
###############################################################################
################################################################################
#
# Includes and boilerplate
#
###############################################################################
################################################################################
AC_PREREQ([2.69])
@ -63,14 +63,14 @@ m4_include([platform.m4])
m4_include([source-dirs.m4])
m4_include([toolchain.m4])
###############################################################################
################################################################################
#
# Initialization / Boot-strapping
#
# The bootstrapping process needs to solve the "chicken or the egg" problem,
# thus it jumps back and forth, each time gaining something needed later on.
#
###############################################################################
################################################################################
# If we are requested to print additional help, do that and then exit.
# This must be the very first call.
@ -128,51 +128,51 @@ PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
BASIC_SETUP_DEFAULT_MAKE_TARGET
BASIC_SETUP_DEFAULT_LOG
###############################################################################
################################################################################
#
# Determine OpenJDK variants and version numbers.
#
###############################################################################
################################################################################
# We need build & target for this.
JDKOPT_SETUP_JMOD_OPTIONS
JDKOPT_SETUP_JLINK_OPTIONS
JDKVER_SETUP_JDK_VERSION_NUMBERS
###############################################################################
################################################################################
#
# Setup BootJDK, used to bootstrap the build.
#
###############################################################################
################################################################################
BOOTJDK_SETUP_BOOT_JDK
BOOTJDK_SETUP_BUILD_JDK
BOOTJDK_SETUP_DOCS_REFERENCE_JDK
###############################################################################
################################################################################
#
# Determine JDK specific build time options.
#
###############################################################################
################################################################################
JDKOPT_SETUP_REPRODUCIBLE_BUILD
JDKOPT_SETUP_JDK_OPTIONS
###############################################################################
################################################################################
#
# Configure the sources to use. We can add or override individual directories.
#
###############################################################################
################################################################################
SRCDIRS_SETUP_DIRS
SRCDIRS_SETUP_IMPORT_MODULES
###############################################################################
################################################################################
#
# Setup the toolchain (compilers etc), i.e. tools used to compile and process
# native code.
#
###############################################################################
################################################################################
# See if we are doing a complete static build or not
JDKOPT_SETUP_STATIC_BUILD
@ -227,31 +227,31 @@ JDKOPT_SETUP_LEAK_SANITIZER
# This needs to go before 'LIB_DETERMINE_DEPENDENCIES'
JDKOPT_SETUP_FALLBACK_LINKER
###############################################################################
################################################################################
#
# Check dependencies for external and internal libraries.
#
###############################################################################
################################################################################
LIB_DETERMINE_DEPENDENCIES
LIB_SETUP_LIBRARIES
###############################################################################
################################################################################
#
# Setup hotspot and JVM features (needs toolchain).
#
###############################################################################
################################################################################
JVM_FEATURES_PARSE_OPTIONS
JVM_FEATURES_SETUP
HOTSPOT_SETUP_MISC
###############################################################################
################################################################################
#
# We need to do some final tweaking, when everything else is done.
#
###############################################################################
################################################################################
LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER
LIB_TESTS_ENABLE_DISABLE_JTREG_TEST_THREAD_FACTORY
@ -263,12 +263,12 @@ JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE
JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT
JDKOPT_SETUP_MACOSX_SIGNING
###############################################################################
################################################################################
#
# Configure parts of the build that only affect the build performance,
# not the result.
#
###############################################################################
################################################################################
BPERF_SETUP_BUILD_CORES
BPERF_SETUP_BUILD_MEMORY
@ -288,11 +288,11 @@ BPERF_SETUP_PRECOMPILED_HEADERS
# Setup use of ccache, if available
BPERF_SETUP_CCACHE
###############################################################################
################################################################################
#
# And now the finish...
#
###############################################################################
################################################################################
# Check for some common pitfalls
BASIC_TEST_USABILITY_ISSUES
@ -313,9 +313,11 @@ AC_OUTPUT
# After AC_OUTPUT, we need to do final work
CUSTOM_CONFIG_OUTPUT_GENERATED_HOOK
BASIC_POST_CONFIG_OUTPUT
# Finally output some useful information to the user
HELP_PRINT_SUMMARY_AND_WARNINGS
CUSTOM_SUMMARY_AND_WARNINGS_HOOK
HELP_REPEAT_WARNINGS
# All output is done. Do the post-config output management.
BASIC_POST_CONFIG_OUTPUT

View File

@ -235,14 +235,16 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
# Additional warnings that are not activated by -Wall and -Wextra
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare \
-Wunused-function -Wundef -Wunused-value -Wreturn-type \
-Wtrampolines"
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare \
-Wtrampolines -Wundef -Wunused-const-variable=1 -Wunused-function \
-Wunused-result -Wunused-value"
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
DISABLED_WARNINGS="unused-parameter unused"
# These warnings will never be turned on, since they generate too many
# false positives.
DISABLED_WARNINGS="unused-parameter"
# gcc10/11 on ppc generate lots of abi warnings about layout of aggregates containing vectors
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
DISABLED_WARNINGS="$DISABLED_WARNINGS psabi"
@ -259,7 +261,9 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
-Wunused-function -Wundef -Wunused-value -Woverloaded-virtual"
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
DISABLED_WARNINGS="unknown-warning-option unused-parameter unused"
# These warnings will never be turned on, since they generate too many
# false positives.
DISABLED_WARNINGS="unknown-warning-option unused-parameter"
;;
esac
AC_SUBST(DISABLE_WARNING_PREFIX)
@ -476,7 +480,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# Always enable optional macros for VM.
ALWAYS_CFLAGS_JVM="-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"
###############################################################################
##############################################################################
# Adjust flags according to debug level.
# Setup debug/release defines
@ -510,7 +514,7 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
ALWAYS_DEFINES_JVM="$ALWAYS_DEFINES -DNOMINMAX"
fi
###############################################################################
##############################################################################
#
#
# CFLAGS BASIC

View File

@ -71,7 +71,9 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
LDFLAGS_CXX_PARTIAL_LINKING="$MACHINE_FLAG -r"
if test "x$OPENJDK_TARGET_OS" = xlinux; then
# Clang needs the lld linker to work correctly
BASIC_LDFLAGS="-fuse-ld=lld -Wl,--exclude-libs,ALL"
UTIL_REQUIRE_PROGS(LLD, lld)
fi
if test "x$OPENJDK_TARGET_OS" = xaix; then
BASIC_LDFLAGS="-Wl,-b64 -Wl,-brtl -Wl,-bnorwexec -Wl,-bnolibpath -Wl,-bnoexpall \
@ -166,9 +168,9 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
# MIPS ABI does not support GNU hash style
if test "x${OPENJDK_$1_CPU}" = xmips ||
test "x${OPENJDK_$1_CPU}" = xmipsel ||
test "x${OPENJDK_$1_CPU}" = xmips64 ||
test "x${OPENJDK_$1_CPU}" = xmips64el; then
test "x${OPENJDK_$1_CPU}" = xmipsel ||
test "x${OPENJDK_$1_CPU}" = xmips64 ||
test "x${OPENJDK_$1_CPU}" = xmips64el; then
$1_CPU_LDFLAGS="${$1_CPU_LDFLAGS} -Wl,--hash-style=sysv"
else
$1_CPU_LDFLAGS="${$1_CPU_LDFLAGS} -Wl,--hash-style=gnu"

View File

@ -26,7 +26,7 @@
# All valid JVM variants
VALID_JVM_VARIANTS="server client minimal core zero custom"
###############################################################################
################################################################################
# Check if the specified JVM variant should be built. To be used in shell if
# constructs, like this:
# if HOTSPOT_CHECK_JVM_VARIANT(server); then
@ -38,7 +38,7 @@ VALID_JVM_VARIANTS="server client minimal core zero custom"
AC_DEFUN([HOTSPOT_CHECK_JVM_VARIANT],
[ [ [[ " $JVM_VARIANTS " =~ " $1 " ]] ] ])
###############################################################################
################################################################################
# Check which variants of the JVM that we want to build. Available variants are:
# server: normal interpreter, and a tiered C1/C2 compiler
# client: normal interpreter, and C1 (no C2 compiler)
@ -102,7 +102,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
AC_SUBST(JVM_VARIANT_MAIN)
])
###############################################################################
################################################################################
# Misc hotspot setup that does not fit elsewhere.
#
AC_DEFUN_ONCE([HOTSPOT_SETUP_MISC],

View File

@ -23,7 +23,7 @@
# questions.
#
###############################################################################
################################################################################
# Set the debug level
# release: no debug information, all optimizations, no asserts.
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
@ -81,7 +81,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
AC_SUBST(DEBUG_LEVEL)
])
###############################################################################
################################################################################
#
# Should we build only OpenJDK even if closed sources are present?
#
@ -235,8 +235,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
else
HOTSPOT_OVERRIDE_LIBPATH=${with_jni_libpath}
if test "x$OPENJDK_TARGET_OS" != "xlinux" &&
test "x$OPENJDK_TARGET_OS" != "xbsd" &&
test "x$OPENJDK_TARGET_OS" != "xaix"; then
test "x$OPENJDK_TARGET_OS" != "xbsd" &&
test "x$OPENJDK_TARGET_OS" != "xaix"; then
AC_MSG_RESULT([fail])
AC_MSG_ERROR([Overriding JNI library path is supported only on Linux, BSD and AIX.])
fi
@ -246,7 +246,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
])
###############################################################################
################################################################################
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
[
@ -410,7 +410,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_CODE_COVERAGE],
AC_SUBST(JCOV_FILTERS)
])
###############################################################################
################################################################################
#
# AddressSanitizer
#
@ -421,8 +421,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
CHECK_AVAILABLE: [
AC_MSG_CHECKING([if AddressSanitizer (asan) is available])
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
test "x$TOOLCHAIN_TYPE" = "xclang" ||
test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
test "x$TOOLCHAIN_TYPE" = "xclang" ||
test "x$TOOLCHAIN_TYPE" = "xmicrosoft"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@ -431,7 +431,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
],
IF_ENABLED: [
if test "x$TOOLCHAIN_TYPE" = "xgcc" ||
test "x$TOOLCHAIN_TYPE" = "xclang"; then
test "x$TOOLCHAIN_TYPE" = "xclang"; then
# ASan is simply incompatible with gcc -Wstringop-truncation. See
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85650
# It's harmless to be suppressed in clang as well.
@ -467,7 +467,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_ADDRESS_SANITIZER],
AC_SUBST(ASAN_ENABLED)
])
###############################################################################
################################################################################
#
# LeakSanitizer
#
@ -500,7 +500,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_LEAK_SANITIZER],
AC_SUBST(LSAN_ENABLED)
])
###############################################################################
################################################################################
#
# UndefinedBehaviorSanitizer
#
@ -707,9 +707,8 @@ AC_DEFUN([JDKOPT_ALLOW_ABSOLUTE_PATHS_IN_OUTPUT],
[
AC_ARG_ENABLE([absolute-paths-in-output],
[AS_HELP_STRING([--disable-absolute-paths-in-output],
[Set to disable to prevent any absolute paths from the build to end up in
any of the build output. @<:@disabled in release builds, otherwise enabled@:>@])
])
[Set to disable to prevent any absolute paths from the build to end up in
any of the build output. @<:@disabled in release builds, otherwise enabled@:>@])])
AC_MSG_CHECKING([if absolute paths should be allowed in the build output])
if test "x$enable_absolute_paths_in_output" = "xno"; then

View File

@ -23,7 +23,7 @@
# questions.
#
###############################################################################
################################################################################
#
# Setup version numbers
#
@ -93,7 +93,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
UTIL_ARG_WITH(NAME: jdk-rc-name, TYPE: string,
DEFAULT: $PRODUCT_NAME $JDK_RC_PLATFORM_NAME,
DESC: [Set JDK RC name. This is used for FileDescription and ProductName
properties of MS Windows binaries.],
properties of MS Windows binaries.],
DEFAULT_DESC: [from branding.conf],
CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
AC_SUBST(JDK_RC_NAME)
@ -105,7 +105,7 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
RESULT: COMPANY_NAME,
DEFAULT: $COMPANY_NAME,
DESC: [Set vendor name. Among others, used to set the 'java.vendor'
and 'java.vm.vendor' system properties.],
and 'java.vm.vendor' system properties.],
DEFAULT_DESC: [from branding.conf],
CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
AC_SUBST(COMPANY_NAME)

View File

@ -23,7 +23,7 @@
# questions.
#
###############################################################################
################################################################################
# Terminology used in this file:
#
# Valid features == All possible features that the JVM knows about.
@ -36,7 +36,7 @@
#
# All valid features are considered available, unless listed as unavailable.
# All available features will be turned on as default, unless listed in a filter.
###############################################################################
################################################################################
# We need these as m4 defines to be able to loop over them using m4 later on.
@ -78,7 +78,7 @@ m4_define(jvm_feature_desc_vm_structs, [export JVM structures to the Serviceabli
m4_define(jvm_feature_desc_zero, [support building variant 'zero'])
m4_define(jvm_feature_desc_zgc, [include the Z garbage collector])
###############################################################################
################################################################################
# Parse command line options for JVM feature selection. After this function
# has run $JVM_FEATURES_ENABLED, $JVM_FEATURES_DISABLED and $JVM_FEATURES_VALID
# can be used.
@ -199,7 +199,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_PARSE_OPTIONS],
AC_SUBST(VALID_JVM_FEATURES)
])
###############################################################################
################################################################################
# Helper function for the JVM_FEATURES_CHECK_* suite.
# The code in the code block should assign 'false' to the variable AVAILABLE
# if the feature is not available, and this function will handle everything
@ -225,7 +225,7 @@ AC_DEFUN([JVM_FEATURES_CHECK_AVAILABILITY],
fi
])
###############################################################################
################################################################################
# Check if the feature 'cds' is available on this platform.
#
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_CDS],
@ -241,7 +241,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_CDS],
])
])
###############################################################################
################################################################################
# Check if the feature 'dtrace' is available on this platform.
#
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_DTRACE],
@ -270,7 +270,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_DTRACE],
])
])
###############################################################################
################################################################################
# Check if the feature 'jvmci' is available on this platform.
#
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
@ -290,7 +290,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
])
])
###############################################################################
################################################################################
# Check if the feature 'shenandoahgc' is available on this platform.
#
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_SHENANDOAHGC],
@ -309,7 +309,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_SHENANDOAHGC],
])
])
###############################################################################
################################################################################
# Check if the feature 'zgc' is available on this platform.
#
AC_DEFUN_ONCE([JVM_FEATURES_CHECK_ZGC],
@ -365,7 +365,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_ZGC],
])
])
###############################################################################
################################################################################
# Setup JVM_FEATURES_PLATFORM_UNAVAILABLE and JVM_FEATURES_PLATFORM_FILTER
# to contain those features that are unavailable, or should be off by default,
# for this platform, regardless of JVM variant.
@ -383,7 +383,7 @@ AC_DEFUN_ONCE([JVM_FEATURES_PREPARE_PLATFORM],
])
###############################################################################
################################################################################
# Setup JVM_FEATURES_VARIANT_UNAVAILABLE and JVM_FEATURES_VARIANT_FILTER
# to contain those features that are unavailable, or should be off by default,
# for this particular JVM variant.
@ -431,7 +431,7 @@ AC_DEFUN([JVM_FEATURES_PREPARE_VARIANT],
fi
])
###############################################################################
################################################################################
# Calculate the actual set of active JVM features for this JVM variant. Store
# the result in JVM_FEATURES_ACTIVE.
#
@ -479,7 +479,7 @@ AC_DEFUN([JVM_FEATURES_CALCULATE_ACTIVE],
$JVM_FEATURES_ENABLED, $JVM_FEATURES_DISABLED)
])
###############################################################################
################################################################################
# Helper function for JVM_FEATURES_VERIFY. Check if the specified JVM
# feature is active. To be used in shell if constructs, like this:
# 'if JVM_FEATURES_IS_ACTIVE(jvmti); then'
@ -489,7 +489,7 @@ AC_DEFUN([JVM_FEATURES_CALCULATE_ACTIVE],
AC_DEFUN([JVM_FEATURES_IS_ACTIVE],
[ [ [[ " $JVM_FEATURES_ACTIVE " =~ ' '$1' ' ]] ] ])
###############################################################################
################################################################################
# Verify that the resulting set of features is consistent and legal.
#
# arg 1: JVM variant
@ -527,7 +527,7 @@ AC_DEFUN([JVM_FEATURES_VERIFY],
fi
])
###############################################################################
################################################################################
# Set up all JVM features for each enabled JVM variant. Requires that
# JVM_FEATURES_PARSE_OPTIONS has been called.
#

View File

@ -70,6 +70,25 @@ AC_DEFUN_ONCE([LIB_SETUP_ALSA],
PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
fi
fi
if test "x$ALSA_FOUND" = xno; then
# If we have sysroot set, and no explicit library location is set,
# look at known locations in sysroot.
if test "x$SYSROOT" != "x" && test "x${with_alsa_lib}" == x; then
if test -f "$SYSROOT/usr/lib64/libasound.so" && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
ALSA_LIBS="-L$SYSROOT/usr/lib64 -lasound"
ALSA_FOUND=yes
elif test -f "$SYSROOT/usr/lib/libasound.so"; then
ALSA_LIBS="-L$SYSROOT/usr/lib -lasound"
ALSA_FOUND=yes
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then
ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound"
ALSA_FOUND=yes
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libasound.so"; then
ALSA_LIBS="-L$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI -lasound"
ALSA_FOUND=yes
fi
fi
fi
if test "x$ALSA_FOUND" = xno; then
AC_CHECK_HEADERS([alsa/asoundlib.h],
[

View File

@ -119,7 +119,7 @@ AC_DEFUN_ONCE([LIB_SETUP_GIFLIB],
AC_DEFUN_ONCE([LIB_SETUP_LIBPNG],
[
AC_ARG_WITH(libpng, [AS_HELP_STRING([--with-libpng],
[use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
[use libpng from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
PKG_CHECK_MODULES(PNG, libpng, [LIBPNG_FOUND=yes], [LIBPNG_FOUND=no])
AC_MSG_CHECKING([for which libpng to use])

View File

@ -73,11 +73,11 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
[
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
[specify whether to use 'system' or 'bundled' freetype.
The selected option applies to both build time and run time.
The default behaviour can be platform dependent.
If using 'system' and either the include files or libraries cannot be
located automatically, then additionally specify both using
--with-freetype-include and --with-freetype-lib.])])
The selected option applies to both build time and run time.
The default behaviour can be platform dependent.
If using 'system' and either the include files or libraries cannot be
located automatically, then additionally specify both using
--with-freetype-include and --with-freetype-lib.])])
AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include],
[specify directory for the freetype include files])])
AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib],
@ -95,8 +95,10 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
FREETYPE_CFLAGS=
FREETYPE_LIBS=
if (test "x$with_freetype_include" = "x" && test "x$with_freetype_lib" != "x") || \
(test "x$with_freetype_include" != "x" && test "x$with_freetype_lib" = "x"); then
if (test "x$with_freetype_include" = "x" && \
test "x$with_freetype_lib" != "x") || \
(test "x$with_freetype_include" != "x" && \
test "x$with_freetype_lib" = "x"); then
AC_MSG_ERROR([Must specify both or neither of --with-freetype-include and --with-freetype-lib])
fi
@ -126,8 +128,8 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
fi
if test "x$FREETYPE_TO_USE" = "xsystem" && \
(test "x$OPENJDK_TARGET_OS" = "xwindows" || \
test "x$OPENJDK_TARGET_OS" = "xmacosx"); then
(test "x$OPENJDK_TARGET_OS" = "xwindows" || \
test "x$OPENJDK_TARGET_OS" = "xmacosx"); then
AC_MSG_ERROR([Only bundled freetype can be specified on Mac and Windows])
fi

View File

@ -163,8 +163,8 @@ AC_DEFUN([LIB_BUILD_BINUTILS],
# We don't know the version, not checking for libsframe.a
if test -e $BINUTILS_INSTALL_DIR/lib/libbfd.a && \
test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \
test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then
test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \
test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a; then
AC_MSG_NOTICE([Found binutils binaries in binutils install directory -- not building])
else
# On Windows, we cannot build with the normal Microsoft CL, but must instead use
@ -267,8 +267,10 @@ AC_DEFUN([LIB_SETUP_HSDIS_BINUTILS],
elif test "x$BINUTILS_INSTALL_DIR" != x; then
disasm_header="\"$BINUTILS_INSTALL_DIR/include/dis-asm.h\""
if test -e $BINUTILS_INSTALL_DIR/lib/libbfd.a && \
test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \
(test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a || test -e $BINUTILS_INSTALL_DIR/lib64/libiberty.a || test -e $BINUTILS_INSTALL_DIR/lib32/libiberty.a); then
test -e $BINUTILS_INSTALL_DIR/lib/libopcodes.a && \
(test -e $BINUTILS_INSTALL_DIR/lib/libiberty.a || \
test -e $BINUTILS_INSTALL_DIR/lib64/libiberty.a || \
test -e $BINUTILS_INSTALL_DIR/lib32/libiberty.a); then
HSDIS_CFLAGS="-DLIBARCH_$OPENJDK_TARGET_CPU_LEGACY_LIB -I$BINUTILS_INSTALL_DIR/include"
# libiberty ignores --libdir and may be installed in $BINUTILS_INSTALL_DIR/lib, $BINUTILS_INSTALL_DIR/lib32

View File

@ -31,7 +31,7 @@
JTREG_MINIMUM_VERSION=7.4
GTEST_MINIMUM_VERSION=1.14.0
###############################################################################
################################################################################
#
# Setup and check for gtest framework source files
#
@ -74,7 +74,7 @@ AC_DEFUN_ONCE([LIB_TESTS_SETUP_GTEST],
AC_SUBST(GTEST_FRAMEWORK_SRC)
])
###############################################################################
################################################################################
#
# Setup and check the Java Microbenchmark Harness
#

View File

@ -71,9 +71,9 @@ AC_DEFUN_ONCE([LIB_SETUP_X11],
elif test -f "$SYSROOT/usr/lib/libX11.so"; then
x_libraries="$SYSROOT/usr/lib"
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI"
elif test -f "$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"; then
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI/libX11.so"
x_libraries="$SYSROOT/usr/lib/$OPENJDK_TARGET_CPU_AUTOCONF-$OPENJDK_TARGET_OS-$OPENJDK_TARGET_ABI"
fi
fi
fi

View File

@ -99,12 +99,12 @@ AC_DEFUN([LIB_SETUP_JVM_LIBS],
if HOTSPOT_CHECK_JVM_VARIANT(zero); then
if test "x$OPENJDK_$1_OS" = xlinux &&
(test "x$OPENJDK_$1_CPU" = xarm ||
test "x$OPENJDK_$1_CPU" = xm68k ||
test "x$OPENJDK_$1_CPU" = xmips ||
test "x$OPENJDK_$1_CPU" = xmipsel ||
test "x$OPENJDK_$1_CPU" = xppc ||
test "x$OPENJDK_$1_CPU" = xsh ||
test "x$OPENJDK_$1_CPU" = xriscv32); then
test "x$OPENJDK_$1_CPU" = xm68k ||
test "x$OPENJDK_$1_CPU" = xmips ||
test "x$OPENJDK_$1_CPU" = xmipsel ||
test "x$OPENJDK_$1_CPU" = xppc ||
test "x$OPENJDK_$1_CPU" = xsh ||
test "x$OPENJDK_$1_CPU" = xriscv32); then
BASIC_JVM_LIBS_$1="$BASIC_JVM_LIBS_$1 -latomic"
fi
fi

View File

@ -390,7 +390,7 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS],
[
AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits],
[build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])])
[build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])])
# We have three types of compiles:
# native == normal compilation, target system == build system
@ -665,7 +665,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
[
AC_ARG_ENABLE(deprecated-ports, [AS_HELP_STRING([--enable-deprecated-ports@<:@=yes/no@:>@],
[Suppress the error when configuring for a deprecated port @<:@no@:>@])])
[Suppress the error when configuring for a deprecated port @<:@no@:>@])])
if test "x$OPENJDK_TARGET_OS" = xwindows && test "x$OPENJDK_TARGET_CPU" = xx86; then
if test "x$enable_deprecated_ports" = "xyes"; then
AC_MSG_WARN([The Windows 32-bit x86 port is deprecated and may be removed in a future release.])
@ -678,7 +678,7 @@ AC_DEFUN([PLATFORM_CHECK_DEPRECATION],
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
[
###############################################################################
##############################################################################
# Note that this is the build platform OS version!
@ -693,7 +693,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
[
###############################################################################
##############################################################################
#
# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code.
# (The JVM can use 32 or 64 bit Java pointers but that decision
@ -739,7 +739,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
[
###############################################################################
##############################################################################
#
# Is the target little or big endian?
#

View File

@ -272,7 +272,7 @@ VERSION_CFLAGS = \
-DVERSION_CLASSFILE_MINOR=$(VERSION_CLASSFILE_MINOR) \
#
ifneq ($(COMPANY_NAME),)
ifneq ($(COMPANY_NAME), )
# COMPANY_NAME is set to "N/A" in make/conf/branding.conf by default,
# but can be customized with the '--with-vendor-name' configure option.
# Only export "VENDOR" to the build if COMPANY_NAME contains a real value.
@ -288,13 +288,13 @@ endif
# Only export VENDOR_URL, VENDOR_URL_BUG and VENDOR_VM_URL_BUG to the build if
# they are not empty. Otherwise, default values which are defined in the sources
# will be used.
ifneq ($(VENDOR_URL),)
ifneq ($(VENDOR_URL), )
VERSION_CFLAGS += -DVENDOR_URL='"$(VENDOR_URL)"'
endif
ifneq ($(VENDOR_URL_BUG),)
ifneq ($(VENDOR_URL_BUG), )
VERSION_CFLAGS += -DVENDOR_URL_BUG='"$(VENDOR_URL_BUG)"'
endif
ifneq ($(VENDOR_URL_VM_BUG),)
ifneq ($(VENDOR_URL_VM_BUG), )
VERSION_CFLAGS += -DVENDOR_URL_VM_BUG='"$(VENDOR_URL_VM_BUG)"'
endif
@ -804,11 +804,7 @@ UCRT_DLL_DIR := @UCRT_DLL_DIR@
ENABLE_PANDOC := @ENABLE_PANDOC@
PANDOC_MARKDOWN_FLAG := @PANDOC_MARKDOWN_FLAG@
####################################################
#
# Libraries
#
USE_EXTERNAL_LCMS := @USE_EXTERNAL_LCMS@
LCMS_CFLAGS := @LCMS_CFLAGS@
LCMS_LIBS := @LCMS_LIBS@
@ -821,11 +817,7 @@ USE_EXTERNAL_LIBPNG := @USE_EXTERNAL_LIBPNG@
PNG_LIBS := @PNG_LIBS@
PNG_CFLAGS := @PNG_CFLAGS@
####################################################
#
# Misc
#
INCLUDE_SA := @INCLUDE_SA@
INCLUDE_JVMCI := @INCLUDE_JVMCI@
INCLUDE_COMPILER2 := @INCLUDE_COMPILER2@

View File

@ -23,14 +23,14 @@
# questions.
#
########################################################################
################################################################################
# This file is responsible for detecting, verifying and setting up the
# toolchain, i.e. the compiler, linker and related utilities. It will setup
# proper paths to the binaries, but it will not setup any flags.
#
# The binaries used is determined by the toolchain type, which is the family of
# compilers and related tools that are used.
########################################################################
################################################################################
m4_include([toolchain_microsoft.m4])
@ -678,6 +678,9 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_EXTRA],
test_metal=`$METAL --version 2>&1`
if test $? -ne 0; then
AC_MSG_RESULT([no])
AC_MSG_NOTICE([A full XCode is required to build the JDK (not only command line tools)])
AC_MSG_NOTICE([If you have XCode installed, you might need to reset the Xcode active developer directory])
AC_MSG_NOTICE([using 'sudo xcode-select -r'])
AC_MSG_ERROR([XCode tool 'metal' neither found in path nor with xcrun])
else
AC_MSG_RESULT([yes, will be using '$METAL'])

View File

@ -161,7 +161,7 @@ AC_DEFUN([TOOLCHAIN_FIND_VISUAL_STUDIO_BAT_FILE],
# version, pass -vcvars_ver=<toolset_version> argument to vcvarsall.bat.
AC_ARG_WITH(msvc-toolset-version, [AS_HELP_STRING([--with-msvc-toolset-version],
[specific MSVC toolset version to use, passed as -vcvars_ver argument to
pass to vcvarsall.bat (Windows only)])])
pass to vcvarsall.bat (Windows only)])])
TARGET_CPU="$1"
VS_VERSION="$2"

View File

@ -25,7 +25,7 @@
m4_include([util_paths.m4])
###############################################################################
################################################################################
# Create a function/macro that takes a series of named arguments. The call is
# similar to AC_DEFUN, but the setup of the function looks like this:
# UTIL_DEFUN_NAMED([MYFUNC], [FOO *BAR], [$@], [
@ -100,7 +100,7 @@ AC_DEFUN([UTIL_DEFUN_NAMED],
])
])
###############################################################################
################################################################################
# Assert that a programmatic condition holds. If not, exit with an error message.
# Check that a shell expression gives return code 0
#
@ -121,7 +121,7 @@ AC_DEFUN([UTIL_ASSERT_SHELL_TEST],
])
###############################################################################
################################################################################
# Assert that a programmatic condition holds. If not, exit with an error message.
# Check that two strings are equal.
#
@ -137,7 +137,7 @@ AC_DEFUN([UTIL_ASSERT_STRING_EQUALS],
$3)
])
###############################################################################
################################################################################
# Assert that a programmatic condition holds. If not, exit with an error message.
# Check that two strings not are equal.
#
@ -153,7 +153,7 @@ AC_DEFUN([UTIL_ASSERT_STRING_NOT_EQUALS],
$3)
])
###############################################################################
################################################################################
# Assert that a programmatic condition holds. If not, exit with an error message.
# Check that the given expression evaluates to the string 'true'
#
@ -165,7 +165,7 @@ AC_DEFUN([UTIL_ASSERT_TRUE],
UTIL_ASSERT_STRING_EQUALS($1, true, $3)
])
###############################################################################
################################################################################
# Assert that a programmatic condition holds. If not, exit with an error message.
# Check that the given expression does not evaluate to the string 'true'
#
@ -177,7 +177,7 @@ AC_DEFUN([UTIL_ASSERT_NOT_TRUE],
UTIL_ASSERT_STRING_NOT_EQUALS($1, true, $3)
])
###############################################################################
################################################################################
# Check if a list of space-separated words are selected only from a list of
# space-separated legal words. Typical use is to see if a user-specified
# set of words is selected from a set of legal words.
@ -204,7 +204,7 @@ AC_DEFUN([UTIL_GET_NON_MATCHING_VALUES],
fi
])
###############################################################################
################################################################################
# Check if a list of space-separated words contains any word(s) from a list of
# space-separated illegal words. Typical use is to see if a user-specified
# set of words contains any from a set of illegal words.
@ -231,7 +231,7 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES],
fi
])
###############################################################################
################################################################################
# Converts an ISO-8601 date/time string to a unix epoch timestamp. If no
# suitable conversion method was found, an empty string is returned.
#
@ -259,7 +259,7 @@ AC_DEFUN([UTIL_GET_EPOCH_TIMESTAMP],
$1=$timestamp
])
###############################################################################
################################################################################
# Sort a space-separated list, and remove duplicates.
#
# Sets the specified variable to the resulting list.
@ -273,7 +273,7 @@ AC_DEFUN([UTIL_SORT_LIST],
$1=${result//$'\n'/ }
])
###############################################################################
################################################################################
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
# If so, then append $1 to $2 \
# Also set JVM_ARG_OK to true/false depending on outcome.
@ -294,7 +294,7 @@ AC_DEFUN([UTIL_ADD_JVM_ARG_IF_OK],
fi
])
###############################################################################
################################################################################
# Register a --with argument but mark it as deprecated
# $1: The name of the with argument to deprecate, not including --with-
AC_DEFUN([UTIL_DEPRECATED_ARG_WITH],
@ -304,7 +304,7 @@ AC_DEFUN([UTIL_DEPRECATED_ARG_WITH],
[AC_MSG_WARN([Option --with-$1 is deprecated and will be ignored.])])
])
###############################################################################
################################################################################
# Register a --enable argument but mark it as deprecated
# $1: The name of the with argument to deprecate, not including --enable-
AC_DEFUN([UTIL_DEPRECATED_ARG_ENABLE],
@ -314,7 +314,7 @@ AC_DEFUN([UTIL_DEPRECATED_ARG_ENABLE],
[AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.])])
])
###############################################################################
################################################################################
# Register an --enable-* argument as an alias for another argument.
# $1: The name of the enable argument for the new alias, not including --enable-
# $2: The full name of the argument of which to make this an alias, including
@ -329,7 +329,7 @@ AC_DEFUN([UTIL_ALIASED_ARG_ENABLE],
])
])
###############################################################################
################################################################################
# Creates a command-line option using the --enable-* pattern. Will return a
# value of 'true' or 'false' in the RESULT variable, depending on whether the
# option was enabled or not by the user. The option can not be turned on if it
@ -471,7 +471,7 @@ UTIL_DEFUN_NAMED([UTIL_ARG_ENABLE],
fi
])
###############################################################################
################################################################################
# Helper functions for ARG_WITH, to validate different types of argument
# Dispatcher to call the correct UTIL_CHECK_TYPE_* function depending on the ARG_TYPE
@ -575,7 +575,7 @@ AC_DEFUN([UTIL_CHECK_TYPE_features],
ARG_RESULT=$($ECHO $feature_list)
])
###############################################################################
################################################################################
# Creates a command-line option using the --with-* pattern. Will return a
# string in the RESULT variable with the option provided by the user, or the
# empty string if the --with-* option was not given. The option can not be given
@ -810,7 +810,7 @@ UTIL_DEFUN_NAMED([UTIL_ARG_WITH],
fi
])
###############################################################################
################################################################################
# Helper functions for CHECK_VALUE in ARG_WITH.
AC_DEFUN([UTIL_CHECK_STRING_NON_EMPTY],
[

View File

@ -23,7 +23,7 @@
# questions.
#
###############################################################################
################################################################################
# Appends a string to a path variable, only adding the : when needed.
AC_DEFUN([UTIL_APPEND_TO_PATH],
[
@ -36,7 +36,7 @@ AC_DEFUN([UTIL_APPEND_TO_PATH],
fi
])
###############################################################################
################################################################################
# Prepends a string to a path variable, only adding the : when needed.
AC_DEFUN([UTIL_PREPEND_TO_PATH],
[
@ -49,7 +49,7 @@ AC_DEFUN([UTIL_PREPEND_TO_PATH],
fi
])
###############################################################################
################################################################################
# This will make sure the given variable points to a full and proper
# path. This means:
# 1) There will be no spaces in the path. On unix platforms,
@ -118,7 +118,7 @@ AC_DEFUN([UTIL_FIXUP_PATH],
fi
])
##############################################################################
################################################################################
# Fixup path to be a Windows full long path
# Note: Only supported with cygwin/msys2 (cygpath tool)
AC_DEFUN([UTIL_FIXUP_WIN_LONG_PATH],
@ -136,7 +136,7 @@ AC_DEFUN([UTIL_FIXUP_WIN_LONG_PATH],
])
###############################################################################
################################################################################
# Check if the given file is a unix-style or windows-style executable, that is,
# if it expects paths in unix-style or windows-style.
# Returns "windows" or "unix" in $RESULT.
@ -170,7 +170,7 @@ AC_DEFUN([UTIL_CHECK_WINENV_EXEC_TYPE],
fi
])
###############################################################################
################################################################################
# This will make sure the given variable points to a executable
# with a full and proper path. This means:
# 1) There will be no spaces in the path. On unix platforms,
@ -289,7 +289,7 @@ AC_DEFUN([UTIL_FIXUP_EXECUTABLE],
fi
])
###############################################################################
################################################################################
# Setup a tool for the given variable. If correctly specified by the user,
# use that value, otherwise search for the tool using the supplied code snippet.
# $1: variable to set
@ -369,7 +369,7 @@ AC_DEFUN([UTIL_SETUP_TOOL],
fi
])
###############################################################################
################################################################################
# Locate a tool using proper methods.
# $1: variable to set
# $2: executable name (or list of names) to look for
@ -436,7 +436,7 @@ AC_DEFUN([UTIL_LOOKUP_PROGS],
])
])
###############################################################################
################################################################################
# Call UTIL_SETUP_TOOL with AC_CHECK_TOOLS to locate the tool. This will look
# first for cross-compilation tools.
# $1: variable to set
@ -452,7 +452,7 @@ AC_DEFUN([UTIL_LOOKUP_TOOLCHAIN_PROGS],
fi
])
###############################################################################
################################################################################
# Test that variable $1 denoting a program is not empty. If empty, exit with an error.
# $1: variable to check
AC_DEFUN([UTIL_CHECK_NONEMPTY],
@ -462,7 +462,7 @@ AC_DEFUN([UTIL_CHECK_NONEMPTY],
fi
])
###############################################################################
################################################################################
# Like UTIL_LOOKUP_PROGS but fails if no tool was found.
# $1: variable to set
# $2: executable name (or list of names) to look for
@ -473,7 +473,7 @@ AC_DEFUN([UTIL_REQUIRE_PROGS],
UTIL_CHECK_NONEMPTY($1)
])
###############################################################################
################################################################################
# Like UTIL_LOOKUP_PROGS but fails if no tool was found.
# $1: variable to set
# $2: executable name (or list of names) to look for
@ -485,7 +485,7 @@ AC_DEFUN([UTIL_REQUIRE_TOOLCHAIN_PROGS],
])
###############################################################################
################################################################################
# Like UTIL_SETUP_TOOL but fails if no tool was found.
# $1: variable to set
# $2: autoconf macro to call to look for the special tool
@ -497,7 +497,7 @@ AC_DEFUN([UTIL_REQUIRE_SPECIAL],
# unix tools. No further processing needed.
])
###############################################################################
################################################################################
# Add FIXPATH prefix to variable. Normally this is done by UTIL_LOOKUP_PROGS
# or UTIL_FIXUP_EXECUTABLE, but in some circumstances this has to be done
# explicitly, such as when the command in question does not exist yet.
@ -510,7 +510,7 @@ AC_DEFUN([UTIL_ADD_FIXPATH],
fi
])
###############################################################################
################################################################################
AC_DEFUN([UTIL_REMOVE_SYMBOLIC_LINKS],
[
if test "x$OPENJDK_BUILD_OS" != xwindows; then

View File

@ -23,7 +23,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including CopyFiles.gmk)
endif

View File

@ -23,7 +23,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including Execute.gmk)
endif

View File

@ -23,7 +23,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including FileUtils.gmk)
endif
@ -136,6 +136,7 @@ ifeq ($(call isTargetOs, macosx), true)
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
fi
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
$(CHMOD) u+w '$(call DecodeSpace, $@)'; \
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
fi
endef
@ -188,6 +189,11 @@ else
endef
endif
define copy-and-chmod-executable
$(install-file)
$(CHMOD) a+rx $@
endef
################################################################################
# Recursive wildcard function. Walks down directories recursively and matches
@ -281,7 +287,7 @@ CacheFindFiles = \
#
# $1 - Directories to start search in
FillFindCache = \
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%, \
$$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
$(if $(CacheFindFiles_NEW_DIRS), \
$(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \

View File

@ -56,7 +56,7 @@ $(foreach root, $(JTREG_TESTROOTS), \
$(eval include $(root)/TEST.ROOT) \
$(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
$(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
) \
) \
)
# Cache the expensive to calculate test names in a generated makefile.

View File

@ -26,13 +26,13 @@
ifndef _JAR_ARCHIVE_GMK
_JAR_ARCHIVE_GMK := 1
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including JarArchive.gmk)
endif
include MakeIO.gmk
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
FALSE_FIND_PATTERN := -name FILE_NAME_THAT_DOESNT_EXIST
# Setup make rules for creating a jar archive.
#
@ -40,81 +40,81 @@ FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# DEPENDENCIES:=List of dependencies for the jar target. If left empty,
# DEPENDENCIES List of dependencies for the jar target. If left empty,
# dependencies are calculated automatically from the source files found.
# For this to work, the source files must exist when the makefile is
# parsed.
# SRCS:=List of directories in where to find files to add to archive
# BIN:=Directory where to store build control files
# SUFFIXES:=File suffixes to include in jar
# INCLUDES:=List of directories/packages in SRCS that should be included
# EXCLUDES:=List of directories/packages in SRCS that should be excluded
# EXCLUDE_FILES:=List of files in SRCS that should be excluded
# EXTRA_FILES:=List of files in SRCS that should be included regardless of suffix match.
# JAR:=Jar file to create
# MANIFEST:=Optional manifest file template.
# JARMAIN:=Optional main class to add to manifest
# JARINDEX:=true means generate the index in the jar file.
# SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically
# SRCS List of directories in where to find files to add to archive
# BIN Directory where to store build control files
# SUFFIXES File suffixes to include in jar
# INCLUDES List of directories/packages in SRCS that should be included
# EXCLUDES List of directories/packages in SRCS that should be excluded
# EXCLUDE_FILES List of files in SRCS that should be excluded
# EXTRA_FILES List of files in SRCS that should be included regardless of suffix match.
# JAR Jar file to create
# MANIFEST Optional manifest file template.
# JARMAIN Optional main class to add to manifest
# JARINDEX true means generate the index in the jar file.
# SKIP_METAINF Set to prevent contents of an META-INF directory to be automatically
# added to the archive.
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
# EXTRA_MANIFEST_ATTR Extra attribute to add to manifest.
# CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
# JAR_CMD:=Optionally override the jar command to use when creating the archive.
# JAR_CMD Optionally override the jar command to use when creating the archive.
SetupJarArchive = $(NamedParamsMacroTemplate)
define SetupJarArchiveBody
$1_JARMAIN:=$(strip $$($1_JARMAIN))
$1_JARNAME:=$$(notdir $$($1_JAR))
$1_JARMAIN := $(strip $$($1_JARMAIN))
$1_JARNAME := $$(notdir $$($1_JAR))
$1_JAR_OUTPUT_DIR := $$(patsubst %/, %, $$(dir $$($1_JAR)))
$$(call SetIfEmpty, $1_BIN, $$($1_JAR_OUTPUT_DIR))
$1_MANIFEST_FILE:=$$($1_BIN)/_the.$$($1_JARNAME)_manifest
$1_DELETESS_FILE:=$$($1_BIN)/_the.$$($1_JARNAME)_deletess
$1_DELETES_FILE:=$$($1_BIN)/_the.$$($1_JARNAME)_deletes
$1_MANIFEST_FILE := $$($1_BIN)/_the.$$($1_JARNAME)_manifest
$1_DELETESS_FILE := $$($1_BIN)/_the.$$($1_JARNAME)_deletess
$1_DELETES_FILE := $$($1_BIN)/_the.$$($1_JARNAME)_deletes
$$(call SetIfEmpty, $1_JAR_CMD, $$(JAR))
ifeq (,$$($1_SUFFIXES))
ifeq ($$($1_SUFFIXES), )
# No suffix was set, default to classes.
$1_SUFFIXES:=.class
$1_SUFFIXES := .class
endif
# Convert suffixes to a find expression
$1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
$1_FIND_PATTERNS := $(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
# On windows, a lot of includes/excludes risk making the command line too long, so
# writing the grep patterns to files.
# Grep returns 1 if nothing is matched. Do not fail the build for this.
ifneq (,$$($1_INCLUDES))
$1_GREP_INCLUDE_PATTERNS:=$$(call EscapeDollar, \
ifneq ($$($1_INCLUDES), )
$1_GREP_INCLUDE_PATTERNS := $$(call EscapeDollar, \
$$(foreach src,$$($1_SRCS), $$(addprefix $$(src)/,$$($1_INCLUDES))))
# If there are a lot of include patterns, output to file to shorten command lines
ifeq ($$(word 20,$$($1_GREP_INCLUDE_PATTERNS)),)
$1_GREP_INCLUDES:=| ( $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) \
ifeq ($$(word 20, $$($1_GREP_INCLUDE_PATTERNS)), )
$1_GREP_INCLUDES := | ( $(GREP) $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_INCLUDE_PATTERNS)) \
|| test "$$$$?" = "1" )
else
$1_GREP_INCLUDE_OUTPUT = \
$$(eval $$(call ListPathsSafely,$1_GREP_INCLUDE_PATTERNS, \
$$(eval $$(call ListPathsSafely, $1_GREP_INCLUDE_PATTERNS, \
$$($1_BIN)/_the.$$($1_JARNAME)_include))
$1_GREP_INCLUDES:=| ( $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include \
$1_GREP_INCLUDES := | ( $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include \
|| test "$$$$?" = "1" )
endif
endif
ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES))
$1_GREP_EXCLUDE_PATTERNS:=$$(call EscapeDollar, \
$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/, \
ifneq ($$($1_EXCLUDES)$$($1_EXCLUDE_FILES), )
$1_GREP_EXCLUDE_PATTERNS := $$(call EscapeDollar, \
$$(foreach src, $$($1_SRCS), $$(addprefix $$(src)/, \
$$($1_EXCLUDES) $$($1_EXCLUDE_FILES))))
# If there are a lot of include patterns, output to file to shorten command lines
ifeq ($$(word 20,$$($1_GREP_EXCLUDE_PATTERNS)),)
$1_GREP_EXCLUDES:=| ( $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) \
ifeq ($$(word 20, $$($1_GREP_EXCLUDE_PATTERNS)), )
$1_GREP_EXCLUDES := | ( $(GREP) -v $$(patsubst %,$(SPACE)-e$(SPACE)$(DQUOTE)%$(DQUOTE),$$($1_GREP_EXCLUDE_PATTERNS)) \
|| test "$$$$?" = "1" )
else
$1_GREP_EXCLUDE_OUTPUT = \
$$(eval $$(call ListPathsSafely,$1_GREP_EXCLUDE_PATTERNS, \
$$(eval $$(call ListPathsSafely, $1_GREP_EXCLUDE_PATTERNS, \
$$($1_BIN)/_the.$$($1_JARNAME)_exclude))
$1_GREP_EXCLUDES:=| ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \
$1_GREP_EXCLUDES := | ( $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude \
|| test "$$$$?" = "1" )
endif
endif
# Check if this jar needs to have its index generated.
ifneq (,$$($1_JARINDEX))
ifneq ($$($1_JARINDEX), )
$1_JARINDEX = (cd $$(dir $$@) && $$($1_JAR_CMD) -i $$(notdir $$@))
else
$1_JARINDEX = true
@ -127,19 +127,19 @@ define SetupJarArchiveBody
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(call FillFindCache, $$($1_FIND_LIST))
$1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
$$(call FindFiles,$$($1_SRCS)))
ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
$1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
$1_DEPENDENCIES := $$(filter $$(addprefix %, $$($1_SUFFIXES)), \
$$(call FindFiles, $$($1_SRCS)))
ifneq ($$($1_GREP_INCLUDE_PATTERNS), )
$1_DEPENDENCIES := $$(filter $$(addsuffix %, $$($1_GREP_INCLUDE_PATTERNS)), $$($1_DEPENDENCIES))
endif
ifneq (,$$($1_GREP_EXCLUDE_PATTERNS))
$1_DEPENDENCIES:=$$(filter-out $$(addsuffix %,$$($1_GREP_EXCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
ifneq ($$($1_GREP_EXCLUDE_PATTERNS), )
$1_DEPENDENCIES := $$(filter-out $$(addsuffix %, $$($1_GREP_EXCLUDE_PATTERNS)), $$($1_DEPENDENCIES))
endif
# Look for EXTRA_FILES in all SRCS dirs and as absolute paths.
$1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
$1_DEPENDENCIES += $$(wildcard $$(foreach src, $$($1_SRCS), \
$$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
ifeq (,$$($1_SKIP_METAINF))
$1_DEPENDENCIES+=$$(call FindFiles,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
ifeq ($$($1_SKIP_METAINF), )
$1_DEPENDENCIES += $$(call FindFiles, $$(wildcard $$(addsuffix /META-INF, $$($1_SRCS))))
endif
endif
# The dependency list should never be empty
@ -156,23 +156,23 @@ define SetupJarArchiveBody
# into -C <dir> <file> lines.
# The EXTRA_FILES_RESOLVED variable must be set in the macro so that it's evaluated
# in the recipe when the files are guaranteed to exist.
$1_CAPTURE_EXTRA_FILES=\
$$(eval $1_EXTRA_FILES_RESOLVED:=$$(call DoubleDollar, \
$1_CAPTURE_EXTRA_FILES = \
$$(eval $1_EXTRA_FILES_RESOLVED := $$(call DoubleDollar, \
$$(wildcard $$(foreach src, $$($1_SRCS), \
$$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES)))) \
$$(if $$($1_EXTRA_FILES_RESOLVED), \
$$(eval $$(call ListPathsSafely,$1_EXTRA_FILES_RESOLVED, \
$$(eval $$(call ListPathsSafely, $1_EXTRA_FILES_RESOLVED, \
$$($1_BIN)/_the.$$($1_JARNAME)_contents.extra)) \
$(SED) $$(foreach src,$$($1_SRCS), -e 's|$$(src)/|-C $$(src) |g') \
$(SED) $$(foreach src, $$($1_SRCS), -e 's|$$(src)/|-C $$(src) |g') \
$$($1_BIN)/_the.$$($1_JARNAME)_contents.extra \
>> $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE))
# The capture contents macro finds all files (matching the patterns, typically
# .class and .prp) that are newer than the jar-file, ie the new content to be put into the jar.
# NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
$1_CAPTURE_CONTENTS=\
$1_CAPTURE_CONTENTS = \
$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE) \
$$(foreach src,$$($1_SRCS), \
$$(foreach src, $$($1_SRCS), \
$(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) -a -newer $$@ $$($1_GREP_INCLUDES) \
$$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/|-C $$(src) |g' \
>> $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)) \
@ -180,19 +180,19 @@ define SetupJarArchiveBody
# The capture metainf macro finds all files below the META-INF directory that are newer than the jar-file.
# Find returns non zero if the META-INF dir does not exist, ignore this.
ifeq (,$$($1_SKIP_METAINF))
$1_CAPTURE_METAINF =$$(foreach src,$$($1_SRCS), \
ifeq ($$($1_SKIP_METAINF), )
$1_CAPTURE_METAINF = $$(foreach src, $$($1_SRCS), \
( ( $(FIND) $$(src)/META-INF -type f -a -newer $$@ 2> /dev/null || true ) \
| $(SED) 's|$$(src)/|-C $$(src) |g' >> \
$$($1_BIN)/_the.$$($1_JARNAME)_contents ) $$(NEWLINE) )
endif
# The capture deletes macro finds all deleted files and concatenates them. The resulting file
# tells us what to remove from the jar-file.
$1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ \
$1_CAPTURE_DELETES = $$(foreach src, $$($1_SRCS), ($(FIND) $$(src) -name _the.package.deleted -newer $$@ \
-exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) $$(NEWLINE))
# The update contents macro updates the jar file with the previously capture contents.
# Use 'wc -w' to see if the contents file is empty.
$1_UPDATE_CONTENTS=\
$1_UPDATE_CONTENTS = \
if [ "`$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'`" -gt "0" ]; then \
$(ECHO) " updating" `$(WC) -l $$($1_BIN)/_the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
$(SORT) $$($1_BIN)/_the.$$($1_JARNAME)_contents > $$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted && \
@ -200,27 +200,27 @@ define SetupJarArchiveBody
fi $$(NEWLINE)
# The s-variants of the above macros are used when the jar is created from scratch.
# NOTICE: please leave the parentheses space separated otherwise the AIX build will break!
$1_SCAPTURE_CONTENTS=\
$1_SCAPTURE_CONTENTS = \
$(RM) $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE) \
$$(foreach src,$$($1_SRCS), \
$$(foreach src, $$($1_SRCS), \
$(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
$$($1_GREP_EXCLUDES) | $(SED) 's|$$(src)/|-C $$(src) |g' \
>> $$($1_BIN)/_the.$$($1_JARNAME)_contents $$(NEWLINE)) \
$$($1_CAPTURE_EXTRA_FILES)
# Find returns non zero if the META-INF dir does not exist, ignore this.
ifeq (,$$($1_SKIP_METAINF))
$1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS), \
ifeq ($$($1_SKIP_METAINF), )
$1_SCAPTURE_METAINF = $$(foreach src, $$($1_SRCS), \
( ( $(FIND) $$(src)/META-INF -type f 2> /dev/null || true ) \
| $(SED) 's|$$(src)/|-C $$(src) |g' >> \
$$($1_BIN)/_the.$$($1_JARNAME)_contents) $$(NEWLINE) )
endif
$1_SUPDATE_CONTENTS=\
$1_SUPDATE_CONTENTS = \
$(SORT) $$($1_BIN)/_the.$$($1_JARNAME)_contents > $$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted && \
$$($1_JAR_CMD) --update $$($1_JAR_OPTIONS) --file $$@ @$$($1_BIN)/_the.$$($1_JARNAME)_contents_sorted $$(NEWLINE)
# Use a slightly shorter name for logging, but with enough path to identify this jar.
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_JAR))
$1_NAME := $$(subst $$(OUTPUTDIR)/,,$$($1_JAR))
# If reproducible build and the boot jdk jar supports --date option
# then specify the --date using SOURCE_DATE in ISO-8601
@ -228,7 +228,7 @@ define SetupJarArchiveBody
ifeq ($$(BOOT_JDK_JAR_SUPPORTS_DATE), true)
$1_JAR_OPTIONS += --date $(SOURCE_DATE_ISO_8601)
endif
ifneq (,$$($1_CHECK_COMPRESS_JAR))
ifneq ($$($1_CHECK_COMPRESS_JAR), )
ifneq ($(COMPRESS_JARS), true)
$1_JAR_OPTIONS += --no-compress
endif

View File

@ -26,7 +26,7 @@
ifndef _JAVA_COMPILATION_GMK
_JAVA_COMPILATION_GMK := 1
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
endif
@ -57,9 +57,9 @@ TARGET_RELEASE_NEWJDK_UPGRADED := $(TARGET_RELEASE_NEWJDK) \
define add_file_to_copy
# param 1 = BUILD_MYPACKAGE
# parma 2 = The source file to copy.
$2_TARGET:=$2
$2_TARGET := $2
# Remove the source prefix.
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
$$(foreach i, $$($1_SRC), $$(eval $$(call remove_string,$$i,$2_TARGET)))
# To allow for automatic overrides, do not create a rule for a target file that
# already has one
ifneq ($$($1_COPY_$$($2_TARGET)), 1)
@ -98,9 +98,9 @@ endef
define add_file_to_clean
# param 1 = BUILD_MYPACKAGE
# parma 2 = The source file to copy and clean.
$2_TARGET:=$2
$2_TARGET := $2
# Remove the source prefix.
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$2_TARGET)))
$$(foreach i, $$($1_SRC), $$(eval $$(call remove_string,$$i,$2_TARGET)))
# Now we can setup the dependency that will trigger the copying.
# To allow for automatic overrides, do not create a rule for a target file that
# already has one
@ -138,44 +138,44 @@ endef
# The target for public API digest is returned in $1_API_TARGET.
#
# Remaining parameters are named arguments. These include:
# SMALL_JAVA:=set to false to run javac as a "big" java app
# COMPILER:=bootjdk or interim, the latter is default
# TARGET_RELEASE:=javac flags to set the targeted jdk release (-source/-target or --release)
# SMALL_JAVA set to false to run javac as a "big" java app
# COMPILER bootjdk or interim, the latter is default
# TARGET_RELEASE javac flags to set the targeted jdk release (-source/-target or --release)
# Defaults to $(TARGET_RELEASE_NEWJDK).
# JAVAC_FLAGS:=javac flags to append to the default ones.
# JAVA_FLAGS:=flags to be appended to the java launching the compiler
# DISABLED_WARNINGS:=list of Xlint warnings that should be disabled
# SRC:=one or more directories to search for sources. The order of the source roots
# JAVAC_FLAGS javac flags to append to the default ones.
# JAVA_FLAGS flags to be appended to the java launching the compiler
# DISABLED_WARNINGS list of Xlint warnings that should be disabled
# 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.
# COPY:=.prp means copy all prp files to the corresponding package in BIN.
# COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
# CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
# CLEAN_FILES:=myapp/foo/setting.txt means clean this file over to the package myapp/foo
# SRCZIP:=Create a src.zip based on the found sources and copied files.
# INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file!
# EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file!
# 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.
# COPY .prp means copy all prp files to the corresponding package in BIN.
# COPY_FILES myapp/foo/setting.txt means copy this file over to the package myapp/foo
# CLEAN .properties means copy and clean all properties file to the corresponding package in BIN.
# CLEAN_FILES myapp/foo/setting.txt means clean this file over to the package myapp/foo
# SRCZIP Create a src.zip based on the found sources and copied files.
# INCLUDE_FILES "com/sun/SolarisFoobar.java" means only compile this file!
# EXCLUDE_FILES "com/sun/SolarisFoobar.java" means do not compile this particular file!
# "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
# EXTRA_FILES:=List of extra source files to include in compilation. Can be used to
# EXTRA_FILES List of extra source files to include in compilation. Can be used to
# specify files that need to be generated by other rules first.
# HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependency
# KEEP_DUPS:=Do not remove duplicate file names from different source roots.
# FAIL_NO_SRC:=Set to false to not fail the build if no source files are found,
# HEADERS path to directory where all generated c-headers are written.
# DEPENDS Extra dependency
# KEEP_DUPS Do not remove duplicate file names from different source roots.
# FAIL_NO_SRC Set to false to not fail the build if no source files are found,
# default is true.
# CREATE_API_DIGEST:=Set to true to use a javac plugin to generate a public API
# CREATE_API_DIGEST Set to true to use a javac plugin to generate a public API
# hash which can be used for down stream dependencies to only rebuild
# when the API changes.
# KEEP_ALL_TRANSLATIONS:=Set to true to skip translation filtering
# KEEP_ALL_TRANSLATIONS Set to true to skip translation filtering
SetupJavaCompilation = $(NamedParamsMacroTemplate)
define SetupJavaCompilationBody
# Verify arguments
ifeq ($$($1_BIN),)
ifeq ($$($1_BIN), )
$$(error Must specify BIN (in $1))
endif
@ -255,9 +255,9 @@ define SetupJavaCompilationBody
$1_JAVAC := $$(INTERIM_LANGTOOLS_ARGS) -m jdk.compiler.interim/com.sun.tools.javac.Main
ifeq ($$($1_SMALL_JAVA), true)
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC)
$1_JAVAC_CMD := $$(JAVA_SMALL) $$($1_JAVA_FLAGS) $$($1_JAVAC)
else
$1_JAVAC_CMD := $$(JAVA) $$($1_JAVA_FLAGS) $$($1_JAVAC)
$1_JAVAC_CMD := $$(JAVA) $$($1_JAVA_FLAGS) $$($1_JAVAC)
endif
endif
@ -282,8 +282,26 @@ define SetupJavaCompilationBody
$1_FLAGS += -Xlint:$$(call CommaList, $$(addprefix -, $$($1_DISABLED_WARNINGS)))
endif
ifneq ($$($1_CLASSPATH), )
$1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
$1_AUGMENTED_CLASSPATH := $$($1_CLASSPATH)
$1_API_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi
$1_API_INTERNAL := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_internalapi
ifeq ($$($1_CREATE_API_DIGEST), true)
$1_API_DIGEST_FLAGS := \
-Xplugin:"depend $$($1_API_TARGET)" \
"-XDinternalAPIPath=$$($1_API_INTERNAL)" \
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
#
$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
# including the compilation output on the classpath, so that incremental
# compilations in unnamed module can refer to other classes from the same
# source root, which are not being recompiled in this compilation:
$1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/depend $$($1_BIN)
endif
ifneq ($$($1_AUGMENTED_CLASSPATH), )
$1_FLAGS += -cp $$(call PathList, $$($1_AUGMENTED_CLASSPATH))
endif
# Make sure the dirs exist, or that one of the EXTRA_FILES, that may not
@ -295,7 +313,7 @@ define SetupJavaCompilationBody
) \
) \
)
$$(call MakeDir,$$($1_BIN))
$$(call MakeDir, $$($1_BIN))
# Order src files according to the order of the src dirs. Correct ordering is
# needed for correct overriding between different source roots.
$1_ALL_SRC_RAW := $$(call FindFiles, $$($1_SRC))
@ -351,72 +369,69 @@ define SetupJavaCompilationBody
endif
else
# All files below META-INF are always copied.
$1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
$1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%, $$($1_SRC)), $$($1_ALL_SRCS))
# Find all files to be copied from source to bin.
ifneq (,$$($1_COPY)$$($1_COPY_FILES))
ifneq ($$($1_COPY)$$($1_COPY_FILES), )
# Search for all files to be copied.
$1_ALL_COPIES += $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS))
$1_ALL_COPIES += $$(filter $$(addprefix %, $$($1_COPY)), $$($1_ALL_SRCS))
# Copy these explicitly
$1_ALL_COPIES += $$($1_COPY_FILES)
endif
# Copy must also respect filters.
ifneq (,$$($1_INCLUDE_PATTERN))
$1_ALL_COPIES := $$(filter $$($1_INCLUDE_PATTERN),$$($1_ALL_COPIES))
ifneq ($$($1_INCLUDE_PATTERN), )
$1_ALL_COPIES := $$(filter $$($1_INCLUDE_PATTERN), $$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDE_PATTERN))
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_PATTERN),$$($1_ALL_COPIES))
ifneq ($$($1_EXCLUDE_PATTERN), )
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_ALL_COPIES))
endif
# Filter out any excluded translations
ifneq ($$($1_KEEP_ALL_TRANSLATIONS), true)
$1_ALL_COPIES := $$(call FilterExcludedTranslations, $$($1_ALL_COPIES), .properties)
endif
ifneq (,$$($1_ALL_COPIES))
ifneq ($$($1_ALL_COPIES), )
# Yep, there are files to be copied!
$1_ALL_COPY_TARGETS:=
$$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
$1_ALL_COPY_TARGETS :=
$$(foreach i, $$($1_ALL_COPIES), $$(eval $$(call add_file_to_copy,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
endif
# Find all property files to be copied and cleaned from source to bin.
ifneq (,$$($1_CLEAN)$$($1_CLEAN_FILES))
ifneq ($$($1_CLEAN)$$($1_CLEAN_FILES), )
# Search for all files to be copied.
$1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS))
$1_ALL_CLEANS := $$(filter $$(addprefix %, $$($1_CLEAN)), $$($1_ALL_SRCS))
# Clean these explicitly
$1_ALL_CLEANS += $$($1_CLEAN_FILES)
# Copy and clean must also respect filters.
ifneq (,$$($1_INCLUDE_PATTERN))
$1_ALL_CLEANS := $$(filter $$($1_INCLUDE_PATTERN),$$($1_ALL_CLEANS))
ifneq ($$($1_INCLUDE_PATTERN), )
$1_ALL_CLEANS := $$(filter $$($1_INCLUDE_PATTERN), $$($1_ALL_CLEANS))
endif
ifneq (,$$($1_EXCLUDE_PATTERN))
$1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_PATTERN),$$($1_ALL_CLEANS))
ifneq ($$($1_EXCLUDE_PATTERN), )
$1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_ALL_CLEANS))
endif
# Filter out any excluded translations
ifneq ($$($1_KEEP_ALL_TRANSLATIONS), true)
$1_ALL_CLEANS := $$(call FilterExcludedTranslations, $$($1_ALL_CLEANS), .properties)
endif
ifneq (,$$($1_ALL_CLEANS))
ifneq ($$($1_ALL_CLEANS), )
# Yep, there are files to be copied and cleaned!
$1_ALL_COPY_CLEAN_TARGETS:=
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_clean,$1,$$i)))
$1_ALL_COPY_CLEAN_TARGETS :=
$$(foreach i, $$($1_ALL_CLEANS), $$(eval $$(call add_file_to_clean,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files!
endif
endif
# Create a sed expression to remove the source roots and to replace / with .
# and remove .java at the end.
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
$1_REWRITE_INTO_CLASSES := $$(foreach i, $$($1_SRC), -e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
$1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch
$1_FILELIST := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch.filelist
$1_MODFILELIST := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch.modfiles
$1_MODFILELIST_FIXED := $$($1_MODFILELIST).fixed
$1_API_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi
$1_API_INTERNAL := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_internalapi
# Put headers in a temp dir to filter out those that actually
# changed before copying them to the real header dir.
ifneq (,$$($1_HEADERS))
ifneq ($$($1_HEADERS), )
$1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp
$$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET)
@ -442,17 +457,6 @@ define SetupJavaCompilationBody
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
ifeq ($$($1_CREATE_API_DIGEST), true)
$1_API_DIGEST_FLAGS := \
-classpath $$(BUILDTOOLS_OUTPUTDIR)/depend \
-Xplugin:"depend $$($1_API_TARGET)" \
"-XDinternalAPIPath=$$($1_API_INTERNAL)" \
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
#
$1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
endif
# Create a file with all sources, to pass to javac in an @file.
# $$($1_VARDEPS_FILE) is used as dependency to track changes in set of
# list of files.
@ -499,27 +503,27 @@ define SetupJavaCompilationBody
$$($1_HEADER_TARGETS)
# Check if a jar file was specified, then setup the rules for the jar.
ifneq (,$$($1_JAR))
ifneq ($$($1_JAR), )
# If no suffixes was explicitly set for this jar file.
# Use class and the cleaned/copied properties file suffixes as the default
# for the types of files to be put into the jar.
ifeq (,$$($1_SUFFIXES))
$1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
ifeq ($$($1_SUFFIXES), )
$1_SUFFIXES := .class $$($1_CLEAN) $$($1_COPY)
endif
$$(eval $$(call SetupJarArchive, ARCHIVE_$1, \
DEPENDENCIES:=$$($1), \
SRCS:=$$($1_BIN)$$($1_MODULE_SUBDIR), \
SUFFIXES:=$$($1_SUFFIXES), \
EXCLUDE:=$$($1_EXCLUDES), \
INCLUDES:=$$($1_INCLUDES), \
EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS), \
JAR:=$$($1_JAR), \
JARMAIN:=$$($1_JARMAIN), \
MANIFEST:=$$($1_MANIFEST), \
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \
JARINDEX:=$$($1_JARINDEX), \
HEADERS:=$$($1_HEADERS), \
DEPENDENCIES := $$($1), \
SRCS := $$($1_BIN)$$($1_MODULE_SUBDIR), \
SUFFIXES := $$($1_SUFFIXES), \
EXCLUDE := $$($1_EXCLUDES), \
INCLUDES := $$($1_INCLUDES), \
EXTRA_FILES := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS), \
JAR := $$($1_JAR), \
JARMAIN := $$($1_JARMAIN), \
MANIFEST := $$($1_MANIFEST), \
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
JARINDEX := $$($1_JARINDEX), \
HEADERS := $$($1_HEADERS), \
))
# Add jar to target list
@ -527,13 +531,13 @@ define SetupJavaCompilationBody
endif
# Check if a srczip was specified, then setup the rules for the srczip.
ifneq (,$$($1_SRCZIP))
ifneq ($$($1_SRCZIP), )
$$(eval $$(call SetupZipArchive, ZIP_ARCHIVE_$1, \
SRC:=$$($1_SRC), \
ZIP:=$$($1_SRCZIP), \
INCLUDES:=$$($1_INCLUDES), \
EXCLUDES:=$$($1_EXCLUDES), \
EXCLUDE_FILES:=$$($1_EXCLUDE_FILES)))
SRC := $$($1_SRC), \
ZIP := $$($1_SRCZIP), \
INCLUDES := $$($1_INCLUDES), \
EXCLUDES := $$($1_EXCLUDES), \
EXCLUDE_FILES := $$($1_EXCLUDE_FILES)))
# Add zip to target list
$1 += $$($1_SRCZIP)

View File

@ -182,12 +182,12 @@ define AddJdkLibrary
$1_$2_NAME := $$(strip $$(lastword $$(subst :, , $3)))
$1_$2_MODULE := $$(strip $$(patsubst %$$($1_$2_NAME), %, $3))
ifeq ($$(filter lib%, $$($1_$2_NAME)),)
ifeq ($$(filter lib%, $$($1_$2_NAME)), )
$$(error Library name $$($1_$2_NAME) missing lib prefix in $1)
endif
$1_$2_NAME := $$(strip $$(patsubst lib%, %, $$($1_$2_NAME)))
ifeq ($$($1_$2_MODULE),)
ifeq ($$($1_$2_MODULE), )
$1_$2_MODULE := $$(MODULE)
else
$1_$2_MODULE := $$(strip $$(patsubst %:, %, $$($1_$2_MODULE)))
@ -196,10 +196,10 @@ define AddJdkLibrary
# Determine if the library in question is static.
# Ideally, we should not hardcode these
ifeq ($(call isTargetOs, aix)+$$($1_$2_MODULE):$$($1_$2_NAME), true+java.base:jli)
$1_$2_STATIC_LIBRARY := true
$1_$2_STATIC_LIBRARY := true
endif
ifeq ($$($1_$2_MODULE):$$($1_$2_NAME), gtest:gtest)
$1_$2_STATIC_LIBRARY := true
$1_$2_STATIC_LIBRARY := true
endif
# Setup $1_$2_LIBPATH.

View File

@ -23,17 +23,17 @@
# questions.
#
################################################################
################################################################################
# MakeBase provides the core functionality needed and used by all makefiles. It
# should be included by all makefiles. MakeBase provides essential
# functionality for named parameter functions, variable dependency, tool
# execution, logging and fixpath functionality.
################################################################
################################################################################
ifndef _MAKEBASE_GMK
_MAKEBASE_GMK := 1
ifeq ($(wildcard $(SPEC)),)
ifeq ($(wildcard $(SPEC)), )
$(error MakeBase.gmk needs SPEC set to a proper spec.gmk)
endif
@ -49,16 +49,16 @@ endif
# When calling macros, the spaces between arguments are
# often semantically important! Sometimes we need to subst
# spaces and commas, therefore we need the following macros.
X:=
SPACE:=$(X) $(X)
COMMA:=,
DOLLAR:=$$
HASH:=\#
LEFT_PAREN:=(
RIGHT_PAREN:=)
SQUOTE:='
X :=
SPACE := $(X) $(X)
COMMA := ,
DOLLAR := $$
HASH := \#
LEFT_PAREN := (
RIGHT_PAREN := )
SQUOTE := '
#'
DQUOTE:="
DQUOTE := "
#"
define NEWLINE
@ -99,7 +99,7 @@ define SetupLogging
endif
endif
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
ifneq ($$(findstring $$(LOG_LEVEL), debug trace), )
SHELL := $$(SHELL) -x
endif
@ -117,21 +117,21 @@ define SetupLogging
# The warn level can never be turned off
LogWarn = $$(info $(LOG_PREFIX)$$(strip $$1))
LOG_WARN :=
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace),)
ifneq ($$(findstring $$(LOG_LEVEL), info debug trace), )
LogInfo = $$(info $(LOG_PREFIX)$$(strip $$1))
LOG_INFO :=
else
LogInfo =
LOG_INFO := > /dev/null
endif
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
ifneq ($$(findstring $$(LOG_LEVEL), debug trace), )
LogDebug = $$(info $(LOG_PREFIX)$$(strip $$1))
LOG_DEBUG :=
else
LogDebug =
LOG_DEBUG := > /dev/null
endif
ifneq ($$(findstring $$(LOG_LEVEL), trace),)
ifneq ($$(findstring $$(LOG_LEVEL), trace), )
LogTrace = $$(info $(LOG_PREFIX)$$(strip $$1))
LOG_TRACE :=
else
@ -164,14 +164,14 @@ PARAM_SEQUENCE := $(call sequence, 2, $(MAX_PARAMS))
# BAR := some parameter value, \
# ))
define NamedParamsMacroTemplate
$(if $($(MAX_PARAMS)),$(error Internal makefile error: \
$(if $($(MAX_PARAMS)), $(error Internal makefile error: \
Too many named arguments to macro, please update MAX_PARAMS in MakeBase.gmk))
# Iterate over 2 3 4... and evaluate the named parameters with $1_ as prefix
$(foreach i,$(PARAM_SEQUENCE), $(if $(strip $($i)),\
$(foreach i, $(PARAM_SEQUENCE), $(if $(strip $($i)), \
$(strip $1)_$(strip $(call EscapeHash, $(call DoubleDollar, $($i))))$(NEWLINE)))
# Debug print all named parameter names and values
$(if $(findstring $(LOG_LEVEL), trace), \
$(info $0 $(strip $1) $(foreach i,$(PARAM_SEQUENCE), \
$(info $0 $(strip $1) $(foreach i, $(PARAM_SEQUENCE), \
$(if $(strip $($i)),$(NEWLINE) $(strip [$i] $(if $(filter $(LOG_LEVEL), trace), \
$($i), $(wordlist 1, 20, $($(i))) $(if $(word 21, $($(i))), ...)))))))
@ -246,8 +246,8 @@ DependOnVariableFileName = \
# Param 1 - Name of variable
DependOnVariableWriteFile = \
$(call MakeDir, $(dir $($1_filename))) \
$(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \
$($1_filename)) \
$(call WriteFile, $1_old := $(call DoubleDollar,$(call EscapeHash,$($1))), \
$($1_filename)) \
# Does the actual work with parameters stripped.
# If the file exists AND the contents is the same as the variable, do nothing
@ -260,7 +260,7 @@ DependOnVariableHelper = \
$(eval $1_filename := $(call DependOnVariableFileName, $1, $2)) \
$(if $(wildcard $($1_filename)), \
$(eval include $($1_filename)) \
$(if $(call equals, $(strip $($1)), $(strip $($1_old))),,\
$(if $(call equals, $(strip $($1)), $(strip $($1_old))),, \
$(if $(findstring $(LOG_LEVEL), trace), \
$(info NewVariable $1: >$(strip $($1))<) \
$(info OldVariable $1: >$(strip $($1_old))<) \

View File

@ -23,7 +23,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including MakeIO.gmk)
endif
@ -67,22 +67,22 @@ else # HAS_FILE_FUNCTION = false
$(eval compress_paths += \
$(strip $(shell $(CAT) $(TOPDIR)/make/common/support/ListPathsSafely-post-compress.incl)))
decompress_paths=$(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \
decompress_paths = $(SED) -f $(TOPDIR)/make/common/support/ListPathsSafely-uncompress.sed \
-e 's|X99|\\n|g' \
-e 's|X98|$(OUTPUTDIR)|g' -e 's|X97|$(TOPDIR)|g' \
-e 's|X00|X|g'
ListPathsSafely_IfPrintf = \
$(if $(word $3,$($(strip $1))), \
$(if $(word $3, $($(strip $1))), \
$(shell $(PRINTF) -- "$(strip $(call EscapeDollar, \
$(call compress_paths, $(wordlist $3,$4,$($(strip $1))))))\n" \
$(call compress_paths, $(wordlist $3, $4, $($(strip $1))))))\n" \
| $(decompress_paths) >> $2))
# Param 1 - Name of variable containing paths/arguments to output
# Param 2 - File to print to
# Param 3 - Set to true to append to file instead of overwriting
define ListPathsSafely
ifneq (,$$(word 30001,$$($$(strip $1))))
ifneq ($$(word 30001, $$($$(strip $1))), )
$$(error Cannot list safely more than 30000 paths. $1 has $$(words $$($$(strip $1))) paths!)
endif
$$(call MakeDir, $$(dir $2))

View File

@ -177,8 +177,8 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
$(call MakeTargetDir)
$(RM) $@
$(foreach m, $(MODULE_INFOS), \
( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) :=" && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/^ *requires/ { sub(/;/, ""); \
sub(/requires /, " "); \
@ -191,8 +191,8 @@ $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
gsub(/\r/, ""); \
printf(" %s", $$0) } \
END { printf("\n") }' $m && \
$(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) :=" && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) '\
$(PRINTF) "TRANSITIVE_MODULES_$(call GetModuleNameFromModuleInfo, $m) := " && \
$(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
/^ *requires *transitive/ { \
sub(/;/, ""); \
@ -221,7 +221,7 @@ FindTransitiveDepsForModule = \
$(foreach m, $(call FindDepsForModule, $1), \
$(call FindDepsForModule, $m) \
$(foreach n, $(call FindDepsForModule, $m), \
$(call FindDepsForModule, $n))))
$(call FindDepsForModule, $n))))
# Find dependencies ("requires") transitively in 3 levels for a set of modules.
# Param 1: List of modules to find dependencies for.
@ -240,7 +240,7 @@ FindTransitiveIndirectDepsForModule = \
$(foreach m, $(call FindIndirectExportsForModule, $1), \
$(call FindIndirectExportsForModule, $m) \
$(foreach n, $(call FindIndirectExportsForModule, $m), \
$(call FindIndirectExportsForModule, $n))))
$(call FindIndirectExportsForModule, $n))))
# Finds indirect exported modules transitively in 3 levels for a set of modules.
# Param 1: List of modules to find indirect exported modules for.

View File

@ -182,7 +182,7 @@ define SetupNativeCompilationBody
# Now call CreateCompiledNativeFile for each source file we are going to compile.
$$(foreach file, $$($1_SRCS), \
$$(eval $$(call CreateCompiledNativeFile,$1_$$(notdir $$(file)),\
$$(eval $$(call CreateCompiledNativeFile,$1_$$(notdir $$(file)), \
FILE := $$(file), \
BASE := $1, \
)) \
@ -222,7 +222,7 @@ define SetupNativeCompilationBody
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
# Override all targets (this is a hack)
$1 := $$($1_ALL_OBJS_JSON)
$1 := $$($1_ALL_OBJS_JSON) $$($1_LDFLAGS_FILE)
endif
endef
@ -292,6 +292,7 @@ define SetupBasicVariables
$1_TARGET := $$($1_OUTPUT_DIR)/$$($1_BASENAME)
$1_NOSUFFIX := $$($1_PREFIX)$$($1_NAME)
$1_SAFE_NAME := $$(strip $$(subst /,_, $1))
$1_UNIQUE_NAME = $$($1_TYPE)_$$(subst /,_,$$(patsubst $$(OUTPUTDIR)/%/,%,$$(dir $$($1_OBJECT_DIR))))_$$($1_NOSUFFIX)
endef
################################################################################

View File

@ -22,7 +22,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including ProcessMarkdown.gmk)
endif
@ -92,7 +92,7 @@ define ProcessMarkdown
-t $$($1_FORMAT) --eol=lf --standalone \
$$($1_$2_CSS_OPTION) $$($1_$2_OPTIONS_FROM_SRC) $$($1_$2_OPTIONS) \
'$$($1_$2_PANDOC_INPUT)' -o '$$($1_$2_PANDOC_OUTPUT)')
ifneq ($$(findstring $$(LOG_LEVEL), debug trace),)
ifneq ($$(findstring $$(LOG_LEVEL), debug trace), )
TOO_LONG_LINES=`$$(GREP) -E -e '^.{80}.+$$$$' $$<` || true ; \
if [ "x$$$$TOO_LONG_LINES" != x ]; then \
$$(ECHO) "Warning: Unsuitable markdown in $$<:" ; \

View File

@ -26,7 +26,7 @@
ifndef _TEST_FILES_COMPILATION_GMK
_TEST_FILES_COMPILATION_GMK := 1
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including TestFilesCompilation.gmk)
endif
@ -95,7 +95,7 @@ define SetupTestFilesCompilationBody
TEST_CFLAGS := -I$(TOPDIR)/test/lib/native
# Setup a compilation for each and every one of them
$$(foreach file, $$($1_FILTERED_FILE_LIST),\
$$(foreach file, $$($1_FILTERED_FILE_LIST), \
$$(eval name := $$(strip $$(basename $$(notdir $$(file))))) \
$$(eval unprefixed_name := $$(patsubst $$($1_PREFIX)%, %, $$(name))) \
$$(eval $$(call SetupJdkNativeCompilation, BUILD_TEST_$$(name), \
@ -112,16 +112,19 @@ define SetupTestFilesCompilationBody
CXXFLAGS := $$(TEST_CFLAGS) $$($1_CFLAGS) $$($1_CFLAGS_$$(name)), \
LD_SET_ORIGIN := $$($1_LD_SET_ORIGIN), \
LDFLAGS := $$($1_LDFLAGS_$$(name)), \
DISABLED_WARNINGS_gcc := format undef unused-function unused-value, \
DISABLED_WARNINGS_clang := undef format-nonliteral \
missing-field-initializers sometimes-uninitialized, \
DISABLED_WARNINGS_gcc := format undef unused-but-set-variable \
unused-const-variable unused-function unused-value \
unused-variable, \
DISABLED_WARNINGS_clang := format-nonliteral \
missing-field-initializers sometimes-uninitialized undef \
unused-but-set-variable unused-function unused-variable, \
DEFAULT_LIBCXX := false, \
JDK_LIBS := $$($1_JDK_LIBS_$$(name)), \
LIBS := $$($1_LIBS_$$(name)), \
DEFAULT_VERSIONINFO_RESOURCE := false, \
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)),$$($1_OPTIMIZATION_$$(name)),LOW), \
OPTIMIZATION := $$(if $$($1_OPTIMIZATION_$$(name)), $$($1_OPTIMIZATION_$$(name)), LOW), \
COPY_DEBUG_SYMBOLS := $$($1_COPY_DEBUG_SYMBOLS), \
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)),$$($1_STRIP_SYMBOLS_$$(name)),false), \
STRIP_SYMBOLS := $$(if $$($1_STRIP_SYMBOLS_$$(name)), $$($1_STRIP_SYMBOLS_$$(name)), false), \
BUILD_INFO_LOG_MACRO := LogInfo, \
)) \
$$(eval $1 += $$(BUILD_TEST_$$(name)) ) \

View File

@ -23,7 +23,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including TextFileProcessing.gmk)
endif
@ -80,47 +80,47 @@ endef
SetupTextFileProcessing = $(NamedParamsMacroTemplate)
define SetupTextFileProcessingBody
ifneq ($$($1_SOURCE_FILES),)
ifneq ($$($1_SOURCE_DIRS),)
ifneq ($$($1_SOURCE_FILES), )
ifneq ($$($1_SOURCE_DIRS), )
$$(error Cannot use both SOURCE_FILES and SOURCE_DIRS (in $1))
endif
ifneq ($$($1_EXCLUDE_FILES)$$($1_INCLUDE_FILES),)
ifneq ($$($1_EXCLUDE_FILES)$$($1_INCLUDE_FILES), )
$$(error Cannot INCLUDE/EXCLUDE_FILES with SOURCE_FILES (in $1))
endif
else
ifeq ($$($1_SOURCE_DIRS),)
ifeq ($$($1_SOURCE_DIRS), )
$$(error Must specify either SOURCE_FILES or SOURCE_DIRS (in $1))
endif
# Find all files in the source trees. Sort to remove duplicates.
$$(foreach src, $$($1_SOURCE_DIRS), $$(if $$(wildcard $$(src)), , \
$$(error SOURCE_DIRS contains missing directory $$(src) (in $1))))
ifneq ($$($1_SOURCE_BASE_DIR),)
ifneq ($$($1_SOURCE_BASE_DIR), )
$$(foreach src, $$($1_SOURCE_DIRS), \
$$(if $$(findstring $$($1_SOURCE_BASE_DIR), $$(src)), , \
$$(error SOURCE_DIRS contains directory $$(src) outside \
SOURCE_BASE_DIR $$($1_SOURCE_BASE_DIR) (in $1))))
endif
$1_SOURCE_FILES := $$(sort $$(call FindFiles,$$($1_SOURCE_DIRS)))
$1_EXCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
$1_INCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
$1_SOURCE_FILES := $$(filter-out $$($1_EXCLUDE_FILES),$$($1_SOURCE_FILES))
ifneq (,$$(strip $$($1_INCLUDE_FILES)))
$1_SOURCE_FILES := $$(filter $$($1_INCLUDE_FILES),$$($1_SOURCE_FILES))
$1_EXCLUDE_FILES := $$(foreach i, $$($1_SOURCE_DIRS), $$(addprefix $$i/, $$($1_EXCLUDE_FILES)))
$1_INCLUDE_FILES := $$(foreach i, $$($1_SOURCE_DIRS), $$(addprefix $$i/, $$($1_INCLUDE_FILES)))
$1_SOURCE_FILES := $$(filter-out $$($1_EXCLUDE_FILES), $$($1_SOURCE_FILES))
ifneq ($$(strip $$($1_INCLUDE_FILES)), )
$1_SOURCE_FILES := $$(filter $$($1_INCLUDE_FILES), $$($1_SOURCE_FILES))
endif
ifeq (,$$($1_SOURCE_FILES))
ifeq ($$($1_SOURCE_FILES), )
$$(info No sources found for $1 when looking inside the dirs $$($1_SRC))
endif
endif
ifneq ($$($1_REPLACEMENTS),)
ifneq ($$($1_REPLACEMENTS), )
# We have a replacement request, prepare it for the recipe
ifneq ($$(findstring /,$$($1_REPLACEMENTS)),)
ifneq ($$(findstring /, $$($1_REPLACEMENTS)), )
# Cannot use / as separator
ifneq ($$(findstring @,$$($1_REPLACEMENTS)),)
ifneq ($$(findstring @, $$($1_REPLACEMENTS)), )
# Cannot use @ as separator
ifneq ($$(findstring |,$$($1_REPLACEMENTS)),)
ifneq ($$(findstring |, $$($1_REPLACEMENTS)), )
# Cannot use | as separator
ifneq ($$(findstring !,$$($1_REPLACEMENTS)),)
ifneq ($$(findstring !, $$($1_REPLACEMENTS)), )
# Cannot use ! as separator. Give up.
$$(error No suitable sed separator can be found for $1. Tested /, @, | and !)
else
@ -161,7 +161,7 @@ define SetupTextFileProcessingBody
$1_REPLACEMENTS_COMMAND_LINE := $(CAT)
endif
ifneq ($$($1_INCLUDES),)
ifneq ($$($1_INCLUDES), )
# We have a include request, prepare it for the recipe.
# Convert an INCLUDE like this PATTERN_1 => file1 ; PATTERN_2 => file2 ;
# into an awk script fragment like this:
@ -190,7 +190,7 @@ define SetupTextFileProcessingBody
# Reset target list before populating it
$1 :=
ifneq ($$($1_OUTPUT_FILE),)
ifneq ($$($1_OUTPUT_FILE), )
ifneq ($$(words $$($1_SOURCE_FILES)), 1)
$$(error Cannot use OUTPUT_FILE for more than one source file (in $1))
endif
@ -199,12 +199,12 @@ define SetupTextFileProcessingBody
$$(eval $$(call SetupSingleTextFileForProcessing,$1, $$($1_SOURCE_FILES), \
$$(patsubst %/, %, $$(dir $$($1_OUTPUT_FILE))), $$(notdir $$($1_OUTPUT_FILE))))
else
ifeq ($$($1_OUTPUT_DIR),)
ifeq ($$($1_OUTPUT_DIR), )
$$(error Neither OUTPUT_FILE nor OUTPUT_DIR was specified (in $1))
endif
# Now call add_native_source for each source file we are going to process.
ifeq ($$($1_SOURCE_BASE_DIR),)
ifeq ($$($1_SOURCE_BASE_DIR), )
# With no base dir specified, put all files in target dir, flattening any
# hierarchies. Note that $1 is space sensitive and must disobey whitespace
# rules.

View File

@ -23,7 +23,7 @@
# questions.
#
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including Utils.gmk)
endif
@ -36,7 +36,7 @@ endif
# String equals
equals = \
$(if $(strip $1)$(strip $2),$(strip \
$(and $(findstring $(strip $1),$(strip $2)),\
$(and $(findstring $(strip $1),$(strip $2)), \
$(findstring $(strip $2),$(strip $1)))), \
true \
)
@ -64,7 +64,7 @@ uppercase = \
# Param 2 - ending number
sequence = \
$(wordlist $1, $2, $(strip \
$(eval SEQUENCE_COUNT :=) \
$(eval SEQUENCE_COUNT := ) \
$(call _sequence-do,$(strip $2))))
_sequence-do = \
@ -225,7 +225,7 @@ uniq = \
# whitespace-separated words in $1 is a substring.
containing = \
$(strip \
$(foreach v,$(strip $2),\
$(foreach v,$(strip $2), \
$(call uniq,$(foreach p,$(strip $1),$(if $(findstring $p,$v),$v)))))
# Returns all whitespace-separated words in $2 where none of the
@ -242,7 +242,7 @@ dups = \
# $1 - List of prefixes
# $2 - List of elements to process
remove-prefixes = \
$(strip $(if $1,$(patsubst $(firstword $1)%,%,\
$(strip $(if $1,$(patsubst $(firstword $1)%,%, \
$(call remove-prefixes,$(filter-out $(firstword $1),$1),$2)),$2))
################################################################################
@ -270,11 +270,11 @@ Or = \
ifeq ($(IS_GNU_DATE), yes)
EpochToISO8601 = \
$(shell $(DATE) --utc --date="@$(strip $1)" \
+"$(ISO_8601_FORMAT_STRING)" 2> /dev/null)
+"$(ISO_8601_FORMAT_STRING)" 2> /dev/null)
else
EpochToISO8601 = \
$(shell $(DATE) -u -j -f "%s" "$(strip $1)" \
+"$(ISO_8601_FORMAT_STRING)" 2> /dev/null)
+"$(ISO_8601_FORMAT_STRING)" 2> /dev/null)
endif
################################################################################

View File

@ -29,7 +29,7 @@ _ZIP_ARCHIVE_GMK := 1
# Depends on build tools for MakeZipReproducible
include ../ToolsJdk.gmk
ifeq (,$(_MAKEBASE_GMK))
ifeq ($(_MAKEBASE_GMK), )
$(error You must include MakeBase.gmk prior to including ZipArchive.gmk)
endif
@ -65,9 +65,9 @@ define SetupZipArchiveBody
# To avoid running find over too large sets of files, which causes make to crash
# on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
# of directories to run find in, if available.
ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),)
$1_FIND_LIST := $$(wildcard $$(foreach s,$$($1_SRC_SLASH), \
$$(addprefix $$s,$$($1_INCLUDES) $$($1_INCLUDE_FILES))))
ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES), )
$1_FIND_LIST := $$(wildcard $$(foreach s, $$($1_SRC_SLASH), \
$$(addprefix $$s, $$($1_INCLUDES) $$($1_INCLUDE_FILES))))
else
$1_FIND_LIST := $$($1_SRC_SLASH)
endif
@ -76,38 +76,38 @@ define SetupZipArchiveBody
# If asked to, follow symlinks in this find since that is what zip does. To do
# this, we need to call ShellFindFiles directly.
ifeq ($$($1_FOLLOW_SYMLINKS), true)
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call ShellFindFiles,$$($1_FIND_LIST), , -L))
$1_ALL_SRCS := $$(call not-containing, _the., $$(call ShellFindFiles, $$($1_FIND_LIST), , -L))
else
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call FindFiles,$$($1_FIND_LIST)))
$1_ALL_SRCS := $$(call not-containing, _the., $$(call FindFiles, $$($1_FIND_LIST)))
endif
# Filter on suffixes if set
ifneq ($$($1_SUFFIXES),)
ifneq ($$($1_SUFFIXES), )
$1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS))
endif
ifneq ($$($1_INCLUDES),)
ifneq ($$($1_SUFFIXES),)
$1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \
$$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
ifneq ($$($1_INCLUDES), )
ifneq ($$($1_SUFFIXES), )
$1_ZIP_INCLUDES := $$(foreach s, $$($1_SUFFIXES), \
$$(addprefix -i$(SPACE)$(DQUOTE), $$(addsuffix /*$$s$(DQUOTE), $$($1_INCLUDES))))
else
$1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
$1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE), $$(addsuffix /*$(DQUOTE), $$($1_INCLUDES)))
endif
else
ifneq ($$($1_SUFFIXES),)
$1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \
$$(addprefix -i$(SPACE)$(DQUOTE),*$$s$(DQUOTE)))
ifneq ($$($1_SUFFIXES), )
$1_ZIP_INCLUDES := $$(foreach s, $$($1_SUFFIXES), \
$$(addprefix -i$(SPACE)$(DQUOTE), *$$s$(DQUOTE)))
endif
endif
ifneq ($$($1_INCLUDE_FILES),)
$1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
ifneq ($$($1_INCLUDE_FILES), )
$1_ZIP_INCLUDES += $$(addprefix -i$(SPACE), $$($1_INCLUDE_FILES))
endif
ifneq ($$($1_EXCLUDES),)
$1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
$1_SRC_EXCLUDES := $$(foreach s,$$($1_SRC_SLASH),$$(addprefix $$s,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
ifneq ($$($1_EXCLUDES), )
$1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE), $$(addsuffix /*$(DQUOTE), $$($1_EXCLUDES)))
$1_SRC_EXCLUDES := $$(foreach s, $$($1_SRC_SLASH), $$(addprefix $$s, $$(addsuffix /%, $$($1_EXCLUDES))))
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES), $$($1_ALL_SRCS))
endif
ifneq ($$($1_EXCLUDE_FILES),)
ifneq ($$($1_EXCLUDE_FILES), )
$1_SRC_EXCLUDE_FILES := $$(addprefix %, $$($1_EXCLUDE_FILES)) $$($1_EXCLUDE_FILES)
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDE_FILES), $$($1_ALL_SRCS))
$$(foreach s, $$($1_SRC_SLASH), \
@ -134,7 +134,7 @@ define SetupZipArchiveBody
endif
# Use a slightly shorter name for logging, but with enough path to identify this zip.
$1_NAME:=$$(subst $$(OUTPUTDIR)/,,$$($1_ZIP))
$1_NAME := $$(subst $$(OUTPUTDIR)/,,$$($1_ZIP))
# Now $1_ALL_SRCS should contain all sources that are going to be put into the zip.
# I.e. the zip -i and -x options should match the filtering done in the makefile.
@ -167,7 +167,7 @@ define SetupZipArchiveBody
) \
) \
)
$$(foreach s,$$($1_SRC_SLASH), $$(call ExecuteWithLog, \
$$(foreach s, $$($1_SRC_SLASH), $$(call ExecuteWithLog, \
$$(SUPPORT_OUTPUTDIR)/zip/$$(patsubst $$(OUTPUTDIR)/%,%, $$@), \
(cd $$s && $(ZIPEXE) -qru $$($1_ZIP_OPTIONS) $$@ . \
$$($1_ZIP_INCLUDES) $$($1_ZIP_EXCLUDES) -x \*_the.\* \

View File

@ -135,7 +135,8 @@ define SetupBuildLauncherBody
$$($1_CFLAGS), \
CFLAGS_windows := $$($1_CFLAGS_windows), \
EXTRA_HEADER_DIRS := java.base:libjvm, \
DISABLED_WARNINGS_gcc := unused-function, \
DISABLED_WARNINGS_gcc := unused-function unused-variable, \
DISABLED_WARNINGS_clang := unused-function, \
LDFLAGS := $$($1_LDFLAGS), \
LDFLAGS_linux := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN,/../lib), \

View File

@ -41,10 +41,10 @@
define WriteCompileCommandsFragment
$(call LogInfo, Creating compile commands fragment for $(notdir $3))
$(call MakeDir, $(dir $1))
$(call WriteFile,{ \
$(call WriteFile, { \
"directory": "$(strip $(call FixPath, $2))"$(COMMA) \
"file": "$(strip $(call FixPath, $3))"$(COMMA) \
"command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\,\
"command": "$(strip $(subst $(DQUOTE),\$(DQUOTE),$(subst \,\\, \
$(subst $(FIXPATH),,$(call FixPath, $4)))))" \
}$(COMMA), \
$1)
@ -344,7 +344,7 @@ define CreateWindowsResourceFile
$(ECHO) $$($1_RES): \\ > $$($1_RES_DEPS_FILE) ; \
$(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEPS_FILE)$(OBJ_SUFFIX).log \
>> $$($1_RES_DEPS_FILE) ; \
$(ECHO) >> $$($1_RES_DEPS_FILE) ;\
$(ECHO) >> $$($1_RES_DEPS_FILE) ; \
$(SED) $(DEPENDENCY_TARGET_SED_PATTERN) $$($1_RES_DEPS_FILE) \
> $$($1_RES_DEPS_TARGETS_FILE)
endif

View File

@ -94,7 +94,7 @@ define CreateDebugSymbols
$1 += $$($1_DEBUGINFO_ZIP)
endif
endif # !STATIC_LIBRARY
endif # !STATIC_LIBRARY
endif # $1_DEBUG_SYMBOLS != false
endif # COPY_DEBUG_SYMBOLS
endef

View File

@ -109,6 +109,11 @@ define CreateStaticLibrary
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
-o $$($1_TARGET_RELOCATABLE) $$($1_LD_OBJ_ARG))
# 'ld -r' might invalidate the .llvm_addrsig section, and this will cause subsequent
# calls to lld (with '-Wl,--icf=safe') to fail when linking with this library, so
# remove that section.
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_objcopy_remove_llvm_addrsig_section, \
$$($1_OBJCOPY) --remove-section=.llvm_addrsig $$($1_TARGET_RELOCATABLE))
endif
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ar, \
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
@ -193,4 +198,16 @@ define CreateDynamicLibraryOrExecutable
$(CODESIGN) -f -s $$($1_CODESIGN_OPTS) --entitlements \
$$(call GetEntitlementsFile, $$@) $$@)
endif
# This is for IDE integration purposes only, and is not normally generated
$1_LDFLAGS_FILE := $$(MAKESUPPORT_OUTPUTDIR)/compile-commands/$$($1_UNIQUE_NAME)-ldflags.txt
$1_ALL_LD_ARGS := $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $$($1_SYSROOT_LDFLAGS) \
$$($1_LIBS) $$($1_EXTRA_LIBS)
$$($1_LDFLAGS_FILE): $$($1_VARDEPS_FILE)
$$(call LogInfo, Creating compile commands linker flags output for $$($1_BASENAME))
$$(call MakeDir, $$(dir $$@))
$$(ECHO) $$($1_ALL_LD_ARGS) > $$@
endef

View File

@ -29,17 +29,21 @@ GTEST_VERSION=1.14.0
JTREG_VERSION=7.4+1
LINUX_X64_BOOT_JDK_EXT=tar.gz
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_linux-x64_bin.tar.gz
LINUX_X64_BOOT_JDK_SHA256=4d65cc6ed28711768fd72c2043a7925f7c83f5f51bb64970bd9d52f7791fc6ac
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_linux-x64_bin.tar.gz
LINUX_X64_BOOT_JDK_SHA256=41536f115668308ecf4eba92aaf6acaeb0936225828b741efd83b6173ba82963
MACOS_X64_BOOT_JDK_EXT=tar.gz
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_macos-x64_bin.tar.gz
MACOS_X64_BOOT_JDK_SHA256=ae31fe10916429e3fe284266095067a5ce9fecbdc03ff1a079d20459f731ca36
ALPINE_LINUX_X64_BOOT_JDK_EXT=tar.gz
ALPINE_LINUX_X64_BOOT_JDK_URL=https://github.com/adoptium/temurin22-binaries/releases/download/jdk-22.0.2%2B9/OpenJDK22U-jdk_x64_alpine-linux_hotspot_22.0.2_9.tar.gz
ALPINE_LINUX_X64_BOOT_JDK_SHA256=49f73414824b1a7c268a611225fa4d7ce5e25600201e0f1cd59f94d1040b5264
MACOS_AARCH64_BOOT_JDK_EXT=tar.gz
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_macos-aarch64_bin.tar.gz
MACOS_AARCH64_BOOT_JDK_SHA256=d10f82429d01047968c52c7975c326388cb5d212791e14c1de21c987463a4b53
MACOS_AARCH64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_macos-aarch64_bin.tar.gz
MACOS_AARCH64_BOOT_JDK_SHA256=3dab98730234e1a87aec14bcb8171d2cae101e96ff4eed1dab96abbb08e843fd
MACOS_X64_BOOT_JDK_EXT=tar.gz
MACOS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_macos-x64_bin.tar.gz
MACOS_X64_BOOT_JDK_SHA256=e8b3ec7a7077711223d31156e771f11723cd7af31c2017f1bd2eda20855940fb
WINDOWS_X64_BOOT_JDK_EXT=zip
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22/830ec9fcccef480bb3e73fb7ecafe059/36/GPL/openjdk-22_windows-x64_bin.zip
WINDOWS_X64_BOOT_JDK_SHA256=8f5138fecb53c08c20abd4fa6812f9400051f3852582a2142ffda0dff73a5824
WINDOWS_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk22.0.2/c9ecb94cd31b495da20a27d4581645e8/9/GPL/openjdk-22.0.2_windows-x64_bin.zip
WINDOWS_X64_BOOT_JDK_SHA256=f2a9b9ab944e71a64637fcdc6b13a1188cf02d4eb9ecf71dc927e98b3e45f5dc

View File

@ -94,48 +94,26 @@ PLATFORM_MODULES_windows= \
NATIVE_ACCESS_MODULES= \
java.base \
java.datatransfer \
java.desktop \
java.instrument \
java.logging \
java.management \
java.management.rmi \
java.naming \
java.net.http \
java.prefs \
java.rmi \
java.scripting \
java.se \
java.security.jgss \
java.security.sasl \
java.smartcardio \
java.sql \
java.sql.rowset \
java.transaction.xa \
java.xml \
java.xml.crypto \
jdk.accessibility \
jdk.charsets \
jdk.attach \
jdk.crypto.cryptoki \
jdk.dynalink \
jdk.httpserver \
jdk.incubator.vector \
jdk.crypto.mscapi \
jdk.hotspot.agent \
jdk.internal.le \
jdk.internal.vm.ci \
jdk.jdi \
jdk.jfr \
jdk.jsobject \
jdk.localedata \
jdk.jpackage \
jdk.management \
jdk.management.agent \
jdk.management.jfr \
jdk.naming.dns \
jdk.naming.rmi \
jdk.net \
jdk.nio.mapmode \
jdk.sctp \
jdk.security.auth \
jdk.security.jgss \
jdk.unsupported \
jdk.xml.dom \
jdk.zipfs \
#

View File

@ -81,7 +81,7 @@ $(info target_platforms $(target_platforms))
all compile : $(platforms)
ifeq (,$(SKIP_ME))
ifeq ($(SKIP_ME), )
$(foreach p,$(filter-out $(me),$(platforms)),$(eval $(p) : $$(me)))
endif

View File

@ -23,7 +23,7 @@
# questions.
#
##########################################################################################
################################################################################
#
# Workhorse makefile for creating ONE cross compiler
# Needs either to be from BUILD -> BUILD OR have
@ -92,7 +92,7 @@ else
$(error Unknown base OS $(BASE_OS))
endif
##########################################################################################
################################################################################
# Define external dependencies
# Latest that could be made to work.
@ -223,7 +223,7 @@ RPM_LIST := \
systemtap-sdt-devel \
#
##########################################################################################
################################################################################
# Define common directories and files
# Ensure we have 32-bit libs also for x64. We enable mixed-mode.
@ -258,7 +258,7 @@ download-rpms:
wget -r -np -nd $(patsubst %, -A "*%*.rpm", $(RPM_LIST)) $(BASE_URL)
endif
##########################################################################################
################################################################################
# Unpack source packages
# Generate downloading + unpacking of sources.
@ -285,7 +285,7 @@ endef
# Download and unpack all source packages
$(foreach p,GCC BINUTILS CCACHE MPFR GMP MPC GDB,$(eval $(call Download,$(p))))
##########################################################################################
################################################################################
# Unpack RPMS
RPM_ARCHS := $(ARCH) noarch
@ -324,7 +324,7 @@ endef
$(foreach p,$(RPM_FILE_LIST),$(eval $(call unrpm,$(p))))
##########################################################################################
################################################################################
# Note: MUST create a <sysroot>/usr/lib even if not really needed.
# gcc will use a path relative to it to resolve lib64. (x86_64).
@ -344,7 +344,7 @@ $(libs) : $(rpms)
@mkdir -p $(SYSROOT)/usr/lib
@touch $@
##########################################################################################
################################################################################
# Create links for ffi header files so that they become visible by default when using the
# devkit.
ifeq ($(ARCH), x86_64)
@ -357,12 +357,12 @@ ifeq ($(ARCH), x86_64)
SYSROOT_LINKS += $(SYSROOT)/usr/include/ffi.h $(SYSROOT)/usr/include/ffitarget.h
endif
##########################################################################################
################################################################################
# Define marker files for each source package to be compiled
$(foreach t,binutils mpfr gmp mpc gcc ccache gdb,$(eval $(t) = $(TARGETDIR)/$($(t)_ver).done))
##########################################################################################
################################################################################
# Default base config
CONFIG = --target=$(TARGET) \
@ -390,7 +390,7 @@ endif
TOOLS ?= $(call declare_tools,_FOR_TARGET,$(TARGET)-)
##########################################################################################
################################################################################
# Create a TARGET bfd + libiberty only.
# Configure one or two times depending on mulitlib arch.
@ -424,7 +424,7 @@ $(bfdmakes) : CONFIG = --target=$(TARGET) \
$(bfdmakes) : TOOLS = $(call declare_tools,_FOR_TARGET,$(TARGET)-) $(call declare_tools,,$(TARGET)-)
##########################################################################################
################################################################################
$(gcc) \
$(binutils) \
@ -591,7 +591,7 @@ else
@echo 'done'
endif
##########################################################################################
################################################################################
# very straightforward. just build a ccache. it is only for host.
$(BUILDDIR)/$(ccache_ver)/Makefile \
: $(CCACHE_CFG)
@ -606,7 +606,7 @@ $(BUILDDIR)/$(ccache_ver)/Makefile \
gccpatch = $(TARGETDIR)/gcc-patched
##########################################################################################
################################################################################
# For some reason cpp is not created as a target-compiler
ifeq ($(HOST),$(TARGET))
$(gccpatch) : $(gcc) link_libs
@ -621,7 +621,7 @@ ifeq ($(HOST),$(TARGET))
@touch $@
@echo 'done'
##########################################################################################
##############################################################################
# Ugly at best. Seems that when we compile host->host compiler, that are NOT
# the BUILD compiler, the result will not try searching for libs in package root.
# "Solve" this by create links from the target libdirs to where they are.
@ -641,7 +641,7 @@ else
@echo 'done'
endif
##########################################################################################
################################################################################
# Build in two steps.
# make <default>
# make install.
@ -656,7 +656,7 @@ $(TARGETDIR)/%.done : $(BUILDDIR)/%/Makefile
@touch $@
@echo 'done'
##########################################################################################
################################################################################
$(PREFIX)/devkit.info:
@echo 'Creating devkit.info in the root of the kit'
@ -670,7 +670,7 @@ $(PREFIX)/devkit.info:
echo 'DEVKIT_SYSROOT="$$DEVKIT_ROOT/$(TARGET)/sysroot"' >> $@
echo 'DEVKIT_EXTRA_PATH="$$DEVKIT_ROOT/bin"' >> $@
##########################################################################################
################################################################################
# Copy these makefiles into the root of the kit
$(PREFIX)/Makefile: ./Makefile
rm -rf $@
@ -686,7 +686,7 @@ $(PREFIX)/Tars.gmk: ./Tars.gmk
THESE_MAKEFILES := $(PREFIX)/Makefile $(PREFIX)/Tools.gmk $(PREFIX)/Tars.gmk
##########################################################################################
################################################################################
ifeq ($(TARGET), $(HOST))
# To build with dtrace support, the build needs access to the dtrace executable from the
@ -706,7 +706,7 @@ ifeq ($(TARGET), $(HOST))
ld.gold nm objcopy objdump ranlib readelf size strings strip)
endif
##########################################################################################
################################################################################
bfdlib : $(bfdlib)
binutils : $(binutils)

View File

@ -37,7 +37,8 @@ ifeq ($(call isTargetOs, windows), true)
$(eval $(call SetupCopyFiles, COPY_LIBS_LIB, \
SRC := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base, \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter %.lib, $(LIB_TARGETS))))
FILES := $(filter %.lib, $(LIB_TARGETS)), \
))
TARGETS += $(COPY_LIBS_BIN) $(COPY_LIBS_LIB)
else

View File

@ -204,11 +204,11 @@ ifeq ($(call check-jvm-feature, compiler2), true)
INSERT_FILENAME_AWK_SCRIPT := \
'{ \
if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \
if (need_lineno && $$0 !~ /\/\//) \
{ print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \
print \
}'
if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \
if (need_lineno && $$0 !~ /\/\//) \
{ print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \
print \
}'
$(SINGLE_AD_SRCFILE): $(AD_SRC_FILES)
$(call LogInfo, Preprocessing adlc files $(^F))

View File

@ -57,8 +57,9 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
$(GTEST_FRAMEWORK_SRC)/googletest/src \
$(GTEST_FRAMEWORK_SRC)/googlemock/src, \
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
DISABLED_WARNINGS_gcc := undef unused-result format-nonliteral maybe-uninitialized, \
DISABLED_WARNINGS_clang := undef unused-result format-nonliteral, \
DISABLED_WARNINGS_gcc := format-nonliteral maybe-uninitialized undef \
unused-result zero-as-null-pointer-constant, \
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result, \
DEFAULT_CFLAGS := false, \
CFLAGS := $(JVM_CFLAGS) \
-I$(GTEST_FRAMEWORK_SRC)/googletest \
@ -94,11 +95,12 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBJVM, \
CFLAGS := $(JVM_CFLAGS) \
-I$(GTEST_FRAMEWORK_SRC)/googletest/include \
-I$(GTEST_FRAMEWORK_SRC)/googlemock/include \
$(addprefix -I,$(GTEST_TEST_SRC)), \
$(addprefix -I, $(GTEST_TEST_SRC)), \
CFLAGS_windows := -EHsc, \
CFLAGS_macosx := -DGTEST_OS_MAC=1, \
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc) \
undef stringop-overflow, \
DISABLED_WARNINGS_gcc_test_metaspace_misc.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_test_threadCpuLoad.cpp := address, \
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang) \
undef switch format-nonliteral tautological-undefined-compare \

View File

@ -92,10 +92,12 @@ CFLAGS_VM_VERSION := \
DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
empty-body implicit-fallthrough int-in-bool-context \
maybe-uninitialized missing-field-initializers \
shift-negative-value unknown-pragmas
shift-negative-value unknown-pragmas unused-but-set-variable \
unused-local-typedefs unused-variable
DISABLED_WARNINGS_clang := sometimes-uninitialized \
missing-braces delete-non-abstract-non-virtual-dtor unknown-pragmas
DISABLED_WARNINGS_clang := delete-non-abstract-non-virtual-dtor missing-braces \
sometimes-uninitialized unknown-pragmas unused-but-set-variable \
unused-function unused-local-typedef unused-private-field unused-variable
ifneq ($(DEBUG_LEVEL), release)
# Assert macro gives warning
@ -177,15 +179,27 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc), \
DISABLED_WARNINGS_gcc_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp := nonnull, \
DISABLED_WARNINGS_gcc_bytecodeInterpreter.cpp := unused-label, \
DISABLED_WARNINGS_gcc_c1_Runtime1_aarch64.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_cgroupV1Subsystem_linux.cpp := address, \
DISABLED_WARNINGS_gcc_cgroupV2Subsystem_linux.cpp := address, \
DISABLED_WARNINGS_gcc_g1FreeIdSet.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_handshake.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_interp_masm_x86.cpp := uninitialized, \
DISABLED_WARNINGS_gcc_javaClasses.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jfrChunkWriter.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jfrMemorySizer.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jfrTraceIdKlassQueue.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jvmciCodeInstaller.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_jvmFlag.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_jvmtiTagMap.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_macroAssembler_ppc_sha.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
DISABLED_WARNINGS_gcc_shenandoahLock.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_stubGenerator_s390.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_synchronizer.cpp := stringop-overflow, \
DISABLED_WARNINGS_gcc_templateInterpreterGenerator_x86.cpp := unused-const-variable, \
DISABLED_WARNINGS_gcc_xGlobals_ppc.cpp := unused-const-variable, \
DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
DISABLED_WARNINGS_clang_codeBuffer.cpp := tautological-undefined-compare, \
@ -268,7 +282,7 @@ ifneq ($(GENERATE_COMPILE_COMMANDS_ONLY), true)
ifeq ($(JVM_VARIANT), $(JVM_VARIANT_MAIN))
$(eval $(call SetupCopyFiles, COPY_JVM_LIB, \
DEST := $(LIB_OUTPUTDIR), \
FILES :=$(BUILD_LIBJVM_IMPORT_LIBRARY), \
FILES := $(BUILD_LIBJVM_IMPORT_LIBRARY), \
))
TARGETS += $(COPY_JVM_LIB)
endif

View File

@ -47,9 +47,10 @@ endif
ifeq ($(call check-jvm-feature, zero), true)
JVM_EXCLUDES += opto libadt
JVM_EXCLUDE_PATTERNS += c1_ c1/ c2_ runtime_ /c2/
JVM_EXCLUDE_FILES += templateInterpreter.cpp templateInterpreterGenerator.cpp \
bcEscapeAnalyzer.cpp ciTypeFlow.cpp
JVM_CFLAGS_FEATURES += -DZERO -DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
JVM_EXCLUDE_FILES += templateInterpreter.cpp \
templateInterpreterGenerator.cpp bcEscapeAnalyzer.cpp ciTypeFlow.cpp
JVM_CFLAGS_FEATURES += -DZERO \
-DZERO_LIBARCH='"$(OPENJDK_TARGET_CPU_LEGACY_LIB)"' $(LIBFFI_CFLAGS)
JVM_LIBS_FEATURES += $(LIBFFI_LIBS)
ifeq ($(ENABLE_LIBFFI_BUNDLING), true)
JVM_LDFLAGS_FEATURES += $(call SET_EXECUTABLE_ORIGIN,/..)
@ -69,7 +70,8 @@ endif
ifeq ($(call check-jvm-feature, minimal), true)
JVM_CFLAGS_FEATURES += -DMINIMAL_JVM -DVMTYPE=\"Minimal\"
ifeq ($(call isTargetOs, linux), true)
# Override the default -g with a more liberal strip policy for the minimal JVM
# Override the default -g with a more liberal strip policy for the
# minimal JVM
JVM_STRIPFLAGS := --strip-unneeded
endif
endif
@ -80,11 +82,14 @@ endif
ifneq ($(call check-jvm-feature, jvmti), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_JVMTI=0
JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp jvmtiAgentList.cpp
JVM_EXCLUDE_FILES += jvmtiGetLoadedClasses.cpp jvmtiThreadState.cpp \
jvmtiExtensions.cpp jvmtiImpl.cpp jvmtiManageCapabilities.cpp \
jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp jvmtiCodeBlobEvents.cpp \
jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp \
jvmtiEnvThreadState.cpp jvmtiTagMap.cpp jvmtiEventController.cpp \
evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp \
jvmtiClassFileReconstituter.cpp jvmtiTagMapTable.cpp jvmtiAgent.cpp \
jvmtiAgentList.cpp jfrJvmtiAgent.cpp
endif
ifneq ($(call check-jvm-feature, jvmci), true)
@ -166,8 +171,10 @@ ifeq ($(call check-jvm-feature, link-time-opt), true)
# later on if desired
JVM_OPTIMIZATION := HIGHEST_JVM
ifeq ($(call isCompiler, gcc), true)
JVM_CFLAGS_FEATURES += -flto=auto -fuse-linker-plugin -fno-strict-aliasing -fno-fat-lto-objects
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto -fuse-linker-plugin -fno-strict-aliasing
JVM_CFLAGS_FEATURES += -flto=auto -fuse-linker-plugin -fno-strict-aliasing \
-fno-fat-lto-objects
JVM_LDFLAGS_FEATURES += $(CXX_O_FLAG_HIGHEST_JVM) -flto=auto \
-fuse-linker-plugin -fno-strict-aliasing
else ifeq ($(call isCompiler, microsoft), true)
JVM_CFLAGS_FEATURES += -GL
JVM_LDFLAGS_FEATURES += -LTCG:INCREMENTAL

View File

@ -124,7 +124,7 @@ else ifeq ($(call isTargetOs, aix), true)
# mode, so don't optimize sharedRuntimeTrig.cpp at all.
BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
ifneq ($(DEBUG_LEVEL),slowdebug)
ifneq ($(DEBUG_LEVEL), slowdebug)
# Compiling jvmtiEnterTrace.cpp with full optimization needs more than 30min
# (mostly because of '-qhot=level=1' and the more than 1300 'log_trace' calls
# which cause a lot of template expansion).

View File

@ -55,7 +55,7 @@ FindModuleNativeDirs = \
# Taken from JdkNativeCompilation.gmk
FindJavaHeaderDir = \
$(if $(strip $1),$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
$(if $(strip $1), $(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)))
JAVA_DIRS := $(strip $(foreach module, $(call FindAllModules), \
$(patsubst $(TOPDIR)/%,%,$(filter-out $(OUTPUTDIR)%, \
@ -112,7 +112,7 @@ define SetupEclipseWorkspaceBody
# Eclipse crashes when processing multiple module-info.java files
# This is an annoying bug that has not been fixed for some time now
$1_CLASSPATH += $$(foreach src,$(JAVA_DIRS), \
$1_CLASSPATH += $$(foreach src, $(JAVA_DIRS), \
<classpathentry excluding="module-info.java|module-info.java.extra" kind="src" path="$$(src)"/>$$(NEWLINE))
$$(eval $$(call SetupTextFileProcessing, $1_CREATE_CLASSPATH_FILE, \
@ -157,7 +157,7 @@ define SetupEclipseWorkspaceBody
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/hotspot"/>$$(NEWLINE)
ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), )
$1_NATIVE_SRCS += $$(foreach src,$(NATIVE_DIRS), \
$1_NATIVE_SRCS += $$(foreach src, $(NATIVE_DIRS), \
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="$$(strip $$(src))"/>$$(NEWLINE))
endif
@ -188,7 +188,7 @@ define SetupEclipseWorkspaceBody
$1_PLAIN_MAKE_TARGETS := update-build-docs docs gensrc gendata copy java \
launchers libs hotspot jdk product-images product-bundles all-images test-image clean
$1_MATCHING_MAKE_TARGETS += $$(foreach name,$$($1_PLAIN_MAKE_TARGETS), \
$1_MATCHING_MAKE_TARGETS += $$(foreach name, $$($1_PLAIN_MAKE_TARGETS), \
<target name="$$(strip $$(name))" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder"> \
<buildCommand>$$($1_MAKE)</buildCommand> \
<buildArguments>-C $$(call FixPath, $(TOPDIR))</buildArguments> \
@ -292,7 +292,7 @@ define SetupEclipseWorkspaceBody
endif
ifneq ($$(findstring $$($1_NATURE), JAVA MIXED), )
$1_LINKED_RESOURCES += $$(foreach src,$(JAVA_DIRS), \
$1_LINKED_RESOURCES += $$(foreach src, $(JAVA_DIRS), \
<link> \
<name>$$(strip $$(src))</name> \
<type>2</type> \
@ -317,7 +317,7 @@ define SetupEclipseWorkspaceBody
endif
ifneq ($$(findstring $$($1_NATURE), NATIVE MIXED), )
$1_LINKED_RESOURCES += $$(foreach src,$(NATIVE_DIRS), \
$1_LINKED_RESOURCES += $$(foreach src, $(NATIVE_DIRS), \
<link> \
<name>$$(strip $$(src))</name> \
<type>2</type> \

View File

@ -28,8 +28,8 @@ include make/MainSupport.gmk
.PHONY: idea
ifeq ($(SPEC),)
ifneq ($(words $(SPECS)),1)
ifeq ($(SPEC), )
ifneq ($(words $(SPECS)), 1)
@echo "Error: Multiple build specification files found. Please select one explicitly."
@exit 2
endif
@ -39,7 +39,7 @@ ifeq ($(SPEC),)
else #with SPEC
include make/common/Modules.gmk
ifeq ($(MODULES),)
ifeq ($(MODULES), )
SEL_MODULES := $(call FindAllModules)
else
SEL_MODULES := $(MODULES)
@ -47,7 +47,7 @@ else #with SPEC
idea:
$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs,$(mod)))\"" >> $(OUT)
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
$(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
$(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, 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
@ -80,10 +80,10 @@ ifeq ($(call isTargetOs, windows), true)
-ignorePath zero \
#
################################################################################
##############################################################################
# Build the ProjectCreator java tool.
TOOLS_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/support/ide_classes
TOOLS_OUTPUTDIR := $(MAKESUPPORT_OUTPUTDIR)/ide/visualstudio
$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \

View File

@ -47,7 +47,7 @@ GetIndexerFragment = \
################################################################################
# Show indexer-specific notes if they exist, otherwise do nothing
################################################################################
ifneq (,$(wildcard $(call GetIndexerFragment,notes)))
ifneq ($(wildcard $(call GetIndexerFragment,notes)), )
ShowIndexerNotes = $(CAT) $(call GetIndexerFragment,notes)
else
ShowIndexerNotes =
@ -66,7 +66,7 @@ endif
# Return an additional configuration fragment if the WORKSPACE_ROOT is different
# from TOPDIR.
################################################################################
ifneq ($(WORKSPACE_ROOT),$(TOPDIR))
ifneq ($(WORKSPACE_ROOT), $(TOPDIR))
GetExtraWorkspaceRoot = $(TOPDIR)/make/ide/vscode/hotspot/template-workspace-folder.txt
else
GetExtraWorkspaceRoot = /dev/null

View File

@ -0,0 +1,112 @@
#
# Copyright (c) 2023, 2024, 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 must be the first rule
default: all
include $(SPEC)
include MakeBase.gmk
include CopyFiles.gmk
include Execute.gmk
include JavaCompilation.gmk
ifeq ($(call isTargetOs, macosx), true)
##############################################################################
# Build the XcodeProjectMaker java tool.
PROJECT_MAKER_DIR := $(TOPDIR)/make/ide/xcode/hotspot
TOOLS_OUTPUTDIR := $(MAKESUPPORT_OUTPUTDIR)/ide/xcode
IDE_OUTPUTDIR := $(OUTPUTDIR)/xcode
PROJECT_FILE_NAME := hotspot.xcodeproj
COMPILE_COMMAND_FILE := $(OUTPUTDIR)/compile_commands.json
LINKER_FLAGS_FILE := $(MAKESUPPORT_OUTPUTDIR)/compile-commands/jvm-ldflags.txt
$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(PROJECT_MAKER_DIR)/src/classes, \
BIN := $(TOOLS_OUTPUTDIR), \
DISABLED_WARNINGS := rawtypes unchecked serial, \
))
TARGETS += $(BUILD_PROJECT_CREATOR)
# Run the XcodeProjectMaker tool
PROJECT_CREATOR_TOOL := $(JAVA_SMALL) -cp $(TOOLS_OUTPUTDIR) XcodeProjectMaker
ifneq ($(findstring $(LOG_LEVEL), debug trace), )
XCODE_PROJ_DEBUG_OPTION := -d
endif
XCODE_PROJ_VARDEPS := $(WORKSPACE_ROOT) $(IDE_OUTPUTDIR) \
$(PROJECT_MAKER_DIR)/data $(COMPILE_COMMAND_FILE) $(LINKER_FLAGS_FILE)
XCODE_PROJ_VARDEPS_FILE := $(call DependOnVariable, XCODE_PROJ_VARDEPS, \
$(TOOLS_OUTPUTDIR)/xcodeproj.vardeps)
$(eval $(call SetupExecute, build_xcode_project, \
WARN := Generating Xcode project file, \
DEPS := $(BUILD_PROJECT_CREATOR) $(COMPILE_COMMAND_FILE) \
$(LINKER_FLAGS_FILE) $(XCODE_PROJ_VARDEPS_FILE), \
OUTPUT_DIR := $(TOOLS_OUTPUTDIR), \
COMMAND := $(PROJECT_CREATOR_TOOL) $(WORKSPACE_ROOT) $(IDE_OUTPUTDIR) \
$(PROJECT_MAKER_DIR)/data $(COMPILE_COMMAND_FILE) \
$(LINKER_FLAGS_FILE) $(XCODE_PROJ_DEBUG_OPTION), \
))
TARGETS += $(build_xcode_project)
$(eval $(call SetupCopyFiles, copy_xcode_project, \
DEST := $(IDE_OUTPUTDIR), \
FILES := $(PROJECT_MAKER_DIR)/data/script_before.sh $(PROJECT_MAKER_DIR)/data/script_after.sh , \
MACRO := copy-and-chmod-executable, \
))
TARGETS += $(copy_xcode_project)
$(eval $(call SetupExecute, open_xcode_project, \
INFO := Opening Xcode project file, \
DEPS := $(build_xcodeproject_TARGET) FORCE, \
OUTPUT_DIR := $(TOOLS_OUTPUTDIR), \
COMMAND := open $(IDE_OUTPUTDIR)/$(PROJECT_FILE_NAME), \
))
TARGETS += $(open_xcode_project)
# Always call open without considering dependencies being up to date
FORCE:
build: $(build_xcode_project) $(copy_xcode_project)
open: $(open_xcode_project)
all: $(TARGETS)
else
build:
open:
all:
$(info Xcode projects are only supported on macOS)
endif
.PHONY: default all build open

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "4"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "Yes"
symbolName = "load_jimage_library"
moduleName = "libjvm.dylib">
<Actions>
<BreakpointActionProxy
ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
<ActionContent
consoleCommand = "process handle -n true -p true -s false SIGSEGV SIGBUS SIGUSR2">
</ActionContent>
</BreakpointActionProxy>
</Actions>
<Locations>
<Location
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "ClassLoader::load_jimage_library()"
moduleName = "libjvm.dylib"
usesParentBreakpointCondition = "Yes"
timestampString = "0"
startingColumnNumber = "0"
endingColumnNumber = "0"
startingLineNumber = "0"
endingLineNumber = "0"
offsetFromSymbolStart = "0">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "TEMPLATE_JDK_PATH/build/jdk/bin/java">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-version"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "DYLD_PRINT_ENV"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "TEMPLATE_JDK_PATH/build/jdk/bin/java">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,207 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
TEMPLATE_PBXBUILDFILE
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
D60000000000000000000003 /* script_before.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = script_before.sh; sourceTree = "<group>"; };
D60000000000000000000002 /* script_after.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = script_after.sh; sourceTree = "<group>"; };
D60000000000000000000006 /* libjvm.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libjvm.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
TEMPLATE_PBXFILEREFERENCE
/* End PBXFileReference section */
/* Begin PBXGroup section */
D60000000000000000000004 /* scripts */ = {
isa = PBXGroup;
children = (
D60000000000000000000003 /* script_before.sh */,
D60000000000000000000002 /* script_after.sh */,
);
name = scripts;
sourceTree = "<group>";
};
D60000000000000000000005 /* Products */ = {
isa = PBXGroup;
children = (
D60000000000000000000006 /* libjvm.dylib */,
);
name = Products;
sourceTree = "<group>";
};
D60000000000000000000001 = {
isa = PBXGroup;
children = (
D60000000000000000000004 /* scripts */,
TEMPLATE_GROUP_GENSRC /* gensrc */,
TEMPLATE_GROUP_SRC /* src */,
TEMPLATE_GROUP_TEST /* test */,
D60000000000000000000005 /* Products */,
);
sourceTree = "<group>";
};
TEMPLATE_GROUPS
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
D60000000000000000000000 /* jvm */ = {
isa = PBXNativeTarget;
buildConfigurationList = D6000000000000000000000F /* Build configuration list for PBXNativeTarget "jvm" */;
buildPhases = (
D60000000000000000000007 /* Run script_before */,
D60000000000000000000008 /* Sources */,
D6000000000000000000000A /* Run script_after */,
);
buildRules = (
);
dependencies = (
);
name = jvm;
productName = jvm;
productReference = D60000000000000000000006 /* libjvm.dylib */;
productType = "com.apple.product-type.library.dynamic";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
D60000000000000000000010 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Oracle;
TargetAttributes = {
D60000000000000000000000 = {
CreatedOnToolsVersion = 9.0;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = D6000000000000000000000E /* Build configuration list for PBXProject "jvm" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = D60000000000000000000001;
productRefGroup = D60000000000000000000005 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
D60000000000000000000000 /* jvm */,
);
};
/* End PBXProject section */
/* Begin PBXShellScriptBuildPhase section */
D60000000000000000000007 /* Run script_before */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run script_before";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd $PROJECT_DIR;\ntime ./script_before.sh;\n";
};
D6000000000000000000000A /* Run script_after */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run script_after";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd $PROJECT_DIR;\ntime ./script_after.sh;\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
D60000000000000000000008 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
TEMPLATE_PBXSOURCESSBUILDPHASE
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
D6000000000000000000000B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CODE_SIGN_IDENTITY = "-";
CONFIGURATION_BUILD_DIR = build/jdk/lib/server;
CONFIGURATION_TEMP_DIR = build;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
MTL_ENABLE_DEBUG_INFO = NO;
OBJROOT = build;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Release;
};
D6000000000000000000000D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CONFIGURATION_BUILD_DIR = "$(BUILD_DIR)";
EXECUTABLE_PREFIX = lib;
FRAMEWORK_SEARCH_PATHS = (
TEMPLATE_FRAMEWORK_SEARCH_PATHS
);
OTHER_CFLAGS = (
TEMPLATE_OTHER_CFLAGS
);
OTHER_LDFLAGS = (
TEMPLATE_OTHER_LDFLAGS
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SYMROOT = build/jdk/lib/server;
USER_HEADER_SEARCH_PATHS = (
TEMPLATE_USER_HEADER_SEARCH_PATHS
);
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
D6000000000000000000000E /* Build configuration list for PBXProject "jvm" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D6000000000000000000000B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D6000000000000000000000F /* Build configuration list for PBXNativeTarget "jvm" */ = {
isa = XCConfigurationList;
buildConfigurations = (
D6000000000000000000000D /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = D60000000000000000000010 /* Project object */;
}

View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = " NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "TEMPLATE_JDK_PATH/build/jdk/bin/java">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
<CommandLineArgument
argument = "-jar TEMPLATE_JDK_PATH/build/jdk/demo/jfc/J2Ddemo/J2Ddemo.jar"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
<EnvironmentVariables>
<EnvironmentVariable
key = "DYLD_PRINT_ENV"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<PathRunnable
runnableDebuggingMode = "0"
FilePath = "TEMPLATE_JDK_PATH/build/jdk/bin/java">
</PathRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D60000000000000000000000"
BuildableName = "libjvm.dylib"
BlueprintName = "jvm"
ReferencedContainer = "container:hotspot.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,34 @@
#!/bin/bash
#
# Copyright (c) 2017, 2024, 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.
#
# 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.
#
echo "running script_after.sh"
readonly JDK_LIB_PATH="build/jdk/lib/server/libjvm.dylib";
if [ ! -f ${JDK_LIB_PATH} ] ; then
{
echo ">>>>>>> Cannot find ${JDK_LIB_PATH}, the build failed!?";
exit 1;
}
fi

View File

@ -0,0 +1,67 @@
#!/bin/bash
#
# Copyright (c) 2017, 2024, 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.
#
# 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.
#
echo "running script_before.sh"
readonly JDK_BUILD_PATH="..";
readonly JAVAC_LOCATE_PATTERN="images/jdk/bin/javac";
readonly HOTSPOT_TOUCH_FILE="../../../src/hotspot/os/posix/jvm_posix.cpp";
echo ">>>>>>> Making a copy of JDK ...";
javac_file_array=( $(find ${JDK_BUILD_PATH} | grep ${JAVAC_LOCATE_PATTERN}) );
javac_file=${javac_file_array[0]};
if [ -z ${javac_file} ] ; then
{
echo ">>>>>>> ERROR: could not locate ${JAVAC_LOCATE_PATTERN} (did you remember to do \"make images\"?)";
exit 1;
}
fi
jdk_build_path=$(dirname $(dirname ${javac_file}));
if [ ! -f "build/${JAVAC_LOCATE_PATTERN}" ] ; then
{
echo ">>>>>>> Copying jdk over...";
rsync -a "${jdk_build_path}" "build/";
}
fi
# the following files will be supplied by the Xcode build
rm -rf "build/jdk/lib/server/libjvm.dylib";
rm -rf "build/jdk/lib/server/libjvm.dylib.dSYM";
echo ">>>>>>> DONE";
echo ">>>>>>> Touching ${HOTSPOT_TOUCH_FILE} to force HotspotVM rebuilt";
if [ ! -f ${HOTSPOT_TOUCH_FILE} ] ; then
{
echo ">>>>>>> Cannot find ${HOTSPOT_TOUCH_FILE}";
exit 1;
}
fi
touch ${HOTSPOT_TOUCH_FILE};
echo ">>>>>>> DONE";
echo ">>>>>>> Xcode should be building the HotspotVM now...";

View File

@ -0,0 +1,291 @@
/*
* Copyright (c) 2017, 2024, 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.
*
* 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.
*
*/
import java.io.File;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
public class DiskFile extends LinkedHashMap<Path, DiskFile> implements Comparable<DiskFile> {
// xcode id ex: D50000000000000000000000
private static long xcodeIdCount = 0xF0000001;
private final Path path;
private final boolean directory;
private final String xcodeId;
private final String xcodeId2;
private Iterable<String> compilerFlags;
public DiskFile(String path, boolean directory) {
this(stringToPath(path), directory);
}
private DiskFile(Path path, boolean directory) {
this.path = path;
this.directory = directory;
this.compilerFlags = null;
this.xcodeId = getNextXcodeId();
this.xcodeId2 = getNextXcodeId();
}
private static Path stringToPath(String string) {
if (string != null) {
return new File(string).toPath();
} else {
return null;
}
}
private static Path clipPath(Path path, String clip) {
return clipPath(path.toString(), clip);
}
private static Path clipPath(String path, String clip) {
String subpath = path;
if (path.contains(clip)) {
subpath = clip;
}
int index = path.indexOf(subpath);
return stringToPath(path.substring(index));
}
private String getNextXcodeId() {
String id = "D5FFFFFF" + Long.toHexString(xcodeIdCount).toUpperCase(Locale.ROOT);
xcodeIdCount++;
return id;
}
private String getPath() {
return this.path.toString();
}
public boolean isDirectory() {
return this.directory;
}
public void markAsCompiled(List<String> compilerFlags) {
this.compilerFlags = compilerFlags;
}
private boolean isCompiled() {
return (this.compilerFlags != null);
}
public String getXcodeId() {
return this.xcodeId;
}
public String generatePbxSourcesBuildPhase() {
String string = "";
if (isCompiled()) {
String fileName = getFileName();
string += String.format(" %s /* %s in Sources */,\n", this.xcodeId2, fileName);
} else if (isDirectory()) {
for (Map.Entry<Path, DiskFile> entry : entrySet()) {
DiskFile file = entry.getValue();
string += file.generatePbxSourcesBuildPhase();
}
}
return string;
}
// D5FFFFFFFFFFFFFFF0006506 /* vm_version.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D5FFFFFFFFFFFFFFF0006505 /* vm_version.cpp */; settings = {COMPILER_FLAGS = HEREHERE; }; };
public String generatePbxBuildFile() {
String string = "";
if (isCompiled()) {
String flagsString = "";
for (String flag : this.compilerFlags) {
flagsString += flag.replace("\"", "\\\\\"") + " ";
}
String fileName = getFileName();
string += String.format(" %s /* %s in Sources */ = {isa = PBXBuildFile; fileRef = %s /* %s */; settings = {COMPILER_FLAGS = \"%s\"; }; };\n", this.xcodeId2, fileName, this.xcodeId, fileName, flagsString);
} else if (isDirectory()) {
for (Map.Entry<Path, DiskFile> entry : entrySet()) {
DiskFile file = entry.getValue();
string += file.generatePbxBuildFile();
}
}
return string;
}
public String generatePbxFileReference(String relativePathToRoot) {
String string = "";
if (!isDirectory()) {
String fileName = getFileName();
String suffix = getFileNameSuffix();
string += String.format(" %s /* %s */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = %s%s; name = %s; path = \"%s%s\"; sourceTree = \"<group>\"; };\n", this.xcodeId, fileName, fileName, suffix, fileName, relativePathToRoot, getPath());
} else if (isDirectory()) {
for (Map.Entry<Path, DiskFile> entry : entrySet()) {
DiskFile file = entry.getValue();
string += file.generatePbxFileReference(relativePathToRoot);
}
}
return string;
}
public String generatePbxGroup() {
String string = String.format(" %s /* %s */ = {\n isa = PBXGroup;\n children = (\n", this.xcodeId, getFileName());
Set<DiskFile> sortedSet = new TreeSet<>(values());
for (DiskFile file : sortedSet) {
string += String.format(" %s /* %s */,\n", file.getXcodeId(), file.getFileName());
}
string += String.format(" );\n name = %s;\n sourceTree = \"<group>\";\n };\n", getFileName());
for (DiskFile file : sortedSet) {
if (file.isDirectory()) {
string += file.generatePbxGroup();
}
}
return string;
}
private ArrayList<DiskFile> getFiles(ArrayList<DiskFile> array) {
for (Map.Entry<Path, DiskFile> entry : entrySet()) {
DiskFile file = entry.getValue();
if (file.isDirectory()) {
array.add(file);
array = file.getFiles(array);
} else {
array.add(file);
}
}
return array;
}
public ArrayList<DiskFile> getFiles() {
return getFiles(new ArrayList<>());
}
public String getFilePath() {
return this.path.toString();
}
private String getFileName() {
Path fileName = this.path.getFileName();
if (fileName != null) {
return fileName.toString();
} else {
return this.path.toString();
}
}
private String getFileNameNoSuffix() {
String string;
Path fileName = this.path.getFileName();
if (fileName != null) {
string = fileName.toString();
int index = string.indexOf('.');
if (index >= 0) {
string = string.substring(0, index);
}
} else {
string = this.path.toString();
}
return string;
}
private String getFileNameSuffix() {
String fileName = getFileName();
int index = fileName.indexOf('.');
if (index >= 0) {
return fileName.substring(index);
} else {
return "";
}
}
public DiskFile getChild(String fileName) {
DiskFile child = null;
for (Map.Entry<Path, DiskFile> entry : entrySet()) {
DiskFile file = entry.getValue();
if (file.getFileName().equals(fileName)) {
child = entry.getValue();
break;
} else if (file.isDirectory()) {
child = file.getChild(fileName);
if (child != null) {
break;
}
}
}
return child;
}
private DiskFile getParent(Path path) {
Path pathParent = path.getParent();
DiskFile parent = get(pathParent);
if (parent == null) {
if (this.path.equals(pathParent)) {
parent = this;
} else {
parent = getParent(pathParent).get(pathParent);
}
parent.putIfAbsent(path, new DiskFile(path, true));
}
return parent;
}
public void addFile(Path path, String clip) {
path = clipPath(path, clip);
DiskFile parent = getParent(path);
parent.put(path, new DiskFile(path, false));
}
public void addDirectory(Path path, String clip) {
path = clipPath(path, clip);
DiskFile parent = getParent(path);
parent.putIfAbsent(path, new DiskFile(path, true));
}
@Override
public int compareTo(DiskFile file) {
// ".hpp", then ".inline.hpp", then ".cpp"
int equal = getFileNameNoSuffix().compareTo(file.getFileNameNoSuffix());
if (equal == 0) {
String suffix1 = getFileNameSuffix();
String suffix2 = file.getFileNameSuffix();
if (!suffix1.equals(".inline.hpp") && !suffix2.equals(".inline.hpp")) {
// .hpp before .cpp
equal = -(getFileNameSuffix().compareTo(file.getFileNameSuffix()));
} else if (suffix1.equals(".inline.hpp") && suffix2.equals(".hpp")) {
return 1;
} else if (suffix1.equals(".inline.hpp") && suffix2.equals(".cpp")) {
return -1;
} else if (suffix1.equals(".hpp") && suffix2.equals(".inline.hpp")) {
return -1;
} else if (suffix1.equals(".cpp") && suffix2.equals(".inline.hpp")) {
return 1;
}
}
return equal;
}
}

View File

@ -0,0 +1,754 @@
/*
* Copyright (c) 2017, 2024, 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.
*
* 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.
*
*/
import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystemLoopException;
import java.nio.file.FileVisitResult;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
public final class XcodeProjectMaker {
private static final String JDK_SCRIPT_TOKEN_1 = "configure";
private static final String JDK_SCRIPT_TOKEN_2 = ".jcheck";
private static final String COMPILER_LINE_HEADER = "-I";
private static final String COMPILER_IFRAMEWORK = "-iframework";
private static final String COMPILER_FFRAMEWORK = "-F";
private static final String SRC_HOTSPOT_PATH = "/src/hotspot";
private static final String TEST_HOTSPOT_PATH = "/test/hotspot/gtest";
private static final String ALIAS_JAVA_OLD = "java_old.sh";
private static final String ALIAS_JAVA_NEW = "java_new.sh";
private static final String JDK_BIN_JAVA = "/jdk/bin/java";
private static final String FILE_TOKEN = "\"file\": ";
private static final String COMMAND_TOKEN = "\"command\": ";
private static final String QUOTE_START_TOKEN = "'\\\"";
private static final String QUOTE_END_TOKEN = "\\\"'";
private static final String VERSION = "2.0.0";
private static final String EXCLUDE_PARSE_TOKEN_1 = "gtest";
private static final String TEMPLATE_FRAMEWORK_SEARCH_PATHS = "TEMPLATE_FRAMEWORK_SEARCH_PATHS";
private static final String TEMPLATE_OTHER_CFLAGS = "TEMPLATE_OTHER_CFLAGS";
private static final String TEMPLATE_OTHER_LDFLAGS = "TEMPLATE_OTHER_LDFLAGS";
private static final String TEMPLATE_USER_HEADER_SEARCH_PATHS = "TEMPLATE_USER_HEADER_SEARCH_PATHS";
private static final String TEMPLATE_GROUP_GENSRC = "TEMPLATE_GROUP_GENSRC";
private static final String TEMPLATE_GROUP_SRC = "TEMPLATE_GROUP_SRC";
private static final String TEMPLATE_GROUP_TEST = "TEMPLATE_GROUP_TEST";
private static final String TEMPLATE_GROUPS = "TEMPLATE_GROUPS";
private static final String TEMPLATE_PBXBUILDFILE = "TEMPLATE_PBXBUILDFILE";
private static final String TEMPLATE_PBXFILEREFERENCE = "TEMPLATE_PBXFILEREFERENCE";
private static final String TEMPLATE_PBXSOURCESSBUILDPHASE = "TEMPLATE_PBXSOURCESSBUILDPHASE";
private static final String TEMPLATE_JDK_PATH = "TEMPLATE_JDK_PATH";
private static final String HOTSPOT_PBXPROJ = "hotspot.xcodeproj";
private static final String PBXPROJ = "project.pbxproj";
private static final String XCSAHAREDDATA = "xcshareddata";
private static final String XCSCHEMES = "xcschemes";
private static final String JVM_XCSCHEME = "jvm.xcscheme";
private static final String J2D_XCSCHEME = "runJ2Demo.xcscheme";
private static final String XCDEBUGGER = "xcdebugger";
private static final String XCBKPTLIST = "Breakpoints_v2.xcbkptlist";
private static final String TEMPLATE_PBXPROJ = PBXPROJ + ".template";
private static final String TEMPLATE_JVM_XCSCHEME = JVM_XCSCHEME + ".template";
private static final String TEMPLATE_J2D_XCSCHEME = J2D_XCSCHEME + ".template";
private static final String TEMPLATE_XCBKPTLIST = XCBKPTLIST + ".template";
private static final String[] EXCLUDE_FILES_PREFIX = {"."};
private static final String[] EXCLUDE_FILES_POSTFIX = {".log", ".cmdline"};
private static final String[] COMPILER_FLAGS_INCLUDE = {"-m", "-f", "-D", "-W"};
private static final String[] COMPILER_FLAGS_IS = {"-g", "-Os", "-0"};
private static final String[] COMPILER_FLAGS_EXCLUDE = {"-DTHIS_FILE", "-DGTEST_OS_MAC", "-mmacosx-version-min", "-Werror"}; // "-Werror" causes Xcode to stop compiling
private static final int EXIT4 = -4;
private static final int EXIT5 = -5;
private static final int EXIT6 = -6;
private static final int EXIT7 = -7;
private final HashMap<String, ArrayList<String>> compiledFiles = new HashMap<>();
private final TreeSet<String> compilerFlags = new TreeSet<>();
private List<String> linkerFlags = List.of();
private final TreeSet<String> headerPaths = new TreeSet<>();
private final boolean debugLog;
private String projectMakerDataPath = null;
private String generatedHotspotPath = null;
private String iframework = null;
private String fframework = null;
private DiskFile rootGensrc = new DiskFile("/", true);
private DiskFile rootSrc = new DiskFile("/", true);
private DiskFile rootTest = new DiskFile("/", true);
public XcodeProjectMaker(boolean debugLog) {
this.debugLog = debugLog;
}
public static void main(String[] args) {
String workspaceRoot = args[0];
String outputDir = args[1];
String pathToProjectMakerData = args[2];
String pathToCompileCommands = args[3];
String pathToLinkerOptionsFile = args[4];
String linkerOptionsString = readFile(pathToLinkerOptionsFile);
boolean debugLog = args.length > 5 && args[5].equals("-d");
File xcodeFolder = new File(outputDir);
xcodeFolder.mkdirs();
String workspaceRootPathFromOutputDir = findRelativePathToWorkspaceRoot(outputDir);
if (debugLog) {
System.out.println();
System.out.println("Version " + VERSION);
System.out.println();
System.out.println(" Path to workspace root is \"" + workspaceRoot + "\"");
System.out.println("Path to compile commands file is \"" + pathToCompileCommands + "\"");
System.out.println(" Xcode project will be placed in \"" + outputDir + "\"");
System.out.println();
}
XcodeProjectMaker maker = new XcodeProjectMaker(debugLog);
maker.parseHotspotCompileCommands(pathToCompileCommands);
maker.linkerFlags = List.of(linkerOptionsString.split(" "));
maker.projectMakerDataPath = pathToProjectMakerData;
maker.printLogDetails();
maker.prepareFiles(workspaceRoot);
maker.makeXcodeProj(outputDir, workspaceRootPathFromOutputDir);
String pathToBuild = getFileParent(outputDir);
maker.makeAliases(outputDir, pathToBuild);
System.out.println();
System.out.println("The Xcode project for hotspot was succesfully created");
System.out.println("It can be found in '" + outputDir + "/" + HOTSPOT_PBXPROJ + "'");
System.out.println();
}
// find a path to what looks like jdk
private static String findRelativePathToWorkspaceRoot(String root) {
String pathToWorkspaceRoot = null;
String path = root;
boolean found1 = false;
boolean found2 = false;
while (!found1 && !found2) {
File folder = new File(path);
File[] files = folder.listFiles();
for (File file : files) {
String fileName = file.toPath().getFileName().toString();
if (fileName.equals(JDK_SCRIPT_TOKEN_1)) {
found1 = true;
}
if (fileName.equals(JDK_SCRIPT_TOKEN_2)) {
found2 = true;
}
if (found1 && found2) {
break;
}
}
if (!found1 && !found2) {
path = Paths.get(path).getParent().toString();
if (pathToWorkspaceRoot == null) {
pathToWorkspaceRoot = "..";
} else {
pathToWorkspaceRoot += "/..";
}
}
}
return pathToWorkspaceRoot;
}
private static String readFile(File file) {
return readFile(file.toPath());
}
private static String readFile(String path) {
return readFile(Paths.get(path));
}
private static String readFile(Path path) {
try {
return Files.readString(path);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
private static void writeFile(File file, String string) {
writeFile(file.toPath(), string);
}
private static void writeFile(Path path, String string) {
try {
Files.writeString(path, string);
} catch (IOException e) {
e.printStackTrace();
System.exit(EXIT4);
}
}
private static boolean excludeFile(Path path) {
return excludeFile(path.toString());
}
private static boolean excludeFile(String string) {
return excludeFile(string, null);
}
private static boolean excludeFile(String string, String exclude) {
if (exclude != null) {
if (contains(string, exclude)) {
return true;
}
}
for (String excludeFilesPrefix : EXCLUDE_FILES_PREFIX) {
if (string.startsWith(excludeFilesPrefix)) {
return true;
}
}
for (String excludeFilesPostfix : EXCLUDE_FILES_POSTFIX) {
if (string.endsWith(excludeFilesPostfix)) {
return true;
}
}
return false;
}
private static boolean isExcludeCompilerFlag(String string) {
boolean flag = false;
for (String exclude : COMPILER_FLAGS_EXCLUDE) {
if (string.contains(exclude)) {
flag = true;
break;
}
}
return flag;
}
private static boolean isCompilerFlag(String string) {
boolean flag = false;
for (String include : COMPILER_FLAGS_INCLUDE) {
if (string.startsWith(include)) {
flag = true;
break;
}
}
for (String is : COMPILER_FLAGS_IS) {
if (string.equals(is)) {
flag = true;
break;
}
}
if (isExcludeCompilerFlag(string)) {
flag = false;
}
return flag;
}
private static String strip(String string) {
return string.substring(2, string.length() - 1);
}
private static String strip(String string, String token) {
int start = string.indexOf(token);
int end = start + token.length();
return strip(string.substring(end));
}
private static boolean contains(String string, String token) {
return ((string.length() >= token.length()) && (string.contains(token)));
}
private static String getFileParent(String path) {
return Paths.get(path).getParent().toString();
}
private static String extractPath(String string, String from, String to) {
String result = null;
String[] tokens = string.split("/");
int i = 0;
for (; i < tokens.length; i++) {
if (tokens[i].equals(from)) {
result = "";
break;
}
}
for (; i < tokens.length; i++) {
result += "/" + tokens[i];
if (tokens[i].equals(to)) {
break;
}
}
return result;
}
private void extractCommonCompilerFlags() {
// heuristic, find average count of number of flags used by each compiled file
int countFiles = 0;
int countFlags = 0;
for (Map.Entry<String, ArrayList<String>> entry : this.compiledFiles.entrySet()) {
countFiles++;
List<String> flags = entry.getValue();
countFlags += flags.size();
}
// when finding common flags, only consider files with this many flags
int flagCutoff = (countFlags / countFiles) / 2;
// collect all flags
for (Map.Entry<String, ArrayList<String>> entry : this.compiledFiles.entrySet()) {
List<String> flags = entry.getValue();
if (flags.size() > flagCutoff) {
this.compilerFlags.addAll(flags);
}
}
// find flags to remove
Set<String> removeFlags = new TreeSet<>();
for (Map.Entry<String, ArrayList<String>> entry : this.compiledFiles.entrySet()) {
List<String> flags = entry.getValue();
if (flags.size() > flagCutoff) {
for (String common : this.compilerFlags) {
if (!flags.contains(common)) {
removeFlags.add(common);
}
}
}
}
// leave only common flags
for (String flag : removeFlags) {
this.compilerFlags.remove(flag);
}
// remove common flags from each compiler file, leaving only the unique ones
for (Map.Entry<String, ArrayList<String>> entry : this.compiledFiles.entrySet()) {
List<String> flags = entry.getValue();
if (flags.size() > flagCutoff) {
for (String common : this.compilerFlags) {
flags.remove(common);
}
}
}
}
private void extractCompilerFlags(String line) {
boolean verboseCompilerTokens = false;
String file = null;
ArrayList<String> flags = null;
String[] commands = line.split(",");
for (String command : commands) {
if (contains(command, FILE_TOKEN)) {
file = strip(command, FILE_TOKEN);
//verbose_compiler_tokens = Contains(file, "vm_version.cpp");
} else if (contains(command, COMMAND_TOKEN)) {
String tokens = strip(command, COMMAND_TOKEN);
String[] arguments = tokens.split(" ");
if (arguments.length >= 3) {
flags = new ArrayList<>();
for (int a = 2; a < arguments.length; a++) {
String argument = arguments[a];
if (isCompilerFlag(argument)) {
// catch argument like -DVMTYPE=\"Minimal\"
if (contains(argument, "\\\\\\\"") && argument.endsWith("\\\\\\\"")) {
// TODO: more robust fix needed here
argument = argument.replace("\\", "");
argument = argument.replaceFirst("\"", "~.~"); // temp token ~.~
argument = argument.replace("\"", "\\\"'");
argument = argument.replace("~.~", "'\\\"");
}
// argument like -DHOTSPOT_VM_DISTRO='\"Java HotSpot(TM)\"'
// gets split up, so reconstruct as single string
if (contains(argument, QUOTE_START_TOKEN) && !argument.endsWith(QUOTE_END_TOKEN)) {
String fullArgument = argument;
do {
++a;
argument = arguments[a];
fullArgument = fullArgument + " " + argument;
} while (!argument.endsWith(QUOTE_END_TOKEN));
argument = fullArgument;
}
flags.add(argument);
if (verboseCompilerTokens) {
System.out.println(" FOUND COMPILER FLAG: " + argument);
}
} else if (argument.startsWith(COMPILER_LINE_HEADER)) {
this.headerPaths.add(argument.substring(2));
} else if (argument.equals(COMPILER_IFRAMEWORK)) {
if (iframework == null) {
++a;
this.iframework = arguments[a]; // gets the value, so skip it for the next loop
}
} else if (argument.equals(COMPILER_FFRAMEWORK)) {
if (fframework == null) {
++a;
this.fframework = arguments[a]; // gets the value, so skip it for the next loop
}
}
}
}
}
}
if ((file != null) && (flags != null)) {
this.compiledFiles.put(file, flags);
} else {
System.err.println(" WARNING: extractCompilerFlags returns file:" + file + ", flags:" + flags);
}
if (verboseCompilerTokens) {
System.exit(0);
}
}
public void parseHotspotCompileCommands(String path) {
String content = readFile(path);
String[] parts = content.split("\\{"); // }
int found = 0;
for (String line : parts) {
if (!contains(line, EXCLUDE_PARSE_TOKEN_1) && !line.startsWith("[")) {
extractCompilerFlags(line);
found++;
}
}
if (debugLog) {
System.out.println("Found total of " + found + " files that make up the libjvm.dylib");
}
extractCommonCompilerFlags();
// figure out "gensrc" folder
// from: "/Users/gerard/Desktop/jdk_test/jdk10/build/macosx-x86_64-normal-server-fastdebug/hotspot/variant-server/gensrc/adfiles/ad_x86_clone.cpp"
// to: "/build/macosx-x86_64-normal-server-fastdebug/hotspot/variant-server/gensrc"
for (Map.Entry<String, ArrayList<String>> entry : this.compiledFiles.entrySet()) {
String file = entry.getKey();
if (file.contains("gensrc")) {
this.generatedHotspotPath = extractPath(file, "build", "gensrc");
//generatedHotspotPath = "/build/macosx-x64/hotspot/variant-server/gensrc";
//generatedHotspotPath = "/build/macosx-x86_64-normal-server-fastdebug/hotspot/variant-server/gensrc";
}
}
}
// https://docs.oracle.com/javase/tutorial/displayCode.html?code=https://docs.oracle.com/javase/tutorial/essential/io/examples/Copy.java
private DiskFile getHotspotFiles(DiskFile root, String workspaceRoot, String hotspotPath) {
File file = new File(workspaceRoot + "/" + hotspotPath);
if (!file.exists()) {
return null;
}
try {
final Path rootDir = Paths.get(workspaceRoot + hotspotPath);
Files.walkFileTree(rootDir, new HotspotFileVisitor(root, hotspotPath));
} catch (IOException ex) {
System.err.println("ex: " + ex);
}
return root;
}
public void prepareFiles(String workspaceRoot) {
this.rootGensrc = getHotspotFiles(this.rootGensrc, workspaceRoot, this.generatedHotspotPath);
this.rootSrc = getHotspotFiles(this.rootSrc, workspaceRoot, SRC_HOTSPOT_PATH);
this.rootTest = getHotspotFiles(this.rootTest, workspaceRoot, TEST_HOTSPOT_PATH);
// make a copy of files from the log
Set<String> logFiles = new TreeSet<>(this.compiledFiles.keySet());
int totalMarkedFiles = 0;
DiskFile[] roots = { this.rootGensrc, this.rootSrc };
for (DiskFile root : roots) {
List<DiskFile> diskFiles = root.getFiles();
for (DiskFile diskFile : diskFiles) {
if (!diskFile.isDirectory()) {
String logFileProcessed = null;
String diskFilePath = diskFile.getFilePath();
for (String logFilePath : logFiles) {
if (contains(logFilePath, diskFilePath)) {
totalMarkedFiles++;
logFileProcessed = logFilePath;
// mark the file as needing compilation
diskFile.markAsCompiled(this.compiledFiles.get(logFilePath));
// break early if found
break;
}
}
if (logFileProcessed != null) {
// remove the file, so we don't have to search through it again
logFiles.remove(logFileProcessed);
}
}
}
}
if (this.compiledFiles.size() != totalMarkedFiles) {
System.err.println("\nError: was expecting to compile " + this.compiledFiles.size() + " files, but marked " + totalMarkedFiles);
for (String file : logFiles) {
System.err.println("file: " + file);
}
System.exit(EXIT5);
}
if (!logFiles.isEmpty()) {
System.err.println("\nError: unprocessed files left over:");
for (String logFile : logFiles) {
System.err.println(" " + logFile);
}
System.exit(EXIT6);
}
}
public void printLogDetails() {
if (!debugLog) return;
System.out.println("\nFound " + this.compilerFlags.size() + " common compiler flags:");
for (String flag : this.compilerFlags) {
System.out.println(" " + flag);
}
System.out.println("\nList of compiled files (each one uses common compiler flags plus extra ones as specified):");
int count = 1;
for (Map.Entry<String, ArrayList<String>> entry : this.compiledFiles.entrySet()) {
String file = entry.getKey();
System.out.format("%4d: %s\n", (count), file);
count++;
List<String> flags = entry.getValue();
for (String flag : flags) {
System.out.println(" " + flag);
}
}
System.out.println("\nFound " + this.linkerFlags.size() + " linker flags:");
for (String flag : this.linkerFlags) {
System.out.println(" " + flag);
}
System.out.println("\nFound " + this.headerPaths.size() + " header paths:");
for (String header : this.headerPaths) {
System.out.println(" " + header);
}
System.out.println("\nFrameworks:");
System.out.println(" -iframework " + iframework);
System.out.println(" -f " + fframework);
}
private String makeProjectPbxproj(String workspaceRootPathFromOutputDir, String string) {
String cFlags = "";
for (String flag : this.compilerFlags) {
cFlags += " \"" + flag.replace("\"", "\\\\\"") + "\",\n";
}
cFlags = cFlags.substring(0, cFlags.length() - 2);
string = string.replaceFirst(TEMPLATE_OTHER_CFLAGS, cFlags);
String ldFlags = "";
for (String flag : this.linkerFlags) {
ldFlags += " \"" + flag + "\",\n";
}
ldFlags = ldFlags.substring(0, ldFlags.length() - 2);
string = string.replaceFirst(TEMPLATE_OTHER_LDFLAGS, ldFlags);
String headerPaths = "";
for (String header : this.headerPaths) {
headerPaths += " \"" + header + "\",\n";
}
headerPaths = headerPaths.substring(0, headerPaths.length() - 2);
string = string.replaceFirst(TEMPLATE_USER_HEADER_SEARCH_PATHS, headerPaths);
String frameworkPaths = "";
if (fframework != null) {
frameworkPaths += " \"" + fframework + "\"\n";
}
string = string.replaceFirst(TEMPLATE_FRAMEWORK_SEARCH_PATHS, frameworkPaths);
DiskFile gensrcFile = this.rootGensrc.getChild("gensrc");
string = string.replaceFirst(TEMPLATE_GROUP_GENSRC, " " + gensrcFile.getXcodeId());
DiskFile srcFile = this.rootSrc.getChild("src");
string = string.replaceFirst(TEMPLATE_GROUP_SRC, " " + srcFile.getXcodeId());
DiskFile testFile = this.rootTest.getChild("test");
string = string.replaceFirst(TEMPLATE_GROUP_TEST, " " + testFile.getXcodeId());
String gensrcGroups = gensrcFile.generatePbxGroup();
String srcGroups = srcFile.generatePbxGroup();
String testGroups = testFile.generatePbxGroup();
string = string.replaceFirst(TEMPLATE_GROUPS, gensrcGroups + srcGroups + testGroups);
String gensrcFiles = gensrcFile.generatePbxFileReference(workspaceRootPathFromOutputDir);
String srcFiles = srcFile.generatePbxFileReference(workspaceRootPathFromOutputDir);
String testFiles = testFile.generatePbxFileReference(workspaceRootPathFromOutputDir);
string = string.replaceFirst(TEMPLATE_PBXFILEREFERENCE, gensrcFiles + srcFiles + testFiles);
String gensrcCompiled = gensrcFile.generatePbxBuildFile();
String compiled = srcFile.generatePbxBuildFile();
string = string.replaceFirst(TEMPLATE_PBXBUILDFILE, gensrcCompiled + compiled);
String gensrcBuilt = gensrcFile.generatePbxSourcesBuildPhase();
String built = srcFile.generatePbxSourcesBuildPhase();
string = string.replaceFirst(TEMPLATE_PBXSOURCESSBUILDPHASE, gensrcBuilt + built);
return string;
}
private String makeTemplateXcscheme(String outputDir, String string) {
string = string.replaceAll(TEMPLATE_JDK_PATH, outputDir);
return string;
}
public void makeXcodeProj(String outputDir, String workspaceRootPathFromOutputDir) {
/*
jvm.xcodeproj <-- folder
project.pbxproj <-- file
xcshareddata <-- folder
xcschemes <-- folder
jvm.xcscheme <-- file
xcdebugger <-- folder
Breakpoints_v2.xcbkptlist <-- file
*/
File xcodeDir = new File(outputDir);
File jvmXcodeprojDir = new File(xcodeDir, HOTSPOT_PBXPROJ);
File projectPbxprojFile = new File(jvmXcodeprojDir, PBXPROJ);
File xcshareddataDir = new File(jvmXcodeprojDir, XCSAHAREDDATA);
File xcschemesDir = new File(xcshareddataDir, XCSCHEMES);
File jvmXcschemeFile = new File(xcschemesDir, JVM_XCSCHEME);
File j2DemoXcschemeFile = new File(xcschemesDir, J2D_XCSCHEME);
File xcdebuggerDir = new File(xcshareddataDir, XCDEBUGGER);
File jBreakpointsV2XcbkptlistFile = new File(xcdebuggerDir, XCBKPTLIST);
if (xcodeDir.exists()) {
xcodeDir.delete();
}
jvmXcodeprojDir.mkdirs();
xcshareddataDir.mkdirs();
xcschemesDir.mkdirs();
xcdebuggerDir.mkdirs();
File dataDir = new File(projectMakerDataPath);
File templateProjectPbxprojFile = new File(dataDir, TEMPLATE_PBXPROJ);
File templateJvmXcschemeFile = new File(dataDir, TEMPLATE_JVM_XCSCHEME);
File templateJ2DemoXcschemeFile = new File(dataDir, TEMPLATE_J2D_XCSCHEME);
File templateJBreakpointsV2XcbkptlistFile = new File(dataDir, TEMPLATE_XCBKPTLIST);
String projectPbxprojString = readFile(templateProjectPbxprojFile);
String jvmXcschemeString = readFile(templateJvmXcschemeFile);
String j2DemoXcschemeString = readFile(templateJ2DemoXcschemeFile);
String jBreakpointsV2XcbkptlistString = readFile(templateJBreakpointsV2XcbkptlistFile);
writeFile(projectPbxprojFile, makeProjectPbxproj(workspaceRootPathFromOutputDir, projectPbxprojString));
writeFile(jvmXcschemeFile, makeTemplateXcscheme(outputDir, jvmXcschemeString));
writeFile(j2DemoXcschemeFile, makeTemplateXcscheme(outputDir, j2DemoXcschemeString));
writeFile(jBreakpointsV2XcbkptlistFile, jBreakpointsV2XcbkptlistString);
}
public void makeAliases(String outputDir, String pathToBuild) {
File xcodeDir = new File(outputDir);
File jdkOldSh = new File(xcodeDir, ALIAS_JAVA_OLD);
File jdkNewSh = new File(xcodeDir, ALIAS_JAVA_NEW);
writeFile(jdkOldSh, "#!/bin/bash\n" + pathToBuild + JDK_BIN_JAVA + " $@");
writeFile(jdkNewSh, "#!/bin/bash\n" + outputDir + "/build" + JDK_BIN_JAVA + " $@");
try {
Set<PosixFilePermission> permissions = new HashSet<>();
permissions.add(PosixFilePermission.OWNER_READ);
permissions.add(PosixFilePermission.OWNER_WRITE);
permissions.add(PosixFilePermission.OWNER_EXECUTE);
permissions.add(PosixFilePermission.GROUP_READ);
permissions.add(PosixFilePermission.OTHERS_READ);
Files.setPosixFilePermissions(jdkOldSh.toPath(), permissions);
Files.setPosixFilePermissions(jdkNewSh.toPath(), permissions);
} catch (IOException ex) {
System.err.println("Warning: unable to change file permissions");
System.err.println(ex);
}
}
private static class HotspotFileVisitor implements FileVisitor<Path> {
private final DiskFile root;
private final String hotspotPath;
public HotspotFileVisitor(DiskFile root, String hotspotPath) {
this.root = root;
this.hotspotPath = hotspotPath;
}
@Override
public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) {
if (excludeFile(path)) {
return FileVisitResult.SKIP_SUBTREE;
} else {
// consider folders based on their names
Path file = path.getFileName();
if (!excludeFile(file)) {
root.addDirectory(path, hotspotPath);
return FileVisitResult.CONTINUE;
} else {
// skip folders with names beginning with ".", etc
return FileVisitResult.SKIP_SUBTREE;
}
}
}
@Override
public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) {
Path file = path.getFileName();
if (!excludeFile(file)) {
//System.err.println(path.toString());
root.addFile(path, hotspotPath);
}
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult postVisitDirectory(Path path, IOException exc) {
return FileVisitResult.CONTINUE;
}
@Override
public FileVisitResult visitFileFailed(Path path, IOException exc) {
if (exc instanceof FileSystemLoopException) {
System.err.println("cycle detected: " + path);
} else {
System.err.format("Unable to process: %s: %s\n", path, exc);
}
return FileVisitResult.CONTINUE;
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2024, 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
@ -638,7 +638,7 @@ public class Main {
index++;
}
boolean updateEndTd = false;
Pattern styleAttr = Pattern.compile("(?<before>.*style=\")(?<style>[^\"]*)(?<after>\".*)");
Pattern styleAttr = Pattern.compile("(?s)(?<before>.*style=\")(?<style>[^\"]*)(?<after>\".*)");
for (Entry e : entries) {
if (simple && e.column == maxIndex) {
String attrs = e.html.substring(3, e.html.length() - 1);

View File

@ -106,7 +106,8 @@ public class JSpec implements Taglet {
this.idPrefix = idPrefix;
}
private static final Pattern TAG_PATTERN = Pattern.compile("(?s)(.+ )?(?<chapter>[1-9][0-9]*)(?<section>[0-9.]*)( .*)?$");
// Note: Matches special cases like @jvms 6.5.checkcast
private static final Pattern TAG_PATTERN = Pattern.compile("(?s)(.+ )?(?<chapter>[1-9][0-9]*)(?<section>[0-9a-z_.]*)( .*)?$");
/**
* Returns the set of locations in which the tag may be used.

Some files were not shown because too many files have changed in this diff Show More