[Distutils] Compiler abstractiom model

Andrew Dalke dalke@bioreason.com
Mon, 29 Mar 1999 21:45:42 -0800


Hey Greg,

  I can see some problems with this compilation model even
for unix machines:

C++ template instantiation
  For at least some compilers, the compilation flags must be
passed to the linker, because the linker instantiates templated
code during a "pre-link" step so needs to know the right
compilation options.

compiler flags
  Where do I stick "-g" or "-O" in the "compile" function?
(Or "-ansi", or for our SGIs, "-o32" ?)  Or will you extract
these from the Python compilation info?  In which case,
getting the values for a CPPCompiler would be tricky.

include directories
  As clarification, the "add_include_dir" is for the list of
directories used for *all* compilations while the compile(...
include_dirs=dirs) is the list needed for just the given source
file?
  I take it the compile() include dirs will be listed first,
or is it used instead?
  Is there any way to get the list of include files (eg, the
initial/default list)?


lib information
  Repeat some of the comments from "include directories"
  
> passing shared_object='foo' to 'link_shared_object()' would result
> in an output file 'foo.so'

  As I recall, not all unix-y machines have .so for their shared
library extensions.  Eg, looking at the Python "makesetup" script,
it seems some machines use ".sl".  I don't think Python exports
this information.

  I believe at times the order of the -l and -L terms can be
important, but I'm not sure.  Eg, I think the following

  -L/home/usa/lib -lfootball -L/home/everyone_else/lib -lfootball

lets me do both (American) football -- as in Superbowl -- and
soccer (football) -- as in World Cup.  Whereas

  -L/home/usa/lib -L/home/everyone_else/lib -lfootball -lfootball

means I link with the same library twice.

I think.

						Andrew
						dalke@bioreason.com