From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31393 invoked by alias); 4 Dec 2002 00:23:49 -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 31206 invoked from network); 4 Dec 2002 00:23:43 -0000 Received: from unknown (HELO mailout6-0.nyroc.rr.com) (24.92.226.125) by sources.redhat.com with SMTP; 4 Dec 2002 00:23:43 -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 gB40Ndk12623; Tue, 3 Dec 2002 19:23:39 -0500 (EST) Received: from neroden by doctormoo with local (Exim 3.36 #1 (Debian)) id 18JNJU-00080W-00; Tue, 03 Dec 2002 19:22:52 -0500 Date: Tue, 03 Dec 2002 16:23:00 -0000 To: gcc-patches@gcc.gnu.org, gdb-patches@sources.redhat.com, binutils@sources.redhat.com, dj@redhat.com Subject: (toplevel patch) host subconfigures in Makefile, fixed version Message-ID: <20021204002251.GA22528@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/msg00097.txt.bz2 Typo which I'd fixed somehow crept into my previous submission. Update of http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01885.html Tested on i686-pc-linux-gnu. This doesn't configure in the Makefile by default, so it's pretty safe. I'll do that a bit later. :-) * Makefile.tpl: Add targets for configuring host subdirs in Makefile, and corresponding dependencies. * Makefile.in: Regenerate. --- Makefile.tpl 2002-12-03 16:20:16.000000000 -0500 +++ Makefile.tpl.newer 2002-12-03 18:46:48.000000000 -0500 @@ -867,6 +867,47 @@ # Modules which run on the host machine # -------------------------------------- [+ FOR host_modules +] +.PHONY: configure-[+module+] maybe-configure-[+module+] +maybe-configure-[+module+]: +configure-[+module+]: [+module+]/Makefile + +[+module+]/Makefile: config.status + @[ -d [+module+] ] || mkdir [+module+]; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + fi; \ + echo Configuring in [+module+]; \ + cd [+module+] || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ + libsrcdir="$$s/[+module+]";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ + libsrcdir="$$s/[+module+]";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + .PHONY: all-[+module+] maybe-all-[+module+] maybe-all-[+module+]: all-[+module+]: @@ -1057,6 +1098,47 @@ # build modules. So GCC is a sort of hybrid. # gcc is the only module which uses GCC_FLAGS_TO_PASS. +.PHONY: configure-gcc maybe-configure-gcc +maybe-configure-gcc: +configure-gcc: gcc/Makefile + +gcc/Makefile: config.status + @[ -d gcc ] || mkdir gcc; \ + r=`${PWD}`; export r; \ + s=`cd $(srcdir); ${PWD}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + if [ z$(build_canonical) != z$(host_canoncial) ] ; then \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + fi; \ + echo Configuring in gcc; \ + cd gcc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + .PHONY: all-gcc maybe-all-gcc maybe-all-gcc: all-gcc: @@ -1190,6 +1272,8 @@ # it's safer to use a soft dependency. # Host modules specific to gcc. +# GCC needs to identify certain tools. +gcc/Makefile: maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex all-gcc: maybe-all-libiberty maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib # This is a slightly kludgy method of getting dependencies on # all-build-libiberty correct; it would be better to build it every time. @@ -1197,12 +1281,16 @@ all-bootstrap: maybe-all-libiberty maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib # Host modules specific to gdb. +# GDB needs to know that the simulator is being built. +gdb/Makefile: maybe-configure-tcl maybe-configure-tk maybe-configure-sim GDB_TK = @GDB_TK@ all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui +libgui/Makefile: maybe-configure-tcl maybe-configure-tk all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl # Host modules specific to binutils. +bfd/Makefile: configure-libiberty all-bfd: maybe-all-libiberty maybe-all-intl all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl # We put install-opcodes before install-binutils because the installed @@ -1216,7 +1304,9 @@ # Other host modules in the 'src' repository. all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk +expect/Makefile: configure-tcl maybe-configure-tk all-expect: maybe-all-tcl maybe-all-tk +itcl/Makefile: maybe-configure-tcl maybe-configure-tk all-itcl: maybe-all-tcl maybe-all-tk # We put install-tcl before install-itcl because itcl wants to run a # program on installation which uses the Tcl libraries. @@ -1224,7 +1314,9 @@ all-sid: maybe-all-tcl maybe-all-tk install-sid: maybe-install-tcl maybe-install-tk all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline +tk/Makefile: maybe-configure-tcl all-tk: maybe-all-tcl +tix/Makefile: maybe-configure-tcl maybe-configure-tk all-tix: maybe-all-tcl maybe-all-tk all-texinfo: maybe-all-libiberty