Skip to content

Commit f2caeed

Browse files
committed
Issue python#3585: Add pkg-config support.
It creates a python-2.7.pc file and a python.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by Clinton Roy.
1 parent 0b09c42 commit f2caeed

7 files changed

Lines changed: 5858 additions & 4957 deletions

File tree

‎Makefile.pre.in‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ bininstall: altbininstall
770770
(cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON))
771771
-rm -f $(DESTDIR)$(BINDIR)/python-config
772772
(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config)
773+
-rm -f $(DESTDIR)$(LIBPC)/python.pc
774+
(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc)
773775

774776
# Install the interpreter with $(VERSION) affixed
775777
# This goes into $(exec_prefix)
@@ -946,8 +948,12 @@ inclinstall:
946948
# Install the library and miscellaneous stuff needed for extending/embedding
947949
# This goes into $(exec_prefix)
948950
LIBPL= $(LIBP)/config
951+
952+
# pkgconfig directory
953+
LIBPC= $(LIBDIR)/pkgconfig
954+
949955
libainstall: all
950-
@for i in $(LIBDIR) $(LIBP) $(LIBPL); \
956+
@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
951957
do \
952958
if test ! -d $(DESTDIR)$$i; then \
953959
echo "Creating directory $$i"; \
@@ -974,6 +980,7 @@ libainstall: all
974980
$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
975981
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
976982
$(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config
983+
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
977984
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
978985
$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
979986
# Substitution happens here, as the completely-expanded BINDIR

‎Misc/ACKS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ Saskia van Rossum
618618
Donald Wallace Rouse II
619619
Liam Routt
620620
Craig Rowland
621+
Clinton Roy
621622
Paul Rubin
622623
Sam Ruby
623624
Audun S. Runde

‎Misc/NEWS‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,10 @@ Tools/Demos
971971
Build
972972
-----
973973

974+
- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file
975+
and a python.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by
976+
Clinton Roy.
977+
974978
- Issue #6094: Build correctly with Subversion 1.7.
975979

976980
- Issue #5847: Remove -n switch on "Edit with IDLE" menu item.

‎Misc/python.pc.in‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
prefix=@prefix@
2+
exec_prefix=@exec_prefix@
3+
libdir=@libdir@
4+
includedir=@includedir@
5+
6+
Name: Python
7+
Description: Python library
8+
Requires:
9+
Version: @VERSION@
10+
Libs.private: @LIBS@
11+
Libs: -L${libdir} -lpython@VERSION@
12+
Cflags: -I${includedir}/python@VERSION@
13+

0 commit comments

Comments
 (0)