From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] PPC: Fail configure when libfdt is not available
Date: Fri, 21 Oct 2011 09:34:22 +0200 [thread overview]
Message-ID: <1319182462-20771-1-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <4EA06A01.5080806@redhat.com>
On 10/20/2011 08:35 PM, Gerd Hoffmann wrote:
> Hi,
>
>> If there are build problems with libfdt on any platform let me know
>> about them. I would like it to build clean as widely as possible, but
>> I don't have that great a diversity of build environments, so I have
>> to reply on bug reports.
>
> Fails to build on RHEL-5:
>
> CC convert-dtsv0-lexer.lex.o
> cc1: warnings being treated as errors
> convert-dtsv0-lexer.lex.c:693: warning: no previous prototype for 'yylex'
> make: *** [convert-dtsv0-lexer.lex.o] Error 1
>
> Removing -Werror from the Makefile gets me a bit further:
>
> CC dtc-lexer.lex.o
> dtc-lexer.lex.c:683: warning: no previous prototype for 'yylex'
> dtc-lexer.l: In function 'push_input_file':
> dtc-lexer.l:192: warning: implicit declaration of function 'yypush_buffer_state'
> dtc-lexer.l:192: warning: nested extern declaration of 'yypush_buffer_state'
> dtc-lexer.l: In function 'pop_input_file':
> dtc-lexer.l:201: warning: implicit declaration of function 'yypop_buffer_state'
> dtc-lexer.l:201: warning: nested extern declaration of 'yypop_buffer_state'
> CC dtc-parser.tab.o
> LD dtc
> dtc-lexer.lex.o: In function `push_input_file':
> /home/buildbot/git/dtc/dtc-lexer.l:192: undefined reference to
> `yypush_buffer_state'
> dtc-lexer.lex.o: In function `pop_input_file':
> /home/buildbot/git/dtc/dtc-lexer.l:201: undefined reference to
> `yypop_buffer_state'
> collect2: ld returned 1 exit status
> make: *** [dtc] Error 1
>
> I guess the flex version shipped with RHEL-5 is too old.
>
> $ rpm -qf $(which lex)
> flex-2.5.4a-41.fc6
flex is only used by dtc, not libfdt, so you can probably patch it out.
However, the usual convention is that lex- and yacc-generated files
are shipped in the tarball, with a "make dist" that wraps tar and/or
git-archive. See the following patch.
Paolo
------------------ 8< -------------------------
>From f91c3f5f165df8c8331c0c33374f55f5cf157ba6 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Fri, 21 Oct 2011 08:59:43 +0200
Subject: [PATCH] build: add make dist
The usual convention is that lex- and yacc-generated files are shipped in
the tarball. Another usual convention, originating in Automake, is that
"make dist" wraps tar and/or git-archive and generates a self-contained
archive. dtc does not use Automake, so add this target.
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 23 +++++++++++++++++++++++
Makefile.dtc | 4 ++--
2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index b32409b..edfdb9c 100644
--- a/Makefile
+++ b/Makefile
@@ -246,4 +246,27 @@ $(LIBFDT_lib):
@$(VECHO) BISON $@
$(BISON) -d $<
+.PHONY: distdir dist-gz dist-xz dist
+
+distdir = dtc-$(dtc_version)/
+distdir: $(DTC_GEN_SRCS) $(CONVERT_GEN_SRCS)
+ mkdir $(distdir)
+ @$(VECHO) DISTDIR $@
+ git archive --format=tar HEAD --prefix=$(distdir) | tar -xf -
+ @for i in $^; do \
+ $(if $(V),echo cp $$i $(distdir),:); \
+ cp $$i $(distdir); \
+ done
+ chmod -R ug+w $(distdir)
+
+dist-gz: distdir
+ @$(VECHO) TAR dtc-$(dtc_version).tar.gz
+ tar -chozf dtc-$(dtc_version).tar.gz $(distdir)
+dist-xz: distdir
+ @$(VECHO) TAR dtc-$(dtc_version).tar.xz
+ tar -Ixz -chof dtc-$(dtc_version).tar.xz $(distdir)
+
+dist: dist-gz dist-xz
+ rm -rf $(distdir)
+
FORCE:
diff --git a/Makefile.dtc b/Makefile.dtc
index bece49b..0b2c869 100644
--- a/Makefile.dtc
+++ b/Makefile.dtc
@@ -14,5 +14,5 @@ DTC_SRCS = \
treesource.c \
util.c
-DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c
-DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
+DTC_GEN_SRCS = dtc-lexer.lex.c dtc-parser.tab.c dtc-parser.tab.h
+DTC_OBJS = $(patsubst %.c,%.o,$(DTC_SRCS) $(filter %.c, $(DTC_GEN_SRCS)))
--
1.7.6
next prev parent reply other threads:[~2011-10-21 7:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-18 0:18 [Qemu-devel] [PATCH] PPC: Fail configure when libfdt is not available Alexander Graf
2011-10-18 6:45 ` Paolo Bonzini
2011-10-18 19:26 ` Richard Henderson
2011-10-19 6:09 ` Paolo Bonzini
2011-10-18 8:55 ` Andreas Färber
2011-10-18 9:02 ` Alexander Graf
2011-10-18 18:30 ` Blue Swirl
2011-10-19 2:08 ` Alexander Graf
2011-10-18 11:37 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2011-10-20 18:35 ` Gerd Hoffmann
2011-10-21 3:34 ` David Gibson
2011-10-21 7:11 ` Gerd Hoffmann
2011-10-21 7:34 ` Paolo Bonzini [this message]
2011-10-24 2:22 ` David Gibson
2011-10-18 9:47 ` [Qemu-devel] " Peter Maydell
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=1319182462-20771-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=david@gibson.dropbear.id.au \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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.
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).