[Python-bugs-list] [ python-Bugs-232609 ] 2.1a2 possible include/library mismatch in setup.py

noreply@sourceforge.net noreply@sourceforge.net
Sat, 17 Mar 2001 08:57:47 -0800


Bugs item #232609, was updated on 2001-02-15 13:34
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232609&group_id=5470

Category: Build
Group: None
>Status: Closed
Priority: 5
Submitted By: Mark Favas (mfavas)
Assigned to: A.M. Kuchling (akuchling)
Summary: 2.1a2 possible include/library mismatch in setup.py

Initial Comment:
The current CVS (Feb 16) version of 2.1a2 has in setup.py the following:

    def detect_modules(self):
        # Ensure that /usr/local is always used
        if '/usr/local/lib' not in self.compiler.library_dirs:
            self.compiler.library_dirs.append('/usr/local/lib')
        if '/usr/local/include' not in self.compiler.include_dirs:
            self.compiler.include_dirs.append( '/usr/local/include' )

        # lib_dirs and inc_dirs are used to search for files;
        # if a file is found in one of those directories, it can
        # be assumed that no additional -I,-L directives are needed.
        lib_dirs = self.compiler.library_dirs + ['/lib', '/usr/lib']
        inc_dirs = ['/usr/include'] + self.compiler.include_dirs

Naively, it seems to me that the lib_dirs line should read:
inc_dirs = self.compiler.include_dirs + ['/usr/include']
so that /usr/local is searched during the compile/link phases before the standard system locations. Otherwise, a module could "include" files from /usr/include and link against library files from /usr/local/lib if a an earlier version of some software package was bundled with the OS (and was in /usr/include, /usr/lib) and a later version had been installed in /usr/local/{include, lib}.

----------------------------------------------------------------------

>Comment By: A.M. Kuchling (akuchling)
Date: 2001-03-17 08:57

Message:
Logged In: YES 
user_id=11375

Good point.  I've checked in a change to setup.py which puts 
/usr/local at the front of the  lists, and leaves
/usr/include at the end.


----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-02-28 20:53

Message:
Logged In: YES 
user_id=3066

distutils migration issue....

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232609&group_id=5470