[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: make qmake honour $RPM_OPT_FLAGS

Till Maas <opensource <at> till.name> writes:
> when one wants to make sure that a package, that uses qmake(-qt4) to build 
> Makefile, honours $RPM_OPT_FLAGS, waht is the best method?
> Is e.g. the following good? (It's in example for vym):
> qmake-qt4 INSTALLDIR=%{buildroot}%{_prefix} \
> QMAKE_CFLAGS="%{optflags}" \
> QMAKE_CXXFLAGS="%{optflags}" \
> QMAKE_LFLAGS="%{optflags}"

IMHO the .pro file should be fixed to take CXXFLAGS from the environment (and 
use sane defaults if the environment defines nothing), e.g. like this:

isEmpty(CXXFLAGS) {
isEmpty(CXXFLAGS) {
  debug {
    CXXFLAGS = -Os -g
  } else {
    CXXFLAGS = -Os -s -fomit-frame-pointer

(This example, taken from a real program, also shows how to add mandatory flags 
after the ones from the environment.) Then all you have to do is set CXXFLAGS 
like with autotools-based programs.

        Kevin Kofler

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]