Mailinglist Archive: opensuse-packaging (183 mails)

< Previous Next >
Re: [opensuse-packaging] qmake and CFLAGS
  • From: Cristian Morales Vega <cmorve69@xxxxxxxx>
  • Date: Sun, 7 Jun 2009 14:29:39 +0200
  • Message-id: <8235e6f40906070529k62e7bd2s19597cb4878fa277@xxxxxxxxxxxxxx>
2009/6/7 Suman Manjunath <manjunath.suman@xxxxxxxxx>:
On Thu, Jun 4, 2009 at 01:49, Cristian Morales Vega<cmorve69@xxxxxxxx> wrote:
I have a program that compiles with just qmake && make.
Since here there is no macro that can set the CFLAGS one would suppose
that the "-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2
-fstack-protector -funwind-tables -fasynchronous-unwind-tables" CFLAGS
would not be used. Somehow qmake adds them (openSUSE patch?), but I
have no idea about how that works.

OK.. So what is the problem? Does adding the CFLAGS break your package?

No, I was just asking myself why qmake was adding those CFLAGS.

And it seems to add a -g even if
you aren't creating debug packages.

You can avoid debug packages by using


in your spec-file IIRC.

But the packages would still be compiled with with debug information.
The only difference is that this debug info would not end splitted in
a different package.

So, how these packages should be created? Should I rely in qmake
magic? There are any QT specific macros that I should use?

There is no magic. If your packages fail because the CFLAGS (they are
actually the RPM_OPT_FLAGS) gets added, then one way to skip them is
to use:

CFLAGS="" qmake

instead of

qmake <or whatever you are using right now>

Be advised that using the RPM_OPT_FLAGS is always the better option.

I tried
and that makes no difference.

The thing is that I though somebody patched qmake to add those CFLAGS,
and I didn't understood exactly why. I looked at the qt package and I
saw no patch to add the flags, so I suppose qmake, as in upstream,
creates Makefiles with the CFLAGS that where used to compile qmake
Then, since I suppose nobody from openSUSE added those flags expecting
the packager to use them I felt free to override them. Finally I used
make CXXFLAGS='%{optflags}'

...note that
CXXFLAGS='%{optflags}' make
neither will work.
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups