Skip to content

Commit 0348030

Browse files
author
mikael
committed
8029797: Let jprt run configure when building
Reviewed-by: dholmes
1 parent b5a8511 commit 0348030

File tree

5 files changed

+26
-177
lines changed

5 files changed

+26
-177
lines changed

Makefile

+1-5
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ else
6666
# First, find out the valid targets
6767
# Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
6868
# available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
69-
all_phony_targets=$(filter-out $(global_targets) bundles bundles-only final-images-only, $(strip $(shell \
69+
all_phony_targets=$(filter-out $(global_targets), $(strip $(shell \
7070
cd $(root_dir) && $(MAKE) -p -q FRC SPEC=$(firstword $(SPEC)) | \
7171
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
7272

@@ -79,10 +79,6 @@ else
7979
endif
8080
endif
8181

82-
# Include this after a potential spec file has been included so that the bundles target
83-
# has access to the spec variables.
84-
include $(root_dir)/make/Jprt.gmk
85-
8682
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
8783
# If you addd more global targets, please update the variable global_targets in MakeHelpers.
8884

make/Jprt.gmk

+2-171
Original file line numberDiff line numberDiff line change
@@ -23,151 +23,7 @@
2323
# questions.
2424
#
2525

26-
# This file is included by the root NewerMakefile and contains targets
27-
# and utilities needed by JPRT.
28-
29-
# Utilities used in this Makefile. Most of this makefile executes without
30-
# the context of a spec file from configure.
31-
CAT=cat
32-
CMP=cmp
33-
CP=cp
34-
ECHO=echo
35-
MKDIR=mkdir
36-
PRINTF=printf
37-
PWD=pwd
38-
# Insure we have a path that looks like it came from pwd
39-
# (This is mostly for Windows sake and drive letters)
40-
define UnixPath # path
41-
$(shell (cd "$1" && $(PWD)))
42-
endef
43-
44-
BUILD_DIR_ROOT:=$(root_dir)/build
45-
46-
ifdef OPENJDK
47-
OPEN_BUILD=true
48-
else
49-
OPEN_BUILD := $(if $(or $(wildcard $(root_dir)/jdk/src/closed), \
50-
$(wildcard $(root_dir)/jdk/make/closed), \
51-
$(wildcard $(root_dir)/jdk/test/closed), \
52-
$(wildcard $(root_dir)/hotspot/src/closed), \
53-
$(wildcard $(root_dir)/hotspot/make/closed), \
54-
$(wildcard $(root_dir)/hotspot/test/closed)), \
55-
false,true)
56-
endif
57-
58-
HOTSPOT_AVAILABLE := $(if $(wildcard $(root_dir)/hotspot),true,false)
59-
60-
###########################################################################
61-
# To help in adoption of the new configure&&make build process, a bridge
62-
# build will use the old settings to run configure and do the build.
63-
64-
# Build with the configure bridge. After running configure, restart make
65-
# to parse the new spec file.
66-
BRIDGE_TARGETS := all
67-
# Add bootcycle-images target if legacy variable is set.
68-
ifeq ($(SKIP_BOOT_CYCLE),false)
69-
BRIDGE_TARGETS += bootcycle-images
70-
endif
71-
bridgeBuild: bridge2configure
72-
@cd $(root_dir) && $(MAKE) -f Makefile $(BRIDGE_TARGETS)
73-
74-
# Bridge from old Makefile ALT settings to configure options
75-
bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts
76-
bash ./configure $(strip $(shell $(CAT) $<))
77-
78-
# Create a file with configure options created from old Makefile mechanisms.
79-
$(BUILD_DIR_ROOT)/.bridge2configureOpts: $(BUILD_DIR_ROOT)/.bridge2configureOptsLatest
80-
$(RM) $@
81-
$(CP) $< $@
82-
83-
# Use this file to only change when obvious things have changed
84-
$(BUILD_DIR_ROOT)/.bridge2configureOptsLatest: FRC
85-
86-
$(MKDIR) -p $(BUILD_DIR_ROOT)
87-
@$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> [email protected]
88-
ifdef ARCH_DATA_MODEL
89-
@$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> [email protected]
90-
endif
91-
ifeq ($(ARCH_DATA_MODEL),32)
92-
@$(ECHO) " --with-jvm-variants=client,server " >> [email protected]
93-
endif
94-
ifdef ALT_PARALLEL_COMPILE_JOBS
95-
@$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> [email protected]
96-
endif
97-
ifdef ALT_BOOTDIR
98-
@$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> [email protected]
99-
endif
100-
ifdef ALT_CUPS_HEADERS_PATH
101-
@$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> [email protected]
102-
endif
103-
ifdef ALT_FREETYPE_HEADERS_PATH
104-
@$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> [email protected]
105-
endif
106-
ifdef ENABLE_SJAVAC
107-
@$(ECHO) " --enable-sjavac" >> [email protected]
108-
endif
109-
ifdef JDK_UPDATE_VERSION
110-
@$(ECHO) " --with-update-version=$(JDK_UPDATE_VERSION)" >> [email protected]
111-
endif
112-
ifeq ($(HOTSPOT_AVAILABLE),false)
113-
ifdef ALT_JDK_IMPORT_PATH
114-
@$(ECHO) " --with-import-hotspot=$(call UnixPath,$(ALT_JDK_IMPORT_PATH)) " >> [email protected]
115-
endif
116-
endif
117-
ifeq ($(OPEN_BUILD),true)
118-
@$(ECHO) " --enable-openjdk-only " >> [email protected]
119-
else
120-
# Todo: move to closed?
121-
ifdef ALT_MOZILLA_HEADERS_PATH
122-
@$(ECHO) " --with-mozilla-headers=$(call UnixPath,$(ALT_MOZILLA_HEADERS_PATH)) " >> [email protected]
123-
endif
124-
ifdef ALT_JUNIT_DIR
125-
@$(ECHO) " --with-junit-dir=$(call UnixPath,$(ALT_JUNIT_DIR)) " >> [email protected]
126-
endif
127-
ifdef ANT_HOME
128-
@$(ECHO) " --with-ant-home=$(call UnixPath,$(ANT_HOME)) " >> [email protected]
129-
endif
130-
ifdef ALT_JAVAFX_ZIP_DIR
131-
@$(ECHO) " --with-javafx-zip-dir=$(call UnixPath,$(ALT_JAVAFX_ZIP_DIR)) " >> [email protected]
132-
endif
133-
ifdef ALT_JMC_ZIP_DIR
134-
@$(ECHO) " --with-jmc-zip-dir=$(call UnixPath,$(ALT_JMC_ZIP_DIR)) " >> [email protected]
135-
endif
136-
ifdef ALT_WIXDIR
137-
@$(ECHO) " --with-wix=$(call UnixPath,$(ALT_WIXDIR)) " >> [email protected]
138-
endif
139-
ifdef ALT_INSTALL_LZMA_PATH
140-
@$(ECHO) " --with-lzma-path=$(call UnixPath,$(ALT_INSTALL_LZMA_PATH)) " >> [email protected]
141-
endif
142-
ifdef ALT_INSTALL_UPX_PATH
143-
@$(ECHO) " --with-upx-path=$(call UnixPath,$(ALT_INSTALL_UPX_PATH)) " >> [email protected]
144-
endif
145-
ifdef ALT_INSTALL_UPX_FILENAME
146-
@$(ECHO) " --with-upx-filename=$(call UnixPath,$(ALT_INSTALL_UPX_FILENAME)) " >> [email protected]
147-
endif
148-
ifdef ALT_CCSS_SIGNING_DIR
149-
@$(ECHO) " --with-ccss-signing=$(call UnixPath,$(ALT_CCSS_SIGNING_DIR)) " >> [email protected]
150-
endif
151-
ifdef ALT_SLASH_JAVA
152-
@$(ECHO) " --with-java-devtools=$(call UnixPath,$(ALT_SLASH_JAVA)/devtools) " >> [email protected]
153-
endif
154-
ifdef ALT_SPARKLE_FRAMEWORK_DIR
155-
@$(ECHO) " --with-sparkle-framework=$(call UnixPath,$(ALT_SPARKLE_FRAMEWORK_DIR)) " >> [email protected]
156-
endif
157-
endif
158-
@if [ -f $@ ] ; then \
159-
if ! $(CMP) $@ [email protected] > /dev/null ; then \
160-
$(CP) [email protected] $@ ; \
161-
fi ; \
162-
else \
163-
$(CP) [email protected] $@ ; \
164-
fi
165-
166-
167-
PHONY_LIST += bridge2configure bridgeBuild
168-
169-
###########################################################################
170-
# JPRT targets
26+
# This file is contains targets utilities needed by JPRT.
17127

17228
ifndef JPRT_ARCHIVE_BUNDLE
17329
JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
@@ -176,23 +32,6 @@ ifndef JPRT_ARCHIVE_INSTALL_BUNDLE
17632
JPRT_ARCHIVE_INSTALL_BUNDLE=/tmp/jprt_bundles/product-install.zip
17733
endif
17834

179-
# These targets execute in a SPEC free context, before calling bridgeBuild
180-
# to generate the SPEC.
181-
jprt_build_product: DEBUG_LEVEL=release
182-
jprt_build_product: BUILD_DIRNAME=*-release
183-
jprt_build_product: jprt_build_generic
184-
185-
jprt_build_fastdebug: DEBUG_LEVEL=fastdebug
186-
jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug
187-
jprt_build_fastdebug: jprt_build_generic
188-
189-
jprt_build_debug: DEBUG_LEVEL=slowdebug
190-
jprt_build_debug: BUILD_DIRNAME=*-debug
191-
jprt_build_debug: jprt_build_generic
192-
193-
jprt_build_generic: BRIDGE_TARGETS+=jprt_bundle
194-
jprt_build_generic: bridgeBuild
195-
19635
# This target must be called in the context of a SPEC file
19736
jprt_bundle: $(JPRT_ARCHIVE_BUNDLE)
19837
@$(call CheckIfMakeAtEnd)
@@ -238,14 +77,6 @@ final-images-only: start-make
23877
@$(call TargetExit)
23978

24079

241-
# Keep track of phony targets
242-
PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
243-
jprt_build_generic bundles jprt_bundle \
244-
final-images final-images-only
245-
24680
###########################################################################
24781
# Phony targets
248-
.PHONY: $(PHONY_LIST)
249-
250-
# Force target
251-
FRC:
82+
.PHONY: jprt_bundle bundles bundles-only final-images final-images-only

make/Main.gmk

+2
Original file line numberDiff line numberDiff line change
@@ -242,4 +242,6 @@ clean-test:
242242
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-nashorn clean-images clean-docs clean-test clean-overlay-images clean-bootcycle-build
243243
.PHONY: profiles profiles-only profiles-oscheck
244244

245+
include $(root_dir)/make/Jprt.gmk
246+
245247
FRC: # Force target

make/MakeHelpers.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ BUILDTIMESDIR=$(OUTPUT_ROOT)/tmp/buildtimes
5050

5151
# Global targets are possible to run either with or without a SPEC. The prototypical
5252
# global target is "help".
53-
global_targets=help jprt% bridgeBuild bridge2configure
53+
global_targets=help
5454

5555
##############################
5656
# Functions

make/jprt.properties

+20
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,23 @@ jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets}
151151
# Directories to be excluded from the source bundles
152152
jprt.bundle.exclude.src.dirs=build dist webrev
153153

154+
# Instruct jprt to use configure when building
155+
jprt.build.use.configure=true
156+
jprt.build.flavor.product.target=jprt_bundle
157+
jprt.build.flavor.fastdebug.target=jprt_bundle
158+
jprt.build.flavor.debug.target=jprt_bundle
159+
160+
# Add these configure args to all builds
161+
jprt.build.configure.args= \
162+
--with-boot-jdk=$ALT_BOOTDIR \
163+
--with-jobs=$ALT_PARALLEL_COMPILE_JOBS
164+
165+
# Add these configure args to 32 bit builds
166+
jprt.i586.build.configure.args= \
167+
--with-target-bits=32 \
168+
--with-jvm-variants=client,server
169+
170+
# Use these configure args to define debug level.
171+
jprt.product.build.configure.args=--with-debug-level=release
172+
jprt.fastdebug.build.configure.args=--with-debug-level=fastdebug
173+
jprt.debug.build.configure.args=--with-debug-level=slowdebug

0 commit comments

Comments
 (0)