[Distutils] Distutilizing wxPython

Greg Ward gward@python.net
Wed Oct 18 20:25:07 2000


On 16 October 2000, Rene Liebscher said:
> Not all compilers have resource compilers which support all these
> options.  There are even resource compilers which doesn't support all
> possible keywords in rc-files (cygwin's windres.) If you want other
> people let build your packages it would be nice to have a way to
> support a format which is compiler-independ.
> 
> The res-file which comes out of the resource compiler, has the same
> format for all compilers. So why doesn't support res-files as source
> files?  You only had to compile it on your machine and add it to your
> sources.  If anyone wants to build your package for himself, he
> doesn't rely on a special (resource) compiler, and you don't have to
> provide any options to the resource compiler. (If people want to
> change the rc-files then it is their problem to get it compiled, not
> yours.)

+1 from this interested bystander.  This seems to me like the moral
equivalent of including your yacc-generated .c file along with your .y
file: not strictly necessary, since "everyone has yacc", but of course
*not* everyone has yacc, and it's one more thing that can go wrong in
the build process.  (There's my Unix bias showing through again.)

For the record, I think it's a fool's errand to try to completely wrap
the capabilities of any particular compiler, be it a C/C++ compiler or a 
resource compiler or what.  The point of the CCompiler interface is to
expose the *common* functionality that *all or most* C compilers
provide.  If you want to take advantage of particular compilers, there
are (awkward) ways of doing so, but you have to skirt around the edges
of the standard interface.  This is by design!

Even including "resource files" in the list of things that can be
processed by a C compiler is a bit of a stretch, but I let it slip since 
Windows is a pretty important platform.  However, since there's more
than one compiler in the Windows world (whatever Chairman Bill's minions 
say ;-), we should not tie ourselves to one particular compiler.

Idea: should resource files be elevated to first-class status in the
CCompiler interface, ie. should we add a 'compile_resource_file()'
method?  This would be a clean place to expose the common functionality
of resource files without cluttering up the general 'compile()' method.
Downside: it would require the "build_ext" command to recognize certain
files as "resource files" and call this different method on them.
(Essential since we must now preserve backwards compatibility of setup
scripts at all costs!  Gone are the days of changing things
willy-nilly...)

        Greg
-- 
Greg Ward                                      gward@python.net
http://starship.python.net/~gward/