@@ -743,6 +743,10 @@ def detect_modules(self):
743
743
missing .extend (['imageop' ])
744
744
745
745
# readline
746
+ # Pyston change: in some container system, the dependencies are provided by
747
+ # LIBRARY_PATH env variable
748
+ lib_dirs += os .getenv ('LIBRARY_PATH' , '' ).split (os .pathsep )
749
+
746
750
do_readline = self .compiler .find_library_file (lib_dirs , 'readline' )
747
751
readline_termcap_library = ""
748
752
curses_library = ""
@@ -1402,13 +1406,16 @@ class db_found(Exception): pass
1402
1406
# provided by the ncurses library.
1403
1407
panel_library = 'panel'
1404
1408
curses_incs = None
1409
+ # Pyston change: in some container system. The headfile are provided
1410
+ # by CPATH env variable
1411
+ inc_dirs += os .getenv ('CPATH' , '' ).split (os .pathsep )
1405
1412
if curses_library .startswith ('ncurses' ):
1406
1413
if curses_library == 'ncursesw' :
1407
1414
# Bug 1464056: If _curses.so links with ncursesw,
1408
1415
# _curses_panel.so must link with panelw.
1409
1416
panel_library = 'panelw'
1410
1417
curses_libs = [curses_library ]
1411
- curses_incs = find_file ('curses.h' , inc_dirs ,
1418
+ curses_incs = find_file ('curses.h' , [] ,
1412
1419
[os .path .join (d , 'ncursesw' ) for d in inc_dirs ])
1413
1420
exts .append ( Extension ('_curses' ,
1414
1421
sources = map (relpath ,
@@ -2075,8 +2082,9 @@ def configure_ctypes(self, ext):
2075
2082
2076
2083
srcdir = sysconfig .get_config_var ('srcdir' )
2077
2084
ffi_builddir = os .path .join (self .build_temp , 'libffi' )
2078
- ffi_srcdir = os .path .abspath (os .path .join (srcdir , 'Modules' ,
2079
- '_ctypes' , 'libffi' ))
2085
+ ffi_srcdir = os .path .abspath (os .path .join (srcdir , relpath ("../../from_cpython/Modules/_ctypes/libffi" )))
2086
+ # ffi_srcdir = os.path.abspath(os.path.join(srcdir, 'Modules',
2087
+ # '_ctypes', 'libffi'))
2080
2088
ffi_configfile = os .path .join (ffi_builddir , 'fficonfig.py' )
2081
2089
2082
2090
from distutils .dep_util import newer_group
@@ -2088,8 +2096,10 @@ def configure_ctypes(self, ext):
2088
2096
ffi_configfile ):
2089
2097
from distutils .dir_util import mkpath
2090
2098
mkpath (ffi_builddir )
2091
- config_args = [arg for arg in sysconfig .get_config_var ("CONFIG_ARGS" ).split ()
2092
- if (('--host=' in arg ) or ('--build=' in arg ))]
2099
+ # Pyston change: we don't support config var yet
2100
+ # config_args = [arg for arg in sysconfig.get_config_var("CONFIG_ARGS").split()
2101
+ # if (('--host=' in arg) or ('--build=' in arg))]
2102
+ config_args = []
2093
2103
if not self .verbose :
2094
2104
config_args .append ("-q" )
2095
2105
@@ -2176,12 +2186,9 @@ def detect_ctypes(self, inc_dirs, lib_dirs):
2176
2186
# in /usr/include/ffi
2177
2187
inc_dirs .append ('/usr/include/ffi' )
2178
2188
2179
- # Pyston change: still hard code the ffi include dir
2180
- # because we don't support this variable configuration in get_config_var yet
2181
- ffi_inc = ['/usr/include/x86_64-linux-gnu' ]
2182
- # ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
2183
- if not ffi_inc or ffi_inc [0 ] == '' :
2184
- ffi_inc = find_file ('ffi.h' , [], inc_dirs )
2189
+ ffi_inc = [sysconfig .get_config_var ("LIBFFI_INCLUDEDIR" )]
2190
+ if not ffi_inc [0 ] or ffi_inc [0 ] == '' :
2191
+ ffi_inc = find_file ('ffi.h' , inc_dirs , inc_dirs )
2185
2192
if ffi_inc is not None :
2186
2193
ffi_h = ffi_inc [0 ] + '/ffi.h'
2187
2194
fp = open (ffi_h )
0 commit comments