bpo-44182: Add -L<libdir> to python-config.in to match python-config.sh.in

This commit is contained in:
Isuru Fernando 2021-10-04 12:41:00 -07:00
parent 07cf10bafc
commit 2bb96db1d2

View file

@ -57,9 +57,12 @@ for opt in opt_flags:
libs.append(libpython)
libs.extend(getvar('LIBS').split() + 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':
libdir = getvar('LIBDIR')
if libdir:
libs.insert(0, '-L' + libdir)
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
print(' '.join(libs))