Florian Weimer writes:
After installing redhat-rpm-config, this works in bash and similar
shells:
$ eval `rpm --eval %set_build_flags`
Maybe we can make it more clear in buildflags.md that this macro is a
shell script fragment?
I find it more convenient to generate parameters for an autoconf-generated
configure script. I do not need to always use the same build flags as rpm.
Sometimes you want to build without optimizations, for debugging purposes.
What I do is
./configure `rpmflags`
with "rpmflags" being this script:
#! /bin/bash
echo -n "CXXFLAGS='"
rpm -E '%build_cxxflags' | tr -d '\012'
echo -n "' CFLAGS='"
rpm -E '%build_cflags' | sed 's/ *$//' | tr -d '\012'
echo -n "' LDFLAGS='"
rpm -E '%build_ldflags' | sed 's/ *$//' | tr -d '\012'
echo "'"
I suppose I can turn this inside-out, and change this to use
%set_build_flags and directly run configure.