From: Georg Brandl Date: Sat, 31 Mar 2007 18:58:21 +0000 (+0000) Subject: Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS X-Git-Tag: v2.5.1c1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48642d4a0a168c8ae0f0e455afc20738cc26cea8;p=thirdparty%2FPython%2Fcpython.git Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS returned by python-config if Python was built with --enable-shared because that prevented the shared library from being used. (backport from rev. 54634) --- diff --git a/Misc/NEWS b/Misc/NEWS index 77aa41485ace..da35e7109032 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -426,6 +426,10 @@ Tests Build ----- +- Bug #1655392: don't add -L/usr/lib/pythonX.Y/config to the LDFLAGS + returned by python-config if Python was built with --enable-shared + because that prevented the shared library from being used. + - Patch #1569798: fix a bug in distutils when building Python from a directory within sys.exec_prefix. diff --git a/Misc/python-config.in b/Misc/python-config.in index e0215a269587..9ac44146d4da 100644 --- a/Misc/python-config.in +++ b/Misc/python-config.in @@ -45,7 +45,9 @@ elif opt in ('--includes', '--cflags'): elif opt in ('--libs', '--ldflags'): libs = getvar('LIBS').split() + getvar('SYSLIBS').split() libs.append('-lpython'+pyver) - if opt == '--ldflags': + # add the prefix/lib/pythonX.Y/config dir, but only if there is no + # shared library in prefix/lib/. + if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'): libs.insert(0, '-L' + getvar('LIBPL')) print ' '.join(libs)