From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28354 invoked by alias); 10 May 2011 16:36:42 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29214 Received: (qmail 13439 invoked from network); 10 May 2011 16:36:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Date: Tue, 10 May 2011 17:36:29 +0100 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: #include problem for generated files included in system.h Message-ID: <20110510173629.21735f0a@pwslap01u.europe.root.pri> In-Reply-To: <110509072517.ZM19256@torch.brasslantern.com> References: <20110509114402.38f33fd3@pwslap01u.europe.root.pri> <110509072517.ZM19256@torch.brasslantern.com> Organization: Cambridge Silicon Radio X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.103.11.49] X-Scanned-By: MailControl A_10_80_00 (www.mailcontrol.com) on 10.71.0.138 On Mon, 9 May 2011 07:25:16 -0700 Bart Schaefer wrote: > Rather than generate /system.h > why not add -Isome-relative-path-added-to-zsh.mdd to CLFAGS? Is the > path being generated at a poor place relative to building Makefiles? The problem is that if you don't tell it explicitly where each file is, then you need to give it a whole load of possibilities of where a header might be relative to the current directory. - It might be in the current directory. - It might be generated in the build version of the Src directory. - It might be in the original Src directory. - It might be in the original Src/Zle directory (needed to get comp.h in zutil). - It might be in the source directory corresponding to the current build directory. The following seemed to do the trick. The ordering of the -I arguments may not be entirely logical but was the first thing that worked everywhere I tried it. > While we're at it the name "system.h" has always seemed a bit generic > to me, and therefore likely to clash with something. I'll see if I can do that separately. Index: Src/Makemod.in.in =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Makemod.in.in,v retrieving revision 1.8 diff -p -u -r1.8 Makemod.in.in --- Src/Makemod.in.in 9 Jan 2011 16:57:02 -0000 1.8 +++ Src/Makemod.in.in 10 May 2011 16:28:21 -0000 @@ -47,8 +47,8 @@ dir_src = $(dir_top)/Src DNCFLAGS = -COMPILE = $(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS) -DLCOMPILE = $(CC) -c -I. $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS) +COMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS) +DLCOMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS) LINK = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS) -o $@ DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@ Index: Src/mkmakemod.sh =================================================================== RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v retrieving revision 1.17 diff -p -u -r1.17 mkmakemod.sh --- Src/mkmakemod.sh 30 Jan 2008 10:03:49 -0000 1.17 +++ Src/mkmakemod.sh 10 May 2011 16:28:22 -0000 @@ -383,11 +383,7 @@ if $first_stage; then if test -n "$headers"; then echo " echo '/* Extra headers for this module */'; \\" echo " for hdr in $headers; do \\" - echo " if test -f \$\$hdr; then \\" - echo " echo '# include \"'\$\$hdr'\"'; \\" - echo " else \\" - echo " echo '# include \"\$(sdir)/'\$\$hdr'\"'; \\" - echo " fi; \\" + echo " echo '# include \"'\$\$hdr'\"'; \\" echo " done; \\" echo " echo; \\" fi Index: Src/zsh.mdd =================================================================== RCS file: /cvsroot/zsh/zsh/Src/zsh.mdd,v retrieving revision 1.24 diff -p -u -r1.24 zsh.mdd --- Src/zsh.mdd 9 May 2011 10:38:02 -0000 1.24 +++ Src/zsh.mdd 10 May 2011 16:28:22 -0000 @@ -127,7 +127,7 @@ clean.zsh: # This is not properly part of this module, but it is built as if it were. main.o: main.c zsh.mdh main.epro - $(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c + $(CC) -c -I. -I$(sdir_top)/Src $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c main.syms: $(PROTODEPS) proto.zsh: main.epro -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom