From: Peter Stephenson <Peter.Stephenson@csr.com>
To: "Zsh Hackers' List" <zsh-workers@zsh.org>
Subject: Re: #include problem for generated files included in system.h
Date: Tue, 10 May 2011 17:36:29 +0100 [thread overview]
Message-ID: <20110510173629.21735f0a@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <110509072517.ZM19256@torch.brasslantern.com>
On Mon, 9 May 2011 07:25:16 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> Rather than generate <some-relative-path-added-to-zsh.mdd>/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 <pws@csr.com> 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
next prev parent reply other threads:[~2011-05-10 16:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 10:44 Peter Stephenson
2011-05-09 14:25 ` Bart Schaefer
2011-05-10 16:36 ` Peter Stephenson [this message]
2011-05-10 16:45 ` Peter Stephenson
2011-05-10 21:04 ` Alexey I. Froloff
2011-05-11 8:53 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110510173629.21735f0a@pwslap01u.europe.root.pri \
--to=peter.stephenson@csr.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).