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

--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
 GCLDIR := ./gclib
-SEARCHDIRS := -I${GCLDIR}
+PKG_CONFIG ?= pkg-config
+SEARCHDIRS := `$(PKG_CONFIG) --cflags libgclib`
 # Use the correct compiler (CXX, not CC) and respect the environment
 # by using ?=
 CXX    ?= g++
@@ -43,6 +44,7 @@ LINKER    := ${CXX}
 #LDFLAGS = 
 #uncomment this when ENABLE_COMPRESSION
 LDFLAGS    := -lz $(LDFLAGS)
+LIBS      = `$(PKG_CONFIG) --libs libgclib`
 
 .PHONY : all
 all:    cdbfasta cdbyank 
@@ -50,11 +52,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>
