1 # Bump on major changes to the library which should not even be
2 # compatiable with earlier versions
3 m4_define([p2tc_major_version], [0])
5 # Bump on new features and interface changes (feature releases)
6 m4_define([p2tc_minor_version], [0])
8 # Bump on revisions that do not break the interface (bug-fix releases)
9 m4_define([p2tc_micro_version], [0])
11 # A version string containing all three version numbers
12 m4_define([p2tc_real_version],
13 [p2tc_major_version.p2tc_minor_version.p2tc_micro_version])
14 m4_define([p2tc_version], [p2tc_real_version])
16 # The version number used when linking with -llibpoly2tri-c-X.Y
17 m4_define([p2tc_api_version], [p2tc_major_version.p2tc_minor_version])
19 # The version number of the currently implemented interface (bump on
20 # every interface change)
21 m4_define([lt_current], [0])
23 # The revision number of the current interface (reset to 0 on every
25 m4_define([lt_revision], [0])
27 # Number of interfaces implemented minus one. The library should
28 # support all interfaces between current minus age and current.
29 # Increment by 1 on every new feature addition
30 # Reset to 0 if backwards compatiability is broken
31 m4_define([lt_age], [0])
33 # Declare the package details
34 AC_INIT([poly2tri-c],[p2tc_real_version],[lightningismyname@gmail.com])
36 P2TC_MAJOR_VERSION=p2tc_major_version
37 P2TC_MINOR_VERSION=p2tc_minor_version
38 P2TC_MICRO_VERSION=p2tc_micro_version
39 P2TC_VERSION=p2tc_version
40 P2TC_REAL_VERSION=p2tc_real_version
41 P2TC_API_VERSION=p2tc_api_version
42 AC_SUBST(P2TC_MAJOR_VERSION)
43 AC_SUBST(P2TC_MINOR_VERSION)
44 AC_SUBST(P2TC_MICRO_VERSION)
45 AC_SUBST(P2TC_VERSION)
46 AC_SUBST(P2TC_REAL_VERSION)
47 AC_SUBST(P2TC_API_VERSION)
49 P2TC_RELEASE=p2tc_api_version
50 AC_SUBST(P2TC_RELEASE)
52 P2TC_LIBRARY_VERSION="lt_current:lt_revision:lt_age"
53 AC_SUBST(P2TC_LIBRARY_VERSION)
55 # Output the auxilary build scripts to a subdirectory
56 AC_CONFIG_AUX_DIR([build-aux])
58 # Tell autoconf where to look for macros
59 AC_CONFIG_MACRO_DIR([m4])
61 # Initialize Automake with the following settings:
62 # Relax some of the GNU requirements
63 # Report all potential warnings and report all warnings as errors
64 AM_INIT_AUTOMAKE([foreign -Wall -Werror])
66 # Enable silent rules is available
67 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
69 # Define maintainer mode
72 # On automake 1.12 we will need to call AM_PROG_AR
73 # However, on some old versions it does not exist, so use and ifdef
74 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
82 # Finding a function which may be built-in in GCC is known to fail when using
83 # -Werror, so we will only add that option afterwards. For more information, see
84 # the discussion at http://lists.gnu.org/archive/html/bug-autoconf/2010-01/msg00031.html
86 # Pedantic errors please
87 CFLAGS="$CFLAGS -Wall -ansi -pedantic"
89 # Find the standard math functions
90 # Taken from http://www.flameeyes.eu/autotools-mythbuster/autoconf/finding.html
91 AC_CHECK_HEADERS([math.h])
92 AC_SEARCH_LIBS([log10], [m], [], [
93 AC_MSG_ERROR([unable to find the log10() function])
96 # Warnings as errors please
97 CFLAGS="$CFLAGS -Werror"
99 # Find GLib support via pkg-config
100 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
102 CFLAGS="$CFLAGS $GLIB_CFLAGS"
103 LDFLAGS="$LDFLAGS $GLIB_LIBS"
104 LIBS="$LIBS $GLIB_LIBS"
106 # Allow building with debugging symbols
107 AC_MSG_CHECKING([whether to turn on debugging])
109 AS_HELP_STRING([--enable-debug],[turn on debugging (default=no)]),
110 if eval "test x$enable_debug = xyes"; then
114 if test -n "$DEBUGFLAG"; then
116 CFLAGS="$DEBUGFLAG $CFLAGS"
121 # Allow forcing a validation of the CDT after each refinement step
122 AC_MSG_CHECKING([whether to enable CDT validation during refinement])
123 AC_ARG_ENABLE(cdt-validation,
124 AS_HELP_STRING([--enable-cdt-validation],[turn on CDT validation during refinement (WARNING: SLOW!, default=no)]),
125 if eval "test x$enable_cdt_validation = xyes"; then
126 P2TR_ENABLE_CDT_VALIDATION="TRUE"
129 if test -n "$P2TR_ENABLE_CDT_VALIDATION"; then
130 CDTVFLAG="-DP2TR_CDT_VALIDATE=TRUE"
133 CDTVFLAG="-DP2TR_CDT_VALIDATE=FALSE"
137 CFLAGS="$CDTVFLAG $CFLAGS"
139 # Output this configuration header file
140 AC_CONFIG_HEADERS([config.h])
146 poly2tri-c/Makefile \
147 poly2tri-c/p2t/sweep/Makefile \
148 poly2tri-c/p2t/common/Makefile \
149 poly2tri-c/p2t/Makefile \
150 poly2tri-c/render/Makefile \
151 poly2tri-c/refine/Makefile \