Include `confsubst' machinery.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Aug 2015 09:58:38 +0000 (10:58 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 6 Sep 2015 23:22:19 +0000 (00:22 +0100)
.links
Makefile.am
vars.am

diff --git a/.links b/.links
index c7a181f..1df072c 100644 (file)
--- a/.links
+++ b/.links
@@ -1,3 +1,4 @@
 COPYING
 COPYING.LIB
 config/auto-version
+config/confsubst
index 0171170..e1b1bbf 100644 (file)
@@ -48,5 +48,6 @@ dist-hook:
 
 ## Additional build tools.
 EXTRA_DIST             += config/auto-version
+EXTRA_DIST             += config/confsubst
 
 ###----- That's all, folks --------------------------------------------------
diff --git a/vars.am b/vars.am
index 2f3336e..5150203 100644 (file)
--- a/vars.am
+++ b/vars.am
@@ -55,6 +55,23 @@ AM_CPPFLAGS           = $(SOD_INCLUDES)
 LDADD                   = $(top_builddir)/lib/libsod.la
 
 ###--------------------------------------------------------------------------
+### Standard configuration substitutions.
+
+## Substitute tags in files.
+confsubst                = $(top_srcdir)/config/confsubst
+
+SUBSTITUTIONS = \
+       prefix=$(prefix) exec_prefix=$(exec_prefix) \
+       libdir=$(libdir) includedir=$(includedir) \
+       bindir=$(bindir) sbindir=$(sbindir) \
+       PACKAGE=$(PACKAGE) VERSION=$(VERSION)
+
+V_SUBST = $(V_SUBST_$(V))
+V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
+V_SUBST_0 = @echo "  SUBST  $@";
+SUBST = $(V_SUBST)$(confsubst)
+
+###--------------------------------------------------------------------------
 ### Translating SOD input files.
 
 ## The tool location.