32 lines
1.2 KiB
Text
32 lines
1.2 KiB
Text
# pythonx.y-config --ldflags out of /usr and missing -L<install_lib_dir>
|
|
# https://bugs.python.org/issue7352
|
|
|
|
# Fix library order returned by python-config. [#18096]
|
|
# bugs.python.org/18096
|
|
|
|
--- Misc/python-config.in.orig 2015-10-18 09:00:25 UTC
|
|
+++ Misc/python-config.in
|
|
@@ -22,6 +22,7 @@ except getopt.error:
|
|
if not opts:
|
|
exit_with_usage()
|
|
|
|
+libdir = sysconfig.get_config_var('exec_prefix') + '/lib'
|
|
pyver = sysconfig.get_config_var('VERSION')
|
|
getvar = sysconfig.get_config_var
|
|
|
|
@@ -45,11 +46,13 @@ for opt in opt_flags:
|
|
print(' '.join(flags))
|
|
|
|
elif opt in ('--libs', '--ldflags'):
|
|
- libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
|
|
- libs.append('-lpython' + pyver + sys.abiflags)
|
|
+ libs = ['-lpython' + pyver + sys.abiflags]
|
|
+ libs += getvar('LIBS').split()
|
|
+ libs += getvar('SYSLIBS').split()
|
|
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
|
|
# shared library in prefix/lib/.
|
|
if opt == '--ldflags':
|
|
+ libs.insert(0, '-L' + libdir)
|
|
if not getvar('Py_ENABLE_SHARED'):
|
|
libs.insert(0, '-L' + getvar('LIBPL'))
|
|
if not getvar('PYTHONFRAMEWORK'):
|