blob: 1dbedb17a75523615c4b1b6f05175589ee4d9760 [file] [log] [blame]
duke6e45e102007-12-01 00:00:00 +00001#
dholmesfba205e2011-03-15 19:52:42 -04002# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
duke6e45e102007-12-01 00:00:00 +00003# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# This code is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 2 only, as
ohair2283b9d2010-05-25 15:58:33 -07007# published by the Free Software Foundation. Oracle designates this
duke6e45e102007-12-01 00:00:00 +00008# particular file as subject to the "Classpath" exception as provided
ohair2283b9d2010-05-25 15:58:33 -07009# by Oracle in the LICENSE file that accompanied this code.
duke6e45e102007-12-01 00:00:00 +000010#
11# This code is distributed in the hope that it will be useful, but WITHOUT
12# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14# version 2 for more details (a copy is included in the LICENSE file that
15# accompanied this code).
16#
17# You should have received a copy of the GNU General Public License version
18# 2 along with this work; if not, write to the Free Software Foundation,
19# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20#
ohair2283b9d2010-05-25 15:58:33 -070021# 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.
duke6e45e102007-12-01 00:00:00 +000024#
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
38SANITY_FILES = $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE)
39
40# How to say "The Release Engineering people use this"
ohair8df39292009-01-31 17:31:21 -080041THE_OFFICIAL_USES=The official builds on $(PLATFORM) use
duke6e45e102007-12-01 00:00:00 +000042
43# How to say "You are using:"
44YOU_ARE_USING=You appear to be using
45
ohair8df39292009-01-31 17:31:21 -080046# Error message
47define SanityError
48$(ECHO) "ERROR: $1\n" >> $(ERROR_FILE)
49endef
50
51# Warning message
52define SanityWarning
53$(ECHO) "WARNING: $1\n" >> $(WARNING_FILE)
54endef
55
56# Official version error message: name version required_version
57define OfficialErrorMessage
58$(call SanityError,\
59$(THE_OFFICIAL_USES) $1 $3. Your $1 $(if $2,undefined,$2) will not work.)
60endef
61
62# Official version warning message: name version required_version
63define OfficialWarningMessage
64$(call SanityWarning,\
65$(THE_OFFICIAL_USES) $1 $3. $(YOU_ARE_USING) $1 $2.)
66endef
67
68
duke6e45e102007-12-01 00:00:00 +000069# Settings and rules to validate the JDK build environment.
70
71ifeq ($(PLATFORM), solaris)
ohair8df39292009-01-31 17:31:21 -080072 # What kind of system we are using (Variations are Solaris and OpenSolaris)
73 OS_VERSION := $(shell uname -r)
74 OS_VARIANT_NAME := $(strip $(shell head -1 /etc/release | awk '{print $$1;}') )
75 OS_VARIANT_VERSION := $(OS_VERSION)
duke6e45e102007-12-01 00:00:00 +000076 REQ_PATCH_LIST = $(JDK_TOPDIR)/make/PatchList.solaris
77 ifeq ($(ARCH_FAMILY), sparc)
78 PATCH_POSITION = $$4
79 else
80 PATCH_POSITION = $$6
81 endif
ohair8df39292009-01-31 17:31:21 -080082 ifndef OPENJDK
83 _GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
84 GCC_VER :=$(call GetVersion,"$(_GCC_VER)")
85 endif
duke6e45e102007-12-01 00:00:00 +000086endif
87
88ifeq ($(PLATFORM), linux)
ohair8df39292009-01-31 17:31:21 -080089 # What kind of system we are using (Variation is the Linux vendor)
90 OS_VERSION := $(shell uname -r)
91 OS_VARIANT_NAME := $(shell \
92 if [ -f /etc/fedora-release ] ; then \
93 echo "Fedora"; \
94 elif [ -f /etc/redhat-release ] ; then \
95 echo "RedHat"; \
96 elif [ -f /etc/SuSE-release ] ; then \
97 echo "SuSE"; \
mduigou1af26382010-12-06 19:37:40 -080098 elif [ -f /etc/lsb-release ] ; then \
99 $(EGREP) DISTRIB_ID /etc/lsb-release | $(SED) -e 's@.*DISTRIB_ID=\(.*\)@\1@'; \
ohair8df39292009-01-31 17:31:21 -0800100 else \
101 echo "Unknown"; \
102 fi)
103 OS_VARIANT_VERSION := $(shell \
104 if [ "$(OS_VARIANT_NAME)" = "Fedora" ] ; then \
105 $(CAT) /etc/fedora-release | $(HEAD) -1 | $(NAWK) '{ print $$3; }' ; \
mduigou1af26382010-12-06 19:37:40 -0800106 elif [ -f /etc/lsb-release ] ; then \
107 $(EGREP) DISTRIB_RELEASE /etc/lsb-release | $(SED) -e 's@.*DISTRIB_RELEASE=\(.*\)@\1@'; \
ohair8df39292009-01-31 17:31:21 -0800108 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) | \
ohair7d709f42011-03-10 14:48:32 -0800112 $(SED) -e 's@.*"\(.*\)".*@\1@' )
ohair8df39292009-01-31 17:31:21 -0800113 ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
duke6e45e102007-12-01 00:00:00 +0000114endif
115
116ifeq ($(PLATFORM), windows)
ohair8df39292009-01-31 17:31:21 -0800117 # Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2
118 # Assume 5.0 (Windows 2000) if systeminfo does not help
119 WINDOWS_MAPPING-5.0 := Windows2000
120 WINDOWS_MAPPING-5.1 := WindowsXP
121 WINDOWS_MAPPING-5.2 := Windows2003
122 # What kind of system we are using (Variation is the common name)
123 _OS_VERSION := \
124 $(shell systeminfo 2> $(DEV_NULL) | \
125 egrep '^OS Version:' | \
126 awk '{print $$3;}' )
127 ifeq ($(_OS_VERSION),)
128 OS_VERSION = 5.0
129 else
ohair82280fd2009-03-16 11:24:06 -0700130 OS_VERSION = $(call MajorVersion,$(_OS_VERSION)).$(call MinorVersion,$(_OS_VERSION))
ohair653661f2008-07-08 09:27:08 -0700131 endif
ohair8df39292009-01-31 17:31:21 -0800132 OS_VARIANT_NAME := $(WINDOWS_MAPPING-$(OS_VERSION))
133 OS_VARIANT_VERSION := $(OS_VERSION)
134 ifdef USING_CYGWIN
135 # CYGWIN version
136 _CYGWIN_VER := $(SYSTEM_UNAME)
137 CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
138 endif
tdvcf2e2232008-07-18 10:48:44 -0700139 DXSDK_VER := $(shell $(EGREP) DIRECT3D_VERSION $(DXSDK_INCLUDE_PATH)/d3d9.h 2>&1 | \
duke6e45e102007-12-01 00:00:00 +0000140 $(EGREP) "\#define" | $(NAWK) '{print $$3}')
141endif
142
143# Get the version numbers of what we are using
144_MAKE_VER :=$(shell $(MAKE) --version 2>&1 | $(HEAD) -n 1)
145_ZIP_VER :=$(shell $(ZIPEXE) -help 2>&1 | $(HEAD) -n 4 | $(EGREP) '^Zip')
146_UNZIP_VER :=$(shell $(UNZIP) -help 2>&1 | $(HEAD) -n 4 | $(EGREP) '^UnZip')
147_BOOT_VER :=$(shell $(BOOTDIR)/bin/java -version 2>&1 | $(HEAD) -n 1)
148MAKE_VER :=$(call GetVersion,"$(_MAKE_VER)")
149ZIP_VER :=$(call GetVersion,"$(_ZIP_VER)")
150UNZIP_VER :=$(call GetVersion,"$(_UNZIP_VER)")
151BOOT_VER :=$(call GetVersion,"$(_BOOT_VER)")
152
ohairc4093c42008-09-10 10:16:54 -0700153_ANT_VER:=$(shell $(ANT) -version 2>&1 )
ohair67d66e12008-03-18 11:08:09 -0700154ANT_VER:=$(call GetVersion,"$(_ANT_VER)")
duke6e45e102007-12-01 00:00:00 +0000155
duke6e45e102007-12-01 00:00:00 +0000156ifdef ALT_BINDIR
157 ALT_BINDIR_VERSION := $(shell $(ALT_BINDIR)/java$(EXE_SUFFIX) -version 2>&1 | $(NAWK) -F'"' '{ print $$2 }')
158 ALT_BINDIR_OK := $(shell $(ECHO) $(ALT_BINDIR_VERSION) | $(EGREP) -c '^$(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)')
159endif
160
161INSTALL_PATCHES_FILE = $(TEMPDIR)/installed.patches
162
163# Get ALL_SETTINGS defined
164include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk
165
166.PHONY: \
167 sane-copyrightyear\
168 sane-settings \
169 sane-insane \
170 sane-build_number \
171 sane-os_version \
172 sane-memory_check \
173 sane-windows \
174 sane-locale \
175 sane-linux \
176 sane-cygwin \
177 sane-cygwin-shell \
178 sane-mks \
179 sane-arch_data_model \
180 sane-os_patch_level \
181 sane-classpath \
182 sane-java_home \
183 sane-fonts \
duke6e45e102007-12-01 00:00:00 +0000184 sane-variant \
185 sane-ld_library_path \
186 sane-ld_library_path_64 \
187 sane-ld_options \
188 sane-ld_run_path \
189 sane-makeflags \
190 sane-alt_outputdir \
191 sane-outputdir \
192 sane-alt_bootdir \
193 sane-bootdir \
anthony14003f02009-05-19 14:43:49 +0400194 sane-local-bootdir \
195 sane-cups \
duke6e45e102007-12-01 00:00:00 +0000196 sane-devtools_path \
197 sane-compiler_path \
198 sane-unixcommand_path \
199 sane-usrbin_path \
200 sane-unixccs_path \
201 sane-docs_import \
202 sane-math_iso \
203 sane-libCrun \
204 sane-odbcdir \
205 sane-msdevtools_path \
206 sane-hotspot_binaries \
207 sane-hotspot_import \
208 sane-hotspot_import_dir \
209 sane-hotspot_import_include \
210 sane-compiler \
211 sane-link \
212 sane-cacerts \
duke6e45e102007-12-01 00:00:00 +0000213 sane-alsa-headers \
214 sane-ant_version \
duke6e45e102007-12-01 00:00:00 +0000215 sane-zip_version \
216 sane-unzip_version \
dholmesfba205e2011-03-15 19:52:42 -0400217 sane-msvcrt_path \
mchungf6cc9302011-03-09 23:11:07 -0800218 sane-freetype
duke6e45e102007-12-01 00:00:00 +0000219
220######################################################
221# check for COPYRIGHT_YEAR variable
222######################################################
223sane-copyrightyear:
224ifdef ALT_COPYRIGHT_YEAR
225 @$(ECHO) "WARNING: ALT_COPYRIGHT_YEAR but not the current year\n" \
226 " will be used for copyright year.\n " \
227 "" >>$(WARNING_FILE)
228endif
229
230######################################################
231# check for INSANE variable
232######################################################
233sane-insane:
234ifdef INSANE
235 @$(ECHO) "WARNING: You are building in 'INSANE' mode. You \n" \
236 " should not use this mode, and in fact, \n" \
237 " it may be removed at any time. If you \n" \
238 " have build problems as a result of using \n" \
239 " INSANE mode, then you should not expect \n" \
240 " assistance from anyone with the problems \n" \
241 " or consequences you experience. \n" \
242 "" >> $(WARNING_FILE)
243endif
244
245######################################################
246# check for GNU Make version
247######################################################
248MAKE_CHECK :=$(call CheckVersions,$(MAKE_VER),$(REQUIRED_MAKE_VER))
249sane-make:
250 @if [ "$(MAKE_CHECK)" != "same" -a "$(MAKE_CHECK)" != "newer" ]; then \
ohair82c95ad2011-01-28 14:32:02 -0800251 $(ECHO) "ERROR: The version of make being used is older than \n" \
duke6e45e102007-12-01 00:00:00 +0000252 " the required version of '$(REQUIRED_MAKE_VER)'. \n" \
253 " The version of make found was '$(MAKE_VER)'. \n" \
ohair82c95ad2011-01-28 14:32:02 -0800254 "" >> $(ERROR_FILE) ; \
duke6e45e102007-12-01 00:00:00 +0000255 fi
256
257######################################################
258# Check the BUILD_NUMBER to make sure it contains bNN
259######################################################
260sane-build_number:
261 @if [ "`$(ECHO) $(BUILD_NUMBER) | $(SED) 's@.*b[0-9][0-9]*.*@bNN@'`" != "bNN" ] ; then \
262 $(ECHO) "WARNING: The BUILD_NUMBER needs to contain b[0-9][0-9]*. Currently BUILD_NUMBER=$(BUILD_NUMBER). \n" \
263 " This has been known to cause build failures. \n" \
264 "" >> $(WARNING_FILE) ; \
265 fi
266
267######################################################
268# Check the ARCH_DATA_MODEL setting
269######################################################
270sane-arch_data_model:
271 @if [ "$(ARCH_DATA_MODEL)" != 32 -a "$(ARCH_DATA_MODEL)" != 64 ]; then \
272 $(ECHO) "ERROR: The setting of ARCH_DATA_MODEL must be 32 or 64.\n" \
273 " $(YOU_ARE_USING) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL). \n" \
274 "" >> $(ERROR_FILE) ; \
275 fi
dholmesfba205e2011-03-15 19:52:42 -0400276ifdef BUILD_CLIENT_ONLY
277 @if [ "$(ARCH_DATA_MODEL)" != 32 ]; then \
278 $(ECHO) "WARNING: You have requested BUILD_CLIENT_ONLY in a 64-bit build.\n" \
279 "" >> $(WARNING_FILE) ; \
280 fi
281endif
duke6e45e102007-12-01 00:00:00 +0000282
283######################################################
mduigou1af26382010-12-06 19:37:40 -0800284# Check the OS version (windows and linux have release name checks)
duke6e45e102007-12-01 00:00:00 +0000285# NOTE: OPENJDK explicitly does not check for OS release information.
286# Unless we know for sure that it will not build somewhere, we cannot
287# generate a fatal sanity error, and a warning about the official
288# build platform just becomes clutter.
289######################################################
ohair8df39292009-01-31 17:31:21 -0800290ifndef OPENJDK
291 OS_VERSION_CHECK := \
292 $(call CheckVersions,$(OS_VERSION),$(REQUIRED_OS_VERSION))
293 ifeq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
294 OS_VARIANT_VERSION_CHECK := \
295 $(call CheckVersions,$(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION))
296 endif
297endif
duke6e45e102007-12-01 00:00:00 +0000298sane-os_version:: sane-arch_data_model sane-memory_check sane-locale sane-os_patch_level
299ifndef OPENJDK
ohair8df39292009-01-31 17:31:21 -0800300 ifneq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
301 ifeq ($(OS_VERSION_CHECK),missing)
302 @$(call OfficialErrorMessage,OS version,$(OS_VERSION),$(REQUIRED_OS_VERSION))
303 endif
304 ifneq ($(OS_VERSION_CHECK),same)
305 @$(call OfficialWarningMessage,OS version,$(OS_VERSION),$(REQUIRED_OS_VERSION))
306 endif
307 @$(call OfficialWarningMessage,OS variant,$(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
308 else
309 ifneq ($(OS_VARIANT_VERSION_CHECK),same)
310 @$(call OfficialWarningMessage,$(OS_VARIANT_NAME) version,$(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION))
311 endif
312 endif
duke6e45e102007-12-01 00:00:00 +0000313endif # OPENJDK
314
315ifeq ($(PLATFORM), windows)
316 sane-os_version:: sane-cygwin sane-mks sane-cygwin-shell
317endif
318
319######################################################
320# Check the memory available on this machine
321######################################################
322sane-memory_check:
323 @if [ "$(LOW_MEMORY_MACHINE)" = "true" ]; then \
324 $(ECHO) "WARNING: This machine appears to only have $(MB_OF_MEMORY)Mb of physical memory, \n" \
325 " builds on this machine could be slow. \n" \
326 "" >> $(WARNING_FILE) ; \
327 fi
328
329######################################################
330# Check the locale (value of LC_ALL, not being empty or ==C can be a problem)
331######################################################
332sane-locale:
333ifneq ($(PLATFORM), windows)
334 @if [ "$(LC_ALL)" != "" -a "$(LC_ALL)" != "C" ]; then \
335 $(ECHO) "WARNING: LC_ALL has been set to $(LC_ALL), this can cause build failures. \n" \
ohair7d709f42011-03-10 14:48:32 -0800336 " Try setting LC_ALL to 'C'. \n" \
duke6e45e102007-12-01 00:00:00 +0000337 "" >> $(WARNING_FILE) ; \
338 fi
339 @if [ "$(LANG)" != "" -a "$(LANG)" != "C" ]; then \
340 $(ECHO) "WARNING: LANG has been set to $(LANG), this can cause build failures. \n" \
ohair7d709f42011-03-10 14:48:32 -0800341 " Try setting LANG to 'C'. \n" \
duke6e45e102007-12-01 00:00:00 +0000342 "" >> $(WARNING_FILE) ; \
343 fi
344endif
345
346######################################################
347# Check the Windows cygwin version
348######################################################
349ifeq ($(PLATFORM), windows)
350 CYGWIN_CHECK :=$(call CheckVersions,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
351sane-cygwin:
352 ifdef USING_CYGWIN
ohair8df39292009-01-31 17:31:21 -0800353 ifeq ($(CYGWIN_CHECK),missing)
354 @$(call OfficialErrorMessage,CYGWIN version,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
355 endif
356 ifeq ($(CYGWIN_CHECK),older)
357 @$(call OfficialWarningMessage,CYGWIN version,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
358 endif
duke6e45e102007-12-01 00:00:00 +0000359 endif
360endif
361
362######################################################
363# Check the cygwin shell is used, not cmd.exe
364######################################################
365ifeq ($(PLATFORM), windows)
366sane-cygwin-shell:
367 ifdef USING_CYGWIN
368 @if [ "$(SHLVL)" = "" -a "$(_)" = "" ]; then \
369 $(ECHO) "ERROR: You are using an unsupported shell. \n" \
370 " Use either sh, bash, ksh, zsh, or tcsh. \n" \
371 " Using the cmd.exe utility is not supported. \n" \
372 " If you still want to try your current shell, \n" \
373 " please export SHLVL=1 when running $(MAKE). \n" \
374 "" >> $(ERROR_FILE) ; \
375 fi
376 endif
377endif
378
379######################################################
380# Check the Windows mks version
381######################################################
382ifeq ($(PLATFORM), windows)
383 MKS_CHECK :=$(call CheckVersions,$(MKS_VER),$(REQUIRED_MKS_VER))
384sane-mks:
385 ifndef USING_CYGWIN
ohair8df39292009-01-31 17:31:21 -0800386 ifeq ($(MKS_CHECK),missing)
387 @$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER))
388 endif
389 ifeq ($(MKS_CHECK),older)
390 @$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER))
391 endif
duke6e45e102007-12-01 00:00:00 +0000392 endif
393endif
394
395######################################################
396# Get list of installed patches (this file has a particular format)
397######################################################
398$(INSTALL_PATCHES_FILE):
399 @$(prep-target)
400ifeq ($(PLATFORM), solaris)
401 ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION))
402 $(SHOWREV) -p > $@ 2>&1
403 endif
404endif
405 @$(ECHO) "" >> $@
406
407######################################################
408# Check list of Solaris patches
409######################################################
410sane-os_patch_level: $(INSTALL_PATCHES_FILE)
411ifeq ($(PLATFORM), solaris)
412 ifeq ($(OS_VERSION),$(REQUIRED_OS_VERSION))
413 @$(NAWK) 'BEGIN { \
414 readingInstallPatches = 0; \
415 requiredCount = 0; \
416 installCount = 0; \
417} \
418{ \
419 if (readingInstallPatches) { \
420 if ($$1=="Patch:") { \
421 ns = split($$2,parts,"-"); \
422 installPatchNo[installCount]=parts[1]; \
423 installPatchRev[installCount]=parts[2]; \
424 installCount++; \
425 } \
426 } \
427 \
428 if (!readingInstallPatches) { \
429 if (index($$1,"#") != 0) continue; \
430 if (match($$1,"BUILD") > 0 \
431 && $$2 == $(OS_VERSION) \
432 && ($$7 == "REQ" || $$7 == "req") \
433 && $(PATCH_POSITION) != "none" \
434 && $(PATCH_POSITION) != "NONE") { \
435 ns = split($(PATCH_POSITION),parts,"-"); \
436 requiredPatchNo[requiredCount]=parts[1]; \
437 requiredPatchRev[requiredCount]=parts[2]; \
438 requiredCount++; \
439 } \
440 } \
441} \
442END { \
443 errorCount=0; \
444 for (i=0; i<requiredCount; i++) { \
445 foundMatch = 0; \
446 for (j=0; j<installCount; j++) { \
447 if (installPatchNo[j] == requiredPatchNo[i] \
448 && installPatchRev[j] >= requiredPatchRev[i]) { \
449 foundMatch = 1; \
450 break; \
451 } \
452 } \
453 if ( foundMatch == 0) { \
454 printf("WARNING: Your solaris install is missing the required patch %s-%s\n", requiredPatchNo[i], requiredPatchRev[i] ); \
455 printf(" Please update your your system patches or build on a different machine.\n\n" ); \
456 errorCount++; \
457 } \
458 } \
459}' $(REQ_PATCH_LIST) readingInstallPatches=1 $(INSTALL_PATCHES_FILE) >> $(WARNING_FILE)
460 endif
461endif # PLATFORM
462
463######################################################
464# CLASSPATH cannot be set, unless you are insane.
465######################################################
466sane-classpath:
467ifdef CLASSPATH
468 @$(ECHO) "ERROR: Your CLASSPATH environment variable is set. This will \n" \
469 " most likely cause the build to fail. Please unset it \n" \
470 " and start your build again. \n" \
471 "" >> $(ERROR_FILE)
472endif
473
474######################################################
475# JAVA_HOME cannot be set, unless you are insane.
476######################################################
477sane-java_home:
478ifdef JAVA_HOME
479 @$(ECHO) "ERROR: Your JAVA_HOME environment variable is set. This will \n" \
480 " most likely cause the build to fail. Please unset it \n" \
481 " and start your build again. \n" \
482 "" >> $(ERROR_FILE)
483endif
484
485######################################################
486# Make sure the fonts are there
487# Exceptions are when explicitly building OPENJDK, or
488# when the entire CLOSED_SRC dir is excluded, so we are
489# implicitly building OPENJDK
490######################################################
491FONT_FILE=$(CLOSED_SRC)/share/lib/fonts/LucidaTypewriterRegular.ttf
492sane-fonts:
493ifndef OPENJDK
494 @if [ -d $(CLOSED_SRC) ] ; then \
495 if [ ! -f $(FONT_FILE) ] ; then \
496 $(ECHO) "ERROR: Missing $(FONT_FILE). \n" \
497 " Verify you have downloaded and overlayed on the source area all the binary files. \n" \
498 "" >> $(ERROR_FILE); \
499 fi \
500 fi
501endif
502
503######################################################
duke6e45e102007-12-01 00:00:00 +0000504# VARIANT must be set to DBG or OPT
505######################################################
506sane-variant:
507 @if [ "$(VARIANT)" != DBG -a "$(VARIANT)" != OPT ] ; then \
508 $(ECHO) "ERROR: Your VARIANT environment variable is set to $(VARIANT). \n" \
509 " Needs to be set to DBG or OPT \n" \
510 "" >> $(ERROR_FILE); \
511 fi
512
513######################################################
514# LD_LIBRARY_PATH should not be set, unless you are insane.
515######################################################
516sane-ld_library_path:
517ifdef LD_LIBRARY_PATH
518 @$(ECHO) "ERROR: Your LD_LIBRARY_PATH environment variable is set. This may \n" \
519 " produce binaries binaries incorrectly. Please unset it \n" \
520 " and start your build again. \n" \
521 "" >> $(ERROR_FILE)
522endif
523
524######################################################
525# LD_LIBRARY_PATH_64 should not be set, unless you are insane.
526######################################################
527sane-ld_library_path_64:
528ifdef LD_LIBRARY_PATH_64
529 @$(ECHO) "ERROR: Your LD_LIBRARY_PATH_64 environment variable is set. This may \n" \
530 " produce binaries binaries incorrectly. Please unset it \n" \
531 " and start your build again. \n" \
532 "" >> $(ERROR_FILE)
533endif
534
535######################################################
536# LD_OPTIONS should not be set, unless you are insane.
537######################################################
538sane-ld_options:
539ifdef LD_OPTIONS
540 @$(ECHO) "ERROR: Your LD_OPTIONS environment variable is set. This may \n" \
541 " produce binaries binaries incorrectly. Please unset it \n" \
542 " and start your build again. \n" \
543 "" >> $(ERROR_FILE)
544endif
545
546######################################################
547# LD_RUN_PATH should not be set, unless you are insane.
548######################################################
549sane-ld_run_path:
550ifdef LD_RUN_PATH
551 @$(ECHO) "ERROR: Your LD_RUN_PATH environment variable is set. This may \n" \
552 " produce binaries binaries incorrectly. Please unset it \n" \
553 " produce binaries binaries incorrectly. Please unset it \n" \
554 " and start your build again. \n" \
555 "" >> $(ERROR_FILE)
556endif
557
558######################################################
559# MAKEFLAGS cannot be set, unless you are insane.
560######################################################
561ifeq ($(PLATFORM), windows)
562ifdef USING_CYGWIN
563REAL_MAKEFLAGS:=$(subst --unix,,$(MAKEFLAGS))
564else
565REAL_MAKEFLAGS:=$(MAKEFLAGS)
566endif
567else
568REAL_MAKEFLAGS:=$(MAKEFLAGS)
569endif
570sane-makeflags:
571# ifneq ($(strip $(REAL_MAKEFLAGS)),)
572ifeq ($(origin MAKEFLAGS),environment)
573 @#
574 @# it is unacceptable to have the-e or --environment-overrides value in MAKEFLAGS
575 @#
576 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(e|--environment-overrides)( |$$)'` -ne 0 ]; then \
577 $(ECHO) "ERROR: Either the build was started with the flag -e or \n" \
578 " --environment-overrides, or the MAKEFLAGS environment \n" \
579 " variable has this value set. This will cause any \n" \
580 " environment variables you have defined to override \n" \
581 " the values defined by the makefiles. This practice is \n" \
582 " not recommemded by the authors of GNU Make, and \n" \
583 " will lead to an improper build. \n" \
584 " Please fix and restart the build. \n" \
585 "" >> $(ERROR_FILE) ; \
586 fi
587 @#
588 @# it is unacceptable to havethe -i or --ignore-errors value in MAKEFLAGS
589 @#
590 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(i|--ignore-errors)( |$$)'` -ne 0 ]; then \
591 $(ECHO) "ERROR: Either the build was started with the flag -i or \n" \
592 " --ignore-errors, or the MAKEFLAGS environment \n" \
593 " variable has this value set. 1111 You will be unable \n" \
594 " to determine if the build is broken or not. \n" \
595 " Please fix and restart the build. \n" \
596 "" >> $(ERROR_FILE) ; \
597 fi
598 @#
599 @# it is unacceptable to have the -I or --include-dir value in MAKEFLAGS
600 @#
601 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(I|--include-dir)( |$$)'` -ne 0 ]; then \
602 $(ECHO) "ERROR: Either the build was started with the flag -I or \n" \
603 " --include-dir, or the MAKEFLAGS environment \n" \
604 " variable has this value set. This will render your \n" \
605 " build questionable as not all the rules and depenencies \n" \
606 " are captured by the build. \n" \
607 " Please fix and restart the build. \n" \
608 "" >> $(ERROR_FILE) ; \
609 fi
610 @#
611 @# it is unacceptable to have the -k or --keep-going value in MAKEFLAGS:
612 @#
613 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(k|--keep-going)( |$$)'` -ne 0 ]; then \
614 $(ECHO) "ERROR: Either the build was started with the flag -k or \n" \
615 " --keep-going, or the MAKEFLAGS environment \n" \
616 " variable has this value set. 222 You will be unable \n" \
617 " to determine if the build is broken or not. \n" \
618 " Please fix and restart the build. \n" \
619 "" >> $(ERROR_FILE) ; \
620 fi
621 @#
622 @# it is unacceptable to have the -o or --assume-old or --old-filevalue in MAKEFLAGS:
623 @# Note - this rule never gets invoked because it is processed out
624 @# in GNU Make startup
625 @#
626 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(o|--assume-old|--old-file)( |$$)'` -ne 0 ]; then \
627 $(ECHO) "ERROR: Either the build was started with the flag -o or \n" \
628 " --assume-old or --old-file, or the MAKEFLAGS environment \n" \
629 " variable has this value set. This could prevent the \n" \
630 " build from executing rules it should, thus rendering a \n" \
631 " questionable result. \n" \
632 " Please fix and restart the build. \n" \
633 "" >> $(ERROR_FILE) ; \
634 fi
635 @#
636 @# it is unacceptable to have the -r or --nobuiltin-rules value in MAKEFLAGS
637 @#
638 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(r|--no-builtin-rules)( |$$)'` -ne 0 ]; then \
639 $(ECHO) "ERROR: Either the build was started with the flag -r or \n" \
640 " --no-builtin-rules, or the MAKEFLAGS environment \n" \
641 " variable has this value set. This may break the build \n" \
642 " by not allowing builtin rules that may be required. \n" \
643 " Please fix and restart the build. \n" \
644 "" >> $(ERROR_FILE) ; \
645 fi
646 @#
647 @# it is unacceptable to have the -t or --touch value in MAKEFLAGS
648 @# Note - this rule never gets invoked because it is processed out
649 @# in GNU Make startup
650 @#
651 @if [ `$(ECHO) $(MAKEFLAGS) | $(EGREP) -c '(^| )(t|--touch)( |$$)'` -ne 0 ]; then \
652 $(ECHO) "ERROR: Either the build was started with the flag -t or \n" \
653 " --touch, or the MAKEFLAGS environment \n" \
654 " variable has this value set. This will leave the \n" \
655 " build in a unclear state and could lead to not executing \n" \
656 " rules which should be executed. \n" \
657 " Please fix and restart the build. \n" \
658 "" >> $(ERROR_FILE) ; \
659 fi
660 @#
661 @# show what is in MAKEFLAGS so the user is aware...
662 @#
663 @$(ECHO) "WARNING: Your MAKEFLAGS environment variable is set. \n" \
664 " You should be very careful about the values set here. \n" \
665 "\n" \
666 " MAKEFLAGS is set to =>$(MAKEFLAGS)<= \n" \
667 "" >> $(WARNING_FILE)
668endif
669
670######################################################
671# if specified, ALT_OUTPUTDIR must point to non-relative path if set
672######################################################
673sane-alt_outputdir:
674ifdef ALT_OUTPUTDIR
ohair5dfae9b2010-03-03 11:29:44 -0800675 @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
duke6e45e102007-12-01 00:00:00 +0000676 $(ECHO) "ERROR: ALT_OUTPUTDIR must be an Absolute Path Name, \n" \
677 " not a Relative Path Name. \n" \
678 "" >> $(ERROR_FILE) ; \
679 fi
680 ifeq ($(PLATFORM), windows)
ohair5dfae9b2010-03-03 11:29:44 -0800681 @if [ `$(ECHO) $(subst \,/,$(ALT_OUTPUTDIR)) | $(EGREP) -c '^([A-Za-z]:)'` -ne 1 ]; then \
duke6e45e102007-12-01 00:00:00 +0000682 $(ECHO) "ERROR: On windows, ALT_OUTPUTDIR must contain the drive letter. \n" \
683 "" >> $(ERROR_FILE) ; \
684 fi
685 endif
686endif
687
688######################################################
689# OUTPUTDIR tests
690######################################################
691sane-outputdir:
692 @#
693 @# OUTPUTDIR must be a directory...
694 @#
695 @if [ ! -d "$(OUTPUTDIR)" ]; then \
696 $(ECHO) "ERROR: OUTPUTDIR must be an existing directory. The current \n" \
697 " value of OUTPUTDIR is \n" \
698 " $(OUTPUTDIR) \n" \
699 " Please check your value of ALT_OUTPUTDIR. \n" \
700 "" >> $(ERROR_FILE) ; \
701 fi
702 @#
703 @# OUTPUTDIR must be writeable by user...
704 @#
705 @if [ ! -w "$(OUTPUTDIR)" ]; then \
706 $(ECHO) "ERROR: You must have write permissions to OUTPUTDIR. The \n" \
707 " current value of OUTPUTDIR is \n" \
708 " $(OUTPUTDIR) \n" \
709 " Either obtain these permissions or set ALT_OUTPUTDIR. \n" \
710 "" >> $(ERROR_FILE) ; \
711 fi
duke6e45e102007-12-01 00:00:00 +0000712
713######################################################
714# if specified, ALT_BOOTDIR must point to non-relative path if set
715######################################################
716sane-alt_bootdir:
717ifdef ALT_BOOTDIR
ohair5dfae9b2010-03-03 11:29:44 -0800718 @if [ `$(ECHO) $(subst \,/,$(ALT_BOOTDIR)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
duke6e45e102007-12-01 00:00:00 +0000719 $(ECHO) "ERROR: ALT_BOOTDIR must be an Absolute Path Name, \n" \
720 " not a Relative Path Name. \n" \
721 " The current value of ALT_BOOTDIR is \n" \
722 " $(ALT_BOOTDIR) \n" \
723 " Please fix this and continue your build. \n" \
724 "" >> $(ERROR_FILE) ; \
725 fi
726endif
727
728######################################################
729# BOOTDIR must point to a valid JDK.
730######################################################
731BOOT_CHECK :=$(call CheckVersions,$(BOOT_VER),$(REQUIRED_BOOT_VER))
732sane-bootdir:
733 @if [ "$(BOOT_CHECK)" != "same" -a "$(BOOT_CHECK)" != "newer" ]; then \
734 $(ECHO) "ERROR: Your BOOTDIR environment variable does not point \n" \
735 " to a valid JDK for bootstrapping this build. \n" \
736 " A JDK $(JDK_MINOR_VERSION) $(MARKET_NAME) build must be bootstrapped using \n" \
737 " JDK $(PREVIOUS_JDK_VERSION) fcs (or later). \n" \
738 " Apparently, your bootstrap JDK is version $(BOOT_VER) \n" \
739 " Please update your ALT_BOOTDIR setting and start your build again. \n" \
740 "" >> $(ERROR_FILE) ; \
741 fi
742
743######################################################
anthony14003f02009-05-19 14:43:49 +0400744# BOOTDIR is recommended to reside on a local drive
745######################################################
746sane-local-bootdir:
747ifeq ($(PLATFORM), windows)
ohair5dfae9b2010-03-03 11:29:44 -0800748 @if [ `$(ECHO) $(BOOTDIR) | $(EGREP) -c '^[jJ]:'` -ne 0 ]; then \
anthony14003f02009-05-19 14:43:49 +0400749 $(ECHO) "WARNING: Your BOOTDIR is located on the J: drive. Often the J:\n" \
750 " drive is mapped over a network. Using a mapped drive for\n" \
751 " the BOOTDIR may significantly slow down the build process.\n" \
752 " You may want to consider using the ALT_BOOTDIR variable\n" \
753 " to point the build to another location for the BOOTDIR instead. \n" \
754 " Your current BOOTDIR is:\n" \
755 " $(BOOTDIR) \n" \
756 "" >> $(WARNING_FILE) ; \
757 fi
758endif
759
760######################################################
duke6e45e102007-12-01 00:00:00 +0000761# CACERTS_FILE must be absoulte path and readable
762######################################################
763sane-cacerts:
764 ifdef ALT_CACERTS_FILE
ohair5dfae9b2010-03-03 11:29:44 -0800765 @if [ `$(ECHO) $(subst \,/,$(ALT_CACERTS_FILE)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
duke6e45e102007-12-01 00:00:00 +0000766 $(ECHO) "ERROR: ALT_CACERTS_FILE must be an Absolute Path Name, \n" \
767 " not a Relative Path Name. \n" \
768 " The current value of ALT_CACERTS_FILE is \n" \
769 " $(ALT_CACERTS_FILE) \n" \
770 " Please fix this and continue your build. \n" \
771 "" >> $(ERROR_FILE) ; \
772 fi
773 endif
774 @#
775 @# CACERTS_FILE must be readable
776 @#
777 @if [ ! -r "$(subst \,/,$(CACERTS_FILE))" ]; then \
778 $(ECHO) "ERROR: You do not have access to a valid cacerts file. \n" \
779 " Please check your access to \n" \
780 " $(subst \,/,$(CACERTS_FILE)) \n" \
781 " and/or check your value of ALT_CACERTS_FILE. \n" \
782 "" >> $(ERROR_FILE) ; \
783 fi
784 @#
785 @# CACERTS_FILE must be a file
786 @#
787 @if [ -d "$(subst \,/,$(CACERTS_FILE))" ]; then \
788 $(ECHO) "ERROR: You do not have access to a valid cacerts file.\n" \
789 " The value of CACERTS_FILE must point to a normal file.\n" \
790 " Please check your access to \n" \
791 " $(subst \,/,$(CACERTS_FILE)) \n" \
792 " and/or check your value of ALT_CACERTS_FILE. \n" \
793 "" >> $(ERROR_FILE) ; \
794 fi
795
796
797######################################################
798# Check for availability of FreeType (OpenJDK specific)
799######################################################
800
801ifdef OPENJDK
dholmes70a4d1a2011-03-16 18:54:50 -0400802 ifndef CROSS_COMPILE_ARCH
803 # The freetypecheck Makefile prints out "Failed" if not good enough
804 $(TEMPDIR)/freetypeinfo: FRC
ohaird71c3922008-03-31 17:17:18 -0700805 @$(prep-target)
806 @(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
807 $(ECHO) "Failed to build freetypecheck." ) > $@
duke6e45e102007-12-01 00:00:00 +0000808
dholmes70a4d1a2011-03-16 18:54:50 -0400809 sane-freetype: $(TEMPDIR)/freetypeinfo
ohaird71c3922008-03-31 17:17:18 -0700810 @if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
duke6e45e102007-12-01 00:00:00 +0000811 $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
ohaird71c3922008-03-31 17:17:18 -0700812 " or higher is required. \n" \
813 "`$(CAT) $<` \n" >> $(ERROR_FILE) ; \
duke6e45e102007-12-01 00:00:00 +0000814 fi
dholmes70a4d1a2011-03-16 18:54:50 -0400815 else
816 #do nothing (cross-compiling)
817 sane-freetype:
818 endif
duke6e45e102007-12-01 00:00:00 +0000819else
dholmes70a4d1a2011-03-16 18:54:50 -0400820 #do nothing (not OpenJDK)
821 sane-freetype:
duke6e45e102007-12-01 00:00:00 +0000822endif
823
824######################################################
825# CUPS_HEADERS_PATH must be valid
826######################################################
827sane-cups:
828ifneq ($(PLATFORM), windows)
829 @if [ ! -r $(CUPS_HEADERS_PATH)/cups/cups.h ]; then \
830 $(ECHO) "ERROR: You do not have access to valid Cups header files. \n" \
831 " Please check your access to \n" \
832 " $(CUPS_HEADERS_PATH)/cups/cups.h \n" \
833 " and/or check your value of ALT_CUPS_HEADERS_PATH, \n" \
834 " CUPS is frequently pre-installed on many systems, \n" \
835 " or may be downloaded from http://www.cups.org \n" \
836 "" >> $(ERROR_FILE) ; \
837 fi
838endif
839
840######################################################
841# Check for existence of DEVTOOLS_PATH
842######################################################
843sane-devtools_path:
844 @if [ "$(DEVTOOLS_PATH)" != "" -a ! -r "$(DEVTOOLS_PATH)" ]; then \
845 $(ECHO) "ERROR: You do not have a valid DEVTOOLS_PATH setting. \n" \
846 " Please check your access to \n" \
847 " $(DEVTOOLS_PATH) \n" \
848 " and/or check your value of ALT_DEVTOOLS_PATH. \n" \
849 "" >> $(ERROR_FILE) ; \
850 fi
851
852######################################################
853# Check for existence of MS_RUNTIME_LIBRARIES
854######################################################
855sane-msvcrt_path:
856ifeq ($(PLATFORM), windows)
ohair82280fd2009-03-16 11:24:06 -0700857 ifneq ($(MSVCRNN_DLL),)
tbellfc2a6fe2009-01-14 21:35:03 -0800858 @if [ ! -r "$(MSVCRNN_DLL_PATH)/$(MSVCRNN_DLL)" ]; then \
859 $(ECHO) "ERROR: You do not have access to $(MSVCRNN_DLL). \n" \
duke6e45e102007-12-01 00:00:00 +0000860 " Please check your access to \n" \
tbellfc2a6fe2009-01-14 21:35:03 -0800861 " $(MSVCRNN_DLL_PATH) \n" \
862 " and/or check your value of ALT_MSVCRNN_DLL_PATH. \n" \
duke6e45e102007-12-01 00:00:00 +0000863 "" >> $(ERROR_FILE) ; \
864 fi
duke6e45e102007-12-01 00:00:00 +0000865 endif
866endif
867
868######################################################
869# Check for existence of COMPILER_PATH
870######################################################
871sane-compiler_path:
872 @if [ "$(COMPILER_PATH)" != "" -a ! -r "$(COMPILER_PATH)" ]; then \
873 $(ECHO) "ERROR: You do not have a valid COMPILER_PATH setting. \n" \
874 " Please check your access to \n" \
875 " $(COMPILER_PATH) \n" \
876 " and/or check your value of ALT_COMPILER_PATH. \n" \
877 "" >> $(ERROR_FILE) ; \
878 fi
879
880######################################################
881# Check for existence of UNIXCOMMAND_PATH
882######################################################
883sane-unixcommand_path:
884 @if [ "$(UNIXCOMMAND_PATH)" != "" -a ! -r "$(UNIXCOMMAND_PATH)" ]; then \
885 $(ECHO) "ERROR: You do not have a valid UNIXCOMMAND_PATH setting. \n" \
886 " Please check your access to \n" \
887 " $(UNIXCOMMAND_PATH) \n" \
888 " and/or check your value of ALT_UNIXCOMMAND_PATH. \n" \
889 "" >> $(ERROR_FILE) ; \
890 fi
891ifeq ($(PLATFORM), windows)
892 @for utility in cpio ar file m4 ; do \
893 if [ ! -r "`$(WHICH) $${utility}`" ]; then \
894 $(ECHO) "WARNING: You do not have the utility $${utility} in the \n" \
895 " directory $(UNIXCOMMAND_PATH). \n" \
896 " The utilities cpio, ar, file, and m4 are required. \n" \
897 "" >> $(WARNING_FILE) ; \
898 fi; \
899 done
900endif
901
902######################################################
903# Check for existence of USRBIN_PATH on linux
904######################################################
905sane-usrbin_path:
906ifeq ($(PLATFORM), linux)
907 @if [ "$(USRBIN_PATH)" != "" -a ! -r "$(USRBIN_PATH)" ]; then \
908 $(ECHO) "ERROR: You do not have a valid USRBIN_PATH setting. \n" \
909 " Please check your access to \n" \
910 " $(USRBIN_PATH) \n" \
911 " and/or check your value of ALT_USRBIN_PATH. \n" \
912 "" >> $(ERROR_FILE) ; \
913 fi
914endif
915
916######################################################
917# Check for existence of UNIXCCS_PATH on solaris
918######################################################
919sane-unixccs_path:
920ifeq ($(PLATFORM), solaris)
921 @if [ "$(UNIXCCS_PATH)" != "" -a ! -r "$(UNIXCCS_PATH)" ]; then \
922 $(ECHO) "ERROR: You do not have a valid UNIXCCS_PATH setting. \n" \
923 " Please check your access to \n" \
924 " $(UNIXCCS_PATH) \n" \
925 " and/or check your value of ALT_UNIXCCS_PATH. \n" \
926 "" >> $(ERROR_FILE) ; \
927 fi
928endif
929
930######################################################
931# Verify the docs directory exists
932######################################################
933sane-docs_import:
934 @if [ ! -d "$(HOTSPOT_DOCS_IMPORT_PATH)" ]; then \
935 $(ECHO) "WARNING: The directory HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_DOCS_IMPORT_PATH) \n" \
936 " does not exist, check your value of ALT_HOTSPOT_DOCS_IMPORT_PATH. \n" \
937 "" >> $(WARNING_FILE) ; \
938 fi
939
940######################################################
941# Check for possible problem regarding __fabsf, math_iso.h and the libm patch.
942# Hotspot should have been changed in Mustang 6.0 Build 47 to not depend
943# on __fabsf, this is just checking that fact now.
944######################################################
945sane-math_iso:
946ifeq ($(PLATFORM), solaris)
947 @if [ -f $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
948 if [ "`$(NM) $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) | $(GREP) __fabsf`" != "" ]; then \
949 $(ECHO) "WARNING: This version of hotspot relies on __fabsf \n" \
950 " which is not always available on Solaris 8 and 9 machines \n" \
951 " unless they have the latest libm patch and the file \n" \
952 " /usr/include/iso/math_iso.h which can trigger this dependency.\n" \
953 " Hotspot should NOT be dependent on this extern, check the \n" \
954 " version of the hotspot library you are using. \n" \
955 "" >> $(WARNING_FILE) ; \
956 fi; \
957 fi
958endif
959
960######################################################
961# Check for possible patch problem regarding /usr/lib/libCrun.so
962######################################################
963sane-libCrun:
964ifeq ($(PLATFORM), solaris)
965 @if [ "`$(NM) /usr/lib/libCrun.so.1 | $(GREP) __1c2n6FIpv_0_`" = "" ]; then \
966 $(ECHO) "WARNING: The file /usr/lib/libCrun.so.1 is missing the extern \n" \
967 " __1c2n6FIpv_0_ which indicates that the system is missing \n" \
968 " a required Solaris patch, or you are using a pre-FCS release \n" \
969 " of Solaris 10. You need the latest /usr/lib/libCrun.so.1 \n" \
970 " which comes with the FCS release of Solaris 10 and available \n" \
971 " through the latest Solaris 8 or 9 C++ runtime patches. \n" \
972 "" >> $(WARNING_FILE) ; \
973 fi
974endif
975
976######################################################
ohair3ae113d2010-12-21 18:21:26 -0800977# Check for existence of the extra tools on windows
duke6e45e102007-12-01 00:00:00 +0000978######################################################
979sane-msdevtools_path:
980ifeq ($(PLATFORM), windows)
ohair86070d72011-03-29 11:29:01 -0700981 ifeq ($(wildcard $(RC)),)
ohair67e0bbf2011-01-05 14:28:58 -0800982 @$(ECHO) "ERROR: Cannot find the RC utility from path: $(RC)\n" \
983 " This is normally obtained from the WINDOWSSDKDIR." \
984 "" >> $(ERROR_FILE)
ohair86070d72011-03-29 11:29:01 -0700985 endif
986 ifeq ($(wildcard $(DUMPBIN)),)
ohair67e0bbf2011-01-05 14:28:58 -0800987 @$(ECHO) "ERROR: Cannot find the DUMPBIN utility from path: $(DUMPBIN)\n" \
ohair01a6ecc2011-03-02 13:18:36 -0800988 " This is normally obtained from the COMPILER_PATH." \
ohair67e0bbf2011-01-05 14:28:58 -0800989 "" >> $(ERROR_FILE)
ohair3ae113d2010-12-21 18:21:26 -0800990 endif
duke6e45e102007-12-01 00:00:00 +0000991endif
992
993######################################################
994# Check for existence of Hotspot binaries
995######################################################
996sane-hotspot_binaries:
997ifeq ($(ARCH_DATA_MODEL), 32)
998 @if [ ! -r $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
999 $(ECHO) "ERROR: HOTSPOT_CLIENT_PATH does not point to a valid HotSpot VM. \n" \
1000 " Please check your access to \n" \
1001 " $(HOTSPOT_CLIENT_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) \n" \
1002 " and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \
1003 "" >> $(ERROR_FILE) ; \
1004 fi
1005endif
1006 @if [ ! -r $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) ]; then \
1007 $(ECHO) "ERROR: HOTSPOT_SERVER_PATH does not point to a valid HotSpot VM. \n" \
1008 " Please check your access to \n" \
1009 " $(HOTSPOT_SERVER_PATH)/$(LIB_PREFIX)jvm.$(LIBRARY_SUFFIX) \n" \
1010 " and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \
1011 "" >> $(ERROR_FILE) ; \
1012 fi
1013 @#
1014 @# Check value of HOTSPOT_LIB_PATH
1015 @#
1016ifeq ($(PLATFORM), windows)
1017 @if [ ! -r $(HOTSPOT_LIB_PATH)/jvm.lib ]; then \
1018 $(ECHO) "ERROR: HOTSPOT_LIB_PATH does not point to a valid HotSpot library. \n" \
1019 " Please check your access to \n" \
1020 " $(HOTSPOT_LIB_PATH)/jvm.lib \n" \
1021 " and/or check your value of ALT_HOTSPOT_LIB_PATH. \n" \
1022 "" >> $(ERROR_FILE) ; \
1023 fi
1024 @#
1025 @# Check for the .map files - its OK if they are not there..
1026 @#
1027 ifeq ($(ARCH_DATA_MODEL), 32)
1028 @# There is no 64-bit HotSpot client VM
1029 @if [ ! -r $(HOTSPOT_CLIENT_PATH)/jvm.map ]; then \
1030 $(ECHO) "WARNING: HOTSPOT_CLIENT_PATH does not point to valid HotSpot .map files. \n" \
1031 " These files are optional and aid in the debugging of the JVM. \n" \
1032 " Please check your access to \n" \
1033 " $(HOTSPOT_CLIENT_PATH)/jvm.map \n" \
1034 " and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \
1035 "" >> $(WARNING_FILE) ; \
1036 fi
1037 @if [ ! -r $(HOTSPOT_CLIENT_PATH)/jvm.pdb ]; then \
1038 $(ECHO) "WARNING: HOTSPOT_CLIENT_PATH does not point to valid HotSpot .pdb files. \n" \
1039 " These files are optional and aid in the debugging of the JVM. \n" \
1040 " Please check your access to \n" \
1041 " $(HOTSPOT_CLIENT_PATH)/jvm.pdb \n" \
1042 " and/or check your value of ALT_HOTSPOT_CLIENT_PATH. \n" \
1043 "" >> $(WARNING_FILE) ; \
1044 fi
1045 endif
1046 @if [ ! -r $(HOTSPOT_SERVER_PATH)/jvm.map ]; then \
1047 $(ECHO) "WARNING: HOTSPOT_SERVER_PATH does not point to valid HotSpot .map files. \n" \
1048 " These files are optional and aid in the debugging of the JVM. \n" \
1049 " Please check your access to \n" \
1050 " $(HOTSPOT_SERVER_PATH)/jvm.map \n" \
1051 " and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \
1052 "" >> $(WARNING_FILE) ; \
1053 fi
1054 @if [ ! -r $(HOTSPOT_SERVER_PATH)/jvm.pdb ]; then \
1055 $(ECHO) "WARNING: HOTSPOT_SERVER_PATH does not point to valid HotSpot .pdb files. \n" \
1056 " These files are optional and aid in the debugging of the JVM. \n" \
1057 " Please check your access to \n" \
1058 " $(HOTSPOT_SERVER_PATH)/jvm.pdb \n" \
1059 " and/or check your value of ALT_HOTSPOT_SERVER_PATH. \n" \
1060 "" >> $(WARNING_FILE) ; \
1061 fi
1062endif
1063
1064
1065######################################################
1066# Check for existence of misc Hotspot imported files
1067######################################################
1068HOTSPOT_INCLUDE_FILE_LIST = jvmti.h
dcubed861f7322010-01-20 12:09:31 -07001069HOTSPOT_INCLUDE_FILE_LIST += jvmticmlr.h
duke6e45e102007-12-01 00:00:00 +00001070#HOTSPOT_INCLUDE_FILE_LIST += jni.h jni_md.h
1071#HOTSPOT_INCLUDE_FILE_LIST += jvm.h jvm_md.h
1072#HOTSPOT_INCLUDE_FILE_LIST += jmm.h
1073TMP_SDK_INCLUDE_FILE_LIST=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.h)
1074TMP_SDK_INCLUDE_FILE_DIFFS=$(HOTSPOT_INCLUDE_FILE_LIST:%.h=$(TEMPDIR)/%.hdiffs)
1075
1076# These include files must have a pattern: 'version: MAJOR.MINOR.MICRO'
1077# where MACRO, MINOR, and MICRO are numbers, e.g. 1.0.1, 0.2.90, etc.
1078# The critical version we are checking is MAJOR.MINOR, we print all three
1079# when we detect an error.
1080
1081TMP_SDK_INCLUDE_FIND_VERSION= $(EGREP) 'version:'
1082TMP_SDK_INCLUDE_GET_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
1083 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\)\.[0-9].*@\1@'
1084TMP_SDK_INCLUDE_GET_FULL_VERSION= $(TMP_SDK_INCLUDE_FIND_VERSION) | \
1085 $(SED) -e 's@.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*@\1@'
1086
1087# Compare an interface file (Rule creates 2 temp files: %.h and %.h.IMPORT)
1088# Files jvm.h, jvm_md.h and jmm.h are special in that they are not publicly
1089# exported but do represent VM interfaces used by the rest of the jdk.
1090# So these 3 will not be found in a promoted build and can only
1091# be checked when this represents a full control build (i.e. the
1092# HOTSPOT_IMPORT_PATH includes these files in it's 'include' directory).
1093$(TEMPDIR)/%.h: $(SHARE_SRC)/javavm/export/%.h
mchungf6cc9302011-03-09 23:11:07 -08001094 @$(install-file)
duke6e45e102007-12-01 00:00:00 +00001095 @$(RM) $@.IMPORT
1096 @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(@F) ]; then \
1097 $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(@F) $@.IMPORT ; \
1098 elif [ "$(@F)" != "jvm.h" -a "$(@F)" != "jmm.h" ] ; then \
1099 $(ECHO) "WARNING: HOTSPOT_IMPORT_PATH does not contain the interface file $(@F). \n" \
1100 " Check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1101 "" >> $(WARNING_FILE) ; \
1102 $(CP) $< $@.IMPORT; \
1103 else \
1104 $(CP) $< $@.IMPORT; \
1105 fi
1106
1107$(TEMPDIR)/%.h: $(PLATFORM_SRC)/javavm/export/%.h
mchungf6cc9302011-03-09 23:11:07 -08001108 @$(install-file)
duke6e45e102007-12-01 00:00:00 +00001109 @$(RM) $@.IMPORT
1110 @if [ -r $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) ]; then \
1111 $(CP) $(HOTSPOT_IMPORT_PATH)/include/$(PLATFORM_INCLUDE_NAME)/$(@F) $@.IMPORT ; \
1112 elif [ "$(@F)" != "jvm_md.h" ] ; then \
1113 $(ECHO) "WARNING: HOTSPOT_IMPORT_PATH does not contain the interface file $(@F). \n" \
1114 " Check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1115 "" >> $(WARNING_FILE) ; \
1116 $(CP) $< $@.IMPORT; \
1117 else \
1118 $(CP) $< $@.IMPORT; \
1119 fi
1120
1121# Compares the two tempfiles: %.h and %.h.IMPORT, answer in %.hdiffs
1122# Note: Putting anything into the hdiffs file will trigger generic IMPORT
1123# warning message in hotspot_import_include.
1124# First checks the major.minor versions, the micro number can differ.
1125# Second checks the full version.
1126# Lastly does a full diff if the full version differs or it has no version
1127$(TEMPDIR)/%.hdiffs: $(TEMPDIR)/%.h
1128 @$(prep-target)
1129 @$(TOUCH) $@
1130 @if [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_GET_VERSION)`" != \
1131 "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_VERSION)`" ] ; then \
1132 $(ECHO) "WARNING: The file $(<F) is not the same interface as the VM version.\n " \
1133 " this workspace has $(<F) `$(CAT) $< | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` and \n " \
1134 " HOTSPOT_IMPORT_PATH contains $(<F) `$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)` \n" \
1135 "" >> $(WARNING_FILE) ; \
1136 $(ECHO) "Version mis-match" > $@ ; \
1137 fi
1138 @if [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" != \
1139 "`$(CAT) $<.IMPORT | $(TMP_SDK_INCLUDE_GET_FULL_VERSION)`" ] ; then \
1140 $(RM) $<.filtered $<.IMPORT.filtered; \
1141 $(EGREP) -v 'VERSION' $< > $<.filtered; \
1142 $(EGREP) -v 'VERSION' $<.IMPORT > $<.IMPORT.filtered; \
1143 ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \
1144 elif [ "`$(CAT) $< | $(TMP_SDK_INCLUDE_FIND_VERSION)`" = "" ] ; then \
1145 $(RM) $<.filtered $<.IMPORT.filtered; \
1146 $(EGREP) -v '@\(#\)' $< > $<.filtered; \
1147 $(EGREP) -v '@\(#\)' $<.IMPORT > $<.IMPORT.filtered; \
1148 ($(DIFF) -w $<.filtered $<.IMPORT.filtered || exit 0) >> $@ ; \
1149 fi
1150
1151# Verify all imported hotspot files
1152sane-hotspot_import:: sane-hotspot_import_dir sane-hotspot_import_include
1153
1154# Verify the base directory exists
1155sane-hotspot_import_dir:
1156 @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1157 @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST)
1158 @if [ ! -d "$(HOTSPOT_IMPORT_PATH)" ]; then \
1159 $(ECHO) "WARNING: The directory HOTSPOT_IMPORT_PATH=$(HOTSPOT_IMPORT_PATH) \n" \
1160 " does not exist, check your value of ALT_HOTSPOT_IMPORT_PATH. \n" \
1161 "" >> $(WARNING_FILE) ; \
1162 fi
1163
1164# Verify hotspot include files
1165sane-hotspot_import_include: $(TMP_SDK_INCLUDE_FILE_LIST) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1166 @if [ "`$(CAT) $(TMP_SDK_INCLUDE_FILE_DIFFS)`" != "" ] ; then \
1167 $(ECHO) "WARNING: Possible HotSpot VM interface conflict. \n" \
1168 " HOTSPOT_IMPORT_PATH is used to import files from the VM build. \n" \
1169 " It is also used to verify that any copied files are consistent between \n" \
1170 " these two components. It has been detected that one or more of the \n" \
1171 " VM interface files inside this workspace may not match the interfaces \n" \
1172 " exported by the VM, or the VM versions could not be found. \n" \
1173 " The list of VM interface files is: \n" \
1174 " $(HOTSPOT_INCLUDE_FILE_LIST). \n" \
1175 " This workspace has copies of these files at: \n" \
1176 " $(SHARE_SRC)/javavm/export and $(PLATFORM_SRC)/javavm/export \n" \
1177 " for build purposes, and they should contain the same interfaces \n" \
1178 " as the VM versions imported from: \n" \
1179 " \$$(HOTSPOT_IMPORT_PATH)/include \n" \
1180 " (i.e. $(HOTSPOT_IMPORT_PATH)/include) \n" \
1181 " If an interface indeed doesn't match, then the use of this interface \n" \
1182 " at JDK runtime could cause serious errors. \n" \
1183 "" >> $(WARNING_FILE) ; \
1184 for i in $(TMP_SDK_INCLUDE_FILE_DIFFS); do \
1185 if [ -s $$i ] ; then \
1186 $(ECHO) " " >> $(WARNING_FILE); \
1187 $(ECHO) "VM Interface Differences: $$i" >> $(WARNING_FILE); \
1188 $(CAT) $$i >> $(WARNING_FILE); \
1189 $(ECHO) " " >> $(WARNING_FILE); \
1190 fi; \
1191 done; \
1192 fi
1193 @$(RM) $(TMP_SDK_INCLUDE_FILE_DIFFS)
1194 @$(RM) $(TMP_SDK_INCLUDE_FILE_LIST)
1195
1196# The JDI-SA feature is not currently released on some platforms.
1197# See the Defs-<arch>.gmk files.
1198
1199ifeq ($(INCLUDE_SA), true)
1200# Verify that hotspot Serviceability Agent files are present. To keep
1201# it simple, we will just check for one of them. The others have arch
1202# dependent paths.
1203
1204sane-hotspot_import::
1205 @if [ ! -r $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar ] ; then \
1206 $(ECHO) "WARNING: File $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar does not exist.\n" \
1207 " The JDI binding for the Serviceability Agent will not be included in the build.\n" \
1208 " Please check your access to\n" \
1209 " $(HOTSPOT_IMPORT_PATH)/lib/sa-jdi.jar\n" \
1210 " and/or check your value of ALT_HOTSPOT_IMPORT_PATH.\n" \
1211 "" >> $(WARNING_FILE) ; \
1212 fi
1213endif
1214
1215######################################################
1216# Check the ant version
1217######################################################
1218ANT_CHECK :=$(call CheckVersions,$(ANT_VER),$(REQUIRED_ANT_VER))
1219sane-ant_version:
1220 @if [ "$(ANT_CHECK)" != "same" \
1221 -a "$(ANT_CHECK)" != "newer" ]; then \
ohair24c06e02011-02-08 16:30:29 -08001222 $(ECHO) "ERROR: The version of ant being used is older than \n" \
duke6e45e102007-12-01 00:00:00 +00001223 " the required version of '$(REQUIRED_ANT_VER)'. \n" \
1224 " The version of ant found was '$(ANT_VER)'. \n" \
ohair24c06e02011-02-08 16:30:29 -08001225 "" >> $(ERROR_FILE) ; \
duke6e45e102007-12-01 00:00:00 +00001226 fi
1227
1228######################################################
duke6e45e102007-12-01 00:00:00 +00001229# Check the zip file version
1230######################################################
1231ZIP_CHECK :=$(call CheckVersions,$(ZIP_VER),$(REQUIRED_ZIP_VER))
1232sane-zip_version: sane-unzip_version
1233 @if [ "$(ZIP_CHECK)" != "same" -a "$(ZIP_CHECK)" != "newer" ]; then \
1234 $(ECHO) "WARNING: The version of zip being used is older than \n" \
1235 " the required version of '$(REQUIRED_ZIP_VER)'. \n" \
1236 " The version of zip found was '$(ZIP_VER)'. \n" \
1237 "" >> $(WARNING_FILE) ; \
1238 fi
1239
1240######################################################
1241# Check the unzip file version
1242######################################################
1243UNZIP_CHECK :=$(call CheckVersions,$(UNZIP_VER),$(REQUIRED_UNZIP_VER))
1244sane-unzip_version:
1245 @if [ "$(UNZIP_CHECK)" != "same" -a "$(UNZIP_CHECK)" != "newer" ]; then \
1246 $(ECHO) "WARNING: The version of unzip being used is older than \n" \
1247 " the required version of '$(REQUIRED_UNZIP_VER)'. \n" \
1248 " The version of unzip found was '$(UNZIP_VER)'. \n" \
1249 "" >> $(WARNING_FILE) ; \
1250 fi
1251
1252######################################################
1253# Check for windows DirectX sdk directory
1254######################################################
1255sane-dxsdk:
1256ifeq ($(PLATFORM), windows)
tdvcf2e2232008-07-18 10:48:44 -07001257 @if [ ! -r $(DXSDK_INCLUDE_PATH)/d3d9.h ]; then \
duke6e45e102007-12-01 00:00:00 +00001258 $(ECHO) "ERROR: You do not have access to a valid DirectX SDK Include dir.\n" \
1259 " The value of DXSDK_INCLUDE_PATH must point a valid DX SDK dir.\n" \
1260 " Please check your access to \n" \
1261 " $(DXSDK_INCLUDE_PATH) \n" \
1262 " and/or check your value of ALT_DXSDK_PATH or ALT_DXSDK_INCLUDE_PATH.\n" \
1263 " Microsoft DirectX 9 SDK (Summer 2004 Update or newer) can be downloaded from the following location:\n" \
1264 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
1265 " Or http://www.microsoft.com/directx\n" \
1266 "" >> $(ERROR_FILE) ; \
1267 else \
1268 if [ ! "$(DXSDK_VER)" = "$(REQUIRED_DXSDK_VER)" ]; then \
1269 $(ECHO) "ERROR: The DirectX SDK must be version $(REQUIRED_DXSDK_VER).\n" \
1270 " $(YOU_ARE_USING) DirectX SDK version: $(DXSDK_VER)\n" \
1271 " The DirectX SDK was obtained from the following location: \n" \
1272 " $(DXSDK_PATH) \n" \
1273 " Please change your DirectX SDK. \n" \
1274 " Microsoft DirectX 9 SDK (Summer 2004 Update or newer) can be downloaded from the following location:\n" \
1275 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
1276 " Or http://www.microsoft.com/directx\n" \
1277 "" >> $(ERROR_FILE) ; \
1278 else \
1279 if [ -r $(DXSDK_INCLUDE_PATH)/basetsd.h ]; then \
1280 if [ `$(EGREP) -c __int3264 $(DXSDK_INCLUDE_PATH)/basetsd.h` -ne 0 ]; then \
1281 $(ECHO) "WARNING: The DirectX SDK Include directory contains a newer basetsd.h,\n" \
1282 " which may indicate that you're using an incorrect version of DirectX SDK.\n" \
1283 " This may result in a build failure.\n" \
1284 " The DirectX SDK Include dir was obtained from the following location:\n" \
1285 " $(DXSDK_INCLUDE_PATH) \n" \
tdvcf2e2232008-07-18 10:48:44 -07001286 " Please change your DirectX SDK to version 9 (Summer 2004 Update or newer).\n" \
duke6e45e102007-12-01 00:00:00 +00001287 " Microsoft DirectX 9 SDK can be downloaded from the following location:\n" \
1288 " http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp\n" \
1289 " Or http://www.microsoft.com/directx\n" \
dholmesfba205e2011-03-15 19:52:42 -04001290 "" >> $(WARNING_FILE) ; \
duke6e45e102007-12-01 00:00:00 +00001291 fi \
1292 fi \
1293 fi \
1294 fi
1295endif
1296
1297######################################################
1298# Check the linker version(s)
1299######################################################
1300ifeq ($(PLATFORM), windows)
1301 LINK_CHECK :=$(call CheckVersions,$(LINK_VER),$(REQUIRED_LINK_VER))
1302endif
1303sane-link:
1304ifdef LINK_VER
1305 @if [ "$(LINK_CHECK)" = "missing" ]; then \
1306 $(ECHO) "ERROR: The Linker version is undefined. \n" \
1307 "" >> $(ERROR_FILE) ; \
1308 fi
1309 @if [ "$(LINK_CHECK)" != "same" ]; then \
1310 $(ECHO) "WARNING: To build Java 2 SDK $(JDK_VERSION) you need : \n" \
ohair7d709f42011-03-10 14:48:32 -08001311 " $(REQUIRED_COMPILER_VERSION) - link.exe version '$(REQUIRED_LINK_VER)' \n" \
ohair82280fd2009-03-16 11:24:06 -07001312 " Specifically the $(REQUIRED_COMPILER_NAME) link.exe. \n " \
ohair7d709f42011-03-10 14:48:32 -08001313 " $(YOU_ARE_USING) Linker version '$(LINK_VER)' \n" \
duke6e45e102007-12-01 00:00:00 +00001314 "" >> $(WARNING_FILE) ; \
1315 fi
1316endif
1317
1318######################################################
1319# Check the compiler version(s)
1320######################################################
dholmes70a4d1a2011-03-16 18:54:50 -04001321ifdef REQUIRED_CC_VER
1322 CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
1323endif
duke6e45e102007-12-01 00:00:00 +00001324sane-compiler: sane-link
dholmes70a4d1a2011-03-16 18:54:50 -04001325ifdef REQUIRED_CC_VER
duke6e45e102007-12-01 00:00:00 +00001326 @if [ "$(CC_CHECK)" = "missing" ]; then \
1327 $(ECHO) "ERROR: The Compiler version is undefined. \n" \
1328 "" >> $(ERROR_FILE) ; \
1329 fi
dholmes70a4d1a2011-03-16 18:54:50 -04001330 ifndef OPENJDK
duke6e45e102007-12-01 00:00:00 +00001331 @if [ "$(CC_CHECK)" != "same" ]; then \
ohair82280fd2009-03-16 11:24:06 -07001332 $(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(REQUIRED_COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \
1333 " Specifically the $(REQUIRED_COMPILER_NAME) compiler. \n " \
1334 " $(YOU_ARE_USING) $(COMPILER_VERSION): $(CC_VER) \n" \
duke6e45e102007-12-01 00:00:00 +00001335 " The compiler was obtained from the following location: \n" \
1336 " $(COMPILER_PATH) \n" \
1337 "" >> $(WARNING_FILE) ; \
1338 fi
dholmes70a4d1a2011-03-16 18:54:50 -04001339 endif
duke6e45e102007-12-01 00:00:00 +00001340endif
1341
1342######################################################
1343# Check that ALSA headers and libs are installed and
1344# that the header has the right version. We only
ohair8df39292009-01-31 17:31:21 -08001345# need /usr/include/alsa/version.h and /usr/lib/libasound.so
duke6e45e102007-12-01 00:00:00 +00001346######################################################
1347
ohair8df39292009-01-31 17:31:21 -08001348ifdef REQUIRED_ALSA_VERSION
1349 ALSA_CHECK := $(call CheckVersions,$(ALSA_VERSION),$(REQUIRED_ALSA_VERSION))
duke6e45e102007-12-01 00:00:00 +00001350endif
ohair8df39292009-01-31 17:31:21 -08001351sane-alsa-headers:
1352ifdef REQUIRED_ALSA_VERSION
andrew4d52e1c2010-11-23 02:17:23 +00001353 @if [ "$(ALSA_CHECK)" != "missing" ] ; then \
1354 if [ "$(ALSA_CHECK)" != "same" -a "$(ALSA_CHECK)" != "newer" ] ; then \
1355 $(ECHO) "ERROR: The ALSA version must be $(REQUIRED_ALSA_VERSION) or higher. \n" \
1356 " You have the following ALSA version installed: $${alsa_version} \n" \
1357 " Please reinstall ALSA (drivers and lib). You can download \n" \
1358 " the source distribution from http://www.alsa-project.org \n" \
1359 " or go to http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \
1360 "" >> $(ERROR_FILE) ; \
1361 fi ; \
duke6e45e102007-12-01 00:00:00 +00001362 else \
andrew4d52e1c2010-11-23 02:17:23 +00001363 $(ECHO) "ERROR: You seem to not have installed ALSA $(REQUIRED_ALSA_VERSION) or higher. \n" \
1364 " Please install ALSA (drivers and lib). You can download the \n" \
1365 " source distribution from http://www.alsa-project.org or go to \n" \
1366 " http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \
1367 "" >> $(ERROR_FILE) ; \
duke6e45e102007-12-01 00:00:00 +00001368 fi
1369endif
1370
1371# If a sanity file doesn't exist, just make sure it's dir exists
1372$(SANITY_FILES):
1373 -@$(prep-target)
1374
1375######################################################
1376# dump out the variable settings...
1377######################################################
ohair8df39292009-01-31 17:31:21 -08001378sane-settings::
duke6e45e102007-12-01 00:00:00 +00001379 @$(ECHO) >> $(MESSAGE_FILE)
1380 @$(ECHO) $(ALL_SETTINGS) >> $(MESSAGE_FILE)
1381 @$(ECHO) >> $(MESSAGE_FILE)
1382
1383######################################################
1384# Check for existence of DEPLOY_MSSDK on windows
1385######################################################
1386sane-mssdk_path:
1387ifeq ($(PLATFORM), windows)
1388 @if [ -z "$(DEPLOY_MSSDK)" ]; then \
1389 $(ECHO) "WARNING: Your DEPLOY_MSSDK setting is empty.\n" \
1390 " It is recommended to set ALT_DEPLOY_MSSDK.\n" \
1391 "" >> $(WARNING_FILE) ; \
1392 fi
1393 @if [ ! -r "$(DEPLOY_MSSDK)" ]; then \
1394 $(ECHO) "ERROR: You do not have a valid DEPLOY_MSSDK setting. \n" \
1395 " Please check your access to \n" \
1396 " $(DEPLOY_MSSDK) \n" \
1397 " and/or check your value of ALT_DEPLOY_MSSDK. \n" \
1398 "" >> $(ERROR_FILE) ; \
1399 fi
1400endif
1401
1402######################################################
ohair3ae113d2010-12-21 18:21:26 -08001403# Check for existence of the MSSDK on windows
duke6e45e102007-12-01 00:00:00 +00001404######################################################
1405sane-install-mssdk_path:
1406ifeq ($(PLATFORM), windows)
ohair3ae113d2010-12-21 18:21:26 -08001407 @if [ -z "$(WINDOWSSDKDIR)" ]; then \
1408 $(ECHO) "WARNING: Your WINDOWSSDKDIR setting is empty.\n" \
1409 " It is recommended to set ALT_WINDOWSSDKDIR.\n" \
1410 "" >> $(WARNING_FILE) ; \
1411 fi
1412 @if [ ! -r "$(WINDOWSSDKDIR)" ]; then \
1413 $(ECHO) "ERROR: You do not have a valid WINDOWSSDKDIR setting. \n" \
1414 " Please check your access to \n" \
1415 " $(WINDOWSSDKDIR) \n" \
1416 " and/or check your value of ALT_WINDOWSSDKDIR. \n" \
1417 "" >> $(ERROR_FILE) ; \
1418 fi
duke6e45e102007-12-01 00:00:00 +00001419 @if [ -z "$(INSTALL_MSSDK)" ]; then \
1420 $(ECHO) "WARNING: Your INSTALL_MSSDK setting is empty.\n" \
1421 " It is recommended to set ALT_INSTALL_MSSDK.\n" \
1422 "" >> $(WARNING_FILE) ; \
1423 fi
1424 @if [ ! -r "$(INSTALL_MSSDK)" ]; then \
1425 $(ECHO) "ERROR: You do not have a valid INSTALL_MSSDK setting. \n" \
1426 " Please check your access to \n" \
1427 " $(INSTALL_MSSDK) \n" \
1428 " and/or check your value of ALT_INSTALL_MSSDK. \n" \
1429 "" >> $(ERROR_FILE) ; \
1430 fi
1431endif
1432
1433######################################################
mduigou1af26382010-12-06 19:37:40 -08001434# Check the GNU C++ compiler for OJI plugin
duke6e45e102007-12-01 00:00:00 +00001435######################################################
1436sane-gcc-compiler:
mduigou1af26382010-12-06 19:37:40 -08001437ifndef OPENJDK
1438 ifeq ($(PLATFORM), solaris)
1439 @if [ -r $(GCC_COMPILER_PATH) ]; then \
1440 if [ ! "$(GCC_VER)" = $(REQUIRED_GCC_VER) ]; then \
1441 $(ECHO) "ERROR: The Solaris GCC compiler version must be $(REQUIRED_GCC_VER). \n" \
duke6e45e102007-12-01 00:00:00 +00001442 " You are using the following compiler version: $(GCC_VER) \n" \
1443 " The compiler was obtained from the following location: \n" \
1444 " $(GCC_COMPILER_PATH) \n" \
1445 " Please change your compiler. \n" \
1446 "" >> $(ERROR_FILE) ; \
mduigou1af26382010-12-06 19:37:40 -08001447 fi \
duke6e45e102007-12-01 00:00:00 +00001448 else \
1449 $(ECHO) "ERROR: You do not have a valid GCC_COMPILER_PATH setting. \n" \
1450 " Please check your access to \n" \
1451 " $(GCC_COMPILER_PATH) \n" \
1452 " and/or check your value of ALT_GCC_COMPILER_PATH. \n" \
1453 " This will affect you if you build the plugin target. \n" \
1454 "" >> $(ERROR_FILE) ; \
1455 fi
1456 endif
1457
1458 ifeq ($(PLATFORM), linux)
mduigou1af26382010-12-06 19:37:40 -08001459 ifeq ($(ARCH_DATA_MODEL), 32)
duke6e45e102007-12-01 00:00:00 +00001460 ifdef ALT_GCC29_COMPILER_PATH
1461 @if [ ! -x $(ALT_GCC29_COMPILER_PATH)/bin/gcc ]; then \
mduigou1af26382010-12-06 19:37:40 -08001462 $(ECHO) "ERROR: You do not have a valid ALT_GCC29_COMPILER_PATH setting. \n" \
duke6e45e102007-12-01 00:00:00 +00001463 " Please check your access to \n" \
1464 " $(ALT_GCC29_COMPILER_PATH)/bin/gcc \n" \
1465 " This will affect you if you build the plugin target. \n" \
1466 "" >> $(ERROR_FILE) ; \
1467 fi
mduigou1af26382010-12-06 19:37:40 -08001468 else
duke6e45e102007-12-01 00:00:00 +00001469 ifdef ALT_GCC29_PLUGIN_LIB_PATH
1470 @if [ ! -r $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so ]; then \
1471 $(ECHO) "Error: You do not have a valid ALT_GCC29_PLUGIN_LIB_PATH setting. \n" \
1472 " Please check your access to \n" \
1473 " $(ALT_GCC29_PLUGIN_LIB_PATH)/libjavaplugin_oji.so \n" \
1474 " This will affect you if you build the plugin target, specifically for gcc 2.9 version of OJI plugin library. \n" \
1475 "" >> $(ERROR_FILE) ; \
1476 fi
1477 else
1478 @if [ ! -r $(GCC29_COMPILER_PATH) ]; then \
1479 $(ECHO) "ERROR: You do not have a valid GCC29_COMPILER_PATH setting. \n" \
1480 " Please check your access to \n" \
1481 " $(GCC29_COMPILER_PATH) \n" \
mduigou1af26382010-12-06 19:37:40 -08001482 " and/or check your value of ALT_GCC29_COMPILER_PATH or ALT_GCC29_PLUGIN_LIB_PATH \n" \
duke6e45e102007-12-01 00:00:00 +00001483 " This will affect you if you build the plugin target. \n" \
1484 "" >> $(ERROR_FILE) ; \
1485 fi
mduigou1af26382010-12-06 19:37:40 -08001486 endif # ALT_GCC29_PLUGIN_LIB_PATH
1487 endif # ALT_GCC29_COMPILER_PATH
1488 endif # ARCH_DATA_MODEL, 32
1489 endif # LINUX
1490endif # OPEN_JDK
duke6e45e102007-12-01 00:00:00 +00001491
1492
1493######################################################
1494# MOZILLA_HEADERS_PATH must be valid
1495######################################################
1496sane-mozilla:
1497ifeq ($(ARCH_DATA_MODEL), 32)
1498 ifdef ALT_MOZILLA_HEADERS_PATH
ohair5dfae9b2010-03-03 11:29:44 -08001499 @if [ `$(ECHO) $(subst \,/,$(ALT_MOZILLA_HEADERS_PATH)) | $(EGREP) -c '^([A-Za-z]:)?/'` -ne 1 ]; then \
duke6e45e102007-12-01 00:00:00 +00001500 $(ECHO) "ERROR: ALT_MOZILLA_HEADERS_PATH must be an Absolute Path Name, \n" \
1501 " not a Relative Path Name. \n" \
1502 " The current value of ALT_MOZILLA_HEADERS_PATH is \n" \
1503 " $(ALT_MOZILLA_HEADERS_PATH) \n" \
1504 " Please fix this and continue your build. \n" \
1505 "" >> $(ERROR_FILE) ; \
1506 fi
1507 endif
1508 @#
1509 @# MOZILLA_HEADERS_PATH must be valid....
1510 @#
1511 ifeq ($(PLATFORM), windows)
1512 @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18.win32/java/bool.h ]; then \
1513 $(ECHO) "ERROR: You do not have access to valid Mozilla header files. \n" \
1514 " Please check your access to \n" \
1515 " $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18.win32/java/bool.h \n" \
1516 " and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
1517 " and on Windows, ALT_JDK_JAVA_DRIVE. \n" \
1518 "" >> $(ERROR_FILE) ; \
1519 fi
1520 else
1521 @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18/java/bool.h ]; then \
1522 $(ECHO) "ERROR: You do not have access to valid Mozilla header files. \n" \
1523 " Please check your access to \n" \
1524 " $(subst \,/,$(MOZILLA_HEADERS_PATH))/mozilla_headers_18/java/bool.h \n" \
1525 " and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
1526 "" >> $(ERROR_FILE) ; \
1527 fi
1528 endif
herrick43e2a0c2009-06-12 14:56:32 -04001529 @#
1530 @# Check for presence of headers required for new Java Plug-In ("plugin2")
1531 @#
1532 @if [ ! -r $(subst \,/,$(MOZILLA_HEADERS_PATH))/plugin2_mozilla_headers/npapi.h ]; then \
1533 $(ECHO) "ERROR: You do not have access to valid Mozilla header files for the new Java Plug-In. \n" \
1534 " Please check your access to \n" \
1535 " $(subst \,/,$(MOZILLA_HEADERS_PATH))/plugin2_mozilla_headers/npapi.h \n" \
1536 " and/or check your value of ALT_JDK_DEVTOOLS_DIR, ALT_MOZILLA_HEADERS_PATH, \n" \
1537 "" >> $(ERROR_FILE) ; \
1538 fi
duke6e45e102007-12-01 00:00:00 +00001539endif
1540
1541
ohaird36311a2008-03-25 14:40:43 -07001542######################################################
herrick43e2a0c2009-06-12 14:56:32 -04001543# Make sure Java Kernel VM is accessible
1544######################################################
1545sane-kernel-vm:
1546ifeq ($(PLATFORM), windows)
1547 ifeq ($(ARCH_DATA_MODEL), 32)
1548 @if [ ! -r $(HOTSPOT_KERNEL_PATH)/jvm.dll ]; then \
herrick446553d2009-06-19 11:46:39 -04001549 $(ECHO) "WARNING: Your HOTSPOT_IMPORT_PATH does not include a Kernel VM... \n" \
1550 " The kernel installer may not be built (unless hotspot is also). \n" \
herrick43e2a0c2009-06-12 14:56:32 -04001551 " $(HOTSPOT_KERNEL_PATH)/jvm.dll \n" \
1552 " Please check the value of ALT_HOTSPOT_IMPORT_PATH. \n" \
herrick446553d2009-06-19 11:46:39 -04001553 >> $(WARNING_FILE) ; \
herrick43e2a0c2009-06-12 14:56:32 -04001554 fi
1555 endif
1556endif
1557
1558
1559######################################################
1560# SECURITY_BASELINE_131 test
1561######################################################
1562security_baseline_131:
1563ifeq ($(PLATFORM), windows)
1564 @if [ -z "$(SECURITY_BASELINE_131)" ]; then \
1565 $(ECHO) "WARNING: Your SECURITY_BASELINE_131 setting is empty.\n" \
1566 " Setting it to the default value of 1.3.1_20.\n" \
1567 " It is recommended to set SECURITY_BASELINE_131.\n" \
1568 "" >> $(WARNING_FILE) ; \
1569 fi
1570endif
1571
1572######################################################
ohaird36311a2008-03-25 14:40:43 -07001573# SECURITY_BASELINE_142 test
1574######################################################
1575security_baseline_142:
1576ifeq ($(PLATFORM), windows)
1577 @if [ -z "$(SECURITY_BASELINE_142)" ]; then \
1578 $(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \
1579 " Setting it to the default value of 1.4.2_10.\n" \
1580 " It is recommended to set SECURITY_BASELINE_142.\n" \
1581 "" >> $(WARNING_FILE) ; \
1582 fi
1583endif
1584
1585######################################################
1586# SECURITY_BASELINE_150 test
1587######################################################
1588security_baseline_150:
1589ifeq ($(PLATFORM), windows)
1590 @if [ -z "$(SECURITY_BASELINE_150)" ]; then \
1591 $(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \
1592 " Setting it to the default value of 1.5.0_07.\n" \
1593 " It is recommended to set SECURITY_BASELINE_150.\n" \
1594 "" >> $(WARNING_FILE) ; \
1595 fi
1596endif
duke6e45e102007-12-01 00:00:00 +00001597
herrick43e2a0c2009-06-12 14:56:32 -04001598######################################################
1599# SECURITY_BASELINE_160 test
1600######################################################
1601security_baseline_160:
1602ifeq ($(PLATFORM), windows)
1603 @if [ -z "$(SECURITY_BASELINE_160)" ]; then \
1604 $(ECHO) "WARNING: Your SECURITY_BASELINE_160 setting is empty.\n" \
1605 " Setting it to the default value of 1.6.0_11.\n" \
1606 " It is recommended to set SECURITY_BASELINE_160.\n" \
1607 "" >> $(WARNING_FILE) ; \
1608 fi
1609endif
1610
duke6e45e102007-12-01 00:00:00 +00001611
1612######################################################
1613# this should be the last rule in any target's sanity rule.
1614######################################################
1615sane-lastrule:
1616ifndef EXTERNALSANITYCONTROL
1617 @if [ -r $(MESSAGE_FILE) ]; then \
1618 $(CAT) $(MESSAGE_FILE) ; \
1619 fi
1620 @if [ -r $(WARNING_FILE) ]; then \
1621 $(CAT) $(WARNING_FILE) ; \
1622 fi
1623 @if [ "x$(INSANE)" != x ]; then \
1624 $(ECHO) "INSANE mode requested. \n" \
1625 "Sanity will not force a build termination, even with errors.\n" \
1626 "" >> $(ERROR_FILE); \
1627 fi
1628 @if [ -r $(ERROR_FILE) ]; then \
1629 if [ "x$(INSANE)" = x ]; then \
1630 $(ECHO) "Exiting because of the above error(s). \n" \
1631 "">> $(ERROR_FILE); \
1632 fi ; \
1633 $(CAT) $(ERROR_FILE) ; \
1634 if [ "x$(INSANE)" = x ]; then \
1635 exit 1 ; \
1636 fi ; \
1637 fi
1638ifdef PEDANTIC
1639 @if [ -r $(WARNING_FILE) ]; then \
1640 $(ECHO) "PEDANTIC mode requested. \n" \
1641 "Exiting because of the above warning(s). \n" \
1642 "" >> $(ERROR_FILE); \
1643 $(CAT) $(ERROR_FILE) ; \
1644 exit 1 ; \
1645 fi
1646endif # PEDANTIC
1647 @if [ ! -r $(ERROR_FILE) ]; then \
1648 $(ECHO) "Sanity check passed." ; \
1649 fi
1650endif # EXTERNALSANITYCONTROL
1651