On May 18, 2006, at 9:36 AM, Ronald Oussoren wrote: > > On 18-mei-2006, at 16:11, William Kyngesburye wrote: > >> >> On May 18, 2006, at 2:14 AM, Ronald Oussoren wrote: >> >>> >>> On 18-mei-2006, at 5:29, William Kyngesburye wrote: >>> >>>> Is there some way to customize or override the build flags for >>>> building a Python extension (a C library wrapper)? >>>> >>>> My main problem is that it adds the -g debug flag, ballooning the >>>> size of the module. I want to build WITHOUT the -g flag. >>> >>> It is possible to add additonal flags, but that won't help you >>> because you want to remove an existing flag and that is not >>> possible. GCC also doesn't have a flag that negates the -g flag. >>> >>> If you want to remove the debugging information you can use the >>> strip command to remove this from the compiled extension. >>> >> I've had mostly bad luck with stripping libraries - it would >> sometimes create an unstable or broken library. I'd prefer not >> using -g in the first place. >> >> Is there maybe a python config file with the flags that distutils >> uses? I looked around a bit in the framework but didn't see >> anything. Or is that built into the python binary/library? > > The build flags are in /Library/Frameworks/Python.framework/ > Versions/Current/lib/python2.4/config/Makefile (BASECFLAGS and > LDFLAGS)
So, distutils loads the flags from that makefile? Didn't think of that. I'll give it a try tonight. thanks >> And I'm a frugal person and like things compact, with little >> bloat. One library I've built was a difference of 20MB with debug >> or 2MB optimized (and that's one of those where I had problems >> stripping it). An application (in constant development) was >> something like 150MB or 35MB. Add to that the doubling affect of >> universal builds now... >> > > Ouch, that is a very significant difference. yeah. Though this python extension isn't so bad - 3.5MB vs. 2MB (judging from the CGI and PHP versions of the library), universal. ----- William Kyngesburye <[EMAIL PROTECTED]> http://www.kyngchaos.com/ Theory of the Universe There is a theory which states that if ever anyone discovers exactly what the universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarrely inexplicable. There is another theory which states that this has already happened. -Hitchhiker's Guide to the Galaxy 2nd season intro _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig