diff --git a/ChangeLog b/ChangeLog
index c529ee2ef25892d37ab6fbcb0cbb162865b34a6d..9bd452c42ae2d405987d8d155c7225caea558a3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-24  Niels M�ller  <nisse@lysator.liu.se>
+
+	* Makefile.in (PKGCONFIG_FILES, pkgconfigdir): New variables.
+	(DISTFILES): Added nettle.pc.in and hogweed.pc.in.
+	(nettle.pc, hogweed.pc): New targets (invoking config.status).
+	(install-pkgconfig, uninstall-pkgconfig): New targets.
+	(install-here): Depend on install-pkgconfig.
+	(uninstall-here): Depend on uninstall-pkgconfig.
+	(distclean-here): Delete nettle.pc and hogweed.pc.
+
 2011-07-20  Niels M�ller  <nisse@lysator.liu.se>
 
 	* configure.ac: Generate nettle.pc and hogweed.pc.
diff --git a/Makefile.in b/Makefile.in
index fd486f57464cf6b85f9c12a2bfe4e47f00870fb8..3bd8c4ffda7984917e5f786ad6055630448aa6d5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -28,6 +28,9 @@ TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) shadata$(EXEEXT) gcmdata$(EXEEXT)\
 
 DOCTARGETS = nettle.info nettle.html nettle.pdf
 
+PKGCONFIG_FILES = nettle.pc @IF_HOGWEED@ hogweed.pc
+pkgconfigdir = $(libdir)/pkgconfig
+
 all check install uninstall:
 	$(MAKE) $@-here
 	set -e; for d in $(SUBDIRS); do \
@@ -127,6 +130,7 @@ DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac \
 	config.guess config.sub install-sh texinfo.tex \
 	config.h.in config.m4.in config.make.in	Makefile.in \
 	README AUTHORS COPYING.LIB INSTALL NEWS TODO ChangeLog \
+	nettle.pc.in hogweed.pc.in \
 	memxor.c $(des_headers) descore.README \
 	aes-internal.h camellia-internal.h serpent-internal.h \
 	cast128_sboxes.h desinfo.h desCode.h \
@@ -264,8 +268,14 @@ config.make: config.make.in config.status
 config.m4: config.m4.in config.status
 	./config.status $@
 
+nettle.pc: nettle.pc.in config.status
+	./config.status $@
+
+hogweed.pc: hogweed.pc.in config.status
+	./config.status $@
+
 # Installation
-install-here: install-info install-headers install-static \
+install-here: install-info install-headers install-static install-pkgconfig \
 	@IF_SHARED@ install-shared-nettle @IF_HOGWEED@ install-shared-hogweed
 
 install-static: $(LIBTARGETS)
@@ -315,9 +325,15 @@ install-headers: $(INSTALL_HEADERS)
 	    $(INSTALL_DATA) "$(srcdir)/$$f" $(DESTDIR)$(includedir)/nettle ; \
 	  fi ; done
 
+install-pkgconfig: $(PKGCONFIG_FILES)
+	$(MKDIR_P) $(DESTDIR)$(pkgconfigdir)
+	for f in $(PKGCONFIG_FILES) ; do \
+	  $(INSTALL_DATA) "$$f" $(DESTDIR)$(pkgconfigdir) ; \
+	done
+
 # Uninstall
 uninstall-here: uninstall-info uninstall-headers uninstall-static \
-	        @IF_SHARED@ uninstall-shared
+		uninstall-pkgconfig @IF_SHARED@ uninstall-shared
 
 uninstall-static:
 	for f in $(LIBTARGETS) ; do \
@@ -349,6 +365,11 @@ uninstall-shared-hogweed:
 	[ -z "$(LIBHOGWEED_SONAME)" ] \
 		|| rm -f $(LIBHOGWEED_SONAME) $(LIBHOGWEED_FORLINK)
 
+uninstall-pkgconfig:
+	for f in $(PKGCONFIG_FILES) ; do \
+	  rm -f $(DESTDIR)$(pkgconfigdir)/$$f ; \
+	done
+
 # Distribution
 distdir = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 top_distdir = $(distdir)
@@ -424,7 +445,9 @@ clean-here:
 
 distclean-here: clean-here
 	-rm -f config.h stamp-h config.log config.status machine.m4 \
-	config.make config.m4 Makefile nettle-stdint.h *.asm *.d
+	config.make config.m4 Makefile nettle-stdint.h \
+	nettle.pc hogweed.pc \
+	*.asm *.d
 
 maintainer-clean-here:
 	-rm -f $(DOCTARGETS) *.dvi *.ps