From: Barak Itkin Date: Sat, 5 May 2012 14:32:17 +0000 (+0300) Subject: Use libtool to build and configure libraries X-Git-Tag: p2tc-0.1.0~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8067bca32196e15c9a2ee0b15ae8b6c6032992ae;p=poly2tri-c Use libtool to build and configure libraries --- diff --git a/.gitignore b/.gitignore index a0ec01b..afa137a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ doxygen-doc *Makefile *Makefile.in *.deps/ +*.libs/ /aclocal.m4 /autom4te.cache /build-aux @@ -16,4 +17,5 @@ doxygen-doc /config.log /config.status /configure +/libtool /stamp-h1 diff --git a/Makefile.am b/Makefile.am index 4ba4069..2077ca0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,3 @@ SUBDIRS = p2t refine render bin + +ACLOCAL_AMFLAGS = -I m4 diff --git a/bin/Makefile.am b/bin/Makefile.am index e7c2a2a..e580fc6 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -1,2 +1,3 @@ -bin_PROGRAMS = poly2tri-c-test -poly2tri_c_test_SOURCES = main.c +bin_PROGRAMS = p2tc-test +p2tc_test_SOURCES = main.c +p2tc_test_LDADD = ../p2t/libp2tc.la ../refine/libp2tc-refine.la ../render/libp2tc-render.la diff --git a/configure.ac b/configure.ac index ae35415..045c94f 100644 --- a/configure.ac +++ b/configure.ac @@ -4,16 +4,25 @@ AC_INIT([poly2tri-c], [0.9], [lightningismyname@gmail.com]) # Output the auxilary build scripts to a subdirectory AC_CONFIG_AUX_DIR([build-aux]) -# Relax some of the GNU requirements +# Tell autoconf where to look for macros +AC_CONFIG_MACRO_DIR([m4macros]) + # Initialize Automake with the following settings: +# Relax some of the GNU requirements # Report all potential warnings and report all warnings as errors AM_INIT_AUTOMAKE([foreign -Wall -Werror]) +# Initialize libtool +LT_INIT + # Find a C compiler AC_PROG_CC -# Find a library make -AC_PROG_RANLIB +# Find the standard math functions +# Taken from http://www.flameeyes.eu/autotools-mythbuster/autoconf/finding.html +AC_SEARCH_LIBS([log10], [m], [], [ + AC_MSG_ERROR([unable to find the log10() function]) +]) # Find GLib support via pkg-config PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28]) diff --git a/m4macros/.gitignore b/m4macros/.gitignore new file mode 100644 index 0000000..464ba5c --- /dev/null +++ b/m4macros/.gitignore @@ -0,0 +1,5 @@ +libtool.m4 +lt~obsolete.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 diff --git a/p2t/Makefile.am b/p2t/Makefile.am index fa1726e..3d41d82 100644 --- a/p2t/Makefile.am +++ b/p2t/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = sweep common -lib_LIBRARIES = libp2t-c.a -libp2t_c_a_LIBADD = common/libp2tcommon.a sweep/libp2tsweep.a -libp2t_c_a_SOURCES = +lib_LTLIBRARIES = libp2tc.la + +libp2tc_la_LIBADD = common/libp2tc-common.la sweep/libp2tc-sweep.la +libp2tc_la_SOURCES = diff --git a/p2t/common/Makefile.am b/p2t/common/Makefile.am index 8ad238a..1b629ea 100644 --- a/p2t/common/Makefile.am +++ b/p2t/common/Makefile.am @@ -1,2 +1,2 @@ -noinst_LIBRARIES = libp2tcommon.a -libp2tcommon_a_SOURCES = cutils.h poly2tri-private.h shapes.c shapes.h utils.c utils.h +noinst_LTLIBRARIES = libp2tc-common.la +libp2tc_common_la_SOURCES = cutils.h poly2tri-private.h shapes.c shapes.h utils.c utils.h diff --git a/p2t/sweep/Makefile.am b/p2t/sweep/Makefile.am index a5c3701..7fb581e 100644 --- a/p2t/sweep/Makefile.am +++ b/p2t/sweep/Makefile.am @@ -1,2 +1,2 @@ -noinst_LIBRARIES = libp2tsweep.a -libp2tsweep_a_SOURCES = advancing_front.c advancing_front.h cdt.c cdt.h sweep.c sweep_context.c sweep_context.h sweep.h +noinst_LTLIBRARIES = libp2tc-sweep.la +libp2tc_sweep_la_SOURCES = advancing_front.c advancing_front.h cdt.c cdt.h sweep.c sweep_context.c sweep_context.h sweep.h diff --git a/refine/Makefile.am b/refine/Makefile.am index 99341bb..a087eb8 100644 --- a/refine/Makefile.am +++ b/refine/Makefile.am @@ -1,3 +1,3 @@ -lib_LIBRARIES = libp2t-c-refine.a +lib_LTLIBRARIES = libp2tc-refine.la -libp2t_c_refine_a_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 math.c math.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 +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 math.c math.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 a035875..2c259a0 100644 --- a/render/Makefile.am +++ b/render/Makefile.am @@ -1,3 +1,3 @@ -lib_LIBRARIES = libp2t-c-render.a +lib_LTLIBRARIES = libp2tc-render.la -libp2t_c_render_a_SOURCES = mesh-render.c mesh-render.h svg-plot.c svg-plot.h +libp2tc_render_la_SOURCES = mesh-render.c mesh-render.h svg-plot.c svg-plot.h