Include Henry's out-of-memory check.
[samtools.git] / debian / patches / use-shlib
diff --git a/debian/patches/use-shlib b/debian/patches/use-shlib
new file mode 100644 (file)
index 0000000..e747a11
--- /dev/null
@@ -0,0 +1,38 @@
+Index: samtools-0.1.17/Makefile
+===================================================================
+--- samtools-0.1.17.orig/Makefile      2011-07-25 21:00:44.145494440 -0700
++++ samtools-0.1.17/Makefile   2011-07-25 21:09:46.265494761 -0700
+@@ -1,5 +1,5 @@
+ CC=                   gcc
+-CFLAGS=               -g -Wall -O2 #-m64 #-arch ppc
++CFLAGS=               -g -Wall -O2 -fPIC #-m64 #-arch ppc
+ DFLAGS=               -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
+ KNETFILE_O=   knetfile.o
+ LOBJS=                bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o \
+@@ -35,13 +35,13 @@
+ .PHONY:all lib clean cleanlocal
+ .PHONY:all-recur lib-recur clean-recur cleanlocal-recur install-recur
+-lib:libbam.a
++lib:libbam.so.1
+ libbam.a:$(LOBJS)
+               $(AR) -csru $@ $(LOBJS)
+ samtools:lib-recur $(AOBJS)
+-              $(CC) $(CFLAGS) -o $@ $(AOBJS) -Lbcftools $(LIBPATH) libbam.a -lbcf $(LIBCURSES) -lm -lz
++              $(CC) $(CFLAGS) -o $@ $(AOBJS) -Lbcftools $(LIBPATH) -L. -lbam -lbcf $(LIBCURSES) -lm -lz
+ razip:razip.o razf.o $(KNETFILE_O)
+               $(CC) $(CFLAGS) -o $@ razf.o razip.o $(KNETFILE_O) -lz
+@@ -75,8 +75,9 @@
+ libbam.1.dylib-local:$(LOBJS)
+               libtool -dynamic $(LOBJS) -o libbam.1.dylib -lc -lz
+-libbam.so.1-local:$(LOBJS)
++libbam.so.1:$(LOBJS)
+               $(CC) -shared -Wl,-soname,libbam.so -o libbam.so.1 $(LOBJS) -lc -lz
++              ln -s $@ libbam.so
+ dylib:
+               @$(MAKE) cleanlocal; \