Skip to content

Commit

Permalink
Merge pull request #90 from ajarzyn/bug/configuration
Browse files Browse the repository at this point in the history
Fix for incorrect configure python library variable
  • Loading branch information
grisha authored Apr 12, 2021
2 parents 88e4444 + 0e436f1 commit 83e9b96
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3232,8 +3232,21 @@ if test "${PYTHONFRAMEWORKDIR}" = "no-framework"; then
standard_lib=1) +"/config")'`
LDFLAGS="${LDFLAGS1} ${LDFLAGS2}"
LDLIBS1=`${PYTHON_BIN} -c 'import distutils.sysconfig;\
print(distutils.sysconfig.get_config_var("LDLIBRARY"))'`
PYTHON_CODE=$(cat <<END
import distutils.sysconfig
lookingFor = "-lpython"
ret = str(distutils.sysconfig.get_config_var("BLDLIBRARY"))
if lookingFor not in ret:
cfg = distutils.sysconfig.get_config_vars()
for key in cfg:
if isinstance(cfg[key], str) and lookingFor in cfg[key]:
ret = cfg[key]
break
print(ret[ret.find(lookingFor) if ret.find(lookingFor) != -1 else 0:])
END
)
LDLIBS1=`${PYTHON_BIN} -c "$PYTHON_CODE"`
LDLIBS2=`${PYTHON_BIN} -c 'from distutils import sysconfig; \
print(sysconfig.get_config_var("LIBS"))'`
Expand Down

0 comments on commit 83e9b96

Please sign in to comment.