aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/Makefile.am
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2013-09-09 20:37:03 +0300
committerLasse Collin <lasse.collin@tukaani.org>2014-04-26 08:29:17 +0300
commit090c69dda59e00fc86d0792879bd921bb1156029 (patch)
tree00bc9df339421de7b88e65b08cf0884bb95c94cf /src/liblzma/Makefile.am
parentmacosx: separate liblzma package (diff)
downloadxz-090c69dda59e00fc86d0792879bd921bb1156029.tar.xz
Build: Create liblzma.pc in a src/liblzma/Makefile.am.
Previously it was done in configure, but doing that goes against the Autoconf manual. Autoconf requires that it is possible to override e.g. prefix after running configure and that doesn't work correctly if liblzma.pc is created by configure. A potential downside of this change is that now e.g. libdir in liblzma.pc is a standalone string instead of being defined via ${prefix}, so if one overrides prefix when running pkg-config the libdir won't get the new value. I don't know if this matters in practice. Thanks to Vincent Torri.
Diffstat (limited to 'src/liblzma/Makefile.am')
-rw-r--r--src/liblzma/Makefile.am20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/liblzma/Makefile.am b/src/liblzma/Makefile.am
index 0529ff84..d8fd6a1d 100644
--- a/src/liblzma/Makefile.am
+++ b/src/liblzma/Makefile.am
@@ -88,3 +88,23 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = liblzma.pc
EXTRA_DIST += liblzma.pc.in
+
+pc_verbose = $(pc_verbose_@AM_V@)
+pc_verbose_ = $(pc_verbose_@AM_DEFAULT_V@)
+pc_verbose_0 = @echo " PC " $@;
+
+liblzma.pc: $(srcdir)/liblzma.pc.in
+ $(AM_V_at)rm -f $@
+ $(pc_verbose)sed \
+ -e 's,@prefix[@],$(prefix),g' \
+ -e 's,@exec_prefix[@],$(exec_prefix),g' \
+ -e 's,@libdir[@],$(libdir),g' \
+ -e 's,@includedir[@],$(includedir),g' \
+ -e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g' \
+ -e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g' \
+ -e 's,@PTHREAD_CFLAGS[@],$(PTHREAD_CFLAGS),g' \
+ -e 's,@LIBS[@],$(LIBS),g' \
+ < $< > $@ || { rm -f $@; exit 1; }
+
+clean-local:
+ rm -f liblzma.pc