Merge
This commit is contained in:
commit
0b33751341
@ -167,3 +167,4 @@ a2b2d435f1d275fa8010774c653197c64e326d3a jdk8-b40
|
||||
661c9aae602bbd9766d12590800c90f1edd1d8dd jdk8-b43
|
||||
e4f81a817447c3a4f6868f083c81c2fb1b15d44c jdk8-b44
|
||||
633f2378c904c92bb922a6e19e9f62fe8eac14af jdk8-b45
|
||||
27fa766a2298ba8347dc198f0cf85ba6618e17db jdk8-b46
|
||||
|
@ -22,5 +22,19 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
autoconf -W all configure.ac > configure
|
||||
rm -rf config.status config.log autom4te.cache
|
||||
script_dir=`dirname $0`
|
||||
closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
|
||||
|
||||
# Create a timestamp as seconds since epoch
|
||||
TIMESTAMP=`date +%s`
|
||||
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
|
||||
rm -rf autom4te.cache
|
||||
|
||||
if test -e $closed_script_dir/closed-hook.m4; then
|
||||
# We have closed sources available; also generate configure script
|
||||
# with closed hooks compiled in.
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
|
||||
sed -e "s|AC_DEFUN_ONCE(\[CLOSED_HOOK\])|m4_include([$closed_script_dir/closed-hook.m4])|" | autoconf -W all -I$script_dir - > $closed_script_dir/generated-configure.sh
|
||||
rm -rf autom4te.cache
|
||||
fi
|
||||
|
485
common/autoconf/basics.m4
Normal file
485
common/autoconf/basics.m4
Normal file
@ -0,0 +1,485 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([ADD_JVM_ARG_IF_OK],
|
||||
[
|
||||
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
|
||||
# If so, then append $1 to $2
|
||||
FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
|
||||
FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`
|
||||
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
|
||||
$2="[$]$2 $1"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD],
|
||||
[
|
||||
# Translate "gcc -E" into "`which gcc` -E" ie
|
||||
# extract the full path to the binary and at the
|
||||
# same time maintain any arguments passed to it.
|
||||
# The command MUST exist in the path, or else!
|
||||
tmp="[$]$1"
|
||||
car="${tmp%% *}"
|
||||
tmp="[$]$1 EOL"
|
||||
cdr="${tmp#* }"
|
||||
# On windows we want paths without spaces.
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
WHICHCMD_SPACESAFE(car)
|
||||
else
|
||||
# "which" is not portable, but is used here
|
||||
# because we know that the command exists!
|
||||
car=`which $car`
|
||||
fi
|
||||
if test "x$cdr" != xEOL; then
|
||||
$1="$car ${cdr% *}"
|
||||
else
|
||||
$1="$car"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SPACESAFE],
|
||||
[
|
||||
# Fail with message $2 if var $1 contains a path with no spaces in it.
|
||||
# Unless on Windows, where we can rewrite the path.
|
||||
HAS_SPACE=`echo "[$]$1" | grep " "`
|
||||
if test "x$HAS_SPACE" != x; then
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
$1=`$CYGPATH -s -m -a "[$]$1"`
|
||||
$1=`$CYGPATH -u "[$]$1"`
|
||||
else
|
||||
AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD_SPACESAFE],
|
||||
[
|
||||
# Translate long cygdrive or C:\sdfsf path
|
||||
# into a short mixed mode path that has no
|
||||
# spaces in it.
|
||||
tmp="[$]$1"
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
tmp=`$CYGPATH -u "[$]$1"`
|
||||
tmp=`which "$tmp"`
|
||||
# If file exists with .exe appended, that's the real filename
|
||||
# and cygpath needs that to convert to short style path.
|
||||
if test -f "${tmp}.exe"; then
|
||||
tmp="${tmp}.exe"
|
||||
elif test -f "${tmp}.cmd"; then
|
||||
tmp="${tmp}.cmd"
|
||||
fi
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
fi
|
||||
$1="$tmp"
|
||||
])
|
||||
|
||||
AC_DEFUN([REMOVE_SYMBOLIC_LINKS],
|
||||
[
|
||||
if test "x$OPENJDK_BUILD_OS" != xwindows; then
|
||||
# Follow a chain of symbolic links. Use readlink
|
||||
# where it exists, else fall back to horribly
|
||||
# complicated shell code.
|
||||
AC_PATH_PROG(READLINK, readlink)
|
||||
if test "x$READLINK_TESTED" != yes; then
|
||||
# On MacOSX there is a readlink tool with a different
|
||||
# purpose than the GNU readlink tool. Check the found readlink.
|
||||
ISGNU=`$READLINK --help 2>&1 | grep GNU`
|
||||
if test "x$ISGNU" = x; then
|
||||
# A readlink that we do not know how to use.
|
||||
# Are there other non-GNU readlinks out there?
|
||||
READLINK_TESTED=yes
|
||||
READLINK=
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$READLINK" != x; then
|
||||
$1=`$READLINK -f [$]$1`
|
||||
else
|
||||
STARTDIR=$PWD
|
||||
COUNTER=0
|
||||
DIR=`dirname [$]$1`
|
||||
FIL=`basename [$]$1`
|
||||
while test $COUNTER -lt 20; do
|
||||
ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'`
|
||||
if test "x$ISLINK" == x; then
|
||||
# This is not a symbolic link! We are done!
|
||||
break
|
||||
fi
|
||||
# The link might be relative! We have to use cd to travel safely.
|
||||
cd $DIR
|
||||
cd `dirname $ISLINK`
|
||||
DIR=`pwd`
|
||||
FIL=`basename $ISLINK`
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
cd $STARTDIR
|
||||
$1=$DIR/$FIL
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_INIT],
|
||||
[
|
||||
# Save the original command line. This is passed to us by the wrapper configure script.
|
||||
AC_SUBST(CONFIGURE_COMMAND_LINE)
|
||||
DATE_WHEN_CONFIGURED=`LANG=C date`
|
||||
AC_SUBST(DATE_WHEN_CONFIGURED)
|
||||
|
||||
# Locate the directory of this script.
|
||||
SCRIPT="[$]0"
|
||||
REMOVE_SYMBOLIC_LINKS(SCRIPT)
|
||||
AUTOCONF_DIR=`dirname [$]0`
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_PATHS],
|
||||
[
|
||||
# Where is the source? It is located two levels above the configure script.
|
||||
CURDIR="$PWD"
|
||||
cd "$AUTOCONF_DIR/../.."
|
||||
SRC_ROOT="`pwd`"
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
SRC_ROOT_LENGTH=`pwd|wc -m`
|
||||
if test $SRC_ROOT_LENGTH -gt 100; then
|
||||
AC_MSG_ERROR([Your base path is too long. It is $SRC_ROOT_LENGTH characters long, but only 100 is supported])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(SRC_ROOT)
|
||||
cd "$CURDIR"
|
||||
|
||||
SPACESAFE(SRC_ROOT,[the path to the source root])
|
||||
SPACESAFE(CURDIR,[the path to the current directory])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_SEARCHPATH],
|
||||
[
|
||||
if test "x$OPENJDK_BUILD_OS" = "xsolaris"; then
|
||||
# Add extra search paths on solaris for utilities like ar and as etc...
|
||||
PATH="$PATH:/usr/ccs/bin:/usr/sfw/bin:/opt/csw/bin"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_PATH_SEP],
|
||||
[
|
||||
# For cygwin we need cygpath first, since it is used everywhere.
|
||||
AC_PATH_PROG(CYGPATH, cygpath)
|
||||
PATH_SEP=":"
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
if test "x$CYGPATH" = x; then
|
||||
AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
|
||||
fi
|
||||
PATH_SEP=";"
|
||||
fi
|
||||
AC_SUBST(PATH_SEP)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
[
|
||||
|
||||
AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
|
||||
[use this as the name of the configuration, overriding the generated default])],
|
||||
[ CONF_NAME=${with_conf_name} ])
|
||||
|
||||
# Test from where we are running configure, in or outside of src root.
|
||||
if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" || test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" || test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
|
||||
# We are running configure from the src root.
|
||||
# Create a default ./build/target-variant-debuglevel output root.
|
||||
if test "x${CONF_NAME}" = x; then
|
||||
CONF_NAME="${OPENJDK_TARGET_OS}-${OPENJDK_TARGET_CPU}-${JDK_VARIANT}-${ANDED_JVM_VARIANTS}-${DEBUG_LEVEL}"
|
||||
fi
|
||||
OUTPUT_ROOT="$SRC_ROOT/build/${CONF_NAME}"
|
||||
mkdir -p "$OUTPUT_ROOT"
|
||||
if test ! -d "$OUTPUT_ROOT"; then
|
||||
AC_MSG_ERROR([Could not create build directory $OUTPUT_ROOT])
|
||||
fi
|
||||
else
|
||||
# We are running configure from outside of the src dir.
|
||||
# Then use the current directory as output dir!
|
||||
# If configuration is situated in normal build directory, just use the build
|
||||
# directory name as configuration name, otherwise use the complete path.
|
||||
if test "x${CONF_NAME}" = x; then
|
||||
CONF_NAME=`$ECHO $CURDIR | $SED -e "s!^${SRC_ROOT}/build/!!"`
|
||||
fi
|
||||
OUTPUT_ROOT="$CURDIR"
|
||||
fi
|
||||
|
||||
SPACESAFE(OUTPUT_ROOT,[the path to the output root])
|
||||
|
||||
AC_SUBST(SPEC, $OUTPUT_ROOT/spec.gmk)
|
||||
AC_SUBST(CONF_NAME, $CONF_NAME)
|
||||
AC_SUBST(OUTPUT_ROOT, $OUTPUT_ROOT)
|
||||
|
||||
# Most of the probed defines are put into config.h
|
||||
AC_CONFIG_HEADERS([$OUTPUT_ROOT/config.h:$AUTOCONF_DIR/config.h.in])
|
||||
# The spec.gmk file contains all variables for the make system.
|
||||
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
|
||||
# The spec.sh file contains variables for compare{images|-objects}.sh scrips.
|
||||
AC_CONFIG_FILES([$OUTPUT_ROOT/spec.sh:$AUTOCONF_DIR/spec.sh.in])
|
||||
# The generated Makefile knows where the spec.gmk is and where the source is.
|
||||
# You can run make from the OUTPUT_ROOT, or from the top-level Makefile
|
||||
# which will look for generated configurations
|
||||
AC_CONFIG_FILES([$OUTPUT_ROOT/Makefile:$AUTOCONF_DIR/Makefile.in])
|
||||
|
||||
# Save the arguments given to us
|
||||
echo "$CONFIGURE_COMMAND_LINE" > $OUTPUT_ROOT/configure-arguments
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_LOGGING],
|
||||
[
|
||||
# Setup default logging of stdout and stderr to build.log in the output root.
|
||||
BUILD_LOG='$(OUTPUT_ROOT)/build.log'
|
||||
BUILD_LOG_PREVIOUS='$(OUTPUT_ROOT)/build.log.old'
|
||||
BUILD_LOG_WRAPPER='$(SH) $(SRC_ROOT)/common/bin/logger.sh $(BUILD_LOG)'
|
||||
AC_SUBST(BUILD_LOG)
|
||||
AC_SUBST(BUILD_LOG_PREVIOUS)
|
||||
AC_SUBST(BUILD_LOG_WRAPPER)
|
||||
])
|
||||
|
||||
|
||||
#%%% Simple tools %%%
|
||||
|
||||
AC_DEFUN([BASIC_CHECK_FIND_DELETE],
|
||||
[
|
||||
# Test if find supports -delete
|
||||
AC_MSG_CHECKING([if find supports -delete])
|
||||
FIND_DELETE="-delete"
|
||||
|
||||
DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
|
||||
|
||||
echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
|
||||
|
||||
TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
|
||||
if test -f $DELETEDIR/TestIfFindSupportsDelete; then
|
||||
# No, it does not.
|
||||
rm $DELETEDIR/TestIfFindSupportsDelete
|
||||
FIND_DELETE="-exec rm \{\} \+"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
rmdir $DELETEDIR
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_NONEMPTY],
|
||||
[
|
||||
# Test that variable $1 is not empty.
|
||||
if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_SETUP_TOOLS],
|
||||
[
|
||||
# Start with tools that do not need have cross compilation support
|
||||
# and can be expected to be found in the default PATH. These tools are
|
||||
# used by configure. Nor are these tools expected to be found in the
|
||||
# devkit from the builddeps server either, since they are
|
||||
# needed to download the devkit.
|
||||
AC_PROG_AWK
|
||||
CHECK_NONEMPTY(AWK)
|
||||
AC_PATH_PROG(CAT, cat)
|
||||
CHECK_NONEMPTY(CAT)
|
||||
AC_PATH_PROG(CHMOD, chmod)
|
||||
CHECK_NONEMPTY(CHMOD)
|
||||
AC_PATH_PROG(CP, cp)
|
||||
CHECK_NONEMPTY(CP)
|
||||
AC_PATH_PROG(CPIO, cpio)
|
||||
CHECK_NONEMPTY(CPIO)
|
||||
AC_PATH_PROG(CUT, cut)
|
||||
CHECK_NONEMPTY(CUT)
|
||||
AC_PATH_PROG(DATE, date)
|
||||
CHECK_NONEMPTY(DATE)
|
||||
AC_PATH_PROG(DF, df)
|
||||
CHECK_NONEMPTY(DF)
|
||||
AC_PATH_PROG(DIFF, diff)
|
||||
CHECK_NONEMPTY(DIFF)
|
||||
# Warning echo is really, really unportable!!!!! Different
|
||||
# behaviour in bash and dash and in a lot of other shells!
|
||||
# Use printf for serious work!
|
||||
AC_PATH_PROG(ECHO, echo)
|
||||
CHECK_NONEMPTY(ECHO)
|
||||
AC_PROG_EGREP
|
||||
CHECK_NONEMPTY(EGREP)
|
||||
AC_PROG_FGREP
|
||||
CHECK_NONEMPTY(FGREP)
|
||||
|
||||
AC_PATH_PROG(FIND, find)
|
||||
CHECK_NONEMPTY(FIND)
|
||||
BASIC_CHECK_FIND_DELETE
|
||||
AC_SUBST(FIND_DELETE)
|
||||
|
||||
AC_PROG_GREP
|
||||
CHECK_NONEMPTY(GREP)
|
||||
AC_PATH_PROG(HEAD, head)
|
||||
CHECK_NONEMPTY(HEAD)
|
||||
AC_PATH_PROG(LN, ln)
|
||||
CHECK_NONEMPTY(LN)
|
||||
AC_PATH_PROG(LS, ls)
|
||||
CHECK_NONEMPTY(LS)
|
||||
AC_PATH_PROGS(MAKE, [gmake make])
|
||||
CHECK_NONEMPTY(MAKE)
|
||||
MAKE_VERSION=`$MAKE --version | head -n 1 | grep '3.8[[12346789]]'`
|
||||
if test "x$MAKE_VERSION" = x; then
|
||||
AC_MSG_ERROR([You must use GNU make 3.81 or newer! Please put it in the path, or add e.g. MAKE=/opt/gmake3.81/make as argument to configure.])
|
||||
fi
|
||||
AC_PATH_PROG(MKDIR, mkdir)
|
||||
CHECK_NONEMPTY(MKDIR)
|
||||
AC_PATH_PROG(MV, mv)
|
||||
CHECK_NONEMPTY(MV)
|
||||
AC_PATH_PROGS(NAWK, [nawk gawk awk])
|
||||
CHECK_NONEMPTY(NAWK)
|
||||
AC_PATH_PROG(PRINTF, printf)
|
||||
CHECK_NONEMPTY(PRINTF)
|
||||
AC_PATH_PROG(THEPWDCMD, pwd)
|
||||
AC_PATH_PROG(RM, rm)
|
||||
CHECK_NONEMPTY(RM)
|
||||
RM="$RM -f"
|
||||
AC_PROG_SED
|
||||
CHECK_NONEMPTY(SED)
|
||||
AC_PATH_PROG(SH, sh)
|
||||
CHECK_NONEMPTY(SH)
|
||||
AC_PATH_PROG(SORT, sort)
|
||||
CHECK_NONEMPTY(SORT)
|
||||
AC_PATH_PROG(TAR, tar)
|
||||
CHECK_NONEMPTY(TAR)
|
||||
AC_PATH_PROG(TAIL, tail)
|
||||
CHECK_NONEMPTY(TAIL)
|
||||
AC_PATH_PROG(TEE, tee)
|
||||
CHECK_NONEMPTY(TEE)
|
||||
AC_PATH_PROG(TR, tr)
|
||||
CHECK_NONEMPTY(TR)
|
||||
AC_PATH_PROG(TOUCH, touch)
|
||||
CHECK_NONEMPTY(TOUCH)
|
||||
AC_PATH_PROG(WC, wc)
|
||||
CHECK_NONEMPTY(WC)
|
||||
AC_PATH_PROG(XARGS, xargs)
|
||||
CHECK_NONEMPTY(XARGS)
|
||||
AC_PATH_PROG(ZIP, zip)
|
||||
CHECK_NONEMPTY(ZIP)
|
||||
AC_PATH_PROG(UNZIP, unzip)
|
||||
CHECK_NONEMPTY(UNZIP)
|
||||
AC_PATH_PROG(LDD, ldd)
|
||||
if test "x$LDD" = "x"; then
|
||||
# List shared lib dependencies is used for
|
||||
# debug output and checking for forbidden dependencies.
|
||||
# We can build without it.
|
||||
LDD="true"
|
||||
fi
|
||||
AC_PATH_PROG(OTOOL, otool)
|
||||
if test "x$OTOOL" = "x"; then
|
||||
OTOOL="true"
|
||||
fi
|
||||
AC_PATH_PROG(READELF, readelf)
|
||||
AC_PATH_PROG(EXPR, expr)
|
||||
CHECK_NONEMPTY(EXPR)
|
||||
AC_PATH_PROG(FILE, file)
|
||||
CHECK_NONEMPTY(FILE)
|
||||
AC_PATH_PROG(HG, hg)
|
||||
])
|
||||
|
||||
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_COMPILE_UNCYGDRIVE],
|
||||
[
|
||||
# When using cygwin, we need a wrapper binary that renames
|
||||
# /cygdrive/c/ arguments into c:/ arguments and peeks into
|
||||
# @files and rewrites these too! This wrapper binary is
|
||||
# called uncygdrive.exe.
|
||||
UNCYGDRIVE=
|
||||
if test "x$OPENJDK_BUILD_OS" = xwindows; then
|
||||
AC_MSG_CHECKING([if uncygdrive can be created])
|
||||
UNCYGDRIVE_SRC=`$CYGPATH -m $SRC_ROOT/common/src/uncygdrive.c`
|
||||
rm -f $OUTPUT_ROOT/uncygdrive*
|
||||
UNCYGDRIVE=`$CYGPATH -m $OUTPUT_ROOT/uncygdrive.exe`
|
||||
cd $OUTPUT_ROOT
|
||||
$CC $UNCYGDRIVE_SRC /Fe$UNCYGDRIVE > $OUTPUT_ROOT/uncygdrive1.log 2>&1
|
||||
cd $CURDIR
|
||||
|
||||
if test ! -x $OUTPUT_ROOT/uncygdrive.exe; then
|
||||
AC_MSG_RESULT([no])
|
||||
cat $OUTPUT_ROOT/uncygdrive1.log
|
||||
AC_MSG_ERROR([Could not create $OUTPUT_ROOT/uncygdrive.exe])
|
||||
fi
|
||||
AC_MSG_RESULT([$UNCYGDRIVE])
|
||||
AC_MSG_CHECKING([if uncygdrive.exe works])
|
||||
cd $OUTPUT_ROOT
|
||||
$UNCYGDRIVE $CC $SRC_ROOT/common/src/uncygdrive.c /Fe$OUTPUT_ROOT/uncygdrive2.exe > $OUTPUT_ROOT/uncygdrive2.log 2>&1
|
||||
cd $CURDIR
|
||||
if test ! -x $OUTPUT_ROOT/uncygdrive2.exe; then
|
||||
AC_MSG_RESULT([no])
|
||||
cat $OUTPUT_ROOT/uncygdrive2.log
|
||||
AC_MSG_ERROR([Uncygdrive did not work!])
|
||||
fi
|
||||
AC_MSG_RESULT([yes])
|
||||
rm -f $OUTPUT_ROOT/uncygdrive?.??? $OUTPUT_ROOT/uncygdrive.obj
|
||||
fi
|
||||
|
||||
AC_SUBST(UNCYGDRIVE)
|
||||
])
|
||||
|
||||
|
||||
# Check if build directory is on local disk.
|
||||
# Argument 1: directory to test
|
||||
# Argument 2: what to do if it is on local disk
|
||||
# Argument 3: what to do otherwise (remote disk or failure)
|
||||
AC_DEFUN([BASIC_CHECK_DIR_ON_LOCAL_DISK],
|
||||
[
|
||||
# df -l lists only local disks; if the given directory is not found then
|
||||
# a non-zero exit code is given
|
||||
if $DF -l $1 > /dev/null 2>&1; then
|
||||
$2
|
||||
else
|
||||
$3
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES],
|
||||
[
|
||||
|
||||
AC_MSG_CHECKING([if build directory is on local disk])
|
||||
BASIC_CHECK_DIR_ON_LOCAL_DISK($OUTPUT_ROOT,
|
||||
[OUTPUT_DIR_IS_LOCAL="yes"],
|
||||
[OUTPUT_DIR_IS_LOCAL="no"])
|
||||
AC_MSG_RESULT($OUTPUT_DIR_IS_LOCAL)
|
||||
|
||||
# Check if the user has any old-style ALT_ variables set.
|
||||
FOUND_ALT_VARIABLES=`env | grep ^ALT_`
|
||||
|
||||
# Before generating output files, test if they exist. If they do, this is a reconfigure.
|
||||
# Since we can't properly handle the dependencies for this, warn the user about the situation
|
||||
if test -e $OUTPUT_ROOT/spec.gmk; then
|
||||
IS_RECONFIGURE=yes
|
||||
else
|
||||
IS_RECONFIGURE=no
|
||||
fi
|
||||
|
||||
if test -e $SRC_ROOT/build/.hide-configure-performance-hints; then
|
||||
HIDE_PERFORMANCE_HINTS=yes
|
||||
else
|
||||
HIDE_PERFORMANCE_HINTS=no
|
||||
# Hide it the next time around...
|
||||
$TOUCH $SRC_ROOT/build/.hide-configure-performance-hints > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
])
|
295
common/autoconf/boot-jdk.m4
Normal file
295
common/autoconf/boot-jdk.m4
Normal file
@ -0,0 +1,295 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Fixes paths on windows to be mixed mode short.
|
||||
AC_DEFUN([BOOTJDK_WIN_FIX_PATH],
|
||||
[
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
AC_PATH_PROG(CYGPATH, cygpath)
|
||||
tmp="[$]$1"
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
$1="$tmp"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([BOOTJDK_MISSING_ERROR],
|
||||
[
|
||||
AC_MSG_NOTICE([This might be fixed by explicitely setting --with-boot-jdk])
|
||||
AC_MSG_ERROR([Cannot continue])
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# 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@:>@])])
|
||||
|
||||
if test "x$with_boot_jdk" != x; then
|
||||
BOOT_JDK=$with_boot_jdk
|
||||
BOOT_JDK_FOUND=yes
|
||||
fi
|
||||
if test "x$BOOT_JDK_FOUND" = xno; then
|
||||
BDEPS_CHECK_MODULE(BOOT_JDK, boot-jdk, xxx, [BOOT_JDK_FOUND=yes], [BOOT_JDK_FOUND=no])
|
||||
fi
|
||||
|
||||
if test "x$BOOT_JDK_FOUND" = xno; then
|
||||
if test "x$JAVA_HOME" != x; then
|
||||
if test ! -d "$JAVA_HOME"; then
|
||||
AC_MSG_NOTICE([Your JAVA_HOME points to a non-existing directory!])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
# Aha, the user has set a JAVA_HOME
|
||||
# let us use that as the Boot JDK.
|
||||
BOOT_JDK="$JAVA_HOME"
|
||||
BOOT_JDK_FOUND=yes
|
||||
# To be on the safe side, lets check that it is a JDK.
|
||||
if test -x "$BOOT_JDK/bin/javac" && test -x "$BOOT_JDK/bin/java"; then
|
||||
JAVAC="$BOOT_JDK/bin/javac"
|
||||
JAVA="$BOOT_JDK/bin/java"
|
||||
BOOT_JDK_FOUND=yes
|
||||
else
|
||||
AC_MSG_NOTICE([Your JAVA_HOME points to a JRE! The build needs a JDK! Please point JAVA_HOME to a JDK. JAVA_HOME=[$]JAVA_HOME])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$BOOT_JDK_FOUND" = xno; then
|
||||
AC_PATH_PROG(JAVAC_CHECK, javac)
|
||||
AC_PATH_PROG(JAVA_CHECK, java)
|
||||
BINARY="$JAVAC_CHECK"
|
||||
if test "x$JAVAC_CHECK" = x; then
|
||||
BINARY="$JAVA_CHECK"
|
||||
fi
|
||||
if test "x$BINARY" != x; then
|
||||
# So there is a java(c) binary, it might be part of a JDK.
|
||||
# Lets find the JDK/JRE directory by following symbolic links.
|
||||
# Linux/GNU systems often have links from /usr/bin/java to
|
||||
# /etc/alternatives/java to the real JDK binary.
|
||||
WHICHCMD_SPACESAFE(BINARY,[path to javac])
|
||||
REMOVE_SYMBOLIC_LINKS(BINARY)
|
||||
BOOT_JDK=`dirname $BINARY`
|
||||
BOOT_JDK=`cd $BOOT_JDK/..; pwd`
|
||||
if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
|
||||
JAVAC=$BOOT_JDK/bin/javac
|
||||
JAVA=$BOOT_JDK/bin/java
|
||||
BOOT_JDK_FOUND=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$BOOT_JDK_FOUND" = xno; then
|
||||
# Try the MacOSX way.
|
||||
if test -x /usr/libexec/java_home; then
|
||||
BOOT_JDK=`/usr/libexec/java_home`
|
||||
if test -x $BOOT_JDK/bin/javac && test -x $BOOT_JDK/bin/java; then
|
||||
JAVAC=$BOOT_JDK/bin/javac
|
||||
JAVA=$BOOT_JDK/bin/java
|
||||
BOOT_JDK_FOUND=yes
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$BOOT_JDK_FOUND" = xno; then
|
||||
AC_PATH_PROG(JAVA_CHECK, java)
|
||||
if test "x$JAVA_CHECK" != x; then
|
||||
# There is a java in the path. But apparently we have not found a javac
|
||||
# in the path, since that would have been tested earlier.
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
# Now if this is a windows platform. The default installation of a JDK
|
||||
# actually puts the JRE in the path and keeps the JDK out of the path!
|
||||
# Go look in the default installation location.
|
||||
BOOT_JDK=/cygdrive/c/Program\ Files/Java/`ls /cygdrive/c/Program\ Files/Java | grep jdk | sort -r | head --lines 1`
|
||||
if test -d "$BOOT_JDK"; then
|
||||
BOOT_JDK_FOUND=yes
|
||||
fi
|
||||
fi
|
||||
if test "x$BOOT_JDK_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([openjdk])
|
||||
AC_MSG_NOTICE([Found a JRE, not not a JDK! Please remove the JRE from your path and put a JDK there instead. $HELP_MSG])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
else
|
||||
HELP_MSG_MISSING_DEPENDENCY([openjdk])
|
||||
AC_MSG_NOTICE([Could not find a JDK. $HELP_MSG])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
fi
|
||||
|
||||
BOOTJDK_WIN_FIX_PATH(BOOT_JDK)
|
||||
|
||||
# Now see if we can find the rt.jar, or its nearest equivalent.
|
||||
BOOT_RTJAR="$BOOT_JDK/jre/lib/rt.jar"
|
||||
SPACESAFE(BOOT_RTJAR,[the path to the Boot JDK rt.jar (or nearest equivalent)])
|
||||
|
||||
BOOT_TOOLSJAR="$BOOT_JDK/lib/tools.jar"
|
||||
SPACESAFE(BOOT_TOOLSJAR,[the path to the Boot JDK tools.jar (or nearest equivalent)])
|
||||
|
||||
if test ! -f $BOOT_RTJAR; then
|
||||
# On MacOSX it is called classes.jar
|
||||
BOOT_RTJAR=$BOOT_JDK/../Classes/classes.jar
|
||||
if test ! -f $BOOT_RTJAR; then
|
||||
AC_MSG_NOTICE([Cannot find the rt.jar or its equivalent!])
|
||||
AC_MSG_NOTICE([This typically means that configure failed to automatically find a suitable Boot JDK])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
# Remove the ..
|
||||
BOOT_RTJAR="`cd ${BOOT_RTJAR%/*} && pwd`/${BOOT_RTJAR##*/}"
|
||||
# The tools.jar is part of classes.jar
|
||||
BOOT_TOOLSJAR="$BOOT_RTJAR"
|
||||
fi
|
||||
|
||||
AC_SUBST(BOOT_JDK)
|
||||
AC_SUBST(BOOT_RTJAR)
|
||||
AC_SUBST(BOOT_TOOLSJAR)
|
||||
AC_MSG_CHECKING([for Boot JDK])
|
||||
AC_MSG_RESULT([$BOOT_JDK])
|
||||
AC_MSG_CHECKING([for Boot rt.jar])
|
||||
AC_MSG_RESULT([$BOOT_RTJAR])
|
||||
AC_MSG_CHECKING([for Boot tools.jar])
|
||||
AC_MSG_RESULT([$BOOT_TOOLSJAR])
|
||||
|
||||
# Use the java tool from the Boot JDK.
|
||||
AC_MSG_CHECKING([for java in Boot JDK])
|
||||
JAVA=$BOOT_JDK/bin/java
|
||||
if test ! -x $JAVA; then
|
||||
AC_MSG_NOTICE([Could not find a working java])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
BOOT_JDK_VERSION=`$JAVA -version 2>&1 | head -n 1`
|
||||
AC_MSG_RESULT([yes $BOOT_JDK_VERSION])
|
||||
AC_SUBST(JAVA)
|
||||
|
||||
# Extra M4 quote needed to protect [] in grep expression.
|
||||
[FOUND_VERSION_78=`echo $BOOT_JDK_VERSION | grep '\"1\.[78]\.'`]
|
||||
if test "x$FOUND_VERSION_78" = x; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([openjdk])
|
||||
AC_MSG_NOTICE([Your boot-jdk must be version 7 or 8. $HELP_MSG])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
|
||||
# When compiling code to be executed by the Boot JDK, force jdk7 compatibility.
|
||||
BOOT_JDK_SOURCETARGET="-source 7 -target 7"
|
||||
AC_SUBST(BOOT_JDK_SOURCETARGET)
|
||||
|
||||
# Use the javac tool from the Boot JDK.
|
||||
AC_MSG_CHECKING([for javac in Boot JDK])
|
||||
JAVAC=$BOOT_JDK/bin/javac
|
||||
if test ! -x $JAVAC; then
|
||||
AC_MSG_ERROR([Could not find a working javac])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_SUBST(JAVAC)
|
||||
AC_SUBST(JAVAC_FLAGS)
|
||||
|
||||
# Use the javah tool from the Boot JDK.
|
||||
AC_MSG_CHECKING([for javah in Boot JDK])
|
||||
JAVAH=$BOOT_JDK/bin/javah
|
||||
if test ! -x $JAVAH; then
|
||||
AC_MSG_NOTICE([Could not find a working javah])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_SUBST(JAVAH)
|
||||
|
||||
# Use the jar tool from the Boot JDK.
|
||||
AC_MSG_CHECKING([for jar in Boot JDK])
|
||||
JAR=$BOOT_JDK/bin/jar
|
||||
if test ! -x $JAR; then
|
||||
AC_MSG_NOTICE([Could not find a working jar])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
AC_SUBST(JAR)
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
# Use the rmic tool from the Boot JDK.
|
||||
AC_MSG_CHECKING([for rmic in Boot JDK])
|
||||
RMIC=$BOOT_JDK/bin/rmic
|
||||
if test ! -x $RMIC; then
|
||||
AC_MSG_NOTICE([Could not find a working rmic])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
AC_SUBST(RMIC)
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
# Use the native2ascii tool from the Boot JDK.
|
||||
AC_MSG_CHECKING([for native2ascii in Boot JDK])
|
||||
NATIVE2ASCII=$BOOT_JDK/bin/native2ascii
|
||||
if test ! -x $NATIVE2ASCII; then
|
||||
AC_MSG_NOTICE([Could not find a working native2ascii])
|
||||
BOOTJDK_MISSING_ERROR
|
||||
fi
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_SUBST(NATIVE2ASCII)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
|
||||
[
|
||||
##############################################################################
|
||||
#
|
||||
# Specify options for anything that is run with the Boot JDK.
|
||||
#
|
||||
AC_ARG_WITH(boot-jdk-jvmargs, [AS_HELP_STRING([--with-boot-jdk-jvmargs],
|
||||
[specify JVM arguments to be passed to all invocations of the Boot JDK, overriding the default values,
|
||||
e.g --with-boot-jdk-jvmargs="-Xmx8G -enableassertions"])])
|
||||
|
||||
if test "x$with_boot_jdk_jvmargs" = x; then
|
||||
# Not all JVM:s accept the same arguments on the command line.
|
||||
# OpenJDK specific increase in thread stack for JDK build,
|
||||
# well more specifically, when running javac.
|
||||
if test "x$BUILD_NUM_BITS" = x32; then
|
||||
STACK_SIZE=768
|
||||
else
|
||||
# Running Javac on a JVM on a 64-bit machine, the stack takes more space
|
||||
# since 64-bit pointers are pushed on the stach. Apparently, we need
|
||||
# to increase the stack space when javacing the JDK....
|
||||
STACK_SIZE=1536
|
||||
fi
|
||||
|
||||
# Minimum amount of heap memory.
|
||||
ADD_JVM_ARG_IF_OK([-Xms64M],boot_jdk_jvmargs,[$JAVA])
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||
# Why does macosx need more heap? Its the huge JDK batch.
|
||||
ADD_JVM_ARG_IF_OK([-Xmx1600M],boot_jdk_jvmargs,[$JAVA])
|
||||
else
|
||||
ADD_JVM_ARG_IF_OK([-Xmx1100M],boot_jdk_jvmargs,[$JAVA])
|
||||
fi
|
||||
# When is adding -client something that speeds up the JVM?
|
||||
# ADD_JVM_ARG_IF_OK([-client],boot_jdk_jvmargs,[$JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-XX:PermSize=32m],boot_jdk_jvmargs,[$JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-XX:MaxPermSize=160m],boot_jdk_jvmargs,[$JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-XX:ThreadStackSize=$STACK_SIZE],boot_jdk_jvmargs,[$JAVA])
|
||||
# Disable special log output when a debug build is used as Boot JDK...
|
||||
ADD_JVM_ARG_IF_OK([-XX:-PrintVMOptions -XX:-UnlockDiagnosticVMOptions -XX:-LogVMOutput],boot_jdk_jvmargs,[$JAVA])
|
||||
fi
|
||||
|
||||
AC_SUBST(BOOT_JDK_JVMARGS, $boot_jdk_jvmargs)
|
||||
])
|
1531
common/autoconf/build-aux/autoconf-config.guess
Normal file
1531
common/autoconf/build-aux/autoconf-config.guess
Normal file
File diff suppressed because it is too large
Load Diff
1553
common/autoconf/build-aux/config.guess
vendored
1553
common/autoconf/build-aux/config.guess
vendored
File diff suppressed because it is too large
Load Diff
378
common/autoconf/build-performance.m4
Normal file
378
common/autoconf/build-performance.m4
Normal file
@ -0,0 +1,378 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([BPERF_CHECK_CORES],
|
||||
[
|
||||
AC_MSG_CHECKING([for number of cores])
|
||||
NUM_CORES=1
|
||||
FOUND_CORES=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/psrinfo; then
|
||||
# Looks like a Solaris system
|
||||
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
NUM_CORES=4
|
||||
fi
|
||||
|
||||
# For c/c++ code we run twice as many concurrent build
|
||||
# jobs than we have cores, otherwise we will stall on io.
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
|
||||
if test "x$FOUND_CORES" = xyes; then
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect number of cores, defaulting to 1!])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([BPERF_CHECK_MEMORY_SIZE],
|
||||
[
|
||||
AC_MSG_CHECKING([for memory size])
|
||||
# Default to 1024MB
|
||||
MEMORY_SIZE=1024
|
||||
FOUND_MEM=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/prtconf; then
|
||||
# Looks like a Solaris system
|
||||
MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$FOUND_MEM" = xyes; then
|
||||
AC_MSG_RESULT([$MEMORY_SIZE MB])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect memory size defaulting to 1024MB!])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_CORES],
|
||||
[
|
||||
# How many cores do we have on this build system?
|
||||
AC_ARG_WITH(num-cores, [AS_HELP_STRING([--with-num-cores],
|
||||
[number of cores in the build system, e.g. --with-num-cores=8 @<:@probed@:>@])])
|
||||
if test "x$with_num_cores" = x; then
|
||||
# The number of cores were not specified, try to probe them.
|
||||
BPERF_CHECK_CORES
|
||||
else
|
||||
NUM_CORES=$with_num_cores
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
fi
|
||||
AC_SUBST(NUM_CORES)
|
||||
AC_SUBST(CONCURRENT_BUILD_JOBS)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_BUILD_MEMORY],
|
||||
[
|
||||
# How much memory do we have on this build system?
|
||||
AC_ARG_WITH(memory-size, [AS_HELP_STRING([--with-memory-size],
|
||||
[memory (in MB) available in the build system, e.g. --with-memory-size=1024 @<:@probed@:>@])])
|
||||
if test "x$with_memory_size" = x; then
|
||||
# The memory size was not specified, try to probe it.
|
||||
BPERF_CHECK_MEMORY_SIZE
|
||||
else
|
||||
MEMORY_SIZE=$with_memory_size
|
||||
fi
|
||||
AC_SUBST(MEMORY_SIZE)
|
||||
])
|
||||
|
||||
AC_DEFUN([BPERF_SETUP_CCACHE],
|
||||
[
|
||||
AC_ARG_ENABLE([ccache],
|
||||
[AS_HELP_STRING([--disable-ccache],
|
||||
[use ccache to speed up recompilations @<:@enabled@:>@])],
|
||||
[ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes])
|
||||
if test "x$ENABLE_CCACHE" = xyes; then
|
||||
AC_PATH_PROG(CCACHE, ccache)
|
||||
else
|
||||
AC_MSG_CHECKING([for ccache])
|
||||
AC_MSG_RESULT([explicitly disabled])
|
||||
CCACHE=
|
||||
fi
|
||||
AC_SUBST(CCACHE)
|
||||
|
||||
AC_ARG_WITH([ccache-dir],
|
||||
[AS_HELP_STRING([--with-ccache-dir],
|
||||
[where to store ccache files @<:@~/.ccache@:>@])])
|
||||
|
||||
if test "x$with_ccache_dir" != x; then
|
||||
# When using a non home ccache directory, assume the use is to share ccache files
|
||||
# with other users. Thus change the umask.
|
||||
SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002"
|
||||
fi
|
||||
CCACHE_FOUND=""
|
||||
if test "x$CCACHE" != x; then
|
||||
BPERF_SETUP_CCACHE_USAGE
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
|
||||
[
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_FOUND="true"
|
||||
# Only use ccache if it is 3.1.4 or later, which supports
|
||||
# precompiled headers.
|
||||
AC_MSG_CHECKING([if ccache supports precompiled headers])
|
||||
HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null`
|
||||
if test "x$HAS_GOOD_CCACHE" = x; then
|
||||
AC_MSG_RESULT([no, disabling ccache])
|
||||
CCACHE=
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
|
||||
PUSHED_FLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="-fpch-preprocess $CXXFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
|
||||
CXXFLAGS="$PUSHED_FLAGS"
|
||||
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
|
||||
CCACHE=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_SLOPPINESS=time_macros
|
||||
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
|
||||
CCACHE_FLAGS=-fpch-preprocess
|
||||
|
||||
if test "x$SET_CCACHE_DIR" != x; then
|
||||
mkdir -p $CCACHE_DIR > /dev/null 2>&1
|
||||
chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_PRECOMPILED_HEADERS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Can the C/C++ compiler use precompiled headers?
|
||||
#
|
||||
AC_ARG_ENABLE([precompiled-headers], [AS_HELP_STRING([--disable-precompiled-headers],
|
||||
[use precompiled headers when compiling C++ @<:@enabled@:>@])],
|
||||
[ENABLE_PRECOMPH=${enable_precompiled-headers}], [ENABLE_PRECOMPH=yes])
|
||||
|
||||
USE_PRECOMPILED_HEADER=1
|
||||
if test "x$ENABLE_PRECOMPH" = xno; then
|
||||
USE_PRECOMPILED_HEADER=0
|
||||
fi
|
||||
|
||||
if test "x$ENABLE_PRECOMPH" = xyes; then
|
||||
# Check that the compiler actually supports precomp headers.
|
||||
if test "x$GCC" = xyes; then
|
||||
AC_MSG_CHECKING([that precompiled headers work])
|
||||
echo "int alfa();" > conftest.h
|
||||
$CXX -x c++-header conftest.h -o conftest.hpp.gch
|
||||
if test ! -f conftest.hpp.gch; then
|
||||
echo Precompiled header is not working!
|
||||
USE_PRECOMPILED_HEADER=0
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
rm -f conftest.h
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_PRECOMPILED_HEADER)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_SMART_JAVAC],
|
||||
[
|
||||
AC_ARG_WITH(server-java, [AS_HELP_STRING([--with-server-java],
|
||||
[use this java binary for running the javac background server and other long running java tasks in the build process,
|
||||
e.g. ---with-server-java="/opt/jrockit/bin/java -server"])])
|
||||
|
||||
if test "x$with_server_java" != x; then
|
||||
SERVER_JAVA="$with_server_java"
|
||||
FOUND_VERSION=`$SERVER_JAVA -version 2>&1 | grep " version \""`
|
||||
if test "x$FOUND_VERSION" = x; then
|
||||
AC_MSG_ERROR([Could not execute server java: $SERVER_JAVA])
|
||||
fi
|
||||
else
|
||||
SERVER_JAVA=""
|
||||
# Hotspot specific options.
|
||||
ADD_JVM_ARG_IF_OK([-XX:+UseParallelOldGC],SERVER_JAVA,[$JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-verbosegc],SERVER_JAVA,[$JAVA])
|
||||
# JRockit specific options.
|
||||
ADD_JVM_ARG_IF_OK([-Xverbose:gc],SERVER_JAVA,[$JAVA])
|
||||
SERVER_JAVA="$JAVA $SERVER_JAVA"
|
||||
fi
|
||||
AC_SUBST(SERVER_JAVA)
|
||||
|
||||
AC_MSG_CHECKING([whether to use shared server for javac])
|
||||
AC_ARG_ENABLE([javac-server], [AS_HELP_STRING([--enable-javac-server],
|
||||
[enable the shared javac server during the build process @<:@disabled@:>@])],
|
||||
[ENABLE_JAVAC_SERVER="${enableval}"], [ENABLE_JAVAC_SERVER='no'])
|
||||
AC_MSG_RESULT([$ENABLE_JAVAC_SERVER])
|
||||
if test "x$ENABLE_JAVAC_SERVER" = xyes; then
|
||||
JAVAC_USE_REMOTE=true
|
||||
JAVAC_SERVERS="$OUTPUT_ROOT/javacservers"
|
||||
else
|
||||
JAVAC_USE_REMOTE=false
|
||||
JAVAC_SERVERS=
|
||||
fi
|
||||
AC_SUBST(JAVAC_USE_REMOTE)
|
||||
AC_SUBST(JAVAC_SERVERS)
|
||||
|
||||
AC_ARG_WITH(javac-server-cores, [AS_HELP_STRING([--with-javac-server-cores],
|
||||
[use at most this number of concurrent threads on the javac server @<:@probed@:>@])])
|
||||
if test "x$with_javac_server_cores" != x; then
|
||||
JAVAC_SERVER_CORES="$with_javac_server_cores"
|
||||
else
|
||||
if test "$NUM_CORES" -gt 16; then
|
||||
# We set this arbitrary limit because we want to limit the heap
|
||||
# size of the javac 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
|
||||
# more concurrent threads in the server.
|
||||
JAVAC_SERVER_CORES="16"
|
||||
else
|
||||
JAVAC_SERVER_CORES="$NUM_CORES"
|
||||
fi
|
||||
|
||||
if test "$MEMORY_SIZE" -gt "17000"; then
|
||||
MAX_HEAP_MEM=10000
|
||||
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xms10G -Xmx10G],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn2G],SERVER_JAVA,[$SERVER_JAVA])
|
||||
elif test "$MEMORY_SIZE" -gt "10000"; then
|
||||
MAX_HEAP_MEM=6000
|
||||
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xms6G -Xmx6G],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn1G],SERVER_JAVA,[$SERVER_JAVA])
|
||||
elif test "$MEMORY_SIZE" -gt "5000"; then
|
||||
MAX_HEAP_MEM=3000
|
||||
ADD_JVM_ARG_IF_OK([-d64],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx3G],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
elif test "$MEMORY_SIZE" -gt "3800"; then
|
||||
MAX_HEAP_MEM=2500
|
||||
ADD_JVM_ARG_IF_OK([-Xms1G -Xmx2500M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
elif test "$MEMORY_SIZE" -gt "1900"; then
|
||||
MAX_HEAP_MEM=1200
|
||||
ADD_JVM_ARG_IF_OK([-Xms700M -Xmx1200M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn256M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
elif test "$MEMORY_SIZE" -gt "1000"; then
|
||||
MAX_HEAP_MEM=900
|
||||
ADD_JVM_ARG_IF_OK([-Xms400M -Xmx900M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
else
|
||||
MAX_HEAP_MEM=512
|
||||
ADD_JVM_ARG_IF_OK([-Xms256M -Xmx512M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
ADD_JVM_ARG_IF_OK([-Xmn128M],SERVER_JAVA,[$SERVER_JAVA])
|
||||
fi
|
||||
|
||||
MAX_COMPILERS_IN_HEAP=`expr $MAX_HEAP_MEM / 501`
|
||||
if test "$JAVAC_SERVER_CORES" -gt "$MAX_COMPILERS_IN_HEAP"; then
|
||||
AC_MSG_CHECKING([if number of server cores must be reduced])
|
||||
JAVAC_SERVER_CORES="$MAX_COMPILERS_IN_HEAP"
|
||||
AC_MSG_RESULT([yes, to $JAVAC_SERVER_CORES with max heap size $MAX_HEAP_MEM MB])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(JAVAC_SERVER_CORES)
|
||||
|
||||
AC_MSG_CHECKING([whether to track dependencies between Java packages])
|
||||
AC_ARG_ENABLE([javac-deps], [AS_HELP_STRING([--enable-javac-deps],
|
||||
[enable the dependency tracking between Java packages @<:@disabled@:>@])],
|
||||
[ENABLE_JAVAC_DEPS="${enableval}"], [ENABLE_JAVAC_DEPS='no'])
|
||||
AC_MSG_RESULT([$ENABLE_JAVAC_DEPS])
|
||||
if test "x$ENABLE_JAVAC_DEPS" = xyes; then
|
||||
JAVAC_USE_DEPS=true
|
||||
else
|
||||
JAVAC_USE_DEPS=false
|
||||
fi
|
||||
AC_SUBST(JAVAC_USE_DEPS)
|
||||
|
||||
AC_MSG_CHECKING([whether to use multiple cores for javac compilation])
|
||||
AC_ARG_ENABLE([javac-multi-core], [AS_HELP_STRING([--enable-javac-multi-core],
|
||||
[compile Java packages concurrently @<:@disabled@:>@])],
|
||||
[ENABLE_JAVAC_MULTICORE="${enableval}"], [ENABLE_JAVAC_MULTICORE='no'])
|
||||
AC_MSG_RESULT([$ENABLE_JAVAC_MULTICORE])
|
||||
if test "x$ENABLE_JAVAC_MULTICORE" = xyes; then
|
||||
JAVAC_USE_MODE=MULTI_CORE_CONCURRENT
|
||||
else
|
||||
JAVAC_USE_MODE=SINGLE_THREADED_BATCH
|
||||
if test "x$ENABLE_JAVAC_DEPS" = xyes; then
|
||||
AC_MSG_WARN([Dependency tracking is not supported with single threaded batch compiles of Java source roots. Please add --disable-javac-deps to your configure options.])
|
||||
AC_MSG_WARN([Disabling dependency tracking for you now.])
|
||||
JAVAC_USE_DEPS=false
|
||||
fi
|
||||
if test "x$ENABLE_JAVAC_SERVER" = xyes; then
|
||||
AC_MSG_WARN([The javac server will not be used since single threaded batch compiles are run within their own JVM. Please add --disable-javac-server to your configure options.])
|
||||
AC_MSG_WARN([Disabling javac server for you now.])
|
||||
JAVAC_USE_REMOTE=false
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(JAVAC_USE_MODE)
|
||||
|
||||
AC_MSG_CHECKING([whether to use sjavac])
|
||||
AC_ARG_ENABLE([sjavac], [AS_HELP_STRING([--enable-sjavac],
|
||||
[use sjavac to do fast incremental compiles @<:@disabled@:>@])],
|
||||
[ENABLE_SJAVAC="${enableval}"], [ENABLE_SJAVAC='no'])
|
||||
AC_MSG_RESULT([$ENABLE_SJAVAC])
|
||||
AC_SUBST(ENABLE_SJAVAC)
|
||||
|
||||
])
|
@ -31,11 +31,11 @@
|
||||
|
||||
# Translate a configuration triplet/quadruplet into something
|
||||
# known by this configuration file.
|
||||
# If no rewrite was found, then rewritten_host=${host}
|
||||
# If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_SYSTEM}
|
||||
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
|
||||
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
|
||||
|
||||
# The needed cups builddeps are host independent header files.
|
||||
# The needed cups builddeps are platform independent header files.
|
||||
# I.e. they need not be part of the devkit.
|
||||
builddep_cups=lib/cups_1_3_9.zip
|
||||
builddep_cups_CFLAGS=-I${depdir}
|
||||
@ -44,10 +44,10 @@ builddep_cups_CFLAGS=-I${depdir}
|
||||
# for the build platform.
|
||||
builddep_devkit=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
|
||||
# The freetype dependency is partyl host dependent.
|
||||
# The freetype dependency is partly platform dependent.
|
||||
# It is stored inside the sys-root.
|
||||
builddep_freetype2=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_host}/sys-root/usr/include/freetype2
|
||||
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_target}/sys-root/usr/include/freetype2
|
||||
builddep_freetype2_LIBS=-lfreetype
|
||||
|
||||
# There are many other build dependencies, but they are implicitly
|
||||
|
@ -23,7 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
[
|
||||
define(LIST_OF_BUILD_DEPENDENCIES,)
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
@ -50,27 +50,27 @@ AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
AC_MSG_ERROR([Could not find any builddeps.conf at all!])
|
||||
fi
|
||||
fi
|
||||
# Create build and host names that use _ instead of "-" and ".".
|
||||
# Create build and target names that use _ instead of "-" and ".".
|
||||
# This is necessary to use them in variable names.
|
||||
build_var=`echo ${build} | tr '-' '_' | tr '.' '_'`
|
||||
host_var=`echo ${host} | tr '-' '_' | tr '.' '_'`
|
||||
# Extract rewrite information for build and host
|
||||
build_var=`echo ${OPENJDK_BUILD_SYSTEM} | tr '-' '_' | tr '.' '_'`
|
||||
target_var=`echo ${OPENJDK_TARGET_SYSTEM} | tr '-' '_' | tr '.' '_'`
|
||||
# Extract rewrite information for build and target
|
||||
eval rewritten_build=\${REWRITE_${build_var}}
|
||||
if test "x$rewritten_build" = x; then
|
||||
rewritten_build=${build}
|
||||
rewritten_build=${OPENJDK_BUILD_SYSTEM}
|
||||
echo Build stays the same $rewritten_build
|
||||
else
|
||||
echo Rewriting build for builddeps into $rewritten_build
|
||||
fi
|
||||
eval rewritten_host=\${REWRITE_${host_var}}
|
||||
if test "x$rewritten_host" = x; then
|
||||
rewritten_host=${host}
|
||||
echo Host stays the same $rewritten_host
|
||||
eval rewritten_target=\${REWRITE_${target_var}}
|
||||
if test "x$rewritten_target" = x; then
|
||||
rewritten_target=${OPENJDK_TARGET_SYSTEM}
|
||||
echo Target stays the same $rewritten_target
|
||||
else
|
||||
echo Rewriting host for builddeps into $rewritten_host
|
||||
echo Rewriting target for builddeps into $rewritten_target
|
||||
fi
|
||||
rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'`
|
||||
rewritten_host_var=`echo ${rewritten_host} | tr '-' '_' | tr '.' '_'`
|
||||
rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'`
|
||||
fi
|
||||
AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip])
|
||||
if test "x$BDEPS_UNZIP" = x7z; then
|
||||
@ -127,11 +127,11 @@ AC_DEFUN([BDEPS_CHECK_MODULE],
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
# Source the builddeps file again, to make sure it uses the latest variables!
|
||||
. $builddepsfile
|
||||
# Look for a host and build machine specific resource!
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}}
|
||||
# Look for a target and build machine specific resource!
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}}
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a host specific resource
|
||||
eval resource=\${builddep_$2_HOST_${rewritten_host_var}}
|
||||
# Ok, lets instead look for a target specific resource
|
||||
eval resource=\${builddep_$2_TARGET_${rewritten_target_var}}
|
||||
fi
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a build specific resource
|
||||
@ -228,3 +228,33 @@ AC_DEFUN([BDEPS_FETCH],
|
||||
$5=$installdir
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BDEPS_CONFIGURE_BUILDDEPS],
|
||||
[
|
||||
AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf],
|
||||
[use this configuration file for the builddeps])])
|
||||
|
||||
AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server],
|
||||
[download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])])
|
||||
|
||||
AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir],
|
||||
[store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])],
|
||||
[],
|
||||
[with_builddeps_dir=/localhome/builddeps])
|
||||
|
||||
AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group],
|
||||
[chgrp the downloaded build dependencies to this group])])
|
||||
|
||||
AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps],
|
||||
[list all build dependencies known to the configure script])],
|
||||
[LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no'])
|
||||
|
||||
if test "x$LIST_BUILDDEPS" = xyes; then
|
||||
echo
|
||||
echo List of build dependencies known to the configure script,
|
||||
echo that can be used in builddeps.conf files:
|
||||
cat $AUTOCONF_DIR/*.ac $AUTOCONF_DIR/*.m4 | grep BDEPS_CHECK_MODUL[E]\( | cut -f 2 -d ',' | tr -d ' ' | sort
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
])
|
||||
|
16836
common/autoconf/configure
vendored
16836
common/autoconf/configure
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,103 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([CHECK_CORES],
|
||||
[
|
||||
AC_MSG_CHECKING([for number of cores])
|
||||
NUM_CORES=1
|
||||
FOUND_CORES=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/psrinfo; then
|
||||
# Looks like a Solaris system
|
||||
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
NUM_CORES=4
|
||||
fi
|
||||
|
||||
# For c/c++ code we run twice as many concurrent build
|
||||
# jobs than we have cores, otherwise we will stall on io.
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
|
||||
if test "x$FOUND_CORES" = xyes; then
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect number of cores, defaulting to 1!])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_MEMORY_SIZE],
|
||||
[
|
||||
AC_MSG_CHECKING([for memory size])
|
||||
# Default to 1024MB
|
||||
MEMORY_SIZE=1024
|
||||
FOUND_MEM=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/prtconf; then
|
||||
# Looks like a Solaris system
|
||||
MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$FOUND_MEM" = xyes; then
|
||||
AC_MSG_RESULT([$MEMORY_SIZE MB])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect memory size defaulting to 1024MB!])
|
||||
fi
|
||||
])
|
18054
common/autoconf/generated-configure.sh
Normal file
18054
common/autoconf/generated-configure.sh
Normal file
File diff suppressed because it is too large
Load Diff
@ -23,11 +23,13 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
function prepare_help_system {
|
||||
AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
|
||||
[
|
||||
AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
|
||||
}
|
||||
|
||||
function help_on_build_dependency {
|
||||
])
|
||||
|
||||
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
|
||||
[
|
||||
# Print a helpful message on how to acquire the necessary build dependency.
|
||||
# $1 is the help tag: freetyp2, cups, pulse, alsa etc
|
||||
MISSING_DEPENDENCY=$1
|
||||
@ -51,9 +53,9 @@ function help_on_build_dependency {
|
||||
if test "x$PKGHANDLER_COMMAND" != x; then
|
||||
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
|
||||
fi
|
||||
}
|
||||
])
|
||||
|
||||
function apt_help {
|
||||
apt_help() {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
|
||||
@ -76,7 +78,7 @@ function apt_help {
|
||||
esac
|
||||
}
|
||||
|
||||
function yum_help {
|
||||
yum_help() {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
|
||||
@ -99,14 +101,97 @@ function yum_help {
|
||||
esac
|
||||
}
|
||||
|
||||
function port_help {
|
||||
port_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
function pkgutil_help {
|
||||
pkgutil_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
function pkgadd_help {
|
||||
pkgadd_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
||||
[
|
||||
# Finally output some useful information to the user
|
||||
|
||||
if test "x$CCACHE_FOUND" != x; then
|
||||
if test "x$HAS_GOOD_CCACHE" = x; then
|
||||
CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
|
||||
CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
|
||||
else
|
||||
CCACHE_STATUS="installed and in use"
|
||||
fi
|
||||
else
|
||||
if test "x$GCC" = xyes; then
|
||||
CCACHE_STATUS="not installed (consider installing)"
|
||||
CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
|
||||
else
|
||||
CCACHE_STATUS="not available for your system"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
printf "====================================================\n"
|
||||
printf "A new configuration has been successfully created in\n"
|
||||
printf "$OUTPUT_ROOT\n"
|
||||
if test "x$CONFIGURE_COMMAND_LINE" != x; then
|
||||
printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
|
||||
else
|
||||
printf "using default settings.\n"
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
printf "Configuration summary:\n"
|
||||
printf "* Debug level: $DEBUG_LEVEL\n"
|
||||
printf "* JDK variant: $JDK_VARIANT\n"
|
||||
printf "* JVM variants: $with_jvm_variants\n"
|
||||
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
||||
printf "* Boot JDK: $BOOT_JDK\n"
|
||||
|
||||
printf "\n"
|
||||
printf "Build performance summary:\n"
|
||||
printf "* Cores to use: $NUM_CORES\n"
|
||||
printf "* Memory limit: $MEMORY_SIZE MB\n"
|
||||
printf "* ccache status: $CCACHE_STATUS\n"
|
||||
printf "\n"
|
||||
|
||||
if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
|
||||
printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
|
||||
printf "$CCACHE_HELP_MSG\n"
|
||||
HELP_MSG_MISSING_DEPENDENCY([ccache])
|
||||
printf "$HELP_MSG\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
|
||||
printf "NOTE: You have requested to build more than one version of the JVM, which\n"
|
||||
printf "will result in longer build times.\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$FOUND_ALT_VARIABLES" != "x"; then
|
||||
printf "WARNING: You have old-style ALT_ environment variables set.\n"
|
||||
printf "These are not respected, and will be ignored. It is recommended\n"
|
||||
printf "that you clean your environment. The following variables are set:\n"
|
||||
printf "$FOUND_ALT_VARIABLES\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
|
||||
printf "WARNING: Your build output directory is not on a local disk.\n"
|
||||
printf "This will severely degrade build performance!\n"
|
||||
printf "It is recommended that you create an output directory on a local disk,\n"
|
||||
printf "and run the configure script again from that directory.\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$IS_RECONFIGURE" = "xyes"; then
|
||||
printf "WARNING: The result of this configuration has overridden an older\n"
|
||||
printf "configuration. You *should* run 'make clean' to make sure you get a\n"
|
||||
printf "proper build. Failure to do so might result in strange build problems.\n"
|
||||
printf "\n"
|
||||
fi
|
||||
])
|
||||
|
551
common/autoconf/jdk-options.m4
Normal file
551
common/autoconf/jdk-options.m4
Normal file
@ -0,0 +1,551 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Check which variant of the JDK that we want to build.
|
||||
# Currently we have:
|
||||
# normal: standard edition
|
||||
# embedded: cut down to a smaller footprint
|
||||
#
|
||||
# Effectively the JDK variant gives a name to a specific set of
|
||||
# modules to compile into the JDK. In the future, these modules
|
||||
# might even be Jigsaw modules.
|
||||
#
|
||||
AC_MSG_CHECKING([which variant of the JDK to build])
|
||||
AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
|
||||
[JDK variant to build (normal, embedded) @<:@normal@:>@])])
|
||||
|
||||
if test "x$with_jdk_variant" = xnormal || test "x$with_jdk_variant" = x; then
|
||||
JAVASE_EMBEDDED=""
|
||||
MINIMIZE_RAM_USAGE=""
|
||||
JDK_VARIANT="normal"
|
||||
elif test "x$with_jdk_variant" = xembedded; then
|
||||
JAVASE_EMBEDDED="JAVASE_EMBEDDED:=true"
|
||||
MINIMIZE_RAM_USAGE="MINIMIZE_RAM_USAGE:=true"
|
||||
JDK_VARIANT="embedded"
|
||||
else
|
||||
AC_MSG_ERROR([The available JDK variants are: normal, embedded])
|
||||
fi
|
||||
|
||||
AC_SUBST(JAVASE_EMBEDDED)
|
||||
AC_SUBST(MINIMIZE_RAM_USAGE)
|
||||
AC_SUBST(JDK_VARIANT)
|
||||
|
||||
AC_MSG_RESULT([$JDK_VARIANT])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check which variants of the JVM that we want to build.
|
||||
# Currently we have:
|
||||
# server: normal interpreter and a tiered C1/C2 compiler
|
||||
# client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
|
||||
# kernel: kernel footprint JVM that passes the TCK without major performance problems,
|
||||
# ie normal interpreter and C1, only the serial GC, kernel jvmti etc
|
||||
# zero: no machine code interpreter, no compiler
|
||||
# zeroshark: zero interpreter and shark/llvm compiler backend
|
||||
AC_MSG_CHECKING([which variants of the JVM that should be built])
|
||||
AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
|
||||
[JVM variants (separated by commas) to build (server, client, kernel, zero, zeroshark) @<:@server@:>@])])
|
||||
|
||||
if test "x$with_jvm_variants" = x; then
|
||||
if test "x$JDK_VARIANT" = xembedded; then
|
||||
with_jvm_variants="client"
|
||||
else
|
||||
with_jvm_variants="server"
|
||||
fi
|
||||
fi
|
||||
|
||||
JVM_VARIANTS=",$with_jvm_variants,"
|
||||
TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//'`
|
||||
|
||||
if test "x$TEST_VARIANTS" != "x,"; then
|
||||
AC_MSG_ERROR([The available JVM variants are: server, client, kernel, zero, zeroshark])
|
||||
fi
|
||||
AC_MSG_RESULT([$with_jvm_variants])
|
||||
|
||||
JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
|
||||
JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
|
||||
JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
|
||||
JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
|
||||
JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
|
||||
|
||||
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
if test "x$JVM_VARIANT_KERNEL" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Replace the commas with AND for use in the build directory name.
|
||||
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/'`
|
||||
COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/'`
|
||||
if test "x$COUNT_VARIANTS" != "x,1"; then
|
||||
BUILDING_MULTIPLE_JVM_VARIANTS=yes
|
||||
else
|
||||
BUILDING_MULTIPLE_JVM_VARIANTS=no
|
||||
fi
|
||||
|
||||
AC_SUBST(JVM_VARIANTS)
|
||||
AC_SUBST(JVM_VARIANT_SERVER)
|
||||
AC_SUBST(JVM_VARIANT_CLIENT)
|
||||
AC_SUBST(JVM_VARIANT_KERNEL)
|
||||
AC_SUBST(JVM_VARIANT_ZERO)
|
||||
AC_SUBST(JVM_VARIANT_ZEROSHARK)
|
||||
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Set the debug level
|
||||
# release: no debug information, all optimizations, no asserts.
|
||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||
#
|
||||
DEBUG_LEVEL="release"
|
||||
AC_MSG_CHECKING([which debug level to use])
|
||||
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
|
||||
[set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) @<:@disabled@:>@])],
|
||||
[
|
||||
ENABLE_DEBUG="${enableval}"
|
||||
DEBUG_LEVEL="fastdebug"
|
||||
], [ENABLE_DEBUG="no"])
|
||||
|
||||
AC_ARG_WITH([debug-level], [AS_HELP_STRING([--with-debug-level],
|
||||
[set the debug level (release, fastdebug, slowdebug) @<:@release@:>@])],
|
||||
[
|
||||
DEBUG_LEVEL="${withval}"
|
||||
if test "x$ENABLE_DEBUG" = xyes; then
|
||||
AC_MSG_ERROR([You cannot use both --enable-debug and --with-debug-level at the same time.])
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT([$DEBUG_LEVEL])
|
||||
|
||||
if test "x$DEBUG_LEVEL" != xrelease && \
|
||||
test "x$DEBUG_LEVEL" != xfastdebug && \
|
||||
test "x$DEBUG_LEVEL" != xslowdebug; then
|
||||
AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Setup legacy vars/targets and new vars to deal with different debug levels.
|
||||
#
|
||||
|
||||
case $DEBUG_LEVEL in
|
||||
release )
|
||||
VARIANT="OPT"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="false"
|
||||
BUILD_VARIANT_RELEASE=""
|
||||
HOTSPOT_DEBUG_LEVEL="product"
|
||||
HOTSPOT_EXPORT="product"
|
||||
;;
|
||||
fastdebug )
|
||||
VARIANT="DBG"
|
||||
FASTDEBUG="true"
|
||||
DEBUG_CLASSFILES="true"
|
||||
BUILD_VARIANT_RELEASE="-fastdebug"
|
||||
HOTSPOT_DEBUG_LEVEL="fastdebug"
|
||||
HOTSPOT_EXPORT="fastdebug"
|
||||
;;
|
||||
slowdebug )
|
||||
VARIANT="DBG"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="true"
|
||||
BUILD_VARIANT_RELEASE="-debug"
|
||||
HOTSPOT_DEBUG_LEVEL="jvmg"
|
||||
HOTSPOT_EXPORT="debug"
|
||||
;;
|
||||
esac
|
||||
|
||||
#####
|
||||
# Generate the legacy makefile targets for hotspot.
|
||||
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
||||
#
|
||||
HOTSPOT_TARGET=""
|
||||
|
||||
if test "x$JVM_VARIANT_SERVER" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_KERNEL" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZERO" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
|
||||
fi
|
||||
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
|
||||
|
||||
#####
|
||||
|
||||
AC_SUBST(DEBUG_LEVEL)
|
||||
AC_SUBST(VARIANT)
|
||||
AC_SUBST(FASTDEBUG)
|
||||
AC_SUBST(DEBUG_CLASSFILES)
|
||||
AC_SUBST(BUILD_VARIANT_RELEASE)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we build only OpenJDK even if closed sources are present?
|
||||
#
|
||||
AC_ARG_ENABLE([openjdk-only], [AS_HELP_STRING([--enable-openjdk-only],
|
||||
[build OpenJDK regardless of the presence of closed repositories @<:@disabled@:>@])],,)
|
||||
|
||||
if test "x$enable_openjdk_only" = "xyes"; then
|
||||
OPENJDK=true
|
||||
elif test "x$enable_openjdk_only" = "xno"; then
|
||||
OPENJDK=false
|
||||
elif test -d "$SRC_ROOT/jdk/src/closed"; then
|
||||
OPENJDK=false
|
||||
else
|
||||
OPENJDK=true
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK" = "xtrue"; then
|
||||
SET_OPENJDK=OPENJDK=true
|
||||
fi
|
||||
|
||||
AC_SUBST(SET_OPENJDK)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# JIGSAW or not. The JIGSAW variable is used during the intermediate
|
||||
# stage when we are building both the old style JDK and the new style modularized JDK.
|
||||
# When the modularized JDK is finalized, this option will go away.
|
||||
#
|
||||
AC_ARG_ENABLE([jigsaw], [AS_HELP_STRING([--enable-jigsaw],
|
||||
[build Jigsaw images (not yet available) @<:@disabled@:>@])],,)
|
||||
|
||||
if test "x$enable_jigsaw" = "xyes"; then
|
||||
JIGSAW=true
|
||||
else
|
||||
JIGSAW=false
|
||||
fi
|
||||
AC_SUBST(JIGSAW)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we build a JDK/JVM with headful support (ie a graphical ui)?
|
||||
# We always build headless support.
|
||||
#
|
||||
AC_MSG_CHECKING([headful support])
|
||||
AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
|
||||
[build headful support (graphical UI support) @<:@enabled@:>@])],
|
||||
[SUPPORT_HEADFUL=${enable_headful}], [SUPPORT_HEADFUL=yes])
|
||||
|
||||
SUPPORT_HEADLESS=yes
|
||||
BUILD_HEADLESS="BUILD_HEADLESS:=true"
|
||||
|
||||
if test "x$SUPPORT_HEADFUL" = xyes; then
|
||||
# We are building both headful and headless.
|
||||
BUILD_HEADLESS_ONLY=""
|
||||
headful_msg="inlude support for both headful and headless"
|
||||
fi
|
||||
|
||||
if test "x$SUPPORT_HEADFUL" = xno; then
|
||||
# Thus we are building headless only.
|
||||
BUILD_HEADLESS="BUILD_HEADLESS:=true"
|
||||
BUILD_HEADLESS_ONLY="BUILD_HEADLESS_ONLY:=true"
|
||||
headful_msg="headless only"
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$headful_msg])
|
||||
|
||||
AC_SUBST(SUPPORT_HEADLESS)
|
||||
AC_SUBST(SUPPORT_HEADFUL)
|
||||
AC_SUBST(BUILD_HEADLESS)
|
||||
AC_SUBST(BUILD_HEADLESS_ONLY)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we run the painfully slow javadoc tool?
|
||||
#
|
||||
AC_MSG_CHECKING([whether to build documentation])
|
||||
AC_ARG_ENABLE([docs], [AS_HELP_STRING([--enable-docs],
|
||||
[enable generation of Javadoc documentation @<:@disabled@:>@])],
|
||||
[ENABLE_DOCS="${enableval}"], [ENABLE_DOCS='no'])
|
||||
AC_MSG_RESULT([$ENABLE_DOCS])
|
||||
AC_SUBST(ENABLE_DOCS)
|
||||
GENERATE_DOCS=false
|
||||
if test "x$ENABLE_DOCS" = xyes; then
|
||||
GENERATE_DOCS=true
|
||||
fi
|
||||
AC_SUBST(GENERATE_DOCS)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we compile nimbus swing L&F? We can probably remove this option
|
||||
# since nimbus is officially part of javax now.
|
||||
#
|
||||
AC_MSG_CHECKING([whether to build nimbus L&F])
|
||||
AC_ARG_ENABLE([nimbus], [AS_HELP_STRING([--disable-nimbus],
|
||||
[disable Nimbus L&F @<:@enabled@:>@])],
|
||||
[ENABLE_NIMBUS="${enableval}"], [ENABLE_NIMBUS='yes'])
|
||||
AC_MSG_RESULT([$ENABLE_NIMBUS])
|
||||
DISABLE_NIMBUS=
|
||||
if test "x$ENABLE_NIMBUS" = xno; then
|
||||
DISABLE_NIMBUS=true
|
||||
fi
|
||||
AC_SUBST(DISABLE_NIMBUS)
|
||||
|
||||
# Control wether Hotspot runs Queens test after build.
|
||||
AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
|
||||
[enable running of Queens test after Hotspot build (not yet available) @<:@disabled@:>@])],,
|
||||
[enable_hotspot_test_in_build=no])
|
||||
if test "x$enable_hotspot_test_in_build" = "xyes"; then
|
||||
TEST_IN_BUILD=true
|
||||
else
|
||||
TEST_IN_BUILD=false
|
||||
fi
|
||||
AC_SUBST(TEST_IN_BUILD)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Choose cacerts source file
|
||||
#
|
||||
AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
|
||||
[specify alternative cacerts file])])
|
||||
if test "x$with_cacerts_file" != x; then
|
||||
CACERTS_FILE=$with_cacerts_file
|
||||
else
|
||||
if test "x$OPENJDK" = "xtrue"; then
|
||||
CACERTS_FILE=${SRC_ROOT}/jdk/src/share/lib/security/cacerts
|
||||
else
|
||||
CACERTS_FILE=${SRC_ROOT}/jdk/src/closed/share/lib/security/cacerts.internal
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(CACERTS_FILE)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Compress jars
|
||||
#
|
||||
COMPRESS_JARS=false
|
||||
|
||||
# default for embedded is yes...
|
||||
if test "x$JDK_VARIANT" = "xembedded"; then
|
||||
COMPRESS_JARS=true
|
||||
fi
|
||||
AC_SUBST(COMPRESS_JARS)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we compile JFR
|
||||
# default no, except for on closed-jdk and !embedded
|
||||
#
|
||||
ENABLE_JFR=no
|
||||
|
||||
# Is the JFR source present
|
||||
|
||||
#
|
||||
# For closed && !embedded default is yes if the source is present
|
||||
#
|
||||
if test "x${OPENJDK}" != "xtrue" && test "x$JDK_VARIANT" != "xembedded" && test -d "$SRC_ROOT/jdk/src/closed/share/native/oracle/jfr"; then
|
||||
ENABLE_JFR=yes
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to build jfr])
|
||||
AC_ARG_ENABLE([jfr], [AS_HELP_STRING([--enable-jfr],
|
||||
[enable jfr (default is no)])]
|
||||
[ENABLE_JFR="${enableval}"])
|
||||
AC_MSG_RESULT([${ENABLE_JFR}])
|
||||
|
||||
if test "x$ENABLE_JFR" = "xyes"; then
|
||||
ENABLE_JFR=true
|
||||
elif test "x$ENABLE_JFR" = "xno"; then
|
||||
ENABLE_JFR=false
|
||||
else
|
||||
AC_MSG_ERROR([Invalid argument to --enable-jfr])
|
||||
fi
|
||||
|
||||
AC_SUBST(ENABLE_JFR)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS],
|
||||
[
|
||||
# Source the version numbers
|
||||
. $AUTOCONF_DIR/version.numbers
|
||||
if test "x$OPENJDK" = "xfalse"; then
|
||||
. $AUTOCONF_DIR/closed.version.numbers
|
||||
fi
|
||||
# Now set the JDK version, milestone, build number etc.
|
||||
AC_SUBST(JDK_MAJOR_VERSION)
|
||||
AC_SUBST(JDK_MINOR_VERSION)
|
||||
AC_SUBST(JDK_MICRO_VERSION)
|
||||
AC_SUBST(JDK_UPDATE_VERSION)
|
||||
AC_SUBST(JDK_BUILD_NUMBER)
|
||||
AC_SUBST(MILESTONE)
|
||||
AC_SUBST(LAUNCHER_NAME)
|
||||
AC_SUBST(PRODUCT_NAME)
|
||||
AC_SUBST(PRODUCT_SUFFIX)
|
||||
AC_SUBST(JDK_RC_PLATFORM_NAME)
|
||||
AC_SUBST(COMPANY_NAME)
|
||||
|
||||
COPYRIGHT_YEAR=`date +'%Y'`
|
||||
AC_SUBST(COPYRIGHT_YEAR)
|
||||
|
||||
RUNTIME_NAME="$PRODUCT_NAME $PRODUCT_SUFFIX"
|
||||
AC_SUBST(RUNTIME_NAME)
|
||||
|
||||
if test "x$JDK_UPDATE_VERSION" != x; then
|
||||
JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}_${JDK_UPDATE_VERSION}"
|
||||
else
|
||||
JDK_VERSION="${JDK_MAJOR_VERSION}.${JDK_MINOR_VERSION}.${JDK_MICRO_VERSION}"
|
||||
fi
|
||||
AC_SUBST(JDK_VERSION)
|
||||
|
||||
if test "x$MILESTONE" != x; then
|
||||
RELEASE="${JDK_VERSION}-${MILESTONE}${BUILD_VARIANT_RELEASE}"
|
||||
else
|
||||
RELEASE="${JDK_VERSION}${BUILD_VARIANT_RELEASE}"
|
||||
fi
|
||||
AC_SUBST(RELEASE)
|
||||
|
||||
if test "x$JDK_BUILD_NUMBER" != x; then
|
||||
FULL_VERSION="${RELEASE}-${JDK_BUILD_NUMBER}"
|
||||
else
|
||||
JDK_BUILD_NUMBER=b00
|
||||
BUILD_DATE=`date '+%Y_%m_%d_%H_%M'`
|
||||
# Avoid [:alnum:] since it depends on the locale.
|
||||
CLEAN_USERNAME=`echo "$USER" | $TR -d -c 'abcdefghijklmnopqrstuvqxyz0123456789'`
|
||||
USER_RELEASE_SUFFIX=`echo "${CLEAN_USERNAME}_${BUILD_DATE}" | $TR 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvqxyz'`
|
||||
FULL_VERSION="${RELEASE}-${USER_RELEASE_SUFFIX}-${JDK_BUILD_NUMBER}"
|
||||
fi
|
||||
AC_SUBST(FULL_VERSION)
|
||||
COOKED_BUILD_NUMBER=`$ECHO $JDK_BUILD_NUMBER | $SED -e 's/^b//' -e 's/^0//'`
|
||||
AC_SUBST(COOKED_BUILD_NUMBER)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
|
||||
[
|
||||
HOTSPOT_MAKE_ARGS="ALT_OUTPUTDIR=$HOTSPOT_OUTPUTDIR ALT_EXPORT_PATH=$HOTSPOT_DIST $HOTSPOT_TARGET"
|
||||
AC_SUBST(HOTSPOT_MAKE_ARGS)
|
||||
|
||||
# The name of the Service Agent jar.
|
||||
SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
|
||||
fi
|
||||
AC_SUBST(SALIB_NAME)
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
[
|
||||
#
|
||||
# ENABLE_DEBUG_SYMBOLS
|
||||
# This must be done after the toolchain is setup, since we're looking at objcopy.
|
||||
#
|
||||
ENABLE_DEBUG_SYMBOLS=default
|
||||
|
||||
# default on macosx is no...
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
ENABLE_DEBUG_SYMBOLS=no
|
||||
fi
|
||||
|
||||
# default for embedded is no...
|
||||
if test "x$JDK_VARIANT" = "xembedded"; then
|
||||
ENABLE_DEBUG_SYMBOLS=no
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([debug-symbols],
|
||||
[AS_HELP_STRING([--disable-debug-symbols],[disable generation of debug symbols (@<:@enabled@:>@)])],
|
||||
[ENABLE_DEBUG_SYMBOLS=${enable_debug_symbols}],
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([if we should generate debug symbols])
|
||||
|
||||
if test "x$ENABLE_DEBUG_SYMBOLS" = "xyes" && test "x$OBJCOPY" = x; then
|
||||
# explicit enabling of enable-debug-symbols and can't find objcopy
|
||||
# this is an error
|
||||
AC_MSG_ERROR([Unable to find objcopy, cannot enable debug-symbols])
|
||||
fi
|
||||
|
||||
if test "x$ENABLE_DEBUG_SYMBOLS" = "xdefault"; then
|
||||
# Default is on if objcopy is found, otherwise off
|
||||
if test "x$OBJCOPY" != x; then
|
||||
ENABLE_DEBUG_SYMBOLS=yes
|
||||
else
|
||||
ENABLE_DEBUG_SYMBOLS=no
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_MSG_RESULT([$ENABLE_DEBUG_SYMBOLS])
|
||||
|
||||
#
|
||||
# ZIP_DEBUGINFO_FILES
|
||||
#
|
||||
ZIP_DEBUGINFO_FILES=yes
|
||||
|
||||
AC_ARG_ENABLE([zip-debug-info],
|
||||
[AS_HELP_STRING([--disable-zip-debug-info],[don't zip debug-info files (@<:@enabled@:@)])],
|
||||
[ZIP_DEBUGINFO_FILES=${enable_zip_debug_info}],
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([if we should zip debug-info files])
|
||||
AC_MSG_RESULT([$ZIP_DEBUGINFO_FILES])
|
||||
|
||||
# Hotspot wants ZIP_DEBUGINFO_FILES to be 1 for yes
|
||||
# use that...
|
||||
if test "x$ZIP_DEBUGINFO_FILES" = "xyes"; then
|
||||
ZIP_DEBUGINFO_FILES=1
|
||||
else
|
||||
ZIP_DEBUGINFO_FILES=0
|
||||
fi
|
||||
|
||||
AC_SUBST(ENABLE_DEBUG_SYMBOLS)
|
||||
AC_SUBST(ZIP_DEBUGINFO_FILES)
|
||||
AC_SUBST(CFLAGS_DEBUG_SYMBOLS)
|
||||
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS)
|
||||
])
|
642
common/autoconf/libraries.m4
Normal file
642
common/autoconf/libraries.m4
Normal file
@ -0,0 +1,642 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_INIT],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# OS specific settings that we never will need to probe.
|
||||
#
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
AC_MSG_CHECKING([what is not needed on Linux?])
|
||||
PULSE_NOT_NEEDED=yes
|
||||
AC_MSG_RESULT([pulse])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
AC_MSG_CHECKING([what is not needed on Solaris?])
|
||||
ALSA_NOT_NEEDED=yes
|
||||
PULSE_NOT_NEEDED=yes
|
||||
AC_MSG_RESULT([alsa pulse])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
AC_MSG_CHECKING([what is not needed on Windows?])
|
||||
CUPS_NOT_NEEDED=yes
|
||||
ALSA_NOT_NEEDED=yes
|
||||
PULSE_NOT_NEEDED=yes
|
||||
X11_NOT_NEEDED=yes
|
||||
AC_MSG_RESULT([alsa cups pulse x11])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
AC_MSG_CHECKING([what is not needed on MacOSX?])
|
||||
ALSA_NOT_NEEDED=yes
|
||||
PULSE_NOT_NEEDED=yes
|
||||
X11_NOT_NEEDED=yes
|
||||
FREETYPE2_NOT_NEEDED=yes
|
||||
# If the java runtime framework is disabled, then we need X11.
|
||||
# This will be adjusted below.
|
||||
AC_MSG_RESULT([alsa pulse x11])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
AC_MSG_CHECKING([what is not needed on bsd?])
|
||||
ALSA_NOT_NEEDED=yes
|
||||
AC_MSG_RESULT([alsa])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK" = "xfalse"; then
|
||||
FREETYPE2_NOT_NEEDED=yes
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for MacOSX support for OpenJDK. If this exists, try to build a JVM
|
||||
# that uses this API.
|
||||
#
|
||||
AC_ARG_ENABLE([macosx-runtime-support], [AS_HELP_STRING([--disable-macosx-runtime-support],
|
||||
[disable the use of MacOSX Java runtime support framework @<:@enabled@:>@])],
|
||||
[MACOSX_RUNTIME_SUPPORT="${enableval}"],[MACOSX_RUNTIME_SUPPORT="no"])
|
||||
|
||||
USE_MACOSX_RUNTIME_SUPPORT=no
|
||||
AC_MSG_CHECKING([for explicit Java runtime support in the OS])
|
||||
if test -f /System/Library/Frameworks/JavaVM.framework/Frameworks/JavaRuntimeSupport.framework/Headers/JavaRuntimeSupport.h; then
|
||||
if test "x$MACOSX_RUNTIME_SUPPORT" != xno; then
|
||||
MACOSX_RUNTIME_SUPPORT=yes
|
||||
USE_MACOSX_RUNTIME_SUPPORT=yes
|
||||
AC_MSG_RESULT([yes, does not need alsa freetype2 pulse and X11])
|
||||
else
|
||||
AC_MSG_RESULT([yes, but explicitly disabled.])
|
||||
fi
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$USE_MACOSX_RUNTIME_SUPPORT" = xno; then
|
||||
AC_MSG_CHECKING([what is not needed on an X11 build on MacOSX?])
|
||||
X11_NOT_NEEDED=
|
||||
FREETYPE2_NOT_NEEDED=
|
||||
AC_MSG_RESULT([alsa pulse])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_X11],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for X Windows
|
||||
#
|
||||
|
||||
# Check if the user has specified sysroot, but not --x-includes or --x-libraries.
|
||||
# Make a simple check for the libraries at the sysroot, and setup --x-includes and
|
||||
# --x-libraries for the sysroot, if that seems to be correct.
|
||||
if test "x$SYS_ROOT" != "x/"; then
|
||||
if test "x$x_includes" = xNONE; then
|
||||
if test -f "$SYS_ROOT/usr/X11R6/include/X11/Xlib.h"; then
|
||||
x_includes="$SYS_ROOT/usr/X11R6/include"
|
||||
fi
|
||||
fi
|
||||
if test "x$x_libraries" = xNONE; then
|
||||
if test -f "$SYS_ROOT/usr/X11R6/lib/libX11.so"; then
|
||||
x_libraries="$SYS_ROOT/usr/X11R6/lib"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Now let autoconf do it's magic
|
||||
AC_PATH_X
|
||||
AC_PATH_XTRA
|
||||
|
||||
if test "x$no_x" = xyes && test "x$X11_NOT_NEEDED" != xyes; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([x11])
|
||||
AC_MSG_ERROR([Could not find X11 libraries. $HELP_MSG])
|
||||
fi
|
||||
|
||||
# Some of the old makefiles require a setting of OPENWIN_HOME
|
||||
# Since the X11R6 directory has disappeared on later Linuxes,
|
||||
# we need to probe for it.
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test -d "$SYS_ROOT/usr/X11R6"; then
|
||||
OPENWIN_HOME="$SYS_ROOT/usr/X11R6"
|
||||
fi
|
||||
if test -d "$SYS_ROOT/usr/include/X11"; then
|
||||
OPENWIN_HOME="$SYS_ROOT/usr"
|
||||
fi
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
OPENWIN_HOME="/usr/openwin"
|
||||
fi
|
||||
AC_SUBST(OPENWIN_HOME)
|
||||
|
||||
|
||||
#
|
||||
# Weird Sol10 something check...TODO change to try compile
|
||||
#
|
||||
if test "x${OPENJDK_TARGET_OS}" = xsolaris; then
|
||||
if test "`uname -r`" = "5.10"; then
|
||||
if test "`${EGREP} -c XLinearGradient ${OPENWIN_HOME}/share/include/X11/extensions/Xrender.h`" = "0"; then
|
||||
X_CFLAGS="${X_CFLAGS} -DSOLARIS10_NO_XRENDER_STRUCTS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_LANG_PUSH(C)
|
||||
OLD_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $X_CFLAGS"
|
||||
AC_CHECK_HEADERS([X11/extensions/shape.h X11/extensions/Xrender.h X11/extensions/XTest.h],
|
||||
[X11_A_OK=yes],
|
||||
[X11_A_OK=no])
|
||||
CFLAGS="$OLD_CFLAGS"
|
||||
AC_LANG_POP(C)
|
||||
|
||||
if test "x$X11_A_OK" = xno && test "x$X11_NOT_NEEDED" != xyes; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([x11])
|
||||
AC_MSG_ERROR([Could not find all X11 headers (shape.h Xrender.h XTest.h). $HELP_MSG])
|
||||
fi
|
||||
|
||||
AC_SUBST(X_CFLAGS)
|
||||
AC_SUBST(X_LIBS)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_CUPS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# The common unix printing system cups is used to print from java.
|
||||
#
|
||||
AC_ARG_WITH(cups, [AS_HELP_STRING([--with-cups],
|
||||
[specify prefix directory for the cups package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
AC_ARG_WITH(cups-include, [AS_HELP_STRING([--with-cups-include],
|
||||
[specify directory for the cups include files])])
|
||||
AC_ARG_WITH(cups-lib, [AS_HELP_STRING([--with-cups-lib],
|
||||
[specify directory for the cups library])])
|
||||
|
||||
if test "x$CUPS_NOT_NEEDED" = xyes; then
|
||||
if test "x${with_cups}" != x || test "x${with_cups_include}" != x || test "x${with_cups_lib}" != x; then
|
||||
AC_MSG_WARN([cups not used, so --with-cups is ignored])
|
||||
fi
|
||||
CUPS_CFLAGS=
|
||||
CUPS_LIBS=
|
||||
else
|
||||
CUPS_FOUND=no
|
||||
|
||||
if test "x${with_cups}" = xno || test "x${with_cups_include}" = xno || test "x${with_cups_lib}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of cups. Remove the --without-cups option.])
|
||||
fi
|
||||
|
||||
if test "x${with_cups}" != x; then
|
||||
CUPS_LIBS="-L${with_cups}/lib -lcups"
|
||||
CUPS_CFLAGS="-I${with_cups}/include"
|
||||
CUPS_FOUND=yes
|
||||
fi
|
||||
if test "x${with_cups_include}" != x; then
|
||||
CUPS_CFLAGS="-I${with_cups_include}"
|
||||
CUPS_FOUND=yes
|
||||
fi
|
||||
if test "x${with_cups_lib}" != x; then
|
||||
CUPS_LIBS="-L${with_cups_lib} -lcups"
|
||||
CUPS_FOUND=yes
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
BDEPS_CHECK_MODULE(CUPS, cups, xxx, [CUPS_FOUND=yes])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
# Are the cups headers installed in the default /usr/include location?
|
||||
AC_CHECK_HEADERS([cups/cups.h cups/ppd.h],
|
||||
[CUPS_FOUND=yes
|
||||
CUPS_CFLAGS=
|
||||
CUPS_LIBS="-lcups"
|
||||
DEFAULT_CUPS=yes])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
# Getting nervous now? Lets poke around for standard Solaris third-party
|
||||
# package installation locations.
|
||||
AC_MSG_CHECKING([for cups headers and libs])
|
||||
if test -s /opt/sfw/cups/include/cups/cups.h; then
|
||||
# An SFW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I/opt/sfw/cups/include"
|
||||
CUPS_LIBS="-L/opt/sfw/cups/lib -lcups"
|
||||
elif test -s /opt/csw/include/cups/cups.h; then
|
||||
# A CSW package seems to be installed!
|
||||
CUPS_FOUND=yes
|
||||
CUPS_CFLAGS="-I/opt/csw/include"
|
||||
CUPS_LIBS="-L/opt/csw/lib -lcups"
|
||||
fi
|
||||
AC_MSG_RESULT([$CUPS_FOUND])
|
||||
fi
|
||||
if test "x$CUPS_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([cups])
|
||||
AC_MSG_ERROR([Could not find cups! $HELP_MSG ])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(CUPS_CFLAGS)
|
||||
AC_SUBST(CUPS_LIBS)
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# The ubiquitous freetype2 library is used to render fonts.
|
||||
#
|
||||
AC_ARG_WITH(freetype, [AS_HELP_STRING([--with-freetype],
|
||||
[specify prefix directory for the freetype2 package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
|
||||
# If we are using the OS installed system lib for freetype, then we do not need to copy it to the build tree
|
||||
USING_SYSTEM_FT_LIB=false
|
||||
|
||||
if test "x$FREETYPE2_NOT_NEEDED" = xyes; then
|
||||
if test "x$with_freetype" != x || test "x$with_freetype_include" != x || test "x$with_freetype_lib" != x; then
|
||||
AC_MSG_WARN([freetype not used, so --with-freetype is ignored])
|
||||
fi
|
||||
FREETYPE2_CFLAGS=
|
||||
FREETYPE2_LIBS=
|
||||
FREETYPE2_LIB_PATH=
|
||||
else
|
||||
FREETYPE2_FOUND=no
|
||||
|
||||
if test "x$with_freetype" != x; then
|
||||
SPACESAFE(with_freetype,[the path to freetype])
|
||||
FREETYPE2_LIBS="-L$with_freetype/lib -lfreetype"
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
FREETYPE2_LIBS="$with_freetype/lib/freetype.lib"
|
||||
fi
|
||||
FREETYPE2_LIB_PATH="$with_freetype/lib"
|
||||
FREETYPE2_CFLAGS="-I$with_freetype/include"
|
||||
if test -s $with_freetype/include/ft2build.h && test -d $with_freetype/include/freetype2/freetype; then
|
||||
FREETYPE2_CFLAGS="-I$with_freetype/include/freetype2 -I$with_freetype/include"
|
||||
fi
|
||||
FREETYPE2_FOUND=yes
|
||||
if test "x$FREETYPE2_FOUND" = xyes; then
|
||||
# Verify that the directories exist
|
||||
if ! test -d "$with_freetype/lib" || ! test -d "$with_freetype/include"; then
|
||||
AC_MSG_ERROR([Could not find the expected directories $with_freetype/lib and $with_freetype/include])
|
||||
fi
|
||||
# List the contents of the lib.
|
||||
FREETYPELIB=`ls $with_freetype/lib/libfreetype.so $with_freetype/lib/freetype.dll 2> /dev/null`
|
||||
if test "x$FREETYPELIB" = x; then
|
||||
AC_MSG_ERROR([Could not find libfreetype.se nor freetype.dll in $with_freetype/lib])
|
||||
fi
|
||||
# Check one h-file
|
||||
if ! test -s "$with_freetype/include/ft2build.h"; then
|
||||
AC_MSG_ERROR([Could not find $with_freetype/include/ft2build.h])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x$FREETYPE2_FOUND" = xno; then
|
||||
BDEPS_CHECK_MODULE(FREETYPE2, freetype2, xxx, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
|
||||
USING_SYSTEM_FT_LIB=true
|
||||
fi
|
||||
if test "x$FREETYPE2_FOUND" = xno; then
|
||||
PKG_CHECK_MODULES(FREETYPE2, freetype2, [FREETYPE2_FOUND=yes], [FREETYPE2_FOUND=no])
|
||||
USING_SYSTEM_FT_LIB=true
|
||||
fi
|
||||
if test "x$FREETYPE2_FOUND" = xno; then
|
||||
AC_MSG_CHECKING([for freetype in some standard locations])
|
||||
|
||||
if test -s /usr/X11/include/ft2build.h && test -d /usr/X11/include/freetype2/freetype; then
|
||||
DEFAULT_FREETYPE_CFLAGS="-I/usr/X11/include/freetype2 -I/usr/X11/include"
|
||||
DEFAULT_FREETYPE_LIBS="-L/usr/X11/lib -lfreetype"
|
||||
fi
|
||||
if test -s /usr/include/ft2build.h && test -d /usr/include/freetype2/freetype; then
|
||||
DEFAULT_FREETYPE_CFLAGS="-I/usr/include/freetype2"
|
||||
DEFAULT_FREETYPE_LIBS="-lfreetype"
|
||||
fi
|
||||
|
||||
PREV_CXXCFLAGS="$CXXFLAGS"
|
||||
PREV_LDFLAGS="$LDFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS $DEFAULT_FREETYPE_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $DEFAULT_FREETYPE_LIBS"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[#include<ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
int main() { return 0; }
|
||||
]])],
|
||||
[
|
||||
# Yes, the default cflags and libs did the trick.
|
||||
FREETYPE2_FOUND=yes
|
||||
FREETYPE2_CFLAGS="$DEFAULT_FREETYPE_CFLAGS"
|
||||
FREETYPE2_LIBS="$DEFAULT_FREETYPE_LIBS"
|
||||
],
|
||||
[
|
||||
FREETYPE2_FOUND=no
|
||||
])
|
||||
CXXCFLAGS="$PREV_CXXFLAGS"
|
||||
LDFLAGS="$PREV_LDFLAGS"
|
||||
AC_MSG_RESULT([$FREETYPE2_FOUND])
|
||||
USING_SYSTEM_FT_LIB=true
|
||||
fi
|
||||
if test "x$FREETYPE2_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([freetype2])
|
||||
AC_MSG_ERROR([Could not find freetype2! $HELP_MSG ])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(USING_SYSTEM_FT_LIB)
|
||||
AC_SUBST(FREETYPE2_LIB_PATH)
|
||||
AC_SUBST(FREETYPE2_CFLAGS)
|
||||
AC_SUBST(FREETYPE2_LIBS)
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_ALSA],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for alsa headers and libraries. Used on Linux/GNU systems.
|
||||
#
|
||||
AC_ARG_WITH(alsa, [AS_HELP_STRING([--with-alsa],
|
||||
[specify prefix directory for the alsa package
|
||||
(expecting the libraries under PATH/lib and the headers under PATH/include)])])
|
||||
AC_ARG_WITH(alsa-include, [AS_HELP_STRING([--with-alsa-include],
|
||||
[specify directory for the alsa include files])])
|
||||
AC_ARG_WITH(alsa-lib, [AS_HELP_STRING([--with-alsa-lib],
|
||||
[specify directory for the alsa library])])
|
||||
|
||||
if test "x$ALSA_NOT_NEEDED" = xyes; then
|
||||
if test "x${with_alsa}" != x || test "x${with_alsa_include}" != x || test "x${with_alsa_lib}" != x; then
|
||||
AC_MSG_WARN([alsa not used, so --with-alsa is ignored])
|
||||
fi
|
||||
ALSA_CFLAGS=
|
||||
ALSA_LIBS=
|
||||
else
|
||||
ALSA_FOUND=no
|
||||
|
||||
if test "x${with_alsa}" = xno || test "x${with_alsa_include}" = xno || test "x${with_alsa_lib}" = xno; then
|
||||
AC_MSG_ERROR([It is not possible to disable the use of alsa. Remove the --without-alsa option.])
|
||||
fi
|
||||
|
||||
if test "x${with_alsa}" != x; then
|
||||
ALSA_LIBS="-L${with_alsa}/lib -lalsa"
|
||||
ALSA_CFLAGS="-I${with_alsa}/include"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
if test "x${with_alsa_include}" != x; then
|
||||
ALSA_CFLAGS="-I${with_alsa_include}"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
if test "x${with_alsa_lib}" != x; then
|
||||
ALSA_LIBS="-L${with_alsa_lib} -lalsa"
|
||||
ALSA_FOUND=yes
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
BDEPS_CHECK_MODULE(ALSA, alsa, xxx, [ALSA_FOUND=yes], [ALSA_FOUND=no])
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
PKG_CHECK_MODULES(ALSA, alsa, [ALSA_FOUND=yes], [ALSA_FOUND=no])
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
AC_CHECK_HEADERS([alsa/asoundlib.h],
|
||||
[ALSA_FOUND=yes
|
||||
ALSA_CFLAGS=-Iignoreme
|
||||
ALSA_LIBS=-lasound
|
||||
DEFAULT_ALSA=yes],
|
||||
[ALSA_FOUND=no])
|
||||
fi
|
||||
if test "x$ALSA_FOUND" = xno; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([alsa])
|
||||
AC_MSG_ERROR([Could not find alsa! $HELP_MSG ])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(ALSA_CFLAGS)
|
||||
AC_SUBST(ALSA_LIBS)
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_MISC_LIBS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for the jpeg library
|
||||
#
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
AC_CHECK_LIB(jpeg, main, [],
|
||||
[ USE_EXTERNAL_LIBJPEG=false
|
||||
AC_MSG_NOTICE([Will use jpeg decoder bundled with the OpenJDK source])
|
||||
])
|
||||
AC_SUBST(USE_EXTERNAL_LIBJPEG)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for the gif library
|
||||
#
|
||||
|
||||
USE_EXTERNAL_LIBJPEG=true
|
||||
AC_CHECK_LIB(gif, main, [],
|
||||
[ USE_EXTERNAL_LIBGIF=false
|
||||
AC_MSG_NOTICE([Will use gif decoder bundled with the OpenJDK source])
|
||||
])
|
||||
AC_SUBST(USE_EXTERNAL_LIBGIF)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for the zlib library
|
||||
#
|
||||
|
||||
AC_ARG_WITH(zlib, [AS_HELP_STRING([--with-zlib],
|
||||
[use zlib from build system or OpenJDK source (system, bundled) @<:@bundled@:>@])])
|
||||
|
||||
AC_CHECK_LIB(z, compress,
|
||||
[ ZLIB_FOUND=yes ],
|
||||
[ ZLIB_FOUND=no ])
|
||||
|
||||
AC_MSG_CHECKING([for which zlib to use])
|
||||
|
||||
DEFAULT_ZLIB=bundled
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
#
|
||||
# On macosx default is system...on others default is
|
||||
#
|
||||
DEFAULT_ZLIB=system
|
||||
fi
|
||||
|
||||
if test "x${ZLIB_FOUND}" != "xyes"; then
|
||||
#
|
||||
# If we don't find any system...set default to bundled
|
||||
#
|
||||
DEFAULT_ZLIB=bundled
|
||||
fi
|
||||
|
||||
#
|
||||
# If user didn't specify, use DEFAULT_ZLIB
|
||||
#
|
||||
if test "x${with_zlib}" = "x"; then
|
||||
with_zlib=${DEFAULT_ZLIB}
|
||||
fi
|
||||
|
||||
if test "x${with_zlib}" = "xbundled"; then
|
||||
USE_EXTERNAL_LIBZ=false
|
||||
AC_MSG_RESULT([bundled])
|
||||
elif test "x${with_zlib}" = "xsystem"; then
|
||||
if test "x${ZLIB_FOUND}" = "xyes"; then
|
||||
USE_EXTERNAL_LIBZ=true
|
||||
AC_MSG_RESULT([system])
|
||||
else
|
||||
AC_MSG_RESULT([system not found])
|
||||
AC_MSG_ERROR([--with-zlib=system specified, but no zlib found!])
|
||||
fi
|
||||
else
|
||||
AC_MSG_ERROR([Invalid value for --with-zlib: ${with_zlib}, use 'system' or 'bundled'])
|
||||
fi
|
||||
|
||||
AC_SUBST(USE_EXTERNAL_LIBZ)
|
||||
|
||||
###############################################################################
|
||||
LIBZIP_CAN_USE_MMAP=true
|
||||
if test "x$JDK_VARIANT" = "xembedded"; then
|
||||
LIBZIP_CAN_USE_MMAP=false
|
||||
fi
|
||||
AC_SUBST(LIBZIP_CAN_USE_MMAP)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check if altzone exists in time.h
|
||||
#
|
||||
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [return (int)altzone;])],
|
||||
[has_altzone=yes],
|
||||
[has_altzone=no])
|
||||
if test "x$has_altzone" = xyes; then
|
||||
AC_DEFINE([HAVE_ALTZONE], 1, [Define if you have the external 'altzone' variable in time.h])
|
||||
fi
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check the maths library
|
||||
#
|
||||
|
||||
AC_CHECK_LIB(m, cos, [],
|
||||
[
|
||||
AC_MSG_NOTICE([Maths library was not found])
|
||||
])
|
||||
AC_SUBST(LIBM)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check for libdl.so
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
LIBS=""
|
||||
AC_CHECK_LIB(dl,dlopen)
|
||||
LIBDL="$LIBS"
|
||||
AC_SUBST(LIBDL)
|
||||
LIBS="$save_LIBS"
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([LIB_SETUP_STATIC_LINK_LIBSTDCPP],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# statically link libstdc++ before C++ ABI is stablized on Linux unless
|
||||
# dynamic build is configured on command line.
|
||||
#
|
||||
AC_ARG_ENABLE([static-link-stdc++], [AS_HELP_STRING([--disable-static-link-stdc++],
|
||||
[disable static linking of the C++ runtime on Linux @<:@enabled@:>@])],,
|
||||
[
|
||||
enable_static_link_stdc__=yes
|
||||
])
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
# Test if -lstdc++ works.
|
||||
AC_MSG_CHECKING([if dynamic link of stdc++ is possible])
|
||||
AC_LANG_PUSH(C++)
|
||||
OLD_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -lstdc++"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
|
||||
[has_dynamic_libstdcxx=yes],
|
||||
[has_dynamic_libstdcxx=no])
|
||||
CXXFLAGS="$OLD_CXXFLAGS"
|
||||
AC_LANG_POP(C++)
|
||||
AC_MSG_RESULT([$has_dynamic_libstdcxx])
|
||||
|
||||
# Test if stdc++ can be linked statically.
|
||||
AC_MSG_CHECKING([if static link of stdc++ is possible])
|
||||
STATIC_STDCXX_FLAGS="-Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic"
|
||||
AC_LANG_PUSH(C++)
|
||||
OLD_LIBS="$LIBS"
|
||||
OLD_CXX="$CXX"
|
||||
LIBS="$STATIC_STDCXX_FLAGS"
|
||||
CXX="$CC"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [return 0;])],
|
||||
[has_static_libstdcxx=yes],
|
||||
[has_static_libstdcxx=no])
|
||||
LIBS="$OLD_LIBS"
|
||||
CXX="$OLD_CXX"
|
||||
AC_LANG_POP(C++)
|
||||
AC_MSG_RESULT([$has_static_libstdcxx])
|
||||
|
||||
if test "x$has_static_libcxx" = xno && test "x$has_dynamic_libcxx" = xno; then
|
||||
AC_MSG_ERROR([I cannot link to stdc++! Neither dynamically nor statically.])
|
||||
fi
|
||||
|
||||
if test "x$enable_static_link_stdc__" = xyes && test "x$has_static_libstdcxx" = xno; then
|
||||
AC_MSG_NOTICE([Static linking of libstdc++ was not possible reverting to dynamic linking.])
|
||||
enable_static_link_stdc__=no
|
||||
fi
|
||||
|
||||
if test "x$enable_static_link_stdc__" = xno && test "x$has_dynamic_libstdcxx" = xno; then
|
||||
AC_MSG_NOTICE([Dynamic linking of libstdc++ was not possible reverting to static linking.])
|
||||
enable_static_link_stdc__=yes
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([how to link with libstdc++])
|
||||
if test "x$enable_static_link_stdc__" = xyes; then
|
||||
LIBCXX="$LIBCXX $STATIC_STDCXX_FLAGS"
|
||||
LDCXX="$CC"
|
||||
AC_MSG_RESULT([static])
|
||||
else
|
||||
LIBCXX="$LIBCXX -lstdc++"
|
||||
LDCXX="$CXX"
|
||||
AC_MSG_RESULT([dynamic])
|
||||
fi
|
||||
fi
|
||||
|
||||
# libCrun is the c++ runtime-library with SunStudio (roughly the equivalent of gcc's libstdc++.so)
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris && test "x$LIBCXX" = x; then
|
||||
LIBCXX="/usr/lib${LEGACY_OPENJDK_TARGET_CPU3}/libCrun.so.1"
|
||||
fi
|
||||
|
||||
# TODO better (platform agnostic) test
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$LIBCXX" = x && test "x$GCC" = xyes; then
|
||||
LIBCXX="-lstdc++"
|
||||
fi
|
||||
|
||||
AC_SUBST(LIBCXX)
|
||||
|
||||
])
|
@ -23,272 +23,59 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([CHECK_FIND_DELETE],
|
||||
[
|
||||
# Test if find supports -delete
|
||||
AC_MSG_CHECKING([if find supports -delete])
|
||||
FIND_DELETE="-delete"
|
||||
|
||||
DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
|
||||
|
||||
echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
|
||||
|
||||
TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
|
||||
if test -f $DELETEDIR/TestIfFindSupportsDelete; then
|
||||
# No, it does not.
|
||||
rm $DELETEDIR/TestIfFindSupportsDelete
|
||||
FIND_DELETE="-exec rm \{\} \+"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
rmdir $DELETEDIR
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_NONEMPTY],
|
||||
[
|
||||
# Test that variable $1 is not empty.
|
||||
if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
|
||||
])
|
||||
|
||||
AC_DEFUN([ADD_JVM_ARG_IF_OK],
|
||||
[
|
||||
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
|
||||
# If so, then append $1 to $2
|
||||
FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
|
||||
FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`
|
||||
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
|
||||
$2="[$]$2 $1"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD],
|
||||
[
|
||||
# Translate "gcc -E" into "`which gcc` -E" ie
|
||||
# extract the full path to the binary and at the
|
||||
# same time maintain any arguments passed to it.
|
||||
# The command MUST exist in the path, or else!
|
||||
tmp="[$]$1"
|
||||
car="${tmp%% *}"
|
||||
tmp="[$]$1 EOL"
|
||||
cdr="${tmp#* }"
|
||||
# On windows we want paths without spaces.
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
WHICHCMD_SPACESAFE(car)
|
||||
else
|
||||
# "which" is not portable, but is used here
|
||||
# because we know that the command exists!
|
||||
car=`which $car`
|
||||
fi
|
||||
if test "x$cdr" != xEOL; then
|
||||
$1="$car ${cdr% *}"
|
||||
else
|
||||
$1="$car"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SPACESAFE],
|
||||
[
|
||||
# Fail with message $2 if var $1 contains a path with no spaces in it.
|
||||
# Unless on Windows, where we can rewrite the path.
|
||||
HAS_SPACE=`echo "[$]$1" | grep " "`
|
||||
if test "x$HAS_SPACE" != x; then
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
$1=`$CYGPATH -s -m -a "[$]$1"`
|
||||
$1=`$CYGPATH -u "[$]$1"`
|
||||
else
|
||||
AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD_SPACESAFE],
|
||||
[
|
||||
# Translate long cygdrive or C:\sdfsf path
|
||||
# into a short mixed mode path that has no
|
||||
# spaces in it.
|
||||
tmp="[$]$1"
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
tmp=`$CYGPATH -u "[$]$1"`
|
||||
tmp=`which "$tmp"`
|
||||
# If file exists with .exe appended, that's the real filename
|
||||
# and cygpath needs that to convert to short style path.
|
||||
if test -f "${tmp}.exe"; then
|
||||
tmp="${tmp}.exe"
|
||||
elif test -f "${tmp}.cmd"; then
|
||||
tmp="${tmp}.cmd"
|
||||
fi
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
fi
|
||||
$1="$tmp"
|
||||
])
|
||||
|
||||
AC_DEFUN([REMOVE_SYMBOLIC_LINKS],
|
||||
[
|
||||
if test "x$BUILD_OS" != xwindows; then
|
||||
# Follow a chain of symbolic links. Use readlink
|
||||
# where it exists, else fall back to horribly
|
||||
# complicated shell code.
|
||||
AC_PATH_PROG(READLINK, readlink)
|
||||
if test "x$READLINK_TESTED" != yes; then
|
||||
# On MacOSX there is a readlink tool with a different
|
||||
# purpose than the GNU readlink tool. Check the found readlink.
|
||||
ISGNU=`$READLINK --help 2>&1 | grep GNU`
|
||||
if test "x$ISGNU" = x; then
|
||||
# A readlink that we do not know how to use.
|
||||
# Are there other non-GNU readlinks out there?
|
||||
READLINK_TESTED=yes
|
||||
READLINK=
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$READLINK" != x; then
|
||||
$1=`$READLINK -f [$]$1`
|
||||
else
|
||||
STARTDIR=$PWD
|
||||
COUNTER=0
|
||||
DIR=`dirname [$]$1`
|
||||
FIL=`basename [$]$1`
|
||||
while test $COUNTER -lt 20; do
|
||||
ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'`
|
||||
if test "x$ISLINK" == x; then
|
||||
# This is not a symbolic link! We are done!
|
||||
break
|
||||
fi
|
||||
# The link might be relative! We have to use cd to travel safely.
|
||||
cd $DIR
|
||||
cd `dirname $ISLINK`
|
||||
DIR=`pwd`
|
||||
FIL=`basename $ISLINK`
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
cd $STARTDIR
|
||||
$1=$DIR/$FIL
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([TESTFOR_PROG_CCACHE],
|
||||
[
|
||||
AC_ARG_ENABLE([ccache],
|
||||
[AS_HELP_STRING([--disable-ccache],
|
||||
[use ccache to speed up recompilations @<:@enabled@:>@])],
|
||||
[ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes])
|
||||
if test "x$ENABLE_CCACHE" = xyes; then
|
||||
AC_PATH_PROG(CCACHE, ccache)
|
||||
else
|
||||
AC_MSG_CHECKING([for ccache])
|
||||
AC_MSG_RESULT([explicitly disabled])
|
||||
CCACHE=
|
||||
fi
|
||||
AC_SUBST(CCACHE)
|
||||
|
||||
AC_ARG_WITH([ccache-dir],
|
||||
[AS_HELP_STRING([--with-ccache-dir],
|
||||
[where to store ccache files @<:@~/.ccache@:>@])])
|
||||
|
||||
if test "x$with_ccache_dir" != x; then
|
||||
# When using a non home ccache directory, assume the use is to share ccache files
|
||||
# with other users. Thus change the umask.
|
||||
SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002"
|
||||
fi
|
||||
CCACHE_FOUND=""
|
||||
if test "x$CCACHE" != x; then
|
||||
SETUP_CCACHE_USAGE
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SETUP_CCACHE_USAGE],
|
||||
[
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_FOUND="true"
|
||||
# Only use ccache if it is 3.1.4 or later, which supports
|
||||
# precompiled headers.
|
||||
AC_MSG_CHECKING([if ccache supports precompiled headers])
|
||||
HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null`
|
||||
if test "x$HAS_GOOD_CCACHE" = x; then
|
||||
AC_MSG_RESULT([no, disabling ccache])
|
||||
CCACHE=
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
|
||||
PUSHED_FLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="-fpch-preprocess $CXXFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
|
||||
CXXFLAGS="$PUSHED_FLAGS"
|
||||
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
|
||||
CCACHE=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_SLOPPINESS=time_macros
|
||||
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
|
||||
CCACHE_FLAGS=-fpch-preprocess
|
||||
|
||||
if test "x$SET_CCACHE_DIR" != x; then
|
||||
mkdir -p $CCACHE_DIR > /dev/null 2>&1
|
||||
chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS],
|
||||
[
|
||||
# Expects $host_os $host_cpu $build_os and $build_cpu
|
||||
# and $with_data_model to have been setup!
|
||||
# and $with_target_bits to have been setup!
|
||||
#
|
||||
# Translate the standard triplet(quadruplet) definition
|
||||
# of the host/build system into
|
||||
# HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows
|
||||
# HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince
|
||||
# HOST_OS_API=posix,winapi
|
||||
# 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
|
||||
#
|
||||
# HOST_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
|
||||
# HOST_CPU_ARCH=x86,sparc,pcc,arm
|
||||
# HOST_CPU_BITS=32,64
|
||||
# HOST_CPU_ENDIAN=big,little
|
||||
# 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_HOST_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris)
|
||||
# LEGACY_HOST_OS_API=solaris,windows
|
||||
# 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 HOST and BUILD
|
||||
AC_SUBST(HOST, ${host})
|
||||
AC_SUBST(BUILD, ${build})
|
||||
# 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)
|
||||
|
||||
EXTRACT_VARS_FROM_OS_TO(HOST,$host_os)
|
||||
EXTRACT_VARS_FROM_CPU_TO(HOST,$host_cpu)
|
||||
PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_TARGET,$host_os)
|
||||
PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_TARGET,$host_cpu)
|
||||
|
||||
EXTRACT_VARS_FROM_OS_TO(BUILD,$build_os)
|
||||
EXTRACT_VARS_FROM_CPU_TO(BUILD,$build_cpu)
|
||||
PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_BUILD,$build_os)
|
||||
PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_BUILD,$build_cpu)
|
||||
|
||||
if test "x$HOST_OS" != xsolaris; then
|
||||
LEGACY_HOST_CPU3=""
|
||||
LEGACY_BUILD_CPU3=""
|
||||
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_HOST_CPU1) ...
|
||||
if test "x$HOST_OS" = xmacosx && test "x$HOST_CPU" = xx64; then
|
||||
LEGACY_HOST_CPU1="x86_64"
|
||||
# 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
|
||||
|
||||
SET_RELEASE_FILE_OS_VALUES()
|
||||
PLATFORM_SET_RELEASE_FILE_OS_VALUES
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS_TO],
|
||||
[
|
||||
EXTRACT_VARS_FROM_OS($2)
|
||||
PLATFORM_EXTRACT_VARS_FROM_OS($2)
|
||||
$1_OS="$VAR_OS"
|
||||
$1_OS_FAMILY="$VAR_OS_FAMILY"
|
||||
$1_OS_API="$VAR_OS_API"
|
||||
@ -306,9 +93,9 @@ AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
|
||||
AC_SUBST(LEGACY_$1_OS_API)
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_CPU_TO],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU_TO],
|
||||
[
|
||||
EXTRACT_VARS_FROM_CPU($2)
|
||||
PLATFORM_EXTRACT_VARS_FROM_CPU($2)
|
||||
$1_CPU="$VAR_CPU"
|
||||
$1_CPU_ARCH="$VAR_CPU_ARCH"
|
||||
$1_CPU_BITS="$VAR_CPU_BITS"
|
||||
@ -339,12 +126,12 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU_TO],
|
||||
LEGACY_$1_CPU3=amd64
|
||||
fi
|
||||
if test "x$$1_CPU" = xsparcv9; then
|
||||
LEGACY_$1_CPU3=sparvc9
|
||||
LEGACY_$1_CPU3=sparcv9
|
||||
fi
|
||||
AC_SUBST(LEGACY_$1_CPU3)
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
||||
[
|
||||
# First argument is the cpu name from the trip/quad
|
||||
case "$1" in
|
||||
@ -372,8 +159,8 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
arm*)
|
||||
VAR_CPU=arm
|
||||
VAR_CPU_ARCH=arm
|
||||
VAR_CPU_BITS=3264
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=little
|
||||
VAR_LEGACY_CPU=arm
|
||||
;;
|
||||
mips)
|
||||
@ -401,7 +188,7 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU=ppc64
|
||||
VAR_CPU_ARCH=ppc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=32
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=ppc64
|
||||
;;
|
||||
sparc)
|
||||
@ -416,7 +203,7 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU_ARCH=sparc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=sparc_sparcv9
|
||||
VAR_LEGACY_CPU=sparcv9
|
||||
;;
|
||||
s390)
|
||||
VAR_CPU=s390
|
||||
@ -452,21 +239,37 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
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_data_model" = "x64"; 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_data_model" = "x32"; then
|
||||
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
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_OS],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
|
||||
[
|
||||
case "$1" in
|
||||
*linux*)
|
||||
@ -495,49 +298,26 @@ AC_DEFUN([EXTRACT_VARS_FROM_OS],
|
||||
VAR_OS_FAMILY=windows
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([unsupported host operating system $1])
|
||||
AC_MSG_ERROR([unsupported operating system $1])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_COMPILER_VERSION],
|
||||
AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
|
||||
[
|
||||
# Test the compilers that their versions are new enough.
|
||||
# AC_MSG_CHECKING([version of GCC])
|
||||
gcc_ver=`${CC} -dumpversion`
|
||||
gcc_major_ver=`echo ${gcc_ver}|cut -d'.' -f1`
|
||||
gcc_minor_ver=`echo ${gcc_ver}|cut -d'.' -f2`
|
||||
# AM_CONDITIONAL(GCC_OLD, test ! ${gcc_major_ver} -ge 4 -a ${gcc_minor_ver} -ge 3)
|
||||
# AC_MSG_RESULT([${gcc_ver} (major version ${gcc_major_ver}, minor version ${gcc_minor_ver})])
|
||||
])
|
||||
|
||||
# Fixes paths on windows hosts to be mixed mode short.
|
||||
AC_DEFUN([WIN_FIX_PATH],
|
||||
[
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
AC_PATH_PROG(CYGPATH, cygpath)
|
||||
tmp="[$]$1"
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
$1="$tmp"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SET_RELEASE_FILE_OS_VALUES],
|
||||
[
|
||||
if test "x$HOST_OS" = "xsolaris"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
REQUIRED_OS_NAME=SunOS
|
||||
REQUIRED_OS_VERSION=5.10
|
||||
fi
|
||||
if test "x$HOST_OS" = "xlinux"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
REQUIRED_OS_NAME=Linux
|
||||
REQUIRED_OS_VERSION=2.6
|
||||
fi
|
||||
if test "x$HOST_OS" = "xwindows"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
REQUIRED_OS_NAME=Windows
|
||||
REQUIRED_OS_VERSION=5.1
|
||||
fi
|
||||
if test "x$HOST_OS" = "xmacosx"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||
REQUIRED_OS_NAME=Darwin
|
||||
REQUIRED_OS_VERSION=11.2
|
||||
fi
|
||||
@ -545,3 +325,174 @@ AC_DEFUN([SET_RELEASE_FILE_OS_VALUES],
|
||||
AC_SUBST(REQUIRED_OS_NAME)
|
||||
AC_SUBST(REQUIRED_OS_VERSION)
|
||||
])
|
||||
|
||||
#%%% Build and target systems %%%
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
|
||||
[
|
||||
# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
|
||||
# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the
|
||||
# product you're building. The target of this build is called "host". Since this is confusing to most people, we
|
||||
# have not adopted that system, but use "target" as the platform we are building for. In some places though we need
|
||||
# to use the configure naming style.
|
||||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
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@:>@])])
|
||||
|
||||
if test "x$with_target_bits" != x && \
|
||||
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],
|
||||
[
|
||||
###############################################################################
|
||||
|
||||
# Note that this is the build platform OS version!
|
||||
|
||||
OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
|
||||
OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
|
||||
OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
|
||||
OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
|
||||
AC_SUBST(OS_VERSION_MAJOR)
|
||||
AC_SUBST(OS_VERSION_MINOR)
|
||||
AC_SUBST(OS_VERSION_MICRO)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_TEST_OPENJDK_TARGET_BITS],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code.
|
||||
# (The JVM can use 32 or 64 bit Java pointers but that decision
|
||||
# is made at runtime.)
|
||||
#
|
||||
AC_LANG_PUSH(C++)
|
||||
OLD_CXXFLAGS="$CXXFLAGS"
|
||||
if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then
|
||||
CXXFLAGS="-m${with_target_bits} $CXXFLAGS"
|
||||
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
|
||||
ADDED_CFLAGS=" -m${with_target_bits}"
|
||||
ADDED_CXXFLAGS=" -m${with_target_bits}"
|
||||
ADDED_LDFLAGS=" -m${with_target_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}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$ARCH_DATA_MODEL" = x64; then
|
||||
A_LP64="LP64:="
|
||||
ADD_LP64="-D_LP64=1"
|
||||
fi
|
||||
AC_MSG_CHECKING([for target address size])
|
||||
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
|
||||
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)])
|
||||
fi
|
||||
|
||||
#
|
||||
# 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
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Is the target little of big endian?
|
||||
#
|
||||
AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"])
|
||||
|
||||
if test "x$ENDIAN" = xuniversal_endianness; then
|
||||
AC_MSG_ERROR([Building with both big and little endianness is not supported])
|
||||
fi
|
||||
if test "x$ENDIAN" = xunknown; then
|
||||
ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN"
|
||||
fi
|
||||
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)])
|
||||
ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN"
|
||||
fi
|
||||
AC_SUBST(ENDIAN)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ISADIR],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Could someone enlighten this configure script with a comment about libCrun?
|
||||
#
|
||||
#
|
||||
])
|
||||
|
280
common/autoconf/source-dirs.m4
Normal file
280
common/autoconf/source-dirs.m4
Normal file
@ -0,0 +1,280 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([SRCDIRS_SETUP_TOPDIRS],
|
||||
[
|
||||
|
||||
# Where are the sources. Any of these can be overridden
|
||||
# using --with-override-corba and the likes.
|
||||
LANGTOOLS_TOPDIR="$SRC_ROOT/langtools"
|
||||
CORBA_TOPDIR="$SRC_ROOT/corba"
|
||||
JAXP_TOPDIR="$SRC_ROOT/jaxp"
|
||||
JAXWS_TOPDIR="$SRC_ROOT/jaxws"
|
||||
HOTSPOT_TOPDIR="$SRC_ROOT/hotspot"
|
||||
JDK_TOPDIR="$SRC_ROOT/jdk"
|
||||
AC_SUBST(LANGTOOLS_TOPDIR)
|
||||
AC_SUBST(CORBA_TOPDIR)
|
||||
AC_SUBST(JAXP_TOPDIR)
|
||||
AC_SUBST(JAXWS_TOPDIR)
|
||||
AC_SUBST(HOTSPOT_TOPDIR)
|
||||
AC_SUBST(JDK_TOPDIR)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Pickup additional source for a component from outside of the source root
|
||||
# or override source for a component.
|
||||
#
|
||||
AC_ARG_WITH(add-source-root, [AS_HELP_STRING([--with-add-source-root],
|
||||
[for each and every source directory, look in this additional source root for
|
||||
the same directory; if it exists and have files in it, include it in the build])])
|
||||
|
||||
AC_ARG_WITH(override-source-root, [AS_HELP_STRING([--with-override-source-root],
|
||||
[for each and every source directory, look in this override source root for
|
||||
the same directory; if it exists, use that directory instead and
|
||||
ignore the directory in the original source root])])
|
||||
|
||||
AC_ARG_WITH(adds-and-overrides, [AS_HELP_STRING([--with-adds-and-overrides],
|
||||
[use the subdirs 'adds' and 'overrides' in the specified directory as
|
||||
add-source-root and override-source-root])])
|
||||
|
||||
if test "x$with_adds_and_overrides" != x; then
|
||||
with_add_source_root="$with_adds_and_overrides/adds"
|
||||
with_override_source_root="$with_adds_and_overrides/overrides"
|
||||
fi
|
||||
|
||||
if test "x$with_add_source_root" != x; then
|
||||
if ! test -d $with_add_source_root; then
|
||||
AC_MSG_ERROR([Trying to use a non-existant add-source-root $with_add_source_root])
|
||||
fi
|
||||
CURDIR="$PWD"
|
||||
cd "$with_add_source_root"
|
||||
ADD_SRC_ROOT="`pwd`"
|
||||
cd "$CURDIR"
|
||||
# Verify that the addon source root does not have any root makefiles.
|
||||
# If it does, then it is usually an error, prevent this.
|
||||
if test -f $with_add_source_root/langtools/makefiles/Makefile || \
|
||||
test -f $with_add_source_root/langtools/make/Makefile; then
|
||||
AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.])
|
||||
fi
|
||||
if test -f $with_add_source_root/corba/makefiles/Makefile || \
|
||||
test -f $with_add_source_root/corba/make/Makefile; then
|
||||
AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.])
|
||||
fi
|
||||
if test -f $with_add_source_root/jaxp/makefiles/Makefile || \
|
||||
test -f $with_add_source_root/jaxp/make/Makefile; then
|
||||
AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.])
|
||||
fi
|
||||
if test -f $with_add_source_root/jaxws/makefiles/Makefile || \
|
||||
test -f $with_add_source_root/jaxws/make/Makefile; then
|
||||
AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.])
|
||||
fi
|
||||
if test -f $with_add_source_root/hotspot/makefiles/Makefile || \
|
||||
test -f $with_add_source_root/hotspot/make/Makefile; then
|
||||
AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.])
|
||||
fi
|
||||
if test -f $with_add_source_root/jdk/makefiles/Makefile || \
|
||||
test -f $with_add_source_root/jdk/make/Makefile; then
|
||||
AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(ADD_SRC_ROOT)
|
||||
|
||||
if test "x$with_override_source_root" != x; then
|
||||
if ! test -d $with_override_source_root; then
|
||||
AC_MSG_ERROR([Trying to use a non-existant override-source-root $with_override_source_root])
|
||||
fi
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_source_root"
|
||||
OVERRIDE_SRC_ROOT="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if test -f $with_override_source_root/langtools/makefiles/Makefile || \
|
||||
test -f $with_override_source_root/langtools/make/Makefile; then
|
||||
AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.])
|
||||
fi
|
||||
if test -f $with_override_source_root/corba/makefiles/Makefile || \
|
||||
test -f $with_override_source_root/corba/make/Makefile; then
|
||||
AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.])
|
||||
fi
|
||||
if test -f $with_override_source_root/jaxp/makefiles/Makefile || \
|
||||
test -f $with_override_source_root/jaxp/make/Makefile; then
|
||||
AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.])
|
||||
fi
|
||||
if test -f $with_override_source_root/jaxws/makefiles/Makefile || \
|
||||
test -f $with_override_source_root/jaxws/make/Makefile; then
|
||||
AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.])
|
||||
fi
|
||||
if test -f $with_override_source_root/hotspot/makefiles/Makefile || \
|
||||
test -f $with_override_source_root/hotspot/make/Makefile; then
|
||||
AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.])
|
||||
fi
|
||||
if test -f $with_override_source_root/jdk/makefiles/Makefile || \
|
||||
test -f $with_override_source_root/jdk/make/Makefile; then
|
||||
AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(OVERRIDE_SRC_ROOT)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Override a repo completely, this is used for example when you have 3 small
|
||||
# development sandboxes of the langtools sources and want to avoid having 3 full
|
||||
# OpenJDK sources checked out on disk.
|
||||
#
|
||||
# Assuming that the 3 langtools sandboxes are located here:
|
||||
# /home/fredrik/sandbox1/langtools
|
||||
# /home/fredrik/sandbox2/langtools
|
||||
# /home/fredrik/sandbox3/langtools
|
||||
#
|
||||
# From the source root you create build subdirs manually:
|
||||
# mkdir -p build1 build2 build3
|
||||
# in each build directory run:
|
||||
# (cd build1 && ../configure --with-override-langtools=/home/fredrik/sandbox1 && make)
|
||||
# (cd build2 && ../configure --with-override-langtools=/home/fredrik/sandbox2 && make)
|
||||
# (cd build3 && ../configure --with-override-langtools=/home/fredrik/sandbox3 && make)
|
||||
#
|
||||
|
||||
AC_ARG_WITH(override-langtools, [AS_HELP_STRING([--with-override-langtools],
|
||||
[use this langtools dir for the build])])
|
||||
|
||||
AC_ARG_WITH(override-corba, [AS_HELP_STRING([--with-override-corba],
|
||||
[use this corba dir for the build])])
|
||||
|
||||
AC_ARG_WITH(override-jaxp, [AS_HELP_STRING([--with-override-jaxp],
|
||||
[use this jaxp dir for the build])])
|
||||
|
||||
AC_ARG_WITH(override-jaxws, [AS_HELP_STRING([--with-override-jaxws],
|
||||
[use this jaxws dir for the build])])
|
||||
|
||||
AC_ARG_WITH(override-hotspot, [AS_HELP_STRING([--with-override-hotspot],
|
||||
[use this hotspot dir for the build])])
|
||||
|
||||
AC_ARG_WITH(override-jdk, [AS_HELP_STRING([--with-override-jdk],
|
||||
[use this jdk dir for the build])])
|
||||
|
||||
if test "x$with_override_langtools" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_langtools"
|
||||
LANGTOOLS_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then
|
||||
AC_MSG_ERROR([You have to override langtools with a full langtools repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if langtools should be overridden])
|
||||
AC_MSG_RESULT([yes with $LANGTOOLS_TOPDIR])
|
||||
fi
|
||||
if test "x$with_override_corba" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_corba"
|
||||
CORBA_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then
|
||||
AC_MSG_ERROR([You have to override corba with a full corba repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if corba should be overridden])
|
||||
AC_MSG_RESULT([yes with $CORBA_TOPDIR])
|
||||
fi
|
||||
if test "x$with_override_jaxp" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_jaxp"
|
||||
JAXP_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then
|
||||
AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if jaxp should be overridden])
|
||||
AC_MSG_RESULT([yes with $JAXP_TOPDIR])
|
||||
fi
|
||||
if test "x$with_override_jaxws" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_jaxws"
|
||||
JAXWS_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then
|
||||
AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if jaxws should be overridden])
|
||||
AC_MSG_RESULT([yes with $JAXWS_TOPDIR])
|
||||
fi
|
||||
if test "x$with_override_hotspot" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_hotspot"
|
||||
HOTSPOT_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \
|
||||
! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then
|
||||
AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if hotspot should be overridden])
|
||||
AC_MSG_RESULT([yes with $HOTSPOT_TOPDIR])
|
||||
fi
|
||||
if test "x$with_override_jdk" != x; then
|
||||
CURDIR="$PWD"
|
||||
cd "$with_override_jdk"
|
||||
JDK_TOPDIR="`pwd`"
|
||||
cd "$CURDIR"
|
||||
if ! test -f $JDK_TOPDIR/makefiles/Makefile; then
|
||||
AC_MSG_ERROR([You have to override JDK with a full JDK repo!])
|
||||
fi
|
||||
AC_MSG_CHECKING([if JDK should be overridden])
|
||||
AC_MSG_RESULT([yes with $JDK_TOPDIR])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([SRCDIRS_SETUP_OUTPUT_DIRS],
|
||||
[
|
||||
LANGTOOLS_OUTPUTDIR="$OUTPUT_ROOT/langtools"
|
||||
CORBA_OUTPUTDIR="$OUTPUT_ROOT/corba"
|
||||
JAXP_OUTPUTDIR="$OUTPUT_ROOT/jaxp"
|
||||
JAXWS_OUTPUTDIR="$OUTPUT_ROOT/jaxws"
|
||||
HOTSPOT_OUTPUTDIR="$OUTPUT_ROOT/hotspot"
|
||||
JDK_OUTPUTDIR="$OUTPUT_ROOT/jdk"
|
||||
IMAGES_OUTPUTDIR="$OUTPUT_ROOT/images"
|
||||
|
||||
AC_SUBST(LANGTOOLS_OUTPUTDIR)
|
||||
AC_SUBST(CORBA_OUTPUTDIR)
|
||||
AC_SUBST(JAXP_OUTPUTDIR)
|
||||
AC_SUBST(JAXWS_OUTPUTDIR)
|
||||
AC_SUBST(HOTSPOT_OUTPUTDIR)
|
||||
AC_SUBST(JDK_OUTPUTDIR)
|
||||
AC_SUBST(IMAGES_OUTPUTDIR)
|
||||
|
||||
LANGTOOLS_DIST="$OUTPUT_ROOT/langtools/dist"
|
||||
CORBA_DIST="$OUTPUT_ROOT/corba/dist"
|
||||
JAXP_DIST="$OUTPUT_ROOT/jaxp/dist"
|
||||
JAXWS_DIST="$OUTPUT_ROOT/jaxws/dist"
|
||||
HOTSPOT_DIST="$OUTPUT_ROOT/hotspot/dist"
|
||||
|
||||
AC_SUBST(LANGTOOLS_DIST)
|
||||
AC_SUBST(CORBA_DIST)
|
||||
AC_SUBST(JAXP_DIST)
|
||||
AC_SUBST(JAXWS_DIST)
|
||||
AC_SUBST(HOTSPOT_DIST)
|
||||
])
|
@ -23,8 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Configured @DATE_WHEN_CONFIGURED@ to build for a @HOST@ system,
|
||||
# using ./configure @CONFIGURE_COMMAND_LINE@
|
||||
# Configured @DATE_WHEN_CONFIGURED@ to build for a @OPENJDK_TARGET_SYSTEM@ system,
|
||||
# using 'configure @CONFIGURE_COMMAND_LINE@'
|
||||
|
||||
# When calling macros, the spaces between arguments are
|
||||
# often semantically important! Sometimes we need to subst
|
||||
@ -67,48 +67,50 @@ SPEC:=@SPEC@
|
||||
# The "human readable" name of this configuration
|
||||
CONF_NAME:=@CONF_NAME@
|
||||
|
||||
# The built jdk will run in this host system.
|
||||
HOST:=@HOST@
|
||||
HOST_OS:=@HOST_OS@
|
||||
HOST_OS_FAMILY:=@HOST_OS_FAMILY@
|
||||
HOST_OS_API:=@HOST_OS_API@
|
||||
# The built jdk will run in this target system.
|
||||
OPENJDK_TARGET_SYSTEM:=@OPENJDK_TARGET_SYSTEM@
|
||||
|
||||
HOST_CPU:=@HOST_CPU@
|
||||
HOST_CPU_ARCH:=@HOST_CPU_ARCH@
|
||||
HOST_CPU_BITS:=@HOST_CPU_BITS@
|
||||
HOST_CPU_ENDIAN:=@HOST_CPU_ENDIAN@
|
||||
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 host.
|
||||
BUILD:=@BUILD@
|
||||
BUILD_OS:=@BUILD_OS@
|
||||
BUILD_OS_FAMILY:=@BUILD_OS_FAMILY@
|
||||
BUILD_OS_API:=@BUILD_OS_API@
|
||||
# When not cross-compiling, it is the same as the target.
|
||||
OPENJDK_BUILD_SYSTEM:=@OPENJDK_BUILD_SYSTEM@
|
||||
|
||||
BUILD_CPU:=@BUILD_CPU@
|
||||
BUILD_CPU_ARCH:=@BUILD_CPU_ARCH@
|
||||
BUILD_CPU_BITS:=@BUILD_CPU_BITS@
|
||||
BUILD_CPU_ENDIAN:=@BUILD_CPU_ENDIAN@
|
||||
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 HOST_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
|
||||
PLATFORM:=@HOST_OS@
|
||||
# Old name for HOST_CPU, uses i586 and amd64, instead of ia32 and x64.
|
||||
ARCH:=@LEGACY_HOST_CPU1@
|
||||
# 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_HOST_CPU2@
|
||||
LIBARCH:=@LEGACY_OPENJDK_TARGET_CPU2@
|
||||
# Use to switch between solaris and windows subdirs in the jdk.
|
||||
LEGACY_HOST_OS_API:=@LEGACY_HOST_OS_API@
|
||||
LEGACY_OPENJDK_TARGET_OS_API:=@LEGACY_OPENJDK_TARGET_OS_API@
|
||||
# 32 or 64 bit
|
||||
ARCH_DATA_MODEL:=@HOST_CPU_BITS@
|
||||
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:=@HOST_CPU_ENDIAN@
|
||||
ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@
|
||||
@SET_OPENJDK@
|
||||
JIGSAW:=@JIGSAW@
|
||||
LIBM:=-lm
|
||||
@ -185,7 +187,6 @@ SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
|
||||
# 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.
|
||||
DEFAULT_JVM_VARIANT:=@DEFAULT_JVM_VARIANT@
|
||||
JVM_VARIANTS:=@JVM_VARIANTS@
|
||||
JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
|
||||
JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
|
||||
@ -202,53 +203,42 @@ DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
|
||||
# Legacy setting: -debug or -fastdebug
|
||||
BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
|
||||
|
||||
LANGTOOLS_OUTPUTDIR:=@OUTPUT_ROOT@/langtools
|
||||
LANGTOOLS_DIST:=@OUTPUT_ROOT@/langtools/dist
|
||||
LANGTOOLS_MAKE_ARGS:=@LANGTOOLS_MAKE_ARGS@
|
||||
|
||||
CORBA_OUTPUTDIR:=@OUTPUT_ROOT@/corba
|
||||
CORBA_DIST:=@OUTPUT_ROOT@/corba/dist
|
||||
CORBA_MAKE_ARGS:=@CORBA_MAKE_ARGS@
|
||||
|
||||
JAXP_OUTPUTDIR:=@OUTPUT_ROOT@/jaxp
|
||||
JAXP_DIST:=@OUTPUT_ROOT@/jaxp/dist
|
||||
JAXP_MAKE_ARGS:=@JAXP_MAKE_ARGS@
|
||||
|
||||
JAXWS_OUTPUTDIR:=@OUTPUT_ROOT@/jaxws
|
||||
JAXWS_DIST:=@OUTPUT_ROOT@/jaxws/dist
|
||||
JAXWS_MAKE_ARGS:=@JAXWS_MAKE_ARGS@
|
||||
|
||||
HOTSPOT_OUTPUTDIR:=@OUTPUT_ROOT@/hotspot
|
||||
HOTSPOT_DIST:=@OUTPUT_ROOT@/hotspot/dist
|
||||
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
|
||||
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.
|
||||
HOTSPOT_IMPORT_PATH:=@OUTPUT_ROOT@/hotspot/dist
|
||||
JDK_OUTPUTDIR:=@OUTPUT_ROOT@/jdk
|
||||
JDK_MAKE_ARGS:=@JDK_MAKE_ARGS@
|
||||
|
||||
# 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
|
||||
IMAGES_MAKE_ARGS:=@IMAGES_MAKE_ARGS@
|
||||
|
||||
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_HOST_CPU3@
|
||||
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_JAVAC_ARGS:=@BOOT_JAVAC_ARGS@
|
||||
BOOT_RTJAR:=@BOOT_RTJAR@
|
||||
BOOT_TOOLSJAR:=@BOOT_TOOLSJAR@
|
||||
|
||||
@ -258,8 +248,6 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
|
||||
|
||||
# Information about the build system
|
||||
NUM_CORES:=@NUM_CORES@
|
||||
# This is used from the libjvm build for C/C++ code.
|
||||
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# This is used from the jdk build for C/C++ code.
|
||||
PARALLEL_COMPILE_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# Store javac server synchronization files here, and
|
||||
@ -282,6 +270,8 @@ JAVAC_SERVER_CORES:=@JAVAC_SERVER_CORES@
|
||||
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
|
||||
@ -375,22 +365,24 @@ LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@
|
||||
@DEFINE_CROSS_COMPILE_ARCH@
|
||||
# The HOSTCC should really be named BUILDCC, ie build executable for
|
||||
# the build platform. Same as CC when not cross compiling.
|
||||
HOSTCC:=@HOSTCC@
|
||||
HOSTCXX:=@HOSTCXX@
|
||||
HOSTCC:=@UNCYGDRIVE@ @HOSTCC@
|
||||
HOSTCXX:=@UNCYGDRIVE@ @HOSTCXX@
|
||||
# And of course, the jdk spells HOSTCC as NIO_CC/HOST_CC
|
||||
HOST_CC:=@HOSTCC@
|
||||
NIO_CC:=@HOSTCC@
|
||||
HOST_CC:=@UNCYGDRIVE@ @HOSTCC@
|
||||
NIO_CC:=@UNCYGDRIVE@ @HOSTCC@
|
||||
|
||||
AS:=@AS@
|
||||
HOST_LD:=@UNCYGDRIVE@ @HOSTLD@
|
||||
|
||||
AS:=@UNCYGDRIVE@ @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@
|
||||
NM:=@UNCYGDRIVE@ @NM@
|
||||
STRIP:=@UNCYGDRIVE@ @STRIP@
|
||||
MCS:=@UNCYGDRIVE@ @MCS@
|
||||
|
||||
# Command to create a shared library
|
||||
SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
|
||||
@ -404,6 +396,17 @@ SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
|
||||
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@
|
||||
|
||||
#
|
||||
# Compress (or not) jars
|
||||
COMPRESS_JARS=@COMPRESS_JARS@
|
||||
|
||||
# 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@
|
||||
@ -507,23 +510,28 @@ READELF:=@READELF@
|
||||
EXPR:=@EXPR@
|
||||
FILE:=@FILE@
|
||||
HG:=@HG@
|
||||
OBJCOPY:=@OBJCOPY@
|
||||
|
||||
UNCYGDRIVE:=@UNCYGDRIVE@
|
||||
|
||||
# Where the build output is stored for your convenience.
|
||||
BUILD_LOG:=@BUILD_LOG@
|
||||
BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
|
||||
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
|
||||
|
||||
# Build setup
|
||||
ENABLE_DOCS:=@ENABLE_DOCS@
|
||||
GENERATE_DOCS:=@ENABLE_DOCS@
|
||||
DISABLE_NIMBUS:=@DISABLE_NIMBUS@
|
||||
ENABLE_JFR=@ENABLE_JFR@
|
||||
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
||||
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@
|
||||
|
||||
|
||||
# ADD_SRCS takes a single argument with source roots
|
||||
# and appends any corresponding source roots found
|
||||
# below --with-add-source-root and below
|
||||
@ -551,6 +559,17 @@ else
|
||||
OVR_SRCS:=
|
||||
endif
|
||||
|
||||
####################################################
|
||||
#
|
||||
# Legacy Hotspot support
|
||||
|
||||
HOTSPOT_DIST:=@HOTSPOT_DIST@
|
||||
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
|
||||
# This is used from the libjvm build for C/C++ code.
|
||||
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# Control wether Hotspot runs Queens test after building
|
||||
TEST_IN_BUILD=@TEST_IN_BUILD@
|
||||
|
||||
####################################################
|
||||
#
|
||||
# INSTALLATION
|
||||
@ -611,10 +630,9 @@ INSTALL_SYSCONFDIR=@sysconfdir@
|
||||
# Name of Service Agent library
|
||||
SALIB_NAME=@SALIB_NAME@
|
||||
|
||||
# Control wether Hotspot runs Queens test after building
|
||||
TEST_IN_BUILD=@TEST_IN_BUILD@
|
||||
|
||||
OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
|
||||
OS_VERSION_MINOR:=@OS_VERSION_MINOR@
|
||||
OS_VERSION_MICRO:=@OS_VERSION_MICRO@
|
||||
|
||||
# Include the closed-spec.gmk file if it exists
|
||||
-include $(dir @SPEC@)/closed-spec.gmk
|
||||
|
527
common/autoconf/spec.sh.in
Normal file
527
common/autoconf/spec.sh.in
Normal file
@ -0,0 +1,527 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
# 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@"
|
||||
CCACHE="@CCACHE@"
|
||||
# CD is going away, but remains to cater for legacy makefiles.
|
||||
CD=cd
|
||||
CHMOD="@CHMOD@"
|
||||
CP="@CP@"
|
||||
CPIO="@CPIO@"
|
||||
CUT="@CUT@"
|
||||
DATE="@DATE@"
|
||||
DF="@DF@"
|
||||
DIFF="@DIFF@"
|
||||
FIND="@FIND@"
|
||||
FIND_DELETE="@FIND_DELETE@"
|
||||
ECHO="@ECHO@"
|
||||
EGREP="@EGREP@"
|
||||
FGREP="@FGREP@"
|
||||
GREP="@GREP@"
|
||||
HEAD="@HEAD@"
|
||||
LS="@LS@"
|
||||
LN="@LN@"
|
||||
MKDIR="@MKDIR@"
|
||||
MV="@MV@"
|
||||
NAWK="@NAWK@"
|
||||
PRINTF="@PRINTF@"
|
||||
PWD="@THEPWDCMD@"
|
||||
RM="@RM@"
|
||||
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@"
|
||||
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@"
|
908
common/autoconf/toolchain.m4
Normal file
908
common/autoconf/toolchain.m4
Normal file
@ -0,0 +1,908 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_VISUAL_STUDIO_ENV],
|
||||
[
|
||||
|
||||
# Check if the VS env variables were setup prior to running configure.
|
||||
# If not, then find vcvarsall.bat and run it automatically, and integrate
|
||||
# the set env variables into the spec file.
|
||||
SETUPDEVENV="# No special vars"
|
||||
if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
|
||||
# If vcvarsall.bat has been run, then VCINSTALLDIR is set.
|
||||
if test "x$VCINSTALLDIR" != x; then
|
||||
# No further setup is needed. The build will happen from this kind
|
||||
# of shell.
|
||||
SETUPDEVENV="# This spec file expects that you are running bash from within a VS command prompt."
|
||||
# Make sure to remind you, if you forget to run make from a cygwin bash shell
|
||||
# that is spawned "bash -l" from a VS command prompt.
|
||||
CHECK_FOR_VCINSTALLDIR=yes
|
||||
AC_MSG_CHECKING([if you are running from within a VS command prompt])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
# Ah, we have not yet run vcvarsall.bat/vsvars32.bat/vsvars64.bat. Lets do that. First find it.
|
||||
if test "x$VS100COMNTOOLS" != x; then
|
||||
VARSBAT=`find "$VS100COMNTOOLS/../.." -name vcvarsall.bat`
|
||||
SEARCH_ROOT="$VS100COMNTOOLS"
|
||||
else
|
||||
VARSBAT=`find "$PROGRAMFILES" -name vcvarsall.bat`
|
||||
SEARCH_ROOT="$PROGRAMFILES"
|
||||
fi
|
||||
VCPATH=`dirname "$VARSBAT"`
|
||||
VCPATH=`cygpath -w "$VCPATH"`
|
||||
if test "x$VARSBAT" = x || test ! -d "$VCPATH"; then
|
||||
AC_MSG_CHECKING([if we can find the VS installation])
|
||||
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.])
|
||||
fi
|
||||
case "$LEGACY_OPENJDK_TARGET_CPU1" in
|
||||
i?86)
|
||||
VARSBAT_ARCH=x86
|
||||
;;
|
||||
*)
|
||||
VARSBAT_ARCH=$LEGACY_OPENJDK_TARGET_CPU1
|
||||
;;
|
||||
esac
|
||||
# Lets extract the variables that are set by vcvarsall.bat/vsvars32.bat/vsvars64.bat
|
||||
cd $OUTPUT_ROOT
|
||||
bash $SRC_ROOT/common/bin/extractvcvars.sh "$VARSBAT" "$VARSBAT_ARCH"
|
||||
cd $CURDIR
|
||||
if test ! -s $OUTPUT_ROOT/localdevenv.sh || test ! -s $OUTPUT_ROOT/localdevenv.gmk; then
|
||||
AC_MSG_CHECKING([if we can extract the needed env variables])
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Could not succesfully extract the env variables needed for the VS setup. Please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.])
|
||||
fi
|
||||
# Now set all paths and other env variables. This will allow the rest of
|
||||
# the configure script to find and run the compiler in the proper way.
|
||||
. $OUTPUT_ROOT/localdevenv.sh
|
||||
AC_MSG_CHECKING([if we can find the VS installation])
|
||||
if test "x$VCINSTALLDIR" != x; then
|
||||
AC_MSG_RESULT([$VCINSTALLDIR])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Could not find VS installation. Please install. If you are sure you have installed VS, then please run "c:\\cygwin\\bin\\bash.exe -l" from a VS command prompt and then run configure/make from there.])
|
||||
fi
|
||||
CHECK_FOR_VCINSTALLDIR=no
|
||||
SETUPDEVENV="include $OUTPUT_ROOT/localdevenv.gmk"
|
||||
|
||||
AC_MSG_CHECKING([for msvcr100.dll])
|
||||
AC_ARG_WITH(msvcr100dll, [AS_HELP_STRING([--with-msvcr100dll],
|
||||
[copy this msvcr100.dll into the built JDK])])
|
||||
if test "x$with_msvcr100dll" != x; then
|
||||
MSVCR100DLL="$with_msvcr100dll"
|
||||
else
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x64 | head --lines 1`
|
||||
else
|
||||
MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | grep x86 | grep -v ia64 | grep -v x64 | head --lines 1`
|
||||
if test "x$MSVCR100DLL" = x; then
|
||||
MSVCR100DLL=`find "$VCINSTALLDIR/.." -name msvcr100.dll | head --lines 1`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if test "x$MSVCR100DLL" = x; then
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([Could not find msvcr100.dll !])
|
||||
fi
|
||||
AC_MSG_RESULT([$MSVCR100DLL])
|
||||
SPACESAFE(MSVCR100DLL,[the path to msvcr100.dll])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(SETUPDEVENV)
|
||||
AC_SUBST(CHECK_FOR_VCINSTALLDIR)
|
||||
AC_SUBST(MSVCR100DLL)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_SYSROOT_AND_OUT_OPTIONS],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Configure the development tool paths and potential sysroot.
|
||||
#
|
||||
AC_LANG(C++)
|
||||
DEVKIT=
|
||||
SYS_ROOT=/
|
||||
AC_SUBST(SYS_ROOT)
|
||||
|
||||
# The option used to specify the target .o,.a or .so file.
|
||||
# When compiling, how to specify the to be created object file.
|
||||
CC_OUT_OPTION='-o$(SPACE)'
|
||||
# When linking, how to specify the to be created executable.
|
||||
EXE_OUT_OPTION='-o$(SPACE)'
|
||||
# When linking, how to specify the to be created dynamically linkable library.
|
||||
LD_OUT_OPTION='-o$(SPACE)'
|
||||
# When archiving, how to specify the to be create static archive for object files.
|
||||
AR_OUT_OPTION='rcs$(SPACE)'
|
||||
AC_SUBST(CC_OUT_OPTION)
|
||||
AC_SUBST(EXE_OUT_OPTION)
|
||||
AC_SUBST(LD_OUT_OPTION)
|
||||
AC_SUBST(AR_OUT_OPTION)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_PATHS],
|
||||
[
|
||||
# If --build AND --host is set, then the configure script will find any
|
||||
# cross compilation tools in the PATH. Cross compilation tools
|
||||
# follows the cross compilation standard where they are prefixed with ${host}.
|
||||
# For example the binary i686-sun-solaris2.10-gcc
|
||||
# will cross compile for i686-sun-solaris2.10
|
||||
# If neither of build and host is not set, then build=host and the
|
||||
# default compiler found in the path will be used.
|
||||
# Setting only --host, does not seem to be really supported.
|
||||
# Please set both --build and --host if you want to cross compile.
|
||||
|
||||
DEFINE_CROSS_COMPILE_ARCH=""
|
||||
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
|
||||
# platform. We can't use the AC_PROG_CC macro, since it can only be used
|
||||
# once.
|
||||
AC_PATH_PROGS(HOSTCC, [cl cc gcc])
|
||||
WHICHCMD(HOSTCC)
|
||||
AC_PATH_PROGS(HOSTCXX, [cl CC g++])
|
||||
WHICHCMD(HOSTCXX)
|
||||
AC_PATH_PROG(HOSTLD, ld)
|
||||
WHICHCMD(HOSTLD)
|
||||
# Building for the build platform should be easy. Therefore
|
||||
# we do not need any linkers or assemblers etc.
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
# 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
|
||||
# PATH variable. If there are cross compilers available in the devkit, these
|
||||
# will be found by AC_PROG_CC et al.
|
||||
BDEPS_CHECK_MODULE(DEVKIT, devkit, xxx,
|
||||
[# Found devkit
|
||||
PATH="$DEVKIT/bin:$PATH"
|
||||
SYS_ROOT="$DEVKIT/${rewritten_target}/sys-root"
|
||||
if test "x$x_includes" = "xNONE"; then
|
||||
x_includes="$SYS_ROOT/usr/include/X11"
|
||||
fi
|
||||
if test "x$x_libraries" = "xNONE"; then
|
||||
x_libraries="$SYS_ROOT/usr/lib"
|
||||
fi
|
||||
],
|
||||
[])
|
||||
|
||||
if test "x$SYS_ROOT" != "x/" ; then
|
||||
CFLAGS="--sysroot=$SYS_ROOT $CFLAGS"
|
||||
CXXFLAGS="--sysroot=$SYS_ROOT $CXXFLAGS"
|
||||
OBJCFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
|
||||
OBJCXXFLAGS="--sysroot=$SYS_ROOT $OBJCFLAGS"
|
||||
CPPFLAGS="--sysroot=$SYS_ROOT $CPPFLAGS"
|
||||
LDFLAGS="--sysroot=$SYS_ROOT $LDFLAGS"
|
||||
fi
|
||||
|
||||
# Store the CFLAGS etal passed to the configure script.
|
||||
ORG_CFLAGS="$CFLAGS"
|
||||
ORG_CXXFLAGS="$CXXFLAGS"
|
||||
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
|
||||
OLD_PATH="$PATH"
|
||||
if test "x$TOOLS_DIR" != x; then
|
||||
PATH=$TOOLS_DIR:$PATH
|
||||
fi
|
||||
|
||||
# gcc is almost always present, but on Windows we
|
||||
# prefer cl.exe and on Solaris we prefer CC.
|
||||
# Thus test for them in this order.
|
||||
AC_PROG_CC([cl cc gcc])
|
||||
if test "x$CC" = x; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([devkit])
|
||||
AC_MSG_ERROR([Could not find a compiler. $HELP_MSG])
|
||||
fi
|
||||
if test "x$CC" = xcc && test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
||||
# Do not use cc on MacOSX use gcc instead.
|
||||
CC="gcc"
|
||||
fi
|
||||
WHICHCMD(CC)
|
||||
|
||||
AC_PROG_CXX([cl CC g++])
|
||||
if test "x$CXX" = xCC && test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
||||
# The found CC, even though it seems to be a g++ derivate, cannot compile
|
||||
# c++ code. Override.
|
||||
CXX="g++"
|
||||
fi
|
||||
WHICHCMD(CXX)
|
||||
|
||||
if test "x$CXX" = x || test "x$CC" = x; then
|
||||
HELP_MSG_MISSING_DEPENDENCY([devkit])
|
||||
AC_MSG_ERROR([Could not find the needed compilers! $HELP_MSG ])
|
||||
fi
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" != xwindows; then
|
||||
AC_PROG_OBJC
|
||||
WHICHCMD(OBJC)
|
||||
else
|
||||
OBJC=
|
||||
fi
|
||||
|
||||
# Restore the flags to the user specified values.
|
||||
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
|
||||
CFLAGS="$ORG_CFLAGS"
|
||||
CXXFLAGS="$ORG_CXXFLAGS"
|
||||
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"
|
||||
LDEXE="$CC"
|
||||
LDCXX="$CXX"
|
||||
LDEXECXX="$CXX"
|
||||
# LDEXE is the linker to use, when creating executables.
|
||||
AC_SUBST(LDEXE)
|
||||
# Linking C++ libraries.
|
||||
AC_SUBST(LDCXX)
|
||||
# Linking C++ executables.
|
||||
AC_SUBST(LDEXECXX)
|
||||
|
||||
AC_CHECK_TOOL(AR, ar)
|
||||
WHICHCMD(AR)
|
||||
if test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
||||
ARFLAGS="-r"
|
||||
else
|
||||
ARFLAGS=""
|
||||
fi
|
||||
AC_SUBST(ARFLAGS)
|
||||
|
||||
COMPILER_NAME=gcc
|
||||
COMPILER_TYPE=CC
|
||||
AS_IF([test "x$OPENJDK_BUILD_OS" = xwindows], [
|
||||
# For now, assume that we are always compiling using cl.exe.
|
||||
CC_OUT_OPTION=-Fo
|
||||
EXE_OUT_OPTION=-out:
|
||||
LD_OUT_OPTION=-out:
|
||||
AR_OUT_OPTION=-out:
|
||||
# On Windows, reject /usr/bin/link, which is a cygwin
|
||||
# program for something completely different.
|
||||
AC_CHECK_PROG([WINLD], [link],[link],,, [/usr/bin/link])
|
||||
# Since we must ignore the first found link, WINLD will contain
|
||||
# the full path to the link.exe program.
|
||||
WHICHCMD_SPACESAFE([WINLD])
|
||||
LD="$WINLD"
|
||||
LDEXE="$WINLD"
|
||||
LDCXX="$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])
|
||||
WHICHCMD_SPACESAFE([MT])
|
||||
# The resource compiler
|
||||
AC_CHECK_PROG([RC], [rc], [rc],,, [/usr/bin/rc])
|
||||
WHICHCMD_SPACESAFE([RC])
|
||||
|
||||
RC_FLAGS="-nologo /l 0x409 /r"
|
||||
AS_IF([test "x$VARIANT" = xOPT], [
|
||||
RC_FLAGS="$RC_FLAGS -d NDEBUG"
|
||||
])
|
||||
JDK_UPDATE_VERSION_NOTNULL=$JDK_UPDATE_VERSION
|
||||
AS_IF([test "x$JDK_UPDATE_VERSION" = x], [
|
||||
JDK_UPDATE_VERSION_NOTNULL=0
|
||||
])
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_BUILD_ID=$FULL_VERSION\""
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_COMPANY=$COMPANY_NAME\""
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_COMPONENT=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME binary\""
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_VER=$JDK_MINOR_VERSION.$JDK_MICRO_VERSION.$JDK_UPDATE_VERSION_NOTNULL.$COOKED_BUILD_NUMBER\""
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_COPYRIGHT=Copyright \xA9 $COPYRIGHT_YEAR\""
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_NAME=$PRODUCT_NAME $JDK_RC_PLATFORM_NAME $JDK_MINOR_VERSION $JDK_UPDATE_META_TAG\""
|
||||
RC_FLAGS="$RC_FLAGS -d \"JDK_FVER=$JDK_MINOR_VERSION,$JDK_MICRO_VERSION,$JDK_UPDATE_VERSION_NOTNULL,$COOKED_BUILD_NUMBER\""
|
||||
|
||||
# lib.exe is used to create static libraries.
|
||||
AC_CHECK_PROG([WINAR], [lib],[lib],,,)
|
||||
WHICHCMD_SPACESAFE([WINAR])
|
||||
AR="$WINAR"
|
||||
ARFLAGS="-nologo -NODEFAULTLIB:MSVCRT"
|
||||
|
||||
AC_CHECK_PROG([DUMPBIN], [dumpbin], [dumpbin],,,)
|
||||
WHICHCMD_SPACESAFE([DUMPBIN])
|
||||
|
||||
COMPILER_TYPE=CL
|
||||
CCXXFLAGS="$CCXXFLAGS -nologo"
|
||||
])
|
||||
AC_SUBST(RC_FLAGS)
|
||||
AC_SUBST(COMPILER_TYPE)
|
||||
|
||||
AC_PROG_CPP
|
||||
WHICHCMD(CPP)
|
||||
|
||||
AC_PROG_CXXCPP
|
||||
WHICHCMD(CXXCPP)
|
||||
|
||||
# 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
|
||||
# starting to probe
|
||||
#
|
||||
# NOTE: I add this /usr/ccs/bin after TOOLS but before OLD_PATH
|
||||
# so that it can be overriden --with-tools-dir
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
PATH="${TOOLS_DIR}:/usr/ccs/bin:${OLD_PATH}"
|
||||
fi
|
||||
|
||||
# Find the right assembler.
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
AC_PATH_PROG(AS, as)
|
||||
WHICHCMD(AS)
|
||||
ASFLAGS=" "
|
||||
else
|
||||
AS="$CC -c"
|
||||
ASFLAGS=" "
|
||||
fi
|
||||
AC_SUBST(AS)
|
||||
AC_SUBST(ASFLAGS)
|
||||
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
AC_PATH_PROG(NM, nm)
|
||||
WHICHCMD(NM)
|
||||
AC_PATH_PROG(STRIP, strip)
|
||||
WHICHCMD(STRIP)
|
||||
AC_PATH_PROG(MCS, mcs)
|
||||
WHICHCMD(MCS)
|
||||
else
|
||||
AC_CHECK_TOOL(NM, nm)
|
||||
WHICHCMD(NM)
|
||||
AC_CHECK_TOOL(STRIP, strip)
|
||||
WHICHCMD(STRIP)
|
||||
fi
|
||||
|
||||
###
|
||||
#
|
||||
# Check for objcopy
|
||||
#
|
||||
# but search for gobjcopy first...
|
||||
# since I on solaris found a broken objcopy...buhh
|
||||
#
|
||||
AC_PATH_TOOL(OBJCOPY, gobjcopy)
|
||||
if test "x$OBJCOPY" = x; then
|
||||
AC_PATH_TOOL(OBJCOPY, objcopy)
|
||||
fi
|
||||
|
||||
# Restore old path without tools dir
|
||||
PATH="$OLD_PATH"
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# How to compile shared libraries.
|
||||
#
|
||||
|
||||
if test "x$GCC" = xyes; then
|
||||
COMPILER_NAME=gcc
|
||||
PICFLAG="-fPIC"
|
||||
LIBRARY_PREFIX=lib
|
||||
SHARED_LIBRARY='lib[$]1.so'
|
||||
STATIC_LIBRARY='lib[$]1.a'
|
||||
SHARED_LIBRARY_FLAGS="-shared"
|
||||
SHARED_LIBRARY_SUFFIX='.so'
|
||||
STATIC_LIBRARY_SUFFIX='.a'
|
||||
OBJ_SUFFIX='.o'
|
||||
EXE_SUFFIX=''
|
||||
SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
|
||||
C_FLAG_REORDER=''
|
||||
CXX_FLAG_REORDER=''
|
||||
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -z -Xlinker origin -Xlinker -rpath -Xlinker \$$$$ORIGIN/[$]1'
|
||||
LD="$CC"
|
||||
LDEXE="$CC"
|
||||
LDCXX="$CXX"
|
||||
LDEXECXX="$CXX"
|
||||
POST_STRIP_CMD="$STRIP -g"
|
||||
if test "x$JDK_VARIANT" = xembedded; then
|
||||
POST_STRIP_CMD="$STRIP --strip-unneeded"
|
||||
fi
|
||||
|
||||
# Linking is different on MacOSX
|
||||
if test "x$OPENJDK_BUILD_OS" = xmacosx; then
|
||||
# Might change in the future to clang.
|
||||
COMPILER_NAME=gcc
|
||||
SHARED_LIBRARY='lib[$]1.dylib'
|
||||
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
|
||||
SHARED_LIBRARY_SUFFIX='.dylib'
|
||||
EXE_SUFFIX=''
|
||||
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
SET_SHARED_LIBRARY_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
|
||||
POST_STRIP_CMD="$STRIP -S"
|
||||
fi
|
||||
else
|
||||
if test "x$OPENJDK_BUILD_OS" = xsolaris; then
|
||||
# If it is not gcc, then assume it is the Oracle Solaris Studio Compiler
|
||||
COMPILER_NAME=ossc
|
||||
PICFLAG="-KPIC"
|
||||
LIBRARY_PREFIX=lib
|
||||
SHARED_LIBRARY='lib[$]1.so'
|
||||
STATIC_LIBRARY='lib[$]1.a'
|
||||
SHARED_LIBRARY_FLAGS="-z defs -xildoff -ztext -G"
|
||||
SHARED_LIBRARY_SUFFIX='.so'
|
||||
STATIC_LIBRARY_SUFFIX='.a'
|
||||
OBJ_SUFFIX='.o'
|
||||
EXE_SUFFIX=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
|
||||
C_FLAG_REORDER='-xF'
|
||||
CXX_FLAG_REORDER='-xF'
|
||||
SET_SHARED_LIBRARY_ORIGIN='-R \$$$$ORIGIN/[$]1'
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} -D__solaris__"
|
||||
CFLAGS_JDKLIB_EXTRA='-xstrconst'
|
||||
POST_STRIP_CMD="$STRIP -x"
|
||||
POST_MCS_CMD="$MCS -d -a \"JDK $FULL_VERSION\""
|
||||
fi
|
||||
if test "x$OPENJDK_BUILD_OS" = xwindows; then
|
||||
# If it is not gcc, then assume it is the MS Visual Studio compiler
|
||||
COMPILER_NAME=cl
|
||||
PICFLAG=""
|
||||
LIBRARY_PREFIX=
|
||||
SHARED_LIBRARY='[$]1.dll'
|
||||
STATIC_LIBRARY='[$]1.lib'
|
||||
SHARED_LIBRARY_FLAGS="-LD"
|
||||
SHARED_LIBRARY_SUFFIX='.dll'
|
||||
STATIC_LIBRARY_SUFFIX='.lib'
|
||||
OBJ_SUFFIX='.obj'
|
||||
EXE_SUFFIX='.exe'
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_SUBST(OBJ_SUFFIX)
|
||||
AC_SUBST(SHARED_LIBRARY)
|
||||
AC_SUBST(STATIC_LIBRARY)
|
||||
AC_SUBST(LIBRARY_PREFIX)
|
||||
AC_SUBST(SHARED_LIBRARY_SUFFIX)
|
||||
AC_SUBST(STATIC_LIBRARY_SUFFIX)
|
||||
AC_SUBST(EXE_SUFFIX)
|
||||
AC_SUBST(SHARED_LIBRARY_FLAGS)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
|
||||
AC_SUBST(C_FLAG_REORDER)
|
||||
AC_SUBST(CXX_FLAG_REORDER)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
||||
AC_SUBST(POST_STRIP_CMD)
|
||||
AC_SUBST(POST_MCS_CMD)
|
||||
|
||||
# The (cross) compiler is now configured, we can now test capabilities
|
||||
# of the target platform.
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Setup the opt flags for different compilers
|
||||
# and different operating systems.
|
||||
#
|
||||
C_FLAG_DEPS="-MMD -MF"
|
||||
CXX_FLAG_DEPS="-MMD -MF"
|
||||
|
||||
case $COMPILER_TYPE in
|
||||
CC )
|
||||
D_FLAG="-g"
|
||||
case $COMPILER_NAME in
|
||||
gcc )
|
||||
case $OPENJDK_TARGET_OS in
|
||||
macosx )
|
||||
# On MacOSX we optimize for size, something
|
||||
# we should do for all platforms?
|
||||
C_O_FLAG_HI="-Os"
|
||||
C_O_FLAG_NORM="-Os"
|
||||
C_O_FLAG_NONE=""
|
||||
;;
|
||||
*)
|
||||
C_O_FLAG_HI="-O3"
|
||||
C_O_FLAG_NORM="-O2"
|
||||
C_O_FLAG_NONE="-O0"
|
||||
CFLAGS_DEBUG_SYMBOLS="-g"
|
||||
CXXFLAGS_DEBUG_SYMBOLS="-g"
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-g1"
|
||||
CXXFLAGS_DEBUG_SYMBOLSG="-g1"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
CXX_O_FLAG_HI="$C_O_FLAG_HI"
|
||||
CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
|
||||
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
|
||||
;;
|
||||
ossc )
|
||||
#
|
||||
# Forte has different names for this with their C++ compiler...
|
||||
#
|
||||
C_FLAG_DEPS="-xMMD -xMF"
|
||||
CXX_FLAG_DEPS="-xMMD -xMF"
|
||||
|
||||
# Extra options used with HIGHEST
|
||||
#
|
||||
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
|
||||
# done with care, there are some assumptions below that need to
|
||||
# be understood about the use of pointers, and IEEE behavior.
|
||||
#
|
||||
# Use non-standard floating point mode (not IEEE 754)
|
||||
CC_HIGHEST="$CC_HIGHEST -fns"
|
||||
# Do some simplification of floating point arithmetic (not IEEE 754)
|
||||
CC_HIGHEST="$CC_HIGHEST -fsimple"
|
||||
# Use single precision floating point with 'float'
|
||||
CC_HIGHEST="$CC_HIGHEST -fsingle"
|
||||
# Assume memory references via basic pointer types do not alias
|
||||
# (Source with excessing pointer casting and data access with mixed
|
||||
# pointer types are not recommended)
|
||||
CC_HIGHEST="$CC_HIGHEST -xalias_level=basic"
|
||||
# Use intrinsic or inline versions for math/std functions
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
CC_HIGHEST="$CC_HIGHEST -xbuiltin=%all"
|
||||
# Loop data dependency optimizations (need -xO3 or higher)
|
||||
CC_HIGHEST="$CC_HIGHEST -xdepend"
|
||||
# Pointer parameters to functions do not overlap
|
||||
# (Similar to -xalias_level=basic usage, but less obvious sometimes.
|
||||
# If you pass in multiple pointers to the same data, do not use this)
|
||||
CC_HIGHEST="$CC_HIGHEST -xrestrict"
|
||||
# Inline some library routines
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
CC_HIGHEST="$CC_HIGHEST -xlibmil"
|
||||
# Use optimized math routines
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
|
||||
#CC_HIGHEST="$CC_HIGHEST -xlibmopt"
|
||||
|
||||
case $LEGACY_OPENJDK_TARGET_CPU1 in
|
||||
i586)
|
||||
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xchip=pentium"
|
||||
C_O_FLAG_HI="-xO4 -Wu,-O4~yz"
|
||||
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz"
|
||||
C_O_FLAG_NONE=""
|
||||
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xchip=pentium"
|
||||
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz"
|
||||
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz"
|
||||
CXX_O_FLAG_NONE=""
|
||||
;;
|
||||
sparc)
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -xmemalign=4s"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} -xmemalign=4s"
|
||||
CFLAGS_JDKLIB_EXTRA="${CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
|
||||
CXXFLAGS_JDKLIB_EXTRA="${CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
|
||||
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
|
||||
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0"
|
||||
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0"
|
||||
C_O_FLAG_NONE=""
|
||||
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra"
|
||||
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
|
||||
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0"
|
||||
CXX_O_FLAG_NONE=""
|
||||
;;
|
||||
esac
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g -xs"
|
||||
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs"
|
||||
esac
|
||||
;;
|
||||
CL )
|
||||
D_FLAG=
|
||||
C_O_FLAG_HI="-O2"
|
||||
C_O_FLAG_NORM="-O1"
|
||||
C_O_FLAG_NONE="-Od"
|
||||
CXX_O_FLAG_HI="$C_O_FLAG_HI"
|
||||
CXX_O_FLAG_NORM="$C_O_FLAG_NORM"
|
||||
CXX_O_FLAG_NONE="$C_O_FLAG_NONE"
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$C_O_FLAG_HIGHEST"; then
|
||||
C_O_FLAG_HIGHEST="$C_O_FLAG_HI"
|
||||
fi
|
||||
|
||||
if test -z "$CXX_O_FLAG_HIGHEST"; then
|
||||
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HI"
|
||||
fi
|
||||
|
||||
AC_SUBST(C_O_FLAG_HIGHEST)
|
||||
AC_SUBST(C_O_FLAG_HI)
|
||||
AC_SUBST(C_O_FLAG_NORM)
|
||||
AC_SUBST(C_O_FLAG_NONE)
|
||||
AC_SUBST(CXX_O_FLAG_HIGHEST)
|
||||
AC_SUBST(CXX_O_FLAG_HI)
|
||||
AC_SUBST(CXX_O_FLAG_NORM)
|
||||
AC_SUBST(CXX_O_FLAG_NONE)
|
||||
AC_SUBST(C_FLAG_DEPS)
|
||||
AC_SUBST(CXX_FLAG_DEPS)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
[
|
||||
|
||||
if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
|
||||
AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags"])
|
||||
fi
|
||||
|
||||
if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
|
||||
AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags"])
|
||||
fi
|
||||
|
||||
if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
|
||||
AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags"])
|
||||
fi
|
||||
|
||||
AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
|
||||
[extra flags to be used when compiling jdk c-files])])
|
||||
|
||||
AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
|
||||
[extra flags to be used when compiling jdk c++-files])])
|
||||
|
||||
AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
|
||||
[extra flags to be used when linking jdk])])
|
||||
|
||||
CFLAGS_JDK="${CFLAGS_JDK} $with_extra_cflags"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK} $with_extra_cxxflags"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} $with_extra_ldflags"
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Now setup the CFLAGS and LDFLAGS for the JDK build.
|
||||
# Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
|
||||
#
|
||||
case $COMPILER_NAME in
|
||||
gcc )
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \
|
||||
-pipe \
|
||||
-D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||
case $OPENJDK_TARGET_CPU_ARCH in
|
||||
arm )
|
||||
# on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
|
||||
;;
|
||||
ppc )
|
||||
# on ppc we don't prevent gcc to omit frame pointer nor strict-aliasing
|
||||
;;
|
||||
* )
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -fno-omit-frame-pointer"
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
ossc )
|
||||
CFLAGS_JDK="$CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -norunpath -xnolib"
|
||||
CXXFLAGS_JDK="$CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX"
|
||||
;;
|
||||
cl )
|
||||
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_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
|
||||
-DWIN32 -DIAL"
|
||||
case $LEGACY_OPENJDK_TARGET_CPU1 in
|
||||
i?86 )
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_X86_ -Dx86"
|
||||
;;
|
||||
amd64 )
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_AMD64_ -Damd64"
|
||||
;;
|
||||
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"
|
||||
|
||||
# The package path is used only on macosx?
|
||||
PACKAGE_PATH=/opt/local
|
||||
AC_SUBST(PACKAGE_PATH)
|
||||
|
||||
# Sometimes we use a cpu dir (.../lib/amd64/server)
|
||||
# Sometimes not (.../lib/server)
|
||||
LIBARCHDIR="$LEGACY_OPENJDK_TARGET_CPU2/"
|
||||
if test "x$ENDIAN" = xlittle; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
|
||||
else
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -D_BIG_ENDIAN"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DLINUX"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DWINDOWS"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DSOLARIS"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DMACOSX -D_ALLBSD_SOURCE"
|
||||
LIBARCHDIR=""
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xbsd; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DBSD -D_ALLBSD_SOURCE"
|
||||
fi
|
||||
if test "x$DEBUG_LEVEL" = xrelease; then
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DNDEBUG"
|
||||
else
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DDEBUG"
|
||||
fi
|
||||
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$LEGACY_OPENJDK_TARGET_CPU1\"' -D$LEGACY_OPENJDK_TARGET_CPU1"
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
|
||||
|
||||
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
|
||||
-I${JDK_OUTPUTDIR}/include \
|
||||
-I${JDK_OUTPUTDIR}/include/$OPENJDK_TARGET_OS \
|
||||
-I${JDK_TOPDIR}/src/share/javavm/export \
|
||||
-I${JDK_TOPDIR}/src/$LEGACY_OPENJDK_TARGET_OS_API/javavm/export \
|
||||
-I${JDK_TOPDIR}/src/share/native/common \
|
||||
-I${JDK_TOPDIR}/src/$LEGACY_OPENJDK_TARGET_OS_API/native/common"
|
||||
|
||||
# The shared libraries are compiled using the picflag.
|
||||
CFLAGS_JDKLIB="$CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
|
||||
CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA "
|
||||
|
||||
# Executable flags
|
||||
CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK"
|
||||
CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK"
|
||||
|
||||
# Now this is odd. The JDK native libraries have to link against libjvm.so
|
||||
# On 32-bit machines there is normally two distinct libjvm.so:s, client and server.
|
||||
# Which should we link to? Are we lucky enough that the binary api to the libjvm.so library
|
||||
# is identical for client and server? Yes. Which is picked at runtime (client or server)?
|
||||
# Neither, since the chosen libjvm.so has already been loaded by the launcher, all the following
|
||||
# libraries will link to whatever is in memory. Yuck.
|
||||
#
|
||||
# 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
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -nologo -opt:ref -incremental:no"
|
||||
if test "x$LEGACY_OPENJDK_TARGET_CPU1" = xi586; then
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -safeseh"
|
||||
fi
|
||||
# TODO: make -debug optional "--disable-full-debug-symbols"
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -debug"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDK} -dll -libpath:${JDK_OUTPUTDIR}/lib"
|
||||
LDFLAGS_JDKLIB_SUFFIX=""
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
|
||||
LDFLAGS_STACK_SIZE=1048576
|
||||
else
|
||||
LDFLAGS_STACK_SIZE=327680
|
||||
fi
|
||||
LDFLAGS_JDKEXE="${LDFLAGS_JDK} /STACK:$LDFLAGS_STACK_SIZE"
|
||||
else
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both, why?
|
||||
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
|
||||
if test -n "$HAS_GNU_HASH"; then
|
||||
# And since we now know that the linker is gnu, then add -z defs, to forbid
|
||||
# undefined symbols in object files.
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both -Xlinker -z -Xlinker defs"
|
||||
if test "x$DEBUG_LEVEL" == "xrelease"; then
|
||||
# When building release libraries, tell the linker optimize them.
|
||||
# Should this be supplied to the OSS linker as well?
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
|
||||
fi
|
||||
fi
|
||||
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDK} $SHARED_LIBRARY_FLAGS \
|
||||
-L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}server \
|
||||
-L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}client \
|
||||
-L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}"
|
||||
LDFLAGS_JDKLIB_SUFFIX="-ljvm -ljava"
|
||||
if test "x$COMPILER_NAME" = xossc; then
|
||||
LDFLAGS_JDKLIB_SUFFIX="$LDFLAGS_JDKLIB_SUFFIX -lc"
|
||||
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}"
|
||||
if test "x$OPENJDK_TARGET_OS" != "xmacosx"; then
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -L${JDK_OUTPUTDIR}/lib/${LIBARCHDIR}jli"
|
||||
LDFLAGS_JDKEXE_SUFFIX="-ljli"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Adjust flags according to debug level.
|
||||
case $DEBUG_LEVEL in
|
||||
fastdebug )
|
||||
CFLAGS="$CFLAGS $D_FLAG"
|
||||
JAVAC_FLAGS="$JAVAC_FLAGS -g"
|
||||
;;
|
||||
slowdebug )
|
||||
CFLAGS="$CFLAGS $D_FLAG"
|
||||
C_O_FLAG_HI="$C_O_FLAG_NONE"
|
||||
C_O_FLAG_NORM="$C_O_FLAG_NONE"
|
||||
CXX_O_FLAG_HI="$CXX_O_FLAG_NONE"
|
||||
CXX_O_FLAG_NORM="$CXX_O_FLAG_NONE"
|
||||
JAVAC_FLAGS="$JAVAC_FLAGS -g"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
AC_SUBST(CFLAGS_JDKLIB)
|
||||
AC_SUBST(CFLAGS_JDKEXE)
|
||||
|
||||
AC_SUBST(CXXFLAGS_JDKLIB)
|
||||
AC_SUBST(CXXFLAGS_JDKEXE)
|
||||
|
||||
AC_SUBST(LDFLAGS_JDKLIB)
|
||||
AC_SUBST(LDFLAGS_JDKEXE)
|
||||
AC_SUBST(LDFLAGS_JDKLIB_SUFFIX)
|
||||
AC_SUBST(LDFLAGS_JDKEXE_SUFFIX)
|
||||
])
|
235
common/bin/compare-objects.sh
Normal file
235
common/bin/compare-objects.sh
Normal file
@ -0,0 +1,235 @@
|
||||
#!/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.
|
||||
#
|
||||
|
||||
# MANUAL
|
||||
#
|
||||
# ./common/bin/compare-objects.sh old_jdk_build_dir new_jdk_build_dir
|
||||
#
|
||||
# Compares object files
|
||||
#
|
||||
|
||||
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 ""
|
||||
echo "Compare object files"
|
||||
echo ""
|
||||
exit 10
|
||||
fi
|
||||
|
||||
#######
|
||||
#
|
||||
# List of files (grep patterns) that are ignored
|
||||
#
|
||||
# 1) hotspot object files
|
||||
IGNORE="-e hotspot"
|
||||
|
||||
# 2) various build artifacts: sizer.32.o sizer.64.o dummyodbc.o
|
||||
# these are produced during build and then e.g run to produce other data
|
||||
# i.e not directly put into build => safe to ignore
|
||||
IGNORE="${IGNORE} -e sizer.32.o -e sizer.64.o"
|
||||
IGNORE="${IGNORE} -e dummyodbc.o"
|
||||
IGNORE="${IGNORE} -e genSolarisConstants.o"
|
||||
IGNORE="${IGNORE} -e genUnixConstants.o"
|
||||
|
||||
OLD="$1"
|
||||
NEW="$2"
|
||||
shift; shift
|
||||
PATTERN="$*"
|
||||
|
||||
if [ -f $NEW/spec.sh ]; then
|
||||
. $NEW/spec.sh
|
||||
elif [ -f $NEW/../../spec.sh ]; then
|
||||
. $NEW/../../spec.sh
|
||||
elif [ -f $OLD/spec.sh ]; then
|
||||
. $OLD/spec.sh
|
||||
elif [ -f $OLD/../../spec.sh ]; then
|
||||
. $OLD/../../spec.sh
|
||||
else
|
||||
echo "Unable to find spec.sh"
|
||||
echo "Giving up"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export COMPARE_ROOT=/tmp/cimages.$USER/objects
|
||||
mkdir -p $COMPARE_ROOT
|
||||
|
||||
(${CD} $OLD && ${FIND} . -name '*.o') > $COMPARE_ROOT/list.old
|
||||
(${CD} $NEW && ${FIND} . -name '*.o') > $COMPARE_ROOT/list.new
|
||||
|
||||
# On macosx JobjC is build in both i386 and x86_64 variant (universial binary)
|
||||
# but new build only builds the x86_64
|
||||
# Remove the 386 variants from comparison...to avoid "false" positives
|
||||
${GREP} -v 'JObjC.dst/Objects-normal/i386' $COMPARE_ROOT/list.old > $COMPARE_ROOT/list.old.new
|
||||
${CP} $COMPARE_ROOT/list.old $COMPARE_ROOT/list.old.full
|
||||
${CP} $COMPARE_ROOT/list.old.new $COMPARE_ROOT/list.old
|
||||
|
||||
findnew() {
|
||||
arg_1=$1
|
||||
arg_2=$2
|
||||
|
||||
# special case 1 unpack-cmd => unpackexe
|
||||
arg_1=`${ECHO} $arg_1 | ${SED} 's!unpack-cmd!unpackexe!g'`
|
||||
arg_2=`${ECHO} $arg_2 | ${SED} 's!unpack-cmd!unpackexe!g'`
|
||||
|
||||
# special case 2 /JObjC.dst/ => /libjobjc/
|
||||
arg_1=`${ECHO} $arg_1 | ${SED} 's!/JObjC.dst/!/libjobjc/!g'`
|
||||
arg_2=`${ECHO} $arg_2 | ${SED} 's!/JObjC.dst/!/libjobjc/!g'`
|
||||
|
||||
full=`${ECHO} $arg_1 | ${SED} 's!\.!\\\.!g'`
|
||||
medium=`${ECHO} $arg_1 | ${SED} 's!.*/\([^/]*/[^/]*\)!\1!'`
|
||||
short=`${ECHO} $arg_2 | ${SED} 's!\.!\\\.!g'`
|
||||
if [ "`${GREP} -c "/$full" $COMPARE_ROOT/list.new`" -eq 1 ]
|
||||
then
|
||||
${ECHO} $NEW/$arg_1
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "`${GREP} -c "$medium" $COMPARE_ROOT/list.new`" -eq 1 ]
|
||||
then
|
||||
${GREP} "$medium" $COMPARE_ROOT/list.new
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "`${GREP} -c "/$short" $COMPARE_ROOT/list.new`" -eq 1 ]
|
||||
then
|
||||
${GREP} "/$short" $COMPARE_ROOT/list.new
|
||||
return
|
||||
fi
|
||||
|
||||
# old style has "dir" before obj{64}
|
||||
dir=`${ECHO} $arg_1 | ${SED} 's!.*/\([^/]*\)/obj[64]*.*!\1!g'`
|
||||
if [ -n "$dir" -a "$dir" != "$arg_1" ]
|
||||
then
|
||||
if [ "`${GREP} $dir $COMPARE_ROOT/list.new | ${GREP} -c "/$short"`" -eq 1 ]
|
||||
then
|
||||
${GREP} $dir $COMPARE_ROOT/list.new | ${GREP} "/$short"
|
||||
return
|
||||
fi
|
||||
|
||||
# Try with lib$dir/
|
||||
if [ "`${GREP} "lib$dir/" $COMPARE_ROOT/list.new | ${GREP} -c "/$short"`" -eq 1 ]
|
||||
then
|
||||
${GREP} "lib$dir/" $COMPARE_ROOT/list.new | ${GREP} "/$short"
|
||||
return
|
||||
fi
|
||||
|
||||
# Try with $dir_objs
|
||||
if [ "`${GREP} "${dir}_objs" $COMPARE_ROOT/list.new | ${GREP} -c "/$short"`" -eq 1 ]
|
||||
then
|
||||
${GREP} "${dir}_objs" $COMPARE_ROOT/list.new | ${GREP} "/$short"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
# check for some specifics...
|
||||
for i in demo hotspot jobjc
|
||||
do
|
||||
if [ "`${ECHO} $full | ${GREP} -c $i`" -gt 0 ]
|
||||
then
|
||||
if [ "`${GREP} $i $COMPARE_ROOT/list.new | ${GREP} -c "/$short"`" -eq 1 ]
|
||||
then
|
||||
${GREP} $i $COMPARE_ROOT/list.new | ${GREP} "/$short"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# check for specific demo
|
||||
demo=`${ECHO} $arg_1 | ${SED} 's!.*/demo/jvmti/\([^/]*\)/.*!\1!g'`
|
||||
if [ -n "$demo" -a "$dir" != "$demo" ]
|
||||
then
|
||||
if [ "`${GREP} $demo $COMPARE_ROOT/list.new | ${GREP} -c "/$short"`" -eq 1 ]
|
||||
then
|
||||
${GREP} $demo $COMPARE_ROOT/list.new | ${GREP} "/$short"
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
compare() {
|
||||
old=$1
|
||||
new=$2
|
||||
${DIFF} $old $new > /dev/null
|
||||
res=$?
|
||||
if [ $res -eq 0 ]
|
||||
then
|
||||
${ECHO} 0
|
||||
return
|
||||
fi
|
||||
|
||||
# check if stripped objects gives equality
|
||||
${CP} $old $COMPARE_ROOT/`basename $old`.old
|
||||
${CP} $new $COMPARE_ROOT/`basename $old`.new
|
||||
${POST_STRIP_CMD} $COMPARE_ROOT/`basename $old`.old $COMPARE_ROOT/`basename $old`.new > /dev/null 2>&1
|
||||
${DIFF} $COMPARE_ROOT/`basename $old`.old $COMPARE_ROOT/`basename $old`.new > /dev/null
|
||||
res=$?
|
||||
${RM} $COMPARE_ROOT/`basename $old`.old $COMPARE_ROOT/`basename $old`.new
|
||||
if [ $res -eq 0 ]
|
||||
then
|
||||
${ECHO} S
|
||||
return
|
||||
fi
|
||||
|
||||
name=`basename $1 | ${SED} 's!\.o!!'`
|
||||
cntold=`strings $old | ${GREP} -c $name`
|
||||
cntnew=`strings $new | ${GREP} -c $name`
|
||||
|
||||
if [ $cntold -gt 0 -a $cntnew -gt 0 ]
|
||||
then
|
||||
${ECHO} F
|
||||
return
|
||||
fi
|
||||
|
||||
${ECHO} 1
|
||||
}
|
||||
|
||||
for F in `${CAT} $COMPARE_ROOT/list.old`
|
||||
do
|
||||
if [ "${IGNORE}" ] && [ "`${ECHO} $F | ${GREP} ${IGNORE}`" ]
|
||||
then
|
||||
#
|
||||
# skip ignored files
|
||||
#
|
||||
continue;
|
||||
fi
|
||||
|
||||
if [ "$PATTERN" ] && [ `${ECHO} $F | ${GREP} -c $PATTERN` -eq 0 ]
|
||||
then
|
||||
continue;
|
||||
fi
|
||||
|
||||
f=`basename $F`
|
||||
o=$OLD/$F
|
||||
n=`findnew $F $f`
|
||||
|
||||
if [ "$n" ]
|
||||
then
|
||||
n="$NEW/$n"
|
||||
${ECHO} `compare $o $n` : $f : $o : $n
|
||||
else
|
||||
${ECHO} "- : $f : $o "
|
||||
fi
|
||||
done
|
@ -177,40 +177,44 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
PERM="gstat -c%a"
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
PERM=
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
PERM="stat -f%p"
|
||||
elif [ "`uname`" == "Linux" ]; then
|
||||
PERM="stat -c%A"
|
||||
else
|
||||
PERM="stat -c%a"
|
||||
fi
|
||||
echo -n Permissions...
|
||||
found=""
|
||||
for f in `cd $OLD && find . -type f`
|
||||
do
|
||||
if [ ! -f ${OLD}/$f ]; then continue; fi
|
||||
if [ ! -f ${NEW}/$f ]; then continue; fi
|
||||
OP=`ls -l ${OLD}/$f | awk '{printf("%.10s\n", $1);}'`
|
||||
NP=`ls -l ${NEW}/$f | awk '{printf("%.10s\n", $1);}'`
|
||||
if [ "$OP" != "$NP" ]
|
||||
then
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
printf "\told: ${OP} new: ${NP}\t$f\n"
|
||||
fi
|
||||
|
||||
if [ "${PERM}" ]
|
||||
then
|
||||
echo -n Permissions...
|
||||
found=""
|
||||
for f in `cd $OLD && find . -type f`
|
||||
do
|
||||
if [ ! -f ${OLD}/$f ]; then continue; fi
|
||||
if [ ! -f ${NEW}/$f ]; then continue; fi
|
||||
OP=`${PERM} ${OLD}/$f`
|
||||
NP=`${PERM} ${NEW}/$f`
|
||||
if [ "$OP" != "$NP" ]
|
||||
OF=`cd ${OLD} && file $f`
|
||||
NF=`cd ${NEW} && file $f`
|
||||
if [ "$f" = "./src.zip" ]
|
||||
then
|
||||
if [ "`echo $OF | grep -ic zip`" -gt 0 -a "`echo $NF | grep -ic zip`" -gt 0 ]
|
||||
then
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
printf "\told: ${OP} new: ${NP}\t$f\n"
|
||||
# the way we produces zip-files make it so that directories are stored in old file
|
||||
# but not in new (only files with full-path)
|
||||
# this makes file-5.09 report them as different
|
||||
continue;
|
||||
fi
|
||||
done
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OF" != "$NF" ]
|
||||
then
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
printf "\tFILE: old: ${OF} new: ${NF}\t$f\n"
|
||||
fi
|
||||
done
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
|
||||
GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
|
||||
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
|
||||
! -name "ct.sym" \
|
||||
! -name "ct.sym" ! -name "*.diz" \
|
||||
| grep -v "./bin/" | sort | $FILTER)
|
||||
echo General files...
|
||||
for f in $GENERAL_FILES
|
||||
|
@ -49,21 +49,24 @@ then
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
NM=gnm
|
||||
STAT="gstat -c%s"
|
||||
if [ -f "`which nm`" ]; then
|
||||
NM=nm
|
||||
elif [ -f "`which gnm`" ]; then
|
||||
NM=gnm
|
||||
else
|
||||
echo "No nm command found"
|
||||
exit 10
|
||||
fi
|
||||
LDD=ldd
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
|
||||
NM_ARGS=/exports
|
||||
STAT="stat -c%s"
|
||||
LDD=
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
NM=nm
|
||||
STAT="stat -f%z"
|
||||
LDD="otool -L"
|
||||
else
|
||||
NM=nm
|
||||
STAT="stat -c%s"
|
||||
LDD=ldd
|
||||
fi
|
||||
|
||||
@ -79,8 +82,8 @@ fi
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
OLD_SIZE=$($STAT "$OLD")
|
||||
NEW_SIZE=$($STAT "$NEW")
|
||||
OLD_SIZE=$(ls -l "$OLD" | awk '{ print $5 }')
|
||||
NEW_SIZE=$(ls -l "$NEW" | awk '{ print $5 }')
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
|
@ -72,7 +72,11 @@ else
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
DIFF=gdiff
|
||||
if [ -f "`which gdiff`" ]; then
|
||||
DIFF=gdiff
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
|
@ -53,21 +53,27 @@ then
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
NM=gnm
|
||||
STAT="gstat -c%s"
|
||||
if [ -f "`which gnm`" ]; then
|
||||
NM=gnm
|
||||
# Jonas 2012-05-29: solaris native nm produces radically different output than gnm
|
||||
# so if using that...we need different filter than "cut -f 2-"
|
||||
#
|
||||
elif [ -f "`which nm`" ]; then
|
||||
NM=nm
|
||||
else
|
||||
echo "No nm command found"
|
||||
exit 10
|
||||
fi
|
||||
LDD=ldd
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
|
||||
NM_ARGS=/exports
|
||||
STAT="stat -c%s"
|
||||
LDD=
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
NM=nm
|
||||
STAT="stat -f%z"
|
||||
LDD="otool -L"
|
||||
else
|
||||
NM=nm
|
||||
STAT="stat -c%s"
|
||||
LDD=ldd
|
||||
fi
|
||||
|
||||
@ -83,8 +89,8 @@ fi
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
OLD_SIZE=$($STAT "$OLD")
|
||||
NEW_SIZE=$($STAT "$NEW")
|
||||
OLD_SIZE=$(ls -l "$OLD" | awk '{ print $5 }')
|
||||
NEW_SIZE=$(ls -l "$NEW" | awk '{ print $5 }')
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
@ -122,8 +128,8 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OLD_SYMBOLS=$COMPARE_ROOT/$OLD_NAME.old
|
||||
NEW_SYMBOLS=$COMPARE_ROOT/$NEW_NAME.new
|
||||
OLD_SYMBOLS=$COMPARE_ROOT/nm.$OLD_NAME.old
|
||||
NEW_SYMBOLS=$COMPARE_ROOT/nm.$NEW_NAME.new
|
||||
|
||||
mkdir -p $(dirname $OLD_SYMBOLS)
|
||||
mkdir -p $(dirname $NEW_SYMBOLS)
|
||||
|
@ -56,10 +56,10 @@ define add_idl_package
|
||||
$4_OLDIMPLBASE_MSG:=with -oldImplBase
|
||||
endif
|
||||
$5 : $4
|
||||
mkdir -p $3/$$($4_TMPDIR)
|
||||
rm -rf $3/$$($4_TMPDIR)
|
||||
mkdir -p $(dir $5)
|
||||
echo Compiling IDL $(patsubst $2/%,%,$4)
|
||||
$(MKDIR) -p $3/$$($4_TMPDIR)
|
||||
$(RM) -rf $3/$$($4_TMPDIR)
|
||||
$(MKDIR) -p $(dir $5)
|
||||
$(ECHO) Compiling IDL $(patsubst $2/%,%,$4)
|
||||
$8 -td $3/$$($4_TMPDIR) \
|
||||
-i $2/org/omg/CORBA \
|
||||
-i $2/org/omg/PortableInterceptor \
|
||||
@ -69,10 +69,10 @@ define add_idl_package
|
||||
$$($4_OLDIMPLBASE) \
|
||||
$(PREFIXES) \
|
||||
$4
|
||||
rm -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
|
||||
cp -rp $3/$$($4_TMPDIR)/* $3
|
||||
(cd $3/$$($4_TMPDIR); find . -type f | sed 's!\./!$3/!g' | awk '{ print $$$$1 ": $4" }' > $5)
|
||||
rm -rf $3/$$($4_TMPDIR)
|
||||
$(RM) -f $$(addprefix $3/$$($4_TMPDIR)/,$6)
|
||||
$(CP) -rp $3/$$($4_TMPDIR)/* $3
|
||||
($(CD) $3/$$($4_TMPDIR); find . -type f | sed 's!\./!$3/!g' | awk '{ print $$$$1 ": $4" }' > $5)
|
||||
$(RM) -rf $3/$$($4_TMPDIR)
|
||||
endef
|
||||
|
||||
define SetupIdlCompilation
|
||||
@ -87,11 +87,13 @@ $(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
|
||||
|
||||
# Remove any relative addressing in the paths.
|
||||
$1_SRC := $$(abspath $$($1_SRC))
|
||||
$1_BIN := $$(abspath $$($1_BIN))
|
||||
# Find all existing java files and existing class files.
|
||||
$$(shell mkdir -p $$($1_SRC) $$($1_BIN))
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN))
|
||||
$1_SRCS := $$(shell find $$($1_SRC) -name "*.idl")
|
||||
$1_BINS := $$(shell find $$($1_BIN) -name "*.java")
|
||||
# Prepend the source/bin path to the filter expressions.
|
||||
@ -111,4 +113,3 @@ $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(
|
||||
endef
|
||||
|
||||
.SUFFIXES: .java .class .package
|
||||
|
||||
|
@ -94,6 +94,7 @@ define SetupJavaCompiler
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
|
||||
|
||||
ifeq ($$($1_MODE),MULTI_CORE_CONCURRENT)
|
||||
ifneq (,$$($1_SERVER_DIR))
|
||||
@ -130,6 +131,7 @@ define SetupArchive
|
||||
# SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically
|
||||
# added to the archive.
|
||||
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
|
||||
# CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
@ -143,6 +145,7 @@ define SetupArchive
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
$(if $(15),$1_$(strip $(15)))
|
||||
$(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
|
||||
|
||||
$1_JARMAIN:=$(strip $$($1_JARMAIN))
|
||||
$1_JARNAME:=$$(notdir $$($1_JAR))
|
||||
@ -243,6 +246,16 @@ define SetupArchive
|
||||
($(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.
|
||||
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
|
||||
|
||||
ifneq (,$$($1_CHECK_COMPRESS_JAR))
|
||||
$1_JAR_CREATE_OPTIONS := c0fm
|
||||
ifeq ($(COMPRESS_JARS), true)
|
||||
$1_JAR_CREATE_OPTIONS := cfm
|
||||
endif
|
||||
else
|
||||
$1_JAR_CREATE_OPTIONS := cfm
|
||||
endif
|
||||
|
||||
# Here is the rule that creates/updates the jar file.
|
||||
$$($1_JAR) : $2 $$($1_ALL_SRC)
|
||||
$(MKDIR) -p $$($1_BIN)
|
||||
@ -283,7 +296,7 @@ define SetupArchive
|
||||
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) true ; \
|
||||
fi ; \
|
||||
else \
|
||||
$(ECHO) Creating $$($1_NAME) && $(JAR) cfm $$@ $$($1_MANIFEST_FILE) && \
|
||||
$(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) && \
|
||||
$$($1_SCAPTURE_CONTENTS) \
|
||||
$$($1_SCAPTURE_METAINF) \
|
||||
$$($1_SUPDATE_CONTENTS) \
|
||||
@ -311,6 +324,7 @@ define SetupZipArchive
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk))
|
||||
|
||||
# Find all files in the source tree.
|
||||
$1_SUFFIX_FILTER := $$(patsubst %,-o -name $(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
|
||||
@ -648,6 +662,7 @@ define SetupJavaCompilation
|
||||
$(if $(12),$1_$(strip $(12)))
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
$(if $(15),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
|
||||
|
||||
# Extract the info from the java compiler setup.
|
||||
$1_MODE := $$($$($1_SETUP)_MODE)
|
||||
@ -688,6 +703,12 @@ $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))))
|
||||
@ -799,6 +820,12 @@ ifeq ($$($1_MODE),SINGLE_THREADED_BATCH)
|
||||
$(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
|
||||
@ -890,5 +917,3 @@ ifneq (,$$($1_SRCZIP))
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
|
||||
|
@ -138,6 +138,7 @@ endef
|
||||
|
||||
# Hook to be called as the very first thing when running a normal build
|
||||
define AtRootMakeStart
|
||||
$(if $(findstring -j,$(MAKEFLAGS)), $(error make -j is not supported, use make JOBS=n))
|
||||
$(call PrintStartMessage)
|
||||
$(call StartTimer)
|
||||
endef
|
||||
|
185
common/makefiles/MakeHelpers.gmk
Normal file
185
common/makefiles/MakeHelpers.gmk
Normal file
@ -0,0 +1,185 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
################################################################
|
||||
#
|
||||
# This file contains helper functions for the top-level Makefile that does
|
||||
# not depend on the spec.gmk file having been read. (The purpose of this
|
||||
# file is ju to avoid cluttering the top-level Makefile.)
|
||||
#
|
||||
################################################################
|
||||
|
||||
ifndef _MAKEHELPERS_GMK
|
||||
_MAKEHELPERS_GMK := 1
|
||||
|
||||
##############################
|
||||
# Stuff to run at include time
|
||||
##############################
|
||||
|
||||
# Find out which variables were passed explicitely on the make command line. These
|
||||
# will be passed on to sub-makes, overriding spec.gmk settings.
|
||||
MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)=$($(var)))
|
||||
|
||||
list_alt_overrides_with_origins=$(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
|
||||
list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
|
||||
|
||||
##############################
|
||||
# Functions
|
||||
##############################
|
||||
|
||||
define fatal-error
|
||||
# If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
|
||||
$$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue))
|
||||
endef
|
||||
|
||||
define ParseLogLevel
|
||||
ifeq ($$(origin VERBOSE),undefined)
|
||||
# Setup logging according to LOG (but only if VERBOSE is not given)
|
||||
ifeq ($$(LOG),)
|
||||
# Set LOG to "warn" as default if not set (and no VERBOSE given)
|
||||
LOG=warn
|
||||
endif
|
||||
ifeq ($$(LOG),warn)
|
||||
VERBOSE=-s
|
||||
else ifeq ($$(LOG),info)
|
||||
VERBOSE=
|
||||
else ifeq ($$(LOG),debug)
|
||||
VERBOSE=
|
||||
else ifeq ($$(LOG),trace)
|
||||
VERBOSE=-d -p
|
||||
else
|
||||
$$(info Error: LOG must be one of: warn, info, debug or trace.)
|
||||
$$(eval $$(call fatal-error))
|
||||
endif
|
||||
else
|
||||
ifneq ($$(LOG),)
|
||||
# We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves,
|
||||
# but complain if this is the top-level make call.
|
||||
ifeq ($$(MAKELEVEL),0)
|
||||
$$(info Cannot use LOG=$$(LOG) and VERBOSE=$$(VERBOSE) at the same time. Choose one.)
|
||||
$$(eval $$(call fatal-error))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
# TODO: Fix duplication in MakeBase.gmk
|
||||
define SetupLogging
|
||||
ifneq ($(findstring $(LOG),debug trace),)
|
||||
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
|
||||
OLD_SHELL:=$$(SHELL)
|
||||
SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
|
||||
endif
|
||||
endef
|
||||
|
||||
define ParseConfAndSpec
|
||||
ifneq ($$(origin SPEC),undefined)
|
||||
# We have been given a SPEC, check that it works out properly
|
||||
ifeq ($$(wildcard $$(SPEC)),)
|
||||
$$(info Cannot locate spec.gmk, given by SPEC=$$(SPEC))
|
||||
$$(eval $$(call fatal-error))
|
||||
endif
|
||||
ifneq ($$(origin CONF),undefined)
|
||||
# We also have a CONF argument. This is OK only if this is a repeated call by ourselves,
|
||||
# but complain if this is the top-level make call.
|
||||
ifeq ($$(MAKELEVEL),0)
|
||||
$$(info Cannot use CONF=$$(CONF) and SPEC=$$(SPEC) at the same time. Choose one.)
|
||||
$$(eval $$(call fatal-error))
|
||||
endif
|
||||
endif
|
||||
# ... OK, we're satisfied, we'll use this SPEC later on
|
||||
else
|
||||
# Find all spec.gmk files in the build output directory
|
||||
output_dir=$$(root_dir)/build
|
||||
all_spec_files=$$(wildcard $$(output_dir)/*/spec.gmk)
|
||||
ifeq ($$(all_spec_files),)
|
||||
$$(info No configurations found for $$(root_dir)! Please run configure to create a configuration.)
|
||||
$$(eval $$(call fatal-error))
|
||||
endif
|
||||
# Extract the configuration names from the path
|
||||
all_confs=$$(patsubst %/spec.gmk,%,$$(patsubst $$(output_dir)/%,%,$$(all_spec_files)))
|
||||
|
||||
ifneq ($$(origin CONF),undefined)
|
||||
# User have given a CONF= argument.
|
||||
ifeq ($$(CONF),)
|
||||
# If given CONF=, match all configurations
|
||||
matching_confs=$$(strip $$(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
matching_confs=$$(strip $$(foreach var,$$(all_confs),$$(if $$(findstring $$(CONF),$$(var)),$$(var))))
|
||||
endif
|
||||
ifeq ($$(matching_confs),)
|
||||
$$(info No configurations found matching CONF=$$(CONF))
|
||||
$$(info Available configurations:)
|
||||
$$(foreach var,$$(all_confs),$$(info * $$(var)))
|
||||
$$(eval $$(call fatal-error))
|
||||
else
|
||||
ifeq ($$(words $$(matching_confs)),1)
|
||||
$$(info Building '$$(matching_confs)' (matching CONF=$$(CONF)))
|
||||
else
|
||||
$$(info Building the following configurations (matching CONF=$$(CONF)):)
|
||||
$$(foreach var,$$(matching_confs),$$(info * $$(var)))
|
||||
endif
|
||||
endif
|
||||
|
||||
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
|
||||
SPEC=$$(addsuffix /spec.gmk,$$(addprefix $$(output_dir)/,$$(matching_confs)))
|
||||
else
|
||||
# No CONF or SPEC given, check the available configurations
|
||||
ifneq ($$(words $$(all_spec_files)),1)
|
||||
$$(info No CONF or SPEC given, but more than one spec.gmk found in $$(output_dir).)
|
||||
$$(info Available configurations:)
|
||||
$$(foreach var,$$(all_confs),$$(info * $$(var)))
|
||||
$$(info Please retry building with CONF=<config> or SPEC=<specfile>)
|
||||
$$(eval $$(call fatal-error))
|
||||
endif
|
||||
|
||||
# We found exactly one configuration, use it
|
||||
SPEC=$$(strip $$(all_spec_files))
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
|
||||
define CheckEnvironment
|
||||
# Find all environment or command line variables that begin with ALT.
|
||||
$(if $(list_alt_overrides),
|
||||
@$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n"
|
||||
@$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n"
|
||||
@$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n\n"
|
||||
)
|
||||
endef
|
||||
|
||||
define PrintStartMessage
|
||||
$(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS))
|
||||
$(call CheckEnvironment)
|
||||
@$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'"
|
||||
endef
|
||||
|
||||
define PrintEndMessage
|
||||
@$(ECHO) "Finished building OpenJDK for target '$@'"
|
||||
$(call CheckEnvironment)
|
||||
endef
|
||||
|
||||
endif # _MAKEHELPERS_GMK
|
@ -26,241 +26,128 @@
|
||||
# This must be the first rule
|
||||
default: all
|
||||
|
||||
# Find out which variables were passed explicitely on the make command line. These
|
||||
# will be passed on to sub-makes, overriding spec.gmk settings.
|
||||
MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)=$($(var)))
|
||||
|
||||
define fatal-error
|
||||
# If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
|
||||
$$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue))
|
||||
endef
|
||||
|
||||
ifeq ($(origin VERBOSE),undefined)
|
||||
# Setup logging according to LOG (but only if VERBOSE is not given)
|
||||
ifeq ($(LOG),)
|
||||
# Set LOG to "warn" as default if not set (and no VERBOSE given)
|
||||
LOG=warn
|
||||
endif
|
||||
ifeq ($(LOG),warn)
|
||||
VERBOSE=-s
|
||||
else ifeq ($(LOG),info)
|
||||
VERBOSE=
|
||||
else ifeq ($(LOG),debug)
|
||||
VERBOSE=
|
||||
else ifeq ($(LOG),trace)
|
||||
VERBOSE=-d -p
|
||||
else
|
||||
$(info Error: LOG must be one of: warn, info, debug or trace.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
else
|
||||
ifneq ($(LOG),)
|
||||
# We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves,
|
||||
# but complain if this is the top-level make call.
|
||||
ifeq ($(MAKELEVEL),0)
|
||||
$(info Cannot use LOG=$(LOG) and VERBOSE=$(VERBOSE) at the same time. Choose one.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# TODO: Fix duplication in MakeBase.gmk
|
||||
define SetupLogging
|
||||
ifneq ($(findstring $(LOG),debug trace),)
|
||||
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
|
||||
OLD_SHELL:=$$(SHELL)
|
||||
SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call SetupLogging))
|
||||
|
||||
# Find all environment or command line variables that begin with ALT.
|
||||
list_alt_overrides_with_origins = $(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
|
||||
list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
|
||||
|
||||
# Locate this Makefile
|
||||
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
|
||||
makefile_path=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
|
||||
makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
|
||||
else
|
||||
makefile_path=$(lastword $(MAKEFILE_LIST))
|
||||
makefile_path:=$(lastword $(MAKEFILE_LIST))
|
||||
endif
|
||||
root_dir=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
|
||||
output_dir=$(root_dir)/build
|
||||
root_dir:=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
|
||||
|
||||
ifneq ($(origin SPEC),undefined)
|
||||
# We have been given a SPEC, check that it works out properly
|
||||
ifeq ($(wildcard $(SPEC)),)
|
||||
$(info Cannot locate spec.gmk, given by SPEC=$(SPEC))
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
ifneq ($(origin CONF),undefined)
|
||||
# We also have a CONF argument. This is OK only if this is a repeated call by ourselves,
|
||||
# but complain if this is the top-level make call.
|
||||
ifeq ($(MAKELEVEL),0)
|
||||
$(info Cannot use CONF=$(CONF) and SPEC=$(SPEC) at the same time. Choose one.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
endif
|
||||
# ... OK, we're satisfied, we'll use this SPEC later on
|
||||
else
|
||||
# Find all spec.gmk files in the build output directory
|
||||
all_spec_files=$(wildcard $(output_dir)/*/spec.gmk)
|
||||
ifeq ($(all_spec_files),)
|
||||
$(info No configurations found for $(root_dir)! Please run configure to create a configuration.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
# Extract the configuration names from the path
|
||||
all_confs=$(patsubst %/spec.gmk,%,$(patsubst $(output_dir)/%,%,$(all_spec_files)))
|
||||
# ... and then we can include our helper functions
|
||||
include $(dir $(makefile_path))/MakeHelpers.gmk
|
||||
|
||||
ifneq ($(origin CONF),undefined)
|
||||
# User have given a CONF= argument.
|
||||
ifeq ($(CONF),)
|
||||
# If given CONF=, match all configurations
|
||||
matching_confs=$(strip $(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
matching_confs=$(strip $(foreach var,$(all_confs),$(if $(findstring $(CONF),$(var)),$(var))))
|
||||
endif
|
||||
ifeq ($(matching_confs),)
|
||||
$(info No configurations found matching CONF=$(CONF))
|
||||
$(info Available configurations:)
|
||||
$(foreach var,$(all_confs),$(info * $(var)))
|
||||
$(eval $(call fatal-error))
|
||||
else
|
||||
ifeq ($(words $(matching_confs)),1)
|
||||
$(info Building '$(matching_confs)' (matching CONF=$(CONF)))
|
||||
else
|
||||
$(info Building the following configurations (matching CONF=$(CONF)):)
|
||||
$(foreach var,$(matching_confs),$(info * $(var)))
|
||||
endif
|
||||
endif
|
||||
$(eval $(call ParseLogLevel))
|
||||
$(eval $(call SetupLogging))
|
||||
$(eval $(call ParseConfAndSpec))
|
||||
|
||||
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
|
||||
SPEC=$(addsuffix /spec.gmk,$(addprefix $(output_dir)/,$(matching_confs)))
|
||||
else
|
||||
# No CONF or SPEC given, check the available configurations
|
||||
ifneq ($(words $(all_spec_files)),1)
|
||||
$(info No CONF or SPEC given, but more than one spec.gmk found in $(output_dir).)
|
||||
$(info Available configurations:)
|
||||
$(foreach var,$(all_confs),$(info * $(var)))
|
||||
$(info Please retry building with CONF=<config> or SPEC=<specfile>)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
|
||||
# We found exactly one configuration, use it
|
||||
SPEC=$(strip $(all_spec_files))
|
||||
endif
|
||||
# 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)
|
||||
# We have multiple configurations to build, call make repeatedly
|
||||
all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean:
|
||||
### We have multiple configurations to build, call make repeatedly
|
||||
all jdk hotspot jaxws jaxp corba langtools install images clean dist-clean:
|
||||
@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@ $(MAKE_ARGS)) &&) true
|
||||
|
||||
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean
|
||||
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images clean dist-clean
|
||||
|
||||
else
|
||||
# This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
|
||||
### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
|
||||
|
||||
# Now load the spec
|
||||
-include $(SPEC)
|
||||
include $(SPEC)
|
||||
|
||||
# Load the vital tools for all the makefiles.
|
||||
-include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
|
||||
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
|
||||
|
||||
# Remove any build.log from a previous run
|
||||
### Clean up from previous run
|
||||
|
||||
# Remove any build.log from a previous run, if they exist
|
||||
ifneq (,$(BUILD_LOG))
|
||||
$(shell $(RM) $(BUILD_LOG))
|
||||
ifneq (,$(BUILD_LOG_PREVIOUS))
|
||||
# Rotate old log
|
||||
$(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
|
||||
$(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
|
||||
else
|
||||
$(shell $(RM) $(BUILD_LOG) 2> /dev/null)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
ifneq (,$(JAVAC_SERVERS))
|
||||
$(shell mkdir -p $(JAVAC_SERVERS) && rm -rf $(JAVAC_SERVERS)/*)
|
||||
endif
|
||||
# Reset the build timers.
|
||||
$(eval $(call ResetTimers))
|
||||
# Clean out any notifications from the previous build.
|
||||
$(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
|
||||
|
||||
# If make was called explicitely with -j, don't add a -j ourself to sub-makes, since
|
||||
# this will be inherited automatically by make. Otherwise use our default for sub-makes.
|
||||
# The -j in MAKEFLAGS is only visible when executing a recipe, hence this macro.
|
||||
define GetMakeJobFlag
|
||||
$(if $(findstring -j,$(MAKEFLAGS)),,-j$(NUM_CORES))
|
||||
endef
|
||||
# Reset the build timers.
|
||||
$(eval $(call ResetTimers))
|
||||
|
||||
define CheckEnvironment
|
||||
$(if $(list_alt_overrides),
|
||||
@$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n"
|
||||
@$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n"
|
||||
@$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n"
|
||||
)
|
||||
endef
|
||||
|
||||
define PrintStartMessage
|
||||
$(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS))
|
||||
$(call CheckEnvironment)
|
||||
@$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'"
|
||||
endef
|
||||
|
||||
define PrintEndMessage
|
||||
@$(ECHO) "Finished building OpenJDK for target '$@'"
|
||||
$(call CheckEnvironment)
|
||||
endef
|
||||
### Main targets
|
||||
|
||||
all: jdk
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
@$(call AtRootMakeEnd)
|
||||
|
||||
langtools: start-make
|
||||
langtools: start-make langtools-only
|
||||
langtools-only:
|
||||
@$(call MakeStart,langtools,all)
|
||||
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(LANGTOOLS_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,langtools,all)
|
||||
|
||||
corba: langtools
|
||||
corba: langtools corba-only
|
||||
corba-only:
|
||||
@$(call MakeStart,corba,all)
|
||||
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,corba,all)
|
||||
|
||||
jaxp: langtools
|
||||
jaxp: langtools jaxp-only
|
||||
jaxp-only:
|
||||
@$(call MakeStart,jaxp,all)
|
||||
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,jaxp,all)
|
||||
|
||||
jaxws: langtools jaxp
|
||||
jaxws: langtools jaxp jaxws-only
|
||||
jaxws-only:
|
||||
@$(call MakeStart,jaxws,all)
|
||||
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,jaxws,all)
|
||||
|
||||
hotspot: langtools
|
||||
hotspot: langtools hotspot-only
|
||||
hotspot-only:
|
||||
@$(call MakeStart,hotspot,all)
|
||||
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,hotspot,all)
|
||||
|
||||
jdk: langtools corba jaxp jaxws hotspot
|
||||
jdk: langtools corba jaxp jaxws hotspot jdk-only
|
||||
jdk-only:
|
||||
@$(call MakeStart,jdk,all)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,jdk,all)
|
||||
|
||||
images install packages: source-tips start-make jdk langtools corba jaxp jaxws hotspot
|
||||
images: source-tips start-make jdk langtools corba jaxp jaxws hotspot images-only
|
||||
images-only:
|
||||
@$(call MakeStart,jdk-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(JDK_MAKE_ARGS) $(MAKE_ARGS) images)
|
||||
@$(call MakeFinish,jdk-images,$@)
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
@$(call AtRootMakeEnd)
|
||||
|
||||
old-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot
|
||||
@$(call MakeStart,jdk-old-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
|
||||
@$(call MakeFinish,old-jdk-images,$@)
|
||||
install: source-tips start-make jdk langtools corba jaxp jaxws hotspot install-only
|
||||
install-only:
|
||||
@$(call MakeStart,jdk-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(JDK_MAKE_ARGS) $(MAKE_ARGS) install)
|
||||
@$(call MakeFinish,jdk-images,$@)
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
@$(call AtRootMakeEnd)
|
||||
|
||||
start-make:
|
||||
@$(call AtRootMakeStart)
|
||||
|
||||
.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-make
|
||||
.PHONY: jdk hotspot jaxws jaxp corba langtools install images start-make
|
||||
|
||||
test: start-make
|
||||
@$(call MakeStart,test,$(if $(TEST),$(TEST),all))
|
||||
@ -281,7 +168,7 @@ $(OUTPUT_ROOT)/source_tips: FRC
|
||||
|
||||
# Remove everything, except the output from configure.
|
||||
clean:
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | 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 `$(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`)
|
||||
@$(ECHO) Cleaned everything except the build configuration.
|
||||
.PHONY: clean
|
||||
|
||||
@ -292,7 +179,7 @@ dist-clean:
|
||||
.PHONY: dist-clean
|
||||
|
||||
clean-jdk:
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | \
|
||||
@(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 langtools | grep -v corba | grep -v jaxp | grep -v jaxws | grep -v hotspot`)
|
||||
@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)"
|
||||
.PHONY: clean
|
||||
|
@ -51,47 +51,55 @@ define add_native_source
|
||||
# param 5 = the c compiler
|
||||
# param 6 = the c++ flags to the compiler
|
||||
# param 7 = the c++ compiler
|
||||
# param 8 = the flags to the assembler
|
||||
|
||||
ifneq (,$$(filter %.c,$2))
|
||||
# Compile as a C file
|
||||
$1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS)
|
||||
$1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -c
|
||||
$1_$2_COMP=$5
|
||||
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
|
||||
else ifneq (,$$(filter %.m,$2))
|
||||
# Compile as a objective-c file
|
||||
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS)
|
||||
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -c
|
||||
$1_$2_COMP=$5
|
||||
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
|
||||
else ifneq (,$$(filter %.s,$2))
|
||||
# Compile as assembler file
|
||||
$1_$2_FLAGS=$8
|
||||
$1_$2_COMP=$(AS)
|
||||
$1_$2_DEP_FLAG:=
|
||||
else
|
||||
# Compile as a C++ file
|
||||
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS)
|
||||
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -c
|
||||
$1_$2_COMP=$7
|
||||
$1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
|
||||
endif
|
||||
# Generate the .o (.obj) file name and place it in the bin dir.
|
||||
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $2))))
|
||||
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $2)))))
|
||||
# Only continue if this object file hasn't been processed already. This lets the first found
|
||||
# source file override any other with the same name.
|
||||
ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
|
||||
$1_OBJS_SO_FAR+=$$($1_$2_OBJ)
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_$2_DEP)
|
||||
ifeq (,$$(filter %.s,$2))
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_$2_DEP)
|
||||
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
|
||||
-Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
|
||||
-Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
|
||||
endif
|
||||
endif
|
||||
|
||||
$$($1_$2_OBJ) : $2
|
||||
ifeq ($(COMPILER_TYPE),CC)
|
||||
$$(call COMPILING_MSG,$$(notdir $2))
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) -c $(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
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$$(call COMPILING_MSG,$$(notdir $2))
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) -c $(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
|
||||
endef
|
||||
@ -107,9 +115,9 @@ define SetupNativeCompilation
|
||||
# LDFLAGS_SUFFIX the linker flags to be added last on the commandline
|
||||
# typically the libraries linked to.
|
||||
# ARFLAGS the archiver flags to be used
|
||||
# BIN the directory where we store the object files
|
||||
# LIB the resulting library file
|
||||
# EXE the resulting exec file
|
||||
# OBJECT_DIR the directory where we store the object files
|
||||
# LIBRARY the resulting library file
|
||||
# PROGRAM the resulting exec file
|
||||
# INCLUDES only pick source from these directories
|
||||
# EXCLUDES do not pick source from these directories
|
||||
# INCLUDE_FILES only compile exactly these files!
|
||||
@ -118,6 +126,9 @@ define SetupNativeCompilation
|
||||
# RC_FLAGS flags for RC.
|
||||
# MAPFILE mapfile
|
||||
# REORDER reorder file
|
||||
# DEBUG_SYMBOLS add debug symbols (if configured on)
|
||||
# CC the compiler to use, default is $(CC)
|
||||
# LDEXE the linker to use for linking executables, default is $(LDEXE)
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
@ -137,13 +148,94 @@ define SetupNativeCompilation
|
||||
$(if $(18),$1_$(strip $(18)))
|
||||
$(if $(19),$1_$(strip $(19)))
|
||||
$(if $(20),$1_$(strip $(20)))
|
||||
$(if $(21),$1_$(strip $(21)))
|
||||
$(if $(22),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
|
||||
|
||||
ifneq (,$$($1_BIN))
|
||||
$$(error BIN has been replaced with OBJECT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_LIB))
|
||||
$$(error LIB has been replaced with LIBRARY)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_EXE))
|
||||
$$(error EXE has been replaced with PROGRAM)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_LIBRARY))
|
||||
ifeq (,$$($1_OUTPUT_DIR))
|
||||
$$(error LIBRARY requires OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY)))
|
||||
$$(error directory of LIBRARY should be specified using OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(SHARED_LIBRARY_SUFFIX),$$($1_LIBRARY)))
|
||||
$$(error LIBRARY should be specified without SHARED_LIBRARY_SUFFIX: $(SHARED_LIBRARY_SUFFIX))
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY)))
|
||||
$$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
|
||||
endif
|
||||
|
||||
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$(SHARED_LIBRARY_SUFFIX)
|
||||
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
|
||||
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_STATIC_LIBRARY))
|
||||
ifeq (,$$($1_OUTPUT_DIR))
|
||||
$$(error STATIC_LIBRARY requires OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_STATIC_LIBRARY),$(basename $$($1_STATIC_LIBRARY)))
|
||||
$$(error directory of STATIC_LIBRARY should be specified using OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(STATIC_LIBRARY_SUFFIX),$$($1_STATIC_LIBRARY)))
|
||||
$$(error STATIC_LIBRARY should be specified without STATIC_LIBRARY_SUFFIX: $(STATIC_LIBRARY_SUFFIX))
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY)))
|
||||
$$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
|
||||
endif
|
||||
|
||||
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$(STATIC_LIBRARY_SUFFIX)
|
||||
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_PROGRAM))
|
||||
ifeq (,$$($1_OUTPUT_DIR))
|
||||
$$(error PROGRAM requires OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_PROGRAM),$(basename $$($1_PROGRAM)))
|
||||
$$(error directory of PROGRAM should be specified using OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM)))
|
||||
$$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
|
||||
endif
|
||||
|
||||
$1_BASENAME:=$$($1_PROGRAM)$(EXE_SUFFIX)
|
||||
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
|
||||
|
||||
endif
|
||||
|
||||
ifeq (,$$($1_TARGET))
|
||||
$$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation)
|
||||
endif
|
||||
|
||||
ifeq (,$$($1_LANG))
|
||||
$$(error You have to specify LANG for native compilation $1)
|
||||
endif
|
||||
ifeq (C,$$($1_LANG))
|
||||
ifeq ($$($1_LDEXE),)
|
||||
$1_LDEXE:=$(LDEXE)
|
||||
endif
|
||||
$1_LD:=$(LD)
|
||||
$1_LDEXE:=$(LDEXE)
|
||||
else
|
||||
ifeq (C++,$$($1_LANG))
|
||||
$1_LD:=$(LDCXX)
|
||||
@ -153,8 +245,12 @@ define SetupNativeCompilation
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_CC),)
|
||||
$1_CC:=$(CC)
|
||||
endif
|
||||
|
||||
# Make sure the dirs exist.
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN) $$(dir $$($1_LIB)) $$(dir $$($1_EXE)))
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
|
||||
# Find all files in the source trees. Sort to remove duplicates.
|
||||
$1_ALL_SRCS := $$(sort $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f)))
|
||||
# Extract the C/C++ files.
|
||||
@ -163,7 +259,7 @@ define SetupNativeCompilation
|
||||
ifneq ($$($1_EXCLUDE_FILES),)
|
||||
$1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
|
||||
endif
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp %.m,$$($1_ALL_SRCS)))
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.s %.c %.cpp %.m,$$($1_ALL_SRCS)))
|
||||
ifneq (,$$(strip $$($1_INCLUDE_FILES)))
|
||||
$1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
|
||||
endif
|
||||
@ -171,7 +267,7 @@ define SetupNativeCompilation
|
||||
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
|
||||
endif
|
||||
# There can be only a single bin dir root, no need to foreach over the roots.
|
||||
$1_BINS := $$(wildcard $$($1_BIN)/*$(OBJ_SUFFIX))
|
||||
$1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
|
||||
# Now we have a list of all c/c++ files to compile: $$($1_SRCS)
|
||||
# and we have a list of all existing object files: $$($1_BINS)
|
||||
|
||||
@ -187,37 +283,36 @@ define SetupNativeCompilation
|
||||
|
||||
# Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
|
||||
# a reproducable order on the input files to the linker).
|
||||
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))
|
||||
$1 := $$($1_EXPECTED_OBJS)
|
||||
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS))))))))
|
||||
# Are there too many object files on disk? Perhaps because some source file was removed?
|
||||
$1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
|
||||
# Clean out the superfluous object files.
|
||||
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
|
||||
|
||||
# Pickup extra HOST_OS_API and/or PLATFORM dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(HOST_OS_API)) $$($1_CFLAGS_$(PLATFORM))
|
||||
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS))
|
||||
ifneq ($(DEBUG_LEVEL),release)
|
||||
# Pickup extra debug dependent variables for CFLAGS
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(HOST_OS_API)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(PLATFORM)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
else
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(HOST_OS_API)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(PLATFORM)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
endif
|
||||
|
||||
# Pickup extra HOST_OS_API and/or PLATFORM dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(HOST_OS_API)) $$($1_CXXFLAGS_$(PLATFORM))
|
||||
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
|
||||
ifneq ($(DEBUG_LEVEL),release)
|
||||
# Pickup extra debug dependent variables for CXXFLAGS
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(HOST_OS_API)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(PLATFORM)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
else
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(HOST_OS_API)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(PLATFORM)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_CXXFLAGS),)
|
||||
@ -232,33 +327,62 @@ define SetupNativeCompilation
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
|
||||
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))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_NONE)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_NONE)
|
||||
else ifeq (LOW, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_NORM)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_NORM)
|
||||
else ifeq (HIGH, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_HI)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_HI)
|
||||
else ifeq (HIGHEST, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_HIGHEST)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_HIGHEST)
|
||||
else ifneq (, $$($1_OPTIMIZATION))
|
||||
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
|
||||
# Now create a list of the packages that are about to compile. Used when sending source
|
||||
# in a batch to the compiler.
|
||||
$$(shell $(RM) $$($1_BIN)/_the.list_of_sources)
|
||||
$$(eval $$(call ListPathsSafelyNow,$1_SRCS,\n, >> $$($1_BIN)/_the.list_of_sources))
|
||||
$$(shell $(RM) $$($1_OBJECT_DIR)/_the.list_of_sources)
|
||||
$$(eval $$(call ListPathsSafelyNow,$1_SRCS,\n, >> $$($1_OBJECT_DIR)/_the.list_of_sources))
|
||||
|
||||
# Now call add_native_source for each source file we are going to compile.
|
||||
$$(foreach p,$$($1_SRCS),\
|
||||
$$(eval $$(call add_native_source,$1,$$p,$$($1_BIN),\
|
||||
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$(CC),\
|
||||
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX))))
|
||||
$$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR),\
|
||||
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC),\
|
||||
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS))))
|
||||
|
||||
# On windows we need to create a resource file
|
||||
ifeq ($(HOST_OS_API), winapi)
|
||||
ifeq ($(OPENJDK_TARGET_OS_API), winapi)
|
||||
ifneq (,$$($1_VERSIONINFO_RESOURCE))
|
||||
ifneq (,$$($1_LIB))
|
||||
$1_BASENAME:=$$(basename $$(notdir $$($1_LIB)))
|
||||
endif
|
||||
ifneq (,$$($1_EXE))
|
||||
$1_BASENAME:=$$(basename $$(notdir $$($1_EXE)))
|
||||
endif
|
||||
$1_RES:=$$($1_BIN)/$$($1_BASENAME).res
|
||||
$1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
|
||||
$$($1_RES): $$($1_VERSIONINFO_RESOURCE)
|
||||
$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
|
||||
endif
|
||||
ifneq (,$$($1_MANIFEST))
|
||||
$1_PROGRAM:=$$(basename $$(notdir $$($1_EXE)))
|
||||
$1_GEN_MANIFEST:=$$($1_BIN)/$$($1_PROGRAM).manifest
|
||||
$1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
|
||||
IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
|
||||
$$($1_GEN_MANIFEST): $$($1_MANIFEST)
|
||||
$(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@
|
||||
@ -266,54 +390,184 @@ define SetupNativeCompilation
|
||||
endif
|
||||
|
||||
# mapfile doesnt seem to be implemented on macosx (yet??)
|
||||
ifneq ($(HOST_OS),macosx)
|
||||
ifneq ($(HOST_OS),windows)
|
||||
$1_REAL_MAPFILE := $$($1_MAPFILE)
|
||||
ifneq ($(OPENJDK_TARGET_CPU),ppc)
|
||||
ifneq ($(OPENJDK_TARGET_CPU),arm)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS),windows)
|
||||
$1_REAL_MAPFILE:=$$($1_MAPFILE)
|
||||
ifneq (,$$($1_REORDER))
|
||||
$1_REAL_MAPFILE := $$($1_BIN)/mapfile
|
||||
$1_REAL_MAPFILE:=$$($1_OBJECT_DIR)/mapfile
|
||||
|
||||
$$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
|
||||
$$(MKDIR) -p $$(@D)
|
||||
$$(CP) $$($1_MAPFILE) $$@.tmp
|
||||
$$(SED) -e 's=OUTPUTDIR=$$($1_BIN)=' $$($1_REORDER) >> $$@.tmp
|
||||
$$(SED) -e 's=OUTPUTDIR=$$($1_OBJECT_DIR)=' $$($1_REORDER) >> $$@.tmp
|
||||
$$(MV) $$@.tmp $$@
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Pickup extra HOST_OS_API dependent variables (posix or winapi) and
|
||||
# Pickup extra OPENJDK_TARGET_OS_API dependent variables (posix or winapi) and
|
||||
# (linux,solaris,windows,bsd) for LDFLAGS and LDFLAGS_SUFFIX
|
||||
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(HOST_OS_API)) $$($1_LDFLAGS_$(PLATFORM))
|
||||
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(HOST_OS_API)) $$($1_LDFLAGS_SUFFIX_$(PLATFORM))
|
||||
$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))
|
||||
ifneq (,$$($1_REAL_MAPFILE))
|
||||
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
|
||||
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_LIB))
|
||||
ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$(notdir $$($1_LIB)))
|
||||
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE)
|
||||
$$(call LINKING_MSG,$$(notdir $$($1_LIB)))
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$($1_LIB) \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
else
|
||||
# Generating a static library, ie object file archive.
|
||||
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call ARCHIVING_MSG,$$(notdir $$($1_LIB)))
|
||||
$(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_LIB) $$($1_EXPECTED_OBJS) \
|
||||
$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
endif
|
||||
$1 := $$($1_TARGET)
|
||||
ifneq (,$$($1_LIBRARY))
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_EXTRA_LDFLAGS+="-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib"
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_DEBUG_SYMBOLS))
|
||||
ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_LIBRARY).pdb" \
|
||||
"-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map"
|
||||
endif
|
||||
|
||||
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/%
|
||||
$(CP) $$< $$@
|
||||
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||
# An empty section header has sh_addr == 0 and sh_size == 0.
|
||||
# This problem has only been seen on Solaris X64, but we call this tool
|
||||
# on all Solaris builds just in case.
|
||||
#
|
||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||
$(RM) $$@
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $$<
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $$(@F) $$<
|
||||
else # not solaris
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
|
||||
$(RM) $$@
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
||||
endif # Touch to not retrigger rule on rebuild
|
||||
$(TOUCH) $$@
|
||||
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES), 1)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET)
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_LIBRARY).map $$($1_LIBRARY).pdb
|
||||
else
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET) \
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||
endif
|
||||
else
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \
|
||||
$$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb
|
||||
else
|
||||
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE)
|
||||
$$(call LINKING_MSG,$$($1_BASENAME))
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
|
||||
$$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
|
||||
endif
|
||||
ifneq (,$$($1_EXE))
|
||||
|
||||
ifneq (,$$($1_STATIC_LIBRARY))
|
||||
# Generating a static library, ie object file archive.
|
||||
$$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call ARCHIVING_MSG,$$($1_LIBRARY))
|
||||
$(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \
|
||||
$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_PROGRAM))
|
||||
# A executable binary has been specified, setup the target for it.
|
||||
$$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
|
||||
$$(call LINKING_EXE_MSG,$$(notdir $$($1_EXE)))
|
||||
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_EXE) \
|
||||
ifneq (,$$($1_DEBUG_SYMBOLS))
|
||||
ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_PROGRAM).pdb" \
|
||||
"-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map"
|
||||
endif
|
||||
|
||||
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/%
|
||||
$(CP) $$< $$@
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||
# An empty section header has sh_addr == 0 and sh_size == 0.
|
||||
# This problem has only been seen on Solaris X64, but we call this tool
|
||||
# on all Solaris builds just in case.
|
||||
#
|
||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||
$(RM) $$@
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $$<
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $$(@F) $$<
|
||||
else # not solaris
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
|
||||
$(RM) $$@
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
||||
endif
|
||||
$(TOUCH) $$@
|
||||
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES), 1)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).diz : $$($1_TARGET)
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_PROGRAM).map $$($1_PROGRAM).pdb
|
||||
else
|
||||
$$($1_OBJECT_DIR)/$$(PROGRAM_PREFIX)$$($1_PROGRAM).diz : $$($1_TARGET) \
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo
|
||||
endif
|
||||
else
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \
|
||||
$$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb
|
||||
else
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
|
||||
$$(call LINKING_EXE_MSG,$$($1_BASENAME))
|
||||
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
|
||||
$$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
ifneq (,$$($1_GEN_MANIFEST))
|
||||
$(MT) -nologo /manifest $$($1_GEN_MANIFEST) /outputresource:$$@;#1
|
||||
endif
|
||||
|
||||
endif
|
||||
endef
|
||||
|
@ -42,6 +42,7 @@ define SetupRMICompilation
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupRMICompilation, please update RMICompilation.gmk))
|
||||
|
||||
|
||||
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic
|
@ -167,3 +167,4 @@ b8cbfb31139f820e5e094ba71449e58159fbe22e jdk8-b38
|
||||
cd879aff5d3cc1f58829aab3116880aa19525b78 jdk8-b43
|
||||
439d9bf8e4ff204cc89c9974c1515a508b2cc6ff jdk8-b44
|
||||
747dad9e9d37d244a5c765a1afe9194f7ddae118 jdk8-b45
|
||||
30141e598d72a6146126cb86b034ed6d0bd191b3 jdk8-b46
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -22,7 +22,6 @@
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.encoding;
|
||||
|
||||
import java.util.Hashtable;
|
||||
@ -32,7 +31,8 @@ import com.sun.org.omg.SendingContext.CodeBaseHelper;
|
||||
import com.sun.org.omg.SendingContext._CodeBaseImplBase;
|
||||
import com.sun.org.omg.SendingContext._CodeBaseStub;
|
||||
import com.sun.corba.se.spi.transport.CorbaConnection;
|
||||
|
||||
import com.sun.corba.se.spi.ior.IOR;
|
||||
import com.sun.corba.se.spi.orb.ORB;
|
||||
/**
|
||||
* Provides the reading side with a per connection cache of
|
||||
* info obtained via calls to the remote CodeBase.
|
||||
@ -51,14 +51,24 @@ import com.sun.corba.se.spi.transport.CorbaConnection;
|
||||
*
|
||||
* Needs cache management.
|
||||
*/
|
||||
// REVISIT: revert to package protected after framework merge.
|
||||
public class CachedCodeBase extends _CodeBaseImplBase
|
||||
{
|
||||
private Hashtable implementations, fvds, bases;
|
||||
private CodeBase delegate;
|
||||
private volatile CodeBase delegate;
|
||||
private CorbaConnection conn;
|
||||
|
||||
private static Hashtable iorToCodeBaseObjMap = new Hashtable();
|
||||
private static Object iorMapLock = new Object();
|
||||
private static Hashtable<IOR,CodeBase> iorMap = new Hashtable<>();
|
||||
|
||||
public static synchronized void cleanCache( ORB orb ) {
|
||||
synchronized (iorMapLock) {
|
||||
for (IOR ior : iorMap.keySet()) {
|
||||
if (ior.getORB() == orb) {
|
||||
iorMap.remove(ior);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CachedCodeBase(CorbaConnection connection) {
|
||||
conn = connection;
|
||||
@ -68,7 +78,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return null;
|
||||
}
|
||||
|
||||
public String implementation (String repId) {
|
||||
public synchronized String implementation (String repId) {
|
||||
String urlResult = null;
|
||||
|
||||
if (implementations == null)
|
||||
@ -86,7 +96,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return urlResult;
|
||||
}
|
||||
|
||||
public String[] implementations (String[] repIds) {
|
||||
public synchronized String[] implementations (String[] repIds) {
|
||||
String[] urlResults = new String[repIds.length];
|
||||
|
||||
for (int i = 0; i < urlResults.length; i++)
|
||||
@ -95,7 +105,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return urlResults;
|
||||
}
|
||||
|
||||
public FullValueDescription meta (String repId) {
|
||||
public synchronized FullValueDescription meta (String repId) {
|
||||
FullValueDescription result = null;
|
||||
|
||||
if (fvds == null)
|
||||
@ -113,7 +123,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return result;
|
||||
}
|
||||
|
||||
public FullValueDescription[] metas (String[] repIds) {
|
||||
public synchronized FullValueDescription[] metas (String[] repIds) {
|
||||
FullValueDescription[] results
|
||||
= new FullValueDescription[repIds.length];
|
||||
|
||||
@ -123,7 +133,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return results;
|
||||
}
|
||||
|
||||
public String[] bases (String repId) {
|
||||
public synchronized String[] bases (String repId) {
|
||||
|
||||
String[] results = null;
|
||||
|
||||
@ -145,7 +155,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
// Ensures that we've used the connection's IOR to create
|
||||
// a valid CodeBase delegate. If this returns false, then
|
||||
// it is not valid to access the delegate.
|
||||
private boolean connectedCodeBase() {
|
||||
private synchronized boolean connectedCodeBase() {
|
||||
if (delegate != null)
|
||||
return true;
|
||||
|
||||
@ -165,7 +175,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return false;
|
||||
}
|
||||
|
||||
synchronized(this) {
|
||||
synchronized(iorMapLock) {
|
||||
|
||||
// Recheck the condition to make sure another
|
||||
// thread didn't already do this while we waited
|
||||
@ -173,7 +183,8 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
return true;
|
||||
|
||||
// Do we have a reference initialized by another connection?
|
||||
delegate = (CodeBase)CachedCodeBase.iorToCodeBaseObjMap.get(conn.getCodeBaseIOR());
|
||||
delegate = CachedCodeBase.iorMap.get(conn.getCodeBaseIOR());
|
||||
|
||||
if (delegate != null)
|
||||
return true;
|
||||
|
||||
@ -181,8 +192,7 @@ public class CachedCodeBase extends _CodeBaseImplBase
|
||||
delegate = CodeBaseHelper.narrow(getObjectFromIOR());
|
||||
|
||||
// Save it for the benefit of other connections
|
||||
CachedCodeBase.iorToCodeBaseObjMap.put(conn.getCodeBaseIOR(),
|
||||
delegate);
|
||||
CachedCodeBase.iorMap.put(conn.getCodeBaseIOR(), delegate);
|
||||
}
|
||||
|
||||
// It's now safe to use the delegate
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -58,7 +58,7 @@ import org.omg.PortableInterceptor.SYSTEM_EXCEPTION;
|
||||
import org.omg.PortableInterceptor.TRANSPORT_RETRY;
|
||||
import org.omg.PortableInterceptor.USER_EXCEPTION;
|
||||
import org.omg.PortableInterceptor.PolicyFactory;
|
||||
import org.omg.PortableInterceptor.ObjectReferenceTemplate ;
|
||||
import org.omg.PortableInterceptor.ObjectReferenceTemplate;
|
||||
|
||||
import com.sun.corba.se.pept.encoding.OutputObject;
|
||||
|
||||
@ -112,10 +112,10 @@ public class PIHandlerImpl implements PIHandler
|
||||
}
|
||||
}
|
||||
|
||||
private ORB orb ;
|
||||
InterceptorsSystemException wrapper ;
|
||||
ORBUtilSystemException orbutilWrapper ;
|
||||
OMGSystemException omgWrapper ;
|
||||
private ORB orb;
|
||||
InterceptorsSystemException wrapper;
|
||||
ORBUtilSystemException orbutilWrapper;
|
||||
OMGSystemException omgWrapper;
|
||||
|
||||
// A unique id used in ServerRequestInfo.
|
||||
// This does not correspond to the GIOP request id.
|
||||
@ -178,6 +178,21 @@ public class PIHandlerImpl implements PIHandler
|
||||
}
|
||||
};
|
||||
|
||||
public void close() {
|
||||
orb = null;
|
||||
wrapper = null;
|
||||
orbutilWrapper = null;
|
||||
omgWrapper = null;
|
||||
codecFactory = null;
|
||||
arguments = null;
|
||||
interceptorList = null;
|
||||
interceptorInvoker = null;
|
||||
current = null;
|
||||
policyFactoryTable = null;
|
||||
threadLocalClientRequestInfoStack = null;
|
||||
threadLocalServerRequestInfoStack = null;
|
||||
}
|
||||
|
||||
// Class to contain all ThreadLocal data for ClientRequestInfo
|
||||
// maintenance.
|
||||
//
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -69,6 +69,9 @@ public class PINoOpHandlerImpl implements PIHandler
|
||||
public PINoOpHandlerImpl( ) {
|
||||
}
|
||||
|
||||
public void close() {
|
||||
}
|
||||
|
||||
public void initialize() {
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -34,14 +34,18 @@ public class MonitoringManagerFactoryImpl implements MonitoringManagerFactory {
|
||||
private HashMap monitoringManagerTable = new HashMap();
|
||||
|
||||
public synchronized MonitoringManager createMonitoringManager(
|
||||
String nameOfTheRoot, String description )
|
||||
String nameOfTheRoot, String description)
|
||||
{
|
||||
MonitoringManagerImpl m = null;
|
||||
m = (MonitoringManagerImpl)monitoringManagerTable.get(nameOfTheRoot);
|
||||
if (m == null) {
|
||||
m = new MonitoringManagerImpl( nameOfTheRoot, description );
|
||||
m = new MonitoringManagerImpl(nameOfTheRoot, description);
|
||||
monitoringManagerTable.put(nameOfTheRoot, m);
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
public synchronized void remove(String nameOfTheRoot) {
|
||||
monitoringManagerTable.remove(nameOfTheRoot);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -26,6 +26,7 @@
|
||||
package com.sun.corba.se.impl.monitoring;
|
||||
|
||||
import com.sun.corba.se.spi.monitoring.MonitoringManager;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoringManagerFactory;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoredObject;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoredObjectFactory;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
|
||||
@ -33,18 +34,24 @@ import com.sun.corba.se.spi.monitoring.MonitoringFactories;
|
||||
public class MonitoringManagerImpl implements MonitoringManager {
|
||||
private final MonitoredObject rootMonitoredObject;
|
||||
|
||||
MonitoringManagerImpl( String nameOfTheRoot, String description ) {
|
||||
MonitoringManagerImpl(String nameOfTheRoot, String description) {
|
||||
MonitoredObjectFactory f =
|
||||
MonitoringFactories.getMonitoredObjectFactory();
|
||||
rootMonitoredObject =
|
||||
f.createMonitoredObject( nameOfTheRoot, description );
|
||||
f.createMonitoredObject(nameOfTheRoot, description);
|
||||
}
|
||||
|
||||
public void clearState( ) {
|
||||
rootMonitoredObject.clearState( );
|
||||
public void clearState() {
|
||||
rootMonitoredObject.clearState();
|
||||
}
|
||||
|
||||
public MonitoredObject getRootMonitoredObject( ) {
|
||||
public MonitoredObject getRootMonitoredObject() {
|
||||
return rootMonitoredObject;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
MonitoringManagerFactory f =
|
||||
MonitoringFactories.getMonitoringManagerFactory();
|
||||
f.remove(rootMonitoredObject.getName());
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -23,35 +23,37 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package com.sun.corba.se.impl.orb ;
|
||||
package com.sun.corba.se.impl.orb;
|
||||
|
||||
import java.applet.Applet;
|
||||
|
||||
import java.io.IOException ;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field ;
|
||||
import java.lang.reflect.Modifier ;
|
||||
import java.lang.reflect.InvocationTargetException ;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import java.util.ArrayList ;
|
||||
import java.util.Iterator ;
|
||||
import java.util.Properties ;
|
||||
import java.util.Vector ;
|
||||
import java.util.Hashtable ;
|
||||
import java.util.Map ;
|
||||
import java.util.HashMap ;
|
||||
import java.util.LinkedList ;
|
||||
import java.util.Collection ;
|
||||
import java.util.Collections ;
|
||||
import java.util.StringTokenizer ;
|
||||
import java.util.Enumeration ;
|
||||
import java.util.WeakHashMap ;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
import java.util.Vector;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.Enumeration;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import java.net.InetAddress ;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.AccessController ;
|
||||
import java.security.AccessController;
|
||||
|
||||
import javax.rmi.CORBA.Util;
|
||||
import javax.rmi.CORBA.ValueHandler;
|
||||
@ -82,18 +84,18 @@ import org.omg.CORBA.ORBPackage.InvalidName;
|
||||
import com.sun.org.omg.SendingContext.CodeBase;
|
||||
|
||||
import com.sun.corba.se.pept.broker.Broker;
|
||||
import com.sun.corba.se.pept.protocol.ClientInvocationInfo ;
|
||||
import com.sun.corba.se.pept.protocol.ClientInvocationInfo;
|
||||
import com.sun.corba.se.pept.transport.ContactInfo;
|
||||
import com.sun.corba.se.pept.transport.ConnectionCache;
|
||||
import com.sun.corba.se.pept.transport.TransportManager;
|
||||
|
||||
import com.sun.corba.se.spi.ior.IOR;
|
||||
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder ;
|
||||
import com.sun.corba.se.spi.ior.IdentifiableFactoryFinder;
|
||||
import com.sun.corba.se.spi.ior.TaggedComponentFactoryFinder;
|
||||
import com.sun.corba.se.spi.ior.IORFactories ;
|
||||
import com.sun.corba.se.spi.ior.ObjectKey ;
|
||||
import com.sun.corba.se.spi.ior.ObjectKeyFactory ;
|
||||
import com.sun.corba.se.spi.ior.iiop.IIOPFactories ;
|
||||
import com.sun.corba.se.spi.ior.IORFactories;
|
||||
import com.sun.corba.se.spi.ior.ObjectKey;
|
||||
import com.sun.corba.se.spi.ior.ObjectKeyFactory;
|
||||
import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
|
||||
import com.sun.corba.se.spi.ior.iiop.GIOPVersion;
|
||||
import com.sun.corba.se.spi.oa.OAInvocationInfo;
|
||||
import com.sun.corba.se.spi.oa.ObjectAdapterFactory;
|
||||
@ -122,10 +124,10 @@ import com.sun.corba.se.spi.orb.StringPair;
|
||||
import com.sun.corba.se.spi.transport.CorbaContactInfoListFactory;
|
||||
import com.sun.corba.se.spi.transport.CorbaTransportManager;
|
||||
import com.sun.corba.se.spi.legacy.connection.LegacyServerSocketManager;
|
||||
import com.sun.corba.se.spi.copyobject.CopierManager ;
|
||||
import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults ;
|
||||
import com.sun.corba.se.spi.presentation.rmi.PresentationManager ;
|
||||
import com.sun.corba.se.spi.presentation.rmi.StubAdapter ;
|
||||
import com.sun.corba.se.spi.copyobject.CopierManager;
|
||||
import com.sun.corba.se.spi.presentation.rmi.PresentationDefaults;
|
||||
import com.sun.corba.se.spi.presentation.rmi.PresentationManager;
|
||||
import com.sun.corba.se.spi.presentation.rmi.StubAdapter;
|
||||
import com.sun.corba.se.spi.servicecontext.ServiceContextRegistry;
|
||||
|
||||
import com.sun.corba.se.impl.corba.TypeCodeFactory;
|
||||
@ -140,6 +142,7 @@ import com.sun.corba.se.impl.corba.AnyImpl;
|
||||
import com.sun.corba.se.impl.corba.RequestImpl;
|
||||
import com.sun.corba.se.impl.dynamicany.DynAnyFactoryImpl;
|
||||
import com.sun.corba.se.impl.encoding.EncapsOutputStream;
|
||||
import com.sun.corba.se.impl.encoding.CachedCodeBase;
|
||||
import com.sun.corba.se.impl.interceptors.PIHandlerImpl;
|
||||
import com.sun.corba.se.impl.interceptors.PINoOpHandlerImpl;
|
||||
import com.sun.corba.se.impl.ior.TaggedComponentFactoryFinderImpl;
|
||||
@ -185,6 +188,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
private java.lang.Object runObj = new java.lang.Object();
|
||||
private java.lang.Object shutdownObj = new java.lang.Object();
|
||||
private java.lang.Object waitForCompletionObj = new java.lang.Object();
|
||||
private static final byte STATUS_OPERATING = 1;
|
||||
private static final byte STATUS_SHUTTING_DOWN = 2;
|
||||
private static final byte STATUS_SHUTDOWN = 3;
|
||||
@ -193,6 +197,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
// XXX Should we move invocation tracking to the first level server dispatcher?
|
||||
private java.lang.Object invocationObj = new java.lang.Object();
|
||||
private int numInvocations = 0;
|
||||
|
||||
// thread local variable to store a boolean to detect deadlock in
|
||||
// ORB.shutdown(true).
|
||||
@ -220,8 +225,6 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
private int transientServerId ;
|
||||
|
||||
private ThreadGroup threadGroup ;
|
||||
|
||||
private ServiceContextRegistry serviceContextRegistry ;
|
||||
|
||||
// Needed here to implement connect/disconnect
|
||||
@ -265,6 +268,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
private final Object urlOperationLock = new java.lang.Object() ;
|
||||
|
||||
private CorbaServerRequestDispatcher insNamingDelegate ;
|
||||
|
||||
// resolverLock must be used for all access to either resolver or
|
||||
// localResolver, since it is possible for the resolver to indirectly
|
||||
// refer to the localResolver. Also used to protect access to
|
||||
@ -279,6 +283,8 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
private ObjectKeyFactory objectKeyFactory ;
|
||||
|
||||
private boolean orbOwnsThreadPoolManager = false ;
|
||||
|
||||
private ThreadPoolManager threadpoolMgr;
|
||||
|
||||
private void dprint( String msg )
|
||||
@ -322,11 +328,17 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public ORBVersion getORBVersion()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return (ORBVersion)(orbVersionThreadLocal.get()) ;
|
||||
}
|
||||
|
||||
public void setORBVersion(ORBVersion verObj)
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
orbVersionThreadLocal.set(verObj);
|
||||
}
|
||||
|
||||
@ -347,46 +359,6 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
// end of this method.
|
||||
pihandler = new PINoOpHandlerImpl( );
|
||||
|
||||
// See bugs 4916766 and 4936203
|
||||
// We intend to create new threads in a reliable thread group.
|
||||
// This avoids problems if the application/applet
|
||||
// creates a thread group, makes JavaIDL calls which create a new
|
||||
// connection and ReaderThread, and then destroys the thread
|
||||
// group. If our ReaderThreads were to be part of such destroyed thread
|
||||
// group then it might get killed and cause other invoking threads
|
||||
// sharing the same connection to get a non-restartable
|
||||
// CommunicationFailure. We'd like to avoid that.
|
||||
//
|
||||
// Our solution is to create all of our threads in the highest thread
|
||||
// group that we have access to, given our own security clearance.
|
||||
//
|
||||
try {
|
||||
// try to get a thread group that's as high in the threadgroup
|
||||
// parent-child hierarchy, as we can get to.
|
||||
// this will prevent an ORB thread created during applet-init from
|
||||
// being killed when an applet dies.
|
||||
threadGroup = (ThreadGroup) AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
public Object run() {
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup() ;
|
||||
ThreadGroup ptg = tg ;
|
||||
try {
|
||||
while (ptg != null) {
|
||||
tg = ptg;
|
||||
ptg = tg.getParent();
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
// Discontinue going higher on a security exception.
|
||||
}
|
||||
return new ThreadGroup(tg, "ORB ThreadGroup");
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (SecurityException e) {
|
||||
// something wrong, we go back to the original code
|
||||
threadGroup = Thread.currentThread().getThreadGroup();
|
||||
}
|
||||
|
||||
// This is the unique id of this server (JVM). Multiple incarnations
|
||||
// of this server will get different ids.
|
||||
// Compute transientServerId = milliseconds since Jan 1, 1970
|
||||
@ -547,6 +519,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void set_parameters( Properties props )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
preInit( null, props ) ;
|
||||
DataCollector dataCollector =
|
||||
DataCollectorFactory.create( props, getLocalHostName() ) ;
|
||||
@ -788,6 +763,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public void notifyORB()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (this.svResponseReceived) {
|
||||
this.svResponseReceived.set();
|
||||
this.svResponseReceived.notify();
|
||||
@ -854,6 +832,8 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
// Note that we connect this if we have not already done so.
|
||||
public synchronized IOR getFVDCodeBaseIOR()
|
||||
{
|
||||
checkShutdownState();
|
||||
|
||||
if (codeBaseIOR != null) // i.e. We are already connected to it
|
||||
return codeBaseIOR;
|
||||
|
||||
@ -1118,6 +1098,8 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public synchronized void setTypeCodeForClass(Class c, TypeCodeImpl tci)
|
||||
{
|
||||
checkShutdownState();
|
||||
|
||||
if (typeCodeForClassMap == null)
|
||||
typeCodeForClassMap = Collections.synchronizedMap(
|
||||
new WeakHashMap(64));
|
||||
@ -1128,6 +1110,8 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public synchronized TypeCodeImpl getTypeCodeForClass(Class c)
|
||||
{
|
||||
checkShutdownState();
|
||||
|
||||
if (typeCodeForClassMap == null)
|
||||
return null;
|
||||
return (TypeCodeImpl)typeCodeForClassMap.get(c);
|
||||
@ -1210,6 +1194,10 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
{
|
||||
CorbaServerRequestDispatcher insnd ;
|
||||
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
|
||||
if ((id == null) || (id.length() == 0))
|
||||
throw new InvalidName() ;
|
||||
|
||||
@ -1253,66 +1241,88 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
}
|
||||
}
|
||||
|
||||
public void shutdown(boolean wait_for_completion)
|
||||
{
|
||||
// to wait for completion, we would deadlock, so throw a standard
|
||||
// OMG exception.
|
||||
if (wait_for_completion && ((Boolean)isProcessingInvocation.get()).booleanValue()) {
|
||||
throw omgWrapper.shutdownWaitForCompletionDeadlock() ;
|
||||
}
|
||||
|
||||
boolean doShutdown = false ;
|
||||
public void shutdown(boolean wait_for_completion) {
|
||||
boolean wait = false;
|
||||
|
||||
synchronized (this) {
|
||||
checkShutdownState() ;
|
||||
checkShutdownState();
|
||||
|
||||
// This is to avoid deadlock: don't allow a thread that is
|
||||
// processing a request to call shutdown( true ), because
|
||||
// the shutdown would block waiting for the request to complete,
|
||||
// while the request would block waiting for shutdown to complete.
|
||||
if (wait_for_completion &&
|
||||
isProcessingInvocation.get() == Boolean.TRUE) {
|
||||
throw omgWrapper.shutdownWaitForCompletionDeadlock();
|
||||
}
|
||||
|
||||
if (status == STATUS_SHUTTING_DOWN) {
|
||||
if (!wait_for_completion)
|
||||
// If we are already shutting down and don't want
|
||||
// to wait, nothing to do: return.
|
||||
return ;
|
||||
} else {
|
||||
// The ORB status was STATUS_OPERATING, so start the shutdown.
|
||||
status = STATUS_SHUTTING_DOWN ;
|
||||
doShutdown = true ;
|
||||
if (wait_for_completion) {
|
||||
wait = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
status = STATUS_SHUTTING_DOWN;
|
||||
}
|
||||
|
||||
// At this point, status is SHUTTING_DOWN.
|
||||
// All shutdown calls with wait_for_completion == true must synchronize
|
||||
// here. Only the first call will be made with doShutdown == true.
|
||||
// Avoid more than one thread performing shutdown at a time.
|
||||
synchronized (shutdownObj) {
|
||||
if (doShutdown) {
|
||||
// shutdownServants will set all POAManagers into the
|
||||
// INACTIVE state, causing request to be rejected.
|
||||
// If wait_for_completion is true, this will not return until
|
||||
// all invocations have completed.
|
||||
// At this point, the ORB status is certainly STATUS_SHUTTING_DOWN.
|
||||
// If wait is true, another thread already called shutdown( true ),
|
||||
// and so we wait for completion
|
||||
if (wait) {
|
||||
while (true) {
|
||||
synchronized (this) {
|
||||
if (status == STATUS_SHUTDOWN)
|
||||
break;
|
||||
}
|
||||
|
||||
try {
|
||||
shutdownObj.wait();
|
||||
} catch (InterruptedException exc) {
|
||||
// NOP: just loop and wait until state is changed
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// perform the actual shutdown
|
||||
shutdownServants(wait_for_completion);
|
||||
|
||||
if (wait_for_completion) {
|
||||
synchronized ( waitForCompletionObj ) {
|
||||
while (numInvocations > 0) {
|
||||
try {
|
||||
waitForCompletionObj.wait();
|
||||
} catch (InterruptedException ex) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
synchronized (runObj) {
|
||||
runObj.notifyAll();
|
||||
}
|
||||
|
||||
synchronized (this) {
|
||||
status = STATUS_SHUTDOWN;
|
||||
}
|
||||
status = STATUS_SHUTDOWN;
|
||||
|
||||
shutdownObj.notifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** This method shuts down the ORB and causes orb.run() to return.
|
||||
* It will cause all POAManagers to be deactivated, which in turn
|
||||
* will cause all POAs to be deactivated.
|
||||
*/
|
||||
// Cause all ObjectAdapaterFactories to clean up all of their internal state, which
|
||||
// may include activated objects that have associated state and callbacks that must
|
||||
// complete in order to shutdown. This will cause new request to be rejected.
|
||||
protected void shutdownServants(boolean wait_for_completion) {
|
||||
Iterator iter = requestDispatcherRegistry.getObjectAdapterFactories().iterator() ;
|
||||
while (iter.hasNext()) {
|
||||
ObjectAdapterFactory oaf = (ObjectAdapterFactory)iter.next() ;
|
||||
oaf.shutdown( wait_for_completion ) ;
|
||||
Set<ObjectAdapterFactory> oaset;
|
||||
synchronized (this) {
|
||||
oaset = new HashSet<>(requestDispatcherRegistry.getObjectAdapterFactories());
|
||||
}
|
||||
|
||||
for (ObjectAdapterFactory oaf : oaset)
|
||||
oaf.shutdown(wait_for_completion);
|
||||
}
|
||||
|
||||
// REVISIT: was protected - made public for framework
|
||||
// Note that the caller must hold the ORBImpl lock.
|
||||
public void checkShutdownState()
|
||||
{
|
||||
@ -1327,21 +1337,40 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public boolean isDuringDispatch()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
Boolean value = (Boolean)(isProcessingInvocation.get()) ;
|
||||
return value.booleanValue() ;
|
||||
}
|
||||
|
||||
public void startingDispatch()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (invocationObj) {
|
||||
isProcessingInvocation.set(Boolean.TRUE);
|
||||
numInvocations++;
|
||||
}
|
||||
}
|
||||
|
||||
public void finishedDispatch()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (invocationObj) {
|
||||
isProcessingInvocation.set(Boolean.FALSE);
|
||||
numInvocations--;
|
||||
isProcessingInvocation.set(false);
|
||||
if (numInvocations == 0) {
|
||||
synchronized (waitForCompletionObj) {
|
||||
waitForCompletionObj.notifyAll();
|
||||
}
|
||||
} else if (numInvocations < 0) {
|
||||
throw wrapper.numInvocationsAlreadyZero(
|
||||
CompletionStatus.COMPLETED_YES);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1350,12 +1379,12 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
* not been shut down, it will start the shutdown process and block until
|
||||
* the ORB has shut down before it destroys the ORB."
|
||||
*/
|
||||
public synchronized void destroy()
|
||||
public void destroy()
|
||||
{
|
||||
boolean shutdownFirst = false ;
|
||||
boolean shutdownFirst = false;
|
||||
|
||||
synchronized (this) {
|
||||
shutdownFirst = (status == STATUS_OPERATING) ;
|
||||
shutdownFirst = (status == STATUS_OPERATING);
|
||||
}
|
||||
|
||||
if (shutdownFirst) {
|
||||
@ -1365,11 +1394,76 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
synchronized (this) {
|
||||
if (status < STATUS_DESTROYED) {
|
||||
getCorbaTransportManager().close();
|
||||
getPIHandler().destroyInterceptors() ;
|
||||
getPIHandler().destroyInterceptors();
|
||||
status = STATUS_DESTROYED;
|
||||
}
|
||||
}
|
||||
synchronized (threadPoolManagerAccessLock) {
|
||||
if (orbOwnsThreadPoolManager) {
|
||||
try {
|
||||
threadpoolMgr.close();
|
||||
threadpoolMgr = null;
|
||||
} catch (IOException exc) {
|
||||
wrapper.ioExceptionOnClose(exc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
monitoringManager.close();
|
||||
monitoringManager = null;
|
||||
} catch (IOException exc) {
|
||||
wrapper.ioExceptionOnClose(exc);
|
||||
}
|
||||
|
||||
CachedCodeBase.cleanCache(this);
|
||||
try {
|
||||
pihandler.close();
|
||||
} catch (IOException exc) {
|
||||
wrapper.ioExceptionOnClose(exc);
|
||||
}
|
||||
|
||||
super.destroy();
|
||||
|
||||
badServerIdHandlerAccessLock = null;
|
||||
clientDelegateFactoryAccessorLock = null;
|
||||
corbaContactInfoListFactoryAccessLock = null;
|
||||
|
||||
objectKeyFactoryAccessLock = null;
|
||||
legacyServerSocketManagerAccessLock = null;
|
||||
threadPoolManagerAccessLock = null;
|
||||
transportManager = null;
|
||||
legacyServerSocketManager = null;
|
||||
OAInvocationInfoStack = null;
|
||||
clientInvocationInfoStack = null;
|
||||
codeBaseIOR = null;
|
||||
dynamicRequests = null;
|
||||
svResponseReceived = null;
|
||||
runObj = null;
|
||||
shutdownObj = null;
|
||||
waitForCompletionObj = null;
|
||||
invocationObj = null;
|
||||
isProcessingInvocation = null;
|
||||
typeCodeForClassMap = null;
|
||||
valueFactoryCache = null;
|
||||
orbVersionThreadLocal = null;
|
||||
requestDispatcherRegistry = null;
|
||||
copierManager = null;
|
||||
toaFactory = null;
|
||||
poaFactory = null;
|
||||
pihandler = null;
|
||||
configData = null;
|
||||
badServerIdHandler = null;
|
||||
clientDelegateFactory = null;
|
||||
corbaContactInfoListFactory = null;
|
||||
resolver = null;
|
||||
localResolver = null;
|
||||
insNamingDelegate = null;
|
||||
urlOperation = null;
|
||||
taggedComponentFactoryFinder = null;
|
||||
taggedProfileFactoryFinder = null;
|
||||
taggedProfileTemplateFactoryFinder = null;
|
||||
objectKeyFactory = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1434,18 +1528,27 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public OAInvocationInfo peekInvocationInfo()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
|
||||
return (OAInvocationInfo)(stack.peek()) ;
|
||||
}
|
||||
|
||||
public void pushInvocationInfo( OAInvocationInfo info )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
|
||||
stack.push( info ) ;
|
||||
}
|
||||
|
||||
public OAInvocationInfo popInvocationInfo()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
StackImpl stack = (StackImpl)(OAInvocationInfoStack.get()) ;
|
||||
return (OAInvocationInfo)(stack.pop()) ;
|
||||
}
|
||||
@ -1459,6 +1562,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void initBadServerIdHandler()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (badServerIdHandlerAccessLock) {
|
||||
Class cls = configData.getBadServerIdHandler() ;
|
||||
if (cls != null) {
|
||||
@ -1477,6 +1583,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void setBadServerIdHandler( BadServerIdHandler handler )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (badServerIdHandlerAccessLock) {
|
||||
badServerIdHandler = handler;
|
||||
}
|
||||
@ -1484,6 +1593,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void handleBadServerId( ObjectKey okey )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (badServerIdHandlerAccessLock) {
|
||||
if (badServerIdHandler == null)
|
||||
throw wrapper.badServerId() ;
|
||||
@ -1532,6 +1644,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public int getTransientServerId()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
if( configData.getORBServerIdPropertySpecified( ) ) {
|
||||
// ORBServerId is specified then use that value
|
||||
return configData.getPersistentServerId( );
|
||||
@ -1541,11 +1656,17 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public RequestDispatcherRegistry getRequestDispatcherRegistry()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return requestDispatcherRegistry;
|
||||
}
|
||||
|
||||
public ServiceContextRegistry getServiceContextRegistry()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return serviceContextRegistry ;
|
||||
}
|
||||
|
||||
@ -1563,12 +1684,18 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
// XXX What about multi-homed host?
|
||||
public boolean isLocalHost( String hostName )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return hostName.equals( configData.getORBServerHost() ) ||
|
||||
hostName.equals( getLocalHostName() ) ;
|
||||
}
|
||||
|
||||
public boolean isLocalServerId( int subcontractId, int serverId )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
if ((subcontractId < ORBConstants.FIRST_POA_SCID) ||
|
||||
(subcontractId > ORBConstants.MAX_POA_SCID))
|
||||
return serverId == getTransientServerId( ) ;
|
||||
@ -1659,6 +1786,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public ClientInvocationInfo createOrIncrementInvocationInfo()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
StackImpl invocationInfoStack =
|
||||
(StackImpl) clientInvocationInfoStack.get();
|
||||
ClientInvocationInfo clientInvocationInfo = null;
|
||||
@ -1682,10 +1812,13 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void releaseOrDecrementInvocationInfo()
|
||||
{
|
||||
StackImpl invocationInfoStack =
|
||||
(StackImpl)clientInvocationInfoStack.get();
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
int entryCount = -1;
|
||||
ClientInvocationInfo clientInvocationInfo = null;
|
||||
StackImpl invocationInfoStack =
|
||||
(StackImpl)clientInvocationInfoStack.get();
|
||||
if (!invocationInfoStack.empty()) {
|
||||
clientInvocationInfo =
|
||||
(ClientInvocationInfo)invocationInfoStack.peek();
|
||||
@ -1705,6 +1838,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public ClientInvocationInfo getInvocationInfo()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
StackImpl invocationInfoStack =
|
||||
(StackImpl) clientInvocationInfoStack.get();
|
||||
return (ClientInvocationInfo) invocationInfoStack.peek();
|
||||
@ -1719,6 +1855,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void setClientDelegateFactory( ClientDelegateFactory factory )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (clientDelegateFactoryAccessorLock) {
|
||||
clientDelegateFactory = factory ;
|
||||
}
|
||||
@ -1726,6 +1865,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public ClientDelegateFactory getClientDelegateFactory()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (clientDelegateFactoryAccessorLock) {
|
||||
return clientDelegateFactory ;
|
||||
}
|
||||
@ -1735,6 +1877,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void setCorbaContactInfoListFactory( CorbaContactInfoListFactory factory )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (corbaContactInfoListFactoryAccessLock) {
|
||||
corbaContactInfoListFactory = factory ;
|
||||
}
|
||||
@ -1742,6 +1887,7 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public synchronized CorbaContactInfoListFactory getCorbaContactInfoListFactory()
|
||||
{
|
||||
checkShutdownState();
|
||||
return corbaContactInfoListFactory ;
|
||||
}
|
||||
|
||||
@ -1750,6 +1896,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public void setResolver( Resolver resolver )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (resolverLock) {
|
||||
this.resolver = resolver ;
|
||||
}
|
||||
@ -1760,6 +1909,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public Resolver getResolver()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (resolverLock) {
|
||||
return resolver ;
|
||||
}
|
||||
@ -1770,6 +1922,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public void setLocalResolver( LocalResolver resolver )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (resolverLock) {
|
||||
this.localResolver = resolver ;
|
||||
}
|
||||
@ -1780,6 +1935,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public LocalResolver getLocalResolver()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (resolverLock) {
|
||||
return localResolver ;
|
||||
}
|
||||
@ -1790,6 +1948,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public void setURLOperation( Operation stringToObject )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (urlOperationLock) {
|
||||
urlOperation = stringToObject ;
|
||||
}
|
||||
@ -1800,6 +1961,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
*/
|
||||
public Operation getURLOperation()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (urlOperationLock) {
|
||||
return urlOperation ;
|
||||
}
|
||||
@ -1807,6 +1971,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void setINSDelegate( CorbaServerRequestDispatcher sdel )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (resolverLock) {
|
||||
insNamingDelegate = sdel ;
|
||||
}
|
||||
@ -1814,16 +1981,25 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public TaggedComponentFactoryFinder getTaggedComponentFactoryFinder()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return taggedComponentFactoryFinder ;
|
||||
}
|
||||
|
||||
public IdentifiableFactoryFinder getTaggedProfileFactoryFinder()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return taggedProfileFactoryFinder ;
|
||||
}
|
||||
|
||||
public IdentifiableFactoryFinder getTaggedProfileTemplateFactoryFinder()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return taggedProfileTemplateFactoryFinder ;
|
||||
}
|
||||
|
||||
@ -1831,6 +2007,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public ObjectKeyFactory getObjectKeyFactory()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (objectKeyFactoryAccessLock) {
|
||||
return objectKeyFactory ;
|
||||
}
|
||||
@ -1838,6 +2017,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void setObjectKeyFactory( ObjectKeyFactory factory )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (objectKeyFactoryAccessLock) {
|
||||
objectKeyFactory = factory ;
|
||||
}
|
||||
@ -1864,6 +2046,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public LegacyServerSocketManager getLegacyServerSocketManager()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (legacyServerSocketManagerAccessLock) {
|
||||
if (legacyServerSocketManager == null) {
|
||||
legacyServerSocketManager = new LegacyServerSocketManagerImpl(this);
|
||||
@ -1876,6 +2061,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public void setThreadPoolManager(ThreadPoolManager mgr)
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (threadPoolManagerAccessLock) {
|
||||
threadpoolMgr = mgr;
|
||||
}
|
||||
@ -1883,9 +2071,13 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public ThreadPoolManager getThreadPoolManager()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
synchronized (threadPoolManagerAccessLock) {
|
||||
if (threadpoolMgr == null) {
|
||||
threadpoolMgr = new ThreadPoolManagerImpl( threadGroup );
|
||||
threadpoolMgr = new ThreadPoolManagerImpl();
|
||||
orbOwnsThreadPoolManager = true;
|
||||
}
|
||||
return threadpoolMgr;
|
||||
}
|
||||
@ -1893,6 +2085,9 @@ public class ORBImpl extends com.sun.corba.se.spi.orb.ORB
|
||||
|
||||
public CopierManager getCopierManager()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return copierManager ;
|
||||
}
|
||||
} // Class ORBImpl
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -25,6 +25,18 @@
|
||||
|
||||
package com.sun.corba.se.impl.orbutil.threadpool;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Closeable;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.NoSuchWorkQueueException;
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPool;
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.Work;
|
||||
@ -36,12 +48,27 @@ import com.sun.corba.se.impl.orbutil.threadpool.WorkQueueImpl;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoringConstants;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoredObject;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoringFactories;
|
||||
import com.sun.corba.se.spi.orb.ORB;
|
||||
import com.sun.corba.se.spi.monitoring.LongMonitoredAttributeBase;
|
||||
|
||||
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
|
||||
import com.sun.corba.se.impl.orbutil.ORBConstants;
|
||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
|
||||
public class ThreadPoolImpl implements ThreadPool
|
||||
{
|
||||
private static int threadCounter = 0; // serial counter useful for debugging
|
||||
// serial counter useful for debugging
|
||||
private static AtomicInteger threadCounter = new AtomicInteger(0);
|
||||
private static final ORBUtilSystemException wrapper =
|
||||
ORBUtilSystemException.get(CORBALogDomains.RPC_TRANSPORT);
|
||||
|
||||
|
||||
// Any time currentThreadCount and/or availableWorkerThreads is updated
|
||||
// or accessed this ThreadPool's WorkQueue must be locked. And, it is
|
||||
// expected that this ThreadPool's WorkQueue is the only object that
|
||||
// updates and accesses these values directly and indirectly though a
|
||||
// call to a method in this ThreadPool. If any call to update or access
|
||||
// those values must synchronized on this ThreadPool's WorkQueue.
|
||||
private WorkQueue workQueue;
|
||||
|
||||
// Stores the number of available worker threads
|
||||
@ -65,14 +92,11 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
// Running count of the work items processed
|
||||
// Set the value to 1 so that divide by zero is avoided in
|
||||
// averageWorkCompletionTime()
|
||||
private long processedCount = 1;
|
||||
private AtomicLong processedCount = new AtomicLong(1);
|
||||
|
||||
// Running aggregate of the time taken in millis to execute work items
|
||||
// processed by the threads in the threadpool
|
||||
private long totalTimeTaken = 0;
|
||||
|
||||
// Lock for protecting state when required
|
||||
private Object lock = new Object();
|
||||
private AtomicLong totalTimeTaken = new AtomicLong(0);
|
||||
|
||||
// Name of the ThreadPool
|
||||
private String name;
|
||||
@ -81,7 +105,10 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
private MonitoredObject threadpoolMonitoredObject;
|
||||
|
||||
// ThreadGroup in which threads should be created
|
||||
private ThreadGroup threadGroup ;
|
||||
private ThreadGroup threadGroup;
|
||||
|
||||
Object workersLock = new Object();
|
||||
List<WorkerThread> workers = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* This constructor is used to create an unbounded threadpool
|
||||
@ -90,7 +117,7 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
inactivityTimeout = ORBConstants.DEFAULT_INACTIVITY_TIMEOUT;
|
||||
maxWorkerThreads = Integer.MAX_VALUE;
|
||||
workQueue = new WorkQueueImpl(this);
|
||||
threadGroup = tg ;
|
||||
threadGroup = tg;
|
||||
name = threadpoolName;
|
||||
initializeMonitoring();
|
||||
}
|
||||
@ -121,6 +148,30 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
initializeMonitoring();
|
||||
}
|
||||
|
||||
// Note that this method should not return until AFTER all threads have died.
|
||||
public void close() throws IOException {
|
||||
|
||||
// Copy to avoid concurrent modification problems.
|
||||
List<WorkerThread> copy = null;
|
||||
synchronized (workersLock) {
|
||||
copy = new ArrayList<>(workers);
|
||||
}
|
||||
|
||||
for (WorkerThread wt : copy) {
|
||||
wt.close();
|
||||
while (wt.getState() != Thread.State.TERMINATED) {
|
||||
try {
|
||||
wt.join();
|
||||
} catch (InterruptedException exc) {
|
||||
wrapper.interruptedJoinCallWhileClosingThreadPool(exc, wt, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
threadGroup = null;
|
||||
}
|
||||
|
||||
|
||||
// Setup monitoring for this threadpool
|
||||
private void initializeMonitoring() {
|
||||
// Get root monitored object
|
||||
@ -217,8 +268,8 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
* or notify waiting threads on the queue for available work
|
||||
*/
|
||||
void notifyForAvailableWork(WorkQueue aWorkQueue) {
|
||||
synchronized (lock) {
|
||||
if (availableWorkerThreads == 0) {
|
||||
synchronized (aWorkQueue) {
|
||||
if (availableWorkerThreads < aWorkQueue.workItemsInQueue()) {
|
||||
createWorkerThread();
|
||||
} else {
|
||||
aWorkQueue.notify();
|
||||
@ -227,120 +278,145 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To be called from the workqueue to create worker threads when none
|
||||
* available.
|
||||
*/
|
||||
void createWorkerThread() {
|
||||
WorkerThread thread;
|
||||
|
||||
synchronized (lock) {
|
||||
if (boundedThreadPool) {
|
||||
if (currentThreadCount < maxWorkerThreads) {
|
||||
thread = new WorkerThread(threadGroup, getName());
|
||||
currentThreadCount++;
|
||||
} else {
|
||||
// REVIST - Need to create a thread to monitor the
|
||||
// the state for deadlock i.e. all threads waiting for
|
||||
// something which can be got from the item in the
|
||||
// workqueue, but there is no thread available to
|
||||
// process that work item - DEADLOCK !!
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
thread = new WorkerThread(threadGroup, getName());
|
||||
currentThreadCount++;
|
||||
}
|
||||
private Thread createWorkerThreadHelper( String name ) {
|
||||
// Thread creation needs to be in a doPrivileged block
|
||||
// if there is a non-null security manager for two reasons:
|
||||
// 1. The creation of a thread in a specific ThreadGroup
|
||||
// is a privileged operation. Lack of a doPrivileged
|
||||
// block here causes an AccessControlException
|
||||
// (see bug 6268145).
|
||||
// 2. We want to make sure that the permissions associated
|
||||
// with this thread do NOT include the permissions of
|
||||
// the current thread that is calling this method.
|
||||
// This leads to problems in the app server where
|
||||
// some threads in the ThreadPool randomly get
|
||||
// bad permissions, leading to unpredictable
|
||||
// permission errors (see bug 6021011).
|
||||
//
|
||||
// A Java thread contains a stack of call frames,
|
||||
// one for each method called that has not yet returned.
|
||||
// Each method comes from a particular class. The class
|
||||
// was loaded by a ClassLoader which has an associated
|
||||
// CodeSource, and this determines the Permissions
|
||||
// for all methods in that class. The current
|
||||
// Permissions for the thread are the intersection of
|
||||
// all Permissions for the methods on the stack.
|
||||
// This is part of the Security Context of the thread.
|
||||
//
|
||||
// When a thread creates a new thread, the new thread
|
||||
// inherits the security context of the old thread.
|
||||
// This is bad in a ThreadPool, because different
|
||||
// creators of threads may have different security contexts.
|
||||
// This leads to occasional unpredictable errors when
|
||||
// a thread is re-used in a different security context.
|
||||
//
|
||||
// Avoiding this problem is simple: just do the thread
|
||||
// creation in a doPrivileged block. This sets the
|
||||
// inherited security context to that of the code source
|
||||
// for the ORB code itself, which contains all permissions
|
||||
// in either Java SE or Java EE.
|
||||
WorkerThread thread = new WorkerThread(threadGroup, name);
|
||||
synchronized (workersLock) {
|
||||
workers.add(thread);
|
||||
}
|
||||
|
||||
// The thread must be set to a daemon thread so the
|
||||
// VM can exit if the only threads left are PooledThreads
|
||||
// or other daemons. We don't want to rely on the
|
||||
// calling thread always being a daemon.
|
||||
// Note that no exception is possible here since we
|
||||
// are inside the doPrivileged block.
|
||||
thread.setDaemon(true);
|
||||
|
||||
// Catch exceptions since setDaemon can cause a
|
||||
// security exception to be thrown under netscape
|
||||
// in the Applet mode
|
||||
try {
|
||||
thread.setDaemon(true);
|
||||
} catch (Exception e) {
|
||||
// REVISIT - need to do some logging here
|
||||
}
|
||||
wrapper.workerThreadCreated(thread, thread.getContextClassLoader());
|
||||
|
||||
thread.start();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method will return the minimum number of threads maintained
|
||||
* by the threadpool.
|
||||
*/
|
||||
* To be called from the workqueue to create worker threads when none
|
||||
* available.
|
||||
*/
|
||||
void createWorkerThread() {
|
||||
final String name = getName();
|
||||
synchronized (workQueue) {
|
||||
try {
|
||||
if (System.getSecurityManager() == null) {
|
||||
createWorkerThreadHelper(name);
|
||||
} else {
|
||||
// If we get here, we need to create a thread.
|
||||
AccessController.doPrivileged(
|
||||
new PrivilegedAction() {
|
||||
public Object run() {
|
||||
return createWorkerThreadHelper(name);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
// Decrementing the count of current worker threads.
|
||||
// But, it will be increased in the finally block.
|
||||
decrementCurrentNumberOfThreads();
|
||||
wrapper.workerThreadCreationFailure(t);
|
||||
} finally {
|
||||
incrementCurrentNumberOfThreads();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int minimumNumberOfThreads() {
|
||||
return minWorkerThreads;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will return the maximum number of threads in the
|
||||
* threadpool at any point in time, for the life of the threadpool
|
||||
*/
|
||||
public int maximumNumberOfThreads() {
|
||||
return maxWorkerThreads;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will return the time in milliseconds when idle
|
||||
* threads in the threadpool are removed.
|
||||
*/
|
||||
public long idleTimeoutForThreads() {
|
||||
return inactivityTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will return the total number of threads currently in the
|
||||
* threadpool. This method returns a value which is not synchronized.
|
||||
*/
|
||||
public int currentNumberOfThreads() {
|
||||
synchronized (lock) {
|
||||
synchronized (workQueue) {
|
||||
return currentThreadCount;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will return the number of available threads in the
|
||||
* threadpool which are waiting for work. This method returns a
|
||||
* value which is not synchronized.
|
||||
*/
|
||||
void decrementCurrentNumberOfThreads() {
|
||||
synchronized (workQueue) {
|
||||
currentThreadCount--;
|
||||
}
|
||||
}
|
||||
|
||||
void incrementCurrentNumberOfThreads() {
|
||||
synchronized (workQueue) {
|
||||
currentThreadCount++;
|
||||
}
|
||||
}
|
||||
|
||||
public int numberOfAvailableThreads() {
|
||||
synchronized (lock) {
|
||||
synchronized (workQueue) {
|
||||
return availableWorkerThreads;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will return the number of busy threads in the threadpool
|
||||
* This method returns a value which is not synchronized.
|
||||
*/
|
||||
public int numberOfBusyThreads() {
|
||||
synchronized (lock) {
|
||||
synchronized (workQueue) {
|
||||
return (currentThreadCount - availableWorkerThreads);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the average elapsed time taken to complete a Work
|
||||
* item in milliseconds.
|
||||
*/
|
||||
public long averageWorkCompletionTime() {
|
||||
synchronized (lock) {
|
||||
return (totalTimeTaken / processedCount);
|
||||
synchronized (workQueue) {
|
||||
return (totalTimeTaken.get() / processedCount.get());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method returns the number of Work items processed by the threadpool
|
||||
*/
|
||||
public long currentProcessedCount() {
|
||||
synchronized (lock) {
|
||||
return processedCount;
|
||||
synchronized (workQueue) {
|
||||
return processedCount.get();
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,15 +433,37 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
|
||||
|
||||
private static synchronized int getUniqueThreadId() {
|
||||
return ThreadPoolImpl.threadCounter++;
|
||||
return ThreadPoolImpl.threadCounter.incrementAndGet();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will decrement the number of available threads
|
||||
* in the threadpool which are waiting for work. Called from
|
||||
* WorkQueueImpl.requestWork()
|
||||
*/
|
||||
void decrementNumberOfAvailableThreads() {
|
||||
synchronized (workQueue) {
|
||||
availableWorkerThreads--;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will increment the number of available threads
|
||||
* in the threadpool which are waiting for work. Called from
|
||||
* WorkQueueImpl.requestWork()
|
||||
*/
|
||||
void incrementNumberOfAvailableThreads() {
|
||||
synchronized (workQueue) {
|
||||
availableWorkerThreads++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private class WorkerThread extends Thread
|
||||
private class WorkerThread extends Thread implements Closeable
|
||||
{
|
||||
private Work currentWork;
|
||||
private int threadId = 0; // unique id for the thread
|
||||
// thread pool this WorkerThread belongs too
|
||||
private volatile boolean closeCalled = false;
|
||||
private String threadPoolName;
|
||||
// name seen by Thread.getName()
|
||||
private StringBuffer workerThreadName = new StringBuffer();
|
||||
@ -377,100 +475,61 @@ public class ThreadPoolImpl implements ThreadPool
|
||||
setName(composeWorkerThreadName(threadPoolName, "Idle"));
|
||||
}
|
||||
|
||||
public synchronized void close() {
|
||||
closeCalled = true;
|
||||
interrupt();
|
||||
}
|
||||
|
||||
private void resetClassLoader() {
|
||||
|
||||
}
|
||||
|
||||
private void performWork() {
|
||||
long start = System.currentTimeMillis();
|
||||
try {
|
||||
currentWork.doWork();
|
||||
} catch (Throwable t) {
|
||||
wrapper.workerThreadDoWorkThrowable(this, t);
|
||||
}
|
||||
long elapsedTime = System.currentTimeMillis() - start;
|
||||
totalTimeTaken.addAndGet(elapsedTime);
|
||||
processedCount.incrementAndGet();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
while (true) {
|
||||
try {
|
||||
|
||||
synchronized (lock) {
|
||||
availableWorkerThreads++;
|
||||
}
|
||||
|
||||
// Get some work to do
|
||||
currentWork = ((WorkQueueImpl)workQueue).requestWork(inactivityTimeout);
|
||||
|
||||
synchronized (lock) {
|
||||
availableWorkerThreads--;
|
||||
// It is possible in notifyForAvailableWork that the
|
||||
// check for availableWorkerThreads = 0 may return
|
||||
// false, because the availableWorkerThreads has not been
|
||||
// decremented to zero before the producer thread added
|
||||
// work to the queue. This may create a deadlock, if the
|
||||
// executing thread needs information which is in the work
|
||||
// item queued in the workqueue, but has no thread to work
|
||||
// on it since none was created because availableWorkerThreads = 0
|
||||
// returned false.
|
||||
// The following code will ensure that a thread is always available
|
||||
// in those situations
|
||||
if ((availableWorkerThreads == 0) &&
|
||||
(workQueue.workItemsInQueue() > 0)) {
|
||||
createWorkerThread();
|
||||
}
|
||||
}
|
||||
|
||||
// Set the thread name for debugging.
|
||||
setName(composeWorkerThreadName(threadPoolName,
|
||||
Integer.toString(this.threadId)));
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
while (!closeCalled) {
|
||||
try {
|
||||
// Do the work
|
||||
currentWork.doWork();
|
||||
currentWork = ((WorkQueueImpl)workQueue).requestWork(
|
||||
inactivityTimeout);
|
||||
if (currentWork == null)
|
||||
continue;
|
||||
} catch (InterruptedException exc) {
|
||||
wrapper.workQueueThreadInterrupted( exc, getName(),
|
||||
Boolean.valueOf(closeCalled));
|
||||
|
||||
continue ;
|
||||
} catch (Throwable t) {
|
||||
// Ignore all errors.
|
||||
;
|
||||
wrapper.workerThreadThrowableFromRequestWork(this, t,
|
||||
workQueue.getName());
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
|
||||
synchronized (lock) {
|
||||
totalTimeTaken += (end - start);
|
||||
processedCount++;
|
||||
}
|
||||
performWork();
|
||||
|
||||
// set currentWork to null so that the work item can be
|
||||
// garbage collected
|
||||
// garbage collected without waiting for the next work item.
|
||||
currentWork = null;
|
||||
|
||||
setName(composeWorkerThreadName(threadPoolName, "Idle"));
|
||||
|
||||
} catch (TimeoutException e) {
|
||||
// This thread timed out waiting for something to do.
|
||||
|
||||
synchronized (lock) {
|
||||
availableWorkerThreads--;
|
||||
|
||||
// This should for both bounded and unbounded case
|
||||
if (currentThreadCount > minWorkerThreads) {
|
||||
currentThreadCount--;
|
||||
// This thread can exit.
|
||||
return;
|
||||
} else {
|
||||
// Go back to waiting on workQueue
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException ie) {
|
||||
// InterruptedExceptions are
|
||||
// caught here. Thus, threads can be forced out of
|
||||
// requestWork and so they have to reacquire the lock.
|
||||
// Other options include ignoring or
|
||||
// letting this thread die.
|
||||
// Ignoring for now. REVISIT
|
||||
synchronized (lock) {
|
||||
availableWorkerThreads--;
|
||||
}
|
||||
|
||||
} catch (Throwable e) {
|
||||
|
||||
// Ignore any exceptions that currentWork.process
|
||||
// accidently lets through, but let Errors pass.
|
||||
// Add debugging output? REVISIT
|
||||
synchronized (lock) {
|
||||
availableWorkerThreads--;
|
||||
}
|
||||
|
||||
resetClassLoader();
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
// This should not be possible
|
||||
wrapper.workerThreadCaughtUnexpectedThrowable(this,e);
|
||||
} finally {
|
||||
synchronized (workersLock) {
|
||||
workers.remove(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -25,6 +25,15 @@
|
||||
|
||||
package com.sun.corba.se.impl.orbutil.threadpool;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.AccessController;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import com.sun.corba.se.spi.orb.ORB;
|
||||
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.NoSuchThreadPoolException;
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPool;
|
||||
import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolManager;
|
||||
@ -33,21 +42,102 @@ import com.sun.corba.se.spi.orbutil.threadpool.ThreadPoolChooser;
|
||||
import com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl;
|
||||
import com.sun.corba.se.impl.orbutil.ORBConstants;
|
||||
|
||||
import com.sun.corba.se.impl.logging.ORBUtilSystemException;
|
||||
import com.sun.corba.se.impl.orbutil.ORBConstants;
|
||||
import com.sun.corba.se.spi.logging.CORBALogDomains;
|
||||
|
||||
|
||||
public class ThreadPoolManagerImpl implements ThreadPoolManager
|
||||
{
|
||||
private ThreadPool threadPool ;
|
||||
private ThreadPool threadPool;
|
||||
private ThreadGroup threadGroup;
|
||||
|
||||
public ThreadPoolManagerImpl( ThreadGroup tg )
|
||||
{
|
||||
// Use unbounded threadpool in J2SE ORB
|
||||
// ThreadPoolManager from s1as appserver code base can be set in the
|
||||
// ORB. ThreadPools in the appserver are bounded. In that situation
|
||||
// the ThreadPool in this ThreadPoolManager will have its threads
|
||||
// die after the idle timeout.
|
||||
// XXX Should there be cleanup when ORB.shutdown is called if the
|
||||
// ORB owns the ThreadPool?
|
||||
threadPool = new ThreadPoolImpl( tg,
|
||||
ORBConstants.THREADPOOL_DEFAULT_NAME ) ;
|
||||
private static final ORBUtilSystemException wrapper =
|
||||
ORBUtilSystemException.get(CORBALogDomains.RPC_TRANSPORT);
|
||||
|
||||
public ThreadPoolManagerImpl() {
|
||||
threadGroup = getThreadGroup();
|
||||
threadPool = new ThreadPoolImpl(threadGroup,
|
||||
ORBConstants.THREADPOOL_DEFAULT_NAME);
|
||||
}
|
||||
|
||||
private static AtomicInteger tgCount = new AtomicInteger();
|
||||
|
||||
|
||||
private ThreadGroup getThreadGroup() {
|
||||
ThreadGroup tg;
|
||||
|
||||
// See bugs 4916766 and 4936203
|
||||
// We intend to create new threads in a reliable thread group.
|
||||
// This avoids problems if the application/applet
|
||||
// creates a thread group, makes JavaIDL calls which create a new
|
||||
// connection and ReaderThread, and then destroys the thread
|
||||
// group. If our ReaderThreads were to be part of such destroyed thread
|
||||
// group then it might get killed and cause other invoking threads
|
||||
// sharing the same connection to get a non-restartable
|
||||
// CommunicationFailure. We'd like to avoid that.
|
||||
//
|
||||
// Our solution is to create all of our threads in the highest thread
|
||||
// group that we have access to, given our own security clearance.
|
||||
//
|
||||
try {
|
||||
// try to get a thread group that's as high in the threadgroup
|
||||
// parent-child hierarchy, as we can get to.
|
||||
// this will prevent an ORB thread created during applet-init from
|
||||
// being killed when an applet dies.
|
||||
tg = AccessController.doPrivileged(
|
||||
new PrivilegedAction<ThreadGroup>() {
|
||||
public ThreadGroup run() {
|
||||
ThreadGroup tg = Thread.currentThread().getThreadGroup();
|
||||
ThreadGroup ptg = tg;
|
||||
try {
|
||||
while (ptg != null) {
|
||||
tg = ptg;
|
||||
ptg = tg.getParent();
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
// Discontinue going higher on a security exception.
|
||||
}
|
||||
return new ThreadGroup(tg, "ORB ThreadGroup " + tgCount.getAndIncrement());
|
||||
}
|
||||
}
|
||||
);
|
||||
} catch (SecurityException e) {
|
||||
// something wrong, we go back to the original code
|
||||
tg = Thread.currentThread().getThreadGroup();
|
||||
}
|
||||
|
||||
return tg;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
try {
|
||||
threadPool.close();
|
||||
} catch (IOException exc) {
|
||||
wrapper.threadPoolCloseError();
|
||||
}
|
||||
|
||||
try {
|
||||
boolean isDestroyed = threadGroup.isDestroyed();
|
||||
int numThreads = threadGroup.activeCount();
|
||||
int numGroups = threadGroup.activeGroupCount();
|
||||
|
||||
if (isDestroyed) {
|
||||
wrapper.threadGroupIsDestroyed(threadGroup);
|
||||
} else {
|
||||
if (numThreads > 0)
|
||||
wrapper.threadGroupHasActiveThreadsInClose(threadGroup, numThreads);
|
||||
|
||||
if (numGroups > 0)
|
||||
wrapper.threadGroupHasSubGroupsInClose(threadGroup, numGroups);
|
||||
|
||||
threadGroup.destroy();
|
||||
}
|
||||
} catch (IllegalThreadStateException exc) {
|
||||
wrapper.threadGroupDestroyFailed(exc, threadGroup);
|
||||
}
|
||||
|
||||
threadGroup = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -111,24 +111,23 @@ public class WorkQueueImpl implements WorkQueue
|
||||
return workqueueMonitoredObject;
|
||||
}
|
||||
|
||||
public void addWork(Work work) {
|
||||
synchronized (this) {
|
||||
public synchronized void addWork(Work work) {
|
||||
workItemsAdded++;
|
||||
work.setEnqueueTime(System.currentTimeMillis());
|
||||
theWorkQueue.addLast(work);
|
||||
((ThreadPoolImpl)workerThreadPool).notifyForAvailableWork(this);
|
||||
}
|
||||
}
|
||||
|
||||
Work requestWork(long waitTime)
|
||||
throws TimeoutException, InterruptedException
|
||||
synchronized Work requestWork(long waitTime) throws TimeoutException, InterruptedException
|
||||
{
|
||||
Work workItem;
|
||||
synchronized (this) {
|
||||
((ThreadPoolImpl)workerThreadPool).incrementNumberOfAvailableThreads();
|
||||
|
||||
if (theWorkQueue.size() != 0) {
|
||||
workItem = (Work)theWorkQueue.removeFirst();
|
||||
totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime();
|
||||
workItemsDequeued++;
|
||||
((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads();
|
||||
return workItem;
|
||||
}
|
||||
|
||||
@ -145,6 +144,7 @@ public class WorkQueueImpl implements WorkQueue
|
||||
workItem = (Work)theWorkQueue.removeFirst();
|
||||
totalTimeInQueue += System.currentTimeMillis() - workItem.getEnqueueTime();
|
||||
workItemsDequeued++;
|
||||
((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads();
|
||||
return workItem;
|
||||
}
|
||||
|
||||
@ -152,12 +152,13 @@ public class WorkQueueImpl implements WorkQueue
|
||||
|
||||
} while (remainingWaitTime > 0);
|
||||
|
||||
((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads();
|
||||
throw new TimeoutException();
|
||||
|
||||
} catch (InterruptedException ie) {
|
||||
((ThreadPoolImpl)workerThreadPool).decrementNumberOfAvailableThreads();
|
||||
throw ie;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setThreadPool(ThreadPool workerThreadPool) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 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
|
||||
@ -1666,7 +1666,9 @@ public class CorbaMessageMediatorImpl
|
||||
((CDRInputObject)messageMediator.getInputObject()).unmarshalHeader();
|
||||
|
||||
ORB orb = (ORB)messageMediator.getBroker();
|
||||
orb.checkShutdownState();
|
||||
synchronized (orb) {
|
||||
orb.checkShutdownState();
|
||||
}
|
||||
|
||||
ObjectKey okey = messageMediator.getObjectKey();
|
||||
if (orb.subcontractDebugFlag) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -69,8 +69,8 @@ public class SelectorImpl
|
||||
private HashMap listenerThreads;
|
||||
private Map readerThreads;
|
||||
private boolean selectorStarted;
|
||||
private boolean closed;
|
||||
private ORBUtilSystemException wrapper ;
|
||||
private volatile boolean closed;
|
||||
private ORBUtilSystemException wrapper;
|
||||
|
||||
|
||||
public SelectorImpl(ORB orb)
|
||||
|
@ -1,6 +1,6 @@
|
||||
;
|
||||
|
||||
; Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
; Copyright (c) 2003, 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
|
||||
@ -62,6 +62,7 @@
|
||||
(IS_LOCAL_REQUIRES_STUB 43 WARNING "Call to StubAdapter.isLocal did not pass a stub")
|
||||
(REQUEST_REQUIRES_STUB 44 WARNING "Call to StubAdapter.request did not pass a stub")
|
||||
(BAD_ACTIVATE_TIE_CALL 45 WARNING "Call to StubAdapter.activateTie did not pass a valid Tie")
|
||||
(IO_EXCEPTION_ON_CLOSE 46 FINE "Useless exception on call to Closeable.close()")
|
||||
)
|
||||
(BAD_PARAM
|
||||
(NULL_PARAM 1 WARNING "Null parameter")
|
||||
@ -291,7 +292,31 @@
|
||||
(JAVA_STREAM_INIT_FAILED 95 WARNING "Java stream initialization failed")
|
||||
(DUPLICATE_ORB_VERSION_SERVICE_CONTEXT 96 WARNING "An ORBVersionServiceContext was already in the service context list")
|
||||
(DUPLICATE_SENDING_CONTEXT_SERVICE_CONTEXT 97 WARNING "A SendingContextServiceContext was already in the service context list")
|
||||
(WORK_QUEUE_THREAD_INTERRUPTED 98 FINE "Worker Thread from thread pool {0} was interrupted: closeCalled is {1}.")
|
||||
(WORKER_THREAD_CREATED
|
||||
104 FINE "Worker thread {0} has been created with ClassLoader {1}")
|
||||
(WORKER_THREAD_THROWABLE_FROM_REQUEST_WORK
|
||||
109 FINE "Worker thread {0} caught throwable {1} when requesting work from work queue {2}.")
|
||||
(WORKER_THREAD_NOT_NEEDED
|
||||
110 FINE "Worker thread {0} will exit; current thread count, {1}, greater than minunum worker threads needed, {2}.")
|
||||
(WORKER_THREAD_DO_WORK_THROWABLE
|
||||
111 FINE "Worker thread {0} caught throwable {1} while executing work.")
|
||||
(WORKER_THREAD_CAUGHT_UNEXPECTED_THROWABLE
|
||||
112 WARNING "Worker thread {0} caught unexpected throwable {1}.")
|
||||
(WORKER_THREAD_CREATION_FAILURE
|
||||
113 SEVERE "Worker thread creation failure; cause {0}.")
|
||||
(WORKER_THREAD_SET_NAME_FAILURE
|
||||
114 WARNING "Unable to set worker thread {0} name to {1}; cause {2}.")
|
||||
(WORK_QUEUE_REQUEST_WORK_NO_WORK_FOUND
|
||||
116 WARNING "Ignoring unexpected {0} when retrieving of work from work queue, {1}.")
|
||||
(THREAD_POOL_CLOSE_ERROR 126 WARNING "Error in closing ThreadPool")
|
||||
(THREAD_GROUP_IS_DESTROYED 127 WARNING "ThreadGroup {0} is already destroyed: can't destroy it")
|
||||
(THREAD_GROUP_HAS_ACTIVE_THREADS_IN_CLOSE 128 WARNING "ThreadGroup {0} has {1} active threads: destroy may cause exception")
|
||||
(THREAD_GROUP_HAS_SUB_GROUPS_IN_CLOSE 129 WARNING "ThreadGroup {0} has {1} sub-thread groups: destroy may cause exception")
|
||||
(THREAD_GROUP_DESTROY_FAILED 130 WARNING "ThreadGroup {0} could not be destroyed")
|
||||
(INTERRUPTED_JOIN_CALL_WHILE_CLOSING_THREAD_POOL 131 WARNING "Join was interrupted on thread {0} while closing ThreadPool {1}")
|
||||
)
|
||||
|
||||
(MARSHAL
|
||||
(CHUNK_OVERFLOW 1 WARNING "Data read past end of chunk without closing the chunk")
|
||||
(UNEXPECTED_EOF 2 WARNING "Grow buffer strategy called underflow handler")
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -24,6 +24,7 @@
|
||||
*/
|
||||
package com.sun.corba.se.spi.monitoring;
|
||||
|
||||
import java.io.Closeable;
|
||||
import com.sun.corba.se.spi.orb.ORB;
|
||||
import com.sun.corba.se.spi.monitoring.MonitoredObject;
|
||||
import java.util.*;
|
||||
@ -39,7 +40,7 @@ import java.util.*;
|
||||
* @author Hemanth Puttaswamy
|
||||
* </p>
|
||||
*/
|
||||
public interface MonitoringManager {
|
||||
public interface MonitoringManager extends Closeable {
|
||||
|
||||
///////////////////////////////////////
|
||||
// operations
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -40,4 +40,6 @@ public interface MonitoringManagerFactory {
|
||||
*/
|
||||
MonitoringManager createMonitoringManager( String nameOfTheRoot,
|
||||
String description );
|
||||
|
||||
void remove(String nameOfTheRoot);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2004, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -171,7 +171,7 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
|
||||
private static Map staticWrapperMap = new ConcurrentHashMap();
|
||||
|
||||
private MonitoringManager monitoringManager;
|
||||
protected MonitoringManager monitoringManager;
|
||||
|
||||
// There is only one instance of the PresentationManager
|
||||
// that is shared between all ORBs. This is necessary
|
||||
@ -226,6 +226,14 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
globalPM.setStubFactoryFactory( true, dynamicStubFactoryFactory ) ;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
wrapper = null;
|
||||
omgWrapper = null;
|
||||
typeCodeMap = null;
|
||||
primitiveTypeCodeConstants = null;
|
||||
byteBufferPool = null;
|
||||
}
|
||||
|
||||
/** Get the single instance of the PresentationManager
|
||||
*/
|
||||
public static PresentationManager getPresentationManager()
|
||||
@ -302,6 +310,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
// Typecode support: needed in both ORBImpl and ORBSingleton
|
||||
public TypeCodeImpl get_primitive_tc(int kind)
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
try {
|
||||
return primitiveTypeCodeConstants[kind] ;
|
||||
} catch (Throwable t) {
|
||||
@ -311,15 +322,20 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
|
||||
public synchronized void setTypeCode(String id, TypeCodeImpl code)
|
||||
{
|
||||
checkShutdownState();
|
||||
typeCodeMap.put(id, code);
|
||||
}
|
||||
|
||||
public synchronized TypeCodeImpl getTypeCode(String id)
|
||||
{
|
||||
checkShutdownState();
|
||||
return (TypeCodeImpl)typeCodeMap.get(id);
|
||||
}
|
||||
|
||||
public MonitoringManager getMonitoringManager( ) {
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
return monitoringManager;
|
||||
}
|
||||
|
||||
@ -434,6 +450,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
*/
|
||||
public Logger getLogger( String domain )
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
ORBData odata = getORBData() ;
|
||||
|
||||
// Determine the correct ORBId. There are 3 cases:
|
||||
@ -510,6 +529,9 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
|
||||
// This method must also be inherited by both ORB and ORBSingleton.
|
||||
public ByteBufferPool getByteBufferPool()
|
||||
{
|
||||
synchronized (this) {
|
||||
checkShutdownState();
|
||||
}
|
||||
if (byteBufferPool == null)
|
||||
byteBufferPool = new ByteBufferPoolImpl(this);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -25,9 +25,15 @@
|
||||
|
||||
package com.sun.corba.se.spi.orbutil.threadpool;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
public interface ThreadPool
|
||||
/** This interface defines a thread pool execution service. The ORB uses this
|
||||
* interface, which preceeds the JDK 5 ExecutorService. Note that the close
|
||||
* method must be called in order to reclaim thread resources.
|
||||
*/
|
||||
public interface ThreadPool extends Closeable
|
||||
{
|
||||
|
||||
/**
|
||||
* This method will return any instance of the WorkQueue. If the ThreadPool
|
||||
* instance only services one WorkQueue then that WorkQueue instance will
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 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
|
||||
@ -25,7 +25,9 @@
|
||||
|
||||
package com.sun.corba.se.spi.orbutil.threadpool;
|
||||
|
||||
public interface ThreadPoolManager
|
||||
import java.io.Closeable;
|
||||
|
||||
public interface ThreadPoolManager extends Closeable
|
||||
{
|
||||
/**
|
||||
* This method will return an instance of the threadpool given a threadpoolId,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -25,6 +25,8 @@
|
||||
|
||||
package com.sun.corba.se.spi.protocol;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
import org.omg.PortableInterceptor.ObjectReferenceTemplate ;
|
||||
import org.omg.PortableInterceptor.Interceptor ;
|
||||
import org.omg.PortableInterceptor.Current ;
|
||||
@ -51,7 +53,7 @@ import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage ;
|
||||
/** This interface defines the PI interface that is used to interface the rest of the
|
||||
* ORB to the PI implementation.
|
||||
*/
|
||||
public interface PIHandler {
|
||||
public interface PIHandler extends Closeable {
|
||||
/** Complete the initialization of the PIHandler. This will execute the methods
|
||||
* on the ORBInitializers, if any are defined. This must be done here so that
|
||||
* the ORB can obtain the PIHandler BEFORE the ORBInitializers run, since they
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* 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
|
||||
@ -37,33 +37,59 @@ import com.sun.corba.se.spi.oa.ObjectAdapterFactory ;
|
||||
* This is a registry of all subcontract ID dependent objects. This includes:
|
||||
* LocalClientRequestDispatcherFactory, ClientRequestDispatcher, ServerRequestDispatcher, and
|
||||
* ObjectAdapterFactory.
|
||||
* XXX Should the registerXXX methods take an scid or not? I think we
|
||||
* want to do this so that the same instance can be shared across multiple
|
||||
* scids (and this is already true for ObjectAdapterFactory and LocalClientRequestDispatcherFactory),
|
||||
* but this will require some changes for ClientRequestDispatcher and ServerRequestDispatcher.
|
||||
*/
|
||||
public interface RequestDispatcherRegistry {
|
||||
// XXX needs javadocs!
|
||||
|
||||
/** Register a ClientRequestDispatcher for a particular subcontract ID.
|
||||
* The subcontract ID appears in the ObjectKey of an object reference, and is used
|
||||
* to control how a remote method invocation is processed by the ORB for a
|
||||
* particular kind of object reference.
|
||||
*/
|
||||
void registerClientRequestDispatcher( ClientRequestDispatcher csc, int scid) ;
|
||||
|
||||
/** Get the ClientRequestDispatcher for subcontract ID scid.
|
||||
*/
|
||||
ClientRequestDispatcher getClientRequestDispatcher( int scid ) ;
|
||||
|
||||
/** Register a LocalClientRequestDispatcher for a particular subcontract ID.
|
||||
* The subcontract ID appears in the ObjectKey of an object reference, and is used
|
||||
* to control how a particular kind of colocated request is processed.
|
||||
*/
|
||||
void registerLocalClientRequestDispatcherFactory( LocalClientRequestDispatcherFactory csc, int scid) ;
|
||||
|
||||
/** Get the LocalClientRequestDispatcher for subcontract ID scid.
|
||||
*/
|
||||
LocalClientRequestDispatcherFactory getLocalClientRequestDispatcherFactory( int scid ) ;
|
||||
|
||||
/** Register a CorbaServerRequestDispatcher for a particular subcontract ID.
|
||||
* The subcontract ID appears in the ObjectKey of an object reference, and is used
|
||||
* to control how a particular kind of request is processed when received by the ORB.
|
||||
*/
|
||||
void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, int scid) ;
|
||||
|
||||
/** Get the CorbaServerRequestDispatcher for subcontract ID scid.
|
||||
*/
|
||||
CorbaServerRequestDispatcher getServerRequestDispatcher(int scid) ;
|
||||
|
||||
/** Register a CorbaServerRequestDispatcher for handling an explicit object key name.
|
||||
* This is used for non-standard invocations such as INS and the bootstrap name service.
|
||||
*/
|
||||
void registerServerRequestDispatcher( CorbaServerRequestDispatcher ssc, String name ) ;
|
||||
|
||||
/** Get the CorbaServerRequestDispatcher for a particular object key.
|
||||
*/
|
||||
CorbaServerRequestDispatcher getServerRequestDispatcher( String name ) ;
|
||||
|
||||
/** Register an ObjectAdapterFactory for a particular subcontract ID.
|
||||
* This controls how Object references are created and managed.
|
||||
*/
|
||||
void registerObjectAdapterFactory( ObjectAdapterFactory oaf, int scid) ;
|
||||
|
||||
/** Get the ObjectAdapterFactory for a particular subcontract ID scid.
|
||||
*/
|
||||
ObjectAdapterFactory getObjectAdapterFactory( int scid ) ;
|
||||
|
||||
Set getObjectAdapterFactories() ;
|
||||
/** Return the set of all ObjectAdapterFactory instances that are registered.
|
||||
*/
|
||||
Set<ObjectAdapterFactory> getObjectAdapterFactories();
|
||||
}
|
||||
|
@ -258,3 +258,4 @@ e77b8e0ed1f84e3e268239e276c7ab64fa573baa jdk8-b43
|
||||
831e5c76a20af18f3c08c5a95ed31be0e128a010 jdk8-b44
|
||||
9d5f20961bc5846fa8d098d534effafbbdae0a58 jdk8-b45
|
||||
40e5a3f2907ed02b335c7caa8ecf068cc801380d hs24-b15
|
||||
cf37a594c38db2ea926954154636f9f81da2e032 jdk8-b46
|
||||
|
@ -167,3 +167,4 @@ f95fdbe525c88ef0d57dc1390be6582a8af5e07c jdk8-b39
|
||||
eff4ece9c8bc43b3ce2b3758574c4c20147f0689 jdk8-b43
|
||||
0b3f3a4ce13930430b32b616a717dfc7fe385b28 jdk8-b44
|
||||
57476f66e13c55eea2f2fe2b858369a4c64b9936 jdk8-b45
|
||||
300f45e990643af230d6cca39477ff62c44a9a54 jdk8-b46
|
||||
|
@ -2609,6 +2609,18 @@ protected static final String PARSER_SETTINGS =
|
||||
if (str == null) {
|
||||
return str;
|
||||
}
|
||||
int len = str.length(), i=0, ch;
|
||||
for (; i < len; i++) {
|
||||
ch = str.charAt(i);
|
||||
// if it's not an ASCII 7 character, break here, and use UTF-8 encoding
|
||||
if (ch >= 128)
|
||||
break;
|
||||
}
|
||||
|
||||
// we saw no non-ascii-7 character
|
||||
if (i == len) {
|
||||
return str;
|
||||
}
|
||||
|
||||
// get UTF-8 bytes for the string
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
@ -2620,11 +2632,11 @@ protected static final String PARSER_SETTINGS =
|
||||
// should never happen
|
||||
return str;
|
||||
}
|
||||
int len = bytes.length;
|
||||
int ch;
|
||||
|
||||
len = bytes.length;
|
||||
|
||||
// for each byte
|
||||
for (int i = 0; i < len; i++) {
|
||||
for (i = 0; i < len; i++) {
|
||||
b = bytes[i];
|
||||
// for non-ascii character: make it positive, then escape
|
||||
if (b < 0) {
|
||||
|
@ -167,3 +167,4 @@ cf5c1f6fbc5ba14163fe0ef8eb8601b33f951372 jdk8-b42
|
||||
b3246687c3695dff6f461bb407f9db88f7d072e7 jdk8-b43
|
||||
db471a7af03168e4441c245b1d9976f720a7cb77 jdk8-b44
|
||||
b92353a01aa049bc508fc56f0347d5934b7c4390 jdk8-b45
|
||||
8d2ed9d58453c8049715a72a6d26b6b66b37a94c jdk8-b46
|
||||
|
@ -215,7 +215,7 @@ define SetupJVMTIDemo
|
||||
# Param 5 = libs for posix
|
||||
# Param 6 = libs for winapi
|
||||
# Param 7 = libs for solaris
|
||||
BUILD_DEMO_JVMTI_$1_EXTRA_SRC:= $$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/demo/jvmti/$1) \
|
||||
BUILD_DEMO_JVMTI_$1_EXTRA_SRC:= $$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/demo/jvmti/$1) \
|
||||
$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2))
|
||||
BUILD_DEMO_JVMTI_$1_EXTRA_INC:=$$(addprefix -I,$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
|
||||
BUILD_DEMO_JVMTI_$1_LANG:=C
|
||||
@ -227,18 +227,26 @@ define SetupJVMTIDemo
|
||||
$1_EXTRA_CXX:=$(LIBCXX)
|
||||
BUILD_DEMO_JVMTI_$1_O_FLAG:=$(CXX_O_FLAG_NORM)
|
||||
endif
|
||||
|
||||
$1_CXXFLAGS:=$(CXXFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
|
||||
ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH),waiters-sparc)
|
||||
$1_FILTER:=-xregs=no%appl
|
||||
$1_CXXFLAGS:=$$(filter-out $$($1_FILTER),$$($1_CXXFLAGS))
|
||||
endif
|
||||
|
||||
$$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1,\
|
||||
SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
|
||||
LANG:=$$(BUILD_DEMO_JVMTI_$1_LANG),\
|
||||
CFLAGS:=$(CFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
|
||||
CXXFLAGS:=$(CXXFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
|
||||
CXXFLAGS:=$$($1_CXXFLAGS),\
|
||||
LDFLAGS:=$(LDFLAGS_JDKLIB),\
|
||||
LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\
|
||||
LDFLAGS_SUFFIX_posix:=$5,\
|
||||
LDFLAGS_SUFFIX_winapi:=$6,\
|
||||
LDFLAGS_SUFFIX_solaris:=-lc $7,\
|
||||
BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\
|
||||
LIB:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)))
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\
|
||||
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib,\
|
||||
LIBRARY:=$1))
|
||||
|
||||
$$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1,\
|
||||
SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
|
||||
@ -262,7 +270,7 @@ define SetupJVMTIDemo
|
||||
BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar
|
||||
endif
|
||||
|
||||
BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX) \
|
||||
BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
|
||||
$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip \
|
||||
$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt
|
||||
endef
|
||||
@ -274,7 +282,7 @@ $(eval $(call SetupJVMTIDemo,heapViewer, agent_util))
|
||||
# hprof contains error messages using __FILE__ macro. These expand to the absolute path
|
||||
# in the new build system and relative in the old, causing the binaries to differ.
|
||||
$(eval $(call SetupJVMTIDemo,hprof, java_crw_demo,\
|
||||
-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt,C,\
|
||||
-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/npt,C,\
|
||||
-ldl,ws2_32.lib winmm.lib,-lsocket -lnsl))
|
||||
|
||||
$(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo))
|
||||
@ -349,7 +357,7 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/README
|
||||
|
||||
##################################################################################################
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
|
||||
$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
|
||||
$(MKDIR) -p $(@D)
|
||||
@ -386,8 +394,9 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER,\
|
||||
CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
|
||||
-I$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
|
||||
LDFLAGS:=$(LDFLAGS_JDKLIB), \
|
||||
BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller,\
|
||||
LIB:=$(JDK_OUTPUTDIR)/newdemoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)))
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller,\
|
||||
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/newdemoobjs, \
|
||||
LIBRARY:=Poller))
|
||||
|
||||
#
|
||||
# We can only compile native code after jar has been build (since we depend on generated .h files)
|
||||
|
@ -45,7 +45,7 @@ EXCLUDES += com/sun/pept \
|
||||
com/sun/tools/example/debug/gui \
|
||||
com/oracle/security
|
||||
|
||||
ifeq ($(PLATFORM)-$(ARCH_DATA_MODEL),windows-64)
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL),windows-64)
|
||||
EXCLUDES += sun/security/pkcs11
|
||||
endif
|
||||
|
||||
@ -61,7 +61,7 @@ ifndef OPENJDK
|
||||
EXFILES := $(JDK_TOPDIR)/src/share/classes/javax/crypto/JarVerifier.java
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM),solaris)
|
||||
ifneq ($(OPENJDK_TARGET_OS),solaris)
|
||||
# Exclude Solaris nio and two security related files in src/share/classes
|
||||
EXFILES += SolarisAclFileAttributeView.java \
|
||||
SolarisFileStore.java \
|
||||
@ -71,37 +71,34 @@ ifneq ($(PLATFORM),solaris)
|
||||
SolarisUserDefinedFileAttributeView.java \
|
||||
SolarisWatchService.java \
|
||||
SolarisAclFileAttributeView.java \
|
||||
SolarisFileStore.java \
|
||||
SolarisFileSystem.java \
|
||||
SolarisFileSystemProvider.java \
|
||||
SolarisUserDefinedFileAttributeView.java \
|
||||
SolarisNativeDispatcher.java \
|
||||
SolarisWatchService.java \
|
||||
SolarisLoginModule.java \
|
||||
SolarisSystem.java \
|
||||
sun/nio/ch/EventPortSelectorImpl.java \
|
||||
sun/nio/ch/EventPortSelectorProvider.java \
|
||||
sun/nio/ch/EventPortWrapper.java \
|
||||
sun/tools/attach/SolarisAttachProvider.java \
|
||||
sun/tools/attach/SolarisVirtualMachine.java
|
||||
endif
|
||||
|
||||
# In the old build, this isn't excluded on macosx, even though it probably
|
||||
# should be.
|
||||
ifneq ($(PLATFORM),macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
EXFILES+=WrapperGenerator.java
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM),windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS),windows)
|
||||
# Exclude Window security related files in src/share/classes
|
||||
EXFILES+=NTLoginModule.java \
|
||||
NTSystem.java
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
# Don't build GTK L&F on Windows
|
||||
EXCLUDES+= com/sun/java/swing/plaf/gtk
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM),linux)
|
||||
ifneq ($(OPENJDK_TARGET_OS),linux)
|
||||
EXFILES+=sun/tools/attach/LinuxAttachProvider.java \
|
||||
sun/tools/attach/LinuxVirtualMachine.java \
|
||||
sun/nio/fs/LinuxDosFileAttributeView.java \
|
||||
@ -113,7 +110,7 @@ ifneq ($(PLATFORM),linux)
|
||||
sun/nio/fs/LinuxWatchService.java
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM),macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
EXFILES+=sun/nio/fs/BsdFileStore.java \
|
||||
sun/nio/fs/BsdFileSystem.java \
|
||||
sun/nio/fs/BsdFileSystemProvider.java \
|
||||
@ -137,11 +134,11 @@ ifdef OPENJDK
|
||||
endif
|
||||
|
||||
# Used on windows and macosx
|
||||
ifeq (,$(filter $(PLATFORM), windows macosx))
|
||||
ifeq (,$(filter $(OPENJDK_TARGET_OS), windows macosx))
|
||||
EXFILES+=sun/awt/AWTCharset.java
|
||||
endif
|
||||
|
||||
ifneq ($(PLATFORM), macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
#
|
||||
# Not in rt.jar on solaris and linux...(windows not checked)
|
||||
# in rt.jar on macosx ??
|
||||
@ -192,7 +189,7 @@ endif
|
||||
# Exclude another implicitly not included file.
|
||||
EXFILES+=sun/util/locale/AsciiUtil.java
|
||||
|
||||
ifeq (,$(filter $(PLATFORM), solaris macosx))
|
||||
ifeq (,$(filter $(OPENJDK_TARGET_OS), solaris macosx))
|
||||
#
|
||||
# only solaris and macosx
|
||||
#
|
||||
@ -205,7 +202,7 @@ EXFILES+=-linux-arm.java \
|
||||
-linux-ppc.java
|
||||
|
||||
# TODO: Is this necessary?
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
EXFILES+=sun/nio/ch/AbstractPollSelectorImpl.java \
|
||||
sun/nio/ch/DevPollArrayWrapper.java \
|
||||
sun/nio/ch/DevPollSelectorImpl.java \
|
||||
@ -248,18 +245,24 @@ include CopyIntoClasses.gmk
|
||||
|
||||
ifndef OPENJDK
|
||||
CLOSED_SRC_DIRS:=$(JDK_TOPDIR)/src/closed/share/classes \
|
||||
$(JDK_TOPDIR)/src/closed/$(LEGACY_HOST_OS_API)/classes
|
||||
$(JDK_TOPDIR)/src/closed/$(LEGACY_OPENJDK_TARGET_OS_API)/classes
|
||||
endif
|
||||
|
||||
MACOSX_SRC_DIRS :=
|
||||
ifeq ($(PLATFORM),macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/classes
|
||||
|
||||
# this files are duplicated in MACOSX_SRC_DIRS
|
||||
EXFILES+= $(JDK_TOPDIR)/src/solaris/classes/sun/nio/ch/DefaultSelectorProvider.java \
|
||||
$(JDK_TOPDIR)/src/solaris/classes/sun/java2d/BackBufferCapsProvider.java \
|
||||
$(JDK_TOPDIR)/src/solaris/classes/java/net/DefaultInterface.java \
|
||||
$(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java
|
||||
$(JDK_TOPDIR)/src/solaris/classes/java/lang/ClassLoaderHelper.java
|
||||
|
||||
# JObjC.jar contains 1.5 byte-code...so skip it here :-(
|
||||
# MACOSX_SRC_DIRS += $(JDK_TOPDIR)/src/macosx/native/jobjc/src
|
||||
# EXCLUDES+= tests/java/com/apple/jobjc
|
||||
|
||||
EXCLUDES+= com/apple/jobjc
|
||||
endif
|
||||
|
||||
# The exception handling of swing beaninfo
|
||||
@ -272,7 +275,7 @@ $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: $(JDK_TOPDIR)/make/t
|
||||
$(eval $(call SetupJavaCompilation,BUILD_JDK,\
|
||||
SETUP:=GENERATE_JDKBYTECODE,\
|
||||
SRC:=$(JDK_TOPDIR)/src/share/classes \
|
||||
$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes \
|
||||
$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes \
|
||||
$(MACOSX_SRC_DIRS) \
|
||||
$(JDK_OUTPUTDIR)/gensrc \
|
||||
$(JDK_OUTPUTDIR)/gensrc_swing/javax/swing/beaninfo \
|
||||
@ -297,7 +300,7 @@ JDK_BASE_HEADER_CLASSES:=java.lang.Integer \
|
||||
JDK_BASE_HEADER_JAVA_FILES:=$(patsubst %,$(JDK_TOPDIR)/src/share/classes/%.java,\
|
||||
$(subst .,/,$(JDK_BASE_HEADER_CLASSES)))
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
JDK_BASE_HEADER_CLASSES_WINDOWS:=sun.nio.ch.PollArrayWrapper
|
||||
JDK_BASE_HEADER_CLASSES+=$(JDK_BASE_HEADER_CLASSES_WINDOWS)
|
||||
JDK_BASE_HEADER_JAVA_FILES+=$(patsubst %,$(JDK_TOPDIR)/src/windows/classes/%.java,\
|
||||
@ -348,6 +351,53 @@ $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin:
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
#
|
||||
# JObjC.jar is compiled with BOOT_JAVAC which (may) not support the "-h" flag.
|
||||
# so we first compile classes with BOOT_JAVAC and then with JDK_JAVAC :-(
|
||||
#
|
||||
$(eval $(call SetupJavaCompiler,GENERATE_15BYTECODE,\
|
||||
JAVAC:=$(JAVAC),\
|
||||
FLAGS:=-source 1.5 -target 1.5 -g -bootclasspath $(BOOT_RTJAR) -cp $(JDK_OUTPUTDIR)/../langtools/dist/lib/classes.jar $(DISABLE_WARNINGS),\
|
||||
SERVER_DIR:=$(JAVAC_SERVERS),\
|
||||
SERVER_JVM:=$(SERVER_JAVA),\
|
||||
MODE:=$(JAVAC_USE_MODE),\
|
||||
USE_DEPS:=$(JAVAC_USE_DEPS)))
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_JOBJC_JAR,\
|
||||
SETUP:=GENERATE_15BYTECODE,\
|
||||
SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
|
||||
$(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
|
||||
$(JDK_OUTPUTDIR)/gensrc, \
|
||||
INCLUDES := com/apple/jobjc,\
|
||||
EXCLUDES := tests/java/com/apple/jobjc,\
|
||||
BIN:=$(JDK_OUTPUTDIR)/jobjc_classes,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/JObjC.jar, \
|
||||
JARINDEX := true))
|
||||
|
||||
$(BUILD_JOBJC_JAR) : $(BUILD_JDK)
|
||||
|
||||
JARS += $(JDK_OUTPUTDIR)/lib/JObjC.jar
|
||||
|
||||
$(eval $(call SetupJavaCompilation,BUILD_JOBJC_HEADERS_JAR,\
|
||||
SETUP:=GENERATE_JDKBYTECODE,\
|
||||
SRC:=$(JDK_TOPDIR)/src/macosx/native/jobjc/src/core/java \
|
||||
$(JDK_TOPDIR)/src/macosx/native/jobjc/src/runtime-additions/java \
|
||||
$(JDK_OUTPUTDIR)/gensrc, \
|
||||
INCLUDES := com/apple/jobjc,\
|
||||
EXCLUDES := tests/java/com/apple/jobjc,\
|
||||
BIN:=$(JDK_OUTPUTDIR)/jobjc_classes_headers,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/jobjc_classes_headers/dummy.jar, \
|
||||
HEADERS:=$(JDK_OUTPUTDIR)/gensrc_headers))
|
||||
|
||||
$(BUILD_JOBJC_HEADERS_JAR) : $(BUILD_JDK)
|
||||
|
||||
JARS += $(JDK_OUTPUTDIR)/jobjc_classes_headers/dummy.jar
|
||||
|
||||
endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# copy with -a to preserve timestamps so dependencies down the line aren't messed up
|
||||
all: $(BUILD_JDK) $(JARS) $(COPY_EXTRA) $(JDK_OUTPUTDIR)/classes/META-INF/services/com.sun.tools.xjc.Plugin \
|
||||
$(JDK_OUTPUTDIR)/classes/_the.jdk.base.headers
|
||||
|
@ -32,17 +32,25 @@ include NativeCompilation.gmk
|
||||
# Setup the java compilers for the JDK build.
|
||||
include Setup.gmk
|
||||
|
||||
# Build tools
|
||||
include Tools.gmk
|
||||
|
||||
BUILD_LAUNCHERS=
|
||||
|
||||
define SetupLauncher
|
||||
# TODO: Fix mapfile on solaris. Won't work with ld as linker.
|
||||
# Parameter 1 is the name of the launcher (java,javac,jar...)
|
||||
# Parameter 2 are extra CFLAGS
|
||||
# Parameter 3 are extra LDFLAGS
|
||||
# Parameter 4 are extra LDFLAGS_SUFFIX_posix
|
||||
# Parameter 5 are extra LDFLAGS_SUFFIX_winapi
|
||||
# Parameter 2 is extra CFLAGS
|
||||
# Parameter 3 is extra LDFLAGS
|
||||
# Parameter 4 is extra LDFLAGS_SUFFIX_posix
|
||||
# Parameter 5 is extra LDFLAGS_SUFFIX_winapi
|
||||
# Parameter 6 is optional Windows JLI library (full path)
|
||||
# Parameter 7 is optional Windows resource (RC) flags
|
||||
# Parameter 8 is optional Windows version resource file (.rc)
|
||||
# Parameter 9 is different output dir
|
||||
# Parameter 10 is FULL DEBUG SYMBOLS (set value to turn OFF, since most(all) seems to have it)
|
||||
|
||||
$1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/jli.lib
|
||||
$1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/libjli/jli.lib
|
||||
ifneq ($6,)
|
||||
$1_WINDOWS_JLI_LIB:=$6
|
||||
endif
|
||||
@ -51,33 +59,73 @@ define SetupLauncher
|
||||
$1_VERSION_INFO_RESOURCE:=$8
|
||||
endif
|
||||
|
||||
$1_LDFLAGS := $3
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
$1_LDFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
|
||||
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
|
||||
endif
|
||||
|
||||
$1_LDFLAGS_SUFFIX :=
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
$1_LDFLAGS_SUFFIX += -lz
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
$1_LDFLAGS_SUFFIX += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
|
||||
-framework Cocoa -framework Security -framework ApplicationServices \
|
||||
-sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/Info-cmdline.plist
|
||||
endif
|
||||
|
||||
|
||||
$1_OUTPUT_DIR_ARG:=$9
|
||||
ifeq (,$$($1_OUTPUT_DIR_ARG))
|
||||
$1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
|
||||
endif
|
||||
|
||||
$1_DEBUG_SYMBOLS:=yes
|
||||
ifneq (,$(10))
|
||||
$1_DEBUG_SYMBOLS:=
|
||||
endif
|
||||
|
||||
$1_OPTIMIZATION:= LOW
|
||||
|
||||
# TODO: maybe it's better to move this if-statement out of this function
|
||||
ifeq ($(1),java)
|
||||
$1_OPTIMIZATION:=HIGH
|
||||
endif
|
||||
|
||||
$(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
|
||||
SRC:=$(JDK_TOPDIR)/src/share/bin,\
|
||||
INCLUDE_FILES:=main.c,\
|
||||
LANG:=C,\
|
||||
CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \
|
||||
OPTIMIZATION :=$$($1_OPTIMIZATION), \
|
||||
CFLAGS:=$(CFLAGS_JDKEXE) \
|
||||
-I$(JDK_TOPDIR)/src/share/bin \
|
||||
-I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin \
|
||||
-I$(JDK_TOPDIR)/src/$(PLATFORM)/bin \
|
||||
-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin \
|
||||
-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
|
||||
-DFULL_VERSION='"$(FULL_VERSION)"' \
|
||||
-DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
|
||||
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
|
||||
-DLIBARCHNAME='"$(ARCH)"' \
|
||||
-DLAUNCHER_NAME='"openjdk"' \
|
||||
-DLAUNCHER_NAME='"java"' \
|
||||
-DPROGNAME='"$1"' $(DPACKAGEPATH) \
|
||||
$2,\
|
||||
CFLAGS_linux:=-fPIC,\
|
||||
CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
|
||||
LDFLAGS:=$(LDFLAGS_JDKEXE) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN,../lib/$(LIBARCH)/jli) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN,../jre/lib/$(LIBARCH)/jli) \
|
||||
$3,\
|
||||
$$($1_LDFLAGS),\
|
||||
MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(ARCH), \
|
||||
LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX),\
|
||||
LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX),\
|
||||
LDFLAGS_SUFFIX_posix:=$4 -lc,\
|
||||
LDFLAGS_SUFFIX_winapi:=$$($1_WINDOWS_JLI_LIB) \
|
||||
$(JDK_OUTPUTDIR)/objs/java.lib advapi32.lib $5,\
|
||||
BIN:=$(JDK_OUTPUTDIR)/objs/$1_objs,\
|
||||
EXE:=$(JDK_OUTPUTDIR)/objs/$1$(EXE_SUFFIX),\
|
||||
$(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5,\
|
||||
LDFLAGS_SUFFIX_solaris := -lthread $(LIBDL), \
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/$1_objs,\
|
||||
OUTPUT_DIR:=$$($1_OUTPUT_DIR_ARG),\
|
||||
PROGRAM:=$1,\
|
||||
DEBUG_SYMBOLS:=$$($1_DEBUG_SYMBOLS),\
|
||||
VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
|
||||
RC_FLAGS:=$(RC_FLAGS)\
|
||||
/D "JDK_FNAME=$1$(EXE_SUFFIX)" \
|
||||
@ -86,13 +134,22 @@ define SetupLauncher
|
||||
$7,\
|
||||
MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
|
||||
|
||||
BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX)
|
||||
BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
$$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjli_static.a
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
$$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
|
||||
$$($1_WINDOWS_JLI_LIB)
|
||||
endif
|
||||
endef
|
||||
|
||||
##########################################################################################
|
||||
|
||||
XLIBS:=-lX11
|
||||
ifeq ($(PLATFORM),macosx)
|
||||
XLIBS:=$(X_LIBS) -lX11
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"'
|
||||
XLIBS:=
|
||||
endif
|
||||
@ -108,17 +165,17 @@ $(eval $(call SetupLauncher,java,\
|
||||
$(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
|
||||
$(JDK_TOPDIR)/src/windows/resource/java.rc))
|
||||
|
||||
ifeq ($(HOST_OS),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
$(eval $(call SetupLauncher,javaw,\
|
||||
-DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
|
||||
$(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
|
||||
$(JDK_TOPDIR)/src/windows/resource/java.rc))
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS),solaris)
|
||||
THREAD_LIB:=-lthread
|
||||
endif
|
||||
ifeq ($(PLATFORM),linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS),linux)
|
||||
THREAD_LIB:=-lpthread
|
||||
endif
|
||||
|
||||
@ -271,7 +328,7 @@ $(eval $(call SetupLauncher,rmiregistry,\
|
||||
$(eval $(call SetupLauncher,jcmd,\
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
$(eval $(call SetupLauncher,kinit,\
|
||||
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
|
||||
|
||||
@ -286,8 +343,10 @@ endif
|
||||
# The order of the object files on the link command line affects the size of the resulting
|
||||
# binary (at least on linux) which causes the size to differ between old and new build.
|
||||
ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
|
||||
UNPACKEXE_ZIPOBJS := -lz
|
||||
else
|
||||
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
|
||||
UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
|
||||
$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
|
||||
$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
|
||||
@ -299,27 +358,31 @@ UNPACKEXE_ZIPOBJS := $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
|
||||
$(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
|
||||
$(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
|
||||
|
||||
endif
|
||||
|
||||
$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
|
||||
UNPACKEXE_CFLAGS += -xregs=no%appl
|
||||
endif
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
|
||||
SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
|
||||
EXCLUDE_FILES:=jni.cpp,\
|
||||
LANG:=C,\
|
||||
CFLAGS:=$(CXXFLAGS_JDKEXE) $(CXX_O_FLAG_NORM) \
|
||||
-DFULL \
|
||||
-I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
|
||||
-DFULL, \
|
||||
CFLAGS_release:=-DPRODUCT,\
|
||||
CFLAGS_linux:=-fPIC,\
|
||||
CFLAGS_solaris := -KPIC, \
|
||||
CFLAGS_macosx := -fPIC, \
|
||||
MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200, \
|
||||
LDFLAGS:=$(LDFLAGS_JDKEXE) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_SUFFIX:=$(UNPACKEXE_ZIPOBJS) $(LIBCXX),\
|
||||
LDFLAGS_SUFFIX_solaris:=-lc,\
|
||||
BIN:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
|
||||
EXE:=$(JDK_OUTPUTDIR)/objs/unpack200$(EXE_SUFFIX),\
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
|
||||
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
|
||||
PROGRAM:=unpack200,\
|
||||
VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
|
||||
RC_FLAGS:=$(RC_FLAGS)\
|
||||
/D "JDK_FNAME=unpack200.exe" \
|
||||
@ -327,7 +390,13 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
|
||||
/D "JDK_FTYPE=0x1L",\
|
||||
MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
|
||||
|
||||
BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
|
||||
ifneq ($(USE_EXTERNAL_LIBZ), true)
|
||||
|
||||
$(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
|
||||
|
||||
endif
|
||||
|
||||
BUILD_LAUNCHERS += $(BUILD_UNPACKEXE)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
@ -335,7 +404,7 @@ BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
|
||||
BUILD_JEXEC :=
|
||||
BUILD_JEXEC_SRC :=
|
||||
BUILD_JEXEC_INC :=
|
||||
BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/jexec$(EXE_SUFFIX)
|
||||
BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)
|
||||
|
||||
#
|
||||
# UNHANDLED:
|
||||
@ -345,30 +414,30 @@ BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/jexec$(EXE_SUFFIX)
|
||||
#
|
||||
# jdk/make/java/Makefile
|
||||
#
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
BUILD_JEXEC := 1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
BUILD_JEXEC := 1
|
||||
endif # PLATFORM
|
||||
endif # OPENJDK_TARGET_OS
|
||||
|
||||
#
|
||||
# jdk/make/java/jexec/Makefile
|
||||
#
|
||||
ifeq ($(BUILD_JEXEC), 1)
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
else ifeq ($(PLATFORM),macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
else ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
|
||||
else
|
||||
BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/jexec$(EXE_SUFFIX)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
|
||||
BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
|
||||
endif
|
||||
endif
|
||||
@ -382,13 +451,15 @@ ifneq ($(BUILD_JEXEC_SRC),)
|
||||
SRC:=$(BUILD_JEXEC_SRC),\
|
||||
INCLUDE_FILES:=jexec.c,\
|
||||
LANG:=C,\
|
||||
CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS:=$(CFLAGS_JDKEXE)\
|
||||
$(BUILD_JEXEC_INC), \
|
||||
LDFLAGS:=$(LDFLAGS_JDKEXE), \
|
||||
BIN:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
|
||||
EXE:=$(BUILD_JEXEC_DST)))
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
|
||||
OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
|
||||
PROGRAM:=jexec))
|
||||
|
||||
BUILD_LAUNCHERS += $(BUILD_JEXEC_DST)
|
||||
BUILD_LAUNCHERS += $(BUILD_JEXEC)
|
||||
endif
|
||||
|
||||
##########################################################################################
|
||||
@ -397,10 +468,10 @@ endif
|
||||
# The java-rmi.cgi script in bin/ only gets delivered in certain situations
|
||||
#
|
||||
JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin/java-rmi.cgi
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
|
||||
endif
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
|
||||
endif
|
||||
@ -413,12 +484,13 @@ endif
|
||||
# images bin dir. This weird behavior is mimicked here in the converted makefiles for
|
||||
# now. Should probably just be deleted.
|
||||
# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
|
||||
ifeq ($(HOST_OS_API),winapi)
|
||||
ifeq ($(OPENJDK_TARGET_OS_API),winapi)
|
||||
$(eval $(call SetupLauncher,java-rmi,\
|
||||
-DEXPAND_CLASSPATH_WILDCARDS,\
|
||||
$(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH))))
|
||||
$(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH)),\
|
||||
,,,,,$(JDK_OUTPUTDIR)/objs))
|
||||
|
||||
$(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/objs/java-rmi$(EXE_SUFFIX)
|
||||
$(JAVA_RMI_CGI): $(BUILD_LAUNCHER_java-rmi)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
|
||||
@ -432,11 +504,6 @@ endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/objs/%
|
||||
$(ECHO) Copying $(@F)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
|
||||
$(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
|
||||
|
||||
all: $(BUILD_LAUNCHERS)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,12 +25,12 @@
|
||||
|
||||
INCLUDEDIR = $(JDK_OUTPUTDIR)/include
|
||||
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM)
|
||||
OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/$(OPENJDK_TARGET_OS)
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/win32
|
||||
else ifeq ($(PLATFORM), macosx)
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/darwin
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/win32
|
||||
else ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
OPENJDK_TARGET_OS_INCLUDE = $(INCLUDEDIR)/darwin
|
||||
endif
|
||||
|
||||
#
|
||||
@ -42,15 +42,15 @@ H_TARGET_FILES =$(INCLUDEDIR)/jdwpTransport.h \
|
||||
$(INCLUDEDIR)/jvmticmlr.h \
|
||||
$(INCLUDEDIR)/classfile_constants.h \
|
||||
$(INCLUDEDIR)/jawt.h \
|
||||
$(PLATFORM_INCLUDE)/jni_md.h \
|
||||
$(PLATFORM_INCLUDE)/jawt_md.h
|
||||
$(OPENJDK_TARGET_OS_INCLUDE)/jni_md.h \
|
||||
$(OPENJDK_TARGET_OS_INCLUDE)/jawt_md.h
|
||||
|
||||
$(INCLUDEDIR)/%.h: $(JDK_TOPDIR)/src/share/javavm/export/%.h
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@
|
||||
$(CP) $< $@
|
||||
|
||||
$(PLATFORM_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/javavm/export/%.h
|
||||
$(OPENJDK_TARGET_OS_INCLUDE)/%.h: $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/javavm/export/%.h
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@
|
||||
$(CP) $< $@
|
||||
@ -83,6 +83,13 @@ $(MGMT_LIBDIR)/management.properties: $(MGMT_LIB_SRC)/management.properties
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 644 $@
|
||||
|
||||
# this file has different permissions...don't know why...
|
||||
$(MGMT_LIBDIR)/jmxremote.access: $(MGMT_LIB_SRC)/jmxremote.access
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 644 $@
|
||||
|
||||
$(MGMT_LIBDIR)/%: $(MGMT_LIB_SRC)/%
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@
|
||||
@ -121,9 +128,13 @@ COPY_FILES += $(PSFONTPROPFILE_TARGET_FILES)
|
||||
#
|
||||
# Copy flavormap.properties, cursor.properties and cursors gif files to LIBDIR
|
||||
#
|
||||
PLATFORM_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib
|
||||
else
|
||||
OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/macosx/lib
|
||||
endif
|
||||
|
||||
$(LIBDIR)/flavormap.properties: $(PLATFORM_LIB_SRC)/flavormap.properties
|
||||
$(LIBDIR)/flavormap.properties: $(OPENJDK_TARGET_OS_LIB_SRC)/flavormap.properties
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@
|
||||
$(CP) $< $@
|
||||
@ -131,9 +142,9 @@ $(LIBDIR)/flavormap.properties: $(PLATFORM_LIB_SRC)/flavormap.properties
|
||||
COPY_FILES += $(LIBDIR)/flavormap.properties
|
||||
|
||||
CURSORS_DEST_DIR = $(LIBDIR)/images/cursors
|
||||
CURSORS_PLATFORM_LIB_SRC = $(PLATFORM_LIB_SRC)/images/cursors
|
||||
CURSORS_OPENJDK_TARGET_OS_LIB_SRC = $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib/images/cursors
|
||||
|
||||
$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_PLATFORM_LIB_SRC)/cursors.properties
|
||||
$(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_OPENJDK_TARGET_OS_LIB_SRC)/cursors.properties
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@
|
||||
$(CP) $< $@
|
||||
@ -141,11 +152,11 @@ $(CURSORS_DEST_DIR)/cursors.properties: $(CURSORS_PLATFORM_LIB_SRC)/cursors.prop
|
||||
COPY_FILES += $(CURSORS_DEST_DIR)/cursors.properties
|
||||
|
||||
CURSORS_LIB_SRC = $(JDK_TOPDIR)/src/share/lib/images/cursors
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/win32_*.gif)
|
||||
else # PLATFORM
|
||||
else # OPENJDK_TARGET_OS
|
||||
CURSORS_SRC_FILES = $(CURSORS_LIB_SRC)/invalid32x32.gif $(wildcard $(CURSORS_LIB_SRC)/motif_*.gif)
|
||||
endif # PLATFORM
|
||||
endif # OPENJDK_TARGET_OS
|
||||
CURSORS_TARGET_FILES = $(subst $(CURSORS_LIB_SRC),$(CURSORS_DEST_DIR),$(CURSORS_SRC_FILES))
|
||||
|
||||
$(CURSORS_DEST_DIR)/%: $(CURSORS_LIB_SRC)/%
|
||||
@ -157,7 +168,7 @@ COPY_FILES += $(CURSORS_TARGET_FILES)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
|
||||
CONTENT_TYPES_SRC=$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib
|
||||
|
||||
$(LIBDIR)/content-types.properties: $(CONTENT_TYPES_SRC)/content-types.properties
|
||||
$(MKDIR) -p $(@D)
|
||||
@ -179,9 +190,9 @@ COPY_FILES += $(LIBDIR)/calendars.properties
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
|
||||
TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/lib
|
||||
TZMAPPINGS_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/lib
|
||||
|
||||
$(LIBDIR)/tzmappings: $(TZMAPPINGS_SRC)/tzmappings
|
||||
$(MKDIR) -p $(@D)
|
||||
@ -233,7 +244,7 @@ COPY_FILES += $(ICCPROFILE_TARGET_FILES)
|
||||
#TODO: rework this to avoid hardcoding library name in the makefile
|
||||
#
|
||||
ifdef OPENJDK
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
FREETYPE_LIB = $(JDK_OUTPUTDIR)/bin/$(call SHARED_LIBRARY,freetype)
|
||||
else
|
||||
ifeq ($(USING_SYSTEM_FT_LIB), false)
|
||||
@ -243,7 +254,7 @@ ifdef OPENJDK
|
||||
|
||||
$(FREETYPE_LIB): $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype)
|
||||
$(CP) $(FREETYPE2_LIB_PATH)/$(call SHARED_LIBRARY,freetype) $@
|
||||
ifeq ($(BUILD_OS), windows)
|
||||
ifeq ($(OPENJDK_BUILD_OS), windows)
|
||||
$(CHMOD) +rx $@
|
||||
endif
|
||||
|
||||
@ -254,7 +265,7 @@ endif
|
||||
|
||||
# Copy msvcr100.dll on windows
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
MSVCRNN_TARGET := $(JDK_OUTPUTDIR)/bin/$(notdir $(MSVCRNN_DLL))
|
||||
$(MSVCRNN_TARGET): $(MSVCRNN_DLL)
|
||||
$(MKDIR) -p $(@D)
|
||||
@ -286,14 +297,14 @@ else
|
||||
JVMCFG_ARCH := $(ARCH)
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
ifeq ($(JVMCFG_ARCH),amd64)
|
||||
JVMCFG_ARCH := x86_64
|
||||
endif
|
||||
JVMCFG_SRC := $(JDK_TOPDIR)/src/macosx/bin/$(JVMCFG_ARCH)/jvm.cfg
|
||||
JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib
|
||||
else
|
||||
JVMCFG_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/$(JVMCFG_ARCH)/jvm.cfg
|
||||
JVMCFG_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/$(JVMCFG_ARCH)/jvm.cfg
|
||||
JVMCFG_DIR := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)
|
||||
endif
|
||||
|
||||
@ -353,15 +364,15 @@ COPY_FILES += $(JVMCFG)
|
||||
PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security
|
||||
PROPS_DST := $(JDK_OUTPUTDIR)/lib/security/java.security
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-solaris
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-windows
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
PROPS_SRC := $(JDK_TOPDIR)/src/share/lib/security/java.security-macosx
|
||||
endif
|
||||
|
||||
@ -453,7 +464,7 @@ $(SHARED_FONTS_DST_DIR)/fonts.dir : $(JDK_TOPDIR)/src/solaris/classes/sun/awt/mo
|
||||
|
||||
COPY_FILES += $(SHARED_FONTS_DST) $(SHARED_FONTS_DST_DIR)/fonts.dir
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
|
||||
# The oblique fonts are only needed/wanted on Linux.
|
||||
|
||||
@ -532,11 +543,13 @@ $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libxinerama.so: $(JDK_TOPDIR)/src/closed/solaris
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) $@
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 755 $@
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNW%.so: $(JDK_TOPDIR)/src/closed/solaris/lib/$(ARCH)/libjdgaSUNW%.so
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) $@
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 755 $@
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNWafb.so: $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/libjdgaSUNWffb.so
|
||||
$(MKDIR) -p $(@D)
|
||||
@ -549,7 +562,7 @@ endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
|
||||
SUNPKCS11_CFG_SRC := $(JDK_TOPDIR)/src/share/lib/security/sunpkcs11-solaris.cfg
|
||||
SUNPKCS11_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/sunpkcs11-solaris.cfg
|
||||
@ -566,7 +579,7 @@ endif
|
||||
##########################################################################################
|
||||
|
||||
ifndef OPENJDK
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
|
||||
UCRYPTO_CFG_SRC := $(JDK_TOPDIR)/src/closed/share/lib/security/ucrypto-solaris.cfg
|
||||
UCRYPTO_CFG_DST := $(JDK_OUTPUTDIR)/lib/security/ucrypto-solaris.cfg
|
||||
|
@ -133,7 +133,7 @@ COPY_FILES += \
|
||||
$(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.png) \
|
||||
$(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/sounds/*.wav)
|
||||
|
||||
ifneq ($(PLATFORM), windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
# Only copy GTK resources on Solaris/Linux
|
||||
SWING_PLAF_GTK_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk
|
||||
COPY_FILES += \
|
||||
@ -174,11 +174,11 @@ COPY_FILES += \
|
||||
$(shell $(MKDIR) -p $(JDK_OUTPUTDIR)/classes/META-INF/services)
|
||||
# Find all META-INF/services/* files
|
||||
ALL_META-INF_DIRS_share:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
|
||||
ALL_META-INF_DIRS_hostapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes -type d -a -name META-INF)
|
||||
ALL_META-INF_DIRS_targetapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes -type d -a -name META-INF)
|
||||
# Platform specific overrides shared
|
||||
ifneq ($(ALL_META-INF_DIRS_hostapi),)
|
||||
ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_hostapi) \
|
||||
$(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes%,%,$(ALL_META-INF_DIRS_hostapi)),\
|
||||
ifneq ($(ALL_META-INF_DIRS_targetapi),)
|
||||
ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_targetapi) \
|
||||
$(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes%,%,$(ALL_META-INF_DIRS_targetapi)),\
|
||||
$(ALL_META-INF_DIRS_share))
|
||||
else
|
||||
ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share)
|
||||
@ -189,7 +189,7 @@ ifdef OPENJDK
|
||||
endif
|
||||
|
||||
ifndef OPENJDK
|
||||
ifneq ($(PLATFORM), macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/jdbc/odbc/META-INF
|
||||
endif
|
||||
endif
|
||||
@ -216,9 +216,9 @@ OUT_SERVICES_FILES:=$(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\
|
||||
$(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
|
||||
OUT_SERVICES_FILES_COLON:=$(addsuffix :,$(OUT_SERVICES_FILES))
|
||||
# Exception handling for print services with no META-INF directory
|
||||
SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/*)
|
||||
SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/print/services/*)
|
||||
OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\
|
||||
$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/print/services/%,%,\
|
||||
$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/print/services/%,%,\
|
||||
$(SRC_SERVICES_FILES_PRINT)))
|
||||
OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :,$(OUT_SERVICES_FILES_PRINT))
|
||||
RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON),$(SRC_SERVICES_FILES_PRINT))
|
||||
@ -229,7 +229,7 @@ META-INF_RULES_SERVICES:=$(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COL
|
||||
define addto_meta-inf_services
|
||||
$1
|
||||
echo Installing META-INF/services/$$(@F)
|
||||
$(CAT) $$< | $(SED) -e "s/^#\[$(PLATFORM)\]//" > $$@
|
||||
$(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@
|
||||
endef
|
||||
$(foreach i,$(META-INF_RULES_SERVICES),$(eval $(call addto_meta-inf_services,$i)))
|
||||
# Here is the generic rule, whose receipt the above rules will trigger.
|
||||
@ -261,13 +261,13 @@ JAVAX_SOUND_SRC_FILES := \
|
||||
|
||||
COPY_EXTRA += $(foreach F,$(notdir $(JAVAX_SOUND_SRC_FILES)),$(JDK_OUTPUTDIR)/classes/META-INF/services/${F})
|
||||
|
||||
ifeq ($(PLATFORM)-$(ARCH),windows-ia64)
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(ARCH),windows-ia64)
|
||||
JAVAX_SOUND_SRC_FILES += windows-ia64/javax.sound.sampled.spi.MixerProvider
|
||||
COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
|
||||
else ifeq ($(PLATFORM),windows)
|
||||
else ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
JAVAX_SOUND_SRC_FILES += windows-i586/javax.sound.sampled.spi.MixerProvider
|
||||
COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
|
||||
else ifeq ($(PLATFORM)-$(ARCH),linux-i586)
|
||||
else ifeq ($(OPENJDK_TARGET_OS)-$(ARCH),linux-i586)
|
||||
JAVAX_SOUND_SRC_FILES += linux-i586/javax.sound.sampled.spi.MixerProvider
|
||||
COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/META-INF/services/javax.sound.sampled.spi.MixerProvider
|
||||
else
|
||||
|
@ -46,7 +46,7 @@ ifndef OPENJDK
|
||||
SAMPLE_TARGET += $(SAMPLE_CLOSED_TARGET)
|
||||
endif
|
||||
|
||||
ifneq (, $(filter $(PLATFORM), solaris macosx))
|
||||
ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
|
||||
SAMPLE_SOLARIS_SOURCE := $(shell $(FIND) $(SAMPLE_SOLARIS_SOURCE_DIR) -type f -print)
|
||||
SAMPLE_SOLARIS_TARGET := $(subst $(SAMPLE_SOLARIS_SOURCE_DIR),$(SAMPLE_TARGET_DIR),$(SAMPLE_SOLARIS_SOURCE))
|
||||
SAMPLE_TARGET += $(SAMPLE_SOLARIS_TARGET)
|
||||
@ -72,4 +72,3 @@ COPY_FILES += $(SAMPLE_TARGET)
|
||||
all: $(COPY_FILES)
|
||||
|
||||
.PHONY: all
|
||||
|
||||
|
@ -32,6 +32,10 @@ default: all
|
||||
|
||||
include Tools.gmk
|
||||
|
||||
#
|
||||
# This makefile...so that altering will trigger rebuilding include/exclude-lists => jars
|
||||
#
|
||||
MAKEFILE=$(JDK_TOPDIR)/makefiles/CreateJars.gmk
|
||||
|
||||
MAINMANIFEST := $(JDK_TOPDIR)/make/tools/manifest.mf
|
||||
BEANMANIFEST := $(JDK_TOPDIR)/make/javax/swing/beaninfo/manifest
|
||||
@ -46,7 +50,7 @@ JCONSOLE_JAR_DEPS := \
|
||||
|
||||
$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/classes,\
|
||||
SUFFIXES:=.class .gif .png,\
|
||||
SUFFIXES:=.class .gif .png .properties,\
|
||||
INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
|
||||
JARMAIN:=sun.tools.jconsole.JConsole,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
|
||||
@ -242,12 +246,35 @@ RT_JAR_EXCLUDES := \
|
||||
sun/swing/BeanInfoUtils.class \
|
||||
$(LOCALEDATA_INCLUDES)
|
||||
|
||||
ifndef OPENJDK
|
||||
ifndef JAVASE_EMBEDDED
|
||||
# These files should never be put into rt.jar
|
||||
# but due to a misstake...some are put there if embedded
|
||||
#
|
||||
ifneq ($(JAVASE_EMBEDDED), true)
|
||||
# normal (correct) case
|
||||
RT_JAR_EXCLUDES += \
|
||||
com/oracle/jrockit/jfr \
|
||||
oracle/jrockit/jfr
|
||||
else
|
||||
# embedded (broken) case
|
||||
RT_JAR_EXCLUDES += \
|
||||
oracle/jrockit/jfr/parser \
|
||||
oracle/jrockit/jfr/tools \
|
||||
oracle/jrockit/jfr/NativeOptions.class \
|
||||
oracle/jrockit/jfr/RepositoryChunkHandler.class
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
RT_JAR_EXCLUDES += com/sun/nio/sctp \
|
||||
sun/nio/ch/sctp \
|
||||
sun/jdbc \
|
||||
sun/nio/ch/DevPollArrayWrapper\$$$$Updator.class \
|
||||
sun/nio/ch/DevPollArrayWrapper.class \
|
||||
sun/nio/ch/DevPollSelectorImpl.class \
|
||||
sun/nio/ch/DevPollSelectorProvider.class \
|
||||
sun/nio/ch/EPollArrayWrapper\$$$$Updator.class \
|
||||
sun/nio/ch/EPollArrayWrapper.class \
|
||||
sun/nio/ch/EPollSelectorImpl.class \
|
||||
sun/nio/ch/EPollSelectorProvider.class
|
||||
endif
|
||||
|
||||
# Find all files in the classes dir to use as dependencies. This could be more fine granular.
|
||||
@ -271,12 +298,19 @@ $(RESOURCE_JAR_MANIFEST_FILE): $(MAINMANIFEST)
|
||||
-e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
|
||||
$(MAINMANIFEST) >> $@
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/_the.jars.exclude:
|
||||
$(JDK_OUTPUTDIR)/lib/_the.jars.exclude: $(MAKEFILE)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(call ListPathsSafely,RT_JAR_EXCLUDES,\n, >> $@)
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/classlist : $(JDK_TOPDIR)/make/tools/sharing/classlist.$(OPENJDK_TARGET_OS) \
|
||||
$(MAKEFILE)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) -f $@.temp
|
||||
$(TOOL_ADDJSUM) $< $@.temp
|
||||
$(MV) $@.temp $@
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/_the.jars.contents: $(BUILD_TOOLS) $(JDK_OUTPUTDIR)/lib/_the.jars.exclude \
|
||||
$(ALL_FILES_IN_CLASSES)
|
||||
$(ALL_FILES_IN_CLASSES) $(JDK_OUTPUTDIR)/lib/classlist
|
||||
$(MKDIR) -p $(@D)
|
||||
$(RM) $@.temp
|
||||
($(CD) $(JDK_OUTPUTDIR)/classes && \
|
||||
@ -290,17 +324,22 @@ $(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents: $(JDK_OUTPUTDIR)/lib/_the.jars.conten
|
||||
$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents: $(JDK_OUTPUTDIR)/lib/_the.jars.contents
|
||||
$(GREP) -v -e '\.class$$' -e '/_the\.*' -e '^_the\.*' $(JDK_OUTPUTDIR)/lib/_the.jars.contents > $@
|
||||
|
||||
RT_JAR_CREATE_OPTIONS := c0fm
|
||||
ifeq ($(COMPRESS_JARS), true)
|
||||
RT_JAR_CREATE_OPTIONS := cfm
|
||||
endif
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/rt.jar: $(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE)
|
||||
$(ECHO) Creating rt.jar
|
||||
$(CD) $(JDK_OUTPUTDIR)/classes && \
|
||||
$(JAR) cfm $@ $(RT_JAR_MANIFEST_FILE) \
|
||||
$(JAR) $(RT_JAR_CREATE_OPTIONS) $@ $(RT_JAR_MANIFEST_FILE) \
|
||||
@$(JDK_OUTPUTDIR)/lib/_the.rt.jar.contents
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/resources.jar: $(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents \
|
||||
$(RESOURCE_JAR_MANIFEST_FILE)
|
||||
$(ECHO) Creating resources.jar
|
||||
$(CD) $(JDK_OUTPUTDIR)/classes && \
|
||||
$(JAR) cfm $@ $(RESOURCE_JAR_MANIFEST_FILE) \
|
||||
$(JAR) $(RT_JAR_CREATE_OPTIONS) $@ $(RESOURCE_JAR_MANIFEST_FILE) \
|
||||
@$(JDK_OUTPUTDIR)/lib/_the.resources.jar.contents
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/rt.jar $(JDK_OUTPUTDIR)/lib/resources.jar
|
||||
@ -309,7 +348,7 @@ JARS+=$(JDK_OUTPUTDIR)/lib/rt.jar $(JDK_OUTPUTDIR)/lib/resources.jar
|
||||
|
||||
CHARSETS_JAR_DEPS :=
|
||||
|
||||
ifneq ($(HOST_OS), windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
CHARSETS_EXTRA_FILES:=sun/awt/motif/X11GBK.class \
|
||||
sun/awt/motif/X11GB2312\$$$$Decoder.class \
|
||||
sun/awt/motif/X11GB2312.class \
|
||||
@ -328,20 +367,22 @@ $(eval $(call SetupArchive,BUILD_CHARSETS_JAR,$(CHARSETS_JAR_DEPS),\
|
||||
$(CHARSETS_EXTRA_FILES) \
|
||||
META-INF/services/java.nio.charset.spi.CharsetProvider, \
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/charsets.jar, \
|
||||
SKIP_METAINF := true))
|
||||
SKIP_METAINF := true, \
|
||||
CHECK_COMPRESS_JAR:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/charsets.jar
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifndef OPENJDK
|
||||
ifeq ($(ENABLE_JFR), true)
|
||||
$(eval $(call SetupArchive,BUILD_JFR_JAR,,\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/classes,\
|
||||
INCLUDES:=com/oracle/jrockit/jfr \
|
||||
oracle/jrockit/jfr,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/jfr.jar,\
|
||||
SKIP_METAINF:=true,\
|
||||
MANIFEST:=$(MAINMANIFEST)))
|
||||
MANIFEST:=$(MAINMANIFEST), \
|
||||
CHECK_COMPRESS_JAR:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/jfr.jar
|
||||
endif
|
||||
@ -356,13 +397,14 @@ $(eval $(call SetupArchive,BUILD_JSSE_JAR,,\
|
||||
com/sun/net/ssl/internal/ssl,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/jsse.jar,\
|
||||
SKIP_METAINF:=true,\
|
||||
MANIFEST:=$(MAINMANIFEST)))
|
||||
MANIFEST:=$(MAINMANIFEST), \
|
||||
CHECK_COMPRESS_JAR:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/jsse.jar
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifneq ($(PLATFORM)-$(ARCH_DATA_MODEL),windows-64)
|
||||
ifneq ($(OPENJDK_TARGET_OS)-$(ARCH_DATA_MODEL),windows-64)
|
||||
SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
|
||||
|
||||
ifndef OPENJDK
|
||||
@ -544,7 +586,7 @@ endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
|
||||
SUNMSCAPI_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunmscapi.jar
|
||||
|
||||
@ -574,7 +616,7 @@ endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(PLATFORM),solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS),solaris)
|
||||
ifndef OPENJDK
|
||||
|
||||
UCRYPTO_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/ucrypto.jar
|
||||
@ -661,7 +703,8 @@ $(eval $(call SetupArchive,BUILD_TOOLS_JAR,$(TOOLS_JAR_DEPS),\
|
||||
META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
|
||||
META-INF/services/com.sun.tools.internal.xjc.Plugin,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/tools.jar,\
|
||||
SKIP_METAINF:=true))
|
||||
SKIP_METAINF:=true, \
|
||||
CHECK_COMPRESS_JAR:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/tools.jar
|
||||
|
||||
@ -696,6 +739,7 @@ EXPORTED_PRIVATE_PKGS = com.sun.servicetag \
|
||||
com.oracle.nio
|
||||
|
||||
$(IMAGES_OUTPUTDIR)/symbols/_the.symbols: $(JDK_OUTPUTDIR)/lib/rt.jar
|
||||
$(RM) -rf $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
|
||||
$(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols/META-INF/sym
|
||||
$(JAVA) \
|
||||
-Xbootclasspath/a:$(JDK_OUTPUTDIR)/classes \
|
||||
@ -711,7 +755,8 @@ MAKE_SURE_DIR_EXISTS_DUMMY := $(shell $(MKDIR) -p $(IMAGES_OUTPUTDIR)/symbols)
|
||||
$(eval $(call SetupArchive,BUILD_CT_SYM,$(IMAGES_OUTPUTDIR)/symbols/_the.symbols,\
|
||||
SRCS:=$(IMAGES_OUTPUTDIR)/symbols,\
|
||||
INCLUDES:=META-INF/sym,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/ct.sym))
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/ct.sym, \
|
||||
CHECK_COMPRESS_JAR:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/ct.sym
|
||||
|
||||
@ -765,7 +810,7 @@ SRC_ZIP_INCLUDES = \
|
||||
org/xml/sax \
|
||||
sunw
|
||||
|
||||
SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes
|
||||
SRC_ZIP_SRCS = $(JDK_TOPDIR)/src/share/classes $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes
|
||||
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gensrc
|
||||
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/impsrc
|
||||
SRC_ZIP_SRCS += $(JDK_OUTPUTDIR)/gendocsrc_rmic
|
||||
@ -776,16 +821,16 @@ endif
|
||||
# Need to copy launcher src files into desired directory structure
|
||||
# before zipping the sources.
|
||||
LAUNCHER_SRC_FILES := $(wildcard $(JDK_TOPDIR)/src/share/bin/*) \
|
||||
$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/java_md*)
|
||||
$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/java_md*)
|
||||
LAUNCHER_ZIP_SRC := $(patsubst $(JDK_TOPDIR)/src/share/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
|
||||
$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
|
||||
$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/%,$(IMAGES_OUTPUTDIR)/src/launcher/%,\
|
||||
$(LAUNCHER_SRC_FILES)))
|
||||
|
||||
$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/share/bin/%
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
|
||||
$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/bin/%
|
||||
$(IMAGES_OUTPUTDIR)/src/launcher/%: $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin/%
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
|
||||
|
@ -35,10 +35,10 @@
|
||||
#
|
||||
TEXT_SRCDIR = $(JDK_TOPDIR)/src/share/classes
|
||||
TEXT_PKG = sun/text/resources
|
||||
TEXT_SOURCES = %$(TEXT_PKG)/BreakIteratorRules.java \
|
||||
%$(TEXT_PKG)/BreakIteratorInfo.java \
|
||||
%$(TEXT_PKG)/BreakIteratorRules_th.java \
|
||||
%$(TEXT_PKG)/BreakIteratorInfo_th.java
|
||||
TEXT_SOURCES = $(TEXT_PKG)/BreakIteratorRules.java \
|
||||
$(TEXT_PKG)/BreakIteratorInfo.java \
|
||||
$(TEXT_PKG)/BreakIteratorRules_th.java \
|
||||
$(TEXT_PKG)/BreakIteratorInfo_th.java
|
||||
|
||||
# Generate BreakIteratorData
|
||||
BREAK_ITERATOR_DIR = $(JDK_OUTPUTDIR)/break_iterator
|
||||
|
@ -25,13 +25,13 @@
|
||||
|
||||
GENDATA_FONT_CONFIG_DST := $(JDK_OUTPUTDIR)/lib
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
GENDATA_FONT_CONFIG_SRC_DIR := $(JDK_TOPDIR)/src/windows/classes/sun/awt/windows
|
||||
GENDATA_FONT_CONFIG_SRC_FILES := fontconfig.properties
|
||||
GENDATA_FONT_CONFIG_SRC_PREFIX :=
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
GENDATA_FONT_CONFIG_SRC_PREFIX := linux.
|
||||
ifdef OPENJDK
|
||||
GENDATA_FONT_CONFIG_SRC_DIR := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/fontconfigs
|
||||
@ -52,27 +52,29 @@ GENDATA_FONT_CONFIG_SRC_FILES := \
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
GENDATA_FONT_CONFIG_SRC_DIR := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/fontconfigs
|
||||
GENDATA_FONT_CONFIG_SRC_FILES := fontconfig.properties
|
||||
GENDATA_FONT_CONFIG_SRC_PREFIX := solaris.
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
GENDATA_FONT_CONFIG_SRC_DIR := $(JDK_TOPDIR)/src/macosx/classes/sun/awt/fontconfigs
|
||||
GENDATA_FONT_CONFIG_SRC_FILES := fontconfig.properties
|
||||
GENDATA_FONT_CONFIG_SRC_PREFIX := macosx.
|
||||
endif # PLATFORM
|
||||
endif # OPENJDK_TARGET_OS
|
||||
|
||||
###
|
||||
|
||||
$(GENDATA_FONT_CONFIG_DST)/%.src : $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 644 $@
|
||||
|
||||
$(GENDATA_FONT_CONFIG_DST)/%.bfc : $(GENDATA_FONT_CONFIG_SRC_DIR)/$(GENDATA_FONT_CONFIG_SRC_PREFIX)%.properties
|
||||
$(MKDIR) -p $(@D)
|
||||
$(TOOL_COMPILEFONTCONFIG) $< $@
|
||||
$(CHMOD) 444 $@
|
||||
|
||||
###
|
||||
|
||||
|
@ -32,5 +32,4 @@ $(HTML32DTD): $(BUILD_TOOLS)
|
||||
$(RM) $@
|
||||
($(TOOL_DTDBUILDER) html32 > $@) || exit 1
|
||||
|
||||
GENDATA_HTML32DTD += $(HTML32DTD)
|
||||
|
||||
GENDATA_HTML32DTD += $(HTML32DTD)
|
@ -27,7 +27,13 @@ default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include RMICompile.gmk
|
||||
include RMICompilation.gmk
|
||||
|
||||
# To ensure the latest stub generator files are picked up from corba repo
|
||||
# when available, we need to run with latest rmic version available.
|
||||
ifeq ($(CROSS_COMPILE_ARCH),)
|
||||
RMIC := $(UNCYGDRIVE) $(JDK_OUTPUTDIR)/bin/rmic
|
||||
endif
|
||||
|
||||
CLASSES_DIR := $(JDK_OUTPUTDIR)/classes
|
||||
# NOTE: If the smart javac dependency management is reintroduced, these classes risk
|
||||
|
@ -69,6 +69,7 @@ $(GENDATA_CURDATA): $(JDK_TOPDIR)/src/share/classes/java/util/CurrencyData.prope
|
||||
$(RM) $@
|
||||
$(TOOL_GENERATECURRENCYDATA) -o $@.temp < $<
|
||||
$(MV) $@.temp $@
|
||||
$(CHMOD) 444 $@
|
||||
|
||||
GENDATA += $(GENDATA_CURDATA)
|
||||
|
||||
|
@ -65,7 +65,7 @@ GENSRC += $(GENSRC_BUFFER)
|
||||
include GensrcExceptions.gmk
|
||||
GENSRC += $(GENSRC_EXCEPTIONS)
|
||||
|
||||
ifneq ($(HOST_OS),windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS),windows)
|
||||
include GensrcIcons.gmk
|
||||
GENSRC += $(GENSRC_ICONS)
|
||||
|
||||
@ -78,6 +78,11 @@ ifndef DISABLE_NIMBUS
|
||||
GENSRC += $(GENSRC_SWING_NIMBUS)
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
include GensrcJObjC.gmk
|
||||
GENSRC += $(GENSRC_JOBJC)
|
||||
endif
|
||||
|
||||
$(GENSRC) : $(BUILD_TOOLS)
|
||||
|
||||
# The exception handling of swing beaninfo
|
||||
@ -100,7 +105,10 @@ all: $(GENSRC) $(GENSRC_SWING_BEANINFO)
|
||||
$(MKDIR) -p gensrc/javax/swing/plaf && \
|
||||
$(CP) -rp gensrc_swing/javax/swing/plaf/* gensrc/javax/swing/plaf) \
|
||||
fi
|
||||
ifneq ($(HOST_OS),windows)
|
||||
if [ -d $(JDK_OUTPUTDIR)/gensrc_jobjc ] ; then \
|
||||
(cd $(JDK_OUTPUTDIR) && cp -rp gensrc_jobjc/src/* gensrc) \
|
||||
fi
|
||||
ifneq ($(OPENJDK_TARGET_OS),windows)
|
||||
(cd $(JDK_OUTPUTDIR) && \
|
||||
$(CP) -rp gensrc_icons/* gensrc && \
|
||||
$(CP) -rp gensrc_x11wrappers/classes/* gensrc)
|
||||
|
@ -198,6 +198,7 @@ define SetupGenBuffer
|
||||
$(if $(12),$1_$(strip $(12)))
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
$(if $(15),$(error Internal makefile error: Too many arguments to SetupGenBuffer, please update GensrcBuffer.gmk))
|
||||
|
||||
$(call fixRw,$1,$$($1_RW))
|
||||
$(call typesAndBits,$1,$$($1_type),$$($1_BO))
|
||||
|
@ -29,7 +29,7 @@ GENSRC_ICONS_TMP := $(JDK_OUTPUTDIR)/gensrc_icons
|
||||
GENSRC_ICONS_DST := $(GENSRC_ICONS_TMP)/sun/awt/X11
|
||||
|
||||
ifdef OPENJDK
|
||||
ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)
|
||||
ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)
|
||||
else
|
||||
ICONS_PATH_PREFIX := $(JDK_TOPDIR)/src/closed/solaris
|
||||
endif
|
||||
@ -41,7 +41,7 @@ GENSRC_ICONS_SRC += \
|
||||
$(ICONS_PATH_PREFIX)/classes/sun/awt/X11/java-icon48.png
|
||||
|
||||
|
||||
ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11
|
||||
ICONPATH := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/awt/X11
|
||||
|
||||
GENSRC_ICONS_SRC += \
|
||||
$(ICONPATH)/security-icon-bw16.png \
|
||||
@ -86,7 +86,7 @@ $$($1_TARGET32) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir
|
||||
$(ECHO) "public class $$($1_NAME32) {" >> $$@.tmp
|
||||
$(ECHO) "public static int[] $$($1_SHORTNAME) = { " >> $$@.tmp
|
||||
# TODO FIX FIX FIX
|
||||
ifneq ($(PLATFORM),macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
|
||||
endif
|
||||
$(ECHO) "}; }" >> $$@.tmp
|
||||
@ -100,7 +100,7 @@ $$($1_TARGET64) : $2/$1 $(GENSRC_ICONS_TMP)/_the.dir
|
||||
$(ECHO) "public class $$($1_NAME64) {" >> $$@.tmp
|
||||
$(ECHO) "public static long[] $$($1_SHORTNAME) = { " >> $$@.tmp
|
||||
# TODO FIX FIX FIX
|
||||
ifneq ($(PLATFORM),macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
$(CAT) $$< | $(TOOL_TOBIN) >> $$@.tmp
|
||||
endif
|
||||
$(ECHO) "}; }" >> $$@.tmp
|
||||
|
80
jdk/makefiles/GensrcJObjC.gmk
Normal file
80
jdk/makefiles/GensrcJObjC.gmk
Normal file
@ -0,0 +1,80 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
GENSRC_JOBJC :=
|
||||
|
||||
JOBJC_FRAMEWORKS := Foundation CoreFoundation AppKit
|
||||
FRAMEWORKS_DIR := /System/Library/Frameworks
|
||||
GBM := /usr/bin/gen_bridge_metadata
|
||||
|
||||
JOBJC_SRC := $(JDK_TOPDIR)/src/macosx/native/jobjc
|
||||
JOBJC_TMP := $(JDK_OUTPUTDIR)/gensrc_jobjc
|
||||
JOBJC_DST := $(JDK_OUTPUTDIR)/gensrc_jobjc/src
|
||||
|
||||
#
|
||||
# Build generator
|
||||
#
|
||||
$(eval $(call SetupJavaCompilation,BUILD_JOBJC_PRIMITIVE_CODER,\
|
||||
SETUP:=GENERATE_OLDBYTECODE,\
|
||||
INCLUDES:=core/java \
|
||||
com/apple,\
|
||||
HEADERS :=$(JOBJC_DST)/jni_headers/core ,\
|
||||
SRC:=$(JOBJC_SRC)/src \
|
||||
$(JOBJC_SRC)/src/generator/java, \
|
||||
BIN:=$(JOBJC_TMP)/bin))
|
||||
|
||||
GENSRC_JOBJC += $(JOBJC_TMP)/bin/_the.batch
|
||||
|
||||
#
|
||||
# Generate bridge support
|
||||
#
|
||||
BRIDGESUPPORT := $(addprefix $(JOBJC_TMP)/bridge/,$(addsuffix Full.bridgesupport,$(JOBJC_FRAMEWORKS)))
|
||||
|
||||
$(JOBJC_TMP)/bridge/%Full.bridgesupport : $(FRAMEWORKS_DIR)/%.framework/Headers/*.h
|
||||
$(MKDIR) -p $(@D)
|
||||
if [ -f $(FRAMEWORKS_DIR)/$*.framework/Resources/BridgeSupport/$(@F) ]; then \
|
||||
cp $(FRAMEWORKS_DIR)/$*.framework/Resources/BridgeSupport/$(@F) $@ ;\
|
||||
else \
|
||||
$(GBM) -F complete --framework $* -o $@ ; \
|
||||
fi
|
||||
|
||||
#
|
||||
# Find Xbootclasspath
|
||||
#
|
||||
$(JOBJC_TMP)/_the.generator_bootclasspath : $(JOBJC_TMP)/bin/_the.batch
|
||||
$(JAVA) -cp $(JOBJC_TMP)/bin com.apple.internal.jobjc.generator.BootClassPathMinus JObjC.jar > $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
|
||||
#
|
||||
# Run generator
|
||||
#
|
||||
TOOL_JOBJC := $(JAVA) -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator
|
||||
|
||||
$(JOBJC_TMP)/_the.generator : $(JOBJC_TMP)/bin/_the.batch $(JOBJC_TMP)/_the.generator_bootclasspath $(BRIDGESUPPORT)
|
||||
$(JAVA) -d64 -Xbootclasspath:`$(CAT) $(JOBJC_TMP)/_the.generator_bootclasspath` -cp $(JOBJC_TMP)/bin -ea com.apple.internal.jobjc.generator.Generator dst=$(JOBJC_DST) frameworks=$(JOBJC_TMP)/bridge
|
||||
$(TOUCH) $@
|
||||
|
||||
GENSRC_JOBJC += $(JOBJC_TMP)/_the.generator
|
@ -53,9 +53,9 @@ GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/tools/jconsole/Version.java
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(HOST_OS_API),posix)
|
||||
UPSUFFIX:=$(PLATFORM)
|
||||
ifeq ($(PLATFORM),macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS_API),posix)
|
||||
UPSUFFIX:=$(OPENJDK_TARGET_OS)
|
||||
ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
UPSUFFIX:=bsd
|
||||
endif
|
||||
# UNIXProcess.java is different for solaris and linux. We need to copy
|
||||
@ -64,7 +64,7 @@ ifeq ($(HOST_OS_API),posix)
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/java/lang/UNIXProcess.java : \
|
||||
$(JDK_TOPDIR)/src/solaris/classes/java/lang/UNIXProcess.java.$(UPSUFFIX)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(ECHO) Copying UNIXProcess.java.$(PLATFORM) to java/lang/UNIXProcess.java
|
||||
$(ECHO) Copying UNIXProcess.java.$(OPENJDK_TARGET_OS) to java/lang/UNIXProcess.java
|
||||
$(CP) $< $@
|
||||
$(CHMOD) u+rw $@
|
||||
|
||||
@ -74,8 +74,8 @@ endif
|
||||
##########################################################################################
|
||||
|
||||
ifndef OPENJDK
|
||||
ifneq ($(PLATFORM), windows)
|
||||
ifneq ($(PLATFORM), macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS), macosx)
|
||||
# These file(s) are needed for building fake .so libs on !windows for jdbcodbc
|
||||
|
||||
$(JDK_OUTPUTDIR)/gensrc_c/libjdbcodbc/dummyodbc1.c :
|
||||
@ -101,85 +101,98 @@ GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java
|
||||
|
||||
GENSRC_SOR_SRC := $(JDK_TOPDIR)/src/share/native/sun/nio/ch
|
||||
GENSRC_SOR_SRC_FILE := genSocketOptionRegistry.c
|
||||
GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genSocketOptionRegistry
|
||||
GENSRC_SOR_EXE := $(GENSRC_SOR_BIN)/genSocketOptionRegistry$(EXE_SUFFIX)
|
||||
GENSRC_SOR_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genSocketOptionRegistry
|
||||
|
||||
SOR_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOR_SRC)/$(GENSRC_SOR_SRC_FILE) | \
|
||||
$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
|
||||
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(GENSRC_SOR_EXE)
|
||||
$(MKDIR) -p $(@D)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
|
||||
$(GENSRC_SOR_EXE) >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOR_EXE,\
|
||||
SRC:=$(GENSRC_SOR_SRC),\
|
||||
INCLUDE_FILES:=$(GENSRC_SOR_SRC_FILE),\
|
||||
LANG:=C,\
|
||||
CFLAGS:=$(CFLAGS_JDKLIB),\
|
||||
BIN:=$(GENSRC_SOR_BIN),\
|
||||
EXE:=$(GENSRC_SOR_EXE)))
|
||||
CC:=$(HOST_CC),\
|
||||
LDEXE:=$(HOST_LD),\
|
||||
OBJECT_DIR:=$(GENSRC_SOR_BIN),\
|
||||
OUTPUT_DIR:=$(GENSRC_SOR_BIN),\
|
||||
PROGRAM:=genSocketOptionRegistry))
|
||||
|
||||
ifneq ($(JAVASE_EMBEDDED), true)
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(BUILD_GENSRC_SOR_EXE)
|
||||
$(MKDIR) -p $(@D)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@.tmp
|
||||
$(BUILD_GENSRC_SOR_EXE) >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
else
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/ch/SocketOptionRegistry.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/ch/SocketOptionRegistry-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifneq ($(PLATFORM),windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS),windows)
|
||||
|
||||
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java
|
||||
|
||||
GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
|
||||
GENSRC_UC_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/fs
|
||||
GENSRC_UC_SRC_FILE := genUnixConstants.c
|
||||
GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genUnixConstants
|
||||
GENSRC_UC_EXE := $(GENSRC_UC_BIN)/genUnixConstants$(EXE_SUFFIX)
|
||||
GENSRC_UC_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genUnixConstants
|
||||
|
||||
UC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_UC_SRC)/$(GENSRC_UC_SRC_FILE) | \
|
||||
$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
|
||||
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(GENSRC_UC_EXE)
|
||||
$(MKDIR) -p $(@D)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
|
||||
$(GENSRC_UC_EXE) >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_GENSRC_UC_EXE,\
|
||||
SRC:=$(GENSRC_UC_SRC),\
|
||||
INCLUDE_FILES:=$(GENSRC_UC_SRC_FILE),\
|
||||
LANG:=C,\
|
||||
CFLAGS:=$(CFLAGS_JDKLIB),\
|
||||
BIN:=$(GENSRC_UC_BIN),\
|
||||
EXE:=$(GENSRC_UC_EXE)))
|
||||
CC:=$(HOST_CC),\
|
||||
LDEXE:=$(HOST_CC),\
|
||||
OBJECT_DIR:=$(GENSRC_UC_BIN),\
|
||||
OUTPUT_DIR:=$(GENSRC_UC_BIN),\
|
||||
PROGRAM:=genUnixConstants))
|
||||
|
||||
ifneq ($(JAVASE_EMBEDDED), true)
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(BUILD_GENSRC_UC_EXE)
|
||||
$(MKDIR) -p $(@D)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(UC_COPYRIGHT_YEARS)" > $@.tmp
|
||||
$(BUILD_GENSRC_UC_EXE) >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
else
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/UnixConstants.java : $(JDK_TOPDIR)/src/closed/solaris/classes/sun/nio/fs/UnixConstants-$(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH).java
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
##########################################################################################
|
||||
|
||||
ifeq ($(PLATFORM),solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS),solaris)
|
||||
|
||||
GENSRC_MISC += $(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java
|
||||
|
||||
GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/native/sun/nio/fs
|
||||
GENSRC_SOL_SRC := $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/sun/nio/fs
|
||||
GENSRC_SOL_SRC_FILE := genSolarisConstants.c
|
||||
GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/objs/gensrc/genSolarisConstants
|
||||
GENSRC_SOL_EXE := $(GENSRC_SOL_BIN)/genSolarisConstants$(EXE_SUFFIX)
|
||||
GENSRC_SOL_BIN := $(JDK_OUTPUTDIR)/gensrc_misc/genSolarisConstants
|
||||
|
||||
SOL_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSRC_SOL_SRC)/$(GENSRC_SOL_SRC_FILE) | \
|
||||
$(NAWK) '/^.*Copyright.*Oracle/ { printf "%s %s",$$4,$$5 }')
|
||||
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(GENSRC_SOL_EXE)
|
||||
$(MKDIR) -p $(@D)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
|
||||
$(GENSRC_SOL_EXE) >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
|
||||
$(eval $(call SetupNativeCompilation,BUILD_GENSRC_SOL_EXE,\
|
||||
SRC:=$(GENSRC_SOL_SRC),\
|
||||
INCLUDE_FILES:=$(GENSRC_SOL_SRC_FILE),\
|
||||
LANG:=C,\
|
||||
CFLAGS:=$(CFLAGS_JDKLIB),\
|
||||
BIN:=$(GENSRC_SOL_BIN),\
|
||||
EXE:=$(GENSRC_SOL_EXE)))
|
||||
CC:=$(HOST_CC),\
|
||||
LDEXE:=$(HOST_CC),\
|
||||
OBJECT_DIR:=$(GENSRC_SOL_BIN),\
|
||||
OUTPUT_DIR:=$(GENSRC_SOL_BIN),\
|
||||
PROGRAM:=genSolarisConstants))
|
||||
|
||||
$(JDK_OUTPUTDIR)/gensrc_misc/sun/nio/fs/SolarisConstants.java : $(BUILD_GENSRC_SOL_EXE)
|
||||
$(MKDIR) -p $(@D)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e $(JDK_TOPDIR)/makefiles/scripts/addNotices.sh "$(SOL_COPYRIGHT_YEARS)" > $@.tmp
|
||||
$(BUILD_GENSRC_SOL_EXE) >> $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
|
||||
endif
|
||||
|
@ -46,7 +46,7 @@ define add_properties_to_compile
|
||||
|
||||
# Strip away prefix and suffix,
|
||||
# leaving for example: sun/util/resources/CurrencyNames_sv
|
||||
$1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/%.properties,%,\
|
||||
$1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/%.properties,%,\
|
||||
$$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2))
|
||||
|
||||
# Apply optional name transformation, example: hz_TW -> hz_HK
|
||||
@ -75,7 +75,7 @@ define add_properties_to_clean
|
||||
|
||||
# Strip away prefix and suffix,
|
||||
# leaving for example: sun/util/resources/CurrencyNames_sv
|
||||
$1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/%.properties,%,\
|
||||
$1_PROPPATHS:=$$(patsubst $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/%.properties,%,\
|
||||
$$(patsubst $(JDK_TOPDIR)/src/share/classes/%.properties,%,$2))
|
||||
|
||||
# Apply optional name transformation, example: hz_TW -> hz_HK
|
||||
@ -124,7 +124,7 @@ $(eval $(call add_properties_to_compile,COM_SUN_ACCESSIBILITY_HK,\
|
||||
$(eval $(call add_properties_to_clean,COM_SUN_IMAGEIO,\
|
||||
$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/imageio -name "*.properties")))
|
||||
#com/sun/java/swing/plaf/gtk/resources
|
||||
ifneq ($(PLATFORM), windows)
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
# Only compile GTK resource bundles on Solaris/Linux
|
||||
$(eval $(call add_properties_to_compile,COM_SUN_SWING_PLAF_GTK,\
|
||||
$(shell find $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk/resources -name "*.properties"),\
|
||||
@ -264,6 +264,10 @@ $(eval $(call add_properties_to_compile,SUN_TOOLS_JAR_HK,\
|
||||
$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
|
||||
$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources -name "javac.properties")))
|
||||
|
||||
#sun/tools/jconsole/resources
|
||||
$(eval $(call add_properties_to_clean,SUN_TOOLS_JCONSOLE,\
|
||||
$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources -name "*.properties")))
|
||||
|
||||
#sun/tools/serialver
|
||||
$(eval $(call add_properties_to_clean,SUN_TOOLS_SERIALVER,\
|
||||
$(shell find $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver -name "*.properties"),,,resources))
|
||||
|
@ -30,10 +30,10 @@ GENSRC_SIZER_SRC := $(JDK_TOPDIR)/src/solaris/classes/sun/awt/X11/generator
|
||||
|
||||
GENSRC_SIZES :=
|
||||
|
||||
ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(LIBARCH), solaris-i386)
|
||||
GENSRC_SIZES := sizes.32 sizes.64
|
||||
else ifeq ($(PLATFORM), solaris)
|
||||
isalist:=$(shell $(ISAINFO))
|
||||
else ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
isalist:=$(shell isainfo)
|
||||
ifneq (,$(findstring sparcv9, $(isalist)))
|
||||
# On sparcv9 we generate both 32 and 64-bit sizers in spite of ARCH_DATA_MODEL.
|
||||
GENSRC_SIZES := sizes.32 sizes.64
|
||||
@ -46,7 +46,7 @@ GENSRC_SIZES := sizes.32
|
||||
endif # amd64
|
||||
endif # sparcv9
|
||||
else # !solaris
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
GENSRC_SIZES := sizes.32 sizes.64
|
||||
else # !macosx
|
||||
GENSRC_SIZES := sizes.$(ARCH_DATA_MODEL)
|
||||
@ -62,18 +62,23 @@ $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c : $(GENSRC_SIZER_SRC)/xlibtypes.txt
|
||||
$(TOOL_WRAPPERGENERATOR) $(@D) $< "sizer" $*
|
||||
|
||||
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.exe : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.%.c
|
||||
(cd $(@D) && $(CC) -m$* -o $@ $< $(CFLAGS_JDKLIB) \
|
||||
(cd $(@D) && $(HOST_CC) -m$* -o $@ $< \
|
||||
-I$(JDK_OUTPUTDIR)/include \
|
||||
-I$(JDK_TOPDIR)/src/share/javavm/export \
|
||||
-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/javavm/export \
|
||||
-I$(JDK_TOPDIR)//src/share/native/common \
|
||||
-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/native/common \
|
||||
-I$(JDK_TOPDIR)/src/solaris/native/sun/awt \
|
||||
-I$(JDK_TOPDIR)/src/share/native/sun/awt/debug \
|
||||
-I$(JDK_TOPDIR)/src/share/native/sun/awt/image/cvutils -lc)
|
||||
|
||||
ifeq ($(PLATFORM)-$(LIBARCH), solaris-i386)
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(LIBARCH), solaris-i386)
|
||||
|
||||
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.32 : $(GENSRC_X11WRAPPERS_TMP)/sizer/sizer.32.exe
|
||||
$< > $@.tmp
|
||||
$(MV) $@.tmp $@
|
||||
|
||||
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/classes/sun/awt/X11/generator/sizes.64-$(PLATFORM)-$(LIBARCH)
|
||||
$(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 : $(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/classes/sun/awt/X11/generator/sizes.64-$(OPENJDK_TARGET_OS)-$(LIBARCH)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
else
|
||||
@ -88,9 +93,9 @@ $(GENSRC_X11WRAPPERS_TMP)/classes/_the.classes : $(foreach S,$(GENSRC_SIZES),$(G
|
||||
$(MKDIR) -p $(@D)/sun/awt/X11
|
||||
$(RM) $(@D)/sun/awt/X11/*
|
||||
$(TOOL_WRAPPERGENERATOR) $(@D)/sun/awt/X11 $(GENSRC_SIZER_SRC)/xlibtypes.txt "gen" $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes
|
||||
ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
|
||||
$(ECHO) COMPARING $@ and $(GENSRC_SIZER_SRC)/sizes.64-$(PLATFORM)-i386
|
||||
$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-$(PLATFORM)-i386
|
||||
ifeq ($(OPENJDK_TARGET_OS)-$(LIBARCH), solaris-amd64)
|
||||
$(ECHO) COMPARING $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 and $(GENSRC_SIZER_SRC)/sizes.64-$(OPENJDK_TARGET_OS)-i386
|
||||
$(DIFF) $(GENSRC_X11WRAPPERS_TMP)/sizer/sizes.64 $(GENSRC_SIZER_SRC)/sizes.64-$(OPENJDK_TARGET_OS)-i386
|
||||
endif
|
||||
$(TOUCH) $@
|
||||
|
||||
|
@ -34,15 +34,20 @@ include Tools.gmk
|
||||
|
||||
images: jre-image jdk-image
|
||||
|
||||
ifeq ($(HOST_OS),solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS),solaris)
|
||||
define install-file
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) -r -P '$<' '$(@D)'
|
||||
$(CP) -f -r -P '$<' '$(@D)'
|
||||
endef
|
||||
else ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
define install-file
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) -fpRP '$<' '$@'
|
||||
endef
|
||||
else
|
||||
define install-file
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) -P '$<' '$@'
|
||||
$(CP) -fP '$<' '$@'
|
||||
endef
|
||||
endif
|
||||
|
||||
@ -67,7 +72,7 @@ $(JDK_IMAGE_DIR)/jre/bin/%: $(JDK_OUTPUTDIR)/bin/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
|
||||
NOT_JRE_BIN_FILES = \
|
||||
NOT_JRE_BIN_FILES := \
|
||||
appletviewer$(EXE_SUFFIX) \
|
||||
extcheck$(EXE_SUFFIX) \
|
||||
idlj$(EXE_SUFFIX) \
|
||||
@ -107,7 +112,12 @@ WINDOWS_JDK_BIN_FILES = \
|
||||
|
||||
# Find all files in bin dir
|
||||
ALL_BIN_LIST := $(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f)
|
||||
ifeq ($(HOST_OS),windows)
|
||||
|
||||
# For unknown reason the debuginfo files for binaries are not put into images
|
||||
# e.g filter them out
|
||||
ALL_BIN_LIST := $(filter-out %.debuginfo %.diz, $(ALL_BIN_LIST))
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),windows)
|
||||
JDK_BIN_LIST := $(filter $(addprefix %,$(WINDOWS_JDK_BIN_FILES)), $(ALL_BIN_LIST))
|
||||
else
|
||||
JDK_BIN_LIST := $(ALL_BIN_LIST)
|
||||
@ -147,7 +157,7 @@ NOT_JRE_LIB_FILES := \
|
||||
ct.sym
|
||||
|
||||
JDK_LIB_FILES := $(NOT_JRE_LIB_FILES)
|
||||
ifeq ($(HOST_OS), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
JDK_LIB_FILES += jexec
|
||||
endif
|
||||
|
||||
@ -236,14 +246,21 @@ JDK_MAN_PAGES = \
|
||||
wsimport.1 \
|
||||
xjc.1
|
||||
|
||||
ifeq ($(HOST_OS), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/linux/doc
|
||||
MAN1_SUBDIR:=man
|
||||
endif
|
||||
ifeq ($(HOST_OS), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/solaris/doc
|
||||
MAN1_SUBDIR:=sun/man/man1
|
||||
endif
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
MAN_SRC_DIR:=$(JDK_TOPDIR)/src/bsd/doc
|
||||
MAN1_SUBDIR:=man
|
||||
JDK_MAN_PAGES := $(filter-out jcmd.1, $(JDK_MAN_PAGES))
|
||||
JDK_MAN_PAGES := $(filter-out jvisualvm.1, $(JDK_MAN_PAGES))
|
||||
endif
|
||||
|
||||
|
||||
$(JRE_IMAGE_DIR)/man/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
@ -286,7 +303,7 @@ $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
||||
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(call install-ja-manpage,PCK)
|
||||
|
||||
ifeq ($(HOST_OS), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
$(JRE_IMAGE_DIR)/man/ja/man1/%: $(MAN_SRC_DIR)/$(MAN1_SUBDIR)/ja/%
|
||||
$(ECHO) Converting $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
@ -302,7 +319,7 @@ $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/jcmd.1 $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1
|
||||
$(MKDIR) -p $(@D)
|
||||
$(TOUCH) $@
|
||||
|
||||
ifeq ($(HOST_OS), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
$(JRE_IMAGE_DIR)/man/ja:
|
||||
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
|
||||
@ -312,7 +329,17 @@ ifeq ($(HOST_OS), linux)
|
||||
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
|
||||
endif
|
||||
|
||||
ifeq ($(HOST_OS), linux)
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
$(JRE_IMAGE_DIR)/man/ja:
|
||||
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
|
||||
|
||||
$(JDK_IMAGE_DIR)/man/ja:
|
||||
$(ECHO) Creating $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(CD) $(@D) && $(RM) ja && $(LN) -s ja_JP.UTF-8 ja
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), linux)
|
||||
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
|
||||
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
|
||||
$(JRE_IMAGE_DIR)/man/ja
|
||||
@ -322,7 +349,7 @@ ifeq ($(HOST_OS), linux)
|
||||
$(JDK_IMAGE_DIR)/man/ja
|
||||
endif
|
||||
|
||||
ifeq ($(HOST_OS), solaris)
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
|
||||
$(addprefix $(JRE_IMAGE_DIR)/man/ja/man1/,$(JRE_MAN_PAGES)) \
|
||||
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
|
||||
@ -334,6 +361,16 @@ ifeq ($(HOST_OS), solaris)
|
||||
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.PCK/man1/,$(JDK_MAN_PAGES))
|
||||
endif
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
JRE_MAN_PAGE_LIST := $(addprefix $(JRE_IMAGE_DIR)/man/man1/,$(JRE_MAN_PAGES)) \
|
||||
$(addprefix $(JRE_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JRE_MAN_PAGES)) \
|
||||
$(JRE_IMAGE_DIR)/man/ja
|
||||
|
||||
JDK_MAN_PAGE_LIST := $(addprefix $(JDK_IMAGE_DIR)/man/man1/,$(JDK_MAN_PAGES)) \
|
||||
$(addprefix $(JDK_IMAGE_DIR)/man/ja_JP.UTF-8/man1/,$(JDK_MAN_PAGES)) \
|
||||
$(JDK_IMAGE_DIR)/man/ja
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# /demo dir
|
||||
|
||||
@ -383,6 +420,7 @@ ifndef OPENJDK
|
||||
$(JDK_IMAGE_DIR)/db/README-JDK.html: $(JDK_TOPDIR)/src/closed/share/db/README-JDK.html
|
||||
$(ECHO) Copying '$(patsubst $(OUTPUT_ROOT)/%,%,$@)'
|
||||
$(install-file)
|
||||
$(CHMOD) 644 $(@)
|
||||
|
||||
JDK_DB_TARGETS := $(patsubst $(JDK_TOPDIR)/src/closed/share/db/%,$(IMAGES_OUTPUTDIR)/_unzip/%.unzipped,\
|
||||
$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*.zip" ! -name "*demo*")) \
|
||||
@ -411,7 +449,7 @@ ifdef OPENJDK
|
||||
else
|
||||
JRE_DOC_FILES := COPYRIGHT Welcome.html LICENSE THIRDPARTYLICENSEREADME.txt
|
||||
JDK_DOC_FILES := COPYRIGHT README.html LICENSE THIRDPARTYLICENSEREADME.txt
|
||||
ifeq ($(HOST_OS), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
JRE_DOC_FILES += README.txt
|
||||
else
|
||||
JRE_DOC_FILES += README
|
||||
@ -432,32 +470,39 @@ JDK_DOC_TARGETS := $(addprefix $(JDK_IMAGE_DIR)/,$(JDK_DOC_FILES))
|
||||
$(JRE_IMAGE_DIR)/%: $(JRE_DOC_LOCATION)/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
$(JDK_IMAGE_DIR)/jre/%: $(JRE_DOC_LOCATION)/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
$(JRE_IMAGE_DIR)/README.txt: $(JRE_DOC_LOCATION)/README
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
$(JDK_IMAGE_DIR)/jre/README.txt: $(JRE_DOC_LOCATION)/README
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) $< $@
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
$(JDK_IMAGE_DIR)/%: $(JDK_DOC_LOCATION)/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
$(JDK_IMAGE_DIR)/demo/%: $(JDK_DOC_LOCATION)/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
$(JDK_IMAGE_DIR)/sample/%: $(JDK_DOC_LOCATION)/%
|
||||
$(ECHO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@)
|
||||
$(install-file)
|
||||
$(CHMOD) 444 $(@)
|
||||
|
||||
JRE_INFO_FILE := $(JRE_IMAGE_DIR)/release
|
||||
JDK_INFO_FILE := $(JDK_IMAGE_DIR)/release
|
||||
@ -500,7 +545,7 @@ $(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip
|
||||
# Post processing (strip etc)
|
||||
|
||||
ifneq ($(POST_STRIP_CMD),)
|
||||
ifeq ($(HOST_OS), windows)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
EXEC_LIST:=$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f -name \*.exe \
|
||||
-o -name \*.dll | $(EGREP) -v -i "$(MSVCRNN_DLL)")
|
||||
else
|
||||
@ -510,17 +555,43 @@ ifneq ($(POST_STRIP_CMD),)
|
||||
| $(EGREP) 'ELF' | $(CUT) -d':' -f1)
|
||||
endif
|
||||
# Filter out non JRE files and convert to unique touch files to depend on
|
||||
JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip/%.stripped,\
|
||||
JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%,$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped,\
|
||||
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
|
||||
|
||||
JDK_JRE_EXEC_TOUCH_LIST:=$(patsubst $(JDK_OUTPUTDIR)/%, \
|
||||
$(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped, \
|
||||
$(filter-out $(addprefix %,$(NOT_JRE_BIN_FILES) $(NOT_JRE_LIB_FILES)), $(EXEC_LIST)))
|
||||
|
||||
JDK_BIN_EXEC_TOUCH_LIST := $(patsubst $(JDK_OUTPUTDIR)/%, \
|
||||
$(IMAGES_OUTPUTDIR)/_strip_jdk/%.stripped, \
|
||||
$(filter-out $(JDK_OUTPUTDIR)/lib/%, $(EXEC_LIST)))
|
||||
|
||||
# Setup a rule for stripping files based on touch files
|
||||
$(IMAGES_OUTPUTDIR)/_strip/%.stripped: $(JRE_IMAGE_DIR)/%
|
||||
$(IMAGES_OUTPUTDIR)/_strip_jre/%.stripped: $(JRE_IMAGE_DIR)/%
|
||||
$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
|
||||
$(CHMOD) u+w $<
|
||||
$(POST_STRIP_CMD) $<
|
||||
$(CHMOD) go-w $<
|
||||
$(MKDIR) -p $(@D)
|
||||
$(TOUCH) $@
|
||||
|
||||
$(IMAGES_OUTPUTDIR)/_strip_jdk/bin/%.stripped: $(JDK_IMAGE_DIR)/bin/%
|
||||
$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
|
||||
$(CHMOD) u+w $<
|
||||
$(POST_STRIP_CMD) $<
|
||||
$(CHMOD) go-w $<
|
||||
$(MKDIR) -p $(@D)
|
||||
$(TOUCH) $@
|
||||
|
||||
# Setup a rule for stripping files based on touch files
|
||||
$(IMAGES_OUTPUTDIR)/_strip_jdk/jre/%.stripped: $(JDK_IMAGE_DIR)/jre/%
|
||||
$(ECHO) Stripping $(patsubst $(OUTPUT_ROOT)/%,%,$<)
|
||||
$(CHMOD) u+w $<
|
||||
$(POST_STRIP_CMD) $<
|
||||
$(CHMOD) go-w $<
|
||||
$(MKDIR) -p $(@D)
|
||||
$(TOUCH) $@
|
||||
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
@ -538,7 +609,8 @@ jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \
|
||||
$(JDK_MAN_PAGE_LIST) $(JDK_SAMPLE_TARGETS) \
|
||||
$(JDK_DB_TARGETS) $(JDK_INCLUDE_TARGETS) \
|
||||
$(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \
|
||||
$(JDK_INFO_FILE) $(JDK_IMAGE_DIR)/src.zip
|
||||
$(JDK_INFO_FILE) $(JDK_JRE_EXEC_TOUCH_LIST) $(JDK_BIN_EXEC_TOUCH_LIST) \
|
||||
$(JDK_IMAGE_DIR)/src.zip
|
||||
|
||||
################################################################################
|
||||
|
||||
|
243
jdk/makefiles/Import.gmk
Normal file
243
jdk/makefiles/Import.gmk
Normal file
@ -0,0 +1,243 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
#######
|
||||
|
||||
IMPORT_TARGET_FILES :=
|
||||
|
||||
IMPORT_CLASSES := CORBA JAXP JAXWS LANGTOOLS
|
||||
IMPORT_SOURCES := CORBA JAXP JAXWS LANGTOOLS
|
||||
# Only Corba has binaries
|
||||
IMPORT_BINARIES := CORBA
|
||||
|
||||
#######
|
||||
|
||||
# Put the libraries here. Different locations for different target apis.
|
||||
ifeq ($(OPENJDK_TARGET_OS_API),posix)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib/$(LIBARCH)
|
||||
else
|
||||
INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/lib
|
||||
endif
|
||||
HOTSPOT_LIB_DIR:=$(HOTSPOT_DIST)/jre/lib/$(LIBARCH)
|
||||
else
|
||||
INSTALL_LIBRARIES_HERE:=$(JDK_OUTPUTDIR)/bin
|
||||
HOTSPOT_LIB_DIR:=$(HOTSPOT_DIST)/jre/bin
|
||||
endif
|
||||
|
||||
#######
|
||||
|
||||
#
|
||||
# jar xf/unzip fails when executing them all in parallel
|
||||
# introduce artificial dependency (_DEP) buuhhh
|
||||
|
||||
define ImportClasses
|
||||
$1_CLASSES_DEP := $$(IMPORT_TARGET_CLASSES)
|
||||
IMPORT_TARGET_CLASSES += $(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported
|
||||
|
||||
$(JDK_OUTPUTDIR)/classes/_the.$1.classes.imported : $$($1_DIST)/lib/classes.jar $$($1_CLASSES_DEP)
|
||||
$(ECHO) Importing $1 classes.jar
|
||||
$(MKDIR) -p $$(@D)
|
||||
($(CD) $$(@D) && $(JAR) xvf $$< > $$@.tmp)
|
||||
$(MV) $$@.tmp $$@
|
||||
endef
|
||||
|
||||
define ImportSources
|
||||
$1_SOURCES_DEP := $$(IMPORT_TARGET_SOURCES)
|
||||
IMPORT_TARGET_SOURCES += $(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported
|
||||
|
||||
$(JDK_OUTPUTDIR)/impsrc/_the.$1.src.imported : $$($1_DIST)/lib/src.zip $$($1_SOURCES_DEP)
|
||||
$(ECHO) Importing $1 src.zip
|
||||
$(MKDIR) -p $$(@D)
|
||||
($(CD) $$(@D) && $(JAR) xvf $$< > $$@.tmp)
|
||||
$(MV) $$@.tmp $$@
|
||||
endef
|
||||
|
||||
define ImportBinaries
|
||||
$1_BINARIES_DEP := $$(IMPORT_TARGET_BINARIES)
|
||||
IMPORT_TARGET_BINARIES += $(JDK_OUTPUTDIR)/_the.$1.binaries.imported
|
||||
|
||||
$(JDK_OUTPUTDIR)/_the.$1.binaries.imported : $$($1_DIST)/lib/bin.zip $$($1_BINARIES_DEP)
|
||||
$(ECHO) Importing $1 bin.zip
|
||||
$(MKDIR) -p $$(@D)
|
||||
($(CD) $$(@D) && $(JAR) xvf $$< > $$@.tmp)
|
||||
$(MV) $$@.tmp $$@
|
||||
endef
|
||||
|
||||
#######
|
||||
|
||||
$(foreach I,$(IMPORT_CLASSES), $(eval $(call ImportClasses,$I)))
|
||||
$(foreach I,$(IMPORT_SOURCES), $(eval $(call ImportSources,$I)))
|
||||
$(foreach I,$(IMPORT_BINARIES), $(eval $(call ImportBinaries,$I)))
|
||||
|
||||
IMPORT_TARGET_FILES += $(IMPORT_TARGET_CLASSES) $(IMPORT_TARGET_SOURCES) $(IMPORT_TARGET_BINARIES)
|
||||
|
||||
#######
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),solaris)
|
||||
define do-install-file
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(CP) -r -P '$$<' '$$(@D)'
|
||||
endef
|
||||
else ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
define do-install-file
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(CP) -pRP '$$<' '$$@'
|
||||
endef
|
||||
else
|
||||
define do-install-file
|
||||
$(MKDIR) -p $$(@D)
|
||||
$(CP) -P '$$<' '$$@'
|
||||
endef
|
||||
endif
|
||||
|
||||
define CopyDir
|
||||
$1_SRC_FILES := $(shell $(FIND) $2 -type f)
|
||||
$1_DST_FILES := $$(patsubst $2/%,$3/%,$$($1_SRC_FILES))
|
||||
IMPORT_TARGET_FILES += $$($1_DST_FILES)
|
||||
$3/% : $2/%
|
||||
$(ECHO) Copying $$(@F)
|
||||
$(do-install-file)
|
||||
endef
|
||||
|
||||
#######
|
||||
|
||||
#
|
||||
# Import hotspot
|
||||
#
|
||||
|
||||
$(eval $(call CopyDir,HOTSPOT0, $(HOTSPOT_LIB_DIR), $(INSTALL_LIBRARIES_HERE)))
|
||||
$(eval $(call CopyDir,HOTSPOT1, $(HOTSPOT_DIST)/lib, $(JDK_OUTPUTDIR)/lib))
|
||||
|
||||
JSIG_DEBUGINFO := $(wildcard $(HOTSPOT_DIST)/jre/lib/$(LIBARCH)/libjsig.debuginfo) \
|
||||
$(wildcard $(HOTSPOT_DIST)/jre/lib/$(LIBARCH)/libjsig.diz)
|
||||
|
||||
ifneq ($(OPENJDK_TARGET_OS), windows)
|
||||
ifeq ($(JVM_VARIANT_SERVER), true)
|
||||
IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
|
||||
ifneq (,$(JSIG_DEBUGINFO))
|
||||
IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/server/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
|
||||
endif
|
||||
endif
|
||||
ifeq ($(JVM_VARIANT_CLIENT), true)
|
||||
IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(LIBRARY_PREFIX)jsig$(SHARED_LIBRARY_SUFFIX)
|
||||
ifneq (,$(JSIG_DEBUGINFO))
|
||||
IMPORT_TARGET_FILES += $(INSTALL_LIBRARIES_HERE)/client/$(foreach I,$(JSIG_DEBUGINFO),$(notdir $I))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$(INSTALL_LIBRARIES_HERE)/server/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
|
||||
$(RM) -f $@
|
||||
$(LN) -s ../$(@F) $@
|
||||
|
||||
$(INSTALL_LIBRARIES_HERE)/server/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
|
||||
$(RM) -f $@
|
||||
$(LN) -s ../$(@F) $@
|
||||
|
||||
$(INSTALL_LIBRARIES_HERE)/server/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
|
||||
$(RM) -f $@
|
||||
ifeq (REALLY_WEIRD,1)
|
||||
$(LN) -s ../$(@F) $@
|
||||
else
|
||||
#
|
||||
# TODO: Check if this is what they really want...a zip containing a symlink
|
||||
#
|
||||
$(RM) -f $(basename $@).debuginfo
|
||||
$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
|
||||
$(ZIP) -q -y $@ $(basename $@).debuginfo
|
||||
$(RM) -f $(basename $@).debuginfo
|
||||
endif
|
||||
|
||||
$(INSTALL_LIBRARIES_HERE)/client/%$(SHARED_LIBRARY_SUFFIX) : $(INSTALL_LIBRARIES_HERE)/%$(SHARED_LIBRARY_SUFFIX)
|
||||
$(RM) -f $@
|
||||
$(LN) -s ../$(@F) $@
|
||||
|
||||
$(INSTALL_LIBRARIES_HERE)/client/%.debuginfo : $(INSTALL_LIBRARIES_HERE)/%.debuginfo
|
||||
$(RM) -f $@
|
||||
$(LN) -s ../$(@F) $@
|
||||
|
||||
$(INSTALL_LIBRARIES_HERE)/client/%.diz : $(INSTALL_LIBRARIES_HERE)/%.diz
|
||||
$(RM) -f $@
|
||||
ifeq (REALLY_WEIRD,1)
|
||||
$(LN) -s ../$(@F) $@
|
||||
else
|
||||
#
|
||||
# TODO: Check if this is what they really want...a zip containing a symlink
|
||||
#
|
||||
$(RM) -f $(basename $@).debuginfo
|
||||
$(LN) -s ../$(basename $(@F)).debuginfo $(basename $@).debuginfo
|
||||
$(ZIP) -q -y $@ $(basename $@).debuginfo
|
||||
$(RM) -f $(basename $@).debuginfo
|
||||
endif
|
||||
|
||||
#######
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS),solaris)
|
||||
define install-file
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) -r -P '$<' '$(@D)'
|
||||
endef
|
||||
else ifeq ($(OPENJDK_TARGET_OS),macosx)
|
||||
define install-file
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) -pRP '$<' '$@'
|
||||
endef
|
||||
else
|
||||
define install-file
|
||||
$(MKDIR) -p $(@D)
|
||||
$(CP) -P '$<' '$@'
|
||||
endef
|
||||
endif
|
||||
|
||||
ifndef OPENJDK
|
||||
|
||||
IMPORT_TARGET_FILES += \
|
||||
$(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar \
|
||||
$(JDK_OUTPUTDIR)/lib/security/local_policy.jar \
|
||||
$(JDK_OUTPUTDIR)/lib/jce.jar
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/jce.jar : $(JDK_TOPDIR)/make/closed/tools/crypto/jce/jce.jar
|
||||
$(ECHO) Copying $(@F)
|
||||
$(install-file)
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/security/local_policy.jar: $(JDK_TOPDIR)/make/closed/tools/crypto/jce/local_policy.jar
|
||||
$(ECHO) Copying $(@F)
|
||||
$(install-file)
|
||||
|
||||
$(JDK_OUTPUTDIR)/lib/security/US_export_policy.jar: $(JDK_TOPDIR)/make/closed/tools/crypto/jce/US_export_policy.jar
|
||||
$(ECHO) Copying $(@F)
|
||||
$(install-file)
|
||||
|
||||
endif # OPENJDK
|
||||
|
||||
#######
|
||||
|
||||
all: $(IMPORT_TARGET_FILES)
|
@ -1,42 +0,0 @@
|
||||
#
|
||||
# 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 $(SPEC)
|
||||
include MakeBase.gmk
|
||||
|
||||
all: $(JDK_OUTPUTDIR)/_the.legacy_make
|
||||
|
||||
DEPS:= $(shell $(FIND) $(JDK_TOPDIR)/makefiles/java -type f) \
|
||||
$(shell $(FIND) $(JDK_TOPDIR)/makefiles/javax -type f) \
|
||||
$(shell $(FIND) $(JDK_TOPDIR)/makefiles/sun -type f) \
|
||||
$(shell $(FIND) $(JDK_TOPDIR)/makefiles/com -type f)
|
||||
|
||||
$(JDK_OUTPUTDIR)/_the.legacy_make: $(DEPS)
|
||||
(echo Building single threaded Java subdir && \
|
||||
$(MAKE) -j1 -C java all && \
|
||||
touch $@)
|
||||
|
||||
.PHONY: all
|
||||
|
@ -38,21 +38,21 @@ include Setup.gmk
|
||||
include Tools.gmk
|
||||
|
||||
all: $(BUILD_TOOLS)
|
||||
# Import (corba jaxp jaxws langtools hotspot)
|
||||
+$(MAKE) -f Import.gmk
|
||||
#
|
||||
+$(MAKE) -f GenerateJavaSources.gmk
|
||||
# Drop back to the old makefiles for
|
||||
# packages/libs that have not yet been converted.
|
||||
+$(MAKE) -f LegacyMakefiles.gmk
|
||||
# Ok, now gensrc is fully populated.
|
||||
+$(MAKE) -f GenerateData.gmk
|
||||
+$(MAKE) -f CompileJavaClasses.gmk
|
||||
# The classes have been built, now generate
|
||||
# classes that have other sources.
|
||||
+$(MAKE) -f GenerateClasses.gmk
|
||||
# The classes are now built and
|
||||
# any javah files have now been generated.
|
||||
+$(MAKE) -f CompileNativeLibraries.gmk
|
||||
# Finally compile the launchers.
|
||||
+$(MAKE) -f CompileLaunchers.gmk
|
||||
# Generate classes that have other sources. Needs
|
||||
# to execute launchers.
|
||||
+$(MAKE) -f GenerateClasses.gmk
|
||||
# Now we have a complete jdk, which you can run.
|
||||
# It is not yet wrapped up as an installed image.
|
||||
# The demos are compiled against this jdk.
|
||||
@ -64,16 +64,11 @@ ifndef NO_SAMPLES
|
||||
+$(MAKE) -f CopySamples.gmk
|
||||
endif
|
||||
|
||||
# Create the final jdk and jre images in the old way. Kept for reference
|
||||
# until conversion is fully done.
|
||||
old-images:
|
||||
+$(MAKE) $(IMAGES_MAKE_ARGS) -f OldImages.gmk
|
||||
|
||||
# Create the final jdk and jre images, to be wrapped up
|
||||
# into packages, or installed.
|
||||
images:
|
||||
+$(MAKE) -f CreateJars.gmk
|
||||
+$(MAKE) $(IMAGES_MAKE_ARGS) -f Images.gmk
|
||||
+$(MAKE) -f Images.gmk
|
||||
|
||||
|
||||
BINARIES:=$(shell if test -d $(IMAGES_OUTPUTDIR)/j2sdk-image/bin; then cd $(IMAGES_OUTPUTDIR)/j2sdk-image/bin && $(LS) ; fi)
|
||||
@ -90,9 +85,4 @@ install: images
|
||||
$(RM) $(addprefix $(INSTALL_PREFIX)/bin/,$(BINARIES))
|
||||
$(foreach b,$(BINARIES),$(LN) -s $(INSTALL_PREFIX)/jvm/$(INSTALLDIR)/bin/$b $(INSTALL_PREFIX)/bin/$b &&) true
|
||||
|
||||
# Create the deb,rpm,tgz,zip, packages.
|
||||
packages: images
|
||||
echo Creating packages...well, in the future.
|
||||
$(MKDIR) -p $(OUTPUT_ROOT)/packages
|
||||
|
||||
.PHONY: all install images
|
||||
|
@ -1,175 +0,0 @@
|
||||
#
|
||||
# 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 $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
include Setup.gmk
|
||||
|
||||
default: $(IMAGES_OUTPUTDIR)/_the.images
|
||||
|
||||
include Tools.gmk
|
||||
|
||||
JARS:=
|
||||
|
||||
##########################################################################################
|
||||
|
||||
JCONSOLE_JAR_DEPS := \
|
||||
$(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/sun/tools/jconsole/ -name "_the.package") \
|
||||
$(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses/com/sun/tools/jconsole/ -name "_the.package")
|
||||
|
||||
$(eval $(call SetupArchive,BUILD_JCONSOLE_JAR,$(JCONSOLE_JAR_DEPS),\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/newclasses,\
|
||||
SUFFIXES:=.class .gif .png,\
|
||||
INCLUDES:=sun/tools/jconsole com/sun/tools/jconsole,\
|
||||
JARMAIN:=sun.tools.jconsole.JConsole,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/jconsole.jar,\
|
||||
SKIP_METAINF:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/jconsole.jar
|
||||
|
||||
##########################################################################################
|
||||
|
||||
CHARSETS_JAR_DEPS :=
|
||||
|
||||
$(eval $(call SetupArchive,BUILD_CHARSETS_JAR,$(CHARSETS_JAR_DEPS),\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/newclasses, \
|
||||
SUFFIXES:=.class .dat,\
|
||||
INCLUDES:=sun/nio/cs/ext,\
|
||||
EXTRA_FILES := sun/awt/HKSCS.class \
|
||||
sun/awt/motif/X11GBK.class \
|
||||
'sun/awt/motif/X11GB2312$$$$Decoder.class' \
|
||||
sun/awt/motif/X11GB2312.class \
|
||||
'sun/awt/motif/X11KSC5601$$$$Decoder.class' \
|
||||
'sun/awt/motif/X11KSC5601$$$$Encoder.class' \
|
||||
'sun/awt/motif/X11GB2312$$$$Encoder.class' \
|
||||
'sun/awt/motif/X11GBK$$$$Encoder.class' \
|
||||
sun/awt/motif/X11KSC5601.class \
|
||||
META-INF/services/java.nio.charset.spi.CharsetProvider, \
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/charsets.jar, \
|
||||
JARMAIN := NONE, \
|
||||
SKIP_METAINF := true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/charsets.jar
|
||||
|
||||
##########################################################################################
|
||||
|
||||
SUNPKCS11_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunpkcs11.jar
|
||||
|
||||
ifndef OPENJDK
|
||||
|
||||
SUNPKCS11_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/pkcs11/sunpkcs11.jar
|
||||
|
||||
$(SUNPKCS11_JAR_DST) : $(SUNPKCS11_JAR_SRC)
|
||||
@$(ECHO) "\n>>>Installing prebuilt SunPKCS11 provider..."
|
||||
$(RM) $@
|
||||
$(CP) $< $@
|
||||
|
||||
else
|
||||
|
||||
$(eval $(call SetupArchive,BUILD_SUNPKCS11_JAR,$(SUNPKCS11_JAR_DEPS),\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/newclasses, \
|
||||
SUFFIXES:=.class,\
|
||||
INCLUDES:=sun/security/pkcs11,\
|
||||
JAR:=$(SUNPKCS11_JAR_DST), \
|
||||
JARMAIN := NONE, \
|
||||
SKIP_METAINF := true))
|
||||
|
||||
endif
|
||||
|
||||
JARS += $(SUNPKCS11_JAR_DST)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
SUNEC_JAR_DST := $(JDK_OUTPUTDIR)/lib/ext/sunec.jar
|
||||
|
||||
ifndef OPENJDK
|
||||
|
||||
SUNEC_JAR_SRC := $(JDK_TOPDIR)/make/closed/tools/crypto/ec/sunec.jar
|
||||
|
||||
$(SUNEC_JAR_DST) : $(SUNEC_JAR_SRC)
|
||||
@$(ECHO) "\n>>>Installing prebuilt SunEC provider..."
|
||||
$(RM) $@
|
||||
$(CP) $< $@
|
||||
|
||||
else
|
||||
|
||||
$(eval $(call SetupArchive,BUILD_SUNEC_JAR,$(SUNEC_JAR_DEPS),\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/newclasses, \
|
||||
SUFFIXES:=.class,\
|
||||
INCLUDES:=sun/security/ec,\
|
||||
EXCLUDE_FILES := \
|
||||
sun/security/ec/ECKeyFactory.class \
|
||||
sun/security/ec/ECParameters.class \
|
||||
sun/security/ec/ECPrivateKeyImpl.class \
|
||||
sun/security/ec/ECPublicKeyImpl.class \
|
||||
sun/security/ec/NamedCurve.class \
|
||||
'sun/security/ec/ECKeyFactory$$$$1.class' \
|
||||
'sun/security/ec/ECKeyFactory$$$$2.class' ,\
|
||||
JAR:=$(SUNEC_JAR_DST), \
|
||||
JARMAIN := NONE, \
|
||||
SKIP_METAINF := true))
|
||||
|
||||
endif
|
||||
|
||||
JARS += $(SUNEC_JAR_DST)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# TODO: deps?
|
||||
$(eval $(call SetupArchive,BUILD_SWINGBEANS_JAR,$(SWINGBEANS_JAR_DEPS),\
|
||||
SRCS:=$(JDK_OUTPUTDIR)/newclasses,\
|
||||
SUFFIXES:=BeanInfo.class .gif,\
|
||||
INCLUDES:=javax/swing sun/swing,\
|
||||
EXCLUDES:=javax/swing/plaf,\
|
||||
EXTRA_FILES:=javax/swing/SwingBeanInfoBase.class sun/swing/BeanInfoUtils.class,\
|
||||
JAR:=$(JDK_OUTPUTDIR)/lib/dt.jar,\
|
||||
JARMAIN:=NONE,\
|
||||
SKIP_METAINF:=true))
|
||||
|
||||
JARS+=$(JDK_OUTPUTDIR)/lib/dt.jar
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# Need to define BUILDDIR for Release.gmk to work
|
||||
BUILDDIR=$(JDK_TOPDIR)/makefiles
|
||||
include common/Defs.gmk
|
||||
include common/Release.gmk
|
||||
|
||||
# A rudimentary attempt at band-aiding the dependency tracking.
|
||||
DEPS:= $(shell $(FIND) $(JDK_OUTPUTDIR)/newclasses -name "*.class" -type f) \
|
||||
$(shell $(FIND) $(JDK_OUTPUTDIR)/bin -type f) \
|
||||
$(shell $(FIND) $(JDK_OUTPUTDIR)/lib -type f)
|
||||
|
||||
$(IMAGES_OUTPUTDIR)/_the.images : $(DEPS) $(JARS)
|
||||
$(MKDIR) -p $(@D)
|
||||
# Restart this makefile, ugly, but since double colon (::) rules
|
||||
# have been used in Release.gmk, it is impossible to craft on
|
||||
# dependencies on these. I.e. -do-not-use- :: rules!!!!!
|
||||
# Repeat after me: -do-not-use- :: rules!!!!!
|
||||
$(MAKE) -j1 -f OldImages.gmk $(IMAGES_MAKE_ARGS) images
|
||||
$(TOUCH) $@
|
||||
|
||||
.PHONY: default
|
@ -123,3 +123,27 @@ TOOL_WRAPPERGENERATOR=$(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
|
||||
|
||||
TOOL_TOBIN=$(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses \
|
||||
sun.awt.X11.ToBin
|
||||
|
||||
##########################################################################################
|
||||
|
||||
# Tools needed on solaris because OBJCOPY is broken.
|
||||
|
||||
$(eval $(call SetupNativeCompilation,ADD_GNU_DEBUGLINK,\
|
||||
SRC:=$(JDK_TOPDIR)/make/tools/add_gnu_debuglink,\
|
||||
LANG:=C,\
|
||||
CC:=$(HOST_CC),\
|
||||
LDEXE:=$(HOST_LD),\
|
||||
LDFLAGS:=-lelf,\
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/add_gnu_debuglink,\
|
||||
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/btbin,\
|
||||
PROGRAM:=add_gnu_debuglink))
|
||||
|
||||
$(eval $(call SetupNativeCompilation,FIX_EMPTY_SEC_HDR_FLAGS,\
|
||||
SRC:=$(JDK_TOPDIR)/make/tools/fix_empty_sec_hdr_flags,\
|
||||
LANG:=C,\
|
||||
CC:=$(HOST_CC),\
|
||||
LDEXE:=$(HOST_LD),\
|
||||
LDFLAGS:=-lelf,\
|
||||
OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/fix_empty_sec_hdr_flags,\
|
||||
OUTPUT_DIR:=$(JDK_OUTPUTDIR)/btbin,\
|
||||
PROGRAM:=fix_empty_sec_hdr_flags))
|
||||
|
@ -1,275 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2007, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for building sunjce_provider.jar.
|
||||
#
|
||||
# This file was derived from make/javax/crypto/Makefile.
|
||||
#
|
||||
|
||||
#
|
||||
# (The terms "OpenJDK" and "JDK" below refer to OpenJDK and Sun JDK builds
|
||||
# respectively.)
|
||||
#
|
||||
# JCE builds are very different between OpenJDK and JDK. The OpenJDK JCE
|
||||
# jar files do not require signing, but those for JDK do. If an unsigned
|
||||
# jar file is installed into JDK, things will break when the crypto
|
||||
# routines are called.
|
||||
#
|
||||
# This Makefile does the "real" build of the JCE files. There are some
|
||||
# javac options currently specific to JCE, so we recompile now to make
|
||||
# sure any implicit compilations didn't use any incorrect flags.
|
||||
#
|
||||
# For OpenJDK, the jar files built here are installed directly into the
|
||||
# OpenJDK.
|
||||
#
|
||||
# For JDK, the binaries use pre-built/pre-signed binary files stored in
|
||||
# the closed workspace that are not shipped in the OpenJDK workspaces.
|
||||
# We still build the JDK files here to verify the files compile, and in
|
||||
# preparation for possible signing. Developers working on JCE in JDK
|
||||
# must sign the JCE files before testing. The JCE signing key is kept
|
||||
# separate from the JDK workspace to prevent its disclosure.
|
||||
#
|
||||
# SPECIAL NOTE TO JCE/JDK developers: The source files must eventually
|
||||
# be built and signed, and the resulting jar files MUST BE CHECKED INTO
|
||||
# THE CLOSED PART OF THE WORKSPACE*. This separate step *MUST NOT BE
|
||||
# FORGOTTEN*, otherwise a bug fixed in the source code will not be
|
||||
# reflected in the shipped binaries. The "release" target should be
|
||||
# used to generate the required files.
|
||||
#
|
||||
# There are a number of targets to help both JDK/OpenJDK developers.
|
||||
#
|
||||
# Main Targets (JDK/OPENJDK):
|
||||
#
|
||||
# all/clobber/clean The usual.
|
||||
# If OpenJDK, installs sunjce_provider.jar.
|
||||
# If JDK, installs prebuilt
|
||||
# sunjce_provider.jar.
|
||||
#
|
||||
# jar Builds/installs sunjce_provider.jar
|
||||
# If OpenJDK, does not sign.
|
||||
# If JDK, tries to sign.
|
||||
#
|
||||
# Other lesser-used Targets (JDK/OPENJDK):
|
||||
#
|
||||
# build-jar Builds sunjce_provider.jar
|
||||
# (does not sign/install)
|
||||
#
|
||||
# install-jar Alias for "jar" above.
|
||||
#
|
||||
# Other targets (JDK only):
|
||||
#
|
||||
# sign Alias for sign-jar
|
||||
# sign-jar Builds/signs sunjce_provider.jar (no install)
|
||||
#
|
||||
# release Builds all targets in preparation
|
||||
# for workspace integration.
|
||||
#
|
||||
# install-prebuilt Installs the pre-built jar files
|
||||
#
|
||||
# This makefile was written to support parallel target execution.
|
||||
#
|
||||
|
||||
BUILDDIR = ../../../..
|
||||
PACKAGE = com.sun.crypto.provider
|
||||
PRODUCT = sun
|
||||
|
||||
#
|
||||
# The following is for when we need to do postprocessing
|
||||
# (signing) against a read-only build. If the OUTPUTDIR
|
||||
# isn't writable, the build currently crashes out.
|
||||
#
|
||||
ifndef OPENJDK
|
||||
ifdef ALT_JCE_BUILD_DIR
|
||||
# =====================================================
|
||||
# Where to place the output, in case we're building from a read-only
|
||||
# build area. (e.g. a release engineering build.)
|
||||
JCE_BUILD_DIR=${ALT_JCE_BUILD_DIR}
|
||||
IGNORE_WRITABLE_OUTPUTDIR_TEST=true
|
||||
else
|
||||
JCE_BUILD_DIR=${TEMPDIR}
|
||||
endif
|
||||
endif
|
||||
|
||||
JAVAC_MAX_WARNINGS = false
|
||||
JAVAC_LINT_OPTIONS = -Xlint:all,-deprecation
|
||||
JAVAC_WARNINGS_FATAL = true
|
||||
include $(BUILDDIR)/common/Defs.gmk
|
||||
|
||||
#
|
||||
# Location for the newly built classfiles.
|
||||
#
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
|
||||
#
|
||||
# Subdirectories of these are automatically included.
|
||||
#
|
||||
AUTO_FILES_JAVA_DIRS = \
|
||||
com/sun/crypto/provider
|
||||
|
||||
include $(BUILDDIR)/common/Classes.gmk
|
||||
|
||||
#
|
||||
# Rules
|
||||
#
|
||||
|
||||
#
|
||||
# Some licensees do not get the security sources, but we still need to
|
||||
# be able to build "all" for them. Check here to see if the sources were
|
||||
# available. If not, then we don't need to continue this rule.
|
||||
#
|
||||
|
||||
ifdef OPENJDK
|
||||
all: build-jar install-jar
|
||||
else # OPENJDK
|
||||
ifeq ($(strip $(FILES_java)),)
|
||||
all: install-prebuilt
|
||||
$(no-source-warning)
|
||||
else # FILES_java available
|
||||
all: build-jar install-prebuilt
|
||||
$(build-warning)
|
||||
endif # $(FILES_java) available
|
||||
endif # OPENJDK
|
||||
|
||||
#
|
||||
# We use a variety of subdirectories in the $(TEMPDIR) depending on what
|
||||
# part of the build we're doing. Both OPENJDK/JDK builds are initially
|
||||
# done in the unsigned area. When files are signed in JDK, they will be
|
||||
# placed in the appropriate areas.
|
||||
#
|
||||
UNSIGNED_DIR = $(TEMPDIR)/unsigned
|
||||
|
||||
include $(BUILDDIR)/javax/crypto/Defs-jce.gmk
|
||||
|
||||
|
||||
# =====================================================
|
||||
# Build the unsigned sunjce_provider.jar file.
|
||||
#
|
||||
|
||||
JAR_DESTFILE = $(EXTDIR)/sunjce_provider.jar
|
||||
|
||||
#
|
||||
# The sunjce_provider.jar needs to be in the extension class directory,
|
||||
# therefore none of its classes should appear in $(CLASSBINDIR).
|
||||
# Currently no one is using any of the SunJCE internals, so these files
|
||||
# should not have been built.
|
||||
#
|
||||
|
||||
#
|
||||
# Since the -C option to jar is used below, each directory entry must be
|
||||
# preceded with the appropriate directory to "cd" into.
|
||||
#
|
||||
JAR_DIRS = $(patsubst %, -C $(CLASSDESTDIR) %, $(AUTO_FILES_JAVA_DIRS))
|
||||
|
||||
build-jar: $(UNSIGNED_DIR)/sunjce_provider.jar
|
||||
|
||||
#
|
||||
# Build sunjce_provider.jar.
|
||||
#
|
||||
$(UNSIGNED_DIR)/sunjce_provider.jar: build $(JCE_MANIFEST_FILE)
|
||||
$(prep-target)
|
||||
$(BOOT_JAR_CMD) cmf $(JCE_MANIFEST_FILE) $@ $(JAR_DIRS) \
|
||||
$(BOOT_JAR_JFLAGS)
|
||||
@$(java-vm-cleanup)
|
||||
|
||||
|
||||
ifndef OPENJDK
|
||||
# =====================================================
|
||||
# Sign the provider jar file. Not needed for OpenJDK.
|
||||
#
|
||||
|
||||
SIGNED_DIR = $(JCE_BUILD_DIR)/signed
|
||||
|
||||
sign: sign-jar
|
||||
|
||||
sign-jar: $(SIGNED_DIR)/sunjce_provider.jar
|
||||
|
||||
ifndef ALT_JCE_BUILD_DIR
|
||||
$(SIGNED_DIR)/sunjce_provider.jar: $(UNSIGNED_DIR)/sunjce_provider.jar
|
||||
else
|
||||
#
|
||||
# We have to remove the build dependency, otherwise, we'll try to rebuild it
|
||||
# which we can't do on a read-only filesystem.
|
||||
#
|
||||
$(SIGNED_DIR)/sunjce_provider.jar:
|
||||
@if [ ! -r $(UNSIGNED_DIR)/sunjce_provider.jar ] ; then \
|
||||
$(ECHO) "Couldn't find $(UNSIGNED_DIR)/sunjce_provider.jar"; \
|
||||
exit 1; \
|
||||
fi
|
||||
endif
|
||||
$(call sign-file, $(UNSIGNED_DIR)/sunjce_provider.jar)
|
||||
|
||||
|
||||
# =====================================================
|
||||
# Create the Release Engineering files. Signed builds, etc.
|
||||
#
|
||||
|
||||
release: $(SIGNED_DIR)/sunjce_provider.jar
|
||||
$(RM) $(JCE_BUILD_DIR)/release/sunjce_provider.jar
|
||||
$(MKDIR) -p $(JCE_BUILD_DIR)/release
|
||||
$(CP) $(SIGNED_DIR)/sunjce_provider.jar $(JCE_BUILD_DIR)/release
|
||||
$(release-warning)
|
||||
|
||||
endif # OPENJDK
|
||||
|
||||
|
||||
# =====================================================
|
||||
# Install routines.
|
||||
#
|
||||
|
||||
#
|
||||
# Install sunjce_provider.jar, depending on which type is requested.
|
||||
#
|
||||
install-jar jar: $(JAR_DESTFILE)
|
||||
ifndef OPENJDK
|
||||
$(release-warning)
|
||||
endif
|
||||
|
||||
ifdef OPENJDK
|
||||
$(JAR_DESTFILE): $(UNSIGNED_DIR)/sunjce_provider.jar
|
||||
else
|
||||
$(JAR_DESTFILE): $(SIGNED_DIR)/sunjce_provider.jar
|
||||
endif
|
||||
$(install-file)
|
||||
|
||||
ifndef OPENJDK
|
||||
install-prebuilt:
|
||||
@$(ECHO) "\n>>>Installing prebuilt SunJCE provider..."
|
||||
$(RM) $(JAR_DESTFILE)
|
||||
$(CP) $(PREBUILT_DIR)/jce/sunjce_provider.jar $(JAR_DESTFILE)
|
||||
endif
|
||||
|
||||
|
||||
# =====================================================
|
||||
# Support routines.
|
||||
#
|
||||
|
||||
clobber clean::
|
||||
$(RM) -r $(JAR_DESTFILE) $(TEMPDIR) $(JCE_BUILD_DIR)
|
||||
|
||||
.PHONY: build-jar jar install-jar
|
||||
ifndef OPENJDK
|
||||
.PHONY: sign sign-jar release install-prebuilt
|
||||
endif
|
@ -1,67 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 2005, 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.
|
||||
#
|
||||
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
include $(JDK_TOPDIR)/makefiles/common/Rules.gmk
|
||||
|
||||
#
|
||||
# Say you built classes into $(ALT_CLASSBINDIR) and then at the end of
|
||||
# the build you might want to copy them over to $(ALT_CLASSDESTDIR);
|
||||
# this rule takes care of that. No one should really set these
|
||||
# variables except the bootstrap/recompile stage of the java compiler.
|
||||
#
|
||||
ifdef ALT_CLASSBINDIR
|
||||
|
||||
# By default post-processing is copying. Suppose you want to build
|
||||
# a jar file then set ALT_CLASSES_DISPOSITION to '../../dest/nameof.jar'
|
||||
# before including this file.
|
||||
ifndef ALT_CLASSES_DISPOSITION
|
||||
ALT_CLASSES_DISPOSITION = copy-classes
|
||||
endif
|
||||
|
||||
build : $(ALT_CLASSES_DISPOSITION)
|
||||
|
||||
copy-classes:
|
||||
ifneq ($(ALT_CLASSBINDIR), $(ALT_CLASSDESTDIR))
|
||||
@if [ -s $(TEMPDIR)/.classes.list ]; then \
|
||||
mkdir -p $(ALT_CLASSDESTDIR); \
|
||||
echo "Copying $(ALT_CLASSBINDIR)..."; \
|
||||
echo "(cd $(ALT_CLASSBINDIR); tar cf - .) | \
|
||||
(cd $(ALT_CLASSDESTDIR); tar xf -)"; \
|
||||
(cd $(ALT_CLASSBINDIR); tar cf - .) | \
|
||||
(cd $(ALT_CLASSDESTDIR); tar xf -); \
|
||||
fi
|
||||
else # ALT_CLASSBINDIR
|
||||
@if [ -s $(TEMPDIR)/.classes.list ]; then \
|
||||
echo "Copy source and destination are the same: $(ALT_CLASSBINDIR) -- Copy skipped..."; \
|
||||
fi
|
||||
endif # ALT_CLASSBINDIR
|
||||
|
||||
.PHONY: copy-classes
|
||||
endif # ALT_CLASSBINDIR
|
||||
|
@ -1,100 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1998, 2010, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# The cscope.out file is made in the current directory and spans the entire
|
||||
# source tree.
|
||||
#
|
||||
# Things to note:
|
||||
# 1. We use relative names for cscope.
|
||||
# 2. We *don't* remove the old cscope.out file, because cscope is smart
|
||||
# enough to only build what has changed. It can be confused, however,
|
||||
# if files are renamed or removed, so it may be necessary to manually
|
||||
# remove cscope.out if a lot of reorganization has occurred.
|
||||
#
|
||||
CSDIRS = $(JDK_TOPDIR)/src $(JDK_TOPDIR)/build
|
||||
CSINCS = $(CSDIRS:%=-I%)
|
||||
|
||||
#
|
||||
# Set CSFLAGS env variable to -b when using fast cscope to build the fast
|
||||
# (but large) cscope data bases.
|
||||
#
|
||||
CSCOPE = cscope-fast
|
||||
ifeq ($(CSCOPE), cscope-fast)
|
||||
CSFLAGS = -b
|
||||
endif
|
||||
|
||||
#
|
||||
# Adding .java files pushes the file count of a full workspace up about 2500
|
||||
# files, which slows database lookup. Thus allow these files to be added from
|
||||
# the environment (CSCLASSES=yes).
|
||||
#
|
||||
ifdef CSCLASSES
|
||||
ADDCLASSES= -o -name '*.java'
|
||||
endif
|
||||
|
||||
#
|
||||
# Adding CClassHeaders also pushes the file count of a full workspace up about
|
||||
# 200 files (these files also don't exist in a new workspace, and thus will
|
||||
# cause the recreation of the database as they get created, which might seem
|
||||
# A little confusing). Thus allow these files to be added from the environment
|
||||
# (CSHEADERS=yes).
|
||||
#
|
||||
ifndef CSHEADERS
|
||||
RMCCHEADERS= -o -name CClassHeaders
|
||||
endif
|
||||
|
||||
|
||||
.PRECIOUS: cscope.out
|
||||
|
||||
cscope.out: cscope.files FRC
|
||||
$(CSCOPE) $(CSFLAGS)
|
||||
|
||||
#
|
||||
# What files should we include? A simple rule might be just those files under
|
||||
# SCM control, however this would miss files we create like the opcodes and
|
||||
# CClassHeaders. The following attempts to find everything that is *useful*.
|
||||
# (demo directories contain many .java files
|
||||
# that probably aren't useful for development, and the pkgarchive may contain
|
||||
# duplicates of files within the source hierarchy). The ordering of the .raw
|
||||
# file is an attempt to make cscope display the most relevant files first.
|
||||
#
|
||||
cscope.files: FRC
|
||||
@-$(RM) cscope.files cscope.files.raw
|
||||
echo "$(CSINCS)" > cscope.files
|
||||
-find $(CSDIRS) $(SCM_DIRS_prune) -o -type d \( -name '.del-*' -o \
|
||||
-name '*demo' -o -name pkgarchive $(RMCCHEADERS) \) -prune -o \
|
||||
-type f \( -name '*.[Ccshlxy]' -o -name '*.il' -o -name '*.cc' -o \
|
||||
-name 'Makefile*' -o -name GNUmakefile -o -name '*.gmk' -o \
|
||||
-name '*.cpp' $(ADDCLASSES) \) -print > cscope.files.raw
|
||||
-egrep -v "\.java|\/build\/" cscope.files.raw >> cscope.files
|
||||
-fgrep ".java" cscope.files.raw >> cscope.files
|
||||
-fgrep "/build/" cscope.files.raw >> cscope.files
|
||||
@-$(RM) cscope.files.raw
|
||||
|
||||
cscope.clean:
|
||||
-$(RM) cscope.files cscope.files.raw cscope.out
|
||||
|
||||
FRC:
|
@ -1,76 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Variable definitions for SE Embedded builds. This file should
|
||||
# not contain rules.
|
||||
#
|
||||
ifdef JAVASE_EMBEDDED
|
||||
|
||||
# Compress jar files
|
||||
COMPRESS_JARS = true
|
||||
|
||||
# Don't mmap zip files
|
||||
LIBZIP_CAN_USE_MMAP = false
|
||||
|
||||
# Disable ALSA version check
|
||||
REQUIRED_ALSA_VERSION =
|
||||
|
||||
# Compilation settings
|
||||
OTHER_CPPFLAGS += -DJAVASE_EMBEDDED
|
||||
|
||||
# Product naming
|
||||
PRODUCT_SUFFIX = SE Runtime Environment for Embedded
|
||||
RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
|
||||
|
||||
# Reduced JRE locations
|
||||
JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
|
||||
JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
|
||||
|
||||
# Override on linux to further reduce binary/lib sizes in product build
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifeq ($(VARIANT), OPT)
|
||||
ifneq ($(NO_STRIP), true)
|
||||
ifneq ($(DEBUG_BINARIES), true)
|
||||
POST_STRIP_PROCESS = $(STRIP) --strip-unneeded
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# NIO Platform specific source file location
|
||||
ifdef CROSS_COMPILE_ARCH
|
||||
NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
|
||||
endif
|
||||
|
||||
# For ARM sflt we need to link to a library with improved FP accuracy
|
||||
# and it must be linked after fdlibm - this places it at the end after libc
|
||||
# -z muldefs avoids linker errors for duplicate symbols.
|
||||
ifeq ($(CROSS_COMPILE_ARCH), arm)
|
||||
EXTRA_LIBS += $(EXT_LIBS_PATH)/sflt_glibc_jdk.a -Xlinker -z -Xlinker muldefs
|
||||
endif
|
||||
|
||||
endif # JAVASE_EMBEDDED
|
||||
|
@ -1,430 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1999, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile to specify compiler flags for programs and libraries
|
||||
# targeted to Linux. Should not contain any rules.
|
||||
#
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
# Warning: the following variables are overriden by Defs.gmk. Set
|
||||
# values will be silently ignored:
|
||||
# CFLAGS (set $(OTHER_CFLAGS) instead)
|
||||
# CPPFLAGS (set $(OTHER_CPPFLAGS) instead)
|
||||
# CXXFLAGS (set $(OTHER_CXXFLAGS) instead)
|
||||
# LDFLAGS (set $(OTHER_LDFAGS) instead)
|
||||
# LDLIBS (set $(EXTRA_LIBS) instead)
|
||||
# LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
|
||||
|
||||
# Get shared JDK settings
|
||||
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
|
||||
|
||||
# Part of INCREMENTAL_BUILD mechanism.
|
||||
# Compiler emits things like: path/file.o: file.h
|
||||
# We want something like: relative_path/file.o relative_path/file.d: file.h
|
||||
CC_DEPEND = -MM
|
||||
CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
|
||||
|
||||
ifndef PLATFORM_SRC
|
||||
PLATFORM_SRC = $(BUILDDIR)/../src/solaris
|
||||
endif # PLATFORM_SRC
|
||||
|
||||
# Platform specific closed sources
|
||||
ifndef OPENJDK
|
||||
ifndef CLOSED_PLATFORM_SRC
|
||||
CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
|
||||
endif
|
||||
endif
|
||||
|
||||
# platform specific include files
|
||||
PLATFORM_INCLUDE_NAME = $(PLATFORM)
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
|
||||
|
||||
# suffix used for make dependencies files.
|
||||
DEPEND_SUFFIX = d
|
||||
# The suffix applied to the library name for FDLIBM
|
||||
FDDLIBM_SUFFIX = a
|
||||
# The suffix applied to scripts (.bat for windows, nothing for unix)
|
||||
SCRIPT_SUFFIX =
|
||||
# CC compiler object code output directive flag value
|
||||
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
|
||||
|
||||
# Default OBJCOPY comes from GNU Binutils on Linux:
|
||||
DEF_OBJCOPY=/usr/bin/objcopy
|
||||
ifdef CROSS_COMPILE_ARCH
|
||||
# don't try to generate .debuginfo files when cross compiling
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: cross compiling for ARCH $(CROSS_COMPILE_ARCH)," \
|
||||
"skipping .debuginfo generation.")
|
||||
OBJCOPY=
|
||||
else
|
||||
OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
|
||||
ifneq ($(ALT_OBJCOPY),)
|
||||
_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
|
||||
# disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
|
||||
OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
|
||||
# The setting of OBJCOPY above enables the JDK build to import
|
||||
# .debuginfo files from the HotSpot build. However, adding FDS
|
||||
# support to the JDK build will occur in phases so a different
|
||||
# make variable is used to indicate that a particular library
|
||||
# supports FDS.
|
||||
|
||||
ifeq ($(OBJCOPY),)
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
|
||||
else
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
|
||||
|
||||
# Library stripping policies for .debuginfo configs:
|
||||
# all_strip - strips everything from the library
|
||||
# min_strip - strips most stuff from the library; leaves minimum symbols
|
||||
# no_strip - does not strip the library at all
|
||||
#
|
||||
# Oracle security policy requires "all_strip". A waiver was granted on
|
||||
# 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
|
||||
#
|
||||
DEF_STRIP_POLICY="min_strip"
|
||||
ifeq ($(ALT_STRIP_POLICY),)
|
||||
STRIP_POLICY=$(DEF_STRIP_POLICY)
|
||||
else
|
||||
STRIP_POLICY=$(ALT_STRIP_POLICY)
|
||||
endif
|
||||
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Default optimization
|
||||
#
|
||||
|
||||
ifndef OPTIMIZATION_LEVEL
|
||||
ifeq ($(PRODUCT), java)
|
||||
OPTIMIZATION_LEVEL = HIGHER
|
||||
else
|
||||
OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
endif
|
||||
ifndef FASTDEBUG_OPTIMIZATION_LEVEL
|
||||
FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
|
||||
CC_OPT/NONE =
|
||||
CC_OPT/LOWER = -O2
|
||||
CC_OPT/HIGHER = -O3
|
||||
CC_OPT/HIGHEST = -O3
|
||||
|
||||
CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
|
||||
|
||||
# For all platforms, do not omit the frame pointer register usage.
|
||||
# We need this frame pointer to make it easy to walk the stacks.
|
||||
# This should be the default on X86, but ia64 and amd64 may not have this
|
||||
# as the default.
|
||||
CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
|
||||
CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
|
||||
CFLAGS_REQUIRED_ia64 += -fno-omit-frame-pointer -D_LITTLE_ENDIAN
|
||||
CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
|
||||
LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
|
||||
CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
|
||||
LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
|
||||
CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN
|
||||
CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN
|
||||
ifeq ($(ZERO_BUILD), true)
|
||||
CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
|
||||
ifeq ($(ZERO_ENDIANNESS), little)
|
||||
CFLAGS_REQUIRED += -D_LITTLE_ENDIAN
|
||||
endif
|
||||
LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
|
||||
else
|
||||
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
|
||||
LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
|
||||
endif
|
||||
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both
|
||||
# The gnu .hash section won't work on some Linux systems like SuSE 10.
|
||||
_HAS_HASH_STYLE_GNU:=$(shell $(CC) -dumpspecs | $(GREP) -- '--hash-style=gnu')
|
||||
ifneq ($(_HAS_HASH_STYLE_GNU),)
|
||||
LDFLAGS_HASH_STYLE = -Wl,--hash-style=both
|
||||
endif
|
||||
LDFLAGS_COMMON += $(LDFLAGS_HASH_STYLE)
|
||||
|
||||
#
|
||||
# Selection of warning messages
|
||||
#
|
||||
GCC_INHIBIT = -Wno-unused -Wno-parentheses
|
||||
GCC_STYLE =
|
||||
GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
|
||||
|
||||
#
|
||||
# Treat compiler warnings as errors, if warnings not allowed
|
||||
#
|
||||
ifeq ($(COMPILER_WARNINGS_FATAL),true)
|
||||
GCC_WARNINGS += -Werror
|
||||
endif
|
||||
|
||||
#
|
||||
# Misc compiler options
|
||||
#
|
||||
ifneq ($(ARCH),ppc)
|
||||
CFLAGS_COMMON = -fno-strict-aliasing
|
||||
endif
|
||||
PIC_CODE_LARGE = -fPIC
|
||||
PIC_CODE_SMALL = -fpic
|
||||
GLOBAL_KPIC = $(PIC_CODE_LARGE)
|
||||
CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS)
|
||||
ifeq ($(ARCH), amd64)
|
||||
CFLAGS_COMMON += -pipe
|
||||
endif
|
||||
|
||||
# Linux 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1
|
||||
DEBUG_FLAG = -g
|
||||
ifeq ($(FASTDEBUG), true)
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
DEBUG_FLAG = -g1
|
||||
endif
|
||||
endif
|
||||
|
||||
# DEBUG_BINARIES overrides everything, use full -g debug information
|
||||
ifeq ($(DEBUG_BINARIES), true)
|
||||
DEBUG_FLAG = -g
|
||||
CFLAGS_REQUIRED += $(DEBUG_FLAG)
|
||||
endif
|
||||
|
||||
CFLAGS_OPT = $(CC_OPT)
|
||||
CFLAGS_DBG = $(DEBUG_FLAG)
|
||||
CFLAGS_COMMON += $(CFLAGS_REQUIRED)
|
||||
|
||||
CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
|
||||
CXXFLAGS_OPT = $(CC_OPT)
|
||||
CXXFLAGS_DBG = $(DEBUG_FLAG)
|
||||
CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
|
||||
|
||||
# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
|
||||
ifeq ($(FASTDEBUG), true)
|
||||
CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
endif
|
||||
|
||||
CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
|
||||
|
||||
# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
|
||||
ifneq ($(ARCH),alpha)
|
||||
CPP_ARCH_FLAGS += -D$(ARCH)
|
||||
else
|
||||
CPP_ARCH_FLAGS += -D_$(ARCH)_
|
||||
endif
|
||||
|
||||
CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -DLINUX $(VERSION_DEFINES) \
|
||||
-D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
|
||||
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
CPPFLAGS_COMMON += -D_LP64=1
|
||||
endif
|
||||
|
||||
CPPFLAGS_OPT = -DNDEBUG
|
||||
CPPFLAGS_DBG = -DDEBUG
|
||||
ifneq ($(PRODUCT), java)
|
||||
CPPFLAGS_DBG += -DLOGGING
|
||||
endif
|
||||
|
||||
ifdef LIBRARY
|
||||
# Libraries need to locate other libraries at runtime, and you can tell
|
||||
# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
|
||||
# buried inside the .so. The $ORIGIN says to look relative to where
|
||||
# the library itself is and it can be followed with relative paths from
|
||||
# that. By default we always look in $ORIGIN, optionally we add relative
|
||||
# paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
|
||||
# On Linux we add a flag -z origin, not sure if this is necessary, but
|
||||
# doesn't seem to hurt.
|
||||
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
|
||||
# Try: 'readelf -d lib*.so' to see these settings in a library.
|
||||
#
|
||||
Z_ORIGIN_FLAG/sparc = -Xlinker -z -Xlinker origin
|
||||
Z_ORIGIN_FLAG/i586 = -Xlinker -z -Xlinker origin
|
||||
Z_ORIGIN_FLAG/amd64 = -Xlinker -z -Xlinker origin
|
||||
Z_ORIGIN_FLAG/ia64 = -Xlinker -z -Xlinker origin
|
||||
Z_ORIGIN_FLAG/arm =
|
||||
Z_ORIGIN_FLAG/ppc =
|
||||
Z_ORIGIN_FLAG/zero = -Xlinker -z -Xlinker origin
|
||||
|
||||
LDFLAG_Z_ORIGIN = $(Z_ORIGIN_FLAG/$(ARCH_FAMILY))
|
||||
|
||||
LDFLAGS_COMMON += $(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN
|
||||
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=$(LDFLAG_Z_ORIGIN) -Xlinker -rpath -Xlinker \$$ORIGIN/%)
|
||||
|
||||
endif
|
||||
|
||||
EXTRA_LIBS += -lc
|
||||
|
||||
LDFLAGS_DEFS_OPTION = -Xlinker -z -Xlinker defs
|
||||
#LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
|
||||
|
||||
#
|
||||
# -L paths for finding and -ljava
|
||||
#
|
||||
LDFLAGS_OPT = -Xlinker -O1
|
||||
LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
|
||||
LDFLAGS_COMMON += -Wl,-soname=$(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
|
||||
|
||||
#
|
||||
# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
|
||||
# statically link libgcc but will print a warning with the flag. We don't
|
||||
# want the warning, so check gcc version first.
|
||||
#
|
||||
ifeq ($(CC_MAJORVER),3)
|
||||
OTHER_LDFLAGS += -static-libgcc
|
||||
endif
|
||||
|
||||
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|
||||
# (See Rules.gmk) The gcc 5 compiler might have an option for this?
|
||||
AUTOMATIC_PCH_OPTION =
|
||||
|
||||
#
|
||||
# Post Processing of libraries/executables
|
||||
#
|
||||
ifeq ($(VARIANT), OPT)
|
||||
ifneq ($(NO_STRIP), true)
|
||||
ifneq ($(DEBUG_BINARIES), true)
|
||||
# Debug 'strip -g' leaves local function Elf symbols (better stack
|
||||
# traces)
|
||||
POST_STRIP_PROCESS = $(STRIP) -g
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
|
||||
#
|
||||
LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
|
||||
|
||||
#
|
||||
# Support for Quantify.
|
||||
#
|
||||
ifdef QUANTIFY
|
||||
QUANTIFY_CMD = quantify
|
||||
QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
|
||||
LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
|
||||
endif
|
||||
|
||||
#
|
||||
# Path and option to link against the VM, if you have to. Note that
|
||||
# there are libraries that link against only -ljava, but they do get
|
||||
# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
|
||||
# the library itself should not.
|
||||
#
|
||||
VM_NAME = server
|
||||
# First try to link against server, if that does not exist link against client.
|
||||
JVMLIB = -L$(LIBDIR)/$(LIBARCH)/server -L$(LIBDIR)/$(LIBARCH)/client -ljvm
|
||||
JAVALIB = -ljava $(JVMLIB)
|
||||
|
||||
#
|
||||
# We want to privatize JVM symbols on Solaris. This is so the user can
|
||||
# write a function called FindClass and this should not override the
|
||||
# FindClass that is inside the JVM. At this point in time we are not
|
||||
# concerned with other JNI libraries because we hope that there will
|
||||
# not be as many clashes there.
|
||||
#
|
||||
PRIVATIZE_JVM_SYMBOLS = false
|
||||
|
||||
USE_PTHREADS = true
|
||||
override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME
|
||||
override AWT_RUNPATH =
|
||||
override HAVE_ALTZONE = false
|
||||
override HAVE_FILIOH = false
|
||||
override HAVE_GETHRTIME = false
|
||||
override HAVE_GETHRVTIME = false
|
||||
override HAVE_SIGIGNORE = true
|
||||
override LEX_LIBRARY = -lfl
|
||||
ifeq ($(STATIC_CXX),true)
|
||||
override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
|
||||
else
|
||||
override LIBCXX = -lstdc++
|
||||
endif
|
||||
override LIBPOSIX4 =
|
||||
override LIBSOCKET =
|
||||
override LIBNSL =
|
||||
override LIBSCF =
|
||||
override LIBTHREAD =
|
||||
override LIBDL = -ldl
|
||||
override MOOT_PRIORITIES = true
|
||||
override NO_INTERRUPTIBLE_IO = true
|
||||
ifeq ($(ARCH), amd64)
|
||||
override OPENWIN_LIB = $(OPENWIN_HOME)/lib64
|
||||
else
|
||||
override OPENWIN_LIB = $(OPENWIN_HOME)/lib
|
||||
endif
|
||||
override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER
|
||||
override SUN_CMM_SUBDIR =
|
||||
override THREADS_FLAG = native
|
||||
override USE_GNU_M4 = true
|
||||
override USING_GNU_TAR = true
|
||||
override WRITE_LIBVERSION = false
|
||||
|
||||
# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
|
||||
# resulting resolved absolute name of the executable in the environment
|
||||
# variable EXECNAME. That executable name is then used that to locate the
|
||||
# installation area.
|
||||
override USE_EXECNAME = true
|
||||
|
||||
# If your platform has DPS, it will have Type1 fonts too, in which case
|
||||
# it is best to enable DPS support until such time as 2D's rasteriser
|
||||
# can fully handle Type1 fonts in all cases. Default is "yes".
|
||||
# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
|
||||
# DPS (Displayable PostScript) is available on Solaris machines
|
||||
HAVE_DPS = no
|
||||
|
||||
#
|
||||
# Japanese manpages
|
||||
#
|
||||
JA_SOURCE_ENCODING = eucJP
|
||||
JA_TARGET_ENCODINGS = UTF-8
|
||||
|
||||
# Settings for the JDI - Serviceability Agent binding.
|
||||
HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
|
||||
SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
|
||||
SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
|
||||
|
||||
# The JDI - Serviceability Agent binding is not currently supported
|
||||
# on Linux-ia64.
|
||||
ifeq ($(ARCH), ia64)
|
||||
INCLUDE_SA = false
|
||||
else
|
||||
INCLUDE_SA = true
|
||||
endif
|
||||
|
||||
ifdef CROSS_COMPILE_ARCH
|
||||
# X11 headers are not under /usr/include
|
||||
OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
|
||||
OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
|
||||
OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
|
||||
endif
|
@ -1,402 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1999, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile to specify compiler flags for programs and libraries
|
||||
# targeted to MACOSX. Should not contain any rules.
|
||||
#
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
# Warning: the following variables are overriden by Defs.gmk. Set
|
||||
# values will be silently ignored:
|
||||
# CFLAGS (set $(OTHER_CFLAGS) instead)
|
||||
# CPPFLAGS (set $(OTHER_CPPFLAGS) instead)
|
||||
# CXXFLAGS (set $(OTHER_CXXFLAGS) instead)
|
||||
# LDFLAGS (set $(OTHER_LDFAGS) instead)
|
||||
# LDLIBS (set $(EXTRA_LIBS) instead)
|
||||
# LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
|
||||
|
||||
# Get shared JDK settings
|
||||
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
|
||||
|
||||
# Part of INCREMENTAL_BUILD mechanism.
|
||||
# Compiler emits things like: path/file.o: file.h
|
||||
# We want something like: relative_path/file.o relative_path/file.d: file.h
|
||||
CC_DEPEND = -MM
|
||||
CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g'
|
||||
|
||||
ifndef PLATFORM_SRC
|
||||
PLATFORM_SRC = $(BUILDDIR)/../src/solaris
|
||||
endif # PLATFORM_SRC
|
||||
|
||||
PLATFORM_SRC_MACOS = $(BUILDDIR)/../src/macosx
|
||||
|
||||
# BSD build pulls its platform sources from the solaris tree.
|
||||
JAVA_SRCDIR_LIST = src/$(PLATFORM) src/solaris src/share
|
||||
NATIVE_SRCDIR_LIST = src/$(PLATFORM) src/solaris src/share
|
||||
|
||||
# Platform specific closed sources
|
||||
ifndef OPENJDK
|
||||
ifndef CLOSED_PLATFORM_SRC
|
||||
CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
|
||||
endif
|
||||
endif
|
||||
|
||||
# platform specific include files
|
||||
PLATFORM_INCLUDE_NAME = $(OS_NAME)
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
|
||||
|
||||
# suffix used for make dependencies files.
|
||||
DEPEND_SUFFIX = d
|
||||
# The suffix applied to the library name for FDLIBM
|
||||
FDDLIBM_SUFFIX = a
|
||||
# The suffix applied to scripts (.bat for windows, nothing for unix)
|
||||
SCRIPT_SUFFIX =
|
||||
# CC compiler object code output directive flag value
|
||||
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
|
||||
CC_PROGRAM_OUTPUT_FLAG = -o #trailing blank required!
|
||||
|
||||
#
|
||||
# Default optimization
|
||||
#
|
||||
|
||||
ifndef OPTIMIZATION_LEVEL
|
||||
ifeq ($(PRODUCT), java)
|
||||
OPTIMIZATION_LEVEL = HIGHER
|
||||
else
|
||||
OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
endif
|
||||
ifndef FASTDEBUG_OPTIMIZATION_LEVEL
|
||||
FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
|
||||
# For macosx use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
|
||||
# <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
|
||||
CC_OPT/NONE =
|
||||
CC_OPT/LOWER = -Os
|
||||
CC_OPT/HIGHER = -Os
|
||||
CC_OPT/HIGHEST = -Os
|
||||
|
||||
CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
|
||||
|
||||
# For all platforms, do not omit the frame pointer register usage.
|
||||
# We need this frame pointer to make it easy to walk the stacks.
|
||||
# This should be the default on X86, but ia64, and x86_64
|
||||
# may not have this as the default.
|
||||
CFLAGS_REQUIRED_x86_64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
|
||||
LDFLAGS_COMMON_x86_64 += -m64
|
||||
CFLAGS_REQUIRED_i586 += -m32 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
|
||||
LDFLAGS_COMMON_i586 += -m32
|
||||
CFLAGS_REQUIRED_ia64 += -m64 -fno-omit-frame-pointer -D_LITTLE_ENDIAN
|
||||
CFLAGS_REQUIRED_sparcv9 += -m64 -mcpu=v9
|
||||
LDFLAGS_COMMON_sparcv9 += -m64 -mcpu=v9
|
||||
CFLAGS_REQUIRED_sparc += -m32 -mcpu=v9
|
||||
LDFLAGS_COMMON_sparc += -m32 -mcpu=v9
|
||||
CFLAGS_REQUIRED_arm += -fsigned-char -D_LITTLE_ENDIAN
|
||||
CFLAGS_REQUIRED_ppc += -fsigned-char -D_BIG_ENDIAN
|
||||
ifeq ($(ZERO_BUILD), true)
|
||||
CFLAGS_REQUIRED = $(ZERO_ARCHFLAG)
|
||||
ifeq ($(ZERO_ENDIANNESS), little)
|
||||
CFLAGS_REQUIRED += -D_LITTLE_ENDIAN
|
||||
endif
|
||||
LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
|
||||
else ifeq ($(ARCH), universal)
|
||||
CFLAGS_REQUIRED += -arch i386 -arch x86_64 -D_LITTLE_ENDIAN
|
||||
LDFLAGS_COMMON += -arch i386 -arch x86_64
|
||||
else
|
||||
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
|
||||
LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
|
||||
endif
|
||||
# 16-byte stack re-alignment on 32-bit Darwin
|
||||
CFLAGS_REQUIRED_i586 += -mstackrealign
|
||||
|
||||
OTHER_CFLAGS = \
|
||||
-F/System/Library/Frameworks/JavaVM.framework/Frameworks \
|
||||
-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
|
||||
|
||||
#
|
||||
# Selection of warning messages
|
||||
#
|
||||
GCC_INHIBIT = -Wno-unused -Wno-parentheses
|
||||
GCC_STYLE =
|
||||
GCC_WARNINGS = -W -Wall $(GCC_STYLE) $(GCC_INHIBIT)
|
||||
|
||||
#
|
||||
# Treat compiler warnings as errors, if warnings not allowed
|
||||
#
|
||||
ifeq ($(COMPILER_WARNINGS_FATAL),true)
|
||||
GCC_WARNINGS += -Werror
|
||||
endif
|
||||
|
||||
#
|
||||
# Misc compiler options
|
||||
#
|
||||
ifneq ($(ARCH),ppc)
|
||||
CFLAGS_COMMON = -fno-strict-aliasing
|
||||
endif
|
||||
PIC_CODE_LARGE = -fPIC
|
||||
PIC_CODE_SMALL = -fpic
|
||||
GLOBAL_KPIC = $(PIC_CODE_LARGE)
|
||||
CFLAGS_COMMON += $(GLOBAL_KPIC) $(GCC_WARNINGS)
|
||||
ifeq ($(ARCH), x86_64)
|
||||
CFLAGS_COMMON += -pipe
|
||||
endif
|
||||
|
||||
# BSD 64bit machines use Dwarf2, which can be HUGE, have fastdebug use -g1
|
||||
DEBUG_FLAG = -g
|
||||
ifeq ($(FASTDEBUG), true)
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
DEBUG_FLAG = -g1
|
||||
endif
|
||||
endif
|
||||
|
||||
# DEBUG_BINARIES overrides everything, use full -g debug information
|
||||
ifeq ($(DEBUG_BINARIES), true)
|
||||
DEBUG_FLAG = -g
|
||||
CFLAGS_REQUIRED += $(DEBUG_FLAG)
|
||||
endif
|
||||
|
||||
CFLAGS_OPT = $(CC_OPT)
|
||||
CFLAGS_DBG = $(DEBUG_FLAG)
|
||||
CFLAGS_COMMON += $(CFLAGS_REQUIRED)
|
||||
|
||||
CXXFLAGS_COMMON = $(GLOBAL_KPIC) -DCC_NOEX $(GCC_WARNINGS)
|
||||
CXXFLAGS_OPT = $(CC_OPT)
|
||||
CXXFLAGS_DBG = $(DEBUG_FLAG)
|
||||
CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
|
||||
|
||||
# FASTDEBUG: Optimize the code in the -g versions, gives us a faster debug java
|
||||
ifeq ($(FASTDEBUG), true)
|
||||
CFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
CXXFLAGS_DBG += $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
endif
|
||||
|
||||
CPP_ARCH_FLAGS = -DARCH='"$(ARCH)"'
|
||||
|
||||
# Alpha arch does not like "alpha" defined (potential general arch cleanup issue here)
|
||||
ifneq ($(ARCH),alpha)
|
||||
CPP_ARCH_FLAGS += -D$(ARCH)
|
||||
else
|
||||
CPP_ARCH_FLAGS += -D_$(ARCH)_
|
||||
endif
|
||||
CPPFLAGS_COMMON = $(CPP_ARCH_FLAGS) -D_ALLBSD_SOURCE $(VERSION_DEFINES) \
|
||||
-D_LARGEFILE64_SOURCE -D_GNU_SOURCE -D_REENTRANT
|
||||
|
||||
CPPFLAGS_COMMON += -DMACOSX
|
||||
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
CPPFLAGS_COMMON += -D_LP64=1
|
||||
endif
|
||||
|
||||
CPPFLAGS_OPT = -DNDEBUG
|
||||
CPPFLAGS_DBG = -DDEBUG
|
||||
ifneq ($(PRODUCT), java)
|
||||
CPPFLAGS_DBG += -DLOGGING
|
||||
endif
|
||||
|
||||
# Libraries need to locate other libraries at runtime, and you can tell
|
||||
# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
|
||||
# buried inside the .{so,dylib}. The {$ORIGIN,@loader_path/} says to look
|
||||
# relative to where the library itself is and it can be followed
|
||||
# with relative paths from that. By default we always look in
|
||||
# {$ORIGIN,@loader_path/}, optionally we add relative paths if the Makefile
|
||||
# sets LD_RUNPATH_EXTRAS to those relative paths.
|
||||
# Except on MacOS X we add a flag -z origin, not sure if this is necessary,
|
||||
# but doesn't seem to hurt.
|
||||
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
|
||||
# See 'man {dyld,rtld}' for more information.
|
||||
# Try: 'readelf -d lib*.so' to see these settings in a library.
|
||||
#
|
||||
LDFLAGS_COMMON += -Xlinker -rpath -Xlinker @loader_path/.
|
||||
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-Xlinker -rpath -Xlinker @loader_path/%)
|
||||
LDFLAGS_COMMON += -Xlinker -install_name -Xlinker @rpath/$(@F)
|
||||
|
||||
#
|
||||
# -L paths for finding and -ljava
|
||||
#
|
||||
LDFLAGS_COMMON += -L$(LIBDIR)
|
||||
|
||||
#
|
||||
# -static-libgcc is a gcc-3 flag to statically link libgcc, gcc-2.9x always
|
||||
# statically link libgcc but will print a warning with the flag. We don't
|
||||
# want the warning, so check gcc version first.
|
||||
#
|
||||
ifeq ($(CC_MAJORVER),3)
|
||||
OTHER_LDFLAGS += -static-libgcc
|
||||
endif
|
||||
|
||||
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|
||||
# (See Rules.gmk) The gcc 5 compiler might have an option for this?
|
||||
AUTOMATIC_PCH_OPTION =
|
||||
|
||||
#
|
||||
# Post Processing of libraries/executables
|
||||
#
|
||||
ifeq ($(VARIANT), OPT)
|
||||
ifneq ($(NO_STRIP), true)
|
||||
ifneq ($(DEBUG_BINARIES), true)
|
||||
# Debug 'strip -S' leaves local function Elf symbols (better stack
|
||||
# traces)
|
||||
POST_STRIP_PROCESS = $(STRIP) -S
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Use: ld $(LD_MAPFILE_FLAG) mapfile *.o
|
||||
#
|
||||
LD_MAPFILE_FLAG = -Xlinker --version-script -Xlinker
|
||||
|
||||
#
|
||||
# Support for Quantify.
|
||||
#
|
||||
ifdef QUANTIFY
|
||||
QUANTIFY_CMD = quantify
|
||||
QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
|
||||
LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
|
||||
endif
|
||||
|
||||
# Darwin does not support linker map files.
|
||||
LDNOMAP=true
|
||||
|
||||
#
|
||||
# Path and option to link against the VM, if you have to. Note that
|
||||
# there are libraries that link against only -ljava, but they do get
|
||||
# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
|
||||
# the library itself should not.
|
||||
#
|
||||
VM_NAME = server
|
||||
JVMLIB = -L$(LIBDIR)/server -L$(LIBDIR)/client -ljvm
|
||||
JAVALIB = -ljava $(JVMLIB)
|
||||
|
||||
#
|
||||
# We want to privatize JVM symbols on Solaris. This is so the user can
|
||||
# write a function called FindClass and this should not override the
|
||||
# FindClass that is inside the JVM. At this point in time we are not
|
||||
# concerned with other JNI libraries because we hope that there will
|
||||
# not be as many clashes there.
|
||||
#
|
||||
PRIVATIZE_JVM_SYMBOLS = false
|
||||
|
||||
USE_PTHREADS = true
|
||||
override ALT_CODESET_KEY = _NL_CTYPE_CODESET_NAME
|
||||
override AWT_RUNPATH =
|
||||
override HAVE_ALTZONE = false
|
||||
override HAVE_FILIOH = false
|
||||
override HAVE_GETHRTIME = false
|
||||
override HAVE_GETHRVTIME = false
|
||||
override HAVE_SIGIGNORE = true
|
||||
override LEX_LIBRARY = -lfl
|
||||
ifeq ($(STATIC_CXX),true)
|
||||
override LIBCXX = -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
|
||||
else
|
||||
override LIBCXX = -lstdc++
|
||||
endif
|
||||
override LIBPOSIX4 =
|
||||
override LIBSOCKET =
|
||||
override LIBNSL =
|
||||
override LIBTHREAD =
|
||||
override LIBDL =
|
||||
override MOOT_PRIORITIES = true
|
||||
override NO_INTERRUPTIBLE_IO = true
|
||||
override OPENWIN_HOME = $(X11_PATH)
|
||||
override OPENWIN_LIB = $(OPENWIN_HOME)/lib
|
||||
override OTHER_M4FLAGS = -D__GLIBC__ -DGNU_ASSEMBLER
|
||||
override SUN_CMM_SUBDIR =
|
||||
override THREADS_FLAG = native
|
||||
override USE_GNU_M4 = true
|
||||
override USING_GNU_TAR = true
|
||||
override WRITE_LIBVERSION = false
|
||||
|
||||
ifdef ALT_X11_PATH
|
||||
X11_PATH = $(ALT_X11_PATH)
|
||||
else
|
||||
X11_PATH = /usr/X11R6
|
||||
endif
|
||||
|
||||
ifdef ALT_PACKAGE_PATH
|
||||
PACKAGE_PATH = $(ALT_PACKAGE_PATH)
|
||||
else
|
||||
PACKAGE_PATH = /opt/local
|
||||
endif
|
||||
|
||||
# ALSA
|
||||
ifdef ALT_ALSA_LIB_PATH
|
||||
ALSA_LIB_PATH = $(ALT_ALSA_LIB_PATH)
|
||||
else
|
||||
ALSA_LIB_PATH = $(PACKAGE_PATH)/lib
|
||||
endif
|
||||
|
||||
ifdef ALT_ALSA_HEADERS_PATH
|
||||
ALSA_HEADERS_PATH = $(ALT_ALSA_HEADERS_PATH)
|
||||
else
|
||||
ALSA_HEADERS_PATH = $(PACKAGE_PATH)/include
|
||||
endif
|
||||
|
||||
# USE_EXECNAME forces the launcher to look up argv[0] on $PATH, and put the
|
||||
# resulting resolved absolute name of the executable in the environment
|
||||
# variable EXECNAME. That executable name is then used that to locate the
|
||||
# installation area.
|
||||
override USE_EXECNAME = true
|
||||
|
||||
# If your platform has DPS, it will have Type1 fonts too, in which case
|
||||
# it is best to enable DPS support until such time as 2D's rasteriser
|
||||
# can fully handle Type1 fonts in all cases. Default is "yes".
|
||||
# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
|
||||
# DPS (Displayable PostScript) is available on Solaris machines
|
||||
HAVE_DPS = no
|
||||
|
||||
SYSTEM_ZLIB = true
|
||||
|
||||
#
|
||||
# Japanese manpages
|
||||
#
|
||||
JA_SOURCE_ENCODING = eucJP
|
||||
JA_TARGET_ENCODINGS = UTF-8
|
||||
|
||||
# Settings for the JDI - Serviceability Agent binding.
|
||||
|
||||
HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
|
||||
SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
|
||||
|
||||
# The JDI - Serviceability Agent binding is not currently supported
|
||||
# on ia64.
|
||||
ifeq ($(ARCH), ia64)
|
||||
INCLUDE_SA = false
|
||||
else
|
||||
INCLUDE_SA = true
|
||||
endif
|
||||
|
||||
ifdef CROSS_COMPILE_ARCH
|
||||
# X11 headers are not under /usr/include
|
||||
OTHER_CFLAGS += -I$(OPENWIN_HOME)/include
|
||||
OTHER_CXXFLAGS += -I$(OPENWIN_HOME)/include
|
||||
OTHER_CPPFLAGS += -I$(OPENWIN_HOME)/include
|
||||
endif
|
||||
|
||||
LIB_LOCATION ?= $(LIBDIR)
|
@ -1,757 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile to specify compiler flags for programs and libraries
|
||||
# targeted to Solaris. Should not contain any rules.
|
||||
#
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
# Warning: the following variables are overridden by Defs.gmk. Set
|
||||
# values will be silently ignored:
|
||||
# CFLAGS (set $(OTHER_CFLAGS) instead)
|
||||
# CPPFLAGS (set $(OTHER_CPPFLAGS) instead)
|
||||
# CXXFLAGS (set $(OTHER_CXXFLAGS) instead)
|
||||
# LDFLAGS (set $(OTHER_LDFAGS) instead)
|
||||
# LDLIBS (set $(EXTRA_LIBS) instead)
|
||||
# LDLIBS_COMMON (set $(EXTRA_LIBS) instead)
|
||||
# LINTFLAGS (set $(OTHER_LINTFLAGS) instead)
|
||||
#
|
||||
# Note: CPPFLAGS are used in C and C++ compiles.
|
||||
#
|
||||
|
||||
# Get shared JDK settings
|
||||
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
|
||||
|
||||
ifndef PLATFORM_SRC
|
||||
PLATFORM_SRC = $(BUILDDIR)/../src/solaris
|
||||
endif # PLATFORM_SRC
|
||||
|
||||
# Platform specific closed sources
|
||||
ifndef OPENJDK
|
||||
ifndef CLOSED_PLATFORM_SRC
|
||||
CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/solaris
|
||||
endif
|
||||
endif
|
||||
|
||||
# platform specific include files
|
||||
PLATFORM_INCLUDE_NAME = $(PLATFORM)
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
|
||||
|
||||
# suffix used for make dependencies files
|
||||
DEPEND_SUFFIX = d
|
||||
# suffix used for lint files
|
||||
LINT_SUFFIX = ln
|
||||
# The suffix applied to the library name for FDLIBM
|
||||
FDDLIBM_SUFFIX = a
|
||||
# The suffix applied to scripts (.bat for windows, nothing for unix)
|
||||
SCRIPT_SUFFIX =
|
||||
# CC compiler object code output directive flag value
|
||||
CC_OBJECT_OUTPUT_FLAG = -o #trailing blank required!
|
||||
|
||||
ifdef ENABLE_FULL_DEBUG_SYMBOLS
|
||||
# Only check for Full Debug Symbols support on Solaris if it is
|
||||
# specifically enabled. Hopefully, it can be enabled by default
|
||||
# once the .debuginfo size issues are worked out.
|
||||
|
||||
# Default OBJCOPY comes from the SUNWbinutils package:
|
||||
DEF_OBJCOPY=/usr/sfw/bin/gobjcopy
|
||||
ifeq ($(PLATFORM)-$(LIBARCH), solaris-amd64)
|
||||
# On Solaris AMD64/X64, gobjcopy is not happy and fails:
|
||||
#
|
||||
# usr/sfw/bin/gobjcopy --add-gnu-debuglink=<lib>.debuginfo <lib>.so
|
||||
# BFD: stKPaiop: Not enough room for program headers, try linking with -N
|
||||
# /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
|
||||
# BFD: stKPaiop: Not enough room for program headers, try linking with -N
|
||||
# /usr/sfw/bin/gobjcopy: libsaproc.debuginfo: Bad value
|
||||
# BFD: stKPaiop: Not enough room for program headers, try linking with -N
|
||||
# /usr/sfw/bin/gobjcopy: stKPaiop: Bad value
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: $(DEF_OBJCOPY) is not working on Solaris AMD64/X64")
|
||||
OBJCOPY=
|
||||
else
|
||||
OBJCOPY=$(shell test -x $(DEF_OBJCOPY) && echo $(DEF_OBJCOPY))
|
||||
ifneq ($(ALT_OBJCOPY),)
|
||||
_JUNK_ := $(shell echo >&2 "INFO: ALT_OBJCOPY=$(ALT_OBJCOPY)")
|
||||
# disable .debuginfo support by setting ALT_OBJCOPY to a non-existent path
|
||||
OBJCOPY=$(shell test -x $(ALT_OBJCOPY) && echo $(ALT_OBJCOPY))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef LIBRARY_SUPPORTS_FULL_DEBUG_SYMBOLS
|
||||
# The setting of OBJCOPY above enables the JDK build to import
|
||||
# .debuginfo files from the HotSpot build. However, adding FDS
|
||||
# support to the JDK build will occur in phases so a different
|
||||
# make variable is used to indicate that a particular library
|
||||
# supports FDS.
|
||||
|
||||
ifeq ($(OBJCOPY),)
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: no objcopy cmd found so cannot create .debuginfo files.")
|
||||
else
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: $(OBJCOPY) cmd found so will create .debuginfo files.")
|
||||
|
||||
# Library stripping policies for .debuginfo configs:
|
||||
# all_strip - strips everything from the library
|
||||
# min_strip - strips most stuff from the library; leaves minimum symbols
|
||||
# no_strip - does not strip the library at all
|
||||
#
|
||||
# Oracle security policy requires "all_strip". A waiver was granted on
|
||||
# 2011.09.01 that permits using "min_strip" in the Java JDK and Java JRE.
|
||||
#
|
||||
DEF_STRIP_POLICY="min_strip"
|
||||
ifeq ($(ALT_STRIP_POLICY),)
|
||||
STRIP_POLICY=$(DEF_STRIP_POLICY)
|
||||
else
|
||||
STRIP_POLICY=$(ALT_STRIP_POLICY)
|
||||
endif
|
||||
_JUNK_ := $(shell \
|
||||
echo >&2 "INFO: STRIP_POLICY=$(STRIP_POLICY)")
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Java default optimization (-x04/-O2) etc. Applies to the VM.
|
||||
#
|
||||
ifndef OPTIMIZATION_LEVEL
|
||||
ifeq ($(PRODUCT), java)
|
||||
OPTIMIZATION_LEVEL = HIGHER
|
||||
else
|
||||
OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
endif
|
||||
ifndef FASTDEBUG_OPTIMIZATION_LEVEL
|
||||
FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
|
||||
#
|
||||
# If -Xa is in CFLAGS_COMMON it will end up ahead of $(CC_OPT) for the
|
||||
# optimized build, and that ordering of the flags completely freaks
|
||||
# out cc. Hence, -Xa is instead in each CFLAGS variant.
|
||||
#
|
||||
# The more unusual options to the Sun C compiler:
|
||||
# -v Stricter type checking, more error checking
|
||||
# (To turn ALL warnings into fatals, use -errwarn=%all)
|
||||
# -xstrconst Place string literals and constants in read-only area
|
||||
# (means you can't write on your string literals)
|
||||
# -xs Force debug information (stabs) into the .so or a.out
|
||||
# (makes the library/executable debuggable without the
|
||||
# .o files needing to be around, but at a space cost)
|
||||
# -g & -O If you add the -g option to the optimized compiles
|
||||
# you will get better stack retraces, the code is
|
||||
# still optimized. This includes a space cost too.
|
||||
# -xc99=%none Do NOT allow for c99 extensions to be used.
|
||||
# e.g. declarations must precede statements
|
||||
# -xCC Allow the C++ style of comments in C: //
|
||||
# Required with many of the source files.
|
||||
# -mt Assume multi-threaded (important)
|
||||
#
|
||||
# The more unusual options to the Sun C compiler:
|
||||
# +w Print more warnings
|
||||
# +w2 Maximum warnings
|
||||
#
|
||||
|
||||
#
|
||||
# Debug flag for C and C++ compiler
|
||||
#
|
||||
CFLAGS_DEBUG_OPTION = -g $(CC_OPT/NONE)
|
||||
CXXFLAGS_DEBUG_OPTION = -g $(CXX_OPT/NONE)
|
||||
|
||||
# Turn off -g if we are doing tcov build
|
||||
ifdef TCOV_BUILD
|
||||
CFLAGS_DEBUG_OPTION=
|
||||
CXXFLAGS_DEBUG_OPTION=
|
||||
endif
|
||||
|
||||
# FASTDEBUG: Optimize the -g builds, gives us a faster debug java
|
||||
# If true adds -O to the debug compiles. This allows for any assert
|
||||
# tests to remain and debug checking. The resulting code is faster
|
||||
# but less debuggable. Stack traces are still valid, although only
|
||||
# approximate line numbers are given. Printing of local variables
|
||||
# during a debugging session is not possible, but stepping and
|
||||
# printing of global or static variables should be possible.
|
||||
# Performance/size of files should be about the same, maybe smaller.
|
||||
#
|
||||
ifeq ($(FASTDEBUG), true)
|
||||
CFLAGS_DEBUG_OPTION = -g $(CC_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
CXXFLAGS_DEBUG_OPTION = -g0 $(CXX_OPT/$(FASTDEBUG_OPTIMIZATION_LEVEL))
|
||||
endif
|
||||
|
||||
CFLAGS_COMMON = -L$(OBJDIR)
|
||||
|
||||
# Do not allow C99 language features like declarations in code etc.
|
||||
CFLAGS_COMMON += -xc99=%none
|
||||
|
||||
# Allow C++ comments in C code
|
||||
CFLAGS_COMMON += -xCC
|
||||
|
||||
# Show error message tags on errors
|
||||
CFLAGS_COMMON += -errshort=tags
|
||||
CXXFLAGS_COMMON += -errtags=yes
|
||||
|
||||
# Optimization flags
|
||||
CFLAGS_OPT = $(CC_OPT)
|
||||
|
||||
# Debug version flags
|
||||
CFLAGS_DBG = $(CFLAGS_DEBUG_OPTION)
|
||||
|
||||
# Required C compiler flags
|
||||
CFLAGS_COMMON += -Xa $(CFLAGS_REQUIRED)
|
||||
|
||||
# Maximum warnings all the time
|
||||
CXXFLAGS_COMMON += +w
|
||||
CFLAGS_COMMON += -v
|
||||
|
||||
# Assume MT behavior all the time (important)
|
||||
CXXFLAGS_COMMON += -mt
|
||||
CFLAGS_COMMON += -mt
|
||||
|
||||
# Assume no C++ exceptions are used
|
||||
CXXFLAGS_COMMON += -features=no%except -DCC_NOEX
|
||||
|
||||
# For C++, these options tell it to assume nothing about locating libraries
|
||||
# either at compile time, or at runtime. Use of these options will likely
|
||||
# require the use of -L and -R options to indicate where libraries will
|
||||
# be found at compile time (-L) and at runtime (-R).
|
||||
# The /usr/lib location comes for free, so no need to specify that one.
|
||||
# Note: C is much simplier and there is no need for these options. This
|
||||
# is mostly needed to avoid dependencies on libraries in the
|
||||
# Compiler install area, also see LIBCXX and LIBM.
|
||||
CXXFLAGS_COMMON += -norunpath -xnolib
|
||||
|
||||
#
|
||||
# Treat compiler warnings as errors, if requested
|
||||
#
|
||||
ifeq ($(COMPILER_WARNINGS_FATAL),true)
|
||||
CFLAGS_COMMON += -errwarn=%all
|
||||
CXXFLAGS_COMMON += -errwarn=%all
|
||||
endif
|
||||
|
||||
CXXFLAGS_OPT = $(CXX_OPT)
|
||||
CXXFLAGS_DBG = $(CXXFLAGS_DEBUG_OPTION)
|
||||
CXXFLAGS_COMMON += $(CFLAGS_REQUIRED)
|
||||
|
||||
# Add -xstrconst to the library compiles. This forces all string
|
||||
# literals into the read-only data section, which prevents them from
|
||||
# being written to and increases the runtime pages shared on the system.
|
||||
#
|
||||
ifdef LIBRARY
|
||||
CFLAGS_COMMON +=-xstrconst
|
||||
endif
|
||||
|
||||
# Source browser database
|
||||
#
|
||||
# COMPILE_WITH_SB
|
||||
# If defined adds -xsb to compiles and creates a
|
||||
# source browsing database during compilation.
|
||||
#
|
||||
ifdef COMPILE_WITH_SB
|
||||
ifeq ($(LIBRARY), java)
|
||||
CFLAGS_DBG += -xsb
|
||||
endif
|
||||
endif
|
||||
|
||||
# Lint Flags:
|
||||
# -Xa ANSI C plus K&R, favor ANSI rules
|
||||
# -fd report on old style func defs
|
||||
# -errchk=structarg report on 64bit struct args by value
|
||||
# -errchk=longptr64 report on 64bit to 32bit issues (ignores casts)
|
||||
# -errchk=parentheses report on suggested use of extra parens
|
||||
# -v suppress unused args
|
||||
# -x suppress unused externs
|
||||
# -u suppress extern func/vars used/defined
|
||||
# -errfmt=simple use one line errors with position info
|
||||
# $(LINT_XARCH_OPTION) See Compiler-sun.gwk
|
||||
|
||||
LINTFLAGS_COMMON = -Xa
|
||||
LINTFLAGS_COMMON += -fd
|
||||
LINTFLAGS_COMMON += -errchk=structarg,longptr64,parentheses
|
||||
LINTFLAGS_COMMON += -v
|
||||
LINTFLAGS_COMMON += -x
|
||||
LINTFLAGS_COMMON += -u
|
||||
LINTFLAGS_COMMON += -errfmt=simple
|
||||
LINTFLAGS_OPT =
|
||||
LINTFLAGS_DBG =
|
||||
|
||||
# The -W0,-noglobal tells the compiler to NOT generate mangled global
|
||||
# ELF data symbols for file local static data.
|
||||
# This can break fix&continue, but we'd rather do the same compilations
|
||||
# for deliverable bits as we do for non-deliverable bits
|
||||
# Tell the compilers to never generate globalized names, all the time.
|
||||
CFLAGS_COMMON += -W0,-noglobal
|
||||
|
||||
# If we have a specific arch value to use, add it
|
||||
CFLAGS_COMMON += $(XARCH_OPTION)
|
||||
CXXFLAGS_COMMON += $(XARCH_OPTION)
|
||||
ASFLAGS_COMMON += $(AS_XARCH_OPTION)
|
||||
EXTRA_LIBS += $(XARCH_OPTION)
|
||||
LINTFLAGS_COMMON += $(LINT_XARCH_OPTION)
|
||||
|
||||
#
|
||||
# uncomment the following to build with PERTURBALOT set
|
||||
#
|
||||
# OTHER_CFLAGS += -DPERTURBALOT
|
||||
#
|
||||
|
||||
CPPFLAGS_COMMON = -D__solaris__ -D$(ARCH_FAMILY)
|
||||
CPPFLAGS_OPT = -DNDEBUG
|
||||
CPPFLAGS_DBG = -DDEBUG
|
||||
|
||||
ifneq ($(PRODUCT), java)
|
||||
CPPFLAGS_DBG += -DLOGGING -DDBINFO
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH_FAMILY), i586)
|
||||
# The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
|
||||
# Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
|
||||
# (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
|
||||
# Note: -Dmacro is the same as #define macro 1
|
||||
# -Dmacro= is the same as #define macro
|
||||
#
|
||||
CPPFLAGS_COMMON += -DcpuIntel -D_LITTLE_ENDIAN= -D$(LIBARCH)
|
||||
# Turn off a superfluous compiler error message on Intel
|
||||
CFLAGS_COMMON += -erroff=E_BAD_PRAGMA_PACK_VALUE
|
||||
endif
|
||||
|
||||
# Java memory management is based on memory mapping by default, but a
|
||||
# system only assuming malloc/free can be built by adding -DUSE_MALLOC
|
||||
|
||||
CPPFLAGS_COMMON += -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS
|
||||
CPPFLAGS_OPT += -DTRIMMED
|
||||
|
||||
LDFLAGS_DEFS_OPTION = -z defs
|
||||
LDFLAGS_COMMON += $(LDFLAGS_DEFS_OPTION)
|
||||
|
||||
#
|
||||
# -L paths for finding and -ljava
|
||||
#
|
||||
LDFLAGS_COMMON += -L$(LIBDIR)/$(LIBARCH)
|
||||
LDFLAGS_OPT =
|
||||
LDFLAGS_DBG =
|
||||
|
||||
#
|
||||
# We never really want the incremental linker, ever
|
||||
# The -xildoff option tells Sun's compilers to NOT use incremental linker
|
||||
#
|
||||
LDFLAGS_COMMON += -xildoff
|
||||
|
||||
ifdef LIBRARY
|
||||
# Libraries need to locate other libraries at runtime, and you can tell
|
||||
# a library where to look by way of the dynamic runpaths (RPATH or RUNPATH)
|
||||
# buried inside the .so. The $ORIGIN says to look relative to where
|
||||
# the library itself is and it can be followed with relative paths from
|
||||
# that. By default we always look in $ORIGIN, optionally we add relative
|
||||
# paths if the Makefile sets LD_RUNPATH_EXTRAS to those relative paths.
|
||||
# The environment variable LD_LIBRARY_PATH will over-ride these runpaths.
|
||||
# Try: 'dump -Lv lib*.so' to see these settings in a library.
|
||||
#
|
||||
LDFLAGS_COMMON += -R\$$ORIGIN
|
||||
LDFLAGS_COMMON += $(LD_RUNPATH_EXTRAS:%=-R\$$ORIGIN/%)
|
||||
endif
|
||||
|
||||
EXTRA_LIBS += -lc
|
||||
|
||||
# Postprocessing is done on the images directories only
|
||||
#
|
||||
ifeq ($(VARIANT), OPT)
|
||||
ifeq ($(PARTIAL_GPROF), true)
|
||||
NO_STRIP = true
|
||||
endif
|
||||
ifeq ($(GPROF), true)
|
||||
NO_STRIP = true
|
||||
endif
|
||||
ifneq ($(NO_STRIP), true)
|
||||
# Debug 'strip -x' leaves local function Elf symbols (better stack traces)
|
||||
POST_STRIP_PROCESS = $(STRIP) -x
|
||||
endif
|
||||
endif
|
||||
POST_MCS_PROCESS=$(MCS) -d -a "JDK $(FULL_VERSION)"
|
||||
|
||||
#
|
||||
# Sun C compiler will take -M and pass it on to ld.
|
||||
# Usage: ld $(LD_MAPFILE_FLAG) mapfile *.o
|
||||
#
|
||||
ifeq ($(CC_VERSION),gcc)
|
||||
LD_MAPFILE_FLAG = -Xlinker -M -Xlinker
|
||||
else
|
||||
LD_MAPFILE_FLAG = -M
|
||||
endif
|
||||
|
||||
#
|
||||
# Variables globally settable from the make command line (default
|
||||
# values in brackets):
|
||||
# GPROF (false)
|
||||
# Eg: % gnumake GPROF=true
|
||||
GPROF = false
|
||||
ifeq ($(GPROF), true)
|
||||
CFLAGS_COMMON += -DGPROF -xpg
|
||||
EXTRA_LIBS += -xpg
|
||||
endif
|
||||
|
||||
# PARTIAL_GPROF is to be used ONLY during compilation - it should not
|
||||
# appear during linking of libraries or programs. It also should
|
||||
# prevent linking with -z defs to allow a symbol to remain undefined.
|
||||
#
|
||||
PARTIAL_GPROF = false
|
||||
ifeq ($(PARTIAL_GPROF), true)
|
||||
CFLAGS_GPROF += -xpg
|
||||
LDFLAGS_DEFS_OPTION = -z nodefs
|
||||
endif
|
||||
|
||||
#
|
||||
# For a TCOV build we add in the TCOV_OPTION
|
||||
#
|
||||
ifdef TCOV_BUILD
|
||||
TCOV_OPTION = -xprofile=tcov
|
||||
LDFLAGS_COMMON += $(TCOV_OPTION) -Kpic
|
||||
CFLAGS_COMMON += $(TCOV_OPTION)
|
||||
CXXFLAGS_COMMON += $(TCOV_OPTION)
|
||||
EXTRA_LIBS += $(TCOV_OPTION)
|
||||
LDNOMAP=true
|
||||
endif
|
||||
|
||||
#
|
||||
# Solaris only uses native threads.
|
||||
#
|
||||
THREADS_FLAG= native
|
||||
THREADS_DIR= threads
|
||||
|
||||
#
|
||||
# Support for Quantify.
|
||||
#
|
||||
ifdef QUANTIFY
|
||||
QUANTIFY_CMD = quantify
|
||||
QUANTIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
|
||||
LINK_PRE_CMD = $(QUANTIFY_CMD) $(QUANTIFY_OPTIONS)
|
||||
ifdef LIBRARY
|
||||
CFLAGS_COMMON += -K PIC
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Support for Purify.
|
||||
#
|
||||
ifdef PURIFY
|
||||
PURIFY_CMD = /net/suntools.eng/export/tools/sparc/bin/purify
|
||||
PURIFY_OPTIONS = -cache-dir=/tmp/quantify -always-use-cache-dir=yes
|
||||
LINK_PRE_CMD = $(PURIFY_CMD) $(PURIFY_OPTIONS)
|
||||
ifdef LIBRARY
|
||||
CFLAGS_COMMON += -K PIC
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Different "levels" of optimization.
|
||||
#
|
||||
ifeq ($(CC_VERSION),gcc)
|
||||
|
||||
CC_OPT/NONE =
|
||||
CC_OPT/LOWER = -O2
|
||||
CC_OPT/HIGHER = -O3
|
||||
CC_OPT/HIGHEST = -O3
|
||||
|
||||
CXX_OPT/NONE =
|
||||
CXX_OPT/LOWER = -O2
|
||||
CXX_OPT/HIGHER = -O3
|
||||
CXX_OPT/HIGHEST = -O3
|
||||
|
||||
CFLAGS_REQUIRED_i586 += -fno-omit-frame-pointer
|
||||
CFLAGS_REQUIRED_amd64 += -fno-omit-frame-pointer
|
||||
|
||||
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|
||||
# (See Rules.gmk) May need to wait for gcc 5?
|
||||
AUTOMATIC_PCH_OPTION =
|
||||
|
||||
else
|
||||
|
||||
# Highest could be -xO5, but indications are that -xO5 should be reserved
|
||||
# for a per-file use, on sources with known performance impacts.
|
||||
OPT_LEVEL/LOWER = 2
|
||||
OPT_LEVEL/HIGHER = 4
|
||||
OPT_LEVEL/HIGHEST = 4
|
||||
|
||||
CC_OPT/NONE =
|
||||
CC_OPT/LOWER = $(OPT_LEVEL/LOWER:%=-xO%)
|
||||
CC_OPT/HIGHER = $(OPT_LEVEL/HIGHER:%=-xO%)
|
||||
CC_OPT/HIGHEST = $(OPT_LEVEL/HIGHEST:%=-xO%)
|
||||
|
||||
CXX_OPT/NONE =
|
||||
CXX_OPT/LOWER = $(OPT_LEVEL/LOWER:%=-xO%)
|
||||
CXX_OPT/HIGHER = $(OPT_LEVEL/HIGHER:%=-xO%)
|
||||
CXX_OPT/HIGHEST = $(OPT_LEVEL/HIGHEST:%=-xO%)
|
||||
|
||||
# We need stack frames at all times
|
||||
USE_XKEEPFRAME_OPTION = false
|
||||
ifeq ($(USE_XKEEPFRAME_OPTION),true)
|
||||
|
||||
# Unknown spelling on this option at this time (Maybe in SS13?)
|
||||
CC_XKEEPFRAME_OPTIONS = -xkeepframe
|
||||
CXX_XKEEPFRAME_OPTIONS = -xkeepframe
|
||||
|
||||
else
|
||||
|
||||
# On X86, make sure tail call optimization is off
|
||||
# The z and y are the tail call optimizations.
|
||||
ifeq ($(ARCH_FAMILY), i586)
|
||||
CC_NEWER_THAN_58 := \
|
||||
$(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \
|
||||
\( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 8 \) )
|
||||
ifeq ($(CC_NEWER_THAN_58),1)
|
||||
# Somehow, tail call optimization is creeping in.
|
||||
# Make sure it is off.
|
||||
# WARNING: These may cause compiler warnings about duplicate -O options
|
||||
CC_XKEEPFRAME_OPTIONS += -Wu,-O$(OPT_LEVEL/$(OPTIMIZATION_LEVEL))~yz
|
||||
CXX_XKEEPFRAME_OPTIONS += -Qoption ube -O$(OPT_LEVEL/$(OPTIMIZATION_LEVEL))~yz
|
||||
endif
|
||||
endif
|
||||
|
||||
# On i586 we need to tell the code generator to ALWAYS use a
|
||||
# frame pointer.
|
||||
ifeq ($(ARCH_FAMILY), i586)
|
||||
# Note that in 5.7, this is done with -xregs=no%frameptr
|
||||
ifeq ($(CC_VER), 5.5)
|
||||
# It's not exactly clear when this optimization kicks in, the
|
||||
# current assumption is -xO4 or greater and for C++ with
|
||||
# the -features=no%except option and -xO4 and greater.
|
||||
# Bottom line is, we ALWAYS want a frame pointer!
|
||||
CC_XKEEPFRAME_OPTIONS += -Wu,-Z~B
|
||||
CXX_XKEEPFRAME_OPTIONS += -Qoption ube -Z~B
|
||||
endif
|
||||
|
||||
CC_NEWER_THAN_56 := \
|
||||
$(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \
|
||||
\( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 6 \) )
|
||||
ifeq ($(CC_NEWER_THAN_56),1)
|
||||
# Do NOT use frame pointer register as a general purpose opt register
|
||||
CC_OPT/NONE += -xregs=no%frameptr
|
||||
CXX_OPT/NONE += -xregs=no%frameptr
|
||||
CC_XKEEPFRAME_OPTIONS += -xregs=no%frameptr
|
||||
CXX_XKEEPFRAME_OPTIONS += -xregs=no%frameptr
|
||||
endif
|
||||
endif
|
||||
|
||||
# Optimizer for sparc needs to be told not to do certain things
|
||||
# related to frames or save instructions.
|
||||
ifeq ($(ARCH_FAMILY), sparc)
|
||||
# Do not use save instructions instead of add instructions
|
||||
# This was an optimization starting in SC5.0 that made it hard for us to
|
||||
# find the "save" instruction (which got turned into an "add")
|
||||
CC_XKEEPFRAME_OPTIONS += -Wc,-Qrm-s
|
||||
CXX_XKEEPFRAME_OPTIONS += -Qoption cg -Qrm-s
|
||||
# Don't allow tail call code optimization. Started in SC5.0.
|
||||
# We don't like code of this form:
|
||||
# save
|
||||
# <code>
|
||||
# call foo
|
||||
# restore
|
||||
# because we can't tell if the method will have a stack frame
|
||||
# and register windows or not.
|
||||
CC_XKEEPFRAME_OPTIONS += -Wc,-Qiselect-T0
|
||||
CXX_XKEEPFRAME_OPTIONS += -Qoption cg -Qiselect-T0
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
# Extra options used with HIGHEST
|
||||
#
|
||||
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
|
||||
# done with care, there are some assumptions below that need to
|
||||
# be understood about the use of pointers, and IEEE behavior.
|
||||
#
|
||||
# Use non-standard floating point mode (not IEEE 754)
|
||||
CC_HIGHEST_EXTRAS += -fns
|
||||
# Do some simplification of floating point arithmetic (not IEEE 754)
|
||||
CC_HIGHEST_EXTRAS += -fsimple
|
||||
# Use single precision floating point with 'float'
|
||||
CC_HIGHEST_EXTRAS += -fsingle
|
||||
# Assume memory references via basic pointer types do not alias
|
||||
# (Source with excessing pointer casting and data access with mixed
|
||||
# pointer types are not recommended)
|
||||
CC_HIGHEST_EXTRAS += -xalias_level=basic
|
||||
# Use intrinsic or inline versions for math/std functions
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
CC_HIGHEST_EXTRAS += -xbuiltin=%all
|
||||
# Loop data dependency optimizations (need -xO3 or higher)
|
||||
CC_HIGHEST_EXTRAS += -xdepend
|
||||
# Pointer parameters to functions do not overlap
|
||||
# (Similar to -xalias_level=basic usage, but less obvious sometimes.
|
||||
# If you pass in multiple pointers to the same data, do not use this)
|
||||
CC_HIGHEST_EXTRAS += -xrestrict
|
||||
# Inline some library routines
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
CC_HIGHEST_EXTRAS += -xlibmil
|
||||
# Use optimized math routines
|
||||
# (If you expect perfect errno behavior, do not use this)
|
||||
# Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
|
||||
# CC_HIGHEST_EXTRAS += -xlibmopt
|
||||
ifeq ($(ARCH_FAMILY), sparc)
|
||||
# Assume at most 8byte alignment, raise SIGBUS on error
|
||||
### Presents an ABI issue with customer JNI libs?
|
||||
####CC_HIGHEST_EXTRAS += -xmemalign=8s
|
||||
# Automatic prefetch instructions, explicit prefetch macros
|
||||
CC_HIGHEST_EXTRAS += -xprefetch=auto,explicit
|
||||
# Pick ultra as the chip to optimize to
|
||||
CC_HIGHEST_EXTRAS += -xchip=ultra
|
||||
endif
|
||||
ifeq ($(ARCH), i586)
|
||||
# Pick pentium as the chip to optimize to
|
||||
CC_HIGHEST_EXTRAS += -xchip=pentium
|
||||
endif
|
||||
ifdef LIBRARY
|
||||
# The Solaris CBE (Common Build Environment) requires that the use
|
||||
# of appl registers be disabled when compiling a public library (or
|
||||
# a library that's loaded by a public library) on sparc.
|
||||
CFLAGS_REQUIRED_sparc += -xregs=no%appl
|
||||
CFLAGS_REQUIRED_sparcv9 += -xregs=no%appl
|
||||
endif
|
||||
CC_NEWER_THAN_56 := \
|
||||
$(shell $(EXPR) $(CC_MAJORVER) \> 5 \| \
|
||||
\( $(CC_MAJORVER) = 5 \& $(CC_MINORVER) \> 6 \) )
|
||||
ifeq ($(CC_NEWER_THAN_56),1)
|
||||
# Presents an ABI issue with customer JNI libs? We must be able to
|
||||
# to handle 4byte aligned objects? (rare occurance, but possible?)
|
||||
CFLAGS_REQUIRED_sparc += -xmemalign=4s
|
||||
endif
|
||||
# Just incase someone trys to use the SOS9 compilers
|
||||
ifeq ($(CC_VER), 5.6)
|
||||
# We MUST allow data alignment of 4 for sparc (sparcv9 is ok at 8s)
|
||||
CFLAGS_REQUIRED_sparc += -xmemalign=4s
|
||||
endif
|
||||
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|
||||
# (See Rules.gmk) The SS11 -xpch=auto* options appear to be broken.
|
||||
AUTOMATIC_PCH_OPTION =
|
||||
|
||||
# Add in keep frame options
|
||||
CC_OPT/LOWER += $(CC_XKEEPFRAME_OPTIONS)
|
||||
CC_OPT/HIGHER += $(CC_XKEEPFRAME_OPTIONS)
|
||||
CC_OPT/HIGHEST += $(CC_XKEEPFRAME_OPTIONS)
|
||||
CXX_OPT/LOWER += $(CXX_XKEEPFRAME_OPTIONS)
|
||||
CXX_OPT/HIGHER += $(CXX_XKEEPFRAME_OPTIONS)
|
||||
CXX_OPT/HIGHEST += $(CXX_XKEEPFRAME_OPTIONS)
|
||||
|
||||
# Add in highest optimization settings
|
||||
CC_OPT/HIGHEST += $(CC_HIGHEST_EXTRAS)
|
||||
CXX_OPT/HIGHEST += $(CC_HIGHEST_EXTRAS)
|
||||
|
||||
endif
|
||||
|
||||
# Default optimization settings based on level.
|
||||
CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
|
||||
CXX_OPT = $(CXX_OPT/$(OPTIMIZATION_LEVEL))
|
||||
|
||||
# Flags required all the time
|
||||
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
|
||||
|
||||
#
|
||||
# Path and option to link against the VM, if you have to. Note that
|
||||
# there are libraries that link against only -ljava, but they do get
|
||||
# -L to the -ljvm, this is because -ljava depends on -ljvm, whereas
|
||||
# the library itself should not.
|
||||
#
|
||||
VM_NAME = server
|
||||
JVMLIB = -L$(LIBDIR)/$(LIBARCH)/server -L$(LIBDIR)/$(LIBARCH)/client -ljvm
|
||||
JAVALIB = -ljava $(JVMLIB)
|
||||
|
||||
# Part of INCREMENTAL_BUILD mechanism.
|
||||
# Compiler emits things like: path/file.o: file.h
|
||||
# We want something like: relative_path/file.o relative_path/file.d: file.h
|
||||
# In addition on Solaris, any include file starting with / is deleted,
|
||||
# this gets rid of things like /usr/include files, which never change.
|
||||
CC_DEPEND = -xM1
|
||||
CC_DEPEND_FILTER = $(SED) -e '/:[ ]*[/]/d' -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)& $(dir $@)$*.$(DEPEND_SUFFIX)!g' | $(SORT) -u
|
||||
|
||||
# Location of openwin libraries (do we really need this anymore?)
|
||||
OPENWIN_HOME = /usr/openwin
|
||||
OPENWIN_LIB = $(OPENWIN_HOME)/lib$(ISA_DIR)
|
||||
|
||||
# Runtime graphics library search paths...
|
||||
OPENWIN_RUNTIME_LIB = /usr/openwin/lib$(ISA_DIR)
|
||||
AWT_RUNPATH = -R/usr/dt/lib$(ISA_DIR) -R$(OPENWIN_RUNTIME_LIB)
|
||||
|
||||
# C++ Runtime library (libCrun.so), use instead of -lCrun.
|
||||
# Originally used instead of -lCrun to guarantee use of the system
|
||||
# .so version and not the .a or .so that came with the compilers.
|
||||
# With the newer compilers this could probably change back to -lCrun but
|
||||
# in general this is ok to continue to do.
|
||||
LIBCXX = /usr/lib$(ISA_DIR)/libCrun.so.1
|
||||
|
||||
# JDK now requires Solaris 10, so pick up libm.so.2
|
||||
LIBM = /usr/lib$(ISA_DIR)/libm.so.2
|
||||
|
||||
# Socket library
|
||||
LIBSOCKET = -lsocket
|
||||
|
||||
# Network Services library
|
||||
LIBNSL = -lnsl
|
||||
|
||||
# service configuration facility library
|
||||
LIBSCF = -lscf
|
||||
|
||||
# Dynamic Loading library
|
||||
LIBDL = -ldl
|
||||
|
||||
# GLOBAL_KPIC: If set means all libraries are PIC, position independent code
|
||||
# EXCEPT for select compiles
|
||||
# If a .o file is compiled non-PIC then it should be forced
|
||||
# into the RW data segment with a mapfile option. This is done
|
||||
# with object files which generated from .s files.
|
||||
# The -ztext enforces that no relocations remain in the text segment
|
||||
# so that it remains purely read-only for optimum system performance.
|
||||
# Some libraries may use a smaller size (13bit -Kpic) on sparc instead of
|
||||
# (32 bit -KPIC) and will override GLOBAL_KPIC appropriately.
|
||||
#
|
||||
PIC_CODE_LARGE = -KPIC
|
||||
PIC_CODE_SMALL = -Kpic
|
||||
ifndef TCOV_BUILD
|
||||
GLOBAL_KPIC = $(PIC_CODE_LARGE)
|
||||
CXXFLAGS_COMMON += $(GLOBAL_KPIC)
|
||||
CFLAGS_COMMON += $(GLOBAL_KPIC)
|
||||
LDFLAGS_COMMON += -ztext
|
||||
endif # TCOV_BUILD
|
||||
|
||||
# If your platform has DPS, it will have Type1 fonts too, in which case
|
||||
# it is best to enable DPS support until such time as 2D's rasteriser
|
||||
# can fully handle Type1 fonts in all cases. Default is "yes".
|
||||
# HAVE_DPS should only be "no" if the platform has no DPS headers or libs
|
||||
# DPS (Displayable PostScript) is available on Solaris machines
|
||||
|
||||
HAVE_DPS = yes
|
||||
|
||||
#
|
||||
# Japanese manpages
|
||||
#
|
||||
JA_SOURCE_ENCODING = eucJP
|
||||
JA_TARGET_ENCODINGS = eucJP UTF-8 PCK
|
||||
|
||||
# Settings for the JDI - Serviceability Agent binding.
|
||||
HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/lib/$(LIBARCH)
|
||||
SALIB_NAME = $(LIB_PREFIX)saproc.$(LIBRARY_SUFFIX)
|
||||
SA_DEBUGINFO_NAME = $(LIB_PREFIX)saproc.debuginfo
|
||||
INCLUDE_SA=true
|
||||
|
@ -1,418 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1999, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile to specify compiler flags for programs and libraries
|
||||
# targeted to Windows builds. Should not contain any rules.
|
||||
#
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
# Get shared JDK settings
|
||||
include $(JDK_MAKE_SHARED_DIR)/Defs.gmk
|
||||
|
||||
# CC compiler object code output directive flag value
|
||||
CC_OBJECT_OUTPUT_FLAG = -Fo
|
||||
|
||||
# The suffix applied to the library name for FDLIBM
|
||||
FDDLIBM_SUFFIX = lib
|
||||
# The suffix applied to scripts (.bat for windows, nothing for unix)
|
||||
SCRIPT_SUFFIX = .bat
|
||||
|
||||
# LIB_LOCATION, which for windows identifies where .exe files go, may be
|
||||
# set by each GNUmakefile. The default is BINDIR.
|
||||
ifndef LIB_LOCATION
|
||||
LIB_LOCATION = $(BINDIR)
|
||||
endif # LIB_LOCATION
|
||||
|
||||
ifndef PLATFORM_SRC
|
||||
PLATFORM_SRC = $(BUILDDIR)/../src/windows
|
||||
endif # PLATFORM_SRC
|
||||
|
||||
# Platform specific closed sources
|
||||
ifndef OPENJDK
|
||||
ifndef CLOSED_PLATFORM_SRC
|
||||
CLOSED_PLATFORM_SRC = $(BUILDDIR)/../src/closed/windows
|
||||
endif
|
||||
endif
|
||||
|
||||
# for backwards compatability, the old "win32" is used here instead of
|
||||
# the more proper "windows"
|
||||
PLATFORM_INCLUDE_NAME = win32
|
||||
PLATFORM_INCLUDE = $(INCLUDEDIR)/$(PLATFORM_INCLUDE_NAME)
|
||||
|
||||
# The following DLL's are considered MS runtime libraries and should
|
||||
# not to be REBASEd, see deploy/make/common/Release.gmk.
|
||||
# msvcr*.dll: Microsoft runtimes
|
||||
ifeq ($(COMPILER_VERSION), VS2010)
|
||||
MSVCRNN_DLL = msvcr100.dll
|
||||
MSVCPNN_DLL = msvcp100.dll
|
||||
endif
|
||||
|
||||
EXTRA_LFLAGS += /LIBPATH:$(DXSDK_LIB_PATH)
|
||||
|
||||
# C Compiler flag definitions
|
||||
|
||||
#
|
||||
# Default optimization
|
||||
#
|
||||
|
||||
ifndef OPTIMIZATION_LEVEL
|
||||
ifeq ($(PRODUCT), java)
|
||||
OPTIMIZATION_LEVEL = HIGHER
|
||||
else
|
||||
OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
endif
|
||||
ifndef FASTDEBUG_OPTIMIZATION_LEVEL
|
||||
FASTDEBUG_OPTIMIZATION_LEVEL = LOWER
|
||||
endif
|
||||
|
||||
ifeq ($(CC_VERSION),msvc)
|
||||
# Visual Studio compiler option definitions:
|
||||
# -O1 Favors reduced size over speed (-Og -Os -Oy -Ob2 -Gs -GF -Gy)
|
||||
# -O2 Favors speed over reduced size (-Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy)
|
||||
# -Ob2 More aggressive inlining
|
||||
# -Og Global optimizations
|
||||
# -Oi Replace some functions with intrinsic or special forms
|
||||
# -fp:precise (should be the default)
|
||||
# Improve floating point calculations (disables some optimizations)
|
||||
# -Os Favor small code
|
||||
# -Ot Favor faster code
|
||||
# -Oy Frame pointer omission
|
||||
# -G6 Used to be -GB?
|
||||
# -GF Pool strings in read-only memory
|
||||
# -Gf Pool strings in read-write memory (the default)
|
||||
# -Gs Controls stack probess
|
||||
# -GS Adds buffer overflow checks on stacks (the default)
|
||||
# -EHsc Enables exception handling
|
||||
# -Gy Function level linking only
|
||||
#
|
||||
|
||||
CC_OPT/NONE = -Od
|
||||
CC_OPT/LOWER = -O2
|
||||
CC_OPT/HIGHER = -O3
|
||||
CC_OPT/HIGHEST = -O3
|
||||
|
||||
ifeq ($(COMPILER_VERSION), VS2010)
|
||||
# Automatic precompiled header option to use (if COMPILE_APPROACH=batch)
|
||||
AUTOMATIC_PCH_OPTION =
|
||||
GX_OPTION = -EHsc
|
||||
GZ_OPTION = -RTC1
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
CC_OPT/HIGHEST = -O2
|
||||
CC_OPT/HIGHER = -O1
|
||||
CC_OPT/LOWER = -O1
|
||||
else
|
||||
CC_OPT/HIGHEST = -O2
|
||||
CC_OPT/HIGHER = -O1
|
||||
CC_OPT/LOWER = -O1
|
||||
endif
|
||||
endif
|
||||
|
||||
else # CC_VERSION
|
||||
# GCC not supported, but left for historical reference...
|
||||
CC_OPT/NONE =
|
||||
CC_OPT/LOWER = -O2
|
||||
CC_OPT/HIGHER = -O2
|
||||
CC_OPT/HIGHEST = -O3
|
||||
|
||||
endif
|
||||
|
||||
CC_OPT = $(CC_OPT/$(OPTIMIZATION_LEVEL))
|
||||
|
||||
# Select the runtime support library carefully, need to be consistent
|
||||
#
|
||||
# Visual Studio Runtime compiler option definitions:
|
||||
# -MD Use dynamic multi-threaded runtime library
|
||||
# -MDd Use debug version (don't use, doesn't mix with -MD DLL's)
|
||||
# -MT Use static multi-threaded runtime library (-ML is going away)
|
||||
# -MTd Use static debug version (better than -MDd, no runtime issues)
|
||||
# -D_DEBUG Change use of malloc/free/etc to use special debug ones (-MTd)
|
||||
#
|
||||
# NOTE: We also will use /D _STATIC_CPPLIB so we don't need msvcpnn.dll
|
||||
#
|
||||
# If MS_RUNTIME_STATIC is requested we may have a problem, it is no longer
|
||||
# supported by VS2010
|
||||
ifneq ($(MS_RUNTIME_STATIC),true)
|
||||
MS_RUNTIME_OPTION=-MD
|
||||
endif
|
||||
# The _DEBUG macro option (changes things like malloc to use debug version)
|
||||
MS_RUNTIME_DEBUG_OPTION=
|
||||
MS_RC_DEBUG_OPTION=
|
||||
# Externally set environment variable can force any build to use the debug vers
|
||||
ifeq ($(MFC_DEBUG), true)
|
||||
ifeq ($(MS_RUNTIME_STATIC),true)
|
||||
MS_RUNTIME_OPTION=-MTd
|
||||
else
|
||||
# This MS debugging flag forces a dependence on the debug
|
||||
# version of the runtime library (MSVCR*D.DLL), as does -MDd.
|
||||
# We cannot re-distribute this debug runtime.
|
||||
MS_RUNTIME_OPTION=-MDd
|
||||
endif
|
||||
MS_RUNTIME_DEBUG_OPTION= -D_DEBUG
|
||||
MS_RC_DEBUG_OPTION= -d _DEBUG
|
||||
endif
|
||||
|
||||
# Always add _STATIC_CPPLIB definition
|
||||
STATIC_CPPLIB_OPTION = /D _STATIC_CPPLIB
|
||||
|
||||
# Silence the warning about using _STATIC_CPPLIB
|
||||
ifneq ($(SHOW_ALL_WARNINGS),true)
|
||||
# Needed with VS2010 to turn off the deprecated warning.
|
||||
STATIC_CPPLIB_OPTION += /D _DISABLE_DEPRECATE_STATIC_CPPLIB
|
||||
endif
|
||||
|
||||
MS_RUNTIME_OPTION += $(STATIC_CPPLIB_OPTION)
|
||||
|
||||
ifeq ($(CC_VERSION),msvc)
|
||||
# Visual Studio compiler option definitions:
|
||||
# -Zi Cause *.pdb file to be created, full debug information
|
||||
# -Z7 Full debug inside the .obj, no .pdb
|
||||
# -Zd Basic debug, no local variables? In the .obj
|
||||
# -Zl Don't add runtime library name to obj file?
|
||||
# -Od Turns off optimization and speeds compilation
|
||||
# -YX -Fp/.../foobar.pch Use precompiled headers (try someday?)
|
||||
# -nologo Don't print out startup message
|
||||
# /D _STATIC_CPPLIB
|
||||
# Use static link for the C++ runtime (so msvcpnn.dll not needed)
|
||||
#
|
||||
CFLAGS_COMMON += -Zi -nologo
|
||||
CFLAGS_OPT = $(CC_OPT)
|
||||
CFLAGS_DBG = -Od $(MS_RUNTIME_DEBUG_OPTION)
|
||||
|
||||
CFLAGS_VS2010 += -Zc:wchar_t-
|
||||
|
||||
# All builds get the same runtime setting
|
||||
CFLAGS_COMMON += $(MS_RUNTIME_OPTION) $(CFLAGS_$(COMPILER_VERSION))
|
||||
|
||||
LDEBUG = /debug
|
||||
|
||||
ifeq ($(VTUNE_SUPPORT), true)
|
||||
OTHER_CFLAGS = -Z7 -Ox
|
||||
LDEBUG += /pdb:NONE
|
||||
endif
|
||||
|
||||
# VS2010, always need safe exception handlers, not needed on 64bit
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
LFLAGS_VS2010 += -SAFESEH
|
||||
endif
|
||||
|
||||
# LFLAGS are the flags given to $(LINK) and used to build the actual DLL file
|
||||
BASELFLAGS = -nologo /opt:REF /incremental:no
|
||||
|
||||
LFLAGS = $(BASELFLAGS) $(LDEBUG) $(EXTRA_LFLAGS) $(LFLAGS_$(COMPILER_VERSION))
|
||||
LDDFLAGS += $(LFLAGS_$(COMPILER_VERSION))
|
||||
|
||||
endif
|
||||
|
||||
#
|
||||
# Preprocessor macro definitions
|
||||
#
|
||||
CPPFLAGS_COMMON = -DWIN32 -DIAL -D_LITTLE_ENDIAN
|
||||
ifeq ($(ARCH), amd64)
|
||||
CPPFLAGS_COMMON += -D_AMD64_ -Damd64
|
||||
else
|
||||
CPPFLAGS_COMMON += -D_X86_ -Dx86
|
||||
endif
|
||||
CPPFLAGS_COMMON += -DWIN32_LEAN_AND_MEAN
|
||||
|
||||
#
|
||||
# Output options (use specific filenames to avoid parallel compile errors)
|
||||
#
|
||||
CFLAGS_COMMON += -Fd$(OBJDIR)/$(basename $(@F)).pdb -Fm$(OBJDIR)/$(basename $(@F)).map
|
||||
|
||||
#
|
||||
# Use -wdNNNN to disable warning NNNN.
|
||||
# C4800 is a warning about bool performance casts (can't make go away)
|
||||
#
|
||||
COMPILER_WARNINGS_TO_IGNORE = 4800
|
||||
CFLAGS_COMMON += $(COMPILER_WARNINGS_TO_IGNORE:%=-wd%)
|
||||
|
||||
#
|
||||
# Treat compiler warnings as errors, if requested
|
||||
#
|
||||
CFLAGS_COMMON += -W$(COMPILER_WARNING_LEVEL)
|
||||
ifeq ($(COMPILER_WARNINGS_FATAL),true)
|
||||
CFLAGS_COMMON += -WX
|
||||
endif
|
||||
|
||||
# Turn off some warnings by default, enable them all if asked.
|
||||
ifneq ($(SHOW_ALL_WARNINGS),true)
|
||||
# The -D _CRT_SECURE_NO_DEPRECATE turns off security/deprecated warnings on
|
||||
# the standard C library functions like strcpy.
|
||||
CFLAGS_COMMON += -D _CRT_SECURE_NO_DEPRECATE
|
||||
# The -D _CRT_NONSTDC_NO_DEPRECATE turns off deprecation warnings about using
|
||||
# non-standard C POSIX functions.
|
||||
CFLAGS_COMMON += -D _CRT_NONSTDC_NO_DEPRECATE
|
||||
endif
|
||||
|
||||
CPPFLAGS_OPT = -DNDEBUG
|
||||
CPPFLAGS_DBG = -DDEBUG -DLOGGING
|
||||
|
||||
CXXFLAGS_COMMON = $(CFLAGS_COMMON)
|
||||
CXXFLAGS_OPT = $(CFLAGS_OPT)
|
||||
CXXFLAGS_DBG = $(CFLAGS_DBG)
|
||||
|
||||
ifneq ($(LIBRARY),fdlibm)
|
||||
EXTRA_LIBS += advapi32.lib
|
||||
endif
|
||||
|
||||
#
|
||||
# Path and option to link against the VM, if you have to.
|
||||
#
|
||||
JVMLIB = $(LIBDIR)/jvm.lib
|
||||
JAVALIB = $(LIBDIR)/java.lib
|
||||
|
||||
ifeq ($(CC_VERSION), msvc)
|
||||
CC_DEPEND = -FD
|
||||
CC_DEPEND_FILTER =
|
||||
else # CC_VERSION
|
||||
# not supported, but left for historical reference...
|
||||
CC_DEPEND = -MM
|
||||
CC_DEPEND_FILTER = $(SED) -e 's!$*\.$(OBJECT_SUFFIX)!$(dir $@)&!g'
|
||||
endif # CC_VERSION
|
||||
|
||||
LIBRARY_SUFFIX = dll
|
||||
LIB_SUFFIX = lib
|
||||
|
||||
# Settings for the JDI - Serviceability Agent binding.
|
||||
HOTSPOT_SALIB_PATH = $(HOTSPOT_IMPORT_PATH)/jre/bin
|
||||
SALIB_NAME = $(LIB_PREFIX)sawindbg.$(LIBRARY_SUFFIX)
|
||||
SAMAP_NAME = $(LIB_PREFIX)sawindbg.map
|
||||
SAPDB_NAME = $(LIB_PREFIX)sawindbg.pdb
|
||||
|
||||
ifeq ($(ARCH), ia64)
|
||||
# SA will never be supported here.
|
||||
INCLUDE_SA = false
|
||||
else
|
||||
INCLUDE_SA = true
|
||||
endif
|
||||
|
||||
# Settings for the VERSIONINFO tap on windows.
|
||||
VERSIONINFO_RESOURCE = $(BUILDDIR)/../src/windows/resource/version.rc
|
||||
|
||||
ifneq ($(JDK_BUILD_NUMBER),)
|
||||
COOKED_BUILD_NUMBER = $(shell $(ECHO) $(JDK_BUILD_NUMBER) | $(SED) -e 's/^b//' -e 's/^0//')
|
||||
else
|
||||
COOKED_BUILD_NUMBER = 0
|
||||
endif
|
||||
|
||||
# If the update version contains non-numeric characters, we need
|
||||
# to massage it into a numeric format.
|
||||
# We use the following formula:
|
||||
# JDK_UPDATE_VER = JDK_UPDATE_VERSION * 10 + EXCEPTION_VERSION
|
||||
#
|
||||
# Here are some examples:
|
||||
# 1.5.0 b01 -> 5,0,0,1
|
||||
# 1.5.0_10 b01 -> 5,0,100,1
|
||||
# 1.4.2 b01 -> 4,2,0,1
|
||||
# 1.4.2_02 b01 -> 4,2,20,1
|
||||
# 1.4.2_02a b01 -> 4,2,21,1
|
||||
# 1.4.2_02b b01 -> 4,2,22,1
|
||||
ifdef JDK_UPDATE_VERSION
|
||||
VTMP := $(shell $(ECHO) $(JDK_UPDATE_VERSION) | $(TR) "abcde" "12345")
|
||||
CAB_CHAR1 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 1, 1);}')
|
||||
CAB_CHAR2 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 2, 1);}')
|
||||
CAB_CHAR3 := $(shell $(ECHO) $(VTMP) | $(NAWK) '{print substr($$1, 3, 1);}')
|
||||
JDK_UPDATE_META_TAG := U$(MARKETING_NUMBER)
|
||||
ifeq ($(CAB_CHAR3),)
|
||||
CAB_CHAR3 := 0
|
||||
endif
|
||||
ifeq ($(CAB_CHAR1), 0)
|
||||
JDK_UPDATE_VER := $(CAB_CHAR2)$(CAB_CHAR3)
|
||||
else
|
||||
JDK_UPDATE_VER := $(CAB_CHAR1)$(CAB_CHAR2)$(CAB_CHAR3)
|
||||
endif
|
||||
else
|
||||
JDK_UPDATE_VER := 0
|
||||
endif
|
||||
|
||||
#RC_FLAGS = /l 0x409 /r
|
||||
|
||||
#ifeq ($(VARIANT), OPT)
|
||||
# RC_FLAGS += -d NDEBUG
|
||||
#else
|
||||
# RC_FLAGS += $(MS_RC_DEBUG_OPTION)
|
||||
#endif
|
||||
|
||||
# Values for the RC variables defined in RC_FLAGS
|
||||
#JDK_RC_BUILD_ID = $(FULL_VERSION)
|
||||
#JDK_RC_COMPANY = $(COMPANY_NAME)
|
||||
#JDK_RC_COMPONENT = $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) binary
|
||||
#JDK_RC_VER = \
|
||||
# $(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
|
||||
#JDK_RC_COPYRIGHT = Copyright \xA9 $(COPYRIGHT_YEAR)
|
||||
#JDK_RC_NAME = \
|
||||
# $(PRODUCT_NAME) $(JDK_RC_PLATFORM_NAME) $(JDK_MINOR_VERSION) $(JDK_UPDATE_META_TAG)
|
||||
#JDK_RC_FVER = \
|
||||
# $(JDK_MINOR_VERSION),$(JDK_MICRO_VERSION),$(JDK_UPDATE_VER),$(COOKED_BUILD_NUMBER)
|
||||
|
||||
# JDK name required here
|
||||
#RC_FLAGS += -d "JDK_BUILD_ID=$(JDK_RC_BUILD_ID)" \
|
||||
# -d "JDK_COMPANY=$(JDK_RC_COMPANY)" \
|
||||
# -d "JDK_COMPONENT=$(JDK_RC_COMPONENT)" \
|
||||
# -d "JDK_VER=$(JDK_RC_VER)" \
|
||||
# -d "JDK_COPYRIGHT=$(JDK_RC_COPYRIGHT)" \
|
||||
# -d "JDK_NAME=$(JDK_RC_NAME)" \
|
||||
# -d "JDK_FVER=$(JDK_RC_FVER)"
|
||||
|
||||
# Enable 7-Zip LZMA file (de)compression for Java Kernel if it is available
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
ifneq ($(KERNEL), off)
|
||||
# This is a hack to use until 7-Zip (and UPX) bundles can be put
|
||||
# under /java/devtools.
|
||||
ifndef DEPLOY_TOPDIR
|
||||
DEPLOY_TOPDIR=$(JDK_TOPDIR)/../deploy
|
||||
endif
|
||||
# Uncomment this block to cause build failure if above assumption false
|
||||
#DCHK = $(shell if [ ! -d $(DEPLOY_TOPDIR) ] ; then \
|
||||
# $(ECHO) deploy_not_a_peer_of_j2se ; \
|
||||
#fi )
|
||||
#ifeq ($(DCHK), deploy_not_a_peer_of_j2se)
|
||||
# If a build failure points to control coming here it means
|
||||
# it means deploy is not in the same directory
|
||||
# as j2se. Java Kernel can't tolerate that for the time being.
|
||||
#endif
|
||||
EC_TMP = $(shell if [ -d $(DEPLOY_TOPDIR)/make/lzma ] ; then \
|
||||
$(ECHO) true ; \
|
||||
else \
|
||||
$(ECHO) false ; \
|
||||
fi )
|
||||
ifeq ($(EC_TMP), true)
|
||||
EXTRA_COMP_INSTALL_PATH = lib\\\\deploy\\\\lzma.dll
|
||||
# Crazy but true: deploy/make/plugin/jinstall/Makefile.jkernel does
|
||||
# not include deploy/make/common/Defs-windows.gmk, either directly
|
||||
# or indirectly. But it does include this file, so redundantly declare
|
||||
# these variables that are in deploy/make/common/Defs-windows.gmk for
|
||||
# the sake of the Java Kernel part of the deploy build. Whew!
|
||||
EXTRA_COMP_LIB_NAME = lzma.dll
|
||||
EXTRA_COMP_PATH = $(OUTPUTDIR)/tmp/deploy/lzma/win32/obj
|
||||
EXTRA_COMP_CMD_PATH = $(EXTRA_COMP_PATH)/lzma.exe
|
||||
EXTRA_COMP_LIB_PATH = $(EXTRA_COMP_PATH)/$(EXTRA_COMP_LIB_NAME)
|
||||
endif
|
||||
endif
|
||||
endif
|
@ -1,577 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Common variables used by all the Java makefiles. This file should
|
||||
# not contain rules.
|
||||
#
|
||||
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
# Check for strange explicit settings (change to empty or true)
|
||||
ifdef OPENJDK
|
||||
ifneq ($(OPENJDK),true)
|
||||
x:=$(error "OPENJDK (if defined) can only be set to true")
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# On Solaris, the 'make' utility from Sun will not work with these makefiles.
|
||||
# This little rule is only understood by Sun's make, and is harmless
|
||||
# when seen by the GNU make tool. If using Sun's make, this causes the
|
||||
# make command to fail.
|
||||
#
|
||||
SUN_MAKE_TEST:sh = echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33
|
||||
|
||||
include $(SPEC)
|
||||
include $(JDK_MAKE_SHARED_DIR)/Platform.gmk
|
||||
|
||||
# Historically PLATFORM_SRC used to be src/$(PLATFORM), but we switched it to
|
||||
# src/solaris so if you want to build on Linux you didn't need a src/linux
|
||||
# directory. In an ideal world it would be called src/genunix but we are not
|
||||
# there yet.
|
||||
#
|
||||
ifndef SHARE_SRC
|
||||
SHARE_SRC = $(BUILDDIR)/../src/share
|
||||
endif
|
||||
|
||||
# Files that cannot be included in the OpenJDK distribution are
|
||||
# collected under a parent directory which contains just those files.
|
||||
ifndef CLOSED_SRC
|
||||
CLOSED_SRC = $(BUILDDIR)/../src/closed
|
||||
endif
|
||||
|
||||
# If CLOSE_SRC_INCLUDED isn't set to true, check if there's any
|
||||
# closed directory.
|
||||
ifneq ($(CLOSED_SRC_INCLUDED), true)
|
||||
CLOSED_SRC_INCLUDED := $(shell \
|
||||
if [ -d $(CLOSED_SRC) ] ; then \
|
||||
echo true; \
|
||||
else \
|
||||
echo false; \
|
||||
fi)
|
||||
endif
|
||||
|
||||
# Set OPENJDK based on CLOSED_SRC_INCLUDED
|
||||
ifeq ($(CLOSED_SRC_INCLUDED), false)
|
||||
OPENJDK = true
|
||||
endif
|
||||
|
||||
# Define where closed directories are
|
||||
ifdef OPENJDK
|
||||
CLOSED_SRC =
|
||||
CLOSED_SHARE_SRC =
|
||||
else
|
||||
ifndef CLOSED_SHARE_SRC
|
||||
CLOSED_SHARE_SRC = $(CLOSED_SRC)/share
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# Get platform definitions
|
||||
#
|
||||
|
||||
include $(JDK_TOPDIR)/makefiles/common/Defs-$(PLATFORM).gmk
|
||||
|
||||
#
|
||||
# SE-Embedded support, if enabled
|
||||
#
|
||||
|
||||
include $(JDK_TOPDIR)/makefiles/common/Defs-embedded.gmk
|
||||
|
||||
#
|
||||
# Cross-compilation Settings
|
||||
#
|
||||
ifdef CROSS_COMPILE_ARCH
|
||||
# Can't run the tools we just built
|
||||
USE_ONLY_BOOTDIR_TOOLS = true
|
||||
|
||||
# When cross-compiling CC generates code for the target, but
|
||||
# some parts of the build generate C code that has to be compiled
|
||||
# and executed on the build host - HOST_CC is the 'local' compiler.
|
||||
# For linux the default is /usr/bin/gcc; other platforms need to
|
||||
# set it explicitly
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifndef HOST_CC
|
||||
HOST_CC = $(USRBIN_PATH)gcc
|
||||
endif
|
||||
endif
|
||||
else
|
||||
# Must set HOST_CC if not already set
|
||||
ifndef HOST_CC
|
||||
HOST_CC = $(CC)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Reset the VM name for client-only builds
|
||||
ifeq ($(JVM_VARIANT),client)
|
||||
VM_NAME = client
|
||||
endif
|
||||
|
||||
#
|
||||
# Freetype logic is applicable to OpenJDK only
|
||||
#
|
||||
ifdef OPENJDK
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/win32/freetype-$(ARCH)
|
||||
endif
|
||||
ifeq ($(PLATFORM), linux)
|
||||
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(PLATFORM)/freetype-$(ARCH)
|
||||
endif
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
# historically for Solaris we have slightly different devtools
|
||||
# naming conventions
|
||||
DEVTOOLS_FT_DIR=$(JDK_DEVTOOLS_DIR)/$(ARCH_FAMILY)/freetype-$(ARCH)
|
||||
endif
|
||||
|
||||
DEVTOOLS_FT_DIR_EXISTS = $(shell \
|
||||
if [ -f $(DEVTOOLS_FT_DIR)/include/ft2build.h ] ; then \
|
||||
echo true; \
|
||||
else \
|
||||
echo false; \
|
||||
fi)
|
||||
|
||||
ifdef ALT_FREETYPE_LIB_PATH
|
||||
FREETYPE_LIB_PATH = $(ALT_FREETYPE_LIB_PATH)
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
USING_SYSTEM_FT_LIB=true
|
||||
endif
|
||||
else
|
||||
ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
|
||||
FREETYPE_LIB_PATH = $(DEVTOOLS_FT_DIR)/lib
|
||||
else
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
FREETYPE_LIB_PATH = /usr/X11R6/lib
|
||||
else
|
||||
FREETYPE_LIB_PATH = /usr/lib
|
||||
endif
|
||||
USING_SYSTEM_FT_LIB=true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef ALT_FREETYPE_HEADERS_PATH
|
||||
FREETYPE_HEADERS_PATH = $(ALT_FREETYPE_HEADERS_PATH)
|
||||
else
|
||||
ifeq ($(DEVTOOLS_FT_DIR_EXISTS), true)
|
||||
FREETYPE_HEADERS_PATH = $(DEVTOOLS_FT_DIR)/include
|
||||
else
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
FREETYPE_HEADERS_PATH = /usr/X11R6/include
|
||||
else
|
||||
FREETYPE_HEADERS_PATH = /usr/include
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
#
|
||||
# zlib version
|
||||
#
|
||||
ZLIB_VERSION = 1.2.5
|
||||
|
||||
|
||||
#
|
||||
# Localizations for the different parts of the product beyond English
|
||||
#
|
||||
|
||||
JRE_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK
|
||||
PLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK
|
||||
JDK_LOCALES = ja zh_CN
|
||||
|
||||
#
|
||||
# A list of locales we support but don't have resource files.
|
||||
# This is defined to optimize the search of resource bundles.
|
||||
#
|
||||
JRE_NONEXIST_LOCALES = en en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR sv_SE zh
|
||||
|
||||
#
|
||||
# For now, most libraries except libjava and libjvm itself link against libjvm
|
||||
# and libjava, the latter for its exported common utilities. libjava only
|
||||
# links against libjvm. Programs' makefiles take their own responsibility for
|
||||
# adding other libs.
|
||||
#
|
||||
# The makefiles for these packages do not link against libjvm and libjava.
|
||||
# This list will eventually go away and each Programs' makefiles
|
||||
# will have to explicitly declare that they want to link to libjava/libjvm
|
||||
#
|
||||
NO_JAVALIB_PKGS = \
|
||||
sun.security.mscapi \
|
||||
sun.security.krb5 \
|
||||
sun.security.pkcs11 \
|
||||
sun.security.jgss \
|
||||
sun.security.jgss.wrapper \
|
||||
sun.security.ec \
|
||||
sun.security.smartcardio \
|
||||
com.sun.security.auth.module
|
||||
|
||||
ifdef PACKAGE
|
||||
# put JAVALIB first, but do not lose any platform specific values....
|
||||
ifeq (,$(findstring $(PACKAGE),$(NO_JAVALIB_PKGS)))
|
||||
LDLIBS_COMMON = $(JAVALIB)
|
||||
endif
|
||||
endif # PACKAGE
|
||||
|
||||
#
|
||||
# Libraries that must appear ahead of libc.so on the link command line
|
||||
#
|
||||
ifdef PROGRAM
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
LDLIBS_COMMON = -lthread -ldl
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
LDLIBS_COMMON = -ldl
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
LDLIBS_COMMON = -pthread
|
||||
endif
|
||||
|
||||
endif # PROGRAM
|
||||
|
||||
LDLIBS_COMMON += $(EXTRA_LIBS)
|
||||
|
||||
# for generated binaries
|
||||
BINDIR = $(OUTPUTDIR)/bin$(ISA_DIR)
|
||||
# for generated libraries
|
||||
LIBDIR = $(OUTPUTDIR)/lib
|
||||
ABS_LIBDIR = $(ABS_OUTPUTDIR)/lib
|
||||
# Optional place to save the windows .lib files
|
||||
LIBFILES_DIR = $(OUTPUTDIR)/libfiles
|
||||
# for ext jre files
|
||||
EXTDIR = $(LIBDIR)/ext
|
||||
# for generated include files
|
||||
INCLUDEDIR = $(OUTPUTDIR)/include
|
||||
# for generated class files
|
||||
CLASSBINDIR = $(OUTPUTDIR)/classes
|
||||
DEMOCLASSDIR = $(OUTPUTDIR)/democlasses
|
||||
# for generated tool class files
|
||||
BUILDTOOLCLASSDIR = $(OUTPUTDIR)/btclasses
|
||||
# for build tool jar files
|
||||
BUILDTOOLJARDIR = $(OUTPUTDIR)/btjars
|
||||
ABS_BUILDTOOLJARDIR = $(ABS_OUTPUTDIR)/btjars
|
||||
# for generated tool class files
|
||||
BUILDTOOLBINDIR = $(OUTPUTDIR)/btbins
|
||||
# for generated java source files
|
||||
GENSRCDIR = $(OUTPUTDIR)/gensrc
|
||||
# for generated C source files (not javah)
|
||||
GENNATIVESRCDIR = $(OUTPUTDIR)/gennativesrc
|
||||
# for imported source files
|
||||
IMPORTSRCDIR = $(OUTPUTDIR)/impsrc
|
||||
# for imported documents
|
||||
IMPORTDOCDIR = $(OUTPUTDIR)/impdoc
|
||||
# for generated demo
|
||||
DEMODIR = $(OUTPUTDIR)/demo
|
||||
NEWDEMODIR = $(OUTPUTDIR)/newdemo
|
||||
# for sample code
|
||||
SAMPLEDIR = $(OUTPUTDIR)/sample
|
||||
# for generated documentation
|
||||
DOCSDIR = $(OUTPUTDIR)/docs$(DOCSDIRSUFFIX)
|
||||
DOCSDIRSUFFIX =
|
||||
|
||||
# The MESSAGE, WARNING and ERROR files are used to store sanityck and
|
||||
# warnings and errors.
|
||||
ifndef ERROR_FILE
|
||||
ERROR_FILE = $(OUTPUTDIR)/sanityCheckErrors.txt
|
||||
endif
|
||||
ifndef WARNING_FILE
|
||||
WARNING_FILE = $(OUTPUTDIR)/sanityCheckWarnings.txt
|
||||
endif
|
||||
ifndef MESSAGE_FILE
|
||||
MESSAGE_FILE = $(OUTPUTDIR)/sanityCheckMessages.txt
|
||||
endif
|
||||
|
||||
#where the demo source can be found
|
||||
DEMOSRCDIR = $(SHARE_SRC)/demo
|
||||
|
||||
#where the sample source can be found
|
||||
SAMPLESRCDIR = $(SHARE_SRC)/sample
|
||||
|
||||
# An attempt is made to generate unique enough directories for the
|
||||
# generated files to not have name collisisons. Most build units
|
||||
# defines PRODUCT (except Release.gmk), but then they may or may
|
||||
# not define PACKAGE, PROGRAM, and LIBRARY. This code attempts to
|
||||
# generate a unique OBJDIR/CLASSHDRDIR for each build unit based
|
||||
# on which of those values are set within each build unit.
|
||||
|
||||
UNIQUE_LOCATION_STRING = tmp
|
||||
|
||||
ifneq ($(PRODUCT),)
|
||||
UNIQUE_LOCATION_STRING += /$(PRODUCT)
|
||||
endif
|
||||
|
||||
ifneq ($(PACKAGE),)
|
||||
UNIQUE_LOCATION_STRING += /$(PACKAGE)
|
||||
endif
|
||||
|
||||
ifneq ($(PROGRAM),)
|
||||
UNIQUE_LOCATION_STRING += /$(PROGRAM)
|
||||
endif
|
||||
|
||||
ifneq ($(LIBRARY),)
|
||||
ifneq ($(LIBRARY_OUTPUT),)
|
||||
UNIQUE_LOCATION_STRING += /$(LIBRARY_OUTPUT)
|
||||
else
|
||||
UNIQUE_LOCATION_STRING += /$(LIBRARY)
|
||||
endif
|
||||
endif
|
||||
|
||||
# the use of += above makes a space separated list which we need to
|
||||
# remove for filespecs.
|
||||
#
|
||||
NULLSTRING :=
|
||||
ONESPACE := $(NULLSTRING) # space before this comment is required.
|
||||
UNIQUE_PATH = $(subst $(ONESPACE),,$(UNIQUE_LOCATION_STRING))
|
||||
|
||||
# TEMPDIR is a unique general purpose directory
|
||||
# need to use 'override' because GNU Make on Linux exports the wrong
|
||||
# value.
|
||||
TEMPDIR ?= $(OUTPUTDIR)/$(UNIQUE_PATH)
|
||||
ABS_TEMPDIR ?= $(ABS_OUTPUTDIR)/$(UNIQUE_PATH)
|
||||
|
||||
# This must be created right away for pattern rules in Sanity.gmk to work.
|
||||
dummy1:=$(shell $(MKDIR) -p $(TEMPDIR))
|
||||
dummy2:=$(shell $(MKDIR) -p $(TEMP_DISK))
|
||||
|
||||
# OBJDIRNAME is the name of the directory where the object code is to
|
||||
# be placed. It's name depends on whether the data model architecture
|
||||
# is 32-bit or not.
|
||||
ifneq ($(ARCH_DATA_MODEL), 32)
|
||||
OBJDIRNAME = obj$(ARCH_DATA_MODEL)$(OBJDIRNAME_SUFFIX)
|
||||
else
|
||||
OBJDIRNAME = obj$(OBJDIRNAME_SUFFIX)
|
||||
endif
|
||||
OBJDIR = $(TEMPDIR)/$(OBJDIRNAME)
|
||||
|
||||
# CLASSHDRDIR is where the generated C Class Header files go.
|
||||
CLASSHDRDIR = $(TEMPDIR)/CClassHeaders
|
||||
|
||||
#
|
||||
# CLASSDESTDIR can be used to specify the directory where generated classes
|
||||
# are to be placed. The default is CLASSBINDIR.
|
||||
#
|
||||
ifndef CLASSDESTDIR
|
||||
CLASSDESTDIR = $(CLASSBINDIR)
|
||||
endif
|
||||
|
||||
INCLUDES = -I. -I$(CLASSHDRDIR) \
|
||||
$(patsubst %,-I%,$(subst $(CLASSPATH_SEPARATOR), ,$(VPATH.h))) $(OTHER_INCLUDES)
|
||||
OTHER_CPPFLAGS += $(INCLUDES)
|
||||
|
||||
#
|
||||
# vpaths. These are the default locations searched for source files.
|
||||
# GNUmakefiles of individual areas often override the default settings.
|
||||
# There are no longer default vpath entries for C and assembler files
|
||||
# so we can ensure that libraries don't get their hands on JVM files.
|
||||
#
|
||||
# We define an intermediate variable for Java files because
|
||||
# we use its value later to help define $SOURCEPATH
|
||||
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
VPATH0.java = $(subst $(ONESPACE),:,$(GENSRCDIR) $(call JavaSrcDirList,,classes))
|
||||
else
|
||||
VPATH0.java = $(GENSRCDIR)$(CLASSPATH_SEPARATOR)$(PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/classes
|
||||
endif
|
||||
|
||||
ifdef OPENJDK
|
||||
VPATH.java = $(VPATH0.java)
|
||||
else
|
||||
#
|
||||
# If filenames are duplicated between open/closed workspaces, prefer
|
||||
# the closed files.
|
||||
#
|
||||
# Source ordering is important: some targets depend on closed files
|
||||
# replacing open ones, and thus the closed file sources must be found
|
||||
# before the open ones.
|
||||
#
|
||||
# Don't reorder without consulting the teams that depend on this behavior.
|
||||
#
|
||||
VPATH.java = $(CLOSED_PLATFORM_SRC)/classes$(CLASSPATH_SEPARATOR)$(CLOSED_SHARE_SRC)/classes$(CLASSPATH_SEPARATOR)$(VPATH0.java)
|
||||
endif
|
||||
vpath %.java $(VPATH.java)
|
||||
vpath %.class $(CLASSBINDIR)
|
||||
vpath %.$(OBJECT_SUFFIX) $(OBJDIR)
|
||||
|
||||
#
|
||||
# VPATH.h is used elsewhere to generate include flags. By default,
|
||||
# anyone has access to the include files that the JVM area exports,
|
||||
# namely jni.h, jvm.h, and jni_utils.h, plus their platform-specific
|
||||
# relatives.
|
||||
#
|
||||
VPATH0.h = $(PLATFORM_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(SHARE_SRC)/javavm/export
|
||||
ifdef OPENJDK
|
||||
VPATH.h = $(VPATH0.h)
|
||||
else
|
||||
VPATH.h = $(CLOSED_SHARE_SRC)/javavm/export$(CLASSPATH_SEPARATOR)$(VPATH0.h)
|
||||
endif
|
||||
vpath %.h $(VPATH.h)
|
||||
|
||||
#
|
||||
# Used in two ways: helps link against libjava.so. Also if overridden
|
||||
# determines where your shared library is installed.
|
||||
#
|
||||
ifndef LIB_LOCATION
|
||||
LIB_LOCATION = $(LIBDIR)/$(LIBARCH)
|
||||
endif
|
||||
|
||||
#
|
||||
# Java header and stub variables
|
||||
#
|
||||
CLASSHDRS = $(patsubst %,$(CLASSHDRDIR)/%.h,$(subst .,_,$(CLASSES.export)))
|
||||
CLASSSTUBOBJS = classstubs.$(OBJECT_SUFFIX)
|
||||
STUBPREAMBLE = $(INCLUDEDIR)/StubPreamble.h
|
||||
|
||||
#
|
||||
# Classpath seen by javac (different from the one seen by the VM
|
||||
# running javac), and useful variables.
|
||||
#
|
||||
SOURCEPATH = $(VPATH.java)
|
||||
PKG = $(shell $(EXPR) $(PACKAGE) : '\([a-z]*\)')
|
||||
PKGDIR = $(subst .,/,$(PACKAGE))
|
||||
|
||||
#
|
||||
# The java/javac/jdk variables (JAVAC_CMD, JAVA_CMD, etc.)
|
||||
#
|
||||
include $(JDK_MAKE_SHARED_DIR)/Defs-java.gmk
|
||||
|
||||
UNIQUE_PATH_PATTERN = $(subst /,.,$(UNIQUE_PATH))
|
||||
|
||||
# Run MAKE $@ for a launcher:
|
||||
# $(call make-launcher, name, mainclass, java-args, main-args)
|
||||
define make-launcher
|
||||
$(CD) $(BUILDDIR)/launchers && \
|
||||
$(MAKE) -f Makefile.launcher \
|
||||
PROGRAM=$(strip $1) \
|
||||
MAIN_CLASS=$(strip $2) \
|
||||
MAIN_JAVA_ARGS="$(strip $3)" \
|
||||
MAIN_ARGS="$(strip $4)"
|
||||
endef
|
||||
|
||||
#
|
||||
# Convenient macros
|
||||
#
|
||||
|
||||
# Prepare $@ target, remove old one and making sure directory exists
|
||||
define prep-target
|
||||
mkdir -p $(@D)
|
||||
rm -f $@
|
||||
endef
|
||||
|
||||
# Simple install of $< file to $@
|
||||
define install-file
|
||||
$(prep-target)
|
||||
$(CP) $< $@
|
||||
endef
|
||||
|
||||
define chmod-file
|
||||
$(CHMOD) $1 $@
|
||||
endef
|
||||
|
||||
define install-sym-link
|
||||
$(LN) -s $1 $@
|
||||
endef
|
||||
|
||||
define install-manifest-file
|
||||
$(install-file)
|
||||
endef
|
||||
|
||||
# Cleanup rule for after debug java run (hotspot.log file is left around)
|
||||
# (This could be an old leftover file in a read-only area, use the @- prefix)
|
||||
HOTSPOT_LOG_NAME = hotspot.log
|
||||
define java-vm-cleanup
|
||||
if [ -w $(HOTSPOT_LOG_NAME) ] ; then rm -f $(HOTSPOT_LOG_NAME); fi
|
||||
endef
|
||||
|
||||
# Current directory
|
||||
CURRENT_DIRECTORY := $(shell $(PWD))
|
||||
|
||||
#
|
||||
# Create BYFILE OPT and DBG settings, if CFLAGS_OPT/foobar.o is set then it is
|
||||
# used for this file, otherwise the default settings are used.
|
||||
#
|
||||
CFLAGS_$(VARIANT)/BYFILE = $(CFLAGS_$(VARIANT)/$(@F)) \
|
||||
$(CFLAGS_$(VARIANT)$(CFLAGS_$(VARIANT)/$(@F)))
|
||||
CXXFLAGS_$(VARIANT)/BYFILE = $(CXXFLAGS_$(VARIANT)/$(@F)) \
|
||||
$(CXXFLAGS_$(VARIANT)$(CXXFLAGS_$(VARIANT)/$(@F)))
|
||||
|
||||
#
|
||||
# Tool flags
|
||||
#
|
||||
# EXTRA_CFLAGS are used to define cross-compilation options
|
||||
#
|
||||
ASFLAGS = $(ASFLAGS_$(VARIANT)) $(ASFLAGS_COMMON) $(OTHER_ASFLAGS)
|
||||
CFLAGS = $(CFLAGS_$(VARIANT)/BYFILE) $(CFLAGS_COMMON) $(OTHER_CFLAGS) $(EXTRA_CFLAGS)
|
||||
CXXFLAGS = $(CXXFLAGS_$(VARIANT)/BYFILE) $(CXXFLAGS_COMMON) $(OTHER_CXXFLAGS) $(EXTRA_CFLAGS)
|
||||
CPPFLAGS = $(CPPFLAGS_$(VARIANT)) $(CPPFLAGS_COMMON) $(OTHER_CPPFLAGS) \
|
||||
$(DEFINES) $(OPTIONS:%=-D%)
|
||||
LDFLAGS = $(LDFLAGS_$(VARIANT)) $(LDFLAGS_COMMON) $(OTHER_LDFLAGS)
|
||||
LDLIBS = $(OTHER_LDLIBS) $(LDLIBS_$(VARIANT)) $(LDLIBS_COMMON)
|
||||
LINTFLAGS = $(LINTFLAGS_$(VARIANT)) $(LINTFLAGS_COMMON) \
|
||||
$(OTHER_LINTFLAGS)
|
||||
|
||||
VERSION_DEFINES = -DRELEASE='"$(RELEASE)"'
|
||||
|
||||
ifdef INSANE
|
||||
export INSANE
|
||||
endif
|
||||
|
||||
ifdef ALT_COPYRIGHT_YEAR
|
||||
COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR)
|
||||
else
|
||||
COPYRIGHT_YEAR := $(shell $(DATE) '+%Y')
|
||||
endif
|
||||
|
||||
ifndef OPENJDK
|
||||
include $(JDK_TOPDIR)/make/closed/common/Defs.gmk
|
||||
endif
|
||||
|
||||
# Install of imported file (JDK_IMPORT_PATH, or some other external location)
|
||||
define install-importonly-file
|
||||
@$(ECHO) "ASSEMBLY_IMPORT: $@"
|
||||
$(prep-target)
|
||||
$(CP) $< $@
|
||||
@if [ "$(PLATFORM)" = "linux" -a "$(@F)" = "libjvm.so" ] ; then \
|
||||
if [ -x /usr/sbin/selinuxenabled ] ; then \
|
||||
/usr/sbin/selinuxenabled; \
|
||||
if [ $$? = 0 ] ; then \
|
||||
$(ECHO) "/usr/bin/chcon -t textrel_shlib_t $@"; \
|
||||
/usr/bin/chcon -t textrel_shlib_t $@; \
|
||||
if [ $$? != 0 ]; then \
|
||||
echo "ERROR: Cannot chcon $@"; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi
|
||||
endef
|
||||
|
||||
define install-import-file
|
||||
$(install-importonly-file)
|
||||
endef
|
||||
|
||||
.PHONY: all build clean clobber
|
@ -1,415 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2004, 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.
|
||||
#
|
||||
|
||||
COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) -c
|
||||
COMPILE.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c
|
||||
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
# JDK Demo building jar file.
|
||||
|
||||
# Some names are defined with LIBRARY inside the Defs.gmk file
|
||||
LIBRARY=$(DEMONAME)
|
||||
OBJDIR=$(TEMPDIR)/$(DEMONAME)
|
||||
|
||||
# Input:
|
||||
# DEMONAME - name of the demo
|
||||
# DEMO_ROOT - path to root of all demo files
|
||||
# DEMO_DESTDIR - path to final demo destination directory
|
||||
#
|
||||
# Optional Input:
|
||||
# DEMO_SRCDIR - path to source if different from DEMO_ROOT
|
||||
# DEMO_PSRCDIR - path to additional platform specific source
|
||||
# DEMO_PKGDIR - sub directory of sources we want
|
||||
# DEMO_TOPFILES - names of top-level files relative to DEMO_ROOT
|
||||
# DEMO_MAINCLASS - name of the main class for the jar manifest
|
||||
# DEMO_NATIVECLASS - name of the class with native methods
|
||||
# DEMO_DESCRIPTOR - name of service file for jar (relative to DEMO_SRCDIR)
|
||||
# DEMO_EXTRA_SRCDIR - path to directory that holds extra sources to add
|
||||
# DEMO_EXTRA_FILES - extra sources relative to DEMO_EXTRA_SRCDIR
|
||||
# DEMO_OBJECTS - extra native object files needed
|
||||
# DEMO_MANIFEST_ATTR - extra line to add to the jar manifest file
|
||||
|
||||
# Assume the source directory is the root directory if not set
|
||||
ifndef DEMO_SRCDIR
|
||||
DEMO_SRCDIR = $(DEMO_ROOT)
|
||||
endif
|
||||
ifndef DEMO_PKGDIR
|
||||
DEMO_PKGDIR = .
|
||||
endif
|
||||
|
||||
# Some demos have special needs
|
||||
ifneq ($(DEMONAME),agent_util)
|
||||
DEMO_NEEDS_AGENT_UTIL = $(findstring agent_util,$(DEMO_OBJECTS))
|
||||
endif
|
||||
ifneq ($(DEMONAME),java_crw_demo)
|
||||
DEMO_NEEDS_JAVA_CRW_DEMO = $(findstring java_crw_demo,$(DEMO_OBJECTS))
|
||||
endif
|
||||
ifeq ($(DEMONAME),hprof)
|
||||
DEMO_NEEDS_NPT = true
|
||||
endif
|
||||
|
||||
# Place to hold the build area (kind of a temp area)
|
||||
DEMO_BUILD_AREA = $(DEMOCLASSDIR)/$(PRODUCT)/$(DEMONAME)
|
||||
|
||||
# Destination "src" directory
|
||||
DEMO_BUILD_SRCDIR = $(DEMO_BUILD_AREA)/src
|
||||
|
||||
ifndef DEMO_SKIP_SRCZIP
|
||||
DEMO_BUILD_SRCZIP = $(DEMO_BUILD_AREA)/src.zip
|
||||
DEMO_SOURCE_ZIP = $(DEMO_DESTDIR)/src.zip
|
||||
endif
|
||||
|
||||
# Place to hold the jar image we are creating
|
||||
DEMO_JAR_IMAGE = $(DEMO_BUILD_AREA)/jar_image
|
||||
|
||||
# The jar manifest file we will create and use
|
||||
DEMO_MANIFEST = $(DEMO_BUILD_AREA)/manifest.mf
|
||||
|
||||
# The list of source files or options we will supply to javac
|
||||
DEMO_JAVAC_INPUT = $(DEMO_BUILD_AREA)/javac_input.txt
|
||||
|
||||
# Any name of javah file
|
||||
DEMO_JAVAH_FILE = $(DEMO_NATIVECLASS:%=$(DEMO_BUILD_SRCDIR)/%.h)
|
||||
|
||||
# Get complete list of files for this demo
|
||||
ifdef DEMO_PSRCDIR
|
||||
DEMO_ALL_FILES2 := $(shell ( $(CD) $(DEMO_PSRCDIR) \
|
||||
&& $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \
|
||||
| $(SED) 's@^\./@@' )
|
||||
DEMO_ALL_FILES += $(DEMO_ALL_FILES2)
|
||||
endif
|
||||
ifdef DEMO_EXTRA_SRCDIR
|
||||
DEMO_ALL_FILES += $(DEMO_EXTRA_FILES)
|
||||
endif
|
||||
DEMO_ALL_FILES1 := $(shell ( $(CD) $(DEMO_SRCDIR) \
|
||||
&& $(FIND) $(DEMO_PKGDIR) $(SCM_DIRS_prune) -o -type f -print ) \
|
||||
| $(SED) 's@^\./@@' )
|
||||
DEMO_ALL_FILES += $(DEMO_ALL_FILES1)
|
||||
|
||||
# Just the java sources
|
||||
DEMO_JAVA_SOURCES = $(filter %.java,$(DEMO_ALL_FILES))
|
||||
|
||||
# Just the C and C++ sources
|
||||
DEMO_C_SRC_FILES = $(filter %.c,$(DEMO_ALL_FILES))
|
||||
DEMO_CPP_SRC_FILES = $(filter %.cpp,$(DEMO_ALL_FILES))
|
||||
|
||||
# All the native source files
|
||||
DEMO_ALL_NATIVE_SOURCES = $(DEMO_C_SRC_FILES)
|
||||
DEMO_ALL_NATIVE_SOURCES += $(DEMO_CPP_SRC_FILES)
|
||||
DEMO_ALL_NATIVE_SOURCES += $(filter %.h,$(DEMO_ALL_FILES))
|
||||
DEMO_ALL_NATIVE_SOURCES += $(filter %.hpp,$(DEMO_ALL_FILES))
|
||||
|
||||
# If we have java sources, then define the jar file we will create
|
||||
ifndef DEMO_JAR_NAME
|
||||
DEMO_JAR_NAME = $(DEMONAME).jar
|
||||
endif
|
||||
ifneq ($(strip $(DEMO_JAVA_SOURCES)),)
|
||||
DEMO_JAR = $(DEMO_DESTDIR)/$(DEMO_JAR_NAME)
|
||||
endif
|
||||
|
||||
# If we have native sources, define the native library we will create
|
||||
ifneq ($(strip $(DEMO_ALL_NATIVE_SOURCES)),)
|
||||
# Path to native library we will create
|
||||
DEMO_LIBRARY = \
|
||||
$(DEMO_DESTDIR)/lib$(ISA_DIR)/$(LIB_PREFIX)$(DEMONAME).$(LIBRARY_SUFFIX)
|
||||
# C and C++ compiler flags we need to add to standard flags
|
||||
DEMO_CPPFLAGS += -I$(DEMO_BUILD_SRCDIR)
|
||||
# If the npt library is used we need to find the npt.h file
|
||||
ifneq ($(DEMO_NEEDS_NPT),)
|
||||
# The npt library is delivered as part of the JRE
|
||||
DEMO_CPPFLAGS += -I$(SHARE_SRC)/npt -I$(PLATFORM_SRC)/npt
|
||||
endif
|
||||
# Is the shared agent_util code needed
|
||||
ifneq ($(DEMO_NEEDS_AGENT_UTIL),)
|
||||
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/agent_util.c
|
||||
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/agent_util.h
|
||||
endif
|
||||
# Is the shared java_crw_demo code needed
|
||||
ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),)
|
||||
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/java_crw_demo.c
|
||||
DEMO_FULL_SOURCES += $(DEMO_BUILD_SRCDIR)/java_crw_demo.h
|
||||
endif
|
||||
# All the native object files we need to build the library
|
||||
DEMO_OBJECTS += $(DEMO_C_SRC_FILES:%.c=%.$(OBJECT_SUFFIX)) \
|
||||
$(DEMO_CPP_SRC_FILES:%.cpp=%.$(OBJECT_SUFFIX))
|
||||
# Linking is special depending on whether we had C++ code or on windows
|
||||
DEMO_NEEDS_CPP = $(strip $(DEMO_CPP_SRC_FILES))
|
||||
CPPFLAGS += $(DEMO_CPPFLAGS)
|
||||
ifeq ($(PLATFORM),windows)
|
||||
# Note: This is a link with cl.exe, not link.exe, options differ quite
|
||||
# bit between them.
|
||||
LINK.demo = $(LINK.c)
|
||||
LDLIBS.demo = $(EXTRA_LIBS) $(LFLAGS_$(COMPILER_VERSION))
|
||||
DEMO_VERSION_INFO = $(OBJDIR)/$(LIBRARY).res
|
||||
LDLIBS.demo += $(DEMO_VERSION_INFO)
|
||||
else
|
||||
ifneq ($(DEMO_NEEDS_CPP),)
|
||||
LINK.demo = $(LINK.cpp)
|
||||
LDLIBS.demo = $(LIBCXX)
|
||||
ifeq ($(PLATFORM),solaris)
|
||||
LDLIBS.demo += -lc
|
||||
endif
|
||||
else
|
||||
LINK.demo = $(LINK.c)
|
||||
LDLIBS.demo = $(LDLIBS)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Files that are considered resources (need to be in the jar file)
|
||||
DEMO_RESOURCES += $(filter-out %.java,$(DEMO_ALL_FILES))
|
||||
|
||||
# All destination files (top level readme files and all sources)
|
||||
# Note: We exclude the topfiles from the src tree.
|
||||
DEMO_DEST_TOPFILES = $(DEMO_TOPFILES:%=$(DEMO_DESTDIR)/%)
|
||||
DEMO_FILTERED_SOURCES = $(filter-out $(DEMO_TOPFILES),$(DEMO_ALL_FILES))
|
||||
DEMO_FULL_SOURCES += $(DEMO_FILTERED_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%)
|
||||
|
||||
# Default rule
|
||||
all: build demo_info
|
||||
|
||||
# Used to populate the destination directories
|
||||
$(DEMO_DESTDIR)/%: $(DEMO_ROOT)/%
|
||||
$(install-file)
|
||||
ifneq ($(DEMO_SRCDIR),$(DEMO_ROOT))
|
||||
$(DEMO_DESTDIR)/%: $(DEMO_SRCDIR)/%
|
||||
$(install-file)
|
||||
endif
|
||||
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/%
|
||||
$(install-file)
|
||||
ifdef DEMO_PSRCDIR
|
||||
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_PSRCDIR)/%
|
||||
$(install-file)
|
||||
endif
|
||||
ifdef DEMO_EXTRA_SRCDIR
|
||||
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_EXTRA_SRCDIR)/%
|
||||
$(install-file)
|
||||
endif
|
||||
ifneq ($(DEMO_NEEDS_AGENT_UTIL),)
|
||||
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../agent_util/%
|
||||
$(install-file)
|
||||
endif
|
||||
ifneq ($(DEMO_NEEDS_JAVA_CRW_DEMO),)
|
||||
$(DEMO_BUILD_SRCDIR)/%: $(DEMO_SRCDIR)/../java_crw_demo/%
|
||||
$(install-file)
|
||||
endif
|
||||
|
||||
# Jar manifest file
|
||||
MAINMANIFEST = $(JDK_TOPDIR)/make/tools/manifest.mf
|
||||
$(DEMO_MANIFEST): $(MAINMANIFEST)
|
||||
@$(prep-target)
|
||||
$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
|
||||
-e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" \
|
||||
$(MAINMANIFEST) >> $@
|
||||
$(ECHO) "Main-Class: $(DEMO_MAINCLASS)" >> $@
|
||||
ifdef DEMO_MANIFEST_ATTR
|
||||
$(ECHO) "$(DEMO_MANIFEST_ATTR)" >> $@
|
||||
endif
|
||||
|
||||
# Populating the jar image directory
|
||||
$(DEMO_JAR_IMAGE)/%: $(DEMO_SRCDIR)/%
|
||||
$(install-file)
|
||||
ifdef DEMO_PSRCDIR
|
||||
$(DEMO_JAR_IMAGE)/%: $(DEMO_PSRCDIR)/%
|
||||
$(install-file)
|
||||
endif
|
||||
ifdef DEMO_EXTRA_SRCDIR
|
||||
$(DEMO_JAR_IMAGE)/%: $(DEMO_EXTRA_SRCDIR)/%
|
||||
$(install-file)
|
||||
endif
|
||||
ifdef DEMO_DESCRIPTOR
|
||||
$(DEMO_JAR_IMAGE)/META-INF/services/$(DEMO_DESCRIPTOR): \
|
||||
$(DEMO_SRCDIR)/$(DEMO_DESCRIPTOR)
|
||||
$(install-file)
|
||||
endif
|
||||
|
||||
# If we are creating a jar file (we have java code)
|
||||
ifdef DEMO_JAR
|
||||
|
||||
# Input file for javac
|
||||
$(DEMO_JAVAC_INPUT): $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%)
|
||||
@$(prep-target)
|
||||
@for i in $(DEMO_JAVA_SOURCES) ; do \
|
||||
$(ECHO) "$(DEMO_BUILD_SRCDIR)/$$i" >> $@ ; \
|
||||
done
|
||||
|
||||
# Jar file creation
|
||||
$(DEMO_JAR): \
|
||||
$(DEMO_JAVAC_INPUT) \
|
||||
$(DEMO_MANIFEST) \
|
||||
$(DEMO_DESCRIPTOR:%=$(DEMO_JAR_IMAGE)/META-INF/services/%) \
|
||||
$(DEMO_RESOURCES:%=$(DEMO_JAR_IMAGE)/%)
|
||||
@$(prep-target)
|
||||
$(MKDIR) -p $(DEMO_JAR_IMAGE)
|
||||
$(JAVAC_CMD) -d $(DEMO_JAR_IMAGE) -sourcepath $(DEMO_BUILD_SRCDIR) \
|
||||
@$(DEMO_JAVAC_INPUT)
|
||||
ifeq ($(DEMO_INCL_SRC),true)
|
||||
$(CP) $(DEMO_JAVA_SOURCES:%=$(DEMO_BUILD_SRCDIR)/%) $(DEMO_JAR_IMAGE)
|
||||
endif
|
||||
ifeq ($(DEMO_ONLY_SRC),true)
|
||||
$(RM) -r $(DEMO_JAR_IMAGE)
|
||||
$(MKDIR) -p $(DEMO_JAR_IMAGE)
|
||||
$(CP) -r $(DEMO_BUILD_SRCDIR)/* $(DEMO_JAR_IMAGE)
|
||||
ifneq ($(DEMO_TOPFILES),)
|
||||
$(CP) $(DEMO_ROOT)/$(DEMO_TOPFILES) $(DEMO_JAR_IMAGE)
|
||||
endif
|
||||
endif
|
||||
$(BOOT_JAR_CMD) -cfm $@ $(DEMO_MANIFEST) \
|
||||
-C $(DEMO_JAR_IMAGE) . \
|
||||
$(BOOT_JAR_JFLAGS)
|
||||
@$(java-vm-cleanup)
|
||||
|
||||
endif
|
||||
|
||||
ifndef DEMO_SKIP_SRCZIP
|
||||
# Create a src.zip file
|
||||
$(DEMO_BUILD_SRCZIP): $(DEMO_FULL_SOURCES)
|
||||
@$(prep-target)
|
||||
$(CD) $(DEMO_BUILD_AREA)/src && $(ZIPEXE) -q -r ../$(@F) .
|
||||
|
||||
# Install the destination src.zip file and create the src tree
|
||||
$(DEMO_SOURCE_ZIP): $(DEMO_BUILD_SRCZIP)
|
||||
$(install-file)
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),windows)
|
||||
# JDK name required here
|
||||
RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
|
||||
/D "JDK_INTERNAL_NAME=$(LIBRARY)" \
|
||||
/D "JDK_FTYPE=0x2L"
|
||||
endif
|
||||
|
||||
# Native library building
|
||||
ifdef DEMO_LIBRARY
|
||||
|
||||
# Full paths to object files
|
||||
DEMO_FULL_OBJECTS = $(DEMO_OBJECTS:%=$(OBJDIR)/%)
|
||||
VPATH=
|
||||
|
||||
# Native compile rules
|
||||
$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.c
|
||||
@$(prep-target)
|
||||
$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$@ $<
|
||||
ifneq ($(DEMO_NEEDS_CPP),)
|
||||
$(OBJDIR)/%.$(OBJECT_SUFFIX): $(DEMO_BUILD_SRCDIR)/%.cpp
|
||||
@$(prep-target)
|
||||
$(COMPILE.cpp) $(CC_OBJECT_OUTPUT_FLAG)$@ $<
|
||||
endif
|
||||
|
||||
# Actual creation of the native shared library (C++ and C are different)
|
||||
$(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS)
|
||||
@$(prep-target)
|
||||
ifeq ($(PLATFORM),windows)
|
||||
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE)
|
||||
$(LINK.demo) $(SHARED_LIBRARY_FLAG) -Fe$@ \
|
||||
$(DEMO_FULL_OBJECTS) $(LDLIBS.demo)
|
||||
else
|
||||
$(LINK.demo) $(SHARED_LIBRARY_FLAG) -o $@ \
|
||||
$(DEMO_FULL_OBJECTS) $(LDLIBS.demo)
|
||||
endif
|
||||
@$(call binary_file_verification,$@)
|
||||
|
||||
# Generation of any javah include file, make sure objects are dependent on it
|
||||
ifdef DEMO_NATIVECLASS
|
||||
$(DEMO_JAVAH_FILE): $(DEMO_JAR)
|
||||
@$(prep-target)
|
||||
$(JAVAH_CMD) -d $(DEMO_BUILD_SRCDIR) -classpath $(DEMO_JAR) \
|
||||
$(DEMO_NATIVECLASS)
|
||||
@$(java-vm-cleanup)
|
||||
$(DEMO_FULL_OBJECTS): $(DEMO_JAVAH_FILE)
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
# Build involves populating the destination "src" tree, building the jar and
|
||||
# native library, and creating a source bundle
|
||||
|
||||
sources: $(DEMO_FULL_SOURCES)
|
||||
@$(ECHO) "Created $@"
|
||||
|
||||
objects:
|
||||
@$(ECHO) "Created $@"
|
||||
|
||||
# Why the nested make here? It only works this way, don't know why.
|
||||
bundles: $(DEMO_BUILD_SRCZIP)
|
||||
$(RM) -r $(DEMO_DESTDIR)
|
||||
$(MKDIR) -p $(DEMO_DESTDIR)
|
||||
$(MAKE) $(DEMO_LIBRARY) $(DEMO_JAR) $(DEMO_SOURCE_ZIP) $(DEMO_DEST_TOPFILES)
|
||||
# Applets are special, no jar file, no src.zip, everything expanded.
|
||||
ifdef DEMO_IS_APPLET
|
||||
@$(ECHO) "Expanding jar file into demos area at $(DEMO_DESTDIR)"
|
||||
( $(CD) $(DEMO_DESTDIR) && \
|
||||
$(BOOT_JAR_CMD) -xfv $(DEMO_JAR_NAME) \
|
||||
$(BOOT_JAR_JFLAGS) && \
|
||||
$(RM) -r META-INF $(DEMO_JAR_NAME) && \
|
||||
$(java-vm-cleanup) )
|
||||
@( $(CD) $(DEMO_DESTDIR) && $(java-vm-cleanup) )
|
||||
@$(ECHO) "Expanding source into demos area at $(DEMO_DESTDIR)"
|
||||
( $(CD) $(DEMO_DESTDIR) && $(UNZIP) -o src.zip && $(RM) src.zip )
|
||||
endif
|
||||
|
||||
build: sources bundles
|
||||
|
||||
# Printing out a demo information line
|
||||
define printDemoSetting
|
||||
if [ "$2" != "" ] ; then $(PRINTF) "%-20s %s\n" "$1:" "$2"; fi
|
||||
endef
|
||||
|
||||
# Print out the demo information
|
||||
demo_info:
|
||||
@$(ECHO) "========================================================="
|
||||
@$(call printDemoSetting,DEMONAME,$(DEMONAME))
|
||||
@$(call printDemoSetting,DEMO_ROOT,$(DEMO_ROOT))
|
||||
@$(call printDemoSetting,DEMO_SRCDIR,$(DEMO_SRCDIR))
|
||||
@$(call printDemoSetting,DEMO_DESTDIR,$(DEMO_DESTDIR))
|
||||
@$(call printDemoSetting,DEMO_JAR,$(DEMO_JAR))
|
||||
@$(call printDemoSetting,DEMO_MANIFEST_ATTR,$(DEMO_MANIFEST_ATTR))
|
||||
@$(call printDemoSetting,DEMO_PSRCDIR,$(DEMO_PSRCDIR))
|
||||
@$(call printDemoSetting,DEMO_EXTRA_SRCDIR,$(DEMO_EXTRA_SRCDIR))
|
||||
@$(call printDemoSetting,DEMO_EXTRA_FILES,$(DEMO_EXTRA_FILES))
|
||||
@$(call printDemoSetting,DEMO_TOPFILES,$(DEMO_TOPFILES))
|
||||
@$(call printDemoSetting,DEMO_MAINCLASS,$(DEMO_MAINCLASS))
|
||||
@$(call printDemoSetting,DEMO_DESCRIPTOR,$(DEMO_DESCRIPTOR))
|
||||
@$(call printDemoSetting,DEMO_NATIVECLASS,$(DEMO_NATIVECLASS))
|
||||
@$(call printDemoSetting,DEMO_LIBRARY,$(DEMO_LIBRARY))
|
||||
@$(call printDemoSetting,DEMO_OBJECTS,$(DEMO_OBJECTS))
|
||||
@$(call printDemoSetting,DEMO_SOURCE_ZIP,$(DEMO_SOURCE_ZIP))
|
||||
@$(ECHO) "========================================================="
|
||||
|
||||
# Clean rule
|
||||
clean clobber:
|
||||
$(RM) -r $(DEMO_BUILD_AREA)
|
||||
$(RM) -r $(DEMO_DESTDIR)
|
||||
|
||||
# This should not be needed, but some versions of GNU make have a bug that
|
||||
# sometimes deleted these files for some strange and unknown reason
|
||||
# (GNU make version 3.78.1 has the problem, GNU make version 3.80 doesn't?)
|
||||
.PRECIOUS: $(DEMO_FULL_SOURCES) $(DEMO_BUILD_SRCZIP) $(DEMO_SOURCE_ZIP)
|
||||
|
||||
# List phony targets
|
||||
.PHONY: all build clean clobber demo_info \
|
||||
sources bundles
|
||||
|
@ -1,326 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Generic makefile for building shared libraries.
|
||||
#
|
||||
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
include $(JDK_TOPDIR)/makefiles/common/Classes.gmk
|
||||
|
||||
#
|
||||
# It is important to define these *after* including Classes.gmk
|
||||
# in order to override the values defined inthat makefile.
|
||||
#
|
||||
|
||||
ifeq ($(LIBRARY), fdlibm)
|
||||
ifeq ($(PLATFORM),windows)
|
||||
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(FDDLIBM_SUFFIX)
|
||||
ACTUAL_LIBRARY_DIR = $(OBJDIR)
|
||||
else # PLATFORM
|
||||
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(ARCH).$(FDDLIBM_SUFFIX)
|
||||
ACTUAL_LIBRARY_DIR = $(OBJDIR)
|
||||
endif #PLATFORM
|
||||
else # LIBRARY
|
||||
ACTUAL_LIBRARY_NAME = $(LIB_PREFIX)$(LIBRARY).$(LIBRARY_SUFFIX)
|
||||
ACTUAL_LIBRARY_DIR = $(LIB_LOCATION)
|
||||
endif
|
||||
ACTUAL_LIBRARY = $(ACTUAL_LIBRARY_DIR)/$(ACTUAL_LIBRARY_NAME)
|
||||
|
||||
library:: $(ACTUAL_LIBRARY)
|
||||
|
||||
FILES_o = $(patsubst %.c, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
|
||||
FILES_o += $(patsubst %.s, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_s))))
|
||||
FILES_o += $(patsubst %.cpp, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
|
||||
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
FILES_o += $(patsubst %.m, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objc))))
|
||||
FILES_o += $(patsubst %.mm, %.$(OBJECT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_objcpp))))
|
||||
|
||||
INCREMENTAL_BUILD=false
|
||||
|
||||
endif # PLATFORM
|
||||
|
||||
ifeq ($(INCREMENTAL_BUILD),true)
|
||||
FILES_d = $(patsubst %.c, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
|
||||
FILES_d += $(patsubst %.cpp, %.$(DEPEND_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_cpp))))
|
||||
endif # INCREMENTAL_BUILD
|
||||
|
||||
ifeq ($(PLATFORM),solaris)
|
||||
# List of all lint files, one for each .c file (only for C)
|
||||
FILES_ln = $(patsubst %.c, %.$(LINT_SUFFIX), $(addprefix $(OBJDIR)/, $(notdir $(FILES_c))))
|
||||
endif
|
||||
|
||||
LINK.cc = $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
LINK.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
|
||||
|
||||
#
|
||||
# C++ libraries must be linked with CC.
|
||||
#
|
||||
ifdef CPLUSPLUSLIBRARY
|
||||
LINKER=$(LINK.cc)
|
||||
else
|
||||
LINKER=$(LINK.c)
|
||||
endif
|
||||
|
||||
$(ACTUAL_LIBRARY):: $(INIT) $(TEMPDIR) $(LIBDIR) $(BINDIR) $(EXTDIR) classheaders
|
||||
@$(ECHO) Building lib:$(ACTUAL_LIBRARY)
|
||||
#
|
||||
# COMPILE_APPROACH: Different approaches to compile up the native object
|
||||
# files as quickly as possible.
|
||||
# The setting of parallel works best on Unix, batch on Windows.
|
||||
#
|
||||
|
||||
COMPILE_FILES_o = $(OBJDIR)/.files_compiled
|
||||
$(COMPILE_FILES_o): $(FILES_d) $(FILES_o)
|
||||
@$(ECHO) "$<" >> $@
|
||||
clean::
|
||||
$(RM) $(COMPILE_FILES_o)
|
||||
|
||||
#
|
||||
# COMPILE_APPROACH=parallel: Will trigger compilations (just compilations) to
|
||||
# happen in parallel. Greatly decreases Unix build time, even on single CPU
|
||||
# machines, more so on multiple CPU machines. Default is 2 compiles
|
||||
# at a time, but can be adjusted with ALT_PARALLEL_COMPILE_JOBS.
|
||||
# Note that each .d file will also be dependent on it's .o file, see
|
||||
# Rules.gmk.
|
||||
# Note this does not depend on Rules.gmk to work like batch (below)
|
||||
# and this technique doesn't seem to help Windows build time nor does
|
||||
# it work very well, it's possible the Windows Visual Studio compilers
|
||||
# don't work well in a parallel situation, this needs investigation.
|
||||
#
|
||||
|
||||
ifeq ($(COMPILE_APPROACH),parallel)
|
||||
|
||||
.PHONY: library_parallel_compile
|
||||
|
||||
library_parallel_compile:
|
||||
@$(ECHO) "Begin parallel compiles: $(shell $(PWD))"
|
||||
$(MAKE) -j $(PARALLEL_COMPILE_JOBS) $(COMPILE_FILES_o)
|
||||
@$(ECHO) "Done with parallel compiles: $(shell $(PWD))"
|
||||
|
||||
$(ACTUAL_LIBRARY):: library_parallel_compile
|
||||
|
||||
endif
|
||||
|
||||
#
|
||||
# COMPILE_APPROACH=batch: Will trigger compilations (just compilations) to
|
||||
# happen in batch mode. Greatly decreases Windows build time.
|
||||
# See logic in Rules.gmk for how compiles happen, the $(MAKE) in
|
||||
# library_batch_compile below triggers the actions in Rules.gmk.
|
||||
# Note that each .d file will also be dependent on it's .o file, see
|
||||
# Rules.gmk.
|
||||
#
|
||||
ifeq ($(COMPILE_APPROACH),batch)
|
||||
|
||||
.PHONY: library_batch_compile
|
||||
|
||||
library_batch_compile:
|
||||
@$(ECHO) "Begin BATCH compiles: $(shell $(PWD))"
|
||||
$(MAKE) $(COMPILE_FILES_o)
|
||||
$(MAKE) batch_compile
|
||||
@$(ECHO) "Done with BATCH compiles: $(shell $(PWD))"
|
||||
$(MAKE) COMPILE_APPROACH=normal $(COMPILE_FILES_o)
|
||||
|
||||
$(ACTUAL_LIBRARY):: library_batch_compile
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
|
||||
#
|
||||
# Library building rules.
|
||||
#
|
||||
|
||||
$(LIBRARY).lib:: $(OBJDIR)
|
||||
|
||||
ifeq ($(LIBRARY), fdlibm)
|
||||
$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lib
|
||||
|
||||
$(OBJDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lcf
|
||||
@$(prep-target)
|
||||
$(AR) -NODEFAULTLIB:MSVCRT -out:$@ -nologo \
|
||||
@$(OBJDIR)/$(LIBRARY).lcf $(OTHER_LCF) $(LDLIBS_COMMON)
|
||||
else # LIBRARY
|
||||
# build it into $(OBJDIR) so that the other generated files get put
|
||||
# there, then copy just the DLL (and MAP file) to the requested directory.
|
||||
#
|
||||
$(ACTUAL_LIBRARY):: $(OBJDIR)/$(LIBRARY).lcf
|
||||
@$(prep-target)
|
||||
@$(MKDIR) -p $(OBJDIR)
|
||||
$(LD) -dll -out:$(OBJDIR)/$(@F) \
|
||||
-map:$(OBJDIR)/$(LIBRARY).map \
|
||||
$(LFLAGS) @$(OBJDIR)/$(LIBRARY).lcf \
|
||||
$(OTHER_LCF) $(LDLIBS)
|
||||
$(CP) $(OBJDIR)/$(@F) $@
|
||||
@$(call binary_file_verification,$@)
|
||||
$(CP) $(OBJDIR)/$(LIBRARY).map $(@D)
|
||||
$(CP) $(OBJDIR)/$(LIBRARY).pdb $(@D)
|
||||
|
||||
endif # LIBRARY
|
||||
|
||||
$(OBJDIR)/$(LIBRARY).lcf: $(OBJDIR)/$(LIBRARY).res $(COMPILE_FILES_o) $(FILES_m)
|
||||
@$(prep-target)
|
||||
@$(MKDIR) -p $(TEMPDIR)
|
||||
@$(ECHO) $(FILES_o) > $@
|
||||
ifndef LOCAL_RESOURCE_FILE
|
||||
@$(ECHO) $(OBJDIR)/$(LIBRARY).res >> $@
|
||||
endif
|
||||
@$(ECHO) Created $@
|
||||
|
||||
# JDK name required here
|
||||
RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
|
||||
/D "JDK_INTERNAL_NAME=$(LIBRARY)" \
|
||||
/D "JDK_FTYPE=0x2L"
|
||||
|
||||
$(OBJDIR)/$(LIBRARY).res: $(VERSIONINFO_RESOURCE)
|
||||
ifndef LOCAL_RESOURCE_FILE
|
||||
@$(prep-target)
|
||||
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
|
||||
endif
|
||||
|
||||
#
|
||||
# Install a .lib file if required.
|
||||
#
|
||||
ifeq ($(INSTALL_DOT_LIB), true)
|
||||
$(ACTUAL_LIBRARY):: $(LIBDIR)/$(LIBRARY).lib
|
||||
|
||||
clean::
|
||||
-$(RM) $(LIBDIR)/$(LIBRARY).lib
|
||||
|
||||
$(LIBDIR)/$(LIBRARY).lib:: $(OBJDIR)/$(LIBRARY).lib
|
||||
$(install-file)
|
||||
|
||||
$(LIBDIR)/$(LIBRARY).dll:: $(OBJDIR)/$(LIBRARY).dll
|
||||
$(install-file)
|
||||
|
||||
endif # INSTALL_DOT_LIB
|
||||
|
||||
else # PLATFORM
|
||||
|
||||
#
|
||||
# On Solaris, use mcs to write the version into the comment section of
|
||||
# the shared library. On other platforms set this to false at the
|
||||
# make command line.
|
||||
#
|
||||
|
||||
ifneq ($(PLATFORM), macosx)
|
||||
ARFLAGS = -r
|
||||
endif
|
||||
|
||||
$(ACTUAL_LIBRARY):: $(COMPILE_FILES_o) $(FILES_m) $(FILES_reorder)
|
||||
@$(prep-target)
|
||||
@$(ECHO) "STATS: LIBRARY=$(LIBRARY), PRODUCT=$(PRODUCT), OPTIMIZATION_LEVEL=$(OPTIMIZATION_LEVEL)"
|
||||
@$(ECHO) "Rebuilding $@ because of $?"
|
||||
ifeq ($(LIBRARY), fdlibm)
|
||||
$(AR) $(ARFLAGS) $@ $(FILES_o)
|
||||
else # LIBRARY
|
||||
$(LINKER) $(SHARED_LIBRARY_FLAG) -o $@ $(FILES_o) $(LDLIBS)
|
||||
@$(call binary_file_verification,$@)
|
||||
ifeq ($(WRITE_LIBVERSION),true)
|
||||
$(MCS) -d -a "$(FULL_VERSION)" $@
|
||||
endif # WRITE_LIBVERSION
|
||||
endif # LIBRARY
|
||||
|
||||
endif # PLATFORM
|
||||
|
||||
#
|
||||
# Cross check all linted files against each other
|
||||
#
|
||||
ifeq ($(PLATFORM),solaris)
|
||||
lint.errors : $(FILES_ln)
|
||||
$(LINT.c) $(FILES_ln) $(LDLIBS)
|
||||
endif
|
||||
|
||||
#
|
||||
# Class libraries with JNI native methods get a include to the package.
|
||||
#
|
||||
ifdef PACKAGE
|
||||
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
|
||||
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)
|
||||
OTHER_INCLUDES += -I$(SHARE_SRC)/native/common -I$(PLATFORM_SRC)/native/common
|
||||
OTHER_INCLUDES += -I$(SHARE_SRC)/native/$(PKGDIR) \
|
||||
-I$(PLATFORM_SRC)/native/$(PKGDIR)
|
||||
endif
|
||||
|
||||
#
|
||||
# Clean/clobber rules
|
||||
#
|
||||
clean::
|
||||
$(RM) -r $(ACTUAL_LIBRARY)
|
||||
|
||||
clobber:: clean
|
||||
|
||||
#
|
||||
# INCREMENTAL_BUILD means that this workspace will be built over and over
|
||||
# possibly incrementally. This means tracking the object file dependencies
|
||||
# on include files so that sources get re-compiled when the include files
|
||||
# change. When building from scratch and doing a one time build (like
|
||||
# release engineering or nightly builds) set INCREMENTAL_BUILD=false.
|
||||
#
|
||||
|
||||
ifeq ($(INCREMENTAL_BUILD),true)
|
||||
|
||||
#
|
||||
# Workaround: gnumake sometimes says files is empty when it shouldn't
|
||||
# was: files := $(foreach file, $(wildcard $(OBJDIR)/*.$(DEPEND_SUFFIX)), $(file))
|
||||
#
|
||||
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
|
||||
|
||||
#
|
||||
# Only include these files if we have any.
|
||||
#
|
||||
ifneq ($(strip $(files)),)
|
||||
|
||||
include $(files)
|
||||
|
||||
endif # files
|
||||
|
||||
endif # INCREMENTAL_BUILD
|
||||
|
||||
#
|
||||
# Default dependencies
|
||||
#
|
||||
|
||||
all: build
|
||||
|
||||
build: library
|
||||
|
||||
debug:
|
||||
$(MAKE) VARIANT=DBG build
|
||||
|
||||
fastdebug:
|
||||
$(MAKE) VARIANT=DBG FASTDEBUG=true build
|
||||
|
||||
openjdk:
|
||||
$(MAKE) OPENJDK=true build
|
||||
|
||||
FORCE:
|
||||
|
||||
.PHONY: all build debug fastdebug
|
||||
|
@ -1,97 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1998, 2005, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Makefile for linking with mapfiles.
|
||||
#
|
||||
# NOTE: Not using a mapfile will expose all your extern functions and
|
||||
# extern data symbols as part of your interface, so unless your
|
||||
# extern names are safe from being mistaken as names from other
|
||||
# libraries, you better use a mapfile, or use a unique naming
|
||||
# convention on all your extern symbols.
|
||||
#
|
||||
# The mapfile will establish versioning by defining the exported interface.
|
||||
#
|
||||
# The mapfile can also force certain .o files or elf sections into the
|
||||
# the different segments of the resulting library/program image.
|
||||
#
|
||||
# The macro FILES_m can contain any number of mapfiles.
|
||||
#
|
||||
|
||||
# Always make sure 'all' is the default rule
|
||||
mapfile_default_rule: all
|
||||
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
|
||||
ifeq ($(VARIANT), OPT)
|
||||
# OPT build MUST have a mapfile?
|
||||
ifndef FILES_m
|
||||
FILES_m = mapfile-vers
|
||||
endif
|
||||
|
||||
# If we are re-ordering functions in this solaris library, we need to make
|
||||
# sure that -xF is added to the compile lines. This option is critical and
|
||||
# enables the functions to be reordered.
|
||||
ifdef FILES_reorder
|
||||
CFLAGS_OPT += -xF
|
||||
CXXFLAGS_OPT += -xF
|
||||
endif
|
||||
|
||||
INIT += $(TEMPDIR)/mapfile-vers
|
||||
|
||||
$(TEMPDIR)/mapfile-vers : $(FILES_m) $(FILES_reorder)
|
||||
$(prep-target)
|
||||
$(CAT) $(FILES_m) > $@
|
||||
ifdef FILES_reorder
|
||||
$(SED) -e 's=OUTPUTDIR=$(OUTPUTDIR)=' $(FILES_reorder) >> $@
|
||||
endif
|
||||
endif # VARIANT
|
||||
|
||||
ifndef LDNOMAP
|
||||
LDMAPFLAGS_OPT = -M$(TEMPDIR)/mapfile-vers
|
||||
LDMAPFLAGS_DBG = $(FILES_m:%=-M%)
|
||||
endif
|
||||
|
||||
endif # PLATFORM
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
|
||||
ifeq ($(VARIANT), OPT)
|
||||
# OPT build MUST have a mapfile?
|
||||
ifndef FILES_m
|
||||
FILES_m = mapfile-vers
|
||||
endif
|
||||
endif # VARIANT
|
||||
|
||||
ifndef LDNOMAP
|
||||
LDMAPFLAGS_OPT = $(FILES_m:%=-Xlinker -version-script=%)
|
||||
LDMAPFLAGS_DBG = $(FILES_m:%=-Xlinker -version-script=%)
|
||||
endif
|
||||
|
||||
endif # PLATFORM
|
||||
|
||||
LDFLAGS_OPT += $(LDMAPFLAGS_OPT)
|
||||
LDFLAGS_DBG += $(LDMAPFLAGS_DBG)
|
||||
|
@ -1,479 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2009, 2010, 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.
|
||||
#
|
||||
|
||||
JDK_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jdk-module-image
|
||||
JRE_MODULE_IMAGE_DIR = $(ABS_OUTPUTDIR)/jre-module-image
|
||||
|
||||
#
|
||||
# modules Target to build jdk and jre module image
|
||||
#
|
||||
# There is one jar file per module containing classes only.
|
||||
# All module jars are currently placed under jre/lib directory.
|
||||
#
|
||||
# Open issues that need further investigation:
|
||||
# 1. Classes in jre/lib/ext/dnsns.jar are currently put in jre/lib/jndi-dns
|
||||
# module. META-INF/services file is not installed.
|
||||
# 2. Signed jars
|
||||
# For JDK build, signed jars are copied to the build.
|
||||
# All jars in the module image are unsigned.
|
||||
|
||||
MODULE_IMAGEBINDIR = bin
|
||||
|
||||
#
|
||||
# Targets.
|
||||
#
|
||||
INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre
|
||||
INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
INITIAL_MODULE_IMAGE_JRE=initial-module-image-jre-sol64
|
||||
INITIAL_MODULE_IMAGE_JDK=initial-module-image-jdk-sol64
|
||||
endif
|
||||
endif
|
||||
|
||||
modules modules-clobber \
|
||||
initial-module-image-jre initial-module-image-jdk \
|
||||
initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
|
||||
trim-module-image-jre trim-module-image-jdk \
|
||||
process-module-image-jre process-module-image-jdk ::
|
||||
@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
|
||||
|
||||
# Order is important here, trim jre after jdk image is created
|
||||
modules:: gen-modules \
|
||||
$(INITIAL_MODULE_IMAGE_JRE) $(INITIAL_MODULE_IMAGE_JDK) \
|
||||
trim-module-image-jre trim-module-image-jdk \
|
||||
process-module-image-jre process-module-image-jdk
|
||||
|
||||
# Don't use these
|
||||
module-image-jre:: initial-module-image-jre trim-module-image-jre process-module-image-jre
|
||||
module-image-jdk:: initial-module-image-jdk trim-module-image-jdk process-module-image-jdk
|
||||
|
||||
#
|
||||
# Paths to these files we need
|
||||
JDK_MODULE_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%)
|
||||
JDK_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%64)
|
||||
JDK_MODULE_DOCFILES = $(OTHER_DOCLIST_JDK:%=$(JDK_MODULE_IMAGE_DIR)/%)
|
||||
|
||||
JRE_MODULE_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%)
|
||||
JRE_MODULE_64_LICENSES = $(LICENSE_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%64)
|
||||
JRE_MODULE_DOCFILES = $(OTHER_DOCLIST_JRE:%=$(JRE_MODULE_IMAGE_DIR)/%)
|
||||
JRE_MODULE_DOCFILES += $(JRE_NAMECHANGE_DOCLIST:%=$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX))
|
||||
|
||||
###### RULES
|
||||
|
||||
# JDK files
|
||||
$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%
|
||||
$(process-doc-file)
|
||||
# Removes LICENSE_VERSION or not
|
||||
ifdef LICENSE_VERSION
|
||||
$(JDK_MODULE_IMAGE_DIR)/%: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION)
|
||||
$(process-doc-file)
|
||||
$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%$(LICENSE_VERSION)
|
||||
$(process-doc-file)
|
||||
else
|
||||
$(JDK_MODULE_IMAGE_DIR)/%64: $(SHARE_JDK_DOC_SRC)/%
|
||||
$(process-doc-file)
|
||||
endif
|
||||
|
||||
# JRE files
|
||||
$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%
|
||||
$(process-doc-file)
|
||||
# Add $(TEXT_SUFFIX) suffix
|
||||
ifdef TEXT_SUFFIX
|
||||
$(JRE_MODULE_IMAGE_DIR)/%$(TEXT_SUFFIX): $(SHARE_JRE_DOC_SRC)/%
|
||||
$(process-doc-file)
|
||||
endif
|
||||
# Removes LICENSE_VERSION or not
|
||||
ifdef LICENSE_VERSION
|
||||
$(JRE_MODULE_IMAGE_DIR)/%: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION)
|
||||
$(process-doc-file)
|
||||
$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%$(LICENSE_VERSION)
|
||||
$(process-doc-file)
|
||||
else
|
||||
$(JRE_MODULE_IMAGE_DIR)/%64: $(SHARE_JRE_DOC_SRC)/%
|
||||
$(process-doc-file)
|
||||
endif
|
||||
|
||||
######################################################
|
||||
# JRE Image
|
||||
######################################################
|
||||
|
||||
MODULES_LIST = $(MODULES_TEMPDIR)/classlist/modules.list
|
||||
|
||||
# Modules in the jre/lib/security directory
|
||||
POLICY_MODULES = US_export_policy local_policy
|
||||
|
||||
# Modules in the modules/ext directory
|
||||
EXT_MODULES = localedata security-sunec security-sunjce
|
||||
|
||||
# Build PKCS#11 on all platforms except 64-bit Windows.
|
||||
PKCS11 = security-sunpkcs11
|
||||
ifeq ($(ARCH_DATA_MODEL), 64)
|
||||
ifeq ($(PLATFORM), windows)
|
||||
PKCS11 =
|
||||
endif
|
||||
endif
|
||||
|
||||
EXT_MODULES += $(PKCS11)
|
||||
|
||||
# Build Microsoft CryptoAPI provider only on (non-64-bit) Windows platform.
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifneq ($(ARCH_DATA_MODEL), 64)
|
||||
EXT_MODULES += security-sunmscapi
|
||||
endif
|
||||
endif
|
||||
|
||||
# Modules for JDK only
|
||||
JDK_MODULES = tools
|
||||
|
||||
gen-modules:
|
||||
$(CD) modules; $(MAKE) all
|
||||
|
||||
initial-module-image-jre-setup:
|
||||
$(RM) -r $(JRE_MODULE_IMAGE_DIR)
|
||||
$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)
|
||||
|
||||
# 64-bit solaris jre image contains only the 64-bit add-on files.
|
||||
initial-module-image-jre-sol64:: initial-module-image-jre-setup \
|
||||
$(JRE_MODULE_LICENSES) $(JRE_MODULE_64_LICENSES)
|
||||
@# Use tar instead of cp to preserve the symbolic links
|
||||
for dir in bin lib ; do \
|
||||
( $(CD) $(OUTPUTDIR) && \
|
||||
$(TAR) cf - `$(FIND) $$dir -name '$(ARCH)' -print` | \
|
||||
($(CD) $(JRE_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
|
||||
done
|
||||
@# Remove some files from the jre area
|
||||
for t in $(NOTJRETOOLS) ; do \
|
||||
$(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
|
||||
done
|
||||
$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl'`
|
||||
$(RM) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl'`
|
||||
|
||||
# Construct an initial jre image (initial jdk jre) no trimming or stripping
|
||||
initial-module-image-jre:: initial-module-image-jre-setup \
|
||||
$(JRE_LICENSES) $(JRE_MODULE_DOCFILES) \
|
||||
$(BUILDMETAINDEX_JARFILE)
|
||||
@# Copy in bin directory
|
||||
$(CD) $(OUTPUTDIR) && $(FIND) bin -depth | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
|
||||
@# CTE plugin security change require new empty directory lib/applet
|
||||
$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/applet
|
||||
@# Copy files but not .jar in lib directory
|
||||
$(CD) $(OUTPUTDIR) && $(FIND) lib -depth | $(EGREP) -v ".jar$$" | $(CPIO) -pdum $(JRE_MODULE_IMAGE_DIR)
|
||||
@#
|
||||
@# copy modules to jre/lib
|
||||
@#
|
||||
for m in `$(NAWK) '{print $$1}' $(MODULES_LIST)` ; do \
|
||||
$(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib ; \
|
||||
done
|
||||
$(MKDIR) -p $(JRE_MODULE_IMAGE_DIR)/lib/ext
|
||||
for m in $(EXT_MODULES) ; do \
|
||||
$(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/ext ; \
|
||||
done
|
||||
for m in $(POLICY_MODULES) ; do \
|
||||
$(MV) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar $(JRE_MODULE_IMAGE_DIR)/lib/security; \
|
||||
done
|
||||
@# Remove jdk modules
|
||||
for m in $(JDK_MODULES) ; do \
|
||||
$(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$$m.jar ; \
|
||||
done
|
||||
|
||||
@# Make sure all directories are read/execute for everyone
|
||||
$(CHMOD) a+rx `$(FIND) $(JRE_MODULE_IMAGE_DIR) -type d`
|
||||
@# Remove some files from the jre area
|
||||
for t in $(NOTJRETOOLS) ; do \
|
||||
$(RM) $(JRE_MODULE_IMAGE_DIR)/bin$(ISA_DIR)/$$t ; \
|
||||
done
|
||||
@# Remove orb.idl and ir.idl from jre
|
||||
$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'orb.idl' -exec $(RM) \{} \;
|
||||
$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -name 'ir.idl' -exec $(RM) \{} \;
|
||||
@# Generate meta-index to make boot and extension class loaders lazier
|
||||
$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
|
||||
$(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
|
||||
-o meta-index *.jar
|
||||
@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && $(java-vm-cleanup)
|
||||
$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && \
|
||||
$(BOOT_JAVA_CMD) -jar $(BUILDMETAINDEX_JARFILE) \
|
||||
-o meta-index *.jar
|
||||
@$(CD) $(JRE_MODULE_IMAGE_DIR)/lib/ext && $(java-vm-cleanup)
|
||||
ifeq ($(PLATFORM), windows)
|
||||
@# Remove certain *.lib files
|
||||
$(CD) $(JRE_MODULE_IMAGE_DIR)/lib && \
|
||||
$(RM) java.$(LIB_SUFFIX) jvm.$(LIB_SUFFIX) \
|
||||
hpi.$(LIB_SUFFIX) awt.$(LIB_SUFFIX) jawt.$(LIB_SUFFIX)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
@# The Java Kernel JRE image ships with a special VM. It is not included
|
||||
@# in the full JRE image, so remove it. Also, is it only for 32-bit windows.
|
||||
$(CD) $(JRE_MODULE_IMAGE_DIR)/bin && $(RM) -r kernel
|
||||
endif
|
||||
endif # Windows
|
||||
ifneq ($(PLATFORM), windows)
|
||||
$(call copy-man-pages,$(JRE_MODULE_IMAGE_DIR),$(JRE_MAN_PAGES))
|
||||
endif # !windows
|
||||
|
||||
# Trim out any extra files not for the jre shipment but wanted in the jdk jre.
|
||||
# (Note the jdk WILL want the jre image before this trimming)
|
||||
# Removes server VM on Windows 32bit.
|
||||
# Remove certain shared libraries that should not be in the jre image
|
||||
# but should be in the jdk jre image.
|
||||
trim-module-image-jre::
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
$(RM) -r $(JRE_MODULE_IMAGE_DIR)/bin/server
|
||||
endif
|
||||
ifdef NOTJRE_SHARED_LIBS
|
||||
for l in $(NOTJRE_SHARED_LIBS) ; do \
|
||||
$(RM) $(JRE_MODULE_IMAGE_DIR)/bin/$$l ; \
|
||||
done ;
|
||||
endif
|
||||
else # PLATFORM
|
||||
ifdef NOTJRE_SHARED_LIBS
|
||||
for l in $(NOTJRE_SHARED_LIBS) ; do \
|
||||
$(RM) $(JRE_MODULE_IMAGE_DIR)/lib/$(LIBARCH)/$$l ; \
|
||||
done ;
|
||||
endif
|
||||
endif # PLATFORM
|
||||
|
||||
# Get list of all Elf files in the jre
|
||||
JRE_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jre-elf-files.list
|
||||
$(JRE_MODULE_ELF_LIST):
|
||||
@$(prep-target)
|
||||
ifneq ($(PLATFORM), windows)
|
||||
$(RM) $@
|
||||
$(FIND) $(JRE_MODULE_IMAGE_DIR)/lib -type f -name \*.$(LIB_SUFFIX) >> $@
|
||||
$(FILE) `$(FIND) $(JRE_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
|
||||
| $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
|
||||
endif
|
||||
|
||||
# Post process the image (strips and mcs on Elf files we are shipping)
|
||||
# (Note the jdk WILL want the jre image before this processing)
|
||||
process-module-image-jre:: $(JRE_MODULE_ELF_LIST)
|
||||
ifneq ($(POST_STRIP_PROCESS), )
|
||||
for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
|
||||
$(CHMOD) u+w $${f}; \
|
||||
$(ECHO) $(POST_STRIP_PROCESS) $${f}; \
|
||||
$(POST_STRIP_PROCESS) $${f}; \
|
||||
$(CHMOD) go-w $${f}; \
|
||||
done
|
||||
endif
|
||||
ifneq ($(POST_MCS_PROCESS), )
|
||||
for f in `$(CAT) $(JRE_MODULE_ELF_LIST)`; do \
|
||||
$(CHMOD) u+w $${f}; \
|
||||
$(ECHO) $(POST_MCS_PROCESS) $${f}; \
|
||||
$(POST_MCS_PROCESS) $${f}; \
|
||||
$(CHMOD) go-w $${f}; \
|
||||
done
|
||||
endif
|
||||
$(RM) $(JRE_MODULE_ELF_LIST)
|
||||
|
||||
######################################################
|
||||
# JDK Image
|
||||
######################################################
|
||||
# Note: cpio ($(CPIO)) sometimes leaves directories without rx access.
|
||||
|
||||
initial-module-image-jdk-setup:
|
||||
$(RM) -r $(JDK_MODULE_IMAGE_DIR)
|
||||
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/jre
|
||||
($(CD) $(JRE_MODULE_IMAGE_DIR) && $(FIND) . -depth -print \
|
||||
| $(CPIO) -pdum $(JDK_MODULE_IMAGE_DIR)/jre )
|
||||
$(RM) -rf $(JDK_MODULE_IMAGE_DIR)/jre/man
|
||||
$(CHMOD) a+rx `$(FIND) $(JDK_MODULE_IMAGE_DIR) -type d`
|
||||
|
||||
initial-module-image-jdk64-bindemos:
|
||||
for dir in bin demo ; do \
|
||||
( $(CD) $(OUTPUTDIR) && \
|
||||
$(TAR) cf - `$(FIND) $$dir -name '$(LIBARCH)' -print` | \
|
||||
($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -) ) ; \
|
||||
done
|
||||
|
||||
# Solaris 64 bit image is special
|
||||
initial-module-image-jdk-sol64:: initial-module-image-jdk-setup \
|
||||
initial-module-image-jdk64-bindemos \
|
||||
$(JDK_MODULE_LICENSES) $(JDK_MODULARLIZED_64_LICENSES)
|
||||
|
||||
# DB files to add
|
||||
ifeq ($(OPENJDK),true)
|
||||
|
||||
initial-module-image-jdk-db:
|
||||
|
||||
else
|
||||
|
||||
# Create the list of db *.zip files to bundle with jdk
|
||||
ABS_DB_PATH :=$(call FullPath,$(CLOSED_SHARE_SRC)/db)
|
||||
DB_ZIP_LIST = $(shell $(LS) $(ABS_DB_PATH)/*.zip 2>/dev/null)
|
||||
|
||||
initial-module-image-jdk-db: $(DB_ZIP_LIST)
|
||||
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/db
|
||||
for d in $(DB_ZIP_LIST); do \
|
||||
($(CD) $(JDK_MODULE_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
|
||||
done
|
||||
|
||||
endif
|
||||
|
||||
# Standard jdk image
|
||||
initial-module-image-jdk:: initial-module-image-jdk-setup \
|
||||
initial-module-image-jdk-db \
|
||||
$(JDK_MODULE_LICENSES) $(JDK_MODULE_DOCFILES)
|
||||
$(MKDIR) $(JDK_MODULE_IMAGE_DIR)/lib
|
||||
@#
|
||||
@# copy jdk modules to jdk/lib
|
||||
@#
|
||||
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/lib
|
||||
for m in $(JDK_MODULES) ; do \
|
||||
$(CP) $(MODULES_DIR)/$$m/lib/$$m.jar $(JDK_MODULE_IMAGE_DIR)/lib ; \
|
||||
done
|
||||
ifeq ($(PLATFORM), windows)
|
||||
@#
|
||||
@# lib/
|
||||
@#
|
||||
$(CP) $(LIBDIR)/$(LIB_PREFIX)jvm.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
|
||||
$(CP) $(LIBDIR)/$(LIB_PREFIX)jawt.$(LIB_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/lib
|
||||
@#
|
||||
@# bin/
|
||||
@#
|
||||
@# copy all EXE files and only certain DLL files from BINDIR
|
||||
$(MKDIR) -p $(JDK_MODULE_IMAGE_DIR)/bin
|
||||
$(CP) $(BINDIR)/*$(EXE_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
|
||||
$(CP) $(BINDIR)/jli.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
|
||||
ifeq ($(COMPILER_VERSION), VS2010)
|
||||
$(CP) $(BINDIR)/msvc*100.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
|
||||
endif
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
ifeq ($(COMPILER_VERSION), VS2003)
|
||||
$(CP) $(BINDIR)/msvc*71.$(LIBRARY_SUFFIX) $(JDK_MODULE_IMAGE_DIR)/bin
|
||||
endif
|
||||
endif
|
||||
else # PLATFORM
|
||||
@#
|
||||
@# bin/
|
||||
@#
|
||||
($(CD) $(BINDIR)/.. && $(TAR) cf - \
|
||||
`$(FIND) bin \( -type f -o -type l \) -print `) | \
|
||||
($(CD) $(JDK_MODULE_IMAGE_DIR) && $(TAR) xf -)
|
||||
endif # PLATFORM
|
||||
@#
|
||||
@# lib/ct.sym
|
||||
@#
|
||||
$(MKDIR) -p $(OUTPUTDIR)/symbols/META-INF/sym
|
||||
$(JAVAC_CMD) -XDprocess.packages -proc:only \
|
||||
-processor com.sun.tools.javac.sym.CreateSymbols \
|
||||
-Acom.sun.tools.javac.sym.Jar=$(RT_JAR) \
|
||||
-Acom.sun.tools.javac.sym.Dest=$(OUTPUTDIR)/symbols/META-INF/sym/rt.jar \
|
||||
$(CORE_PKGS) $(NON_CORE_PKGS) $(EXCLUDE_PROPWARN_PKGS)
|
||||
$(BOOT_JAR_CMD) c0f $(LIBDIR)/ct.sym \
|
||||
-C $(OUTPUTDIR)/symbols META-INF $(BOOT_JAR_JFLAGS)
|
||||
@$(java-vm-cleanup)
|
||||
$(CP) $(LIBDIR)/ct.sym $(JDK_MODULE_IMAGE_DIR)/lib/ct.sym
|
||||
@#
|
||||
@# CORBA supported orb.idl and ir.idl should be copied to lib
|
||||
@#
|
||||
$(CP) $(LIBDIR)/orb.idl $(JDK_MODULE_IMAGE_DIR)/lib/orb.idl
|
||||
$(CP) $(LIBDIR)/ir.idl $(JDK_MODULE_IMAGE_DIR)/lib/ir.idl
|
||||
ifeq ($(PLATFORM), linux)
|
||||
@#
|
||||
@# on Linux copy jexec from jre/lib to /lib
|
||||
@#
|
||||
$(CP) $(LIBDIR)/jexec $(JDK_MODULE_IMAGE_DIR)/lib/jexec
|
||||
endif # PLATFORM
|
||||
@#
|
||||
@# demo, include
|
||||
@#
|
||||
$(CP) -r -f $(DEMODIR) $(JDK_MODULE_IMAGE_DIR)
|
||||
$(CP) -r -f $(SAMPLEDIR) $(JDK_MODULE_IMAGE_DIR)
|
||||
$(CP) -r $(INCLUDEDIR) $(JDK_MODULE_IMAGE_DIR)
|
||||
@#
|
||||
@# Swing BeanInfo generation
|
||||
@#
|
||||
$(CD) javax/swing/beaninfo && $(MAKE) JDK_IMAGE_DIR=$(JDK_MODULE_IMAGE_DIR) swing-1.2-beans
|
||||
ifneq ($(PLATFORM), windows)
|
||||
$(call copy-man-pages,$(JDK_MODULE_IMAGE_DIR),$(JDK_MAN_PAGES))
|
||||
endif # !windows
|
||||
|
||||
# Trim out files we don't want to ship
|
||||
trim-module-image-jdk::
|
||||
@# Remove tools that should not be part of SDK.
|
||||
for t in $(NOTJDKTOOLS); do \
|
||||
$(RM) $(JDK_MODULE_IMAGE_DIR)/bin/$${t}$(EXE_SUFFIX) \
|
||||
$(JDK_MODULE_IMAGE_DIR)/bin/*/native_threads/$${t}$(EXE_SUFFIX); \
|
||||
done
|
||||
|
||||
# Get list of Elf files in the jdk
|
||||
JDK_MODULE_ELF_LIST=$(MODULES_TEMPDIR)/jdk-elf-files.list
|
||||
$(JDK_MODULE_ELF_LIST):
|
||||
@$(prep-target)
|
||||
ifneq ($(PLATFORM), windows)
|
||||
$(RM) $@
|
||||
$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/lib -type f -name \*.$(LIB_SUFFIX) >> $@
|
||||
$(FILE) `$(FIND) $(JDK_MODULE_IMAGE_DIR)/jre/bin -type f -name \*$(EXE_SUFFIX)` \
|
||||
| $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
|
||||
file `$(FIND) $(JDK_MODULE_IMAGE_DIR)/bin -type f -name \*$(EXE_SUFFIX)` \
|
||||
| $(EGREP) 'ELF' | $(CUT) -d':' -f1 >> $@
|
||||
endif
|
||||
|
||||
# Post process the image (strips and mcs on files we are shipping)
|
||||
process-module-image-jdk:: $(JDK_MODULE_ELF_LIST)
|
||||
ifneq ($(POST_STRIP_PROCESS), )
|
||||
for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
|
||||
$(CHMOD) u+w $${f}; \
|
||||
$(ECHO) $(POST_STRIP_PROCESS) $${f}; \
|
||||
$(POST_STRIP_PROCESS) $${f}; \
|
||||
$(CHMOD) go-w $${f}; \
|
||||
done
|
||||
endif
|
||||
ifneq ($(POST_MCS_PROCESS), )
|
||||
for f in `$(CAT) $(JDK_MODULE_ELF_LIST)`; do \
|
||||
$(CHMOD) u+w $${f}; \
|
||||
$(ECHO) $(POST_MCS_PROCESS) $${f}; \
|
||||
$(POST_MCS_PROCESS) $${f}; \
|
||||
$(CHMOD) go-w $${f}; \
|
||||
done
|
||||
endif
|
||||
$(RM) $(JDK_MODULE_ELF_LIST)
|
||||
|
||||
######################################################
|
||||
# clobber
|
||||
######################################################
|
||||
modules-clobber::
|
||||
$(RM) -r $(JDK_MODULE_IMAGE_DIR)
|
||||
$(RM) -r $(JRE_MODULE_IMAGE_DIR)
|
||||
|
||||
modules modules-clobber::
|
||||
@$(ECHO) ">>>Finished making "$@" @ `$(DATE)` ..."
|
||||
@$(java-vm-cleanup)
|
||||
|
||||
.PHONY: modules module-image-jre module-image-jdk \
|
||||
initial-module-image-jre initial-module-image-jdk \
|
||||
initial-module-image-jre-sol64 initial-module-image-jdk-sol64 \
|
||||
initial-module-image-jdk-setup \
|
||||
initial-module-image-jdk-db \
|
||||
initial-module-image-jdk64-bindemos \
|
||||
initial-module-image-jre-setup \
|
||||
trim-module-image-jre trim-module-image-jdk \
|
||||
process-module-image-jre process-module-image-jdk \
|
||||
install-previous-jre install-previous-jdk \
|
||||
modules-clobber
|
||||
|
||||
# Force rule
|
||||
FRC:
|
||||
|
@ -1,319 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 1995, 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.
|
||||
#
|
||||
|
||||
#
|
||||
# Generic makefile for building executables.
|
||||
#
|
||||
|
||||
# WARNING: This file is shared with other workspaces.
|
||||
# So when it includes other files, it must use JDK_TOPDIR.
|
||||
#
|
||||
|
||||
#
|
||||
# If building programs, use a normal compile approach
|
||||
#
|
||||
ifeq ($(COMPILE_APPROACH),batch)
|
||||
override COMPILE_APPROACH = normal
|
||||
endif
|
||||
|
||||
# set the platform specific directory for macosx, also this platform shares
|
||||
# substantial family ties with its siblings (solaris and linux), thus we add
|
||||
# solaris src path to its compilation dependencies.
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
LAUNCHER_PLATFORM_SRC = $(BUILDDIR)/../src/macosx
|
||||
LAUNCHER_SOLARIS_PLATFORM_SRC = $(BUILDDIR)/../src/solaris
|
||||
else
|
||||
LAUNCHER_PLATFORM_SRC = $(PLATFORM_SRC)
|
||||
endif
|
||||
|
||||
ifndef LAUNCHER_SHARE_SRC
|
||||
LAUNCHER_SHARE_SRC = $(SHARE_SRC)
|
||||
endif
|
||||
|
||||
ACTUAL_PROGRAM_NAME = $(PROGRAM)$(EXE_SUFFIX)
|
||||
ACTUAL_PROGRAM_DIR = $(BINDIR)
|
||||
ACTUAL_PROGRAM = $(ACTUAL_PROGRAM_DIR)/$(ACTUAL_PROGRAM_NAME)
|
||||
|
||||
# Make sure the default rule is all
|
||||
program_default_rule: all
|
||||
|
||||
program: $(ACTUAL_PROGRAM)
|
||||
|
||||
# Work-around for missing processor specific mapfiles
|
||||
ifndef CROSS_COMPILE_ARCH
|
||||
# reuse the mapfiles in the launcher's directory, the same should
|
||||
# be applicable to the tool launchers as well.
|
||||
FILES_m = $(BUILDDIR)/java/main/java/mapfile-$(ARCH)
|
||||
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
||||
endif
|
||||
|
||||
include $(JDK_TOPDIR)/makefiles/common/Rules.gmk
|
||||
|
||||
ifdef NEVER_ACT_AS_SERVER_CLASS_MACHINE
|
||||
OTHER_CPPFLAGS += -DNEVER_ACT_AS_SERVER_CLASS_MACHINE
|
||||
endif
|
||||
|
||||
#
|
||||
# Create a dependency on libjli (Java Launcher Infrastructure)
|
||||
#
|
||||
# On UNIX, this is a relative dependency using $ORIGIN. Unfortunately, to
|
||||
# do this reliably on Linux takes a different syntax than Solaris.
|
||||
#
|
||||
# On Windows, this is done by using the same directory as the executable
|
||||
# itself, as with all the Windows libraries.
|
||||
#
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
ifneq ($(ARCH), universal)
|
||||
LDFLAGS += -Wl,-all_load
|
||||
endif
|
||||
LDFLAGS += $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static/libjli.a
|
||||
|
||||
ifeq ($(SYSTEM_ZLIB),true)
|
||||
OTHER_LDLIBS += -lz
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(PLATFORM), linux solaris)) # UNIX systems
|
||||
LDFLAGS += -L $(LIBDIR)/$(LIBARCH)/jli
|
||||
OTHER_LDLIBS += -ljli
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
LDFLAGS += -R \$$ORIGIN/../lib/$(LIBARCH)/jli
|
||||
LDFLAGS += -R \$$ORIGIN/../jre/lib/$(LIBARCH)/jli
|
||||
else
|
||||
LDFLAGS += -R \$$ORIGIN/../../lib/$(LIBARCH)/jli
|
||||
LDFLAGS += -R \$$ORIGIN/../../jre/lib/$(LIBARCH)/jli
|
||||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM), linux)
|
||||
LDFLAGS += $(LDFLAG_Z_ORIGIN)
|
||||
LDFLAGS += -Wl,--allow-shlib-undefined
|
||||
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../lib/$(LIBARCH)/jli
|
||||
LDFLAGS += -Wl,-rpath -Wl,\$$ORIGIN/../jre/lib/$(LIBARCH)/jli
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
JLI_LCF = $(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/jli.lcf
|
||||
ifdef STATIC_JLI
|
||||
LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)/static
|
||||
else
|
||||
LDFLAGS += -libpath:$(OUTPUTDIR)/tmp/java/jli/$(OBJDIRNAME)
|
||||
endif
|
||||
OTHER_LDLIBS += jli.lib
|
||||
endif
|
||||
|
||||
#
|
||||
# Launcher specific files.
|
||||
#
|
||||
FILES_o = $(OBJDIR)/main.$(OBJECT_SUFFIX)
|
||||
|
||||
$(ACTUAL_PROGRAM):: classes $(INIT)
|
||||
|
||||
#
|
||||
# Windows only
|
||||
#
|
||||
ifeq ($(PLATFORM), windows)
|
||||
# JDK name required here
|
||||
RC_FLAGS += /D "JDK_FNAME=$(PROGRAM)$(EXE_SUFFIX)" \
|
||||
/D "JDK_INTERNAL_NAME=$(PROGRAM)" \
|
||||
/D "JDK_FTYPE=0x1L"
|
||||
|
||||
$(OBJDIR)/$(PROGRAM).res: $(VERSIONINFO_RESOURCE)
|
||||
@$(prep-target)
|
||||
ifndef LOCAL_RESOURCE_FILE
|
||||
$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(@) $(VERSIONINFO_RESOURCE)
|
||||
endif
|
||||
|
||||
$(OBJDIR)/$(PROGRAM).lcf: $(OBJDIR)/$(PROGRAM).res $(FILES_o)
|
||||
@$(prep-target)
|
||||
@$(ECHO) $(FILES_o) > $@
|
||||
ifndef LOCAL_RESOURCE_FILE
|
||||
@$(ECHO) $(OBJDIR)/$(PROGRAM).res >> $@
|
||||
endif
|
||||
@$(ECHO) setargv.obj >> $@
|
||||
@$(ECHO) Created $@
|
||||
|
||||
$(ACTUAL_PROGRAM):: $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
|
||||
@$(install-file)
|
||||
|
||||
ifeq ($(ARCH_DATA_MODEL), 32)
|
||||
STACK_SIZE=327680
|
||||
else
|
||||
# We need more Stack for Windows 64bit
|
||||
STACK_SIZE=1048576
|
||||
endif
|
||||
|
||||
IMVERSION=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VER).$(COOKED_BUILD_NUMBER)
|
||||
$(OBJDIR)/$(PROGRAM).exe.manifest: $(JDK_TOPDIR)/src/windows/resource/java.manifest
|
||||
@$(prep-target)
|
||||
$(SED) 's%IMVERSION%$(IMVERSION)%g;s%PROGRAM%$(PROGRAM)%g' $< > $@
|
||||
|
||||
# We used a hand-crafted manifest file for all executables.
|
||||
# It is tweaked to embed the build number and executable name.
|
||||
# Use ";#2" for .dll and ";#1" for .exe in the MT command below:
|
||||
$(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX):: $(OBJDIR)/$(PROGRAM).lcf $(FILES_o) $(JLI_LCF) $(OBJDIR)/$(PROGRAM).exe.manifest
|
||||
@$(prep-target)
|
||||
@set -- $?; \
|
||||
$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
|
||||
$(LD) -out:$@ /STACK:$(STACK_SIZE) \
|
||||
-map:$(OBJDIR)/$(PROGRAM).map $(LFLAGS) $(LDFLAGS) \
|
||||
@$(OBJDIR)/$(PROGRAM).lcf $(LDLIBS)
|
||||
ifdef MT
|
||||
$(MT) /manifest $(OBJDIR)/$(PROGRAM).exe.manifest /outputresource:$@;#1
|
||||
endif
|
||||
@$(call binary_file_verification,$@)
|
||||
else
|
||||
#
|
||||
# Note that we have to link -lthread even when USE_PTHREADS is true.
|
||||
# This is becuase checkForCorrectLibthread() croaks otherwise.
|
||||
#
|
||||
LIBTHREAD = -lthread
|
||||
ifeq ($(USE_PTHREADS),true)
|
||||
THREADLIBS = -lpthread $(LIBTHREAD)
|
||||
else
|
||||
THREADLIBS = $(LIBTHREAD)
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
THREADLIBS = -pthread
|
||||
# Needed for linking the various launchers
|
||||
LDFLAGS += -framework Cocoa -framework Security \
|
||||
-framework ApplicationServices
|
||||
OTHER_CPPFLAGS += -DPACKAGE_PATH='"$(PACKAGE_PATH)"'
|
||||
|
||||
# Default Info.plist file for the command line tools. This gets overridden by
|
||||
# some of the jvmstat tools so that they have task_for_pid() privileges
|
||||
ifndef INFO_PLIST_FILE
|
||||
INFO_PLIST_FILE = Info-cmdline.plist
|
||||
endif
|
||||
LDFLAGS += -sectcreate __TEXT __info_plist $(LAUNCHER_PLATFORM_SRC)/lib/$(INFO_PLIST_FILE)
|
||||
else
|
||||
INFO_PLIST_FILE=
|
||||
endif
|
||||
|
||||
#
|
||||
# This rule only applies on unix. It supports quantify and its ilk.
|
||||
#
|
||||
$(ACTUAL_PROGRAM):: $(FILES_o)
|
||||
@$(prep-target)
|
||||
@set -- $?; \
|
||||
$(ECHO) Rebuilding $@ because of $$1 $$2 $$3 $$4 $$5 $$6 $${7:+...};
|
||||
@$(MKDIR) -p $(TEMPDIR)
|
||||
$(LINK_PRE_CMD) $(CC) $(CC_OBJECT_OUTPUT_FLAG)$@ $(LDFLAGS) \
|
||||
$(FILES_o) $(THREADLIBS) $(LDLIBS)
|
||||
ifeq ($(findstring privileged, $(INFO_PLIST_FILE)), privileged)
|
||||
-codesign -s openjdk_codesign $@
|
||||
endif
|
||||
@$(call binary_file_verification,$@)
|
||||
endif # PLATFORM
|
||||
|
||||
clean::
|
||||
ifeq ($(PLATFORM), windows)
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).rc
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).ico
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).lcf
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).map
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).exp
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).lib
|
||||
$(RM) $(OBJDIR)/$(PROGRAM)$(EXE_SUFFIX)
|
||||
$(RM) $(OBJDIR)/$(PROGRAM).ilk
|
||||
$(RM) *.pdb
|
||||
endif
|
||||
|
||||
|
||||
clobber::
|
||||
$(RM) $(ACTUAL_PROGRAM)
|
||||
|
||||
#
|
||||
# Now include make dependencies (created during compilation, see Rules.gmk)
|
||||
#
|
||||
ifeq ($(INCREMENTAL_BUILD),true)
|
||||
# Workaround: gnumake sometimes says files is empty when it shouldn't
|
||||
# was: files := $(foreach file, $(wildcard */$(ARCH)/*.$(DEPEND_SUFFIX)), $(file))
|
||||
files := $(shell $(LS) $(OBJDIR)/*.$(DEPEND_SUFFIX) 2>/dev/null)
|
||||
ifneq ($(strip $(files)),)
|
||||
include $(files)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef JAVA_ARGS
|
||||
OTHER_CPPFLAGS += -DJAVA_ARGS='$(JAVA_ARGS)'
|
||||
OTHER_CPPFLAGS += -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"'
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM), windows)
|
||||
ifdef RELEASE
|
||||
OTHER_CPPFLAGS += -DVERSION='"$(RELEASE)"'
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(PLATFORM), windows)
|
||||
HAVE_GETHRTIME=true
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_GETHRTIME),true)
|
||||
OTHER_CPPFLAGS += -DHAVE_GETHRTIME
|
||||
endif
|
||||
|
||||
OTHER_INCLUDES += -I$(LAUNCHER_SHARE_SRC)/bin -I$(LAUNCHER_PLATFORM_SRC)/bin
|
||||
ifeq ($(PLATFORM), macosx)
|
||||
OTHER_INCLUDES += -I$(LAUNCHER_SOLARIS_PLATFORM_SRC)/bin
|
||||
ifneq ($(SYSTEM_ZLIB), true)
|
||||
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
|
||||
endif
|
||||
else
|
||||
OTHER_INCLUDES += -I$(SHARE_SRC)/native/java/util/zip/zlib-1.1.3
|
||||
endif
|
||||
|
||||
OTHER_CPPFLAGS += -DPROGNAME='"$(PROGRAM)"'
|
||||
VERSION_DEFINES += -DFULL_VERSION='"$(FULL_VERSION)"'
|
||||
|
||||
VERSION_DEFINES += -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
|
||||
-DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"'
|
||||
|
||||
|
||||
|
||||
$(OBJDIR)/main.$(OBJECT_SUFFIX): $(LAUNCHER_SHARE_SRC)/bin/main.c
|
||||
@$(prep-target)
|
||||
$(COMPILE.c) $(CC_OBJECT_OUTPUT_FLAG)$(OBJDIR)/main.$(OBJECT_SUFFIX) \
|
||||
$(VERSION_DEFINES) $<
|
||||
|
||||
#
|
||||
# Default dependencies
|
||||
#
|
||||
|
||||
all: build
|
||||
|
||||
build: program
|
||||
|
||||
debug:
|
||||
$(MAKE) VARIANT=DBG build
|
||||
|
||||
fastdebug:
|
||||
$(MAKE) VARIANT=DBG FASTDEBUG=true build
|
||||
|
||||
.PHONY: all build program clean clobber debug fastdebug
|
@ -1,230 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 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.
|
||||
#
|
||||
|
||||
#
|
||||
# SE-Embedded Reduced JRE targets
|
||||
#
|
||||
ifdef JAVASE_EMBEDDED
|
||||
|
||||
reduced-image-jre reduced-headless-image-jre ::
|
||||
@$(ECHO) ">>>Making "$@" @ `$(DATE)` ..."
|
||||
|
||||
# Add the reduced-jre images as pre-reqs. These will be processed last
|
||||
images:: reduced-image-jre reduced-headless-image-jre
|
||||
|
||||
|
||||
######################################################
|
||||
# Create the headless rt.jar
|
||||
######################################################
|
||||
|
||||
NOT_HEADLESS_RT_JAR_LIST = $(ABS_TEMPDIR)/not_hl_rt_jar.list
|
||||
HEADLESS_RT_JAR_FILELIST=$(JARFILELISTS_TEMPDIR)/hl_rt_jar_list
|
||||
TOTAL_HEADLESS_JAR_FILELIST=$(REORDER_TEMPDIR)/hl_file_list
|
||||
HEADLESS_CLASSLIST=$(ABS_TEMPDIR)/headless_classlist
|
||||
|
||||
# Add the jar file directories that we don't want in the
|
||||
# headless JRE. If you want to remove most classes in a
|
||||
# directory, put the directory in the NOT_HEADLESS_RT_JAR_LIST
|
||||
# and put the individual classes you want to keep in the
|
||||
# HEADLESS_CLASSLIST file.
|
||||
$(NOT_HEADLESS_RT_JAR_LIST): $(NOT_RT_JAR_LIST)
|
||||
$(RM) $(HEADLESS_CLASSLIST)
|
||||
$(RM) $(NOT_HEADLESS_RT_JAR_LIST)
|
||||
$(CP) $(NOT_RT_JAR_LIST) $(NOT_HEADLESS_RT_JAR_LIST)
|
||||
# List all the packages to be excluded
|
||||
$(ECHO) "sun/awt/motif/" >> $@
|
||||
$(ECHO) "sun/awt/X11/" >> $@
|
||||
$(ECHO) "sun/applet/" >> $@
|
||||
$(ECHO) "sun/java2d/opengl/" >> $@
|
||||
$(ECHO) "com/sun/java/swing/plaf/" >> $@
|
||||
# List all the individual classes to be included
|
||||
$(ECHO) "sun/awt/motif/MFontConfiguration.class" >$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/applet/AppContextCreator.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/applet/AppletAudioClip.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXSurfaceData.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/OGLSurfaceData.class" >>$(HEADLESS_CLASSLIST)
|
||||
|
||||
|
||||
$(TOTAL_HEADLESS_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_HEADLESS_RT_JAR_LIST)
|
||||
$(prep-target)
|
||||
$(RM) $@.temp
|
||||
$(CD) $(CLASSBINDIR) ; \
|
||||
$(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
|
||||
-o $@.temp - $(NOT_HEADLESS_RT_JAR_LIST) .
|
||||
# Add on the explicitly included class files from the otherwise excluded packages
|
||||
$(CAT) $(HEADLESS_CLASSLIST) >> $@.temp
|
||||
$(MV) $@.temp $@
|
||||
@$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
|
||||
|
||||
# Create the headless rt.jar file list & non-class files list
|
||||
MakeHeadlessJarFileList: $(TOTAL_HEADLESS_JAR_FILELIST) $(JARSPLIT_JARFILE)
|
||||
@$(RM) $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
|
||||
$(BOOT_JAVA_CMD) -jar $(JARSPLIT_JARFILE) $(TOTAL_HEADLESS_JAR_FILELIST) \
|
||||
-o $(HEADLESS_RT_JAR_FILELIST) $(RES_JAR_FILELIST)
|
||||
@$(java-vm-cleanup)
|
||||
|
||||
# Create headless rt.jar
|
||||
HL_RT_JAR=$(ABS_TEMPDIR)/rt-hl-orig.jar
|
||||
$(HL_RT_JAR): MakeHeadlessJarFileList $(RT_JAR_MANIFEST_FILE)
|
||||
$(prep-target)
|
||||
$(CD) $(CLASSBINDIR) ; \
|
||||
$(BOOT_JAR_CMD) $(CREATE_JAR_OPTS) $(RT_JAR_MANIFEST_FILE) $@ @$(HEADLESS_RT_JAR_FILELIST) \
|
||||
$(JAR_JFLAGS)
|
||||
@$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
|
||||
|
||||
|
||||
#
|
||||
# Produce a reduced Headful JRE for Embedded Devices
|
||||
#
|
||||
# The deployment binaries are added during the deployment build process
|
||||
#
|
||||
|
||||
# Binaries that don't get included in reduced jre image bin directory
|
||||
NOT_REDUCEDJRE_BIN = \
|
||||
java_vm \
|
||||
kinit \
|
||||
klist \
|
||||
ktab \
|
||||
orbd \
|
||||
policytool \
|
||||
rmid \
|
||||
rmiregistry \
|
||||
servertool \
|
||||
tnameserv \
|
||||
pack200 \
|
||||
unpack200
|
||||
|
||||
# jars/resources/libs that don't get included in reduced jre image lib directory
|
||||
NOT_REDUCEDJRE_LIB = \
|
||||
charsets.jar \
|
||||
ext/dnsns.jar \
|
||||
ext/localedata.jar \
|
||||
$(LIBARCH)/client/classes.jsa \
|
||||
$(LIBARCH)/libjavaplugin_jni.so \
|
||||
$(LIBARCH)/libjavaplugin_nscp_gcc29.so \
|
||||
$(LIBARCH)/libjavaplugin_nscp.so \
|
||||
$(LIBARCH)/libjavaplugin_oji.so
|
||||
|
||||
# JRE docs that don't get included in reduced jre image top directory
|
||||
NOT_REDUCEDJRE_DOC = \
|
||||
Welcome.html
|
||||
|
||||
reduced-image-jre::
|
||||
@$(ECHO) Starting to Produce Reduced JRE
|
||||
@#
|
||||
@# First make a copy of the full JRE
|
||||
@#
|
||||
$(RM) -r $(JRE_REDUCED_IMAGE_DIR)
|
||||
$(MKDIR) -p $(JRE_REDUCED_IMAGE_DIR)
|
||||
$(CD) $(JRE_IMAGE_DIR); \
|
||||
$(TAR) cf - . | ($(CD) $(JRE_REDUCED_IMAGE_DIR); $(TAR) xf - );
|
||||
|
||||
@#
|
||||
@# Remove all of the files that are not needed for the
|
||||
@# reduced JRE
|
||||
@#
|
||||
for l in $(NOT_REDUCEDJRE_BIN) ; do \
|
||||
$(RM) $(JRE_REDUCED_IMAGE_DIR)/bin/$$l ; \
|
||||
done
|
||||
for l in $(NOT_REDUCEDJRE_LIB) ; do \
|
||||
$(RM) $(JRE_REDUCED_IMAGE_DIR)/lib/$$l ; \
|
||||
done
|
||||
for l in $(NOT_REDUCEDJRE_DOC) ; do \
|
||||
$(RM) $(JRE_REDUCED_IMAGE_DIR)/$$l ; \
|
||||
done
|
||||
|
||||
@# Remove misc. other files
|
||||
$(RM) -r $(JRE_REDUCED_IMAGE_DIR)/man
|
||||
$(RM) -f $(JRE_REDUCED_IMAGE_DIR)/CHANGES
|
||||
|
||||
@$(ECHO) Done Creating Reduced JRE
|
||||
|
||||
#
|
||||
# Produce a reduced Headless JRE
|
||||
#
|
||||
reduced-headless-image-jre:: $(RT_JAR) $(RESOURCES_JAR) $(BUILD_META_INDEX) $(HL_RT_JAR)
|
||||
@$(ECHO) Starting to Produce Reduced Headless JRE
|
||||
@#
|
||||
@# First make a copy of the reduced JRE we just built
|
||||
@#
|
||||
$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
|
||||
$(MKDIR) -p $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
|
||||
$(CD) $(JRE_REDUCED_IMAGE_DIR); \
|
||||
$(TAR) cf - . | ($(CD) $(JRE_REDUCED_HEADLESS_IMAGE_DIR); $(TAR) xf - );
|
||||
|
||||
@# Replace the full rt.jar with the headless rt.jar
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
|
||||
$(CP) $(HL_RT_JAR) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/rt.jar
|
||||
|
||||
@#
|
||||
@# Remove all of the files that are not needed for the
|
||||
@# reduced Headless JRE
|
||||
@#
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/gtkhelper
|
||||
$(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libjsoundalsa.so
|
||||
$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/audio
|
||||
$(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/applet
|
||||
$(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/awt_robot
|
||||
$(RM) $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libawt_xawt.so
|
||||
$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/$(LIBARCH)/libsplashscreen.so
|
||||
@# Remove oblique fonts and reduce font support to LucidaSansRegular only
|
||||
$(RM) -fr $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/oblique-fonts
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiBold.ttf
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightDemiItalic.ttf
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightItalic.ttf
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaBrightRegular.ttf
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaSansDemiBold.ttf
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterBold.ttf
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/LucidaTypewriterRegular.ttf
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
# put out minimal fonts.dir file for the remaining font
|
||||
$(RM) -f $(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) 6>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-1">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-2">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-4">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-5">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-7">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
$(ECHO) "LucidaSansRegular.ttf -b&h-lucidasans-medium-r-normal-sans-0-0-0-0-p-0-iso8859-9">>$(JRE_REDUCED_HEADLESS_IMAGE_DIR)/lib/fonts/fonts.dir
|
||||
|
||||
endif # Linux
|
||||
|
||||
@#
|
||||
@# all done with JRE reduced headless image
|
||||
@#
|
||||
|
||||
@$(ECHO) Done Creating Reduced Headless JRE
|
||||
|
||||
images-clobber::
|
||||
$(RM) -r $(JRE_REDUCED_IMAGE_DIR)
|
||||
$(RM) -r $(JRE_REDUCED_HEADLESS_IMAGE_DIR)
|
||||
|
||||
.PHONY: reduced-image-jre reduced-headless-image-jre
|
||||
|
||||
endif # JAVASE_EMBEDDED
|
||||
|
@ -1,75 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 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.
|
||||
#
|
||||
|
||||
MANBASEDIRS=$(JDK_TOPDIR)/src/bsd/doc $(IMPORTDOCDIR)
|
||||
MAN1SUBDIR = man
|
||||
JA_DIRNAME=ja_JP.UTF-8
|
||||
|
||||
# Defines the release targets for Mac OS X build products
|
||||
|
||||
JDK_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2sdk-bundle/jdk$(JDK_VERSION).jdk/Contents
|
||||
JRE_BUNDLE_DIR = $(ABS_OUTPUTDIR)/j2re-bundle/jre$(JDK_VERSION).jre/Contents
|
||||
|
||||
MACOSX_SRC = $(JDK_TOPDIR)/src/macosx
|
||||
|
||||
BUNDLE_ID ?= net.java.openjdk
|
||||
BUNDLE_ID_JRE ?= $(BUNDLE_ID).jre
|
||||
BUNDLE_ID_JDK ?= $(BUNDLE_ID).jdk
|
||||
|
||||
BUNDLE_NAME ?= OpenJDK $(JDK_MINOR_VERSION)
|
||||
BUNDLE_NAME_JRE ?= $(BUNDLE_NAME)
|
||||
BUNDLE_NAME_JDK ?= $(BUNDLE_NAME)
|
||||
|
||||
BUNDLE_INFO ?= OpenJDK ($(JDK_VERSION))
|
||||
BUNDLE_INFO_JRE ?= $(BUNDLE_INFO)
|
||||
BUNDLE_INFO_JDK ?= $(BUNDLE_INFO)
|
||||
|
||||
BUNDLE_PLATFORM_VERSION ?= $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION)
|
||||
BUNDLE_VERSION ?= $(JDK_VERSION)
|
||||
BUNDLE_VENDOR ?= UNDEFINED
|
||||
|
||||
jre-bundle-setup:
|
||||
$(RM) -r $(JRE_BUNDLE_DIR)
|
||||
|
||||
jdk-bundle-setup:
|
||||
$(RM) -r $(JDK_BUNDLE_DIR)
|
||||
|
||||
jre-bundle-files:
|
||||
$(MKDIR) -p $(JRE_BUNDLE_DIR)/MacOS
|
||||
ln -s ../Home/lib/jli/libjli.dylib $(JRE_BUNDLE_DIR)/MacOS/
|
||||
$(CP) -r $(JRE_IMAGE_DIR) $(JRE_BUNDLE_DIR)/Home
|
||||
$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JRE)/g" -e "s/@@NAME@@/$(BUNDLE_NAME_JRE)/g" -e "s/@@INFO@@/$(BUNDLE_INFO_JRE)/g" -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" < $(MACOSX_SRC)/bundle/JRE-Info.plist > $(JRE_BUNDLE_DIR)/Info.plist
|
||||
/usr/bin/SetFile -a B $(JRE_BUNDLE_DIR)/../
|
||||
|
||||
jdk-bundle-files:
|
||||
$(MKDIR) -p $(JDK_BUNDLE_DIR)/MacOS
|
||||
ln -s ../Home/jre/lib/jli/libjli.dylib $(JDK_BUNDLE_DIR)/MacOS/
|
||||
$(CP) -r $(JDK_IMAGE_DIR) $(JDK_BUNDLE_DIR)/Home
|
||||
$(SED) -e "s/@@ID@@/$(BUNDLE_ID_JDK)/g" -e "s/@@NAME@@/$(BUNDLE_NAME_JDK)/g" -e "s/@@INFO@@/$(BUNDLE_INFO_JDK)/g" -e "s/@@PLATFORM_VERSION@@/$(BUNDLE_PLATFORM_VERSION)/g" -e "s/@@VERSION@@/$(BUNDLE_VERSION)/g" -e "s/@@VENDOR@@/$(BUNDLE_VENDOR)/g" < $(MACOSX_SRC)/bundle/JDK-Info.plist > $(JDK_BUNDLE_DIR)/Info.plist
|
||||
/usr/bin/SetFile -a B $(JDK_BUNDLE_DIR)/../
|
||||
|
||||
EXTRA_IMAGE_TARGETS += jre-bundle-setup jdk-bundle-setup jre-bundle-files jdk-bundle-files
|
||||
|
||||
.PHONY: $(EXTRA_JRE_TARGETS) $(EXTRA_IMAGE_TARGETS)
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user