Skip to content

Commit ced52a9

Browse files
committed
Patch #1523356: fix determining include dirs in python-config.
Also don't install "python-config" when doing altinstall, but always install "python-config2.x" and make a link to it like with the main executable.
1 parent 982e9fe commit ced52a9

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

Makefile.pre.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ bininstall: altbininstall
649649
else true; \
650650
fi
651651
(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
652+
(cd $(DESTDIR)$(BINDIR); $(LN) -sf python-config$(VERSION)$(EXE) python-config$(EXE))
652653

653654
# Install the interpreter with $(VERSION) affixed
654655
# This goes into $(exec_prefix)
@@ -849,8 +850,8 @@ libainstall: all
849850
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
850851
# Substitution happens here, as the completely-expanded BINDIR
851852
# is not available in configure
852-
sed -e "s,@BINDIR@,$(BINDIR)," < $(srcdir)/Misc/python-config.in >python-config
853-
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python-config
853+
sed -e "s,@EXENAME@,$(BINDIR)/python$(VERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config
854+
$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python-config$(VERSION)$(EXE)
854855
rm python-config
855856
@if [ -s Modules/python.exp -a \
856857
"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \

Misc/python-config.in

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!@BINDIR@/python
1+
#!@EXENAME@
22

33
import sys
44
import os
@@ -36,13 +36,14 @@ elif opt == '--exec-prefix':
3636
print sysconfig.EXEC_PREFIX
3737

3838
elif opt in ('--includes', '--cflags'):
39-
flags = ['-I'+dir for dir in getvar('INCLDIRSTOMAKE').split()]
39+
flags = ['-I' + sysconfig.get_python_inc(),
40+
'-I' + sysconfig.get_python_inc(plat_specific=True)]
4041
if opt == '--cflags':
4142
flags.extend(getvar('CFLAGS').split())
4243
print ' '.join(flags)
4344

4445
elif opt in ('--libs', '--ldflags'):
45-
libs = sysconfig.get_config_var('LIBS').split()
46+
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
4647
libs.append('-lpython'+pyver)
4748
if opt == '--ldflags':
4849
libs.insert(0, '-L' + getvar('LIBPL'))

0 commit comments

Comments
 (0)