1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
|
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 22 Jun 2016 16:27:46 +0200
Description: Add autoconf stuff to enable simple library creation
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,16 @@
+lib_LTLIBRARIES = libsmithwaterman.la
+
+libsmithwatermandir=$(includedir)/smithwaterman
+libsmithwaterman_HEADERS=BandedSmithWaterman.h IndelAllele.h LeftAlign.h Mosaik.h Repeats.h SmithWatermanGotoh.h convert.h
+libsmithwaterman_la_SOURCES = BandedSmithWaterman.cpp IndelAllele.cpp LeftAlign.cpp Repeats.cpp SmithWatermanGotoh.cpp
+libsmithwaterman_la_LDFLAGS = -version-info @LIB_VERSION@
+
+libsmithwaterman_la_CPPFLAGS = $(INCLUDES)
+
+bin_PROGRAMS = smithwaterman
+smithwaterman_SOURCES = smithwaterman.cpp
+smithwaterman_LDADD = libsmithwaterman.la -ldisorder
+
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA = libsmithwaterman.pc
+
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,61 @@
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT(smithwaterman, 0.0, erik.garrison@bc.edu)
+AC_CONFIG_HEADERS([config.h])
+
+AC_PREREQ(2.57)
+
+# Directory that contains install-sh and other auxiliary files
+AC_CONFIG_AUX_DIR([config])
+
+################################################################################
+# According to (http://www.mail-archive.com/autoconf@gnu.org/msg14232.html)
+# this macro should be after AC_INIT but before AM_INIT_AUTOMAKE
+################################################################################
+AC_CONFIG_MACRO_DIR(config)
+
+AM_INIT_AUTOMAKE([1.6 foreign dist-zip tar-ustar filename-length-max=299])
+
+LIB_VERSION=0:0
+
+AC_SUBST([VERSION])
+AC_SUBST([LIB_VERSION])
+
+AC_SUBST([VERSION])
+
+# Checks for programs.
+AC_PROG_LN_S
+AC_PROG_INSTALL
+AC_PROG_LIBTOOL
+
+################################################################################
+# calling AC_PROG_CXX resets CXXFLAGS, we use our own flags set in the
+# the AX_CXXFLAGS macro below.
+# So we cache the argument to configure
+# here in ARG_CXX_FLAGS (so that our macro does not override them)
+################################################################################
+ARG_CXX_FLAGS="$CXXFLAGS"
+AC_PROG_CXX
+
+#Ranlib handled by check for libtool
+CXXFLAGS="$ARG_CXX_FLAGS"
+AX_CXXFLAGS
+
+AC_SUBST(CXXFLAGS)
+
+CPPFLAGS="-I\$(top_srcdir) $CPPFLAGS"
+# Checks for libraries.
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([stdlib.h])
+
+AC_PROG_MAKE_SET
+
+AC_CONFIG_FILES([
+ Makefile
+ libsmithwaterman.pc
+ ])
+AC_OUTPUT
+
--- a/Makefile
+++ /dev/null
@@ -1,66 +0,0 @@
-# =========================================
-# MOSAIK Banded Smith-Waterman Makefile
-# (c) 2009 Michael Stromberg & Wan-Ping Lee
-# =========================================
-
-# ----------------------------------
-# define our source and object files
-# ----------------------------------
-SOURCES= smithwaterman.cpp BandedSmithWaterman.cpp SmithWatermanGotoh.cpp Repeats.cpp LeftAlign.cpp IndelAllele.cpp
-OBJECTS= $(SOURCES:.cpp=.o) disorder.o
-OBJECTS_NO_MAIN= disorder.o BandedSmithWaterman.o SmithWatermanGotoh.o Repeats.o LeftAlign.o IndelAllele.o
-
-# ----------------
-# compiler options
-# ----------------
-
-# Use ?= to allow overriding from the env or command-line
-CXX?= c++
-CXXFLAGS?= -O3
-OBJ?= sw.o
-
-# I don't think := is useful here, since there is nothing to expand
-LDFLAGS:= -Wl,-s
-#CXXFLAGS=-g
-EXE:= smithwaterman
-LIBS=
-
-all: $(EXE) $(OBJ)
-
-.PHONY: all
-
-libsw.a: smithwaterman.o BandedSmithWaterman.o SmithWatermanGotoh.o LeftAlign.o Repeats.o IndelAllele.o disorder.o
- ar rs $@ smithwaterman.o SmithWatermanGotoh.o disorder.o BandedSmithWaterman.o LeftAlign.o Repeats.o IndelAllele.o
-
-sw.o: BandedSmithWaterman.o SmithWatermanGotoh.o LeftAlign.o Repeats.o IndelAllele.o disorder.o
- ld -r $^ -o sw.o -L.
- #$(CXX) $(CFLAGS) -c -o smithwaterman.cpp $(OBJECTS_NO_MAIN) -I.
-
-### @$(CXX) $(LDFLAGS) $(CFLAGS) -o $@ $^ -I.
-$(EXE): smithwaterman.o BandedSmithWaterman.o SmithWatermanGotoh.o disorder.o LeftAlign.o Repeats.o IndelAllele.o
- $(CXX) $(CFLAGS) $^ -I. -o $@
-
-#smithwaterman: $(OBJECTS)
-# $(CXX) $(CXXFLAGS) -o $@ $< -I.
-
-smithwaterman.o: smithwaterman.cpp disorder.o
- $(CXX) $(CXXFLAGS) -c -o $@ smithwaterman.cpp -I.
-
-disorder.o: disorder.cpp disorder.h
- $(CXX) $(CXXFLAGS) -c -o $@ $< -I.
-BandedSmithWaterman.o: BandedSmithWaterman.cpp BandedSmithWaterman.h
- $(CXX) $(CXXFLAGS) -c -o $@ $< -I.
-SmithWatermanGotoh.o: SmithWatermanGotoh.cpp SmithWatermanGotoh.h disorder.o
- $(CXX) $(CXXFLAGS) -c -o $@ $< -I.
-Repeats.o: Repeats.cpp
- $(CXX) $(CXXFLAGS) -c -o $@ $< -I.
-LeftAlign.o: LeftAlign.cpp
- $(CXX) $(CXXFLAGS) -c -o $@ $< -I.
-IndelAllele.o: IndelAllele.cpp
- $(CXX) $(CXXFLAGS) -c -o $@ $< -I.
-
-.PHONY: clean
-
-clean:
- @echo "Cleaning up."
- @rm -f *.o $(PROGRAM) *~
--- /dev/null
+++ b/libsmithwaterman.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/smithwaterman
+
+
+Name: libsmithwaterman
+Version: @VERSION@
+Description: smith-waterman-gotoh alignment algorithm
+Libs: -L${libdir} -lsmithwaterman -ldisorder
+Cflags: -I${includedir}
|