From: "Michael R. Crusoe" <crusoe@debian.org>
Date: Mon, 9 Sep 2019 10:23:45 +0900
Subject: For Debian, don't statically link to cairo, jansson, libstdc++,
 libgcc

Forwarded: not-needed
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index ce834db..e5b1b3c 100644
--- a/Makefile
+++ b/Makefile
@@ -77,7 +77,7 @@ LD_LIB_FLAGS := -lvcflib -ltabixpp -lgssw -lssw -lsublinearLS -lpthread -lncurse
 # By default it has no suffix
 BOOST_SUFFIX=""
 # We define some more libraries to link against at the end, in static linking mode if possible, so we can use faster non-PIC code.
-LD_STATIC_LIB_FLAGS := -lvgio $(CWD)/$(LIB_DIR)/libtabixpp.a $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lz -lbz2 -llzma
+LD_STATIC_LIB_FLAGS := -lvgio $(CWD)/$(LIB_DIR)/libtabixpp.a $(CWD)/$(LIB_DIR)/libhts.a -ldeflate -lz -llzma
 # Some of our static libraries depend on libraries that may not always be avilable in static form.
 LD_STATIC_LIB_DEPS := -lpthread -lm
 # Use pkg-config to find dependencies.
@@ -275,7 +275,7 @@ endif
 LD_LIB_FLAGS += "-lboost_program_options$(BOOST_SUFFIX)"
 
 # These libs need to come after libdw if used, because libdw depends on them
-LD_LIB_FLAGS += -ldl -llzma -lbz2 -lzstd
+LD_LIB_FLAGS += -ldl -llzma -lzstd
 
 # Sometimes we need to filter the assembler output. The assembler can run during
 # ./configure scripts, compiler calls, or $(MAKE) calls (other than $(MAKE)
@@ -295,7 +295,7 @@ endif
 # When building statically, we need to tell the linker not to bail if it sees multiple definitions.
 # libc on e.g. our Jenkins host does not define malloc as weak, so other mallocs can't override it in a static build.
 # TODO: Why did this problem only begin to happen when libvw was added?
-STATIC_FLAGS=-static -static-libstdc++ -static-libgcc -Wl,--allow-multiple-definition
+STATIC_FLAGS=-static -Wl,--allow-multiple-definition
 
 # These are put into libvg. Grab everything except main
 OBJ = $(filter-out $(OBJ_DIR)/main.o,$(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(wildcard $(SRC_DIR)/*.cpp)))
