From: Barak Itkin Date: Fri, 1 Jun 2012 15:03:39 +0000 (+0300) Subject: Add version numbering, pkg-config support and combine all output libs X-Git-Tag: p2tc-0.1.0~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8298628e43f5ce13a12782cc0d1713b8d192a7db;p=poly2tri-c Add version numbering, pkg-config support and combine all output libs --- diff --git a/.gitignore b/.gitignore index 035ad0d..5f7c2c2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ doxygen-doc *.lo *.a *.o +*.pc /*.config *Makefile *Makefile.in diff --git a/Makefile.am b/Makefile.am index 2077ca0..0ddc800 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,14 @@ SUBDIRS = p2t refine render bin ACLOCAL_AMFLAGS = -I m4 + +AM_LDFLAGS = -version-info $(P2TC_LIBRARY_VERSION) + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = poly2tri-c.pc + +lib_LTLIBRARIES = libpoly2tri-c-@P2TC_API_VERSION@.la + +libpoly2tri_c_@P2TC_API_VERSION@_la_LIBADD = p2t/libp2tc.la refine/libp2tc-refine.la render/libp2tc-render.la +libpoly2tri_c_@P2TC_API_VERSION@_la_SOURCES = + diff --git a/configure.ac b/configure.ac index 014de59..bb949c1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,56 @@ +# Bump on major changes to the library which should not even be +# compatiable with earlier versions +m4_define([p2tc_major_version], [0]) + +# Bump on new features and interface changes (feature releases) +m4_define([p2tc_minor_version], [0]) + +# Bump on revisions that do not break the interface (bug-fix releases) +m4_define([p2tc_micro_version], [0]) + +# A version string containing all three version numbers +m4_define([p2tc_real_version], + [p2tc_major_version.p2tc_minor_version.p2tc_micro_version]) +m4_define([p2tc_version], [p2tc_real_version]) + +# The version number used when linking with -llibpoly2tri-c-X.Y +m4_define([p2tc_api_version], [p2tc_major_version.p2tc_minor_version]) + +# The version number of the currently implemented interface (bump on +# every interface change) +m4_define([lt_current], [0]) + +# The revision number of the current interface (reset to 0 on every +# interface change) +m4_define([lt_revision], [0]) + +# Number of interfaces implemented minus one. The library should +# support all interfaces between current minus age and current. +# Increment by 1 on every new feature addition +# Reset to 0 if backwards compatiability is broken +m4_define([lt_age], [0]) + # Declare the package details -AC_INIT([poly2tri-c], [0.9], [lightningismyname@gmail.com]) +AC_INIT([poly2tri-c], p2tc_real_version, [lightningismyname@gmail.com]) + +P2TC_MAJOR_VERSION=p2tc_major_version +P2TC_MINOR_VERSION=p2tc_minor_version +P2TC_MICRO_VERSION=p2tc_micro_version +P2TC_VERSION=p2tc_version +P2TC_REAL_VERSION=p2tc_real_version +P2TC_API_VERSION=p2tc_api_version +AC_SUBST(P2TC_MAJOR_VERSION) +AC_SUBST(P2TC_MINOR_VERSION) +AC_SUBST(P2TC_MICRO_VERSION) +AC_SUBST(P2TC_VERSION) +AC_SUBST(P2TC_REAL_VERSION) +AC_SUBST(P2TC_API_VERSION) + +P2TC_RELEASE=p2tc_api_version +AC_SUBST(P2TC_RELEASE) + +P2TC_LIBRARY_VERSION="lt_current:lt_revision:lt_age" +AC_SUBST(P2TC_LIBRARY_VERSION) # Output the auxilary build scripts to a subdirectory AC_CONFIG_AUX_DIR([build-aux]) @@ -53,6 +104,7 @@ AC_CONFIG_HEADERS([config.h]) # Output these files AC_CONFIG_FILES([ + poly2tri-c.pc \ bin/Makefile \ p2t/sweep/Makefile \ p2t/common/Makefile \ diff --git a/p2t/Makefile.am b/p2t/Makefile.am index 3d41d82..c635a68 100644 --- a/p2t/Makefile.am +++ b/p2t/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = sweep common -lib_LTLIBRARIES = libp2tc.la +noinst_LTLIBRARIES = libp2tc.la libp2tc_la_LIBADD = common/libp2tc-common.la sweep/libp2tc-sweep.la libp2tc_la_SOURCES = diff --git a/poly2tri-c.pc.in b/poly2tri-c.pc.in new file mode 100644 index 0000000..9642470 --- /dev/null +++ b/poly2tri-c.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Poly2tri-C +Description: A 2D constrained Delaunay triangulation and Delaunay refinement library +Version: @P2TC_REAL_VERSION@ +Requires: glib-2.0 +Libs: -L${libdir} -l@PACKAGE_NAME@-@P2TC_API_VERSION@ +Cflags: -I${includedir}/@PACKAGE_NAME@-@P2TC_API_VERSION@ diff --git a/refine/Makefile.am b/refine/Makefile.am index 1fc044e..4f96478 100644 --- a/refine/Makefile.am +++ b/refine/Makefile.am @@ -1,3 +1,3 @@ -lib_LTLIBRARIES = libp2tc-refine.la +noinst_LTLIBRARIES = libp2tc-refine.la libp2tc_refine_la_SOURCES = bounded-line.c bounded-line.h cdt.c cdt.h circle.c circle.h cluster.c cluster.h delaunay-terminator.c delaunay-terminator.h edge.c edge.h line.c line.h rmath.c rmath.h mesh.c mesh.h point.c point.h pslg.c pslg.h refine.h triangle.c triangle.h triangulation.h utils.c utils.h vector2.c vector2.h visibility.c visibility.h diff --git a/render/Makefile.am b/render/Makefile.am index 2c259a0..6aa8fa2 100644 --- a/render/Makefile.am +++ b/render/Makefile.am @@ -1,3 +1,3 @@ -lib_LTLIBRARIES = libp2tc-render.la +noinst_LTLIBRARIES = libp2tc-render.la libp2tc_render_la_SOURCES = mesh-render.c mesh-render.h svg-plot.c svg-plot.h