提交 90f78aa1 编写于 作者: K katleman

Merge

......@@ -108,6 +108,7 @@
<li><a href="#testing">Testing the Build</a> </li>
<li><a href="#variables">Environment/Make Variables</a></li>
<li><a href="#troubleshooting">Troubleshooting</a></li>
<li><a href="#newbuild">The New Build</a></li>
</ul>
</blockquote>
......@@ -2120,6 +2121,16 @@
</li>
</ul>
</blockquote>
<!-- ------------------------------------------------------ -->
<hr>
<h2><a name="newbuild">The New Build</a></h2>
<blockquote>
The <a href="http://openjdk.java.net/projects/build-infra/">
Build Infrastructure project</a> is working on a new
build. For information on how to try it out, please see the
<a href="http://openjdk.java.net/projects/build-infra/guide.html">
Build Infra User Guide</a>
</blockquote>
<hr>
</body>
</html>
......@@ -22,5 +22,5 @@
# questions.
#
autoconf configure.ac > configure
autoconf -W all configure.ac > configure
rm -rf config.status config.log autom4te.cache
......@@ -34,7 +34,7 @@ AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
. $builddepsfile
AC_MSG_RESULT([loaded!])
else
AC_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!])
AC_MSG_ERROR([The given builddeps conf file $with_builddeps_conf could not be loaded!])
fi
else
AC_MSG_CHECKING([for builddeps.conf files in sources...])
......@@ -47,7 +47,7 @@ AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
. $builddepsfile
AC_MSG_RESULT([found at least one!])
else
AC_ERROR([Could not find any builddeps.conf at all!])
AC_MSG_ERROR([Could not find any builddeps.conf at all!])
fi
fi
# Create build and host names that use _ instead of "-" and ".".
......@@ -117,7 +117,7 @@ AC_DEFUN([BDEPS_FTPGET],
) | ftp -in $FTPSERVER
fi
if test "x$VALID_TOOL" != xyes; then
AC_ERROR([I do not know how to use the tool: $BDEPS_FTP])
AC_MSG_ERROR([I do not know how to use the tool: $BDEPS_FTP])
fi
])
......@@ -159,7 +159,7 @@ AC_DEFUN([BDEPS_CHECK_MODULE],
thecflags=${builddep_$2_CFLAGS}
thelibs=${builddep_$2_LIBS}
if test "x$depdir" = x; then
AC_ERROR([Could not download build dependency $2])
AC_MSG_ERROR([Could not download build dependency $2])
fi
$1=$depdir
if test "x$theroot" != x; then
......@@ -198,17 +198,17 @@ AC_DEFUN([BDEPS_FETCH],
mkdir -p $installdir
fi
if test ! -d $installdir; then
AC_ERROR([Could not create directory $installdir])
AC_MSG_ERROR([Could not create directory $installdir])
fi
tmpfile=`mktemp $installdir/$1.XXXXXXXXX`
touch $tmpfile
if test ! -f $tmpfile; then
AC_ERROR([Could not create files in directory $installdir])
AC_MSG_ERROR([Could not create files in directory $installdir])
fi
BDEPS_FTPGET([$3/$2] , [$tmpfile])
mv $tmpfile $installdir/$filename
if test ! -s $installdir/$filename; then
AC_ERROR([Could not download $3/$2])
AC_MSG_ERROR([Could not download $3/$2])
fi
case "$extension" in
zip) echo "Unzipping $installdir/$filename..."
......@@ -220,7 +220,7 @@ AC_DEFUN([BDEPS_FETCH],
tgz) echo "Untaring $installdir/$filename..."
(cd $installdir ; rm -f $installdir/$filename.unpacked ; tar xzf $installdir/$filename && touch $installdir/$filename.unpacked)
;;
*) AC_ERROR([Cannot handle build depency archive with extension $extension])
*) AC_MSG_ERROR([Cannot handle build depency archive with extension $extension])
;;
esac
fi
......@@ -228,4 +228,3 @@ AC_DEFUN([BDEPS_FETCH],
$5=$installdir
fi
])
此差异已折叠。
此差异已折叠。
......@@ -23,14 +23,16 @@
# questions.
#
function prepare_help_system {
AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
}
function help_on_build_dependency {
# Print a helpful message on how to acquire the necessary build dependency.
# $1 is the help tag: freetyp2, cups, pulse, alsa etc
MISSING_DEPENDENCY=$1
PKGHANDLER_COMMAND=
AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
case $PKGHANDLER in
apt-get)
apt_help $MISSING_DEPENDENCY ;;
......@@ -47,7 +49,7 @@ function help_on_build_dependency {
esac
if test "x$PKGHANDLER_COMMAND" != x; then
HELP_MSG="Try running '$PKGHANDLER_COMMAND'."
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
fi
}
......
......@@ -48,7 +48,7 @@ AC_DEFUN([CHECK_FIND_DELETE],
AC_DEFUN([CHECK_NONEMPTY],
[
# Test that variable $1 is not empty.
if test "" = "[$]$1"; then AC_ERROR(Could not find translit($1,A-Z,a-z) !); fi
if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
])
AC_DEFUN([ADD_JVM_ARG_IF_OK],
......@@ -97,7 +97,7 @@ AC_DEFUN([SPACESAFE],
$1=`$CYGPATH -s -m -a "[$]$1"`
$1=`$CYGPATH -u "[$]$1"`
else
AC_ERROR([You cannot have spaces in $2! "[$]$1"])
AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
fi
fi
])
......@@ -215,7 +215,7 @@ AC_DEFUN([SETUP_CCACHE_USAGE],
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
PUSHED_FLAGS="$CXXFLAGS"
CXXFLAGS="-fpch-preprocess $CXXFLAGS"
AC_TRY_COMPILE([], [], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
CXXFLAGS="$PUSHED_FLAGS"
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
AC_MSG_RESULT([yes])
......@@ -257,7 +257,7 @@ AC_DEFUN([EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS],
# The same values are setup for BUILD_...
#
# And the legacy variables, for controlling the old makefiles.
# LEGACY_HOST_CPU1=i586,amd64,sparc,sparcv9,arm,arm64...
# LEGACY_HOST_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
# LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
# LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris)
# LEGACY_HOST_OS_API=solaris,windows
......@@ -277,6 +277,13 @@ AC_DEFUN([EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS],
LEGACY_HOST_CPU3=""
LEGACY_BUILD_CPU3=""
fi
# On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_HOST_CPU1) ...
if test "x$HOST_OS" = xmacosx && test "x$HOST_CPU" = xx64; then
LEGACY_HOST_CPU1="x86_64"
fi
SET_RELEASE_FILE_OS_VALUES()
])
AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
......@@ -427,7 +434,7 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
VAR_LEGACY_CPU=s390x
;;
*)
AC_ERROR([unsupported cpu $1])
AC_MSG_ERROR([unsupported cpu $1])
;;
esac
......@@ -515,3 +522,26 @@ AC_DEFUN([WIN_FIX_PATH],
$1="$tmp"
fi
])
AC_DEFUN([SET_RELEASE_FILE_OS_VALUES],
[
if test "x$HOST_OS" = "xsolaris"; then
REQUIRED_OS_NAME=SunOS
REQUIRED_OS_VERSION=5.10
fi
if test "x$HOST_OS" = "xlinux"; then
REQUIRED_OS_NAME=Linux
REQUIRED_OS_VERSION=2.6
fi
if test "x$HOST_OS" = "xwindows"; then
REQUIRED_OS_NAME=Windows
REQUIRED_OS_VERSION=5.1
fi
if test "x$HOST_OS" = "xmacosx"; then
REQUIRED_OS_NAME=Darwin
REQUIRED_OS_VERSION=11.2
fi
AC_SUBST(REQUIRED_OS_NAME)
AC_SUBST(REQUIRED_OS_VERSION)
])
......@@ -64,6 +64,9 @@ endif
# A self-referential reference to this file.
SPEC:=@SPEC@
# The "human readable" name of this configuration
CONF_NAME:=@CONF_NAME@
# The built jdk will run in this host system.
HOST:=@HOST@
HOST_OS:=@HOST_OS@
......@@ -87,6 +90,10 @@ BUILD_CPU_ARCH:=@BUILD_CPU_ARCH@
BUILD_CPU_BITS:=@BUILD_CPU_BITS@
BUILD_CPU_ENDIAN:=@BUILD_CPU_ENDIAN@
# Legacy OS values for use in release file.
REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
# Old name for HOST_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
PLATFORM:=@HOST_OS@
# Old name for HOST_CPU, uses i586 and amd64, instead of ia32 and x64.
......@@ -105,6 +112,7 @@ ENDIAN:=@HOST_CPU_ENDIAN@
@SET_OPENJDK@
JIGSAW:=@JIGSAW@
LIBM:=-lm
LIBDL:=@LIBDL@
# colon or semicolon
PATH_SEP:=@PATH_SEP@
......@@ -287,8 +295,8 @@ CUPS_CFLAGS:=@CUPS_CFLAGS@
PACKAGE_PATH=@PACKAGE_PATH@
CACERTS_FILE:=$(SRC_ROOT)/jdk/src/share/lib/security/cacerts
#CACERTS_INT=$(CLOSED_SHARE_SRC)/lib/security/cacerts.internal
# Source file for cacerts
CACERTS_FILE=@CACERTS_FILE@
#MOZILLA_HEADERS_PATH:=
......@@ -308,13 +316,18 @@ LD_OUT_OPTION:=@LD_OUT_OPTION@
AR_OUT_OPTION:=@AR_OUT_OPTION@
# Flags used for overriding the default opt setting for a C/C++ source file.
C_O_FLAG_HIGHEST:=@C_O_FLAG_HIGHEST@
C_O_FLAG_HI:=@C_O_FLAG_HI@
C_O_FLAG_NORM:=@C_O_FLAG_NORM@
C_O_FLAG_NONE:=@C_O_FLAG_NONE@
CXX_O_FLAG_HIGHEST:=@CXX_O_FLAG_HIGHEST@
CXX_O_FLAG_HI:=@CXX_O_FLAG_HI@
CXX_O_FLAG_NORM:=@CXX_O_FLAG_NORM@
CXX_O_FLAG_NONE:=@CXX_O_FLAG_NONE@
C_FLAG_DEPS:=@C_FLAG_DEPS@
CXX_FLAG_DEPS:=@CXX_FLAG_DEPS@
# Tools that potentially need to be cross compilation aware.
CC:=@UNCYGDRIVE@ @CCACHE@ @CC@
......@@ -386,6 +399,11 @@ SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
# Options for C/CXX compiler to be used if linking is performed
# using reorder file
C_FLAG_REORDER:=@C_FLAG_REORDER@
CXX_FLAG_REORDER:=@CXX_FLAG_REORDER@
# Options to linker to specify the library name.
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
......@@ -406,6 +424,9 @@ STATIC_LIBRARY_SUFFIX:=@STATIC_LIBRARY_SUFFIX@
EXE_SUFFIX:=@EXE_SUFFIX@
OBJ_SUFFIX:=@OBJ_SUFFIX@
POST_STRIP_CMD:=@POST_STRIP_CMD@
POST_MCS_CMD:=@POST_MCS_CMD@
JAVA_FLAGS:=@BOOT_JDK_JVMARGS@
JAVA=@UNCYGDRIVE@ @JAVA@ $(JAVA_FLAGS)
......@@ -419,6 +440,8 @@ JAR:=@UNCYGDRIVE@ @JAR@
RMIC:=@UNCYGDRIVE@ @RMIC@
NATIVE2ASCII:=@UNCYGDRIVE@ @NATIVE2ASCII@
BOOT_JAR_CMD:=@UNCYGDRIVE@ @JAR@
BOOT_JAR_JFLAGS:=
......@@ -483,6 +506,7 @@ OTOOL:=@OTOOL@
READELF:=@READELF@
EXPR:=@EXPR@
FILE:=@FILE@
HG:=@HG@
UNCYGDRIVE:=@UNCYGDRIVE@
......@@ -584,5 +608,13 @@ INSTALL_SYSCONFDIR=@sysconfdir@
# Misc
#
# Name of Service Agent library
SALIB_NAME=@SALIB_NAME@
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=@TEST_IN_BUILD@
OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
OS_VERSION_MINOR:=@OS_VERSION_MINOR@
OS_VERSION_MICRO:=@OS_VERSION_MICRO@
......@@ -45,7 +45,7 @@
#
if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then
echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image"
echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image"
echo ""
echo "Compare the directory structure."
echo "Compare the filenames in the directories."
......@@ -55,11 +55,11 @@ if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then
echo "Compare the native executables"
echo "Compare the remaining files"
echo ""
echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]"
echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image [zips jars libs execs other]"
echo ""
echo "Compare only the selected subset of the images."
echo ""
echo "./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar"
echo "bash ./common/bin/compareimages.sh old_jdk_image new_jdk_image CodePointIM.jar"
echo ""
echo "Compare only the CodePointIM.jar file"
echo "Can be used to compare zips, libraries and executables."
......@@ -114,10 +114,10 @@ else
CMP_OTHER=true
fi
DIFFJARZIP=`dirname $0`/diffjarzip.sh
DIFFLIB=`dirname $0`/difflib.sh
DIFFEXEC=`dirname $0`/diffexec.sh
export COMPARE_ROOT=/tmp/cimages
DIFFJARZIP="/bin/bash `dirname $0`/diffjarzip.sh"
DIFFLIB="/bin/bash `dirname $0`/difflib.sh"
DIFFEXEC="/bin/bash `dirname $0`/diffexec.sh"
export COMPARE_ROOT=/tmp/cimages.$USER
mkdir -p $COMPARE_ROOT
# Load the correct exception list.
......@@ -167,16 +167,64 @@ else
ONLY_OLD=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '<')
if [ "$ONLY_OLD" ]; then
echo Only in $OLD
echo $ONLY_OLD | sed 's|< ./|\t|g' | sed 's/ /\n/g'
echo "$ONLY_OLD" | sed 's|< ./| |g'
fi
# Differences in directories found.
ONLY_NEW=$(diff $COMPARE_ROOT/from_files $COMPARE_ROOT/to_files | grep '>')
if [ "$ONLY_NEW" ]; then
echo Only in $NEW
echo $ONLY_NEW | sed 's|> ./|\t|g' | sed 's/ /\n/g'
echo "$ONLY_NEW" | sed 's|> ./| |g'
fi
fi
if [ "`uname`" == "SunOS" ]; then
PERM="gstat -c%a"
elif [ $OSTYPE == "cygwin" ]; then
PERM=
elif [ "`uname`" == "Darwin" ]; then
PERM="stat -f%p"
elif [ "`uname`" == "Linux" ]; then
PERM="stat -c%A"
else
PERM="stat -c%a"
fi
if [ "${PERM}" ]
then
echo -n Permissions...
found=""
for f in `cd $OLD && find . -type f`
do
if [ ! -f ${OLD}/$f ]; then continue; fi
if [ ! -f ${NEW}/$f ]; then continue; fi
OP=`${PERM} ${OLD}/$f`
NP=`${PERM} ${NEW}/$f`
if [ "$OP" != "$NP" ]
then
if [ -z "$found" ]; then echo ; found="yes"; fi
printf "\told: ${OP} new: ${NP}\t$f\n"
fi
done
if [ -z "$found" ]; then echo ; found="yes"; fi
fi
GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
! -name "ct.sym" \
| grep -v "./bin/" | sort | $FILTER)
echo General files...
for f in $GENERAL_FILES
do
if [ -e $NEW/$f ]; then
DIFF_OUT=$(diff $OLD/$f $NEW/$f 2>&1)
if [ -n "$DIFF_OUT" ]; then
echo $f
echo "$DIFF_OUT"
fi
fi
done
if [ "x$CMP_ZIPS" == "xtrue" ]; then
ZIPS=$(cd $OLD && find . -type f -name "*.zip" | sort | $FILTER)
......@@ -194,7 +242,7 @@ if [ "x$CMP_ZIPS" == "xtrue" ]; then
fi
if [ "x$CMP_JARS" == "xtrue" ]; then
JARS=$(cd $OLD && find . -type f -name "*.jar" | sort | $FILTER)
JARS=$(cd $OLD && find . -type f -name "*.jar" -o -name "ct.sym" | sort | $FILTER)
if [ -n "$JARS" ]; then
echo Jar files...
......
......@@ -50,14 +50,21 @@ fi
if [ "`uname`" == "SunOS" ]; then
NM=gnm
STAT=gstat
STAT="gstat -c%s"
LDD=ldd
elif [ $OSTYPE == "cygwin" ]; then
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
NM_ARGS=/exports
STAT=stat
STAT="stat -c%s"
LDD=
elif [ "`uname`" == "Darwin" ]; then
NM=nm
STAT="stat -f%z"
LDD="otool -L"
else
NM=nm
STAT=stat
STAT="stat -c%s"
LDD=ldd
fi
# Should the differences be viewed?
......@@ -72,8 +79,8 @@ fi
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
OLD_SIZE=$($STAT -c%s "$OLD")
NEW_SIZE=$($STAT -c%s "$NEW")
OLD_SIZE=$($STAT "$OLD")
NEW_SIZE=$($STAT "$NEW")
if [ $# -gt 3 ]
then
......@@ -119,15 +126,41 @@ fi
DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS)
if [ "${LDD}" ]
then
NAME=`basename $OLD`
TMP=$COMPARE_ROOT/ldd/ldd.${NAME}
rm -rf "${TMP}"
mkdir -p "${TMP}"
(cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old)
(cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new)
(cd "${TMP}" && rm -f ${NAME})
DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new")
DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new")
DEP_MSG=
if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then
DEP_MSG="Identical dependencies"
elif [ -z "${DIFFS_UNIQ_DEP}" ]; then
DEP_MSG="Redundant duplicate dependencies added"
RES=1
else
DEP_MSG="DIFFERENT dependencies"
RES=1
fi
fi
RESULT=0
if [ -n "$DIFFS" ]; then
if [ $OLD_SIZE -ne $NEW_SIZE ]
then
echo Differences, content AND size : $OLD_NAME
echo Differences, content AND size : $DEP_MSG : $OLD_NAME
RESULT=4
else
echo Differences, content BUT SAME size: $OLD_NAME
echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME
RESULT=3
fi
if [ "x$VIEW" == "xview" ]; then
......@@ -136,10 +169,10 @@ if [ -n "$DIFFS" ]; then
else
if [ $OLD_SIZE -ne $NEW_SIZE ]
then
echo Identical symbols BUT NEW size : $OLD_NAME
echo Identical symbols BUT NEW size : $DEP_MSG : $OLD_NAME
RESULT=2
else
echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME
echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME
RESULT=1
fi
fi
......
......@@ -84,8 +84,8 @@ if [ "$OLD_SUFFIX" != "$NEW_SUFFIX" ]; then
exit 2
fi
if [ "$OLD_SUFFIX" != "zip" ] && [ "$OLD_SUFFIX" != "jar" ]; then
echo The files have to be zip or jar! They are $OLD_SUFFIX
if [ "$OLD_SUFFIX" != "zip" ] && [ "$OLD_SUFFIX" != "jar" ] && [ "$OLD_SUFFIX" != "sym" ]; then
echo The files have to be zip, jar or sym! They are $OLD_SUFFIX
exit 2
fi
......@@ -128,7 +128,7 @@ if [ -n "$ONLY2" ]; then
| sed "s|Only in $NEW_TEMPDIR| |"g | sed 's|: |/|g'
fi
DIFFTEXT=`dirname $0`/difftext.sh
DIFFTEXT="/bin/bash `dirname $0`/difftext.sh"
LANG=C $DIFF -rq $DIFF_FLAGS $OLD_TEMPDIR $NEW_TEMPDIR | grep differ | cut -f 2,4 -d ' ' | \
awk "{ print \"$DIFFTEXT \"\$1\" \"\$2 }" > $COMPARE_ROOT/diffing
......
......@@ -54,14 +54,21 @@ fi
if [ "`uname`" == "SunOS" ]; then
NM=gnm
STAT=gstat
STAT="gstat -c%s"
LDD=ldd
elif [ $OSTYPE == "cygwin" ]; then
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
NM_ARGS=/exports
STAT=stat
STAT="stat -c%s"
LDD=
elif [ "`uname`" == "Darwin" ]; then
NM=nm
STAT="stat -f%z"
LDD="otool -L"
else
NM=nm
STAT=stat
STAT="stat -c%s"
LDD=ldd
fi
# Should the differences be viewed?
......@@ -76,8 +83,8 @@ fi
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
OLD_SIZE=$($STAT -c%s "$OLD")
NEW_SIZE=$($STAT -c%s "$NEW")
OLD_SIZE=$($STAT "$OLD")
NEW_SIZE=$($STAT "$NEW")
if [ $# -gt 3 ]
then
......@@ -139,13 +146,39 @@ DIFFS=$(LANG=C diff $OLD_SYMBOLS $NEW_SYMBOLS)
RESULT=0
if [ "${LDD}" ]
then
NAME=`basename $OLD`
TMP=$COMPARE_ROOT/ldd/ldd.${NAME}
rm -rf "${TMP}"
mkdir -p "${TMP}"
(cd "${TMP}" && cp $OLD . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.old | uniq > dep.uniq.old)
(cd "${TMP}" && cp $NEW . && ${LDD} ${NAME} | awk '{ print $1;}' | sort | tee dep.new | uniq > dep.uniq.new)
(cd "${TMP}" && rm -f ${NAME})
DIFFS_DEP=$(LANG=C diff "${TMP}/dep.old" "${TMP}/dep.new")
DIFFS_UNIQ_DEP=$(LANG=C diff "${TMP}/dep.uniq.old" "${TMP}/dep.uniq.new")
DEP_MSG=
if [ -z "${DIFFS_UNIQ_DEP}" -a -z "${DIFFS_DEP}" ]; then
DEP_MSG="Identical dependencies"
elif [ -z "${DIFFS_UNIQ_DEP}" ]; then
DEP_MSG="Redundant duplicate dependencies added"
RES=1
else
DEP_MSG="DIFFERENT dependencies"
RES=1
fi
fi
if [ -n "$DIFFS" ]; then
if [ $OLD_SIZE -ne $NEW_SIZE ]
then
echo Differences, content AND size : $OLD_NAME
echo Differences, content AND size : $DEP_MSG : $OLD_NAME
RESULT=4
else
echo Differences, content BUT SAME size: $OLD_NAME
echo Differences, content BUT SAME size: $DEP_MSG : $OLD_NAME
RESULT=3
fi
if [ "x$VIEW" == "xview" ]; then
......@@ -154,10 +187,10 @@ if [ -n "$DIFFS" ]; then
else
if [ $OLD_SIZE -ne $NEW_SIZE ]
then
echo Identical symbols BUT NEW size : $OLD_NAME
echo Identical symbols BUT NEW size : $DEP_MSG : $OLD_NAME
RESULT=2
else
echo Identical symbols AND size, BUT not bytewise identical: $OLD_NAME
echo Identical symbols AND size, BUT not bytewise identical: $DEP_MSG : $OLD_NAME
RESULT=1
fi
fi
......
......@@ -37,10 +37,9 @@
# Create a temporary directory to store the result code from
# the wrapped command.
RCDIR=`mktemp -d tmp.XXXXXX` || exit $?
trap "rm -rf '$RCDIR'" EXIT
RCDIR=`mktemp -dt jdk-build-logger.tmp.XXXXXX` || exit $?
trap "rm -rf \"$RCDIR\"" EXIT
LOGFILE=$1
shift
(exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > $RCDIR/rc) | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE
exit `cat $RCDIR/rc`
(exec 3>&1 ; ("$@" 2>&1 1>&3; echo $? > "$RCDIR/rc") | tee -a $LOGFILE 1>&2 ; exec 3>&-) | tee -a $LOGFILE
exit `cat "$RCDIR/rc"`
......@@ -126,8 +126,7 @@ define SetupArchive
# JAR:=Jar file to create
# MANIFEST:=Optional manifest file template.
# JARMAIN:=Optional main class to add to manifest
# SETUP:=The Java(h) compiler setup, needed to run javah.
# HEADERS:=Directory to put headers in
# JARINDEX :=
# SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically
# added to the archive.
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
......@@ -143,9 +142,8 @@ define SetupArchive
$(if $(12),$1_$(strip $(12)))
$(if $(13),$1_$(strip $(13)))
$(if $(14),$1_$(strip $(14)))
$(if $(15),$1_$(strip $(15)))
$1_JVM := $$($$($1_SETUP)_JVM)
$1_JAVAH := $$($$($1_SETUP)_JAVAH)
$1_JARMAIN:=$(strip $$($1_JARMAIN))
$1_JARNAME:=$$(notdir $$($1_JAR))
$1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest
......@@ -155,19 +153,46 @@ define SetupArchive
$1_NATIVEAPI_NOTIFICATIONS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native_notifications
$1_NATIVEAPI_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native
$1_BIN:=$$(dir $$($1_JAR))
ifeq (,$$($1_SUFFIXES))
# No suffix was set, default to classes.
$1_SUFFIXES:=.class
endif
# Convert suffixes to a find expression
$1_FIND_PATTERNS:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
# On windows, a lot of includes/excludes risk making the command line too long, so
# writing the grep patterns to files.
ifneq (,$$($1_INCLUDES))
$1_GREP_INCLUDES:=| $(GREP) $$(foreach src,$$($1_SRCS),$$(addprefix -e$(SPACE)$$(src)/,$$($1_INCLUDES)))
$1_GREP_INCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),\
$$(addprefix $$(src)/,$$($1_INCLUDES)))
$$(eval $$(call ListPathsSafelyNow,$1_GREP_INCLUDE_PATTERNS,\n, \
>> $$($1_BIN)/_the.$$($1_JARNAME)_include))
$1_GREP_INCLUDES:=| $(GREP) -f $$($1_BIN)/_the.$$($1_JARNAME)_include
endif
ifneq (,$$($1_EXCLUDES)$$($1_EXCLUDE_FILES))
$1_GREP_EXCLUDES:=| $(GREP) -v $$(foreach src,$$($1_SRCS),$$(addprefix -e$(SPACE)$$(src)/,$$($1_EXCLUDES) $$($1_EXCLUDE_FILES)))
$1_GREP_EXCLUDE_PATTERNS:=$$(foreach src,$$($1_SRCS),$$(addprefix $$(src)/,\
$$($1_EXCLUDES) $$($1_EXCLUDE_FILES)))
$$(eval $$(call ListPathsSafelyNow,$1_GREP_EXCLUDE_PATTERNS,\n, \
>> $$($1_BIN)/_the.$$($1_JARNAME)_exclude))
$1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude
endif
ifneq (,$$($1_JARINDEX))
$1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@))
else
$1_JARINDEX = true
endif
# When this macro is run in the same makefile as the java compilation, dependencies are transfered
# in make variables. When the macro is run in a different makefile than the java compilation, the
# dependencies need to be found in the filesystem.
$1_ALL_SRCS:=$$(foreach src,$$($1_SRCS),$$(shell ($(FIND) $$(src) -type f \
-a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
$$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES))))
ifeq (,$$($1_SKIP_METAINF))
$1_ALL_SRCS+=$$(foreach src,$$($1_SRCS),$$(shell $(FIND) $$(src)/META-INF -type f 2> /dev/null))
endif
# Utility macros, to make the shell script receipt somewhat easier to dechipher.
# The capture contents macro finds all files (matching the patterns, typically
......@@ -187,15 +212,6 @@ define SetupArchive
(cd $$(src) && \
$(FIND) . -name _the.package.api.notify -exec dirname \{\} \; >> $$($1_PUBAPI_NOTIFICATIONS_FILE) ; \
true) &&)
# The capture nativeapi macro scans for native api change notificiations. If such notifications are
# found, then we will run javah on the changed classes. It also collects all classes with native methods
# to be used to find out which classes no longer has native methods, to trigger deletion of those .h files.
$1_CAPTURE_NATIVEAPI=$$(foreach src,$$($1_SRCS),\
(cd $$(src) && \
$(FIND) . -name _the.package.native.notify | $(SED) 's/package.native.notify/package.native/' | \
$(XARGS) $(CAT) | $(GREP) '^TYPE ' | $(SED) 's/.*TYPE //' >> $$($1_NATIVEAPI_NOTIFICATIONS_FILE) ; \
$(FIND) . -name _the.package.native -exec $(CAT) \{\} \; | $(SED) -n 's/^TYPE //p' >> $$($1_NATIVEAPI_FILE) ; \
true) &&)
# The update contents macro updates the jar file with the previously capture contents.
$1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
(cd $$(src) && \
......@@ -205,13 +221,18 @@ define SetupArchive
fi) &&)
# The s-variants of the above macros are used when the jar is created from scratch.
$1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\
(($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) $$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > $$(src)/_the.$$($1_JARNAME)_contents) && )
(($(FIND) $$(src) -type f -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
$$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)) | $(SED) 's|$$(src)/||g' > \
$$(src)/_the.$$($1_JARNAME)_contents) && )
ifeq (,$$($1_SKIP_METAINF))
$1_SCAPTURE_METAINF=$$(foreach src,$$($1_SRCS),\
($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> $$(src)/_the.$$($1_JARNAME)_contents) && )
($(FIND) $$(src)/META-INF -type f 2> /dev/null | $(SED) 's|$$(src)/||g' >> \
$$(src)/_the.$$($1_JARNAME)_contents) && )
endif
$1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
(cd $$(src) && $(JAR) uf $$@ @$$(src)/_the.$$($1_JARNAME)_contents) &&)
# The TOUCH macro is used to make sure all timestamps are identical for package files and the pubapi files.
# If we do not do this, we get random recompilations, the next time we run make, since the order of package building is random,
# ie independent of package --dependes on-> public api of another package. This is of course
......@@ -223,7 +244,7 @@ define SetupArchive
# Use a slightly shorter name for logging, but with enough path to identify this jar.
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
# Here is the rule that creates/updates the jar file.
$$($1_JAR) : $2
$$($1_JAR) : $2 $$($1_ALL_SRC)
$(MKDIR) -p $$($1_BIN)
if [ -n "$$($1_MANIFEST)" ]; then \
$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
......@@ -231,9 +252,11 @@ define SetupArchive
else \
$(RM) $$($1_MANIFEST_FILE) && $(TOUCH) $$($1_MANIFEST_FILE); \
fi
$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE)
if [ -n "$$(strip $$($1_JARMAIN))" ]; then \
$(ECHO) "Main-Class: $$(strip $$($1_JARMAIN))" >> $$($1_MANIFEST_FILE); \
fi
if [ -n "$$($1_EXTRA_MANIFEST_ATTR)" ]; then \
$(ECHO) "$$($1_EXTRA_MANIFEST_ATTR)" >> $$($1_MANIFEST_FILE); \
$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE); \
fi
+if [ -s $$@ ]; then \
$(RM) -r $$($1_PUBAPI_NOTIFICATIONS_FILE) && \
......@@ -255,20 +278,8 @@ define SetupArchive
$(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \
fi && \
$$($1_UPDATE_CONTENTS) true && \
$$($1_JARINDEX) && \
$$($1_TOUCH_API_FILES) true && \
$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
$$($1_CAPTURE_NATIVEAPI) true && \
if [ "x$$($1_JAVAH)" != "x" ] && [ -s $$($1_NATIVEAPI_NOTIFICATIONS_FILE) ]; then \
$(ECHO) Native api change detected in: && $(CAT) $$($1_NATIVEAPI_NOTIFICATIONS_FILE) && \
$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_JAR)" -d $$($1_HEADERS) @$$($1_NATIVEAPI_NOTIFICATIONS_FILE) ; \
fi && \
$(TOUCH) $$($1_NATIVEAPI_FILE)_prev ; \
($(GREP) -xvf $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev > $$($1_NATIVEAPI_FILE)_deleted; true) && \
$(CP) $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev && \
if [ -s $$($1_NATIVEAPI_FILE)_deleted ]; then \
$(ECHO) Native methods dropped from classes: && $(CAT) $$($1_NATIVEAPI_FILE)_deleted && \
$(RM) `$(CAT) $$($1_NATIVEAPI_FILE)_deleted | $(SED) -e 's|\.|_|g' -e 's|.*|$$($1_HEADERS)/&.h $$($1_HEADERS)/&_*|'` ; \
fi && \
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) true ; \
fi ; \
else \
......@@ -276,15 +287,9 @@ define SetupArchive
$$($1_SCAPTURE_CONTENTS) \
$$($1_SCAPTURE_METAINF) \
$$($1_SUPDATE_CONTENTS) \
$$($1_JARINDEX) && \
$$($1_TOUCH_API_FILES) true && \
$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
$$($1_CAPTURE_NATIVEAPI) true && \
if [ "x$$($1_JAVAH)" != "x" ] && [ -s $$($1_NATIVEAPI_FILE) ]; then \
$(ECHO) Generating native api headers for `$(CAT) $$($1_NATIVEAPI_FILE) | $(WC) -l` classes && \
$(RM) $$($1_HEADERS)/*.h && \
$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_JAR)" -d $$($1_HEADERS) @$$($1_NATIVEAPI_FILE) && \
$(CP) $$($1_NATIVEAPI_FILE) $$($1_NATIVEAPI_FILE)_prev ; \
fi && \
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name "*.notify" $(FIND_DELETE); true) &&) true ; \
fi;
......@@ -297,7 +302,7 @@ 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,EXCLUDES,EXCLUDE_FILES
# SRC,ZIP,INCLUDES,EXCLUDES,EXCLUDE_FILES,SUFFIXES,EXTRA_DEPS
$(if $2,$1_$(strip $2))
$(if $3,$1_$(strip $3))
$(if $4,$1_$(strip $4))
......@@ -308,11 +313,17 @@ define SetupZipArchive
$(if $9,$1_$(strip $9))
# Find all files in the source tree.
$1_ALL_SRCS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f -a ! -name "_the.*"))
$1_SUFFIX_FILTER := $$(patsubst %,-o -name $(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
$1_ALL_SRCS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f -a ! -name "_the.*" \( -name FALSE_DUMMY $$($1_SUFFIX_FILTER) \) ))
ifneq ($$($1_INCLUDES),)
$1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($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
$1_ALL_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_SRCS))
endif
ifneq ($$($1_EXCLUDES),)
......@@ -329,7 +340,7 @@ define SetupZipArchive
# 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.
$$($1_ZIP) : $$($1_ALL_SRCS)
$$($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)))) ;) true
......@@ -472,7 +483,7 @@ define add_file_to_copy_and_clean
| $(SED) -e '/^#/d' -e '/^$$$$/d' \
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \
-e 's/^[ \t]*//;s/[ \t]*$$$$//' \
-e 's/\\=/=/' | LANG=C sort > $$@
-e 's/\\=/=/' | LANG=C $(SORT) > $$@
$(CHMOD) -f ug+w $$@
# And do not forget this target
......@@ -623,6 +634,7 @@ define SetupJavaCompilation
# JAVAC_SOURCE_PATH_UGLY_OVERRIDE:=Don't use this. This forces an explicit -sourcepath to javac.
# Its only here until we cleanup some nasty source code pasta in the jdk.
# HEADERS:=path to directory where all generated c-headers are written.
# DEPENDS:=Extra dependecy
$(if $2,$1_$(strip $2))
$(if $3,$1_$(strip $3))
$(if $4,$1_$(strip $4))
......@@ -650,9 +662,6 @@ $1_JVM := $$($$($1_SETUP)_JVM)
$1_JAVAC := $$($$($1_SETUP)_JAVAC)
$1_JAVAH := $$($$($1_SETUP)_JAVAH)
$1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
ifeq (,$$($1_HEADERS))
$1_HEADERS := $$($1_BIN)
endif
# Handle addons and overrides.
$1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
......@@ -776,24 +785,21 @@ ifeq ($$($1_MODE),SINGLE_THREADED_BATCH)
$$(eval $$(call replace_space_with_pathsep,$1_SRCROOTSC,$$($1_SRC)))
endif
ifneq (,$$($1_HEADERS))
$1_HEADERS_ARG := -h $$($1_HEADERS)
endif
# Create a sed expression to remove the source roots and to replace / with .
# and remove .java at the end.
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
# Here is the batch rules that depends on all the sources.
$$($1_BIN)/_the.batch: $$($1_SRCS)
$$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS)
$(MKDIR) -p $$(@D)
$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in batch $1
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) @$$($1_BIN)/_the.batch.tmp && \
$$(if $$($1_JAVAH),\
$(CAT) $$($1_BIN)/_the.batch.tmp | $(XARGS) $(GREP) -E "[[:space:]]native[[:space:]]|@GenerateNativeHeader" |\
$(GREP) -v '*' | $(GREP) -v '//' | $(CUT) -f 1 -d ':' | $(SORT) -u |\
$(SED) $$($1_REWRITE_INTO_CLASSES) > $$($1_BIN)/_the.batch.natives && \
if test -s $$($1_BIN)/_the.batch.natives; then \
$$($1_JVM) $$($1_JAVAH) "-Xbootclasspath/p:$$($1_BIN)" -d $$($1_HEADERS) @$$($1_BIN)/_the.batch.natives ; \
fi &&) \
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \
$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
else
# Ok, we have a modern javac server running!
......@@ -868,6 +874,7 @@ ifneq (,$$($1_JAR))
JARMAIN:=$$($1_JARMAIN),\
MANIFEST:=$$($1_MANIFEST),\
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\
JARINDEX:=$$($1_JARINDEX),\
HEADERS:=$$($1_HEADERS),\
SETUP:=$$($1_SETUP)))
endif
......
......@@ -91,6 +91,15 @@ $(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/b
> $(BUILDTIMESDIR)/build_time_diff_$1
endef
# Check if the current target is the final target, as specified by
# the user on the command line. If so, call PrintEndMessage.
define CheckIfFinished
$(if $(filter $@,$(MAKECMDGOALS)),$(call PrintEndMessage))
# If no taget is given, "all" is default. Check for that, too.
# At most one of the tests can be true.
$(if $(MAKECMDGOALS),,$(if $(filter $@,all),$(call PrintEndMessage)))
endef
# Indicate that we are done.
# Record ending time and print out the total time it took to build.
define MakeFinish
......@@ -101,6 +110,7 @@ $(BUILD_LOG_WRAPPER) $(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s ###
"########################################################################" \
$(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
"########################################################################"
$(call CheckIfFinished)
endef
# Find all build_time_* files and print their contents in a list sorted
......@@ -126,6 +136,18 @@ define StopTimer
$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
endef
# Hook to be called as the very first thing when running a normal build
define AtRootMakeStart
$(call PrintStartMessage)
$(call StartTimer)
endef
# Hook to be called as the very last thing for targets that are "top level" targets
define AtRootMakeEnd
$(call StopTimer)
$(call CheckIfFinished)
endef
# If the variable that you want to send to stdout for piping into a file or otherwise,
# is potentially long, for example the a list of file paths, eg a list of all package directories.
# Then you need to use ListPathsSafely, which optimistically splits the output into several shell
......@@ -324,4 +346,51 @@ define ListPathsSafelyNow
endef
# The source tips can come from the Mercurial repository, or in the files
# $(HGTIP_FILENAME) which contains the tip but is also positioned in the same
# directory as the original $(HGDIR) directory.
# These should not be := assignments, only used from the root Makefile.
HG_VERSION = $(shell $(HG) version 2> /dev/null)
HG_DIRECTORY=.hg
HGTIP_FILENAME=.hgtip
HG_SEARCH = ./REPO ./*/REPO ./*/*/REPO ./*/*/*/REPO
REPO_LIST = $(patsubst ./%,%,$(patsubst %/,%,$(sort $(dir \
$(shell $(CD) $(SRC_ROOT) ; ( $(LS) -d $(HG_SEARCH:%/REPO=%/$(HG_DIRECTORY)) ; \
$(LS) $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) ) \
2> /dev/null)))))
# Emit the repo:tip pairs to $@
define GetSourceTips
$(CD) $(SRC_ROOT) ; \
for i in $(REPO_LIST) IGNORE ; do \
if [ "$${i}" = "IGNORE" ] ; then \
continue; \
elif [ -d $${i}/$(HG_DIRECTORY) -a "$(HG_VERSION)" != "" ] ; then \
$(PRINTF) " %s:%s" \
"$${i}" `$(HG) tip --repository $${i} --template '{node|short}\n'` ; \
elif [ -f $${i}/$(HGTIP_FILENAME) ] ; then \
$(PRINTF) " %s:%s" \
"$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
fi; \
done >> $@
$(PRINTF) "\n" >> $@
endef
# Create the HGTIP_FILENAME file. Called from jdk/make/closed/bundles.gmk
define CreateHgTip
$(HG) tip --repository $1 --template '{node|short}\n' > $1/$(HGTIP_FILENAME);\
$(ECHO) $1/$(HGTIP_FILENAME)
endef
define SetupLogging
ifneq ($(findstring $(LOG),debug trace),)
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
OLD_SHELL:=$$(SHELL)
SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
endif
endef
# Make sure logging is setup for everyone that includes MakeBase.gmk.
$(eval $(call SetupLogging))
endif # _MAKEBASE_GMK
......@@ -23,49 +23,144 @@
# questions.
#
# Default to sane output from make.
# Override with empty string to get insane amount of output.
# Override with -d to get even more insane amount of debugging output.
# Override with "-d -p" to get it all.
VERBOSE=-s
# This must be the first rule
default: all
# Find out which variables were passed explicitely on the make command line. These
# will be passed on to sub-makes, overriding spec.gmk settings.
MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)=$($(var)))
define fatal-error
# If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
$$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue))
endef
ifeq ($(origin VERBOSE),undefined)
# Setup logging according to LOG (but only if VERBOSE is not given)
ifeq ($(LOG),)
# Set LOG to "warn" as default if not set (and no VERBOSE given)
LOG=warn
endif
ifeq ($(LOG),warn)
VERBOSE=-s
else ifeq ($(LOG),info)
VERBOSE=
else ifeq ($(LOG),debug)
VERBOSE=
else ifeq ($(LOG),trace)
VERBOSE=-d -p
else
$(info Error: LOG must be one of: warn, info, debug or trace.)
$(eval $(call fatal-error))
endif
else
ifneq ($(LOG),)
# We have both a VERBOSE and a LOG 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 LOG=$(LOG) and VERBOSE=$(VERBOSE) at the same time. Choose one.)
$(eval $(call fatal-error))
endif
endif
endif
# TODO: Fix duplication in MakeBase.gmk
define SetupLogging
ifneq ($(findstring $(LOG),debug trace),)
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
OLD_SHELL:=$$(SHELL)
SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
endif
endef
$(eval $(call SetupLogging))
# Find all environment or command line variables that begin with ALT.
list_alt_overrides_with_origins = $(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
ifneq ($(list_alt_overrides),)
$(info You have set the following ALT_ variables:)
$(foreach var,$(list_alt_overrides), $(info $(var)=$($(var))))
$(error Using ALT_ variables is deprecated! Please clean your environment!)
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
makefile_path=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
else
makefile_path=$(lastword $(MAKEFILE_LIST))
endif
root_dir=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
output_dir=$(root_dir)/build
# The spec.gmk file contains the variables extracted by the configure script.
# It is usually set with SPEC=....spec.gmk on the make command line.
# However if you simply type make from the openjdk source root, it will go looking
# for a spec file, if only one is found, use it. If more than one is found,
# complain. If none is found, request the user to run configure!
SPEC ?= $(wildcard $(CURDIR)/../../build/*/spec.gmk)
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 fatal-error))
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.)
$(eval $(call fatal-error))
endif
endif
# ... OK, we're satisfied, we'll use this SPEC later on
else
# Find all spec.gmk files in the build output directory
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.)
$(eval $(call fatal-error))
endif
# Extract the configuration names from the path
all_confs=$(patsubst %/spec.gmk,%,$(patsubst $(output_dir)/%,%,$(all_spec_files)))
ifeq ($(words $(SPEC)),0)
$(error You must run configure!)
endif
ifneq ($(origin CONF),undefined)
# User have given a CONF= argument.
ifeq ($(CONF),)
# If given CONF=, match all configurations
matching_confs=$(strip $(all_confs))
else
# Otherwise select those that contain the given CONF string
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:)
$(foreach var,$(all_confs),$(info * $(var)))
$(eval $(call fatal-error))
else
ifeq ($(words $(matching_confs)),1)
$(info Building '$(matching_confs)' (matching CONF=$(CONF)))
else
$(info Building the following configurations (matching CONF=$(CONF)):)
$(foreach var,$(matching_confs),$(info * $(var)))
endif
endif
ifneq ($(words $(SPEC)),1)
ifeq ($(MAKECMDGOALS),all-conf)
SPECS:=$(shell echo $(SPEC) | sed -e 's|$(CURDIR)/build/||g' -e 's|/spec.gmk|\\n|g' -e 's| ||g')
allconf:
@echo Building configurations:
@printf "$(SPECS)"
@$(foreach s,$(SPEC),($(MAKE) SPEC=$s $(VERBOSE) VERBOSE=$(VERBOSE) images) &&) true
@echo Done building configurations:
@printf "$(SPECS)"
.PHONY: all-conf
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
SPEC=$(addsuffix /spec.gmk,$(addprefix $(output_dir)/,$(matching_confs)))
else
$(error Since you have more than one output dir configured under build, \
you have to either run make from the output dir of your choice \
or specify run "make SPEC=build/.../spec.gmk" or run all the build configurations \
using "make all-conf")
# No CONF or SPEC given, check the available configurations
ifneq ($(words $(all_spec_files)),1)
$(info No CONF or SPEC given, but more than one spec.gmk found in $(output_dir).)
$(info Available configurations:)
$(foreach var,$(all_confs),$(info * $(var)))
$(info Please retry building with CONF=<config> or SPEC=<specfile>)
$(eval $(call fatal-error))
endif
# We found exactly one configuration, use it
SPEC=$(strip $(all_spec_files))
endif
endif
ifneq ($(words $(SPEC)),1)
# We have multiple configurations to build, call make repeatedly
all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean:
@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@ $(MAKE_ARGS)) &&) true
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean
else
# This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
# Now load the spec
-include $(SPEC)
......@@ -88,51 +183,101 @@ $(eval $(call ResetTimers))
# Clean out any notifications from the previous build.
$(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
# If make was called explicitely with -j, don't add a -j ourself to sub-makes, since
# this will be inherited automatically by make. Otherwise use our default for sub-makes.
# The -j in MAKEFLAGS is only visible when executing a recipe, hence this macro.
define GetMakeJobFlag
$(if $(findstring -j,$(MAKEFLAGS)),,-j$(NUM_CORES))
endef
define CheckEnvironment
$(if $(list_alt_overrides),
@$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n"
@$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n"
@$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n"
)
endef
define PrintStartMessage
$(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS))
$(call CheckEnvironment)
@$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'"
endef
define PrintEndMessage
@$(ECHO) "Finished building OpenJDK for target '$@'"
$(call CheckEnvironment)
endef
all: jdk
@$(call StopTimer)
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
@$(call AtRootMakeEnd)
langtools: start-timer
langtools: start-make
@$(call MakeStart,langtools,all)
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(LANGTOOLS_MAKE_ARGS))
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(LANGTOOLS_MAKE_ARGS) $(MAKE_ARGS))
@$(call MakeFinish,langtools,all)
corba: langtools
@$(call MakeStart,corba,all)
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
@$(call MakeFinish,corba,all)
jaxp: langtools
@$(call MakeStart,jaxp,all)
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
@$(call MakeFinish,jaxp,all)
jaxws: langtools jaxp
@$(call MakeStart,jaxws,all)
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(CORBA_MAKE_ARGS))
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
@$(call MakeFinish,jaxws,all)
hotspot: langtools
@$(call MakeStart,hotspot,all)
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS))
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) $(MAKE_ARGS))
@$(call MakeFinish,hotspot,all)
jdk: langtools corba jaxp jaxws hotspot
@$(call MakeStart,jdk,all)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(JDK_MAKE_ARGS))
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS))
@$(call MakeFinish,jdk,all)
images install packages: start-timer jdk langtools corba jaxp jaxws hotspot
images install packages: source-tips start-make jdk langtools corba jaxp jaxws hotspot
@$(call MakeStart,jdk-images,$@)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(NUM_CORES) $(JDK_MAKE_ARGS) $@)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
@$(call MakeFinish,jdk-images,$@)
@$(call StopTimer)
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
@$(call AtRootMakeEnd)
old-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot
@$(call MakeStart,jdk-old-images,$@)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
@$(call MakeFinish,old-jdk-images,$@)
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
@$(call AtRootMakeEnd)
start-make:
@$(call AtRootMakeStart)
start-timer:
@$(call StartTimer)
.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-make
test: start-make
@$(call MakeStart,test,$(if $(TEST),$(TEST),all))
@($(CD) $(SRC_ROOT)/test && $(BUILD_LOG_WRAPPER) $(MAKE) MAKEFLAGS= -j1 PRODUCT_HOME=$(OUTPUT_ROOT)/jdk JPRT_JAVA_HOME=$(OUTPUT_ROOT)/jdk ALT_OUTPUTDIR=$(OUTPUT_ROOT) $(TEST)) || true
@$(call MakeFinish,test,$(if $(TEST),$(TEST),all))
@$(call AtRootMakeEnd)
.PHONY: test
# Stores the tips for each repository. This file is be used when constructing the jdk image and can be
# used to track the exact sources used to build that image.
source-tips: $(OUTPUT_ROOT)/source_tips
$(OUTPUT_ROOT)/source_tips: FRC
@$(MKDIR) -p $(@D)
@$(RM) $@
@$(call GetSourceTips)
.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-timer
# Remove everything, except the output from configure.
clean:
......@@ -152,25 +297,35 @@ clean-jdk:
@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)"
.PHONY: clean
endif
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
# If you addd more global targets, please update the fatal-error macro.
help:
$(info )
$(info Typical make commands:)
$(info make)
$(info make VERBOSE= # print all commands)
$(info make VERBOSE="-d -p" # debug make as well)
$(info make all-conf # build images for all configurations)
$(info make clean # remove build artifacts)
$(info make dist-clean # you have to rerun configure)
# $(info make test # run tests)
$(info make images # create the jdk and jre images)
$(info make install # install the jdk image)
# $(info make modules # EXPERIMENTAL: Migrate JDK into a modularized form!)
$(info make packages # create zips and other packages)
# $(info make eclipse_workspace # Create an Eclipse workspace)
# $(info make netbeans_workspace # Create a NetBeans workspace)
# $(info make vs_workspace # Create a Visual Studio workspace)
$(info OpenJDK Makefile help)
$(info =====================)
$(info )
$(info Common make targets)
$(info . make [all] # Compile all code but do not create images)
$(info . make images # Create complete j2sdk and j2re images)
$(info . make install # Install the generated images locally)
$(info . make clean # Remove all files generated by make, but not those generated by configure)
$(info . make dist-clean # Remove all files generated by both make and configure)
$(info . make help # Give some help on using make)
$(info . make test # Run tests, default is all tests (see TEST below))
$(info )
$(info Useful make variables)
$(info . make CONF= # Build all configurations (note, assignment is empty))
$(info . make CONF=<substring> # Build the configuration(s) with a name matching the given substring)
$(info )
$(info . make LOG=<loglevel> # Change loglevel from warn (default) to the given loglevel)
$(info . # Available loglevels are: warn, info, debug and trace)
$(info . # To see executed command lines, use LOG=info)
$(info )
$(info . make test TEST=<test> # Only run the given test or tests, e.g.)
$(info . # make test TEST="jdk_lang jdk_net")
$(info )
.PHONY: help
endif
FRC: # Force target
......@@ -28,7 +28,7 @@
# desired whenever sort is used below!
ifeq (,$(_MAKEBASE_GMK))
$(error You must include MakeBase.gmk prior to including JavaCompilation.gmk)
$(error You must include MakeBase.gmk prior to including NativeCompilation.gmk)
endif
ifeq ($(COMPILER_TYPE),CC)
......@@ -54,15 +54,22 @@ define add_native_source
ifneq (,$$(filter %.c,$2))
# Compile as a C file
$1_$2_FLAGS=$4
$1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS)
$1_$2_COMP=$5
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
else ifneq (,$$(filter %.m,$2))
# Compile as a objective-c file
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS)
$1_$2_COMP=$5
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
else
# Compile as a C++ file
$1_$2_FLAGS=$6
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS)
$1_$2_COMP=$7
$1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
endif
# 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),$$(notdir $2)))
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $2))))
# 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.
ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
......@@ -80,7 +87,7 @@ define add_native_source
$$($1_$2_OBJ) : $2
ifeq ($(COMPILER_TYPE),CC)
$$(call COMPILING_MSG,$$(notdir $2))
$$($1_$2_COMP) $$($1_$2_FLAGS) -MMD -MF $$($1_$2_DEP) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
endif
ifeq ($(COMPILER_TYPE),CL)
$$(call COMPILING_MSG,$$(notdir $2))
......@@ -109,6 +116,8 @@ define SetupNativeCompilation
# EXCLUDE_FILES with these names
# VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
# RC_FLAGS flags for RC.
# MAPFILE mapfile
# REORDER reorder file
$(if $2,$1_$(strip $2))
$(if $3,$1_$(strip $3))
$(if $4,$1_$(strip $4))
......@@ -154,7 +163,7 @@ define SetupNativeCompilation
ifneq ($$($1_EXCLUDE_FILES),)
$1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
endif
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp,$$($1_ALL_SRCS)))
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp %.m,$$($1_ALL_SRCS)))
ifneq (,$$(strip $$($1_INCLUDE_FILES)))
$1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
endif
......@@ -178,7 +187,7 @@ define SetupNativeCompilation
# Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
# a reproducable order on the input files to the linker).
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS))))))
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))
$1 := $$($1_EXPECTED_OBJS)
# 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)))
......@@ -218,6 +227,11 @@ define SetupNativeCompilation
$1_EXTRA_CXXFLAGS:=$$($1_EXTRA_CFLAGS)
endif
ifneq (,$$($1_REORDER))
$1_EXTRA_CFLAGS += $$(C_FLAG_REORDER)
$1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
endif
# Now create a list of the packages that are about to compile. Used when sending source
# in a batch to the compiler.
$$(shell $(RM) $$($1_BIN)/_the.list_of_sources)
......@@ -233,29 +247,53 @@ define SetupNativeCompilation
ifeq ($(HOST_OS_API), winapi)
ifneq (,$$($1_VERSIONINFO_RESOURCE))
ifneq (,$$($1_LIB))
ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
$1_RES:=$$(patsubst %$(SHARED_LIBRARY_SUFFIX),%.res,$$($1_LIB))
else
$1_RES:=$$(patsubst %$(STATIC_LIBRARY_SUFFIX),%.res,$$($1_LIB))
endif
$1_BASENAME:=$$(basename $$(notdir $$($1_LIB)))
endif
ifneq (,$$($1_EXE))
$1_RES:=$$(patsubst %$(EXE_SUFFIX),%.res,$$($1_EXE))
$1_BASENAME:=$$(basename $$(notdir $$($1_EXE)))
endif
$1_RES:=$$($1_BIN)/$$($1_BASENAME).res
$$($1_RES): $$($1_VERSIONINFO_RESOURCE)
$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
endif
ifneq (,$$($1_MANIFEST))
$1_PROGRAM:=$$(basename $$(notdir $$($1_EXE)))
$1_GEN_MANIFEST:=$$($1_BIN)/$$($1_PROGRAM).manifest
IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
$$($1_GEN_MANIFEST): $$($1_MANIFEST)
$(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@
endif
endif
# mapfile doesnt seem to be implemented on macosx (yet??)
ifneq ($(HOST_OS),macosx)
ifneq ($(HOST_OS),windows)
$1_REAL_MAPFILE := $$($1_MAPFILE)
ifneq (,$$($1_REORDER))
$1_REAL_MAPFILE := $$($1_BIN)/mapfile
$$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
$$(MKDIR) -p $$(@D)
$$(CP) $$($1_MAPFILE) $$@.tmp
$$(SED) -e 's=OUTPUTDIR=$$($1_BIN)=' $$($1_REORDER) >> $$@.tmp
$$(MV) $$@.tmp $$@
endif
endif
endif
# Pickup extra HOST_OS_API dependent variables (posix or winapi) and
# (linux,solaris,windows,bsd) for LDFLAGS and LDFLAGS_SUFFIX
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(HOST_OS_API)) $$($1_LDFLAGS_$(PLATFORM))
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(HOST_OS_API)) $$($1_LDFLAGS_SUFFIX_$(PLATFORM))
ifneq (,$$($1_REAL_MAPFILE))
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
endif
ifneq (,$$($1_LIB))
ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
# Generating a dynamic library.
$1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$(notdir $$($1_LIB)))
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES)
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE)
$$(call LINKING_MSG,$$(notdir $$($1_LIB)))
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$($1_LIB) \
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
......@@ -269,9 +307,13 @@ define SetupNativeCompilation
endif
ifneq (,$$($1_EXE))
# A executable binary has been specified, setup the target for it.
$$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES)
$$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
$$(call LINKING_EXE_MSG,$$(notdir $$($1_EXE)))
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_EXE) \
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
$$($1_EXTRA_LDFLAGS_SUFFIX)
ifneq (,$$($1_GEN_MANIFEST))
$(MT) -nologo /manifest $$($1_GEN_MANIFEST) /outputresource:$$@;#1
endif
endif
endef
......@@ -112,6 +112,9 @@ for i in ${repos} ; do
sleep 5
fi
done
# Wait for all hg commands to complete
wait
if [ "${repos_extra}" != "" ] ; then
for i in ${repos_extra} ; do
echo "Starting on ${i}"
......@@ -127,11 +130,10 @@ if [ "${repos_extra}" != "" ] ; then
sleep 5
fi
done
# Wait for all hg commands to complete
wait
fi
# Wait for all hg commands to complete
wait
# Cleanup
rm -f -r ${tmp}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册