From: Barak Itkin Date: Sat, 5 May 2012 09:54:40 +0000 (+0300) Subject: Add a basic build system using GNU autotools X-Git-Tag: p2tc-0.1.0~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8b9fd106b928fefa180f1a0b06e15e660dcc422;p=poly2tri-c Add a basic build system using GNU autotools --- diff --git a/.gitignore b/.gitignore index b962ae6..a0ec01b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,19 @@ doxygen-doc +*.la +*.lo +*.a +*.o +/*.config +*Makefile +*Makefile.in +*.deps/ +/aclocal.m4 +/autom4te.cache +/build-aux +/config.cache +/config.h +/config.h.in +/config.log +/config.status +/configure +/stamp-h1 diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..4ba4069 --- /dev/null +++ b/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = p2t refine render bin diff --git a/bin/Makefile.am b/bin/Makefile.am new file mode 100644 index 0000000..e7c2a2a --- /dev/null +++ b/bin/Makefile.am @@ -0,0 +1,2 @@ +bin_PROGRAMS = poly2tri-c-test +poly2tri_c_test_SOURCES = main.c diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..ae35415 --- /dev/null +++ b/configure.ac @@ -0,0 +1,40 @@ +# Declare the package details +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 +# Initialize Automake with the following settings: +# Report all potential warnings and report all warnings as errors +AM_INIT_AUTOMAKE([foreign -Wall -Werror]) + +# Find a C compiler +AC_PROG_CC + +# Find a library make +AC_PROG_RANLIB + +# Find GLib support via pkg-config +PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28]) + +CFLAGS="$CFLAGS $GLIB_CFLAGS" +LDFLAGS="$LDFLAGS $GLIB_LIBS" +LIBS="$LIBS $GLIB_LIBS" + +# Output this configuration header file +AC_CONFIG_HEADERS([config.h]) + +# Output these files +AC_CONFIG_FILES([ + bin/Makefile \ + p2t/sweep/Makefile \ + p2t/common/Makefile \ + p2t/Makefile \ + render/Makefile \ + refine/Makefile \ + Makefile \ + ]) + +# Now really output +AC_OUTPUT diff --git a/p2t/Makefile.am b/p2t/Makefile.am new file mode 100644 index 0000000..fa1726e --- /dev/null +++ b/p2t/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = sweep common +lib_LIBRARIES = libp2t-c.a + +libp2t_c_a_LIBADD = common/libp2tcommon.a sweep/libp2tsweep.a +libp2t_c_a_SOURCES = diff --git a/p2t/common/Makefile.am b/p2t/common/Makefile.am new file mode 100644 index 0000000..8ad238a --- /dev/null +++ b/p2t/common/Makefile.am @@ -0,0 +1,2 @@ +noinst_LIBRARIES = libp2tcommon.a +libp2tcommon_a_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 new file mode 100644 index 0000000..a5c3701 --- /dev/null +++ b/p2t/sweep/Makefile.am @@ -0,0 +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 diff --git a/refine/Makefile.am b/refine/Makefile.am new file mode 100644 index 0000000..99341bb --- /dev/null +++ b/refine/Makefile.am @@ -0,0 +1,3 @@ +lib_LIBRARIES = libp2t-c-refine.a + +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 diff --git a/refine/utils.h b/refine/utils.h old mode 100755 new mode 100644 diff --git a/render/Makefile.am b/render/Makefile.am new file mode 100644 index 0000000..a035875 --- /dev/null +++ b/render/Makefile.am @@ -0,0 +1,3 @@ +lib_LIBRARIES = libp2t-c-render.a + +libp2t_c_render_a_SOURCES = mesh-render.c mesh-render.h svg-plot.c svg-plot.h