public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] binutils: fix out of tree building with syslex regens
@ 2011-10-14  2:38 Mike Frysinger
  2011-10-24  4:27 ` Raymes Khoury
  2011-10-24 13:03 ` Nick Clifton
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Frysinger @ 2011-10-14  2:38 UTC (permalink / raw)
  To: binutils; +Cc: raymes

If you take a release tarball (which has pregenerated syslex and sysinfo files
in it), apply some patches which touch syslex.l, and then build the result out
of tree, it will fail.  This is because syslex.l uses sysinfo.h, but the
sysinfo.y file wasn't updated and so it wasn't regenerated (the files are found
in the $srcdir), and the build rule for syslex.c does not use -I$(srcdir) when
it finds a local file.  Simple fix below.

OK to commit ?

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
to reproduce:
tar xf binutils-2.21.tar.bz2
cd binutils-2.21
mkdir build
cd build
../configure -q
# build everything needed for binutils ahead of time
make all-bfd all-opcodes configure-binutils -s -j4
cd binutils
touch ../../binutils/syslex.l
make

then you'll eventually see the error:
syslex.l:31:21: error: sysinfo.h: No such file or directory

--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -272,7 +272,7 @@
 
 syslex.@OBJEXT@: syslex.c sysinfo.h config.h
 	if [ -r syslex.c ]; then \
-	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
+	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
 	else \
 	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
 	fi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] binutils: fix out of tree building with syslex regens
  2011-10-14  2:38 [patch] binutils: fix out of tree building with syslex regens Mike Frysinger
@ 2011-10-24  4:27 ` Raymes Khoury
  2011-10-24 13:03 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Raymes Khoury @ 2011-10-24  4:27 UTC (permalink / raw)
  To: binutils; +Cc: nickc, Mike Frysinger

ping

On Thu, Oct 13, 2011 at 7:37 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> If you take a release tarball (which has pregenerated syslex and sysinfo files
> in it), apply some patches which touch syslex.l, and then build the result out
> of tree, it will fail.  This is because syslex.l uses sysinfo.h, but the
> sysinfo.y file wasn't updated and so it wasn't regenerated (the files are found
> in the $srcdir), and the build rule for syslex.c does not use -I$(srcdir) when
> it finds a local file.  Simple fix below.
>
> OK to commit ?
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> to reproduce:
> tar xf binutils-2.21.tar.bz2
> cd binutils-2.21
> mkdir build
> cd build
> ../configure -q
> # build everything needed for binutils ahead of time
> make all-bfd all-opcodes configure-binutils -s -j4
> cd binutils
> touch ../../binutils/syslex.l
> make
>
> then you'll eventually see the error:
> syslex.l:31:21: error: sysinfo.h: No such file or directory
>
> --- a/binutils/Makefile.am
> +++ b/binutils/Makefile.am
> @@ -272,7 +272,7 @@
>
>  syslex.@OBJEXT@: syslex.c sysinfo.h config.h
>        if [ -r syslex.c ]; then \
> -         $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
> +         $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
>        else \
>          $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
>        fi
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] binutils: fix out of tree building with syslex regens
  2011-10-14  2:38 [patch] binutils: fix out of tree building with syslex regens Mike Frysinger
  2011-10-24  4:27 ` Raymes Khoury
@ 2011-10-24 13:03 ` Nick Clifton
  1 sibling, 0 replies; 3+ messages in thread
From: Nick Clifton @ 2011-10-24 13:03 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: binutils, raymes

Hi Mike,

> +++ b/binutils/Makefile.am
> @@ -272,7 +272,7 @@
>
>   syslex.@OBJEXT@: syslex.c sysinfo.h config.h
>   	if [ -r syslex.c ]; then \
> -	  $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
> +	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) syslex.c ; \
>   	else \
>   	  $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) $(srcdir)/syslex.c ;\
>   	fi

Approved - please apply.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-24 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-14  2:38 [patch] binutils: fix out of tree building with syslex regens Mike Frysinger
2011-10-24  4:27 ` Raymes Khoury
2011-10-24 13:03 ` Nick Clifton

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 read-only IMAP folder(s) and NNTP newsgroup(s).