From df8389646f36c26d6be8a012d2256ae9e48428dd Mon Sep 17 00:00:00 2001 From: Joshua Cranmer Date: Sun, 31 Mar 2013 00:29:30 -0500 Subject: [PATCH] Bug 846540 - Emasculate comm-central/configure.in, part 3: (effectively) eliminate autoconf.mk. r=Standard8, gps --HG-- extra : rebase_source : ad2e03fab20de30009c4c2c84c4befc7347f7798 --- configure.in | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/configure.in b/configure.in index 8ceead30a1..cbd32729e1 100644 --- a/configure.in +++ b/configure.in @@ -6326,6 +6326,66 @@ esac AC_OUTPUT([config/autoconf.mk]) +# Build the config.status for comm-central +changequote(<<<,>>>)dnl +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +cat > $CONFIG_STATUS <>>), topsrcdir) + topsrcdir = os.path.normpath(os.path.abspath(rel)) + +topobjdir = os.path.dirname(<<<__file__>>>) + +from mozbuild.backend.configenvironment import BuildConfig +mozfile = os.path.join(topobjdir, 'mozilla', 'config.status') +mozbuildcfg = BuildConfig.from_config_status(mozfile) + +dnl No need to tweak these from mozilla-central +defines = mozbuildcfg.defines +non_global_defines = mozbuildcfg.non_global_defines + +dnl Fix up substitutitons +def remap_subst(pair): + name, value = pair + value = value.replace('\$(DEPTH)', '\$(DEPTH)/mozilla') + value = value.replace('\$(topsrcdir)', '\$(topsrcdir)/mozilla') + if name == 'ac_configure_args': + value = r''' $ac_configure_args '''[1:-1] + elif name in ['MOZ_BRANDING_DIRECTORY', 'MOZ_BUILD_APP']: + value = value[3:] # Strip off ../ from the beginning + elif name in ['top_srcdir', 'MOZ_BUILD_ROOT', 'WIN_TOP_SRC']: + value = value[:-8] # Strip off /mozilla from the end + return name, value + +substs = map(remap_subst, mozbuildcfg.substs) +substs.append(('COMM_BUILD', '1')) + +dnl These are what we output +files = ['config/autoconf.mk'] +headers = [] + +__all__ = ['topobjdir', 'topsrcdir', 'defines', 'non_global_defines', 'substs', 'files', 'headers'] + +dnl Do the actual work +if __name__ == '__main__': + args = dict([(name, globals()[name]) for name in __all__]) + import sys +dnl Don't rely on virtualenv here. Standalone js doesn't use it. + sys.path.append(os.path.join(topsrcdir, ${extra_python_path}'build')) + from ConfigStatus import config_status + config_status(**args) +EOF +changequote([,])dnl + +# Make the config.status file executable +chmod +x $CONFIG_STATUS + dnl ======================================================== dnl = Setup a nice relatively clean build environment for dnl = sub-configures. @@ -6350,6 +6410,11 @@ if test -n "$_WRAP_MALLOC"; then _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`" fi +if test -n "$UNIFY_DIST"; then + # Make --with-unify-dist point to the right path + _SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --with-unify-dist=$UNIFY_DIST" +fi + # build Mozilla first # # the subdir may not yet have been created in the build tree. @@ -6382,3 +6447,6 @@ fi AC_OUTPUT_SUBDIRS(mozilla) ac_configure_args="$_SUBDIR_CONFIG_ARGS" MOZ_BUILD_APP="$MOZ_BUILD_APP_CACHED" + +# Build the comm-central files with config.status +test "$no_create" = yes || ${PYTHON} $CONFIG_STATUS || exit 1