2016-04-13 15:58:02 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-09-15 11:57:59 +02:00
|
|
|
set -eu
|
|
|
|
|
2016-04-13 15:58:02 +02:00
|
|
|
if ! type gnunet-config >/dev/null; then
|
|
|
|
echo "$0 needs gnunet-config to be installed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# FIXME: not very portable ...
|
2016-11-18 17:21:10 +01:00
|
|
|
# FIXME: should use "libdir" instead of prefix/lib, but somehow
|
|
|
|
# the recursive expansion does not work ;-(.
|
2019-09-15 11:57:59 +02:00
|
|
|
GC=`which gnunet-config`
|
|
|
|
ASAN=""
|
|
|
|
A=`ldd $GC | grep libasan` && ASAN=`echo $A | awk '{print $3 ":"}'`
|
2020-01-18 19:49:33 +01:00
|
|
|
if test -z $ASAN
|
|
|
|
then
|
|
|
|
A=`ldd @prefix@/lib/libtalerutil.so | grep libasan` && ASAN=`echo $A | awk '{print $3 ":"}'`
|
|
|
|
fi
|
2019-09-15 11:57:59 +02:00
|
|
|
export LD_PRELOAD=${ASAN}${LD_PRELOAD:-}:@prefix@/lib/libtalerutil.so
|
2016-04-13 15:58:02 +02:00
|
|
|
exec gnunet-config "$@"
|