This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Remove config.cache files when reconfiguring at top level
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Cc: gdb-patches at sourceware dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Feb 2010 10:52:57 +0000
- Subject: Remove config.cache files when reconfiguring at top level
Hi Guys,
I am going to apply the patch below to the top level configure.ac file
to fix a problem reported in the binutils PR 11238.
Essentially the problem is that if a toolchain builder re-runs the
configure script with a new set of CFLAGS (or some other similar
variable) without first running distclean, then the config.cache files
will be left behind in the build sub-directories. This then prevents
the the next build from working as the cached value of CFLAGS differs
from the new one. The patch fixes the problem by makeing the
configure script delete config.cache files at the same time as it is
deleting Makefiles in the sub-directories.
Cheers
Nick
ChangeLog
2010-02-15 Nick Clifton <nickc@redhat.com>
PR 11238
* configure.ac: Delete config.cache files in sub-directories when
deleting Makefiles.
* configure: Regenerate.
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/configure.ac,v
retrieving revision 1.93
diff -c -3 -p -r1.93 configure.ac
*** configure.ac 15 Feb 2010 10:37:54 -0000 1.93
--- configure.ac 15 Feb 2010 10:42:04 -0000
*************** for module in ${build_configdirs} ; do
*** 2710,2715 ****
--- 2710,2721 ----
echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
rm -f ${build_subdir}/${module}/Makefile
fi
+ # PR 11238: Also remove config.cache files.
+ if test -z "${no_recursion}" \
+ && test -f ${build_subdir}/${module}/config.cache; then
+ echo 1>&2 "*** removing ${build_subdir}/${module}/config.cache to allow reconfigure"
+ rm -f ${build_subdir}/${module}/config.cache
+ fi
extrasub_build="$extrasub_build
/^@if build-$module\$/d
/^@endif build-$module\$/d
*************** for module in ${configdirs} ; do
*** 2725,2730 ****
--- 2731,2741 ----
rm -f ${file}
fi
done
+ # PR 11238: Also remove config.cache files.
+ if test -f ${module}/config.cache; then
+ echo 1>&2 "*** removing ${module}/config.cache to allow reconfigure"
+ rm -f ${module}/config.cache
+ fi
fi
extrasub_host="$extrasub_host
/^@if $module\$/d
*************** for module in ${target_configdirs} ; do
*** 2739,2744 ****
--- 2750,2761 ----
echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
rm -f ${target_subdir}/${module}/Makefile
fi
+ # PR 11238: Also remove config.cache files.
+ if test -z "${no_recursion}" \
+ && test -f ${target_subdir}/${module}/config.cache; then
+ echo 1>&2 "*** removing ${target_subdir}/${module}/config.cache to allow reconfigure"
+ rm -f ${target_subdir}/${module}/config.cache
+ fi
# We only bootstrap target libraries listed in bootstrap_target_libs.
case $bootstrap_target_libs in