Index: Python-2.6.6/setup.py =================================================================== --- Python-2.6.6.orig/setup.py +++ Python-2.6.6/setup.py @@ -356,8 +356,8 @@ class PyBuildExt(build_ext): def detect_modules(self): # Ensure that /usr/local is always used - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # Add paths specified in the environment variables LDFLAGS and # CPPFLAGS for header and library files. @@ -393,10 +393,10 @@ class PyBuildExt(build_ext): for directory in reversed(options.dirs): add_dir_to_list(dir_list, directory) - if os.path.normpath(sys.prefix) != '/usr': - add_dir_to_list(self.compiler.library_dirs, + + add_dir_to_list(self.compiler.library_dirs, sysconfig.get_config_var("LIBDIR")) - add_dir_to_list(self.compiler.include_dirs, + add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) try: @@ -407,11 +407,8 @@ class PyBuildExt(build_ext): # 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 + [ - '/lib64', '/usr/lib64', - '/lib', '/usr/lib', - ] - inc_dirs = self.compiler.include_dirs + ['/usr/include'] + lib_dirs = self.compiler.library_dirs + inc_dirs = self.compiler.include_dirs exts = [] missing = [] @@ -661,8 +658,7 @@ class PyBuildExt(build_ext): pass # Issue 7384: Already linked against curses or tinfo. elif curses_library: readline_libs.append(curses_library) - elif self.compiler.find_library_file(lib_dirs + - ['/usr/lib/termcap'], + elif self.compiler.find_library_file(lib_dirs, 'termcap'): readline_libs.append('termcap') exts.append( Extension('readline', ['readline.c'],