Port bug 762358 - .mozconfig changes don't cause configure to run - to comm-central to fix unit test sync dirs bustage. r=bustage-fix

This commit is contained in:
Mark Banner 2012-06-07 12:12:10 +02:00
Родитель 52215167a9
Коммит 0ec205e97c
2 изменённых файлов: 15 добавлений и 23 удалений

Просмотреть файл

@ -11,7 +11,7 @@
print_header() {
_mozconfig=${MOZCONFIG:-$HOME/.mozconfig}
cat >> $tmp_file <<EOF
cat <<EOF
# gmake
# This file is automatically generated for client.mk.
# Do not edit. Edit $_mozconfig instead.
@ -20,11 +20,11 @@ EOF
}
ac_add_options() {
echo "# $* is used by configure (not client.mk)" >> $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

Просмотреть файл

@ -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)