From b7cbd7e5e1b11e552ceae3e4602d2b7f4be136fd Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Jul 25 2021 20:22:33 +0000 Subject: spec: Open code %set_build_flags There should be no functional difference here, but it's not obvious at a glance how qemu handles globally defined CFLAGS + LDFLAGS with --extra-cflags and --extra-ldflags. Reproduce the desired behavior with explicit configure options and RPM variables Signed-off-by: Cole Robinson --- diff --git a/qemu.spec b/qemu.spec index 8486308..9dcc0bd 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1275,11 +1275,9 @@ mkdir -p %{static_builddir} --with-git-submodules=ignore \\\ --without-default-devices -# Export CFLAGS, LDFLAGS, CC, CXX, etc. -%set_build_flags - run_configure() { ../configure \ + --cc=%{__cc} \ --cxx=/bin/false \ --prefix="%{_prefix}" \ --libdir="%{_libdir}" \ @@ -1289,8 +1287,8 @@ run_configure() { --localstatedir="%{_localstatedir}" \ --docdir="%{_docdir}" \ --libexecdir="%{_libexecdir}" \ - --extra-ldflags="$LDFLAGS" \ - --extra-cflags="$CFLAGS" \ + --extra-ldflags="%{build_ldflags}" \ + --extra-cflags="%{optflags}" \ --with-pkgversion="%{name}-%{version}-%{release}" \ --with-suffix="%{name}" \ --firmwarepath=%firmwaredirs \