From 0ce39766e91c2bfc88e1fabaa7ccaf0530d2d270 Mon Sep 17 00:00:00 2001 From: Al Stone Date: Thu, 15 Mar 2018 10:41:33 -0600 Subject: [PATCH] Fix the %build section of the spec file to pass in proper CFLAGS The wrong assumptions were being made about what generate/unix/Makefile.config would do with passed in values of OPT_CFLAGS, causing CWARNINGFLAGS to be ignore in that makefile. For packaging purposes, OPT_CFLAGS needs to be used to pass in distro required values; we needed to add to that all of the CWARNINGFLAGS so that we do not have to rewrite or significantly patch large portions of the original makefile. Signed-off-by: Al Stone --- acpica-tools.spec | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/acpica-tools.spec b/acpica-tools.spec index 46a6953..0930308 100644 --- a/acpica-tools.spec +++ b/acpica-tools.spec @@ -128,7 +128,43 @@ chmod a-x source/compiler/new_table.txt %build -make OPT_CFLAGS="%{optflags}" OPT_LDFLAGS="%{__global_ldflags}" +CWARNINGFLAGS="\ + -std=c99\ + -Wall\ + -Wbad-function-cast\ + -Wdeclaration-after-statement\ + -Werror\ + -Wformat=2\ + -Wmissing-declarations\ + -Wmissing-prototypes\ + -Wstrict-aliasing=0\ + -Wstrict-prototypes\ + -Wswitch-default\ + -Wpointer-arith\ + -Wundef\ + -Waddress\ + -Waggregate-return\ + -Winit-self\ + -Winline\ + -Wmissing-declarations\ + -Wmissing-field-initializers\ + -Wnested-externs\ + -Wold-style-definition\ + -Wno-format-nonliteral\ + -Wredundant-decls\ + -Wempty-body\ + -Woverride-init\ + -Wlogical-op\ + -Wmissing-parameter-type\ + -Wold-style-declaration\ + -Wtype-limits" + +OPT_CFLAGS="%{optflags} $CWARNINGFLAGS" +OPT_LDLAGS="%{__global_ldflags}" +export OPT_CFLAGS +export OPT_LDFLAGS + +make %install @@ -213,6 +249,10 @@ fi - Add in option -th that allows one to better name generated hex files, and clean up the header files generated (applied github patch) - Added gcc to BuildRequires +- It turns out the %%build section was incorrectly passing in OPT_CFLAGS; it + made the wrong assumptions about what generate/unix/Makefile.config did with + that value. Added to the spec file what should happen so that a full and + complete set of C flags get passed in, not just the small subset that was. * Fri Feb 09 2018 Igor Gnatenko - 20180105-3 - Escape macros in %%changelog