提交 9b22b45f 编写于 作者: I ihse

8065914: Various improvements and cleanup of build system

Reviewed-by: erikj
上级 70ff25f3
......@@ -33,7 +33,7 @@ default:
# 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.
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.
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
......@@ -46,7 +46,17 @@ ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
else
makefile_path:=$(lastword $(MAKEFILE_LIST))
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
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
# and call the real Main.gmk.
include $(SPEC)
include $(SRC_ROOT)/make/common/MakeBase.gmk
### Clean up from previous run
# Remove any build.log from a previous run, if they exist
......
......@@ -268,7 +268,7 @@ AC_DEFUN([BASIC_CHECK_LEFTOVER_OVERRIDDEN],
fi
])
# Setup a tool for the given variable. If correctly specified by the user,
# Setup a tool for the given variable. If correctly specified by the user,
# use that value, otherwise search for the tool using the supplied code snippet.
# $1: variable to set
# $2: code snippet to call to look for the tool
......@@ -546,7 +546,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
XCODEBUILD=
AC_SUBST(XCODEBUILD)
fi
AC_MSG_CHECKING([for sdk name])
AC_ARG_WITH([sdk-name], [AS_HELP_STRING([--with-sdk-name],
[use the platform SDK of the given name. @<:@macosx@:>@])],
......
......@@ -24,31 +24,31 @@
#
########################################################################
# This file handles detection of the Boot JDK. The Boot JDK detection
# process has been developed as a response to solve a complex real-world
# problem. Initially, it was simple, but it has grown as platform after
# This file handles detection of the Boot JDK. The Boot JDK detection
# process has been developed as a response to solve a complex real-world
# problem. Initially, it was simple, but it has grown as platform after
# platform, idiosyncracy after idiosyncracy has been supported.
#
# The basic idea is this:
# 1) You need an acceptable *) JDK to use as a Boot JDK
# 2) There are several ways to locate a JDK, that are mostly platform
# 2) There are several ways to locate a JDK, that are mostly platform
# dependent **)
# 3) You can have multiple JDKs installed
# 4) If possible, configure should try to dig out an acceptable JDK
# 4) If possible, configure should try to dig out an acceptable JDK
# automatically, without having to resort to command-line options
#
# *) acceptable means e.g. JDK7 for building JDK8, a complete JDK (with
# javac) and not a JRE, etc.
# *) acceptable means e.g. JDK7 for building JDK8, a complete JDK (with
# javac) and not a JRE, etc.
#
# **) On Windows we typically use a well-known path.
# **) On Windows we typically use a well-known path.
# On MacOSX we typically use the tool java_home.
# On Linux we typically find javac in the $PATH, and then follow a
# chain of symlinks that often ends up in a real JDK.
# On Linux we typically find javac in the $PATH, and then follow a
# chain of symlinks that often ends up in a real JDK.
#
# This leads to the code where we check in different ways to locate a
# JDK, and if one is found, check if it is acceptable. If not, we print
# our reasons for rejecting it (useful when debugging non-working
# configure situations) and continue checking the next one.
# This leads to the code where we check in different ways to locate a
# JDK, and if one is found, check if it is acceptable. If not, we print
# our reasons for rejecting it (useful when debugging non-working
# configure situations) and continue checking the next one.
########################################################################
# Execute the check given as argument, and verify the result
......@@ -244,7 +244,7 @@ AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS],
AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK],
[
# Use user overridden value if available, otherwise locate tool in the Boot JDK.
BASIC_SETUP_TOOL($1,
BASIC_SETUP_TOOL($1,
[
AC_MSG_CHECKING([for $2 in Boot JDK])
$1=$BOOT_JDK/bin/$2
......
......@@ -57,4 +57,3 @@ JAR_CMD:=$(BOOT_JDK)/bin/jar
NATIVE2ASCII_CMD:=$(BOOT_JDK)/bin/native2ascii
JARSIGNER_CMD:=$(BOOT_JDK)/bin/jarsigner
SJAVAC_SERVER_JAVA_CMD:=$(JAVA_CMD)
......@@ -77,7 +77,7 @@ if test $? = 0; then
fi
# Test and fix little endian PowerPC64.
# TODO: should be handled by autoconf-config.guess.
# TODO: should be handled by autoconf-config.guess.
if [ "x$OUT" = x ]; then
if [ `uname -m` = ppc64le ]; then
if [ `uname -s` = Linux ]; then
......
#!/bin/sh
echo >&2 "No suitable 'install' command found.'"
echo >&2 "If automake is installed, running 'automake -fa'"
echo >&2 "(and ignoring the errors) might produce one."
exit 1
#!/bin/sh
echo >&2 "No suitable 'install' command found.'"
echo >&2 "If automake is installed, running 'automake -fa'"
echo >&2 "(and ignoring the errors) might produce one."
exit 1
......@@ -47,6 +47,7 @@ FIND="@FIND@"
GREP="@GREP@"
JAVAP="@FIXPATH@ @BOOT_JDK@/bin/javap @JAVA_TOOL_FLAGS_SMALL@"
LDD="@LDD@"
LN="@LN@"
MKDIR="@MKDIR@"
NAWK="@NAWK@"
NM="@GNM@"
......
......@@ -4331,7 +4331,7 @@ TOOLCHAIN_DESCRIPTION_xlc="IBM XL C/C++"
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1417016445
DATE_WHEN_GENERATED=1417099232
###############################################################################
#
......@@ -355,7 +355,7 @@ AC_DEFUN([LIB_CHECK_POTENTIAL_FREETYPE],
FOUND_FREETYPE=no
fi
fi
if test "x$FOUND_FREETYPE" = xyes; then
# Include file found, let's continue the sanity check.
AC_MSG_NOTICE([Found freetype include files at $POTENTIAL_FREETYPE_INCLUDE_PATH using $METHOD])
......
......@@ -456,7 +456,7 @@ JAVA_FLAGS_SMALL:=@JAVA_FLAGS_SMALL@
JAVA_TOOL_FLAGS_SMALL:=@JAVA_TOOL_FLAGS_SMALL@
SJAVAC_SERVER_JAVA_FLAGS:=@SJAVAC_SERVER_JAVA_FLAGS@
# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
# The *_CMD variables are defined separately to be easily overridden in bootcycle-spec.gmk
# for bootcycle-images build. Make sure to keep them in sync. Do not use the *_CMD
# versions of the variables directly.
JAVA_CMD:=@JAVA@
......@@ -713,7 +713,7 @@ JRE_BUNDLE_DIR=$(IMAGES_OUTPUTDIR)/$(JRE_BUNDLE_SUBDIR)
# This macro is called to allow inclusion of closed source counterparts.
# Unless overridden in closed sources, it expands to nothing.
# Usage: This function is called in an open makefile, with the following
# Usage: This function is called in an open makefile, with the following
# arguments:
# $1 the name of the repo, or empty if the top-level repo.
# $2 the name of the makefile
......
......@@ -248,7 +248,7 @@ AC_DEFUN([TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL],
METHOD="$2"
if test -e "$POSSIBLE_MSVCR_DLL"; then
AC_MSG_NOTICE([Found msvcr100.dll at $POSSIBLE_MSVCR_DLL using $METHOD])
# Need to check if the found msvcr is correct architecture
AC_MSG_CHECKING([found msvcr100.dll architecture])
MSVCR_DLL_FILETYPE=`$FILE -b "$POSSIBLE_MSVCR_DLL"`
......@@ -291,7 +291,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
AC_MSG_ERROR([Could not find a proper msvcr100.dll as specified by --with-msvcr-dll])
fi
fi
if test "x$MSVCR_DLL" = x; then
# Probe: Using well-known location from Visual Studio 10.0
if test "x$VCINSTALLDIR" != x; then
......@@ -311,9 +311,9 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
POSSIBLE_MSVCR_DLL="$BOOT_JDK/bin/msvcr100.dll"
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [well-known location in Boot JDK])
fi
if test "x$MSVCR_DLL" = x; then
# Probe: Look in the Windows system32 directory
# Probe: Look in the Windows system32 directory
CYGWIN_SYSTEMROOT="$SYSTEMROOT"
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(CYGWIN_SYSTEMROOT)
POSSIBLE_MSVCR_DLL="$CYGWIN_SYSTEMROOT/system32/msvcr100.dll"
......@@ -333,7 +333,7 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VS100COMNTOOLS])
fi
fi
if test "x$MSVCR_DLL" = x; then
# Probe: Search wildly in the VCINSTALLDIR. We've probably lost by now.
# (This was the original behaviour; kept since it might turn up something)
......@@ -347,11 +347,11 @@ AC_DEFUN([TOOLCHAIN_SETUP_MSVCR_DLL],
POSSIBLE_MSVCR_DLL=`$FIND "$CYGWIN_VC_INSTALL_DIR" -name msvcr100.dll | $HEAD --lines 1`
fi
fi
TOOLCHAIN_CHECK_POSSIBLE_MSVCR_DLL([$POSSIBLE_MSVCR_DLL], [search of VCINSTALLDIR])
fi
fi
if test "x$MSVCR_DLL" = x; then
AC_MSG_CHECKING([for msvcr100.dll])
AC_MSG_RESULT([no])
......
此差异已折叠。
......@@ -85,6 +85,7 @@ ACCEPTED_BIN_DIFF="
./bin/jdb
./bin/jhat
./bin/jinfo
./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
......@@ -108,6 +109,7 @@ ACCEPTED_BIN_DIFF="
./bin/wsimport
./bin/xjc
./jre/bin/java
./jre/bin/jjs
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
......@@ -172,6 +174,7 @@ ACCEPTED_BIN_DIFF="
./bin/jdb
./bin/jhat
./bin/jinfo
./bin/jjs
./bin/jmap
./bin/jps
./bin/jrunscript
......@@ -195,6 +198,7 @@ ACCEPTED_BIN_DIFF="
./bin/wsimport
./bin/xjc
./jre/bin/java
./jre/bin/jjs
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
......@@ -910,11 +914,6 @@ ACCEPTED_JARZIP_CONTENTS="
/META-INF/INDEX.LIST
"
KNOWN_BIN_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
ACCEPTED_BIN_DIFF="
./bin/appletviewer
./bin/idlj
......@@ -964,34 +963,82 @@ ACCEPTED_BIN_DIFF="
./jre/bin/tnameserv
./jre/lib/libsaproc.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/libsplashscreen.dylib
./lib/server/libjvm.dylib
./lib/deploy/JavaControlPanel.prefPane/Contents/MacOS/JavaControlPanel
"
KNOWN_SIZE_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
SORT_SYMBOLS="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
KNOWN_SYM_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
"
KNOWN_ELF_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
./Contents/Home/lib/libsaproc.dylib
./jre/lib/libsaproc.dylib
./lib/libsaproc.dylib
"
KNOWN_DIS_DIFF="
./jre/lib/libJObjC.dylib
./lib/libJObjC.dylib
ACCEPTED_SMALL_SIZE_DIFF="
./bin/javaws
./Contents/Home/bin/_javaws
"
fi
......@@ -22,10 +22,10 @@
# questions.
#
# Usage: ./logger.sh theloggfile acommand arg1 arg2
# Usage: ./logger.sh theloggfile acommand arg1 arg2
#
# Execute acommand with args, in such a way that
# both stdout and stderr from acommand are appended to
# both stdout and stderr from acommand are appended to
# theloggfile.
#
# Preserve stdout and stderr, so that the stdout
......
......@@ -26,12 +26,12 @@
#
# This shell script is supposed to be set as a replacement for SHELL in make,
# causing it to be called whenever make wants to execute shell commands.
# The <shell command line> is suitable for passing on to the old shell,
# The <shell command line> is suitable for passing on to the old shell,
# typically beginning with -c.
#
# This script will make sure the shell command line is executed with
# This script will make sure the shell command line is executed with
# OLD_SHELL -x, and it will also store a simple log of the the time it takes to
# execute the command in the OUTPUT_FILE, using the "time" utility as pointed
# execute the command in the OUTPUT_FILE, using the "time" utility as pointed
# to by TIME_CMD. If TIME_CMD is "-", no timestamp will be stored.
TIME_CMD="$1"
......
......@@ -171,7 +171,7 @@ checkErrors
) 2>&1 | tee ${t3}.build.txt
checkErrors
# Compare old build to build-infra build
# Compare old build to build-infra build
( \
sh ${t0}/common/bin/compareimage.sh \
${t3}/build/*/j2sdk-image \
......@@ -181,4 +181,3 @@ checkErrors
checkErrors
exit 0
......@@ -80,7 +80,7 @@ for r in $repos ; do
if [ $repo = "$r" ] ; then
found="true"
break;
fi
fi
done
if [ $found = "false" ] ; then
echo "ERROR: Unknown repo: $repo. Should be one of [$repos]." >&2
......@@ -200,4 +200,3 @@ do
printf "%s\n" "$line" >> $output
fi
done < "$input"
......@@ -321,7 +321,7 @@ jdk.compiler_COPY := javax.tools.JavaCompilerTool
################################################################################
jdk.jcmd_COPY := _options
jdk.jcmd_COPY := _options
################################################################################
......@@ -470,7 +470,7 @@ define SetupModuleCompilation
$1_DEPS := $$(call FindDepsForModule, $1)
$1_CLASSPATH := $$(addprefix $(JDK_OUTPUTDIR)/modules/,$$($1_DEPS))
# When crypto classes are prebuilt, need to look for classes already in
# When crypto classes are prebuilt, need to look for classes already in
# output dir.
ifneq ($(BUILD_CRYPTO), true)
$1_CLASSPATH += $(JDK_OUTPUTDIR)/modules/$1
......@@ -495,7 +495,7 @@ define SetupModuleCompilation
# Declare dependencies between java compilation of different modules.
# Since not all modules have been declared yet, or might be declared
# in different invocations of this file, use the macro to find the
# in different invocations of this file, use the macro to find the
# correct target file to depend on.
# Only the javac compilation actually depends on other modules so limit
# dependency declaration to that by using the *_COMPILE_TARGET variable.
......
......@@ -481,7 +481,7 @@ $(DOCLETAPI_OPTIONS_FILE):
) >> $@
# Create a file with the package names in it
$(DOCLETAPI_PACKAGES_FILE): $(call PackageDependencies,$(DOCLETAPI_PKGS))
$(DOCLETAPI_PACKAGES_FILE): $(call PackageDependencies,$(DOCLETAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(DOCLETAPI_PKGS))
......
......@@ -43,7 +43,7 @@ include $(SRC_ROOT)/make/common/Modules.gmk
include $(JDK_TOPDIR)/make/ProfileNames.gmk
# Declare ALL_TARGETS as an immediate variable. This variable is a list of all
# valid top level targets. It's used to declare them all as PHONY and to
# valid top level targets. It's used to declare them all as PHONY and to
# generate the -only targets.
ALL_TARGETS :=
......@@ -314,9 +314,9 @@ ALL_TARGETS += install
################################################################################
#
# Dependency declarations between targets.
# Dependency declarations between targets.
#
# These are declared in two groups. First all dependencies between targets that
# These are declared in two groups. First all dependencies between targets that
# have recipes above as these dependencies may be disabled. Then the aggregator
# targets that do not have recipes of their own, which will never have their
# dependencies disabled.
......@@ -324,10 +324,10 @@ ALL_TARGETS += install
################################################################################
# Targets with recipes above
# If running an *-only target, parallel execution and dependencies between
# recipe targets are disabled. This makes it possible to run a select set of
# If running an *-only target, parallel execution and dependencies between
# recipe targets are disabled. This makes it possible to run a select set of
# recipe targets in order. It's the responsibility of the user to make sure
# all prerequisites are fulfilled.
# all prerequisites are fulfilled.
ifneq ($(findstring -only, $(MAKECMDGOALS)), )
.NOTPARALLEL:
else
......@@ -376,11 +376,11 @@ else
# Declare dependencies from all other <module>-lib to java.base-lib
$(foreach t, $(filter-out java.base-libs, $(LIB_TARGETS)), \
$(eval $t: java.base-libs))
# Declare the special case dependency for jdk.deploy.osx where libosx
# Declare the special case dependency for jdk.deploy.osx where libosx
# links against libosxapp.
jdk.deploy.osx-libs: java.desktop-libs
# This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
# This dependency needs to be explicitly declared. jdk.jdi-gensrc generates a
# header file used by jdk.jdwp libs.
jdk.jdwp.agent-libs: jdk.jdi-gensrc
......@@ -493,7 +493,7 @@ ALL_TARGETS += default all
# Clean targets
#
################################################################################
# Clean targets are automatically run serially by the Makefile calling this
# Clean targets are automatically run serially by the Makefile calling this
# file.
CLEAN_COMPONENTS += langtools corba hotspot jdk nashorn images \
......@@ -529,8 +529,8 @@ ALL_TARGETS += clean dist-clean $(CLEAN_TARGETS)
################################################################################
# Setup a rule for SPEC file that fails if executed. This check makes sure the
# configuration is up to date after changes to configure.
# Setup a rule for SPEC file that fails if executed. This check makes sure the
# configuration is up to date after changes to configure.
ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
$(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
@$(ECHO) "ERROR: $(SPEC) is not up to date."
......
......@@ -228,25 +228,26 @@ define ParseConfAndSpec
# If we only have global targets, no need to bother with SPEC or CONF
ifneq ($$(origin SPEC),undefined)
# 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)
# 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.
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))
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
else
# Find all spec.gmk files in the build output directory
output_dir=$$(root_dir)/build
all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk)
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))
endif
# 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))))
endif
ifeq ($$(matching_confs),)
$$(info No configurations found matching CONF=$$(CONF))
$$(info Available configurations:)
$$(info Error: No configurations found matching CONF=$$(CONF).)
$$(info Available configurations in $$(output_dir):)
$$(foreach var,$$(all_confs),$$(info * $$(var)))
$$(eval $$(call FatalError))
else
ifeq ($$(words $$(matching_confs)),1)
$$(info Building '$$(matching_confs)' (matching CONF=$$(CONF)))
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)))
endif
endif
......@@ -280,10 +281,10 @@ define ParseConfAndSpec
else
# No CONF or SPEC given, check the available configurations
ifneq ($$(words $$(all_spec_files)),1)
$$(info No CONF given, but more than one configuration found in $$(output_dir).)
$$(info Available configurations:)
$$(info Error: No CONF given, but more than one configuration found.)
$$(info Available configurations in $$(output_dir):)
$$(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))
endif
......
......@@ -166,7 +166,7 @@ define SetupArchiveInner
ifneq (,$2)
$1_DEPS:=$2
else
# Add all source roots to the find cache since we are likely going to run find
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(eval $$(call FillCacheFind, $$($1_FIND_LIST)))
$1_DEPS:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
......@@ -336,7 +336,7 @@ endef
#
# The sed expression does this:
# 1. Add a backslash before any :, = or ! that do not have a backslash already.
# 2. Apply the file unicode2x.sed which does a whole bunch of \u00XX to \xXX
# 2. Apply the file unicode2x.sed which does a whole bunch of \u00XX to \xXX
# conversions.
# 3. Delete all lines starting with #.
# 4. Delete empty lines.
......@@ -345,7 +345,7 @@ endef
# as sed on macosx does not understand '\t'.
# 7. Replace the first \= with just =.
# 8. Finally it's all sorted to create a stable output.
#
#
# It is assumed that = is the character used for separating names and values.
define add_file_to_clean
# param 1 = BUILD_MYPACKAGE
......@@ -431,7 +431,7 @@ define SetupJavaCompilationInner
# Make sure the dirs exist.
$$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d)))
$$(eval $$(call MakeDir,$$($1_BIN)))
# Add all source roots to the find cache since we are likely going to run find
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(eval $$(call FillCacheFind,$$($1_SRC)))
# Find all files in the source trees. Preserve order of source roots for overrides to
......
......@@ -405,7 +405,7 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
# 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.
define install-file
$(MKDIR) -p $(@D)
$(MKDIR) -p '$(@D)'
$(RM) '$@'
if [ "$(@D)" != "$(<D)" ]; then \
$(CP) -f -r -P '$<' '$(@D)'; \
......@@ -427,7 +427,7 @@ else ifeq ($(OPENJDK_TARGET_OS),macosx)
# 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.
define install-file
$(MKDIR) -p $(@D)
$(MKDIR) -p '$(@D)'
$(CP) -fRP '$<' '$@'
if [ -n "`$(XATTR) -l '$@'`" ]; then $(XATTR) -c '$@'; fi
endef
......@@ -435,7 +435,7 @@ else
# Running mkdir and cp in the same shell speeds up copy intensive tasks in Cygwin
# significantly.
define install-file
$(MKDIR) -p $(@D) && $(CP) -fP '$<' '$@'
$(MKDIR) -p '$(@D)' && $(CP) -fP '$<' '$@'
endef
endif
......
......@@ -87,11 +87,9 @@ define SetupRMICompilationInner
$$($1_DEP_FILE): $$($1_CLASS_FILES)
$(MKDIR) -p $$($1_STUB_CLASSES_DIR)
if [ "x$$($1_ARGS)" != "x" ]; then \
$(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) && \
$(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \
fi;
$(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) && \
$(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES); \
if [ "x$$($1_ARGS2)" != "x" ]; then \
$(ECHO) $(LOG_INFO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) && \
$(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \
......
......@@ -40,9 +40,9 @@ $(eval $(call SetupJavaCompiler,BOOT_JAVAC, \
JAVAC := $(JAVAC), \
FLAGS := -XDignore.symbol.file=true -g -Xlint:all$(COMMA)-deprecation -Werror))
# Any java code executed during a JDK build to build other parts of the JDK must be
# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this
# purpose must be built with -target PREVIOUS for bootstrapping purposes, which
# Any java code executed during a JDK build to build other parts of the JDK must be
# executed by the bootstrap JDK (probably with -Xbootclasspath/p: ) and for this
# purpose must be built with -target PREVIOUS for bootstrapping purposes, which
# requires restricting to language level and api of previous JDK.
#
# The generate old bytecode javac setup uses the new compiler to compile for the
......
......@@ -73,9 +73,9 @@ endef
# REPLACEMENTS one or more text replacement patterns, using the syntax:
# PATTERN => REPLACEMENT_TEXT ; ...
#
# At least one of INCLUDES or REPLACEMENTS must be present. If both are
# present, then the includes will be processed first, and replacements will be
# done on the included fragments as well.
# If both INCLUDES or REPLACEMENTS are present, then the includes will be
# processed first, and replacements will be done on the included fragments as well.
# If neither is present, the files will just be copied without modifications.
#
define SetupTextFileProcessing
$(if $(16),$(error Internal makefile error: Too many arguments to SetupTextFileProcessing, please update TextFileProcessing.gmk))
......@@ -87,10 +87,6 @@ define SetupTextFileProcessingInner
$(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))
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_DIRS),)
$$(error Cannot use both SOURCE_FILES and SOURCE_DIRS (in $1))
......@@ -102,6 +98,9 @@ define SetupTextFileProcessingInner
$$(error Cannot INCLUDE/EXCLUDE_FILES with SOURCE_FILES (in $1))
endif
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.
$$(foreach src, $$($1_SOURCE_DIRS), $$(if $$(wildcard $$(src)), , \
$$(error SOURCE_DIRS contains missing directory $$(src) (in $1))))
......@@ -154,7 +153,7 @@ define SetupTextFileProcessingInner
$1_REPLACEMENTS += ;
endif
# If we have a trailing ";", add a dummy replacement, since there is no easy
# If we have a trailing ";", add a dummy replacement, since there is no easy
# way to delete the last word in make.
ifeq ($$(lastword $$($1_REPLACEMENTS)), ;)
$1_REPLACEMENTS += DUMMY_REPLACEMENT => DUMMY_REPLACEMENT
......@@ -163,11 +162,11 @@ define SetupTextFileProcessingInner
# 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 '/'
# and ';' with '/" -e "s/', and adjusting for edge cases.
$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),$$(strip $$($1_REPLACEMENTS)))))$$($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),$$($1_SEP)$$($1_SEP)' \
-e 's$$($1_SEP),$$(strip $$($1_REPLACEMENTS)))))$$($1_SEP)'
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)
endif
......@@ -176,8 +175,8 @@ define SetupTextFileProcessingInner
# Convert an INCLUDE like this PATTERN_1 => file1 ; PATTERN_2 => file2 ;
# into an awk script fragment like this:
# {
# if (matches("PATTERN_1")) { include("file1") } else
# if (matches("PATTERN_2")) { include("file2") } else
# if (matches("PATTERN_1")) { include("file1") } else
# if (matches("PATTERN_2")) { include("file2") } else
# print
# }
......@@ -190,12 +189,12 @@ define SetupTextFileProcessingInner
$1_INCLUDES_COMMAND_LINE := $(NAWK) '$$($1_INCLUDES_HEADER_AWK) \
{ if (matches("$$($1_INCLUDES_PARTIAL_AWK)") } else print }'
else
# We don't have any includes, just pipe the file through cat.
# We don't have any includes, just pipe the file through cat.
$1_INCLUDES_COMMAND_LINE := $(CAT)
endif
# Reset target list before populating it
$1 :=
$1 :=
ifneq ($$($1_OUTPUT_FILE),)
ifneq ($$(words $$($1_SOURCE_FILES)), 1)
......@@ -204,7 +203,7 @@ define SetupTextFileProcessingInner
# Note that $1 is space sensitive and must disobey whitespace rules
$$(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
ifeq ($$($1_OUTPUT_DIR),)
$$(error Neither OUTPUT_FILE nor OUTPUT_DIR was specified (in $1))
......@@ -212,19 +211,20 @@ define SetupTextFileProcessingInner
# Now call add_native_source for each source file we are going to process.
ifeq ($$($1_SOURCE_BASE_DIR),)
# With no base dir specified, put all files in target dir, flattening any
# With no base dir specified, put all files in target dir, flattening any
# hierarchies. Note that $1 is space sensitive and must disobey whitespace
# rules.
$$(foreach src, $$($1_SOURCE_FILES), \
$$(eval $$(call SetupSingleTextFileForProcessing,$1, $$(src), \
$$($1_OUTPUT_DIR), $$(notdir $$(src)))))
$$(patsubst %/, %, $$($1_OUTPUT_DIR)), $$(notdir $$(src)))))
else
# 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
# arguments to patsubst.
$$(foreach src, $$($1_SOURCE_FILES), \
$$(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
endef
......@@ -154,7 +154,7 @@ my.make.rule.test.targets.default= \
${my.test.target.set:TESTNAME=jdk_lang}, \
${my.test.target.set:TESTNAME=jdk_math}, \
${my.test.target.set:TESTNAME=jdk_util}
# Default vm test targets (testset=core)
my.test.targets.core=
......
......@@ -32,7 +32,7 @@
if ($#ARGV < 0) {
&usage;
die;
}
......@@ -99,7 +99,7 @@ sub parse_file {
# Skip directories
return if -d;
# Skip SCCS files
return if ($filename =~ /\/SCCS\//);
......@@ -121,18 +121,18 @@ sub parse_file {
chdir $dirname;
open(FILE, $filename) or die "Failed while open $filename: $!\n";
# Read file
my @content;
my $line;
my $emptylinescount = 0;
my $modified = 0;
while ($line = <FILE>) {
my $originalline = $line;
# Process line
# Remove from the end of the line spaces and return character
while ($line =~ /\s$/) {
chop($line);
......@@ -144,16 +144,16 @@ sub parse_file {
$line = substr($line, 0, $i) . $tabvalues[7 - ($i % 8)] . substr($line, $i + 1);
}
}
if (length($line) == 0) {
$emptylinescount++;
} else {
while ($emptylinescount > 0) {
push(@content, "");
$emptylinescount--;
}
push(@content, $line);
}
......@@ -162,23 +162,23 @@ sub parse_file {
}
}
$allfiles++;
if ($emptylinescount > 0) {
$modified = 1;
}
close(FILE);
if ($modified != 0) {
# Write file
open(FILE, ">$filename") or die "Failed while open $filename: $!\n";
for (my $i = 0; $i <= $#content; $i++) {
print FILE "$content[$i]\n";
}
close(FILE);
# Print name from current dir
......@@ -204,5 +204,3 @@ sub usage {
print "Examples:\n";
print " normalizer.pl -e c,cpp,h,hpp .\n";
}
......@@ -196,4 +196,3 @@ fi
# Cleanup
rm -f -r ${tmp}
exit 0
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册