#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# 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.
#
#
# Shared sanity settings file. Fills in the variable ALL_SETTINGS.
#
# On Windows in particular, it can happen that quotes get into the PATH
# variable. This is very bad, and must be caught early or you can
# see errors like: sh: -c: line 0: syntax error near unexpected token
#
endif
dummy1:=$(error ERROR: PATH variable contains single quotes, fix your PATH.)
endif
# Used to add a heading to ALL_SETTINGS
define addHeading
"\n$1:\n"
endef
# Used to add a line to ALL_SETTINGS for an optional value
# (need if test for windows which has issues with ; characters in values)
define addOptionalSetting
$(if $($1)," $1 = $($1)\n"," $1 = $($1)\n")
endef
# Used to add a line to ALL_SETTINGS for something that must have a value
define addRequiredSetting
$(if $($1)," $1 = $($1)\n",$(warning WARNING: $1 should not be empty [Sanity-Settings.gmk]))
endef
# Used to add a line to ALL_SETTINGS for something that must have a value
define addRequiredVersionSetting
$(if $($1)," $1 = $($1) [requires at least $(REQUIRED_$1)]\n",$(warning WARNING: $1 should not be empty [Sanity-Settings.gmk]))
endef
# Used to add a series of lines to ALL_SETTINGS
define addAltSetting
" $1 = $($1)\n ALT_$1 = $(ALT_$1)\n"
endef
# Variable that contains a string of all information
ALL_SETTINGS:=$(call addHeading,Bootstrap Settings)
ALL_SETTINGS+=$(call addAltSetting,BOOTDIR)
ALL_SETTINGS+=$(call addRequiredVersionSetting,BOOT_VER)
ALL_SETTINGS+=$(call addAltSetting,OUTPUTDIR)
ALL_SETTINGS+=$(call addRequiredSetting,ABS_OUTPUTDIR)
ALL_SETTINGS+=$(call addHeading,Build Tool Settings)
ALL_SETTINGS+=$(call addAltSetting,SLASH_JAVA)
ALL_SETTINGS+=$(call addRequiredSetting,VARIANT)
ALL_SETTINGS+=$(call addAltSetting,JDK_DEVTOOLS_DIR)
ALL_SETTINGS+=$(call addOptionalSetting,ANT_HOME)
ALL_SETTINGS+=$(call addAltSetting,UNIXCOMMAND_PATH)
ALL_SETTINGS+=$(call addAltSetting,COMPILER_PATH)
ALL_SETTINGS+=$(call addAltSetting,DEVTOOLS_PATH)
ifeq ($(PLATFORM),linux)
ALL_SETTINGS+=$(call addAltSetting,UNIXCCS_PATH)
ALL_SETTINGS+=$(call addAltSetting,USRBIN_PATH)
ifndef OPENJDK
ALL_SETTINGS+=$(call addAltSetting,GCC29_COMPILER_PATH)
endif
endif
ifeq ($(PLATFORM),solaris)
ALL_SETTINGS+=$(call addAltSetting,UNIXCCS_PATH)
ifndef OPENJDK
ALL_SETTINGS+=$(call addAltSetting,GCC_COMPILER_PATH)
endif
endif
ifeq ($(PLATFORM),windows)
ifneq ($(MSVCRNN_DLL),)
ALL_SETTINGS+=$(call addAltSetting,MSVCRNN_DLL_PATH)
endif
ALL_SETTINGS+=$(call addRequiredSetting,INCLUDE)
ALL_SETTINGS+=$(call addRequiredSetting,LIB)
endif
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME)
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION)
ifdef REQUIRED_CC_VER
ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
else
ALL_SETTINGS+=$(call addOptionalSetting,CC_VER)
endif
ifeq ($(PLATFORM),solaris)
ifeq ($(ARCH_DATA_MODEL), 32)
ifndef OPENJDK
ALL_SETTINGS+=$(call addRequiredVersionSetting,GCC_VER)
endif
endif
endif
ALL_SETTINGS+=$(call addRequiredVersionSetting,ZIP_VER)
ALL_SETTINGS+=$(call addRequiredVersionSetting,UNZIP_VER)
ifeq ($(PLATFORM),windows)
ALL_SETTINGS+=$(call addRequiredVersionSetting,LINK_VER)
ALL_SETTINGS+=$(call addRequiredSetting,CC)
ALL_SETTINGS+=$(call addRequiredSetting,LINK)
ALL_SETTINGS+=$(call addRequiredSetting,DUMPBIN)
endif
ALL_SETTINGS+=$(call addRequiredVersionSetting,ANT_VER)
ALL_SETTINGS+=$(call addRequiredSetting,TEMPDIR)
ALL_SETTINGS+=$(call addHeading,Build Directives)
ALL_SETTINGS+=$(call addOptionalSetting,OPENJDK)
ALL_SETTINGS+=$(call addOptionalSetting,USE_HOTSPOT_INTERPRETER_MODE)
ALL_SETTINGS+=$(call addOptionalSetting,PEDANTIC)
ALL_SETTINGS+=$(call addOptionalSetting,DEV_ONLY)
ALL_SETTINGS+=$(call addOptionalSetting,NO_DOCS)
ALL_SETTINGS+=$(call addOptionalSetting,NO_IMAGES)
ALL_SETTINGS+=$(call addOptionalSetting,TOOLS_ONLY)
ALL_SETTINGS+=$(call addOptionalSetting,INSANE)
ALL_SETTINGS+=$(call addRequiredSetting,COMPILE_APPROACH)
ifeq ($(COMPILE_APPROACH), parallel)
ALL_SETTINGS+=$(call addAltSetting,PARALLEL_COMPILE_JOBS)
endif
ALL_SETTINGS+=$(call addOptionalSetting,FASTDEBUG)
ALL_SETTINGS+=$(call addRequiredSetting,COMPILER_WARNINGS_FATAL)
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_WARNING_LEVEL)
ALL_SETTINGS+=$(call addOptionalSetting,SHOW_ALL_WARNINGS)
ALL_SETTINGS+=$(call addRequiredSetting,INCREMENTAL_BUILD)
ALL_SETTINGS+=$(call addOptionalSetting,CC_HIGHEST_OPT)
ALL_SETTINGS+=$(call addOptionalSetting,CC_HIGHER_OPT)
ALL_SETTINGS+=$(call addOptionalSetting,CC_LOWER_OPT)
ALL_SETTINGS+=$(call addOptionalSetting,CXXFLAGS)
ALL_SETTINGS+=$(call addOptionalSetting,CFLAGS)
ALL_SETTINGS+=$(call addOptionalSetting,BOOT_JAVA_CMD)
ALL_SETTINGS+=$(call addOptionalSetting,BOOT_JAVAC_CMD)
ALL_SETTINGS+=$(call addOptionalSetting,BOOT_JAR_CMD)
ALL_SETTINGS+=$(call addOptionalSetting,BOOT_JARSIGNER_CMD)
else