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.

Attachment: pgpb1WTkcDfaO.pgp
Description: PGP signature

_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to