7182051: Update of latest build-infra Makefiles (missing files)
Reviewed-by: ohair
This commit is contained in:
parent
f7b99ca7f6
commit
34570ba690
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
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)
|
||||
|
||||
])
|
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
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)
|
||||
|
||||
])
|
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)
|
||||
])
|
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
|
@ -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
|
||||
@ -93,7 +93,7 @@ $(if $(10),$(error Internal makefile error: Too many arguments to SetupIdlCompil
|
||||
$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.
|
||||
|
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
|
@ -451,13 +451,14 @@ define SetupNativeCompilation
|
||||
$(RM) $$@
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $$<
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(ADD_GNU_DEBUGLINK) $$@ $$<
|
||||
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $$(@F) $$<
|
||||
else # not solaris
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
|
||||
$(RM) $$@
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(OBJCOPY) --add-gnu-debuglink=$$@ $$<
|
||||
endif
|
||||
$(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
|
||||
@ -526,13 +527,14 @@ define SetupNativeCompilation
|
||||
$(RM) $$@
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $$<
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(ADD_GNU_DEBUGLINK) $$@ $$<
|
||||
$(CD) $$(@D) && $(ADD_GNU_DEBUGLINK) $$(@F) $$<
|
||||
else # not solaris
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
|
||||
$(RM) $$@
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(OBJCOPY) --add-gnu-debuglink=$$@ $$<
|
||||
$(CD) $$(@D) && $(OBJCOPY) --add-gnu-debuglink=$$(@F) $$<
|
||||
endif
|
||||
$(TOUCH) $$@
|
||||
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES), 1)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
|
||||
|
104
common/makefiles/RMICompilation.gmk
Normal file
104
common/makefiles/RMICompilation.gmk
Normal file
@ -0,0 +1,104 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
define SetupRMICompilation
|
||||
# param 1 is a name for a variable to depend on.
|
||||
# param 2 and up are named args.
|
||||
# CLASSES:=List of classes to generate stubs for
|
||||
# CLASSES_DIR:=Directory where to look for classes
|
||||
# STUB_CLASSES_DIR:=Directory in where to put stub classes
|
||||
# RUN_V11:=Set to run rmic with -v1.1
|
||||
# RUN_V12:=Set to run rmic with -v1.2
|
||||
# RUN_IIOP:=Set to run rmic with -iiop
|
||||
# RUN_IIOP_STDPKG:=Set to run rmic with -iiop -standardPackage
|
||||
# KEEP_GENERATED:=Set to keep generated sources around
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
$(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 SetupRMICompilation, please update RMICompilation.gmk))
|
||||
|
||||
|
||||
$1_DEP_FILE := $$($1_STUB_CLASSES_DIR)/$1_rmic
|
||||
|
||||
$1_CLASSES_SLASH := $$(subst .,/,$$($1_CLASSES))
|
||||
$1_CLASS_FILES := $$(addprefix $$($1_CLASSES_DIR)/,$$(addsuffix .class,$$($1_CLASSES_SLASH)))
|
||||
$1_STUB_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Stub.class,$$($1_CLASSES_SLASH)))
|
||||
$1_TARGETS := $$($1_STUB_FILES)
|
||||
$1_ARGS :=
|
||||
ifneq (,$$($1_RUN_V11))
|
||||
$1_SKEL_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Skel.class,$$($1_CLASSES_SLASH)))
|
||||
$1_TARGETS += $$($1_SKEL_FILES)
|
||||
$1_ARGS += -v1.1
|
||||
endif
|
||||
ifneq (,$$($1_RUN_V12))
|
||||
$1_ARGS += -v1.2
|
||||
endif
|
||||
|
||||
$1_TIE_BASE_FILES := $$(foreach f,$$($1_CLASSES_SLASH),$$(dir $$f)_$$(notdir $$f))
|
||||
$1_TIE_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/org/omg/stub/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
|
||||
$1_TIE_STDPKG_FILES := $$(addprefix $$($1_STUB_CLASSES_DIR)/,$$(addsuffix _Tie.class,$$($1_TIE_BASE_FILES)))
|
||||
|
||||
ifneq (,$$($1_RUN_IIOP))
|
||||
$1_TARGETS += $$($1_TIE_FILES)
|
||||
$1_ARGS += -iiop
|
||||
endif
|
||||
ifneq (,$$($1_RUN_IIOP_STDPKG))
|
||||
$1_TARGETS += $$($1_TIE_STDPKG_FILES)
|
||||
$1_ARGS2 := -iiop -standardPackage
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_KEEP_GENERATED))
|
||||
$1_ARGS += -keepgenerated
|
||||
$1_TARGETS += $$(subst .class,.java,$$($1_TARGETS))
|
||||
endif
|
||||
|
||||
$1_DOLLAR_SAFE_CLASSES := $$(subst $$$$,\$$$$,$$($1_CLASSES))
|
||||
|
||||
$$($1_TARGETS): $$($1_DEP_FILE) $$($1_CLASS_FILES)
|
||||
|
||||
$$($1_DEP_FILE): $$($1_CLASS_FILES)
|
||||
$(MKDIR) -p $$($1_STUB_CLASSES_DIR)
|
||||
if [ "x$$($1_ARGS)" != "x" ]; then \
|
||||
$(ECHO) Running rmic $$($1_ARGS) for $$($1_DOLLAR_SAFE_CLASSES) &&\
|
||||
$(RMIC) $$($1_ARGS) -classpath "$$($1_CLASSES_DIR)" \
|
||||
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\
|
||||
fi;
|
||||
if [ "x$$($1_ARGS2)" != "x" ]; then \
|
||||
$(ECHO) Running rmic $$($1_ARGS2) for $$($1_DOLLAR_SAFE_CLASSES) &&\
|
||||
$(RMIC) $$($1_ARGS2) -classpath "$$($1_CLASSES_DIR)" \
|
||||
-d $$($1_STUB_CLASSES_DIR) $$($1_DOLLAR_SAFE_CLASSES);\
|
||||
fi;
|
||||
|
||||
|
||||
$1 := $$($1_TARGETS)
|
||||
|
||||
# By marking as secondary, this "touch" file doesn't need to be touched and will never exist.
|
||||
.SECONDARY: $$($1_DEP_FILE)
|
||||
endef
|
Loading…
Reference in New Issue
Block a user