8189263: Introduce CUSTOM_ROOT
authorihse
Mon, 16 Oct 2017 08:43:42 +0200
changeset 47346 ea082b202a23
parent 47345 0a1fc9f3779c
child 47347 26d9587d814b
8189263: Introduce CUSTOM_ROOT Reviewed-by: erikj
make/Init.gmk
make/InitSupport.gmk
make/autoconf/basics.m4
make/autoconf/configure
make/autoconf/generated-configure.sh
make/autoconf/spec.gmk.in
--- a/make/Init.gmk	Sat Oct 14 09:51:25 2017 +0100
+++ b/make/Init.gmk	Mon Oct 16 08:43:42 2017 +0200
@@ -267,8 +267,9 @@
 	  $(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
--- a/make/InitSupport.gmk	Sat Oct 14 09:51:25 2017 +0100
+++ b/make/InitSupport.gmk	Mon Oct 16 08:43:42 2017 +0200
@@ -70,10 +70,10 @@
       $(subst \ ,\#,$(MAKEOVERRIDES))))
 
   # Setup information about available configurations, if any.
-  ifeq ($(CUSTOM_BUILD_DIR), )
+  ifneq ($(CUSTOM_ROOT), )
+    build_dir=$(CUSTOM_ROOT)/build
+  else
     build_dir=$(topdir)/build
-  else
-    build_dir=$(CUSTOM_BUILD_DIR)
   endif
   all_spec_files=$(wildcard $(build_dir)/*/spec.gmk)
   # Extract the configuration names from the path
@@ -227,7 +227,11 @@
     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)
--- a/make/autoconf/basics.m4	Sat Oct 14 09:51:25 2017 +0100
+++ b/make/autoconf/basics.m4	Mon Oct 16 08:43:42 2017 +0200
@@ -766,13 +766,10 @@
   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 @@
     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])
--- a/make/autoconf/configure	Sat Oct 14 09:51:25 2017 +0100
+++ b/make/autoconf/configure	Mon Oct 16 08:43:42 2017 +0200
@@ -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
--- a/make/autoconf/generated-configure.sh	Sat Oct 14 09:51:25 2017 +0100
+++ b/make/autoconf/generated-configure.sh	Mon Oct 16 08:43:42 2017 +0200
@@ -1134,7 +1134,6 @@
 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 @@
   --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 @@
 #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 @@
 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 "$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
--- a/make/autoconf/spec.gmk.in	Sat Oct 14 09:51:25 2017 +0100
+++ b/make/autoconf/spec.gmk.in	Mon Oct 16 08:43:42 2017 +0200
@@ -842,8 +842,6 @@
 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