Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 11 Apr 2017 17:24:13 +0200
Description: Link against Debian packaged libsquid and remove
 duplicated functions from there
Forwarded: No (orphaned upstream)

--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -18,6 +18,7 @@
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS  = @LDFLAGS@
 DEFS     = @DEFS@
+PKG_CONFIG = @PKG_CONFIG@
 LIBS     = @LIBS@ -lm
 
 ## archiving command, and ranlib command if you need one.
@@ -42,9 +43,9 @@
 PVMPROGS  = @PVMPROGS@
 
 SHELL    = /bin/sh
-MYLIBS   = -lsquid
-MYLIBDIR = -L../squid
-MYINCDIR = -I../squid
+MYLIBS   = `$(PKG_CONFIG) --libs libsquid`
+MYLIBDIR = 
+MYINCDIR = `$(PKG_CONFIG) --cflags libsquid`
 
 PROGS = hmmalign\
 	hmmbuild\
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -17,7 +17,8 @@
 LDFLAGS   = @LDFLAGS@
 DEFS      = @DEFS@
 LIBS      = @LIBS@ -lm
-MYLIBS    = -lhmmer -lsquid
+PKG_CONFIG = @PKG_CONFIG@
+MYLIBS    = -lhmmer `$(PKG_CONFIG) --libs libsquid`
 
 # Configuration for optional pthreads multiprocessor support
 #
@@ -40,12 +41,12 @@
 #######
 
 .c.o:
-	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) ${CPPFLAGS} $(DEFS) -I../squid -I../src -c $<		
+	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) ${CPPFLAGS} $(DEFS) `$(PKG_CONFIG) --cflags libsquid` -I../src -c $<		
 
 all: 	$(SHIVA)
 
 $(SHIVA): @EXEC_DEPENDENCY@
-	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) ${LDFLAGS} $(DEFS) -o $@ -L../squid -L../src $@.o $(MYLIBS) $(PTHREAD_LIBS) $(LIBS)
+	$(CC) $(CFLAGS) $(PTHREAD_CFLAGS) ${LDFLAGS} $(DEFS) -o $@ -L../src $@.o $(MYLIBS) $(PTHREAD_LIBS) $(LIBS)
 
 #######
 ## `make check` actually runs the tests.
--- a/src/funcs.h
+++ b/src/funcs.h
@@ -181,7 +181,6 @@
 extern float Logp_cvec(float *cvec, int n, float *alpha);
 extern void  SampleDirichlet(float *alpha, int n, float *p);
 extern float SampleGamma(float alpha);
-extern void  SampleCountvector(float *p, int n, int c, float *cvec);
 extern float P_PvecGivenDirichlet(float *p, int n, float *alpha);
 
 /* from misc.c
--- a/src/mathsupport.c
+++ b/src/mathsupport.c
@@ -320,23 +320,6 @@
   return 0.0;
 }
 
-/* Function: SampleCountvector()
- * 
- * Purpose:  Given a probability vector p of dimensionality
- *           n, sample c counts and store them in cvec.
- *           cvec is n-dimensional and is alloced by the caller.
- */
-void
-SampleCountvector(float *p, int n, int c, float *cvec)
-{
-  int i;
-
-  FSet(cvec, n, 0.0);
-  for (i = 0; i < c; i++)
-    cvec[FChoose(p,n)] += 1.0;
-}
-
-
 
 /* Function: P_PvecGivenDirichlet()
  * 
--- a/configure
+++ b/configure
@@ -2597,11 +2597,11 @@
    yes) { echo "$as_me:$LINENO: configured for optional LFS, large file support" >&5
 echo "$as_me: configured for optional LFS, large file support" >&6;}
 	cat >>confdefs.h <<\_ACEOF
-#define _LARGEFILE_SOURCE 1
+#define _LARGEFILE_SOURCE_defined_in_biosquid 1
 _ACEOF
 
 	cat >>confdefs.h <<\_ACEOF
-#define _LARGEFILE64_SOURCE 1
+#define _LARGEFILE64_SOURCE_defined_in_biosquid 1
 _ACEOF
 
 	cat >>confdefs.h <<\_ACEOF
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -96,8 +96,6 @@
 
 /* --enable-lfs          Large File Summit (LFS) support for >2Gb files
  */
-#undef _LARGEFILE_SOURCE
-#undef _LARGEFILE64_SOURCE
 #undef _FILE_OFFSET_BITS
 
 /* --enable-pvm          Parallel Virtual Machine (PVM)
--- a/Makefile.in
+++ b/Makefile.in
@@ -87,7 +87,6 @@
 	  echo "If you really want to rebuild from source, move or delete the" ;\
 	  echo "binaries/ subdirectory."; \
 	else\
-	  (cd squid;     ${MAKE}; ${MAKE} module);\
 	  (cd src;       ${MAKE}; ${MAKE} module);\
 	  (cd testsuite; ${MAKE});\
 	fi
@@ -98,9 +97,6 @@
 check:	
 	(cd testsuite; make check)
 
-squid/libsquid.a:
-	(cd squid; make; make module)
-
 src/libhmmer.a: 
 	(cd src;   make; make module)
 
@@ -143,7 +139,6 @@
 #
 clean:
 	(cd src;       make clean)
-	(cd squid;     make clean)
 	(cd testsuite; make clean)
 	-rm -f *.o *~ Makefile.bak core TAGS gmon.out
 
@@ -156,7 +151,6 @@
 	-rm -f *.o *~ Makefile.bak core TAGS gmon.out
 	-rm Makefile
 	(cd src;       make distclean)
-	(cd squid;     make distclean)
 	(cd testsuite; make distclean)
 
 
@@ -165,7 +159,6 @@
 #
 binclean:
 	(cd src;       make binclean)
-	(cd squid;     make binclean)
 	(cd testsuite; make binclean)
 	-rm -f *.o *~ Makefile.bak core TAGS gmon.out
 	-rm config.log config.status
