summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-07-15 22:08:22 +1000
committerSimon Horman <horms@verge.net.au>2008-07-16 16:16:45 +1000
commitee9c90d4d99108623176c9512689569a34e6a249 (patch)
treed42748c429aa7054d4522b7d0c4c030890867a98
parent16666069407ccd9ebf92b61574f2e6e610abf8a1 (diff)
Allow BUILD_CFLAGS and TARGET_CFLAGS to be specified at configure time
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@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--configure.ac9
-rw-r--r--util/Makefile2
2 files changed, 8 insertions, 3 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" ])
diff --git a/util/Makefile b/util/Makefile
index a1a78ac..948ee63 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -5,7 +5,7 @@ $(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): CFLAGS=$(BUILD_CFLAGS)
$(BIN_TO_HEX): LDFLAGS=
dist += util/Makefile util/bin-to-hex.c