Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4f88028

Browse files
committed
Fixed LDSHARED for AIX, based on a patch by Rene Liebscher.
Ditched my old code that fixed relative paths in the Makefile -- didn't work, doomed to failure, etc.
1 parent b593793 commit 4f88028

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

Lib/distutils/sysconfig.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,6 @@ def parse_makefile(fp, g=None):
222222
# bogus variable reference; just drop it since we can't deal
223223
del notdone[name]
224224

225-
# "Fix" all pathnames in the Makefile that are explicitly relative,
226-
# ie. that start with "./". This is a kludge to fix the "./ld_so_aix"
227-
# problem, the nature of which is that Python's installed Makefile
228-
# refers to "./ld_so_aix", but when we are building extensions we are
229-
# far from the directory where Python's Makefile (and ld_so_aix, for
230-
# that matter) is installed. Unfortunately, there are several other
231-
# relative pathnames in the Makefile, and this fix doesn't fix them,
232-
# because the layout of Python's source tree -- which is what the
233-
# Makefile refers to -- is not fully preserved in the Python
234-
# installation. Grumble.
235-
from os.path import normpath, join, dirname
236-
for (name, value) in done.items():
237-
if value[0:2] == "./":
238-
done[name] = normpath(join(dirname(fp.name), value))
239-
240225
# save the results in the global dictionary
241226
g.update(done)
242227
return g
@@ -257,6 +242,18 @@ def _init_posix():
257242
raise DistutilsPlatformError, my_msg
258243

259244
parse_makefile(file, g)
245+
246+
# On AIX, there are wrong paths to the linker scripts in the Makefile
247+
# -- these paths are relative to the Python source, but when installed
248+
# the scripts are in another directory.
249+
if sys.platform: # == 'aix4': # what about AIX 3.x ?
250+
# Linker script is in the config directory, not in Modules as the
251+
# Makefile says.
252+
python_lib = get_python_lib(standard_lib=1)
253+
ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
254+
python_exp = os.path.join(python_lib, 'config', 'python.exp')
255+
256+
g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
260257

261258

262259
def _init_nt():

0 commit comments

Comments
 (0)