[apparmor] [patch] Have the parser makefile honor CFLAGS environment variable

Steve Beattie steve at nxnw.org
Sat Oct 9 02:33:56 BST 2010


This patch makes the parser's makefile honor CFLAGS that have been
exported in the environment. Without it, merely setting the CFLAGS
environment variable would not affect the compilation of the parser,
though it was still possible to override it by passing the variable as
an argument (e.g. make all CFLAGS="-Oinsane -Wextra-special").

It also makes the default CFLAGS for the parser consistent with
the default for the C++ dfa library, and passes the flags on to
the library.

An audit of the other bits of C showed that they either supported
CFLAGS during configure or were otherwise honoring CFLAGS when set
as environment variable.

I'm also nominating this patch for 2.5.2.
---
 parser/Makefile |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: b/parser/Makefile
===================================================================
--- a/parser/Makefile
+++ b/parser/Makefile
@@ -45,11 +45,14 @@ WARNINGS += $(shell for warning in ${EXT
 				echo "$${warning}"; \
 			fi ; \
 		done)
-CFLAGS	= -O2 -pipe
+ifndef CFLAGS
+CFLAGS	= -g -O2 -pipe
 
 ifdef DEBUG
 CFLAGS = -g
 endif
+endif #CFLAGS
+
 EXTRA_CFLAGS = ${CFLAGS} ${WARNINGS} -D_GNU_SOURCE
 
 #LEXLIB	:= -lfl
@@ -232,7 +235,7 @@ check: tests
 .SILENT: $(AAREOBJECTS)
 .PHONY: $(AAREOBJECTS)
 $(AAREOBJECTS):
-	make -C $(AAREDIR)
+	make -C $(AAREDIR) CFLAGS="$(CFLAGS)"
 
 .PHONY: install-rhel4
 install-rhel4: install-redhat

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/apparmor/attachments/20101008/2d61a23a/attachment.pgp 


More information about the AppArmor mailing list