python 2.3.3 why adding sys.prefix to include_dir, libdir?

Holger Joukl Holger.Joukl at
Thu Feb 19 12:21:49 CET 2004

Hi there,
2 questions regarding build/installation issues:

1. In the python 2.3.3 script, the detect_modules method of
class PyBuildExt contains the following code:

253         if os.path.normpath(sys.prefix) != '/usr':
254             add_dir_to_list(self.compiler.library_dirs,
255                             sysconfig.get_config_var("LIBDIR"))
256             add_dir_to_list(self.compiler.include_dirs,
257                             sysconfig.get_config_var("INCLUDEDIR"))

This basically just adds the PREFIX/lib and PREFIX/include to
and self.include_dirs, PREFIX being what I gave to configure as command
line argument, e.g.:
./configure --prefix=/opt/tools --with-cxx=gcc

I understand the --prefix=PREFIX sets the installation _target_ directory.
Does it make sense to have these paths in include_dirs/library_dirs? Why
would I want this?
In fact, as it turned out that I had some bogus header files in the PREFIX
directory, an
extension module would not compile.

2. As a lot of things do not live in the "standard" places in our
environment, there seem to be several
places where I have to change manually. E.g. adding runtime
library dirs for curses, gdbm etc.
Is there another way to achieve correct build, in terms of telling my
non-standard paths to configure
in the first place? Just to spare me from changing

Any comments are appreciated.
Best regards


Holger Joukl
Landesbank Baden-Württemberg
1651 Financial Markets Technologies
fon +49 (711) 124 - 7078
fax +49 (711) 124 - 3759

Der Inhalt dieser E-Mail ist vertraulich. Falls Sie nicht der angegebene
Empfänger sind oder falls diese E-Mail irrtümlich an Sie adressiert wurde,
verständigen Sie bitte den Absender sofort und löschen Sie die E-Mail
sodann. Das unerlaubte Kopieren sowie die unbefugte Übermittlung sind nicht
gestattet. Die Sicherheit von Übermittlungen per E-Mail kann nicht
garantiert werden. Falls Sie eine Bestätigung wünschen, fordern Sie bitte
den Inhalt der E-Mail als Hardcopy an.

The contents of this  e-mail are confidential. If you are not the named
addressee or if this transmission has been addressed to you in error,
please notify the sender immediately and then delete this e-mail.  Any
unauthorized copying and transmission is forbidden. E-Mail transmission
cannot be guaranteed to be secure. If verification is required, please
request a hard copy version.

More information about the Python-list mailing list