提交 ce54264b 编写于 作者: D duke

Merge

^build/
^dist/
/nbproject/private/
nbproject/private/
^webrev
^.hgtip
^.bridge2
.DS_Store
......@@ -177,3 +177,4 @@ c97b99424815c43818e3cc3ffcdd1a60f3198b52 jdk8-b49
febd7ff5280067ca482faaeb9418ae88764c1a35 jdk8-b53
c1a277c6022affbc6855bdfb039511e73fbe2395 jdk8-b54
b85b44cced2406792cfb9baab1377ff03e7001d8 jdk8-b55
76844579fa4b30929731115b237e477181a82394 jdk8-b56
#
# Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1995, 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
......@@ -23,6 +23,16 @@
# questions.
#
# If NEWBUILD is defined, use the new build-infra Makefiles and configure.
# See NewMakefile.gmk for more information.
ifeq ($(NEWBUILD),true)
# The new top level Makefile
include NewMakefile.gmk
else # Original Makefile logic
BUILD_PARENT_DIRECTORY=.
# Basename of any originally supplied ALT_OUTPUTDIR directory
......@@ -557,3 +567,5 @@ include ./make/jprt.gmk
# Force target
FRC:
endif # Original Makefile logic
#
# Copyright (c) 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.
#
# Utilities used in this Makefile
BASENAME=basename
CAT=cat
CD=cd
CMP=cmp
CP=cp
ECHO=echo
MKDIR=mkdir
PWD=pwd
SH=sh
ifeq ($(PLATFORM),windows)
ZIP=zip
else
# store symbolic links as the link
ZIP=zip -y
endif
# Insure we have a path that looks like it came from pwd
# (This is mostly for Windows sake and drive letters)
define UnixPath # path
$(shell (cd "$1" && $(PWD)))
endef
# Current root directory
CURRENT_DIRECTORY := $(shell $(PWD))
# Build directory root
BUILD_DIR_ROOT = $(CURRENT_DIRECTORY)/build
# All configured Makefiles to run
ALL_MAKEFILES = $(wildcard $(BUILD_DIR_ROOT)/*-*/Makefile)
# All bundles to create
ALL_IMAGE_DIRS = $(wildcard $(BUILD_DIR_ROOT)/*-*/images/*-image)
# Build all the standard 'all', 'images', and 'clean' targets
all images clean: checks
@if [ "$(ALL_MAKEFILES)" = "" ] ; then \
$(ECHO) "ERROR: No configurations to build"; exit 1; \
fi
@for bdir in $(dir $(ALL_MAKEFILES)) ; do \
$(ECHO) "$(CD) $${bdir} && $(MAKE) $(EXTRA_MAKE_ARGS) $@" ; \
$(CD) $${bdir} && $(MAKE) $(EXTRA_MAKE_ARGS) $@ ; \
done
# Bundle creation
bundles:
@if [ "$(ALL_IMAGE_DIRS)" = "" ] ; then \
$(ECHO) "ERROR: No images to bundle"; exit 1; \
fi
@for i in $(ALL_IMAGE_DIRS) ; do \
$(MKDIR) -p $${i}/../../bundles && \
$(RM) $${i}/../../bundles/`$(BASENAME) $${i}`.zip && \
$(ECHO) "$(CD) $${i} && $(ZIP) -q -r ../../bundles/`$(BASENAME) $${i}`.zip ." && \
$(CD) $${i} && $(ZIP) -q -r ../../bundles/`$(BASENAME) $${i}`.zip . ; \
done
# Clobber all the built files
clobber::
$(RM) -r $(BUILD_DIR_ROOT)
# Make various checks to insure the build will be successful
# Possibilities:
# * Check that if any closed repo is provided, they all must be.
# * Check that all open repos exist, at least until we are ready for some
# kind of partial build.
checks:
@$(ECHO) "No checks yet"
# Keep track of phony targets
PHONY_LIST += all images clean clobber checks
###########################################################################
# To help in adoption of the new configure&&make build process, a bridge
# build will use the old settings to run configure and do the build.
# Build with the configure bridge
bridgeBuild: bridge2configure images
# Bridge from old Makefile ALT settings to configure options
bridge2configure: .bridge2configureOpts
$(CD) common/makefiles && sh ../autoconf/configure $(strip $(shell $(CAT) $<))
# Create a file with configure options created from old Makefile mechanisms.
.bridge2configureOpts: .bridge2configureOptsLatest
$(RM) $@
$(CP) $< $@
# In case make was invoked from a specific path
_MAKE_COMMAND_PATH:=$(firstword $(MAKE))
ifneq ($(dir $(_MAKE_COMMAND_PATH)),./)
# This could be removed someday if JPRT was fixed and we could assume that
# the path to make was always in PATH.
MAKE_BINDIR:=$(call UnixPath,$(dir $(_MAKE_COMMAND_PATH)))
NEWPATH:=$(MAKE_BINDIR):${PATH}
PATH:=$(NEWPATH)
export PATH
MAKE_COMMAND=$(MAKE_BINDIR)/$(notdir $(_MAKE_COMMAND_PATH))
else
MAKE_COMMAND=$(_MAKE_COMMAND_PATH)
endif
# Use this file to only change when obvious things have changed
.bridge2configureOptsLatest: FRC
$(RM) $@.tmp
@$(ECHO) " MAKE=$(MAKE_COMMAND) " >> $@.tmp
@$(ECHO) " --with-debug-level=$(if $(DEBUG_LEVEL),$(DEBUG_LEVEL),release) " >> $@.tmp
ifdef ARCH_DATA_MODEL
@$(ECHO) " --with-target-bits=$(ARCH_DATA_MODEL) " >> $@.tmp
endif
ifdef ALT_PARALLEL_COMPILE_JOBS
@$(ECHO) " --with-num-cores=$(ALT_PARALLEL_COMPILE_JOBS) " >> $@.tmp
endif
ifdef ALT_BOOTDIR
@$(ECHO) " --with-boot-jdk=$(call UnixPath,$(ALT_BOOTDIR)) " >> $@.tmp
endif
ifdef ALT_CUPS_HEADERS_PATH
@$(ECHO) " --with-cups-include=$(call UnixPath,$(ALT_CUPS_HEADERS_PATH)) " >> $@.tmp
endif
ifdef ALT_FREETYPE_HEADERS_PATH
@$(ECHO) " --with-freetype=$(call UnixPath,$(ALT_FREETYPE_HEADERS_PATH)/..) " >> $@.tmp
endif
@if [ -f $@ ] ; then \
if ! $(CMP) $@ $@.tmp > /dev/null ; then \
$(CP) $@.tmp $@ ; \
fi ; \
else \
$(CP) $@.tmp $@ ; \
fi
$(RM) $@.tmp
# Clobber all the built files
clobber:: bridge2clobber
bridge2clobber::
$(RM) .bridge2*
# Keep track of phony targets
PHONY_LIST += bridge2configure bridgeBuild bridge2clobber
###########################################################################
# Javadocs
#
javadocs:
cd common/makefiles && $(MAKE) -f MakefileJavadoc.gmk
# Keep track of phony targets
PHONY_LIST += javadocs
###########################################################################
# JPRT targets
ifndef JPRT_ARCHIVE_BUNDLE
JPRT_ARCHIVE_BUNDLE=/tmp/jprt_bundles/j2sdk-image.zip
endif
jprt_build_product: DEBUG_LEVEL=release
jprt_build_product: BUILD_DIRNAME=*-release
jprt_build_product: jprt_build_generic
jprt_build_fastdebug: DEBUG_LEVEL=fastdebug
jprt_build_fastdebug: BUILD_DIRNAME=*-fastdebug
jprt_build_fastdebug: jprt_build_generic
jprt_build_debug: DEBUG_LEVEL=slowdebug
jprt_build_debug: BUILD_DIRNAME=*-debug
jprt_build_debug: jprt_build_generic
jprt_build_generic: EXTRA_MAKE_ARGS=LOG=nofile,info
jprt_build_generic: $(JPRT_ARCHIVE_BUNDLE)
$(JPRT_ARCHIVE_BUNDLE): bridgeBuild bundles
$(MKDIR) -p $(@D)
$(RM) $@
$(CP) $(BUILD_DIR_ROOT)/$(BUILD_DIRNAME)/bundles/j2sdk-image.zip $@
# Keep track of phony targets
PHONY_LIST += jprt_build_product jprt_build_fastdebug jprt_build_debug \
jprt_build_generic
###########################################################################
# Phony targets
.PHONY: $(PHONY_LIST)
# Force target
FRC:
......@@ -23,18 +23,38 @@
#
script_dir=`dirname $0`
closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
# Create a timestamp as seconds since epoch
TIMESTAMP=`date +%s`
if test "x`uname -s`" = "xSunOS"; then
# date +%s is not available on Solaris, use this workaround
# from http://solarisjedi.blogspot.co.uk/2006/06/solaris-date-command-and-epoch-time.html
TIMESTAMP=`/usr/bin/truss /usr/bin/date 2>&1 | nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}'`
# On Solaris /bin/sh doesn't support test -e but /usr/bin/test does.
TEST=`which test`
else
TIMESTAMP=`date +%s`
TEST="test"
fi
if $TEST "$CUSTOM_CONFIG_DIR" = ""; then
custom_script_dir="$script_dir/../../jdk/make/closed/autoconf"
else
custom_script_dir=$CUSTOM_CONFIG_DIR
fi
custom_hook=$custom_script_dir/custom-hook.m4
echo Generating generated-configure.sh
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.
if $TEST -e $custom_hook; then
echo Generating custom generated-configure.sh
# We have custom sources available; also generate configure script
# with custom 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
sed -e "s|AC_DEFUN_ONCE(\[CUSTOM_HOOK\])|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
rm -rf autom4te.cache
else
echo No custom hook found: $custom_hook
fi
......@@ -34,7 +34,7 @@ AC_DEFUN([ADD_JVM_ARG_IF_OK],
fi
])
AC_DEFUN([WHICHCMD],
AC_DEFUN([SET_FULL_PATH],
[
# Translate "gcc -E" into "`which gcc` -E" ie
# extract the full path to the binary and at the
......@@ -46,7 +46,7 @@ AC_DEFUN([WHICHCMD],
cdr="${tmp#* }"
# On windows we want paths without spaces.
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
WHICHCMD_SPACESAFE(car)
SET_FULL_PATH_SPACESAFE(car)
else
# "which" is not portable, but is used here
# because we know that the command exists!
......@@ -66,15 +66,19 @@ AC_DEFUN([SPACESAFE],
HAS_SPACE=`echo "[$]$1" | grep " "`
if test "x$HAS_SPACE" != x; then
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
# First convert it to DOS-style, short mode (no spaces)
$1=`$CYGPATH -s -m -a "[$]$1"`
$1=`$CYGPATH -u "[$]$1"`
# Now it's case insensitive; let's make it lowercase to improve readability
$1=`$ECHO "[$]$1" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'`
# Now convert it back to Unix-stile (cygpath)
$1=`$CYGPATH -u "[$]$1"`
else
AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
fi
fi
])
AC_DEFUN([WHICHCMD_SPACESAFE],
AC_DEFUN([SET_FULL_PATH_SPACESAFE],
[
# Translate long cygdrive or C:\sdfsf path
# into a short mixed mode path that has no
......@@ -148,15 +152,16 @@ AC_DEFUN_ONCE([BASIC_INIT],
AC_SUBST(CONFIGURE_COMMAND_LINE)
DATE_WHEN_CONFIGURED=`LANG=C date`
AC_SUBST(DATE_WHEN_CONFIGURED)
])
# Setup basic configuration paths, and platform-specific stuff related to PATHs.
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
[
# Locate the directory of this script.
SCRIPT="[$]0"
REMOVE_SYMBOLIC_LINKS(SCRIPT)
REMOVE_SYMBOLIC_LINKS(SCRIPT)
AUTOCONF_DIR=`dirname [$]0`
])
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
[
# Where is the source? It is located two levels above the configure script.
CURDIR="$PWD"
cd "$AUTOCONF_DIR/../.."
......@@ -172,18 +177,12 @@ cd "$CURDIR"
SPACESAFE(SRC_ROOT,[the path to the source root])
SPACESAFE(CURDIR,[the path to the current directory])
])
AC_DEFUN_ONCE([BASIC_SETUP_SEARCHPATH],
[
if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
# Add extra search paths on solaris for utilities like ar and as etc...
PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
fi
])
AC_DEFUN_ONCE([BASIC_SETUP_PATH_SEP],
[
# For cygwin we need cygpath first, since it is used everywhere.
AC_PATH_PROG(CYGPATH, cygpath)
PATH_SEP=":"
......@@ -194,6 +193,36 @@ if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
PATH_SEP=";"
fi
AC_SUBST(PATH_SEP)
# You can force the sys-root if the sys-root encoded into the cross compiler tools
# is not correct.
AC_ARG_WITH(sys-root, [AS_HELP_STRING([--with-sys-root],
[pass this sys-root to the compilers and linker (useful if the sys-root encoded in
the cross compiler tools is incorrect)])])
if test "x$with_sys_root" != x; then
SYS_ROOT=$with_sys_root
else
SYS_ROOT=/
fi
AC_SUBST(SYS_ROOT)
AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
[search this directory for (cross-compiling) compilers and tools])], [TOOLS_DIR=$with_tools_dir])
AC_ARG_WITH([devkit], [AS_HELP_STRING([--with-devkit],
[use this directory as base for tools-dir and sys-root (for cross-compiling)])],
[
if test "x$with_sys_root" != x; then
AC_MSG_ERROR([Cannot specify both --with-devkit and --with-sys-root at the same time])
fi
if test "x$with_tools_dir" != x; then
AC_MSG_ERROR([Cannot specify both --with-devkit and --with-tools-dir at the same time])
fi
TOOLS_DIR=$with_devkit/bin
SYS_ROOT=$with_devkit/$host_alias/libc
])
])
AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
......@@ -236,7 +265,13 @@ AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
# The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
# The spec.sh file contains variables for compare{images|-objects}.sh scrips.
# The hotspot-spec.gmk file contains legacy variables for the hotspot make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/hotspot-spec.gmk:$AUTOCONF_DIR/hotspot-spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
# The compare.sh is used to compare the build output to other builds.
AC_CONFIG_FILES([$OUTPUT_ROOT/compare.sh:$AUTOCONF_DIR/compare.sh.in])
# Spec.sh is currently used by compare-objects.sh
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
# The generated Makefile knows where the spec.gmk is and where the source is.
# You can run make from the OUTPUT_ROOT, or from the top-level Makefile
......@@ -261,6 +296,79 @@ AC_SUBST(BUILD_LOG_WRAPPER)
#%%% Simple tools %%%
# Check if we have found a usable version of make
# $1: the path to a potential make binary (or empty)
# $2: the description on how we found this
AC_DEFUN([BASIC_CHECK_MAKE_VERSION],
[
MAKE_CANDIDATE="$1"
DESCRIPTION="$2"
if test "x$MAKE_CANDIDATE" != x; then
AC_MSG_NOTICE([Testing potential make at $MAKE_CANDIDATE, found using $DESCRIPTION])
SET_FULL_PATH(MAKE_CANDIDATE)
MAKE_VERSION_STRING=`$MAKE_CANDIDATE --version | $HEAD -n 1`
IS_GNU_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP 'GNU Make'`
if test "x$IS_GNU_MAKE" = x; then
AC_MSG_NOTICE([Found potential make at $MAKE_CANDIDATE, however, this is not GNU Make. Ignoring.])
else
IS_MODERN_MAKE=`$ECHO $MAKE_VERSION_STRING | $GREP '3.8[[12346789]]'`
if test "x$IS_MODERN_MAKE" = x; then
AC_MSG_NOTICE([Found GNU make at $MAKE_CANDIDATE, however this is not version 3.81 or later. (it is: $MAKE_VERSION_STRING). Ignoring.])
else
FOUND_MAKE=$MAKE_CANDIDATE
fi
fi
fi
])
# Goes looking for a usable version of GNU make.
AC_DEFUN([BASIC_CHECK_GNU_MAKE],
[
# We need to find a recent version of GNU make. Especially on Solaris, this can be tricky.
if test "x$MAKE" != x; then
# User has supplied a make, test it.
if test ! -f "$MAKE"; then
AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not found.])
fi
BASIC_CHECK_MAKE_VERSION("$MAKE", [user supplied MAKE=])
if test "x$FOUND_MAKE" = x; then
AC_MSG_ERROR([The specified make (by MAKE=$MAKE) is not GNU make 3.81 or newer.])
fi
else
# Try our hardest to locate a correct version of GNU make
AC_PATH_PROGS(CHECK_GMAKE, gmake)
BASIC_CHECK_MAKE_VERSION("$CHECK_GMAKE", [gmake in PATH])
if test "x$FOUND_MAKE" = x; then
AC_PATH_PROGS(CHECK_MAKE, make)
BASIC_CHECK_MAKE_VERSION("$CHECK_MAKE", [make in PATH])
fi
if test "x$FOUND_MAKE" = x; then
if test "x$TOOLS_DIR" != x; then
# We have a tools-dir, check that as well before giving up.
OLD_PATH=$PATH
PATH=$TOOLS_DIR:$PATH
AC_PATH_PROGS(CHECK_TOOLSDIR_GMAKE, gmake)
BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_GMAKE", [gmake in tools-dir])
if test "x$FOUND_MAKE" = x; then
AC_PATH_PROGS(CHECK_TOOLSDIR_MAKE, make)
BASIC_CHECK_MAKE_VERSION("$CHECK_TOOLSDIR_MAKE", [make in tools-dir])
fi
PATH=$OLD_PATH
fi
fi
if test "x$FOUND_MAKE" = x; then
AC_MSG_ERROR([Cannot find GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
fi
fi
MAKE=$FOUND_MAKE
AC_SUBST(MAKE)
AC_MSG_NOTICE([Using GNU make 3.81 (or later) at $FOUND_MAKE (version: $MAKE_VERSION_STRING)])
])
AC_DEFUN([BASIC_CHECK_FIND_DELETE],
[
# Test if find supports -delete
......@@ -283,10 +391,30 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE],
rmdir $DELETEDIR
])
# Test that variable $1 denoting a program is not empty. If empty, exit with an error.
# $1: variable to check
# $2: executable name to print in warning (optional)
AC_DEFUN([CHECK_NONEMPTY],
[
# Test that variable $1 is not empty.
if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
if test "x[$]$1" = x; then
if test "x$2" = x; then
PROG_NAME=translit($1,A-Z,a-z)
else
PROG_NAME=$2
fi
AC_MSG_NOTICE([Could not find $PROG_NAME!])
AC_MSG_ERROR([Cannot continue])
fi
])
# Does AC_PATH_PROG followed by CHECK_NONEMPTY.
# Arguments as AC_PATH_PROG:
# $1: variable to set
# $2: executable name to look for
AC_DEFUN([BASIC_REQUIRE_PROG],
[
AC_PATH_PROGS($1, $2)
CHECK_NONEMPTY($1, $2)
])
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
......@@ -295,90 +423,68 @@ AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
# and can be expected to be found in the default PATH. These tools are
# used by configure. Nor are these tools expected to be found in the
# devkit from the builddeps server either, since they are
# needed to download the devkit.
# needed to download the devkit.
# First are all the simple required tools.
BASIC_REQUIRE_PROG(BASENAME, basename)
BASIC_REQUIRE_PROG(CAT, cat)
BASIC_REQUIRE_PROG(CHMOD, chmod)
BASIC_REQUIRE_PROG(CMP, cmp)
BASIC_REQUIRE_PROG(CP, cp)
BASIC_REQUIRE_PROG(CPIO, cpio)
BASIC_REQUIRE_PROG(CUT, cut)
BASIC_REQUIRE_PROG(DATE, date)
BASIC_REQUIRE_PROG(DF, df)
BASIC_REQUIRE_PROG(DIFF, [gdiff diff])
BASIC_REQUIRE_PROG(ECHO, echo)
BASIC_REQUIRE_PROG(EXPR, expr)
BASIC_REQUIRE_PROG(FILE, file)
BASIC_REQUIRE_PROG(FIND, find)
BASIC_REQUIRE_PROG(HEAD, head)
BASIC_REQUIRE_PROG(LN, ln)
BASIC_REQUIRE_PROG(LS, ls)
BASIC_REQUIRE_PROG(MKDIR, mkdir)
BASIC_REQUIRE_PROG(MV, mv)
BASIC_REQUIRE_PROG(PRINTF, printf)
BASIC_REQUIRE_PROG(SH, sh)
BASIC_REQUIRE_PROG(SORT, sort)
BASIC_REQUIRE_PROG(TAIL, tail)
BASIC_REQUIRE_PROG(TAR, tar)
BASIC_REQUIRE_PROG(TEE, tee)
BASIC_REQUIRE_PROG(TOUCH, touch)
BASIC_REQUIRE_PROG(TR, tr)
BASIC_REQUIRE_PROG(UNIQ, uniq)
BASIC_REQUIRE_PROG(UNZIP, unzip)
BASIC_REQUIRE_PROG(WC, wc)
BASIC_REQUIRE_PROG(XARGS, xargs)
BASIC_REQUIRE_PROG(ZIP, zip)
# Then required tools that require some special treatment.
AC_PROG_AWK
CHECK_NONEMPTY(AWK)
AC_PATH_PROG(CAT, cat)
CHECK_NONEMPTY(CAT)
AC_PATH_PROG(CHMOD, chmod)
CHECK_NONEMPTY(CHMOD)
AC_PATH_PROG(CP, cp)
CHECK_NONEMPTY(CP)
AC_PATH_PROG(CPIO, cpio)
CHECK_NONEMPTY(CPIO)
AC_PATH_PROG(CUT, cut)
CHECK_NONEMPTY(CUT)
AC_PATH_PROG(DATE, date)
CHECK_NONEMPTY(DATE)
AC_PATH_PROG(DF, df)
CHECK_NONEMPTY(DF)
AC_PATH_PROG(DIFF, diff)
CHECK_NONEMPTY(DIFF)
# Warning echo is really, really unportable!!!!! Different
# behaviour in bash and dash and in a lot of other shells!
# Use printf for serious work!
AC_PATH_PROG(ECHO, echo)
CHECK_NONEMPTY(ECHO)
AC_PROG_GREP
CHECK_NONEMPTY(GREP)
AC_PROG_EGREP
CHECK_NONEMPTY(EGREP)
AC_PROG_FGREP
CHECK_NONEMPTY(FGREP)
AC_PROG_SED
CHECK_NONEMPTY(SED)
AC_PATH_PROGS(NAWK, [nawk gawk awk])
CHECK_NONEMPTY(NAWK)
BASIC_CHECK_GNU_MAKE
BASIC_REQUIRE_PROG(RM, rm)
RM="$RM -f"
AC_PATH_PROG(FIND, find)
CHECK_NONEMPTY(FIND)
BASIC_CHECK_FIND_DELETE
AC_SUBST(FIND_DELETE)
AC_PROG_GREP
CHECK_NONEMPTY(GREP)
AC_PATH_PROG(HEAD, head)
CHECK_NONEMPTY(HEAD)
AC_PATH_PROG(LN, ln)
CHECK_NONEMPTY(LN)
AC_PATH_PROG(LS, ls)
CHECK_NONEMPTY(LS)
AC_PATH_PROGS(MAKE, [gmake make])
CHECK_NONEMPTY(MAKE)
MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'`
if test "x$MAKE_VERSION" = x; then
AC_MSG_ERROR([You must use GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
fi
AC_PATH_PROG(MKDIR, mkdir)
CHECK_NONEMPTY(MKDIR)
AC_PATH_PROG(MV, mv)
CHECK_NONEMPTY(MV)
AC_PATH_PROGS(NAWK, [nawk gawk awk])
CHECK_NONEMPTY(NAWK)
AC_PATH_PROG(PRINTF, printf)
CHECK_NONEMPTY(PRINTF)
# Non-required basic tools
AC_PATH_PROG(THEPWDCMD, pwd)
AC_PATH_PROG(RM, rm)
CHECK_NONEMPTY(RM)
RM="$RM -f"
AC_PROG_SED
CHECK_NONEMPTY(SED)
AC_PATH_PROG(SH, sh)
CHECK_NONEMPTY(SH)
AC_PATH_PROG(SORT, sort)
CHECK_NONEMPTY(SORT)
AC_PATH_PROG(TAR, tar)
CHECK_NONEMPTY(TAR)
AC_PATH_PROG(TAIL, tail)
CHECK_NONEMPTY(TAIL)
AC_PATH_PROG(TEE, tee)
CHECK_NONEMPTY(TEE)
AC_PATH_PROG(TR, tr)
CHECK_NONEMPTY(TR)
AC_PATH_PROG(TOUCH, touch)
CHECK_NONEMPTY(TOUCH)
AC_PATH_PROG(WC, wc)
CHECK_NONEMPTY(WC)
AC_PATH_PROG(XARGS, xargs)
CHECK_NONEMPTY(XARGS)
AC_PATH_PROG(ZIP, zip)
CHECK_NONEMPTY(ZIP)
AC_PATH_PROG(UNZIP, unzip)
CHECK_NONEMPTY(UNZIP)
AC_PATH_PROG(LDD, ldd)
if test "x$LDD" = "x"; then
# List shared lib dependencies is used for
......@@ -390,16 +496,11 @@ AC_PATH_PROG(OTOOL, otool)
if test "x$OTOOL" = "x"; then
OTOOL="true"
fi
AC_PATH_PROG(READELF, readelf)
AC_PATH_PROG(EXPR, expr)
CHECK_NONEMPTY(EXPR)
AC_PATH_PROG(FILE, file)
CHECK_NONEMPTY(FILE)
AC_PATH_PROGS(READELF, [readelf greadelf])
AC_PATH_PROGS(OBJDUMP, [objdump gobjdump])
AC_PATH_PROG(HG, hg)
])
AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE],
[
# When using cygwin, we need a wrapper binary that renames
......@@ -433,6 +534,8 @@ if test "x$OPENJDK_BUILD_OS" = xwindows; then
fi
AC_MSG_RESULT([yes])
rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
# The path to uncygdrive to use should be Unix-style
UNCYGDRIVE="$OUTPUT_ROOT/uncygdrive.exe"
fi
AC_SUBST(UNCYGDRIVE)
......
......@@ -23,66 +23,97 @@
# questions.
#
# Fixes paths on windows to be mixed mode short.
AC_DEFUN([BOOTJDK_WIN_FIX_PATH],
# Execute the check given as argument, and verify the result
# If the Boot JDK was previously found, do nothing
# $1 A command line (typically autoconf macro) to execute
AC_DEFUN([BOOTJDK_DO_CHECK],
[
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
AC_PATH_PROG(CYGPATH, cygpath)
tmp="[$]$1"
# Convert to C:/ mixed style path without spaces.
tmp=`$CYGPATH -s -m "$tmp"`
$1="$tmp"
fi
])
if test "x$BOOT_JDK_FOUND" = xno; then
# Now execute the test
$1
AC_DEFUN([BOOTJDK_MISSING_ERROR],
[
AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk])
AC_MSG_ERROR([Cannot continue])
])
# If previous step claimed to have found a JDK, check it to see if it seems to be valid.
if test "x$BOOT_JDK_FOUND" = xmaybe; then
# Do we have a bin/java?
if test ! -x "$BOOT_JDK/bin/java"; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring])
BOOT_JDK_FOUND=no
else
# Do we have a bin/javac?
if test ! -x "$BOOT_JDK/bin/javac"; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring])
AC_MSG_NOTICE([(This might be an JRE instead of an JDK)])
BOOT_JDK_FOUND=no
else
# Do we have an rt.jar? (On MacOSX it is called classes.jar)
if test ! -f "$BOOT_JDK/jre/lib/rt.jar" && test ! -f "$BOOT_JDK/../Classes/classes.jar"; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain an rt.jar; ignoring])
BOOT_JDK_FOUND=no
else
# Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | head -n 1`
###############################################################################
#
# We need a Boot JDK to bootstrap the build.
#
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`]
if test "x$FOUND_VERSION_78" = x; then
AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
AC_MSG_NOTICE([(Your Boot JDK must be version 7 or 8)])
BOOT_JDK_FOUND=no
else
# We're done! :-)
BOOT_JDK_FOUND=yes
SPACESAFE(BOOT_JDK,[the path to the Boot JDK])
AC_MSG_CHECKING([for Boot JDK])
AC_MSG_RESULT([$BOOT_JDK ($BOOT_JDK_VERSION)])
fi # end check jdk version
fi # end check rt.jar
fi # end check javac
fi # end check java
fi # end check boot jdk found
fi
])
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
# Test: Is bootjdk explicitely set by command line arguments?
AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
[
BOOT_JDK_FOUND=no
AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk],
[path to Boot JDK (used to bootstrap build) @<:@probed@:>@])])
if test "x$with_boot_jdk" != x; then
BOOT_JDK=$with_boot_jdk
BOOT_JDK_FOUND=yes
fi
if test "x$BOOT_JDK_FOUND" = xno; then
BDEPS_CHECK_MODULE(BOOT_JDK, boot-jdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no])
BOOT_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Boot JDK using configure arguments])
fi
])
if test "x$BOOT_JDK_FOUND" = xno; then
# Test: Is bootjdk available from builddeps?
AC_DEFUN([BOOTJDK_CHECK_BUILDDEPS],
[
BDEPS_CHECK_MODULE(BOOT_JDK, bootjdk, xxx, [BOOT_JDK_FOUND=maybe], [BOOT_JDK_FOUND=no])
])
# Test: Is $JAVA_HOME set?
AC_DEFUN([BOOTJDK_CHECK_JAVA_HOME],
[
if test "x$JAVA_HOME" != x; then
if test ! -d "$JAVA_HOME"; then
AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
BOOTJDK_MISSING_ERROR
if test "x$OPENJDK_TARGET_OS" = xwindows; then
# On Windows, JAVA_HOME is likely in DOS-style
JAVA_HOME_PROCESSED="`$CYGPATH -u "$JAVA_HOME"`"
else
JAVA_HOME_PROCESSED="$JAVA_HOME"
fi
# Aha, the user has set a JAVA_HOME
# let us use that as the Boot JDK.
BOOT_JDK="$JAVA_HOME"
BOOT_JDK_FOUND=yes
# To be on the safe side, lets check that it is a JDK.
if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
JAVAC="$BOOT_JDK/bin/javac"
JAVA="$BOOT_JDK/bin/java"
BOOT_JDK_FOUND=yes
if test ! -d "$JAVA_HOME_PROCESSED"; then
AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
else
AC_MSG_NOTICE([Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK. JAVA_HOME=[$]JAVA_HOME])
BOOTJDK_MISSING_ERROR
fi
# Aha, the user has set a JAVA_HOME
# let us use that as the Boot JDK.
BOOT_JDK="$JAVA_HOME_PROCESSED"
BOOT_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME])
fi
fi
fi
])
if test "x$BOOT_JDK_FOUND" = xno; then
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
AC_DEFUN([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK],
[
AC_PATH_PROG(JAVAC_CHECK, javac)
AC_PATH_PROG(JAVA_CHECK, java)
BINARY="$JAVAC_CHECK"
......@@ -94,161 +125,164 @@ if test "x$BOOT_JDK_FOUND" = xno; then
# Lets find the JDK/JRE directory by following symbolic links.
# Linux/GNU systems often have links from /usr/bin/java to
# /etc/alternatives/java to the real JDK binary.
WHICHCMD_SPACESAFE(BINARY,[path to javac])
SET_FULL_PATH_SPACESAFE(BINARY)
REMOVE_SYMBOLIC_LINKS(BINARY)
BOOT_JDK=`dirname $BINARY`
BOOT_JDK=`cd $BOOT_JDK/..; pwd`
if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
JAVAC=$BOOT_JDK/bin/javac
JAVA=$BOOT_JDK/bin/java
BOOT_JDK_FOUND=yes
BOOT_JDK=`dirname "$BINARY"`
BOOT_JDK=`cd "$BOOT_JDK/.."; pwd`
if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
# Looks like we found ourselves an JDK
BOOT_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH])
fi
fi
fi
])
if test "x$BOOT_JDK_FOUND" = xno; then
# Try the MacOSX way.
# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME],
[
if test -x /usr/libexec/java_home; then
BOOT_JDK=`/usr/libexec/java_home`
if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
JAVAC=$BOOT_JDK/bin/javac
JAVA=$BOOT_JDK/bin/java
BOOT_JDK_FOUND=yes
fi
BOOT_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home])
fi
fi
])
if test "x$BOOT_JDK_FOUND" = xno; then
AC_PATH_PROG(JAVA_CHECK, java)
if test "x$JAVA_CHECK" != x; then
# There is a java in the path. But apparently we have not found a javac
# in the path, since that would have been tested earlier.
if test "x$OPENJDK_TARGET_OS" = xwindows; then
# Now if this is a windows platform. The default installation of a JDK
# actually puts the JRE in the path and keeps the JDK out of the path!
# Go look in the default installation location.
BOOT_JDK=/cygdrive/c/Program\ Files/Java/`ls /cygdrive/c/Program\ Files/Java | grep jdk | sort -r | head --lines 1`
if test -d "$BOOT_JDK"; then
BOOT_JDK_FOUND=yes
fi
fi
if test "x$BOOT_JDK_FOUND" = xno; then
HELP_MSG_MISSING_DEPENDENCY([openjdk])
AC_MSG_NOTICE([Found a JRE, not not a JDK! Please remove the JRE from your path and put a JDK there instead. $HELP_MSG])
BOOTJDK_MISSING_ERROR
fi
else
HELP_MSG_MISSING_DEPENDENCY([openjdk])
AC_MSG_NOTICE([Could not find a JDK. $HELP_MSG])
BOOTJDK_MISSING_ERROR
# Look for a jdk in the given path. If there are multiple, try to select the newest.
# If found, set BOOT_JDK and BOOT_JDK_FOUND.
# $1 = Path to directory containing jdk installations.
# $2 = String to append to the found JDK directory to get the proper JDK home
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY],
[
BOOT_JDK_PREFIX="$1"
BOOT_JDK_SUFFIX="$2"
BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 `
if test "x$BEST_JDK_FOUND" != x; then
BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}"
if test -d "$BOOT_JDK"; then
BOOT_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)])
fi
fi
])
# Call BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY, but use the given
# environmental variable as base for where to look.
# $1 Name of an environmal variable, assumed to point to the Program Files directory.
AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY],
[
if test "x[$]$1" != x; then
BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([`$CYGPATH -u "[$]$1"`/Java])
fi
])
# Test: Is there a JDK installed in default, well-known locations?
AC_DEFUN([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS],
[
if test "x$OPENJDK_TARGET_OS" = xwindows; then
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramW6432])])
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMW6432])])
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([PROGRAMFILES])])
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_WINDOWS_VIRTUAL_DIRECTORY([ProgramFiles])])
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/cygdrive/c/Program Files/Java])])
elif test "x$OPENJDK_TARGET_OS" = xmacosx; then
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/Library/Java/JavaVirtualMachines],[/Contents/Home])])
BOOTJDK_DO_CHECK([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY([/System/Library/Java/JavaVirtualMachines],[/Contents/Home])])
fi
])
# Check that a command-line tool in the Boot JDK is correct
# $1 = name of variable to assign
# $2 = name of binary
AC_DEFUN([BOOTJDK_CHECK_TOOL_IN_BOOTJDK],
[
AC_MSG_CHECKING([for $2 in Boot JDK])
$1=$BOOT_JDK/bin/$2
if test ! -x [$]$1; then
AC_MSG_RESULT(not found)
AC_MSG_NOTICE([Your Boot JDK seems broken. This might be fixed by explicitely setting --with-boot-jdk])
AC_MSG_ERROR([Could not find $2 in the Boot JDK])
fi
AC_MSG_RESULT(ok)
])
###############################################################################
#
# We need a Boot JDK to bootstrap the build.
#
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK],
[
BOOT_JDK_FOUND=no
AC_ARG_WITH(boot-jdk, [AS_HELP_STRING([--with-boot-jdk],
[path to Boot JDK (used to bootstrap build) @<:@probed@:>@])])
# We look for the Boot JDK through various means, going from more certain to
# more of a guess-work. After each test, BOOT_JDK_FOUND is set to "yes" if
# we detected something (if so, the path to the jdk is in BOOT_JDK). But we
# must check if this is indeed valid; otherwise we'll continue looking.
# Test: Is bootjdk explicitely set by command line arguments?
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_ARGUMENTS])
if test "x$with_boot_jdk" != x && test "x$BOOT_JDK_FOUND" = xno; then
# Having specified an argument which is incorrect will produce an instant failure;
# we should not go on looking
AC_MSG_ERROR([The path given by --with-boot-jdk does not contain a valid Boot JDK])
fi
BOOTJDK_WIN_FIX_PATH(BOOT_JDK)
# Test: Is bootjdk available from builddeps?
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_BUILDDEPS])
# Now see if we can find the rt.jar, or its nearest equivalent.
BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
SPACESAFE(BOOT_RTJAR,[the path to the Boot JDK rt.jar (or nearest equivalent)])
# Test: Is $JAVA_HOME set?
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME])
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
SPACESAFE(BOOT_TOOLSJAR,[the path to the Boot JDK tools.jar (or nearest equivalent)])
# Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME])
# Test: Is there a java or javac in the PATH, which is a symlink to the JDK?
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_IN_PATH_IS_SYMLINK])
# Test: Is there a JDK installed in default, well-known locations?
BOOTJDK_DO_CHECK([BOOTJDK_CHECK_WELL_KNOWN_LOCATIONS])
# If we haven't found anything yet, we've truly lost. Give up.
if test "x$BOOT_JDK_FOUND" = xno; then
HELP_MSG_MISSING_DEPENDENCY([openjdk])
AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG])
AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk])
AC_MSG_ERROR([Cannot continue])
fi
if test ! -f $BOOT_RTJAR; then
# Setup proper paths for what we found
BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
if test ! -f "$BOOT_RTJAR"; then
# On MacOSX it is called classes.jar
BOOT_RTJAR=$BOOT_JDK/../Classes/classes.jar
if test ! -f $BOOT_RTJAR; then
AC_MSG_NOTICE([Cannot find the rt.jar or its equivalent!])
AC_MSG_NOTICE([This typically means that configure failed to automatically find a suitable Boot JDK])
BOOTJDK_MISSING_ERROR
BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
if test -f "$BOOT_RTJAR"; then
# Remove the ..
BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
fi
# Remove the ..
BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
# The tools.jar is part of classes.jar
BOOT_TOOLSJAR="$BOOT_RTJAR"
fi
AC_SUBST(BOOT_JDK)
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
BOOT_JDK="$BOOT_JDK"
AC_SUBST(BOOT_RTJAR)
AC_SUBST(BOOT_TOOLSJAR)
AC_MSG_CHECKING([for Boot JDK])
AC_MSG_RESULT([$BOOT_JDK])
AC_MSG_CHECKING([for Boot rt.jar])
AC_MSG_RESULT([$BOOT_RTJAR])
AC_MSG_CHECKING([for Boot tools.jar])
AC_MSG_RESULT([$BOOT_TOOLSJAR])
AC_SUBST(BOOT_JDK)
# Use the java tool from the Boot JDK.
AC_MSG_CHECKING([for java in Boot JDK])
JAVA=$BOOT_JDK/bin/java
if test ! -x $JAVA; then
AC_MSG_NOTICE([Could not find a working java])
BOOTJDK_MISSING_ERROR
fi
BOOT_JDK_VERSION=`$JAVA -version 2>&1 | head -n 1`
AC_MSG_RESULT([yes $BOOT_JDK_VERSION])
AC_SUBST(JAVA)
# Setup tools from the Boot JDK.
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java)
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac)
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah)
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap)
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar)
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic)
BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii)
# Extra M4 quote needed to protect [] in grep expression.
[FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`]
if test "x$FOUND_VERSION_78" = x; then
HELP_MSG_MISSING_DEPENDENCY([openjdk])
AC_MSG_NOTICE([Your boot-jdk must be version 7 or 8. $HELP_MSG])
BOOTJDK_MISSING_ERROR
fi
# Finally, set some other options...
# When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
BOOT_JDK_SOURCETARGET="-source 7 -target 7"
AC_SUBST(BOOT_JDK_SOURCETARGET)
# Use the javac tool from the Boot JDK.
AC_MSG_CHECKING([for javac in Boot JDK])
JAVAC=$BOOT_JDK/bin/javac
if test ! -x $JAVAC; then
AC_MSG_ERROR([Could not find a working javac])
fi
AC_MSG_RESULT(yes)
AC_SUBST(JAVAC)
AC_SUBST(JAVAC_FLAGS)
# Use the javah tool from the Boot JDK.
AC_MSG_CHECKING([for javah in Boot JDK])
JAVAH=$BOOT_JDK/bin/javah
if test ! -x $JAVAH; then
AC_MSG_NOTICE([Could not find a working javah])
BOOTJDK_MISSING_ERROR
fi
AC_MSG_RESULT(yes)
AC_SUBST(JAVAH)
# Use the jar tool from the Boot JDK.
AC_MSG_CHECKING([for jar in Boot JDK])
JAR=$BOOT_JDK/bin/jar
if test ! -x $JAR; then
AC_MSG_NOTICE([Could not find a working jar])
BOOTJDK_MISSING_ERROR
fi
AC_SUBST(JAR)
AC_MSG_RESULT(yes)
# Use the rmic tool from the Boot JDK.
AC_MSG_CHECKING([for rmic in Boot JDK])
RMIC=$BOOT_JDK/bin/rmic
if test ! -x $RMIC; then
AC_MSG_NOTICE([Could not find a working rmic])
BOOTJDK_MISSING_ERROR
fi
AC_SUBST(RMIC)
AC_MSG_RESULT(yes)
# Use the native2ascii tool from the Boot JDK.
AC_MSG_CHECKING([for native2ascii in Boot JDK])
NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
if test ! -x $NATIVE2ASCII; then
AC_MSG_NOTICE([Could not find a working native2ascii])
BOOTJDK_MISSING_ERROR
fi
AC_MSG_RESULT(yes)
AC_SUBST(NATIVE2ASCII)
])
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
......
#
# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
# 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
......@@ -23,54 +23,21 @@
# questions.
#
#
# Variable definitions for SE Embedded builds. This file should
# not contain rules.
#
ifdef JAVASE_EMBEDDED
# Compress jar files
COMPRESS_JARS = true
# Don't mmap zip files
LIBZIP_CAN_USE_MMAP = false
# Disable ALSA version check
REQUIRED_ALSA_VERSION =
# Support for building boot cycle builds
# Compilation settings
OTHER_CPPFLAGS += -DJAVASE_EMBEDDED
# First include the real base spec.gmk file
include @SPEC@
# Product naming
PRODUCT_SUFFIX = SE Embedded Runtime Environment
RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
# Reduced JRE locations
JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
# Override on linux to further reduce binary/lib sizes in product build
ifeq ($(PLATFORM), linux)
ifeq ($(VARIANT), OPT)
ifneq ($(NO_STRIP), true)
ifneq ($(DEBUG_BINARIES), true)
POST_STRIP_PROCESS = $(STRIP) --strip-unneeded
endif
endif
endif
# Check that the user did not try to specify a different java to use for compiling.
ifneq ($(firstword $(SJAVAC_SERVER_JAVA)),$(firstword $(JAVA)))
$(error Bootcycle builds are not possible if --with-sjavac-server-java is specified)
endif
# NIO Platform specific source file location
ifdef CROSS_COMPILE_ARCH
NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
endif
# For ARM sflt we need to link to a library with improved FP accuracy
# and it must be linked after fdlibm - this places it at the end after libc
# -z muldefs avoids linker errors for duplicate symbols.
ifeq ($(CROSS_COMPILE_ARCH), arm)
EXTRA_LIBS += $(EXT_LIBS_PATH)/sflt_glibc_jdk.a -Xlinker -z -Xlinker muldefs
endif
# Override specific values to do a boot cycle build
endif # JAVASE_EMBEDDED
# The bootcycle build has a different output directory
BUILD_OUTPUT:=@BUILD_OUTPUT@/bootcycle-build
# Use a different Boot JDK
BOOT_JDK:=@BUILD_OUTPUT@/images/j2sdk-image
BOOT_RTJAR:=@BUILD_OUTPUT@/images/j2sdk-image/jre/lib/rt.jar
......@@ -22,17 +22,39 @@
# questions.
#
# This is a wrapper for the config.guess from autoconf. The latter does not properly
# detect amd64 systems, since that require isainfo instead of uname. Instead of patching
# the autoconf system (which might easily get lost in a future update), we wrap it and
# fix the broken property, if needed.
# This is a wrapper for the config.guess from autoconf. The latter does not
# properly detect 64 bit systems on all platforms. Instead of patching the
# autoconf system (which might easily get lost in a future update), we wrap it
# and fix the broken property, if needed.
DIR=`dirname $0`
OUT=`. $DIR/autoconf-config.guess`
# Test and fix solaris on x86_64
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
if test $? = 0; then
# isainfo -n returns either i386 or amd64 on Intel systems
# isainfo -n returns either i386 or amd64
REAL_CPU=`isainfo -n`
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
fi
# Test and fix solaris on sparcv9
echo $OUT | grep sparc-sun-solaris > /dev/null 2> /dev/null
if test $? = 0; then
# isainfo -n returns either sparc or sparcv9
REAL_CPU=`isainfo -n`
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
fi
# Test and fix cygwin on x86_64
echo $OUT | grep 86-pc-cygwin > /dev/null 2> /dev/null
if test $? = 0; then
case `echo $PROCESSOR_IDENTIFIER | cut -f1 -d' '` in
intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64)
REAL_CPU=x86_64
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
;;
esac
fi
echo $OUT
......@@ -30,27 +30,19 @@ AC_DEFUN([BPERF_CHECK_CORES],
FOUND_CORES=no
if test -f /proc/cpuinfo; then
# Looks like a Linux system
# Looks like a Linux (or cygwin) system
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
FOUND_CORES=yes
fi
if test -x /usr/sbin/psrinfo; then
elif 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
elif 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`
......@@ -66,31 +58,26 @@ AC_DEFUN([BPERF_CHECK_CORES],
AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
[
AC_MSG_CHECKING([for memory size])
# Default to 1024MB
# Default to 1024 MB
MEMORY_SIZE=1024
FOUND_MEM=no
if test -f /proc/cpuinfo; then
# Looks like a Linux system
if test -f /proc/meminfo; then
# Looks like a Linux (or cygwin) 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
elif 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
elif 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
elif test "x$build_os" = xwindows; then
# Windows, but without cygwin
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
FOUND_MEM=yes
fi
......@@ -98,7 +85,7 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
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!])
AC_MSG_RESULT([could not detect memory size defaulting to 1024 MB!])
fi
])
......@@ -240,46 +227,30 @@ AC_SUBST(USE_PRECOMPILED_HEADER)
AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
[
AC_ARG_WITH(server-java, [AS_HELP_STRING([--with-server-java],
[use this java binary for running the javac background server and other long running java tasks in the build process,
e.g. ---with-server-java="/opt/jrockit/bin/java -server"])])
AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java],
[use this java binary for running the sjavac background server and other long running java tasks in the build process,
e.g. ---with-sjavac-server-java="/opt/jrockit/bin/java -server"])])
if test "x$with_server_java" != x; then
SERVER_JAVA="$with_server_java"
FOUND_VERSION=`$SERVER_JAVA -version 2>&1 | grep " version \""`
if test "x$with_sjavac_server_java" != x; then
SJAVAC_SERVER_JAVA="$with_sjavac_server_java"
FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
if test "x$FOUND_VERSION" = x; then
AC_MSG_ERROR([Could not execute server java: $SERVER_JAVA])
AC_MSG_ERROR([Could not execute server java: $SJAVAC_SERVER_JAVA])
fi
else
SERVER_JAVA=""
SJAVAC_SERVER_JAVA=""
# Hotspot specific options.
ADD_JVM_ARG_IF_OK([-XX:+UseParallelOldGC],SERVER_JAVA,[$JAVA])
ADD_JVM_ARG_IF_OK([-verbosegc],SERVER_JAVA,[$JAVA])
ADD_JVM_ARG_IF_OK([-verbosegc],SJAVAC_SERVER_JAVA,[$JAVA])
# JRockit specific options.
ADD_JVM_ARG_IF_OK([-Xverbose:gc],SERVER_JAVA,[$JAVA])
SERVER_JAVA="$JAVA $SERVER_JAVA"
ADD_JVM_ARG_IF_OK([-Xverbose:gc],SJAVAC_SERVER_JAVA,[$JAVA])
SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA"
fi
AC_SUBST(SERVER_JAVA)
AC_MSG_CHECKING([whether to use shared server for javac])
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
[enable the shared javac server during the build process @<:@disabled@:>@])],
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER='no'])
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
if test "x$ENABLE_JAVAC_SERVER" = xyes; then
JAVAC_USE_REMOTE=true
JAVAC_SERVERS="$OUTPUT_ROOT/javacservers"
else
JAVAC_USE_REMOTE=false
JAVAC_SERVERS=
fi
AC_SUBST(JAVAC_USE_REMOTE)
AC_SUBST(JAVAC_SERVERS)
AC_SUBST(SJAVAC_SERVER_JAVA)
AC_ARG_WITH(javac-server-cores, [AS_HELP_STRING([--with-javac-server-cores],
[use at most this number of concurrent threads on the javac server @<:@probed@:>@])])
if test "x$with_javac_server_cores" != x; then
JAVAC_SERVER_CORES="$with_javac_server_cores"
AC_ARG_WITH(sjavac-server-cores, [AS_HELP_STRING([--with-sjavac-server-cores],
[use at most this number of concurrent threads on the sjavac server @<:@probed@:>@])])
if test "x$with_sjavac_server_cores" != x; then
SJAVAC_SERVER_CORES="$with_sjavac_server_cores"
else
if test "$NUM_CORES" -gt 16; then
# We set this arbitrary limit because we want to limit the heap
......@@ -287,86 +258,49 @@ else
# In the future we will make the javac compilers in the server
# share more and more state, thus enabling us to use more and
# more concurrent threads in the server.
JAVAC_SERVER_CORES="16"
SJAVAC_SERVER_CORES="16"
else
JAVAC_SERVER_CORES="$NUM_CORES"
SJAVAC_SERVER_CORES="$NUM_CORES"
fi
if test "$MEMORY_SIZE" -gt "17000"; then
MAX_HEAP_MEM=10000
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn2G],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "10000"; then
MAX_HEAP_MEM=6000
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn1G],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "5000"; then
MAX_HEAP_MEM=3000
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "3800"; then
MAX_HEAP_MEM=2500
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "1900"; then
MAX_HEAP_MEM=1200
ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1200M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1400M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "1000"; then
MAX_HEAP_MEM=900
ADD_JVM_ARG_IF_OK([-Xms400M -Xmx900M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
else
MAX_HEAP_MEM=512
ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
fi
ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501`
if test "$JAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then
if test "$SJAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then
AC_MSG_CHECKING([if number of server cores must be reduced])
JAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP"
AC_MSG_RESULT([yes, to $JAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB])
SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP"
AC_MSG_RESULT([yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB])
fi
fi
AC_SUBST(JAVAC_SERVER_CORES)
AC_MSG_CHECKING([whether to track dependencies between Java packages])
AC_ARG_ENABLE([javac-deps], [AS_HELP_STRING([--enable-javac-deps],
[enable the dependency tracking between Java packages @<:@disabled@:>@])],
[ENABLE_JAVAC_DEPS="${enableval}"], [ENABLE_JAVAC_DEPS='no'])
AC_MSG_RESULT([$ENABLE_JAVAC_DEPS])
if test "x$ENABLE_JAVAC_DEPS" = xyes; then
JAVAC_USE_DEPS=true
else
JAVAC_USE_DEPS=false
fi
AC_SUBST(JAVAC_USE_DEPS)
AC_MSG_CHECKING([whether to use multiple cores for javac compilation])
AC_ARG_ENABLE([javac-multi-core], [AS_HELP_STRING([--enable-javac-multi-core],
[compile Java packages concurrently @<:@disabled@:>@])],
[ENABLE_JAVAC_MULTICORE="${enableval}"], [ENABLE_JAVAC_MULTICORE='no'])
AC_MSG_RESULT([$ENABLE_JAVAC_MULTICORE])
if test "x$ENABLE_JAVAC_MULTICORE" = xyes; then
JAVAC_USE_MODE=MULTI_CORE_CONCURRENT
else
JAVAC_USE_MODE=SINGLE_THREADED_BATCH
if test "x$ENABLE_JAVAC_DEPS" = xyes; then
AC_MSG_WARN([Dependency tracking is not supported with single threaded batch compiles of Java source roots. Please add --disable-javac-deps to your configure options.])
AC_MSG_WARN([Disabling dependency tracking for you now.])
JAVAC_USE_DEPS=false
fi
if test "x$ENABLE_JAVAC_SERVER" = xyes; then
AC_MSG_WARN([The javac server will not be used since single threaded batch compiles are run within their own JVM. Please add --disable-javac-server to your configure options.])
AC_MSG_WARN([Disabling javac server for you now.])
JAVAC_USE_REMOTE=false
fi
fi
AC_SUBST(JAVAC_USE_MODE)
AC_SUBST(SJAVAC_SERVER_CORES)
AC_MSG_CHECKING([whether to use sjavac])
AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
......@@ -375,4 +309,11 @@ AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
AC_MSG_RESULT([$ENABLE_SJAVAC])
AC_SUBST(ENABLE_SJAVAC)
if test "x$ENABLE_SJAVAC" = xyes; then
SJAVAC_SERVER_DIR="$OUTPUT_ROOT/javacservers"
else
SJAVAC_SERVER_DIR=
fi
AC_SUBST(SJAVAC_SERVER_DIR)
])
......@@ -31,7 +31,7 @@
# Translate a configuration triplet/quadruplet into something
# known by this configuration file.
# If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_SYSTEM}
# If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME}
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
......
......@@ -52,19 +52,19 @@ AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS],
fi
# Create build and target names that use _ instead of "-" and ".".
# This is necessary to use them in variable names.
build_var=`echo ${OPENJDK_BUILD_SYSTEM} | tr '-' '_' | tr '.' '_'`
target_var=`echo ${OPENJDK_TARGET_SYSTEM} | tr '-' '_' | tr '.' '_'`
build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'`
target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'`
# Extract rewrite information for build and target
eval rewritten_build=\${REWRITE_${build_var}}
if test "x$rewritten_build" = x; then
rewritten_build=${OPENJDK_BUILD_SYSTEM}
rewritten_build=${OPENJDK_BUILD_AUTOCONF_NAME}
echo Build stays the same $rewritten_build
else
echo Rewriting build for builddeps into $rewritten_build
fi
eval rewritten_target=\${REWRITE_${target_var}}
if test "x$rewritten_target" = x; then
rewritten_target=${OPENJDK_TARGET_SYSTEM}
rewritten_target=${OPENJDK_TARGET_AUTOCONF_NAME}
echo Target stays the same $rewritten_target
else
echo Rewriting target for builddeps into $rewritten_target
......
此差异已折叠。
......@@ -2,7 +2,12 @@
CONFIGURE_COMMAND_LINE="$@"
conf_script_dir=`dirname $0`
conf_closed_script_dir="$conf_script_dir/../../jdk/make/closed/autoconf"
if [ "$CUSTOM_CONFIG_DIR" = "" ]; then
conf_custom_script_dir="$conf_script_dir/../../jdk/make/closed/autoconf"
else
conf_custom_script_dir=$CUSTOM_CONFIG_DIR
fi
###
### Test that the generated configure is up-to-date
......@@ -14,8 +19,12 @@ TEST=`which test`
print_error_not_up_to_date() {
echo "Error: The configure source files is newer than the generated files."
echo "Please run 'sh autogen.sh' to update the generated files."
echo "Note that this test might trigger incorrectly sometimes due to hg timestamps".
}
# NOTE: This test can occasionally go wrong due to the way mercurial handles
# timestamps. It it supposed to aid during development of build-infra, but should
# go away before making this the default build system.
for file in configure.ac *.m4 ; do
if $TEST $file -nt generated-configure.sh; then
print_error_not_up_to_date
......@@ -23,26 +32,32 @@ for file in configure.ac *.m4 ; do
fi
done
if $TEST -e $conf_closed_script_dir/generated-configure.sh; then
# If closed source configure is available, make sure it is up-to-date as well.
for file in configure.ac *.m4 $conf_closed_script_dir/*.m4; do
if $TEST $file -nt $conf_closed_script_dir/generated-configure.sh; then
if $TEST -e $conf_custom_script_dir/generated-configure.sh; then
# If custom source configure is available, make sure it is up-to-date as well.
for file in configure.ac *.m4 $conf_custom_script_dir/*.m4; do
if $TEST $file -nt $conf_custom_script_dir/generated-configure.sh; then
print_error_not_up_to_date
exit 1
fi
done
# Test if open configure is newer than closed configure, if so, closed needs to
# be regenerated.
# Test if open configure is newer than custom configure, if so, custom needs to
# be regenerated. This test is required to ensure consistency with custom source.
conf_open_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_script_dir/generated-configure.sh | cut -d" " -f 3`
conf_closed_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_closed_script_dir/generated-configure.sh | cut -d" " -f 3`
if $TEST $conf_open_configure_timestamp -gt $conf_closed_configure_timestamp; then
print_error_not_up_to_date
conf_custom_configure_timestamp=`grep DATE_WHEN_GENERATED: $conf_custom_script_dir/generated-configure.sh | cut -d" " -f 3`
if $TEST $conf_open_configure_timestamp -gt $conf_custom_configure_timestamp; then
echo "Error: The generated configure file contains changes not present in the custom generated file."
echo "Please run 'sh autogen.sh' to update the generated files."
exit 1
fi
fi
# Autoconf calls the configure script recursively sometimes.
# Don't start logging twice in that case
if $TEST "x$conf_debug_configure" = xtrue; then
conf_debug_configure=recursive
fi
###
### Process command-line arguments
###
......@@ -63,6 +78,12 @@ do
--with-extra-cxxflags=*)
conf_extra_cxxflags=`expr "X$conf_option" : '[^=]*=\(.*\)'`
continue ;;
--debug-configure)
if $TEST "x$conf_debug_configure" != xrecursive; then
conf_debug_configure=true
export conf_debug_configure
fi
continue ;;
*)
conf_processed_arguments="$conf_processed_arguments $conf_option" ;;
esac
......@@ -104,13 +125,29 @@ conf_processed_arguments="--enable-option-checking=fatal $conf_processed_argumen
###
### Call the configure script
###
if $TEST -e $conf_closed_script_dir/generated-configure.sh; then
# Closed source configure available; run that instead
. $conf_closed_script_dir/generated-configure.sh $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags"
if $TEST -e $conf_custom_script_dir/generated-configure.sh; then
# Custom source configure available; run that instead
echo Running custom generated-configure.sh
conf_script_to_run=$conf_custom_script_dir/generated-configure.sh
else
echo Running generated-configure.sh
conf_script_to_run=$conf_script_dir/generated-configure.sh
fi
if $TEST "x$conf_debug_configure" != x; then
# Turn on shell debug output if requested (initial or recursive)
set -x
fi
if $TEST "x$conf_debug_configure" = xtrue; then
# Turn on logging, but don't turn on twice when called recursive
conf_debug_logfile=./debug-configure.log
(exec 3>&1 ; (. $conf_script_to_run $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags" 2>&1 1>&3 ) | tee -a $conf_debug_logfile 1>&2 ; exec 3>&-) | tee -a $conf_debug_logfile
else
. $conf_script_dir/generated-configure.sh $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags"
. $conf_script_to_run $conf_processed_arguments --with-extra-cflags="$conf_extra_cflags" --with-extra-cxxflags="$conf_extra_cxxflags"
fi
conf_result_code=$?
###
### Post-processing
###
......@@ -119,3 +156,5 @@ fi
if $TEST -d "$OUTPUT_ROOT"; then
mv -f config.log "$OUTPUT_ROOT" 2> /dev/null
fi
exit $conf_result_code
......@@ -53,9 +53,9 @@ m4_include([source-dirs.m4])
m4_include([toolchain.m4])
# This line needs to be here, verbatim, after all includes.
# It is replaced with closed functionality when building
# closed sources.
AC_DEFUN_ONCE([CLOSED_HOOK])
# It is replaced with custom functionality when building
# custom sources.
AC_DEFUN_ONCE([CUSTOM_HOOK])
###############################################################################
#
......@@ -65,6 +65,12 @@ AC_DEFUN_ONCE([CLOSED_HOOK])
# Basic initialization that must happen first of all
BASIC_INIT
# Now we can determine OpenJDK build and target platforms. This is required to
# have early on.
PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
# Continue setting up basic stuff.
BASIC_SETUP_PATHS
BASIC_SETUP_LOGGING
......@@ -75,27 +81,17 @@ HELP_SETUP_DEPENDENCY_HELP
# Without these, we can't properly run the rest of the configure script.
BASIC_SETUP_TOOLS
# Setup builddeps, for automatic downloading of tools we need.
# This is needed before we can call BDEPS_CHECK_MODULE, which is done in
# boot-jdk setup, but we need to have basic tools setup first.
BDEPS_CONFIGURE_BUILDDEPS
BDEPS_SCAN_FOR_BUILDDEPS
# Check if pkg-config is available.
PKG_PROG_PKG_CONFIG
###############################################################################
#
# Determine OpenJDK build and target platforms.
#
###############################################################################
PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
# After basic tools have been setup, we can check build os specific details.
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
# With knowledge of the build platform, setup more basic things.
BASIC_SETUP_PATH_SEP
BASIC_SETUP_SEARCHPATH
# Setup builddeps, for automatic downloading of tools we need.
# This is needed before we can call BDEPS_CHECK_MODULE, which is done in
# boot-jdk setup, but we need to have basic tools setup first.
BDEPS_CONFIGURE_BUILDDEPS
BDEPS_SCAN_FOR_BUILDDEPS
###############################################################################
#
......@@ -148,7 +144,7 @@ TOOLCHAIN_SETUP_PATHS
# FIXME: Currently we must test this after paths but before flags. Fix!
# And we can test some aspects on the target using configure macros.
PLATFORM_TEST_OPENJDK_TARGET_BITS
PLATFORM_SETUP_OPENJDK_TARGET_BITS
PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
# Configure flags for the tools
......@@ -213,8 +209,8 @@ BPERF_SETUP_CCACHE
# Check for some common pitfalls
BASIC_TEST_USABILITY_ISSUES
# At the end, call the closed hook. (Dummy macro if no closed sources available)
CLOSED_HOOK
# At the end, call the custom hook. (Dummy macro if no custom sources available)
CUSTOM_HOOK
# We're messing a bit with internal autoconf variables to put the config.status
# in the output directory instead of the current directory.
......@@ -222,5 +218,8 @@ CONFIG_STATUS="$OUTPUT_ROOT/config.status"
# Create the actual output files. Now the main work of configure is done.
AC_OUTPUT
# Make the compare script executable
$CHMOD +x $OUTPUT_ROOT/compare.sh
# Finally output some useful information to the user
HELP_PRINT_SUMMARY_AND_WARNINGS
#
# 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.
#
# Chaining of spec files
HOTSPOT_SPEC:=$(dir $(SPEC))hotspot-spec.gmk
override SPEC=$(HOTSPOT_SPEC)
# Now include the base spec.gmk file
include $(BASE_SPEC)
# Additional legacy variables defined for Hotspot
@SET_OPENJDK@
# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
@BUILD_HEADLESS@
# Legacy setting: OPT or DBG
VARIANT:=@VARIANT@
# Legacy setting: true or false
FASTDEBUG:=@FASTDEBUG@
# Legacy setting: debugging the class files?
DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
# The HOSTCC/HOSTCXX is Hotspot terminology for the BUILD_CC/BUILD_CXX, i.e. the
# compiler that produces code that can be run on the build platform.
HOSTCC:=@UNCYGDRIVE@ @BUILD_CC@
HOSTCXX:=@UNCYGDRIVE@ @BUILD_CXX@
####################################################
#
# Legacy Hotspot support
# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here.
@DEFINE_CROSS_COMPILE_ARCH@
# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
PLATFORM=$(OPENJDK_TARGET_OS)
# 32 or 64 bit
ARCH_DATA_MODEL=$(OPENJDK_TARGET_CPU_BITS)
ALT_BOOTDIR=$(BOOT_JDK)
# Can be /sparcv9 or /amd64 on Solaris
ISA_DIR=$(OPENJDK_TARGET_CPU_ISADIR)
# Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of x86 and x86_64.
LIBARCH=$(OPENJDK_TARGET_CPU_LEGACY_LIB)
# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of x86 and x86_64.
ARCH=$(OPENJDK_TARGET_CPU_LEGACY)
# Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64:=1
@LP64@
ALT_OUTPUTDIR=$(HOTSPOT_OUTPUTDIR)
ALT_EXPORT_PATH=$(HOTSPOT_DIST)
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
# This is used from the libjvm build for C/C++ code.
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=@TEST_IN_BUILD@
EXTRA_CFLAGS=@LEGACY_EXTRA_CFLAGS@
EXTRA_CXXFLAGS=@LEGACY_EXTRA_CXXFLAGS@
EXTRA_LDFLAGS=@LEGACY_EXTRA_LDFLAGS@
......@@ -30,7 +30,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
# Check which variant of the JDK that we want to build.
# Currently we have:
# normal: standard edition
# embedded: cut down to a smaller footprint
# but the custom make system may add other variants
#
# Effectively the JDK variant gives a name to a specific set of
# modules to compile into the JDK. In the future, these modules
......@@ -38,22 +38,14 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
#
AC_MSG_CHECKING([which variant of the JDK to build])
AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
[JDK variant to build (normal, embedded) @<:@normal@:>@])])
[JDK variant to build (normal) @<:@normal@:>@])])
if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
JAVASE_EMBEDDED=""
MINIMIZE_RAM_USAGE=""
JDK_VARIANT="normal"
elif test "x$with_jdk_variant" = xembedded; then
JAVASE_EMBEDDED="JAVASE_EMBEDDED:=true"
MINIMIZE_RAM_USAGE="MINIMIZE_RAM_USAGE:=true"
JDK_VARIANT="embedded"
else
AC_MSG_ERROR([The available JDK variants are: normal, embedded])
AC_MSG_ERROR([The available JDK variants are: normal])
fi
AC_SUBST(JAVASE_EMBEDDED)
AC_SUBST(MINIMIZE_RAM_USAGE)
AC_SUBST(JDK_VARIANT)
AC_MSG_RESULT([$JDK_VARIANT])
......@@ -77,11 +69,7 @@ AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
[JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
if test "x$with_jvm_variants" = x; then
if test "x$JDK_VARIANT" = xembedded; then
with_jvm_variants="client"
else
with_jvm_variants="server"
fi
with_jvm_variants="server"
fi
JVM_VARIANTS=",$with_jvm_variants,"
......@@ -125,6 +113,11 @@ AC_SUBST(JVM_VARIANT_KERNEL)
AC_SUBST(JVM_VARIANT_ZERO)
AC_SUBST(JVM_VARIANT_ZEROSHARK)
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
MACOSX_UNIVERSAL="true"
fi
AC_SUBST(MACOSX_UNIVERSAL)
])
......@@ -223,6 +216,14 @@ fi
HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
# On Macosx universal binaries are produced, but they only contain
# 64 bit intel. This invalidates control of which jvms are built
# from configure, but only server is valid anyway. Fix this
# when hotspot makefiles are rewritten.
if test "x$MACOSX_UNIVERSAL" = xtrue; then
HOTSPOT_TARGET=universal_product
fi
#####
AC_SUBST(DEBUG_LEVEL)
......@@ -289,14 +290,12 @@ BUILD_HEADLESS="BUILD_HEADLESS:=true"
if test "x$SUPPORT_HEADFUL" = xyes; then
# We are building both headful and headless.
BUILD_HEADLESS_ONLY=""
headful_msg="inlude support for both headful and headless"
fi
if test "x$SUPPORT_HEADFUL" = xno; then
# Thus we are building headless only.
BUILD_HEADLESS="BUILD_HEADLESS:=true"
BUILD_HEADLESS_ONLY="BUILD_HEADLESS_ONLY:=true"
headful_msg="headless only"
fi
......@@ -305,23 +304,6 @@ AC_MSG_RESULT([$headful_msg])
AC_SUBST(SUPPORT_HEADLESS)
AC_SUBST(SUPPORT_HEADFUL)
AC_SUBST(BUILD_HEADLESS)
AC_SUBST(BUILD_HEADLESS_ONLY)
###############################################################################
#
# Should we run the painfully slow javadoc tool?
#
AC_MSG_CHECKING([whether to build documentation])
AC_ARG_ENABLE([docs], [AS_HELP_STRING([--enable-docs],
[enable generation of Javadoc documentation @<:@disabled@:>@])],
[ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='no'])
AC_MSG_RESULT([$ENABLE_DOCS])
AC_SUBST(ENABLE_DOCS)
GENERATE_DOCS=false
if test "x$ENABLE_DOCS" = xyes; then
GENERATE_DOCS=true
fi
AC_SUBST(GENERATE_DOCS)
###############################################################################
#
......@@ -373,25 +355,21 @@ AC_SUBST(CACERTS_FILE)
#
COMPRESS_JARS=false
# default for embedded is yes...
if test "x$JDK_VARIANT" = "xembedded"; then
COMPRESS_JARS=true
fi
AC_SUBST(COMPRESS_JARS)
###############################################################################
#
# Should we compile JFR
# default no, except for on closed-jdk and !embedded
# default no, except for on closed-jdk
#
ENABLE_JFR=no
# Is the JFR source present
#
# For closed && !embedded default is yes if the source is present
# For closed default is yes
#
if test "x${OPENJDK}" != "xtrue" && test "x$JDK_VARIANT" != "xembedded" && test -d "$SRC_ROOT/jdk/src/closed/share/native/oracle/jfr"; then
if test "x${OPENJDK}" != "xtrue"; then
ENABLE_JFR=yes
fi
......@@ -469,7 +447,7 @@ AC_SUBST(COOKED_BUILD_NUMBER)
AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
[
HOTSPOT_MAKE_ARGS="ALT_OUTPUTDIR=$HOTSPOT_OUTPUTDIR ALT_EXPORT_PATH=$HOTSPOT_DIST $HOTSPOT_TARGET"
HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
AC_SUBST(HOTSPOT_MAKE_ARGS)
# The name of the Service Agent jar.
......@@ -494,11 +472,6 @@ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
ENABLE_DEBUG_SYMBOLS=no
fi
# default for embedded is no...
if test "x$JDK_VARIANT" = "xembedded"; then
ENABLE_DEBUG_SYMBOLS=no
fi
AC_ARG_ENABLE([debug-symbols],
[AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])],
[ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}],
......@@ -549,3 +522,11 @@ AC_SUBST(ZIP_DEBUGINFO_FILES)
AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
])
# Support for customization of the build process. Some build files
# will include counterparts from this location, if they exist. This allows
# for a degree of customization of the build targets and the rules/recipes
# to create them
AC_ARG_WITH([custom-make-dir], [AS_HELP_STRING([--with-custom-make-dir],
[directory containing custom build/make files])], [CUSTOM_MAKE_DIR=$with_custom_make_dir])
AC_SUBST(CUSTOM_MAKE_DIR)
......@@ -73,6 +73,10 @@ if test "x$OPENJDK" = "xfalse"; then
FREETYPE2_NOT_NEEDED=yes
fi
if test "x$SUPPORT_HEADFUL" = xno; then
X11_NOT_NEEDED=yes
fi
###############################################################################
#
# Check for MacOSX support for OpenJDK. If this exists, try to build a JVM
......@@ -518,9 +522,7 @@ AC_SUBST(USE_EXTERNAL_LIBZ)
###############################################################################
LIBZIP_CAN_USE_MMAP=true
if test "x$JDK_VARIANT" = "xembedded"; then
LIBZIP_CAN_USE_MMAP=false
fi
AC_SUBST(LIBZIP_CAN_USE_MMAP)
###############################################################################
......@@ -629,7 +631,7 @@ fi
# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
LIBCXX="/usr/lib${LEGACY_OPENJDK_TARGET_CPU3}/libCrun.so.1"
LIBCXX="/usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libCrun.so.1"
fi
# TODO better (platform agnostic) test
......
此差异已折叠。
......@@ -250,31 +250,8 @@ fi
AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
[
LANGTOOLS_OUTPUTDIR="$OUTPUT_ROOT/langtools"
CORBA_OUTPUTDIR="$OUTPUT_ROOT/corba"
JAXP_OUTPUTDIR="$OUTPUT_ROOT/jaxp"
JAXWS_OUTPUTDIR="$OUTPUT_ROOT/jaxws"
HOTSPOT_OUTPUTDIR="$OUTPUT_ROOT/hotspot"
JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
IMAGES_OUTPUTDIR="$OUTPUT_ROOT/images"
AC_SUBST(LANGTOOLS_OUTPUTDIR)
AC_SUBST(CORBA_OUTPUTDIR)
AC_SUBST(JAXP_OUTPUTDIR)
AC_SUBST(JAXWS_OUTPUTDIR)
AC_SUBST(HOTSPOT_OUTPUTDIR)
AC_SUBST(JDK_OUTPUTDIR)
AC_SUBST(IMAGES_OUTPUTDIR)
BUILD_OUTPUT="$OUTPUT_ROOT"
AC_SUBST(BUILD_OUTPUT)
LANGTOOLS_DIST="$OUTPUT_ROOT/langtools/dist"
CORBA_DIST="$OUTPUT_ROOT/corba/dist"
JAXP_DIST="$OUTPUT_ROOT/jaxp/dist"
JAXWS_DIST="$OUTPUT_ROOT/jaxws/dist"
HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
AC_SUBST(LANGTOOLS_DIST)
AC_SUBST(CORBA_DIST)
AC_SUBST(JAXP_DIST)
AC_SUBST(JAXWS_DIST)
AC_SUBST(HOTSPOT_DIST)
JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
])
......@@ -23,7 +23,11 @@
# questions.
#
# Configured @DATE_WHEN_CONFIGURED@ to build for a @OPENJDK_TARGET_SYSTEM@ system,
# Configured @DATE_WHEN_CONFIGURED@ to build
# for target system @OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU@
# (called @OPENJDK_TARGET_AUTOCONF_NAME@ by autoconf)
# on build system @OPENJDK_BUILD_OS@-@OPENJDK_BUILD_CPU@
# (called @OPENJDK_BUILD_AUTOCONF_NAME@ by autoconf)
# using 'configure @CONFIGURE_COMMAND_LINE@'
# When calling macros, the spaces between arguments are
......@@ -40,6 +44,17 @@ DQUOTE:="
define NEWLINE:=
endef
# A self-referential reference to this file.
SPEC:=@SPEC@
# Specify where the spec file is.
MAKE_ARGS="SPEC=$(SPEC)"
# TODO The logic for finding and setting MAKE is currently not working
# well on windows. Disable it TEMPORARILY there for now.
ifneq (@OPENJDK_TARGET_OS@,windows)
MAKE:=@MAKE@
endif
# Pass along the verbosity setting.
ifeq (,$(findstring VERBOSE=,$(MAKE)))
......@@ -51,27 +66,16 @@ ifeq (,$(findstring -R,$(MAKE)))
MAKE:=$(MAKE) -R
endif
# Specify where the spec file is.
ifeq (,$(findstring SPEC=,$(MAKE)))
MAKE:=$(MAKE) SPEC=@SPEC@
endif
# Specify where the common include directory for makefiles is.
ifeq (,$(findstring -I @SRC_ROOT@/common/makefiles,$(MAKE)))
MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles
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 target system.
OPENJDK_TARGET_SYSTEM:=@OPENJDK_TARGET_SYSTEM@
OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
OPENJDK_TARGET_OS_FAMILY:=@OPENJDK_TARGET_OS_FAMILY@
OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@
OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
......@@ -79,12 +83,20 @@ OPENJDK_TARGET_CPU_ARCH:=@OPENJDK_TARGET_CPU_ARCH@
OPENJDK_TARGET_CPU_BITS:=@OPENJDK_TARGET_CPU_BITS@
OPENJDK_TARGET_CPU_ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@
COMPILE_TYPE:=@COMPILE_TYPE@
# Legacy support
OPENJDK_TARGET_CPU_ISADIR:=@OPENJDK_TARGET_CPU_ISADIR@
OPENJDK_TARGET_CPU_LIBDIR:=@OPENJDK_TARGET_CPU_LIBDIR@
OPENJDK_TARGET_CPU_LEGACY:=@OPENJDK_TARGET_CPU_LEGACY@
OPENJDK_TARGET_CPU_LEGACY_LIB:=@OPENJDK_TARGET_CPU_LEGACY_LIB@
OPENJDK_TARGET_CPU_OSARCH:=@OPENJDK_TARGET_CPU_OSARCH@
OPENJDK_TARGET_CPU_JLI_CFLAGS:=@OPENJDK_TARGET_CPU_JLI_CFLAGS@
OPENJDK_TARGET_OS_API_DIR:=@OPENJDK_TARGET_OS_API_DIR@
# We are building on this build system.
# When not cross-compiling, it is the same as the target.
OPENJDK_BUILD_SYSTEM:=@OPENJDK_BUILD_SYSTEM@
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
OPENJDK_BUILD_OS_FAMILY:=@OPENJDK_BUILD_OS_FAMILY@
OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@
OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@
......@@ -96,21 +108,6 @@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
PLATFORM:=@OPENJDK_TARGET_OS@
# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of ia32 and x64.
ARCH:=@LEGACY_OPENJDK_TARGET_CPU1@
# Yet another name for arch used for an extra subdir below the jvm lib.
# Uses i386 and amd64, instead of ia32 and x64.
LIBARCH:=@LEGACY_OPENJDK_TARGET_CPU2@
# Use to switch between solaris and windows subdirs in the jdk.
LEGACY_OPENJDK_TARGET_OS_API:=@LEGACY_OPENJDK_TARGET_OS_API@
# 32 or 64 bit
ARCH_DATA_MODEL:=@OPENJDK_TARGET_CPU_BITS@
# Legacy setting for building for a 64 bit machine.
# If yes then this expands to _LP64:=1
@LP64@
ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@
@SET_OPENJDK@
JIGSAW:=@JIGSAW@
LIBM:=-lm
......@@ -143,6 +140,9 @@ JAXWS_TOPDIR:=@JAXWS_TOPDIR@
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@
# Location where build customization files may be found
CUSTOM_MAKE_DIR:=@CUSTOM_MAKE_DIR@
# Information gathered from the version.numbers file.
JDK_MAJOR_VERSION:=@JDK_MAJOR_VERSION@
JDK_MINOR_VERSION:=@JDK_MINOR_VERSION@
......@@ -171,17 +171,12 @@ DEBUG_LEVEL:=@DEBUG_LEVEL@
# The JDK variant is a name for a specific set of modules to be compiled for the JDK.
JDK_VARIANT:=@JDK_VARIANT@
# Legacy defines controlling the JDK variant embedded.
@JAVASE_EMBEDDED@
@MINIMIZE_RAM_USAGE@
# Should we compile support for running with a graphical UI? (ie headful)
# Should we compile support for running without? (ie headless)
SUPPORT_HEADFUL:=@SUPPORT_HEADFUL@
SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
@BUILD_HEADLESS@
@BUILD_HEADLESS_ONLY@
# These are the libjvms that we want to build.
# The java launcher uses the default.
......@@ -194,53 +189,43 @@ JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@
JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
# Legacy setting: OPT or DBG
VARIANT:=@VARIANT@
# Legacy setting: true or false
FASTDEBUG:=@FASTDEBUG@
# Legacy setting: debugging the class files?
DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
# Universal binaries on macosx
MACOSX_UNIVERSAL=@MACOSX_UNIVERSAL@
# Legacy setting: -debug or -fastdebug
# Still used in version string...
BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
LANGTOOLS_OUTPUTDIR:=@LANGTOOLS_OUTPUTDIR@
CORBA_OUTPUTDIR:=@CORBA_OUTPUTDIR@
JAXP_OUTPUTDIR:=@JAXP_OUTPUTDIR@
JAXWS_OUTPUTDIR:=@JAXWS_OUTPUTDIR@
HOTSPOT_OUTPUTDIR:=@HOTSPOT_OUTPUTDIR@
# This where a working jvm is built.
# JDK_OUTPUTDIR specifies where a working jvm is built.
# You can run $(JDK_OUTPUTDIR)/bin/java
# Though the layout of the contents of $(JDK_OUTPUTDIR) is not
# yet the same as a default installation.
JDK_OUTPUTDIR:=@OUTPUT_ROOT@/jdk
#
# When you run "make install" it will create the standardized
# layout for the jdk and the jre inside the images subdir.
# layout for the jdk and the jre inside the IMAGES_OUTPUTDIR subdir.
# Then it will copy the contents of the jdk into the installation
# directory.
IMAGES_OUTPUTDIR:=@OUTPUT_ROOT@/images
LANGTOOLS_DIST:=@LANGTOOLS_DIST@
CORBA_DIST:=@CORBA_DIST@
JAXP_DIST:=@JAXP_DIST@
JAXWS_DIST:=@JAXWS_DIST@
HOTSPOT_DIST:=@HOTSPOT_DIST@
# Legacy variables used by Release.gmk
JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image
JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image
# Can be /sparcv9 or /amd64 on Solaris
ISA_DIR:=@LEGACY_OPENJDK_TARGET_CPU3@
BINDIR:=$(JDK_OUTPUTDIR)/bin$(ISA_DIR)
BUILD_OUTPUT:=@BUILD_OUTPUT@
LANGTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/langtools
CORBA_OUTPUTDIR=$(BUILD_OUTPUT)/corba
JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
JDK_OUTPUTDIR=$(BUILD_OUTPUT)/jdk
IMAGES_OUTPUTDIR=$(BUILD_OUTPUT)/images
LANGTOOLS_DIST=$(LANGTOOLS_OUTPUTDIR)/dist
CORBA_DIST=$(CORBA_OUTPUTDIR)/dist
JAXP_DIST=$(JAXP_OUTPUTDIR)/dist
JAXWS_DIST=$(JAXWS_OUTPUTDIR)/dist
HOTSPOT_DIST=$(HOTSPOT_OUTPUTDIR)/dist
# The boot jdk to use
ALT_BOOTDIR:=@BOOT_JDK@
BOOT_JDK:=@BOOT_JDK@
BOOT_JDK_JVMARGS:=@BOOT_JDK_JVMARGS@
BOOT_RTJAR:=@BOOT_RTJAR@
BOOT_TOOLSJAR:=@BOOT_TOOLSJAR@
BOOT_TOOLSJAR=$(BOOT_JDK)/lib/tools.jar
# When compiling Java source to be run by the boot jdk
# use these extra flags, eg -source 6 -target 6
......@@ -248,30 +233,18 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
# Information about the build system
NUM_CORES:=@NUM_CORES@
# This is used from the jdk build for C/C++ code.
PARALLEL_COMPILE_JOBS:=@CONCURRENT_BUILD_JOBS@
# Store javac server synchronization files here, and
# the javac server log files.
JAVAC_SERVERS:=@JAVAC_SERVERS@
# Should we use a javac server or not? The javac server gives
# an enormous performance improvement since it reduces the
# startup costs of javac and reuses as much as possible of intermediate
# compilation work. But if we want to compile with a non-Java
# javac compiler, like gcj. Then we cannot use javac server and
# this variable is set to false.
JAVAC_USE_REMOTE:=@JAVAC_USE_REMOTE@
# Enable sjavac support = use a javac server,
# multi core javac compilation and dependency tracking.
ENABLE_SJAVAC:=@ENABLE_SJAVAC@
# Store sjavac server synchronization files here, and
# the sjavac server log files.
SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
# We can block the Javac server to never use more cores than this.
# This is not for performance reasons, but for memory usage, since each
# core requires its own JavaCompiler. We might have 64 cores and 4GB
# of memory, 64 JavaCompilers will currently not fit in a 3GB heap.
# Since there is no sharing of data between the JavaCompilers.
JAVAC_SERVER_CORES:=@JAVAC_SERVER_CORES@
# Should we use dependency tracking between Java packages? true or false.
JAVAC_USE_DEPS:=@JAVAC_USE_DEPS@
# We can invoke javac: SINGLE_THREADED_BATCH or MULTI_CORE_CONCURRENT
JAVAC_USE_MODE:=@JAVAC_USE_MODE@
# Enable not yet complete sjavac support.
ENABLE_SJAVAC:=@ENABLE_SJAVAC@
SJAVAC_SERVER_CORES:=@SJAVAC_SERVER_CORES@
# The OpenJDK makefiles should be changed to using the standard
# configure output ..._CFLAGS and ..._LIBS. In the meantime we
......@@ -280,7 +253,6 @@ FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@
FREETYPE2_LIBS:=@FREETYPE2_LIBS@
FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@
USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@
ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
CUPS_CFLAGS:=@CUPS_CFLAGS@
PACKAGE_PATH=@PACKAGE_PATH@
......@@ -288,8 +260,6 @@ PACKAGE_PATH=@PACKAGE_PATH@
# Source file for cacerts
CACERTS_FILE=@CACERTS_FILE@
#MOZILLA_HEADERS_PATH:=
# Necessary additional compiler flags to compile X11
X_CFLAGS:=@X_CFLAGS@
X_LIBS:=@X_LIBS@
......@@ -338,7 +308,7 @@ OBJC:=@CCACHE@ @OBJC@
CPP:=@UNCYGDRIVE@ @CPP@
#CPPFLAGS:=@CPPFLAGS@
# The linker can be gcc or ld on posix systems, or link.exe on winapi systems.
# The linker can be gcc or ld on posix systems, or link.exe on windows systems.
LD:=@UNCYGDRIVE@ @LD@
# LDFLAGS used to link the jdk native libraries (C-code)
......@@ -353,6 +323,9 @@ LDEXE:=@UNCYGDRIVE@ @LDEXE@
LDFLAGS_JDKEXE:=@LDFLAGS_JDKEXE@
LDFLAGS_JDKEXE_SUFFIX:=@LDFLAGS_JDKEXE_SUFFIX@
# LDFLAGS specific to C++ linking.
LDFLAGS_CXX_JDK:=@LDFLAGS_CXX_JDK@
# Sometimes a different linker is needed for c++ libs
LDCXX:=@UNCYGDRIVE@ @LDCXX@
# The flags for linking libstdc++ linker.
......@@ -361,28 +334,22 @@ LIBCXX:=@LIBCXX@
# Sometimes a different linker is needed for c++ executables
LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@
# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here.
@DEFINE_CROSS_COMPILE_ARCH@
# The HOSTCC should really be named BUILDCC, ie build executable for
# the build platform. Same as CC when not cross compiling.
HOSTCC:=@UNCYGDRIVE@ @HOSTCC@
HOSTCXX:=@UNCYGDRIVE@ @HOSTCXX@
# And of course, the jdk spells HOSTCC as NIO_CC/HOST_CC
HOST_CC:=@UNCYGDRIVE@ @HOSTCC@
NIO_CC:=@UNCYGDRIVE@ @HOSTCC@
HOST_LD:=@UNCYGDRIVE@ @HOSTLD@
# BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
# build platform.
BUILD_CC:=@UNCYGDRIVE@ @BUILD_CC@
BUILD_LD:=@UNCYGDRIVE@ @BUILD_LD@
AS:=@UNCYGDRIVE@ @AS@
ASFLAGS:=@ASFLAGS@
# AR is used to create a static library (is ar in posix, lib.exe in winapi)
# AR is used to create a static library (is ar in posix, lib.exe in windows)
AR:=@UNCYGDRIVE@ @AR@
ARFLAGS:=@ARFLAGS@
NM:=@UNCYGDRIVE@ @NM@
STRIP:=@UNCYGDRIVE@ @STRIP@
MCS:=@UNCYGDRIVE@ @MCS@
NM:=@NM@
STRIP:=@STRIP@
MCS:=@MCS@
LIPO:=@LIPO@
# Command to create a shared library
SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
......@@ -414,6 +381,7 @@ SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
# Set origin using the linker, ie use the relative path to the dependent library to find the dependees.
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_ORIGIN=@SET_SHARED_LIBRARY_ORIGIN@
SET_EXECUTABLE_ORIGIN=@SET_EXECUTABLE_ORIGIN@
# Different OS:es have different ways of naming shared libraries.
# The SHARED_LIBRARY macro takes "verify" as and argument and returns:
......@@ -432,21 +400,20 @@ POST_MCS_CMD:=@POST_MCS_CMD@
JAVA_FLAGS:=@BOOT_JDK_JVMARGS@
JAVA=@UNCYGDRIVE@ @JAVA@ $(JAVA_FLAGS)
JAVAC:=@UNCYGDRIVE@ @JAVAC@
JAVAC_FLAGS:=@JAVAC_FLAGS@
JAVA=@UNCYGDRIVE@ $(BOOT_JDK)/bin/java $(JAVA_FLAGS)
JAVAH:=@UNCYGDRIVE@ @JAVAH@
JAVAC=@UNCYGDRIVE@ $(BOOT_JDK)/bin/javac
# Hotspot sets this variable before reading the SPEC when compiling sa-jdi.jar. Avoid
# overriding that value by using ?=.
JAVAC_FLAGS?=@JAVAC_FLAGS@
JAR:=@UNCYGDRIVE@ @JAR@
JAVAH=@UNCYGDRIVE@ $(BOOT_JDK)/bin/javah
RMIC:=@UNCYGDRIVE@ @RMIC@
JAR=@UNCYGDRIVE@ $(BOOT_JDK)/bin/jar
NATIVE2ASCII:=@UNCYGDRIVE@ @NATIVE2ASCII@
RMIC=@UNCYGDRIVE@ $(BOOT_JDK)/bin/rmic
BOOT_JAR_CMD:=@UNCYGDRIVE@ @JAR@
BOOT_JAR_JFLAGS:=
NATIVE2ASCII=@UNCYGDRIVE@ $(BOOT_JDK)/bin/native2ascii
# Base flags for RC
# Guarding this against resetting value. Legacy make files include spec multiple
......@@ -456,11 +423,12 @@ RC_FLAGS:=@RC_FLAGS@
endif
# A specific java binary with specific options can be used to run
# the long running background javac server and other long running tasks.
SERVER_JAVA:=@UNCYGDRIVE@ @SERVER_JAVA@
# the long running background sjavac servers and other long running tasks.
SJAVAC_SERVER_JAVA:=@UNCYGDRIVE@ @SJAVAC_SERVER_JAVA@
# Tools adhering to a minimal and common standard of posix compliance.
AWK:=@AWK@
BASENAME:=@BASENAME@
CAT:=@CAT@
CCACHE:=@CCACHE@
# CD is going away, but remains to cater for legacy makefiles.
......@@ -520,8 +488,6 @@ BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
# Build setup
ENABLE_DOCS:=@ENABLE_DOCS@
GENERATE_DOCS:=@ENABLE_DOCS@
DISABLE_NIMBUS:=@DISABLE_NIMBUS@
ENABLE_JFR=@ENABLE_JFR@
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
......@@ -559,17 +525,6 @@ else
OVR_SRCS:=
endif
####################################################
#
# Legacy Hotspot support
HOTSPOT_DIST:=@HOTSPOT_DIST@
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
# This is used from the libjvm build for C/C++ code.
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
# Control wether Hotspot runs Queens test after building
TEST_IN_BUILD=@TEST_IN_BUILD@
####################################################
#
# INSTALLATION
......@@ -634,5 +589,5 @@ OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
OS_VERSION_MINOR:=@OS_VERSION_MINOR@
OS_VERSION_MICRO:=@OS_VERSION_MICRO@
# Include the closed-spec.gmk file if it exists
-include $(dir @SPEC@)/closed-spec.gmk
# Include the custom-spec.gmk file if it exists
-include $(dir @SPEC@)/custom-spec.gmk
此差异已折叠。
此差异已折叠。
#!/bin/bash
#
# Copyright (c) 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.
#
# 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.
#
# The boot_cycle.sh script performs two complete image builds (no javadoc though....)
# where the second build uses the first build as the boot jdk.
#
# This is useful to verify that the build is self hoisting and assists
# in flushing out bugs. You can follow up with compare_objects.sh to check
# that the two boot_cycle_?/images/j2sdk are identical. They should be.
#
# Usage:
# Specify the configure arguments to boot_cycle.sh, for example:
#
# sh common/bin/boot_cycle.sh --enable-debug --with-jvm-variants=server
#
# The same arguments will be used for both builds, except of course --with-boot-jdk
# that will be adjusted to boot_cycle_1 for the second build.
SCRIPT_DIR=`pwd`/`dirname $0`
ROOT_DIR=`(cd $SCRIPT_DIR/../.. ; pwd)`
BUILD_DIR=$ROOT_DIR/build
mkdir -p $BUILD_DIR
AUTOCONF_DIR=`(cd $SCRIPT_DIR/../autoconf ; pwd)`
BOOT_CYCLE_1_DIR=$BUILD_DIR/boot_cycle_1
BOOT_CYCLE_2_DIR=$BUILD_DIR/boot_cycle_2
# Create the boot cycle dirs in the build directory.
mkdir -p $BOOT_CYCLE_1_DIR
mkdir -p $BOOT_CYCLE_2_DIR
cd $BOOT_CYCLE_1_DIR
# Configure!
sh $AUTOCONF_DIR/configure "$@"
# Now build!
make images
if ! test -x $BOOT_CYCLE_1_DIR/images/j2sdk-image/bin/java ; then
echo Failed to build the executable $BOOT_CYCLE_1_DIR/images/j2sdk-image/bin/java
exit 1
fi
cd $BOOT_CYCLE_2_DIR
# Pickup the configure arguments, but drop any --with-boot-jdk=....
# and add the correct --with-boot-jdk=...boot_cycle_1... at the end.
ARGUMENTS="`cat $BOOT_CYCLE_1_DIR/configure-arguments|sed 's/--with-boot-jdk=[^ ]*//'` --with-boot-jdk=$BOOT_CYCLE_1_DIR/images/j2sdk-image"
# Configure using these adjusted arguments.
sh $AUTOCONF_DIR/configure $ARGUMENTS
# Now build!
make images
if ! test -x $BOOT_CYCLE_2_DIR/images/j2sdk-image/bin/java ; then
echo Failed to build the final executable $BOOT_CYCLE_2_DIR/images/j2sdk-image/bin/java
exit 1
fi
......@@ -30,7 +30,7 @@
#
if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then
echo "bash ./common/bin/compare-build.sh old_jdk_build_dir new_jdk_build_dir"
echo "bash ./common/bin/compare-objects.sh old_jdk_build_dir new_jdk_build_dir <pattern>"
echo ""
echo "Compare object files"
echo ""
......
此差异已折叠。
此差异已折叠。
#
# 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.
#
# Include the legacy hotspot-spec.gmk (which in turns includes spec.gmk)
BASE_SPEC:=$(SPEC)
include $(dir $(SPEC))hotspot-spec.gmk
include MakeBase.gmk
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j. Recursively called makefiles will not be
# affected, however. This is required for correct dependency management.
.NOTPARALLEL:
default: all
# Get all files except .hg in the hotspot directory.
HOTSPOT_FILES := $(shell $(FIND) $(HOTSPOT_TOPDIR) -name ".hg" -prune -o -print)
$(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp: $(HOTSPOT_FILES)
@($(CD) $(HOTSPOT_TOPDIR)/make && $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) SPEC=$(HOTSPOT_SPEC) BASE_SPEC=$(BASE_SPEC))
$(TOUCH) $@
hotspot: $(HOTSPOT_OUTPUTDIR)/_hotspot.timestamp
all: hotspot
.PHONY: default all hotspot
......@@ -138,7 +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))
$(if $(findstring --jobserver,$(MAKEFLAGS)), $(error make -j is not supported, use make JOBS=n))
$(call PrintStartMessage)
$(call StartTimer)
endef
......
......@@ -57,9 +57,25 @@ endef
define ParseLogLevel
ifeq ($$(origin VERBOSE),undefined)
# Setup logging according to LOG (but only if VERBOSE is not given)
# If the "nofile" argument is given, act on it and strip it away
ifneq ($$(findstring nofile,$$(LOG)),)
# Reset the build log wrapper, regardless of other values
override BUILD_LOG_WRAPPER=
# COMMA is defined in spec.gmk, but that is not included yet
COMMA=,
# First try to remove ",nofile" if it exists
LOG_STRIPPED1=$$(subst $$(COMMA)nofile,,$$(LOG))
# Otherwise just remove "nofile"
LOG_STRIPPED2=$$(subst nofile,,$$(LOG_STRIPPED1))
# We might have ended up with a leading comma. Remove it
LOG_STRIPPED3=$$(strip $$(patsubst $$(COMMA)%,%,$$(LOG_STRIPPED2)))
override LOG:=$$(LOG_STRIPPED3)
endif
ifeq ($$(LOG),)
# Set LOG to "warn" as default if not set (and no VERBOSE given)
LOG=warn
override LOG=warn
endif
ifeq ($$(LOG),warn)
VERBOSE=-s
......@@ -182,4 +198,11 @@ define PrintEndMessage
$(call CheckEnvironment)
endef
# Cleans the component given as $1
define CleanComponent
@$(PRINTF) "Cleaning $1 build artifacts ..."
@($(CD) $(OUTPUT_ROOT) && $(RM) -r $1)
@$(PRINTF) " done\n"
endef
endif # _MAKEHELPERS_GMK
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册