Description: add static link to libbam.a
 The Debian libbam package only provides a static library to link to,
 adding this to the Makefile.
Author: Sascha Steinbiss <steinbiss@zbh.uni-hamburg.de>

--- a/Makefile
+++ b/Makefile
@@ -601,6 +601,10 @@
 	$(V_DO)$(RANLIB) $@
 endif
 
+ifeq ($(useshared),yes)
+  ADDITIONAL_STATIC_DEPS:=/usr/lib/libbam.a
+endif
+
 lib/libgenometools.a: obj/gt_config.h  $(LIBGENOMETOOLS_OBJ)
 	$(V_ECHO) "[link $(@F)]"
 	$(V_DO)test -d $(@D) || mkdir -p $(@D)
@@ -619,13 +623,14 @@
                                           $(LIBGENOMETOOLS_OBJ) \
                                           $(ADDITIONAL_SO_DEPS) \
                                           $(ADDITIONAL_ZLIBS) \
+                                          $(ADDITIONAL_STATIC_DEPS) \
                                           $(VERSION_SCRIPT)
 	$(V_ECHO) "[link $(@F)]"
 	$(V_DO)test -d $(@D) || mkdir -p $(@D)
 	$(V_DO)$(CC) $(EXP_LDFLAGS) $(VERSION_SCRIPT_PARAM) \
 	  $(GT_LDFLAGS) $(ADDITIONAL_SO_DEPS) $(SHARED) \
 		-Wl,-soname,$(notdir $@)$(SONAME_VERSION) $(LIBGENOMETOOLS_OBJ) \
-		-o $@$(SONAME_VERSION) $(GTSHAREDLIB_LIBDEP)
+		-o $@$(SONAME_VERSION) $(GTSHAREDLIB_LIBDEP) $(ADDITIONAL_STATIC_DEPS)
 
 define PROGRAM_template
 $(1): $(2)
@@ -638,46 +643,55 @@
 
 $(eval $(call PROGRAM_template, bin/gt, $(GTMAIN_OBJ) $(TOOLS_OBJ) \
                                         lib/libgenometools.a \
+                                        $(ADDITIONAL_STATIC_DEPS) \
                                         $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/custom_stream, \
                                 obj/src/examples/custom_stream.o \
                                 lib/libgenometools.a\
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/gff3sort, \
                                 obj/src/examples/gff3sort.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/gff3validator, \
                                 obj/src/examples/gff3validator.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/noop, \
                                 obj/src/examples/noop.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/sketch_constructed, \
                                 obj/src/examples/sketch_constructed.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/sketch_parsed, \
                                 obj/src/examples/sketch_parsed.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/sketch_parsed_with_ctrack, \
                                 obj/src/examples/sketch_parsed_with_ctrack.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 $(eval $(call PROGRAM_template, bin/examples/sketch_parsed_with_ordering, \
                                 obj/src/examples/sketch_parsed_with_ordering.o \
                                 lib/libgenometools.a \
+                                $(ADDITIONAL_STATIC_DEPS) \
                                 $(ADDITIONAL_ZLIBS)))
 
 bin/lua: $(LUAMAIN_OBJ)
