Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2019-11-14 16:43:07 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2019-11-18 14:05:47 -0500
commitfd1a5837ba2a9107ae06eb596b735e5cb9839c76 (patch)
treef477423c1ef66b9b21c3789948dff407675cd8c4 /tamer/configure.ac
parentd9ecbd4e2c8c1b005c78123dd8127439e2c05749 (diff)
downloadtame-fd1a5837ba2a9107ae06eb596b735e5cb9839c76.tar.gz
tame-fd1a5837ba2a9107ae06eb596b735e5cb9839c76.tar.bz2
tame-fd1a5837ba2a9107ae06eb596b735e5cb9839c76.zip
TAMER: Initial commit
Diffstat (limited to 'tamer/configure.ac')
-rw-r--r--tamer/configure.ac58
1 files changed, 58 insertions, 0 deletions
diff --git a/tamer/configure.ac b/tamer/configure.ac
new file mode 100644
index 0000000..0fc7bf4
--- /dev/null
+++ b/tamer/configure.ac
@@ -0,0 +1,58 @@
+# For use by automake and autoconf
+#
+# Copyright (C) 2014-2019 Ryan Specialty Group, LLC.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+##
+
+m4_include([build-aux/m4/ax_compare_version.m4])
+
+# version string is dynamically generated
+m4_define([ver], m4_esyscmd(build-aux/vergen))
+m4_if(ver, [], [m4_exit(1)])
+
+AC_INIT([tame], [ver], [dev@lovullo.com])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_INIT_AUTOMAKE([foreign])
+
+# provide more granular version numbers based on the version string, using
+# the format MAJOR.MINOR.REV[-SUFFIX], where SUFFIX can itself contain
+# dashes (and often will)
+m4_define([ver_split],
+ m4_split(
+ patsubst(AC_PACKAGE_VERSION, [^\([^-]+\)-], [\1.]),
+ [\.]))
+AC_SUBST(MAJOR, m4_argn(1, ver_split))
+AC_SUBST(MINOR, m4_argn(2, ver_split))
+AC_SUBST(REV, m4_argn(3, ver_split))
+AC_SUBST(SUFFIX, m4_argn(4, ver_split))
+
+AC_ARG_VAR([CARGO], [Rust Cargo executable])
+AC_CHECK_PROGS(CARGO, [cargo])
+
+test -n "$CARGO" || AC_MSG_ERROR([cargo not found])
+
+rustc_ver_req=1.39.0
+
+AC_CHECK_PROGS(RUSTC, [rustc])
+AC_MSG_CHECKING([rustc version >= $rustc_ver_req])
+rustc_version=$("$RUSTC" --version | cut -d' ' -f2)
+AX_COMPARE_VERSION([$rustc_version], [ge], [$rustc_ver_req],
+ [AC_MSG_RESULT([yes ($rustc_version)])],
+ [AC_MSG_ERROR([no ($rustc_version)])])
+
+AC_CONFIG_FILES([Makefile])
+
+AC_OUTPUT
+