summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-04-13 15:58:02 +0200
committerFlorian Dold <florian.dold@gmail.com>2016-04-13 15:58:02 +0200
commitc234a8bed842c8be3aaded936e620e7f5d32e5cb (patch)
treeb48cc70ab39ff3bb61185c8c2fe8bc65fba15c48 /src
parent9f9d41dd06ed5911b9abdf3017171d411f4dc8a6 (diff)
downloadexchange-c234a8bed842c8be3aaded936e620e7f5d32e5cb.tar.gz
exchange-c234a8bed842c8be3aaded936e620e7f5d32e5cb.tar.bz2
exchange-c234a8bed842c8be3aaded936e620e7f5d32e5cb.zip
Create taler-config wrapper around gnunet-config
The wrapper uses LD_PRELOAD to make sure that paths are adjusted for taler.
Diffstat (limited to 'src')
-rw-r--r--src/util/Makefile.am12
-rw-r--r--src/util/taler-config.in10
2 files changed, 22 insertions, 0 deletions
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index f52bc81c6..22bc788b8 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -15,6 +15,18 @@ pkgcfg_DATA = \
EXTRA_DIST = \
paths.conf
+dist_bin_SCRIPTS = taler-config
+
+# See https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
+# for and explanation and why this ugliness is necessary.
+edit = sed -e 's|@libdir[@]|$(libdir)|g'
+taler-config: Makefile $(srcdir)/taler-config.in
+ rm -f $@ $@.tmp
+ $(edit) '$(srcdir)/$@.in' >$@.tmp
+ chmod +x $@.tmp
+ chmod a-w $@.tmp
+ mv $@.tmp $@
+
if WALLET_ONLY
lib_LTLIBRARIES = \
libtalerutil_wallet.la
diff --git a/src/util/taler-config.in b/src/util/taler-config.in
new file mode 100644
index 000000000..eb4114c82
--- /dev/null
+++ b/src/util/taler-config.in
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+
+if ! type gnunet-config >/dev/null; then
+ echo "$0 needs gnunet-config to be installed"
+ exit 1
+fi
+
+# FIXME: not very portable ...
+export LD_PRELOAD=@libdir@/libtalerutil.so
+exec gnunet-config "$@"