rev 5380 : 7126277: Alternative hashing implementation

   1 #
   2 # Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact 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 # Makefile for core Java libraries
  28 # (java.lang, java.lang.ref, java.lang.reflect, java.io, java.util)
  29 #
  30 
  31 BUILDDIR = ../..
  32 PACKAGE = java.lang
  33 LIBRARY = java
  34 PRODUCT = java
  35 SUBDIRS_MAKEFLAGS += JAVAC_MAX_WARNINGS=false
  36 SUBDIRS_MAKEFLAGS += JAVAC_WARNINGS_FATAL=false
  37 JAVAC_MAX_WARNINGS=false
  38 include $(BUILDDIR)/common/Defs.gmk
  39 
  40 # windows compiler flags
  41 ifeq ($(PLATFORM),windows)
  42   OTHER_CFLAGS =
  43   # build directly into BINDIR...
  44   LIB_LOCATION = $(BINDIR)
  45   # Exported functions
  46   OTHER_LCF = -export:winFileHandleOpen -export:handleLseek
  47 endif
  48 
  49 OTHER_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
  50                 -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
  51                 -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
  52                 -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
  53 
  54 ifdef JDK_UPDATE_VERSION
  55 OTHER_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
  56 endif
  57 
  58 
  59 #
  60 # Files to compile.
  61 #
  62 include FILES_c.gmk
  63 include FILES_java.gmk
  64 include Exportedfiles.gmk
  65 
  66 ifeq ($(PLATFORM),windows)
  67 FILES_java +=   java/io/Win32FileSystem.java \
  68                 java/io/WinNTFileSystem.java \
  69                 java/util/prefs/WindowsPreferences.java \
  70                 java/util/prefs/WindowsPreferencesFactory.java
  71 
  72 FILES_c    +=   ProcessImpl_md.c \
  73                 Win32FileSystem_md.c \
  74                 WinNTFileSystem_md.c \
  75                 canonicalize_md.c \
  76                 dirent_md.c \
  77                 TimeZone.c \
  78                 TimeZone_md.c \
  79                 WindowsPreferences.c \
  80                 sun/security/provider/WinCAPISeedGenerator.c \
  81                 sun/io/Win32ErrorMode.c
  82 
  83 else # PLATFORM
  84 FILES_java +=   java/lang/UNIXProcess.java \
  85                 java/io/UnixFileSystem.java \
  86                 java/util/prefs/FileSystemPreferences.java \
  87                 java/util/prefs/FileSystemPreferencesFactory.java \
  88 
  89 FILES_c    +=   UNIXProcess_md.c \
  90                 UnixFileSystem_md.c \
  91                 canonicalize_md.c \
  92                 TimeZone.c \
  93                 TimeZone_md.c \
  94                 FileSystemPreferences.c
  95 
  96 INIT += $(GENSRCDIR)/java/lang/UNIXProcess.java
  97 
  98 endif # PLATFORM
  99 
 100 ifeq ($(PLATFORM), macosx)
 101 FILES_c    +=   java_props_macosx.c
 102 FILES_java +=   java/util/prefs/MacOSXPreferences.java \
 103                 java/util/prefs/MacOSXPreferencesFile.java \
 104                 java/util/prefs/MacOSXPreferencesFactory.java
 105 
 106 CFLAGS_$(VARIANT)/java_props_md.o = -Os -x objective-c
 107 endif
 108 
 109 #
 110 # Make sure first rule does 'all'
 111 #
 112 default_rule: all
 113 
 114 #
 115 # Source files to generate before we try to compile anything
 116 #
 117 
 118 #
 119 # genlocales.gmk define rules to generate LocaleDataMetaInfo.java
 120 # which contains locale string list for sun.text.resources and
 121 # sun.util.resources.
 122 #
 123 include genlocales.gmk
 124 
 125 CLASSES_INIT = gencharsrc niosrc rbcontrolsrc genlocales
 126 
 127 niosrc: ; ($(CD) ../nio; $(MAKE) sources)
 128 
 129 gencharsrc: $(GENSRCDIR)/java/lang/CharacterData00.java \
 130     $(GENSRCDIR)/java/lang/CharacterData01.java \
 131     $(GENSRCDIR)/java/lang/CharacterData02.java \
 132     $(GENSRCDIR)/java/lang/CharacterData0E.java \
 133     $(GENSRCDIR)/java/lang/CharacterDataLatin1.java \
 134     $(GENSRCDIR)/java/lang/CharacterDataUndefined.java \
 135     $(GENSRCDIR)/java/lang/CharacterDataPrivateUse.java
 136 
 137 rbcontrolsrc: $(GENSRCDIR)/sun/util/CoreResourceBundleControl.java
 138 
 139 #
 140 # Add to the default C file search paths
 141 #
 142 vpath %.c $(PLATFORM_SRC)/native/java/lang:$(SHARE_SRC)/native/java/lang
 143 vpath %.c $(SHARE_SRC)/native/java/lang/ref
 144 vpath %.c $(SHARE_SRC)/native/java/lang/reflect
 145 vpath %.c $(SHARE_SRC)/native/java/io
 146 vpath %.c $(PLATFORM_SRC)/native/java/io
 147 vpath %.c $(SHARE_SRC)/native/java/nio
 148 vpath %.c $(SHARE_SRC)/native/java/security
 149 vpath %.c $(SHARE_SRC)/native/common
 150 vpath %.c $(SHARE_SRC)/native/sun/misc
 151 vpath %.c $(SHARE_SRC)/native/sun/reflect
 152 vpath %.c $(SHARE_SRC)/native/java/sql
 153 vpath %.c $(SHARE_SRC)/native/java/util
 154 vpath %.c $(SHARE_SRC)/native/java/util/concurrent/atomic
 155 vpath %.c $(PLATFORM_SRC)/native/common
 156 vpath %.c $(PLATFORM_SRC)/native/java/util
 157 vpath %.c $(PLATFORM_SRC)/native/sun/security/provider
 158 vpath %.c $(PLATFORM_SRC)/native/sun/io
 159 
 160 #
 161 # Includes the fdlibm header file.
 162 #
 163 OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/lang/fdlibm/include
 164 
 165 #
 166 # Also include the io_util.h header file.
 167 #
 168 OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/io
 169 OTHER_INCLUDES += -I$(PLATFORM_SRC)/native/java/io
 170 
 171 #
 172 # Also include the TimeZone_md.h header file.
 173 #
 174 OTHER_INCLUDES += -I$(PLATFORM_SRC)/native/java/util
 175 
 176 #
 177 # Is the altzone extern documented in ctime(3C) available?
 178 #
 179 ifneq ($(PLATFORM), windows)
 180 ifneq ($(PLATFORM), macosx)
 181 HAVE_ALTZONE=true
 182 endif
 183 endif
 184 
 185 ifeq ($(HAVE_ALTZONE),true)
 186 OTHER_CPPFLAGS += -DHAVE_ALTZONE
 187 endif
 188 
 189 #
 190 # System.c needs RELEASE.
 191 # java_props_md.c needs ARCH on non-Solaris platforms.
 192 #
 193 OTHER_CPPFLAGS += $(VERSION_DEFINES)
 194 
 195 #
 196 # Include name of LIBARCH
 197 #
 198 OTHER_CPPFLAGS += -DARCHPROPNAME='"$(ARCHPROP)"'
 199 
 200 #
 201 # Is the key in the call nl_langinfo(CODESET) called something other than
 202 # CODESET?
 203 #
 204 ifdef ALT_CODESET_KEY
 205 OTHER_CPPFLAGS += -DALT_CODESET_KEY=$(ALT_CODESET_KEY)
 206 endif
 207 
 208 #
 209 # Install .lib file.
 210 #
 211 INSTALL_DOT_LIB = true
 212 
 213 #
 214 # What to link?
 215 # On Windows, shell32 is not normally required and so it is delay loaded.
 216 #
 217 ifeq ($(PLATFORM),windows)
 218 OTHER_LDLIBS += $(JVMLIB) -libpath:$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) fdlibm.lib \
 219                        -libpath:$(OBJDIR)/../../../verify/$(OBJDIRNAME) verify.lib \
 220                        shell32.lib delayimp.lib /DELAYLOAD:shell32.dll
 221 else
 222 OTHER_LDLIBS += $(JVMLIB) -lverify $(LIBSOCKET) $(LIBNSL) $(LIBSCF) $(LIBDL) \
 223                 -L$(OBJDIR)/../../../fdlibm/$(OBJDIRNAME) -lfdlibm.$(ARCH)
 224 ifeq ($(PLATFORM), macosx)
 225 OTHER_LDLIBS += \
 226         -framework CoreFoundation \
 227         -framework Security \
 228         -framework SystemConfiguration
 229 endif
 230 endif
 231 
 232 #
 233 # Rules.
 234 #
 235 ifeq ($(PLATFORM), solaris)
 236   ifneq ($(ARCH), amd64)
 237     FILES_reorder += reorder-$(ARCH)
 238   endif
 239 endif
 240 
 241 SUBDIRS = reflect
 242 include $(BUILDDIR)/common/Subdirs.gmk
 243 
 244 all build:
 245         $(SUBDIRS-loop)
 246 clean clobber::
 247         $(SUBDIRS-loop)
 248 
 249 include $(BUILDDIR)/common/Mapfile-vers.gmk
 250 include $(BUILDDIR)/common/Library.gmk
 251 
 252 ifeq ($(PLATFORM), solaris)
 253   ifeq ($(CC_VER), 5.8)
 254     ifndef REMOVE_ALL_WORKAROUNDS
 255       CFLAGS_OPT/ObjectInputStream.o = -xO3 \
 256           $(warning  "WARNING: Using workaround for SS11 bug 6346242, on $@")
 257     endif
 258   endif
 259 endif
 260 
 261 ifneq ($(PLATFORM),windows)
 262 
 263 # UNIXProcess.java is different for solaris and linux. We need to copy
 264 # the correct UNIXProcess.java over to $(GENSRCDIR)/java/lang/.
 265 
 266 ifeq ($(PLATFORM), macosx)
 267 PLATFORM_UNIX_PROCESS = \
 268     $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.bsd
 269 else
 270 PLATFORM_UNIX_PROCESS = \
 271     $(PLATFORM_SRC)/classes/java/lang/UNIXProcess.java.$(PLATFORM)
 272 endif
 273 
 274 $(GENSRCDIR)/java/lang/UNIXProcess.java: $(PLATFORM_UNIX_PROCESS)
 275         $(install-file)
 276 
 277 clean::
 278         $(RM) $(GENSRCDIR)/java/lang/UNIXProcess.java
 279 
 280 endif
 281 
 282 
 283 #
 284 # Because we can't link against ourselves!
 285 #
 286 JAVALIB =
 287 
 288 #
 289 # Special rules.
 290 #
 291 clean::
 292         $(RM) -r $(CLASSHDRDIR)
 293 
 294 clobber::
 295         $(RM) -r $(CLASSBINDIR)/java/io $(CLASSBINDIR)/java/lang \
 296                 $(CLASSBINDIR)/java/security $(CLASSBINDIR)/java/util \
 297                 $(CLASSBINDIR)/sun/misc
 298 
 299 #
 300 # Additional rule from sun/net/GNUmakefile to copy content-type.properties
 301 # file so that the MimeTable class won't complain while bootstrapping...
 302 #
 303 PROPS = content-types.properties
 304 
 305 #
 306 # Rule to copy calendars.properties file.
 307 #
 308 CAL_PROPS = calendars.properties
 309 
 310 #
 311 # Rule to copy tzmappings file on Windows
 312 #
 313 ifeq ($(PLATFORM), windows)
 314 TZMAP = $(LIBDIR)/tzmappings
 315 TZMAPFILE = $(PLATFORM_SRC)/lib/tzmappings
 316 
 317 $(TZMAP): $(TZMAPFILE)
 318         $(install-file)
 319         $(call chmod-file, 444)
 320 endif
 321 
 322 build: $(LIBDIR)/$(PROPS) $(LIBDIR)/$(CAL_PROPS) $(TZMAP)
 323 
 324 $(LIBDIR)/$(PROPS): $(PLATFORM_SRC)/lib/$(PROPS)
 325         $(install-file)
 326 
 327 $(LIBDIR)/$(CAL_PROPS): $(SHARE_SRC)/lib/$(CAL_PROPS)
 328         $(install-file)
 329 
 330 clean::
 331         $(RM) -r $(LIBDIR)/$(PROPS) $(TZMAP)
 332 
 333 #
 334 # Rules to create lib/currency.data
 335 #
 336 
 337 CURDATA = $(LIBDIR)/currency.data
 338 GENERATECURRENCYDATA_JARFILE = $(BUILDTOOLJARDIR)/generatecurrencydata.jar
 339 
 340 build: $(CURDATA)
 341 
 342 $(CURDATA): \
 343   $(GENERATECURRENCYDATA_JARFILE) \
 344   $(SHARE_SRC)/classes/java/util/CurrencyData.properties
 345         $(RM) $(CURDATA)
 346         $(BOOT_JAVA_CMD) -jar $(GENERATECURRENCYDATA_JARFILE) -o $@.temp \
 347                 < $(SHARE_SRC)/classes/java/util/CurrencyData.properties
 348         $(MV) $@.temp $@
 349         $(call chmod-file, 444)
 350 
 351 clean::
 352         $(RM) $(CURDATA)
 353 
 354 
 355 #
 356 # Rules to create $(GENSRCDIR)/sun/lang/CharacterData*.java
 357 #
 358 CHARACTERDATA = $(BUILDDIR)/tools/GenerateCharacter
 359 UNICODEDATA   = $(BUILDDIR)/tools/UnicodeData
 360 
 361 GENERATECHARACTER_JARFILE = $(BUILDTOOLJARDIR)/generatecharacter.jar
 362 
 363 $(GENSRCDIR)/java/lang/CharacterDataLatin1.java \
 364   $(GENSRCDIR)/java/lang/CharacterData00.java \
 365   $(GENSRCDIR)/java/lang/CharacterData01.java \
 366   $(GENSRCDIR)/java/lang/CharacterData02.java \
 367   $(GENSRCDIR)/java/lang/CharacterData0E.java: \
 368     $(wildcard $(CHARACTERDATA)/*) \
 369     $(GENERATECHARACTER_JARFILE)
 370         @$(prep-target)
 371         $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) \
 372                 -template $(CHARACTERDATA)/CharacterDataLatin1.java.template \
 373                 -spec $(UNICODEDATA)/UnicodeData.txt \
 374                 -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
 375                 -proplist $(UNICODEDATA)/PropList.txt \
 376                 -o $(GENSRCDIR)/java/lang/CharacterDataLatin1.java -string \
 377                 -usecharforbyte -latin1 8
 378         $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 0 \
 379                 -template $(CHARACTERDATA)/CharacterData00.java.template \
 380                 -spec $(UNICODEDATA)/UnicodeData.txt \
 381                 -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
 382                 -proplist $(UNICODEDATA)/PropList.txt \
 383                 -o $(GENSRCDIR)/java/lang/CharacterData00.java -string \
 384                 -usecharforbyte 11 4 1
 385         $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 1 \
 386                 -template $(CHARACTERDATA)/CharacterData01.java.template \
 387                 -spec $(UNICODEDATA)/UnicodeData.txt \
 388                 -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
 389                 -proplist $(UNICODEDATA)/PropList.txt \
 390                 -o $(GENSRCDIR)/java/lang/CharacterData01.java -string \
 391                 -usecharforbyte  11 4 1
 392         $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 2 \
 393                 -template $(CHARACTERDATA)/CharacterData02.java.template \
 394                 -spec $(UNICODEDATA)/UnicodeData.txt \
 395                 -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
 396                 -proplist $(UNICODEDATA)/PropList.txt \
 397                 -o $(GENSRCDIR)/java/lang/CharacterData02.java -string \
 398                 -usecharforbyte 11 4 1
 399         $(BOOT_JAVA_CMD) -jar $(GENERATECHARACTER_JARFILE) -plane 14 \
 400                 -template $(CHARACTERDATA)/CharacterData0E.java.template \
 401                 -spec $(UNICODEDATA)/UnicodeData.txt \
 402                 -specialcasing $(UNICODEDATA)/SpecialCasing.txt \
 403                 -proplist $(UNICODEDATA)/PropList.txt \
 404                 -o $(GENSRCDIR)/java/lang/CharacterData0E.java -string \
 405                 -usecharforbyte 11 4 1
 406 
 407 $(GENSRCDIR)/java/lang/%.java : $(CHARACTERDATA)/%.java.template
 408         $(install-file)
 409 
 410 clean::
 411         $(RM) $(GENSRCDIR)/java/lang/CharacterDataLatin1.java
 412         $(RM) $(GENSRCDIR)/java/lang/CharacterData00.java
 413         $(RM) $(GENSRCDIR)/java/lang/CharacterData01.java
 414         $(RM) $(GENSRCDIR)/java/lang/CharacterData02.java
 415         $(RM) $(GENSRCDIR)/java/lang/CharacterData0E.java
 416         $(RM) $(GENSRCDIR)/java/lang/CharacterDataUndefined.java
 417         $(RM) $(GENSRCDIR)/java/lang/CharacterDataPrivateUse.java
 418 
 419 #
 420 # Rules to generate classes/java/lang/uniName.dat
 421 #
 422 
 423 
 424 
 425 UNINAME = $(CLASSBINDIR)/java/lang/uniName.dat
 426 GENERATEUNINAME_JARFILE = $(BUILDTOOLJARDIR)/generatecharacter.jar
 427 
 428 build: $(UNINAME)
 429 
 430 $(UNINAME): $(UNICODEDATA)/UnicodeData.txt \
 431         $(GENERATECHARACTER_JARFILE)
 432         @$(prep-target)
 433         $(BOOT_JAVA_CMD) -classpath $(GENERATECHARACTER_JARFILE) \
 434         build.tools.generatecharacter.CharacterName \
 435                 $(UNICODEDATA)/UnicodeData.txt $(UNINAME)
 436 
 437 clean::
 438         $(RM) $(UNINAME)
 439 
 440 #
 441 # End of rules to create $(GENSRCDIR)/java/lang/CharacterDataXX.java
 442 #
 443 
 444 #
 445 # Rule to precompile CoreResourceBundleControl.java
 446 #
 447 LOCALES_GEN_SH = localelist.sh
 448 
 449 $(GENSRCDIR)/sun/util/CoreResourceBundleControl.java: \
 450         $(SHARE_SRC)/classes/sun/util/CoreResourceBundleControl-XLocales.java.template $(LOCALES_GEN_SH)
 451         @$(prep-target)
 452         NAWK="$(NAWK)" SED="$(SED)" $(SH) $(LOCALES_GEN_SH) "$(JRE_NONEXIST_LOCALES)" \
 453                 $< $@
 454 clean::
 455         $(RM) $(GENSRCDIR)/sun/util/CoreResourceBundleControl.java

--- EOF ---