Final patch for issue 9807.

This commit is contained in:
Barry Warsaw 2010-11-24 19:43:47 +00:00
parent fdba067213
commit 14d98ac31b
7 changed files with 332 additions and 328 deletions

View file

@ -48,7 +48,7 @@
'unix_prefix': {
'purelib': '$base/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',
'data' : '$base',
},
@ -82,7 +82,8 @@
INSTALL_SCHEMES['unix_user'] = {
'purelib': '$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',
'data' : '$userbase',
}
@ -322,6 +323,7 @@ def finalize_options(self):
'prefix': prefix,
'sys_exec_prefix': exec_prefix,
'exec_prefix': exec_prefix,
'abiflags': sys.abiflags,
}
if HAS_USER_SITE:

View file

@ -11,7 +11,6 @@
__revision__ = "$Id$"
import io
import os
import re
import sys
@ -49,6 +48,18 @@ def _python_build():
return False
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():
"""Return a string containing the major and minor Python version,
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:
incdir = os.path.join(get_config_var('srcdir'), 'Include')
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":
return os.path.join(prefix, "include")
elif os.name == "os2":
@ -209,7 +221,8 @@ def get_makefile_filename():
if python_build:
return os.path.join(os.path.dirname(sys.executable), "Makefile")
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):

View file

@ -25,8 +25,10 @@
'platstdlib': '{platbase}/lib/python{py_version_short}',
'purelib': '{base}/lib/python{py_version_short}/site-packages',
'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
'include': '{base}/include/python{py_version_short}',
'platinclude': '{platbase}/include/python{py_version_short}',
'include':
'{base}/include/python{py_version_short}{abiflags}',
'platinclude':
'{platbase}/include/python{py_version_short}{abiflags}',
'scripts': '{base}/bin',
'data': '{base}',
},
@ -317,7 +319,9 @@ def get_makefile_filename():
"""Return the path of the Makefile."""
if _PYTHON_BUILD:
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):
@ -471,6 +475,7 @@ def get_config_vars(*args):
_CONFIG_VARS['base'] = _PREFIX
_CONFIG_VARS['platbase'] = _EXEC_PREFIX
_CONFIG_VARS['projectbase'] = _PROJECT_BASE
_CONFIG_VARS['abiflags'] = sys.abiflags
if os.name in ('nt', 'os2'):
_init_non_posix(_CONFIG_VARS)

View file

@ -108,9 +108,8 @@ ABIFLAGS= @ABIFLAGS@
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
LIBDEST= $(SCRIPTDIR)/python$(VERSION)
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(VERSION)
LIBP= $(LIBDIR)/python$(VERSION)
INCLUDEPY= $(INCLUDEDIR)/python$(LDVERSION)
CONFINCLUDEPY= $(CONFINCLUDEDIR)/python$(LDVERSION)
# Symbols used for using shared libraries
SO= @SO@
@ -834,7 +833,7 @@ altbininstall: $(BUILDPYTHON)
else true; \
fi; \
done
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE)
$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE)
if test -f $(LDLIBRARY); then \
if test -n "$(DLLLIBRARY)" ; then \
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
@ -852,11 +851,20 @@ bininstall: altbininstall
then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \
else true; \
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))
-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)
-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 python-$(LDVERSION).pc)
# Install the manual page
maninstall:
@ -986,7 +994,7 @@ $(srcdir)/Lib/$(PLATDIR):
python-config: $(srcdir)/Misc/python-config.in
# Substitution happens here, as the completely-expanded BINDIR
# 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
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
@ -1008,13 +1016,13 @@ inclinstall:
# Install the library and miscellaneous stuff needed for extending/embedding
# This goes into $(exec_prefix)
LIBPL= $(LIBP)/config
LIBPL= $(LIBDEST)/config-$(LDVERSION)
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig
libainstall: all python-config
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
echo "Creating directory $$i"; \
@ -1044,7 +1052,7 @@ libainstall: all python-config
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
$(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
@if [ -s Modules/python.exp -a \
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \

View file

@ -1,3 +1,4 @@
# See: man pkg-config
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
@ -9,5 +10,4 @@ Requires:
Version: @VERSION@
Libs.private: @LIBS@
Libs: -L${libdir} -lpython@VERSION@@ABIFLAGS@
Cflags: -I${includedir}/python@VERSION@
Cflags: -I${includedir}/python@VERSION@@ABIFLAGS@

594
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -618,7 +618,7 @@ INSTSONAME='$(LDLIBRARY)'
DLLLIBRARY=''
LDLIBRARYDIR=''
RUNSHARED=''
LDVERSION="$(VERSION)"
LDVERSION="$VERSION"
# 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