Sanity-Settings.gmk 10.6 KB
Newer Older
D
duke 已提交
1
#
2
# Copyright 2005-2008 Sun Microsystems, Inc.  All Rights Reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
# 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.  Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.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
#
ifneq ($(PATH), $(subst ",,$(PATH)))
  dummy1:=$(error ERROR: PATH variable contains double quotes, fix your PATH.)
endif
ifneq ($(PATH), $(subst ',,$(PATH)))
  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

# Make sure this is a 'do it now' variable.
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)
  ALL_SETTINGS+=$(call addAltSetting,MSVCRT_DLL_PATH)
  ifeq ($(ARCH_DATA_MODEL), 32)
101
    ALL_SETTINGS+=$(call addAltSetting,MSVCRNN_DLL_PATH)
D
duke 已提交
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
  endif
  ALL_SETTINGS+=$(call addAltSetting,MSDEVTOOLS_PATH)
endif
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_NAME)
ALL_SETTINGS+=$(call addOptionalSetting,COMPILER_VERSION)
ALL_SETTINGS+=$(call addRequiredVersionSetting,CC_VER)
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)
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 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)

# These don't print out well with windows due to the ';' characters
ifneq ($(PLATFORM),windows)
  ALL_SETTINGS+=$(call addOptionalSetting,JAVAC_CMD)
  ALL_SETTINGS+=$(call addOptionalSetting,JAVAH_CMD)
  ALL_SETTINGS+=$(call addOptionalSetting,JAVADOC_CMD)
endif

ALL_SETTINGS+=$(call addHeading,Build Platform Settings)
ALL_SETTINGS+=$(call addRequiredSetting,USER)
ALL_SETTINGS+=$(call addRequiredSetting,PLATFORM)
ALL_SETTINGS+=$(call addRequiredSetting,ARCH)
ALL_SETTINGS+=$(call addRequiredSetting,LIBARCH)
ALL_SETTINGS+=$(call addRequiredSetting,ARCH_FAMILY)
ALL_SETTINGS+=$(call addRequiredSetting,ARCH_DATA_MODEL)
ALL_SETTINGS+=$(call addRequiredSetting,ARCHPROP)
ifeq ($(PLATFORM),windows)
  ALL_SETTINGS+=$(call addRequiredSetting,PROCESSOR_ARCHITECTURE)
  ALL_SETTINGS+=$(call addRequiredSetting,PROCESSOR_IDENTIFIER)
  ALL_SETTINGS+=$(call addRequiredSetting,WINDOWS_VERSION)
  ALL_SETTINGS+=$(call addRequiredSetting,WINDOWS_NT_VERSION_STRING)
  ifdef USING_CYGWIN
    ALL_SETTINGS+=$(call addRequiredSetting,USING_CYGWIN)
    ALL_SETTINGS+=$(call addRequiredVersionSetting,CYGWIN_VER)
    ALL_SETTINGS+=$(call addRequiredSetting,CYGPATH_CMD)
  else
    ALL_SETTINGS+=$(call addRequiredVersionSetting,MKS_VER)
    ALL_SETTINGS+=$(call addOptionalSetting,DOSNAME_CMD)
  endif
endif
ifeq ($(PLATFORM),linux)
  ALL_SETTINGS+=$(call addRequiredSetting,LINUX_VERSION)
  ifneq ($(ARCH), ia64)
    ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
  endif
endif
ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION)
ALL_SETTINGS+=$(call addRequiredSetting,OS_NAME)
ALL_SETTINGS+=$(call addRequiredSetting,TEMP_FREE_SPACE)
ALL_SETTINGS+=$(call addRequiredSetting,FREE_SPACE)
ALL_SETTINGS+=$(call addRequiredSetting,MB_OF_MEMORY)


ALL_SETTINGS+=$(call addHeading,GNU Make Settings)
ALL_SETTINGS+=$(call addRequiredSetting,MAKE)
ALL_SETTINGS+=$(call addRequiredVersionSetting,MAKE_VER)
ALL_SETTINGS+=$(call addOptionalSetting,MAKECMDGOALS)
ALL_SETTINGS+=$(call addOptionalSetting,MAKEFLAGS)
ALL_SETTINGS+=$(call addRequiredSetting,SHELL)


ALL_SETTINGS+=$(call addHeading,Target Build Versions)
ALL_SETTINGS+=$(call addRequiredSetting,JDK_VERSION)
ALL_SETTINGS+=$(call addOptionalSetting,MILESTONE)
ALL_SETTINGS+=$(call addOptionalSetting,RELEASE)
ALL_SETTINGS+=$(call addRequiredSetting,FULL_VERSION)
ALL_SETTINGS+=$(call addOptionalSetting,BUILD_NUMBER)


ALL_SETTINGS+=$(call addHeading,External File/Binary Locations)
ALL_SETTINGS+=$(call addRequiredSetting,USRJDKINSTANCES_PATH)
ALL_SETTINGS+=$(call addAltSetting,BUILD_JDK_IMPORT_PATH)
ALL_SETTINGS+=$(call addAltSetting,JDK_IMPORT_PATH)
ALL_SETTINGS+=$(call addAltSetting,LANGTOOLS_DIST)
ALL_SETTINGS+=$(call addAltSetting,CORBA_DIST)
ALL_SETTINGS+=$(call addAltSetting,JAXP_DIST)
ALL_SETTINGS+=$(call addAltSetting,JAXWS_DIST)
ALL_SETTINGS+=$(call addAltSetting,HOTSPOT_DOCS_IMPORT_PATH)
ALL_SETTINGS+=$(call addAltSetting,HOTSPOT_IMPORT_PATH)
ifeq ($(ARCH_DATA_MODEL), 32)
  ALL_SETTINGS+=$(call addAltSetting,HOTSPOT_CLIENT_PATH)
endif
ALL_SETTINGS+=$(call addAltSetting,HOTSPOT_SERVER_PATH)
ifeq ($(PLATFORM),windows)
  ALL_SETTINGS+=$(call addAltSetting,HOTSPOT_LIB_PATH)
  ALL_SETTINGS+=$(call addRequiredSetting,DXSDK_VER)
  ALL_SETTINGS+=$(call addAltSetting,DXSDK_PATH)
  ALL_SETTINGS+=$(call addAltSetting,DXSDK_INCLUDE_PATH)
  ALL_SETTINGS+=$(call addAltSetting,DXSDK_LIB_PATH)
  ifndef OPENJDK
    ALL_SETTINGS+=$(call addAltSetting,DEPLOY_MSSDK)
    ALL_SETTINGS+=$(call addAltSetting,INSTALL_MSSDK)
    ALL_SETTINGS+=$(call addAltSetting,WSCRIPT)
    ALL_SETTINGS+=$(call addAltSetting,MSICERT)
    ALL_SETTINGS+=$(call addAltSetting,MSITRAN)
    ALL_SETTINGS+=$(call addAltSetting,MSIVAL2)
  endif
endif
ALL_SETTINGS+=$(call addAltSetting,CACERTS_FILE)
ifndef OPENJDK
  ALL_SETTINGS+=$(call addAltSetting,MOZILLA_HEADERS_PATH)
endif
ifneq ($(PLATFORM),windows)
  ALL_SETTINGS+=$(call addAltSetting,CUPS_HEADERS_PATH)
endif

ifdef OPENJDK
  ALL_SETTINGS+=$(call addHeading,OpenJDK-specific settings)
  ALL_SETTINGS+=$(call addAltSetting,FREETYPE_HEADERS_PATH)
  ALL_SETTINGS+=$(call addAltSetting,FREETYPE_LIB_PATH)
  ALL_SETTINGS+=$(call addHeading,OPENJDK Import Binary Plug Settings)
  ALL_SETTINGS+=$(call addAltSetting,BINARY_PLUGS_JARFILE)
  ALL_SETTINGS+=$(call addAltSetting,BINARY_PLUGS_PATH)
  ALL_SETTINGS+=$(call addAltSetting,BUILD_BINARY_PLUGS_PATH)
else 
  ALL_SETTINGS+=$(call addHeading,OPENJDK Export Binary Plug Settings)
  ALL_SETTINGS+=$(call addOptionalSetting,PLUG_EXPORT_DIRNAME)
endif
ALL_SETTINGS+=$(call addOptionalSetting,PLUG_LIBRARY_NAMES)

ifdef OPENJDK
  ALL_SETTINGS+=$(call addHeading,Previous JDK Settings)
  ALL_SETTINGS+=$(call addAltSetting,PREVIOUS_RELEASE_PATH)
  ALL_SETTINGS+=$(call addAltSetting,PREVIOUS_JDK_VERSION)
  ALL_SETTINGS+=$(call addAltSetting,PREVIOUS_JDK_FILE)
  ALL_SETTINGS+=$(call addAltSetting,PREVIOUS_JRE_FILE)
  ALL_SETTINGS+=$(call addAltSetting,PREVIOUS_RELEASE_IMAGE)
endif