From: Harlan Lieberman-Berg <hlieberman@debian.org>
Date: Sun, 4 Nov 2018 21:34:10 +0800
Subject: Ensure jq doesn't statically link in libraries

Forwarded: not-needed
---
 Makefile.am | 3 +--
 tests/setup | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

--- a/Makefile.am
+++ b/Makefile.am
@@ -106,7 +106,6 @@
 
 bin_PROGRAMS = jq
 jq_SOURCES = src/main.c src/version.h
-jq_LDFLAGS = -static-libtool-libs
 jq_LDADD = libjq.la -lm
 
 if WIN32
@@ -114,7 +113,7 @@
 endif
 
 if ENABLE_ALL_STATIC
-jq_LDFLAGS += -all-static
+jq_LDFLAGS = -all-static
 endif
 
 ### Tests (make check)
--- a/tests/setup
+++ b/tests/setup
@@ -13,8 +13,9 @@
 JQ=$JQBASEDIR/jq
 
 if [ -z "${NO_VALGRIND-}" ] && which valgrind > /dev/null; then
-    VALGRIND="valgrind --error-exitcode=1 --leak-check=full \
-                       --suppressions=$JQTESTDIR/onig.supp"
+    VALGRIND="libtool --mode=execute -- valgrind \
+    		      	       --error-exitcode=1 --leak-check=full \
+		      	       --suppressions=$JQTESTDIR/onig.supp"
     VG_EXIT0=--error-exitcode=0
     Q=-q
 else
