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

Skip to content

Commit 66e966f

Browse files
committed
Rene Liebscher: hack '_init_posix()' to handle the BeOS linker script.
(With a worry-wart comment added by me about where we *should* add the Python library to the link.)
1 parent b3b6d39 commit 66e966f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lib/distutils/sysconfig.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,23 @@ def _init_posix():
255255

256256
g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
257257

258+
if sys.platform == 'beos':
259+
260+
# Linker script is in the config directory. In the Makefile it is
261+
# relative to the srcdir, which after installation no longer makes
262+
# sense.
263+
python_lib = get_python_lib(standard_lib=1)
264+
linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0])
265+
linkerscript = os.path.join(python_lib, 'config', linkerscript_name)
266+
267+
# XXX this isn't the right place to do this: adding the Python
268+
# library to the link, if needed, should be in the "build_ext"
269+
# command. (It's also needed for non-MS compilers on Windows, and
270+
# it's taken care of for them by the 'build_ext.get_libraries()'
271+
# method.)
272+
g['LDSHARED'] = ("%s -L%s/lib -lpython%s" %
273+
(linkerscript, sys.prefix, sys.version[0:3]))
274+
258275

259276
def _init_nt():
260277
"""Initialize the module as appropriate for NT"""

0 commit comments

Comments
 (0)