Re: make qmake honour $RPM_OPT_FLAGS

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

 



Till Maas <opensource <at> till.name> writes:
> when one wants to make sure that a package, that uses qmake(-qt4) to build 
its 
> 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) {
  CXXFLAGS = $$(CXXFLAGS)
}
isEmpty(CXXFLAGS) {
  debug {
    CXXFLAGS = -Os -g
  } else {
    CXXFLAGS = -Os -s -fomit-frame-pointer
  }
}
QMAKE_CXXFLAGS_DEBUG = $$CXXFLAGS -Wno-non-virtual-dtor $$PKGCONFIG_CFLAGS
QMAKE_CXXFLAGS_RELEASE = $$CXXFLAGS -Wno-non-virtual-dtor $$PKGCONFIG_CFLAGS

(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

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux