提交 a07972c0 编写于 作者: M mlapshin

Merge

37a05a11f281b4d238e2f9e7ebb67c63f64d0e77 jdk7-b24 37a05a11f281b4d238e2f9e7ebb67c63f64d0e77 jdk7-b24
75fca0b0ab83ab1392e615910cea020f66535390 jdk7-b25
fb57027902e04ecafceae31a605e69b436c23d57 jdk7-b26
...@@ -41,7 +41,7 @@ endif ...@@ -41,7 +41,7 @@ endif
# Omit mirror since it's built with the apt tool. # Omit mirror since it's built with the apt tool.
SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \ SUBDIRS = $(SCRIPT_SUBDIR) image security crypto/provider jndi jmx \
java inputmethods org xml rowset net/httpserver net/ssl demo \ java inputmethods org xml rowset net/httpserver net/ssl demo \
tools jarsigner tools jarsigner tracing
all build clean clobber:: all build clean clobber::
$(SUBDIRS-loop) $(SUBDIRS-loop)
......
# #
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -87,8 +87,7 @@ ...@@ -87,8 +87,7 @@
# sign Alias for sign-jar # sign Alias for sign-jar
# sign-jar Builds/signs sunjce_provider.jar (no install) # sign-jar Builds/signs sunjce_provider.jar (no install)
# #
# obfus Builds/obfuscates/signs/installs # obfus Builds/obfuscates/signs sunjce_provider.jar
# sunjce_provider.jar
# #
# release Builds all targets in preparation # release Builds all targets in preparation
# for workspace integration. # for workspace integration.
...@@ -101,8 +100,25 @@ ...@@ -101,8 +100,25 @@
BUILDDIR = ../../../.. BUILDDIR = ../../../..
PACKAGE = com.sun.crypto.provider PACKAGE = com.sun.crypto.provider
PRODUCT = sun PRODUCT = sun
#
# The following is for when we need to do postprocessing
# (signing/obfuscation) against a read-only build. If the OUTPUTDIR
# isn't writable, the build currently crashes out.
#
ifndef OPENJDK
ifdef ALT_JCE_BUILD_DIR
# =====================================================
# Where to place the output, in case we're building from a read-only
# build area. (e.g. a release engineering build.)
JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
IGNORE_WRITABLE_OUTPUTDIR_TEST=true
else
JCE_BUILD_DIR=${TEMPDIR}
endif
endif
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
# #
# Location for the newly built classfiles. # Location for the newly built classfiles.
...@@ -147,6 +163,8 @@ endif # OPENJDK ...@@ -147,6 +163,8 @@ endif # OPENJDK
# #
UNSIGNED_DIR = $(TEMPDIR)/unsigned UNSIGNED_DIR = $(TEMPDIR)/unsigned
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
# ===================================================== # =====================================================
# Build the unsigned sunjce_provider.jar file. # Build the unsigned sunjce_provider.jar file.
...@@ -184,44 +202,66 @@ ifndef OPENJDK ...@@ -184,44 +202,66 @@ ifndef OPENJDK
# Sign the provider jar file. Not needed for OpenJDK. # Sign the provider jar file. Not needed for OpenJDK.
# #
SIGNED_DIR = $(TEMPDIR)/signed SIGNED_DIR = $(JCE_BUILD_DIR)/signed
sign: sign-jar sign: sign-jar
sign-jar: $(SIGNED_DIR)/sunjce_provider.jar sign-jar: $(SIGNED_DIR)/sunjce_provider.jar
ifndef ALT_JCE_BUILD_DIR
$(SIGNED_DIR)/sunjce_provider.jar: $(UNSIGNED_DIR)/sunjce_provider.jar $(SIGNED_DIR)/sunjce_provider.jar: $(UNSIGNED_DIR)/sunjce_provider.jar
$(sign-file) else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(SIGNED_DIR)/sunjce_provider.jar:
@if [ ! -r $(UNSIGNED_DIR)/sunjce_provider.jar ] ; then \
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunjce_provider.jar"; \
exit 1; \
fi
endif
$(call sign-file, $(UNSIGNED_DIR)/sunjce_provider.jar)
# ===================================================== # =====================================================
# Obfuscate/sign/install the JDK build. Not needed for OpenJDK. # Obfuscate/sign/install the JDK build. Not needed for OpenJDK.
# #
OBFUS_DIR = $(TEMPDIR)/obfus OBFUS_DIR = $(JCE_BUILD_DIR)/obfus/sunjce
CLOSED_DIR = $(BUILDDIR)/closed/com/sun/crypto/provider CLOSED_DIR = $(BUILDDIR)/closed/com/sun/crypto/provider
obfus: $(OBFUS_DIR)/sunjce_provider.jar obfus: $(OBFUS_DIR)/sunjce_provider.jar
$(release-warning) $(release-warning)
$(OBFUS_DIR)/sunjce_provider.jar: build-jar $(JCE_MANIFEST_FILE) ifndef ALT_JCE_BUILD_DIR
$(OBFUS_DIR)/sunjce_provider.jar: build-jar $(JCE_MANIFEST_FILE) \
$(OBFUS_DIR)/sunjce.dox
else
$(OBFUS_DIR)/sunjce_provider.jar: $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/sunjce.dox
@if [ ! -d $(CLASSDESTDIR) ] ; then \
$(ECHO) "Couldn't find $(CLASSDESTDIR)"; \
exit 1; \
fi
endif
@$(ECHO) ">>>Obfuscating SunJCE Provider..."
$(presign) $(presign)
$(preobfus) $(preobfus)
@$(ECHO) ">>>Obfuscating Sun JCE Provider..."
$(prep-target) $(prep-target)
$(CD) $(OBFUS_DIR); \ $(CD) $(OBFUS_DIR); \
$(OBFUSCATOR) -fv \ $(OBFUSCATOR) -fv sunjce.dox
$(CURRENT_DIRECTORY)/$(CLOSED_DIR)/obfus/sunjce.dox
@$(CD) $(OBFUS_DIR); $(java-vm-cleanup) @$(CD) $(OBFUS_DIR); $(java-vm-cleanup)
$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ \ $(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ \
-C $(OBFUS_DIR)/build com \ -C $(OBFUS_DIR)/build com \
$(JAR_JFLAGS) $(JAR_JFLAGS)
$(sign-target) $(sign-target)
$(MKDIR) -p $(dir $(JAR_DESTFILE))
$(RM) $(JAR_DESTFILE)
$(CP) $@ $(JAR_DESTFILE)
@$(java-vm-cleanup) @$(java-vm-cleanup)
$(OBFUS_DIR)/sunjce.dox: $(CLOSED_DIR)/obfus/sunjce.dox
@$(ECHO) ">>>Creating sunjce.dox"
$(prep-target)
$(SED) "s:@@TEMPDIR@@:$(ABS_TEMPDIR):" $< > $@
# #
# The current obfuscator has a limitation in that it currently only # The current obfuscator has a limitation in that it currently only
# supports up to v49 class file format. Force v49 classfiles in our # supports up to v49 class file format. Force v49 classfiles in our
...@@ -235,9 +275,9 @@ TARGET_CLASS_VERSION = 5 ...@@ -235,9 +275,9 @@ TARGET_CLASS_VERSION = 5
# #
release: $(OBFUS_DIR)/sunjce_provider.jar release: $(OBFUS_DIR)/sunjce_provider.jar
$(RM) $(RELEASE_DIR)/sunjce_provider.jar $(RM) $(JCE_BUILD_DIR)/release/sunjce_provider.jar
$(MKDIR) -p $(RELEASE_DIR) $(MKDIR) -p $(JCE_BUILD_DIR)/release
$(CP) $(OBFUS_DIR)/sunjce_provider.jar $(RELEASE_DIR) $(CP) $(OBFUS_DIR)/sunjce_provider.jar $(JCE_BUILD_DIR)/release
$(release-warning) $(release-warning)
endif # OPENJDK endif # OPENJDK
...@@ -275,7 +315,7 @@ endif ...@@ -275,7 +315,7 @@ endif
# #
clobber clean:: clobber clean::
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
.PHONY: build-jar jar install-jar .PHONY: build-jar jar install-jar
ifndef OPENJDK ifndef OPENJDK
......
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
# Makefile for building tracing classes
#
BUILDDIR = ../../..
PACKAGE = com.sun.tracing
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dtrace
all build:
$(SUBDIRS-loop)
clean clobber::
$(SUBDIRS-loop)
AUTO_FILES_JAVA_DIRS = com/sun/tracing
#
# Rules.
#
include $(BUILDDIR)/common/Classes.gmk
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
# Makefile for building dtrace extension
#
BUILDDIR = ../../../..
PACKAGE = com.sun.tracing.dtrace
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
AUTO_FILES_JAVA_DIRS = com/sun/tracing/dtrace
#
# Rules.
#
include $(BUILDDIR)/common/Classes.gmk
...@@ -50,13 +50,13 @@ CC_DEPEND = -MM ...@@ -50,13 +50,13 @@ CC_DEPEND = -MM
CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
ifndef PLATFORM_SRC ifndef PLATFORM_SRC
PLATFORM_SRC = $(JDK_TOPDIR)/src/solaris PLATFORM_SRC = $(BUILDDIR)/../src/solaris
endif # PLATFORM_SRC endif # PLATFORM_SRC
# Platform specific closed sources # Platform specific closed sources
ifndef OPENJDK ifndef OPENJDK
ifndef CLOSED_PLATFORM_SRC ifndef CLOSED_PLATFORM_SRC
CLOSED_PLATFORM_SRC = $(JDK_TOPDIR)/src/closed/solaris CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
endif endif
endif endif
......
...@@ -45,13 +45,13 @@ ...@@ -45,13 +45,13 @@
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
ifndef PLATFORM_SRC ifndef PLATFORM_SRC
PLATFORM_SRC = $(JDK_TOPDIR)/src/solaris PLATFORM_SRC = $(BUILDDIR)/../src/solaris
endif # PLATFORM_SRC endif # PLATFORM_SRC
# Platform specific closed sources # Platform specific closed sources
ifndef OPENJDK ifndef OPENJDK
ifndef CLOSED_PLATFORM_SRC ifndef CLOSED_PLATFORM_SRC
CLOSED_PLATFORM_SRC = $(JDK_TOPDIR)/src/closed/solaris CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
endif endif
endif endif
......
...@@ -51,13 +51,13 @@ ifndef LIB_LOCATION ...@@ -51,13 +51,13 @@ ifndef LIB_LOCATION
endif # LIB_LOCATION endif # LIB_LOCATION
ifndef PLATFORM_SRC ifndef PLATFORM_SRC
PLATFORM_SRC = $(JDK_TOPDIR)/src/windows PLATFORM_SRC = $(BUILDDIR)/../src/windows
endif # PLATFORM_SRC endif # PLATFORM_SRC
# Platform specific closed sources # Platform specific closed sources
ifndef OPENJDK ifndef OPENJDK
ifndef CLOSED_PLATFORM_SRC ifndef CLOSED_PLATFORM_SRC
CLOSED_PLATFORM_SRC = $(JDK_TOPDIR)/src/closed/windows CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/windows
endif endif
endif endif
...@@ -367,7 +367,7 @@ else ...@@ -367,7 +367,7 @@ else
endif endif
# Settings for the VERSIONINFO tap on windows. # Settings for the VERSIONINFO tap on windows.
VERSIONINFO_RESOURCE = $(JDK_TOPDIR)/src/windows/resource/version.rc VERSIONINFO_RESOURCE = $(BUILDDIR)/../src/windows/resource/version.rc
ifneq ($(JDK_BUILD_NUMBER),) ifneq ($(JDK_BUILD_NUMBER),)
COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) | $(SED) -e 's/^b//' -e 's/^0//') COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) | $(SED) -e 's/^b//' -e 's/^0//')
......
...@@ -32,6 +32,13 @@ ...@@ -32,6 +32,13 @@
# So when it includes other files, it must use JDK_TOPDIR. # So when it includes other files, it must use JDK_TOPDIR.
# #
# Check for strange explicit settings (change to empty or true)
ifdef OPENJDK
ifneq ($(OPENJDK),true)
x:=$(error "OPENJDK (if defined) can only be set to true")
endif
endif
# #
# On Solaris, the 'make' utility from Sun will not work with these makefiles. # On Solaris, the 'make' utility from Sun will not work with these makefiles.
# This little rule is only understood by Sun's make, and is harmless # This little rule is only understood by Sun's make, and is harmless
...@@ -41,7 +48,15 @@ ...@@ -41,7 +48,15 @@
SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
ifndef JDK_TOPDIR ifndef JDK_TOPDIR
JDK_TOPDIR=$(BUILDDIR)/.. ifdef BUILDDIR
JDK_TOPDIR=$(BUILDDIR)/..
else
JDK_TOPDIR:=$(error "ERROR: Cannot define top of jdk repository")
endif
endif
ifndef BUILDDIR
# Hack, due to deploy repository using this file.
BUILDDIR=$(JDK_TOPDIR)/make
endif endif
ifndef JDK_MAKE_SHARED_DIR ifndef JDK_MAKE_SHARED_DIR
JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
...@@ -59,13 +74,13 @@ include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk ...@@ -59,13 +74,13 @@ include $(JDK_TOPDIR)/make/common/CancelImplicits.gmk
# there yet. # there yet.
# #
ifndef SHARE_SRC ifndef SHARE_SRC
SHARE_SRC = $(JDK_TOPDIR)/src/share SHARE_SRC = $(BUILDDIR)/../src/share
endif endif
# Files that cannot be included in the OpenJDK distribution are # Files that cannot be included in the OpenJDK distribution are
# collected under a parent directory which contains just those files. # collected under a parent directory which contains just those files.
ifndef CLOSED_SRC ifndef CLOSED_SRC
CLOSED_SRC = $(JDK_TOPDIR)/src/closed CLOSED_SRC = $(BUILDDIR)/../src/closed
endif endif
# If we have no closed directory, force it to an openjdk build # If we have no closed directory, force it to an openjdk build
...@@ -79,19 +94,6 @@ ifeq ($(CLOSED_SRC_DIR_EXISTS), false) ...@@ -79,19 +94,6 @@ ifeq ($(CLOSED_SRC_DIR_EXISTS), false)
OPENJDK = true OPENJDK = true
endif endif
# Check for strange explicit settings (change to empty or true)
ifdef OPENJDK
ifeq ($(OPENJDK),false)
# Silently treat as not defined
OPENJDK =
else
ifneq ($(OPENJDK),true)
dummy := $(warning "WARNING: OPENKJDK=$(OPENJDK) being treated as true")
OPENJDK = true
endif
endif
endif
# Define where closed directories are # Define where closed directories are
ifdef OPENJDK ifdef OPENJDK
CLOSED_SRC = CLOSED_SRC =
...@@ -170,14 +172,6 @@ ifdef OPENJDK ...@@ -170,14 +172,6 @@ ifdef OPENJDK
endif endif
endif # OPENJDK endif # OPENJDK
# Default output directory
ifdef OPENJDK
_OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
else
_OUTPUTDIR=$(JDK_TOPDIR)/build/$(PLATFORM)-$(ARCH)
endif
# #
# Get platform definitions # Get platform definitions
# #
...@@ -309,6 +303,8 @@ BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses ...@@ -309,6 +303,8 @@ BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses
# for build tool jar files # for build tool jar files
BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
# for generated tool class files
BUILDTOOLBINDIR = $(OUTPUTDIR)/btbins
# for generated java source files # for generated java source files
GENSRCDIR = $(OUTPUTDIR)/gensrc GENSRCDIR = $(OUTPUTDIR)/gensrc
# for generated C source files (not javah) # for generated C source files (not javah)
......
...@@ -231,12 +231,14 @@ classes : $(CLASSES_INIT) .delete.classlist .compile.classlist ...@@ -231,12 +231,14 @@ classes : $(CLASSES_INIT) .delete.classlist .compile.classlist
.compile.classlist : $(JAVA_SOURCE_LIST) .compile.classlist : $(JAVA_SOURCE_LIST)
@$(MKDIR) -p $(CLASSDESTDIR) @$(MKDIR) -p $(CLASSDESTDIR)
@if [ `$(CAT) $(JAVA_SOURCE_LIST) | $(WC) -l` -ge 1 ] ; then \ @$(RM) $<.filtered
$(ECHO) "# Java sources to be compiled: (listed in file $(JAVA_SOURCE_LIST))"; \ @$(CAT) $< | $(NAWK) 'length>0' | $(SORT) -u > $<.filtered
$(CAT) $(JAVA_SOURCE_LIST); \ @if [ `$(CAT) $<.filtered | $(WC) -l` -ge 1 ] ; then \
$(ECHO) "# Java sources to be compiled: (listed in file $<)"; \
$(CAT) $<.filtered; \
$(ECHO) "# Running javac:"; \ $(ECHO) "# Running javac:"; \
$(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \ $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
$(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$(JAVA_SOURCE_LIST); \ $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
fi fi
@$(java-vm-cleanup) @$(java-vm-cleanup)
......
...@@ -45,10 +45,8 @@ ifeq ($(PLATFORM), windows) ...@@ -45,10 +45,8 @@ ifeq ($(PLATFORM), windows)
NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
CC_VER = UNKNOWN CC_VER = UNKNOWN
CC_TYPE = UNKNOWN
else else
CC_VER = UNKNOWN CC_VER = UNKNOWN
CC_TYPE = UNKNOWN
endif endif
_LINK_VER :=$(shell $(LINK) 2>&1 | $(HEAD) -n 1) _LINK_VER :=$(shell $(LINK) 2>&1 | $(HEAD) -n 1)
LINK_VER :=$(call GetVersion,"$(_LINK_VER)") LINK_VER :=$(call GetVersion,"$(_LINK_VER)")
......
...@@ -47,13 +47,13 @@ ifeq ($(PLATFORM), windows) ...@@ -47,13 +47,13 @@ ifeq ($(PLATFORM), windows)
# unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake # unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake
NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
# Compiler version and type (Always get word after "Version")
CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(SED) 's/.*\(Version.*\)/\1/' | $(NAWK) '{print $$2}')
# SDK-64 and MSVC6 put REBASE.EXE in a different places - go figure... # SDK-64 and MSVC6 put REBASE.EXE in a different places - go figure...
ifeq ($(ARCH_DATA_MODEL), 32) ifeq ($(ARCH_DATA_MODEL), 32)
CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$8}')
LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}') LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
CC_TYPE := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$5}')
CC_MAJORVER :=$(call MajorVersion,$(CC_VER)) CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
REQUIRED_CCTYPE = Optimizing
REQUIRED_CC_VER = 13.10.3077 REQUIRED_CC_VER = 13.10.3077
REQUIRED_LINK_VER = 7.10.3077 REQUIRED_LINK_VER = 7.10.3077
ifeq ($(CC_MAJORVER), 12) ifeq ($(CC_MAJORVER), 12)
...@@ -85,9 +85,7 @@ ifeq ($(PLATFORM), windows) ...@@ -85,9 +85,7 @@ ifeq ($(PLATFORM), windows)
endif endif
endif endif
else else
CC_VER := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$7}')
LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}') LINK_VER := $(shell $(LINK) | $(HEAD) -n 1 | $(NAWK) '{print $$6}')
CC_TYPE := $(shell $(CC) 2>&1 | $(HEAD) -n 1 | $(NAWK) '{print $$4}')
CC_MAJORVER :=$(call MajorVersion,$(CC_VER)) CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
CC_MINORVER :=$(call MinorVersion,$(CC_VER)) CC_MINORVER :=$(call MinorVersion,$(CC_VER))
CC_MICROVER :=$(call MicroVersion,$(CC_VER)) CC_MICROVER :=$(call MicroVersion,$(CC_VER))
......
...@@ -36,7 +36,7 @@ ifndef JDK_MAKE_SHARED_DIR ...@@ -36,7 +36,7 @@ ifndef JDK_MAKE_SHARED_DIR
endif endif
ifndef CONTROL_TOPDIR ifndef CONTROL_TOPDIR
CONTROL_TOPDIR=$(TOPDIR)/control CONTROL_TOPDIR=$(TOPDIR)
endif endif
ifndef HOTSPOT_TOPDIR ifndef HOTSPOT_TOPDIR
HOTSPOT_TOPDIR=$(TOPDIR)/hotspot HOTSPOT_TOPDIR=$(TOPDIR)/hotspot
...@@ -69,8 +69,8 @@ endif ...@@ -69,8 +69,8 @@ endif
# Get shared platform settings # Get shared platform settings
include $(JDK_MAKE_SHARED_DIR)/Platform.gmk include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
# Default output directory # Default directory immediately above the "build" output directory (OUTPUTDIR)
_OUTPUTDIR=$(CONTROL_TOPDIR)/build/$(PLATFORM)-$(ARCH) BUILD_PARENT_DIRECTORY=$(TOPDIR)
# Get platform specific settings # Get platform specific settings
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
......
...@@ -67,16 +67,6 @@ ifeq ($(PLATFORM),windows) ...@@ -67,16 +67,6 @@ ifeq ($(PLATFORM),windows)
UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH) UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
endif endif
# Utilities ant and findbugs
ifndef ANT_HOME
ANT_HOME = $(JDK_DEVTOOLS_DIR)/share/ant/latest
endif
ANT = $(ANT_HOME)/bin/ant
ifndef FINDBUGS_HOME
FINDBUGS_HOME = $(JDK_DEVTOOLS_DIR)/share/findbugs/latest
endif
FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
# Utilities # Utilities
ADB = $(UTILS_COMMAND_PATH)adb ADB = $(UTILS_COMMAND_PATH)adb
AR = $(UTILS_CCS_BIN_PATH)ar AR = $(UTILS_CCS_BIN_PATH)ar
......
# #
# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -55,7 +55,10 @@ include $(JDK_MAKE_SHARED_DIR)/Defs-utils.gmk ...@@ -55,7 +55,10 @@ include $(JDK_MAKE_SHARED_DIR)/Defs-utils.gmk
# Simple pwd path # Simple pwd path
define PwdPath define PwdPath
$(shell cd $1 2> $(DEV_NULL) && pwd) $(shell $(CD) $1 2> $(DEV_NULL) && $(PWD))
endef
define AbsPwdPathCheck
$(shell $(CD) .. 2> $(DEV_NULL) && $(CD) $1 2> $(DEV_NULL) && $(PWD))
endef endef
# Checks an ALT value for spaces (should be one word), # Checks an ALT value for spaces (should be one word),
...@@ -262,7 +265,9 @@ ifdef BUILD_NUMBER ...@@ -262,7 +265,9 @@ ifdef BUILD_NUMBER
FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER) FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER)
else else
BUILD_NUMBER = b00 BUILD_NUMBER = b00
USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`) BUILD_DATE := $(shell $(DATE) '+%Y_%m_%d_%H_%M')
CLEAN_USERNAME := $(shell $(ECHO) "$(USER)" | $(TR) -d -c '[:alnum:]')
USER_RELEASE_SUFFIX := $(shell $(ECHO) "$(CLEAN_USERNAME)_$(BUILD_DATE)" | $(TR) '[:upper:]' '[:lower:]' )
FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER) FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER)
endif endif
...@@ -422,24 +427,64 @@ CACERTS_FILE:=$(call AltCheckSpaces,CACERTS_FILE) ...@@ -422,24 +427,64 @@ CACERTS_FILE:=$(call AltCheckSpaces,CACERTS_FILE)
CACERTS_FILE:=$(call AltCheckValue,CACERTS_FILE) CACERTS_FILE:=$(call AltCheckValue,CACERTS_FILE)
# OUTPUTDIR: Location of all output for the build # OUTPUTDIR: Location of all output for the build
_BACKUP_OUTPUTDIR = $(TEMP_DISK)/$(USER)/jdk-outputdir
ifdef ALT_OUTPUTDIR ifdef ALT_OUTPUTDIR
_POSSIBLE_OUTPUTDIR =$(subst \,/,$(ALT_OUTPUTDIR)) OUTPUTDIR:=$(subst \,/,$(ALT_OUTPUTDIR))
# Assumes this is absolute (checks later)
ABS_OUTPUTDIR:=$(OUTPUTDIR)
else else
ifndef _OUTPUTDIR ifndef _OUTPUTDIR
_OUTPUTDIR = $(_BACKUP_OUTPUTDIR) # Default: Get "build" parent directory, which should always exist
ifndef BUILD_PARENT_DIRECTORY
BUILD_PARENT_DIRECTORY=$(BUILDDIR)/..
endif
ABS_BUILD_PARENT_DIRECTORY:=$(call FullPath,$(BUILD_PARENT_DIRECTORY))
ifdef OPENJDK
_OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)$(OPENJDK_SUFFIX)
else
_OUTPUTDIRNAME=$(PLATFORM)-$(ARCH)
endif
_OUTPUTDIR=$(BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
ABS_OUTPUTDIR:=$(ABS_BUILD_PARENT_DIRECTORY)/build/$(_OUTPUTDIRNAME)
endif endif
_POSSIBLE_OUTPUTDIR =$(_OUTPUTDIR) OUTPUTDIR:=$(_OUTPUTDIR)
endif
_create_outputdir1:=$(shell mkdir -p $(_POSSIBLE_OUTPUTDIR) > $(DEV_NULL) 2>&1)
OUTPUTDIR:=$(call WriteDirExists,$(_POSSIBLE_OUTPUTDIR),$(_BACKUP_OUTPUTDIR))
_create_outputdir2:=$(shell mkdir -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1)
ifeq "$(OUTPUTDIR)" "$(_BACKUP_OUTPUTDIR)"
_outputdir_warning:=$(warning "WARNING: OUTPUTDIR '$(_POSSIBLE_OUTPUTDIR)' not writable, will use '$(_BACKUP_OUTPUTDIR)'")
endif endif
# Check for spaces and null value
OUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR) OUTPUTDIR:=$(call AltCheckSpaces,OUTPUTDIR)
OUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR) OUTPUTDIR:=$(call AltCheckValue,OUTPUTDIR)
#
# When signing the JCE framework and provider, we could be using built
# bits on a read-only filesystem. If so, this test will fail and crash
# the build.
#
ifndef IGNORE_WRITABLE_OUTPUTDIR_TEST
# Create the output directory and make sure it exists and is writable
_create_outputdir:=$(shell $(MKDIR) -p "$(OUTPUTDIR)" > $(DEV_NULL) 2>&1)
ifeq ($(call WriteDirExists,$(OUTPUTDIR),/dev/null),/dev/null)
_outputdir_error:=$(error "ERROR: OUTPUTDIR '$(OUTPUTDIR)' not created or not writable")
endif
endif
# Define absolute path if needed and check for spaces and null value
ifndef ABS_OUTPUTDIR
ABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
endif
ABS_OUTPUTDIR:=$(call AltCheckSpaces,ABS_OUTPUTDIR)
ABS_OUTPUTDIR:=$(call AltCheckValue,ABS_OUTPUTDIR)
# Make doubly sure this is a full path
ifeq ($(call AbsPwdPathCheck,$(ABS_OUTPUTDIR)), )
ifdef ALT_OUTPUTDIR
_outputdir_error:=$(error "ERROR: Trouble with the absolute path for OUTPUTDIR '$(OUTPUTDIR)', was ALT_OUTPUTDIR '$(ALT_OUTPUTDIR)' an absolute path?")
else
_outputdir_error:=$(error "ERROR: Trouble with the absolute path for OUTPUTDIR '$(OUTPUTDIR)'")
endif
endif
_dir1:=$(call FullPath,$(ABS_OUTPUTDIR))
_dir2:=$(call FullPath,$(OUTPUTDIR))
ifneq ($(_dir1),$(_dir2))
_outputdir_error:=$(error "ERROR: ABS_OUTPUTDIR '$(ABS_OUTPUTDIR)' is not the same directory as OUTPUTDIR '$(OUTPUTDIR)', '$(_dir1)'!='$(_dir2)'")
endif
# Bin directory # Bin directory
# NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64 # NOTE: ISA_DIR is usually empty, on Solaris it might be /sparcv9 or /amd64
BINDIR = $(OUTPUTDIR)/bin$(ISA_DIR) BINDIR = $(OUTPUTDIR)/bin$(ISA_DIR)
...@@ -469,15 +514,30 @@ JDK_CUPS_HEADERS_PATH=$(JDK_DEVTOOLS_DIR)/share/cups/include ...@@ -469,15 +514,30 @@ JDK_CUPS_HEADERS_PATH=$(JDK_DEVTOOLS_DIR)/share/cups/include
endif endif
endif endif
# Utilities ant and findbugs
ifeq ($(ANT_HOME),)
ANT_HOME := $(call DirExists,/usr/share/ant,$(JDK_DEVTOOLS_DIR)/share/ant/latest,)
endif
ifeq ($(ANT_HOME),)
ANT = ant
else
ANT = $(ANT_HOME)/bin/ant
endif
ifeq ($(FINDBUGS_HOME),)
FINDBUGS_HOME := $(call DirExists,/usr/share/findbugs,$(JDK_DEVTOOLS_DIR)/share/findbugs/latest,)
endif
ifeq ($(FINDBUGS_HOME),)
FINDBUGS = findbugs
else
FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
endif
ifdef ALT_COPYRIGHT_YEAR ifdef ALT_COPYRIGHT_YEAR
COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
else else
COPYRIGHT_YEAR = $(shell $(DATE) '+%Y') COPYRIGHT_YEAR = $(shell $(DATE) '+%Y')
endif endif
# Absolute path to output directory
ABS_OUTPUTDIR:=$(call FullPath,$(OUTPUTDIR))
# Get shared compiler settings # Get shared compiler settings
include $(JDK_MAKE_SHARED_DIR)/Compiler.gmk include $(JDK_MAKE_SHARED_DIR)/Compiler.gmk
...@@ -93,20 +93,18 @@ SYSTEM_UNAME := $(shell uname) ...@@ -93,20 +93,18 @@ SYSTEM_UNAME := $(shell uname)
# Normal boot jdk is previous release, but a hard requirement is a 1.5 boot # Normal boot jdk is previous release, but a hard requirement is a 1.5 boot
REQUIRED_BOOT_VER = 1.5 REQUIRED_BOOT_VER = 1.5
#This is specific to OpenJDK build # If we are using freetype, this is the required version
ifdef OPENJDK REQUIRED_FREETYPE_VERSION=2.3.0
REQUIRED_FREETYPE_VERSION=2.3.0
endif
# #
# Prune out all known SCM (Source Code Management) directories # Prune out all known SCM (Source Code Management) directories
# so they will not be included when copying directory trees # so they will not be included when copying directory trees
# or packaging up .jar files, etc. This applies to all workspaces. # or packaging up .jar files, etc. This applies to all workspaces.
# #
SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files .hgignore .hgtags
# When changing SCM_DIRs also change SCM_DIRS_rexp and SCM_DIRS_prune: # When changing SCM_DIRs also change SCM_DIRS_rexp and SCM_DIRS_prune:
SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files" SCM_DIRS_rexp = ".hg|.svn|CVS|RCS|SCCS|Codemgr_wsdata|deleted_files|.hgignore|.hgtags"
SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files \) -prune SCM_DIRS_prune = \( -name .hg -o -name .svn -o -name CVS -o -name RCS -o -name SCCS -o -name Codemgr_wsdata -o -name deleted_files -o -name .hgignore -o -name .hgtags \) -prune
# Don't define this unless it's not defined # Don't define this unless it's not defined
ifndef VARIANT ifndef VARIANT
...@@ -272,7 +270,7 @@ ifeq ($(SYSTEM_UNAME), Linux) ...@@ -272,7 +270,7 @@ ifeq ($(SYSTEM_UNAME), Linux)
REQUIRED_ALSA_VERSION = ^((0[.]9[.][1-9])|(1[.]0[.][0-9]))[0-9]* REQUIRED_ALSA_VERSION = ^((0[.]9[.][1-9])|(1[.]0[.][0-9]))[0-9]*
endif endif
# How much RAM does this machine have: # How much RAM does this machine have:
MB_OF_MEMORY := $(shell free -m | fgrep Mem: | sed -e 's@\ \ *@ @g' | cut -d' ' -f2) MB_OF_MEMORY := $(shell free -m | fgrep Mem: | awk '{print $$2;}' )
endif endif
# Windows with and without CYGWIN will be slightly different # Windows with and without CYGWIN will be slightly different
...@@ -376,45 +374,35 @@ ifeq ($(PLATFORM), windows) ...@@ -376,45 +374,35 @@ ifeq ($(PLATFORM), windows)
REQUIRED_DXSDK_VER = 0x0700 REQUIRED_DXSDK_VER = 0x0700
OS_VENDOR = Microsoft OS_VENDOR = Microsoft
# How much RAM does this machine have: # How much RAM does this machine have:
MB_OF_MEMORY := $(shell \ ifeq ($(USING_CYGWIN),true)
if [ -f "C:/cygwin/bin/free.exe" ] ; then \ # CYGWIN has the 'free' utility
( C:/cygwin/bin/bash.exe -c "C:/cygwin/bin/free.exe -m" ) | \ _MB_OF_MEMORY := \
grep Mem: | \ $(shell free -m | grep Mem: | awk '{print $$2;}' )
sed -e 's@\ \ *@ @g' | cut -d' ' -f2 ; \ else
else \ # Windows 2000 has the mem utility, but two memory areas
echo "512"; \ # extended memory is what is beyond 1024M
fi) _B_OF_EXT_MEMORY := \
endif $(shell mem 2> $(DEV_NULL) | grep 'total contiguous extended memory' | awk '{print $$1;}')
ifeq ($(_B_OF_EXT_MEMORY),)
# Machines with 512Mb or less of real memory are considered low memory _B_OF_MEMORY := \
# build machines and adjustments will be made to prevent excessing $(shell mem 2> $(DEV_NULL) | grep 'total conventional memory' | awk '{print $$1;}')
# system swapping during the build. else
# If we don't know, assume 512. Subtract 128 from MB for VM MAX. _B_OF_MEMORY := \
# Don't set VM max over 1024-128=896. $(shell expr 1048576 '+' $(_B_OF_EXT_MEMORY) 2> $(DEV_NULL))
ifneq ($(MB_OF_MEMORY),) endif
LOW_MEMORY_MACHINE := $(shell \ ifeq ($(_B_OF_MEMORY),)
if [ $(MB_OF_MEMORY) -le 512 ] ; then \ # Windows 2003 has the systeminfo utility use it if mem doesn't work
echo "true"; \ _MB_OF_MEMORY := \
else \ $(shell systeminfo 2> $(DEV_NULL) | grep 'Total Physical Memory:' | awk '{print $$4;}' | sed -e 's@,@@')
echo "false"; \ else
fi) _MB_OF_MEMORY := $(shell expr $(_B_OF_MEMORY) '/' 1024 2> $(DEV_NULL))
MAX_VM_MEMORY := $(shell \ endif
if [ $(MB_OF_MEMORY) -le 1024 ] ; then \ endif
expr $(MB_OF_MEMORY) '-' 128 ; \ ifeq ($(shell expr $(_MB_OF_MEMORY) '+' 0 2> $(DEV_NULL)), $(_MB_OF_MEMORY))
else \ MB_OF_MEMORY := $(_MB_OF_MEMORY)
echo "896"; \ else
fi) MB_OF_MEMORY := 512
MIN_VM_MEMORY := $(shell \ endif
if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
expr $(MAX_VM_MEMORY) '-' 8 ; \
else \
echo "128"; \
fi)
else
MB_OF_MEMORY := unknown
LOW_MEMORY_MACHINE := true
MAX_VM_MEMORY := 384
MIN_VM_MEMORY := 128
endif endif
REQUIRED_ZIP_VER = 2.2 REQUIRED_ZIP_VER = 2.2
...@@ -454,6 +442,37 @@ ifneq ($(PLATFORM), windows) ...@@ -454,6 +442,37 @@ ifneq ($(PLATFORM), windows)
ARCH_VM_SUBDIR=jre/lib/$(LIBARCH) ARCH_VM_SUBDIR=jre/lib/$(LIBARCH)
endif endif
# Machines with 512Mb or less of real memory are considered low memory
# build machines and adjustments will be made to prevent excessing
# system swapping during the build.
# If we don't know, assume 512. Subtract 128 from MB for VM MAX.
# Don't set VM max over 1024-128=896.
ifneq ($(MB_OF_MEMORY),)
LOW_MEMORY_MACHINE := $(shell \
if [ $(MB_OF_MEMORY) -le 512 ] ; then \
echo "true"; \
else \
echo "false"; \
fi)
MAX_VM_MEMORY := $(shell \
if [ $(MB_OF_MEMORY) -le 1024 ] ; then \
expr $(MB_OF_MEMORY) '-' 128 2> $(DEV_NULL) ; \
else \
echo "896"; \
fi)
MIN_VM_MEMORY := $(shell \
if [ $(MAX_VM_MEMORY) -le 128 ] ; then \
expr $(MAX_VM_MEMORY) '-' 8 2> $(DEV_NULL) ; \
else \
echo "128"; \
fi)
else
MB_OF_MEMORY := unknown
LOW_MEMORY_MACHINE := true
MAX_VM_MEMORY := 384
MIN_VM_MEMORY := 128
endif
# If blanks in the username, use the first 4 words and pack them together # If blanks in the username, use the first 4 words and pack them together
_USER1:=$(subst ', ,$(_USER)) _USER1:=$(subst ', ,$(_USER))
_USER2:=$(subst ", ,$(_USER1)) _USER2:=$(subst ", ,$(_USER1))
......
...@@ -105,13 +105,21 @@ ZIP_VER :=$(call GetVersion,"$(_ZIP_VER)") ...@@ -105,13 +105,21 @@ ZIP_VER :=$(call GetVersion,"$(_ZIP_VER)")
UNZIP_VER :=$(call GetVersion,"$(_UNZIP_VER)") UNZIP_VER :=$(call GetVersion,"$(_UNZIP_VER)")
BOOT_VER :=$(call GetVersion,"$(_BOOT_VER)") BOOT_VER :=$(call GetVersion,"$(_BOOT_VER)")
REQUIRED_ANT_VER := 1.6.3 REQUIRED_ANT_VER := 1.6.3
_ANT_VER :=$(shell $(ANT) -version 2>&1 ) ifeq ($(ANT_HOME),)
ANT_VER :=$(call GetVersion,"$(_ANT_VER)") _ANT_VER:=$(shell JAVACMD="$(BOOTDIR)/bin/java" $(ANT) -version 2>&1 )
else
_ANT_VER:=$(shell JAVACMD="$(BOOTDIR)/bin/java" ANT_HOME="$(ANT_HOME)" $(ANT) -version 2>&1 )
endif
ANT_VER:=$(call GetVersion,"$(_ANT_VER)")
REQUIRED_FINDBUGS_VER := 1.1 REQUIRED_FINDBUGS_VER := 1.2
_FINDBUGS_VER :=$(shell $(FINDBUGS) -version 2>&1 ) ifeq ($(FINDBUGS_HOME),)
FINDBUGS_VER :=$(call GetVersion,"$(_FINDBUGS_VER)") _FINDBUGS_VER:=$(shell $(FINDBUGS) -javahome "$(BOOTDIR)" -textui -version 2>&1 )
else
_FINDBUGS_VER:=$(shell FINDBUGS_HOME="$(FINDBUGS_HOME)" $(FINDBUGS) -javahome "$(BOOTDIR)" -textui -version 2>&1 )
endif
FINDBUGS_VER:=$(call GetVersion,"$(_FINDBUGS_VER)")
ifdef ALT_BINDIR ifdef ALT_BINDIR
ALT_BINDIR_VERSION := $(shell $(ALT_BINDIR)/java$(EXE_SUFFIX) -version 2>&1 | $(NAWK) -F'"' '{ print $$2 }') ALT_BINDIR_VERSION := $(shell $(ALT_BINDIR)/java$(EXE_SUFFIX) -version 2>&1 | $(NAWK) -F'"' '{ print $$2 }')
...@@ -780,21 +788,17 @@ sane-cacerts: ...@@ -780,21 +788,17 @@ sane-cacerts:
ifdef OPENJDK ifdef OPENJDK
#name of test program that prints out "Failed" if freetype is not good enough # The freetypecheck Makefile prints out "Failed" if not good enough
FREETYPE_VERSION_CHECK_NAME = freetype_versioncheck $(TEMPDIR)/freetypeinfo: FRC
FREETYPE_VERSION_CHECK = $(TEMPDIR)/$(FREETYPE_VERSION_CHECK_NAME)$(EXE_SUFFIX) @$(prep-target)
@(($(CD) $(BUILDDIR)/tools/freetypecheck && $(MAKE)) || \
sane-freetype: $(ECHO) "Failed to build freetypecheck." ) > $@
@-($(CD) $(BUILDDIR)/tools/freetypecheck && \
$(MAKE) REQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION) \ sane-freetype: $(TEMPDIR)/freetypeinfo
FT_TEST=$(FREETYPE_VERSION_CHECK_NAME) \ @if [ "`$(CAT) $< | $(GREP) Fail`" != "" ]; then \
FT_HEADERS=$(FREETYPE_HEADERS_PATH) \
FT_LIB=$(FREETYPE_LIB_PATH) \
XARCH=$(XARCH))
@if [ ! -r $(FREETYPE_VERSION_CHECK) -o \
"`$(FREETYPE_VERSION_CHECK) | $(GREP) Fail`" != "" ]; then \
$(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \ $(ECHO) "ERROR: FreeType version " $(REQUIRED_FREETYPE_VERSION) \
"or higher is required. \n" >> $(ERROR_FILE) ; \ " or higher is required. \n" \
"`$(CAT) $<` \n" >> $(ERROR_FILE) ; \
fi fi
else else
...@@ -1331,7 +1335,7 @@ sane-compiler: sane-link ...@@ -1331,7 +1335,7 @@ sane-compiler: sane-link
ifndef OPENJDK ifndef OPENJDK
@if [ "$(CC_CHECK)" != "same" ]; then \ @if [ "$(CC_CHECK)" != "same" ]; then \
$(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \ $(ECHO) "WARNING: The $(PLATFORM) compiler is not version $(COMPILER_VERSION) $(REQUIRED_CC_VER) \n" \
" Specifically the $(COMPILER_NAME) $(CC_TYPE) compiler. \n " \ " Specifically the $(COMPILER_NAME) compiler. \n " \
" $(YOU_ARE_USING) compiler version: $(CC_VER) \n" \ " $(YOU_ARE_USING) compiler version: $(CC_VER) \n" \
" The compiler was obtained from the following location: \n" \ " The compiler was obtained from the following location: \n" \
" $(COMPILER_PATH) \n" \ " $(COMPILER_PATH) \n" \
...@@ -1564,31 +1568,31 @@ ifeq ($(ARCH_DATA_MODEL), 32) ...@@ -1564,31 +1568,31 @@ ifeq ($(ARCH_DATA_MODEL), 32)
endif endif
###################################################### ######################################################
# SECURITY_BASELINE_142 test # SECURITY_BASELINE_142 test
###################################################### ######################################################
security_baseline_142: security_baseline_142:
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
@if [ -z "$(SECURITY_BASELINE_142)" ]; then \ @if [ -z "$(SECURITY_BASELINE_142)" ]; then \
$(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \ $(ECHO) "WARNING: Your SECURITY_BASELINE_142 setting is empty.\n" \
" Setting it to the default value of 1.4.2_10.\n" \ " Setting it to the default value of 1.4.2_10.\n" \
" It is recommended to set SECURITY_BASELINE_142.\n" \ " It is recommended to set SECURITY_BASELINE_142.\n" \
"" >> $(WARNING_FILE) ; \ "" >> $(WARNING_FILE) ; \
fi fi
endif endif
###################################################### ######################################################
# SECURITY_BASELINE_150 test # SECURITY_BASELINE_150 test
###################################################### ######################################################
security_baseline_150: security_baseline_150:
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
@if [ -z "$(SECURITY_BASELINE_150)" ]; then \ @if [ -z "$(SECURITY_BASELINE_150)" ]; then \
$(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \ $(ECHO) "WARNING: Your SECURITY_BASELINE_150 setting is empty.\n" \
" Setting it to the default value of 1.5.0_07.\n" \ " Setting it to the default value of 1.5.0_07.\n" \
" It is recommended to set SECURITY_BASELINE_150.\n" \ " It is recommended to set SECURITY_BASELINE_150.\n" \
"" >> $(WARNING_FILE) ; \ "" >> $(WARNING_FILE) ; \
fi fi
endif endif
###################################################### ######################################################
......
...@@ -49,8 +49,8 @@ EXCLUDE_PKGS = \ ...@@ -49,8 +49,8 @@ EXCLUDE_PKGS = \
# ACTIVE_JSR_PKGS are packages that are part of an active JSR process-- # ACTIVE_JSR_PKGS are packages that are part of an active JSR process--
# one that is doing its own review. These packages are not included when # one that is doing its own review. These packages are not included when
# creating diff pages for the platform's JCP process. # creating diff pages for the platform's JCP process.
# #
# (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs) # (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs)
# Note: # Note:
# This is a list of regular expressions. So foo.* matches "foo" and "foo.bar". # This is a list of regular expressions. So foo.* matches "foo" and "foo.bar".
# #
...@@ -72,13 +72,13 @@ ACTIVE_JSR_PKGS= \ ...@@ -72,13 +72,13 @@ ACTIVE_JSR_PKGS= \
# CORE_PKGS is the list of packages that form the # CORE_PKGS is the list of packages that form the
# Java API Specification. # Java API Specification.
# #
### ***IMPORTANT NOTE*** ### ***IMPORTANT NOTE***
### There is also a "REGEXP" variable in the docs/makefile that ### There is also a "REGEXP" variable in the docs/makefile that
### determines which table the packages go in on the main page. ### determines which table the packages go in on the main page.
### Currently, there is only table ("Platform Packages") and ### Currently, there is only table ("Platform Packages") and
### everything goes in it, so REGEXP is "*". But if that policy ### everything goes in it, so REGEXP is "*". But if that policy
### changes, packages added will need to be reflected in that ### changes, packages added will need to be reflected in that
### list of wildcard expressions, as well. ### list of wildcard expressions, as well.
### ###
CORE_PKGS = \ CORE_PKGS = \
java.applet \ java.applet \
......
...@@ -272,6 +272,28 @@ SMARTCARDIO_DOCTITLE = "Java$(TRADEMARK) Smart Card I/O" ...@@ -272,6 +272,28 @@ SMARTCARDIO_DOCTITLE = "Java$(TRADEMARK) Smart Card I/O"
SMARTCARDIO_JAVADOCHEADER = "Java Smart Card I/O" SMARTCARDIO_JAVADOCHEADER = "Java Smart Card I/O"
# SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk # SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk
#
# Variables used by TRACING target
#
TRACING_SOURCEPATH = $(TOPDIR)/src/share/classes
TRACING_DOCDIR = $(DOCSDIR)/jre/api/tracing
TRACING_JAVADOCFLAGS = $(COMMON_JAVADOCFLAGS) \
-encoding ascii \
-nodeprecatedlist \
-d $(TRACING_DOCDIR) \
-sourcepath $(TRACING_SOURCEPATH) \
-windowtitle $(TRACING_WINDOWTITLE) \
-doctitle $(TRACING_DOCTITLE) \
-header $(TRACING_JAVADOCHEADER) \
-linkoffline ../../../../../api $(DOCSDIR)/api/
TRACING_WINDOWTITLE = "Tracing"
TRACING_DOCTITLE = "Java$(TRADEMARK) Platform Tracing"
TRACING_JAVADOCHEADER = "Platform Tracing"
# TRACING_PKGS is located in NON_CORE_PKGS.gmk
# #
# Variables used by HTTPSERVER target # Variables used by HTTPSERVER target
# #
...@@ -420,6 +442,7 @@ ALL_OTHER_TARGETS = \ ...@@ -420,6 +442,7 @@ ALL_OTHER_TARGETS = \
jaasdocs \ jaasdocs \
jgssdocs \ jgssdocs \
smartcardiodocs \ smartcardiodocs \
tracingdocs \
httpserverdocs \ httpserverdocs \
mgmtdocs \ mgmtdocs \
attachdocs \ attachdocs \
...@@ -585,6 +608,14 @@ smartcardiodocs: ...@@ -585,6 +608,14 @@ smartcardiodocs:
$(JAVADOC_CMD) $(SMARTCARDIO_JAVADOCFLAGS) \ $(JAVADOC_CMD) $(SMARTCARDIO_JAVADOCFLAGS) \
$(SMARTCARDIO_PKGS) $(SMARTCARDIO_PKGS)
.PHONY: tracingdocs
tracingdocs:
@# ######## api-tracing ############################
$(RM) -r $(TRACING_DOCDIR)
$(MKDIR) -p $(TRACING_DOCDIR)
$(JAVADOC) $(TRACING_JAVADOCFLAGS) \
$(TRACING_PKGS)
.PHONY: httpserverdocs .PHONY: httpserverdocs
httpserverdocs: httpserverdocs:
@# ######## api-httpserver ####################### @# ######## api-httpserver #######################
......
...@@ -84,6 +84,9 @@ TREEAPI_PKGS = com.sun.source.tree \ ...@@ -84,6 +84,9 @@ TREEAPI_PKGS = com.sun.source.tree \
SMARTCARDIO_PKGS = javax.smartcardio SMARTCARDIO_PKGS = javax.smartcardio
TRACING_PKGS = com.sun.tracing \
com.sun.tracing.dtrace
# non-core packages in rt.jar # non-core packages in rt.jar
NON_CORE_PKGS = $(DOMAPI_PKGS) \ NON_CORE_PKGS = $(DOMAPI_PKGS) \
$(MGMT_PKGS) \ $(MGMT_PKGS) \
...@@ -91,4 +94,5 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \ ...@@ -91,4 +94,5 @@ NON_CORE_PKGS = $(DOMAPI_PKGS) \
$(JGSS_PKGS) \ $(JGSS_PKGS) \
$(OLD_JSSE_PKGS) \ $(OLD_JSSE_PKGS) \
$(HTTPSERVER_PKGS) \ $(HTTPSERVER_PKGS) \
$(SMARTCARDIO_PKGS) $(SMARTCARDIO_PKGS) \
$(TRACING_PKGS)
...@@ -80,7 +80,8 @@ $(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH) ...@@ -80,7 +80,8 @@ $(LocaleDataMetaInfo_Dest):$(LocaleDataMetaInfo_Src) $(LOCALEGEN_SH)
@$(ECHO) $(subst .java,'\n',$(Euro_Resources_java)) >> $@.tmp.euro; @$(ECHO) $(subst .java,'\n',$(Euro_Resources_java)) >> $@.tmp.euro;
@$(ECHO) $(subst .properties,'\n',$(NonEuro_Resources_properties)) > $@.tmp.noneuro; @$(ECHO) $(subst .properties,'\n',$(NonEuro_Resources_properties)) > $@.tmp.noneuro;
@$(ECHO) $(subst .java,'\n',$(NonEuro_Resources_java)) >> $@.tmp.noneuro; @$(ECHO) $(subst .java,'\n',$(NonEuro_Resources_java)) >> $@.tmp.noneuro;
NAWK=$(NAWK) SED=$(SED) $(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \ NAWK="$(NAWK)" SED="$(SED)" SORT="$(SORT)" \
$(SH) $(LOCALEGEN_SH) $(RESOURCE_NAMES) $@.tmp.euro \
$@.tmp.noneuro $< $@ $@.tmp.noneuro $< $@
@$(RM) $@.tmp.euro $@.tmp.noneuro; @$(RM) $@.tmp.euro $@.tmp.noneuro;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
# This script is to generate the supported locale list string and replace the # This script is to generate the supported locale list string and replace the
# LocaleDataMetaInfo-XLocales.java in <ws>/src/share/classes/sun/util # LocaleDataMetaInfo-XLocales.java in <ws>/src/share/classes/sun/util
# #
# NAWK & SED is passed in as environment variables. # SORT, NAWK & SED is passed in as environment variables.
# #
# A list of resource base name list; # A list of resource base name list;
...@@ -47,7 +47,7 @@ OUTPUT_FILE=$5 ...@@ -47,7 +47,7 @@ OUTPUT_FILE=$5
localelist= localelist=
getlocalelist() { getlocalelist() {
localelist="" localelist=""
localelist=`$NAWK -F$1_ '{print $2}' $2 | sort` localelist=`$NAWK -F$1_ '{print $2}' $2 | $SORT`
} }
sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" " sed_script="$SED -e \"s@^#warn .*@// -- This file was mechanically generated: Do not edit! -- //@\" "
......
...@@ -85,7 +85,6 @@ SUNWprivate_1.1 { ...@@ -85,7 +85,6 @@ SUNWprivate_1.1 {
Java_java_io_FileOutputStream_close0; Java_java_io_FileOutputStream_close0;
Java_java_io_FileOutputStream_initIDs; Java_java_io_FileOutputStream_initIDs;
Java_java_io_FileOutputStream_open; Java_java_io_FileOutputStream_open;
Java_java_io_FileOutputStream_openAppend;
Java_java_io_FileOutputStream_write; Java_java_io_FileOutputStream_write;
Java_java_io_FileOutputStream_writeBytes; Java_java_io_FileOutputStream_writeBytes;
Java_java_io_FileSystem_getFileSystem; Java_java_io_FileSystem_getFileSystem;
......
...@@ -107,6 +107,7 @@ endif # PLATFORM ...@@ -107,6 +107,7 @@ endif # PLATFORM
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
EXTRA_LIBS = advapi32.lib \ EXTRA_LIBS = advapi32.lib \
comctl32.lib \
user32.lib user32.lib
JAVALIB = JAVALIB =
......
...@@ -43,7 +43,7 @@ include $(BUILDDIR)/common/Defs.gmk ...@@ -43,7 +43,7 @@ include $(BUILDDIR)/common/Defs.gmk
# Override the default version info with our own resource file (see 5106536) # Override the default version info with our own resource file (see 5106536)
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
LDLIBS_COMMON += user32.lib LDLIBS_COMMON += user32.lib comctl32.lib
ifdef OPENJDK ifdef OPENJDK
RC_FLAGS += -i "$(PLATFORM_SRC)/resource/icons" RC_FLAGS += -i "$(PLATFORM_SRC)/resource/icons"
else else
......
...@@ -46,7 +46,7 @@ STATIC_JLI = true ...@@ -46,7 +46,7 @@ STATIC_JLI = true
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
OTHER_CPPFLAGS += -DJAVAW OTHER_CPPFLAGS += -DJAVAW
LDLIBS_COMMON += user32.lib LDLIBS_COMMON += user32.lib comctl32.lib
# Override the default version info with our own resource file (see 5106536) # Override the default version info with our own resource file (see 5106536)
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
......
...@@ -191,7 +191,7 @@ sources: $(SPP) $(FILES_genout) ...@@ -191,7 +191,7 @@ sources: $(SPP) $(FILES_genout)
GEN_BUFFER_SH = genBuffer.sh GEN_BUFFER_SH = genBuffer.sh
GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK=$(NAWK) SED=$(SED) \ GEN_BUFFER_CMD = SPP="$(SPP_CMD)" NAWK=$(NAWK) SED=$(SED) SH=$(SH) \
$(SH) $(GEN_BUFFER_SH) $(SH) $(GEN_BUFFER_SH)
# Public abstract buffer classes # Public abstract buffer classes
...@@ -582,7 +582,7 @@ $(BUF_GEN)/ByteBufferAsDoubleBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.jav ...@@ -582,7 +582,7 @@ $(BUF_GEN)/ByteBufferAsDoubleBuffer%L.java: $(BUF_SRC)/ByteBufferAs-X-Buffer.jav
GEN_CODER_SH = genCoder.sh GEN_CODER_SH = genCoder.sh
GEN_CODER_CMD = SPP="$(SPP_CMD)" SED=$(SED) NAWK=$(NAWK) $(SH) $(GEN_CODER_SH) GEN_CODER_CMD = SPP="$(SPP_CMD)" SED=$(SED) NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_CODER_SH)
$(CS_GEN)/CharsetDecoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH) $(CS_GEN)/CharsetDecoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
$(prep-target) $(prep-target)
...@@ -602,7 +602,7 @@ $(CS_GEN)/CharsetEncoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH) ...@@ -602,7 +602,7 @@ $(CS_GEN)/CharsetEncoder.java: $(CS_SRC)/Charset-X-Coder.java $(GEN_CODER_SH)
GEN_EX_SH = genExceptions.sh GEN_EX_SH = genExceptions.sh
GEN_EX_CMD = NAWK=$(NAWK) $(SHELL) $(GEN_EX_SH) GEN_EX_CMD = NAWK=$(NAWK) SH=$(SH) $(SH) $(GEN_EX_SH)
$(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions $(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
$(prep-target) $(prep-target)
...@@ -635,8 +635,8 @@ $(SCS_GEN)/StandardCharsets.java: genCharsetProvider.sh \ ...@@ -635,8 +635,8 @@ $(SCS_GEN)/StandardCharsets.java: genCharsetProvider.sh \
$(HASHER_JARFILE) $(SCS_SRC)/standard-charsets $(HASHER_JARFILE) $(SCS_SRC)/standard-charsets
$(prep-target) $(prep-target)
@$(RM) $@.temp @$(RM) $@.temp
NAWK=$(NAWK) TEMPDIR=$(TEMPDIR) \ NAWK=$(NAWK) TEMPDIR=$(TEMPDIR) SH=$(SH) \
HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \ HASHER="$(BOOT_JAVA_CMD) -jar $(HASHER_JARFILE)" \
$(SHELL) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN) $(SH) -e genCharsetProvider.sh $(SCS_SRC)/standard-charsets $(SCS_GEN)
.PHONY: sources .PHONY: sources
...@@ -48,7 +48,7 @@ echo '-->' $OUT ...@@ -48,7 +48,7 @@ echo '-->' $OUT
# Header # Header
# #
$SHELL addNotices.sh "$COPYRIGHT_YEARS" > $OUT $SH ./addNotices.sh "$COPYRIGHT_YEARS" > $OUT
cat <<__END__ >>$OUT cat <<__END__ >>$OUT
......
...@@ -41,7 +41,7 @@ gen() { ...@@ -41,7 +41,7 @@ gen() {
echo '-->' $DST/$ID.java echo '-->' $DST/$ID.java
out=$DST/${ID}.java out=$DST/${ID}.java
$SHELL addNotices.sh "$COPYRIGHT_YEARS" > $out $SH ./addNotices.sh "$COPYRIGHT_YEARS" > $out
cat >>$out <<__END__ cat >>$out <<__END__
......
...@@ -33,6 +33,7 @@ FILES_java = \ ...@@ -33,6 +33,7 @@ FILES_java = \
sun/nio/cs/AbstractCharsetProvider.java \ sun/nio/cs/AbstractCharsetProvider.java \
sun/nio/cs/HistoricallyNamedCharset.java \ sun/nio/cs/HistoricallyNamedCharset.java \
sun/nio/cs/Surrogate.java \ sun/nio/cs/Surrogate.java \
sun/nio/cs/CharsetMapping.java \
sun/nio/cs/SingleByteEncoder.java \ sun/nio/cs/SingleByteEncoder.java \
sun/nio/cs/SingleByteDecoder.java \ sun/nio/cs/SingleByteDecoder.java \
sun/nio/cs/UnicodeEncoder.java \ sun/nio/cs/UnicodeEncoder.java \
......
...@@ -30,24 +30,10 @@ ...@@ -30,24 +30,10 @@
BUILDDIR = .. BUILDDIR = ..
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
#
# Files to compile
#
AUTO_FILES_JAVA_DIRS = \
javax/naming \
com/sun/naming/internal \
javax/net \
javax/script \
javax/security/auth \
javax/security/cert \
javax/security/sasl \
javax/smartcardio \
javax/tools \
javax/xml
# imageio uses xml, so build it last # imageio uses xml, so build it last
SUBDIRS = \ SUBDIRS = \
others \
accessibility \ accessibility \
print \ print \
swing \ swing \
...@@ -63,8 +49,3 @@ all build: ...@@ -63,8 +49,3 @@ all build:
clean clobber:: clean clobber::
$(SUBDIRS-loop) $(SUBDIRS-loop)
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
# #
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -31,7 +31,7 @@ include $(BUILDDIR)/common/Release.gmk ...@@ -31,7 +31,7 @@ include $(BUILDDIR)/common/Release.gmk
JCE_MANIFEST_FILE = $(TEMPDIR)/manifest.mf JCE_MANIFEST_FILE = $(TEMPDIR)/manifest.mf
$(JCE_MANIFEST_FILE): $(MAINMANIFEST) $(JCE_MANIFEST_FILE): $(MAINMANIFEST)
$(prep-target) $(prep-target)
( $(SED) "s/@@RELEASE@@/$(RELEASE)/" $(MAINMANIFEST); \ ( $(SED) "s/@@RELEASE@@/$(RELEASE)/" $<; \
$(ECHO) "Extension-Name: javax.crypto"; \ $(ECHO) "Extension-Name: javax.crypto"; \
$(ECHO) "Implementation-Vendor-Id: com.sun"; ) > $@ $(ECHO) "Implementation-Vendor-Id: com.sun"; ) > $@
...@@ -75,6 +75,7 @@ endef ...@@ -75,6 +75,7 @@ endef
define sign-target define sign-target
$(BOOT_JARSIGNER_CMD) -keystore $(SIGNING_KEYSTORE) \ $(BOOT_JARSIGNER_CMD) -keystore $(SIGNING_KEYSTORE) \
$@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE) $@ $(SIGNING_ALIAS) < $(SIGNING_PASSPHRASE)
@$(java-vm-cleanup)
@$(ECHO) "\nJar codesigning finished." @$(ECHO) "\nJar codesigning finished."
endef endef
...@@ -88,13 +89,15 @@ define release-warning ...@@ -88,13 +89,15 @@ define release-warning
endef endef
# #
# Convenience macro for steps needed to sign a jar file. # Convenience macros for signing a jar file.
#
# Call through $(call sign-file, target file)
# #
define sign-file define sign-file
$(presign) $(presign)
$(install-file) $(prep-target)
$(CP) $1 $@
$(sign-target) $(sign-target)
@$(java-vm-cleanup)
endef endef
# #
......
# #
# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
# sign-jar Builds/signs jce.jar file (no install) # sign-jar Builds/signs jce.jar file (no install)
# sign-policy Builds/signs policy files (no install) # sign-policy Builds/signs policy files (no install)
# #
# obfus Builds/obfuscates/signs/installs jce.jar # obfus Builds/obfuscates/signs jce.jar
# #
# release Builds all targets in preparation # release Builds all targets in preparation
# for workspace integration. # for workspace integration.
...@@ -110,8 +110,24 @@ BUILDDIR = ../.. ...@@ -110,8 +110,24 @@ BUILDDIR = ../..
PACKAGE = javax.crypto PACKAGE = javax.crypto
PRODUCT = sun PRODUCT = sun
#
# The following is for when we need to do postprocessing
# (signing/obfuscation) against a read-only build. If the OUTPUTDIR
# isn't writable, the build currently crashes out.
#
ifndef OPENJDK
ifdef ALT_JCE_BUILD_DIR
# =====================================================
# Where to place the output, in case we're building from a read-only
# build area. (e.g. a release engineering build.)
JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
IGNORE_WRITABLE_OUTPUTDIR_TEST=true
else
JCE_BUILD_DIR=${TEMPDIR}
endif
endif
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
include Defs-jce.gmk
# #
# Location for the newly built classfiles. # Location for the newly built classfiles.
...@@ -158,6 +174,8 @@ endif # OPENJDK ...@@ -158,6 +174,8 @@ endif # OPENJDK
# #
UNSIGNED_DIR = $(TEMPDIR)/unsigned UNSIGNED_DIR = $(TEMPDIR)/unsigned
include Defs-jce.gmk
# ===================================================== # =====================================================
# Build the unsigned jce.jar file. Signing/obfuscation comes later. # Build the unsigned jce.jar file. Signing/obfuscation comes later.
...@@ -299,7 +317,7 @@ ifndef OPENJDK ...@@ -299,7 +317,7 @@ ifndef OPENJDK
# Sign the various jar files. Not needed for OpenJDK. # Sign the various jar files. Not needed for OpenJDK.
# #
SIGNED_DIR = $(TEMPDIR)/signed SIGNED_DIR = $(JCE_BUILD_DIR)/signed
SIGNED_POLICY_BUILDDIR = $(SIGNED_DIR)/policy SIGNED_POLICY_BUILDDIR = $(SIGNED_DIR)/policy
SIGNED_POLICY_FILES = \ SIGNED_POLICY_FILES = \
...@@ -312,61 +330,87 @@ sign-jar: $(SIGNED_DIR)/jce.jar ...@@ -312,61 +330,87 @@ sign-jar: $(SIGNED_DIR)/jce.jar
sign-policy: $(SIGNED_POLICY_FILES) sign-policy: $(SIGNED_POLICY_FILES)
ifndef ALT_JCE_BUILD_DIR
$(SIGNED_DIR)/jce.jar: $(UNSIGNED_DIR)/jce.jar $(SIGNED_DIR)/jce.jar: $(UNSIGNED_DIR)/jce.jar
$(sign-file) else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(SIGNED_DIR)/jce.jar:
@if [ ! -r $(UNSIGNED_DIR)/jce.jar ] ; then \
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/jce.jar"; \
exit 1; \
fi
endif
$(call sign-file, $(UNSIGNED_DIR)/jce.jar)
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar: \ $(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar $(UNSIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar
$(sign-file) $(call sign-file, $<)
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar: \ $(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar $(UNSIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar
$(sign-file) $(call sign-file, $<)
$(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \ $(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar $(UNSIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar
$(sign-file) $(call sign-file, $<)
$(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \ $(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \
$(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar $(UNSIGNED_POLICY_BUILDDIR)/limited/local_policy.jar
$(sign-file) $(call sign-file, $<)
# ===================================================== # =====================================================
# Obfuscate/sign/install the JDK build. Not needed for OpenJDK. # Obfuscate/sign/install the JDK build. Not needed for OpenJDK.
# #
OBFUS_DIR = $(TEMPDIR)/obfus OBFUS_DIR = $(JCE_BUILD_DIR)/obfus/jce
CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto
obfus: $(OBFUS_DIR)/jce.jar obfus: $(OBFUS_DIR)/jce.jar
$(release-warning) $(release-warning)
$(OBFUS_DIR)/jce.jar: build-jar $(JCE_MANIFEST_FILE) ifndef ALT_JCE_BUILD_DIR
$(OBFUS_DIR)/jce.jar: build-jar $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/framework.dox
else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(OBFUS_DIR)/jce.jar: $(JCE_MANIFEST_FILE) $(OBFUS_DIR)/framework.dox
@if [ ! -d $(CLASSDESTDIR) ] ; then \
$(ECHO) "Couldn't find $(CLASSDESTDIR)"; \
exit 1; \
fi
endif
@$(ECHO) ">>>Obfuscating JCE framework..."
$(presign) $(presign)
$(preobfus) $(preobfus)
@$(ECHO) ">>>Obfuscating JCE framework..."
$(prep-target) $(prep-target)
$(CD) $(OBFUS_DIR); \ $(CD) $(OBFUS_DIR); \
$(OBFUSCATOR) -fv \ $(OBFUSCATOR) -fv framework.dox
$(CURRENT_DIRECTORY)/$(CLOSED_DIR)/obfus/framework.dox
@$(CD) $(OBFUS_DIR); $(java-vm-cleanup) @$(CD) $(OBFUS_DIR); $(java-vm-cleanup)
@#
@# The sun.security.internal classes are currently not obfuscated @# The sun.security.internal classes are currently not obfuscated
@# due to an obfus problem. Manually copy them to the build directory @# due to an obfus problem. Manually copy them to the build directory
@# so that they are included in the jce.jar file. @# so that they are included in the jce.jar file.
@#
$(CP) -r $(CLASSDESTDIR)/sun $(OBFUS_DIR)/build $(CP) -r $(CLASSDESTDIR)/sun $(OBFUS_DIR)/build
$(RM) $(UNSIGNED_DIR)/jce.jar
$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ \ $(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ \
-C $(OBFUS_DIR)/build javax \ -C $(OBFUS_DIR)/build javax \
-C $(OBFUS_DIR)/build sun \ -C $(OBFUS_DIR)/build sun \
$(JAR_JFLAGS) $(JAR_JFLAGS)
$(sign-target) $(sign-target)
$(MKDIR) -p $(dir $(JAR_DESTFILE))
$(RM) $(JAR_DESTFILE)
$(CP) $@ $(JAR_DESTFILE)
@$(java-vm-cleanup) @$(java-vm-cleanup)
$(OBFUS_DIR)/framework.dox: $(CLOSED_DIR)/obfus/framework.dox
@$(ECHO) ">>>Creating framework.dox"
$(prep-target)
$(SED) "s:@@TEMPDIR@@:$(ABS_TEMPDIR):" $< > $@
# #
# The current obfuscator has a limitation in that it currently only # The current obfuscator has a limitation in that it currently only
# supports up to v49 class file format. Force v49 classfiles in our # supports up to v49 class file format. Force v49 classfiles in our
...@@ -380,26 +424,27 @@ TARGET_CLASS_VERSION = 5 ...@@ -380,26 +424,27 @@ TARGET_CLASS_VERSION = 5
# unlimited policy file distribution, etc. # unlimited policy file distribution, etc.
# #
release: $(OBFUS_DIR)/jce.jar sign-policy release: $(OBFUS_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/COPYRIGHT.html \
$(CLOSED_DIR)/doc/README.txt
$(RM) -r \ $(RM) -r \
$(RELEASE_DIR)/UnlimitedJCEPolicy \ $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy \
$(RELEASE_DIR)/jce.jar \ $(JCE_BUILD_DIR)/release/jce.jar \
$(RELEASE_DIR)/US_export_policy.jar \ $(JCE_BUILD_DIR)/release/US_export_policy.jar \
$(RELEASE_DIR)/local_policy.jar \ $(JCE_BUILD_DIR)/release/local_policy.jar \
$(RELEASE_DIR)/UnlimitedJCEPolicy.zip $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy.zip
$(MKDIR) -p $(RELEASE_DIR)/UnlimitedJCEPolicy $(MKDIR) -p $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy
$(CP) $(OBFUS_DIR)/jce.jar $(RELEASE_DIR) $(CP) $(OBFUS_DIR)/jce.jar $(JCE_BUILD_DIR)/release
$(CP) -r \ $(CP) \
$(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \ $(SIGNED_POLICY_BUILDDIR)/limited/US_export_policy.jar \
$(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar \ $(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar \
$(RELEASE_DIR) $(JCE_BUILD_DIR)/release
$(CP) \ $(CP) \
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \ $(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \ $(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \
$(RELEASE_DIR)/UnlimitedJCEPolicy $(CLOSED_DIR)/doc/COPYRIGHT.html \
$(CP) $(CLOSED_DIR)/doc/COPYRIGHT.html \ $(CLOSED_DIR)/doc/README.txt \
$(CLOSED_DIR)/doc/README.txt $(RELEASE_DIR)/UnlimitedJCEPolicy $(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy
cd $(RELEASE_DIR) ; \ cd $(JCE_BUILD_DIR)/release ; \
$(ZIPEXE) -qr UnlimitedJCEPolicy.zip UnlimitedJCEPolicy $(ZIPEXE) -qr UnlimitedJCEPolicy.zip UnlimitedJCEPolicy
$(release-warning) $(release-warning)
...@@ -478,7 +523,8 @@ endif ...@@ -478,7 +523,8 @@ endif
clobber clean:: clobber clean::
$(RM) -r $(JAR_DESTFILE) $(POLICY_DESTDIR)/US_export_policy.jar \ $(RM) -r $(JAR_DESTFILE) $(POLICY_DESTDIR)/US_export_policy.jar \
$(POLICY_DESTDIR)/local_policy.jar $(DELETE_DIRS) $(TEMPDIR) $(POLICY_DESTDIR)/local_policy.jar $(DELETE_DIRS) $(TEMPDIR) \
$(JCE_BUILD_DIR)
.PHONY: build-jar jar build-policy unlimited limited install-jar \ .PHONY: build-jar jar build-policy unlimited limited install-jar \
install-limited install-unlimited install-limited install-unlimited
......
#
# Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
#
# Makefile for building javax (other classes)
#
BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk
#
# Files to compile
#
AUTO_FILES_JAVA_DIRS = \
javax/naming \
com/sun/naming/internal \
javax/net \
javax/script \
javax/security/auth \
javax/security/cert \
javax/security/sasl \
javax/smartcardio \
javax/tools \
javax/xml
#
# Rules
#
include $(BUILDDIR)/common/Classes.gmk
...@@ -63,7 +63,7 @@ SUBDIRS = jar security javazic misc net audio $(RENDER_SUBDIR) image \ ...@@ -63,7 +63,7 @@ SUBDIRS = jar security javazic misc net audio $(RENDER_SUBDIR) image \
$(HEADLESS_SUBDIR) $(DGA_SUBDIR) \ $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \
font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \ font jpeg cmm applet rmi beans $(JDBC_SUBDIR) \
jawt text nio launcher management $(ORG_SUBDIR) \ jawt text nio launcher management $(ORG_SUBDIR) \
native2ascii serialver tools jconsole native2ascii serialver tools jconsole tracing
all build clean clobber:: all build clean clobber::
$(SUBDIRS-loop) $(SUBDIRS-loop)
......
# #
# Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved. # Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -73,11 +73,21 @@ build: $(CHARSETS_JAR) ...@@ -73,11 +73,21 @@ build: $(CHARSETS_JAR)
SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION) SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)
GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
FILES_MAP = $(GENCSDATASRC)/sjis0213.map
FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat
CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar
$(FILES_DAT): $(FILES_MAP)
@$(prep-target)
$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \
$(FILES_MAP) $(FILES_DAT)
$(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \ $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
$(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH) $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
$(install-file) $(install-file)
$(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
$(BOOT_JAR_CMD) cf $(CHARSETS_JAR) \ $(BOOT_JAR_CMD) cf $(CHARSETS_JAR) \
-C $(CLASSDESTDIR) sun \ -C $(CLASSDESTDIR) sun \
-C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \ -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH) \
......
# #
# Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -92,8 +92,25 @@ BUILDDIR = ../../.. ...@@ -92,8 +92,25 @@ BUILDDIR = ../../..
PACKAGE = sun.security.mscapi PACKAGE = sun.security.mscapi
LIBRARY = sunmscapi LIBRARY = sunmscapi
PRODUCT = sun PRODUCT = sun
#
# The following is for when we need to do postprocessing
# (signing/obfuscation) against a read-only build. If the OUTPUTDIR
# isn't writable, the build currently crashes out.
#
ifndef OPENJDK
ifdef ALT_JCE_BUILD_DIR
# =====================================================
# Where to place the output, in case we're building from a read-only
# build area. (e.g. a release engineering build.)
JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
IGNORE_WRITABLE_OUTPUTDIR_TEST=true
else
JCE_BUILD_DIR=${TEMPDIR}
endif
endif
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
CPLUSPLUSLIBRARY=true CPLUSPLUSLIBRARY=true
...@@ -163,6 +180,8 @@ all: build-jar install-prebuilt ...@@ -163,6 +180,8 @@ all: build-jar install-prebuilt
$(build-warning) $(build-warning)
endif endif
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
# ===================================================== # =====================================================
# Build the unsigned sunmscapi.jar file. # Build the unsigned sunmscapi.jar file.
...@@ -200,14 +219,26 @@ ifndef OPENJDK ...@@ -200,14 +219,26 @@ ifndef OPENJDK
# Sign the provider jar file. Not needed for OpenJDK. # Sign the provider jar file. Not needed for OpenJDK.
# #
SIGNED_DIR = $(TEMPDIR)/signed SIGNED_DIR = $(JCE_BUILD_DIR)/signed
sign: sign-jar sign: sign-jar
sign-jar: $(SIGNED_DIR)/sunmscapi.jar sign-jar: $(SIGNED_DIR)/sunmscapi.jar
ifndef ALT_JCE_BUILD_DIR
$(SIGNED_DIR)/sunmscapi.jar: $(UNSIGNED_DIR)/sunmscapi.jar $(SIGNED_DIR)/sunmscapi.jar: $(UNSIGNED_DIR)/sunmscapi.jar
$(sign-file) else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(SIGNED_DIR)/sunmscapi.jar:
@if [ ! -r $(UNSIGNED_DIR)/sunmscapi.jar ] ; then \
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunmscapi.jar"; \
exit 1; \
fi
endif
$(call sign-file, $(UNSIGNED_DIR)/sunmscapi.jar)
# ===================================================== # =====================================================
...@@ -215,9 +246,9 @@ $(SIGNED_DIR)/sunmscapi.jar: $(UNSIGNED_DIR)/sunmscapi.jar ...@@ -215,9 +246,9 @@ $(SIGNED_DIR)/sunmscapi.jar: $(UNSIGNED_DIR)/sunmscapi.jar
# #
release: $(SIGNED_DIR)/sunmscapi.jar release: $(SIGNED_DIR)/sunmscapi.jar
$(RM) $(RELEASE_DIR)/sunmscapi.jar $(RM) $(JCE_BUILD_DIR)/release/sunmscapi.jar
$(MKDIR) -p $(RELEASE_DIR) $(MKDIR) -p $(JCE_BUILD_DIR)/release
$(CP) $(SIGNED_DIR)/sunmscapi.jar $(RELEASE_DIR) $(CP) $(SIGNED_DIR)/sunmscapi.jar $(JCE_BUILD_DIR)/release
$(release-warning) $(release-warning)
endif # OPENJDK endif # OPENJDK
...@@ -255,7 +286,7 @@ endif ...@@ -255,7 +286,7 @@ endif
# #
clobber clean:: clobber clean::
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
.PHONY: build-jar jar install-jar .PHONY: build-jar jar install-jar
ifndef OPENJDK ifndef OPENJDK
......
# #
# Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -92,8 +92,25 @@ BUILDDIR = ../../.. ...@@ -92,8 +92,25 @@ BUILDDIR = ../../..
PACKAGE = sun.security.pkcs11 PACKAGE = sun.security.pkcs11
LIBRARY = j2pkcs11 LIBRARY = j2pkcs11
PRODUCT = sun PRODUCT = sun
#
# The following is for when we need to do postprocessing
# (signing/obfuscation) against a read-only build. If the OUTPUTDIR
# isn't writable, the build currently crashes out.
#
ifndef OPENJDK
ifdef ALT_JCE_BUILD_DIR
# =====================================================
# Where to place the output, in case we're building from a read-only
# build area. (e.g. a release engineering build.)
JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
IGNORE_WRITABLE_OUTPUTDIR_TEST=true
else
JCE_BUILD_DIR=${TEMPDIR}
endif
endif
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
# #
# C and Java Files # C and Java Files
...@@ -163,6 +180,8 @@ all: build-jar install-prebuilt ...@@ -163,6 +180,8 @@ all: build-jar install-prebuilt
$(build-warning) $(build-warning)
endif endif
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
# ===================================================== # =====================================================
# Build the unsigned sunpkcs11.jar file. # Build the unsigned sunpkcs11.jar file.
...@@ -200,14 +219,26 @@ ifndef OPENJDK ...@@ -200,14 +219,26 @@ ifndef OPENJDK
# Sign the provider jar file. Not needed for OpenJDK. # Sign the provider jar file. Not needed for OpenJDK.
# #
SIGNED_DIR = $(TEMPDIR)/signed SIGNED_DIR = $(JCE_BUILD_DIR)/signed
sign: sign-jar sign: sign-jar
sign-jar: $(SIGNED_DIR)/sunpkcs11.jar sign-jar: $(SIGNED_DIR)/sunpkcs11.jar
ifndef ALT_JCE_BUILD_DIR
$(SIGNED_DIR)/sunpkcs11.jar: $(UNSIGNED_DIR)/sunpkcs11.jar $(SIGNED_DIR)/sunpkcs11.jar: $(UNSIGNED_DIR)/sunpkcs11.jar
$(sign-file) else
#
# We have to remove the build dependency, otherwise, we'll try to rebuild it
# which we can't do on a read-only filesystem.
#
$(SIGNED_DIR)/sunpkcs11.jar:
@if [ ! -r $(UNSIGNED_DIR)/sunpkcs11.jar ] ; then \
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunpkcs11.jar"; \
exit 1; \
fi
endif
$(call sign-file, $(UNSIGNED_DIR)/sunpkcs11.jar)
# ===================================================== # =====================================================
...@@ -215,9 +246,9 @@ $(SIGNED_DIR)/sunpkcs11.jar: $(UNSIGNED_DIR)/sunpkcs11.jar ...@@ -215,9 +246,9 @@ $(SIGNED_DIR)/sunpkcs11.jar: $(UNSIGNED_DIR)/sunpkcs11.jar
# #
release: $(SIGNED_DIR)/sunpkcs11.jar release: $(SIGNED_DIR)/sunpkcs11.jar
$(RM) $(RELEASE_DIR)/sunpkcs11.jar $(RM) $(JCE_BUILD_DIR)/release/sunpkcs11.jar
$(MKDIR) -p $(RELEASE_DIR) $(MKDIR) -p $(JCE_BUILD_DIR)/release
$(CP) $(SIGNED_DIR)/sunpkcs11.jar $(RELEASE_DIR) $(CP) $(SIGNED_DIR)/sunpkcs11.jar $(JCE_BUILD_DIR)/release
$(release-warning) $(release-warning)
endif # OPENJDK endif # OPENJDK
...@@ -255,7 +286,7 @@ endif ...@@ -255,7 +286,7 @@ endif
# #
clobber clean:: clobber clean::
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
.PHONY: build-jar jar install-jar .PHONY: build-jar jar install-jar
ifndef OPENJDK ifndef OPENJDK
......
...@@ -85,3 +85,13 @@ vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen ...@@ -85,3 +85,13 @@ vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen
CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen CPPFLAGS += -I$(PLATFORM_SRC)/native/$(PKGDIR)/splashscreen -I$(SHARE_SRC)/native/$(PKGDIR)/splashscreen
CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3 CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR)/image/jpeg -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
ifeq ($(PLATFORM), linux)
ifeq ($(ARCH_DATA_MODEL), 64)
# 64-bit gcc has problems compiling MMX instructions.
# Google it for more details. Possibly the newer versions of
# the PNG-library and/or the new compiler will not need this
# option in the future.
CPPFLAGS += -DPNG_NO_MMX_CODE
endif
endif
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
# Makefile for building tracing package implementation classes
#
BUILDDIR = ../..
PACKAGE = sun.tracing
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
SUBDIRS = dtrace
all build:
$(SUBDIRS-loop)
clean clobber::
$(SUBDIRS-loop)
AUTO_FILES_JAVA_DIRS = sun/tracing
#
# Rules.
#
include $(BUILDDIR)/common/Classes.gmk
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
# Makefile for building dtrace extension
#
BUILDDIR = ../../..
PACKAGE = sun.tracing.dtrace
LIBRARY = jsdt
PRODUCT = sun
include $(BUILDDIR)/common/Defs.gmk
#
# Use mapfile
#
FILES_m = mapfile-vers
include $(BUILDDIR)/common/Mapfile-vers.gmk
NATIVE_DTRACE_DIR=native/sun/tracing/dtrace
SRCDIR=$(SHARE_SRC)/$(NATIVE_DTRACE_DIR)
PSRCDIR=$(PLATFORM_SRC)/$(NATIVE_DTRACE_DIR)
FILES_c = JVM.c jvm_symbols_md.c
FILES_java = \
sun/tracing/dtrace/Activation.java \
sun/tracing/dtrace/DTraceProvider.java \
sun/tracing/dtrace/DTraceProbe.java \
sun/tracing/dtrace/DTraceProviderFactory.java \
sun/tracing/dtrace/JVM.java
FILES_export = $(FILES_java)
ifeq ($(PLATFORM), linux)
OTHER_LDLIBS += -ldl
endif
#
# Use JNI for generating header files
#
JAVAHFLAGS += -jni
#
# Don't need to link against -ljava
#
JAVALIB=
#
# Rules.
#
include $(BUILDDIR)/common/Library.gmk
#
# Add to ambient vpath so we pick up the library files
#
vpath %.c $(SRCDIR):$(PSRCDIR)
#
#ident "@(#)mapfile-vers 1.1 07/08/14"
#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
# Define library interface.
SUNWprivate_1.1 {
global:
Java_sun_tracing_dtrace_JVM_isSupported0;
Java_sun_tracing_dtrace_JVM_activate0;
Java_sun_tracing_dtrace_JVM_dispose0;
Java_sun_tracing_dtrace_JVM_isEnabled0;
Java_sun_tracing_dtrace_JVM_defineClass0;
local:
*;
};
# #
# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. # Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -246,7 +246,7 @@ $(SIZES): $(SIZERS) ...@@ -246,7 +246,7 @@ $(SIZES): $(SIZERS)
@if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \ @if [ "$(DOCOMPARE)$(suffix $@)" = "true.64" ]; then \
$(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \ $(ECHO) COMPARING $@ and $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
$(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \ $(DIFF) $@ $(STORED_SIZES_TMPL_$(PLATFORM)_$(LIBARCH)); \
fi fi
$(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES) $(TEMPDIR)/.gen.wrappers: $(SIZES) $(WRAPPER_GENERATOR_CLASS) $(XLIBTYPES)
$(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \ $(BOOT_JAVA_CMD) -cp $(WRAPPER_GENERATOR_TEMPDIR) WrapperGenerator \
...@@ -256,10 +256,11 @@ touch.wrappers: $(TEMPDIR)/.gen.wrappers ...@@ -256,10 +256,11 @@ touch.wrappers: $(TEMPDIR)/.gen.wrappers
$(MKDIR) -p $(TEMPDIR) $(MKDIR) -p $(TEMPDIR)
$(TOUCH) $(TEMPDIR)/.gen.wrappers $(TOUCH) $(TEMPDIR)/.gen.wrappers
generated.clean: generated.clean:
$(RM) -r $(WRAPPER_GENERATOR_TEMPDIR) $(RM) -r $(WRAPPER_GENERATOR_TEMPDIR)
$(RM) -r $(WRAPPER_GENERATOR_DIR) $(RM) -r $(WRAPPER_GENERATOR_DIR)
$(RM) -r $(GEN_DIR)/*.java $(RM) -r $(GEN_DIR)/*.java
$(RM) -r $(TEMPDIR)/.gen_icons
ifdef OPENJDK ifdef OPENJDK
ICONS_PATH_PREFIX=$(PLATFORM_SRC) ICONS_PATH_PREFIX=$(PLATFORM_SRC)
......
#
# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Sun designates this
# particular file as subject to the "Classpath" exception as provided
# by Sun in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
#
# Makefile for building the charsetmapping tool
#
BUILDDIR = ../..
PACKAGE = build.tools.charsetmapping
PRODUCT = tools
PROGRAM = charsetmapping
include $(BUILDDIR)/common/Defs.gmk
BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src
BUILDTOOL_MAIN = $(PKGDIR)/GenerateMapping.java
#
# Build tool jar rules.
#
include $(BUILDDIR)/common/BuildToolJar.gmk
此差异已折叠。
...@@ -40,6 +40,7 @@ SUBDIRS = \ ...@@ -40,6 +40,7 @@ SUBDIRS = \
dir_diff \ dir_diff \
dtdbuilder \ dtdbuilder \
fontchecker \ fontchecker \
freetypecheck \
generate_break_iterator \ generate_break_iterator \
GenerateCharacter \ GenerateCharacter \
generatecurrencydata \ generatecurrencydata \
...@@ -50,7 +51,8 @@ SUBDIRS = \ ...@@ -50,7 +51,8 @@ SUBDIRS = \
jdwpgen \ jdwpgen \
makeclasslist \ makeclasslist \
strip_properties \ strip_properties \
winver winver \
CharsetMapping
all build clean clobber:: all build clean clobber::
$(SUBDIRS-loop) $(SUBDIRS-loop)
...@@ -58,4 +60,5 @@ all build clean clobber:: ...@@ -58,4 +60,5 @@ all build clean clobber::
clean clobber:: clean clobber::
$(RM) -r $(BUILDTOOLCLASSDIR) $(RM) -r $(BUILDTOOLCLASSDIR)
$(RM) -r $(BUILDTOOLJARDIR) $(RM) -r $(BUILDTOOLJARDIR)
$(RM) -r $(BUILDTOOLBINDIR)
...@@ -22,48 +22,58 @@ ...@@ -22,48 +22,58 @@
# CA 95054 USA or visit www.sun.com if you need additional information or # CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions. # have any questions.
# Builds test program for freetype sanity check. # Builds and runs test program for freetype sanity check.
#
# Makefile should be called with following input parameters
# FT_TEST - full name of test program
# FT_HEADERS - path to freetype headers
# FT_LIB - location of directory with library
# XARCH - xarch option if required
BUILDDIR = ../.. BUILDDIR = ../..
include $(BUILDDIR)/common/Defs.gmk include $(BUILDDIR)/common/Defs.gmk
#test program is expected in the TEMPDIR # Default name
FT_TEST_PATH = $(TEMPDIR)/$(FT_TEST) FT_TEST = $(BUILDTOOLBINDIR)/freetype_versioncheck$(EXE_SUFFIX)
all: $(FT_TEST_PATH)
FT_OPTIONS = -I$(FT_HEADERS) -I$(FT_HEADERS)/freetype2 # Used on openjdk only
FT_OPTIONS += $(XARCH) ifeq ($(OPENJDK),true)
#add runtime library search path # Start with CFLAGS (which gets us the required -xarch setting on solaris)
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
FREETYPE_LIB=$(FT_LIB)/freetype.lib FT_OPTIONS = /nologo $(CC_OBJECT_OUTPUT_FLAG)$(TEMPDIR)
FREETYPE_DLL=$(FT_LIB)/freetype.dll FREETYPE_DLL = $(FREETYPE_LIB_PATH)/freetype.dll
DFLAG=/D FT_LD_OPTIONS = $(FREETYPE_LIB_PATH)/freetype.lib
else else
FT_OPTIONS += -L$(FT_LIB) FT_OPTIONS = $(CFLAGS)
DFLAG = -D FT_LD_OPTIONS = -L$(FREETYPE_LIB_PATH)
# Add runtime lib search path to ensure test will be runnable
#add runtime lib search path to ensure test will be runnable
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
FT_OPTIONS += -R $(FT_LIB) -lfreetype FT_LD_OPTIONS += -R $(FREETYPE_LIB_PATH) -lfreetype
else #linux else #linux
FT_OPTIONS += -Wl,-rpath -Wl,$(FT_LIB) -lfreetype FT_LD_OPTIONS += -Wl,-rpath -Wl,$(FREETYPE_LIB_PATH) -lfreetype
endif endif
endif endif
FT_OPTIONS += -I$(FREETYPE_HEADERS_PATH)
FT_OPTIONS += -I$(FREETYPE_HEADERS_PATH)/freetype2
FT_OPTIONS += -DREQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION)
FT_LD_OPTIONS += $(LFLAGS_$(COMPILER_VERSION))
FT_OPTIONS += $(DFLAG)REQUIRED_FREETYPE_VERSION=$(REQUIRED_FREETYPE_VERSION) # Create test program
all: $(FT_TEST)
@$(FT_TEST)
# On windows we need to copy dll to test dir # On windows we need to copy dll to test dir to ensure it will be found
# ti ensure it will be found in runtime # at runtime
$(FT_TEST_PATH): freetypecheck.c $(FT_TEST): freetypecheck.c
@$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FREETYPE_LIB) $(LFLAGS_$(COMPILER_VERSION)) @$(prep-target)
@$(CC) $(FT_OPTIONS) $(CC_PROGRAM_OUTPUT_FLAG)$@ $< $(FT_LD_OPTIONS)
ifeq ($(PLATFORM), windows) ifeq ($(PLATFORM), windows)
@$(CP) $(FREETYPE_DLL) `dirname $@` @$(CP) $(FREETYPE_DLL) `dirname $@`
endif endif
else
# Inform user this is openjdk only
all:
@$(ECHO) "The freetype files are only used with OpenJDK"
endif
clean::
$(RM) $(FT_TEST)
...@@ -26,13 +26,16 @@ ...@@ -26,13 +26,16 @@
/* Test program for freetype sanity check. /* Test program for freetype sanity check.
Prints "Failed" messages to STDOUT if check fails. */ Prints "Failed" messages to STDOUT if check fails. */
#include <stdio.h>
#include <string.h>
#include "ft2build.h" #include "ft2build.h"
#include FT_FREETYPE_H #include FT_FREETYPE_H
#define QUOTEMACRO(x) QUOTEME(x) #define QUOTEMACRO(x) QUOTEME(x)
#define QUOTEME(x) #x #define QUOTEME(x) #x
int main(char** argv, int argc) { int main(int argc, char** argv) {
char v[50]; char v[50];
FT_Int major, minor, patch; FT_Int major, minor, patch;
FT_Library library; FT_Library library;
......
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package build.tools.charsetmapping;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.*;
public class CharsetMapping {
public final static char UNMAPPABLE_DECODING = '\uFFFD';
public final static int UNMAPPABLE_ENCODING = -1;
public static class Entry {
public int bs; //byte sequence reps
public int cp; //Unicode codepoint
public int cp2; //CC of composite
public Entry () {}
public Entry (int bytes, int cp, int cp2) {
this.bs = bytes;
this.cp = cp;
this.cp2 = cp2;
}
}
static Comparator<Entry> comparatorCP =
new Comparator<Entry>() {
public int compare(Entry m1, Entry m2) {
return m1.cp - m2.cp;
}
public boolean equals(Object obj) {
return this == obj;
}
};
public static class Parser {
static final Pattern basic = Pattern.compile("(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)?\\s*+.*");
static final int gBS = 1;
static final int gCP = 2;
static final int gCP2 = 3;
BufferedReader reader;
boolean closed;
Matcher matcher;
int gbs, gcp, gcp2;
public Parser (InputStream in, Pattern p, int gbs, int gcp, int gcp2)
throws IOException
{
this.reader = new BufferedReader(new InputStreamReader(in));
this.closed = false;
this.matcher = p.matcher("");
this.gbs = gbs;
this.gcp = gcp;
this.gcp2 = gcp2;
}
public Parser (InputStream in, Pattern p) throws IOException {
this(in, p, gBS, gCP, gCP2);
}
public Parser (InputStream in) throws IOException {
this(in, basic, gBS, gCP, gCP2);
}
protected boolean isDirective(String line) {
return line.startsWith("#");
}
protected Entry parse(Matcher matcher, Entry mapping) {
mapping.bs = Integer.parseInt(matcher.group(gbs), 16);
mapping.cp = Integer.parseInt(matcher.group(gcp), 16);
if (gcp2 <= matcher.groupCount() &&
matcher.group(gcp2) != null)
mapping.cp2 = Integer.parseInt(matcher.group(gcp2), 16);
else
mapping.cp2 = 0;
return mapping;
}
public Entry next() throws Exception {
return next(new Entry());
}
// returns null and closes the input stream if the eof has beenreached.
public Entry next(Entry mapping) throws Exception {
if (closed)
return null;
String line;
while ((line = reader.readLine()) != null) {
if (isDirective(line))
continue;
matcher.reset(line);
if (!matcher.lookingAt()) {
//System.out.println("Missed: " + line);
continue;
}
return parse(matcher, mapping);
}
reader.close();
closed = true;
return null;
}
}
// tags of different charset mapping tables
private final static int MAP_SINGLEBYTE = 0x1; // 0..256 : c
private final static int MAP_DOUBLEBYTE1 = 0x2; // min..max: c
private final static int MAP_DOUBLEBYTE2 = 0x3; // min..max: c [DB2]
private final static int MAP_SUPPLEMENT = 0x5; // db,c
private final static int MAP_SUPPLEMENT_C2B = 0x6; // c,db
private final static int MAP_COMPOSITE = 0x7; // db,base,cc
private final static int MAP_INDEXC2B = 0x8; // index table of c->bb
private static final void writeShort(OutputStream out, int data)
throws IOException
{
out.write((data >>> 8) & 0xFF);
out.write((data ) & 0xFF);
}
private static final void writeShortArray(OutputStream out,
int type,
int[] array,
int off,
int size) // exclusive
throws IOException
{
writeShort(out, type);
writeShort(out, size);
for (int i = off; i < size; i++) {
writeShort(out, array[off+i]);
}
}
public static final void writeSIZE(OutputStream out, int data)
throws IOException
{
out.write((data >>> 24) & 0xFF);
out.write((data >>> 16) & 0xFF);
out.write((data >>> 8) & 0xFF);
out.write((data ) & 0xFF);
}
public static void writeINDEXC2B(OutputStream out, int[] indexC2B)
throws IOException
{
writeShort(out, MAP_INDEXC2B);
writeShort(out, indexC2B.length);
int off = 0;
for (int i = 0; i < indexC2B.length; i++) {
if (indexC2B[i] != 0) {
writeShort(out, off);
off += 256;
} else {
writeShort(out, -1);
}
}
}
public static void writeSINGLEBYTE(OutputStream out, int[] sb)
throws IOException
{
writeShortArray(out, MAP_SINGLEBYTE, sb, 0, 256);
}
private static void writeDOUBLEBYTE(OutputStream out,
int type,
int[] db,
int b1Min, int b1Max,
int b2Min, int b2Max)
throws IOException
{
writeShort(out, type);
writeShort(out, b1Min);
writeShort(out, b1Max);
writeShort(out, b2Min);
writeShort(out, b2Max);
writeShort(out, (b1Max - b1Min + 1) * (b2Max - b2Min + 1));
for (int b1 = b1Min; b1 <= b1Max; b1++) {
for (int b2 = b2Min; b2 <= b2Max; b2++) {
writeShort(out, db[b1 * 256 + b2]);
}
}
}
public static void writeDOUBLEBYTE1(OutputStream out,
int[] db,
int b1Min, int b1Max,
int b2Min, int b2Max)
throws IOException
{
writeDOUBLEBYTE(out, MAP_DOUBLEBYTE1, db, b1Min, b1Max, b2Min, b2Max);
}
public static void writeDOUBLEBYTE2(OutputStream out,
int[] db,
int b1Min, int b1Max,
int b2Min, int b2Max)
throws IOException
{
writeDOUBLEBYTE(out, MAP_DOUBLEBYTE2, db, b1Min, b1Max, b2Min, b2Max);
}
// the c2b table is output as well
public static void writeSUPPLEMENT(OutputStream out, Entry[] supp, int size)
throws IOException
{
writeShort(out, MAP_SUPPLEMENT);
writeShort(out, size * 2);
// db at first half, cc at the low half
for (int i = 0; i < size; i++) {
writeShort(out, supp[i].bs);
}
for (int i = 0; i < size; i++) {
writeShort(out, supp[i].cp);
}
//c2b
writeShort(out, MAP_SUPPLEMENT_C2B);
writeShort(out, size*2);
Arrays.sort(supp, 0, size, comparatorCP);
for (int i = 0; i < size; i++) {
writeShort(out, supp[i].cp);
}
for (int i = 0; i < size; i++) {
writeShort(out, supp[i].bs);
}
}
public static void writeCOMPOSITE(OutputStream out, Entry[] comp, int size)
throws IOException
{
writeShort(out, MAP_COMPOSITE);
writeShort(out, size*3);
// comp is sorted already
for (int i = 0; i < size; i++) {
writeShort(out, (char)comp[i].bs);
writeShort(out, (char)comp[i].cp);
writeShort(out, (char)comp[i].cp2);
}
}
}
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package build.tools.charsetmapping;
import java.io.*;
import java.util.regex.*;
import static build.tools.charsetmapping.CharsetMapping.*;
public class GenerateMapping {
public static void main(String argv[]) throws IOException {
if (argv.length < 2) {
System.out.println("Usage: java GenCSData fMap fDat");
System.exit(1);
}
genDataJIS0213(new FileInputStream(argv[0]),
new FileOutputStream(argv[1]));
}
// regex pattern to parse the "jis0213.map" file
static Pattern sjis0213 = Pattern.compile("0x(\\p{XDigit}++)\\s++U\\+(\\p{XDigit}++)(?:\\+(\\p{XDigit}++))?\\s++#.*");
private static void genDataJIS0213(InputStream in, OutputStream out)
{
int[] sb = new int[0x100]; // singlebyte
int[] db = new int[0x10000]; // doublebyte
int[] indexC2B = new int[256];
Entry[] supp = new Entry[0x10000];
Entry[] comp = new Entry[0x100];
int suppTotal = 0;
int compTotal = 0;
int b1Min1 = 0x81;
int b1Max1 = 0x9f;
int b1Min2 = 0xe0;
int b1Max2 = 0xfc;
int b2Min = 0x40;
int b2Max = 0xfe;
//init
for (int i = 0; i < 0x80; i++) sb[i] = i;
for (int i = 0x80; i < 0x100; i++) sb[i] = UNMAPPABLE_DECODING;
for (int i = 0; i < 0x10000; i++) db[i] = UNMAPPABLE_DECODING;
try {
Parser p = new Parser(in, sjis0213);
Entry e = null;
while ((e = p.next()) != null) {
if (e.cp2 != 0) {
comp[compTotal++] = e;
} else {
if (e.cp <= 0xffff) {
if (e.bs <= 0xff)
sb[e.bs] = e.cp;
else
db[e.bs] = e.cp;
indexC2B[e.cp>>8] = 1;
} else {
supp[suppTotal++] = e;
}
}
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
// c2b Index Table, always the first one
writeINDEXC2B(baos, indexC2B);
writeSINGLEBYTE(baos, sb);
writeDOUBLEBYTE1(baos, db, b1Min1, b1Max1, b2Min, b2Max);
writeDOUBLEBYTE2(baos, db, b1Min2, b1Max2, b2Min, b2Max);
writeSUPPLEMENT(baos, supp, suppTotal);
writeCOMPOSITE(baos, comp, compTotal);
writeSIZE(out, baos.size());
baos.writeTo(out);
out.close();
} catch (Exception x) {
x.printStackTrace();
}
}
}
...@@ -32,9 +32,9 @@ class CommandNode extends AbstractCommandNode { ...@@ -32,9 +32,9 @@ class CommandNode extends AbstractCommandNode {
void constrain(Context ctx) { void constrain(Context ctx) {
if (components.size() == 3) { if (components.size() == 3) {
Node out = (Node)components.get(0); Node out = components.get(0);
Node reply = (Node)components.get(1); Node reply = components.get(1);
Node error = (Node)components.get(2); Node error = components.get(2);
if (!(out instanceof OutNode)) { if (!(out instanceof OutNode)) {
error("Expected 'Out' item, got: " + out); error("Expected 'Out' item, got: " + out);
} }
...@@ -45,7 +45,7 @@ class CommandNode extends AbstractCommandNode { ...@@ -45,7 +45,7 @@ class CommandNode extends AbstractCommandNode {
error("Expected 'ErrorSet' item, got: " + error); error("Expected 'ErrorSet' item, got: " + error);
} }
} else if (components.size() == 1) { } else if (components.size() == 1) {
Node evt = (Node)components.get(0); Node evt = components.get(0);
if (!(evt instanceof EventNode)) { if (!(evt instanceof EventNode)) {
error("Expected 'Event' item, got: " + evt); error("Expected 'Event' item, got: " + evt);
} }
......
...@@ -98,7 +98,7 @@ class ConstantSetNode extends AbstractNamedNode { ...@@ -98,7 +98,7 @@ class ConstantSetNode extends AbstractNamedNode {
if (constantMap == null) { if (constantMap == null) {
return ""; return "";
} }
String com = (String) constantMap.get(key); String com = constantMap.get(key);
if(com == null){ if(com == null){
return ""; return "";
} else { } else {
......
...@@ -37,7 +37,7 @@ class RepeatNode extends AbstractTypeNode { ...@@ -37,7 +37,7 @@ class RepeatNode extends AbstractTypeNode {
if (components.size() != 1) { if (components.size() != 1) {
error("Repeat must have exactly one member, use Group for more"); error("Repeat must have exactly one member, use Group for more");
} }
member = (Node)(components.get(0)); member = components.get(0);
if (!(member instanceof TypeNode)) { if (!(member instanceof TypeNode)) {
error("Repeat member must be type specifier"); error("Repeat member must be type specifier");
} }
......
文件模式从 100644 更改为 100755
/* /*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define JAR_ERROR2 "Error: Unable to access jarfile %s" #define JAR_ERROR2 "Error: Unable to access jarfile %s"
#define JAR_ERROR3 "Error: Invalid or corrupt jarfile %s" #define JAR_ERROR3 "Error: Invalid or corrupt jarfile %s"
#define CLS_ERROR1 "Error: Could not find the main class.\n" JNI_ERROR #define CLS_ERROR1 "Error: Could not find the main class %s.\n" JNI_ERROR
#define CLS_ERROR2 "Error: Failed to load Main Class: %s\n%s" #define CLS_ERROR2 "Error: Failed to load Main Class: %s\n%s"
#define CLS_ERROR3 "Error: No main method found in specified class.\n" GEN_ERROR #define CLS_ERROR3 "Error: No main method found in specified class.\n" GEN_ERROR
#define CLS_ERROR4 "Error: Main method not public\n" GEN_ERROR #define CLS_ERROR4 "Error: Main method not public\n" GEN_ERROR
......
/* /*
* Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -205,9 +205,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ ...@@ -205,9 +205,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */
_wc_enabled = cpwildcard; _wc_enabled = cpwildcard;
_ergo_policy = ergo; _ergo_policy = ergo;
if (javaw == JNI_TRUE) InitLauncher(javaw);
SetJavaw();
DumpState(); DumpState();
/* /*
...@@ -416,7 +414,7 @@ JavaMain(void * _args) ...@@ -416,7 +414,7 @@ JavaMain(void * _args)
mainClass = LoadClass(env, classname); mainClass = LoadClass(env, classname);
if(mainClass == NULL) { /* exception occured */ if(mainClass == NULL) { /* exception occured */
ReportExceptionDescription(env); ReportExceptionDescription(env);
ReportErrorMessage(CLS_ERROR1); ReportErrorMessage(CLS_ERROR1, classname);
goto leave; goto leave;
} }
(*env)->ReleaseStringUTFChars(env, mainClassName, classname); (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
...@@ -435,7 +433,7 @@ JavaMain(void * _args) ...@@ -435,7 +433,7 @@ JavaMain(void * _args)
mainClass = LoadClass(env, classname); mainClass = LoadClass(env, classname);
if(mainClass == NULL) { /* exception occured */ if(mainClass == NULL) { /* exception occured */
ReportExceptionDescription(env); ReportExceptionDescription(env);
ReportErrorMessage(CLS_ERROR1); ReportErrorMessage(CLS_ERROR1, classname);
goto leave; goto leave;
} }
(*env)->ReleaseStringUTFChars(env, mainClassName, classname); (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
......
...@@ -172,7 +172,6 @@ const char* GetDotVersion(); ...@@ -172,7 +172,6 @@ const char* GetDotVersion();
const char* GetFullVersion(); const char* GetFullVersion();
jboolean IsJavaArgs(); jboolean IsJavaArgs();
jboolean IsJavaw(); jboolean IsJavaw();
void SetJavaw();
jint GetErgoPolicy(); jint GetErgoPolicy();
jboolean ServerClassMachine(); jboolean ServerClassMachine();
...@@ -180,5 +179,9 @@ jboolean ServerClassMachine(); ...@@ -180,5 +179,9 @@ jboolean ServerClassMachine();
static int ContinueInNewThread(InvocationFunctions* ifn, int argc, char** argv, static int ContinueInNewThread(InvocationFunctions* ifn, int argc, char** argv,
char* jarfile, char* classname, int ret); char* jarfile, char* classname, int ret);
/*
* Initialize platform specific settings
*/
void InitLauncher(jboolean javaw);
#endif /* _JAVA_H_ */ #endif /* _JAVA_H_ */
...@@ -64,8 +64,6 @@ main(int argc, char ** argv) ...@@ -64,8 +64,6 @@ main(int argc, char ** argv)
margv = argv; margv = argv;
#endif /* JAVAW */ #endif /* JAVAW */
JLI_SetTraceLauncher();
return JLI_Launch(margc, margv, return JLI_Launch(margc, margv,
sizeof(const_jargs) / sizeof(char *), const_jargs, sizeof(const_jargs) / sizeof(char *), const_jargs,
sizeof(const_appclasspath) / sizeof(char *), const_appclasspath, sizeof(const_appclasspath) / sizeof(char *), const_appclasspath,
......
...@@ -34,6 +34,7 @@ import java.security.KeyRep; ...@@ -34,6 +34,7 @@ import java.security.KeyRep;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.security.InvalidKeyException; import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.spec.InvalidKeySpecException; import java.security.spec.InvalidKeySpecException;
import javax.crypto.Mac; import javax.crypto.Mac;
import javax.crypto.SecretKey; import javax.crypto.SecretKey;
...@@ -107,12 +108,17 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { ...@@ -107,12 +108,17 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey {
throw new InvalidKeySpecException("Key length is negative"); throw new InvalidKeySpecException("Key length is negative");
} }
try { try {
this.prf = Mac.getInstance(prfAlgo, new SunJCE()); this.prf = Mac.getInstance(prfAlgo, "SunJCE");
} catch (NoSuchAlgorithmException nsae) { } catch (NoSuchAlgorithmException nsae) {
// not gonna happen; re-throw just in case // not gonna happen; re-throw just in case
InvalidKeySpecException ike = new InvalidKeySpecException(); InvalidKeySpecException ike = new InvalidKeySpecException();
ike.initCause(nsae); ike.initCause(nsae);
throw ike; throw ike;
} catch (NoSuchProviderException nspe) {
// Again, not gonna happen; re-throw just in case
InvalidKeySpecException ike = new InvalidKeySpecException();
ike.initCause(nspe);
throw ike;
} }
this.key = deriveKey(prf, passwdBytes, salt, iterCount, keyLength); this.key = deriveKey(prf, passwdBytes, salt, iterCount, keyLength);
} }
......
# #
# Default Input method display names for Indic input methods # Default Input method display names for Indic input methods
# #
DisplayName.Devanagari = Devanagari Input Method DisplayName.Devanagari = Devanagari Input Method
# #
# Default Input method display names for Thai input methods # Default Input method display names for Thai input methods
# #
DisplayName.Thai = Thai Input Method DisplayName.Thai = Thai Input Method
...@@ -34,8 +34,6 @@ import java.util.Set; ...@@ -34,8 +34,6 @@ import java.util.Set;
import java.util.HashSet; import java.util.HashSet;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.security.AccessControlContext; import java.security.AccessControlContext;
import java.security.Permission; import java.security.Permission;
import java.security.ProtectionDomain; import java.security.ProtectionDomain;
...@@ -51,7 +49,6 @@ import javax.management.InstanceAlreadyExistsException; ...@@ -51,7 +49,6 @@ import javax.management.InstanceAlreadyExistsException;
import javax.management.InstanceNotFoundException; import javax.management.InstanceNotFoundException;
import javax.management.IntrospectionException; import javax.management.IntrospectionException;
import javax.management.InvalidAttributeValueException; import javax.management.InvalidAttributeValueException;
import javax.management.JMException;
import javax.management.JMRuntimeException; import javax.management.JMRuntimeException;
import javax.management.ListenerNotFoundException; import javax.management.ListenerNotFoundException;
import javax.management.MalformedObjectNameException; import javax.management.MalformedObjectNameException;
...@@ -84,11 +81,10 @@ import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER; ...@@ -84,11 +81,10 @@ import static com.sun.jmx.defaults.JmxProperties.MBEANSERVER_LOGGER;
import com.sun.jmx.mbeanserver.DynamicMBean2; import com.sun.jmx.mbeanserver.DynamicMBean2;
import com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository; import com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository;
import com.sun.jmx.mbeanserver.MBeanInstantiator; import com.sun.jmx.mbeanserver.MBeanInstantiator;
import com.sun.jmx.mbeanserver.MXBeanSupport;
import com.sun.jmx.mbeanserver.Repository; import com.sun.jmx.mbeanserver.Repository;
import com.sun.jmx.mbeanserver.NamedObject; import com.sun.jmx.mbeanserver.NamedObject;
import com.sun.jmx.defaults.ServiceName;
import com.sun.jmx.mbeanserver.Introspector; import com.sun.jmx.mbeanserver.Introspector;
import com.sun.jmx.mbeanserver.Util;
import com.sun.jmx.remote.util.EnvHelp; import com.sun.jmx.remote.util.EnvHelp;
/** /**
...@@ -623,18 +619,9 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor { ...@@ -623,18 +619,9 @@ public class DefaultMBeanServerInterceptor implements MBeanServerInterceptor {
List<String> result = new ArrayList<String>(domains.length); List<String> result = new ArrayList<String>(domains.length);
for (int i = 0; i < domains.length; i++) { for (int i = 0; i < domains.length; i++) {
try { try {
ObjectName domain = new ObjectName(domains[i] + ":x=x"); ObjectName domain = Util.newObjectName(domains[i] + ":x=x");
checkMBeanPermission((String) null, null, domain, "getDomains"); checkMBeanPermission((String) null, null, domain, "getDomains");
result.add(domains[i]); result.add(domains[i]);
} catch (MalformedObjectNameException e) {
// Should never occur... But let's log it just in case.
if (MBEANSERVER_LOGGER.isLoggable(Level.SEVERE)) {
MBEANSERVER_LOGGER.logp(Level.SEVERE,
DefaultMBeanServerInterceptor.class.getName(),
"getDomains",
"Failed to check permission for domain = " +
domains[i], e);
}
} catch (SecurityException e) { } catch (SecurityException e) {
// OK: Do not add this domain to the list // OK: Do not add this domain to the list
} }
......
...@@ -43,6 +43,13 @@ import javax.management.MBeanInfo; ...@@ -43,6 +43,13 @@ import javax.management.MBeanInfo;
import javax.management.NotCompliantMBeanException; import javax.management.NotCompliantMBeanException;
import com.sun.jmx.mbeanserver.Util; import com.sun.jmx.mbeanserver.Util;
import com.sun.jmx.remote.util.EnvHelp;
import java.beans.BeanInfo;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import javax.management.AttributeNotFoundException;
import javax.management.openmbean.CompositeData;
/** /**
* This class contains the methods for performing all the tests needed to verify * This class contains the methods for performing all the tests needed to verify
...@@ -482,4 +489,33 @@ public class Introspector { ...@@ -482,4 +489,33 @@ public class Introspector {
return null; return null;
} }
public static Object elementFromComplex(Object complex, String element)
throws AttributeNotFoundException {
try {
if (complex.getClass().isArray() && element.equals("length")) {
return Array.getLength(complex);
} else if (complex instanceof CompositeData) {
return ((CompositeData) complex).get(element);
} else {
// Java Beans introspection
//
BeanInfo bi = java.beans.Introspector.getBeanInfo(complex.getClass());
PropertyDescriptor[] pds = bi.getPropertyDescriptors();
for (PropertyDescriptor pd : pds)
if (pd.getName().equals(element))
return pd.getReadMethod().invoke(complex);
throw new AttributeNotFoundException(
"Could not find the getter method for the property " +
element + " using the Java Beans introspector");
}
} catch (InvocationTargetException e) {
throw new IllegalArgumentException(e);
} catch (AttributeNotFoundException e) {
throw e;
} catch (Exception e) {
throw EnvHelp.initCause(
new AttributeNotFoundException(e.getMessage()), e);
}
}
} }
...@@ -107,10 +107,7 @@ class MBeanAnalyzer<M> { ...@@ -107,10 +107,7 @@ class MBeanAnalyzer<M> {
private MBeanAnalyzer(Class<?> mbeanInterface, private MBeanAnalyzer(Class<?> mbeanInterface,
MBeanIntrospector<M> introspector) MBeanIntrospector<M> introspector)
throws NotCompliantMBeanException { throws NotCompliantMBeanException {
if (!mbeanInterface.isInterface()) { introspector.checkCompliance(mbeanInterface);
throw new NotCompliantMBeanException("Not an interface: " +
mbeanInterface.getName());
}
try { try {
initMaps(mbeanInterface, introspector); initMaps(mbeanInterface, introspector);
...@@ -121,11 +118,10 @@ class MBeanAnalyzer<M> { ...@@ -121,11 +118,10 @@ class MBeanAnalyzer<M> {
// Introspect the mbeanInterface and initialize this object's maps. // Introspect the mbeanInterface and initialize this object's maps.
// //
private void initMaps(Class<?> mbeanInterface, private void initMaps(Class<?> mbeanType,
MBeanIntrospector<M> introspector) throws Exception { MBeanIntrospector<M> introspector) throws Exception {
final Method[] methodArray = mbeanInterface.getMethods(); final List<Method> methods1 = introspector.getMethods(mbeanType);
final List<Method> methods = eliminateCovariantMethods(methods1);
final List<Method> methods = eliminateCovariantMethods(methodArray);
/* Run through the methods to detect inconsistencies and to enable /* Run through the methods to detect inconsistencies and to enable
us to give getter and setter together to visitAttribute. */ us to give getter and setter together to visitAttribute. */
...@@ -234,13 +230,13 @@ class MBeanAnalyzer<M> { ...@@ -234,13 +230,13 @@ class MBeanAnalyzer<M> {
but existing code may depend on it and users may be used to seeing but existing code may depend on it and users may be used to seeing
operations or attributes appear in a particular order. */ operations or attributes appear in a particular order. */
static List<Method> static List<Method>
eliminateCovariantMethods(Method[] methodArray) { eliminateCovariantMethods(List<Method> startMethods) {
// We are assuming that you never have very many methods with the // We are assuming that you never have very many methods with the
// same name, so it is OK to use algorithms that are quadratic // same name, so it is OK to use algorithms that are quadratic
// in the number of methods with the same name. // in the number of methods with the same name.
final int len = methodArray.length; final int len = startMethods.size();
final Method[] sorted = methodArray.clone(); final Method[] sorted = startMethods.toArray(new Method[len]);
Arrays.sort(sorted,MethodOrder.instance); Arrays.sort(sorted,MethodOrder.instance);
final Set<Method> overridden = newSet(); final Set<Method> overridden = newSet();
for (int i=1;i<len;i++) { for (int i=1;i<len;i++) {
...@@ -259,7 +255,7 @@ class MBeanAnalyzer<M> { ...@@ -259,7 +255,7 @@ class MBeanAnalyzer<M> {
} }
} }
final List<Method> methods = newList(Arrays.asList(methodArray)); final List<Method> methods = newList(startMethods);
methods.removeAll(overridden); methods.removeAll(overridden);
return methods; return methods;
} }
......
...@@ -34,6 +34,7 @@ import java.lang.reflect.Constructor; ...@@ -34,6 +34,7 @@ import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.WeakHashMap; import java.util.WeakHashMap;
...@@ -169,6 +170,19 @@ abstract class MBeanIntrospector<M> { ...@@ -169,6 +170,19 @@ abstract class MBeanIntrospector<M> {
*/ */
abstract Descriptor getMBeanDescriptor(Class<?> resourceClass); abstract Descriptor getMBeanDescriptor(Class<?> resourceClass);
void checkCompliance(Class<?> mbeanType) throws NotCompliantMBeanException {
if (!mbeanType.isInterface()) {
throw new NotCompliantMBeanException("Not an interface: " +
mbeanType.getName());
}
}
/**
* Get the methods to be analyzed to build the MBean interface.
*/
List<Method> getMethods(final Class<?> mbeanType) throws Exception {
return Arrays.asList(mbeanType.getMethods());
}
final PerInterface<M> getPerInterface(Class<?> mbeanInterface) final PerInterface<M> getPerInterface(Class<?> mbeanInterface)
throws NotCompliantMBeanException { throws NotCompliantMBeanException {
......
/*
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.jmx.mbeanserver;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import javax.management.NotCompliantMBeanException;
import javax.management.Notification;
/**
* <p>A variant of {@code StandardMBeanSupport} where the only
* methods included are public getters. This is used by
* {@code QueryNotificationFilter} to pretend that a Notification is
* an MBean so it can have a query evaluated on it. Standard queries
* never set attributes or invoke methods but custom queries could and
* we don't want to allow that. Also we don't want to fail if a
* Notification happens to have inconsistent types in a pair of getX and
* setX methods, and we want to include the Object.getClass() method.
*/
public class NotificationMBeanSupport extends StandardMBeanSupport {
public <T extends Notification> NotificationMBeanSupport(T n)
throws NotCompliantMBeanException {
super(n, Util.<Class<T>>cast(n.getClass()));
}
@Override
MBeanIntrospector<Method> getMBeanIntrospector() {
return introspector;
}
private static class Introspector extends StandardMBeanIntrospector {
@Override
void checkCompliance(Class<?> mbeanType) {}
@Override
List<Method> getMethods(final Class<?> mbeanType)
throws Exception {
List<Method> methods = new ArrayList<Method>();
for (Method m : mbeanType.getMethods()) {
String name = m.getName();
Class<?> ret = m.getReturnType();
if (m.getParameterTypes().length == 0) {
if ((name.startsWith("is") && name.length() > 2 &&
ret == boolean.class) ||
(name.startsWith("get") && name.length() > 3 &&
ret != void.class)) {
methods.add(m);
}
}
}
return methods;
}
}
private static final MBeanIntrospector<Method> introspector =
new Introspector();
}
...@@ -438,7 +438,7 @@ public abstract class OpenConverter { ...@@ -438,7 +438,7 @@ public abstract class OpenConverter {
c.getClassLoader() == null); c.getClassLoader() == null);
final List<Method> methods = final List<Method> methods =
MBeanAnalyzer.eliminateCovariantMethods(c.getMethods()); MBeanAnalyzer.eliminateCovariantMethods(Arrays.asList(c.getMethods()));
final SortedMap<String,Method> getterMap = newSortedMap(); final SortedMap<String,Method> getterMap = newSortedMap();
/* Select public methods that look like "T getX()" or "boolean /* Select public methods that look like "T getX()" or "boolean
...@@ -1118,11 +1118,11 @@ public abstract class OpenConverter { ...@@ -1118,11 +1118,11 @@ public abstract class OpenConverter {
final Class<ConstructorProperties> propertyNamesClass = ConstructorProperties.class; final Class<ConstructorProperties> propertyNamesClass = ConstructorProperties.class;
Class targetClass = getTargetClass(); Class targetClass = getTargetClass();
Constructor[] constrs = targetClass.getConstructors(); Constructor<?>[] constrs = targetClass.getConstructors();
// Applicable if and only if there are any annotated constructors // Applicable if and only if there are any annotated constructors
List<Constructor> annotatedConstrList = newList(); List<Constructor<?>> annotatedConstrList = newList();
for (Constructor constr : constrs) { for (Constructor<?> constr : constrs) {
if (Modifier.isPublic(constr.getModifiers()) if (Modifier.isPublic(constr.getModifiers())
&& constr.getAnnotation(propertyNamesClass) != null) && constr.getAnnotation(propertyNamesClass) != null)
annotatedConstrList.add(constr); annotatedConstrList.add(constr);
...@@ -1152,7 +1152,7 @@ public abstract class OpenConverter { ...@@ -1152,7 +1152,7 @@ public abstract class OpenConverter {
// Also remember the set of properties in that constructor // Also remember the set of properties in that constructor
// so we can test unambiguity. // so we can test unambiguity.
Set<BitSet> getterIndexSets = newSet(); Set<BitSet> getterIndexSets = newSet();
for (Constructor constr : annotatedConstrList) { for (Constructor<?> constr : annotatedConstrList) {
String[] propertyNames = String[] propertyNames =
constr.getAnnotation(propertyNamesClass).value(); constr.getAnnotation(propertyNamesClass).value();
...@@ -1309,10 +1309,10 @@ public abstract class OpenConverter { ...@@ -1309,10 +1309,10 @@ public abstract class OpenConverter {
} }
private static class Constr { private static class Constr {
final Constructor constructor; final Constructor<?> constructor;
final int[] paramIndexes; final int[] paramIndexes;
final BitSet presentParams; final BitSet presentParams;
Constr(Constructor constructor, int[] paramIndexes, Constr(Constructor<?> constructor, int[] paramIndexes,
BitSet presentParams) { BitSet presentParams) {
this.constructor = constructor; this.constructor = constructor;
this.paramIndexes = paramIndexes; this.paramIndexes = paramIndexes;
......
...@@ -415,17 +415,8 @@ public class Repository { ...@@ -415,17 +415,8 @@ public class Repository {
boolean to_default_domain = false; boolean to_default_domain = false;
// Set domain to default if domain is empty and not already set // Set domain to default if domain is empty and not already set
if (dom.length() == 0) { if (dom.length() == 0)
try { name = Util.newObjectName(domain + name.toString());
name = new ObjectName(domain + name.toString());
} catch (MalformedObjectNameException e) {
if (MBEANSERVER_LOGGER.isLoggable(Level.FINEST)) {
MBEANSERVER_LOGGER.logp(Level.FINEST,
Repository.class.getName(), "addMBean",
"Unexpected MalformedObjectNameException", e);
}
}
}
// Do we have default domain ? // Do we have default domain ?
if (dom == domain) { if (dom == domain) {
......
...@@ -38,6 +38,8 @@ import java.util.Map; ...@@ -38,6 +38,8 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.SortedMap; import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
public class Util { public class Util {
static <K, V> Map<K, V> newMap() { static <K, V> Map<K, V> newMap() {
...@@ -85,6 +87,14 @@ public class Util { ...@@ -85,6 +87,14 @@ public class Util {
return new ArrayList<E>(c); return new ArrayList<E>(c);
} }
public static ObjectName newObjectName(String s) {
try {
return new ObjectName(s);
} catch (MalformedObjectNameException e) {
throw new IllegalArgumentException(e);
}
}
/* This method can be used by code that is deliberately violating the /* This method can be used by code that is deliberately violating the
* allowed checked casts. Rather than marking the whole method containing * allowed checked casts. Rather than marking the whole method containing
* the code with @SuppressWarnings, you can use a call to this method for * the code with @SuppressWarnings, you can use a call to this method for
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
package com.sun.management; package com.sun.management;
import java.lang.management.PlatformManagedObject;
/** /**
* Diagnostic management interface for the HotSpot Virtual Machine. * Diagnostic management interface for the HotSpot Virtual Machine.
* The diagnostic MBean is registered to the platform MBeanServer * The diagnostic MBean is registered to the platform MBeanServer
...@@ -35,8 +37,13 @@ package com.sun.management; ...@@ -35,8 +37,13 @@ package com.sun.management;
* <blockquote> * <blockquote>
* <tt>com.sun.management:type=HotSpotDiagnostic</tt> * <tt>com.sun.management:type=HotSpotDiagnostic</tt>
* </blockquote> * </blockquote>
.*
* It can be obtained by calling the
* {@link PlatformManagedObject#getObjectName} method.
*
* @see ManagementFactory#getPlatformMXBeans(Class)
*/ */
public interface HotSpotDiagnosticMXBean { public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
/** /**
* Dumps the heap to the <tt>outputFile</tt> file in the same * Dumps the heap to the <tt>outputFile</tt> file in the same
* format as the hprof heap dump. * format as the hprof heap dump.
......
CTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html> <html>
<head> <head>
<!-- <!--
......
<?xml version='1.0' encoding='UTF-8' ?> <?xml version='1.0' encoding='UTF-8' ?>
<!ELEMENT Configuration (CanonicalizationMethods , TransformAlgorithms , JCEAlgorithmMappings , Log4J , ResourceBundles , UnitTests , ResourceResolvers , KeyResolvers)> <!ELEMENT Configuration (CanonicalizationMethods , TransformAlgorithms , JCEAlgorithmMappings , Log4J , ResourceBundles , UnitTests , ResourceResolvers , KeyResolvers)>
<!ATTLIST Configuration xmlns CDATA #FIXED 'http://www.xmlsecurity.org/NS/#configuration' <!ATTLIST Configuration xmlns CDATA #FIXED 'http://www.xmlsecurity.org/NS/#configuration'
target CDATA #IMPLIED> target CDATA #IMPLIED>
<!ELEMENT CanonicalizationMethods (CanonicalizationMethod+)> <!ELEMENT CanonicalizationMethods (CanonicalizationMethod+)>
<!ATTLIST CanonicalizationMethods JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.c14n.Canonicalizer' > <!ATTLIST CanonicalizationMethods JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.c14n.Canonicalizer' >
<!ELEMENT CanonicalizationMethod EMPTY> <!ELEMENT CanonicalizationMethod EMPTY>
<!ATTLIST CanonicalizationMethod URI CDATA #REQUIRED <!ATTLIST CanonicalizationMethod URI CDATA #REQUIRED
JAVACLASS CDATA #REQUIRED > JAVACLASS CDATA #REQUIRED >
<!ELEMENT TransformAlgorithms (TransformAlgorithm+)> <!ELEMENT TransformAlgorithms (TransformAlgorithm+)>
<!ATTLIST TransformAlgorithms JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.transforms.Transform' > <!ATTLIST TransformAlgorithms JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.transforms.Transform' >
<!ELEMENT TransformAlgorithm EMPTY> <!ELEMENT TransformAlgorithm EMPTY>
<!ATTLIST TransformAlgorithm URI CDATA #REQUIRED <!ATTLIST TransformAlgorithm URI CDATA #REQUIRED
JAVACLASS CDATA #REQUIRED > JAVACLASS CDATA #REQUIRED >
<!ELEMENT JCEAlgorithmMappings (Providers , Algorithms)> <!ELEMENT JCEAlgorithmMappings (Providers , Algorithms)>
<!ELEMENT Providers (Provider+)> <!ELEMENT Providers (Provider+)>
<!ELEMENT Provider EMPTY> <!ELEMENT Provider EMPTY>
<!ATTLIST Provider Id ID #REQUIRED <!ATTLIST Provider Id ID #REQUIRED
Class CDATA #REQUIRED Class CDATA #REQUIRED
Info CDATA #IMPLIED Info CDATA #IMPLIED
ProviderURL CDATA #IMPLIED > ProviderURL CDATA #IMPLIED >
<!ELEMENT Algorithms (Algorithm+)> <!ELEMENT Algorithms (Algorithm+)>
<!ELEMENT Algorithm (ProviderAlgo+)> <!ELEMENT Algorithm (ProviderAlgo+)>
<!ATTLIST Algorithm URI CDATA #REQUIRED <!ATTLIST Algorithm URI CDATA #REQUIRED
Description CDATA #IMPLIED Description CDATA #IMPLIED
AlgorithmClass CDATA #IMPLIED > AlgorithmClass CDATA #IMPLIED >
<!ELEMENT ProviderAlgo EMPTY> <!ELEMENT ProviderAlgo EMPTY>
<!ATTLIST ProviderAlgo ProviderId IDREF #REQUIRED <!ATTLIST ProviderAlgo ProviderId IDREF #REQUIRED
JCEName CDATA #REQUIRED JCEName CDATA #REQUIRED
JCEAlias CDATA #IMPLIED > JCEAlias CDATA #IMPLIED >
<!ELEMENT Log4J EMPTY> <!ELEMENT Log4J EMPTY>
<!ATTLIST Log4J configFile CDATA 'data/log4j.xml' > <!ATTLIST Log4J configFile CDATA 'data/log4j.xml' >
<!ELEMENT ResourceBundles (ResourceBundle+)> <!ELEMENT ResourceBundles (ResourceBundle+)>
<!ATTLIST ResourceBundles defaultLanguageCode CDATA 'de' <!ATTLIST ResourceBundles defaultLanguageCode CDATA 'de'
defaultCountryCode CDATA 'DE' > defaultCountryCode CDATA 'DE' >
<!ELEMENT ResourceBundle EMPTY> <!ELEMENT ResourceBundle EMPTY>
<!ATTLIST ResourceBundle LanguageCode CDATA #REQUIRED <!ATTLIST ResourceBundle LanguageCode CDATA #REQUIRED
CountryCode CDATA #REQUIRED CountryCode CDATA #REQUIRED
LOCATION CDATA #REQUIRED > LOCATION CDATA #REQUIRED >
<!ELEMENT UnitTests (UnitTest+)> <!ELEMENT UnitTests (UnitTest+)>
<!ATTLIST UnitTests JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.test.AllTests' > <!ATTLIST UnitTests JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.test.AllTests' >
<!ELEMENT ResourceResolvers (Resolver+)> <!ELEMENT ResourceResolvers (Resolver+)>
<!ELEMENT Resolver EMPTY> <!ELEMENT Resolver EMPTY>
<!ATTLIST Resolver JAVACLASS CDATA #REQUIRED <!ATTLIST Resolver JAVACLASS CDATA #REQUIRED
DESCRIPTION CDATA #IMPLIED > DESCRIPTION CDATA #IMPLIED >
<!ELEMENT KeyResolvers (KeyResolver+)> <!ELEMENT KeyResolvers (KeyResolver+)>
<!ATTLIST KeyResolvers JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.keys.KeyResolver' > <!ATTLIST KeyResolvers JAVACLASS CDATA #FIXED 'com.sun.org.apache.xml.internal.security.keys.KeyResolver' >
<!ELEMENT KeyResolver EMPTY> <!ELEMENT KeyResolver EMPTY>
<!ATTLIST KeyResolver URI CDATA #REQUIRED <!ATTLIST KeyResolver URI CDATA #REQUIRED
JAVACLASS CDATA #REQUIRED > JAVACLASS CDATA #REQUIRED >
<!ELEMENT UnitTest (#PCDATA)> <!ELEMENT UnitTest (#PCDATA)>
<!ATTLIST UnitTest JAVACLASS CDATA #REQUIRED > <!ATTLIST UnitTest JAVACLASS CDATA #REQUIRED >
...@@ -91,9 +91,7 @@ abstract public class EventRequestSpec { ...@@ -91,9 +91,7 @@ abstract public class EventRequestSpec {
void attemptImmediateResolve(VirtualMachine vm) { void attemptImmediateResolve(VirtualMachine vm) {
// try to resolve immediately // try to resolve immediately
Iterator iter = vm.allClasses().iterator(); for (ReferenceType refType : vm.allClasses()) {
while (iter.hasNext()) {
ReferenceType refType = (ReferenceType)iter.next();
if (refSpec.matches(refType)) { if (refSpec.matches(refType)) {
try { try {
resolve(refType); resolve(refType);
......
...@@ -47,9 +47,8 @@ class EventRequestSpecList { ...@@ -47,9 +47,8 @@ class EventRequestSpecList {
*/ */
void resolve(ReferenceType refType) { void resolve(ReferenceType refType) {
synchronized(eventRequestSpecs) { synchronized(eventRequestSpecs) {
Iterator iter = eventRequestSpecs.iterator(); for (EventRequestSpec spec : eventRequestSpecs) {
while (iter.hasNext()) { spec.attemptResolve(refType);
((EventRequestSpec)iter.next()).attemptResolve(refType);
} }
} }
} }
...@@ -79,7 +78,7 @@ class EventRequestSpecList { ...@@ -79,7 +78,7 @@ class EventRequestSpecList {
BreakpointSpec BreakpointSpec
createMethodBreakpoint(String classPattern, createMethodBreakpoint(String classPattern,
String methodId, List methodArgs) { String methodId, List<String> methodArgs) {
ReferenceTypeSpec refSpec = ReferenceTypeSpec refSpec =
new PatternReferenceTypeSpec(classPattern); new PatternReferenceTypeSpec(classPattern);
return new MethodBreakpointSpec(this, refSpec, return new MethodBreakpointSpec(this, refSpec,
...@@ -132,47 +131,48 @@ class EventRequestSpecList { ...@@ -132,47 +131,48 @@ class EventRequestSpecList {
// -------- notify routines -------------------- // -------- notify routines --------------------
private Vector specListeners() { @SuppressWarnings("unchecked")
return (Vector)runtime.specListeners.clone(); private Vector<SpecListener> specListeners() {
return (Vector<SpecListener>)runtime.specListeners.clone();
} }
void notifySet(EventRequestSpec spec) { void notifySet(EventRequestSpec spec) {
Vector l = specListeners(); Vector<SpecListener> l = specListeners();
SpecEvent evt = new SpecEvent(spec); SpecEvent evt = new SpecEvent(spec);
for (int i = 0; i < l.size(); i++) { for (int i = 0; i < l.size(); i++) {
spec.notifySet((SpecListener)l.elementAt(i), evt); spec.notifySet(l.elementAt(i), evt);
} }
} }
void notifyDeferred(EventRequestSpec spec) { void notifyDeferred(EventRequestSpec spec) {
Vector l = specListeners(); Vector<SpecListener> l = specListeners();
SpecEvent evt = new SpecEvent(spec); SpecEvent evt = new SpecEvent(spec);
for (int i = 0; i < l.size(); i++) { for (int i = 0; i < l.size(); i++) {
spec.notifyDeferred((SpecListener)l.elementAt(i), evt); spec.notifyDeferred(l.elementAt(i), evt);
} }
} }
void notifyDeleted(EventRequestSpec spec) { void notifyDeleted(EventRequestSpec spec) {
Vector l = specListeners(); Vector<SpecListener> l = specListeners();
SpecEvent evt = new SpecEvent(spec); SpecEvent evt = new SpecEvent(spec);
for (int i = 0; i < l.size(); i++) { for (int i = 0; i < l.size(); i++) {
spec.notifyDeleted((SpecListener)l.elementAt(i), evt); spec.notifyDeleted(l.elementAt(i), evt);
} }
} }
void notifyResolved(EventRequestSpec spec) { void notifyResolved(EventRequestSpec spec) {
Vector l = specListeners(); Vector<SpecListener> l = specListeners();
SpecEvent evt = new SpecEvent(spec); SpecEvent evt = new SpecEvent(spec);
for (int i = 0; i < l.size(); i++) { for (int i = 0; i < l.size(); i++) {
spec.notifyResolved((SpecListener)l.elementAt(i), evt); spec.notifyResolved(l.elementAt(i), evt);
} }
} }
void notifyError(EventRequestSpec spec, Exception exc) { void notifyError(EventRequestSpec spec, Exception exc) {
Vector l = specListeners(); Vector<SpecListener> l = specListeners();
SpecErrorEvent evt = new SpecErrorEvent(spec, exc); SpecErrorEvent evt = new SpecErrorEvent(spec, exc);
for (int i = 0; i < l.size(); i++) { for (int i = 0; i < l.size(); i++) {
spec.notifyError((SpecListener)l.elementAt(i), evt); spec.notifyError(l.elementAt(i), evt);
} }
} }
} }
...@@ -232,10 +232,7 @@ public class ExecutionManager { ...@@ -232,10 +232,7 @@ public class ExecutionManager {
if (pattern.startsWith("*.")) { if (pattern.startsWith("*.")) {
// Wildcard matches any leading package name. // Wildcard matches any leading package name.
pattern = pattern.substring(1); pattern = pattern.substring(1);
List classes = vm().allClasses(); for (ReferenceType type : vm().allClasses()) {
Iterator iter = classes.iterator();
while (iter.hasNext()) {
ReferenceType type = ((ReferenceType)iter.next());
if (type.name().endsWith(pattern)) { if (type.name().endsWith(pattern)) {
result.add(type); result.add(type);
} }
...@@ -278,7 +275,7 @@ public class ExecutionManager { ...@@ -278,7 +275,7 @@ public class ExecutionManager {
public ThreadGroupReference systemThreadGroup() public ThreadGroupReference systemThreadGroup()
throws NoSessionException { throws NoSessionException {
ensureActiveSession(); ensureActiveSession();
return (ThreadGroupReference)vm().topLevelThreadGroups().get(0); return vm().topLevelThreadGroups().get(0);
} }
/* /*
...@@ -349,10 +346,9 @@ public class ExecutionManager { ...@@ -349,10 +346,9 @@ public class ExecutionManager {
* attach sessions. * attach sessions.
*/ */
VirtualMachineManager mgr = Bootstrap.virtualMachineManager(); VirtualMachineManager mgr = Bootstrap.virtualMachineManager();
List connectors = mgr.attachingConnectors(); AttachingConnector connector = mgr.attachingConnectors().get(0);
AttachingConnector connector = (AttachingConnector)connectors.get(0);
Map<String, Connector.Argument> arguments = connector.defaultArguments(); Map<String, Connector.Argument> arguments = connector.defaultArguments();
((Connector.Argument)arguments.get("port")).setValue(portName); arguments.get("port").setValue(portName);
Session newSession = internalAttach(connector, arguments); Session newSession = internalAttach(connector, arguments);
if (newSession != null) { if (newSession != null) {
...@@ -504,10 +500,7 @@ public class ExecutionManager { ...@@ -504,10 +500,7 @@ public class ExecutionManager {
* if so, it gets removed here. * if so, it gets removed here.
*/ */
EventRequestManager mgr = vm().eventRequestManager(); EventRequestManager mgr = vm().eventRequestManager();
List requests = mgr.stepRequests(); for (StepRequest request : mgr.stepRequests()) {
Iterator iter = requests.iterator();
while (iter.hasNext()) {
StepRequest request = (StepRequest)iter.next();
if (request.thread().equals(thread)) { if (request.thread().equals(thread)) {
mgr.deleteEventRequest(request); mgr.deleteEventRequest(request);
break; break;
...@@ -591,7 +584,7 @@ public class ExecutionManager { ...@@ -591,7 +584,7 @@ public class ExecutionManager {
if (session == null || thread == null) { if (session == null || thread == null) {
return null; return null;
} }
ThreadInfo info = (ThreadInfo)threadInfoMap.get(thread); ThreadInfo info = threadInfoMap.get(thread);
if (info == null) { if (info == null) {
//### Should not hardcode initial frame count and prefetch here! //### Should not hardcode initial frame count and prefetch here!
//info = new ThreadInfo(thread, 10, 10); //info = new ThreadInfo(thread, 10, 10);
...@@ -607,24 +600,22 @@ public class ExecutionManager { ...@@ -607,24 +600,22 @@ public class ExecutionManager {
void validateThreadInfo() { void validateThreadInfo() {
session.interrupted = true; session.interrupted = true;
Iterator iter = threadInfoList.iterator(); for (ThreadInfo threadInfo : threadInfoList) {
while (iter.hasNext()) { threadInfo.validate();
((ThreadInfo)iter.next()).validate();
} }
} }
private void invalidateThreadInfo() { private void invalidateThreadInfo() {
if (session != null) { if (session != null) {
session.interrupted = false; session.interrupted = false;
Iterator iter = threadInfoList.iterator(); for (ThreadInfo threadInfo : threadInfoList) {
while (iter.hasNext()) { threadInfo.invalidate();
((ThreadInfo)iter.next()).invalidate();
} }
} }
} }
void removeThreadInfo(ThreadReference thread) { void removeThreadInfo(ThreadReference thread) {
ThreadInfo info = (ThreadInfo)threadInfoMap.get(thread); ThreadInfo info = threadInfoMap.get(thread);
if (info != null) { if (info != null) {
info.invalidate(); info.invalidate();
threadInfoMap.remove(thread); threadInfoMap.remove(thread);
...@@ -702,7 +693,7 @@ public class ExecutionManager { ...@@ -702,7 +693,7 @@ public class ExecutionManager {
while (inputBuffer.size() < 1) { while (inputBuffer.size() < 1) {
inputLock.wait(); inputLock.wait();
} }
line = (String)inputBuffer.removeLast(); line = inputBuffer.removeLast();
} catch (InterruptedException e) {} } catch (InterruptedException e) {}
} }
} }
...@@ -774,7 +765,7 @@ public class ExecutionManager { ...@@ -774,7 +765,7 @@ public class ExecutionManager {
public BreakpointSpec public BreakpointSpec
createMethodBreakpoint(String classPattern, createMethodBreakpoint(String classPattern,
String methodId, List methodArgs) { String methodId, List<String> methodArgs) {
return specList.createMethodBreakpoint(classPattern, return specList.createMethodBreakpoint(classPattern,
methodId, methodArgs); methodId, methodArgs);
} }
...@@ -811,7 +802,7 @@ public class ExecutionManager { ...@@ -811,7 +802,7 @@ public class ExecutionManager {
specList.install(spec, vm()); specList.install(spec, vm());
} }
public List eventRequestSpecs() { public List<EventRequestSpec> eventRequestSpecs() {
return specList.eventRequestSpecs(); return specList.eventRequestSpecs();
} }
} }
...@@ -82,9 +82,7 @@ class JDIEventSource extends Thread { ...@@ -82,9 +82,7 @@ class JDIEventSource extends Thread {
boolean interrupted = es.suspendedAll(); boolean interrupted = es.suspendedAll();
es.notify(firstListener); es.notify(firstListener);
boolean wantInterrupt = JDIEventSource.this.wantInterrupt; boolean wantInterrupt = JDIEventSource.this.wantInterrupt;
for (Iterator it = session.runtime.jdiListeners.iterator(); for (JDIListener jl : session.runtime.jdiListeners) {
it.hasNext(); ) {
JDIListener jl = (JDIListener)it.next();
es.notify(jl); es.notify(jl);
} }
if (interrupted && !wantInterrupt) { if (interrupted && !wantInterrupt) {
......
...@@ -58,12 +58,12 @@ public class LineBreakpointSpec extends BreakpointSpec { ...@@ -58,12 +58,12 @@ public class LineBreakpointSpec extends BreakpointSpec {
LineNotFoundException { LineNotFoundException {
Location location = null; Location location = null;
try { try {
List locs = clazz.locationsOfLine(lineNumber()); List<Location> locs = clazz.locationsOfLine(lineNumber());
if (locs.size() == 0) { if (locs.size() == 0) {
throw new LineNotFoundException(); throw new LineNotFoundException();
} }
// TODO handle multiple locations // TODO handle multiple locations
location = (Location)locs.get(0); location = locs.get(0);
if (location.method() == null) { if (location.method() == null) {
throw new LineNotFoundException(); throw new LineNotFoundException();
} }
......
...@@ -34,11 +34,11 @@ import java.util.Iterator; ...@@ -34,11 +34,11 @@ import java.util.Iterator;
public class MethodBreakpointSpec extends BreakpointSpec { public class MethodBreakpointSpec extends BreakpointSpec {
String methodId; String methodId;
List methodArgs; List<String> methodArgs;
MethodBreakpointSpec(EventRequestSpecList specs, MethodBreakpointSpec(EventRequestSpecList specs,
ReferenceTypeSpec refSpec, ReferenceTypeSpec refSpec,
String methodId, List methodArgs) { String methodId, List<String> methodArgs) {
super(specs, refSpec); super(specs, refSpec);
this.methodId = methodId; this.methodId = methodId;
this.methodArgs = methodArgs; this.methodArgs = methodArgs;
...@@ -76,7 +76,7 @@ public class MethodBreakpointSpec extends BreakpointSpec { ...@@ -76,7 +76,7 @@ public class MethodBreakpointSpec extends BreakpointSpec {
return methodId; return methodId;
} }
public List methodArgs() { public List<String> methodArgs() {
return methodArgs; return methodArgs;
} }
...@@ -120,14 +120,13 @@ public class MethodBreakpointSpec extends BreakpointSpec { ...@@ -120,14 +120,13 @@ public class MethodBreakpointSpec extends BreakpointSpec {
buffer.append('.'); buffer.append('.');
buffer.append(methodId); buffer.append(methodId);
if (methodArgs != null) { if (methodArgs != null) {
Iterator iter = methodArgs.iterator();
boolean first = true; boolean first = true;
buffer.append('('); buffer.append('(');
while (iter.hasNext()) { for (String name : methodArgs) {
if (!first) { if (!first) {
buffer.append(','); buffer.append(',');
} }
buffer.append((String)iter.next()); buffer.append(name);
first = false; first = false;
} }
buffer.append(")"); buffer.append(")");
...@@ -151,8 +150,8 @@ public class MethodBreakpointSpec extends BreakpointSpec { ...@@ -151,8 +150,8 @@ public class MethodBreakpointSpec extends BreakpointSpec {
* and if the number of arguments in the method matches the * and if the number of arguments in the method matches the
* number of names passed * number of names passed
*/ */
private boolean compareArgTypes(Method method, List nameList) { private boolean compareArgTypes(Method method, List<String> nameList) {
List argTypeNames = method.argumentTypeNames(); List<String> argTypeNames = method.argumentTypeNames();
// If argument counts differ, we can stop here // If argument counts differ, we can stop here
if (argTypeNames.size() != nameList.size()) { if (argTypeNames.size() != nameList.size()) {
...@@ -162,8 +161,8 @@ public class MethodBreakpointSpec extends BreakpointSpec { ...@@ -162,8 +161,8 @@ public class MethodBreakpointSpec extends BreakpointSpec {
// Compare each argument type's name // Compare each argument type's name
int nTypes = argTypeNames.size(); int nTypes = argTypeNames.size();
for (int i = 0; i < nTypes; ++i) { for (int i = 0; i < nTypes; ++i) {
String comp1 = (String)argTypeNames.get(i); String comp1 = argTypeNames.get(i);
String comp2 = (String)nameList.get(i); String comp2 = nameList.get(i);
if (! comp1.equals(comp2)) { if (! comp1.equals(comp2)) {
/* /*
* We have to handle varargs. EG, the * We have to handle varargs. EG, the
...@@ -288,22 +287,17 @@ public class MethodBreakpointSpec extends BreakpointSpec { ...@@ -288,22 +287,17 @@ public class MethodBreakpointSpec extends BreakpointSpec {
List<String> argTypeNames = null; List<String> argTypeNames = null;
if (methodArgs() != null) { if (methodArgs() != null) {
argTypeNames = new ArrayList<String>(methodArgs().size()); argTypeNames = new ArrayList<String>(methodArgs().size());
Iterator iter = methodArgs().iterator(); for (String name : methodArgs()) {
while (iter.hasNext()) {
String name = (String)iter.next();
name = normalizeArgTypeName(name); name = normalizeArgTypeName(name);
argTypeNames.add(name); argTypeNames.add(name);
} }
} }
// Check each method in the class for matches // Check each method in the class for matches
Iterator iter = clazz.methods().iterator();
Method firstMatch = null; // first method with matching name Method firstMatch = null; // first method with matching name
Method exactMatch = null; // (only) method with same name & sig Method exactMatch = null; // (only) method with same name & sig
int matchCount = 0; // > 1 implies overload int matchCount = 0; // > 1 implies overload
while (iter.hasNext()) { for (Method candidate : clazz.methods()) {
Method candidate = (Method)iter.next();
if (candidate.name().equals(methodName())) { if (candidate.name().equals(methodName())) {
matchCount++; matchCount++;
......
...@@ -36,7 +36,7 @@ import java.util.Iterator; ...@@ -36,7 +36,7 @@ import java.util.Iterator;
* Descend the tree of thread groups. * Descend the tree of thread groups.
* @author Robert G. Field * @author Robert G. Field
*/ */
public class ThreadGroupIterator implements Iterator { public class ThreadGroupIterator implements Iterator<ThreadGroupReference> {
private final Stack<Iterator<ThreadGroupReference>> stack private final Stack<Iterator<ThreadGroupReference>> stack
= new Stack<Iterator<ThreadGroupReference>>(); = new Stack<Iterator<ThreadGroupReference>>();
...@@ -56,8 +56,8 @@ public class ThreadGroupIterator implements Iterator { ...@@ -56,8 +56,8 @@ public class ThreadGroupIterator implements Iterator {
} }
*/ */
private Iterator top() { private Iterator<ThreadGroupReference> top() {
return (Iterator)stack.peek(); return stack.peek();
} }
/** /**
...@@ -77,12 +77,12 @@ public class ThreadGroupIterator implements Iterator { ...@@ -77,12 +77,12 @@ public class ThreadGroupIterator implements Iterator {
return !stack.isEmpty(); return !stack.isEmpty();
} }
public Object next() { public ThreadGroupReference next() {
return nextThreadGroup(); return nextThreadGroup();
} }
public ThreadGroupReference nextThreadGroup() { public ThreadGroupReference nextThreadGroup() {
ThreadGroupReference tg = (ThreadGroupReference)top().next(); ThreadGroupReference tg = top().next();
push(tg.threadGroups()); push(tg.threadGroups());
return tg; return tg;
} }
......
...@@ -30,8 +30,8 @@ import com.sun.jdi.ThreadReference; ...@@ -30,8 +30,8 @@ import com.sun.jdi.ThreadReference;
import java.util.List; import java.util.List;
import java.util.Iterator; import java.util.Iterator;
public class ThreadIterator implements Iterator { public class ThreadIterator implements Iterator<ThreadReference> {
Iterator it = null; Iterator<ThreadReference> it = null;
ThreadGroupIterator tgi; ThreadGroupIterator tgi;
public ThreadIterator(ThreadGroupReference tg) { public ThreadIterator(ThreadGroupReference tg) {
...@@ -53,12 +53,12 @@ public class ThreadIterator implements Iterator { ...@@ -53,12 +53,12 @@ public class ThreadIterator implements Iterator {
return true; return true;
} }
public Object next() { public ThreadReference next() {
return it.next(); return it.next();
} }
public ThreadReference nextThread() { public ThreadReference nextThread() {
return (ThreadReference)next(); return next();
} }
public void remove() { public void remove() {
......
...@@ -124,9 +124,7 @@ public class ClassTreeTool extends JPanel { ...@@ -124,9 +124,7 @@ public class ClassTreeTool extends JPanel {
public void sessionStart(EventObject e) { public void sessionStart(EventObject e) {
// Get system classes and any others loaded before attaching. // Get system classes and any others loaded before attaching.
try { try {
Iterator iter = runtime.allClasses().iterator(); for (ReferenceType type : runtime.allClasses()) {
while (iter.hasNext()) {
ReferenceType type = ((ReferenceType)iter.next());
root.addClass(type); root.addClass(type);
} }
} catch (VMDisconnectedException ee) { } catch (VMDisconnectedException ee) {
......
...@@ -201,11 +201,11 @@ public class JDBFileFilter extends FileFilter { ...@@ -201,11 +201,11 @@ public class JDBFileFilter extends FileFilter {
if(description == null || isExtensionListInDescription()) { if(description == null || isExtensionListInDescription()) {
fullDescription = description==null ? "(" : description + " ("; fullDescription = description==null ? "(" : description + " (";
// build the description from the extension list // build the description from the extension list
Enumeration extensions = filters.keys(); Enumeration<String> extensions = filters.keys();
if(extensions != null) { if(extensions != null) {
fullDescription += "." + (String) extensions.nextElement(); fullDescription += "." + extensions.nextElement();
while (extensions.hasMoreElements()) { while (extensions.hasMoreElements()) {
fullDescription += ", " + (String) extensions.nextElement(); fullDescription += ", " + extensions.nextElement();
} }
} }
fullDescription += ")"; fullDescription += ")";
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册