Merge
This commit is contained in:
commit
a2e046f672
@ -116,6 +116,14 @@ LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
|
||||
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
|
||||
LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
|
||||
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both
|
||||
# The gnu .hash section won't work on some Linux systems like SuSE 10.
|
||||
_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu')
|
||||
ifneq ($(_HAS_HASH_STYLE_GNU),)
|
||||
LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
|
||||
endif
|
||||
LDFLAGS_COMMON += $(LDFLAGS_HASH_STYLE)
|
||||
|
||||
#
|
||||
# Selection of warning messages
|
||||
#
|
||||
|
@ -68,24 +68,6 @@ ifeq ($(PLATFORM), linux)
|
||||
else
|
||||
CXX = $(COMPILER_PATH)g++
|
||||
endif
|
||||
ifneq ("$(findstring sparc,$(ARCH))", "")
|
||||
# sparc or sparcv9
|
||||
REQUIRED_CC_VER = 4.0
|
||||
REQUIRED_GCC_VER = 4.0.*
|
||||
else
|
||||
REQUIRED_CC_VER = 3.2
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
REQUIRED_GCC_VER = 3.2.1*
|
||||
REQUIRED_GCC_VER_INT = 3.2.1-7a
|
||||
else
|
||||
ifeq ($(ARCH), amd64)
|
||||
REQUIRED_GCC_VER = 3.2.*
|
||||
endif
|
||||
ifeq ($(ARCH), ia64)
|
||||
REQUIRED_GCC_VER = 2.9[56789].*
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
# Option used to create a shared library
|
||||
SHARED_LIBRARY_FLAG = -shared -mimpure-text
|
||||
SUN_COMP_VER := $(shell $(CC) --verbose 2>&1 )
|
||||
@ -98,18 +80,10 @@ ifeq ($(PLATFORM), solaris)
|
||||
CC = $(COMPILER_PATH)gcc
|
||||
CPP = $(COMPILER_PATH)gcc -E
|
||||
CXX = $(COMPILER_PATH)g++
|
||||
REQUIRED_CC_VER = 3.2
|
||||
|
||||
# Option used to create a shared library
|
||||
SHARED_LIBRARY_FLAG = -G
|
||||
# But gcc is still needed no matter what on 32bit
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
REQUIRED_GCC_VER = 2.95
|
||||
GCC =$(GCC_COMPILER_PATH)gcc
|
||||
_GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
|
||||
GCC_VER :=$(call GetVersion,"$(_GCC_VER)")
|
||||
endif
|
||||
|
||||
|
||||
endif
|
||||
|
||||
# Get gcc version
|
||||
|
@ -41,8 +41,6 @@ ifeq ($(PLATFORM), windows)
|
||||
# Fill in unknown values
|
||||
COMPILER_NAME=Unknown MSVC Compiler
|
||||
COMPILER_VERSION=
|
||||
REQUIRED_CC_VER=
|
||||
REQUIRED_LINK_VER=
|
||||
|
||||
# unset any GNU Make settings of MFLAGS and MAKEFLAGS which may mess up nmake
|
||||
NMAKE = MFLAGS= MAKEFLAGS= $(COMPILER_PATH)nmake -nologo
|
||||
@ -56,8 +54,6 @@ ifeq ($(PLATFORM), windows)
|
||||
CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
|
||||
ifeq ($(CC_MAJORVER), 13)
|
||||
# This should be: CC_VER=13.10.3077 LINK_VER=7.10.3077
|
||||
REQUIRED_CC_VER = 13.10.3077
|
||||
REQUIRED_LINK_VER = 7.10.3077
|
||||
COMPILER_NAME=Visual Studio .NET 2003 Professional C++
|
||||
COMPILER_VERSION=VS2003
|
||||
REBASE = $(COMPILER_PATH)../../Common7/Tools/Bin/rebase
|
||||
@ -67,9 +63,6 @@ ifeq ($(PLATFORM), windows)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CC_MAJORVER), 14)
|
||||
# This should be: CC_VER=14.00.50727.42 LINK_VER=8.00.50727.42
|
||||
REQUIRED_CC_VER = 14.00.50727.42
|
||||
REQUIRED_LINK_VER = 8.00.50727.42
|
||||
COMPILER_NAME=Visual Studio 8
|
||||
COMPILER_VERSION=VS2005
|
||||
REBASE = $(COMPILER_PATH)../../Common8/Tools/Bin/rebase
|
||||
@ -80,9 +73,6 @@ ifeq ($(PLATFORM), windows)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CC_MAJORVER), 15)
|
||||
# This should be: CC_VER=15.00.21022.08 LINK_VER=9.00.21022.08
|
||||
REQUIRED_CC_VER = 15.00.21022.08
|
||||
REQUIRED_LINK_VER = 9.00.21022.08
|
||||
COMPILER_NAME=Visual Studio 9
|
||||
COMPILER_VERSION=VS2008
|
||||
#rebase and midl moved out of Visual Studio into the SDK:
|
||||
@ -99,14 +89,6 @@ ifeq ($(PLATFORM), windows)
|
||||
CC_MAJORVER :=$(call MajorVersion,$(CC_VER))
|
||||
CC_MINORVER :=$(call MinorVersion,$(CC_VER))
|
||||
CC_MICROVER :=$(call MicroVersion,$(CC_VER))
|
||||
ifeq ($(ARCH), ia64)
|
||||
REQUIRED_CC_VER = 13.00.9337.7
|
||||
REQUIRED_LINK_VER = 7.00.9337.7
|
||||
endif
|
||||
ifeq ($(ARCH), amd64)
|
||||
REQUIRED_CC_VER = 14.00.40310.41
|
||||
REQUIRED_LINK_VER = 8.00.40310.39
|
||||
endif
|
||||
ifeq ($(CC_MAJORVER), 13)
|
||||
ifeq ($(ARCH), ia64)
|
||||
# This should be: CC_VER=13.00.9337.7 LINK_VER=7.00.9337.7
|
||||
|
@ -32,27 +32,19 @@ COMPILER_NAME=Sun Studio
|
||||
# Sun Studio Compiler settings specific to Solaris
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
COMPILER_VERSION=SS12
|
||||
REQUIRED_CC_VER=5.9
|
||||
CC = $(COMPILER_PATH)cc
|
||||
CPP = $(COMPILER_PATH)cc -E
|
||||
CXX = $(COMPILER_PATH)CC
|
||||
LINT = $(COMPILER_PATH)lint
|
||||
# Option used to create a shared library
|
||||
SHARED_LIBRARY_FLAG = -G
|
||||
# But gcc is still needed no matter what on 32bit
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
REQUIRED_GCC_VER = 2.95
|
||||
GCC =$(GCC_COMPILER_PATH)gcc
|
||||
_GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
|
||||
GCC_VER :=$(call GetVersion,"$(_GCC_VER)")
|
||||
endif
|
||||
GCC =$(GCC_COMPILER_PATH)gcc
|
||||
endif
|
||||
|
||||
# Sun Studio Compiler settings specific to Linux
|
||||
ifeq ($(PLATFORM), linux)
|
||||
# This has not been tested
|
||||
COMPILER_VERSION=SS12
|
||||
REQUIRED_CC_VER=5.9
|
||||
CC = $(COMPILER_PATH)cc
|
||||
CPP = $(COMPILER_PATH)cc -E
|
||||
CXX = $(COMPILER_PATH)CC
|
||||
@ -73,7 +65,7 @@ endif
|
||||
# Get compiler version
|
||||
_CC_VER :=$(shell $(CC) -V 2>&1 | $(HEAD) -n 1)
|
||||
CC_VER :=$(call GetVersion,"$(_CC_VER)")
|
||||
|
||||
|
||||
# Arch specific settings (determines type of .o files and instruction set)
|
||||
# Starting in SS12 (5.9), the arch options changed.
|
||||
# The assembler /usr/ccs/bin/as wants older SS11 (5.8) style options.
|
||||
|
183
jdk/make/common/shared/Defs-versions.gmk
Normal file
183
jdk/make/common/shared/Defs-versions.gmk
Normal file
@ -0,0 +1,183 @@
|
||||
#
|
||||
# Copyright 2009 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.
|
||||
#
|
||||
|
||||
#
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
#
|
||||
|
||||
# This file needs these set: CC_VERSION, PLATFORM, ARCH_FAMILY, and ARCH_DATA_MODEL.
|
||||
|
||||
##########################################################################
|
||||
#
|
||||
# List of JDK official minimum, expected, or required versions:
|
||||
#
|
||||
# REQUIRED_ALSA_VERSION
|
||||
# Linux only: The ALSA sound library version expected.
|
||||
#
|
||||
# REQUIRED_ANT_VER
|
||||
# The minimum 'ant' version.
|
||||
#
|
||||
# REQUIRED_BOOT_VER
|
||||
# The minimum boot jdk version.
|
||||
#
|
||||
# REQUIRED_CC_VER
|
||||
# The primary C compiler version expected.
|
||||
#
|
||||
# REQUIRED_CYGWIN_VER
|
||||
# Windows only: If CYGWIN is used, the minimum CYGWIN version.
|
||||
#
|
||||
# REQUIRED_DXSDK_VER
|
||||
# Windows only: The version of DirectX SDK expected.
|
||||
#
|
||||
# REQUIRED_FREE_SPACE
|
||||
# The minimum disk space needed as determined by running 'du -sk' on a fully
|
||||
# built workspace.
|
||||
#
|
||||
# REQUIRED_FREETYPE_VERSION
|
||||
# If we are using freetype, the freetype version expected.
|
||||
#
|
||||
# REQUIRED_GCC_VER
|
||||
# Solaris and Linux only. The required version of gcc/g++ for the plugin.
|
||||
#
|
||||
# REQUIRED_LINK_VER
|
||||
# Windows only: The version of link.exe expected.
|
||||
#
|
||||
# REQUIRED_MAKE_VER
|
||||
# The minimum version of GNU make.
|
||||
#
|
||||
# REQUIRED_MKS_VER
|
||||
# Windows only: If MKS used instead of CYGWIN, the minimum version of MKS.
|
||||
#
|
||||
# REQUIRED_OS_VARIANT_NAME
|
||||
# The OS variation name required.
|
||||
# Solaris: Solaris or OpenSolaris
|
||||
# Windows: Windows2000, WindowsXP, Windows2003, etc.
|
||||
# Linux: Fedora, RedHat, SuSE, Ubuntu, etc.
|
||||
#
|
||||
# REQUIRED_OS_VARIANT_VERSION
|
||||
# The version number associated with the above OS variant name.
|
||||
# Solaris: output of uname -r
|
||||
# Windows: 5.0 for Windows2000, 5.1 for WindowsXP, 5.2 for Windows2003, etc.
|
||||
# Linux: number for the variant, e.g. 9 for Fedora 9
|
||||
#
|
||||
# REQUIRED_OS_VERSION
|
||||
# The formal OS version number.
|
||||
# Solaris & Windows: same as REQUIRED_OS_VARIANT_VERSION
|
||||
# Linux: the kernel version, or output of uname -r
|
||||
#
|
||||
# REQUIRED_UNZIP_VER
|
||||
# The minimum version of unzip.
|
||||
#
|
||||
# REQUIRED_ZIP_VER
|
||||
# The minimum version of unzip.
|
||||
#
|
||||
###########
|
||||
#
|
||||
# Differences in the build platform from these versions may trigger warnings
|
||||
# messages during the sanity checking when building the JDK.
|
||||
#
|
||||
# When building the OpenJDK most of these required or expected versions are
|
||||
# ignored or allowed to vary widely to accomodate the many build situations
|
||||
# of the OpenJDK.
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
# Solaris specific
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
REQUIRED_OS_VERSION = 5.10
|
||||
REQUIRED_OS_VARIANT_NAME = Solaris
|
||||
REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION)
|
||||
ifeq ($(ARCH_FAMILY), sparc)
|
||||
REQUIRED_FREE_SPACE = 1300000
|
||||
else
|
||||
REQUIRED_FREE_SPACE = 1040000
|
||||
endif
|
||||
ifeq ($(CC_VERSION),sun)
|
||||
REQUIRED_CC_VER = 5.9
|
||||
endif
|
||||
ifeq ($(CC_VERSION),gcc)
|
||||
REQUIRED_CC_VER = 3.4.3
|
||||
endif
|
||||
REQUIRED_GCC_VER = 2.95.2
|
||||
endif
|
||||
|
||||
# Linux specific
|
||||
ifeq ($(PLATFORM), linux)
|
||||
REQUIRED_OS_VERSION = 2.6
|
||||
REQUIRED_OS_VARIANT_NAME = Fedora
|
||||
REQUIRED_OS_VARIANT_VERSION = 9
|
||||
REQUIRED_FREE_SPACE = 1460000
|
||||
REQUIRED_ALSA_VERSION = 0.9.1
|
||||
REQUIRED_GCC_VER = 2.95
|
||||
ifeq ($(CC_VERSION),gcc)
|
||||
REQUIRED_CC_VER = 4.3.0
|
||||
endif
|
||||
ifeq ($(CC_VERSION),sun)
|
||||
REQUIRED_CC_VER = 5.9
|
||||
endif
|
||||
endif
|
||||
|
||||
# Windows specific
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(ARCH_DATA_MODEL),64)
|
||||
REQUIRED_OS_VERSION = 5.2
|
||||
REQUIRED_OS_VARIANT_NAME = Windows2003
|
||||
else
|
||||
REQUIRED_OS_VERSION = 5.1
|
||||
REQUIRED_OS_VARIANT_NAME = WindowsXP
|
||||
endif
|
||||
REQUIRED_OS_VARIANT_VERSION = $(REQUIRED_OS_VERSION)
|
||||
REQUIRED_CYGWIN_VER = 4.0
|
||||
REQUIRED_MKS_VER = 6.1
|
||||
REQUIRED_FREE_SPACE = 500000
|
||||
REQUIRED_DXSDK_VER = 0x0900
|
||||
ifeq ($(CC_VERSION),msvc)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
REQUIRED_CC_VER = 15.00.21022.08
|
||||
REQUIRED_LINK_VER = 9.00.21022.08
|
||||
else
|
||||
ifeq ($(ARCH), ia64)
|
||||
REQUIRED_CC_VER = 13.00.9337.7
|
||||
REQUIRED_LINK_VER = 7.00.9337.7
|
||||
endif
|
||||
ifeq ($(ARCH), amd64)
|
||||
REQUIRED_CC_VER = 14.00.40310.41
|
||||
REQUIRED_LINK_VER = 8.00.40310.39
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CC_VERSION),gcc)
|
||||
REQUIRED_CC_VER = 3.4.3
|
||||
endif
|
||||
endif
|
||||
|
||||
# Generic
|
||||
REQUIRED_ANT_VER = 1.6.3
|
||||
REQUIRED_BOOT_VER = 1.5
|
||||
REQUIRED_FREETYPE_VERSION = 2.3.0
|
||||
REQUIRED_MAKE_VER = 3.78
|
||||
REQUIRED_UNZIP_VER = 5.12
|
||||
REQUIRED_ZIP_VER = 2.2
|
||||
|
@ -136,10 +136,7 @@ endif
|
||||
UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
|
||||
|
||||
# Get version of MKS or CYGWIN
|
||||
ifdef USING_CYGWIN
|
||||
_CYGWIN_VER :=$(shell $(UNAME))
|
||||
CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
|
||||
else # MKS
|
||||
ifndef USING_CYGWIN
|
||||
_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
|
||||
MKS_VER :=$(call GetVersion,$(_MKS_VER))
|
||||
# At this point, we can re-define FullPath to use DOSNAME_CMD
|
||||
|
@ -116,9 +116,9 @@ $(shell \
|
||||
fi)
|
||||
endef
|
||||
|
||||
# Given a line of text, get the major.minor version number from it
|
||||
# Given a line of text, get the version number from it
|
||||
define GetVersion
|
||||
$(shell echo $1 | sed -e 's@[^1-9]*\([1-9][0-9]*\.[0-9][0-9]*\).*@\1@' )
|
||||
$(shell echo $1 | sed -e 's@[^0-9]*\([0-9][0-9]*\.[0-9][.0-9]*\).*@\1@' )
|
||||
endef
|
||||
|
||||
# Given a major.minor.micro version, return the major, minor, or micro number
|
||||
@ -133,26 +133,26 @@ $(if $(word 3, $(subst ., ,$1)),$(word 3, $(subst ., ,$1)),0)
|
||||
endef
|
||||
|
||||
# Macro that returns missing, same, newer, or older $1=version $2=required
|
||||
# (currently does not check the micro number)
|
||||
define CheckVersions
|
||||
$(shell \
|
||||
if [ "$1" = "" -o "$2" = "" ]; then \
|
||||
echo missing; \
|
||||
elif [ "$1" = "$2" ]; then \
|
||||
echo same; \
|
||||
elif [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
|
||||
echo older; \
|
||||
elif [ $(call MajorVersion,$1) -gt $(call MajorVersion,$2) ] ; then \
|
||||
echo newer; \
|
||||
elif [ $(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
|
||||
echo older; \
|
||||
elif [ $(call MinorVersion,$1) -gt $(call MinorVersion,$2) ]; then \
|
||||
echo newer; \
|
||||
elif [ $(call MicroVersion,$1) -lt $(call MicroVersion,$2) ]; then \
|
||||
echo older; \
|
||||
elif [ $(call MicroVersion,$1) -gt $(call MicroVersion,$2) ]; then \
|
||||
echo newer; \
|
||||
else \
|
||||
if [ "$1" = "$2" ]; then \
|
||||
echo same; \
|
||||
else \
|
||||
if [ $(call MajorVersion,$1) -lt $(call MajorVersion,$2) ] ; then \
|
||||
echo older; \
|
||||
else \
|
||||
if [ $(call MajorVersion,$1) -eq $(call MajorVersion,$2) -a \
|
||||
$(call MinorVersion,$1) -lt $(call MinorVersion,$2) ]; then \
|
||||
echo older; \
|
||||
else \
|
||||
echo newer; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi; \
|
||||
echo same; \
|
||||
fi)
|
||||
endef
|
||||
|
||||
@ -561,3 +561,6 @@ endif
|
||||
# Get shared compiler settings
|
||||
include $(JDK_MAKE_SHARED_DIR)/Compiler.gmk
|
||||
|
||||
# Get the REQUIRED versions
|
||||
include $(JDK_MAKE_SHARED_DIR)/Defs-versions.gmk
|
||||
|
||||
|
@ -51,9 +51,6 @@ PLATFORM_SHARED=done
|
||||
# USER login name of user (minus blanks)
|
||||
# PLATFORM windows, solaris, or linux
|
||||
# VARIANT OPT or DBG, OPT is the default
|
||||
# OS_NAME solaris, linux, or nt
|
||||
# OS_VERSION specific version of os, 5.10, 2.4.9-e.3, etc.
|
||||
# OS_VENDOR company name
|
||||
# TEMP_DISK /tmp or C:/temp
|
||||
# ARCH_DATA_MODEL 32 or 64
|
||||
# ARCH sparc, sparcv9, i586, amd64, or ia64
|
||||
@ -72,29 +69,11 @@ PLATFORM_SHARED=done
|
||||
# ISA_DIR solaris only: /sparcv9 or /amd64
|
||||
# LIBARCH32 solaris only: sparc or i386
|
||||
# LIBARCH64 solaris only: sparcv9 or amd64
|
||||
# REQUIRED_WINDOWS_VERSION windows only: specific version of windows
|
||||
# USING_CYGWIN windows only: true or false
|
||||
# WINDOWS_NT_VERSION_STRING windows only: long version name
|
||||
# REQUIRED_OS_VERSION required OS version, e.g. 5.10, 2.4
|
||||
# REQUIRED_FREE_SPACE minimum disk space needed for outputdir
|
||||
# ISHIELD_TEMP_MIN windows only: minimum disk space in temp area
|
||||
# REQUIRED_ZIP_VER required version of zip
|
||||
# REQUIRED_UNZIP_VER required version of unzip
|
||||
# REQUIRED_DXSDK_VER windows only: required version of DirectX
|
||||
# LINUX_VERSION_INFO linux only: location of linux release file
|
||||
# REQUIRED_LINUX_VER linux only: required version of linux
|
||||
# REQUIRED_LINUX_FULLVER linux only: required full version of linux
|
||||
# REQUIRED_ALSA_VERSION linux only: required version of ALSA
|
||||
# REQUIRED_FREETYPE_VERSION openjdk only: required version of freetype
|
||||
|
||||
SYSTEM_UNAME := $(shell uname)
|
||||
|
||||
# Normal boot jdk is previous release, but a hard requirement is a 1.5 boot
|
||||
REQUIRED_BOOT_VER = 1.5
|
||||
|
||||
# If we are using freetype, this is the required version
|
||||
REQUIRED_FREETYPE_VERSION=2.3.0
|
||||
|
||||
#
|
||||
# Prune out all known SCM (Source Code Management) directories
|
||||
# so they will not be included when copying directory trees
|
||||
@ -113,8 +92,6 @@ endif
|
||||
# Platform settings specific to Solaris
|
||||
ifeq ($(SYSTEM_UNAME), SunOS)
|
||||
PLATFORM = solaris
|
||||
OS_NAME = solaris
|
||||
OS_VERSION := $(shell uname -r)
|
||||
# Solaris sparc build can be either 32-bit or 64-bit.
|
||||
# Default to 32, but allow explicit setting to 32 or 64.
|
||||
ifndef ARCH_DATA_MODEL
|
||||
@ -166,16 +143,6 @@ ifeq ($(SYSTEM_UNAME), SunOS)
|
||||
endif
|
||||
# Suffix for file bundles used in previous release
|
||||
BUNDLE_FILE_SUFFIX=.tar
|
||||
OS_VENDOR = Sun Microsystems
|
||||
# Required Solaris version
|
||||
REQUIRED_OS_VERSION = 5.10
|
||||
# Minimum disk space needed as determined by running 'du -sk' on
|
||||
# a fully built workspace.
|
||||
ifeq ($(ARCH_FAMILY), sparc)
|
||||
REQUIRED_FREE_SPACE=1300000
|
||||
else
|
||||
REQUIRED_FREE_SPACE=1040000
|
||||
endif
|
||||
# How much RAM does this machine have:
|
||||
MB_OF_MEMORY=$(shell /etc/prtconf | fgrep 'Memory size:' | expand | cut -d' ' -f3)
|
||||
endif
|
||||
@ -183,8 +150,6 @@ endif
|
||||
# Platform settings specific to Linux
|
||||
ifeq ($(SYSTEM_UNAME), Linux)
|
||||
PLATFORM = linux
|
||||
OS_NAME = linux
|
||||
OS_VERSION := $(shell uname -r)
|
||||
# Arch and OS name/version
|
||||
mach := $(shell uname -m)
|
||||
archExpr = case "$(mach)" in \
|
||||
@ -242,32 +207,6 @@ ifeq ($(SYSTEM_UNAME), Linux)
|
||||
|
||||
# Suffix for file bundles used in previous release
|
||||
BUNDLE_FILE_SUFFIX=.tar.gz
|
||||
# Minimum disk space needed as determined by running 'du -sk' on
|
||||
# a fully built workspace.
|
||||
REQUIRED_FREE_SPACE=1460000
|
||||
LINUX_VERSION_INFO = /etc/redhat-release
|
||||
OS_VENDOR = Red Hat
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
REQUIRED_LINUX_VER = Advanced Server
|
||||
REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS
|
||||
REQUIRED_OS_VERSION = 2.4.9-e.3
|
||||
else
|
||||
ifeq ($(ARCH), amd64)
|
||||
LINUX_VERSION_INFO = /etc/SuSE-release
|
||||
OS_VENDOR = SuSE Enterprise
|
||||
REQUIRED_LINUX_VER = 8.1
|
||||
REQUIRED_LINUX_FULLVER = $(REQUIRED_LINUX_VER) SLSE AMD64
|
||||
REQUIRED_OS_VERSION = 2.4.19-SMP
|
||||
else
|
||||
REQUIRED_LINUX_VER = Advanced Server
|
||||
REQUIRED_LINUX_FULLVER = Advanced Server release 2.1AS 64 bit
|
||||
REQUIRED_OS_VERSION = 2.4.19-SMP
|
||||
endif
|
||||
endif
|
||||
ifneq ($(ARCH), ia64)
|
||||
# ALSA 0.9.1 and above
|
||||
REQUIRED_ALSA_VERSION = ^((0[.]9[.][1-9])|(1[.]0[.][0-9]))[0-9]*
|
||||
endif
|
||||
# How much RAM does this machine have:
|
||||
MB_OF_MEMORY := $(shell free -m | fgrep Mem: | awk '{print $$2;}' )
|
||||
endif
|
||||
@ -275,23 +214,15 @@ endif
|
||||
# Windows with and without CYGWIN will be slightly different
|
||||
ifeq ($(SYSTEM_UNAME), Windows_NT)
|
||||
PLATFORM = windows
|
||||
OS_VERSION := $(shell uname -r)
|
||||
WINDOWS_NT_VERSION_STRING=Windows_NT
|
||||
REQUIRED_MKS_VER=6.1
|
||||
endif
|
||||
ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
|
||||
PLATFORM = windows
|
||||
OS_VERSION := 5
|
||||
USING_CYGWIN = true
|
||||
export USING_CYGWIN
|
||||
WINDOWS_NT_VERSION_STRING=CYGWIN_NT
|
||||
REQUIRED_CYGWIN_VER=4.0
|
||||
endif
|
||||
|
||||
# Platform settings specific to Windows
|
||||
ifeq ($(PLATFORM), windows)
|
||||
OS_NAME = nt
|
||||
REQUIRED_OS_VERSION=5
|
||||
# Windows builds default to the appropriate for the underlaying
|
||||
# architecture.
|
||||
# Temporary disk area
|
||||
@ -314,7 +245,6 @@ ifeq ($(PLATFORM), windows)
|
||||
# If the user wants to perform a cross compile build then they must
|
||||
# - set ARCH_DATA_MODEL=64 and either
|
||||
# + set ARCH to ia64 or amd64, or
|
||||
REQUIRED_WINDOWS_VERSION=Server 2003 Enterprise x64 Edition
|
||||
ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)), AMD64)
|
||||
ARCH=amd64
|
||||
else
|
||||
@ -324,8 +254,6 @@ ifeq ($(PLATFORM), windows)
|
||||
# Value of Java os.arch property
|
||||
ARCHPROP=$(LIBARCH)
|
||||
else
|
||||
REQUIRED_WINDOWS_VERSION=2000 or Unknown
|
||||
#REQUIRED_WINDOWS_VERSION=XP Professional
|
||||
# LIBARCH is used to preserve the jre/lib/i386 directory name for 32-bit intel
|
||||
ARCH=i586
|
||||
LIBARCH=i386
|
||||
@ -364,14 +292,9 @@ ifeq ($(PLATFORM), windows)
|
||||
ARCH_VM_SUBDIR=jre/bin
|
||||
# Suffix for file bundles used in previous release
|
||||
BUNDLE_FILE_SUFFIX=.tar
|
||||
# Minimum disk space needed as determined by running 'du -sk' on
|
||||
# a fully built workspace.
|
||||
REQUIRED_FREE_SPACE=500000
|
||||
# ISHIELD_TEMP_MIN is the difference of an empty C:\TEMP vs. one after a
|
||||
# bundles build on windows.
|
||||
ISHIELD_TEMP_MIN=250000
|
||||
REQUIRED_DXSDK_VER = 0x0900
|
||||
OS_VENDOR = Microsoft
|
||||
# How much RAM does this machine have:
|
||||
ifeq ($(JDK_HAS_MEM_INFO),)
|
||||
ifeq ($(USING_CYGWIN),true)
|
||||
@ -410,10 +333,6 @@ ifeq ($(PLATFORM), windows)
|
||||
endif
|
||||
endif
|
||||
|
||||
REQUIRED_ZIP_VER = 2.2
|
||||
REQUIRED_UNZIP_VER = 5.12
|
||||
REQUIRED_MAKE_VER = 3.78
|
||||
|
||||
# Unix type settings (same for all unix platforms)
|
||||
ifneq ($(PLATFORM), windows)
|
||||
# Temporary disk area
|
||||
|
@ -167,8 +167,6 @@ ALL_SETTINGS+=$(call addRequiredSetting,ARCHPROP)
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,PROCESSOR_ARCHITECTURE)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,PROCESSOR_IDENTIFIER)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,WINDOWS_VERSION)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,WINDOWS_NT_VERSION_STRING)
|
||||
ifdef USING_CYGWIN
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,USING_CYGWIN)
|
||||
ALL_SETTINGS+=$(call addRequiredVersionSetting,CYGWIN_VER)
|
||||
@ -179,13 +177,11 @@ ifeq ($(PLATFORM),windows)
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),linux)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,LINUX_VERSION)
|
||||
ifneq ($(ARCH), ia64)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
|
||||
endif
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,ALSA_VERSION)
|
||||
endif
|
||||
ALL_SETTINGS+=$(call addRequiredVersionSetting,OS_VERSION)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,OS_NAME)
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_NAME)
|
||||
ALL_SETTINGS+=$(call addOptionalSetting,OS_VARIANT_VERSION)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,TEMP_FREE_SPACE)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,FREE_SPACE)
|
||||
ALL_SETTINGS+=$(call addRequiredSetting,MB_OF_MEMORY)
|
||||
|
@ -38,60 +38,106 @@
|
||||
SANITY_FILES = $(ERROR_FILE) $(WARNING_FILE) $(MESSAGE_FILE)
|
||||
|
||||
# How to say "The Release Engineering people use this"
|
||||
THE_OFFICIAL_USES=The official $(PLATFORM) builds use
|
||||
THE_OFFICIAL_USES=The official builds on $(PLATFORM) use
|
||||
|
||||
# How to say "You are using:"
|
||||
YOU_ARE_USING=You appear to be using
|
||||
|
||||
# Error message
|
||||
define SanityError
|
||||
$(ECHO) "ERROR: $1\n" >> $(ERROR_FILE)
|
||||
endef
|
||||
|
||||
# Warning message
|
||||
define SanityWarning
|
||||
$(ECHO) "WARNING: $1\n" >> $(WARNING_FILE)
|
||||
endef
|
||||
|
||||
# Official version error message: name version required_version
|
||||
define OfficialErrorMessage
|
||||
$(call SanityError,\
|
||||
$(THE_OFFICIAL_USES) $1 $3. Your $1 $(if $2,undefined,$2) will not work.)
|
||||
endef
|
||||
|
||||
# Official version warning message: name version required_version
|
||||
define OfficialWarningMessage
|
||||
$(call SanityWarning,\
|
||||
$(THE_OFFICIAL_USES) $1 $3. $(YOU_ARE_USING) $1 $2.)
|
||||
endef
|
||||
|
||||
|
||||
# Settings and rules to validate the JDK build environment.
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
FREE_SPACE := $(shell $(DF) -b $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
|
||||
TEMP_FREE_SPACE := $(shell $(DF) -b $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$2;}')
|
||||
# What kind of system we are using (Variations are Solaris and OpenSolaris)
|
||||
OS_VERSION := $(shell uname -r)
|
||||
OS_VARIANT_NAME := $(strip $(shell head -1 /etc/release | awk '{print $$1;}') )
|
||||
OS_VARIANT_VERSION := $(OS_VERSION)
|
||||
REQ_PATCH_LIST = $(JDK_TOPDIR)/make/PatchList.solaris
|
||||
ifeq ($(ARCH_FAMILY), sparc)
|
||||
PATCH_POSITION = $$4
|
||||
else
|
||||
PATCH_POSITION = $$6
|
||||
endif
|
||||
ifndef OPENJDK
|
||||
_GCC_VER :=$(shell $(GCC) -dumpversion 2>&1 )
|
||||
GCC_VER :=$(call GetVersion,"$(_GCC_VER)")
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
FREE_SPACE := $(shell $(DF) --sync -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
|
||||
TEMP_FREE_SPACE := $(shell $(DF) --sync -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
|
||||
ifeq ($(ARCH), amd64)
|
||||
LINUX_VERSION := $(shell \
|
||||
if [ -r "$(LINUX_VERSION_INFO)" ] ; then \
|
||||
$(CAT) $(LINUX_VERSION_INFO) | $(TAIL) -1 | $(NAWK) '{ print $$3; }';\
|
||||
else \
|
||||
$(ECHO) "Unknown linux"; \
|
||||
fi )
|
||||
else
|
||||
LINUX_VERSION := $(shell \
|
||||
if [ -r "$(LINUX_VERSION_INFO)" ] ; then \
|
||||
$(NAWK) '{ print $$4" "$$5; }' $(LINUX_VERSION_INFO) ; \
|
||||
else \
|
||||
$(ECHO) "Unknown linux"; \
|
||||
fi )
|
||||
endif
|
||||
ifneq ($(ARCH), ia64)
|
||||
# dummy program that outputs ALSA's version (created in target sane-alsa-versioncheck)
|
||||
ALSA_VERSION_CHECK = $(TEMPDIR)/alsaversioncheck
|
||||
ALSA_VERSION = `if [ -f "$(ALSA_VERSION_CHECK)" ] ; then $(ALSA_VERSION_CHECK) ; fi`
|
||||
endif
|
||||
# What kind of system we are using (Variation is the Linux vendor)
|
||||
OS_VERSION := $(shell uname -r)
|
||||
OS_VARIANT_NAME := $(shell \
|
||||
if [ -f /etc/fedora-release ] ; then \
|
||||
echo "Fedora"; \
|
||||
elif [ -f /etc/redhat-release ] ; then \
|
||||
echo "RedHat"; \
|
||||
elif [ -f /etc/SuSE-release ] ; then \
|
||||
echo "SuSE"; \
|
||||
else \
|
||||
echo "Unknown"; \
|
||||
fi)
|
||||
OS_VARIANT_VERSION := $(shell \
|
||||
if [ "$(OS_VARIANT_NAME)" = "Fedora" ] ; then \
|
||||
$(CAT) /etc/fedora-release | $(HEAD) -1 | $(NAWK) '{ print $$3; }' ; \
|
||||
fi)
|
||||
ALSA_INCLUDE=/usr/include/alsa/version.h
|
||||
ALSA_LIBRARY=/usr/lib/libasound.so
|
||||
_ALSA_VERSION := $(shell $(EGREP) SND_LIB_VERSION_STR $(ALSA_INCLUDE) | \
|
||||
$(SED) -e 's@.*\"\(.*\)\".*@\1@' )
|
||||
ALSA_VERSION := $(call GetVersion,$(_ALSA_VERSION))
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
FREE_SPACE := $(shell $(DF) -kP $(OUTPUTDIR) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
|
||||
TEMP_FREE_SPACE := $(shell $(DF) -kP $(TEMP_DISK) | $(TAIL) -1 | $(NAWK) '{print $$4;}')
|
||||
# Localized systeminfo has localized labels, but not localized values.
|
||||
_WINDOWS_VERSION := \
|
||||
$(shell systeminfo 2> $(DEV_NULL) | grep 'Microsoft' | grep 'Windows' | \
|
||||
cut -d':' -f2)
|
||||
ifeq ($(_WINDOWS_VERSION),)
|
||||
_WINDOWS_VERSION := Windows 2000 or Unknown (no systeminfo utility)
|
||||
# Windows 2000 is 5.0, Windows XP is 5.1, Windows 2003 is 5.2
|
||||
# Assume 5.0 (Windows 2000) if systeminfo does not help
|
||||
WINDOWS_MAPPING-5.0 := Windows2000
|
||||
WINDOWS_MAPPING-5.1 := WindowsXP
|
||||
WINDOWS_MAPPING-5.2 := Windows2003
|
||||
# What kind of system we are using (Variation is the common name)
|
||||
_OS_VERSION := \
|
||||
$(shell systeminfo 2> $(DEV_NULL) | \
|
||||
egrep '^OS Version:' | \
|
||||
awk '{print $$3;}' )
|
||||
ifeq ($(_OS_VERSION),)
|
||||
OS_VERSION = 5.0
|
||||
else
|
||||
OS_VERSION = $(_OS_VERSION)
|
||||
endif
|
||||
OS_VARIANT_NAME := $(WINDOWS_MAPPING-$(OS_VERSION))
|
||||
OS_VARIANT_VERSION := $(OS_VERSION)
|
||||
ifdef USING_CYGWIN
|
||||
# CYGWIN version
|
||||
_CYGWIN_VER := $(SYSTEM_UNAME)
|
||||
CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
|
||||
endif
|
||||
WINDOWS_VERSION := $(strip $(_WINDOWS_VERSION))
|
||||
DXSDK_VER := $(shell $(EGREP) DIRECT3D_VERSION $(DXSDK_INCLUDE_PATH)/d3d9.h 2>&1 | \
|
||||
$(EGREP) "\#define" | $(NAWK) '{print $$3}')
|
||||
endif
|
||||
@ -106,7 +152,6 @@ ZIP_VER :=$(call GetVersion,"$(_ZIP_VER)")
|
||||
UNZIP_VER :=$(call GetVersion,"$(_UNZIP_VER)")
|
||||
BOOT_VER :=$(call GetVersion,"$(_BOOT_VER)")
|
||||
|
||||
REQUIRED_ANT_VER := 1.6.3
|
||||
_ANT_VER:=$(shell $(ANT) -version 2>&1 )
|
||||
ANT_VER:=$(call GetVersion,"$(_ANT_VER)")
|
||||
|
||||
@ -167,7 +212,6 @@ include $(JDK_MAKE_SHARED_DIR)/Sanity-Settings.gmk
|
||||
sane-compiler \
|
||||
sane-link \
|
||||
sane-cacerts \
|
||||
sane-alsa-versioncheck \
|
||||
sane-alsa-headers \
|
||||
sane-ant_version \
|
||||
sane-zip_version \
|
||||
@ -239,35 +283,29 @@ sane-arch_data_model:
|
||||
# generate a fatal sanity error, and a warning about the official
|
||||
# build platform just becomes clutter.
|
||||
######################################################
|
||||
OS_CHECK :=$(call CheckVersions,$(OS_VERSION),$(REQUIRED_OS_VERSION))
|
||||
ifndef OPENJDK
|
||||
OS_VERSION_CHECK := \
|
||||
$(call CheckVersions,$(OS_VERSION),$(REQUIRED_OS_VERSION))
|
||||
ifeq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
|
||||
OS_VARIANT_VERSION_CHECK := \
|
||||
$(call CheckVersions,$(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION))
|
||||
endif
|
||||
endif
|
||||
sane-os_version:: sane-arch_data_model sane-memory_check sane-locale sane-os_patch_level
|
||||
ifndef OPENJDK
|
||||
@if [ "$(OS_CHECK)" = "missing" ]; then \
|
||||
$(ECHO) "ERROR: The $(PLATFORM) OS version is undefined (Try: uname -r). \n" \
|
||||
"" >> $(ERROR_FILE) ; \
|
||||
fi
|
||||
@if [ "$(OS_CHECK)" != "same" ]; then \
|
||||
$(ECHO) "WARNING: $(THE_OFFICIAL_USES) OS version $(REQUIRED_OS_VERSION). \n" \
|
||||
" $(YOU_ARE_USING) OS version $(OS_VERSION). \n" \
|
||||
"" >> $(WARNING_FILE) ; \
|
||||
fi
|
||||
ifeq ($(PLATFORM), windows)
|
||||
@if [ "$(findstring $(REQUIRED_WINDOWS_VERSION),$(WINDOWS_VERSION))" = "" ]; then \
|
||||
$(ECHO) "WARNING: $(YOU_ARE_USING) an unknown version of Windows. \n" \
|
||||
" The required version is $(REQUIRED_WINDOWS_VERSION). \n" \
|
||||
" $(YOU_ARE_USING) $(WINDOWS_VERSION) \n" \
|
||||
"" >> $(WARNING_FILE) ; \
|
||||
fi
|
||||
endif # windows
|
||||
ifeq ($(PLATFORM), linux)
|
||||
@if [ `$(ECHO) "$(LINUX_VERSION)" | $(EGREP) -c '$(REQUIRED_LINUX_VER)'` -ne 1 ]; then \
|
||||
$(ECHO) "WARNING: The build is being done on Linux $(LINUX_VERSION). \n" \
|
||||
" $(THE_OFFICIAL_USES) Linux $(REQUIRED_LINUX_VER), \n" \
|
||||
" specifically Linux $(REQUIRED_LINUX_FULLVER). \n" \
|
||||
" The version found was '$(OS_VERSION)'. \n" \
|
||||
"" >> $(WARNING_FILE) ; \
|
||||
fi
|
||||
endif # linux
|
||||
ifneq ($(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
|
||||
ifeq ($(OS_VERSION_CHECK),missing)
|
||||
@$(call OfficialErrorMessage,OS version,$(OS_VERSION),$(REQUIRED_OS_VERSION))
|
||||
endif
|
||||
ifneq ($(OS_VERSION_CHECK),same)
|
||||
@$(call OfficialWarningMessage,OS version,$(OS_VERSION),$(REQUIRED_OS_VERSION))
|
||||
endif
|
||||
@$(call OfficialWarningMessage,OS variant,$(OS_VARIANT_NAME),$(REQUIRED_OS_VARIANT_NAME))
|
||||
else
|
||||
ifneq ($(OS_VARIANT_VERSION_CHECK),same)
|
||||
@$(call OfficialWarningMessage,$(OS_VARIANT_NAME) version,$(OS_VARIANT_VERSION),$(REQUIRED_OS_VARIANT_VERSION))
|
||||
endif
|
||||
endif
|
||||
endif # OPENJDK
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
@ -308,16 +346,12 @@ ifeq ($(PLATFORM), windows)
|
||||
CYGWIN_CHECK :=$(call CheckVersions,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
|
||||
sane-cygwin:
|
||||
ifdef USING_CYGWIN
|
||||
@if [ "$(CYGWIN_CHECK)" = "missing" ]; then \
|
||||
$(ECHO) "ERROR: The CYGWIN version is undefined. \n" \
|
||||
" $(THE_OFFICIAL_USES) CYGWIN $(REQUIRED_CYGWIN_VER). \n" \
|
||||
"" >> $(ERROR_FILE) ; \
|
||||
fi
|
||||
@if [ "$(CYGWIN_CHECK)" = "older" ]; then \
|
||||
$(ECHO) "ERROR: The build cannot be done on CYGWIN $(CYGWIN_VER). \n" \
|
||||
" Use CYGWIN $(REQUIRED_CYGWIN_VER) or higher. \n" \
|
||||
"" >> $(ERROR_FILE) ; \
|
||||
fi
|
||||
ifeq ($(CYGWIN_CHECK),missing)
|
||||
@$(call OfficialErrorMessage,CYGWIN version,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
|
||||
endif
|
||||
ifeq ($(CYGWIN_CHECK),older)
|
||||
@$(call OfficialWarningMessage,CYGWIN version,$(CYGWIN_VER),$(REQUIRED_CYGWIN_VER))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -345,16 +379,12 @@ ifeq ($(PLATFORM), windows)
|
||||
MKS_CHECK :=$(call CheckVersions,$(MKS_VER),$(REQUIRED_MKS_VER))
|
||||
sane-mks:
|
||||
ifndef USING_CYGWIN
|
||||
@if [ "$(MKS_CHECK)" = "missing" ]; then \
|
||||
$(ECHO) "ERROR: The MKS version is undefined. \n" \
|
||||
" $(THE_OFFICIAL_USES) MKS $(REQUIRED_MKS_VER). \n" \
|
||||
"" >> $(ERROR_FILE) ; \
|
||||
fi
|
||||
@if [ "$(MKS_CHECK)" = "older" ]; then \
|
||||
$(ECHO) "ERROR: The build cannot be done on MKS $(MKS_VER). \n" \
|
||||
" Use MKS $(REQUIRED_MKS_VER) or higher. \n" \
|
||||
"" >> $(ERROR_FILE) ; \
|
||||
fi
|
||||
ifeq ($(MKS_CHECK),missing)
|
||||
@$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER))
|
||||
endif
|
||||
ifeq ($(MKS_CHECK),older)
|
||||
@$(call OfficialErrorMessage,MKS version,$(MKS_VER),$(REQUIRED_MKS_VER))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -1295,11 +1325,6 @@ endif
|
||||
# Check the compiler version(s)
|
||||
######################################################
|
||||
CC_CHECK :=$(call CheckVersions,$(CC_VER),$(REQUIRED_CC_VER))
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
GCC_CHECK :=$(call CheckVersions,$(GCC_VER),$(REQUIRED_GCC_VER))
|
||||
endif
|
||||
endif
|
||||
sane-compiler: sane-link
|
||||
@if [ "$(CC_CHECK)" = "missing" ]; then \
|
||||
$(ECHO) "ERROR: The Compiler version is undefined. \n" \
|
||||
@ -1314,16 +1339,6 @@ ifndef OPENJDK
|
||||
" $(COMPILER_PATH) \n" \
|
||||
"" >> $(WARNING_FILE) ; \
|
||||
fi
|
||||
ifdef GCC_CHECK
|
||||
@if [ "$(GCC_CHECK)" != "same" ]; then \
|
||||
$(ECHO) "WARNING: The $(PLATFORM) GCC compiler must be version $(REQUIRED_GCC_VER) \n" \
|
||||
" $(YOU_ARE_USING) compiler version: $(GCC_VER) \n" \
|
||||
" The compiler was obtained from the following location: \n" \
|
||||
" $(GCC_COMPILER_PATH) \n" \
|
||||
" Please change your compiler. \n" \
|
||||
"" >> $(WARNING_FILE) ; \
|
||||
fi
|
||||
endif
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
ifneq ($(COMPILER_VERSION), VS2005)
|
||||
@ -1337,39 +1352,24 @@ endif
|
||||
######################################################
|
||||
# Check that ALSA headers and libs are installed and
|
||||
# that the header has the right version. We only
|
||||
# need /usr/include/alsa/*.h and /usr/lib/libasound.so
|
||||
# need /usr/include/alsa/version.h and /usr/lib/libasound.so
|
||||
######################################################
|
||||
|
||||
ifdef ALSA_VERSION_CHECK
|
||||
$(ALSA_VERSION_CHECK): $(ALSA_VERSION_CHECK).c
|
||||
@$(prep-target)
|
||||
@$(CC) -lasound -o $@ $<
|
||||
|
||||
$(ALSA_VERSION_CHECK).c:
|
||||
@$(prep-target)
|
||||
@$(ECHO) "#include <alsa/asoundlib.h>\n" \
|
||||
"#include <stdio.h>\n" \
|
||||
"int main(int argc, char** argv) {\n" \
|
||||
" printf(\"%s\", SND_LIB_VERSION_STR);\n" \
|
||||
" return 0;\n" \
|
||||
"}\n" \
|
||||
> $@
|
||||
ifdef REQUIRED_ALSA_VERSION
|
||||
ALSA_CHECK := $(call CheckVersions,$(ALSA_VERSION),$(REQUIRED_ALSA_VERSION))
|
||||
endif
|
||||
|
||||
sane-alsa-versioncheck: $(ALSA_VERSION_CHECK)
|
||||
sane-alsa-headers: sane-alsa-versioncheck
|
||||
ifdef ALSA_VERSION_CHECK
|
||||
@if [ -f "$(ALSA_VERSION_CHECK)" ]; then \
|
||||
if [ `$(ALSA_VERSION_CHECK) | $(EGREP) -c '$(REQUIRED_ALSA_VERSION)'` -ne 1 ] ; then \
|
||||
$(ECHO) "ERROR: The ALSA version must be 0.9.1 or higher. \n" \
|
||||
" You have the following ALSA version installed: $(ALSA_VERSION) \n" \
|
||||
sane-alsa-headers:
|
||||
ifdef REQUIRED_ALSA_VERSION
|
||||
if [ "$(ALSA_CHECK)" != "same" -a "$(ALSA_CHECK)" != "newer" ] ; then \
|
||||
$(ECHO) "ERROR: The ALSA version must be $(REQUIRED_ALSA_VERSION) or higher. \n" \
|
||||
" You have the following ALSA version installed: $${alsa_version) \n" \
|
||||
" Please reinstall ALSA (drivers and lib). You can download \n" \
|
||||
" the source distribution from http://www.alsa-project.org \n" \
|
||||
" or go to http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \
|
||||
"" >> $(ERROR_FILE) ; \
|
||||
fi \
|
||||
else \
|
||||
$(ECHO) "ERROR: You seem to not have installed ALSA 0.9.1 or higher. \n" \
|
||||
$(ECHO) "ERROR: You seem to not have installed ALSA $(REQUIRED_ALSA_VERSION) or higher. \n" \
|
||||
" Please install ALSA (drivers and lib). You can download the \n" \
|
||||
" source distribution from http://www.alsa-project.org or go to \n" \
|
||||
" http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages. \n" \
|
||||
@ -1384,7 +1384,7 @@ $(SANITY_FILES):
|
||||
######################################################
|
||||
# dump out the variable settings...
|
||||
######################################################
|
||||
sane-settings:: sane-alsa-versioncheck
|
||||
sane-settings::
|
||||
@$(ECHO) >> $(MESSAGE_FILE)
|
||||
@$(ECHO) $(ALL_SETTINGS) >> $(MESSAGE_FILE)
|
||||
@$(ECHO) >> $(MESSAGE_FILE)
|
||||
@ -1453,8 +1453,8 @@ sane-gcc-compiler:
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifndef OPENJDK
|
||||
@if [ -r $(GCC_COMPILER_PATH) ]; then \
|
||||
if [ ! "$(GCC_VER)" = 2.95.2 ]; then \
|
||||
$(ECHO) "ERROR: The Solaris GCC compiler version must be 2.95.2. \n" \
|
||||
if [ ! "$(GCC_VER)" = $(REQUIRED_GCC_VERSION) ]; then \
|
||||
$(ECHO) "ERROR: The Solaris GCC compiler version must be $(REQUIRED_GCC_VERSION). \n" \
|
||||
" You are using the following compiler version: $(GCC_VER) \n" \
|
||||
" The compiler was obtained from the following location: \n" \
|
||||
" $(GCC_COMPILER_PATH) \n" \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1994-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1994-2009 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
|
||||
|
@ -5,7 +5,7 @@
|
||||
* 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 "Classname" exception as provided
|
||||
* 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1999-2009 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1999-2009 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Portions Copyright 2000-2009 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 2000-2009 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
|
||||
@ -143,11 +143,15 @@ class PKIXMasterCertPathValidator {
|
||||
}
|
||||
|
||||
} catch (CertPathValidatorException cpve) {
|
||||
// Throw the saved OCSP exception
|
||||
// (when the CRL check has also failed)
|
||||
// Throw the saved OCSP exception unless the CRL
|
||||
// checker has determined that the cert is revoked
|
||||
if (ocspCause != null &&
|
||||
currChecker instanceof CrlRevocationChecker) {
|
||||
throw ocspCause;
|
||||
currChecker instanceof CrlRevocationChecker) {
|
||||
if (cpve.getReason() == BasicReason.REVOKED) {
|
||||
throw cpve;
|
||||
} else {
|
||||
throw ocspCause;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Handle failover from OCSP to CRLs
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 2004-2009 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1995-2009 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1995-2009 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
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* 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 conne02110-1301 USA.
|
||||
* 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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 2000-2009 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
|
||||
|
@ -16,7 +16,7 @@
|
||||
*
|
||||
* 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 conne02110-1301 USA.
|
||||
* 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
|
||||
|
@ -15,6 +15,10 @@
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -0,0 +1,265 @@
|
||||
/*
|
||||
* Copyright 2009 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.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @bug 6383095
|
||||
* @summary CRL revoked certificate failures masked by OCSP failures
|
||||
*
|
||||
* Note that the certificate validity is from Mar 16 14:55:35 2009 GMT to
|
||||
* Dec 1 14:55:35 2028 GMT, please update it with newer certificate if
|
||||
* expires.
|
||||
*
|
||||
* @author Xuelei Fan
|
||||
*/
|
||||
|
||||
/*
|
||||
* Certificates used in the test.
|
||||
*
|
||||
* end entity certificate:
|
||||
* Data:
|
||||
* Version: 3 (0x2)
|
||||
* Serial Number: 25 (0x19)
|
||||
* Signature Algorithm: md5WithRSAEncryption
|
||||
* Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
|
||||
* Validity
|
||||
* Not Before: Mar 16 14:55:35 2009 GMT
|
||||
* Not After : Dec 1 14:55:35 2028 GMT
|
||||
* Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org, OU=SSL-Client,
|
||||
* CN=localhost
|
||||
* Subject Public Key Info:
|
||||
* Public Key Algorithm: rsaEncryption
|
||||
* RSA Public Key: (1024 bit)
|
||||
* Modulus (1024 bit):
|
||||
* 00:bb:f0:40:36:ac:26:54:4e:f4:a3:5a:00:2f:69:
|
||||
* 21:6f:b9:7a:3a:93:ec:a2:f6:e1:8e:c7:63:d8:2f:
|
||||
* 12:30:99:2e:b0:f2:8f:f8:27:2d:24:78:28:84:f7:
|
||||
* 01:bf:8d:44:79:dd:3b:d2:55:f3:ce:3c:b2:5b:21:
|
||||
* 7d:ef:fd:33:4a:b1:a3:ff:c6:c8:9b:b9:0f:7c:41:
|
||||
* 35:97:f9:db:3a:05:60:05:15:af:59:17:92:a3:10:
|
||||
* ad:16:1c:e4:07:53:af:a8:76:a2:56:2a:92:d3:f9:
|
||||
* 28:e0:78:cf:5e:1f:48:ab:5c:19:dd:e1:67:43:ba:
|
||||
* 75:8d:f5:82:ac:43:92:44:1b
|
||||
* Exponent: 65537 (0x10001)
|
||||
* X509v3 extensions:
|
||||
* X509v3 Basic Constraints:
|
||||
* CA:FALSE
|
||||
* X509v3 Key Usage:
|
||||
* Digital Signature, Non Repudiation, Key Encipherment
|
||||
* X509v3 Subject Key Identifier:
|
||||
* CD:BB:C8:85:AA:91:BD:FD:1D:BE:CD:67:7C:FF:B3:E9:4C:A8:22:E6
|
||||
* X509v3 Authority Key Identifier:
|
||||
* keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
|
||||
* Signature Algorithm: md5WithRSAEncryption
|
||||
*
|
||||
*
|
||||
* trusted certificate authority:
|
||||
* Data:
|
||||
* Version: 3 (0x2)
|
||||
* Serial Number: 0 (0x0)
|
||||
* Signature Algorithm: md5WithRSAEncryption
|
||||
* Issuer: C=US, ST=Some-State, L=Some-City, O=Some-Org
|
||||
* Validity
|
||||
* Not Before: Dec 8 02:43:36 2008 GMT
|
||||
* Not After : Aug 25 02:43:36 2028 GMT
|
||||
* Subject: C=US, ST=Some-State, L=Some-City, O=Some-Org
|
||||
* Subject Public Key Info:
|
||||
* Public Key Algorithm: rsaEncryption
|
||||
* RSA Public Key: (1024 bit)
|
||||
* Modulus (1024 bit):
|
||||
* 00:cb:c4:38:20:07:be:88:a7:93:b0:a1:43:51:2d:
|
||||
* d7:8e:85:af:54:dd:ad:a2:7b:23:5b:cf:99:13:53:
|
||||
* 99:45:7d:ee:6d:ba:2d:bf:e3:ad:6e:3d:9f:1a:f9:
|
||||
* 03:97:e0:17:55:ae:11:26:57:de:01:29:8e:05:3f:
|
||||
* 21:f7:e7:36:e8:2e:37:d7:48:ac:53:d6:60:0e:c7:
|
||||
* 50:6d:f6:c5:85:f7:8b:a6:c5:91:35:72:3c:94:ee:
|
||||
* f1:17:f0:71:e3:ec:1b:ce:ca:4e:40:42:b0:6d:ee:
|
||||
* 6a:0e:d6:e5:ad:3c:0f:c9:ba:82:4f:78:f8:89:97:
|
||||
* 89:2a:95:12:4c:d8:09:2a:e9
|
||||
* Exponent: 65537 (0x10001)
|
||||
* X509v3 extensions:
|
||||
* X509v3 Subject Key Identifier:
|
||||
* FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
|
||||
* X509v3 Authority Key Identifier:
|
||||
* keyid:FA:B9:51:BF:4C:E7:D9:86:98:33:F9:E7:CB:1E:F1:33:49:F7:A8:14
|
||||
* DirName:/C=US/ST=Some-State/L=Some-City/O=Some-Org
|
||||
* X509v3 Basic Constraints:
|
||||
* CA:TRUE
|
||||
* Signature Algorithm: md5WithRSAEncryption
|
||||
*
|
||||
* CRL:
|
||||
* Certificate Revocation List (CRL):
|
||||
* Version 2 (0x1)
|
||||
* Signature Algorithm: md5WithRSAEncryption
|
||||
* Issuer: /C=US/ST=Some-State/L=Some-City/O=Some-Org
|
||||
* Last Update: Mar 16 16:27:14 2009 GMT
|
||||
* Next Update: May 15 16:27:14 2028 GMT
|
||||
* CRL extensions:
|
||||
* X509v3 CRL Number:
|
||||
* 2
|
||||
* Revoked Certificates:
|
||||
* Serial Number: 19
|
||||
* Revocation Date: Mar 16 16:22:08 2009 GMT
|
||||
* CRL entry extensions:
|
||||
* X509v3 CRL Reason Code:
|
||||
* Superseded
|
||||
* Signature Algorithm: md5WithRSAEncryption
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
import java.net.SocketException;
|
||||
import java.util.*;
|
||||
import java.security.Security;
|
||||
import java.security.cert.*;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.cert.CertPathValidatorException.BasicReason;
|
||||
|
||||
public class FailoverToCRL {
|
||||
|
||||
static String trusedCertStr =
|
||||
"-----BEGIN CERTIFICATE-----\n" +
|
||||
"MIICrDCCAhWgAwIBAgIBADANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
|
||||
"MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
|
||||
"EwhTb21lLU9yZzAeFw0wODEyMDgwMjQzMzZaFw0yODA4MjUwMjQzMzZaMEkxCzAJ\n" +
|
||||
"BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
|
||||
"dHkxETAPBgNVBAoTCFNvbWUtT3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB\n" +
|
||||
"gQDLxDggB76Ip5OwoUNRLdeOha9U3a2ieyNbz5kTU5lFfe5tui2/461uPZ8a+QOX\n" +
|
||||
"4BdVrhEmV94BKY4FPyH35zboLjfXSKxT1mAOx1Bt9sWF94umxZE1cjyU7vEX8HHj\n" +
|
||||
"7BvOyk5AQrBt7moO1uWtPA/JuoJPePiJl4kqlRJM2Akq6QIDAQABo4GjMIGgMB0G\n" +
|
||||
"A1UdDgQWBBT6uVG/TOfZhpgz+efLHvEzSfeoFDBxBgNVHSMEajBogBT6uVG/TOfZ\n" +
|
||||
"hpgz+efLHvEzSfeoFKFNpEswSTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt\n" +
|
||||
"U3RhdGUxEjAQBgNVBAcTCVNvbWUtQ2l0eTERMA8GA1UEChMIU29tZS1PcmeCAQAw\n" +
|
||||
"DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQBcIm534U123Hz+rtyYO5uA\n" +
|
||||
"ofd81G6FnTfEAV8Kw9fGyyEbQZclBv34A9JsFKeMvU4OFIaixD7nLZ/NZ+IWbhmZ\n" +
|
||||
"LovmJXyCkOufea73pNiZ+f/4/ScZaIlM/PRycQSqbFNd4j9Wott+08qxHPLpsf3P\n" +
|
||||
"6Mvf0r1PNTY2hwTJLJmKtg==\n" +
|
||||
"-----END CERTIFICATE-----";
|
||||
|
||||
static String targetCertStr =
|
||||
"-----BEGIN CERTIFICATE-----\n" +
|
||||
"MIICizCCAfSgAwIBAgIBGTANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzET\n" +
|
||||
"MBEGA1UECBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQK\n" +
|
||||
"EwhTb21lLU9yZzAeFw0wOTAzMTYxNDU1MzVaFw0yODEyMDExNDU1MzVaMHIxCzAJ\n" +
|
||||
"BgNVBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMRIwEAYDVQQHEwlTb21lLUNp\n" +
|
||||
"dHkxETAPBgNVBAoTCFNvbWUtT3JnMRMwEQYDVQQLEwpTU0wtQ2xpZW50MRIwEAYD\n" +
|
||||
"VQQDEwlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALvwQDas\n" +
|
||||
"JlRO9KNaAC9pIW+5ejqT7KL24Y7HY9gvEjCZLrDyj/gnLSR4KIT3Ab+NRHndO9JV\n" +
|
||||
"8848slshfe/9M0qxo//GyJu5D3xBNZf52zoFYAUVr1kXkqMQrRYc5AdTr6h2olYq\n" +
|
||||
"ktP5KOB4z14fSKtcGd3hZ0O6dY31gqxDkkQbAgMBAAGjWjBYMAkGA1UdEwQCMAAw\n" +
|
||||
"CwYDVR0PBAQDAgXgMB0GA1UdDgQWBBTNu8iFqpG9/R2+zWd8/7PpTKgi5jAfBgNV\n" +
|
||||
"HSMEGDAWgBT6uVG/TOfZhpgz+efLHvEzSfeoFDANBgkqhkiG9w0BAQQFAAOBgQBv\n" +
|
||||
"p7JjCDOrMBNun46xs4Gz7Y4ygM5VHaFP0oO7369twvRSu0pCuIdZd5OIMPFeRqQw\n" +
|
||||
"PA68ZdhYVR0pG5W7isV+jB+Dfge/IOgOA85sZ/6FlP3PBRW+YMQKKdRr5So3ook9\n" +
|
||||
"PimQ7rbxRAofPECv20IUKFBbOUkU+gFcn+WbTKYxBw==\n" +
|
||||
"-----END CERTIFICATE-----";
|
||||
|
||||
static String crlStr =
|
||||
"-----BEGIN X509 CRL-----\n" +
|
||||
"MIIBRTCBrwIBATANBgkqhkiG9w0BAQQFADBJMQswCQYDVQQGEwJVUzETMBEGA1UE\n" +
|
||||
"CBMKU29tZS1TdGF0ZTESMBAGA1UEBxMJU29tZS1DaXR5MREwDwYDVQQKEwhTb21l\n" +
|
||||
"LU9yZxcNMDkwMzE2MTYyNzE0WhcNMjgwNTE1MTYyNzE0WjAiMCACARkXDTA5MDMx\n" +
|
||||
"NjE2MjIwOFowDDAKBgNVHRUEAwoBBKAOMAwwCgYDVR0UBAMCAQIwDQYJKoZIhvcN\n" +
|
||||
"AQEEBQADgYEAMixJI9vBwYpOGosn46+T/MTEtlm2S5pIVT/xPDrHkCPfw8l4Zrgp\n" +
|
||||
"dGPuUkglWdrGdxY9MNRUj2YFNfdZi6zZ7JF6XbkDHYOAKYgPDJRjS/0VcBntn5RJ\n" +
|
||||
"sQfZsBqc9fFSP8gknRRn3LT41kr9xNRxTT1t3YYjv7J3zkMYyInqeUA=\n" +
|
||||
"-----END X509 CRL-----";
|
||||
|
||||
|
||||
private static CertPath generateCertificatePath()
|
||||
throws CertificateException {
|
||||
// generate certificate from cert strings
|
||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||
|
||||
ByteArrayInputStream is =
|
||||
new ByteArrayInputStream(targetCertStr.getBytes());
|
||||
Certificate targetCert = cf.generateCertificate(is);
|
||||
|
||||
// generate certification path
|
||||
List<Certificate> list = Arrays.asList(new Certificate[] {targetCert});
|
||||
|
||||
return cf.generateCertPath(list);
|
||||
}
|
||||
|
||||
private static Set<TrustAnchor> generateTrustAnchors()
|
||||
throws CertificateException {
|
||||
// generate certificate from cert string
|
||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||
|
||||
ByteArrayInputStream is =
|
||||
new ByteArrayInputStream(trusedCertStr.getBytes());
|
||||
Certificate trusedCert = cf.generateCertificate(is);
|
||||
|
||||
// generate a trust anchor
|
||||
TrustAnchor anchor = new TrustAnchor((X509Certificate)trusedCert, null);
|
||||
|
||||
return Collections.singleton(anchor);
|
||||
}
|
||||
|
||||
private static CertStore generateCertificateStore() throws Exception {
|
||||
// generate CRL from CRL string
|
||||
CertificateFactory cf = CertificateFactory.getInstance("X.509");
|
||||
|
||||
ByteArrayInputStream is =
|
||||
new ByteArrayInputStream(crlStr.getBytes());
|
||||
|
||||
// generate a cert store
|
||||
Collection<? extends CRL> crls = cf.generateCRLs(is);
|
||||
return CertStore.getInstance("Collection",
|
||||
new CollectionCertStoreParameters(crls));
|
||||
}
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
CertPath path = generateCertificatePath();
|
||||
Set<TrustAnchor> anchors = generateTrustAnchors();
|
||||
CertStore crls = generateCertificateStore();
|
||||
|
||||
PKIXParameters params = new PKIXParameters(anchors);
|
||||
|
||||
// add the CRL store
|
||||
params.addCertStore(crls);
|
||||
|
||||
// Activate certificate revocation checking
|
||||
params.setRevocationEnabled(true);
|
||||
|
||||
// Activate OCSP
|
||||
Security.setProperty("ocsp.enable", "true");
|
||||
System.setProperty("com.sun.security.enableCRLDP", "true");
|
||||
|
||||
// Ensure that the ocsp.responderURL property is not set.
|
||||
if (Security.getProperty("ocsp.responderURL") != null) {
|
||||
throw new
|
||||
Exception("The ocsp.responderURL property must not be set");
|
||||
}
|
||||
|
||||
CertPathValidator validator = CertPathValidator.getInstance("PKIX");
|
||||
|
||||
try {
|
||||
validator.validate(path, params);
|
||||
} catch (CertPathValidatorException cpve) {
|
||||
if (cpve.getReason() != BasicReason.REVOKED) {
|
||||
throw new Exception(
|
||||
"unexpect exception, should be a REVOKED CPVE", cpve);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -4,7 +4,6 @@
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
|
Loading…
x
Reference in New Issue
Block a user