set LDFLAGS conditional on arch, like CFLAGS

this should prevent gcc configure fails on s390x etc
This commit is contained in:
Jens Petersen 2018-09-03 16:29:09 +09:00
parent b979ca9d84
commit 11a0f144f5
1 changed files with 7 additions and 2 deletions

View File

@ -329,8 +329,13 @@ CFLAGS="${CFLAGS:-%optflags}"
%endif
export CFLAGS
%endif
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
# for ghc-8.2
%ifarch aarch64 s390x
LDFLAGS="${LDFLAGS:-$(echo %{?__global_ldflags} | sed -e 's!-specs=/usr/lib/rpm/redhat/redhat-hardened-ld!!')}"
%else
LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
%endif
export LDFLAGS
# for ghc >= 8.2
export CC=%{_bindir}/gcc
# * %%configure induces cross-build due to different target/host/build platform names
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \