From 0ec205e97cc16f51d9490901eb6b437d88040986 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Thu, 7 Jun 2012 12:12:10 +0200 Subject: [PATCH] Port bug 762358 - .mozconfig changes don't cause configure to run - to comm-central to fix unit test sync dirs bustage. r=bustage-fix --- build/autoconf/mozconfig2client-mk | 30 ++++++++++-------------------- client.mk | 8 +++++--- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/build/autoconf/mozconfig2client-mk b/build/autoconf/mozconfig2client-mk index 8018cfc09e..dc6ace9378 100755 --- a/build/autoconf/mozconfig2client-mk +++ b/build/autoconf/mozconfig2client-mk @@ -11,7 +11,7 @@ print_header() { _mozconfig=${MOZCONFIG:-$HOME/.mozconfig} - cat >> $tmp_file <> $tmp_file + echo "# $* is used by configure (not client.mk)" } ac_add_app_options() { - echo "# $* is used by configure (not client.mk)" >> $tmp_file + echo "# $* is used by configure (not client.mk)" } mk_add_options() { @@ -35,14 +35,14 @@ mk_add_options() { _opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'` echo $_opt; opts="${opts:+$opts^}$_opt"; - done >> $tmp_file + done } mk_echo_options() { - echo "Adding client.mk options from $FOUND_MOZCONFIG:" + echo "Adding client.mk options from $FOUND_MOZCONFIG:" >&2 IFS=^ for _opt in $opts; do - echo " $_opt" + echo " $_opt" >&2 done } @@ -51,23 +51,19 @@ mk_echo_options() { scriptdir=`dirname $0` topsrcdir=$1 -out_file=$2 -tmp_file="$out_file-tmp$$" opts="" -trap "rm -f $tmp_file; exit 1" 1 2 15 - -print_header > $tmp_file +print_header # If the path changes, configure should be rerun -echo "# PATH=$PATH" >> $tmp_file +echo "# PATH=$PATH" # If FOUND_MOZCONFIG isn't set, look for it and make sure the script doesn't error out isfoundset=${FOUND_MOZCONFIG+yes} if [ -z $isfoundset ]; then FOUND_MOZCONFIG=`$scriptdir/mozconfig-find $topsrcdir` if [ $? -ne 0 ]; then - echo '$(error Fix above errors before continuing.)' >> $tmp_file + echo '$(error Fix above errors before continuing.)' else isfoundset=yes fi @@ -78,15 +74,9 @@ if [ -n $isfoundset ]; then then . "$FOUND_MOZCONFIG" fi - echo "export FOUND_MOZCONFIG := $FOUND_MOZCONFIG" >> $tmp_file + echo "export FOUND_MOZCONFIG := $FOUND_MOZCONFIG" if [ "$opts" ]; then mk_echo_options fi fi - -if test -f $out_file && cmp -s $tmp_file $out_file; then - rm $tmp_file -else - mv -f $tmp_file $out_file -fi diff --git a/client.mk b/client.mk index 25055649fb..22bd2e4696 100644 --- a/client.mk +++ b/client.mk @@ -99,10 +99,12 @@ MOZCONFIG_LOADER := build/autoconf/mozconfig2client-mk MOZCONFIG_FINDER := build/autoconf/mozconfig-find MOZCONFIG_MODULES := build/unix/uniq.pl -run_for_side_effects := \ - $(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) $(TOPSRCDIR)/.mozconfig.mk > $(TOPSRCDIR)/.mozconfig.out) +define CR -include $(TOPSRCDIR)/.mozconfig.mk + +endef + +$(eval $(subst ||,$(CR),$(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) 2> $(TOPSRCDIR)/.mozconfig.out | sed 's/$$/||/'))) ifndef MOZ_OBJDIR MOZ_OBJDIR = obj-$(CONFIG_GUESS)