This commit is contained in:
J. Duke 2017-07-05 20:09:15 +02:00
commit 9464c8981e
40 changed files with 929 additions and 714 deletions

View File

@ -283,3 +283,4 @@ c173ba994245380fb11ef077d1e59823386840eb jdk9-b35
d42c0a90afc3c66ca87543076ec9aafd4b4680de jdk9-b38 d42c0a90afc3c66ca87543076ec9aafd4b4680de jdk9-b38
512dbbeb1730edcebfec873fc3f1455660b32000 jdk9-b39 512dbbeb1730edcebfec873fc3f1455660b32000 jdk9-b39
cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40 cf136458ee747e151a27aa9ea0c1492ea55ef3e7 jdk9-b40
67395f7ca2db3b52e3a62a84888487de5cb9210a jdk9-b41

View File

@ -33,7 +33,7 @@ default:
# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make. # The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
# /usr/ccs/bin/make lacks basically every other flow control mechanism. # /usr/ccs/bin/make lacks basically every other flow control mechanism.
TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1 .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. # Assume we have GNU make, but check version.
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), ) ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
@ -46,7 +46,17 @@ ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
else else
makefile_path:=$(lastword $(MAKEFILE_LIST)) makefile_path:=$(lastword $(MAKEFILE_LIST))
endif endif
root_dir:=$(dir $(makefile_path)) root_dir:=$(patsubst %/,%,$(dir $(makefile_path)))
ifneq ($(findstring qp,$(MAKEFLAGS)),)
# When called with -qp, assume an external part (e.g. bash completion) is trying
# to understand our targets.
# Duplication of global targets, needed before ParseConfAndSpec in case we have
# no configurations.
help:
# If CONF is not set, look for all available configurations
CONF?=
endif
# ... and then we can include our helper functions # ... and then we can include our helper functions
include $(root_dir)/make/MakeHelpers.gmk include $(root_dir)/make/MakeHelpers.gmk
@ -89,6 +99,7 @@ else
# The wrapper target was called so we now have a single configuration. Load the spec file # The wrapper target was called so we now have a single configuration. Load the spec file
# and call the real Main.gmk. # and call the real Main.gmk.
include $(SPEC) include $(SPEC)
include $(SRC_ROOT)/make/common/MakeBase.gmk
### Clean up from previous run ### Clean up from previous run
# Remove any build.log from a previous run, if they exist # Remove any build.log from a previous run, if they exist

View File

@ -69,7 +69,7 @@ AC_DEFUN([BASIC_PREPEND_TO_PATH],
# This will make sure the given variable points to a full and proper # This will make sure the given variable points to a full and proper
# path. This means: # path. This means:
# 1) There will be no spaces in the path. On posix platforms, # 1) There will be no spaces in the path. On unix platforms,
# spaces in the path will result in an error. On Windows, # spaces in the path will result in an error. On Windows,
# the path will be rewritten using short-style to be space-free. # the path will be rewritten using short-style to be space-free.
# 2) The path will be absolute, and it will be in unix-style (on # 2) The path will be absolute, and it will be in unix-style (on
@ -82,7 +82,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
BASIC_FIXUP_PATH_MSYS($1) BASIC_FIXUP_PATH_MSYS($1)
else else
# We're on a posix platform. Hooray! :) # We're on a unix platform. Hooray! :)
path="[$]$1" path="[$]$1"
has_space=`$ECHO "$path" | $GREP " "` has_space=`$ECHO "$path" | $GREP " "`
if test "x$has_space" != x; then if test "x$has_space" != x; then
@ -102,7 +102,7 @@ AC_DEFUN([BASIC_FIXUP_PATH],
# This will make sure the given variable points to a executable # This will make sure the given variable points to a executable
# with a full and proper path. This means: # with a full and proper path. This means:
# 1) There will be no spaces in the path. On posix platforms, # 1) There will be no spaces in the path. On unix platforms,
# spaces in the path will result in an error. On Windows, # spaces in the path will result in an error. On Windows,
# the path will be rewritten using short-style to be space-free. # the path will be rewritten using short-style to be space-free.
# 2) The path will be absolute, and it will be in unix-style (on # 2) The path will be absolute, and it will be in unix-style (on
@ -118,7 +118,7 @@ AC_DEFUN([BASIC_FIXUP_EXECUTABLE],
elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then
BASIC_FIXUP_EXECUTABLE_MSYS($1) BASIC_FIXUP_EXECUTABLE_MSYS($1)
else else
# We're on a posix platform. Hooray! :) # We're on a unix platform. Hooray! :)
# First separate the path from the arguments. This will split at the first # First separate the path from the arguments. This will split at the first
# space. # space.
complete="[$]$1" complete="[$]$1"

View File

@ -56,4 +56,3 @@ JAR_CMD:=$(BOOT_JDK)/bin/jar
NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD) SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)

View File

@ -48,6 +48,7 @@ GREP="@GREP@"
JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@" JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage" JIMAGE="@FIXPATH@ @BUILD_OUTPUT@/jdk/bin/jimage"
LDD="@LDD@" LDD="@LDD@"
LN="@LN@"
MKDIR="@MKDIR@" MKDIR="@MKDIR@"
NAWK="@NAWK@" NAWK="@NAWK@"
NM="@GNM@" NM="@GNM@"

View File

@ -275,3 +275,4 @@ $CHMOD +x $OUTPUT_ROOT/compare.sh
# Finally output some useful information to the user # Finally output some useful information to the user
HELP_PRINT_SUMMARY_AND_WARNINGS HELP_PRINT_SUMMARY_AND_WARNINGS
CUSTOM_SUMMARY_AND_WARNINGS_HOOK CUSTOM_SUMMARY_AND_WARNINGS_HOOK
HELP_REPEAT_WARNINGS

View File

@ -94,9 +94,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
# On Windows, we need to set RC flags. # On Windows, we need to set RC flags.
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
RC_FLAGS="-nologo -l 0x409 -r" RC_FLAGS="-nologo -l0x409"
if test "x$VARIANT" = xOPT; then if test "x$VARIANT" = xOPT; then
RC_FLAGS="$RC_FLAGS -d NDEBUG" RC_FLAGS="$RC_FLAGS -DNDEBUG"
fi fi
# The version variables used to create RC_FLAGS may be overridden # The version variables used to create RC_FLAGS may be overridden
@ -105,13 +105,13 @@ AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
# The \$ are escaped to the shell, and the $(...) variables # The \$ are escaped to the shell, and the $(...) variables
# are evaluated by make. # are evaluated by make.
RC_FLAGS="$RC_FLAGS \ RC_FLAGS="$RC_FLAGS \
-d \"JDK_BUILD_ID=\$(FULL_VERSION)\" \ -D\"JDK_BUILD_ID=\$(FULL_VERSION)\" \
-d \"JDK_COMPANY=\$(COMPANY_NAME)\" \ -D\"JDK_COMPANY=\$(COMPANY_NAME)\" \
-d \"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \ -D\"JDK_COMPONENT=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) binary\" \
-d \"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \ -D\"JDK_VER=\$(JDK_MINOR_VERSION).\$(JDK_MICRO_VERSION).\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0).\$(COOKED_BUILD_NUMBER)\" \
-d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \ -D\"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\" \
-d \"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \ -D\"JDK_NAME=\$(PRODUCT_NAME) \$(JDK_RC_PLATFORM_NAME) \$(JDK_MINOR_VERSION) \$(JDK_UPDATE_META_TAG)\" \
-d \"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\"" -D\"JDK_FVER=\$(JDK_MINOR_VERSION),\$(JDK_MICRO_VERSION),\$(if \$(JDK_UPDATE_VERSION),\$(JDK_UPDATE_VERSION),0),\$(COOKED_BUILD_NUMBER)\""
fi fi
AC_SUBST(RC_FLAGS) AC_SUBST(RC_FLAGS)
@ -348,10 +348,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
# Add runtime stack smashing and undefined behavior checks # Add runtime stack smashing and undefined behavior checks
CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1" CFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
CXXFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1" CXXFLAGS_DEBUG_OPTIONS="-fstack-protector-all --param ssp-buffer-size=1"
if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
CFLAGS_DEBUG_OPTIONS="$CFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG"
CXXFLAGS_DEBUG_OPTIONS="$CXXFLAGS_DEBUG_OPTIONS $CFLAG_DETECT_UNDEFINED_BEHAVIsOR_FLAG"
fi
;; ;;
esac esac
fi fi
@ -668,7 +664,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \ COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK \
-I${JDK_TOPDIR}/src/java.base/share/native/include \ -I${JDK_TOPDIR}/src/java.base/share/native/include \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \ -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS/native/include \
-I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_API_DIR/native/include" -I${JDK_TOPDIR}/src/java.base/$OPENJDK_TARGET_OS_TYPE/native/include"
# The shared libraries are compiled using the picflag. # The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" CFLAGS_JDKLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
@ -746,25 +742,6 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib" LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
fi fi
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
# If undefined behaviour detection is enabled then we need to tell linker.
case $DEBUG_LEVEL in
release | fastdebug )
;;
slowdebug )
AC_MSG_WARN([$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR])
if test "x$HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR" = "xtrue"; then
# enable undefined behaviour checking
LDFLAGS_JDK="$LDFLAGS_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK `$ECHO -n $CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG | sed -e "s/[ ]*\([^ ]\+\)/ -Xlinker \1/g"`"
fi
;;
* )
AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
;;
esac
fi
# Customize LDFLAGS for executables # Customize LDFLAGS for executables
LDFLAGS_JDKEXE="${LDFLAGS_JDK}" LDFLAGS_JDKEXE="${LDFLAGS_JDK}"

File diff suppressed because it is too large Load Diff

View File

@ -257,3 +257,17 @@ AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
printf "\n" printf "\n"
fi fi
]) ])
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
[
if test -e "$OUTPUT_ROOT/config.log"; then
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" > /dev/null 2>&1
if test $? -eq 0; then
printf "The following warnings were produced. Repeated here for convenience:\n"
# We must quote sed expression (using []) to stop m4 from eating the [].
$GREP '^configure:.*: WARNING:' "$OUTPUT_ROOT/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
printf "\n"
fi
fi
])

View File

@ -549,7 +549,15 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
AC_SUBST(MACOSX_BUNDLE_NAME_BASE) AC_SUBST(MACOSX_BUNDLE_NAME_BASE)
AC_SUBST(MACOSX_BUNDLE_ID_BASE) AC_SUBST(MACOSX_BUNDLE_ID_BASE)
AC_ARG_WITH(copyright-year, [AS_HELP_STRING([--with-copyright-year],
[Set copyright year value for build @<:@current year@:>@])])
if test "x$with_copyright_year" = xyes; then
AC_MSG_ERROR([Copyright year must have a value])
elif test "x$with_copyright_year" != x; then
COPYRIGHT_YEAR="$with_copyright_year"
else
COPYRIGHT_YEAR=`date +'%Y'` COPYRIGHT_YEAR=`date +'%Y'`
fi
AC_SUBST(COPYRIGHT_YEAR) AC_SUBST(COPYRIGHT_YEAR)
if test "x$JDK_UPDATE_VERSION" != x; then if test "x$JDK_UPDATE_VERSION" != x; then

View File

@ -98,44 +98,37 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
# Converts autoconf style OS name to OpenJDK style, into # Converts autoconf style OS name to OpenJDK style, into
# VAR_OS and VAR_OS_API. # VAR_OS, VAR_OS_TYPE and VAR_OS_ENV.
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
[ [
case "$1" in case "$1" in
*linux*) *linux*)
VAR_OS=linux VAR_OS=linux
VAR_OS_API=posix VAR_OS_TYPE=unix
VAR_OS_ENV=linux
;; ;;
*solaris*) *solaris*)
VAR_OS=solaris VAR_OS=solaris
VAR_OS_API=posix VAR_OS_TYPE=unix
VAR_OS_ENV=solaris
;; ;;
*darwin*) *darwin*)
VAR_OS=macosx VAR_OS=macosx
VAR_OS_API=posix VAR_OS_TYPE=unix
VAR_OS_ENV=macosx
;; ;;
*bsd*) *bsd*)
VAR_OS=bsd VAR_OS=bsd
VAR_OS_API=posix VAR_OS_TYPE=unix
VAR_OS_ENV=bsd
;; ;;
*cygwin*) *cygwin*)
VAR_OS=windows VAR_OS=windows
VAR_OS_API=winapi
VAR_OS_ENV=windows.cygwin VAR_OS_ENV=windows.cygwin
;; ;;
*mingw*) *mingw*)
VAR_OS=windows VAR_OS=windows
VAR_OS_API=winapi
VAR_OS_ENV=windows.msys VAR_OS_ENV=windows.msys
;; ;;
*aix*) *aix*)
VAR_OS=aix VAR_OS=aix
VAR_OS_API=posix VAR_OS_TYPE=unix
VAR_OS_ENV=aix
;; ;;
*) *)
AC_MSG_ERROR([unsupported operating system $1]) AC_MSG_ERROR([unsupported operating system $1])
@ -165,14 +158,22 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu) PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
# ..and setup our own variables. (Do this explicitely to facilitate searching) # ..and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_BUILD_OS="$VAR_OS" OPENJDK_BUILD_OS="$VAR_OS"
OPENJDK_BUILD_OS_API="$VAR_OS_API" if test "x$VAR_OS_TYPE" != x; then
OPENJDK_BUILD_OS_TYPE="$VAR_OS_TYPE"
else
OPENJDK_BUILD_OS_TYPE="$VAR_OS"
fi
if test "x$VAR_OS_ENV" != x; then
OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV" OPENJDK_BUILD_OS_ENV="$VAR_OS_ENV"
else
OPENJDK_BUILD_OS_ENV="$VAR_OS"
fi
OPENJDK_BUILD_CPU="$VAR_CPU" OPENJDK_BUILD_CPU="$VAR_CPU"
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH" OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS" OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN" OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST(OPENJDK_BUILD_OS) AC_SUBST(OPENJDK_BUILD_OS)
AC_SUBST(OPENJDK_BUILD_OS_API) AC_SUBST(OPENJDK_BUILD_OS_TYPE)
AC_SUBST(OPENJDK_BUILD_OS_ENV) AC_SUBST(OPENJDK_BUILD_OS_ENV)
AC_SUBST(OPENJDK_BUILD_CPU) AC_SUBST(OPENJDK_BUILD_CPU)
AC_SUBST(OPENJDK_BUILD_CPU_ARCH) AC_SUBST(OPENJDK_BUILD_CPU_ARCH)
@ -187,14 +188,22 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu) PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
# ... and setup our own variables. (Do this explicitely to facilitate searching) # ... and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_TARGET_OS="$VAR_OS" OPENJDK_TARGET_OS="$VAR_OS"
OPENJDK_TARGET_OS_API="$VAR_OS_API" if test "x$VAR_OS_TYPE" != x; then
OPENJDK_TARGET_OS_TYPE="$VAR_OS_TYPE"
else
OPENJDK_TARGET_OS_TYPE="$VAR_OS"
fi
if test "x$VAR_OS_ENV" != x; then
OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV" OPENJDK_TARGET_OS_ENV="$VAR_OS_ENV"
else
OPENJDK_TARGET_OS_ENV="$VAR_OS"
fi
OPENJDK_TARGET_CPU="$VAR_CPU" OPENJDK_TARGET_CPU="$VAR_CPU"
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH" OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS" OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN" OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST(OPENJDK_TARGET_OS) AC_SUBST(OPENJDK_TARGET_OS)
AC_SUBST(OPENJDK_TARGET_OS_API) AC_SUBST(OPENJDK_TARGET_OS_TYPE)
AC_SUBST(OPENJDK_TARGET_OS_ENV) AC_SUBST(OPENJDK_TARGET_OS_ENV)
AC_SUBST(OPENJDK_TARGET_CPU) AC_SUBST(OPENJDK_TARGET_CPU)
AC_SUBST(OPENJDK_TARGET_CPU_ARCH) AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
@ -331,19 +340,10 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
fi fi
AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS)
# Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
if test "x$OPENJDK_TARGET_OS_API" = xposix; then
OPENJDK_TARGET_OS_API_DIR="unix"
fi
if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then
OPENJDK_TARGET_OS_API_DIR="windows"
fi
AC_SUBST(OPENJDK_TARGET_OS_API_DIR)
if test "x$OPENJDK_TARGET_OS" = xmacosx; then if test "x$OPENJDK_TARGET_OS" = xmacosx; then
OPENJDK_TARGET_OS_EXPORT_DIR=macosx OPENJDK_TARGET_OS_EXPORT_DIR=macosx
else else
OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_API_DIR} OPENJDK_TARGET_OS_EXPORT_DIR=${OPENJDK_TARGET_OS_TYPE}
fi fi
AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR) AC_SUBST(OPENJDK_TARGET_OS_EXPORT_DIR)
@ -472,8 +472,8 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
# And -q on AIX because otherwise the compiler produces 32-bit objects by default # And -q on AIX because otherwise the compiler produces 32-bit objects by default
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
elif test "x$COMPILE_TYPE" = xreduced; then elif test "x$COMPILE_TYPE" = xreduced; then
if test "x$OPENJDK_TARGET_OS" != xwindows; then if test "x$OPENJDK_TARGET_OS_TYPE" = xunix; then
# Specify -m if running reduced on other Posix platforms # Specify -m if running reduced on unix platforms
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
fi fi
fi fi

View File

@ -36,6 +36,7 @@
X:= X:=
SPACE:=$(X) $(X) SPACE:=$(X) $(X)
COMMA:=, COMMA:=,
DOLLAR:=$$
HASH:=\# HASH:=\#
LEFT_PAREN:=( LEFT_PAREN:=(
RIGHT_PAREN:=) RIGHT_PAREN:=)
@ -82,7 +83,7 @@ CONF_NAME:=@CONF_NAME@
# The built jdk will run in this target system. # The built jdk will run in this target system.
OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@ OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@ OPENJDK_TARGET_OS_TYPE:=@OPENJDK_TARGET_OS_TYPE@
OPENJDK_TARGET_OS_ENV:=@OPENJDK_TARGET_OS_ENV@ OPENJDK_TARGET_OS_ENV:=@OPENJDK_TARGET_OS_ENV@
OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@ OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
@ -99,13 +100,12 @@ OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@ OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@ OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@ OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@
OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@
OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@ OPENJDK_TARGET_OS_EXPORT_DIR:=@OPENJDK_TARGET_OS_EXPORT_DIR@
# We are building on this build system. # We are building on this build system.
# When not cross-compiling, it is the same as the target. # When not cross-compiling, it is the same as the target.
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@ OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@ OPENJDK_BUILD_OS_TYPE:=@OPENJDK_BUILD_OS_TYPE@
OPENJDK_BUILD_OS_ENV:=@OPENJDK_BUILD_OS_ENV@ OPENJDK_BUILD_OS_ENV:=@OPENJDK_BUILD_OS_ENV@
OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@ OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@
@ -343,7 +343,7 @@ OBJC:=@CCACHE@ @OBJC@
CPP:=@FIXPATH@ @CPP@ CPP:=@FIXPATH@ @CPP@
#CPPFLAGS:=@CPPFLAGS@ #CPPFLAGS:=@CPPFLAGS@
# The linker can be gcc or ld on posix systems, or link.exe on windows systems. # The linker can be gcc or ld on unix systems, or link.exe on windows systems.
LD:=@FIXPATH@ @LD@ LD:=@FIXPATH@ @LD@
# Xcode SDK path # Xcode SDK path
@ -384,7 +384,7 @@ BUILD_LD:=@FIXPATH@ @BUILD_LD@
AS:=@FIXPATH@ @AS@ AS:=@FIXPATH@ @AS@
# AR is used to create a static library (is ar in posix, lib.exe in windows) # AR is used to create a static library (is ar in unix, lib.exe in windows)
AR:=@FIXPATH@ @AR@ AR:=@FIXPATH@ @AR@
ARFLAGS:=@ARFLAGS@ ARFLAGS:=@ARFLAGS@
@ -562,10 +562,10 @@ FIXPATH:=@FIXPATH@
# Where the build output is stored for your convenience. # Where the build output is stored for your convenience.
BUILD_LOG:=@BUILD_LOG@ BUILD_LOG:=@BUILD_LOG@
BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@ BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
# Disable the build log wrapper on sjavac+winapi until # Disable the build log wrapper on sjavac+windows until
# we have solved how to prevent the log wrapper to wait # we have solved how to prevent the log wrapper to wait
# for the background sjavac server process. # for the background sjavac server process.
ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS_API@,yesXwinapi) ifeq (@ENABLE_SJAVAC@X@OPENJDK_BUILD_OS@,yesXwindows)
BUILD_LOG_WRAPPER:= BUILD_LOG_WRAPPER:=
else else
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@ BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@

View File

@ -712,12 +712,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
[HAS_CFLAG_OPTIMIZE_DEBUG=true], [HAS_CFLAG_OPTIMIZE_DEBUG=true],
[HAS_CFLAG_OPTIMIZE_DEBUG=false]) [HAS_CFLAG_OPTIMIZE_DEBUG=false])
# "-fsanitize=undefined" supported for GCC 4.9 and later
CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG="-fsanitize=undefined -fsanitize-recover"
FLAGS_COMPILER_CHECK_ARGUMENTS([$CFLAG_DETECT_UNDEFINED_BEHAVIOR_FLAG],
[HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=true],
[HAS_CFLAG_DETECT_UNDEFINED_BEHAVIOR=false])
# "-z relro" supported in GNU binutils 2.17 and later # "-z relro" supported in GNU binutils 2.17 and later
LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro" LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG], FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],

View File

@ -110,6 +110,7 @@ ACCEPTED_BIN_DIFF="
./bin/wsimport ./bin/wsimport
./bin/xjc ./bin/xjc
./jre/bin/java ./jre/bin/java
./jre/bin/jjs
./jre/bin/keytool ./jre/bin/keytool
./jre/bin/orbd ./jre/bin/orbd
./jre/bin/pack200 ./jre/bin/pack200
@ -199,6 +200,7 @@ ACCEPTED_BIN_DIFF="
./bin/wsimport ./bin/wsimport
./bin/xjc ./bin/xjc
./jre/bin/java ./jre/bin/java
./jre/bin/jjs
./jre/bin/keytool ./jre/bin/keytool
./jre/bin/orbd ./jre/bin/orbd
./jre/bin/pack200 ./jre/bin/pack200
@ -924,11 +926,6 @@ ACCEPTED_JARZIP_CONTENTS="
/META-INF/INDEX.LIST /META-INF/INDEX.LIST
" "
KNOWN_BIN_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
ACCEPTED_BIN_DIFF=" ACCEPTED_BIN_DIFF="
./bin/appletviewer ./bin/appletviewer
./bin/idlj ./bin/idlj
@ -980,34 +977,82 @@ ACCEPTED_BIN_DIFF="
./jre/bin/tnameserv ./jre/bin/tnameserv
./jre/lib/libsaproc.dylib ./jre/lib/libsaproc.dylib
./jre/lib/server/libjvm.dylib ./jre/lib/server/libjvm.dylib
./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib
./demo/jvmti/gctest/lib/libgctest.dylib
./demo/jvmti/heapTracker/lib/libheapTracker.dylib
./demo/jvmti/heapViewer/lib/libheapViewer.dylib
./demo/jvmti/minst/lib/libminst.dylib
./demo/jvmti/mtrace/lib/libmtrace.dylib
./demo/jvmti/versionCheck/lib/libversionCheck.dylib
./demo/jvmti/waiters/lib/libwaiters.dylib
./Contents/Home/lib/libAppleScriptEngine.dylib
./Contents/Home/lib/libattach.dylib
./Contents/Home/lib/libawt_lwawt.dylib
./Contents/Home/lib/libdeploy.dylib
./Contents/Home/lib/libdt_socket.dylib
./Contents/Home/lib/libhprof.dylib
./Contents/Home/lib/libinstrument.dylib
./Contents/Home/lib/libjava_crw_demo.dylib
./Contents/Home/lib/libjdwp.dylib
./Contents/Home/lib/libjsdt.dylib
./Contents/Home/lib/libjsig.dylib
./Contents/Home/lib/libmanagement.dylib
./Contents/Home/lib/libnpjp2.dylib
./Contents/Home/lib/libosx.dylib
./Contents/Home/lib/libosxapp.dylib
./Contents/Home/lib/libsaproc.dylib
./Contents/Home/lib/libsplashscreen.dylib
./Contents/Home/lib/libverify.dylib
./Contents/Home/lib/server/libjsig.dylib
./Contents/Home/lib/server/libjvm.dylib
./jre/lib/libAppleScriptEngine.dylib
./jre/lib/libattach.dylib
./jre/lib/libawt_lwawt.dylib
./jre/lib/libdeploy.dylib
./jre/lib/libdt_socket.dylib
./jre/lib/libhprof.dylib
./jre/lib/libinstrument.dylib
./jre/lib/libjava_crw_demo.dylib
./jre/lib/libjdwp.dylib
./jre/lib/libjsdt.dylib
./jre/lib/libjsig.dylib
./jre/lib/libmanagement.dylib
./jre/lib/libosx.dylib
./jre/lib/libosxapp.dylib
./jre/lib/libsaproc.dylib
./jre/lib/libsplashscreen.dylib
./jre/lib/libverify.dylib
./jre/lib/server/libjvm.dylib
./lib/libAppleScriptEngine.dylib
./lib/libattach.dylib
./lib/libawt_lwawt.dylib
./lib/libdeploy.dylib
./lib/libdt_socket.dylib
./lib/libhprof.dylib
./lib/libinstrument.dylib
./lib/libjava_crw_demo.dylib
./lib/libjdwp.dylib
./lib/libjsdt.dylib
./lib/libjsig.dylib
./lib/libmanagement.dylib
./lib/libnpjp2.dylib
./lib/libosx.dylib
./lib/libosxapp.dylib
./lib/libverify.dylib
./lib/libsaproc.dylib ./lib/libsaproc.dylib
./lib/libsplashscreen.dylib
./lib/server/libjvm.dylib ./lib/server/libjvm.dylib
./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel ./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
" "
KNOWN_SIZE_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
SORT_SYMBOLS=" SORT_SYMBOLS="
./jre/lib/libJObjC.dylib ./Contents/Home/lib/libsaproc.dylib
./lib/libJObjC.dylib ./jre/lib/libsaproc.dylib
./lib/libsaproc.dylib
" "
KNOWN_SYM_DIFF=" ACCEPTED_SMALL_SIZE_DIFF="
./jre/lib/libJObjC.dylib ./bin/javaws
./lib/libJObjC.dylib ./Contents/Home/bin/_javaws
" "
KNOWN_ELF_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
KNOWN_DIS_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
fi fi

View File

@ -181,4 +181,3 @@ checkErrors
checkErrors checkErrors
exit 0 exit 0

View File

@ -200,4 +200,3 @@ do
printf "%s\n" "$line" >> $output printf "%s\n" "$line" >> $output
fi fi
done < "$input" done < "$input"

View File

@ -433,8 +433,8 @@ GENERATED_SRC_DIRS += \
# #
OS_SRC_DIRS += $(JDK_TOPDIR)/src/$1/$(OPENJDK_TARGET_OS)/classes OS_SRC_DIRS += $(JDK_TOPDIR)/src/$1/$(OPENJDK_TARGET_OS)/classes
ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_API_DIR)) ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
OS_API_SRC_DIRS += $(JDK_TOPDIR)/src/$1/$(OPENJDK_TARGET_OS_API_DIR)/classes OS_TYPE_SRC_DIRS += $(JDK_TOPDIR)/src/$1/$(OPENJDK_TARGET_OS_TYPE)/classes
endif endif
SHARE_SRC_DIRS += \ SHARE_SRC_DIRS += \
@ -448,7 +448,7 @@ SHARE_SRC_DIRS += \
ALL_SRC_DIRS = \ ALL_SRC_DIRS = \
$(GENERATED_SRC_DIRS) \ $(GENERATED_SRC_DIRS) \
$(OS_SRC_DIRS) \ $(OS_SRC_DIRS) \
$(OS_API_SRC_DIRS) \ $(OS_TYPE_SRC_DIRS) \
$(SHARE_SRC_DIRS) \ $(SHARE_SRC_DIRS) \
# #

View File

@ -74,6 +74,7 @@ JCONSOLE_FIRST_COPYRIGHT_YEAR = 2006
SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009 SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009
TRACING_FIRST_COPYRIGHT_YEAR = 2008 TRACING_FIRST_COPYRIGHT_YEAR = 2008
TREEAPI_FIRST_COPYRIGHT_YEAR = 2005 TREEAPI_FIRST_COPYRIGHT_YEAR = 2005
NASHORNAPI_FIRST_COPYRIGHT_YEAR = 2014
JNLP_FIRST_COPYRIGHT_YEAR = 1998 JNLP_FIRST_COPYRIGHT_YEAR = 1998
PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007 PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007
JDKNET_FIRST_COPYRIGHT_YEAR = 2014 JDKNET_FIRST_COPYRIGHT_YEAR = 2014
@ -137,8 +138,10 @@ $(FULL_COMPANY_NAME) in the US and other countries.
# command (newline or shell ; character) # command (newline or shell ; character)
ALL_SOURCE_DIRS := $(wildcard \ ALL_SOURCE_DIRS := $(wildcard \
$(JDK_TOPDIR)/src/*/share/classes \ $(JDK_TOPDIR)/src/*/share/classes \
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_API_DIR)/classes \ $(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS)/classes \
$(JDK_TOPDIR)/src/*/$(OPENJDK_TARGET_OS_TYPE)/classes \
$(LANGTOOLS_TOPDIR)/src/*/share/classes \ $(LANGTOOLS_TOPDIR)/src/*/share/classes \
$(NASHORN_TOPDIR)/src/*/share/classes \
$(CORBA_TOPDIR)/src/*/share/classes \ $(CORBA_TOPDIR)/src/*/share/classes \
$(JAXP_TOPDIR)/src/*/share/classes \ $(JAXP_TOPDIR)/src/*/share/classes \
$(JAXWS_TOPDIR)/src/*/share/classes \ $(JAXWS_TOPDIR)/src/*/share/classes \
@ -1119,6 +1122,60 @@ $(TREEAPI_PACKAGES_FILE): $(call PackageDependencies,$(TREEAPI_PKGS))
$(prep-target) $(prep-target)
$(call PackageFilter,$(TREEAPI_PKGS)) $(call PackageFilter,$(TREEAPI_PKGS))
#############################################################
#
# nashornapidocs
#
ALL_OTHER_TARGETS += nashornapidocs
NASHORNAPI_DOCDIR := $(JDK_API_DOCSDIR)/nashorn
NASHORNAPI2COREAPI := ../$(JDKJRE2COREAPI)
NASHORNAPI_DOCTITLE := Nashorn API
NASHORNAPI_WINDOWTITLE := Nashorn API
NASHORNAPI_HEADER := <strong>Nashorn API</strong>
NASHORNAPI_BOTTOM := $(call CommonBottom,$(NASHORNAPI_FIRST_COPYRIGHT_YEAR))
NASHORNAPI_GROUPNAME := Packages
NASHORNAPI_REGEXP := jdk.nashorn.api.scripting.*
# NASHORNAPI_PKGS is located in NON_CORE_PKGS.gmk
NASHORNAPI_INDEX_HTML = $(NASHORNAPI_DOCDIR)/index.html
NASHORNAPI_OPTIONS_FILE = $(DOCSTMPDIR)/nashornapi.options
NASHORNAPI_PACKAGES_FILE = $(DOCSTMPDIR)/nashornapi.packages
nashornapidocs: $(NASHORNAPI_INDEX_HTML)
# Set relative location to core api document root
$(NASHORNAPI_INDEX_HTML): GET2DOCSDIR=$(NASHORNAPI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(NASHORNAPI_INDEX_HTML): $(NASHORNAPI_OPTIONS_FILE) $(NASHORNAPI_PACKAGES_FILE) $(COREAPI_INDEX_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(NASHORNAPI_OPTIONS_FILE),$(NASHORNAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(NASHORNAPI_OPTIONS_FILE) @$(NASHORNAPI_PACKAGES_FILE)
# Create file with javadoc options in it
$(NASHORNAPI_OPTIONS_FILE):
$(prep-target)
@($(call COMMON_JAVADOCFLAGS) ; \
$(call COMMON_JAVADOCTAGS) ; \
$(call OptionOnly,-Xdoclint:all) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionPair,-doctitle,$(NASHORNAPI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(NASHORNAPI_WINDOWTITLE) $(DRAFT_WINTITLE)); \
$(call OptionPair,-header,$(NASHORNAPI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(NASHORNAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-group,$(NASHORNAPI_GROUPNAME),$(NASHORNAPI_REGEXP)); \
$(call OptionTrip,-linkoffline,$(NASHORNAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(NASHORNAPI_PACKAGES_FILE): $(call PackageDependencies,$(NASHORNAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(NASHORNAPI_PKGS))
############################################################# #############################################################
# #
# sctpdocs # sctpdocs

View File

@ -353,7 +353,7 @@ else
# links against libosxapp. # links against libosxapp.
jdk.deploy.osx-libs: java.desktop-libs jdk.deploy.osx-libs: java.desktop-libs
# This dependency needs to be explicitly declared as jdk.jdi-gensrc generates a # This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
# header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a # header file used by jdk.jdwp.agent-libs. The jdk.jdwp.agent-gensrc is a
# virtual target. # virtual target.
jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc

View File

@ -228,25 +228,26 @@ define ParseConfAndSpec
# If we only have global targets, no need to bother with SPEC or CONF # If we only have global targets, no need to bother with SPEC or CONF
ifneq ($$(origin SPEC),undefined) ifneq ($$(origin SPEC),undefined)
# We have been given a SPEC, check that it works out properly # We have been given a SPEC, check that it works out properly
ifeq ($$(wildcard $$(SPEC)),)
$$(info Cannot locate spec.gmk, given by SPEC=$$(SPEC))
$$(eval $$(call FatalError))
endif
ifneq ($$(origin CONF),undefined) ifneq ($$(origin CONF),undefined)
# We also have a CONF argument. This is OK only if this is a repeated call by ourselves, # We also have a CONF argument. This is OK only if this is a repeated call by ourselves,
# but complain if this is the top-level make call. # but complain if this is the top-level make call.
ifeq ($$(MAKELEVEL),0) ifeq ($$(MAKELEVEL),0)
$$(info Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.) $$(info Error: Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
$$(eval $$(call FatalError)) $$(eval $$(call FatalError))
endif endif
endif endif
ifeq ($$(wildcard $$(SPEC)),)
$$(info Error: Cannot locate spec.gmk, given by SPEC=$$(SPEC).)
$$(eval $$(call FatalError))
endif
# ... OK, we're satisfied, we'll use this SPEC later on # ... OK, we're satisfied, we'll use this SPEC later on
else else
# Find all spec.gmk files in the build output directory # Find all spec.gmk files in the build output directory
output_dir=$$(root_dir)/build output_dir=$$(root_dir)/build
all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk) all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk)
ifeq ($$(all_spec_files),) ifeq ($$(all_spec_files),)
$$(info No configurations found for $$(root_dir)! Please run configure to create a configuration.) $$(info Error: No configurations found for $$(root_dir).)
$$(info Please run 'bash configure' to create a configuration.)
$$(eval $$(call FatalError)) $$(eval $$(call FatalError))
endif endif
# Extract the configuration names from the path # Extract the configuration names from the path
@ -262,15 +263,15 @@ define ParseConfAndSpec
matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var)))) matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var))))
endif endif
ifeq ($$(matching_confs),) ifeq ($$(matching_confs),)
$$(info No configurations found matching CONF=$$(CONF)) $$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations:) $$(info Available configurations in $$(output_dir):)
$$(foreach var,$$(all_confs),$$(info * $$(var))) $$(foreach var,$$(all_confs),$$(info * $$(var)))
$$(eval $$(call FatalError)) $$(eval $$(call FatalError))
else else
ifeq ($$(words $$(matching_confs)),1) ifeq ($$(words $$(matching_confs)),1)
$$(info Building '$$(matching_confs)' (matching CONF=$$(CONF))) $$(info Building '$$(matching_confs)' (matching CONF=$$(CONF)))
else else
$$(info Building target '$(call GetRealTarget)' in the following configurations (matching CONF=$$(CONF)):) $$(info Building target '$(call GetRealTarget)' in these configurations (matching CONF=$$(CONF)):)
$$(foreach var,$$(matching_confs),$$(info * $$(var))) $$(foreach var,$$(matching_confs),$$(info * $$(var)))
endif endif
endif endif
@ -280,10 +281,10 @@ define ParseConfAndSpec
else else
# No CONF or SPEC given, check the available configurations # No CONF or SPEC given, check the available configurations
ifneq ($$(words $$(all_spec_files)),1) ifneq ($$(words $$(all_spec_files)),1)
$$(info No CONF given, but more than one configuration found in $$(output_dir).) $$(info Error: No CONF given, but more than one configuration found.)
$$(info Available configurations:) $$(info Available configurations in $$(output_dir):)
$$(foreach var,$$(all_confs),$$(info * $$(var))) $$(foreach var,$$(all_confs),$$(info * $$(var)))
$$(info Please retry building with CONF=<config pattern> (or SPEC=<specfile>)) $$(info Please retry building with CONF=<config pattern> (or SPEC=<specfile>).)
$$(eval $$(call FatalError)) $$(eval $$(call FatalError))
endif endif

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -75,10 +75,25 @@ define add_idl_package
$(RM) -rf $3/$$($4_TMPDIR) $(RM) -rf $3/$$($4_TMPDIR)
endef endef
# Setup make rules for creating an IDL compilation.
#
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# IDLJ
# SRC
# BIN
# INCLUDES
# EXCLUDES
# OLDIMPLBASES
# DELETES
define SetupIdlCompilation define SetupIdlCompilation
# param 1 is for example BUILD_IDLS $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
# param 2,3,4,5,6,7,8 are named args. $(call EvalDebugWrapper,$(strip $1),$(call SetupIdlCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
# IDLJ,SRC,BIN,INCLUDES,EXCLUDES,OLDIMPLBASES,DELETES endef
define SetupIdlCompilationInner
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupIdlCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(call LogSetupMacroEntry,SetupIdlCompilation($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 SetupIdlCompilation, please update IdlCompilation.gmk)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -42,17 +42,29 @@ ifeq (,$(_MAKEBASE_GMK))
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk) $(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
endif endif
# Java compilation needs SetupZipArchive if we're generating a source zip.
include ZipArchive.gmk
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
define SetupJavaCompiler # Setup make rules for defining a Java compiler, which is needed to compile
# param 1 is for example GENERATE_OLD_BYTECODE or GENERATE_NEW_JDKBYTECODE # Java code. This rule generates no output.
# This is the name of the compiler setup. #
# param 2-9 are named args. # Parameter 1 is the name of the compiler definition. This name needs to be
# passed to SetupJavaCompilation. This name is used as variable prefix.
#
# Remaining parameters are named arguments. These include:
# JVM:=The jvm used to run the javac/javah command # JVM:=The jvm used to run the javac/javah command
# JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out # JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out
# FLAGS:=Flags to be supplied to javac # FLAGS:=Flags to be supplied to javac
# SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
# SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
define SetupJavaCompiler
$(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
$(call EvalDebugWrapper,$(strip $1),$(call SetupJavaCompilerInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
endef
define SetupJavaCompilerInner
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupJavaCompiler($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(call LogSetupMacroEntry,SetupJavaCompiler($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 SetupJavaCompiler, please update JavaCompilation.gmk)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
@ -67,10 +79,12 @@ define SetupJavaCompiler
endif endif
endef endef
define SetupArchive # Setup make rules for creating a jar archive.
# param 1 is for example ARCHIVE_MYPACKAGE #
# param 2 are the dependecies # Parameter 1 is the name of the rule. This name is used as variable prefix,
# param 3,4,5,6,7,8,9 are named args. # and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# SRCS:=List of directories in where to find files to add to archive # SRCS:=List of directories in where to find files to add to archive
# SUFFIXES:=File suffixes to include in jar # SUFFIXES:=File suffixes to include in jar
# INCLUDES:=List of directories/packages in SRCS that should be included # INCLUDES:=List of directories/packages in SRCS that should be included
@ -85,7 +99,12 @@ define SetupArchive
# added to the archive. # added to the archive.
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
# CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable # CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
define SetupArchive
$(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
$(call EvalDebugWrapper,$(strip $1),$(call SetupArchiveInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
endef
define SetupArchiveInner
# NOTE: $2 is dependencies, not a named argument! # NOTE: $2 is dependencies, not a named argument!
$(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) $(foreach i,3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(call LogSetupMacroEntry,SetupArchive($1),<dependencies>,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
@ -287,78 +306,13 @@ define SetupArchive
$1 += $$($1_JAR) $1 += $$($1_JAR)
endef endef
define SetupZipArchive
# param 1 is for example ZIP_MYSOURCE
# param 2,3,4,5,6,7,8,9 are named args.
# SRC,ZIP,INCLUDES,INCLUDE_FILES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupZipArchive($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 SetupZipArchive, please update JavaCompilation.gmk))
# To avoid running find over too large sets of files, which causes make to crash
# on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
# of directories to run find in, if available.
ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),)
$1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC), \
$$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES))))
else
$1_FIND_LIST := $$($1_SRC)
endif
# Find all files in the source tree.
$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),)
$1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \
$$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
else
$1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
endif
endif
ifneq ($$($1_INCLUDE_FILES),)
$1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
endif
ifneq ($$($1_EXCLUDES),)
$1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
endif
ifneq ($$($1_EXCLUDE_FILES),) ifneq ($$($1_EXCLUDE_FILES),)
# Cannot precompute ZIP_EXCLUDE_FILES as it is dependent on which src root is being # Cannot precompute ZIP_EXCLUDE_FILES as it is dependent on which src root is being
# zipped at the moment. # zipped at the moment.
$1_SRC_EXCLUDE_FILES := $$(addprefix %, $$($1_EXCLUDE_FILES)) $$($1_EXCLUDE_FILES) $1_SRC_EXCLUDE_FILES := $$(addprefix %, $$($1_EXCLUDE_FILES)) $$($1_EXCLUDE_FILES)
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDE_FILES), $$($1_ALL_SRCS)) $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDE_FILES), $$($1_ALL_SRCS))
endif endif
# Use a slightly shorter name for logging, but with enough path to identify this zip.
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP))
# Now $1_ALL_SRCS should contain all sources that are going to be put into the zip.
# I.e. the zip -i and -x options should match the filtering done in the makefile.
# Explicitly excluded files can be given with absolute path. The patsubst solution
# isn't perfect but the likelyhood of an absolute path to match something in a src
# dir is very small.
# If zip has nothing to do, it returns 12 and would fail the build. Check for 12
# and only fail if it's not.
$$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
$(MKDIR) -p $$(@D)
$(ECHO) Updating $$($1_NAME)
$$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$@ . $$($1_ZIP_INCLUDES) \
$$($1_ZIP_EXCLUDES) -x \*_the.\* \
$$(addprefix -x$(SPACE), $$(patsubst $$i/%,%, $$($1_EXCLUDE_FILES))) \
|| test "$$$$?" = "12" )$$(NEWLINE)) true
$(TOUCH) $$@
# Add zip to target list
$1 += $$($1_ZIP)
endef
define add_file_to_copy define add_file_to_copy
# param 1 = BUILD_MYPACKAGE # param 1 = BUILD_MYPACKAGE
# parma 2 = The source file to copy. # parma 2 = The source file to copy.
@ -409,13 +363,15 @@ define add_file_to_clean
# Now we can setup the depency that will trigger the copying. # Now we can setup the depency that will trigger the copying.
$$($1_BIN)$$($2_TARGET) : $2 $$($1_BIN)$$($2_TARGET) : $2
$(MKDIR) -p $$(@D) $(MKDIR) -p $$(@D)
$(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \ export LC_ALL=C ; $(CAT) $$< \
| $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' \
-e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \ -e 's/\([^\\]\)!/\1\\!/g' -e 's/#.*/#/g' \
| $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \ | $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \
| $(SED) -e '/^#/d' -e '/^$$$$/d' \ | $(SED) -e '/^#/d' -e '/^$$$$/d' \
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \ -e :a -e '/\\$$$$/N; s/\\\n//; ta' \
-e 's/^[ ]*//;s/[ ]*$$$$//' \ -e 's/^[ ]*//;s/[ ]*$$$$//' \
-e 's/\\=/=/' | LC_ALL=C $(SORT) > $$@ -e 's/\\=/=/' \
| $(SORT) > $$@
$(CHMOD) -f ug+w $$@ $(CHMOD) -f ug+w $$@
# And do not forget this target # And do not forget this target
@ -430,9 +386,13 @@ define replace_space_with_pathsep
$1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2))) $1:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$2)))
endef endef
define SetupJavaCompilation # Setup make rules for compiling Java source code to class files and/or a
# param 1 is for example BUILD_MYPACKAGE # resulting jar file.
# param 2,3,4,5,6,7,8 are named args. #
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC # SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
# JVM:=path to ..bin/java # JVM:=path to ..bin/java
# ADD_JAVAC_FLAGS:=javac flags to append to the default ones. # ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
@ -453,6 +413,12 @@ define SetupJavaCompilation
# HEADERS:=path to directory where all generated c-headers are written. # HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependecy # DEPENDS:=Extra dependecy
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit. # DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
define SetupJavaCompilation
$(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
$(call EvalDebugWrapper,$(strip $1),$(call SetupJavaCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
endef
define SetupJavaCompilationInner
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(call LogSetupMacroEntry,SetupJavaCompilation($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 SetupJavaCompilation, please update JavaCompilation.gmk)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))

View File

@ -380,6 +380,17 @@ define LogSetupMacroEntry
$(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i)))))) $(if $(findstring $(LOG_LEVEL),debug trace), $(info $1 $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26,$(if $($i),$(NEWLINE) $(strip [$i] $($i))))))
endef endef
# Support macro for all SetupFoo macros.
define EvalDebugWrapper
$(if $(DEBUG_$1),
$(info -------- <<< Begin expansion of $1)
$(info $2)
$(info -------- >>> End expansion of $1)
)
$2
endef
# Make directory without forking mkdir if not needed # Make directory without forking mkdir if not needed
define MakeDir define MakeDir
ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9)) ifneq ($$(wildcard $1 $2 $3 $4 $5 $6 $7 $8 $9),$$(strip $1 $2 $3 $4 $5 $6 $7 $8 $9))
@ -394,7 +405,7 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
# If the source and target parent directories are the same, recursive copy doesn't work # If the source and target parent directories are the same, recursive copy doesn't work
# so we fall back on regular copy, which isn't preserving symlinks. # so we fall back on regular copy, which isn't preserving symlinks.
define install-file define install-file
$(MKDIR) -p $(@D) $(MKDIR) -p '$(@D)'
$(RM) '$@' $(RM) '$@'
if [ "$(@D)" != "$(<D)" ]; then \ if [ "$(@D)" != "$(<D)" ]; then \
$(CP) -f -r -P '$<' '$(@D)'; \ $(CP) -f -r -P '$<' '$(@D)'; \
@ -416,7 +427,7 @@ else ifeq ($(OPENJDK_TARGET_OS),macosx)
# output dir. When these are copied again to images, xattr would fail. By only clearing # output dir. When these are copied again to images, xattr would fail. By only clearing
# attributes when they are present, failing on this is avoided. # attributes when they are present, failing on this is avoided.
define install-file define install-file
$(MKDIR) -p $(@D) $(MKDIR) -p '$(@D)'
$(CP) -fRP '$<' '$@' $(CP) -fRP '$<' '$@'
if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
endef endef
@ -424,7 +435,7 @@ else
# Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin # Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin
# significantly. # significantly.
define install-file define install-file
$(MKDIR) -p $(@D) && $(CP) -fP '$<' '$@' $(MKDIR) -p '$(@D)' && $(CP) -fP '$<' '$@'
endef endef
endif endif

View File

@ -46,8 +46,8 @@ define FindJavaModules
$(filter-out $(JAVA_MODULES_FILTER), $(sort $(notdir \ $(filter-out $(JAVA_MODULES_FILTER), $(sort $(notdir \
$(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \ $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \
$(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \ $(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %,%/*/$(OPENJDK_TARGET_OS_API_DIR)/classes/*, $(ALL_TOP_SRC_DIRS)) \ $(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)))))))))))) $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))))
endef endef
# Find all modules with source for the target platform. # Find all modules with source for the target platform.
@ -55,7 +55,7 @@ define FindAllModules
$(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \ $(sort $(filter-out closed demo sample, $(notdir $(patsubst %/,%, $(dir \
$(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \ $(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \ $(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
$(patsubst %, %/*/$(OPENJDK_TARGET_OS_API_DIR), $(ALL_TOP_SRC_DIRS)))))))) $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS))))))))
endef endef
################################################################################ ################################################################################

View File

@ -82,6 +82,8 @@ TREEAPI_PKGS = com.sun.source.doctree \
com.sun.source.util \ com.sun.source.util \
jdk jdk
NASHORNAPI_PKGS = jdk.nashorn.api.scripting
SMARTCARDIO_PKGS = javax.smartcardio SMARTCARDIO_PKGS = javax.smartcardio
SCTPAPI_PKGS = com.sun.nio.sctp SCTPAPI_PKGS = com.sun.nio.sctp

View File

@ -34,17 +34,18 @@ ifeq (,$(_MAKEBASE_GMK))
$(error You must include MakeBase.gmk prior to including NativeCompilation.gmk) $(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
endif endif
ifneq ($(TOOLCHAIN_TYPE), microsoft) # Extensions of files handled by this macro.
COMPILING_MSG=echo $(LOG_INFO) "Compiling $(notdir $1) (for $(notdir $2))" NATIVE_SOURCE_EXTENSIONS := %.s %.c %.cpp %.m %.mm
LINKING_MSG=echo $(LOG_INFO) "Linking $1"
LINKING_EXE_MSG=echo $(LOG_INFO) "Linking executable $1" # Replaces native source extensions with the object file extension in a string.
ARCHIVING_MSG=echo $(LOG_INFO) "Archiving $1" # Param 1: the string containing source file names with extensions
else # The surrounding strip is needed to keep additional whitespace out
COMPILING_MSG= define replace_with_obj_extension
LINKING_MSG= $(strip \
LINKING_EXE_MSG= $(foreach extension, $(NATIVE_SOURCE_EXTENSIONS), \
ARCHIVING_MSG= $(patsubst $(extension),%$(OBJ_SUFFIX),$(filter $(extension),$1))) \
endif )
endef
ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin) ifeq ($(OPENJDK_BUILD_OS_ENV), windows.cygwin)
UNIX_PATH_PREFIX := /cygdrive UNIX_PATH_PREFIX := /cygdrive
@ -52,6 +53,15 @@ else ifeq ($(OPENJDK_BUILD_OS_ENV), windows.msys)
UNIX_PATH_PREFIX := UNIX_PATH_PREFIX :=
endif endif
WINDOWS_SHOWINCLUDE_SED_PATTERN := \
-e '/^Note: including file:/!d' \
-e 's|Note: including file: *||' \
-e 's|\\|/|g' \
-e 's|^\([a-zA-Z]\):|$(UNIX_PATH_PREFIX)/\1|g' \
-e '/$(subst /,\/,$(TOPDIR))/!d' \
-e 's|$$$$| \\|g' \
#
define add_native_source define add_native_source
# param 1 = BUILD_MYPACKAGE # param 1 = BUILD_MYPACKAGE
# parma 2 = the source file name (..../alfa.c or .../beta.cpp) # parma 2 = the source file name (..../alfa.c or .../beta.cpp)
@ -60,7 +70,8 @@ define add_native_source
# param 5 = the c compiler # param 5 = the c compiler
# param 6 = the c++ flags to the compiler # param 6 = the c++ flags to the compiler
# param 7 = the c++ compiler # param 7 = the c++ compiler
# param 8 = the flags to the assembler # param 8 = the objc compiler
# param 9 = the flags to the assembler
ifneq (,$$(filter %.c,$2)) ifneq (,$$(filter %.c,$2))
# Compile as a C file # Compile as a C file
@ -70,25 +81,27 @@ define add_native_source
else ifneq (,$$(filter %.m,$2)) else ifneq (,$$(filter %.m,$2))
# Compile as a objective-c file # Compile as a objective-c file
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c $1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$5 $1_$2_COMP=$8
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS) $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
else ifneq (,$$(filter %.s,$2)) else ifneq (,$$(filter %.s,$2))
# Compile as assembler file # Compile as assembler file
$1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"' $1_$2_FLAGS=$9 -DTHIS_FILE='"$$(<F)"'
$1_$2_COMP=$(AS) $1_$2_COMP=$(AS)
$1_$2_DEP_FLAG:= $1_$2_DEP_FLAG:=
else else ifneq (,$$(filter %.cpp,$2)$$(filter %.mm,$2))
# Compile as a C++ file # Compile as a C++ file
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c $1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$7 $1_$2_COMP=$7
$1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS) $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
else
$$(error Internal error in NativeCompilation.gmk: no compiler for file $2)
endif endif
# Generate the .o (.obj) file name and place it in the bin dir. # Generate the .o (.obj) file name and place it in the bin dir.
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $2))))) $1_$2_OBJ := $3/$$(call replace_with_obj_extension, $$(notdir $2))
# Only continue if this object file hasn't been processed already. This lets the first found # Only continue if this object file hasn't been processed already. This lets the first found
# source file override any other with the same name. # source file override any other with the same name.
ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR))) ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_ALL_OBJS)))
$1_OBJS_SO_FAR+=$$($1_$2_OBJ) $1_ALL_OBJS+=$$($1_$2_OBJ)
ifeq (,$$(filter %.s,$2)) ifeq (,$$(filter %.s,$2))
# And this is the dependency file for this obj file. # And this is the dependency file for this obj file.
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ)) $1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
@ -101,9 +114,9 @@ define add_native_source
endif endif
endif endif
$$($1_$2_OBJ) : $2 $$($1_$2_OBJ) : $2 | $$($1_BUILD_INFO)
$(ECHO) $(LOG_INFO) "Compiling $$(notdir $2) (for $$(notdir $$($1_TARGET)))"
ifneq ($(TOOLCHAIN_TYPE), microsoft) ifneq ($(TOOLCHAIN_TYPE), microsoft)
$$(call COMPILING_MSG,$2,$$($1_TARGET))
# The Solaris studio compiler doesn't output the full path to the object file in the # The Solaris studio compiler doesn't output the full path to the object file in the
# generated deps files. Fixing it with sed. If compiling assembly, don't try this. # generated deps files. Fixing it with sed. If compiling assembly, don't try this.
ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio) ifeq ($(TOOLCHAIN_TYPE)$$(filter %.s,$2), solstudio)
@ -119,24 +132,22 @@ define add_native_source
ifeq ($(TOOLCHAIN_TYPE), microsoft) ifeq ($(TOOLCHAIN_TYPE), microsoft)
($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \ ($$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
$(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \ $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 ; echo $$$$? > $$($1_$2_DEP).exitvalue) \
| $(TEE) $$($1_$2_DEP).raw | $(GREP) -v "^Note: including file:" \ | $(TEE) $$($1_$2_DEP).raw | $(GREP) -v -e "^Note: including file:" \
&& exit `cat $$($1_$2_DEP).exitvalue` -e "^$(notdir $2)$$$$" ; exit `cat $$($1_$2_DEP).exitvalue`
$(RM) $$($1_$2_DEP).exitvalue $(RM) $$($1_$2_DEP).exitvalue
($(ECHO) $$@: \\ \ ($(ECHO) $$@: \\ \
&& $(SED) -e '/^Note: including file:/!d' \ && $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_DEP).raw) > $$($1_$2_DEP)
-e 's|Note: including file: *||' \
-e 's|\\|/|g' \
-e 's|^\([a-zA-Z]\):|$(UNIX_PATH_PREFIX)/\1|g' \
-e '/$(subst /,\/,$(TOPDIR))/!d' \
-e 's|$$$$| \\|g' \
$$($1_$2_DEP).raw) > $$($1_$2_DEP)
endif endif
endif endif
endef endef
define SetupNativeCompilation # Setup make rules for creating a native binary (a shared library or an
# param 1 is for example BUILD_MYPACKAGE # executable).
# param 2,3,4,5,6,7,8 are named args. #
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# SRC one or more directory roots to scan for C/C++ files. # SRC one or more directory roots to scan for C/C++ files.
# LANG C or C++ # LANG C or C++
# CFLAGS the compiler flags to be used, used both for C and C++. # CFLAGS the compiler flags to be used, used both for C and C++.
@ -152,6 +163,7 @@ define SetupNativeCompilation
# EXCLUDES do not pick source from these directories # EXCLUDES do not pick source from these directories
# INCLUDE_FILES only compile exactly these files! # INCLUDE_FILES only compile exactly these files!
# EXCLUDE_FILES with these names # EXCLUDE_FILES with these names
# EXTRA_FILES List of extra files not in any of the SRC dirs
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run # VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
# RC_FLAGS flags for RC. # RC_FLAGS flags for RC.
# MAPFILE mapfile # MAPFILE mapfile
@ -160,6 +172,12 @@ define SetupNativeCompilation
# CC the compiler to use, default is $(CC) # CC the compiler to use, default is $(CC)
# LDEXE the linker to use for linking executables, default is $(LDEXE) # LDEXE the linker to use for linking executables, default is $(LDEXE)
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST # OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
define SetupNativeCompilation
$(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
$(call EvalDebugWrapper,$(strip $1),$(call SetupNativeCompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)))
endef
define SetupNativeCompilationInner
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26)) $(call LogSetupMacroEntry,SetupNativeCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15),$(16),$(17),$(18),$(19),$(20),$(21),$(22),$(23),$(24),$(25),$(26))
$(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) $(if $(27),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
@ -193,7 +211,11 @@ define SetupNativeCompilation
$$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX)) $$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
endif endif
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$(SHARED_LIBRARY_SUFFIX) ifeq ($$($1_SUFFIX), )
$1_SUFFIX := $(SHARED_LIBRARY_SUFFIX)
endif
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$$($1_SUFFIX)
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
$1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_LIBRARY) $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_LIBRARY)
endif endif
@ -215,7 +237,11 @@ define SetupNativeCompilation
$$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX)) $$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
endif endif
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$(STATIC_LIBRARY_SUFFIX) ifeq ($$($1_SUFFIX), )
$1_SUFFIX := $(STATIC_LIBRARY_SUFFIX)
endif
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$$($1_SUFFIX)
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
$1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY) $1_NOSUFFIX:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)
endif endif
@ -233,7 +259,11 @@ define SetupNativeCompilation
$$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX)) $$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
endif endif
$1_BASENAME:=$$($1_PROGRAM)$(EXE_SUFFIX) ifeq ($$($1_SUFFIX), )
$1_SUFFIX := $(EXE_SUFFIX)
endif
$1_BASENAME:=$$($1_PROGRAM)$$($1_SUFFIX)
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME) $1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
$1_NOSUFFIX:=$$($1_PROGRAM) $1_NOSUFFIX:=$$($1_PROGRAM)
endif endif
@ -249,11 +279,17 @@ define SetupNativeCompilation
ifeq ($$($1_LDEXE),) ifeq ($$($1_LDEXE),)
$1_LDEXE:=$(LDEXE) $1_LDEXE:=$(LDEXE)
endif endif
ifeq ($$($1_LD),)
$1_LD:=$(LD) $1_LD:=$(LD)
endif
else else
ifeq (C++,$$($1_LANG)) ifeq (C++,$$($1_LANG))
ifeq ($$($1_LD),)
$1_LD:=$(LDCXX) $1_LD:=$(LDCXX)
endif
ifeq ($$($1_LDEXE),)
$1_LDEXE:=$(LDEXECXX) $1_LDEXE:=$(LDEXECXX)
endif
else else
$$(error Unknown native language $$($1_LANG) for $1) $$(error Unknown native language $$($1_LANG) for $1)
endif endif
@ -262,6 +298,12 @@ define SetupNativeCompilation
ifeq ($$($1_CC),) ifeq ($$($1_CC),)
$1_CC:=$(CC) $1_CC:=$(CC)
endif endif
ifeq ($$($1_CXX),)
$1_CXX:=$(CXX)
endif
ifeq ($$($1_OBJC),)
$1_OBJC:=$(OBJC)
endif
# Make sure the dirs exist. # Make sure the dirs exist.
$$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))) $$(eval $$(call MakeDir,$$($1_OBJECT_DIR) $$($1_OUTPUT_DIR)))
@ -275,7 +317,7 @@ define SetupNativeCompilation
ifneq ($$($1_EXCLUDE_FILES),) ifneq ($$($1_EXCLUDE_FILES),)
$1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES)) $1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
endif endif
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.s %.c %.cpp %.m,$$($1_ALL_SRCS))) $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter $$(NATIVE_SOURCE_EXTENSIONS),$$($1_ALL_SRCS)))
ifneq (,$$(strip $$($1_INCLUDE_FILES))) ifneq (,$$(strip $$($1_INCLUDE_FILES)))
$1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS)) $1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
endif endif
@ -298,9 +340,12 @@ define SetupNativeCompilation
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) $1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
endif endif
$1_SRCS += $$($1_EXTRA_FILES)
# Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides # Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
# a reproducable order on the input files to the linker). # a reproducable order on the input files to the linker).
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))) $1_EXPECTED_OBJS_FILENAMES := $$(call replace_with_obj_extension, $$(notdir $$($1_SRCS)))
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$($1_EXPECTED_OBJS_FILENAMES)))
# Are there too many object files on disk? Perhaps because some source file was removed? # Are there too many object files on disk? Perhaps because some source file was removed?
$1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS))) $1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
# Clean out the superfluous object files. # Clean out the superfluous object files.
@ -308,33 +353,33 @@ define SetupNativeCompilation
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS)) $$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
endif endif
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS. # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CFLAGS.
$1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS)) $1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS))
ifneq ($(DEBUG_LEVEL),release) ifneq ($(DEBUG_LEVEL),release)
# Pickup extra debug dependent variables for CFLAGS # Pickup extra debug dependent variables for CFLAGS
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug) $1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_debug) $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug) $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
else else
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_release) $1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_release) $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release) $1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
endif endif
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS. # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
$1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)) $1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
ifneq ($(DEBUG_LEVEL),release) ifneq ($(DEBUG_LEVEL),release)
# Pickup extra debug dependent variables for CXXFLAGS # Pickup extra debug dependent variables for CXXFLAGS
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_debug) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_debug)
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
else else
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_release) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_TYPE)_release)
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
endif endif
ifneq (,$$($1_DEBUG_SYMBOLS)) ifeq ($$($1_DEBUG_SYMBOLS), true)
ifeq ($(ENABLE_DEBUG_SYMBOLS), true) ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
ifdef OPENJDK ifdef OPENJDK
# Always add debug symbols # Always add debug symbols
@ -379,22 +424,38 @@ define SetupNativeCompilation
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
endif endif
# Add sys root specific cflags last $1_BUILD_INFO := $$($1_OBJECT_DIR)/_build-info.marker
$1_EXTRA_CFLAGS += $(SYSROOT_CFLAGS)
$1_EXTRA_CXXFLAGS += $(SYSROOT_CFLAGS) # Setup rule for printing progress info when compiling source files.
# This is a rough heuristic and may not always print accurate information.
$$($1_BUILD_INFO): $$($1_SRCS)
ifeq ($$(wildcard $$($1_TARGET)),)
$(ECHO) 'Creating $$($1_BASENAME) from $$(words $$?) file(s)'
else
$(ECHO) 'Updating $$($1_BASENAME) from $$(words $$?) file(s)'
endif
$(TOUCH) $$@
# Now call add_native_source for each source file we are going to compile. # Now call add_native_source for each source file we are going to compile.
$$(foreach p,$$($1_SRCS), \ $$(foreach p,$$($1_SRCS), \
$$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \ $$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR), \
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC), \ $(SYSROOT_CFLAGS) $$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC), \
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS)))) $(SYSROOT_CFLAGS) $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$$($1_CXX),$$($1_OBJC),$$($1_ASFLAGS))))
# On windows we need to create a resource file # On windows we need to create a resource file
ifeq ($(OPENJDK_TARGET_OS), windows) ifeq ($(OPENJDK_TARGET_OS), windows)
ifneq (,$$($1_VERSIONINFO_RESOURCE)) ifneq (,$$($1_VERSIONINFO_RESOURCE))
$1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
$1_RES_DEP:=$$($1_RES).d
-include $$($1_RES_DEP)
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES): $$($1_VERSIONINFO_RESOURCE)
$(ECHO) $(LOG_INFO) "Compiling resource $$(notdir $$($1_VERSIONINFO_RESOURCE)) (for $$(notdir $$($1_TARGET)))"
$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE) $(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
# Windows RC compiler does not support -showIncludes, so we mis-use CL for this.
$(CC) $$($1_RC_FLAGS) -showIncludes -nologo -TC \
$(CC_OUT_OPTION)$$($1_RES_DEP).obj $$($1_VERSIONINFO_RESOURCE) > $$($1_RES_DEP).raw 2>&1 || exit 0
($(ECHO) $$($1_RES): \\ \
&& $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_RES_DEP).raw) > $$($1_RES_DEP)
endif endif
ifneq (,$$($1_MANIFEST)) ifneq (,$$($1_MANIFEST))
$1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest $1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
@ -420,20 +481,18 @@ define SetupNativeCompilation
endif endif
endif endif
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables # Pickup extra OPENJDK_TARGET_OS_TYPE and/or OPENJDK_TARGET_OS dependent variables
# for LDFLAGS and LDFLAGS_SUFFIX # for LDFLAGS and LDFLAGS_SUFFIX
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS)) $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_TYPE)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
ifneq (,$$($1_REAL_MAPFILE)) ifneq (,$$($1_REAL_MAPFILE))
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE)) $1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
endif endif
$1_EXTRA_LDFLAGS += $(SYSROOT_LDFLAGS)
# Need to make sure TARGET is first on list # Need to make sure TARGET is first on list
$1 := $$($1_TARGET) $1 := $$($1_TARGET)
ifeq ($$($1_STATIC_LIBRARY),) ifeq ($$($1_STATIC_LIBRARY),)
ifneq ($$($1_DEBUG_SYMBOLS),) ifeq ($$($1_DEBUG_SYMBOLS), true)
ifeq ($(ENABLE_DEBUG_SYMBOLS), true) ifeq ($(ENABLE_DEBUG_SYMBOLS), true)
ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet ifneq ($(OPENJDK_TARGET_OS), macosx) # no MacOS X support yet
ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR)) ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR))
@ -517,7 +576,7 @@ define SetupNativeCompilation
$$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \ $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE) \
$$($1_DEBUGINFO_EXTRA_DEPS) $$($1_DEBUGINFO_EXTRA_DEPS)
$$(call LINKING_MSG,$$($1_BASENAME)) $$(call LINKING_MSG,$$($1_BASENAME))
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \ $$($1_LD) $(SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
$$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
$$($1_CREATE_DEBUGINFO_CMDS) $$($1_CREATE_DEBUGINFO_CMDS)
@ -532,7 +591,7 @@ define SetupNativeCompilation
ifneq (,$$($1_STATIC_LIBRARY)) ifneq (,$$($1_STATIC_LIBRARY))
# Generating a static library, ie object file archive. # Generating a static library, ie object file archive.
$$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES)
$$(call ARCHIVING_MSG,$$($1_LIBRARY)) $(ECHO) $(LOG_INFO) "Archiving $$($1_STATIC_LIBRARY)"
$(AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \ $(AR) $$($1_ARFLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \
$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
endif endif
@ -544,7 +603,7 @@ define SetupNativeCompilation
$$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) \ $$($1_TARGET): $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST) \
$$($1_DEBUGINFO_EXTRA_DEPS) $$($1_DEBUGINFO_EXTRA_DEPS)
$$(call LINKING_EXE_MSG,$$($1_BASENAME)) $$(call LINKING_EXE_MSG,$$($1_BASENAME))
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \ $$($1_LDEXE) $(SYSROOT_LDFLAGS) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \ $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
$$($1_EXTRA_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
ifneq (,$$($1_GEN_MANIFEST)) ifneq (,$$($1_GEN_MANIFEST))

View File

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -23,9 +23,12 @@
# questions. # questions.
# #
define SetupRMICompilation # Setup make rules for creating an RMI compilation.
# param 1 is a name for a variable to depend on. #
# param 2 and up are named args. # Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# CLASSES:=List of classes to generate stubs for # CLASSES:=List of classes to generate stubs for
# CLASSES_DIR:=Directory where to look for classes # CLASSES_DIR:=Directory where to look for classes
# STUB_CLASSES_DIR:=Directory in where to put stub classes # STUB_CLASSES_DIR:=Directory in where to put stub classes
@ -34,6 +37,12 @@ define SetupRMICompilation
# RUN_IIOP:=Set to run rmic with -iiop # RUN_IIOP:=Set to run rmic with -iiop
# RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage # RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage
# KEEP_GENERATED:=Set to keep generated sources around # KEEP_GENERATED:=Set to keep generated sources around
define SetupRMICompilation
$(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
$(call EvalDebugWrapper,$(strip $1),$(call SetupRMICompilationInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
endef
define SetupRMICompilationInner
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE)) $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupRMICompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(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)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
@ -78,11 +87,9 @@ define SetupRMICompilation
$$($1_DEP_FILE): $$($1_CLASS_FILES) $$($1_DEP_FILE): $$($1_CLASS_FILES)
$(MKDIR) -p $$($1_STUB_CLASSES_DIR) $(MKDIR) -p $$($1_STUB_CLASSES_DIR)
if [ "x$$($1_ARGS)" != "x" ]; then \
$(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) && \ $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) && \
$(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \ $(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \ -d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \
fi;
if [ "x$$($1_ARGS2)" != "x" ]; then \ if [ "x$$($1_ARGS2)" != "x" ]; then \
$(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) && \ $(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) && \
$(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \ $(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \

View File

@ -23,15 +23,9 @@
# questions. # questions.
# #
define EvalDebugWrapper ifeq (,$(_MAKEBASE_GMK))
$(if $(DEBUG_$1), $(error You must include MakeBase.gmk prior to including TextFileProcessing.gmk)
$(info -------- <<< Begin expansion of $1) endif
$(info $2)
$(info -------- >>> End expansion of $1)
)
$2
endef
# Helper function for SetupTextFileProcessing; adds a rule for a single file # Helper function for SetupTextFileProcessing; adds a rule for a single file
# to be processed. # to be processed.
@ -52,11 +46,13 @@ define SetupSingleTextFileForProcessing
$1 += $(strip $3)/$(strip $4) $1 += $(strip $3)/$(strip $4)
endef endef
# Setup a text file for processing, in which specified markers are replaced with # Setup make rules for processing one or more text files, in which specified
# a given text, or with the contents of a given file. # markers are replaced with a given text, or with the contents of a given file.
# #
# param 1 is the name space for this setup, e.g. BUILD_VERSION_FILE # Parameter 1 is the name of the rule. This name is used as variable prefix,
# param 2, 3, .. etc are named args: # and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# SOURCE_DIRS one or more directory roots to search for files to process # SOURCE_DIRS one or more directory roots to search for files to process
# SOURCE_FILES complete paths to one or more files to process # SOURCE_FILES complete paths to one or more files to process
# OUTPUT_DIR the directory where we store the processed files. # OUTPUT_DIR the directory where we store the processed files.
@ -77,9 +73,9 @@ endef
# REPLACEMENTS one or more text replacement patterns, using the syntax: # REPLACEMENTS one or more text replacement patterns, using the syntax:
# PATTERN => REPLACEMENT_TEXT ; ... # PATTERN => REPLACEMENT_TEXT ; ...
# #
# At least one of INCLUDES or REPLACEMENTS must be present. If both are # If both INCLUDES or REPLACEMENTS are present, then the includes will be
# present, then the includes will be processed first, and replacements will be # processed first, and replacements will be done on the included fragments as well.
# done on the included fragments as well. # If neither is present, the files will just be copied without modifications.
# #
define SetupTextFileProcessing define SetupTextFileProcessing
$(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
@ -91,10 +87,6 @@ define SetupTextFileProcessingInner
$(call LogSetupMacroEntry,SetupTextFileProcessing($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)) $(call LogSetupMacroEntry,SetupTextFileProcessing($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 SetupTextFileProcessing, please update TextFileProcessing.gmk)) $(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
ifeq ($$($1_REPLACEMENTS)$$($1_INCLUDES),)
$$(error At least one of REPLACEMENTS or INCLUDES are required for $1)
endif
ifneq ($$($1_SOURCE_FILES),) ifneq ($$($1_SOURCE_FILES),)
ifneq ($$($1_SOURCE_DIRS),) ifneq ($$($1_SOURCE_DIRS),)
$$(error Cannot use both SOURCE_FILES and SOURCE_DIRS (in $1)) $$(error Cannot use both SOURCE_FILES and SOURCE_DIRS (in $1))
@ -106,6 +98,9 @@ define SetupTextFileProcessingInner
$$(error Cannot INCLUDE/EXCLUDE_FILES with SOURCE_FILES (in $1)) $$(error Cannot INCLUDE/EXCLUDE_FILES with SOURCE_FILES (in $1))
endif endif
else else
ifeq ($$($1_SOURCE_DIRS),)
$$(error Must specify either SOURCE_FILES or SOURCE_DIRS (in $1))
endif
# Find all files in the source trees. Sort to remove duplicates. # Find all files in the source trees. Sort to remove duplicates.
$$(foreach src, $$($1_SOURCE_DIRS), $$(if $$(wildcard $$(src)), , \ $$(foreach src, $$($1_SOURCE_DIRS), $$(if $$(wildcard $$(src)), , \
$$(error SOURCE_DIRS contains missing directory $$(src) (in $1)))) $$(error SOURCE_DIRS contains missing directory $$(src) (in $1))))
@ -167,9 +162,9 @@ define SetupTextFileProcessingInner
# Convert the REPLACEMENTS syntax ( A => B ; C => D ; ...) to a sed command # Convert the REPLACEMENTS syntax ( A => B ; C => D ; ...) to a sed command
# line (-e "s/A/B/" -e "s/C/D/" ...), basically by replacing '=>' with '/' # line (-e "s/A/B/" -e "s/C/D/" ...), basically by replacing '=>' with '/'
# and ';' with '/" -e "s/', and adjusting for edge cases. # and ';' with '/" -e "s/', and adjusting for edge cases.
$1_REPLACEMENTS_COMMAND_LINE := $(SED) -e "s$$($1_SEP)$$(subst $$(SPACE);$$(SPACE),$$($1_SEP)" \ $1_REPLACEMENTS_COMMAND_LINE := $(SED) -e 's$$($1_SEP)$$(subst $$(SPACE);$$(SPACE),$$($1_SEP)' \
-e "s$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE),$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE);$$(SPACE),//" \ -e 's$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE),$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE);$$(SPACE),$$($1_SEP)$$($1_SEP)' \
-e "s$$($1_SEP),$$(strip $$($1_REPLACEMENTS)))))$$($1_SEP)" -e 's$$($1_SEP),$$(strip $$($1_REPLACEMENTS)))))$$($1_SEP)'
else else
# We don't have any replacements, just pipe the file through cat. # We don't have any replacements, just pipe the file through cat.
$1_REPLACEMENTS_COMMAND_LINE := $(CAT) $1_REPLACEMENTS_COMMAND_LINE := $(CAT)
@ -208,7 +203,7 @@ define SetupTextFileProcessingInner
# Note that $1 is space sensitive and must disobey whitespace rules # Note that $1 is space sensitive and must disobey whitespace rules
$$(eval $$(call SetupSingleTextFileForProcessing,$1, $$($1_SOURCE_FILES), \ $$(eval $$(call SetupSingleTextFileForProcessing,$1, $$($1_SOURCE_FILES), \
$$(dir $$($1_OUTPUT_FILE)), $$(notdir $$($1_OUTPUT_FILE)))) $$(patsubst %/, %, $$(dir $$($1_OUTPUT_FILE))), $$(notdir $$($1_OUTPUT_FILE))))
else else
ifeq ($$($1_OUTPUT_DIR),) ifeq ($$($1_OUTPUT_DIR),)
$$(error Neither OUTPUT_FILE nor OUTPUT_DIR was specified (in $1)) $$(error Neither OUTPUT_FILE nor OUTPUT_DIR was specified (in $1))
@ -221,14 +216,15 @@ define SetupTextFileProcessingInner
# rules. # rules.
$$(foreach src, $$($1_SOURCE_FILES), \ $$(foreach src, $$($1_SOURCE_FILES), \
$$(eval $$(call SetupSingleTextFileForProcessing,$1, $$(src), \ $$(eval $$(call SetupSingleTextFileForProcessing,$1, $$(src), \
$$($1_OUTPUT_DIR), $$(notdir $$(src))))) $$(patsubst %/, %, $$($1_OUTPUT_DIR)), $$(notdir $$(src)))))
else else
# With a base dir, extract the relative portion of the path. Note that $1 # With a base dir, extract the relative portion of the path. Note that $1
# is space sensitive and must disobey whitespace rules, and so is the # is space sensitive and must disobey whitespace rules, and so is the
# arguments to patsubst. # arguments to patsubst.
$$(foreach src, $$($1_SOURCE_FILES), \ $$(foreach src, $$($1_SOURCE_FILES), \
$$(eval $$(call SetupSingleTextFileForProcessing,$1, $$(src), \ $$(eval $$(call SetupSingleTextFileForProcessing,$1, $$(src), \
$$($1_OUTPUT_DIR), $$(patsubst $$($1_SOURCE_BASE_DIR)/%,%,$$(src))))) $$(patsubst %/, %, $$($1_OUTPUT_DIR)), \
$$(patsubst $$($1_SOURCE_BASE_DIR)/%,%,$$(src)))))
endif endif
endif endif
endef endef

122
make/common/ZipArchive.gmk Normal file
View File

@ -0,0 +1,122 @@
#
# Copyright (c) 2011, 2014, 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.
#
ifndef _ZIP_ARCHIVE_GMK
_ZIP_ARCHIVE_GMK := 1
ifeq (,$(_MAKEBASE_GMK))
$(error You must include MakeBase.gmk prior to including ZipArchive.gmk)
endif
# Setup make rules for creating a zip archive.
#
# Parameter 1 is the name of the rule. This name is used as variable prefix,
# and the targets generated are listed in a variable by that name.
#
# Remaining parameters are named arguments. These include:
# SRC
# ZIP
# INCLUDES
# INCLUDE_FILES
# EXCLUDES
# EXCLUDE_FILES
# SUFFIXES
# EXTRA_DEPS
# ZIP_OPTIONS extra options to pass to zip
define SetupZipArchive
$(if $(16),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update ZipArchive.gmk))
$(call EvalDebugWrapper,$(strip $1),$(call SetupZipArchiveInner,$(strip $1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15)))
endef
define SetupZipArchiveInner
$(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $(strip $($i)),$1_$(strip $($i)))$(NEWLINE))
$(call LogSetupMacroEntry,SetupZipArchive($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 SetupZipArchive, please update JavaCompilation.gmk))
# To avoid running find over too large sets of files, which causes make to crash
# on some configurations (cygwin), use INCLUDES and INCLUDE_FILES to build a set
# of directories to run find in, if available.
ifneq ($$($1_INCLUDES)$$($1_INCLUDE_FILES),)
$1_FIND_LIST := $$(wildcard $$(foreach i,$$($1_SRC), \
$$(addprefix $$i/,$$($1_INCLUDES) $$($1_INCLUDE_FILES))))
else
$1_FIND_LIST := $$($1_SRC)
endif
# Find all files in the source tree.
$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),)
$1_ZIP_INCLUDES := $$(foreach s,$$($1_SUFFIXES), \
$$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$$s$(DQUOTE),$$($1_INCLUDES))))
else
$1_ZIP_INCLUDES := $$(addprefix -i$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_INCLUDES)))
endif
endif
ifneq ($$($1_INCLUDE_FILES),)
$1_ZIP_INCLUDES += $$(addprefix -i$(SPACE),$$($1_INCLUDE_FILES))
endif
ifneq ($$($1_EXCLUDES),)
$1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_SRCS))
endif
ifneq ($$($1_EXCLUDE_FILES),)
# Cannot precompute ZIP_EXCLUDE_FILES as it is dependent on which src root is being
# zipped at the moment.
$1_SRC_EXCLUDE_FILES := $$(addprefix %, $$($1_EXCLUDE_FILES)) $$($1_EXCLUDE_FILES)
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDE_FILES), $$($1_ALL_SRCS))
endif
# Use a slightly shorter name for logging, but with enough path to identify this zip.
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_ZIP))
# Now $1_ALL_SRCS should contain all sources that are going to be put into the zip.
# I.e. the zip -i and -x options should match the filtering done in the makefile.
# Explicitly excluded files can be given with absolute path. The patsubst solution
# isn't perfect but the likelyhood of an absolute path to match something in a src
# dir is very small.
# If zip has nothing to do, it returns 12 and would fail the build. Check for 12
# and only fail if it's not.
$$($1_ZIP) : $$($1_ALL_SRCS) $$($1_EXTRA_DEPS)
$(MKDIR) -p $$(@D)
$(ECHO) Updating $$($1_NAME)
$$(foreach i,$$($1_SRC),(cd $$i && $(ZIP) -qru $$($1_ZIP_OPTIONS) $$@ . $$($1_ZIP_INCLUDES) \
$$($1_ZIP_EXCLUDES) -x \*_the.\* \
$$(addprefix -x$(SPACE), $$(patsubst $$i/%,%, $$($1_EXCLUDE_FILES))) \
|| test "$$$$?" = "12" )$$(NEWLINE)) true
$(TOUCH) $$@
# Add zip to target list
$1 += $$($1_ZIP)
endef
endif # _ZIP_ARCHIVE_GMK

View File

@ -50,14 +50,18 @@ jprt.build.flavor.debugOpen.target=jprt_bundle
jprt.build.flavor.fastdebug.target=jprt_bundle jprt.build.flavor.fastdebug.target=jprt_bundle
jprt.build.flavor.product.target=jprt_bundle jprt.build.flavor.product.target=jprt_bundle
jprt.build.flavor.productOpen.target=jprt_bundle jprt.build.flavor.productOpen.target=jprt_bundle
jprt.build.flavor.optimized.target=jprt_bundle
jprt.build.flavor.optimizedOpen.target=jprt_bundle
# Use these configure args to define debug level # Use these configure args to define debug level
jprt.debug.build.configure.args=--with-debug-level=slowdebug jprt.debug.build.configure.args=--with-debug-level=slowdebug
jprt.fastdebug.build.configure.args=--with-debug-level=fastdebug jprt.fastdebug.build.configure.args=--with-debug-level=fastdebug
jprt.product.build.configure.args=--with-debug-level=release jprt.product.build.configure.args=--with-debug-level=release
jprt.optimized.build.configure.args=--with-debug-level=optimized
jprt.debugOpen.build.configure.args=${jprt.debug.build.configure.args} --enable-openjdk-only jprt.debugOpen.build.configure.args=${jprt.debug.build.configure.args} --enable-openjdk-only
jprt.fastdebugOpen.build.configure.args=${jprt.fastdebug.build.configure.args} --enable-openjdk-only jprt.fastdebugOpen.build.configure.args=${jprt.fastdebug.build.configure.args} --enable-openjdk-only
jprt.productOpen.build.configure.args=${jprt.product.build.configure.args} --enable-openjdk-only jprt.productOpen.build.configure.args=${jprt.product.build.configure.args} --enable-openjdk-only
jprt.optimizedOpen.build.configure.args=${jprt.product.build.configure.args} --enable-openjdk-only
# Select build flavors and build targets # Select build flavors and build targets
jprt.build.flavors=${my.is.hotspot.job ? ${my.build.flavors.hotspot} : ${my.build.flavors.default}} jprt.build.flavors=${my.is.hotspot.job ? ${my.build.flavors.hotspot} : ${my.build.flavors.default}}
@ -230,18 +234,18 @@ my.make.rule.test.targets.jck= \
# The hotspot build flavors # The hotspot build flavors
my.build.flavors.hotspot= \ my.build.flavors.hotspot= \
debugOpen,fastdebug,product,productOpen, \ debugOpen,fastdebug,product,productOpen,optimized,optimizedOpen \
${my.additional.build.flavors.hotspot} ${my.additional.build.flavors.hotspot}
# Platforms built for hotspot push jobs # Platforms built for hotspot push jobs
my.build.targets.hotspot= \ my.build.targets.hotspot= \
solaris_sparcv9_5.11-{product|fastdebug|optimized}, \ solaris_sparcv9_5.11-{product|fastdebug}, \
solaris_x64_5.11-{product|fastdebug}, \ solaris_x64_5.11-{product|fastdebug}, \
linux_i586_2.6-{product|fastdebug}, \ linux_i586_2.6-{product|fastdebug}, \
linux_x64_2.6-{product|fastdebug|optimized}, \ linux_x64_2.6-{product|fastdebug}, \
macosx_x64_10.7-{product|fastdebug}, \ macosx_x64_10.7-{product|fastdebug}, \
windows_i586_6.1-{product|fastdebug}, \ windows_i586_6.1-{product|fastdebug}, \
windows_x64_6.1-{product|fastdebug|optimized}, \ windows_x64_6.1-{product|fastdebug}, \
solaris_x64_5.11-{debugOpen}, \ solaris_x64_5.11-{debugOpen}, \
linux_x64_2.6-{productOpen}, \ linux_x64_2.6-{productOpen}, \
${my.additional.build.targets.hotspot} ${my.additional.build.targets.hotspot}
@ -491,4 +495,5 @@ my.make.rule.test.targets.hotspot= \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime_closed}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_runtime_closed}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_serviceability}, \ ${my.make.rule.test.targets.hotspot.reg.group:GROUP=hotspot_serviceability}, \
${my.make.rule.test.targets.hotspot.reg.group:GROUP=jdk_svc_sanity}, \
${my.additional.make.rule.test.targets.hotspot} ${my.additional.make.rule.test.targets.hotspot}

View File

@ -204,5 +204,3 @@ sub usage {
print "Examples:\n"; print "Examples:\n";
print " normalizer.pl -e c,cpp,h,hpp .\n"; print " normalizer.pl -e c,cpp,h,hpp .\n";
} }

View File

@ -196,4 +196,3 @@ fi
# Cleanup # Cleanup
rm -f -r ${tmp} rm -f -r ${tmp}
exit 0 exit 0