7181504: Update of latest build-infra Makefiles
Reviewed-by: ohair
This commit is contained in:
parent
7517b9d193
commit
f7b99ca7f6
@ -22,5 +22,19 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
autoconf -W all configure.ac > configure
|
||||
rm -rf config.status config.log autom4te.cache
|
||||
script_dir=`dirname $0`
|
||||
closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
|
||||
|
||||
# Create a timestamp as seconds since epoch
|
||||
TIMESTAMP=`date +%s`
|
||||
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
|
||||
rm -rf autom4te.cache
|
||||
|
||||
if test -e $closed_script_dir/closed-hook.m4; then
|
||||
# We have closed sources available; also generate configure script
|
||||
# with closed hooks compiled in.
|
||||
cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
|
||||
sed -e "s|AC_DEFUN_ONCE(\[CLOSED_HOOK\])|m4_include([$closed_script_dir/closed-hook.m4])|" | autoconf -W all -I$script_dir - > $closed_script_dir/generated-configure.sh
|
||||
rm -rf autom4te.cache
|
||||
fi
|
||||
|
1553
common/autoconf/build-aux/config.guess
vendored
1553
common/autoconf/build-aux/config.guess
vendored
File diff suppressed because it is too large
Load Diff
@ -31,11 +31,11 @@
|
||||
|
||||
# Translate a configuration triplet/quadruplet into something
|
||||
# known by this configuration file.
|
||||
# If no rewrite was found, then rewritten_host=${host}
|
||||
# If no rewrite was found, then rewritten_target=${OPENJDK_TARGET_SYSTEM}
|
||||
REWRITE_i686_pc_linux_gnu=i686-unknown-linux-gnu
|
||||
REWRITE_i386_pc_solaris2_10=i686-sun-solaris2_10
|
||||
|
||||
# The needed cups builddeps are host independent header files.
|
||||
# The needed cups builddeps are platform independent header files.
|
||||
# I.e. they need not be part of the devkit.
|
||||
builddep_cups=lib/cups_1_3_9.zip
|
||||
builddep_cups_CFLAGS=-I${depdir}
|
||||
@ -44,10 +44,10 @@ builddep_cups_CFLAGS=-I${depdir}
|
||||
# for the build platform.
|
||||
builddep_devkit=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
|
||||
# The freetype dependency is partyl host dependent.
|
||||
# The freetype dependency is partly platform dependent.
|
||||
# It is stored inside the sys-root.
|
||||
builddep_freetype2=sdk/sdk-${rewritten_build}-20110921.tar.gz
|
||||
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_host}/sys-root/usr/include/freetype2
|
||||
builddep_freetype2_CFLAGS=-I${depdir}/${rewritten_target}/sys-root/usr/include/freetype2
|
||||
builddep_freetype2_LIBS=-lfreetype
|
||||
|
||||
# There are many other build dependencies, but they are implicitly
|
||||
|
@ -23,7 +23,7 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
AC_DEFUN_ONCE([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
[
|
||||
define(LIST_OF_BUILD_DEPENDENCIES,)
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
@ -50,27 +50,27 @@ AC_DEFUN([BDEPS_SCAN_FOR_BUILDDEPS],
|
||||
AC_MSG_ERROR([Could not find any builddeps.conf at all!])
|
||||
fi
|
||||
fi
|
||||
# Create build and host names that use _ instead of "-" and ".".
|
||||
# Create build and target names that use _ instead of "-" and ".".
|
||||
# This is necessary to use them in variable names.
|
||||
build_var=`echo ${build} | tr '-' '_' | tr '.' '_'`
|
||||
host_var=`echo ${host} | tr '-' '_' | tr '.' '_'`
|
||||
# Extract rewrite information for build and host
|
||||
build_var=`echo ${OPENJDK_BUILD_SYSTEM} | tr '-' '_' | tr '.' '_'`
|
||||
target_var=`echo ${OPENJDK_TARGET_SYSTEM} | tr '-' '_' | tr '.' '_'`
|
||||
# Extract rewrite information for build and target
|
||||
eval rewritten_build=\${REWRITE_${build_var}}
|
||||
if test "x$rewritten_build" = x; then
|
||||
rewritten_build=${build}
|
||||
rewritten_build=${OPENJDK_BUILD_SYSTEM}
|
||||
echo Build stays the same $rewritten_build
|
||||
else
|
||||
echo Rewriting build for builddeps into $rewritten_build
|
||||
fi
|
||||
eval rewritten_host=\${REWRITE_${host_var}}
|
||||
if test "x$rewritten_host" = x; then
|
||||
rewritten_host=${host}
|
||||
echo Host stays the same $rewritten_host
|
||||
eval rewritten_target=\${REWRITE_${target_var}}
|
||||
if test "x$rewritten_target" = x; then
|
||||
rewritten_target=${OPENJDK_TARGET_SYSTEM}
|
||||
echo Target stays the same $rewritten_target
|
||||
else
|
||||
echo Rewriting host for builddeps into $rewritten_host
|
||||
echo Rewriting target for builddeps into $rewritten_target
|
||||
fi
|
||||
rewritten_build_var=`echo ${rewritten_build} | tr '-' '_' | tr '.' '_'`
|
||||
rewritten_host_var=`echo ${rewritten_host} | tr '-' '_' | tr '.' '_'`
|
||||
rewritten_target_var=`echo ${rewritten_target} | tr '-' '_' | tr '.' '_'`
|
||||
fi
|
||||
AC_CHECK_PROGS(BDEPS_UNZIP, [7z unzip])
|
||||
if test "x$BDEPS_UNZIP" = x7z; then
|
||||
@ -127,11 +127,11 @@ AC_DEFUN([BDEPS_CHECK_MODULE],
|
||||
if test "x$with_builddeps_server" != x || test "x$with_builddeps_conf" != x; then
|
||||
# Source the builddeps file again, to make sure it uses the latest variables!
|
||||
. $builddepsfile
|
||||
# Look for a host and build machine specific resource!
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_HOST_${rewritten_host_var}}
|
||||
# Look for a target and build machine specific resource!
|
||||
eval resource=\${builddep_$2_BUILD_${rewritten_build_var}_TARGET_${rewritten_target_var}}
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a host specific resource
|
||||
eval resource=\${builddep_$2_HOST_${rewritten_host_var}}
|
||||
# Ok, lets instead look for a target specific resource
|
||||
eval resource=\${builddep_$2_TARGET_${rewritten_target_var}}
|
||||
fi
|
||||
if test "x$resource" = x; then
|
||||
# Ok, lets instead look for a build specific resource
|
||||
@ -228,3 +228,33 @@ AC_DEFUN([BDEPS_FETCH],
|
||||
$5=$installdir
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BDEPS_CONFIGURE_BUILDDEPS],
|
||||
[
|
||||
AC_ARG_WITH(builddeps-conf, [AS_HELP_STRING([--with-builddeps-conf],
|
||||
[use this configuration file for the builddeps])])
|
||||
|
||||
AC_ARG_WITH(builddeps-server, [AS_HELP_STRING([--with-builddeps-server],
|
||||
[download and use build dependencies from this server url, e.g. --with-builddeps-server=ftp://example.com/dir])])
|
||||
|
||||
AC_ARG_WITH(builddeps-dir, [AS_HELP_STRING([--with-builddeps-dir],
|
||||
[store downloaded build dependencies here @<:@d/localhome/builddeps@:>@])],
|
||||
[],
|
||||
[with_builddeps_dir=/localhome/builddeps])
|
||||
|
||||
AC_ARG_WITH(builddeps-group, [AS_HELP_STRING([--with-builddeps-group],
|
||||
[chgrp the downloaded build dependencies to this group])])
|
||||
|
||||
AC_ARG_ENABLE([list-builddeps], [AS_HELP_STRING([--enable-list-builddeps],
|
||||
[list all build dependencies known to the configure script])],
|
||||
[LIST_BUILDDEPS="${enableval}"], [LIST_BUILDDEPS='no'])
|
||||
|
||||
if test "x$LIST_BUILDDEPS" = xyes; then
|
||||
echo
|
||||
echo List of build dependencies known to the configure script,
|
||||
echo that can be used in builddeps.conf files:
|
||||
cat $AUTOCONF_DIR/*.ac $AUTOCONF_DIR/*.m4 | grep BDEPS_CHECK_MODUL[E]\( | cut -f 2 -d ',' | tr -d ' ' | sort
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
])
|
||||
|
16836
common/autoconf/configure
vendored
16836
common/autoconf/configure
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,103 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([CHECK_CORES],
|
||||
[
|
||||
AC_MSG_CHECKING([for number of cores])
|
||||
NUM_CORES=1
|
||||
FOUND_CORES=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
NUM_CORES=`cat /proc/cpuinfo | grep -c processor`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/psrinfo; then
|
||||
# Looks like a Solaris system
|
||||
NUM_CORES=`LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
NUM_CORES=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Cores' | awk '{print [$]5}'`
|
||||
FOUND_CORES=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
NUM_CORES=4
|
||||
fi
|
||||
|
||||
# For c/c++ code we run twice as many concurrent build
|
||||
# jobs than we have cores, otherwise we will stall on io.
|
||||
CONCURRENT_BUILD_JOBS=`expr $NUM_CORES \* 2`
|
||||
|
||||
if test "x$FOUND_CORES" = xyes; then
|
||||
AC_MSG_RESULT([$NUM_CORES])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect number of cores, defaulting to 1!])
|
||||
fi
|
||||
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_MEMORY_SIZE],
|
||||
[
|
||||
AC_MSG_CHECKING([for memory size])
|
||||
# Default to 1024MB
|
||||
MEMORY_SIZE=1024
|
||||
FOUND_MEM=no
|
||||
|
||||
if test -f /proc/cpuinfo; then
|
||||
# Looks like a Linux system
|
||||
MEMORY_SIZE=`cat /proc/meminfo | grep MemTotal | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE / 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/prtconf; then
|
||||
# Looks like a Solaris system
|
||||
MEMORY_SIZE=`/usr/sbin/prtconf | grep "Memory size" | awk '{ print [$]3 }'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test -x /usr/sbin/system_profiler; then
|
||||
# Looks like a MacOSX system
|
||||
MEMORY_SIZE=`/usr/sbin/system_profiler -detailLevel full SPHardwareDataType | grep 'Memory' | awk '{print [$]2}'`
|
||||
MEMORY_SIZE=`expr $MEMORY_SIZE \* 1024`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$build_os" = xwindows; then
|
||||
MEMORY_SIZE=`systeminfo | grep 'Total Physical Memory:' | awk '{ print [$]4 }' | sed 's/,//'`
|
||||
FOUND_MEM=yes
|
||||
fi
|
||||
|
||||
if test "x$FOUND_MEM" = xyes; then
|
||||
AC_MSG_RESULT([$MEMORY_SIZE MB])
|
||||
else
|
||||
AC_MSG_RESULT([could not detect memory size defaulting to 1024MB!])
|
||||
fi
|
||||
])
|
@ -23,11 +23,13 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
function prepare_help_system {
|
||||
AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP],
|
||||
[
|
||||
AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd)
|
||||
}
|
||||
|
||||
function help_on_build_dependency {
|
||||
])
|
||||
|
||||
AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY],
|
||||
[
|
||||
# Print a helpful message on how to acquire the necessary build dependency.
|
||||
# $1 is the help tag: freetyp2, cups, pulse, alsa etc
|
||||
MISSING_DEPENDENCY=$1
|
||||
@ -51,9 +53,9 @@ function help_on_build_dependency {
|
||||
if test "x$PKGHANDLER_COMMAND" != x; then
|
||||
HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
|
||||
fi
|
||||
}
|
||||
])
|
||||
|
||||
function apt_help {
|
||||
apt_help() {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
|
||||
@ -76,7 +78,7 @@ function apt_help {
|
||||
esac
|
||||
}
|
||||
|
||||
function yum_help {
|
||||
yum_help() {
|
||||
case $1 in
|
||||
devkit)
|
||||
PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
|
||||
@ -99,14 +101,97 @@ function yum_help {
|
||||
esac
|
||||
}
|
||||
|
||||
function port_help {
|
||||
port_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
function pkgutil_help {
|
||||
pkgutil_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
function pkgadd_help {
|
||||
pkgadd_help() {
|
||||
PKGHANDLER_COMMAND=""
|
||||
}
|
||||
|
||||
AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
|
||||
[
|
||||
# Finally output some useful information to the user
|
||||
|
||||
if test "x$CCACHE_FOUND" != x; then
|
||||
if test "x$HAS_GOOD_CCACHE" = x; then
|
||||
CCACHE_STATUS="installed, but disabled (version older than 3.1.4)"
|
||||
CCACHE_HELP_MSG="You have ccache installed, but it is a version prior to 3.1.4. Try upgrading."
|
||||
else
|
||||
CCACHE_STATUS="installed and in use"
|
||||
fi
|
||||
else
|
||||
if test "x$GCC" = xyes; then
|
||||
CCACHE_STATUS="not installed (consider installing)"
|
||||
CCACHE_HELP_MSG="You do not have ccache installed. Try installing it."
|
||||
else
|
||||
CCACHE_STATUS="not available for your system"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
printf "====================================================\n"
|
||||
printf "A new configuration has been successfully created in\n"
|
||||
printf "$OUTPUT_ROOT\n"
|
||||
if test "x$CONFIGURE_COMMAND_LINE" != x; then
|
||||
printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
|
||||
else
|
||||
printf "using default settings.\n"
|
||||
fi
|
||||
|
||||
printf "\n"
|
||||
printf "Configuration summary:\n"
|
||||
printf "* Debug level: $DEBUG_LEVEL\n"
|
||||
printf "* JDK variant: $JDK_VARIANT\n"
|
||||
printf "* JVM variants: $with_jvm_variants\n"
|
||||
printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
|
||||
printf "* Boot JDK: $BOOT_JDK\n"
|
||||
|
||||
printf "\n"
|
||||
printf "Build performance summary:\n"
|
||||
printf "* Cores to use: $NUM_CORES\n"
|
||||
printf "* Memory limit: $MEMORY_SIZE MB\n"
|
||||
printf "* ccache status: $CCACHE_STATUS\n"
|
||||
printf "\n"
|
||||
|
||||
if test "x$CCACHE_HELP_MSG" != x && test "x$HIDE_PERFORMANCE_HINTS" = "xno"; then
|
||||
printf "Build performance tip: ccache gives a tremendous speedup for C++ recompilations.\n"
|
||||
printf "$CCACHE_HELP_MSG\n"
|
||||
HELP_MSG_MISSING_DEPENDENCY([ccache])
|
||||
printf "$HELP_MSG\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xyes"; then
|
||||
printf "NOTE: You have requested to build more than one version of the JVM, which\n"
|
||||
printf "will result in longer build times.\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$FOUND_ALT_VARIABLES" != "x"; then
|
||||
printf "WARNING: You have old-style ALT_ environment variables set.\n"
|
||||
printf "These are not respected, and will be ignored. It is recommended\n"
|
||||
printf "that you clean your environment. The following variables are set:\n"
|
||||
printf "$FOUND_ALT_VARIABLES\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
|
||||
printf "WARNING: Your build output directory is not on a local disk.\n"
|
||||
printf "This will severely degrade build performance!\n"
|
||||
printf "It is recommended that you create an output directory on a local disk,\n"
|
||||
printf "and run the configure script again from that directory.\n"
|
||||
printf "\n"
|
||||
fi
|
||||
|
||||
if test "x$IS_RECONFIGURE" = "xyes"; then
|
||||
printf "WARNING: The result of this configuration has overridden an older\n"
|
||||
printf "configuration. You *should* run 'make clean' to make sure you get a\n"
|
||||
printf "proper build. Failure to do so might result in strange build problems.\n"
|
||||
printf "\n"
|
||||
fi
|
||||
])
|
||||
|
@ -23,272 +23,59 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
AC_DEFUN([CHECK_FIND_DELETE],
|
||||
[
|
||||
# Test if find supports -delete
|
||||
AC_MSG_CHECKING([if find supports -delete])
|
||||
FIND_DELETE="-delete"
|
||||
|
||||
DELETEDIR=`mktemp -d tmp.XXXXXXXXXX` || (echo Could not create temporary directory!; exit $?)
|
||||
|
||||
echo Hejsan > $DELETEDIR/TestIfFindSupportsDelete
|
||||
|
||||
TEST_DELETE=`$FIND "$DELETEDIR" -name TestIfFindSupportsDelete $FIND_DELETE 2>&1`
|
||||
if test -f $DELETEDIR/TestIfFindSupportsDelete; then
|
||||
# No, it does not.
|
||||
rm $DELETEDIR/TestIfFindSupportsDelete
|
||||
FIND_DELETE="-exec rm \{\} \+"
|
||||
AC_MSG_RESULT([no])
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
rmdir $DELETEDIR
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_NONEMPTY],
|
||||
[
|
||||
# Test that variable $1 is not empty.
|
||||
if test "" = "[$]$1"; then AC_MSG_ERROR(Could not find translit($1,A-Z,a-z) !); fi
|
||||
])
|
||||
|
||||
AC_DEFUN([ADD_JVM_ARG_IF_OK],
|
||||
[
|
||||
# Test if $1 is a valid argument to $3 (often is $JAVA passed as $3)
|
||||
# If so, then append $1 to $2
|
||||
FOUND_WARN=`$3 $1 -version 2>&1 | grep -i warn`
|
||||
FOUND_VERSION=`$3 $1 -version 2>&1 | grep " version \""`
|
||||
if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
|
||||
$2="[$]$2 $1"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD],
|
||||
[
|
||||
# Translate "gcc -E" into "`which gcc` -E" ie
|
||||
# extract the full path to the binary and at the
|
||||
# same time maintain any arguments passed to it.
|
||||
# The command MUST exist in the path, or else!
|
||||
tmp="[$]$1"
|
||||
car="${tmp%% *}"
|
||||
tmp="[$]$1 EOL"
|
||||
cdr="${tmp#* }"
|
||||
# On windows we want paths without spaces.
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
WHICHCMD_SPACESAFE(car)
|
||||
else
|
||||
# "which" is not portable, but is used here
|
||||
# because we know that the command exists!
|
||||
car=`which $car`
|
||||
fi
|
||||
if test "x$cdr" != xEOL; then
|
||||
$1="$car ${cdr% *}"
|
||||
else
|
||||
$1="$car"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SPACESAFE],
|
||||
[
|
||||
# Fail with message $2 if var $1 contains a path with no spaces in it.
|
||||
# Unless on Windows, where we can rewrite the path.
|
||||
HAS_SPACE=`echo "[$]$1" | grep " "`
|
||||
if test "x$HAS_SPACE" != x; then
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
$1=`$CYGPATH -s -m -a "[$]$1"`
|
||||
$1=`$CYGPATH -u "[$]$1"`
|
||||
else
|
||||
AC_MSG_ERROR([You cannot have spaces in $2! "[$]$1"])
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([WHICHCMD_SPACESAFE],
|
||||
[
|
||||
# Translate long cygdrive or C:\sdfsf path
|
||||
# into a short mixed mode path that has no
|
||||
# spaces in it.
|
||||
tmp="[$]$1"
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
tmp=`$CYGPATH -u "[$]$1"`
|
||||
tmp=`which "$tmp"`
|
||||
# If file exists with .exe appended, that's the real filename
|
||||
# and cygpath needs that to convert to short style path.
|
||||
if test -f "${tmp}.exe"; then
|
||||
tmp="${tmp}.exe"
|
||||
elif test -f "${tmp}.cmd"; then
|
||||
tmp="${tmp}.cmd"
|
||||
fi
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
fi
|
||||
$1="$tmp"
|
||||
])
|
||||
|
||||
AC_DEFUN([REMOVE_SYMBOLIC_LINKS],
|
||||
[
|
||||
if test "x$BUILD_OS" != xwindows; then
|
||||
# Follow a chain of symbolic links. Use readlink
|
||||
# where it exists, else fall back to horribly
|
||||
# complicated shell code.
|
||||
AC_PATH_PROG(READLINK, readlink)
|
||||
if test "x$READLINK_TESTED" != yes; then
|
||||
# On MacOSX there is a readlink tool with a different
|
||||
# purpose than the GNU readlink tool. Check the found readlink.
|
||||
ISGNU=`$READLINK --help 2>&1 | grep GNU`
|
||||
if test "x$ISGNU" = x; then
|
||||
# A readlink that we do not know how to use.
|
||||
# Are there other non-GNU readlinks out there?
|
||||
READLINK_TESTED=yes
|
||||
READLINK=
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$READLINK" != x; then
|
||||
$1=`$READLINK -f [$]$1`
|
||||
else
|
||||
STARTDIR=$PWD
|
||||
COUNTER=0
|
||||
DIR=`dirname [$]$1`
|
||||
FIL=`basename [$]$1`
|
||||
while test $COUNTER -lt 20; do
|
||||
ISLINK=`ls -l $DIR/$FIL | grep '\->' | sed -e 's/.*-> \(.*\)/\1/'`
|
||||
if test "x$ISLINK" == x; then
|
||||
# This is not a symbolic link! We are done!
|
||||
break
|
||||
fi
|
||||
# The link might be relative! We have to use cd to travel safely.
|
||||
cd $DIR
|
||||
cd `dirname $ISLINK`
|
||||
DIR=`pwd`
|
||||
FIL=`basename $ISLINK`
|
||||
let COUNTER=COUNTER+1
|
||||
done
|
||||
cd $STARTDIR
|
||||
$1=$DIR/$FIL
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([TESTFOR_PROG_CCACHE],
|
||||
[
|
||||
AC_ARG_ENABLE([ccache],
|
||||
[AS_HELP_STRING([--disable-ccache],
|
||||
[use ccache to speed up recompilations @<:@enabled@:>@])],
|
||||
[ENABLE_CCACHE=${enable_ccache}], [ENABLE_CCACHE=yes])
|
||||
if test "x$ENABLE_CCACHE" = xyes; then
|
||||
AC_PATH_PROG(CCACHE, ccache)
|
||||
else
|
||||
AC_MSG_CHECKING([for ccache])
|
||||
AC_MSG_RESULT([explicitly disabled])
|
||||
CCACHE=
|
||||
fi
|
||||
AC_SUBST(CCACHE)
|
||||
|
||||
AC_ARG_WITH([ccache-dir],
|
||||
[AS_HELP_STRING([--with-ccache-dir],
|
||||
[where to store ccache files @<:@~/.ccache@:>@])])
|
||||
|
||||
if test "x$with_ccache_dir" != x; then
|
||||
# When using a non home ccache directory, assume the use is to share ccache files
|
||||
# with other users. Thus change the umask.
|
||||
SET_CCACHE_DIR="CCACHE_DIR=$with_ccache_dir CCACHE_UMASK=002"
|
||||
fi
|
||||
CCACHE_FOUND=""
|
||||
if test "x$CCACHE" != x; then
|
||||
SETUP_CCACHE_USAGE
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SETUP_CCACHE_USAGE],
|
||||
[
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_FOUND="true"
|
||||
# Only use ccache if it is 3.1.4 or later, which supports
|
||||
# precompiled headers.
|
||||
AC_MSG_CHECKING([if ccache supports precompiled headers])
|
||||
HAS_GOOD_CCACHE=`($CCACHE --version | head -n 1 | grep -E 3.1.@<:@456789@:>@) 2> /dev/null`
|
||||
if test "x$HAS_GOOD_CCACHE" = x; then
|
||||
AC_MSG_RESULT([no, disabling ccache])
|
||||
CCACHE=
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if C-compiler supports ccache precompiled headers])
|
||||
PUSHED_FLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="-fpch-preprocess $CXXFLAGS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [CC_KNOWS_CCACHE_TRICK=yes], [CC_KNOWS_CCACHE_TRICK=no])
|
||||
CXXFLAGS="$PUSHED_FLAGS"
|
||||
if test "x$CC_KNOWS_CCACHE_TRICK" = xyes; then
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no, disabling ccaching of precompiled headers])
|
||||
CCACHE=
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$CCACHE" != x; then
|
||||
CCACHE_SLOPPINESS=time_macros
|
||||
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS $CCACHE"
|
||||
CCACHE_FLAGS=-fpch-preprocess
|
||||
|
||||
if test "x$SET_CCACHE_DIR" != x; then
|
||||
mkdir -p $CCACHE_DIR > /dev/null 2>&1
|
||||
chmod a+rwxs $CCACHE_DIR > /dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_HOST_AND_BUILD_AND_LEGACY_VARS],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS],
|
||||
[
|
||||
# Expects $host_os $host_cpu $build_os and $build_cpu
|
||||
# and $with_data_model to have been setup!
|
||||
# and $with_target_bits to have been setup!
|
||||
#
|
||||
# Translate the standard triplet(quadruplet) definition
|
||||
# of the host/build system into
|
||||
# HOST_OS=aix,bsd,hpux,linux,macosx,solaris,windows
|
||||
# HOST_OS_FAMILY=bsd,gnu,sysv,win32,wince
|
||||
# HOST_OS_API=posix,winapi
|
||||
# of the target/build system into
|
||||
# OPENJDK_TARGET_OS=aix,bsd,hpux,linux,macosx,solaris,windows
|
||||
# OPENJDK_TARGET_OS_FAMILY=bsd,gnu,sysv,win32,wince
|
||||
# OPENJDK_TARGET_OS_API=posix,winapi
|
||||
#
|
||||
# HOST_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
|
||||
# HOST_CPU_ARCH=x86,sparc,pcc,arm
|
||||
# HOST_CPU_BITS=32,64
|
||||
# HOST_CPU_ENDIAN=big,little
|
||||
# OPENJDK_TARGET_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
|
||||
# OPENJDK_TARGET_CPU_ARCH=x86,sparc,pcc,arm
|
||||
# OPENJDK_TARGET_CPU_BITS=32,64
|
||||
# OPENJDK_TARGET_CPU_ENDIAN=big,little
|
||||
#
|
||||
# The same values are setup for BUILD_...
|
||||
#
|
||||
# And the legacy variables, for controlling the old makefiles.
|
||||
# LEGACY_HOST_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_HOST_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_HOST_CPU3=sparcv9,amd64 (but only on solaris)
|
||||
# LEGACY_HOST_OS_API=solaris,windows
|
||||
# LEGACY_OPENJDK_TARGET_CPU1=i586,amd64/x86_64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_OPENJDK_TARGET_CPU2=i386,amd64,sparc,sparcv9,arm,arm64...
|
||||
# LEGACY_OPENJDK_TARGET_CPU3=sparcv9,amd64 (but only on solaris)
|
||||
# LEGACY_OPENJDK_TARGET_OS_API=solaris,windows
|
||||
#
|
||||
# We also copy the autoconf trip/quadruplet
|
||||
# verbatim to HOST and BUILD
|
||||
AC_SUBST(HOST, ${host})
|
||||
AC_SUBST(BUILD, ${build})
|
||||
# verbatim to OPENJDK_TARGET_SYSTEM (from the autoconf "host") and OPENJDK_BUILD_SYSTEM
|
||||
OPENJDK_TARGET_SYSTEM="$host"
|
||||
OPENJDK_BUILD_SYSTEM="$build"
|
||||
AC_SUBST(OPENJDK_TARGET_SYSTEM)
|
||||
AC_SUBST(OPENJDK_BUILD_SYSTEM)
|
||||
|
||||
EXTRACT_VARS_FROM_OS_TO(HOST,$host_os)
|
||||
EXTRACT_VARS_FROM_CPU_TO(HOST,$host_cpu)
|
||||
PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_TARGET,$host_os)
|
||||
PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_TARGET,$host_cpu)
|
||||
|
||||
EXTRACT_VARS_FROM_OS_TO(BUILD,$build_os)
|
||||
EXTRACT_VARS_FROM_CPU_TO(BUILD,$build_cpu)
|
||||
PLATFORM_EXTRACT_VARS_FROM_OS_TO(OPENJDK_BUILD,$build_os)
|
||||
PLATFORM_EXTRACT_VARS_FROM_CPU_TO(OPENJDK_BUILD,$build_cpu)
|
||||
|
||||
if test "x$HOST_OS" != xsolaris; then
|
||||
LEGACY_HOST_CPU3=""
|
||||
LEGACY_BUILD_CPU3=""
|
||||
if test "x$OPENJDK_TARGET_OS" != xsolaris; then
|
||||
LEGACY_OPENJDK_TARGET_CPU3=""
|
||||
LEGACY_OPENJDK_BUILD_CPU3=""
|
||||
fi
|
||||
|
||||
# On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_HOST_CPU1) ...
|
||||
if test "x$HOST_OS" = xmacosx && test "x$HOST_CPU" = xx64; then
|
||||
LEGACY_HOST_CPU1="x86_64"
|
||||
# On MacOSX and MacOSX only, we have a different name for the x64 CPU in ARCH (LEGACY_OPENJDK_TARGET_CPU1) ...
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$OPENJDK_TARGET_CPU" = xx64; then
|
||||
LEGACY_OPENJDK_TARGET_CPU1="x86_64"
|
||||
fi
|
||||
|
||||
SET_RELEASE_FILE_OS_VALUES()
|
||||
PLATFORM_SET_RELEASE_FILE_OS_VALUES
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS_TO],
|
||||
[
|
||||
EXTRACT_VARS_FROM_OS($2)
|
||||
PLATFORM_EXTRACT_VARS_FROM_OS($2)
|
||||
$1_OS="$VAR_OS"
|
||||
$1_OS_FAMILY="$VAR_OS_FAMILY"
|
||||
$1_OS_API="$VAR_OS_API"
|
||||
@ -306,9 +93,9 @@ AC_DEFUN([EXTRACT_VARS_FROM_OS_TO],
|
||||
AC_SUBST(LEGACY_$1_OS_API)
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_CPU_TO],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU_TO],
|
||||
[
|
||||
EXTRACT_VARS_FROM_CPU($2)
|
||||
PLATFORM_EXTRACT_VARS_FROM_CPU($2)
|
||||
$1_CPU="$VAR_CPU"
|
||||
$1_CPU_ARCH="$VAR_CPU_ARCH"
|
||||
$1_CPU_BITS="$VAR_CPU_BITS"
|
||||
@ -339,12 +126,12 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU_TO],
|
||||
LEGACY_$1_CPU3=amd64
|
||||
fi
|
||||
if test "x$$1_CPU" = xsparcv9; then
|
||||
LEGACY_$1_CPU3=sparvc9
|
||||
LEGACY_$1_CPU3=sparcv9
|
||||
fi
|
||||
AC_SUBST(LEGACY_$1_CPU3)
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU],
|
||||
[
|
||||
# First argument is the cpu name from the trip/quad
|
||||
case "$1" in
|
||||
@ -372,8 +159,8 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
arm*)
|
||||
VAR_CPU=arm
|
||||
VAR_CPU_ARCH=arm
|
||||
VAR_CPU_BITS=3264
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_CPU_BITS=32
|
||||
VAR_CPU_ENDIAN=little
|
||||
VAR_LEGACY_CPU=arm
|
||||
;;
|
||||
mips)
|
||||
@ -401,7 +188,7 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU=ppc64
|
||||
VAR_CPU_ARCH=ppc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=32
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=ppc64
|
||||
;;
|
||||
sparc)
|
||||
@ -416,7 +203,7 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
VAR_CPU_ARCH=sparc
|
||||
VAR_CPU_BITS=64
|
||||
VAR_CPU_ENDIAN=big
|
||||
VAR_LEGACY_CPU=sparc_sparcv9
|
||||
VAR_LEGACY_CPU=sparcv9
|
||||
;;
|
||||
s390)
|
||||
VAR_CPU=s390
|
||||
@ -452,21 +239,37 @@ AC_DEFUN([EXTRACT_VARS_FROM_CPU],
|
||||
fi
|
||||
fi
|
||||
|
||||
# on solaris x86...default seems to be 32-bit
|
||||
if test "x$VAR_OS" = "xsolaris" && \
|
||||
test "x$with_target_bits" = "x" && \
|
||||
test "x$VAR_CPU_ARCH" = "xx86"
|
||||
then
|
||||
with_target_bits=32
|
||||
fi
|
||||
|
||||
if test "x$VAR_CPU_ARCH" = "xx86"; then
|
||||
if test "x$with_data_model" = "x64"; then
|
||||
if test "x$with_target_bits" = "x64"; then
|
||||
VAR_CPU=x64
|
||||
VAR_CPU_BITS=64
|
||||
VAR_LEGACY_CPU=amd64
|
||||
fi
|
||||
if test "x$with_data_model" = "x32"; then
|
||||
if test "x$with_target_bits" = "x32"; then
|
||||
VAR_CPU=ia32
|
||||
VAR_CPU_BITS=32
|
||||
VAR_LEGACY_CPU=i586
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$VAR_CPU_ARCH" = "xsparc"; then
|
||||
if test "x$with_target_bits" = "x64"; then
|
||||
VAR_CPU=sparcv9
|
||||
VAR_CPU_BITS=64
|
||||
VAR_LEGACY_CPU=sparcv9
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([EXTRACT_VARS_FROM_OS],
|
||||
AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_OS],
|
||||
[
|
||||
case "$1" in
|
||||
*linux*)
|
||||
@ -495,49 +298,26 @@ AC_DEFUN([EXTRACT_VARS_FROM_OS],
|
||||
VAR_OS_FAMILY=windows
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([unsupported host operating system $1])
|
||||
AC_MSG_ERROR([unsupported operating system $1])
|
||||
;;
|
||||
esac
|
||||
])
|
||||
|
||||
AC_DEFUN([CHECK_COMPILER_VERSION],
|
||||
AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES],
|
||||
[
|
||||
# Test the compilers that their versions are new enough.
|
||||
# AC_MSG_CHECKING([version of GCC])
|
||||
gcc_ver=`${CC} -dumpversion`
|
||||
gcc_major_ver=`echo ${gcc_ver}|cut -d'.' -f1`
|
||||
gcc_minor_ver=`echo ${gcc_ver}|cut -d'.' -f2`
|
||||
# AM_CONDITIONAL(GCC_OLD, test ! ${gcc_major_ver} -ge 4 -a ${gcc_minor_ver} -ge 3)
|
||||
# AC_MSG_RESULT([${gcc_ver} (major version ${gcc_major_ver}, minor version ${gcc_minor_ver})])
|
||||
])
|
||||
|
||||
# Fixes paths on windows hosts to be mixed mode short.
|
||||
AC_DEFUN([WIN_FIX_PATH],
|
||||
[
|
||||
if test "x$BUILD_OS" = "xwindows"; then
|
||||
AC_PATH_PROG(CYGPATH, cygpath)
|
||||
tmp="[$]$1"
|
||||
# Convert to C:/ mixed style path without spaces.
|
||||
tmp=`$CYGPATH -s -m "$tmp"`
|
||||
$1="$tmp"
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([SET_RELEASE_FILE_OS_VALUES],
|
||||
[
|
||||
if test "x$HOST_OS" = "xsolaris"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then
|
||||
REQUIRED_OS_NAME=SunOS
|
||||
REQUIRED_OS_VERSION=5.10
|
||||
fi
|
||||
if test "x$HOST_OS" = "xlinux"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xlinux"; then
|
||||
REQUIRED_OS_NAME=Linux
|
||||
REQUIRED_OS_VERSION=2.6
|
||||
fi
|
||||
if test "x$HOST_OS" = "xwindows"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
REQUIRED_OS_NAME=Windows
|
||||
REQUIRED_OS_VERSION=5.1
|
||||
fi
|
||||
if test "x$HOST_OS" = "xmacosx"; then
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||
REQUIRED_OS_NAME=Darwin
|
||||
REQUIRED_OS_VERSION=11.2
|
||||
fi
|
||||
@ -545,3 +325,174 @@ AC_DEFUN([SET_RELEASE_FILE_OS_VALUES],
|
||||
AC_SUBST(REQUIRED_OS_NAME)
|
||||
AC_SUBST(REQUIRED_OS_VERSION)
|
||||
])
|
||||
|
||||
#%%% Build and target systems %%%
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET],
|
||||
[
|
||||
# Figure out the build and target systems. # Note that in autoconf terminology, "build" is obvious, but "target"
|
||||
# is confusing; it assumes you are cross-compiling a cross-compiler (!) and "target" is thus the target of the
|
||||
# product you're building. The target of this build is called "host". Since this is confusing to most people, we
|
||||
# have not adopted that system, but use "target" as the platform we are building for. In some places though we need
|
||||
# to use the configure naming style.
|
||||
AC_CANONICAL_BUILD
|
||||
AC_CANONICAL_HOST
|
||||
AC_CANONICAL_TARGET
|
||||
|
||||
AC_ARG_WITH(target-bits, [AS_HELP_STRING([--with-target-bits],
|
||||
[build 32-bit or 64-bit binaries (for platforms that support it), e.g. --with-target-bits=32 @<:@guessed@:>@])])
|
||||
|
||||
if test "x$with_target_bits" != x && \
|
||||
test "x$with_target_bits" != x32 && \
|
||||
test "x$with_target_bits" != x64 ; then
|
||||
AC_MSG_ERROR([--with-target-bits can only be 32 or 64, you specified $with_target_bits!])
|
||||
fi
|
||||
# Translate the standard cpu-vendor-kernel-os quadruplets into
|
||||
# the new TARGET_.... and BUILD_... and the legacy names used by
|
||||
# the openjdk build.
|
||||
# It uses $host_os $host_cpu $build_os $build_cpu and $with_target_bits
|
||||
PLATFORM_EXTRACT_TARGET_AND_BUILD_AND_LEGACY_VARS
|
||||
|
||||
# The LEGACY_OPENJDK_TARGET_CPU3 is the setting for ISA_DIR.
|
||||
if test "x$LEGACY_OPENJDK_TARGET_CPU3" != x; then
|
||||
LEGACY_OPENJDK_TARGET_CPU3="/${LEGACY_OPENJDK_TARGET_CPU3}"
|
||||
fi
|
||||
|
||||
# Now the following vars are defined.
|
||||
# OPENJDK_TARGET_OS=aix,bsd,hpux,linux,macosx,solaris,windows
|
||||
# OPENJDK_TARGET_OS_FAMILY=bsd,gnu,sysv,win32,wince
|
||||
# OPENJDK_TARGET_OS_API=posix,winapi
|
||||
#
|
||||
# OPENJDK_TARGET_CPU=ia32,x64,sparc,sparcv9,arm,arm64,ppc,ppc64
|
||||
# OPENJDK_TARGET_CPU_ARCH=x86,sparc,pcc,arm
|
||||
# OPENJDK_TARGET_CPU_BITS=32,64
|
||||
# OPENJDK_TARGET_CPU_ENDIAN=big,little
|
||||
#
|
||||
# There is also a:
|
||||
# LEGACY_OPENJDK_TARGET_CPU1=i586,amd64,.... # used to set the old var ARCH
|
||||
# LEGACY_OPENJDK_TARGET_CPU2=i386,amd64,.... # used to set the old var LIBARCH
|
||||
# LEGACY_OPENJDK_TARGET_CPU3=only sparcv9,amd64 # used to set the ISA_DIR on Solaris
|
||||
# There was also a BUILDARCH that had i486,amd64,... but we do not use that
|
||||
# in the new build.
|
||||
# LEGACY_OPENJDK_TARGET_OS_API=solaris,windows # used to select source roots
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_OS_VERSION],
|
||||
[
|
||||
###############################################################################
|
||||
|
||||
# Note that this is the build platform OS version!
|
||||
|
||||
OS_VERSION="`uname -r | ${SED} 's!\.! !g' | ${SED} 's!-! !g'`"
|
||||
OS_VERSION_MAJOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 1 -d ' '`"
|
||||
OS_VERSION_MINOR="`${ECHO} ${OS_VERSION} | ${CUT} -f 2 -d ' '`"
|
||||
OS_VERSION_MICRO="`${ECHO} ${OS_VERSION} | ${CUT} -f 3 -d ' '`"
|
||||
AC_SUBST(OS_VERSION_MAJOR)
|
||||
AC_SUBST(OS_VERSION_MINOR)
|
||||
AC_SUBST(OS_VERSION_MICRO)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_TEST_OPENJDK_TARGET_BITS],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Now we check if libjvm.so will use 32 or 64 bit pointers for the C/C++ code.
|
||||
# (The JVM can use 32 or 64 bit Java pointers but that decision
|
||||
# is made at runtime.)
|
||||
#
|
||||
AC_LANG_PUSH(C++)
|
||||
OLD_CXXFLAGS="$CXXFLAGS"
|
||||
if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then
|
||||
CXXFLAGS="-m${with_target_bits} $CXXFLAGS"
|
||||
fi
|
||||
AC_CHECK_SIZEOF([int *], [1111])
|
||||
CXXFLAGS="$OLD_CXXFLAGS"
|
||||
AC_LANG_POP(C++)
|
||||
|
||||
# keep track of c/cxx flags that we added outselves...
|
||||
# to prevent emitting warning...
|
||||
ADDED_CFLAGS=
|
||||
ADDED_CXXFLAGS=
|
||||
ADDED_LDFLAGS=
|
||||
|
||||
if test "x$ac_cv_sizeof_int_p" = x0; then
|
||||
# The test failed, lets pick the assumed value.
|
||||
ARCH_DATA_MODEL=$OPENJDK_TARGET_CPU_BITS
|
||||
else
|
||||
ARCH_DATA_MODEL=`expr 8 \* $ac_cv_sizeof_int_p`
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" != xwindows && test "x$with_target_bits" != x; then
|
||||
ADDED_CFLAGS=" -m${with_target_bits}"
|
||||
ADDED_CXXFLAGS=" -m${with_target_bits}"
|
||||
ADDED_LDFLAGS=" -m${with_target_bits}"
|
||||
|
||||
CFLAGS="${CFLAGS}${ADDED_CFLAGS}"
|
||||
CXXFLAGS="${CXXFLAGS}${ADDED_CXXFLAGS}"
|
||||
LDFLAGS="${LDFLAGS}${ADDED_LDFLAGS}"
|
||||
|
||||
CFLAGS_JDK="${CFLAGS_JDK}${ADDED_CFLAGS}"
|
||||
CXXFLAGS_JDK="${CXXFLAGS_JDK}${ADDED_CXXFLAGS}"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK}${ADDED_LDFLAGS}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$ARCH_DATA_MODEL" = x64; then
|
||||
A_LP64="LP64:="
|
||||
ADD_LP64="-D_LP64=1"
|
||||
fi
|
||||
AC_MSG_CHECKING([for target address size])
|
||||
AC_MSG_RESULT([$ARCH_DATA_MODEL bits])
|
||||
AC_SUBST(LP64,$A_LP64)
|
||||
AC_SUBST(ARCH_DATA_MODEL)
|
||||
|
||||
if test "x$ARCH_DATA_MODEL" != "x$OPENJDK_TARGET_CPU_BITS"; then
|
||||
AC_MSG_ERROR([The tested number of bits in the target ($ARCH_DATA_MODEL) differs from the number of bits expected to be found in the target ($OPENJDK_TARGET_CPU_BITS)])
|
||||
fi
|
||||
|
||||
#
|
||||
# NOTE: check for -mstackrealign needs to be below potential addition of -m32
|
||||
#
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x32 && test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# On 32-bit MacOSX the OS requires C-entry points to be 16 byte aligned.
|
||||
# While waiting for a better solution, the current workaround is to use -mstackrealign.
|
||||
CFLAGS="$CFLAGS -mstackrealign"
|
||||
AC_MSG_CHECKING([if 32-bit compiler supports -mstackrealign])
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
|
||||
[
|
||||
AC_MSG_RESULT([yes])
|
||||
],
|
||||
[
|
||||
AC_MSG_RESULT([no])
|
||||
AC_MSG_ERROR([The selected compiler $CXX does not support -mstackrealign! Try to put another compiler in the path.])
|
||||
])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Is the target little of big endian?
|
||||
#
|
||||
AC_C_BIGENDIAN([ENDIAN="big"],[ENDIAN="little"],[ENDIAN="unknown"],[ENDIAN="universal_endianness"])
|
||||
|
||||
if test "x$ENDIAN" = xuniversal_endianness; then
|
||||
AC_MSG_ERROR([Building with both big and little endianness is not supported])
|
||||
fi
|
||||
if test "x$ENDIAN" = xunknown; then
|
||||
ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN"
|
||||
fi
|
||||
if test "x$ENDIAN" != "x$OPENJDK_TARGET_CPU_ENDIAN"; then
|
||||
AC_MSG_WARN([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)])
|
||||
ENDIAN="$OPENJDK_TARGET_CPU_ENDIAN"
|
||||
fi
|
||||
AC_SUBST(ENDIAN)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ISADIR],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Could someone enlighten this configure script with a comment about libCrun?
|
||||
#
|
||||
#
|
||||
])
|
||||
|
@ -23,8 +23,8 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Configured @DATE_WHEN_CONFIGURED@ to build for a @HOST@ system,
|
||||
# using ./configure @CONFIGURE_COMMAND_LINE@
|
||||
# Configured @DATE_WHEN_CONFIGURED@ to build for a @OPENJDK_TARGET_SYSTEM@ system,
|
||||
# using 'configure @CONFIGURE_COMMAND_LINE@'
|
||||
|
||||
# When calling macros, the spaces between arguments are
|
||||
# often semantically important! Sometimes we need to subst
|
||||
@ -67,48 +67,50 @@ SPEC:=@SPEC@
|
||||
# The "human readable" name of this configuration
|
||||
CONF_NAME:=@CONF_NAME@
|
||||
|
||||
# The built jdk will run in this host system.
|
||||
HOST:=@HOST@
|
||||
HOST_OS:=@HOST_OS@
|
||||
HOST_OS_FAMILY:=@HOST_OS_FAMILY@
|
||||
HOST_OS_API:=@HOST_OS_API@
|
||||
# The built jdk will run in this target system.
|
||||
OPENJDK_TARGET_SYSTEM:=@OPENJDK_TARGET_SYSTEM@
|
||||
|
||||
HOST_CPU:=@HOST_CPU@
|
||||
HOST_CPU_ARCH:=@HOST_CPU_ARCH@
|
||||
HOST_CPU_BITS:=@HOST_CPU_BITS@
|
||||
HOST_CPU_ENDIAN:=@HOST_CPU_ENDIAN@
|
||||
OPENJDK_TARGET_OS:=@OPENJDK_TARGET_OS@
|
||||
OPENJDK_TARGET_OS_FAMILY:=@OPENJDK_TARGET_OS_FAMILY@
|
||||
OPENJDK_TARGET_OS_API:=@OPENJDK_TARGET_OS_API@
|
||||
|
||||
OPENJDK_TARGET_CPU:=@OPENJDK_TARGET_CPU@
|
||||
OPENJDK_TARGET_CPU_ARCH:=@OPENJDK_TARGET_CPU_ARCH@
|
||||
OPENJDK_TARGET_CPU_BITS:=@OPENJDK_TARGET_CPU_BITS@
|
||||
OPENJDK_TARGET_CPU_ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@
|
||||
|
||||
# We are building on this build system.
|
||||
# When not cross-compiling, it is the same as the host.
|
||||
BUILD:=@BUILD@
|
||||
BUILD_OS:=@BUILD_OS@
|
||||
BUILD_OS_FAMILY:=@BUILD_OS_FAMILY@
|
||||
BUILD_OS_API:=@BUILD_OS_API@
|
||||
# When not cross-compiling, it is the same as the target.
|
||||
OPENJDK_BUILD_SYSTEM:=@OPENJDK_BUILD_SYSTEM@
|
||||
|
||||
BUILD_CPU:=@BUILD_CPU@
|
||||
BUILD_CPU_ARCH:=@BUILD_CPU_ARCH@
|
||||
BUILD_CPU_BITS:=@BUILD_CPU_BITS@
|
||||
BUILD_CPU_ENDIAN:=@BUILD_CPU_ENDIAN@
|
||||
OPENJDK_BUILD_OS:=@OPENJDK_BUILD_OS@
|
||||
OPENJDK_BUILD_OS_FAMILY:=@OPENJDK_BUILD_OS_FAMILY@
|
||||
OPENJDK_BUILD_OS_API:=@OPENJDK_BUILD_OS_API@
|
||||
|
||||
OPENJDK_BUILD_CPU:=@OPENJDK_BUILD_CPU@
|
||||
OPENJDK_BUILD_CPU_ARCH:=@OPENJDK_BUILD_CPU_ARCH@
|
||||
OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@
|
||||
OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@
|
||||
|
||||
# Legacy OS values for use in release file.
|
||||
REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@
|
||||
REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@
|
||||
|
||||
# Old name for HOST_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
|
||||
PLATFORM:=@HOST_OS@
|
||||
# Old name for HOST_CPU, uses i586 and amd64, instead of ia32 and x64.
|
||||
ARCH:=@LEGACY_HOST_CPU1@
|
||||
# Old name for OPENJDK_TARGET_OS (aix,bsd,hpux,linux,macosx,solaris,windows etc)
|
||||
PLATFORM:=@OPENJDK_TARGET_OS@
|
||||
# Old name for OPENJDK_TARGET_CPU, uses i586 and amd64, instead of ia32 and x64.
|
||||
ARCH:=@LEGACY_OPENJDK_TARGET_CPU1@
|
||||
# Yet another name for arch used for an extra subdir below the jvm lib.
|
||||
# Uses i386 and amd64, instead of ia32 and x64.
|
||||
LIBARCH:=@LEGACY_HOST_CPU2@
|
||||
LIBARCH:=@LEGACY_OPENJDK_TARGET_CPU2@
|
||||
# Use to switch between solaris and windows subdirs in the jdk.
|
||||
LEGACY_HOST_OS_API:=@LEGACY_HOST_OS_API@
|
||||
LEGACY_OPENJDK_TARGET_OS_API:=@LEGACY_OPENJDK_TARGET_OS_API@
|
||||
# 32 or 64 bit
|
||||
ARCH_DATA_MODEL:=@HOST_CPU_BITS@
|
||||
ARCH_DATA_MODEL:=@OPENJDK_TARGET_CPU_BITS@
|
||||
# Legacy setting for building for a 64 bit machine.
|
||||
# If yes then this expands to _LP64:=1
|
||||
@LP64@
|
||||
ENDIAN:=@HOST_CPU_ENDIAN@
|
||||
ENDIAN:=@OPENJDK_TARGET_CPU_ENDIAN@
|
||||
@SET_OPENJDK@
|
||||
JIGSAW:=@JIGSAW@
|
||||
LIBM:=-lm
|
||||
@ -185,7 +187,6 @@ SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
|
||||
# The java launcher uses the default.
|
||||
# The other can be selected by specifying -client -server -kernel -zero or -zeroshark
|
||||
# on the java launcher command line.
|
||||
DEFAULT_JVM_VARIANT:=@DEFAULT_JVM_VARIANT@
|
||||
JVM_VARIANTS:=@JVM_VARIANTS@
|
||||
JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
|
||||
JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
|
||||
@ -202,53 +203,42 @@ DEBUG_CLASSFILES:=@DEBUG_CLASSFILES@
|
||||
# Legacy setting: -debug or -fastdebug
|
||||
BUILD_VARIANT_RELEASE:=@BUILD_VARIANT_RELEASE@
|
||||
|
||||
LANGTOOLS_OUTPUTDIR:=@OUTPUT_ROOT@/langtools
|
||||
LANGTOOLS_DIST:=@OUTPUT_ROOT@/langtools/dist
|
||||
LANGTOOLS_MAKE_ARGS:=@LANGTOOLS_MAKE_ARGS@
|
||||
|
||||
CORBA_OUTPUTDIR:=@OUTPUT_ROOT@/corba
|
||||
CORBA_DIST:=@OUTPUT_ROOT@/corba/dist
|
||||
CORBA_MAKE_ARGS:=@CORBA_MAKE_ARGS@
|
||||
|
||||
JAXP_OUTPUTDIR:=@OUTPUT_ROOT@/jaxp
|
||||
JAXP_DIST:=@OUTPUT_ROOT@/jaxp/dist
|
||||
JAXP_MAKE_ARGS:=@JAXP_MAKE_ARGS@
|
||||
|
||||
JAXWS_OUTPUTDIR:=@OUTPUT_ROOT@/jaxws
|
||||
JAXWS_DIST:=@OUTPUT_ROOT@/jaxws/dist
|
||||
JAXWS_MAKE_ARGS:=@JAXWS_MAKE_ARGS@
|
||||
|
||||
HOTSPOT_OUTPUTDIR:=@OUTPUT_ROOT@/hotspot
|
||||
HOTSPOT_DIST:=@OUTPUT_ROOT@/hotspot/dist
|
||||
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
|
||||
LANGTOOLS_OUTPUTDIR:=@LANGTOOLS_OUTPUTDIR@
|
||||
CORBA_OUTPUTDIR:=@CORBA_OUTPUTDIR@
|
||||
JAXP_OUTPUTDIR:=@JAXP_OUTPUTDIR@
|
||||
JAXWS_OUTPUTDIR:=@JAXWS_OUTPUTDIR@
|
||||
HOTSPOT_OUTPUTDIR:=@HOTSPOT_OUTPUTDIR@
|
||||
|
||||
# This where a working jvm is built.
|
||||
# You can run $(JDK_OUTPUTDIR)/bin/java
|
||||
# Though the layout of the contents of $(JDK_OUTPUTDIR) is not
|
||||
# yet the same as a default installation.
|
||||
HOTSPOT_IMPORT_PATH:=@OUTPUT_ROOT@/hotspot/dist
|
||||
JDK_OUTPUTDIR:=@OUTPUT_ROOT@/jdk
|
||||
JDK_MAKE_ARGS:=@JDK_MAKE_ARGS@
|
||||
|
||||
# When you run "make install" it will create the standardized
|
||||
# layout for the jdk and the jre inside the images subdir.
|
||||
# Then it will copy the contents of the jdk into the installation
|
||||
# directory.
|
||||
IMAGES_OUTPUTDIR:=@OUTPUT_ROOT@/images
|
||||
IMAGES_MAKE_ARGS:=@IMAGES_MAKE_ARGS@
|
||||
|
||||
LANGTOOLS_DIST:=@LANGTOOLS_DIST@
|
||||
CORBA_DIST:=@CORBA_DIST@
|
||||
JAXP_DIST:=@JAXP_DIST@
|
||||
JAXWS_DIST:=@JAXWS_DIST@
|
||||
HOTSPOT_DIST:=@HOTSPOT_DIST@
|
||||
|
||||
# Legacy variables used by Release.gmk
|
||||
JDK_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2sdk-image
|
||||
JRE_IMAGE_DIR:=$(IMAGES_OUTPUTDIR)/j2re-image
|
||||
|
||||
# Can be /sparcv9 or /amd64 on Solaris
|
||||
ISA_DIR:=@LEGACY_HOST_CPU3@
|
||||
ISA_DIR:=@LEGACY_OPENJDK_TARGET_CPU3@
|
||||
BINDIR:=$(JDK_OUTPUTDIR)/bin$(ISA_DIR)
|
||||
|
||||
# The boot jdk to use
|
||||
ALT_BOOTDIR:=@BOOT_JDK@
|
||||
BOOT_JDK:=@BOOT_JDK@
|
||||
BOOT_JDK_JVMARGS:=@BOOT_JDK_JVMARGS@
|
||||
BOOT_JAVAC_ARGS:=@BOOT_JAVAC_ARGS@
|
||||
BOOT_RTJAR:=@BOOT_RTJAR@
|
||||
BOOT_TOOLSJAR:=@BOOT_TOOLSJAR@
|
||||
|
||||
@ -258,8 +248,6 @@ BOOT_JDK_SOURCETARGET:=@BOOT_JDK_SOURCETARGET@
|
||||
|
||||
# Information about the build system
|
||||
NUM_CORES:=@NUM_CORES@
|
||||
# This is used from the libjvm build for C/C++ code.
|
||||
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# This is used from the jdk build for C/C++ code.
|
||||
PARALLEL_COMPILE_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# Store javac server synchronization files here, and
|
||||
@ -282,6 +270,8 @@ JAVAC_SERVER_CORES:=@JAVAC_SERVER_CORES@
|
||||
JAVAC_USE_DEPS:=@JAVAC_USE_DEPS@
|
||||
# We can invoke javac: SINGLE_THREADED_BATCH or MULTI_CORE_CONCURRENT
|
||||
JAVAC_USE_MODE:=@JAVAC_USE_MODE@
|
||||
# Enable not yet complete sjavac support.
|
||||
ENABLE_SJAVAC:=@ENABLE_SJAVAC@
|
||||
|
||||
# The OpenJDK makefiles should be changed to using the standard
|
||||
# configure output ..._CFLAGS and ..._LIBS. In the meantime we
|
||||
@ -375,22 +365,24 @@ LDEXECXX:=@UNCYGDRIVE@ @LDEXECXX@
|
||||
@DEFINE_CROSS_COMPILE_ARCH@
|
||||
# The HOSTCC should really be named BUILDCC, ie build executable for
|
||||
# the build platform. Same as CC when not cross compiling.
|
||||
HOSTCC:=@HOSTCC@
|
||||
HOSTCXX:=@HOSTCXX@
|
||||
HOSTCC:=@UNCYGDRIVE@ @HOSTCC@
|
||||
HOSTCXX:=@UNCYGDRIVE@ @HOSTCXX@
|
||||
# And of course, the jdk spells HOSTCC as NIO_CC/HOST_CC
|
||||
HOST_CC:=@HOSTCC@
|
||||
NIO_CC:=@HOSTCC@
|
||||
HOST_CC:=@UNCYGDRIVE@ @HOSTCC@
|
||||
NIO_CC:=@UNCYGDRIVE@ @HOSTCC@
|
||||
|
||||
AS:=@AS@
|
||||
HOST_LD:=@UNCYGDRIVE@ @HOSTLD@
|
||||
|
||||
AS:=@UNCYGDRIVE@ @AS@
|
||||
ASFLAGS:=@ASFLAGS@
|
||||
|
||||
# AR is used to create a static library (is ar in posix, lib.exe in winapi)
|
||||
AR:=@UNCYGDRIVE@ @AR@
|
||||
ARFLAGS:=@ARFLAGS@
|
||||
|
||||
NM:=@NM@
|
||||
STRIP:=@STRIP@
|
||||
MCS:=@MCS@
|
||||
NM:=@UNCYGDRIVE@ @NM@
|
||||
STRIP:=@UNCYGDRIVE@ @STRIP@
|
||||
MCS:=@UNCYGDRIVE@ @MCS@
|
||||
|
||||
# Command to create a shared library
|
||||
SHARED_LIBRARY_FLAGS:=@SHARED_LIBRARY_FLAGS@
|
||||
@ -404,6 +396,17 @@ SET_SHARED_LIBRARY_MAPFILE=@SET_SHARED_LIBRARY_MAPFILE@
|
||||
C_FLAG_REORDER:=@C_FLAG_REORDER@
|
||||
CXX_FLAG_REORDER:=@CXX_FLAG_REORDER@
|
||||
|
||||
#
|
||||
# Options for generating debug symbols
|
||||
ENABLE_DEBUG_SYMBOLS:=@ENABLE_DEBUG_SYMBOLS@
|
||||
CFLAGS_DEBUG_SYMBOLS:=@CFLAGS_DEBUG_SYMBOLS@
|
||||
CXXFLAGS_DEBUG_SYMBOLS:=@CXXFLAGS_DEBUG_SYMBOLS@
|
||||
ZIP_DEBUGINFO_FILES:=@ZIP_DEBUGINFO_FILES@
|
||||
|
||||
#
|
||||
# Compress (or not) jars
|
||||
COMPRESS_JARS=@COMPRESS_JARS@
|
||||
|
||||
# Options to linker to specify the library name.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
|
||||
@ -507,23 +510,28 @@ READELF:=@READELF@
|
||||
EXPR:=@EXPR@
|
||||
FILE:=@FILE@
|
||||
HG:=@HG@
|
||||
OBJCOPY:=@OBJCOPY@
|
||||
|
||||
UNCYGDRIVE:=@UNCYGDRIVE@
|
||||
|
||||
# Where the build output is stored for your convenience.
|
||||
BUILD_LOG:=@BUILD_LOG@
|
||||
BUILD_LOG_PREVIOUS:=@BUILD_LOG_PREVIOUS@
|
||||
BUILD_LOG_WRAPPER:=@BUILD_LOG_WRAPPER@
|
||||
|
||||
# Build setup
|
||||
ENABLE_DOCS:=@ENABLE_DOCS@
|
||||
GENERATE_DOCS:=@ENABLE_DOCS@
|
||||
DISABLE_NIMBUS:=@DISABLE_NIMBUS@
|
||||
ENABLE_JFR=@ENABLE_JFR@
|
||||
USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@
|
||||
USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@
|
||||
USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@
|
||||
LIBZIP_CAN_USE_MMAP:=@LIBZIP_CAN_USE_MMAP@
|
||||
CHECK_FOR_VCINSTALLDIR=@CHECK_FOR_VCINSTALLDIR@
|
||||
MSVCRNN_DLL:=@MSVCR100DLL@
|
||||
|
||||
|
||||
# ADD_SRCS takes a single argument with source roots
|
||||
# and appends any corresponding source roots found
|
||||
# below --with-add-source-root and below
|
||||
@ -551,6 +559,17 @@ else
|
||||
OVR_SRCS:=
|
||||
endif
|
||||
|
||||
####################################################
|
||||
#
|
||||
# Legacy Hotspot support
|
||||
|
||||
HOTSPOT_DIST:=@HOTSPOT_DIST@
|
||||
HOTSPOT_MAKE_ARGS:=@HOTSPOT_MAKE_ARGS@
|
||||
# This is used from the libjvm build for C/C++ code.
|
||||
HOTSPOT_BUILD_JOBS:=@CONCURRENT_BUILD_JOBS@
|
||||
# Control wether Hotspot runs Queens test after building
|
||||
TEST_IN_BUILD=@TEST_IN_BUILD@
|
||||
|
||||
####################################################
|
||||
#
|
||||
# INSTALLATION
|
||||
@ -611,10 +630,9 @@ INSTALL_SYSCONFDIR=@sysconfdir@
|
||||
# Name of Service Agent library
|
||||
SALIB_NAME=@SALIB_NAME@
|
||||
|
||||
# Control wether Hotspot runs Queens test after building
|
||||
TEST_IN_BUILD=@TEST_IN_BUILD@
|
||||
|
||||
OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
|
||||
OS_VERSION_MINOR:=@OS_VERSION_MINOR@
|
||||
OS_VERSION_MICRO:=@OS_VERSION_MICRO@
|
||||
|
||||
# Include the closed-spec.gmk file if it exists
|
||||
-include $(dir @SPEC@)/closed-spec.gmk
|
||||
|
@ -177,40 +177,44 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
PERM="gstat -c%a"
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
PERM=
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
PERM="stat -f%p"
|
||||
elif [ "`uname`" == "Linux" ]; then
|
||||
PERM="stat -c%A"
|
||||
else
|
||||
PERM="stat -c%a"
|
||||
fi
|
||||
echo -n Permissions...
|
||||
found=""
|
||||
for f in `cd $OLD && find . -type f`
|
||||
do
|
||||
if [ ! -f ${OLD}/$f ]; then continue; fi
|
||||
if [ ! -f ${NEW}/$f ]; then continue; fi
|
||||
OP=`ls -l ${OLD}/$f | awk '{printf("%.10s\n", $1);}'`
|
||||
NP=`ls -l ${NEW}/$f | awk '{printf("%.10s\n", $1);}'`
|
||||
if [ "$OP" != "$NP" ]
|
||||
then
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
printf "\told: ${OP} new: ${NP}\t$f\n"
|
||||
fi
|
||||
|
||||
if [ "${PERM}" ]
|
||||
then
|
||||
echo -n Permissions...
|
||||
found=""
|
||||
for f in `cd $OLD && find . -type f`
|
||||
do
|
||||
if [ ! -f ${OLD}/$f ]; then continue; fi
|
||||
if [ ! -f ${NEW}/$f ]; then continue; fi
|
||||
OP=`${PERM} ${OLD}/$f`
|
||||
NP=`${PERM} ${NEW}/$f`
|
||||
if [ "$OP" != "$NP" ]
|
||||
OF=`cd ${OLD} && file $f`
|
||||
NF=`cd ${NEW} && file $f`
|
||||
if [ "$f" = "./src.zip" ]
|
||||
then
|
||||
if [ "`echo $OF | grep -ic zip`" -gt 0 -a "`echo $NF | grep -ic zip`" -gt 0 ]
|
||||
then
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
printf "\told: ${OP} new: ${NP}\t$f\n"
|
||||
# the way we produces zip-files make it so that directories are stored in old file
|
||||
# but not in new (only files with full-path)
|
||||
# this makes file-5.09 report them as different
|
||||
continue;
|
||||
fi
|
||||
done
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$OF" != "$NF" ]
|
||||
then
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
printf "\tFILE: old: ${OF} new: ${NF}\t$f\n"
|
||||
fi
|
||||
done
|
||||
if [ -z "$found" ]; then echo ; found="yes"; fi
|
||||
|
||||
GENERAL_FILES=$(cd $OLD && find . -type f ! -name "*.so" ! -name "*.jar" ! -name "*.zip" \
|
||||
! -name "*.debuginfo" ! -name "*.dylib" ! -name "jexec" \
|
||||
! -name "ct.sym" \
|
||||
! -name "ct.sym" ! -name "*.diz" \
|
||||
| grep -v "./bin/" | sort | $FILTER)
|
||||
echo General files...
|
||||
for f in $GENERAL_FILES
|
||||
|
@ -49,21 +49,24 @@ then
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
NM=gnm
|
||||
STAT="gstat -c%s"
|
||||
if [ -f "`which nm`" ]; then
|
||||
NM=nm
|
||||
elif [ -f "`which gnm`" ]; then
|
||||
NM=gnm
|
||||
else
|
||||
echo "No nm command found"
|
||||
exit 10
|
||||
fi
|
||||
LDD=ldd
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
|
||||
NM_ARGS=/exports
|
||||
STAT="stat -c%s"
|
||||
LDD=
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
NM=nm
|
||||
STAT="stat -f%z"
|
||||
LDD="otool -L"
|
||||
else
|
||||
NM=nm
|
||||
STAT="stat -c%s"
|
||||
LDD=ldd
|
||||
fi
|
||||
|
||||
@ -79,8 +82,8 @@ fi
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
OLD_SIZE=$($STAT "$OLD")
|
||||
NEW_SIZE=$($STAT "$NEW")
|
||||
OLD_SIZE=$(ls -l "$OLD" | awk '{ print $5 }')
|
||||
NEW_SIZE=$(ls -l "$NEW" | awk '{ print $5 }')
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
|
@ -72,7 +72,11 @@ else
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
DIFF=gdiff
|
||||
if [ -f "`which gdiff`" ]; then
|
||||
DIFF=gdiff
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
else
|
||||
DIFF=diff
|
||||
fi
|
||||
|
@ -53,21 +53,27 @@ then
|
||||
fi
|
||||
|
||||
if [ "`uname`" == "SunOS" ]; then
|
||||
NM=gnm
|
||||
STAT="gstat -c%s"
|
||||
if [ -f "`which gnm`" ]; then
|
||||
NM=gnm
|
||||
# Jonas 2012-05-29: solaris native nm produces radically different output than gnm
|
||||
# so if using that...we need different filter than "cut -f 2-"
|
||||
#
|
||||
elif [ -f "`which nm`" ]; then
|
||||
NM=nm
|
||||
else
|
||||
echo "No nm command found"
|
||||
exit 10
|
||||
fi
|
||||
LDD=ldd
|
||||
elif [ $OSTYPE == "cygwin" ]; then
|
||||
NM="$VS100COMNTOOLS/../../VC/bin/amd64/dumpbin.exe"
|
||||
NM_ARGS=/exports
|
||||
STAT="stat -c%s"
|
||||
LDD=
|
||||
elif [ "`uname`" == "Darwin" ]; then
|
||||
NM=nm
|
||||
STAT="stat -f%z"
|
||||
LDD="otool -L"
|
||||
else
|
||||
NM=nm
|
||||
STAT="stat -c%s"
|
||||
LDD=ldd
|
||||
fi
|
||||
|
||||
@ -83,8 +89,8 @@ fi
|
||||
OLD=$(cd $(dirname $1) && pwd)/$(basename $1)
|
||||
NEW=$(cd $(dirname $2) && pwd)/$(basename $2)
|
||||
|
||||
OLD_SIZE=$($STAT "$OLD")
|
||||
NEW_SIZE=$($STAT "$NEW")
|
||||
OLD_SIZE=$(ls -l "$OLD" | awk '{ print $5 }')
|
||||
NEW_SIZE=$(ls -l "$NEW" | awk '{ print $5 }')
|
||||
|
||||
if [ $# -gt 3 ]
|
||||
then
|
||||
@ -122,8 +128,8 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
OLD_SYMBOLS=$COMPARE_ROOT/$OLD_NAME.old
|
||||
NEW_SYMBOLS=$COMPARE_ROOT/$NEW_NAME.new
|
||||
OLD_SYMBOLS=$COMPARE_ROOT/nm.$OLD_NAME.old
|
||||
NEW_SYMBOLS=$COMPARE_ROOT/nm.$NEW_NAME.new
|
||||
|
||||
mkdir -p $(dirname $OLD_SYMBOLS)
|
||||
mkdir -p $(dirname $NEW_SYMBOLS)
|
||||
|
@ -87,6 +87,8 @@ $(if $6,$1_$(strip $6))
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupIdlCompilation, please update IdlCompilation.gmk))
|
||||
|
||||
# Remove any relative addressing in the paths.
|
||||
$1_SRC := $$(abspath $$($1_SRC))
|
||||
$1_BIN := $$(abspath $$($1_BIN))
|
||||
@ -111,4 +113,3 @@ $$(foreach p,$$($1),$$(eval $$(call add_idl_package,$1,$$($1_SRC),$$($1_BIN),$$(
|
||||
endef
|
||||
|
||||
.SUFFIXES: .java .class .package
|
||||
|
||||
|
@ -94,6 +94,7 @@ define SetupJavaCompiler
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupJavaCompiler, please update JavaCompilation.gmk))
|
||||
|
||||
ifeq ($$($1_MODE),MULTI_CORE_CONCURRENT)
|
||||
ifneq (,$$($1_SERVER_DIR))
|
||||
@ -130,6 +131,7 @@ define SetupArchive
|
||||
# SKIP_METAINF:=Set to prevent contents of an META-INF directory to be automatically
|
||||
# added to the archive.
|
||||
# EXTRA_MANIFEST_ATTR:=Extra attribute to add to manifest.
|
||||
# CHECK_COMPRESS_JAR Check the COMPRESS_JAR variable
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
$(if $5,$1_$(strip $5))
|
||||
@ -143,6 +145,7 @@ define SetupArchive
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
$(if $(15),$1_$(strip $(15)))
|
||||
$(if $(16),$(error Internal makefile error: Too many arguments to SetupArchive, please update JavaCompilation.gmk))
|
||||
|
||||
$1_JARMAIN:=$(strip $$($1_JARMAIN))
|
||||
$1_JARNAME:=$$(notdir $$($1_JAR))
|
||||
@ -243,6 +246,16 @@ define SetupArchive
|
||||
($(FIND) $$(src) -name _the.package -exec $(TOUCH) -r $$($1_JAR) \{\} \; ; true) &&)
|
||||
# Use a slightly shorter name for logging, but with enough path to identify this jar.
|
||||
$1_NAME:=$$(subst $$(OUTPUT_ROOT)/,,$$($1_JAR))
|
||||
|
||||
ifneq (,$$($1_CHECK_COMPRESS_JAR))
|
||||
$1_JAR_CREATE_OPTIONS := c0fm
|
||||
ifeq ($(COMPRESS_JARS), true)
|
||||
$1_JAR_CREATE_OPTIONS := cfm
|
||||
endif
|
||||
else
|
||||
$1_JAR_CREATE_OPTIONS := cfm
|
||||
endif
|
||||
|
||||
# Here is the rule that creates/updates the jar file.
|
||||
$$($1_JAR) : $2 $$($1_ALL_SRC)
|
||||
$(MKDIR) -p $$($1_BIN)
|
||||
@ -283,7 +296,7 @@ define SetupArchive
|
||||
$$(foreach src,$$($1_SRCS),($(FIND) $$(src) -name _the.package.api.notify $(FIND_DELETE); true) &&) true ; \
|
||||
fi ; \
|
||||
else \
|
||||
$(ECHO) Creating $$($1_NAME) && $(JAR) cfm $$@ $$($1_MANIFEST_FILE) && \
|
||||
$(ECHO) Creating $$($1_NAME) && $(JAR) $$($1_JAR_CREATE_OPTIONS) $$@ $$($1_MANIFEST_FILE) && \
|
||||
$$($1_SCAPTURE_CONTENTS) \
|
||||
$$($1_SCAPTURE_METAINF) \
|
||||
$$($1_SUPDATE_CONTENTS) \
|
||||
@ -311,6 +324,7 @@ define SetupZipArchive
|
||||
$(if $7,$1_$(strip $7))
|
||||
$(if $8,$1_$(strip $8))
|
||||
$(if $9,$1_$(strip $9))
|
||||
$(if $(10),$(error Internal makefile error: Too many arguments to SetupZipArchive, please update JavaCompilation.gmk))
|
||||
|
||||
# Find all files in the source tree.
|
||||
$1_SUFFIX_FILTER := $$(patsubst %,-o -name $(DQUOTE)*%$(DQUOTE),$$($1_SUFFIXES))
|
||||
@ -648,6 +662,7 @@ define SetupJavaCompilation
|
||||
$(if $(12),$1_$(strip $(12)))
|
||||
$(if $(13),$1_$(strip $(13)))
|
||||
$(if $(14),$1_$(strip $(14)))
|
||||
$(if $(15),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
|
||||
|
||||
# Extract the info from the java compiler setup.
|
||||
$1_MODE := $$($$($1_SETUP)_MODE)
|
||||
@ -688,6 +703,12 @@ $1_BINS := $$(shell $(FIND) $$($1_BIN) -name "*.class")
|
||||
# Now we have a list of all java files to compile: $$($1_SRCS)
|
||||
# and we have a list of all existing class files: $$($1_BINS)
|
||||
|
||||
# Create the corresponding smart javac wrapper command line.
|
||||
$1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix .*,$$(subst /,.,$$($1_EXCLUDES)))) \
|
||||
$$(addprefix -i ,$$(addsuffix .*,$$(subst /,.,$$($1_INCLUDES)))) \
|
||||
$$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES))) \
|
||||
$$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) -src $$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))
|
||||
|
||||
# Prepend the source/bin path to the filter expressions.
|
||||
ifneq ($$($1_INCLUDES),)
|
||||
$1_SRC_INCLUDES := $$(foreach i,$$($1_SRC),$$(addprefix $$i/,$$(addsuffix /%,$$($1_INCLUDES))))
|
||||
@ -799,6 +820,12 @@ ifeq ($$($1_MODE),SINGLE_THREADED_BATCH)
|
||||
$(RM) $$($1_BIN)/_the.batch $$($1_BIN)/_the.batch.tmp
|
||||
$$(call ListPathsSafely,$1_SRCS,\n, >> $$($1_BIN)/_the.batch.tmp)
|
||||
$(ECHO) Compiling `$(WC) $$($1_BIN)/_the.batch.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files in batch $1
|
||||
ifeq ($$($1_NOSJAVAC),)
|
||||
ifeq ($$(ENABLE_SJAVAC),yes)
|
||||
mkdir -p $$($1_BIN)_sjavac
|
||||
$$($1_JVM) $$(word 1,$$($1_JAVAC)) com.sun.tools.javac.smart.Main $$($1_SJAVAC_ARGS) -mfl $$($1_BIN)/_the.batch.tmp -d $$($1_BIN)_sjavac
|
||||
endif
|
||||
endif
|
||||
($$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) -implicit:none -sourcepath "$$($1_SRCROOTSC)" -d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_BIN)/_the.batch.tmp && \
|
||||
$(MV) $$($1_BIN)/_the.batch.tmp $$($1_BIN)/_the.batch)
|
||||
else
|
||||
@ -890,5 +917,3 @@ ifneq (,$$($1_SRCZIP))
|
||||
endif
|
||||
|
||||
endef
|
||||
|
||||
|
||||
|
@ -138,6 +138,7 @@ endef
|
||||
|
||||
# Hook to be called as the very first thing when running a normal build
|
||||
define AtRootMakeStart
|
||||
$(if $(findstring -j,$(MAKEFLAGS)), $(error make -j is not supported, use make JOBS=n))
|
||||
$(call PrintStartMessage)
|
||||
$(call StartTimer)
|
||||
endef
|
||||
|
@ -26,241 +26,128 @@
|
||||
# This must be the first rule
|
||||
default: all
|
||||
|
||||
# Find out which variables were passed explicitely on the make command line. These
|
||||
# will be passed on to sub-makes, overriding spec.gmk settings.
|
||||
MAKE_ARGS=$(foreach var,$(subst =command,,$(filter %=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))),$(var)=$($(var)))
|
||||
|
||||
define fatal-error
|
||||
# If the user specificed a "global" target (e.g. 'help'), do not exit but continue running
|
||||
$$(if $$(findstring help,$$(MAKECMDGOALS)),,$$(error Cannot continue))
|
||||
endef
|
||||
|
||||
ifeq ($(origin VERBOSE),undefined)
|
||||
# Setup logging according to LOG (but only if VERBOSE is not given)
|
||||
ifeq ($(LOG),)
|
||||
# Set LOG to "warn" as default if not set (and no VERBOSE given)
|
||||
LOG=warn
|
||||
endif
|
||||
ifeq ($(LOG),warn)
|
||||
VERBOSE=-s
|
||||
else ifeq ($(LOG),info)
|
||||
VERBOSE=
|
||||
else ifeq ($(LOG),debug)
|
||||
VERBOSE=
|
||||
else ifeq ($(LOG),trace)
|
||||
VERBOSE=-d -p
|
||||
else
|
||||
$(info Error: LOG must be one of: warn, info, debug or trace.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
else
|
||||
ifneq ($(LOG),)
|
||||
# We have both a VERBOSE and a LOG argument. This is OK only if this is a repeated call by ourselves,
|
||||
# but complain if this is the top-level make call.
|
||||
ifeq ($(MAKELEVEL),0)
|
||||
$(info Cannot use LOG=$(LOG) and VERBOSE=$(VERBOSE) at the same time. Choose one.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# TODO: Fix duplication in MakeBase.gmk
|
||||
define SetupLogging
|
||||
ifneq ($(findstring $(LOG),debug trace),)
|
||||
# Shell redefinition trick inspired by http://www.cmcrossroads.com/ask-mr-make/6535-tracing-rule-execution-in-gnu-make
|
||||
OLD_SHELL:=$$(SHELL)
|
||||
SHELL = $$(warning Building $$@$$(if $$<, (from $$<))$(if $$?, ($$? newer)))$$(OLD_SHELL) -x
|
||||
endif
|
||||
endef
|
||||
|
||||
$(eval $(call SetupLogging))
|
||||
|
||||
# Find all environment or command line variables that begin with ALT.
|
||||
list_alt_overrides_with_origins = $(filter ALT_%=environment ALT_%=command,$(foreach var,$(.VARIABLES),$(var)=$(firstword $(origin $(var)))))
|
||||
list_alt_overrides=$(subst =command,,$(subst =environment,,$(list_alt_overrides_with_origins)))
|
||||
|
||||
# Locate this Makefile
|
||||
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
|
||||
makefile_path=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
|
||||
makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
|
||||
else
|
||||
makefile_path=$(lastword $(MAKEFILE_LIST))
|
||||
makefile_path:=$(lastword $(MAKEFILE_LIST))
|
||||
endif
|
||||
root_dir=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
|
||||
output_dir=$(root_dir)/build
|
||||
root_dir:=$(patsubst %/common/makefiles/Makefile,%,$(makefile_path))
|
||||
|
||||
ifneq ($(origin SPEC),undefined)
|
||||
# We have been given a SPEC, check that it works out properly
|
||||
ifeq ($(wildcard $(SPEC)),)
|
||||
$(info Cannot locate spec.gmk, given by SPEC=$(SPEC))
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
ifneq ($(origin CONF),undefined)
|
||||
# We also have a CONF argument. This is OK only if this is a repeated call by ourselves,
|
||||
# but complain if this is the top-level make call.
|
||||
ifeq ($(MAKELEVEL),0)
|
||||
$(info Cannot use CONF=$(CONF) and SPEC=$(SPEC) at the same time. Choose one.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
endif
|
||||
# ... OK, we're satisfied, we'll use this SPEC later on
|
||||
else
|
||||
# Find all spec.gmk files in the build output directory
|
||||
all_spec_files=$(wildcard $(output_dir)/*/spec.gmk)
|
||||
ifeq ($(all_spec_files),)
|
||||
$(info No configurations found for $(root_dir)! Please run configure to create a configuration.)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
# Extract the configuration names from the path
|
||||
all_confs=$(patsubst %/spec.gmk,%,$(patsubst $(output_dir)/%,%,$(all_spec_files)))
|
||||
# ... and then we can include our helper functions
|
||||
include $(dir $(makefile_path))/MakeHelpers.gmk
|
||||
|
||||
ifneq ($(origin CONF),undefined)
|
||||
# User have given a CONF= argument.
|
||||
ifeq ($(CONF),)
|
||||
# If given CONF=, match all configurations
|
||||
matching_confs=$(strip $(all_confs))
|
||||
else
|
||||
# Otherwise select those that contain the given CONF string
|
||||
matching_confs=$(strip $(foreach var,$(all_confs),$(if $(findstring $(CONF),$(var)),$(var))))
|
||||
endif
|
||||
ifeq ($(matching_confs),)
|
||||
$(info No configurations found matching CONF=$(CONF))
|
||||
$(info Available configurations:)
|
||||
$(foreach var,$(all_confs),$(info * $(var)))
|
||||
$(eval $(call fatal-error))
|
||||
else
|
||||
ifeq ($(words $(matching_confs)),1)
|
||||
$(info Building '$(matching_confs)' (matching CONF=$(CONF)))
|
||||
else
|
||||
$(info Building the following configurations (matching CONF=$(CONF)):)
|
||||
$(foreach var,$(matching_confs),$(info * $(var)))
|
||||
endif
|
||||
endif
|
||||
$(eval $(call ParseLogLevel))
|
||||
$(eval $(call SetupLogging))
|
||||
$(eval $(call ParseConfAndSpec))
|
||||
|
||||
# Create a SPEC definition. This will contain the path to one or more spec.gmk files.
|
||||
SPEC=$(addsuffix /spec.gmk,$(addprefix $(output_dir)/,$(matching_confs)))
|
||||
else
|
||||
# No CONF or SPEC given, check the available configurations
|
||||
ifneq ($(words $(all_spec_files)),1)
|
||||
$(info No CONF or SPEC given, but more than one spec.gmk found in $(output_dir).)
|
||||
$(info Available configurations:)
|
||||
$(foreach var,$(all_confs),$(info * $(var)))
|
||||
$(info Please retry building with CONF=<config> or SPEC=<specfile>)
|
||||
$(eval $(call fatal-error))
|
||||
endif
|
||||
|
||||
# We found exactly one configuration, use it
|
||||
SPEC=$(strip $(all_spec_files))
|
||||
endif
|
||||
# Setup number of jobs to use. -jN is unfortunately not available for us to parse from the command line,
|
||||
# hence this workaround.
|
||||
ifeq ($(JOBS),)
|
||||
JOBS=$(NUM_CORES)
|
||||
endif
|
||||
|
||||
ifneq ($(words $(SPEC)),1)
|
||||
# We have multiple configurations to build, call make repeatedly
|
||||
all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean:
|
||||
### We have multiple configurations to build, call make repeatedly
|
||||
all jdk hotspot jaxws jaxp corba langtools install images clean dist-clean:
|
||||
@$(foreach spec,$(SPEC),($(MAKE) -f $(makefile_path) SPEC=$(spec) $(VERBOSE) VERBOSE=$(VERBOSE) $@ $(MAKE_ARGS)) &&) true
|
||||
|
||||
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images packages clean dist-clean
|
||||
.PHONY: all jdk hotspot jaxws jaxp corba langtools install images clean dist-clean
|
||||
|
||||
else
|
||||
# This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
|
||||
### This is the main part of the Makefile, for the normal case with SPEC specifying a single existing spec.gmk file.
|
||||
|
||||
# Now load the spec
|
||||
-include $(SPEC)
|
||||
include $(SPEC)
|
||||
|
||||
# Load the vital tools for all the makefiles.
|
||||
-include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
|
||||
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
|
||||
|
||||
# Remove any build.log from a previous run
|
||||
### Clean up from previous run
|
||||
|
||||
# Remove any build.log from a previous run, if they exist
|
||||
ifneq (,$(BUILD_LOG))
|
||||
$(shell $(RM) $(BUILD_LOG))
|
||||
ifneq (,$(BUILD_LOG_PREVIOUS))
|
||||
# Rotate old log
|
||||
$(shell $(RM) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
|
||||
$(shell $(MV) $(BUILD_LOG) $(BUILD_LOG_PREVIOUS) 2> /dev/null)
|
||||
else
|
||||
$(shell $(RM) $(BUILD_LOG) 2> /dev/null)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Remove any javac server logs and port files. This
|
||||
# prevents a new make run to reuse the previous servers.
|
||||
ifneq (,$(JAVAC_SERVERS))
|
||||
$(shell mkdir -p $(JAVAC_SERVERS) && rm -rf $(JAVAC_SERVERS)/*)
|
||||
endif
|
||||
# Reset the build timers.
|
||||
$(eval $(call ResetTimers))
|
||||
# Clean out any notifications from the previous build.
|
||||
$(shell find $(OUTPUT_ROOT) -name "_the.*.notify" $(FIND_DELETE))
|
||||
|
||||
# If make was called explicitely with -j, don't add a -j ourself to sub-makes, since
|
||||
# this will be inherited automatically by make. Otherwise use our default for sub-makes.
|
||||
# The -j in MAKEFLAGS is only visible when executing a recipe, hence this macro.
|
||||
define GetMakeJobFlag
|
||||
$(if $(findstring -j,$(MAKEFLAGS)),,-j$(NUM_CORES))
|
||||
endef
|
||||
# Reset the build timers.
|
||||
$(eval $(call ResetTimers))
|
||||
|
||||
define CheckEnvironment
|
||||
$(if $(list_alt_overrides),
|
||||
@$(PRINTF) "\nWARNING: You have the following ALT_ variables set:\n"
|
||||
@$(PRINTF) "$(foreach var,$(list_alt_overrides),$(var)=$$$(var))\n"
|
||||
@$(PRINTF) "ALT_ variables are deprecated and will be ignored. Please clean your environment.\n"
|
||||
)
|
||||
endef
|
||||
|
||||
define PrintStartMessage
|
||||
$(if $(VERBOSE),,@$(ECHO) Running make as $(MAKE) $(MFLAGS) $(MAKE_ARGS))
|
||||
$(call CheckEnvironment)
|
||||
@$(ECHO) "Building OpenJDK for target $(if $(MAKECMDGOALS),'$(MAKECMDGOALS)','all') in configuration '$(CONF_NAME)'"
|
||||
endef
|
||||
|
||||
define PrintEndMessage
|
||||
@$(ECHO) "Finished building OpenJDK for target '$@'"
|
||||
$(call CheckEnvironment)
|
||||
endef
|
||||
### Main targets
|
||||
|
||||
all: jdk
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
@$(call AtRootMakeEnd)
|
||||
|
||||
langtools: start-make
|
||||
langtools: start-make langtools-only
|
||||
langtools-only:
|
||||
@$(call MakeStart,langtools,all)
|
||||
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(LANGTOOLS_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,langtools,all)
|
||||
|
||||
corba: langtools
|
||||
corba: langtools corba-only
|
||||
corba-only:
|
||||
@$(call MakeStart,corba,all)
|
||||
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,corba,all)
|
||||
|
||||
jaxp: langtools
|
||||
jaxp: langtools jaxp-only
|
||||
jaxp-only:
|
||||
@$(call MakeStart,jaxp,all)
|
||||
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,jaxp,all)
|
||||
|
||||
jaxws: langtools jaxp
|
||||
jaxws: langtools jaxp jaxws-only
|
||||
jaxws-only:
|
||||
@$(call MakeStart,jaxws,all)
|
||||
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(CORBA_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,jaxws,all)
|
||||
|
||||
hotspot: langtools
|
||||
hotspot: langtools hotspot-only
|
||||
hotspot-only:
|
||||
@$(call MakeStart,hotspot,all)
|
||||
@($(CD) $(HOTSPOT_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) -j1 $(HOTSPOT_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,hotspot,all)
|
||||
|
||||
jdk: langtools corba jaxp jaxws hotspot
|
||||
jdk: langtools corba jaxp jaxws hotspot jdk-only
|
||||
jdk-only:
|
||||
@$(call MakeStart,jdk,all)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS))
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(MAKE_ARGS))
|
||||
@$(call MakeFinish,jdk,all)
|
||||
|
||||
images install packages: source-tips start-make jdk langtools corba jaxp jaxws hotspot
|
||||
images: source-tips start-make jdk langtools corba jaxp jaxws hotspot images-only
|
||||
images-only:
|
||||
@$(call MakeStart,jdk-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(JDK_MAKE_ARGS) $(MAKE_ARGS) images)
|
||||
@$(call MakeFinish,jdk-images,$@)
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
@$(call AtRootMakeEnd)
|
||||
|
||||
old-images: source-tips start-make jdk langtools corba jaxp jaxws hotspot
|
||||
@$(call MakeStart,jdk-old-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(call GetMakeJobFlag) $(JDK_MAKE_ARGS) $(MAKE_ARGS) $@)
|
||||
@$(call MakeFinish,old-jdk-images,$@)
|
||||
install: source-tips start-make jdk langtools corba jaxp jaxws hotspot install-only
|
||||
install-only:
|
||||
@$(call MakeStart,jdk-images,$@)
|
||||
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) -j$(JOBS) $(JDK_MAKE_ARGS) $(MAKE_ARGS) install)
|
||||
@$(call MakeFinish,jdk-images,$@)
|
||||
@$(if $(JAVAC_SERVERS),rm -rf $(JAVAC_SERVERS)/*.port)
|
||||
@$(call AtRootMakeEnd)
|
||||
|
||||
start-make:
|
||||
@$(call AtRootMakeStart)
|
||||
|
||||
.PHONY: jdk hotspot jaxws jaxp corba langtools install images packages start-make
|
||||
.PHONY: jdk hotspot jaxws jaxp corba langtools install images start-make
|
||||
|
||||
test: start-make
|
||||
@$(call MakeStart,test,$(if $(TEST),$(TEST),all))
|
||||
@ -281,7 +168,7 @@ $(OUTPUT_ROOT)/source_tips: FRC
|
||||
|
||||
# Remove everything, except the output from configure.
|
||||
clean:
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | grep -v "localdevenv.*" | grep -v uncygdrive.exe`)
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v spec.sh | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | grep -v "localdevenv.*" | grep -v uncygdrive.exe`)
|
||||
@$(ECHO) Cleaned everything except the build configuration.
|
||||
.PHONY: clean
|
||||
|
||||
@ -292,7 +179,7 @@ dist-clean:
|
||||
.PHONY: dist-clean
|
||||
|
||||
clean-jdk:
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | \
|
||||
@(cd $(OUTPUT_ROOT) && $(RM) -r `$(LS) $(OUTPUT_ROOT) | grep -v spec.gmk | grep -v spec.sh | grep -v Makefile | grep -v config.status | grep -v config.log | grep -v config.h | grep -v configure-arguments | \
|
||||
grep -v langtools | grep -v corba | grep -v jaxp | grep -v jaxws | grep -v hotspot`)
|
||||
@$(ECHO) "Cleaned jdk build artifacts (but not langtools,corba,jaxp,jaxws,hotspot nor the build configuration)"
|
||||
.PHONY: clean
|
||||
|
@ -51,47 +51,55 @@ define add_native_source
|
||||
# param 5 = the c compiler
|
||||
# param 6 = the c++ flags to the compiler
|
||||
# param 7 = the c++ compiler
|
||||
# param 8 = the flags to the assembler
|
||||
|
||||
ifneq (,$$(filter %.c,$2))
|
||||
# Compile as a C file
|
||||
$1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS)
|
||||
$1_$2_FLAGS=$4 $$($1_$(notdir $2)_CFLAGS) -c
|
||||
$1_$2_COMP=$5
|
||||
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
|
||||
else ifneq (,$$(filter %.m,$2))
|
||||
# Compile as a objective-c file
|
||||
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS)
|
||||
$1_$2_FLAGS=-x objective-c $4 $$($1_$(notdir $2)_CFLAGS) -c
|
||||
$1_$2_COMP=$5
|
||||
$1_$2_DEP_FLAG:=$(C_FLAG_DEPS)
|
||||
else ifneq (,$$(filter %.s,$2))
|
||||
# Compile as assembler file
|
||||
$1_$2_FLAGS=$8
|
||||
$1_$2_COMP=$(AS)
|
||||
$1_$2_DEP_FLAG:=
|
||||
else
|
||||
# Compile as a C++ file
|
||||
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS)
|
||||
$1_$2_FLAGS=$6 $$($1_$(notdir $2)_CXXFLAGS) -c
|
||||
$1_$2_COMP=$7
|
||||
$1_$2_DEP_FLAG:=$(CXX_FLAG_DEPS)
|
||||
endif
|
||||
# Generate the .o (.obj) file name and place it in the bin dir.
|
||||
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $2))))
|
||||
$1_$2_OBJ:=$3/$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $2)))))
|
||||
# Only continue if this object file hasn't been processed already. This lets the first found
|
||||
# source file override any other with the same name.
|
||||
ifeq (,$$(findstring $$($1_$2_OBJ),$$($1_OBJS_SO_FAR)))
|
||||
$1_OBJS_SO_FAR+=$$($1_$2_OBJ)
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_$2_DEP)
|
||||
ifeq (,$$(filter %.s,$2))
|
||||
# And this is the dependency file for this obj file.
|
||||
$1_$2_DEP:=$$(patsubst %$(OBJ_SUFFIX),%.d,$$($1_$2_OBJ))
|
||||
# Include previously generated dependency information. (if it exists)
|
||||
-include $$($1_$2_DEP)
|
||||
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
|
||||
-Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$1_$2_DEBUG_OUT_FLAGS:=-Fd$$(patsubst %$(OBJ_SUFFIX),%.pdb,$$($1_$2_OBJ)) \
|
||||
-Fm$$(patsubst %$(OBJ_SUFFIX),%.map,$$($1_$2_OBJ))
|
||||
endif
|
||||
endif
|
||||
|
||||
$$($1_$2_OBJ) : $2
|
||||
ifeq ($(COMPILER_TYPE),CC)
|
||||
$$(call COMPILING_MSG,$$(notdir $2))
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEP_FLAG) $$($1_$2_DEP) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
|
||||
endif
|
||||
ifeq ($(COMPILER_TYPE),CL)
|
||||
$$(call COMPILING_MSG,$$(notdir $2))
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) -c $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
|
||||
$$($1_$2_COMP) $$($1_$2_FLAGS) $$($1_$2_DEBUG_OUT_FLAGS) $(CC_OUT_OPTION)$$($1_$2_OBJ) $2
|
||||
endif
|
||||
endif
|
||||
endef
|
||||
@ -107,9 +115,9 @@ define SetupNativeCompilation
|
||||
# LDFLAGS_SUFFIX the linker flags to be added last on the commandline
|
||||
# typically the libraries linked to.
|
||||
# ARFLAGS the archiver flags to be used
|
||||
# BIN the directory where we store the object files
|
||||
# LIB the resulting library file
|
||||
# EXE the resulting exec file
|
||||
# OBJECT_DIR the directory where we store the object files
|
||||
# LIBRARY the resulting library file
|
||||
# PROGRAM the resulting exec file
|
||||
# INCLUDES only pick source from these directories
|
||||
# EXCLUDES do not pick source from these directories
|
||||
# INCLUDE_FILES only compile exactly these files!
|
||||
@ -118,6 +126,9 @@ define SetupNativeCompilation
|
||||
# RC_FLAGS flags for RC.
|
||||
# MAPFILE mapfile
|
||||
# REORDER reorder file
|
||||
# DEBUG_SYMBOLS add debug symbols (if configured on)
|
||||
# CC the compiler to use, default is $(CC)
|
||||
# LDEXE the linker to use for linking executables, default is $(LDEXE)
|
||||
$(if $2,$1_$(strip $2))
|
||||
$(if $3,$1_$(strip $3))
|
||||
$(if $4,$1_$(strip $4))
|
||||
@ -137,13 +148,94 @@ define SetupNativeCompilation
|
||||
$(if $(18),$1_$(strip $(18)))
|
||||
$(if $(19),$1_$(strip $(19)))
|
||||
$(if $(20),$1_$(strip $(20)))
|
||||
$(if $(21),$1_$(strip $(21)))
|
||||
$(if $(22),$(error Internal makefile error: Too many arguments to SetupNativeCompilation, please update NativeCompilation.gmk))
|
||||
|
||||
ifneq (,$$($1_BIN))
|
||||
$$(error BIN has been replaced with OBJECT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_LIB))
|
||||
$$(error LIB has been replaced with LIBRARY)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_EXE))
|
||||
$$(error EXE has been replaced with PROGRAM)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_LIBRARY))
|
||||
ifeq (,$$($1_OUTPUT_DIR))
|
||||
$$(error LIBRARY requires OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_LIBRARY),$(basename $$($1_LIBRARY)))
|
||||
$$(error directory of LIBRARY should be specified using OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(SHARED_LIBRARY_SUFFIX),$$($1_LIBRARY)))
|
||||
$$(error LIBRARY should be specified without SHARED_LIBRARY_SUFFIX: $(SHARED_LIBRARY_SUFFIX))
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_LIBRARY)))
|
||||
$$(error LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
|
||||
endif
|
||||
|
||||
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_LIBRARY)$(SHARED_LIBRARY_SUFFIX)
|
||||
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
|
||||
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_STATIC_LIBRARY))
|
||||
ifeq (,$$($1_OUTPUT_DIR))
|
||||
$$(error STATIC_LIBRARY requires OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_STATIC_LIBRARY),$(basename $$($1_STATIC_LIBRARY)))
|
||||
$$(error directory of STATIC_LIBRARY should be specified using OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(STATIC_LIBRARY_SUFFIX),$$($1_STATIC_LIBRARY)))
|
||||
$$(error STATIC_LIBRARY should be specified without STATIC_LIBRARY_SUFFIX: $(STATIC_LIBRARY_SUFFIX))
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(LIBRARY_PREFIX),$$($1_STATIC_LIBRARY)))
|
||||
$$(error STATIC_LIBRARY should be specified without LIBRARY_PREFIX: $(LIBRARY_PREFIX))
|
||||
endif
|
||||
|
||||
$1_BASENAME:=$(LIBRARY_PREFIX)$$($1_STATIC_LIBRARY)$(STATIC_LIBRARY_SUFFIX)
|
||||
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_PROGRAM))
|
||||
ifeq (,$$($1_OUTPUT_DIR))
|
||||
$$(error PROGRAM requires OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq ($$($1_PROGRAM),$(basename $$($1_PROGRAM)))
|
||||
$$(error directory of PROGRAM should be specified using OUTPUT_DIR)
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring $(EXE_SUFFIX),$$($1_PROGRAM)))
|
||||
$$(error PROGRAM should be specified without EXE_SUFFIX: $(EXE_SUFFIX))
|
||||
endif
|
||||
|
||||
$1_BASENAME:=$$($1_PROGRAM)$(EXE_SUFFIX)
|
||||
$1_TARGET:=$$($1_OUTPUT_DIR)/$$($1_BASENAME)
|
||||
|
||||
endif
|
||||
|
||||
ifeq (,$$($1_TARGET))
|
||||
$$(error Neither PROGRAM, LIBRARY nor STATIC_LIBRARY has been specified for SetupNativeCompilation)
|
||||
endif
|
||||
|
||||
ifeq (,$$($1_LANG))
|
||||
$$(error You have to specify LANG for native compilation $1)
|
||||
endif
|
||||
ifeq (C,$$($1_LANG))
|
||||
ifeq ($$($1_LDEXE),)
|
||||
$1_LDEXE:=$(LDEXE)
|
||||
endif
|
||||
$1_LD:=$(LD)
|
||||
$1_LDEXE:=$(LDEXE)
|
||||
else
|
||||
ifeq (C++,$$($1_LANG))
|
||||
$1_LD:=$(LDCXX)
|
||||
@ -153,8 +245,12 @@ define SetupNativeCompilation
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($$($1_CC),)
|
||||
$1_CC:=$(CC)
|
||||
endif
|
||||
|
||||
# Make sure the dirs exist.
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_BIN) $$(dir $$($1_LIB)) $$(dir $$($1_EXE)))
|
||||
$$(shell $(MKDIR) -p $$($1_SRC) $$($1_OBJECT_DIR) $$($1_OUTPUT_DIR))
|
||||
# Find all files in the source trees. Sort to remove duplicates.
|
||||
$1_ALL_SRCS := $$(sort $$(foreach i,$$($1_SRC), $$(shell $(FIND) $$i -type f)))
|
||||
# Extract the C/C++ files.
|
||||
@ -163,7 +259,7 @@ define SetupNativeCompilation
|
||||
ifneq ($$($1_EXCLUDE_FILES),)
|
||||
$1_EXCLUDE_FILES:=$$(addprefix %,$$($1_EXCLUDE_FILES))
|
||||
endif
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.c %.cpp %.m,$$($1_ALL_SRCS)))
|
||||
$1_SRCS := $$(filter-out $$($1_EXCLUDE_FILES),$$(filter %.s %.c %.cpp %.m,$$($1_ALL_SRCS)))
|
||||
ifneq (,$$(strip $$($1_INCLUDE_FILES)))
|
||||
$1_SRCS := $$(filter $$($1_INCLUDE_FILES),$$($1_SRCS))
|
||||
endif
|
||||
@ -171,7 +267,7 @@ define SetupNativeCompilation
|
||||
$$(error No sources found for $1 when looking inside the dirs $$($1_SRC))
|
||||
endif
|
||||
# There can be only a single bin dir root, no need to foreach over the roots.
|
||||
$1_BINS := $$(wildcard $$($1_BIN)/*$(OBJ_SUFFIX))
|
||||
$1_BINS := $$(wildcard $$($1_OBJECT_DIR)/*$(OBJ_SUFFIX))
|
||||
# Now we have a list of all c/c++ files to compile: $$($1_SRCS)
|
||||
# and we have a list of all existing object files: $$($1_BINS)
|
||||
|
||||
@ -187,37 +283,36 @@ define SetupNativeCompilation
|
||||
|
||||
# Calculate the expected output from compiling the sources (sort to remove duplicates. Also provides
|
||||
# a reproducable order on the input files to the linker).
|
||||
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_BIN)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS)))))))
|
||||
$1 := $$($1_EXPECTED_OBJS)
|
||||
$1_EXPECTED_OBJS:=$$(sort $$(addprefix $$($1_OBJECT_DIR)/,$$(patsubst %.cpp,%$(OBJ_SUFFIX),$$(patsubst %.c,%$(OBJ_SUFFIX),$$(patsubst %.m,%$(OBJ_SUFFIX),$$(patsubst %.s,%$(OBJ_SUFFIX),$$(notdir $$($1_SRCS))))))))
|
||||
# Are there too many object files on disk? Perhaps because some source file was removed?
|
||||
$1_SUPERFLOUS_OBJS:=$$(sort $$(filter-out $$($1_EXPECTED_OBJS),$$($1_BINS)))
|
||||
# Clean out the superfluous object files.
|
||||
$$(shell $(RM) -f $$($1_SUPERFLUOUS_OBJS))
|
||||
|
||||
# Pickup extra HOST_OS_API and/or PLATFORM dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(HOST_OS_API)) $$($1_CFLAGS_$(PLATFORM))
|
||||
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CFLAGS.
|
||||
$1_EXTRA_CFLAGS:=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CFLAGS_$(OPENJDK_TARGET_OS))
|
||||
ifneq ($(DEBUG_LEVEL),release)
|
||||
# Pickup extra debug dependent variables for CFLAGS
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(HOST_OS_API)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(PLATFORM)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_debug)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
else
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(HOST_OS_API)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(PLATFORM)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS_API)_release)
|
||||
$1_EXTRA_CFLAGS+=$$($1_CFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
endif
|
||||
|
||||
# Pickup extra HOST_OS_API and/or PLATFORM dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(HOST_OS_API)) $$($1_CXXFLAGS_$(PLATFORM))
|
||||
# Pickup extra OPENJDK_TARGET_OS_API and/or OPENJDK_TARGET_OS dependent variables for CXXFLAGS.
|
||||
$1_EXTRA_CXXFLAGS:=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_CXXFLAGS_$(OPENJDK_TARGET_OS))
|
||||
ifneq ($(DEBUG_LEVEL),release)
|
||||
# Pickup extra debug dependent variables for CXXFLAGS
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(HOST_OS_API)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(PLATFORM)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_debug)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_debug)
|
||||
else
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(HOST_OS_API)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(PLATFORM)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS_API)_release)
|
||||
$1_EXTRA_CXXFLAGS+=$$($1_CXXFLAGS_$(OPENJDK_TARGET_OS)_release)
|
||||
endif
|
||||
|
||||
ifeq ($$($1_CXXFLAGS),)
|
||||
@ -232,33 +327,62 @@ define SetupNativeCompilation
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_FLAG_REORDER)
|
||||
endif
|
||||
|
||||
ifneq (no, $(ENABLE_DEBUG_SYMBOLS))
|
||||
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# <weird code />
|
||||
# There is very weird code in Defs-solaris.gmk that first sets variables as decribed below
|
||||
# and then a couple of hundreds of line below resets them...
|
||||
# this feels like a sure bug...but before this is confirmed, mimic this behaviour
|
||||
# (note: skip indenting this as it will surely be removed anyway)
|
||||
# <weird code />
|
||||
|
||||
ifneq (,$$($1_DEBUG_SYMBOLS))
|
||||
$1_OPTIMIZATION := LOW
|
||||
$1_EXTRA_CFLAGS += $(CFLAGS_DEBUG_SYMBOLS)
|
||||
$1_EXTRA_CXXFLAGS += $(CXXFLAGS_DEBUG_SYMBOLS)
|
||||
endif
|
||||
|
||||
# <weird code />
|
||||
endif
|
||||
# <weird code />
|
||||
endif
|
||||
|
||||
ifeq (NONE, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_NONE)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_NONE)
|
||||
else ifeq (LOW, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_NORM)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_NORM)
|
||||
else ifeq (HIGH, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_HI)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_HI)
|
||||
else ifeq (HIGHEST, $$($1_OPTIMIZATION))
|
||||
$1_EXTRA_CFLAGS += $$(C_O_FLAG_HIGHEST)
|
||||
$1_EXTRA_CXXFLAGS += $$(CXX_O_FLAG_HIGHEST)
|
||||
else ifneq (, $$($1_OPTIMIZATION))
|
||||
$$(error Unknown value for OPTIMIZATION: $$($1_OPTIMIZATION))
|
||||
endif
|
||||
|
||||
# Now create a list of the packages that are about to compile. Used when sending source
|
||||
# in a batch to the compiler.
|
||||
$$(shell $(RM) $$($1_BIN)/_the.list_of_sources)
|
||||
$$(eval $$(call ListPathsSafelyNow,$1_SRCS,\n, >> $$($1_BIN)/_the.list_of_sources))
|
||||
$$(shell $(RM) $$($1_OBJECT_DIR)/_the.list_of_sources)
|
||||
$$(eval $$(call ListPathsSafelyNow,$1_SRCS,\n, >> $$($1_OBJECT_DIR)/_the.list_of_sources))
|
||||
|
||||
# Now call add_native_source for each source file we are going to compile.
|
||||
$$(foreach p,$$($1_SRCS),\
|
||||
$$(eval $$(call add_native_source,$1,$$p,$$($1_BIN),\
|
||||
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$(CC),\
|
||||
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX))))
|
||||
$$(eval $$(call add_native_source,$1,$$p,$$($1_OBJECT_DIR),\
|
||||
$$($1_CFLAGS) $$($1_EXTRA_CFLAGS),$$($1_CC),\
|
||||
$$($1_CXXFLAGS) $$($1_EXTRA_CXXFLAGS),$(CXX),$$($1_ASFLAGS))))
|
||||
|
||||
# On windows we need to create a resource file
|
||||
ifeq ($(HOST_OS_API), winapi)
|
||||
ifeq ($(OPENJDK_TARGET_OS_API), winapi)
|
||||
ifneq (,$$($1_VERSIONINFO_RESOURCE))
|
||||
ifneq (,$$($1_LIB))
|
||||
$1_BASENAME:=$$(basename $$(notdir $$($1_LIB)))
|
||||
endif
|
||||
ifneq (,$$($1_EXE))
|
||||
$1_BASENAME:=$$(basename $$(notdir $$($1_EXE)))
|
||||
endif
|
||||
$1_RES:=$$($1_BIN)/$$($1_BASENAME).res
|
||||
$1_RES:=$$($1_OBJECT_DIR)/$$($1_BASENAME).res
|
||||
$$($1_RES): $$($1_VERSIONINFO_RESOURCE)
|
||||
$(RC) $$($1_RC_FLAGS) $(CC_OUT_OPTION)$$@ $$($1_VERSIONINFO_RESOURCE)
|
||||
endif
|
||||
ifneq (,$$($1_MANIFEST))
|
||||
$1_PROGRAM:=$$(basename $$(notdir $$($1_EXE)))
|
||||
$1_GEN_MANIFEST:=$$($1_BIN)/$$($1_PROGRAM).manifest
|
||||
$1_GEN_MANIFEST:=$$($1_OBJECT_DIR)/$$($1_PROGRAM).manifest
|
||||
IMVERSIONVALUE:=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
|
||||
$$($1_GEN_MANIFEST): $$($1_MANIFEST)
|
||||
$(SED) 's%IMVERSION%$$(IMVERSIONVALUE)%g;s%PROGRAM%$$($1_PROGRAM)%g' $$< > $$@
|
||||
@ -266,54 +390,182 @@ define SetupNativeCompilation
|
||||
endif
|
||||
|
||||
# mapfile doesnt seem to be implemented on macosx (yet??)
|
||||
ifneq ($(HOST_OS),macosx)
|
||||
ifneq ($(HOST_OS),windows)
|
||||
$1_REAL_MAPFILE := $$($1_MAPFILE)
|
||||
ifneq ($(OPENJDK_TARGET_CPU),ppc)
|
||||
ifneq ($(OPENJDK_TARGET_CPU),arm)
|
||||
ifneq ($(OPENJDK_TARGET_OS),macosx)
|
||||
ifneq ($(OPENJDK_TARGET_OS),windows)
|
||||
$1_REAL_MAPFILE:=$$($1_MAPFILE)
|
||||
ifneq (,$$($1_REORDER))
|
||||
$1_REAL_MAPFILE := $$($1_BIN)/mapfile
|
||||
$1_REAL_MAPFILE:=$$($1_OBJECT_DIR)/mapfile
|
||||
|
||||
$$($1_REAL_MAPFILE) : $$($1_MAPFILE) $$($1_REORDER)
|
||||
$$(MKDIR) -p $$(@D)
|
||||
$$(CP) $$($1_MAPFILE) $$@.tmp
|
||||
$$(SED) -e 's=OUTPUTDIR=$$($1_BIN)=' $$($1_REORDER) >> $$@.tmp
|
||||
$$(SED) -e 's=OUTPUTDIR=$$($1_OBJECT_DIR)=' $$($1_REORDER) >> $$@.tmp
|
||||
$$(MV) $$@.tmp $$@
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# Pickup extra HOST_OS_API dependent variables (posix or winapi) and
|
||||
# Pickup extra OPENJDK_TARGET_OS_API dependent variables (posix or winapi) and
|
||||
# (linux,solaris,windows,bsd) for LDFLAGS and LDFLAGS_SUFFIX
|
||||
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(HOST_OS_API)) $$($1_LDFLAGS_$(PLATFORM))
|
||||
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(HOST_OS_API)) $$($1_LDFLAGS_SUFFIX_$(PLATFORM))
|
||||
$1_EXTRA_LDFLAGS:=$$($1_LDFLAGS_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_$(OPENJDK_TARGET_OS))
|
||||
$1_EXTRA_LDFLAGS_SUFFIX:=$$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS_API)) $$($1_LDFLAGS_SUFFIX_$(OPENJDK_TARGET_OS))
|
||||
ifneq (,$$($1_REAL_MAPFILE))
|
||||
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
|
||||
$1_EXTRA_LDFLAGS += $(call SET_SHARED_LIBRARY_MAPFILE,$$($1_REAL_MAPFILE))
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_LIB))
|
||||
ifeq (dynamic,$$(patsubst %$(SHARED_LIBRARY_SUFFIX),dynamic,$$($1_LIB)))
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$(notdir $$($1_LIB)))
|
||||
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE)
|
||||
$$(call LINKING_MSG,$$(notdir $$($1_LIB)))
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$($1_LIB) \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
else
|
||||
# Generating a static library, ie object file archive.
|
||||
$$($1_LIB) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call ARCHIVING_MSG,$$(notdir $$($1_LIB)))
|
||||
$(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_LIB) $$($1_EXPECTED_OBJS) \
|
||||
$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
endif
|
||||
$1 := $$($1_TARGET)
|
||||
ifneq (,$$($1_LIBRARY))
|
||||
# Generating a dynamic library.
|
||||
$1_EXTRA_LDFLAGS+=$$(call SET_SHARED_LIBRARY_NAME,$$($1_BASENAME))
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_EXTRA_LDFLAGS+="-implib:$$($1_OBJECT_DIR)/$$($1_LIBRARY).lib"
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_DEBUG_SYMBOLS))
|
||||
ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_LIBRARY).pdb" \
|
||||
"-map:$$($1_OBJECT_DIR)/$$($1_LIBRARY).map"
|
||||
endif
|
||||
|
||||
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/%
|
||||
$(CP) $$< $$@
|
||||
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||
# An empty section header has sh_addr == 0 and sh_size == 0.
|
||||
# This problem has only been seen on Solaris X64, but we call this tool
|
||||
# on all Solaris builds just in case.
|
||||
#
|
||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET) \
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||
$(RM) $$@
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $$<
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(ADD_GNU_DEBUGLINK) $$@ $$<
|
||||
else # not solaris
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo : $$($1_TARGET)
|
||||
$(RM) $$@
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(OBJCOPY) --add-gnu-debuglink=$$@ $$<
|
||||
endif
|
||||
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES), 1)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET)
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_LIBRARY).map $$($1_LIBRARY).pdb
|
||||
else
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).diz : $$($1_TARGET) \
|
||||
$$($1_OBJECT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||
endif
|
||||
else
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_LIBRARY).map \
|
||||
$$($1_OUTPUT_DIR)/$$($1_LIBRARY).pdb
|
||||
else
|
||||
$1 += $$($1_OUTPUT_DIR)/$$(LIBRARY_PREFIX)$$($1_LIBRARY).debuginfo
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_REAL_MAPFILE)
|
||||
$$(call LINKING_MSG,$$($1_BASENAME))
|
||||
$$($1_LD) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(LD_OUT_OPTION)$$@ \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
|
||||
$$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
|
||||
endif
|
||||
ifneq (,$$($1_EXE))
|
||||
|
||||
ifneq (,$$($1_STATIC_LIBRARY))
|
||||
# Generating a static library, ie object file archive.
|
||||
$$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES)
|
||||
$$(call ARCHIVING_MSG,$$($1_LIBRARY))
|
||||
$(AR) $$($1_AR_FLAGS) $(AR_OUT_OPTION)$$($1_TARGET) $$($1_EXPECTED_OBJS) \
|
||||
$$($1_RES) $$($1_LDFLAGS_SUFFIX) $$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
endif
|
||||
|
||||
ifneq (,$$($1_PROGRAM))
|
||||
# A executable binary has been specified, setup the target for it.
|
||||
$$($1_EXE) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
|
||||
$$(call LINKING_EXE_MSG,$$(notdir $$($1_EXE)))
|
||||
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_EXE) \
|
||||
ifneq (,$$($1_DEBUG_SYMBOLS))
|
||||
ifeq ($(ENABLE_DEBUG_SYMBOLS), yes)
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1_EXTRA_LDFLAGS+="-pdb:$$($1_OBJECT_DIR)/$$($1_PROGRAM).pdb" \
|
||||
"-map:$$($1_OBJECT_DIR)/$$($1_PROGRAM).map"
|
||||
endif
|
||||
|
||||
$$($1_OUTPUT_DIR)/% : $$($1_OBJECT_DIR)/%
|
||||
$(CP) $$< $$@
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
||||
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
|
||||
# Use $(FIX_EMPTY_SEC_HDR_FLAGS) to clear the SHF_ALLOC flag (if set) from
|
||||
# empty section headers until a fixed $(OBJCOPY) is available.
|
||||
# An empty section header has sh_addr == 0 and sh_size == 0.
|
||||
# This problem has only been seen on Solaris X64, but we call this tool
|
||||
# on all Solaris builds just in case.
|
||||
#
|
||||
# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
|
||||
# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET) \
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $(ADD_GNU_DEBUGLINK)
|
||||
$(RM) $$@
|
||||
$(FIX_EMPTY_SEC_HDR_FLAGS) $$<
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(ADD_GNU_DEBUGLINK) $$@ $$<
|
||||
else # not solaris
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo : $$($1_TARGET)
|
||||
$(RM) $$@
|
||||
$(OBJCOPY) --only-keep-debug $$< $$@
|
||||
$(OBJCOPY) --add-gnu-debuglink=$$@ $$<
|
||||
endif
|
||||
|
||||
ifeq ($(ZIP_DEBUGINFO_FILES), 1)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).diz
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).diz : $$($1_TARGET)
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_PROGRAM).map $$($1_PROGRAM).pdb
|
||||
else
|
||||
$$($1_OBJECT_DIR)/$$(PROGRAM_PREFIX)$$($1_PROGRAM).diz : $$($1_TARGET) \
|
||||
$$($1_OBJECT_DIR)/$$($1_PROGRAM).debuginfo
|
||||
$(CD) $$($1_OBJECT_DIR) \
|
||||
&& $(ZIP) -q $$@ $$($1_PROGRAM).debuginfo
|
||||
endif
|
||||
else
|
||||
ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).map \
|
||||
$$($1_OUTPUT_DIR)/$$($1_PROGRAM).pdb
|
||||
else
|
||||
$1 += $$($1_OUTPUT_DIR)/$$($1_PROGRAM).debuginfo
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
$$($1_TARGET) : $$($1_EXPECTED_OBJS) $$($1_RES) $$($1_GEN_MANIFEST)
|
||||
$$(call LINKING_EXE_MSG,$$($1_BASENAME))
|
||||
$$($1_LDEXE) $$($1_LDFLAGS) $$($1_EXTRA_LDFLAGS) $(EXE_OUT_OPTION)$$($1_TARGET) \
|
||||
$$($1_EXPECTED_OBJS) $$($1_RES) $$($1_LDFLAGS_SUFFIX) \
|
||||
$$($1_EXTRA_LDFLAGS_SUFFIX)
|
||||
ifneq (,$$($1_GEN_MANIFEST))
|
||||
$(MT) -nologo /manifest $$($1_GEN_MANIFEST) /outputresource:$$@;#1
|
||||
endif
|
||||
|
||||
endif
|
||||
endef
|
||||
|
@ -1,103 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License version 2 only, as
|
||||
# published by the Free Software Foundation. Oracle designates this
|
||||
# particular file as subject to the "Classpath" exception as provided
|
||||
# by Oracle in the LICENSE file that accompanied this code.
|
||||
#
|
||||
# This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
# version 2 for more details (a copy is included in the LICENSE file that
|
||||
# accompanied this code).
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License version
|
||||
# 2 along with this work; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
# or visit www.oracle.com if you need additional information or have any
|
||||
# questions.
|
||||
#
|
||||
|
||||
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))
|
||||
|
||||
|
||||
$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