[Distutils] How to find out the default include path

Michael Hudson mwh@python.net
Thu Oct 24 06:30:02 2002


"M.-A. Lemburg" <mal@lemburg.com> writes:

> Mats Wichmann wrote:
> > At 01:54 PM 10/23/2002 +0200, M.-A. Lemburg wrote:
> >  >M.-A. Lemburg wrote:
> >  >> Is there a way to find out the default include path
> >  >> used by a compiler ? Does distutils have an API for
> >  >> this ?
> >  >>
> >  >> I scanned the code but couldn't find any hint.
> >  >
> >  >So far I found these defaults:
> >  >
> >  >Linux:
> >  >    libs:    /lib, /usr/lib
> >  >    headers: /usr/include
> > 
> > Depends on what you mean by "default" :-)
> 
> What I'm working on is an automatic system for finding 3rd
> party libs to link against, e.g. say I have an extension
> which links against OpenSSL I want the setup.py to
> automatically find the .so and .h files.
> 
> It easy to simply look in a few directories, but I found
> that I have to be very careful about adding things like
> -I/usr/include to the compiler run, because on some systems
> this can bomb (the compiler picks up non-compiler compatible
> standard C header files, like e.g. stdarg.h).

I would have thought the autoconf approach of trial compilations is
the only reasonable way of doing this.

Cheers,
M.

-- 
  Sufficiently advanced political correctness is indistinguishable
  from irony.                                           -- Erik Naggum