This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: subdir/toplevel dependence (was Re: (toplevel)...)
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Nathanael Nerode <neroden at twcny dot rr dot com>
- Cc: gcc-patches at gcc dot gnu dot org, binutils at sources dot redhat dot com, gdb-patches at sources dot redhat dot com
- Date: 09 Jan 2003 18:44:23 -0200
- Subject: Re: subdir/toplevel dependence (was Re: (toplevel)...)
- Organization: GCC Team, Red Hat
- References: <20021230142402.GA29870@doctormoo>
On Dec 30, 2002, Nathanael Nerode <neroden@twcny.rr.com> wrote:
> Alex said:
>> The solution I see is to arrange for configure to remove sub-Makefiles
>> if it is run without --no-recursion (i.e., no_recursion != yes).
>> Then, the check for sub-Makefile in the configure-* targets will take
>> care of reconfiguring. How does this sound?
> Sounds good to me. Should work.
Fixed with this patch:
Index: ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* configure.in: Remove Makefile in build, host and target modules
unless configure was run with --no-recursion.
* configure: Rebuilt.
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/configure.in,v
retrieving revision 1.208
diff -u -p -r1.208 configure.in
--- configure.in 7 Jan 2003 20:40:40 -0000 1.208
+++ configure.in 9 Jan 2003 20:35:44 -0000
@@ -1,5 +1,5 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-# 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -868,20 +868,6 @@ if test -n "${target_configdirs}" ; then
fi
fi
-# Deconfigure all subdirectories, in case we are changing the
-# configuration from one where a subdirectory is supported to one where it
-# is not.
-if test -z "${norecursion}" && test -n "${configdirs}" ; then
- for i in `echo ${configdirs} | sed -e s/target-//g` ; do
- rm -f $i/Makefile
- done
-fi
-if test -z "${norecursion}" && test -n "${target_configdirs}" ; then
- for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
- rm -f ${target_subdir}/$i/Makefile
- done
-fi
-
# Quietly strip out all directories which aren't configurable in this tree.
# This relies on all configurable subdirectories being autoconfiscated, which
# is now the case.
@@ -1668,13 +1654,24 @@ target_configdirs=`echo "${target_config
# This is the final value for target_configdirs. configdirs already
# has its final value. It's time to create some lists of valid targets.
+# While at that, we remove Makefiles if we were started for recursive
+# configuration, such that the top-level Makefile reconfigures them,
+# like we used to do when configure itself was recursive.
+
all_build_modules=
configure_build_modules=
# Only make build modules if build != host.
# This should be done more generally, but at the moment it doesn't matter.
if test ${host_alias} != ${build_alias} ; then
- all_build_modules=all-build-libiberty
- configure_build_modules=configure-build-libiberty
+ for module in libiberty ; do
+ all_build_modules=all-build-${module}
+ configure_build_modules=configure-build-${module}
+ if test -z "${no_recursion}" \
+ && test -f ${build_subdir}/${module}/Makefile; then
+ echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure"
+ rm -f ${build_subdir}/${module}/Makefile
+ fi
+ done
fi
all_host_modules=
@@ -1686,6 +1683,11 @@ for module in ${configdirs} ; do
check_host_modules="${check_host_modules} check-${module}"
install_host_modules="${install_host_modules} install-${module}"
configure_host_modules="${configure_host_modules} configure-${module}"
+ if test -z "${no_recursion}" \
+ && test -f ${module}/Makefile; then
+ echo 1>&2 "*** removing ${module}/Makefile to force reconfigure"
+ rm -f ${module}/Makefile
+ fi
done
install_host_modules_nogcc=`echo "${install_host_modules}" | sed -e 's/install-gcc//g'`
@@ -1698,6 +1700,11 @@ for module in ${target_configdirs} ; do
check_target_modules="${check_target_modules} check-target-${module}"
install_target_modules="${install_target_modules} install-target-${module}"
configure_target_modules="${configure_target_modules} configure-target-${module}"
+ if test -z "${no_recursion}" \
+ && test -f ${target_subdir}/${module}/Makefile; then
+ echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure"
+ rm -f ${target_subdir}/${module}/Makefile
+ fi
done
# Determine whether gdb needs tk/tcl or not.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer