From 28274f8b3a78c9f8a15a9e1170e9e3f78746dbe5 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Oct 17 2016 02:37:21 +0000 Subject: only pass CFLAGS and LDFLAGS to ghc if set --- diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 064f01a..6c7d3c1 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -11,7 +11,7 @@ Name: ghc-rpm-macros Version: 1.6.9 -Release: 5%{?dist} +Release: 6%{?dist} Summary: RPM macros for building Haskell packages for GHC License: GPLv3+ @@ -137,6 +137,9 @@ EOF %changelog +* Mon Oct 17 2016 Jens Petersen - 1.6.9-6 +- only pass CFLAGS and LDFLAGS to ghc if set + * Mon Oct 17 2016 Jens Petersen - 1.6.9-5 - for aarch64 do not set CFLAGS and LDFLAGS diff --git a/macros.ghc b/macros.ghc index 156197b..4195a9a 100644 --- a/macros.ghc +++ b/macros.ghc @@ -27,7 +27,7 @@ fi CFLAGS="${CFLAGS:-%optflags}"; export CFLAGS\ LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"; export LDFLAGS\ %endif\ -%cabal configure %{?cabal_verbose} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_defaultlicensedir}/%{name} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --ghc-options="$(echo ' '$CFLAGS | sed -e 's/ / -optc/g') $(echo ' '$LDFLAGS | sed -e 's/ / -optl/g')" %{?cabal_configure_options} $cabal_configure_extra_options +%cabal configure %{?cabal_verbose} --prefix=%{_prefix} --libdir=%{_libdir} --docdir=%{_defaultlicensedir}/%{name} --libsubdir='$compiler/$pkgkey' --datasubdir='$pkgid' --ghc %{!?ghc_without_dynamic:--enable-executable-dynamic} %{?with_tests:--enable-tests} --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 # install %cabal_install %cabal copy %{?cabal_verbose} %{!?cabal_verbose:-v} --destdir=%{buildroot}