From 32c4fa64af5ca4f8b180203f8fe6ad4d71e09c23 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Mon, 4 Dec 2017 21:24:21 +0900 Subject: [PATCH] add %ghc_set_cflags macro --- macros.ghc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/macros.ghc b/macros.ghc index 874db17..b86a469 100644 --- a/macros.ghc +++ b/macros.ghc @@ -22,10 +22,7 @@ proceeding, to avoid dependency ABI breakage from a future ghc rebuild."\ %endif\ fi -# configure -%cabal_configure\ -%ghc_check_bootstrap\ -%global _hardened_ldflags %{nil}\ +%ghc_set_cflags\ # -Wunused-label is extremely noisy\ %ifarch aarch64 s390x\ CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall -Werror=format-security //')}"\ @@ -33,6 +30,13 @@ CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall -Werror=format-security //' CFLAGS="${CFLAGS:-%optflags}"\ %endif\ export CFLAGS\ +%{nil} + +# configure +%cabal_configure\ +%ghc_check_bootstrap\ +%ghc_set_cflags\ +%global _hardened_ldflags %{nil}\ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\ %cabal --version\ %cabal configure --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_ghcdocdir} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} %{?ghc_subpackaging:--user}%{!?ghc_subpackaging:--global} --ghc-options="${CFLAGS:+$(echo ' '$CFLAGS | sed -e 's/ / -optc/g')} ${LDFLAGS:+$(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')}" %{?cabal_configure_options} $cabal_configure_extra_options