Description: Use Debian packaged gclib
Author: Andreas Tille <tille@debian.org>
Last-Update: Sat, 13 Jun 2020 07:41:58 +0200

--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 GCLDIR := ./gclib
-SEARCHDIRS := -I${GCLDIR}
+SEARCHDIRS := `pkg-config --cflags libgclib`
 CC      := g++
 
 BASEFLAGS  = -Wall ${SEARCHDIRS} $(MARCH) -DENABLE_COMPRESSION=1 -D_FILE_OFFSET_BITS=64 \
@@ -42,6 +42,7 @@ LINKER    := g++
 #LDFLAGS = 
 #uncomment this when ENABLE_COMPRESSION
 LDFLAGS  := -lz $(LDFLAGS)
+LIBS      = `pkg-config --libs libgclib`
 
 .PHONY : all
 all:    cdbfasta cdbyank 
@@ -49,11 +50,11 @@ debug:  all
 nommap: all
 #when compression is enabled:
 #cdbfasta:  ./cdbfasta.o ./gcdbz.o  ...
-cdbfasta:  ./cdbfasta.o ./gcdbz.o ${GCLDIR}/gcdb.o ${GCLDIR}/GBase.o ${GCLDIR}/GStr.o ${GCLDIR}/GArgs.o
-	${LINKER} -o $@ ${filter-out %.a %.so, $^} $(LDFLAGS)
+cdbfasta:  ./cdbfasta.o ./gcdbz.o 
+	${LINKER} -o $@ ${filter-out %.a %.so, $^} $(LIBS) $(LDFLAGS)
 #cdbyank :  ./cdbyank.o ./gcdbz.o
-cdbyank :  ./cdbyank.o ./gcdbz.o ${GCLDIR}/gcdb.o ${GCLDIR}/GBase.o ${GCLDIR}/GStr.o ${GCLDIR}/GArgs.o
-	${LINKER} -o $@ ${filter-out %.a %.so, $^} $(LDFLAGS)
+cdbyank :  ./cdbyank.o ./gcdbz.o
+	${LINKER} -o $@ ${filter-out %.a %.so, $^} $(LIBS) $(LDFLAGS)
 
 # target for removing all object files
 
--- a/gcdbz.h
+++ b/gcdbz.h
@@ -3,7 +3,7 @@
 
 #define GCDBZ_SBUF_LEN 8192
 #define GCDBZ_LBUF_LEN 8192*2
-#include "gcdb.h"
+#include <gclib/gcdb.h>
 #include <zlib.h>
 #include <stdio.h>
 
--- a/cdbfasta.cpp
+++ b/cdbfasta.cpp
@@ -2,10 +2,10 @@
 #include <fcntl.h>
 #include <string.h>
 #include <sys/stat.h>
-#include "GBase.h"
-#include "GArgs.h"
-#include "GHash.hh"
-#include "gcdb.h"
+#include <gclib/GBase.h>
+#include <gclib/GArgs.h>
+#include <gclib/GHash.hh>
+#include <gclib/gcdb.h>
 #ifdef ENABLE_COMPRESSION
 #include "gcdbz.h"
 #endif
@@ -741,7 +741,7 @@ int main(int argc, char **argv) {
      if (fastq) GError("Error: sorry, compression is not supported with fastq format\n");
      //TODO: use a better block compression/indexing scheme with virtual offsets, like bgzf
      //      -- this should take care of the fastq compression
-#ifdef COMPRESSION_ENABLED
+#ifdef ENABLE_COMPRESSION
      fdbsize=0;
      GCdbz cdbz(zf); // zlib interface
      recpos=cdbz.getZRecPos();
--- a/cdbyank.cpp
+++ b/cdbyank.cpp
@@ -1,6 +1,6 @@
-#include "GBase.h"
-#include "gcdb.h"
-#include "GArgs.h"
+#include <gclib/GBase.h>
+#include <gclib/gcdb.h>
+#include <gclib/GArgs.h>
 #include "ctype.h"
 #include <fcntl.h>
 #include <string.h>
