make/common/shared/Sanity.gmk

Print this page




  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # 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 builds on $(PLATFORM) use
  42 






  43 # How to say "You are using:"
  44 YOU_ARE_USING=You appear to be using
  45 
  46 # Error message
  47 define SanityError
  48 $(ECHO) "ERROR: $1\n" >> $(ERROR_FILE)

  49 endef
  50 
  51 # Warning message
  52 define SanityWarning
  53 $(ECHO) "WARNING: $1\n" >> $(WARNING_FILE)

  54 endef
  55 
  56 # Official version error message: name version required_version
  57 define OfficialErrorMessage
  58 $(call SanityError,\
  59 $(THE_OFFICIAL_USES) $1 $3. Your $1 $(if $2,undefined,$2) will not work.)
  60 endef
  61 
  62 # Official version warning message: name version required_version
  63 define OfficialWarningMessage
  64 $(call SanityWarning,\
  65 $(THE_OFFICIAL_USES) $1 $3. $(YOU_ARE_USING) $1 $2.)
  66 endef
  67 





  68 







































































  69 # Settings and rules to validate the JDK build environment.
  70 
  71 ifeq ($(PLATFORM), solaris)
  72   FREE_SPACE := $(shell $(DF) -b $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
  73   TEMP_FREE_SPACE := $(shell $(DF) -b $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
  74   # What kind of system we are using (Variations are Solaris and OpenSolaris)
  75   OS_VERSION := $(shell uname -r)
  76   OS_VARIANT_NAME := $(strip $(shell head -1 /etc/release | awk '{print $$1;}') )
  77   OS_VARIANT_VERSION := $(OS_VERSION)
  78   REQ_PATCH_LIST = $(JDK_TOPDIR)/make/PatchList.solaris
  79   ifeq ($(ARCH_FAMILY), sparc)
  80     PATCH_POSITION = $$4
  81   else
  82     PATCH_POSITION = $$6
  83   endif
  84   ifndef OPENJDK
  85     _GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
  86     GCC_VER  :=$(call GetVersion,"$(_GCC_VER)")
  87   endif
  88 endif
  89 
  90 ifeq ($(PLATFORM), linux)
  91   FREE_SPACE := $(shell $(DF) --sync -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
  92   TEMP_FREE_SPACE := $(shell $(DF) --sync -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
  93   # What kind of system we are using (Variation is the Linux vendor)
  94   OS_VERSION := $(shell uname -r)
  95   OS_VARIANT_NAME := $(shell \
  96     if [ -f /etc/fedora-release ] ; then \
  97       echo "Fedora"; \
  98     elif [ -f /etc/redhat-release ] ; then \
  99       echo "RedHat"; \
 100     elif [ -f /etc/SuSE-release ] ; then \
 101       echo "SuSE"; \
 102     else \
 103       echo "Unknown"; \
 104     fi)
 105   OS_VARIANT_VERSION := $(shell \
 106     if [ "$(OS_VARIANT_NAME)" = "Fedora" ] ; then \
 107       $(CAT) /etc/fedora-release | $(HEAD) -1 | $(NAWK) '{ print $$3; }' ; \
 108     fi)
 109   ALSA_INCLUDE=/usr/include/alsa/version.h
 110   ALSA_LIBRARY=/usr/lib/libasound.so
 111   _ALSA_VERSION := $(shell $(EGREP) SND_LIB_VERSION_STR $(ALSA_INCLUDE) | \
 112            $(SED) -e 's@.*\"\(.*\)\".*@\1@' )
 113   ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
 114 endif
 115 
 116 ifeq ($(PLATFORM), windows)
 117   FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 118   TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 119   # Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2
 120   #    Assume 5.0 (Windows 2000) if systeminfo does not help
 121   WINDOWS_MAPPING-5.0 := Windows2000
 122   WINDOWS_MAPPING-5.1 := WindowsXP
 123   WINDOWS_MAPPING-5.2 := Windows2003
 124   # What kind of system we are using (Variation is the common name)
 125   _OS_VERSION := \
 126     $(shell systeminfo 2> $(DEV_NULL) | \


 209         sane-hotspot_binaries \
 210         sane-hotspot_import \
 211         sane-hotspot_import_dir \
 212         sane-hotspot_import_include \
 213         sane-compiler \
 214         sane-link \
 215         sane-cacerts \
 216         sane-alsa-headers \
 217         sane-ant_version \
 218         sane-zip_version \
 219         sane-unzip_version \
 220         sane-msvcrt_path \
 221         sane-freetype \
 222         sane-build_modules
 223 
 224 ######################################################
 225 # check for COPYRIGHT_YEAR variable
 226 ######################################################
 227 sane-copyrightyear:
 228 ifdef ALT_COPYRIGHT_YEAR
 229         @$(ECHO) "WARNING: ALT_COPYRIGHT_YEAR but not the current year\n" \
 230                                  " will be used for copyright year.\n " \
 231                 "" >>$(WARNING_FILE)
 232 endif
 233 
 234 ######################################################
 235 # check for INSANE variable
 236 ######################################################
 237 sane-insane:
 238 ifdef INSANE
 239         @$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \
 240            "        should not use this mode, and in fact, \n" \
 241            "        it may be removed at any time. If you \n" \
 242            "        have build problems as a result of using \n" \
 243            "        INSANE mode, then you should not expect \n" \
 244            "        assistance from anyone with the problems \n" \
 245            "        or consequences you experience. \n" \
 246            "" >> $(WARNING_FILE)
 247 endif
 248 
 249 ######################################################
 250 # check for GNU Make version
 251 ######################################################
 252 MAKE_CHECK :=$(call CheckVersions,$(MAKE_VER),$(REQUIRED_MAKE_VER))
 253 sane-make:
 254         @if [ "$(MAKE_CHECK)" != "same" -a "$(MAKE_CHECK)" != "newer" ]; then \
 255           $(ECHO) "WARNING: The version of make being used is older than \n" \
 256             "      the required version of '$(REQUIRED_MAKE_VER)'. \n" \
 257             "      The version of make found was '$(MAKE_VER)'. \n" \
 258             "" >> $(WARNING_FILE) ; \
 259         fi
 260 
 261 ######################################################
 262 # Check the BUILD_NUMBER to make sure it contains bNN
 263 ######################################################
 264 sane-build_number: 
 265         @if [ "`$(ECHO) $(BUILD_NUMBER) | $(SED) 's@.*b[0-9][0-9]*.*@bNN@'`" != "bNN" ] ; then \
 266             $(ECHO) "WARNING: The BUILD_NUMBER needs to contain b[0-9][0-9]*. Currently BUILD_NUMBER=$(BUILD_NUMBER). \n" \
 267               "        This has been known to cause build failures. \n" \
 268               "" >> $(WARNING_FILE) ; \

 269         fi
 270 
 271 ######################################################
 272 # Check the ARCH_DATA_MODEL setting
 273 ######################################################
 274 sane-arch_data_model:
 275         @if [ "$(ARCH_DATA_MODEL)" != 32 -a "$(ARCH_DATA_MODEL)" != 64 ]; then \
 276             $(ECHO) "ERROR: The setting of ARCH_DATA_MODEL must be 32 or 64.\n" \
 277               "      $(YOU_ARE_USING) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL). \n" \
 278               "" >> $(ERROR_FILE) ; \
 279         fi


 280 
 281 ######################################################
 282 # Check the OS version (windows and linus have release name checks)
 283 #   NOTE: OPENJDK explicitly does not check for OS release information.
 284 #         Unless we know for sure that it will not build somewhere, we cannot
 285 #         generate a fatal sanity error, and a warning about the official
 286 #         build platform just becomes clutter.
 287 ######################################################

 288 ifndef OPENJDK
 289   OS_VERSION_CHECK := \
 290     $(call CheckVersions,$(OS_VERSION),$(REQUIRED_OS_VERSION))
 291   ifeq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
 292     OS_VARIANT_VERSION_CHECK := \
 293       $(call CheckVersions,$(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION))





 294   endif
 295 endif
 296 sane-os_version:: sane-arch_data_model sane-memory_check sane-locale sane-os_patch_level
 297 ifndef OPENJDK
 298   ifneq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
 299     ifeq ($(OS_VERSION_CHECK),missing)
 300         @$(call OfficialErrorMessage,OS version,$(OS_VERSION),$(REQUIRED_OS_VERSION))
 301     endif
 302     ifneq ($(OS_VERSION_CHECK),same)
 303         @$(call OfficialWarningMessage,OS version,$(OS_VERSION),$(REQUIRED_OS_VERSION))
 304     endif
 305         @$(call OfficialWarningMessage,OS variant,$(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
 306   else
 307     ifneq ($(OS_VARIANT_VERSION_CHECK),same)
 308         @$(call OfficialWarningMessage,$(OS_VARIANT_NAME) version,$(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION))


 309     endif
 310   endif
 311 endif # OPENJDK
 312 
 313 ifeq ($(PLATFORM), windows)
 314   sane-os_version:: sane-cygwin sane-mks sane-cygwin-shell
 315 endif
 316 
 317 ######################################################
 318 # Check the memory available on this machine
 319 ######################################################
 320 sane-memory_check:
 321         @if [ "$(LOW_MEMORY_MACHINE)" = "true" ]; then \
 322           $(ECHO) "WARNING: This machine appears to only have $(MB_OF_MEMORY)Mb of physical memory, \n" \
 323             "        builds on this machine could be slow. \n" \
 324             "" >> $(WARNING_FILE) ; \
 325         fi
 326 
 327 ######################################################
 328 # Check the locale (value of LC_ALL, not being empty or ==C can be a problem)
 329 ######################################################
 330 sane-locale:
 331 ifneq ($(PLATFORM), windows)
 332         @if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \
 333           $(ECHO) "WARNING: LC_ALL has been set to $(LC_ALL), this can cause build failures. \n" \
 334             "        Try setting LC_ALL to \"C\". \n" \
 335             "" >> $(WARNING_FILE) ; \
 336         fi
 337         @if [ "$(LANG)" != "" -a "$(LANG)" != "C" ]; then \
 338           $(ECHO) "WARNING: LANG has been set to $(LANG), this can cause build failures. \n" \
 339             "        Try setting LANG to \"C\". \n" \
 340             "" >> $(WARNING_FILE) ; \
 341         fi
 342 endif
 343 
 344 ######################################################
 345 # Check the Windows cygwin version
 346 ######################################################
 347 ifeq ($(PLATFORM), windows)
 348   CYGWIN_CHECK :=$(call CheckVersions,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
 349 sane-cygwin:
 350   ifdef USING_CYGWIN
 351     ifeq ($(CYGWIN_CHECK),missing)
 352         @$(call OfficialErrorMessage,CYGWIN version,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
 353     endif
 354     ifeq ($(CYGWIN_CHECK),older)
 355         @$(call OfficialWarningMessage,CYGWIN version,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
 356     endif
 357   endif
 358 endif
 359 
 360 ######################################################
 361 # Check the cygwin shell is used, not cmd.exe
 362 ######################################################
 363 ifeq ($(PLATFORM), windows)
 364 sane-cygwin-shell:
 365   ifdef USING_CYGWIN
 366         @if [ "$(SHLVL)" = "" -a "$(_)" = "" ]; then \
 367           $(ECHO) "ERROR: You are using an unsupported shell. \n" \
 368             "      Use either sh, bash, ksh, zsh, or tcsh. \n" \
 369             "      Using the cmd.exe utility is not supported. \n" \
 370             "      If you still want to try your current shell, \n" \
 371             "      please export SHLVL=1 when running $(MAKE).  \n" \
 372             "" >> $(ERROR_FILE) ; \
 373         fi
 374   endif
 375 endif
 376 
 377 ######################################################
 378 # Check the Windows mks version
 379 ######################################################
 380 ifeq ($(PLATFORM), windows)
 381     MKS_CHECK :=$(call CheckVersions,$(MKS_VER),$(REQUIRED_MKS_VER))
 382 sane-mks:
 383   ifndef USING_CYGWIN
 384     ifeq ($(MKS_CHECK),missing)
 385         @$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER))
 386     endif
 387     ifeq ($(MKS_CHECK),older)
 388         @$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER))
 389     endif
 390   endif
 391 endif
 392 
 393 ######################################################
 394 # Get list of installed patches (this file has a particular format)
 395 ######################################################
 396 $(INSTALL_PATCHES_FILE):
 397         @$(prep-target)
 398 ifeq ($(PLATFORM), solaris)
 399   ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION))
 400         $(SHOWREV) -p > $@ 2>&1
 401   endif
 402 endif
 403         @$(ECHO) "" >> $@
 404 
 405 ######################################################
 406 # Check list of Solaris patches
 407 ######################################################
 408 sane-os_patch_level: $(INSTALL_PATCHES_FILE)
 409 ifeq ($(PLATFORM), solaris)
 410   ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION))


 445             if (installPatchNo[j] == requiredPatchNo[i] \
 446             && installPatchRev[j] >= requiredPatchRev[i]) { \
 447                 foundMatch = 1; \
 448                 break; \
 449             } \
 450         } \
 451         if ( foundMatch == 0) { \
 452             printf("WARNING: Your solaris install is missing the required patch %s-%s\n", requiredPatchNo[i], requiredPatchRev[i] ); \
 453             printf("         Please update your your system patches or build on a different machine.\n\n" ); \
 454             errorCount++; \
 455         } \
 456     } \
 457 }' $(REQ_PATCH_LIST) readingInstallPatches=1 $(INSTALL_PATCHES_FILE) >> $(WARNING_FILE)
 458   endif
 459 endif # PLATFORM
 460 
 461 ######################################################
 462 # CLASSPATH cannot be set, unless you are insane.
 463 ######################################################
 464 sane-classpath:
 465 ifdef CLASSPATH
 466         @$(ECHO) "ERROR: Your CLASSPATH environment variable is set.  This will \n" \
 467            "      most likely cause the build to fail.  Please unset it \n" \
 468            "      and start your build again. \n" \
 469            "" >> $(ERROR_FILE)
 470 endif
 471 
 472 ######################################################
 473 # JAVA_HOME cannot be set, unless you are insane.
 474 ######################################################
 475 sane-java_home:
 476 ifdef JAVA_HOME
 477         @$(ECHO) "ERROR: Your JAVA_HOME environment variable is set.  This will \n" \
 478            "      most likely cause the build to fail.  Please unset it \n" \
 479            "      and start your build again. \n" \
 480            "" >> $(ERROR_FILE)
 481 endif
 482 
 483 ######################################################
 484 # Make sure the fonts are there
 485 # Exceptions are when explicitly building OPENJDK, or
 486 # when the entire CLOSED_SRC dir is excluded, so we are
 487 # implicitly building OPENJDK
 488 ######################################################
 489 FONT_FILE=$(CLOSED_SRC)/share/lib/fonts/LucidaTypewriterRegular.ttf
 490 sane-fonts:
 491 ifndef OPENJDK
 492         @if [ -d $(CLOSED_SRC) ] ; then \
 493          if [ ! -f $(FONT_FILE) ] ; then \
 494           $(ECHO) "ERROR: Missing $(FONT_FILE). \n" \
 495            "      Verify you have downloaded and overlayed on the source area all the binary files. \n" \
 496            "" >> $(ERROR_FILE); \
 497         fi \
 498         fi
 499 endif
 500 
 501 ######################################################
 502 # If building OPENJDK check pre-built binaries are
 503 # available for binary plug source components.
 504 ######################################################
 505 ifdef OPENJDK
 506 sane-binary-plugs:
 507   ifeq ($(IMPORT_BINARY_PLUGS),true)
 508         @if [ ! -d "$(BINARY_PLUGS_PATH)" ]; then \
 509           $(ECHO) "WARNING: Can't locate pre-built libraries. \n" \
 510             "      Please check your access to \n" \
 511             "          $(BINARY_PLUGS_PATH) \n" \
 512             "      and/or check your value of ALT_BINARY_PLUGS_PATH. \n" \
 513            "" >> $(WARNING_FILE); \
 514         fi
 515   endif
 516 endif
 517 
 518 ######################################################
 519 # VARIANT must be set to DBG or OPT
 520 ######################################################
 521 sane-variant:
 522         @if [ "$(VARIANT)" != DBG -a "$(VARIANT)" != OPT ] ; then \
 523           $(ECHO) "ERROR: Your VARIANT environment variable is set to $(VARIANT). \n" \
 524            "      Needs to be set to DBG or OPT \n" \
 525            "" >> $(ERROR_FILE); \
 526         fi


 527 
 528 ######################################################
 529 # LD_LIBRARY_PATH should not be set, unless you are insane.
 530 ######################################################
 531 sane-ld_library_path:
 532 ifdef LD_LIBRARY_PATH
 533         @$(ECHO) "ERROR: Your LD_LIBRARY_PATH environment variable is set.  This may \n" \
 534            "      produce binaries binaries incorrectly.  Please unset it \n" \
 535            "      and start your build again. \n" \
 536            "" >> $(ERROR_FILE)
 537 endif
 538 
 539 ######################################################
 540 # LD_LIBRARY_PATH_64 should not be set, unless you are insane.
 541 ######################################################
 542 sane-ld_library_path_64:
 543 ifdef LD_LIBRARY_PATH_64
 544         @$(ECHO) "ERROR: Your LD_LIBRARY_PATH_64 environment variable is set.  This may \n" \
 545            "      produce binaries binaries incorrectly.  Please unset it \n" \
 546            "      and start your build again. \n" \
 547            "" >> $(ERROR_FILE)
 548 endif
 549 
 550 ######################################################
 551 # LD_OPTIONS should not be set, unless you are insane.
 552 ######################################################
 553 sane-ld_options:
 554 ifdef LD_OPTIONS
 555         @$(ECHO) "ERROR: Your LD_OPTIONS environment variable is set.  This may \n" \
 556            "      produce binaries binaries incorrectly.  Please unset it \n" \
 557            "      and start your build again. \n" \
 558            "" >> $(ERROR_FILE)
 559 endif
 560 
 561 ######################################################
 562 # LD_RUN_PATH should not be set, unless you are insane.
 563 ######################################################
 564 sane-ld_run_path:
 565 ifdef LD_RUN_PATH
 566         @$(ECHO) "ERROR: Your LD_RUN_PATH environment variable is set.  This may \n" \
 567            "      produce binaries binaries incorrectly.  Please unset it \n" \
 568            "      produce binaries binaries incorrectly.  Please unset it \n" \
 569            "      and start your build again. \n" \
 570            "" >> $(ERROR_FILE)
 571 endif
 572 
 573 ######################################################
 574 # MAKEFLAGS cannot be set, unless you are insane.









 575 ######################################################
 576 ifeq ($(PLATFORM), windows)
 577 ifdef USING_CYGWIN
 578 REAL_MAKEFLAGS:=$(subst --unix,,$(MAKEFLAGS))
 579 else
 580 REAL_MAKEFLAGS:=$(MAKEFLAGS)
 581 endif
 582 else
 583 REAL_MAKEFLAGS:=$(MAKEFLAGS)
 584 endif
 585 sane-makeflags:
 586 # ifneq ($(strip $(REAL_MAKEFLAGS)),)
 587 ifeq ($(origin MAKEFLAGS),environment)
 588         @#
 589         @# it is unacceptable to have the-e or --environment-overrides value in MAKEFLAGS
 590         @#
 591         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(e|--environment-overrides)( |$$)'` -ne 0 ]; then \
 592           $(ECHO) "ERROR: Either the build was started with the flag -e or \n" \
 593             "      --environment-overrides, or the MAKEFLAGS environment \n" \
 594             "      variable has this value set.  This will cause any \n" \
 595             "      environment variables you have defined to override \n" \
 596             "      the values defined by the makefiles. This practice is \n" \
 597             "      not recommemded by the authors of GNU Make, and \n" \
 598             "      will lead to an improper build. \n" \
 599             "      Please fix and restart the build. \n" \
 600             "" >> $(ERROR_FILE) ; \
 601         fi
 602         @#
 603         @# it is unacceptable to havethe -i or --ignore-errors value in MAKEFLAGS
 604         @#
 605         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(i|--ignore-errors)( |$$)'` -ne 0 ]; then \
 606           $(ECHO) "ERROR: Either the build was started with the flag -i or \n" \
 607             "      --ignore-errors, or the MAKEFLAGS environment \n" \
 608             "      variable has this value set. 1111 You will be unable \n" \
 609             "      to determine if the build is broken or not. \n" \
 610             "      Please fix and restart the build. \n" \
 611             "" >> $(ERROR_FILE) ; \
 612         fi
 613         @#
 614         @# it is unacceptable to have the -I or --include-dir value in MAKEFLAGS
 615         @#
 616         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(I|--include-dir)( |$$)'` -ne 0 ]; then \
 617           $(ECHO) "ERROR: Either the build was started with the flag -I or \n" \
 618             "      --include-dir, or the MAKEFLAGS environment \n" \
 619             "      variable has this value set.  This will render your \n" \
 620             "      build questionable as not all the rules and depenencies \n" \
 621             "      are captured by the build. \n" \
 622             "      Please fix and restart the build. \n" \
 623             "" >> $(ERROR_FILE) ; \
 624         fi
 625         @#
 626         @# it is unacceptable to have the -k or --keep-going value in MAKEFLAGS:
 627         @#
 628         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(k|--keep-going)( |$$)'` -ne 0 ]; then \
 629           $(ECHO) "ERROR: Either the build was started with the flag -k or \n" \
 630             "      --keep-going, or the MAKEFLAGS environment \n" \
 631             "      variable has this value set. 222 You will be unable \n" \
 632             "      to determine if the build is broken or not. \n" \
 633             "      Please fix and restart the build.  \n" \
 634             "" >> $(ERROR_FILE) ; \
 635         fi
 636         @#
 637         @# it is unacceptable to have the -o or --assume-old or --old-filevalue in MAKEFLAGS:
 638         @# Note - this rule never gets invoked because it is processed out
 639         @#        in GNU Make startup
 640         @#
 641         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(o|--assume-old|--old-file)( |$$)'` -ne 0 ]; then \
 642           $(ECHO) "ERROR: Either the build was started with the flag -o or \n" \
 643             "      --assume-old or --old-file, or the MAKEFLAGS environment \n" \
 644             "      variable has this value set.  This could prevent the \n" \
 645             "      build from executing rules it should, thus rendering a \n" \
 646             "      questionable result. \n" \
 647             "      Please fix and restart the build. \n" \
 648             "" >> $(ERROR_FILE) ; \
 649         fi
 650         @#
 651         @# it is unacceptable to have the -r or --nobuiltin-rules value in MAKEFLAGS
 652         @#
 653         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(r|--no-builtin-rules)( |$$)'` -ne 0 ]; then \
 654           $(ECHO) "ERROR: Either the build was started with the flag -r or \n" \
 655             "      --no-builtin-rules, or the MAKEFLAGS environment \n" \
 656             "      variable has this value set.  This may break the build \n" \
 657             "      by not allowing builtin rules that may be required. \n" \
 658             "      Please fix and restart the build. \n" \
 659             "" >> $(ERROR_FILE) ; \
 660         fi
 661         @#
 662         @# it is unacceptable to have the -t or --touch value in MAKEFLAGS
 663         @# Note - this rule never gets invoked because it is processed out
 664         @#        in GNU Make startup
 665         @#
 666         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(t|--touch)( |$$)'` -ne 0 ]; then \
 667           $(ECHO) "ERROR: Either the build was started with the flag -t or \n" \
 668             "      --touch, or the MAKEFLAGS environment \n" \
 669             "      variable has this value set.  This will leave the \n" \
 670             "      build in a unclear state and could lead to not executing \n" \
 671             "      rules which should be executed. \n" \
 672             "      Please fix and restart the build. \n" \
 673             "" >> $(ERROR_FILE) ; \
 674         fi
 675         @#
 676         @# show what is in MAKEFLAGS so the user is aware...
 677         @#
 678         @$(ECHO) "WARNING: Your MAKEFLAGS environment variable is set. \n" \
 679            "        You should be very careful about the values set here. \n" \
 680            "\n" \
 681            "        MAKEFLAGS is set to =>$(MAKEFLAGS)<= \n" \
 682            "" >> $(WARNING_FILE)
 683 endif
 684 
 685 ######################################################
 686 # if specified, ALT_OUTPUTDIR must point to non-relative path if set
 687 ######################################################
 688 sane-alt_outputdir:
 689 ifdef ALT_OUTPUTDIR
 690         @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
 691           $(ECHO) "ERROR: ALT_OUTPUTDIR must be an Absolute Path Name, \n" \
 692             "      not a Relative Path Name. \n" \
 693             "" >> $(ERROR_FILE) ; \
 694         fi
 695   ifeq ($(PLATFORM), windows)
 696         @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)'` -ne 1 ]; then \
 697           $(ECHO) "ERROR: On windows, ALT_OUTPUTDIR must contain the drive letter. \n" \
 698             "" >> $(ERROR_FILE) ; \
 699         fi
 700   endif
 701 endif
 702 
 703 ######################################################
 704 # OUTPUTDIR tests
 705 ######################################################
 706 sane-outputdir:
 707         @#
 708         @# OUTPUTDIR must be a directory...
 709         @#
 710         @if [ ! -d "$(OUTPUTDIR)" ]; then \
 711           $(ECHO) "ERROR: OUTPUTDIR must be an existing directory. The current \n" \
 712             "      value of OUTPUTDIR is \n" \
 713             "          $(OUTPUTDIR) \n" \
 714             "      Please check your value of ALT_OUTPUTDIR. \n" \
 715             "" >> $(ERROR_FILE) ; \
 716         fi
 717         @#
 718         @# OUTPUTDIR must be writeable by user...
 719         @#
 720         @if [ ! -w "$(OUTPUTDIR)" ]; then \
 721           $(ECHO) "ERROR: You must have write permissions to OUTPUTDIR. The \n" \
 722             "      current value of OUTPUTDIR is \n" \
 723             "          $(OUTPUTDIR) \n" \
 724             "      Either obtain these permissions or set ALT_OUTPUTDIR. \n" \
 725             "" >> $(ERROR_FILE) ; \
 726         fi
 727         @#
 728         @# OUTPUTDIR must have enough free space...
 729         @#
 730         @if [ $(FREE_SPACE) -lt $(REQUIRED_FREE_SPACE) ]; then \
 731           $(ECHO) "WARNING: You may not have enough free space in your OUTPUTDIR. The \n" \
 732             "        current value of OUTPUTDIR is \n" \
 733             "            $(OUTPUTDIR) \n" \
 734             "        You need "$(REQUIRED_FREE_SPACE)" Kbytes free on this device to build \n" \
 735             "        and it appears that only "$(FREE_SPACE)" Kbytes are free. \n" \
 736             "        Either obtain more space or set ALT_OUTPUTDIR to a larger disk. \n" \
 737             "" >> $(WARNING_FILE) ; \
 738         fi
 739 
 740 ######################################################
 741 # if specified, ALT_BOOTDIR must point to non-relative path if set
 742 ######################################################
 743 sane-alt_bootdir:
 744 ifdef ALT_BOOTDIR
 745         @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
 746           $(ECHO) "ERROR: ALT_BOOTDIR must be an Absolute Path Name, \n" \
 747             "      not a Relative Path Name. \n" \
 748             "      The current value of ALT_BOOTDIR is \n" \
 749             "          $(ALT_BOOTDIR) \n" \
 750             "      Please fix this and continue your build. \n" \
 751             "" >> $(ERROR_FILE) ; \
 752         fi
 753 endif
 754 
 755 ######################################################
 756 # BOOTDIR must point to a valid JDK.
 757 ######################################################
 758 BOOT_CHECK :=$(call CheckVersions,$(BOOT_VER),$(REQUIRED_BOOT_VER))
 759 sane-bootdir:
 760         @if [ "$(BOOT_CHECK)" != "same" -a "$(BOOT_CHECK)" != "newer" ]; then \
 761           $(ECHO) "ERROR: Your BOOTDIR environment variable does not point \n" \
 762             "      to a valid JDK for bootstrapping this build. \n" \
 763             "      A JDK $(JDK_MINOR_VERSION) $(MARKET_NAME) build must be bootstrapped using  \n" \
 764             "      JDK $(PREVIOUS_JDK_VERSION) fcs (or later). \n" \
 765             "      Apparently, your bootstrap JDK is version $(BOOT_VER) \n" \
 766             "      Please update your ALT_BOOTDIR setting and start your build again. \n" \
 767             "" >> $(ERROR_FILE) ; \
 768         fi
 769 
 770 ######################################################
 771 # BOOTDIR is recommended to reside on a local drive
 772 ######################################################
 773 sane-local-bootdir:
 774 ifeq ($(PLATFORM), windows)
 775         @if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -c '^[jJ]:'` -ne 0 ]; then \
 776           $(ECHO) "WARNING: Your BOOTDIR is located on the J: drive. Often the J:\n" \
 777             "        drive is mapped over a network. Using a mapped drive for\n" \
 778             "        the BOOTDIR may significantly slow down the build process.\n" \
 779             "        You may want to consider using the ALT_BOOTDIR variable\n" \
 780             "        to point the build to another location for the BOOTDIR instead. \n" \
 781             "        Your current BOOTDIR is:\n" \
 782             "           $(BOOTDIR) \n" \
 783             "" >> $(WARNING_FILE) ; \
 784         fi
 785 endif
 786 
 787 ######################################################
 788 # CACERTS_FILE must be absoulte path and readable
 789 ######################################################
 790 sane-cacerts:
 791   ifdef ALT_CACERTS_FILE
 792         @if [ `$(ECHO) $(subst \,/,$(ALT_CACERTS_FILE)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
 793           $(ECHO) "ERROR: ALT_CACERTS_FILE must be an Absolute Path Name, \n" \
 794             "      not a Relative Path Name. \n" \
 795             "      The current value of ALT_CACERTS_FILE is \n" \
 796             "          $(ALT_CACERTS_FILE) \n" \
 797             "      Please fix this and continue your build. \n" \
 798             "" >> $(ERROR_FILE) ; \
 799         fi
 800   endif
 801         @#
 802         @# CACERTS_FILE must be readable
 803         @#
 804         @if [ ! -r "$(subst \,/,$(CACERTS_FILE))" ]; then \
 805           $(ECHO) "ERROR: You do not have access to a valid cacerts file. \n" \
 806             "      Please check your access to \n" \
 807             "          $(subst \,/,$(CACERTS_FILE)) \n" \
 808             "      and/or check your value of ALT_CACERTS_FILE. \n" \
 809             "" >> $(ERROR_FILE) ; \
 810         fi
 811         @#
 812         @# CACERTS_FILE must be a file
 813         @#
 814         @if [ -d "$(subst \,/,$(CACERTS_FILE))" ]; then \
 815           $(ECHO) "ERROR: You do not have access to a valid cacerts file.\n" \
 816             "      The value of CACERTS_FILE must point to a normal file.\n" \
 817             "      Please check your access to \n" \
 818             "          $(subst \,/,$(CACERTS_FILE)) \n" \
 819             "      and/or check your value of ALT_CACERTS_FILE. \n" \
 820             "" >> $(ERROR_FILE) ; \
 821         fi
 822 
 823 
 824 ######################################################
 825 # Check for availability of FreeType (OpenJDK specific)
 826 ######################################################
 827 
 828 ifdef OPENJDK
 829 
 830 # The freetypecheck Makefile prints out "Failed" if not good enough
 831 $(TEMPDIR)/freetypeinfo: FRC
 832         @$(prep-target)
 833         @(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
 834             $(ECHO) "Failed to build freetypecheck." ) > $@
 835 
 836 sane-freetype: $(TEMPDIR)/freetypeinfo
 837         @if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
 838           $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
 839                   " or higher is required. \n" \
 840                   "`$(CAT) $<`  \n" >> $(ERROR_FILE) ; \
 841         fi
 842 
 843 else
 844 #do nothing  (not OpenJDK)
 845 sane-freetype: 
 846 endif
 847 
 848 ######################################################
 849 # if specified, BUILD_MODULES must contain valid values.
 850 ######################################################
 851 MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
 852 sane-build_modules:
 853 ifdef BUILD_MODULES
 854         @for m in $(BUILD_MODULES) ; do \
 855             valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
 856             if [ "x$$valid" = "x" ] ; then \
 857                 $(ECHO) "ERROR: $$m set in the BUILD_MODULES variable is invalid.\n" \
 858                 "" >> $(ERROR_FILE); \
 859             fi \
 860         done
 861 endif
 862 
 863 ######################################################
 864 # CUPS_HEADERS_PATH must be valid
 865 ######################################################
 866 sane-cups:
 867 ifneq ($(PLATFORM), windows)
 868         @if [ ! -r $(CUPS_HEADERS_PATH)/cups/cups.h ]; then \
 869           $(ECHO) "ERROR: You do not have access to valid Cups header files. \n" \
 870             "      Please check your access to \n" \
 871             "          $(CUPS_HEADERS_PATH)/cups/cups.h \n" \
 872             "      and/or check your value of ALT_CUPS_HEADERS_PATH, \n" \
 873             "      CUPS is frequently pre-installed on many systems, \n" \
 874             "      or may be downloaded from http://www.cups.org \n" \
 875             "" >> $(ERROR_FILE) ; \
 876         fi
 877 endif
 878 
 879 ######################################################
 880 # Check for existence of DEVTOOLS_PATH
 881 ######################################################
 882 sane-devtools_path:
 883         @if [ "$(DEVTOOLS_PATH)" != "" -a ! -r "$(DEVTOOLS_PATH)" ]; then \
 884           $(ECHO) "ERROR: You do not have a valid DEVTOOLS_PATH setting. \n" \
 885             "      Please check your access to \n" \
 886             "          $(DEVTOOLS_PATH) \n" \
 887             "      and/or check your value of ALT_DEVTOOLS_PATH. \n" \
 888             "" >> $(ERROR_FILE) ; \
 889         fi
 890 
 891 ######################################################
 892 # Check for existence of MS_RUNTIME_LIBRARIES
 893 ######################################################
 894 sane-msvcrt_path:
 895 ifeq ($(PLATFORM), windows)
 896         @if [ ! -r "$(MSVCRT_DLL_PATH)/msvcrt.dll" ]; then \
 897           $(ECHO) "ERROR: You do not have access to msvcrt.dll. \n" \
 898             "      Please check your access to \n" \
 899             "          $(MSVCRT_DLL_PATH) \n" \
 900             "      and/or check your value of ALT_MSVCRT_DLL_PATH. \n" \
 901             "" >> $(ERROR_FILE) ; \
 902         fi
 903   ifneq ($(MSVCRNN_DLL),)
 904         @if [ ! -r "$(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)" ]; then \
 905           $(ECHO) "ERROR: You do not have access to $(MSVCRNN_DLL). \n" \
 906             "      Please check your access to \n" \
 907             "          $(MSVCRNN_DLL_PATH) \n" \
 908             "      and/or check your value of ALT_MSVCRNN_DLL_PATH. \n" \
 909             "" >> $(ERROR_FILE) ; \
 910         fi
 911   endif
 912 endif
 913 
 914 ######################################################
 915 # Check for existence of COMPILER_PATH
 916 ######################################################
 917 sane-compiler_path:
 918         @if [ "$(COMPILER_PATH)" != "" -a ! -r "$(COMPILER_PATH)" ]; then \
 919           $(ECHO) "ERROR: You do not have a valid COMPILER_PATH setting. \n" \
 920             "      Please check your access to \n" \
 921             "          $(COMPILER_PATH) \n" \
 922             "      and/or check your value of ALT_COMPILER_PATH. \n" \
 923             "" >> $(ERROR_FILE) ; \
 924         fi
 925 
 926 ######################################################
 927 # Check for existence of UNIXCOMMAND_PATH
 928 ######################################################
 929 sane-unixcommand_path:
 930         @if [ "$(UNIXCOMMAND_PATH)" != "" -a ! -r "$(UNIXCOMMAND_PATH)" ]; then \
 931           $(ECHO) "ERROR: You do not have a valid UNIXCOMMAND_PATH setting. \n" \
 932             "      Please check your access to \n" \
 933             "          $(UNIXCOMMAND_PATH) \n" \
 934             "      and/or check your value of ALT_UNIXCOMMAND_PATH. \n" \
 935             "" >> $(ERROR_FILE) ; \
 936         fi
 937 ifeq ($(PLATFORM), windows)
 938         @for utility in cpio ar file m4 ; do \
 939           if [ ! -r "`$(WHICH) $${utility}`" ]; then \
 940             $(ECHO) "WARNING: You do not have the utility $${utility} in the \n" \
 941               "      directory $(UNIXCOMMAND_PATH). \n" \
 942               "      The utilities cpio, ar, file, and m4 are required. \n" \
 943               "" >> $(WARNING_FILE) ; \
 944           fi; \
 945         done
 946 endif
 947 
 948 ######################################################
 949 # Check for existence of USRBIN_PATH on linux
 950 ######################################################
 951 sane-usrbin_path:
 952 ifeq ($(PLATFORM), linux)
 953         @if [ "$(USRBIN_PATH)" != "" -a ! -r "$(USRBIN_PATH)" ]; then \
 954             $(ECHO) "ERROR: You do not have a valid USRBIN_PATH setting. \n" \
 955               "      Please check your access to \n" \
 956               "          $(USRBIN_PATH)  \n" \
 957               "      and/or check your value of ALT_USRBIN_PATH. \n" \
 958               "" >> $(ERROR_FILE) ; \
 959           fi
 960 endif
 961 
 962 ######################################################
 963 # Check for existence of UNIXCCS_PATH on solaris
 964 ######################################################
 965 sane-unixccs_path:
 966 ifeq ($(PLATFORM), solaris)
 967         @if [ "$(UNIXCCS_PATH)" != "" -a ! -r "$(UNIXCCS_PATH)" ]; then \
 968           $(ECHO) "ERROR: You do not have a valid UNIXCCS_PATH setting. \n" \
 969             "      Please check your access to \n" \
 970             "          $(UNIXCCS_PATH) \n" \
 971             "      and/or check your value of ALT_UNIXCCS_PATH. \n" \
 972             "" >> $(ERROR_FILE) ; \
 973           fi
 974 endif
 975 
 976 ######################################################
 977 # Verify the docs directory exists
 978 ######################################################
 979 sane-docs_import:
 980         @if [ ! -d "$(HOTSPOT_DOCS_IMPORT_PATH)" ]; then \
 981             $(ECHO) "WARNING: The directory HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_DOCS_IMPORT_PATH) \n" \
 982               "      does not exist, check your value of ALT_HOTSPOT_DOCS_IMPORT_PATH. \n" \
 983               "" >> $(WARNING_FILE) ; \
 984         fi
 985 
 986 ######################################################
 987 # Check for possible problem regarding __fabsf,  math_iso.h and the libm patch.
 988 #    Hotspot should have been changed in Mustang 6.0 Build 47 to not depend
 989 #    on __fabsf, this is just checking that fact now.
 990 ######################################################
 991 sane-math_iso:
 992 ifeq ($(PLATFORM), solaris)
 993         @if [ -f $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
 994           if [ "`$(NM) $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) | $(GREP) __fabsf`" != "" ]; then \
 995             $(ECHO) "WARNING: This version of hotspot relies on __fabsf \n" \
 996               "        which is not always available on Solaris 8 and 9 machines \n" \
 997               "        unless they have the latest libm patch and the file \n" \
 998               "        /usr/include/iso/math_iso.h which can trigger this dependency.\n" \
 999               "        Hotspot should NOT be dependent on this extern, check the \n" \
1000               "        version of the hotspot library you are using. \n" \
1001               "" >> $(WARNING_FILE) ; \
1002             fi; \
1003         fi
1004 endif
1005 
1006 ######################################################
1007 # Check for possible patch problem regarding /usr/lib/libCrun.so
1008 ######################################################
1009 sane-libCrun:
1010 ifeq ($(PLATFORM), solaris)
1011         @if [ "`$(NM) /usr/lib/libCrun.so.1 | $(GREP) __1c2n6FIpv_0_`" = "" ]; then \
1012           $(ECHO) "WARNING: The file /usr/lib/libCrun.so.1 is missing the extern \n" \
1013             "        __1c2n6FIpv_0_ which indicates that the system is missing \n" \
1014             "        a required Solaris patch, or you are using a pre-FCS release \n" \
1015             "        of Solaris 10. You need the latest /usr/lib/libCrun.so.1 \n" \
1016             "        which comes with the FCS release of Solaris 10 and available \n" \
1017             "        through the latest Solaris 8 or 9 C++ runtime patches. \n" \
1018             "" >> $(WARNING_FILE) ; \
1019         fi
1020 endif
1021 
1022 ######################################################
1023 # Check for existence of MSDEVTOOLS_PATH on windows
1024 ######################################################
1025 sane-msdevtools_path:
1026 ifeq ($(PLATFORM), windows)
1027         @if [ "$(MSDEVTOOLS_PATH)" != "" -a ! -r "$(MSDEVTOOLS_PATH)" ]; then \
1028           $(ECHO) "ERROR: You do not have a valid MSDEVTOOLS_PATH setting. \n" \
1029             "      Please check your access to \n" \
1030             "          $(MSDEVTOOLS_PATH) \n" \
1031             "      and/or check your value of ALT_MSDEVTOOLS_PATH. \n" \
1032             "" >> $(ERROR_FILE) ; \
1033         fi
1034 endif
1035 
1036 ######################################################
1037 # Check for existence of Hotspot binaries
1038 ######################################################
1039 sane-hotspot_binaries:
1040 ifeq ($(ARCH_DATA_MODEL), 32)
1041         @if [ ! -r $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
1042           $(ECHO) "ERROR: HOTSPOT_CLIENT_PATH does not point to a valid HotSpot VM. \n" \
1043             "      Please check your access to \n" \
1044             "          $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) \n" \
1045             "      and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \
1046             "" >> $(ERROR_FILE) ; \
1047         fi
1048 endif
1049         @if [ ! -r $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
1050           $(ECHO) "ERROR: HOTSPOT_SERVER_PATH does not point to a valid HotSpot VM. \n" \
1051             "      Please check your access to \n" \
1052             "          $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) \n" \
1053             "      and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \
1054             "" >> $(ERROR_FILE) ; \
1055         fi
1056         @#
1057         @# Check value of HOTSPOT_LIB_PATH
1058         @#
1059 ifeq ($(PLATFORM), windows)
1060         @if [ ! -r $(HOTSPOT_LIB_PATH)/jvm.lib ]; then \
1061           $(ECHO) "ERROR: HOTSPOT_LIB_PATH does not point to a valid HotSpot library. \n" \
1062             "      Please check your access to \n" \
1063             "          $(HOTSPOT_LIB_PATH)/jvm.lib \n" \
1064             "      and/or check your value of ALT_HOTSPOT_LIB_PATH. \n" \
1065             "" >> $(ERROR_FILE) ; \
1066         fi
1067         @#
1068         @# Check for the .map files - its OK if they are not there..
1069         @#
1070   ifeq ($(ARCH_DATA_MODEL), 32)
1071         @# There is no 64-bit HotSpot client VM
1072         @if [ ! -r $(HOTSPOT_CLIENT_PATH)/jvm.map ]; then \
1073           $(ECHO) "WARNING: HOTSPOT_CLIENT_PATH does not point to valid HotSpot .map files. \n" \
1074             "        These files are optional and aid in the debugging of the JVM. \n" \
1075             "        Please check your access to \n" \
1076             "          $(HOTSPOT_CLIENT_PATH)/jvm.map \n" \
1077             "        and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \
1078             "" >> $(WARNING_FILE) ; \
1079         fi
1080         @if [ ! -r $(HOTSPOT_CLIENT_PATH)/jvm.pdb ]; then \
1081           $(ECHO) "WARNING: HOTSPOT_CLIENT_PATH does not point to valid HotSpot .pdb files. \n" \
1082             "        These files are optional and aid in the debugging of the JVM. \n" \
1083             "        Please check your access to \n" \
1084             "          $(HOTSPOT_CLIENT_PATH)/jvm.pdb \n" \
1085             "        and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \
1086             "" >> $(WARNING_FILE) ; \
1087         fi
1088   endif
1089         @if [ ! -r $(HOTSPOT_SERVER_PATH)/jvm.map ]; then \
1090           $(ECHO) "WARNING: HOTSPOT_SERVER_PATH does not point to valid HotSpot .map files. \n" \
1091             "        These files are optional and aid in the debugging of the JVM. \n" \
1092             "        Please check your access to \n" \
1093             "          $(HOTSPOT_SERVER_PATH)/jvm.map \n" \
1094             "        and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \
1095             "" >> $(WARNING_FILE) ; \
1096         fi
1097         @if [ ! -r $(HOTSPOT_SERVER_PATH)/jvm.pdb ]; then \
1098           $(ECHO) "WARNING: HOTSPOT_SERVER_PATH does not point to valid HotSpot .pdb files. \n" \
1099             "        These files are optional and aid in the debugging of the JVM. \n" \
1100             "        Please check your access to \n" \
1101             "          $(HOTSPOT_SERVER_PATH)/jvm.pdb \n" \
1102             "        and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \
1103             "" >> $(WARNING_FILE) ; \
1104         fi
1105 endif   
1106 
1107 
1108 ######################################################
1109 # Check for existence of misc Hotspot imported files
1110 ######################################################
1111 HOTSPOT_INCLUDE_FILE_LIST  = jvmti.h
1112 HOTSPOT_INCLUDE_FILE_LIST  += jvmticmlr.h
1113 #HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h
1114 #HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h
1115 #HOTSPOT_INCLUDE_FILE_LIST += jmm.h
1116 TMP_SDK_INCLUDE_FILE_LIST=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.h)
1117 TMP_SDK_INCLUDE_FILE_DIFFS=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.hdiffs)
1118 
1119 # These include files must have a pattern: 'version: MAJOR.MINOR.MICRO'
1120 #    where MACRO, MINOR, and MICRO are numbers, e.g. 1.0.1, 0.2.90, etc.
1121 #    The critical version we are checking is MAJOR.MINOR, we print all three
1122 #    when we detect an error.
1123 
1124 TMP_SDK_INCLUDE_FIND_VERSION= $(EGREP) 'version:'
1125 TMP_SDK_INCLUDE_GET_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
1126                 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\)\.[0-9].*@\1@'
1127 TMP_SDK_INCLUDE_GET_FULL_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
1128                 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*@\1@'
1129 
1130 # Compare an interface file (Rule creates 2 temp files: %.h and %.h.IMPORT)
1131 #    Files jvm.h, jvm_md.h and jmm.h are special in that they are not publicly 
1132 #    exported but do represent VM interfaces used by the rest of the jdk.
1133 #    So these 3 will not be found in a promoted build and can only
1134 #    be checked when this represents a full control build (i.e. the
1135 #    HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory).
1136 $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
1137         @$(install-non-module-file)
1138         @$(RM) $@.IMPORT
1139         @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \
1140           $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \
1141         elif [ "$(@F)" != "jvm.h" -a "$(@F)" != "jmm.h" ] ; then \
1142           $(ECHO) "WARNING: HOTSPOT_IMPORT_PATH does not contain the interface file $(@F). \n" \
1143             "        Check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1144             "" >> $(WARNING_FILE) ; \
1145           $(CP) $< $@.IMPORT; \
1146         else \
1147           $(CP) $< $@.IMPORT; \
1148         fi
1149 
1150 $(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
1151         @$(install-non-module-file)
1152         @$(RM) $@.IMPORT
1153         @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \
1154           $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \
1155         elif [ "$(@F)" != "jvm_md.h" ] ; then \
1156           $(ECHO) "WARNING: HOTSPOT_IMPORT_PATH does not contain the interface file $(@F). \n" \
1157             "        Check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1158             "" >> $(WARNING_FILE) ; \
1159           $(CP) $< $@.IMPORT; \
1160         else \
1161           $(CP) $< $@.IMPORT; \
1162         fi
1163 
1164 # Compares the two tempfiles: %.h and %.h.IMPORT, answer in %.hdiffs
1165 #   Note: Putting anything into the hdiffs file will trigger generic IMPORT
1166 #         warning message in hotspot_import_include.
1167 #   First checks the major.minor versions, the micro number can differ.
1168 #   Second checks the full version.
1169 #   Lastly does a full diff if the full version differs or it has no version
1170 $(TEMPDIR)/%.hdiffs: $(TEMPDIR)/%.h
1171         @$(prep-target)
1172         @$(TOUCH) $@
1173         @if [ "`$(CAT) $<        | $(TMP_SDK_INCLUDE_GET_VERSION)`" != \
1174               "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_VERSION)`" ] ; then \
1175             $(ECHO) "WARNING: The file $(<F) is not the same interface as the VM version.\n " \
1176               "        this workspace has $(<F) `$(CAT) $< | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` and \n " \
1177               "        HOTSPOT_IMPORT_PATH contains $(<F) `$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` \n" \
1178             "" >> $(WARNING_FILE) ; \
1179              $(ECHO) "Version mis-match" > $@ ; \
1180         fi
1181         @if [ "`$(CAT) $<        | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" != \
1182                "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" ] ; then \
1183           $(RM) $<.filtered  $<.IMPORT.filtered; \
1184           $(EGREP) -v 'VERSION' $< > $<.filtered; \
1185           $(EGREP) -v 'VERSION' $<.IMPORT > $<.IMPORT.filtered; \
1186           ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \
1187         elif [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_FIND_VERSION)`" = "" ] ; then \
1188           $(RM) $<.filtered  $<.IMPORT.filtered; \
1189           $(EGREP) -v '@\(#\)' $< > $<.filtered; \
1190           $(EGREP) -v '@\(#\)' $<.IMPORT > $<.IMPORT.filtered; \
1191           ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \
1192         fi
1193 
1194 # Verify all imported hotspot files
1195 sane-hotspot_import:: sane-hotspot_import_dir sane-hotspot_import_include
1196 
1197 # Verify the base directory exists
1198 sane-hotspot_import_dir:
1199         @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1200         @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST)
1201         @if [ ! -d "$(HOTSPOT_IMPORT_PATH)" ]; then \
1202             $(ECHO) "WARNING: The directory HOTSPOT_IMPORT_PATH=$(HOTSPOT_IMPORT_PATH) \n" \
1203               "      does not exist, check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1204               "" >> $(WARNING_FILE) ; \
1205         fi
1206 
1207 # Verify hotspot include files
1208 sane-hotspot_import_include: $(TMP_SDK_INCLUDE_FILE_LIST) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1209         @if [ "`$(CAT) $(TMP_SDK_INCLUDE_FILE_DIFFS)`" != "" ] ; then \
1210           $(ECHO) "WARNING: Possible HotSpot VM interface conflict. \n" \
1211             "        HOTSPOT_IMPORT_PATH is used to import files from the VM build. \n" \
1212             "        It is also used to verify that any copied files are consistent between \n" \
1213             "        these two components. It has been detected that one or more of the \n" \
1214             "        VM interface files inside this workspace may not match the interfaces \n" \
1215             "        exported by the VM, or the VM versions could not be found. \n" \
1216             "        The list of VM interface files is: \n" \
1217             "            $(HOTSPOT_INCLUDE_FILE_LIST). \n" \
1218             "        This workspace has copies of these files at: \n" \
1219             "          $(SHARE_SRC)/javavm/export and $(PLATFORM_SRC)/javavm/export \n" \
1220             "        for build purposes, and they should contain the same interfaces \n" \
1221             "        as the VM versions imported from: \n" \
1222             "          \$$(HOTSPOT_IMPORT_PATH)/include \n" \
1223             "               (i.e. $(HOTSPOT_IMPORT_PATH)/include) \n" \
1224             "        If an interface indeed doesn't match, then the use of this interface \n" \
1225             "        at JDK runtime could cause serious errors. \n" \
1226             "" >> $(WARNING_FILE) ; \

1227             for i in $(TMP_SDK_INCLUDE_FILE_DIFFS); do \
1228                 if [ -s $$i ] ; then \
1229                   $(ECHO) " " >> $(WARNING_FILE); \
1230                   $(ECHO) "VM Interface Differences: $$i" >> $(WARNING_FILE); \
1231                   $(CAT) $$i >> $(WARNING_FILE); \
1232                   $(ECHO) " " >> $(WARNING_FILE); \
1233                 fi; \
1234             done; \
1235         fi
1236         @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1237         @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST)
1238 
1239 # The JDI-SA feature is not currently released on some platforms.
1240 # See the Defs-<arch>.gmk files.
1241 
1242 ifeq ($(INCLUDE_SA), true)
1243 # Verify that hotspot Serviceability Agent files are present.  To keep 
1244 # it simple, we will just check for one of them.  The others have arch 
1245 # dependent paths.
1246 
1247 sane-hotspot_import::
1248         @if [ ! -r  $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
1249           $(ECHO) "WARNING: File $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar does not exist.\n" \
1250             "        The JDI binding for the Serviceability Agent will not be included in the build.\n" \
1251             "        Please check your access to\n" \
1252             "          $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar\n" \
1253             "        and/or check your value of ALT_HOTSPOT_IMPORT_PATH.\n" \
1254             "" >> $(WARNING_FILE) ; \
1255          fi
1256 endif
1257 
1258 ######################################################
1259 # Check the ant version
1260 ######################################################
1261 ANT_CHECK :=$(call CheckVersions,$(ANT_VER),$(REQUIRED_ANT_VER))
1262 sane-ant_version:
1263         @if [ "$(ANT_CHECK)" != "same" \
1264               -a "$(ANT_CHECK)" != "newer" ]; then \
1265           $(ECHO) "WARNING: The version of ant being used is older than \n" \
1266             "      the required version of '$(REQUIRED_ANT_VER)'. \n" \
1267             "      The version of ant found was '$(ANT_VER)'. \n" \
1268             "" >> $(WARNING_FILE) ; \
1269         fi
1270 
1271 ######################################################
1272 # Check the zip file version
1273 ######################################################
1274 ZIP_CHECK :=$(call CheckVersions,$(ZIP_VER),$(REQUIRED_ZIP_VER))
1275 sane-zip_version: sane-unzip_version
1276         @if [ "$(ZIP_CHECK)" != "same" -a "$(ZIP_CHECK)" != "newer" ]; then \
1277           $(ECHO) "WARNING: The version of zip being used is older than \n" \
1278             "      the required version of '$(REQUIRED_ZIP_VER)'. \n" \
1279             "      The version of zip found was '$(ZIP_VER)'. \n" \
1280             "" >> $(WARNING_FILE) ; \
1281         fi
1282 
1283 ######################################################
1284 # Check the unzip file version
1285 ######################################################
1286 UNZIP_CHECK :=$(call CheckVersions,$(UNZIP_VER),$(REQUIRED_UNZIP_VER))
1287 sane-unzip_version:
1288         @if [ "$(UNZIP_CHECK)" != "same" -a "$(UNZIP_CHECK)" != "newer" ]; then \
1289           $(ECHO) "WARNING: The version of unzip being used is older than \n" \
1290             "      the required version of '$(REQUIRED_UNZIP_VER)'. \n" \
1291             "      The version of unzip found was '$(UNZIP_VER)'. \n" \
1292             "" >> $(WARNING_FILE) ; \
1293         fi
1294 
1295 ######################################################
1296 # Check for windows DirectX sdk directory
1297 ######################################################
1298 sane-dxsdk:
1299 ifeq ($(PLATFORM), windows)
1300         @if [ ! -r $(DXSDK_INCLUDE_PATH)/d3d9.h  ]; then \
1301         $(ECHO) "ERROR: You do not have access to a valid DirectX SDK Include dir.\n" \
1302           "      The value of DXSDK_INCLUDE_PATH must point a valid DX SDK dir.\n" \
1303           "      Please check your access to \n" \
1304           "          $(DXSDK_INCLUDE_PATH) \n" \
1305           "      and/or check your value of ALT_DXSDK_PATH or ALT_DXSDK_INCLUDE_PATH.\n" \
1306           "      Microsoft DirectX 9 SDK (Summer 2004 Update or newer) 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           "" >> $(ERROR_FILE) ; \
1310         else \
1311           if [ ! "$(DXSDK_VER)" = "$(REQUIRED_DXSDK_VER)" ]; then \
1312           $(ECHO) "ERROR: The DirectX SDK must be version $(REQUIRED_DXSDK_VER).\n" \
1313             "      $(YOU_ARE_USING) DirectX SDK version: $(DXSDK_VER)\n" \
1314             "      The DirectX SDK was obtained from the following location: \n" \
1315             "          $(DXSDK_PATH) \n" \
1316             "      Please change your DirectX SDK. \n" \
1317             "      Microsoft DirectX 9 SDK (Summer 2004 Update or newer) can be downloaded from the following location:\n" \
1318             "          http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
1319             "      Or  http://www.microsoft.com/directx\n" \
1320             "" >> $(ERROR_FILE) ; \
1321           else \
1322             if [ -r $(DXSDK_INCLUDE_PATH)/basetsd.h ]; then \
1323               if [ `$(EGREP) -c __int3264 $(DXSDK_INCLUDE_PATH)/basetsd.h` -ne 0 ]; then \
1324               $(ECHO) "WARNING: The DirectX SDK Include directory contains a newer basetsd.h,\n" \
1325                 "      which may indicate that you're using an incorrect version of DirectX SDK.\n" \
1326                 "      This may result in a build failure.\n" \
1327                 "      The DirectX SDK Include dir was obtained from the following location:\n" \
1328                 "         $(DXSDK_INCLUDE_PATH) \n" \
1329                 "      Please change your DirectX SDK to version 9 (Summer 2004 Update or newer).\n" \
1330                 "      Microsoft DirectX 9 SDK can be downloaded from the following location:\n" \
1331                 "          http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
1332                 "      Or  http://www.microsoft.com/directx\n" \
1333                 "" >> $(WARNING_FILE) ; \
1334               fi \
1335             fi \
1336           fi \
1337         fi
1338 endif
1339 
1340 ######################################################
1341 # Check the linker version(s)
1342 ######################################################

1343 ifeq ($(PLATFORM), windows)
1344   LINK_CHECK  :=$(call CheckVersions,$(LINK_VER),$(REQUIRED_LINK_VER))






1345 endif
1346 sane-link:
1347 ifdef LINK_VER
1348         @if [ "$(LINK_CHECK)" = "missing" ]; then \
1349           $(ECHO) "ERROR: The Linker version is undefined. \n" \
1350             "" >> $(ERROR_FILE) ; \
1351         fi
1352         @if [ "$(LINK_CHECK)" != "same" ]; then \
1353           $(ECHO) "WARNING: To build Java 2 SDK $(JDK_VERSION) you need : \n" \
1354             "      $(REQUIRED_COMPILER_VERSION) - link.exe version \"$(REQUIRED_LINK_VER)\" \n" \
1355               "      Specifically the $(REQUIRED_COMPILER_NAME) link.exe. \n " \
1356             "      $(YOU_ARE_USING) Linker version \"$(LINK_VER)\" \n" \
1357             "" >> $(WARNING_FILE) ; \
1358         fi
1359 endif
1360 
1361 ######################################################
1362 # Check the compiler version(s)
1363 ######################################################
1364 CC_CHECK  :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
1365 sane-compiler: sane-link
1366         @if [ "$(CC_CHECK)" = "missing" ]; then \
1367           $(ECHO) "ERROR: The Compiler version is undefined. \n" \
1368             "" >> $(ERROR_FILE) ; \
1369         fi
1370 ifndef OPENJDK
1371         @if [ "$(CC_CHECK)" != "same" ]; then \
1372               $(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(REQUIRED_COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \
1373               "      Specifically the $(REQUIRED_COMPILER_NAME) compiler. \n " \
1374               "      $(YOU_ARE_USING) $(COMPILER_VERSION): $(CC_VER) \n" \
1375               "      The compiler was obtained from the following location: \n" \
1376               "          $(COMPILER_PATH) \n" \
1377               "" >> $(WARNING_FILE) ; \
1378          fi

1379 endif
1380 
1381 ######################################################
1382 # Check that ALSA headers and libs are installed and 
1383 # that the header has the right version. We only
1384 # need /usr/include/alsa/version.h and /usr/lib/libasound.so
1385 ######################################################
1386 
1387 ifdef REQUIRED_ALSA_VERSION
1388   ALSA_CHECK := $(call CheckVersions,$(ALSA_VERSION),$(REQUIRED_ALSA_VERSION))
1389 endif
1390 sane-alsa-headers:
1391 ifdef REQUIRED_ALSA_VERSION
1392         if [ "$(ALSA_CHECK)" != "same" -a "$(ALSA_CHECK)" != "newer"  ] ; then \
1393             $(ECHO) "ERROR: The ALSA version must be $(REQUIRED_ALSA_VERSION) or higher. \n" \
1394               "      You have the following ALSA version installed: $${alsa_version) \n" \
1395               "      Please reinstall ALSA (drivers and lib). You can download \n" \
1396               "      the source distribution from http://www.alsa-project.org \n" \
1397               "      or go to http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \
1398               "" >> $(ERROR_FILE) ; \
1399           fi \
1400         else \
1401           $(ECHO) "ERROR: You seem to not have installed ALSA $(REQUIRED_ALSA_VERSION) or higher. \n" \
1402           "      Please install ALSA (drivers and lib). You can download the \n" \
1403           "      source distribution from http://www.alsa-project.org or go to \n" \
1404           "      http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \
1405           "" >> $(ERROR_FILE) ; \
1406         fi
1407 endif
1408 

1409 # If a sanity file doesn't exist, just make sure it's dir exists
1410 $(SANITY_FILES):
1411         -@$(prep-target)
1412 
1413 ######################################################
1414 # dump out the variable settings...
1415 ######################################################
1416 sane-settings::
1417         @$(ECHO)  >> $(MESSAGE_FILE)
1418         @$(ECHO) $(ALL_SETTINGS)  >> $(MESSAGE_FILE)
1419         @$(ECHO)  >> $(MESSAGE_FILE)
1420 
1421 ######################################################
1422 # Check for existence of DEPLOY_MSSDK on windows
1423 ######################################################
1424 sane-mssdk_path:
1425 ifeq ($(PLATFORM), windows)
1426         @if [ -z "$(DEPLOY_MSSDK)" ]; then \
1427           $(ECHO) "WARNING: Your DEPLOY_MSSDK setting is empty.\n" \
1428             "        It is recommended to set ALT_DEPLOY_MSSDK.\n" \
1429             "" >> $(WARNING_FILE) ; \
1430         fi
1431         @if [ ! -r "$(DEPLOY_MSSDK)" ]; then \
1432           $(ECHO) "ERROR: You do not have a valid DEPLOY_MSSDK setting. \n" \
1433             "      Please check your access to \n" \
1434             "          $(DEPLOY_MSSDK) \n" \
1435             "      and/or check your value of ALT_DEPLOY_MSSDK. \n" \
1436             "" >> $(ERROR_FILE) ; \
1437         fi
1438 endif
1439 
1440 ######################################################
1441 # Check for existence of INSTALL_MSSDK on windows
1442 ######################################################
1443 sane-install-mssdk_path:
1444 ifeq ($(PLATFORM), windows)
1445         @if [ -z "$(INSTALL_MSSDK)" ]; then \
1446           $(ECHO) "WARNING: Your INSTALL_MSSDK setting is empty.\n" \
1447             "        It is recommended to set ALT_INSTALL_MSSDK.\n" \
1448             "" >> $(WARNING_FILE) ; \
1449         fi
1450         @if [ ! -r "$(INSTALL_MSSDK)" ]; then \
1451           $(ECHO) "ERROR: You do not have a valid INSTALL_MSSDK setting. \n" \
1452             "      Please check your access to \n" \
1453             "          $(INSTALL_MSSDK) \n" \
1454             "      and/or check your value of ALT_INSTALL_MSSDK. \n" \
1455             "" >> $(ERROR_FILE) ; \
1456         fi
1457 endif
1458 
1459 ######################################################
1460 # Check for existence of INSTALL_MSIVAL2 on windows
1461 ######################################################
1462 sane-install-msival2_path:
1463 ifeq ($(PLATFORM), windows)
1464         @if [ -z "$(INSTALL_MSIVAL2)" ]; then \
1465           $(ECHO) "WARNING: Your INSTALL_MSIVAL2 setting is empty.\n" \
1466             "        It is recommended to set ALT_INSTALL_MSIVAL2.\n" \
1467             "" >> $(WARNING_FILE) ; \
1468         fi
1469         @if [ ! -r "$(INSTALL_MSIVAL2)" ]; then \
1470           $(ECHO) "ERROR: You do not have a valid INSTALL_MSIVAL2 setting. \n" \
1471             "      Please check your access to \n" \
1472             "          $(INSTALL_MSIVAL2) \n" \
1473             "      and/or check your value of ALT_INSTALL_MSIVAL2. \n" \
1474             "" >> $(ERROR_FILE) ; \
1475         fi
1476 endif
1477 
1478 ######################################################
1479 # Check the Solaris GNU c++ compiler for solaris plugin
1480 ######################################################
1481 sane-gcc-compiler:
1482 ifeq ($(PLATFORM), solaris)
1483   ifndef OPENJDK
1484     @if [ -r $(GCC_COMPILER_PATH) ]; then \
1485           if [ ! "$(GCC_VER)" = $(REQUIRED_GCC_VERSION) ]; then \
1486             $(ECHO) "ERROR: The Solaris GCC compiler version must be $(REQUIRED_GCC_VERSION). \n" \
1487               "      You are using the following compiler version: $(GCC_VER) \n" \
1488               "      The compiler was obtained from the following location: \n" \
1489               "          $(GCC_COMPILER_PATH) \n" \
1490               "      Please change your compiler. \n" \
1491               "" >> $(ERROR_FILE) ; \
1492     fi \
1493         else \
1494           $(ECHO) "ERROR: You do not have a valid GCC_COMPILER_PATH setting. \n" \
1495             "      Please check your access to \n" \
1496             "          $(GCC_COMPILER_PATH) \n" \
1497             "      and/or check your value of ALT_GCC_COMPILER_PATH. \n" \
1498             "      This will affect you if you build the plugin target. \n" \
1499             "" >> $(ERROR_FILE) ; \
1500         fi
1501   endif
1502 
1503   ifeq ($(PLATFORM), linux)
1504     ifdef ALT_GCC29_COMPILER_PATH
1505         @if [ ! -x $(ALT_GCC29_COMPILER_PATH)/bin/gcc ]; then \
1506             $(ECHO) "ERROR: You do not have a valid ALT_GCC29_COMPILER_PATH setting. \n" \
1507                  "      Please check your access to \n" \
1508                  "      $(ALT_GCC29_COMPILER_PATH)/bin/gcc \n" \
1509                  "      This will affect you if you build the plugin target. \n" \
1510                  "" >> $(ERROR_FILE) ; \
1511     fi
1512     endif
1513     ifdef ALT_GCC29_PLUGIN_LIB_PATH
1514         @if [ ! -r $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so ]; then \
1515             $(ECHO) "Error: You do not have a valid ALT_GCC29_PLUGIN_LIB_PATH setting. \n" \
1516                         " Please check your access to \n" \
1517                         " $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so \n" \
1518                         " This will affect you if you build the plugin target, specifically for gcc 2.9 version of OJI plugin library. \n" \
1519                         "" >> $(ERROR_FILE) ; \

1520         fi
1521     else
1522         @if [ ! -r $(GCC29_COMPILER_PATH) ]; then \
1523             $(ECHO) "ERROR: You do not have a valid GCC29_COMPILER_PATH setting. \n" \
1524                     " Please check your access to \n" \
1525                     " $(GCC29_COMPILER_PATH) \n" \
1526                     " and/or check your value of ALT_GCC29_COMPILER_PATH. \n" \
1527                     " This will affect you if you build the plugin target. \n" \
1528                     "" >> $(ERROR_FILE) ; \
1529         fi
1530     endif
1531   endif
1532 endif
1533 
1534 
1535 ######################################################
1536 # MOZILLA_HEADERS_PATH must be valid
1537 ######################################################
1538 sane-mozilla:
1539 ifeq ($(ARCH_DATA_MODEL), 32)
1540   ifdef ALT_MOZILLA_HEADERS_PATH
1541         @if [ `$(ECHO) $(subst \,/,$(ALT_MOZILLA_HEADERS_PATH)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
1542           $(ECHO) "ERROR: ALT_MOZILLA_HEADERS_PATH must be an Absolute Path Name, \n" \
1543             "      not a Relative Path Name. \n" \
1544             "      The current value of ALT_MOZILLA_HEADERS_PATH is \n" \
1545             "          $(ALT_MOZILLA_HEADERS_PATH) \n" \
1546             "      Please fix this and continue your build. \n" \
1547             "" >> $(ERROR_FILE) ; \
1548         fi
1549   endif
1550         @#
1551         @# MOZILLA_HEADERS_PATH must be valid....
1552         @#
1553   ifeq ($(PLATFORM), windows)
1554         @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18.win32/java/bool.h ]; then \
1555           $(ECHO) "ERROR: You do not have access to valid Mozilla header files. \n" \
1556             "      Please check your access to \n" \
1557             "          $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18.win32/java/bool.h \n" \
1558             "      and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
1559             "      and on Windows, ALT_JDK_JAVA_DRIVE. \n" \
1560             "" >> $(ERROR_FILE) ; \
1561         fi
1562   else
1563         @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18/java/bool.h ]; then \
1564           $(ECHO) "ERROR: You do not have access to valid Mozilla header files. \n" \
1565             "      Please check your access to \n" \
1566             "          $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18/java/bool.h \n" \
1567             "      and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
1568             "" >> $(ERROR_FILE) ; \
1569         fi
1570   endif
1571         @#
1572         @# Check for presence of headers required for new Java Plug-In ("plugin2")
1573         @#
1574         @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/plugin2_mozilla_headers/npapi.h ]; then \
1575           $(ECHO) "ERROR: You do not have access to valid Mozilla header files for the new Java Plug-In. \n" \
1576             "      Please check your access to \n" \
1577             "          $(subst \,/,$(MOZILLA_HEADERS_PATH))/plugin2_mozilla_headers/npapi.h \n" \
1578             "      and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
1579             "" >> $(ERROR_FILE) ; \
1580         fi
1581 endif
1582 
1583 
1584 ######################################################
1585 # Make sure Java Kernel VM is accessible
1586 ######################################################
1587 sane-kernel-vm:
1588 ifeq ($(PLATFORM), windows)
1589   ifeq ($(ARCH_DATA_MODEL), 32)
1590         @if [ ! -r $(HOTSPOT_KERNEL_PATH)/jvm.dll ]; then \
1591             $(ECHO) "WARNING: Your HOTSPOT_IMPORT_PATH does not include a Kernel VM... \n" \
1592                     "     The kernel installer may not be built (unless hotspot is also). \n" \
1593                     "     $(HOTSPOT_KERNEL_PATH)/jvm.dll \n" \
1594                     "     Please check the value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1595                     >> $(WARNING_FILE) ; \
1596         fi
1597   endif
1598 endif
1599 
1600 
1601 ######################################################
1602 # SECURITY_BASELINE_131 test
1603 ######################################################
1604 security_baseline_131:
1605 ifeq ($(PLATFORM), windows)
1606         @if [ -z "$(SECURITY_BASELINE_131)" ]; then \
1607             $(ECHO) "WARNING: Your SECURITY_BASELINE_131 setting is empty.\n" \
1608                 "        Setting it to the default value of 1.3.1_20.\n" \
1609                 "        It is recommended to set SECURITY_BASELINE_131.\n" \
1610                 "" >> $(WARNING_FILE) ; \
1611         fi
1612 endif
1613 
1614 ######################################################
1615 # SECURITY_BASELINE_142 test
1616 ######################################################
1617 security_baseline_142:
1618 ifeq ($(PLATFORM), windows)
1619         @if [ -z "$(SECURITY_BASELINE_142)" ]; then \
1620             $(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \
1621                 "        Setting it to the default value of 1.4.2_10.\n" \
1622                 "        It is recommended to set SECURITY_BASELINE_142.\n" \
1623                 "" >> $(WARNING_FILE) ; \
1624         fi
1625 endif
1626 
1627 ######################################################
1628 # SECURITY_BASELINE_150 test
1629 ######################################################
1630 security_baseline_150:
1631 ifeq ($(PLATFORM), windows)
1632         @if [ -z "$(SECURITY_BASELINE_150)" ]; then \
1633             $(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \
1634                 "        Setting it to the default value of 1.5.0_07.\n" \
1635                 "        It is recommended to set SECURITY_BASELINE_150.\n" \
1636                 "" >> $(WARNING_FILE) ; \
1637         fi
1638 endif
1639 
1640 ######################################################
1641 # SECURITY_BASELINE_160 test
1642 ######################################################
1643 security_baseline_160:
1644 ifeq ($(PLATFORM), windows)
1645         @if [ -z "$(SECURITY_BASELINE_160)" ]; then \
1646             $(ECHO) "WARNING: Your SECURITY_BASELINE_160 setting is empty.\n" \
1647                 "        Setting it to the default value of 1.6.0_11.\n" \
1648                 "        It is recommended to set SECURITY_BASELINE_160.\n" \
1649                 "" >> $(WARNING_FILE) ; \
1650         fi
1651 endif
1652 
1653 
1654 ######################################################
1655 # this should be the last rule in any target's sanity rule.
1656 ######################################################
1657 sane-lastrule:
1658 ifndef EXTERNALSANITYCONTROL
1659         @if [ -r $(MESSAGE_FILE) ]; then \
1660           $(CAT) $(MESSAGE_FILE) ; \
1661         fi
1662         @if [ -r $(WARNING_FILE) ]; then \
1663           $(CAT) $(WARNING_FILE) ; \
1664         fi
1665         @if [ "x$(INSANE)" != x ]; then \
1666           $(ECHO) "INSANE mode requested. \n" \
1667             "Sanity will not force a build termination, even with errors.\n" \
1668             "" >> $(ERROR_FILE); \
1669         fi
1670         @if [ -r $(ERROR_FILE) ]; then \
1671           if [ "x$(INSANE)" = x ]; then \
1672             $(ECHO) "Exiting because of the above error(s). \n" \
1673               "">> $(ERROR_FILE); \
1674           fi ; \
1675           $(CAT) $(ERROR_FILE) ; \
1676           if [ "x$(INSANE)" = x ]; then \
1677             exit 1 ; \
1678           fi ; \
1679         fi
1680 ifdef PEDANTIC
1681         @if [ -r $(WARNING_FILE) ]; then \
1682           $(ECHO) "PEDANTIC mode requested. \n" \
1683             "Exiting because of the above warning(s). \n" \
1684             "" >> $(ERROR_FILE); \
1685           $(CAT) $(ERROR_FILE) ; \
1686           exit 1 ; \
1687         fi
1688 endif # PEDANTIC
1689         @if [ ! -r $(ERROR_FILE) ]; then \
1690           $(ECHO) "Sanity check passed." ; \
1691         fi
1692 endif #  EXTERNALSANITYCONTROL
1693 


  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # 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 # Build readme
  41 BUILD_README=http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-builds.html
  42 define BuildReadme # section
  43 "See $(BUILD_README)#$1 (or file:/$(call FullPath,$(JDK_TOPDIR)/../README-builds.html)#$1)."
  44 endef
  45 
  46 # How to say "The Release Engineering people use this"
  47 THE_OFFICIAL_USES=The official $(PLATFORM) builds use
  48 
  49 # Warning about using different versions
  50 MAY_PRODUCE=This may produce binaries incorrectly or cause the build to fail.
  51 
  52 # If a comma is needed in the sentence, use ${comma}
  53 comma=,
  54 
  55 # How to say "You are using:"
  56 YOU_ARE_USING=You appear to be using
  57 
  58 # Error message
  59 define SanityError # primary secondary
  60 $(PRINTF) "\nERROR: %s\n" $1   >> $(ERROR_FILE); \
  61 $(PRINTF)   "       %s\n" $2   >> $(ERROR_FILE)
  62 endef
  63 
  64 # Warning message
  65 define SanityWarning # primary secondary
  66 $(PRINTF) "\nWARNING: %s\n" $1   >> $(WARNING_FILE); \
  67 $(PRINTF)   "         %s\n" $2   >> $(WARNING_FILE)
  68 endef
  69 
  70 # Issue unset variable warning
  71 define UnsetSanityWarning # name envname extraLines
  72 $(call SanityWarning, "You do not have a $(strip $1) setting.", \
  73 "We recommend that you set $(strip $2)." $3)
  74 endef
  75 
  76 # Issue unset variable error
  77 define UnsetSanityError # name envname extraLines
  78 $(call SanityError, "You must have a $(strip $1) setting.", \
  79 "We recommend that you set $(strip $2)." $3)
  80 endef
  81 
  82 # Issue bad variable setting error
  83 define BadPathSanityError # name envname extraLines
  84 $(call SanityError, "You do not have a valid $(strip $1) setting.", \
  85 "Please check your access to $(strip $1)=$($(strip $1)) and/or check your value of $(strip $2)." $3)
  86 endef
  87 
  88 # Must be set and must exist and be a file
  89 define VarFileSanityCheck # name extraLines
  90 if [ ! -f "$($(strip $1))" -o ! -r "$($(strip $1))" ]; then \
  91 $(call SanityError, "Missing file $(strip $1)=$($(strip $1)).",$2); \
  92 fi
  93 endef
  94 
  95 # Must be set and must exist and be readable
  96 define VarPathSanityCheck # name envname extraLines
  97 if [ "$($(strip $1))" = "" ]; then \
  98 $(call UnsetSanityError,$(strip $1),$(strip $2),$3); \
  99 elif [ ! -d "$($(strip $1))" -o ! -r "$($(strip $1))" ]; then \
 100 $(call BadPathSanityError,$(strip $1),$(strip $2),$3); \
 101 fi
 102 endef
 103 
 104 # Unset is just a warning, if set must exist and be readable
 105 define OptionalVarPathSanityCheck # name envname extraLines
 106 if [ "$($(strip $1))" = "" ]; then \
 107 $(call UnsetSanityWarning,$(strip $1),$(strip $2),$3); \
 108 elif [ ! -d "$($(strip $1))" -o ! -r "$($(strip $1))" ]; then \
 109 $(call BadPathSanityError,$(strip $1),$(strip $2),$3); \
 110 fi
 111 endef
 112 
 113 # Common error, never set this environment variable
 114 define NeverSetSanityCheck # variableName
 115 $(if $($(strip $1)),$(call SanityError, \
 116 "Your $(strip $1) environment variable is set.", \
 117 "$(MAY_PRODUCE)" \
 118 "Please unset $(strip $1) and start your build again."),)
 119 endef
 120 
 121 define VarPathFileSanityCheck # name envname filepath extraLines
 122 if [ ! -f "$(strip $3)" -o ! -r  "$(strip $3)" ]; then \
 123 $(call SanityError, "File $(strip $3) does not exist.",\
 124 "You do not have a valid $(strip $1) setting." \
 125 "Please check your access to $(strip $1)=$($(strip $1)) and/or check your value of $(strip $2)." $4); \
 126 fi
 127 endef
 128 
 129 define OptionalVarPathFileSanityCheck # name envname filepath extraLines
 130 if [ ! -f "$(strip $3)" -o ! -r  "$(strip $3)" ]; then \
 131 $(call SanityWarning, "File $(strip $3) does not exist.",\
 132 "You do not have a valid $(strip $1) setting." \
 133 "Please check your access to $(strip $1)=$($(strip $1)) and/or check your value of $(strip $2)." $4); \
 134 fi
 135 endef
 136 
 137 # Common error, version too old, silent to be same or newer
 138 define VersionSanityCheck # toolName foundVer reqVer extraLines
 139 $(if $(subst newer,,$(subst same,,$(call CheckVersions,$(strip $2),$(strip $3)))),\
 140 $(call SanityError, \
 141 "$(YOU_ARE_USING) $(strip $1) $(strip $2) which is a $(call CheckVersions,$(strip $2),$(strip $3)) version.", \
 142 "$(THE_OFFICIAL_USES) $(strip $1) $(strip $3)." \
 143 "$(MAY_PRODUCE)" \
 144  $4)\
 145 ,)
 146 endef
 147 
 148 # Common error, version too old, and warn if not an exact match
 149 define SameVersionSanityCheck # toolName foundVer reqVer extraLines
 150 $(if $(subst newer,,$(call CheckVersions,$(strip $2),$(strip $3))),\
 151 $(call VersionSanityCheck,$(strip $1),$(strip $2),$(strip $3),$4),\
 152 $(call SanityWarning, \
 153 "$(YOU_ARE_USING) $(strip $1) $(strip $2) which is a $(call CheckVersions,$(strip $2),$(strip $3)) version.", \
 154 "$(THE_OFFICIAL_USES) $(strip $1) $(strip $3)." \
 155 "$(MAY_PRODUCE)" \
 156  $4))
 157 endef
 158 
 159 # Settings and rules to validate the JDK build environment.
 160 
 161 ifeq ($(PLATFORM), solaris)
 162   FREE_SPACE := $(shell $(DF) -b $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
 163   TEMP_FREE_SPACE := $(shell $(DF) -b $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
 164   # What kind of system we are using (Variations are Solaris and OpenSolaris)
 165   OS_VERSION := $(shell uname -r)
 166   OS_VARIANT_NAME := $(strip $(shell head -1 /etc/release | awk '{print $$1;}') )
 167   OS_VARIANT_VERSION := $(OS_VERSION)
 168   REQ_PATCH_LIST = $(JDK_TOPDIR)/make/PatchList.solaris
 169   ifeq ($(ARCH_FAMILY), sparc)
 170     PATCH_POSITION = $$4
 171   else
 172     PATCH_POSITION = $$6
 173   endif
 174   ifndef OPENJDK
 175     _GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
 176     GCC_VER  :=$(call GetVersion,"$(_GCC_VER)")
 177   endif
 178 endif
 179 
 180 ifeq ($(PLATFORM), linux)
 181   FREE_SPACE := $(shell $(DF) --sync -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 182   TEMP_FREE_SPACE := $(shell $(DF) --sync -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 183   # What kind of system we are using (Variation is the Linux vendor)
 184   OS_VERSION := $(shell uname -r)
 185   OS_VARIANT_NAME := $(shell \
 186     if [ -f /etc/fedora-release ]; then \
 187       echo "Fedora"; \
 188     elif [ -f /etc/redhat-release ]; then \
 189       echo "RedHat"; \
 190     elif [ -f /etc/SuSE-release ]; then \
 191       echo "SuSE"; \
 192     else \
 193       echo "Unknown"; \
 194     fi)
 195   OS_VARIANT_VERSION := $(shell \
 196     if [ "$(OS_VARIANT_NAME)" = "Fedora" ]; then \
 197       $(CAT) /etc/fedora-release | $(HEAD) -1 | $(NAWK) '{ print $$3; }' ; \
 198     fi)
 199   ALSA_INCLUDE=/usr/include/alsa/version.h
 200   ALSA_LIBRARY=/usr/lib/libasound.so
 201   _ALSA_VERSION := $(shell $(EGREP) SND_LIB_VERSION_STR $(ALSA_INCLUDE) | \
 202            $(SED) -e 's@.*\"\(.*\)\".*@\1@' )
 203   ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
 204 endif
 205 
 206 ifeq ($(PLATFORM), windows)
 207   FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 208   TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
 209   # Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2
 210   #    Assume 5.0 (Windows 2000) if systeminfo does not help
 211   WINDOWS_MAPPING-5.0 := Windows2000
 212   WINDOWS_MAPPING-5.1 := WindowsXP
 213   WINDOWS_MAPPING-5.2 := Windows2003
 214   # What kind of system we are using (Variation is the common name)
 215   _OS_VERSION := \
 216     $(shell systeminfo 2> $(DEV_NULL) | \


 299         sane-hotspot_binaries \
 300         sane-hotspot_import \
 301         sane-hotspot_import_dir \
 302         sane-hotspot_import_include \
 303         sane-compiler \
 304         sane-link \
 305         sane-cacerts \
 306         sane-alsa-headers \
 307         sane-ant_version \
 308         sane-zip_version \
 309         sane-unzip_version \
 310         sane-msvcrt_path \
 311         sane-freetype \
 312         sane-build_modules
 313 
 314 ######################################################
 315 # check for COPYRIGHT_YEAR variable
 316 ######################################################
 317 sane-copyrightyear:
 318 ifdef ALT_COPYRIGHT_YEAR
 319         @$(call SanityWarning, \
 320 "ALT_COPYRIGHT_YEAR but not the current year will be used for copyright year.",)

 321 endif
 322 
 323 ######################################################
 324 # check for INSANE variable
 325 ######################################################
 326 sane-insane:
 327 ifdef INSANE
 328         @$(call SanityWarning, \
 329 "You are building in 'INSANE' mode${comma} this is not a supported option.", \
 330 "Builds can be unpredictable and should not be trusted.")





 331 endif
 332 
 333 ######################################################
 334 # check for GNU Make version
 335 ######################################################

 336 sane-make:
 337         @$(call VersionSanityCheck,make,\
 338                 $(MAKE_VER),$(REQUIRED_MAKE_VER),)




 339 
 340 ######################################################
 341 # Check the BUILD_NUMBER to make sure it contains bNN
 342 ######################################################
 343 sane-build_number: 
 344         @if [ "`$(ECHO) $(BUILD_NUMBER) | $(SED) 's@.*b[0-9][0-9]*.*@bNN@'`" != "bNN" ]; then \
 345             $(call SanityWarning, \
 346 "The BUILD_NUMBER needs to contain b[0-9][0-9]*.", \
 347 "Currently BUILD_NUMBER=$(BUILD_NUMBER). \
 348 This has been known to cause build failures.") ; \
 349         fi
 350 
 351 ######################################################
 352 # Check the ARCH_DATA_MODEL setting
 353 ######################################################
 354 sane-arch_data_model:
 355 ifneq ($(ARCH_DATA_MODEL),32)
 356   ifneq ($(ARCH_DATA_MODEL),64)
 357         @$(call SanityError, \
 358 "The setting of ARCH_DATA_MODEL must be 32 or 64.", \
 359 "$(YOU_ARE_USING) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL).")
 360   endif
 361 endif
 362 
 363 ######################################################
 364 # Check the OS version
 365 #   NOTE: OPENJDK explicitly does not check for OS release information.
 366 #         Unless we know for sure that it will not build somewhere, we cannot
 367 #         generate a fatal sanity error, and a warning about the official
 368 #         build platform just becomes clutter.
 369 ######################################################
 370 sane-os_version:: sane-arch_data_model sane-memory_check sane-locale sane-os_patch_level
 371 ifndef OPENJDK


 372   ifeq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
 373         @$(call SameVersionSanityCheck,$(OS_VARIANT_NAME) version, \
 374                 $(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION),)
 375   else
 376         @$(call SanityWarning,\
 377 "$(OS_VARIANT_NAME) is not the required or expected $(REQUIRED_OS_VARIANT_NAME) variation.", )
 378         @$(call SameVersionSanityCheck,$(PLATFORM) version,\
 379                 $(OS_VERSION),$(REQUIRED_OS_VERSION),)
 380   endif
 381 else
 382   ifeq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
 383         @$(call VersionSanityCheck,$(OS_VARIANT_NAME) version,\
 384                 $(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION),)







 385   else
 386         @$(call SanityWarning,\
 387 "$(OS_VARIANT_NAME) is not the required $(REQUIRED_OS_VARIANT_NAME)", )
 388         @$(call VersionSanityCheck,$(PLATFORM) version,\
 389                 $(OS_VERSION),$(REQUIRED_OS_VERSION),)
 390   endif

 391 endif # OPENJDK
 392 
 393 ifeq ($(PLATFORM), windows)
 394   sane-os_version:: sane-cygwin sane-mks sane-cygwin-shell
 395 endif
 396 
 397 ######################################################
 398 # Check the memory available on this machine
 399 ######################################################
 400 sane-memory_check:
 401         @if [ "$(LOW_MEMORY_MACHINE)" = "true" ]; then \
 402           $(call SanityWarning, \
 403 "This machine appears to only have $(MB_OF_MEMORY)Mb of physical memory.", \
 404 "Builds on this machine could be slow.") ; \
 405         fi
 406 
 407 ######################################################
 408 # Check the locale (value of LC_ALL, not being empty or ==C can be a problem)
 409 ######################################################
 410 sane-locale:
 411 ifneq ($(PLATFORM), windows)
 412         @if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \
 413           $(call SanityWarning, \
 414 "LC_ALL has been set to $(LC_ALL)${comma} this can cause build failures.", \
 415 "Try setting LC_ALL to \"C\"."); \
 416         fi
 417         @if [ "$(LANG)" != "" -a "$(LANG)" != "C" ]; then \
 418           $(call SanityWarning, \
 419 "LANG has been set to $(LANG)${comma} this can cause build failures.", \
 420 "Try setting LANG to \"C\".") ; \
 421         fi
 422 endif
 423 
 424 ######################################################
 425 # Check the Windows cygwin version
 426 ######################################################
 427 ifeq ($(PLATFORM), windows)

 428 sane-cygwin:
 429   ifdef USING_CYGWIN
 430         @$(call VersionSanityCheck,CYGWIN,\
 431                 $(CYGWIN_VER),$(REQUIRED_CYGWIN_VER),)
 432   endif




 433 endif
 434 
 435 ######################################################
 436 # Check the cygwin shell is used, not cmd.exe
 437 ######################################################
 438 ifeq ($(PLATFORM), windows)
 439 sane-cygwin-shell:
 440   ifdef USING_CYGWIN
 441         @if [ "$(SHLVL)" = "" -a "$(_)" = "" ]; then \
 442           $(call SanityError, \
 443 "You are using an unsupported shell.", \
 444 "Use either sh${comma} bash${comma} ksh${comma} zsh${comma} or tcsh." \
 445 "Using the cmd.exe utility is not supported." \
 446 "If you still want to try your current shell${comma} \
 447  please export SHLVL=1 when running $(MAKE)."); \
 448         fi
 449   endif
 450 endif
 451 
 452 ######################################################
 453 # Check the Windows mks version
 454 ######################################################
 455 ifeq ($(PLATFORM), windows)

 456 sane-mks:
 457   ifndef USING_CYGWIN
 458         @$(call VersionSanityCheck,MKS,\
 459                 $(MKS_VER),$(REQUIRED_MKS_VER),)
 460   endif




 461 endif
 462 
 463 ######################################################
 464 # Get list of installed patches (this file has a particular format)
 465 ######################################################
 466 $(INSTALL_PATCHES_FILE):
 467         @$(prep-target)
 468 ifeq ($(PLATFORM), solaris)
 469   ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION))
 470         $(SHOWREV) -p > $@ 2>&1
 471   endif
 472 endif
 473         @$(ECHO) "" >> $@
 474 
 475 ######################################################
 476 # Check list of Solaris patches
 477 ######################################################
 478 sane-os_patch_level: $(INSTALL_PATCHES_FILE)
 479 ifeq ($(PLATFORM), solaris)
 480   ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION))


 515             if (installPatchNo[j] == requiredPatchNo[i] \
 516             && installPatchRev[j] >= requiredPatchRev[i]) { \
 517                 foundMatch = 1; \
 518                 break; \
 519             } \
 520         } \
 521         if ( foundMatch == 0) { \
 522             printf("WARNING: Your solaris install is missing the required patch %s-%s\n", requiredPatchNo[i], requiredPatchRev[i] ); \
 523             printf("         Please update your your system patches or build on a different machine.\n\n" ); \
 524             errorCount++; \
 525         } \
 526     } \
 527 }' $(REQ_PATCH_LIST) readingInstallPatches=1 $(INSTALL_PATCHES_FILE) >> $(WARNING_FILE)
 528   endif
 529 endif # PLATFORM
 530 
 531 ######################################################
 532 # CLASSPATH cannot be set, unless you are insane.
 533 ######################################################
 534 sane-classpath:
 535         @$(call NeverSetSanityCheck, CLASSPATH)





 536 
 537 ######################################################
 538 # JAVA_HOME cannot be set, unless you are insane.
 539 ######################################################
 540 sane-java_home:
 541         @$(call NeverSetSanityCheck, JAVA_HOME)





 542 
 543 ######################################################
 544 # Make sure the fonts are there
 545 # Exceptions are when explicitly building OPENJDK, or
 546 # when the entire CLOSED_SRC dir is excluded, so we are
 547 # implicitly building OPENJDK
 548 ######################################################
 549 FONT_FILE=$(CLOSED_SRC)/share/lib/fonts/LucidaTypewriterRegular.ttf
 550 sane-fonts:
 551 ifndef OPENJDK
 552         @if [ -d $(CLOSED_SRC) ]; then \
 553           $(call VarFileSanityCheck,FONT_FILE, \
 554 "Verify you have downloaded and overlayed on the source area all the binary files.") ; \



 555         fi
 556 endif
 557 
 558 ######################################################
 559 # If building OPENJDK check pre-built binaries are
 560 # available for binary plug source components.
 561 ######################################################
 562 ifdef OPENJDK
 563 sane-binary-plugs:
 564   ifeq ($(IMPORT_BINARY_PLUGS),true)
 565         @$(call OptionalVarPathSanityCheck,\
 566                 BINARY_PLUGS_PATH,ALT_BINARY_PLUGS_PATH, )





 567   endif
 568 endif
 569 
 570 ######################################################
 571 # VARIANT must be set to DBG or OPT
 572 ######################################################
 573 sane-variant:
 574 ifneq ($(VARIANT),DBG)
 575   ifneq ($(VARIANT),OPT)
 576         @$(call SanityError, \
 577 "Your VARIANT environment variable is set to VARIANT=$(VARIANT) \
 578  and needs to be set to DBG or OPT.",)
 579   endif
 580 endif
 581 
 582 ######################################################
 583 # LD_LIBRARY_PATH should not be set, unless you are insane.
 584 ######################################################
 585 sane-ld_library_path:
 586         @$(call NeverSetSanityCheck, LD_LIBRARY_PATH)





 587 
 588 ######################################################
 589 # LD_LIBRARY_PATH_64 should not be set, unless you are insane.
 590 ######################################################
 591 sane-ld_library_path_64:
 592         @$(call NeverSetSanityCheck, LD_LIBRARY_PATH_64)





 593 
 594 ######################################################
 595 # LD_OPTIONS should not be set, unless you are insane.
 596 ######################################################
 597 sane-ld_options:
 598         @$(call NeverSetSanityCheck, LD_OPTIONS)





 599 
 600 ######################################################
 601 # LD_RUN_PATH should not be set, unless you are insane.
 602 ######################################################
 603 sane-ld_run_path:
 604         @$(call NeverSetSanityCheck, LD_RUN_PATH)






 605 
 606 ######################################################
 607 # MAKEFLAGS cannot be set, unless you are insane.
 608 #   it is unacceptable  to have these in MAKEFLAGS
 609 #     -e or --environment-overrides
 610 #     -i or --ignore-errors
 611 #     -I or --include-dir
 612 #     -k or --keep-going
 613 #     -r or --nobuiltin-rules
 614 #     -o or --assume-old or --old-filevalue
 615 #     -t or --touch value in MAKEFLAGS
 616 #       Note - some may be processed out in GNU Make startup
 617 ######################################################









 618 sane-makeflags:

 619 ifeq ($(origin MAKEFLAGS),environment)



 620         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(e|--environment-overrides)( |$$)'` -ne 0 ]; then \
 621           $(call SanityError, \
 622 "Either the build was started with the flag -e or \
 623  --environment-overrides or the MAKEFLAGS variable has this value set.", \
 624 "This will cause any environment variables you have defined to override \
 625  the values defined by the makefiles." \
 626 "This practice is not recommemded by the authors of GNU Make \
 627  and will lead to an improper build." \
 628 "Please fix and restart the build.") ; \

 629         fi



 630         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(i|--ignore-errors)( |$$)'` -ne 0 ]; then \
 631           $(call SanityError, \
 632 "Either the build was started with the flag -i or \
 633  --ignore-errors or the MAKEFLAGS environment variable has this value set.", \
 634 "You will be unable to determine if the build is broken or not." \
 635 "Please fix and restart the build.") ; \

 636         fi



 637         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(I|--include-dir)( |$$)'` -ne 0 ]; then \
 638           $(call SanityError, \
 639 "Either the build was started with the flag -I or --include-dir \
 640  or the MAKEFLAGS environment variable has this value set.", \
 641 "This will render your build questionable as not all the rules and \
 642  dependencies are captured by the build." \
 643 "Please fix and restart the build.") ; \

 644         fi



 645         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(k|--keep-going)( |$$)'` -ne 0 ]; then \
 646           $(call SanityError, \
 647 "Either the build was started with the flag -k or --keep-going \
 648  or the MAKEFLAGS environment variable has this value set.", \
 649 "You will be unable to determine if the build is broken or not." \
 650 "Please fix and restart the build.") ; \

 651         fi





 652         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(o|--assume-old|--old-file)( |$$)'` -ne 0 ]; then \
 653           $(call SanityError, \
 654 "Either the build was started with the flag -o or --assume-old or --old-file \
 655  or the MAKEFLAGS environment variable has this value set.", \
 656 "This could prevent the build from executing rules it should \
 657  thus rendering a questionable result." \
 658 "Please fix and restart the build.") ; \

 659         fi



 660         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(r|--no-builtin-rules)( |$$)'` -ne 0 ]; then \
 661           $(call SanityError, \
 662 "Either the build was started with the flag -r or --no-builtin-rules \
 663  or the MAKEFLAGS environment variable has this value set.", \
 664 "This may break the build by not allowing builtin rules that may be required." \
 665 "Please fix and restart the build.") ; \

 666         fi





 667         @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(t|--touch)( |$$)'` -ne 0 ]; then \
 668           $(call SanityError, \
 669 "Either the build was started with the flag -t or --touch \
 670  or the MAKEFLAGS environment variable has this value set.", \
 671 "This will leave the build in a unclear state and could lead to not \
 672  executing rules which should be executed." \
 673 "Please fix and restart the build.") ; \

 674         fi
 675         @$(call NeverSetSanityCheck, MAKEFLAGS)







 676 endif
 677 
 678 ######################################################
 679 # if specified, ALT_OUTPUTDIR must point to non-relative path if set
 680 ######################################################
 681 sane-alt_outputdir:
 682 ifdef ALT_OUTPUTDIR
 683         @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
 684           $(call SanityError, \
 685 "ALT_OUTPUTDIR must be an Absolute Path Name not a Relative Path Name.",) ; \

 686         fi
 687   ifeq ($(PLATFORM), windows)
 688         @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)'` -ne 1 ]; then \
 689           $(call SanityError, \
 690 "On windows ALT_OUTPUTDIR must contain the drive letter.",) ; \
 691         fi
 692   endif
 693 endif
 694 
 695 ######################################################
 696 # OUTPUTDIR tests
 697 ######################################################
 698 sane-outputdir:
 699         @$(call VarPathSanityCheck,OUTPUTDIR,ALT_OUTPUTDIR, )












 700         @if [ ! -w "$(OUTPUTDIR)" ]; then \
 701           $(call SanityError, \
 702 "You must have write permissions to OUTPUTDIR.", \
 703 "The current value of OUTPUTDIR is $(OUTPUTDIR)." \
 704 "Either obtain these permissions or set ALT_OUTPUTDIR.") ; \

 705         fi



 706         @if [ $(FREE_SPACE) -lt $(REQUIRED_FREE_SPACE) ]; then \
 707           $(call SanityWarning, \
 708 "You may not have enough free space in your OUTPUTDIR.", \
 709 "The current value of OUTPUTDIR is $(OUTPUTDIR)." \
 710 "You need '$(REQUIRED_FREE_SPACE)' Kbytes free on this device to build \
 711 and it appears that only '$(FREE_SPACE)' Kbytes are free." \
 712 "Either obtain more space or set ALT_OUTPUTDIR to a larger disk.") ; \

 713         fi
 714 
 715 ######################################################
 716 # if specified, ALT_BOOTDIR must point to non-relative path if set
 717 ######################################################
 718 sane-alt_bootdir:
 719 ifdef ALT_BOOTDIR
 720         @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
 721           $(call SanityError, \
 722 "ALT_BOOTDIR must be an Absolute Path Name${comma} not a Relative Path Name.", \
 723 "The current value of ALT_BOOTDIR is $(ALT_BOOTDIR)." \
 724 "Please fix this and continue your build.") ; \


 725         fi
 726 endif
 727 
 728 ######################################################
 729 # BOOTDIR must point to a valid JDK.
 730 ######################################################

 731 sane-bootdir:
 732         @$(call VersionSanityCheck,boot JDK,\
 733                 $(BOOT_VER),$(REQUIRED_BOOT_VER), \
 734 "Your ALT_BOOTDIR environment variable does not point to a valid JDK \
 735  for bootstrapping this build." \
 736 "A JDK $(JDK_MINOR_VERSION) $(MARKET_NAME) build must be bootstrapped using \
 737  JDK $(PREVIOUS_JDK_VERSION) fcs (or later).")



 738 
 739 ######################################################
 740 # BOOTDIR is recommended to reside on a local drive
 741 ######################################################
 742 sane-local-bootdir:
 743 ifeq ($(PLATFORM), windows)
 744         @if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -c '^[jJ]:'` -ne 0 ]; then \
 745           $(call SanityWarning, \
 746 "Your BOOTDIR is located on the J: drive.", \
 747 "Often the J: drive is mapped over a network." \
 748 "Using a mapped drive for the BOOTDIR may significantly slow down the build process." \
 749 "You may want to consider using the ALT_BOOTDIR variable to point the build \
 750  to another location for the BOOTDIR instead." \
 751 "Your current BOOTDIR is: $(BOOTDIR)") ; \

 752         fi
 753 endif
 754 
 755 ######################################################
 756 # CACERTS_FILE must be absoulte path and readable
 757 ######################################################
 758 sane-cacerts:
 759   ifdef ALT_CACERTS_FILE
 760         @if [ `$(ECHO) $(subst \,/,$(ALT_CACERTS_FILE)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
 761           $(call SanityError, \
 762 "ALT_CACERTS_FILE must be an Absolute Path Name not a Relative Path Name.", \
 763 "The current value of ALT_CACERTS_FILE is $(ALT_CACERTS_FILE)." \
 764 "Please fix this and continue your build.") ; \


 765         fi
 766   endif
 767         @#
 768         @# CACERTS_FILE must be readable
 769         @#
 770         @if [ ! -r "$(subst \,/,$(CACERTS_FILE))" ]; then \
 771           $(call SanityError, \
 772 "You do not have access to a valid cacerts file.", \
 773 "Please check your access to $(subst \,/,$(CACERTS_FILE)) \
 774  and/or check your value of ALT_CACERTS_FILE.") ; \

 775         fi
 776         @#
 777         @# CACERTS_FILE must be a file
 778         @#
 779         @if [ -d "$(subst \,/,$(CACERTS_FILE))" ]; then \
 780           $(call SanityError, \
 781 "You do not have access to a valid cacerts file.", \
 782 "The value of CACERTS_FILE must point to a normal file." \
 783 "Please check your access to $(subst \,/,$(CACERTS_FILE)) \
 784  and/or check your value of ALT_CACERTS_FILE.") ; \

 785         fi
 786 
 787 
 788 ######################################################
 789 # Check for availability of FreeType (OpenJDK specific)
 790 ######################################################
 791 
 792 ifdef OPENJDK
 793 
 794 # The freetypecheck Makefile prints out "Failed" if not good enough
 795 $(TEMPDIR)/freetypeinfo: FRC
 796         @$(prep-target)
 797         @(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
 798             $(ECHO) "Failed to build freetypecheck." ) > $@
 799 
 800 sane-freetype: $(TEMPDIR)/freetypeinfo
 801         @if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
 802           $(call SanityError, \
 803 "FreeType version $(REQUIRED_FREETYPE_VERSION) or higher is required.", \
 804 "`$(CAT) $<`") ; \
 805         fi
 806 
 807 else
 808 #do nothing  (not OpenJDK)
 809 sane-freetype: 
 810 endif
 811 
 812 ######################################################
 813 # if specified, BUILD_MODULES must contain valid values.
 814 ######################################################
 815 MODULES_REGEX="all|base|desktop|management|enterprise|misc|tools"
 816 sane-build_modules:
 817 ifdef BUILD_MODULES
 818         @for m in $(BUILD_MODULES) ; do \
 819             valid=`$(ECHO) $$m | $(EGREP) $(MODULES_REGEX)`; \
 820             if [ "x$$valid" = "x" ]; then \
 821                 $(call SanityError, \
 822 "$$m set in the BUILD_MODULES variable is invalid.", ) ; \
 823             fi \
 824         done
 825 endif
 826 
 827 ######################################################
 828 # CUPS_HEADERS_PATH must be valid
 829 ######################################################
 830 sane-cups:
 831 ifneq ($(PLATFORM), windows)
 832         @$(call VarPathFileSanityCheck,\
 833                 CUPS_HEADERS_PATH,ALT_CUPS_HEADERS_PATH,\
 834                 $(CUPS_HEADERS_PATH)/cups/cups.h,$(call BuildReadme,cups))






 835 endif
 836 
 837 ######################################################
 838 # Check for existence of DEVTOOLS_PATH
 839 ######################################################
 840 sane-devtools_path:
 841         @$(call VarPathSanityCheck,DEVTOOLS_PATH,ALT_DEVTOOLS_PATH, )






 842 
 843 ######################################################
 844 # Check for existence of MS_RUNTIME_LIBRARIES
 845 ######################################################
 846 sane-msvcrt_path:
 847 ifeq ($(PLATFORM), windows)
 848         @$(call VarPathFileSanityCheck,\
 849                 MSVCRT_DLL_PATH,ALT_MSVCRT_DLL_PATH,\
 850                 $(MSVCRT_DLL_PATH)/msvcrt.dll, )




 851   ifneq ($(MSVCRNN_DLL),)
 852         @$(call VarPathFileSanityCheck,\
 853                 MSVCRNN_DLL_PATH,ALT_MSVCRNN_DLL_PATH,\
 854                 $(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL), )




 855   endif
 856 endif
 857 
 858 ######################################################
 859 # Check for existence of COMPILER_PATH
 860 ######################################################
 861 sane-compiler_path:
 862         @$(call VarPathSanityCheck,COMPILER_PATH,ALT_COMPILER_PATH, )






 863 
 864 ######################################################
 865 # Check for existence of UNIXCOMMAND_PATH
 866 ######################################################
 867 sane-unixcommand_path:
 868         @$(call VarPathSanityCheck,UNIXCOMMAND_PATH,ALT_UNIXCOMMAND_PATH, )






 869 ifeq ($(PLATFORM), windows)
 870         @for utility in cpio ar file m4 ; do \
 871           if [ ! -r "`$(WHICH) $${utility}`" ]; then \
 872             $(call SanityWarning, \
 873 "You do not have the utility $${utility} in the directory $(UNIXCOMMAND_PATH).", \
 874 "The utilities cpio${comma} ar${comma} file${comma} and m4 are required."); \

 875           fi; \
 876         done
 877 endif
 878 
 879 ######################################################
 880 # Check for existence of USRBIN_PATH on linux
 881 ######################################################
 882 sane-usrbin_path:
 883 ifeq ($(PLATFORM), linux)
 884         @$(call VarPathSanityCheck,USRBIN_PATH,ALT_USRBIN_PATH, )






 885 endif
 886 
 887 ######################################################
 888 # Check for existence of UNIXCCS_PATH on solaris
 889 ######################################################
 890 sane-unixccs_path:
 891 ifeq ($(PLATFORM), solaris)
 892         @$(call VarPathSanityCheck,UNIXCCS_PATH,ALT_UNIXCCS_PATH, )






 893 endif
 894 
 895 ######################################################
 896 # Verify the docs directory exists
 897 ######################################################
 898 sane-docs_import:
 899         @$(call OptionalVarPathSanityCheck,\
 900                 HOTSPOT_DOCS_IMPORT_PATH,ALT_HOTSPOT_DOCS_IMPORT_PATH, )



 901 
 902 ######################################################
 903 # Check for possible problem regarding __fabsf,  math_iso.h and the libm patch.
 904 #    Hotspot should have been changed in Mustang 6.0 Build 47 to not depend
 905 #    on __fabsf, this is just checking that fact now.
 906 ######################################################
 907 sane-math_iso:
 908 ifeq ($(PLATFORM), solaris)
 909         @if [ -f $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
 910           if [ "`$(NM) $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) | $(GREP) __fabsf`" != "" ]; then \
 911             $(call SanityWarning, \
 912 "This version of hotspot relies on __fabsf which is not always available \
 913  on Solaris 8 and 9 machines unless they have the latest libm patch \
 914  and the file /usr/include/iso/math_iso.h which can trigger this dependency.", \
 915 "Hotspot should NOT be dependent on this extern${comma} check the \
 916  version of the hotspot library you are using.") ; \

 917             fi; \
 918         fi
 919 endif
 920 
 921 ######################################################
 922 # Check for possible patch problem regarding /usr/lib/libCrun.so
 923 ######################################################
 924 sane-libCrun:
 925 ifeq ($(PLATFORM), solaris)
 926         @if [ "`$(NM) /usr/lib/libCrun.so.1 | $(GREP) __1c2n6FIpv_0_`" = "" ]; then \
 927           $(call SanityWarning, \
 928 "The file /usr/lib/libCrun.so.1 is missing the extern __1c2n6FIpv_0_ \
 929  which indicates that the system is missing a required Solaris patch \
 930  or you are using a pre-FCS release of Solaris 10.", \
 931 "You need the latest /usr/lib/libCrun.so.1 which comes with the \
 932  FCS release of Solaris 10 and available through the latest \
 933  Solaris 8 or 9 C++ runtime patches.") ; \
 934         fi
 935 endif
 936 
 937 ######################################################
 938 # Check for existence of MSDEVTOOLS_PATH on windows
 939 ######################################################
 940 sane-msdevtools_path:
 941 ifeq ($(PLATFORM), windows)
 942         @$(call VarPathSanityCheck,MSDEVTOOLS_PATH,ALT_MSDEVTOOLS_PATH, )






 943 endif
 944 
 945 ######################################################
 946 # Check for existence of Hotspot binaries
 947 ######################################################
 948 sane-hotspot_binaries:
 949 ifeq ($(ARCH_DATA_MODEL), 32)
 950         @$(call VarPathFileSanityCheck,\
 951                 HOTSPOT_CLIENT_PATH,ALT_HOTSPOT_CLIENT_PATH,\
 952                 $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX),\
 953 "The ALT_HOTSPOT_IMPORT_PATH may also be used.")



 954 endif
 955         @$(call VarPathFileSanityCheck,\
 956                 HOTSPOT_SERVER_PATH,ALT_HOTSPOT_SERVER_PATH,\
 957                 $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX),\
 958 "The ALT_HOTSPOT_IMPORT_PATH may also be used.")






 959 ifeq ($(PLATFORM), windows)
 960         @$(call VarPathFileSanityCheck,\
 961                 HOTSPOT_LIB_PATH,ALT_HOTSPOT_LIB_PATH,\
 962                 $(HOTSPOT_LIB_PATH)/jvm.lib, )







 963   ifeq ($(ARCH_DATA_MODEL), 32)
 964         @$(call OptionalVarPathFileSanityCheck,\
 965                 HOTSPOT_CLIENT_PATH,ALT_HOTSPOT_CLIENT_PATH,\
 966                 $(HOTSPOT_CLIENT_PATH)/jvm.map, \
 967 "These map files are optional and aid in the debugging of the JVM.")
 968         @$(call OptionalVarPathFileSanityCheck,\
 969                 HOTSPOT_CLIENT_PATH,ALT_HOTSPOT_CLIENT_PATH,\
 970                 $(HOTSPOT_CLIENT_PATH)/jvm.pdb, \
 971 "These pdb files are optional and aid in the debugging of the JVM.")









 972   endif
 973         @$(call OptionalVarPathFileSanityCheck,\
 974                 HOTSPOT_SERVER_PATH,ALT_HOTSPOT_SERVER_PATH,\
 975                 $(HOTSPOT_SERVER_PATH)/jvm.map, \
 976 "These map files are optional and aid in the debugging of the JVM.")
 977         @$(call OptionalVarPathFileSanityCheck,\
 978                 HOTSPOT_SERVER_PATH,ALT_HOTSPOT_SERVER_PATH,\
 979                 $(HOTSPOT_SERVER_PATH)/jvm.pdb, \
 980 "These pdb files are optional and aid in the debugging of the JVM.")








 981 endif   
 982 
 983 
 984 ######################################################
 985 # Check for existence of misc Hotspot imported files
 986 ######################################################
 987 HOTSPOT_INCLUDE_FILE_LIST  = jvmti.h
 988 HOTSPOT_INCLUDE_FILE_LIST  += jvmticmlr.h
 989 #HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h
 990 #HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h
 991 #HOTSPOT_INCLUDE_FILE_LIST += jmm.h
 992 TMP_SDK_INCLUDE_FILE_LIST=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.h)
 993 TMP_SDK_INCLUDE_FILE_DIFFS=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.hdiffs)
 994 
 995 # These include files must have a pattern: 'version: MAJOR.MINOR.MICRO'
 996 #    where MACRO, MINOR, and MICRO are numbers, e.g. 1.0.1, 0.2.90, etc.
 997 #    The critical version we are checking is MAJOR.MINOR, we print all three
 998 #    when we detect an error.
 999 
1000 TMP_SDK_INCLUDE_FIND_VERSION= $(EGREP) 'version:'
1001 TMP_SDK_INCLUDE_GET_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
1002                 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\)\.[0-9].*@\1@'
1003 TMP_SDK_INCLUDE_GET_FULL_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
1004                 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*@\1@'
1005 
1006 # Compare an interface file (Rule creates 2 temp files: %.h and %.h.IMPORT)
1007 #    Files jvm.h, jvm_md.h and jmm.h are special in that they are not publicly 
1008 #    exported but do represent VM interfaces used by the rest of the jdk.
1009 #    So these 3 will not be found in a promoted build and can only
1010 #    be checked when this represents a full control build (i.e. the
1011 #    HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory).
1012 $(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
1013         @$(install-non-module-file)
1014         @$(RM) $@.IMPORT
1015         @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \
1016           $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \
1017         elif [ "$(@F)" != "jvm.h" -a "$(@F)" != "jmm.h" ]; then \
1018           $(call SanityWarning, \
1019 "HOTSPOT_IMPORT_PATH does not contain the interface file $(@F).", \
1020 "Check your value of ALT_HOTSPOT_IMPORT_PATH."); \
1021           $(CP) $< $@.IMPORT; \
1022         else \
1023           $(CP) $< $@.IMPORT; \
1024         fi
1025 
1026 $(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
1027         @$(install-non-module-file)
1028         @$(RM) $@.IMPORT
1029         @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \
1030           $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \
1031         elif [ "$(@F)" != "jvm_md.h" ]; then \
1032           $(call SanityWarning, \
1033 "HOTSPOT_IMPORT_PATH does not contain the interface file $(@F).", \
1034 "Check your value of ALT_HOTSPOT_IMPORT_PATH."); \
1035           $(CP) $< $@.IMPORT; \
1036         else \
1037           $(CP) $< $@.IMPORT; \
1038         fi
1039 
1040 # Compares the two tempfiles: %.h and %.h.IMPORT, answer in %.hdiffs
1041 #   Note: Putting anything into the hdiffs file will trigger generic IMPORT
1042 #         warning message in hotspot_import_include.
1043 #   First checks the major.minor versions, the micro number can differ.
1044 #   Second checks the full version.
1045 #   Lastly does a full diff if the full version differs or it has no version
1046 $(TEMPDIR)/%.hdiffs: $(TEMPDIR)/%.h
1047         @$(prep-target)
1048         @$(TOUCH) $@
1049         @if [ "`$(CAT) $<        | $(TMP_SDK_INCLUDE_GET_VERSION)`" != \
1050               "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_VERSION)`" ]; then \
1051           $(call SanityWarning, \
1052 "The file $(<F) is not the same interface as the VM version.", \
1053 "This source has $(<F) `$(CAT) $< | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` and \
1054  HOTSPOT_IMPORT_PATH contains $(<F) `$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`"); \
1055              $(ECHO) "Version mis-match" > $@ ; \
1056         fi
1057         @if [ "`$(CAT) $<        | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" != \
1058                "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" ]; then \
1059           $(RM) $<.filtered  $<.IMPORT.filtered; \
1060           $(EGREP) -v 'VERSION' $< > $<.filtered; \
1061           $(EGREP) -v 'VERSION' $<.IMPORT > $<.IMPORT.filtered; \
1062           ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \
1063         elif [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_FIND_VERSION)`" = "" ]; then \
1064           $(RM) $<.filtered  $<.IMPORT.filtered; \
1065           $(EGREP) -v '@\(#\)' $< > $<.filtered; \
1066           $(EGREP) -v '@\(#\)' $<.IMPORT > $<.IMPORT.filtered; \
1067           ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \
1068         fi
1069 
1070 # Verify all imported hotspot files
1071 sane-hotspot_import:: sane-hotspot_import_dir sane-hotspot_import_include
1072 
1073 # Verify the base directory exists
1074 sane-hotspot_import_dir:
1075         @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1076         @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST)
1077         @$(call OptionalVarPathSanityCheck,\
1078                 HOTSPOT_IMPORT_PATH,ALT_HOTSPOT_IMPORT_PATH, )



1079 
1080 # Verify hotspot include files
1081 sane-hotspot_import_include: $(TMP_SDK_INCLUDE_FILE_LIST) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1082         @if [ "`$(CAT) $(TMP_SDK_INCLUDE_FILE_DIFFS)`" != "" ]; then \
1083           $(call SanityWarning, \
1084 "Possible HotSpot VM interface conflict.", \
1085 "HOTSPOT_IMPORT_PATH is used to import files from the VM build." \
1086 "It is also used to verify that any copied files are consistent between \
1087  these two components." \
1088 "It has been detected that one or more of the VM interface files inside \
1089  this workspace may not match the interfaces exported by the VM \
1090  or the VM versions could not be found." \
1091 "The list of VM interface files is: \
1092  $(HOTSPOT_INCLUDE_FILE_LIST)." \
1093 "This workspace has copies of these files at: \
1094  $(SHARE_SRC)/javavm/export and $(PLATFORM_SRC)/javavm/export \
1095  for build purposes and they should contain the same interfaces \
1096  as the VM versions imported from:" \
1097 "\$$(HOTSPOT_IMPORT_PATH)/include" \
1098 "(i.e. $(HOTSPOT_IMPORT_PATH)/include)" \
1099 "If an interface indeed doesn't match then the use of this interface \
1100  at JDK runtime could cause serious errors.") ; \
1101             for i in $(TMP_SDK_INCLUDE_FILE_DIFFS); do \
1102                 if [ -s $$i ]; then \
1103                   $(PRINTF) "\n\n%s\n" "VM Interface Differences: $$i" \
1104                     >> $(WARNING_FILE); \
1105                   $(CAT) $$i >> $(WARNING_FILE); \
1106                   $(PRINTF) "\n" >> $(WARNING_FILE); \
1107                 fi; \
1108             done; \
1109         fi
1110         @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1111         @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST)
1112 
1113 # The JDI-SA feature is not currently released on some platforms.
1114 # See the Defs-<arch>.gmk files.
1115 
1116 ifeq ($(INCLUDE_SA), true)
1117 # Verify that hotspot Serviceability Agent files are present.  To keep 
1118 # it simple, we will just check for one of them.  The others have arch 
1119 # dependent paths.
1120 
1121 sane-hotspot_import::
1122         @$(call OptionalVarPathFileSanityCheck,\
1123                 HOTSPOT_IMPORT_PATH,ALT_HOTSPOT_IMPORT_PATH,\
1124                 $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar,\
1125 "The JDI binding for the Serviceability Agent will not be included in the build.")




1126 endif
1127 
1128 ######################################################
1129 # Check the ant version
1130 ######################################################

1131 sane-ant_version:
1132         @$(call VersionSanityCheck,ant,\
1133                 $(ANT_VER),$(REQUIRED_ANT_VER),)





1134 
1135 ######################################################
1136 # Check the zip file version
1137 ######################################################

1138 sane-zip_version: sane-unzip_version
1139         @$(call VersionSanityCheck,zip,\
1140                 $(ZIP_VER),$(REQUIRED_ZIP_VER),)




1141 
1142 ######################################################
1143 # Check the unzip file version
1144 ######################################################

1145 sane-unzip_version:
1146         @$(call VersionSanityCheck,unzip,\
1147                 $(UNZIP_VER),$(REQUIRED_UNZIP_VER),)




1148 
1149 ######################################################
1150 # Check for windows DirectX sdk directory
1151 ######################################################
1152 sane-dxsdk:
1153 ifeq ($(PLATFORM), windows)
1154         @$(call VersionSanityCheck,dxsdk,\
1155                 $(DXSDK_VER),$(REQUIRED_DXSDK_VER),\
1156 $(call BuildReadme,dxsdk))
1157         @$(call VarPathFileSanityCheck,\
1158                 DXSDK_INCLUDE_PATH,ALT_DXSDK_INCLUDE_PATH,\
1159                 $(DXSDK_INCLUDE_PATH)/d3d9.h,\
1160 $(call BuildReadme,dxsdk))
1161         @if [ -r $(DXSDK_INCLUDE_PATH)/basetsd.h ]; then \















1162           if [ `$(EGREP) -c __int3264 $(DXSDK_INCLUDE_PATH)/basetsd.h` -ne 0 ]; then \
1163             $(call SanityWarning, \
1164 "The DirectX SDK Include directory contains a newer basetsd.h \
1165  which may indicate that you're using an incorrect version of DirectX SDK.", \
1166 "This may result in a build failure." \
1167 "The DirectX SDK Include dir was obtained from the following location: \
1168  $(DXSDK_INCLUDE_PATH)" \
1169 $(call BuildReadme,dxsdk))



1170           fi \


1171         fi
1172 endif
1173 
1174 ######################################################
1175 # Check the linker version(s)
1176 ######################################################
1177 sane-link:
1178 ifeq ($(PLATFORM), windows)
1179   ifdef LINK_VER
1180         @$(call SameVersionSanityCheck,link.exe,\
1181                 $(LINK_VER),$(REQUIRED_LINK_VER),\
1182 "To build JDK $(JDK_VERSION) you need \
1183  $(REQUIRED_COMPILER_VERSION) - link.exe version $(REQUIRED_LINK_VER)." \
1184 "Specifically the $(REQUIRED_COMPILER_NAME) link.exe.")
1185   endif
1186 endif














1187 
1188 ######################################################
1189 # Check the compiler version(s)
1190 ######################################################

1191 sane-compiler: sane-link




1192 ifndef OPENJDK
1193         @$(call SameVersionSanityCheck,C/C++ compiler,\
1194                 $(CC_VER),$(REQUIRED_CC_VER), \
1195 "The $(PLATFORM) compiler is not the $(REQUIRED_COMPILER_NAME) compiler." \
1196 "The compiler was obtained from the following location: $(COMPILER_PATH)")
1197 else
1198         @$(call VersionSanityCheck,C/C++ compiler,,\
1199                 $(CC_VER),$(REQUIRED_CC_VER), \
1200 "The $(PLATFORM) compiler is not the $(REQUIRED_COMPILER_NAME) compiler." \
1201 "The compiler was obtained from the following location: $(COMPILER_PATH)")
1202 endif
1203 
1204 ######################################################
1205 # Check that ALSA headers and libs are installed and 
1206 # that the header has the right version. We only
1207 # need /usr/include/alsa/version.h and /usr/lib/libasound.so
1208 ######################################################
1209 



1210 sane-alsa-headers:
1211 ifdef REQUIRED_ALSA_VERSION
1212         @$(call VersionSanityCheck,alsa,\
1213                 $(ALSA_VERSION),$(REQUIRED_ALSA_VERSION), \
1214 "Please install or reinstall the ALSA packages (drivers and lib)." \
1215 $(call BuildReadme,alsa))











1216 endif
1217 
1218 ######################################################
1219 # If a sanity file doesn't exist, just make sure it's dir exists
1220 $(SANITY_FILES):
1221         -@$(prep-target)
1222 
1223 ######################################################
1224 # dump out the variable settings...
1225 ######################################################
1226 sane-settings::
1227         @$(ECHO)  >> $(MESSAGE_FILE)
1228         @$(ECHO) $(ALL_SETTINGS)  >> $(MESSAGE_FILE)
1229         @$(ECHO)  >> $(MESSAGE_FILE)
1230 
1231 ######################################################
1232 # Check for existence of DEPLOY_MSSDK on windows
1233 ######################################################
1234 sane-mssdk_path:
1235 ifeq ($(PLATFORM), windows)
1236         @$(call OptionalVarPathSanityCheck,\
1237                 DEPLOY_MSSDK,ALT_DEPLOY_MSSDK, )










1238 endif
1239 
1240 ######################################################
1241 # Check for existence of INSTALL_MSSDK on windows
1242 ######################################################
1243 sane-install-mssdk_path:
1244 ifeq ($(PLATFORM), windows)
1245         @$(call OptionalVarPathSanityCheck,\
1246                 INSTALL_MSSDK,ALT_INSTALL_MSSDK, )










1247 endif
1248 
1249 ######################################################
1250 # Check for existence of INSTALL_MSIVAL2 on windows
1251 ######################################################
1252 sane-install-msival2_path:
1253 ifeq ($(PLATFORM), windows)
1254         @$(call OptionalVarPathSanityCheck,\
1255                 INSTALL_MSIVAL2,ALT_INSTALL_MSIVAL2, )










1256 endif
1257 
1258 ######################################################
1259 # Check the Solaris GNU c++ compiler for solaris plugin
1260 ######################################################
1261 sane-gcc-compiler:
1262 ifeq ($(PLATFORM), solaris)
1263   ifndef OPENJDK
1264     @if [ -r $(GCC_COMPILER_PATH) ]; then \
1265           if [ ! "$(GCC_VER)" = $(REQUIRED_GCC_VERSION) ]; then \
1266             $(call SanityError, \
1267 "The Solaris GCC compiler version must be $(REQUIRED_GCC_VERSION).", \
1268 "You are using the following compiler version: $(GCC_VER)" \
1269 "The compiler was obtained from the following location: \
1270  $(GCC_COMPILER_PATH)" \
1271 "Please change your compiler.") ; \
1272     fi \
1273         else \
1274           $(call SanityError, \
1275 "You do not have a valid GCC_COMPILER_PATH setting.", \
1276 "Please check your access to $(GCC_COMPILER_PATH) \
1277  and/or check your value of ALT_GCC_COMPILER_PATH." \
1278 "This will affect you if you build the plugin target.") ; \

1279         fi
1280   endif
1281 
1282   ifeq ($(PLATFORM), linux)
1283     ifdef ALT_GCC29_COMPILER_PATH
1284         @if [ ! -x $(ALT_GCC29_COMPILER_PATH)/bin/gcc ]; then \
1285             $(call SanityError, \
1286 "You do not have a valid ALT_GCC29_COMPILER_PATH setting.", \
1287 "Please check your access to $(ALT_GCC29_COMPILER_PATH)/bin/gcc" \
1288 "This will affect you if you build the plugin target.") ; \

1289     fi
1290     endif
1291     ifdef ALT_GCC29_PLUGIN_LIB_PATH
1292         @if [ ! -r $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so ]; then \
1293             $(call SanityError, \
1294 "You do not have a valid ALT_GCC29_PLUGIN_LIB_PATH setting.", \
1295 "Please check your access to \
1296   $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so" \
1297 "This will affect you if you build the plugin target \
1298  specifically for gcc 2.9 version of OJI plugin library.") ; \
1299         fi
1300     else
1301         @$(call VarPathSanityCheck,GCC29_COMPILER_PATH,ALT_GCC29_COMPILER_PATH, \
1302 "This will affect you if you build the plugin target.")






1303     endif
1304   endif
1305 endif
1306 
1307 
1308 ######################################################
1309 # MOZILLA_HEADERS_PATH must be valid
1310 ######################################################
1311 sane-mozilla:
1312 ifeq ($(ARCH_DATA_MODEL), 32)
1313   ifdef ALT_MOZILLA_HEADERS_PATH
1314         @if [ `$(ECHO) $(subst \,/,$(ALT_MOZILLA_HEADERS_PATH)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
1315           $(call SanityError, \
1316 "ALT_MOZILLA_HEADERS_PATH must be an Absolute Path Name not a Relative Path Name.", \
1317 "The current value of ALT_MOZILLA_HEADERS_PATH is $(ALT_MOZILLA_HEADERS_PATH)" \
1318 "Please fix this and continue your build.") ; \


1319         fi
1320   endif



1321   ifeq ($(PLATFORM), windows)
1322         @$(call VarPathFileSanityCheck,\
1323                 MOZILLA_HEADERS_PATH,ALT_MOZILLA_HEADERS_PATH,\
1324                 $(MOZILLA_HEADERS_PATH)/mozilla_headers_18.win32/java/bool.h, \
1325 "Or check your value of ALT_JDK_DEVTOOLS_DIR.")




1326   else
1327         @$(call VarPathFileSanityCheck,\
1328                 MOZILLA_HEADERS_PATH,ALT_MOZILLA_HEADERS_PATH,\
1329                 $(MOZILLA_HEADERS_PATH)/mozilla_headers_18/java/bool.h, \
1330 "Or check your value of ALT_JDK_DEVTOOLS_DIR.")



1331   endif
1332         @$(call VarPathFileSanityCheck,\
1333                 MOZILLA_HEADERS_PATH,ALT_MOZILLA_HEADERS_PATH,\
1334                 $(MOZILLA_HEADERS_PATH)/plugin2_mozilla_headers/npapi.h, \
1335 "Or check your value of ALT_JDK_DEVTOOLS_DIR." \
1336 "This file is needed for plugin2.")





1337 endif
1338 
1339 
1340 ######################################################
1341 # Make sure Java Kernel VM is accessible
1342 ######################################################
1343 sane-kernel-vm:
1344 ifeq ($(PLATFORM), windows)
1345   ifeq ($(ARCH_DATA_MODEL), 32)
1346         @$(call OptionalVarPathFileSanityCheck,\
1347                 HOTSPOT_KERNEL_PATH,ALT_HOTSPOT_IMPORT_PATH,\
1348                 $(HOTSPOT_KERNEL_PATH)/jvm.dll,\
1349 "Your HOTSPOT_IMPORT_PATH does not include a Kernel VM." \
1350 "The kernel installer may not be built (unless hotspot is also).")


1351   endif
1352 endif
1353 
1354 
1355 ######################################################
1356 # SECURITY_BASELINE_131 test
1357 ######################################################
1358 security_baseline_131:
1359 ifeq ($(PLATFORM), windows)
1360         @$(call OptionalVarPathSanityCheck,\
1361                 SECURITY_BASELINE_131,SECURITY_BASELINE_131, )




1362 endif
1363 
1364 ######################################################
1365 # SECURITY_BASELINE_142 test
1366 ######################################################
1367 security_baseline_142:
1368 ifeq ($(PLATFORM), windows)
1369         @$(call OptionalVarPathSanityCheck,\
1370                 SECURITY_BASELINE_142,SECURITY_BASELINE_142, )




1371 endif
1372 
1373 ######################################################
1374 # SECURITY_BASELINE_150 test
1375 ######################################################
1376 security_baseline_150:
1377 ifeq ($(PLATFORM), windows)
1378         @$(call OptionalVarPathSanityCheck,\
1379                 SECURITY_BASELINE_150,SECURITY_BASELINE_150, )




1380 endif
1381 
1382 ######################################################
1383 # SECURITY_BASELINE_160 test
1384 ######################################################
1385 security_baseline_160:
1386 ifeq ($(PLATFORM), windows)
1387         @$(call OptionalVarPathSanityCheck,\
1388                 SECURITY_BASELINE_160,SECURITY_BASELINE_160, )




1389 endif
1390 
1391 
1392 ######################################################
1393 # this should be the last rule in any target's sanity rule.
1394 ######################################################
1395 sane-lastrule:
1396 ifndef EXTERNALSANITYCONTROL
1397         @if [ -r $(MESSAGE_FILE) ]; then \
1398           $(CAT) $(MESSAGE_FILE) ; \
1399         fi
1400         @if [ -r $(WARNING_FILE) ]; then \
1401           $(CAT) $(WARNING_FILE) ; \
1402         fi
1403         @if [ "x$(INSANE)" != x ]; then \
1404           $(PRINTF) "\n%s\n%s\n\n" "INSANE mode requested." \
1405             "Sanity will not force a build termination, even with errors." \
1406             >> $(ERROR_FILE); \
1407         fi
1408         @if [ -r $(ERROR_FILE) ]; then \
1409           if [ "x$(INSANE)" = x ]; then \
1410             $(PRINTF) "\n%s\n\n" "Exiting because of the above error(s)." \
1411               >> $(ERROR_FILE); \
1412           fi ; \
1413           $(CAT) $(ERROR_FILE) ; \
1414           if [ "x$(INSANE)" = x ]; then \
1415             exit 1 ; \
1416           fi ; \
1417         fi
1418 ifdef PEDANTIC
1419         @if [ -r $(WARNING_FILE) ]; then \
1420           $(PRINTF) "\n%s\n%s\n\n" "PEDANTIC mode requested." \
1421             "Exiting because of the above warning(s)." \
1422             >> $(ERROR_FILE); \
1423           $(CAT) $(ERROR_FILE) ; \
1424           exit 1 ; \
1425         fi
1426 endif # PEDANTIC
1427         @if [ ! -r $(ERROR_FILE) ]; then \
1428           $(PRINTF) "\n%s\n" "Sanity check passed." ; \
1429         fi
1430 endif #  EXTERNALSANITYCONTROL
1431