Author: Andreas Tille <tille@debian.org>
Last-Update: Thu, 18 Apr 2019 12:54:42 +0200
Descriptions: Build proper libraries via automake

Index: libgclib/Makefile.am
===================================================================
--- /dev/null
+++ libgclib/Makefile.am
@@ -0,0 +1,38 @@
+lib_LTLIBRARIES  = libgclib.la
+
+libgclibdir=$(includedir)
+libgclib_HEADERS= *.h *.hh
+libgclib_la_SOURCES =  codons.cpp \
+                       GAlnExtend.cpp \
+                       GapAssem.cpp \
+                       GArgs.cpp \
+                       GBase.cpp \
+                       gcdb.cpp \
+                       GCdbYank.cpp \
+                       gdna.cpp \
+                       GFaSeqGet.cpp \
+                       GFastaIndex.cpp \
+                       gff.cpp \
+                       gsocket.cpp \
+                       gstopwatch.cpp \
+                       GStr.cpp \
+                       GThreads.cpp
+
+#                       gdimg.cpp # Not build by upstream Makefile
+#				 # Would introduce unneeded dependency from libgd-dev
+#                       GBam.cpp # is not build by upstream Makefile
+#				 # Would need bam.h / sam.h
+#                       gtest.cpp # Seems to be just a test (FIXME: create autopkgtest from it)
+
+
+libgclib_la_LDFLAGS = -version-info @LIB_VERSION@ -lpthread
+
+libgclib_la_CPPFLAGS = $(INCLUDES)
+
+pkgconfigdir=$(libdir)/pkgconfig
+pkgconfig_DATA = libgclib.pc
+
+# FIXME: Build mdtest to properly test the lib.  The code below does not work
+mdtest_SOURCES = mdtest.cpp libgclib.a
+mdtest_LDADD = libgclib.la
+bin_PROGRAMS = mdtest
Index: libgclib/libgclib.pc.in
===================================================================
--- /dev/null
+++ libgclib/libgclib.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+
+Name: libgclib
+Version: @VERSION@
+Description: Genomic C(++) library of reusable code for bioinformatics projects
+Libs: -L${libdir} -lgclib
+Cflags: -I${includedir}
Index: libgclib/configure.ac
===================================================================
--- /dev/null
+++ libgclib/configure.ac
@@ -0,0 +1,61 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT(gclib, 1, geo.pertea@gmail.com)
+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=2: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
+	libgclib.pc
+	])
+AC_OUTPUT
+
