From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5046 invoked by alias); 20 Dec 2002 00:06:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5021 invoked from network); 20 Dec 2002 00:06:26 -0000 Received: from unknown (HELO mailout6-0.nyroc.rr.com) (24.92.226.177) by 209.249.29.67 with SMTP; 20 Dec 2002 00:06:26 -0000 Received: from doctormoo (syr-24-24-16-193.twcny.rr.com [24.24.16.193]) by mailout6-0.nyroc.rr.com (8.11.6/RoadRunner 1.20) with ESMTP id gBK061k27561; Thu, 19 Dec 2002 19:06:01 -0500 (EST) Received: from neroden by doctormoo with local (Exim 3.36 #1 (Debian)) id 18PAen-0007t3-00; Thu, 19 Dec 2002 19:04:49 -0500 Date: Thu, 19 Dec 2002 16:16:00 -0000 To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com, binutils@sources.redhat.com, dj@redhat.com Subject: (toplevel patch) Fix multilib.out dependencies and related problems. Message-ID: <20021220000447.GA18896@doctormoo> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i From: Nathanael Nerode X-SW-Source: 2002-12/txt/msg00565.txt.bz2 I think this finally fixes the various problems related to phony depdencies, real dependencies, and multilib.out. DJ, please review. :-) Bootstrapped on i686-pc-linux-gnu. Ran 'make'; no reconfigurations. Removed xgcc and ran 'make'; gcc rebuilt it, and target libs were reconfigured and built. Ran 'make'; no reconfigurations. Configured and built with a preset CC_FOR_TARGET; no errors from missing dependencies. So it all works. Woo hoo. I know I have some leftover BASE_CC_FOR_TARGET junk, but I'll get that later. * configure.in: Issue 'maybe_compiler_driver' (rather than BASE_CC_FOR_TARGET) as the dependence for multilib.out * Makefile.tpl: Use it; add regen rule for gcc/xgcc. * Makefile.in: Regenerate. Index: Makefile.tpl =================================================================== RCS file: /cvs/gcc/gcc/Makefile.tpl,v retrieving revision 1.21 diff -u -r1.21 Makefile.tpl --- Makefile.tpl 19 Dec 2002 20:23:50 -0000 1.21 +++ Makefile.tpl 19 Dec 2002 21:16:18 -0000 @@ -784,7 +784,6 @@ # built are. TAGS: do-TAGS - # -------------------------------------- # Modules which run on the build machine # -------------------------------------- @@ -970,7 +969,7 @@ # Don't manually override CC_FOR_TARGET at make time; get it set right # at configure time. Otherwise multilibs may be wrong. -$(TARGET_SUBDIR)/[+module+]/multilib.out: maybe-all-gcc +$(TARGET_SUBDIR)/[+module+]/multilib.out: @maybe_compiler_driver@ @[ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\ r=`${PWD}`; export r; \ echo "Configuring multilibs for [+module+]"; \ @@ -1264,6 +1263,14 @@ rm -rf gcc/include; \ mv gcc/tmp-include gcc/include 2>/dev/null; \ else true; fi + +# Special multilib.out dependence support. +# When in-tree gcc is being used as CC_FOR_TARGET, we make +# multilib.out depend on gcc/xgcc. So we need a rule for what to +# do if gcc/xgcc is in fact missing. (Normally it would be either +# up to date or newer than multilib.out, not missing.) +gcc/xgcc: + $(MAKE) all-gcc # -------------------------------------- # Dependencies between different modules Index: configure.in =================================================================== RCS file: /cvs/gcc/gcc/configure.in,v retrieving revision 1.196 diff -u -r1.196 configure.in --- configure.in 19 Dec 2002 20:23:50 -0000 1.196 +++ configure.in 19 Dec 2002 21:16:21 -0000 @@ -1698,11 +1698,23 @@ qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'` qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'` -# BASE_CC_FOR_TARGET is the actual program file of CC_FOR_TARGET, -# for use in dependencies. Replace $$r with a relative -# path if it's present. -set dummy $CC_FOR_TARGET; cc_for_target_first_word=$2 -BASE_CC_FOR_TARGET=`echo "$cc_for_target_first_word" | sed -e 's,[$][$]r,.,'` +# maybe_compiler_driver is the program file on which multilib.out depends. + +# If we're not using the configured GCC, for now we just punt on the +# dependency. If you change the external compiler you're using, you +# should know enough to reconfigure from scratch. +maybe_compiler_driver= + +# On the other hand, if you are using the configured GCC... +case "${configdirs}" in + *gcc*) # We're configuring GCC. + case "${CC_FOR_TARGET}" in + *xgcc*) + # And we are (probably) using the configured GCC. + maybe_compiler_driver=gcc/xgcc + ;; + esac ;; +esac sedtemp=sed.$$ cat >$sedtemp <