On Thursday 2013-05-30 17:31, Cristian Morales Vega wrote:
I am trying to compile in openSUSE 12.3 a program which uses "waf" to build. It fails to detect Python.h because the test program is compiled with -O0 and -D_FORTIFY_SOURCE=2, and you can't use both at the same time.
The FORTIFY_SOURCE part comes from waf using: "get_config_var('CFLAGS')". And from what I can see that gets the CFLAGS used to build python itself from %{_libdir}/python2.7/config/Makefile, from the python-base package.
Now, I don't know the first thing about the "Python way". So, can somebody answer:
- There is really some use for Python defining this CFLAGS "config_var"? - It's normal for the build systems to try to retrieve get_config_var('CFLAGS')? Why?
Downstream programs usually only need CPPFLAGS containing the -I arguments to get to the header files. Sometimes they also include -D args, but that reeks of "gee, could you not have put that into some config.h". C(XX)FLAGS is then for things like -pthread which may at times be wanted. Now, some build scripts that have not received enough love to distinguish between CPPFLAGS and CFLAGS, so the -Is and -Ds may be found in some CFLAGS instead. In any case, CFLAGS on how the library was built is seldom useful; what is needed are CFLAGS for library _users_. And if those contain -f, -g and -O is just screwing around with users. Like `mysql-config --cflags` (but at least, mysql has --include as alternative) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org