Setting compilation parameter for qt within portfile

Nicolas Pavillon nicos at macports.org
Fri Dec 2 07:33:58 PST 2011


Hello, 

Thank you a lot for the answers. 

>> Usually you would set the optimization level using:
>> 
>> configure.optflags -O0

I can confirm that qmake ignores this option. In fact, I tried standard to set within the portfile (and thus through environement/configure args) cflags, cmake cflags and qt cflags, but none worked for what I tried. This is a quite inconvenient behaviour. 

>> Are you sure -O0 is necessary? That means all optimization will be disabled, which means the program will be slow.

I am not sure unfortunately, as I am rather blind for this problem. It occurs only on Lion, and being on SL, I am not in position to test it. It was however reported by several people that it does not build, and that setting -O0 solves the issue. To note that trying to force compilation with gcc instead of clang does not solve it. 

As it breaks the port, I would vote for taking this as a workaround, at least until another solution is found.

> Seems to me none of the flags get through. qmake spec files have their own logic and don't care to honour autotool style env vars. I'd speculate it's possible to create some qmake spec files which examine env vars, and patch port:qt4-mac accordingly.

Thanks a lot for the patch submitted in the ticket. I was hoping to avoid patching, but at least it does the trick. 

Cheers, 

Nicolas



More information about the macports-dev mailing list