8189263: Introduce CUSTOM_ROOT

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2017-10-16 08:43:42 +02:00
parent e4bea042c5
commit f627304d96
6 changed files with 34 additions and 35 deletions

View File

@ -267,8 +267,9 @@ else # HAS_SPEC=true
$(ECHO) "Re-running configure using default settings"
endif
( cd $(OUTPUTDIR) && PATH="$(ORIGINAL_PATH)" \
CUSTOM_ROOT="$(CUSTOM_ROOT)" \
CUSTOM_CONFIG_DIR="$(CUSTOM_CONFIG_DIR)" \
$(BASH) $(CONFIGURE_CMD) $(CONFIGURE_COMMAND_LINE) )
$(BASH) $(TOPDIR)/configure $(CONFIGURE_COMMAND_LINE) )
##############################################################################
# The main target, for delegating into Main.gmk

View File

@ -70,10 +70,10 @@ ifeq ($(HAS_SPEC),)
$(subst \ ,\#,$(MAKEOVERRIDES))))
# Setup information about available configurations, if any.
ifeq ($(CUSTOM_BUILD_DIR), )
build_dir=$(topdir)/build
ifneq ($(CUSTOM_ROOT), )
build_dir=$(CUSTOM_ROOT)/build
else
build_dir=$(CUSTOM_BUILD_DIR)
build_dir=$(topdir)/build
endif
all_spec_files=$(wildcard $(build_dir)/*/spec.gmk)
# Extract the configuration names from the path
@ -227,7 +227,11 @@ ifeq ($(HAS_SPEC),)
else
# Use spec.gmk files in the build output directory
ifeq ($$(all_spec_files),)
$$(info Error: No configurations found for $$(topdir).)
ifneq ($(CUSTOM_ROOT), )
$$(info Error: No configurations found for $$(CUSTOM_ROOT).)
else
$$(info Error: No configurations found for $$(topdir).)
endif
$$(info Please run 'bash configure' to create a configuration.)
$$(info )
$$(error Cannot continue)

View File

@ -766,13 +766,10 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_ARG_WITH(conf-name, [AS_HELP_STRING([--with-conf-name],
[use this as the name of the configuration @<:@generated from important configuration options@:>@])],
[ CONF_NAME=${with_conf_name} ])
AC_ARG_WITH(output-base-dir, [AS_HELP_STRING([--with-output-base-dir],
[override the default output base directory @<:@./build@:>@])],
[ OUTPUT_BASE=${with_output_base_dir} ], [ OUTPUT_BASE="$TOPDIR/build" ] )
# Test from where we are running configure, in or outside of src root.
AC_MSG_CHECKING([where to store configuration])
if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$TOPDIR/common" \
if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \
|| test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
|| test "x$CURDIR" = "x$TOPDIR/make" ; then
# We are running configure from the src root.
@ -783,7 +780,12 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
else
AC_MSG_RESULT([in build directory with custom name])
fi
OUTPUTDIR="${OUTPUT_BASE}/${CONF_NAME}"
if test "x$CUSTOM_ROOT" != x; then
OUTPUTDIR="${CUSTOM_ROOT}/build/${CONF_NAME}"
else
OUTPUTDIR="${TOPDIR}/build/${CONF_NAME}"
fi
$MKDIR -p "$OUTPUTDIR"
if test ! -d "$OUTPUTDIR"; then
AC_MSG_ERROR([Could not create build directory $OUTPUTDIR])

View File

@ -23,19 +23,18 @@
#
if test "x$1" != xCHECKME; then
echo "WARNING: Calling the wrapper script directly is deprecated and unsupported."
echo "Not all features of configure will be available."
echo "ERROR: Calling this wrapper script directly is not supported."
echo "Use the 'configure' script in the top-level directory instead."
TOPDIR=$(cd $(dirname $0)/../.. > /dev/null && pwd)
else
# Now the next argument is the absolute top-level directory path.
# The TOPDIR variable is passed on to configure.ac.
TOPDIR="$2"
# Remove these two arguments to get to the user supplied arguments
shift
shift
exit 1
fi
# The next argument is the absolute top-level directory path.
# The TOPDIR variable is passed on to configure.ac.
TOPDIR="$2"
# Remove these two arguments to get to the user supplied arguments
shift
shift
if test "x$BASH" = x; then
echo "Error: This script must be run using bash." 1>&2
exit 1

View File

@ -1134,7 +1134,6 @@ with_toolchain_path
with_extra_path
with_sdk_name
with_conf_name
with_output_base_dir
with_output_sync
with_default_make_target
enable_headless_only
@ -2043,7 +2042,6 @@ Optional Packages:
--with-sdk-name use the platform SDK of the given name. [macosx]
--with-conf-name use this as the name of the configuration [generated
from important configuration options]
--with-output-base-dir override the default output base directory [./build]
--with-output-sync set make output sync type if supported by make.
[recurse]
--with-default-make-target
@ -5117,7 +5115,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1507635096
DATE_WHEN_GENERATED=1508136203
###############################################################################
#
@ -17554,18 +17552,10 @@ if test "${with_conf_name+set}" = set; then :
fi
# Check whether --with-output-base-dir was given.
if test "${with_output_base_dir+set}" = set; then :
withval=$with_output_base_dir; OUTPUT_BASE=${with_output_base_dir}
else
OUTPUT_BASE="$TOPDIR/build"
fi
# Test from where we are running configure, in or outside of src root.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to store configuration" >&5
$as_echo_n "checking where to store configuration... " >&6; }
if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$TOPDIR/common" \
if test "x$CURDIR" = "x$TOPDIR" || test "x$CURDIR" = "x$CUSTOM_ROOT" \
|| test "x$CURDIR" = "x$TOPDIR/make/autoconf" \
|| test "x$CURDIR" = "x$TOPDIR/make" ; then
# We are running configure from the src root.
@ -17578,7 +17568,12 @@ $as_echo "in default location" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: in build directory with custom name" >&5
$as_echo "in build directory with custom name" >&6; }
fi
OUTPUTDIR="${OUTPUT_BASE}/${CONF_NAME}"
if test "x$CUSTOM_ROOT" != x; then
OUTPUTDIR="${CUSTOM_ROOT}/build/${CONF_NAME}"
else
OUTPUTDIR="${TOPDIR}/build/${CONF_NAME}"
fi
$MKDIR -p "$OUTPUTDIR"
if test ! -d "$OUTPUTDIR"; then
as_fn_error $? "Could not create build directory $OUTPUTDIR" "$LINENO" 5

View File

@ -842,8 +842,6 @@ JRE_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME)
TEST_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME)
DOCS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME)
CONFIGURE_CMD := $(TOPDIR)/configure
# This macro is called to allow inclusion of closed source counterparts.
# Unless overridden in closed sources, it expands to nothing.
# Usage: This function is called in an open makefile, with the following