[Asterisk-code-review] BuildSystem: User CFLAGS should always have the last say. (asterisk[19])

Alexander Traud asteriskteam at digium.com
Mon Aug 16 10:58:56 CDT 2021


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/16285 )


Change subject: BuildSystem: User CFLAGS should always have the last say.
......................................................................

BuildSystem: User CFLAGS should always have the last say.

ASTERISK-29583

Change-Id: I7ffbcebb76de88426438565154ac6d09dd1b9221
---
M Makefile
M Makefile.rules
2 files changed, 6 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/85/16285/1

diff --git a/Makefile b/Makefile
index a2e52f1..4bc1069 100644
--- a/Makefile
+++ b/Makefile
@@ -112,7 +112,7 @@
 
 # start the primary CFLAGS and LDFLAGS with any that were provided
 # to the configure script
-_ASTCFLAGS:=$(CONFIG_CFLAGS) $(CONFIG_SIGNED_CHAR)
+_ASTCFLAGS:=$(CONFIG_SIGNED_CHAR)
 _ASTLDFLAGS:=$(CONFIG_LDFLAGS)
 
 # Some build systems, such as the one in openwrt, like to pass custom target
diff --git a/Makefile.rules b/Makefile.rules
index 934e44a..63ebdb9 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -95,19 +95,16 @@
     _ASTCFLAGS_COVERAGE=
 endif
 
-ifeq ($(findstring $(CONFIG_CFLAGS),$(_ASTCFLAGS)),)
-    _ASTCFLAGS+=$(CONFIG_CFLAGS)
-endif
-
 # shortcuts for common combinations of flags; these must be recursively expanded so that
 # per-target settings will be applied
-CC_CFLAGS=$(PTHREAD_CFLAGS) $(_ASTCFLAGS) $(ASTCFLAGS)
-CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(_ASTCFLAGS) $(ASTCFLAGS))
-
+CC_CFLAGS=$(PTHREAD_CFLAGS) $(_ASTCFLAGS)
 # Clang -Werror warning suppressions
 ifeq ($(C_COMPILER_FAMILY),clang)
-	CC_CFLAGS+=-Wno-unused-value -Wno-parentheses-equality
+	CC_CFLAGS+=-Wno-unused-value -Wparentheses-equality
 endif
+CC_CFLAGS+=$(CONFIG_CFLAGS) $(ASTCFLAGS)
+
+CXX_CFLAGS=$(PTHREAD_CFLAGS) $(filter-out -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(AST_DECLARATION_AFTER_STATEMENT),$(_ASTCFLAGS) $(ASTCFLAGS))
 
 ifeq ($(GNU_LD),1)
 SO_SUPPRESS_SYMBOLS=-Wl,--version-script,$(subst .so,.exports,$@),--warn-common

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16285
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 19
Gerrit-Change-Id: I7ffbcebb76de88426438565154ac6d09dd1b9221
Gerrit-Change-Number: 16285
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210816/e9087208/attachment.html>


More information about the asterisk-code-review mailing list