At 11:58 22/12/98 -0500, Fred L. Drake wrote:
John Skaller writes:
This depends on knowing where the makefile and
the config file are. Which suggest a further factorisation:
Ok, I've modified distutils.sysconfig to contain:
get_config_h_filename() get_makefile_filename() parse_config_h(fileobject, g=None) parse_makefile(fileobject, g=None)
Note that the parse_*() routines take a file object instead of a filename,
Ah, that seems even better, yes!
and the dictionary to update may be passed in. If no dictionary is provided a new one is used. However the dict is obtained, it is returned by the function.
Right. Seems OK.
Equivalents for non-Unix platforms are still needed; has anyone thought about Windows or Mac platforms?
I don't think we (necessarily) need equivalents for the following reason: the sysconfig data isn't meant for user access: its there to support implementation of functions like 'compile_this_c_as_a_module'.
It is these functions which need to be standardised (that is, cross platform). For the VC++ windows build, sysconfig could be omitted entirely, and a hand written 'compile' function provided. For Unix, it is convenient to parameterise such a function with the config data -- for that is the way the autoconf/ make/blah blah process works.
none of this implies there shouldn't be an equivalent; but I think the important interfaces is the 'OO' one: <grin> the one characterized by function semantics rather than values of data attributes.
I passed on this for now. I think the cross-platform issues need to be explored more.
I agree. I would like people to explore the interface of my compilers module to see if it is _possible_ for that interface to work on all platforms. It may be that the Unix implementation uses sysconfig data to adapt to various Unix platforms, whereas the Mac or Windows version is hard coded, or uses a different scheme. ------------------------------------------------------- John Skaller email: firstname.lastname@example.org http://www.maxtal.com.au/%7Eskaller phone: 61-2-96600850 snail: 10/1 Toxteth Rd, Glebe NSW 2037, Australia
John Skaller writes:
I don't think we (necessarily) need equivalents
for the following reason: the sysconfig data isn't meant for user access: its there to support implementation of functions like 'compile_this_c_as_a_module'.
I was thinking that it needed to be there for use by the "compile..." stuff, but if it's not needed, then importing sysconfig shouldn't break things. (With the last patch, it would raise a NameError when os.name wasn't "posix".) People that know the other platforms better will have to determine if sysconfig-style data is useful. If it is, please provide an _init_<os.name>() function that does the right thing. I do expect the specific names that are defined to be specific to the platform; there's no need to provide the same names.
-- Fred L. Drake, Jr. email@example.com Corporation for National Research Initiatives 1895 Preston White Dr. Reston, VA 20191