Building Python - how to set include and lib paths?

Lack Mr G M gml4410 at ggr.co.uk
Wed Jul 9 11:05:53 CEST 2003


In article <2lcqt-p45.ln1 at newsgate.kjn.lan>, Theodor Rash <trash at kjn-law.de> writes:
|> Lack Mr G M wrote:
|> 
|> > ...  My problem occurs when I am *building* python
|> > itself.  There seem to be no way that I can tell it where to look for
|> > header files and libraries for other packages/utilities (eg: SSL) that I
|> > have previously installed or how to add these to compilation and linking
|> > options..  It hard-wires /usr/local/{include,lib} for these.
|> > 
|> That's right. I had to patch setup.py to make it find Tcl/Tk which resides
|> under /opt in my system.

   Well, I have a fudge for it...

   Whereas the configure stage does not allow you to specify where you
have things, and neither setup.py nor build.py seem to have any way of
changing things either, the even lower level build_ext.py script *does*
allow you to specify libdirs. incdirs and rpath info.  So, the low-level
ability is there (well, some of it is - read on) but no higher-level
ability to actualy use it :-(

   So, after running a standard make (where some things fail). I then
run a script which:

a) sets environment variables CC, LDSHARED and OPT to the values set in
   the Makefile. 

b) Run build_ext directly using

  ./python -E ./setup.py build_ext \
   --include-dirs=${_incdir} \
   --library-dirs=${_libdir} \
   --rpath=${_libdir}

where ${_incdir} and ${_libdir} are set to the :-separated lists I need.


   Mind you, this fails if your linker uses -rpath rather than -R.  Then
you also need to edit ccompiler.py and unixccompiler.py in Lib/distutils
to:

1) Make runtime_library_dir_option use -rpath as required.

2) Make runtime_library_dir_option return a list, rather than a string,
   since -rpath requires you to pass back 2 parameters (-R allows
   catenation as a string).

3) Make the call to runtime_library_dir_option be a loop, to handle the
   returned list.


   All very messy....




-- 
--------- Gordon Lack --------------- gml4410 at ggr.co.uk  ------------
This message *may* reflect my personal opinion.  It is *not* intended
to reflect those of my employer, or anyone else.




More information about the Python-list mailing list