提交 27797a3a 编写于 作者: D duke

Merge

^build/ ^build/
^dist/ ^dist/
/nbproject/private/ nbproject/private/
^webrev ^webrev
^.hgtip ^.hgtip
^.bridge2
.DS_Store .DS_Store
...@@ -177,3 +177,4 @@ c97b99424815c43818e3cc3ffcdd1a60f3198b52 jdk8-b49 ...@@ -177,3 +177,4 @@ c97b99424815c43818e3cc3ffcdd1a60f3198b52 jdk8-b49
febd7ff5280067ca482faaeb9418ae88764c1a35 jdk8-b53 febd7ff5280067ca482faaeb9418ae88764c1a35 jdk8-b53
c1a277c6022affbc6855bdfb039511e73fbe2395 jdk8-b54 c1a277c6022affbc6855bdfb039511e73fbe2395 jdk8-b54
b85b44cced2406792cfb9baab1377ff03e7001d8 jdk8-b55 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. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
...@@ -23,6 +23,16 @@ ...@@ -23,6 +23,16 @@
# questions. # 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=. BUILD_PARENT_DIRECTORY=.
# Basename of any originally supplied ALT_OUTPUTDIR directory # Basename of any originally supplied ALT_OUTPUTDIR directory
...@@ -557,3 +567,5 @@ include ./make/jprt.gmk ...@@ -557,3 +567,5 @@ include ./make/jprt.gmk
# Force target # Force target
FRC: 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 @@ ...@@ -23,18 +23,38 @@
# #
script_dir=`dirname $0` script_dir=`dirname $0`
closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
# Create a timestamp as seconds since epoch # 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 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 rm -rf autom4te.cache
if test -e $closed_script_dir/closed-hook.m4; then if $TEST -e $custom_hook; then
# We have closed sources available; also generate configure script echo Generating custom generated-configure.sh
# with closed hooks compiled in. # 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|" | \ 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 rm -rf autom4te.cache
else
echo No custom hook found: $custom_hook
fi fi
...@@ -34,7 +34,7 @@ AC_DEFUN([ADD_JVM_ARG_IF_OK], ...@@ -34,7 +34,7 @@ AC_DEFUN([ADD_JVM_ARG_IF_OK],
fi fi
]) ])
AC_DEFUN([WHICHCMD], AC_DEFUN([SET_FULL_PATH],
[ [
# Translate "gcc -E" into "`which gcc` -E" ie # Translate "gcc -E" into "`which gcc` -E" ie
# extract the full path to the binary and at the # extract the full path to the binary and at the
...@@ -46,7 +46,7 @@ AC_DEFUN([WHICHCMD], ...@@ -46,7 +46,7 @@ AC_DEFUN([WHICHCMD],
cdr="${tmp#* }" cdr="${tmp#* }"
# On windows we want paths without spaces. # On windows we want paths without spaces.
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
WHICHCMD_SPACESAFE(car) SET_FULL_PATH_SPACESAFE(car)
else else
# "which" is not portable, but is used here # "which" is not portable, but is used here
# because we know that the command exists! # because we know that the command exists!
...@@ -66,15 +66,19 @@ AC_DEFUN([SPACESAFE], ...@@ -66,15 +66,19 @@ AC_DEFUN([SPACESAFE],
HAS_SPACE=`echo "[$]$1" | grep " "` HAS_SPACE=`echo "[$]$1" | grep " "`
if test "x$HAS_SPACE" != x; then if test "x$HAS_SPACE" != x; then
if test "x$OPENJDK_BUILD_OS" = "xwindows"; 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 -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 else
AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"]) AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
fi fi
fi fi
]) ])
AC_DEFUN([WHICHCMD_SPACESAFE], AC_DEFUN([SET_FULL_PATH_SPACESAFE],
[ [
# Translate long cygdrive or C:\sdfsf path # Translate long cygdrive or C:\sdfsf path
# into a short mixed mode path that has no # into a short mixed mode path that has no
...@@ -148,15 +152,16 @@ AC_DEFUN_ONCE([BASIC_INIT], ...@@ -148,15 +152,16 @@ AC_DEFUN_ONCE([BASIC_INIT],
AC_SUBST(CONFIGURE_COMMAND_LINE) AC_SUBST(CONFIGURE_COMMAND_LINE)
DATE_WHEN_CONFIGURED=`LANG=C date` DATE_WHEN_CONFIGURED=`LANG=C date`
AC_SUBST(DATE_WHEN_CONFIGURED) 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. # Locate the directory of this script.
SCRIPT="[$]0" SCRIPT="[$]0"
REMOVE_SYMBOLIC_LINKS(SCRIPT) REMOVE_SYMBOLIC_LINKS(SCRIPT)
AUTOCONF_DIR=`dirname [$]0` AUTOCONF_DIR=`dirname [$]0`
])
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
[
# Where is the source? It is located two levels above the configure script. # Where is the source? It is located two levels above the configure script.
CURDIR="$PWD" CURDIR="$PWD"
cd "$AUTOCONF_DIR/../.." cd "$AUTOCONF_DIR/../.."
...@@ -172,18 +177,12 @@ cd "$CURDIR" ...@@ -172,18 +177,12 @@ cd "$CURDIR"
SPACESAFE(SRC_ROOT,[the path to the source root]) SPACESAFE(SRC_ROOT,[the path to the source root])
SPACESAFE(CURDIR,[the path to the current directory]) SPACESAFE(CURDIR,[the path to the current directory])
])
AC_DEFUN_ONCE([BASIC_SETUP_SEARCHPATH],
[
if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
# Add extra search paths on solaris for utilities like ar and as etc... # Add extra search paths on solaris for utilities like ar and as etc...
PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin" PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
fi fi
])
AC_DEFUN_ONCE([BASIC_SETUP_PATH_SEP],
[
# For cygwin we need cygpath first, since it is used everywhere. # For cygwin we need cygpath first, since it is used everywhere.
AC_PATH_PROG(CYGPATH, cygpath) AC_PATH_PROG(CYGPATH, cygpath)
PATH_SEP=":" PATH_SEP=":"
...@@ -194,6 +193,36 @@ if test "x$OPENJDK_BUILD_OS" = "xwindows"; then ...@@ -194,6 +193,36 @@ if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
PATH_SEP=";" PATH_SEP=";"
fi fi
AC_SUBST(PATH_SEP) 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], AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
...@@ -236,7 +265,13 @@ AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT) ...@@ -236,7 +265,13 @@ AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in]) AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
# The spec.gmk file contains all variables for the make system. # The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in]) 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]) 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. # 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 # You can run make from the OUTPUT_ROOT, or from the top-level Makefile
...@@ -261,6 +296,79 @@ AC_SUBST(BUILD_LOG_WRAPPER) ...@@ -261,6 +296,79 @@ AC_SUBST(BUILD_LOG_WRAPPER)
#%%% Simple tools %%% #%%% 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], AC_DEFUN([BASIC_CHECK_FIND_DELETE],
[ [
# Test if find supports -delete # Test if find supports -delete
...@@ -283,10 +391,30 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE], ...@@ -283,10 +391,30 @@ AC_DEFUN([BASIC_CHECK_FIND_DELETE],
rmdir $DELETEDIR 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], AC_DEFUN([CHECK_NONEMPTY],
[ [
# Test that variable $1 is not empty. if test "x[$]$1" = x; then
if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi 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], AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
...@@ -295,90 +423,68 @@ 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 # 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 # used by configure. Nor are these tools expected to be found in the
# devkit from the builddeps server either, since they are # 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 AC_PROG_AWK
CHECK_NONEMPTY(AWK) CHECK_NONEMPTY(AWK)
AC_PATH_PROG(CAT, cat) AC_PROG_GREP
CHECK_NONEMPTY(CAT) CHECK_NONEMPTY(GREP)
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_EGREP AC_PROG_EGREP
CHECK_NONEMPTY(EGREP) CHECK_NONEMPTY(EGREP)
AC_PROG_FGREP AC_PROG_FGREP
CHECK_NONEMPTY(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 BASIC_CHECK_FIND_DELETE
AC_SUBST(FIND_DELETE) AC_SUBST(FIND_DELETE)
AC_PROG_GREP # Non-required basic tools
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)
AC_PATH_PROG(THEPWDCMD, pwd) 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) AC_PATH_PROG(LDD, ldd)
if test "x$LDD" = "x"; then if test "x$LDD" = "x"; then
# List shared lib dependencies is used for # List shared lib dependencies is used for
...@@ -390,16 +496,11 @@ AC_PATH_PROG(OTOOL, otool) ...@@ -390,16 +496,11 @@ AC_PATH_PROG(OTOOL, otool)
if test "x$OTOOL" = "x"; then if test "x$OTOOL" = "x"; then
OTOOL="true" OTOOL="true"
fi fi
AC_PATH_PROG(READELF, readelf) AC_PATH_PROGS(READELF, [readelf greadelf])
AC_PATH_PROG(EXPR, expr) AC_PATH_PROGS(OBJDUMP, [objdump gobjdump])
CHECK_NONEMPTY(EXPR)
AC_PATH_PROG(FILE, file)
CHECK_NONEMPTY(FILE)
AC_PATH_PROG(HG, hg) AC_PATH_PROG(HG, hg)
]) ])
AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE], AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE],
[ [
# When using cygwin, we need a wrapper binary that renames # When using cygwin, we need a wrapper binary that renames
...@@ -433,6 +534,8 @@ if test "x$OPENJDK_BUILD_OS" = xwindows; then ...@@ -433,6 +534,8 @@ if test "x$OPENJDK_BUILD_OS" = xwindows; then
fi fi
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj 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 fi
AC_SUBST(UNCYGDRIVE) AC_SUBST(UNCYGDRIVE)
......
...@@ -23,66 +23,97 @@ ...@@ -23,66 +23,97 @@
# questions. # questions.
# #
# Fixes paths on windows to be mixed mode short. # Execute the check given as argument, and verify the result
AC_DEFUN([BOOTJDK_WIN_FIX_PATH], # 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 if test "x$BOOT_JDK_FOUND" = xno; then
AC_PATH_PROG(CYGPATH, cygpath) # Now execute the test
tmp="[$]$1" $1
# Convert to C:/ mixed style path without spaces.
tmp=`$CYGPATH -s -m "$tmp"`
$1="$tmp"
fi
])
AC_DEFUN([BOOTJDK_MISSING_ERROR], # 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
AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk]) # Do we have a bin/java?
AC_MSG_ERROR([Cannot continue]) 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`
############################################################################### # Extra M4 quote needed to protect [] in grep expression.
# [FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`]
# We need a Boot JDK to bootstrap the build. 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 if test "x$with_boot_jdk" != x; then
BOOT_JDK=$with_boot_jdk BOOT_JDK=$with_boot_jdk
BOOT_JDK_FOUND=yes BOOT_JDK_FOUND=maybe
fi AC_MSG_NOTICE([Found potential Boot JDK using configure arguments])
if test "x$BOOT_JDK_FOUND" = xno; then
BDEPS_CHECK_MODULE(BOOT_JDK, boot-jdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no])
fi 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 "x$JAVA_HOME" != x; then
if test ! -d "$JAVA_HOME"; then if test "x$OPENJDK_TARGET_OS" = xwindows; then
AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!]) # On Windows, JAVA_HOME is likely in DOS-style
BOOTJDK_MISSING_ERROR JAVA_HOME_PROCESSED="`$CYGPATH -u "$JAVA_HOME"`"
else
JAVA_HOME_PROCESSED="$JAVA_HOME"
fi fi
# Aha, the user has set a JAVA_HOME if test ! -d "$JAVA_HOME_PROCESSED"; then
# let us use that as the Boot JDK. AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
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
else 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]) # Aha, the user has set a JAVA_HOME
BOOTJDK_MISSING_ERROR # let us use that as the Boot JDK.
fi BOOT_JDK="$JAVA_HOME_PROCESSED"
BOOT_JDK_FOUND=maybe
AC_MSG_NOTICE([Found potential Boot JDK using JAVA_HOME])
fi
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(JAVAC_CHECK, javac)
AC_PATH_PROG(JAVA_CHECK, java) AC_PATH_PROG(JAVA_CHECK, java)
BINARY="$JAVAC_CHECK" BINARY="$JAVAC_CHECK"
...@@ -94,161 +125,164 @@ if test "x$BOOT_JDK_FOUND" = xno; then ...@@ -94,161 +125,164 @@ if test "x$BOOT_JDK_FOUND" = xno; then
# Lets find the JDK/JRE directory by following symbolic links. # Lets find the JDK/JRE directory by following symbolic links.
# Linux/GNU systems often have links from /usr/bin/java to # Linux/GNU systems often have links from /usr/bin/java to
# /etc/alternatives/java to the real JDK binary. # /etc/alternatives/java to the real JDK binary.
WHICHCMD_SPACESAFE(BINARY,[path to javac]) SET_FULL_PATH_SPACESAFE(BINARY)
REMOVE_SYMBOLIC_LINKS(BINARY) REMOVE_SYMBOLIC_LINKS(BINARY)
BOOT_JDK=`dirname $BINARY` BOOT_JDK=`dirname "$BINARY"`
BOOT_JDK=`cd $BOOT_JDK/..; pwd` BOOT_JDK=`cd "$BOOT_JDK/.."; pwd`
if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
JAVAC=$BOOT_JDK/bin/javac # Looks like we found ourselves an JDK
JAVA=$BOOT_JDK/bin/java BOOT_JDK_FOUND=maybe
BOOT_JDK_FOUND=yes AC_MSG_NOTICE([Found potential Boot JDK using java(c) in PATH])
fi fi
fi fi
fi ])
if test "x$BOOT_JDK_FOUND" = xno; then # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
# Try the MacOSX way. AC_DEFUN([BOOTJDK_CHECK_LIBEXEC_JAVA_HOME],
[
if test -x /usr/libexec/java_home; then if test -x /usr/libexec/java_home; then
BOOT_JDK=`/usr/libexec/java_home` BOOT_JDK=`/usr/libexec/java_home`
if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then BOOT_JDK_FOUND=maybe
JAVAC=$BOOT_JDK/bin/javac AC_MSG_NOTICE([Found potential Boot JDK using /usr/libexec/java_home])
JAVA=$BOOT_JDK/bin/java
BOOT_JDK_FOUND=yes
fi
fi fi
fi ])
if test "x$BOOT_JDK_FOUND" = xno; then # Look for a jdk in the given path. If there are multiple, try to select the newest.
AC_PATH_PROG(JAVA_CHECK, java) # If found, set BOOT_JDK and BOOT_JDK_FOUND.
if test "x$JAVA_CHECK" != x; then # $1 = Path to directory containing jdk installations.
# There is a java in the path. But apparently we have not found a javac # $2 = String to append to the found JDK directory to get the proper JDK home
# in the path, since that would have been tested earlier. AC_DEFUN([BOOTJDK_FIND_BEST_JDK_IN_DIRECTORY],
if test "x$OPENJDK_TARGET_OS" = xwindows; then [
# Now if this is a windows platform. The default installation of a JDK BOOT_JDK_PREFIX="$1"
# actually puts the JRE in the path and keeps the JDK out of the path! BOOT_JDK_SUFFIX="$2"
# Go look in the default installation location. BEST_JDK_FOUND=`$LS "$BOOT_JDK_PREFIX" 2> /dev/null | $GREP jdk | $SORT -r | $HEAD -n 1 `
BOOT_JDK=/cygdrive/c/Program\ Files/Java/`ls /cygdrive/c/Program\ Files/Java | grep jdk | sort -r | head --lines 1` if test "x$BEST_JDK_FOUND" != x; then
if test -d "$BOOT_JDK"; then BOOT_JDK="${BOOT_JDK_PREFIX}/${BEST_JDK_FOUND}${BOOT_JDK_SUFFIX}"
BOOT_JDK_FOUND=yes if test -d "$BOOT_JDK"; then
fi BOOT_JDK_FOUND=maybe
fi AC_MSG_NOTICE([Found potential Boot JDK using well-known locations (in $BOOT_JDK_PREFIX)])
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
fi 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 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. # Test: Is $JAVA_HOME set?
BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar" BOOTJDK_DO_CHECK([BOOTJDK_CHECK_JAVA_HOME])
SPACESAFE(BOOT_RTJAR,[the path to the Boot JDK rt.jar (or nearest equivalent)])
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar" # Test: Is there a /usr/libexec/java_home? (Typically on MacOSX)
SPACESAFE(BOOT_TOOLSJAR,[the path to the Boot JDK tools.jar (or nearest equivalent)]) 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 # On MacOSX it is called classes.jar
BOOT_RTJAR=$BOOT_JDK/../Classes/classes.jar BOOT_RTJAR="$BOOT_JDK/../Classes/classes.jar"
if test ! -f $BOOT_RTJAR; then if test -f "$BOOT_RTJAR"; then
AC_MSG_NOTICE([Cannot find the rt.jar or its equivalent!]) # Remove the ..
AC_MSG_NOTICE([This typically means that configure failed to automatically find a suitable Boot JDK]) BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
BOOTJDK_MISSING_ERROR
fi fi
# Remove the ..
BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
# The tools.jar is part of classes.jar
BOOT_TOOLSJAR="$BOOT_RTJAR"
fi fi
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
AC_SUBST(BOOT_JDK) BOOT_JDK="$BOOT_JDK"
AC_SUBST(BOOT_RTJAR) AC_SUBST(BOOT_RTJAR)
AC_SUBST(BOOT_TOOLSJAR) AC_SUBST(BOOT_TOOLSJAR)
AC_MSG_CHECKING([for Boot JDK]) AC_SUBST(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])
# Use the java tool from the Boot JDK. # Setup tools from the Boot JDK.
AC_MSG_CHECKING([for java in Boot JDK]) BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA,java)
JAVA=$BOOT_JDK/bin/java BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC,javac)
if test ! -x $JAVA; then BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH,javah)
AC_MSG_NOTICE([Could not find a working java]) BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAP,javap)
BOOTJDK_MISSING_ERROR BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR,jar)
fi BOOTJDK_CHECK_TOOL_IN_BOOTJDK(RMIC,rmic)
BOOT_JDK_VERSION=`$JAVA -version 2>&1 | head -n 1` BOOTJDK_CHECK_TOOL_IN_BOOTJDK(NATIVE2ASCII,native2ascii)
AC_MSG_RESULT([yes $BOOT_JDK_VERSION])
AC_SUBST(JAVA)
# Extra M4 quote needed to protect [] in grep expression. # Finally, set some other options...
[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
# When compiling code to be executed by the Boot JDK, force jdk7 compatibility. # When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
BOOT_JDK_SOURCETARGET="-source 7 -target 7" BOOT_JDK_SOURCETARGET="-source 7 -target 7"
AC_SUBST(BOOT_JDK_SOURCETARGET) 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) 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], AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
......
#
# 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.
#
# Support for building boot cycle builds
# First include the real base spec.gmk file
include @SPEC@
# 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
# Override specific values to do a boot cycle build
# 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 @@ ...@@ -22,17 +22,39 @@
# questions. # questions.
# #
# This is a wrapper for the config.guess from autoconf. The latter does not properly # This is a wrapper for the config.guess from autoconf. The latter does not
# detect amd64 systems, since that require isainfo instead of uname. Instead of patching # properly detect 64 bit systems on all platforms. Instead of patching the
# the autoconf system (which might easily get lost in a future update), we wrap it and # autoconf system (which might easily get lost in a future update), we wrap it
# fix the broken property, if needed. # and fix the broken property, if needed.
DIR=`dirname $0` DIR=`dirname $0`
OUT=`. $DIR/autoconf-config.guess` OUT=`. $DIR/autoconf-config.guess`
# Test and fix solaris on x86_64
echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null echo $OUT | grep i386-pc-solaris > /dev/null 2> /dev/null
if test $? = 0; then 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` REAL_CPU=`isainfo -n`
OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'` OUT=$REAL_CPU`echo $OUT | sed -e 's/[^-]*//'`
fi 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 echo $OUT
...@@ -30,27 +30,19 @@ AC_DEFUN([BPERF_CHECK_CORES], ...@@ -30,27 +30,19 @@ AC_DEFUN([BPERF_CHECK_CORES],
FOUND_CORES=no FOUND_CORES=no
if test -f /proc/cpuinfo; then 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` NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
FOUND_CORES=yes FOUND_CORES=yes
fi elif test -x /usr/sbin/psrinfo; then
if test -x /usr/sbin/psrinfo; then
# Looks like a Solaris system # Looks like a Solaris system
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line` NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
FOUND_CORES=yes FOUND_CORES=yes
fi elif test -x /usr/sbin/system_profiler; then
if test -x /usr/sbin/system_profiler; then
# Looks like a MacOSX system # Looks like a MacOSX system
NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'` NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
FOUND_CORES=yes FOUND_CORES=yes
fi fi
if test "x$build_os" = xwindows; then
NUM_CORES=4
fi
# For c/c++ code we run twice as many concurrent build # For c/c++ code we run twice as many concurrent build
# jobs than we have cores, otherwise we will stall on io. # jobs than we have cores, otherwise we will stall on io.
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2` CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
...@@ -66,31 +58,26 @@ AC_DEFUN([BPERF_CHECK_CORES], ...@@ -66,31 +58,26 @@ AC_DEFUN([BPERF_CHECK_CORES],
AC_DEFUN([BPERF_CHECK_MEMORY_SIZE], AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
[ [
AC_MSG_CHECKING([for memory size]) AC_MSG_CHECKING([for memory size])
# Default to 1024MB # Default to 1024 MB
MEMORY_SIZE=1024 MEMORY_SIZE=1024
FOUND_MEM=no FOUND_MEM=no
if test -f /proc/cpuinfo; then if test -f /proc/meminfo; then
# Looks like a Linux system # Looks like a Linux (or cygwin) system
MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'` MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024` MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
FOUND_MEM=yes FOUND_MEM=yes
fi elif test -x /usr/sbin/prtconf; then
if test -x /usr/sbin/prtconf; then
# Looks like a Solaris system # Looks like a Solaris system
MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'` MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'`
FOUND_MEM=yes FOUND_MEM=yes
fi elif test -x /usr/sbin/system_profiler; then
if test -x /usr/sbin/system_profiler; then
# Looks like a MacOSX system # Looks like a MacOSX system
MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'` MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024` MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
FOUND_MEM=yes FOUND_MEM=yes
fi elif test "x$build_os" = xwindows; then
# Windows, but without cygwin
if test "x$build_os" = xwindows; then
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'` MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
FOUND_MEM=yes FOUND_MEM=yes
fi fi
...@@ -98,7 +85,7 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE], ...@@ -98,7 +85,7 @@ AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
if test "x$FOUND_MEM" = xyes; then if test "x$FOUND_MEM" = xyes; then
AC_MSG_RESULT([$MEMORY_SIZE MB]) AC_MSG_RESULT([$MEMORY_SIZE MB])
else 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 fi
]) ])
...@@ -240,46 +227,30 @@ AC_SUBST(USE_PRECOMPILED_HEADER) ...@@ -240,46 +227,30 @@ AC_SUBST(USE_PRECOMPILED_HEADER)
AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC], AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
[ [
AC_ARG_WITH(server-java, [AS_HELP_STRING([--with-server-java], AC_ARG_WITH(sjavac-server-java, [AS_HELP_STRING([--with-sjavac-server-java],
[use this java binary for running the javac background server and other long running java tasks in the build process, [use this java binary for running the sjavac background server and other long running java tasks in the build process,
e.g. ---with-server-java="/opt/jrockit/bin/java -server"])]) e.g. ---with-sjavac-server-java="/opt/jrockit/bin/java -server"])])
if test "x$with_server_java" != x; then if test "x$with_sjavac_server_java" != x; then
SERVER_JAVA="$with_server_java" SJAVAC_SERVER_JAVA="$with_sjavac_server_java"
FOUND_VERSION=`$SERVER_JAVA -version 2>&1 | grep " version \""` FOUND_VERSION=`$SJAVAC_SERVER_JAVA -version 2>&1 | grep " version \""`
if test "x$FOUND_VERSION" = x; then 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 fi
else else
SERVER_JAVA="" SJAVAC_SERVER_JAVA=""
# Hotspot specific options. # Hotspot specific options.
ADD_JVM_ARG_IF_OK([-XX:+UseParallelOldGC],SERVER_JAVA,[$JAVA]) ADD_JVM_ARG_IF_OK([-verbosegc],SJAVAC_SERVER_JAVA,[$JAVA])
ADD_JVM_ARG_IF_OK([-verbosegc],SERVER_JAVA,[$JAVA])
# JRockit specific options. # JRockit specific options.
ADD_JVM_ARG_IF_OK([-Xverbose:gc],SERVER_JAVA,[$JAVA]) ADD_JVM_ARG_IF_OK([-Xverbose:gc],SJAVAC_SERVER_JAVA,[$JAVA])
SERVER_JAVA="$JAVA $SERVER_JAVA" SJAVAC_SERVER_JAVA="$JAVA $SJAVAC_SERVER_JAVA"
fi fi
AC_SUBST(SERVER_JAVA) AC_SUBST(SJAVAC_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_ARG_WITH(javac-server-cores, [AS_HELP_STRING([--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 javac server @<:@probed@:>@])]) [use at most this number of concurrent threads on the sjavac server @<:@probed@:>@])])
if test "x$with_javac_server_cores" != x; then if test "x$with_sjavac_server_cores" != x; then
JAVAC_SERVER_CORES="$with_javac_server_cores" SJAVAC_SERVER_CORES="$with_sjavac_server_cores"
else else
if test "$NUM_CORES" -gt 16; then if test "$NUM_CORES" -gt 16; then
# We set this arbitrary limit because we want to limit the heap # We set this arbitrary limit because we want to limit the heap
...@@ -287,86 +258,49 @@ else ...@@ -287,86 +258,49 @@ else
# In the future we will make the javac compilers in the server # In the future we will make the javac compilers in the server
# share more and more state, thus enabling us to use more and # share more and more state, thus enabling us to use more and
# more concurrent threads in the server. # more concurrent threads in the server.
JAVAC_SERVER_CORES="16" SJAVAC_SERVER_CORES="16"
else else
JAVAC_SERVER_CORES="$NUM_CORES" SJAVAC_SERVER_CORES="$NUM_CORES"
fi fi
if test "$MEMORY_SIZE" -gt "17000"; then if test "$MEMORY_SIZE" -gt "17000"; then
MAX_HEAP_MEM=10000 MAX_HEAP_MEM=10000
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn2G],SERVER_JAVA,[$SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "10000"; then elif test "$MEMORY_SIZE" -gt "10000"; then
MAX_HEAP_MEM=6000 MAX_HEAP_MEM=6000
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn1G],SERVER_JAVA,[$SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "5000"; then elif test "$MEMORY_SIZE" -gt "5000"; then
MAX_HEAP_MEM=3000 MAX_HEAP_MEM=3000
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-d64],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "3800"; then elif test "$MEMORY_SIZE" -gt "3800"; then
MAX_HEAP_MEM=2500 MAX_HEAP_MEM=2500
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "1900"; then elif test "$MEMORY_SIZE" -gt "1900"; then
MAX_HEAP_MEM=1200 MAX_HEAP_MEM=1200
ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1200M],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1400M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
elif test "$MEMORY_SIZE" -gt "1000"; then elif test "$MEMORY_SIZE" -gt "1000"; then
MAX_HEAP_MEM=900 MAX_HEAP_MEM=900
ADD_JVM_ARG_IF_OK([-Xms400M -Xmx900M],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms400M -Xmx1100M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
else else
MAX_HEAP_MEM=512 MAX_HEAP_MEM=512
ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SERVER_JAVA,[$SERVER_JAVA]) ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SJAVAC_SERVER_JAVA,[$SJAVAC_SERVER_JAVA])
ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
fi 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` 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]) AC_MSG_CHECKING([if number of server cores must be reduced])
JAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP" SJAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP"
AC_MSG_RESULT([yes, to $JAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB]) AC_MSG_RESULT([yes, to $SJAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB])
fi fi
fi fi
AC_SUBST(JAVAC_SERVER_CORES) AC_SUBST(SJAVAC_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_MSG_CHECKING([whether to use sjavac]) AC_MSG_CHECKING([whether to use sjavac])
AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac], AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
...@@ -375,4 +309,11 @@ 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_MSG_RESULT([$ENABLE_SJAVAC])
AC_SUBST(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 @@ ...@@ -31,7 +31,7 @@
# Translate a configuration triplet/quadruplet into something # Translate a configuration triplet/quadruplet into something
# known by this configuration file. # 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_i686_pc_linux_gnu=i686-unknown-linux-gnu
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10 REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
......
...@@ -52,19 +52,19 @@ AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS], ...@@ -52,19 +52,19 @@ AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS],
fi fi
# Create build and target names that use _ instead of "-" and ".". # Create build and target names that use _ instead of "-" and ".".
# This is necessary to use them in variable names. # This is necessary to use them in variable names.
build_var=`echo ${OPENJDK_BUILD_SYSTEM} | tr '-' '_' | tr '.' '_'` build_var=`echo ${OPENJDK_BUILD_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'`
target_var=`echo ${OPENJDK_TARGET_SYSTEM} | tr '-' '_' | tr '.' '_'` target_var=`echo ${OPENJDK_TARGET_AUTOCONF_NAME} | tr '-' '_' | tr '.' '_'`
# Extract rewrite information for build and target # Extract rewrite information for build and target
eval rewritten_build=\${REWRITE_${build_var}} eval rewritten_build=\${REWRITE_${build_var}}
if test "x$rewritten_build" = x; then 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 echo Build stays the same $rewritten_build
else else
echo Rewriting build for builddeps into $rewritten_build echo Rewriting build for builddeps into $rewritten_build
fi fi
eval rewritten_target=\${REWRITE_${target_var}} eval rewritten_target=\${REWRITE_${target_var}}
if test "x$rewritten_target" = x; then 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 echo Target stays the same $rewritten_target
else else
echo Rewriting target for builddeps into $rewritten_target echo Rewriting target for builddeps into $rewritten_target
......
#!/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.
#
# This script is processed by configure before it's usable. It is run from
# the root of the build directory.
##########################################################################################
# Substitutions from autoconf
LEGACY_BUILD_DIR=@OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU_LEGACY@
OPENJDK_TARGET_OS="@OPENJDK_TARGET_OS@"
OPENJDK_TARGET_CPU="@OPENJDK_TARGET_CPU@"
AWK="@AWK@"
CAT="@CAT@"
CMP="@CMP@"
CP="@CP@"
CUT="@CUT@"
DIFF="@DIFF@"
DUMPBIN="@UNCYGDRIVE@ @DUMPBIN@"
EXPR="@EXPR@"
FILE="@FILE@"
FIND="@FIND@"
GREP="@GREP@"
JAVAP="@UNCYGDRIVE@ @BOOT_JDK@/bin/javap"
LDD="@LDD@"
MKDIR="@MKDIR@"
NM="@NM@"
OBJDUMP="@OBJDUMP@"
OTOOL="@OTOOL@"
PRINTF="@PRINTF@"
READELF="@READELF@"
RM="@RM@"
SED="@SED@"
SORT="@SORT@"
STRIP="@POST_STRIP_CMD@"
TEE="@TEE@"
UNIQ="@UNIQ@"
UNZIP="@UNZIP@"
SRC_ROOT="@SRC_ROOT@"
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
READELF_CMD="otool -v -V -h -X -t -d"
elif [ -n "$READELF" ] && [ "$OPENJDK_TARGET_OS" != "windows" ]; then
READELF_CMD="$READELF -a"
fi
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
LDD_CMD="$OTOOL -L"
elif [ -n "$LDD" ]; then
LDD_CMD="$LDD"
fi
##########################################################################################
# Diff exceptions
if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
STRIP_BEFORE_COMPARE="
./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
./demo/jvmti/gctest/lib/libgctest.so
./demo/jvmti/heapTracker/lib/libheapTracker.so
./demo/jvmti/heapViewer/lib/libheapViewer.so
./demo/jvmti/hprof/lib/libhprof.so
./demo/jvmti/minst/lib/libminst.so
./demo/jvmti/mtrace/lib/libmtrace.so
./demo/jvmti/versionCheck/lib/libversionCheck.so
./demo/jvmti/waiters/lib/libwaiters.so
"
KNOWN_BIN_DIFF="
"
ACCEPTED_BIN_DIFF="
./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
./demo/jvmti/gctest/lib/libgctest.so
./demo/jvmti/heapTracker/lib/libheapTracker.so
./demo/jvmti/heapViewer/lib/libheapViewer.so
./demo/jvmti/hprof/lib/libhprof.so
./demo/jvmti/minst/lib/libminst.so
./demo/jvmti/mtrace/lib/libmtrace.so
./demo/jvmti/versionCheck/lib/libversionCheck.so
./demo/jvmti/waiters/lib/libwaiters.so
./jre/lib/amd64/libattach.so
./jre/lib/amd64/libdt_socket.so
./jre/lib/amd64/libhprof.so
./jre/lib/amd64/libinstrument.so
./jre/lib/amd64/libjava_crw_demo.so
./jre/lib/amd64/libjsdt.so
./jre/lib/amd64/libjsig.so
./jre/lib/amd64/libmanagement.so
./jre/lib/amd64/libnpt.so
./jre/lib/amd64/libsaproc.so
./jre/lib/amd64/libverify.so
./jre/lib/amd64/server/libjsig.so
./jre/lib/amd64/server/libjvm.so
./bin/appletviewer
./bin/extcheck
./bin/idlj
./bin/jar
./bin/jarsigner
./bin/java
./bin/javac
./bin/javadoc
./bin/javah
./bin/javap
./bin/jcmd
./bin/jconsole
./bin/jdb
./bin/jhat
./bin/jinfo
./bin/jmap
./bin/jps
./bin/jrunscript
./bin/jsadebugd
./bin/jstack
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry
./bin/schemagen
./bin/serialver
./bin/servertool
./bin/tnameserv
./bin/wsgen
./bin/wsimport
./bin/xjc
./jre/bin/java
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
./jre/bin/policytool
./jre/bin/rmid
./jre/bin/rmiregistry
./jre/bin/servertool
./jre/bin/tnameserv
"
KNOWN_SIZE_DIFF="
"
KNOWN_SYM_DIFF="
"
KNOWN_ELF_DIFF="
./demo/jvmti/heapTracker/lib/libheapTracker.so
./demo/jvmti/hprof/lib/libhprof.so
./demo/jvmti/waiters/lib/libwaiters.so
"
fi
if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86" ]; then
STRIP_BEFORE_COMPARE="
./demo/jni/Poller/lib/libPoller.so
./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
./demo/jvmti/gctest/lib/libgctest.so
./demo/jvmti/heapTracker/lib/libheapTracker.so
./demo/jvmti/heapViewer/lib/libheapViewer.so
./demo/jvmti/hprof/lib/libhprof.so
./demo/jvmti/minst/lib/libminst.so
./demo/jvmti/mtrace/lib/libmtrace.so
./demo/jvmti/versionCheck/lib/libversionCheck.so
./demo/jvmti/waiters/lib/libwaiters.so
./jre/lib/i386/jexec
"
SORT_SYMBOLS="
./jre/lib/i386/client/libjvm.so
./jre/lib/i386/server/libjvm.so
"
SKIP_BIN_DIFF="true"
ACCEPTED_SMALL_SIZE_DIFF="
./demo/jni/Poller/lib/libPoller.so
./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so
./demo/jvmti/gctest/lib/libgctest.so
./demo/jvmti/heapTracker/lib/libheapTracker.so
./demo/jvmti/heapViewer/lib/libheapViewer.so
./demo/jvmti/hprof/lib/libhprof.so
./demo/jvmti/minst/lib/libminst.so
./demo/jvmti/mtrace/lib/libmtrace.so
./demo/jvmti/versionCheck/lib/libversionCheck.so
./demo/jvmti/waiters/lib/libwaiters.so
./jre/lib/i386/client/libjvm.so
./jre/lib/i386/jli/libjli.so
./jre/lib/i386/libJdbcOdbc.so
./jre/lib/i386/libattach.so
./jre/lib/i386/libawt.so
./jre/lib/i386/libawt_headless.so
./jre/lib/i386/libawt_xawt.so
./jre/lib/i386/libdcpr.so
./jre/lib/i386/libdt_socket.so
./jre/lib/i386/libfontmanager.so
./jre/lib/i386/libhprof.so
./jre/lib/i386/libinstrument.so
./jre/lib/i386/libj2gss.so
./jre/lib/i386/libj2pcsc.so
./jre/lib/i386/libj2pkcs11.so
./jre/lib/i386/libj2ucrypto.so
./jre/lib/i386/libjaas_unix.so
./jre/lib/i386/libjava.so
./jre/lib/i386/libjava_crw_demo.so
./jre/lib/i386/libjawt.so
./jre/lib/i386/libjdwp.so
./jre/lib/i386/libjfr.so
./jre/lib/i386/libjpeg.so
./jre/lib/i386/libjsdt.so
./jre/lib/i386/libjsound.so
./jre/lib/i386/libkcms.so
./jre/lib/i386/libmanagement.so
./jre/lib/i386/libmlib_image.so
./jre/lib/i386/libnet.so
./jre/lib/i386/libnio.so
./jre/lib/i386/libnpt.so
./jre/lib/i386/libsctp.so
./jre/lib/i386/libsplashscreen.so
./jre/lib/i386/libsunec.so
./jre/lib/i386/libsunwjdga.so
./jre/lib/i386/libt2k.so
./jre/lib/i386/libunpack.so
./jre/lib/i386/libverify.so
./jre/lib/i386/libzip.so
./jre/lib/i386/server/libjvm.so
./bin/appletviewer
./bin/extcheck
./bin/idlj
./bin/jar
./bin/jarsigner
./bin/java
./bin/javac
./bin/javadoc
./bin/javah
./bin/javap
./bin/jcmd
./bin/jconsole
./bin/jdb
./bin/jhat
./bin/jinfo
./bin/jmap
./bin/jps
./bin/jrunscript
./bin/jsadebugd
./bin/jstack
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry
./bin/schemagen
./bin/serialver
./bin/servertool
./bin/tnameserv
./bin/unpack200
./bin/wsgen
./bin/wsimport
./bin/xjc
./jre/bin/java
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
./jre/bin/policytool
./jre/bin/rmid
./jre/bin/rmiregistry
./jre/bin/servertool
./jre/bin/tnameserv
./jre/bin/unpack200
./jre/lib/i386/jexec
"
SKIP_ELF_DIFF="true"
# libjvm.so differs in the random 15 char prefix on some symbols.
ACCEPTED_DIS_DIFF="
./jre/lib/i386/client/libjvm.so
./jre/lib/i386/server/libjvm.so
"
fi
if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
STRIP_BEFORE_COMPARE="
./demo/jni/Poller/lib/amd64/libPoller.so
./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so
./demo/jvmti/gctest/lib/amd64/libgctest.so
./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so
./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so
./demo/jvmti/hprof/lib/amd64/libhprof.so
./demo/jvmti/minst/lib/amd64/libminst.so
./demo/jvmti/mtrace/lib/amd64/libmtrace.so
./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so
./demo/jvmti/waiters/lib/amd64/libwaiters.so
"
SORT_SYMBOLS="
./jre/lib/amd64/server/libjvm.so
"
SKIP_BIN_DIFF="true"
ACCEPTED_SMALL_SIZE_DIFF="
./demo/jni/Poller/lib/amd64/libPoller.so
./demo/jvmti/compiledMethodLoad/lib/amd64/libcompiledMethodLoad.so
./demo/jvmti/gctest/lib/amd64/libgctest.so
./demo/jvmti/heapTracker/lib/amd64/libheapTracker.so
./demo/jvmti/heapViewer/lib/amd64/libheapViewer.so
./demo/jvmti/hprof/lib/amd64/libhprof.so
./demo/jvmti/minst/lib/amd64/libminst.so
./demo/jvmti/mtrace/lib/amd64/libmtrace.so
./demo/jvmti/versionCheck/lib/amd64/libversionCheck.so
./demo/jvmti/waiters/lib/amd64/libwaiters.so
./jre/lib/amd64/jli/libjli.so
./jre/lib/amd64/libJdbcOdbc.so
./jre/lib/amd64/libattach.so
./jre/lib/amd64/libawt.so
./jre/lib/amd64/libawt_headless.so
./jre/lib/amd64/libawt_xawt.so
./jre/lib/amd64/libdcpr.so
./jre/lib/amd64/libdt_socket.so
./jre/lib/amd64/libfontmanager.so
./jre/lib/amd64/libhprof.so
./jre/lib/amd64/libinstrument.so
./jre/lib/amd64/libj2gss.so
./jre/lib/amd64/libj2pcsc.so
./jre/lib/amd64/libj2pkcs11.so
./jre/lib/amd64/libj2ucrypto.so
./jre/lib/amd64/libjaas_unix.so
./jre/lib/amd64/libjava.so
./jre/lib/amd64/libjava_crw_demo.so
./jre/lib/amd64/libjawt.so
./jre/lib/amd64/libjdwp.so
./jre/lib/amd64/libjfr.so
./jre/lib/amd64/libjpeg.so
./jre/lib/amd64/libjsdt.so
./jre/lib/amd64/libjsound.so
./jre/lib/amd64/libkcms.so
./jre/lib/amd64/libmanagement.so
./jre/lib/amd64/libmlib_image.so
./jre/lib/amd64/libnet.so
./jre/lib/amd64/libnio.so
./jre/lib/amd64/libnpt.so
./jre/lib/amd64/libsctp.so
./jre/lib/amd64/libsplashscreen.so
./jre/lib/amd64/libsunec.so
./jre/lib/amd64/libsunwjdga.so
./jre/lib/amd64/libt2k.so
./jre/lib/amd64/libunpack.so
./jre/lib/amd64/libverify.so
./jre/lib/amd64/libzip.so
./jre/lib/amd64/server/64/libjvm_db.so
./jre/lib/amd64/server/64/libjvm_dtrace.so
./bin/amd64/appletviewer
./bin/amd64/extcheck
./bin/amd64/idlj
./bin/amd64/jar
./bin/amd64/jarsigner
./bin/amd64/java
./bin/amd64/javac
./bin/amd64/javadoc
./bin/amd64/javah
./bin/amd64/javap
./bin/amd64/jcmd
./bin/amd64/jconsole
./bin/amd64/jdb
./bin/amd64/jhat
./bin/amd64/jinfo
./bin/amd64/jmap
./bin/amd64/jps
./bin/amd64/jrunscript
./bin/amd64/jsadebugd
./bin/amd64/jstack
./bin/amd64/jstat
./bin/amd64/jstatd
./bin/amd64/keytool
./bin/amd64/native2ascii
./bin/amd64/orbd
./bin/amd64/pack200
./bin/amd64/policytool
./bin/amd64/rmic
./bin/amd64/rmid
./bin/amd64/rmiregistry
./bin/amd64/schemagen
./bin/amd64/serialver
./bin/amd64/servertool
./bin/amd64/tnameserv
./bin/amd64/unpack200
./bin/amd64/wsgen
./bin/amd64/wsimport
./bin/amd64/xjc
./jre/bin/amd64/java
./jre/bin/amd64/keytool
./jre/bin/amd64/orbd
./jre/bin/amd64/pack200
./jre/bin/amd64/policytool
./jre/bin/amd64/rmid
./jre/bin/amd64/rmiregistry
./jre/bin/amd64/servertool
./jre/bin/amd64/tnameserv
./jre/bin/amd64/unpack200
./jre/lib/amd64/jexec
"
SKIP_ELF_DIFF="true"
# Can't find an explaination for the diff in libmlib_image.so.
KNOWN_DIS_DIFF="
./jre/lib/amd64/libmlib_image.so
"
# libjvm.so differs in the random 15 char prefix on some symbols.
ACCEPTED_DIS_DIFF="
./jre/lib/amd64/server/libjvm.so
"
fi
if [ "$OPENJDK_TARGET_OS" = "windows" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
ACCEPTED_BIN_DIFF="
./bin/jli.dll
./demo/jvmti/compiledMethodLoad/lib/compiledMethodLoad.dll
./demo/jvmti/gctest/lib/gctest.dll
./demo/jvmti/heapTracker/lib/heapTracker.dll
./demo/jvmti/heapViewer/lib/heapViewer.dll
./demo/jvmti/hprof/lib/hprof.dll
./demo/jvmti/minst/lib/minst.dll
./demo/jvmti/mtrace/lib/mtrace.dll
./demo/jvmti/versionCheck/lib/versionCheck.dll
./demo/jvmti/waiters/lib/waiters.dll
./jre/bin/attach.dll
./jre/bin/awt.dll
./jre/bin/dcpr.dll
./jre/bin/dt_shmem.dll
./jre/bin/dt_socket.dll
./jre/bin/fontmanager.dll
./jre/bin/hprof.dll
./jre/bin/instrument.dll
./jre/bin/j2pcsc.dll
./jre/bin/j2pkcs11.dll
./jre/bin/jaas_nt.dll
./jre/bin/java.dll
./jre/bin/java_crw_demo.dll
./jre/bin/jawt.dll
./jre/bin/JdbcOdbc.dll
./jre/bin/jdwp.dll
./jre/bin/jfr.dll
./jre/bin/jli.dll
./jre/bin/jpeg.dll
./jre/bin/jsdt.dll
./jre/bin/jsound.dll
./jre/bin/jsoundds.dll
./jre/bin/kcms.dll
./jre/bin/management.dll
./jre/bin/mlib_image.dll
./jre/bin/net.dll
./jre/bin/nio.dll
./jre/bin/npt.dll
./jre/bin/sawindbg.dll
./jre/bin/server/jvm.dll
./jre/bin/splashscreen.dll
./jre/bin/sunec.dll
./jre/bin/sunmscapi.dll
./jre/bin/t2k.dll
./jre/bin/unpack.dll
./jre/bin/verify.dll
./jre/bin/w2k_lsa_auth.dll
./jre/bin/zip.dll
./bin/appletviewer.exe
./bin/extcheck.exe
./bin/idlj.exe
./bin/jar.exe
./bin/jarsigner.exe
./bin/java.exe
./bin/javac.exe
./bin/javadoc.exe
./bin/javah.exe
./bin/javap.exe
./bin/java-rmi.exe
./bin/javaw.exe
./bin/jcmd.exe
./bin/jconsole.exe
./bin/jdb.exe
./bin/jhat.exe
./bin/jinfo.exe
./bin/jmap.exe
./bin/jps.exe
./bin/jrunscript.exe
./bin/jsadebugd.exe
./bin/jstack.exe
./bin/jstat.exe
./bin/jstatd.exe
./bin/keytool.exe
./bin/kinit.exe
./bin/klist.exe
./bin/ktab.exe
./bin/native2ascii.exe
./bin/orbd.exe
./bin/pack200.exe
./bin/policytool.exe
./bin/rmic.exe
./bin/rmid.exe
./bin/rmiregistry.exe
./bin/schemagen.exe
./bin/serialver.exe
./bin/servertool.exe
./bin/tnameserv.exe
./bin/unpack200.exe
./bin/wsgen.exe
./bin/wsimport.exe
./bin/xjc.exe
./jre/bin/java.exe
./jre/bin/java-rmi.exe
./jre/bin/javaw.exe
./jre/bin/keytool.exe
./jre/bin/kinit.exe
./jre/bin/klist.exe
./jre/bin/ktab.exe
./jre/bin/orbd.exe
./jre/bin/pack200.exe
./jre/bin/policytool.exe
./jre/bin/rmid.exe
./jre/bin/rmiregistry.exe
./jre/bin/servertool.exe
./jre/bin/tnameserv.exe
./jre/bin/unpack200.exe
"
KNOWN_SIZE_DIFF="
./demo/jvmti/heapTracker/lib/heapTracker.dll
./demo/jvmti/minst/lib/minst.dll
./jre/bin/awt.dll
./jre/bin/java_crw_demo.dll
./bin/java.exe
./bin/javaw.exe
./bin/unpack200.exe
./jre/bin/java.exe
./jre/bin/javaw.exe
./jre/bin/unpack200.exe
"
KNOWN_SYM_DIFF="
./jre/bin/awt.dll
./jre/bin/java_crw_demo.dll
"
fi
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
ACCEPTED_JARZIP_CONTENTS="
/META-INF/INDEX.LIST
"
KNOWN_BIN_DIFF="
./jre/lib/libJObjC.dylib
./jre/lib/libsaproc.dylib
./jre/lib/server/libjvm.dylib
"
ACCEPTED_BIN_DIFF="
./bin/appletviewer
./bin/extcheck
./bin/idlj
./bin/jar
./bin/jarsigner
./bin/java
./bin/javac
./bin/javadoc
./bin/javah
./bin/javap
./bin/jcmd
./bin/jconsole
./bin/jdb
./bin/jhat
./bin/jinfo
./bin/jmap
./bin/jps
./bin/jrunscript
./bin/jsadebugd
./bin/jstack
./bin/jstat
./bin/jstatd
./bin/keytool
./bin/native2ascii
./bin/orbd
./bin/pack200
./bin/policytool
./bin/rmic
./bin/rmid
./bin/rmiregistry
./bin/schemagen
./bin/serialver
./bin/servertool
./bin/tnameserv
./bin/wsgen
./bin/wsimport
./bin/xjc
./jre/bin/java
./jre/bin/keytool
./jre/bin/orbd
./jre/bin/pack200
./jre/bin/policytool
./jre/bin/rmid
./jre/bin/rmiregistry
./jre/bin/servertool
./jre/bin/tnameserv
"
KNOWN_SIZE_DIFF="
./jre/lib/libJObjC.dylib
./jre/lib/server/libjvm.dylib
"
KNOWN_SYM_DIFF="
./jre/lib/libJObjC.dylib
./jre/lib/server/libjvm.dylib
"
KNOWN_ELF_DIFF="
./jre/lib/libJObjC.dylib
./jre/lib/server/libjvm.dylib
"
SKIP_DIS_DIFF="true"
fi
##########################################################################################
# Compare text files and ignore specific differences:
#
# * Timestamps in Java sources generated by idl2java
# * Sorting order and cleanup style in .properties files
diff_text() {
OTHER_FILE=$1
THIS_FILE=$2
SUFFIX="${THIS_FILE##*.}"
TMP=1
if [[ "$THIS_FILE" = *"META-INF/MANIFEST.MF" ]]; then
TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \
$GREP '^[<>]' | \
$SED -e '/[<>] Ant-Version: Apache Ant .*/d' \
-e '/[<>] Created-By: .* (Oracle Corporation).*/d')
fi
if test "x$SUFFIX" = "xjava"; then
TMP=$(LANG=C $DIFF $OTHER_FILE $THIS_FILE | \
$GREP '^[<>]' | \
$SED -e '/[<>] \* from.*\.idl/d' \
-e '/[<>] \*.*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
-e '/[<>] \*.*[0-9]\{4\} [0-9][0-9]*:[0-9]\{2\}:[0-9]\{2\}.*/d' \
-e '/\/\/ Generated from input file.*/d' \
-e '/\/\/ This file was generated AUTOMATICALLY from a template file.*/d' \
-e '/\/\/ java GenerateCharacter.*/d')
fi
# Ignore date strings in class files.
# On Macosx the system sources for generated java classes produce different output on
# consequtive invokations seemingly randomly.
# For example a method parameter randomly named "thePoint" or "aPoint". Ignore this.
if test "x$SUFFIX" = "xclass"; then
$JAVAP -c -constants -l -p ${OTHER_FILE} > ${OTHER_FILE}.javap
$JAVAP -c -constants -l -p ${THIS_FILE} > ${THIS_FILE}.javap
TMP=$($DIFF ${OTHER_FILE}.javap ${THIS_FILE}.javap | \
$GREP '^[<>]' | \
$SED -e '/[<>].*[0-9]\{4\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}_[0-9]\{2\}-b[0-9]\{2\}.*/d' \
-e '/[<>].*Point Lcom\/apple\/jobjc\/foundation\/NSPoint;/d' \
-e '/[<>].*public com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*itemsPtr();/d' \
-e '/[<>].*public void setItemsPtr(com\.apple\.jobjc\.Pointer<com\.apple\.jobjc\..*);/d')
fi
if test "x$SUFFIX" = "xproperties"; then
$CAT $OTHER_FILE | $SED -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
| $SED -f "$SRC_ROOT/common/bin/unicode2x.sed" \
| $SED -e '/^#/d' -e '/^$/d' \
-e :a -e '/\\$/N; s/\\\n//; ta' \
-e 's/^[ \t]*//;s/[ \t]*$//' \
-e 's/\\=/=/' | LANG=C $SORT > $OTHER_FILE.cleaned
TMP=$(LANG=C $DIFF $OTHER_FILE.cleaned $THIS_FILE)
fi
if test -n "$TMP"; then
echo Files $OTHER_FILE and $THIS_FILE differ
return 1
fi
return 0
}
##########################################################################################
# Compare directory structure
compare_dirs() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
mkdir -p $WORK_DIR
(cd $OTHER_DIR && $FIND . -type d | $SORT > $WORK_DIR/other_dirs)
(cd $THIS_DIR && $FIND . -type d | $SORT > $WORK_DIR/this_dirs)
echo -n Directory structure...
if $DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs > /dev/null; then
echo Identical!
else
echo Differences found.
REGRESSIONS=true
# Differences in directories found.
ONLY_OTHER=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '<')
if [ "$ONLY_OTHER" ]; then
echo Only in $OTHER
echo $ONLY_OTHER | $SED 's|< ./|\t|g' | $SED 's/ /\n/g'
fi
# Differences in directories found.
ONLY_THIS=$($DIFF $WORK_DIR/other_dirs $WORK_DIR/this_dirs | $GREP '>')
if [ "$ONLY_THIS" ]; then
echo Only in $THIS
echo $ONLY_THIS | $SED 's|> ./|\t|g' | $SED 's/ /\n/g'
fi
fi
}
##########################################################################################
# Compare file structure
compare_files() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
mkdir -p $WORK_DIR
(cd $OTHER_DIR && $FIND . -type f | $SORT > $WORK_DIR/other_files)
(cd $THIS_DIR && $FIND . -type f | $SORT > $WORK_DIR/this_files)
echo -n File names...
if diff $WORK_DIR/other_files $WORK_DIR/this_files > /dev/null; then
echo Identical!
else
echo Differences found.
REGRESSIONS=true
# Differences in directories found.
ONLY_OTHER=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '<')
if [ "$ONLY_OTHER" ]; then
echo Only in $OTHER
echo "$ONLY_OTHER" | sed 's|< ./| |g'
fi
# Differences in directories found.
ONLY_THIS=$(diff $WORK_DIR/other_files $WORK_DIR/this_files | $GREP '>')
if [ "$ONLY_THIS" ]; then
echo Only in $THIS
echo "$ONLY_THIS" | sed 's|> ./| |g'
fi
fi
}
##########################################################################################
# Compare permissions
compare_permissions() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
mkdir -p $WORK_DIR
echo -n Permissions...
found=""
for f in `cd $OTHER_DIR && $FIND . -type f`
do
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
OP=`ls -l ${OTHER_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
TP=`ls -l ${THIS_DIR}/$f | awk '{printf("%.10s\n", $1);}'`
if [ "$OP" != "$TP" ]
then
if [ -z "$found" ]; then echo ; found="yes"; fi
$PRINTF "\told: ${OP} new: ${TP}\t$f\n"
fi
done
if [ -z "$found" ]; then
echo "Identical!"
else
REGRESSIONS=true
fi
}
##########################################################################################
# Compare file command output
compare_file_types() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
$MKDIR -p $WORK_DIR
echo -n File types...
found=""
for f in `cd $OTHER_DIR && $FIND . -type f`
do
if [ ! -f ${OTHER_DIR}/$f ]; then continue; fi
if [ ! -f ${THIS_DIR}/$f ]; then continue; fi
OF=`cd ${OTHER_DIR} && $FILE $f`
TF=`cd ${THIS_DIR} && $FILE $f`
if [ "$f" = "./src.zip" ] || [ "$f" = "./jre/lib/JObjC.jar" ] || [ "$f" = "./lib/JObjC.jar" ]
then
if [ "`echo $OF | $GREP -ic zip`" -gt 0 -a "`echo $TF | $GREP -ic zip`" -gt 0 ]
then
# the way we produces zip-files make it so that directories are stored in old file
# but not in new (only files with full-path)
# this makes file-5.09 report them as different
continue;
fi
fi
if [ "$OF" != "$TF" ]
then
if [ -z "$found" ]; then echo ; found="yes"; fi
$PRINTF "\tother: ${OF}\n\tthis : ${TF}\n"
fi
done
if [ -z "$found" ]; then
echo "Identical!"
else
REGRESSIONS=true
fi
}
##########################################################################################
# Compare the rest of the files
compare_general_files() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
GENERAL_FILES=$(cd $THIS_DIR && $FIND . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
! -name "ct.sym" ! -name "*.diz" ! -name "*.dll" \
! -name "*.pdb" ! -name "*.exp" ! -name "*.ilk" \
! -name "*.lib" \
| $GREP -v "./bin/" | $SORT | $FILTER)
echo General files...
for f in $GENERAL_FILES
do
if [ -e $OTHER_DIR/$f ]; then
DIFF_OUT=$($DIFF $OTHER_DIR/$f $THIS_DIR/$f 2>&1)
if [ -n "$DIFF_OUT" ]; then
echo $f
REGRESSIONS=true
if [ "$SHOW_DIFFS" = "true" ]; then
echo "$DIFF_OUT"
fi
fi
fi
done
}
##########################################################################################
# Compare zip file
compare_zip_file() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
ZIP_FILE=$4
THIS_ZIP=$THIS_DIR/$ZIP_FILE
OTHER_ZIP=$OTHER_DIR/$ZIP_FILE
THIS_SUFFIX="${THIS_ZIP##*.}"
OTHER_SUFFIX="${OTHER_ZIP##*.}"
if [ "$THIS_SUFFIX" != "$OTHER_SUFFIX" ]; then
echo The files do not have the same suffix type!
return 2
fi
UNARCHIVE="$UNZIP -q"
TYPE="$THIS_SUFFIX"
if $CMP $OTHER_ZIP $THIS_ZIP > /dev/null
then
return 0
fi
# Not quite identical, the might still contain the same data.
# Unpack the jar/zip files in temp dirs
THIS_UNZIPDIR=$WORK_DIR/$ZIP_FILE.this
OTHER_UNZIPDIR=$WORK_DIR/$ZIP_FILE.other
$RM -rf $THIS_UNZIPDIR $OTHER_UNZIPDIR
$MKDIR -p $THIS_UNZIPDIR
$MKDIR -p $OTHER_UNZIPDIR
(cd $THIS_UNZIPDIR && $UNARCHIVE $THIS_ZIP)
(cd $OTHER_UNZIPDIR && $UNARCHIVE $OTHER_ZIP)
CONTENTS_DIFF_FILE=$WORK_DIR/$ZIP_FILE.diff
LANG=C $DIFF -rq $OTHER_UNZIPDIR $THIS_UNZIPDIR > $CONTENTS_DIFF_FILE
ONLY_OTHER=$($GREP "^Only in $OTHER_UNZIPDIR" $CONTENTS_DIFF_FILE)
ONLY_THIS=$($GREP "^Only in $THIS_UNZIPDIR" $CONTENTS_DIFF_FILE)
return_value=0
if [ -n "$ONLY_OTHER" ]; then
echo " Only OTHER $ZIP_FILE contains:"
echo "$ONLY_OTHER" | sed "s|Only in $OTHER_UNZIPDIR| |"g | sed 's|: |/|g'
return_value=1
fi
if [ -n "$ONLY_THIS" ]; then
echo " Only THIS $ZIP_FILE contains:"
echo "$ONLY_THIS" | sed "s|Only in $THIS_UNZIPDIR| |"g | sed 's|: |/|g'
return_value=1
fi
DIFFING_FILES=$($GREP differ $CONTENTS_DIFF_FILE | $CUT -f 2 -d ' ' | $SED "s|$OTHER_UNZIPDIR/||g")
$RM -f $WORK_DIR/$ZIP_FILE.diffs
for file in $DIFFING_FILES; do
if [[ "$ACCEPTED_JARZIP_CONTENTS" != *"$file"* ]]; then
diff_text $OTHER_UNZIPDIR/$file $THIS_UNZIPDIR/$file >> $WORK_DIR/$ZIP_FILE.diffs
fi
done
if [ -s "$WORK_DIR/$ZIP_FILE.diffs" ]; then
return_value=1
echo " Differing files in $ZIP_FILE"
$CAT $WORK_DIR/$ZIP_FILE.diffs | $GREP differ | cut -f 2 -d ' ' | \
$SED "s|$OTHER_UNZIPDIR| |g" > $WORK_DIR/$ZIP_FILE.difflist
$CAT $WORK_DIR/$ZIP_FILE.difflist
if [ -n "$SHOW_DIFFS" ]; then
for i in $(cat $WORK_DIR/$ZIP_FILE.difflist) ; do
if [ -f "${OTHER_UNZIPDIR}/$i.javap" ]; then
LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.javap ${THIS_UNZIPDIR}/$i.javap
elif [ -f "${OTHER_UNZIPDIR}/$i.cleaned" ]; then
LANG=C $DIFF ${OTHER_UNZIPDIR}/$i.cleaned ${THIS_UNZIPDIR}/$i
else
LANG=C $DIFF ${OTHER_UNZIPDIR}/$i ${THIS_UNZIPDIR}/$i
fi
done
fi
fi
return $return_value
}
##########################################################################################
# Compare all zip files
compare_all_zip_files() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.zip" | $SORT | $FILTER )
if [ -n "$ZIPS" ]; then
echo Zip files...
return_value=0
for f in $ZIPS; do
if [ -f "$OTHER_DIR/$f" ]; then
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
if [ "$?" != "0" ]; then
return_value=1
REGRESSIONS=true
fi
fi
done
fi
return $return_value
}
##########################################################################################
# Compare all jar files
compare_all_jar_files() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
# TODO filter?
ZIPS=$(cd $THIS_DIR && $FIND . -type f -name "*.jar" | $SORT | $FILTER)
if [ -n "$ZIPS" ]; then
echo Jar files...
return_value=0
for f in $ZIPS; do
if [ -f "$OTHER_DIR/$f" ]; then
compare_zip_file $THIS_DIR $OTHER_DIR $WORK_DIR $f
if [ "$?" != "0" ]; then
return_value=1
REGRESSIONS=true
fi
fi
done
fi
return $return_value
}
##########################################################################################
# Compare binary (executable/library) file
compare_bin_file() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
BIN_FILE=$4
THIS_FILE=$THIS_DIR/$BIN_FILE
OTHER_FILE=$OTHER_DIR/$BIN_FILE
NAME=$(basename $BIN_FILE)
WORK_FILE_BASE=$WORK_DIR/$BIN_FILE
FILE_WORK_DIR=$(dirname $WORK_FILE_BASE)
$MKDIR -p $FILE_WORK_DIR
ORIG_THIS_FILE="$THIS_FILE"
ORIG_OTHER_FILE="$OTHER_FILE"
if [[ "$STRIP_BEFORE_COMPARE" = *"$BIN_FILE"* ]]; then
THIS_STRIPPED_FILE=$FILE_WORK_DIR/this/$NAME
OTHER_STRIPPED_FILE=$FILE_WORK_DIR/other/$NAME
$MKDIR -p $FILE_WORK_DIR/this $FILE_WORK_DIR/other
$CP $THIS_FILE $THIS_STRIPPED_FILE
$CP $OTHER_FILE $OTHER_STRIPPED_FILE
$STRIP $THIS_STRIPPED_FILE
$STRIP $OTHER_STRIPPED_FILE
THIS_FILE="$THIS_STRIPPED_FILE"
OTHER_FILE="$OTHER_STRIPPED_FILE"
fi
if [ -z "$SKIP_BIN_DIFF" ]; then
if cmp $OTHER_FILE $THIS_FILE > /dev/null; then
# The files were bytewise identical.
if [ -n "$VERBOSE" ]; then
echo " : : : : : $BIN_FILE"
fi
return 0
fi
BIN_MSG=" diff "
if [[ "$ACCEPTED_BIN_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_BIN=true
if [[ "$KNOWN_BIN_DIFF" != *"$BIN_FILE"* ]]; then
BIN_MSG="*$BIN_MSG*"
REGRESSIONS=true
else
BIN_MSG=" $BIN_MSG "
fi
else
BIN_MSG="($BIN_MSG)"
DIFF_BIN=
fi
fi
THIS_SIZE=$(ls -l "$THIS_FILE" | awk '{ print $5 }')
OTHER_SIZE=$(ls -l "$OTHER_FILE" | awk '{ print $5 }')
if [ $THIS_SIZE -ne $OTHER_SIZE ]; then
DIFF_SIZE_NUM=$($EXPR $THIS_SIZE - $OTHER_SIZE)
DIFF_SIZE_REL=$($EXPR $THIS_SIZE \* 100 / $OTHER_SIZE)
SIZE_MSG=$($PRINTF "%3d%% %4d" $DIFF_SIZE_REL $DIFF_SIZE_NUM)
if [[ "$ACCEPTED_SMALL_SIZE_DIFF" = *"$BIN_FILE"* ]] && [ "$DIFF_SIZE_REL" -gt 98 ] && [ "$DIFF_SIZE_REL" -lt 102 ]; then
SIZE_MSG="($SIZE_MSG)"
DIFF_SIZE=
else
if [[ "$ACCEPTED_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_SIZE=true
if [[ "$KNOWN_SIZE_DIFF" != *"$BIN_FILE"* ]]; then
SIZE_MSG="*$SIZE_MSG*"
REGRESSIONS=true
else
SIZE_MSG=" $SIZE_MSG "
fi
else
SIZE_MSG="($SIZE_MSG)"
DIFF_SIZE=
fi
fi
else
SIZE_MSG=" "
DIFF_SIZE=
if [[ "$KNOWN_SIZE_DIFF $ACCEPTED_SIZE_DIFF" = *"$BIN_FILE"* ]]; then
SIZE_MSG=" ! "
fi
fi
if [[ "$SORT_SYMBOLS" = *"$BIN_FILE"* ]]; then
SYM_SORT_CMD="sort"
else
SYM_SORT_CMD="cat"
fi
# Check symbols
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
$DUMPBIN -exports $OTHER_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
$DUMPBIN -exports $THIS_FILE | $GREP " = " | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
elif [ "$OPENJDK_TARGET_OS" = "solaris" ]; then
# Some symbols get seemingly random 15 character prefixes. Filter them out.
$NM -a $ORIG_OTHER_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] \.\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
$NM -a $ORIG_THIS_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] \.\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
else
$NM -a $ORIG_OTHER_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
$NM -a $ORIG_THIS_FILE | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
fi
LANG=C $DIFF $WORK_FILE_BASE.symbols.other $WORK_FILE_BASE.symbols.this > $WORK_FILE_BASE.symbols.diff
if [ -s $WORK_FILE_BASE.symbols.diff ]; then
SYM_MSG=" diff "
if [[ "$ACCEPTED_SYM_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_SYM=true
if [[ "$KNOWN_SYM_DIFF" != *"$BIN_FILE"* ]]; then
SYM_MSG="*$SYM_MSG*"
REGRESSIONS=true
else
SYM_MSG=" $SYM_MSG "
fi
else
SYM_MSG="($SYM_MSG)"
DIFF_SYM=
fi
else
SYM_MSG=" "
DIFF_SYM=
if [[ "$KNOWN_SYM_DIFF $ACCEPTED_SYM_DIFF" = *"$BIN_FILE"* ]]; then
SYM_MSG=" ! "
fi
fi
# Check dependencies
if [ -n "$LDD_CMD" ];then
(cd $FILE_WORK_DIR && $CP $OTHER_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.other | $UNIQ > $WORK_FILE_BASE.deps.other.uniq)
(cd $FILE_WORK_DIR && $CP $THIS_FILE . && $LDD_CMD $NAME | $AWK '{ print $1;}' | $SORT | $TEE $WORK_FILE_BASE.deps.this | $UNIQ > $WORK_FILE_BASE.deps.this.uniq)
(cd $FILE_WORK_DIR && $RM -f $NAME)
LANG=C $DIFF $WORK_FILE_BASE.deps.other $WORK_FILE_BASE.deps.this > $WORK_FILE_BASE.deps.diff
LANG=C $DIFF $WORK_FILE_BASE.deps.other.uniq $WORK_FILE_BASE.deps.this.uniq > $WORK_FILE_BASE.deps.diff.uniq
if [ -s $WORK_FILE_BASE.deps.diff ]; then
if [ -s $WORK_FILE_BASE.deps.diff.uniq ]; then
DEP_MSG=" diff "
else
DEP_MSG=" redun "
fi
if [[ "$ACCEPTED_DEP_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_DEP=true
if [[ "$KNOWN_DEP_DIFF" != *"$BIN_FILE"* ]]; then
DEP_MSG="*$DEP_MSG*"
REGRESSIONS=true
else
DEP_MSG=" $DEP_MSG "
fi
else
DEP_MSG="($DEP_MSG)"
DIFF_DEP=
fi
else
DEP_MSG=" "
DIFF_DEP=
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
DEP_MSG=" ! "
fi
fi
fi
# Compare readelf output
if [ -n "$READELF_CMD" ] && [ -z "$SKIP_ELF_DIFF" ]; then
$READELF_CMD $OTHER_FILE > $WORK_FILE_BASE.readelf.other 2>&1
$READELF_CMD $THIS_FILE > $WORK_FILE_BASE.readelf.this 2>&1
LANG=C $DIFF $WORK_FILE_BASE.readelf.other $WORK_FILE_BASE.readelf.this > $WORK_FILE_BASE.readelf.diff
if [ -s $WORK_FILE_BASE.readelf.diff ]; then
ELF_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.readelf.diff | awk '{print $5}')
ELF_MSG=$($PRINTF "%8d" $ELF_DIFF_SIZE)
if [[ "$ACCEPTED_ELF_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_ELF=true
if [[ "$KNOWN_ELF_DIFF" != *"$BIN_FILE"* ]]; then
ELF_MSG="*$ELF_MSG*"
REGRESSIONS=true
else
ELF_MSG=" $ELF_MSG "
fi
else
ELF_MSG="($ELF_MSG)"
DIFF_ELF=
fi
else
ELF_MSG=" "
DIFF_ELF=
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
ELF_MSG=" ! "
fi
fi
fi
# Compare disassemble output
if [ -f "$OBJDUMP" ] && [ -z "$SKIP_DIS_DIFF" ]; then
$OBJDUMP -d $OTHER_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.other 2>&1
$OBJDUMP -d $THIS_FILE | $GREP -v $NAME > $WORK_FILE_BASE.dis.this 2>&1
LANG=C $DIFF $WORK_FILE_BASE.dis.other $WORK_FILE_BASE.dis.this > $WORK_FILE_BASE.dis.diff
if [ -s $WORK_FILE_BASE.dis.diff ]; then
DIS_DIFF_SIZE=$(ls -n $WORK_FILE_BASE.dis.diff | awk '{print $5}')
DIS_MSG=$($PRINTF "%8d" $DIS_DIFF_SIZE)
if [[ "$ACCEPTED_DIS_DIFF" != *"$BIN_FILE"* ]]; then
DIFF_DIS=true
if [[ "$KNOWN_DIS_DIFF" != *"$BIN_FILE"* ]]; then
DIS_MSG="*$DIS_MSG*"
REGRESSIONS=true
else
DIS_MSG=" $DIS_MSG "
fi
else
DIS_MSG="($DIS_MSG)"
DIFF_DIS=
fi
else
DIS_MSG=" "
DIFF_DIS=
if [[ "$KNOWN_DEP_DIFF $ACCEPTED_DEP_DIFF" = *"$BIN_FILE"* ]]; then
DIS_MSG=" ! "
fi
fi
fi
if [ -n "$DIFF_BIN$DIFF_SIZE$DIFF_SYM$DIFF_DEP$DIFF_ELF$DIFF_DIS" ] || [ -n "$VERBOSE" ]; then
if [ -n "$BIN_MSG" ]; then echo -n "$BIN_MSG:"; fi
if [ -n "$SIZE_MSG" ]; then echo -n "$SIZE_MSG:"; fi
if [ -n "$SYM_MSG" ]; then echo -n "$SYM_MSG:"; fi
if [ -n "$DEP_MSG" ]; then echo -n "$DEP_MSG:"; fi
if [ -n "$ELF_MSG" ]; then echo -n "$ELF_MSG:"; fi
if [ -n "$DIS_MSG" ]; then echo -n "$DIS_MSG:"; fi
echo " $BIN_FILE"
if [ "$SHOW_DIFFS" = "true" ]; then
if [ -s "$WORK_FILE_BASE.symbols.diff" ]; then
echo "Symbols diff:"
$CAT $WORK_FILE_BASE.symbols.diff
fi
if [ -s "$WORK_FILE_BASE.deps.diff" ]; then
echo "Deps diff:"
$CAT $WORK_FILE_BASE.deps.diff
fi
if [ -s "$WORK_FILE_BASE.readelf.diff" ]; then
echo "Readelf diff:"
$CAT $WORK_FILE_BASE.readelf.diff
fi
if [ -s "$WORK_FILE_BASE.dis.diff" ]; then
echo "Disassembly diff:"
$CAT $WORK_FILE_BASE.dis.diff
fi
fi
return 1
fi
return 0
}
##########################################################################################
# Print binary diff header
print_binary_diff_header() {
if [ -z "$SKIP_BIN_DIFF" ]; then echo -n " Binary :"; fi
if [ -z "$SKIP_SIZE_DIFF" ]; then echo -n " Size :"; fi
if [ -z "$SKIP_SYM_DIFF" ]; then echo -n " Symbols :"; fi
if [ -z "$SKIP_DEP_DIFF" ]; then echo -n " Deps :"; fi
if [ -z "$SKIP_ELF_DIFF" ]; then echo -n " Readelf :"; fi
if [ -z "$SKIP_DIS_DIFF" ]; then echo -n " Disass :"; fi
echo
}
##########################################################################################
# Compare all libraries
compare_all_libs() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
LIBS=$(cd $THIS_DIR && $FIND . -name 'lib*.so' -o -name '*.dylib' -o -name '*.dll' | $SORT | $FILTER)
if [ -n "$LIBS" ]; then
echo Libraries...
print_binary_diff_header
for l in $LIBS; do
if [ -f "$OTHER_DIR/$l" ]; then
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $l
if [ "$?" != "0" ]; then
return_value=1
fi
fi
done
fi
return $return_value
}
##########################################################################################
# Compare all executables
compare_all_execs() {
THIS_DIR=$1
OTHER_DIR=$2
WORK_DIR=$3
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
EXECS=$(cd $THIS_DIR && $FIND . -type f -name '*.exe' | $SORT | $FILTER)
else
EXECS=$(cd $THIS_DIR && $FIND . -name db -prune -o -type f -perm -100 \! \( -name '*.so' -o -name '*.dylib' -o -name '*.dll' -o -name '*.cgi' \) | $SORT | $FILTER)
fi
if [ -n "$EXECS" ]; then
echo Executables...
print_binary_diff_header
for e in $EXECS; do
if [ -f "$OTHER_DIR/$e" ]; then
compare_bin_file $THIS_DIR $OTHER_DIR $WORK_DIR $e
if [ "$?" != "0" ]; then
return_value=1
fi
fi
done
fi
return $return_value
}
##########################################################################################
# Initiate configuration
COMPARE_ROOT=/tmp/cimages.$USER
$MKDIR -p $COMPARE_ROOT
if [ "$OPENJDK_TARGET_OS" = "windows" ]; then
if [ "$(uname -o)" = "Cygwin" ]; then
COMPARE_ROOT=$(cygpath -msa $COMPARE_ROOT)
fi
fi
THIS="$( cd "$( dirname "$0" )" && pwd )"
echo "$THIS"
THIS_SCRIPT="$0"
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-?" ] || [ "$1" = "/h" ] || [ "$1" = "/?" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
echo "bash ./compare.sh [OPTIONS] [FILTER]"
echo ""
echo "-all Compare all files in all known ways"
echo "-names Compare the file names and directory structure"
echo "-perms Compare the permission bits on all files and directories"
echo "-types Compare the output of the file command on all files"
echo "-general Compare the files not convered by the specialized comparisons"
echo "-zips Compare the contents of all zip files"
echo "-jars Compare the contents of all jar files"
echo "-libs Compare all native libraries"
echo "-execs Compare all executables"
echo "-v Verbose output, does not hide known differences"
echo "-vv More verbose output, shows diff output of all comparisons"
echo "-o [OTHER] Compare with build in other directory. Will default to the old build directory"
echo ""
echo "[FILTER] List filenames in the image to compare, works for jars, zips, libs and execs"
echo "Example:"
echo "bash ./common/bin/compareimages.sh CodePointIM.jar"
exit 10
fi
CMP_NAMES=false
CMP_PERMS=false
CMP_TYPES=false
CMP_GENERAL=false
CMP_ZIPS=false
CMP_JARS=false
CMP_LIBS=false
CMP_EXECS=false
while [ -n "$1" ]; do
case "$1" in
-v)
VERBOSE=true
;;
-vv)
VERBOSE=true
SHOW_DIFFS=true
;;
-o)
OTHER=$2
shift
;;
-all)
CMP_NAMES=true
if [ "$OPENJDK_TARGET_OS" != "windows" ]; then
CMP_PERMS=true
fi
CMP_TYPES=true
CMP_GENERAL=true
CMP_ZIPS=true
CMP_JARS=true
CMP_LIBS=true
CMP_EXECS=true
;;
-names)
CMP_NAMES=true
;;
-perms)
CMP_PERMS=true
;;
-types)
CMP_TYPES=true
;;
-general)
CMP_GENERAL=true
;;
-zips)
CMP_ZIPS=true
;;
-jars)
CMP_JARS=true
;;
-libs)
CMP_LIBS=true
;;
-execs)
CMP_EXECS=true
;;
*)
CMP_NAMES=false
CMP_PERMS=false
CMP_TYPES=false
CMP_ZIPS=true
CMP_JARS=true
CMP_LIBS=true
CMP_EXECS=true
if [ -z "$FILTER" ]; then
FILTER="$GREP"
fi
FILTER="$FILTER -e $1"
;;
esac
shift
done
if [ "$CMP_NAMES" = "false" ] && [ "$CMP_TYPES" = "false" ] && [ "$CMP_PERMS" = "false" ] && [ "$CMP_GENERAL" = "false" ] && [ "$CMP_ZIPS" = "false" ] && [ "$CMP_JARS" = "false" ] && [ "$CMP_LIBS" = "false" ] && [ "$CMP_EXECS" = "false" ]; then
CMP_NAMES=true
CMP_PERMS=true
CMP_TYPES=true
CMP_GENERAL=true
CMP_ZIPS=true
CMP_JARS=true
CMP_LIBS=true
CMP_EXECS=true
fi
if [ -z "$FILTER" ]; then
FILTER="$CAT"
fi
if [ -z "$OTHER" ]; then
OTHER="$THIS/../$LEGACY_BUILD_DIR"
if [ -d "$OTHER" ]; then
OTHER="$( cd "$OTHER" && pwd )"
else
echo "Default old build directory does not exist:"
echo "$OTHER"
fi
echo "Comparing to default old build:"
echo "$OTHER"
echo
else
echo "Comparing to:"
echo "$OTHER"
echo
fi
if [ ! -d "$OTHER" ]; then
echo "Other build directory does not exist:"
echo "$OTHER"
exit 1;
fi
# Figure out the layout of the new build. Which kinds of images have been produced
if [ -d "$THIS/images/j2sdk-image" ]; then
THIS_J2SDK="$THIS/images/j2sdk-image"
THIS_J2RE="$THIS/images/j2re-image"
fi
if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
fi
# Figure out the layout of the other build (old or new, normal or overlay image)
if [ -d "$OTHER/j2sdk-image" ]; then
if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
OTHER_J2SDK="$OTHER/j2sdk-image"
OTHER_J2RE="$OTHER/j2re-image"
else
OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
fi
fi
if [ -z "$OTHER_J2SDK" ] && [ -n "$OTHER_J2SDK_OVERLAY" ] && [ -z "$THIS_J2SDK_OVERLAY" ]; then
echo "OTHER build only has an overlay image while this build does not. Nothing to compare!"
exit 1
fi
##########################################################################################
# Do the work
if [ "$CMP_NAMES" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
echo -n "J2SDK "
compare_dirs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
echo -n "J2RE "
compare_dirs $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
echo -n "J2SDK "
compare_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
echo -n "J2RE "
compare_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
echo -n "J2SDK Overlay "
compare_dirs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
echo -n "J2RE Overlay "
compare_dirs $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
echo -n "J2SDK Overlay "
compare_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
echo -n "J2RE Overlay "
compare_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
fi
fi
if [ "$CMP_PERMS" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
echo -n "J2SDK "
compare_permissions $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
echo -n "J2RE "
compare_permissions $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
echo -n "J2SDK Overlay "
compare_permissions $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
echo -n "J2RE Overlay "
compare_permissions $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
fi
fi
if [ "$CMP_TYPES" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
echo -n "J2SDK "
compare_file_types $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
echo -n "J2RE "
compare_file_types $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
echo -n "J2SDK Overlay "
compare_file_types $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
echo -n "J2RE Overlay "
compare_file_types $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
fi
fi
if [ "$CMP_GENERAL" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
echo -n "J2SDK "
compare_general_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
echo -n "J2RE "
compare_general_files $THIS_J2RE $OTHER_J2RE $COMPARE_ROOT/j2re
fi
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
echo -n "J2SDK Overlay "
compare_general_files $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
echo -n "J2RE Overlay "
compare_general_files $THIS_J2RE_OVERLAY $OTHER_J2RE_OVERLAY $COMPARE_ROOT/j2re-overlay
fi
fi
if [ "$CMP_ZIPS" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
compare_all_zip_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
fi
fi
if [ "$CMP_JARS" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
compare_all_jar_files $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
fi
fi
if [ "$CMP_LIBS" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
compare_all_libs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
fi
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
echo -n "Overlay "
compare_all_libs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
fi
fi
if [ "$CMP_EXECS" = "true" ]; then
if [ -n "$THIS_J2SDK" ] && [ -n "$OTHER_J2SDK" ]; then
compare_all_execs $THIS_J2SDK $OTHER_J2SDK $COMPARE_ROOT/j2sdk
fi
if [ -n "$THIS_J2SDK_OVERLAY" ] && [ -n "$OTHER_J2SDK_OVERLAY" ]; then
echo -n "Overlay "
compare_all_execs $THIS_J2SDK_OVERLAY $OTHER_J2SDK_OVERLAY $COMPARE_ROOT/j2sdk-overlay
fi
fi
echo
if [ -n "$REGRESSIONS" ]; then
echo "REGRESSIONS FOUND!"
echo
exit 1
else
echo "No regressions found"
echo
exit 0
fi
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
CONFIGURE_COMMAND_LINE="$@" CONFIGURE_COMMAND_LINE="$@"
conf_script_dir=`dirname $0` 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 ### Test that the generated configure is up-to-date
...@@ -14,8 +19,12 @@ TEST=`which test` ...@@ -14,8 +19,12 @@ TEST=`which test`
print_error_not_up_to_date() { print_error_not_up_to_date() {
echo "Error: The configure source files is newer than the generated files." echo "Error: The configure source files is newer than the generated files."
echo "Please run 'sh autogen.sh' to update 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 for file in configure.ac *.m4 ; do
if $TEST $file -nt generated-configure.sh; then if $TEST $file -nt generated-configure.sh; then
print_error_not_up_to_date print_error_not_up_to_date
...@@ -23,26 +32,32 @@ for file in configure.ac *.m4 ; do ...@@ -23,26 +32,32 @@ for file in configure.ac *.m4 ; do
fi fi
done done
if $TEST -e $conf_closed_script_dir/generated-configure.sh; then if $TEST -e $conf_custom_script_dir/generated-configure.sh; then
# If closed source configure is available, make sure it is up-to-date as well. # If custom 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 for file in configure.ac *.m4 $conf_custom_script_dir/*.m4; do
if $TEST $file -nt $conf_closed_script_dir/generated-configure.sh; then if $TEST $file -nt $conf_custom_script_dir/generated-configure.sh; then
print_error_not_up_to_date print_error_not_up_to_date
exit 1 exit 1
fi fi
done done
# Test if open configure is newer than closed configure, if so, closed needs to # Test if open configure is newer than custom configure, if so, custom needs to
# be regenerated. # 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_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` 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_closed_configure_timestamp; then if $TEST $conf_open_configure_timestamp -gt $conf_custom_configure_timestamp; then
print_error_not_up_to_date 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 exit 1
fi fi
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 ### Process command-line arguments
### ###
...@@ -63,6 +78,12 @@ do ...@@ -63,6 +78,12 @@ do
--with-extra-cxxflags=*) --with-extra-cxxflags=*)
conf_extra_cxxflags=`expr "X$conf_option" : '[^=]*=\(.*\)'` conf_extra_cxxflags=`expr "X$conf_option" : '[^=]*=\(.*\)'`
continue ;; 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" ;; conf_processed_arguments="$conf_processed_arguments $conf_option" ;;
esac esac
...@@ -104,13 +125,29 @@ conf_processed_arguments="--enable-option-checking=fatal $conf_processed_argumen ...@@ -104,13 +125,29 @@ conf_processed_arguments="--enable-option-checking=fatal $conf_processed_argumen
### ###
### Call the configure script ### Call the configure script
### ###
if $TEST -e $conf_closed_script_dir/generated-configure.sh; then if $TEST -e $conf_custom_script_dir/generated-configure.sh; then
# Closed source configure available; run that instead # Custom 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" 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 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 fi
conf_result_code=$?
### ###
### Post-processing ### Post-processing
### ###
...@@ -119,3 +156,5 @@ fi ...@@ -119,3 +156,5 @@ fi
if $TEST -d "$OUTPUT_ROOT"; then if $TEST -d "$OUTPUT_ROOT"; then
mv -f config.log "$OUTPUT_ROOT" 2> /dev/null mv -f config.log "$OUTPUT_ROOT" 2> /dev/null
fi fi
exit $conf_result_code
...@@ -53,9 +53,9 @@ m4_include([source-dirs.m4]) ...@@ -53,9 +53,9 @@ m4_include([source-dirs.m4])
m4_include([toolchain.m4]) m4_include([toolchain.m4])
# This line needs to be here, verbatim, after all includes. # This line needs to be here, verbatim, after all includes.
# It is replaced with closed functionality when building # It is replaced with custom functionality when building
# closed sources. # custom sources.
AC_DEFUN_ONCE([CLOSED_HOOK]) AC_DEFUN_ONCE([CUSTOM_HOOK])
############################################################################### ###############################################################################
# #
...@@ -65,6 +65,12 @@ AC_DEFUN_ONCE([CLOSED_HOOK]) ...@@ -65,6 +65,12 @@ AC_DEFUN_ONCE([CLOSED_HOOK])
# Basic initialization that must happen first of all # Basic initialization that must happen first of all
BASIC_INIT 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_PATHS
BASIC_SETUP_LOGGING BASIC_SETUP_LOGGING
...@@ -75,27 +81,17 @@ HELP_SETUP_DEPENDENCY_HELP ...@@ -75,27 +81,17 @@ HELP_SETUP_DEPENDENCY_HELP
# Without these, we can't properly run the rest of the configure script. # Without these, we can't properly run the rest of the configure script.
BASIC_SETUP_TOOLS 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. # Check if pkg-config is available.
PKG_PROG_PKG_CONFIG PKG_PROG_PKG_CONFIG
############################################################################### # After basic tools have been setup, we can check build os specific details.
#
# Determine OpenJDK build and target platforms.
#
###############################################################################
PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET
PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION
# With knowledge of the build platform, setup more basic things. # Setup builddeps, for automatic downloading of tools we need.
BASIC_SETUP_PATH_SEP # This is needed before we can call BDEPS_CHECK_MODULE, which is done in
BASIC_SETUP_SEARCHPATH # 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 ...@@ -148,7 +144,7 @@ TOOLCHAIN_SETUP_PATHS
# FIXME: Currently we must test this after paths but before flags. Fix! # FIXME: Currently we must test this after paths but before flags. Fix!
# And we can test some aspects on the target using configure macros. # 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 PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
# Configure flags for the tools # Configure flags for the tools
...@@ -213,8 +209,8 @@ BPERF_SETUP_CCACHE ...@@ -213,8 +209,8 @@ BPERF_SETUP_CCACHE
# Check for some common pitfalls # Check for some common pitfalls
BASIC_TEST_USABILITY_ISSUES BASIC_TEST_USABILITY_ISSUES
# At the end, call the closed hook. (Dummy macro if no closed sources available) # At the end, call the custom hook. (Dummy macro if no custom sources available)
CLOSED_HOOK CUSTOM_HOOK
# We're messing a bit with internal autoconf variables to put the config.status # We're messing a bit with internal autoconf variables to put the config.status
# in the output directory instead of the current directory. # in the output directory instead of the current directory.
...@@ -222,5 +218,8 @@ CONFIG_STATUS="$OUTPUT_ROOT/config.status" ...@@ -222,5 +218,8 @@ CONFIG_STATUS="$OUTPUT_ROOT/config.status"
# Create the actual output files. Now the main work of configure is done. # Create the actual output files. Now the main work of configure is done.
AC_OUTPUT AC_OUTPUT
# Make the compare script executable
$CHMOD +x $OUTPUT_ROOT/compare.sh
# Finally output some useful information to the user # Finally output some useful information to the user
HELP_PRINT_SUMMARY_AND_WARNINGS HELP_PRINT_SUMMARY_AND_WARNINGS
因为 它太大了无法显示 source diff 。你可以改为 查看blob
#
# 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], ...@@ -30,7 +30,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
# Check which variant of the JDK that we want to build. # Check which variant of the JDK that we want to build.
# Currently we have: # Currently we have:
# normal: standard edition # 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 # Effectively the JDK variant gives a name to a specific set of
# modules to compile into the JDK. In the future, these modules # modules to compile into the JDK. In the future, these modules
...@@ -38,22 +38,14 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT], ...@@ -38,22 +38,14 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
# #
AC_MSG_CHECKING([which variant of the JDK to build]) AC_MSG_CHECKING([which variant of the JDK to build])
AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant], 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 if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
JAVASE_EMBEDDED=""
MINIMIZE_RAM_USAGE=""
JDK_VARIANT="normal" 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 else
AC_MSG_ERROR([The available JDK variants are: normal, embedded]) AC_MSG_ERROR([The available JDK variants are: normal])
fi fi
AC_SUBST(JAVASE_EMBEDDED)
AC_SUBST(MINIMIZE_RAM_USAGE)
AC_SUBST(JDK_VARIANT) AC_SUBST(JDK_VARIANT)
AC_MSG_RESULT([$JDK_VARIANT]) AC_MSG_RESULT([$JDK_VARIANT])
...@@ -77,11 +69,7 @@ AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants], ...@@ -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@:>@])]) [JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
if test "x$with_jvm_variants" = x; then if test "x$with_jvm_variants" = x; then
if test "x$JDK_VARIANT" = xembedded; then with_jvm_variants="server"
with_jvm_variants="client"
else
with_jvm_variants="server"
fi
fi fi
JVM_VARIANTS=",$with_jvm_variants," JVM_VARIANTS=",$with_jvm_variants,"
...@@ -125,6 +113,11 @@ AC_SUBST(JVM_VARIANT_KERNEL) ...@@ -125,6 +113,11 @@ AC_SUBST(JVM_VARIANT_KERNEL)
AC_SUBST(JVM_VARIANT_ZERO) AC_SUBST(JVM_VARIANT_ZERO)
AC_SUBST(JVM_VARIANT_ZEROSHARK) 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 ...@@ -223,6 +216,14 @@ fi
HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT" 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) AC_SUBST(DEBUG_LEVEL)
...@@ -289,14 +290,12 @@ BUILD_HEADLESS="BUILD_HEADLESS:=true" ...@@ -289,14 +290,12 @@ BUILD_HEADLESS="BUILD_HEADLESS:=true"
if test "x$SUPPORT_HEADFUL" = xyes; then if test "x$SUPPORT_HEADFUL" = xyes; then
# We are building both headful and headless. # We are building both headful and headless.
BUILD_HEADLESS_ONLY=""
headful_msg="inlude support for both headful and headless" headful_msg="inlude support for both headful and headless"
fi fi
if test "x$SUPPORT_HEADFUL" = xno; then if test "x$SUPPORT_HEADFUL" = xno; then
# Thus we are building headless only. # Thus we are building headless only.
BUILD_HEADLESS="BUILD_HEADLESS:=true" BUILD_HEADLESS="BUILD_HEADLESS:=true"
BUILD_HEADLESS_ONLY="BUILD_HEADLESS_ONLY:=true"
headful_msg="headless only" headful_msg="headless only"
fi fi
...@@ -305,23 +304,6 @@ AC_MSG_RESULT([$headful_msg]) ...@@ -305,23 +304,6 @@ AC_MSG_RESULT([$headful_msg])
AC_SUBST(SUPPORT_HEADLESS) AC_SUBST(SUPPORT_HEADLESS)
AC_SUBST(SUPPORT_HEADFUL) AC_SUBST(SUPPORT_HEADFUL)
AC_SUBST(BUILD_HEADLESS) 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) ...@@ -373,25 +355,21 @@ AC_SUBST(CACERTS_FILE)
# #
COMPRESS_JARS=false COMPRESS_JARS=false
# default for embedded is yes...
if test "x$JDK_VARIANT" = "xembedded"; then
COMPRESS_JARS=true
fi
AC_SUBST(COMPRESS_JARS) AC_SUBST(COMPRESS_JARS)
############################################################################### ###############################################################################
# #
# Should we compile JFR # Should we compile JFR
# default no, except for on closed-jdk and !embedded # default no, except for on closed-jdk
# #
ENABLE_JFR=no ENABLE_JFR=no
# Is the JFR source present # 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 ENABLE_JFR=yes
fi fi
...@@ -469,7 +447,7 @@ AC_SUBST(COOKED_BUILD_NUMBER) ...@@ -469,7 +447,7 @@ AC_SUBST(COOKED_BUILD_NUMBER)
AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS], 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) AC_SUBST(HOTSPOT_MAKE_ARGS)
# The name of the Service Agent jar. # The name of the Service Agent jar.
...@@ -494,11 +472,6 @@ if test "x$OPENJDK_TARGET_OS" = xmacosx; then ...@@ -494,11 +472,6 @@ if test "x$OPENJDK_TARGET_OS" = xmacosx; then
ENABLE_DEBUG_SYMBOLS=no ENABLE_DEBUG_SYMBOLS=no
fi fi
# default for embedded is no...
if test "x$JDK_VARIANT" = "xembedded"; then
ENABLE_DEBUG_SYMBOLS=no
fi
AC_ARG_ENABLE([debug-symbols], AC_ARG_ENABLE([debug-symbols],
[AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])], [AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])],
[ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}], [ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}],
...@@ -549,3 +522,11 @@ AC_SUBST(ZIP_DEBUGINFO_FILES) ...@@ -549,3 +522,11 @@ AC_SUBST(ZIP_DEBUGINFO_FILES)
AC_SUBST(CFLAGS_DEBUG_SYMBOLS) AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
AC_SUBST(CXXFLAGS_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 ...@@ -73,6 +73,10 @@ if test "x$OPENJDK" = "xfalse"; then
FREETYPE2_NOT_NEEDED=yes FREETYPE2_NOT_NEEDED=yes
fi 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 # Check for MacOSX support for OpenJDK. If this exists, try to build a JVM
...@@ -518,9 +522,7 @@ AC_SUBST(USE_EXTERNAL_LIBZ) ...@@ -518,9 +522,7 @@ AC_SUBST(USE_EXTERNAL_LIBZ)
############################################################################### ###############################################################################
LIBZIP_CAN_USE_MMAP=true LIBZIP_CAN_USE_MMAP=true
if test "x$JDK_VARIANT" = "xembedded"; then
LIBZIP_CAN_USE_MMAP=false
fi
AC_SUBST(LIBZIP_CAN_USE_MMAP) AC_SUBST(LIBZIP_CAN_USE_MMAP)
############################################################################### ###############################################################################
...@@ -629,7 +631,7 @@ fi ...@@ -629,7 +631,7 @@ fi
# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so) # 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 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 fi
# TODO better (platform agnostic) test # TODO better (platform agnostic) test
......
...@@ -23,279 +23,86 @@ ...@@ -23,279 +23,86 @@
# questions. # questions.
# #
AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS], # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
[ # Converts autoconf style CPU name to OpenJDK style, into
# Expects $host_os $host_cpu $build_os and $build_cpu # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN.
# and $with_target_bits to have been setup!
#
# Translate the standard triplet(quadruplet) definition
# of the target/build system into
# OPENJDK_TARGET_OS=aix,bsd,hpux,linux,macosx,solaris,windows
# OPENJDK_TARGET_OS_FAMILY=bsd,gnu,sysv,win32,wince
# OPENJDK_TARGET_OS_API=posix,winapi
#
# OPENJDK_TARGET_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
# OPENJDK_TARGET_CPU_ARCH=x86,sparc,pcc,arm
# OPENJDK_TARGET_CPU_BITS=32,64
# OPENJDK_TARGET_CPU_ENDIAN=big,little
#
# The same values are setup for BUILD_...
#
# And the legacy variables, for controlling the old makefiles.
# LEGACY_OPENJDK_TARGET_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
# LEGACY_OPENJDK_TARGET_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
# LEGACY_OPENJDK_TARGET_CPU3=sparcv9,amd64 (but only on solaris)
# LEGACY_OPENJDK_TARGET_OS_API=solaris,windows
#
# We also copy the autoconf trip/quadruplet
# verbatim to OPENJDK_TARGET_SYSTEM (from the autoconf "host") and OPENJDK_BUILD_SYSTEM
OPENJDK_TARGET_SYSTEM="$host"
OPENJDK_BUILD_SYSTEM="$build"
AC_SUBST(OPENJDK_TARGET_SYSTEM)
AC_SUBST(OPENJDK_BUILD_SYSTEM)
PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_TARGET,$host_os)
PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_TARGET,$host_cpu)
PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_BUILD,$build_os)
PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_BUILD,$build_cpu)
if test "x$OPENJDK_TARGET_OS" != xsolaris; then
LEGACY_OPENJDK_TARGET_CPU3=""
LEGACY_OPENJDK_BUILD_CPU3=""
fi
# On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_OPENJDK_TARGET_CPU1) ...
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$OPENJDK_TARGET_CPU" = xx64; then
LEGACY_OPENJDK_TARGET_CPU1="x86_64"
fi
PLATFORM_SET_RELEASE_FILE_OS_VALUES
])
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS_TO],
[
PLATFORM_EXTRACT_VARS_FROM_OS($2)
$1_OS="$VAR_OS"
$1_OS_FAMILY="$VAR_OS_FAMILY"
$1_OS_API="$VAR_OS_API"
AC_SUBST($1_OS)
AC_SUBST($1_OS_FAMILY)
AC_SUBST($1_OS_API)
if test "x$$1_OS_API" = xposix; then
LEGACY_$1_OS_API="solaris"
fi
if test "x$$1_OS_API" = xwinapi; then
LEGACY_$1_OS_API="windows"
fi
AC_SUBST(LEGACY_$1_OS_API)
])
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU_TO],
[
PLATFORM_EXTRACT_VARS_FROM_CPU($2)
$1_CPU="$VAR_CPU"
$1_CPU_ARCH="$VAR_CPU_ARCH"
$1_CPU_BITS="$VAR_CPU_BITS"
$1_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST($1_CPU)
AC_SUBST($1_CPU_ARCH)
AC_SUBST($1_CPU_BITS)
AC_SUBST($1_CPU_ENDIAN)
# Also store the legacy naming of the cpu.
# Ie i586 and amd64 instead of ia32 and x64
LEGACY_$1_CPU1="$VAR_LEGACY_CPU"
AC_SUBST(LEGACY_$1_CPU1)
# And the second legacy naming of the cpu.
# Ie i386 and amd64 instead of ia32 and x64.
LEGACY_$1_CPU2="$LEGACY_$1_CPU1"
if test "x$LEGACY_$1_CPU1" = xi586; then
LEGACY_$1_CPU2=i386
fi
AC_SUBST(LEGACY_$1_CPU2)
# And the third legacy naming of the cpu.
# Ie only amd64 or sparcv9, used for the ISA_DIR on Solaris.
LEGACY_$1_CPU3=""
if test "x$$1_CPU" = xx64; then
LEGACY_$1_CPU3=amd64
fi
if test "x$$1_CPU" = xsparcv9; then
LEGACY_$1_CPU3=sparcv9
fi
AC_SUBST(LEGACY_$1_CPU3)
])
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
[ [
# First argument is the cpu name from the trip/quad # First argument is the cpu name from the trip/quad
case "$1" in case "$1" in
x86_64) x86_64)
VAR_CPU=x64 VAR_CPU=x86_64
VAR_CPU_ARCH=x86 VAR_CPU_ARCH=x86
VAR_CPU_BITS=64 VAR_CPU_BITS=64
VAR_CPU_ENDIAN=little VAR_CPU_ENDIAN=little
VAR_LEGACY_CPU=amd64
;; ;;
i?86) i?86)
VAR_CPU=ia32 VAR_CPU=x86
VAR_CPU_ARCH=x86 VAR_CPU_ARCH=x86
VAR_CPU_BITS=32 VAR_CPU_BITS=32
VAR_CPU_ENDIAN=little VAR_CPU_ENDIAN=little
VAR_LEGACY_CPU=i586
;;
alpha*)
VAR_CPU=alpha
VAR_CPU_ARCH=alpha
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big
VAR_LEGACY_CPU=alpha
;; ;;
arm*) arm*)
VAR_CPU=arm VAR_CPU=arm
VAR_CPU_ARCH=arm VAR_CPU_ARCH=arm
VAR_CPU_BITS=32 VAR_CPU_BITS=32
VAR_CPU_ENDIAN=little VAR_CPU_ENDIAN=little
VAR_LEGACY_CPU=arm
;; ;;
mips)
VAR_CPU=mips
VAR_CPU_ARCH=mips
VAR_CPU_BITS=woot
VAR_CPU_ENDIAN=woot
VAR_LEGACY_CPU=mips
;;
mipsel)
VAR_CPU=mipsel
VAR_CPU_ARCH=mips
VAR_CPU_BITS=woot
VAR_CPU_ENDIAN=woot
VAR_LEGACY_CPU=mipsel
;;
powerpc) powerpc)
VAR_CPU=ppc VAR_CPU=ppc
VAR_CPU_ARCH=ppc VAR_CPU_ARCH=ppc
VAR_CPU_BITS=32 VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big VAR_CPU_ENDIAN=big
VAR_LEGACY_CPU=ppc
;; ;;
powerpc64) powerpc64)
VAR_CPU=ppc64 VAR_CPU=ppc64
VAR_CPU_ARCH=ppc VAR_CPU_ARCH=ppc
VAR_CPU_BITS=64 VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big VAR_CPU_ENDIAN=big
VAR_LEGACY_CPU=ppc64
;; ;;
sparc) sparc)
VAR_CPU=sparc VAR_CPU=sparc
VAR_CPU_ARCH=sparc VAR_CPU_ARCH=sparc
VAR_CPU_BITS=32 VAR_CPU_BITS=32
VAR_CPU_ENDIAN=big VAR_CPU_ENDIAN=big
VAR_LEGACY_CPU=sparc
;; ;;
sparc64) sparcv9)
VAR_CPU=sparcv9 VAR_CPU=sparcv9
VAR_CPU_ARCH=sparc VAR_CPU_ARCH=sparc
VAR_CPU_BITS=64 VAR_CPU_BITS=64
VAR_CPU_ENDIAN=big VAR_CPU_ENDIAN=big
VAR_LEGACY_CPU=sparcv9
;;
s390)
VAR_CPU=s390
VAR_CPU_ARCH=s390
VAR_CPU_BITS=32
VAR_CPU_ENDIAN=woot
VAR_LEGACY_CPU=s390
VAR_LEGACY_CPU=s390
;;
s390x)
VAR_CPU=s390x
VAR_CPU_ARCH=s390
VAR_CPU_BITS=64
VAR_CPU_ENDIAN=woot
VAR_LEGACY_CPU=s390x
;; ;;
*) *)
AC_MSG_ERROR([unsupported cpu $1]) AC_MSG_ERROR([unsupported cpu $1])
;; ;;
esac esac
# Workaround cygwin not knowing about 64 bit.
if test "x$VAR_OS" = "xwindows"; then
if test "x$PROCESSOR_IDENTIFIER" != "x"; then
PROC_ARCH=`echo $PROCESSOR_IDENTIFIER | $CUT -f1 -d' '`
case "$PROC_ARCH" in
intel64|Intel64|INTEL64|em64t|EM64T|amd64|AMD64|8664|x86_64)
VAR_CPU=x64
VAR_CPU_BITS=64
VAR_LEGACY_CPU=amd64
;;
esac
fi
fi
# on solaris x86...default seems to be 32-bit
if test "x$VAR_OS" = "xsolaris" && \
test "x$with_target_bits" = "x" && \
test "x$VAR_CPU_ARCH" = "xx86"
then
with_target_bits=32
fi
if test "x$VAR_CPU_ARCH" = "xx86"; then
if test "x$with_target_bits" = "x64"; then
VAR_CPU=x64
VAR_CPU_BITS=64
VAR_LEGACY_CPU=amd64
fi
if test "x$with_target_bits" = "x32"; then
VAR_CPU=ia32
VAR_CPU_BITS=32
VAR_LEGACY_CPU=i586
fi
fi
if test "x$VAR_CPU_ARCH" = "xsparc"; then
if test "x$with_target_bits" = "x64"; then
VAR_CPU=sparcv9
VAR_CPU_BITS=64
VAR_LEGACY_CPU=sparcv9
fi
fi
]) ])
# Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD.
# Converts autoconf style OS name to OpenJDK style, into
# VAR_OS and VAR_OS_API.
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
[ [
case "$1" in case "$1" in
*linux*) *linux*)
VAR_OS=linux VAR_OS=linux
VAR_OS_API=posix VAR_OS_API=posix
VAR_OS_FAMILY=gnu
;; ;;
*solaris*) *solaris*)
VAR_OS=solaris VAR_OS=solaris
VAR_OS_API=posix VAR_OS_API=posix
VAR_OS_FAMILY=sysv
;; ;;
*darwin*) *darwin*)
VAR_OS=macosx VAR_OS=macosx
VAR_OS_API=posix VAR_OS_API=posix
VAR_OS_FAMILY=bsd
;; ;;
*bsd*) *bsd*)
VAR_OS=bsd VAR_OS=bsd
VAR_OS_API=posix VAR_OS_API=posix
VAR_OS_FAMILY=bsd
;; ;;
*cygwin*|*windows*) *cygwin*|*windows*)
VAR_OS=windows VAR_OS=windows
VAR_OS_API=winapi VAR_OS_API=winapi
VAR_OS_FAMILY=windows
;; ;;
*) *)
AC_MSG_ERROR([unsupported operating system $1]) AC_MSG_ERROR([unsupported operating system $1])
...@@ -303,6 +110,208 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS], ...@@ -303,6 +110,208 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
esac esac
]) ])
# Expects $host_os $host_cpu $build_os and $build_cpu
# and $with_target_bits to have been setup!
#
# Translate the standard triplet(quadruplet) definition
# of the target/build system into OPENJDK_TARGET_OS, OPENJDK_TARGET_CPU,
# OPENJDK_BUILD_OS, etc.
AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
[
# Copy the autoconf trip/quadruplet verbatim to OPENJDK_TARGET_AUTOCONF_NAME
# (from the autoconf "host") and OPENJDK_BUILD_AUTOCONF_NAME
# Note that we might later on rewrite e.g. OPENJDK_TARGET_CPU due to reduced build,
# but this will not change the value of OPENJDK_TARGET_AUTOCONF_NAME.
OPENJDK_TARGET_AUTOCONF_NAME="$host"
OPENJDK_BUILD_AUTOCONF_NAME="$build"
AC_SUBST(OPENJDK_TARGET_AUTOCONF_NAME)
AC_SUBST(OPENJDK_BUILD_AUTOCONF_NAME)
# Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables.
PLATFORM_EXTRACT_VARS_FROM_OS($host_os)
PLATFORM_EXTRACT_VARS_FROM_CPU($host_cpu)
# ... and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_TARGET_OS="$VAR_OS"
OPENJDK_TARGET_OS_API="$VAR_OS_API"
OPENJDK_TARGET_CPU="$VAR_CPU"
OPENJDK_TARGET_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_TARGET_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_TARGET_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST(OPENJDK_TARGET_OS)
AC_SUBST(OPENJDK_TARGET_OS_API)
AC_SUBST(OPENJDK_TARGET_CPU)
AC_SUBST(OPENJDK_TARGET_CPU_ARCH)
AC_SUBST(OPENJDK_TARGET_CPU_BITS)
AC_SUBST(OPENJDK_TARGET_CPU_ENDIAN)
# Convert the autoconf OS/CPU value to our own data, into the VAR_OS/CPU variables.
PLATFORM_EXTRACT_VARS_FROM_OS($build_os)
PLATFORM_EXTRACT_VARS_FROM_CPU($build_cpu)
# ..and setup our own variables. (Do this explicitely to facilitate searching)
OPENJDK_BUILD_OS="$VAR_OS"
OPENJDK_BUILD_OS_API="$VAR_OS_API"
OPENJDK_BUILD_CPU="$VAR_CPU"
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
OPENJDK_BUILD_CPU_ENDIAN="$VAR_CPU_ENDIAN"
AC_SUBST(OPENJDK_BUILD_OS)
AC_SUBST(OPENJDK_BUILD_OS_API)
AC_SUBST(OPENJDK_BUILD_CPU)
AC_SUBST(OPENJDK_BUILD_CPU_ARCH)
AC_SUBST(OPENJDK_BUILD_CPU_BITS)
AC_SUBST(OPENJDK_BUILD_CPU_ENDIAN)
])
# Check if a reduced build (32-bit on 64-bit platforms) is requested, and modify behaviour
# accordingly. Must be done after setting up build and target system, but before
# doing anything else with these values.
AC_DEFUN([PLATFORM_SETUP_TARGET_CPU_BITS],
[
AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits],
[build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])])
# We have three types of compiles:
# native == normal compilation, target system == build system
# cross == traditional cross compilation, target system != build system; special toolchain needed
# reduced == using native compilers, but with special flags (e.g. -m32) to produce 32-bit builds on 64-bit machines
#
if test "x$OPENJDK_BUILD_AUTOCONF_NAME" != "x$OPENJDK_TARGET_AUTOCONF_NAME"; then
# We're doing a proper cross-compilation
COMPILE_TYPE="cross"
else
COMPILE_TYPE="native"
fi
if test "x$with_target_bits" != x; then
if test "x$COMPILE_TYPE" = "xcross"; then
AC_MSG_ERROR([It is not possible to combine --with-target-bits=X and proper cross-compilation. Choose either.])
fi
if test "x$with_target_bits" = x32 && test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
# A reduced build is requested
COMPILE_TYPE="reduced"
OPENJDK_TARGET_CPU_BITS=32
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then
OPENJDK_TARGET_CPU=x86
elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then
OPENJDK_TARGET_CPU=sparc
else
AC_MSG_ERROR([Reduced build (--with-target-bits=32) is only supported on x86_64 and sparcv9])
fi
elif test "x$with_target_bits" = x64 && test "x$OPENJDK_TARGET_CPU_BITS" = x32; then
AC_MSG_ERROR([It is not possible to use --with-target-bits=64 on a 32 bit system. Use proper cross-compilation instead.])
elif test "x$with_target_bits" = "x$OPENJDK_TARGET_CPU_BITS"; then
AC_MSG_NOTICE([--with-target-bits are set to build platform address size; argument has no meaning])
else
AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!])
fi
fi
AC_SUBST(COMPILE_TYPE)
AC_MSG_CHECKING([for compilation type])
AC_MSG_RESULT([$COMPILE_TYPE])
])
# Setup the legacy variables, for controlling the old makefiles.
#
AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS],
[
# Also store the legacy naming of the cpu.
# Ie i586 and amd64 instead of x86 and x86_64
OPENJDK_TARGET_CPU_LEGACY="$OPENJDK_TARGET_CPU"
if test "x$OPENJDK_TARGET_CPU" = xx86; then
OPENJDK_TARGET_CPU_LEGACY="i586"
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
# On all platforms except MacOSX replace x86_64 with amd64.
OPENJDK_TARGET_CPU_LEGACY="amd64"
fi
AC_SUBST(OPENJDK_TARGET_CPU_LEGACY)
# And the second legacy naming of the cpu.
# Ie i386 and amd64 instead of x86 and x86_64.
OPENJDK_TARGET_CPU_LEGACY_LIB="$OPENJDK_TARGET_CPU"
if test "x$OPENJDK_TARGET_CPU" = xx86; then
OPENJDK_TARGET_CPU_LEGACY_LIB="i386"
elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then
OPENJDK_TARGET_CPU_LEGACY_LIB="amd64"
fi
AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB)
# This is the name of the cpu (but using i386 and amd64 instead of
# x86 and x86_64, respectively), preceeded by a /, to be used when
# locating libraries. On macosx, it's empty, though.
OPENJDK_TARGET_CPU_LIBDIR="/$OPENJDK_TARGET_CPU_LEGACY_LIB"
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
OPENJDK_TARGET_CPU_LIBDIR=""
fi
AC_SUBST(OPENJDK_TARGET_CPU_LIBDIR)
# OPENJDK_TARGET_CPU_ISADIR is normally empty. On 64-bit Solaris systems, it is set to
# /amd64 or /sparcv9. This string is appended to some library paths, like this:
# /usr/lib${OPENJDK_TARGET_CPU_ISADIR}/libexample.so
OPENJDK_TARGET_CPU_ISADIR=""
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
OPENJDK_TARGET_CPU_ISADIR="/amd64"
elif test "x$OPENJDK_TARGET_CPU" = xsparcv9; then
OPENJDK_TARGET_CPU_ISADIR="/sparcv9"
fi
fi
AC_SUBST(OPENJDK_TARGET_CPU_ISADIR)
# Setup OPENJDK_TARGET_CPU_OSARCH, which is used to set the os.arch Java system property
OPENJDK_TARGET_CPU_OSARCH="$OPENJDK_TARGET_CPU"
if test "x$OPENJDK_TARGET_OS" = xlinux && test "x$OPENJDK_TARGET_CPU" = xx86; then
# On linux only, we replace x86 with i386.
OPENJDK_TARGET_CPU_OSARCH="i386"
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
# On all platforms except macosx, we replace x86_64 with amd64.
OPENJDK_TARGET_CPU_OSARCH="amd64"
fi
AC_SUBST(OPENJDK_TARGET_CPU_OSARCH)
OPENJDK_TARGET_CPU_JLI="$OPENJDK_TARGET_CPU"
if test "x$OPENJDK_TARGET_CPU" = xx86; then
OPENJDK_TARGET_CPU_JLI="i386"
elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then
# On all platforms except macosx, we replace x86_64 with amd64.
OPENJDK_TARGET_CPU_JLI="amd64"
fi
# Now setup the -D flags for building libjli.
OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'"
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
if test "x$OPENJDK_TARGET_CPU_ARCH" = xsparc; then
OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"sparc\"' -DLIBARCH64NAME='\"sparcv9\"'"
elif test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -DLIBARCH32NAME='\"i386\"' -DLIBARCH64NAME='\"amd64\"'"
fi
fi
AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS)
# Setup OPENJDK_TARGET_OS_API_DIR, used in source paths.
if test "x$OPENJDK_TARGET_OS_API" = xposix; then
OPENJDK_TARGET_OS_API_DIR="solaris"
fi
if test "x$OPENJDK_TARGET_OS_API" = xwinapi; then
OPENJDK_TARGET_OS_API_DIR="windows"
fi
AC_SUBST(OPENJDK_TARGET_OS_API_DIR)
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
A_LP64="LP64:="
ADD_LP64="-D_LP64=1"
fi
AC_SUBST(LP64,$A_LP64)
if test "x$COMPILE_TYPE" = "xcross"; then
# FIXME: ... or should this include reduced builds..?
DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$OPENJDK_TARGET_CPU_LEGACY"
else
DEFINE_CROSS_COMPILE_ARCH=""
fi
AC_SUBST(DEFINE_CROSS_COMPILE_ARCH)
])
AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
[ [
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
...@@ -315,7 +324,11 @@ AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], ...@@ -315,7 +324,11 @@ AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
fi fi
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
REQUIRED_OS_NAME=Windows REQUIRED_OS_NAME=Windows
REQUIRED_OS_VERSION=5.1 if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
REQUIRED_OS_VERSION=5.2
else
REQUIRED_OS_VERSION=5.1
fi
fi fi
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
REQUIRED_OS_NAME=Darwin REQUIRED_OS_NAME=Darwin
...@@ -338,42 +351,10 @@ AC_CANONICAL_BUILD ...@@ -338,42 +351,10 @@ AC_CANONICAL_BUILD
AC_CANONICAL_HOST AC_CANONICAL_HOST
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits], PLATFORM_EXTRACT_TARGET_AND_BUILD
[build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])]) PLATFORM_SETUP_TARGET_CPU_BITS
PLATFORM_SET_RELEASE_FILE_OS_VALUES
if test "x$with_target_bits" != x && \ PLATFORM_SETUP_LEGACY_VARS
test "x$with_target_bits" != x32 && \
test "x$with_target_bits" != x64 ; then
AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!])
fi
# Translate the standard cpu-vendor-kernel-os quadruplets into
# the new TARGET_.... and BUILD_... and the legacy names used by
# the openjdk build.
# It uses $host_os $host_cpu $build_os $build_cpu and $with_target_bits
PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS
# The LEGACY_OPENJDK_TARGET_CPU3 is the setting for ISA_DIR.
if test "x$LEGACY_OPENJDK_TARGET_CPU3" != x; then
LEGACY_OPENJDK_TARGET_CPU3="/${LEGACY_OPENJDK_TARGET_CPU3}"
fi
# Now the following vars are defined.
# OPENJDK_TARGET_OS=aix,bsd,hpux,linux,macosx,solaris,windows
# OPENJDK_TARGET_OS_FAMILY=bsd,gnu,sysv,win32,wince
# OPENJDK_TARGET_OS_API=posix,winapi
#
# OPENJDK_TARGET_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
# OPENJDK_TARGET_CPU_ARCH=x86,sparc,pcc,arm
# OPENJDK_TARGET_CPU_BITS=32,64
# OPENJDK_TARGET_CPU_ENDIAN=big,little
#
# There is also a:
# LEGACY_OPENJDK_TARGET_CPU1=i586,amd64,.... # used to set the old var ARCH
# LEGACY_OPENJDK_TARGET_CPU2=i386,amd64,.... # used to set the old var LIBARCH
# LEGACY_OPENJDK_TARGET_CPU3=only sparcv9,amd64 # used to set the ISA_DIR on Solaris
# There was also a BUILDARCH that had i486,amd64,... but we do not use that
# in the new build.
# LEGACY_OPENJDK_TARGET_OS_API=solaris,windows # used to select source roots
]) ])
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION], AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
...@@ -391,7 +372,26 @@ AC_SUBST(OS_VERSION_MINOR) ...@@ -391,7 +372,26 @@ AC_SUBST(OS_VERSION_MINOR)
AC_SUBST(OS_VERSION_MICRO) AC_SUBST(OS_VERSION_MICRO)
]) ])
AC_DEFUN_ONCE([PLATFORM_TEST_OPENJDK_TARGET_BITS], # Support macro for PLATFORM_SETUP_OPENJDK_TARGET_BITS.
# Add -mX to various FLAGS variables.
AC_DEFUN([PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS],
[
# keep track of c/cxx flags that we added outselves...
# to prevent emitting warning...
ADDED_CFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
ADDED_CXXFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
ADDED_LDFLAGS=" -m${OPENJDK_TARGET_CPU_BITS}"
CFLAGS="${CFLAGS}${ADDED_CFLAGS}"
CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}"
CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}"
LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
])
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_BITS],
[ [
############################################################################### ###############################################################################
# #
...@@ -399,72 +399,47 @@ AC_DEFUN_ONCE([PLATFORM_TEST_OPENJDK_TARGET_BITS], ...@@ -399,72 +399,47 @@ AC_DEFUN_ONCE([PLATFORM_TEST_OPENJDK_TARGET_BITS],
# (The JVM can use 32 or 64 bit Java pointers but that decision # (The JVM can use 32 or 64 bit Java pointers but that decision
# is made at runtime.) # is made at runtime.)
# #
AC_LANG_PUSH(C++) if test "x$OPENJDK_TARGET_OS" = xsolaris; then
OLD_CXXFLAGS="$CXXFLAGS" # Always specify -m flags on Solaris
if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
CXXFLAGS="-m${with_target_bits} $CXXFLAGS" elif test "x$COMPILE_TYPE" = xreduced; then
if test "x$OPENJDK_TARGET_OS" != xwindows; then
# Specify -m if running reduced on other Posix platforms
PLATFORM_SET_COMPILER_TARGET_BITS_FLAGS
fi
fi fi
AC_CHECK_SIZEOF([int *], [1111])
CXXFLAGS="$OLD_CXXFLAGS"
AC_LANG_POP(C++)
# keep track of c/cxx flags that we added outselves...
# to prevent emitting warning...
ADDED_CFLAGS=
ADDED_CXXFLAGS=
ADDED_LDFLAGS=
if test "x$ac_cv_sizeof_int_p" = x0; then
# The test failed, lets pick the assumed value.
ARCH_DATA_MODEL=$OPENJDK_TARGET_CPU_BITS
else
ARCH_DATA_MODEL=`expr 8 \* $ac_cv_sizeof_int_p`
if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then # Make compilation sanity check
ADDED_CFLAGS=" -m${with_target_bits}" AC_CHECK_HEADERS([stdio.h], , [
ADDED_CXXFLAGS=" -m${with_target_bits}" AC_MSG_NOTICE([Failed to compile stdio.h. This likely implies missing compile dependencies.])
ADDED_LDFLAGS=" -m${with_target_bits}" if test "x$COMPILE_TYPE" = xreduced; then
AC_MSG_NOTICE([You are doing a reduced build. Check that you have 32-bit libraries installed.])
elif test "x$COMPILE_TYPE" = xcross; then
AC_MSG_NOTICE([You are doing a cross-compilation. Check that you have all target platform libraries installed.])
fi
AC_MSG_ERROR([Cannot continue.])
])
CFLAGS="${CFLAGS}${ADDED_CFLAGS}" AC_CHECK_SIZEOF([int *], [1111])
CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}" if test "x$SIZEOF_INT_P" != "x$ac_cv_sizeof_int_p"; then
CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}" # Workaround autoconf bug, see http://lists.gnu.org/archive/html/autoconf/2010-07/msg00004.html
LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}" SIZEOF_INT_P="$ac_cv_sizeof_int_p"
fi
fi fi
if test "x$ARCH_DATA_MODEL" = x64; then if test "x$SIZEOF_INT_P" = x; then
A_LP64="LP64:=" # The test failed, lets stick to the assumed value.
ADD_LP64="-D_LP64=1" AC_MSG_WARN([The number of bits in the target could not be determined, using $OPENJDK_TARGET_CPU_BITS.])
fi else
AC_MSG_CHECKING([for target address size]) TESTED_TARGET_CPU_BITS=`expr 8 \* $SIZEOF_INT_P`
AC_MSG_RESULT([$ARCH_DATA_MODEL bits])
AC_SUBST(LP64,$A_LP64)
AC_SUBST(ARCH_DATA_MODEL)
if test "x$ARCH_DATA_MODEL" != "x$OPENJDK_TARGET_CPU_BITS"; then if test "x$TESTED_TARGET_CPU_BITS" != "x$OPENJDK_TARGET_CPU_BITS"; then
AC_MSG_ERROR([The tested number of bits in the target ($ARCH_DATA_MODEL) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)]) AC_MSG_ERROR([The tested number of bits in the target ($TESTED_TARGET_CPU_BITS) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
fi
fi fi
# AC_MSG_CHECKING([for target address size])
# NOTE: check for -mstackrealign needs to be below potential addition of -m32 AC_MSG_RESULT([$OPENJDK_TARGET_CPU_BITS bits])
#
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
# While waiting for a better solution, the current workaround is to use -mstackrealign.
CFLAGS="$CFLAGS -mstackrealign"
AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
])
fi
]) ])
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
...@@ -478,21 +453,7 @@ AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="univ ...@@ -478,21 +453,7 @@ AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="univ
if test "x$ENDIAN" = xuniversal_endianness; then if test "x$ENDIAN" = xuniversal_endianness; then
AC_MSG_ERROR([Building with both big and little endianness is not supported]) AC_MSG_ERROR([Building with both big and little endianness is not supported])
fi fi
if test "x$ENDIAN" = xunknown; then
ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN"
fi
if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then
AC_MSG_WARN([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)])
ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN"
fi fi
AC_SUBST(ENDIAN)
])
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ISADIR],
[
###############################################################################
#
# Could someone enlighten this configure script with a comment about libCrun?
#
#
]) ])
...@@ -250,31 +250,8 @@ fi ...@@ -250,31 +250,8 @@ fi
AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS], AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
[ [
LANGTOOLS_OUTPUTDIR="$OUTPUT_ROOT/langtools" BUILD_OUTPUT="$OUTPUT_ROOT"
CORBA_OUTPUTDIR="$OUTPUT_ROOT/corba" AC_SUBST(BUILD_OUTPUT)
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)
LANGTOOLS_DIST="$OUTPUT_ROOT/langtools/dist" JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
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)
]) ])
...@@ -23,7 +23,11 @@ ...@@ -23,7 +23,11 @@
# questions. # 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@' # using 'configure @CONFIGURE_COMMAND_LINE@'
# When calling macros, the spaces between arguments are # When calling macros, the spaces between arguments are
...@@ -40,6 +44,17 @@ DQUOTE:=" ...@@ -40,6 +44,17 @@ DQUOTE:="
define NEWLINE:= define NEWLINE:=
endef 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. # Pass along the verbosity setting.
ifeq (,$(findstring VERBOSE=,$(MAKE))) ifeq (,$(findstring VERBOSE=,$(MAKE)))
...@@ -51,27 +66,16 @@ ifeq (,$(findstring -R,$(MAKE))) ...@@ -51,27 +66,16 @@ ifeq (,$(findstring -R,$(MAKE)))
MAKE:=$(MAKE) -R MAKE:=$(MAKE) -R
endif 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. # Specify where the common include directory for makefiles is.
ifeq (,$(findstring -I @SRC_ROOT@/common/makefiles,$(MAKE))) ifeq (,$(findstring -I @SRC_ROOT@/common/makefiles,$(MAKE)))
MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles
endif endif
# A self-referential reference to this file.
SPEC:=@SPEC@
# The "human readable" name of this configuration # The "human readable" name of this configuration
CONF_NAME:=@CONF_NAME@ CONF_NAME:=@CONF_NAME@
# The built jdk will run in this target system. # The built jdk will run in this target system.
OPENJDK_TARGET_SYSTEM:=@OPENJDK_TARGET_SYSTEM@
OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@ OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
OPENJDK_TARGET_OS_FAMILY:=@OPENJDK_TARGET_OS_FAMILY@
OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@ OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@
OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@ OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
...@@ -79,12 +83,20 @@ OPENJDK_TARGET_CPU_ARCH:=@OPENJDK_TARGET_CPU_ARCH@ ...@@ -79,12 +83,20 @@ OPENJDK_TARGET_CPU_ARCH:=@OPENJDK_TARGET_CPU_ARCH@
OPENJDK_TARGET_CPU_BITS:=@OPENJDK_TARGET_CPU_BITS@ OPENJDK_TARGET_CPU_BITS:=@OPENJDK_TARGET_CPU_BITS@
OPENJDK_TARGET_CPU_ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@ 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. # We are building on this build system.
# When not cross-compiling, it is the same as the target. # When not cross-compiling, it is the same as the target.
OPENJDK_BUILD_SYSTEM:=@OPENJDK_BUILD_SYSTEM@
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@ OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
OPENJDK_BUILD_OS_FAMILY:=@OPENJDK_BUILD_OS_FAMILY@
OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@ OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@
OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@ OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@
...@@ -96,21 +108,6 @@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@ ...@@ -96,21 +108,6 @@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@ REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@ 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@ @SET_OPENJDK@
JIGSAW:=@JIGSAW@ JIGSAW:=@JIGSAW@
LIBM:=-lm LIBM:=-lm
...@@ -143,6 +140,9 @@ JAXWS_TOPDIR:=@JAXWS_TOPDIR@ ...@@ -143,6 +140,9 @@ JAXWS_TOPDIR:=@JAXWS_TOPDIR@
HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@ HOTSPOT_TOPDIR:=@HOTSPOT_TOPDIR@
COPYRIGHT_YEAR:=@COPYRIGHT_YEAR@ 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. # Information gathered from the version.numbers file.
JDK_MAJOR_VERSION:=@JDK_MAJOR_VERSION@ JDK_MAJOR_VERSION:=@JDK_MAJOR_VERSION@
JDK_MINOR_VERSION:=@JDK_MINOR_VERSION@ JDK_MINOR_VERSION:=@JDK_MINOR_VERSION@
...@@ -171,17 +171,12 @@ DEBUG_LEVEL:=@DEBUG_LEVEL@ ...@@ -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. # The JDK variant is a name for a specific set of modules to be compiled for the JDK.
JDK_VARIANT:=@JDK_VARIANT@ 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 with a graphical UI? (ie headful)
# Should we compile support for running without? (ie headless) # Should we compile support for running without? (ie headless)
SUPPORT_HEADFUL:=@SUPPORT_HEADFUL@ SUPPORT_HEADFUL:=@SUPPORT_HEADFUL@
SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@ SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
# Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options. # Legacy defines controlled by the SUPPORT_HEADLESS and SUPPORT_HEADFUL options.
@BUILD_HEADLESS@ @BUILD_HEADLESS@
@BUILD_HEADLESS_ONLY@
# These are the libjvms that we want to build. # These are the libjvms that we want to build.
# The java launcher uses the default. # The java launcher uses the default.
...@@ -194,53 +189,43 @@ JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@ ...@@ -194,53 +189,43 @@ JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@
JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@ JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@ JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
# Legacy setting: OPT or DBG # Universal binaries on macosx
VARIANT:=@VARIANT@ MACOSX_UNIVERSAL=@MACOSX_UNIVERSAL@
# Legacy setting: true or false
FASTDEBUG:=@FASTDEBUG@
# Legacy setting: debugging the class files?
DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
# Legacy setting: -debug or -fastdebug # Legacy setting: -debug or -fastdebug
# Still used in version string...
BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@ BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
LANGTOOLS_OUTPUTDIR:=@LANGTOOLS_OUTPUTDIR@ # JDK_OUTPUTDIR specifies where a working jvm is built.
CORBA_OUTPUTDIR:=@CORBA_OUTPUTDIR@
JAXP_OUTPUTDIR:=@JAXP_OUTPUTDIR@
JAXWS_OUTPUTDIR:=@JAXWS_OUTPUTDIR@
HOTSPOT_OUTPUTDIR:=@HOTSPOT_OUTPUTDIR@
# This where a working jvm is built.
# You can run $(JDK_OUTPUTDIR)/bin/java # You can run $(JDK_OUTPUTDIR)/bin/java
# Though the layout of the contents of $(JDK_OUTPUTDIR) is not # Though the layout of the contents of $(JDK_OUTPUTDIR) is not
# yet the same as a default installation. # yet the same as a default installation.
JDK_OUTPUTDIR:=@OUTPUT_ROOT@/jdk #
# When you run "make install" it will create the standardized # 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 # Then it will copy the contents of the jdk into the installation
# directory. # 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 BUILD_OUTPUT:=@BUILD_OUTPUT@
JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image LANGTOOLS_OUTPUTDIR=$(BUILD_OUTPUT)/langtools
JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image CORBA_OUTPUTDIR=$(BUILD_OUTPUT)/corba
JAXP_OUTPUTDIR=$(BUILD_OUTPUT)/jaxp
# Can be /sparcv9 or /amd64 on Solaris JAXWS_OUTPUTDIR=$(BUILD_OUTPUT)/jaxws
ISA_DIR:=@LEGACY_OPENJDK_TARGET_CPU3@ HOTSPOT_OUTPUTDIR=$(BUILD_OUTPUT)/hotspot
BINDIR:=$(JDK_OUTPUTDIR)/bin$(ISA_DIR) 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 # The boot jdk to use
ALT_BOOTDIR:=@BOOT_JDK@
BOOT_JDK:=@BOOT_JDK@ BOOT_JDK:=@BOOT_JDK@
BOOT_JDK_JVMARGS:=@BOOT_JDK_JVMARGS@ BOOT_JDK_JVMARGS:=@BOOT_JDK_JVMARGS@
BOOT_RTJAR:=@BOOT_RTJAR@ 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 # When compiling Java source to be run by the boot jdk
# use these extra flags, eg -source 6 -target 6 # use these extra flags, eg -source 6 -target 6
...@@ -248,30 +233,18 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@ ...@@ -248,30 +233,18 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
# Information about the build system # Information about the build system
NUM_CORES:=@NUM_CORES@ NUM_CORES:=@NUM_CORES@
# This is used from the jdk build for C/C++ code. # Enable sjavac support = use a javac server,
PARALLEL_COMPILE_JOBS:=@CONCURRENT_BUILD_JOBS@ # multi core javac compilation and dependency tracking.
# Store javac server synchronization files here, and ENABLE_SJAVAC:=@ENABLE_SJAVAC@
# the javac server log files. # Store sjavac server synchronization files here, and
JAVAC_SERVERS:=@JAVAC_SERVERS@ # the sjavac server log files.
# Should we use a javac server or not? The javac server gives SJAVAC_SERVER_DIR:=@SJAVAC_SERVER_DIR@
# 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@
# We can block the Javac server to never use more cores than this. # 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 # This is not for performance reasons, but for memory usage, since each
# core requires its own JavaCompiler. We might have 64 cores and 4GB # core requires its own JavaCompiler. We might have 64 cores and 4GB
# of memory, 64 JavaCompilers will currently not fit in a 3GB heap. # of memory, 64 JavaCompilers will currently not fit in a 3GB heap.
# Since there is no sharing of data between the JavaCompilers. # Since there is no sharing of data between the JavaCompilers.
JAVAC_SERVER_CORES:=@JAVAC_SERVER_CORES@ SJAVAC_SERVER_CORES:=@SJAVAC_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@
# The OpenJDK makefiles should be changed to using the standard # The OpenJDK makefiles should be changed to using the standard
# configure output ..._CFLAGS and ..._LIBS. In the meantime we # configure output ..._CFLAGS and ..._LIBS. In the meantime we
...@@ -280,7 +253,6 @@ FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@ ...@@ -280,7 +253,6 @@ FREETYPE2_LIB_PATH:=@FREETYPE2_LIB_PATH@
FREETYPE2_LIBS:=@FREETYPE2_LIBS@ FREETYPE2_LIBS:=@FREETYPE2_LIBS@
FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@ FREETYPE2_CFLAGS:=@FREETYPE2_CFLAGS@
USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@ USING_SYSTEM_FT_LIB=@USING_SYSTEM_FT_LIB@
ALT_CUPS_HEADERS_PATH:=$(patsubst -I%,%,$(filter -I%,@CUPS_CFLAGS@))
CUPS_CFLAGS:=@CUPS_CFLAGS@ CUPS_CFLAGS:=@CUPS_CFLAGS@
PACKAGE_PATH=@PACKAGE_PATH@ PACKAGE_PATH=@PACKAGE_PATH@
...@@ -288,8 +260,6 @@ PACKAGE_PATH=@PACKAGE_PATH@ ...@@ -288,8 +260,6 @@ PACKAGE_PATH=@PACKAGE_PATH@
# Source file for cacerts # Source file for cacerts
CACERTS_FILE=@CACERTS_FILE@ CACERTS_FILE=@CACERTS_FILE@
#MOZILLA_HEADERS_PATH:=
# Necessary additional compiler flags to compile X11 # Necessary additional compiler flags to compile X11
X_CFLAGS:=@X_CFLAGS@ X_CFLAGS:=@X_CFLAGS@
X_LIBS:=@X_LIBS@ X_LIBS:=@X_LIBS@
...@@ -338,7 +308,7 @@ OBJC:=@CCACHE@ @OBJC@ ...@@ -338,7 +308,7 @@ OBJC:=@CCACHE@ @OBJC@
CPP:=@UNCYGDRIVE@ @CPP@ CPP:=@UNCYGDRIVE@ @CPP@
#CPPFLAGS:=@CPPFLAGS@ #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@ LD:=@UNCYGDRIVE@ @LD@
# LDFLAGS used to link the jdk native libraries (C-code) # LDFLAGS used to link the jdk native libraries (C-code)
...@@ -353,6 +323,9 @@ LDEXE:=@UNCYGDRIVE@ @LDEXE@ ...@@ -353,6 +323,9 @@ LDEXE:=@UNCYGDRIVE@ @LDEXE@
LDFLAGS_JDKEXE:=@LDFLAGS_JDKEXE@ LDFLAGS_JDKEXE:=@LDFLAGS_JDKEXE@
LDFLAGS_JDKEXE_SUFFIX:=@LDFLAGS_JDKEXE_SUFFIX@ 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 # Sometimes a different linker is needed for c++ libs
LDCXX:=@UNCYGDRIVE@ @LDCXX@ LDCXX:=@UNCYGDRIVE@ @LDCXX@
# The flags for linking libstdc++ linker. # The flags for linking libstdc++ linker.
...@@ -361,28 +334,22 @@ LIBCXX:=@LIBCXX@ ...@@ -361,28 +334,22 @@ LIBCXX:=@LIBCXX@
# Sometimes a different linker is needed for c++ executables # Sometimes a different linker is needed for c++ executables
LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@ LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@
# If cross compiling, then define CROSS_COMPILE_ARCH:=cpu_name here. # BUILD_CC/BUILD_LD is a compiler/linker that generates code that is runnable on the
@DEFINE_CROSS_COMPILE_ARCH@ # build platform.
# The HOSTCC should really be named BUILDCC, ie build executable for BUILD_CC:=@UNCYGDRIVE@ @BUILD_CC@
# the build platform. Same as CC when not cross compiling. BUILD_LD:=@UNCYGDRIVE@ @BUILD_LD@
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@
AS:=@UNCYGDRIVE@ @AS@ 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@ AR:=@UNCYGDRIVE@ @AR@
ARFLAGS:=@ARFLAGS@ ARFLAGS:=@ARFLAGS@
NM:=@UNCYGDRIVE@ @NM@ NM:=@NM@
STRIP:=@UNCYGDRIVE@ @STRIP@ STRIP:=@STRIP@
MCS:=@UNCYGDRIVE@ @MCS@ MCS:=@MCS@
LIPO:=@LIPO@
# Command to create a shared library # Command to create a shared library
SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@ SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
...@@ -414,6 +381,7 @@ SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@ ...@@ -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. # 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) # (Note absence of := assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_ORIGIN=@SET_SHARED_LIBRARY_ORIGIN@ SET_SHARED_LIBRARY_ORIGIN=@SET_SHARED_LIBRARY_ORIGIN@
SET_EXECUTABLE_ORIGIN=@SET_EXECUTABLE_ORIGIN@
# Different OS:es have different ways of naming shared libraries. # Different OS:es have different ways of naming shared libraries.
# The SHARED_LIBRARY macro takes "verify" as and argument and returns: # The SHARED_LIBRARY macro takes "verify" as and argument and returns:
...@@ -432,21 +400,20 @@ POST_MCS_CMD:=@POST_MCS_CMD@ ...@@ -432,21 +400,20 @@ POST_MCS_CMD:=@POST_MCS_CMD@
JAVA_FLAGS:=@BOOT_JDK_JVMARGS@ JAVA_FLAGS:=@BOOT_JDK_JVMARGS@
JAVA=@UNCYGDRIVE@ @JAVA@ $(JAVA_FLAGS) JAVA=@UNCYGDRIVE@ $(BOOT_JDK)/bin/java $(JAVA_FLAGS)
JAVAC:=@UNCYGDRIVE@ @JAVAC@
JAVAC_FLAGS:=@JAVAC_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@ NATIVE2ASCII=@UNCYGDRIVE@ $(BOOT_JDK)/bin/native2ascii
BOOT_JAR_JFLAGS:=
# Base flags for RC # Base flags for RC
# Guarding this against resetting value. Legacy make files include spec multiple # Guarding this against resetting value. Legacy make files include spec multiple
...@@ -456,11 +423,12 @@ RC_FLAGS:=@RC_FLAGS@ ...@@ -456,11 +423,12 @@ RC_FLAGS:=@RC_FLAGS@
endif endif
# A specific java binary with specific options can be used to run # A specific java binary with specific options can be used to run
# the long running background javac server and other long running tasks. # the long running background sjavac servers and other long running tasks.
SERVER_JAVA:=@UNCYGDRIVE@ @SERVER_JAVA@ SJAVAC_SERVER_JAVA:=@UNCYGDRIVE@ @SJAVAC_SERVER_JAVA@
# Tools adhering to a minimal and common standard of posix compliance. # Tools adhering to a minimal and common standard of posix compliance.
AWK:=@AWK@ AWK:=@AWK@
BASENAME:=@BASENAME@
CAT:=@CAT@ CAT:=@CAT@
CCACHE:=@CCACHE@ CCACHE:=@CCACHE@
# CD is going away, but remains to cater for legacy makefiles. # CD is going away, but remains to cater for legacy makefiles.
...@@ -520,8 +488,6 @@ BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@ ...@@ -520,8 +488,6 @@ BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@ BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
# Build setup # Build setup
ENABLE_DOCS:=@ENABLE_DOCS@
GENERATE_DOCS:=@ENABLE_DOCS@
DISABLE_NIMBUS:=@DISABLE_NIMBUS@ DISABLE_NIMBUS:=@DISABLE_NIMBUS@
ENABLE_JFR=@ENABLE_JFR@ ENABLE_JFR=@ENABLE_JFR@
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
...@@ -559,17 +525,6 @@ else ...@@ -559,17 +525,6 @@ else
OVR_SRCS:= OVR_SRCS:=
endif 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 # INSTALLATION
...@@ -634,5 +589,5 @@ OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@ ...@@ -634,5 +589,5 @@ OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
OS_VERSION_MINOR:=@OS_VERSION_MINOR@ OS_VERSION_MINOR:=@OS_VERSION_MINOR@
OS_VERSION_MICRO:=@OS_VERSION_MICRO@ OS_VERSION_MICRO:=@OS_VERSION_MICRO@
# Include the closed-spec.gmk file if it exists # Include the custom-spec.gmk file if it exists
-include $(dir @SPEC@)/closed-spec.gmk -include $(dir @SPEC@)/custom-spec.gmk
...@@ -23,505 +23,14 @@ ...@@ -23,505 +23,14 @@
# questions. # questions.
# #
# Configured"@DATE_WHEN_CONFIGURED@ to build for a @OPENJDK_TARGET_SYSTEM@ system,
# using 'configure @CONFIGURE_COMMAND_LINE@'
# 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@"
OPENJDK_TARGET_CPU_ARCH="@OPENJDK_TARGET_CPU_ARCH@"
OPENJDK_TARGET_CPU_BITS="@OPENJDK_TARGET_CPU_BITS@"
OPENJDK_TARGET_CPU_ENDIAN="@OPENJDK_TARGET_CPU_ENDIAN@"
# 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@"
OPENJDK_BUILD_CPU_ARCH="@OPENJDK_BUILD_CPU_ARCH@"
OPENJDK_BUILD_CPU_BITS="@OPENJDK_BUILD_CPU_BITS@"
OPENJDK_BUILD_CPU_ENDIAN="@OPENJDK_BUILD_CPU_ENDIAN@"
# Legacy OS values for use in release file.
REQUIRED_OS_NAME="@REQUIRED_OS_NAME@"
REQUIRED_OS_VERSION="@REQUIRED_OS_VERSION@"
# Old name for 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
ENDIAN="@OPENJDK_TARGET_CPU_ENDIAN@"
JIGSAW="@JIGSAW@"
LIBM=-lm
LIBDL="@LIBDL@"
# colon or semicolon
PATH_SEP="@PATH_SEP@"
# The sys root where standard headers and libraries are found.
# Usually not needed since the configure script should have
# taken it into account already when setting CFLAGS et al.
SYS_ROOT="@SYS_ROOT@"
# Paths to the source code
SRC_ROOT="@SRC_ROOT@"
ADD_SRC_ROOT="@ADD_SRC_ROOT@"
OVERRIDE_SRC_ROOT="@OVERRIDE_SRC_ROOT@"
TOPDIR="@SRC_ROOT@"
OUTPUT_ROOT="@OUTPUT_ROOT@"
JDK_MAKE_SHARED_DIR="@JDK_TOPDIR@"/makefiles/common/shared
JDK_TOPDIR="@JDK_TOPDIR@"
LANGTOOLS_TOPDIR="@LANGTOOLS_TOPDIR@"
CORBA_TOPDIR="@CORBA_TOPDIR@"
JAXP_TOPDIR="@JAXP_TOPDIR@"
JAXWS_TOPDIR="@JAXWS_TOPDIR@"
HOTSPOT_TOPDIR="@HOTSPOT_TOPDIR@"
COPYRIGHT_YEAR="@COPYRIGHT_YEAR@"
# Information gathered from the version.numbers file.
JDK_MAJOR_VERSION="@JDK_MAJOR_VERSION@"
JDK_MINOR_VERSION="@JDK_MINOR_VERSION@"
JDK_MICRO_VERSION="@JDK_MICRO_VERSION@"
JDK_UPDATE_VERSION="@JDK_UPDATE_VERSION@"
JDK_BUILD_NUMBER="@JDK_BUILD_NUMBER@"
MILESTONE="@MILESTONE@"
LAUNCHER_NAME="@LAUNCHER_NAME@"
PRODUCT_NAME="@PRODUCT_NAME@"
PRODUCT_SUFFIX="@PRODUCT_SUFFIX@"
JDK_RC_PLATFORM_NAME="@JDK_RC_PLATFORM_NAME@"
COMPANY_NAME="@COMPANY_NAME@"
# Different version strings generated from the above information.
JDK_VERSION="@JDK_VERSION@"
RUNTIME_NAME="@RUNTIME_NAME@"
FULL_VERSION="@FULL_VERSION@"
JRE_RELEASE_VERSION="@FULL_VERSION@"
RELEASE="@RELEASE@"
COOKED_BUILD_NUMBER="@COOKED_BUILD_NUMBER@"
# How to compile the code: release, fastdebug or slowdebug
DEBUG_LEVEL="@DEBUG_LEVEL@"
# This is the JDK variant to build.
# The JDK variant is a name for a specific set of modules to be compiled for the JDK.
JDK_VARIANT="@JDK_VARIANT@"
# 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@"
# These are the libjvms that we want to build.
# The java launcher uses the default.
# The other can be selected by specifying -client -server -kernel -zero or -zeroshark
# on the java launcher command line.
JVM_VARIANTS="@JVM_VARIANTS@"
JVM_VARIANT_SERVER="@JVM_VARIANT_SERVER@"
JVM_VARIANT_CLIENT="@JVM_VARIANT_CLIENT@"
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@"
# Legacy setting: -debug or -fastdebug
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.
# 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.
# 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}"
# 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@"
# When compiling Java source to be run by the boot jdk
# use these extra flags, eg -source 6 -target 6
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@"
# 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@"
# The OpenJDK makefiles should be changed to using the standard
# configure output ..._CFLAGS and ..._LIBS. In the meantime we
# extract the information here.
FREETYPE2_LIB_PATH="@FREETYPE2_LIB_PATH@"
FREETYPE2_LIBS="@FREETYPE2_LIBS@"
FREETYPE2_CFLAGS="@FREETYPE2_CFLAGS@"
USING_SYSTEM_FT_LIB="@USING_SYSTEM_FT_LIB@"
CUPS_CFLAGS="@CUPS_CFLAGS@"
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@"
OPENWIN_HOME="@OPENWIN_HOME@"
# There are two types: CC or CL
# CC is gcc and others behaving reasonably similar.
# CL is cl.exe only.
COMPILER_TYPE="@COMPILER_TYPE@"
# Flags used for overriding the default opt setting for a C/C++ source file.
C_O_FLAG_HIGHEST="@C_O_FLAG_HIGHEST@"
C_O_FLAG_HI="@C_O_FLAG_HI@"
C_O_FLAG_NORM="@C_O_FLAG_NORM@"
C_O_FLAG_NONE="@C_O_FLAG_NONE@"
CXX_O_FLAG_HIGHEST="@CXX_O_FLAG_HIGHEST@"
CXX_O_FLAG_HI="@CXX_O_FLAG_HI@"
CXX_O_FLAG_NORM="@CXX_O_FLAG_NORM@"
CXX_O_FLAG_NONE="@CXX_O_FLAG_NONE@"
C_FLAG_DEPS="@C_FLAG_DEPS@"
CXX_FLAG_DEPS="@CXX_FLAG_DEPS@"
# Tools that potentially need to be cross compilation aware.
CC="@UNCYGDRIVE@ @CCACHE@ @CC@"
# CFLAGS used to compile the jdk native libraries (C-code)
CFLAGS_JDKLIB="@CFLAGS_JDKLIB@"
CXXFLAGS_JDKLIB="@CXXFLAGS_JDKLIB@"
# CFLAGS used to compile the jdk native launchers (C-code)
CFLAGS_JDKEXE="@CFLAGS_JDKEXE@"
CXXFLAGS_JDKEXE="@CXXFLAGS_JDKEXE@"
CXX="@UNCYGDRIVE@ @CCACHE@ @CXX@"
#CXXFLAGS="@CXXFLAGS@"
OBJC="@CCACHE@ @OBJC@"
#OBJCFLAGS="@OBJCFLAGS@"
CPP="@UNCYGDRIVE@ @CPP@"
#CPPFLAGS="@CPPFLAGS@"
# The linker can be gcc or ld on posix systems, or link.exe on winapi systems.
LD="@UNCYGDRIVE@ @LD@"
# LDFLAGS used to link the jdk native libraries (C-code)
LDFLAGS_JDKLIB="@LDFLAGS_JDKLIB@"
LDFLAGS_JDKLIB_SUFFIX="@LDFLAGS_JDKLIB_SUFFIX@"
# On some platforms the linker cannot be used to create executables, thus
# the need for a separate LDEXE command.
LDEXE="@UNCYGDRIVE@ @LDEXE@"
# LDFLAGS used to link the jdk native launchers (C-code)
LDFLAGS_JDKEXE="@LDFLAGS_JDKEXE@"
LDFLAGS_JDKEXE_SUFFIX="@LDFLAGS_JDKEXE_SUFFIX@"
# Sometimes a different linker is needed for c++ libs
LDCXX="@UNCYGDRIVE@ @LDCXX@"
# The flags for linking libstdc++ linker.
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.
# The HOSTCC should really be named BUILDCC, ie build executable for
# the build platform. Same as CC when not cross compiling.
HOSTCC="@HOSTCC@"
HOSTCXX="@HOSTCXX@"
# And of course, the jdk spells HOSTCC as NIO_CC/HOST_CC
HOST_CC="@HOSTCC@"
NIO_CC="@HOSTCC@"
AS="@AS@"
ASFLAGS="@ASFLAGS@"
# AR is used to create a static library (is ar in posix, lib.exe in winapi)
AR="@UNCYGDRIVE@ @AR@"
ARFLAGS="@ARFLAGS@"
NM="@NM@"
STRIP="@STRIP@"
MCS="@MCS@"
# Command to create a shared library
SHARED_LIBRARY_FLAGS="@SHARED_LIBRARY_FLAGS@"
# Options to linker to specify a mapfile.
# (Note absence of = assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_MAPFILE="@SET_SHARED_LIBRARY_MAPFILE@"
# Options for C/CXX compiler to be used if linking is performed
# using reorder file
C_FLAG_REORDER="@C_FLAG_REORDER@"
CXX_FLAG_REORDER="@CXX_FLAG_REORDER@"
#
# Options for generating debug symbols
ENABLE_DEBUG_SYMBOLS="@ENABLE_DEBUG_SYMBOLS@"
CFLAGS_DEBUG_SYMBOLS="@CFLAGS_DEBUG_SYMBOLS@"
CXXFLAGS_DEBUG_SYMBOLS="@CXXFLAGS_DEBUG_SYMBOLS@"
ZIP_DEBUGINFO_FILES="@ZIP_DEBUGINFO_FILES@"
# Options to linker to specify the library name.
# (Note absence of = assignment, because we do not want to evaluate the macro body here)
SET_SHARED_LIBRARY_NAME="@SET_SHARED_LIBRARY_NAME@"
# 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@"
# Different OS:es have different ways of naming shared libraries.
# The SHARED_LIBRARY macro takes "verify" as and argument and returns:
# "libverify.so" or "libverify.dylib" or "verify.dll" depending on platform.
# (Note absence of = assignment, because we do not want to evaluate the macro body here)
SHARED_LIBRARY="@SHARED_LIBRARY@"
STATIC_LIBRARY="@STATIC_LIBRARY@"
LIBRARY_PREFIX="@LIBRARY_PREFIX@"
SHARED_LIBRARY_SUFFIX="@SHARED_LIBRARY_SUFFIX@"
STATIC_LIBRARY_SUFFIX="@STATIC_LIBRARY_SUFFIX@"
EXE_SUFFIX="@EXE_SUFFIX@"
OBJ_SUFFIX="@OBJ_SUFFIX@"
POST_STRIP_CMD="@POST_STRIP_CMD@"
POST_MCS_CMD='@POST_MCS_CMD@'
JAVA_FLAGS="@BOOT_JDK_JVMARGS@"
JAVA="@UNCYGDRIVE@ @JAVA@ ${JAVA_FLAGS}"
JAVAC="@UNCYGDRIVE@ @JAVAC@"
JAVAC_FLAGS="@JAVAC_FLAGS@"
JAVAH="@UNCYGDRIVE@ @JAVAH@"
JAR="@UNCYGDRIVE@ @JAR@"
RMIC="@UNCYGDRIVE@ @RMIC@"
NATIVE2ASCII="@UNCYGDRIVE@ @NATIVE2ASCII@"
BOOT_JAR_CMD="@UNCYGDRIVE@ @JAR@"
BOOT_JAR_JFLAGS=
# Tools adhering to a minimal and common standard of posix compliance.
AWK="@AWK@"
CAT="@CAT@" CAT="@CAT@"
CCACHE="@CCACHE@"
# CD is going away, but remains to cater for legacy makefiles.
CD=cd CD=cd
CHMOD="@CHMOD@"
CP="@CP@" CP="@CP@"
CPIO="@CPIO@"
CUT="@CUT@"
DATE="@DATE@"
DF="@DF@"
DIFF="@DIFF@" DIFF="@DIFF@"
FIND="@FIND@"
FIND_DELETE="@FIND_DELETE@"
ECHO="@ECHO@" ECHO="@ECHO@"
EGREP="@EGREP@" FIND="@FIND@"
FGREP="@FGREP@"
GREP="@GREP@" GREP="@GREP@"
HEAD="@HEAD@"
LS="@LS@"
LN="@LN@"
MKDIR="@MKDIR@"
MV="@MV@"
NAWK="@NAWK@"
PRINTF="@PRINTF@"
PWD="@THEPWDCMD@"
RM="@RM@" RM="@RM@"
SED="@SED@" SED="@SED@"
SH="@SH@"
SORT="@SORT@"
TAR="@TAR@"
TAIL="@TAIL@"
TEE="@TEE@"
TR="@TR@"
TOUCH="@TOUCH@"
WC="@WC@"
XARGS="@XARGS@"
ZIPEXE="@ZIP@"
ZIP="@ZIP@"
UNZIP="@UNZIP@"
MT="@UNCYGDRIVE@ @MT@"
RC="@UNCYGDRIVE@ @RC@"
DUMPBIN="@UNCYGDRIVE@ @DUMPBIN@"
CYGPATH="@CYGPATH@"
LDD="@LDD@"
OTOOL="@OTOOL@"
READELF="@READELF@"
EXPR="@EXPR@"
FILE="@FILE@"
HG="@HG@"
OBJCOPY="@OBJCOPY@"
UNCYGDRIVE="@UNCYGDRIVE@"
# Build setup
ENABLE_DOCS="@ENABLE_DOCS@"
GENERATE_DOCS="@ENABLE_DOCS@"
DISABLE_NIMBUS="@DISABLE_NIMBUS@"
USE_EXTERNAL_LIBJPEG="@USE_EXTERNAL_LIBJPEG@"
USE_EXTERNAL_LIBGIF="@USE_EXTERNAL_LIBGIF@"
USE_EXTERNAL_LIBZ="@USE_EXTERNAL_LIBZ@"
LIBZIP_CAN_USE_MMAP="@LIBZIP_CAN_USE_MMAP@"
CHECK_FOR_VCINSTALLDIR="@CHECK_FOR_VCINSTALLDIR@"
MSVCRNN_DLL="@MSVCR100DLL@"
####################################################
#
# Legacy Hotspot support
HOTSPOT_DIST="@HOTSPOT_DIST@" POST_STRIP_CMD="@POST_STRIP_CMD@"
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
#
# Common prefix for all installed files. Defaults to /usr/local,
# but /opt/myjdk is another common version.
INSTALL_PREFIX="@prefix@"
# Directories containing architecture-dependent files should be relative to exec_prefix
INSTALL_EXECPREFIX="@exec_prefix@"
# java,javac,javah,javap etc are installed here.
INSTALL_BINDIR="@bindir@"
# Read only architecture-independent data
INSTALL_DATADIR="@datadir@"
# Root of above.
INSTALL_DATAROOTDIR="@datarootdir@"
# Doc files, other than info and man.
INSTALL_DOCDIR="@docdir@"
# Html documentation
INSTALL_HTMLDIR="@htmldir@"
# Installing C header files, JNI headers for example.
INSTALL_INCLUDEDIR="@includedir@"
# Installing library files....
INSTALL_INCLUDEDIR="@libdir@"
# Executables that other programs run.
INSTALL_LIBEXECDIR="@libexecdir@"
# Locale-dependent but architecture-independent data, such as message catalogs.
INSTALL_LOCALEDIR="@localedir@"
# Modifiable single-machine data
INSTALL_LOCALSTATEDIR="@localstatedir@"
# Man pages
INSTALL_MANDIR="@mandir@"
# Modifiable architecture-independent data.
INSTALL_SHAREDSTATEDIR="@sharedstatedir@"
# Read-only single-machine data
INSTALL_SYSCONFDIR="@sysconfdir@"
####################################################
#
# Misc
#
# Name of Service Agent library
SALIB_NAME="@SALIB_NAME@"
OS_VERSION_MAJOR="@OS_VERSION_MAJOR@"
OS_VERSION_MINOR="@OS_VERSION_MINOR@"
OS_VERSION_MICRO="@OS_VERSION_MICRO@"
...@@ -31,6 +31,19 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV], ...@@ -31,6 +31,19 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
# the set env variables into the spec file. # the set env variables into the spec file.
SETUPDEVENV="# No special vars" SETUPDEVENV="# No special vars"
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
# Store path to cygwin link.exe to help excluding it when searching for
# VS linker.
AC_PATH_PROG(CYGWIN_LINK, link)
AC_MSG_CHECKING([if the first found link.exe is actually the Cygwin link tool])
"$CYGWIN_LINK" --version > /dev/null
if test $? -eq 0 ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
# This might be the VS linker. Don't exclude it later on.
CYGWIN_LINK=""
fi
# If vcvarsall.bat has been run, then VCINSTALLDIR is set. # If vcvarsall.bat has been run, then VCINSTALLDIR is set.
if test "x$VCINSTALLDIR" != x; then if test "x$VCINSTALLDIR" != x; then
# No further setup is needed. The build will happen from this kind # No further setup is needed. The build will happen from this kind
...@@ -57,12 +70,12 @@ if test "x$OPENJDK_BUILD_OS" = "xwindows"; then ...@@ -57,12 +70,12 @@ if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
AC_MSG_ERROR([Tried to find a VS installation using both $SEARCH_ROOT but failed. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.]) AC_MSG_ERROR([Tried to find a VS installation using both $SEARCH_ROOT but failed. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.])
fi fi
case "$LEGACY_OPENJDK_TARGET_CPU1" in case "$OPENJDK_TARGET_CPU" in
i?86) x86)
VARSBAT_ARCH=x86 VARSBAT_ARCH=x86
;; ;;
*) x86_64)
VARSBAT_ARCH=$LEGACY_OPENJDK_TARGET_CPU1 VARSBAT_ARCH=amd64
;; ;;
esac esac
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat # Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
...@@ -122,9 +135,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS], ...@@ -122,9 +135,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS],
# Configure the development tool paths and potential sysroot. # Configure the development tool paths and potential sysroot.
# #
AC_LANG(C++) AC_LANG(C++)
DEVKIT=
SYS_ROOT=/
AC_SUBST(SYS_ROOT)
# The option used to specify the target .o,.a or .so file. # The option used to specify the target .o,.a or .so file.
# When compiling, how to specify the to be created object file. # When compiling, how to specify the to be created object file.
...@@ -153,44 +163,28 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_PATHS], ...@@ -153,44 +163,28 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_PATHS],
# Setting only --host, does not seem to be really supported. # Setting only --host, does not seem to be really supported.
# Please set both --build and --host if you want to cross compile. # Please set both --build and --host if you want to cross compile.
DEFINE_CROSS_COMPILE_ARCH="" if test "x$COMPILE_TYPE" = "xcross"; then
HOSTCC=""
HOSTCXX=""
HOSTLD=""
AC_SUBST(DEFINE_CROSS_COMPILE_ARCH)
AC_MSG_CHECKING([if this is a cross compile])
if test "x$OPENJDK_BUILD_SYSTEM" != "x$OPENJDK_TARGET_SYSTEM"; then
AC_MSG_RESULT([yes, from $OPENJDK_BUILD_SYSTEM to $OPENJDK_TARGET_SYSTEM])
# We have detected a cross compile!
DEFINE_CROSS_COMPILE_ARCH="CROSS_COMPILE_ARCH:=$LEGACY_OPENJDK_TARGET_CPU1"
# Now we to find a C/C++ compiler that can build executables for the build # Now we to find a C/C++ compiler that can build executables for the build
# platform. We can't use the AC_PROG_CC macro, since it can only be used # platform. We can't use the AC_PROG_CC macro, since it can only be used
# once. # once. Also, we need to do this before adding a tools dir to the path,
AC_PATH_PROGS(HOSTCC, [cl cc gcc]) # otherwise we might pick up cross-compilers which don't use standard naming.
WHICHCMD(HOSTCC) # Otherwise, we'll set the BUILD_tools to the native tools, but that'll have
AC_PATH_PROGS(HOSTCXX, [cl CC g++]) # to wait until they are properly discovered.
WHICHCMD(HOSTCXX) AC_PATH_PROGS(BUILD_CC, [cl cc gcc])
AC_PATH_PROG(HOSTLD, ld) SET_FULL_PATH(BUILD_CC)
WHICHCMD(HOSTLD) AC_PATH_PROGS(BUILD_CXX, [cl CC g++])
# Building for the build platform should be easy. Therefore SET_FULL_PATH(BUILD_CXX)
# we do not need any linkers or assemblers etc. AC_PATH_PROG(BUILD_LD, ld)
else SET_FULL_PATH(BUILD_LD)
AC_MSG_RESULT([no])
fi fi
AC_SUBST(BUILD_CC)
AC_SUBST(BUILD_CXX)
AC_SUBST(BUILD_LD)
# 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
fi
# If a devkit is found on the builddeps server, then prepend its path to the # If a devkit is found on the builddeps server, then prepend its path to the
# PATH variable. If there are cross compilers available in the devkit, these # PATH variable. If there are cross compilers available in the devkit, these
# will be found by AC_PROG_CC et al. # will be found by AC_PROG_CC et al.
DEVKIT=
BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx, BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
[# Found devkit [# Found devkit
PATH="$DEVKIT/bin:$PATH" PATH="$DEVKIT/bin:$PATH"
...@@ -218,21 +212,6 @@ ORG_CFLAGS="$CFLAGS" ...@@ -218,21 +212,6 @@ ORG_CFLAGS="$CFLAGS"
ORG_CXXFLAGS="$CXXFLAGS" ORG_CXXFLAGS="$CXXFLAGS"
ORG_OBJCFLAGS="$OBJCFLAGS" ORG_OBJCFLAGS="$OBJCFLAGS"
AC_ARG_WITH([tools-dir], [AS_HELP_STRING([--with-tools-dir],
[search this directory for 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])], [
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
])
# autoconf magic only relies on PATH, so update it if tools dir is specified # autoconf magic only relies on PATH, so update it if tools dir is specified
OLD_PATH="$PATH" OLD_PATH="$PATH"
if test "x$TOOLS_DIR" != x; then if test "x$TOOLS_DIR" != x; then
...@@ -251,7 +230,7 @@ if test "x$CC" = xcc && test "x$OPENJDK_BUILD_OS" = xmacosx; then ...@@ -251,7 +230,7 @@ if test "x$CC" = xcc && test "x$OPENJDK_BUILD_OS" = xmacosx; then
# Do not use cc on MacOSX use gcc instead. # Do not use cc on MacOSX use gcc instead.
CC="gcc" CC="gcc"
fi fi
WHICHCMD(CC) SET_FULL_PATH(CC)
AC_PROG_CXX([cl CC g++]) AC_PROG_CXX([cl CC g++])
if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then
...@@ -259,7 +238,7 @@ if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then ...@@ -259,7 +238,7 @@ if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then
# c++ code. Override. # c++ code. Override.
CXX="g++" CXX="g++"
fi fi
WHICHCMD(CXX) SET_FULL_PATH(CXX)
if test "x$CXX" = x || test "x$CC" = x; then if test "x$CXX" = x || test "x$CC" = x; then
HELP_MSG_MISSING_DEPENDENCY([devkit]) HELP_MSG_MISSING_DEPENDENCY([devkit])
...@@ -268,7 +247,7 @@ fi ...@@ -268,7 +247,7 @@ fi
if test "x$OPENJDK_BUILD_OS" != xwindows; then if test "x$OPENJDK_BUILD_OS" != xwindows; then
AC_PROG_OBJC AC_PROG_OBJC
WHICHCMD(OBJC) SET_FULL_PATH(OBJC)
else else
OBJC= OBJC=
fi fi
...@@ -279,19 +258,11 @@ CFLAGS="$ORG_CFLAGS" ...@@ -279,19 +258,11 @@ CFLAGS="$ORG_CFLAGS"
CXXFLAGS="$ORG_CXXFLAGS" CXXFLAGS="$ORG_CXXFLAGS"
OBJCFLAGS="$ORG_OBJCFLAGS" OBJCFLAGS="$ORG_OBJCFLAGS"
# If we are not cross compiling, use the same compilers for
# building the build platform executables.
if test "x$DEFINE_CROSS_COMPILE_ARCH" = x; then
HOSTCC="$CC"
HOSTCXX="$CXX"
fi
AC_CHECK_TOOL(LD, ld)
WHICHCMD(LD)
LD="$CC" LD="$CC"
LDEXE="$CC" LDEXE="$CC"
LDCXX="$CXX" LDCXX="$CXX"
LDEXECXX="$CXX" LDEXECXX="$CXX"
AC_SUBST(LD)
# LDEXE is the linker to use, when creating executables. # LDEXE is the linker to use, when creating executables.
AC_SUBST(LDEXE) AC_SUBST(LDEXE)
# Linking C++ libraries. # Linking C++ libraries.
...@@ -299,8 +270,10 @@ AC_SUBST(LDCXX) ...@@ -299,8 +270,10 @@ AC_SUBST(LDCXX)
# Linking C++ executables. # Linking C++ executables.
AC_SUBST(LDEXECXX) AC_SUBST(LDEXECXX)
AC_CHECK_TOOL(AR, ar) if test "x$OPENJDK_BUILD_OS" != xwindows; then
WHICHCMD(AR) AC_CHECK_TOOL(AR, ar)
SET_FULL_PATH(AR)
fi
if test "x$OPENJDK_BUILD_OS" = xmacosx; then if test "x$OPENJDK_BUILD_OS" = xmacosx; then
ARFLAGS="-r" ARFLAGS="-r"
else else
...@@ -316,25 +289,31 @@ AS_IF([test "x$OPENJDK_BUILD_OS" = xwindows], [ ...@@ -316,25 +289,31 @@ AS_IF([test "x$OPENJDK_BUILD_OS" = xwindows], [
EXE_OUT_OPTION=-out: EXE_OUT_OPTION=-out:
LD_OUT_OPTION=-out: LD_OUT_OPTION=-out:
AR_OUT_OPTION=-out: AR_OUT_OPTION=-out:
# On Windows, reject /usr/bin/link, which is a cygwin # On Windows, reject /usr/bin/link (as determined in CYGWIN_LINK), which is a cygwin
# program for something completely different. # program for something completely different.
AC_CHECK_PROG([WINLD], [link],[link],,, [/usr/bin/link]) AC_CHECK_PROG([WINLD], [link],[link],,, [$CYGWIN_LINK])
# Since we must ignore the first found link, WINLD will contain # Since we must ignore the first found link, WINLD will contain
# the full path to the link.exe program. # the full path to the link.exe program.
WHICHCMD_SPACESAFE([WINLD]) SET_FULL_PATH_SPACESAFE([WINLD])
printf "Windows linker was found at $WINLD\n"
AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
"$WINLD" --version > /dev/null
if test $? -eq 0 ; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
else
AC_MSG_RESULT([yes])
fi
LD="$WINLD" LD="$WINLD"
LDEXE="$WINLD" LDEXE="$WINLD"
LDCXX="$WINLD" LDCXX="$WINLD"
LDEXECXX="$WINLD" LDEXECXX="$WINLD"
# Set HOSTLD to same as LD until we fully support cross compilation
# on windows.
HOSTLD="$WINLD"
AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt]) AC_CHECK_PROG([MT], [mt], [mt],,, [/usr/bin/mt])
WHICHCMD_SPACESAFE([MT]) SET_FULL_PATH_SPACESAFE([MT])
# The resource compiler # The resource compiler
AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc]) AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc])
WHICHCMD_SPACESAFE([RC]) SET_FULL_PATH_SPACESAFE([RC])
RC_FLAGS="-nologo /l 0x409 /r" RC_FLAGS="-nologo /l 0x409 /r"
AS_IF([test "x$VARIANT" = xOPT], [ AS_IF([test "x$VARIANT" = xOPT], [
...@@ -354,12 +333,12 @@ AS_IF([test "x$OPENJDK_BUILD_OS" = xwindows], [ ...@@ -354,12 +333,12 @@ AS_IF([test "x$OPENJDK_BUILD_OS" = xwindows], [
# lib.exe is used to create static libraries. # lib.exe is used to create static libraries.
AC_CHECK_PROG([WINAR], [lib],[lib],,,) AC_CHECK_PROG([WINAR], [lib],[lib],,,)
WHICHCMD_SPACESAFE([WINAR]) SET_FULL_PATH_SPACESAFE([WINAR])
AR="$WINAR" AR="$WINAR"
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT" ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,) AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
WHICHCMD_SPACESAFE([DUMPBIN]) SET_FULL_PATH_SPACESAFE([DUMPBIN])
COMPILER_TYPE=CL COMPILER_TYPE=CL
CCXXFLAGS="$CCXXFLAGS -nologo" CCXXFLAGS="$CCXXFLAGS -nologo"
...@@ -368,10 +347,20 @@ AC_SUBST(RC_FLAGS) ...@@ -368,10 +347,20 @@ AC_SUBST(RC_FLAGS)
AC_SUBST(COMPILER_TYPE) AC_SUBST(COMPILER_TYPE)
AC_PROG_CPP AC_PROG_CPP
WHICHCMD(CPP) SET_FULL_PATH(CPP)
AC_PROG_CXXCPP AC_PROG_CXXCPP
WHICHCMD(CXXCPP) SET_FULL_PATH(CXXCPP)
if test "x$COMPILE_TYPE" != "xcross"; then
# If we are not cross compiling, use the same compilers for
# building the build platform executables. The cross-compilation
# case needed to be done earlier, but this can only be done after
# the native tools have been localized.
BUILD_CC="$CC"
BUILD_CXX="$CXX"
BUILD_LD="$LD"
fi
# for solaris we really need solaris tools, and not gnu equivalent # for solaris we really need solaris tools, and not gnu equivalent
# these seems to normally reside in /usr/ccs/bin so add that to path before # these seems to normally reside in /usr/ccs/bin so add that to path before
...@@ -386,27 +375,24 @@ fi ...@@ -386,27 +375,24 @@ fi
# Find the right assembler. # Find the right assembler.
if test "x$OPENJDK_BUILD_OS" = xsolaris; then if test "x$OPENJDK_BUILD_OS" = xsolaris; then
AC_PATH_PROG(AS, as) AC_PATH_PROG(AS, as)
WHICHCMD(AS) SET_FULL_PATH(AS)
ASFLAGS=" "
else else
AS="$CC -c" AS="$CC -c"
ASFLAGS=" "
fi fi
AC_SUBST(AS) AC_SUBST(AS)
AC_SUBST(ASFLAGS)
if test "x$OPENJDK_BUILD_OS" = xsolaris; then if test "x$OPENJDK_BUILD_OS" = xsolaris; then
AC_PATH_PROG(NM, nm) AC_PATH_PROGS(NM, [gnm nm])
WHICHCMD(NM) SET_FULL_PATH(NM)
AC_PATH_PROG(STRIP, strip) AC_PATH_PROG(STRIP, strip)
WHICHCMD(STRIP) SET_FULL_PATH(STRIP)
AC_PATH_PROG(MCS, mcs) AC_PATH_PROG(MCS, mcs)
WHICHCMD(MCS) SET_FULL_PATH(MCS)
else elif test "x$OPENJDK_BUILD_OS" != xwindows; then
AC_CHECK_TOOL(NM, nm) AC_CHECK_TOOL(NM, nm)
WHICHCMD(NM) SET_FULL_PATH(NM)
AC_CHECK_TOOL(STRIP, strip) AC_CHECK_TOOL(STRIP, strip)
WHICHCMD(STRIP) SET_FULL_PATH(STRIP)
fi fi
### ###
...@@ -421,6 +407,11 @@ if test "x$OBJCOPY" = x; then ...@@ -421,6 +407,11 @@ if test "x$OBJCOPY" = x; then
AC_PATH_TOOL(OBJCOPY, objcopy) AC_PATH_TOOL(OBJCOPY, objcopy)
fi fi
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
AC_PATH_PROG(LIPO, lipo)
SET_FULL_PATH(LIPO)
fi
# Restore old path without tools dir # Restore old path without tools dir
PATH="$OLD_PATH" PATH="$OLD_PATH"
]) ])
...@@ -449,15 +440,13 @@ if test "x$GCC" = xyes; then ...@@ -449,15 +440,13 @@ if test "x$GCC" = xyes; then
SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1' SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
C_FLAG_REORDER='' C_FLAG_REORDER=''
CXX_FLAG_REORDER='' CXX_FLAG_REORDER=''
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN/[$]1' SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
LD="$CC" LD="$CC"
LDEXE="$CC" LDEXE="$CC"
LDCXX="$CXX" LDCXX="$CXX"
LDEXECXX="$CXX" LDEXECXX="$CXX"
POST_STRIP_CMD="$STRIP -g" POST_STRIP_CMD="$STRIP -g"
if test "x$JDK_VARIANT" = xembedded; then
POST_STRIP_CMD="$STRIP --strip-unneeded"
fi
# Linking is different on MacOSX # Linking is different on MacOSX
if test "x$OPENJDK_BUILD_OS" = xmacosx; then if test "x$OPENJDK_BUILD_OS" = xmacosx; then
...@@ -470,6 +459,7 @@ if test "x$GCC" = xyes; then ...@@ -470,6 +459,7 @@ if test "x$GCC" = xyes; then
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1' SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
SET_SHARED_LIBRARY_MAPFILE='' SET_SHARED_LIBRARY_MAPFILE=''
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.' SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
POST_STRIP_CMD="$STRIP -S" POST_STRIP_CMD="$STRIP -S"
fi fi
else else
...@@ -480,7 +470,7 @@ else ...@@ -480,7 +470,7 @@ else
LIBRARY_PREFIX=lib LIBRARY_PREFIX=lib
SHARED_LIBRARY='lib[$]1.so' SHARED_LIBRARY='lib[$]1.so'
STATIC_LIBRARY='lib[$]1.a' STATIC_LIBRARY='lib[$]1.a'
SHARED_LIBRARY_FLAGS="-z defs -xildoff -ztext -G" SHARED_LIBRARY_FLAGS="-G"
SHARED_LIBRARY_SUFFIX='.so' SHARED_LIBRARY_SUFFIX='.so'
STATIC_LIBRARY_SUFFIX='.a' STATIC_LIBRARY_SUFFIX='.a'
OBJ_SUFFIX='.o' OBJ_SUFFIX='.o'
...@@ -489,7 +479,8 @@ else ...@@ -489,7 +479,8 @@ else
SET_SHARED_LIBRARY_MAPFILE='-M[$]1' SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
C_FLAG_REORDER='-xF' C_FLAG_REORDER='-xF'
CXX_FLAG_REORDER='-xF' CXX_FLAG_REORDER='-xF'
SET_SHARED_LIBRARY_ORIGIN='-R \$$$$ORIGIN/[$]1' SET_SHARED_LIBRARY_ORIGIN='-R\$$$$ORIGIN[$]1'
SET_EXECUTABLE_ORIGIN="$SET_SHARED_LIBRARY_ORIGIN"
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__" CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__" CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
CFLAGS_JDKLIB_EXTRA='-xstrconst' CFLAGS_JDKLIB_EXTRA='-xstrconst'
...@@ -511,6 +502,7 @@ else ...@@ -511,6 +502,7 @@ else
SET_SHARED_LIBRARY_NAME='' SET_SHARED_LIBRARY_NAME=''
SET_SHARED_LIBRARY_MAPFILE='' SET_SHARED_LIBRARY_MAPFILE=''
SET_SHARED_LIBRARY_ORIGIN='' SET_SHARED_LIBRARY_ORIGIN=''
SET_EXECUTABLE_ORIGIN=''
fi fi
fi fi
...@@ -527,6 +519,7 @@ AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) ...@@ -527,6 +519,7 @@ AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
AC_SUBST(C_FLAG_REORDER) AC_SUBST(C_FLAG_REORDER)
AC_SUBST(CXX_FLAG_REORDER) AC_SUBST(CXX_FLAG_REORDER)
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
AC_SUBST(SET_EXECUTABLE_ORIGIN)
AC_SUBST(POST_STRIP_CMD) AC_SUBST(POST_STRIP_CMD)
AC_SUBST(POST_MCS_CMD) AC_SUBST(POST_MCS_CMD)
...@@ -542,6 +535,25 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION], ...@@ -542,6 +535,25 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
# Setup the opt flags for different compilers # Setup the opt flags for different compilers
# and different operating systems. # and different operating systems.
# #
#
# NOTE: check for -mstackrealign needs to be below potential addition of -m32
#
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
# On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
# While waiting for a better solution, the current workaround is to use -mstackrealign.
CFLAGS="$CFLAGS -mstackrealign"
AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
])
fi
C_FLAG_DEPS="-MMD -MF" C_FLAG_DEPS="-MMD -MF"
CXX_FLAG_DEPS="-MMD -MF" CXX_FLAG_DEPS="-MMD -MF"
...@@ -566,7 +578,7 @@ case $COMPILER_TYPE in ...@@ -566,7 +578,7 @@ case $COMPILER_TYPE in
CXXFLAGS_DEBUG_SYMBOLS="-g" CXXFLAGS_DEBUG_SYMBOLS="-g"
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
CFLAGS_DEBUG_SYMBOLS="-g1" CFLAGS_DEBUG_SYMBOLS="-g1"
CXXFLAGS_DEBUG_SYMBOLSG="-g1" CXXFLAGS_DEBUG_SYMBOLS="-g1"
fi fi
;; ;;
esac esac
...@@ -578,52 +590,56 @@ case $COMPILER_TYPE in ...@@ -578,52 +590,56 @@ case $COMPILER_TYPE in
# #
# Forte has different names for this with their C++ compiler... # Forte has different names for this with their C++ compiler...
# #
C_FLAG_DEPS="-xMMD -xMF" C_FLAG_DEPS="-xMMD -xMF"
CXX_FLAG_DEPS="-xMMD -xMF" CXX_FLAG_DEPS="-xMMD -xMF"
# Extra options used with HIGHEST # Extra options used with HIGHEST
# #
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
# done with care, there are some assumptions below that need to # done with care, there are some assumptions below that need to
# be understood about the use of pointers, and IEEE behavior. # be understood about the use of pointers, and IEEE behavior.
# #
# Use non-standard floating point mode (not IEEE 754) # Use non-standard floating point mode (not IEEE 754)
CC_HIGHEST="$CC_HIGHEST -fns" CC_HIGHEST="$CC_HIGHEST -fns"
# Do some simplification of floating point arithmetic (not IEEE 754) # Do some simplification of floating point arithmetic (not IEEE 754)
CC_HIGHEST="$CC_HIGHEST -fsimple" CC_HIGHEST="$CC_HIGHEST -fsimple"
# Use single precision floating point with 'float' # Use single precision floating point with 'float'
CC_HIGHEST="$CC_HIGHEST -fsingle" CC_HIGHEST="$CC_HIGHEST -fsingle"
# Assume memory references via basic pointer types do not alias # Assume memory references via basic pointer types do not alias
# (Source with excessing pointer casting and data access with mixed # (Source with excessing pointer casting and data access with mixed
# pointer types are not recommended) # pointer types are not recommended)
CC_HIGHEST="$CC_HIGHEST -xalias_level=basic" CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
# Use intrinsic or inline versions for math/std functions # Use intrinsic or inline versions for math/std functions
# (If you expect perfect errno behavior, do not use this) # (If you expect perfect errno behavior, do not use this)
CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all" CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
# Loop data dependency optimizations (need -xO3 or higher) # Loop data dependency optimizations (need -xO3 or higher)
CC_HIGHEST="$CC_HIGHEST -xdepend" CC_HIGHEST="$CC_HIGHEST -xdepend"
# Pointer parameters to functions do not overlap # Pointer parameters to functions do not overlap
# (Similar to -xalias_level=basic usage, but less obvious sometimes. # (Similar to -xalias_level=basic usage, but less obvious sometimes.
# If you pass in multiple pointers to the same data, do not use this) # If you pass in multiple pointers to the same data, do not use this)
CC_HIGHEST="$CC_HIGHEST -xrestrict" CC_HIGHEST="$CC_HIGHEST -xrestrict"
# Inline some library routines # Inline some library routines
# (If you expect perfect errno behavior, do not use this) # (If you expect perfect errno behavior, do not use this)
CC_HIGHEST="$CC_HIGHEST -xlibmil" CC_HIGHEST="$CC_HIGHEST -xlibmil"
# Use optimized math routines # Use optimized math routines
# (If you expect perfect errno behavior, do not use this) # (If you expect perfect errno behavior, do not use this)
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now # Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
#CC_HIGHEST="$CC_HIGHEST -xlibmopt" #CC_HIGHEST="$CC_HIGHEST -xlibmopt"
case $LEGACY_OPENJDK_TARGET_CPU1 in case $OPENJDK_TARGET_CPU_ARCH in
i586) x86)
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xchip=pentium" C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xregs=no%frameptr"
C_O_FLAG_HI="-xO4 -Wu,-O4~yz" C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr"
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz" C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr"
C_O_FLAG_NONE="" C_O_FLAG_NONE="-xregs=no%frameptr"
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xchip=pentium" CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr"
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz" CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr"
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz" CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr"
CXX_O_FLAG_NONE="" CXX_O_FLAG_NONE="-xregs=no%frameptr"
if test "x$OPENJDK_TARGET_CPU" = xx86; then
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium"
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium"
fi
;; ;;
sparc) sparc)
CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s" CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
...@@ -647,9 +663,11 @@ CC_HIGHEST="$CC_HIGHEST -xlibmil" ...@@ -647,9 +663,11 @@ CC_HIGHEST="$CC_HIGHEST -xlibmil"
;; ;;
CL ) CL )
D_FLAG= D_FLAG=
C_O_FLAG_HI="-O2" C_O_FLAG_HIGHEST="-O2"
C_O_FLAG_HI="-O1"
C_O_FLAG_NORM="-O1" C_O_FLAG_NORM="-O1"
C_O_FLAG_NONE="-Od" C_O_FLAG_NONE="-Od"
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST"
CXX_O_FLAG_HI="$C_O_FLAG_HI" CXX_O_FLAG_HI="$C_O_FLAG_HI"
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
...@@ -680,15 +698,15 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK], ...@@ -680,15 +698,15 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK],
[ [
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags"]) AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
fi fi
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags"]) AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
fi fi
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags"]) AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
fi fi
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags], AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
...@@ -704,6 +722,15 @@ CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags" ...@@ -704,6 +722,15 @@ CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags" CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags" LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
# Hotspot needs these set in their legacy form
LEGACY_EXTRA_CFLAGS=$with_extra_cflags
LEGACY_EXTRA_CXXFLAGS=$with_extra_cxxflags
LEGACY_EXTRA_LDFLAGS=$with_extra_ldflags
AC_SUBST(LEGACY_EXTRA_CFLAGS)
AC_SUBST(LEGACY_EXTRA_CXXFLAGS)
AC_SUBST(LEGACY_EXTRA_LDFLAGS)
############################################################################### ###############################################################################
# #
# Now setup the CFLAGS and LDFLAGS for the JDK build. # Now setup the CFLAGS and LDFLAGS for the JDK build.
...@@ -729,43 +756,36 @@ case $COMPILER_NAME in ...@@ -729,43 +756,36 @@ case $COMPILER_NAME in
esac esac
;; ;;
ossc ) ossc )
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -norunpath -xnolib" CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX" case $OPENJDK_TARGET_CPU_ARCH in
x86 )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DcpuIntel -Di586 -Di386"
CFLAGS_JDK="$CFLAGS_JDK -erroff=E_BAD_PRAGMA_PACK_VALUE"
;;
esac
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
;; ;;
cl ) cl )
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \ CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Zi -MD -Zc:wchar_t- -W3 -wd4800 \
-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \ -D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB -DWIN32_LEAN_AND_MEAN \
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \ -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
-DWIN32 -DIAL" -DWIN32 -DIAL"
case $LEGACY_OPENJDK_TARGET_CPU1 in case $OPENJDK_TARGET_CPU in
i?86 ) x86 )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
;; ;;
amd64 ) x86_64 )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
;; ;;
esac esac
;; ;;
esac esac
###############################################################################
#
# Cross-compile arch specific flags
#
if test "x$JDK_VARIANT" = "xembedded"; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DJAVASE_EMBEDDED"
fi
case $OPENJDK_TARGET_CPU_ARCH in
arm )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fsigned-char"
;;
ppc )
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fsigned-char"
;;
esac
############################################################################### ###############################################################################
CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
...@@ -774,11 +794,17 @@ CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64" ...@@ -774,11 +794,17 @@ CCXXFLAGS_JDK="$CCXXFLAGS_JDK $ADD_LP64"
PACKAGE_PATH=/opt/local PACKAGE_PATH=/opt/local
AC_SUBST(PACKAGE_PATH) AC_SUBST(PACKAGE_PATH)
# Sometimes we use a cpu dir (.../lib/amd64/server) if test "x$OPENJDK_TARGET_CPU_ENDIAN" = xlittle; then
# Sometimes not (.../lib/server) # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
LIBARCHDIR="$LEGACY_OPENJDK_TARGET_CPU2/" # Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
if test "x$ENDIAN" = xlittle; then # (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN" # Note: -Dmacro is the same as #define macro 1
# -Dmacro= is the same as #define macro
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
else
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
fi
else else
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
fi fi
...@@ -793,27 +819,29 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then ...@@ -793,27 +819,29 @@ if test "x$OPENJDK_TARGET_OS" = xsolaris; then
fi fi
if test "x$OPENJDK_TARGET_OS" = xmacosx; then if test "x$OPENJDK_TARGET_OS" = xmacosx; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
LIBARCHDIR=""
fi fi
if test "x$OPENJDK_TARGET_OS" = xbsd; then if test "x$OPENJDK_TARGET_OS" = xbsd; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
fi fi
if test "x$DEBUG_LEVEL" = xrelease; then if test "x$DEBUG_LEVEL" = xrelease; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DTRIMMED"
fi
else else
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
fi fi
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$LEGACY_OPENJDK_TARGET_CPU1\"' -D$LEGACY_OPENJDK_TARGET_CPU1" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'" CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \ CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
-I${JDK_OUTPUTDIR}/include \ -I${JDK_OUTPUTDIR}/include \
-I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \ -I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
-I${JDK_TOPDIR}/src/share/javavm/export \ -I${JDK_TOPDIR}/src/share/javavm/export \
-I${JDK_TOPDIR}/src/$LEGACY_OPENJDK_TARGET_OS_API/javavm/export \ -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/javavm/export \
-I${JDK_TOPDIR}/src/share/native/common \ -I${JDK_TOPDIR}/src/share/native/common \
-I${JDK_TOPDIR}/src/$LEGACY_OPENJDK_TARGET_OS_API/native/common" -I${JDK_TOPDIR}/src/$OPENJDK_TARGET_OS_API_DIR/native/common"
# The shared libraries are compiled using the picflag. # The shared libraries are compiled using the picflag.
CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA" CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
...@@ -833,7 +861,7 @@ CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" ...@@ -833,7 +861,7 @@ CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
# Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh. # Thus we offer the compiler to find libjvm.so first in server then in client. It works. Ugh.
if test "x$COMPILER_TYPE" = xCL; then if test "x$COMPILER_TYPE" = xCL; then
LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no" LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
if test "x$LEGACY_OPENJDK_TARGET_CPU1" = xi586; then if test "x$OPENJDK_TARGET_CPU" = xx86; then
LDFLAGS_JDK="$LDFLAGS_JDK -safeseh" LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
fi fi
# TODO: make -debug optional "--disable-full-debug-symbols" # TODO: make -debug optional "--disable-full-debug-symbols"
...@@ -861,20 +889,18 @@ else ...@@ -861,20 +889,18 @@ else
fi fi
LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \ LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
-L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/server \
-L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}client \ -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}/client \
-L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}" -L${JDK_OUTPUTDIR}/lib${OPENJDK_TARGET_CPU_LIBDIR}"
LDFLAGS_JDKLIB_SUFFIX="-ljvm -ljava"
LDFLAGS_JDKLIB_SUFFIX="-ljava -ljvm"
if test "x$COMPILER_NAME" = xossc; then if test "x$COMPILER_NAME" = xossc; then
LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc" LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
fi fi
# Only the jli library is explicitly linked when the launchers are built.
# The libjvm is then dynamically loaded/linked by the launcher.
LDFLAGS_JDKEXE="${LDFLAGS_JDK}" LDFLAGS_JDKEXE="${LDFLAGS_JDK}"
if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then if test "x$OPENJDK_TARGET_OS" = xlinux; then
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli" LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
LDFLAGS_JDKEXE_SUFFIX="-ljli"
fi fi
fi fi
...@@ -905,4 +931,5 @@ AC_SUBST(LDFLAGS_JDKLIB) ...@@ -905,4 +931,5 @@ AC_SUBST(LDFLAGS_JDKLIB)
AC_SUBST(LDFLAGS_JDKEXE) AC_SUBST(LDFLAGS_JDKEXE)
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX) AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
AC_SUBST(LDFLAGS_JDKEXE_SUFFIX) AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
AC_SUBST(LDFLAGS_CXX_JDK)
]) ])
#!/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 @@ ...@@ -30,7 +30,7 @@
# #
if [ "x$1" = "x-h" ] || [ "x$1" = "x--help" ] || [ "x$1" == "x" ]; then 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 ""
echo "Compare object files" echo "Compare object files"
echo "" echo ""
......
#!/bin/bash
set -x
set -e
options="$*"
option="$1"
tmp=/tmp/test_builds.$$
rm -f -r ${tmp}
mkdir -p ${tmp}
errMessages=${tmp}/error_messages.txt
#######
# Error function
error() # message
{
echo "ERROR: $1" | tee -a ${errMessages}
}
# Check errors
checkErrors()
{
if [ -s ${errMessages} ] ; then
cat ${errMessages}
exit 1
fi
}
#######
os="`uname -s`"
arch="`uname -p`"
make=make
if [ "${os}" = "SunOS" ] ; then
make=gmake
export J7="/opt/java/jdk1.7.0"
elif [ "${os}" = "Darwin" ] ; then
export J7="/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home"
elif [ "${os}" = "Linux" -a "${arch}" = "x86_64" ] ; then
export J7="/usr/lib/jvm/java-7-openjdk-amd64/"
else
echo "What os/arch is this: ${os}/${arch}"
exit 1
fi
# Must have a jdk7
if [ ! -d ${J7} ] ; then
echo "No JDK7 found at: ${J7}"
exit 1
fi
# What sources we use
fromroot="http://hg.openjdk.java.net/build-infra/jdk8"
# Where we do it
root="testbuilds"
mkdir -p ${root}
# Three areas, last three are cloned from first to insure sameness
t0=${root}/t0
t1=${root}/t1
t2=${root}/t2
t3=${root}/t3
repolist="${t0} ${t1} ${t2} ${t3}"
# Optional complete clobber
if [ "${option}" = "clobber" ] ; then
for i in ${repolist} ; do
rm -f -r ${i}
done
fi
# Get top repos
if [ ! -d ${t0}/.hg ] ; then
rm -f -r ${t0}
hg clone ${fromroot} ${t0}
fi
for i in ${t1} ${t2} ${t3} ; do
if [ ! -d ${i}/.hg ] ; then
hg clone ${t0} ${i}
fi
done
# Get repos updated
for i in ${repolist} ; do
( \
set -e \
&& cd ${i} \
&& sh ./get_source.sh \
|| error "Cannot get source" \
) 2>&1 | tee ${i}.get_source.txt
checkErrors
done
# Optional clean
if [ "${option}" = "clean" ] ; then
for i in ${repolist} ; do
rm -f -r ${i}/build
rm -f -r ${i}/*/build
rm -f -r ${i}/*/dist
done
fi
# Check changes on working set files
for i in ${repolist} ; do
( \
set -e \
&& cd ${i} \
&& sh ./make/scripts/hgforest.sh status \
|| error "Cannot check status" \
) 2>&1 | tee ${i}.hg.status.txt
checkErrors
done
# Configure for build-infra building
for i in ${t1} ${t2} ; do
( \
set -e \
&& cd ${i}/common/makefiles \
&& sh ../autoconf/configure --with-boot-jdk=${J7} \
|| error "Cannot configure" \
) 2>&1 | tee ${i}.config.txt
checkErrors
done
# Do build-infra builds
for i in ${t1} ${t2} ; do
( \
set -e \
&& cd ${i}/common/makefiles \
&& ${make} \
FULL_VERSION:=1.8.0-internal-b00 \
JRE_RELEASE_VERSION:=1.8.0-internal-b00 \
USER_RELEASE_SUFFIX:=compare \
RELEASE:=1.8.0-internal \
VERBOSE= \
LIBARCH= \
all images \
|| error "Cannot build" \
) 2>&1 | tee ${i}.build.txt
checkErrors
done
# Compare build-infra builds
( \
sh ${t0}/common/bin/compareimage.sh \
${t1}/build/*/images/j2sdk-image \
${t2}/build/*/images/j2sdk-image \
|| error "Cannot compare" \
) 2>&1 | tee ${root}/build-infra-comparison.txt
checkErrors
# Do old build
unset JAVA_HOME
export ALT_BOOTDIR="${J7}"
( \
cd ${t3} \
&& ${make} FULL_VERSION='"1.8.0-internal" sanity \
|| error "Cannot sanity" \
) 2>&1 | tee ${t3}.sanity.txt
checkErrors
( \
cd ${t3} \
&& ${make} \
FULL_VERSION='"1.8.0-internal" \
JRE_RELEASE_VERSION:=1.8.0-internal-b00 \
USER_RELEASE_SUFFIX:=compare \
RELEASE:=1.8.0-internal \
|| error "Cannot build old way" \
) 2>&1 | tee ${t3}.build.txt
checkErrors
# Compare old build to build-infra build
( \
sh ${t0}/common/bin/compareimage.sh \
${t3}/build/*/j2sdk-image \
${t1}/build/*/images/j2sdk-image \
|| error "Cannot compare" \
) 2>&1 | tee ${root}/build-comparison.txt
checkErrors
exit 0
s/\\u0020/\x20/g
s/\\u003A/\x3A/g
s/\\u006B/\x6B/g
s/\\u0075/\x75/g
s/\\u00A0/\xA0/g
s/\\u00A3/\xA3/g
s/\\u00B0/\xB0/g
s/\\u00B7/\xB7/g
s/\\u00BA/\xBA/g
s/\\u00BF/\xBF/g
s/\\u00C0/\xC0/g
s/\\u00C1/\xC1/g
s/\\u00C2/\xC2/g
s/\\u00C4/\xC4/g
s/\\u00C5/\xC5/g
s/\\u00C8/\xC8/g
s/\\u00C9/\xC9/g
s/\\u00CA/\xCA/g
s/\\u00CD/\xCD/g
s/\\u00CE/\xCE/g
s/\\u00D3/\xD3/g
s/\\u00D4/\xD4/g
s/\\u00D6/\xD6/g
s/\\u00DA/\xDA/g
s/\\u00DC/\xDC/g
s/\\u00DD/\xDD/g
s/\\u00DF/\xDF/g
s/\\u00E0/\xE0/g
s/\\u00E1/\xE1/g
s/\\u00E2/\xE2/g
s/\\u00E3/\xE3/g
s/\\u00E4/\xE4/g
s/\\u00E5/\xE5/g
s/\\u00E6/\xE6/g
s/\\u00E7/\xE7/g
s/\\u00E8/\xE8/g
s/\\u00E9/\xE9/g
s/\\u00EA/\xEA/g
s/\\u00EB/\xEB/g
s/\\u00EC/\xEC/g
s/\\u00ED/\xED/g
s/\\u00EE/\xEE/g
s/\\u00EF/\xEF/g
s/\\u00F1/\xF1/g
s/\\u00F2/\xF2/g
s/\\u00F3/\xF3/g
s/\\u00F4/\xF4/g
s/\\u00F5/\xF5/g
s/\\u00F6/\xF6/g
s/\\u00F9/\xF9/g
s/\\u00FA/\xFA/g
s/\\u00FC/\xFC/g
s/\\u0020/\x20/g
s/\\u003f/\x3f/g
s/\\u006f/\x6f/g
s/\\u0075/\x75/g
s/\\u00a0/\xa0/g
s/\\u00a3/\xa3/g
s/\\u00b0/\xb0/g
s/\\u00ba/\xba/g
s/\\u00bf/\xbf/g
s/\\u00c1/\xc1/g
s/\\u00c4/\xc4/g
s/\\u00c5/\xc5/g
s/\\u00c8/\xc8/g
s/\\u00c9/\xc9/g
s/\\u00ca/\xca/g
s/\\u00cd/\xcd/g
s/\\u00d6/\xd6/g
s/\\u00dc/\xdc/g
s/\\u00dd/\xdd/g
s/\\u00df/\xdf/g
s/\\u00e0/\xe0/g
s/\\u00e1/\xe1/g
s/\\u00e2/\xe2/g
s/\\u00e3/\xe3/g
s/\\u00e4/\xe4/g
s/\\u00e5/\xe5/g
s/\\u00e7/\xe7/g
s/\\u00e8/\xe8/g
s/\\u00e9/\xe9/g
s/\\u00ea/\xea/g
s/\\u00eb/\xeb/g
s/\\u00ec/\xec/g
s/\\u00ed/\xed/g
s/\\u00ee/\xee/g
s/\\u00ef/\xef/g
s/\\u00f0/\xf0/g
s/\\u00f1/\xf1/g
s/\\u00f2/\xf2/g
s/\\u00f3/\xf3/g
s/\\u00f4/\xf4/g
s/\\u00f5/\xf5/g
s/\\u00f6/\xf6/g
s/\\u00f7/\xf7/g
s/\\u00f8/\xf8/g
s/\\u00f9/\xf9/g
s/\\u00fa/\xfa/g
s/\\u00fc/\xfc/g
s/\\u00ff/\xff/g
#
# 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
...@@ -23,40 +23,14 @@ ...@@ -23,40 +23,14 @@
# questions. # questions.
# #
# The complexity of this makefile is not the fault of make, but the fault # This makefile is much simpler now that it can use the smart javac wrapper
# of javac and javah. The basic problems are: # for dependency tracking between java packages and incremental compiles.
# # It could be even more simple if we added support for incremental jar updates
# 1) Compiling a single Java source file unpredictably generates anything # directly from the smart javac wrapper.
# between zero (0!) and an infinite number of .class files!
# 2) There is no hint, for which classes javah needs to be run, # Cleaning/copying properties here is not a good solution. The properties
# and it happily generates .h files for classes with no native methods. # should be cleaned/copied by a annotation processor in sjavac.
# 3) javac and javah do not cleanup anything, for example if an internal
# class (potentially with native methods) is removed from a Java source file.
#
# This makefile is a tribute to GNU make. And yes, it was harder to write than it is
# to read. The include/excludes of directories and files are only a temporary measure
# to work around the messy jdk sources that put platform specific code in src/share/classes.
#
# We should move most of the functionality of this makefile into a
# smart javac/javah/javadoc/jar combo tool. sjavac ?
#
# I.e. 1) It always generates a single output, a zip-file from a number of source roots.
# The zip file contains information that enable incremental builds with full
# dependency tracking between packages.
# 2) It automatically generates the right .h files.
# 3) It keeps its house clean.
# *) Generates intermediate files to be used for javadoc generation later.
# and does all the other useful things that this makefile does, such as:
# use all cores for compilation, reuse the running JVM for all compilations,
# and has pubapi dependency tracking to minimize the number of files
# that need to be recompiled during an incremental build.
#
# A zip file, or several zip files combined, can then be converted to a .jar file, or to a .jmod file.
#
# This would make this makefile much much simpler. I.e. make can be used
# for its real purpose, track dependencies and trigger a recompile if a
# dependency has changed.
#
# When you read this source. Remember that $(sort ...) has the side effect # When you read this source. Remember that $(sort ...) has the side effect
# of removing duplicates. It is actually this side effect that is # of removing duplicates. It is actually this side effect that is
# desired whenever sort is used below! # desired whenever sort is used below!
...@@ -67,25 +41,15 @@ endif ...@@ -67,25 +41,15 @@ endif
FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST FALSE_FIND_PATTERN:=-name FILE_NAME_THAT_DOESNT_EXIST
# If compilation of java package fails, then the public api file for that
# package will not be genereated. We add this fallback rule to generate
# an empty pubapi file.
%.api:
if test ! -f $@; then $(MKDIR) -p $(@D); $(TOUCH) $@; fi
define SetupJavaCompiler define SetupJavaCompiler
# param 1 is for example BOOT_JAVAC or NEW_JAVAC # param 1 is for example BOOT_JAVAC or NEW_JAVAC
# This is the name later used to decide which java compiler to use. # This is the name later used to decide which java compiler to use.
# param 2-9 are named args. # param 2-9 are named args.
# JVM:=The jvm used to run the javac/javah command # JVM:=The jvm used to run the javac/javah command
# JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out # JAVAC:=The javac jar and bootstrap classpath changes, or just bin/javac if JVM is left out
# JAVAH:=The javah jar and bootstrap classpath changes, or just bin/javah if JVM is left out
# FLAGS:=Flags to be supplied to javac # FLAGS:=Flags to be supplied to javac
# MODE:=SINGLE_THREADED_BATCH (primarily for old javac) or MULTI_CORE_CONCURRENT
# only for MULTI_CORE_CONCURRENT are the options below relevant:
# SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here # SERVER_DIR:=Use a javac server (-XDserver) and store the server related files here
# SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above. # SERVER_JVM:=Use this JVM for the server. Defaults to the JVM above.
# USE_DEPS:=true means use -XDdeps,-XDpubapi and -XDnativeapi to track java dependencies
$(if $2,$1_$(strip $2)) $(if $2,$1_$(strip $2))
$(if $3,$1_$(strip $3)) $(if $3,$1_$(strip $3))
$(if $4,$1_$(strip $4)) $(if $4,$1_$(strip $4))
...@@ -96,21 +60,17 @@ define SetupJavaCompiler ...@@ -96,21 +60,17 @@ define SetupJavaCompiler
$(if $9,$1_$(strip $9)) $(if $9,$1_$(strip $9))
$(if $(10),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk)) $(if $(10),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
ifeq ($$($1_MODE),MULTI_CORE_CONCURRENT) ifeq ($$(ENABLE_SJAVAC),yes)
ifneq (,$$($1_SERVER_DIR)) # The port file contains the tcp/ip on which the server listens
# A javac server has been requested. # and the cookie necessary to talk to the server.
# The port file contains the tcp/ip on which the server listens $1_JAVAC_PORTFILE:=$$($1_SERVER_DIR)/server.port
# and the cookie necessary to talk to the server. # You can use a different JVM to run the background javac server.
$1_JAVAC_PORTFILE:=$$($1_SERVER_DIR)/$1.port ifeq ($$($1_SERVER_JVM),)
ifeq ($$($1_SERVER_JVM),) # It defaults to the same JVM that is used to start the javac command.
# You can use a different JVM to run the background javac server. $1_SERVER_JVM:=$$($1_JVM)
# But if not set, it defaults to the same JVM that is used to start
# the javac command.
$1_SERVER_JVM:=$$($1_JVM)
endif
# Set the $1_REMOTE to spawn a background javac server.
$1_REMOTE:=-XDserver:portfile=$$($1_JAVAC_PORTFILE),poolsize=$(JAVAC_SERVER_CORES),javac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_JAVAC))))
endif endif
# Set the $1_REMOTE to spawn a background javac server.
$1_REMOTE:=-XDserver:portfile=$$($1_JAVAC_PORTFILE),poolsize=$(SJAVAC_SERVER_CORES),id=$1,javac=$$(subst $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_JAVAC))))
endif endif
endef endef
...@@ -127,7 +87,7 @@ define SetupArchive ...@@ -127,7 +87,7 @@ define SetupArchive
# JAR:=Jar file to create # JAR:=Jar file to create
# MANIFEST:=Optional manifest file template. # MANIFEST:=Optional manifest file template.
# JARMAIN:=Optional main class to add to manifest # JARMAIN:=Optional main class to add to manifest
# JARINDEX := # JARINDEX:=true means generate the index in the jar file.
# SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically # SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically
# added to the archive. # added to the archive.
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest. # EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
...@@ -152,9 +112,6 @@ define SetupArchive ...@@ -152,9 +112,6 @@ define SetupArchive
$1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest $1_MANIFEST_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_manifest
$1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess $1_DELETESS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletess
$1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes $1_DELETES_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_deletes
$1_PUBAPI_NOTIFICATIONS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_pubapi_notifications
$1_NATIVEAPI_NOTIFICATIONS_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native_notifications
$1_NATIVEAPI_FILE:=$$(dir $$($1_JAR))_the.$$($1_JARNAME)_native
$1_BIN:=$$(dir $$($1_JAR)) $1_BIN:=$$(dir $$($1_JAR))
ifeq (,$$($1_SUFFIXES)) ifeq (,$$($1_SUFFIXES))
...@@ -180,6 +137,7 @@ define SetupArchive ...@@ -180,6 +137,7 @@ define SetupArchive
$1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude $1_GREP_EXCLUDES:=| $(GREP) -v -f $$($1_BIN)/_the.$$($1_JARNAME)_exclude
endif endif
# Check if this jar needs to have its index generated.
ifneq (,$$($1_JARINDEX)) ifneq (,$$($1_JARINDEX))
$1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@)) $1_JARINDEX = (cd $$(dir $$@) && $(JAR) -i $$(notdir $$@))
else else
...@@ -188,14 +146,17 @@ define SetupArchive ...@@ -188,14 +146,17 @@ define SetupArchive
# When this macro is run in the same makefile as the java compilation, dependencies are transfered # When this macro is run in the same makefile as the java compilation, dependencies are transfered
# in make variables. When the macro is run in a different makefile than the java compilation, the # in make variables. When the macro is run in a different makefile than the java compilation, the
# dependencies need to be found in the filesystem. # dependencies need to be found in the filesystem.
$1_ALL_SRCS:=$$(foreach src,$$($1_SRCS),$$(shell ($(FIND) $$(src) -type f \ ifneq (,$2)
$1_DEPS:=$2
else
$1_DEPS:=$$(foreach src,$$($1_SRCS),$$(shell ($(FIND) $$(src) -type f \
-a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \ -a \( $$($1_FIND_PATTERNS) \) $$($1_GREP_INCLUDES) \
$$($1_GREP_EXCLUDES) && $(ECHO) $$($1_EXTRA_FILES)))) $$($1_GREP_EXCLUDES) && $(ECHO) $$(addprefix $$(src)/,$$($1_EXTRA_FILES)))))
ifeq (,$$($1_SKIP_METAINF)) ifeq (,$$($1_SKIP_METAINF))
$1_ALL_SRCS+=$$(foreach src,$$($1_SRCS),$$(shell $(FIND) $$(src)/META-INF -type f 2> /dev/null)) $1_DEPS+=$$(foreach src,$$($1_SRCS),$$(shell $(FIND) $$(src)/META-INF -type f 2> /dev/null))
endif
endif endif
# Utility macros, to make the shell script receipt somewhat easier to dechipher. # Utility macros, to make the shell script receipt somewhat easier to dechipher.
# The capture contents macro finds all files (matching the patterns, typically # The capture contents macro finds all files (matching the patterns, typically
...@@ -208,19 +169,12 @@ define SetupArchive ...@@ -208,19 +169,12 @@ define SetupArchive
# The capture deletes macro finds all deleted files and concatenates them. The resulting file # The capture deletes macro finds all deleted files and concatenates them. The resulting file
# tells us what to remove from the jar-file. # tells us what to remove from the jar-file.
$1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) &&) $1_CAPTURE_DELETES=$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.deleted -newer $$@ -exec $(SED) 's|$$(src)||g' \{\} >> $$($1_DELETES_FILE) \;) &&)
# The capture pubapi notifications scans for pubapi change notifications. If such notifications are
# found, then we will build the classes leading up to the jar again, to take into account the new timestamps
# on the changed pubapi files.
$1_CAPTURE_PUBAPI_NOTIFICATIONS=$$(foreach src,$$($1_SRCS),\
(cd $$(src) && \
$(FIND) . -name _the.package.api.notify -exec dirname \{\} \; >> $$($1_PUBAPI_NOTIFICATIONS_FILE) ; \
true) &&)
# The update contents macro updates the jar file with the previously capture contents. # The update contents macro updates the jar file with the previously capture contents.
$1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ $1_UPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
(cd $$(src) && \ (cd $$(src) && \
if [ -s _the.$$($1_JARNAME)_contents ]; then \ if [ -s _the.$$($1_JARNAME)_contents ]; then \
$(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \ $(ECHO) " updating" `$(WC) -l _the.$$($1_JARNAME)_contents | $(AWK) '{ print $$$$1 }'` files && \
$(JAR) uf $$@ @_the.$$($1_JARNAME)_contents; \ $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @_the.$$($1_JARNAME)_contents; \
fi) &&) fi) &&)
# The s-variants of the above macros are used when the jar is created from scratch. # The s-variants of the above macros are used when the jar is created from scratch.
$1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\ $1_SCAPTURE_CONTENTS=$$(foreach src,$$($1_SRCS),\
...@@ -234,30 +188,25 @@ define SetupArchive ...@@ -234,30 +188,25 @@ define SetupArchive
$$(src)/_the.$$($1_JARNAME)_contents) && ) $$(src)/_the.$$($1_JARNAME)_contents) && )
endif endif
$1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\ $1_SUPDATE_CONTENTS=$$(foreach src,$$($1_SRCS),\
(cd $$(src) && $(JAR) uf $$@ @$$(src)/_the.$$($1_JARNAME)_contents) &&) (cd $$(src) && $(JAR) $$($1_JAR_UPDATE_OPTIONS) $$@ @$$(src)/_the.$$($1_JARNAME)_contents) &&)
# The TOUCH macro is used to make sure all timestamps are identical for package files and the pubapi files.
# If we do not do this, we get random recompilations, the next time we run make, since the order of package building is random,
# ie independent of package --dependes on-> public api of another package. This is of course
# due to the fact that Java source often (always?) has circular dependencies. (Thus there is no correct order
# to compile packages, and we can just as well do them in a random order. Which we do.)
$1_TOUCH_API_FILES=$$(foreach src,$$($1_SRCS),\
($(FIND) $$(src) -name _the.package.api -exec $(TOUCH) -r $$($1_JAR) \{\} \; ; true) && \
($(FIND) $$(src) -name _the.package -exec $(TOUCH) -r $$($1_JAR) \{\} \; ; true) &&)
# Use a slightly shorter name for logging, but with enough path to identify this jar. # Use a slightly shorter name for logging, but with enough path to identify this jar.
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR)) $1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
ifneq (,$$($1_CHECK_COMPRESS_JAR)) ifneq (,$$($1_CHECK_COMPRESS_JAR))
$1_JAR_CREATE_OPTIONS := c0fm $1_JAR_CREATE_OPTIONS := c0fm
$1_JAR_UPDATE_OPTIONS := u0f
ifeq ($(COMPRESS_JARS), true) ifeq ($(COMPRESS_JARS), true)
$1_JAR_CREATE_OPTIONS := cfm $1_JAR_CREATE_OPTIONS := cfm
$1_JAR_UPDATE_OPTIONS := uf
endif endif
else else
$1_JAR_CREATE_OPTIONS := cfm $1_JAR_CREATE_OPTIONS := cfm
$1_JAR_UPDATE_OPTIONS := uf
endif endif
# Here is the rule that creates/updates the jar file. # Here is the rule that creates/updates the jar file.
$$($1_JAR) : $2 $$($1_ALL_SRC) $$($1_JAR) : $$($1_DEPS)
$(MKDIR) -p $$($1_BIN) $(MKDIR) -p $$($1_BIN)
if [ -n "$$($1_MANIFEST)" ]; then \ if [ -n "$$($1_MANIFEST)" ]; then \
$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \ $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
...@@ -272,46 +221,28 @@ define SetupArchive ...@@ -272,46 +221,28 @@ define SetupArchive
$(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE); \ $(PRINTF) "$$($1_EXTRA_MANIFEST_ATTR)\n" >> $$($1_MANIFEST_FILE); \
fi fi
+if [ -s $$@ ]; then \ +if [ -s $$@ ]; then \
$(RM) -r $$($1_PUBAPI_NOTIFICATIONS_FILE) && \ $(ECHO) Modifying $$($1_NAME) && \
$$($1_CAPTURE_PUBAPI_NOTIFICATIONS) \ $$($1_CAPTURE_CONTENTS) \
if [ -s $$($1_PUBAPI_NOTIFICATIONS_FILE) ]; then \ $$($1_CAPTURE_METAINF) \
$(ECHO) Public api change detected in: && \ $(RM) $$($1_DELETES_FILE) && \
$(CAT) $$($1_PUBAPI_NOTIFICATIONS_FILE) | $(TR) '/' '.' | $(SED) 's|^..||g' | $(SED) 's|\.$$$$||g' | $(AWK) '{print " "$$$$1}' && \ $$($1_CAPTURE_DELETES) \
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) \ $(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) && \
$(MAKE) -f $(word 1,$(MAKEFILE_LIST)) $$($1_JAR) ; \ if [ -s $$($1_DELETESS_FILE) ]; then \
else \ $(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \
$(ECHO) Modifying $$($1_NAME) && \ $(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \
$$($1_CAPTURE_CONTENTS) \ fi && \
$$($1_CAPTURE_METAINF) \ $$($1_UPDATE_CONTENTS) true && \
$(RM) $$($1_DELETES_FILE) && \ $$($1_JARINDEX) && true ; \
$$($1_CAPTURE_DELETES) \
$(CAT) $$($1_DELETES_FILE) > $$($1_DELETESS_FILE) && \
if [ -s $$($1_DELETESS_FILE) ]; then \
$(ECHO) " deleting" `$(WC) -l $$($1_DELETESS_FILE) | $(AWK) '{ print $$$$1 }'` files && \
$(ZIP) -q -d $$@ `$(CAT) $$($1_DELETESS_FILE)` ; \
fi && \
$$($1_UPDATE_CONTENTS) true && \
$$($1_JARINDEX) && \
$$($1_TOUCH_API_FILES) true && \
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) true ; \
fi ; \
else \ else \
$(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) && \ $(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) && \
$$($1_SCAPTURE_CONTENTS) \ $$($1_SCAPTURE_CONTENTS) \
$$($1_SCAPTURE_METAINF) \ $$($1_SCAPTURE_METAINF) \
$$($1_SUPDATE_CONTENTS) \ $$($1_SUPDATE_CONTENTS) \
$$($1_JARINDEX) && \ $$($1_JARINDEX) && true ; \
$$($1_TOUCH_API_FILES) true && \
$(RM) -r $$($1_NATIVEAPI_NOTIFICATIONS_FILE) $$($1_NATIVEAPI_FILE) && \
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name "*.notify" $(FIND_DELETE); true) &&) true ; \
fi; fi;
endef endef
define append_to
$(ECHO) "$1" >> $2
endef
define SetupZipArchive define SetupZipArchive
# param 1 is for example ZIP_MYSOURCE # param 1 is for example ZIP_MYSOURCE
# param 2,3,4,5,6,7,8,9 are named args. # param 2,3,4,5,6,7,8,9 are named args.
...@@ -343,7 +274,7 @@ define SetupZipArchive ...@@ -343,7 +274,7 @@ define SetupZipArchive
ifneq ($$($1_EXCLUDES),) ifneq ($$($1_EXCLUDES),)
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES)))) $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES))) $1_ZIP_EXCLUDES := $$(addprefix -x$(SPACE)$(DQUOTE),$$(addsuffix /*$(DQUOTE),$$($1_EXCLUDES)))
$1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS)) $1_ALL_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRC))
endif endif
# Use a slightly shorter name for logging, but with enough path to identify this zip. # Use a slightly shorter name for logging, but with enough path to identify this zip.
...@@ -381,7 +312,8 @@ endef ...@@ -381,7 +312,8 @@ endef
# This macro is used only for properties files that are to be # This macro is used only for properties files that are to be
# copied over to the classes directory in cleaned form: # copied over to the classes directory in cleaned form:
# Previously this was inconsistently done in different repositories. # Previously this was inconsistently done in different repositories.
# This is the new clean standard. # This is the new clean standard. Though it is to be superseded by
# a standard annotation processor from with sjavac.
define add_file_to_copy_and_clean define add_file_to_copy_and_clean
# param 1 = BUILD_MYPACKAGE # param 1 = BUILD_MYPACKAGE
# parma 2 = The source file to copy and clean. # parma 2 = The source file to copy and clean.
...@@ -391,109 +323,8 @@ define add_file_to_copy_and_clean ...@@ -391,109 +323,8 @@ define add_file_to_copy_and_clean
# Now we can setup the depency that will trigger the copying. # Now we can setup the depency that will trigger the copying.
$$($1_BIN)$$($2_TARGET) : $2 $$($1_BIN)$$($2_TARGET) : $2
$(MKDIR) -p $$(@D) $(MKDIR) -p $$(@D)
$(ECHO) Cleaning $$($2_TARGET)
$(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \ $(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
| $(SED) \ | $(SED) -f "$(SRC_ROOT)/common/bin/unicode2x.sed" \
-e 's/\\u0020/\x20/g' \
-e 's/\\u003A/\x3A/g' \
-e 's/\\u006B/\x6B/g' \
-e 's/\\u0075/\x75/g' \
-e 's/\\u00A0/\xA0/g' \
-e 's/\\u00A3/\xA3/g' \
-e 's/\\u00B0/\xB0/g' \
-e 's/\\u00B7/\xB7/g' \
-e 's/\\u00BA/\xBA/g' \
-e 's/\\u00BF/\xBF/g' \
-e 's/\\u00C0/\xC0/g' \
-e 's/\\u00C1/\xC1/g' \
-e 's/\\u00C2/\xC2/g' \
-e 's/\\u00C4/\xC4/g' \
-e 's/\\u00C5/\xC5/g' \
-e 's/\\u00C8/\xC8/g' \
-e 's/\\u00C9/\xC9/g' \
-e 's/\\u00CA/\xCA/g' \
-e 's/\\u00CD/\xCD/g' \
-e 's/\\u00CE/\xCE/g' \
-e 's/\\u00D3/\xD3/g' \
-e 's/\\u00D4/\xD4/g' \
-e 's/\\u00D6/\xD6/g' \
-e 's/\\u00DA/\xDA/g' \
-e 's/\\u00DC/\xDC/g' \
-e 's/\\u00DD/\xDD/g' \
-e 's/\\u00DF/\xDF/g' \
-e 's/\\u00E0/\xE0/g' \
-e 's/\\u00E1/\xE1/g' \
-e 's/\\u00E2/\xE2/g' \
-e 's/\\u00E3/\xE3/g' \
-e 's/\\u00E4/\xE4/g' \
-e 's/\\u00E5/\xE5/g' \
-e 's/\\u00E6/\xE6/g' \
-e 's/\\u00E7/\xE7/g' \
-e 's/\\u00E8/\xE8/g' \
-e 's/\\u00E9/\xE9/g' \
-e 's/\\u00EA/\xEA/g' \
-e 's/\\u00EB/\xEB/g' \
-e 's/\\u00EC/\xEC/g' \
-e 's/\\u00ED/\xED/g' \
-e 's/\\u00EE/\xEE/g' \
-e 's/\\u00EF/\xEF/g' \
-e 's/\\u00F1/\xF1/g' \
-e 's/\\u00F2/\xF2/g' \
-e 's/\\u00F3/\xF3/g' \
-e 's/\\u00F4/\xF4/g' \
-e 's/\\u00F5/\xF5/g' \
-e 's/\\u00F6/\xF6/g' \
-e 's/\\u00F9/\xF9/g' \
-e 's/\\u00FA/\xFA/g' \
-e 's/\\u00FC/\xFC/g' \
-e 's/\\u0020/\x20/g' \
-e 's/\\u003f/\x3f/g' \
-e 's/\\u006f/\x6f/g' \
-e 's/\\u0075/\x75/g' \
-e 's/\\u00a0/\xa0/g' \
-e 's/\\u00a3/\xa3/g' \
-e 's/\\u00b0/\xb0/g' \
-e 's/\\u00ba/\xba/g' \
-e 's/\\u00bf/\xbf/g' \
-e 's/\\u00c1/\xc1/g' \
-e 's/\\u00c4/\xc4/g' \
-e 's/\\u00c5/\xc5/g' \
-e 's/\\u00c8/\xc8/g' \
-e 's/\\u00c9/\xc9/g' \
-e 's/\\u00ca/\xca/g' \
-e 's/\\u00cd/\xcd/g' \
-e 's/\\u00d6/\xd6/g' \
-e 's/\\u00dc/\xdc/g' \
-e 's/\\u00dd/\xdd/g' \
-e 's/\\u00df/\xdf/g' \
-e 's/\\u00e0/\xe0/g' \
-e 's/\\u00e1/\xe1/g' \
-e 's/\\u00e2/\xe2/g' \
-e 's/\\u00e3/\xe3/g' \
-e 's/\\u00e4/\xe4/g' \
-e 's/\\u00e5/\xe5/g' \
-e 's/\\u00e7/\xe7/g' \
-e 's/\\u00e8/\xe8/g' \
-e 's/\\u00e9/\xe9/g' \
-e 's/\\u00ea/\xea/g' \
-e 's/\\u00eb/\xeb/g' \
-e 's/\\u00ec/\xec/g' \
-e 's/\\u00ed/\xed/g' \
-e 's/\\u00ee/\xee/g' \
-e 's/\\u00ef/\xef/g' \
-e 's/\\u00f0/\xf0/g' \
-e 's/\\u00f1/\xf1/g' \
-e 's/\\u00f2/\xf2/g' \
-e 's/\\u00f3/\xf3/g' \
-e 's/\\u00f4/\xf4/g' \
-e 's/\\u00f5/\xf5/g' \
-e 's/\\u00f6/\xf6/g' \
-e 's/\\u00f7/\xf7/g' \
-e 's/\\u00f8/\xf8/g' \
-e 's/\\u00f9/\xf9/g' \
-e 's/\\u00fa/\xfa/g' \
-e 's/\\u00fc/\xfc/g' \
-e 's/\\u00ff/\xff/g' \
| $(SED) -e '/^#/d' -e '/^$$$$/d' \ | $(SED) -e '/^#/d' -e '/^$$$$/d' \
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \ -e :a -e '/\\$$$$/N; s/\\\n//; ta' \
-e 's/^[ \t]*//;s/[ \t]*$$$$//' \ -e 's/^[ \t]*//;s/[ \t]*$$$$//' \
...@@ -504,122 +335,6 @@ define add_file_to_copy_and_clean ...@@ -504,122 +335,6 @@ define add_file_to_copy_and_clean
$1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET) $1_ALL_COPY_CLEAN_TARGETS += $$($1_BIN)$$($2_TARGET)
endef endef
define add_java_package
# param 1 = BUILD_MYPACKAGE
# param 2 = the package target file (_the.package)
# param 3 = src roots, all of them, separated with space
# param 4 = bin root
# param 5 = include these dependecies
# param 6 = not used
# param 7 = if non-empty, then use -Xdeps and -Xpubapi
# param 8 = xremote configuration, or empty.
# param 9 = javac command
# param 10 = javac flags
# param 11 = exclude these files!
# param 12 = only include these files!
# param 13 = javah command
# param 14 = override src roots to be passed into -sourcepath, ugly ugly ugly, do not use this!
# it is only here to workaround ugly things in the source code in the jdk that ought
# to be fixed instead!
ifdef $2_USED_BY
$$(error Attempting to add the package $2 from $3 which is already added with sources from $$($2_USED_BY))
endif
$2_USED_BY:=$3
# Remove the _the.package file to get the target bin dir for the classes in this package.
$2_PACKAGE_BDIR:=$(dir $2)
# The source roots separated with a path separator (: or ; depending on os)
# (The patsubst is necessary to trim away unnecessary spaces.)
ifneq ($(14),)
$2_SRCROOTSC:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$(14))))
else
$2_SRCROOTSC:=$(subst $(SPACE),$(PATH_SEP),$(strip $(patsubst %,%,$3)))
endif
# Suffix the package path to the src roots, to get a list of all possible source locations
# for this package.
$2_PACKAGE_SDIRS:=$$(foreach i,$3,$$(subst $4,$$i,$$($2_PACKAGE_BDIR)))
# Use wildcard in all potential source locations to find the actual sources.
$2_PACKAGE_SRCS:=$$(filter-out $(11),$$(wildcard $$(addsuffix *.java,$$($2_PACKAGE_SDIRS))))
ifneq ($(12),)
# Filter on include file filter if set.
$2_PACKAGE_SRCS:=$$(filter $(12),$$($2_PACKAGE_SRCS))
endif
# Generate a proper package name from the file name.
$2_PACKAGE:=$(patsubst .%.,%,$(subst /,.,$(subst $4,,$(dir $2))))
# Use a javac server for this package?
$2_REMOTE:=$8
# Include previously generated information about what classes are output by this package
# and what sources were used for the compile.
-include $$($2_PACKAGE_BDIR)_the.package.d
# Include the notify, file, that exists if the package has been compiled during a previous make round.
# I.e. we are now dealing with a compile triggered by a pubapi change.
-include $$($2_PACKAGE_BDIR)_the.package.notify
# If the notify file existed, then $$($2_NOTIFIED) will be equal to true.
# Use this information to block dependency tracking for this package.
# This is necessary to cut the circular dependency chains that are so common in Java sources.
ifneq ($$($2_NOTIFIED),true)
# No need to block, since this package has not yet been recompiled.
# Thus include previously generated dependency information. (if it exists)
-include $$($2_PACKAGE_BDIR)_the.package.dddd
# else
# $$(info WAS NOTIFIED $2)
endif
# Should we create proper dependencies between packages?
ifneq ($7,)
# The flag: -XDpubapi:file=foo,package=mypack,notify writes a file foo that contains a
# database of the public api of the classes supplied on the command line and are
# inside the package mypack. If foo already exists, javac will only write to foo,
# if there is a change in the pubapi. I.e. we can use the timestamp of this file
# for triggering dependencies. "notify" means create a "file" suffixed with notify
# if the pubapi really changed.
$2_PUBAPI=-XDpubapi=file=$$($2_PACKAGE_BDIR)_the.package.api,notify,package=$$($2_PACKAGE)
# The flag: -XDnativeapi:file=foo,package=mypack,notify works similar to pubabi, but
# instead tracks native methods. This file can be used to trigger dependencies for
# native compilations.
$2_NATIVEAPI=-XDnativeapi=file=$$($2_PACKAGE_BDIR)_the.package.native,notify,package=$$($2_PACKAGE)
# The flag -XDdeps:file=foo.deps,groupon=package writes a foo.deps file containing packages dependencies:
# java.net : java.io java.lang
# I.e. the classes in .net depend on the public apis of java.io and java.lang
# The dependencies can be grouped on classes instead (groupon=class)
# java.net.Bar : java.io.Socket java.lang.String
$2_DEPS:=-XDdeps=file=$$($2_PACKAGE_BDIR)_the.package.deps,groupon=package
# The next command rewrites the deps output from javac into a proper makefile dependency.
# The dependencies are always to an .api file generated by the pubapi option above.
# This is necessary since java package dependencies are almost always circular.
$2_APPEND_DEPS:=($(CAT) $$($2_PACKAGE_BDIR)_the.package.deps | $(TR) '.' '/' | $(AWK) '{ print "$4/" $$$$3 }' | sort > $$($2_PACKAGE_BDIR)_the.package.ddd && $(GREP) -f $$($2_PACKAGE_BDIR)_the.package.ddd $5 | $(AWK) '{ print "$(dir $2)_the.package : " $$$$1 "_the.package.api" }' > $$($2_PACKAGE_BDIR)_the.package.dddd ; true)
else
# If not using dependencies, use $2 as fallback to trigger regeneration of javah header files.
# This will generate a surplus of header files, but this does not hurt compilation.
$2_NATIVEAPICHANGE_TRIGGER:=$2
$2_FETCH_NATIVEAPICHANGE_CLASSES:=$(CAT) $$($2_PACKAGE_BDIR)_the.package.now|$(GREP) -v '\$$$$'|$(SED) -e 's|$4/||g'|$(SED) 's|.class||g'| $(TR) '/' '.'
endif
# The _the.package file is dependent on the java files inside the package.
# Fill the _the.package file with a list of the java files and compile them
# to class files.
$2 : $$($2_PACKAGE_SRCS)
$(MKDIR) -p $$($2_PACKAGE_BDIR)
$(RM) $2.tmp
$$(call ListPathsSafely,$2_PACKAGE_SRCS,\n, >> $2.tmp)
$(ECHO) $$($2_PACKAGE_BDIR)*.class | $(GREP) -v \*.class | $(TR) ' ' '\n' > $$($2_PACKAGE_BDIR)_the.package.prev
$(RM) $$($2_PACKAGE_BDIR)*.class $$($2_PACKAGE_BDIR)*.notify $$($2_PACKAGE_BDIR)*.deleted
$(ECHO) Compiling `$(WC) $2.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in package $(patsubst $4/%/,%,$(dir $2.tmp))
$9 $$($2_REMOTE) $$($2_DEPS) $$($2_PUBAPI) $$($2_NATIVEAPI) $(10) -implicit:none -sourcepath "$$($2_SRCROOTSC)" -d $4 @$2.tmp
$(ECHO) $$($2_PACKAGE_BDIR)*.class | $(GREP) -v \*.class | $(TR) ' ' '\n' > $$($2_PACKAGE_BDIR)_the.package.now
($(GREP) -xvf $$($2_PACKAGE_BDIR)_the.package.now $$($2_PACKAGE_BDIR)_the.package.prev > $$($2_PACKAGE_BDIR)_the.package.deleted;true)
$(ECHO) $1_CLASSES += `$(CAT) $$($2_PACKAGE_BDIR)_the.package.now` | \
$(SED) 's/\$$$$/\$$$$\$$$$/g' > $$($2_PACKAGE_BDIR)_the.package.d
$(ECHO) $1_JAVAS += $$($2_PACKAGE_SRCS) >> $$($2_PACKAGE_BDIR)_the.package.d
$(ECHO) $2_NOTIFIED:=true > $$($2_PACKAGE_BDIR)_the.package.notify
$$($2_APPEND_DEPS)
$$($2_COPY_FILES)
$(MV) -f $2.tmp $2
endef
define remove_string define remove_string
$2 := $$(subst $1,,$$($2)) $2 := $$(subst $1,,$$($2))
endef endef
...@@ -664,140 +379,101 @@ define SetupJavaCompilation ...@@ -664,140 +379,101 @@ define SetupJavaCompilation
$(if $(14),$1_$(strip $(14))) $(if $(14),$1_$(strip $(14)))
$(if $(15),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk)) $(if $(15),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
# Extract the info from the java compiler setup. # Extract the info from the java compiler setup.
$1_MODE := $$($$($1_SETUP)_MODE) $1_REMOTE := $$($$($1_SETUP)_REMOTE)
ifneq (SINGLE_THREADED_BATCH,$$($1_MODE)) $1_JVM := $$($$($1_SETUP)_JVM)
ifneq (MULTI_CORE_CONCURRENT,$$($1_MODE)) $1_JAVAC := $$($$($1_SETUP)_JAVAC)
$1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
ifeq ($$($1_JAVAC),)
$$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP)) $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
endif endif
endif
$1_USE_DEPS := $$($$($1_SETUP)_USE_DEPS)
$1_REMOTE := $$($$($1_SETUP)_REMOTE)
$1_JVM := $$($$($1_SETUP)_JVM)
$1_JAVAC := $$($$($1_SETUP)_JAVAC)
$1_JAVAH := $$($$($1_SETUP)_JAVAH)
$1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
# Handle addons and overrides.
$1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
# Make sure the dirs exist.
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN))
# Find all files in the source trees.
$1_ALL_SRCS := $$(filter-out $(OVR_SRCS),$$(foreach i,$$($1_SRC),$$(shell $(FIND) $$i -type f)))
# Extract the java files.
ifneq ($$($1_EXCLUDE_FILES),)
$1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES))
endif
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS)))
ifneq ($$($1_INCLUDE_FILES),)
$1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
$1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS))
endif
$1_PKGS := $$(sort $$(dir $$($1_SRCS)))
# Remove the source root from each found path.
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$1_PKGS)))
$1_PKGS := $$(sort $$($1_PKGS))
# There can be only a single bin dir root, no need to foreach over the roots.
$1_BINS := $$(shell $(FIND) $$($1_BIN) -name "*.class")
# Now we have a list of all java files to compile: $$($1_SRCS)
# and we have a list of all existing class files: $$($1_BINS)
# Create the corresponding smart javac wrapper command line.
$1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \
$$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \
$$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \
$$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) -src $$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))
# Prepend the source/bin path to the filter expressions.
ifneq ($$($1_INCLUDES),)
$1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
$1_PKG_INCLUDES := $$(addprefix /,$$(addsuffix /%,$$($1_INCLUDES)))
$1_BIN_INCLUDES := $$(addprefix $$($1_BIN)/,$$(addsuffix /%,$$($1_INCLUDES)))
$1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
$1_PKGS := $$(filter $$($1_PKG_INCLUDES),$$($1_PKGS))
$1_BINS := $$(filter $$($1_BIN_INCLUDES),$$($1_BINS))
endif
ifneq ($$($1_EXCLUDES),)
$1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_PKG_EXCLUDES := $$(addprefix /,$$(addsuffix /%,$$($1_EXCLUDES)))
$1_BIN_EXCLUDES := $$(addprefix $$($1_BIN)/,$$(addsuffix /%,$$($1_EXCLUDES)))
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
$1_PKGS := $$(filter-out $$($1_PKG_EXCLUDES),$$($1_PKGS))
$1_BINS := $$(filter-out $$($1_BIN_EXCLUDES),$$($1_BINS))
endif
# Find all files to be copied from source to bin. # Handle addons and overrides.
ifneq (,$$($1_COPY)) $1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
# Rewrite list of patterns into a find statement. # Make sure the dirs exist.
$1_COPY_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_COPY)) $$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN))
# Search for all files to be copied. # Find all files in the source trees.
$1_ALL_COPIES := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_COPY_PATTERN) \) -a -type f)) $1_ALL_SRCS := $$(filter-out $(OVR_SRCS),$$(foreach i,$$($1_SRC),$$(shell $(FIND) $$i -type f)))
# Copy these explicitly # Extract the java files.
$1_ALL_COPIES += $$($1_COPY_FILES) ifneq ($$($1_EXCLUDE_FILES),)
# Copy must also respect filters. $1_EXCLUDE_FILES_PATTERN:=$$(addprefix %,$$($1_EXCLUDE_FILES))
ifneq (,$$($1_INCLUDES))
$1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDES))
$1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDE_FILES))
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES))
endif endif
# All files below META-INF are always copied. $1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$(filter %.java,$$($1_ALL_SRCS)))
$1_ALL_COPIES += $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i/META-INF -type f 2> /dev/null)) ifneq ($$($1_INCLUDE_FILES),)
ifneq (,$$($1_ALL_COPIES)) $1_INCLUDE_FILES:=$$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
# Yep, there are files to be copied! $1_SRCS := $$(filter $$($1_INCLUDE_FILES), $$($1_SRCS))
$1_ALL_COPY_TARGETS:=
$$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
endif endif
endif
# Find all property files to be copied and cleaned from source to bin. # Now we have a list of all java files to compile: $$($1_SRCS)
ifneq (,$$($1_CLEAN))
# Rewrite list of patterns into a find statement. # Create the corresponding smart javac wrapper command line.
$1_CLEAN_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_CLEAN)) $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \
# Search for all files to be copied. $$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \
$1_ALL_CLEANS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_CLEAN_PATTERN) \) -a -type f)) $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \
# Copy and clean must also respect filters. $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \
ifneq (,$$($1_INCLUDES)) -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))"
$1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS))
endif # Prepend the source/bin path to the filter expressions.
ifneq (,$$($1_EXCLUDES)) ifneq ($$($1_INCLUDES),)
$1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS)) $1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
$1_SRCS := $$(filter $$($1_SRC_INCLUDES),$$($1_SRCS))
endif endif
ifneq (,$$($1_EXCLUDE_FILES)) ifneq ($$($1_EXCLUDES),)
$1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS)) $1_SRC_EXCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_EXCLUDES))))
$1_SRCS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_SRCS))
endif endif
ifneq (,$$($1_ALL_CLEANS))
# Yep, there are files to be copied and cleaned! # Find all files to be copied from source to bin.
$1_ALL_COPY_CLEAN_TARGETS:= ifneq (,$$($1_COPY))
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i))) # Rewrite list of patterns into a find statement.
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! $1_COPY_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_COPY))
# Search for all files to be copied.
$1_ALL_COPIES := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_COPY_PATTERN) \) -a -type f))
# Copy these explicitly
$1_ALL_COPIES += $$($1_COPY_FILES)
# Copy must also respect filters.
ifneq (,$$($1_INCLUDES))
$1_ALL_COPIES := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDES))
$1_ALL_COPIES := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDE_FILES))
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_COPIES))
endif
# All files below META-INF are always copied.
$1_ALL_COPIES += $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i/META-INF -type f 2> /dev/null))
ifneq (,$$($1_ALL_COPIES))
# Yep, there are files to be copied!
$1_ALL_COPY_TARGETS:=
$$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
endif
endif endif
endif
# Find all the directories that contain java sources, each directory # Find all property files to be copied and cleaned from source to bin.
# corresponds to a package because we expect the source ifneq (,$$($1_CLEAN))
# code to be organized in this standardized way! # Rewrite list of patterns into a find statement.
$1_SDIRS := $$(sort $$(dir $$($1_SRCS))) $1_CLEAN_PATTERN:=$(FALSE_FIND_PATTERN) $$(patsubst %,$(SPACE)-o$(SPACE)-name$(SPACE)$(DQUOTE)*%$(DQUOTE),$$($1_CLEAN))
# Now prefix each package with the bin root. # Search for all files to be copied.
$1_BDIRS := $$(foreach i,$$($1_PKGS),$$(addprefix $$($1_BIN),$$i)) $1_ALL_CLEANS := $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i \( $$($1_CLEAN_PATTERN) \) -a -type f))
# Now create a list of the packages that are about to compile. This list is # Copy and clean must also respect filters.
# later used to filter out dependencies that point outside of this set. ifneq (,$$($1_INCLUDES))
$$(shell $(RM) $$($1_BIN)/_the.list_of_packages) $1_ALL_CLEANS := $$(filter $$($1_SRC_INCLUDES),$$($1_ALL_CLEANS))
$$(eval $$(call ListPathsSafelyNow,$1_BDIRS,\n, >> $$($1_BIN)/_the.list_of_packages)) endif
ifneq (,$$($1_EXCLUDES))
ifeq ($$($1_MODE),SINGLE_THREADED_BATCH) $1_ALL_CLEANS := $$(filter-out $$($1_SRC_EXCLUDES),$$($1_ALL_CLEANS))
# Ok, we will feed all the found java files into a single javac invocation. endif
# There can be no dependency checking, nor incremental builds. It is ifneq (,$$($1_EXCLUDE_FILES))
# the best we can do with the old javac. If the javac supports a javac server $1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_FILES_PATTERN),$$($1_ALL_CLEANS))
# then we can use the javac server. endif
ifneq (,$$($1_ALL_CLEANS))
# We can depend on this target file to trigger a regeneration of all the sources # Yep, there are files to be copied and cleaned!
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch $1_ALL_COPY_CLEAN_TARGETS:=
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_copy_and_clean,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files!
endif
endif
# Prep the source paths. # Prep the source paths.
ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),) ifneq ($$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE),)
...@@ -807,113 +483,73 @@ ifeq ($$($1_MODE),SINGLE_THREADED_BATCH) ...@@ -807,113 +483,73 @@ ifeq ($$($1_MODE),SINGLE_THREADED_BATCH)
endif endif
ifneq (,$$($1_HEADERS)) ifneq (,$$($1_HEADERS))
$1_HEADERS_ARG := -h $$($1_HEADERS) $1_HEADERS_ARG := -h $$($1_HEADERS)
endif endif
# Create a sed expression to remove the source roots and to replace / with . # Create a sed expression to remove the source roots and to replace / with .
# and remove .java at the end. # and remove .java at the end.
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
# Here is the batch rules that depends on all the sources. ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
$$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS) # Using sjavac to compile.
$(MKDIR) -p $$(@D) $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/javac_state
$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in batch $1
ifeq ($$($1_NOSJAVAC),)
ifeq ($$(ENABLE_SJAVAC),yes)
mkdir -p $$($1_BIN)_sjavac
$$($1_JVM) $$(word 1,$$($1_JAVAC)) com.sun.tools.javac.smart.Main $$($1_SJAVAC_ARGS) -mfl $$($1_BIN)/_the.batch.tmp -d $$($1_BIN)_sjavac
endif
endif
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \
$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
else
# Ok, we have a modern javac server running!
# Since a single Java file can generate zero to an infinity number of .class files
# the exact number and names of the .class files will only be known after the compile.
# Thus after the compile, a list of the generated classes will be stored in _the.package.d
# which is included by the makefile during the next compile. These .d files will
# add the generated class names to the BUILD_MYPACKAGE_CLASSES variable and used java file names
# to the BUILD_MYPACKAGE_JAVAS variable.
$1_CLASSES :=
$1_JAVAS :=
# Create a file in each package that represents the package dependency.
# This file (_the.package) will also contain a list of the source files
# to be compiled for this package.
$1 := $$(sort $$(patsubst %,%_the.package,$$($1_BDIRS)))
# Now call add_java_package for each package to create the dependencies.
$$(foreach p,$$($1),$$(eval $$(call add_java_package,$1,$$p,$$($1_SRC),$$($1_BIN),$$($1_BIN)/_the.list_of_packages,NOTUSED,$$($1_USE_DEPS),$$($1_REMOTE),$$($1_JVM) $$($1_JAVAC),$$($1_FLAGS),$$($1_EXCLUDE_FILES_PATTERN) $(OVR_SRCS),$$($1_INCLUDE_FILES),$$($1_JVM) $$($1_JAVAH),$$($1_JAVAC_SOURCE_PATH_UGLY_OVERRIDE))))
# All dependencies are setup, now we only need to depend on $1 (aka $(BUILD_MYPACKAGE))
# and they will automatically be built!
# Now add on any files to copy targets
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1)
# Remove the set of found classes from the set of all previously known classes
# and the remainder is the set of missing classes.
$1_MISSING_CLASSES:=$$(filter-out $$($1_BINS),$$($1_CLASSES))
$1_PKGS_MISSING_CLASSES:=$$(sort $$(dir $$($1_MISSING_CLASSES)))
# Remove the set of found java files from the set of all previously known java files
# the remainder is Java files that have gone missing.
$1_MISSING_JAVAS:=$$(filter-out $$($1_SRCS),$$($1_JAVAS))
$1_PKGS_MISSING_JAVAS:=$$(sort $$(dir $$($1_MISSING_JAVAS)))
# Remove each source root from the found paths.
$$(foreach i,$$($1_SRC),$$(eval $$(call remove_string,$$i,$1_PKGS_MISSING_JAVAS)))
# Finally remove duplicates and prefix with the binary path instead.
$1_PKGS_MISSING_JAVAS:= $$(addprefix $$($1_BIN),$$(sort $$($1_PKGS_MISSING_JAVAS)))
# Remove the set of all theoretical classes from the set of found classes.
# the remainder is the set of superfluous classes.
$1_SUPERFLUOUS_CLASSES:=$$(sort $$(filter-out $$($1_CLASSES),$$($1_BINS)))
$1_PKGS_SUPERFLUOUS_CLASSES:=$$(sort $$(dir $$($1_SUPERFLUOUS_CLASSES)))
# Now delete the _the.package files inside the problematic dirs.
# This will force a rebuild of these packages!
$1_FOO:=$$(sort $$($1_PKGS_MISSING_CLASSES) \
$$($1_PKGS_SUPERFLUOUS_CLASSES) \
$$($1_PKGS_MISSING_JAVAS))
# ifneq (,$$($1_FOO))
# $$(info MESSED UP PACKAGES $$($1_FOO))
# endif
$$(shell $(RM) $$(addsuffix _the.package,$$(sort $$($1_PKGS_MISSING_CLASSES) \
$$($1_PKGS_SUPERFLUOUS_CLASSES) \
$$($1_PKGS_MISSING_JAVAS))))
# Normal makefile dependencies based on timestamps will detect the normal use case
# when Java files are simply added or modified.
endif
ifneq (,$$($1_JAR)) $$($1_BIN)/javac_state: $$($1_SRCS) $$($1_DEPENDS)
$(MKDIR) -p $$(@D)
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
$(ECHO) Compiling $1
$$($1_JVM) $$(word 1,$$($1_JAVAC)) com.sun.tools.sjavac.Main \
$$($1_REMOTE) $$($1_SJAVAC_ARGS) --permit-unidentified-artifacts -mfl $$($1_BIN)/_the.batch.tmp \
$$($1_FLAGS) \
-implicit:none -d $$($1_BIN) $$($1_HEADERS_ARG)
else
# Using plain javac to batch compile everything.
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_BIN)/_the.batch
ifeq (,$$($1_SUFFIXES)) # When not using sjavac, pass along all sources to javac using an @file.
$1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY) $$($1_BIN)/_the.batch: $$($1_SRCS) $$($1_DEPENDS)
$(MKDIR) -p $$(@D)
$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) \
-implicit:none -sourcepath "$$($1_SRCROOTSC)" \
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \
$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
endif endif
# A jar file was specified. Set it up. # Check if a jar file was specified, then setup the rules for the jar.
$$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1),\ ifneq (,$$($1_JAR))
SRCS:=$$($1_BIN),\ # If no suffixes was explicitly set for this jar file.
SUFFIXES:=$$($1_SUFFIXES),\ # Use class and the cleaned/copied properties file suffixes as the default
EXCLUDE:=$$($1_EXCLUDES),\ # for the types of files to be put into the jar.
INCLUDES:=$$($1_INCLUDES),\ ifeq (,$$($1_SUFFIXES))
EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS),\ $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
JAR:=$$($1_JAR),\ endif
JARMAIN:=$$($1_JARMAIN),\
MANIFEST:=$$($1_MANIFEST),\ $$(eval $$(call SetupArchive,ARCHIVE_$1,$$($1),\
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\ SRCS:=$$($1_BIN),\
JARINDEX:=$$($1_JARINDEX),\ SUFFIXES:=$$($1_SUFFIXES),\
HEADERS:=$$($1_HEADERS),\ EXCLUDE:=$$($1_EXCLUDES),\
SETUP:=$$($1_SETUP))) INCLUDES:=$$($1_INCLUDES),\
endif EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS),\
JAR:=$$($1_JAR),\
JARMAIN:=$$($1_JARMAIN),\
MANIFEST:=$$($1_MANIFEST),\
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR),\
JARINDEX:=$$($1_JARINDEX),\
HEADERS:=$$($1_HEADERS),\
SETUP:=$$($1_SETUP)))
endif
ifneq (,$$($1_SRCZIP)) # Check if a srczip was specified, then setup the rules for the srczip.
# A srczip file was specified. Set it up. ifneq (,$$($1_SRCZIP))
$$(eval $$(call SetupZipArchive,ARCHIVE_$1,\ $$(eval $$(call SetupZipArchive,ARCHIVE_$1,\
SRC:=$$($1_SRC),\ SRC:=$$($1_SRC),\
ZIP:=$$($1_SRCZIP),\ ZIP:=$$($1_SRCZIP),\
INCLUDES:=$$($1_INCLUDES),\ INCLUDES:=$$($1_INCLUDES),\
EXCLUDES:=$$($1_EXCLUDES),\ EXCLUDES:=$$($1_EXCLUDES),\
EXCLUDE_FILES:=$$($1_EXCLUDE_FILES))) EXCLUDE_FILES:=$$($1_EXCLUDE_FILES)))
endif endif
endef endef
...@@ -138,7 +138,7 @@ endef ...@@ -138,7 +138,7 @@ endef
# Hook to be called as the very first thing when running a normal build # Hook to be called as the very first thing when running a normal build
define AtRootMakeStart 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 PrintStartMessage)
$(call StartTimer) $(call StartTimer)
endef endef
......
...@@ -57,9 +57,25 @@ endef ...@@ -57,9 +57,25 @@ endef
define ParseLogLevel define ParseLogLevel
ifeq ($$(origin VERBOSE),undefined) ifeq ($$(origin VERBOSE),undefined)
# Setup logging according to LOG (but only if VERBOSE is not given) # 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),) ifeq ($$(LOG),)
# Set LOG to "warn" as default if not set (and no VERBOSE given) # Set LOG to "warn" as default if not set (and no VERBOSE given)
LOG=warn override LOG=warn
endif endif
ifeq ($$(LOG),warn) ifeq ($$(LOG),warn)
VERBOSE=-s VERBOSE=-s
...@@ -182,4 +198,11 @@ define PrintEndMessage ...@@ -182,4 +198,11 @@ define PrintEndMessage
$(call CheckEnvironment) $(call CheckEnvironment)
endef 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 endif # _MAKEHELPERS_GMK
...@@ -26,6 +26,11 @@ ...@@ -26,6 +26,11 @@
# This must be the first rule # This must be the first rule
default: all default: all
# 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:
# Locate this Makefile # Locate this Makefile
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),) ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST)) makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
...@@ -41,18 +46,18 @@ $(eval $(call ParseLogLevel)) ...@@ -41,18 +46,18 @@ $(eval $(call ParseLogLevel))
$(eval $(call SetupLogging)) $(eval $(call SetupLogging))
$(eval $(call ParseConfAndSpec)) $(eval $(call ParseConfAndSpec))
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
# hence this workaround.
ifeq ($(JOBS),)
JOBS=$(NUM_CORES)
endif
ifneq ($(words $(SPEC)),1) ifneq ($(words $(SPEC)),1)
### We have multiple configurations to build, call make repeatedly ### We have multiple configurations to build, call make repeatedly
all jdk hotspot jaxws jaxp corba langtools install images clean dist-clean: all clean dist-clean:
@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@ $(MAKE_ARGS)) &&) true langtools corba jaxp jaxws hotspot jdk images overlay-images install:
langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only:
clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images:
@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@) &&) true
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images clean dist-clean .PHONY: all clean dist-clean
.PHONY: langtools corba jaxp jaxws hotspot jdk images overlay-images install
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only overlay-images-only install-only
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images
else else
### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file. ### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
...@@ -77,77 +82,110 @@ ifneq (,$(BUILD_LOG)) ...@@ -77,77 +82,110 @@ ifneq (,$(BUILD_LOG))
endif endif
# Remove any javac server logs and port files. This # Remove any javac server logs and port files. This
# prevents a new make run to reuse the previous servers. # prevents a new make run to reuse the previous servers.
ifneq (,$(JAVAC_SERVERS)) ifneq (,$(SJAVAC_SERVER_DIR))
$(shell mkdir -p $(JAVAC_SERVERS) && rm -rf $(JAVAC_SERVERS)/*) $(shell $(MKDIR) -p $(SJAVAC_SERVER_DIR) && $(RM) -rf $(SJAVAC_SERVER_DIR)/*)
endif endif
# Clean out any notifications from the previous build. # Clean out any notifications from the previous build.
$(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE)) $(shell $(FIND) $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
# Reset the build timers. # Reset the build timers.
$(eval $(call ResetTimers)) $(eval $(call ResetTimers))
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
# hence this workaround.
ifeq ($(JOBS),)
JOBS=$(NUM_CORES)
endif
MAKE_ARGS:=$(MAKE_ARGS) -j$(JOBS)
### Main targets ### Main targets
all: jdk all: jdk
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port) @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
@$(call AtRootMakeEnd) @$(call AtRootMakeEnd)
.PHONY: all
langtools: start-make langtools-only langtools: start-make langtools-only
langtools-only: langtools-only:
@$(call MakeStart,langtools,all) @$(call MakeStart,langtools,all)
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS)) @($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
@$(call MakeFinish,langtools,all) @$(call MakeFinish,langtools,all)
corba: langtools corba-only corba: langtools corba-only
corba-only: corba-only:
@$(call MakeStart,corba,all) @$(call MakeStart,corba,all)
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS)) @($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
@$(call MakeFinish,corba,all) @$(call MakeFinish,corba,all)
jaxp: langtools jaxp-only jaxp: langtools jaxp-only
jaxp-only: jaxp-only:
@$(call MakeStart,jaxp,all) @$(call MakeStart,jaxp,all)
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS)) @($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
@$(call MakeFinish,jaxp,all) @$(call MakeFinish,jaxp,all)
jaxws: langtools jaxp jaxws-only jaxws: langtools jaxp jaxws-only
jaxws-only: jaxws-only:
@$(call MakeStart,jaxws,all) @$(call MakeStart,jaxws,all)
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS)) @($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS))
@$(call MakeFinish,jaxws,all) @$(call MakeFinish,jaxws,all)
hotspot: langtools hotspot-only hotspot: langtools hotspot-only
hotspot-only: hotspot-only:
@$(call MakeStart,hotspot,all) @$(call MakeStart,hotspot,all)
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) $(MAKE_ARGS)) @($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
@$(call MakeFinish,hotspot,all) @$(call MakeFinish,hotspot,all)
jdk: langtools corba jaxp jaxws hotspot jdk-only jdk: langtools corba jaxp jaxws hotspot jdk-only
jdk-only: jdk-only:
@$(call MakeStart,jdk,all) @$(call MakeStart,jdk,all)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS)) @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) $(JDK_TARGET))
@$(call MakeFinish,jdk,all) @$(call MakeFinish,jdk,all)
images: source-tips start-make jdk langtools corba jaxp jaxws hotspot images-only images: source-tips start-make jdk langtools corba jaxp jaxws hotspot images-only
images-only: images-only:
@$(call MakeStart,jdk-images,$@) @$(call MakeStart,jdk-images,$@)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(JDK_MAKE_ARGS) $(MAKE_ARGS) images) @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) images)
@$(call MakeFinish,jdk-images,$@) @$(call MakeFinish,jdk-images,$@)
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port) @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
@$(call AtRootMakeEnd)
overlay-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot overlay-images-only
overlay-images-only:
@$(call MakeStart,jdk-overlay-images,$@)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) overlay-images)
@$(call MakeFinish,jdk-overlay-images,$@)
@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
@$(call AtRootMakeEnd) @$(call AtRootMakeEnd)
install: source-tips start-make jdk langtools corba jaxp jaxws hotspot install-only install: source-tips start-make jdk langtools corba jaxp jaxws hotspot install-only
install-only: install-only:
@$(call MakeStart,jdk-images,$@) @$(call MakeStart,jdk-images,$@)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(JDK_MAKE_ARGS) $(MAKE_ARGS) install) @($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) install)
@$(call MakeFinish,jdk-images,$@) @$(call MakeFinish,jdk-images,$@)
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port) @$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
@$(call AtRootMakeEnd) @$(call AtRootMakeEnd)
docs: start-make jdk docs-only
docs-only:
@$(call MakeStart,docs,$@)
@($(CD) $(SRC_ROOT)/common/makefiles/javadoc && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
@$(call MakeFinish,docs,$@)
@$(if $(SJAVAC_SERVER_DIR),$(RM) -rf $(SJAVAC_SERVER_DIR)/*.port)
@$(call AtRootMakeEnd)
.PHONY: langtools corba jaxp jaxws hotspot jdk images install
.PHONY: langtools-only corba-only jaxp-only jaxws-only hotspot-only jdk-only images-only install-only
start-make: start-make:
@$(call AtRootMakeStart) @$(call AtRootMakeStart)
.PHONY: start-make
.PHONY: jdk hotspot jaxws jaxp corba langtools install images start-make bootcycle-images:
@$(ECHO) Boot cycle build step 1: Building the JDK image normally
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(SPEC) images)
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
test: start-make test: start-make
@$(call MakeStart,test,$(if $(TEST),$(TEST),all)) @$(call MakeStart,test,$(if $(TEST),$(TEST),all))
...@@ -167,8 +205,8 @@ $(OUTPUT_ROOT)/source_tips: FRC ...@@ -167,8 +205,8 @@ $(OUTPUT_ROOT)/source_tips: FRC
# Remove everything, except the output from configure. # Remove everything, except the output from configure.
clean: clean: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images clean-bootcycle-build
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v spec.sh | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | grep -v "localdevenv.*" | grep -v uncygdrive.exe`) @($(CD) $(OUTPUT_ROOT) && $(RM) -r tmp source_tips build.log*)
@$(ECHO) Cleaned everything except the build configuration. @$(ECHO) Cleaned everything except the build configuration.
.PHONY: clean .PHONY: clean
...@@ -178,11 +216,24 @@ dist-clean: ...@@ -178,11 +216,24 @@ dist-clean:
@$(ECHO) Cleaned everything, you will have to re-run configure. @$(ECHO) Cleaned everything, you will have to re-run configure.
.PHONY: dist-clean .PHONY: dist-clean
clean-langtools:
$(call CleanComponent,langtools)
clean-corba:
$(call CleanComponent,corba)
clean-jaxp:
$(call CleanComponent,jaxp)
clean-jaxws:
$(call CleanComponent,jaxws)
clean-hotspot:
$(call CleanComponent,hotspot)
clean-jdk: clean-jdk:
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v spec.sh | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | \ $(call CleanComponent,jdk)
grep -v langtools | grep -v corba | grep -v jaxp | grep -v jaxws | grep -v hotspot`) clean-images:
@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)" $(call CleanComponent,images)
.PHONY: clean clean-bootcycle-build:
$(call CleanComponent,bootcycle-build)
.PHONY: clean-langtools clean-corba clean-jaxp clean-jaxws clean-hotspot clean-jdk clean-images
endif endif
...@@ -195,24 +246,39 @@ help: ...@@ -195,24 +246,39 @@ help:
$(info =====================) $(info =====================)
$(info ) $(info )
$(info Common make targets) $(info Common make targets)
$(info . make [all] # Compile all code but do not create images) $(info . make [all] # Compile all code but do not create images)
$(info . make images # Create complete j2sdk and j2re images) $(info . make images # Create complete j2sdk and j2re images)
$(info . make install # Install the generated images locally) $(info . make overlay-images # Create limited images for sparc 64 bit platforms)
$(info . make clean # Remove all files generated by make, but not those generated by configure) $(info . make bootcycle-images # Build images twice, second time with newly build JDK)
$(info . make dist-clean # Remove all files generated by both make and configure) $(info . make install # Install the generated images locally)
$(info . make help # Give some help on using make) $(info . make clean # Remove all files generated by make, but not those)
$(info . make test # Run tests, default is all tests (see TEST below)) $(info . # generated by configure)
$(info . make dist-clean # Remove all files, including configuration)
$(info . make help # Give some help on using make)
$(info . make test # Run tests, default is all tests (see TEST below))
$(info )
$(info Targets for specific components)
$(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk or images))
$(info . make <component> # Build <component> and everything it depends on. )
$(info . make <component>-only # Build <component> only, without dependencies. This)
$(info . # is faster but can result in incorrect build results!)
$(info . make clean-<component> # Remove files generated by make for <component>)
$(info ) $(info )
$(info Useful make variables) $(info Useful make variables)
$(info . make CONF= # Build all configurations (note, assignment is empty)) $(info . make CONF= # Build all configurations (note, assignment is empty))
$(info . make CONF=<substring> # Build the configuration(s) with a name matching the given substring) $(info . make CONF=<substring> # Build the configuration(s) with a name matching)
$(info . # <substring>)
$(info )
$(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>)
$(info . # Available log levels are:)
$(info . # 'warn' (default), 'info', 'debug' and 'trace')
$(info . # To see executed command lines, use LOG=info)
$(info ) $(info )
$(info . make LOG=<loglevel> # Change loglevel from warn (default) to the given loglevel) $(info . make JOBS=<n> # Run <n> parallel make jobs)
$(info . # Available loglevels are: warn, info, debug and trace) $(info . # Note that -jN does not work as expected!)
$(info . # To see executed command lines, use LOG=info)
$(info ) $(info )
$(info . make test TEST=<test> # Only run the given test or tests, e.g.) $(info . make test TEST=<test> # Only run the given test or tests, e.g.)
$(info . # make test TEST="jdk_lang jdk_net") $(info . # make test TEST="jdk_lang jdk_net")
$(info ) $(info )
.PHONY: help .PHONY: help
FRC: # Force target FRC: # Force target
...@@ -55,22 +55,22 @@ define add_native_source ...@@ -55,22 +55,22 @@ define add_native_source
ifneq (,$$(filter %.c,$2)) ifneq (,$$(filter %.c,$2))
# Compile as a C file # Compile as a C file
$1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -c $1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$5 $1_$2_COMP=$5
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS) $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
else ifneq (,$$(filter %.m,$2)) else ifneq (,$$(filter %.m,$2))
# Compile as a objective-c file # Compile as a objective-c file
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -c $1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$5 $1_$2_COMP=$5
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS) $1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
else ifneq (,$$(filter %.s,$2)) else ifneq (,$$(filter %.s,$2))
# Compile as assembler file # Compile as assembler file
$1_$2_FLAGS=$8 $1_$2_FLAGS=$8 -DTHIS_FILE='"$$(<F)"'
$1_$2_COMP=$(AS) $1_$2_COMP=$(AS)
$1_$2_DEP_FLAG:= $1_$2_DEP_FLAG:=
else else
# Compile as a C++ file # Compile as a C++ file
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -c $1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -DTHIS_FILE='"$$(<F)"' -c
$1_$2_COMP=$7 $1_$2_COMP=$7
$1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS) $1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
endif endif
...@@ -98,7 +98,6 @@ define add_native_source ...@@ -98,7 +98,6 @@ define add_native_source
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
endif endif
ifeq ($(COMPILER_TYPE),CL) ifeq ($(COMPILER_TYPE),CL)
$$(call COMPILING_MSG,$$(notdir $2))
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2 $$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
endif endif
endif endif
...@@ -129,6 +128,7 @@ define SetupNativeCompilation ...@@ -129,6 +128,7 @@ define SetupNativeCompilation
# DEBUG_SYMBOLS add debug symbols (if configured on) # DEBUG_SYMBOLS add debug symbols (if configured on)
# CC the compiler to use, default is $(CC) # CC the compiler to use, default is $(CC)
# LDEXE the linker to use for linking executables, default is $(LDEXE) # LDEXE the linker to use for linking executables, default is $(LDEXE)
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
$(if $2,$1_$(strip $2)) $(if $2,$1_$(strip $2))
$(if $3,$1_$(strip $3)) $(if $3,$1_$(strip $3))
$(if $4,$1_$(strip $4)) $(if $4,$1_$(strip $4))
...@@ -149,7 +149,11 @@ define SetupNativeCompilation ...@@ -149,7 +149,11 @@ define SetupNativeCompilation
$(if $(19),$1_$(strip $(19))) $(if $(19),$1_$(strip $(19)))
$(if $(20),$1_$(strip $(20))) $(if $(20),$1_$(strip $(20)))
$(if $(21),$1_$(strip $(21))) $(if $(21),$1_$(strip $(21)))
$(if $(22),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk)) $(if $(22),$1_$(strip $(22)))
$(if $(23),$1_$(strip $(23)))
$(if $(24),$1_$(strip $(24)))
$(if $(25),$1_$(strip $(25)))
$(if $(26),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
ifneq (,$$($1_BIN)) ifneq (,$$($1_BIN))
$$(error BIN has been replaced with OBJECT_DIR) $$(error BIN has been replaced with OBJECT_DIR)
...@@ -315,6 +319,17 @@ define SetupNativeCompilation ...@@ -315,6 +319,17 @@ define SetupNativeCompilation
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release) $1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
endif endif
ifneq (,$$($1_DEBUG_SYMBOLS))
ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
# Programs don't get the debug symbols added in the old build. It's not clear if
# this is intentional.
ifeq ($$($1_PROGRAM),)
$1_EXTRA_CFLAGS+=$(CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS+=$(CXXFLAGS_DEBUG_SYMBOLS)
endif
endif
endif
ifeq ($$($1_CXXFLAGS),) ifeq ($$($1_CXXFLAGS),)
$1_CXXFLAGS:=$$($1_CFLAGS) $1_CXXFLAGS:=$$($1_CFLAGS)
endif endif
...@@ -327,40 +342,20 @@ define SetupNativeCompilation ...@@ -327,40 +342,20 @@ define SetupNativeCompilation
$1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER) $1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
endif endif
ifneq (no, $(ENABLE_DEBUG_SYMBOLS))
ifneq ($(OPENJDK_TARGET_OS), solaris)
# <weird code />
# There is very weird code in Defs-solaris.gmk that first sets variables as decribed below
# and then a couple of hundreds of line below resets them...
# this feels like a sure bug...but before this is confirmed, mimic this behaviour
# (note: skip indenting this as it will surely be removed anyway)
# <weird code />
ifneq (,$$($1_DEBUG_SYMBOLS))
$1_OPTIMIZATION := LOW
$1_EXTRA_CFLAGS += $(CFLAGS_DEBUG_SYMBOLS)
$1_EXTRA_CXXFLAGS += $(CXXFLAGS_DEBUG_SYMBOLS)
endif
# <weird code />
endif
# <weird code />
endif
ifeq (NONE, $$($1_OPTIMIZATION)) ifeq (NONE, $$($1_OPTIMIZATION))
$1_EXTRA_CFLAGS += $$(C_O_FLAG_NONE) $1_EXTRA_CFLAGS += $(C_O_FLAG_NONE)
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_NONE) $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NONE)
else ifeq (LOW, $$($1_OPTIMIZATION)) else ifeq (LOW, $$($1_OPTIMIZATION))
$1_EXTRA_CFLAGS += $$(C_O_FLAG_NORM) $1_EXTRA_CFLAGS += $(C_O_FLAG_NORM)
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_NORM) $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_NORM)
else ifeq (HIGH, $$($1_OPTIMIZATION)) else ifeq (HIGH, $$($1_OPTIMIZATION))
$1_EXTRA_CFLAGS += $$(C_O_FLAG_HI) $1_EXTRA_CFLAGS += $(C_O_FLAG_HI)
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_HI) $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HI)
else ifeq (HIGHEST, $$($1_OPTIMIZATION)) else ifeq (HIGHEST, $$($1_OPTIMIZATION))
$1_EXTRA_CFLAGS += $$(C_O_FLAG_HIGHEST) $1_EXTRA_CFLAGS += $(C_O_FLAG_HIGHEST)
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_HIGHEST) $1_EXTRA_CXXFLAGS += $(CXX_O_FLAG_HIGHEST)
else ifneq (, $$($1_OPTIMIZATION)) else ifneq (, $$($1_OPTIMIZATION))
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION)) $$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
endif endif
# Now create a list of the packages that are about to compile. Used when sending source # Now create a list of the packages that are about to compile. Used when sending source
...@@ -375,7 +370,7 @@ define SetupNativeCompilation ...@@ -375,7 +370,7 @@ define SetupNativeCompilation
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS)))) $$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS))))
# On windows we need to create a resource file # On windows we need to create a resource file
ifeq ($(OPENJDK_TARGET_OS_API), winapi) ifeq ($(OPENJDK_TARGET_OS), windows)
ifneq (,$$($1_VERSIONINFO_RESOURCE)) ifneq (,$$($1_VERSIONINFO_RESOURCE))
$1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res $1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
$$($1_RES): $$($1_VERSIONINFO_RESOURCE) $$($1_RES): $$($1_VERSIONINFO_RESOURCE)
...@@ -409,8 +404,8 @@ define SetupNativeCompilation ...@@ -409,8 +404,8 @@ define SetupNativeCompilation
endif endif
endif endif
# Pickup extra OPENJDK_TARGET_OS_API dependent variables (posix or winapi) and # Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables
# (linux,solaris,windows,bsd) for LDFLAGS and LDFLAGS_SUFFIX # for LDFLAGS and LDFLAGS_SUFFIX
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS)) $1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS)) $1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
ifneq (,$$($1_REAL_MAPFILE)) ifneq (,$$($1_REAL_MAPFILE))
...@@ -432,9 +427,10 @@ define SetupNativeCompilation ...@@ -432,9 +427,10 @@ define SetupNativeCompilation
"-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map" "-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map"
endif endif
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR))
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/%
$(CP) $$< $$@ $(CP) $$< $$@
endif
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(OPENJDK_TARGET_OS), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
...@@ -509,8 +505,10 @@ define SetupNativeCompilation ...@@ -509,8 +505,10 @@ define SetupNativeCompilation
"-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map" "-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map"
endif endif
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/% ifneq ($$($1_OUTPUT_DIR),$$($1_OBJECT_DIR))
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/%
$(CP) $$< $$@ $(CP) $$< $$@
endif
ifeq ($(OPENJDK_TARGET_OS), solaris) ifeq ($(OPENJDK_TARGET_OS), solaris)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
......
#
# Copyright (c) 2001, 2011, 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.
#
# EXCLUDE_PKGS is the list of packages to exclude from the
# Java API Specification. Do not add these to CORE_PKGS.
# The concatenation of EXCLUDE_PKGS and CORE_PKGS
# should make up the list of all packages under the
# src/shared/classes directory of the JDK source tree.
#
EXCLUDE_PKGS = \
java.awt.peer \
java.awt.dnd.peer \
sun.* \
com.sun.* \
org.apache.* \
org.jcp.* \
org.w3c.dom.css \
org.w3c.dom.html \
org.w3c.dom.stylesheets \
org.w3c.dom.traversal \
org.w3c.dom.ranges \
org.w3c.dom.views \
org.omg.stub.javax.management.remote.rmi
#
# ACTIVE_JSR_PKGS are packages that are part of an active JSR process--
# one that is doing its own review. These packages are not included when
# creating diff pages for the platform's JCP process.
#
# (see /java/pubs/apisrc/jdk/6.0/beta/make/docs/active_jsr_pkgs)
# Note:
# This is a list of regular expressions. So foo.* matches "foo" and "foo.bar".
#
ACTIVE_JSR_PKGS= \
java.lang.invoke \
java.sql \
javax.activation \
javax.annotation.* \
javax.jws.* \
javax.lang.* \
javax.management.* \
javax.script \
javax.sql.* \
javax.tools.* \
javax.xml.* \
org.w3c.* \
org.xml.sax
#
# CORE_PKGS is the list of packages that form the
# Java API Specification.
#
### ***IMPORTANT NOTE***
### There is also a "REGEXP" variable in the docs/makefile that
### determines which table the packages go in on the main page.
### Currently, there is only table ("Platform Packages") and
### everything goes in it, so REGEXP is "*". But if that policy
### changes, packages added will need to be reflected in that
### list of wildcard expressions, as well.
###
CORE_PKGS = \
java.applet \
java.awt \
java.awt.color \
java.awt.datatransfer \
java.awt.dnd \
java.awt.event \
java.awt.font \
java.awt.geom \
java.awt.im \
java.awt.im.spi \
java.awt.image \
java.awt.image.renderable \
java.awt.print \
java.beans \
java.beans.beancontext \
java.io \
java.lang \
java.lang.annotation \
java.lang.instrument \
java.lang.invoke \
java.lang.management \
java.lang.ref \
java.lang.reflect \
java.math \
java.net \
java.nio \
java.nio.channels \
java.nio.channels.spi \
java.nio.charset \
java.nio.charset.spi \
java.nio.file \
java.nio.file.attribute \
java.nio.file.spi \
java.rmi \
java.rmi.activation \
java.rmi.dgc \
java.rmi.registry \
java.rmi.server \
java.security \
java.security.acl \
java.security.cert \
java.security.interfaces \
java.security.spec \
java.sql \
java.text \
java.text.spi \
java.util \
java.util.concurrent \
java.util.concurrent.atomic \
java.util.concurrent.locks \
java.util.jar \
java.util.logging \
java.util.prefs \
java.util.regex \
java.util.spi \
java.util.zip \
javax.accessibility \
javax.activation \
javax.activity \
javax.annotation \
javax.annotation.processing \
javax.crypto \
javax.crypto.interfaces \
javax.crypto.spec \
javax.imageio \
javax.imageio.event \
javax.imageio.metadata \
javax.imageio.plugins.jpeg \
javax.imageio.plugins.bmp \
javax.imageio.spi \
javax.imageio.stream \
javax.jws \
javax.jws.soap \
javax.lang.model \
javax.lang.model.element \
javax.lang.model.type \
javax.lang.model.util \
javax.management \
javax.management.loading \
javax.management.monitor \
javax.management.relation \
javax.management.openmbean \
javax.management.timer \
javax.management.modelmbean \
javax.management.remote \
javax.management.remote.rmi \
javax.naming \
javax.naming.directory \
javax.naming.event \
javax.naming.ldap \
javax.naming.spi \
javax.net \
javax.net.ssl \
javax.print \
javax.print.attribute \
javax.print.attribute.standard \
javax.print.event \
javax.rmi \
javax.rmi.CORBA \
javax.rmi.ssl \
javax.script \
javax.security.auth \
javax.security.auth.callback \
javax.security.auth.kerberos \
javax.security.auth.login \
javax.security.auth.spi \
javax.security.auth.x500 \
javax.security.cert \
javax.security.sasl \
javax.sound.sampled \
javax.sound.sampled.spi \
javax.sound.midi \
javax.sound.midi.spi \
javax.sql \
javax.sql.rowset \
javax.sql.rowset.serial \
javax.sql.rowset.spi \
javax.swing \
javax.swing.border \
javax.swing.colorchooser \
javax.swing.filechooser \
javax.swing.event \
javax.swing.table \
javax.swing.text \
javax.swing.text.html \
javax.swing.text.html.parser \
javax.swing.text.rtf \
javax.swing.tree \
javax.swing.undo \
javax.swing.plaf \
javax.swing.plaf.basic \
javax.swing.plaf.metal \
javax.swing.plaf.multi \
javax.swing.plaf.nimbus \
javax.swing.plaf.synth \
javax.tools \
javax.tools.annotation \
javax.transaction \
javax.transaction.xa \
javax.xml.parsers \
javax.xml.bind \
javax.xml.bind.annotation \
javax.xml.bind.annotation.adapters \
javax.xml.bind.attachment \
javax.xml.bind.helpers \
javax.xml.bind.util \
javax.xml.soap \
javax.xml.ws \
javax.xml.ws.handler \
javax.xml.ws.handler.soap \
javax.xml.ws.http \
javax.xml.ws.soap \
javax.xml.ws.spi \
javax.xml.ws.spi.http \
javax.xml.ws.wsaddressing \
javax.xml.transform \
javax.xml.transform.sax \
javax.xml.transform.dom \
javax.xml.transform.stax \
javax.xml.transform.stream \
javax.xml \
javax.xml.crypto \
javax.xml.crypto.dom \
javax.xml.crypto.dsig \
javax.xml.crypto.dsig.dom \
javax.xml.crypto.dsig.keyinfo \
javax.xml.crypto.dsig.spec \
javax.xml.datatype \
javax.xml.validation \
javax.xml.namespace \
javax.xml.xpath \
javax.xml.stream \
javax.xml.stream.events \
javax.xml.stream.util \
org.ietf.jgss \
org.omg.CORBA \
org.omg.CORBA.DynAnyPackage \
org.omg.CORBA.ORBPackage \
org.omg.CORBA.TypeCodePackage \
org.omg.stub.java.rmi \
org.omg.CORBA.portable \
org.omg.CORBA_2_3 \
org.omg.CORBA_2_3.portable \
org.omg.CosNaming \
org.omg.CosNaming.NamingContextExtPackage \
org.omg.CosNaming.NamingContextPackage \
org.omg.SendingContext \
org.omg.PortableServer \
org.omg.PortableServer.CurrentPackage \
org.omg.PortableServer.POAPackage \
org.omg.PortableServer.POAManagerPackage \
org.omg.PortableServer.ServantLocatorPackage \
org.omg.PortableServer.portable \
org.omg.PortableInterceptor \
org.omg.PortableInterceptor.ORBInitInfoPackage \
org.omg.Messaging \
org.omg.IOP \
org.omg.IOP.CodecFactoryPackage \
org.omg.IOP.CodecPackage \
org.omg.Dynamic \
org.omg.DynamicAny \
org.omg.DynamicAny.DynAnyPackage \
org.omg.DynamicAny.DynAnyFactoryPackage \
org.w3c.dom \
org.w3c.dom.events \
org.w3c.dom.bootstrap \
org.w3c.dom.ls \
org.xml.sax \
org.xml.sax.ext \
org.xml.sax.helpers
# Copyright (c) 1997, 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 $(SPEC)
include MakeBase.gmk
.SUFFIXES: # Delete the default suffixes
.SUFFIXES: .java
#
# Definitions for $(DOCSDIR), $(MKDIR), $(BINDIR), etc.
#
CLASSPATH_SEPARATOR = :
DOCSDIR=$(OUTPUT_ROOT)/docs
TEMPDIR=$(OUTPUT_ROOT)/docstemp
JDK_SHARE_SRC=$(JDK_TOPDIR)/src/share
JDK_SHARE_CLASSES=$(JDK_SHARE_SRC)/classes
JDK_IMPSRC = $(JDK_OUTPUTDIR)/impsrc
JDK_GENSRC = $(JDK_OUTPUTDIR)/gensrc
HOTSPOT_DOCS_IMPORT_PATH=$(HOTSPOT_OUTPUTDIR)/docs
BUILD_NUMBER=$(JDK_BUILD_NUMBER)
BOOT_JAVA_CMD=$(JAVA)
# Langtools
JAVAC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javac.jar
JAVADOC_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/javadoc.jar
DOCLETS_JAR = $(LANGTOOLS_DIST)/bootstrap/lib/doclets.jar
JAVADOC_CMD = $(BOOT_JAVA_CMD) \
-Xmx1024m \
-Djava.awt.headless=true \
"-Xbootclasspath/p:$(JAVADOC_JAR)$(CLASSPATH_SEPARATOR)$(JAVAC_JAR)$(CLASSPATH_SEPARATOR)$(DOCLETS_JAR)" \
-jar $(JAVADOC_JAR)
JAVADOC_CMD = javadoc
# Copyright year for beginning of Java and some of the apis
# (Needed when creating the javadocs)
FIRST_COPYRIGHT_YEAR = 1993
DOMAPI_FIRST_COPYRIGHT_YEAR = 2005
MIRROR_FIRST_COPYRIGHT_YEAR = 2004
DOCLETAPI_FIRST_COPYRIGHT_YEAR = 1993
TAGLETAPI_FIRST_COPYRIGHT_YEAR = 1993
JDI_FIRST_COPYRIGHT_YEAR = 1999
JAAS_FIRST_COPYRIGHT_YEAR = 1998
JGSS_FIRST_COPYRIGHT_YEAR = 2000
SMARTCARDIO_FIRST_COPYRIGHT_YEAR = 2005
HTTPSERVER_FIRST_COPYRIGHT_YEAR = 2005
MGMT_FIRST_COPYRIGHT_YEAR = 2003
ATTACH_FIRST_COPYRIGHT_YEAR = 2005
JCONSOLE_FIRST_COPYRIGHT_YEAR = 2006
SCTPAPI_FIRST_COPYRIGHT_YEAR = 2009
TRACING_FIRST_COPYRIGHT_YEAR = 2008
TREEAPI_FIRST_COPYRIGHT_YEAR = 2005
JNLP_FIRST_COPYRIGHT_YEAR = 1998
PLUGIN2_FIRST_COPYRIGHT_YEAR = 2007
# Oracle name
FULL_COMPANY_NAME = Oracle and/or its affiliates
# Copyright address
COMPANY_ADDRESS = 500 Oracle Parkway<br>Redwood Shores, CA 94065 USA.
# The trademark symbol
TRADEMARK = &trade;
# Common copyright lines used
# The word "Copyright" might optionally be a link to the file cpyr.html.
# The first year of copyright may vary or not be available.
# The address to the company might be optional.
COMMA:= ,
EMPTY:=
SPACE:=$(EMPTY) $(EMPTY)
COPYRIGHT_SYMBOL = &\#x00a9;
# Macro to construct the copyright line
# (The GNU make 3.78.1 "if" conditional is broken, fixed in GNU make 3.81)
define CopyrightLine # optionalurl optionalfirstyear optionaladdress
$(if $(strip $1),<a href="$(strip $1)">Copyright</a>,Copyright) \
$(COPYRIGHT_SYMBOL) $(if $2,$2${COMMA},) $(COPYRIGHT_YEAR),\
$(FULL_COMPANY_NAME). $3 All rights reserved.
endef
# Url to root of documents
DOCSDIR_URL = {@docroot}/$(GET2DOCSDIR)
# Url to copyright html file
COPYRIGHT_URL-7 = $(DOCSDIR_URL)/legal/cpyr.html
COPYRIGHT_URL-8 = $(DOCSDIR_URL)/legal/cpyr.html
COPYRIGHT_URL = $(COPYRIGHT_URL-$(JDK_MINOR_VERSION))
# Url to bug filing site
BUG_SUBMIT_URL = http://bugreport.sun.com/bugreport/
# Common line for how to submit a bug or rfe
BUG_SUBMIT_LINE = <a href="$(BUG_SUBMIT_URL)">Submit a bug or feature</a>
# Url to devdocs page
# Was: http://java.sun.com/javase/6/webnotes/devdocs-vs-specs.html
DEV_DOCS_URL-7 = http://download.oracle.com/javase/7/docs/index.html
DEV_DOCS_URL-8 = http://download.oracle.com/javase/7/docs/index.html
DEV_DOCS_URL = $(DEV_DOCS_URL-$(JDK_MINOR_VERSION))
DOCS_BASE_URL = http://download.oracle.com/javase/7/docs
# Common Java trademark line
JAVA_TRADEMARK_LINE = Java is a trademark or registered trademark of \
$(FULL_COMPANY_NAME) in the US and other countries.
#################################################################
# Macros:
# List of all possible directories for javadoc to look for sources
# NOTE: Quotes are required around sourcepath argument only on Windows.
# Otherwise, you get "No packages or classes specified." due
# to $(CLASSPATH_SEPARATOR) being interpreted as an end of
# command (newline or shell ; character)
ALL_SOURCE_DIRS = $(JDK_IMPSRC) \
$(JDK_GENSRC) \
$(JDK_SHARE_CLASSES) \
$(JDK_TOPDIR)/src/solaris/classes \
$(JDK_TOPDIR)/src/windows/classes \
$(JDK_SHARE_SRC)/doc/stub
# List of directories that actually exist
ALL_EXISTING_SOURCE_DIRS := $(wildcard $(ALL_SOURCE_DIRS))
# List with classpath separator between them
EMPTY:=
SPACE:= $(EMPTY) $(EMPTY)
RELEASEDOCS_SOURCEPATH = \
$(subst $(SPACE),$(CLASSPATH_SEPARATOR),$(strip $(ALL_SOURCE_DIRS)))
define prep-target
$(MKDIR) -p $(@D)
$(RM) $@
endef
# Prep for javadoc creation, assumes $@ is an index.html file
define prep-javadoc
@if [ -f "$@" -a "$?" != "" ] ; then \
$(ECHO) "# Dependencies have changed: $?"; \
fi
$(RM) -r $(@D)
$(MKDIR) -p $(@D)
endef
# A cache of the directories in ALL_SOURCE_DIRS
DIRECTORY_CACHE = $(DOCSTMPDIR)/directory.cache
# Given a list of packages, return a list of files or dirs to be dependent on
# (Currently only returning a list of directories)
define PackageDependencies # packages
$(shell \
if [ "$1" != "" -a -f $(DIRECTORY_CACHE) ] ; then \
for p in $1 ; do \
pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \
$(CAT) $(DIRECTORY_CACHE) | $(GREP) "/$${pd}/" ; \
done; \
fi \
)
endef
# Given a list of packages, add packages that exist to $@, print summary
define PackageFilter # packages
@if [ "$1" != "" ] ; then \
for p in $1 ; do \
pd=`$(ECHO) $${p} | $(SED) -e 's@[.]@/@g'`; \
found="false"; \
for cp in $(ALL_SOURCE_DIRS) ; do \
if [ -d $${cp}/$${pd} ] ; then \
$(ECHO) "$${p}" >> $@; \
found="true"; \
break; \
fi; \
done; \
if [ "$${found}" = "false" ] ; then \
$(ECHO) "WARNING: Package not found: $${p}"; \
fi; \
done; \
fi
endef
# Print out a summary of the javadoc command about to be run
define JavadocSummary # optionsfile packagesfile
@$(ECHO) "# Summary for $@";\
$(ECHO) "# Options (`$(BASENAME) $1`):"; $(SED) -e 's@^@# @' $1; \
$(ECHO) "# Packages (`$(BASENAME) $2`):";$(SED) -e 's@^@# @' $2
endef
#
# Temporary directory for javadoc creation
#
DOCSTMPDIR = $(TEMPDIR)/doctmp
#
# Different api directories created from root directory
#
COREAPI_DOCSDIR = $(DOCSDIR)/api
JDK_API_DOCSDIR = $(DOCSDIR)/jdk/api
JRE_API_DOCSDIR = $(DOCSDIR)/jre/api
PLATFORM_DOCSDIR = $(DOCSDIR)/platform
# The non-core api javadocs need to be able to access the root of the core
# api directory, so for jdk/api or jre/api to get to the core api/
# directory we would use this:
JDKJRE2COREAPI = ../../api
# Common bottom argument
define CommonBottom # year
<font size="-1"><br> $(call CopyrightLine,,$1,)</font>
endef
# Common trademark bottom argument (Not sure why this is used sometimes)
define CommonTrademarkBottom # year
<font size="-1">\
$(BUG_SUBMIT_LINE)<br>$(JAVA_TRADEMARK_LINE)<br>\
$(call CopyrightLine,,$1,$(COMPANY_ADDRESS))\
</font>
endef
# Common echo of option
define OptionOnly # opt
$(PRINTF) "%s\n" "$1"
endef
define OptionPair # opt arg
$(PRINTF) "%s '%s'\n" "$1" '$2'
endef
define OptionTrip # opt arg arg
$(PRINTF) "%s '%s' '%s'\n" "$1" '$2' '$3'
endef
# Core api bottom argument (with special sauce)
COREAPI_BOTTOM = <font size="-1"> $(BUG_SUBMIT_LINE)\
<br>For further API reference and developer documentation, \
see <a href="$(DEV_DOCS_URL)" target="_blank">Java SE Documentation</a>. \
That documentation contains more detailed, developer-targeted descriptions, \
with conceptual overviews, definitions of terms, workarounds, \
and working code examples.<br>\
$(call CopyrightLine,$(COPYRIGHT_URL),$(FIRST_COPYRIGHT_YEAR),)\
</font>
# Common javadoc options used by all
COMMON_JAVADOCFLAGS = \
-XDignore.symbol.file=true \
-quiet \
-use \
-keywords \
$(ADDITIONAL_JAVADOCFLAGS)
ifdef OPENJDK
ADDITIONAL_JAVADOCFLAGS = \
-Xdocrootparent $(DOCS_BASE_URL)
else
ADDITIONAL_JAVADOCFLAGS =
endif
# Draft used for non-fcs documents
DRAFT_HEADER =
ifneq ($(MILESTONE), fcs)
DRAFT_HEADER = <br><strong>DRAFT&nbsp;$(MILESTONE)-$(BUILD_NUMBER)</strong>
DRAFT_BOTTOM = <br><strong>DRAFT&nbsp;$(MILESTONE)-$(BUILD_NUMBER)</strong>
DRAFT_WINTITLE = $(BUILD_NUMBER)
# Early access top text (not used in FCS releases)
COREAPI_TOP_EARLYACCESS = \
<div style="background-color: \#EEEEEE"> \
<div style="padding: 6px; margin-top: 2px; margin-bottom: 6px; \
margin-left: 6px; margin-right: 6px; text-align: justify; \
font-size: 80%; font-family: Helvetica, Arial, sans-serif; \
font-weight: normal;"> \
Please note that the specifications and other information \
contained herein are not final and are subject to change. \
The information is being made available to you solely for purpose of \
evaluation. \
</div> </div>
endif
#################################################################
#
# CORE_PKGS environment variable has been moved to the following file
#
include CORE_PKGS.gmk
#
# Load environment variables for API package names that are not part of
# the Java SE platform
#
include NON_CORE_PKGS.gmk
#################################################################
#
# Default target is same as docs target, create core api and all others it can
#
all: docs
docs: coredocs otherdocs
#################################################################
# Production Targets -- USE THESE TARGETS WHEN:
# a) You're generating docs outside of release engineering's
# standard control build.
# b) The docs will be pushed to the web and/or included in
# the downloaded doc bundle.
#
# See: Notes.html#releaseTargets
# Note: Spaces precede ifdef/ifndef indents. Tabs precede target commands (!)
#
sanitycheckcoredocs:
@$(ECHO) ""
@$(ECHO) "Building core api docs with these values:"
@$(ECHO) " BUILD_NUMBER = $(BUILD_NUMBER)"
@$(ECHO) " MILESTONE = $(MILESTONE)"
@$(ECHO) ""
ifeq ($(BUILD_NUMBER), b00)
@$(ECHO) "ERROR: Build number must be defined"
@$(ECHO) "MILESTONE is set to $(MILESTONE)"
@$(ECHO) ""
exit 1
endif
#############################################################
#
# coredocs
#
COREAPI_DOCTITLE = Java$(TRADEMARK) Platform, Standard Edition \
$(JDK_MINOR_VERSION)<br>API Specification
COREAPI_WINDOWTITLE = Java Platform SE $(JDK_MINOR_VERSION)
COREAPI_HEADER = \
<strong>Java$(TRADEMARK)&nbsp;Platform<br>Standard&nbsp;Ed.&nbsp;$(JDK_MINOR_VERSION)</strong>
# Java language specification cite
TAG_JLS = jls:a:See <cite> \
The Java&trade; Language Specification</cite>:
# Overview file for core apis
COREAPI_OVERVIEW = $(JDK_SHARE_CLASSES)/overview-core.html
# The index.html, options, and packages files
COREAPI_INDEX_FILE = $(COREAPI_DOCSDIR)/index.html
COREAPI_OPTIONS_FILE = $(DOCSTMPDIR)/coredocs.options
COREAPI_PACKAGES_FILE = $(DOCSTMPDIR)/coredocs.packages
coredocs: $(COREAPI_INDEX_FILE)
# Set relative location to core api document root
$(COREAPI_INDEX_FILE): GET2DOCSDIR=..
# Run javadoc if the index file is out of date or missing
$(COREAPI_INDEX_FILE): $(COREAPI_OPTIONS_FILE) $(COREAPI_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(COREAPI_OPTIONS_FILE),$(COREAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(COREAPI_OPTIONS_FILE) @$(COREAPI_PACKAGES_FILE)
# Create file with javadoc options in it
$(COREAPI_OPTIONS_FILE): $(COREAPI_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ISO-8859-1) ; \
$(call OptionPair,-tag,beaninfo:X) ; \
$(call OptionPair,-tag,revised:X) ; \
$(call OptionPair,-tag,since.unbundled:X) ; \
$(call OptionPair,-tag,spec:X) ; \
$(call OptionPair,-tag,specdefault:X) ; \
$(call OptionPair,-tag,Note:X) ; \
$(call OptionPair,-tag,ToDo:X) ; \
$(call OptionPair,-tag,$(TAG_JLS)) ; \
$(call OptionOnly,-splitIndex) ; \
$(call OptionPair,-overview,$(COREAPI_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(COREAPI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(COREAPI_WINDOWTITLE) $(DRAFT_WINTITLE)) ;\
$(call OptionPair,-header,$(COREAPI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(COREAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
) >> $@
ifdef COREAPI_TOP_EARLYACCESS
@$(call OptionPair,-top,$(COREAPI_TOP_EARLYACCESS)) >> $@
endif
# Create a file with the package names in it
$(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_PKGS))
$(prep-target)
$(call PackageFilter,$(CORE_PKGS))
#############################################################
#
# docletapidocs
#
ALL_OTHER_TARGETS += docletapidocs
DOCLETAPI_DOCDIR := $(JDK_API_DOCSDIR)/javadoc/doclet
DOCLETAPI2COREAPI := ../../$(JDKJRE2COREAPI)
DOCLETAPI_DOCTITLE := Doclet API
DOCLETAPI_WINDOWTITLE := Doclet API
DOCLETAPI_HEADER := <strong>Doclet API</strong>
DOCLETAPI_BOTTOM := $(call CommonTrademarkBottom,$(DOCLETAPI_FIRST_COPYRIGHT_YEAR))
DOCLETAPI_GROUPNAME := Packages
DOCLETAPI_REGEXP := com.sun.javadoc
# DOCLETAPI_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
DOCLETAPI_INDEX_FILE = $(DOCLETAPI_DOCDIR)/index.html
DOCLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/docletapi.options
DOCLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/docletapi.packages
docletapidocs: $(DOCLETAPI_INDEX_FILE)
# Set relative location to core api document root
$(DOCLETAPI_INDEX_FILE): GET2DOCSDIR=$(DOCLETAPI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(DOCLETAPI_INDEX_FILE): $(DOCLETAPI_OPTIONS_FILE) $(DOCLETAPI_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(DOCLETAPI_OPTIONS_FILE),$(DOCLETAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(DOCLETAPI_OPTIONS_FILE) @$(DOCLETAPI_PACKAGES_FILE)
# Create file with javadoc options in it
$(DOCLETAPI_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-breakiterator) ; \
$(call OptionPair,-doctitle,$(DOCLETAPI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(DOCLETAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(DOCLETAPI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(DOCLETAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-group,$(DOCLETAPI_GROUPNAME),$(DOCLETAPI_REGEXP)); \
$(call OptionTrip,-linkoffline,$(DOCLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(DOCLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOCLETAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(DOCLETAPI_PKGS))
#############################################################
#
# tagletapidocs
#
ALL_OTHER_TARGETS += tagletapidocs
TAGLETAPI_DOCDIR := $(JDK_API_DOCSDIR)/javadoc/taglet
TAGLETAPI2COREAPI := ../../$(JDKJRE2COREAPI)
TAGLETAPI_BOTTOM := $(call CommonTrademarkBottom,$(TAGLETAPI_FIRST_COPYRIGHT_YEAR))
# TAGLETAPI_FILE is located in NON_CORE_PKGS.gmk
# Temporary directory (special generation rules)
TAGLETAPI_TEMPDIR = $(DOCSTMPDIR)/taglets_temp
# The index.html, options, and packages files
TAGLETAPI_INDEX_FILE = $(TAGLETAPI_DOCDIR)/com/sun/tools/doclets/Taglet.html
TAGLETAPI_OPTIONS_FILE = $(DOCSTMPDIR)/tagletapi.options
TAGLETAPI_PACKAGES_FILE = $(DOCSTMPDIR)/tagletapi.packages
tagletapidocs: $(TAGLETAPI_INDEX_FILE)
# Set relative location to core api document root
$(TAGLETAPI_INDEX_FILE): GET2DOCSDIR=$(TAGLETAPI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(TAGLETAPI_INDEX_FILE): $(TAGLETAPI_OPTIONS_FILE) $(TAGLETAPI_PACKAGES_FILE)
$(prep-javadoc)
$(RM) -r $(TAGLETAPI_TEMPDIR)
$(MKDIR) -p $(TAGLETAPI_TEMPDIR)
$(call JavadocSummary,$(TAGLETAPI_OPTIONS_FILE),$(TAGLETAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(TAGLETAPI_TEMPDIR) \
@$(TAGLETAPI_OPTIONS_FILE) @$(TAGLETAPI_PACKAGES_FILE)
cp -r $(TAGLETAPI_TEMPDIR)/com $(@D)
cp $(TAGLETAPI_TEMPDIR)/stylesheet.css $(@D)
$(RM) -r $(TAGLETAPI_TEMPDIR)
# Create file with javadoc options in it
$(TAGLETAPI_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nonavbar) ; \
$(call OptionOnly,-noindex) ; \
$(call OptionPair,-bottom,$(TAGLETAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(TAGLETAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(TAGLETAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TAGLETAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(TAGLETAPI_PKGS))
$(GREP) "$(TAGLETAPI_FILE)" $@ > $@.tmp
$(MV) $@.tmp $@
#############################################################
#
# domapidocs
#
ALL_OTHER_TARGETS += domapidocs
DOMAPI_DOCDIR := $(JRE_API_DOCSDIR)/plugin/dom
DOMAPI2COREAPI := ../../$(JDKJRE2COREAPI)
DOMAPI_DOCTITLE := Common DOM API
DOMAPI_WINDOWTITLE := Common DOM API
DOMAPI_HEADER := <strong>Common DOM API</strong>
DOMAPI_BOTTOM := $(call CommonTrademarkBottom,$(DOMAPI_FIRST_COPYRIGHT_YEAR))
DOMAPI_GROUPNAME := Packages
DOMAPI_REGEXP := com.sun.java.browser.dom:org.w3c.dom*
# DOMAPI_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
DOMAPI_INDEX_FILE = $(DOMAPI_DOCDIR)/index.html
DOMAPI_OPTIONS_FILE = $(DOCSTMPDIR)/domapi.options
DOMAPI_PACKAGES_FILE = $(DOCSTMPDIR)/domapi.packages
domapidocs: $(DOMAPI_INDEX_FILE)
# Set relative location to core api document root
$(DOMAPI_INDEX_FILE): GET2DOCSDIR=$(DOMAPI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(DOMAPI_INDEX_FILE): $(DOMAPI_OPTIONS_FILE) $(DOMAPI_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(DOMAPI_OPTIONS_FILE),$(DOMAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(DOMAPI_OPTIONS_FILE) @$(DOMAPI_PACKAGES_FILE)
# Create file with javadoc options in it
$(DOMAPI_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-splitIndex) ; \
$(call OptionPair,-doctitle,$(DOMAPI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(DOMAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(DOMAPI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(DOMAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-group,$(DOMAPI_GROUPNAME),$(DOMAPI_REGEXP)); \
$(call OptionTrip,-linkoffline,$(DOMAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(DOMAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(DOMAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(DOMAPI_PKGS))
#############################################################
#
# jpdadocs
#
ALL_OTHER_TARGETS += jpdadocs
jpdadocs: jdidocs jdwpdocs jvmtidocs
#############################################################
#
# jdidocs
#
ALL_OTHER_TARGETS += jdidocs
JDI_DOCDIR := $(JDK_API_DOCSDIR)/jpda/jdi
JDI2COREAPI := ../../$(JDKJRE2COREAPI)
JDI_DOCTITLE := Java$(TRADEMARK) Debug Interface
JDI_WINDOWTITLE := Java Debug Interface
JDI_HEADER := <strong>Java Debug Interface</strong>
JDI_BOTTOM := $(call CommonBottom,$(JDI_FIRST_COPYRIGHT_YEAR))
JDI_OVERVIEW := $(JDK_SHARE_CLASSES)/jdi-overview.html
# JDI_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
JDI_INDEX_FILE = $(JDI_DOCDIR)/index.html
JDI_OPTIONS_FILE = $(DOCSTMPDIR)/jdi.options
JDI_PACKAGES_FILE = $(DOCSTMPDIR)/jdi.packages
jdidocs: $(JDI_INDEX_FILE)
# Set relative location to core api document root
$(JDI_INDEX_FILE): GET2DOCSDIR=$(JDI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(JDI_INDEX_FILE): $(JDI_OPTIONS_FILE) $(JDI_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(JDI_OPTIONS_FILE),$(JDI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(JDI_OPTIONS_FILE) @$(JDI_PACKAGES_FILE)
# Create file with javadoc options in it
$(JDI_OPTIONS_FILE): $(JDI_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionPair,-overview,$(JDI_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(JDI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(JDI_WINDOWTITLE) $(DRAFT_WINTITLE)); \
$(call OptionPair,-header,$(JDI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(JDI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(JDI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(JDI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JDI_PKGS))
$(prep-target)
$(call PackageFilter,$(JDI_PKGS))
#############################################################
#
# jdwpdocs
#
ALL_OTHER_TARGETS += jdwpdocs
JDWP_DOCDIR = $(PLATFORM_DOCSDIR)/jpda/jdwp
jdwpdocs: $(JDWP_DOCDIR)/jdwp-protocol.html
$(JDWP_DOCDIR)/jdwp-protocol.html : $(JDK_OUTPUTDIR)/gensrc_jdwp_doc/jdwp-protocol.html
$(MKDIR) -p $(@D)
$(RM) $@
$(CP) $< $@
#############################################################
#
# jvmtidocs
#
ALL_OTHER_TARGETS += jvmtidocs
JVMTI_DOCDIR = $(PLATFORM_DOCSDIR)/jvmti
JVMTI_HTML = $(HOTSPOT_DIST)/docs/platform/jvmti/jvmti.html
jvmtidocs: $(JVMTI_DOCDIR)/jvmti.html
$(JVMTI_DOCDIR)/jvmti.html:
@$(prep-javadoc)
@if [ -f $(JVMTI_HTML) ] ; then \
$(ECHO) "$(CP) $(JVMTI_HTML) $@"; \
$(CP) $(JVMTI_HTML) $@; \
else \
$(ECHO) "WARNING: Generated file does not exist: $(JVMTI_HTML)"; \
fi
#############################################################
#
# jaasdocs
#
ALL_OTHER_TARGETS += jaasdocs
JAAS_DOCDIR := $(JRE_API_DOCSDIR)/security/jaas/spec
JAAS2COREAPI := ../../../$(JDKJRE2COREAPI)
JAAS_DOCTITLE := Java$(TRADEMARK) Authentication and Authorization Service
JAAS_WINDOWTITLE := Java Authentication and Authorization Service
JAAS_HEADER := <strong>Java Authentication and Authorization Service</strong>
JAAS_BOTTOM := $(call CommonBottom,$(JAAS_FIRST_COPYRIGHT_YEAR))
# JAAS_PKGS is located in NON_CORE_PKGS.gmk
JAAS_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/security/auth/jaas-overview.html
# The index.html, options, and packages files
JAAS_INDEX_FILE = $(JAAS_DOCDIR)/index.html
JAAS_OPTIONS_FILE = $(DOCSTMPDIR)/jaas.options
JAAS_PACKAGES_FILE = $(DOCSTMPDIR)/jaas.packages
jaasdocs: $(JAAS_INDEX_FILE)
# Set relative location to core api document root
$(JAAS_INDEX_FILE): GET2DOCSDIR=$(JAAS2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(JAAS_INDEX_FILE): $(JAAS_OPTIONS_FILE) $(JAAS_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(JAAS_OPTIONS_FILE),$(JAAS_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(JAAS_OPTIONS_FILE) @$(JAAS_PACKAGES_FILE)
# Create file with javadoc options in it
$(JAAS_OPTIONS_FILE): $(JAAS_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionPair,-overview,$(JAAS_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(JAAS_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(JAAS_WINDOWTITLE) $(DRAFT_WINTITLE)); \
$(call OptionPair,-header,$(JAAS_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(JAAS_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(JAAS2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(JAAS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JAAS_PKGS))
$(prep-target)
$(call PackageFilter,$(JAAS_PKGS))
#############################################################
#
# jgssdocs
#
ALL_OTHER_TARGETS += jgssdocs
JGSS_DOCDIR := $(JRE_API_DOCSDIR)/security/jgss/spec
JGSS2COREAPI := ../../../$(JDKJRE2COREAPI)
JGSS_DOCTITLE := Java$(TRADEMARK) GSS-API Utilities
JGSS_WINDOWTITLE := Java GSS-API Utilities
JGSS_HEADER := <strong>Java GSS-API Utilities</strong>
JGSS_BOTTOM := $(call CommonBottom,$(JGSS_FIRST_COPYRIGHT_YEAR))
JGSS_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/security/jgss/jgss-overview.html
# JGSS_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
JGSS_INDEX_FILE = $(JGSS_DOCDIR)/index.html
JGSS_OPTIONS_FILE = $(DOCSTMPDIR)/jgss.options
JGSS_PACKAGES_FILE = $(DOCSTMPDIR)/jgss.packages
jgssdocs: $(JGSS_INDEX_FILE)
# Set relative location to core api document root
$(JGSS_INDEX_FILE): GET2DOCSDIR=$(JGSS2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(JGSS_INDEX_FILE): $(JGSS_OPTIONS_FILE) $(JGSS_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(JGSS_OPTIONS_FILE),$(JGSS_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(JGSS_OPTIONS_FILE) @$(JGSS_PACKAGES_FILE)
# Create file with javadoc options in it
$(JGSS_OPTIONS_FILE): $(JGSS_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-overview,$(JGSS_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(JGSS_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(JGSS_WINDOWTITLE) $(DRAFT_WINTITLE)); \
$(call OptionPair,-header,$(JGSS_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(JGSS_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(JGSS2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(JGSS_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JGSS_PKGS))
$(prep-target)
$(call PackageFilter,$(JGSS_PKGS))
#############################################################
#
# smartcardiodocs
#
ALL_OTHER_TARGETS += smartcardiodocs
SMARTCARDIO_DOCDIR := $(JRE_API_DOCSDIR)/security/smartcardio/spec
SMARTCARDIO2COREAPI := ../../../$(JDKJRE2COREAPI)
SMARTCARDIO_DOCTITLE := Java$(TRADEMARK) Smart Card I/O
SMARTCARDIO_WINDOWTITLE := Java Smart Card I/O
SMARTCARDIO_HEADER := <strong>Java Smart Card I/O</strong>
SMARTCARDIO_BOTTOM := $(call CommonBottom,$(SMARTCARDIO_FIRST_COPYRIGHT_YEAR))
# SMARTCARDIO_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
SMARTCARDIO_INDEX_FILE = $(SMARTCARDIO_DOCDIR)/index.html
SMARTCARDIO_OPTIONS_FILE = $(DOCSTMPDIR)/smartcardio.options
SMARTCARDIO_PACKAGES_FILE = $(DOCSTMPDIR)/smartcardio.packages
smartcardiodocs: $(SMARTCARDIO_INDEX_FILE)
# Set relative location to core api document root
$(SMARTCARDIO_INDEX_FILE): GET2DOCSDIR=$(SMARTCARDIO2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(SMARTCARDIO_INDEX_FILE): $(SMARTCARDIO_OPTIONS_FILE) $(SMARTCARDIO_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(SMARTCARDIO_OPTIONS_FILE),$(SMARTCARDIO_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(SMARTCARDIO_OPTIONS_FILE) @$(SMARTCARDIO_PACKAGES_FILE)
# Create file with javadoc options in it
$(SMARTCARDIO_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-doctitle,$(SMARTCARDIO_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(SMARTCARDIO_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(SMARTCARDIO_HEADER)$(DRAFT_HEADER)); \
$(call OptionPair,-bottom,$(SMARTCARDIO_BOTTOM)$(DRAFT_BOTTOM)); \
$(call OptionTrip,-linkoffline,$(SMARTCARDIO2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(SMARTCARDIO_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SMARTCARDIO_PKGS))
$(prep-target)
$(call PackageFilter,$(SMARTCARDIO_PKGS))
#############################################################
#
# httpserverdocs
#
ALL_OTHER_TARGETS += httpserverdocs
HTTPSERVER_DOCDIR := $(JRE_API_DOCSDIR)/net/httpserver/spec
HTTPSERVER2COREAPI := ../../../$(JDKJRE2COREAPI)
HTTPSERVER_DOCTITLE := Java$(TRADEMARK) HTTP Server
HTTPSERVER_WINDOWTITLE := Java HTTP Server
HTTPSERVER_HEADER := <strong>Java HTTP Server</strong>
HTTPSERVER_BOTTOM := $(call CommonBottom,$(HTTPSERVER_FIRST_COPYRIGHT_YEAR))
# HTTPSERVER_PKGS is located in NON_CORE_PKGS.gmk
HTTPSERVER_INDEX_HTML = $(HTTPSERVER_DOCDIR)/index.html
HTTPSERVER_OPTIONS_FILE = $(DOCSTMPDIR)/httpserver.options
HTTPSERVER_PACKAGES_FILE = $(DOCSTMPDIR)/httpserver.packages
httpserverdocs: $(HTTPSERVER_INDEX_HTML)
# Set relative location to core api document root
$(HTTPSERVER_INDEX_HTML): GET2DOCSDIR=$(HTTPSERVER2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(HTTPSERVER_INDEX_HTML): $(HTTPSERVER_OPTIONS_FILE) $(HTTPSERVER_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(HTTPSERVER_OPTIONS_FILE),$(HTTPSERVER_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(HTTPSERVER_OPTIONS_FILE) @$(HTTPSERVER_PACKAGES_FILE)
# Create file with javadoc options in it
$(HTTPSERVER_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-doctitle,$(HTTPSERVER_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(HTTPSERVER_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(HTTPSERVER_HEADER)$(DRAFT_HEADER)); \
$(call OptionPair,-bottom,$(HTTPSERVER_BOTTOM)$(DRAFT_BOTTOM)); \
$(call OptionTrip,-linkoffline,$(HTTPSERVER2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(HTTPSERVER_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(HTTPSERVER_PKGS))
$(prep-target)
$(call PackageFilter,$(HTTPSERVER_PKGS))
#############################################################
#
# mgmtdocs
#
ALL_OTHER_TARGETS += mgmtdocs
MGMT_DOCDIR := $(JRE_API_DOCSDIR)/management/extension
MGMT2COREAPI := ../../$(JDKJRE2COREAPI)
JVM_MIB_NAME := JVM-MANAGEMENT-MIB.mib
JVM_MIB_SRC := $(CLOSED_SRC)/share/classes/sun/management/snmp/$(JVM_MIB_NAME)
MGMT_DOCTITLE := Monitoring and Management Interface for the Java$(TRADEMARK) Platform
MGMT_WINDOWTITLE := Monitoring and Management Interface for the Java Platform
MGMT_HEADER := <strong>Monitoring and Management Interface for the Java Platform</strong>
MGMT_BOTTOM := $(call CommonBottom,$(MGMT_FIRST_COPYRIGHT_YEAR))
MGMT_OVERVIEW := $(JDK_SHARE_CLASSES)/com/sun/management/mgmt-overview.html
# MGMT_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
MGMT_INDEX_FILE = $(MGMT_DOCDIR)/index.html
MGMT_OPTIONS_FILE = $(DOCSTMPDIR)/mgmt.options
MGMT_PACKAGES_FILE = $(DOCSTMPDIR)/mgmt.packages
mgmtdocs: $(MGMT_INDEX_FILE)
# Set relative location to core api document root
$(MGMT_INDEX_FILE): GET2DOCSDIR=$(MGMT2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(MGMT_INDEX_FILE): $(MGMT_OPTIONS_FILE) $(MGMT_PACKAGES_FILE)
$(prep-javadoc)
@if [ -f $(JVM_MIB_SRC) ] ; then \
$(ECHO) "$(CP) $(JVM_MIB_SRC) $(@D)/.."; \
$(CP) $(JVM_MIB_SRC) $(@D)/.. ; \
else \
$(ECHO) "WARNING: File $(JVM_MIB_NAME) not available."; \
fi
$(call JavadocSummary,$(MGMT_OPTIONS_FILE),$(MGMT_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(MGMT_OPTIONS_FILE) @$(MGMT_PACKAGES_FILE)
# Create file with javadoc options in it
$(MGMT_OPTIONS_FILE): $(MGMT_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-overview,$(MGMT_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(MGMT_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(MGMT_WINDOWTITLE) $(DRAFT_WINTITLE)); \
$(call OptionPair,-header,$(MGMT_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(MGMT_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(MGMT2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(MGMT_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MGMT_PKGS))
$(prep-target)
$(call PackageFilter,$(MGMT_PKGS))
#############################################################
#
# attachdocs
#
ALL_OTHER_TARGETS += attachdocs
ATTACH_DOCDIR := $(JDK_API_DOCSDIR)/attach/spec
ATTACH2COREAPI := ../../$(JDKJRE2COREAPI)
ATTACH_DOCTITLE := Attach API
ATTACH_WINDOWTITLE := Attach API
ATTACH_HEADER := <strong>Attach API</strong>
ATTACH_BOTTOM := $(call CommonBottom,$(ATTACH_FIRST_COPYRIGHT_YEAR))
# ATTACH_PKGS is located in NON_CORE_PKGS.gmk
ATTACH_INDEX_HTML = $(ATTACH_DOCDIR)/index.html
ATTACH_OPTIONS_FILE = $(DOCSTMPDIR)/attach.options
ATTACH_PACKAGES_FILE = $(DOCSTMPDIR)/attach.packages
attachdocs: $(ATTACH_INDEX_HTML)
# Set relative location to core api document root
$(ATTACH_INDEX_HTML): GET2DOCSDIR=$(ATTACH2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(ATTACH_INDEX_HTML): $(ATTACH_OPTIONS_FILE) $(ATTACH_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(ATTACH_OPTIONS_FILE),$(ATTACH_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(ATTACH_OPTIONS_FILE) @$(ATTACH_PACKAGES_FILE)
# Create file with javadoc options in it
$(ATTACH_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-doctitle,$(ATTACH_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(ATTACH_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(ATTACH_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(ATTACH_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(ATTACH2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(ATTACH_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(ATTACH_PKGS))
$(prep-target)
$(call PackageFilter,$(ATTACH_PKGS))
#############################################################
#
# jconsoledocs
#
ALL_OTHER_TARGETS += jconsoledocs
JCONSOLE_DOCDIR := $(JDK_API_DOCSDIR)/jconsole/spec
JCONSOLE2COREAPI := ../../$(JDKJRE2COREAPI)
JCONSOLE_DOCTITLE := JConsole API
JCONSOLE_WINDOWTITLE := JConsole API
JCONSOLE_HEADER := <strong>JConsole API</strong>
JCONSOLE_BOTTOM := $(call CommonBottom,$(JCONSOLE_FIRST_COPYRIGHT_YEAR))
# JCONSOLE_PKGS is located in NON_CORE_PKGS.gmk
JCONSOLE_INDEX_HTML = $(JCONSOLE_DOCDIR)/index.html
JCONSOLE_OPTIONS_FILE = $(DOCSTMPDIR)/jconsole.options
JCONSOLE_PACKAGES_FILE = $(DOCSTMPDIR)/jconsole.packages
jconsoledocs: $(JCONSOLE_INDEX_HTML)
# Set relative location to core api document root
$(JCONSOLE_INDEX_HTML): GET2DOCSDIR=$(JCONSOLE2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(JCONSOLE_INDEX_HTML): $(JCONSOLE_OPTIONS_FILE) $(JCONSOLE_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(JCONSOLE_OPTIONS_FILE),$(JCONSOLE_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(JCONSOLE_OPTIONS_FILE) @$(JCONSOLE_PACKAGES_FILE)
# Create file with javadoc options in it
$(JCONSOLE_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-doctitle,$(JCONSOLE_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(JCONSOLE_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(JCONSOLE_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(JCONSOLE_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(JCONSOLE2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(JCONSOLE_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(JCONSOLE_PKGS))
$(prep-target)
$(call PackageFilter,$(JCONSOLE_PKGS))
#############################################################
#
# treeapidocs
#
ALL_OTHER_TARGETS += treeapidocs
TREEAPI_DOCDIR := $(JDK_API_DOCSDIR)/javac/tree
TREEAPI2COREAPI := ../../$(JDKJRE2COREAPI)
TREEAPI_DOCTITLE := Compiler Tree API
TREEAPI_WINDOWTITLE := Compiler Tree API
TREEAPI_HEADER := <strong>Compiler Tree API</strong>
TREEAPI_BOTTOM := $(call CommonBottom,$(TREEAPI_FIRST_COPYRIGHT_YEAR))
TREEAPI_GROUPNAME := Packages
TREEAPI_REGEXP := com.sun.source.*
# TREEAPI_PKGS is located in NON_CORE_PKGS.gmk
TREEAPI_INDEX_HTML = $(TREEAPI_DOCDIR)/index.html
TREEAPI_OPTIONS_FILE = $(DOCSTMPDIR)/treeapi.options
TREEAPI_PACKAGES_FILE = $(DOCSTMPDIR)/treeapi.packages
treeapidocs: $(TREEAPI_INDEX_HTML)
# Set relative location to core api document root
$(TREEAPI_INDEX_HTML): GET2DOCSDIR=$(TREEAPI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(TREEAPI_INDEX_HTML): $(TREEAPI_OPTIONS_FILE) $(TREEAPI_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(TREEAPI_OPTIONS_FILE),$(TREEAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(TREEAPI_OPTIONS_FILE) @$(TREEAPI_PACKAGES_FILE)
# Create file with javadoc options in it
$(TREEAPI_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionPair,-doctitle,$(TREEAPI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(TREEAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(TREEAPI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-tag,$(TAG_JLS)) ; \
$(call OptionPair,-bottom,$(TREEAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-group,$(TREEAPI_GROUPNAME),$(TREEAPI_REGEXP)); \
$(call OptionTrip,-linkoffline,$(TREEAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(TREEAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(TREEAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(TREEAPI_PKGS))
#############################################################
#
# sctpdocs
#
ALL_OTHER_TARGETS += sctpdocs
SCTPAPI_DOCDIR := $(JRE_API_DOCSDIR)/nio/sctp/spec
SCTPAPI2COREAPI := ../../../$(JDKJRE2COREAPI)
SCTPAPI_DOCTITLE := SCTP API
SCTPAPI_WINDOWTITLE := SCTP API
SCTPAPI_HEADER := <strong>SCTP API</strong>
SCTPAPI_BOTTOM := $(call CommonBottom,$(SCTPAPI_FIRST_COPYRIGHT_YEAR))
# SCTPAPI_PKGS is located in NON_CORE_PKGS.gmk
SCTPAPI_INDEX_HTML = $(SCTPAPI_DOCDIR)/index.html
SCTPAPI_OPTIONS_FILE = $(DOCSTMPDIR)/sctp.options
SCTPAPI_PACKAGES_FILE = $(DOCSTMPDIR)/sctp.packages
sctpdocs: $(SCTPAPI_INDEX_HTML)
# Set relative location to core api document root
$(SCTPAPI_INDEX_HTML): GET2DOCSDIR=$(SCTPAPI2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(SCTPAPI_INDEX_HTML): $(SCTPAPI_OPTIONS_FILE) $(SCTPAPI_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(SCTPAPI_OPTIONS_FILE),$(SCTPAPI_PACKAGES_FILE))
$(JAVADOC_CMD) -d $(@D) \
@$(SCTPAPI_OPTIONS_FILE) @$(SCTPAPI_PACKAGES_FILE)
# Create file with javadoc options in it
$(SCTPAPI_OPTIONS_FILE):
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionOnly,-nodeprecatedlist) ; \
$(call OptionPair,-doctitle,$(SCTPAPI_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(SCTPAPI_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(SCTPAPI_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(SCTPAPI_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-linkoffline,$(SCTPAPI2COREAPI),$(COREAPI_DOCSDIR)/); \
) >> $@
# Create a file with the package names in it
$(SCTPAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(SCTPAPI_PKGS))
$(prep-target)
$(call PackageFilter,$(SCTPAPI_PKGS))
#############################################################
#
# Get a cache of all the directories
$(DIRECTORY_CACHE): $(ALL_EXISTING_SOURCE_DIRS)
$(prep-target)
@for cp in $(ALL_EXISTING_SOURCE_DIRS) ; do \
$(ECHO) "$(FIND) $${cp} -type f >> $@"; \
$(FIND) $${cp} -type f >> $@; \
done
#############################################################
#release version of core packages ########
# Maximize performance and ensure that build number & milestone are set.
rel-coredocs: sanitycheckcoredocs
$(MAKE) coredocs
rel-docs: rel-coredocs $(ALL_OTHER_TARGETS)
#
# end of production targets
otherdocs: $(ALL_OTHER_TARGETS)
clean:
$(RM) -r $(DOCSDIR) $(DOCSTMPDIR)
#############################################################
# DEBUG TARGET
# List the values defined in the makefile hierarchy, to make sure everything
# is set properly, and to help identify values we can use instead of making new ones.
# (Most of them come from common/shared/Defs.gmk)
#
# Notes:
# * BUILD_NUMBER defaults to b00 if not set on command line with BUILD_NUMBER=<value>
# * MILESTONE defaults to internal unless set to beta, rc, or fcs on command line
#
#############################################################
.PHONY: all docs coredocs rel-docs otherdocs rel-coredocs \
sanitycheckcoredocs $(ALL_OTHER_TARGETS)
#
# Copyright (c) 2002, 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.
#
#
# This file contains the package names of all the "non-core"
# API published in the Java 2 SDK documentation. "Non-core" means
# it includes all published API outside of the JDK API specification.
#
# These environment variables are used by javadoc in
# make/docs/Makefile and are referenced by the localization
# team when determining which APIs to extract javadoc
# comments from.
DOMAPI_PKGS = com.sun.java.browser.dom \
org.w3c.dom \
org.w3c.dom.bootstrap \
org.w3c.dom.ls \
org.w3c.dom.ranges \
org.w3c.dom.traversal \
org.w3c.dom.html \
org.w3c.dom.stylesheets \
org.w3c.dom.css \
org.w3c.dom.events \
org.w3c.dom.views
JDI_PKGS = com.sun.jdi \
com.sun.jdi.event \
com.sun.jdi.request \
com.sun.jdi.connect \
com.sun.jdi.connect.spi
MGMT_PKGS = com.sun.management
JAAS_PKGS = com.sun.security.auth \
com.sun.security.auth.callback \
com.sun.security.auth.login \
com.sun.security.auth.module
JGSS_PKGS = com.sun.security.jgss
OLD_JSSE_PKGS = com.sun.net.ssl
HTTPSERVER_PKGS = com.sun.net.httpserver \
com.sun.net.httpserver.spi
NIO_PKGS = com.sun.nio.file
DOCLETAPI_PKGS = com.sun.javadoc
TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java
TAGLETAPI_PKGS = com.sun.tools.doclets
ATTACH_PKGS = com.sun.tools.attach \
com.sun.tools.attach.spi
JCONSOLE_PKGS = com.sun.tools.jconsole
TREEAPI_PKGS = com.sun.source.tree \
com.sun.source.util
SMARTCARDIO_PKGS = javax.smartcardio
SCTPAPI_PKGS = com.sun.nio.sctp
ifeq ($(PLATFORM), macosx)
APPLE_EXT_PKGS = com.apple.concurrent \
com.apple.eawt \
com.apple.eawt.event \
com.apple.eio
endif
# non-core packages in rt.jar
NON_CORE_PKGS = $(DOMAPI_PKGS) \
$(MGMT_PKGS) \
$(JAAS_PKGS) \
$(JGSS_PKGS) \
$(NIO_PKGS) \
$(OLD_JSSE_PKGS) \
$(HTTPSERVER_PKGS) \
$(SMARTCARDIO_PKGS) \
$(SCTPAPI_PKGS) \
$(APPLE_EXT_PKGS)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Doc Process Notes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h3><a name="REGEXP"></a><br>
REGEXP</h3>
<p> REGEXP is a list of wildcard patterns that determines which packages listed
in CORE_PKGS.gmk go into which summary-table on the main API index page. It
was motivated by the need to divide the world into &quot;core packages&quot;
(java.*) and &quot;extension packages&quot; (javax.*). In time, the distinction
went away. The whole table is now called &quot;Platform Packages&quot;--which
eliminated the need for this list of regular expressions. But it lingered on,
accreting all of the packages in the JVM, one by one. I pruned it back to &quot;*&quot;,
so it now covers every package in the Java platform API docs. If some separation
is needed in the future, it can grow back into a colon-separated list, starting
with this, which is in all respects equivalent to &quot;*&quot; at this point
in time:</p>
<blockquote>
<pre>REGEXP = &quot;java.*:javax.*:org.ietf*:org.omg.</pre>
</blockquote>
<h3><a name="releaseTargets"></a><br>
Release Targets</h3>
<p> (Thanks to Kelly O'Hair for this info.)</p>
<p> The <tt>rel-coredocs</tt> and <tt>rel-docs</tt> targets were added by Eric
Armstrong. <tt>rel-coredocs</tt> assumes the kind of large, 32-bit machine used
in the javapubs group's docs-release process. It specifies memory settings accordingly
to maximize performance.</p>
<p> The performance settings, like the sanity check, are most important for the
core docs--the platform APIs. Running javadoc on those APIs takes a significant
amount of time and memory. Setting the initial heap size as large as possible
is important to prevent thrashing as the heap grows. Setting the maximum as
large as necessary is also important to keep the job from failing.</p>
<blockquote>
<p> <tt>-J-Xmx512</tt> sets a maximum of 512, which became necessary in 6.0<br>
<tt>-J-Xms256</tt> sets starting size to 256 (default is 8)</p>
</blockquote>
<p> <tt>rel-coredocs</tt> also includes a sanity check to help ensure that <tt>BUILD_NUMBER</tt>
and <tt>MILESTONE</tt> are specified properly when docs are built outside of
the normal release engineering process, with the intention of releasing them
on the web or in a downloaded docs bundle. (When invoked in release engineering's
control build, the values are always set properly. But when the targets are
run by themselves, they default to b00 and &quot;internal&quot;--which silently
sabotage the result of a build that can take many hours to complete.</p>
</body>
</html>
...@@ -275,3 +275,4 @@ e3619706a7253540a2d94e9e841acaab8ace7038 jdk8-b49 ...@@ -275,3 +275,4 @@ e3619706a7253540a2d94e9e841acaab8ace7038 jdk8-b49
e8fb566b94667f88462164defa654203f0ab6820 jdk8-b54 e8fb566b94667f88462164defa654203f0ab6820 jdk8-b54
09ea7e0752b306b8ae74713aeb4eb6263e1c6836 hs24-b22 09ea7e0752b306b8ae74713aeb4eb6263e1c6836 hs24-b22
af0c8a0808516317333dcf9af15567cdd52761ce jdk8-b55 af0c8a0808516317333dcf9af15567cdd52761ce jdk8-b55
6124ff4218296c91e4a72f1a76c064892d39d61b jdk8-b56
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册