Final patch for issue 9807.
This commit is contained in:
parent
fdba067213
commit
14d98ac31b
|
@ -48,7 +48,7 @@ INSTALL_SCHEMES = {
|
||||||
'unix_prefix': {
|
'unix_prefix': {
|
||||||
'purelib': '$base/lib/python$py_version_short/site-packages',
|
'purelib': '$base/lib/python$py_version_short/site-packages',
|
||||||
'platlib': '$platbase/lib/python$py_version_short/site-packages',
|
'platlib': '$platbase/lib/python$py_version_short/site-packages',
|
||||||
'headers': '$base/include/python$py_version_short/$dist_name',
|
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
|
||||||
'scripts': '$base/bin',
|
'scripts': '$base/bin',
|
||||||
'data' : '$base',
|
'data' : '$base',
|
||||||
},
|
},
|
||||||
|
@ -82,7 +82,8 @@ if HAS_USER_SITE:
|
||||||
INSTALL_SCHEMES['unix_user'] = {
|
INSTALL_SCHEMES['unix_user'] = {
|
||||||
'purelib': '$usersite',
|
'purelib': '$usersite',
|
||||||
'platlib': '$usersite',
|
'platlib': '$usersite',
|
||||||
'headers': '$userbase/include/python$py_version_short/$dist_name',
|
'headers':
|
||||||
|
'$userbase/include/python$py_version_short$abiflags/$dist_name',
|
||||||
'scripts': '$userbase/bin',
|
'scripts': '$userbase/bin',
|
||||||
'data' : '$userbase',
|
'data' : '$userbase',
|
||||||
}
|
}
|
||||||
|
@ -322,6 +323,7 @@ class install(Command):
|
||||||
'prefix': prefix,
|
'prefix': prefix,
|
||||||
'sys_exec_prefix': exec_prefix,
|
'sys_exec_prefix': exec_prefix,
|
||||||
'exec_prefix': exec_prefix,
|
'exec_prefix': exec_prefix,
|
||||||
|
'abiflags': sys.abiflags,
|
||||||
}
|
}
|
||||||
|
|
||||||
if HAS_USER_SITE:
|
if HAS_USER_SITE:
|
||||||
|
|
|
@ -11,7 +11,6 @@ Email: <fdrake@acm.org>
|
||||||
|
|
||||||
__revision__ = "$Id$"
|
__revision__ = "$Id$"
|
||||||
|
|
||||||
import io
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -49,6 +48,18 @@ def _python_build():
|
||||||
return False
|
return False
|
||||||
python_build = _python_build()
|
python_build = _python_build()
|
||||||
|
|
||||||
|
# Calculate the build qualifier flags if they are defined. Adding the flags
|
||||||
|
# to the include and lib directories only makes sense for an installation, not
|
||||||
|
# an in-source build.
|
||||||
|
build_flags = ''
|
||||||
|
try:
|
||||||
|
if not python_build:
|
||||||
|
build_flags = sys.abiflags
|
||||||
|
except AttributeError:
|
||||||
|
# It's not a configure-based build, so the sys module doesn't have
|
||||||
|
# this attribute, which is fine.
|
||||||
|
pass
|
||||||
|
|
||||||
def get_python_version():
|
def get_python_version():
|
||||||
"""Return a string containing the major and minor Python version,
|
"""Return a string containing the major and minor Python version,
|
||||||
leaving off the patchlevel. Sample return values could be '1.5'
|
leaving off the patchlevel. Sample return values could be '1.5'
|
||||||
|
@ -83,7 +94,8 @@ def get_python_inc(plat_specific=0, prefix=None):
|
||||||
else:
|
else:
|
||||||
incdir = os.path.join(get_config_var('srcdir'), 'Include')
|
incdir = os.path.join(get_config_var('srcdir'), 'Include')
|
||||||
return os.path.normpath(incdir)
|
return os.path.normpath(incdir)
|
||||||
return os.path.join(prefix, "include", "python" + get_python_version())
|
python_dir = 'python' + get_python_version() + build_flags
|
||||||
|
return os.path.join(prefix, "include", python_dir)
|
||||||
elif os.name == "nt":
|
elif os.name == "nt":
|
||||||
return os.path.join(prefix, "include")
|
return os.path.join(prefix, "include")
|
||||||
elif os.name == "os2":
|
elif os.name == "os2":
|
||||||
|
@ -209,7 +221,8 @@ def get_makefile_filename():
|
||||||
if python_build:
|
if python_build:
|
||||||
return os.path.join(os.path.dirname(sys.executable), "Makefile")
|
return os.path.join(os.path.dirname(sys.executable), "Makefile")
|
||||||
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
|
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
|
||||||
return os.path.join(lib_dir, "config", "Makefile")
|
config_file = 'config-{}{}'.format(get_python_version(), build_flags)
|
||||||
|
return os.path.join(lib_dir, config_file, 'Makefile')
|
||||||
|
|
||||||
|
|
||||||
def parse_config_h(fp, g=None):
|
def parse_config_h(fp, g=None):
|
||||||
|
|
|
@ -25,8 +25,10 @@ _INSTALL_SCHEMES = {
|
||||||
'platstdlib': '{platbase}/lib/python{py_version_short}',
|
'platstdlib': '{platbase}/lib/python{py_version_short}',
|
||||||
'purelib': '{base}/lib/python{py_version_short}/site-packages',
|
'purelib': '{base}/lib/python{py_version_short}/site-packages',
|
||||||
'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
|
'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
|
||||||
'include': '{base}/include/python{py_version_short}',
|
'include':
|
||||||
'platinclude': '{platbase}/include/python{py_version_short}',
|
'{base}/include/python{py_version_short}{abiflags}',
|
||||||
|
'platinclude':
|
||||||
|
'{platbase}/include/python{py_version_short}{abiflags}',
|
||||||
'scripts': '{base}/bin',
|
'scripts': '{base}/bin',
|
||||||
'data': '{base}',
|
'data': '{base}',
|
||||||
},
|
},
|
||||||
|
@ -317,7 +319,9 @@ def get_makefile_filename():
|
||||||
"""Return the path of the Makefile."""
|
"""Return the path of the Makefile."""
|
||||||
if _PYTHON_BUILD:
|
if _PYTHON_BUILD:
|
||||||
return os.path.join(_PROJECT_BASE, "Makefile")
|
return os.path.join(_PROJECT_BASE, "Makefile")
|
||||||
return os.path.join(get_path('stdlib'), "config", "Makefile")
|
return os.path.join(get_path('stdlib'),
|
||||||
|
'config-{}{}'.format(_PY_VERSION_SHORT, sys.abiflags),
|
||||||
|
'Makefile')
|
||||||
|
|
||||||
|
|
||||||
def _init_posix(vars):
|
def _init_posix(vars):
|
||||||
|
@ -471,6 +475,7 @@ def get_config_vars(*args):
|
||||||
_CONFIG_VARS['base'] = _PREFIX
|
_CONFIG_VARS['base'] = _PREFIX
|
||||||
_CONFIG_VARS['platbase'] = _EXEC_PREFIX
|
_CONFIG_VARS['platbase'] = _EXEC_PREFIX
|
||||||
_CONFIG_VARS['projectbase'] = _PROJECT_BASE
|
_CONFIG_VARS['projectbase'] = _PROJECT_BASE
|
||||||
|
_CONFIG_VARS['abiflags'] = sys.abiflags
|
||||||
|
|
||||||
if os.name in ('nt', 'os2'):
|
if os.name in ('nt', 'os2'):
|
||||||
_init_non_posix(_CONFIG_VARS)
|
_init_non_posix(_CONFIG_VARS)
|
||||||
|
|
|
@ -108,9 +108,8 @@ ABIFLAGS= @ABIFLAGS@
|
||||||
# Detailed destination directories
|
# Detailed destination directories
|
||||||
BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
BINLIBDEST= $(LIBDIR)/python$(VERSION)
|
||||||
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
|
||||||
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
|
INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
|
||||||
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
|
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
|
||||||
LIBP= $(LIBDIR)/python$(VERSION)
|
|
||||||
|
|
||||||
# Symbols used for using shared libraries
|
# Symbols used for using shared libraries
|
||||||
SO= @SO@
|
SO= @SO@
|
||||||
|
@ -834,7 +833,7 @@ altbininstall: $(BUILDPYTHON)
|
||||||
else true; \
|
else true; \
|
||||||
fi; \
|
fi; \
|
||||||
done
|
done
|
||||||
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
|
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE)
|
||||||
if test -f $(LDLIBRARY); then \
|
if test -f $(LDLIBRARY); then \
|
||||||
if test -n "$(DLLLIBRARY)" ; then \
|
if test -n "$(DLLLIBRARY)" ; then \
|
||||||
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
|
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
|
||||||
|
@ -852,11 +851,20 @@ bininstall: altbininstall
|
||||||
then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \
|
then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \
|
||||||
else true; \
|
else true; \
|
||||||
fi
|
fi
|
||||||
|
-if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)$(VERSION)$(EXE); \
|
||||||
|
then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
|
||||||
|
else true; \
|
||||||
|
fi
|
||||||
|
(cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE))
|
||||||
(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE))
|
(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE))
|
||||||
-rm -f $(DESTDIR)$(BINDIR)/python3-config
|
-rm -f $(DESTDIR)$(BINDIR)/python3-config
|
||||||
|
-rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config
|
||||||
|
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config)
|
||||||
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
|
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
|
||||||
-rm -f $(DESTDIR)$(LIBPC)/python3.pc
|
-rm -f $(DESTDIR)$(LIBPC)/python3.pc
|
||||||
|
-rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc
|
||||||
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
|
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
|
||||||
|
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc)
|
||||||
|
|
||||||
# Install the manual page
|
# Install the manual page
|
||||||
maninstall:
|
maninstall:
|
||||||
|
@ -986,7 +994,7 @@ $(srcdir)/Lib/$(PLATDIR):
|
||||||
python-config: $(srcdir)/Misc/python-config.in
|
python-config: $(srcdir)/Misc/python-config.in
|
||||||
# Substitution happens here, as the completely-expanded BINDIR
|
# Substitution happens here, as the completely-expanded BINDIR
|
||||||
# is not available in configure
|
# is not available in configure
|
||||||
sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
|
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
|
||||||
|
|
||||||
# Install the include files
|
# Install the include files
|
||||||
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
|
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
|
||||||
|
@ -1008,13 +1016,13 @@ inclinstall:
|
||||||
|
|
||||||
# Install the library and miscellaneous stuff needed for extending/embedding
|
# Install the library and miscellaneous stuff needed for extending/embedding
|
||||||
# This goes into $(exec_prefix)
|
# This goes into $(exec_prefix)
|
||||||
LIBPL= $(LIBP)/config
|
LIBPL= $(LIBDEST)/config-$(LDVERSION)
|
||||||
|
|
||||||
# pkgconfig directory
|
# pkgconfig directory
|
||||||
LIBPC= $(LIBDIR)/pkgconfig
|
LIBPC= $(LIBDIR)/pkgconfig
|
||||||
|
|
||||||
libainstall: all python-config
|
libainstall: all python-config
|
||||||
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
|
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
|
||||||
do \
|
do \
|
||||||
if test ! -d $(DESTDIR)$$i; then \
|
if test ! -d $(DESTDIR)$$i; then \
|
||||||
echo "Creating directory $$i"; \
|
echo "Creating directory $$i"; \
|
||||||
|
@ -1044,7 +1052,7 @@ libainstall: all python-config
|
||||||
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
||||||
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
||||||
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
|
||||||
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(VERSION)-config
|
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
|
||||||
rm python-config
|
rm python-config
|
||||||
@if [ -s Modules/python.exp -a \
|
@if [ -s Modules/python.exp -a \
|
||||||
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
|
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# See: man pkg-config
|
||||||
prefix=@prefix@
|
prefix=@prefix@
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix=@exec_prefix@
|
||||||
libdir=@libdir@
|
libdir=@libdir@
|
||||||
|
@ -9,5 +10,4 @@ Requires:
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Libs.private: @LIBS@
|
Libs.private: @LIBS@
|
||||||
Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
|
Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
|
||||||
Cflags: -I${includedir}/python@VERSION@
|
Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@
|
||||||
|
|
||||||
|
|
|
@ -618,7 +618,7 @@ INSTSONAME='$(LDLIBRARY)'
|
||||||
DLLLIBRARY=''
|
DLLLIBRARY=''
|
||||||
LDLIBRARYDIR=''
|
LDLIBRARYDIR=''
|
||||||
RUNSHARED=''
|
RUNSHARED=''
|
||||||
LDVERSION="$(VERSION)"
|
LDVERSION="$VERSION"
|
||||||
|
|
||||||
# LINKCC is the command that links the python executable -- default is $(CC).
|
# LINKCC is the command that links the python executable -- default is $(CC).
|
||||||
# If CXX is set, and if it is needed to link a main function that was
|
# If CXX is set, and if it is needed to link a main function that was
|
||||||
|
|
Loading…
Reference in New Issue