diff --git a/.hgtags b/.hgtags index f9dffacfa30..0990efaad3b 100644 --- a/.hgtags +++ b/.hgtags @@ -233,3 +233,4 @@ b5ed503c26ad38869c247c5e32debec217fd056b jdk8-b104 af9a674e12a16da1a4bd53e4990ddb1121a21ef1 jdk8-b109 b5d2bf482a3ea1cca08c994512804ffbc73de0a1 jdk8-b110 b9a0f6c693f347a6f4b9bb994957f4eaa05bdedd jdk8-b111 +ad67c34f79c28a8e755f4a49f313868619d6702c jdk8-b112 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index a9a38f902cc..8814acccf94 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -233,3 +233,4 @@ b7e64be81c8a7690703df5711f4fc2375da8a9cb jdk8-b103 91f47e8da5c60de58ed195e9b57f3bf192a18f83 jdk8-b109 4faa09c7fe555de086dd9048d3c5cc92317d6f45 jdk8-b110 d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111 +547316ea137d83d9c63083a9b83db64198fe0c81 jdk8-b112 diff --git a/NewMakefile.gmk b/NewMakefile.gmk index 366a3b93561..a3389ff7278 100644 --- a/NewMakefile.gmk +++ b/NewMakefile.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. 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 @@ -36,10 +36,8 @@ default: TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1 # Assume we have GNU make, but check version. -ifeq (,$(findstring 3.81,$(MAKE_VERSION))) - ifeq (,$(findstring 3.82,$(MAKE_VERSION))) - $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) - endif +ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), ) + $(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.) endif # Locate this Makefile diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 464f68f5b66..74eb88ad814 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -212,6 +212,18 @@ AC_DEFUN([BASIC_DEPRECATED_ARG_WITH], [AC_MSG_WARN([Option --with-$1 is deprecated and will be ignored.])]) ]) +# Register a --enable argument but mark it as deprecated +# $1: The name of the with argument to deprecate, not including --enable- +# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) +AC_DEFUN([BASIC_DEPRECATED_ARG_ENABLE], +[ + AC_ARG_ENABLE($1, [AS_HELP_STRING([--enable-$1], + [Deprecated. Option is kept for backwards compatibility and is ignored])]) + if test "x$enable_$2" != x; then + AC_MSG_WARN([Option --enable-$1 is deprecated and will be ignored.]) + fi +]) + AC_DEFUN_ONCE([BASIC_INIT], [ # Save the original command line. This is passed to us by the wrapper configure script. @@ -502,7 +514,7 @@ AC_DEFUN([BASIC_CHECK_MAKE_VERSION], if test "x$IS_GNU_MAKE" = x; then AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.]) else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[[12]]\)\|\(4\.\)'` if test "x$IS_MODERN_MAKE" = x; then AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.]) else @@ -644,6 +656,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], fi if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + BASIC_REQUIRE_PROG(DSYMUTIL, dsymutil) BASIC_REQUIRE_PROG(XATTR, xattr) AC_PATH_PROG(CODESIGN, codesign) if test "x$CODESIGN" != "x"; then diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac index 22f917b589a..238e4a44274 100644 --- a/common/autoconf/configure.ac +++ b/common/autoconf/configure.ac @@ -177,6 +177,9 @@ JDKOPT_SETUP_DEBUG_SYMBOLS # ############################################################################### +# After we have toolchain, we can compile fixpath. It's needed by the lib checks. +BASIC_COMPILE_FIXPATH + LIB_SETUP_INIT LIB_SETUP_X11 LIB_SETUP_CUPS @@ -185,8 +188,6 @@ LIB_SETUP_ALSA LIB_SETUP_MISC_LIBS LIB_SETUP_STATIC_LINK_LIBSTDCPP -# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper -BASIC_COMPILE_FIXPATH ############################################################################### # diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 325cd794770..0c43de65644 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -634,7 +634,6 @@ NUM_CORES ENABLE_INTREE_EC SALIB_NAME HOTSPOT_MAKE_ARGS -FIXPATH LIBCXX LLVM_LIBS LLVM_LDFLAGS @@ -651,10 +650,9 @@ USE_EXTERNAL_LIBGIF USE_EXTERNAL_LIBJPEG ALSA_LIBS ALSA_CFLAGS -FREETYPE2_LIB_PATH -USING_SYSTEM_FT_LIB -FREETYPE2_LIBS -FREETYPE2_CFLAGS +FREETYPE_BUNDLE_LIB_PATH +FREETYPE_LIBS +FREETYPE_CFLAGS CUPS_CFLAGS OPENWIN_HOME X_EXTRA_LIBS @@ -662,6 +660,7 @@ X_LIBS X_PRE_LIBS X_CFLAGS XMKMF +FIXPATH CXXFLAGS_DEBUG_SYMBOLS CFLAGS_DEBUG_SYMBOLS ZIP_DEBUGINFO_FILES @@ -825,6 +824,7 @@ OS_VERSION_MAJOR PKG_CONFIG CODESIGN XATTR +DSYMUTIL IS_GNU_TIME TIME STAT @@ -1046,6 +1046,9 @@ with_x with_cups with_cups_include with_freetype +with_freetype_include +with_freetype_lib +enable_freetype_bundling with_alsa with_alsa_include with_alsa_lib @@ -1078,8 +1081,8 @@ OBJCFLAGS CPP CXXCPP XMKMF -FREETYPE2_CFLAGS -FREETYPE2_LIBS +FREETYPE_CFLAGS +FREETYPE_LIBS ALSA_CFLAGS ALSA_LIBS LIBFFI_CFLAGS @@ -1715,9 +1718,13 @@ Optional Features: --disable-debug-symbols disable generation of debug symbols [enabled] --disable-zip-debug-info disable zipping of debug-info files [enabled] - --disable-macosx-runtime-support - disable the use of MacOSX Java runtime support - framework [enabled] + --enable-macosx-runtime-support + Deprecated. Option is kept for backwards + compatibility and is ignored + --disable-freetype-bundling + disable bundling of the freetype library with the + build result [enabled on Windows or when using + --with-freetype, disabled otherwise] --enable-sjavac use sjavac to do fast incremental compiles [disabled] --disable-precompiled-headers @@ -1803,9 +1810,11 @@ Optional Packages: --with-cups specify prefix directory for the cups package (expecting the headers under PATH/include) --with-cups-include specify directory for the cups include files - --with-freetype specify prefix directory for the freetype2 package + --with-freetype specify prefix directory for the freetype package (expecting the libraries under PATH/lib and the headers under PATH/include) + --with-freetype-include specify directory for the freetype include files + --with-freetype-lib specify directory for the freetype library --with-alsa specify prefix directory for the alsa package (expecting the libraries under PATH/lib and the headers under PATH/include) @@ -1846,10 +1855,10 @@ Some influential environment variables: CPP C preprocessor CXXCPP C++ preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System - FREETYPE2_CFLAGS - C compiler flags for FREETYPE2, overriding pkg-config - FREETYPE2_LIBS - linker flags for FREETYPE2, overriding pkg-config + FREETYPE_CFLAGS + C compiler flags for FREETYPE, overriding pkg-config + FREETYPE_LIBS + linker flags for FREETYPE, overriding pkg-config ALSA_CFLAGS C compiler flags for ALSA, overriding pkg-config ALSA_LIBS linker flags for ALSA, overriding pkg-config LIBFFI_CFLAGS @@ -3148,6 +3157,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # $1: The name of the with argument to deprecate, not including --with- +# Register a --enable argument but mark it as deprecated +# $1: The name of the with argument to deprecate, not including --enable- +# $2: The name of the argument to deprecate, in shell variable style (i.e. with _ instead of -) + + # Test that variable $1 denoting a program is not empty. If empty, exit with an error. @@ -3443,16 +3457,42 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. cygwin_help() { case $1 in unzip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P unzip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P unzip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; zip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P zip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P zip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; make) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P make" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P make )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; + freetype) + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + HELP_MSG="To install freetype, run: +wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe +chmod +x /tmp/freetype-setup.exe +/tmp/freetype-setup.exe +Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". +After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll." + else + HELP_MSG="You need to build a 64-bit version of freetype. +This is not readily available. +You can find source code and build instructions on +http://www.freetype.org/ +If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically." + fi + ;; * ) break ;; esac } +msys_help() { + PKGHANDLER_COMMAND="" +} + apt_help() { case $1 in devkit) @@ -3463,7 +3503,7 @@ apt_help() { PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; cups) PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; - freetype2) + freetype) PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; pulse) PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; @@ -3486,7 +3526,7 @@ yum_help() { PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; cups) PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; - freetype2) + freetype) PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; pulse) PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; @@ -3614,6 +3654,8 @@ fi + + # # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -3812,13 +3854,17 @@ fi + + + + # This line needs to be here, verbatim, after all includes and the dummy hook # definitions. It is replaced with custom functionality when building # custom sources. #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1381407169 +DATE_WHEN_GENERATED=1382540536 ############################################################################### # @@ -8269,7 +8315,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -8626,7 +8672,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -8980,7 +9026,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9339,7 +9385,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -9692,7 +9738,7 @@ $as_echo "$as_me: Testing potential make at $MAKE_CANDIDATE, found using $DESCRI { $as_echo "$as_me:${as_lineno-$LINENO}: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&5 $as_echo "$as_me: Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring." >&6;} else - IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[12346789]'` + IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '\(3\.8[12]\)\|\(4\.\)'` if test "x$IS_MODERN_MAKE" = x; then { $as_echo "$as_me:${as_lineno-$LINENO}: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&5 $as_echo "$as_me: Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring." >&6;} @@ -10478,6 +10524,65 @@ $as_echo "$as_me: Could not find $PROG_NAME!" >&6;} if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then + for ac_prog in dsymutil +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DSYMUTIL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DSYMUTIL in + [\\/]* | ?:[\\/]*) + ac_cv_path_DSYMUTIL="$DSYMUTIL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DSYMUTIL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DSYMUTIL=$ac_cv_path_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DSYMUTIL" && break +done + + + if test "x$DSYMUTIL" = x; then + if test "xdsymutil" = x; then + PROG_NAME=dsymutil + else + PROG_NAME=dsymutil + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $PROG_NAME!" >&5 +$as_echo "$as_me: Could not find $PROG_NAME!" >&6;} + as_fn_error $? "Cannot continue" "$LINENO" 5 + fi + + + for ac_prog in xattr do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -15717,27 +15822,34 @@ $as_echo "$BOOT_JDK_VERSION" >&6; } if test "x$BOOT_JDK_FOUND" = xno; then # Print a helpful message on how to acquire the necessary build dependency. - # openjdk is the help tag: freetyp2, cups, pulse, alsa etc + # openjdk is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=openjdk - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find a valid Boot JDK. $HELP_MSG" >&5 @@ -17415,63 +17527,303 @@ $as_echo "$as_me: or run \"bash.exe -l\" from a VS command prompt and then run c as_fn_error $? "Cannot continue" "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 -$as_echo_n "checking for msvcr100.dll... " >&6; } + # Check whether --with-msvcr-dll was given. if test "${with_msvcr_dll+set}" = set; then : withval=$with_msvcr_dll; fi + if test "x$with_msvcr_dll" != x; then - MSVCR_DLL="$with_msvcr_dll" - else - if test "x$VCINSTALLDIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1` - else - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` - if test "x$MSVCR_DLL" = x; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1` - fi - fi - if test "x$MSVCR_DLL" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&5 -$as_echo "$as_me: msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR" >&6;} - else - { $as_echo "$as_me:${as_lineno-$LINENO}: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&5 -$as_echo "$as_me: Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR" >&6;} - fi + # If given explicitely by user, do not probe. If not present, fail directly. + + POSSIBLE_MSVCR_DLL="$with_msvcr_dll" + METHOD="--with-msvcr-dll" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 fi - # Try some fallback alternatives - if test "x$MSVCR_DLL" = x; then - # If visual studio express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1` - { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&5 -$as_echo "$as_me: msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS.." >&6;} - fi - fi - fi - if test "x$MSVCR_DLL" = x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - # Fallback for 32bit builds, look in the windows directory. - if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: msvcr100.dll found in $SYSTEMROOT/system32" >&5 -$as_echo "$as_me: msvcr100.dll found in $SYSTEMROOT/system32" >&6;} - MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll" - fi - fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} fi fi + + if test "x$MSVCR_DLL" = x; then + as_fn_error $? "Could not find a proper msvcr100.dll as specified by --with-msvcr-dll" "$LINENO" 5 + fi + fi + if test "x$MSVCR_DLL" = x; then + # Probe: Using well-known location from Visual Studio 10.0 + if test "x$VCINSTALLDIR" != x; then + CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" + + windows_path="$CYGWIN_VC_INSTALL_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VC_INSTALL_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_VC_INSTALL_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + else + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + fi + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in VCINSTALLDIR" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Check in the Boot JDK directory. + POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in Boot JDK" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Look in the Windows system32 directory + CYGWIN_SYSTEMROOT="$SYSTEMROOT" + + windows_path="$CYGWIN_SYSTEMROOT" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_SYSTEMROOT="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_SYSTEMROOT="$unix_path" + fi + + POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="well-known location in SYSTEMROOT" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: If Visual Studio Express is installed, there is usually one with the debugger + if test "x$VS100COMNTOOLS" != x; then + CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + + windows_path="$CYGWIN_VS_TOOLS_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + CYGWIN_VS_TOOLS_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + CYGWIN_VS_TOOLS_DIR="$unix_path" + fi + + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + fi + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="search of VS100COMNTOOLS" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. + # (This was the original behaviour; kept since it might turn up something) + if test "x$CYGWIN_VC_INSTALL_DIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVCR_DLL" = x; then + # We're grasping at straws now... + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + fi + fi + + + POSSIBLE_MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + METHOD="search of VCINSTALLDIR" + if test -e "$POSSIBLE_MSVCR_DLL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&5 +$as_echo "$as_me: Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD" >&6;} + + # Need to check if the found msvcr is correct architecture + { $as_echo "$as_me:${as_lineno-$LINENO}: checking found msvcr100.dll architecture" >&5 +$as_echo_n "checking found msvcr100.dll architecture... " >&6; } + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 +$as_echo "$MSVCR_DLL" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: incorrect, ignoring" >&5 +$as_echo "incorrect, ignoring" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&5 +$as_echo "$as_me: The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE" >&6;} + fi + fi + + fi + fi + + if test "x$MSVCR_DLL" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for msvcr100.dll" >&5 +$as_echo_n "checking for msvcr100.dll... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "Could not find msvcr100.dll !" "$LINENO" 5 + as_fn_error $? "Could not find msvcr100.dll. Please specify using --with-msvcr-dll." "$LINENO" 5 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSVCR_DLL" >&5 -$as_echo "$MSVCR_DLL" >&6; } + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then @@ -18874,27 +19226,34 @@ done if test "x$CC" = x; then # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetyp2, cups, pulse, alsa etc + # devkit is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=devkit - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 @@ -20446,27 +20805,34 @@ done if test "x$CXX" = x; then # Print a helpful message on how to acquire the necessary build dependency. - # devkit is the help tag: freetyp2, cups, pulse, alsa etc + # devkit is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=devkit - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi as_fn_error $? "Could not find a $COMPILER_NAME compiler. $HELP_MSG" "$LINENO" 5 @@ -29539,11 +29905,11 @@ $as_echo_n "checking if we should generate debug symbols... " >&6; } elif test "x$enable_debug_symbols" = "xno"; then ENABLE_DEBUG_SYMBOLS=false else - # default on macosx is false - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ENABLE_DEBUG_SYMBOLS=false - # Default is on if objcopy is found, otherwise off - elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then + # Default is on if objcopy is found + if test "x$OBJCOPY" != x; then + ENABLE_DEBUG_SYMBOLS=true + # MacOS X and Windows don't use objcopy but default is on for those OSes + elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then ENABLE_DEBUG_SYMBOLS=true else ENABLE_DEBUG_SYMBOLS=false @@ -29586,6 +29952,66 @@ $as_echo "${enable_zip_debug_info}" >&6; } # ############################################################################### +# After we have toolchain, we can compile fixpath. It's needed by the lib checks. + + # When using cygwin or msys, we need a wrapper binary that renames + # /cygdrive/c/ arguments into c:/ arguments and peeks into + # @files and rewrites these too! This wrapper binary is + # called fixpath. + FIXPATH= + if test "x$OPENJDK_BUILD_OS" = xwindows; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5 +$as_echo_n "checking if fixpath can be created... " >&6; } + FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" + FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" + if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then + FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC` + FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN` + # Important to keep the .exe suffix on Cygwin for Hotspot makefiles + FIXPATH="$OUTPUT_ROOT/fixpath.exe -c" + elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then + FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC` + FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN` + + # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line + # @ was chosen as separator to minimize risk of other tools messing around with it + all_unique_prefixes=`echo "${all_fixpath_prefixes[@]}" | tr ' ' '\n' | grep '^/./' | sort | uniq` + fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` + + FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" + fi + rm -f $OUTPUT_ROOT/fixpath* + cd $OUTPUT_ROOT + $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 + cd $CURDIR + + if test ! -x $OUTPUT_ROOT/fixpath.exe; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cat $OUTPUT_ROOT/fixpath1.log + as_fn_error $? "Could not create $OUTPUT_ROOT/fixpath.exe" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5 +$as_echo_n "checking if fixpath.exe works... " >&6; } + cd $OUTPUT_ROOT + $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 + cd $CURDIR + if test ! -x $OUTPUT_ROOT/fixpath2.exe; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + cat $OUTPUT_ROOT/fixpath2.log + as_fn_error $? "fixpath did not work!" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj + fi + + + + ############################################################################### @@ -29626,7 +30052,6 @@ $as_echo_n "checking what is not needed on MacOSX?... " >&6; } ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes - FREETYPE2_NOT_NEEDED=yes # If the java runtime framework is disabled, then we need X11. # This will be adjusted below. { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse x11" >&5 @@ -29642,7 +30067,7 @@ $as_echo "alsa" >&6; } fi if test "x$OPENJDK" = "xfalse"; then - FREETYPE2_NOT_NEEDED=yes + FREETYPE_NOT_NEEDED=yes fi if test "x$SUPPORT_HEADFUL" = xno; then @@ -29651,44 +30076,31 @@ $as_echo "alsa" >&6; } ############################################################################### # - # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM - # that uses this API. + # Check for MacOSX support for OpenJDK. # + + # Check whether --enable-macosx-runtime-support was given. if test "${enable_macosx_runtime_support+set}" = set; then : - enableval=$enable_macosx_runtime_support; MACOSX_RUNTIME_SUPPORT="${enableval}" -else - MACOSX_RUNTIME_SUPPORT="no" + enableval=$enable_macosx_runtime_support; fi + if test "x$enable_macosx_runtime_support" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&5 +$as_echo "$as_me: WARNING: Option --enable-macosx-runtime-support is deprecated and will be ignored." >&2;} + fi - USE_MACOSX_RUNTIME_SUPPORT=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit Java runtime support in the OS" >&5 -$as_echo_n "checking for explicit Java runtime support in the OS... " >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mac OS X Java Framework" >&5 +$as_echo_n "checking for Mac OS X Java Framework... " >&6; } if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then - if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then - MACOSX_RUNTIME_SUPPORT=yes - USE_MACOSX_RUNTIME_SUPPORT=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, does not need alsa freetype2 pulse and X11" >&5 -$as_echo "yes, does not need alsa freetype2 pulse and X11" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, but explicitly disabled." >&5 -$as_echo "yes, but explicitly disabled." >&6; } - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: /System/Library/Frameworks/JavaVM.framework" >&5 +$as_echo "/System/Library/Frameworks/JavaVM.framework" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what is not needed on an X11 build on MacOSX?" >&5 -$as_echo_n "checking what is not needed on an X11 build on MacOSX?... " >&6; } - X11_NOT_NEEDED= - FREETYPE2_NOT_NEEDED= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: alsa pulse" >&5 -$as_echo "alsa pulse" >&6; } - fi - ############################################################################### @@ -30412,42 +30824,39 @@ fi if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then # Print a helpful message on how to acquire the necessary build dependency. - # x11 is the help tag: freetyp2, cups, pulse, alsa etc + # x11 is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=x11 - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi as_fn_error $? "Could not find X11 libraries. $HELP_MSG" "$LINENO" 5 fi - # Some of the old makefiles require a setting of OPENWIN_HOME - # Since the X11R6 directory has disappeared on later Linuxes, - # we need to probe for it. - if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test -d "$SYS_ROOT/usr/X11R6"; then - OPENWIN_HOME="$SYS_ROOT/usr/X11R6" - elif test -d "$SYS_ROOT/usr/include/X11"; then - OPENWIN_HOME="$SYS_ROOT/usr" - fi - fi if test "x$OPENJDK_TARGET_OS" = xsolaris; then OPENWIN_HOME="/usr/openwin" fi @@ -30507,27 +30916,34 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then # Print a helpful message on how to acquire the necessary build dependency. - # x11 is the help tag: freetyp2, cups, pulse, alsa etc + # x11 is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=x11 - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi as_fn_error $? "Could not find all X11 headers (shape.h Xrender.h XTest.h Intrinsic.h). $HELP_MSG" "$LINENO" 5 @@ -30762,27 +31178,34 @@ $as_echo "$CUPS_FOUND" >&6; } if test "x$CUPS_FOUND" = xno; then # Print a helpful message on how to acquire the necessary build dependency. - # cups is the help tag: freetyp2, cups, pulse, alsa etc + # cups is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=cups - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi as_fn_error $? "Could not find cups! $HELP_MSG " "$LINENO" 5 @@ -30796,7 +31219,7 @@ $as_echo "$CUPS_FOUND" >&6; } ############################################################################### # - # The ubiquitous freetype2 library is used to render fonts. + # The ubiquitous freetype library is used to render fonts. # # Check whether --with-freetype was given. @@ -30805,27 +31228,103 @@ if test "${with_freetype+set}" = set; then : fi - # If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree - USING_SYSTEM_FT_LIB=false +# Check whether --with-freetype-include was given. +if test "${with_freetype_include+set}" = set; then : + withval=$with_freetype_include; +fi - if test "x$FREETYPE2_NOT_NEEDED" = xyes; then + +# Check whether --with-freetype-lib was given. +if test "${with_freetype_lib+set}" = set; then : + withval=$with_freetype_lib; +fi + + # Check whether --enable-freetype-bundling was given. +if test "${enable_freetype_bundling+set}" = set; then : + enableval=$enable_freetype_bundling; +fi + + + FREETYPE_CFLAGS= + FREETYPE_LIBS= + FREETYPE_BUNDLE_LIB_PATH= + + if test "x$FREETYPE_NOT_NEEDED" = xyes; then if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --with-freetype is ignored" >&5 $as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2;} fi - FREETYPE2_CFLAGS= - FREETYPE2_LIBS= - FREETYPE2_LIB_PATH= + if test "x$enable_freetype_bundling" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: freetype not used, so --enable-freetype-bundling is ignored" >&5 +$as_echo "$as_me: WARNING: freetype not used, so --enable-freetype-bundling is ignored" >&2;} + fi else - FREETYPE2_FOUND=no + # freetype is needed to build; go get it! - if test "x$with_freetype" != x; then + BUNDLE_FREETYPE="$enable_freetype_bundling" + + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then + # User has specified settings + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype + BUNDLE_FREETYPE=yes + fi + + if test "x$with_freetype" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" + fi + + # Allow --with-freetype-lib and --with-freetype-include to override + if test "x$with_freetype_include" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" + fi + if test "x$with_freetype_lib" != x; then + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" + fi + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + # Okay, we got it. Check that it works. + + POTENTIAL_FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + METHOD="--with-freetype" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. - path="$with_freetype" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" new_path=`$CYGPATH -u "$path"` # Cygwin tries to hide some aspects of the Windows file system, such that binaries are @@ -30837,9 +31336,9 @@ $as_echo "$as_me: WARNING: freetype not used, so --with-freetype is ignored" >&2 # It is also a way to make sure we got the proper file name for the real test later on. test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of with_freetype" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 fi # Call helper function which possibly converts this using DOS-style short mode. @@ -30877,14 +31376,14 @@ $as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is inv if test "x$path" != "x$new_path"; then - with_freetype="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - path="$with_freetype" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` new_path="$path" if test "x$has_colon" = x; then @@ -30915,9 +31414,9 @@ $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} fi if test "x$path" != "x$new_path"; then - with_freetype="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting with_freetype to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi # Save the first 10 bytes of this path to the storage, so fixpath can work. @@ -30925,54 +31424,187 @@ $as_echo "$as_me: Rewriting with_freetype to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) - path="$with_freetype" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of with_freetype, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of with_freetype, which resolves as \"$path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi # Use eval to expand a potential ~ eval path="$path" if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of with_freetype, which resolves as \"$path\", is not found." "$LINENO" 5 + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 fi - with_freetype="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" fi - FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib" - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then - FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" - fi - if test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" - fi - FREETYPE2_CFLAGS="-I$with_freetype/include" - if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then - FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" - fi - FREETYPE2_FOUND=yes - if test "x$FREETYPE2_FOUND" = xyes; then - # Verify that the directories exist - if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then - as_fn_error $? "Could not find the expected directories $with_freetype/lib and $with_freetype/include" "$LINENO" 5 - fi - # List the contents of the lib. - FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` - if test "x$FREETYPELIB" = x; then - as_fn_error $? "Could not find libfreetype.so nor freetype.dll in $with_freetype/lib" "$LINENO" 5 - fi - # Check one h-file - if ! test -s "$with_freetype/include/ft2build.h"; then - as_fn_error $? "Could not find $with_freetype/include/ft2build.h" "$LINENO" 5 - fi - fi + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" fi - if test "x$FREETYPE2_FOUND" = xno; then + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + if test "x$FOUND_FREETYPE" != xyes; then + as_fn_error $? "Can not find or use freetype at location given by --with-freetype" "$LINENO" 5 + fi + else + # User specified only one of lib or include. This is an error. + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-lib but not --with-freetype-include" >&5 +$as_echo "$as_me: User specified --with-freetype-lib but not --with-freetype-include" >&6;} + as_fn_error $? "Need both freetype lib and include paths. Consider using --with-freetype instead." "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: User specified --with-freetype-include but not --with-freetype-lib" >&5 +$as_echo "$as_me: User specified --with-freetype-include but not --with-freetype-lib" >&6;} + as_fn_error $? "Need both freetype lib and include paths. Consider using --with-freetype instead." "$LINENO" 5 + fi + fi + else + # User did not specify settings, but we need freetype. Try to locate it. + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype only on windows + if test "x$OPENJDK_TARGET_OS" = xwindows; then + BUNDLE_FREETYPE=yes + else + BUNDLE_FREETYPE=no + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check builddeps if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then @@ -31100,34 +31732,184 @@ $as_echo "$as_me: Downloading build dependency freetype2 from $with_builddeps_se if test "x$depdir" = x; then as_fn_error $? "Could not download build dependency freetype2" "$LINENO" 5 fi - FREETYPE2=$depdir + FREETYPE=$depdir if test "x$theroot" != x; then - FREETYPE2="$theroot" + FREETYPE="$theroot" fi if test "x$thecflags" != x; then - FREETYPE2_CFLAGS="$thecflags" + FREETYPE_CFLAGS="$thecflags" fi if test "x$thelibs" != x; then - FREETYPE2_LIBS="$thelibs" + FREETYPE_LIBS="$thelibs" fi - FREETYPE2_FOUND=yes - else FREETYPE2_FOUND=no + FOUND_FREETYPE=yes + else FOUND_FREETYPE=no fi - else FREETYPE2_FOUND=no + else FOUND_FREETYPE=no fi - USING_SYSTEM_FT_LIB=true + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$FOUND_FREETYPE" = xyes; then + if test "x$BUNDLE_FREETYPE" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using builddeps, but ignoring since we can not bundle that" >&5 +$as_echo "$as_me: Found freetype using builddeps, but ignoring since we can not bundle that" >&6;} + FOUND_FREETYPE=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5 +$as_echo_n "checking for freetype... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using builddeps)" >&5 +$as_echo "yes (using builddeps)" >&6; } + fi + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check modules using pkg-config, but only if we have it (ugly output results otherwise) + if test "x$PKG_CONFIG" != x; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE" >&5 +$as_echo_n "checking for FREETYPE... " >&6; } + +if test -n "$FREETYPE_CFLAGS"; then + pkg_cv_FREETYPE_CFLAGS="$FREETYPE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$FREETYPE_LIBS"; then + pkg_cv_FREETYPE_LIBS="$FREETYPE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 + ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FREETYPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "freetype2" 2>&1` + else + FREETYPE_PKG_ERRORS=`$PKG_CONFIG --print-errors "freetype2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$FREETYPE_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + FOUND_FREETYPE=no +elif test $pkg_failed = untried; then + FOUND_FREETYPE=no +else + FREETYPE_CFLAGS=$pkg_cv_FREETYPE_CFLAGS + FREETYPE_LIBS=$pkg_cv_FREETYPE_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + FOUND_FREETYPE=yes +fi + if test "x$FOUND_FREETYPE" = xyes; then + # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` + # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` + fi + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$BUNDLE_FREETYPE" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype using pkg-config, but ignoring since we can not bundle that" >&5 +$as_echo "$as_me: Found freetype using pkg-config, but ignoring since we can not bundle that" >&6;} + FOUND_FREETYPE=no + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype" >&5 +$as_echo_n "checking for freetype... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (using pkg-config)" >&5 +$as_echo "yes (using pkg-config)" >&6; } + fi + fi + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check in well-known locations + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" + + windows_path="$FREETYPE_BASE_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + FREETYPE_BASE_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + FREETYPE_BASE_DIR="$unix_path" + fi + + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi fi - if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPELOCATION="$PROGRAMFILES/GnuWin32" + fi + + if test "x$FOUND_FREETYPE" = xyes; then if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then # Input might be given as Windows format, start by converting to # unix format. - path="$FREETYPELOCATION" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" new_path=`$CYGPATH -u "$path"` # Cygwin tries to hide some aspects of the Windows file system, such that binaries are @@ -31139,9 +31921,9 @@ $as_echo "$as_me: Downloading build dependency freetype2 from $with_builddeps_se # It is also a way to make sure we got the proper file name for the real test later on. test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` if test "x$test_shortpath" = x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} - as_fn_error $? "Cannot locate the the path of FREETYPELOCATION" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 fi # Call helper function which possibly converts this using DOS-style short mode. @@ -31179,14 +31961,14 @@ $as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is if test "x$path" != "x$new_path"; then - FREETYPELOCATION="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then - path="$FREETYPELOCATION" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_colon=`$ECHO $path | $GREP ^.:` new_path="$path" if test "x$has_colon" = x; then @@ -31217,9 +31999,9 @@ $as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} fi if test "x$path" != "x$new_path"; then - FREETYPELOCATION="$new_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPELOCATION to \"$new_path\"" >&5 -$as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} fi # Save the first 10 bytes of this path to the storage, so fixpath can work. @@ -31227,242 +32009,2330 @@ $as_echo "$as_me: Rewriting FREETYPELOCATION to \"$new_path\"" >&6;} else # We're on a posix platform. Hooray! :) - path="$FREETYPELOCATION" + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" has_space=`$ECHO "$path" | $GREP " "` if test "x$has_space" != x; then - { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&5 -$as_echo "$as_me: The path of FREETYPELOCATION, which resolves as \"$path\", is invalid." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi # Use eval to expand a potential ~ eval path="$path" if test ! -f "$path" && test ! -d "$path"; then - as_fn_error $? "The path of FREETYPELOCATION, which resolves as \"$path\", is not found." "$LINENO" 5 + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 fi - FREETYPELOCATION="`cd "$path"; $THEPWDCMD -L`" + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard windows locations" >&5 -$as_echo_n "checking for freetype in some standard windows locations... " >&6; } - if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then - FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" - FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" - FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" - if ! test -s "$FREETYPE2_LIBS"; then - as_fn_error $? "Could not find $FREETYPE2_LIBS" "$LINENO" 5 - fi - if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then - as_fn_error $? "Could not find $FREETYPE2_LIB_PATH/freetype.dll" "$LINENO" 5 - fi - USING_SYSTEM_FT_LIB=true - FREETYPE2_FOUND=yes - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5 -$as_echo "$FREETYPE2_FOUND" >&6; } + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" fi - if test "x$FREETYPE2_FOUND" = xno; then + fi -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FREETYPE2" >&5 -$as_echo_n "checking for FREETYPE2... " >&6; } - -if test -n "$FREETYPE2_CFLAGS"; then - pkg_cv_FREETYPE2_CFLAGS="$FREETYPE2_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FREETYPE2_CFLAGS=`$PKG_CONFIG --cflags "freetype2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$FREETYPE2_LIBS"; then - pkg_cv_FREETYPE2_LIBS="$FREETYPE2_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"freetype2\""; } >&5 - ($PKG_CONFIG --exists --print-errors "freetype2") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_FREETYPE2_LIBS=`$PKG_CONFIG --libs "freetype2" 2>/dev/null` -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi -if test $pkg_failed = yes; then + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "freetype2" 2>&1` + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" + + windows_path="$FREETYPE_BASE_DIR" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + FREETYPE_BASE_DIR="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + FREETYPE_BASE_DIR="$unix_path" + fi + + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi else - FREETYPE2_PKG_ERRORS=`$PKG_CONFIG --print-errors "freetype2" 2>&1` + if test "x$SYS_ROOT" = "x/"; then + FREETYPE_ROOT= + else + FREETYPE_ROOT="$SYS_ROOT" + fi + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no fi - # Put the nasty error message in config.log where it belongs - echo "$FREETYPE2_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - FREETYPE2_FOUND=no -elif test $pkg_failed = untried; then - FREETYPE2_FOUND=no -else - FREETYPE2_CFLAGS=$pkg_cv_FREETYPE2_CFLAGS - FREETYPE2_LIBS=$pkg_cv_FREETYPE2_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - FREETYPE2_FOUND=yes -fi - # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` - USING_SYSTEM_FT_LIB=true - # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 - if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" fi fi - if test "x$FREETYPE2_FOUND" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype in some standard locations" >&5 -$as_echo_n "checking for freetype in some standard locations... " >&6; } + fi - if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" - DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" - fi - if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2" - DEFAULT_FREETYPE_LIBS="-lfreetype" - fi + if test "x$FOUND_FREETYPE" = xyes; then - PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LDFLAGS="$LDFLAGS" - CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" - LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then - #include - #include FT_FREETYPE_H - int main() { return 0; } + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi - # Yes, the default cflags and libs did the trick. - FREETYPE2_FOUND=yes - FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" - FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. -else - - FREETYPE2_FOUND=no - - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - CXXCFLAGS="$PREV_CXXFLAGS" - LDFLAGS="$PREV_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE2_FOUND" >&5 -$as_echo "$FREETYPE2_FOUND" >&6; } - USING_SYSTEM_FT_LIB=true + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" fi - if test "x$FREETYPE2_FOUND" = xno; then + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11" + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + else + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib/i386-linux-gnu" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + if test "x$FOUND_FREETYPE" != xyes; then + + POTENTIAL_FREETYPE_INCLUDE_PATH="$FREETYPE_BASE_DIR/include" + POTENTIAL_FREETYPE_LIB_PATH="$FREETYPE_BASE_DIR/lib32" + METHOD="well-known location" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + { $as_echo "$as_me:${as_lineno-$LINENO}: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&5 +$as_echo "$as_me: Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD" >&6;} + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location." >&6;} + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&5 +$as_echo "$as_me: Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location." >&6;} + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$POTENTIAL_FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of POTENTIAL_FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + POTENTIAL_FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting POTENTIAL_FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$POTENTIAL_FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of POTENTIAL_FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + POTENTIAL_FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype includes" >&5 +$as_echo_n "checking for freetype includes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_INCLUDE_PATH" >&5 +$as_echo "$FREETYPE_INCLUDE_PATH" >&6; } + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype libraries" >&5 +$as_echo_n "checking for freetype libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIB_PATH" >&5 +$as_echo "$FREETYPE_LIB_PATH" >&6; } + fi + + fi + fi + fi + fi + fi # end check in well-known locations + + if test "x$FOUND_FREETYPE" != xyes; then # Print a helpful message on how to acquire the necessary build dependency. - # freetype2 is the help tag: freetyp2, cups, pulse, alsa etc - MISSING_DEPENDENCY=freetype2 - PKGHANDLER_COMMAND= + # freetype is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=freetype - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi - as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 + as_fn_error $? "Could not find freetype! $HELP_MSG " "$LINENO" 5 + fi + fi # end user specified settings + + # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. + if test "x$FREETYPE_CFLAGS" = x; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$FREETYPE_INCLUDE_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of FREETYPE_INCLUDE_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$FREETYPE_INCLUDE_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + FREETYPE_INCLUDE_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_INCLUDE_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$FREETYPE_INCLUDE_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 fi - if test "x$OPENJDK_TARGET_OS" != xwindows; then - # AC_CHECK_LIB does not support use of cl.exe - PREV_LDFLAGS="$LDFLAGS" - LDFLAGS="$FREETYPE2_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Init_FreeType in -lfreetype" >&5 -$as_echo_n "checking for FT_Init_FreeType in -lfreetype... " >&6; } -if ${ac_cv_lib_freetype_FT_Init_FreeType+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lfreetype $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_INCLUDE_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + FREETYPE_INCLUDE_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" + else + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" + fi + fi + + if test "x$FREETYPE_LIBS" = x; then + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + + # Input might be given as Windows format, start by converting to + # unix format. + path="$FREETYPE_LIB_PATH" + new_path=`$CYGPATH -u "$path"` + + # Cygwin tries to hide some aspects of the Windows file system, such that binaries are + # named .exe but called without that suffix. Therefore, "foo" and "foo.exe" are considered + # the same file, most of the time (as in "test -f"). But not when running cygpath -s, then + # "foo.exe" is OK but "foo" is an error. + # + # This test is therefore slightly more accurate than "test -f" to check for file precense. + # It is also a way to make sure we got the proper file name for the real test later on. + test_shortpath=`$CYGPATH -s -m "$new_path" 2> /dev/null` + if test "x$test_shortpath" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Cannot locate the the path of FREETYPE_LIB_PATH" "$LINENO" 5 + fi + + # Call helper function which possibly converts this using DOS-style short mode. + # If so, the updated path is stored in $new_path. + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-._/a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + shortmode_path=`$CYGPATH -s -m -a "$input_path"` + path_after_shortmode=`$CYGPATH -u "$shortmode_path"` + if test "x$path_after_shortmode" != "x$input_to_shortpath"; then + # Going to short mode and back again did indeed matter. Since short mode is + # case insensitive, let's make it lowercase to improve readability. + shortmode_path=`$ECHO "$shortmode_path" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Now convert it back to Unix-stile (cygpath) + input_path=`$CYGPATH -u "$shortmode_path"` + new_path="$input_path" + fi + fi + + test_cygdrive_prefix=`$ECHO $input_path | $GREP ^/cygdrive/` + if test "x$test_cygdrive_prefix" = x; then + # As a simple fix, exclude /usr/bin since it's not a real path. + if test "x`$ECHO $new_path | $GREP ^/usr/bin/`" = x; then + # The path is in a Cygwin special directory (e.g. /home). We need this converted to + # a path prefixed by /cygdrive for fixpath to work. + new_path="$CYGWIN_ROOT_PATH$input_path" + fi + fi + + + if test "x$path" != "x$new_path"; then + FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + + path="$FREETYPE_LIB_PATH" + has_colon=`$ECHO $path | $GREP ^.:` + new_path="$path" + if test "x$has_colon" = x; then + # Not in mixed or Windows style, start by that. + new_path=`cmd //c echo $path` + fi + + + input_path="$new_path" + # Check if we need to convert this using DOS-style short mode. If the path + # contains just simple characters, use it. Otherwise (spaces, weird characters), + # take no chances and rewrite it. + # Note: m4 eats our [], so we need to use [ and ] instead. + has_forbidden_chars=`$ECHO "$input_path" | $GREP [^-_/:a-zA-Z0-9]` + if test "x$has_forbidden_chars" != x; then + # Now convert it to mixed DOS-style, short mode (no spaces, and / instead of \) + new_path=`cmd /c "for %A in (\"$input_path\") do @echo %~sA"|$TR \\\\\\\\ / | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + fi + + + windows_path="$new_path" + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + unix_path=`$CYGPATH -u "$windows_path"` + new_path="$unix_path" + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + unix_path=`$ECHO "$windows_path" | $SED -e 's,^\\(.\\):,/\\1,g' -e 's,\\\\,/,g'` + new_path="$unix_path" + fi + + if test "x$path" != "x$new_path"; then + FREETYPE_LIB_PATH="$new_path" + { $as_echo "$as_me:${as_lineno-$LINENO}: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&5 +$as_echo "$as_me: Rewriting FREETYPE_LIB_PATH to \"$new_path\"" >&6;} + fi + + # Save the first 10 bytes of this path to the storage, so fixpath can work. + all_fixpath_prefixes=("${all_fixpath_prefixes[@]}" "${new_path:0:10}") + + else + # We're on a posix platform. Hooray! :) + path="$FREETYPE_LIB_PATH" + has_space=`$ECHO "$path" | $GREP " "` + if test "x$has_space" != x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&5 +$as_echo "$as_me: The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is invalid." >&6;} + as_fn_error $? "Spaces are not allowed in this path." "$LINENO" 5 + fi + + # Use eval to expand a potential ~ + eval path="$path" + if test ! -f "$path" && test ! -d "$path"; then + as_fn_error $? "The path of FREETYPE_LIB_PATH, which resolves as \"$path\", is not found." "$LINENO" 5 + fi + + FREETYPE_LIB_PATH="`cd "$path"; $THEPWDCMD -L`" + fi + + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" + else + FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" + fi + fi + + # Try to compile it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can compile and link with freetype" >&5 +$as_echo_n "checking if we can compile and link with freetype... " >&6; } + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + PREV_CXXCFLAGS="$CXXFLAGS" + PREV_LDFLAGS="$LDFLAGS" + PREV_CXX="$CXX" + CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + LDFLAGS="$LDFLAGS $FREETYPE_LIBS" + CXX="$FIXPATH $CXX" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char FT_Init_FreeType (); -int -main () -{ -return FT_Init_FreeType (); - ; - return 0; -} + #include + #include FT_FREETYPE_H + int main () { + FT_Init_FreeType(NULL); + return 0; + } + _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_freetype_FT_Init_FreeType=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else - ac_cv_lib_freetype_FT_Init_FreeType=no + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: Could not compile and link with freetype. This might be a 32/64-bit mismatch." >&5 +$as_echo "$as_me: Could not compile and link with freetype. This might be a 32/64-bit mismatch." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS" >&5 +$as_echo "$as_me: Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS" >&6;} + + + # Print a helpful message on how to acquire the necessary build dependency. + # freetype is the help tag: freetype, cups, pulse, alsa etc + MISSING_DEPENDENCY=freetype + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= + + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi + fi + + + as_fn_error $? "Can not continue without freetype. $HELP_MSG" "$LINENO" 5 + + fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Init_FreeType" >&5 -$as_echo "$ac_cv_lib_freetype_FT_Init_FreeType" >&6; } -if test "x$ac_cv_lib_freetype_FT_Init_FreeType" = xyes; then : - FREETYPE2_FOUND=true -else - as_fn_error $? "Could not find freetype2! $HELP_MSG " "$LINENO" 5 -fi + CXXCFLAGS="$PREV_CXXFLAGS" + LDFLAGS="$PREV_LDFLAGS" + CXX="$PREV_CXX" + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - LDFLAGS="$PREV_LDFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should bundle freetype" >&5 +$as_echo_n "checking if we should bundle freetype... " >&6; } + if test "x$BUNDLE_FREETYPE" = xyes; then + FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" fi - fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUNDLE_FREETYPE" >&5 +$as_echo "$BUNDLE_FREETYPE" >&6; } + fi # end freetype needed @@ -31760,27 +34630,34 @@ done if test "x$ALSA_FOUND" = xno; then # Print a helpful message on how to acquire the necessary build dependency. - # alsa is the help tag: freetyp2, cups, pulse, alsa etc + # alsa is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=alsa - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi as_fn_error $? "Could not find alsa! $HELP_MSG " "$LINENO" 5 @@ -32508,65 +35385,6 @@ fi -# After we have toolchain and the paths to all libraries (needed by msys), we can compile the fixpath helper - - # When using cygwin or msys, we need a wrapper binary that renames - # /cygdrive/c/ arguments into c:/ arguments and peeks into - # @files and rewrites these too! This wrapper binary is - # called fixpath. - FIXPATH= - if test "x$OPENJDK_BUILD_OS" = xwindows; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath can be created" >&5 -$as_echo_n "checking if fixpath can be created... " >&6; } - FIXPATH_SRC="$SRC_ROOT/common/src/fixpath.c" - FIXPATH_BIN="$OUTPUT_ROOT/fixpath.exe" - if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin; then - FIXPATH_SRC=`$CYGPATH -m $FIXPATH_SRC` - FIXPATH_BIN=`$CYGPATH -m $FIXPATH_BIN` - # Important to keep the .exe suffix on Cygwin for Hotspot makefiles - FIXPATH="$OUTPUT_ROOT/fixpath.exe -c" - elif test "x$OPENJDK_BUILD_OS_ENV" = xwindows.msys; then - FIXPATH_SRC=`cmd //c echo $FIXPATH_SRC` - FIXPATH_BIN=`cmd //c echo $FIXPATH_BIN` - - # Take all collected prefixes and turn them into a -m/c/foo@/c/bar@... command line - # @ was chosen as separator to minimize risk of other tools messing around with it - all_unique_prefixes=`echo "${all_fixpath_prefixes[@]}" | tr ' ' '\n' | grep '^/./' | sort | uniq` - fixpath_argument_list=`echo $all_unique_prefixes | tr ' ' '@'` - - FIXPATH="$OUTPUT_ROOT/fixpath -m$fixpath_argument_list" - fi - rm -f $OUTPUT_ROOT/fixpath* - cd $OUTPUT_ROOT - $CC $FIXPATH_SRC -Fe$FIXPATH_BIN > $OUTPUT_ROOT/fixpath1.log 2>&1 - cd $CURDIR - - if test ! -x $OUTPUT_ROOT/fixpath.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $OUTPUT_ROOT/fixpath1.log - as_fn_error $? "Could not create $OUTPUT_ROOT/fixpath.exe" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fixpath.exe works" >&5 -$as_echo_n "checking if fixpath.exe works... " >&6; } - cd $OUTPUT_ROOT - $FIXPATH $CC $SRC_ROOT/common/src/fixpath.c -Fe$OUTPUT_ROOT/fixpath2.exe > $OUTPUT_ROOT/fixpath2.log 2>&1 - cd $CURDIR - if test ! -x $OUTPUT_ROOT/fixpath2.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - cat $OUTPUT_ROOT/fixpath2.log - as_fn_error $? "fixpath did not work!" "$LINENO" 5 - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - rm -f $OUTPUT_ROOT/fixpath?.??? $OUTPUT_ROOT/fixpath.obj - fi - - - ############################################################################### # @@ -34572,27 +37390,34 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh printf "$CCACHE_HELP_MSG\n" # Print a helpful message on how to acquire the necessary build dependency. - # ccache is the help tag: freetyp2, cups, pulse, alsa etc + # ccache is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=ccache - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi printf "$HELP_MSG\n" diff --git a/common/autoconf/help.m4 b/common/autoconf/help.m4 index c287af3cd1d..5cfcc6fcfc1 100644 --- a/common/autoconf/help.m4 +++ b/common/autoconf/help.m4 @@ -31,43 +31,76 @@ AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], [ # Print a helpful message on how to acquire the necessary build dependency. - # $1 is the help tag: freetyp2, cups, pulse, alsa etc + # $1 is the help tag: freetype, cups, pulse, alsa etc MISSING_DEPENDENCY=$1 - PKGHANDLER_COMMAND= - case $PKGHANDLER in - apt-get) - apt_help $MISSING_DEPENDENCY ;; - yum) - yum_help $MISSING_DEPENDENCY ;; - port) - port_help $MISSING_DEPENDENCY ;; - pkgutil) - pkgutil_help $MISSING_DEPENDENCY ;; - pkgadd) - pkgadd_help $MISSING_DEPENDENCY ;; - * ) - break ;; - esac + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= - if test "x$PKGHANDLER_COMMAND" != x; then - HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + * ) + break ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi fi ]) cygwin_help() { case $1 in unzip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P unzip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P unzip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; zip) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P zip" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P zip )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; make) - PKGHANDLER_COMMAND="cd && cmd /c setup -q -P make" ;; + PKGHANDLER_COMMAND="( cd && cmd /c setup -q -P make )" + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + ;; + freetype) + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + HELP_MSG="To install freetype, run: +wget \"http://gnuwin32.sourceforge.net/downlinks/freetype.php\" -O /tmp/freetype-setup.exe +chmod +x /tmp/freetype-setup.exe +/tmp/freetype-setup.exe +Follow GUI prompts, and install to default directory \"C:\Program Files (x86)\GnuWin32\". +After installation, locate lib/libfreetype.dll.a and make a copy with the name freetype.dll." + else + HELP_MSG="You need to build a 64-bit version of freetype. +This is not readily available. +You can find source code and build instructions on +http://www.freetype.org/ +If you put the resulting build in \"C:\Program Files\GnuWin32\", it will be found automatically." + fi + ;; * ) break ;; esac } +msys_help() { + PKGHANDLER_COMMAND="" +} + apt_help() { case $1 in devkit) @@ -78,7 +111,7 @@ apt_help() { PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; cups) PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; - freetype2) + freetype) PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; pulse) PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; @@ -101,7 +134,7 @@ yum_help() { PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; cups) PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; - freetype2) + freetype) PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; pulse) PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; diff --git a/common/autoconf/hotspot-spec.gmk.in b/common/autoconf/hotspot-spec.gmk.in index ffacc970373..b5a38d25c09 100644 --- a/common/autoconf/hotspot-spec.gmk.in +++ b/common/autoconf/hotspot-spec.gmk.in @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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 @@ -123,8 +123,7 @@ endif # Hotspot expects the variable ZIP_DEBUGINFO_FILES=1/0 and not true/false. ifeq ($(ZIP_DEBUGINFO_FILES)$(ENABLE_DEBUG_SYMBOLS), truetrue) ZIP_DEBUGINFO_FILES:=1 -endif -ifeq ($(ZIP_DEBUGINFO_FILES), false) +else ZIP_DEBUGINFO_FILES:=0 endif diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index 07e548ce8c6..126ab49c637 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -516,11 +516,11 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS], elif test "x$enable_debug_symbols" = "xno"; then ENABLE_DEBUG_SYMBOLS=false else - # default on macosx is false - if test "x$OPENJDK_TARGET_OS" = xmacosx; then - ENABLE_DEBUG_SYMBOLS=false - # Default is on if objcopy is found, otherwise off - elif test "x$OBJCOPY" != x || test "x$OPENJDK_TARGET_OS" = xwindows; then + # Default is on if objcopy is found + if test "x$OBJCOPY" != x; then + ENABLE_DEBUG_SYMBOLS=true + # MacOS X and Windows don't use objcopy but default is on for those OSes + elif test "x$OPENJDK_TARGET_OS" = xmacosx || test "x$OPENJDK_TARGET_OS" = xwindows; then ENABLE_DEBUG_SYMBOLS=true else ENABLE_DEBUG_SYMBOLS=false diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4 index 941d842d136..c41da30a70b 100644 --- a/common/autoconf/libraries.m4 +++ b/common/autoconf/libraries.m4 @@ -57,7 +57,6 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT], ALSA_NOT_NEEDED=yes PULSE_NOT_NEEDED=yes X11_NOT_NEEDED=yes - FREETYPE2_NOT_NEEDED=yes # If the java runtime framework is disabled, then we need X11. # This will be adjusted below. AC_MSG_RESULT([alsa pulse x11]) @@ -70,7 +69,7 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT], fi if test "x$OPENJDK" = "xfalse"; then - FREETYPE2_NOT_NEEDED=yes + FREETYPE_NOT_NEEDED=yes fi if test "x$SUPPORT_HEADFUL" = xno; then @@ -79,33 +78,17 @@ AC_DEFUN_ONCE([LIB_SETUP_INIT], ############################################################################### # - # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM - # that uses this API. + # Check for MacOSX support for OpenJDK. # - AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support], - [disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])], - [MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"]) - USE_MACOSX_RUNTIME_SUPPORT=no - AC_MSG_CHECKING([for explicit Java runtime support in the OS]) + BASIC_DEPRECATED_ARG_ENABLE(macosx-runtime-support, macosx_runtime_support) + + AC_MSG_CHECKING([for Mac OS X Java Framework]) if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then - if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then - MACOSX_RUNTIME_SUPPORT=yes - USE_MACOSX_RUNTIME_SUPPORT=yes - AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11]) - else - AC_MSG_RESULT([yes, but explicitly disabled.]) - fi + AC_MSG_RESULT([/System/Library/Frameworks/JavaVM.framework]) else AC_MSG_RESULT([no]) fi - - if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then - AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?]) - X11_NOT_NEEDED= - FREETYPE2_NOT_NEEDED= - AC_MSG_RESULT([alsa pulse]) - fi ]) AC_DEFUN_ONCE([LIB_SETUP_X11], @@ -153,16 +136,6 @@ AC_DEFUN_ONCE([LIB_SETUP_X11], AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG]) fi - # Some of the old makefiles require a setting of OPENWIN_HOME - # Since the X11R6 directory has disappeared on later Linuxes, - # we need to probe for it. - if test "x$OPENJDK_TARGET_OS" = xlinux; then - if test -d "$SYS_ROOT/usr/X11R6"; then - OPENWIN_HOME="$SYS_ROOT/usr/X11R6" - elif test -d "$SYS_ROOT/usr/include/X11"; then - OPENWIN_HOME="$SYS_ROOT/usr" - fi - fi if test "x$OPENJDK_TARGET_OS" = xsolaris; then OPENWIN_HOME="/usr/openwin" fi @@ -277,151 +250,279 @@ AC_DEFUN_ONCE([LIB_SETUP_CUPS], ]) +AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE], +[ + POTENTIAL_FREETYPE_INCLUDE_PATH="$1" + POTENTIAL_FREETYPE_LIB_PATH="$2" + METHOD="$3" + + # First check if the files exists. + if test -s "$POTENTIAL_FREETYPE_INCLUDE_PATH/ft2build.h"; then + # We found an arbitrary include file. That's a good sign. + AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD]) + FOUND_FREETYPE=yes + + FREETYPE_LIB_NAME="${LIBRARY_PREFIX}freetype${SHARED_LIBRARY_SUFFIX}" + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME"; then + AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/$FREETYPE_LIB_NAME. Ignoring location.]) + FOUND_FREETYPE=no + else + if test "x$OPENJDK_TARGET_OS" = xwindows; then + # On Windows, we will need both .lib and .dll file. + if ! test -s "$POTENTIAL_FREETYPE_LIB_PATH/freetype.lib"; then + AC_MSG_NOTICE([Could not find $POTENTIAL_FREETYPE_LIB_PATH/freetype.lib. Ignoring location.]) + FOUND_FREETYPE=no + fi + elif test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -s "$POTENTIAL_FREETYPE_LIB_PATH/amd64/$FREETYPE_LIB_NAME"; then + # On solaris-x86_86, default is (normally) PATH/lib/amd64. Update our guess! + POTENTIAL_FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH/amd64" + fi + fi + fi + + if test "x$FOUND_FREETYPE" = xyes; then + BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_INCLUDE_PATH) + BASIC_FIXUP_PATH(POTENTIAL_FREETYPE_LIB_PATH) + + FREETYPE_INCLUDE_PATH="$POTENTIAL_FREETYPE_INCLUDE_PATH" + AC_MSG_CHECKING([for freetype includes]) + AC_MSG_RESULT([$FREETYPE_INCLUDE_PATH]) + FREETYPE_LIB_PATH="$POTENTIAL_FREETYPE_LIB_PATH" + AC_MSG_CHECKING([for freetype libraries]) + AC_MSG_RESULT([$FREETYPE_LIB_PATH]) + fi +]) + AC_DEFUN_ONCE([LIB_SETUP_FREETYPE], [ ############################################################################### # - # The ubiquitous freetype2 library is used to render fonts. + # The ubiquitous freetype library is used to render fonts. # AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype], - [specify prefix directory for the freetype2 package + [specify prefix directory for the freetype package (expecting the libraries under PATH/lib and the headers under PATH/include)])]) + AC_ARG_WITH(freetype-include, [AS_HELP_STRING([--with-freetype-include], + [specify directory for the freetype include files])]) + AC_ARG_WITH(freetype-lib, [AS_HELP_STRING([--with-freetype-lib], + [specify directory for the freetype library])]) + AC_ARG_ENABLE(freetype-bundling, [AS_HELP_STRING([--disable-freetype-bundling], + [disable bundling of the freetype library with the build result @<:@enabled on Windows or when using --with-freetype, disabled otherwise@:>@])]) - # If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree - USING_SYSTEM_FT_LIB=false + FREETYPE_CFLAGS= + FREETYPE_LIBS= + FREETYPE_BUNDLE_LIB_PATH= - if test "x$FREETYPE2_NOT_NEEDED" = xyes; then + if test "x$FREETYPE_NOT_NEEDED" = xyes; then if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then AC_MSG_WARN([freetype not used, so --with-freetype is ignored]) fi - FREETYPE2_CFLAGS= - FREETYPE2_LIBS= - FREETYPE2_LIB_PATH= + if test "x$enable_freetype_bundling" != x; then + AC_MSG_WARN([freetype not used, so --enable-freetype-bundling is ignored]) + fi else - FREETYPE2_FOUND=no + # freetype is needed to build; go get it! - if test "x$with_freetype" != x; then - BASIC_FIXUP_PATH(with_freetype) - FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib" - if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64 && test -d "$with_freetype/lib/amd64"; then - FREETYPE2_LIBS="-L$with_freetype/lib/amd64 -lfreetype" - FREETYPE2_LIB_PATH="$with_freetype/lib/amd64" + BUNDLE_FREETYPE="$enable_freetype_bundling" + + if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then + # User has specified settings + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype + BUNDLE_FREETYPE=yes fi + + if test "x$with_freetype" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype/include" + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype/lib" + fi + + # Allow --with-freetype-lib and --with-freetype-include to override + if test "x$with_freetype_include" != x; then + POTENTIAL_FREETYPE_INCLUDE_PATH="$with_freetype_include" + fi + if test "x$with_freetype_lib" != x; then + POTENTIAL_FREETYPE_LIB_PATH="$with_freetype_lib" + fi + + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" != x && test "x$POTENTIAL_FREETYPE_LIB_PATH" != x; then + # Okay, we got it. Check that it works. + LIB_CHECK_POTENTIAL_FREETYPE($POTENTIAL_FREETYPE_INCLUDE_PATH, $POTENTIAL_FREETYPE_LIB_PATH, [--with-freetype]) + if test "x$FOUND_FREETYPE" != xyes; then + AC_MSG_ERROR([Can not find or use freetype at location given by --with-freetype]) + fi + else + # User specified only one of lib or include. This is an error. + if test "x$POTENTIAL_FREETYPE_INCLUDE_PATH" = x ; then + AC_MSG_NOTICE([User specified --with-freetype-lib but not --with-freetype-include]) + AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) + else + AC_MSG_NOTICE([User specified --with-freetype-include but not --with-freetype-lib]) + AC_MSG_ERROR([Need both freetype lib and include paths. Consider using --with-freetype instead.]) + fi + fi + else + # User did not specify settings, but we need freetype. Try to locate it. + + if test "x$BUNDLE_FREETYPE" = x; then + # If not specified, default is to bundle freetype only on windows + if test "x$OPENJDK_TARGET_OS" = xwindows; then + BUNDLE_FREETYPE=yes + else + BUNDLE_FREETYPE=no + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check builddeps + BDEPS_CHECK_MODULE(FREETYPE, freetype2, xxx, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$FOUND_FREETYPE" = xyes; then + if test "x$BUNDLE_FREETYPE" = xyes; then + AC_MSG_NOTICE([Found freetype using builddeps, but ignoring since we can not bundle that]) + FOUND_FREETYPE=no + else + AC_MSG_CHECKING([for freetype]) + AC_MSG_RESULT([yes (using builddeps)]) + fi + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check modules using pkg-config, but only if we have it (ugly output results otherwise) + if test "x$PKG_CONFIG" != x; then + PKG_CHECK_MODULES(FREETYPE, freetype2, [FOUND_FREETYPE=yes], [FOUND_FREETYPE=no]) + if test "x$FOUND_FREETYPE" = xyes; then + # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's/-lz//g'` + # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 + if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then + FREETYPE_LIBS=`$ECHO $FREETYPE_LIBS | $SED 's?/lib?/lib/amd64?g'` + fi + # BDEPS_CHECK_MODULE will set FREETYPE_CFLAGS and _LIBS, but we don't get a lib path for bundling. + if test "x$BUNDLE_FREETYPE" = xyes; then + AC_MSG_NOTICE([Found freetype using pkg-config, but ignoring since we can not bundle that]) + FOUND_FREETYPE=no + else + AC_MSG_CHECKING([for freetype]) + AC_MSG_RESULT([yes (using pkg-config)]) + fi + fi + fi + fi + + if test "x$FOUND_FREETYPE" != xyes; then + # Check in well-known locations + if test "x$OPENJDK_TARGET_OS" = xwindows; then + FREETYPE_BASE_DIR="$PROGRAMFILES/GnuWin32" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$ProgramW6432/GnuWin32" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR) + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + fi + else + if test "x$SYS_ROOT" = "x/"; then + FREETYPE_ROOT= + else + FREETYPE_ROOT="$SYS_ROOT" + fi + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr/X11" + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location]) + fi + + if test "x$FOUND_FREETYPE" != xyes; then + FREETYPE_BASE_DIR="$FREETYPE_ROOT/usr" + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/x86_64-linux-gnu], [well-known location]) + else + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib/i386-linux-gnu], [well-known location]) + if test "x$FOUND_FREETYPE" != xyes; then + LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location]) + fi + fi + fi + fi + fi # end check in well-known locations + + if test "x$FOUND_FREETYPE" != xyes; then + HELP_MSG_MISSING_DEPENDENCY([freetype]) + AC_MSG_ERROR([Could not find freetype! $HELP_MSG ]) + fi + fi # end user specified settings + + # Set FREETYPE_CFLAGS, _LIBS and _LIB_PATH from include and lib dir. + if test "x$FREETYPE_CFLAGS" = x; then + BASIC_FIXUP_PATH(FREETYPE_INCLUDE_PATH) + if test -d $FREETYPE_INCLUDE_PATH/freetype2/freetype; then + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH/freetype2 -I$FREETYPE_INCLUDE_PATH" + else + FREETYPE_CFLAGS="-I$FREETYPE_INCLUDE_PATH" + fi + fi + + if test "x$FREETYPE_LIBS" = x; then + BASIC_FIXUP_PATH(FREETYPE_LIB_PATH) if test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPE2_LIBS="$with_freetype/lib/freetype.lib" + FREETYPE_LIBS="$FREETYPE_LIB_PATH/freetype.lib" + else + FREETYPE_LIBS="-L$FREETYPE_LIB_PATH -lfreetype" fi - FREETYPE2_CFLAGS="-I$with_freetype/include" - if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then - FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include" - fi - FREETYPE2_FOUND=yes - if test "x$FREETYPE2_FOUND" = xyes; then - # Verify that the directories exist - if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then - AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include]) - fi - # List the contents of the lib. - FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null` - if test "x$FREETYPELIB" = x; then - AC_MSG_ERROR([Could not find libfreetype.so nor freetype.dll in $with_freetype/lib]) - fi - # Check one h-file - if ! test -s "$with_freetype/include/ft2build.h"; then - AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h]) - fi - fi - fi - if test "x$FREETYPE2_FOUND" = xno; then - BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) - USING_SYSTEM_FT_LIB=true - fi - if test "x$FREETYPE2_FOUND" = xno && test "x$OPENJDK_TARGET_OS" = xwindows; then - FREETYPELOCATION="$PROGRAMFILES/GnuWin32" - BASIC_FIXUP_PATH(FREETYPELOCATION) - AC_MSG_CHECKING([for freetype in some standard windows locations]) - if test -s "$FREETYPELOCATION/include/ft2build.h" && test -d "$FREETYPELOCATION/include/freetype2/freetype"; then - FREETYPE2_CFLAGS="-I$FREETYPELOCATION/include/freetype2 -I$FREETYPELOCATION/include" - FREETYPE2_LIBS="$FREETYPELOCATION/lib/freetype.lib" - FREETYPE2_LIB_PATH="$FREETYPELOCATION/lib" - if ! test -s "$FREETYPE2_LIBS"; then - AC_MSG_ERROR([Could not find $FREETYPE2_LIBS]) - fi - if ! test -s "$FREETYPE2_LIB_PATH/freetype.dll"; then - AC_MSG_ERROR([Could not find $FREETYPE2_LIB_PATH/freetype.dll]) - fi - USING_SYSTEM_FT_LIB=true - FREETYPE2_FOUND=yes - fi - AC_MSG_RESULT([$FREETYPE2_FOUND]) - fi - if test "x$FREETYPE2_FOUND" = xno; then - PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no]) - # On solaris, pkg_check adds -lz to freetype libs, which isn't necessary for us. - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's/-lz//g'` - USING_SYSTEM_FT_LIB=true - # 64-bit libs for Solaris x86 are installed in the amd64 subdirectory, change lib to lib/amd64 - if test "x$FREETYPE2_FOUND" = xyes && test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$OPENJDK_TARGET_CPU" = xx86_64; then - FREETYPE2_LIBS=`$ECHO $FREETYPE2_LIBS | $SED 's?/lib?/lib/amd64?g'` - fi - fi - if test "x$FREETYPE2_FOUND" = xno; then - AC_MSG_CHECKING([for freetype in some standard locations]) - - if test -s $SYS_ROOT/usr/X11/include/ft2build.h && test -d $SYS_ROOT/usr/X11/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/X11/include/freetype2 -I$SYS_ROOT/usr/X11/include" - DEFAULT_FREETYPE_LIBS="-L$SYS_ROOT/usr/X11/lib -lfreetype" - fi - if test -s $SYS_ROOT/usr/include/ft2build.h && test -d $SYS_ROOT/usr/include/freetype2/freetype; then - DEFAULT_FREETYPE_CFLAGS="-I$SYS_ROOT/usr/include/freetype2" - DEFAULT_FREETYPE_LIBS="-lfreetype" - fi - - PREV_CXXCFLAGS="$CXXFLAGS" - PREV_LDFLAGS="$LDFLAGS" - CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS" - LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS" - AC_LINK_IFELSE([AC_LANG_SOURCE([[ - #include - #include FT_FREETYPE_H - int main() { return 0; } - ]])], - [ - # Yes, the default cflags and libs did the trick. - FREETYPE2_FOUND=yes - FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS" - FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS" - ], - [ - FREETYPE2_FOUND=no - ] - ) - CXXCFLAGS="$PREV_CXXFLAGS" - LDFLAGS="$PREV_LDFLAGS" - AC_MSG_RESULT([$FREETYPE2_FOUND]) - USING_SYSTEM_FT_LIB=true - fi - if test "x$FREETYPE2_FOUND" = xno; then - HELP_MSG_MISSING_DEPENDENCY([freetype2]) - AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ]) fi - if test "x$OPENJDK_TARGET_OS" != xwindows; then - # AC_CHECK_LIB does not support use of cl.exe - PREV_LDFLAGS="$LDFLAGS" - LDFLAGS="$FREETYPE2_LIBS" - AC_CHECK_LIB(freetype, FT_Init_FreeType, - FREETYPE2_FOUND=true, - AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])) - LDFLAGS="$PREV_LDFLAGS" - fi - fi + # Try to compile it + AC_MSG_CHECKING([if we can compile and link with freetype]) + AC_LANG_PUSH(C++) + PREV_CXXCFLAGS="$CXXFLAGS" + PREV_LDFLAGS="$LDFLAGS" + PREV_CXX="$CXX" + CXXFLAGS="$CXXFLAGS $FREETYPE_CFLAGS" + LDFLAGS="$LDFLAGS $FREETYPE_LIBS" + CXX="$FIXPATH $CXX" + AC_LINK_IFELSE([AC_LANG_SOURCE([[ + #include + #include FT_FREETYPE_H + int main () { + FT_Init_FreeType(NULL); + return 0; + } + ]])], + [ + AC_MSG_RESULT([yes]) + ], + [ + AC_MSG_RESULT([no]) + AC_MSG_NOTICE([Could not compile and link with freetype. This might be a 32/64-bit mismatch.]) + AC_MSG_NOTICE([Using FREETYPE_CFLAGS=$FREETYPE_CFLAGS and FREETYPE_LIBS=$FREETYPE_LIBS]) + + HELP_MSG_MISSING_DEPENDENCY([freetype]) + + AC_MSG_ERROR([Can not continue without freetype. $HELP_MSG]) + ] + ) + CXXCFLAGS="$PREV_CXXFLAGS" + LDFLAGS="$PREV_LDFLAGS" + CXX="$PREV_CXX" + AC_LANG_POP(C++) - AC_SUBST(USING_SYSTEM_FT_LIB) - AC_SUBST(FREETYPE2_LIB_PATH) - AC_SUBST(FREETYPE2_CFLAGS) - AC_SUBST(FREETYPE2_LIBS) + AC_MSG_CHECKING([if we should bundle freetype]) + if test "x$BUNDLE_FREETYPE" = xyes; then + FREETYPE_BUNDLE_LIB_PATH="$FREETYPE_LIB_PATH" + fi + AC_MSG_RESULT([$BUNDLE_FREETYPE]) + + fi # end freetype needed + + AC_SUBST(FREETYPE_BUNDLE_LIB_PATH) + AC_SUBST(FREETYPE_CFLAGS) + AC_SUBST(FREETYPE_LIBS) ]) AC_DEFUN_ONCE([LIB_SETUP_ALSA], diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index 82f5197d194..a8cc664c178 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -268,13 +268,9 @@ SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@ # Number of parallel jobs to use for compilation JOBS?=@JOBS@ -# The OpenJDK makefiles should be changed to using the standard -# configure output ..._CFLAGS and ..._LIBS. In the meantime we -# extract the information here. -FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@ -FREETYPE2_LIBS:=@FREETYPE2_LIBS@ -FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@ -USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@ +FREETYPE_LIBS:=@FREETYPE_LIBS@ +FREETYPE_CFLAGS:=@FREETYPE_CFLAGS@ +FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@ CUPS_CFLAGS:=@CUPS_CFLAGS@ ALSA_LIBS:=@ALSA_LIBS@ ALSA_CFLAGS:=@ALSA_CFLAGS@ @@ -485,6 +481,7 @@ CUT:=@CUT@ DATE:=@DATE@ DIFF:=@DIFF@ DIRNAME:=@DIRNAME@ +DSYMUTIL:=@DSYMUTIL@ FIND:=@FIND@ FIND_DELETE:=@FIND_DELETE@ ECHO:=@ECHO@ diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index abddf994fac..5ad404d4fdd 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -176,6 +176,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_PATHS], [ if test "x$OPENJDK_TARGET_OS" = "xwindows"; then TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV + TOOLCHAIN_SETUP_MSVCR_DLL BASIC_DEPRECATED_ARG_WITH([dxsdk]) BASIC_DEPRECATED_ARG_WITH([dxsdk-lib]) BASIC_DEPRECATED_ARG_WITH([dxsdk-include]) diff --git a/common/autoconf/toolchain_windows.m4 b/common/autoconf/toolchain_windows.m4 index 814b429f58e..37da5554066 100644 --- a/common/autoconf/toolchain_windows.m4 +++ b/common/autoconf/toolchain_windows.m4 @@ -228,52 +228,113 @@ AC_DEFUN([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], AC_MSG_NOTICE([or run "bash.exe -l" from a VS command prompt and then run configure from there.]) AC_MSG_ERROR([Cannot continue]) fi +]) - AC_MSG_CHECKING([for msvcr100.dll]) +AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL], +[ + POSSIBLE_MSVCR_DLL="$1" + METHOD="$2" + if test -e "$POSSIBLE_MSVCR_DLL"; then + AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD]) + + # Need to check if the found msvcr is correct architecture + AC_MSG_CHECKING([found msvcr100.dll architecture]) + MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"` + if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then + CORRECT_MSVCR_ARCH=386 + else + CORRECT_MSVCR_ARCH=x86-64 + fi + if $ECHO "$MSVCR_DLL_FILETYPE" | $GREP $CORRECT_MSVCR_ARCH 2>&1 > /dev/null; then + AC_MSG_RESULT([ok]) + MSVCR_DLL="$POSSIBLE_MSVCR_DLL" + AC_MSG_CHECKING([for msvcr100.dll]) + AC_MSG_RESULT([$MSVCR_DLL]) + else + AC_MSG_RESULT([incorrect, ignoring]) + AC_MSG_NOTICE([The file type of the located msvcr100.dll is $MSVCR_DLL_FILETYPE]) + fi + fi +]) + +AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL], +[ AC_ARG_WITH(msvcr-dll, [AS_HELP_STRING([--with-msvcr-dll], [copy this msvcr100.dll into the built JDK (Windows only) @<:@probed@:>@])]) + if test "x$with_msvcr_dll" != x; then - MSVCR_DLL="$with_msvcr_dll" - else - if test "x$VCINSTALLDIR" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x64 | head --lines 1` - else - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1` - if test "x$MSVCR_DLL" = x; then - MSVCR_DLL=`find "$VCINSTALLDIR" -name msvcr100.dll | head --lines 1` - fi - fi - if test "x$MSVCR_DLL" != x; then - AC_MSG_NOTICE([msvcr100.dll found in VCINSTALLDIR: $VCINSTALLDIR]) - else - AC_MSG_NOTICE([Warning: msvcr100.dll not found in VCINSTALLDIR: $VCINSTALLDIR]) - fi - fi - # Try some fallback alternatives + # If given explicitely by user, do not probe. If not present, fail directly. + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$with_msvcr_dll], [--with-msvcr-dll]) if test "x$MSVCR_DLL" = x; then - # If visual studio express is installed, there is usually one with the debugger - if test "x$VS100COMNTOOLS" != x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then - MSVCR_DLL=`find "$VS100COMNTOOLS/.." -name msvcr100.dll | grep -i x64 | head --lines 1` - AC_MSG_NOTICE([msvcr100.dll found in $VS100COMNTOOLS..: $VS100COMNTOOLS..]) - fi - fi - fi - if test "x$MSVCR_DLL" = x; then - if test "x$OPENJDK_TARGET_CPU_BITS" = x32; then - # Fallback for 32bit builds, look in the windows directory. - if test -f "$SYSTEMROOT/system32/msvcr100.dll"; then - AC_MSG_NOTICE([msvcr100.dll found in $SYSTEMROOT/system32]) - MSVCR_DLL="$SYSTEMROOT/system32/msvcr100.dll" - fi - fi + AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll]) fi fi + if test "x$MSVCR_DLL" = x; then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Could not find msvcr100.dll !]) + # Probe: Using well-known location from Visual Studio 10.0 + if test "x$VCINSTALLDIR" != x; then + CYGWIN_VC_INSTALL_DIR="$VCINSTALLDIR" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VC_INSTALL_DIR) + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x64/Microsoft.VC100.CRT/msvcr100.dll" + else + POSSIBLE_MSVCR_DLL="$CYGWIN_VC_INSTALL_DIR/redist/x86/Microsoft.VC100.CRT/msvcr100.dll" + fi + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in VCINSTALLDIR]) + fi fi - AC_MSG_RESULT([$MSVCR_DLL]) + + if test "x$MSVCR_DLL" = x; then + # Probe: Check in the Boot JDK directory. + POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll" + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK]) + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Look in the Windows system32 directory + CYGWIN_SYSTEMROOT="$SYSTEMROOT" + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT) + POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll" + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in SYSTEMROOT]) + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: If Visual Studio Express is installed, there is usually one with the debugger + if test "x$VS100COMNTOOLS" != x; then + CYGWIN_VS_TOOLS_DIR="$VS100COMNTOOLS/.." + BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_VS_TOOLS_DIR) + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x64/ | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VS_TOOLS_DIR" -name msvcr100.dll | $GREP -i /x86/ | $HEAD --lines 1` + fi + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS]) + fi + fi + + if test "x$MSVCR_DLL" = x; then + # Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now. + # (This was the original behaviour; kept since it might turn up something) + if test "x$CYGWIN_VC_INSTALL_DIR" != x; then + if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x64 | $HEAD --lines 1` + else + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $GREP x86 | $GREP -v ia64 | $GREP -v x64 | $HEAD --lines 1` + if test "x$POSSIBLE_MSVCR_DLL" = x; then + # We're grasping at straws now... + POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1` + fi + fi + + TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR]) + fi + fi + + if test "x$MSVCR_DLL" = x; then + AC_MSG_CHECKING([for msvcr100.dll]) + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Could not find msvcr100.dll. Please specify using --with-msvcr-dll.]) + fi + BASIC_FIXUP_PATH(MSVCR_DLL) ]) diff --git a/common/bin/hgforest.sh b/common/bin/hgforest.sh index 1dc50390b42..2282c3239ca 100644 --- a/common/bin/hgforest.sh +++ b/common/bin/hgforest.sh @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2009, 2013, Oracle and/or its affiliates. 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 @@ -27,37 +27,11 @@ command="$1" pull_extra_base="$2" -# Python always buffers stdout significantly, thus we will not see any output from hg clone jdk, -# until a lot of time has passed! By passing -u to python, we get incremental updates -# on stdout. Much nicer. -whichhg="`which hg 2> /dev/null | grep -v '^no hg in'`" - -if [ "${whichhg}" = "" ] ; then - echo Cannot find hg! - exit 1 -fi - if [ "" = "$command" ] ; then echo No command to hg supplied! exit 1 fi -has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`" -python="" -bpython="" - -if [ "#!" = "$has_hash_bang" ] ; then - python="`head -n 1 ${whichhg} | cut -b 3- | sed -e 's/^[ \t]*//;s/[ \t]*$//'`" - bpython="`basename "$python"`" -fi - -if [ -x "$python" -a ! -d "$python" -a "`${python} -V 2>&1 | cut -f 1 -d ' '`" = "Python" ] ; then - hg="${python} -u ${whichhg}" -else - echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout. - hg="hg" -fi - # Clean out the temporary directory that stores the pid files. tmp=/tmp/forest.$$ rm -f -r ${tmp} @@ -171,7 +145,7 @@ for i in ${repos} ${repos_extra} ; do ( if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`" - echo ${hg} clone ${pull_newrepo} ${i} + echo hg clone ${pull_newrepo} ${i} path="`dirname ${i}`" if [ "${path}" != "." ] ; then times=0 @@ -184,10 +158,10 @@ for i in ${repos} ${repos_extra} ; do sleep 5 done fi - (${hg} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& + (PYTHONUNBUFFERED=true hg clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& else - echo "cd ${i} && ${hg} $*" - cd ${i} && (${hg} "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& + echo "cd ${i} && hg $*" + cd ${i} && (PYTHONUNBUFFERED=true hg "$@"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )& fi echo $! > ${tmp}/${repopidfile}.pid ) 2>&1 | sed -e "s@^@${reponame}: @") & diff --git a/common/makefiles/JavaCompilation.gmk b/common/makefiles/JavaCompilation.gmk index 69006c818a1..009aba801d9 100644 --- a/common/makefiles/JavaCompilation.gmk +++ b/common/makefiles/JavaCompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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 @@ -266,8 +266,12 @@ define SetupZipArchive endif # Find all files in the source tree. - $1_ALL_SRCS := $$(call not-containing,_the., \ - $$(filter $$(addprefix %,$$($1_SUFFIXES)),$$(call CacheFind,$$($1_FIND_LIST)))) + $1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST))) + + # Filter on suffixes if set + ifneq ($$($1_SUFFIXES),) + $1_ALL_SRCS := $$(filter $$(addprefix %, $$($1_SUFFIXES)), $$($1_ALL_SRCS)) + endif ifneq ($$($1_INCLUDES),) ifneq ($$($1_SUFFIXES),) @@ -371,8 +375,8 @@ define SetupJavaCompilation # INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file! # EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file! # "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found. - # JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac. - # Its only here until we cleanup some nasty source code pasta in the jdk. + # JAVAC_SOURCE_PATH_OVERRIDE:=This forces an explicit -sourcepath to javac instead of the complete + # source roots from SRC. This is sometimes needed when compiling specific subsets of the source. # HEADERS:=path to directory where all generated c-headers are written. # DEPENDS:=Extra dependecy $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) @@ -474,8 +478,8 @@ define SetupJavaCompilation endif # Prep the source paths. - ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),) - $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE))) + ifneq ($$($1_JAVAC_SOURCE_PATH_OVERRIDE),) + $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_JAVAC_SOURCE_PATH_OVERRIDE))) else $$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC))) endif diff --git a/common/makefiles/NativeCompilation.gmk b/common/makefiles/NativeCompilation.gmk index 94612fbf6a1..3c9a0a1a490 100644 --- a/common/makefiles/NativeCompilation.gmk +++ b/common/makefiles/NativeCompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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 @@ -435,31 +435,36 @@ define SetupNativeCompilation $(CP) $$< $$@ endif - ifeq ($(OPENJDK_TARGET_OS), solaris) - # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. - # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from - # empty section headers until a fixed $(OBJCOPY) is available. - # An empty section header has sh_addr == 0 and sh_size == 0. - # This problem has only been seen on Solaris X64, but we call this tool - # on all Solaris builds just in case. - # - # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. - # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) - $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< - else # not solaris - $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< - endif # Touch to not retrigger rule on rebuild + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) + # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. + # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from + # empty section headers until a fixed $(OBJCOPY) is available. + # An empty section header has sh_addr == 0 and sh_size == 0. + # This problem has only been seen on Solaris X64, but we call this tool + # on all Solaris builds just in case. + # + # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. + # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) + $(RM) $$@ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris + $$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) + $(RM) $$@ + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif # Touch to not retrigger rule on rebuild $(TOUCH) $$@ + endif # !windows + endif # !macosx ifeq ($(ZIP_DEBUGINFO_FILES), true) + ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz ifeq ($(OPENJDK_TARGET_OS), windows) @@ -472,11 +477,12 @@ define SetupNativeCompilation $(CD) $$($1_OBJECT_DIR) \ && $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo endif + endif # no MacOS X support yet else ifeq ($(OPENJDK_TARGET_OS), windows) $1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \ $$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb - else + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files $1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo endif endif @@ -513,31 +519,36 @@ define SetupNativeCompilation $(CP) $$< $$@ endif - ifeq ($(OPENJDK_TARGET_OS), solaris) - # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. - # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from - # empty section headers until a fixed $(OBJCOPY) is available. - # An empty section header has sh_addr == 0 and sh_size == 0. - # This problem has only been seen on Solaris X64, but we call this tool - # on all Solaris builds just in case. - # - # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. - # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) - $(RM) $$@ - $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< - else # not solaris - $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) - $(RM) $$@ - $(OBJCOPY) --only-keep-debug $$< $$@ - $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< - endif - $(TOUCH) $$@ + ifneq ($(OPENJDK_TARGET_OS), macosx) # OBJCOPY is not used on MacOS X + ifneq ($(OPENJDK_TARGET_OS), windows) # nor on Windows + ifeq ($(OPENJDK_TARGET_OS), solaris) + # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. + # Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from + # empty section headers until a fixed $(OBJCOPY) is available. + # An empty section header has sh_addr == 0 and sh_size == 0. + # This problem has only been seen on Solaris X64, but we call this tool + # on all Solaris builds just in case. + # + # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. + # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK) + $(RM) $$@ + $(FIX_EMPTY_SEC_HDR_FLAGS) $(LOG_INFO) $$< + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $(LOG_INFO) $$(@F) $$< + else # not solaris + $$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) + $(RM) $$@ + $(OBJCOPY) --only-keep-debug $$< $$@ + $(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$< + endif + $(TOUCH) $$@ + endif # !windows + endif # !macosx ifeq ($(ZIP_DEBUGINFO_FILES), true) + ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz ifeq ($(OPENJDK_TARGET_OS), windows) @@ -550,11 +561,12 @@ define SetupNativeCompilation $(CD) $$($1_OBJECT_DIR) \ && $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo endif + endif # no MacOS X support yet else ifeq ($(OPENJDK_TARGET_OS), windows) $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \ $$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb - else + else ifneq ($(OPENJDK_TARGET_OS), macosx) # MacOS X does not use .debuginfo files $1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo endif endif diff --git a/common/makefiles/RMICompilation.gmk b/common/makefiles/RMICompilation.gmk index f994a7dccf2..2c87b70441b 100644 --- a/common/makefiles/RMICompilation.gmk +++ b/common/makefiles/RMICompilation.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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 @@ -38,7 +38,7 @@ define SetupRMICompilation $(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk)) - $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic + $1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/_the.$1_rmic.generated $1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES)) $1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH))) @@ -60,11 +60,11 @@ define SetupRMICompilation ifneq (,$$($1_RUN_IIOP)) $1_TARGETS += $$($1_TIE_FILES) - $1_ARGS += -iiop + $1_ARGS += -iiop -emitPermissionCheck endif ifneq (,$$($1_RUN_IIOP_STDPKG)) $1_TARGETS += $$($1_TIE_STDPKG_FILES) - $1_ARGS2 := -iiop -standardPackage + $1_ARGS2 := -iiop -emitPermissionCheck -standardPackage endif ifneq (,$$($1_KEEP_GENERATED)) @@ -88,10 +88,9 @@ define SetupRMICompilation $(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \ -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ fi; + $(TOUCH) $$@ - $1 := $$($1_TARGETS) + $1 := $$($1_TARGETS) $$($1_DEP_FILE) - # By marking as secondary, this "touch" file doesn't need to be touched and will never exist. - .SECONDARY: $$($1_DEP_FILE) endef diff --git a/corba/.hgtags b/corba/.hgtags index 8db624575ae..3b352004341 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -233,3 +233,4 @@ a4bb3b4500164748a9c33b2283cfda76d89f25ab jdk8-b108 428428cf5e06163322144cfb5367e1faa86acf20 jdk8-b109 3d2b7ce93c5c2e3db748f29c3d29620a8b3b748a jdk8-b110 85c1c94e723582f9a1dd0251502c42b73d6deea7 jdk8-b111 +43cec76d1d62587a07af07e2d9bec93aba2a506b jdk8-b112 diff --git a/corba/make/jprt.properties b/corba/make/jprt.properties index b03c53ca656..5dfce3c118c 100644 --- a/corba/make/jprt.properties +++ b/corba/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ diff --git a/corba/makefiles/BuildCorba.gmk b/corba/makefiles/BuildCorba.gmk index 5f2d6257166..3190ce899cf 100644 --- a/corba/makefiles/BuildCorba.gmk +++ b/corba/makefiles/BuildCorba.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2007, 2013, Oracle and/or its affiliates. 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 @@ -45,7 +45,9 @@ DISABLE_CORBA_WARNINGS := -Xlint:all,-deprecation,-unchecked,-serial,-fallthroug $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \ JVM := $(JAVA), \ JAVAC := $(NEW_JAVAC), \ - FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_CORBA_WARNINGS), \ + FLAGS := $(BOOT_JDK_SOURCETARGET) \ + -bootclasspath "$(BOOT_RTJAR)$(PATH_SEP)$(BOOT_TOOLSJAR)" \ + $(DISABLE_CORBA_WARNINGS), \ SERVER_DIR := $(SJAVAC_SERVER_DIR), \ SERVER_JVM := $(SJAVAC_SERVER_JAVA))) @@ -183,6 +185,15 @@ ifeq ($(LOGWRAPPERS_ARE_CREATED), yes) COPY := .prp LogStrings.properties, \ BIN := $(CORBA_OUTPUTDIR)/classes)) + $(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_CORBA, \ + SETUP := GENERATE_OLDBYTECODE, \ + SRC := $(BUILD_CORBA_SRC), \ + EXCLUDES := $(BUILD_CORBA_EXCLUDES), \ + EXCLUDE_FILES := $(BUILD_CORBA_EXCLUDE_FILES), \ + COPY := $(BUILD_CORBA_COPY), \ + BIN := $(CORBA_OUTPUTDIR)/btclasses/corba_classes, \ + JAR := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar)) + # Separate src.zip call to include sources that were excluded in the build to # mimic behavior in old build system. $(eval $(call SetupZipArchive,ARCHIVE_BUILD_CORBA, \ @@ -241,6 +252,7 @@ ifeq ($(LOGWRAPPERS_ARE_CREATED), yes) all: $(CORBA_OUTPUTDIR)/btjars/stripproperties.jar \ $(CORBA_OUTPUTDIR)/btjars/idlj.jar \ $(CORBA_OUTPUTDIR)/btjars/logutil.jar \ + $(CORBA_OUTPUTDIR)/btjars/btcorba.jar \ $(CORBA_OUTPUTDIR)/dist/lib/classes.jar \ $(CORBA_OUTPUTDIR)/dist/lib/src.zip \ $(CORBA_OUTPUTDIR)/dist/lib/bin.zip diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java index dfe6581cc11..86a47992a72 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/IDLNameTranslatorImpl.java @@ -905,28 +905,4 @@ public class IDLNameTranslatorImpl implements IDLNameTranslator { return contents.toString(); } - - public static void main(String[] args) { - - Class remoteInterface = java.rmi.Remote.class; - - if( args.length > 0 ) { - String className = args[0]; - try { - remoteInterface = Class.forName(className); - } catch(Exception e) { - e.printStackTrace(); - System.exit(-1); - } - } - - System.out.println("Building name translation for " + remoteInterface); - try { - IDLNameTranslator nameTranslator = - IDLNameTranslatorImpl.get(remoteInterface); - System.out.println(nameTranslator); - } catch(IllegalStateException ise) { - ise.printStackTrace(); - } - } } diff --git a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java index 37a5968d87d..076ed1929ea 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/presentation/rmi/InvocationHandlerFactoryImpl.java @@ -43,6 +43,8 @@ import com.sun.corba.se.spi.orbutil.proxy.InvocationHandlerFactory ; import com.sun.corba.se.spi.orbutil.proxy.DelegateInvocationHandlerImpl ; import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandler ; import com.sun.corba.se.spi.orbutil.proxy.CompositeInvocationHandlerImpl ; +import java.security.AccessController; +import java.security.PrivilegedAction; public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory { @@ -114,24 +116,32 @@ public class InvocationHandlerFactoryImpl implements InvocationHandlerFactory // which extends org.omg.CORBA.Object. This handler delegates all // calls directly to a DynamicStubImpl, which extends // org.omg.CORBA.portable.ObjectImpl. - InvocationHandler dynamicStubHandler = + final InvocationHandler dynamicStubHandler = DelegateInvocationHandlerImpl.create( stub ) ; // Create an invocation handler that handles any remote interface // methods. - InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl( + final InvocationHandler stubMethodHandler = new StubInvocationHandlerImpl( pm, classData, stub ) ; // Create a composite handler that handles the DynamicStub interface // as well as the remote interfaces. final CompositeInvocationHandler handler = new CustomCompositeInvocationHandlerImpl( stub ) ; + + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { handler.addInvocationHandler( DynamicStub.class, dynamicStubHandler ) ; handler.addInvocationHandler( org.omg.CORBA.Object.class, dynamicStubHandler ) ; handler.addInvocationHandler( Object.class, dynamicStubHandler ) ; + return null; + } + }); + // If the method passed to invoke is not from DynamicStub or its superclasses, // it must be from an implemented interface, so we just handle diff --git a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java index 7bd98805ab7..054071b7d8b 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/impl/transport/SelectorImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. 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 @@ -55,7 +55,7 @@ import com.sun.corba.se.impl.orbutil.ORBUtility; /** * @author Harold Carr */ -public class SelectorImpl +class SelectorImpl extends Thread implements diff --git a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java index fb81ceee29c..91aacd5afae 100644 --- a/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java +++ b/corba/src/share/classes/com/sun/corba/se/spi/orbutil/proxy/CompositeInvocationHandlerImpl.java @@ -36,6 +36,7 @@ import java.lang.reflect.InvocationHandler ; import com.sun.corba.se.spi.logging.CORBALogDomains ; import com.sun.corba.se.impl.logging.ORBUtilSystemException ; +import com.sun.corba.se.impl.presentation.rmi.DynamicAccessPermission; public class CompositeInvocationHandlerImpl implements CompositeInvocationHandler @@ -46,11 +47,13 @@ public class CompositeInvocationHandlerImpl implements public void addInvocationHandler( Class interf, InvocationHandler handler ) { + checkAccess(); classToInvocationHandler.put( interf, handler ) ; } public void setDefaultHandler( InvocationHandler handler ) { + checkAccess(); defaultHandler = handler ; } @@ -78,4 +81,12 @@ public class CompositeInvocationHandlerImpl implements return handler.invoke( proxy, method, args ) ; } + + private static final DynamicAccessPermission perm = new DynamicAccessPermission("access"); + private void checkAccess() { + final SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(perm); +} + } } diff --git a/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java b/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java index aa3c6bea2f5..0d41c1edb90 100644 --- a/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java +++ b/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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 @@ -34,6 +34,9 @@ package sun.rmi.rmic.iiop; import java.io.File; import java.io.IOException; +import java.io.SerializablePermission; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.Vector; import java.util.Hashtable; import java.util.Enumeration; @@ -49,6 +52,7 @@ import com.sun.corba.se.impl.util.Utility; import com.sun.corba.se.impl.util.PackagePrefixChecker; import sun.rmi.rmic.Main; + /** * An IIOP stub/tie generator for rmic. * @@ -78,6 +82,7 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { protected boolean castArray = false; protected Hashtable transactionalObjects = new Hashtable() ; protected boolean POATie = false ; + protected boolean emitPermissionCheck = false; /** * Default constructor for Main to use. @@ -193,6 +198,9 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { } else if (argv[i].equals("-standardPackage")) { standardPackage = true; argv[i] = null; + } else if (argv[i].equals("-emitPermissionCheck")) { + emitPermissionCheck = true; + argv[i] = null; } else if (arg.equals("-xstubbase")) { argv[i] = null; if (++i < argv.length && argv[i] != null && !argv[i].startsWith("-")) { @@ -390,9 +398,22 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { writePackageAndImports(p); +// generate +// import java.security.AccessController; +// import java.security.PrivilegedAction; +// import java.io.SerializablePermission; + if (emitPermissionCheck) { + p.pln("import java.security.AccessController;"); + p.pln("import java.security.PrivilegedAction;"); + p.pln("import java.io.SerializablePermission;"); + p.pln(); + p.pln(); + } + // Declare the stub class; implement all remote interfaces. p.p("public class " + currentClass); + p.p(" extends " + getName(stubBaseClass)); p.p(" implements "); if (remoteInterfaces.length > 0) { @@ -422,6 +443,57 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { writeIds( p, theType, false ); p.pln(); + if (emitPermissionCheck) { + + // produce the following generated code for example + // private static Void checkPermission() { + // SecurityManager sm = System.getSecurityManager(); + // if (sm != null) { + // sm.checkPermission(new SerializablePermission( + // "enableSubclassImplementation")); // testing + // } + // return null; + // } + // + // private _XXXXX_Stub(Void ignore) { + // } + // + // public _XXXXX_Stub() { + // this(checkPermission()); + // } + // + // where XXXXX is the name of the remote interface + + p.pln(); + p.plnI("private static Void checkPermission() {"); + p.plnI("SecurityManager sm = System.getSecurityManager();"); + p.pln("if (sm != null) {"); + p.pI(); + p.plnI("sm.checkPermission(new SerializablePermission("); + p.plnI("\"enableSubclassImplementation\"));"); + p.pO(); + p.pO(); + p.pOln("}"); + p.pln("return null;"); + p.pO(); + p.pOln("}"); + p.pln(); + p.pO(); + + p.pI(); + p.pln("private " + currentClass + "(Void ignore) { }"); + p.pln(); + + p.plnI("public " + currentClass + "() { "); + p.pln("this(checkPermission());"); + p.pOln("}"); + p.pln(); + } + + if (!emitPermissionCheck) { + p.pI(); + } + // Write the _ids() method... p.plnI("public String[] _ids() { "); @@ -815,7 +887,6 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator { CompoundType theType) throws IOException { // Wtite the method declaration and opening brace... - String methodName = method.getName(); String methodIDLName = method.getIDLName(); diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 75a05fd42c4..f794add23e0 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -387,3 +387,5 @@ f6962730bbde82f279a0ae3a1c14bc5e58096c6e jdk8-b111 4a845c7a463844cead9e1e1641d6bcfb8a77f1c7 hs25-b54 0ed9a90f45e1b392c671005f9ee22ce1acf02984 jdk8-b112 23b8db5ea31d3079f1326afde4cd5c67b1dac49c hs25-b55 +4589b398ab03aba6a5da8c06ff53603488d1b8f4 jdk8-b113 +82a9cdbf683e374a76f2009352de53e16bed5a91 hs25-b56 diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version index 95f420164ac..69d9e8e9e59 100644 --- a/hotspot/make/hotspot_version +++ b/hotspot/make/hotspot_version @@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013 HS_MAJOR_VER=25 HS_MINOR_VER=0 -HS_BUILD_NUMBER=56 +HS_BUILD_NUMBER=57 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff --git a/hotspot/make/windows/makefiles/compile.make b/hotspot/make/windows/makefiles/compile.make index 80d84c6b794..9da2742335e 100644 --- a/hotspot/make/windows/makefiles/compile.make +++ b/hotspot/make/windows/makefiles/compile.make @@ -181,6 +181,7 @@ DEBUG_OPT_OPTION = /Od PRODUCT_OPT_OPTION = /O2 /Oy- FASTDEBUG_OPT_OPTION = /O2 /Oy- DEBUG_OPT_OPTION = /Od +SAFESEH_FLAG = /SAFESEH !endif !if "$(COMPILER_NAME)" == "VS2005" @@ -199,6 +200,7 @@ LD_FLAGS = /manifest $(LD_FLAGS) $(BUFFEROVERFLOWLIB) !if "x$(MT)" == "x" MT=mt.exe !endif +SAFESEH_FLAG = /SAFESEH !endif !if "$(COMPILER_NAME)" == "VS2008" @@ -213,6 +215,7 @@ MP_FLAG = /MP !if "x$(MT)" == "x" MT=mt.exe !endif +SAFESEH_FLAG = /SAFESEH !endif !if "$(COMPILER_NAME)" == "VS2010" @@ -244,9 +247,11 @@ MP_FLAG = /MP !if "x$(MT)" == "x" MT=mt.exe !endif -!if "$(BUILDARCH)" == "i486" -LD_FLAGS = /SAFESEH $(LD_FLAGS) +SAFESEH_FLAG = /SAFESEH !endif + +!if "$(BUILDARCH)" == "i486" +LD_FLAGS = $(SAFESEH_FLAG) $(LD_FLAGS) !endif CXX_FLAGS = $(CXX_FLAGS) $(MP_FLAG) diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make index c04e3630937..5b5cc2d723c 100644 --- a/hotspot/make/windows/makefiles/sa.make +++ b/hotspot/make/windows/makefiles/sa.make @@ -110,6 +110,9 @@ SA_LFLAGS = $(SA_LD_FLAGS) -nologo -subsystem:console -machine:$(MACHINE) !if "$(ENABLE_FULL_DEBUG_SYMBOLS)" == "1" SA_LFLAGS = $(SA_LFLAGS) -map -debug !endif +!if "$(BUILDARCH)" == "i486" +SA_LFLAGS = $(SAFESEH_FLAG) $(SA_LFLAGS) +!endif SA_CFLAGS = $(SA_CFLAGS) $(MP_FLAG) diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index 6817f573db3..1774ac18284 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -2197,8 +2197,8 @@ methodHandle ClassFileParser::parse_method(bool is_interface, } if (lvt_cnt == max_lvt_cnt) { max_lvt_cnt <<= 1; - REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt); - REALLOC_RESOURCE_ARRAY(u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt); + localvariable_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_table_length, lvt_cnt, max_lvt_cnt); + localvariable_table_start = REALLOC_RESOURCE_ARRAY(u2*, localvariable_table_start, lvt_cnt, max_lvt_cnt); } localvariable_table_start[lvt_cnt] = parse_localvariable_table(code_length, @@ -2226,8 +2226,8 @@ methodHandle ClassFileParser::parse_method(bool is_interface, // Parse local variable type table if (lvtt_cnt == max_lvtt_cnt) { max_lvtt_cnt <<= 1; - REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt); - REALLOC_RESOURCE_ARRAY(u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt); + localvariable_type_table_length = REALLOC_RESOURCE_ARRAY(u2, localvariable_type_table_length, lvtt_cnt, max_lvtt_cnt); + localvariable_type_table_start = REALLOC_RESOURCE_ARRAY(u2*, localvariable_type_table_start, lvtt_cnt, max_lvtt_cnt); } localvariable_type_table_start[lvtt_cnt] = parse_localvariable_table(code_length, @@ -4483,9 +4483,8 @@ void ClassFileParser::check_final_method_override(instanceKlassHandle this_klass for (int index = 0; index < num_methods; index++) { Method* m = methods->at(index); - // skip private, static and methods - if ((!m->is_private()) && - (!m->is_static()) && + // skip static and methods + if ((!m->is_static()) && (m->name() != vmSymbols::object_initializer_name())) { Symbol* name = m->name(); diff --git a/hotspot/src/share/vm/services/diagnosticCommand.cpp b/hotspot/src/share/vm/services/diagnosticCommand.cpp index 8e6b547128f..71b552801aa 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.cpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.cpp @@ -48,7 +48,7 @@ void DCmdRegistrant::register_dcmds(){ DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #if INCLUDE_SERVICES // Heap dumping/inspection supported - DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); + DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(DCmd_Source_Internal | DCmd_Source_AttachAPI, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); DCmdFactory::register_DCmdFactory(new DCmdFactoryImpl(full_export, true, false)); #endif // INCLUDE_SERVICES diff --git a/jaxp/.hgtags b/jaxp/.hgtags index fb2959bf0db..7621bc5f5a1 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -233,3 +233,4 @@ d6a32e3831aab20a9a3bc78cdc0a60aaad725c6c jdk8-b107 02bfab2aa93899e0f02584f1e85537485a196553 jdk8-b109 4c84c5b447b09aff27f3b72667ab3a5401e85968 jdk8-b110 17ee0d3e97fdb412e48f14d87f504946a708f846 jdk8-b111 +c1f9158fbb9c2da50f6946fffd974e8236e08447 jdk8-b112 diff --git a/jaxp/make/jprt.properties b/jaxp/make/jprt.properties index b03c53ca656..5dfce3c118c 100644 --- a/jaxp/make/jprt.properties +++ b/jaxp/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java index ce50626a612..f4a80afacfe 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/XalanConstants.java @@ -39,6 +39,116 @@ public final class XalanConstants { // // Constants // + //Xerces security manager + public static final String SECURITY_MANAGER = + "http://apache.org/xml/properties/security-manager"; + + // + // Implementation limits: API properties + // + /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ + public static final String ORACLE_JAXP_PROPERTY_PREFIX = + "http://www.oracle.com/xml/jaxp/properties/"; + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String JDK_ENTITY_EXPANSION_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String JDK_MAX_OCCUR_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String JDK_XML_NAME_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit"; + /** + * JDK property indicating whether the parser shall print out entity + * count information + * Value: a string "yes" means print, "no" or any other string means not. + */ + public static final String JDK_ENTITY_COUNT_INFO = + ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo"; + + // + // Implementation limits: corresponding System Properties of the above + // API properties + // + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit"; + + //legacy System Properties + public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; + public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; + public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; + + /** + * A string "yes" that can be used for properties such as getEntityCountInfo + */ + public static final String JDK_YES = "yes"; + // Oracle Feature: /** *

Use Service Mechanism

@@ -51,21 +161,16 @@ public final class XalanConstants { *
  • * {@code false} instruct an object to skip service mechanism and * use the default implementation for that service. - *
  • - * - */ - + * + * + */ public static final String ORACLE_FEATURE_SERVICE_MECHANISM = "http://www.oracle.com/feature/use-service-mechanism"; - /** Oracle JAXP property prefix ("http://www.oracle.com/xml/jaxp/properties/"). */ - public static final String ORACLE_JAXP_PROPERTY_PREFIX = - "http://www.oracle.com/xml/jaxp/properties/"; //System Properties corresponding to ACCESS_EXTERNAL_* properties public static final String SP_ACCESS_EXTERNAL_STYLESHEET = "javax.xml.accessExternalStylesheet"; public static final String SP_ACCESS_EXTERNAL_DTD = "javax.xml.accessExternalDTD"; - //all access keyword public static final String ACCESS_EXTERNAL_ALL = "all"; diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java index aea4fffa668..1a85fc3ba9b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources.java @@ -471,7 +471,13 @@ public class XSLTErrorResources extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java index 40a5c714b03..c9cea1d299c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_de.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_de extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_de extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java index 9937fe6b51d..7294a36feeb 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_es.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_es extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_es extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java index 9dc7f691a88..1748506a255 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_fr.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_fr extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_fr extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java index 2d7351cf4d0..d25eb67d962 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_it.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_it extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_it extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java index e5c25673227..50028e76907 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ja.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_ja extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_ja extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java index 36203fb8f0f..d4b9b32b3b3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_ko.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_ko extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_ko extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java index ae6f6c7b312..b79cfabe162 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_pt_BR.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java index 999092d231c..53e943cce24 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_sv.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_sv extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_sv extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java index c42b6f3a6f4..3c4544056ec 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_CN.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java index 317ee2013e7..a842dfa8020 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/res/XSLTErrorResources_zh_TW.java @@ -471,7 +471,13 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle // Error messages... - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /** Error message ID that has a null message, but takes in a single object. */ {"ER0000" , "{0}" }, @@ -1412,13 +1418,6 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle }; - /** Get the lookup table for error messages. - * - * @return The int to message lookup table. - */ - public Object[][] getContents() - { - return _contents; } // ================= INFRASTRUCTURE ====================== diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java new file mode 100644 index 00000000000..99a8e2d5f69 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityManager.java @@ -0,0 +1,449 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package com.sun.org.apache.xalan.internal.utils; + +import com.sun.org.apache.xalan.internal.XalanConstants; + + +/** + * This class is not the same as that in Xerces. It is used to manage the + * state of corresponding Xerces properties and pass the values over to + * the Xerces Security Manager. + * + * @author Joe Wang Oracle Corp. + * + */ +public final class XMLSecurityManager { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + + DEFAULT("default"), FSP("FEATURE_SECURE_PROCESSING"), + JAXPDOTPROPERTIES("jaxp.properties"), SYSTEMPROPERTY("system property"), + APIPROPERTY("property"); + + final String literal; + State(String literal) { + this.literal = literal; + } + + String literal() { + return literal; + } + } + + /** + * Limits managed by the security manager + */ + public static enum Limit { + + ENTITY_EXPANSION_LIMIT(XalanConstants.JDK_ENTITY_EXPANSION_LIMIT, + XalanConstants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000), + MAX_OCCUR_NODE_LIMIT(XalanConstants.JDK_MAX_OCCUR_LIMIT, + XalanConstants.SP_MAX_OCCUR_LIMIT, 0, 5000), + ELEMENT_ATTRIBUTE_LIMIT(XalanConstants.JDK_ELEMENT_ATTRIBUTE_LIMIT, + XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000), + TOTAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_TOTAL_ENTITY_SIZE_LIMIT, + XalanConstants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000), + GENEAL_ENTITY_SIZE_LIMIT(XalanConstants.JDK_GENEAL_ENTITY_SIZE_LIMIT, + XalanConstants.SP_GENEAL_ENTITY_SIZE_LIMIT, 0, 0), + PARAMETER_ENTITY_SIZE_LIMIT(XalanConstants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, + XalanConstants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000); + + final String apiProperty; + final String systemProperty; + final int defaultValue; + final int secureValue; + + Limit(String apiProperty, String systemProperty, int value, int secureValue) { + this.apiProperty = apiProperty; + this.systemProperty = systemProperty; + this.defaultValue = value; + this.secureValue = secureValue; + } + + public boolean equalsAPIPropertyName(String propertyName) { + return (propertyName == null) ? false : apiProperty.equals(propertyName); + } + + public boolean equalsSystemPropertyName(String propertyName) { + return (propertyName == null) ? false : systemProperty.equals(propertyName); + } + + public String apiProperty() { + return apiProperty; + } + + String systemProperty() { + return systemProperty; + } + + int defaultValue() { + return defaultValue; + } + + int secureValue() { + return secureValue; + } + } + + /** + * Map old property names with the new ones + */ + public static enum NameMap { + + ENTITY_EXPANSION_LIMIT(XalanConstants.SP_ENTITY_EXPANSION_LIMIT, + XalanConstants.ENTITY_EXPANSION_LIMIT), + MAX_OCCUR_NODE_LIMIT(XalanConstants.SP_MAX_OCCUR_LIMIT, + XalanConstants.MAX_OCCUR_LIMIT), + ELEMENT_ATTRIBUTE_LIMIT(XalanConstants.SP_ELEMENT_ATTRIBUTE_LIMIT, + XalanConstants.ELEMENT_ATTRIBUTE_LIMIT); + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + /** + * Values of the properties + */ + private final int[] values; + /** + * States of the settings for each property + */ + private State[] states; + /** + * States that determine if properties are set explicitly + */ + private boolean[] isSet; + + + /** + * Index of the special entityCountInfo property + */ + private int indexEntityCountInfo = 10000; + private String printEntityCountInfo = ""; + + /** + * Default constructor. Establishes default values for known security + * vulnerabilities. + */ + public XMLSecurityManager() { + this(false); + } + + /** + * Instantiate Security Manager in accordance with the status of + * secure processing + * @param secureProcessing + */ + public XMLSecurityManager(boolean secureProcessing) { + values = new int[Limit.values().length]; + states = new State[Limit.values().length]; + isSet = new boolean[Limit.values().length]; + for (Limit limit : Limit.values()) { + if (secureProcessing) { + values[limit.ordinal()] = limit.secureValue(); + states[limit.ordinal()] = State.FSP; + } else { + values[limit.ordinal()] = limit.defaultValue(); + states[limit.ordinal()] = State.DEFAULT; + } + } + //read system properties or jaxp.properties + readSystemProperties(); + } + + /** + * Setting FEATURE_SECURE_PROCESSING explicitly + */ + public void setSecureProcessing(boolean secure) { + for (Limit limit : Limit.values()) { + if (secure) { + setLimit(limit.ordinal(), State.FSP, limit.secureValue()); + } else { + setLimit(limit.ordinal(), State.FSP, limit.defaultValue()); + } + } + } + + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security manager; false + * if otherwise. + */ + public boolean setLimit(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setLimit(index, state, value); + return true; + } + return false; + } + + /** + * Set the value for a specific limit. + * + * @param limit the limit + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(Limit limit, State state, int value) { + setLimit(limit.ordinal(), state, value); + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, Object value) { + if (index == indexEntityCountInfo) { + //if it's explicitly set, it's treated as yes no matter the value + printEntityCountInfo = (String)value; + } else { + int temp = 0; + try { + temp = Integer.parseInt((String) value); + if (temp < 0) { + temp = 0; + } + } catch (NumberFormatException e) {} + setLimit(index, state, temp); } + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, int value) { + if (index == indexEntityCountInfo) { + //if it's explicitly set, it's treated as yes no matter the value + printEntityCountInfo = XalanConstants.JDK_YES; + } else { + //only update if it shall override + if (state.compareTo(states[index]) >= 0) { + values[index] = value; + states[index] = state; + isSet[index] = true; + } + } + } + + + /** + * Return the value of the specified property. + * + * @param propertyName the property name + * @return the value of the property as a string. If a property is managed + * by this manager, its value shall not be null. + */ + public String getLimitAsString(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getLimitValueByIndex(index); + } + + return null; + } + + /** + * Return the value of a property by its ordinal + * + * @param limit the property + * @return value of a property + */ + public String getLimitValueAsString(Limit limit) { + return Integer.toString(values[limit.ordinal()]); + } + + /** + * Return the value of the specified property + * + * @param limit the property + * @return the value of the property + */ + public int getLimit(Limit limit) { + return values[limit.ordinal()]; + } + + /** + * Return the value of a property by its ordinal + * + * @param index the index of a property + * @return value of a property + */ + public int getLimitByIndex(int index) { + return values[index]; + } + /** + * Return the value of a property by its index + * + * @param index the index of a property + * @return limit of a property as a string + */ + public String getLimitValueByIndex(int index) { + if (index == indexEntityCountInfo) { + return printEntityCountInfo; + } + + return Integer.toString(values[index]); + } + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public State getState(Limit limit) { + return states[limit.ordinal()]; + } + + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public String getStateLiteral(Limit limit) { + return states[limit.ordinal()].literal(); + } + + /** + * Get the index by property name + * + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public int getIndex(String propertyName) { + for (Limit limit : Limit.values()) { + if (limit.equalsAPIPropertyName(propertyName)) { + //internally, ordinal is used as index + return limit.ordinal(); + } + } + //special property to return entity count info + if (propertyName.equals(XalanConstants.JDK_ENTITY_COUNT_INFO)) { + return indexEntityCountInfo; + } + return -1; + } + + /** + * Indicate if a property is set explicitly + * @param index + * @return + */ + public boolean isSet(int index) { + return isSet[index]; + } + + public boolean printEntityCountInfo() { + return printEntityCountInfo.equals(XalanConstants.JDK_YES); + } + /** + * Read from system properties, or those in jaxp.properties + */ + private void readSystemProperties() { + + for (Limit limit : Limit.values()) { + if (!getSystemProperty(limit, limit.systemProperty())) { + //if system property is not found, try the older form if any + for (NameMap nameMap : NameMap.values()) { + String oldName = nameMap.getOldName(limit.systemProperty()); + if (oldName != null) { + getSystemProperty(limit, oldName); + } + } + } + } + + } + + /** + * Read from system properties, or those in jaxp.properties + * + * @param property the type of the property + * @param sysPropertyName the name of system property + */ + private boolean getSystemProperty(Limit limit, String sysPropertyName) { + try { + String value = SecuritySupport.getSystemProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.SYSTEMPROPERTY; + return true; + } + + value = SecuritySupport.readJAXPProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.JAXPDOTPROPERTIES; + return true; + } + } catch (NumberFormatException e) { + //invalid setting + throw new NumberFormatException("Invalid setting for system property: " + limit.systemProperty()); + } + return false; + } +} diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java index 5f5501a3434..35dc9a5d04b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/utils/XMLSecurityPropertyManager.java @@ -93,6 +93,23 @@ public final class XMLSecurityPropertyManager { readSystemProperties(); } + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setValue(index, state, (String)value); + return true; + } + return false; + } + /** * Set the value for a specific property. * @@ -121,6 +138,22 @@ public final class XMLSecurityPropertyManager { states[index] = state; } } + + /** + * Return the value of the specified property + * + * @param propertyName the property name + * @return the value of the property as a string + */ + public String getValue(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getValueByIndex(index); + } + + return null; + } + /** * Return the value of the specified property * diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java index fdfbe178d1d..e1971d35c06 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Import.java @@ -86,7 +86,7 @@ final class Import extends TopLevelElement { if (input == null) { docToLoad = SystemIDResolver.getAbsoluteURI(docToLoad, currLoadedDoc); String accessError = SecuritySupport.checkAccess(docToLoad, - xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), + (String)xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), XalanConstants.ACCESS_EXTERNAL_ALL); if (accessError != null) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java index 71c129f7cca..5bf12f8dc1b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Include.java @@ -87,7 +87,7 @@ final class Include extends TopLevelElement { if (input == null) { docToLoad = SystemIDResolver.getAbsoluteURI(docToLoad, currLoadedDoc); String accessError = SecuritySupport.checkAccess(docToLoad, - xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), + (String)xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), XalanConstants.ACCESS_EXTERNAL_ALL); if (accessError != null) { diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java index 3c186a1172b..0903d9a9ef6 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/Parser.java @@ -28,6 +28,7 @@ import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodType; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; @@ -487,6 +488,20 @@ public class Parser implements Constants, ContentHandler { } final XMLReader reader = parser.getXMLReader(); + try { + XMLSecurityManager securityManager = + (XMLSecurityManager)_xsltc.getProperty(XalanConstants.SECURITY_MANAGER); + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + reader.setProperty(limit.apiProperty(), securityManager.getLimitValueAsString(limit)); + } + if (securityManager.printEntityCountInfo()) { + parser.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); + } + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } + return(parse(reader, input)); } catch (ParserConfigurationException e) { @@ -565,7 +580,7 @@ public class Parser implements Constants, ContentHandler { } path = SystemIDResolver.getAbsoluteURI(path); String accessError = SecuritySupport.checkAccess(path, - _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), + (String)_xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET), XalanConstants.ACCESS_EXTERNAL_ALL); if (accessError != null) { ErrorMsg msg = new ErrorMsg(ErrorMsg.ACCESSING_XSLT_TARGET_ERR, diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java index 97fff3bf2e0..10823f14689 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XSLTC.java @@ -44,11 +44,11 @@ import javax.xml.XMLConstants; import com.sun.org.apache.bcel.internal.classfile.JavaClass; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; import com.sun.org.apache.xml.internal.dtm.DTM; -import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import org.xml.sax.InputSource; import org.xml.sax.XMLReader; @@ -146,6 +146,7 @@ public final class XSLTC { */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; + private XMLSecurityManager _xmlSecurityManager; /** * XSLTC compiler constructor @@ -184,12 +185,14 @@ public final class XSLTC { /** * Return allowed protocols for accessing external stylesheet. */ - public String getProperty(String name) { + public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { return _accessExternalStylesheet; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + return _xmlSecurityManager; } return null; } @@ -197,12 +200,14 @@ public final class XSLTC { /** * Set allowed protocols for accessing external stylesheet. */ - public void setProperty(String name, String value) { + public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { _accessExternalStylesheet = (String)value; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + _xmlSecurityManager = (XMLSecurityManager)value; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java index 8595d82bc21..500c3fce26a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages.java @@ -90,7 +90,13 @@ public class ErrorMessages extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "More than one stylesheet defined in the same file."}, @@ -1012,12 +1018,5 @@ public class ErrorMessages extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java index fa28ddc2d2f..708f7444b89 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ca.java @@ -90,7 +90,13 @@ public class ErrorMessages_ca extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "S'ha definit m\u00e9s d'un full d'estils en el mateix fitxer."}, @@ -853,12 +859,5 @@ public class ErrorMessages_ca extends ListResourceBundle { "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java index 4220efd8f04..f172643766d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_cs.java @@ -90,7 +90,13 @@ public class ErrorMessages_cs extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "V\u00edce ne\u017e jedna p\u0159edloha stylu je definov\u00e1na ve stejn\u00e9m souboru."}, @@ -853,12 +859,5 @@ public class ErrorMessages_cs extends ListResourceBundle { "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java index 48c3b6d1466..9807d06f41c 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_de.java @@ -90,7 +90,13 @@ public class ErrorMessages_de extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Mehrere Stylesheets in derselben Datei definiert."}, @@ -964,12 +970,5 @@ public class ErrorMessages_de extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java index 46e69aaf1b1..1225bd9cfbe 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_es.java @@ -90,7 +90,13 @@ public class ErrorMessages_es extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Se ha definido m\u00E1s de una hoja de estilo en el mismo archivo."}, @@ -964,12 +970,5 @@ public class ErrorMessages_es extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java index 6d68f2479bd..588e02df1ad 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_fr.java @@ -90,7 +90,13 @@ public class ErrorMessages_fr extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Plusieurs feuilles de style d\u00E9finies dans le m\u00EAme fichier."}, @@ -964,12 +970,5 @@ public class ErrorMessages_fr extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java index 32872e75d30..030ea71a00a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_it.java @@ -90,7 +90,13 @@ public class ErrorMessages_it extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Sono stati definiti pi\u00F9 fogli di stile nello stesso file."}, @@ -964,12 +970,5 @@ public class ErrorMessages_it extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java index 7507e5d7287..efd13271a2e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ja.java @@ -90,7 +90,13 @@ public class ErrorMessages_ja extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\u540C\u3058\u30D5\u30A1\u30A4\u30EB\u306B\u8907\u6570\u306E\u30B9\u30BF\u30A4\u30EB\u30B7\u30FC\u30C8\u304C\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059\u3002"}, @@ -964,12 +970,5 @@ public class ErrorMessages_ja extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java index dc0d6c3d67f..3921af4e764 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_ko.java @@ -90,7 +90,13 @@ public class ErrorMessages_ko extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\uB3D9\uC77C\uD55C \uD30C\uC77C\uC5D0 \uC2A4\uD0C0\uC77C\uC2DC\uD2B8\uAC00 \uB450 \uAC1C \uC774\uC0C1 \uC815\uC758\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}, @@ -964,12 +970,5 @@ public class ErrorMessages_ko extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java index 274a4a0f5bd..6760941be9d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_pt_BR.java @@ -90,7 +90,13 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Mais de uma folha de estilos definida no mesmo arquivo."}, @@ -964,12 +970,5 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java index 1a76afc2403..17646e9c51d 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sk.java @@ -90,7 +90,13 @@ public class ErrorMessages_sk extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Viac ne\u017e jeden \u0161t\u00fdl dokumentu bol definovan\u00fd v rovnakom s\u00fabore."}, @@ -853,12 +859,5 @@ public class ErrorMessages_sk extends ListResourceBundle { "FEATURE_SECURE_PROCESSING: Cannot set the feature to false when security manager is present."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java index 66ee5fb53b3..93edfa9cae2 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_sv.java @@ -90,7 +90,13 @@ public class ErrorMessages_sv extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "Fler \u00E4n en formatmall har definierats i samma fil."}, @@ -964,12 +970,5 @@ public class ErrorMessages_sv extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java index 6896db34888..93889c37085 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_CN.java @@ -90,7 +90,13 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\u540C\u4E00\u6587\u4EF6\u4E2D\u5B9A\u4E49\u4E86\u591A\u4E2A\u6837\u5F0F\u8868\u3002"}, @@ -964,12 +970,5 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java index 59c0b335f12..d99e7ec2a2b 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/util/ErrorMessages_zh_TW.java @@ -90,7 +90,13 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { {ErrorMsg.MULTIPLE_STYLESHEET_ERR, "\u76F8\u540C\u6A94\u6848\u4E2D\u5B9A\u7FA9\u4E86\u8D85\u904E\u4E00\u500B\u6A23\u5F0F\u8868\u3002"}, @@ -964,12 +970,5 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java index 37b4176f3b1..e1fd9e38df3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages.java @@ -81,7 +81,13 @@ public class ErrorMessages extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Use of the extension element ''{0}'' is not allowed when the secure processing feature is set to true."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java index 1f1c461680d..a2b2ba14caa 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ca.java @@ -79,7 +79,13 @@ public class ErrorMessages_ca extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -223,13 +229,6 @@ public class ErrorMessages_ca extends ListResourceBundle { "No s''ha pogut resoldre la refer\u00e8ncia d''URI ''{0}''."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java index 497367b8689..88409e1a507 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_cs.java @@ -79,7 +79,13 @@ public class ErrorMessages_cs extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -223,13 +229,6 @@ public class ErrorMessages_cs extends ListResourceBundle { "Nelze p\u0159elo\u017eit odkazy URI ''{0}''."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java index 181b4e17af5..747ae526d4e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_de.java @@ -81,7 +81,13 @@ public class ErrorMessages_de extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_de extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Verwendung des Erweiterungselements \"{0}\" ist nicht zul\u00E4ssig, wenn das Feature f\u00FCr die sichere Verarbeitung auf \"true\" gesetzt ist."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java index a5979582a1c..7810adaf78e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_es.java @@ -81,7 +81,13 @@ public class ErrorMessages_es extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_es extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "El uso del elemento de extensi\u00F3n ''{0}'' no est\u00E1 permitido cuando la funci\u00F3n de procesamiento seguro se ha definido en true."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java index 5319304f456..28089e97bb3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_fr.java @@ -81,7 +81,13 @@ public class ErrorMessages_fr extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_fr extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "L''utilisation de l''\u00E9l\u00E9ment d''extension ''{0}'' n''est pas autoris\u00E9e lorsque la fonctionnalit\u00E9 de traitement s\u00E9curis\u00E9 est d\u00E9finie sur True."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java index da6622e48c4..3fa594b215e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_it.java @@ -81,7 +81,13 @@ public class ErrorMessages_it extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_it extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Non \u00E8 consentito utilizzare l''elemento di estensione ''{0}'' se la funzione di elaborazione sicura \u00E8 impostata su true."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java index 54dc000aa39..ce4f1708f5e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ja.java @@ -81,7 +81,13 @@ public class ErrorMessages_ja extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_ja extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\u30BB\u30AD\u30E5\u30A2\u51E6\u7406\u6A5F\u80FD\u304Ctrue\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u3068\u304D\u3001\u62E1\u5F35\u8981\u7D20''{0}''\u306E\u4F7F\u7528\u306F\u8A31\u53EF\u3055\u308C\u307E\u305B\u3093\u3002"}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java index 87b532349b3..6ede7dfdd8a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_ko.java @@ -81,7 +81,13 @@ public class ErrorMessages_ko extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_ko extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\uBCF4\uC548 \uCC98\uB9AC \uAE30\uB2A5\uC774 true\uB85C \uC124\uC815\uB41C \uACBD\uC6B0 \uD655\uC7A5 \uC694\uC18C ''{0}''\uC744(\uB97C) \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java index 0eb0cfad52f..6004632a832 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_pt_BR.java @@ -81,7 +81,13 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_pt_BR extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "O uso do elemento da extens\u00E3o ''{0}'' n\u00E3o ser\u00E1 permitido quando o recurso de processamento seguro for definido como verdadeiro."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java index cf23692df73..6ee58b7c614 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sk.java @@ -79,7 +79,13 @@ public class ErrorMessages_sk extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -223,13 +229,6 @@ public class ErrorMessages_sk extends ListResourceBundle { "Nebolo mo\u017en\u00e9 rozl\u00ed\u0161i\u0165 referenciu URI ''{0}''."} }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java index 0e7b2fe1fa1..14f6797117a 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_sv.java @@ -81,7 +81,13 @@ public class ErrorMessages_sv extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_sv extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "Anv\u00E4ndning av till\u00E4ggselementet ''{0}'' \u00E4r inte till\u00E5tet n\u00E4r s\u00E4ker bearbetning till\u00E4mpas."}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java index 2900d55f057..c673f2b5234 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_CN.java @@ -81,7 +81,13 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_zh_CN extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\u5F53\u5B89\u5168\u5904\u7406\u529F\u80FD\u8BBE\u7F6E\u4E3A\u201C\u771F\u201D\u65F6, \u4E0D\u5141\u8BB8\u4F7F\u7528\u6269\u5C55\u5143\u7D20 ''{0}''\u3002"}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java index 8e591a223ee..50972c6cb2e 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/ErrorMessages_zh_TW.java @@ -81,7 +81,13 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { */ // These message should be read from a locale-specific resource bundle - private static final Object[][] _contents = new Object[][] { + /** Get the lookup table for error messages. + * + * @return The message lookup table. + */ + public Object[][] getContents() + { + return new Object[][] { /* * Note to translators: the substitution text in the following message @@ -276,13 +282,6 @@ public class ErrorMessages_zh_TW extends ListResourceBundle { {BasisLibrary.UNALLOWED_EXTENSION_ELEMENT_ERR, "\u7576\u5B89\u5168\u8655\u7406\u529F\u80FD\u8A2D\u70BA\u771F\u6642\uFF0C\u4E0D\u5141\u8A31\u4F7F\u7528\u64F4\u5145\u5957\u4EF6\u5143\u7D20 ''{0}''\u3002"}, }; - /** Get the lookup table for error messages. - * - * @return The message lookup table. - */ - public Object[][] getContents() - { - return _contents; } } diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java index 879c1cb4de0..ff43ca9410f 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TemplatesHandlerImpl.java @@ -29,7 +29,7 @@ import javax.xml.transform.Templates; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; import javax.xml.transform.sax.TemplatesHandler; - +import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.xsltc.compiler.CompilerException; import com.sun.org.apache.xalan.internal.xsltc.compiler.Parser; import com.sun.org.apache.xalan.internal.xsltc.compiler.SourceLoader; @@ -103,6 +103,8 @@ public class TemplatesHandlerImpl (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD)); + xsltc.setProperty(XalanConstants.SECURITY_MANAGER, + tfactory.getAttribute(XalanConstants.SECURITY_MANAGER)); if ("true".equals(tfactory.getAttribute(TransformerFactoryImpl.ENABLE_INLINING))) diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java index 874892942f9..9b6589d7aa8 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java @@ -27,6 +27,7 @@ import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.utils.ObjectFactory; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.Property; import com.sun.org.apache.xalan.internal.utils.XMLSecurityPropertyManager.State; @@ -218,13 +219,13 @@ public class TransformerFactoryImpl * protocols allowed for external references set by the stylesheet processing instruction, Import and Include element. */ private String _accessExternalStylesheet = XalanConstants.EXTERNAL_ACCESS_DEFAULT; - /** * protocols allowed for external DTD references in source file and/or stylesheet. */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; private XMLSecurityPropertyManager _xmlSecurityPropertyMgr; + private XMLSecurityManager _xmlSecurityManager; /** * javax.xml.transform.sax.TransformerFactory implementation. @@ -250,6 +251,9 @@ public class TransformerFactoryImpl Property.ACCESS_EXTERNAL_DTD); _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue( Property.ACCESS_EXTERNAL_STYLESHEET); + + //Parser's security manager + _xmlSecurityManager = new XMLSecurityManager(true); } /** @@ -311,11 +315,21 @@ public class TransformerFactoryImpl return Boolean.TRUE; else return Boolean.FALSE; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + return _xmlSecurityManager; } - int index = _xmlSecurityPropertyMgr.getIndex(name); - if (index > -1) { - return _xmlSecurityPropertyMgr.getValueByIndex(index); + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (_xmlSecurityManager != null) ? + _xmlSecurityManager.getLimitAsString(name) : null; + if (propertyValue != null) { + return propertyValue; + } else { + propertyValue = (_xmlSecurityPropertyMgr != null) ? + _xmlSecurityPropertyMgr.getValue(name) : null; + if (propertyValue != null) { + return propertyValue; + } } // Throw an exception for all other attributes @@ -419,10 +433,13 @@ public class TransformerFactoryImpl } } - int index = _xmlSecurityPropertyMgr.getIndex(name); - if (index > -1) { - _xmlSecurityPropertyMgr.setValue(index, - State.APIPROPERTY, (String)value); + if (_xmlSecurityManager != null && + _xmlSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) { + return; + } + + if (_xmlSecurityPropertyMgr != null && + _xmlSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { _accessExternalDTD = _xmlSecurityPropertyMgr.getValue( Property.ACCESS_EXTERNAL_DTD); _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue( @@ -473,6 +490,7 @@ public class TransformerFactoryImpl throw new TransformerConfigurationException(err.toString()); } _isNotSecureProcessing = !value; + _xmlSecurityManager.setSecureProcessing(value); // set external access restriction when FSP is explicitly set if (value && XalanConstants.IS_JDK8_OR_ABOVE) { @@ -849,6 +867,7 @@ public class TransformerFactoryImpl if (!_isNotSecureProcessing) xsltc.setSecureProcessing(true); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, _accessExternalStylesheet); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); + xsltc.setProperty(XalanConstants.SECURITY_MANAGER, _xmlSecurityManager); xsltc.init(); // Set a document loader (for xsl:include/import) if defined diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java index 63446e734e2..6bf365fe2a7 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java @@ -25,6 +25,7 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; @@ -214,6 +215,7 @@ public final class TransformerImpl extends Transformer */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; + private XMLSecurityManager _securityManager; /** * A hashtable to store parameters for the identity transform. These * are not needed during the transformation, but we must keep track of @@ -269,8 +271,11 @@ public final class TransformerImpl extends Transformer _useServicesMechanism = _tfactory.useServicesMechnism(); _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET); _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD); + _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER); _readerManager = XMLReaderManager.getInstance(_useServicesMechanism); _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); + _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); + _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager); //_isIncremental = tfactory._incremental; } @@ -286,6 +291,7 @@ public final class TransformerImpl extends Transformer */ public void setSecureProcessing(boolean flag) { _isSecureProcessing = flag; + _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); } /** * Return the state of the services mechanism feature. diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java index 25c45c04be9..4c6e02936c3 100644 --- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java +++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/Util.java @@ -23,6 +23,7 @@ package com.sun.org.apache.xalan.internal.xsltc.trax; +import com.sun.org.apache.xalan.internal.XalanConstants; import java.io.InputStream; import java.io.Reader; @@ -43,6 +44,7 @@ import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ErrorMsg; @@ -105,6 +107,13 @@ public final class Util { if (reader == null) { try { reader= XMLReaderFactory.createXMLReader(); + try { + reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + xsltc.isSecureProcessing()); + } catch (SAXNotRecognizedException e) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + e.getMessage()); + } } catch (Exception e ) { try { @@ -144,6 +153,22 @@ public final class Util { + e.getMessage()); } + try { + XMLSecurityManager securityManager = + (XMLSecurityManager)xsltc.getProperty(XalanConstants.SECURITY_MANAGER); + if (securityManager != null) { + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + reader.setProperty(limit.apiProperty(), + securityManager.getLimitValueAsString(limit)); + } + if (securityManager.printEntityCountInfo()) { + reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); + } + } + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } xsltc.setXMLReader(reader); }catch (SAXNotRecognizedException snre ) { throw new TransformerConfigurationException diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java index 832724ac586..1e8dcd98817 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/DOMConfigurationImpl.java @@ -33,6 +33,7 @@ import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.utils.ObjectFactory; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; @@ -59,6 +60,7 @@ import org.w3c.dom.DOMStringList; import org.w3c.dom.ls.LSResourceResolver; + /** * Xerces implementation of DOMConfiguration that maintains a table of recognized parameters. * @@ -156,6 +158,9 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings protected static final String SCHEMA_DV_FACTORY = Constants.XERCES_PROPERTY_PREFIX + Constants.SCHEMA_DV_FACTORY_PROPERTY; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; + /** Property identifier: Security property manager. */ private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; @@ -279,6 +284,7 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings JAXP_SCHEMA_LANGUAGE, DTD_VALIDATOR_FACTORY_PROPERTY, SCHEMA_DV_FACTORY, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); @@ -313,6 +319,8 @@ public class DOMConfigurationImpl extends ParserConfigurationSettings fValidationManager = createValidationManager(); setProperty(VALIDATION_MANAGER, fValidationManager); + setProperty(SECURITY_MANAGER, new XMLSecurityManager(true)); + setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java index bcc2a796b08..579622a7270 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/Constants.java @@ -174,8 +174,6 @@ public final class Constants { /** JAXP schemaSource language: when used internally may include DTD namespace (DOM) */ public static final String SCHEMA_LANGUAGE = "schemaLanguage"; - public static final String SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; - /** JAXP Standard property prefix ("http://javax.xml.XMLConstants/property/"). */ public static final String JAXPAPI_PROPERTY_PREFIX = "http://javax.xml.XMLConstants/property/"; @@ -208,6 +206,107 @@ public final class Constants { */ public static final boolean IS_JDK8_OR_ABOVE = isJavaVersionAtLeast(8); + // + // Implementation limits: corresponding System Properties of the above + // API properties + // + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String JDK_ENTITY_EXPANSION_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String JDK_ELEMENT_ATTRIBUTE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String JDK_MAX_OCCUR_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String JDK_TOTAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String JDK_GENEAL_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String JDK_PARAMETER_ENTITY_SIZE_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String JDK_XML_NAME_LIMIT = + ORACLE_JAXP_PROPERTY_PREFIX + "maxXMLNameLimit"; + /** + * JDK property to allow printing out information from the limit analyzer + */ + public static final String JDK_ENTITY_COUNT_INFO = + ORACLE_JAXP_PROPERTY_PREFIX + "getEntityCountInfo"; + + // + // Implementation limits: API properties + // + /** + * JDK entity expansion limit; Note that the existing system property + * "entityExpansionLimit" with no prefix is still observed + */ + public static final String SP_ENTITY_EXPANSION_LIMIT = "jdk.xml.entityExpansionLimit"; + + /** + * JDK element attribute limit; Note that the existing system property + * "elementAttributeLimit" with no prefix is still observed + */ + public static final String SP_ELEMENT_ATTRIBUTE_LIMIT = "jdk.xml.elementAttributeLimit"; + + /** + * JDK maxOccur limit; Note that the existing system property + * "maxOccurLimit" with no prefix is still observed + */ + public static final String SP_MAX_OCCUR_LIMIT = "jdk.xml.maxOccurLimit"; + + /** + * JDK total entity size limit + */ + public static final String SP_TOTAL_ENTITY_SIZE_LIMIT = "jdk.xml.totalEntitySizeLimit"; + + /** + * JDK maximum general entity size limit + */ + public static final String SP_GENEAL_ENTITY_SIZE_LIMIT = "jdk.xml.maxGeneralEntitySizeLimit"; + /** + * JDK maximum parameter entity size limit + */ + public static final String SP_PARAMETER_ENTITY_SIZE_LIMIT = "jdk.xml.maxParameterEntitySizeLimit"; + /** + * JDK maximum XML name limit + */ + public static final String SP_XML_NAME_LIMIT = "jdk.xml.maxXMLNameLimit"; + + //legacy System Properties + public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; + public static final String ELEMENT_ATTRIBUTE_LIMIT = "elementAttributeLimit" ; + public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; + + /** + * A string "yes" that can be used for properties such as getEntityCountInfo + */ + public static final String JDK_YES = "yes"; + // // DOM features // @@ -443,7 +542,7 @@ public final class Constants { public static final String LOCALE_PROPERTY = "locale"; /** property identifier: security manager. */ - protected static final String SECURITY_MANAGER = + public static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; @@ -511,9 +610,6 @@ public final class Constants { */ public final static String ATTRIBUTE_DECLARED = "ATTRIBUTE_DECLARED"; - public final static String ENTITY_EXPANSION_LIMIT = "entityExpansionLimit"; - - public final static String MAX_OCCUR_LIMIT = "maxOccurLimit"; /** * {@link org.w3c.dom.TypeInfo} associated with current element/attribute diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java index 0f5119d1fb1..2c8f3aff2c2 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/PropertyManager.java @@ -25,6 +25,7 @@ package com.sun.org.apache.xerces.internal.impl; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.xml.internal.stream.StaxEntityResolverWrapper; import java.util.HashMap; @@ -50,12 +51,16 @@ public class PropertyManager { private static final String STRING_INTERNING = "http://xml.org/sax/features/string-interning"; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; + /** Property identifier: Security property manager. */ private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; HashMap supportedProps = new HashMap(); + private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; public static final int CONTEXT_READER = 1; @@ -82,6 +87,7 @@ public class PropertyManager { HashMap properties = propertyManager.getProperties(); supportedProps.putAll(properties); + fSecurityManager = (XMLSecurityManager)getProperty(SECURITY_MANAGER); fSecurityPropertyMgr = (XMLSecurityPropertyManager)getProperty(XML_SECURITY_PROPERTY_MANAGER); } @@ -124,6 +130,8 @@ public class PropertyManager { supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_DUPLICATE_ENTITYDEF_FEATURE, new Boolean(false)); supportedProps.put(Constants.XERCES_FEATURE_PREFIX + Constants.WARN_ON_UNDECLARED_ELEMDEF_FEATURE, new Boolean(false)); + fSecurityManager = new XMLSecurityManager(true); + supportedProps.put(SECURITY_MANAGER, fSecurityManager); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); supportedProps.put(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); } @@ -142,6 +150,7 @@ public class PropertyManager { */ public boolean containsProperty(String property){ return supportedProps.containsKey(property) || + (fSecurityManager != null && fSecurityManager.getIndex(property) > -1) || (fSecurityPropertyMgr!=null && fSecurityPropertyMgr.getIndex(property) > -1) ; } @@ -169,12 +178,34 @@ public class PropertyManager { supportedProps.put( Constants.XERCES_PROPERTY_PREFIX + Constants.STAX_ENTITY_RESOLVER_PROPERTY , new StaxEntityResolverWrapper((XMLResolver)value)) ; } - int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(property) : -1; - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - } else { - supportedProps.put(property, value); + /** + * It's possible for users to set a security manager through the interface. + * If it's the old SecurityManager, convert it to the new XMLSecurityManager + */ + if (property.equals(Constants.SECURITY_MANAGER)) { + fSecurityManager = XMLSecurityManager.convert(value, fSecurityManager); + supportedProps.put(Constants.SECURITY_MANAGER, fSecurityManager); + return; + } + if (property.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (value == null) { + fSecurityPropertyMgr = new XMLSecurityPropertyManager(); + } else { + fSecurityPropertyMgr = (XMLSecurityPropertyManager)value; + } + supportedProps.put(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); + return; + } + + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(property, XMLSecurityManager.State.APIPROPERTY, value)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(property, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { + //fall back to the existing property manager + supportedProps.put(property, value); + } } if(equivalentProperty != null){ diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java index dbfd46a5d5f..7a826dfcc97 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XML11NSDocumentScannerImpl.java @@ -108,6 +108,7 @@ import javax.xml.stream.events.XMLEvent; * @author Elena Litani, IBM * @author Michael Glavassevich, IBM * @author Sunitha Reddy, Sun Microsystems + * @version $Id: XML11NSDocumentScannerImpl.java,v 1.6 2010-11-01 04:39:40 joehw Exp $ */ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { @@ -236,7 +237,8 @@ public class XML11NSDocumentScannerImpl extends XML11DocumentScannerImpl { // attributes scanAttribute(fAttributes); - if (fSecurityManager != null && fAttributes.getLength() > fElementAttributeLimit){ + if (fSecurityManager != null && (!fSecurityManager.isNoLimit(fElementAttributeLimit)) && + fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", new Object[]{rawname, new Integer(fElementAttributeLimit) }, diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java index 6c5553c7979..18a9902d1b7 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java @@ -44,6 +44,8 @@ import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.xml.internal.stream.Entity; /** * This class is responsible for scanning the declarations found @@ -66,7 +68,7 @@ import com.sun.org.apache.xerces.internal.impl.Constants; * @author Glenn Marcy, IBM * @author Eric Ye, IBM * - * @version $Id: XMLDTDScannerImpl.java,v 1.7 2007/09/26 12:52:40 ndw Exp $ + * @version $Id: XMLDTDScannerImpl.java,v 1.8 2010-11-01 04:39:41 joehw Exp $ */ public class XMLDTDScannerImpl extends XMLScanner @@ -1545,7 +1547,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { // internal entity if (systemId == null) { - scanEntityValue(fLiteral, fLiteral2); + scanEntityValue(name, isPEDecl, fLiteral, fLiteral2); // since we need it's value anyway, let's snag it so it doesn't get corrupted // if a new load takes place before we store the entity values fStringBuffer.clear(); @@ -1610,7 +1612,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { * the use of scanCharReferenceValue), and fStringBuffer2, anything in them * at the time of calling is lost. */ - protected final void scanEntityValue(XMLString value, + protected final void scanEntityValue(String entityName, boolean isPEDecl, XMLString value, XMLString nonNormalizedValue) throws IOException, XNIException { int quote = fEntityScanner.scanChar(); @@ -1622,10 +1624,20 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { XMLString literal = fString; XMLString literal2 = fString; + int countChar = 0; + if (fLimitAnalyzer == null && fSecurityManager != null) { + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + fLimitAnalyzer.startEntity(entityName); + } + if (fEntityScanner.scanLiteral(quote, fString) != quote) { fStringBuffer.clear(); fStringBuffer2.clear(); do { + if (isPEDecl && fLimitAnalyzer != null) { + checkLimit("%" + entityName, fString.length + countChar); + } + countChar = 0; fStringBuffer.append(fString); fStringBuffer2.append(fString); if (fEntityScanner.skipChar('&')) { @@ -1685,6 +1697,7 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { } } else { + countChar++; int c = fEntityScanner.peekChar(); if (XMLChar.isHighSurrogate(c)) { scanSurrogates(fStringBuffer2); @@ -1708,9 +1721,17 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { fStringBuffer2.append(fString); literal = fStringBuffer; literal2 = fStringBuffer2; + } else { + if (isPEDecl) { + checkLimit("%" + entityName, literal); + } } value.setValues(literal); nonNormalizedValue.setValues(literal2); + if (fLimitAnalyzer != null) { + fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName); + } + if (!fEntityScanner.skipChar(quote)) { reportFatalError("CloseQuoteMissingInDecl", null); } @@ -2126,6 +2147,43 @@ implements XMLDTDScanner, XMLComponent, XMLEntityHandler { //new SymbolTable()); } + /** + * Add the count of the content buffer and check if the accumulated + * value exceeds the limit + * @param entityName entity name + * @param buffer content buffer + */ + private void checkLimit(String entityName, XMLString buffer) { + checkLimit(entityName, buffer.length); + } + + /** + * Add the count and check limit + * @param entityName entity name + * @param len length of the buffer + */ + private void checkLimit(String entityName, int len) { + if (fLimitAnalyzer == null) { + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + } + fLimitAnalyzer.addValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT, entityName, len); + if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("MaxEntitySizeLimit", new Object[]{entityName, + fLimitAnalyzer.getValue(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.PARAMETER_ENTITY_SIZE_LIMIT)}); + } + if (fSecurityManager.isOverLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("TotalEntitySizeLimit", + new Object[]{fLimitAnalyzer.getTotalValue(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(XMLSecurityManager.Limit.TOTAL_ENTITY_SIZE_LIMIT)}); + } + + } + public DTDGrammar getGrammar(){ return nvGrammarInfo; } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java index 050b852e84d..600527daa93 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java @@ -50,12 +50,14 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.NamespaceSupport; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.State; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; -import com.sun.xml.internal.stream.Entity; import javax.xml.XMLConstants; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.events.XMLEvent; @@ -213,11 +215,8 @@ public class XMLDocumentFragmentScannerImpl }; private static final char [] cdata = {'[','C','D','A','T','A','['}; - private static final char [] endTag = {'<','/'}; - - //this variable is also used by XMLDocumentScannerImpl in the same package static final char [] xmlDecl = {'<','?','x','m','l'}; - + private static final char [] endTag = {'<','/'}; // debugging /** Debug scanner state. */ @@ -316,6 +315,7 @@ public class XMLDocumentFragmentScannerImpl protected String fDeclaredEncoding = null; /** Xerces Feature: Disallow doctype declaration. */ protected boolean fDisallowDoctype = false; + /** * comma-delimited list of protocols that are allowed for the purpose * of accessing external dtd or entity references @@ -384,7 +384,6 @@ public class XMLDocumentFragmentScannerImpl protected boolean foundBuiltInRefs = false; - protected SecurityManager fSecurityManager = null; //skip element algorithm static final short MAX_DEPTH_LIMIT = 5 ; @@ -571,8 +570,11 @@ public class XMLDocumentFragmentScannerImpl // xerces features fReportCdataEvent = componentManager.getFeature(Constants.STAX_REPORT_CDATA_EVENT, true); - fSecurityManager = (SecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null); - fElementAttributeLimit = (fSecurityManager != null)?fSecurityManager.getElementAttrLimit():0; + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(Constants.SECURITY_MANAGER, null); + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + + fElementAttributeLimit = (fSecurityManager != null)? + fSecurityManager.getLimit(XMLSecurityManager.Limit.ELEMENT_ATTRIBUTE_LIMIT):0; fNotifyBuiltInRefs = componentManager.getFeature(NOTIFY_BUILTIN_REFS, false); @@ -598,9 +600,6 @@ public class XMLDocumentFragmentScannerImpl //xxx: external entities are supported in Xerces // it would be good to define feature for this case fSupportExternalEntities = true; - fSupportExternalEntities = true; - fSupportExternalEntities = true; - fSupportExternalEntities = true; fReplaceEntityReferences = true; fIsCoalesce = false; @@ -671,6 +670,9 @@ public class XMLDocumentFragmentScannerImpl XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER); fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); + + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(Constants.SECURITY_MANAGER); + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); } // reset(XMLComponentManager) /** @@ -1322,7 +1324,8 @@ public class XMLDocumentFragmentScannerImpl fAddDefaultAttr = true; do { scanAttribute(fAttributes); - if (fSecurityManager != null && fAttributes.getLength() > fElementAttributeLimit){ + if (fSecurityManager != null && !fSecurityManager.isNoLimit(fElementAttributeLimit) && + fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", new Object[]{rawname, new Integer(fAttributes.getLength()) }, @@ -2036,6 +2039,13 @@ public class XMLDocumentFragmentScannerImpl } // getDriverName():String + /** + * Check the protocol used in the systemId against allowed protocols + * + * @param systemId the Id of the URI + * @param allowedProtocols a list of allowed protocols separated by comma + * @return the name of the protocol if rejected, null otherwise + */ String checkAccess(String systemId, String allowedProtocols) throws IOException { String baseSystemId = fEntityScanner.getBaseSystemId(); String expandedSystemId = fEntityManager.expandSystemId(systemId, baseSystemId,fStrictURI); @@ -2833,6 +2843,8 @@ public class XMLDocumentFragmentScannerImpl if(DEBUG){ System.out.println("NOT USING THE BUFFER, STRING = " + fTempString.toString()); } + //check limit before returning event + checkLimit(fContentBuffer); if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){ if(DEBUG)System.out.println("Return SPACE EVENT"); return XMLEvent.SPACE; @@ -2931,6 +2943,8 @@ public class XMLDocumentFragmentScannerImpl fLastSectionWasCharacterData = true ; continue; }else{ + //check limit before returning event + checkLimit(fContentBuffer); if(dtdGrammarUtil!= null && dtdGrammarUtil.isIgnorableWhiteSpace(fContentBuffer)){ if(DEBUG)System.out.println("Return SPACE EVENT"); return XMLEvent.SPACE; @@ -3141,6 +3155,30 @@ public class XMLDocumentFragmentScannerImpl } //while loop }//next + /** + * Add the count of the content buffer and check if the accumulated + * value exceeds the limit + * @param buffer content buffer + */ + protected void checkLimit(XMLStringBuffer buffer) { + if (fLimitAnalyzer.isTracking(fCurrentEntityName)) { + fLimitAnalyzer.addValue(Limit.GENEAL_ENTITY_SIZE_LIMIT, fCurrentEntityName, buffer.length); + if (fSecurityManager.isOverLimit(Limit.GENEAL_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("MaxEntitySizeLimit", new Object[]{fCurrentEntityName, + fLimitAnalyzer.getValue(Limit.GENEAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(Limit.GENEAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(Limit.GENEAL_ENTITY_SIZE_LIMIT)}); + } + if (fSecurityManager.isOverLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT)) { + fSecurityManager.debugPrint(); + reportFatalError("TotalEntitySizeLimit", + new Object[]{fLimitAnalyzer.getTotalValue(Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getLimit(Limit.TOTAL_ENTITY_SIZE_LIMIT), + fSecurityManager.getStateLiteral(Limit.TOTAL_ENTITY_SIZE_LIMIT)}); + } + } + } // // Protected methods diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java index da902908dce..59f3aa00e2d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLEntityManager.java @@ -28,9 +28,10 @@ import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.util.*; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; @@ -174,7 +175,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** access external dtd: file protocol */ static final String EXTERNAL_ACCESS_DEFAULT = Constants.EXTERNAL_ACCESS_DEFAULT; - // recognized features and properties /** Recognized features. */ @@ -307,6 +307,7 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** used to restrict external access */ protected String fAccessExternalDTD = EXTERNAL_ACCESS_DEFAULT; + // settings /** @@ -324,9 +325,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { */ protected int fBufferSize = DEFAULT_BUFFER_SIZE; - // stores defaults for entity expansion limit if it has - // been set on the configuration. - protected SecurityManager fSecurityManager = null; + /** Security Manager */ + protected XMLSecurityManager fSecurityManager = null; + + protected XMLLimitAnalyzer fLimitAnalyzer = null; + + protected int entityExpansionIndex; /** * True if the document entity is standalone. This should really @@ -352,10 +356,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { /** XML 1.1 entity scanner. */ protected XMLEntityScanner fXML11EntityScanner; - /** entity expansion limit (contains useful data if and only if - fSecurityManager is non-null) */ - protected int fEntityExpansionLimit = 0; - /** count of entities expanded: */ protected int fEntityExpansionCount = 0; @@ -833,6 +833,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { fCurrentEntity.setEncodingExternallySpecified(encodingExternallySpecified); fEntityScanner.setCurrentEntity(fCurrentEntity); fResourceIdentifier.setValues(publicId, literalSystemId, baseSystemId, expandedSystemId); + if (fLimitAnalyzer != null) { + fLimitAnalyzer.startEntity(name); + } return encoding; } //setupCurrentEntity(String, XMLInputSource, boolean, boolean): String @@ -1294,10 +1297,13 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { //expansions exceeds the entity expansion limit, parser will throw fatal error. // Note that this represents the nesting level of open entities. fEntityExpansionCount++; - if( fSecurityManager != null && fEntityExpansionCount > fEntityExpansionLimit ){ - fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, - "EntityExpansionLimitExceeded", - new Object[]{new Integer(fEntityExpansionLimit) }, + if(fLimitAnalyzer != null) { + fLimitAnalyzer.addValue(entityExpansionIndex, name, 1); + } + if( fSecurityManager != null && fSecurityManager.isOverLimit(entityExpansionIndex)){ + fSecurityManager.debugPrint(); + fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,"EntityExpansionLimitExceeded", + new Object[]{fSecurityManager.getLimitValueByIndex(entityExpansionIndex)}, XMLErrorReporter.SEVERITY_FATAL_ERROR ); // is there anything better to do than reset the counter? // at least one can envision debugging applications where this might @@ -1361,6 +1367,12 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { if(fCurrentEntity != null){ //close the reader try{ + if (fLimitAnalyzer != null) { + fLimitAnalyzer.endEntity(XMLSecurityManager.Limit.GENEAL_ENTITY_SIZE_LIMIT, fCurrentEntity.name); + if (fCurrentEntity.name.equals("[xml]")) { + fSecurityManager.debugPrint(); + } + } fCurrentEntity.close(); }catch(IOException ex){ throw new XNIException(ex); @@ -1426,6 +1438,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) propertyManager.getProperty(XML_SECURITY_PROPERTY_MANAGER); fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER); + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + // initialize state //fStandalone = false; fEntities.clear(); @@ -1485,7 +1500,9 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { fEntityResolver = (XMLEntityResolver)componentManager.getProperty(ENTITY_RESOLVER, null); fStaxEntityResolver = (StaxEntityResolverWrapper)componentManager.getProperty(STAX_ENTITY_RESOLVER, null); fValidationManager = (ValidationManager)componentManager.getProperty(VALIDATION_MANAGER, null); - fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER, null); + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER, null); + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); + entityExpansionIndex = fSecurityManager.getIndex(Constants.JDK_ENTITY_EXPANSION_LIMIT); // JAXP 1.5 feature XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager) componentManager.getProperty(XML_SECURITY_PROPERTY_MANAGER, null); @@ -1506,7 +1523,6 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { // a class acting as a component manager but not // implementing that interface for whatever reason. public void reset() { - fEntityExpansionLimit = (fSecurityManager != null)?fSecurityManager.getEntityExpansionLimit():0; // initialize state fStandalone = false; @@ -1642,8 +1658,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { } if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() && propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) { - fSecurityManager = (SecurityManager)value; - fEntityExpansionLimit = (fSecurityManager != null)?fSecurityManager.getEntityExpansionLimit():0; + fSecurityManager = (XMLSecurityManager)value; + fLimitAnalyzer = fSecurityManager.getLimitAnalyzer(); } } @@ -1652,9 +1668,8 @@ public class XMLEntityManager implements XMLComponent, XMLEntityResolver { { XMLSecurityPropertyManager spm = (XMLSecurityPropertyManager)value; fAccessExternalDTD = spm.getValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD); + } } - } - /** * Returns a list of property identifiers that are recognized by * this component. This method may return null if no properties diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java index b0461eb9138..464511c368c 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLNSDocumentScannerImpl.java @@ -58,6 +58,7 @@ import javax.xml.stream.events.XMLEvent; * @author Neeraj Bajaj, Sun Microsystems * @author Venugopal Rao K, Sun Microsystems * @author Elena Litani, IBM + * @version $Id: XMLNSDocumentScannerImpl.java,v 1.11 2010-11-01 04:39:41 joehw Exp $ */ public class XMLNSDocumentScannerImpl extends XMLDocumentScannerImpl { @@ -251,7 +252,8 @@ public class XMLNSDocumentScannerImpl do { scanAttribute(fAttributes); - if (fSecurityManager != null && fAttributes.getLength() > fElementAttributeLimit){ + if (fSecurityManager != null && (!fSecurityManager.isNoLimit(fElementAttributeLimit)) && + fAttributes.getLength() > fElementAttributeLimit){ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN, "ElementAttributeLimit", new Object[]{rawname, new Integer(fAttributes.getLength()) }, diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java index 0c66aa236fa..70de7869e78 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLScanner.java @@ -32,6 +32,8 @@ import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl; import com.sun.org.apache.xerces.internal.util.XMLStringBuffer; +import com.sun.org.apache.xerces.internal.utils.XMLLimitAnalyzer; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.XMLAttributes; import com.sun.org.apache.xerces.internal.xni.XMLResourceIdentifier; @@ -106,6 +108,9 @@ public abstract class XMLScanner protected static final String ENTITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_MANAGER_PROPERTY; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; + // debugging /** Debug attribute normalization. */ @@ -159,6 +164,12 @@ public abstract class XMLScanner /** xxx this should be available from EntityManager Entity storage */ protected XMLEntityStorage fEntityStore = null ; + /** Security manager. */ + protected XMLSecurityManager fSecurityManager = null; + + /** Limit analyzer. */ + protected XMLLimitAnalyzer fLimitAnalyzer = null; + // protected data /** event type */ @@ -256,6 +267,7 @@ public abstract class XMLScanner fSymbolTable = (SymbolTable)componentManager.getProperty(SYMBOL_TABLE); fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER); fEntityManager = (XMLEntityManager)componentManager.getProperty(ENTITY_MANAGER); + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER); //this step is extra because we have separated the storage of entity fEntityStore = fEntityManager.getEntityStore() ; @@ -293,6 +305,10 @@ public abstract class XMLScanner fEntityManager = (XMLEntityManager)value; } } + + if (propertyId.equals(SECURITY_MANAGER)) { + fSecurityManager = (XMLSecurityManager)value; + } /*else if(propertyId.equals(Constants.STAX_PROPERTIES)){ fStaxProperties = (HashMap)value; //TODO::discuss with neeraj what are his thoughts on passing properties. @@ -352,6 +368,8 @@ public abstract class XMLScanner fEntityManager = (XMLEntityManager)propertyManager.getProperty(ENTITY_MANAGER); fEntityStore = fEntityManager.getEntityStore() ; fEntityScanner = (XMLEntityScanner)fEntityManager.getEntityScanner() ; + fSecurityManager = (XMLSecurityManager)propertyManager.getProperty(SECURITY_MANAGER); + //fEntityManager.reset(); // DTD preparsing defaults: fValidation = false; @@ -499,7 +517,7 @@ public abstract class XMLScanner reportFatalError("SDDeclInvalid", new Object[] {standalone}); } } else { - reportFatalError("EncodingDeclRequired", null); + reportFatalError("SDDeclNameInvalid", null); } break; } @@ -510,8 +528,9 @@ public abstract class XMLScanner sawSpace = fEntityScanner.skipSpaces(); } // restore original literal value - if(currLiteral) + if(currLiteral) { currEnt.literal = true; + } // REVISIT: should we remove this error reporting? if (scanningTextDecl && state != STATE_DONE) { reportFatalError("MorePseudoAttributes", null); @@ -564,7 +583,7 @@ public abstract class XMLScanner XMLString value) throws IOException, XNIException { - String name = fEntityScanner.scanName(); + String name = scanPseudoAttributeName(); // XMLEntityManager.print(fEntityManager.getCurrentEntity()); if (name == null) { @@ -616,6 +635,35 @@ public abstract class XMLScanner } // scanPseudoAttribute(XMLString):String + /** + * Scans the name of a pseudo attribute. The only legal names + * in XML 1.0/1.1 documents are 'version', 'encoding' and 'standalone'. + * + * @return the name of the pseudo attribute or null + * if a legal pseudo attribute name could not be scanned. + */ + private String scanPseudoAttributeName() throws IOException, XNIException { + final int ch = fEntityScanner.peekChar(); + switch (ch) { + case 'v': + if (fEntityScanner.skipString(fVersionSymbol)) { + return fVersionSymbol; + } + break; + case 'e': + if (fEntityScanner.skipString(fEncodingSymbol)) { + return fEncodingSymbol; + } + break; + case 's': + if (fEntityScanner.skipString(fStandaloneSymbol)) { + return fStandaloneSymbol; + } + break; + } + return null; + } // scanPseudoAttributeName() + /** * Scans a processing instruction. *

    diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties index 1a5d62af9bb..200b904b105 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/msg/XMLMessages.properties @@ -44,6 +44,7 @@ # 2.9 Standalone Document Declaration SDDeclInvalid = The standalone document declaration value must be \"yes\" or \"no\", not \"{0}\". + SDDeclNameInvalid = The standalone name in XML declaration may be misspelled. # 2.12 Language Identification XMLLangInvalid = The xml:lang attribute value \"{0}\" is an invalid language identifier. # 3. Logical Structures @@ -292,8 +293,10 @@ InvalidCharInLiteral=InvalidCharInLiteral -#Application can set the limit of number of entities that should be expanded by the parser. -EntityExpansionLimitExceeded=The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the application. +# Implementation limits + EntityExpansionLimitExceeded=JAXP00010001: The parser has encountered more than \"{0}\" entity expansions in this document; this is the limit imposed by the JDK. + ElementAttributeLimit=JAXP00010002: Element \"{0}\" has more than \"{1}\" attributes, \"{1}\" is the limit imposed by the JDK. + MaxEntitySizeLimit=JAXP00010003: The length of entity \"{0}\" is \"{1}\" that exceeds the \"{2}\" limit set by \"{3}\". + TotalEntitySizeLimit=JAXP00010004: The accumulated size \"{0}\" of entities exceeded the \"{1}\" limit set by \"{2}\". + MaxXMLNameLimit=JAXP00010005: The name \"{0}\" exceeded the \"{1}\" limit set by \"{2}\". -# Application can set the limit of number of attributes of entity that should be expanded by the parser. -ElementAttributeLimit= Element \"{0}\" has more than \"{1}\" attributes, \"{1}\" is the limit imposed by the application. diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java index 90d6491d568..eb652a89441 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xpath/XPath.java @@ -1422,7 +1422,7 @@ public class XPath { } ch = data.charAt(currentOffset); } while (ch == ' ' || ch == 0x0A || ch == 0x09 || ch == 0x0D); - if (currentOffset == endOffset || ch == '|') { + if (currentOffset == endOffset || ch == '|' || ch == '/') { addToken(tokens, XPath.Tokens.EXPRTOKEN_PERIOD); starIsMultiplyOperator = true; break; diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java index d1831661f88..6aa06b8828d 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/models/CMNodeFactory.java @@ -21,13 +21,13 @@ package com.sun.org.apache.xerces.internal.impl.xs.models; -import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; -import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; -import com.sun.org.apache.xerces.internal.util.SecurityManager ; -import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode; -import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; -import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; +import com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode; +import com.sun.org.apache.xerces.internal.impl.xs.XSMessageFormatter; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; +import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; /** * @@ -68,7 +68,7 @@ public class CMNodeFactory { // stores defaults for different security holes (maxOccurLimit in current context) if it has // been set on the configuration. - private SecurityManager fSecurityManager = null; + private XMLSecurityManager fSecurityManager = null; /** default constructor */ public CMNodeFactory() { @@ -77,10 +77,10 @@ public class CMNodeFactory { public void reset(XMLComponentManager componentManager){ fErrorReporter = (XMLErrorReporter)componentManager.getProperty(ERROR_REPORTER); try { - fSecurityManager = (SecurityManager)componentManager.getProperty(SECURITY_MANAGER); + fSecurityManager = (XMLSecurityManager)componentManager.getProperty(SECURITY_MANAGER); //we are setting the limit of number of nodes to 3times the maxOccur value.. if(fSecurityManager != null){ - maxNodeLimit = fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY ; + maxNodeLimit = fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY ; } } catch (XMLConfigurationException e) { @@ -109,7 +109,8 @@ public class CMNodeFactory { } public void nodeCountCheck(){ - if( fSecurityManager != null && nodeCount++ > maxNodeLimit){ + if( fSecurityManager != null && !fSecurityManager.isNoLimit(maxNodeLimit) && + nodeCount++ > maxNodeLimit){ if(DEBUG){ System.out.println("nodeCount = " + nodeCount ) ; System.out.println("nodeLimit = " + maxNodeLimit ) ; @@ -150,8 +151,9 @@ public class CMNodeFactory { if (suffixLength == Constants.SECURITY_MANAGER_PROPERTY.length() && propertyId.endsWith(Constants.SECURITY_MANAGER_PROPERTY)) { - fSecurityManager = (SecurityManager)value; - maxNodeLimit = (fSecurityManager != null) ? fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY : 0 ; + fSecurityManager = (XMLSecurityManager)value; + maxNodeLimit = (fSecurityManager != null) ? + fSecurityManager.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT) * MULTIPLICITY : 0 ; return; } if (suffixLength == Constants.ERROR_REPORTER_PROPERTY.length() && diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java index 3744692c33d..f9eea6a4dc4 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSAttributeChecker.java @@ -40,6 +40,7 @@ import com.sun.org.apache.xerces.internal.util.DOMUtil; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLSymbols; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xs.XSConstants; import java.util.HashMap; @@ -1194,8 +1195,8 @@ public class XSAttributeChecker { if (!optimize) { //Revisit :: IMO this is not right place to check // maxOccurNodeLimit. - int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getMaxOccurNodeLimit(); - if (max > maxOccurNodeLimit) { + int maxOccurNodeLimit = fSchemaHandler.fSecureProcessing.getLimit(XMLSecurityManager.Limit.MAX_OCCUR_NODE_LIMIT); + if (max > maxOccurNodeLimit && !fSchemaHandler.fSecureProcessing.isNoLimit(maxOccurNodeLimit)) { reportSchemaFatalError("maxOccurLimit", new Object[] {new Integer(maxOccurNodeLimit)}, element); // reset max values in case processing continues on error diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java index d947cf8815d..d6a6e948f65 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/traversers/XSDHandler.java @@ -70,7 +70,6 @@ import com.sun.org.apache.xerces.internal.util.DOMUtil; import com.sun.org.apache.xerces.internal.util.DefaultErrorHandler; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXInputSource; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.StAXInputSource; import com.sun.org.apache.xerces.internal.util.StAXLocationWrapper; import com.sun.org.apache.xerces.internal.util.SymbolHash; @@ -79,6 +78,7 @@ import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; import com.sun.org.apache.xerces.internal.utils.SecuritySupport; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.QName; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; @@ -257,7 +257,7 @@ public class XSDHandler { * *

    Protected to allow access by any traverser.

    */ - protected SecurityManager fSecureProcessing = null; + protected XMLSecurityManager fSecureProcessing = null; private String fAccessExternalSchema; private String fAccessExternalDTD; @@ -3509,7 +3509,7 @@ public class XSDHandler { fSecureProcessing = null; if( componentManager!=null ) { - fSecureProcessing = (SecurityManager) componentManager.getProperty(SECURE_PROCESSING, null); + fSecureProcessing = (XMLSecurityManager) componentManager.getProperty(SECURE_PROCESSING, null); } //set entity resolver diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java index 00bc0bbfab0..0c8d0a84db2 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DefaultValidationErrorHandler.java @@ -20,6 +20,8 @@ package com.sun.org.apache.xerces.internal.jaxp; +import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; +import java.util.Locale; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; @@ -30,6 +32,11 @@ import org.xml.sax.helpers.DefaultHandler; class DefaultValidationErrorHandler extends DefaultHandler { static private int ERROR_COUNT_LIMIT = 10; private int errorCount = 0; + private Locale locale = Locale.getDefault(); + + public DefaultValidationErrorHandler(Locale locale) { + this.locale = locale; + } // XXX Fix message i18n public void error(SAXParseException e) throws SAXException { @@ -38,11 +45,8 @@ class DefaultValidationErrorHandler extends DefaultHandler { return; } else if (errorCount == 0) { // Print a warning before the first error - System.err.println("Warning: validation was turned on but an org.xml.sax.ErrorHandler was not"); - System.err.println("set, which is probably not what is desired. Parser will use a default"); - System.err.println("ErrorHandler to print the first " + - ERROR_COUNT_LIMIT + " errors. Please call"); - System.err.println("the 'setErrorHandler' method to fix this."); + System.err.println(SAXMessageFormatter.formatMessage(locale, + "errorHandlerNotSet", new Object [] {errorCount})); } String systemId = e.getSystemId(); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java index 0c90afec1f8..51f22d713b1 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/DocumentBuilderImpl.java @@ -36,7 +36,7 @@ import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator; import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer; import com.sun.org.apache.xerces.internal.parsers.DOMParser; -import com.sun.org.apache.xerces.internal.util.SecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.Property; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager.State; @@ -46,7 +46,6 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; -import javax.xml.XMLConstants; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; import org.xml.sax.EntityResolver; @@ -125,6 +124,7 @@ public class DocumentBuilderImpl extends DocumentBuilder /** Initial EntityResolver */ private final EntityResolver fInitEntityResolver; + private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; DocumentBuilderImpl(DocumentBuilderFactoryImpl dbf, Hashtable dbfAttrs, Hashtable features) @@ -141,7 +141,7 @@ public class DocumentBuilderImpl extends DocumentBuilder // validation errors with a warning telling the user to set an // ErrorHandler if (dbf.isValidating()) { - fInitErrorHandler = new DefaultValidationErrorHandler(); + fInitErrorHandler = new DefaultValidationErrorHandler(domParser.getXMLParserConfiguration().getLocale()); setErrorHandler(fInitErrorHandler); } else { @@ -173,10 +173,10 @@ public class DocumentBuilderImpl extends DocumentBuilder fSecurityPropertyMgr = new XMLSecurityPropertyManager(); domParser.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - // If the secure processing feature is on set a security manager. - if (secureProcessing) { - domParser.setProperty(SECURITY_MANAGER, new SecurityManager()); + fSecurityManager = new XMLSecurityManager(secureProcessing); + domParser.setProperty(SECURITY_MANAGER, fSecurityManager); + if (secureProcessing) { /** * If secure processing is explicitly set on the factory, the * access properties will be set unless the corresponding @@ -250,9 +250,9 @@ public class DocumentBuilderImpl extends DocumentBuilder String feature = (String) entry.getKey(); boolean value = ((Boolean) entry.getValue()).booleanValue(); domParser.setFeature(feature, value); - } } } + } /** * Set any DocumentBuilderFactory attributes of our underlying DOMParser @@ -303,14 +303,17 @@ public class DocumentBuilderImpl extends DocumentBuilder } } } else { - int index = fSecurityPropertyMgr.getIndex(name); - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)val); - } else { - // Let Xerces code handle the property - domParser.setProperty(name, val); - } + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, val)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, val)) { + //fall back to the existing property manager + domParser.setProperty(name, val); + } + } + } } } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java index 3a6d38f551b..6cc3e9a4678 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/SAXParserImpl.java @@ -20,22 +20,13 @@ package com.sun.org.apache.xerces.internal.jaxp; -import java.io.IOException; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Map; - -import javax.xml.XMLConstants; -import javax.xml.validation.Schema; - import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator; import com.sun.org.apache.xerces.internal.jaxp.validation.XSGrammarPoolContainer; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.Status; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLDocumentHandler; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; @@ -46,6 +37,14 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; import com.sun.org.apache.xerces.internal.xs.AttributePSVI; import com.sun.org.apache.xerces.internal.xs.ElementPSVI; import com.sun.org.apache.xerces.internal.xs.PSVIProvider; +import java.io.IOException; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; +import javax.xml.XMLConstants; +import javax.xml.validation.Schema; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.HandlerBase; @@ -112,6 +111,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser /** Initial EntityResolver */ private final EntityResolver fInitEntityResolver; + private final XMLSecurityManager fSecurityManager; private final XMLSecurityPropertyManager fSecurityPropertyMgr; /** @@ -130,10 +130,10 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser SAXParserImpl(SAXParserFactoryImpl spf, Hashtable features, boolean secureProcessing) throws SAXException { + fSecurityManager = new XMLSecurityManager(secureProcessing); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); - // Instantiate a SAXParser directly and not through SAX so that we use the right ClassLoader - xmlReader = new JAXPSAXParser(this, fSecurityPropertyMgr); + xmlReader = new JAXPSAXParser(this, fSecurityPropertyMgr, fSecurityManager); // JAXP "namespaceAware" == SAX Namespaces feature // Note: there is a compatibility problem here with default values: @@ -154,9 +154,9 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser xmlReader.setProperty0(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - // If the secure processing feature is on set a security manager. + xmlReader.setProperty0(SECURITY_MANAGER, fSecurityManager); + if (secureProcessing) { - xmlReader.setProperty0(SECURITY_MANAGER, new SecurityManager()); /** * By default, secure processing is set, no external access is allowed. * However, we need to check if it is actively set on the factory since we @@ -164,6 +164,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser * the default value */ if (features != null) { + Object temp = features.get(XMLConstants.FEATURE_SECURE_PROCESSING); if (temp != null) { boolean value = ((Boolean) temp).booleanValue(); @@ -185,7 +186,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser // validation errors with a warning telling the user to set an // ErrorHandler. if (spf.isValidating()) { - fInitErrorHandler = new DefaultValidationErrorHandler(); + fInitErrorHandler = new DefaultValidationErrorHandler(xmlReader.getLocale()); xmlReader.setErrorHandler(fInitErrorHandler); } else { @@ -398,28 +399,42 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser private final HashMap fInitFeatures = new HashMap(); private final HashMap fInitProperties = new HashMap(); private final SAXParserImpl fSAXParser; + private XMLSecurityManager fSecurityManager; private XMLSecurityPropertyManager fSecurityPropertyMgr; public JAXPSAXParser() { - this(null, null); + this(null, null, null); } - JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager spm) { + JAXPSAXParser(SAXParserImpl saxParser, XMLSecurityPropertyManager securityPropertyMgr, + XMLSecurityManager securityManager) { super(); fSAXParser = saxParser; - fSecurityPropertyMgr = spm; - + fSecurityManager = securityManager; + fSecurityPropertyMgr = securityPropertyMgr; /** * This class may be used directly. So initialize the security manager if * it is null. */ + if (fSecurityManager == null) { + fSecurityManager = new XMLSecurityManager(true); + try { + super.setProperty(SECURITY_MANAGER, fSecurityManager); + } catch (SAXException e) { + throw new UnsupportedOperationException( + SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), + "property-not-recognized", new Object [] {SECURITY_MANAGER}), e); + } + } if (fSecurityPropertyMgr == null) { fSecurityPropertyMgr = new XMLSecurityPropertyManager(); try { super.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); - } catch (Exception ex) { - //shall not happen + } catch (SAXException e) { + throw new UnsupportedOperationException( + SAXMessageFormatter.formatMessage(fConfiguration.getLocale(), + "property-not-recognized", new Object [] {SECURITY_MANAGER}), e); } } } @@ -437,7 +452,8 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { try { - setProperty(SECURITY_MANAGER, value ? new SecurityManager() : null); + fSecurityManager.setSecureProcessing(value); + setProperty(SECURITY_MANAGER, fSecurityManager); } catch (SAXNotRecognizedException exc) { // If the property is not supported @@ -473,13 +489,7 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser throw new NullPointerException(); } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { - try { - return (super.getProperty(SECURITY_MANAGER) != null); - } - // If the property is not supported the value must be false. - catch (SAXException exc) { - return false; - } + return fSecurityManager.isSecureProcessing(); } return super.getFeature(name); } @@ -558,17 +568,21 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser if (fSAXParser != null && fSAXParser.fSchemaValidator != null) { setSchemaValidatorProperty(name, value); } - /** Check to see if the property is managed by the property manager **/ - int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(name) : -1; - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - } else { - if (!fInitProperties.containsKey(name)) { - fInitProperties.put(name, super.getProperty(name)); + + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { + //fall back to the existing property manager + if (!fInitProperties.containsKey(name)) { + fInitProperties.put(name, super.getProperty(name)); + } + super.setProperty(name, value); } - super.setProperty(name, value); } + } public synchronized Object getProperty(String name) @@ -581,9 +595,18 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser // JAXP 1.2 support return fSAXParser.schemaLanguage; } - int index = (fSecurityPropertyMgr != null) ? fSecurityPropertyMgr.getIndex(name) : -1; - if (index > -1) { - return fSecurityPropertyMgr.getValueByIndex(index); + + /** Check to see if the property is managed by the security manager **/ + String propertyValue = (fSecurityManager != null) ? + fSecurityManager.getLimitAsString(name) : null; + if (propertyValue != null) { + return propertyValue; + } else { + propertyValue = (fSecurityPropertyMgr != null) ? + fSecurityPropertyMgr.getValue(name) : null; + if (propertyValue != null) { + return propertyValue; + } } return super.getProperty(name); @@ -662,6 +685,10 @@ public class SAXParserImpl extends javax.xml.parsers.SAXParser return super.getProperty(name); } + Locale getLocale() { + return fConfiguration.getLocale(); + } + private void setSchemaValidatorFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException { try { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java index f398e037d18..5af27e26fc1 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StAXValidatorHelper.java @@ -26,6 +26,7 @@ package com.sun.org.apache.xerces.internal.jaxp.validation; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import java.io.IOException; import javax.xml.transform.Result; @@ -73,6 +74,19 @@ public final class StAXValidatorHelper implements ValidatorHelper { SAXTransformerFactory tf = fComponentManager.getFeature(Constants.ORACLE_FEATURE_SERVICE_MECHANISM) ? (SAXTransformerFactory)SAXTransformerFactory.newInstance() : (SAXTransformerFactory) TransformerFactory.newInstance(DEFAULT_TRANSFORMER_IMPL, StAXValidatorHelper.class.getClassLoader()); + XMLSecurityManager securityManager = (XMLSecurityManager)fComponentManager.getProperty(Constants.SECURITY_MANAGER); + if (securityManager != null) { + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + if (securityManager.isSet(limit.ordinal())){ + tf.setAttribute(limit.apiProperty(), + securityManager.getLimitValueAsString(limit)); + } + } + if (securityManager.printEntityCountInfo()) { + tf.setAttribute(Constants.JDK_ENTITY_COUNT_INFO, "yes"); + } + } + identityTransformer1 = tf.newTransformer(); identityTransformer2 = tf.newTransformerHandler(); } catch (TransformerConfigurationException e) { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java index c3f1b674134..d6c04fd984a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/StreamValidatorHelper.java @@ -20,28 +20,27 @@ package com.sun.org.apache.xerces.internal.jaxp.validation; -import java.lang.ref.SoftReference; -import java.io.IOException; - -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.sax.SAXTransformerFactory; -import javax.xml.transform.sax.TransformerHandler; -import javax.xml.transform.stream.StreamSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.TransformerFactoryConfigurationError; -import javax.xml.XMLConstants; - import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLErrorReporter; import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter; import com.sun.org.apache.xerces.internal.parsers.XML11Configuration; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; +import java.io.IOException; +import java.lang.ref.SoftReference; +import javax.xml.XMLConstants; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.sax.SAXTransformerFactory; +import javax.xml.transform.sax.TransformerHandler; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; import org.xml.sax.SAXException; /** @@ -86,6 +85,11 @@ final class StreamValidatorHelper implements ValidatorHelper { Constants.XERCES_PROPERTY_PREFIX + Constants.VALIDATION_MANAGER_PROPERTY; private static final String DEFAULT_TRANSFORMER_IMPL = "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl"; + + /** Property id: security manager. */ + private static final String SECURITY_MANAGER = + Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; + // // Data // @@ -165,6 +169,9 @@ final class StreamValidatorHelper implements ValidatorHelper { private XMLParserConfiguration initialize() { XML11Configuration config = new XML11Configuration(); + if (fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) { + config.setProperty(SECURITY_MANAGER, new XMLSecurityManager()); + } config.setProperty(ENTITY_RESOLVER, fComponentManager.getProperty(ENTITY_RESOLVER)); config.setProperty(ERROR_HANDLER, fComponentManager.getProperty(ERROR_HANDLER)); XMLErrorReporter errorReporter = (XMLErrorReporter) fComponentManager.getProperty(ERROR_REPORTER); @@ -182,6 +189,8 @@ final class StreamValidatorHelper implements ValidatorHelper { config.setDTDContentModelHandler(null); config.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fComponentManager.getProperty(Constants.XML_SECURITY_PROPERTY_MANAGER)); + config.setProperty(Constants.SECURITY_MANAGER, + fComponentManager.getProperty(Constants.SECURITY_MANAGER)); fConfiguration = new SoftReference(config); return config; } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java index 8add5d26441..fc652af221a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/ValidatorHandlerImpl.java @@ -49,11 +49,11 @@ import com.sun.org.apache.xerces.internal.util.SAXLocatorWrapper; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -679,10 +679,12 @@ final class ValidatorHandlerImpl extends ValidatorHandler implements SAXParserFactory.newInstance() : new SAXParserFactoryImpl(); spf.setNamespaceAware(true); try { + spf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, + fComponentManager.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)); reader = spf.newSAXParser().getXMLReader(); // If this is a Xerces SAX parser, set the security manager if there is one if (reader instanceof com.sun.org.apache.xerces.internal.parsers.SAXParser) { - SecurityManager securityManager = (SecurityManager) fComponentManager.getProperty(SECURITY_MANAGER); + XMLSecurityManager securityManager = (XMLSecurityManager) fComponentManager.getProperty(SECURITY_MANAGER); if (securityManager != null) { try { reader.setProperty(SECURITY_MANAGER, securityManager); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java index a19088d9a67..f2dadd0fc4a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java @@ -41,10 +41,10 @@ import com.sun.org.apache.xerces.internal.util.DOMInputSource; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXInputSource; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.StAXInputSource; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; @@ -79,7 +79,7 @@ public final class XMLSchemaFactory extends SchemaFactory { private static final String XMLGRAMMAR_POOL = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY; - /** Property identifier: SecurityManager. */ + /** Property identifier: XMLSecurityManager. */ private static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; @@ -108,7 +108,7 @@ public final class XMLSchemaFactory extends SchemaFactory { private ErrorHandlerWrapper fErrorHandlerWrapper; /** The SecurityManager. */ - private SecurityManager fSecurityManager; + private XMLSecurityManager fSecurityManager; /** The Security property manager. */ private XMLSecurityPropertyManager fSecurityPropertyMgr; @@ -141,7 +141,7 @@ public final class XMLSchemaFactory extends SchemaFactory { fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper); // Enable secure processing feature by default - fSecurityManager = new SecurityManager(); + fSecurityManager = new XMLSecurityManager(true); fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); @@ -301,7 +301,7 @@ public final class XMLSchemaFactory extends SchemaFactory { "FeatureNameNull", null)); } if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { - return (fSecurityManager != null); + return (fSecurityManager != null && fSecurityManager.isSecureProcessing()); } try { return fXMLSchemaLoader.getFeature(name); @@ -365,17 +365,15 @@ public final class XMLSchemaFactory extends SchemaFactory { SAXMessageFormatter.formatMessage(null, "jaxp-secureprocessing-feature", null)); } - if (value) { - fSecurityManager = new SecurityManager(); + fSecurityManager.setSecureProcessing(value); + if (value) { if (Constants.IS_JDK8_OR_ABOVE) { fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD, XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP); fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA, XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP); } - } else { - fSecurityManager = null; } fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); @@ -410,9 +408,17 @@ public final class XMLSchemaFactory extends SchemaFactory { "ProperyNameNull", null)); } if (name.equals(SECURITY_MANAGER)) { - fSecurityManager = (SecurityManager) object; + fSecurityManager = XMLSecurityManager.convert(object, fSecurityManager); fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); return; + } else if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (object == null) { + fSecurityPropertyMgr = new XMLSecurityPropertyManager(); + } else { + fSecurityPropertyMgr = (XMLSecurityPropertyManager)object; + } + fXMLSchemaLoader.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); + return; } else if (name.equals(XMLGRAMMAR_POOL)) { throw new SAXNotSupportedException( @@ -420,12 +426,15 @@ public final class XMLSchemaFactory extends SchemaFactory { "property-not-supported", new Object [] {name})); } try { - int index = fSecurityPropertyMgr.getIndex(name); - if (index > -1) { - fSecurityPropertyMgr.setValue(index, - XMLSecurityPropertyManager.State.APIPROPERTY, (String)object); - } else { - fXMLSchemaLoader.setProperty(name, object); + //check if the property is managed by security manager + if (fSecurityManager == null || + !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, object)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, object)) { + //fall back to the existing property manager + fXMLSchemaLoader.setProperty(name, object); + } } } catch (XMLConfigurationException e) { diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java index 74e30daec1d..dcbbabd4d4a 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaValidatorComponentManager.java @@ -39,10 +39,10 @@ import com.sun.org.apache.xerces.internal.util.FeatureState; import com.sun.org.apache.xerces.internal.util.NamespaceSupport; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; @@ -181,7 +181,7 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin private final HashMap fInitProperties = new HashMap(); /** Stores the initial security manager. */ - private final SecurityManager fInitSecurityManager; + private XMLSecurityManager fInitSecurityManager; /** Stores the initial security property manager. */ private final XMLSecurityPropertyManager fSecurityPropertyMgr; @@ -221,12 +221,6 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin fComponents.put(ENTITY_RESOLVER, null); fComponents.put(ERROR_HANDLER, null); - if (System.getSecurityManager() != null) { - _isSecureMode = true; - setProperty(SECURITY_MANAGER, new SecurityManager()); - } else { - fComponents.put(SECURITY_MANAGER, null); - } fComponents.put(SYMBOL_TABLE, new SymbolTable()); // setup grammar pool @@ -241,15 +235,21 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin addRecognizedParamsAndSetDefaults(fErrorReporter, grammarContainer); addRecognizedParamsAndSetDefaults(fSchemaValidator, grammarContainer); - // if the secure processing feature is set to true, add a security manager to the configuration - Boolean secureProcessing = grammarContainer.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING); - if (Boolean.TRUE.equals(secureProcessing)) { - fInitSecurityManager = new SecurityManager(); + boolean secureProcessing = grammarContainer.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING); + if (System.getSecurityManager() != null) { + _isSecureMode = true; + secureProcessing = true; } - else { - fInitSecurityManager = null; + + fInitSecurityManager = (XMLSecurityManager) + grammarContainer.getProperty(SECURITY_MANAGER); + if (fInitSecurityManager != null ) { + fInitSecurityManager.setSecureProcessing(secureProcessing); + } else { + fInitSecurityManager = new XMLSecurityManager(secureProcessing); } - fComponents.put(SECURITY_MANAGER, fInitSecurityManager); + + setProperty(SECURITY_MANAGER, fInitSecurityManager); //pass on properties set on SchemaFactory fSecurityPropertyMgr = (XMLSecurityPropertyManager) @@ -281,7 +281,7 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin return FeatureState.is(fUseGrammarPoolOnly); } else if (XMLConstants.FEATURE_SECURE_PROCESSING.equals(featureId)) { - return FeatureState.is(getProperty(SECURITY_MANAGER) != null); + return FeatureState.is(fInitSecurityManager.isSecureProcessing()); } else if (SCHEMA_ELEMENT_DEFAULT.equals(featureId)) { return FeatureState.is(true); //pre-condition: VALIDATION and SCHEMA_VALIDATION are always true @@ -311,7 +311,9 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin if (_isSecureMode && !value) { throw new XMLConfigurationException(Status.NOT_ALLOWED, XMLConstants.FEATURE_SECURE_PROCESSING); } - setProperty(SECURITY_MANAGER, value ? new SecurityManager() : null); + + fInitSecurityManager.setSecureProcessing(value); + setProperty(SECURITY_MANAGER, fInitSecurityManager); if (value && Constants.IS_JDK8_OR_ABOVE) { fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD, @@ -390,10 +392,19 @@ final class XMLSchemaValidatorComponentManager extends ParserConfigurationSettin fComponents.put(propertyId, value); return; } - if (!fInitProperties.containsKey(propertyId)) { - fInitProperties.put(propertyId, super.getProperty(propertyId)); + //check if the property is managed by security manager + if (fInitSecurityManager == null || + !fInitSecurityManager.setLimit(propertyId, XMLSecurityManager.State.APIPROPERTY, value)) { + //check if the property is managed by security property manager + if (fSecurityPropertyMgr == null || + !fSecurityPropertyMgr.setValue(propertyId, XMLSecurityPropertyManager.State.APIPROPERTY, value)) { + //fall back to the existing property manager + if (!fInitProperties.containsKey(propertyId)) { + fInitProperties.put(propertyId, super.getProperty(propertyId)); + } + super.setProperty(propertyId, value); + } } - super.setProperty(propertyId, value); } /** diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java index 726f31e76b5..eea7057417b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/AbstractSAXParser.java @@ -20,18 +20,15 @@ package com.sun.org.apache.xerces.internal.parsers; -import java.io.IOException; -import java.util.Locale; - import com.sun.org.apache.xerces.internal.impl.Constants; -import com.sun.org.apache.xerces.internal.util.Status; -import com.sun.org.apache.xerces.internal.xs.PSVIProvider; -import com.sun.org.apache.xerces.internal.util.EntityResolverWrapper; import com.sun.org.apache.xerces.internal.util.EntityResolver2Wrapper; +import com.sun.org.apache.xerces.internal.util.EntityResolverWrapper; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; +import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolHash; import com.sun.org.apache.xerces.internal.util.XMLSymbols; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -48,15 +45,17 @@ import com.sun.org.apache.xerces.internal.xni.parser.XMLParseException; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; import com.sun.org.apache.xerces.internal.xs.AttributePSVI; import com.sun.org.apache.xerces.internal.xs.ElementPSVI; +import com.sun.org.apache.xerces.internal.xs.PSVIProvider; +import java.io.IOException; +import java.util.Locale; +import javax.xml.XMLConstants; import org.xml.sax.AttributeList; -import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.DTDHandler; import org.xml.sax.DocumentHandler; import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; -import org.xml.sax.Locator; import org.xml.sax.Parser; import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; @@ -131,6 +130,10 @@ public abstract class AbstractSAXParser protected static final String DOM_NODE = Constants.SAX_PROPERTY_PREFIX + Constants.DOM_NODE_PROPERTY; + /** Property id: security manager. */ + private static final String SECURITY_MANAGER = + Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; + /** Recognized properties. */ private static final String[] RECOGNIZED_PROPERTIES = { LEXICAL_HANDLER, @@ -1645,19 +1648,13 @@ public abstract class AbstractSAXParser // Drop through and perform default processing // } - - // - // Xerces Features - // - - /* - else if (featureId.startsWith(XERCES_FEATURES_PREFIX)) { - String feature = featureId.substring(XERCES_FEATURES_PREFIX.length()); - // - // Drop through and perform default processing - // + else if (featureId.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { + if (state) { + if (fConfiguration.getProperty(SECURITY_MANAGER )==null) { + fConfiguration.setProperty(SECURITY_MANAGER, new XMLSecurityManager()); + } + } } - */ // // Default handling diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java index f681fadbd33..f2020efda4b 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DOMParser.java @@ -29,6 +29,7 @@ import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; @@ -531,7 +532,54 @@ public class DOMParser */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + /** + * It's possible for users to set a security manager through the interface. + * If it's the old SecurityManager, convert it to the new XMLSecurityManager + */ + if (propertyId.equals(Constants.SECURITY_MANAGER)) { + securityManager = XMLSecurityManager.convert(value, securityManager); + setProperty0(Constants.SECURITY_MANAGER, securityManager); + return; + } + if (propertyId.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (value == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + } else { + securityPropertyManager = (XMLSecurityPropertyManager)value; + } + setProperty0(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + return; + } + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + setProperty0(Constants.SECURITY_MANAGER, securityManager); + } + + if (securityPropertyManager == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + setProperty0(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + } + int index = securityPropertyManager.getIndex(propertyId); + + if (index > -1) { + /** + * this is a direct call to this parser, not a subclass since + * internally the support of this property is done through + * XMLSecurityPropertyManager + */ + securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); + } else { + //check if the property is managed by security manager + if (!securityManager.setLimit(propertyId, XMLSecurityManager.State.APIPROPERTY, value)) { + //fall back to the default configuration to handle the property + setProperty0(propertyId, value); + } + } + } + + public void setProperty0(String propertyId, Object value) + throws SAXNotRecognizedException, SAXNotSupportedException { try { fConfiguration.setProperty(propertyId, value); } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java index c63ae43923e..0f37f7c375e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/DTDConfiguration.java @@ -185,9 +185,12 @@ public class DTDConfiguration protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; - /** Property identifier: Security property manager. */ - protected static final String XML_SECURITY_PROPERTY_MANAGER = - Constants.XML_SECURITY_PROPERTY_MANAGER; + /** Property identifier: Security property manager. */ + protected static final String XML_SECURITY_PROPERTY_MANAGER = + Constants.XML_SECURITY_PROPERTY_MANAGER; + + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; // debugging @@ -334,6 +337,7 @@ public class DTDConfiguration JAXP_SCHEMA_SOURCE, JAXP_SCHEMA_LANGUAGE, LOCALE, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java index 481eda6f21e..469780136cd 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/NonValidatingConfiguration.java @@ -158,9 +158,12 @@ public class NonValidatingConfiguration protected static final String LOCALE = Constants.XERCES_PROPERTY_PREFIX + Constants.LOCALE_PROPERTY; - /** Property identifier: Security property manager. */ - protected static final String XML_SECURITY_PROPERTY_MANAGER = - Constants.XML_SECURITY_PROPERTY_MANAGER; + /** Property identifier: Security property manager. */ + protected static final String XML_SECURITY_PROPERTY_MANAGER = + Constants.XML_SECURITY_PROPERTY_MANAGER; + + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; // debugging @@ -316,6 +319,7 @@ public class NonValidatingConfiguration DATATYPE_VALIDATOR_FACTORY, VALIDATION_MANAGER, LOCALE, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java index 1ba84aff710..48b8a1ed538 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SAXParser.java @@ -22,6 +22,7 @@ package com.sun.org.apache.xerces.internal.parsers; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; @@ -76,7 +77,7 @@ public class SAXParser XMLGRAMMAR_POOL, }; - XMLSecurityPropertyManager securityPropertyManager; + // // Constructors // @@ -130,11 +131,36 @@ public class SAXParser */ public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { + /** + * It's possible for users to set a security manager through the interface. + * If it's the old SecurityManager, convert it to the new XMLSecurityManager + */ + if (name.equals(Constants.SECURITY_MANAGER)) { + securityManager = XMLSecurityManager.convert(value, securityManager); + super.setProperty(Constants.SECURITY_MANAGER, securityManager); + return; + } + if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { + if (value == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + } else { + securityPropertyManager = (XMLSecurityPropertyManager)value; + } + super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + return; + } + + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + super.setProperty(Constants.SECURITY_MANAGER, securityManager); + } + if (securityPropertyManager == null) { securityPropertyManager = new XMLSecurityPropertyManager(); + super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); } - int index = securityPropertyManager.getIndex(name); + int index = securityPropertyManager.getIndex(name); if (index > -1) { /** * this is a direct call to this parser, not a subclass since @@ -142,9 +168,12 @@ public class SAXParser * XMLSecurityPropertyManager */ securityPropertyManager.setValue(index, XMLSecurityPropertyManager.State.APIPROPERTY, (String)value); - super.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); } else { - super.setProperty(name, value); + //check if the property is managed by security manager + if (!securityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, value)) { + //fall back to the default configuration to handle the property + super.setProperty(name, value); + } } } } // class SAXParser diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java index df32bfa41d9..65c85d164ca 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/SecurityConfiguration.java @@ -23,8 +23,8 @@ package com.sun.org.apache.xerces.internal.parsers; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; /** * This configuration allows Xerces to behave in a security-conscious manner; that is, @@ -44,6 +44,7 @@ import com.sun.org.apache.xerces.internal.util.SymbolTable; * * @author Neil Graham, IBM * + * @version $Id: SecurityConfiguration.java,v 1.6 2010-11-01 04:40:09 joehw Exp $ */ public class SecurityConfiguration extends XIncludeAwareParserConfiguration { @@ -107,7 +108,7 @@ public class SecurityConfiguration extends XIncludeAwareParserConfiguration super(symbolTable, grammarPool, parentSettings); // create the SecurityManager property: - setProperty(SECURITY_MANAGER_PROPERTY, new SecurityManager()); + setProperty(SECURITY_MANAGER_PROPERTY, new XMLSecurityManager(true)); } // (SymbolTable,XMLGrammarPool) } // class SecurityConfiguration diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java index 993ef6132bd..bbcbceed10e 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XML11Configuration.java @@ -52,6 +52,7 @@ import com.sun.org.apache.xerces.internal.util.FeatureState; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; import com.sun.org.apache.xerces.internal.util.PropertyState; import com.sun.org.apache.xerces.internal.util.SymbolTable; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XMLDTDContentModelHandler; import com.sun.org.apache.xerces.internal.xni.XMLDTDHandler; @@ -279,6 +280,8 @@ public class XML11Configuration extends ParserConfigurationSettings private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; + /** Property identifier: Security manager. */ + private static final String SECURITY_MANAGER = Constants.SECURITY_MANAGER; // debugging @@ -449,26 +452,26 @@ public class XML11Configuration extends ParserConfigurationSettings XMLGrammarPool grammarPool, XMLComponentManager parentSettings) { - super(parentSettings); + super(parentSettings); - // create a vector to hold all the components in use - // XML 1.0 specialized components - fComponents = new ArrayList(); - // XML 1.1 specialized components - fXML11Components = new ArrayList(); - // Common components for XML 1.1. and XML 1.0 - fCommonComponents = new ArrayList(); + // create a vector to hold all the components in use + // XML 1.0 specialized components + fComponents = new ArrayList(); + // XML 1.1 specialized components + fXML11Components = new ArrayList(); + // Common components for XML 1.1. and XML 1.0 + fCommonComponents = new ArrayList(); - // create table for features and properties - fFeatures = new HashMap(); - fProperties = new HashMap(); + // create table for features and properties + fFeatures = new HashMap(); + fProperties = new HashMap(); // add default recognized features final String[] recognizedFeatures = { CONTINUE_AFTER_FATAL_ERROR, LOAD_EXTERNAL_DTD, // from XMLDTDScannerImpl - VALIDATION, - NAMESPACES, + VALIDATION, + NAMESPACES, NORMALIZE_DATA, SCHEMA_ELEMENT_DEFAULT, SCHEMA_AUGMENT_PSVI, GENERATE_SYNTHETIC_ANNOTATIONS, VALIDATE_ANNOTATIONS, HONOUR_ALL_SCHEMALOCATIONS, NAMESPACE_GROWTH, @@ -479,47 +482,47 @@ public class XML11Configuration extends ParserConfigurationSettings // features might not have been set and it would cause a // not-recognized exception to be thrown. -Ac XMLSCHEMA_VALIDATION, XMLSCHEMA_FULL_CHECKING, - EXTERNAL_GENERAL_ENTITIES, - EXTERNAL_PARAMETER_ENTITIES, - PARSER_SETTINGS, - XMLConstants.FEATURE_SECURE_PROCESSING + EXTERNAL_GENERAL_ENTITIES, + EXTERNAL_PARAMETER_ENTITIES, + PARSER_SETTINGS, + XMLConstants.FEATURE_SECURE_PROCESSING }; addRecognizedFeatures(recognizedFeatures); - // set state for default features - fFeatures.put(VALIDATION, Boolean.FALSE); - fFeatures.put(NAMESPACES, Boolean.TRUE); - fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE); - fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE); - fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE); - fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE); - fFeatures.put(SCHEMA_ELEMENT_DEFAULT, Boolean.TRUE); - fFeatures.put(NORMALIZE_DATA, Boolean.TRUE); - fFeatures.put(SCHEMA_AUGMENT_PSVI, Boolean.TRUE); - fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE); - fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE); - fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE); - fFeatures.put(NAMESPACE_GROWTH, Boolean.FALSE); - fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE); - fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE); - fFeatures.put(PARSER_SETTINGS, Boolean.TRUE); - fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); + // set state for default features + fFeatures.put(VALIDATION, Boolean.FALSE); + fFeatures.put(NAMESPACES, Boolean.TRUE); + fFeatures.put(EXTERNAL_GENERAL_ENTITIES, Boolean.TRUE); + fFeatures.put(EXTERNAL_PARAMETER_ENTITIES, Boolean.TRUE); + fFeatures.put(CONTINUE_AFTER_FATAL_ERROR, Boolean.FALSE); + fFeatures.put(LOAD_EXTERNAL_DTD, Boolean.TRUE); + fFeatures.put(SCHEMA_ELEMENT_DEFAULT, Boolean.TRUE); + fFeatures.put(NORMALIZE_DATA, Boolean.TRUE); + fFeatures.put(SCHEMA_AUGMENT_PSVI, Boolean.TRUE); + fFeatures.put(GENERATE_SYNTHETIC_ANNOTATIONS, Boolean.FALSE); + fFeatures.put(VALIDATE_ANNOTATIONS, Boolean.FALSE); + fFeatures.put(HONOUR_ALL_SCHEMALOCATIONS, Boolean.FALSE); + fFeatures.put(NAMESPACE_GROWTH, Boolean.FALSE); + fFeatures.put(TOLERATE_DUPLICATES, Boolean.FALSE); + fFeatures.put(USE_GRAMMAR_POOL_ONLY, Boolean.FALSE); + fFeatures.put(PARSER_SETTINGS, Boolean.TRUE); + fFeatures.put(XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE); // add default recognized properties final String[] recognizedProperties = { - SYMBOL_TABLE, - ERROR_HANDLER, - ENTITY_RESOLVER, + SYMBOL_TABLE, + ERROR_HANDLER, + ENTITY_RESOLVER, ERROR_REPORTER, ENTITY_MANAGER, DOCUMENT_SCANNER, DTD_SCANNER, DTD_PROCESSOR, DTD_VALIDATOR, - DATATYPE_VALIDATOR_FACTORY, - VALIDATION_MANAGER, - SCHEMA_VALIDATOR, - XML_STRING, + DATATYPE_VALIDATOR_FACTORY, + VALIDATION_MANAGER, + SCHEMA_VALIDATOR, + XML_STRING, XMLGRAMMAR_POOL, JAXP_SCHEMA_SOURCE, JAXP_SCHEMA_LANGUAGE, @@ -531,19 +534,20 @@ public class XML11Configuration extends ParserConfigurationSettings SCHEMA_NONS_LOCATION, LOCALE, SCHEMA_DV_FACTORY, + SECURITY_MANAGER, XML_SECURITY_PROPERTY_MANAGER }; addRecognizedProperties(recognizedProperties); - if (symbolTable == null) { - symbolTable = new SymbolTable(); - } - fSymbolTable = symbolTable; - fProperties.put(SYMBOL_TABLE, fSymbolTable); + if (symbolTable == null) { + symbolTable = new SymbolTable(); + } + fSymbolTable = symbolTable; + fProperties.put(SYMBOL_TABLE, fSymbolTable); fGrammarPool = grammarPool; if (fGrammarPool != null) { - fProperties.put(XMLGRAMMAR_POOL, fGrammarPool); + fProperties.put(XMLGRAMMAR_POOL, fGrammarPool); } fEntityManager = new XMLEntityManager(); @@ -579,8 +583,6 @@ public class XML11Configuration extends ParserConfigurationSettings fVersionDetector = new XMLVersionDetector(); - fProperties.put(XML_SECURITY_PROPERTY_MANAGER, new XMLSecurityPropertyManager()); - // add message formatters if (fErrorReporter.getMessageFormatter(XMLMessageFormatter.XML_DOMAIN) == null) { XMLMessageFormatter xmft = new XMLMessageFormatter(); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java index 210b7ce9cc6..970cc51cd26 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/parsers/XMLParser.java @@ -23,6 +23,8 @@ package com.sun.org.apache.xerces.internal.parsers; import java.io.IOException; import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; @@ -78,6 +80,13 @@ public abstract class XMLParser { /** The parser configuration. */ protected XMLParserConfiguration fConfiguration; + /** The XML Security Manager. */ + XMLSecurityManager securityManager; + + /** The XML Security Property Manager. */ + XMLSecurityPropertyManager securityPropertyManager; + + // // Constructors // @@ -118,6 +127,15 @@ public abstract class XMLParser { */ public void parse(XMLInputSource inputSource) throws XNIException, IOException { + // null indicates that the parser is called directly, initialize them + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + fConfiguration.setProperty(Constants.SECURITY_MANAGER, securityManager); + } + if (securityPropertyManager == null) { + securityPropertyManager = new XMLSecurityPropertyManager(); + fConfiguration.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, securityPropertyManager); + } reset(); fConfiguration.parse(inputSource); diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java index dd510b622bc..d916f5bc516 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java @@ -61,8 +61,6 @@ package com.sun.org.apache.xerces.internal.util; import com.sun.org.apache.xerces.internal.impl.Constants; -import java.security.AccessController; -import java.security.PrivilegedAction; /** * This class is a container for parser settings that relate to * security, or more specifically, it is intended to be used to prevent denial-of-service @@ -79,7 +77,6 @@ import java.security.PrivilegedAction; * * @author Neil Graham, IBM * - * @version $Id: SecurityManager.java,v 1.5 2010-11-01 04:40:14 joehw Exp $ */ public final class SecurityManager { @@ -179,48 +176,40 @@ public final class SecurityManager { private void readSystemProperties(){ - //TODO: also read SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT - try { - String value = getSystemProperty(Constants.ENTITY_EXPANSION_LIMIT); - if(value != null && !value.equals("")){ - entityExpansionLimit = Integer.parseInt(value); - if (entityExpansionLimit < 0) - entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; - } - else - entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; - }catch(Exception ex){} + try { + String value = System.getProperty(Constants.ENTITY_EXPANSION_LIMIT); + if(value != null && !value.equals("")){ + entityExpansionLimit = Integer.parseInt(value); + if (entityExpansionLimit < 0) + entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; + } + else + entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT; + }catch(Exception ex){} - try { - String value = getSystemProperty(Constants.MAX_OCCUR_LIMIT); - if(value != null && !value.equals("")){ - maxOccurLimit = Integer.parseInt(value); - if (maxOccurLimit < 0) - maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; - } - else - maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; - }catch(Exception ex){} + try { + String value = System.getProperty(Constants.MAX_OCCUR_LIMIT); + if(value != null && !value.equals("")){ + maxOccurLimit = Integer.parseInt(value); + if (maxOccurLimit < 0) + maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; + } + else + maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT; + }catch(Exception ex){} - try { - String value = getSystemProperty(Constants.SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT); - if(value != null && !value.equals("")){ - fElementAttributeLimit = Integer.parseInt(value); - if ( fElementAttributeLimit < 0) - fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; - } - else - fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; + try { + String value = System.getProperty(Constants.ELEMENT_ATTRIBUTE_LIMIT); + if(value != null && !value.equals("")){ + fElementAttributeLimit = Integer.parseInt(value); + if ( fElementAttributeLimit < 0) + fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; + } + else + fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT; }catch(Exception ex){} } - private String getSystemProperty(final String propName) { - return AccessController.doPrivileged(new PrivilegedAction() { - public String run() { - return System.getProperty(propName); - } - }); - } } // class SecurityManager diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java index b3d9ed7f925..8e62c1f1d75 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/SymbolTable.java @@ -173,7 +173,7 @@ public class SymbolTable { for (int i = 0; i < length; i++) { code = code * 37 + symbol.charAt(i); } - return code & 0x7FFFFFF; + return code & 0x7FFFFFFF; } // hash(String):int @@ -194,7 +194,7 @@ public class SymbolTable { for (int i = 0; i < length; i++) { code = code * 37 + buffer[offset + i]; } - return code & 0x7FFFFFF; + return code & 0x7FFFFFFF; } // hash(char[],int,int):int diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java b/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java index e420f2616b6..a92cd20e399 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/util/URI.java @@ -689,9 +689,13 @@ import java.util.Objects; if (!initializeAuthority(uriSpec.substring(startPos, index))) { index = startPos - 2; } - } - else { + } else if (index < uriSpecLen) { + //Same as java.net.URI: + // DEVIATION: Allow empty authority prior to non-empty + // path, query component or fragment identifier m_host = ""; + } else { + throw new MalformedURIException("Expected authority."); } } diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java new file mode 100644 index 00000000000..82667edeed0 --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLLimitAnalyzer.java @@ -0,0 +1,239 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package com.sun.org.apache.xerces.internal.utils; + +import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager.Limit; +import java.util.Formatter; +import java.util.HashMap; +import java.util.Map; + +/** + * A helper for analyzing entity expansion limits + * + * @author Joe Wang Oracle Corp. + * + */ +public final class XMLLimitAnalyzer { + + /** + * Map old property names with the new ones + */ + public static enum NameMap { + ENTITY_EXPANSION_LIMIT(Constants.SP_ENTITY_EXPANSION_LIMIT, Constants.ENTITY_EXPANSION_LIMIT), + MAX_OCCUR_NODE_LIMIT(Constants.SP_MAX_OCCUR_LIMIT, Constants.MAX_OCCUR_LIMIT), + ELEMENT_ATTRIBUTE_LIMIT(Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, Constants.ELEMENT_ATTRIBUTE_LIMIT); + + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + + private XMLSecurityManager securityManager; + /** + * Max value accumulated for each property + */ + private final int[] values; + /** + * Names of the entities corresponding to their max values + */ + private final String[] names; + /** + * Total value of accumulated entities + */ + private final int[] totalValue; + + /** + * Maintain values of the top 10 elements in the process of parsing + */ + private final Map[] caches; + + private String entityStart, entityEnd; + /** + * Default constructor. Establishes default values for known security + * vulnerabilities. + */ + public XMLLimitAnalyzer(XMLSecurityManager securityManager) { + this.securityManager = securityManager; + values = new int[Limit.values().length]; + totalValue = new int[Limit.values().length]; + names = new String[Limit.values().length]; + caches = new Map[Limit.values().length]; + } + + /** + * Add the value to the current max count for the specified property + * To find the max value of all entities, set no limit + * + * @param limit the type of the property + * @param entityName the name of the entity + * @param value the value of the entity + */ + public void addValue(Limit limit, String entityName, int value) { + addValue(limit.ordinal(), entityName, value); + } + + /** + * Add the value to the current count by the index of the property + * @param index the index of the property + * @param entityName the name of the entity + * @param value the value of the entity + */ + public void addValue(int index, String entityName, int value) { + if (index == Limit.ENTITY_EXPANSION_LIMIT.ordinal() || + index == Limit.MAX_OCCUR_NODE_LIMIT.ordinal() || + index == Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal()) { + totalValue[index] += value; + return; + } + + Map cache; + if (caches[index] == null) { + cache = new HashMap(10); + caches[index] = cache; + } else { + cache = caches[index]; + } + + int accumulatedValue = value; + if (cache.containsKey(entityName)) { + accumulatedValue += cache.get(entityName).intValue(); + cache.put(entityName, Integer.valueOf(accumulatedValue)); + } else { + cache.put(entityName, Integer.valueOf(value)); + } + + if (accumulatedValue > values[index]) { + values[index] = accumulatedValue; + names[index] = entityName; + } + + + if (index == Limit.GENEAL_ENTITY_SIZE_LIMIT.ordinal() || + index == Limit.PARAMETER_ENTITY_SIZE_LIMIT.ordinal()) { + totalValue[Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()] += value; + } + } + + /** + * Return the value of the current max count for the specified property + * + * @param limit the property + * @return the value of the property + */ + public int getValue(Limit limit) { + return values[limit.ordinal()]; + } + + public int getValue(int index) { + return values[index]; + } + /** + * Return the total value accumulated so far + * + * @param limit the property + * @return the accumulated value of the property + */ + public int getTotalValue(Limit limit) { + return totalValue[limit.ordinal()]; + } + + public int getTotalValue(int index) { + return totalValue[index]; + } + /** + * Return the current max value (count or length) by the index of a property + * @param index the index of a property + * @return count of a property + */ + public int getValueByIndex(int index) { + return values[index]; + } + + public void startEntity(String name) { + entityStart = name; + } + + public boolean isTracking(String name) { + if (entityStart == null) { + return false; + } + return entityStart.equals(name); + } + /** + * Stop tracking the entity + * @param limit the limit property + * @param name the name of an entity + */ + public void endEntity(Limit limit, String name) { + entityStart = ""; + Map cache = caches[limit.ordinal()]; + if (cache != null) { + cache.remove(name); + } + } + + public void debugPrint() { + Formatter formatter = new Formatter(); + System.out.println(formatter.format("%30s %15s %15s %15s %30s", + "Property","Limit","Total size","Size","Entity Name")); + + for (Limit limit : Limit.values()) { + formatter = new Formatter(); + System.out.println(formatter.format("%30s %15d %15d %15d %30s", + limit.name(), + securityManager.getLimit(limit), + totalValue[limit.ordinal()], + values[limit.ordinal()], + names[limit.ordinal()])); + } + } +} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java new file mode 100644 index 00000000000..a28e80dc81a --- /dev/null +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityManager.java @@ -0,0 +1,555 @@ +/* + * Copyright (c) 2013 Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.org.apache.xerces.internal.utils; + +import com.sun.org.apache.xerces.internal.impl.Constants; +import com.sun.org.apache.xerces.internal.util.SecurityManager; + +/** + * This class manages standard and implementation-specific limitations. + * + */ +public final class XMLSecurityManager { + + /** + * States of the settings of a property, in the order: default value, value + * set by FEATURE_SECURE_PROCESSING, jaxp.properties file, jaxp system + * properties, and jaxp api properties + */ + public static enum State { + //this order reflects the overriding order + + DEFAULT("default"), FSP("FEATURE_SECURE_PROCESSING"), + JAXPDOTPROPERTIES("jaxp.properties"), SYSTEMPROPERTY("system property"), + APIPROPERTY("property"); + + final String literal; + State(String literal) { + this.literal = literal; + } + + String literal() { + return literal; + } + } + + /** + * Limits managed by the security manager + */ + public static enum Limit { + + ENTITY_EXPANSION_LIMIT(Constants.JDK_ENTITY_EXPANSION_LIMIT, Constants.SP_ENTITY_EXPANSION_LIMIT, 0, 64000), + MAX_OCCUR_NODE_LIMIT(Constants.JDK_MAX_OCCUR_LIMIT, Constants.SP_MAX_OCCUR_LIMIT, 0, 5000), + ELEMENT_ATTRIBUTE_LIMIT(Constants.JDK_ELEMENT_ATTRIBUTE_LIMIT, Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, 0, 10000), + TOTAL_ENTITY_SIZE_LIMIT(Constants.JDK_TOTAL_ENTITY_SIZE_LIMIT, Constants.SP_TOTAL_ENTITY_SIZE_LIMIT, 0, 50000000), + GENEAL_ENTITY_SIZE_LIMIT(Constants.JDK_GENEAL_ENTITY_SIZE_LIMIT, Constants.SP_GENEAL_ENTITY_SIZE_LIMIT, 0, 0), + PARAMETER_ENTITY_SIZE_LIMIT(Constants.JDK_PARAMETER_ENTITY_SIZE_LIMIT, Constants.SP_PARAMETER_ENTITY_SIZE_LIMIT, 0, 1000000); + + final String apiProperty; + final String systemProperty; + final int defaultValue; + final int secureValue; + + Limit(String apiProperty, String systemProperty, int value, int secureValue) { + this.apiProperty = apiProperty; + this.systemProperty = systemProperty; + this.defaultValue = value; + this.secureValue = secureValue; + } + + public boolean equalsAPIPropertyName(String propertyName) { + return (propertyName == null) ? false : apiProperty.equals(propertyName); + } + + public boolean equalsSystemPropertyName(String propertyName) { + return (propertyName == null) ? false : systemProperty.equals(propertyName); + } + + public String apiProperty() { + return apiProperty; + } + + String systemProperty() { + return systemProperty; + } + + int defaultValue() { + return defaultValue; + } + + int secureValue() { + return secureValue; + } + } + + /** + * Map old property names with the new ones + */ + public static enum NameMap { + + ENTITY_EXPANSION_LIMIT(Constants.SP_ENTITY_EXPANSION_LIMIT, Constants.ENTITY_EXPANSION_LIMIT), + MAX_OCCUR_NODE_LIMIT(Constants.SP_MAX_OCCUR_LIMIT, Constants.MAX_OCCUR_LIMIT), + ELEMENT_ATTRIBUTE_LIMIT(Constants.SP_ELEMENT_ATTRIBUTE_LIMIT, Constants.ELEMENT_ATTRIBUTE_LIMIT); + final String newName; + final String oldName; + + NameMap(String newName, String oldName) { + this.newName = newName; + this.oldName = oldName; + } + + String getOldName(String newName) { + if (newName.equals(this.newName)) { + return oldName; + } + return null; + } + } + private static final int NO_LIMIT = 0; + /** + * Values of the properties + */ + private final int[] values; + /** + * States of the settings for each property + */ + private State[] states; + /** + * Flag indicating if secure processing is set + */ + boolean secureProcessing; + + /** + * States that determine if properties are set explicitly + */ + private boolean[] isSet; + + + private XMLLimitAnalyzer limitAnalyzer; + /** + * Index of the special entityCountInfo property + */ + private int indexEntityCountInfo = 10000; + private String printEntityCountInfo = ""; + + /** + * Default constructor. Establishes default values for known security + * vulnerabilities. + */ + public XMLSecurityManager() { + this(false); + } + + /** + * Instantiate Security Manager in accordance with the status of + * secure processing + * @param secureProcessing + */ + public XMLSecurityManager(boolean secureProcessing) { + limitAnalyzer = new XMLLimitAnalyzer(this); + values = new int[Limit.values().length]; + states = new State[Limit.values().length]; + isSet = new boolean[Limit.values().length]; + this.secureProcessing = secureProcessing; + for (Limit limit : Limit.values()) { + if (secureProcessing) { + values[limit.ordinal()] = limit.secureValue; + states[limit.ordinal()] = State.FSP; + } else { + values[limit.ordinal()] = limit.defaultValue(); + states[limit.ordinal()] = State.DEFAULT; + } + } + //read system properties or jaxp.properties + readSystemProperties(); + } + + /** + * Setting FEATURE_SECURE_PROCESSING explicitly + */ + public void setSecureProcessing(boolean secure) { + secureProcessing = secure; + for (Limit limit : Limit.values()) { + if (secure) { + setLimit(limit.ordinal(), State.FSP, limit.secureValue()); + } else { + setLimit(limit.ordinal(), State.FSP, limit.defaultValue()); + } + } + } + + /** + * Return the state of secure processing + * @return the state of secure processing + */ + public boolean isSecureProcessing() { + return secureProcessing; + } + + + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security manager; false + * if otherwise. + */ + public boolean setLimit(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setLimit(index, state, value); + return true; + } + return false; + } + + /** + * Set the value for a specific limit. + * + * @param limit the limit + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(Limit limit, State state, int value) { + setLimit(limit.ordinal(), state, value); + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, Object value) { + if (index == indexEntityCountInfo) { + printEntityCountInfo = (String)value; + } else { + int temp = 0; + try { + temp = Integer.parseInt((String) value); + if (temp < 0) { + temp = 0; + } + } catch (NumberFormatException e) {} + setLimit(index, state, temp); + } + } + + /** + * Set the value of a property by its index + * + * @param index the index of the property + * @param state the state of the property + * @param value the value of the property + */ + public void setLimit(int index, State state, int value) { + if (index == indexEntityCountInfo) { + //if it's explicitly set, it's treated as yes no matter the value + printEntityCountInfo = Constants.JDK_YES; + } else { + //only update if it shall override + if (state.compareTo(states[index]) >= 0) { + values[index] = value; + states[index] = state; + isSet[index] = true; + } + } + } + + /** + * Return the value of the specified property + * + * @param propertyName the property name + * @return the value of the property as a string. If a property is managed + * by this manager, its value shall not be null. + */ + public String getLimitAsString(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getLimitValueByIndex(index); + } + + return null; + } + /** + * Return the value of the specified property + * + * @param limit the property + * @return the value of the property + */ + public int getLimit(Limit limit) { + return values[limit.ordinal()]; + } + + /** + * Return the value of a property by its ordinal + * + * @param limit the property + * @return value of a property + */ + public String getLimitValueAsString(Limit limit) { + return Integer.toString(values[limit.ordinal()]); + } + + /** + * Return the value of a property by its ordinal + * + * @param index the index of a property + * @return limit of a property as a string + */ + public String getLimitValueByIndex(int index) { + if (index == indexEntityCountInfo) { + return printEntityCountInfo; + } + + return Integer.toString(values[index]); + } + + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public State getState(Limit limit) { + return states[limit.ordinal()]; + } + + /** + * Return the state of the limit property + * + * @param limit the limit + * @return the state of the limit property + */ + public String getStateLiteral(Limit limit) { + return states[limit.ordinal()].literal(); + } + + /** + * Get the index by property name + * + * @param propertyName property name + * @return the index of the property if found; return -1 if not + */ + public int getIndex(String propertyName) { + for (Limit limit : Limit.values()) { + if (limit.equalsAPIPropertyName(propertyName)) { + //internally, ordinal is used as index + return limit.ordinal(); + } + } + //special property to return entity count info + if (propertyName.equals(Constants.JDK_ENTITY_COUNT_INFO)) { + return indexEntityCountInfo; + } + return -1; + } + + /** + * Check if there's no limit defined by the Security Manager + * @param limit + * @return + */ + public boolean isNoLimit(int limit) { + return limit==NO_LIMIT; + } + /** + * Check if the size (length or count) of the specified limit property is + * over the limit + * + * @param limit the type of the limit property + * @param entityName the name of the entity + * @param size the size (count or length) of the entity + * @return true if the size is over the limit, false otherwise + */ + public boolean isOverLimit(Limit limit, String entityName, int size) { + return isOverLimit(limit.ordinal(), entityName, size); + } + + /** + * Check if the value (length or count) of the specified limit property is + * over the limit + * + * @param index the index of the limit property + * @param entityName the name of the entity + * @param size the size (count or length) of the entity + * @return true if the size is over the limit, false otherwise + */ + public boolean isOverLimit(int index, String entityName, int size) { + if (values[index] == NO_LIMIT) { + return false; + } + if (size > values[index]) { + limitAnalyzer.addValue(index, entityName, size); + return true; + } + return false; + } + + /** + * Check against cumulated value + * + * @param limit the type of the limit property + * @param size the size (count or length) of the entity + * @return true if the size is over the limit, false otherwise + */ + public boolean isOverLimit(Limit limit) { + return isOverLimit(limit.ordinal()); + } + + public boolean isOverLimit(int index) { + if (values[index] == NO_LIMIT) { + return false; + } + + if (index==Limit.ELEMENT_ATTRIBUTE_LIMIT.ordinal() || + index==Limit.ENTITY_EXPANSION_LIMIT.ordinal() || + index==Limit.TOTAL_ENTITY_SIZE_LIMIT.ordinal()) { + return (limitAnalyzer.getTotalValue(index) > values[index]); + } else { + return (limitAnalyzer.getValue(index) > values[index]); + } + } + + public void debugPrint() { + if (printEntityCountInfo.equals(Constants.JDK_YES)) { + limitAnalyzer.debugPrint(); + } + } + + /** + * Return the limit analyzer + * + * @return the limit analyzer + */ + public XMLLimitAnalyzer getLimitAnalyzer() { + return limitAnalyzer; + } + + /** + * Set limit analyzer + * + * @param analyzer a limit analyzer + */ + public void setLimitAnalyzer(XMLLimitAnalyzer analyzer) { + limitAnalyzer = analyzer; + } + + /** + * Indicate if a property is set explicitly + * @param index + * @return + */ + public boolean isSet(int index) { + return isSet[index]; + } + + public boolean printEntityCountInfo() { + return printEntityCountInfo.equals(Constants.JDK_YES); + } + + /** + * Read from system properties, or those in jaxp.properties + */ + private void readSystemProperties() { + + for (Limit limit : Limit.values()) { + if (!getSystemProperty(limit, limit.systemProperty())) { + //if system property is not found, try the older form if any + for (NameMap nameMap : NameMap.values()) { + String oldName = nameMap.getOldName(limit.systemProperty()); + if (oldName != null) { + getSystemProperty(limit, oldName); + } + } + } + } + + } + + /** + * Read from system properties, or those in jaxp.properties + * + * @param property the type of the property + * @param sysPropertyName the name of system property + */ + private boolean getSystemProperty(Limit limit, String sysPropertyName) { + try { + String value = SecuritySupport.getSystemProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.SYSTEMPROPERTY; + return true; + } + + value = SecuritySupport.readJAXPProperty(sysPropertyName); + if (value != null && !value.equals("")) { + values[limit.ordinal()] = Integer.parseInt(value); + states[limit.ordinal()] = State.JAXPDOTPROPERTIES; + return true; + } + } catch (NumberFormatException e) { + //invalid setting + throw new NumberFormatException("Invalid setting for system property: " + limit.systemProperty()); + } + return false; + } + + + /** + * Convert a value set through setProperty to XMLSecurityManager. + * If the value is an instance of XMLSecurityManager, use it to override the default; + * If the value is an old SecurityManager, convert to the new XMLSecurityManager. + * + * @param value user specified security manager + * @param securityManager an instance of XMLSecurityManager + * @return an instance of the new security manager XMLSecurityManager + */ + static public XMLSecurityManager convert(Object value, XMLSecurityManager securityManager) { + if (value == null) { + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + } + return securityManager; + } + if (XMLSecurityManager.class.isAssignableFrom(value.getClass())) { + return (XMLSecurityManager)value; + } else { + if (securityManager == null) { + securityManager = new XMLSecurityManager(true); + } + if (SecurityManager.class.isAssignableFrom(value.getClass())) { + SecurityManager origSM = (SecurityManager)value; + securityManager.setLimit(Limit.MAX_OCCUR_NODE_LIMIT, State.APIPROPERTY, origSM.getMaxOccurNodeLimit()); + securityManager.setLimit(Limit.ENTITY_EXPANSION_LIMIT, State.APIPROPERTY, origSM.getEntityExpansionLimit()); + securityManager.setLimit(Limit.ELEMENT_ATTRIBUTE_LIMIT, State.APIPROPERTY, origSM.getElementAttrLimit()); + } + return securityManager; + } + } +} diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java index c6bb0310702..4286f043e50 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/utils/XMLSecurityPropertyManager.java @@ -91,6 +91,24 @@ public final class XMLSecurityPropertyManager { readSystemProperties(); } + + /** + * Set limit by property name and state + * @param propertyName property name + * @param state the state of the property + * @param value the value of the property + * @return true if the property is managed by the security property manager; + * false if otherwise. + */ + public boolean setValue(String propertyName, State state, Object value) { + int index = getIndex(propertyName); + if (index > -1) { + setValue(index, state, (String)value); + return true; + } + return false; + } + /** * Set the value for a specific property. * @@ -119,6 +137,23 @@ public final class XMLSecurityPropertyManager { states[index] = state; } } + + + /** + * Return the value of the specified property + * + * @param propertyName the property name + * @return the value of the property as a string + */ + public String getValue(String propertyName) { + int index = getIndex(propertyName); + if (index > -1) { + return getValueByIndex(index); + } + + return null; + } + /** * Return the value of the specified property * diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java index 0c01d601c06..a060f99e091 100644 --- a/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java +++ b/jaxp/src/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java @@ -37,7 +37,6 @@ import com.sun.org.apache.xerces.internal.util.AugmentationsImpl; import com.sun.org.apache.xerces.internal.util.HTTPInputSource; import com.sun.org.apache.xerces.internal.util.IntStack; import com.sun.org.apache.xerces.internal.util.ParserConfigurationSettings; -import com.sun.org.apache.xerces.internal.util.SecurityManager; import com.sun.org.apache.xerces.internal.util.SymbolTable; import com.sun.org.apache.xerces.internal.util.URI; import com.sun.org.apache.xerces.internal.util.XMLAttributesImpl; @@ -45,6 +44,7 @@ import com.sun.org.apache.xerces.internal.util.XMLResourceIdentifierImpl; import com.sun.org.apache.xerces.internal.util.XMLChar; import com.sun.org.apache.xerces.internal.util.XMLSymbols; import com.sun.org.apache.xerces.internal.util.URI.MalformedURIException; +import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.QName; @@ -289,7 +289,7 @@ public class XIncludeHandler protected SymbolTable fSymbolTable; protected XMLErrorReporter fErrorReporter; protected XMLEntityResolver fEntityResolver; - protected SecurityManager fSecurityManager; + protected XMLSecurityManager fSecurityManager; protected XMLSecurityPropertyManager fSecurityPropertyMgr; // these are needed for text include processing @@ -517,8 +517,8 @@ public class XIncludeHandler // Get security manager. try { - SecurityManager value = - (SecurityManager)componentManager.getProperty( + XMLSecurityManager value = + (XMLSecurityManager)componentManager.getProperty( SECURITY_MANAGER); if (value != null) { @@ -674,7 +674,7 @@ public class XIncludeHandler return; } if (propertyId.equals(SECURITY_MANAGER)) { - fSecurityManager = (SecurityManager)value; + fSecurityManager = (XMLSecurityManager)value; if (fChildConfig != null) { fChildConfig.setProperty(propertyId, value); } diff --git a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java index cab4f46bd42..a9c9aab1d50 100644 --- a/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java +++ b/jaxp/src/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java @@ -25,12 +25,15 @@ package com.sun.org.apache.xml.internal.utils; import com.sun.org.apache.xalan.internal.XalanConstants; import com.sun.org.apache.xalan.internal.utils.FactoryImpl; import com.sun.org.apache.xalan.internal.utils.SecuritySupport; +import com.sun.org.apache.xalan.internal.utils.XMLSecurityManager; import java.util.HashMap; + import javax.xml.XMLConstants; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory; @@ -63,11 +66,15 @@ public class XMLReaderManager { private HashMap m_inUse; private boolean m_useServicesMechanism = true; + + private boolean _secureProcessing; /** * protocols allowed for external DTD references in source file and/or stylesheet. */ private String _accessExternalDTD = XalanConstants.EXTERNAL_ACCESS_DEFAULT; + private XMLSecurityManager _xmlSecurityManager; + /** * Hidden constructor */ @@ -118,7 +125,12 @@ public class XMLReaderManager { // TransformerFactory creates a reader via the // XMLReaderFactory if setXMLReader is not used reader = XMLReaderFactory.createXMLReader(); - + try { + reader.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _secureProcessing); + } catch (SAXNotRecognizedException e) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + e.getMessage()); + } } catch (Exception e) { try { // If unable to create an instance, let's try to use @@ -164,6 +176,21 @@ public class XMLReaderManager { + se.getMessage()); } + try { + if (_xmlSecurityManager != null) { + for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { + reader.setProperty(limit.apiProperty(), + _xmlSecurityManager.getLimitValueAsString(limit)); + } + if (_xmlSecurityManager.printEntityCountInfo()) { + reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); + } + } + } catch (SAXException se) { + System.err.println("Warning: " + reader.getClass().getName() + ": " + + se.getMessage()); + } + return reader; } @@ -194,12 +221,23 @@ public class XMLReaderManager { m_useServicesMechanism = flag; } + /** + * Set feature + */ + public void setFeature(String name, boolean value) { + if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) { + _secureProcessing = value; + } + } + /** * Get property value */ - public String getProperty(String name) { + public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + return _xmlSecurityManager; } return null; } @@ -207,9 +245,11 @@ public class XMLReaderManager { /** * Set property. */ - public void setProperty(String name, String value) { + public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; + } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { + _xmlSecurityManager = (XMLSecurityManager)value; } } } diff --git a/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java index e71f61e6243..fd5db6f011e 100644 --- a/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java +++ b/jaxp/src/com/sun/org/apache/xpath/internal/XPathContext.java @@ -99,8 +99,7 @@ public class XPathContext extends DTMManager // implements ExpressionContext * the DTMManager, it really is a proxy for this object, which * is the real DTMManager. */ - protected DTMManager m_dtmManager = DTMManager.newInstance( - com.sun.org.apache.xpath.internal.objects.XMLStringFactoryImpl.getFactory()); + protected DTMManager m_dtmManager = null; /** * Return the DTMManager object. Though XPathContext context extends diff --git a/jaxp/src/javax/xml/stream/FactoryFinder.java b/jaxp/src/javax/xml/stream/FactoryFinder.java index 68f4ef21d66..886caa57ee0 100644 --- a/jaxp/src/javax/xml/stream/FactoryFinder.java +++ b/jaxp/src/javax/xml/stream/FactoryFinder.java @@ -253,7 +253,13 @@ class FactoryFinder { // Use the system property first try { - String systemProp = ss.getSystemProperty(factoryId); + + final String systemProp; + if (type.getName().equals(factoryId)) { + systemProp = ss.getSystemProperty(factoryId); + } else { + systemProp = System.getProperty(factoryId); + } if (systemProp != null) { dPrint("found system property, value=" + systemProp); // There's a bug here - because 'cl' is ignored. @@ -262,7 +268,8 @@ class FactoryFinder { } } catch (SecurityException se) { - if (debug) se.printStackTrace(); + throw new FactoryConfigurationError( + "Failed to read factoryId '" + factoryId + "'", se); } // Try read $java.home/lib/stax.properties followed by diff --git a/jaxws/.hgtags b/jaxws/.hgtags index a8d225947ad..74b6fb898b4 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -233,3 +233,4 @@ d1ea68556fd7925a3c7078dd9f77c6ca73d5aa9e jdk8-b108 df5d4d01642572e77fd3c01e4c8703ed3f6eec87 jdk8-b109 cc682329886be2fc26220fc30597ee4e5bba43ed jdk8-b110 32edc7a2c86696dfcbdb6ffae641ff153f8e34bd jdk8-b111 +dbdd5c76250928582cb5342bcf7b299a6007d538 jdk8-b112 diff --git a/jaxws/make/jprt.properties b/jaxws/make/jprt.properties index 12ce773022a..8afa5316423 100644 --- a/jaxws/make/jprt.properties +++ b/jaxws/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ diff --git a/jaxws/makefiles/BuildJaxws.gmk b/jaxws/makefiles/BuildJaxws.gmk index db718ff62b2..204dd47fb53 100644 --- a/jaxws/makefiles/BuildJaxws.gmk +++ b/jaxws/makefiles/BuildJaxws.gmk @@ -57,7 +57,7 @@ $(eval $(call SetupJavaCompilation,BUILD_JAXWS, \ COPY_FILES := $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/internal/xjc/runtime/JAXBContextFactory.java \ $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/internal/xjc/runtime/ZeroOneBooleanAdapter.java \ $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/xml/internal/ws/assembler/jaxws-tubes-default.xml, \ - ADD_JAVAC_FLAGS = -cp $(OUTPUT_ROOT)/jaxp/dist/lib/classes.jar)) + ADD_JAVAC_FLAGS = -Xbootclasspath/p:$(OUTPUT_ROOT)/jaxp/dist/lib/classes.jar)) $(JAXWS_OUTPUTDIR)/jaxws_classes/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin: \ $(JAXWS_TOPDIR)/src/share/jaxws_classes/com/sun/tools/etc/META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java index e670ac452e6..560e98e9085 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/AbstractInstanceResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 @@ -66,7 +66,7 @@ public abstract class AbstractInstanceResolver extends InstanceResolver { if (!method.isAccessible()) { method.setAccessible(true); } - method.invoke(instance,args); + MethodUtil.invoke(instance,method, args); } catch (IllegalAccessException e) { throw new ServerRtException("server.rt.err",e); } catch (InvocationTargetException e) { diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java index 625f59f47b0..7c11e6455f7 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/InstanceResolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 @@ -232,7 +232,7 @@ public abstract class InstanceResolver { public Object invoke(Packet p, Method m, Object... args) throws InvocationTargetException, IllegalAccessException { T t = resolve(p); try { - return m.invoke(t, args ); + return MethodUtil.invoke(t, m, args ); } finally { postInvoke(p,t); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java new file mode 100644 index 00000000000..c8497055678 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/api/server/MethodUtil.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.api.server; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * to java.lang,reflect.Method.invoke() + * + * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too! + */ +class MethodUtil { + + private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); + private static final Method INVOKE_METHOD; + + static { + Method method; + try { + Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); + method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); + } + } catch (Throwable t) { + method = null; + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); + } + } + INVOKE_METHOD = method; + } + + static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { + if (INVOKE_METHOD != null) { + // sun.reflect.misc.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return INVOKE_METHOD.invoke(null, method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); + } + } else { + // other then Oracle JDK ... + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); + } + return method.invoke(target, args); + } + } + + private static InvocationTargetException unwrapException(InvocationTargetException ite) { + Throwable targetException = ite.getTargetException(); + if (targetException != null && targetException instanceof InvocationTargetException) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unwrapping invocation target exception"); + } + return (InvocationTargetException) targetException; + } else { + return ite; + } + } + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java new file mode 100644 index 00000000000..f0daea51faf --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.client.sei; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * to java.lang,reflect.Method.invoke() + *

    + * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too! + */ +class MethodUtil { + + private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); + private static final Method INVOKE_METHOD; + + static { + Method method; + try { + Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); + method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); + } + } catch (Throwable t) { + method = null; + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); + } + } + INVOKE_METHOD = method; + } + + static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { + if (INVOKE_METHOD != null) { + // sun.reflect.misc.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return INVOKE_METHOD.invoke(null, method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); + } + } else { + // other then Oracle JDK ... + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); + } + return method.invoke(target, args); + } + } + + private static InvocationTargetException unwrapException(InvocationTargetException ite) { + Throwable targetException = ite.getTargetException(); + if (targetException != null && targetException instanceof InvocationTargetException) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unwrapping invocation target exception"); + } + return (InvocationTargetException) targetException; + } else { + return ite; + } + } + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java index 7a5f0e3a1a7..9ad1f6edfba 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/client/sei/SEIStub.java @@ -28,6 +28,7 @@ package com.sun.xml.internal.ws.client.sei; import com.sun.istack.internal.NotNull; import com.sun.istack.internal.Nullable; import com.sun.xml.internal.ws.api.SOAPVersion; +import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.client.WSPortInfo; import com.sun.xml.internal.ws.api.databinding.Databinding; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; @@ -36,12 +37,16 @@ import com.sun.xml.internal.ws.api.message.Headers; import com.sun.xml.internal.ws.api.message.Packet; import com.sun.xml.internal.ws.api.model.MEP; import com.sun.xml.internal.ws.api.model.wsdl.WSDLBoundOperation; -import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.pipe.Fiber; +import com.sun.xml.internal.ws.api.pipe.Tube; import com.sun.xml.internal.ws.api.server.Container; import com.sun.xml.internal.ws.api.server.ContainerResolver; import com.sun.xml.internal.ws.binding.BindingImpl; -import com.sun.xml.internal.ws.client.*; +import com.sun.xml.internal.ws.client.AsyncResponseImpl; +import com.sun.xml.internal.ws.client.RequestContext; +import com.sun.xml.internal.ws.client.ResponseContextReceiver; +import com.sun.xml.internal.ws.client.Stub; +import com.sun.xml.internal.ws.client.WSServiceDelegate; import com.sun.xml.internal.ws.model.JavaMethodImpl; import com.sun.xml.internal.ws.model.SOAPSEIModel; import com.sun.xml.internal.ws.wsdl.OperationDispatcher; @@ -50,6 +55,8 @@ import javax.xml.namespace.QName; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Proxy; import java.util.HashMap; import java.util.Map; @@ -132,6 +139,7 @@ public final class SEIStub extends Stub implements InvocationHandler { private final Map methodHandlers = new HashMap(); public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + validateInputs(proxy, method); Container old = ContainerResolver.getDefault().enterContainer(owner.getContainer()); try { MethodHandler handler = methodHandlers.get(method); @@ -155,6 +163,17 @@ public final class SEIStub extends Stub implements InvocationHandler { } } + private void validateInputs(Object proxy, Method method) { + if (proxy == null || !Proxy.isProxyClass(proxy.getClass())) { + throw new IllegalStateException("Passed object is not proxy!"); + } + Class declaringClass = method.getDeclaringClass(); + if (method == null || declaringClass == null + || Modifier.isStatic(method.getModifiers())) { + throw new IllegalStateException("Invoking static method is not allowed!"); + } + } + public final Packet doProcess(Packet request, RequestContext rc, ResponseContextReceiver receiver) { return super.process(request, rc, receiver); } diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java new file mode 100644 index 00000000000..ad2ad4a6ef5 --- /dev/null +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.xml.internal.ws.policy.privateutil; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * to java.lang,reflect.Method.invoke() + */ +class MethodUtil { + + private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); + private static final Method INVOKE_METHOD; + + static { + Method method; + try { + Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); + method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); + } + } catch (Throwable t) { + method = null; + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); + } + } + INVOKE_METHOD = method; + } + + static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { + if (INVOKE_METHOD != null) { + // sun.reflect.misc.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); + } + try { + return INVOKE_METHOD.invoke(null, method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); + } + } else { + // other then Oracle JDK ... + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); + } + return method.invoke(target, args); + } + } + + private static InvocationTargetException unwrapException(InvocationTargetException ite) { + Throwable targetException = ite.getTargetException(); + if (targetException != null && targetException instanceof InvocationTargetException) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unwrapping invocation target exception"); + } + return (InvocationTargetException) targetException; + } else { + return ite; + } + } + +} diff --git a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java index d3a2752ad5e..ec537d88358 100644 --- a/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java +++ b/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/policy/privateutil/PolicyUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 @@ -282,13 +282,13 @@ public final class PolicyUtils { /** * Reflection utilities wrapper */ - public static class Reflection { + static class Reflection { private static final PolicyLogger LOGGER = PolicyLogger.getLogger(PolicyUtils.Reflection.class); /** * Reflectively invokes specified method on the specified target */ - public static T invoke(final Object target, final String methodName, + static T invoke(final Object target, final String methodName, final Class resultClass, final Object... parameters) throws RuntimePolicyUtilsException { Class[] parameterTypes; if (parameters != null && parameters.length > 0) { @@ -311,7 +311,7 @@ public final class PolicyUtils { final Object[] parameters, final Class[] parameterTypes) throws RuntimePolicyUtilsException { try { final Method method = target.getClass().getMethod(methodName, parameterTypes); - final Object result = method.invoke(target, parameters); + final Object result = MethodUtil.invoke(target, method,parameters); return resultClass.cast(result); } catch (IllegalArgumentException e) { diff --git a/jdk/.hgtags b/jdk/.hgtags index 3a38f345100..6fc1c37c4f0 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -233,3 +233,4 @@ eea685b9ccaa1980e0a7e07d6a3a84bcc7e9ab82 jdk8-b107 946f3fd5f8bf0ccd180c258d25e5837fa1bf004c jdk8-b109 54e099776f08430d3a7f4feabd9f2ba886b55320 jdk8-b110 719befd87c7b96ae103c05730ca555227bfc0116 jdk8-b111 +f002f5f3a16cca62e139cb8eed05ffaeb373587d jdk8-b112 diff --git a/jdk/make/com/sun/jmx/Makefile b/jdk/make/com/sun/jmx/Makefile index 62435751673..02ef6b07998 100644 --- a/jdk/make/com/sun/jmx/Makefile +++ b/jdk/make/com/sun/jmx/Makefile @@ -130,11 +130,13 @@ $(CLASSDESTDIR)/%_Stub.class: $(CLASSDESTDIR)/%.class $(RMIC) -classpath "$(CLASSDESTDIR)" \ -d $(CLASSDESTDIR) \ -iiop -v1.2 \ + -emitPermissionCheck \ $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) $(RMIC) $(HOTSPOT_INTERPRETER_FLAG) -classpath "$(CLASSDESTDIR)" \ -d $(CLASSDESTDIR) \ -iiop -v1.2 \ -standardPackage \ + -emitPermissionCheck \ $(subst /,.,$(<:$(CLASSDESTDIR)/%.class=%)) @$(java-vm-cleanup) diff --git a/jdk/make/common/Defs-macosx.gmk b/jdk/make/common/Defs-macosx.gmk index befd2cfed5b..83ccf604ac0 100644 --- a/jdk/make/common/Defs-macosx.gmk +++ b/jdk/make/common/Defs-macosx.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2013, Oracle and/or its affiliates. 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 @@ -85,6 +85,100 @@ SCRIPT_SUFFIX = CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required! CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required! +# The Full Debug Symbols (FDS) default for VARIANT == OPT builds is +# enabled with debug info files ZIP'ed to save space. For VARIANT != +# OPT builds, FDS is always enabled, after all a debug build without +# debug info isn't very useful. The ZIP_DEBUGINFO_FILES option only has +# meaning when FDS is enabled. +# +# If you invoke a build with FULL_DEBUG_SYMBOLS=0, then FDS will be +# disabled for a VARIANT == OPT build. +# +# Note: Use of a different variable name for the FDS override option +# versus the FDS enabled check is intentional (FULL_DEBUG_SYMBOLS +# versus ENABLE_FULL_DEBUG_SYMBOLS). For auto build systems that pass +# in options via environment variables, use of distinct variables +# prevents strange behaviours. For example, in a VARIANT != OPT build, +# the FULL_DEBUG_SYMBOLS environment variable will be 0, but the +# ENABLE_FULL_DEBUG_SYMBOLS make variable will be 1. If the same +# variable name is used, then different values can be picked up by +# different parts of the build. Just to be clear, we only need two +# variable names because the incoming option value can be overridden +# in some situations, e.g., a VARIANT != OPT build. + +ifeq ($(VARIANT), OPT) + FULL_DEBUG_SYMBOLS ?= 1 + ENABLE_FULL_DEBUG_SYMBOLS = $(FULL_DEBUG_SYMBOLS) +else + # debug variants always get Full Debug Symbols (if available) + ENABLE_FULL_DEBUG_SYMBOLS = 1 +endif +_JUNK_ := $(shell \ + echo >&2 "INFO: ENABLE_FULL_DEBUG_SYMBOLS=$(ENABLE_FULL_DEBUG_SYMBOLS)") +# since objcopy is optional, we set ZIP_DEBUGINFO_FILES later + +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(OS_NAME),darwin) + # MacOS X doesn't use OBJCOPY or STRIP_POLICY + OBJCOPY= + STRIP_POLICY= + ZIP_DEBUGINFO_FILES ?= 1 + else + ifndef CROSS_COMPILE_ARCH + # Default OBJCOPY comes from GNU Binutils on Linux: + DEF_OBJCOPY=/usr/bin/objcopy + else + # Assume objcopy is part of the cross-compilation toolkit + DEF_OBJCOPY=$(COMPILER_PATH)/objcopy + endif + OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY)) + ifneq ($(ALT_OBJCOPY),) + _JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)") + # disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path + OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY)) + endif + + # Setting ENABLE_FULL_DEBUG_SYMBOLS=1 (and OBJCOPY) above enables the + # JDK build to import .debuginfo or .diz files from the HotSpot build. + # However, adding FDS support to the JDK build will occur in phases + # so a different make variable (LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS + # and PROGRAM_SUPPORTS_FULL_DEBUG_SYMBOLS) is used to indicate that a + # particular library or program supports FDS. + + ifeq ($(OBJCOPY),) + _JUNK_ := $(shell \ + echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo" \ + "files. You may need to set ALT_OBJCOPY.") + ENABLE_FULL_DEBUG_SYMBOLS=0 + else + _JUNK_ := $(shell \ + echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.") + + # Library stripping policies for .debuginfo configs: + # all_strip - strips everything from the library + # min_strip - strips most stuff from the library; leaves + # minimum symbols + # no_strip - does not strip the library at all + # + # Oracle security policy requires "all_strip". A waiver was granted + # on 2011.09.01 that permits using "min_strip" in the Java JDK and + # Java JRE. + # + # Currently, STRIP_POLICY is only used when Full Debug Symbols + # is enabled. + STRIP_POLICY ?= min_strip + + _JUNK_ := $(shell \ + echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)") + + ZIP_DEBUGINFO_FILES ?= 1 + endif + endif + + _JUNK_ := $(shell \ + echo >&2 "INFO: ZIP_DEBUGINFO_FILES=$(ZIP_DEBUGINFO_FILES)") +endif + # # Default optimization # diff --git a/jdk/make/common/Defs.gmk b/jdk/make/common/Defs.gmk index fe2bc94506f..5403664ff60 100644 --- a/jdk/make/common/Defs.gmk +++ b/jdk/make/common/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 2013, Oracle and/or its affiliates. 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 @@ -508,12 +508,18 @@ endef # Convenient macros # -# Prepare $@ target, remove old one and making sure directory exists +# Prepare $@ target, remove old one and making sure containing dir exists define prep-target $(MKDIR) -p $(@D) $(RM) $@ endef +# Prepare $@ target dir, remove old one and making sure containing dir exists +define prep-target-dir +$(MKDIR) -p $(@D) +$(RM) -r $@ +endef + # Simple install of $< file to $@ define install-file $(prep-target) @@ -616,6 +622,26 @@ $(CP) $< $@ fi endef +# MacOS X strongly discourages 'cp -r' and provides 'cp -R' instead. +# May need to have a MacOS X specific definition of install-import-dir +# sometime in the future. +define install-import-dir +@$(ECHO) "ASSEMBLY_IMPORT: $@" +$(prep-target-dir) +$(CP) -r $< $@ +endef + +ifeq ($(PLATFORM), macosx) +# On MacOS X, debug info is in .dSYM directories +define install-import-debuginfo +$(install-import-dir) +endef +else +define install-import-debuginfo +$(install-import-file) +endef +endif + define install-import-file $(install-importonly-file) endef diff --git a/jdk/make/java/management/mapfile-vers b/jdk/make/java/management/mapfile-vers index 63c4fbf03cc..0ea2ab4eb06 100644 --- a/jdk/make/java/management/mapfile-vers +++ b/jdk/make/java/management/mapfile-vers @@ -57,7 +57,7 @@ SUNWprivate_1.1 { Java_sun_management_GcInfoBuilder_fillGcAttributeInfo; Java_sun_management_GcInfoBuilder_getLastGcInfo0; Java_sun_management_GcInfoBuilder_getNumGcExtAttributes; - Java_sun_management_HotSpotDiagnostic_dumpHeap; + Java_sun_management_HotSpotDiagnostic_dumpHeap0; Java_sun_management_HotspotThread_getInternalThreadCount; Java_sun_management_HotspotThread_getInternalThreadTimes0; Java_sun_management_MemoryImpl_getMemoryManagers0; diff --git a/jdk/make/java/redist/Makefile b/jdk/make/java/redist/Makefile index fb257f5c354..f06e5d1cedb 100644 --- a/jdk/make/java/redist/Makefile +++ b/jdk/make/java/redist/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 @@ -60,15 +60,24 @@ LIBJSIG_NAME = $(LIB_PREFIX)jsig.$(LIBRARY_SUFFIX) JVMDB_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).$(LIBRARY_SUFFIX) JVMDTRACE_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).$(LIBRARY_SUFFIX) -JVM_DEBUGINFO_NAME = $(LIB_PREFIX)jvm.debuginfo JVM_DIZ_NAME = $(LIB_PREFIX)jvm.diz -LIBJSIG_DEBUGINFO_NAME = $(LIB_PREFIX)jsig.debuginfo LIBJSIG_DIZ_NAME = $(LIB_PREFIX)jsig.diz -JVMDB_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo JVMDB_DIZ_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).diz -JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo JVMDTRACE_DIZ_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).diz +ifeq ($(PLATFORM), macosx) + # Note: *.dSYM is a directory + JVM_DEBUGINFO_NAME = $(LIB_PREFIX)jvm.dSYM + LIBJSIG_DEBUGINFO_NAME = $(LIB_PREFIX)jsig.dSYM + JVMDB_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).dSYM + JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).dSYM +else + JVM_DEBUGINFO_NAME = $(LIB_PREFIX)jvm.debuginfo + LIBJSIG_DEBUGINFO_NAME = $(LIB_PREFIX)jsig.debuginfo + JVMDB_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DB_SUFFIX).debuginfo + JVMDTRACE_DEBUGINFO_NAME = $(LIB_PREFIX)jvm$(DTRACE_SUFFIX).debuginfo +endif + CLASSSHARINGDATA_DIR = $(BUILDDIR)/tools/sharing # Needed to do file copy @@ -441,7 +450,7 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM $(install-import-file) else $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVM_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -459,7 +468,7 @@ $(LIB_LOCATION)/$(LIBJSIG_DIZ_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$( $(install-import-file) else $(LIB_LOCATION)/$(LIBJSIG_DEBUGINFO_NAME): $(HOTSPOT_IMPORT_PATH)/$(ARCH_VM_SUBDIR)/$(LIBJSIG_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -471,8 +480,8 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_NAME): ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) # We don't create a symlink to a libjsig.diz file, but we do put -# the libjsig.debuginfo symlink into a libjsig.diz file. The aurora -# system does not like dangling symlinks. +# the $(LIBJSIG_DEBUGINFO_NAME) symlink into a libjsig.diz file. +# The aurora system does not like dangling symlinks. ifeq ($(ZIP_DEBUGINFO_FILES),1) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME) \ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(LIBJSIG_DIZ_NAME): @@ -496,8 +505,8 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_NAME): ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) # We don't create a symlink to a libjsig.diz file, but we do put -# the libjsig.debuginfo symlink into a libjsig.diz file. The aurora -# system does not like dangling symlinks. +# the $(LIBJSIG_DEBUGINFO_NAME) symlink into a libjsig.diz file. +# The aurora system does not like dangling symlinks. ifeq ($(ZIP_DEBUGINFO_FILES),1) $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(LIBJSIG_DIZ_NAME): @$(prep-target) @@ -531,10 +540,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DIZ_NAME): $(HOTSPOT_CLIENT_PATH)/ $(install-import-file) else $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -556,10 +565,10 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/ $(install-import-file) else $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDB_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDB_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif endif @@ -581,10 +590,10 @@ $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DIZ_NAME): $(HOTSPOT_CLIENT_PA $(install-import-file) else $(LIB_LOCATION)/$(CLIENT_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(CLIENT_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_CLIENT_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif @@ -613,13 +622,13 @@ $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DIZ_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM $(install-import-file) else $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(SERVER_LOCATION)/64/$(JVMDTRACE_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/64/$(JVMDTRACE_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) $(LIB_LOCATION)/$(SERVER_LOCATION)/$(JVM_DEBUGINFO_NAME): $(HOTSPOT_SERVER_PATH)/$(JVM_DEBUGINFO_NAME) - $(install-import-file) + $(install-import-debuginfo) endif endif diff --git a/jdk/make/java/security/Makefile b/jdk/make/java/security/Makefile index 05b6b8a5664..813597347bf 100644 --- a/jdk/make/java/security/Makefile +++ b/jdk/make/java/security/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1996, 2013, Oracle and/or its affiliates. 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 @@ -79,6 +79,9 @@ ifndef OPENJDK BLACKLISTED_CERTS_SRC += $(wildcard $(CLOSED_SHARE_SRC)/lib/security/blacklisted.certs) TRUSTEDLIBS_SRC = $(CLOSED_SHARE_SRC)/lib/security/trusted.libraries TRUSTEDLIBS_BUILD = $(LIBDIR)/security/trusted.libraries + RESTRICTED_PKGS_SRC = $(CLOSED_SHARE_SRC)/lib/security/restricted.pkgs + RESTRICTED_PKGS := $(shell $(CAT) $(RESTRICTED_PKGS_SRC) | $(TR) "\n" " ") + ADDTORESTRICTEDPKGS_JARFILE = $(BUILDTOOLJARDIR)/addtorestrictedpkgs.jar endif FILES_class = $(FILES_java:%.java=$(CLASSBINDIR)/%.class) @@ -108,8 +111,15 @@ blacklisted-certs: classes $(BLACKLISTED_CERTS_BUILD) trustedlibs: classes $(TRUSTEDLIBS_BUILD) +ifdef OPENJDK $(PROPS_BUILD): $(PROPS_SRC) $(install-file) +else +$(PROPS_BUILD): $(PROPS_SRC) + $(MKDIR) -p $(@D) + $(BOOT_JAVA_CMD) -jar $(ADDTORESTRICTEDPKGS_JARFILE) $^ $@.tmp $(RESTRICTED_PKGS) + $(MV) $@.tmp $@ +endif $(POLICY_BUILD): $(POLICY_SRC) $(install-file) diff --git a/jdk/make/jprt.properties b/jdk/make/jprt.properties index eb6ff3ff2f0..c34540ee1f7 100644 --- a/jdk/make/jprt.properties +++ b/jdk/make/jprt.properties @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug # Standard list of jprt build targets for this source tree jprt.build.targets= \ - solaris_sparc_5.10-{product|fastdebug}, \ solaris_sparcv9_5.10-{product|fastdebug}, \ - solaris_i586_5.10-{product|fastdebug}, \ solaris_x64_5.10-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \ linux_x64_2.6-{product|fastdebug}, \ @@ -48,9 +46,7 @@ jprt.my.test.set=${jprt.test.set} # Test target list (no fastdebug & limited c2 testing) jprt.my.test.target.set= \ - solaris_sparc_5.10-product-c1-TESTNAME, \ solaris_sparcv9_5.10-product-c2-TESTNAME, \ - solaris_i586_5.10-product-c1-TESTNAME, \ solaris_x64_5.10-product-c2-TESTNAME, \ linux_i586_2.6-product-{c1|c2}-TESTNAME, \ linux_x64_2.6-product-c2-TESTNAME, \ @@ -112,9 +108,7 @@ jprt.make.rule.all.test.targets= \ # JCK test targets in test/Makefile (no windows) jprt.my.jck.test.target.set= \ - solaris_sparc_5.10-product-c1-JCK7TESTRULE, \ solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, \ - solaris_i586_5.10-product-c1-JCK7TESTRULE, \ solaris_x64_5.10-product-c2-JCK7TESTRULE, \ linux_i586_2.6-product-c1-JCK7TESTRULE, \ linux_x64_2.6-product-c2-JCK7TESTRULE diff --git a/jdk/make/sun/awt/Makefile b/jdk/make/sun/awt/Makefile index 8b7612e416a..9f11638a69e 100644 --- a/jdk/make/sun/awt/Makefile +++ b/jdk/make/sun/awt/Makefile @@ -145,8 +145,6 @@ ifeq ($(PLATFORM), macosx) # # Files # -include FILES_c_macosx.gmk -include FILES_export_macosx.gmk FILES_objc = $(FILES_AWT_objc) OTHER_LDLIBS = -lmlib_image $(JVMLIB) $(LIBM) \ diff --git a/jdk/make/sun/javazic/tzdata/VERSION b/jdk/make/sun/javazic/tzdata/VERSION index e50b6f37dcc..ea1c49a6f83 100644 --- a/jdk/make/sun/javazic/tzdata/VERSION +++ b/jdk/make/sun/javazic/tzdata/VERSION @@ -21,4 +21,4 @@ # or visit www.oracle.com if you need additional information or have any # questions. # -tzdata2013d +tzdata2013g diff --git a/jdk/make/sun/javazic/tzdata/africa b/jdk/make/sun/javazic/tzdata/africa index 6b19b982c6b..19bc98afe16 100644 --- a/jdk/make/sun/javazic/tzdata/africa +++ b/jdk/make/sun/javazic/tzdata/africa @@ -881,13 +881,23 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou # transitions would be 2013-07-07 and 2013-08-10; see: # http://www.maroc.ma/en/news/morocco-suspends-daylight-saving-time-july-7-aug10 -# From Paul Eggert (2013-07-03): +# From Steffen Thorsen (2013-09-28): +# Morocco extends DST by one month, on very short notice, just 1 day +# before it was going to end. There is a new decree (2.13.781) for +# this, where DST from now on goes from last Sunday of March at 02:00 +# to last Sunday of October at 03:00, similar to EU rules. Official +# source (French): +# http://www.maroc.gov.ma/fr/actualites/lhoraire-dete-gmt1-maintenu-jusquau-27-octobre-2013 +# Another source (specifying the time for start and end in the decree): +# http://www.lemag.ma/Heure-d-ete-au-Maroc-jusqu-au-27-octobre_a75620.html + +# From Paul Eggert (2013-09-30): # To estimate what the Moroccan government will do in future years, -# transition dates for 2014 through 2021 were determined by running +# transition dates for 2014 through 2037 were determined by running # the following program under GNU Emacs 24.3: # # (let ((islamic-year 1435)) -# (while (< islamic-year 1444) +# (while (< islamic-year 1460) # (let ((a # (calendar-gregorian-from-absolute # (calendar-islamic-to-absolute (list 9 1 islamic-year)))) @@ -902,13 +912,14 @@ Zone Indian/Mayotte 3:00:56 - LMT 1911 Jul # Mamoutzou # (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) # (setq islamic-year (+ 1 islamic-year)))) # -# with the results hand-edited for 2020-2022, when the normal spring-forward -# date falls during the estimated Ramadan. -# -# From 2023 through 2038 Ramadan is not predicted to overlap with -# daylight saving time. Starting in 2039 there will be overlap again, +# with spring-forward transitions removed for 2023-2025, when the +# normal spring-forward date falls during the estimated Ramadan; with +# all transitions removed for 2026-2035, where the estimated Ramadan +# falls entirely outside daylight-saving time; and with fall-back +# transitions removed for 2036-2037, where the normal fall-back +# date falls during the estimated Ramadan. Problems continue after that, # but 32-bit time_t values roll around in 2038 so for now do not worry -# about dates after 2038. +# about dates after 2037. # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -935,12 +946,14 @@ Rule Morocco 2010 only - May 2 0:00 1:00 S Rule Morocco 2010 only - Aug 8 0:00 0 - Rule Morocco 2011 only - Apr 3 0:00 1:00 S Rule Morocco 2011 only - Jul 31 0 0 - -Rule Morocco 2012 2019 - Apr lastSun 2:00 1:00 S -Rule Morocco 2012 max - Sep lastSun 3:00 0 - +Rule Morocco 2012 2013 - Apr lastSun 2:00 1:00 S +Rule Morocco 2012 only - Sep 30 3:00 0 - Rule Morocco 2012 only - Jul 20 3:00 0 - Rule Morocco 2012 only - Aug 20 2:00 1:00 S Rule Morocco 2013 only - Jul 7 3:00 0 - Rule Morocco 2013 only - Aug 10 2:00 1:00 S +Rule Morocco 2013 2035 - Oct lastSun 3:00 0 - +Rule Morocco 2014 2022 - Mar lastSun 2:00 1:00 S Rule Morocco 2014 only - Jun 29 3:00 0 - Rule Morocco 2014 only - Jul 29 2:00 1:00 S Rule Morocco 2015 only - Jun 18 3:00 0 - @@ -953,10 +966,21 @@ Rule Morocco 2018 only - May 16 3:00 0 - Rule Morocco 2018 only - Jun 15 2:00 1:00 S Rule Morocco 2019 only - May 6 3:00 0 - Rule Morocco 2019 only - Jun 5 2:00 1:00 S +Rule Morocco 2020 only - Apr 24 3:00 0 - Rule Morocco 2020 only - May 24 2:00 1:00 S +Rule Morocco 2021 only - Apr 13 3:00 0 - Rule Morocco 2021 only - May 13 2:00 1:00 S +Rule Morocco 2022 only - Apr 3 3:00 0 - Rule Morocco 2022 only - May 3 2:00 1:00 S -Rule Morocco 2023 max - Apr lastSun 2:00 1:00 S +Rule Morocco 2023 only - Apr 22 2:00 1:00 S +Rule Morocco 2024 only - Apr 10 2:00 1:00 S +Rule Morocco 2025 only - Mar 31 2:00 1:00 S +Rule Morocco 2026 max - Mar lastSun 2:00 1:00 S +Rule Morocco 2036 only - Oct 21 3:00 0 - +Rule Morocco 2037 only - Oct 11 3:00 0 - +Rule Morocco 2038 only - Sep 30 3:00 0 - +Rule Morocco 2038 only - Oct 30 2:00 1:00 S +Rule Morocco 2038 max - Oct lastSun 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 @@ -1123,9 +1147,7 @@ Zone Africa/Khartoum 2:10:08 - LMT 1931 3:00 - EAT # South Sudan -Zone Africa/Juba 2:06:24 - LMT 1931 - 2:00 Sudan CA%sT 2000 Jan 15 12:00 - 3:00 - EAT +Link Africa/Khartoum Africa/Juba # Swaziland # Zone NAME GMTOFF RULES FORMAT [UNTIL] diff --git a/jdk/make/sun/javazic/tzdata/antarctica b/jdk/make/sun/javazic/tzdata/antarctica index 434432611ca..f30cf747f10 100644 --- a/jdk/make/sun/javazic/tzdata/antarctica +++ b/jdk/make/sun/javazic/tzdata/antarctica @@ -39,9 +39,9 @@ # # Except for the French entries, # I made up all time zone abbreviations mentioned here; corrections welcome! -# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited. +# FORMAT is 'zzz' and GMTOFF is 0 for locations while uninhabited. -# These rules are stolen from the `southamerica' file. +# These rules are stolen from the 'southamerica' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule ArgAQ 1964 1966 - Mar 1 0:00 0 - Rule ArgAQ 1964 1966 - Oct 15 0:00 1:00 S @@ -251,9 +251,10 @@ Zone Antarctica/Syowa 0 - zzz 1957 Jan 29 # Scott Island (never inhabited) # # year-round base -# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo. +# Scott Base, Ross Island, since 1957-01. +# See Pacific/Auckland. # -# These rules for New Zealand are stolen from the `australasia' file. +# These rules for New Zealand are stolen from the 'australasia' file. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NZAQ 1974 only - Nov 3 2:00s 1:00 D Rule NZAQ 1975 1988 - Oct lastSun 2:00s 1:00 D @@ -291,11 +292,11 @@ Rule NZAQ 2008 max - Apr Sun>=1 2:00s 0 S # From Lee Hotz (2001-03-08): # I queried the folks at Columbia who spent the summer at Vostok and this is # what they had to say about time there: -# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo) +# "in the US Camp (East Camp) we have been on New Zealand (McMurdo) # time, which is 12 hours ahead of GMT. The Russian Station Vostok was # 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead # of GMT). This is a time zone I think two hours east of Moscow. The -# natural time zone is in between the two: 8 hours ahead of GMT.'' +# natural time zone is in between the two: 8 hours ahead of GMT." # # From Paul Eggert (2001-05-04): # This seems to be hopelessly confusing, so I asked Lee Hotz about it @@ -360,16 +361,8 @@ Zone Antarctica/Palmer 0 - zzz 1965 -4:00 ChileAQ CL%sT # # -# McMurdo, Ross Island, since 1955-12 -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Antarctica/McMurdo 0 - zzz 1956 - 12:00 NZAQ NZ%sT -# -# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20 -# -# From Paul Eggert (1996-09-03): -# Normally it wouldn't have a separate entry, since it's like the -# larger Antarctica/McMurdo since 1970, but it's too famous to omit. +# McMurdo Station, Ross Island, since 1955-12 +# Amundsen-Scott South Pole Station, continuously occupied since 1956-11-20 # # From Chris Carrier (1996-06-27): # Siple, the first commander of the South Pole station, @@ -391,4 +384,4 @@ Zone Antarctica/McMurdo 0 - zzz 1956 # we have to go around and set them back 5 minutes or so. # Maybe if we let them run fast all of the time, we'd get to leave here sooner!! # -Link Antarctica/McMurdo Antarctica/South_Pole +# See 'australasia' for Antarctica/McMurdo. diff --git a/jdk/make/sun/javazic/tzdata/asia b/jdk/make/sun/javazic/tzdata/asia index f0931b3264d..fd278e5c8a8 100644 --- a/jdk/make/sun/javazic/tzdata/asia +++ b/jdk/make/sun/javazic/tzdata/asia @@ -29,7 +29,7 @@ # go ahead and edit the file (and please send any changes to # tz@iana.org for general use in the future). -# From Paul Eggert (2013-02-21): +# From Paul Eggert (2013-08-11): # # A good source for time zone historical data outside the U.S. is # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -67,11 +67,11 @@ # 4:00 GST Gulf* # 5:30 IST India # 7:00 ICT Indochina* -# 7:00 WIT west Indonesia -# 8:00 CIT central Indonesia +# 7:00 WIB west Indonesia (Waktu Indonesia Barat) +# 8:00 WITA central Indonesia (Waktu Indonesia Tengah) # 8:00 CST China # 9:00 CJT Central Japanese Time (1896/1937)* -# 9:00 EIT east Indonesia +# 9:00 WIT east Indonesia (Waktu Indonesia Timur) # 9:00 JST JDT Japan # 9:00 KST KDT Korea # 9:30 CST (Australian) Central Standard Time @@ -779,7 +779,7 @@ Zone Asia/Dili 8:22:20 - LMT 1912 8:00 - TLT 1942 Feb 21 23:00 # E Timor Time 9:00 - JST 1945 Sep 23 9:00 - TLT 1976 May 3 - 8:00 - CIT 2000 Sep 17 00:00 + 8:00 - WITA 2000 Sep 17 00:00 9:00 - TLT # India @@ -816,36 +816,53 @@ Zone Asia/Kolkata 5:53:28 - LMT 1880 # Kolkata # (Hollandia). For now, assume all Indonesian locations other than Jayapura # switched on 1945-09-23. # +# From Paul Eggert (2013-08-11): +# Normally the tz database uses English-language abbreviations, but in +# Indonesia it's typical to use Indonesian-language abbreviations even +# when writing in English. For example, see the English-language +# summary published by the Time and Frequency Laboratory of the +# Research Center for Calibration, Instrumentation and Metrology, +# Indonesia, (2006-09-29). +# The abbreviations are: +# +# WIB - UTC+7 - Waktu Indonesia Barat (Indonesia western time) +# WITA - UTC+8 - Waktu Indonesia Tengah (Indonesia central time) +# WIT - UTC+9 - Waktu Indonesia Timur (Indonesia eastern time) +# # Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Java, Sumatra Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10 # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, # but this must be a typo. - 7:07:12 - JMT 1923 Dec 31 23:47:12 # Jakarta + 7:07:12 - BMT 1923 Dec 31 23:47:12 # Batavia 7:20 - JAVT 1932 Nov # Java Time - 7:30 - WIT 1942 Mar 23 + 7:30 - WIB 1942 Mar 23 9:00 - JST 1945 Sep 23 - 7:30 - WIT 1948 May - 8:00 - WIT 1950 May - 7:30 - WIT 1964 - 7:00 - WIT + 7:30 - WIB 1948 May + 8:00 - WIB 1950 May + 7:30 - WIB 1964 + 7:00 - WIB +# west and central Borneo Zone Asia/Pontianak 7:17:20 - LMT 1908 May 7:17:20 - PMT 1932 Nov # Pontianak MT - 7:30 - WIT 1942 Jan 29 + 7:30 - WIB 1942 Jan 29 9:00 - JST 1945 Sep 23 - 7:30 - WIT 1948 May - 8:00 - WIT 1950 May - 7:30 - WIT 1964 - 8:00 - CIT 1988 Jan 1 - 7:00 - WIT + 7:30 - WIB 1948 May + 8:00 - WIB 1950 May + 7:30 - WIB 1964 + 8:00 - WITA 1988 Jan 1 + 7:00 - WIB +# Sulawesi, Lesser Sundas, east and south Borneo Zone Asia/Makassar 7:57:36 - LMT 1920 7:57:36 - MMT 1932 Nov # Macassar MT - 8:00 - CIT 1942 Feb 9 + 8:00 - WITA 1942 Feb 9 9:00 - JST 1945 Sep 23 - 8:00 - CIT + 8:00 - WITA +# Maluku Islands, West Papua, Papua Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov - 9:00 - EIT 1944 Sep 1 + 9:00 - WIT 1944 Sep 1 9:30 - CST 1964 - 9:00 - EIT + 9:00 - WIT # Iran @@ -1387,9 +1404,11 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u # until about the same time next year (at least). # http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 # -# From Paul Eggert (2012-10-25): -# For now, assume this is just a one-year measure. If it becomes -# permanent, we should move Jordan from EET to AST effective tomorrow. +# From Paul Eggert (2013-09-21): +# It's looking like this change will be permanent; see +# Petra News Agency, Cancelling winter saved Jordan $7 million (2013-02-20) +# . +# So move Jordan to UTC+3 as of the abovementioned date. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S @@ -1415,15 +1434,15 @@ Rule Jordan 1995 1998 - Sep Fri>=15 0:00s 0 - Rule Jordan 1999 only - Jul 1 0:00s 1:00 S Rule Jordan 1999 2002 - Sep lastFri 0:00s 0 - Rule Jordan 2000 2001 - Mar lastThu 0:00s 1:00 S -Rule Jordan 2002 max - Mar lastThu 24:00 1:00 S +Rule Jordan 2002 2012 - Mar lastThu 24:00 1:00 S Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - -Rule Jordan 2013 max - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2012 - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 - 2:00 Jordan EE%sT + 2:00 Jordan EE%sT 2012 Oct 26 0:00s + 3:00 - AST # Kazakhstan @@ -2303,9 +2322,18 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # http://www.samanews.com/index.php?act=Show&id=154120 # http://safa.ps/details/news/99844/%D8%B1%D8%A7%D9%85-%D8%A7%D9%84%D9%84%D9%87-%D8%A8%D8%AF%D8%A1-%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%AA-%D8%A7%D9%84%D8%B5%D9%8A%D9%81%D9%8A-29-%D8%A7%D9%84%D8%AC%D8%A7%D8%B1%D9%8A.html -# From Paul Eggert (2013-04-15): +# From Steffen Thorsen (2013-09-24): +# The Gaza and West Bank are ending DST Thursday at midnight +# (2013-09-27 00:00:00) (one hour earlier than last year...). +# This source in English, says "that winter time will go into effect +# at midnight on Thursday in the West Bank and Gaza Strip": +# http://english.wafa.ps/index.php?action=detail&id=23246 +# official source...: +# http://www.palestinecabinet.gov.ps/ar/Views/ViewDetails.aspx?pid=1252 + +# From Paul Eggert (2013-09-24): # For future dates, guess the last Thursday in March at 24:00 through -# the first Friday on or after September 21 at 01:00. This is consistent with +# the first Friday on or after September 21 at 00:00. This is consistent with # the predictions in today's editions of the following URLs, # which are for Gaza and Hebron respectively: # http://www.timeanddate.com/worldclock/timezone.html?n=702 @@ -2336,7 +2364,8 @@ Rule Palestine 2011 only - Aug 1 0:00 0 - Rule Palestine 2011 only - Aug 30 0:00 1:00 S Rule Palestine 2011 only - Sep 30 0:00 0 - Rule Palestine 2012 max - Mar lastThu 24:00 1:00 S -Rule Palestine 2012 max - Sep Fri>=21 1:00 0 - +Rule Palestine 2012 only - Sep 21 1:00 0 - +Rule Palestine 2013 max - Sep Fri>=21 0:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Gaza 2:17:52 - LMT 1900 Oct diff --git a/jdk/make/sun/javazic/tzdata/australasia b/jdk/make/sun/javazic/tzdata/australasia index 11a3cb97fee..cd6b724859d 100644 --- a/jdk/make/sun/javazic/tzdata/australasia +++ b/jdk/make/sun/javazic/tzdata/australasia @@ -375,16 +375,25 @@ Zone Indian/Cocos 6:27:40 - LMT 1900 # today confirmed that Fiji will start daylight savings at 2 am on Sunday 21st # October 2012 and end at 3 am on Sunday 20th January 2013. # http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=6702&catid=71&Itemid=155 + +# From the Fijian Government Media Center (2013-08-30) via David Wheeler: +# Fiji will start daylight savings on Sunday 27th October, 2013 and end at 3am +# on Sunday 19th January, 2014.... move clocks forward by one hour from 2am +# http://www.fiji.gov.fj/Media-Center/Press-Releases/DAYLIGHT-SAVING-STARTS-ON-SUNDAY,-27th-OCTOBER-201.aspx # -# From Paul Eggert (2012-08-31): -# For now, guess a pattern of the penultimate Sundays in October and January. +# From Paul Eggert (2013-09-09): +# For now, guess that Fiji springs forward the Sunday before the fourth +# Monday in October. This matches both recent practice and +# timeanddate.com's current spring-forward prediction. +# For the January 2014 transition we guessed right while timeanddate.com +# guessed wrong, so leave the fall-back prediction alone. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Fiji 1998 1999 - Nov Sun>=1 2:00 1:00 S Rule Fiji 1999 2000 - Feb lastSun 3:00 0 - Rule Fiji 2009 only - Nov 29 2:00 1:00 S Rule Fiji 2010 only - Mar lastSun 3:00 0 - -Rule Fiji 2010 max - Oct Sun>=18 2:00 1:00 S +Rule Fiji 2010 max - Oct Sun>=21 2:00 1:00 S Rule Fiji 2011 only - Mar Sun>=1 3:00 0 - Rule Fiji 2012 max - Jan Sun>=18 3:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -510,6 +519,7 @@ Zone Pacific/Auckland 11:39:04 - LMT 1868 Nov 2 Zone Pacific/Chatham 12:13:48 - LMT 1957 Jan 1 12:45 Chatham CHA%sT +Link Pacific/Auckland Antarctica/McMurdo # Auckland Is # uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers, @@ -759,7 +769,7 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901 # 1886-1891; Baker was similar but exact dates are not known. # Inhabited by civilians 1935-1942; U.S. military bases 1943-1944; # uninhabited thereafter. -# Howland observed Hawaii Standard Time (UTC-10:30) in 1937; +# Howland observed Hawaii Standard Time (UT-10:30) in 1937; # see page 206 of Elgen M. Long and Marie K. Long, # Amelia Earhart: the Mystery Solved, Simon & Schuster (2000). # So most likely Howland and Baker observed Hawaii Time from 1935 @@ -772,8 +782,17 @@ Zone Pacific/Funafuti 11:56:52 - LMT 1901 # no information; was probably like Pacific/Kiritimati # Johnston -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Johnston -10:00 - HST +# +# From Paul Eggert (2013-09-03): +# In his memoirs of June 6th to October 4, 1945 +# (2005), Herbert C. Bach writes, +# "We started our letdown to Kwajalein Atoll and landed there at 5:00 AM +# Johnston time, 1:30 AM Kwajalein time." This was in June 1945, and +# confirms that Johnston kept the same time as Honolulu in summer 1945. +# We have no better information, so for now, assume this has been true +# indefinitely into the past. +# +# See 'northamerica' for Pacific/Johnston. # Kingman # uninhabited diff --git a/jdk/make/sun/javazic/tzdata/backward b/jdk/make/sun/javazic/tzdata/backward index ca4c437a150..5afe9a317ff 100644 --- a/jdk/make/sun/javazic/tzdata/backward +++ b/jdk/make/sun/javazic/tzdata/backward @@ -45,15 +45,17 @@ Link America/Kentucky/Louisville America/Louisville Link America/Argentina/Mendoza America/Mendoza Link America/Rio_Branco America/Porto_Acre Link America/Argentina/Cordoba America/Rosario -Link America/St_Thomas America/Virgin +Link America/Denver America/Shiprock +Link America/Port_of_Spain America/Virgin +Link Pacific/Auckland Antarctica/South_Pole Link Asia/Ashgabat Asia/Ashkhabad +Link Asia/Kolkata Asia/Calcutta Link Asia/Chongqing Asia/Chungking Link Asia/Dhaka Asia/Dacca Link Asia/Kathmandu Asia/Katmandu -Link Asia/Kolkata Asia/Calcutta Link Asia/Macau Asia/Macao -Link Asia/Jerusalem Asia/Tel_Aviv Link Asia/Ho_Chi_Minh Asia/Saigon +Link Asia/Jerusalem Asia/Tel_Aviv Link Asia/Thimphu Asia/Thimbu Link Asia/Makassar Asia/Ujung_Pandang Link Asia/Ulaanbaatar Asia/Ulan_Bator @@ -111,10 +113,10 @@ Link Pacific/Auckland NZ Link Pacific/Chatham NZ-CHAT Link America/Denver Navajo Link Asia/Shanghai PRC -Link Pacific/Pago_Pago Pacific/Samoa -Link Pacific/Chuuk Pacific/Yap -Link Pacific/Chuuk Pacific/Truk Link Pacific/Pohnpei Pacific/Ponape +Link Pacific/Pago_Pago Pacific/Samoa +Link Pacific/Chuuk Pacific/Truk +Link Pacific/Chuuk Pacific/Yap Link Europe/Warsaw Poland Link Europe/Lisbon Portugal Link Asia/Taipei ROC diff --git a/jdk/make/sun/javazic/tzdata/etcetera b/jdk/make/sun/javazic/tzdata/etcetera index d557e3033fb..ebaa5fdfc04 100644 --- a/jdk/make/sun/javazic/tzdata/etcetera +++ b/jdk/make/sun/javazic/tzdata/etcetera @@ -54,9 +54,9 @@ Link Etc/GMT Etc/GMT0 # even though this is the opposite of what many people expect. # POSIX has positive signs west of Greenwich, but many people expect # positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses -# the abbreviation "GMT+4" and corresponds to 4 hours behind UTC +# the abbreviation "GMT+4" and corresponds to 4 hours behind UT # (i.e. west of Greenwich) even though many people would expect it to -# mean 4 hours ahead of UTC (i.e. east of Greenwich). +# mean 4 hours ahead of UT (i.e. east of Greenwich). # # In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='+4'; if you want time zone abbreviations conforming to diff --git a/jdk/make/sun/javazic/tzdata/europe b/jdk/make/sun/javazic/tzdata/europe index 688136c8016..9f574a3b2b6 100644 --- a/jdk/make/sun/javazic/tzdata/europe +++ b/jdk/make/sun/javazic/tzdata/europe @@ -65,7 +65,7 @@ # (1998-09-21, in Portuguese) # -# I invented the abbreviations marked `*' in the following table; +# I invented the abbreviations marked '*' in the following table; # the rest are from earlier versions of this file, or from other sources. # Corrections are welcome! # std dst 2dst @@ -119,7 +119,7 @@ # and a sketch map showing some of the sightlines involved. One paragraph # of the text said: # -# `An old stone obelisk marking a forgotten terrestrial meridian stands +# 'An old stone obelisk marking a forgotten terrestrial meridian stands # beside the river at Kew. In the 18th century, before time and longitude # was standardised by the Royal Observatory in Greenwich, scholars observed # this stone and the movement of stars from Kew Observatory nearby. They @@ -163,7 +163,7 @@ # From Paul Eggert (2003-09-27): # Summer Time was first seriously proposed by William Willett (1857-1915), # a London builder and member of the Royal Astronomical Society -# who circulated a pamphlet ``The Waste of Daylight'' (1907) +# who circulated a pamphlet "The Waste of Daylight" (1907) # that proposed advancing clocks 20 minutes on each of four Sundays in April, # and retarding them by the same amount on four Sundays in September. # A bill was drafted in 1909 and introduced in Parliament several times, @@ -188,10 +188,10 @@ # # From Paul Eggert (1996-09-03): -# The OED Supplement says that the English originally said ``Daylight Saving'' +# The OED Supplement says that the English originally said "Daylight Saving" # when they were debating the adoption of DST in 1908; but by 1916 this # term appears only in quotes taken from DST's opponents, whereas the -# proponents (who eventually won the argument) are quoted as using ``Summer''. +# proponents (who eventually won the argument) are quoted as using "Summer". # From Arthur David Olson (1989-01-19): # @@ -231,9 +231,9 @@ # which could not be said to run counter to any official description. # From Paul Eggert (2000-10-02): -# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common +# Howse writes (p 157) 'DBST' too, but 'BDST' seems to have been common # and follows the more usual convention of putting the location name first, -# so we use `BDST'. +# so we use 'BDST'. # Peter Ilieve (1998-04-19) described at length # the history of summer time legislation in the United Kingdom. @@ -454,6 +454,8 @@ Rule GB-Eire 1981 1989 - Oct Sun>=23 1:00u 0 GMT Rule GB-Eire 1990 1995 - Oct Sun>=22 1:00u 0 GMT # Summer Time Order 1997 (S.I. 1997/2982) # See EU for rules starting in 1996. +# +# Use Europe/London for Jersey, Guernsey, and the Isle of Man. # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/London -0:01:15 - LMT 1847 Dec 1 0:00s @@ -820,7 +822,7 @@ Zone Europe/Brussels 0:17:30 - LMT 1880 1:00 EU CE%sT # Bosnia and Herzegovina -# see Serbia +# See Europe/Belgrade. # Bulgaria # @@ -848,10 +850,10 @@ Zone Europe/Sofia 1:33:16 - LMT 1880 2:00 EU EE%sT # Croatia -# see Serbia +# See Europe/Belgrade. # Cyprus -# Please see the `asia' file for Asia/Nicosia. +# Please see the 'asia' file for Asia/Nicosia. # Czech Republic # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -868,6 +870,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 1:00 C-Eur CE%sT 1944 Sep 17 2:00s 1:00 Czech CE%sT 1979 1:00 EU CE%sT +# Use Europe/Prague also for Slovakia. # Denmark, Faroe Islands, and Greenland @@ -1031,12 +1034,12 @@ Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base # From Peter Ilieve (1996-10-28): # [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s, # but a relative confirms that Estonia still switches at 02:00s, writing:] -# ``I do not [know] exactly but there are some little different +# "I do not [know] exactly but there are some little different # (confusing) rules for International Air and Railway Transport Schedules # conversion in Sunday connected with end of summer time in Estonia.... # A discussion is running about the summer time efficiency and effect on # human physiology. It seems that Estonia maybe will not change to -# summer time next spring.'' +# summer time next spring." # From Peter Ilieve (1998-11-04), heavily edited: # @@ -1091,7 +1094,7 @@ Zone Europe/Tallinn 1:39:00 - LMT 1880 # Well, here in Helsinki we're just changing from summer time to regular one, # and it's supposed to change at 4am... -# From Janne Snabb (2010-0715): +# From Janne Snabb (2010-07-15): # # I noticed that the Finland data is not accurate for years 1981 and 1982. # During these two first trial years the DST adjustment was made one hour @@ -1148,7 +1151,7 @@ Link Europe/Helsinki Europe/Mariehamn # -# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman. +# Shank & Pottenger seem to use '24:00' ambiguously; resolve it with Whitman. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule France 1916 only - Jun 14 23:00s 1:00 S Rule France 1916 1919 - Oct Sun>=1 23:00s 0 - @@ -1438,7 +1441,7 @@ Zone Atlantic/Reykjavik -1:27:24 - LMT 1837 # # Day-light Saving Time in Italy (2006-02-03) # -# (`FP' below), taken from an Italian National Electrotechnical Institute +# ('FP' below), taken from an Italian National Electrotechnical Institute # publication. When the three sources disagree, guess who's right, as follows: # # year FP Shanks&P. (S) Whitman (W) Go with: @@ -1584,10 +1587,22 @@ Zone Europe/Riga 1:36:24 - LMT 1880 2:00 EU EE%sT # Liechtenstein -# Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Vaduz 0:38:04 - LMT 1894 Jun - 1:00 - CET 1981 - 1:00 EU CE%sT + +# From Paul Eggert (2013-09-09): +# Shanks & Pottenger say Vaduz is like Zurich. + +# From Alois Treindl (2013-09-18): +# http://www.eliechtensteinensia.li/LIJ/1978/1938-1978/1941.pdf +# ... confirms on p. 6 that Liechtenstein followed Switzerland in 1941 and 1942. +# I ... translate only the last two paragraphs: +# ... during second world war, in the years 1941 and 1942, Liechtenstein +# introduced daylight saving time, adapting to Switzerland. From 1943 on +# central European time was in force throughout the year. +# From a report of the duke's government to the high council, +# regarding the introduction of a time law, of 31 May 1977. + +Link Europe/Zurich Europe/Vaduz + # Lithuania @@ -1675,7 +1690,7 @@ Zone Europe/Luxembourg 0:24:36 - LMT 1904 Jun 1:00 EU CE%sT # Macedonia -# see Serbia +# See Europe/Belgrade. # Malta # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -1768,7 +1783,7 @@ Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15 1:00 EU CE%sT # Montenegro -# see Serbia +# See Europe/Belgrade. # Netherlands @@ -1883,7 +1898,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # before 1895, and therefore probably changed the local time somewhere # between 1895 and 1925 (inclusive). -# From Paul Eggert (2001-05-01): +# From Paul Eggert (2013-09-04): # # Actually, Jan Mayen was never occupied by Germany during World War II, # so it must have diverged from Oslo time during the war, as Oslo was @@ -1894,7 +1909,7 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # 1941 with a small Norwegian garrison and continued operations despite # frequent air ttacks from Germans. In 1943 the Americans established a # radiolocating station on the island, called "Atlantic City". Possibly -# the UTC offset changed during the war, but I think it unlikely that +# the UT offset changed during the war, but I think it unlikely that # Jan Mayen used German daylight-saving rules. # # Svalbard is more complicated, as it was raided in August 1941 by an @@ -1907,9 +1922,8 @@ Zone Europe/Oslo 0:43:00 - LMT 1895 Jan 1 # the German armed forces at the Svalbard weather station code-named # Haudegen did not surrender to the Allies until September 1945. # -# All these events predate our cutoff date of 1970. Unless we can -# come up with more definitive info about the timekeeping during the -# war years it's probably best just do...the following for now: +# All these events predate our cutoff date of 1970, so use Europe/Oslo +# for these regions. Link Europe/Oslo Arctic/Longyearbyen # Poland @@ -2167,7 +2181,7 @@ Zone Europe/Bucharest 1:44:24 - LMT 1891 Oct # so we (Novosibirsk) simply did not switch. # # From Andrey A. Chernov (1996-10-04): -# `MSK' and `MSD' were born and used initially on Moscow computers with +# 'MSK' and 'MSD' were born and used initially on Moscow computers with # UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group).... # The next step was the UUCP network, the Relcom predecessor # (used mainly for mail), and MSK/MSD was actively used there. @@ -2466,6 +2480,9 @@ Zone Asia/Anadyr 11:49:56 - LMT 1924 May 2 11:00 Russia ANA%sT 2011 Mar 27 2:00s 12:00 - ANAT +# San Marino +# See Europe/Rome. + # Serbia # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Europe/Belgrade 1:22:00 - LMT 1884 @@ -2488,7 +2505,7 @@ Link Europe/Belgrade Europe/Zagreb # Croatia Link Europe/Prague Europe/Bratislava # Slovenia -# see Serbia +# See Europe/Belgrade. # Spain # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S @@ -2622,7 +2639,7 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1 # and their performance improved enormously. Communities began to keep # mean time in preference to apparent time -- Geneva from 1780 .... # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -# From Whitman (who writes ``Midnight?''): +# From Whitman (who writes "Midnight?"): # Rule Swiss 1940 only - Nov 2 0:00 1:00 S # Rule Swiss 1940 only - Dec 31 0:00 0 - # From Shanks & Pottenger: @@ -2667,23 +2684,53 @@ Zone Europe/Stockholm 1:12:12 - LMT 1879 Jan 1 # The 1940 rules must be deleted. # # One further detail for Switzerland, which is probably out of scope for -# most users of tzdata: -# The zone file -# Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 -# 0:29:44 - BMT 1894 Jun #Bern Mean Time -# 1:00 Swiss CE%sT 1981 -# 1:00 EU CE%sT +# most users of tzdata: The [Europe/Zurich zone] ... # describes all of Switzerland correctly, with the exception of # the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not # follow Bern Mean Time but kept its own local mean time. # To represent this, an extra zone would be needed. +# +# From Alois Treindl (2013-09-11): +# The Federal regulations say +# http://www.admin.ch/opc/de/classified-compilation/20071096/index.html +# ... the meridian for Bern mean time ... is 7 degrees 26'22.50". +# Expressed in time, it is 0h29m45.5s. + +# From Pierre-Yves Berger (2013-09-11): +# the "Circulaire du conseil federal" (December 11 1893) +# ... +# clearly states that the [1894-06-01] change should be done at midnight +# but if no one is present after 11 at night, could be postponed until one +# hour before the beginning of service. + +# From Paul Eggert (2013-09-11): +# Round BMT to the nearest even second, 0:29:46. +# +# We can find no reliable source for Shanks's assertion that all of Switzerland +# except Geneva switched to Bern Mean Time at 00:00 on 1848-09-12. This book: +# +# Jakob Messerli. Gleichmassig, punktlich, schnell: Zeiteinteilung und +# Zeitgebrauch in der Schweiz im 19. Jahrhundert. Chronos, Zurich 1995, +# ISBN 3-905311-68-2, OCLC 717570797. +# +# suggests that the transition was more gradual, and that the Swiss did not +# agree about civil time during the transition. The timekeeping it gives the +# most detail for is postal and telegraph time: here, federal legislation (the +# "Bundesgesetz uber die Erstellung von elektrischen Telegraphen") passed on +# 1851-11-23, and an official implementation notice was published 1853-07-16 +# (Bundesblatt 1853, Bd. II, S. 859). On p 72 Messerli writes that in +# practice since July 1853 Bernese time was used in "all postal and telegraph +# offices in Switzerland from Geneva to St. Gallen and Basel to Chiasso" +# (Google translation). For now, model this transition as occurring on +# 1853-07-16, though it probably occurred at some other date in Zurich, and +# legal civil time probably changed at still some other transition date. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Swiss 1941 1942 - May Mon>=1 1:00 1:00 S Rule Swiss 1941 1942 - Oct Mon>=1 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Europe/Zurich 0:34:08 - LMT 1848 Sep 12 - 0:29:44 - BMT 1894 Jun # Bern Mean Time +Zone Europe/Zurich 0:34:08 - LMT 1853 Jul 16 # See above comment. + 0:29:46 - BMT 1894 Jun # Bern Mean Time 1:00 Swiss CE%sT 1981 1:00 EU CE%sT @@ -2907,7 +2954,7 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 # From Paul Eggert (2006-03-22): # The _Economist_ (1994-05-28, p 45) reports that central Crimea switched # from Kiev to Moscow time sometime after the January 1994 elections. -# Shanks (1999) says ``date of change uncertain'', but implies that it happened +# Shanks (1999) says "date of change uncertain", but implies that it happened # sometime between the 1994 DST switches. Shanks & Pottenger simply say # 1994-09-25 03:00, but that can't be right. For now, guess it # changed in May. @@ -2921,6 +2968,9 @@ Zone Europe/Simferopol 2:16:24 - LMT 1880 3:00 - MSK 1997 Mar lastSun 1:00u 2:00 EU EE%sT +# Vatican City +# See Europe/Rome. + ############################################################################### # One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from diff --git a/jdk/make/sun/javazic/tzdata/iso3166.tab b/jdk/make/sun/javazic/tzdata/iso3166.tab index c6b2d0af3f1..28fb64b647e 100644 --- a/jdk/make/sun/javazic/tzdata/iso3166.tab +++ b/jdk/make/sun/javazic/tzdata/iso3166.tab @@ -32,7 +32,7 @@ # 1. ISO 3166-1 alpha-2 country code, current as of # ISO 3166-1 Newsletter VI-15 (2013-05-10). See: Updates on ISO 3166 # http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm -# 2. The usual English name for the country, +# 2. The usual English name for the coded region, # chosen so that alphabetic sorting of subsets produces helpful lists. # This is not the same as the English name in the ISO 3166 tables. # @@ -46,7 +46,7 @@ # to take or endorse any position on legal or territorial claims. # #country- -#code country name +#code name of country, territory, area, or subdivision AD Andorra AE United Arab Emirates AF Afghanistan @@ -76,7 +76,7 @@ BL St Barthelemy BM Bermuda BN Brunei BO Bolivia -BQ Bonaire, St Eustatius & Saba +BQ Caribbean Netherlands BR Brazil BS Bahamas BT Bhutan diff --git a/jdk/make/sun/javazic/tzdata/leapseconds b/jdk/make/sun/javazic/tzdata/leapseconds index 912801227a2..faf5319d408 100644 --- a/jdk/make/sun/javazic/tzdata/leapseconds +++ b/jdk/make/sun/javazic/tzdata/leapseconds @@ -20,18 +20,24 @@ # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. -# -#

    -# This file is in the public domain, so clarified as of
    -# 2009-05-17 by Arthur David Olson.
     
     # Allowance for leapseconds added to each timezone file.
     
    +# This file is in the public domain.
    +
    +# This file is generated automatically from the data in the public-domain
    +# leap-seconds.list file available from most NIST time servers.
    +# If the URL  does not work,
    +# you should be able to pick up leap-seconds.list from a secondary NIST server.
    +# For more about leap-seconds.list, please see
    +# The NTP Timescale and Leap Seconds
    +# .
    +
     # The International Earth Rotation Service periodically uses leap seconds
     # to keep UTC to within 0.9 s of UT1
     # (which measures the true angular orientation of the earth in space); see
     # Terry J Quinn, The BIPM and the accurate measure of time,
    -# Proc IEEE 79, 7 (July 1991), 894-905.
    +# Proc IEEE 79, 7 (July 1991), 894-905 .
     # There were no leap seconds before 1972, because the official mechanism
     # accounting for the discrepancy between atomic time and the earth's rotation
     # did not exist until the early 1970s.
    @@ -42,8 +48,8 @@
     # or
     #	Leap	YEAR	MON	DAY	23:59:59	-	R/S
     
    -# If the leapsecond is Rolling (R) the given time is local time
    -# If the leapsecond is Stationary (S) the given time is UTC
    +# If the leapsecond is Rolling (R) the given time is local time.
    +# If the leapsecond is Stationary (S) the given time is UTC.
     
     # Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
     Leap	1972	Jun	30	23:59:60	+	S
    @@ -71,53 +77,3 @@ Leap	1998	Dec	31	23:59:60	+	S
     Leap	2005	Dec	31	23:59:60	+	S
     Leap	2008	Dec	31	23:59:60	+	S
     Leap	2012	Jun	30	23:59:60	+	S
    -
    -# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
    -#
    -# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
    -#
    -#
    -# SERVICE DE LA ROTATION TERRESTRE
    -# OBSERVATOIRE DE PARIS
    -# 61, Av. de l'Observatoire 75014 PARIS (France)
    -# Tel.      : 33 (0) 1 40 51 22 26
    -# FAX       : 33 (0) 1 40 51 22 91
    -# e-mail    : (E-Mail Removed)
    -# http://hpiers.obspm.fr/eop-pc
    -#
    -# Paris, 5 January 2012
    -#
    -#
    -# Bulletin C 43
    -#
    -# To authorities responsible
    -# for the measurement and
    -# distribution of time
    -#
    -#
    -# UTC TIME STEP
    -# on the 1st of July 2012
    -#
    -#
    -# A positive leap second will be introduced at the end of June 2012.
    -# The sequence of dates of the UTC second markers will be:
    -#
    -#                          2012 June 30,     23h 59m 59s
    -#                          2012 June 30,     23h 59m 60s
    -#                          2012 July  1,      0h  0m  0s
    -#
    -# The difference between UTC and the International Atomic Time TAI is:
    -#
    -# from 2009 January 1, 0h UTC, to 2012 July 1  0h UTC  : UTC-TAI = - 34s
    -# from 2012 July 1,    0h UTC, until further notice    : UTC-TAI = - 35s
    -#
    -# Leap seconds can be introduced in UTC at the end of the months of December
    -# or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every
    -# six months, either to announce a time step in UTC or to confirm that there
    -# will be no time step at the next possible date.
    -#
    -#
    -# Daniel GAMBIS
    -# Head
    -# Earth Orientation Center of IERS
    -# Observatoire de Paris, France
    diff --git a/jdk/make/sun/javazic/tzdata/northamerica b/jdk/make/sun/javazic/tzdata/northamerica
    index 43a0b22504b..b8caf6d019b 100644
    --- a/jdk/make/sun/javazic/tzdata/northamerica
    +++ b/jdk/make/sun/javazic/tzdata/northamerica
    @@ -43,7 +43,7 @@
     # Howse writes (pp 121-125) that time zones were invented by
     # Professor Charles Ferdinand Dowd (1825-1904),
     # Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
    -# His pamphlet ``A System of National Time for Railroads'' (1870)
    +# His pamphlet "A System of National Time for Railroads" (1870)
     # was the result of his proposals at the Convention of Railroad Trunk Lines
     # in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
     # but in 1872-05 he moved the proposed origin to Greenwich.
    @@ -63,8 +63,8 @@
     
     # From Paul Eggert (2001-03-06):
     # Daylight Saving Time was first suggested as a joke by Benjamin Franklin
    -# in his whimsical essay ``An Economical Project for Diminishing the Cost
    -# of Light'' published in the Journal de Paris (1784-04-26).
    +# in his whimsical essay "An Economical Project for Diminishing the Cost
    +# of Light" published in the Journal de Paris (1784-04-26).
     # Not everyone is happy with the results:
     #
     #	I don't really care how time is reckoned so long as there is some
    @@ -190,8 +190,8 @@ Zone	PST8PDT		 -8:00	US	P%sT
     #    of the Aleutian islands.   No DST.
     
     # From Paul Eggert (1995-12-19):
    -# The tables below use `NST', not `NT', for Nome Standard Time.
    -# I invented `CAWT' for Central Alaska War Time.
    +# The tables below use 'NST', not 'NT', for Nome Standard Time.
    +# I invented 'CAWT' for Central Alaska War Time.
     
     # From U. S. Naval Observatory (1989-01-19):
     # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
    @@ -260,9 +260,9 @@ Zone	PST8PDT		 -8:00	US	P%sT
     # H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
     #   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
     #   U.S.C. 260a(a)) is amended--
    -#     (1) by striking `first Sunday of April' and inserting `second
    +#     (1) by striking 'first Sunday of April' and inserting 'second
     #     Sunday of March'; and
    -#     (2) by striking `last Sunday of October' and inserting `first
    +#     (2) by striking 'last Sunday of October' and inserting 'first
     #     Sunday of November'.
     #   (b) Effective Date- Subsection (a) shall take effect 1 year after the
     #   date of enactment of this Act or March 1, 2007, whichever is later.
    @@ -623,6 +623,8 @@ Zone Pacific/Honolulu	-10:31:26 -	LMT	1896 Jan 13 12:00 #Schmitt&Cox
     			-10:30	-	HST	1947 Jun  8 2:00 #Schmitt&Cox+2
     			-10:00	-	HST
     
    +Link Pacific/Honolulu Pacific/Johnston
    +
     # Now we turn to US areas that have diverged from the consensus since 1970.
     
     # Arizona mostly uses MST.
    @@ -659,8 +661,9 @@ Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
     # Navajo Nation participates in the Daylight Saving Time policy, due to its
     # large size and location in three states."  (The "only" means that other
     # tribal nations don't use DST.)
    -
    -Link America/Denver America/Shiprock
    +#
    +# From Paul Eggert (2013-08-26):
    +# See America/Denver for a zone appropriate for the Navajo Nation.
     
     # Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
     # Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
    @@ -700,13 +703,13 @@ Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:15:11
     #   and Switzerland counties have their own time zone histories as noted below.
     #
     # Shanks partitioned Indiana into 345 regions, each with its own time history,
    -# and wrote ``Even newspaper reports present contradictory information.''
    +# and wrote "Even newspaper reports present contradictory information."
     # Those Hoosiers!  Such a flighty and changeable people!
     # Fortunately, most of the complexity occurred before our cutoff date of 1970.
     #
     # Other than Indianapolis, the Indiana place names are so nondescript
    -# that they would be ambiguous if we left them at the `America' level.
    -# So we reluctantly put them all in a subdirectory `America/Indiana'.
    +# that they would be ambiguous if we left them at the 'America' level.
    +# So we reluctantly put them all in a subdirectory 'America/Indiana'.
     
     # From Paul Eggert (2005-08-16):
     # http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
    @@ -970,8 +973,8 @@ Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
     # This story is too entertaining to be false, so go with Howse over Shanks.
     #
     # From Paul Eggert (2001-03-06):
    -# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
    -# one hour in 1914.''  This change is not in Shanks.  We have no more
    +# Garland (1927) writes "Cleveland and Detroit advanced their clocks
    +# one hour in 1914."  This change is not in Shanks.  We have no more
     # info, so omit this for now.
     #
     # Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
    @@ -1011,7 +1014,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
     # occupied 1857/1900 by the Navassa Phosphate Co
     # US lighthouse 1917/1996-09
     # currently uninhabited
    -# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
    +# see Mark Fineman, "An Isle Rich in Guano and Discord",
     # _Los Angeles Times_ (1998-11-10), A1, A10; it cites
     # Jimmy Skaggs, _The Great Guano Rush_ (1994).
     
    @@ -1045,7 +1048,7 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
     #	Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94
     #	.
     #
    -# See the `europe' file for Greenland.
    +# See the 'europe' file for Greenland.
     
     # Canada
     
    @@ -1246,7 +1249,7 @@ Zone America/St_Johns	-3:30:52 -	LMT	1884
     
     # most of east Labrador
     
    -# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
    +# The name 'Happy Valley-Goose Bay' is too long; use 'Goose Bay'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Goose_Bay	-4:01:40 -	LMT	1884 # Happy Valley-Goose Bay
     			-3:30:52 -	NST	1918
    @@ -1363,25 +1366,27 @@ Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
     
     # Quebec
     
    -# From Paul Eggert (2006-07-09):
    -# Shanks & Pottenger write that since 1970 most of Quebec has been
    -# like Montreal.
    +# From Paul Eggert (2013-08-30):
    +# Since 1970 most of Quebec has been like Toronto.
    +# However, because earlier versions of the tz database mistakenly relied on data
    +# from Shanks & Pottenger saying that Quebec differed from Ontario after 1970,
    +# a separate entry was created for most of Quebec.  We're loath to lose
    +# its pre-1970 info, even though the tz database is normally limited to
    +# zones that differ after 1970, so keep this otherwise out-of-scope entry.
     
    -# From Paul Eggert (2006-06-27):
     # Matthews and Vincent (1998) also write that Quebec east of the -63
     # meridian is supposed to observe AST, but residents as far east as
     # Natashquan use EST/EDT, and residents east of Natashquan use AST.
    -# In "Official time in Quebec" the Quebec department of justice writes in
    -# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
    -# that "The residents of the Municipality of the
    -# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
    -# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
    -# written and use Atlantic standard time all year round. The same applies to
    -# the residents of the Native facilities along the lower North Shore."
    -# 
    +# The Quebec department of justice writes in
    +# "The situation in Minganie and Basse-Cote-Nord"
    +# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm
    +# that the coastal strip from just east of Natashquan to Blanc-Sablon
    +# observes Atlantic standard time all year round.
    +# http://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en
     # says this common practice was codified into law as of 2007.
     # For lack of better info, guess this practice began around 1970, contra to
     # Shanks & Pottenger who have this region observing AST/ADT.
    +# for post-1970 data America/Puerto_Rico.
     
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
    @@ -1425,7 +1430,6 @@ Zone America/Montreal	-4:54:16 -	LMT	1884
     			-5:00	Mont	E%sT	1974
     			-5:00	Canada	E%sT
     
    -
     # Ontario
     
     # From Paul Eggert (2006-07-09):
    @@ -1644,7 +1648,7 @@ Zone America/Thunder_Bay -5:57:00 -	LMT	1895
     			-6:00	-	CST	1910
     			-5:00	-	EST	1942
     			-5:00	Canada	E%sT	1970
    -			-5:00	Mont	E%sT	1973
    +			-5:00	Toronto	E%sT	1973
     			-5:00	-	EST	1974
     			-5:00	Canada	E%sT
     Zone America/Nipigon	-5:53:04 -	LMT	1895
    @@ -2231,7 +2235,7 @@ Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
     # From Paul Eggert (1996-06-12):
     # For an English translation of the decree, see
     # 
    -# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
    +# "Diario Oficial: Time Zone Changeover" (1996-01-04).
     # 
     
     # From Rives McDow (1998-10-08):
    @@ -2568,9 +2572,7 @@ Zone America/Santa_Isabel	-7:39:28 -	LMT	1922 Jan  1  0:20:32
     ###############################################################################
     
     # Anguilla
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Anguilla	-4:12:16 -	LMT	1912 Mar 2
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Antigua and Barbuda
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -2639,13 +2641,13 @@ Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Atlantic/Bermuda	-4:19:18 -	LMT	1930 Jan  1 2:00    # Hamilton
     			-4:00	-	AST	1974 Apr 28 2:00
    -			-4:00	Bahamas	A%sT	1976
    +			-4:00	Canada	A%sT	1976
     			-4:00	US	A%sT
     
     # Cayman Is
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Cayman	-5:25:32 -	LMT	1890		# Georgetown
    -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
    +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
     			-5:00	-	EST
     
     # Costa Rica
    @@ -2660,7 +2662,7 @@ Rule	CR	1991	1992	-	Jan	Sat>=15	0:00	1:00	D
     # go with Shanks & Pottenger.
     Rule	CR	1991	only	-	Jul	 1	0:00	0	S
     Rule	CR	1992	only	-	Mar	15	0:00	0	S
    -# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
    +# There are too many San Joses elsewhere, so we'll use 'Costa Rica'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Costa_Rica	-5:36:13 -	LMT	1890		# San Jose
     			-5:36:13 -	SJMT	1921 Jan 15 # San Jose Mean Time
    @@ -2892,9 +2894,7 @@ Zone	America/Havana	-5:29:28 -	LMT	1890
     			-5:00	Cuba	C%sT
     
     # Dominica
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Dominica	-4:05:36 -	LMT	1911 Jul 1 0:01		# Roseau
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Dominican Republic
     
    @@ -2943,18 +2943,10 @@ Zone America/El_Salvador -5:56:48 -	LMT	1921		# San Salvador
     			-6:00	Salv	C%sT
     
     # Grenada
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	America/Grenada	-4:07:00 -	LMT	1911 Jul	# St George's
    -			-4:00	-	AST
    -
     # Guadeloupe
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Guadeloupe	-4:06:08 -	LMT	1911 Jun 8	# Pointe a Pitre
    -			-4:00	-	AST
     # St Barthelemy
    -Link America/Guadeloupe	America/St_Barthelemy
     # St Martin (French part)
    -Link America/Guadeloupe	America/Marigot
    +# See 'southamerica'.
     
     # Guatemala
     #
    @@ -3097,17 +3089,12 @@ Zone America/Tegucigalpa -5:48:52 -	LMT	1921 Apr
     # Great Swan I ceded by US to Honduras in 1972
     
     # Jamaica
    -
    -# From Bob Devine (1988-01-28):
    -# Follows US rules.
    -
    -# From U. S. Naval Observatory (1989-01-19):
    -# JAMAICA             5 H  BEHIND UTC
    -
    -# From Shanks & Pottenger:
    +# Shanks & Pottenger give -5:07:12, but Milne records -5:07:10.41 from an
    +# unspecified official document, and says "This time is used throughout the
    +# island".  Go with Milne.  Round to the nearest second as required by zic.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	America/Jamaica	-5:07:12 -	LMT	1890		# Kingston
    -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
    +Zone	America/Jamaica	-5:07:11 -	LMT	1890		# Kingston
    +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
     			-5:00	-	EST	1974 Apr 28 2:00
     			-5:00	US	E%sT	1984
     			-5:00	-	EST
    @@ -3121,12 +3108,7 @@ Zone America/Martinique	-4:04:20 -      LMT	1890		# Fort-de-France
     			-4:00	-	AST
     
     # Montserrat
    -# From Paul Eggert (2006-03-22):
    -# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
    -# world.gazetteer.com says Cork Hill is the most populous location now.
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Montserrat	-4:08:52 -	LMT	1911 Jul 1 0:01   # Cork Hill
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Nicaragua
     #
    @@ -3200,7 +3182,7 @@ Zone	America/Panama	-5:18:08 -	LMT	1890
     			-5:00	-	EST
     
     # Puerto Rico
    -# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
    +# There are too many San Juans elsewhere, so we'll use 'Puerto_Rico'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
     			-4:00	-	AST	1942 May  3
    @@ -3208,18 +3190,11 @@ Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
     			-4:00	-	AST
     
     # St Kitts-Nevis
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Kitts	-4:10:52 -	LMT	1912 Mar 2	# Basseterre
    -			-4:00	-	AST
    -
     # St Lucia
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Lucia	-4:04:00 -	LMT	1890		# Castries
    -			-4:04:00 -	CMT	1912	    # Castries Mean Time
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # St Pierre and Miquelon
    -# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
    +# There are too many St Pierres elsewhere, so we'll use 'Miquelon'.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
     			-4:00	-	AST	1980 May
    @@ -3227,10 +3202,7 @@ Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
     			-3:00	Canada	PM%sT
     
     # St Vincent and the Grenadines
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Vincent	-4:04:56 -	LMT	1890		# Kingstown
    -			-4:04:56 -	KMT	1912	   # Kingstown Mean Time
    -			-4:00	-	AST
    +# See 'southamerica'.
     
     # Turks and Caicos
     #
    @@ -3260,15 +3232,9 @@ Rule	TC	2007	max	-	Mar	Sun>=8	2:00	1:00	D
     Rule	TC	2007	max	-	Nov	Sun>=1	2:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Grand_Turk	-4:44:32 -	LMT	1890
    -			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
    +			-5:07:11 -	KMT	1912 Feb    # Kingston Mean Time
     			-5:00	TC	E%sT
     
     # British Virgin Is
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/Tortola	-4:18:28 -	LMT	1911 Jul    # Road Town
    -			-4:00	-	AST
    -
     # Virgin Is
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone America/St_Thomas	-4:19:44 -	LMT	1911 Jul    # Charlotte Amalie
    -			-4:00	-	AST
    +# See 'southamerica'.
    diff --git a/jdk/make/sun/javazic/tzdata/southamerica b/jdk/make/sun/javazic/tzdata/southamerica
    index e7df18ad2c3..2230d066661 100644
    --- a/jdk/make/sun/javazic/tzdata/southamerica
    +++ b/jdk/make/sun/javazic/tzdata/southamerica
    @@ -474,6 +474,17 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
     # rules...San Luis is still using "Western ARgentina Time" and it got
     # stuck on Summer daylight savings time even though the summer is over.
     
    +# From Paul Eggert (2013-09-05):
    +# Perhaps San Luis operates on the legal fiction that it is at UTC-4
    +# with perpetual summer time, but ordinary usage typically seems to
    +# just say it's at UTC-3; see, for example,
    +# .
    +# We've documented similar situations as being plain changes to
    +# standard time, so let's do that here too.  This does not change UTC
    +# offsets, only tm_isdst and the time zone abbreviations.  One minor
    +# plus is that this silences a zic complaint that there's no POSIX TZ
    +# setting for time stamps past 2038.
    +
     # From Paul Eggert (2013-02-21):
     # Milne says Cordoba time was -4:16:48.2.  Round to the nearest second.
     
    @@ -611,7 +622,7 @@ Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
     # San Luis (SL)
     
     Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
    -Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
    +Rule	SanLuis	2007	2008	-	Oct	Sun>=8	0:00	1:00	S
     
     Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    @@ -627,7 +638,8 @@ Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
     			-3:00	-	ART	2004 May 31
     			-4:00	-	WART	2004 Jul 25
     			-3:00	Arg	AR%sT	2008 Jan 21
    -			-4:00	SanLuis	WAR%sT
    +			-4:00	SanLuis	WAR%sT	2009 Oct 11
    +			-3:00	-	ART
     #
     # Santa Cruz (SC)
     Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
    @@ -654,10 +666,7 @@ Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
     			-3:00	-	ART
     
     # Aruba
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	America/Aruba	-4:40:24 -	LMT	1912 Feb 12	# Oranjestad
    -			-4:30	-	ANT	1965 # Netherlands Antilles Time
    -			-4:00	-	AST
    +Link America/Curacao America/Aruba
     
     # Bolivia
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -859,6 +868,12 @@ Zone	America/La_Paz	-4:32:36 -	LMT	1890
     # Tocantins state will have DST.
     # http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html
     
    +# From Steffen Thorsen (2013-09-20):
    +# Tocantins in Brazil is very likely not to observe DST from October....
    +# http://conexaoto.com.br/2013/09/18/ministerio-confirma-que-tocantins-esta-fora-do-horario-de-verao-em-2013-mas-falta-publicacao-de-decreto
    +# We will keep this article updated when this is confirmed:
    +# http://www.timeanddate.com/news/time/brazil-starts-dst-2013.html
    +
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     # Decree 20,466 (1931-10-01)
     # Decree 21,896 (1932-01-10)
    @@ -1078,7 +1093,8 @@ Zone America/Araguaina	-3:12:48 -	LMT	1914
     			-3:00	-	BRT	1995 Sep 14
     			-3:00	Brazil	BR%sT	2003 Sep 24
     			-3:00	-	BRT	2012 Oct 21
    -			-3:00	Brazil	BR%sT
    +			-3:00	Brazil	BR%sT	2013 Sep
    +			-3:00	-	BRT
     #
     # Alagoas (AL), Sergipe (SE)
     Zone America/Maceio	-2:22:52 -	LMT	1914
    @@ -1373,12 +1389,12 @@ Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12	# Willemstad
     			-4:00	-	AST
     
     # From Arthur David Olson (2011-06-15):
    -# At least for now, use links for places with new iso3166 codes.
    +# use links for places with new iso3166 codes.
     # The name "Lower Prince's Quarter" is both longer than fourteen charaters
     # and contains an apostrophe; use "Lower_Princes" below.
     
    -Link	America/Curacao	America/Lower_Princes # Sint Maarten
    -Link	America/Curacao	America/Kralendijk # Bonaire, Sint Estatius and Saba
    +Link	America/Curacao	America/Lower_Princes	# Sint Maarten
    +Link	America/Curacao	America/Kralendijk	# Caribbean Netherlands
     
     # Ecuador
     #
    @@ -1519,10 +1535,16 @@ Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar	# Georgetown
     			-4:00	-	GYT
     
     # Paraguay
    +#
     # From Paul Eggert (2006-03-22):
     # Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
     # and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
     # editions of Shanks, and with the IATA, who say transitions occur at 00:00.
    +#
    +# From Waldemar Villamayor-Venialbo (2013-09-20):
    +# No time of the day is established for the adjustment, so people normally
    +# adjust their clocks at 0 hour of the given dates.
    +#
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Para	1975	1988	-	Oct	 1	0:00	1:00	S
     Rule	Para	1975	1978	-	Mar	 1	0:00	0	-
    @@ -1656,6 +1678,19 @@ Zone America/Paramaribo	-3:40:40 -	LMT	1911
     Zone America/Port_of_Spain -4:06:04 -	LMT	1912 Mar 2
     			-4:00	-	AST
     
    +Link America/Port_of_Spain America/Anguilla
    +Link America/Port_of_Spain America/Dominica
    +Link America/Port_of_Spain America/Grenada
    +Link America/Port_of_Spain America/Guadeloupe
    +Link America/Port_of_Spain America/Marigot
    +Link America/Port_of_Spain America/Montserrat
    +Link America/Port_of_Spain America/St_Barthelemy
    +Link America/Port_of_Spain America/St_Kitts
    +Link America/Port_of_Spain America/St_Lucia
    +Link America/Port_of_Spain America/St_Thomas
    +Link America/Port_of_Spain America/St_Vincent
    +Link America/Port_of_Spain America/Tortola
    +
     # Uruguay
     # From Paul Eggert (1993-11-18):
     # Uruguay wins the prize for the strangest peacetime manipulation of the rules.
    @@ -1673,7 +1708,7 @@ Rule	Uruguay	1937	1941	-	Mar	lastSun	 0:00	0	-
     # Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
     Rule	Uruguay	1937	1940	-	Oct	lastSun	 0:00	0:30	HS
     # Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
    -# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
    +# and 1943 Apr 13 "to present time"; go with Shanks & Pottenger.
     Rule	Uruguay	1941	only	-	Aug	 1	 0:00	0:30	HS
     Rule	Uruguay	1942	only	-	Jan	 1	 0:00	0	-
     Rule	Uruguay	1942	only	-	Dec	14	 0:00	1:00	S
    diff --git a/jdk/make/sun/javazic/tzdata/zone.tab b/jdk/make/sun/javazic/tzdata/zone.tab
    index aa247c26df8..b34cdb0dc7d 100644
    --- a/jdk/make/sun/javazic/tzdata/zone.tab
    +++ b/jdk/make/sun/javazic/tzdata/zone.tab
    @@ -26,27 +26,30 @@
     # This file is in the public domain, so clarified as of
     # 2009-05-17 by Arthur David Olson.
     #
    -# From Paul Eggert (2013-05-27):
    +# From Paul Eggert (2013-08-14):
     #
    -# This file contains a table with the following columns:
    -# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
    -#     This identifies a country that overlaps the zone.  The country may
    -#     overlap other zones and the zone may overlap other countries.
    -# 2.  Latitude and longitude of the zone's principal location
    +# This file contains a table where each row stands for an area that is
    +# the intersection of a region identified by a country code and of a
    +# zone where civil clocks have agreed since 1970.  The columns of the
    +# table are as follows:
    +#
    +# 1.  ISO 3166 2-character country code.  See the file 'iso3166.tab'.
    +# 2.  Latitude and longitude of the area's principal location
     #     in ISO 6709 sign-degrees-minutes-seconds format,
     #     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
     #     first latitude (+ is north), then longitude (+ is east).
    -#     This location need not lie within the column-1 country.
     # 3.  Zone name used in value of TZ environment variable.
     #     Please see the 'Theory' file for how zone names are chosen.
    +#     If multiple zones overlap a country, each has a row in the
    +#     table, with column 1 being duplicated.
     # 4.  Comments; present if and only if the country has multiple rows.
     #
     # Columns are separated by a single tab.
     # The table is sorted first by country, then an order within the country that
     # (1) makes some geographical sense, and
    -# (2) puts the most populous zones first, where that does not contradict (1).
    +# (2) puts the most populous areas first, where that does not contradict (1).
     #
    -# Lines beginning with `#' are comments.
    +# Lines beginning with '#' are comments.
     #
     # This table is intended as an aid for users, to help them select time
     # zone data appropriate for their practical needs.  It is not intended
    @@ -62,8 +65,7 @@ AI	+1812-06304	America/Anguilla
     AL	+4120+01950	Europe/Tirane
     AM	+4011+04430	Asia/Yerevan
     AO	-0848+01314	Africa/Luanda
    -AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
    -AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
    +AQ	-7750+16636	Antarctica/McMurdo	McMurdo, South Pole, Scott (New Zealand time)
     AQ	-6734-06808	Antarctica/Rothera	Rothera Station, Adelaide Island
     AQ	-6448-06406	Antarctica/Palmer	Palmer Station, Anvers Island
     AQ	-6736+06253	Antarctica/Mawson	Mawson Station, Holme Bay
    @@ -143,8 +145,7 @@ CA	+4612-05957	America/Glace_Bay	Atlantic Time - Nova Scotia - places that did n
     CA	+4606-06447	America/Moncton	Atlantic Time - New Brunswick
     CA	+5320-06025	America/Goose_Bay	Atlantic Time - Labrador - most locations
     CA	+5125-05707	America/Blanc-Sablon	Atlantic Standard Time - Quebec - Lower North Shore
    -CA	+4531-07334	America/Montreal	Eastern Time - Quebec - most locations
    -CA	+4339-07923	America/Toronto	Eastern Time - Ontario - most locations
    +CA	+4339-07923	America/Toronto	Eastern Time - Ontario & Quebec - most locations
     CA	+4901-08816	America/Nipigon	Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
     CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
     CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
    @@ -255,7 +256,7 @@ IR	+3540+05126	Asia/Tehran
     IS	+6409-02151	Atlantic/Reykjavik
     IT	+4154+01229	Europe/Rome
     JE	+4912-00207	Europe/Jersey
    -JM	+1800-07648	America/Jamaica
    +JM	+175805-0764736	America/Jamaica
     JO	+3157+03556	Asia/Amman
     JP	+353916+1394441	Asia/Tokyo
     KE	-0117+03649	Africa/Nairobi
    @@ -444,8 +445,7 @@ US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota -
     US	+471551-1014640	America/North_Dakota/Beulah	Central Time - North Dakota - Mercer County
     US	+394421-1045903	America/Denver	Mountain Time
     US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
    -US	+364708-1084111	America/Shiprock	Mountain Time - Navajo
    -US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona
    +US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona (except Navajo)
     US	+340308-1181434	America/Los_Angeles	Pacific Time
     US	+611305-1495401	America/Anchorage	Alaska Time
     US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
    diff --git a/jdk/make/tools/Makefile b/jdk/make/tools/Makefile
    index e01f77ea03d..d6724f7b2d7 100644
    --- a/jdk/make/tools/Makefile
    +++ b/jdk/make/tools/Makefile
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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
    @@ -35,6 +35,7 @@ include $(BUILDDIR)/common/Defs.gmk
     # Note: freetypecheck is built by Sanity.gmk if needed
     SUBDIRS =                   \
       addjsum                   \
    +  addtorestrictedpkgs       \
       buildmetaindex            \
       cldrconverter             \
       commentchecker            \
    diff --git a/jdk/make/sun/awt/FILES_export_macosx.gmk b/jdk/make/tools/addtorestrictedpkgs/Makefile
    similarity index 71%
    rename from jdk/make/sun/awt/FILES_export_macosx.gmk
    rename to jdk/make/tools/addtorestrictedpkgs/Makefile
    index c7f0e003cb9..53922d56519 100644
    --- a/jdk/make/sun/awt/FILES_export_macosx.gmk
    +++ b/jdk/make/tools/addtorestrictedpkgs/Makefile
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2013, Oracle and/or its affiliates. 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
    @@ -23,7 +23,21 @@
     # questions.
     #
     
    -# FILES_export definitions for Mac OS X
    +#
    +# Makefile for building the addtorestrictedpkgs tool
    +#
    +
    +BUILDDIR = ../..
    +PACKAGE = build.tools.addtorestrictedpkgs
    +PRODUCT = tools
    +PROGRAM = addtorestrictedpkgs
    +include $(BUILDDIR)/common/Defs.gmk
    +
    +BUILDTOOL_SOURCE_ROOT = $(BUILDDIR)/tools/src
    +BUILDTOOL_MAIN        = $(PKGDIR)/AddToRestrictedPkgs.java
    +
    +#
    +# Build tool jar rules.
    +#
    +include $(BUILDDIR)/common/BuildToolJar.gmk
     
    -FILES_export += \
    -	com/apple/resources/MacOSXResourceBundle.java
    diff --git a/jdk/make/tools/src/build/tools/addtorestrictedpkgs/AddToRestrictedPkgs.java b/jdk/make/tools/src/build/tools/addtorestrictedpkgs/AddToRestrictedPkgs.java
    new file mode 100644
    index 00000000000..ee9deb4b75f
    --- /dev/null
    +++ b/jdk/make/tools/src/build/tools/addtorestrictedpkgs/AddToRestrictedPkgs.java
    @@ -0,0 +1,105 @@
    +/*
    + * Copyright (c) 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    + * particular file as subject to the "Classpath" exception as provided
    + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    + * or visit www.oracle.com if you need additional information or have any
    + * questions.
    + */
    +
    +package build.tools.addtorestrictedpkgs;
    +
    +import java.io.*;
    +
    +/**
    + * Adds additional packages to the package.access and package.definition
    + * security properties.
    + */
    +public class AddToRestrictedPkgs {
    +
    +    private static final String PKG_ACC = "package.access";
    +    private static final String PKG_DEF = "package.definition";
    +    private static final int PKG_ACC_INDENT = 15;
    +    private static final int PKG_DEF_INDENT = 19;
    +
    +    public static void main(String[] args) throws Exception {
    +
    +        if (args.length < 3) {
    +            System.err.println("Usage: java AddToRestrictedPkgs " +
    +                               "[input java.security file name] " +
    +                               "[output java.security file name] " +
    +                               "[packages ...]");
    +            System.exit(1);
    +        }
    +
    +        try (FileReader fr = new FileReader(args[0]);
    +             BufferedReader br = new BufferedReader(fr);
    +             FileWriter fw = new FileWriter(args[1]);
    +             BufferedWriter bw = new BufferedWriter(fw))
    +        {
    +            // parse the file line-by-line, looking for pkg access properties
    +            String line = br.readLine();
    +            while (line != null) {
    +                if (line.startsWith(PKG_ACC)) {
    +                    writePackages(br, bw, line, PKG_ACC_INDENT, args);
    +                } else if (line.startsWith(PKG_DEF)) {
    +                    writePackages(br, bw, line, PKG_DEF_INDENT, args);
    +                } else {
    +                    writeLine(bw, line);
    +                }
    +                line = br.readLine();
    +            }
    +            bw.flush();
    +        }
    +    }
    +
    +    private static void writePackages(BufferedReader br, BufferedWriter bw,
    +                                      String line, int numSpaces,
    +                                      String[] args) throws IOException {
    +        // parse property until EOL, not including line breaks
    +        while (line.endsWith("\\")) {
    +            writeLine(bw, line);
    +            line = br.readLine();
    +        }
    +        // append comma and line-break to last package
    +        writeLine(bw, line + ",\\");
    +        // add new packages, one per line
    +        for (int i = 2; i < args.length - 1; i++) {
    +            indent(bw, numSpaces);
    +            writeLine(bw, args[i] + ",\\");
    +        }
    +        indent(bw, numSpaces);
    +        writeLine(bw, args[args.length - 1]);
    +    }
    +
    +    private static void writeLine(BufferedWriter bw, String line)
    +        throws IOException
    +    {
    +        bw.write(line);
    +        bw.newLine();
    +    }
    +
    +    private static void indent(BufferedWriter bw, int numSpaces)
    +        throws IOException
    +    {
    +        for (int i = 0; i < numSpaces; i++) {
    +            bw.append(' ');
    +        }
    +    }
    +}
    diff --git a/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java b/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
    index f573c57e99f..f08b115912e 100644
    --- a/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
    +++ b/jdk/make/tools/src/build/tools/buildmetaindex/BuildMetaIndex.java
    @@ -173,6 +173,12 @@ class JarMetaIndex {
          */
         private HashMap> knownPrefixMap = new HashMap<>();
     
    +    /**
    +     * Special value for the HashSet to indicate that there are classes in
    +     * the top-level package.
    +     */
    +    private static final String TOP_LEVEL = "TOP";
    +
         /*
          * A class for mapping package prefixes to the number of
          * levels of package elements to include.
    @@ -212,7 +218,7 @@ class JarMetaIndex {
     
     
         /*
    -     * We add maximum 5 second level entries to "sun", "java" and
    +     * We add maximum 5 second level entries to "sun", "jdk", "java" and
          * "javax" entries. Tune this parameter to get a balance on the
          * cold start and footprint.
          */
    @@ -223,6 +229,7 @@ class JarMetaIndex {
         JarMetaIndex(String fileName) throws IOException {
             jar = new JarFile(fileName);
             knownPrefixMap.put("sun", new HashSet());
    +        knownPrefixMap.put("jdk", new HashSet());
             knownPrefixMap.put("java", new HashSet());
             knownPrefixMap.put("javax", new HashSet());
         }
    @@ -336,12 +343,12 @@ class JarMetaIndex {
                 return false;
             }
     
    -        String secondPkgElement = name.substring(firstSlashIndex + 1,
    -                                                 name.indexOf("/",
    -                                                              firstSlashIndex + 1));
    -
             /* Add the second level package name to the corresponding hashset. */
    -        if (secondPkgElement != null) {
    +        int secondSlashIndex = name.indexOf("/", firstSlashIndex+1);
    +        if (secondSlashIndex == -1) {
    +            pkgSet.add(TOP_LEVEL);
    +        } else {
    +            String secondPkgElement = name.substring(firstSlashIndex+1, secondSlashIndex);
                 pkgSet.add(secondPkgElement);
             }
     
    @@ -368,8 +375,9 @@ class JarMetaIndex {
                 if (setSize == 0) {
                     continue;
                 }
    -            else if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX) {
    -                indexSet.add(key + "/");
    +            if (setSize > JarMetaIndex.MAX_PKGS_WITH_KNOWN_PREFIX ||
    +                pkgSetStartsWithKey.contains(TOP_LEVEL)) {
    +                 indexSet.add(key + "/");
                 } else {
                     /* If the set contains less than MAX_PKGS_WITH_KNOWN_PREFIX, add
                      * them to the indexSet of the MetaIndex object.
    diff --git a/jdk/makefiles/CompileJavaClasses.gmk b/jdk/makefiles/CompileJavaClasses.gmk
    index e032f472331..bc830d5c711 100644
    --- a/jdk/makefiles/CompileJavaClasses.gmk
    +++ b/jdk/makefiles/CompileJavaClasses.gmk
    @@ -269,7 +269,10 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
           $(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \
           $(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java \
           $(JDK_TOPDIR)/src/solaris/classes/sun/util/locale/provider/HostLocaleProviderAdapterImpl.java \
    -      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpChannelImpl.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java \
    +      $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
     
       # JObjC.jar contains 1.5 byte-code...so skip it here :-(
       # MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/jobjc/src
    diff --git a/jdk/makefiles/CompileLaunchers.gmk b/jdk/makefiles/CompileLaunchers.gmk
    index b3cc4e2dbc2..af5b3583758 100644
    --- a/jdk/makefiles/CompileLaunchers.gmk
    +++ b/jdk/makefiles/CompileLaunchers.gmk
    @@ -52,8 +52,7 @@ endif
     ifeq ($(OPENJDK_TARGET_OS), macosx)
       ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN)
     else
    -  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) \
    -      $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
    +  ORIGIN_ARG := $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
     endif
     
     #
    @@ -62,8 +61,7 @@ endif
     # devloper documentation of JAWT and what worked with OpenJDK6.
     #
     ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris), )
    -  ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \
    -      $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR))
    +  ORIGIN_ARG += $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR))
     endif
     
     define SetupLauncher
    @@ -576,9 +574,7 @@ ifeq ($(OPENJDK_TARGET_OS), linux)
       BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
     endif
     ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -    BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
    -  endif
    +  BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
     endif
     
     # TODO:
    diff --git a/jdk/makefiles/CompileNativeLibraries.gmk b/jdk/makefiles/CompileNativeLibraries.gmk
    index 294f73b1b21..57ef12e32cb 100644
    --- a/jdk/makefiles/CompileNativeLibraries.gmk
    +++ b/jdk/makefiles/CompileNativeLibraries.gmk
    @@ -56,9 +56,7 @@ BUILD_LIBRARIES =
     
     # Absolute paths to lib files on windows for use in LDFLAGS. Should figure out a more
     # elegant solution to this.
    -WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib
     WIN_JAVA_LIB := $(JDK_OUTPUTDIR)/objs/libjava/java.lib
    -WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
     
     # Use this variable to set DEBUG_SYMBOLS true on windows for all libraries, but
     # not on other platforms.
    @@ -71,3386 +69,23 @@ ifdef OPENJDK
       DEBUG_ALL_BINARIES := true
     endif
     
    -#
    -# TODO replace with X_FLAGS / X_LIBS
    -# and add them to configure
    -#
    -OPENWIN_LIB := $(OPENWIN_HOME)/lib
    -
     ##########################################################################################
     
    -BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
    +include lib/CoreLibraries.gmk
     
    -ifneq ($(OPENJDK_TARGET_OS), solaris)
    -  BUILD_LIBFDLIBM_OPTIMIZATION := NONE
    -endif
    +include lib/PlatformLibraries.gmk
     
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
    -      STATIC_LIBRARY := fdlibm, \
    -      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
    -      SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
    -      LANG := C, \
    -      OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
    -      CFLAGS_windows_debug := -DLOGGING, \
    -      ARFLAGS := $(ARFLAGS), \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +include lib/NetworkingLibraries.gmk
     
    -else
    +include lib/NioLibraries.gmk
     
    -# On macosx the old build does partial (incremental) linking of fdlibm instead of
    -# a plain static library.
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
    -      LIBRARY := fdlibm, \
    -      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
    -      SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
    -      LANG := C, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
    -      LDFLAGS := -nostdlib -r -arch x86_64, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +include lib/SecurityLibraries.gmk
     
    -  BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
    -  $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
    -	$(call install-file)
    +include lib/ServiceabilityLibraries.gmk
     
    -endif
    -BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
    -
    -##########################################################################################
    -
    -BUILD_LIBVERIFY_SRC := check_code.c check_format.c
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -    BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
    -  endif
    -endif
    -
    -LIBVERIFY_OPTIMIZATION := HIGH
    -ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
    -  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    -    LIBVERIFY_OPTIMIZATION := LOW
    -  endif
    -endif
    -
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
    -    LIBRARY := verify, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/common, \
    -    INCLUDE_FILES := $(BUILD_LIBVERIFY_SRC), \
    -    LANG := C, \
    -    OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
    -    CFLAGS := $(CFLAGS_JDKLIB), \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_posix := -ljvm -lc, \
    -    LDFLAGS_SUFFIX_windows := jvm.lib, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=verify.dll" \
    -        -D "JDK_INTERNAL_NAME=verify" \
    -        -D "JDK_FTYPE=0x2L", \
    -    REORDER := $(BUILD_LIBVERIFY_REORDER), \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libverify, \
    -    DEBUG_SYMBOLS := true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
    -
    -##########################################################################################
    -
    -LIBJAVA_SRC_DIRS := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \
    -  $(JDK_TOPDIR)/src/share/native/java/lang \
    -  $(JDK_TOPDIR)/src/share/native/java/lang/ref \
    -  $(JDK_TOPDIR)/src/share/native/java/lang/reflect \
    -  $(JDK_TOPDIR)/src/share/native/java/io \
    -  $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
    -  $(JDK_TOPDIR)/src/share/native/java/nio \
    -  $(JDK_TOPDIR)/src/share/native/java/security \
    -  $(JDK_TOPDIR)/src/share/native/common \
    -  $(JDK_TOPDIR)/src/share/native/sun/misc \
    -  $(JDK_TOPDIR)/src/share/native/sun/reflect \
    -  $(JDK_TOPDIR)/src/share/native/java/util \
    -  $(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \
    -  $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
    -  $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util
    -
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider
    -else
    -  LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \
    -      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io
    -endif
    -
    -LIBJAVA_CFLAGS := $(foreach dir, $(LIBJAVA_SRC_DIRS), -I$(dir)) \
    -    -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
    -    -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
    -
    -LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
    -    -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
    -    -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
    -     -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
    -
    -ifneq (, $(JDK_UPDATE_VERSION))
    -  LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
    -endif
    -
    -LIBJAVA_EXCLUDE_FILES := check_code.c check_format.c jspawnhelper.c
    -
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
    -else
    -  BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
    -  BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBJAVA_EXCLUDE_FILES += \
    -      UNIXProcess_md.c \
    -      UnixFileSystem_md.c \
    -      FileSystemPreferences.c
    -else
    -  LIBJAVA_EXCLUDE_FILES += \
    -      ProcessImpl_md.c \
    -      WinNTFileSystem_md.c \
    -      dirent_md.c \
    -      WindowsPreferences.c \
    -      sun/security/provider/WinCAPISeedGenerator.c \
    -      sun/io/Win32ErrorMode.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -    LIBJAVA_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
    -  endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
    -    LIBRARY := java, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(LIBJAVA_SRC_DIRS), \
    -    EXCLUDES := fdlibm/src zip, \
    -    EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
    -    LANG := C, \
    -    OPTIMIZATION := HIGH, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(LIBJAVA_CFLAGS), \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_posix := -ljvm -lverify, \
    -    LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
    -    LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
    -    LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \
    -        -framework CoreFoundation \
    -        -framework Foundation \
    -        -framework Security -framework SystemConfiguration, \
    -    LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
    -        jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
    -        shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
    -        advapi32.lib, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=java.dll" \
    -        -D "JDK_INTERNAL_NAME=java" \
    -        -D "JDK_FTYPE=0x2L", \
    -    REORDER := $(LIBJAVA_REORDER), \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAVA)
    -
    -$(BUILD_LIBJAVA): $(LIBJLI_BINARY)
    -
    -$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
    -
    -$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
    -
    -##########################################################################################
    -
    -BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib
    -BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
    -    -I$(BUILD_LIBMLIB_SRC) \
    -    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib
    -
    -BUILD_LIBMLIB_LDLIBS :=
    -BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers
    -
    -BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
    -
    -ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    -  BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -  BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
    -    LIBRARY := mlib_image, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(BUILD_LIBMLIB_SRC), \
    -    EXCLUDE_FILES := awt_ImagingLib.c mlib_c_ImageBlendTable.c, \
    -    LANG := C, \
    -    OPTIMIZATION := HIGHEST, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(BUILD_LIBMLIB_CFLAGS), \
    -    MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX := $(BUILD_LIBMLIB_LDLIBS) \
    -        $(LDFLAGS_JDKLIB_SUFFIX), \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=mlib_image.dll" \
    -        -D "JDK_INTERNAL_NAME=mlib_image" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
    -
    -  BUILD_LIBMLIB_IMAGE_V_FILES := \
    -      mlib_v_ImageLookUp.c \
    -      mlib_ImageCreate.c \
    -      mlib_ImageAffine.c \
    -      mlib_ImageConvMxN.c \
    -      mlib_ImageConvKernelConvert.c \
    -      mlib_sys.c \
    -      mlib_ImageLookUp_64.c \
    -      mlib_ImageLookUp_Bit.c \
    -      mlib_ImageColorTrue2Index.c \
    -      mlib_c_ImageThresh1_U8.c \
    -      mlib_v_ImageLookUpS16S16Func.c \
    -      mlib_v_ImageLookUpS16S32Func.c \
    -      mlib_v_ImageLookUpS16U16Func.c \
    -      mlib_v_ImageLookUpS16U8Func.c \
    -      mlib_v_ImageLookUpS32S16Func.c \
    -      mlib_v_ImageLookUpS32S32Func.c \
    -      mlib_v_ImageLookUpS32U16Func.c \
    -      mlib_v_ImageLookUpS32U8Func.c \
    -      mlib_v_ImageLookUpSIS16S16Func.c \
    -      mlib_v_ImageLookUpSIS16S32Func.c \
    -      mlib_v_ImageLookUpSIS16U16Func.c \
    -      mlib_v_ImageLookUpSIS16U8Func.c \
    -      mlib_v_ImageLookUpSIS32S16Func.c \
    -      mlib_v_ImageLookUpSIS32S32Func.c \
    -      mlib_v_ImageLookUpSIS32U16Func.c \
    -      mlib_v_ImageLookUpSIS32U8Func.c \
    -      mlib_v_ImageLookUpSIU16S16Func.c \
    -      mlib_v_ImageLookUpSIU16S32Func.c \
    -      mlib_v_ImageLookUpSIU16U16Func.c \
    -      mlib_v_ImageLookUpSIU16U8Func.c \
    -      mlib_v_ImageLookUpSIU8S16Func.c \
    -      mlib_v_ImageLookUpSIU8S32Func.c \
    -      mlib_v_ImageLookUpSIU8U16Func.c \
    -      mlib_v_ImageLookUpSIU8U8Func.c \
    -      mlib_v_ImageLookUpU16S16Func.c \
    -      mlib_v_ImageLookUpU16S32Func.c \
    -      mlib_v_ImageLookUpU16U16Func.c \
    -      mlib_v_ImageLookUpU16U8Func.c \
    -      mlib_v_ImageLookUpU8S16Func.c \
    -      mlib_v_ImageLookUpU8S32Func.c \
    -      mlib_v_ImageLookUpU8U16Func.c \
    -      mlib_v_ImageLookUpU8U8Func.c \
    -      mlib_v_ImageAffineIndex_BC.c \
    -      mlib_v_ImageAffine_BC.c \
    -      mlib_v_ImageAffine_BC_S16.c \
    -      mlib_v_ImageAffine_BC_U16.c \
    -      mlib_v_ImageAffine_BL.c \
    -      mlib_v_ImageAffine_BL_S16.c \
    -      mlib_v_ImageAffine_BL_U16.c \
    -      mlib_v_ImageAffine_NN.c \
    -      mlib_v_ImageFilters.c \
    -      mlib_ImageAffineEdge.c \
    -      mlib_ImageAffine_BC_D64.c \
    -      mlib_ImageAffine_BC_F32.c \
    -      mlib_ImageAffine_BC_S32.c \
    -      mlib_ImageAffine_BL_D64.c \
    -      mlib_ImageAffine_BL_F32.c \
    -      mlib_ImageAffine_BL_S32.c \
    -      mlib_ImageAffine_NN.c \
    -      mlib_ImageAffine_NN_Bit.c \
    -      mlib_ImageFilters.c \
    -      mlib_ImageScanPoly.c \
    -      mlib_ImageConv_8nw.c \
    -      mlib_ImageConv_8ext.c \
    -      mlib_ImageConv_16nw.c \
    -      mlib_ImageConv_16ext.c \
    -      mlib_ImageConv_u16nw.c \
    -      mlib_ImageConv_u16ext.c \
    -      mlib_ImageConv_32nw.c \
    -      mlib_ImageConv_F32nw.c \
    -      mlib_ImageConvMxN_Fp.c \
    -      mlib_ImageConvMxN_ext.c \
    -      mlib_ImageConv_D64nw.c \
    -      mlib_ImageClipping.c \
    -      mlib_ImageConvCopyEdge_Bit.c \
    -      mlib_ImageConvClearEdge_Bit.c \
    -      mlib_ImageConv2x2_f.c \
    -      mlib_ImageConvClearEdge_Fp.c \
    -      mlib_v_ImageConvMxN_8.c \
    -      mlib_v_ImageConvClearEdge.c \
    -      mlib_v_ImageConvCopyEdge.c \
    -      mlib_v_ImageConvMxN_8ext.c \
    -      mlib_v_ImageConvVersion.c \
    -      mlib_v_ImageConv_8nw.c \
    -      mlib_ImageConvCopyEdge_Fp.c \
    -      mlib_v_ImageChannelInsert_1.c \
    -      mlib_v_ImageChannelExtract_43.c \
    -      mlib_v_ImageChannelExtract_1.c \
    -      mlib_ImageCopy_Bit.c \
    -      mlib_v_ImageCopy_f.c \
    -      mlib_ImageUtils.c \
    -      mlib_ImageDivTables.c
    -
    -  BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
    -      LIBRARY := mlib_image_v, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    -          $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib, \
    -      LANG := C, \
    -      INCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_FILES), \
    -      OPTIMIZATION := HIGHEST, \
    -      CFLAGS := -xarch=sparcvis \
    -          $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il \
    -          $(BUILD_LIBMLIB_V_CFLAGS) \
    -          $(CFLAGS_JDKLIB), \
    -      MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX_solaris := -lc, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
    -
    -endif
    -
    -##########################################################################################
    -
    -LIBAWT_DIRS := \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    -    $(JDK_TOPDIR)/src/share/native/sun/java2d \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -    $(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -    $(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -    $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    -    $(JDK_TOPDIR)/src/share/native/sun/font
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBAWT_DIRS += \
    -      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    -      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
    -      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
    -else
    -  LIBAWT_DIRS += \
    -      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
    -endif
    -
    -LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
    -    $(X_CFLAGS) \
    -    $(foreach dir, $(LIBAWT_DIRS), -I$(dir))
    -
    -LIBAWT_FILES := \
    -    gifdecoder.c \
    -    imageInitIDs.c \
    -    img_globals.c \
    -    SurfaceData.c \
    -    Region.c \
    -    BufImgSurfaceData.c \
    -    Disposer.c \
    -    Trace.c \
    -    GraphicsPrimitiveMgr.c \
    -    Blit.c \
    -    BlitBg.c \
    -    ScaledBlit.c \
    -    FillRect.c \
    -    FillSpans.c \
    -    FillParallelogram.c \
    -    DrawParallelogram.c \
    -    DrawLine.c \
    -    DrawRect.c \
    -    DrawPolygons.c \
    -    DrawPath.c \
    -    FillPath.c \
    -    ProcessPath.c \
    -    MaskBlit.c \
    -    MaskFill.c \
    -    TransformHelper.c \
    -    AlphaMath.c \
    -    AlphaMacros.c \
    -    AnyByte.c \
    -    ByteBinary1Bit.c \
    -    ByteBinary2Bit.c \
    -    ByteBinary4Bit.c \
    -    ByteIndexed.c \
    -    ByteGray.c \
    -    Index8Gray.c \
    -    Index12Gray.c \
    -    AnyShort.c \
    -    Ushort555Rgb.c \
    -    Ushort565Rgb.c \
    -    Ushort4444Argb.c \
    -    Ushort555Rgbx.c \
    -    UshortGray.c \
    -    UshortIndexed.c \
    -    Any3Byte.c \
    -    ThreeByteBgr.c \
    -    AnyInt.c \
    -    IntArgb.c \
    -    IntArgbPre.c \
    -    IntArgbBm.c \
    -    IntRgb.c \
    -    IntBgr.c \
    -    IntRgbx.c \
    -    Any4Byte.c \
    -    FourByteAbgr.c \
    -    FourByteAbgrPre.c \
    -    BufferedMaskBlit.c \
    -    BufferedRenderPipe.c \
    -    ShapeSpanIterator.c \
    -    SpanClipRenderer.c \
    -    awt_ImageRep.c \
    -    awt_ImagingLib.c \
    -    awt_Mlib.c \
    -    awt_parseImage.c \
    -    DataBufferNative.c \
    -    dither.c \
    -    debug_assert.c \
    -    debug_mem.c \
    -    debug_trace.c \
    -    debug_util.c
    -
    -ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux))
    -  LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBAWT_FILES += awt_LoadLibrary.c img_colors.c
    -  LIBAWT_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/apple/resources
    -  LIBAWT_FILES += awt_LoadLibrary.c MacOSXResourceBundle.m
    -  LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
    -
    -  LIBAWT_MacOSXResourceBundle.m_CFLAGS := -O0
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
    -  LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
    -  LIBAWT_CFLAGS += -xarch=sparcvis
    -  LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il
    -  LIBAWT_CFLAGS += \
    -      -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
    -      -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
    -      -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
    -
    -  LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
    -      $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
    -
    -  LIBAWT_FILES += \
    -      vis_FuncArray.c \
    -      java2d_Mlib.c \
    -      mlib_ImageCreate.c \
    -      mlib_ImageZoom_NN.c \
    -      mlib_ImageCopy_Bit.c \
    -      mlib_sys.c \
    -      mlib_v_ImageClear.c \
    -      mlib_v_ImageClear_f.c \
    -      mlib_v_ImageConstXor.c \
    -      mlib_v_ImageCopy.c \
    -      mlib_v_ImageCopy_f.c \
    -      mlib_v_ImageXor.c \
    -      mlib_v_ImageZoom_NN_f.c \
    -      vis_Interp.c \
    -      vis_AlphaMacros.c \
    -      vis_AlphaMaskBlit.c \
    -      vis_AlphaMaskFill.c \
    -      vis_ByteGray.c \
    -      vis_ByteGray_FromRgb.c \
    -      vis_ByteGray_Mask.c \
    -      vis_ByteIndexed.c \
    -      vis_DrawLine.c \
    -      vis_FourByteAbgr.c \
    -      vis_IntArgb.c \
    -      vis_IntArgbPre.c \
    -      vis_IntArgbPre_Mask.c \
    -      vis_IntBgr.c \
    -      vis_IntRgb.c \
    -      vis_IntRgbx.c \
    -      vis_SrcMaskFill.c \
    -      vis_SrcOverMaskBlit.c \
    -      vis_SrcOverMaskFill.c \
    -      vis_FourByteAbgrPre.c \
    -      vis_GlyphList.c \
    -      vis_GlyphListXor.c \
    -      vis_IntArgbBm.c \
    -      vis_ThreeByteBgr.c \
    -      vis_UshortGray.c \
    -      vis_UshortGray_FromRgb.c \
    -      vis_XorBlit.c \
    -      mlib_v_ImageCopy_blk.s
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    -    LIBAWT_ASFLAGS = -P -xarch=v9a
    -  else
    -    LIBAWT_ASFLAGS = -P -xarch=v8plusa
    -  endif
    -else
    -  LIBAWT_FILES += MapAccelFunc.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), solaris)
    -  LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
    -endif
    -
    -LIBAWT_LANG := C
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBAWT_FILES += AccelGlyphCache.c \
    -      ShaderList.c \
    -      CmdIDList.cpp \
    -      Hashtable.cpp \
    -      GDIHashtable.cpp \
    -      Devices.cpp \
    -      ObjectList.cpp \
    -      GDIBlitLoops.cpp \
    -      GDIRenderer.cpp \
    -      GDIWindowSurfaceData.cpp \
    -      WindowsFlags.cpp \
    -      WPrinterJob.cpp \
    -      awt_%.cpp \
    -      D3DBlitLoops.cpp \
    -      D3DBufImgOps.cpp \
    -      D3DContext.cpp \
    -      D3DGlyphCache.cpp \
    -      D3DGraphicsDevice.cpp \
    -      D3DMaskBlit.cpp \
    -      D3DMaskCache.cpp \
    -      D3DMaskFill.cpp \
    -      D3DPipelineManager.cpp \
    -      D3DPaints.cpp \
    -      D3DRenderer.cpp \
    -      D3DRenderQueue.cpp \
    -      D3DResourceManager.cpp \
    -      D3DSurfaceData.cpp \
    -      D3DTextRenderer.cpp \
    -      D3DVertexCacher.cpp \
    -      ShellFolder2.cpp \
    -      ThemeReader.cpp \
    -      ComCtl32Util.cpp \
    -      DllUtil.cpp \
    -      initIDs.cpp \
    -      MouseInfo.cpp \
    -      rect.c \
    -      OGLBlitLoops.c \
    -      OGLBufImgOps.c \
    -      OGLContext.c \
    -      OGLFuncs.c \
    -      OGLMaskBlit.c \
    -      OGLMaskFill.c \
    -      OGLPaints.c \
    -      OGLRenderQueue.c \
    -      OGLRenderer.c \
    -      OGLSurfaceData.c \
    -      OGLTextRenderer.c \
    -      OGLVertexCache.c \
    -      WGLGraphicsConfig.c \
    -      WGLSurfaceData.c
    -
    -  LIBAWT_LANG := C++
    -  LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
    -  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    -    LIBAWT_CFLAGS += -DMLIB_OS64BIT
    -  endif
    -
    -  ifdef OPENJDK
    -    LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/windows/resource/icons"
    -  else
    -    LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
    -  endif
    -  LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
    -endif
    -
    -ifeq ($(MILESTONE), internal)
    -  LIBAWT_CFLAGS += -DINTERNAL_BUILD
    -endif
    -
    -LIBAWT_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -  LIBAWT_MAPFILE :=
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
    -    LIBRARY := awt, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(LIBAWT_DIRS), \
    -    INCLUDE_FILES := $(LIBAWT_FILES), \
    -    LANG := $(LIBAWT_LANG), \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
    -    ASFLAGS := $(LIBAWT_ASFLAGS), \
    -    MAPFILE := $(LIBAWT_MAPFILE), \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_solaris := -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    -    LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \
    -    LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \
    -    LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
    -        -framework Cocoa \
    -        -framework OpenGL \
    -        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -        -framework JavaNativeFoundation \
    -        -framework JavaRuntimeSupport \
    -        -framework ApplicationServices \
    -        -framework AudioToolbox \
    -        -ljava, \
    -    LDFLAGS_SUFFIX_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
    -        imm32.lib ole32.lib uuid.lib shell32.lib \
    -        comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
    -        delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
    -        -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
    -        -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
    -        -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
    -        -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
    -        -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll, \
    -    VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
    -    RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
    -        -D "JDK_FNAME=awt.dll" \
    -        -D "JDK_INTERNAL_NAME=awt" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBAWT): $(BUILD_LIBJAVA)
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
    -endif
    -
    -BUILD_LIBRARIES += $(BUILD_LIBAWT)
    -
    -##########################################################################################
    -
    -# TODO!!
    -# Even though this variable as a general name, it is
    -# only used on macos, in fontpath.c, as prefix for where to find fonts.
    -#
    -# It's used for libawt_headless _and_ libawt_xawt
    -#
    -X11_PATH := /usr/X11R6
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -  ifndef BUILD_HEADLESS_ONLY
    -
    -    LIBAWT_XAWT_DIRS := \
    -        $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -        $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    -        $(JDK_TOPDIR)/src/share/native/sun/font \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
    -        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \
    -
    -    LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \
    -        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
    -        $(CUPS_CFLAGS) \
    -        $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga
    -
    -    ifeq ($(OPENJDK_TARGET_OS), solaris)
    -      LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
    -    endif
    -
    -    ifeq ($(OPENJDK_TARGET_OS), linux)
    -      ifndef OPENJDK
    -        include $(JDK_TOPDIR)/make/closed/xawt.gmk
    -      endif
    -
    -      ifeq ($(DISABLE_XRENDER), true)
    -        LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
    -      endif
    -    endif
    -
    -    ifeq ($(MILESTONE), internal)
    -      LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
    -    endif
    -
    -    LIBAWT_XAWT_FILES := \
    -        XlibWrapper.c \
    -        XWindow.c \
    -        XToolkit.c \
    -        X11Color.c \
    -        X11SurfaceData.c \
    -        awt_GraphicsEnv.c \
    -        awt_InputMethod.c \
    -        robot_common.c \
    -        awt_Robot.c \
    -        list.c \
    -        multiVis.c \
    -        initIDs.c \
    -        awt_util.c \
    -        awt_Desktop.c \
    -        awt_UNIXToolkit.c \
    -        X11FontScaler_md.c \
    -        X11TextRenderer_md.c \
    -        fontpath.c \
    -        awt_Insets.c \
    -        awt_Event.c \
    -        X11Renderer.c \
    -        X11PMBlitLoops.c \
    -        OGLBlitLoops.c \
    -        OGLBufImgOps.c \
    -        OGLContext.c \
    -        OGLFuncs.c \
    -        OGLMaskBlit.c \
    -        OGLMaskFill.c \
    -        OGLPaints.c \
    -        OGLRenderQueue.c \
    -        OGLRenderer.c \
    -        OGLSurfaceData.c \
    -        OGLTextRenderer.c \
    -        OGLVertexCache.c \
    -        GLXGraphicsConfig.c \
    -        GLXSurfaceData.c \
    -        AccelGlyphCache.c \
    -        awt_Font.c \
    -        multi_font.c \
    -        awt_AWTEvent.c \
    -        awt_DrawingSurface.c \
    -        jawt.c \
    -        CUPSfuncs.c \
    -        debug_assert.c \
    -        debug_mem.c \
    -        debug_trace.c \
    -        debug_util.c \
    -        awt_Plugin.c \
    -        gnome_interface.c \
    -        gtk2_interface.c \
    -        swing_GTKEngine.c \
    -        swing_GTKStyle.c \
    -        rect.c \
    -        sun_awt_X11_GtkFileDialogPeer.c \
    -        XRSurfaceData.c \
    -        XRBackendNative.c
    -
    -    LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
    -
    -    ifeq ($(OPENJDK_TARGET_OS), linux)
    -      # To match old build, add this to LDFLAGS instead of suffix.
    -      LIBAWT_XAWT_LDFLAGS += -lpthread
    -    endif
    -
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -      LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
    -    endif
    -
    -    # On macosx, the shared library origin is set twice for this lib.
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
    -        LIBRARY := awt_xawt, \
    -        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -        SRC := $(LIBAWT_XAWT_DIRS), \
    -        INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \
    -        LANG := C, \
    -        OPTIMIZATION := LOW, \
    -        CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
    -            $(X_CFLAGS), \
    -        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \
    -        LDFLAGS := $(LDFLAGS_JDKLIB) \
    -            $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS), \
    -        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    -        LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -            -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
    -            -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -            -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
    -            -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    -        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN). \
    -            $(call SET_SHARED_LIBRARY_ORIGIN) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN)., \
    -        LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
    -        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -        RC_FLAGS := $(RC_FLAGS) \
    -            -D "JDK_FNAME=xawt.dll" \
    -            -D "JDK_INTERNAL_NAME=xawt" \
    -            -D "JDK_FTYPE=0x2L", \
    -        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
    -        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)
    -
    -    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
    -
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -BUILD_LIBZIP_EXCLUDES :=
    -ifeq ($(USE_EXTERNAL_LIBZ), true)
    -  LIBZ := -lz
    -  LIBZIP_EXCLUDES += zlib-1.2.5
    -else
    -  ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -endif
    -
    -BUILD_LIBZIP_REORDER :=
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -    BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
    -  endif
    -endif
    -
    -ifeq ($(LIBZIP_CAN_USE_MMAP), true)
    -  BUILD_LIBZIP_MMAP := -DUSE_MMAP
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
    -    LIBRARY := zip, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \
    -    EXCLUDES := $(LIBZIP_EXCLUDES), \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(ZLIB_CPPFLAGS) \
    -        -I$(JDK_TOPDIR)/src/share/native/java/io \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \
    -    CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
    -    REORDER := $(BUILD_LIBZIP_REORDER), \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN) \
    -        $(EXPORT_ZIP_FUNCS), \
    -    LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
    -        -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
    -        $(WIN_JAVA_LIB), \
    -    LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
    -    LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
    -    LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=zip.dll" \
    -        -D "JDK_INTERNAL_NAME=zip" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -
    -$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBZIP)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
    -    LIBRARY := unpack, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \
    -    EXCLUDE_FILES := main.cpp, \
    -    LANG := C++, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CXXFLAGS_JDKLIB) \
    -        -DNO_ZLIB -DUNPACK_JNI -DFULL, \
    -    CFLAGS_release := -DPRODUCT, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
    -        jvm.lib $(WIN_JAVA_LIB), \
    -    LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=unpack.dll" \
    -        -D "JDK_INTERNAL_NAME=unpack" \
    -        -D "JDK_FTYPE=0x2L", \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBUNPACK): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
    -	$(ECHO) Copying $(@F)
    -	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.map, $<) $@
    -
    -  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
    -	$(ECHO) Copying $(@F)
    -	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.pdb, $<) $@
    -endif
    -
    -##########################################################################################
    -
    -LIBATTACH_EXCLUDE_FILES :=
    -ifneq ($(OPENJDK_TARGET_OS), solaris)
    -  LIBATTACH_EXCLUDE_FILES += SolarisVirtualMachine.c
    -endif
    -ifneq ($(OPENJDK_TARGET_OS), linux)
    -  LIBATTACH_EXCLUDE_FILES += LinuxVirtualMachine.c
    -endif
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBATTACH_EXCLUDE_FILES += BsdVirtualMachine.c
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \
    -    LIBRARY := attach, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach, \
    -    EXCLUDE_FILES := $(LIBATTACH_EXCLUDE_FILES), \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB), \
    -    CFLAGS_windows := /Gy, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=attach.dll" \
    -        -D "JDK_INTERNAL_NAME=attach" \
    -        -D "JDK_FTYPE=0x2L", \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_solaris := -ldoor, \
    -    LDFLAGS_windows := /ORDER:@$(JDK_TOPDIR)/makefiles/mapfiles/libattach/reorder-windows-$(OPENJDK_TARGET_CPU), \
    -    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    -    LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libattach, \
    -    DEBUG_SYMBOLS := true))
    -
    -$(BUILD_LIBATTACH): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBATTACH)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \
    -    LIBRARY := dt_socket, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/transport/socket \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
    -        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
    -        -I$(JDK_TOPDIR)/src/share/transport/socket \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket \
    -        -I$(JDK_TOPDIR)/src/share/back/export \
    -        -I$(JDK_TOPDIR)/src/share/back, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_linux := -lpthread, \
    -    LDFLAGS_SUFFIX_solaris := -lnsl -lsocket -lc, \
    -    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=dt_socket.dll" \
    -        -D "JDK_INTERNAL_NAME=dt_socket" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdt_socket, \
    -    DEBUG_SYMBOLS := true))
    -
    -$(BUILD_LIBDT_SOCKET): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBDT_SOCKET)
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM, \
    -      LIBRARY := dt_shmem, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \
    -          $(JDK_TOPDIR)/src/share/transport/shmem \
    -          $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
    -          -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
    -          -I$(JDK_TOPDIR)/src/share/transport/shmem \
    -          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem \
    -          -I$(JDK_TOPDIR)/src/share/back/export, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB), \
    -      LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
    -      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=dt_shmem.dll" \
    -          -D "JDK_INTERNAL_NAME=dt_shmem" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdt_shmem, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBDT_SHMEM)
    -
    -endif # OPENJDK_TARGET_OS
    -
    -##########################################################################################
    -# JDWP_LOGGING causes log messages to be compiled into the library.
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \
    -    LIBRARY := jdwp, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \
    -        -I$(JDK_TOPDIR)/src/share/transport/export \
    -        -I$(JDK_TOPDIR)/src/share/back/export \
    -        -I$(JDK_TOPDIR)/src/share/npt \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
    -        -I$(JDK_TOPDIR)/src/share/back \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back \
    -        -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_linux := $(LIBDL), \
    -    LDFLAGS_SUFFIX_solaris := $(LIBDL) -lc, \
    -    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=jdwp.dll" \
    -        -D "JDK_INTERNAL_NAME=jdwp" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjdwp, \
    -    DEBUG_SYMBOLS := true))
    -
    -$(BUILD_LIBJDWP): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJDWP)
    -
    -##########################################################################################
    -
    -LIBJAAS_MAPFILE :=
    -ifneq ($(OPENJDK_TARGET_OS), solaris)
    -  LIBJAAS_EXCLUDE_FILES := Solaris.c
    -else
    -  # only on solaris...wonder why
    -  LIBJAAS_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
    -endif
    -
    -LIBJAAS_NAME := jaas_unix
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBJAAS_NAME := jaas_nt
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \
    -    LIBRARY := $(LIBJAAS_NAME), \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/security/auth/module, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB), \
    -    MAPFILE := $(LIBJAAS_MAPFILE), \
    -    LDFLAGS := $(filter-out -ljava, $(LDFLAGS_JDKLIB)) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib, \
    -    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    EXCLUDE_FILES := $(LIBJAAS_EXCLUDE_FILES), \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=$(LIBJAAS_NAME).dll" \
    -        -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjaas, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJAAS): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAAS)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \
    -    LIBRARY := jsdt, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tracing/dtrace, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_linux := $(LIBDL), \
    -    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL), \
    -    LDFLAGS_SUFFIX_macosx := $(LIBDL), \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=jsdt.dll" \
    -        -D "JDK_INTERNAL_NAME=jsdt" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsdt, \
    -    DEBUG_SYMBOLS := true))
    -
    -$(BUILD_LIBJSDT): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJSDT)
    -
    -##########################################################################################
    -
    -# TODO: Update awt lib path when awt is converted
    -$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
    -    LIBRARY := lcms, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
    -    LANG := C, \
    -    OPTIMIZATION := HIGHEST, \
    -    CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
    -        $(SHARED_LIBRARY_FLAGS) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
    -    CFLAGS_solaris := -xc99=no_lib, \
    -    CFLAGS_windows := -DCMS_IS_WINDOWS_, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
    -    LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
    -    LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
    -    LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
    -    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=lcms.dll" \
    -        -D "JDK_INTERNAL_NAME=lcms" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBLCMS)
    -
    -$(BUILD_LIBLCMS): $(BUILD_LIBAWT)
    -
    -##########################################################################################
    -
    -ifdef OPENJDK
    -  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
    -else
    -  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers-closed
    -  BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
    -  BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
    -endif
    -
    -BUILD_LIBJPEG_REORDER :=
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -    BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
    -  endif
    -endif
    -
    -# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
    -# or 'vfork'": this warning indicates that some variable is placed to
    -# a register by optimized compiler and it's value might be lost on longjmp().
    -# Recommended way to avoid such warning is to declare the variable as
    -# volatile to prevent the optimization. However, this approach does not
    -# work because we have to declare all variables as volatile in result.
    -#ifndef CROSS_COMPILE_ARCH
    -#  CC_43_OR_NEWER := \
    -#      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
    -#          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
    -#  ifeq ($(CC_43_OR_NEWER), 1)
    -#    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
    -#  endif
    -#endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
    -    LIBRARY := jpeg, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
    -        $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
    -    LANG := C, \
    -    OPTIMIZATION := HIGHEST, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
    -    MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
    -    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=jpeg.dll" \
    -        -D "JDK_INTERNAL_NAME=jpeg" \
    -        -D "JDK_FTYPE=0x2L", \
    -    REORDER := $(BUILD_LIBJPEG_REORDER), \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJPEG)
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -  FONT_HEADERS := -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
    -  BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
    -  LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
    -else
    -  FONT_HEADERS := $(FREETYPE2_CFLAGS)
    -  BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
    -  BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE2_LIBS)
    -endif
    -
    -LIBFONTMANAGER_OPTIMIZATION := HIGH
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
    -      X11TextRenderer.c
    -  LIBFONTMANAGER_OPTIMIZATION := HIGHEST
    -else
    -  LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
    -      lcdglyph.c
    -endif
    -
    -BUILD_LIBFONTMANAGER_CFLAGS_COMMON := \
    -    $(X_CFLAGS) \
    -    -DLE_STANDALONE -DHEADLESS \
    -    $(FONT_HEADERS) \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/font \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/java2d
    -
    -# Turn off aliasing with GCC for ExtensionSubtables.cpp
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -  BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
    -    LIBRARY := fontmanager, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/sun/font \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font, \
    -    EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
    -        AccelGlyphCache.c, \
    -    LANG := C++, \
    -    CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
    -    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
    -    OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
    -    CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    -        -DCC_NOEX, \
    -    MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
    -    LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
    -    LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
    -    LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
    -    LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
    -        -ljava -ljvm, \
    -    LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
    -        $(WIN_AWT_LIB), \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=fontmanager.dll" \
    -        -D "JDK_INTERNAL_NAME=fontmanager" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
    -
    -ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris macosx))
    -  $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
    -endif
    -
    -BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -
    -  #ifeq ($(OPENJDK_TARGET_OS), linux)
    -  #  ifeq ("$(CC_VER_MAJOR)", "3")
    -  #    OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
    -  #  endif
    -  #endif
    -  #
    -  # The resulting size of the t2k lib file is (at least on linux) dependant on the order of
    -  # the input .o files. Because of this the new build will differ in size to the old build.
    -  BUILD_LIBT2K_CFLAGS_COMMON := -I$(JDK_TOPDIR)/src/share/native/sun/font \
    -      -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
    -      -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
    -      -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
    -      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
    -      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -      -I$(JDK_TOPDIR)/src/share/native/sun/java2d
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \
    -      LIBRARY := t2k, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/font \
    -          $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
    -          $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints, \
    -      EXCLUDE_FILES := orion.c, \
    -      LANG := C++, \
    -      OPTIMIZATION := HIGH, \
    -      CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
    -      CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
    -      CFLAGS_windows = -DCC_NOEX, \
    -      CXXFLAGS_windows = -DCC_NOEX, \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_windows := user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib, \
    -      LDFLAGS_SUFFIX_posix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
    -      LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=t2k.dll" \
    -          -D "JDK_INTERNAL_NAME=t2k" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libt2k, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  # t2k is linked against fontmanager
    -  $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBT2K)
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  ifeq ($(OPENJDK_TARGET_CPU), x86)
    -    KERNEL32_LIB := kernel32.lib
    -  endif
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
    -      LIBRARY := jawt, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows, \
    -      INCLUDE_FILES := jawt.cpp, \
    -      LANG := C++, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CXXFLAGS_JDKLIB) \
    -          -EHsc -DUNICODE -D_UNICODE \
    -          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
    -          advapi32.lib $(WIN_AWT_LIB), \
    -      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=jawt.dll" \
    -          -D "JDK_INTERNAL_NAME=jawt" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
    -
    -  $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
    -	$(ECHO) Copying $(@F)
    -	$(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
    -
    -  BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
    -
    -else # OPENJDK_TARGET_OS not windows
    -
    -  JAWT_LIBS :=
    -  ifneq ($(OPENJDK_TARGET_OS), solaris)
    -    JAWT_LIBS += -lawt
    -  endif
    -
    -  ifndef BUILD_HEADLESS_ONLY
    -    JAWT_LIBS += -lawt_xawt
    -  else
    -    JAWT_LIBS += -lawt_headless
    -    HEADLESS_CFLAG += -DHEADLESS
    -  endif
    -
    -  JAWT_FILES := jawt.c
    -  ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    JAWT_FILES := jawt.m
    -    JAWT_LIBS := -lawt_lwawt
    -  endif
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
    -      LIBRARY := jawt, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    -          $(JDK_TOPDIR)/src/macosx/native/sun/awt, \
    -      INCLUDE_FILES := $(JAWT_FILES), \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB), \
    -      CFLAGS_linux := $(HEADLESS_CFLAG), \
    -      CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjawt/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    -      LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
    -      LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
    -      LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
    -          -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  ifndef BUILD_HEADLESS_ONLY
    -    $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
    -  else
    -    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
    -  endif
    -
    -endif # OPENJDK_TARGET_OS
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAWT)
    -
    -##########################################################################################
    -
    -LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/share/instrument \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument
    -
    -LIBINSTRUMENT_FILES := \
    -    EncodingSupport.c \
    -    EncodingSupport_md.c \
    -    FileSystemSupport_md.c \
    -    InstrumentationImplNativeMethods.c \
    -    InvocationAdapter.c \
    -    JarFacade.c \
    -    JPLISAgent.c \
    -    JPLISAssert.c \
    -    JavaExceptions.c \
    -    PathCharsValidator.c \
    -    Reentrancy.c \
    -    Utilities.c \
    -    canonicalize_md.c
    -
    -LIBINSTRUMENT_DIR := $(JDK_OUTPUTDIR)/objs/libinstrument
    -LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
    -    -I$(JDK_TOPDIR)/src/share/instrument \
    -    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument \
    -    -I$(JDK_TOPDIR)/src/share/bin
    -
    -LIBINSTRUMENT_LDFLAGS :=
    -LIBINSTRUMENT_LDFLAGS_SUFFIX :=
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/jli_static.lib $(WIN_JAVA_LIB) \
    -      -export:Agent_OnAttach advapi32.lib
    -  # Statically link the C runtime so that there are not dependencies on modules
    -  # not on the search patch when invoked from the Windows system directory
    -  # (or elsewhere).
    -  LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS))
    -  # equivalent of strcasecmp is stricmp on Windows
    -  LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
    -    LIBRARY := instrument, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(LIBINSTRUMENT_SRC), \
    -    INCLUDE_FILES := $(LIBINSTRUMENT_FILES), \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(LIBINSTRUMENT_CFLAGS), \
    -    CFLAGS_debug := -DJPLIS_LOGGING, \
    -    CFLAGS_release := -DNO_JPLIS_LOGGING, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libinstrument/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN) \
    -        $(LIBINSTRUMENT_LDFLAGS), \
    -    LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
    -    LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
    -    LDFLAGS_macosx := -Xlinker -all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
    -        -framework Cocoa -framework Security -framework ApplicationServices, \
    -    LDFLAGS_SUFFIX := $(LIBINSTRUMENT_LDFLAGS_SUFFIX), \
    -    LDFLAGS_SUFFIX_macosx := -liconv $(LIBZ), \
    -    LDFLAGS_SUFFIX_solaris := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc, \
    -    LDFLAGS_SUFFIX_linux := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL), \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=instrument.dll" \
    -        -D "JDK_INTERNAL_NAME=instrument" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(LIBINSTRUMENT_DIR), \
    -    DEBUG_SYMBOLS := true))
    -
    -ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows))
    -  $(BUILD_LIBINSTRUMENT): $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
    -else
    -  $(BUILD_LIBINSTRUMENT): $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
    -endif
    -$(BUILD_LIBINSTRUMENT): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
    -
    -##########################################################################################
    -
    -BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/share/native/sun/management \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/management
    -
    -BUILD_LIBMANAGEMENT_EXCLUDES :=
    -
    -BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/management
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -  BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
    -else
    -  BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), solaris)
    -  BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), linux)
    -  BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -  BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
    -endif
    -
    -LIBMANAGEMENT_OPTIMIZATION := HIGH
    -ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
    -  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    -    LIBMANAGEMENT_OPTIMIZATION := LOW
    -  endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
    -    LIBRARY := management, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(BUILD_LIBMANAGEMENT_SRC), \
    -    EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \
    -    LANG := C, \
    -    OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
    -    CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS), \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_solaris := -lkstat, \
    -    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    -    LDFLAGS_SUFFIX_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=management.dll" \
    -        -D "JDK_INTERNAL_NAME=management" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmanagement, \
    -    DEBUG_SYMBOLS := true))
    -
    -$(BUILD_LIBMANAGEMENT): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBMANAGEMENT)
    -
    -##########################################################################################
    -
    -BUILD_LIBHPROF_SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/hprof
    -BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \
    -    -I$(JDK_TOPDIR)/src/share/npt \
    -    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
    -    -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
    -
    -BUILD_LIBHPROF_LDFLAGS :=
    -
    -LIBHPROF_OPTIMIZATION := HIGHEST
    -ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
    -  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    -    LIBHPROF_OPTIMIZATION := LOW
    -  endif
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \
    -    LIBRARY := hprof, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(BUILD_LIBHPROF_SRC), \
    -    LANG := C, \
    -    OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(BUILD_LIBHPROF_CFLAGS), \
    -    CFLAGS_debug := -DHPROF_LOGGING, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libhprof/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_windows := wsock32.lib winmm.lib advapi32.lib, \
    -    LDFLAGS_SUFFIX_linux := $(LIBDL), \
    -    LDFLAGS_SUFFIX_macosx := $(LIBDL), \
    -    LDFLAGS_SUFFIX_solaris := -lsocket -lnsl $(LIBDL) -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=hprof.dll" \
    -        -D "JDK_INTERNAL_NAME=hprof" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libhprof_jvmti, \
    -    DEBUG_SYMBOLS := true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBHPROF)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO, \
    -    LIBRARY := java_crw_demo, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=java_crw_demo.dll" \
    -        -D "JDK_INTERNAL_NAME=java_crw_demo" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava_crw_demo, \
    -    DEBUG_SYMBOLS := true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO)
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \
    -    LIBRARY := npt, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        -I$(JDK_TOPDIR)/src/share/npt \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnpt/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_macosx := -liconv, \
    -    LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=npt.dll" \
    -        -D "JDK_INTERNAL_NAME=npt" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \
    -    DEBUG_SYMBOLS := true))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBNPT)
    -
    -##########################################################################################
    -
    -LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/share/native/java/net \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/www/protocol/http/ntlm
    -else
    -  LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/sdp
    -endif
    -
    -LIBNET_CFLAGS := $(foreach dir, $(LIBNET_SRC_DIRS), -I$(dir))
    -
    -LIBNET_EXCLUDE_FILES :=
    -ifneq ($(OPENJDK_TARGET_OS), linux)
    -  LIBNET_EXCLUDE_FILES += linux_close.c
    -endif
    -
    -ifneq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBNET_EXCLUDE_FILES += bsd_close.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c
    -else
    -  LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \
    -      TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \
    -      NTLMAuthSequence.c NetworkInterface_winXP.c
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
    -    LIBRARY := net, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(LIBNET_SRC_DIRS), \
    -    EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(LIBNET_CFLAGS), \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnet/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_macosx := -ljvm -ljava, \
    -    LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lnsl -lsocket $(LIBDL) -lc, \
    -    LDFLAGS_SUFFIX_linux := $(LIBDL) -ljvm -lpthread -ljava, \
    -    LDFLAGS_SUFFIX_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \
    -        delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \
    -        -DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=net.dll" \
    -        -D "JDK_INTERNAL_NAME=net" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnet, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBNET): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBNET)
    -
    -$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
    -	$(ECHO) $(LOG_INFO) Copying $(@F)
    -	$(call install-file)
    -
    -COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template
    -	$(ECHO) $(LOG_INFO) Copying $(@F)
    -	$(call install-file)
    -
    -  COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
    -endif
    -
    -##########################################################################################
    -
    -BUILD_LIBNIO_SRC := \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/nio \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    -
    -BUILD_LIBNIO_CFLAGS := \
    -    -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
    -    -I$(JDK_TOPDIR)/src/share/native/java/io \
    -    -I$(JDK_TOPDIR)/src/share/native/java/net \
    -    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net
    -
    -BUILD_LIBNIO_FILES := \
    -    DatagramChannelImpl.c \
    -    DatagramDispatcher.c \
    -    FileChannelImpl.c \
    -    FileDispatcherImpl.c \
    -    FileKey.c \
    -    IOUtil.c \
    -    MappedByteBuffer.c \
    -    Net.c \
    -    ServerSocketChannelImpl.c \
    -    SocketChannelImpl.c \
    -    SocketDispatcher.c
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  BUILD_LIBNIO_FILES += \
    -      Iocp.c \
    -      RegistryFileTypeDetector.c \
    -      WindowsAsynchronousFileChannelImpl.c \
    -      WindowsAsynchronousServerSocketChannelImpl.c \
    -      WindowsAsynchronousSocketChannelImpl.c \
    -      WindowsNativeDispatcher.c \
    -      WindowsSelectorImpl.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    -  BUILD_LIBNIO_FILES += \
    -      EPoll.c \
    -      EPollArrayWrapper.c \
    -      EPollPort.c \
    -      InheritedChannel.c \
    -      NativeThread.c \
    -      PollArrayWrapper.c \
    -      UnixAsynchronousServerSocketChannelImpl.c \
    -      UnixAsynchronousSocketChannelImpl.c \
    -      GnomeFileTypeDetector.c \
    -      MagicFileTypeDetector.c \
    -      LinuxNativeDispatcher.c \
    -      LinuxWatchService.c \
    -      UnixCopyFile.c \
    -      UnixNativeDispatcher.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    -  BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch
    -  BUILD_LIBNIO_FILES += \
    -      InheritedChannel.c \
    -      NativeThread.c \
    -      PollArrayWrapper.c \
    -      UnixAsynchronousServerSocketChannelImpl.c \
    -      UnixAsynchronousSocketChannelImpl.c \
    -      BsdNativeDispatcher.c \
    -      MacOSXNativeDispatcher.c \
    -      UnixCopyFile.c \
    -      UnixNativeDispatcher.c \
    -      KQueue.c \
    -      KQueuePort.c \
    -      KQueueArrayWrapper.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    -  BUILD_LIBNIO_FILES += \
    -      DevPollArrayWrapper.c \
    -      InheritedChannel.c \
    -      NativeThread.c \
    -      PollArrayWrapper.c \
    -      SolarisEventPort.c \
    -      UnixAsynchronousServerSocketChannelImpl.c \
    -      UnixAsynchronousSocketChannelImpl.c \
    -      GnomeFileTypeDetector.c \
    -      SolarisNativeDispatcher.c \
    -      SolarisWatchService.c \
    -      UnixCopyFile.c \
    -      UnixNativeDispatcher.c
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
    -    LIBRARY := nio, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(BUILD_LIBNIO_SRC), \
    -    INCLUDE_FILES := $(BUILD_LIBNIO_FILES), \
    -    LANG := C, \
    -    OPTIMIZATION := HIGH, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(BUILD_LIBNIO_CFLAGS), \
    -    MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_linux := -ljava -lnet -lpthread $(LIBDL), \
    -    LDFLAGS_SUFFIX_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
    -        -lsendfile -ljava -lnet -lc, \
    -    LDFLAGS_SUFFIX_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
    -        $(JDK_OUTPUTDIR)/objs/libnet/net.lib \
    -        advapi32.lib, \
    -    LDFLAGS_SUFFIX_macosx := -ljava -lnet -pthread -framework CoreFoundation, \
    -    LDFLAGS_SUFFIX :=, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=nio.dll" \
    -        -D "JDK_INTERNAL_NAME=nio" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnio, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBNIO)
    -
    -$(BUILD_LIBNIO): $(BUILD_LIBNET)
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS_API), posix)
    -
    -  ifneq ($(OPENJDK_TARGET_OS), macosx)
    -
    -    SCTP_WERROR := -Werror
    -    ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    -      SCTP_WERROR :=
    -    endif
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
    -        LIBRARY := sctp, \
    -        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -        SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch/sctp, \
    -        LANG := C, \
    -        OPTIMIZATION := LOW, \
    -        CFLAGS := $(CFLAGS_JDKLIB) \
    -            -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
    -            -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
    -            -I$(JDK_TOPDIR)/src/share/native/java/net \
    -            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
    -            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net, \
    -        CFLAGS_linux := $(SCTP_WERROR), \
    -        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
    -        LDFLAGS := $(LDFLAGS_JDKLIB) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN), \
    -        LDFLAGS_SUFFIX_linux := -lpthread $(LIBDL) -ljava -ljvm, \
    -        LDFLAGS_SUFFIX_posix := -lnio -lnet, \
    -        LDFLAGS_SUFFIX_solaris := -lsocket -ljava -ljvm -lc, \
    -        LDFLAGS_SUFFIX_macosx := -ljava -ljvm, \
    -        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsctp, \
    -        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBSCTP)
    -
    -    $(BUILD_LIBSCTP): $(BUILD_LIBNIO)
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin
    -LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir))
    -
    -BUILD_LIBJLI_FILES := \
    -    java.c \
    -    splashscreen_stubs.c \
    -    parse_manifest.c \
    -    version_comp.c \
    -    wildcard.c \
    -    jli_util.c
    -
    -ifeq ($(JVM_VARIANT_ZERO), true)
    -  ERGO_FAMILY := zero
    -else
    -  ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
    -    ERGO_FAMILY := i586
    -  else
    -    ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
    -  endif
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
    -  BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
    -  BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
    -
    -  BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
    -  BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  BUILD_LIBJLI_FILES += java_md.c \
    -      cmdtoargs.c
    -  # Staticically link with c runtime on windows.
    -  LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
    -else ifneq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  BUILD_LIBJLI_FILES += java_md_common.c
    -  BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
    -
    -  ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
    -
    -  # if the architecture specific ergo file exists then
    -  # use it, else use the generic definitions from ergo.c
    -  ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)), )
    -    BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
    -  else # !ERGO_ARCH_FILE
    -    LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
    -  endif # ERGO_ARCH_FILE
    -endif #WINDOWS
    -
    -# Append defines depending on target platform
    -LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
    -endif
    -
    -ifneq ($(USE_EXTERNAL_LIBZ), true)
    -  BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -  LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
    -  BUILD_LIBJLI_FILES += \
    -      inflate.c \
    -      inftrees.c \
    -      inffast.c \
    -      zadler32.c \
    -      zcrc32.c \
    -      zutil.c
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
    -else
    -  LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
    -endif
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
    -    LIBRARY := jli, \
    -    OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
    -    SRC := $(BUILD_LIBJLI_SRC_DIRS), \
    -    INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
    -    LANG := C, \
    -    OPTIMIZATION := HIGH, \
    -    CFLAGS := $(LIBJLI_CFLAGS), \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjli/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    -    LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    -    LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
    -    LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
    -    LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
    -    LDFLAGS_SUFFIX_macosx := $(LIBZ), \
    -    LDFLAGS_SUFFIX_windows := \
    -        -export:JLI_Launch \
    -        -export:JLI_ManifestIterate \
    -        -export:JLI_SetTraceLauncher \
    -        -export:JLI_ReportErrorMessage \
    -        -export:JLI_ReportErrorMessageSys \
    -        -export:JLI_ReportMessage \
    -        -export:JLI_ReportExceptionDescription \
    -        -export:JLI_MemAlloc \
    -        -export:JLI_CmdToArgs \
    -        -export:JLI_GetStdArgc \
    -        -export:JLI_GetStdArgs \
    -        advapi32.lib \
    -        comctl32.lib \
    -        user32.lib, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=jli.dll" \
    -        -D "JDK_INTERNAL_NAME=jli" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJLI)
    -
    -# On windows, the static library has the same suffix as the import library created by
    -# with the shared library, so the static library is given a different name. No harm
    -# in doing it for all platform to reduce complexity.
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
    -      STATIC_LIBRARY := jli_static, \
    -      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
    -      SRC := $(BUILD_LIBJLI_SRC_DIRS), \
    -      INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
    -      LANG := C, \
    -      OPTIMIZATION := HIGH, \
    -      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
    -      ARFLAGS := $(ARFLAGS), \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
    -
    -else ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  #
    -  # On macosx they do partial (incremental) linking of libjli_static.a
    -  # code it here...rather than add support to NativeCompilation
    -  # as this is first time I see it
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
    -      LIBRARY := jli_static, \
    -      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
    -      SRC := $(BUILD_LIBJLI_SRC_DIRS), \
    -      INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
    -      LANG := C, \
    -      OPTIMIZATION := HIGH, \
    -      CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
    -      LDFLAGS := -nostdlib -r, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC)
    -	$(call install-file)
    -
    -  BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -  ifeq ($(ENABLE_JFR), true)
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBJFR, \
    -        LIBRARY := jfr, \
    -        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -        SRC := $(JDK_TOPDIR)/src/closed/share/native/oracle/jfr, \
    -        LANG := C, \
    -        OPTIMIZATION := LOW, \
    -        CFLAGS := $(CFLAGS_JDKLIB) \
    -            -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \
    -        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \
    -        LDFLAGS := $(LDFLAGS_JDKLIB) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN), \
    -        LDFLAGS_SUFFIX_solaris := -lc, \
    -        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -        RC_FLAGS := $(RC_FLAGS) \
    -            -D "JDK_FNAME=jfr.dll" \
    -            -D "JDK_INTERNAL_NAME=jfr" \
    -            -D "JDK_FTYPE=0x2L", \
    -        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjfr, \
    -        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBJFR)
    -
    -endif
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -
    -  BUILD_LIBKCMS_EXCLUDE_FILES :=
    -  ifeq ($(OPENJDK_TARGET_OS), windows)
    -    BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
    -  else
    -    BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
    -  endif
    -
    -  BUILD_LIBKCMS_FLAGS := $(CFLAGS_JDKLIB)
    -
    -  ifeq ($(OPENJDK_TARGET_OS), solaris)
    -    # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
    -    # implement it like this...since it's only used here
    -    BUILD_LIBKCMS_FLAGS := $(patsubst -KPIC, -Kpic, $(BUILD_LIBKCMS_FLAGS))
    -  else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    -    BUILD_LIBKCMS_FLAGS := $(patsubst -fPIC, -fpic, $(BUILD_LIBKCMS_FLAGS))
    -  endif
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
    -      LIBRARY := kcms, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms, \
    -      LANG := C, \
    -      EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(BUILD_LIBKCMS_FLAGS) \
    -          -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
    -      CFLAGS_linux := -Wno-missing-field-initializers, \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libkcms/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX_linux := -lc -lpthread, \
    -      LDFLAGS_SUFFIX_solaris := -lc, \
    -      LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
    -      LDFLAGS_SUFFIX_posix := -lm -ljava -ljvm, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=kcms.dll" \
    -          -D "JDK_INTERNAL_NAME=kcms" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkcms, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBKCMS): $(BUILD_LIBJAVA)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBKCMS)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -  ifeq ($(OPENJDK_TARGET_OS), solaris)
    -    ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -
    -      ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
    -
    -        SUNWJDGA_MAPFILE :=
    -        ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    -          SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdga/mapfile-vers
    -        endif
    -
    -        $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
    -            LIBRARY := sunwjdga, \
    -            OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -            SRC := $(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
    -            LANG := C, \
    -            OPTIMIZATION := LOW, \
    -            CFLAGS := $(CFLAGS_JDKLIB) \
    -                -I$(JDK_TOPDIR)/src/share/javavm/export \
    -                -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
    -                -I$(OPENWIN_HOME)/include, \
    -            MAPFILE := $(SUNWJDGA_MAPFILE), \
    -            LDFLAGS := $(LDFLAGS_JDKLIB) \
    -                $(call SET_SHARED_LIBRARY_ORIGIN), \
    -            LDFLAGS_SUFFIX := -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
    -            OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunwjdga, \
    -            DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -        BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
    -
    -      endif
    -    endif
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(BUILD_HEADLESS), true)
    -  ifneq ($(OPENJDK_TARGET_OS), windows)
    -
    -    LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
    -        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -        $(JDK_TOPDIR)/src/solaris/native/sun/font \
    -        $(JDK_TOPDIR)/src/solaris/native/sun/awt \
    -        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
    -        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
    -
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -      LIBAWT_HEADLESS_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/font
    -    endif
    -
    -    LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
    -        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
    -        $(CUPS_CFLAGS) \
    -        $(X_CFLAGS) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
    -        $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
    -
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -      LIBAWT_HEADLESS_CFLAGS += \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
    -    endif
    -
    -    LIBAWT_HEADLESS_FILES := \
    -        awt_Font.c \
    -        HeadlessToolkit.c \
    -        fontpath.c \
    -        VDrawingArea.c \
    -        X11Color.c \
    -        X11Renderer.c \
    -        X11PMBlitLoops.c \
    -        X11SurfaceData.c \
    -        X11FontScaler_md.c \
    -        X11TextRenderer_md.c \
    -        OGLBlitLoops.c \
    -        OGLBufImgOps.c \
    -        OGLContext.c \
    -        OGLFuncs.c \
    -        OGLMaskBlit.c \
    -        OGLMaskFill.c \
    -        OGLPaints.c \
    -        OGLRenderQueue.c \
    -        OGLRenderer.c \
    -        OGLSurfaceData.c \
    -        OGLTextRenderer.c \
    -        OGLVertexCache.c \
    -        GLXGraphicsConfig.c \
    -        GLXSurfaceData.c \
    -        AccelGlyphCache.c \
    -        CUPSfuncs.c
    -
    -    ifeq ($(OPENJDK_TARGET_OS), macosx)
    -      LIBAWT_HEADLESS_FILES += \
    -          AWTFont.m \
    -          AWTStrike.m \
    -          CCharToGlyphMapper.m \
    -          CGGlyphImages.m \
    -          CGGlyphOutlines.m \
    -          CoreTextSupport.m
    -    endif
    -
    -    LIBAWT_HEADLESS_REORDER :=
    -    ifeq ($(OPENJDK_TARGET_OS), solaris)
    -      ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    -        LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
    -      endif
    -    endif
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
    -        LIBRARY := awt_headless, \
    -        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -        SRC := $(LIBAWT_HEADLESS_DIRS), \
    -        INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES), \
    -        LANG := C, \
    -        OPTIMIZATION := LOW, \
    -        CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS), \
    -        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers, \
    -        LDFLAGS := $(LDFLAGS_JDKLIB) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN), \
    -        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    -        LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
    -            -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    -            -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    -        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
    -        REORDER := $(LIBAWT_HEADLESS_REORDER), \
    -        LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
    -        LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
    -        LDFLAGS_SUFFIX_macosx := -ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \
    -            -framework Accelerate \
    -            -framework ApplicationServices \
    -            -framework Cocoa \
    -            -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -            -framework JavaNativeFoundation \
    -            -framework JavaRuntimeSupport, \
    -        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
    -        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -    $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
    -
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -ifndef BUILD_HEADLESS_ONLY
    -  LIBSPLASHSCREEN_DIRS := \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
    -    $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
    -
    -  ifeq ($(USE_EXTERNAL_LIBGIF), true)
    -    GIFLIB_LDFLAGS := -lgif
    -  else
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    -    GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    -  endif
    -
    -  ifneq ($(OPENJDK_TARGET_OS), macosx)
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
    -  else
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
    -  endif
    -
    -  LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
    -      $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir))
    -
    -  ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
    -        $(LIBSPLASHSCREEN_CFLAGS) \
    -        -F/System/Library/Frameworks/JavaVM.framework/Frameworks
    -    LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
    -    LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
    -
    -    LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
    -    LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
    -    LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
    -    LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
    -    LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
    -    LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
    -    LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
    -
    -  else ifneq ($(OPENJDK_TARGET_OS), windows)
    -    LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
    -  else
    -    LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
    -  endif
    -
    -  LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
    -
    -  ifneq ($(USE_EXTERNAL_LIBZ), true)
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    -    LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
    -        -framework ApplicationServices \
    -        -framework Foundation \
    -        -framework Cocoa \
    -        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -        -framework JavaNativeFoundation
    -  else ifneq ($(OPENJDK_TARGET_OS), windows)
    -    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
    -  else # OPENJDK_TARGET_OS
    -    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
    -  endif # OPENJDK_TARGET_OS
    -
    -  $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN, \
    -      LIBRARY := splashscreen, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(LIBSPLASHSCREEN_DIRS), \
    -      EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
    -      LDFLAGS_SUFFIX_solaris := -lc, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=splashscreen.dll" \
    -          -D "JDK_INTERNAL_NAME=splashscreen" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
    -
    -  ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    $(LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
    -  endif
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -
    -  LIBDCPR_SRC_DIRS := \
    -      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
    -      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
    -      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
    -      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
    -
    -  LIBDCPR_CFLAGS := $(foreach dir, $(LIBDCPR_SRC_DIRS), -I$(dir)) \
    -      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
    -      LIBRARY := dcpr, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(LIBDCPR_SRC_DIRS), \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          $(LIBDCPR_CFLAGS), \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
    -      LDFLAGS_SUFFIX_posix := -lm, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=dcpr.dll" \
    -          -D "JDK_INTERNAL_NAME=dcpr" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdcpr, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBDCPR): $(BUILD_LIBJAVA)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBDCPR)
    -
    -endif
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
    -    LIBRARY := j2pcsc, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio, \
    -    LANG := C, \
    -    CFLAGS_posix := -D__sun_jdk, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pcsc/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_posix := $(LIBDL), \
    -    LDFLAGS_SUFFIX_windows := winscard.lib, \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=j2pcsc.dll" \
    -        -D "JDK_INTERNAL_NAME=j2pcsc" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pcsc, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)
    -
    -##########################################################################################
    -
    -ifneq ($(OPENJDK_TARGET_OS), windows)
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
    -      LIBRARY := j2gss, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
    -          $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
    -          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := $(LIBDL), \
    -      LDFLAGS_SUFFIX_solaris := -lc, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2gss, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
    -endif
    -
    -##########################################################################################
    -
    -ifneq ($(BUILD_CRYPTO), no)
    -  BUILD_LIBKRB5_NAME :=
    -  ifeq ($(OPENJDK_TARGET_OS), windows)
    -    BUILD_LIBKRB5_NAME := w2k_lsa_auth
    -    BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5
    -    BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
    -        gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    -        ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
    -  else ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    BUILD_LIBKRB5_NAME := osxkrb5
    -    BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/share/native/sun/security/krb5
    -    BUILD_LIBKRB5_LIBS := -framework Kerberos
    -  endif
    -
    -  ifneq ($(BUILD_LIBKRB5_NAME), )
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
    -        LIBRARY := $(BUILD_LIBKRB5_NAME), \
    -        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -        SRC := $(BUILD_LIBKRB5_SRC), \
    -        LANG := C, \
    -        OPTIMIZATION := LOW, \
    -        CFLAGS := $(CFLAGS_JDKLIB) \
    -            -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
    -            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5, \
    -        LDFLAGS := $(LDFLAGS_JDKLIB) \
    -            $(call SET_SHARED_LIBRARY_ORIGIN), \
    -        LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \
    -        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -        RC_FLAGS := $(RC_FLAGS) \
    -            -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \
    -            -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \
    -            -D "JDK_FTYPE=0x2L", \
    -        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkrb5, \
    -        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBKRB5)
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \
    -      LIBRARY := sunmscapi, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \
    -      LANG := C++, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := Crypt32.Lib advapi32.lib, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=sunmscapi.dll" \
    -          -D "JDK_INTERNAL_NAME=sunmscapi" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunmscapi, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI)
    -endif
    -
    -##########################################################################################
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
    -    LIBRARY := j2pkcs11, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
    -        $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
    -        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \
    -    LANG := C, \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
    -        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
    -        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_SUFFIX_posix := $(LIBDL), \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=j2pkcs11.dll" \
    -        -D "JDK_INTERNAL_NAME=j2pkcs11" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pkcs11, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11)
    -
    -##########################################################################################
    -
    -ifeq ($(ENABLE_INTREE_EC), yes)
    -
    -  BUILD_LIBSUNEC_FLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \
    -      -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl
    -
    -  #
    -  # On sol-sparc...all libraries are compiled with -xregs=no%appl
    -  # (set in CFLAGS_REQUIRED_sparc)
    -  #
    -  # except!!! libsunec.so
    -  #
    -  ECC_JNI_SOLSPARC_FILTER :=
    -  ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    -    ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl
    -  endif
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \
    -      LIBRARY := sunec, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/share/native/sun/security/ec \
    -          $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \
    -      LANG := C++, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \
    -          $(BUILD_LIBSUNEC_FLAGS) \
    -          -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
    -      CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
    -          $(BUILD_LIBSUNEC_FLAGS), \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsunec/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
    -      LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := $(LIBCXX), \
    -      LDFLAGS_SUFFIX_linux := -lc, \
    -      LDFLAGS_SUFFIX_solaris := -lc, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=sunec.dll" \
    -          -D "JDK_INTERNAL_NAME=sunec" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunec, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBSUNEC)
    -endif
    -
    -##########################################################################################
    -
    -LIBJSOUND_SRC_DIRS := \
    -    $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \
    -    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound
    -
    -LIBJSOUND_SRC_FILES := Utilities.c Platform.c
    -
    -LIBJSOUND_LANG := C
    -LIBJSOUND_CFLAGS := $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir))
    -
    -EXTRA_SOUND_JNI_LIBS :=
    -
    -LIBJSOUND_MIDIFILES := \
    -    MidiInDevice.c \
    -    MidiInDeviceProvider.c \
    -    MidiOutDevice.c \
    -    MidiOutDeviceProvider.c \
    -    PlatformMidi.c
    -
    -# files needed for ports
    -LIBJSOUND_PORTFILES := \
    -    PortMixerProvider.c \
    -    PortMixer.c
    -
    -# files needed for direct audio
    -LIBJSOUND_DAUDIOFILES := \
    -    DirectAudioDeviceProvider.c \
    -    DirectAudioDevice.c
    -
    -ifeq ($(OPENJDK_TARGET_OS), windows)
    -  EXTRA_SOUND_JNI_LIBS += jsoundds
    -  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
    -      -DUSE_PLATFORM_MIDI_OUT=TRUE \
    -      -DUSE_PLATFORM_MIDI_IN=TRUE \
    -      -DUSE_PORTS=TRUE
    -  LIBJSOUND_SRC_FILES += \
    -      PLATFORM_API_WinOS_MidiIn.cpp \
    -      PLATFORM_API_WinOS_MidiOut.c \
    -      PLATFORM_API_WinOS_Util.c \
    -      PLATFORM_API_WinOS_Ports.c
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    -endif # OPENJDK_TARGET_OS windows
    -
    -ifeq ($(OPENJDK_TARGET_OS), linux)
    -  EXTRA_SOUND_JNI_LIBS += jsoundalsa
    -  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
    -endif # OPENJDK_TARGET_OS linux
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  LIBJSOUND_LANG := C++
    -  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
    -      -DUSE_PORTS=TRUE \
    -      -DUSE_DAUDIO=TRUE \
    -      -DUSE_PLATFORM_MIDI_OUT=TRUE \
    -      -DUSE_PLATFORM_MIDI_IN=TRUE
    -  LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound
    -  LIBJSOUND_SRC_FILES += \
    -      PLATFORM_API_MacOSX_Utils.cpp \
    -      PLATFORM_API_MacOSX_PCM.cpp \
    -      PLATFORM_API_MacOSX_Ports.cpp \
    -      PLATFORM_API_MacOSX_MidiIn.c \
    -      PLATFORM_API_MacOSX_MidiOut.c \
    -      PLATFORM_API_MacOSX_MidiUtils.c
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
    -endif # OPENJDK_TARGET_OS macosx
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
    -      -DUSE_PORTS=TRUE \
    -      -DUSE_DAUDIO=TRUE
    -  LIBJSOUND_SRC_FILES += \
    -      PLATFORM_API_SolarisOS_Utils.c \
    -      PLATFORM_API_SolarisOS_Ports.c \
    -      PLATFORM_API_SolarisOS_PCM.c
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    -  LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
    -endif # OPENJDK_TARGET_OS solaris
    -
    -
    -ifeq ($(JVM_VARIANT_ZERO), true)
    -  LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO
    -else
    -  ifeq ($(OPENJDK_TARGET_CPU), x86)
    -    LIBJSOUND_CFLAGS += -DX_ARCH=X_I586
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), sparc)
    -    LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    -    LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
    -    LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), arm)
    -    LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_CPU), ppc)
    -    LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
    -  endif
    -endif
    -
    -LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
    -
    -$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
    -    LIBRARY := jsound, \
    -    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -    SRC := $(LIBJSOUND_SRC_DIRS), \
    -    INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \
    -    LANG := $(LIBJSOUND_LANG), \
    -    OPTIMIZATION := LOW, \
    -    CFLAGS := $(CFLAGS_JDKLIB) \
    -        $(LIBJSOUND_CFLAGS), \
    -    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
    -    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
    -    LDFLAGS := $(LDFLAGS_JDKLIB) \
    -        $(call SET_SHARED_LIBRARY_ORIGIN), \
    -    LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \
    -        -framework CoreServices -framework AudioUnit $(LIBCXX) \
    -        -framework CoreMIDI -framework AudioToolbox, \
    -    LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \
    -    LDFLAGS_SUFFIX_posix := -ljava -ljvm, \
    -    LDFLAGS_SUFFIX_solaris := -lc, \
    -    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -    RC_FLAGS := $(RC_FLAGS) \
    -        -D "JDK_FNAME=jsound.dll" \
    -        -D "JDK_INTERNAL_NAME=jsound" \
    -        -D "JDK_FTYPE=0x2L", \
    -    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsound, \
    -    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA)
    -
    -BUILD_LIBRARIES += $(BUILD_LIBJSOUND)
    -
    -##########################################################################################
    -
    -ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), )
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \
    -      LIBRARY := jsoundalsa, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(LIBJSOUND_SRC_DIRS), \
    -      INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
    -          $(LIBJSOUND_DAUDIOFILES) \
    -          PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \
    -          PLATFORM_API_LinuxOS_ALSA_PCM.c \
    -          PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \
    -          PLATFORM_API_LinuxOS_ALSA_MidiIn.c \
    -          PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
    -          PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
    -          PLATFORM_API_LinuxOS_ALSA_Ports.c, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
    -          $(LIBJSOUND_CFLAGS) \
    -          -DUSE_DAUDIO=TRUE \
    -          -DUSE_PORTS=TRUE \
    -          -DUSE_PLATFORM_MIDI_OUT=TRUE \
    -          -DUSE_PLATFORM_MIDI_IN=TRUE, \
    -      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundalsa, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), )
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \
    -      LIBRARY := jsoundds, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(LIBJSOUND_SRC_DIRS), \
    -      INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
    -          PLATFORM_API_WinOS_DirectSound.cpp, \
    -      LANG := C++, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          $(LIBJSOUND_CFLAGS) \
    -          -DUSE_DAUDIO=TRUE, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \
    -      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    -      RC_FLAGS := $(RC_FLAGS) \
    -          -D "JDK_FNAME=jsoundds.dll" \
    -          -D "JDK_INTERNAL_NAME=jsoundds" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundds, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifndef OPENJDK
    -
    -    $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \
    -        LIBRARY := j2ucrypto, \
    -        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -        SRC := $(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \
    -        LANG := C, \
    -        OPTIMIZATION := LOW, \
    -        CFLAGS := $(CFLAGS_JDKLIB) \
    -            -I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \
    -        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \
    -        LDFLAGS := $(LDFLAGS_JDKLIB), \
    -        LDFLAGS_SUFFIX := $(LIBDL), \
    -        LDFLAGS_SUFFIX_solaris := -lc, \
    -        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \
    -        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -    $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA)
    -
    -    BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO)
    -
    -  endif
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE, \
    -      LIBRARY := AppleScriptEngine, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := -framework Cocoa \
    -          -framework Carbon \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          $(LDFLAGS_JDKLIB_SUFFIX), \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(BUILD_LIBAPPLESCRIPTENGINE): $(BUILD_LIBJAVA)
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \
    -      LIBRARY := osxapp, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -          -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX_macosx := \
    -          -framework Accelerate \
    -          -framework ApplicationServices \
    -          -framework AudioToolbox \
    -          -framework Carbon \
    -          -framework Cocoa \
    -          -framework Security \
    -          -framework ExceptionHandling \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          -framework JavaRuntimeSupport \
    -          -framework OpenGL \
    -          -framework IOSurface \
    -          -framework QuartzCore, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxapp, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBOSXAPP)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  LIBOSX_DIRS := \
    -      $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
    -      $(JDK_TOPDIR)/src/macosx/native/java/util \
    -      $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
    -      $(JDK_TOPDIR)/src/macosx/native/apple/security \
    -      $(JDK_TOPDIR)/src/macosx/native/apple/launcher
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
    -      LIBRARY := osx, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(LIBOSX_DIRS), \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
    -          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX_macosx := \
    -          -losxapp \
    -          -framework Cocoa \
    -          -framework ApplicationServices \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          -framework JavaRuntimeSupport \
    -          -framework Security \
    -          -framework SystemConfiguration \
    -          $(LDFLAGS_JDKLIB_SUFFIX), \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosx, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBOSX)
    -
    -  $(BUILD_LIBOSX): $(BUILD_LIBOSXAPP)
    -
    -  $(BUILD_LIBOSX): $(BUILD_LIBJAVA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  LIBAWT_LWAWT_FILES := \
    -      awt.m \
    -      ApplicationDelegate.m \
    -      CFRetainedResource.m \
    -      CGLGraphicsConfig.m \
    -      CGLSurfaceData.m \
    -      CGLLayer.m \
    -      CGraphicsConfig.m \
    -      CGraphicsDevice.m \
    -      CGraphicsEnv.m \
    -      CCharToGlyphMapper.m \
    -      CSystemColors.m \
    -      AWTFont.m \
    -      CGGlyphOutlines.m \
    -      CGGlyphImages.m \
    -      CoreTextSupport.m \
    -      AWTStrike.m \
    -      InitIDs.m \
    -      AWTEvent.m \
    -      AWTView.m \
    -      AWTWindow.m \
    -      AWTSurfaceLayers.m \
    -      CCursorManager.m \
    -      CClipboard.m \
    -      CDataTransferer.m \
    -      CDragSource.m \
    -      CDragSourceContextPeer.m \
    -      CDropTarget.m \
    -      CDropTargetContextPeer.m \
    -      CInputMethod.m \
    -      CDesktopPeer.m \
    -      OSVersion.m \
    -      DnDUtilities.m \
    -      CFileDialog.m \
    -      CImage.m \
    -      CMenu.m \
    -      CMenuBar.m \
    -      CMenuComponent.m \
    -      CMenuItem.m \
    -      CPopupMenu.m \
    -      CRobot.m \
    -      CTrayIcon.m \
    -      CWrapper.m \
    -      JavaAccessibilityAction.m \
    -      JavaAccessibilityUtilities.m \
    -      JavaComponentAccessibility.m \
    -      JavaTextAccessibility.m \
    -      LWCToolkit.m \
    -      GeomUtilities.m \
    -      CPrinterJob.m \
    -      PrintModel.m \
    -      PrinterSurfaceData.m \
    -      PrinterView.m \
    -      QuartzSurfaceData.m \
    -      QuartzRenderer.m \
    -      CTextPipe.m \
    -      ImageSurfaceData.m \
    -      awt_DrawingSurface.m \
    -      \
    -      OGLBlitLoops.c \
    -      OGLBufImgOps.c \
    -      OGLContext.c \
    -      OGLFuncs.c \
    -      OGLMaskBlit.c \
    -      OGLMaskFill.c \
    -      OGLPaints.c \
    -      OGLRenderQueue.c \
    -      OGLRenderer.c \
    -      OGLSurfaceData.c \
    -      OGLTextRenderer.c \
    -      OGLVertexCache.c \
    -      AccelGlyphCache.c \
    -      CUPSfuncs.c
    -
    -
    -  LIBAWT_LWAWT_DIRS := \
    -      $(JDK_TOPDIR)/src/macosx/native/sun/awt \
    -      $(JDK_TOPDIR)/src/macosx/native/sun/font \
    -      $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
    -      $(JDK_TOPDIR)/src/solaris/native/sun/awt \
    -      $(JDK_TOPDIR)/src/share/native/sun/font \
    -      $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
    -      LIBRARY := awt_lwawt, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(LIBAWT_LWAWT_DIRS), \
    -      LANG := C, \
    -      INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -      $(X_CFLAGS) \
    -      $(X_LIBS) \
    -      $(foreach dir, $(LIBAWT_LWAWT_DIRS), -I$(dir)) \
    -          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    -          -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    -          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
    -          -framework Accelerate \
    -          -framework ApplicationServices \
    -          -framework AudioToolbox \
    -          -framework Carbon \
    -          -framework Cocoa \
    -          -framework Security \
    -          -framework ExceptionHandling \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          -framework JavaRuntimeSupport \
    -          -framework OpenGL \
    -          -framework QuartzCore -ljava, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
    -
    -  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
    -
    -  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
    -
    -  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
    -
    -  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBJAVA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
    -      LIBRARY := osxui, \
    -      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -      SRC := $(JDK_TOPDIR)/src/macosx/native/com/apple/laf, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
    -          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    -          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN) \
    -          -Xlinker -rpath -Xlinker @loader_path, \
    -      LDFLAGS_SUFFIX_macosx := -lawt -losxapp -lawt_lwawt \
    -          -framework Cocoa \
    -          -framework Carbon \
    -          -framework ApplicationServices \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          -framework JavaRuntimeSupport \
    -          -ljava -ljvm, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxui, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  BUILD_LIBRARIES += $(BUILD_LIBOSXUI)
    -
    -  $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
    -
    -  $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
    -
    -  $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
    -
    -  #$(BUILD_LIBOSXUI): $(BUILD_LIBJAVA)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -
    -  # Ugly hack to mimic behaviour in old build where this is built as an xcode project.
    -  SET_SHARED_LIBRARY_NAME = -Xlinker -install_name -Xlinker /usr/local/lib/libJObjC.dylib
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC32, \
    -      LIBRARY := JObjC, \
    -      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \
    -      SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
    -          $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := -fpascal-strings \
    -          -fobjc-gc \
    -          -gdwarf-2 \
    -          $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -m32, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB) \
    -          -m32, \
    -      LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          -lffi, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC64, \
    -      LIBRARY := JObjC, \
    -      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \
    -      SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
    -          $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \
    -      LANG := C, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := -fpascal-strings \
    -          -fobjc-gc \
    -          -gdwarf-2 \
    -          $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          , \
    -      LDFLAGS := -fpascal-strings \
    -          -fobjc-gc \
    -          -gdwarf-2 \
    -          $(LDFLAGS_JDKLIB) \
    -          $(call SET_SHARED_LIBRARY_ORIGIN), \
    -      LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \
    -          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    -          -framework JavaNativeFoundation \
    -          -lffi, \
    -      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \
    -      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    -
    -  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX): $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
    -	$(LIPO) -create -output $@ $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
    -
    -  BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX)
    -
    -endif
    -
    -##########################################################################################
    -
    -ifndef OPENJDK
    -  ifeq ($(OPENJDK_TARGET_OS), windows)
    -
    -    ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
    -
    -    define SetupAccessBridge
    -      # Parameter 1 Suffix
    -      # Parameter 2 Machine
    -      # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
    -
    -      $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
    -          LIBRARY = JAWTAccessBridge$1, \
    -          OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -          SRC := $(ACCESSBRIDGE_SRCDIR), \
    -          INCLUDE_FILES := JAWTAccessBridge.cpp, \
    -          LANG := C++, \
    -          OPTIMIZATION := LOW, \
    -          CFLAGS := $(CFLAGS_JDKLIB) \
    -              -DACCESSBRIDGE_ARCH_$3, \
    -          LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    -              winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
    -              ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    -              -subsystem:windows -machine:$2 \
    -              -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
    -          VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
    -          RC_FLAGS := $(RC_FLAGS), \
    -          OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
    -          DEBUG_SYMBOLS := true)
    -
    -      $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
    -
    -      $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
    -          LIBRARY = JavaAccessBridge$1, \
    -          OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -          SRC := $(ACCESSBRIDGE_SRCDIR), \
    -          INCLUDE_FILES := AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
    -              AccessBridgeJavaEntryPoints.cpp \
    -              AccessBridgeMessages.cpp JavaAccessBridge.cpp, \
    -          LANG := C++, \
    -          OPTIMIZATION := LOW, \
    -          CFLAGS := $(CFLAGS_JDKLIB) \
    -              -DACCESSBRIDGE_ARCH_$3, \
    -          LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    -              winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    -              ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    -              -subsystem:windows -machine:$2 \
    -              -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
    -          VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
    -          RC_FLAGS := $(RC_FLAGS), \
    -          OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1, \
    -          DEBUG_SYMBOLS := true)
    -
    -      $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \
    -          LIBRARY = WindowsAccessBridge$1, \
    -          OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    -          SRC := $(ACCESSBRIDGE_SRCDIR), \
    -          INCLUDE_FILES := AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
    -              AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
    -              WinAccessBridge.cpp AccessBridgeDebug.cpp \
    -              AccessBridgeEventHandler.cpp, \
    -          LANG := C++, \
    -          OPTIMIZATION := LOW, \
    -          CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
    -              -DACCESSBRIDGE_ARCH_$3, \
    -          LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    -              winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    -              ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    -              -subsystem:windows -machine:$2 \
    -              -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF, \
    -          VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
    -          RC_FLAGS := $(RC_FLAGS), \
    -          OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1, \
    -          DEBUG_SYMBOLS := true)
    -
    -      BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
    -          $$(BUILD_WINDOWSACCESSBRIDGE$1)
    -
    -    endef
    -
    -    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -      $(eval $(call SetupAccessBridge,-32,I386,32))
    -      $(eval $(call SetupAccessBridge,,I386,LEGACY))
    -    else
    -      $(eval $(call SetupAccessBridge,-64,X64,64))
    -    endif
    -  endif
    -endif
    +include lib/Awt2dLibraries.gmk
     
    +include lib/SoundLibraries.gmk
     
     ##########################################################################################
     
    diff --git a/jdk/makefiles/CopyFiles.gmk b/jdk/makefiles/CopyFiles.gmk
    index 0ad18ced8ff..02bafafbbe8 100644
    --- a/jdk/makefiles/CopyFiles.gmk
    +++ b/jdk/makefiles/CopyFiles.gmk
    @@ -215,39 +215,37 @@ COPY_FILES += $(ICCPROFILE_TARGET_FILES)
     
     ##########################################################################################
     
    -# make sure freetype dll will be available at runtime as well as link time
    -#
    -# NB: Default freetype build system uses -h linker option and
    -# result .so contains hardcoded library name that is later
    -# used for adding dependencies to other objects
    -# (e.g. libfontmanager.so).
    -#
    -# It is not obvious how to extract that hardcoded name (libfreetype.so.6)
    -# without overcomplicating logic here.
    -# To workaround this we hardcode .6 suffix for now.
    -#
    -# Note that .so.6 library will not be found by System.loadLibrary()
    -# but fortunately we need to load FreeType library explicitly
    -# on windows only
    -#
    -#TODO: rework this to avoid hardcoding library name in the makefile
    -#
    -ifdef OPENJDK
    +ifneq ($(FREETYPE_BUNDLE_LIB_PATH), )
    +  # We need to bundle the freetype library, so it will be available at runtime as well as link time.
    +  #
    +  # NB: Default freetype build system uses -h linker option and
    +  # result .so contains hardcoded library name that is later
    +  # used for adding dependencies to other objects
    +  # (e.g. libfontmanager.so).
    +  #
    +  # It is not obvious how to extract that hardcoded name (libfreetype.so.6)
    +  # without overcomplicating logic here.
    +  # To workaround this we hardcode .6 suffix for now.
    +  #
    +  # Note that .so.6 library will not be found by System.loadLibrary()
    +  # but fortunately we need to load FreeType library explicitly
    +  # on windows only
    +  #
    +  #TODO: rework this to avoid hardcoding library name in the makefile
    +  #
       ifeq ($(OPENJDK_TARGET_OS), windows)
    -    FREETYPE_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
    +    FREETYPE_TARGET_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
       else
    -    ifeq ($(USING_SYSTEM_FT_LIB), false)
    -      FREETYPE_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
    -    endif
    +    FREETYPE_TARGET_LIB = $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/$(call SHARED_LIBRARY,freetype).6
       endif
     
    -  $(FREETYPE_LIB): $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
    -	$(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
    +  $(FREETYPE_TARGET_LIB): $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
    +	$(CP) $(FREETYPE_BUNDLE_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
             ifeq ($(OPENJDK_BUILD_OS), windows)
     	  $(CHMOD) +rx $@
             endif
     
    -  COPY_FILES += $(FREETYPE_LIB)
    +  COPY_FILES += $(FREETYPE_TARGET_LIB)
     endif
     
     ##########################################################################################
    @@ -354,9 +352,23 @@ COPY_FILES += $(JVMCFG)
     PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-$(OPENJDK_TARGET_OS)
     PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
     
    +ifndef OPENJDK
    +
    +RESTRICTED_PKGS_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/restricted.pkgs
    +RESTRICTED_PKGS := $(shell $(CAT) $(RESTRICTED_PKGS_SRC) | $(TR) "\n" " ")
    +
    +$(PROPS_DST): $(PROPS_SRC)
    +	$(MKDIR) -p $(@D)
    +	$(TOOL_ADDTORESTRICTEDPKGS) $^ $@.tmp $(RESTRICTED_PKGS)
    +	$(MV) $@.tmp $@
    +
    +else
    +
     $(PROPS_DST): $(PROPS_SRC)
     	$(call install-file)
     
    +endif
    +
     COPY_FILES += $(PROPS_DST)
     
     ##########################################################################################
    diff --git a/jdk/makefiles/CopyIntoClasses.gmk b/jdk/makefiles/CopyIntoClasses.gmk
    index 2eb496b2446..ddf5ae8b1e2 100644
    --- a/jdk/makefiles/CopyIntoClasses.gmk
    +++ b/jdk/makefiles/CopyIntoClasses.gmk
    @@ -91,7 +91,7 @@ ifndef OPENJDK
           $(SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED)/icons/JavaCup32.png
     endif
     
    -ifndef OPENJDK
    +ifeq ($(ENABLE_JFR), true)
       JFR_CONFIGURATION_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings
       COPY_FILES += \
           $(JFR_CONFIGURATION_DIR_CLOSED)/jfc.xsd
    diff --git a/jdk/makefiles/CreateJars.gmk b/jdk/makefiles/CreateJars.gmk
    index 05c88da3a25..b3595ab0344 100644
    --- a/jdk/makefiles/CreateJars.gmk
    +++ b/jdk/makefiles/CreateJars.gmk
    @@ -216,11 +216,6 @@ RT_JAR_EXCLUDES += \
         oracle/jrockit/jfr \
         jdk/jfr
     
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  RT_JAR_EXCLUDES += com/sun/nio/sctp \
    -      sun/nio/ch/sctp
    -endif
    -
     # Find all files in the classes dir to use as dependencies. This could be more fine granular.
     ALL_FILES_IN_CLASSES := $(call not-containing, _the., $(filter-out %javac_state, \
         $(call CacheFind, $(JDK_OUTPUTDIR)/classes)))
    @@ -988,8 +983,6 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
           JARINDEX := true))
     endif
     
    -##########################################################################################
    -
     # This file is imported from hotspot in Import.gmk. Copying it into images/lib so that
     # all jars can be found in one place when creating images in Images.gmk. It needs to be
     # done here so that clean targets can be simple and accurate.
    diff --git a/jdk/makefiles/GenerateClasses.gmk b/jdk/makefiles/GenerateClasses.gmk
    index 4c683530652..f4dafc55087 100644
    --- a/jdk/makefiles/GenerateClasses.gmk
    +++ b/jdk/makefiles/GenerateClasses.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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
    @@ -28,12 +28,33 @@ default: all
     include $(SPEC)
     include MakeBase.gmk
     include RMICompilation.gmk
    +include JavaCompilation.gmk
    +include Setup.gmk
     
    -# To ensure the latest stub generator files are picked up from corba repo
    -# when available, we need to run with latest rmic version available.
    -ifneq ($(COMPILE_TYPE), cross)
    -  RMIC := $(FIXPATH) $(JDK_OUTPUTDIR)/bin/rmic
    -endif
    +##########################################################################################
    +
    +RMIC_PKGS := \
    +    sun/rmi/rmic \
    +    sun/tools/asm \
    +    sun/tools/java \
    +    sun/tools/javac \
    +    sun/tools/tree \
    +    sun/tools/util \
    +    #
    +
    +$(eval $(call SetupJavaCompilation,BUILD_BOOTSTRAP_RMIC, \
    +    SETUP := GENERATE_OLDBYTECODE, \
    +    SRC := $(JDK_TOPDIR)/src/share/classes, \
    +    INCLUDES := $(RMIC_PKGS), \
    +    BIN := $(JDK_OUTPUTDIR)/btclasses_rmic, \
    +    COPY := .properties, \
    +    JAVAC_SOURCE_PATH_OVERRIDE := $(addprefix $(JDK_TOPDIR)/src/share/classes/, $(RMIC_PKGS))))
    +
    +##########################################################################################
    +
    +BTRMIC_CP := $(CORBA_OUTPUTDIR)/btjars/btcorba.jar$(PATH_SEP)$(JDK_OUTPUTDIR)/btclasses_rmic$(PATH_SEP)$(BOOTSTRAP_JAVAC_JAR)
    +BTRMIC_ARGS := "-Xbootclasspath/p:$(BTRMIC_CP)" -cp "$(BTRMIC_CP)"
    +RMIC := $(JAVA) $(BTRMIC_ARGS) sun.rmi.rmic.Main
     
     CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
     # NOTE: If the smart javac dependency management is reintroduced, these classes risk
    @@ -91,6 +112,8 @@ GENCLASSES += $(filter %.java, $(RMI_SRC))
     
     ##########################################################################################
     
    +$(RMI_12) $(RMI_11) $(RMI_IIOP) $(RMI_SRC): $(BUILD_BOOTSTRAP_RMIC)
    +
     $(RMIC_GENSRC_DIR)/_the.classes.removed: $(GENCLASSES)
     	$(FIND) $(RMIC_GENSRC_DIR) -name "*.class" $(FIND_DELETE)
     	$(TOUCH) $@
    diff --git a/jdk/makefiles/Images.gmk b/jdk/makefiles/Images.gmk
    index 4626e36edf9..e40cc6d09f2 100644
    --- a/jdk/makefiles/Images.gmk
    +++ b/jdk/makefiles/Images.gmk
    @@ -238,6 +238,11 @@ ifeq ($(OPENJDK_TARGET_OS), linux)
       JDK_LIB_FILES += jexec
     endif
     
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),) # If Linux or Solaris
    +    JDK_LIB_FILES += $(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX) \
    +		     $(LIBRARY_PREFIX)jawt$(SHARED_LIBRARY_SUFFIX)
    +endif
    +
     # Find all files to copy from $(JDK_OUTPUTDIR)/lib
     # Jar files are not expected to be here
     ALL_JDKOUT_LIB_LIST := $(call not-containing,_the., $(filter-out %.jar, \
    diff --git a/jdk/makefiles/Import.gmk b/jdk/makefiles/Import.gmk
    index 8d74196e8a1..50164b9f5d3 100644
    --- a/jdk/makefiles/Import.gmk
    +++ b/jdk/makefiles/Import.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2012, 2013, Oracle and/or its affiliates. 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
    @@ -119,8 +119,13 @@ HOTSPOT_IMPORT_FILES := $(addprefix $(LIBRARY_PREFIX), jvm.* saproc.* jsig.* saw
     $(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE), $(HOTSPOT_IMPORT_FILES)))
     $(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib, $(HOTSPOT_IMPORT_FILES)))
     
    -JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
    -    $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.dSYM) \
    +                      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
    +else
    +    JSIG_DEBUGINFO := $(strip $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.debuginfo) \
    +                      $(wildcard $(HOTSPOT_DIST)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/libjsig.diz) )
    +endif
     
     ifneq ($(OPENJDK_TARGET_OS), windows)
       ifeq ($(JVM_VARIANT_SERVER), true)
    @@ -135,12 +140,14 @@ ifneq ($(OPENJDK_TARGET_OS), windows)
           IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
         endif
       endif
    -  ifeq ($(JVM_VARIANT_MINIMAL1), true)
    -    IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    -    ifneq (, $(JSIG_DEBUGINFO))
    -      IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    +    ifneq ($(OPENJDK_TARGET_OS), macosx)
    +        ifeq ($(JVM_VARIANT_MINIMAL1), true)
    +            IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
    +            ifneq (,$(JSIG_DEBUGINFO))
    +                IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/minimal/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
    +            endif
    +        endif
         endif
    -  endif
     endif
     
     $(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
    @@ -148,6 +155,21 @@ $(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +$(INSTALL_LIBRARIES_HERE)/server/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(LN) -s ../$(@F) $@
    +
    +$(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(RM) $@.tmp $(basename $@).dSYM
    +	$(LN) -s ../$(basename $(@F)).dSYM $(basename $@).dSYM
    +	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).dSYM
    +	$(RM) $(basename $@).dSYM
    +	$(MV) $@.tmp $@
    +else
     $(INSTALL_LIBRARIES_HERE)/server/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
     	$(MKDIR) -p $(@D)
     	$(RM) $@
    @@ -161,12 +183,28 @@ $(INSTALL_LIBRARIES_HERE)/server/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
     	$(RM) $(basename $@).debuginfo
     	$(MV) $@.tmp $@
    +endif
     
     $(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +$(INSTALL_LIBRARIES_HERE)/client/%.dSYM : $(INSTALL_LIBRARIES_HERE)/%.dSYM
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(LN) -s ../$(@F) $@
    +
    +$(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
    +	$(MKDIR) -p $(@D)
    +	$(RM) $@
    +	$(RM) $@.tmp $(basename $@).dSYM
    +	$(LN) -s ../$(basename $(@F)).dSYM $(basename $@).dSYM
    +	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).dSYM
    +	$(RM) $(basename $@).dSYM
    +	$(MV) $@.tmp $@
    +else
     $(INSTALL_LIBRARIES_HERE)/client/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
     	$(MKDIR) -p $(@D)
     	$(RM) $@
    @@ -180,12 +218,14 @@ $(INSTALL_LIBRARIES_HERE)/client/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
     	$(RM) $(basename $@).debuginfo
     	$(MV) $@.tmp $@
    +endif
     
     $(INSTALL_LIBRARIES_HERE)/minimal/%$(SHARED_LIBRARY_SUFFIX): $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
     	$(MKDIR) -p $(@D)
     	$(RM) $@
     	$(LN) -s ../$(@F) $@
     
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
     $(INSTALL_LIBRARIES_HERE)/minimal/%.debuginfo: $(INSTALL_LIBRARIES_HERE)/%.debuginfo
     	$(MKDIR) -p $(@D)
     	$(RM) $@
    @@ -199,6 +239,7 @@ $(INSTALL_LIBRARIES_HERE)/minimal/%.diz: $(INSTALL_LIBRARIES_HERE)/%.diz
     	$(CD) $(@D) && $(ZIP) -q -y $@.tmp $(basename $(@F)).debuginfo
     	$(RM) $(basename $@).debuginfo
     	$(MV) $@.tmp $@
    +endif
     
     ##########################################################################################
     # Unpack the binary distributions of the crypto classes if they exist.
    diff --git a/jdk/makefiles/Setup.gmk b/jdk/makefiles/Setup.gmk
    index f40ded57bcf..b624afb6025 100644
    --- a/jdk/makefiles/Setup.gmk
    +++ b/jdk/makefiles/Setup.gmk
    @@ -29,13 +29,18 @@ DISABLE_WARNINGS := -Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-
     # make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
     JAVAC_WARNINGS := -Xlint:-unchecked,-deprecation,-overrides,classfile,dep-ann,divzero,varargs -Werror
     
    +# Any java code executed during a JDK build to build other parts of the JDK must be 
    +# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this 
    +# purpose must be built with -target PREVIOUS for bootstrapping purposes, which 
    +# requires restricting to language level and api of previous JDK.
    +#
     # The generate old bytecode javac setup uses the new compiler to compile for the
     # boot jdk to generate tools that need to be run with the boot jdk.
    -# Thus we force the target bytecode to 7.
    +# Thus we force the target bytecode to the previous JDK version.
     $(eval $(call SetupJavaCompiler,GENERATE_OLDBYTECODE, \
         JVM := $(JAVA), \
         JAVAC := $(NEW_JAVAC), \
    -    FLAGS := -source 7 -target 7 -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS), \
    +    FLAGS := $(BOOT_JDK_SOURCETARGET) -bootclasspath $(BOOT_RTJAR) $(DISABLE_WARNINGS), \
         SERVER_DIR := $(SJAVAC_SERVER_DIR), \
         SERVER_JVM := $(SJAVAC_SERVER_JAVA)))
     
    diff --git a/jdk/makefiles/Tools.gmk b/jdk/makefiles/Tools.gmk
    index 9dc4af0b24e..49a3c61448a 100644
    --- a/jdk/makefiles/Tools.gmk
    +++ b/jdk/makefiles/Tools.gmk
    @@ -149,10 +149,14 @@ TOOL_CHECKDEPS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap
         -cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
         build.tools.deps.CheckDeps
     
    +TOOL_ADDTORESTRICTEDPKGS=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
    + 	build.tools.addtorestrictedpkgs.AddToRestrictedPkgs
    +
     ##########################################################################################
     
     # Tools needed on solaris because OBJCOPY is broken.
     
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
     $(eval $(call SetupNativeCompilation,ADD_GNU_DEBUGLINK, \
         SRC := $(JDK_TOPDIR)/make/tools/add_gnu_debuglink, \
         LANG := C, \
    @@ -172,3 +176,4 @@ $(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS, \
         OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags, \
         OUTPUT_DIR := $(JDK_OUTPUTDIR)/btbin, \
         PROGRAM := fix_empty_sec_hdr_flags))
    +endif
    diff --git a/jdk/makefiles/gendata/GendataBreakIterator.gmk b/jdk/makefiles/gendata/GendataBreakIterator.gmk
    index b0f6253d2af..1b9eba3bffc 100644
    --- a/jdk/makefiles/gendata/GendataBreakIterator.gmk
    +++ b/jdk/makefiles/gendata/GendataBreakIterator.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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
    @@ -44,17 +44,17 @@ TEXT_SOURCES = $(TEXT_PKG)/BreakIteratorRules.java \
     BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator
     BREAK_ITERATOR_CLASSES = $(BREAK_ITERATOR_DIR)/classes
     
    -# JAVAC_SOURCE_PATH_UGLY_OVERRIDE is set to isolate the compile to just those
    +# JAVAC_SOURCE_PATH_OVERRIDE is set to isolate the compile to just those
     # two files in that directory and not get anything implicit from
    -# surrounding directories which aren't jdk 6 compatible.
    -# Because we are targeting jdk 6, but the surrounding source code is jdk 7. Ugh.
    +# surrounding directories which aren't jdk N-1 compatible.
    +# Because we are targeting jdk N-1, but the surrounding source code is jdk N.
     # These two files should be moved out to a build tool! We have to disable
     # sjavac here as well.
     $(eval $(call SetupJavaCompilation,BUILD_BREAKITERATOR, \
         SETUP := GENERATE_OLDBYTECODE, \
         SRC := $(TEXT_SRCDIR), \
         DISABLE_SJAVAC := true, \
    -    JAVAC_SOURCE_PATH_UGLY_OVERRIDE := $(TEXT_SRCDIR)/$(TEXT_PKG), \
    +    JAVAC_SOURCE_PATH_OVERRIDE := $(TEXT_SRCDIR)/$(TEXT_PKG), \
         INCLUDES := $(TEXT_PKG), \
         INCLUDE_FILES := $(TEXT_SOURCES), \
         BIN := $(BREAK_ITERATOR_CLASSES)))
    diff --git a/jdk/makefiles/jprt.properties b/jdk/makefiles/jprt.properties
    index 7a1b8a25c5e..6dfdf2f248c 100644
    --- a/jdk/makefiles/jprt.properties
    +++ b/jdk/makefiles/jprt.properties
    @@ -33,9 +33,7 @@ jprt.build.flavors=product,fastdebug
     
     # Standard list of jprt build targets for this source tree
     jprt.build.targets= \
    -    solaris_sparc_5.10-{product|fastdebug}, \
         solaris_sparcv9_5.10-{product|fastdebug}, \
    -    solaris_i586_5.10-{product|fastdebug}, \
         solaris_x64_5.10-{product|fastdebug}, \
         linux_i586_2.6-{product|fastdebug}, \
         linux_x64_2.6-{product|fastdebug}, \
    @@ -47,9 +45,7 @@ jprt.my.test.set=${jprt.test.set}
     
     # Standard vm test target
     jprt.vm.default.test.targets= \
    -    solaris_sparc_5.10-product-c1-jvm98, \
         solaris_sparcv9_5.10-product-c2-jvm98, \
    -    solaris_i586_5.10-product-c1-jvm98, \
         solaris_x64_5.10-product-c2-jvm98, \
         linux_i586_2.6-product-{c1|c2}-jvm98, \
         linux_x64_2.6-product-c2-jvm98, \
    @@ -64,117 +60,91 @@ jprt.test.targets=${jprt.vm.${jprt.my.test.set}.test.targets}
     # Default jdk test targets in test/Makefile (no fastdebug & limited c2)
     jprt.make.rule.default.test.targets= \
         \
    -    solaris_sparc_5.10-product-c1-jdk_beans1, \
         solaris_sparcv9_5.10-product-c2-jdk_beans1, \
    -    solaris_i586_5.10-product-c1-jdk_beans1, \
         solaris_x64_5.10-product-c2-jdk_beans1, \
         linux_i586_2.6-product-{c1|c2}-jdk_beans1, \
         linux_x64_2.6-product-c2-jdk_beans1, \
         windows_i586_6.1-product-c1-jdk_beans1, \
         windows_x64_6.1-product-c2-jdk_beans1, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_io, \
         solaris_sparcv9_5.10-product-c2-jdk_io, \
    -    solaris_i586_5.10-product-c1-jdk_io, \
         solaris_x64_5.10-product-c2-jdk_io, \
         linux_i586_2.6-product-{c1|c2}-jdk_io, \
         linux_x64_2.6-product-c2-jdk_io, \
         windows_i586_6.1-product-c1-jdk_io, \
         windows_x64_6.1-product-c2-jdk_io, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_lang, \
         solaris_sparcv9_5.10-product-c2-jdk_lang, \
    -    solaris_i586_5.10-product-c1-jdk_lang, \
         solaris_x64_5.10-product-c2-jdk_lang, \
         linux_i586_2.6-product-{c1|c2}-jdk_lang, \
         linux_x64_2.6-product-c2-jdk_lang, \
         windows_i586_6.1-product-c1-jdk_lang, \
         windows_x64_6.1-product-c2-jdk_lang, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_math, \
         solaris_sparcv9_5.10-product-c2-jdk_math, \
    -    solaris_i586_5.10-product-c1-jdk_math, \
         solaris_x64_5.10-product-c2-jdk_math, \
         linux_i586_2.6-product-{c1|c2}-jdk_math, \
         linux_x64_2.6-product-c2-jdk_math, \
         windows_i586_6.1-product-c1-jdk_math, \
         windows_x64_6.1-product-c2-jdk_math, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_misc, \
         solaris_sparcv9_5.10-product-c2-jdk_misc, \
    -    solaris_i586_5.10-product-c1-jdk_misc, \
         solaris_x64_5.10-product-c2-jdk_misc, \
         linux_i586_2.6-product-{c1|c2}-jdk_misc, \
         linux_x64_2.6-product-c2-jdk_misc, \
         windows_i586_6.1-product-c1-jdk_misc, \
         windows_x64_6.1-product-c2-jdk_misc, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_net, \
         solaris_sparcv9_5.10-product-c2-jdk_net, \
    -    solaris_i586_5.10-product-c1-jdk_net, \
         solaris_x64_5.10-product-c2-jdk_net, \
         linux_i586_2.6-product-{c1|c2}-jdk_net, \
         linux_x64_2.6-product-c2-jdk_net, \
         windows_i586_6.1-product-c1-jdk_net, \
         windows_x64_6.1-product-c2-jdk_net, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_nio1, \
         solaris_sparcv9_5.10-product-c2-jdk_nio1, \
    -    solaris_i586_5.10-product-c1-jdk_nio1, \
         solaris_x64_5.10-product-c2-jdk_nio1, \
         linux_i586_2.6-product-{c1|c2}-jdk_nio1, \
         linux_x64_2.6-product-c2-jdk_nio1, \
         windows_i586_6.1-product-c1-jdk_nio1, \
         windows_x64_6.1-product-c2-jdk_nio1, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_nio2, \
         solaris_sparcv9_5.10-product-c2-jdk_nio2, \
    -    solaris_i586_5.10-product-c1-jdk_nio2, \
         solaris_x64_5.10-product-c2-jdk_nio2, \
         linux_i586_2.6-product-{c1|c2}-jdk_nio2, \
         linux_x64_2.6-product-c2-jdk_nio2, \
         windows_i586_6.1-product-c1-jdk_nio2, \
         windows_x64_6.1-product-c2-jdk_nio2, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_nio3, \
         solaris_sparcv9_5.10-product-c2-jdk_nio3, \
    -    solaris_i586_5.10-product-c1-jdk_nio3, \
         solaris_x64_5.10-product-c2-jdk_nio3, \
         linux_i586_2.6-product-{c1|c2}-jdk_nio3, \
         linux_x64_2.6-product-c2-jdk_nio3, \
         windows_i586_6.1-product-c1-jdk_nio3, \
         windows_x64_6.1-product-c2-jdk_nio3, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_security1, \
         solaris_sparcv9_5.10-product-c2-jdk_security1, \
    -    solaris_i586_5.10-product-c1-jdk_security1, \
         solaris_x64_5.10-product-c2-jdk_security1, \
         linux_i586_2.6-product-{c1|c2}-jdk_security1, \
         linux_x64_2.6-product-c2-jdk_security1, \
         windows_i586_6.1-product-c1-jdk_security1, \
         windows_x64_6.1-product-c2-jdk_security1, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_text, \
         solaris_sparcv9_5.10-product-c2-jdk_text, \
    -    solaris_i586_5.10-product-c1-jdk_text, \
         solaris_x64_5.10-product-c2-jdk_text, \
         linux_i586_2.6-product-{c1|c2}-jdk_text, \
         linux_x64_2.6-product-c2-jdk_text, \
         windows_i586_6.1-product-c1-jdk_text, \
         windows_x64_6.1-product-c2-jdk_text, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_tools1, \
         solaris_sparcv9_5.10-product-c2-jdk_tools1, \
    -    solaris_i586_5.10-product-c1-jdk_tools1, \
         solaris_x64_5.10-product-c2-jdk_tools1, \
         linux_i586_2.6-product-{c1|c2}-jdk_tools1, \
         linux_x64_2.6-product-c2-jdk_tools1, \
         windows_i586_6.1-product-c1-jdk_tools1, \
         windows_x64_6.1-product-c2-jdk_tools1, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_util, \
         solaris_sparcv9_5.10-product-c2-jdk_util, \
    -    solaris_i586_5.10-product-c1-jdk_util, \
         solaris_x64_5.10-product-c2-jdk_util, \
         linux_i586_2.6-product-{c1|c2}-jdk_util, \
         linux_x64_2.6-product-c2-jdk_util, \
    @@ -186,99 +156,77 @@ jprt.make.rule.all.test.targets= \
         \
        ${jprt.make.rule.default.test.targets}, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_awt, \
         solaris_sparcv9_5.10-product-c2-jdk_awt, \
    -    solaris_i586_5.10-product-c1-jdk_awt, \
         solaris_x64_5.10-product-c2-jdk_awt, \
         linux_i586_2.6-product-{c1|c2}-jdk_awt, \
         linux_x64_2.6-product-c2-jdk_awt, \
         windows_i586_6.1-product-c1-jdk_awt, \
         windows_x64_6.1-product-c2-jdk_awt, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_beans2, \
         solaris_sparcv9_5.10-product-c2-jdk_beans2, \
    -    solaris_i586_5.10-product-c1-jdk_beans2, \
         solaris_x64_5.10-product-c2-jdk_beans2, \
         linux_i586_2.6-product-{c1|c2}-jdk_beans2, \
         linux_x64_2.6-product-c2-jdk_beans2, \
         windows_i586_6.1-product-c1-jdk_beans2, \
         windows_x64_6.1-product-c2-jdk_beans2, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_beans3, \
         solaris_sparcv9_5.10-product-c2-jdk_beans3, \
    -    solaris_i586_5.10-product-c1-jdk_beans3, \
         solaris_x64_5.10-product-c2-jdk_beans3, \
         linux_i586_2.6-product-{c1|c2}-jdk_beans3, \
         linux_x64_2.6-product-c2-jdk_beans3, \
         windows_i586_6.1-product-c1-jdk_beans3, \
         windows_x64_6.1-product-c2-jdk_beans3, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_management1, \
         solaris_sparcv9_5.10-product-c2-jdk_management1, \
    -    solaris_i586_5.10-product-c1-jdk_management1, \
         solaris_x64_5.10-product-c2-jdk_management1, \
         linux_i586_2.6-product-{c1|c2}-jdk_management1, \
         linux_x64_2.6-product-c2-jdk_management1, \
         windows_i586_6.1-product-c1-jdk_management1, \
         windows_x64_6.1-product-c2-jdk_management1, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_management2, \
         solaris_sparcv9_5.10-product-c2-jdk_management2, \
    -    solaris_i586_5.10-product-c1-jdk_management2, \
         solaris_x64_5.10-product-c2-jdk_management2, \
         linux_i586_2.6-product-{c1|c2}-jdk_management2, \
         linux_x64_2.6-product-c2-jdk_management2, \
         windows_i586_6.1-product-c1-jdk_management2, \
         windows_x64_6.1-product-c2-jdk_management2, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_rmi, \
         solaris_sparcv9_5.10-product-c2-jdk_rmi, \
    -    solaris_i586_5.10-product-c1-jdk_rmi, \
         solaris_x64_5.10-product-c2-jdk_rmi, \
         linux_i586_2.6-product-{c1|c2}-jdk_rmi, \
         linux_x64_2.6-product-c2-jdk_rmi, \
         windows_i586_6.1-product-c1-jdk_rmi, \
         windows_x64_6.1-product-c2-jdk_rmi, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_security2, \
         solaris_sparcv9_5.10-product-c2-jdk_security2, \
    -    solaris_i586_5.10-product-c1-jdk_security2, \
         solaris_x64_5.10-product-c2-jdk_security2, \
         linux_i586_2.6-product-{c1|c2}-jdk_security2, \
         linux_x64_2.6-product-c2-jdk_security2, \
         windows_i586_6.1-product-c1-jdk_security2, \
         windows_x64_6.1-product-c2-jdk_security2, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_security3, \
         solaris_sparcv9_5.10-product-c2-jdk_security3, \
    -    solaris_i586_5.10-product-c1-jdk_security3, \
         solaris_x64_5.10-product-c2-jdk_security3, \
         linux_i586_2.6-product-{c1|c2}-jdk_security3, \
         linux_x64_2.6-product-c2-jdk_security3, \
         windows_i586_6.1-product-c1-jdk_security3, \
         windows_x64_6.1-product-c2-jdk_security3, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_sound, \
         solaris_sparcv9_5.10-product-c2-jdk_sound, \
    -    solaris_i586_5.10-product-c1-jdk_sound, \
         solaris_x64_5.10-product-c2-jdk_sound, \
         linux_i586_2.6-product-{c1|c2}-jdk_sound, \
         linux_x64_2.6-product-c2-jdk_sound, \
         windows_i586_6.1-product-c1-jdk_sound, \
         windows_x64_6.1-product-c2-jdk_sound, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_swing, \
         solaris_sparcv9_5.10-product-c2-jdk_swing, \
    -    solaris_i586_5.10-product-c1-jdk_swing, \
         solaris_x64_5.10-product-c2-jdk_swing, \
         linux_i586_2.6-product-{c1|c2}-jdk_swing, \
         linux_x64_2.6-product-c2-jdk_swing, \
         windows_i586_6.1-product-c1-jdk_swing, \
         windows_x64_6.1-product-c2-jdk_swing, \
         \
    -    solaris_sparc_5.10-product-c1-jdk_tools2, \
         solaris_sparcv9_5.10-product-c2-jdk_tools2, \
    -    solaris_i586_5.10-product-c1-jdk_tools2, \
         solaris_x64_5.10-product-c2-jdk_tools2, \
         linux_i586_2.6-product-{c1|c2}-jdk_tools2, \
         linux_x64_2.6-product-c2-jdk_tools2, \
    @@ -287,9 +235,7 @@ jprt.make.rule.all.test.targets= \
     
     # JCK test targets in test/Makefile (no fastdebug & limited c2, windows broken)
     jprt.my.jck.test.target.set= \
    -    solaris_sparc_5.10-product-c1-JCK7TESTRULE, \
         solaris_sparcv9_5.10-product-c2-JCK7TESTRULE, \
    -    solaris_i586_5.10-product-c1-JCK7TESTRULE, \
         solaris_x64_5.10-product-c2-JCK7TESTRULE, \
         linux_i586_2.6-product-c1-JCK7TESTRULE, \
         linux_x64_2.6-product-c2-JCK7TESTRULE
    diff --git a/jdk/makefiles/lib/Awt2dLibraries.gmk b/jdk/makefiles/lib/Awt2dLibraries.gmk
    new file mode 100644
    index 00000000000..9d1caa2ba98
    --- /dev/null
    +++ b/jdk/makefiles/lib/Awt2dLibraries.gmk
    @@ -0,0 +1,1527 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +# Openwin is defined on Solaris.
    +OPENWIN_LIB := $(OPENWIN_HOME)/lib
    +
    +WIN_AWT_LIB := $(JDK_OUTPUTDIR)/objs/libawt/awt.lib
    +
    +##########################################################################################
    +
    +BUILD_LIBMLIB_SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib
    +BUILD_LIBMLIB_CFLAGS := -D__USE_J2D_NAMES -D__MEDIALIB_OLD_NAMES \
    +    -I$(BUILD_LIBMLIB_SRC) \
    +    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/medialib
    +
    +BUILD_LIBMLIB_LDLIBS :=
    +BUILD_LIBMLIB_IMAGE_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmlib_image/mapfile-vers
    +
    +BUILD_LIBMLIB_CFLAGS += -DMLIB_NO_LIBSUNMATH
    +
    +ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    +  BUILD_LIBMLIB_CFLAGS += -DMLIB_OS64BIT
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  BUILD_LIBMLIB_LDLIBS += $(LIBM) $(LIBDL)
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE, \
    +    LIBRARY := mlib_image, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(BUILD_LIBMLIB_SRC), \
    +    EXCLUDE_FILES := awt_ImagingLib.c mlib_c_ImageBlendTable.c, \
    +    LANG := C, \
    +    OPTIMIZATION := HIGHEST, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(BUILD_LIBMLIB_CFLAGS), \
    +    MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX := $(BUILD_LIBMLIB_LDLIBS) \
    +        $(LDFLAGS_JDKLIB_SUFFIX), \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=mlib_image.dll" \
    +        -D "JDK_INTERNAL_NAME=mlib_image" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBMLIB_IMAGE): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE)
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
    +
    +  BUILD_LIBMLIB_IMAGE_V_FILES := \
    +      mlib_v_ImageLookUp.c \
    +      mlib_ImageCreate.c \
    +      mlib_ImageAffine.c \
    +      mlib_ImageConvMxN.c \
    +      mlib_ImageConvKernelConvert.c \
    +      mlib_sys.c \
    +      mlib_ImageLookUp_64.c \
    +      mlib_ImageLookUp_Bit.c \
    +      mlib_ImageColorTrue2Index.c \
    +      mlib_c_ImageThresh1_U8.c \
    +      mlib_v_ImageLookUpS16S16Func.c \
    +      mlib_v_ImageLookUpS16S32Func.c \
    +      mlib_v_ImageLookUpS16U16Func.c \
    +      mlib_v_ImageLookUpS16U8Func.c \
    +      mlib_v_ImageLookUpS32S16Func.c \
    +      mlib_v_ImageLookUpS32S32Func.c \
    +      mlib_v_ImageLookUpS32U16Func.c \
    +      mlib_v_ImageLookUpS32U8Func.c \
    +      mlib_v_ImageLookUpSIS16S16Func.c \
    +      mlib_v_ImageLookUpSIS16S32Func.c \
    +      mlib_v_ImageLookUpSIS16U16Func.c \
    +      mlib_v_ImageLookUpSIS16U8Func.c \
    +      mlib_v_ImageLookUpSIS32S16Func.c \
    +      mlib_v_ImageLookUpSIS32S32Func.c \
    +      mlib_v_ImageLookUpSIS32U16Func.c \
    +      mlib_v_ImageLookUpSIS32U8Func.c \
    +      mlib_v_ImageLookUpSIU16S16Func.c \
    +      mlib_v_ImageLookUpSIU16S32Func.c \
    +      mlib_v_ImageLookUpSIU16U16Func.c \
    +      mlib_v_ImageLookUpSIU16U8Func.c \
    +      mlib_v_ImageLookUpSIU8S16Func.c \
    +      mlib_v_ImageLookUpSIU8S32Func.c \
    +      mlib_v_ImageLookUpSIU8U16Func.c \
    +      mlib_v_ImageLookUpSIU8U8Func.c \
    +      mlib_v_ImageLookUpU16S16Func.c \
    +      mlib_v_ImageLookUpU16S32Func.c \
    +      mlib_v_ImageLookUpU16U16Func.c \
    +      mlib_v_ImageLookUpU16U8Func.c \
    +      mlib_v_ImageLookUpU8S16Func.c \
    +      mlib_v_ImageLookUpU8S32Func.c \
    +      mlib_v_ImageLookUpU8U16Func.c \
    +      mlib_v_ImageLookUpU8U8Func.c \
    +      mlib_v_ImageAffineIndex_BC.c \
    +      mlib_v_ImageAffine_BC.c \
    +      mlib_v_ImageAffine_BC_S16.c \
    +      mlib_v_ImageAffine_BC_U16.c \
    +      mlib_v_ImageAffine_BL.c \
    +      mlib_v_ImageAffine_BL_S16.c \
    +      mlib_v_ImageAffine_BL_U16.c \
    +      mlib_v_ImageAffine_NN.c \
    +      mlib_v_ImageFilters.c \
    +      mlib_ImageAffineEdge.c \
    +      mlib_ImageAffine_BC_D64.c \
    +      mlib_ImageAffine_BC_F32.c \
    +      mlib_ImageAffine_BC_S32.c \
    +      mlib_ImageAffine_BL_D64.c \
    +      mlib_ImageAffine_BL_F32.c \
    +      mlib_ImageAffine_BL_S32.c \
    +      mlib_ImageAffine_NN.c \
    +      mlib_ImageAffine_NN_Bit.c \
    +      mlib_ImageFilters.c \
    +      mlib_ImageScanPoly.c \
    +      mlib_ImageConv_8nw.c \
    +      mlib_ImageConv_8ext.c \
    +      mlib_ImageConv_16nw.c \
    +      mlib_ImageConv_16ext.c \
    +      mlib_ImageConv_u16nw.c \
    +      mlib_ImageConv_u16ext.c \
    +      mlib_ImageConv_32nw.c \
    +      mlib_ImageConv_F32nw.c \
    +      mlib_ImageConvMxN_Fp.c \
    +      mlib_ImageConvMxN_ext.c \
    +      mlib_ImageConv_D64nw.c \
    +      mlib_ImageClipping.c \
    +      mlib_ImageConvCopyEdge_Bit.c \
    +      mlib_ImageConvClearEdge_Bit.c \
    +      mlib_ImageConv2x2_f.c \
    +      mlib_ImageConvClearEdge_Fp.c \
    +      mlib_v_ImageConvMxN_8.c \
    +      mlib_v_ImageConvClearEdge.c \
    +      mlib_v_ImageConvCopyEdge.c \
    +      mlib_v_ImageConvMxN_8ext.c \
    +      mlib_v_ImageConvVersion.c \
    +      mlib_v_ImageConv_8nw.c \
    +      mlib_ImageConvCopyEdge_Fp.c \
    +      mlib_v_ImageChannelInsert_1.c \
    +      mlib_v_ImageChannelExtract_43.c \
    +      mlib_v_ImageChannelExtract_1.c \
    +      mlib_ImageCopy_Bit.c \
    +      mlib_v_ImageCopy_f.c \
    +      mlib_ImageUtils.c \
    +      mlib_ImageDivTables.c
    +
    +  BUILD_LIBMLIB_V_CFLAGS := $(filter-out -DMLIB_NO_LIBSUNMATH, $(BUILD_LIBMLIB_CFLAGS))
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBMLIB_IMAGE_V, \
    +      LIBRARY := mlib_image_v, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    +          $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib, \
    +      LANG := C, \
    +      INCLUDE_FILES := $(BUILD_LIBMLIB_IMAGE_V_FILES), \
    +      OPTIMIZATION := HIGHEST, \
    +      CFLAGS := -xarch=sparcvis \
    +          $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il \
    +          $(BUILD_LIBMLIB_V_CFLAGS) \
    +          $(CFLAGS_JDKLIB), \
    +      MAPFILE := $(BUILD_LIBMLIB_IMAGE_MAPFILE), \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(BUILD_LIBMLIB_LDLIBS) -ljava -ljvm \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX_solaris := -lc, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmlib_image_v, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBMLIB_IMAGE_V): $(BUILD_LIBJAVA)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBMLIB_IMAGE_V)
    +
    +endif
    +
    +##########################################################################################
    +
    +LIBAWT_DIRS := \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/image \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/image/gif \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/medialib \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    +    $(JDK_TOPDIR)/src/share/native/sun/java2d \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    +    $(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    +    $(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/image \
    +    $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    +    $(JDK_TOPDIR)/src/share/native/sun/font
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBAWT_DIRS += \
    +      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    +      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows \
    +      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/d3d
    +else
    +  LIBAWT_DIRS += \
    +      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11
    +endif
    +
    +LIBAWT_CFLAGS += -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES \
    +    $(X_CFLAGS) \
    +    $(foreach dir, $(LIBAWT_DIRS), -I$(dir))
    +
    +LIBAWT_FILES := \
    +    gifdecoder.c \
    +    imageInitIDs.c \
    +    img_globals.c \
    +    SurfaceData.c \
    +    Region.c \
    +    BufImgSurfaceData.c \
    +    Disposer.c \
    +    Trace.c \
    +    GraphicsPrimitiveMgr.c \
    +    Blit.c \
    +    BlitBg.c \
    +    ScaledBlit.c \
    +    FillRect.c \
    +    FillSpans.c \
    +    FillParallelogram.c \
    +    DrawParallelogram.c \
    +    DrawLine.c \
    +    DrawRect.c \
    +    DrawPolygons.c \
    +    DrawPath.c \
    +    FillPath.c \
    +    ProcessPath.c \
    +    MaskBlit.c \
    +    MaskFill.c \
    +    TransformHelper.c \
    +    AlphaMath.c \
    +    AlphaMacros.c \
    +    AnyByte.c \
    +    ByteBinary1Bit.c \
    +    ByteBinary2Bit.c \
    +    ByteBinary4Bit.c \
    +    ByteIndexed.c \
    +    ByteGray.c \
    +    Index8Gray.c \
    +    Index12Gray.c \
    +    AnyShort.c \
    +    Ushort555Rgb.c \
    +    Ushort565Rgb.c \
    +    Ushort4444Argb.c \
    +    Ushort555Rgbx.c \
    +    UshortGray.c \
    +    UshortIndexed.c \
    +    Any3Byte.c \
    +    ThreeByteBgr.c \
    +    AnyInt.c \
    +    IntArgb.c \
    +    IntArgbPre.c \
    +    IntArgbBm.c \
    +    IntRgb.c \
    +    IntBgr.c \
    +    IntRgbx.c \
    +    Any4Byte.c \
    +    FourByteAbgr.c \
    +    FourByteAbgrPre.c \
    +    BufferedMaskBlit.c \
    +    BufferedRenderPipe.c \
    +    ShapeSpanIterator.c \
    +    SpanClipRenderer.c \
    +    awt_ImageRep.c \
    +    awt_ImagingLib.c \
    +    awt_Mlib.c \
    +    awt_parseImage.c \
    +    DataBufferNative.c \
    +    dither.c \
    +    debug_assert.c \
    +    debug_mem.c \
    +    debug_trace.c \
    +    debug_util.c
    +
    +ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris linux))
    +  LIBAWT_FILES += awt_LoadLibrary.c initIDs.c img_colors.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBAWT_FILES += awt_LoadLibrary.c img_colors.c
    +  LIBAWT_CFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc)
    +  LIBAWT_CFLAGS += -DMLIB_ADD_SUFF
    +  LIBAWT_CFLAGS += -xarch=sparcvis
    +  LIBAWT_CFLAGS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib/vis_$(OPENJDK_TARGET_CPU_BITS).il
    +  LIBAWT_CFLAGS += \
    +      -I$(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
    +      -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/medialib \
    +      -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
    +
    +  LIBAWT_DIRS += $(JDK_TOPDIR)/src/solaris/native/sun/awt/medialib \
    +      $(JDK_TOPDIR)/src/solaris/native/sun/java2d/loops
    +
    +  LIBAWT_FILES += \
    +      vis_FuncArray.c \
    +      java2d_Mlib.c \
    +      mlib_ImageCreate.c \
    +      mlib_ImageZoom_NN.c \
    +      mlib_ImageCopy_Bit.c \
    +      mlib_sys.c \
    +      mlib_v_ImageClear.c \
    +      mlib_v_ImageClear_f.c \
    +      mlib_v_ImageConstXor.c \
    +      mlib_v_ImageCopy.c \
    +      mlib_v_ImageCopy_f.c \
    +      mlib_v_ImageXor.c \
    +      mlib_v_ImageZoom_NN_f.c \
    +      vis_Interp.c \
    +      vis_AlphaMacros.c \
    +      vis_AlphaMaskBlit.c \
    +      vis_AlphaMaskFill.c \
    +      vis_ByteGray.c \
    +      vis_ByteGray_FromRgb.c \
    +      vis_ByteGray_Mask.c \
    +      vis_ByteIndexed.c \
    +      vis_DrawLine.c \
    +      vis_FourByteAbgr.c \
    +      vis_IntArgb.c \
    +      vis_IntArgbPre.c \
    +      vis_IntArgbPre_Mask.c \
    +      vis_IntBgr.c \
    +      vis_IntRgb.c \
    +      vis_IntRgbx.c \
    +      vis_SrcMaskFill.c \
    +      vis_SrcOverMaskBlit.c \
    +      vis_SrcOverMaskFill.c \
    +      vis_FourByteAbgrPre.c \
    +      vis_GlyphList.c \
    +      vis_GlyphListXor.c \
    +      vis_IntArgbBm.c \
    +      vis_ThreeByteBgr.c \
    +      vis_UshortGray.c \
    +      vis_UshortGray_FromRgb.c \
    +      vis_XorBlit.c \
    +      mlib_v_ImageCopy_blk.s
    +
    +  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    +    LIBAWT_ASFLAGS = -P -xarch=v9a
    +  else
    +    LIBAWT_ASFLAGS = -P -xarch=v8plusa
    +  endif
    +else
    +  LIBAWT_FILES += MapAccelFunc.c
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), solaris)
    +  LIBAWT_CFLAGS += -DMLIB_NO_LIBSUNMATH
    +endif
    +
    +LIBAWT_LANG := C
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBAWT_FILES += AccelGlyphCache.c \
    +      ShaderList.c \
    +      CmdIDList.cpp \
    +      Hashtable.cpp \
    +      GDIHashtable.cpp \
    +      Devices.cpp \
    +      ObjectList.cpp \
    +      GDIBlitLoops.cpp \
    +      GDIRenderer.cpp \
    +      GDIWindowSurfaceData.cpp \
    +      WindowsFlags.cpp \
    +      WPrinterJob.cpp \
    +      awt_%.cpp \
    +      D3DBlitLoops.cpp \
    +      D3DBufImgOps.cpp \
    +      D3DContext.cpp \
    +      D3DGlyphCache.cpp \
    +      D3DGraphicsDevice.cpp \
    +      D3DMaskBlit.cpp \
    +      D3DMaskCache.cpp \
    +      D3DMaskFill.cpp \
    +      D3DPipelineManager.cpp \
    +      D3DPaints.cpp \
    +      D3DRenderer.cpp \
    +      D3DRenderQueue.cpp \
    +      D3DResourceManager.cpp \
    +      D3DSurfaceData.cpp \
    +      D3DTextRenderer.cpp \
    +      D3DVertexCacher.cpp \
    +      ShellFolder2.cpp \
    +      ThemeReader.cpp \
    +      ComCtl32Util.cpp \
    +      DllUtil.cpp \
    +      initIDs.cpp \
    +      MouseInfo.cpp \
    +      rect.c \
    +      OGLBlitLoops.c \
    +      OGLBufImgOps.c \
    +      OGLContext.c \
    +      OGLFuncs.c \
    +      OGLMaskBlit.c \
    +      OGLMaskFill.c \
    +      OGLPaints.c \
    +      OGLRenderQueue.c \
    +      OGLRenderer.c \
    +      OGLSurfaceData.c \
    +      OGLTextRenderer.c \
    +      OGLVertexCache.c \
    +      WGLGraphicsConfig.c \
    +      WGLSurfaceData.c
    +
    +  LIBAWT_LANG := C++
    +  LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE
    +  ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    +    LIBAWT_CFLAGS += -DMLIB_OS64BIT
    +  endif
    +
    +  ifdef OPENJDK
    +    LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/windows/resource/icons"
    +  else
    +    LIBAWT_RC_FLAGS := -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
    +  endif
    +  LIBAWT_VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/native/sun/windows/awt.rc
    +endif
    +
    +ifeq ($(MILESTONE), internal)
    +  LIBAWT_CFLAGS += -DINTERNAL_BUILD
    +endif
    +
    +LIBAWT_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt/mapfile-vers
    +ifeq ($(OPENJDK_TARGET_OS), linux)
    +  LIBAWT_MAPFILE :=
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBAWT, \
    +    LIBRARY := awt, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(LIBAWT_DIRS), \
    +    INCLUDE_FILES := $(LIBAWT_FILES), \
    +    LANG := $(LIBAWT_LANG), \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_CFLAGS), \
    +    ASFLAGS := $(LIBAWT_ASFLAGS), \
    +    MAPFILE := $(LIBAWT_MAPFILE), \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_solaris := -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    +    LDFLAGS_SUFFIX_linux := -ljvm $(LIBM) $(LIBDL) -ljava, \
    +    LDFLAGS_SUFFIX_solaris := -ljvm $(LIBM) $(LIBDL) -ljava -lc, \
    +    LDFLAGS_SUFFIX_macosx := -lmlib_image -ljvm $(LIBM) \
    +        -framework Cocoa \
    +        -framework OpenGL \
    +        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +        -framework JavaNativeFoundation \
    +        -framework JavaRuntimeSupport \
    +        -framework ApplicationServices \
    +        -framework AudioToolbox \
    +        -ljava, \
    +    LDFLAGS_SUFFIX_windows := kernel32.lib user32.lib gdi32.lib winspool.lib \
    +        imm32.lib ole32.lib uuid.lib shell32.lib \
    +        comdlg32.lib winmm.lib comctl32.lib shlwapi.lib \
    +        delayimp.lib jvm.lib $(WIN_JAVA_LIB) advapi32.lib \
    +        -DELAYLOAD:user32.dll -DELAYLOAD:gdi32.dll \
    +        -DELAYLOAD:shell32.dll -DELAYLOAD:winmm.dll \
    +        -DELAYLOAD:winspool.drv -DELAYLOAD:imm32.dll \
    +        -DELAYLOAD:ole32.dll -DELAYLOAD:comdlg32.dll \
    +        -DELAYLOAD:comctl32.dll -DELAYLOAD:shlwapi.dll, \
    +    VERSIONINFO_RESOURCE := $(LIBAWT_VERSIONINFO_RESOURCE), \
    +    RC_FLAGS := $(RC_FLAGS) $(LIBAWT_RC_FLAGS) \
    +        -D "JDK_FNAME=awt.dll" \
    +        -D "JDK_INTERNAL_NAME=awt" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBAWT): $(BUILD_LIBJAVA)
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  $(BUILD_LIBAWT): $(BUILD_LIBMLIB_IMAGE)
    +endif
    +
    +BUILD_LIBRARIES += $(BUILD_LIBAWT)
    +
    +##########################################################################################
    +
    +# TODO!!
    +# Even though this variable as a general name, it is
    +# only used on macos, in fontpath.c, as prefix for where to find fonts.
    +#
    +# It's used for libawt_headless _and_ libawt_xawt
    +#
    +X11_PATH := /usr/X11R6
    +
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  ifndef BUILD_HEADLESS_ONLY
    +
    +    LIBAWT_XAWT_DIRS := \
    +        $(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +        $(JDK_TOPDIR)/src/share/native/sun/awt/utility \
    +        $(JDK_TOPDIR)/src/share/native/sun/font \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
    +        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/opengl \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/x11 \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/xawt \
    +
    +    LIBAWT_XAWT_CFLAGS := -DXAWT -DXAWT_HACK \
    +        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
    +        $(CUPS_CFLAGS) \
    +        $(foreach dir, $(LIBAWT_XAWT_DIRS), -I$(dir)) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga
    +
    +    ifeq ($(OPENJDK_TARGET_OS), solaris)
    +      LIBAWT_XAWT_CFLAGS += -DFUNCPROTO=15
    +    endif
    +
    +    ifeq ($(OPENJDK_TARGET_OS), linux)
    +      ifndef OPENJDK
    +        include $(JDK_TOPDIR)/make/closed/xawt.gmk
    +      endif
    +
    +      ifeq ($(DISABLE_XRENDER), true)
    +        LIBAWT_XAWT_CFLAGS += -DDISABLE_XRENDER_BY_DEFAULT=true
    +      endif
    +    endif
    +
    +    ifeq ($(MILESTONE), internal)
    +      LIBAWT_XAWT_CFLAGS += -DINTERNAL_BUILD
    +    endif
    +
    +    LIBAWT_XAWT_FILES := \
    +        XlibWrapper.c \
    +        XWindow.c \
    +        XToolkit.c \
    +        X11Color.c \
    +        X11SurfaceData.c \
    +        awt_GraphicsEnv.c \
    +        awt_InputMethod.c \
    +        robot_common.c \
    +        awt_Robot.c \
    +        list.c \
    +        multiVis.c \
    +        initIDs.c \
    +        awt_util.c \
    +        awt_Desktop.c \
    +        awt_UNIXToolkit.c \
    +        X11FontScaler_md.c \
    +        X11TextRenderer_md.c \
    +        fontpath.c \
    +        awt_Insets.c \
    +        awt_Event.c \
    +        X11Renderer.c \
    +        X11PMBlitLoops.c \
    +        OGLBlitLoops.c \
    +        OGLBufImgOps.c \
    +        OGLContext.c \
    +        OGLFuncs.c \
    +        OGLMaskBlit.c \
    +        OGLMaskFill.c \
    +        OGLPaints.c \
    +        OGLRenderQueue.c \
    +        OGLRenderer.c \
    +        OGLSurfaceData.c \
    +        OGLTextRenderer.c \
    +        OGLVertexCache.c \
    +        GLXGraphicsConfig.c \
    +        GLXSurfaceData.c \
    +        AccelGlyphCache.c \
    +        awt_Font.c \
    +        multi_font.c \
    +        awt_AWTEvent.c \
    +        awt_DrawingSurface.c \
    +        jawt.c \
    +        CUPSfuncs.c \
    +        debug_assert.c \
    +        debug_mem.c \
    +        debug_trace.c \
    +        debug_util.c \
    +        awt_Plugin.c \
    +        gnome_interface.c \
    +        gtk2_interface.c \
    +        swing_GTKEngine.c \
    +        swing_GTKStyle.c \
    +        rect.c \
    +        sun_awt_X11_GtkFileDialogPeer.c \
    +        XRSurfaceData.c \
    +        XRBackendNative.c
    +
    +    LIBAWT_XAWT_LDFLAGS_SUFFIX := $(LIBM) -lawt -lXext -lX11 -lXrender $(LIBDL) -lXtst -lXi -ljava -ljvm -lc
    +
    +    ifeq ($(OPENJDK_TARGET_OS), linux)
    +      # To match old build, add this to LDFLAGS instead of suffix.
    +      LIBAWT_XAWT_LDFLAGS += -lpthread
    +    endif
    +
    +    ifeq ($(OPENJDK_TARGET_OS), macosx)
    +      LIBAWT_XAWT_LDFLAGS_SUFFIX += -lpthread
    +    endif
    +
    +    # On macosx, the shared library origin is set twice for this lib.
    +    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_XAWT, \
    +        LIBRARY := awt_xawt, \
    +        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +        SRC := $(LIBAWT_XAWT_DIRS), \
    +        INCLUDE_FILES := $(LIBAWT_XAWT_FILES), \
    +        LANG := C, \
    +        OPTIMIZATION := LOW, \
    +        CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_XAWT_CFLAGS) \
    +            $(X_CFLAGS), \
    +        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_xawt/mapfile-vers, \
    +        LDFLAGS := $(LDFLAGS_JDKLIB) \
    +            $(X_LIBS) $(LIBAWT_XAWT_LDFLAGS), \
    +        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    +        LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    +            -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
    +            -R$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    +            -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) \
    +            -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    +        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN). \
    +            $(call SET_SHARED_LIBRARY_ORIGIN) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN)., \
    +        LDFLAGS_SUFFIX := $(LIBAWT_XAWT_LDFLAGS_SUFFIX), \
    +        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +        RC_FLAGS := $(RC_FLAGS) \
    +            -D "JDK_FNAME=xawt.dll" \
    +            -D "JDK_INTERNAL_NAME=xawt" \
    +            -D "JDK_FTYPE=0x2L", \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_xawt, \
    +        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBJAVA)
    +
    +    $(BUILD_LIBAWT_XAWT): $(BUILD_LIBAWT)
    +
    +    BUILD_LIBRARIES += $(BUILD_LIBAWT_XAWT)
    +
    +  endif
    +endif
    +
    +##########################################################################################
    +
    +# TODO: Update awt lib path when awt is converted
    +$(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \
    +    LIBRARY := lcms, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/sun/java2d/cmm/lcms, \
    +    LANG := C, \
    +    OPTIMIZATION := HIGHEST, \
    +    CFLAGS := $(filter-out -xc99=%none, $(CFLAGS_JDKLIB)) \
    +        $(SHARED_LIBRARY_FLAGS) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug, \
    +    CFLAGS_solaris := -xc99=no_lib, \
    +    CFLAGS_windows := -DCMS_IS_WINDOWS_, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/liblcms/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_solaris := /usr/lib$(OPENJDK_TARGET_CPU_ISADIR)/libm.so.2, \
    +    LDFLAGS_windows := $(WIN_AWT_LIB) $(WIN_JAVA_LIB), \
    +    LDFLAGS_SUFFIX_solaris := -lawt -ljava -ljvm -lc, \
    +    LDFLAGS_SUFFIX_macosx := $(LIBM) -lawt -ljava -ljvm, \
    +    LDFLAGS_SUFFIX_linux := -lm -lawt -ljava -ljvm, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=lcms.dll" \
    +        -D "JDK_INTERNAL_NAME=lcms" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/liblcms, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBLCMS)
    +
    +$(BUILD_LIBLCMS): $(BUILD_LIBAWT)
    +
    +##########################################################################################
    +
    +ifdef OPENJDK
    +  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers
    +else
    +  BUILD_LIBJPEG_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/mapfile-vers-closed
    +  BUILD_LIBJPEG_CLOSED_SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/awt/image/jpeg
    +  BUILD_LIBJPEG_CLOSED_INCLUDES := -I$(BUILD_LIBJPEG_CLOSED_SRC)
    +endif
    +
    +BUILD_LIBJPEG_REORDER :=
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    +    BUILD_LIBJPEG_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjpeg/reorder-$(OPENJDK_TARGET_CPU)
    +  endif
    +endif
    +
    +# Suppress gcc warnings like "variable might be clobbered by 'longjmp'
    +# or 'vfork'": this warning indicates that some variable is placed to
    +# a register by optimized compiler and it's value might be lost on longjmp().
    +# Recommended way to avoid such warning is to declare the variable as
    +# volatile to prevent the optimization. However, this approach does not
    +# work because we have to declare all variables as volatile in result.
    +#ifndef CROSS_COMPILE_ARCH
    +#  CC_43_OR_NEWER := \
    +#      $(shell $(EXPR) $(CC_MAJORVER) \> 4 \| \
    +#          \( $(CC_MAJORVER) = 4 \& $(CC_MINORVER) \>= 3 \) )
    +#  ifeq ($(CC_43_OR_NEWER), 1)
    +#    BUILD_LIBJPEG_CFLAGS_linux += -Wno-clobbered
    +#  endif
    +#endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJPEG, \
    +    LIBRARY := jpeg, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(BUILD_LIBJPEG_CLOSED_SRC) \
    +        $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
    +    LANG := C, \
    +    OPTIMIZATION := HIGHEST, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(BUILD_LIBJPEG_CLOSED_INCLUDES) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg, \
    +    MAPFILE := $(BUILD_LIBJPEG_MAPFILE), \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_windows := $(WIN_JAVA_LIB) jvm.lib, \
    +    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=jpeg.dll" \
    +        -D "JDK_INTERNAL_NAME=jpeg" \
    +        -D "JDK_FTYPE=0x2L", \
    +    REORDER := $(BUILD_LIBJPEG_REORDER), \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjpeg, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBJPEG): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJPEG)
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +  FONT_HEADERS := -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k
    +  BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers
    +  LIBFONTMANAGER_EXCLUDE_FILES += freetypeScaler.c
    +else
    +  FONT_HEADERS := $(FREETYPE_CFLAGS)
    +  BUILD_LIBFONTMANAGER_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libfontmanager/mapfile-vers.openjdk
    +  BUILD_LIBFONTMANAGER_FONTLIB := $(FREETYPE_LIBS)
    +endif
    +
    +LIBFONTMANAGER_OPTIMIZATION := HIGH
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBFONTMANAGER_EXCLUDE_FILES += X11FontScaler.c \
    +      X11TextRenderer.c
    +  LIBFONTMANAGER_OPTIMIZATION := HIGHEST
    +else
    +  LIBFONTMANAGER_EXCLUDE_FILES += fontpath.c \
    +      lcdglyph.c
    +endif
    +
    +BUILD_LIBFONTMANAGER_CFLAGS_COMMON := \
    +    $(X_CFLAGS) \
    +    -DLE_STANDALONE -DHEADLESS \
    +    $(FONT_HEADERS) \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/font \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/font/layout \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    +    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    +    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/java2d
    +
    +# Turn off aliasing with GCC for ExtensionSubtables.cpp
    +ifeq ($(OPENJDK_TARGET_OS), linux)
    +  BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
    +    LIBRARY := fontmanager, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/sun/font \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font, \
    +    EXCLUDE_FILES := $(LIBFONTMANAGER_EXCLUDE_FILES) \
    +        AccelGlyphCache.c, \
    +    LANG := C++, \
    +    CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
    +    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBFONTMANAGER_CFLAGS_COMMON), \
    +    OPTIMIZATION := $(LIBFONTMANAGER_OPTIMIZATION), \
    +    CFLAGS_windows = -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    +        -DCC_NOEX, \
    +    MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
    +    LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
    +    LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
    +    LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
    +    LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
    +        -ljava -ljvm, \
    +    LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
    +        $(WIN_AWT_LIB), \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=fontmanager.dll" \
    +        -D "JDK_INTERNAL_NAME=fontmanager" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfontmanager, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
    +
    +ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris macosx))
    +  $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
    +endif
    +
    +BUILD_LIBRARIES += $(BUILD_LIBFONTMANAGER)
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +
    +  #ifeq ($(OPENJDK_TARGET_OS), linux)
    +  #  ifeq ("$(CC_VER_MAJOR)", "3")
    +  #    OTHER_LDLIBS += -Wl,-Bstatic -lgcc_eh -Wl,-Bdynamic
    +  #  endif
    +  #endif
    +  #
    +  # The resulting size of the t2k lib file is (at least on linux) dependant on the order of
    +  # the input .o files. Because of this the new build will differ in size to the old build.
    +  BUILD_LIBT2K_CFLAGS_COMMON := -I$(JDK_TOPDIR)/src/share/native/sun/font \
    +      -I$(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
    +      -I$(JDK_TOPDIR)/src/closed/share/native/sun/font \
    +      -I$(JDK_TOPDIR)/src/share/share/native/sun/font \
    +      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/font \
    +      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    +      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    +      -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    +      -I$(JDK_TOPDIR)/src/share/native/sun/java2d
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBT2K, \
    +      LIBRARY := t2k, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/font \
    +          $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k \
    +          $(JDK_TOPDIR)/src/closed/share/native/sun/font/t2k/ttHints, \
    +      EXCLUDE_FILES := orion.c, \
    +      LANG := C++, \
    +      OPTIMIZATION := HIGH, \
    +      CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
    +      CXXFLAGS := $(CXXFLAGS_JDKLIB) $(BUILD_LIBT2K_CFLAGS_COMMON), \
    +      CFLAGS_windows = -DCC_NOEX, \
    +      CXXFLAGS_windows = -DCC_NOEX, \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libt2k/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_windows := user32.lib $(JDK_OUTPUTDIR)/objs/libfontmanager/fontmanager.lib, \
    +      LDFLAGS_SUFFIX_posix := $(LIBM) $(LIBCXX) -lfontmanager -ljava -ljvm -lc, \
    +      LDFLAGS_SUFFIX_solaris := -lawt -lawt_xawt, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=t2k.dll" \
    +          -D "JDK_INTERNAL_NAME=t2k" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libt2k, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  # t2k is linked against fontmanager
    +  $(BUILD_LIBT2K): $(BUILD_LIBFONTMANAGER)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBT2K)
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  ifeq ($(OPENJDK_TARGET_CPU), x86)
    +    KERNEL32_LIB := kernel32.lib
    +  endif
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
    +      LIBRARY := jawt, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows, \
    +      INCLUDE_FILES := jawt.cpp, \
    +      LANG := C++, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CXXFLAGS_JDKLIB) \
    +          -EHsc -DUNICODE -D_UNICODE \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/windows \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d/windows, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) $(KERNEL32_LIB) $(LDFLAGS_CXX_JDK) \
    +          advapi32.lib $(WIN_AWT_LIB), \
    +      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=jawt.dll" \
    +          -D "JDK_INTERNAL_NAME=jawt" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBJAWT): $(BUILD_LIBAWT)
    +
    +  $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX): $(BUILD_LIBJAWT)
    +	$(ECHO) Copying $(@F)
    +	$(CP) $(JDK_OUTPUTDIR)/objs/libjawt/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX) $@
    +
    +  BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
    +
    +else # OPENJDK_TARGET_OS not windows
    +
    +  JAWT_LIBS :=
    +  ifneq ($(OPENJDK_TARGET_OS), solaris)
    +    JAWT_LIBS += -lawt
    +  endif
    +
    +  ifndef BUILD_HEADLESS_ONLY
    +    JAWT_LIBS += -lawt_xawt
    +  else
    +    JAWT_LIBS += -lawt_headless
    +    HEADLESS_CFLAG += -DHEADLESS
    +  endif
    +
    +  JAWT_FILES := jawt.c
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    JAWT_FILES := jawt.m
    +    JAWT_LIBS := -lawt_lwawt
    +  endif
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJAWT, \
    +      LIBRARY := jawt, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt \
    +          $(JDK_TOPDIR)/src/macosx/native/sun/awt, \
    +      INCLUDE_FILES := $(JAWT_FILES), \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB), \
    +      CFLAGS_linux := $(HEADLESS_CFLAG), \
    +      CFLAGS_macosx := -I$(JDK_TOPDIR)/src/solaris/native/sun/awt, \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjawt/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_solaris := -L$(OPENWIN_HOME)/sfw/lib$(OPENJDK_TARGET_CPU_ISADIR) -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    +      LDFLAGS_SUFFIX_linux := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX), \
    +      LDFLAGS_SUFFIX_solaris := $(JAWT_LIBS) $(LDFLAGS_JDKLIB_SUFFIX) -lXrender, \
    +      LDFLAGS_SUFFIX_macosx := -Xlinker -rpath -Xlinker @loader_path $(JAWT_LIBS) \
    +          -framework Cocoa $(LDFLAGS_JDKLIB_SUFFIX), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawt, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  ifndef BUILD_HEADLESS_ONLY
    +    $(BUILD_LIBJAWT): $(BUILD_LIBAWT_XAWT)
    +  else
    +    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_headless$(SHARED_LIBRARY_SUFFIX)
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    $(BUILD_LIBJAWT): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)awt_lwawt$(SHARED_LIBRARY_SUFFIX)
    +  endif
    +
    +endif # OPENJDK_TARGET_OS
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJAWT)
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +
    +  BUILD_LIBKCMS_EXCLUDE_FILES :=
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    BUILD_LIBKCMS_EXCLUDE_FILES += ukcpmgr.c unixmem.c
    +  else
    +    BUILD_LIBKCMS_EXCLUDE_FILES += cmmdll.c registry.c spxffile.c sysinfo.c winmem.c wkcpmgr.c
    +  endif
    +
    +  BUILD_LIBKCMS_FLAGS := $(CFLAGS_JDKLIB)
    +
    +  ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    # This particular library uses a feature called PIC_CODE_SMALL (on solaris)
    +    # implement it like this...since it's only used here
    +    BUILD_LIBKCMS_FLAGS := $(patsubst -KPIC, -Kpic, $(BUILD_LIBKCMS_FLAGS))
    +  else ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    +    BUILD_LIBKCMS_FLAGS := $(patsubst -fPIC, -fpic, $(BUILD_LIBKCMS_FLAGS))
    +  endif
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBKCMS, \
    +      LIBRARY := kcms, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms, \
    +      LANG := C, \
    +      EXCLUDE_FILES := $(BUILD_LIBKCMS_EXCLUDE_FILES), \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(BUILD_LIBKCMS_FLAGS) \
    +          -DJAVACMM -DFUT_CALC_EX -DNO_FUT_GCONST, \
    +      CFLAGS_linux := -Wno-missing-field-initializers, \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libkcms/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX_linux := -lc -lpthread, \
    +      LDFLAGS_SUFFIX_solaris := -lc, \
    +      LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib version.lib, \
    +      LDFLAGS_SUFFIX_posix := -lm -ljava -ljvm, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/closed/share/native/sun/java2d/cmm/kcms/cmm.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=kcms.dll" \
    +          -D "JDK_INTERNAL_NAME=kcms" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkcms, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBKCMS): $(BUILD_LIBJAVA)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBKCMS)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +  ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    +
    +      ifeq ($(shell if test "$(OS_VERSION_MAJOR)" -eq 5 -a "$(OS_VERSION_MINOR)" -le 10; then $(ECHO) ok; fi), ok)
    +
    +        SUNWJDGA_MAPFILE :=
    +        ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    +          SUNWJDGA_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdga/mapfile-vers
    +        endif
    +
    +        $(eval $(call SetupNativeCompilation,BUILD_LIBSUNWJDGA, \
    +            LIBRARY := sunwjdga, \
    +            OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +            SRC := $(JDK_TOPDIR)/src/solaris/native/sun/jdga, \
    +            LANG := C, \
    +            OPTIMIZATION := LOW, \
    +            CFLAGS := $(CFLAGS_JDKLIB) \
    +                -I$(JDK_TOPDIR)/src/share/javavm/export \
    +                -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/javavm/export \
    +                -I$(OPENWIN_HOME)/include, \
    +            MAPFILE := $(SUNWJDGA_MAPFILE), \
    +            LDFLAGS := $(LDFLAGS_JDKLIB) \
    +                $(call SET_SHARED_LIBRARY_ORIGIN), \
    +            LDFLAGS_SUFFIX := -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -ldga -lX11 $(LIBDL) -lc, \
    +            OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunwjdga, \
    +            DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +        BUILD_LIBRARIES += $(BUILD_LIBSUNWJDGA)
    +
    +      endif
    +    endif
    +  endif
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(BUILD_HEADLESS), true)
    +  ifneq ($(OPENJDK_TARGET_OS), windows)
    +
    +    LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/share/native/sun/font \
    +        $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    +        $(JDK_TOPDIR)/src/solaris/native/sun/font \
    +        $(JDK_TOPDIR)/src/solaris/native/sun/awt \
    +        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/opengl \
    +        $(JDK_TOPDIR)/src/solaris/native/sun/java2d/x11
    +
    +    ifeq ($(OPENJDK_TARGET_OS), macosx)
    +      LIBAWT_HEADLESS_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/font
    +    endif
    +
    +    LIBAWT_HEADLESS_CFLAGS := -DHEADLESS=true \
    +        -DX11_PATH=\"$(X11_PATH)\" -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
    +        $(CUPS_CFLAGS) \
    +        $(X_CFLAGS) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/java2d \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/jdga \
    +        $(foreach dir, $(LIBAWT_HEADLESS_DIRS), -I$(dir))
    +
    +    ifeq ($(OPENJDK_TARGET_OS), macosx)
    +      LIBAWT_HEADLESS_CFLAGS += \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
    +    endif
    +
    +    LIBAWT_HEADLESS_FILES := \
    +        awt_Font.c \
    +        HeadlessToolkit.c \
    +        fontpath.c \
    +        VDrawingArea.c \
    +        X11Color.c \
    +        X11Renderer.c \
    +        X11PMBlitLoops.c \
    +        X11SurfaceData.c \
    +        X11FontScaler_md.c \
    +        X11TextRenderer_md.c \
    +        OGLBlitLoops.c \
    +        OGLBufImgOps.c \
    +        OGLContext.c \
    +        OGLFuncs.c \
    +        OGLMaskBlit.c \
    +        OGLMaskFill.c \
    +        OGLPaints.c \
    +        OGLRenderQueue.c \
    +        OGLRenderer.c \
    +        OGLSurfaceData.c \
    +        OGLTextRenderer.c \
    +        OGLVertexCache.c \
    +        GLXGraphicsConfig.c \
    +        GLXSurfaceData.c \
    +        AccelGlyphCache.c \
    +        CUPSfuncs.c
    +
    +    ifeq ($(OPENJDK_TARGET_OS), macosx)
    +      LIBAWT_HEADLESS_FILES += \
    +          AWTFont.m \
    +          AWTStrike.m \
    +          CCharToGlyphMapper.m \
    +          CGGlyphImages.m \
    +          CGGlyphOutlines.m \
    +          CoreTextSupport.m
    +    endif
    +
    +    LIBAWT_HEADLESS_REORDER :=
    +    ifeq ($(OPENJDK_TARGET_OS), solaris)
    +      ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    +        LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
    +      endif
    +    endif
    +
    +    $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
    +        LIBRARY := awt_headless, \
    +        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +        SRC := $(LIBAWT_HEADLESS_DIRS), \
    +        INCLUDE_FILES := $(LIBAWT_HEADLESS_FILES), \
    +        LANG := C, \
    +        OPTIMIZATION := LOW, \
    +        CFLAGS := $(CFLAGS_JDKLIB) $(LIBAWT_HEADLESS_CFLAGS), \
    +        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libawt_headless/mapfile-vers, \
    +        LDFLAGS := $(LDFLAGS_JDKLIB) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN), \
    +        LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    +        LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..) \
    +            -R/usr/dt/lib$(OPENJDK_TARGET_CPU_ISADIR) \
    +            -R$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR), \
    +        LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
    +        REORDER := $(LIBAWT_HEADLESS_REORDER), \
    +        LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
    +        LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
    +        LDFLAGS_SUFFIX_macosx := -ljvm $(LIBCXX) -lawt $(LIBDL) -ljava \
    +            -framework Accelerate \
    +            -framework ApplicationServices \
    +            -framework Cocoa \
    +            -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +            -framework JavaNativeFoundation \
    +            -framework JavaRuntimeSupport, \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_headless, \
    +        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +    $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
    +
    +    BUILD_LIBRARIES += $(BUILD_LIBAWT_HEADLESS)
    +
    +  endif
    +endif
    +
    +##########################################################################################
    +
    +ifndef BUILD_HEADLESS_ONLY
    +  LIBSPLASHSCREEN_DIRS := \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/image/jpeg \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/libpng \
    +    $(JDK_TOPDIR)/src/share/native/sun/awt/splashscreen
    +
    +  ifeq ($(USE_EXTERNAL_LIBGIF), true)
    +    GIFLIB_LDFLAGS := -lgif
    +  else
    +    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    +    GIFLIB_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/awt/giflib
    +  endif
    +
    +  ifneq ($(OPENJDK_TARGET_OS), macosx)
    +    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/awt/splashscreen
    +  else
    +    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen
    +  endif
    +
    +  LIBSPLASHSCREEN_CFLAGS := -DSPLASHSCREEN -DPNG_NO_MMX_CODE \
    +      $(foreach dir, $(LIBSPLASHSCREEN_DIRS), -I$(dir))
    +
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    LIBSPLASHSCREEN_CFLAGS := -I$(JDK_TOPDIR)/src/macosx/native/sun/awt/splashscreen \
    +        $(LIBSPLASHSCREEN_CFLAGS) \
    +        -F/System/Library/Frameworks/JavaVM.framework/Frameworks
    +    LIBSPLASHSCREEN_CFLAGS += -DWITH_MACOSX
    +    LIBSPLASHSCREEN_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp
    +
    +    LIBSPLASHSCREEN_java_awt_SplashScreen.c_CFLAGS := -x objective-c -O0
    +    LIBSPLASHSCREEN_splashscreen_gfx_impl.c_CFLAGS := -x objective-c -O0
    +    LIBSPLASHSCREEN_splashscreen_gif.c_CFLAGS := -x objective-c -O0
    +    LIBSPLASHSCREEN_splashscreen_impl.c_CFLAGS := -x objective-c -O0
    +    LIBSPLASHSCREEN_splashscreen_jpeg.c_CFLAGS := -x objective-c -O0
    +    LIBSPLASHSCREEN_splashscreen_png.c_CFLAGS := -x objective-c -O0
    +    LIBSPLASHSCREEN_splashscreen_sys.m_CFLAGS := -O0
    +
    +  else ifeq ($(OPENJDK_TARGET_OS), windows)
    +    LIBSPLASHSCREEN_CFLAGS += -DWITH_WIN32
    +  else ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 -I$(OPENWIN_HOME)/include -I$(OPENWIN_HOME)/include/X11/extensions
    +  else
    +    LIBSPLASHSCREEN_CFLAGS += -DWITH_X11 $(X_CFLAGS)
    +  endif
    +
    +  LIBSPLASHSCREEN_LDFLAGS_SUFFIX :=
    +
    +  ifneq ($(USE_EXTERNAL_LIBZ), true)
    +    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    +    LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(LIBM) -lpthread -liconv -losxapp \
    +        -framework ApplicationServices \
    +        -framework Foundation \
    +        -framework Cocoa \
    +        -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +        -framework JavaNativeFoundation
    +  else ifeq ($(OPENJDK_TARGET_OS), windows)
    +    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += kernel32.lib user32.lib gdi32.lib delayimp.lib -DELAYLOAD:user32.dll
    +  else ifeq ($(OPENJDK_TARGET_OS), solaris)
    +    # Solaris still uses OPENWIN_LIB ..
    +    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += -L$(OPENWIN_LIB)$(OPENJDK_TARGET_CPU_ISADIR) -lX11 -lXext $(LIBM) -lpthread
    +  else	# .. all other Unixes can use X_LIBS
    +    LIBSPLASHSCREEN_LDFLAGS_SUFFIX += $(X_LIBS) -lX11 -lXext $(LIBM) -lpthread
    +  endif
    +
    +  $(eval $(call SetupNativeCompilation,LIBSPLASHSCREEN, \
    +      LIBRARY := splashscreen, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(LIBSPLASHSCREEN_DIRS), \
    +      EXCLUDE_FILES := imageioJPEG.c jpegdecoder.c pngtest.c, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) $(GIFLIB_CFLAGS), \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsplashscreen/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := $(LIBSPLASHSCREEN_LDFLAGS_SUFFIX) $(LIBZ) $(GIFLIB_LDFLAGS), \
    +      LDFLAGS_SUFFIX_solaris := -lc, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=splashscreen.dll" \
    +          -D "JDK_INTERNAL_NAME=splashscreen" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsplashscreen, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(LIBSPLASHSCREEN)
    +
    +  ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    $(LIBSPLASHSCREEN): $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)osxapp$(SHARED_LIBRARY_SUFFIX)
    +  endif
    +
    +endif
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +
    +  LIBDCPR_SRC_DIRS := \
    +      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/doe \
    +      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/path \
    +      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/pr \
    +      $(JDK_TOPDIR)/src/closed/share/native/sun/dc/util
    +
    +  LIBDCPR_CFLAGS := $(foreach dir, $(LIBDCPR_SRC_DIRS), -I$(dir)) \
    +      -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBDCPR, \
    +      LIBRARY := dcpr, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(LIBDCPR_SRC_DIRS), \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          $(LIBDCPR_CFLAGS), \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdcpr/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := $(LIBM) $(LDFLAGS_JDKLIB_SUFFIX), \
    +      LDFLAGS_SUFFIX_posix := -lm, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=dcpr.dll" \
    +          -D "JDK_INTERNAL_NAME=dcpr" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdcpr, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBDCPR): $(BUILD_LIBJAVA)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBDCPR)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  LIBAWT_LWAWT_FILES := \
    +      awt.m \
    +      ApplicationDelegate.m \
    +      CFRetainedResource.m \
    +      CGLGraphicsConfig.m \
    +      CGLSurfaceData.m \
    +      CGLLayer.m \
    +      CGraphicsConfig.m \
    +      CGraphicsDevice.m \
    +      CGraphicsEnv.m \
    +      CCharToGlyphMapper.m \
    +      CSystemColors.m \
    +      AWTFont.m \
    +      CGGlyphOutlines.m \
    +      CGGlyphImages.m \
    +      CoreTextSupport.m \
    +      AWTStrike.m \
    +      InitIDs.m \
    +      AWTEvent.m \
    +      AWTView.m \
    +      AWTWindow.m \
    +      AWTSurfaceLayers.m \
    +      CCursorManager.m \
    +      CClipboard.m \
    +      CDataTransferer.m \
    +      CDragSource.m \
    +      CDragSourceContextPeer.m \
    +      CDropTarget.m \
    +      CDropTargetContextPeer.m \
    +      CInputMethod.m \
    +      CDesktopPeer.m \
    +      OSVersion.m \
    +      DnDUtilities.m \
    +      CFileDialog.m \
    +      CImage.m \
    +      CMenu.m \
    +      CMenuBar.m \
    +      CMenuComponent.m \
    +      CMenuItem.m \
    +      CPopupMenu.m \
    +      CRobot.m \
    +      CTrayIcon.m \
    +      CWrapper.m \
    +      JavaAccessibilityAction.m \
    +      JavaAccessibilityUtilities.m \
    +      JavaComponentAccessibility.m \
    +      JavaTextAccessibility.m \
    +      LWCToolkit.m \
    +      GeomUtilities.m \
    +      CPrinterJob.m \
    +      PrintModel.m \
    +      PrinterSurfaceData.m \
    +      PrinterView.m \
    +      QuartzSurfaceData.m \
    +      QuartzRenderer.m \
    +      CTextPipe.m \
    +      ImageSurfaceData.m \
    +      awt_DrawingSurface.m \
    +      \
    +      OGLBlitLoops.c \
    +      OGLBufImgOps.c \
    +      OGLContext.c \
    +      OGLFuncs.c \
    +      OGLMaskBlit.c \
    +      OGLMaskFill.c \
    +      OGLPaints.c \
    +      OGLRenderQueue.c \
    +      OGLRenderer.c \
    +      OGLSurfaceData.c \
    +      OGLTextRenderer.c \
    +      OGLVertexCache.c \
    +      AccelGlyphCache.c \
    +      CUPSfuncs.c
    +
    +
    +  LIBAWT_LWAWT_DIRS := \
    +      $(JDK_TOPDIR)/src/macosx/native/sun/awt \
    +      $(JDK_TOPDIR)/src/macosx/native/sun/font \
    +      $(JDK_TOPDIR)/src/macosx/native/sun/java2d/opengl \
    +      $(JDK_TOPDIR)/src/solaris/native/sun/awt \
    +      $(JDK_TOPDIR)/src/share/native/sun/font \
    +      $(JDK_TOPDIR)/src/share/native/sun/java2d/opengl \
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_LWAWT, \
    +      LIBRARY := awt_lwawt, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(LIBAWT_LWAWT_DIRS), \
    +      LANG := C, \
    +      INCLUDE_FILES := $(LIBAWT_LWAWT_FILES), \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          $(X_CFLAGS) \
    +          $(X_LIBS) \
    +          $(foreach dir, $(LIBAWT_LWAWT_DIRS), -I$(dir)) \
    +          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/java2d \
    +          -I$(JDK_TOPDIR)/src/solaris/native/sun/java2d \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/loops \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/java2d/pipe \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX_macosx := -lawt -lmlib_image -losxapp -ljvm $(LIBM) \
    +          -framework Accelerate \
    +          -framework ApplicationServices \
    +          -framework AudioToolbox \
    +          -framework Carbon \
    +          -framework Cocoa \
    +          -framework Security \
    +          -framework ExceptionHandling \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          -framework JavaRuntimeSupport \
    +          -framework OpenGL \
    +          -framework QuartzCore -ljava, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libawt_lwawt, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBAWT_LWAWT)
    +
    +  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBAWT)
    +
    +  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBMLIB_IMAGE)
    +
    +  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBOSXAPP)
    +
    +  $(BUILD_LIBAWT_LWAWT): $(BUILD_LIBJAVA)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXUI, \
    +      LIBRARY := osxui, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/com/apple/laf, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/macosx/native/com/apple/laf \
    +          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    +          -I$(JDK_TOPDIR)/src/macosx/native/sun/awt \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN) \
    +          -Xlinker -rpath -Xlinker @loader_path, \
    +      LDFLAGS_SUFFIX_macosx := -lawt -losxapp -lawt_lwawt \
    +          -framework Cocoa \
    +          -framework Carbon \
    +          -framework ApplicationServices \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          -framework JavaRuntimeSupport \
    +          -ljava -ljvm, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxui, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBOSXUI)
    +
    +  $(BUILD_LIBOSXUI): $(BUILD_LIBAWT)
    +
    +  $(BUILD_LIBOSXUI): $(BUILD_LIBOSXAPP)
    +
    +  $(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)
    +
    +  #$(BUILD_LIBOSXUI): $(BUILD_LIBJAVA)
    +
    +endif
    diff --git a/jdk/makefiles/lib/CoreLibraries.gmk b/jdk/makefiles/lib/CoreLibraries.gmk
    new file mode 100644
    index 00000000000..29c1d5fc08a
    --- /dev/null
    +++ b/jdk/makefiles/lib/CoreLibraries.gmk
    @@ -0,0 +1,510 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +WIN_VERIFY_LIB := $(JDK_OUTPUTDIR)/objs/libverify/verify.lib
    +
    +##########################################################################################
    +
    +BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
    +
    +ifneq ($(OPENJDK_TARGET_OS), solaris)
    +  BUILD_LIBFDLIBM_OPTIMIZATION := NONE
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM, \
    +      STATIC_LIBRARY := fdlibm, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
    +      SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
    +      LANG := C, \
    +      OPTIMIZATION := $(BUILD_LIBFDLIBM_OPTIMIZATION), \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
    +      CFLAGS_windows_debug := -DLOGGING, \
    +      ARFLAGS := $(ARFLAGS), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +else
    +
    +  # On macosx the old build does partial (incremental) linking of fdlibm instead of
    +  # a plain static library.
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBFDLIBM_MAC, \
    +      LIBRARY := fdlibm, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
    +      SRC := $(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/src, \
    +      LANG := C, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
    +      LDFLAGS := -nostdlib -r -arch x86_64, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBFDLIBM := $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)fdlibm$(STATIC_LIBRARY_SUFFIX)
    +  $(BUILD_LIBFDLIBM): $(BUILD_LIBFDLIBM_MAC)
    +	$(call install-file)
    +
    +endif
    +
    +BUILD_LIBRARIES += $(BUILD_LIBFDLIBM)
    +
    +##########################################################################################
    +
    +BUILD_LIBVERIFY_SRC := check_code.c check_format.c
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    +    BUILD_LIBVERIFY_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/reorder-$(OPENJDK_TARGET_CPU)
    +  endif
    +endif
    +
    +LIBVERIFY_OPTIMIZATION := HIGH
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
    +  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    +    LIBVERIFY_OPTIMIZATION := LOW
    +  endif
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBVERIFY, \
    +    LIBRARY := verify, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/common, \
    +    INCLUDE_FILES := $(BUILD_LIBVERIFY_SRC), \
    +    LANG := C, \
    +    OPTIMIZATION := $(LIBVERIFY_OPTIMIZATION), \
    +    CFLAGS := $(CFLAGS_JDKLIB), \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libverify/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_posix := -ljvm -lc, \
    +    LDFLAGS_SUFFIX_windows := jvm.lib, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=verify.dll" \
    +        -D "JDK_INTERNAL_NAME=verify" \
    +        -D "JDK_FTYPE=0x2L", \
    +    REORDER := $(BUILD_LIBVERIFY_REORDER), \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libverify, \
    +    DEBUG_SYMBOLS := true))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBVERIFY)
    +
    +##########################################################################################
    +
    +LIBJAVA_SRC_DIRS := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/lang \
    +    $(JDK_TOPDIR)/src/share/native/java/lang \
    +    $(JDK_TOPDIR)/src/share/native/java/lang/ref \
    +    $(JDK_TOPDIR)/src/share/native/java/lang/reflect \
    +    $(JDK_TOPDIR)/src/share/native/java/io \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
    +    $(JDK_TOPDIR)/src/share/native/java/nio \
    +    $(JDK_TOPDIR)/src/share/native/java/security \
    +    $(JDK_TOPDIR)/src/share/native/common \
    +    $(JDK_TOPDIR)/src/share/native/sun/misc \
    +    $(JDK_TOPDIR)/src/share/native/sun/reflect \
    +    $(JDK_TOPDIR)/src/share/native/java/util \
    +    $(JDK_TOPDIR)/src/share/native/java/util/concurrent/atomic \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/common \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/util
    +
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/util/locale/provider
    +else
    +  LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/sun/util/locale/provider
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBJAVA_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/provider \
    +      $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/io
    +endif
    +
    +LIBJAVA_CFLAGS := $(foreach dir, $(LIBJAVA_SRC_DIRS), -I$(dir)) \
    +    -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include \
    +    -DARCHPROPNAME='"$(OPENJDK_TARGET_CPU_OSARCH)"'
    +
    +LIBJAVA_CFLAGS += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
    +    -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
    +    -DJDK_MICRO_VERSION='"$(JDK_MICRO_VERSION)"' \
    +     -DJDK_BUILD_NUMBER='"$(JDK_BUILD_NUMBER)"'
    +
    +ifneq (, $(JDK_UPDATE_VERSION))
    +  LIBJAVA_CFLAGS += -DJDK_UPDATE_VERSION='"$(JDK_UPDATE_VERSION)"'
    +endif
    +
    +LIBJAVA_EXCLUDE_FILES := check_code.c check_format.c jspawnhelper.c
    +
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBJAVA_EXCLUDE_FILES += java_props_macosx.c
    +else
    +  BUILD_LIBJAVA_java_props_md.c_CFLAGS := -x objective-c
    +  BUILD_LIBJAVA_java_props_macosx.c_CFLAGS := -x objective-c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBJAVA_EXCLUDE_FILES += \
    +      UNIXProcess_md.c \
    +      UnixFileSystem_md.c \
    +      FileSystemPreferences.c
    +else
    +  LIBJAVA_EXCLUDE_FILES += \
    +      ProcessImpl_md.c \
    +      WinNTFileSystem_md.c \
    +      dirent_md.c \
    +      WindowsPreferences.c \
    +      sun/security/provider/WinCAPISeedGenerator.c \
    +      sun/io/Win32ErrorMode.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    +    LIBJAVA_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/reorder-$(OPENJDK_TARGET_CPU)
    +  endif
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA, \
    +    LIBRARY := java, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(LIBJAVA_SRC_DIRS), \
    +    EXCLUDES := fdlibm/src zip, \
    +    EXCLUDE_FILES := $(LIBJAVA_EXCLUDE_FILES), \
    +    LANG := C, \
    +    OPTIMIZATION := HIGH, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(LIBJAVA_CFLAGS), \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_posix := -ljvm -lverify, \
    +    LDFLAGS_SUFFIX_solaris := -lsocket -lnsl -lscf $(LIBDL) $(BUILD_LIBFDLIBM) -lc, \
    +    LDFLAGS_SUFFIX_linux := $(LIBDL) $(BUILD_LIBFDLIBM), \
    +    LDFLAGS_SUFFIX_macosx := -L$(JDK_OUTPUTDIR)/objs/ -lfdlibm \
    +        -framework CoreFoundation \
    +        -framework Foundation \
    +        -framework Security -framework SystemConfiguration, \
    +    LDFLAGS_SUFFIX_windows := -export:winFileHandleOpen -export:handleLseek \
    +        jvm.lib $(BUILD_LIBFDLIBM) $(WIN_VERIFY_LIB) \
    +        shell32.lib delayimp.lib -DELAYLOAD:shell32.dll \
    +        advapi32.lib, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=java.dll" \
    +        -D "JDK_INTERNAL_NAME=java" \
    +        -D "JDK_FTYPE=0x2L", \
    +    REORDER := $(LIBJAVA_REORDER), \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJAVA)
    +
    +$(BUILD_LIBJAVA): $(LIBJLI_BINARY)
    +
    +$(BUILD_LIBJAVA): $(BUILD_LIBVERIFY)
    +
    +$(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
    +
    +##########################################################################################
    +
    +BUILD_LIBZIP_EXCLUDES :=
    +ifeq ($(USE_EXTERNAL_LIBZ), true)
    +  LIBZ := -lz
    +  LIBZIP_EXCLUDES += zlib-1.2.5
    +else
    +  ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    +endif
    +
    +BUILD_LIBZIP_REORDER :=
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  ifneq ($(OPENJDK_TARGET_CPU), x86_64)
    +    BUILD_LIBZIP_REORDER := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/reorder-$(OPENJDK_TARGET_CPU)
    +  endif
    +endif
    +
    +ifeq ($(LIBZIP_CAN_USE_MMAP), true)
    +  BUILD_LIBZIP_MMAP := -DUSE_MMAP
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBZIP, \
    +    LIBRARY := zip, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    SRC := $(JDK_TOPDIR)/src/share/native/java/util/zip, \
    +    EXCLUDES := $(LIBZIP_EXCLUDES), \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(ZLIB_CPPFLAGS) \
    +        -I$(JDK_TOPDIR)/src/share/native/java/io \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io, \
    +    CFLAGS_posix := $(BUILD_LIBZIP_MMAP) -UDEBUG, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libzip/mapfile-vers, \
    +    REORDER := $(BUILD_LIBZIP_REORDER), \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN) \
    +        $(EXPORT_ZIP_FUNCS), \
    +    LDFLAGS_windows := -export:ZIP_Open -export:ZIP_Close -export:ZIP_FindEntry \
    +        -export:ZIP_ReadEntry -export:ZIP_GetNextEntry jvm.lib \
    +        $(WIN_JAVA_LIB), \
    +    LDFLAGS_SUFFIX_linux := -ljvm -ljava $(LIBZ), \
    +    LDFLAGS_SUFFIX_solaris := -ljvm -ljava $(LIBZ) -lc, \
    +    LDFLAGS_SUFFIX_macosx := $(LIBZ) -ljava -ljvm, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=zip.dll" \
    +        -D "JDK_INTERNAL_NAME=zip" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libzip, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +
    +$(BUILD_LIBZIP): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBZIP)
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBUNPACK, \
    +    LIBRARY := unpack, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack, \
    +    EXCLUDE_FILES := main.cpp, \
    +    LANG := C++, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CXXFLAGS_JDKLIB) \
    +        -DNO_ZLIB -DUNPACK_JNI -DFULL, \
    +    CFLAGS_release := -DPRODUCT, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_windows := -map:$(JDK_OUTPUTDIR)/objs/unpack.map -debug \
    +        jvm.lib $(WIN_JAVA_LIB), \
    +    LDFLAGS_SUFFIX_posix := -ljvm $(LIBCXX) -ljava -lc, \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libunpack, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=unpack.dll" \
    +        -D "JDK_INTERNAL_NAME=unpack" \
    +        -D "JDK_FTYPE=0x2L", \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBUNPACK): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBUNPACK)
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.map: $(BUILD_LIBUNPACK)
    +	$(ECHO) Copying $(@F)
    +	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.map, $<) $@
    +
    +  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)unpack.pdb: $(BUILD_LIBUNPACK)
    +	$(ECHO) Copying $(@F)
    +	$(CP) $(patsubst %$(SHARED_LIBRARY_SUFFIX), %.pdb, $<) $@
    +endif
    +
    +##########################################################################################
    +
    +BUILD_LIBJLI_SRC_DIRS := $(JDK_TOPDIR)/src/share/bin $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin
    +LIBJLI_CFLAGS := $(CFLAGS_JDKLIB) $(foreach dir, $(BUILD_LIBJLI_SRC_DIRS), -I$(dir))
    +
    +BUILD_LIBJLI_FILES := \
    +    java.c \
    +    splashscreen_stubs.c \
    +    parse_manifest.c \
    +    version_comp.c \
    +    wildcard.c \
    +    jli_util.c
    +
    +ifeq ($(JVM_VARIANT_ZERO), true)
    +  ERGO_FAMILY := zero
    +else
    +  ifeq ($(OPENJDK_TARGET_CPU_ARCH), x86)
    +    ERGO_FAMILY := i586
    +  else
    +    ERGO_FAMILY := $(OPENJDK_TARGET_CPU_ARCH)
    +  endif
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBJLI_CFLAGS += -I$(JDK_TOPDIR)/src/macosx/bin
    +  BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/bin
    +  BUILD_LIBJLI_FILES += java_md_common.c java_md_macosx.c
    +
    +  BUILD_LIBJLI_java_md_macosx.c_CFLAGS := -x objective-c
    +  BUILD_LIBJLI_STATIC_java_md_macosx.c_CFLAGS := -x objective-c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  BUILD_LIBJLI_FILES += java_md.c \
    +      cmdtoargs.c
    +  # Staticically link with c runtime on windows.
    +  LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
    +else ifneq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  BUILD_LIBJLI_FILES += java_md_common.c
    +  BUILD_LIBJLI_FILES += java_md_solinux.c ergo.c
    +
    +  ERGO_ARCH_FILE = ergo_$(ERGO_FAMILY).c
    +
    +  # if the architecture specific ergo file exists then
    +  # use it, else use the generic definitions from ergo.c
    +  ifneq ($(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin/$(ERGO_ARCH_FILE)), )
    +    BUILD_LIBJLI_FILES += $(ERGO_ARCH_FILE)
    +  else # !ERGO_ARCH_FILE
    +    LIBJLI_CFLAGS += -DUSE_GENERIC_ERGO
    +  endif # ERGO_ARCH_FILE
    +endif #WINDOWS
    +
    +# Append defines depending on target platform
    +LIBJLI_CFLAGS += $(OPENJDK_TARGET_CPU_JLI_CFLAGS)
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBJLI_CFLAGS += -DPACKAGE_PATH=\"$(PACKAGE_PATH)\"
    +endif
    +
    +ifneq ($(USE_EXTERNAL_LIBZ), true)
    +  BUILD_LIBJLI_SRC_DIRS += $(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
    +  LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
    +  BUILD_LIBJLI_FILES += \
    +      inflate.c \
    +      inftrees.c \
    +      inffast.c \
    +      zadler32.c \
    +      zcrc32.c \
    +      zutil.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
    +else
    +  LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
    +    LIBRARY := jli, \
    +    OUTPUT_DIR := $(LIBJLI_OUTPUT_DIR), \
    +    SRC := $(BUILD_LIBJLI_SRC_DIRS), \
    +    INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
    +    LANG := C, \
    +    OPTIMIZATION := HIGH, \
    +    CFLAGS := $(LIBJLI_CFLAGS), \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjli/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    +    LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
    +    LDFLAGS_macosx := -framework Cocoa -framework Security -framework ApplicationServices, \
    +    LDFLAGS_SUFFIX_solaris := $(LIBZ) $(LIBDL) -lc, \
    +    LDFLAGS_SUFFIX_linux := $(LIBZ) $(LIBDL) -lc -lpthread, \
    +    LDFLAGS_SUFFIX_macosx := $(LIBZ), \
    +    LDFLAGS_SUFFIX_windows := \
    +        -export:JLI_Launch \
    +        -export:JLI_ManifestIterate \
    +        -export:JLI_SetTraceLauncher \
    +        -export:JLI_ReportErrorMessage \
    +        -export:JLI_ReportErrorMessageSys \
    +        -export:JLI_ReportMessage \
    +        -export:JLI_ReportExceptionDescription \
    +        -export:JLI_MemAlloc \
    +        -export:JLI_CmdToArgs \
    +        -export:JLI_GetStdArgc \
    +        -export:JLI_GetStdArgs \
    +        advapi32.lib \
    +        comctl32.lib \
    +        user32.lib, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=jli.dll" \
    +        -D "JDK_INTERNAL_NAME=jli" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJLI)
    +
    +# On windows, the static library has the same suffix as the import library created by
    +# with the shared library, so the static library is given a different name. No harm
    +# in doing it for all platform to reduce complexity.
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
    +      STATIC_LIBRARY := jli_static, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
    +      SRC := $(BUILD_LIBJLI_SRC_DIRS), \
    +      INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
    +      LANG := C, \
    +      OPTIMIZATION := HIGH, \
    +      CFLAGS := $(STATIC_LIBRARY_FLAGS) $(LIBJLI_CFLAGS), \
    +      ARFLAGS := $(ARFLAGS), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBJLI_STATIC)
    +
    +else ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  #
    +  # On macosx they do partial (incremental) linking of libjli_static.a
    +  # code it here...rather than add support to NativeCompilation
    +  # as this is first time I see it
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJLI_STATIC, \
    +      LIBRARY := jli_static, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs, \
    +      SRC := $(BUILD_LIBJLI_SRC_DIRS), \
    +      INCLUDE_FILES := $(BUILD_LIBJLI_FILES), \
    +      LANG := C, \
    +      OPTIMIZATION := HIGH, \
    +      CFLAGS := $(CFLAGS_JDKLIB) $(LIBJLI_CFLAGS), \
    +      LDFLAGS := -nostdlib -r, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjli_static, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(JDK_OUTPUTDIR)/objs/libjli_static.a: $(BUILD_LIBJLI_STATIC)
    +	$(call install-file)
    +
    +  BUILD_LIBRARIES += $(JDK_OUTPUTDIR)/objs/libjli_static.a
    +endif
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBNPT, \
    +    LIBRARY := npt, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/npt $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        -I$(JDK_TOPDIR)/src/share/npt \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnpt/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_macosx := -liconv, \
    +    LDFLAGS_SUFFIX_windows := -export:nptInitialize -export:nptTerminate, \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=npt.dll" \
    +        -D "JDK_INTERNAL_NAME=npt" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnpt, \
    +    DEBUG_SYMBOLS := true))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBNPT)
    diff --git a/jdk/makefiles/lib/NetworkingLibraries.gmk b/jdk/makefiles/lib/NetworkingLibraries.gmk
    new file mode 100644
    index 00000000000..546565af91b
    --- /dev/null
    +++ b/jdk/makefiles/lib/NetworkingLibraries.gmk
    @@ -0,0 +1,98 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +LIBNET_SRC_DIRS := $(JDK_TOPDIR)/src/share/native/java/net \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/dns \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/spi
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/www/protocol/http/ntlm
    +else
    +  LIBNET_SRC_DIRS += $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/net/sdp
    +endif
    +
    +LIBNET_CFLAGS := $(foreach dir, $(LIBNET_SRC_DIRS), -I$(dir))
    +
    +LIBNET_EXCLUDE_FILES :=
    +ifneq ($(OPENJDK_TARGET_OS), linux)
    +  LIBNET_EXCLUDE_FILES += linux_close.c
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBNET_EXCLUDE_FILES += bsd_close.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBNET_EXCLUDE_FILES += PlainSocketImpl.c PlainDatagramSocketImpl.c SdpSupport.c
    +else
    +  LIBNET_EXCLUDE_FILES += TwoStacksPlainSocketImpl.c DualStackPlainSocketImpl.c \
    +      TwoStacksPlainDatagramSocketImpl.c DualStackPlainDatagramSocketImpl.c \
    +      NTLMAuthSequence.c NetworkInterface_winXP.c
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBNET, \
    +    LIBRARY := net, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(LIBNET_SRC_DIRS), \
    +    EXCLUDE_FILES := $(LIBNET_EXCLUDE_FILES), \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(LIBNET_CFLAGS), \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnet/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_macosx := -ljvm -ljava, \
    +    LDFLAGS_SUFFIX_solaris := -ljvm -ljava -lnsl -lsocket $(LIBDL) -lc, \
    +    LDFLAGS_SUFFIX_linux := $(LIBDL) -ljvm -lpthread -ljava, \
    +    LDFLAGS_SUFFIX_windows := ws2_32.lib jvm.lib secur32.lib iphlpapi.lib \
    +        delayimp.lib $(WIN_JAVA_LIB) advapi32.lib \
    +        -DELAYLOAD:secur32.dll -DELAYLOAD:iphlpapi.dll, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=net.dll" \
    +        -D "JDK_INTERNAL_NAME=net" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnet, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBNET): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBNET)
    +
    +$(JDK_OUTPUTDIR)/lib/net.properties: $(JDK_TOPDIR)/src/share/lib/net.properties
    +	$(ECHO) $(LOG_INFO) Copying $(@F)
    +	$(call install-file)
    +
    +COPY_FILES += $(JDK_OUTPUTDIR)/lib/net.properties
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template: $(JDK_TOPDIR)/src/${OPENJDK_TARGET_OS_API_DIR}/lib/sdp/sdp.conf.template
    +	$(ECHO) $(LOG_INFO) Copying $(@F)
    +	$(call install-file)
    +
    +  COPY_FILES += $(JDK_OUTPUTDIR)/lib/sdp/sdp.conf.template
    +endif
    diff --git a/jdk/makefiles/lib/NioLibraries.gmk b/jdk/makefiles/lib/NioLibraries.gmk
    new file mode 100644
    index 00000000000..afab1c9c29c
    --- /dev/null
    +++ b/jdk/makefiles/lib/NioLibraries.gmk
    @@ -0,0 +1,186 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +BUILD_LIBNIO_SRC := \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/nio \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/fs
    +
    +BUILD_LIBNIO_CFLAGS := \
    +    -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
    +    -I$(JDK_TOPDIR)/src/share/native/java/io \
    +    -I$(JDK_TOPDIR)/src/share/native/java/net \
    +    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net
    +
    +BUILD_LIBNIO_FILES := \
    +    DatagramChannelImpl.c \
    +    DatagramDispatcher.c \
    +    FileChannelImpl.c \
    +    FileDispatcherImpl.c \
    +    FileKey.c \
    +    IOUtil.c \
    +    MappedByteBuffer.c \
    +    Net.c \
    +    ServerSocketChannelImpl.c \
    +    SocketChannelImpl.c \
    +    SocketDispatcher.c
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  BUILD_LIBNIO_FILES += \
    +      Iocp.c \
    +      RegistryFileTypeDetector.c \
    +      WindowsAsynchronousFileChannelImpl.c \
    +      WindowsAsynchronousServerSocketChannelImpl.c \
    +      WindowsAsynchronousSocketChannelImpl.c \
    +      WindowsNativeDispatcher.c \
    +      WindowsSelectorImpl.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), linux)
    +  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    +  BUILD_LIBNIO_FILES += \
    +      EPoll.c \
    +      EPollArrayWrapper.c \
    +      EPollPort.c \
    +      InheritedChannel.c \
    +      NativeThread.c \
    +      PollArrayWrapper.c \
    +      UnixAsynchronousServerSocketChannelImpl.c \
    +      UnixAsynchronousSocketChannelImpl.c \
    +      GnomeFileTypeDetector.c \
    +      MagicFileTypeDetector.c \
    +      LinuxNativeDispatcher.c \
    +      LinuxWatchService.c \
    +      UnixCopyFile.c \
    +      UnixNativeDispatcher.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    +  BUILD_LIBNIO_SRC += $(JDK_TOPDIR)/src/macosx/native/sun/nio/ch
    +  BUILD_LIBNIO_FILES += \
    +      InheritedChannel.c \
    +      NativeThread.c \
    +      PollArrayWrapper.c \
    +      UnixAsynchronousServerSocketChannelImpl.c \
    +      UnixAsynchronousSocketChannelImpl.c \
    +      BsdNativeDispatcher.c \
    +      MacOSXNativeDispatcher.c \
    +      UnixCopyFile.c \
    +      UnixNativeDispatcher.c \
    +      KQueue.c \
    +      KQueuePort.c \
    +      KQueueArrayWrapper.c
    +endif
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  BUILD_LIBNIO_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libnio/mapfile-$(OPENJDK_TARGET_OS)
    +  BUILD_LIBNIO_FILES += \
    +      DevPollArrayWrapper.c \
    +      InheritedChannel.c \
    +      NativeThread.c \
    +      PollArrayWrapper.c \
    +      SolarisEventPort.c \
    +      UnixAsynchronousServerSocketChannelImpl.c \
    +      UnixAsynchronousSocketChannelImpl.c \
    +      GnomeFileTypeDetector.c \
    +      SolarisNativeDispatcher.c \
    +      SolarisWatchService.c \
    +      UnixCopyFile.c \
    +      UnixNativeDispatcher.c
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBNIO, \
    +    LIBRARY := nio, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(BUILD_LIBNIO_SRC), \
    +    INCLUDE_FILES := $(BUILD_LIBNIO_FILES), \
    +    LANG := C, \
    +    OPTIMIZATION := HIGH, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(BUILD_LIBNIO_CFLAGS), \
    +    MAPFILE := $(BUILD_LIBNIO_MAPFILE), \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) $(BUILD_LIBNIO_LDFLAGS) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_linux := -ljava -lnet -lpthread $(LIBDL), \
    +    LDFLAGS_SUFFIX_solaris := -ljvm -lsocket -lposix4 $(LIBDL) \
    +        -lsendfile -ljava -lnet -lc, \
    +    LDFLAGS_SUFFIX_windows := jvm.lib ws2_32.lib $(WIN_JAVA_LIB) \
    +        $(JDK_OUTPUTDIR)/objs/libnet/net.lib \
    +        advapi32.lib, \
    +    LDFLAGS_SUFFIX_macosx := -ljava -lnet -pthread -framework CoreFoundation, \
    +    LDFLAGS_SUFFIX :=, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=nio.dll" \
    +        -D "JDK_INTERNAL_NAME=nio" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libnio, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBNIO)
    +
    +$(BUILD_LIBNIO): $(BUILD_LIBNET)
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS_API), posix)
    +
    +  ifneq ($(OPENJDK_TARGET_OS), macosx)
    +
    +    # Suppress unused parameters required by exported JNI functions.
    +    SCTP_WERROR := -Werror -Wno-error=unused-parameter
    +    ifeq ($(OPENJDK_TARGET_CPU_ARCH), ppc)
    +      SCTP_WERROR :=
    +    endif
    +
    +    $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
    +        LIBRARY := sctp, \
    +        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +        SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch/sctp, \
    +        LANG := C, \
    +        OPTIMIZATION := LOW, \
    +        CFLAGS := $(CFLAGS_JDKLIB) \
    +            -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch \
    +            -I$(JDK_TOPDIR)/src/share/native/sun/nio/ch/sctp \
    +            -I$(JDK_TOPDIR)/src/share/native/java/net \
    +            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/nio/ch \
    +            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/net, \
    +        CFLAGS_linux := $(SCTP_WERROR), \
    +        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsctp/mapfile-vers, \
    +        LDFLAGS := $(LDFLAGS_JDKLIB) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN), \
    +        LDFLAGS_SUFFIX_linux := -lpthread $(LIBDL) -ljava -ljvm, \
    +        LDFLAGS_SUFFIX_posix := -lnio -lnet, \
    +        LDFLAGS_SUFFIX_solaris := -lsocket -ljava -ljvm -lc, \
    +        LDFLAGS_SUFFIX_macosx := -ljava -ljvm, \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsctp, \
    +        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +    BUILD_LIBRARIES += $(BUILD_LIBSCTP)
    +
    +    $(BUILD_LIBSCTP): $(BUILD_LIBNIO)
    +  endif
    +endif
    diff --git a/jdk/makefiles/lib/PlatformLibraries.gmk b/jdk/makefiles/lib/PlatformLibraries.gmk
    new file mode 100644
    index 00000000000..7684bddeece
    --- /dev/null
    +++ b/jdk/makefiles/lib/PlatformLibraries.gmk
    @@ -0,0 +1,283 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBAPPLESCRIPTENGINE, \
    +      LIBRARY := AppleScriptEngine, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/apple/applescript, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/macosx/native/apple/applescript \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := -framework Cocoa \
    +          -framework Carbon \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          $(LDFLAGS_JDKLIB_SUFFIX), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libAppleScriptEngine, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBAPPLESCRIPTENGINE): $(BUILD_LIBJAVA)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBAPPLESCRIPTENGINE)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBOSXAPP, \
    +      LIBRARY := osxapp, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/sun/osxapp, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    +          -I$(JDK_OUTPUTDIR)/gensrc/sun/osxapp \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX_macosx := \
    +          -framework Accelerate \
    +          -framework ApplicationServices \
    +          -framework AudioToolbox \
    +          -framework Carbon \
    +          -framework Cocoa \
    +          -framework Security \
    +          -framework ExceptionHandling \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          -framework JavaRuntimeSupport \
    +          -framework OpenGL \
    +          -framework IOSurface \
    +          -framework QuartzCore, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosxapp, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBOSXAPP)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  LIBOSX_DIRS := \
    +      $(JDK_TOPDIR)/src/macosx/native/com/apple/concurrent \
    +      $(JDK_TOPDIR)/src/macosx/native/java/util \
    +      $(JDK_TOPDIR)/src/macosx/native/com/apple/eio \
    +      $(JDK_TOPDIR)/src/macosx/native/apple/security \
    +      $(JDK_TOPDIR)/src/macosx/native/apple/launcher
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBOSX, \
    +      LIBRARY := osx, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(LIBOSX_DIRS), \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          $(foreach dir, $(LIBOSX_DIRS), -I$(dir)) \
    +          -I$(JDK_TOPDIR)/src/macosx/native/sun/osxapp \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX_macosx := \
    +          -losxapp \
    +          -framework Cocoa \
    +          -framework ApplicationServices \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          -framework JavaRuntimeSupport \
    +          -framework Security \
    +          -framework SystemConfiguration \
    +          $(LDFLAGS_JDKLIB_SUFFIX), \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libosx, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBOSX)
    +
    +  $(BUILD_LIBOSX): $(BUILD_LIBOSXAPP)
    +
    +  $(BUILD_LIBOSX): $(BUILD_LIBJAVA)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC32, \
    +      LIBRARY := JObjC, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
    +          $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := -fpascal-strings \
    +          -fobjc-gc \
    +          -gdwarf-2 \
    +          $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -m32, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          -m32, \
    +      LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          -lffi, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc32, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJOBJC64, \
    +      LIBRARY := JObjC, \
    +      OUTPUT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \
    +      SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/native \
    +          $(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/native, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := -fpascal-strings \
    +          -fobjc-gc \
    +          -gdwarf-2 \
    +          $(CFLAGS_JDKLIB) -I$(JDK_OUTPUTDIR)/gensrc_headers_jobjc \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          , \
    +      LDFLAGS := -fpascal-strings \
    +          -fobjc-gc \
    +          -gdwarf-2 \
    +          $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := -framework Foundation -framework JavaVM \
    +          -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
    +          -framework JavaNativeFoundation \
    +          -lffi, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjobjc64, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX): $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
    +	$(LIPO) -create -output $@ $(BUILD_LIBJOBJC32) $(BUILD_LIBJOBJC64)
    +
    +  BUILD_LIBRARIES += $(INSTALL_LIBRARIES_HERE)/$(LIBRARY_PREFIX)JObjC$(SHARED_LIBRARY_SUFFIX)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +
    +    ACCESSBRIDGE_SRCDIR := $(JDK_TOPDIR)/src/closed/windows/native/sun/bridge
    +
    +    define SetupAccessBridge
    +      # Parameter 1 Suffix
    +      # Parameter 2 Machine
    +      # Parameter 3 ACCESSBRIDGE_ARCH_ suffix
    +
    +      $(call SetupNativeCompilation,BUILD_JAWTACCESSBRIDGE$1, \
    +          LIBRARY = JAWTAccessBridge$1, \
    +          OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +          SRC := $(ACCESSBRIDGE_SRCDIR), \
    +          INCLUDE_FILES := JAWTAccessBridge.cpp, \
    +          LANG := C++, \
    +          OPTIMIZATION := LOW, \
    +          CFLAGS := $(CFLAGS_JDKLIB) \
    +              -DACCESSBRIDGE_ARCH_$3, \
    +          LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    +              winspool.lib jawt.lib comdlg32.lib advapi32.lib shell32.lib \
    +              ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    +              -subsystem:windows -machine:$2 \
    +              -def:$(ACCESSBRIDGE_SRCDIR)/JAWTAccessBridge.DEF, \
    +          VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
    +          RC_FLAGS := $(RC_FLAGS), \
    +          OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjawtaccessbridge$1, \
    +          DEBUG_SYMBOLS := true)
    +
    +      $$(BUILD_JAWTACCESSBRIDGE$1): $(JDK_OUTPUTDIR)/lib/$(LIBRARY_PREFIX)jawt$(STATIC_LIBRARY_SUFFIX)
    +
    +      $(call SetupNativeCompilation,BUILD_JAVAACCESSBRIDGE$1, \
    +          LIBRARY = JavaAccessBridge$1, \
    +          OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +          SRC := $(ACCESSBRIDGE_SRCDIR), \
    +          INCLUDE_FILES := AccessBridgeATInstance.cpp AccessBridgeDebug.cpp \
    +              AccessBridgeJavaEntryPoints.cpp \
    +              AccessBridgeMessages.cpp JavaAccessBridge.cpp, \
    +          LANG := C++, \
    +          OPTIMIZATION := LOW, \
    +          CFLAGS := $(CFLAGS_JDKLIB) \
    +              -DACCESSBRIDGE_ARCH_$3, \
    +          LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    +              winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    +              ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    +              -subsystem:windows -machine:$2 \
    +              -def:$(ACCESSBRIDGE_SRCDIR)/JavaAccessBridge.DEF, \
    +          VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
    +          RC_FLAGS := $(RC_FLAGS), \
    +          OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjavaaccessbridge$1, \
    +          DEBUG_SYMBOLS := true)
    +
    +      $(call SetupNativeCompilation,BUILD_WINDOWSACCESSBRIDGE$1, \
    +          LIBRARY = WindowsAccessBridge$1, \
    +          OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +          SRC := $(ACCESSBRIDGE_SRCDIR), \
    +          INCLUDE_FILES := AccessBridgeJavaVMInstance.cpp AccessBridgeMessageQueue.cpp \
    +              AccessBridgeMessages.cpp AccessBridgeWindowsEntryPoints.cpp \
    +              WinAccessBridge.cpp AccessBridgeDebug.cpp \
    +              AccessBridgeEventHandler.cpp, \
    +          LANG := C++, \
    +          OPTIMIZATION := LOW, \
    +          CFLAGS := $(filter-out -MD, $(CFLAGS_JDKLIB)) -MT \
    +              -DACCESSBRIDGE_ARCH_$3, \
    +          LDFLAGS := $(LDFLAGS_JDKLIB) kernel32.lib user32.lib gdi32.lib \
    +              winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    +              ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \
    +              -subsystem:windows -machine:$2 \
    +              -def:$(ACCESSBRIDGE_SRCDIR)/WinAccessBridge.DEF, \
    +          VERSIONINFO_RESOURCE := $(ACCESSBRIDGE_SRCDIR)/AccessBridgeStatusWindow.rc, \
    +          RC_FLAGS := $(RC_FLAGS), \
    +          OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libwindowsaccessbridge$1, \
    +          DEBUG_SYMBOLS := true)
    +
    +      BUILD_LIBRARIES += $$(BUILD_JAWTACCESSBRIDGE$1) $$(BUILD_JAVAACCESSBRIDGE$1) \
    +          $$(BUILD_WINDOWSACCESSBRIDGE$1)
    +
    +    endef
    +
    +    ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    +      $(eval $(call SetupAccessBridge,-32,I386,32))
    +      $(eval $(call SetupAccessBridge,,I386,LEGACY))
    +    else
    +      $(eval $(call SetupAccessBridge,-64,X64,64))
    +    endif
    +  endif
    +endif
    diff --git a/jdk/makefiles/lib/SecurityLibraries.gmk b/jdk/makefiles/lib/SecurityLibraries.gmk
    new file mode 100644
    index 00000000000..779504f5f84
    --- /dev/null
    +++ b/jdk/makefiles/lib/SecurityLibraries.gmk
    @@ -0,0 +1,289 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +LIBJAAS_MAPFILE :=
    +ifneq ($(OPENJDK_TARGET_OS), solaris)
    +  LIBJAAS_EXCLUDE_FILES := Solaris.c
    +else
    +  # only on solaris...wonder why
    +  LIBJAAS_MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjaas/mapfile-vers
    +endif
    +
    +LIBJAAS_NAME := jaas_unix
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBJAAS_NAME := jaas_nt
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJAAS, \
    +    LIBRARY := $(LIBJAAS_NAME), \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/security/auth/module, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB), \
    +    MAPFILE := $(LIBJAAS_MAPFILE), \
    +    LDFLAGS := $(filter-out -ljava, $(LDFLAGS_JDKLIB)) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_windows := netapi32.lib user32.lib mpr.lib advapi32.lib, \
    +    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    EXCLUDE_FILES := $(LIBJAAS_EXCLUDE_FILES), \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=$(LIBJAAS_NAME).dll" \
    +        -D "JDK_INTERNAL_NAME=$(LIBJAAS_NAME)" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjaas, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBJAAS): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJAAS)
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PCSC, \
    +    LIBRARY := j2pcsc, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio, \
    +    LANG := C, \
    +    CFLAGS_posix := -D__sun_jdk, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/security/smartcardio \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/smartcardio/MUSCLE, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pcsc/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_posix := $(LIBDL), \
    +    LDFLAGS_SUFFIX_windows := winscard.lib, \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=j2pcsc.dll" \
    +        -D "JDK_INTERNAL_NAME=j2pcsc" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pcsc, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJ2PCSC)
    +
    +##########################################################################################
    +
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJ2GSS, \
    +      LIBRARY := j2gss, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
    +          $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/share/native/sun/security/jgss/wrapper \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/jgss/wrapper, \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2gss/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := $(LIBDL), \
    +      LDFLAGS_SUFFIX_solaris := -lc, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2gss, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBJ2GSS)
    +endif
    +
    +##########################################################################################
    +
    +ifneq ($(BUILD_CRYPTO), no)
    +  BUILD_LIBKRB5_NAME :=
    +  ifeq ($(OPENJDK_TARGET_OS), windows)
    +    BUILD_LIBKRB5_NAME := w2k_lsa_auth
    +    BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5
    +    BUILD_LIBKRB5_LIBS := advapi32.lib Secur32.lib netapi32.lib kernel32.lib user32.lib \
    +        gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib \
    +        ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib
    +  else ifeq ($(OPENJDK_TARGET_OS), macosx)
    +    BUILD_LIBKRB5_NAME := osxkrb5
    +    BUILD_LIBKRB5_SRC := $(JDK_TOPDIR)/src/share/native/sun/security/krb5
    +    BUILD_LIBKRB5_LIBS := -framework Kerberos
    +  endif
    +
    +  ifneq ($(BUILD_LIBKRB5_NAME), )
    +    $(eval $(call SetupNativeCompilation,BUILD_LIBKRB5, \
    +        LIBRARY := $(BUILD_LIBKRB5_NAME), \
    +        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +        SRC := $(BUILD_LIBKRB5_SRC), \
    +        LANG := C, \
    +        OPTIMIZATION := LOW, \
    +        CFLAGS := $(CFLAGS_JDKLIB) \
    +            -I$(JDK_TOPDIR)/src/share/native/sun/security/krb5 \
    +            -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/krb5, \
    +        LDFLAGS := $(LDFLAGS_JDKLIB) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN), \
    +        LDFLAGS_SUFFIX := $(BUILD_LIBKRB5_LIBS), \
    +        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +        RC_FLAGS := $(RC_FLAGS) \
    +            -D "JDK_FNAME=$(BUILD_LIBKRB5_NAME).dll" \
    +            -D "JDK_INTERNAL_NAME=$(BUILD_LIBKRB5_NAME)" \
    +            -D "JDK_FTYPE=0x2L", \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libkrb5, \
    +        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +    BUILD_LIBRARIES += $(BUILD_LIBKRB5)
    +  endif
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBSUNMSCAPI, \
    +      LIBRARY := sunmscapi, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \
    +      LANG := C++, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/mscapi, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := Crypt32.Lib advapi32.lib, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=sunmscapi.dll" \
    +          -D "JDK_INTERNAL_NAME=sunmscapi" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunmscapi, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBSUNMSCAPI)
    +endif
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJ2PKCS11, \
    +    LIBRARY := j2pkcs11, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
    +        $(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11 \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11 \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/security/pkcs11/wrapper \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/security/pkcs11/wrapper, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2pkcs11/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_posix := $(LIBDL), \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=j2pkcs11.dll" \
    +        -D "JDK_INTERNAL_NAME=j2pkcs11" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2pkcs11, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJ2PKCS11)
    +
    +##########################################################################################
    +
    +ifeq ($(ENABLE_INTREE_EC), yes)
    +
    +  BUILD_LIBSUNEC_FLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/security/ec \
    +      -I$(JDK_TOPDIR)/src/share/native/sun/security/ec/impl
    +
    +  #
    +  # On sol-sparc...all libraries are compiled with -xregs=no%appl
    +  # (set in CFLAGS_REQUIRED_sparc)
    +  #
    +  # except!!! libsunec.so
    +  #
    +  ECC_JNI_SOLSPARC_FILTER :=
    +  ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    +    ECC_JNI_SOLSPARC_FILTER := -xregs=no%appl
    +  endif
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBSUNEC, \
    +      LIBRARY := sunec, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/share/native/sun/security/ec \
    +          $(JDK_TOPDIR)/src/share/native/sun/security/ec/impl, \
    +      LANG := C++, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \
    +          $(BUILD_LIBSUNEC_FLAGS) \
    +          -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \
    +      CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \
    +          $(BUILD_LIBSUNEC_FLAGS), \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libsunec/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK), \
    +      LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := $(LIBCXX), \
    +      LDFLAGS_SUFFIX_linux := -lc, \
    +      LDFLAGS_SUFFIX_solaris := -lc, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=sunec.dll" \
    +          -D "JDK_INTERNAL_NAME=sunec" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libsunec, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBSUNEC)
    +endif
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  ifndef OPENJDK
    +
    +    $(eval $(call SetupNativeCompilation,BUILD_LIBJ2UCRYPTO, \
    +        LIBRARY := j2ucrypto, \
    +        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +        SRC := $(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \
    +        LANG := C, \
    +        OPTIMIZATION := LOW, \
    +        CFLAGS := $(CFLAGS_JDKLIB) \
    +            -I$(JDK_TOPDIR)/src/closed/solaris/native/com/oracle/security/ucrypto, \
    +        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libj2ucrypto/mapfile-vers, \
    +        LDFLAGS := $(LDFLAGS_JDKLIB), \
    +        LDFLAGS_SUFFIX := $(LIBDL), \
    +        LDFLAGS_SUFFIX_solaris := -lc, \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libj2ucrypto, \
    +        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +    $(BUILD_LIBJ2UCRYPTO): $(BUILD_LIBJAVA)
    +
    +    BUILD_LIBRARIES += $(BUILD_LIBJ2UCRYPTO)
    +
    +  endif
    +endif
    diff --git a/jdk/makefiles/lib/ServiceabilityLibraries.gmk b/jdk/makefiles/lib/ServiceabilityLibraries.gmk
    new file mode 100644
    index 00000000000..0cc5ad96a88
    --- /dev/null
    +++ b/jdk/makefiles/lib/ServiceabilityLibraries.gmk
    @@ -0,0 +1,431 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +LIBATTACH_EXCLUDE_FILES :=
    +ifneq ($(OPENJDK_TARGET_OS), solaris)
    +  LIBATTACH_EXCLUDE_FILES += SolarisVirtualMachine.c
    +endif
    +ifneq ($(OPENJDK_TARGET_OS), linux)
    +  LIBATTACH_EXCLUDE_FILES += LinuxVirtualMachine.c
    +endif
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBATTACH_EXCLUDE_FILES += BsdVirtualMachine.c
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBATTACH, \
    +    LIBRARY := attach, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tools/attach, \
    +    EXCLUDE_FILES := $(LIBATTACH_EXCLUDE_FILES), \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB), \
    +    CFLAGS_windows := /Gy, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libattach/mapfile-$(OPENJDK_TARGET_OS), \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=attach.dll" \
    +        -D "JDK_INTERNAL_NAME=attach" \
    +        -D "JDK_FTYPE=0x2L", \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_solaris := -ldoor, \
    +    LDFLAGS_windows := /ORDER:@$(JDK_TOPDIR)/makefiles/mapfiles/libattach/reorder-windows-$(OPENJDK_TARGET_CPU), \
    +    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    +    LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib psapi.lib, \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libattach, \
    +    DEBUG_SYMBOLS := true))
    +
    +$(BUILD_LIBATTACH): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBATTACH)
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBDT_SOCKET, \
    +    LIBRARY := dt_socket, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/transport/socket \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
    +        -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
    +        -I$(JDK_TOPDIR)/src/share/transport/socket \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/socket \
    +        -I$(JDK_TOPDIR)/src/share/back/export \
    +        -I$(JDK_TOPDIR)/src/share/back, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libdt_socket/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_linux := -lpthread, \
    +    LDFLAGS_SUFFIX_solaris := -lnsl -lsocket -lc, \
    +    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) -export:jdwpTransport_OnLoad ws2_32.lib, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=dt_socket.dll" \
    +        -D "JDK_INTERNAL_NAME=dt_socket" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdt_socket, \
    +    DEBUG_SYMBOLS := true))
    +
    +$(BUILD_LIBDT_SOCKET): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBDT_SOCKET)
    +
    +##########################################################################################
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBDT_SHMEM, \
    +      LIBRARY := dt_shmem, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(JDK_TOPDIR)/src/share/native/com/sun/tools/jdi \
    +          $(JDK_TOPDIR)/src/share/transport/shmem \
    +          $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) -DUSE_MMAP \
    +          -I$(INCLUDEDIR) -I$(JDK_OUTPUTDIR)/include/$(OPENJDK_TARGET_OS) \
    +          -I$(JDK_TOPDIR)/src/share/transport/shmem \
    +          -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/transport/shmem \
    +          -I$(JDK_TOPDIR)/src/share/back/export, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB), \
    +      LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
    +      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=dt_shmem.dll" \
    +          -D "JDK_INTERNAL_NAME=dt_shmem" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libdt_shmem, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBDT_SHMEM)
    +
    +endif # OPENJDK_TARGET_OS
    +
    +##########################################################################################
    +
    +# JDWP_LOGGING causes log messages to be compiled into the library.
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJDWP, \
    +    LIBRARY := jdwp, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/back $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) -DJDWP_LOGGING \
    +        -I$(JDK_TOPDIR)/src/share/transport/export \
    +        -I$(JDK_TOPDIR)/src/share/back/export \
    +        -I$(JDK_TOPDIR)/src/share/npt \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
    +        -I$(JDK_TOPDIR)/src/share/back \
    +        -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/back \
    +        -I$(JDK_OUTPUTDIR)/gensrc_jdwp_headers, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjdwp/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_linux := $(LIBDL), \
    +    LDFLAGS_SUFFIX_solaris := $(LIBDL) -lc, \
    +    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX), \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=jdwp.dll" \
    +        -D "JDK_INTERNAL_NAME=jdwp" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjdwp, \
    +    DEBUG_SYMBOLS := true))
    +
    +$(BUILD_LIBJDWP): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJDWP)
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \
    +    LIBRARY := jsdt, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace \
    +        $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/tracing/dtrace, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        -I$(JDK_TOPDIR)/src/share/native/sun/tracing/dtrace, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsdt/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_linux := $(LIBDL), \
    +    LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL), \
    +    LDFLAGS_SUFFIX_macosx := $(LIBDL), \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=jsdt.dll" \
    +        -D "JDK_INTERNAL_NAME=jsdt" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsdt, \
    +    DEBUG_SYMBOLS := true))
    +
    +$(BUILD_LIBJSDT): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJSDT)
    +
    +##########################################################################################
    +
    +LIBINSTRUMENT_SRC := $(JDK_TOPDIR)/src/share/instrument \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/java/io \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument
    +
    +LIBINSTRUMENT_FILES := \
    +    EncodingSupport.c \
    +    EncodingSupport_md.c \
    +    FileSystemSupport_md.c \
    +    InstrumentationImplNativeMethods.c \
    +    InvocationAdapter.c \
    +    JarFacade.c \
    +    JPLISAgent.c \
    +    JPLISAssert.c \
    +    JavaExceptions.c \
    +    PathCharsValidator.c \
    +    Reentrancy.c \
    +    Utilities.c \
    +    canonicalize_md.c
    +
    +LIBINSTRUMENT_DIR := $(JDK_OUTPUTDIR)/objs/libinstrument
    +LIBINSTRUMENT_CFLAGS := $(CFLAGS_JDKLIB) \
    +    -I$(JDK_TOPDIR)/src/share/instrument \
    +    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/instrument \
    +    -I$(JDK_TOPDIR)/src/share/bin
    +
    +LIBINSTRUMENT_LDFLAGS :=
    +LIBINSTRUMENT_LDFLAGS_SUFFIX :=
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  LIBINSTRUMENT_LDFLAGS += $(JDK_OUTPUTDIR)/objs/jli_static.lib $(WIN_JAVA_LIB) \
    +      -export:Agent_OnAttach advapi32.lib
    +  # Statically link the C runtime so that there are not dependencies on modules
    +  # not on the search patch when invoked from the Windows system directory
    +  # (or elsewhere).
    +  LIBINSTRUMENT_CFLAGS := $(filter-out -MD, $(LIBINSTRUMENT_CFLAGS))
    +  # equivalent of strcasecmp is stricmp on Windows
    +  LIBINSTRUMENT_CFLAGS += -Dstrcasecmp=stricmp
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
    +    LIBRARY := instrument, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(LIBINSTRUMENT_SRC), \
    +    INCLUDE_FILES := $(LIBINSTRUMENT_FILES), \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(LIBINSTRUMENT_CFLAGS), \
    +    CFLAGS_debug := -DJPLIS_LOGGING, \
    +    CFLAGS_release := -DNO_JPLIS_LOGGING, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libinstrument/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN) \
    +        $(LIBINSTRUMENT_LDFLAGS), \
    +    LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
    +    LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli), \
    +    LDFLAGS_macosx := -Xlinker -all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
    +        -framework Cocoa -framework Security -framework ApplicationServices, \
    +    LDFLAGS_SUFFIX := $(LIBINSTRUMENT_LDFLAGS_SUFFIX), \
    +    LDFLAGS_SUFFIX_macosx := -liconv $(LIBZ), \
    +    LDFLAGS_SUFFIX_solaris := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL) -lc, \
    +    LDFLAGS_SUFFIX_linux := $(LIBZ) -L $(INSTALL_LIBRARIES_HERE)/jli -ljli $(LIBDL), \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=instrument.dll" \
    +        -D "JDK_INTERNAL_NAME=instrument" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(LIBINSTRUMENT_DIR), \
    +    DEBUG_SYMBOLS := true))
    +
    +ifneq (, $(findstring $(OPENJDK_TARGET_OS), macosx windows))
    +  $(BUILD_LIBINSTRUMENT): $(JDK_OUTPUTDIR)/objs/$(LIBRARY_PREFIX)jli_static$(STATIC_LIBRARY_SUFFIX)
    +else
    +  $(BUILD_LIBINSTRUMENT): $(INSTALL_LIBRARIES_HERE)/jli/$(LIBRARY_PREFIX)jli$(SHARED_LIBRARY_SUFFIX)
    +endif
    +$(BUILD_LIBINSTRUMENT): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBINSTRUMENT)
    +
    +##########################################################################################
    +
    +BUILD_LIBMANAGEMENT_SRC := $(JDK_TOPDIR)/src/share/native/sun/management \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/sun/management \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/management
    +
    +BUILD_LIBMANAGEMENT_EXCLUDES :=
    +
    +BUILD_LIBMANAGEMENT_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/sun/management
    +
    +ifneq ($(OPENJDK_TARGET_OS), windows)
    +  BUILD_LIBMANAGEMENT_EXCLUDES += OperatingSystem_md.c
    +else
    +  BUILD_LIBMANAGEMENT_EXCLUDES += UnixOperatingSystem_md.c
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), solaris)
    +  BUILD_LIBMANAGEMENT_EXCLUDES += SolarisOperatingSystem.c
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), linux)
    +  BUILD_LIBMANAGEMENT_EXCLUDES += LinuxOperatingSystem.c
    +endif
    +
    +ifneq ($(OPENJDK_TARGET_OS), macosx)
    +  BUILD_LIBMANAGEMENT_EXCLUDES += MacosxOperatingSystem.c
    +endif
    +
    +LIBMANAGEMENT_OPTIMIZATION := HIGH
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
    +  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    +    LIBMANAGEMENT_OPTIMIZATION := LOW
    +  endif
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBMANAGEMENT, \
    +    LIBRARY := management, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(BUILD_LIBMANAGEMENT_SRC), \
    +    EXCLUDE_FILES := $(BUILD_LIBMANAGEMENT_EXCLUDES), \
    +    LANG := C, \
    +    OPTIMIZATION := $(LIBMANAGEMENT_OPTIMIZATION), \
    +    CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBMANAGEMENT_CFLAGS), \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libmanagement/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_solaris := -lkstat, \
    +    LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX), \
    +    LDFLAGS_SUFFIX_windows := jvm.lib psapi.lib $(WIN_JAVA_LIB) advapi32.lib, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=management.dll" \
    +        -D "JDK_INTERNAL_NAME=management" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libmanagement, \
    +    DEBUG_SYMBOLS := true))
    +
    +$(BUILD_LIBMANAGEMENT): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBMANAGEMENT)
    +
    +##########################################################################################
    +
    +BUILD_LIBHPROF_SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/hprof $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/hprof
    +BUILD_LIBHPROF_CFLAGS := -I$(JDK_TOPDIR)/src/share/demo/jvmti/hprof \
    +    -I$(JDK_TOPDIR)/src/share/npt \
    +    -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
    +    -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo
    +
    +BUILD_LIBHPROF_LDFLAGS :=
    +
    +LIBHPROF_OPTIMIZATION := HIGHEST
    +ifneq ($(findstring $(OPENJDK_TARGET_OS), solaris linux), )
    +  ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
    +    LIBHPROF_OPTIMIZATION := LOW
    +  endif
    +endif
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBHPROF, \
    +    LIBRARY := hprof, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(BUILD_LIBHPROF_SRC), \
    +    LANG := C, \
    +    OPTIMIZATION := $(LIBHPROF_OPTIMIZATION), \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(BUILD_LIBHPROF_CFLAGS), \
    +    CFLAGS_debug := -DHPROF_LOGGING, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libhprof/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_windows := wsock32.lib winmm.lib advapi32.lib, \
    +    LDFLAGS_SUFFIX_linux := $(LIBDL), \
    +    LDFLAGS_SUFFIX_macosx := $(LIBDL), \
    +    LDFLAGS_SUFFIX_solaris := -lsocket -lnsl $(LIBDL) -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=hprof.dll" \
    +        -D "JDK_INTERNAL_NAME=hprof" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libhprof_jvmti, \
    +    DEBUG_SYMBOLS := true))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBHPROF)
    +
    +##########################################################################################
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJAVA_CRW_DEMO, \
    +    LIBRARY := java_crw_demo, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \
    +    LANG := C, \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        -I$(JDK_TOPDIR)/src/share/demo/jvmti/java_crw_demo, \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjava_crw_demo/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=java_crw_demo.dll" \
    +        -D "JDK_INTERNAL_NAME=java_crw_demo" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjava_crw_demo, \
    +    DEBUG_SYMBOLS := true))
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJAVA_CRW_DEMO)
    +
    +##########################################################################################
    +
    +ifndef OPENJDK
    +  ifeq ($(ENABLE_JFR), true)
    +
    +    $(eval $(call SetupNativeCompilation,BUILD_LIBJFR, \
    +        LIBRARY := jfr, \
    +        OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +        SRC := $(JDK_TOPDIR)/src/closed/share/native/oracle/jfr, \
    +        LANG := C, \
    +        OPTIMIZATION := LOW, \
    +        CFLAGS := $(CFLAGS_JDKLIB) \
    +            -I$(JDK_TOPDIR)/src/closed/share/javavm/export, \
    +        MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjfr/mapfile-vers, \
    +        LDFLAGS := $(LDFLAGS_JDKLIB) \
    +            $(call SET_SHARED_LIBRARY_ORIGIN), \
    +        LDFLAGS_SUFFIX_solaris := -lc, \
    +        VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +        RC_FLAGS := $(RC_FLAGS) \
    +            -D "JDK_FNAME=jfr.dll" \
    +            -D "JDK_INTERNAL_NAME=jfr" \
    +            -D "JDK_FTYPE=0x2L", \
    +        OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjfr, \
    +        DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +    BUILD_LIBRARIES += $(BUILD_LIBJFR)
    +
    +  endif
    +endif
    diff --git a/jdk/makefiles/lib/SoundLibraries.gmk b/jdk/makefiles/lib/SoundLibraries.gmk
    new file mode 100644
    index 00000000000..dc507ab58cf
    --- /dev/null
    +++ b/jdk/makefiles/lib/SoundLibraries.gmk
    @@ -0,0 +1,237 @@
    +#
    +# Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    +# particular file as subject to the "Classpath" exception as provided
    +# by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    +# or visit www.oracle.com if you need additional information or have any
    +# questions.
    +#
    +
    +LIBJSOUND_SRC_DIRS := \
    +    $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \
    +    $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound
    +
    +LIBJSOUND_SRC_FILES := Utilities.c Platform.c
    +
    +LIBJSOUND_LANG := C
    +LIBJSOUND_CFLAGS := $(foreach dir, $(LIBJSOUND_SRC_DIRS), -I$(dir))
    +
    +EXTRA_SOUND_JNI_LIBS :=
    +
    +LIBJSOUND_MIDIFILES := \
    +    MidiInDevice.c \
    +    MidiInDeviceProvider.c \
    +    MidiOutDevice.c \
    +    MidiOutDeviceProvider.c \
    +    PlatformMidi.c
    +
    +# files needed for ports
    +LIBJSOUND_PORTFILES := \
    +    PortMixerProvider.c \
    +    PortMixer.c
    +
    +# files needed for direct audio
    +LIBJSOUND_DAUDIOFILES := \
    +    DirectAudioDeviceProvider.c \
    +    DirectAudioDevice.c
    +
    +ifeq ($(OPENJDK_TARGET_OS), windows)
    +  EXTRA_SOUND_JNI_LIBS += jsoundds
    +  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_WINDOWS \
    +      -DUSE_PLATFORM_MIDI_OUT=TRUE \
    +      -DUSE_PLATFORM_MIDI_IN=TRUE \
    +      -DUSE_PORTS=TRUE
    +  LIBJSOUND_SRC_FILES += \
    +      PLATFORM_API_WinOS_MidiIn.cpp \
    +      PLATFORM_API_WinOS_MidiOut.c \
    +      PLATFORM_API_WinOS_Util.c \
    +      PLATFORM_API_WinOS_Ports.c
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    +endif # OPENJDK_TARGET_OS windows
    +
    +ifeq ($(OPENJDK_TARGET_OS), linux)
    +  EXTRA_SOUND_JNI_LIBS += jsoundalsa
    +  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_LINUX
    +endif # OPENJDK_TARGET_OS linux
    +
    +ifeq ($(OPENJDK_TARGET_OS), macosx)
    +  LIBJSOUND_LANG := C++
    +  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_MACOSX \
    +      -DUSE_PORTS=TRUE \
    +      -DUSE_DAUDIO=TRUE \
    +      -DUSE_PLATFORM_MIDI_OUT=TRUE \
    +      -DUSE_PLATFORM_MIDI_IN=TRUE
    +  LIBJSOUND_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/com/sun/media/sound
    +  LIBJSOUND_SRC_FILES += \
    +      PLATFORM_API_MacOSX_Utils.cpp \
    +      PLATFORM_API_MacOSX_PCM.cpp \
    +      PLATFORM_API_MacOSX_Ports.cpp \
    +      PLATFORM_API_MacOSX_MidiIn.c \
    +      PLATFORM_API_MacOSX_MidiOut.c \
    +      PLATFORM_API_MacOSX_MidiUtils.c
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
    +endif # OPENJDK_TARGET_OS macosx
    +
    +ifeq ($(OPENJDK_TARGET_OS), solaris)
    +  LIBJSOUND_CFLAGS += -DX_PLATFORM=X_SOLARIS \
    +      -DUSE_PORTS=TRUE \
    +      -DUSE_DAUDIO=TRUE
    +  LIBJSOUND_SRC_FILES += \
    +      PLATFORM_API_SolarisOS_Utils.c \
    +      PLATFORM_API_SolarisOS_Ports.c \
    +      PLATFORM_API_SolarisOS_PCM.c
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_MIDIFILES)
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_PORTFILES)
    +  LIBJSOUND_SRC_FILES += $(LIBJSOUND_DAUDIOFILES)
    +endif # OPENJDK_TARGET_OS solaris
    +
    +
    +ifeq ($(JVM_VARIANT_ZERO), true)
    +  LIBJSOUND_CFLAGS += -DX_ARCH=X_ZERO
    +else
    +  ifeq ($(OPENJDK_TARGET_CPU), x86)
    +    LIBJSOUND_CFLAGS += -DX_ARCH=X_I586
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_CPU), sparc)
    +    LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARC
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_CPU), sparcv9)
    +    LIBJSOUND_CFLAGS += -DX_ARCH=X_SPARCV9
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_CPU), x86_64)
    +    LIBJSOUND_CFLAGS += -DX_ARCH=X_AMD64
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_CPU), arm)
    +    LIBJSOUND_CFLAGS += -DX_ARCH=X_ARM
    +  endif
    +
    +  ifeq ($(OPENJDK_TARGET_CPU), ppc)
    +    LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC
    +  endif
    +endif
    +
    +LIBJSOUND_CFLAGS += -DEXTRA_SOUND_JNI_LIBS='"$(EXTRA_SOUND_JNI_LIBS)"'
    +
    +$(eval $(call SetupNativeCompilation,BUILD_LIBJSOUND, \
    +    LIBRARY := jsound, \
    +    OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +    SRC := $(LIBJSOUND_SRC_DIRS), \
    +    INCLUDE_FILES := $(LIBJSOUND_SRC_FILES), \
    +    LANG := $(LIBJSOUND_LANG), \
    +    OPTIMIZATION := LOW, \
    +    CFLAGS := $(CFLAGS_JDKLIB) \
    +        $(LIBJSOUND_CFLAGS), \
    +    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(LIBJSOUND_CFLAGS), \
    +    MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsound/mapfile-vers, \
    +    LDFLAGS := $(LDFLAGS_JDKLIB) \
    +        $(call SET_SHARED_LIBRARY_ORIGIN), \
    +    LDFLAGS_macosx := -framework CoreAudio -framework CoreFoundation \
    +        -framework CoreServices -framework AudioUnit $(LIBCXX) \
    +        -framework CoreMIDI -framework AudioToolbox, \
    +    LDFLAGS_windows := $(WIN_JAVA_LIB) advapi32.lib winmm.lib, \
    +    LDFLAGS_SUFFIX_posix := -ljava -ljvm, \
    +    LDFLAGS_SUFFIX_solaris := -lc, \
    +    VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +    RC_FLAGS := $(RC_FLAGS) \
    +        -D "JDK_FNAME=jsound.dll" \
    +        -D "JDK_INTERNAL_NAME=jsound" \
    +        -D "JDK_FTYPE=0x2L", \
    +    OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsound, \
    +    DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +$(BUILD_LIBJSOUND): $(BUILD_LIBJAVA)
    +
    +BUILD_LIBRARIES += $(BUILD_LIBJSOUND)
    +
    +##########################################################################################
    +
    +ifneq ($(filter jsoundalsa, $(EXTRA_SOUND_JNI_LIBS)), )
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDALSA, \
    +      LIBRARY := jsoundalsa, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(LIBJSOUND_SRC_DIRS), \
    +      INCLUDE_FILES := Utilities.c $(LIBJSOUND_MIDIFILES) $(LIBJSOUND_PORTFILES) \
    +          $(LIBJSOUND_DAUDIOFILES) \
    +          PLATFORM_API_LinuxOS_ALSA_CommonUtils.c \
    +          PLATFORM_API_LinuxOS_ALSA_PCM.c \
    +          PLATFORM_API_LinuxOS_ALSA_PCMUtils.c \
    +          PLATFORM_API_LinuxOS_ALSA_MidiIn.c \
    +          PLATFORM_API_LinuxOS_ALSA_MidiOut.c \
    +          PLATFORM_API_LinuxOS_ALSA_MidiUtils.c \
    +          PLATFORM_API_LinuxOS_ALSA_Ports.c, \
    +      LANG := C, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) $(ALSA_CFLAGS) \
    +          $(LIBJSOUND_CFLAGS) \
    +          -DUSE_DAUDIO=TRUE \
    +          -DUSE_PORTS=TRUE \
    +          -DUSE_PLATFORM_MIDI_OUT=TRUE \
    +          -DUSE_PLATFORM_MIDI_IN=TRUE, \
    +      MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/libjsoundalsa/mapfile-vers, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := $(ALSA_LIBS) -ljava -ljvm, \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundalsa, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBJSOUNDALSA): $(BUILD_LIBJAVA)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBJSOUNDALSA)
    +
    +endif
    +
    +##########################################################################################
    +
    +ifneq ($(filter jsoundds, $(EXTRA_SOUND_JNI_LIBS)), )
    +
    +  $(eval $(call SetupNativeCompilation,BUILD_LIBJSOUNDDS, \
    +      LIBRARY := jsoundds, \
    +      OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
    +      SRC := $(LIBJSOUND_SRC_DIRS), \
    +      INCLUDE_FILES := Utilities.c $(LIBJSOUND_DAUDIOFILES) \
    +          PLATFORM_API_WinOS_DirectSound.cpp, \
    +      LANG := C++, \
    +      OPTIMIZATION := LOW, \
    +      CFLAGS := $(CFLAGS_JDKLIB) \
    +          $(LIBJSOUND_CFLAGS) \
    +          -DUSE_DAUDIO=TRUE, \
    +      LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
    +          $(call SET_SHARED_LIBRARY_ORIGIN), \
    +      LDFLAGS_SUFFIX := $(LDFLAGS_JDKLIB_SUFFIX) dsound.lib winmm.lib user32.lib ole32.lib, \
    +      VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
    +      RC_FLAGS := $(RC_FLAGS) \
    +          -D "JDK_FNAME=jsoundds.dll" \
    +          -D "JDK_INTERNAL_NAME=jsoundds" \
    +          -D "JDK_FTYPE=0x2L", \
    +      OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libjsoundds, \
    +      DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
    +
    +  $(BUILD_LIBJSOUNDDS): $(BUILD_LIBJAVA)
    +
    +  BUILD_LIBRARIES += $(BUILD_LIBJSOUNDDS)
    +
    +endif
    diff --git a/jdk/makefiles/mapfiles/libmanagement/mapfile-vers b/jdk/makefiles/mapfiles/libmanagement/mapfile-vers
    index b934fe8b748..724f7bb7100 100644
    --- a/jdk/makefiles/mapfiles/libmanagement/mapfile-vers
    +++ b/jdk/makefiles/mapfiles/libmanagement/mapfile-vers
    @@ -57,7 +57,7 @@ SUNWprivate_1.1 {
     	    Java_sun_management_GcInfoBuilder_fillGcAttributeInfo;
     	    Java_sun_management_GcInfoBuilder_getLastGcInfo0;
     	    Java_sun_management_GcInfoBuilder_getNumGcExtAttributes;
    -	    Java_sun_management_HotSpotDiagnostic_dumpHeap;
    +	    Java_sun_management_HotSpotDiagnostic_dumpHeap0;
     	    Java_sun_management_HotspotThread_getInternalThreadCount;
     	    Java_sun_management_HotspotThread_getInternalThreadTimes0;
     	    Java_sun_management_MemoryImpl_getMemoryManagers0;
    diff --git a/jdk/makefiles/profile-includes.txt b/jdk/makefiles/profile-includes.txt
    index 1d1adbff060..105f9d36689 100644
    --- a/jdk/makefiles/profile-includes.txt
    +++ b/jdk/makefiles/profile-includes.txt
    @@ -33,8 +33,6 @@ PROFILE_1_JRE_LIB_FILES := \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsig.diz \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)net$(SHARED_LIBRARY_SUFFIX) \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)nio$(SHARED_LIBRARY_SUFFIX) \
    -    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \
    -    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sunec$(SHARED_LIBRARY_SUFFIX) \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify$(SHARED_LIBRARY_SUFFIX) \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)verify.diz \
    @@ -130,6 +128,8 @@ PROFILE_3_JRE_LIB_FILES := \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)jsdt.diz \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management$(SHARED_LIBRARY_SUFFIX) \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)management.diz \
    +    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt$(SHARED_LIBRARY_SUFFIX) \
    +    $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)npt.diz \
         $(OPENJDK_TARGET_CPU_LEGACY_LIB)/$(LIBRARY_PREFIX)sctp$(SHARED_LIBRARY_SUFFIX) \
         jvm.hprof.txt \
         management-agent.jar \
    diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java
    index 457b82d36a3..046d693e329 100644
    --- a/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java
    +++ b/jdk/src/macosx/classes/com/apple/laf/AquaLookAndFeel.java
    @@ -37,8 +37,6 @@ import javax.swing.plaf.basic.BasicLookAndFeel;
     import sun.swing.*;
     import apple.laf.*;
     
    -import com.apple.resources.MacOSXResourceBundle;
    -
     public class AquaLookAndFeel extends BasicLookAndFeel {
         static final String sOldPropertyPrefix = "com.apple.macos."; // old prefix for things like 'useScreenMenuBar'
         static final String sPropertyPrefix = "apple.laf."; // new prefix for things like 'useScreenMenuBar'
    @@ -252,7 +250,7 @@ public class AquaLookAndFeel extends BasicLookAndFeel {
             table.setDefaultLocale(Locale.getDefault());
             table.addResourceBundle(PKG_PREFIX + "resources.aqua");
             try {
    -            final ResourceBundle aquaProperties = MacOSXResourceBundle.getMacResourceBundle(PKG_PREFIX + "resources.aqua");
    +            final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua");
                 final Enumeration propertyKeys = aquaProperties.getKeys();
     
                 while (propertyKeys.hasMoreElements()) {
    diff --git a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
    index 0592da714a2..a5f5501cb35 100644
    --- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
    +++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2011, 2013, Oracle and/or its affiliates. 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
    @@ -29,6 +29,7 @@ import java.awt.*;
     import java.awt.image.*;
     import java.lang.ref.SoftReference;
     import java.lang.reflect.Method;
    +import java.security.AccessController;
     import java.security.PrivilegedAction;
     import java.util.*;
     
    @@ -41,56 +42,68 @@ import sun.awt.AppContext;
     import sun.lwawt.macosx.CImage;
     import sun.lwawt.macosx.CImage.Creator;
     import sun.lwawt.macosx.CPlatformWindow;
    +import sun.misc.Launcher;
    +import sun.reflect.misc.ReflectUtil;
    +import sun.security.action.GetPropertyAction;
     import sun.swing.SwingUtilities2;
     
     import com.apple.laf.AquaImageFactory.SlicedImageControl;
     
    -public class AquaUtils {
    -    final static String ANIMATIONS_SYSTEM_PROPERTY = "swing.enableAnimations";
    +final class AquaUtils {
     
    -    /*
    +    private static final String ANIMATIONS_PROPERTY = "swing.enableAnimations";
    +
    +    /**
    +     * Suppresses default constructor, ensuring non-instantiability.
    +     */
    +    private AquaUtils() {
    +    }
    +
    +    /**
          * Convenience function for determining ComponentOrientation.  Helps us
          * avoid having Munge directives throughout the code.
          */
    -    public static boolean isLeftToRight(final Component c) {
    +    static boolean isLeftToRight(final Component c) {
             return c.getComponentOrientation().isLeftToRight();
         }
     
    -    public static void enforceComponentOrientation(Component c, ComponentOrientation orientation) {
    +    static void enforceComponentOrientation(final Component c, final ComponentOrientation orientation) {
             c.setComponentOrientation(orientation);
             if (c instanceof Container) {
    -            for (Component child : ((Container)c).getComponents()) {
    +            for (final Component child : ((Container)c).getComponents()) {
                     enforceComponentOrientation(child, orientation);
                 }
             }
         }
     
    -    private static CImage.Creator getCImageCreatorInternal() {
    -        return java.security.AccessController.doPrivileged(new PrivilegedAction() {
    +    private static Creator getCImageCreatorInternal() {
    +        return AccessController.doPrivileged(new PrivilegedAction() {
    +            @Override
                 public Creator run() {
                     try {
                         final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {});
                         getCreatorMethod.setAccessible(true);
    -                    return (CImage.Creator)getCreatorMethod.invoke(null, new Object[] {});
    -                } catch (final Exception e) {
    +                    return (Creator)getCreatorMethod.invoke(null, new Object[] {});
    +                } catch (final Exception ignored) {
                         return null;
                     }
                 }
             });
         }
     
    -    private static final RecyclableSingleton cImageCreator = new RecyclableSingleton() {
    +    private static final RecyclableSingleton cImageCreator = new RecyclableSingleton() {
             @Override
             protected Creator getInstance() {
                 return getCImageCreatorInternal();
             }
         };
    -    static CImage.Creator getCImageCreator() {
    +    static Creator getCImageCreator() {
             return cImageCreator.get();
         }
     
    -    protected static Image generateSelectedDarkImage(final Image image) {
    +    static Image generateSelectedDarkImage(final Image image) {
             final ImageProducer prod = new FilteredImageSource(image.getSource(), new IconImageFilter() {
    +            @Override
                 int getGreyFor(final int gray) {
                     return gray * 75 / 100;
                 }
    @@ -98,8 +111,9 @@ public class AquaUtils {
             return Toolkit.getDefaultToolkit().createImage(prod);
         }
     
    -    protected static Image generateDisabledImage(final Image image) {
    +    static Image generateDisabledImage(final Image image) {
             final ImageProducer prod = new FilteredImageSource(image.getSource(), new IconImageFilter() {
    +            @Override
                 int getGreyFor(final int gray) {
                     return 255 - ((255 - gray) * 65 / 100);
                 }
    @@ -107,19 +121,20 @@ public class AquaUtils {
             return Toolkit.getDefaultToolkit().createImage(prod);
         }
     
    -    protected static Image generateLightenedImage(final Image image, final int percent) {
    +    static Image generateLightenedImage(final Image image, final int percent) {
             final GrayFilter filter = new GrayFilter(true, percent);
             final ImageProducer prod = new FilteredImageSource(image.getSource(), filter);
             return Toolkit.getDefaultToolkit().createImage(prod);
         }
     
    -    static abstract class IconImageFilter extends RGBImageFilter {
    -        public IconImageFilter() {
    +    private abstract static class IconImageFilter extends RGBImageFilter {
    +        IconImageFilter() {
                 super();
                 canFilterIndexColorModel = true;
             }
     
    -        public int filterRGB(final int x, final int y, final int rgb) {
    +        @Override
    +        public final int filterRGB(final int x, final int y, final int rgb) {
                 final int red = (rgb >> 16) & 0xff;
                 final int green = (rgb >> 8) & 0xff;
                 final int blue = rgb & 0xff;
    @@ -135,14 +150,14 @@ public class AquaUtils {
                 return result;
             }
     
    -        abstract int getGreyFor(final int gray);
    +        abstract int getGreyFor(int gray);
         }
     
    -    public abstract static class RecyclableObject {
    -        protected SoftReference objectRef = null;
    +    abstract static class RecyclableObject {
    +        private SoftReference objectRef;
     
    -        public T get() {
    -            T referent = null;
    +        T get() {
    +            T referent;
                 if (objectRef != null && (referent = objectRef.get()) != null) return referent;
                 referent = create();
                 objectRef = new SoftReference(referent);
    @@ -152,8 +167,8 @@ public class AquaUtils {
             protected abstract T create();
         }
     
    -    public abstract static class RecyclableSingleton {
    -        public T get() {
    +    abstract static class RecyclableSingleton {
    +        final T get() {
                 final AppContext appContext = AppContext.getAppContext();
                 SoftReference ref = (SoftReference) appContext.get(this);
                 if (ref != null) {
    @@ -166,38 +181,36 @@ public class AquaUtils {
                 return object;
             }
     
    -        public void reset() {
    -            AppContext appContext = AppContext.getAppContext();
    -            appContext.remove(this);
    +        void reset() {
    +            AppContext.getAppContext().remove(this);
             }
     
    -        protected abstract T getInstance();
    +        abstract T getInstance();
         }
     
    -    public static class RecyclableSingletonFromDefaultConstructor extends RecyclableSingleton {
    -        protected final Class clazz;
    +    static class RecyclableSingletonFromDefaultConstructor extends RecyclableSingleton {
    +        private final Class clazz;
     
    -        public RecyclableSingletonFromDefaultConstructor(final Class clazz) {
    +        RecyclableSingletonFromDefaultConstructor(final Class clazz) {
                 this.clazz = clazz;
             }
     
    -        protected T getInstance() {
    +        @Override
    +        T getInstance() {
                 try {
    +                ReflectUtil.checkPackageAccess(clazz);
                     return clazz.newInstance();
    -            } catch (final InstantiationException e) {
    -                e.printStackTrace();
    -            } catch (final IllegalAccessException e) {
    -                e.printStackTrace();
    +            } catch (InstantiationException | IllegalAccessException ignored) {
                 }
                 return null;
             }
         }
     
    -    public abstract static class LazyKeyedSingleton {
    -        protected Map refs;
    +    abstract static class LazyKeyedSingleton {
    +        private Map refs;
     
    -        public V get(final K key) {
    -            if (refs == null) refs = new HashMap();
    +        V get(final K key) {
    +            if (refs == null) refs = new HashMap<>();
     
                 final V cachedValue = refs.get(key);
                 if (cachedValue != null) return cachedValue;
    @@ -207,44 +220,45 @@ public class AquaUtils {
                 return value;
             }
     
    -        protected abstract V getInstance(final K key);
    +        protected abstract V getInstance(K key);
         }
     
    -    static final RecyclableSingleton enableAnimations = new RecyclableSingleton() {
    +    private static final RecyclableSingleton enableAnimations = new RecyclableSingleton() {
             @Override
             protected Boolean getInstance() {
    -            final String sizeProperty = (String)java.security.AccessController.doPrivileged((PrivilegedAction)new sun.security.action.GetPropertyAction(ANIMATIONS_SYSTEM_PROPERTY));
    -            return new Boolean(!"false".equals(sizeProperty)); // should be true by default
    +            final String sizeProperty = (String) AccessController.doPrivileged((PrivilegedAction)new GetPropertyAction(
    +                    ANIMATIONS_PROPERTY));
    +            return !"false".equals(sizeProperty); // should be true by default
             }
         };
    -    static boolean animationsEnabled() {
    +    private static boolean animationsEnabled() {
             return enableAnimations.get();
         }
     
    -    static final int MENU_BLINK_DELAY = 50; // 50ms == 3/60 sec, according to the spec
    -    protected static void blinkMenu(final Selectable selectable) {
    +    private static final int MENU_BLINK_DELAY = 50; // 50ms == 3/60 sec, according to the spec
    +    static void blinkMenu(final Selectable selectable) {
             if (!animationsEnabled()) return;
             try {
                 selectable.paintSelected(false);
                 Thread.sleep(MENU_BLINK_DELAY);
                 selectable.paintSelected(true);
                 Thread.sleep(MENU_BLINK_DELAY);
    -        } catch (final InterruptedException e) { }
    +        } catch (final InterruptedException ignored) { }
         }
     
         interface Selectable {
    -        void paintSelected(final boolean selected);
    +        void paintSelected(boolean selected);
         }
     
         interface JComponentPainter {
    -        public void paint(JComponent c, Graphics g, int x, int y, int w, int h);
    +        void paint(JComponent c, Graphics g, int x, int y, int w, int h);
         }
     
         interface Painter {
    -        public void paint(final Graphics g, int x, int y, int w, int h);
    +        void paint(Graphics g, int x, int y, int w, int h);
         }
     
    -    public static void paintDropShadowText(final Graphics g, final JComponent c, final Font font, final FontMetrics metrics, final int x, final int y, final int offsetX, final int offsetY, final Color textColor, final Color shadowColor, final String text) {
    +    static void paintDropShadowText(final Graphics g, final JComponent c, final Font font, final FontMetrics metrics, final int x, final int y, final int offsetX, final int offsetY, final Color textColor, final Color shadowColor, final String text) {
             g.setFont(font);
             g.setColor(shadowColor);
             SwingUtilities2.drawString(c, g, text, x + offsetX, y + offsetY + metrics.getAscent());
    @@ -252,22 +266,22 @@ public class AquaUtils {
             SwingUtilities2.drawString(c, g, text, x, y + metrics.getAscent());
         }
     
    -    public static class ShadowBorder implements Border {
    -        final Painter prePainter;
    -        final Painter postPainter;
    +    static class ShadowBorder implements Border {
    +        private final Painter prePainter;
    +        private final Painter postPainter;
     
    -        final int offsetX;
    -        final int offsetY;
    -        final float distance;
    -        final int blur;
    -        final Insets insets;
    -        final ConvolveOp blurOp;
    +        private final int offsetX;
    +        private final int offsetY;
    +        private final float distance;
    +        private final int blur;
    +        private final Insets insets;
    +        private final ConvolveOp blurOp;
     
    -        public ShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur) {
    +        ShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur) {
                 this.prePainter = prePainter; this.postPainter = postPainter;
                 this.offsetX = offsetX; this.offsetY = offsetY; this.distance = distance; this.blur = blur;
                 final int halfBlur = blur / 2;
    -            this.insets = new Insets(halfBlur - offsetY, halfBlur - offsetX, halfBlur + offsetY, halfBlur + offsetX);
    +            insets = new Insets(halfBlur - offsetY, halfBlur - offsetX, halfBlur + offsetY, halfBlur + offsetX);
     
                 final float blurry = intensity / (blur * blur);
                 final float[] blurKernel = new float[blur * blur];
    @@ -275,14 +289,17 @@ public class AquaUtils {
                 blurOp = new ConvolveOp(new Kernel(blur, blur, blurKernel));
             }
     
    -        public boolean isBorderOpaque() {
    +        @Override
    +        public final boolean isBorderOpaque() {
                 return false;
             }
     
    -        public Insets getBorderInsets(final Component c) {
    +        @Override
    +        public final Insets getBorderInsets(final Component c) {
                 return insets;
             }
     
    +        @Override
             public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
                 final BufferedImage img = new BufferedImage(width + blur * 2, height + blur * 2, BufferedImage.TYPE_INT_ARGB_PRE);
                 paintToImage(img, x, y, width, height);
    @@ -290,7 +307,7 @@ public class AquaUtils {
                 g.drawImage(img, -blur, -blur, null);
             }
     
    -        protected void paintToImage(final BufferedImage img, final int x, final int y, final int width, final int height) {
    +        private void paintToImage(final BufferedImage img, final int x, final int y, final int width, final int height) {
                 // clear the prior image
                 Graphics2D imgG = (Graphics2D)img.getGraphics();
                 imgG.setComposite(AlphaComposite.Clear);
    @@ -319,10 +336,10 @@ public class AquaUtils {
             }
         }
     
    -    public static class SlicedShadowBorder extends ShadowBorder {
    -        final SlicedImageControl slices;
    +    static class SlicedShadowBorder extends ShadowBorder {
    +        private final SlicedImageControl slices;
     
    -        public SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) {
    +        SlicedShadowBorder(final Painter prePainter, final Painter postPainter, final int offsetX, final int offsetY, final float distance, final float intensity, final int blur, final int templateWidth, final int templateHeight, final int leftCut, final int topCut, final int rightCut, final int bottomCut) {
                 super(prePainter, postPainter, offsetX, offsetY, distance, intensity, blur);
     
                 final BufferedImage i = new BufferedImage(templateWidth, templateHeight, BufferedImage.TYPE_INT_ARGB_PRE);
    @@ -331,15 +348,12 @@ public class AquaUtils {
                 slices = new SlicedImageControl(i, leftCut, topCut, rightCut, bottomCut, false);
             }
     
    +        @Override
             public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
                 slices.paint(g, x, y, width, height);
             }
         }
     
    -    public interface NineSliceMetricsProvider {
    -
    -    }
    -
     //    static void debugFrame(String name, Image image) {
     //        JFrame f = new JFrame(name);
     //        f.setContentPane(new JLabel(new ImageIcon(image)));
    @@ -350,28 +364,30 @@ public class AquaUtils {
         // special casing naughty applications, like InstallAnywhere
         //  REGR: JButton: Myst IV: the buttons of 1.0.3 updater have redraw issue
         static boolean shouldUseOpaqueButtons() {
    -        final ClassLoader launcherClassLoader = sun.misc.Launcher.getLauncher().getClassLoader();
    +        final ClassLoader launcherClassLoader = Launcher.getLauncher().getClassLoader();
             if (classExists(launcherClassLoader, "com.installshield.wizard.platform.macosx.MacOSXUtils")) return true;
             return false;
         }
     
    -    static boolean classExists(final ClassLoader classLoader, final String clazzName) {
    +    private static boolean classExists(final ClassLoader classLoader, final String clazzName) {
             try {
                 return Class.forName(clazzName, false, classLoader) != null;
    -        } catch (final Throwable e) { }
    +        } catch (final Throwable ignored) { }
             return false;
         }
     
    -    private static RecyclableSingleton getJComponentGetFlagMethod = new RecyclableSingleton() {
    +    private static final RecyclableSingleton getJComponentGetFlagMethod = new RecyclableSingleton() {
    +        @Override
             protected Method getInstance() {
    -            return java.security.AccessController.doPrivileged(
    +            return AccessController.doPrivileged(
                     new PrivilegedAction() {
    +                    @Override
                         public Method run() {
                             try {
                                 final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class });
                                 method.setAccessible(true);
                                 return method;
    -                        } catch (final Throwable e) {
    +                        } catch (final Throwable ignored) {
                                 return null;
                             }
                         }
    @@ -380,18 +396,18 @@ public class AquaUtils {
             }
         };
     
    -    private static final Integer OPAQUE_SET_FLAG = new Integer(24); // private int JComponent.OPAQUE_SET
    -    protected static boolean hasOpaqueBeenExplicitlySet(final JComponent c) {
    +    private static final Integer OPAQUE_SET_FLAG = 24; // private int JComponent.OPAQUE_SET
    +    static boolean hasOpaqueBeenExplicitlySet(final JComponent c) {
             final Method method = getJComponentGetFlagMethod.get();
             if (method == null) return false;
             try {
                 return Boolean.TRUE.equals(method.invoke(c, OPAQUE_SET_FLAG));
    -        } catch (final Throwable e) {
    +        } catch (final Throwable ignored) {
                 return false;
             }
         }
     
    -    protected static boolean isWindowTextured(final Component c) {
    +    private static boolean isWindowTextured(final Component c) {
             if (!(c instanceof JComponent)) {
                 return false;
             }
    @@ -412,13 +428,12 @@ public class AquaUtils {
             return new Color(color.getRed(), color.getGreen(), color.getBlue(), 0);
         }
     
    -    protected static void fillRect(final Graphics g, final Component c) {
    +    static void fillRect(final Graphics g, final Component c) {
             fillRect(g, c, c.getBackground(), 0, 0, c.getWidth(), c.getHeight());
         }
     
    -    protected static void fillRect(final Graphics g, final Component c,
    -                                   final Color color, final int x, final int y,
    -                                   final int w, final int h) {
    +    static void fillRect(final Graphics g, final Component c, final Color color,
    +                         final int x, final int y, final int w, final int h) {
             if (!(g instanceof Graphics2D)) {
                 return;
             }
    diff --git a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java
    index 5f78ff6e061..87393408487 100644
    --- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java
    +++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenu.java
    @@ -36,7 +36,10 @@ import sun.awt.SunToolkit;
     import sun.lwawt.LWToolkit;
     import sun.lwawt.macosx.*;
     
    -class ScreenMenu extends Menu implements ContainerListener, ComponentListener, ScreenMenuPropertyHandler {
    +final class ScreenMenu extends Menu
    +        implements ContainerListener, ComponentListener,
    +                   ScreenMenuPropertyHandler {
    +
         static {
             java.security.AccessController.doPrivileged(
                 new java.security.PrivilegedAction() {
    @@ -48,20 +51,22 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
         }
     
         // screen menu stuff
    -    public static native long addMenuListeners(ScreenMenu listener, long nativeMenu);
    -    public static native void removeMenuListeners(long modelPtr);
    +    private static native long addMenuListeners(ScreenMenu listener, long nativeMenu);
    +    private static native void removeMenuListeners(long modelPtr);
     
    -    long fModelPtr = 0;
    +    private transient long fModelPtr;
     
    -    Hashtable fItems;
    -    JMenu fInvoker;
    +    private final Hashtable fItems;
    +    private final JMenu fInvoker;
     
    -    Component fLastMouseEventTarget;
    -    Rectangle fLastTargetRect;
    +    private Component fLastMouseEventTarget;
    +    private Rectangle fLastTargetRect;
         private volatile Rectangle[] fItemBounds;
     
    +    private ScreenMenuPropertyListener fPropertyListener;
    +
         // Array of child hashes used to see if we need to recreate the Menu.
    -    int childHashArray[];
    +    private int childHashArray[];
     
         ScreenMenu(final JMenu invoker) {
             super(invoker.getText());
    @@ -74,25 +79,12 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
             updateItems();
         }
     
    -    // I'm always 'visible', but never on screen
    -    static class ScreenMenuComponent extends Container {
    -        public boolean isVisible() { return true; }
    -        public boolean isShowing() { return true; }
    -        public void setVisible(final boolean b) {}
    -        public void show() {}
    -    }
    -
    -    ScreenMenuComponent makeScreenMenuComponent() {
    -        return new ScreenMenuComponent();
    -    }
    -
    -
         /**
          * Determine if we need to tear down the Menu and re-create it, since the contents may have changed in the Menu opened listener and
          * we do not get notified of it, because EDT is busy in our code. We only need to update if the menu contents have changed in some
          * way, such as the number of menu items, the text of the menuitems, icon, shortcut etc.
          */
    -    static boolean needsUpdate(final Component items[], final int childHashArray[]) {
    +    private static boolean needsUpdate(final Component items[], final int childHashArray[]) {
           if (items == null || childHashArray == null) {
             return true;
           }
    @@ -112,7 +104,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
          * Used to recreate the AWT based Menu structure that implements the Screen Menu.
          * Also computes hashcode and stores them so that we can compare them later in needsUpdate.
          */
    -    void updateItems() {
    +    private void updateItems() {
             final int count = fInvoker.getMenuComponentCount();
             final Component[] items = fInvoker.getMenuComponents();
             if (needsUpdate(items, childHashArray)) {
    @@ -163,16 +155,14 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
                 LWCToolkit.invokeAndWait(new Runnable() {
                     public void run() {
                         invoker.setSelected(false);
    -
    -            // Null out the tracking rectangles and the array.
    +                    // Null out the tracking rectangles and the array.
                         if (fItemBounds != null) {
    -            for (int i = 0; i < fItemBounds.length; i++) {
    -                fItemBounds[i] = null;
    -            }
    +                        for (int i = 0; i < fItemBounds.length; i++) {
    +                            fItemBounds[i] = null;
    +                        }
                         }
    -
    -            fItemBounds = null;
    -    }
    +                    fItemBounds = null;
    +                }
                 }, invoker);
             } catch (final Exception e) {
                 e.printStackTrace();
    @@ -237,49 +227,56 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
             });
         }
     
    -    ScreenMenuPropertyListener fPropertyListener;
    +    @Override
         public void addNotify() {
    -        super.addNotify();
    -        if (fModelPtr == 0) {
    -        fInvoker.addContainerListener(this);
    -        fInvoker.addComponentListener(this);
    -        fPropertyListener = new ScreenMenuPropertyListener(this);
    -        fInvoker.addPropertyChangeListener(fPropertyListener);
    +        synchronized (getTreeLock()) {
    +            super.addNotify();
    +            if (fModelPtr == 0) {
    +                fInvoker.addContainerListener(this);
    +                fInvoker.addComponentListener(this);
    +                fPropertyListener = new ScreenMenuPropertyListener(this);
    +                fInvoker.addPropertyChangeListener(fPropertyListener);
     
    -        final Icon icon = fInvoker.getIcon();
    -        if (icon != null) {
    -            this.setIcon(icon);
    -        }
    +                final Icon icon = fInvoker.getIcon();
    +                if (icon != null) {
    +                    setIcon(icon);
    +                }
     
    -        final String tooltipText = fInvoker.getToolTipText();
    -        if (tooltipText != null) {
    -            this.setToolTipText(tooltipText);
    -        }
    -        final MenuComponentPeer peer = getPeer();
    -        if (peer instanceof CMenu) {
    -            final CMenu menu = (CMenu)peer;
    -            final long nativeMenu = menu.getNativeMenu();
    -            fModelPtr = addMenuListeners(this, nativeMenu);
    +                final String tooltipText = fInvoker.getToolTipText();
    +                if (tooltipText != null) {
    +                    setToolTipText(tooltipText);
    +                }
    +                final MenuComponentPeer peer = getPeer();
    +                if (peer instanceof CMenu) {
    +                    final CMenu menu = (CMenu) peer;
    +                    final long nativeMenu = menu.getNativeMenu();
    +                    fModelPtr = addMenuListeners(this, nativeMenu);
    +                }
                 }
             }
         }
     
    +    @Override
         public void removeNotify() {
    -        // Call super so that the NSMenu has been removed, before we release the delegate in removeMenuListeners
    -        super.removeNotify();
    -        fItems.clear();
    -        if (fModelPtr != 0) {
    -            removeMenuListeners(fModelPtr);
    -            fModelPtr = 0;
    -            fInvoker.removeContainerListener(this);
    -            fInvoker.removeComponentListener(this);
    -            fInvoker.removePropertyChangeListener(fPropertyListener);
    +        synchronized (getTreeLock()) {
    +            // Call super so that the NSMenu has been removed, before we release
    +            // the delegate in removeMenuListeners
    +            super.removeNotify();
    +            fItems.clear();
    +            if (fModelPtr != 0) {
    +                removeMenuListeners(fModelPtr);
    +                fModelPtr = 0;
    +                fInvoker.removeContainerListener(this);
    +                fInvoker.removeComponentListener(this);
    +                fInvoker.removePropertyChangeListener(fPropertyListener);
    +            }
             }
         }
     
         /**
          * Invoked when a component has been added to the container.
          */
    +    @Override
         public void componentAdded(final ContainerEvent e) {
             addItem(e.getChild());
         }
    @@ -287,23 +284,26 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
         /**
          * Invoked when a component has been removed from the container.
          */
    +    @Override
         public void componentRemoved(final ContainerEvent e) {
             final Component child = e.getChild();
             final MenuItem sm = fItems.get(child);
             if (sm == null) return;
     
    -            remove(sm);
    -            fItems.remove(sm);
    -        }
    +        remove(sm);
    +        fItems.remove(sm);
    +    }
     
         /**
          * Invoked when the component's size changes.
          */
    +    @Override
         public void componentResized(final ComponentEvent e) {}
     
         /**
          * Invoked when the component's position changes.
          */
    +    @Override
         public void componentMoved(final ComponentEvent e) {}
     
         /**
    @@ -311,6 +311,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
          * See componentHidden - we should still have a MenuItem
          * it just isn't inserted
          */
    +    @Override
         public void componentShown(final ComponentEvent e) {
             setVisible(true);
         }
    @@ -321,11 +322,12 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
          * so we remove the ScreenMenuItem from the ScreenMenu
          * but leave it in fItems
          */
    +    @Override
         public void componentHidden(final ComponentEvent e) {
             setVisible(false);
         }
     
    -    public void setVisible(final boolean b) {
    +    private void setVisible(final boolean b) {
             // Tell our parent to add/remove us
             final MenuContainer parent = getParent();
     
    @@ -333,20 +335,24 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
                 if (parent instanceof ScreenMenu) {
                     final ScreenMenu sm = (ScreenMenu)parent;
                     sm.setChildVisible(fInvoker, b);
    -    }
    +            }
             }
         }
     
    +    @Override
         public void setChildVisible(final JMenuItem child, final boolean b) {
             fItems.remove(child);
             updateItems();
         }
     
    +    @Override
         public void setAccelerator(final KeyStroke ks) {}
     
         // only check and radio items can be indeterminate
    +    @Override
         public void setIndeterminate(boolean indeterminate) { }
     
    +    @Override
         public void setToolTipText(final String text) {
             final MenuComponentPeer peer = getPeer();
             if (!(peer instanceof CMenuItem)) return;
    @@ -355,6 +361,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
             cmi.setToolTipText(text);
         }
     
    +    @Override
         public void setIcon(final Icon i) {
             final MenuComponentPeer peer = getPeer();
             if (!(peer instanceof CMenuItem)) return;
    @@ -374,9 +381,8 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
         /**
          * Gets a hashCode for a JMenu or JMenuItem or subclass so that we can compare for
          * changes in the Menu.
    -     *
          */
    -    static int getHashCode(final Component m) {
    +    private static int getHashCode(final Component m) {
             int hashCode = m.hashCode();
     
             if (m instanceof JMenuItem) {
    @@ -408,7 +414,7 @@ class ScreenMenu extends Menu implements ContainerListener, ComponentListener, S
             return hashCode;
         }
     
    -    void addItem(final Component m) {
    +    private void addItem(final Component m) {
             if (!m.isVisible()) return;
             MenuItem sm = fItems.get(m);
     
    diff --git a/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java b/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java
    deleted file mode 100644
    index 143584b0b87..00000000000
    --- a/jdk/src/macosx/classes/com/apple/resources/MacOSXResourceBundle.java
    +++ /dev/null
    @@ -1,110 +0,0 @@
    -/*
    - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. 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.  Oracle designates this
    - * particular file as subject to the "Classpath" exception as provided
    - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    - * or visit www.oracle.com if you need additional information or have any
    - * questions.
    - */
    -
    -package com.apple.resources;
    -
    -import java.security.*;
    -import java.util.PropertyResourceBundle;
    -import java.util.ResourceBundle;
    -import java.io.*;
    -
    -public class MacOSXResourceBundle extends PropertyResourceBundle {
    -    MacOSXResourceBundle(InputStream stream) throws IOException {
    -        super(stream);
    -    }
    -
    -    void setItsParent(ResourceBundle rb) {
    -        setParent(rb);
    -    }
    -
    -    public static ResourceBundle getMacResourceBundle(String baseJavaBundle) throws Exception {
    -        return getMacResourceBundle(baseJavaBundle, null);
    -    }
    -
    -    public static ResourceBundle getMacResourceBundle(String baseJavaBundle, String filename) throws Exception {
    -        LoadNativeBundleAction lnba = new LoadNativeBundleAction(baseJavaBundle, filename);
    -        return (ResourceBundle)java.security.AccessController.doPrivileged(lnba);
    -    }
    -}
    -
    -class LoadNativeBundleAction implements PrivilegedExceptionAction {
    -    String mBaseJavaBundle;
    -    String mFilenameOverride;
    -
    -    LoadNativeBundleAction(String baseJavaBundle, String filenameOverride) {
    -        mBaseJavaBundle = baseJavaBundle;
    -        mFilenameOverride = filenameOverride;
    -    }
    -
    -    public Object run() {
    -        java.util.ResourceBundle returnValue = null;
    -        MacOSXResourceBundle macOSrb = null;
    -
    -        // Load the Mac OS X resources.
    -        // Use a base filename if we were given one. Otherwise, we will look for the last piece of the bundle path
    -        // with '.properties' appended. Either way, the native method will take care of the extension.
    -        String filename = mFilenameOverride;
    -
    -        if (filename == null) {
    -            filename = mBaseJavaBundle.substring(mBaseJavaBundle.lastIndexOf('.') + 1);
    -        }
    -
    -        File propsFile = null;
    -        String propertyFileName = getPathToBundleFile(filename);
    -        InputStream stream = null;
    -
    -        try {
    -            propsFile = new File(propertyFileName);
    -            stream = new FileInputStream(propsFile);
    -            stream = new java.io.BufferedInputStream(stream);
    -            macOSrb = new MacOSXResourceBundle(stream);
    -        } catch (Exception e) {
    -            //e.printStackTrace();
    -            //System.out.println("Failed to create resources from application bundle.  Using Java-based resources.");
    -        } finally {
    -            try {
    -                if (stream != null) stream.close();
    -                stream = null;
    -            } catch (Exception e) {
    -                e.printStackTrace();
    -            }
    -        }
    -
    -        returnValue = ResourceBundle.getBundle(mBaseJavaBundle);
    -
    -        // If we have a platform-specific bundle, make it the parent of the generic bundle, so failures propagate up to the parent.
    -        if (returnValue != null) {
    -            if (macOSrb != null) {
    -                macOSrb.setItsParent(returnValue);
    -                returnValue = macOSrb;
    -            }
    -        }
    -
    -        return returnValue;
    -    }
    -
    -    private static native String getPathToBundleFile(String filename);
    -}
    -
    diff --git a/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java
    new file mode 100644
    index 00000000000..8a147203402
    --- /dev/null
    +++ b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpChannelImpl.java
    @@ -0,0 +1,150 @@
    +/*
    + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. 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.  Oracle designates this
    + * particular file as subject to the "Classpath" exception as provided
    + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    + * or visit www.oracle.com if you need additional information or have any
    + * questions.
    + */
    +package sun.nio.ch.sctp;
    +
    +import java.net.SocketAddress;
    +import java.net.InetAddress;
    +import java.io.IOException;
    +import java.util.Set;
    +import java.nio.ByteBuffer;
    +import java.nio.channels.spi.SelectorProvider;
    +import com.sun.nio.sctp.Association;
    +import com.sun.nio.sctp.MessageInfo;
    +import com.sun.nio.sctp.NotificationHandler;
    +import com.sun.nio.sctp.SctpChannel;
    +import com.sun.nio.sctp.SctpSocketOption;
    +
    +/**
    + * Unimplemented.
    + */
    +public class SctpChannelImpl extends SctpChannel
    +{
    +    private static final String message = "SCTP not supported on this platform";
    +
    +    public SctpChannelImpl(SelectorProvider provider) {
    +        super(provider);
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Association association() {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpChannel bind(SocketAddress local)
    +                            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpChannel bindAddress(InetAddress address)
    +         throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpChannel unbindAddress(InetAddress address)
    +         throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public boolean connect(SocketAddress remote) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public boolean connect(SocketAddress remote, int maxOutStreams,
    +       int maxInStreams) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public boolean isConnectionPending() {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public boolean finishConnect() throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set getAllLocalAddresses()
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set getRemoteAddresses()
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpChannel shutdown() throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  T getOption(SctpSocketOption name)
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  SctpChannel setOption(SctpSocketOption name, T value)
    +        throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set> supportedOptions() {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  MessageInfo receive(ByteBuffer dst, T attachment,
    +            NotificationHandler handler) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public int send(ByteBuffer src, MessageInfo messageInfo)
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    protected void implConfigureBlocking(boolean block) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public void implCloseSelectableChannel() throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +}
    diff --git a/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java
    new file mode 100644
    index 00000000000..c2c1d968307
    --- /dev/null
    +++ b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpMultiChannelImpl.java
    @@ -0,0 +1,137 @@
    +/*
    + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. 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.  Oracle designates this
    + * particular file as subject to the "Classpath" exception as provided
    + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    + * or visit www.oracle.com if you need additional information or have any
    + * questions.
    + */
    +package sun.nio.ch.sctp;
    +
    +import java.net.SocketAddress;
    +import java.net.InetAddress;
    +import java.io.IOException;
    +import java.util.Set;
    +import java.nio.ByteBuffer;
    +import java.nio.channels.spi.SelectorProvider;
    +import com.sun.nio.sctp.Association;
    +import com.sun.nio.sctp.SctpChannel;
    +import com.sun.nio.sctp.MessageInfo;
    +import com.sun.nio.sctp.NotificationHandler;
    +import com.sun.nio.sctp.SctpMultiChannel;
    +import com.sun.nio.sctp.SctpSocketOption;
    +
    +/**
    + * Unimplemented.
    + */
    +public class SctpMultiChannelImpl extends SctpMultiChannel
    +{
    +    private static final String message = "SCTP not supported on this platform";
    +
    +    public SctpMultiChannelImpl(SelectorProvider provider) {
    +        super(provider);
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set associations() {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpMultiChannel bind(SocketAddress local,
    +            int backlog) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpMultiChannel bindAddress(InetAddress address)
    +         throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpMultiChannel unbindAddress(InetAddress address)
    +         throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set getAllLocalAddresses()
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set getRemoteAddresses
    +            (Association association) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpMultiChannel shutdown(Association association)
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  T getOption(SctpSocketOption name,
    +            Association association) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  SctpMultiChannel setOption(SctpSocketOption name,
    +            T value, Association association) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set> supportedOptions() {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  MessageInfo receive(ByteBuffer buffer, T attachment,
    +            NotificationHandler handler) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public int send(ByteBuffer buffer, MessageInfo messageInfo)
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpChannel branch(Association association)
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    protected void implConfigureBlocking(boolean block) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public void implCloseSelectableChannel() throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +}
    diff --git a/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
    new file mode 100644
    index 00000000000..1e224afd13f
    --- /dev/null
    +++ b/jdk/src/macosx/classes/sun/nio/ch/sctp/SctpServerChannelImpl.java
    @@ -0,0 +1,102 @@
    +/*
    + * Copyright (c) 2009, 2012, Oracle and/or its affiliates. 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.  Oracle designates this
    + * particular file as subject to the "Classpath" exception as provided
    + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    + * or visit www.oracle.com if you need additional information or have any
    + * questions.
    + */
    +package sun.nio.ch.sctp;
    +
    +import java.net.SocketAddress;
    +import java.net.InetAddress;
    +import java.io.IOException;
    +import java.util.Set;
    +import java.nio.channels.spi.SelectorProvider;
    +import com.sun.nio.sctp.SctpChannel;
    +import com.sun.nio.sctp.SctpServerChannel;
    +import com.sun.nio.sctp.SctpSocketOption;
    +
    +/**
    + * Unimplemented.
    + */
    +public class SctpServerChannelImpl extends SctpServerChannel
    +{
    +    private static final String message = "SCTP not supported on this platform";
    +
    +    public SctpServerChannelImpl(SelectorProvider provider) {
    +        super(provider);
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpChannel accept() throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpServerChannel bind(SocketAddress local,
    +            int backlog) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpServerChannel bindAddress(InetAddress address)
    +         throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public SctpServerChannel unbindAddress(InetAddress address)
    +         throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set getAllLocalAddresses()
    +            throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  T getOption(SctpSocketOption name) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public  SctpServerChannel setOption(SctpSocketOption name,
    +            T value) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public Set> supportedOptions() {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    protected void implConfigureBlocking(boolean block) throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +
    +    @Override
    +    public void implCloseSelectableChannel() throws IOException {
    +        throw new UnsupportedOperationException(message);
    +    }
    +}
    diff --git a/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m b/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m
    deleted file mode 100644
    index 0b98d2b0588..00000000000
    --- a/jdk/src/macosx/native/com/apple/resources/MacOSXResourceBundle.m
    +++ /dev/null
    @@ -1,110 +0,0 @@
    -/*
    - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. 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.  Oracle designates this
    - * particular file as subject to the "Classpath" exception as provided
    - * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    - * or visit www.oracle.com if you need additional information or have any
    - * questions.
    - */
    -
    -#import 
    -#import 
    -#import 
    -
    -#ifndef MAXPATHLEN
    -#define MAXPATHLEN PATH_MAX
    -#endif
    -
    -static jboolean
    -GetPathFromCurrentBinary(char *buf, jint bufsize)
    -{
    -    Dl_info dlinfo;
    -    dladdr((void *)GetPathFromCurrentBinary, &dlinfo);
    -    if (realpath(dlinfo.dli_fname, buf) == NULL) {
    -//      fprintf(stderr, "Error: realpath(`%s') failed.\n", dlinfo.dli_fname);
    -        return JNI_FALSE;
    -    }
    -
    -    const char *libawt = "lib/libawt.dylib";
    -    int strLen, libawtLen;
    -
    -    strLen = strlen(buf);
    -    libawtLen = strlen(libawt);
    -
    -    if (strLen < libawtLen ||
    -        strcmp(buf + strLen - libawtLen, libawt) != 0) {
    -        return JNI_FALSE;
    -    }
    -
    -    buf[strLen - libawtLen] = '\0';
    -
    -    return JNI_TRUE;
    -}
    -
    -#define JAVA_DLL "libjava.dylib"
    -
    -static jboolean
    -GetJREPath(char *buf, jint bufsize)
    -{
    -    /* try to get the path from the current binary, if not, bail to the framework */
    -    if (GetPathFromCurrentBinary(buf, bufsize) == JNI_TRUE) {
    -        /* does the rest of the JRE exist? */
    -        char libjava[MAXPATHLEN];
    -        snprintf(libjava, MAXPATHLEN, "%s/lib/" JAVA_DLL, buf);
    -        if (access(libjava, F_OK) == 0) {
    -            return JNI_TRUE;
    -        }
    -    }
    -
    -    return JNI_FALSE;
    -}
    -
    -static NSString *getRunningJavaBundle()
    -{
    -    char path[MAXPATHLEN];
    -    GetJREPath(path, MAXPATHLEN);
    -    return [[NSString alloc] initWithFormat:@"%@/bundle", [NSString stringWithUTF8String:path]];
    -}
    -
    -/*
    - * Class:     com_apple_resources_LoadNativeBundleAction
    - * Method:    getPathToBundleFile
    - * Signature: (Ljava/lang/String)Ljava/lang/String;
    - */
    -JNIEXPORT jstring JNICALL
    -Java_com_apple_resources_LoadNativeBundleAction_getPathToBundleFile
    -    (JNIEnv *env, jclass klass, jstring filename)
    -{
    -    jstring returnVal = NULL;
    -    if (filename == NULL) {
    -        return NULL;
    -    }
    -
    -JNF_COCOA_ENTER(env);
    -    NSBundle *javaBundle = [NSBundle bundleWithPath:getRunningJavaBundle()];
    -    NSString *baseFilename = JNFJavaToNSString(env, filename);
    -    NSString *propertyFilePath = [javaBundle pathForResource:baseFilename ofType:@"properties"];
    -
    -    if (propertyFilePath != nil) {
    -        returnVal = JNFNSToJavaString(env, propertyFilePath);
    -    }
    -JNF_COCOA_EXIT(env);
    -
    -    return returnVal;
    -}
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java
    index 3ed00e07257..c32aa7feae5 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherBlockChaining.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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
    @@ -135,9 +135,10 @@ class CipherBlockChaining extends FeedbackCipher  {
          * @param plainLen the length of the input data
          * @param cipher the buffer for the result
          * @param cipherOffset the offset in cipher
    +     * @return the length of the encrypted data
          */
    -    void encrypt(byte[] plain, int plainOffset, int plainLen,
    -                 byte[] cipher, int cipherOffset)
    +    int encrypt(byte[] plain, int plainOffset, int plainLen,
    +                byte[] cipher, int cipherOffset)
         {
             int i;
             int endIndex = plainOffset + plainLen;
    @@ -150,6 +151,7 @@ class CipherBlockChaining extends FeedbackCipher  {
                 embeddedCipher.encryptBlock(k, 0, cipher, cipherOffset);
                 System.arraycopy(cipher, cipherOffset, r, 0, blockSize);
             }
    +        return plainLen;
         }
     
         /**
    @@ -174,13 +176,14 @@ class CipherBlockChaining extends FeedbackCipher  {
          * @param cipherLen the length of the input data
          * @param plain the buffer for the result
          * @param plainOffset the offset in plain
    +     * @return the length of the decrypted data
          *
          * @exception IllegalBlockSizeException if input data whose length does
          * not correspond to the embedded cipher's block size is passed to the
          * embedded cipher
          */
    -    void decrypt(byte[] cipher, int cipherOffset, int cipherLen,
    -                 byte[] plain, int plainOffset)
    +    int decrypt(byte[] cipher, int cipherOffset, int cipherLen,
    +                byte[] plain, int plainOffset)
         {
             int i;
             byte[] cipherOrig=null;
    @@ -195,7 +198,6 @@ class CipherBlockChaining extends FeedbackCipher  {
                 // the plaintext result.
                 cipherOrig = cipher.clone();
             }
    -
             for (; cipherOffset < endIndex;
                  cipherOffset += blockSize, plainOffset += blockSize) {
                 embeddedCipher.decryptBlock(cipher, cipherOffset, k, 0);
    @@ -208,5 +210,6 @@ class CipherBlockChaining extends FeedbackCipher  {
                     System.arraycopy(cipherOrig, cipherOffset, r, 0, blockSize);
                 }
             }
    +        return cipherLen;
         }
     }
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java
    index 7548612242a..dab1b4d6f57 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherCore.java
    @@ -310,49 +310,20 @@ final class CipherCore {
          * @return the required output buffer size (in bytes)
          */
         int getOutputSize(int inputLen) {
    -        int totalLen = buffered + inputLen;
    -
    -        // GCM: this call may be for either update() or doFinal(), so have to
    -        // return the larger value of both
    -        // Encryption: based on doFinal value: inputLen + tag
    -        // Decryption: based on update value: inputLen
    -        if (!decrypting && (cipherMode == GCM_MODE)) {
    -            return (totalLen + ((GaloisCounterMode) cipher).getTagLen());
    -        }
    -
    -        if (padding == null) {
    -            return totalLen;
    -        }
    -
    -        if (decrypting) {
    -            return totalLen;
    -        }
    -
    -        if (unitBytes != blockSize) {
    -            if (totalLen < diffBlocksize) {
    -                return diffBlocksize;
    -            } else {
    -                return (totalLen + blockSize -
    -                        ((totalLen - diffBlocksize) % blockSize));
    -            }
    -        } else {
    -            return totalLen + padding.padLength(totalLen);
    -        }
    +        // estimate based on the maximum
    +        return getOutputSizeByOperation(inputLen, true);
         }
     
         private int getOutputSizeByOperation(int inputLen, boolean isDoFinal) {
    -        int totalLen = 0;
    +        int totalLen = buffered + inputLen + cipher.getBufferedLength();
             switch (cipherMode) {
             case GCM_MODE:
    -            totalLen = buffered + inputLen;
                 if (isDoFinal) {
                     int tagLen = ((GaloisCounterMode) cipher).getTagLen();
    -                if (decrypting) {
    -                    // need to get the actual value from cipher??
    -                    // deduct tagLen
    -                    totalLen -= tagLen;
    -                } else {
    +                if (!decrypting) {
                         totalLen += tagLen;
    +                } else {
    +                    totalLen -= tagLen;
                     }
                 }
                 if (totalLen < 0) {
    @@ -360,8 +331,19 @@ final class CipherCore {
                 }
                 break;
             default:
    -             totalLen  = getOutputSize(inputLen);
    -             break;
    +            if (padding != null && !decrypting) {
    +                if (unitBytes != blockSize) {
    +                    if (totalLen < diffBlocksize) {
    +                        totalLen = diffBlocksize;
    +                    } else {
    +                        int residue = (totalLen - diffBlocksize) % blockSize;
    +                        totalLen += (blockSize - residue);
    +                    }
    +                } else {
    +                    totalLen += padding.padLength(totalLen);
    +                }
    +            }
    +            break;
             }
             return totalLen;
         }
    @@ -729,36 +711,52 @@ final class CipherCore {
             len = (len > 0 ? (len - (len%unitBytes)) : 0);
     
             // check output buffer capacity
    -        if ((output == null) || ((output.length - outputOffset) < len)) {
    +        if ((output == null) ||
    +            ((output.length - outputOffset) < len)) {
                 throw new ShortBufferException("Output buffer must be "
                                                + "(at least) " + len
                                                + " bytes long");
             }
     
    -        if (len != 0) {
    -            // there is some work to do
    -            byte[] in = new byte[len];
    -
    -            int inputConsumed = len - buffered;
    -            int bufferedConsumed = buffered;
    -            if (inputConsumed < 0) {
    -                inputConsumed = 0;
    -                bufferedConsumed = len;
    +        int outLen = 0;
    +        if (len != 0) { // there is some work to do
    +            if (len <= buffered) {
    +                // all to-be-processed data are from 'buffer'
    +                if (decrypting) {
    +                    outLen = cipher.decrypt(buffer, 0, len, output, outputOffset);
    +                } else {
    +                    outLen = cipher.encrypt(buffer, 0, len, output, outputOffset);
    +                }
    +                buffered -= len;
    +                if (buffered != 0) {
    +                    System.arraycopy(buffer, len, buffer, 0, buffered);
    +                }
    +            } else { // len > buffered
    +                if (buffered == 0) {
    +                    // all to-be-processed data are from 'input'
    +                    if (decrypting) {
    +                        outLen = cipher.decrypt(input, inputOffset, len, output, outputOffset);
    +                    } else {
    +                        outLen = cipher.encrypt(input, inputOffset, len, output, outputOffset);
    +                    }
    +                    inputOffset += len;
    +                    inputLen -= len;
    +                } else {
    +                    // assemble the data using both 'buffer' and 'input'
    +                    byte[] in = new byte[len];
    +                    System.arraycopy(buffer, 0, in, 0, buffered);
    +                    int inConsumed = len - buffered;
    +                    System.arraycopy(input, inputOffset, in, buffered, inConsumed);
    +                    buffered = 0;
    +                    inputOffset += inConsumed;
    +                    inputLen -= inConsumed;
    +                    if (decrypting) {
    +                        outLen = cipher.decrypt(in, 0, len, output, outputOffset);
    +                    } else {
    +                        outLen = cipher.encrypt(in, 0, len, output, outputOffset);
    +                    }
    +                }
                 }
    -
    -            if (buffered != 0) {
    -                System.arraycopy(buffer, 0, in, 0, bufferedConsumed);
    -            }
    -            if (inputConsumed > 0) {
    -                System.arraycopy(input, inputOffset, in,
    -                                 bufferedConsumed, inputConsumed);
    -            }
    -            if (decrypting) {
    -                cipher.decrypt(in, 0, len, output, outputOffset);
    -            } else {
    -                cipher.encrypt(in, 0, len, output, outputOffset);
    -            }
    -
                 // Let's keep track of how many bytes are needed to make
                 // the total input length a multiple of blocksize when
                 // padding is applied
    @@ -770,23 +768,14 @@ final class CipherCore {
                             ((len - diffBlocksize) % blockSize);
                     }
                 }
    -
    -            inputLen -= inputConsumed;
    -            inputOffset += inputConsumed;
    -            outputOffset += len;
    -            buffered -= bufferedConsumed;
    -            if (buffered > 0) {
    -                System.arraycopy(buffer, bufferedConsumed, buffer, 0,
    -                                 buffered);
    -            }
             }
    -        // left over again
    +        // Store remaining input into 'buffer' again
             if (inputLen > 0) {
                 System.arraycopy(input, inputOffset, buffer, buffered,
                                  inputLen);
    +            buffered += inputLen;
             }
    -        buffered += inputLen;
    -        return len;
    +        return outLen;
         }
     
         /**
    @@ -881,11 +870,24 @@ final class CipherCore {
                     ("Must use either different key or iv for GCM encryption");
             }
     
    -        // calculate the total input length
    -        int totalLen = buffered + inputLen;
    -        int paddedLen = totalLen;
    -        int paddingLen = 0;
    +        int estOutSize = getOutputSizeByOperation(inputLen, true);
    +        // check output buffer capacity.
    +        // if we are decrypting with padding applied, we can perform this
    +        // check only after we have determined how many padding bytes there
    +        // are.
    +        int outputCapacity = output.length - outputOffset;
    +        int minOutSize = (decrypting? (estOutSize - blockSize):estOutSize);
    +        if ((output == null) || (outputCapacity < minOutSize)) {
    +            throw new ShortBufferException("Output buffer must be "
    +                + "(at least) " + minOutSize + " bytes long");
    +        }
     
    +        // calculate total input length
    +        int len = buffered + inputLen;
    +
    +        // calculate padding length
    +        int totalLen = len + cipher.getBufferedLength();
    +        int paddingLen = 0;
             // will the total input length be a multiple of blockSize?
             if (unitBytes != blockSize) {
                 if (totalLen < diffBlocksize) {
    @@ -898,40 +900,23 @@ final class CipherCore {
                 paddingLen = padding.padLength(totalLen);
             }
     
    -        if ((paddingLen > 0) && (paddingLen != blockSize) &&
    -            (padding != null) && decrypting) {
    +        if (decrypting && (padding != null) &&
    +            (paddingLen > 0) && (paddingLen != blockSize)) {
                 throw new IllegalBlockSizeException
                     ("Input length must be multiple of " + blockSize +
                      " when decrypting with padded cipher");
             }
     
    -        // if encrypting and padding not null, add padding
    -        if (!decrypting && padding != null) {
    -            paddedLen += paddingLen;
    -        }
    -
    -        // check output buffer capacity.
    -        // if we are decrypting with padding applied, we can perform this
    -        // check only after we have determined how many padding bytes there
    -        // are.
    -        if (output == null) {
    -            throw new ShortBufferException("Output buffer is null");
    -        }
    -        int outputCapacity = output.length - outputOffset;
    -
    -        if (((!decrypting) && (outputCapacity < paddedLen)) ||
    -            (decrypting && (outputCapacity < (paddedLen - blockSize)))) {
    -            throw new ShortBufferException("Output buffer too short: "
    -                                           + outputCapacity + " bytes given, "
    -                                           + paddedLen + " bytes needed");
    -        }
    -
             // prepare the final input avoiding copying if possible
             byte[] finalBuf = input;
             int finalOffset = inputOffset;
    +        int finalBufLen = inputLen;
             if ((buffered != 0) || (!decrypting && padding != null)) {
    +            if (decrypting || padding == null) {
    +                paddingLen = 0;
    +            }
    +            finalBuf = new byte[len + paddingLen];
                 finalOffset = 0;
    -            finalBuf = new byte[paddedLen];
                 if (buffered != 0) {
                     System.arraycopy(buffer, 0, finalBuf, 0, buffered);
                 }
    @@ -939,50 +924,50 @@ final class CipherCore {
                     System.arraycopy(input, inputOffset, finalBuf,
                                      buffered, inputLen);
                 }
    -            if (!decrypting && padding != null) {
    -                padding.padWithLen(finalBuf, totalLen, paddingLen);
    +            if (paddingLen != 0) {
    +                padding.padWithLen(finalBuf, (buffered+inputLen), paddingLen);
                 }
    +            finalBufLen = finalBuf.length;
             }
    -
    +        int outLen = 0;
             if (decrypting) {
                 // if the size of specified output buffer is less than
                 // the length of the cipher text, then the current
                 // content of cipher has to be preserved in order for
                 // users to retry the call with a larger buffer in the
                 // case of ShortBufferException.
    -            if (outputCapacity < paddedLen) {
    +            if (outputCapacity < estOutSize) {
                     cipher.save();
                 }
                 // create temporary output buffer so that only "real"
                 // data bytes are passed to user's output buffer.
    -            byte[] outWithPadding = new byte[totalLen];
    -            totalLen = finalNoPadding(finalBuf, finalOffset, outWithPadding,
    -                                      0, totalLen);
    +            byte[] outWithPadding = new byte[estOutSize];
    +            outLen = finalNoPadding(finalBuf, finalOffset, outWithPadding,
    +                                    0, finalBufLen);
     
                 if (padding != null) {
    -                int padStart = padding.unpad(outWithPadding, 0, totalLen);
    +                int padStart = padding.unpad(outWithPadding, 0, outLen);
                     if (padStart < 0) {
                         throw new BadPaddingException("Given final block not "
                                                       + "properly padded");
                     }
    -                totalLen = padStart;
    +                outLen = padStart;
                 }
     
    -            if ((output.length - outputOffset) < totalLen) {
    +            if (outputCapacity < outLen) {
                     // restore so users can retry with a larger buffer
                     cipher.restore();
                     throw new ShortBufferException("Output buffer too short: "
    -                                               + (output.length-outputOffset)
    -                                               + " bytes given, " + totalLen
    +                                               + (outputCapacity)
    +                                               + " bytes given, " + outLen
                                                    + " bytes needed");
                 }
    -            for (int i = 0; i < totalLen; i++) {
    -                output[outputOffset + i] = outWithPadding[i];
    -            }
    +            // copy the result into user-supplied output buffer
    +            System.arraycopy(outWithPadding, 0, output, outputOffset, outLen);
             } else { // encrypting
                 try {
    -                totalLen = finalNoPadding(finalBuf, finalOffset, output,
    -                                          outputOffset, paddedLen);
    +                outLen = finalNoPadding(finalBuf, finalOffset, output,
    +                                        outputOffset, finalBufLen);
                 } finally {
                     // reset after doFinal() for GCM encryption
                     requireReinit = (cipherMode == GCM_MODE);
    @@ -994,12 +979,13 @@ final class CipherCore {
             if (cipherMode != ECB_MODE) {
                 cipher.reset();
             }
    -        return totalLen;
    +        return outLen;
         }
     
         private int finalNoPadding(byte[] in, int inOfs, byte[] out, int outOfs,
                                    int len)
    -        throws IllegalBlockSizeException, AEADBadTagException {
    +        throws IllegalBlockSizeException, AEADBadTagException,
    +        ShortBufferException {
     
             if ((cipherMode != GCM_MODE) && (in == null || len == 0)) {
                 return 0;
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java b/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java
    index a5f74f68266..f8e6115c98f 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/CipherFeedback.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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
    @@ -150,9 +150,10 @@ final class CipherFeedback extends FeedbackCipher {
          * @param plainLen the length of the input data
          * @param cipher the buffer for the result
          * @param cipherOffset the offset in cipher
    +     * @return the length of the encrypted data
          */
    -    void encrypt(byte[] plain, int plainOffset, int plainLen,
    -                        byte[] cipher, int cipherOffset)
    +    int encrypt(byte[] plain, int plainOffset, int plainLen,
    +                byte[] cipher, int cipherOffset)
         {
             int i, len;
             len = blockSize - numBytes;
    @@ -194,6 +195,7 @@ final class CipherFeedback extends FeedbackCipher {
                     }
                 }
             }
    +        return plainLen;
         }
     
         /**
    @@ -218,9 +220,10 @@ final class CipherFeedback extends FeedbackCipher {
          * @param cipherLen the length of the input data
          * @param plain the buffer for the result
          * @param plainOffset the offset in plain
    +     * @return the length of the decrypted data
          */
    -    void decrypt(byte[] cipher, int cipherOffset, int cipherLen,
    -                        byte[] plain, int plainOffset)
    +    int decrypt(byte[] cipher, int cipherOffset, int cipherLen,
    +                byte[] plain, int plainOffset)
         {
             int i, len;
             len = blockSize - numBytes;
    @@ -268,5 +271,6 @@ final class CipherFeedback extends FeedbackCipher {
                     }
                 }
             }
    +        return cipherLen;
         }
     }
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java
    index d9e936c3bd0..438998e01ce 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/CounterMode.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2002, 201313, Oracle and/or its affiliates. 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
    @@ -149,9 +149,10 @@ final class CounterMode extends FeedbackCipher {
          * @param len the length of the input data
          * @param out the buffer for the result
          * @param outOff the offset in cipher
    +     * @return the length of the encrypted data
          */
    -    void encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    -        crypt(in, inOff, len, out, outOff);
    +    int encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    +        return crypt(in, inOff, len, out, outOff);
         }
     
         /**
    @@ -176,9 +177,10 @@ final class CounterMode extends FeedbackCipher {
          * @param len the length of the input data
          * @param out the buffer for the result
          * @param outOff the offset in plain
    +     * @return the length of the decrypted data
          */
    -    void decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    -        crypt(in, inOff, len, out, outOff);
    +    int decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    +        return crypt(in, inOff, len, out, outOff);
         }
     
         /**
    @@ -197,7 +199,8 @@ final class CounterMode extends FeedbackCipher {
          * keystream generated by encrypting the counter values. Counter values
          * are encrypted on demand.
          */
    -    private void crypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    +    private int crypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    +        int result = len;
             while (len-- > 0) {
                 if (used >= blockSize) {
                     embeddedCipher.encryptBlock(counter, 0, encryptedCounter, 0);
    @@ -206,5 +209,6 @@ final class CounterMode extends FeedbackCipher {
                 }
                 out[outOff++] = (byte)(in[inOff++] ^ encryptedCounter[used++]);
             }
    +        return result;
         }
     }
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java
    index 00baf133ae6..a12e9457b26 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/DHParameterGenerator.java
    @@ -58,6 +58,16 @@ extends AlgorithmParameterGeneratorSpi {
         // The source of randomness
         private SecureRandom random = null;
     
    +    private static void checkKeySize(int keysize)
    +        throws InvalidAlgorithmParameterException {
    +        if ((keysize != 2048) &&
    +            ((keysize < 512) || (keysize > 1024) || (keysize % 64 != 0))) {
    +            throw new InvalidAlgorithmParameterException(
    +                "Keysize must be multiple of 64 ranging from "
    +                + "512 to 1024 (inclusive), or 2048");
    +        }
    +    }
    +
         /**
          * Initializes this parameter generator for a certain keysize
          * and source of randomness.
    @@ -67,11 +77,11 @@ extends AlgorithmParameterGeneratorSpi {
          * @param random the source of randomness
          */
         protected void engineInit(int keysize, SecureRandom random) {
    -        if ((keysize < 512) || (keysize > 2048) || (keysize % 64 != 0)) {
    -            throw new InvalidParameterException("Keysize must be multiple "
    -                                                + "of 64, and can only range "
    -                                                + "from 512 to 2048 "
    -                                                + "(inclusive)");
    +        // Re-uses DSA parameters and thus have the same range
    +        try {
    +            checkKeySize(keysize);
    +        } catch (InvalidAlgorithmParameterException ex) {
    +            throw new InvalidParameterException(ex.getMessage());
             }
             this.primeSize = keysize;
             this.random = random;
    @@ -91,31 +101,29 @@ extends AlgorithmParameterGeneratorSpi {
         protected void engineInit(AlgorithmParameterSpec genParamSpec,
                                   SecureRandom random)
             throws InvalidAlgorithmParameterException {
    -            if (!(genParamSpec instanceof DHGenParameterSpec)) {
    -                throw new InvalidAlgorithmParameterException
    -                    ("Inappropriate parameter type");
    -            }
    +        if (!(genParamSpec instanceof DHGenParameterSpec)) {
    +            throw new InvalidAlgorithmParameterException
    +                ("Inappropriate parameter type");
    +        }
     
    -            DHGenParameterSpec dhParamSpec = (DHGenParameterSpec)genParamSpec;
    +        DHGenParameterSpec dhParamSpec = (DHGenParameterSpec)genParamSpec;
     
    -            primeSize = dhParamSpec.getPrimeSize();
    -            if ((primeSize<512) || (primeSize>2048) || (primeSize%64 != 0)) {
    -                throw new InvalidAlgorithmParameterException
    -                    ("Modulus size must be multiple of 64, and can only range "
    -                     + "from 512 to 2048 (inclusive)");
    -            }
    +        primeSize = dhParamSpec.getPrimeSize();
     
    -            exponentSize = dhParamSpec.getExponentSize();
    -            if (exponentSize <= 0) {
    -                throw new InvalidAlgorithmParameterException
    -                    ("Exponent size must be greater than zero");
    -            }
    +        // Re-uses DSA parameters and thus have the same range
    +        checkKeySize(primeSize);
     
    -            // Require exponentSize < primeSize
    -            if (exponentSize >= primeSize) {
    -                throw new InvalidAlgorithmParameterException
    -                    ("Exponent size must be less than modulus size");
    -            }
    +        exponentSize = dhParamSpec.getExponentSize();
    +        if (exponentSize <= 0) {
    +            throw new InvalidAlgorithmParameterException
    +                ("Exponent size must be greater than zero");
    +        }
    +
    +        // Require exponentSize < primeSize
    +        if (exponentSize >= primeSize) {
    +            throw new InvalidAlgorithmParameterException
    +                ("Exponent size must be less than modulus size");
    +        }
         }
     
         /**
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java
    index e3254c4fc34..c87cc1c5d62 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/DHPrivateKey.java
    @@ -271,22 +271,6 @@ javax.crypto.interfaces.DHPrivateKey, Serializable {
             }
         }
     
    -    public String toString() {
    -        String LINE_SEP = System.getProperty("line.separator");
    -
    -        StringBuffer strbuf
    -            = new StringBuffer("SunJCE Diffie-Hellman Private Key:"
    -                               + LINE_SEP + "x:" + LINE_SEP
    -                               + Debug.toHexString(this.x)
    -                               + LINE_SEP + "p:" + LINE_SEP
    -                               + Debug.toHexString(this.p)
    -                               + LINE_SEP + "g:" + LINE_SEP
    -                               + Debug.toHexString(this.g));
    -        if (this.l != 0)
    -            strbuf.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
    -        return strbuf.toString();
    -    }
    -
         private void parseKeyBits() throws InvalidKeyException {
             try {
                 DerInputStream in = new DerInputStream(this.key);
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java b/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java
    index abbddd771de..a407b6a50c0 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/ElectronicCodeBook.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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
    @@ -115,14 +115,15 @@ final class ElectronicCodeBook extends FeedbackCipher {
          * @param len the length of the input data
          * @param out the buffer for the result
          * @param outOff the offset in cipher
    +     * @return the length of the encrypted data
          */
    -    void encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    -        while (len >= blockSize) {
    +    int encrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    +        for (int i = len; i >= blockSize; i -= blockSize) {
                 embeddedCipher.encryptBlock(in, inOff, out, outOff);
    -            len -= blockSize;
                 inOff += blockSize;
                 outOff += blockSize;
             }
    +        return len;
         }
     
         /**
    @@ -147,14 +148,14 @@ final class ElectronicCodeBook extends FeedbackCipher {
          * @param len the length of the input data
          * @param out the buffer for the result
          * @param outOff the offset in plain
    +     * @return the length of the decrypted data
          */
    -    void decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    -        while (len >= blockSize) {
    +    int decrypt(byte[] in, int inOff, int len, byte[] out, int outOff) {
    +        for (int i = len; i >= blockSize; i -= blockSize) {
                 embeddedCipher.decryptBlock(in, inOff, out, outOff);
    -            len -= blockSize;
                 inOff += blockSize;
                 outOff += blockSize;
             }
    +        return len;
         }
    -
     }
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java b/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java
    index c27332457f3..8d03913e284 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/FeedbackCipher.java
    @@ -133,9 +133,10 @@ abstract class FeedbackCipher {
          * @param plainLen the length of the input data
          * @param cipher the buffer for the encryption result
          * @param cipherOffset the offset in cipher
    +     * @return the number of bytes placed into cipher
          */
    -    abstract void encrypt(byte[] plain, int plainOffset, int plainLen,
    -                          byte[] cipher, int cipherOffset);
    +    abstract int encrypt(byte[] plain, int plainOffset, int plainLen,
    +                         byte[] cipher, int cipherOffset);
         /**
          * Performs encryption operation for the last time.
          *
    @@ -154,10 +155,9 @@ abstract class FeedbackCipher {
          */
          int encryptFinal(byte[] plain, int plainOffset, int plainLen,
                           byte[] cipher, int cipherOffset)
    -         throws IllegalBlockSizeException {
    -         encrypt(plain, plainOffset, plainLen, cipher, cipherOffset);
    -         return plainLen;
    -     }
    +         throws IllegalBlockSizeException, ShortBufferException {
    +         return encrypt(plain, plainOffset, plainLen, cipher, cipherOffset);
    +    }
         /**
          * Performs decryption operation.
          *
    @@ -174,9 +174,10 @@ abstract class FeedbackCipher {
          * @param cipherLen the length of the input data
          * @param plain the buffer for the decryption result
          * @param plainOffset the offset in plain
    +     * @return the number of bytes placed into plain
          */
    -    abstract void decrypt(byte[] cipher, int cipherOffset, int cipherLen,
    -                          byte[] plain, int plainOffset);
    +    abstract int decrypt(byte[] cipher, int cipherOffset, int cipherLen,
    +                         byte[] plain, int plainOffset);
     
         /**
          * Performs decryption operation for the last time.
    @@ -196,9 +197,9 @@ abstract class FeedbackCipher {
          */
          int decryptFinal(byte[] cipher, int cipherOffset, int cipherLen,
                           byte[] plain, int plainOffset)
    -         throws IllegalBlockSizeException, AEADBadTagException {
    -         decrypt(cipher, cipherOffset, cipherLen, plain, plainOffset);
    -         return cipherLen;
    +         throws IllegalBlockSizeException, AEADBadTagException,
    +         ShortBufferException {
    +         return decrypt(cipher, cipherOffset, cipherLen, plain, plainOffset);
          }
     
         /**
    @@ -228,4 +229,15 @@ abstract class FeedbackCipher {
         void updateAAD(byte[] src, int offset, int len) {
             throw new IllegalStateException("No AAD accepted");
         }
    +
    +    /**
    +     * @return the number of bytes that are buffered internally inside
    +     * this FeedbackCipher instance.
    +     * @since 1.8
    +     */
    +    int getBufferedLength() {
    +        // Currently only AEAD cipher impl, e.g. GCM, buffers data
    +        // internally during decryption mode
    +        return 0;
    +    }
     }
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java
    index 74d3555cc58..d4cd740af7b 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/GCTR.java
    @@ -54,7 +54,7 @@ final class GCTR {
         private byte[] counter;
     
         // needed for save/restore calls
    -    private byte[] counterSave;
    +    private byte[] counterSave = null;
     
         // NOTE: cipher should already be initialized
         GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) {
    @@ -98,17 +98,16 @@ final class GCTR {
                     throw new IllegalBlockSizeException("Negative input size!");
                 } else if (inLen > 0) {
                     int lastBlockSize = inLen % AES_BLOCK_SIZE;
    +                int completeBlkLen = inLen - lastBlockSize;
                     // process the complete blocks first
    -                update(in, inOfs, inLen - lastBlockSize, out, outOfs);
    +                update(in, inOfs, completeBlkLen, out, outOfs);
                     if (lastBlockSize != 0) {
                         // do the last partial block
                         byte[] encryptedCntr = new byte[AES_BLOCK_SIZE];
                         aes.encryptBlock(counter, 0, encryptedCntr, 0);
    -
    -                    int processed = inLen - lastBlockSize;
                         for (int n = 0; n < lastBlockSize; n++) {
    -                        out[outOfs + processed + n] =
    -                            (byte) ((in[inOfs + processed + n] ^
    +                        out[outOfs + completeBlkLen + n] =
    +                            (byte) ((in[inOfs + completeBlkLen + n] ^
                                          encryptedCntr[n]));
                         }
                     }
    @@ -120,12 +119,11 @@ final class GCTR {
         }
     
         /**
    -     * Resets the current counter to its initial value.
    -     * This is used after the doFinal() is called so this object can be
    -     * reused w/o explicit re-initialization.
    +     * Resets the content of this object to when it's first constructed.
          */
         void reset() {
             System.arraycopy(icb, 0, counter, 0, icb.length);
    +        counterSave = null;
         }
     
         /**
    diff --git a/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java b/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java
    index 2f8b584e2a9..37bf6f41433 100644
    --- a/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java
    +++ b/jdk/src/share/classes/com/sun/crypto/provider/GaloisCounterMode.java
    @@ -35,10 +35,12 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
      * This class represents ciphers in GaloisCounter (GCM) mode.
      *
      * 

    This mode currently should only be used w/ AES cipher. - * Although no checking is done here, caller should only - * pass AES Cipher to the constructor. + * Although no checking is done, caller should only pass AES + * Cipher to the constructor. * - *

    NOTE: This class does not deal with buffering or padding. + *

    NOTE: Unlike other modes, when used for decryption, this class + * will buffer all processed outputs internally and won't return them + * until the tag has been successfully verified. * * @since 1.8 */ @@ -51,6 +53,9 @@ final class GaloisCounterMode extends FeedbackCipher { private ByteArrayOutputStream aadBuffer = new ByteArrayOutputStream(); private int sizeOfAAD = 0; + // buffer for storing input in decryption, not used for encryption + private ByteArrayOutputStream ibuffer = null; + // in bytes; need to convert to bits (default value 128) when needed private int tagLenBytes = DEFAULT_TAG_LEN; @@ -68,12 +73,14 @@ final class GaloisCounterMode extends FeedbackCipher { // additional variables for save/restore calls private byte[] aadBufferSave = null; private int sizeOfAADSave = 0; + private byte[] ibufferSave = null; private int processedSave = 0; // value must be 16-byte long; used by GCTR and GHASH as well static void increment32(byte[] value) { if (value.length != AES_BLOCK_SIZE) { - throw new RuntimeException("Unexpected counter block length"); + // should never happen + throw new ProviderException("Illegal counter block length"); } // start from last byte and only go over 4 bytes, i.e. total 32 bits int n = value.length - 1; @@ -171,6 +178,9 @@ final class GaloisCounterMode extends FeedbackCipher { if (ghashAllToS != null) ghashAllToS.reset(); processed = 0; sizeOfAAD = 0; + if (ibuffer != null) { + ibuffer.reset(); + } } /** @@ -184,6 +194,9 @@ final class GaloisCounterMode extends FeedbackCipher { null : aadBuffer.toByteArray()); if (gctrPAndC != null) gctrPAndC.save(); if (ghashAllToS != null) ghashAllToS.save(); + if (ibuffer != null) { + ibufferSave = ibuffer.toByteArray(); + } } /** @@ -198,8 +211,12 @@ final class GaloisCounterMode extends FeedbackCipher { aadBuffer.write(aadBufferSave, 0, aadBufferSave.length); } } - if (gctrPAndC != null) gctrPAndC.restore(); - if (ghashAllToS != null) ghashAllToS.restore(); + if (gctrPAndC != null) gctrPAndC.restore(); + if (ghashAllToS != null) ghashAllToS.restore(); + if (ibuffer != null) { + ibuffer.reset(); + ibuffer.write(ibufferSave, 0, ibufferSave.length); + } } /** @@ -261,6 +278,9 @@ final class GaloisCounterMode extends FeedbackCipher { } processed = 0; sizeOfAAD = 0; + if (decrypting) { + ibuffer = new ByteArrayOutputStream(); + } } /** @@ -299,7 +319,7 @@ final class GaloisCounterMode extends FeedbackCipher { // Feed the AAD data to GHASH, pad if necessary void processAAD() { - if (aadBuffer != null) { + if (aadBuffer != null && aadBuffer.size() > 0) { byte[] aad = aadBuffer.toByteArray(); sizeOfAAD = aad.length; aadBuffer = null; @@ -365,13 +385,14 @@ final class GaloisCounterMode extends FeedbackCipher { * @param out the buffer for the result * @param outOfs the offset in out */ - void encrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { + int encrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { processAAD(); if (len > 0) { gctrPAndC.update(in, inOfs, len, out, outOfs); processed += len; ghashAllToS.update(out, outOfs, len); } + return len; } /** @@ -387,28 +408,28 @@ final class GaloisCounterMode extends FeedbackCipher { * @param outOfs the offset in out * @return the number of bytes placed into the out buffer */ - int encryptFinal(byte[] in, int inOfs, int len, byte[] out, int outOfs) - throws IllegalBlockSizeException { - if (out.length - outOfs < (len + tagLenBytes)) { - throw new RuntimeException("Output buffer too small"); - } + int encryptFinal(byte[] in, int inOfs, int len, byte[] out, int outOfs) + throws IllegalBlockSizeException, ShortBufferException { + if (out.length - outOfs < (len + tagLenBytes)) { + throw new ShortBufferException("Output buffer too small"); + } - processAAD(); - if (len > 0) { - //ByteUtil.dumpArray(Arrays.copyOfRange(in, inOfs, inOfs + len)); - doLastBlock(in, inOfs, len, out, outOfs, true); - } + processAAD(); + if (len > 0) { + doLastBlock(in, inOfs, len, out, outOfs, true); + } - byte[] lengthBlock = getLengthBlock(sizeOfAAD*8, processed*8); - ghashAllToS.update(lengthBlock); - byte[] s = ghashAllToS.digest(); - byte[] sOut = new byte[s.length]; - GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); - gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); + byte[] lengthBlock = + getLengthBlock(sizeOfAAD*8, processed*8); + ghashAllToS.update(lengthBlock); + byte[] s = ghashAllToS.digest(); + byte[] sOut = new byte[s.length]; + GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); + gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); - System.arraycopy(sOut, 0, out, (outOfs + len), tagLenBytes); - return (len + tagLenBytes); - } + System.arraycopy(sOut, 0, out, (outOfs + len), tagLenBytes); + return (len + tagLenBytes); + } /** * Performs decryption operation. @@ -432,14 +453,16 @@ final class GaloisCounterMode extends FeedbackCipher { * @param out the buffer for the result * @param outOfs the offset in out */ - void decrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { + int decrypt(byte[] in, int inOfs, int len, byte[] out, int outOfs) { processAAD(); - if (len > 0) { // must be at least AES_BLOCK_SIZE bytes long - gctrPAndC.update(in, inOfs, len, out, outOfs); - processed += len; - ghashAllToS.update(in, inOfs, len); + if (len > 0) { + // store internally until decryptFinal is called because + // spec mentioned that only return recovered data after tag + // is successfully verified + ibuffer.write(in, inOfs, len); } + return 0; } /** @@ -458,44 +481,62 @@ final class GaloisCounterMode extends FeedbackCipher { * @param outOfs the offset in plain * @return the number of bytes placed into the out buffer */ - int decryptFinal(byte[] in, int inOfs, int len, - byte[] out, int outOfs) - throws IllegalBlockSizeException, AEADBadTagException { - if (len < tagLenBytes) { - throw new RuntimeException("Input buffer too short - need tag"); - } - if (out.length - outOfs < (len - tagLenBytes)) { - throw new RuntimeException("Output buffer too small"); - } - processAAD(); + int decryptFinal(byte[] in, int inOfs, int len, + byte[] out, int outOfs) + throws IllegalBlockSizeException, AEADBadTagException, + ShortBufferException { + if (len < tagLenBytes) { + throw new AEADBadTagException("Input too short - need tag"); + } + if (out.length - outOfs < ((ibuffer.size() + len) - tagLenBytes)) { + throw new ShortBufferException("Output buffer too small"); + } + processAAD(); + if (len != 0) { + ibuffer.write(in, inOfs, len); + } - int processedOld = processed; - byte[] tag = new byte[tagLenBytes]; - // get the trailing tag bytes from 'in' - System.arraycopy(in, inOfs + len - tagLenBytes, tag, 0, tagLenBytes); - len -= tagLenBytes; + // refresh 'in' to all buffered-up bytes + in = ibuffer.toByteArray(); + inOfs = 0; + len = in.length; + ibuffer.reset(); - if (len > 0) { - doLastBlock(in, inOfs, len, out, outOfs, false); - } + byte[] tag = new byte[tagLenBytes]; + // get the trailing tag bytes from 'in' + System.arraycopy(in, len - tagLenBytes, tag, 0, tagLenBytes); + len -= tagLenBytes; - byte[] lengthBlock = getLengthBlock(sizeOfAAD*8, processed*8); - ghashAllToS.update(lengthBlock); + if (len > 0) { + doLastBlock(in, inOfs, len, out, outOfs, false); + } - byte[] s = ghashAllToS.digest(); - byte[] sOut = new byte[s.length]; - GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); - gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); - for (int i = 0; i < tagLenBytes; i++) { - if (tag[i] != sOut[i]) { - throw new AEADBadTagException("Tag mismatch!"); - } - } - return len; - } + byte[] lengthBlock = + getLengthBlock(sizeOfAAD*8, processed*8); + ghashAllToS.update(lengthBlock); + + byte[] s = ghashAllToS.digest(); + byte[] sOut = new byte[s.length]; + GCTR gctrForSToTag = new GCTR(embeddedCipher, this.preCounterBlock); + gctrForSToTag.doFinal(s, 0, s.length, sOut, 0); + for (int i = 0; i < tagLenBytes; i++) { + if (tag[i] != sOut[i]) { + throw new AEADBadTagException("Tag mismatch!"); + } + } + return len; + } // return tag length in bytes int getTagLen() { return this.tagLenBytes; } + + int getBufferedLength() { + if (ibuffer == null) { + return 0; + } else { + return ibuffer.size(); + } + } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java b/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java index f8a34602ac1..ea5890db2e5 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/OutputFeedback.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. 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 @@ -149,9 +149,10 @@ final class OutputFeedback extends FeedbackCipher { * @param plainLen the length of the input data * @param cipher the buffer for the result * @param cipherOffset the offset in cipher + * @return the length of the encrypted data */ - void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset) + int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset) { int i; int len = blockSize - numBytes; @@ -195,6 +196,7 @@ final class OutputFeedback extends FeedbackCipher { System.arraycopy(k, 0, register, len, numBytes); } } + return plainLen; } /** @@ -219,11 +221,12 @@ final class OutputFeedback extends FeedbackCipher { * @param cipherLen the length of the input data * @param plain the buffer for the result * @param plainOffset the offset in plain + * @return the length of the decrypted data */ - void decrypt(byte[] cipher, int cipherOffset, int cipherLen, + int decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) { // OFB encrypt and decrypt are identical - encrypt(cipher, cipherOffset, cipherLen, plain, plainOffset); + return encrypt(cipher, cipherOffset, cipherLen, plain, plainOffset); } } diff --git a/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java b/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java index aa4758593af..360e1833afb 100644 --- a/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java +++ b/jdk/src/share/classes/com/sun/crypto/provider/PCBC.java @@ -136,8 +136,8 @@ final class PCBC extends FeedbackCipher { * @param cipher the buffer for the result * @param cipherOffset the offset in cipher */ - void encrypt(byte[] plain, int plainOffset, int plainLen, - byte[] cipher, int cipherOffset) + int encrypt(byte[] plain, int plainOffset, int plainLen, + byte[] cipher, int cipherOffset) { int i; int endIndex = plainOffset + plainLen; @@ -152,6 +152,7 @@ final class PCBC extends FeedbackCipher { k[i] = (byte)(plain[i+plainOffset] ^ cipher[i+cipherOffset]); } } + return plainLen; } /** @@ -177,8 +178,8 @@ final class PCBC extends FeedbackCipher { * @param plain the buffer for the result * @param plainOffset the offset in plain */ - void decrypt(byte[] cipher, int cipherOffset, int cipherLen, - byte[] plain, int plainOffset) + int decrypt(byte[] cipher, int cipherOffset, int cipherLen, + byte[] plain, int plainOffset) { int i; int endIndex = cipherOffset + cipherLen; @@ -194,5 +195,6 @@ final class PCBC extends FeedbackCipher { k[i] = (byte)(plain[i+plainOffset] ^ cipher[i+cipherOffset]); } } + return cipherLen; } } diff --git a/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java b/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java index f2e33d72454..96950870be2 100644 --- a/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java +++ b/jdk/src/share/classes/com/sun/demo/jvmti/hprof/Tracker.java @@ -53,7 +53,10 @@ public class Tracker { public static void ObjectInit(Object obj) { - if ( engaged != 0 ) { + if ( engaged != 0) { + if (obj == null) { + throw new IllegalArgumentException("Null object."); + } nativeObjectInit(Thread.currentThread(), obj); } } @@ -66,7 +69,10 @@ public class Tracker { public static void NewArray(Object obj) { - if ( engaged != 0 ) { + if ( engaged != 0) { + if (obj == null) { + throw new IllegalArgumentException("Null object."); + } nativeNewArray(Thread.currentThread(), obj); } } @@ -82,6 +88,14 @@ public class Tracker { public static void CallSite(int cnum, int mnum) { if ( engaged != 0 ) { + if (cnum < 0) { + throw new IllegalArgumentException("Negative class index"); + } + + if (mnum < 0) { + throw new IllegalArgumentException("Negative method index"); + } + nativeCallSite(Thread.currentThread(), cnum, mnum); } } @@ -95,6 +109,14 @@ public class Tracker { public static void ReturnSite(int cnum, int mnum) { if ( engaged != 0 ) { + if (cnum < 0) { + throw new IllegalArgumentException("Negative class index"); + } + + if (mnum < 0) { + throw new IllegalArgumentException("Negative method index"); + } + nativeReturnSite(Thread.currentThread(), cnum, mnum); } } diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java index d69200c1408..0b7a865074a 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageReader.java @@ -1165,6 +1165,11 @@ public class JPEGImageReader extends ImageReader { target = imRas; } int [] bandSizes = target.getSampleModel().getSampleSize(); + for (int i = 0; i < bandSizes.length; i++) { + if (bandSizes[i] <= 0 || bandSizes[i] > 8) { + throw new IIOException("Illegal band size: should be 0 < size <= 8"); + } + } /* * If the process is sequential, and we have restart markers, diff --git a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java index b8564176df8..d9723e7ba20 100644 --- a/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java +++ b/jdk/src/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java @@ -495,8 +495,8 @@ public class JPEGImageWriter extends ImageWriter { // handle <= 8-bit samples. We now check the band sizes and throw // an exception for images, such as USHORT_GRAY, with > 8 bits // per sample. - if (bandSizes[i] > 8) { - throw new IIOException("Sample size must be <= 8"); + if (bandSizes[i] <= 0 || bandSizes[i] > 8) { + throw new IIOException("Illegal band size: should be 0 < size <= 8"); } // 4450894 part 2: We expand IndexColorModel images to full 24- // or 32-bit in grabPixels() for each scanline. For indexed diff --git a/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java b/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java index 93b0a75e702..31f2f615b01 100644 --- a/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java +++ b/jdk/src/share/classes/com/sun/jdi/AbsentInformationException.java @@ -31,6 +31,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class AbsentInformationException extends Exception { private static final long serialVersionUID = 4988939309582416373L; diff --git a/jdk/src/share/classes/com/sun/jdi/Accessible.java b/jdk/src/share/classes/com/sun/jdi/Accessible.java index 7eb8dbb154e..4ad4d3b03d8 100644 --- a/jdk/src/share/classes/com/sun/jdi/Accessible.java +++ b/jdk/src/share/classes/com/sun/jdi/Accessible.java @@ -36,6 +36,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Accessible { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ArrayReference.java b/jdk/src/share/classes/com/sun/jdi/ArrayReference.java index f450931f66c..87ee9577b9d 100644 --- a/jdk/src/share/classes/com/sun/jdi/ArrayReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ArrayReference.java @@ -39,6 +39,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ArrayReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ArrayType.java b/jdk/src/share/classes/com/sun/jdi/ArrayType.java index fb5b2da9a56..fc209fa11b7 100644 --- a/jdk/src/share/classes/com/sun/jdi/ArrayType.java +++ b/jdk/src/share/classes/com/sun/jdi/ArrayType.java @@ -38,6 +38,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ArrayType extends ReferenceType { /** diff --git a/jdk/src/share/classes/com/sun/jdi/BooleanType.java b/jdk/src/share/classes/com/sun/jdi/BooleanType.java index ae7bbb9532d..adbb49edbbb 100644 --- a/jdk/src/share/classes/com/sun/jdi/BooleanType.java +++ b/jdk/src/share/classes/com/sun/jdi/BooleanType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface BooleanType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/BooleanValue.java b/jdk/src/share/classes/com/sun/jdi/BooleanValue.java index 02aa89aa3ac..d360e80008e 100644 --- a/jdk/src/share/classes/com/sun/jdi/BooleanValue.java +++ b/jdk/src/share/classes/com/sun/jdi/BooleanValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface BooleanValue extends PrimitiveValue -{ +@jdk.Exported +public interface BooleanValue extends PrimitiveValue { + /** * Returns this BooleanValue as a boolean. * diff --git a/jdk/src/share/classes/com/sun/jdi/Bootstrap.java b/jdk/src/share/classes/com/sun/jdi/Bootstrap.java index e4c0f95679f..ca449dd0252 100644 --- a/jdk/src/share/classes/com/sun/jdi/Bootstrap.java +++ b/jdk/src/share/classes/com/sun/jdi/Bootstrap.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @since 1.3 */ +@jdk.Exported public class Bootstrap extends Object { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ByteType.java b/jdk/src/share/classes/com/sun/jdi/ByteType.java index be8efa866da..87da248a656 100644 --- a/jdk/src/share/classes/com/sun/jdi/ByteType.java +++ b/jdk/src/share/classes/com/sun/jdi/ByteType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ByteType extends PrimitiveType -{ +@jdk.Exported +public interface ByteType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/ByteValue.java b/jdk/src/share/classes/com/sun/jdi/ByteValue.java index 4e4a8992abe..b7fc08bc786 100644 --- a/jdk/src/share/classes/com/sun/jdi/ByteValue.java +++ b/jdk/src/share/classes/com/sun/jdi/ByteValue.java @@ -33,8 +33,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ByteValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface ByteValue extends PrimitiveValue, Comparable { + /** * Returns this ByteValue as a byte. * diff --git a/jdk/src/share/classes/com/sun/jdi/CharType.java b/jdk/src/share/classes/com/sun/jdi/CharType.java index 0174c0d3907..cdcf036efc5 100644 --- a/jdk/src/share/classes/com/sun/jdi/CharType.java +++ b/jdk/src/share/classes/com/sun/jdi/CharType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface CharType extends PrimitiveType -{ +@jdk.Exported +public interface CharType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/CharValue.java b/jdk/src/share/classes/com/sun/jdi/CharValue.java index 87a9d44bad5..6909fb96ea7 100644 --- a/jdk/src/share/classes/com/sun/jdi/CharValue.java +++ b/jdk/src/share/classes/com/sun/jdi/CharValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface CharValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface CharValue extends PrimitiveValue, Comparable { + /** * Returns this CharValue as a char. * diff --git a/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java b/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java index 11edb716c41..8e511d893be 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassLoaderReference.java @@ -39,6 +39,7 @@ import java.util.List; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ClassLoaderReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java b/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java index 97732769844..debc3bd47fc 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassNotLoadedException.java @@ -67,6 +67,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ClassNotLoadedException extends Exception { private static final long serialVersionUID = -6242978768444298722L; diff --git a/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java b/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java index 538bc827256..a26f93d4987 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassNotPreparedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ClassNotPreparedException extends RuntimeException { private static final long serialVersionUID = -6120698967144079642L; public ClassNotPreparedException() diff --git a/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java b/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java index f6fa3867fa2..d008379d3a7 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassObjectReference.java @@ -35,6 +35,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ClassObjectReference extends ObjectReference { /** diff --git a/jdk/src/share/classes/com/sun/jdi/ClassType.java b/jdk/src/share/classes/com/sun/jdi/ClassType.java index 73e94f10de8..73720245d39 100644 --- a/jdk/src/share/classes/com/sun/jdi/ClassType.java +++ b/jdk/src/share/classes/com/sun/jdi/ClassType.java @@ -41,6 +41,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ClassType extends ReferenceType { /** * Gets the superclass of this class. diff --git a/jdk/src/share/classes/com/sun/jdi/DoubleType.java b/jdk/src/share/classes/com/sun/jdi/DoubleType.java index a585f45bbbe..7898aa4c8b3 100644 --- a/jdk/src/share/classes/com/sun/jdi/DoubleType.java +++ b/jdk/src/share/classes/com/sun/jdi/DoubleType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface DoubleType extends PrimitiveType -{ +@jdk.Exported +public interface DoubleType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/DoubleValue.java b/jdk/src/share/classes/com/sun/jdi/DoubleValue.java index fccff0dbbde..529e23305e9 100644 --- a/jdk/src/share/classes/com/sun/jdi/DoubleValue.java +++ b/jdk/src/share/classes/com/sun/jdi/DoubleValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface DoubleValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface DoubleValue extends PrimitiveValue, Comparable { + /** * Returns this DoubleValue as a double. * diff --git a/jdk/src/share/classes/com/sun/jdi/Field.java b/jdk/src/share/classes/com/sun/jdi/Field.java index fea18a9598e..5e5dff2e9ed 100644 --- a/jdk/src/share/classes/com/sun/jdi/Field.java +++ b/jdk/src/share/classes/com/sun/jdi/Field.java @@ -38,6 +38,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Field extends TypeComponent, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/FloatType.java b/jdk/src/share/classes/com/sun/jdi/FloatType.java index c0de125200b..e0d3d4824b0 100644 --- a/jdk/src/share/classes/com/sun/jdi/FloatType.java +++ b/jdk/src/share/classes/com/sun/jdi/FloatType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface FloatType extends PrimitiveType -{ +@jdk.Exported +public interface FloatType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/FloatValue.java b/jdk/src/share/classes/com/sun/jdi/FloatValue.java index 07937d27663..273451b1406 100644 --- a/jdk/src/share/classes/com/sun/jdi/FloatValue.java +++ b/jdk/src/share/classes/com/sun/jdi/FloatValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface FloatValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface FloatValue extends PrimitiveValue, Comparable { + /** * Returns this FloatValue as a float. * diff --git a/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java b/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java index 01b7c713692..ccb5c99e52c 100644 --- a/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java +++ b/jdk/src/share/classes/com/sun/jdi/IncompatibleThreadStateException.java @@ -32,16 +32,15 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ -public class IncompatibleThreadStateException extends Exception -{ +@jdk.Exported +public class IncompatibleThreadStateException extends Exception { private static final long serialVersionUID = 6199174323414551389L; - public IncompatibleThreadStateException() - { + + public IncompatibleThreadStateException() { super(); } - public IncompatibleThreadStateException(String s) - { + public IncompatibleThreadStateException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java b/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java index a7caff8f579..deaa41e15df 100644 --- a/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java +++ b/jdk/src/share/classes/com/sun/jdi/InconsistentDebugInfoException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InconsistentDebugInfoException extends RuntimeException { private static final long serialVersionUID = 7964236415376861808L; public InconsistentDebugInfoException() { diff --git a/jdk/src/share/classes/com/sun/jdi/IntegerType.java b/jdk/src/share/classes/com/sun/jdi/IntegerType.java index 03601a5e9f6..8142ed49ec6 100644 --- a/jdk/src/share/classes/com/sun/jdi/IntegerType.java +++ b/jdk/src/share/classes/com/sun/jdi/IntegerType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface IntegerType extends PrimitiveType -{ +@jdk.Exported +public interface IntegerType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/IntegerValue.java b/jdk/src/share/classes/com/sun/jdi/IntegerValue.java index 89b7defaa48..4cdd3520cbb 100644 --- a/jdk/src/share/classes/com/sun/jdi/IntegerValue.java +++ b/jdk/src/share/classes/com/sun/jdi/IntegerValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface IntegerValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface IntegerValue extends PrimitiveValue, Comparable { + /** * Returns this IntegerValue as an int. * diff --git a/jdk/src/share/classes/com/sun/jdi/InterfaceType.java b/jdk/src/share/classes/com/sun/jdi/InterfaceType.java index 94a26e04a8a..e2c28ec24cb 100644 --- a/jdk/src/share/classes/com/sun/jdi/InterfaceType.java +++ b/jdk/src/share/classes/com/sun/jdi/InterfaceType.java @@ -43,6 +43,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface InterfaceType extends ReferenceType { /** * Gets the interfaces directly extended by this interface. diff --git a/jdk/src/share/classes/com/sun/jdi/InternalException.java b/jdk/src/share/classes/com/sun/jdi/InternalException.java index 668a4bcc98c..706bc65810d 100644 --- a/jdk/src/share/classes/com/sun/jdi/InternalException.java +++ b/jdk/src/share/classes/com/sun/jdi/InternalException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InternalException extends RuntimeException { private static final long serialVersionUID = -9171606393104480607L; private int errorCode; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java b/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java index 357f6c5e2a8..bae0b071e43 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidCodeIndexException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported @Deprecated public class InvalidCodeIndexException extends RuntimeException { private static final long serialVersionUID = 7416010225133747805L; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java b/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java index acf530cc73f..38a0980a933 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidLineNumberException.java @@ -34,6 +34,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported @Deprecated public class InvalidLineNumberException extends RuntimeException { private static final long serialVersionUID = 4048709912372692875L; diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java b/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java index 8bcca8eb269..696d21d4431 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidStackFrameException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class InvalidStackFrameException extends RuntimeException { private static final long serialVersionUID = -1919378296505827922L; public InvalidStackFrameException() { diff --git a/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java b/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java index 20d0f488568..9671dfd3b1f 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvalidTypeException.java @@ -32,16 +32,15 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public class InvalidTypeException extends Exception -{ +@jdk.Exported +public class InvalidTypeException extends Exception { private static final long serialVersionUID = 2256667231949650806L; - public InvalidTypeException() - { + + public InvalidTypeException() { super(); } - public InvalidTypeException(String s) - { + public InvalidTypeException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/InvocationException.java b/jdk/src/share/classes/com/sun/jdi/InvocationException.java index 565a74dbf2f..89e8763b845 100644 --- a/jdk/src/share/classes/com/sun/jdi/InvocationException.java +++ b/jdk/src/share/classes/com/sun/jdi/InvocationException.java @@ -32,19 +32,17 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ -public class InvocationException extends Exception -{ +@jdk.Exported +public class InvocationException extends Exception { private static final long serialVersionUID = 6066780907971918568L; ObjectReference exception; - public InvocationException(ObjectReference exception) - { + public InvocationException(ObjectReference exception) { super("Exception occurred in target VM"); this.exception = exception; } - public ObjectReference exception() - { + public ObjectReference exception() { return exception; } } diff --git a/jdk/src/share/classes/com/sun/jdi/JDIPermission.java b/jdk/src/share/classes/com/sun/jdi/JDIPermission.java index cb69adf7436..ddcb8f7bf6b 100644 --- a/jdk/src/share/classes/com/sun/jdi/JDIPermission.java +++ b/jdk/src/share/classes/com/sun/jdi/JDIPermission.java @@ -78,6 +78,7 @@ package com.sun.jdi; * */ +@jdk.Exported public final class JDIPermission extends java.security.BasicPermission { private static final long serialVersionUID = -6988461416938786271L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/LocalVariable.java b/jdk/src/share/classes/com/sun/jdi/LocalVariable.java index dc74f911129..60fe24aca32 100644 --- a/jdk/src/share/classes/com/sun/jdi/LocalVariable.java +++ b/jdk/src/share/classes/com/sun/jdi/LocalVariable.java @@ -42,6 +42,7 @@ package com.sun.jdi; * @since 1.3 */ +@jdk.Exported public interface LocalVariable extends Mirror, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/Locatable.java b/jdk/src/share/classes/com/sun/jdi/Locatable.java index a00badf64b0..4cb0ea751e9 100644 --- a/jdk/src/share/classes/com/sun/jdi/Locatable.java +++ b/jdk/src/share/classes/com/sun/jdi/Locatable.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Locatable { /** * Returns the {@link Location} of this mirror, if there diff --git a/jdk/src/share/classes/com/sun/jdi/Location.java b/jdk/src/share/classes/com/sun/jdi/Location.java index a2447285b3e..e3fd4c1687d 100644 --- a/jdk/src/share/classes/com/sun/jdi/Location.java +++ b/jdk/src/share/classes/com/sun/jdi/Location.java @@ -86,6 +86,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Location extends Mirror, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/LongType.java b/jdk/src/share/classes/com/sun/jdi/LongType.java index b27c5d30330..126317c4ecf 100644 --- a/jdk/src/share/classes/com/sun/jdi/LongType.java +++ b/jdk/src/share/classes/com/sun/jdi/LongType.java @@ -35,6 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface LongType extends PrimitiveType -{ +@jdk.Exported +public interface LongType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/LongValue.java b/jdk/src/share/classes/com/sun/jdi/LongValue.java index 1dfd41feeb8..1ccd37dfd6b 100644 --- a/jdk/src/share/classes/com/sun/jdi/LongValue.java +++ b/jdk/src/share/classes/com/sun/jdi/LongValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface LongValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface LongValue extends PrimitiveValue, Comparable { + /** * Returns this LongValue as a long. * diff --git a/jdk/src/share/classes/com/sun/jdi/Method.java b/jdk/src/share/classes/com/sun/jdi/Method.java index 2d41b471089..396381f3e7e 100644 --- a/jdk/src/share/classes/com/sun/jdi/Method.java +++ b/jdk/src/share/classes/com/sun/jdi/Method.java @@ -39,6 +39,7 @@ import java.util.List; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Method extends TypeComponent, Locatable, Comparable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/Mirror.java b/jdk/src/share/classes/com/sun/jdi/Mirror.java index d821c4faebf..9660ebdcfe9 100644 --- a/jdk/src/share/classes/com/sun/jdi/Mirror.java +++ b/jdk/src/share/classes/com/sun/jdi/Mirror.java @@ -56,6 +56,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java b/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java index fb6557c7461..a35cc403b81 100644 --- a/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java +++ b/jdk/src/share/classes/com/sun/jdi/MonitorInfo.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @since 1.6 */ +@jdk.Exported public interface MonitorInfo extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java b/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java index 311fd1f625c..2db8460d03f 100644 --- a/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java +++ b/jdk/src/share/classes/com/sun/jdi/NativeMethodException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class NativeMethodException extends RuntimeException { private static final long serialVersionUID = 3924951669039469992L; diff --git a/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java b/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java index 720690dd1da..29da6d9b08b 100644 --- a/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java +++ b/jdk/src/share/classes/com/sun/jdi/ObjectCollectedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class ObjectCollectedException extends RuntimeException { private static final long serialVersionUID = -1928428056197269588L; public ObjectCollectedException() { diff --git a/jdk/src/share/classes/com/sun/jdi/ObjectReference.java b/jdk/src/share/classes/com/sun/jdi/ObjectReference.java index 66e8acf7c47..18710cbab93 100644 --- a/jdk/src/share/classes/com/sun/jdi/ObjectReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ObjectReference.java @@ -55,8 +55,9 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ -public interface ObjectReference extends Value -{ +@jdk.Exported +public interface ObjectReference extends Value { + /** * Gets the {@link ReferenceType} that mirrors the type * of this object. The type may be a subclass or implementor of the diff --git a/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java b/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java index 8c4aae74ef8..e2c9ae79352 100644 --- a/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java +++ b/jdk/src/share/classes/com/sun/jdi/PathSearchingVirtualMachine.java @@ -33,6 +33,7 @@ import java.util.List; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface PathSearchingVirtualMachine extends VirtualMachine { /** * Get the class path for this virtual machine. diff --git a/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java b/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java index ba34a5049a4..3805d6a577d 100644 --- a/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java +++ b/jdk/src/share/classes/com/sun/jdi/PrimitiveType.java @@ -37,5 +37,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface PrimitiveType extends Type { } diff --git a/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java b/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java index 0d9442a38a0..6af5a3311fd 100644 --- a/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java +++ b/jdk/src/share/classes/com/sun/jdi/PrimitiveValue.java @@ -35,8 +35,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface PrimitiveValue extends Value -{ +@jdk.Exported +public interface PrimitiveValue extends Value { + /** * Converts this value to a BooleanValue and returns the result * as a boolean. diff --git a/jdk/src/share/classes/com/sun/jdi/ReferenceType.java b/jdk/src/share/classes/com/sun/jdi/ReferenceType.java index 864e368ea76..96973bca203 100644 --- a/jdk/src/share/classes/com/sun/jdi/ReferenceType.java +++ b/jdk/src/share/classes/com/sun/jdi/ReferenceType.java @@ -77,6 +77,7 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ReferenceType extends Type, Comparable, Accessible { diff --git a/jdk/src/share/classes/com/sun/jdi/ShortType.java b/jdk/src/share/classes/com/sun/jdi/ShortType.java index c7b9e8b04dc..87542a1af23 100644 --- a/jdk/src/share/classes/com/sun/jdi/ShortType.java +++ b/jdk/src/share/classes/com/sun/jdi/ShortType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface ShortType extends PrimitiveType { } diff --git a/jdk/src/share/classes/com/sun/jdi/ShortValue.java b/jdk/src/share/classes/com/sun/jdi/ShortValue.java index 771ef562683..c7011c35a20 100644 --- a/jdk/src/share/classes/com/sun/jdi/ShortValue.java +++ b/jdk/src/share/classes/com/sun/jdi/ShortValue.java @@ -34,8 +34,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface ShortValue extends PrimitiveValue, Comparable -{ +@jdk.Exported +public interface ShortValue extends PrimitiveValue, Comparable { + /** * Returns this ShortValue as a short. * diff --git a/jdk/src/share/classes/com/sun/jdi/StackFrame.java b/jdk/src/share/classes/com/sun/jdi/StackFrame.java index 40c03021ad2..dc78485aaac 100644 --- a/jdk/src/share/classes/com/sun/jdi/StackFrame.java +++ b/jdk/src/share/classes/com/sun/jdi/StackFrame.java @@ -58,8 +58,9 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ -public interface StackFrame extends Mirror, Locatable -{ +@jdk.Exported +public interface StackFrame extends Mirror, Locatable { + /** * Returns the {@link Location} of the current instruction in the frame. * The method for which this frame was created can also be accessed diff --git a/jdk/src/share/classes/com/sun/jdi/StringReference.java b/jdk/src/share/classes/com/sun/jdi/StringReference.java index a149768f18a..e32b442a9de 100644 --- a/jdk/src/share/classes/com/sun/jdi/StringReference.java +++ b/jdk/src/share/classes/com/sun/jdi/StringReference.java @@ -35,8 +35,8 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface StringReference extends ObjectReference -{ +@jdk.Exported +public interface StringReference extends ObjectReference { /** * Returns the StringReference as a String. The returned string * is the equivalent of the mirrored string, but is an entity in the diff --git a/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java b/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java index 8bf631d7ec4..ca13fc363b5 100644 --- a/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ThreadGroupReference.java @@ -37,8 +37,9 @@ import java.util.List; * @author James McIlree * @since 1.3 */ -public interface ThreadGroupReference extends ObjectReference -{ +@jdk.Exported +public interface ThreadGroupReference extends ObjectReference { + /** * Returns the name of this thread group. * diff --git a/jdk/src/share/classes/com/sun/jdi/ThreadReference.java b/jdk/src/share/classes/com/sun/jdi/ThreadReference.java index 235ab291f87..a082ddf580e 100644 --- a/jdk/src/share/classes/com/sun/jdi/ThreadReference.java +++ b/jdk/src/share/classes/com/sun/jdi/ThreadReference.java @@ -36,8 +36,8 @@ import java.util.List; * @author James McIlree * @since 1.3 */ -public interface ThreadReference extends ObjectReference -{ +@jdk.Exported +public interface ThreadReference extends ObjectReference { /** Thread status is unknown */ public final int THREAD_STATUS_UNKNOWN =-1; /** Thread has completed execution */ diff --git a/jdk/src/share/classes/com/sun/jdi/Type.java b/jdk/src/share/classes/com/sun/jdi/Type.java index 3f216e5bc44..fdcccd495fa 100644 --- a/jdk/src/share/classes/com/sun/jdi/Type.java +++ b/jdk/src/share/classes/com/sun/jdi/Type.java @@ -127,8 +127,9 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ -public interface Type extends Mirror -{ +@jdk.Exported +public interface Type extends Mirror { + /** * Returns the JNI-style signature for this type. *

    diff --git a/jdk/src/share/classes/com/sun/jdi/TypeComponent.java b/jdk/src/share/classes/com/sun/jdi/TypeComponent.java index 5f2a192803d..5354a675ce7 100644 --- a/jdk/src/share/classes/com/sun/jdi/TypeComponent.java +++ b/jdk/src/share/classes/com/sun/jdi/TypeComponent.java @@ -44,6 +44,7 @@ package com.sun.jdi; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface TypeComponent extends Mirror, Accessible { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java b/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java index 36e424bd689..b5f354aedfb 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMCannotBeModifiedException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Jim Holmlund * @since 1.5 */ +@jdk.Exported public class VMCannotBeModifiedException extends UnsupportedOperationException { private static final long serialVersionUID = -4063879815130164009L; public VMCannotBeModifiedException() { diff --git a/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java b/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java index bf78d851989..888308ca4dd 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMDisconnectedException.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public class VMDisconnectedException extends RuntimeException { private static final long serialVersionUID = 2892975269768351637L; diff --git a/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java b/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java index c4e19acabe8..90c0232fd4e 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMMismatchException.java @@ -33,6 +33,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class VMMismatchException extends RuntimeException { private static final long serialVersionUID = 289169358790459564L; public VMMismatchException() { diff --git a/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java b/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java index 1848d22c854..afb8235fb92 100644 --- a/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java +++ b/jdk/src/share/classes/com/sun/jdi/VMOutOfMemoryException.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public class VMOutOfMemoryException extends RuntimeException { private static final long serialVersionUID = 71504228548910686L; public VMOutOfMemoryException() { diff --git a/jdk/src/share/classes/com/sun/jdi/Value.java b/jdk/src/share/classes/com/sun/jdi/Value.java index 316f4b8b97b..582f439f701 100644 --- a/jdk/src/share/classes/com/sun/jdi/Value.java +++ b/jdk/src/share/classes/com/sun/jdi/Value.java @@ -168,8 +168,8 @@ package com.sun.jdi; * @since 1.3 */ -public interface Value extends Mirror -{ +@jdk.Exported +public interface Value extends Mirror { /** * Returns the run-time type of this value. * diff --git a/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java b/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java index 38faf903176..096465acbbf 100644 --- a/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java +++ b/jdk/src/share/classes/com/sun/jdi/VirtualMachine.java @@ -70,6 +70,7 @@ import java.util.Map; * @author James McIlree * @since 1.3 */ +@jdk.Exported public interface VirtualMachine extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java b/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java index 5af1776d5fb..a388086c9e0 100644 --- a/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java +++ b/jdk/src/share/classes/com/sun/jdi/VirtualMachineManager.java @@ -271,6 +271,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface VirtualMachineManager { /** diff --git a/jdk/src/share/classes/com/sun/jdi/VoidType.java b/jdk/src/share/classes/com/sun/jdi/VoidType.java index 4a976e84920..85671b4cee0 100644 --- a/jdk/src/share/classes/com/sun/jdi/VoidType.java +++ b/jdk/src/share/classes/com/sun/jdi/VoidType.java @@ -35,5 +35,6 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VoidType extends Type { } diff --git a/jdk/src/share/classes/com/sun/jdi/VoidValue.java b/jdk/src/share/classes/com/sun/jdi/VoidValue.java index 8a8a79e465c..74fee8dfd39 100644 --- a/jdk/src/share/classes/com/sun/jdi/VoidValue.java +++ b/jdk/src/share/classes/com/sun/jdi/VoidValue.java @@ -32,6 +32,7 @@ package com.sun.jdi; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VoidValue extends Value { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java index 8b846137d57..9343795f846 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/AttachingConnector.java @@ -35,6 +35,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface AttachingConnector extends Connector { /** * Attaches to a running application and and returns a diff --git a/jdk/src/share/classes/com/sun/jdi/connect/Connector.java b/jdk/src/share/classes/com/sun/jdi/connect/Connector.java index e817c446eb4..f6bd8060656 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/Connector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/Connector.java @@ -45,6 +45,7 @@ import java.io.Serializable; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface Connector { /** * Returns a short identifier for the connector. Connector implementors @@ -91,6 +92,7 @@ public interface Connector { * {@link Connector.IntegerArgument}, * or {@link Connector.SelectedArgument}. */ + @jdk.Exported public interface Argument extends Serializable { /** * Returns a short, unique identifier for the argument. @@ -156,6 +158,7 @@ public interface Connector { * whose value is Boolean. Boolean values are represented * by the localized versions of the strings "true" and "false". */ + @jdk.Exported public interface BooleanArgument extends Argument { /** * Sets the value of the argument. @@ -196,6 +199,7 @@ public interface Connector { * whose value is an integer. Integer values are represented * by their corresponding strings. */ + @jdk.Exported public interface IntegerArgument extends Argument { /** * Sets the value of the argument. @@ -257,6 +261,7 @@ public interface Connector { * Specification for and value of a Connector argument, * whose value is a String. */ + @jdk.Exported public interface StringArgument extends Argument { /** * Performs basic sanity check of argument. @@ -269,6 +274,7 @@ public interface Connector { * Specification for and value of a Connector argument, * whose value is a String selected from a list of choices. */ + @jdk.Exported public interface SelectedArgument extends Argument { /** * Return the possible values for the argument diff --git a/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java b/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java index fd45b15eb3c..27c49744252 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/IllegalConnectorArgumentsException.java @@ -36,8 +36,9 @@ import java.util.Collections; * @author Gordon Hirsch * @since 1.3 */ -public class IllegalConnectorArgumentsException extends Exception -{ +@jdk.Exported +public class IllegalConnectorArgumentsException extends Exception { + private static final long serialVersionUID = -3042212603611350941L; List names; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java index 206c8aafa19..dc636ed7e79 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/LaunchingConnector.java @@ -35,6 +35,7 @@ import java.io.IOException; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface LaunchingConnector extends Connector { /** * Launches an application and connects to its VM. Properties diff --git a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java index b588875c99b..b6e4f0a2bb7 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/ListeningConnector.java @@ -35,6 +35,7 @@ import com.sun.jdi.VirtualMachine; * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface ListeningConnector extends Connector { /** * Indicates whether this listening connector supports multiple diff --git a/jdk/src/share/classes/com/sun/jdi/connect/Transport.java b/jdk/src/share/classes/com/sun/jdi/connect/Transport.java index 266bd8089ab..b271a9692bc 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/Transport.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/Transport.java @@ -42,6 +42,7 @@ import com.sun.jdi.connect.spi.TransportService; // for javadoc * @author Gordon Hirsch * @since 1.3 */ +@jdk.Exported public interface Transport { /** * Returns a short identifier for the transport. diff --git a/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java b/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java index fcfc48cf0d6..9ea50ee1e89 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/TransportTimeoutException.java @@ -54,6 +54,7 @@ package com.sun.jdi.connect; * * @since 1.5 */ +@jdk.Exported public class TransportTimeoutException extends java.io.IOException { private static final long serialVersionUID = 4107035242623365074L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java b/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java index 111d48b260c..0163347c2e7 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/VMStartException.java @@ -34,8 +34,9 @@ package com.sun.jdi.connect; * @author Gordon Hirsch * @since 1.3 */ -public class VMStartException extends Exception -{ +@jdk.Exported +public class VMStartException extends Exception { + private static final long serialVersionUID = 6408644824640801020L; Process process; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/package-info.java b/jdk/src/share/classes/com/sun/jdi/connect/package-info.java new file mode 100644 index 00000000000..c444b75137a --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/connect/package-info.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package defines connections between the virtual machine + * using the JDI and the target virtual machine. + * In concert with {@link com.sun.jdi.VirtualMachineManager} + * it is the mechanism for launching, attaching, etc to + * target virtual machines. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.connect; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/package.html b/jdk/src/share/classes/com/sun/jdi/connect/package.html deleted file mode 100644 index 7484ce2ca6e..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/connect/package.html +++ /dev/null @@ -1,43 +0,0 @@ - - -com.sun.jdi.connect description - - - - -This package defines -connections between the virtual machine -using the JDI and the target virtual machine. -In concert with {@link com.sun.jdi.VirtualMachineManager} -it is the mechanism for launching, attaching, etc to -target virtual machines. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java index 6c172af97ee..bd0a8c4400c 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/ClosedConnectionException.java @@ -45,6 +45,7 @@ package com.sun.jdi.connect.spi; * * @since 1.5 */ +@jdk.Exported public class ClosedConnectionException extends java.io.IOException { private static final long serialVersionUID = 3877032124297204774L; /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java index 6d87949abb4..d4b1721af64 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/Connection.java @@ -56,6 +56,7 @@ import java.io.IOException; * @since 1.5 */ +@jdk.Exported public abstract class Connection { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java index 6db4cfea8e9..297d3e25116 100644 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/TransportService.java @@ -77,6 +77,7 @@ import com.sun.jdi.connect.TransportTimeoutException; * @since 1.5 */ +@jdk.Exported public abstract class TransportService { /** @@ -96,6 +97,7 @@ public abstract class TransportService { /** * The transport service capabilities. */ + @jdk.Exported public static abstract class Capabilities { /** @@ -229,6 +231,7 @@ public abstract class TransportService { * #stopListening stopListening} to stop the transport * service from listening on an address. */ + @jdk.Exported public static abstract class ListenKey { /** diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java b/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java new file mode 100644 index 00000000000..956e28dcff8 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/connect/spi/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package comprises the interfaces and classes used to + * develop new {@link com.sun.jdi.connect.spi.TransportService} + * implementations. + */ + +@jdk.Exported +package com.sun.jdi.connect.spi; diff --git a/jdk/src/share/classes/com/sun/jdi/connect/spi/package.html b/jdk/src/share/classes/com/sun/jdi/connect/spi/package.html deleted file mode 100644 index 29f98ede107..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/connect/spi/package.html +++ /dev/null @@ -1,35 +0,0 @@ - - - com.sun.jdi.connect.spi description - - - -This package comprises the interfaces and classes used to -develop new {@link com.sun.jdi.connect.spi.TransportService} -implementations. - - diff --git a/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java index 1770fca292d..6bee053ffd0 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/AccessWatchpointEvent.java @@ -37,5 +37,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface AccessWatchpointEvent extends WatchpointEvent { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java index 811e6f7f14a..0fbd9cf3d1e 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/BreakpointEvent.java @@ -47,6 +47,6 @@ import java.util.List; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface BreakpointEvent extends LocatableEvent { - } diff --git a/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java index 9b57feed2d2..2922ed81435 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ClassPrepareEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassPrepareEvent extends Event { /** * Returns the thread in which this event has occurred. diff --git a/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java index 8835b1e6e87..1da9da39030 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ClassUnloadEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassUnloadEvent extends Event { /** * Returns the name of the class that has been unloaded. diff --git a/jdk/src/share/classes/com/sun/jdi/event/Event.java b/jdk/src/share/classes/com/sun/jdi/event/Event.java index ba005734bb9..92c0217431d 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/Event.java +++ b/jdk/src/share/classes/com/sun/jdi/event/Event.java @@ -43,6 +43,7 @@ import com.sun.jdi.request.EventRequest; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface Event extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java b/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java index 220a1e417bd..a66fc850a54 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventIterator.java @@ -40,6 +40,7 @@ import java.util.Iterator; * @since 1.3 */ +@jdk.Exported public interface EventIterator extends Iterator { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java b/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java index 4c966a97942..5dde7462154 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventQueue.java @@ -57,6 +57,7 @@ import com.sun.jdi.*; * @since 1.3 */ +@jdk.Exported public interface EventQueue extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/EventSet.java b/jdk/src/share/classes/com/sun/jdi/event/EventSet.java index 26efafc1899..63efacf2d51 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/EventSet.java +++ b/jdk/src/share/classes/com/sun/jdi/event/EventSet.java @@ -127,6 +127,7 @@ import java.util.Set; * @since 1.3 */ +@jdk.Exported public interface EventSet extends Mirror, Set { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java index 89cb4667d17..1a03bb6cdf3 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ExceptionEvent.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ExceptionEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java b/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java index d7f66054e22..66a2070ae19 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/LocatableEvent.java @@ -36,6 +36,7 @@ import java.util.List; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface LocatableEvent extends Event, Locatable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java index 963b4e6657a..2f48a4a69b9 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MethodEntryEvent.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodEntryEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java index e492cc4d852..7a08790d080 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MethodExitEvent.java @@ -40,6 +40,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodExitEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java index 32d637d2891..9531ad4ee16 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ModificationWatchpointEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ModificationWatchpointEvent extends WatchpointEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java index 9f22f9aa57d..338ac38f25e 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnterEvent.java @@ -40,6 +40,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnterEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java index 0b4ba8171f9..1c9835b9634 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorContendedEnteredEvent.java @@ -39,6 +39,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnteredEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java index 7d3d717526b..d8630df1e7f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java index f9b14ca3573..b458ad6d68f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/MonitorWaitedEvent.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitedEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java b/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java index e6a5f7510a5..ebeadfffd7b 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/StepEvent.java @@ -46,6 +46,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface StepEvent extends LocatableEvent { - } diff --git a/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java index 01f4b04b416..f998e6da724 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ThreadDeathEvent.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadDeathEvent extends Event { /** * Returns the thread which is terminating. diff --git a/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java b/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java index 5be5d0ff2e4..7730e9a5225 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/ThreadStartEvent.java @@ -52,6 +52,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadStartEvent extends Event { /** * Returns the thread which has started. diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java index 7225ae028e1..a6decf00c03 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMDeathEvent.java @@ -68,5 +68,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMDeathEvent extends Event { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java index 8301d78c0f3..55a928c1010 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMDisconnectEvent.java @@ -52,5 +52,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMDisconnectEvent extends Event { } diff --git a/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java b/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java index cf500a28de7..3172bc74aeb 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/VMStartEvent.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface VMStartEvent extends Event { /** * Returns the initial thread of the VM which has started. diff --git a/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java b/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java index d60908f897e..9cb5d5d4f6f 100644 --- a/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java +++ b/jdk/src/share/classes/com/sun/jdi/event/WatchpointEvent.java @@ -37,6 +37,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface WatchpointEvent extends LocatableEvent { /** diff --git a/jdk/src/share/classes/com/sun/jdi/event/package-info.java b/jdk/src/share/classes/com/sun/jdi/event/package-info.java new file mode 100644 index 00000000000..fa9afe3346a --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/event/package-info.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package defines JDI events and event processing. + * An {@link com.sun.jdi.event.Event} is always a member of an + * {@link com.sun.jdi.event.EventSet}, which + * is retrieved from the {@link com.sun.jdi.event.EventQueue}. + * Examples of Events include + * {@link com.sun.jdi.event.BreakpointEvent "breakpoints events"}, + * {@link com.sun.jdi.event.ThreadStartEvent "thread creation events"} and + * {@link com.sun.jdi.event.VMDeathEvent "virtual machine death event"}. + * With the exception + * of termination events, all events received must be requested with an + * {@link com.sun.jdi.request.EventRequest "EventRequest"}. The + * {@link com.sun.jdi.request} package defines event requests and event + * request management. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.event; diff --git a/jdk/src/share/classes/com/sun/jdi/event/package.html b/jdk/src/share/classes/com/sun/jdi/event/package.html deleted file mode 100644 index 521a8b7c85f..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/event/package.html +++ /dev/null @@ -1,49 +0,0 @@ - - - com.sun.jdi.event description - - - -This package defines JDI events and event processing. -An {@link com.sun.jdi.event.Event} is always a member of an -{@link com.sun.jdi.event.EventSet}, which -is retrieved from the {@link com.sun.jdi.event.EventQueue}. -Examples of Events include -{@link com.sun.jdi.event.BreakpointEvent "breakpoints events"}, -{@link com.sun.jdi.event.ThreadStartEvent "thread creation events"} and -{@link com.sun.jdi.event.VMDeathEvent "virtual machine death event"}. -With the exception -of termination events, all events received must be requested with an -{@link com.sun.jdi.request.EventRequest "EventRequest"}. The -{@link com.sun.jdi.request} package defines event requests and event -request management. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/package-info.java b/jdk/src/share/classes/com/sun/jdi/package-info.java new file mode 100644 index 00000000000..00f422fd702 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/package-info.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This is the core package of the Java Debug + * Interface (JDI), it defines mirrors for values, types, and the target + * VirtualMachine itself - as well bootstrapping facilities. + * {@link com.sun.jdi.VirtualMachine} mirrors the target virtual machine and + * is the origin of all information provided by the JDI. A VirtualMachine + * is typically created by using the + * {@link com.sun.jdi.VirtualMachineManager} to create + * a connection to the target virtual machine (see the + * {@link com.sun.jdi.connect} package). In turn the + * {@link com.sun.jdi.VirtualMachineManager} is typically created by calling + * {@link com.sun.jdi.Bootstrap#virtualMachineManager()}. + *

    + * Most of the methods within this package can throw the unchecked exception + * {@link com.sun.jdi.VMDisconnectedException}. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi; diff --git a/jdk/src/share/classes/com/sun/jdi/package.html b/jdk/src/share/classes/com/sun/jdi/package.html deleted file mode 100644 index 5aee603d981..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/package.html +++ /dev/null @@ -1,50 +0,0 @@ - - - com.sun.jdi package description - - - -This is the core package of the Java Debug -Interface (JDI), it defines mirrors for values, types, and the target -VirtualMachine itself - as well bootstrapping facilities. -{@link com.sun.jdi.VirtualMachine} mirrors the target virtual machine and -is the origin of all information provided by the JDI. A VirtualMachine -is typically created by using the -{@link com.sun.jdi.VirtualMachineManager} to create -a connection to the target virtual machine (see the -{@link com.sun.jdi.connect} package). In turn the -{@link com.sun.jdi.VirtualMachineManager} is typically created by calling -{@link com.sun.jdi.Bootstrap#virtualMachineManager()}. -

    -Most of the methods within this package can throw the unchecked exception -{@link com.sun.jdi.VMDisconnectedException}. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java index 727614774b5..15915252a98 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/AccessWatchpointRequest.java @@ -56,5 +56,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface AccessWatchpointRequest extends WatchpointRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java index d31df572854..6d6ee7d2bfe 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/BreakpointRequest.java @@ -46,6 +46,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface BreakpointRequest extends EventRequest, Locatable { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java index 19f1bfc1e6a..6089292ced4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ClassPrepareRequest.java @@ -47,6 +47,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassPrepareRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java index abad6d319c6..4868b8053ed 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ClassUnloadRequest.java @@ -46,6 +46,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ClassUnloadRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java b/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java index 5de664eb367..b50203481c2 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java +++ b/jdk/src/share/classes/com/sun/jdi/request/DuplicateRequestException.java @@ -31,16 +31,15 @@ package com.sun.jdi.request; * @author Robert Field * @since 1.3 */ -public class DuplicateRequestException extends RuntimeException -{ +@jdk.Exported +public class DuplicateRequestException extends RuntimeException { private static final long serialVersionUID = -3719784920313411060L; - public DuplicateRequestException() - { + + public DuplicateRequestException() { super(); } - public DuplicateRequestException(String s) - { + public DuplicateRequestException(String s) { super(s); } } diff --git a/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java b/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java index 9b9138e2c29..8b64f1f2457 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/EventRequest.java @@ -78,6 +78,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface EventRequest extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java b/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java index e2627de9296..13f03fc5242 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java +++ b/jdk/src/share/classes/com/sun/jdi/request/EventRequestManager.java @@ -44,6 +44,7 @@ import java.util.List; * @since 1.3 */ +@jdk.Exported public interface EventRequestManager extends Mirror { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java index e7e06bf26de..ddb5d97d81c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ExceptionRequest.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ExceptionRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java b/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java index 8bd3292caa3..619f47bd968 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java +++ b/jdk/src/share/classes/com/sun/jdi/request/InvalidRequestStateException.java @@ -35,6 +35,7 @@ package com.sun.jdi.request; * @author Robert Field * @since 1.3 */ +@jdk.Exported public class InvalidRequestStateException extends RuntimeException { private static final long serialVersionUID = -3774632428543322148L; public InvalidRequestStateException() diff --git a/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java index 397e97cbdcb..1d98adec192 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MethodEntryRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodEntryRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java index c6a4649abaa..e0612903e0e 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MethodExitRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface MethodExitRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java index 778d5d8ef34..20b5b2320f4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ModificationWatchpointRequest.java @@ -55,5 +55,6 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ModificationWatchpointRequest extends WatchpointRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java index b3edd957ed9..864522cef6c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnterRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnterRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java index 0066f868caa..965df47b8ff 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorContendedEnteredRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorContendedEnteredRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java index 37ce47f1831..35df22578e4 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java index 9fea543e278..ee4982a4767 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/MonitorWaitedRequest.java @@ -45,6 +45,7 @@ import com.sun.jdi.*; * @author Swamy Venkataramanappa * @since 1.6 */ +@jdk.Exported public interface MonitorWaitedRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java b/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java index 765fdd02a81..2ea385f45d2 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/StepRequest.java @@ -43,6 +43,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface StepRequest extends EventRequest { /** Step into any newly pushed frames */ diff --git a/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java index fe9e68a9aca..ac17fa23fc0 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ThreadDeathRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadDeathRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java b/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java index 298da9a3941..596c96b329a 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/ThreadStartRequest.java @@ -44,6 +44,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface ThreadStartRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java b/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java index c600651c562..86434403439 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/VMDeathRequest.java @@ -56,6 +56,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.4 */ +@jdk.Exported public interface VMDeathRequest extends EventRequest { } diff --git a/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java b/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java index cafe61dc40f..9c78f75499c 100644 --- a/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java +++ b/jdk/src/share/classes/com/sun/jdi/request/WatchpointRequest.java @@ -38,6 +38,7 @@ import com.sun.jdi.*; * @author Robert Field * @since 1.3 */ +@jdk.Exported public interface WatchpointRequest extends EventRequest { /** diff --git a/jdk/src/share/classes/com/sun/jdi/request/package-info.java b/jdk/src/share/classes/com/sun/jdi/request/package-info.java new file mode 100644 index 00000000000..add151ddce0 --- /dev/null +++ b/jdk/src/share/classes/com/sun/jdi/request/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package is used to request that a JDI + * event be sent under specified conditions. + * With the exception of termination events, which are + * always sent, there is one kind of + * {@link com.sun.jdi.request.EventRequest} for each kind of + * {@link com.sun.jdi.event.Event Event} - for example, + * {@link com.sun.jdi.request.BreakpointRequest} is used to request a + * {@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}. + * Event requests are created by the + * {@link com.sun.jdi.request.EventRequestManager}. + * Events and event processing are defined in the + * {@link com.sun.jdi.event} package. + *

    + * Methods may be added to the interfaces in the JDI packages in future + * releases. Existing packages may be renamed if the JDI becomes a standard + * extension. + */ + +@jdk.Exported +package com.sun.jdi.request; diff --git a/jdk/src/share/classes/com/sun/jdi/request/package.html b/jdk/src/share/classes/com/sun/jdi/request/package.html deleted file mode 100644 index c99c1c8e359..00000000000 --- a/jdk/src/share/classes/com/sun/jdi/request/package.html +++ /dev/null @@ -1,48 +0,0 @@ - - - com.sun.jdi.request description - - - -This package is used to request that a JDI -event be sent under specified conditions. -With the exception of termination events, which are -always sent, there is one kind of -{@link com.sun.jdi.request.EventRequest} for each kind of -{@link com.sun.jdi.event.Event Event} - for example, -{@link com.sun.jdi.request.BreakpointRequest} is used to request a -{@link com.sun.jdi.event.BreakpointEvent BreakpointEvent}. -Event requests are created by the -{@link com.sun.jdi.request.EventRequestManager}. -Events and event processing are defined in the -{@link com.sun.jdi.event} package. -

    -Methods may be added to the interfaces in the JDI packages in future -releases. Existing packages may be renamed if the JDI becomes a standard -extension. - - diff --git a/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java b/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java index d4171b24282..b0fe91bf728 100644 --- a/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java +++ b/jdk/src/share/classes/com/sun/jmx/remote/protocol/iiop/IIOPProxyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009,2013, Oracle and/or its affiliates. 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 @@ -36,13 +36,34 @@ import java.rmi.RemoteException; import java.rmi.NoSuchObjectException; import com.sun.jmx.remote.internal.IIOPProxy; +import java.io.SerializablePermission; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.Permissions; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; /** - * An implementatin of IIOPProxy that simply delegates to the appropriate + * An implementation of IIOPProxy that simply delegates to the appropriate * RMI-IIOP and CORBA APIs. */ public class IIOPProxyImpl implements IIOPProxy { + // special ACC used to initialize the IIOP stub + // the only allowed privilege is SerializablePermission("enableSubclassImplementation") + private static final AccessControlContext STUB_ACC; + + static { + Permissions p = new Permissions(); + p.add(new SerializablePermission("enableSubclassImplementation")); + STUB_ACC = new AccessControlContext( + new ProtectionDomain[]{ + new ProtectionDomain(null, p) + } + ); + } + public IIOPProxyImpl() { } @Override @@ -113,7 +134,24 @@ public class IIOPProxyImpl implements IIOPProxy { } @Override - public Remote toStub(Remote obj) throws NoSuchObjectException { - return PortableRemoteObject.toStub(obj); + public Remote toStub(final Remote obj) throws NoSuchObjectException { + if (System.getSecurityManager() == null) { + return PortableRemoteObject.toStub(obj); + } else { + try { + return AccessController.doPrivileged(new PrivilegedExceptionAction() { + + @Override + public Remote run() throws Exception { + return PortableRemoteObject.toStub(obj); + } + }, STUB_ACC); + } catch (PrivilegedActionException e) { + if (e.getException() instanceof NoSuchObjectException) { + throw (NoSuchObjectException)e.getException(); + } + throw new RuntimeException("Unexpected exception type", e.getException()); + } + } } } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java index d6ab7310a87..9797aad348f 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapCtxFactory.java @@ -237,7 +237,7 @@ final public class LdapCtxFactory implements ObjectFactory, InitialContextFactor private static String[] getTypeNames(Class currentClass, Vector v) { getClassesAux(currentClass, v); - Class[] members = currentClass.getInterfaces(); + Class[] members = currentClass.getInterfaces(); for (int i = 0; i < members.length; i++) { getClassesAux(members[i], v); } diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java b/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java index b401c0289c9..122253812c6 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/LdapPoolManager.java @@ -237,7 +237,7 @@ public final class LdapPoolManager { !socketFactory.equals(LdapCtx.DEFAULT_SSL_FACTORY)) { try { Class socketFactoryClass = Obj.helper.loadClass(socketFactory); - Class[] interfaces = socketFactoryClass.getInterfaces(); + Class[] interfaces = socketFactoryClass.getInterfaces(); for (int i = 0; i < interfaces.length; i++) { if (interfaces[i].getCanonicalName().equals(COMPARATOR)) { foundSockCmp = true; diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java index 9e8854a460c..63e6bd280ba 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/VersionHelper12.java @@ -25,11 +25,12 @@ package com.sun.jndi.ldap; -import java.net.URL; import java.net.URLClassLoader; import java.net.MalformedURLException; +import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.misc.SharedSecrets; final class VersionHelper12 extends VersionHelper { @@ -82,12 +83,16 @@ final class VersionHelper12 extends VersionHelper { } Thread createThread(final Runnable r) { + final AccessControlContext acc = AccessController.getContext(); + // 4290486: doPrivileged is needed to create a thread in + // an environment that restricts "modifyThreadGroup". return AccessController.doPrivileged( - new PrivilegedAction() { - public Thread run() { - return new Thread(r); + new PrivilegedAction() { + public Thread run() { + return SharedSecrets.getJavaLangAccess() + .newThreadWithAcc(r, acc); + } } - } ); } } diff --git a/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java b/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java index 64fb94b3fb8..b27512020d8 100644 --- a/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java +++ b/jdk/src/share/classes/com/sun/management/GarbageCollectionNotificationInfo.java @@ -85,6 +85,7 @@ import sun.management.GarbageCollectionNotifInfoCompositeData; * **/ +@jdk.Exported public class GarbageCollectionNotificationInfo implements CompositeDataView { private final String gcName; diff --git a/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java b/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java index ad9335f94d0..af574caa43f 100644 --- a/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java +++ b/jdk/src/share/classes/com/sun/management/GarbageCollectorMXBean.java @@ -37,6 +37,7 @@ import javax.management.openmbean.CompositeType; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface GarbageCollectorMXBean extends java.lang.management.GarbageCollectorMXBean { diff --git a/jdk/src/share/classes/com/sun/management/GcInfo.java b/jdk/src/share/classes/com/sun/management/GcInfo.java index 5fa897cb1ff..516174a5384 100644 --- a/jdk/src/share/classes/com/sun/management/GcInfo.java +++ b/jdk/src/share/classes/com/sun/management/GcInfo.java @@ -64,6 +64,7 @@ import sun.management.GcInfoBuilder; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public class GcInfo implements CompositeData, CompositeDataView { private final long index; private final long startTime; diff --git a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java index 2fe8835259f..60751b04d0d 100644 --- a/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java +++ b/jdk/src/share/classes/com/sun/management/HotSpotDiagnosticMXBean.java @@ -48,6 +48,7 @@ import java.lang.management.PlatformManagedObject; * * @see ManagementFactory#getPlatformMXBeans(Class) */ +@jdk.Exported public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { /** * Dumps the heap to the outputFile file in the same @@ -66,6 +67,11 @@ public interface HotSpotDiagnosticMXBean extends PlatformManagedObject { * cannot be created, opened, or written to. * @throws UnsupportedOperationException if this operation is not supported. * @throws NullPointerException if outputFile is null. + * @throws SecurityException + * If a security manager exists and its {@link + * java.lang.SecurityManager#checkWrite(java.lang.String)} + * method denies write access to the named file + * or the caller does not have ManagmentPermission("control"). */ public void dumpHeap(String outputFile, boolean live) throws java.io.IOException; diff --git a/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java b/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java index d20cd3696f1..57075080ff1 100644 --- a/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java +++ b/jdk/src/share/classes/com/sun/management/OperatingSystemMXBean.java @@ -39,6 +39,7 @@ package com.sun.management; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface OperatingSystemMXBean extends java.lang.management.OperatingSystemMXBean { diff --git a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java index f5a9a5b9a0d..25a59c41017 100644 --- a/jdk/src/share/classes/com/sun/management/ThreadMXBean.java +++ b/jdk/src/share/classes/com/sun/management/ThreadMXBean.java @@ -38,6 +38,7 @@ import java.util.Map; * @since 6u25 */ +@jdk.Exported public interface ThreadMXBean extends java.lang.management.ThreadMXBean { /** * Returns the total CPU time for each thread whose ID is diff --git a/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java b/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java index 20f43bf0bbd..00cb3f4af86 100644 --- a/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java +++ b/jdk/src/share/classes/com/sun/management/UnixOperatingSystemMXBean.java @@ -32,6 +32,7 @@ package com.sun.management; * @author Mandy Chung * @since 1.5 */ +@jdk.Exported public interface UnixOperatingSystemMXBean extends com.sun.management.OperatingSystemMXBean { diff --git a/jdk/src/share/classes/com/sun/management/VMOption.java b/jdk/src/share/classes/com/sun/management/VMOption.java index ba8e1d06fb9..d79bc5b4d67 100644 --- a/jdk/src/share/classes/com/sun/management/VMOption.java +++ b/jdk/src/share/classes/com/sun/management/VMOption.java @@ -52,6 +52,7 @@ import javax.management.openmbean.CompositeData; * @author Mandy Chung * @since 1.6 */ +@jdk.Exported public class VMOption { private String name; private String value; @@ -64,6 +65,7 @@ public class VMOption { * * @since 1.6 */ + @jdk.Exported public enum Origin { /** * The VM option has not been set and its value diff --git a/jdk/src/share/classes/com/sun/management/package-info.java b/jdk/src/share/classes/com/sun/management/package-info.java new file mode 100644 index 00000000000..75808f5c96f --- /dev/null +++ b/jdk/src/share/classes/com/sun/management/package-info.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2004, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package contains Oracle Corporation's platform extension to + * the implementation of the + * + * java.lang.management API and also defines the management + * interface for some other components for the platform. + * + *

    + * All platform MBeans are registered in the platform MBeanServer + * which can be obtained via the + * + * java.lang.management.ManagementFactory.getPlatformMBeanServer + * + * @author Mandy Chung + * @since 1.5 + */ + +@jdk.Exported +package com.sun.management; diff --git a/jdk/src/share/classes/com/sun/management/package.html b/jdk/src/share/classes/com/sun/management/package.html deleted file mode 100644 index c26d4309da6..00000000000 --- a/jdk/src/share/classes/com/sun/management/package.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - -This package contains Oracle Corporation's platform extension to -the implementation of the - -java.lang.management API and also defines the management -interface for some other components for the platform. - -

    -All platform MBeans are registered in the platform MBeanServer -which can be obtained via the - -java.lang.management.ManagementFactory.getPlatformMBeanServer - -@author Mandy Chung -@since 1.5 - - - - - diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java index c9a0bc3c5ee..ba4aecb3e17 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Authenticator.java @@ -36,6 +36,7 @@ import java.util.*; * Note. This implies that any caching of credentials or other authentication * information must be done outside of this class. */ +@jdk.Exported public abstract class Authenticator { /** @@ -47,6 +48,7 @@ public abstract class Authenticator { * Indicates an authentication failure. The authentication * attempt has completed. */ + @jdk.Exported public static class Failure extends Result { private int responseCode; @@ -68,6 +70,7 @@ public abstract class Authenticator { * authenticated user principal can be acquired by calling * getPrincipal(). */ + @jdk.Exported public static class Success extends Result { private HttpPrincipal principal; @@ -89,6 +92,7 @@ public abstract class Authenticator { * set any necessary response headers in the given HttpExchange * before returning this Retry object. */ + @jdk.Exported public static class Retry extends Result { private int responseCode; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java index 60ccd3ab73d..09964d5dced 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/BasicAuthenticator.java @@ -33,6 +33,7 @@ import java.util.Base64; * to provide an implementation of {@link #checkCredentials(String,String)} * which is called to verify each incoming request. */ +@jdk.Exported public abstract class BasicAuthenticator extends Authenticator { protected String realm; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Filter.java b/jdk/src/share/classes/com/sun/net/httpserver/Filter.java index 7431453f85e..01fd7b694da 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Filter.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Filter.java @@ -39,6 +39,7 @@ import java.util.*; * exchange handler. * @since 1.6 */ +@jdk.Exported public abstract class Filter { protected Filter () {} @@ -48,6 +49,7 @@ public abstract class Filter { * Each filter in the chain is given one of these * so it can invoke the next filter in the chain */ + @jdk.Exported public static class Chain { /* the last element in the chain must invoke the users * handler diff --git a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java index afe3c217d41..c33e250d32b 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/Headers.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/Headers.java @@ -58,6 +58,7 @@ import java.util.*; * as a header line containing the key but no associated value. * @since 1.6 */ +@jdk.Exported public class Headers implements Map> { HashMap> map; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java index d42833c6689..b145813abb9 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpContext.java @@ -40,6 +40,7 @@ import java.util.*; * context can be pre- and post-processed by each Filter in the chain. * @since 1.6 */ +@jdk.Exported public abstract class HttpContext { protected HttpContext () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java index 1754fe30bb6..2ceacf764ae 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpExchange.java @@ -65,6 +65,7 @@ import sun.net.www.MessageHeader; * @since 1.6 */ +@jdk.Exported public abstract class HttpExchange { protected HttpExchange () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java index 54c69cb464d..3611d67c429 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpHandler.java @@ -32,6 +32,7 @@ import java.io.IOException; * HTTP exchange is handled by one of these handlers. * @since 1.6 */ +@jdk.Exported public interface HttpHandler { /** * Handle the given request and generate an appropriate response. diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java index 2a2f6e93249..e34eccb173f 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpPrincipal.java @@ -33,6 +33,7 @@ import java.security.Principal; * Represents a user authenticated by HTTP Basic or Digest * authentication. */ +@jdk.Exported public class HttpPrincipal implements Principal { private String username, realm; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java index e24b133134d..21dfe413f30 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpServer.java @@ -87,6 +87,7 @@ import com.sun.net.httpserver.spi.HttpServerProvider; * @since 1.6 */ +@jdk.Exported public abstract class HttpServer { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java index 2543a157a4d..f15c8a9a84e 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsConfigurator.java @@ -67,6 +67,7 @@ import javax.net.ssl.*; *

    * @since 1.6 */ +@jdk.Exported public class HttpsConfigurator { private SSLContext context; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java index 807bb51c4d6..1893b1de1fc 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsExchange.java @@ -39,6 +39,7 @@ import java.util.*; * @since 1.6 */ +@jdk.Exported public abstract class HttpsExchange extends HttpExchange { protected HttpsExchange () { diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java index d740c11b52f..70df374dad3 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsParameters.java @@ -49,6 +49,7 @@ import javax.net.ssl.SSLParameters; * are used, and any settings made in this object are ignored. * @since 1.6 */ +@jdk.Exported public abstract class HttpsParameters { private String[] cipherSuites; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java b/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java index dbcdd9f60ba..b4a0a58fef4 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/HttpsServer.java @@ -45,6 +45,7 @@ import com.sun.net.httpserver.spi.*; * @since 1.6 */ +@jdk.Exported public abstract class HttpsServer extends HttpServer { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/package-info.java b/jdk/src/share/classes/com/sun/net/httpserver/package-info.java index 859746cb362..ebe76e5fdfe 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/package-info.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/package-info.java @@ -123,4 +123,5 @@

    @since 1.6 */ +@jdk.Exported package com.sun.net.httpserver; diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java index 080420b6285..affd8ab2aa0 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/HttpServerProvider.java @@ -40,6 +40,7 @@ import com.sun.net.httpserver.*; * {@link HttpServer} and associated classes. Applications do not normally use * this class. See {@link #provider()} for how providers are found and loaded. */ +@jdk.Exported public abstract class HttpServerProvider { /** diff --git a/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java b/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java index 9f85747317d..f4d244a9995 100644 --- a/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java +++ b/jdk/src/share/classes/com/sun/net/httpserver/spi/package-info.java @@ -24,7 +24,8 @@ */ /** - Provides a pluggable service provider interface, which allows the HTTP server - implementation to be replaced with other implementations. -*/ + * Provides a pluggable service provider interface, which allows the HTTP server + * implementation to be replaced with other implementations. + */ +@jdk.Exported package com.sun.net.httpserver.spi; diff --git a/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java b/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java index 776a84c1459..f4a2a80552e 100644 --- a/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java +++ b/jdk/src/share/classes/com/sun/net/ssl/internal/www/protocol/https/HttpsURLConnectionOldImpl.java @@ -404,6 +404,7 @@ public class HttpsURLConnectionOldImpl return delegate.getContent(); } + @SuppressWarnings("rawtypes") public Object getContent(Class[] classes) throws IOException { return delegate.getContent(classes); } diff --git a/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java b/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java index 6240c6c9189..d11cc16fb21 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/AbstractNotificationHandler.java @@ -39,6 +39,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class AbstractNotificationHandler implements NotificationHandler { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/Association.java b/jdk/src/share/classes/com/sun/nio/sctp/Association.java index 965feae3418..01cc82deecc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/Association.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/Association.java @@ -51,6 +51,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class Association { private final int associationID; private final int maxInStreams; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java index 5e8b29d4398..ff41b472d4b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/AssociationChangeNotification.java @@ -29,6 +29,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public abstract class AssociationChangeNotification implements Notification { @@ -37,6 +38,7 @@ public abstract class AssociationChangeNotification * * @since 1.7 */ + @jdk.Exported public enum AssocChangeEvent { /** diff --git a/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java b/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java index 7301b45fb0e..42dd17fde42 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/HandlerResult.java @@ -34,6 +34,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public enum HandlerResult { /** * Try to receieve another message or notification. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java index b5a4137054d..dec6382b5a1 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalReceiveException.java @@ -31,6 +31,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class IllegalReceiveException extends IllegalStateException { private static final long serialVersionUID = 2296619040988576224L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java index 4088df34687..dc965d626cd 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/IllegalUnbindException.java @@ -31,6 +31,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class IllegalUnbindException extends IllegalStateException { private static final long serialVersionUID = -310540883995532224L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java index abe49f24593..c331b25d681 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/InvalidStreamException.java @@ -30,6 +30,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public class InvalidStreamException extends IllegalArgumentException { private static final long serialVersionUID = -9172703378046665558L; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java index 997c6253834..a63f909aa04 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/MessageInfo.java @@ -56,6 +56,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class MessageInfo { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java index 2436fae7ba7..8c20103735a 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/Notification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/Notification.java @@ -37,6 +37,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public interface Notification { /** * Returns the association that this notification is applicable to. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java b/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java index f5af2b227e2..f95d9ec5ab3 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/NotificationHandler.java @@ -49,6 +49,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public interface NotificationHandler { /** * Invoked when a notification is received from the SCTP stack. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java index d8afdcd957a..e05c8bb0277 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/PeerAddressChangeNotification.java @@ -32,6 +32,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class PeerAddressChangeNotification implements Notification { @@ -46,6 +47,7 @@ public abstract class PeerAddressChangeNotification * * @since 1.7 */ + @jdk.Exported public enum AddressChangeEvent { /** * This address is now reachable. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java index 22cf07650f4..52709b07e9d 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpChannel.java @@ -134,6 +134,7 @@ import java.nio.channels.SelectionKey; * * @since 1.7 */ +@jdk.Exported public abstract class SctpChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java index 42e56591e43..79c5efba5cc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpMultiChannel.java @@ -134,6 +134,7 @@ import java.nio.channels.SelectionKey; * * @since 1.7 */ +@jdk.Exported public abstract class SctpMultiChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java index c96e516ca4d..a1e7a9a4439 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpServerChannel.java @@ -68,6 +68,7 @@ import java.nio.channels.spi.AbstractSelectableChannel; * * @since 1.7 */ +@jdk.Exported public abstract class SctpServerChannel extends AbstractSelectableChannel { diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java index 3cccefa4371..783bc56f752 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpSocketOption.java @@ -35,4 +35,5 @@ import java.net.SocketOption; * * @see SctpStandardSocketOptions */ +@jdk.Exported public interface SctpSocketOption extends SocketOption { } diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java index 839c73be29b..1ac4c79f5cc 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SctpStandardSocketOptions.java @@ -34,6 +34,7 @@ import sun.nio.ch.sctp.SctpStdSocketOption; * * @since 1.7 */ +@jdk.Exported public class SctpStandardSocketOptions { private SctpStandardSocketOptions() {} /** @@ -315,6 +316,7 @@ public class SctpStandardSocketOptions { * * @since 1.7 */ + @jdk.Exported public static class InitMaxStreams { private int maxInStreams; private int maxOutStreams; diff --git a/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java index 2c3bc855d11..8178b3ca63b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/SendFailedNotification.java @@ -37,6 +37,7 @@ import java.net.SocketAddress; * * @since 1.7 */ +@jdk.Exported public abstract class SendFailedNotification implements Notification { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java b/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java index 6405752e310..d3556b3a155 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/ShutdownNotification.java @@ -32,6 +32,7 @@ package com.sun.nio.sctp; * * @since 1.7 */ +@jdk.Exported public abstract class ShutdownNotification implements Notification { /** * Initializes a new instance of this class. diff --git a/jdk/src/share/classes/com/sun/nio/sctp/package-info.java b/jdk/src/share/classes/com/sun/nio/sctp/package-info.java index 7893a4d755f..fe63d18b65b 100644 --- a/jdk/src/share/classes/com/sun/nio/sctp/package-info.java +++ b/jdk/src/share/classes/com/sun/nio/sctp/package-info.java @@ -72,4 +72,5 @@ * @since 1.7 */ +@jdk.Exported package com.sun.nio.sctp; diff --git a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java index 6e067fe723d..e974f2cb833 100644 --- a/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/LdapPrincipal.java @@ -45,6 +45,7 @@ import javax.naming.ldap.LdapName; * * @since 1.6 */ +@jdk.Exported public final class LdapPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = 6820120005580754861L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java index 9afbfead1a7..e89e565afd0 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTDomainPrincipal.java @@ -45,6 +45,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTDomainPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -4408637351440771220L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java b/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java index b574f8cde9f..02f9634ef39 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTNumericCredential.java @@ -31,6 +31,7 @@ package com.sun.security.auth; * */ +@jdk.Exported public class NTNumericCredential { private long impersonationToken; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSid.java b/jdk/src/share/classes/com/sun/security/auth/NTSid.java index 0720c5ec3fb..2c64deb65a6 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSid.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSid.java @@ -47,6 +47,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSid implements Principal, java.io.Serializable { private static final long serialVersionUID = 4412290580770249885L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java index 0182c345dfd..082b9c43379 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidDomainPrincipal.java @@ -43,6 +43,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidDomainPrincipal extends NTSid { private static final long serialVersionUID = 5247810785821650912L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java index 66df636ba64..52205c974a0 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidGroupPrincipal.java @@ -40,6 +40,7 @@ package com.sun.security.auth; * @see javax.security.auth.Subject * @see com.sun.security.auth.NTSid */ +@jdk.Exported public class NTSidGroupPrincipal extends NTSid { private static final long serialVersionUID = -1373347438636198229L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java index 10055e5c29f..7d3f6663f8b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidPrimaryGroupPrincipal.java @@ -39,6 +39,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidPrimaryGroupPrincipal extends NTSid { private static final long serialVersionUID = 8011978367305190527L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java index c7f8f9b4afe..b180f52338b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTSidUserPrincipal.java @@ -39,6 +39,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTSidUserPrincipal extends NTSid { private static final long serialVersionUID = -5573239889517749525L; diff --git a/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java index c5d42486607..405d5538dae 100644 --- a/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/NTUserPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class NTUserPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -8737649811939033735L; diff --git a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java index 1df34428514..a6402eb68ee 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/PolicyFile.java @@ -215,6 +215,7 @@ import javax.security.auth.Subject; * @see java.security.ProtectionDomain * @see java.security.Security security properties */ +@jdk.Exported(false) @Deprecated public class PolicyFile extends javax.security.auth.Policy { diff --git a/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java b/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java index 2d8ccde63b3..122a31cd30a 100644 --- a/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java +++ b/jdk/src/share/classes/com/sun/security/auth/PrincipalComparator.java @@ -50,6 +50,7 @@ package com.sun.security.auth; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public interface PrincipalComparator { /** * Check if the specified Subject is implied by diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java index 66943aaa71a..bb7e8b8f01c 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericGroupPrincipal.java @@ -45,6 +45,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisNumericGroupPrincipal implements Principal, diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java index 5623239666e..eff1f3dcedf 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisNumericUserPrincipal.java @@ -44,6 +44,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisNumericUserPrincipal implements Principal, diff --git a/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java index 406692c7687..bd3e8c8067f 100644 --- a/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/SolarisPrincipal.java @@ -44,6 +44,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported(false) @Deprecated public class SolarisPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java index 5c4260b5ccc..7e63b443156 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixNumericGroupPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java index bb15312b602..25811860e13 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixNumericUserPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixNumericUserPrincipal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java index 67d9133ef03..3a8004f24bd 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UnixPrincipal.java @@ -41,6 +41,7 @@ import java.security.Principal; * @see java.security.Principal * @see javax.security.auth.Subject */ +@jdk.Exported public class UnixPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = -2951667807323493631L; diff --git a/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java b/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java index 0b8a9a821ee..a156b473beb 100644 --- a/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java +++ b/jdk/src/share/classes/com/sun/security/auth/UserPrincipal.java @@ -42,6 +42,7 @@ import java.security.Principal; * * @since 1.6 */ +@jdk.Exported public final class UserPrincipal implements Principal, java.io.Serializable { private static final long serialVersionUID = 892106070870210969L; diff --git a/jdk/src/share/classes/com/sun/security/auth/X500Principal.java b/jdk/src/share/classes/com/sun/security/auth/X500Principal.java index cb48043aea4..d4b7ce26347 100644 --- a/jdk/src/share/classes/com/sun/security/auth/X500Principal.java +++ b/jdk/src/share/classes/com/sun/security/auth/X500Principal.java @@ -49,6 +49,7 @@ import sun.security.x509.X500Name; * class. * @see javax.security.auth.x500.X500Principal */ +@jdk.Exported(false) @Deprecated public class X500Principal implements Principal, java.io.Serializable { diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java index 9f6bd0433c2..a68ad5db678 100644 --- a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java +++ b/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java @@ -54,6 +54,7 @@ import javax.swing.JTextField; * @see javax.security.auth.callback * @deprecated This class will be removed in a future release. */ +@jdk.Exported(false) @Deprecated public class DialogCallbackHandler implements CallbackHandler { diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java b/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java index 004c05da149..6bebfb4f398 100644 --- a/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java +++ b/jdk/src/share/classes/com/sun/security/auth/callback/TextCallbackHandler.java @@ -53,6 +53,7 @@ import sun.security.util.Password; * @see javax.security.auth.callback */ +@jdk.Exported public class TextCallbackHandler implements CallbackHandler { /** diff --git a/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java b/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java new file mode 100644 index 00000000000..61d65688798 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/callback/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth.callback; diff --git a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java index 3e6dc7da579..53058177ac2 100644 --- a/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java +++ b/jdk/src/share/classes/com/sun/security/auth/login/ConfigFile.java @@ -83,6 +83,7 @@ import java.net.URI; * @see javax.security.auth.login.LoginContext * @see java.security.Security security properties */ +@jdk.Exported public class ConfigFile extends Configuration { private final sun.security.provider.ConfigFile.Spi spi; diff --git a/jdk/src/share/classes/com/sun/security/auth/login/package-info.java b/jdk/src/share/classes/com/sun/security/auth/login/package-info.java new file mode 100644 index 00000000000..a0b207c5578 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/login/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth.login; diff --git a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java index b6b8660a2e4..35d35cc91d9 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/JndiLoginModule.java @@ -151,6 +151,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; * * */ +@jdk.Exported public class JndiLoginModule implements LoginModule { private static final ResourceBundle rb = AccessController.doPrivileged( diff --git a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java index 70f74d65a22..ada7630b463 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/KeyStoreLoginModule.java @@ -110,6 +110,7 @@ import sun.security.util.Password; * * */ +@jdk.Exported public class KeyStoreLoginModule implements LoginModule { private static final ResourceBundle rb = AccessController.doPrivileged( diff --git a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java index cd60c6ac790..c5b26892073 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/Krb5LoginModule.java @@ -379,6 +379,7 @@ import sun.misc.HexDumpEncoder; * @author Ram Marti */ +@jdk.Exported public class Krb5LoginModule implements LoginModule { // initial state diff --git a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java index 10fa6b640d8..24c7571effe 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/LdapLoginModule.java @@ -304,6 +304,7 @@ import com.sun.security.auth.UserPrincipal; * * @since 1.6 */ +@jdk.Exported public class LdapLoginModule implements LoginModule { // Use the default classloader for this class to load the prompt strings. diff --git a/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java index 4ef208def94..18fb73db7cc 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/NTLoginModule.java @@ -57,6 +57,7 @@ import com.sun.security.auth.NTNumericCredential; * * @see javax.security.auth.spi.LoginModule */ +@jdk.Exported public class NTLoginModule implements LoginModule { private NTSystem ntSystem; diff --git a/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java index 51f9a2c688c..502d92a7144 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/NTSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * security information for the current user. * */ +@jdk.Exported public class NTSystem { private native void getCurrent(boolean debug); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java index 07042b7e3e7..e03eb7a03b1 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/SolarisLoginModule.java @@ -52,6 +52,7 @@ import com.sun.security.auth.SolarisNumericGroupPrincipal; * UnixLoginModule. * */ +@jdk.Exported(false) @Deprecated public class SolarisLoginModule implements LoginModule { diff --git a/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java index 622671bd3fb..df4f5278877 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/SolarisSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * UID/GID/groups information for the current user. * */ +@jdk.Exported public class SolarisSystem { private native void getSolarisInfo(); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java b/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java index 00b7d2559a2..3b592671998 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/UnixLoginModule.java @@ -47,6 +47,7 @@ import com.sun.security.auth.UnixNumericGroupPrincipal; * debug messages will be output to the output stream, System.out. * */ +@jdk.Exported public class UnixLoginModule implements LoginModule { // initial state diff --git a/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java b/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java index b902cc9e36a..804d8c10a1b 100644 --- a/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java +++ b/jdk/src/share/classes/com/sun/security/auth/module/UnixSystem.java @@ -30,6 +30,7 @@ package com.sun.security.auth.module; * UID/GID/groups information for the current user. * */ +@jdk.Exported public class UnixSystem { private native void getUnixInfo(); diff --git a/jdk/src/share/classes/com/sun/security/auth/module/package-info.java b/jdk/src/share/classes/com/sun/security/auth/module/package-info.java new file mode 100644 index 00000000000..21569670ffe --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/module/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth.module; diff --git a/jdk/src/share/classes/com/sun/security/auth/package-info.java b/jdk/src/share/classes/com/sun/security/auth/package-info.java new file mode 100644 index 00000000000..3fe7e206fa7 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/auth/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.auth; diff --git a/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java b/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java index afdb880e42e..fdabd190fb8 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java +++ b/jdk/src/share/classes/com/sun/security/jgss/AuthorizationDataEntry.java @@ -28,7 +28,8 @@ package com.sun.security.jgss; /** * Kerberos 5 AuthorizationData entry. */ -final public class AuthorizationDataEntry { +@jdk.Exported +public final class AuthorizationDataEntry { private final int type; private final byte[] data; diff --git a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java index 3d8935a59e8..798379e0dde 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java +++ b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSContext.java @@ -32,6 +32,7 @@ import org.ietf.jgss.*; * functionalities not defined by {@code org.ietf.jgss.GSSContext}, * such as querying context-specific attributes. */ +@jdk.Exported public interface ExtendedGSSContext extends GSSContext { /** * Return the mechanism-specific attribute associated with {@code type}. diff --git a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java index 8f09482a7d0..bf44dff65cd 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java +++ b/jdk/src/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java @@ -32,6 +32,7 @@ import org.ietf.jgss.*; * functionalities not defined by {@code org.ietf.jgss.GSSCredential}. * @since 1.8 */ +@jdk.Exported public interface ExtendedGSSCredential extends GSSCredential { /** * Impersonates a principal. In Kerberos, this can be implemented diff --git a/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java b/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java index d05582a8c17..50b83da5ebb 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java +++ b/jdk/src/share/classes/com/sun/security/jgss/GSSUtil.java @@ -33,6 +33,7 @@ import org.ietf.jgss.GSSCredential; * GSS-API Utilities for using in conjunction with Sun Microsystem's * implementation of Java GSS-API. */ +@jdk.Exported public class GSSUtil { /** diff --git a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java index e07072d5b9c..1e247f9ca07 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java +++ b/jdk/src/share/classes/com/sun/security/jgss/InquireSecContextPermission.java @@ -35,6 +35,7 @@ import java.security.BasicPermission; * *

    The target name is the {@link InquireType} allowed. */ +@jdk.Exported public final class InquireSecContextPermission extends BasicPermission { private static final long serialVersionUID = -7131173349668647297L; diff --git a/jdk/src/share/classes/com/sun/security/jgss/InquireType.java b/jdk/src/share/classes/com/sun/security/jgss/InquireType.java index e69ad1a6ced..c153ccb8c4f 100644 --- a/jdk/src/share/classes/com/sun/security/jgss/InquireType.java +++ b/jdk/src/share/classes/com/sun/security/jgss/InquireType.java @@ -29,6 +29,7 @@ package com.sun.security.jgss; * Attribute types that can be specified as an argument of * {@link com.sun.security.jgss.ExtendedGSSContext#inquireSecContext} */ +@jdk.Exported public enum InquireType { /** * Attribute type for retrieving the session key of an diff --git a/jdk/src/share/classes/com/sun/security/jgss/package-info.java b/jdk/src/share/classes/com/sun/security/jgss/package-info.java new file mode 100644 index 00000000000..b1c82d77387 --- /dev/null +++ b/jdk/src/share/classes/com/sun/security/jgss/package-info.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +@jdk.Exported +package com.sun.security.jgss; diff --git a/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java b/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java index 5f241b4044b..cee1a519d38 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AgentInitializationException.java @@ -40,6 +40,7 @@ package com.sun.tools.attach; * the error returned by the agent's Agent_OnAttach function. * This error code can be obtained by invoking the {@link #returnValue() returnValue} method. */ +@jdk.Exported public class AgentInitializationException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java b/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java index a724d8b4bf2..fa19a5f3e63 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AgentLoadException.java @@ -36,6 +36,7 @@ package com.sun.tools.attach; * com.sun.tools.attach.VirtualMachine#loadAgentPath loadAgentPath} methods * if the agent, or agent library, cannot be loaded. */ +@jdk.Exported public class AgentLoadException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java b/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java index ac4d1ee6be2..40f86243413 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AttachNotSupportedException.java @@ -36,6 +36,7 @@ import com.sun.tools.attach.spi.AttachProvider; // for javadoc * AttachProvider.attachVirtualMachine} if the provider attempts to * attach to a Java virtual machine with which it not comptatible. */ +@jdk.Exported public class AttachNotSupportedException extends Exception { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java b/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java index ca094d658d8..4d05f1e49b6 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java +++ b/jdk/src/share/classes/com/sun/tools/attach/AttachPermission.java @@ -79,6 +79,7 @@ package com.sun.tools.attach; * @see com.sun.tools.attach.spi.AttachProvider */ +@jdk.Exported public final class AttachPermission extends java.security.BasicPermission { /** use serialVersionUID for interoperability */ diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java index 29464d88da6..1bea7512147 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java +++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java @@ -102,6 +102,7 @@ import java.io.IOException; * @since 1.6 */ +@jdk.Exported public abstract class VirtualMachine { private AttachProvider provider; private String id; diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java index 9334ea19fc6..3e27fe8489f 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java +++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachineDescriptor.java @@ -55,6 +55,7 @@ import com.sun.tools.attach.spi.AttachProvider; * * @since 1.6 */ +@jdk.Exported public class VirtualMachineDescriptor { private AttachProvider provider; diff --git a/jdk/src/share/classes/com/sun/tools/attach/package-info.java b/jdk/src/share/classes/com/sun/tools/attach/package-info.java new file mode 100644 index 00000000000..e335725390a --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/attach/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Provides the API to attach to a JavaTM + * virtual machine. + *

    + * A tool, written in the Java Language, uses this API to attach to a target + * virtual machine (VM) and load its tool agent into the target VM. For + * example, a management console might have a management agent which it uses + * to obtain management information from instrumented objects in a Java + * virtual machine. If the management console is required to manage + * an application that is running in a virtual machine that does not include + * the management agent, then this API can be used to attach to the target + * VM and load the agent. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.attach; diff --git a/jdk/src/share/classes/com/sun/tools/attach/package.html b/jdk/src/share/classes/com/sun/tools/attach/package.html deleted file mode 100644 index 8673b110bb3..00000000000 --- a/jdk/src/share/classes/com/sun/tools/attach/package.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - -Provides the API to attach to a JavaTM -virtual machine. - -A tool, written in the Java Language, uses this API to attach to a target -virtual machine (VM) and load its tool agent into the target VM. For -example, a management console might have a management agent which it uses -to obtain management information from instrumented objects in a Java -virtual machine. If the management console is required to manage -an application that is running in a virtual machine that does not include -the management agent, then this API can be used to attach to the target -VM and load the agent. - -@since 1.6 - - - - - - diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java b/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java index f85daab7706..67f74f707c4 100644 --- a/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java +++ b/jdk/src/share/classes/com/sun/tools/attach/spi/AttachProvider.java @@ -74,6 +74,7 @@ import java.util.ServiceLoader; * @since 1.6 */ +@jdk.Exported public abstract class AttachProvider { private static final Object lock = new Object(); diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java b/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java new file mode 100644 index 00000000000..b2c68ebe5a0 --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/attach/spi/package-info.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * Only developers who are defining new attach providers should need to make + * direct use of this package. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.attach.spi; diff --git a/jdk/src/share/classes/com/sun/tools/attach/spi/package.html b/jdk/src/share/classes/com/sun/tools/attach/spi/package.html deleted file mode 100644 index 28b7db6bc31..00000000000 --- a/jdk/src/share/classes/com/sun/tools/attach/spi/package.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - -Provider classes for the {@link com.sun.tools.attach} package. - -

    Only developers who are defining new attach providers should need to make -direct use of this package.

    - -@since 1.6 - - - diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java index d44a8fc2ecf..bdf01b8d5c6 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java @@ -84,7 +84,7 @@ class AllClassesQuery extends QueryHandler { lastPackage = pkg; printClass(clazz); if (clazz.getId() != -1) { - out.print(" [" + clazz.getIdString() + "]"); + print(" [" + clazz.getIdString() + "]"); } out.println("
    "); } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java index 1d5782390ce..f13572a22cc 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java @@ -112,12 +112,12 @@ class ClassQuery extends QueryHandler { out.println("

    Instances

    "); printAnchorStart(); - out.print("instances/" + encodeForURL(clazz)); + print("instances/" + encodeForURL(clazz)); out.print("\">"); out.println("Exclude subclasses
    "); printAnchorStart(); - out.print("allInstances/" + encodeForURL(clazz)); + print("allInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Include subclasses
    "); @@ -126,19 +126,19 @@ class ClassQuery extends QueryHandler { out.println("

    New Instances

    "); printAnchorStart(); - out.print("newInstances/" + encodeForURL(clazz)); + print("newInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Exclude subclasses
    "); printAnchorStart(); - out.print("allNewInstances/" + encodeForURL(clazz)); + print("allNewInstances/" + encodeForURL(clazz)); out.print("\">"); out.println("Include subclasses
    "); } out.println("

    References summary by Type

    "); printAnchorStart(); - out.print("refsByType/" + encodeForURL(clazz)); + print("refsByType/" + encodeForURL(clazz)); out.print("\">"); out.println("References summary by type"); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java index f86c8caa8e2..f08c9875c67 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java @@ -41,21 +41,17 @@ package com.sun.tools.hat.internal.server; import java.net.Socket; -import java.net.ServerSocket; -import java.net.InetAddress; import java.io.InputStream; import java.io.BufferedInputStream; import java.io.IOException; -import java.io.Writer; import java.io.BufferedWriter; import java.io.PrintWriter; -import java.io.OutputStream; import java.io.OutputStreamWriter; -import java.io.BufferedOutputStream; import com.sun.tools.hat.internal.model.Snapshot; import com.sun.tools.hat.internal.oql.OQLEngine; +import com.sun.tools.hat.internal.util.Misc; public class HttpReader implements Runnable { @@ -87,7 +83,7 @@ public class HttpReader implements Runnable { outputError("Protocol error"); } int data; - StringBuffer queryBuf = new StringBuffer(); + StringBuilder queryBuf = new StringBuilder(); while ((data = in.read()) != -1 && data != ' ') { char ch = (char) data; queryBuf.append(ch); @@ -217,7 +213,7 @@ public class HttpReader implements Runnable { private void outputError(String msg) { out.println(); out.println(""); - out.println(msg); + out.println(Misc.encodeHtml(msg)); out.println(""); } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java index 724b549ca4b..7e87543ef99 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java @@ -102,7 +102,7 @@ class InstancesCountQuery extends QueryHandler { int count = clazz.getInstancesCount(false); print("" + count); printAnchorStart(); - out.print("instances/" + encodeForURL(classes[i])); + print("instances/" + encodeForURL(classes[i])); out.print("\"> "); if (count == 1) { print("instance"); @@ -121,7 +121,7 @@ class InstancesCountQuery extends QueryHandler { } print("("); printAnchorStart(); - out.print("newInstances/" + encodeForURL(classes[i])); + print("newInstances/" + encodeForURL(classes[i])); out.print("\">"); print("" + newInst + " new"); out.print(") "); diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java index 6aaa909109a..730d2b7672d 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java @@ -54,10 +54,7 @@ class OQLHelp extends QueryHandler { out.print((char)ch); } } catch (Exception exp) { - out.println(exp.getMessage()); - out.println("
    ");
    -            exp.printStackTrace(out);
    -            out.println("
    "); + printException(exp); } } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java index 8e5ec5e2894..3e99bbcbb74 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java @@ -32,10 +32,7 @@ package com.sun.tools.hat.internal.server; -import com.sun.tools.hat.internal.model.*; import com.sun.tools.hat.internal.oql.*; -import com.sun.tools.hat.internal.util.ArraySorter; -import com.sun.tools.hat.internal.util.Comparer; /** * This handles Object Query Language (OQL) queries. @@ -68,7 +65,7 @@ class OQLQuery extends QueryHandler { out.println("

    "); out.println(""); out.println("

    "); @@ -91,10 +88,7 @@ class OQLQuery extends QueryHandler { try { out.println(engine.toHtml(o)); } catch (Exception e) { - out.println(e.getMessage()); - out.println("
    ");
    -                             e.printStackTrace(out);
    -                             out.println("
    "); + printException(e); } out.println(""); return false; @@ -102,10 +96,7 @@ class OQLQuery extends QueryHandler { }); out.println(""); } catch (OQLException exp) { - out.println(exp.getMessage()); - out.println("
    ");
    -            exp.printStackTrace(out);
    -            out.println("
    "); + printException(exp); } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java index deda0f48058..9a6d93de06a 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java @@ -36,6 +36,7 @@ import java.io.PrintWriter; import com.sun.tools.hat.internal.model.*; import com.sun.tools.hat.internal.util.Misc; +import java.io.StringWriter; import java.net.URLEncoder; import java.io.UnsupportedEncodingException; @@ -96,7 +97,7 @@ abstract class QueryHandler { } protected void error(String msg) { - out.println(msg); + println(msg); } protected void printAnchorStart() { @@ -160,7 +161,6 @@ abstract class QueryHandler { out.println("null"); return; } - String name = clazz.getName(); printAnchorStart(); out.print("class/"); print(encodeForURL(clazz)); @@ -208,6 +208,15 @@ abstract class QueryHandler { } } + protected void printException(Throwable t) { + println(t.getMessage()); + out.println("
    ");
    +        StringWriter sw = new StringWriter();
    +        t.printStackTrace(new PrintWriter(sw));
    +        print(sw.toString());
    +        out.println("
    "); + } + protected void printHex(long addr) { if (snapshot.getIdentifierSize() == 4) { out.print(Misc.toHex((int)addr)); @@ -223,4 +232,8 @@ abstract class QueryHandler { protected void print(String str) { out.print(Misc.encodeHtml(str)); } + + protected void println(String str) { + out.println(Misc.encodeHtml(str)); + } } diff --git a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java index 5e7de9a8866..3337b471590 100644 --- a/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java +++ b/jdk/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java @@ -89,7 +89,7 @@ public class RefsByTypeQuery extends QueryHandler { out.println("

    "); printClass(clazz); if (clazz.getId() != -1) { - out.println("[" + clazz.getIdString() + "]"); + println("[" + clazz.getIdString() + "]"); } out.println("

    "); @@ -125,9 +125,9 @@ public class RefsByTypeQuery extends QueryHandler { JavaClass clazz = classes[i]; out.println(""); out.print(""); - out.print(clazz.getName()); + print(clazz.getName()); out.println(""); out.println(""); out.println(map.get(clazz)); diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java b/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java index 0c24061b99f..9c8895f304f 100644 --- a/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java +++ b/jdk/src/share/classes/com/sun/tools/jconsole/JConsoleContext.java @@ -43,6 +43,7 @@ import javax.swing.event.SwingPropertyChangeSupport; * * @since 1.6 */ +@jdk.Exported public interface JConsoleContext { /** * The {@link ConnectionState ConnectionState} bound property name. @@ -53,6 +54,7 @@ public interface JConsoleContext { * Values for the {@linkplain #CONNECTION_STATE_PROPERTY * ConnectionState} bound property. */ + @jdk.Exported public enum ConnectionState { /** * The connection has been successfully established. diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java b/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java index ab8a969e349..daff88c33af 100644 --- a/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java +++ b/jdk/src/share/classes/com/sun/tools/jconsole/JConsolePlugin.java @@ -72,6 +72,7 @@ import javax.swing.SwingWorker; * * @since 1.6 */ +@jdk.Exported public abstract class JConsolePlugin { private volatile JConsoleContext context = null; private List listeners = null; diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java b/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java new file mode 100644 index 00000000000..99b52aa3728 --- /dev/null +++ b/jdk/src/share/classes/com/sun/tools/jconsole/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2006, 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * This package contains the JConsole API. + * + * @since 1.6 + */ + +@jdk.Exported +package com.sun.tools.jconsole; diff --git a/jdk/src/share/classes/com/sun/tools/jconsole/package.html b/jdk/src/share/classes/com/sun/tools/jconsole/package.html deleted file mode 100644 index c0859d24723..00000000000 --- a/jdk/src/share/classes/com/sun/tools/jconsole/package.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - -This package contains the JConsole API. - -@since 1.6 - - - diff --git a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java index ac1403348d7..86ac95cb172 100644 --- a/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java +++ b/jdk/src/share/classes/java/awt/datatransfer/DataFlavor.java @@ -30,6 +30,9 @@ import java.nio.*; import java.util.*; import sun.awt.datatransfer.DataTransferer; +import sun.reflect.misc.ReflectUtil; + +import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION; /** * A {@code DataFlavor} provides meta information about data. {@code DataFlavor} @@ -116,27 +119,33 @@ public class DataFlavor implements Externalizable, Cloneable { ClassLoader fallback) throws ClassNotFoundException { - ClassLoader systemClassLoader = (ClassLoader) - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public Object run() { - ClassLoader cl = Thread.currentThread(). - getContextClassLoader(); - return (cl != null) - ? cl - : ClassLoader.getSystemClassLoader(); - } - }); - + ReflectUtil.checkPackageAccess(className); try { - return Class.forName(className, true, systemClassLoader); - } catch (ClassNotFoundException e2) { - if (fallback != null) { - return Class.forName(className, true, fallback); - } else { - throw new ClassNotFoundException(className); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(GET_CLASSLOADER_PERMISSION); } + ClassLoader loader = ClassLoader.getSystemClassLoader(); + try { + // bootstrap class loader and system class loader if present + return Class.forName(className, true, loader); + } + catch (ClassNotFoundException exception) { + // thread context class loader if and only if present + loader = Thread.currentThread().getContextClassLoader(); + if (loader != null) { + try { + return Class.forName(className, true, loader); + } + catch (ClassNotFoundException e) { + // fallback to user's class loader + } + } + } + } catch (SecurityException exception) { + // ignore secured class loaders } + return Class.forName(className, true, fallback); } /* diff --git a/jdk/src/share/classes/java/beans/Beans.java b/jdk/src/share/classes/java/beans/Beans.java index 58a411691fd..5bf13fa7d09 100644 --- a/jdk/src/share/classes/java/beans/Beans.java +++ b/jdk/src/share/classes/java/beans/Beans.java @@ -42,6 +42,8 @@ import java.io.ObjectInputStream; import java.io.ObjectStreamClass; import java.io.StreamCorruptedException; +import java.lang.reflect.Modifier; + import java.net.URL; import java.security.AccessController; @@ -224,6 +226,10 @@ public class Beans { throw ex; } + if (!Modifier.isPublic(cl.getModifiers())) { + throw new ClassNotFoundException("" + cl + " : no public access"); + } + /* * Try to instantiate the class. */ diff --git a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java index 0d056c2e8e5..d4ec31a29e1 100644 --- a/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java +++ b/jdk/src/share/classes/java/beans/DefaultPersistenceDelegate.java @@ -222,6 +222,9 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate { // Write out the properties of this instance. private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) { for (Field field : type.getFields()) { + if (!ReflectUtil.isPackageAccessible(field.getDeclaringClass())) { + continue; + } int mod = field.getModifiers(); if (Modifier.isFinal(mod) || Modifier.isStatic(mod) || Modifier.isTransient(mod)) { continue; diff --git a/jdk/src/share/classes/java/beans/MetaData.java b/jdk/src/share/classes/java/beans/MetaData.java index 61f51d4bb3f..d733b6f1eab 100644 --- a/jdk/src/share/classes/java/beans/MetaData.java +++ b/jdk/src/share/classes/java/beans/MetaData.java @@ -42,6 +42,7 @@ import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.lang.reflect.Modifier; import java.lang.reflect.InvocationTargetException; import java.security.AccessController; @@ -56,7 +57,7 @@ import javax.swing.plaf.ColorUIResource; import sun.swing.PrintColorUIResource; -import java.util.Objects; +import static sun.reflect.misc.ReflectUtil.isPackageAccessible; /* * Like the Intropector, the MetaData class @@ -850,13 +851,15 @@ static final class java_awt_AWTKeyStroke_PersistenceDelegate extends Persistence static class StaticFieldsPersistenceDelegate extends PersistenceDelegate { protected void installFields(Encoder out, Class cls) { - Field fields[] = cls.getFields(); - for(int i = 0; i < fields.length; i++) { - Field field = fields[i]; - // Don't install primitives, their identity will not be preserved - // by wrapping. - if (Object.class.isAssignableFrom(field.getType())) { - out.writeExpression(new Expression(field, "get", new Object[]{null})); + if (Modifier.isPublic(cls.getModifiers()) && isPackageAccessible(cls)) { + Field fields[] = cls.getFields(); + for(int i = 0; i < fields.length; i++) { + Field field = fields[i]; + // Don't install primitives, their identity will not be preserved + // by wrapping. + if (Object.class.isAssignableFrom(field.getType())) { + out.writeExpression(new Expression(field, "get", new Object[]{null})); + } } } } diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java index d754cc2c275..c71681c255d 100644 --- a/jdk/src/share/classes/java/io/ObjectInputStream.java +++ b/jdk/src/share/classes/java/io/ObjectInputStream.java @@ -491,11 +491,12 @@ public class ObjectInputStream public void defaultReadObject() throws IOException, ClassNotFoundException { - if (curContext == null) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to readObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); bin.setBlockDataMode(false); defaultReadFields(curObj, curDesc); bin.setBlockDataMode(true); @@ -529,11 +530,12 @@ public class ObjectInputStream public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException { - if (curContext == null) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to readObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); bin.setBlockDataMode(false); GetFieldImpl getField = new GetFieldImpl(curDesc); getField.readFields(); @@ -1968,7 +1970,6 @@ public class ObjectInputStream private void defaultReadFields(Object obj, ObjectStreamClass desc) throws IOException { - // REMIND: is isInstance check necessary? Class cl = desc.forClass(); if (cl != null && obj != null && !cl.isInstance(obj)) { throw new ClassCastException(); diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java index 6f4c1f3e070..c851b3a641a 100644 --- a/jdk/src/share/classes/java/io/ObjectOutputStream.java +++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java @@ -431,11 +431,12 @@ public class ObjectOutputStream * OutputStream */ public void defaultWriteObject() throws IOException { - if ( curContext == null ) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to writeObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); bout.setBlockDataMode(false); defaultWriteFields(curObj, curDesc); bout.setBlockDataMode(true); @@ -453,11 +454,12 @@ public class ObjectOutputStream */ public ObjectOutputStream.PutField putFields() throws IOException { if (curPut == null) { - if (curContext == null) { + SerialCallbackContext ctx = curContext; + if (ctx == null) { throw new NotActiveException("not in call to writeObject"); } - Object curObj = curContext.getObj(); - ObjectStreamClass curDesc = curContext.getDesc(); + Object curObj = ctx.getObj(); + ObjectStreamClass curDesc = ctx.getDesc(); curPut = new PutFieldImpl(curDesc); } return curPut; @@ -1517,7 +1519,11 @@ public class ObjectOutputStream private void defaultWriteFields(Object obj, ObjectStreamClass desc) throws IOException { - // REMIND: perform conservative isInstance check here? + Class cl = desc.forClass(); + if (cl != null && obj != null && !cl.isInstance(obj)) { + throw new ClassCastException(); + } + desc.checkDefaultSerialize(); int primDataSize = desc.getPrimDataSize(); diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java index 6d1aa009755..500f70d3cb5 100644 --- a/jdk/src/share/classes/java/lang/Class.java +++ b/jdk/src/share/classes/java/lang/Class.java @@ -1209,9 +1209,25 @@ public final class Class implements java.io.Serializable, * type, or void,then this method returns null. * * @return the declaring class for this class + * @throws SecurityException + * If a security manager, s, is present and the caller's + * class loader is not the same as or an ancestor of the class + * loader for the declaring class and invocation of {@link + * SecurityManager#checkPackageAccess s.checkPackageAccess()} + * denies access to the package of the declaring class * @since JDK1.1 */ - public native Class getDeclaringClass(); + @CallerSensitive + public Class getDeclaringClass() throws SecurityException { + final Class candidate = getDeclaringClass0(); + + if (candidate != null) + candidate.checkPackageAccess( + ClassLoader.getClassLoader(Reflection.getCallerClass()), true); + return candidate; + } + + private native Class getDeclaringClass0(); /** diff --git a/jdk/src/share/classes/java/lang/ClassLoader.java b/jdk/src/share/classes/java/lang/ClassLoader.java index c3f2aa20458..7aa5087ad2f 100644 --- a/jdk/src/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/share/classes/java/lang/ClassLoader.java @@ -57,6 +57,7 @@ import sun.misc.URLClassPath; import sun.misc.VM; import sun.reflect.CallerSensitive; import sun.reflect.Reflection; +import sun.reflect.misc.ReflectUtil; import sun.security.util.SecurityConstants; /** @@ -486,6 +487,13 @@ public abstract class ClassLoader { private void checkPackageAccess(Class cls, ProtectionDomain pd) { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { + if (ReflectUtil.isNonPublicProxyClass(cls)) { + for (Class intf: cls.getInterfaces()) { + checkPackageAccess(intf, pd); + } + return; + } + final String name = cls.getName(); final int i = name.lastIndexOf('.'); if (i != -1) { @@ -1061,6 +1069,10 @@ public abstract class ClassLoader { * built-in to the virtual machine is searched. That failing, this method * will invoke {@link #findResource(String)} to find the resource.

    * + * @apiNote When overriding this method it is recommended that an + * implementation ensures that any delegation is consistent with the {@link + * #getResources(java.lang.String) getResources(String)} method. + * * @param name * The resource name * @@ -1094,6 +1106,13 @@ public abstract class ClassLoader { *

    The search order is described in the documentation for {@link * #getResource(String)}.

    * + * @apiNote When overriding this method it is recommended that an + * implementation ensures that any delegation is consistent with the {@link + * #getResource(java.lang.String) getResource(String)} method. This should + * ensure that the first element returned by the Enumeration's + * {@code nextElement} method is the same resource that the + * {@code getResource(String)} method would return. + * * @param name * The resource name * diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java index 79eb6434433..c5b5e9e890b 100644 --- a/jdk/src/share/classes/java/lang/System.java +++ b/jdk/src/share/classes/java/lang/System.java @@ -26,6 +26,7 @@ package java.lang; import java.io.*; import java.lang.reflect.Executable; +import java.security.AccessControlContext; import java.util.Properties; import java.util.PropertyPermission; import java.util.StringTokenizer; @@ -1254,6 +1255,9 @@ public final class System { public String newStringUnsafe(char[] chars) { return new String(chars, true); } + public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) { + return new Thread(target, acc); + } }); } } diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java index d8a9ee2a582..c2f5561bdf4 100644 --- a/jdk/src/share/classes/java/lang/Thread.java +++ b/jdk/src/share/classes/java/lang/Thread.java @@ -340,6 +340,15 @@ class Thread implements Runnable { sleep(millis); } + /** + * Initializes a Thread with the current AccessControlContext. + * @see #init(ThreadGroup,Runnable,String,long,AccessControlContext) + */ + private void init(ThreadGroup g, Runnable target, String name, + long stackSize) { + init(g, target, name, stackSize, null); + } + /** * Initializes a Thread. * @@ -348,9 +357,11 @@ class Thread implements Runnable { * @param name the name of the new Thread * @param stackSize the desired stack size for the new thread, or * zero to indicate that this parameter is to be ignored. + * @param acc the AccessControlContext to inherit, or + * AccessController.getContext() if null */ private void init(ThreadGroup g, Runnable target, String name, - long stackSize) { + long stackSize, AccessControlContext acc) { if (name == null) { throw new NullPointerException("name cannot be null"); } @@ -396,7 +407,8 @@ class Thread implements Runnable { this.contextClassLoader = parent.getContextClassLoader(); else this.contextClassLoader = parent.contextClassLoader; - this.inheritedAccessControlContext = AccessController.getContext(); + this.inheritedAccessControlContext = + acc != null ? acc : AccessController.getContext(); this.target = target; setPriority(priority); if (parent.inheritableThreadLocals != null) @@ -448,6 +460,14 @@ class Thread implements Runnable { init(null, target, "Thread-" + nextThreadNum(), 0); } + /** + * Creates a new Thread that inherits the given AccessControlContext. + * This is not a public constructor. + */ + Thread(Runnable target, AccessControlContext acc) { + init(null, target, "Thread-" + nextThreadNum(), 0, acc); + } + /** * Allocates a new {@code Thread} object. This constructor has the same * effect as {@linkplain #Thread(ThreadGroup,Runnable,String) Thread} diff --git a/jdk/src/share/classes/java/lang/instrument/Instrumentation.java b/jdk/src/share/classes/java/lang/instrument/Instrumentation.java index 4cdb2de9c9a..bedb780680f 100644 --- a/jdk/src/share/classes/java/lang/instrument/Instrumentation.java +++ b/jdk/src/share/classes/java/lang/instrument/Instrumentation.java @@ -381,6 +381,7 @@ public interface Instrumentation { * * @return an array containing all the classes loaded by the JVM, zero-length if there are none */ + @SuppressWarnings("rawtypes") Class[] getAllLoadedClasses(); @@ -393,6 +394,7 @@ public interface Instrumentation { * @return an array containing all the classes for which loader is an initiating loader, * zero-length if there are none */ + @SuppressWarnings("rawtypes") Class[] getInitiatedClasses(ClassLoader loader); diff --git a/jdk/src/share/classes/java/lang/invoke/CallSite.java b/jdk/src/share/classes/java/lang/invoke/CallSite.java index 1d584d53fdb..5da81af41ba 100644 --- a/jdk/src/share/classes/java/lang/invoke/CallSite.java +++ b/jdk/src/share/classes/java/lang/invoke/CallSite.java @@ -124,7 +124,7 @@ public class CallSite { * or if the target returned by the hook is not of the given {@code targetType} * @throws NullPointerException if the hook returns a null value * @throws ClassCastException if the hook returns something other than a {@code MethodHandle} - * @throws Throwable anything else thrown by the the hook function + * @throws Throwable anything else thrown by the hook function */ /*package-private*/ CallSite(MethodType targetType, MethodHandle createTargetHook) throws Throwable { diff --git a/jdk/src/share/classes/java/lang/invoke/ConstantCallSite.java b/jdk/src/share/classes/java/lang/invoke/ConstantCallSite.java index 2d9fedecc8a..771b06d2058 100644 --- a/jdk/src/share/classes/java/lang/invoke/ConstantCallSite.java +++ b/jdk/src/share/classes/java/lang/invoke/ConstantCallSite.java @@ -75,7 +75,7 @@ public class ConstantCallSite extends CallSite { * or if the target returned by the hook is not of the given {@code targetType} * @throws NullPointerException if the hook returns a null value * @throws ClassCastException if the hook returns something other than a {@code MethodHandle} - * @throws Throwable anything else thrown by the the hook function + * @throws Throwable anything else thrown by the hook function */ protected ConstantCallSite(MethodType targetType, MethodHandle createTargetHook) throws Throwable { super(targetType, createTargetHook); @@ -85,7 +85,7 @@ public class ConstantCallSite extends CallSite { /** * Returns the target method of the call site, which behaves * like a {@code final} field of the {@code ConstantCallSite}. - * That is, the the target is always the original value passed + * That is, the target is always the original value passed * to the constructor call which created this instance. * * @return the immutable linkage state of this call site, a constant method handle diff --git a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index f74678e1bae..486680712e0 100644 --- a/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -27,12 +27,15 @@ package java.lang.invoke; import jdk.internal.org.objectweb.asm.*; import sun.misc.Unsafe; +import sun.security.action.GetPropertyAction; +import java.io.FilePermission; import java.lang.reflect.Constructor; import java.security.AccessController; import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.concurrent.atomic.AtomicInteger; +import java.util.PropertyPermission; import static jdk.internal.org.objectweb.asm.Opcodes.*; @@ -66,12 +69,23 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // Used to ensure that each spun class name is unique private static final AtomicInteger counter = new AtomicInteger(0); + // For dumping generated classes to disk, for debugging purposes + private static final ProxyClassesDumper dumper; + + static { + final String key = "jdk.internal.lambda.dumpProxyClasses"; + String path = AccessController.doPrivileged( + new GetPropertyAction(key), null, + new PropertyPermission(key , "read")); + dumper = (null == path) ? null : ProxyClassesDumper.getInstance(path); + } + // See context values in AbstractValidatingLambdaMetafactory private final String implMethodClassName; // Name of type containing implementation "CC" private final String implMethodName; // Name of implementation method "impl" private final String implMethodDesc; // Type descriptor for implementation methods "(I)Ljava/lang/String;" - private final Type[] implMethodArgumentTypes; // ASM types for implementaion method parameters - private final Type implMethodReturnType; // ASM type for implementaion method return type "Ljava/lang/String;" + private final Type[] implMethodArgumentTypes; // ASM types for implementation method parameters + private final Type implMethodReturnType; // ASM type for implementation method return type "Ljava/lang/String;" private final MethodType constructorType; // Generated class constructor type "(CC)void" private final String constructorDesc; // Type descriptor for constructor "(LCC;)V" private final ClassWriter cw; // ASM class writer @@ -259,29 +273,31 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; final byte[] classBytes = cw.toByteArray(); - /*** Uncomment to dump the generated file - System.out.printf("Loaded: %s (%d bytes) %n", lambdaClassName, - classBytes.length); - try (FileOutputStream fos = new FileOutputStream(lambdaClassName - .replace('/', '.') + ".class")) { - fos.write(classBytes); - } catch (IOException ex) { - PlatformLogger.getLogger(InnerClassLambdaMetafactory.class - .getName()).severe(ex.getMessage(), ex); - } - ***/ + // If requested, dump out to a file for debugging purposes + if (dumper != null) { + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { + dumper.dumpClass(lambdaClassName, classBytes); + return null; + } + }, null, + new FilePermission("<>", "read, write"), + // createDirectories may need it + new PropertyPermission("user.dir", "read")); + } ClassLoader loader = targetClass.getClassLoader(); ProtectionDomain pd = (loader == null) - ? null - : AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public ProtectionDomain run() { - return targetClass.getProtectionDomain(); - } - } - ); + ? null + : AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ProtectionDomain run() { + return targetClass.getProtectionDomain(); + } + } + ); return UNSAFE.defineClass(lambdaClassName, classBytes, 0, classBytes.length, diff --git a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index 7b6b4137549..639b3628fa5 100644 --- a/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/jdk/src/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2013, Oracle and/or its affiliates. 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 @@ -609,6 +609,7 @@ class InvokerBytecodeGenerator { cls = cls.getComponentType(); if (cls.isPrimitive()) return true; // int[].class, for example + // could use VerifyAccess.isClassAccessible but the following is a safe approximation if (cls.getClassLoader() != Object.class.getClassLoader()) return false; if (VerifyAccess.isSamePackage(MethodHandle.class, cls)) diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java index 14bc2b44d58..ce115df85ed 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandle.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandle.java @@ -251,7 +251,7 @@ import java.util.logging.Logger; * *

    Usage examples

    * Here are some examples of usage: - *

    {@code
    + * 
    {@code
     Object x, y; String s; int i;
     MethodType mt; MethodHandle mh;
     MethodHandles.Lookup lookup = MethodHandles.lookup();
    @@ -608,7 +608,7 @@ public abstract class MethodHandle {
          * or forced to null if the return type is void.
          * 

    * This call is equivalent to the following code: - *

    {@code
    +     * 
    {@code
          * MethodHandle invoker = MethodHandles.spreadInvoker(this.type(), 0);
          * Object result = invoker.invokeExact(this, arguments);
          * }
    @@ -643,9 +643,9 @@ public abstract class MethodHandle { * of the argument array. *

    * This method is also equivalent to the following code: - *

    -     * {@link #invokeWithArguments(Object...) invokeWithArguments}{@code(arguments.toArray())}
    -     * 
    + *
    {@code
    +     *   invokeWithArguments(arguments.toArray()
    +     * }
    * * @param arguments the arguments to pass to the target * @return the result returned by the target @@ -1183,7 +1183,7 @@ assertEquals("[three, thee, tee]", Arrays.toString((Object[])ls.get(0))); /** * Makes a fixed arity method handle which is otherwise - * equivalent to the the current method handle. + * equivalent to the current method handle. *

    * If the current method handle is not of * {@linkplain #asVarargsCollector variable arity}, diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java index 369d14b21f4..1ad7e9cd23f 100644 --- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java @@ -597,7 +597,7 @@ public class MethodHandles { Lookup(Class lookupClass) { this(lookupClass, ALL_MODES); // make sure we haven't accidentally picked up a privileged class: - checkUnprivilegedlookupClass(lookupClass); + checkUnprivilegedlookupClass(lookupClass, ALL_MODES); } private Lookup(Class lookupClass, int allowedModes) { @@ -651,7 +651,7 @@ public class MethodHandles { // No permissions. newModes = 0; } - checkUnprivilegedlookupClass(requestedLookupClass); + checkUnprivilegedlookupClass(requestedLookupClass, newModes); return new Lookup(requestedLookupClass, newModes); } @@ -667,10 +667,19 @@ public class MethodHandles { /** Package-private version of lookup which is trusted. */ static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED); - private static void checkUnprivilegedlookupClass(Class lookupClass) { + private static void checkUnprivilegedlookupClass(Class lookupClass, int allowedModes) { String name = lookupClass.getName(); if (name.startsWith("java.lang.invoke.")) throw newIllegalArgumentException("illegal lookupClass: "+lookupClass); + + // For caller-sensitive MethodHandles.lookup() + // disallow lookup more restricted packages + if (allowedModes == ALL_MODES && lookupClass.getClassLoader() == null) { + if (name.startsWith("java.") || + (name.startsWith("sun.") && !name.startsWith("sun.invoke."))) { + throw newIllegalArgumentException("illegal lookupClass: " + lookupClass); + } + } } /** @@ -739,7 +748,7 @@ public class MethodHandles { * If the returned method handle is invoked, the method's class will * be initialized, if it has not already been initialized. *

    Example: - *

    {@code
    +         * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -797,7 +806,7 @@ assertEquals("[x, y]", MH_asList.invoke("x", "y").toString());
              * with the same {@code type} argument.
              *
              * Example:
    -         * 

    {@code
    +         * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -873,7 +882,7 @@ assertEquals("", (String) MH_newString.invokeExact());
              * If the returned method handle is invoked, the constructor's class will
              * be initialized, if it has not already been initialized.
              * 

    Example: - *

    {@code
    +         * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -933,7 +942,7 @@ assertEquals("[x, y, z]", pb.command().toString());
              * in special circumstances.  Use {@link #findConstructor findConstructor}
              * to access instance initialization methods in a safe manner.)
              * 

    Example: - *

    {@code
    +         * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -1759,6 +1768,12 @@ return mh1;
                 if (MethodHandleNatives.refKindIsField(refKind)) {
                     return getDirectFieldNoSecurityManager(refKind, defc, member);
                 } else if (MethodHandleNatives.refKindIsMethod(refKind)) {
    +                if (defc == MethodHandle.class && refKind == REF_invokeVirtual) {
    +                    MethodHandle mh = findVirtualForMH(member.getName(), member.getMethodType());
    +                    if (mh != null) {
    +                        return mh;
    +                    }
    +                }
                     return getDirectMethodNoSecurityManager(refKind, defc, member, lookupClass);
                 } else if (refKind == REF_newInvokeSpecial) {
                     return getDirectConstructorNoSecurityManager(defc, member);
    @@ -2208,7 +2223,7 @@ assert((int)twice.invokeExact(21) == 42);
          * they will come after.
          * 

    * Example: - *

    {@code
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -2222,7 +2237,7 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z"));
          * }
    *

    * This method is also equivalent to the following code: - *

    +     * 
          * {@link #dropArguments(MethodHandle,int,Class...) dropArguments}{@code (target, pos, valueTypes.toArray(new Class[0]))}
          * 
    * @param target the method handle to invoke after the arguments are dropped @@ -2266,7 +2281,7 @@ assertEquals("yz", (String) d0.invokeExact(123, "x", "y", "z")); * they will come after. *

    * Example: - *

    {@code
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -2284,7 +2299,7 @@ assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z"));
          * }
    *

    * This method is also equivalent to the following code: - *

    +     * 
          * {@link #dropArguments(MethodHandle,int,List) dropArguments}{@code (target, pos, Arrays.asList(valueTypes))}
          * 
    * @param target the method handle to invoke after the arguments are dropped @@ -2332,7 +2347,7 @@ assertEquals("xz", (String) d12.invokeExact("x", 12, true, "z")); * (null or not) * which do not correspond to argument positions in the target. *

    Example: - *

    {@code
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -2425,7 +2440,7 @@ assertEquals("XY", (String) f2.invokeExact("x", "y")); // XY
          * In all cases, {@code pos} must be greater than or equal to zero, and
          * {@code pos} must also be less than or equal to the target's arity.
          * 

    Example: - *

    {@code
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -2530,7 +2545,7 @@ assertEquals("[top, [[up, down, strange], charm], bottom]",
          * The argument type of the filter (if any) must be identical to the
          * return type of the target.
          * 

    Example: - *

    {@code
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    @@ -2621,7 +2636,7 @@ System.out.println((int) f0.invokeExact("x", "y")); // 2
          * arguments will not need to be live on the stack on entry to the
          * target.)
          * 

    Example: - *

    {@code
    +     * 
    {@code
     import static java.lang.invoke.MethodHandles.*;
     import static java.lang.invoke.MethodType.*;
     ...
    diff --git a/jdk/src/share/classes/java/lang/invoke/MethodType.java b/jdk/src/share/classes/java/lang/invoke/MethodType.java
    index 5a73037afdb..f8e0967c7af 100644
    --- a/jdk/src/share/classes/java/lang/invoke/MethodType.java
    +++ b/jdk/src/share/classes/java/lang/invoke/MethodType.java
    @@ -137,7 +137,7 @@ class MethodType implements java.io.Serializable {
     
         /** This number is the maximum arity of a method handle invoker, 253.
          *  It is derived from the absolute JVM-imposed arity by subtracting two,
    -     *  which are the slots occupied by invoke method handle, and the the
    +     *  which are the slots occupied by invoke method handle, and the
          *  target method handle, which are both at the beginning of the argument
          *  list used to invoke the target method handle.
          *  The longest possible invocation will look like
    diff --git a/jdk/src/share/classes/java/lang/invoke/ProxyClassesDumper.java b/jdk/src/share/classes/java/lang/invoke/ProxyClassesDumper.java
    new file mode 100644
    index 00000000000..463f1ff286c
    --- /dev/null
    +++ b/jdk/src/share/classes/java/lang/invoke/ProxyClassesDumper.java
    @@ -0,0 +1,147 @@
    +/*
    + * Copyright (c) 2013, Oracle and/or its affiliates. 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.  Oracle designates this
    + * particular file as subject to the "Classpath" exception as provided
    + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    + * or visit www.oracle.com if you need additional information or have any
    + * questions.
    + */
    +package java.lang.invoke;
    +
    +import sun.util.logging.PlatformLogger;
    +
    +import java.io.FilePermission;
    +import java.nio.file.Files;
    +import java.nio.file.InvalidPathException;
    +import java.nio.file.Path;
    +import java.nio.file.Paths;
    +import java.security.AccessController;
    +import java.security.PrivilegedAction;
    +import java.util.Objects;
    +import java.util.concurrent.atomic.AtomicBoolean;
    +
    +/**
    + * Helper class used by InnerClassLambdaMetafactory to log generated classes
    + *
    + * @implNote
    + * 

    Because this class is called by LambdaMetafactory, make use + * of lambda lead to recursive calls cause stack overflow. + */ +final class ProxyClassesDumper { + private static final char[] HEX = { + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' + }; + private static final char[] BAD_CHARS = { + '\\', ':', '*', '?', '"', '<', '>', '|' + }; + private static final String[] REPLACEMENT = { + "%5C", "%3A", "%2A", "%3F", "%22", "%3C", "%3E", "%7C" + }; + + private final Path dumpDir; + + public static ProxyClassesDumper getInstance(String path) { + if (null == path) { + return null; + } + try { + path = path.trim(); + final Path dir = Paths.get(path.length() == 0 ? "." : path); + AccessController.doPrivileged(new PrivilegedAction() { + @Override + public Void run() { + validateDumpDir(dir); + return null; + } + }, null, new FilePermission("<>", "read, write")); + return new ProxyClassesDumper(dir); + } catch (InvalidPathException ex) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning("Path " + path + " is not valid - dumping disabled", ex); + } catch (IllegalArgumentException iae) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning(iae.getMessage() + " - dumping disabled"); + } + return null; + } + + private ProxyClassesDumper(Path path) { + dumpDir = Objects.requireNonNull(path); + } + + private static void validateDumpDir(Path path) { + if (!Files.exists(path)) { + throw new IllegalArgumentException("Directory " + path + " does not exist"); + } else if (!Files.isDirectory(path)) { + throw new IllegalArgumentException("Path " + path + " is not a directory"); + } else if (!Files.isWritable(path)) { + throw new IllegalArgumentException("Directory " + path + " is not writable"); + } + } + + public static String encodeForFilename(String className) { + final int len = className.length(); + StringBuilder sb = new StringBuilder(len); + + for (int i = 0; i < len; i++) { + char c = className.charAt(i); + // control characters + if (c <= 31) { + sb.append('%'); + sb.append(HEX[c >> 4 & 0x0F]); + sb.append(HEX[c & 0x0F]); + } else { + int j = 0; + for (; j < BAD_CHARS.length; j++) { + if (c == BAD_CHARS[j]) { + sb.append(REPLACEMENT[j]); + break; + } + } + if (j >= BAD_CHARS.length) { + sb.append(c); + } + } + } + + return sb.toString(); + } + + public void dumpClass(String className, final byte[] classBytes) { + Path file; + try { + file = dumpDir.resolve(encodeForFilename(className) + ".class"); + } catch (InvalidPathException ex) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning("Invalid path for class " + className); + return; + } + + try { + Path dir = file.getParent(); + Files.createDirectories(dir); + Files.write(file, classBytes); + } catch (Exception ignore) { + PlatformLogger.getLogger(ProxyClassesDumper.class.getName()) + .warning("Exception writing to path at " + file.toString()); + // simply don't care if this operation failed + } + } +} diff --git a/jdk/src/share/classes/java/lang/reflect/Array.java b/jdk/src/share/classes/java/lang/reflect/Array.java index 55b3dbf646f..f6d7efed146 100644 --- a/jdk/src/share/classes/java/lang/reflect/Array.java +++ b/jdk/src/share/classes/java/lang/reflect/Array.java @@ -55,13 +55,18 @@ class Array { *

    *
    * + *

    The number of dimensions of the new array must not + * exceed 255. + * * @param componentType the {@code Class} object representing the * component type of the new array * @param length the length of the new array * @return the new array * @exception NullPointerException if the specified * {@code componentType} parameter is null - * @exception IllegalArgumentException if componentType is {@link Void#TYPE} + * @exception IllegalArgumentException if componentType is {@link + * Void#TYPE} or if the number of dimensions of the requested array + * instance exceed 255. * @exception NegativeArraySizeException if the specified {@code length} * is negative */ @@ -85,8 +90,7 @@ class Array { * {@code componentType}. * *

    The number of dimensions of the new array must not - * exceed the number of array dimensions supported by the - * implementation (typically 255). + * exceed 255. * * @param componentType the {@code Class} object representing the component * type of the new array @@ -96,10 +100,9 @@ class Array { * @exception NullPointerException if the specified * {@code componentType} argument is null * @exception IllegalArgumentException if the specified {@code dimensions} - * argument is a zero-dimensional array, or if the number of - * requested dimensions exceeds the limit on the number of array dimensions - * supported by the implementation (typically 255), or if componentType - * is {@link Void#TYPE}. + * argument is a zero-dimensional array, if componentType is {@link + * Void#TYPE}, or if the number of dimensions of the requested array + * instance exceed 255. * @exception NegativeArraySizeException if any of the components in * the specified {@code dimensions} argument is negative. */ diff --git a/jdk/src/share/classes/java/lang/reflect/MalformedParametersException.java b/jdk/src/share/classes/java/lang/reflect/MalformedParametersException.java index c68600b412a..74796244ec1 100644 --- a/jdk/src/share/classes/java/lang/reflect/MalformedParametersException.java +++ b/jdk/src/share/classes/java/lang/reflect/MalformedParametersException.java @@ -50,10 +50,22 @@ package java.lang.reflect; */ public class MalformedParametersException extends RuntimeException { + /** + * Version for serialization. + */ private static final long serialVersionUID = 20130919L; + /** + * Create a {@code MalformedParametersException} with an empty + * reason. + */ public MalformedParametersException() {} + /** + * Create a {@code MalformedParametersException}. + * + * @param reason The reason for the exception. + */ public MalformedParametersException(String reason) { super(reason); } diff --git a/jdk/src/share/classes/java/lang/reflect/Proxy.java b/jdk/src/share/classes/java/lang/reflect/Proxy.java index dd5c2ad4336..f2e4eda4e62 100644 --- a/jdk/src/share/classes/java/lang/reflect/Proxy.java +++ b/jdk/src/share/classes/java/lang/reflect/Proxy.java @@ -347,11 +347,11 @@ public class Proxy implements java.io.Serializable { * s.checkPermission} with * {@code RuntimePermission("getClassLoader")} permission * denies access. - *

  • the caller's class loader is not the same as or an - * ancestor of the class loader for the current class and + *
  • for each proxy interface, {@code intf}, + * the caller's class loader is not the same as or an + * ancestor of the class loader for {@code intf} and * invocation of {@link SecurityManager#checkPackageAccess - * s.checkPackageAccess()} denies access to any one of the - * given proxy interfaces.
  • + * s.checkPackageAccess()} denies access to {@code intf}. * * @throws NullPointerException if the {@code interfaces} array @@ -680,11 +680,11 @@ public class Proxy implements java.io.Serializable { * s.checkPermission} with * {@code RuntimePermission("getClassLoader")} permission * denies access; - *
  • the caller's class loader is not the same as or an - * ancestor of the class loader for the current class and + *
  • for each proxy interface, {@code intf}, + * the caller's class loader is not the same as or an + * ancestor of the class loader for {@code intf} and * invocation of {@link SecurityManager#checkPackageAccess - * s.checkPackageAccess()} denies access to any one of the - * given proxy interfaces.
  • + * s.checkPackageAccess()} denies access to {@code intf}; *
  • any of the given proxy interfaces is non-public and the * caller class is not in the same {@linkplain Package runtime package} * as the non-public interface and the invocation of @@ -795,7 +795,14 @@ public class Proxy implements java.io.Serializable { * @return the invocation handler for the proxy instance * @throws IllegalArgumentException if the argument is not a * proxy instance + * @throws SecurityException if a security manager, s, is present + * and the caller's class loader is not the same as or an + * ancestor of the class loader for the invocation handler + * and invocation of {@link SecurityManager#checkPackageAccess + * s.checkPackageAccess()} denies access to the invocation + * handler's class. */ + @CallerSensitive public static InvocationHandler getInvocationHandler(Object proxy) throws IllegalArgumentException { @@ -806,8 +813,19 @@ public class Proxy implements java.io.Serializable { throw new IllegalArgumentException("not a proxy instance"); } - Proxy p = (Proxy) proxy; - return p.h; + final Proxy p = (Proxy) proxy; + final InvocationHandler ih = p.h; + if (System.getSecurityManager() != null) { + Class ihClass = ih.getClass(); + Class caller = Reflection.getCallerClass(); + if (ReflectUtil.needsPackageAccessCheck(caller.getClassLoader(), + ihClass.getClassLoader())) + { + ReflectUtil.checkPackageAccess(ihClass); + } + } + + return ih; } private static native Class defineClass0(ClassLoader loader, String name, diff --git a/jdk/src/share/classes/java/math/BigDecimal.java b/jdk/src/share/classes/java/math/BigDecimal.java index 0abfb7522b5..c17b8b77aff 100644 --- a/jdk/src/share/classes/java/math/BigDecimal.java +++ b/jdk/src/share/classes/java/math/BigDecimal.java @@ -727,36 +727,27 @@ public class BigDecimal extends Number implements Comparable { *
    *
    BigDecimalString: *
    Signopt Significand Exponentopt - *

    *

    Sign: *
    {@code +} *
    {@code -} - *

    *

    Significand: *
    IntegerPart {@code .} FractionPartopt *
    {@code .} FractionPart *
    IntegerPart - *

    *

    IntegerPart: *
    Digits - *

    *

    FractionPart: *
    Digits - *

    *

    Exponent: *
    ExponentIndicator SignedInteger - *

    *

    ExponentIndicator: *
    {@code e} *
    {@code E} - *

    *

    SignedInteger: *
    Signopt Digits - *

    *

    Digits: *
    Digit *
    Digits Digit - *

    *

    Digit: *
    any character for which {@link Character#isDigit} * returns {@code true}, including 0, 1, 2 ... diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java index 6beaed71bb3..f7878ab3302 100644 --- a/jdk/src/share/classes/java/math/BigInteger.java +++ b/jdk/src/share/classes/java/math/BigInteger.java @@ -35,6 +35,7 @@ import java.io.ObjectOutputStream; import java.io.ObjectStreamField; import java.util.Arrays; import java.util.Random; +import java.util.concurrent.ThreadLocalRandom; import sun.misc.DoubleConsts; import sun.misc.FloatConsts; @@ -918,15 +919,6 @@ public class BigInteger extends Number implements Comparable { return u; } - private static volatile Random staticRandom; - - private static Random getSecureRandom() { - if (staticRandom == null) { - staticRandom = new java.security.SecureRandom(); - } - return staticRandom; - } - /** * Returns true iff this BigInteger passes the specified number of * Miller-Rabin tests. This test is taken from the DSA spec (NIST FIPS @@ -945,7 +937,7 @@ public class BigInteger extends Number implements Comparable { // Do the tests if (rnd == null) { - rnd = getSecureRandom(); + rnd = ThreadLocalRandom.current(); } for (int i=0; i < iterations; i++) { // Generate a uniform random on (1, this) diff --git a/jdk/src/share/classes/java/math/RoundingMode.java b/jdk/src/share/classes/java/math/RoundingMode.java index 41493a200e2..3a4fe97f4ab 100644 --- a/jdk/src/share/classes/java/math/RoundingMode.java +++ b/jdk/src/share/classes/java/math/RoundingMode.java @@ -51,7 +51,6 @@ package java.math; * proper {@code MathContext}. A summary table showing the results * of these rounding operations for all rounding modes appears below. * - *

    * * *
    Summary of Rounding Operations Under Different Rounding Modes
    Result of rounding input to one digit with the given diff --git a/jdk/src/share/classes/java/net/ContentHandler.java b/jdk/src/share/classes/java/net/ContentHandler.java index 8c585cbf354..c658585c530 100644 --- a/jdk/src/share/classes/java/net/ContentHandler.java +++ b/jdk/src/share/classes/java/net/ContentHandler.java @@ -96,6 +96,7 @@ abstract public class ContentHandler { * @exception IOException if an I/O error occurs while reading the object. * @since 1.3 */ + @SuppressWarnings("rawtypes") public Object getContent(URLConnection urlc, Class[] classes) throws IOException { Object obj = getContent(urlc); diff --git a/jdk/src/share/classes/java/net/HostPortrange.java b/jdk/src/share/classes/java/net/HostPortrange.java new file mode 100644 index 00000000000..fc5e3d98a20 --- /dev/null +++ b/jdk/src/share/classes/java/net/HostPortrange.java @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.net; + +import java.net.*; +import java.util.Formatter; +import java.util.Locale; +import sun.net.util.IPAddressUtil; + +/** + * Parses a string containing a host/domain name and port range + */ +class HostPortrange { + + String hostname; + String scheme; + int[] portrange; + + boolean wildcard; + boolean literal; + boolean ipv6, ipv4; + static final int PORT_MIN = 0; + static final int PORT_MAX = (1 << 16) -1; + + boolean equals(HostPortrange that) { + return this.hostname.equals(that.hostname) + && this.portrange[0] == that.portrange[0] + && this.portrange[1] == that.portrange[1] + && this.wildcard == that.wildcard + && this.literal == that.literal; + } + + public int hashCode() { + return hostname.hashCode() + portrange[0] + portrange[1]; + } + + HostPortrange(String scheme, String str) { + // Parse the host name. A name has up to three components, the + // hostname, a port number, or two numbers representing a port + // range. "www.sun.com:8080-9090" is a valid host name. + + // With IPv6 an address can be 2010:836B:4179::836B:4179 + // An IPv6 address needs to be enclose in [] + // For ex: [2010:836B:4179::836B:4179]:8080-9090 + // Refer to RFC 2732 for more information. + + // first separate string into two fields: hoststr, portstr + String hoststr, portstr = null; + this.scheme = scheme; + + // check for IPv6 address + if (str.charAt(0) == '[') { + ipv6 = literal = true; + int rb = str.indexOf(']'); + if (rb != -1) { + hoststr = str.substring(1, rb); + } else { + throw new IllegalArgumentException("invalid IPv6 address: " + str); + } + int sep = str.indexOf(':', rb + 1); + if (sep != -1 && str.length() > sep) { + portstr = str.substring(sep + 1); + } + // need to normalize hoststr now + byte[] ip = IPAddressUtil.textToNumericFormatV6(hoststr); + if (ip == null) { + throw new IllegalArgumentException("illegal IPv6 address"); + } + StringBuilder sb = new StringBuilder(); + Formatter formatter = new Formatter(sb, Locale.US); + formatter.format("%02x%02x:%02x%02x:%02x%02x:%02x" + + "%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", + ip[0], ip[1], ip[2], ip[3], ip[4], ip[5], ip[6], ip[7], ip[8], + ip[9], ip[10], ip[11], ip[12], ip[13], ip[14], ip[15]); + hostname = sb.toString(); + } else { + // not IPv6 therefore ':' is the port separator + + int sep = str.indexOf(':'); + if (sep != -1 && str.length() > sep) { + hoststr = str.substring(0, sep); + portstr = str.substring(sep + 1); + } else { + hoststr = sep == -1 ? str : str.substring(0, sep); + } + // is this a domain wildcard specification? + if (hoststr.lastIndexOf('*') > 0) { + throw new IllegalArgumentException("invalid host wildcard specification"); + } else if (hoststr.startsWith("*")) { + wildcard = true; + if (hoststr.equals("*")) { + hoststr = ""; + } else if (hoststr.startsWith("*.")) { + hoststr = hoststr.substring(1).toLowerCase(); // leave the '.' ? + } else { + throw new IllegalArgumentException("invalid host wildcard specification"); + } + } else { + // check if ipv4 (if rightmost label a number) + // The normal way to specify ipv4 is 4 decimal labels + // but actually three, two or single label formats valid also + // So, we recognise ipv4 by just testing the rightmost label + // being a number. + int lastdot = hoststr.lastIndexOf('.'); + if (lastdot != -1 && (hoststr.length() > 1)) { + boolean ipv4 = true; + + for (int i = lastdot + 1, len = hoststr.length(); i < len; i++) { + char c = hoststr.charAt(i); + if (c < '0' || c > '9') { + ipv4 = false; + break; + } + } + this.ipv4 = this.literal = ipv4; + if (ipv4) { + byte[] ip = IPAddressUtil.textToNumericFormatV4(hoststr); + if (ip == null) { + throw new IllegalArgumentException("illegal IPv4 address"); + } + StringBuilder sb = new StringBuilder(); + Formatter formatter = new Formatter(sb, Locale.US); + formatter.format("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); + hoststr = sb.toString(); + } else { + // regular domain name + hoststr = hoststr.toLowerCase(); + } + } + } + hostname = hoststr; + } + + try { + portrange = parsePort(portstr); + } catch (Exception e) { + throw new IllegalArgumentException("invalid port range: " + portstr); + } + } + + public boolean literal() { + return literal; + } + + public boolean ipv4Literal() { + return ipv4; + } + + public boolean ipv6Literal() { + return ipv6; + } + + public String hostname() { + return hostname; + } + + public int[] portrange() { + return portrange; + } + + /** + * returns true if the hostname part started with * + * hostname returns the remaining part of the host component + * eg "*.foo.com" -> ".foo.com" or "*" -> "" + * + * @return + */ + public boolean wildcard() { + return wildcard; + } + + // these shouldn't leak outside the implementation + final static int[] HTTP_PORT = {80, 80}; + final static int[] HTTPS_PORT = {443, 443}; + final static int[] NO_PORT = {-1, -1}; + + int[] defaultPort() { + if (scheme.equals("http")) { + return HTTP_PORT; + } else if (scheme.equals("https")) { + return HTTPS_PORT; + } + return NO_PORT; + } + + int[] parsePort(String port) + { + + if (port == null || port.equals("")) { + return defaultPort(); + } + + if (port.equals("*")) { + return new int[] {PORT_MIN, PORT_MAX}; + } + + try { + int dash = port.indexOf('-'); + + if (dash == -1) { + int p = Integer.parseInt(port); + return new int[] {p, p}; + } else { + String low = port.substring(0, dash); + String high = port.substring(dash+1); + int l,h; + + if (low.equals("")) { + l = PORT_MIN; + } else { + l = Integer.parseInt(low); + } + + if (high.equals("")) { + h = PORT_MAX; + } else { + h = Integer.parseInt(high); + } + if (l < 0 || h < 0 || h
  • a "connect" {@link SocketPermission} to the host/port combination of the * destination URL or
  • - *
  • a {@link HttpURLPermission} that permits this request.
  • + *
  • a {@link URLPermission} that permits this request.
  • *

    * If automatic redirection is enabled, and this request is redirected to another * destination, then the caller must also have permission to connect to the diff --git a/jdk/src/share/classes/java/net/Inet6Address.java b/jdk/src/share/classes/java/net/Inet6Address.java index 7b10db96c08..068a4ce235d 100644 --- a/jdk/src/share/classes/java/net/Inet6Address.java +++ b/jdk/src/share/classes/java/net/Inet6Address.java @@ -28,7 +28,10 @@ package java.net; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.ObjectStreamField; import java.util.Enumeration; +import java.util.Arrays; /** * This class represents an Internet Protocol version 6 (IPv6) address. @@ -177,37 +180,192 @@ class Inet6Address extends InetAddress { */ private transient int cached_scope_id; // 0 - /** - * Holds a 128-bit (16 bytes) IPv6 address. - * - * @serial - */ - byte[] ipaddress; + private class Inet6AddressHolder { - /** - * scope_id. The scope specified when the object is created. If the object - * is created with an interface name, then the scope_id is not determined - * until the time it is needed. - */ - private int scope_id; // 0 + private Inet6AddressHolder() { + ipaddress = new byte[INADDRSZ]; + } - /** - * This will be set to true when the scope_id field contains a valid - * integer scope_id. - */ - private boolean scope_id_set; // false + private Inet6AddressHolder( + byte[] ipaddress, int scope_id, boolean scope_id_set, + NetworkInterface ifname, boolean scope_ifname_set) + { + this.ipaddress = ipaddress; + this.scope_id = scope_id; + this.scope_id_set = scope_id_set; + this.scope_ifname_set = scope_ifname_set; + this.scope_ifname = ifname; + } - /** - * scoped interface. scope_id is derived from this as the scope_id of the first - * address whose scope is the same as this address for the named interface. - */ - private transient NetworkInterface scope_ifname; // null + /** + * Holds a 128-bit (16 bytes) IPv6 address. + */ + byte[] ipaddress; - /** - * set if the object is constructed with a scoped - * interface instead of a numeric scope id. - */ - private boolean scope_ifname_set; // false; + /** + * scope_id. The scope specified when the object is created. If the object + * is created with an interface name, then the scope_id is not determined + * until the time it is needed. + */ + int scope_id; // 0 + + /** + * This will be set to true when the scope_id field contains a valid + * integer scope_id. + */ + boolean scope_id_set; // false + + /** + * scoped interface. scope_id is derived from this as the scope_id of the first + * address whose scope is the same as this address for the named interface. + */ + NetworkInterface scope_ifname; // null + + /** + * set if the object is constructed with a scoped + * interface instead of a numeric scope id. + */ + boolean scope_ifname_set; // false; + + void setAddr(byte addr[]) { + if (addr.length == INADDRSZ) { // normal IPv6 address + System.arraycopy(addr, 0, ipaddress, 0, INADDRSZ); + } + } + + void init(byte addr[], int scope_id) { + setAddr(addr); + + if (scope_id >= 0) { + this.scope_id = scope_id; + this.scope_id_set = true; + } + } + + void init(byte addr[], NetworkInterface nif) + throws UnknownHostException + { + setAddr(addr); + + if (nif != null) { + this.scope_id = deriveNumericScope(ipaddress, nif); + this.scope_id_set = true; + this.scope_ifname = nif; + this.scope_ifname_set = true; + } + } + + String getHostAddress() { + String s = numericToTextFormat(ipaddress); + if (scope_ifname != null) { /* must check this first */ + s = s + "%" + scope_ifname.getName(); + } else if (scope_id_set) { + s = s + "%" + scope_id; + } + return s; + } + + public boolean equals(Object o) { + if (! (o instanceof Inet6AddressHolder)) { + return false; + } + Inet6AddressHolder that = (Inet6AddressHolder)o; + + return Arrays.equals(this.ipaddress, that.ipaddress); + } + + public int hashCode() { + if (ipaddress != null) { + + int hash = 0; + int i=0; + while (i= 0, or -1 to indicate not being set */ Inet6Address(String hostName, byte addr[], int scope_id) { - holder().hostName = hostName; - if (addr.length == INADDRSZ) { // normal IPv6 address - holder().family = IPv6; - ipaddress = addr.clone(); - } - if (scope_id >= 0) { - this.scope_id = scope_id; - scope_id_set = true; - } + holder.init(hostName, IPv6); + holder6 = new Inet6AddressHolder(); + holder6.init(addr, scope_id); } Inet6Address(String hostName, byte addr[]) { + holder6 = new Inet6AddressHolder(); try { initif (hostName, addr, null); } catch (UnknownHostException e) {} /* cant happen if ifname is null */ @@ -245,12 +397,14 @@ class Inet6Address extends InetAddress { Inet6Address (String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException { + holder6 = new Inet6AddressHolder(); initif (hostName, addr, nif); } Inet6Address (String hostName, byte addr[], String ifname) throws UnknownHostException { + holder6 = new Inet6AddressHolder(); initstr (hostName, addr, ifname); } @@ -341,17 +495,13 @@ class Inet6Address extends InetAddress { private void initif(String hostName, byte addr[], NetworkInterface nif) throws UnknownHostException { - holder().hostName = hostName; + int family = -1; + holder6.init(addr, nif); + if (addr.length == INADDRSZ) { // normal IPv6 address - holder().family = IPv6; - ipaddress = addr.clone(); - } - if (nif != null) { - scope_ifname = nif; - scope_id = deriveNumericScope(nif); - scope_id_set = true; - scope_ifname_set = true; // for consistency + family = IPv6; } + holder.init(hostName, family); } /* check the two Ipv6 addresses and return false if they are both @@ -359,17 +509,22 @@ class Inet6Address extends InetAddress { * (ie. one is sitelocal and the other linklocal) * return true otherwise. */ - private boolean differentLocalAddressTypes(Inet6Address other) { - if (isLinkLocalAddress() && !other.isLinkLocalAddress()) + + private static boolean isDifferentLocalAddressType( + byte[] thisAddr, byte[] otherAddr) { + + if (Inet6Address.isLinkLocalAddress(thisAddr) && + !Inet6Address.isLinkLocalAddress(otherAddr)) { return false; - if (isSiteLocalAddress() && !other.isSiteLocalAddress()) + } + if (Inet6Address.isSiteLocalAddress(thisAddr) && + !Inet6Address.isSiteLocalAddress(otherAddr)) { return false; + } return true; } - private int deriveNumericScope(NetworkInterface ifc) - throws UnknownHostException - { + private static int deriveNumericScope (byte[] thisAddr, NetworkInterface ifc) throws UnknownHostException { Enumeration addresses = ifc.getInetAddresses(); while (addresses.hasMoreElements()) { InetAddress addr = addresses.nextElement(); @@ -378,46 +533,60 @@ class Inet6Address extends InetAddress { } Inet6Address ia6_addr = (Inet6Address)addr; /* check if site or link local prefixes match */ - if (!differentLocalAddressTypes(ia6_addr)){ + if (!isDifferentLocalAddressType(thisAddr, ia6_addr.getAddress())){ /* type not the same, so carry on searching */ continue; } /* found a matching address - return its scope_id */ - return ia6_addr.scope_id; + return ia6_addr.getScopeId(); } throw new UnknownHostException ("no scope_id found"); } - private int deriveNumericScope(String ifname) throws UnknownHostException { + private int deriveNumericScope (String ifname) throws UnknownHostException { Enumeration en; try { en = NetworkInterface.getNetworkInterfaces(); } catch (SocketException e) { - throw new UnknownHostException( - "could not enumerate local network interfaces"); + throw new UnknownHostException ("could not enumerate local network interfaces"); } while (en.hasMoreElements()) { NetworkInterface ifc = en.nextElement(); - if (ifc.getName().equals(ifname)) { - Enumeration addresses = ifc.getInetAddresses(); - while (addresses.hasMoreElements()) { - InetAddress addr = addresses.nextElement(); - if (!(addr instanceof Inet6Address)) { - continue; - } - Inet6Address ia6_addr = (Inet6Address)addr; - /* check if site or link local prefixes match */ - if (!differentLocalAddressTypes(ia6_addr)){ - /* type not the same, so carry on searching */ - continue; - } - /* found a matching address - return its scope_id */ - return ia6_addr.scope_id; - } + if (ifc.getName().equals (ifname)) { + return deriveNumericScope(holder6.ipaddress, ifc); } } - throw new UnknownHostException( - "No matching address found for interface : " +ifname); + throw new UnknownHostException ("No matching address found for interface : " +ifname); + } + + /** + * @serialField ipaddress byte[] + * @serialField scope_id int + * @serialField scope_id_set boolean + * @serialField scope_ifname_set boolean + * @serialField ifname String + */ + + private static final ObjectStreamField[] serialPersistentFields = { + new ObjectStreamField("ipaddress", byte[].class), + new ObjectStreamField("scope_id", int.class), + new ObjectStreamField("scope_id_set", boolean.class), + new ObjectStreamField("scope_ifname_set", boolean.class), + new ObjectStreamField("ifname", String.class) + }; + + private static final long FIELDS_OFFSET; + private static final sun.misc.Unsafe UNSAFE; + + static { + try { + sun.misc.Unsafe unsafe = sun.misc.Unsafe.getUnsafe(); + FIELDS_OFFSET = unsafe.objectFieldOffset( + Inet6Address.class.getDeclaredField("holder6")); + UNSAFE = unsafe; + } catch (ReflectiveOperationException e) { + throw new Error(e); + } } /** @@ -427,35 +596,41 @@ class Inet6Address extends InetAddress { */ private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { + NetworkInterface scope_ifname = null; if (getClass().getClassLoader() != null) { throw new SecurityException ("invalid address type"); } - s.defaultReadObject(); + ObjectInputStream.GetField gf = s.readFields(); + byte[] ipaddress = (byte[])gf.get("ipaddress", null); + int scope_id = (int)gf.get("scope_id", -1); + boolean scope_id_set = (boolean)gf.get("scope_id_set", false); + boolean scope_ifname_set = (boolean)gf.get("scope_ifname_set", false); + String ifname = (String)gf.get("ifname", null); - if (ifname != null && !ifname.equals("")) { + if (ifname != null && !"".equals (ifname)) { try { scope_ifname = NetworkInterface.getByName(ifname); - if (scope_ifname != null) { - scope_ifname_set = true; - try { - scope_id = deriveNumericScope(scope_ifname); - } catch (UnknownHostException e) { - // typically should not happen, but it may be that - // the machine being used for deserialization has - // the same interface name but without IPv6 configured. - } - } else { + if (scope_ifname == null) { /* the interface does not exist on this system, so we clear * the scope information completely */ scope_id_set = false; scope_ifname_set = false; scope_id = 0; + } else { + scope_ifname_set = true; + try { + scope_id = deriveNumericScope (ipaddress, scope_ifname); + } catch (UnknownHostException e) { + // typically should not happen, but it may be that + // the machine being used for deserialization has + // the same interface name but without IPv6 configured. + } } } catch (SocketException e) {} - } + /* if ifname was not supplied, then the numeric info is used */ ipaddress = ipaddress.clone(); @@ -466,9 +641,38 @@ class Inet6Address extends InetAddress { ipaddress.length); } - if (holder().getFamily() != IPv6) { + if (holder.getFamily() != IPv6) { throw new InvalidObjectException("invalid address family type"); } + + Inet6AddressHolder h = new Inet6AddressHolder( + ipaddress, scope_id, scope_id_set, scope_ifname, scope_ifname_set + ); + + UNSAFE.putObject(this, FIELDS_OFFSET, h); + } + + /** + * default behavior is overridden in order to write the + * scope_ifname field as a String, rather than a NetworkInterface + * which is not serializable + */ + private synchronized void writeObject(ObjectOutputStream s) + throws IOException + { + String ifname = null; + + if (holder6.scope_ifname != null) { + ifname = holder6.scope_ifname.getName(); + holder6.scope_ifname_set = true; + } + ObjectOutputStream.PutField pfields = s.putFields(); + pfields.put("ipaddress", holder6.ipaddress); + pfields.put("scope_id", holder6.scope_id); + pfields.put("scope_id_set", holder6.scope_id_set); + pfields.put("scope_ifname_set", holder6.scope_ifname_set); + pfields.put("ifname", ifname); + s.writeFields(); } /** @@ -483,7 +687,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMulticastAddress() { - return ((ipaddress[0] & 0xff) == 0xff); + return holder6.isMulticastAddress(); } /** @@ -496,11 +700,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isAnyLocalAddress() { - byte test = 0x00; - for (int i = 0; i < INADDRSZ; i++) { - test |= ipaddress[i]; - } - return (test == 0x00); + return holder6.isAnyLocalAddress(); } /** @@ -513,11 +713,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isLoopbackAddress() { - byte test = 0x00; - for (int i = 0; i < 15; i++) { - test |= ipaddress[i]; - } - return (test == 0x00) && (ipaddress[15] == 0x01); + return holder6.isLoopbackAddress(); } /** @@ -530,6 +726,11 @@ class Inet6Address extends InetAddress { */ @Override public boolean isLinkLocalAddress() { + return holder6.isLinkLocalAddress(); + } + + /* static version of above */ + static boolean isLinkLocalAddress(byte[] ipaddress) { return ((ipaddress[0] & 0xff) == 0xfe && (ipaddress[1] & 0xc0) == 0x80); } @@ -544,6 +745,11 @@ class Inet6Address extends InetAddress { */ @Override public boolean isSiteLocalAddress() { + return holder6.isSiteLocalAddress(); + } + + /* static version of above */ + static boolean isSiteLocalAddress(byte[] ipaddress) { return ((ipaddress[0] & 0xff) == 0xfe && (ipaddress[1] & 0xc0) == 0xc0); } @@ -559,8 +765,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCGlobal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x0e); + return holder6.isMCGlobal(); } /** @@ -574,8 +779,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCNodeLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x01); + return holder6.isMCNodeLocal(); } /** @@ -589,8 +793,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCLinkLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x02); + return holder6.isMCLinkLocal(); } /** @@ -604,8 +807,7 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCSiteLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x05); + return holder6.isMCSiteLocal(); } /** @@ -619,10 +821,8 @@ class Inet6Address extends InetAddress { */ @Override public boolean isMCOrgLocal() { - return ((ipaddress[0] & 0xff) == 0xff - && (ipaddress[1] & 0x0f) == 0x08); + return holder6.isMCOrgLocal(); } - /** * Returns the raw IP address of this {@code InetAddress} object. The result * is in network byte order: the highest order byte of the address is in @@ -632,7 +832,7 @@ class Inet6Address extends InetAddress { */ @Override public byte[] getAddress() { - return ipaddress.clone(); + return holder6.ipaddress.clone(); } /** @@ -644,7 +844,7 @@ class Inet6Address extends InetAddress { * @since 1.5 */ public int getScopeId() { - return scope_id; + return holder6.scope_id; } /** @@ -655,7 +855,7 @@ class Inet6Address extends InetAddress { * @since 1.5 */ public NetworkInterface getScopedInterface() { - return scope_ifname; + return holder6.scope_ifname; } /** @@ -669,13 +869,7 @@ class Inet6Address extends InetAddress { */ @Override public String getHostAddress() { - String s = numericToTextFormat(ipaddress); - if (scope_ifname != null) { /* must check this first */ - s = s + "%" + scope_ifname.getName(); - } else if (scope_id_set) { - s = s + "%" + scope_id; - } - return s; + return holder6.getHostAddress(); } /** @@ -685,25 +879,7 @@ class Inet6Address extends InetAddress { */ @Override public int hashCode() { - if (ipaddress != null) { - - int hash = 0; - int i=0; - while (iname of the permission is the url string. * The actions string is a concatenation of the request methods and headers. * The range of method and header names is not restricted by this class. *

    The url

    - * The url string is also used to instantiate a {@link URI} object which is - * used for comparison with other HttpURLPermission instances. Therefore, any - * references in this specification to url, mean this URI object. - * The path component of the url comprises a sequence of path segments, separated - * by '/' characters. The path is specified in a similar way to the path - * in {@link java.io.FilePermission}. There are three different ways - * as the following examples show: + * The url string has the following expected structure. + *

    + *     scheme : // authority [ / path ]
    + * 
    + * scheme will typically be http or https, but is not restricted by this + * class. + * authority is specified as:

    + *

    + *     authority = hostrange [ : portrange ]
    + *     portrange = portnumber | -portnumber | portnumber-[portnumber] | *
    + *     hostrange = ([*.] dnsname) | IPv4address | IPv6address
    + * 
    + * dnsname is a standard DNS host or domain name, ie. one or more labels + * separated by ".". IPv4address is a standard literal IPv4 address and + * IPv6address is as defined in + * RFC 2732. Literal IPv6 addresses must however, be enclosed in '[]' characters. + * The dnsname specification can be preceded by "*." which means + * the name will match any hostname whose right-most domain labels are the same as + * this name. For example, "*.oracle.com" matches "foo.bar.oracle.com" + *

    + * portrange is used to specify a port number, or a bounded or unbounded range of ports + * that this permission applies to. If portrange is absent or invalid, then a default + * port number is assumed if the scheme is {@code http} (default 80) or {@code https} + * (default 443). No default is assumed for other schemes. A wildcard may be specified + * which means all ports. + *

    + * The path component comprises a sequence of path segments, + * separated by '/' characters. path may also be empty. The path is specified + * in a similar way to the path in {@link java.io.FilePermission}. There are + * three different ways as the following examples show: * * * @@ -68,13 +91,19 @@ import java.security.Permission; *

    * The '*' and '-' may only be specified in the final segment of a path and must be * the only character in that segment. Any query or fragment components of the - * url are ignored when constructing HttpURLPermissions. + * url are ignored when constructing URLPermissions. *

    - * As a special case, urls of the form, "http:*" or "https:*" are accepted to + * As a special case, urls of the form, "scheme:*" are accepted to * mean any url of the given scheme. + *

    + * The scheme and authority components of the url string are handled + * without regard to case. This means {@link #equals(Object)}, + * {@link #hashCode()} and {@link #implies(Permission)} are case insensitive with respect + * to these components. If the authority contains a literal IP address, + * then the address is normalized for comparison. The path component is case sensitive. *

    The actions string

    - * The actions string of a HttpURLPermission is a concatenation of the method list - * and the request headers list. These are lists of the permitted HTTP request + * The actions string of a URLPermission is a concatenation of the method list + * and the request headers list. These are lists of the permitted request * methods and permitted request headers of the permission (respectively). The two lists * are separated by a colon ':' character and elements of each list are comma separated. * Some examples are: @@ -89,7 +118,7 @@ import java.security.Permission; *

    * The colon separator need not be present if the request headers list is empty. * No white-space is permitted in the actions string. The action strings supplied to - * the HttpURLPermission constructors are case-insensitive and are normalized by converting + * the URLPermission constructors are case-insensitive and are normalized by converting * method names to upper-case and header names to the form defines in RFC2616 (lower case * with initial letter of each word capitalized). Either list can contain a wild-card '*' * character which signifies all request methods or headers respectively. @@ -102,38 +131,40 @@ import java.security.Permission; * * @since 1.8 */ -public final class HttpURLPermission extends Permission { +public final class URLPermission extends Permission { private static final long serialVersionUID = -2702463814894478682L; - private transient URI uri; + private transient String scheme; + private transient String ssp; // scheme specific part + private transient String path; private transient List methods; private transient List requestHeaders; + private transient Authority authority; // serialized field private String actions; /** - * Creates a new HttpURLPermission from a url string and which permits the given + * Creates a new URLPermission from a url string and which permits the given * request methods and user-settable request headers. - * The name of the permission is its url string. Only the scheme, authority - * and path components of the url are used. Any fragment or query + * The name of the permission is the url string it was created with. Only the scheme, + * authority and path components of the url are used internally. Any fragment or query * components are ignored. The permissions action string is as specified above. * * @param url the url string * * @param actions the actions string * - * @throws IllegalArgumentException if url does not result in a valid {@link URI}, - * its scheme is not http or https, or if actions contains white-space. + * @exception IllegalArgumentException if url is invalid or if actions contains white-space. */ - public HttpURLPermission(String url, String actions) { + public URLPermission(String url, String actions) { super(url); init(actions); } private void init(String actions) { - URI uri = parseURI(getName()); + parseURI(getName()); int colon = actions.indexOf(':'); if (actions.lastIndexOf(':') != colon) { throw new IllegalArgumentException("invalid actions string"); @@ -157,19 +188,18 @@ public final class HttpURLPermission extends Permission { this.requestHeaders = Collections.unmodifiableList(l); this.actions = actions(); - this.uri = uri; } /** - * Creates a HttpURLPermission with the given url string and unrestricted + * Creates a URLPermission with the given url string and unrestricted * methods and request headers by invoking the two argument - * constructor as follows: HttpURLPermission(url, "*:*") + * constructor as follows: URLPermission(url, "*:*") * * @param url the url string * * @throws IllegalArgumentException if url does not result in a valid {@link URI} */ - public HttpURLPermission(String url) { + public URLPermission(String url) { this(url, "*:*"); } @@ -190,20 +220,23 @@ public final class HttpURLPermission extends Permission { } /** - * Checks if this HttpURLPermission implies the given permission. + * Checks if this URLPermission implies the given permission. * Specifically, the following checks are done as if in the * following sequence: *

      - *
    • if 'p' is not an instance of HttpURLPermission return false
    • + *
    • if 'p' is not an instance of URLPermission return false
    • *
    • if any of p's methods are not in this's method list, and if * this's method list is not equal to "*", then return false.
    • *
    • if any of p's headers are not in this's request header list, and if * this's request header list is not equal to "*", then return false.
    • - *
    • if this's url is equal to p's url , then return true
    • *
    • if this's url scheme is not equal to p's url scheme return false
    • *
    • if the scheme specific part of this's url is '*' return true
    • - *
    • if this's url authority is not equal to p's url authority - * return false
    • + *
    • if the set of hosts defined by p's url hostrange is not a subset of + * this's url hostrange then return false. For example, "*.foo.oracle.com" + * is a subset of "*.oracle.com". "foo.bar.oracle.com" is not + * a subset of "*.foo.oracle.com"
    • + *
    • if the portrange defined by p's url is not a subset of the + * portrange defined by this's url then return false. *
    • if the path or paths specified by p's url are contained in the * set of paths specified by this's url, then return true *
    • otherwise, return false
    • @@ -222,11 +255,11 @@ public final class HttpURLPermission extends Permission { *
    URL Examples
    Example urlDescription
    */ public boolean implies(Permission p) { - if (! (p instanceof HttpURLPermission)) { + if (! (p instanceof URLPermission)) { return false; } - HttpURLPermission that = (HttpURLPermission)p; + URLPermission that = (URLPermission)p; if (!this.methods.get(0).equals("*") && Collections.indexOfSubList(this.methods, that.methods) == -1) { @@ -244,39 +277,36 @@ public final class HttpURLPermission extends Permission { return false; } - if (this.uri.equals(that.uri)) { - return true; - } - - if (!this.uri.getScheme().equals(that.uri.getScheme())) { + if (!this.scheme.equals(that.scheme)) { return false; } - if (this.uri.getSchemeSpecificPart().equals("*")) { + if (this.ssp.equals("*")) { return true; } - String thisAuthority = this.uri.getAuthority(); - - if (thisAuthority != null && - !thisAuthority.equals(that.uri.getAuthority())) { + if (!this.authority.implies(that.authority)) { return false; } - String thispath = this.uri.getPath(); - String thatpath = that.uri.getPath(); + if (this.path == null) { + return that.path == null; + } + if (that.path == null) { + return false; + } - if (thispath.endsWith("/-")) { - String thisprefix = thispath.substring(0, thispath.length() - 1); - return thatpath.startsWith(thisprefix); + if (this.path.endsWith("/-")) { + String thisprefix = this.path.substring(0, this.path.length() - 1); + return that.path.startsWith(thisprefix); } - if (thispath.endsWith("/*")) { - String thisprefix = thispath.substring(0, thispath.length() - 1); - if (!thatpath.startsWith(thisprefix)) { + if (this.path.endsWith("/*")) { + String thisprefix = this.path.substring(0, this.path.length() - 1); + if (!that.path.startsWith(thisprefix)) { return false; } - String thatsuffix = thatpath.substring(thisprefix.length()); + String thatsuffix = that.path.substring(thisprefix.length()); // suffix must not contain '/' chars if (thatsuffix.indexOf('/') != -1) { return false; @@ -286,7 +316,7 @@ public final class HttpURLPermission extends Permission { } return true; } - return false; + return this.path.equals(that.path); } @@ -295,20 +325,35 @@ public final class HttpURLPermission extends Permission { * and p's url equals this's url. Returns false otherwise. */ public boolean equals(Object p) { - if (!(p instanceof HttpURLPermission)) { + if (!(p instanceof URLPermission)) { return false; } - HttpURLPermission that = (HttpURLPermission)p; - return this.getActions().equals(that.getActions()) && - this.uri.equals(that.uri); + URLPermission that = (URLPermission)p; + if (!this.scheme.equals(that.scheme)) { + return false; + } + if (!this.getActions().equals(that.getActions())) { + return false; + } + if (!this.authority.equals(that.authority)) { + return false; + } + if (this.path != null) { + return this.path.equals(that.path); + } else { + return that.path == null; + } } /** * Returns a hashcode calculated from the hashcode of the - * actions String and the url + * actions String and the url string. */ public int hashCode() { - return getActions().hashCode() + uri.hashCode(); + return getActions().hashCode() + + scheme.hashCode() + + authority.hashCode() + + path == null ? 0 : path.hashCode(); } @@ -371,17 +416,31 @@ public final class HttpURLPermission extends Permission { return l; } - private URI parseURI(String url) { - URI u = URI.create(url); - String scheme = u.getScheme(); - if (!(scheme.equalsIgnoreCase("http") || - scheme.equalsIgnoreCase("https"))) { - throw new IllegalArgumentException ("unexpected URL scheme"); + private void parseURI(String url) { + int len = url.length(); + int delim = url.indexOf(':'); + if (delim == -1 || delim + 1 == len) { + throw new IllegalArgumentException("invalid URL string"); } - if (!u.getSchemeSpecificPart().equals("*")) { - u = URI.create(scheme + "://" + u.getRawAuthority() + u.getRawPath()); + scheme = url.substring(0, delim).toLowerCase(); + this.ssp = url.substring(delim + 1); + + if (!ssp.startsWith("//")) { + this.authority = new Authority(scheme, ssp.toLowerCase()); + return; } - return u; + String authpath = ssp.substring(2); + + delim = authpath.indexOf('/'); + String auth; + if (delim == -1) { + this.path = ""; + auth = authpath; + } else { + auth = authpath.substring(0, delim); + this.path = authpath.substring(delim); + } + this.authority = new Authority(scheme, auth.toLowerCase()); } private String actions() { @@ -395,6 +454,7 @@ public final class HttpURLPermission extends Permission { } return b.toString(); } + /** * restore the state of this object from stream */ @@ -405,4 +465,59 @@ public final class HttpURLPermission extends Permission { init(actions); } + + static class Authority { + HostPortrange p; + + Authority(String scheme, String authority) { + p = new HostPortrange(scheme, authority); + } + + boolean implies(Authority other) { + return impliesHostrange(other) && impliesPortrange(other); + } + + private boolean impliesHostrange(Authority that) { + String thishost = this.p.hostname(); + String thathost = that.p.hostname(); + + if (p.wildcard() && thishost.equals("")) { + // this "*" implies all others + return true; + } + if (that.p.wildcard() && thathost.equals("")) { + // that "*" can only be implied by this "*" + return false; + } + if (thishost.equals(thathost)) { + // covers all cases of literal IP addresses and fixed + // domain names. + return true; + } + if (this.p.wildcard()) { + // this "*.foo.com" implies "bub.bar.foo.com" + return thathost.endsWith(thishost); + } + return false; + } + + private boolean impliesPortrange(Authority that) { + int[] thisrange = this.p.portrange(); + int[] thatrange = that.p.portrange(); + if (thisrange[0] == -1) { + /* port not specified non http/s URL */ + return true; + } + return thisrange[0] <= thatrange[0] && + thisrange[1] >= thatrange[1]; + } + + boolean equals(Authority that) { + return this.p.equals(that.p); + } + + public int hashCode() { + return p.hashCode(); + } + } } diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java index 01629442af4..920ac93d097 100644 --- a/jdk/src/share/classes/java/nio/file/Files.java +++ b/jdk/src/share/classes/java/nio/file/Files.java @@ -43,9 +43,10 @@ import java.nio.channels.SeekableByteChannel; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.nio.charset.CharsetEncoder; +import java.nio.charset.StandardCharsets; import java.nio.file.attribute.BasicFileAttributeView; import java.nio.file.attribute.BasicFileAttributes; -import java.nio.file.attribute.DosFileAttributes; +import java.nio.file.attribute.DosFileAttributes; // javadoc import java.nio.file.attribute.FileAttribute; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.FileOwnerAttributeView; @@ -104,8 +105,7 @@ public final class Files { return () -> { try { c.close(); - } - catch (IOException e) { + } catch (IOException e) { throw new UncheckedIOException(e); } }; @@ -2550,7 +2550,7 @@ public final class Files { * checkExec} is invoked to check execute access to the file. */ public static boolean isExecutable(Path path) { - return isAccessible(path, AccessMode.EXECUTE); + return isAccessible(path, AccessMode.EXECUTE); } // -- Recursive operations -- @@ -2782,6 +2782,37 @@ public final class Files { return new BufferedReader(reader); } + /** + * Opens a file for reading, returning a {@code BufferedReader} to read text + * from the file in an efficient manner. Bytes from the file are decoded into + * characters using the {@link StandardCharsets#UTF_8 UTF-8} {@link Charset + * charset}. + * + *

    This method works as if invoking it were equivalent to evaluating the + * expression: + *

    {@code
    +     * Files.newBufferedReader(path, StandardCharsets.UTF_8)
    +     * }
    + * + * @param path + * the path to the file + * + * @return a new buffered reader, with default buffer size, to read text + * from the file + * + * @throws IOException + * if an I/O error occurs opening the file + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @since 1.8 + */ + public static BufferedReader newBufferedReader(Path path) throws IOException { + return newBufferedReader(path, StandardCharsets.UTF_8); + } + /** * Opens or creates a file for writing, returning a {@code BufferedWriter} * that may be used to write text to the file in an efficient manner. @@ -2827,6 +2858,41 @@ public final class Files { return new BufferedWriter(writer); } + /** + * Opens or creates a file for writing, returning a {@code BufferedWriter} + * to write text to the file in an efficient manner. The text is encoded + * into bytes for writing using the {@link StandardCharsets#UTF_8 UTF-8} + * {@link Charset charset}. + * + *

    This method works as if invoking it were equivalent to evaluating the + * expression: + *

    {@code
    +     * Files.newBufferedWriter(path, StandardCharsets.UTF_8, options)
    +     * }
    + * + * @param path + * the path to the file + * @param options + * options specifying how the file is opened + * + * @return a new buffered writer, with default buffer size, to write text + * to the file + * + * @throws IOException + * if an I/O error occurs opening or creating the file + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + * + * @since 1.8 + */ + public static BufferedWriter newBufferedWriter(Path path, OpenOption... options) throws IOException { + return newBufferedWriter(path, StandardCharsets.UTF_8, options); + } + /** * Reads all bytes from an input stream and writes them to an output stream. */ @@ -3025,9 +3091,7 @@ public final class Files { * @throws OutOfMemoryError * if an array of the required size cannot be allocated */ - private static byte[] read(InputStream source, int initialSize) - throws IOException - { + private static byte[] read(InputStream source, int initialSize) throws IOException { int capacity = initialSize; byte[] buf = new byte[capacity]; int nread = 0; @@ -3131,9 +3195,7 @@ public final class Files { * * @see #newBufferedReader */ - public static List readAllLines(Path path, Charset cs) - throws IOException - { + public static List readAllLines(Path path, Charset cs) throws IOException { try (BufferedReader reader = newBufferedReader(path, cs)) { List result = new ArrayList<>(); for (;;) { @@ -3146,6 +3208,37 @@ public final class Files { } } + /** + * Read all lines from a file. Bytes from the file are decoded into characters + * using the {@link StandardCharsets#UTF_8 UTF-8} {@link Charset charset}. + * + *

    This method works as if invoking it were equivalent to evaluating the + * expression: + *

    {@code
    +     * Files.readAllLines(path, StandardCharsets.UTF_8)
    +     * }
    + * + * @param path + * the path to the file + * + * @return the lines from the file as a {@code List}; whether the {@code + * List} is modifiable or not is implementation dependent and + * therefore not specified + * + * @throws IOException + * if an I/O error occurs reading from the file or a malformed or + * unmappable byte sequence is read + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @since 1.8 + */ + public static List readAllLines(Path path) throws IOException { + return readAllLines(path, StandardCharsets.UTF_8); + } + /** * Writes bytes to a file. The {@code options} parameter specifies how the * the file is created or opened. If no options are present then this method @@ -3262,6 +3355,45 @@ public final class Files { return path; } + /** + * Write lines of text to a file. Characters are encoded into bytes using + * the {@link StandardCharsets#UTF_8 UTF-8} {@link Charset charset}. + * + *

    This method works as if invoking it were equivalent to evaluating the + * expression: + *

    {@code
    +     * Files.write(path, lines, StandardCharsets.UTF_8, options);
    +     * }
    + * + * @param path + * the path to the file + * @param lines + * an object to iterate over the char sequences + * @param options + * options specifying how the file is opened + * + * @return the path + * + * @throws IOException + * if an I/O error occurs writing to or creating the file, or the + * text cannot be encoded as {@code UTF-8} + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + * + * @since 1.8 + */ + public static Path write(Path path, + Iterable lines, + OpenOption... options) + throws IOException + { + return write(path, lines, StandardCharsets.UTF_8, options); + } + // -- Stream APIs -- /** @@ -3431,9 +3563,11 @@ public final class Files { * if an I/O error is thrown when accessing the starting file. * @since 1.8 */ - public static Stream walk(Path start, int maxDepth, + public static Stream walk(Path start, + int maxDepth, FileVisitOption... options) - throws IOException { + throws IOException + { FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options); try { return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false) @@ -3484,9 +3618,7 @@ public final class Files { * @see #walk(Path, int, FileVisitOption...) * @since 1.8 */ - public static Stream walk(Path start, - FileVisitOption... options) - throws IOException { + public static Stream walk(Path start, FileVisitOption... options) throws IOException { return walk(start, Integer.MAX_VALUE, options); } @@ -3547,7 +3679,8 @@ public final class Files { int maxDepth, BiPredicate matcher, FileVisitOption... options) - throws IOException { + throws IOException + { FileTreeIterator iterator = new FileTreeIterator(start, maxDepth, options); try { return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false) @@ -3561,7 +3694,7 @@ public final class Files { } /** - * Read all lines from a file as a {@code Stream}. Unlike {@link + * Read all lines from a file as a {@code Stream}. Unlike {@link * #readAllLines(Path, Charset) readAllLines}, this method does not read * all lines into a {@code List}, but instead populates lazily as the stream * is consumed. @@ -3619,4 +3752,33 @@ public final class Files { throw e; } } + + /** + * Read all lines from a file as a {@code Stream}. Bytes from the file are + * decoded into characters using the {@link StandardCharsets#UTF_8 UTF-8} + * {@link Charset charset}. + * + *

    This method works as if invoking it were equivalent to evaluating the + * expression: + *

    {@code
    +     * Files.lines(path, StandardCharsets.UTF_8)
    +     * }
    + * + * @param path + * the path to the file + * + * @return the lines from the file as a {@code Stream} + * + * @throws IOException + * if an I/O error occurs opening the file + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @since 1.8 + */ + public static Stream lines(Path path) throws IOException { + return lines(path, StandardCharsets.UTF_8); + } } diff --git a/jdk/src/share/classes/java/security/DomainLoadStoreParameter.java b/jdk/src/share/classes/java/security/DomainLoadStoreParameter.java new file mode 100644 index 00000000000..bc9697597e5 --- /dev/null +++ b/jdk/src/share/classes/java/security/DomainLoadStoreParameter.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2013, Oracle and/or its affiliates. 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. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.security; + +import java.net.URI; +import java.util.*; +import static java.security.KeyStore.*; + +/** + * Configuration data that specifies the keystores in a keystore domain. + * A keystore domain is a collection of keystores that are presented as a + * single logical keystore. The configuration data is used during + * {@code KeyStore} + * {@link KeyStore#load(KeyStore.LoadStoreParameter) load} and + * {@link KeyStore#store(KeyStore.LoadStoreParameter) store} operations. + *

    + * The following syntax is supported for configuration data: + *

    {@code
    + *     domain  [ ...] {
    + *         keystore  [ ...] ;
    + *         ...
    + *     };
    + *     ...
    + * }
    + * where {@code domainName} and {@code keystoreName} are identifiers + * and {@code property} is a key/value pairing. The key and value are + * separated by an 'equals' symbol and the value is enclosed in double + * quotes. A property value may be either a printable string or a binary + * string of colon-separated pairs of hexadecimal digits. Multi-valued + * properties are represented as a comma-separated list of values, + * enclosed in square brackets. + * See {@link Arrays#toString(java.lang.Object[])}. + *

    + * To ensure that keystore entries are uniquely identified, each + * entry's alias is prefixed by its {@code keystoreName} followed + * by the entry name separator and each {@code keystoreName} must be + * unique within its domain. Entry name prefixes are omitted when + * storing a keystore. + *

    + * Properties are context-sensitive: properties that apply to + * all the keystores in a domain are located in the domain clause, + * and properties that apply only to a specific keystore are located + * in that keystore's clause. + * Unless otherwise specified, a property in a keystore clause overrides + * a property of the same name in the domain clause. All property names + * are case-insensitive. The following properties are supported: + *

    + *
    {@code keystoreType=""}
    + *
    The keystore type.
    + *
    {@code keystoreURI=""}
    + *
    The keystore location.
    + *
    {@code keystoreProviderName=""}
    + *
    The name of the keystore's JCE provider.
    + *
    {@code keystorePasswordEnv=""}
    + *
    The environment variable that stores a keystore password. + * Alternatively, passwords may be supplied to the constructor + * method in a {@code Map}.
    + *
    {@code entryNameSeparator=""}
    + *
    The separator between a keystore name prefix and an entry name. + * When specified, it applies to all the entries in a domain. + * Its default value is a space.
    + *
    + *

    + * For example, configuration data for a simple keystore domain + * comprising three keystores is shown below: + *

    + *
    + * domain app1 {
    + *     keystore app1-truststore
    + *         keystoreURI="file:///app1/etc/truststore.jks";
    + *
    + *     keystore system-truststore
    + *         keystoreURI="${java.home}/lib/security/cacerts";
    + *
    + *     keystore app1-keystore
    + *         keystoreType="PKCS12"
    + *         keystoreURI="file:///app1/etc/keystore.p12";
    + * };
    + *
    + * 
    + * @since 1.8 + */ +public final class DomainLoadStoreParameter implements LoadStoreParameter { + + private final URI configuration; + private final Map protectionParams; + + /** + * Constructs a DomainLoadStoreParameter for a keystore domain with + * the parameters used to protect keystore data. + * + * @param configuration identifier for the domain configuration data. + * The name of the target domain should be specified in the + * {@code java.net.URI} fragment component when it is necessary + * to distinguish between several domain configurations at the + * same location. + * + * @param protectionParams the map from keystore name to the parameter + * used to protect keystore data. + * A {@code java.util.Collections.EMPTY_MAP} should be used + * when protection parameters are not required or when they have + * been specified by properties in the domain configuration data. + * It is cloned to prevent subsequent modification. + * + * @exception NullPointerException if {@code configuration} or + * {@code protectionParams} is {@code null} + */ + public DomainLoadStoreParameter(URI configuration, + Map protectionParams) { + if (configuration == null || protectionParams == null) { + throw new NullPointerException("invalid null input"); + } + this.configuration = configuration; + this.protectionParams = + Collections.unmodifiableMap(new HashMap<>(protectionParams)); + } + + /** + * Gets the identifier for the domain configuration data. + * + * @return the identifier for the configuration data + */ + public URI getConfiguration() { + return configuration; + } + + /** + * Gets the keystore protection parameters for keystores in this + * domain. + * + * @return an unmodifiable map of keystore names to protection + * parameters + */ + public Map getProtectionParams() { + return protectionParams; + } + + /** + * Gets the keystore protection parameters for this domain. + * Keystore domains do not support a protection parameter. + * + * @return always returns {@code null} + */ + @Override + public KeyStore.ProtectionParameter getProtectionParameter() { + return null; + } +} diff --git a/jdk/src/share/classes/java/security/KeyStore.java b/jdk/src/share/classes/java/security/KeyStore.java index 187683baa50..e769bb158e1 100644 --- a/jdk/src/share/classes/java/security/KeyStore.java +++ b/jdk/src/share/classes/java/security/KeyStore.java @@ -218,148 +218,6 @@ public class KeyStore { public ProtectionParameter getProtectionParameter(); } - /** - * Configuration data that specifies the keystores in a keystore domain. - * A keystore domain is a collection of keystores that are presented as a - * single logical keystore. The configuration data is used during - * {@code KeyStore} - * {@link #load(KeyStore.LoadStoreParameter) load} and - * {@link #store(KeyStore.LoadStoreParameter) store} operations. - *

    - * The following syntax is supported for configuration data: - *

    {@code
    -     *     domain  [ ...] {
    -     *         keystore  [ ...] ;
    -     *         ...
    -     *     };
    -     *     ...
    -     * }
    - * where {@code domainName} and {@code keystoreName} are identifiers - * and {@code property} is a key/value pairing. The key and value are - * separated by an 'equals' symbol and the value is enclosed in double - * quotes. A property value may be either a printable string or a binary - * string of colon-separated pairs of hexadecimal digits. Multi-valued - * properties are represented as a comma-separated list of values, - * enclosed in square brackets. - * See {@link Arrays#toString(java.lang.Object[])}. - *

    - * To ensure that keystore entries are uniquely identified, each - * entry's alias is prefixed by its {@code keystoreName} followed - * by the entry name separator and each {@code keystoreName} must be - * unique within its domain. Entry name prefixes are omitted when - * storing a keystore. - *

    - * Properties are context-sensitive: properties that apply to - * all the keystores in a domain are located in the domain clause, - * and properties that apply only to a specific keystore are located - * in that keystore's clause. - * Unless otherwise specified, a property in a keystore clause overrides - * a property of the same name in the domain clause. All property names - * are case-insensitive. The following properties are supported: - *

    - *
    {@code keystoreType=""}
    - *
    The keystore type.
    - *
    {@code keystoreURI=""}
    - *
    The keystore location.
    - *
    {@code keystoreProviderName=""}
    - *
    The name of the keystore's JCE provider.
    - *
    {@code keystorePasswordEnv=""}
    - *
    The environment variable that stores a keystore password. - * Alternatively, passwords may be supplied to the constructor - * method in a {@code Map}.
    - *
    {@code entryNameSeparator=""}
    - *
    The separator between a keystore name prefix and an entry name. - * When specified, it applies to all the entries in a domain. - * Its default value is a space.
    - *
    - *

    - * For example, configuration data for a simple keystore domain - * comprising three keystores is shown below: - *

    -     *
    -     * domain app1 {
    -     *     keystore app1-truststore
    -     *         keystoreURI="file:///app1/etc/truststore.jks"
    -     *
    -     *     keystore system-truststore
    -     *         keystoreURI="${java.home}/lib/security/cacerts"
    -     *
    -     *     keystore app1-keystore
    -     *         keystoreType="PKCS12"
    -     *         keystoreURI="file:///app1/etc/keystore.p12"
    -     * };
    -     *
    -     * 
    - * @since 1.8 - */ - public static final class DomainLoadStoreParameter - implements LoadStoreParameter { - - private final URI configuration; - private final Map protectionParams; - - /** - * Constructs a DomainLoadStoreParameter for a keystore domain with - * the parameters used to protect keystore data. - * - * @param configuration identifier for the domain configuration data. - * The name of the target domain should be specified in the - * {@code java.net.URI} fragment component when it is necessary - * to distinguish between several domain configurations at the - * same location. - * - * @param protectionParams the map from keystore name to the parameter - * used to protect keystore data. - * A {@code java.util.Collections.EMPTY_MAP} should be used - * when protection parameters are not required or when they have - * been specified by properties in the domain configuration data. - * It is cloned to prevent subsequent modification. - * - * @exception NullPointerException if {@code configuration} or - * {@code protectionParams} is {@code null} - */ - public DomainLoadStoreParameter(URI configuration, - Map protectionParams) { - if (configuration == null || protectionParams == null) { - throw new NullPointerException("invalid null input"); - } - this.configuration = configuration; - this.protectionParams = - Collections.unmodifiableMap(new HashMap<>(protectionParams)); - } - - /** - * Gets the identifier for the domain configuration data. - * - * @return the identifier for the configuration data - */ - public URI getConfiguration() { - return configuration; - } - - /** - * Gets the keystore protection parameters for keystores in this - * domain. - * - * @return an unmodifiable map of keystore names to protection - * parameters - */ - public Map getProtectionParams() { - return protectionParams; - } - - /** - * Gets the keystore protection parameters for this domain. - * Keystore domains do not support a protection parameter. - * - * @return always returns {@code null} - */ - @Override - public KeyStore.ProtectionParameter getProtectionParameter() { - return null; - } - } - /** * A marker interface for keystore protection parameters. * diff --git a/jdk/src/share/classes/java/sql/CallableStatement.java b/jdk/src/share/classes/java/sql/CallableStatement.java index dc98859bf8b..a41aa10fa1e 100644 --- a/jdk/src/share/classes/java/sql/CallableStatement.java +++ b/jdk/src/share/classes/java/sql/CallableStatement.java @@ -56,7 +56,7 @@ import java.io.InputStream; * For maximum portability, a call's ResultSet objects and * update counts should be processed prior to getting the values of output * parameters. - *

    + * * * @see Connection#prepareCall * @see ResultSet diff --git a/jdk/src/share/classes/java/sql/Connection.java b/jdk/src/share/classes/java/sql/Connection.java index 9b6706562ba..3077c3c278c 100644 --- a/jdk/src/share/classes/java/sql/Connection.java +++ b/jdk/src/share/classes/java/sql/Connection.java @@ -611,7 +611,7 @@ public interface Connection extends Wrapper, AutoCloseable { * Map object returned from * getTypeMap as a JDBC driver may create an internal * copy of the Map object passed to setTypeMap: - *

    + * *

          *      Map<String,Class<?>> myMap = con.getTypeMap();
          *      myMap.put("mySchemaName.ATHLETES", Athletes.class);
    @@ -636,7 +636,7 @@ public interface Connection  extends Wrapper, AutoCloseable {
          * You must set the the values for the TypeMap prior to
          * callng setMap as a JDBC driver may create an internal copy
          * of the TypeMap:
    -     * 

    + * *

          *      Map myMap<String,Class<?>> = new HashMap<String,Class<?>>();
          *      myMap.put("mySchemaName.ATHLETES", Athletes.class);
    @@ -1119,7 +1119,7 @@ public interface Connection  extends Wrapper, AutoCloseable {
              * @exception SQLException if the value supplied for timeout
              * is less then 0
              * @since 1.6
    -         * 

    + * * @see java.sql.DatabaseMetaData#getClientInfoProperties */ boolean isValid(int timeout) throws SQLException; @@ -1154,7 +1154,7 @@ public interface Connection extends Wrapper, AutoCloseable { * required to support these properties however if the driver supports a * client info property that can be described by one of the standard * properties, the standard property name should be used. - *

    + * *