bootcycle-spec.gmk.in revision 2378:e75ac6a88841
178344Sobrien#
278344Sobrien# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
398184Sgordon# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
498184Sgordon#
578344Sobrien# This code is free software; you can redistribute it and/or modify it
678344Sobrien# under the terms of the GNU General Public License version 2 only, as
778344Sobrien# published by the Free Software Foundation.  Oracle designates this
878344Sobrien# particular file as subject to the "Classpath" exception as provided
9124616Smtm# by Oracle in the LICENSE file that accompanied this code.
1098184Sgordon#
1198184Sgordon# This code is distributed in the hope that it will be useful, but WITHOUT
1278344Sobrien# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1398184Sgordon# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1498184Sgordon# version 2 for more details (a copy is included in the LICENSE file that
1598184Sgordon# accompanied this code).
1678344Sobrien#
1778344Sobrien# You should have received a copy of the GNU General Public License version
1878344Sobrien# 2 along with this work; if not, write to the Free Software Foundation,
1998184Sgordon# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2078344Sobrien#
21124622Smtm# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22124622Smtm# or visit www.oracle.com if you need additional information or have any
2378344Sobrien# questions.
24124622Smtm#
25102864Sgordon
26124622Smtm# Support for building boot cycle builds
27124622Smtm
28124622SmtmBOOT_JDK_MODULAR := true
29124622Smtm
30124622Smtm# First include the real base spec.gmk file
31124622Smtminclude @SPEC@
32102864Sgordon
33102864Sgordon# Check that the user did not try to specify a different java to use for compiling.
34102864Sgordon# On windows we need to account for fixpath being first word.
3578344Sobrienifeq ($(firstword $(JAVA)),$(FIXPATH))
3678344Sobrien  JAVA_EXEC_POS=2
3778344Sobrienelse
3878344Sobrien  JAVA_EXEC_POS=1
3978344Sobrienendif
4098184Sgordonifneq ($(word $(JAVA_EXEC_POS),$(SJAVAC_SERVER_JAVA)),$(word $(JAVA_EXEC_POS),$(JAVA)))
4178344Sobrien  $(error Bootcycle builds are not possible if --with-sjavac-server-java is specified)
4278344Sobrienendif
4378344Sobrien
4478344Sobrien
4578344Sobrien# Override specific values to do a boot cycle build
4678344Sobrien
4778344Sobrien# Use a different Boot JDK
4878344SobrienBOOT_JDK := $(JDK_IMAGE_DIR)
4978344Sobrien
5078344Sobrien# The bootcycle build has a different output directory
5178344SobrienOLD_BUILD_OUTPUT:=@BUILD_OUTPUT@
5278344SobrienBUILD_OUTPUT:=$(OLD_BUILD_OUTPUT)/bootcycle-build
5378344SobrienSJAVAC_SERVER_DIR:=$(patsubst $(OLD_BUILD_OUTPUT)%, $(BUILD_OUTPUT)%, $(SJAVAC_SERVER_DIR))
5478344Sobrien
5578344SobrienJAVA_CMD:=$(BOOT_JDK)/bin/java
5678344SobrienJAVAC_CMD:=$(BOOT_JDK)/bin/javac
5778344SobrienJAVAH_CMD:=$(BOOT_JDK)/bin/javah
5878344SobrienJAR_CMD:=$(BOOT_JDK)/bin/jar
5978344SobrienJARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
6078344SobrienSJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
6178344Sobrien# When building a 32bit target, make sure the sjavac server flags are compatible
6278344Sobrien# with a 32bit JVM.
6398184Sgordonifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
6498184Sgordon  SJAVAC_SERVER_JAVA_FLAGS := @BOOTCYCLE_JVM_ARGS_BIG@
6578344Sobrienendif
6678344Sobrien# The bootcycle JVM arguments may differ from the original boot jdk.
6778344SobrienJAVA_FLAGS_BIG := @BOOTCYCLE_JVM_ARGS_BIG@
6878344Sobrien