Parsing config files + passing options

Hello all! I've been playing around with Distutils-0.8.2 and just have a few questions. Before I start though, thanks for all your work on this so far, it is *very* nice and much needed! I just have two questions: 1. I'm working on writing a setup.py for an extension that uses gnome and glib libraries, and was curious if there was a general way anyone has already thought of to handle getting information from gnome-config and glib-config calls into a form that you can input into Distutils. For instance, if I do something like the following:
import commands gthread_cflags = commands.getoutput("glib-config --cflags gthread") print gthread_cflags -I/usr/local/include/glib12 -D_THREAD_SAFE
I can get the options you would pass. It would be useful to have something to process this like: def parse_cflag_config(configure_script, library) which would then return two lists, the include dirs and the macros. So they you could do something in your setup.py like: gthread_includes, gthread_macros = parse_cflag_config("glib-config", "gthread") Of course, this would only work on UNIX, but that is where the config calls are anyways :-) Is this something that would be generally useful to anyone? Does this approach seem like a good idea? Is there already a better plan in place to handle this? 2. Going along with this first problem, I was also wondering how to pass specific compiler flags. The issue I have is that on FreeBSD, there is a FreeBSD specific option for linking the thread libraries: '-pthread' (what this option does is link in libc_r and not libc, if anyone cares. I'm afraid I'm not smart enough to more about it than that :-). Anyways, is there a way to pass a flag like '-pthread'? Apologies if I missed it! Thanks much for listening and thanks again for the wonderful tool. Brad

On Thu, May 11, 2000 at 10:29:19AM -0400, Brad Chapman wrote:
2. Going along with this first problem, I was also wondering how to pass specific compiler flags. The issue I have is that on FreeBSD, there is a FreeBSD specific option for linking the thread libraries: '-pthread' (what this option does is link in libc_r and not libc, if anyone cares. I'm afraid I'm not smart enough to more about it than that :-).
If you look through recent bdist_rpm related messages, the last bdist_rpm patch contains a patch to build_ext.py that allows it to recognize the CFLAGS environment variable, and one of Greg's messages contains a way to specify compiler flags in setup.py . -- Harry Henry Gebel, Senior Developer, Landon House SBS West Dover Hundred, Delaware PyNcurses ncurses binding for Python http://pyncurses.sourceforge.ne
participants (2)
-
Brad Chapman
-
Harry Henry Gebel