1 # 2 # Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 5 # This code is free software; you can redistribute it and/or modify it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. Sun designates this 8 # particular file as subject to the "Classpath" exception as provided 9 # by Sun in the LICENSE file that accompanied this code. 10 # 11 # This code is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # version 2 for more details (a copy is included in the LICENSE file that 15 # accompanied this code). 16 # 17 # You should have received a copy of the GNU General Public License version 18 # 2 along with this work; if not, write to the Free Software Foundation, 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 # 21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22 # CA 95054 USA or visit www.sun.com if you need additional information or 23 # have any questions. 24 # 25 26 # 27 # WARNING: This file is shared with other workspaces. 28 # 29 30 # 31 # Shared sanity rules for the JDK builds. 32 # 33 34 .SUFFIXES: .hdiffs 35 36 # All files created during sanity checking 37 38 SANITY_FILES = $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE) 39 40 # How to say "The Release Engineering people use this" 41 THE_OFFICIAL_USES=The official $(PLATFORM) builds use 42 43 # How to say "You are using:" 44 YOU_ARE_USING=You appear to be using 45 46 # Settings and rules to validate the JDK build environment. 47 48 ifeq ($(PLATFORM), solaris) 49 FREE_SPACE := $(shell $(DF) -b $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$2;}') 50 TEMP_FREE_SPACE := $(shell $(DF) -b $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$2;}') 51 REQ_PATCH_LIST = $(JDK_TOPDIR)/make/PatchList.solaris 52 ifeq ($(ARCH_FAMILY), sparc) 53 PATCH_POSITION = $$4 54 else 55 PATCH_POSITION = $$6 56 endif 57 endif 58 59 ifeq ($(PLATFORM), linux) 60 FREE_SPACE := $(shell $(DF) --sync -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}') 61 TEMP_FREE_SPACE := $(shell $(DF) --sync -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}') 62 ifeq ($(ARCH), amd64) 63 LINUX_VERSION := $(shell \ 64 if [ -r "$(LINUX_VERSION_INFO)" ] ; then \ 65 $(CAT) $(LINUX_VERSION_INFO) | $(TAIL) -1 | $(NAWK) '{ print $$3; }';\ 66 else \ 67 $(ECHO) "Unknown linux"; \ 68 fi ) 69 else 70 LINUX_VERSION := $(shell \ 71 if [ -r "$(LINUX_VERSION_INFO)" ] ; then \ 72 $(NAWK) '{ print $$4" "$$5; }' $(LINUX_VERSION_INFO) ; \ 73 else \ 74 $(ECHO) "Unknown linux"; \ 75 fi ) 76 endif 77 ifneq ($(ARCH), ia64) 78 # dummy program that outputs ALSA's version (created in target sane-alsa-versioncheck) 79 ALSA_VERSION_CHECK = $(TEMPDIR)/alsaversioncheck 80 ALSA_VERSION = `if [ -f "$(ALSA_VERSION_CHECK)" ] ; then $(ALSA_VERSION_CHECK) ; fi` 81 endif 82 endif 83 84 ifeq ($(PLATFORM), windows) 85 FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}') 86 TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}') 87 # Localized systeminfo has localized labels, but not localized values. 88 _WINDOWS_VERSION := \ 89 $(shell systeminfo 2> $(DEV_NULL) | grep 'Microsoft' | grep 'Windows' | \ 90 cut -d':' -f2) 91 ifeq ($(_WINDOWS_VERSION),) 92 _WINDOWS_VERSION := Windows 2000 or Unknown (no systeminfo utility) 93 endif 94 WINDOWS_VERSION := $(strip $(_WINDOWS_VERSION)) 95 DXSDK_VER := $(shell $(EGREP) DIRECTDRAW_VERSION $(DXSDK_INCLUDE_PATH)/ddraw.h 2>&1 | \ 96 $(EGREP) "\#define" | $(NAWK) '{print $$3}') 97 endif 98 99 # Get the version numbers of what we are using 100 _MAKE_VER :=$(shell $(MAKE) --version 2>&1 | $(HEAD) -n 1) 101 _ZIP_VER :=$(shell $(ZIPEXE) -help 2>&1 | $(HEAD) -n 4 | $(EGREP) '^Zip') 102 _UNZIP_VER :=$(shell $(UNZIP) -help 2>&1 | $(HEAD) -n 4 | $(EGREP) '^UnZip') 103 _BOOT_VER :=$(shell $(BOOTDIR)/bin/java -version 2>&1 | $(HEAD) -n 1) 104 MAKE_VER :=$(call GetVersion,"$(_MAKE_VER)") 105 ZIP_VER :=$(call GetVersion,"$(_ZIP_VER)") 106 UNZIP_VER :=$(call GetVersion,"$(_UNZIP_VER)") 107 BOOT_VER :=$(call GetVersion,"$(_BOOT_VER)") 108 109 REQUIRED_ANT_VER := 1.6.3 110 _ANT_VER :=$(shell $(ANT) -version 2>&1 ) 111 ANT_VER :=$(call GetVersion,"$(_ANT_VER)") 112 113 ifdef ALT_BINDIR 114 ALT_BINDIR_VERSION := $(shell $(ALT_BINDIR)/java$(EXE_SUFFIX) -version 2>&1 | $(NAWK) -F'"' '{ print $$2 }') 115 ALT_BINDIR_OK := $(shell $(ECHO) $(ALT_BINDIR_VERSION) | $(EGREP) -c '^$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)') 116 endif 117 118 INSTALL_PATCHES_FILE = $(TEMPDIR)/installed.patches 119 120 # Get ALL_SETTINGS defined 121 include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk 122 123 .PHONY: \ 124 sane-copyrightyear\ 125 sane-settings \ 126 sane-insane \ 127 sane-build_number \ 128 sane-os_version \ 129 sane-memory_check \ 130 sane-windows \ 131 sane-locale \ 132 sane-linux \ 133 sane-cygwin \ 134 sane-cygwin-shell \ 135 sane-mks \ 136 sane-arch_data_model \ 137 sane-os_patch_level \ 138 sane-classpath \ 139 sane-java_home \ 140 sane-fonts \ 141 sane-binary-plugs \ 142 sane-variant \ 143 sane-ld_library_path \ 144 sane-ld_library_path_64 \ 145 sane-ld_options \ 146 sane-ld_run_path \ 147 sane-makeflags \ 148 sane-alt_outputdir \ 149 sane-outputdir \ 150 sane-alt_bootdir \ 151 sane-bootdir \ 152 sane-motif \ 153 sane-cups \ 154 sane-devtools_path \ 155 sane-compiler_path \ 156 sane-unixcommand_path \ 157 sane-usrbin_path \ 158 sane-unixccs_path \ 159 sane-docs_import \ 160 sane-math_iso \ 161 sane-libCrun \ 162 sane-odbcdir \ 163 sane-msdevtools_path \ 164 sane-hotspot_binaries \ 165 sane-hotspot_import \ 166 sane-hotspot_import_dir \ 167 sane-hotspot_import_include \ 168 sane-compiler \ 169 sane-link \ 170 sane-cacerts \ 171 sane-alsa-versioncheck \ 172 sane-alsa-headers \ 173 sane-ant_version \ 174 sane-zip_version \ 175 sane-unzip_version \ 176 sane-msvcrt_path \ 177 sane-freetype 178 179 ###################################################### 180 # check for COPYRIGHT_YEAR variable 181 ###################################################### 182 sane-copyrightyear: 183 ifdef ALT_COPYRIGHT_YEAR 184 @$(ECHO) "WARNING: ALT_COPYRIGHT_YEAR but not the current year\n" \ 185 " will be used for copyright year.\n " \ 186 "" >>$(WARNING_FILE) 187 endif 188 189 ###################################################### 190 # check for INSANE variable 191 ###################################################### 192 sane-insane: 193 ifdef INSANE 194 @$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \ 195 " should not use this mode, and in fact, \n" \ 196 " it may be removed at any time. If you \n" \ 197 " have build problems as a result of using \n" \ 198 " INSANE mode, then you should not expect \n" \ 199 " assistance from anyone with the problems \n" \ 200 " or consequences you experience. \n" \ 201 "" >> $(WARNING_FILE) 202 endif 203 204 ###################################################### 205 # check for GNU Make version 206 ###################################################### 207 MAKE_CHECK :=$(call CheckVersions,$(MAKE_VER),$(REQUIRED_MAKE_VER)) 208 sane-make: 209 @if [ "$(MAKE_CHECK)" != "same" -a "$(MAKE_CHECK)" != "newer" ]; then \ 210 $(ECHO) "WARNING: The version of make being used is older than \n" \ 211 " the required version of '$(REQUIRED_MAKE_VER)'. \n" \ 212 " The version of make found was '$(MAKE_VER)'. \n" \ 213 "" >> $(WARNING_FILE) ; \ 214 fi 215 216 ###################################################### 217 # Check the BUILD_NUMBER to make sure it contains bNN 218 ###################################################### 219 sane-build_number: 220 @if [ "`$(ECHO) $(BUILD_NUMBER) | $(SED) 's@.*b[0-9][0-9]*.*@bNN@'`" != "bNN" ] ; then \ 221 $(ECHO) "WARNING: The BUILD_NUMBER needs to contain b[0-9][0-9]*. Currently BUILD_NUMBER=$(BUILD_NUMBER). \n" \ 222 " This has been known to cause build failures. \n" \ 223 "" >> $(WARNING_FILE) ; \ 224 fi 225 226 ###################################################### 227 # Check the ARCH_DATA_MODEL setting 228 ###################################################### 229 sane-arch_data_model: 230 @if [ "$(ARCH_DATA_MODEL)" != 32 -a "$(ARCH_DATA_MODEL)" != 64 ]; then \ 231 $(ECHO) "ERROR: The setting of ARCH_DATA_MODEL must be 32 or 64.\n" \ 232 " $(YOU_ARE_USING) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL). \n" \ 233 "" >> $(ERROR_FILE) ; \ 234 fi 235 236 ###################################################### 237 # Check the OS version (windows and linus have release name checks) 238 # NOTE: OPENJDK explicitly does not check for OS release information. 239 # Unless we know for sure that it will not build somewhere, we cannot 240 # generate a fatal sanity error, and a warning about the official 241 # build platform just becomes clutter. 242 ###################################################### 243 OS_CHECK :=$(call CheckVersions,$(OS_VERSION),$(REQUIRED_OS_VERSION)) 244 sane-os_version:: sane-arch_data_model sane-memory_check sane-locale sane-os_patch_level 245 ifndef OPENJDK 246 @if [ "$(OS_CHECK)" = "missing" ]; then \ 247 $(ECHO) "ERROR: The $(PLATFORM) OS version is undefined (Try: uname -r). \n" \ 248 "" >> $(ERROR_FILE) ; \ 249 fi 250 @if [ "$(OS_CHECK)" != "same" ]; then \ 251 $(ECHO) "WARNING: $(THE_OFFICIAL_USES) OS version $(REQUIRED_OS_VERSION). \n" \ 252 " $(YOU_ARE_USING) OS version $(OS_VERSION). \n" \ 253 "" >> $(WARNING_FILE) ; \ 254 fi 255 ifeq ($(PLATFORM), windows) 256 @if [ "$(findstring $(REQUIRED_WINDOWS_VERSION),$(WINDOWS_VERSION))" = "" ]; then \ 257 $(ECHO) "WARNING: $(YOU_ARE_USING) an unknown version of Windows. \n" \ 258 " The required version is $(REQUIRED_WINDOWS_VERSION). \n" \ 259 " $(YOU_ARE_USING) $(WINDOWS_VERSION) \n" \ 260 "" >> $(WARNING_FILE) ; \ 261 fi 262 endif # windows 263 ifeq ($(PLATFORM), linux) 264 @if [ `$(ECHO) "$(LINUX_VERSION)" | $(EGREP) -c '$(REQUIRED_LINUX_VER)'` -ne 1 ]; then \ 265 $(ECHO) "WARNING: The build is being done on Linux $(LINUX_VERSION). \n" \ 266 " $(THE_OFFICIAL_USES) Linux $(REQUIRED_LINUX_VER), \n" \ 267 " specifically Linux $(REQUIRED_LINUX_FULLVER). \n" \ 268 " The version found was '$(OS_VERSION)'. \n" \ 269 "" >> $(WARNING_FILE) ; \ 270 fi 271 endif # linux 272 endif # OPENJDK 273 274 ifeq ($(PLATFORM), windows) 275 sane-os_version:: sane-cygwin sane-mks sane-cygwin-shell 276 endif 277 278 ###################################################### 279 # Check the memory available on this machine 280 ###################################################### 281 sane-memory_check: 282 @if [ "$(LOW_MEMORY_MACHINE)" = "true" ]; then \ 283 $(ECHO) "WARNING: This machine appears to only have $(MB_OF_MEMORY)Mb of physical memory, \n" \ 284 " builds on this machine could be slow. \n" \ 285 "" >> $(WARNING_FILE) ; \ 286 fi 287 288 ###################################################### 289 # Check the locale (value of LC_ALL, not being empty or ==C can be a problem) 290 ###################################################### 291 sane-locale: 292 ifneq ($(PLATFORM), windows) 293 @if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \ 294 $(ECHO) "WARNING: LC_ALL has been set to $(LC_ALL), this can cause build failures. \n" \ 295 " Try setting LC_ALL to \"C\". \n" \ 296 "" >> $(WARNING_FILE) ; \ 297 fi 298 @if [ "$(LANG)" != "" -a "$(LANG)" != "C" ]; then \ 299 $(ECHO) "WARNING: LANG has been set to $(LANG), this can cause build failures. \n" \ 300 " Try setting LANG to \"C\". \n" \ 301 "" >> $(WARNING_FILE) ; \ 302 fi 303 endif 304 305 ###################################################### 306 # Check the Windows cygwin version 307 ###################################################### 308 ifeq ($(PLATFORM), windows) 309 CYGWIN_CHECK :=$(call CheckVersions,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER)) 310 sane-cygwin: 311 ifdef USING_CYGWIN 312 @if [ "$(CYGWIN_CHECK)" = "missing" ]; then \ 313 $(ECHO) "ERROR: The CYGWIN version is undefined. \n" \ 314 " $(THE_OFFICIAL_USES) CYGWIN $(REQUIRED_CYGWIN_VER). \n" \ 315 "" >> $(ERROR_FILE) ; \ 316 fi 317 @if [ "$(CYGWIN_CHECK)" = "older" ]; then \ 318 $(ECHO) "ERROR: The build cannot be done on CYGWIN $(CYGWIN_VER). \n" \ 319 " Use CYGWIN $(REQUIRED_CYGWIN_VER) or higher. \n" \ 320 "" >> $(ERROR_FILE) ; \ 321 fi 322 endif 323 endif 324 325 ###################################################### 326 # Check the cygwin shell is used, not cmd.exe 327 ###################################################### 328 ifeq ($(PLATFORM), windows) 329 sane-cygwin-shell: 330 ifdef USING_CYGWIN 331 @if [ "$(SHLVL)" = "" -a "$(_)" = "" ]; then \ 332 $(ECHO) "ERROR: You are using an unsupported shell. \n" \ 333 " Use either sh, bash, ksh, zsh, or tcsh. \n" \ 334 " Using the cmd.exe utility is not supported. \n" \ 335 " If you still want to try your current shell, \n" \ 336 " please export SHLVL=1 when running $(MAKE). \n" \ 337 "" >> $(ERROR_FILE) ; \ 338 fi 339 endif 340 endif 341 342 ###################################################### 343 # Check the Windows mks version 344 ###################################################### 345 ifeq ($(PLATFORM), windows) 346 MKS_CHECK :=$(call CheckVersions,$(MKS_VER),$(REQUIRED_MKS_VER)) 347 sane-mks: 348 ifndef USING_CYGWIN 349 @if [ "$(MKS_CHECK)" = "missing" ]; then \ 350 $(ECHO) "ERROR: The MKS version is undefined. \n" \ 351 " $(THE_OFFICIAL_USES) MKS $(REQUIRED_MKS_VER). \n" \ 352 "" >> $(ERROR_FILE) ; \ 353 fi 354 @if [ "$(MKS_CHECK)" = "older" ]; then \ 355 $(ECHO) "ERROR: The build cannot be done on MKS $(MKS_VER). \n" \ 356 " Use MKS $(REQUIRED_MKS_VER) or higher. \n" \ 357 "" >> $(ERROR_FILE) ; \ 358 fi 359 endif 360 endif 361 362 ###################################################### 363 # Get list of installed patches (this file has a particular format) 364 ###################################################### 365 $(INSTALL_PATCHES_FILE): 366 @$(prep-target) 367 ifeq ($(PLATFORM), solaris) 368 ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION)) 369 $(SHOWREV) -p > $@ 2>&1 370 endif 371 endif 372 @$(ECHO) "" >> $@ 373 374 ###################################################### 375 # Check list of Solaris patches 376 ###################################################### 377 sane-os_patch_level: $(INSTALL_PATCHES_FILE) 378 ifeq ($(PLATFORM), solaris) 379 ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION)) 380 @$(NAWK) 'BEGIN { \ 381 readingInstallPatches = 0; \ 382 requiredCount = 0; \ 383 installCount = 0; \ 384 } \ 385 { \ 386 if (readingInstallPatches) { \ 387 if ($$1=="Patch:") { \ 388 ns = split($$2,parts,"-"); \ 389 installPatchNo[installCount]=parts[1]; \ 390 installPatchRev[installCount]=parts[2]; \ 391 installCount++; \ 392 } \ 393 } \ 394 \ 395 if (!readingInstallPatches) { \ 396 if (index($$1,"#") != 0) continue; \ 397 if (match($$1,"BUILD") > 0 \ 398 && $$2 == $(OS_VERSION) \ 399 && ($$7 == "REQ" || $$7 == "req") \ 400 && $(PATCH_POSITION) != "none" \ 401 && $(PATCH_POSITION) != "NONE") { \ 402 ns = split($(PATCH_POSITION),parts,"-"); \ 403 requiredPatchNo[requiredCount]=parts[1]; \ 404 requiredPatchRev[requiredCount]=parts[2]; \ 405 requiredCount++; \ 406 } \ 407 } \ 408 } \ 409 END { \ 410 errorCount=0; \ 411 for (i=0; i<requiredCount; i++) { \ 412 foundMatch = 0; \ 413 for (j=0; j<installCount; j++) { \ 414 if (installPatchNo[j] == requiredPatchNo[i] \ 415 && installPatchRev[j] >= requiredPatchRev[i]) { \ 416 foundMatch = 1; \ 417 break; \ 418 } \ 419 } \ 420 if ( foundMatch == 0) { \ 421 printf("WARNING: Your solaris install is missing the required patch %s-%s\n", requiredPatchNo[i], requiredPatchRev[i] ); \ 422 printf(" Please update your your system patches or build on a different machine.\n\n" ); \ 423 errorCount++; \ 424 } \ 425 } \ 426 }' $(REQ_PATCH_LIST) readingInstallPatches=1 $(INSTALL_PATCHES_FILE) >> $(WARNING_FILE) 427 endif 428 endif # PLATFORM 429 430 ###################################################### 431 # CLASSPATH cannot be set, unless you are insane. 432 ###################################################### 433 sane-classpath: 434 ifdef CLASSPATH 435 @$(ECHO) "ERROR: Your CLASSPATH environment variable is set. This will \n" \ 436 " most likely cause the build to fail. Please unset it \n" \ 437 " and start your build again. \n" \ 438 "" >> $(ERROR_FILE) 439 endif 440 441 ###################################################### 442 # JAVA_HOME cannot be set, unless you are insane. 443 ###################################################### 444 sane-java_home: 445 ifdef JAVA_HOME 446 @$(ECHO) "ERROR: Your JAVA_HOME environment variable is set. This will \n" \ 447 " most likely cause the build to fail. Please unset it \n" \ 448 " and start your build again. \n" \ 449 "" >> $(ERROR_FILE) 450 endif 451 452 ###################################################### 453 # Make sure the fonts are there 454 # Exceptions are when explicitly building OPENJDK, or 455 # when the entire CLOSED_SRC dir is excluded, so we are 456 # implicitly building OPENJDK 457 ###################################################### 458 FONT_FILE=$(CLOSED_SRC)/share/lib/fonts/LucidaTypewriterRegular.ttf 459 sane-fonts: 460 ifndef OPENJDK 461 @if [ -d $(CLOSED_SRC) ] ; then \ 462 if [ ! -f $(FONT_FILE) ] ; then \ 463 $(ECHO) "ERROR: Missing $(FONT_FILE). \n" \ 464 " Verify you have downloaded and overlayed on the source area all the binary files. \n" \ 465 "" >> $(ERROR_FILE); \ 466 fi \ 467 fi 468 endif 469 470 ###################################################### 471 # If building OPENJDK check pre-built binaries are 472 # available for binary plug source components. 473 ###################################################### 474 ifdef OPENJDK 475 sane-binary-plugs: 476 ifeq ($(IMPORT_BINARY_PLUGS),true) 477 @if [ ! -d "$(BINARY_PLUGS_PATH)" ]; then \ 478 $(ECHO) "ERROR: Can't locate pre-built libraries. \n" \ 479 " Please check your access to \n" \ 480 " $(BINARY_PLUGS_PATH) \n" \ 481 " and/or check your value of ALT_BINARY_PLUGS_PATH. \n" \ 482 "" >> $(ERROR_FILE); \ 483 fi 484 endif 485 endif 486 487 ###################################################### 488 # VARIANT must be set to DBG or OPT 489 ###################################################### 490 sane-variant: 491 @if [ "$(VARIANT)" != DBG -a "$(VARIANT)" != OPT ] ; then \ 492 $(ECHO) "ERROR: Your VARIANT environment variable is set to $(VARIANT). \n" \ 493 " Needs to be set to DBG or OPT \n" \ 494 "" >> $(ERROR_FILE); \ 495 fi 496 497 ###################################################### 498 # LD_LIBRARY_PATH should not be set, unless you are insane. 499 ###################################################### 500 sane-ld_library_path: 501 ifdef LD_LIBRARY_PATH 502 @$(ECHO) "ERROR: Your LD_LIBRARY_PATH environment variable is set. This may \n" \ 503 " produce binaries binaries incorrectly. Please unset it \n" \ 504 " and start your build again. \n" \ 505 "" >> $(ERROR_FILE) 506 endif 507 508 ###################################################### 509 # LD_LIBRARY_PATH_64 should not be set, unless you are insane. 510 ###################################################### 511 sane-ld_library_path_64: 512 ifdef LD_LIBRARY_PATH_64 513 @$(ECHO) "ERROR: Your LD_LIBRARY_PATH_64 environment variable is set. This may \n" \ 514 " produce binaries binaries incorrectly. Please unset it \n" \ 515 " and start your build again. \n" \ 516 "" >> $(ERROR_FILE) 517 endif 518 519 ###################################################### 520 # LD_OPTIONS should not be set, unless you are insane. 521 ###################################################### 522 sane-ld_options: 523 ifdef LD_OPTIONS 524 @$(ECHO) "ERROR: Your LD_OPTIONS environment variable is set. This may \n" \ 525 " produce binaries binaries incorrectly. Please unset it \n" \ 526 " and start your build again. \n" \ 527 "" >> $(ERROR_FILE) 528 endif 529 530 ###################################################### 531 # LD_RUN_PATH should not be set, unless you are insane. 532 ###################################################### 533 sane-ld_run_path: 534 ifdef LD_RUN_PATH 535 @$(ECHO) "ERROR: Your LD_RUN_PATH environment variable is set. This may \n" \ 536 " produce binaries binaries incorrectly. Please unset it \n" \ 537 " produce binaries binaries incorrectly. Please unset it \n" \ 538 " and start your build again. \n" \ 539 "" >> $(ERROR_FILE) 540 endif 541 542 ###################################################### 543 # MAKEFLAGS cannot be set, unless you are insane. 544 ###################################################### 545 ifeq ($(PLATFORM), windows) 546 ifdef USING_CYGWIN 547 REAL_MAKEFLAGS:=$(subst --unix,,$(MAKEFLAGS)) 548 else 549 REAL_MAKEFLAGS:=$(MAKEFLAGS) 550 endif 551 else 552 REAL_MAKEFLAGS:=$(MAKEFLAGS) 553 endif 554 sane-makeflags: 555 # ifneq ($(strip $(REAL_MAKEFLAGS)),) 556 ifeq ($(origin MAKEFLAGS),environment) 557 @# 558 @# it is unacceptable to have the-e or --environment-overrides value in MAKEFLAGS 559 @# 560 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(e|--environment-overrides)( |$$)'` -ne 0 ]; then \ 561 $(ECHO) "ERROR: Either the build was started with the flag -e or \n" \ 562 " --environment-overrides, or the MAKEFLAGS environment \n" \ 563 " variable has this value set. This will cause any \n" \ 564 " environment variables you have defined to override \n" \ 565 " the values defined by the makefiles. This practice is \n" \ 566 " not recommemded by the authors of GNU Make, and \n" \ 567 " will lead to an improper build. \n" \ 568 " Please fix and restart the build. \n" \ 569 "" >> $(ERROR_FILE) ; \ 570 fi 571 @# 572 @# it is unacceptable to havethe -i or --ignore-errors value in MAKEFLAGS 573 @# 574 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(i|--ignore-errors)( |$$)'` -ne 0 ]; then \ 575 $(ECHO) "ERROR: Either the build was started with the flag -i or \n" \ 576 " --ignore-errors, or the MAKEFLAGS environment \n" \ 577 " variable has this value set. 1111 You will be unable \n" \ 578 " to determine if the build is broken or not. \n" \ 579 " Please fix and restart the build. \n" \ 580 "" >> $(ERROR_FILE) ; \ 581 fi 582 @# 583 @# it is unacceptable to have the -I or --include-dir value in MAKEFLAGS 584 @# 585 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(I|--include-dir)( |$$)'` -ne 0 ]; then \ 586 $(ECHO) "ERROR: Either the build was started with the flag -I or \n" \ 587 " --include-dir, or the MAKEFLAGS environment \n" \ 588 " variable has this value set. This will render your \n" \ 589 " build questionable as not all the rules and depenencies \n" \ 590 " are captured by the build. \n" \ 591 " Please fix and restart the build. \n" \ 592 "" >> $(ERROR_FILE) ; \ 593 fi 594 @# 595 @# it is unacceptable to have the -k or --keep-going value in MAKEFLAGS: 596 @# 597 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(k|--keep-going)( |$$)'` -ne 0 ]; then \ 598 $(ECHO) "ERROR: Either the build was started with the flag -k or \n" \ 599 " --keep-going, or the MAKEFLAGS environment \n" \ 600 " variable has this value set. 222 You will be unable \n" \ 601 " to determine if the build is broken or not. \n" \ 602 " Please fix and restart the build. \n" \ 603 "" >> $(ERROR_FILE) ; \ 604 fi 605 @# 606 @# it is unacceptable to have the -o or --assume-old or --old-filevalue in MAKEFLAGS: 607 @# Note - this rule never gets invoked because it is processed out 608 @# in GNU Make startup 609 @# 610 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(o|--assume-old|--old-file)( |$$)'` -ne 0 ]; then \ 611 $(ECHO) "ERROR: Either the build was started with the flag -o or \n" \ 612 " --assume-old or --old-file, or the MAKEFLAGS environment \n" \ 613 " variable has this value set. This could prevent the \n" \ 614 " build from executing rules it should, thus rendering a \n" \ 615 " questionable result. \n" \ 616 " Please fix and restart the build. \n" \ 617 "" >> $(ERROR_FILE) ; \ 618 fi 619 @# 620 @# it is unacceptable to have the -r or --nobuiltin-rules value in MAKEFLAGS 621 @# 622 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(r|--no-builtin-rules)( |$$)'` -ne 0 ]; then \ 623 $(ECHO) "ERROR: Either the build was started with the flag -r or \n" \ 624 " --no-builtin-rules, or the MAKEFLAGS environment \n" \ 625 " variable has this value set. This may break the build \n" \ 626 " by not allowing builtin rules that may be required. \n" \ 627 " Please fix and restart the build. \n" \ 628 "" >> $(ERROR_FILE) ; \ 629 fi 630 @# 631 @# it is unacceptable to have the -t or --touch value in MAKEFLAGS 632 @# Note - this rule never gets invoked because it is processed out 633 @# in GNU Make startup 634 @# 635 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(t|--touch)( |$$)'` -ne 0 ]; then \ 636 $(ECHO) "ERROR: Either the build was started with the flag -t or \n" \ 637 " --touch, or the MAKEFLAGS environment \n" \ 638 " variable has this value set. This will leave the \n" \ 639 " build in a unclear state and could lead to not executing \n" \ 640 " rules which should be executed. \n" \ 641 " Please fix and restart the build. \n" \ 642 "" >> $(ERROR_FILE) ; \ 643 fi 644 @# 645 @# show what is in MAKEFLAGS so the user is aware... 646 @# 647 @$(ECHO) "WARNING: Your MAKEFLAGS environment variable is set. \n" \ 648 " You should be very careful about the values set here. \n" \ 649 "\n" \ 650 " MAKEFLAGS is set to =>$(MAKEFLAGS)<= \n" \ 651 "" >> $(WARNING_FILE) 652 endif 653 654 ###################################################### 655 # if specified, ALT_OUTPUTDIR must point to non-relative path if set 656 ###################################################### 657 sane-alt_outputdir: 658 ifdef ALT_OUTPUTDIR 659 @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ 660 $(ECHO) "ERROR: ALT_OUTPUTDIR must be an Absolute Path Name, \n" \ 661 " not a Relative Path Name. \n" \ 662 "" >> $(ERROR_FILE) ; \ 663 fi 664 ifeq ($(PLATFORM), windows) 665 @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -ci '^([a-z]:)'` -ne 1 ]; then \ 666 $(ECHO) "ERROR: On windows, ALT_OUTPUTDIR must contain the drive letter. \n" \ 667 "" >> $(ERROR_FILE) ; \ 668 fi 669 endif 670 endif 671 672 ###################################################### 673 # OUTPUTDIR tests 674 ###################################################### 675 sane-outputdir: 676 @# 677 @# OUTPUTDIR must be a directory... 678 @# 679 @if [ ! -d "$(OUTPUTDIR)" ]; then \ 680 $(ECHO) "ERROR: OUTPUTDIR must be an existing directory. The current \n" \ 681 " value of OUTPUTDIR is \n" \ 682 " $(OUTPUTDIR) \n" \ 683 " Please check your value of ALT_OUTPUTDIR. \n" \ 684 "" >> $(ERROR_FILE) ; \ 685 fi 686 @# 687 @# OUTPUTDIR must be writeable by user... 688 @# 689 @if [ ! -w "$(OUTPUTDIR)" ]; then \ 690 $(ECHO) "ERROR: You must have write permissions to OUTPUTDIR. The \n" \ 691 " current value of OUTPUTDIR is \n" \ 692 " $(OUTPUTDIR) \n" \ 693 " Either obtain these permissions or set ALT_OUTPUTDIR. \n" \ 694 "" >> $(ERROR_FILE) ; \ 695 fi 696 @# 697 @# OUTPUTDIR must have enough free space... 698 @# 699 @if [ $(FREE_SPACE) -lt $(REQUIRED_FREE_SPACE) ]; then \ 700 $(ECHO) "WARNING: You may not have enough free space in your OUTPUTDIR. The \n" \ 701 " current value of OUTPUTDIR is \n" \ 702 " $(OUTPUTDIR) \n" \ 703 " You need "$(REQUIRED_FREE_SPACE)" Kbytes free on this device to build \n" \ 704 " and it appears that only "$(FREE_SPACE)" Kbytes are free. \n" \ 705 " Either obtain more space or set ALT_OUTPUTDIR to a larger disk. \n" \ 706 "" >> $(WARNING_FILE) ; \ 707 fi 708 709 ###################################################### 710 # if specified, ALT_BOOTDIR must point to non-relative path if set 711 ###################################################### 712 sane-alt_bootdir: 713 ifdef ALT_BOOTDIR 714 @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ 715 $(ECHO) "ERROR: ALT_BOOTDIR must be an Absolute Path Name, \n" \ 716 " not a Relative Path Name. \n" \ 717 " The current value of ALT_BOOTDIR is \n" \ 718 " $(ALT_BOOTDIR) \n" \ 719 " Please fix this and continue your build. \n" \ 720 "" >> $(ERROR_FILE) ; \ 721 fi 722 endif 723 724 ###################################################### 725 # BOOTDIR must point to a valid JDK. 726 ###################################################### 727 BOOT_CHECK :=$(call CheckVersions,$(BOOT_VER),$(REQUIRED_BOOT_VER)) 728 sane-bootdir: 729 @if [ "$(BOOT_CHECK)" != "same" -a "$(BOOT_CHECK)" != "newer" ]; then \ 730 $(ECHO) "ERROR: Your BOOTDIR environment variable does not point \n" \ 731 " to a valid JDK for bootstrapping this build. \n" \ 732 " A JDK $(JDK_MINOR_VERSION) $(MARKET_NAME) build must be bootstrapped using \n" \ 733 " JDK $(PREVIOUS_JDK_VERSION) fcs (or later). \n" \ 734 " Apparently, your bootstrap JDK is version $(BOOT_VER) \n" \ 735 " Please update your ALT_BOOTDIR setting and start your build again. \n" \ 736 "" >> $(ERROR_FILE) ; \ 737 fi 738 739 ###################################################### 740 # CACERTS_FILE must be absoulte path and readable 741 ###################################################### 742 sane-cacerts: 743 ifdef ALT_CACERTS_FILE 744 @if [ `$(ECHO) $(subst \,/,$(ALT_CACERTS_FILE)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ 745 $(ECHO) "ERROR: ALT_CACERTS_FILE must be an Absolute Path Name, \n" \ 746 " not a Relative Path Name. \n" \ 747 " The current value of ALT_CACERTS_FILE is \n" \ 748 " $(ALT_CACERTS_FILE) \n" \ 749 " Please fix this and continue your build. \n" \ 750 "" >> $(ERROR_FILE) ; \ 751 fi 752 endif 753 @# 754 @# CACERTS_FILE must be readable 755 @# 756 @if [ ! -r "$(subst \,/,$(CACERTS_FILE))" ]; then \ 757 $(ECHO) "ERROR: You do not have access to a valid cacerts file. \n" \ 758 " Please check your access to \n" \ 759 " $(subst \,/,$(CACERTS_FILE)) \n" \ 760 " and/or check your value of ALT_CACERTS_FILE. \n" \ 761 "" >> $(ERROR_FILE) ; \ 762 fi 763 @# 764 @# CACERTS_FILE must be a file 765 @# 766 @if [ -d "$(subst \,/,$(CACERTS_FILE))" ]; then \ 767 $(ECHO) "ERROR: You do not have access to a valid cacerts file.\n" \ 768 " The value of CACERTS_FILE must point to a normal file.\n" \ 769 " Please check your access to \n" \ 770 " $(subst \,/,$(CACERTS_FILE)) \n" \ 771 " and/or check your value of ALT_CACERTS_FILE. \n" \ 772 "" >> $(ERROR_FILE) ; \ 773 fi 774 775 ###################################################### 776 # Check for existence of Motif in the bootstrap area 777 ###################################################### 778 MOTIF_CHECK_FILE=$(MOTIF_INCLUDE)/Xm/AtomMgr.h 779 sane-motif: 780 ifneq ($(PLATFORM), windows) 781 ifeq ($(MOTIF_REQUIRED), true) 782 ifeq ($(PLATFORM), solaris) 783 @if [ ! -r $(MOTIF_LIB)/libXm.so ]; then \ 784 $(ECHO) "ERROR: You do not have access to a valid Motif 2.1 library. \n" \ 785 " Please check your access to \n" \ 786 " $(MOTIF_LIB)/libXm.so \n" \ 787 " and/or check your value of ALT_MOTIF_DIR. \n" \ 788 "" >> $(ERROR_FILE) ; \ 789 fi 790 endif 791 ifeq ($(PLATFORM), linux) 792 @if [ ! -r $(MOTIF_LIB)/libXm.a ]; then \ 793 $(ECHO) "ERROR: You do not have access to a valid Motif 2.1 library. \n" \ 794 " Please check your access to \n" \ 795 " $(MOTIF_LIB)/libXm.a \n" \ 796 " and/or check your value of ALT_MOTIF_DIR. \n" \ 797 "" >> $(ERROR_FILE) ; \ 798 fi 799 endif 800 endif 801 @if [ ! -r $(MOTIF_CHECK_FILE) ]; then \ 802 $(ECHO) "ERROR: You do not have access to valid Motif 2.1 header files. \n" \ 803 " Please check your access to (for example) \n" \ 804 " $(MOTIF_CHECK_FILE) \n" \ 805 " and/or check your value of ALT_MOTIF_DIR. \n" \ 806 "" >> $(ERROR_FILE) ; \ 807 fi 808 endif 809 810 ###################################################### 811 # Check for availability of FreeType (OpenJDK specific) 812 ###################################################### 813 814 ifdef OPENJDK 815 816 #name of test program that prints out "Failed" if freetype is not good enough 817 FREETYPE_VERSION_CHECK_NAME = freetype_versioncheck 818 FREETYPE_VERSION_CHECK = $(TEMPDIR)/$(FREETYPE_VERSION_CHECK_NAME)$(EXE_SUFFIX) 819 820 sane-freetype: 821 @-($(CD) $(BUILDDIR)/tools/freetypecheck && \ 822 $(MAKE) REQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION) \ 823 FT_TEST=$(FREETYPE_VERSION_CHECK_NAME) \ 824 FT_HEADERS=$(FREETYPE_HEADERS_PATH) \ 825 FT_LIB=$(FREETYPE_LIB_PATH) \ 826 XARCH=$(XARCH)) 827 @if [ ! -r $(FREETYPE_VERSION_CHECK) -o \ 828 "`$(FREETYPE_VERSION_CHECK) | $(GREP) Fail`" != "" ]; then \ 829 $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \ 830 "or higher is required. \n" >> $(ERROR_FILE) ; \ 831 fi 832 833 else 834 #do nothing (not OpenJDK) 835 sane-freetype: 836 endif 837 838 ###################################################### 839 # CUPS_HEADERS_PATH must be valid 840 ###################################################### 841 sane-cups: 842 ifneq ($(PLATFORM), windows) 843 @if [ ! -r $(CUPS_HEADERS_PATH)/cups/cups.h ]; then \ 844 $(ECHO) "ERROR: You do not have access to valid Cups header files. \n" \ 845 " Please check your access to \n" \ 846 " $(CUPS_HEADERS_PATH)/cups/cups.h \n" \ 847 " and/or check your value of ALT_CUPS_HEADERS_PATH, \n" \ 848 " CUPS is frequently pre-installed on many systems, \n" \ 849 " or may be downloaded from http://www.cups.org \n" \ 850 "" >> $(ERROR_FILE) ; \ 851 fi 852 endif 853 854 ###################################################### 855 # Check for existence of DEVTOOLS_PATH 856 ###################################################### 857 sane-devtools_path: 858 @if [ "$(DEVTOOLS_PATH)" != "" -a ! -r "$(DEVTOOLS_PATH)" ]; then \ 859 $(ECHO) "ERROR: You do not have a valid DEVTOOLS_PATH setting. \n" \ 860 " Please check your access to \n" \ 861 " $(DEVTOOLS_PATH) \n" \ 862 " and/or check your value of ALT_DEVTOOLS_PATH. \n" \ 863 "" >> $(ERROR_FILE) ; \ 864 fi 865 866 ###################################################### 867 # Check for existence of MS_RUNTIME_LIBRARIES 868 ###################################################### 869 sane-msvcrt_path: 870 ifeq ($(PLATFORM), windows) 871 @if [ ! -r "$(MSVCRT_DLL_PATH)/msvcrt.dll" ]; then \ 872 $(ECHO) "ERROR: You do not have access to msvcrt.dll. \n" \ 873 " Please check your access to \n" \ 874 " $(MSVCRT_DLL_PATH) \n" \ 875 " and/or check your value of ALT_MSVCRT_DLL_PATH. \n" \ 876 "" >> $(ERROR_FILE) ; \ 877 fi 878 ifeq ($(ARCH_DATA_MODEL), 32) 879 ifeq ($(COMPILER_VERSION), VS2003) 880 @if [ ! -r "$(MSVCR71_DLL_PATH)/msvcr71.dll" ]; then \ 881 $(ECHO) "ERROR: You do not have access to msvcr71.dll. \n" \ 882 " Please check your access to \n" \ 883 " $(MSVCR71_DLL_PATH) \n" \ 884 " and/or check your value of ALT_MSVCR71_DLL_PATH. \n" \ 885 "" >> $(ERROR_FILE) ; \ 886 fi 887 endif 888 endif 889 endif 890 891 ###################################################### 892 # Check for existence of COMPILER_PATH 893 ###################################################### 894 sane-compiler_path: 895 @if [ "$(COMPILER_PATH)" != "" -a ! -r "$(COMPILER_PATH)" ]; then \ 896 $(ECHO) "ERROR: You do not have a valid COMPILER_PATH setting. \n" \ 897 " Please check your access to \n" \ 898 " $(COMPILER_PATH) \n" \ 899 " and/or check your value of ALT_COMPILER_PATH. \n" \ 900 "" >> $(ERROR_FILE) ; \ 901 fi 902 903 ###################################################### 904 # Check for existence of UNIXCOMMAND_PATH 905 ###################################################### 906 sane-unixcommand_path: 907 @if [ "$(UNIXCOMMAND_PATH)" != "" -a ! -r "$(UNIXCOMMAND_PATH)" ]; then \ 908 $(ECHO) "ERROR: You do not have a valid UNIXCOMMAND_PATH setting. \n" \ 909 " Please check your access to \n" \ 910 " $(UNIXCOMMAND_PATH) \n" \ 911 " and/or check your value of ALT_UNIXCOMMAND_PATH. \n" \ 912 "" >> $(ERROR_FILE) ; \ 913 fi 914 ifeq ($(PLATFORM), windows) 915 @for utility in cpio ar file m4 ; do \ 916 if [ ! -r "`$(WHICH) $${utility}`" ]; then \ 917 $(ECHO) "WARNING: You do not have the utility $${utility} in the \n" \ 918 " directory $(UNIXCOMMAND_PATH). \n" \ 919 " The utilities cpio, ar, file, and m4 are required. \n" \ 920 "" >> $(WARNING_FILE) ; \ 921 fi; \ 922 done 923 endif 924 925 ###################################################### 926 # Check for existence of USRBIN_PATH on linux 927 ###################################################### 928 sane-usrbin_path: 929 ifeq ($(PLATFORM), linux) 930 @if [ "$(USRBIN_PATH)" != "" -a ! -r "$(USRBIN_PATH)" ]; then \ 931 $(ECHO) "ERROR: You do not have a valid USRBIN_PATH setting. \n" \ 932 " Please check your access to \n" \ 933 " $(USRBIN_PATH) \n" \ 934 " and/or check your value of ALT_USRBIN_PATH. \n" \ 935 "" >> $(ERROR_FILE) ; \ 936 fi 937 endif 938 939 ###################################################### 940 # Check for existence of UNIXCCS_PATH on solaris 941 ###################################################### 942 sane-unixccs_path: 943 ifeq ($(PLATFORM), solaris) 944 @if [ "$(UNIXCCS_PATH)" != "" -a ! -r "$(UNIXCCS_PATH)" ]; then \ 945 $(ECHO) "ERROR: You do not have a valid UNIXCCS_PATH setting. \n" \ 946 " Please check your access to \n" \ 947 " $(UNIXCCS_PATH) \n" \ 948 " and/or check your value of ALT_UNIXCCS_PATH. \n" \ 949 "" >> $(ERROR_FILE) ; \ 950 fi 951 endif 952 953 ###################################################### 954 # Verify the docs directory exists 955 ###################################################### 956 sane-docs_import: 957 @if [ ! -d "$(HOTSPOT_DOCS_IMPORT_PATH)" ]; then \ 958 $(ECHO) "WARNING: The directory HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_DOCS_IMPORT_PATH) \n" \ 959 " does not exist, check your value of ALT_HOTSPOT_DOCS_IMPORT_PATH. \n" \ 960 "" >> $(WARNING_FILE) ; \ 961 fi 962 963 ###################################################### 964 # Check for possible problem regarding __fabsf, math_iso.h and the libm patch. 965 # Hotspot should have been changed in Mustang 6.0 Build 47 to not depend 966 # on __fabsf, this is just checking that fact now. 967 ###################################################### 968 sane-math_iso: 969 ifeq ($(PLATFORM), solaris) 970 @if [ -f $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \ 971 if [ "`$(NM) $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) | $(GREP) __fabsf`" != "" ]; then \ 972 $(ECHO) "WARNING: This version of hotspot relies on __fabsf \n" \ 973 " which is not always available on Solaris 8 and 9 machines \n" \ 974 " unless they have the latest libm patch and the file \n" \ 975 " /usr/include/iso/math_iso.h which can trigger this dependency.\n" \ 976 " Hotspot should NOT be dependent on this extern, check the \n" \ 977 " version of the hotspot library you are using. \n" \ 978 "" >> $(WARNING_FILE) ; \ 979 fi; \ 980 fi 981 endif 982 983 ###################################################### 984 # Check for possible patch problem regarding /usr/lib/libCrun.so 985 ###################################################### 986 sane-libCrun: 987 ifeq ($(PLATFORM), solaris) 988 @if [ "`$(NM) /usr/lib/libCrun.so.1 | $(GREP) __1c2n6FIpv_0_`" = "" ]; then \ 989 $(ECHO) "WARNING: The file /usr/lib/libCrun.so.1 is missing the extern \n" \ 990 " __1c2n6FIpv_0_ which indicates that the system is missing \n" \ 991 " a required Solaris patch, or you are using a pre-FCS release \n" \ 992 " of Solaris 10. You need the latest /usr/lib/libCrun.so.1 \n" \ 993 " which comes with the FCS release of Solaris 10 and available \n" \ 994 " through the latest Solaris 8 or 9 C++ runtime patches. \n" \ 995 "" >> $(WARNING_FILE) ; \ 996 fi 997 endif 998 999 ###################################################### 1000 # Check for existence of MSDEVTOOLS_PATH on windows 1001 ###################################################### 1002 sane-msdevtools_path: 1003 ifeq ($(PLATFORM), windows) 1004 @if [ "$(MSDEVTOOLS_PATH)" != "" -a ! -r "$(MSDEVTOOLS_PATH)" ]; then \ 1005 $(ECHO) "ERROR: You do not have a valid MSDEVTOOLS_PATH setting. \n" \ 1006 " Please check your access to \n" \ 1007 " $(MSDEVTOOLS_PATH) \n" \ 1008 " and/or check your value of ALT_MSDEVTOOLS_PATH. \n" \ 1009 "" >> $(ERROR_FILE) ; \ 1010 fi 1011 endif 1012 1013 ###################################################### 1014 # Check for existence of Hotspot binaries 1015 ###################################################### 1016 sane-hotspot_binaries: 1017 ifeq ($(ARCH_DATA_MODEL), 32) 1018 @if [ ! -r $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \ 1019 $(ECHO) "ERROR: HOTSPOT_CLIENT_PATH does not point to a valid HotSpot VM. \n" \ 1020 " Please check your access to \n" \ 1021 " $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) \n" \ 1022 " and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \ 1023 "" >> $(ERROR_FILE) ; \ 1024 fi 1025 endif 1026 @if [ ! -r $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \ 1027 $(ECHO) "ERROR: HOTSPOT_SERVER_PATH does not point to a valid HotSpot VM. \n" \ 1028 " Please check your access to \n" \ 1029 " $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) \n" \ 1030 " and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \ 1031 "" >> $(ERROR_FILE) ; \ 1032 fi 1033 @# 1034 @# Check value of HOTSPOT_LIB_PATH 1035 @# 1036 ifeq ($(PLATFORM), windows) 1037 @if [ ! -r $(HOTSPOT_LIB_PATH)/jvm.lib ]; then \ 1038 $(ECHO) "ERROR: HOTSPOT_LIB_PATH does not point to a valid HotSpot library. \n" \ 1039 " Please check your access to \n" \ 1040 " $(HOTSPOT_LIB_PATH)/jvm.lib \n" \ 1041 " and/or check your value of ALT_HOTSPOT_LIB_PATH. \n" \ 1042 "" >> $(ERROR_FILE) ; \ 1043 fi 1044 @# 1045 @# Check for the .map files - its OK if they are not there.. 1046 @# 1047 ifeq ($(ARCH_DATA_MODEL), 32) 1048 @# There is no 64-bit HotSpot client VM 1049 @if [ ! -r $(HOTSPOT_CLIENT_PATH)/jvm.map ]; then \ 1050 $(ECHO) "WARNING: HOTSPOT_CLIENT_PATH does not point to valid HotSpot .map files. \n" \ 1051 " These files are optional and aid in the debugging of the JVM. \n" \ 1052 " Please check your access to \n" \ 1053 " $(HOTSPOT_CLIENT_PATH)/jvm.map \n" \ 1054 " and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \ 1055 "" >> $(WARNING_FILE) ; \ 1056 fi 1057 @if [ ! -r $(HOTSPOT_CLIENT_PATH)/jvm.pdb ]; then \ 1058 $(ECHO) "WARNING: HOTSPOT_CLIENT_PATH does not point to valid HotSpot .pdb files. \n" \ 1059 " These files are optional and aid in the debugging of the JVM. \n" \ 1060 " Please check your access to \n" \ 1061 " $(HOTSPOT_CLIENT_PATH)/jvm.pdb \n" \ 1062 " and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \ 1063 "" >> $(WARNING_FILE) ; \ 1064 fi 1065 endif 1066 @if [ ! -r $(HOTSPOT_SERVER_PATH)/jvm.map ]; then \ 1067 $(ECHO) "WARNING: HOTSPOT_SERVER_PATH does not point to valid HotSpot .map files. \n" \ 1068 " These files are optional and aid in the debugging of the JVM. \n" \ 1069 " Please check your access to \n" \ 1070 " $(HOTSPOT_SERVER_PATH)/jvm.map \n" \ 1071 " and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \ 1072 "" >> $(WARNING_FILE) ; \ 1073 fi 1074 @if [ ! -r $(HOTSPOT_SERVER_PATH)/jvm.pdb ]; then \ 1075 $(ECHO) "WARNING: HOTSPOT_SERVER_PATH does not point to valid HotSpot .pdb files. \n" \ 1076 " These files are optional and aid in the debugging of the JVM. \n" \ 1077 " Please check your access to \n" \ 1078 " $(HOTSPOT_SERVER_PATH)/jvm.pdb \n" \ 1079 " and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \ 1080 "" >> $(WARNING_FILE) ; \ 1081 fi 1082 endif 1083 1084 1085 ###################################################### 1086 # Check for existence of misc Hotspot imported files 1087 ###################################################### 1088 HOTSPOT_INCLUDE_FILE_LIST = jvmti.h 1089 #HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h 1090 #HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h 1091 #HOTSPOT_INCLUDE_FILE_LIST += jmm.h 1092 TMP_SDK_INCLUDE_FILE_LIST=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.h) 1093 TMP_SDK_INCLUDE_FILE_DIFFS=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.hdiffs) 1094 1095 # These include files must have a pattern: 'version: MAJOR.MINOR.MICRO' 1096 # where MACRO, MINOR, and MICRO are numbers, e.g. 1.0.1, 0.2.90, etc. 1097 # The critical version we are checking is MAJOR.MINOR, we print all three 1098 # when we detect an error. 1099 1100 TMP_SDK_INCLUDE_FIND_VERSION= $(EGREP) 'version:' 1101 TMP_SDK_INCLUDE_GET_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \ 1102 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\)\.[0-9].*@\1@' 1103 TMP_SDK_INCLUDE_GET_FULL_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \ 1104 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*@\1@' 1105 1106 # Compare an interface file (Rule creates 2 temp files: %.h and %.h.IMPORT) 1107 # Files jvm.h, jvm_md.h and jmm.h are special in that they are not publicly 1108 # exported but do represent VM interfaces used by the rest of the jdk. 1109 # So these 3 will not be found in a promoted build and can only 1110 # be checked when this represents a full control build (i.e. the 1111 # HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory). 1112 $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h 1113 @$(install-file) 1114 @$(RM) $@.IMPORT 1115 @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \ 1116 $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \ 1117 elif [ "$(@F)" != "jvm.h" -a "$(@F)" != "jmm.h" ] ; then \ 1118 $(ECHO) "WARNING: HOTSPOT_IMPORT_PATH does not contain the interface file $(@F). \n" \ 1119 " Check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \ 1120 "" >> $(WARNING_FILE) ; \ 1121 $(CP) $< $@.IMPORT; \ 1122 else \ 1123 $(CP) $< $@.IMPORT; \ 1124 fi 1125 1126 $(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h 1127 @$(install-file) 1128 @$(RM) $@.IMPORT 1129 @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \ 1130 $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \ 1131 elif [ "$(@F)" != "jvm_md.h" ] ; then \ 1132 $(ECHO) "WARNING: HOTSPOT_IMPORT_PATH does not contain the interface file $(@F). \n" \ 1133 " Check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \ 1134 "" >> $(WARNING_FILE) ; \ 1135 $(CP) $< $@.IMPORT; \ 1136 else \ 1137 $(CP) $< $@.IMPORT; \ 1138 fi 1139 1140 # Compares the two tempfiles: %.h and %.h.IMPORT, answer in %.hdiffs 1141 # Note: Putting anything into the hdiffs file will trigger generic IMPORT 1142 # warning message in hotspot_import_include. 1143 # First checks the major.minor versions, the micro number can differ. 1144 # Second checks the full version. 1145 # Lastly does a full diff if the full version differs or it has no version 1146 $(TEMPDIR)/%.hdiffs: $(TEMPDIR)/%.h 1147 @$(prep-target) 1148 @$(TOUCH) $@ 1149 @if [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_GET_VERSION)`" != \ 1150 "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_VERSION)`" ] ; then \ 1151 $(ECHO) "WARNING: The file $(<F) is not the same interface as the VM version.\n " \ 1152 " this workspace has $(<F) `$(CAT) $< | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` and \n " \ 1153 " HOTSPOT_IMPORT_PATH contains $(<F) `$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` \n" \ 1154 "" >> $(WARNING_FILE) ; \ 1155 $(ECHO) "Version mis-match" > $@ ; \ 1156 fi 1157 @if [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" != \ 1158 "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" ] ; then \ 1159 $(RM) $<.filtered $<.IMPORT.filtered; \ 1160 $(EGREP) -v 'VERSION' $< > $<.filtered; \ 1161 $(EGREP) -v 'VERSION' $<.IMPORT > $<.IMPORT.filtered; \ 1162 ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \ 1163 elif [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_FIND_VERSION)`" = "" ] ; then \ 1164 $(RM) $<.filtered $<.IMPORT.filtered; \ 1165 $(EGREP) -v '@\(#\)' $< > $<.filtered; \ 1166 $(EGREP) -v '@\(#\)' $<.IMPORT > $<.IMPORT.filtered; \ 1167 ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \ 1168 fi 1169 1170 # Verify all imported hotspot files 1171 sane-hotspot_import:: sane-hotspot_import_dir sane-hotspot_import_include 1172 1173 # Verify the base directory exists 1174 sane-hotspot_import_dir: 1175 @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS) 1176 @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST) 1177 @if [ ! -d "$(HOTSPOT_IMPORT_PATH)" ]; then \ 1178 $(ECHO) "WARNING: The directory HOTSPOT_IMPORT_PATH=$(HOTSPOT_IMPORT_PATH) \n" \ 1179 " does not exist, check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \ 1180 "" >> $(WARNING_FILE) ; \ 1181 fi 1182 1183 # Verify hotspot include files 1184 sane-hotspot_import_include: $(TMP_SDK_INCLUDE_FILE_LIST) $(TMP_SDK_INCLUDE_FILE_DIFFS) 1185 @if [ "`$(CAT) $(TMP_SDK_INCLUDE_FILE_DIFFS)`" != "" ] ; then \ 1186 $(ECHO) "WARNING: Possible HotSpot VM interface conflict. \n" \ 1187 " HOTSPOT_IMPORT_PATH is used to import files from the VM build. \n" \ 1188 " It is also used to verify that any copied files are consistent between \n" \ 1189 " these two components. It has been detected that one or more of the \n" \ 1190 " VM interface files inside this workspace may not match the interfaces \n" \ 1191 " exported by the VM, or the VM versions could not be found. \n" \ 1192 " The list of VM interface files is: \n" \ 1193 " $(HOTSPOT_INCLUDE_FILE_LIST). \n" \ 1194 " This workspace has copies of these files at: \n" \ 1195 " $(SHARE_SRC)/javavm/export and $(PLATFORM_SRC)/javavm/export \n" \ 1196 " for build purposes, and they should contain the same interfaces \n" \ 1197 " as the VM versions imported from: \n" \ 1198 " \$$(HOTSPOT_IMPORT_PATH)/include \n" \ 1199 " (i.e. $(HOTSPOT_IMPORT_PATH)/include) \n" \ 1200 " If an interface indeed doesn't match, then the use of this interface \n" \ 1201 " at JDK runtime could cause serious errors. \n" \ 1202 "" >> $(WARNING_FILE) ; \ 1203 for i in $(TMP_SDK_INCLUDE_FILE_DIFFS); do \ 1204 if [ -s $$i ] ; then \ 1205 $(ECHO) " " >> $(WARNING_FILE); \ 1206 $(ECHO) "VM Interface Differences: $$i" >> $(WARNING_FILE); \ 1207 $(CAT) $$i >> $(WARNING_FILE); \ 1208 $(ECHO) " " >> $(WARNING_FILE); \ 1209 fi; \ 1210 done; \ 1211 fi 1212 @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS) 1213 @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST) 1214 1215 # The JDI-SA feature is not currently released on some platforms. 1216 # See the Defs-<arch>.gmk files. 1217 1218 ifeq ($(INCLUDE_SA), true) 1219 # Verify that hotspot Serviceability Agent files are present. To keep 1220 # it simple, we will just check for one of them. The others have arch 1221 # dependent paths. 1222 1223 sane-hotspot_import:: 1224 @if [ ! -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \ 1225 $(ECHO) "WARNING: File $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar does not exist.\n" \ 1226 " The JDI binding for the Serviceability Agent will not be included in the build.\n" \ 1227 " Please check your access to\n" \ 1228 " $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar\n" \ 1229 " and/or check your value of ALT_HOTSPOT_IMPORT_PATH.\n" \ 1230 "" >> $(WARNING_FILE) ; \ 1231 fi 1232 endif 1233 1234 ###################################################### 1235 # Check the ant version 1236 ###################################################### 1237 ANT_CHECK :=$(call CheckVersions,$(ANT_VER),$(REQUIRED_ANT_VER)) 1238 sane-ant_version: 1239 @if [ "$(ANT_CHECK)" != "same" \ 1240 -a "$(ANT_CHECK)" != "newer" ]; then \ 1241 $(ECHO) "WARNING: The version of ant being used is older than \n" \ 1242 " the required version of '$(REQUIRED_ANT_VER)'. \n" \ 1243 " The version of ant found was '$(ANT_VER)'. \n" \ 1244 "" >> $(WARNING_FILE) ; \ 1245 fi 1246 1247 ###################################################### 1248 # Check the zip file version 1249 ###################################################### 1250 ZIP_CHECK :=$(call CheckVersions,$(ZIP_VER),$(REQUIRED_ZIP_VER)) 1251 sane-zip_version: sane-unzip_version 1252 @if [ "$(ZIP_CHECK)" != "same" -a "$(ZIP_CHECK)" != "newer" ]; then \ 1253 $(ECHO) "WARNING: The version of zip being used is older than \n" \ 1254 " the required version of '$(REQUIRED_ZIP_VER)'. \n" \ 1255 " The version of zip found was '$(ZIP_VER)'. \n" \ 1256 "" >> $(WARNING_FILE) ; \ 1257 fi 1258 1259 ###################################################### 1260 # Check the unzip file version 1261 ###################################################### 1262 UNZIP_CHECK :=$(call CheckVersions,$(UNZIP_VER),$(REQUIRED_UNZIP_VER)) 1263 sane-unzip_version: 1264 @if [ "$(UNZIP_CHECK)" != "same" -a "$(UNZIP_CHECK)" != "newer" ]; then \ 1265 $(ECHO) "WARNING: The version of unzip being used is older than \n" \ 1266 " the required version of '$(REQUIRED_UNZIP_VER)'. \n" \ 1267 " The version of unzip found was '$(UNZIP_VER)'. \n" \ 1268 "" >> $(WARNING_FILE) ; \ 1269 fi 1270 1271 ###################################################### 1272 # Check for windows DirectX sdk directory 1273 ###################################################### 1274 sane-dxsdk: 1275 ifeq ($(PLATFORM), windows) 1276 @if [ ! -r $(DXSDK_INCLUDE_PATH)/ddraw.h ]; then \ 1277 $(ECHO) "ERROR: You do not have access to a valid DirectX SDK Include dir.\n" \ 1278 " The value of DXSDK_INCLUDE_PATH must point a valid DX SDK dir.\n" \ 1279 " Please check your access to \n" \ 1280 " $(DXSDK_INCLUDE_PATH) \n" \ 1281 " and/or check your value of ALT_DXSDK_PATH or ALT_DXSDK_INCLUDE_PATH.\n" \ 1282 " Microsoft DirectX 9 SDK (Summer 2004 Update or newer) can be downloaded from the following location:\n" \ 1283 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \ 1284 " Or http://www.microsoft.com/directx\n" \ 1285 "" >> $(ERROR_FILE) ; \ 1286 else \ 1287 if [ ! "$(DXSDK_VER)" = "$(REQUIRED_DXSDK_VER)" ]; then \ 1288 $(ECHO) "ERROR: The DirectX SDK must be version $(REQUIRED_DXSDK_VER).\n" \ 1289 " $(YOU_ARE_USING) DirectX SDK version: $(DXSDK_VER)\n" \ 1290 " The DirectX SDK was obtained from the following location: \n" \ 1291 " $(DXSDK_PATH) \n" \ 1292 " Please change your DirectX SDK. \n" \ 1293 " Microsoft DirectX 9 SDK (Summer 2004 Update or newer) can be downloaded from the following location:\n" \ 1294 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \ 1295 " Or http://www.microsoft.com/directx\n" \ 1296 "" >> $(ERROR_FILE) ; \ 1297 else \ 1298 if [ -r $(DXSDK_INCLUDE_PATH)/basetsd.h ]; then \ 1299 if [ `$(EGREP) -c __int3264 $(DXSDK_INCLUDE_PATH)/basetsd.h` -ne 0 ]; then \ 1300 $(ECHO) "WARNING: The DirectX SDK Include directory contains a newer basetsd.h,\n" \ 1301 " which may indicate that you're using an incorrect version of DirectX SDK.\n" \ 1302 " This may result in a build failure.\n" \ 1303 " The DirectX SDK Include dir was obtained from the following location:\n" \ 1304 " $(DXSDK_INCLUDE_PATH) \n" \ 1305 " Please change your DirectX SDK to version 7 or 9 (Summer 2004 Update or newer).\n" \ 1306 " Microsoft DirectX 9 SDK can be downloaded from the following location:\n" \ 1307 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \ 1308 " Or http://www.microsoft.com/directx\n" \ 1309 "" >> $(WARNING_FILE) ; \ 1310 fi \ 1311 fi \ 1312 fi \ 1313 fi 1314 endif 1315 1316 ###################################################### 1317 # Check for the Microsoft Layer for Unicode binary files 1318 ###################################################### 1319 sane-mslu: 1320 ifeq ($(PLATFORM), windows) 1321 ifeq ($(ARCH_DATA_MODEL), 32) 1322 @if [ ! -r "$(UNICOWS_LIB_PATH)/unicows.lib" ]; then \ 1323 $(ECHO) "ERROR: You do not have access to the Microsoft Layer for Unicode (MSLU) linktime files.\n" \ 1324 " Please check your access to \n" \ 1325 " $(UNICOWS_LIB_PATH)/unicows.lib \n" \ 1326 " and/or check your value of ALT_UNICOWS_LIB_PATH \n" \ 1327 "" >> $(ERROR_FILE) ; \ 1328 fi 1329 @if [ ! -r "$(UNICOWS_DLL_PATH)/unicows.dll" ]; then \ 1330 $(ECHO) "ERROR: You do not have access to the Microsoft Layer for Unicode (MSLU) runtime files.\n" \ 1331 " Please check your access to \n" \ 1332 " $(UNICOWS_DLL_PATH)/unicows.dll \n" \ 1333 " and/or check your value of ALT_UNICOWS_DLL_PATH \n" \ 1334 "" >> $(ERROR_FILE) ; \ 1335 fi 1336 endif 1337 endif 1338 1339 ###################################################### 1340 # Check the linker version(s) 1341 ###################################################### 1342 ifeq ($(PLATFORM), windows) 1343 LINK_CHECK :=$(call CheckVersions,$(LINK_VER),$(REQUIRED_LINK_VER)) 1344 endif 1345 sane-link: 1346 ifdef LINK_VER 1347 @if [ "$(LINK_CHECK)" = "missing" ]; then \ 1348 $(ECHO) "ERROR: The Linker version is undefined. \n" \ 1349 "" >> $(ERROR_FILE) ; \ 1350 fi 1351 @if [ "$(LINK_CHECK)" != "same" ]; then \ 1352 $(ECHO) "WARNING: To build Java 2 SDK $(JDK_VERSION) you need : \n" \ 1353 " $(COMPILER_VERSION) - link.exe version \"$(REQUIRED_LINK_VER)\" \n" \ 1354 " Specifically the $(COMPILER_NAME) link.exe. \n " \ 1355 " $(YOU_ARE_USING) Linker version \"$(LINK_VER)\" \n" \ 1356 "" >> $(WARNING_FILE) ; \ 1357 fi 1358 endif 1359 1360 ###################################################### 1361 # Check the compiler version(s) 1362 ###################################################### 1363 CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER)) 1364 ifeq ($(PLATFORM), solaris) 1365 ifeq ($(ARCH_DATA_MODEL), 32) 1366 GCC_CHECK :=$(call CheckVersions,$(GCC_VER),$(REQUIRED_GCC_VER)) 1367 endif 1368 endif 1369 sane-compiler: sane-link 1370 @if [ "$(CC_CHECK)" = "missing" ]; then \ 1371 $(ECHO) "ERROR: The Compiler version is undefined. \n" \ 1372 "" >> $(ERROR_FILE) ; \ 1373 fi 1374 ifndef OPENJDK 1375 @if [ "$(CC_CHECK)" != "same" ]; then \ 1376 $(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \ 1377 " Specifically the $(COMPILER_NAME) $(CC_TYPE) compiler. \n " \ 1378 " $(YOU_ARE_USING) compiler version: $(CC_VER) \n" \ 1379 " The compiler was obtained from the following location: \n" \ 1380 " $(COMPILER_PATH) \n" \ 1381 "" >> $(WARNING_FILE) ; \ 1382 fi 1383 ifdef GCC_CHECK 1384 @if [ "$(GCC_CHECK)" != "same" ]; then \ 1385 $(ECHO) "WARNING: The $(PLATFORM) GCC compiler must be version $(REQUIRED_GCC_VER) \n" \ 1386 " $(YOU_ARE_USING) compiler version: $(GCC_VER) \n" \ 1387 " The compiler was obtained from the following location: \n" \ 1388 " $(GCC_COMPILER_PATH) \n" \ 1389 " Please change your compiler. \n" \ 1390 "" >> $(WARNING_FILE) ; \ 1391 fi 1392 endif 1393 ifeq ($(PLATFORM), windows) 1394 ifeq ($(ARCH_DATA_MODEL), 64) 1395 ifneq ($(COMPILER_VERSION), VS2005) 1396 @$(ECHO) "WARNING: Should be using VS2005 compiler on 64bit platform. \n" \ 1397 "" >> $(WARNING_FILE) 1398 endif 1399 endif 1400 endif 1401 endif 1402 1403 ###################################################### 1404 # Check that ALSA headers and libs are installed and 1405 # that the header has the right version. We only 1406 # need /usr/include/alsa/*.h and /usr/lib/libasound.so 1407 ###################################################### 1408 1409 ifdef ALSA_VERSION_CHECK 1410 $(ALSA_VERSION_CHECK): $(ALSA_VERSION_CHECK).c 1411 @$(prep-target) 1412 @$(CC) -lasound -o $@ $< 1413 1414 $(ALSA_VERSION_CHECK).c: 1415 @$(prep-target) 1416 @$(ECHO) "#include <alsa/asoundlib.h>\n" \ 1417 "int main(char** argv, int argc) {\n" \ 1418 " printf(\"%s\", SND_LIB_VERSION_STR);\n" \ 1419 " return 0;\n" \ 1420 "}\n" \ 1421 > $@ 1422 endif 1423 1424 sane-alsa-versioncheck: $(ALSA_VERSION_CHECK) 1425 sane-alsa-headers: sane-alsa-versioncheck 1426 ifdef ALSA_VERSION_CHECK 1427 @if [ -f "$(ALSA_VERSION_CHECK)" ]; then \ 1428 if [ `$(ALSA_VERSION_CHECK) | $(EGREP) -c '$(REQUIRED_ALSA_VERSION)'` -ne 1 ] ; then \ 1429 $(ECHO) "ERROR: The ALSA version must be 0.9.1 or higher. \n" \ 1430 " You have the following ALSA version installed: $(ALSA_VERSION) \n" \ 1431 " Please reinstall ALSA (drivers and lib). You can download \n" \ 1432 " the source distribution from http://www.alsa-project.org \n" \ 1433 " or go to http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \ 1434 "" >> $(ERROR_FILE) ; \ 1435 fi \ 1436 else \ 1437 $(ECHO) "ERROR: You seem to not have installed ALSA 0.9.1 or higher. \n" \ 1438 " Please install ALSA (drivers and lib). You can download the \n" \ 1439 " source distribution from http://www.alsa-project.org or go to \n" \ 1440 " http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \ 1441 "" >> $(ERROR_FILE) ; \ 1442 fi 1443 endif 1444 1445 # If a sanity file doesn't exist, just make sure it's dir exists 1446 $(SANITY_FILES): 1447 -@$(prep-target) 1448 1449 ###################################################### 1450 # dump out the variable settings... 1451 ###################################################### 1452 sane-settings:: sane-alsa-versioncheck 1453 @$(ECHO) >> $(MESSAGE_FILE) 1454 @$(ECHO) $(ALL_SETTINGS) >> $(MESSAGE_FILE) 1455 @$(ECHO) >> $(MESSAGE_FILE) 1456 1457 ###################################################### 1458 # Check for existence of DEPLOY_MSSDK on windows 1459 ###################################################### 1460 sane-mssdk_path: 1461 ifeq ($(PLATFORM), windows) 1462 @if [ -z "$(DEPLOY_MSSDK)" ]; then \ 1463 $(ECHO) "WARNING: Your DEPLOY_MSSDK setting is empty.\n" \ 1464 " It is recommended to set ALT_DEPLOY_MSSDK.\n" \ 1465 "" >> $(WARNING_FILE) ; \ 1466 fi 1467 @if [ ! -r "$(DEPLOY_MSSDK)" ]; then \ 1468 $(ECHO) "ERROR: You do not have a valid DEPLOY_MSSDK setting. \n" \ 1469 " Please check your access to \n" \ 1470 " $(DEPLOY_MSSDK) \n" \ 1471 " and/or check your value of ALT_DEPLOY_MSSDK. \n" \ 1472 "" >> $(ERROR_FILE) ; \ 1473 fi 1474 endif 1475 1476 ###################################################### 1477 # Check for existence of INSTALL_MSSDK on windows 1478 ###################################################### 1479 sane-install-mssdk_path: 1480 ifeq ($(PLATFORM), windows) 1481 @if [ -z "$(INSTALL_MSSDK)" ]; then \ 1482 $(ECHO) "WARNING: Your INSTALL_MSSDK setting is empty.\n" \ 1483 " It is recommended to set ALT_INSTALL_MSSDK.\n" \ 1484 "" >> $(WARNING_FILE) ; \ 1485 fi 1486 @if [ ! -r "$(INSTALL_MSSDK)" ]; then \ 1487 $(ECHO) "ERROR: You do not have a valid INSTALL_MSSDK setting. \n" \ 1488 " Please check your access to \n" \ 1489 " $(INSTALL_MSSDK) \n" \ 1490 " and/or check your value of ALT_INSTALL_MSSDK. \n" \ 1491 "" >> $(ERROR_FILE) ; \ 1492 fi 1493 endif 1494 1495 ###################################################### 1496 # Check for existence of INSTALL_MSIVAL2 on windows 1497 ###################################################### 1498 sane-install-msival2_path: 1499 ifeq ($(PLATFORM), windows) 1500 @if [ -z "$(INSTALL_MSIVAL2)" ]; then \ 1501 $(ECHO) "WARNING: Your INSTALL_MSIVAL2 setting is empty.\n" \ 1502 " It is recommended to set ALT_INSTALL_MSIVAL2.\n" \ 1503 "" >> $(WARNING_FILE) ; \ 1504 fi 1505 @if [ ! -r "$(INSTALL_MSIVAL2)" ]; then \ 1506 $(ECHO) "ERROR: You do not have a valid INSTALL_MSIVAL2 setting. \n" \ 1507 " Please check your access to \n" \ 1508 " $(INSTALL_MSIVAL2) \n" \ 1509 " and/or check your value of ALT_INSTALL_MSIVAL2. \n" \ 1510 "" >> $(ERROR_FILE) ; \ 1511 fi 1512 endif 1513 1514 ###################################################### 1515 # Check the Solaris GNU c++ compiler for solaris plugin 1516 ###################################################### 1517 sane-gcc-compiler: 1518 ifeq ($(PLATFORM), solaris) 1519 ifndef OPENJDK 1520 @if [ -r $(GCC_COMPILER_PATH) ]; then \ 1521 if [ ! "$(GCC_VER)" = 2.95.2 ]; then \ 1522 $(ECHO) "ERROR: The Solaris GCC compiler version must be 2.95.2. \n" \ 1523 " You are using the following compiler version: $(GCC_VER) \n" \ 1524 " The compiler was obtained from the following location: \n" \ 1525 " $(GCC_COMPILER_PATH) \n" \ 1526 " Please change your compiler. \n" \ 1527 "" >> $(ERROR_FILE) ; \ 1528 fi \ 1529 else \ 1530 $(ECHO) "ERROR: You do not have a valid GCC_COMPILER_PATH setting. \n" \ 1531 " Please check your access to \n" \ 1532 " $(GCC_COMPILER_PATH) \n" \ 1533 " and/or check your value of ALT_GCC_COMPILER_PATH. \n" \ 1534 " This will affect you if you build the plugin target. \n" \ 1535 "" >> $(ERROR_FILE) ; \ 1536 fi 1537 endif 1538 1539 ifeq ($(PLATFORM), linux) 1540 ifdef ALT_GCC29_COMPILER_PATH 1541 @if [ ! -x $(ALT_GCC29_COMPILER_PATH)/bin/gcc ]; then \ 1542 $(ECHO) "ERROR: You do not have a valid ALT_GCC29_COMPILER_PATH setting. \n" \ 1543 " Please check your access to \n" \ 1544 " $(ALT_GCC29_COMPILER_PATH)/bin/gcc \n" \ 1545 " This will affect you if you build the plugin target. \n" \ 1546 "" >> $(ERROR_FILE) ; \ 1547 fi 1548 endif 1549 ifdef ALT_GCC29_PLUGIN_LIB_PATH 1550 @if [ ! -r $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so ]; then \ 1551 $(ECHO) "Error: You do not have a valid ALT_GCC29_PLUGIN_LIB_PATH setting. \n" \ 1552 " Please check your access to \n" \ 1553 " $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so \n" \ 1554 " This will affect you if you build the plugin target, specifically for gcc 2.9 version of OJI plugin library. \n" \ 1555 "" >> $(ERROR_FILE) ; \ 1556 fi 1557 else 1558 @if [ ! -r $(GCC29_COMPILER_PATH) ]; then \ 1559 $(ECHO) "ERROR: You do not have a valid GCC29_COMPILER_PATH setting. \n" \ 1560 " Please check your access to \n" \ 1561 " $(GCC29_COMPILER_PATH) \n" \ 1562 " and/or check your value of ALT_GCC29_COMPILER_PATH. \n" \ 1563 " This will affect you if you build the plugin target. \n" \ 1564 "" >> $(ERROR_FILE) ; \ 1565 fi 1566 endif 1567 endif 1568 endif 1569 1570 1571 ###################################################### 1572 # MOZILLA_HEADERS_PATH must be valid 1573 ###################################################### 1574 sane-mozilla: 1575 ifeq ($(ARCH_DATA_MODEL), 32) 1576 ifdef ALT_MOZILLA_HEADERS_PATH 1577 @if [ `$(ECHO) $(subst \,/,$(ALT_MOZILLA_HEADERS_PATH)) | $(EGREP) -ci '^([a-z]:)?/'` -ne 1 ]; then \ 1578 $(ECHO) "ERROR: ALT_MOZILLA_HEADERS_PATH must be an Absolute Path Name, \n" \ 1579 " not a Relative Path Name. \n" \ 1580 " The current value of ALT_MOZILLA_HEADERS_PATH is \n" \ 1581 " $(ALT_MOZILLA_HEADERS_PATH) \n" \ 1582 " Please fix this and continue your build. \n" \ 1583 "" >> $(ERROR_FILE) ; \ 1584 fi 1585 endif 1586 @# 1587 @# MOZILLA_HEADERS_PATH must be valid.... 1588 @# 1589 ifeq ($(PLATFORM), windows) 1590 @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18.win32/java/bool.h ]; then \ 1591 $(ECHO) "ERROR: You do not have access to valid Mozilla header files. \n" \ 1592 " Please check your access to \n" \ 1593 " $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18.win32/java/bool.h \n" \ 1594 " and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \ 1595 " and on Windows, ALT_JDK_JAVA_DRIVE. \n" \ 1596 "" >> $(ERROR_FILE) ; \ 1597 fi 1598 else 1599 @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18/java/bool.h ]; then \ 1600 $(ECHO) "ERROR: You do not have access to valid Mozilla header files. \n" \ 1601 " Please check your access to \n" \ 1602 " $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18/java/bool.h \n" \ 1603 " and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \ 1604 "" >> $(ERROR_FILE) ; \ 1605 fi 1606 endif 1607 endif 1608 1609 1610 ###################################################### 1611 # SECURITY_BASELINE_142 test 1612 ###################################################### 1613 security_baseline_142: 1614 ifeq ($(PLATFORM), windows) 1615 @if [ -z "$(SECURITY_BASELINE_142)" ]; then \ 1616 $(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \ 1617 " Setting it to the default value of 1.4.2_10.\n" \ 1618 " It is recommended to set SECURITY_BASELINE_142.\n" \ 1619 "" >> $(WARNING_FILE) ; \ 1620 fi 1621 endif 1622 1623 ###################################################### 1624 # SECURITY_BASELINE_150 test 1625 ###################################################### 1626 security_baseline_150: 1627 ifeq ($(PLATFORM), windows) 1628 @if [ -z "$(SECURITY_BASELINE_150)" ]; then \ 1629 $(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \ 1630 " Setting it to the default value of 1.5.0_07.\n" \ 1631 " It is recommended to set SECURITY_BASELINE_150.\n" \ 1632 "" >> $(WARNING_FILE) ; \ 1633 fi 1634 endif 1635 1636 1637 ###################################################### 1638 # this should be the last rule in any target's sanity rule. 1639 ###################################################### 1640 sane-lastrule: 1641 ifndef EXTERNALSANITYCONTROL 1642 @if [ -r $(MESSAGE_FILE) ]; then \ 1643 $(CAT) $(MESSAGE_FILE) ; \ 1644 fi 1645 @if [ -r $(WARNING_FILE) ]; then \ 1646 $(CAT) $(WARNING_FILE) ; \ 1647 fi 1648 @if [ "x$(INSANE)" != x ]; then \ 1649 $(ECHO) "INSANE mode requested. \n" \ 1650 "Sanity will not force a build termination, even with errors.\n" \ 1651 "" >> $(ERROR_FILE); \ 1652 fi 1653 @if [ -r $(ERROR_FILE) ]; then \ 1654 if [ "x$(INSANE)" = x ]; then \ 1655 $(ECHO) "Exiting because of the above error(s). \n" \ 1656 "">> $(ERROR_FILE); \ 1657 fi ; \ 1658 $(CAT) $(ERROR_FILE) ; \ 1659 if [ "x$(INSANE)" = x ]; then \ 1660 exit 1 ; \ 1661 fi ; \ 1662 fi 1663 ifdef PEDANTIC 1664 @if [ -r $(WARNING_FILE) ]; then \ 1665 $(ECHO) "PEDANTIC mode requested. \n" \ 1666 "Exiting because of the above warning(s). \n" \ 1667 "" >> $(ERROR_FILE); \ 1668 $(CAT) $(ERROR_FILE) ; \ 1669 exit 1 ; \ 1670 fi 1671 endif # PEDANTIC 1672 @if [ ! -r $(ERROR_FILE) ]; then \ 1673 $(ECHO) "Sanity check passed." ; \ 1674 fi 1675 endif # EXTERNALSANITYCONTROL 1676