Kaydet (Commit) f4e7a35d authored tarafından Stefan Krah's avatar Stefan Krah

Issue #7384: On Gentoo, libreadline.so is a "fake library", so ldd fails.

In that case, do not attempt to parse stderr output.
üst 45bf773f
......@@ -534,18 +534,19 @@ class PyBuildExt(build_ext):
tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
os.system("ldd %s > %s" % (do_readline, tmpfile))
fp = open(tmpfile)
for ln in fp:
if 'curses' in ln:
readline_termcap_library = re.sub(
r'.*lib(n?cursesw?)\.so.*', r'\1', ln
).rstrip()
break
if 'tinfo' in ln: # termcap interface split out from ncurses
readline_termcap_library = 'tinfo'
break
fp.close()
ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
if ret >> 8 == 0:
fp = open(tmpfile)
for ln in fp:
if 'curses' in ln:
readline_termcap_library = re.sub(
r'.*lib(n?cursesw?)\.so.*', r'\1', ln
).rstrip()
break
if 'tinfo' in ln: # termcap interface split out from ncurses
readline_termcap_library = 'tinfo'
break
fp.close()
os.unlink(tmpfile)
# Issue 7384: If readline is already linked against curses,
# use the same library for the readline and curses modules.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment