[PATCH] Allow BUILD_CFLAGS and TARGET_CFLAGS to be specified at configure time
Simon Horman
horms at verge.net.au
Tue Jul 15 09:06:07 EDT 2008
On Tue, Jul 15, 2008 at 02:26:59PM +0200, Bernhard Walle wrote:
> * Simon Horman [2008-07-15 22:24]:
> >
> > On Tue, Jul 15, 2008 at 10:08:22PM +1000, Jeremy Kerr wrote:
> > > Currently, we're unconditionally setting the build and target cflags in
> > > the configure script, which means that they can't be easily
> > > overwritten.
> > >
> > > This change conditionally sets these variables if they're not specified
> > > during configure, allowing something like:
> > >
> > > BUILD_CFLAGS=-Werror ./configure
> > >
> > > Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
> > >
> > > ---
> > > configure.ac | 9 +++++++--
> > > 1 file changed, 7 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/configure.ac b/configure.ac
> > > index 5f1c15a..fa5330a 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -56,8 +56,13 @@ if test "${host_alias}" ; then
> > > OBJDIR="$OBJDIR-${host_alias}"
> > > fi
> > >
> > > -BUILD_CFLAGS='-O2 -Wall'
> > > -TARGET_CFLAGS='-O2 -Wall'
> > > +if test "x$BUILD_CFLAGS" = "x" ; then
> > > + BUILD_CFLAGS='-O2 -Wall'
> > > +fi
> > > +
> > > +if test "x$TARGET_CFLAGS" = "x" ; then
> > > + TARGET_CFLAGS='-O2 -Wall'
> > > +fi
> > >
> > > AC_ARG_WITH([objdir], AC_HELP_STRING([--with-objdir=<dir>],[select directory for object files]),
> > > [ OBJDIR="$withval" ], [ OBJDIR="$OBJDIR" ])
> >
> > Can we get rid of TARGET_CFLAGS? It doesn't seem to be used anywhere.
> >
> > Also I think you need the following util/Makefile snippet as Bernhards
> > patch is already in the tree (I was working on a similar patch myself :-)
> >
> > diff --git a/util/Makefile b/util/Makefile
> > index a1a78ac..0ea59d4 100644
> > --- a/util/Makefile
> > +++ b/util/Makefile
> > @@ -5,8 +5,8 @@ $(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
> > $(LINK.o) $(CFLAGS) -o $@ $^
> >
> > $(BIN_TO_HEX): CC=$(BUILD_CC)
> > -$(BIN_TO_HEX): CFLAGS+=$(BUILD_CFLAGS)
> > -$(BIN_TO_HEX): LDFLAGS=
> > +$(BIN_TO_HEX): CFLAGS=$(BUILD_CFLAGS)
> > +$(BIN_TO_HEX): LDFLAGS=$(BUILD_LDFLAGS)
>
> Yes. I was just working on a patch that does that. :)
Sorry, the
$(BIN_TO_HEX): LDFLAGS=$(BUILD_LDFLAGS)
line is bogus. I was considering adding BUILD_LDFLAGS, but it
isn't really of any use since any flag can just be added
to BUILD_CFLAGS and have the same affect. So the line should
be unchanged as:
$(BIN_TO_HEX): LDFLAGS=
--
Horms
More information about the kexec
mailing list