提交 fd179675 编写于 作者: E erikj

7181504: Update of latest build-infra Makefiles

Reviewed-by: ohair
上级 67c77dd3
......@@ -22,5 +22,19 @@
# questions.
#
autoconf -W all configure.ac > configure
rm -rf config.status config.log autom4te.cache
script_dir=`dirname $0`
closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
# Create a timestamp as seconds since epoch
TIMESTAMP=`date +%s`
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
rm -rf autom4te.cache
if test -e $closed_script_dir/closed-hook.m4; then
# We have closed sources available; also generate configure script
# with closed hooks compiled in.
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
sed -e "s|AC_DEFUN_ONCE(\[CLOSED_HOOK\])|m4_include([$closed_script_dir/closed-hook.m4])|" | autoconf -W all -I$script_dir - > $closed_script_dir/generated-configure.sh
rm -rf autom4te.cache
fi
......@@ -31,11 +31,11 @@
# Translate a configuration triplet/quadruplet into something
# known by this configuration file.
# If no rewrite was found, then rewritten_host=${host}
# If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_SYSTEM}
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
# The needed cups builddeps are host independent header files.
# The needed cups builddeps are platform independent header files.
# I.e. they need not be part of the devkit.
builddep_cups=lib/cups_1_3_9.zip
builddep_cups_CFLAGS=-I${depdir}
......@@ -44,10 +44,10 @@ builddep_cups_CFLAGS=-I${depdir}
# for the build platform.
builddep_devkit=sdk/sdk-${rewritten_build}-20110921.tar.gz
# The freetype dependency is partyl host dependent.
# The freetype dependency is partly platform dependent.
# It is stored inside the sys-root.
builddep_freetype2=sdk/sdk-${rewritten_build}-20110921.tar.gz
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_host}/sys-root/usr/include/freetype2
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_target}/sys-root/usr/include/freetype2
builddep_freetype2_LIBS=-lfreetype
# There are many other build dependencies, but they are implicitly
......
......@@ -23,7 +23,7 @@
# questions.
#
AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS],
[
define(LIST_OF_BUILD_DEPENDENCIES,)
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
......@@ -50,27 +50,27 @@ AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
AC_MSG_ERROR([Could not find any builddeps.conf at all!])
fi
fi
# Create build and host names that use _ instead of "-" and ".".
# Create build and target names that use _ instead of "-" and ".".
# This is necessary to use them in variable names.
build_var=`echo ${build} | tr '-' '_' | tr '.' '_'`
host_var=`echo ${host} | tr '-' '_' | tr '.' '_'`
# Extract rewrite information for build and host
build_var=`echo ${OPENJDK_BUILD_SYSTEM} | tr '-' '_' | tr '.' '_'`
target_var=`echo ${OPENJDK_TARGET_SYSTEM} | tr '-' '_' | tr '.' '_'`
# Extract rewrite information for build and target
eval rewritten_build=\${REWRITE_${build_var}}
if test "x$rewritten_build" = x; then
rewritten_build=${build}
rewritten_build=${OPENJDK_BUILD_SYSTEM}
echo Build stays the same $rewritten_build
else
echo Rewriting build for builddeps into $rewritten_build
fi
eval rewritten_host=\${REWRITE_${host_var}}
if test "x$rewritten_host" = x; then
rewritten_host=${host}
echo Host stays the same $rewritten_host
eval rewritten_target=\${REWRITE_${target_var}}
if test "x$rewritten_target" = x; then
rewritten_target=${OPENJDK_TARGET_SYSTEM}
echo Target stays the same $rewritten_target
else
echo Rewriting host for builddeps into $rewritten_host
echo Rewriting target for builddeps into $rewritten_target
fi
rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'`
rewritten_host_var=`echo ${rewritten_host} | tr '-' '_' | tr '.' '_'`
rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'`
fi
AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip])
if test "x$BDEPS_UNZIP" = x7z; then
......@@ -127,11 +127,11 @@ AC_DEFUN([BDEPS_CHECK_MODULE],
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
# Source the builddeps file again, to make sure it uses the latest variables!
. $builddepsfile
# Look for a host and build machine specific resource!
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}}
# Look for a target and build machine specific resource!
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}}
if test "x$resource" = x; then
# Ok, lets instead look for a host specific resource
eval resource=\${builddep_$2_HOST_${rewritten_host_var}}
# Ok, lets instead look for a target specific resource
eval resource=\${builddep_$2_TARGET_${rewritten_target_var}}
fi
if test "x$resource" = x; then
# Ok, lets instead look for a build specific resource
......@@ -228,3 +228,33 @@ AC_DEFUN([BDEPS_FETCH],
$5=$installdir
fi
])
AC_DEFUN_ONCE([BDEPS_CONFIGURE_BUILDDEPS],
[
AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf],
[use this configuration file for the builddeps])])
AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server],
[download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])])
AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir],
[store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])],
[],
[with_builddeps_dir=/localhome/builddeps])
AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group],
[chgrp the downloaded build dependencies to this group])])
AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps],
[list all build dependencies known to the configure script])],
[LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no'])
if test "x$LIST_BUILDDEPS" = xyes; then
echo
echo List of build dependencies known to the configure script,
echo that can be used in builddeps.conf files:
cat $AUTOCONF_DIR/*.ac $AUTOCONF_DIR/*.m4 | grep BDEPS_CHECK_MODUL[E]\( | cut -f 2 -d ',' | tr -d ' ' | sort
echo
exit 1
fi
])
此差异已折叠。
此差异已折叠。
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#
AC_DEFUN([CHECK_CORES],
[
AC_MSG_CHECKING([for number of cores])
NUM_CORES=1
FOUND_CORES=no
if test -f /proc/cpuinfo; then
# Looks like a Linux system
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
FOUND_CORES=yes
fi
if test -x /usr/sbin/psrinfo; then
# Looks like a Solaris system
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
FOUND_CORES=yes
fi
if test -x /usr/sbin/system_profiler; then
# Looks like a MacOSX system
NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
FOUND_CORES=yes
fi
if test "x$build_os" = xwindows; then
NUM_CORES=4
fi
# For c/c++ code we run twice as many concurrent build
# jobs than we have cores, otherwise we will stall on io.
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
if test "x$FOUND_CORES" = xyes; then
AC_MSG_RESULT([$NUM_CORES])
else
AC_MSG_RESULT([could not detect number of cores, defaulting to 1!])
fi
])
AC_DEFUN([CHECK_MEMORY_SIZE],
[
AC_MSG_CHECKING([for memory size])
# Default to 1024MB
MEMORY_SIZE=1024
FOUND_MEM=no
if test -f /proc/cpuinfo; then
# Looks like a Linux system
MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
FOUND_MEM=yes
fi
if test -x /usr/sbin/prtconf; then
# Looks like a Solaris system
MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'`
FOUND_MEM=yes
fi
if test -x /usr/sbin/system_profiler; then
# Looks like a MacOSX system
MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
FOUND_MEM=yes
fi
if test "x$build_os" = xwindows; then
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
FOUND_MEM=yes
fi
if test "x$FOUND_MEM" = xyes; then
AC_MSG_RESULT([$MEMORY_SIZE MB])
else
AC_MSG_RESULT([could not detect memory size defaulting to 1024MB!])
fi
])
......@@ -23,11 +23,13 @@
# questions.
#
function prepare_help_system {
AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
[
AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
}
function help_on_build_dependency {
])
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
[
# Print a helpful message on how to acquire the necessary build dependency.
# $1 is the help tag: freetyp2, cups, pulse, alsa etc
MISSING_DEPENDENCY=$1
......@@ -51,9 +53,9 @@ function help_on_build_dependency {
if test "x$PKGHANDLER_COMMAND" != x; then
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
fi
}
])
function apt_help {
apt_help() {
case $1 in
devkit)
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
......@@ -76,7 +78,7 @@ function apt_help {
esac
}
function yum_help {
yum_help() {
case $1 in
devkit)
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
......@@ -99,14 +101,97 @@ function yum_help {
esac
}
function port_help {
port_help() {
PKGHANDLER_COMMAND=""
}
function pkgutil_help {
pkgutil_help() {
PKGHANDLER_COMMAND=""
}
function pkgadd_help {
pkgadd_help() {
PKGHANDLER_COMMAND=""
}
AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
[
# Finally output some useful information to the user
if test "x$CCACHE_FOUND" != x; then
if test "x$HAS_GOOD_CCACHE" = x; then
CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
else
CCACHE_STATUS="installed and in use"
fi
else
if test "x$GCC" = xyes; then
CCACHE_STATUS="not installed (consider installing)"
CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
else
CCACHE_STATUS="not available for your system"
fi
fi
printf "\n"
printf "====================================================\n"
printf "A new configuration has been successfully created in\n"
printf "$OUTPUT_ROOT\n"
if test "x$CONFIGURE_COMMAND_LINE" != x; then
printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
else
printf "using default settings.\n"
fi
printf "\n"
printf "Configuration summary:\n"
printf "* Debug level: $DEBUG_LEVEL\n"
printf "* JDK variant: $JDK_VARIANT\n"
printf "* JVM variants: $with_jvm_variants\n"
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
printf "* Boot JDK: $BOOT_JDK\n"
printf "\n"
printf "Build performance summary:\n"
printf "* Cores to use: $NUM_CORES\n"
printf "* Memory limit: $MEMORY_SIZE MB\n"
printf "* ccache status: $CCACHE_STATUS\n"
printf "\n"
if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
printf "$CCACHE_HELP_MSG\n"
HELP_MSG_MISSING_DEPENDENCY([ccache])
printf "$HELP_MSG\n"
printf "\n"
fi
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
printf "NOTE: You have requested to build more than one version of the JVM, which\n"
printf "will result in longer build times.\n"
printf "\n"
fi
if test "x$FOUND_ALT_VARIABLES" != "x"; then
printf "WARNING: You have old-style ALT_ environment variables set.\n"
printf "These are not respected, and will be ignored. It is recommended\n"
printf "that you clean your environment. The following variables are set:\n"
printf "$FOUND_ALT_VARIABLES\n"
printf "\n"
fi
if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
printf "WARNING: Your build output directory is not on a local disk.\n"
printf "This will severely degrade build performance!\n"
printf "It is recommended that you create an output directory on a local disk,\n"
printf "and run the configure script again from that directory.\n"
printf "\n"
fi
if test "x$IS_RECONFIGURE" = "xyes"; then
printf "WARNING: The result of this configuration has overridden an older\n"
printf "configuration. You *should* run 'make clean' to make sure you get a\n"
printf "proper build. Failure to do so might result in strange build problems.\n"
printf "\n"
fi
])
此差异已折叠。
此差异已折叠。
......@@ -177,40 +177,44 @@ else
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
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=`ls -l ${OLD}/$f | awk '{printf("%.10s\n", $1);}'`
NP=`ls -l ${NEW}/$f | awk '{printf("%.10s\n", $1);}'`
if [ "$OP" != "$NP" ]
then
if [ -z "$found" ]; then echo ; found="yes"; fi
printf "\told: ${OP} new: ${NP}\t$f\n"
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" ]
OF=`cd ${OLD} && file $f`
NF=`cd ${NEW} && file $f`
if [ "$f" = "./src.zip" ]
then
if [ "`echo $OF | grep -ic zip`" -gt 0 -a "`echo $NF | grep -ic zip`" -gt 0 ]
then
if [ -z "$found" ]; then echo ; found="yes"; fi
printf "\told: ${OP} new: ${NP}\t$f\n"
# the way we produces zip-files make it so that directories are stored in old file
# but not in new (only files with full-path)
# this makes file-5.09 report them as different
continue;
fi
done
if [ -z "$found" ]; then echo ; found="yes"; fi
fi
fi
if [ "$OF" != "$NF" ]
then
if [ -z "$found" ]; then echo ; found="yes"; fi
printf "\tFILE: old: ${OF} new: ${NF}\t$f\n"
fi
done
if [ -z "$found" ]; then echo ; found="yes"; fi
GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
! -name "ct.sym" \
! -name "ct.sym" ! -name "*.diz" \
| grep -v "./bin/" | sort | $FILTER)
echo General files...
for f in $GENERAL_FILES
......
此差异已折叠。
......@@ -72,7 +72,11 @@ else
fi
if [ "`uname`" == "SunOS" ]; then
DIFF=gdiff
if [ -f "`which gdiff`" ]; then
DIFF=gdiff
else
DIFF=diff
fi
else
DIFF=diff
fi
......
此差异已折叠。
此差异已折叠。
......@@ -138,6 +138,7 @@ endef
# Hook to be called as the very first thing when running a normal build
define AtRootMakeStart
$(if $(findstring -j,$(MAKEFLAGS)), $(error make -j is not supported, use make JOBS=n))
$(call PrintStartMessage)
$(call StartTimer)
endef
......
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册