add %ghc_set_cflags macro

This commit is contained in:
Jens Petersen 2017-12-04 21:24:21 +09:00
parent b838259f68
commit 32c4fa64af
1 changed files with 8 additions and 4 deletions

View File

@ -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