2018-07-05 16:04:33 -04:00
|
|
|
# Common build configuration for TAME-based build systems
|
|
|
|
#
|
2023-01-17 23:09:25 -05:00
|
|
|
# Copyright (C) 2014-2023 Ryan Specialty, LLC.
|
2018-07-05 16:04:33 -04:00
|
|
|
#
|
|
|
|
# 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/>.
|
|
|
|
#
|
|
|
|
# To use, include this in your configure.ac:
|
|
|
|
# m4_define(`calc_root', path/to/calc/root)
|
|
|
|
# m4_include([path/to/calc/root/build-aux/m4/calcdsl.m4])
|
|
|
|
##
|
|
|
|
|
|
|
|
# We use an M4 value (calc_root, specifically); this allows us to cleanly
|
|
|
|
# reference it
|
|
|
|
m4_pattern_allow([defn])
|
|
|
|
|
|
|
|
# Initialize Automake, indicating that we use non-standard conventions
|
|
|
|
AC_CONFIG_AUX_DIR(m4_defn(`calc_root')/build-aux)
|
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
|
|
|
|
|
|
|
# Configuration values that can be provided via environment variables or the
|
|
|
|
# command line at configure- or build-time.
|
|
|
|
AC_ARG_VAR([JAVA], [The Java executable])
|
|
|
|
AC_ARG_VAR([ANT], [Apache Ant])
|
|
|
|
AC_ARG_VAR([DSLC_JAR], [Path to DSL Compiler JAR])
|
2018-10-08 23:27:02 -04:00
|
|
|
AC_ARG_VAR([TAME], [The TAME compiler])
|
2022-02-28 10:04:56 -05:00
|
|
|
AC_ARG_VAR([TAME_PARAMS], [key=value pairs for XSLT-based compiler global params])
|
2018-07-05 16:04:33 -04:00
|
|
|
AC_ARG_VAR([RATER_CLASSPATH], [DSL Compiler Saxon class path])
|
|
|
|
AC_ARG_VAR([PROGUI_TEST_PATH], [Path to JavaScript tests for Program UI])
|
|
|
|
|
tamed --report and runner status line (TAMED_TUI)
This is something that I've wanted to do for quite some time, but for good
reason, have been avoiding.
`tamed --report` is fairly basic right now, but allows you to see what each
of the runners are doing. This will be expanded further to gather data for
further analysis.
The thing that I was avoiding was a status line during the build to
summarize what the runners are doing, since it's nearly impossible to do so
from the build output with multiple runners. This will not only allow me to
debug more easily, but will keep the output plainly visible to developers at
all times in the hope that it can help them improve the build times
themselves in certain cases.
It is currently gated behind TAMED_TUI, since, while it works well overall,
it is imperfect, and will cause artifacts from build output partly
overwriting the status line, and may even occasionally clobber the PS1 by
erasing the line. This will be improved upon in the future; something is
better than nothing.
2022-01-19 11:43:10 -05:00
|
|
|
# This can also be set via the environment or during a make invocation
|
|
|
|
AC_ARG_VAR([TAMED_TUI], [Enable TUI (text UI) mode for tamed])
|
|
|
|
|
2018-07-05 16:04:33 -04:00
|
|
|
# Auto-discover Java and Ant paths
|
|
|
|
AC_CHECK_PROGS(JAVA, [java])
|
|
|
|
AC_CHECK_PROGS(ANT, [ant])
|
|
|
|
|
2018-11-28 15:55:49 -05:00
|
|
|
# Destination paths for local development
|
|
|
|
AC_CHECK_FILE(c1-import,
|
|
|
|
[AC_SUBST(C1_IMPORT_MAPDEST, c1-import/src/RSG/ImportBundle/Lib/interfaces/c1/contract)],
|
|
|
|
[AC_SUBST(C1_IMPORT_MAPDEST, lovullo/src/lib/c1/interfaces/c1/contract)])
|
|
|
|
|
2018-07-05 16:04:33 -04:00
|
|
|
AS_IF([test "$JAVA"],,
|
|
|
|
[AC_MSG_ERROR([missing java])])
|
|
|
|
AS_IF([test "$ANT"],,
|
|
|
|
[AC_MSG_ERROR([missing ant])])
|
|
|
|
|
|
|
|
# Automake runs before shell is available, thus the separate m4 variable
|
|
|
|
CALCROOT="m4_defn(`calc_root')"
|
|
|
|
|
2018-11-08 11:05:38 -05:00
|
|
|
# Default source paths for BC
|
|
|
|
test -n "$SRCPATHS" || SRCPATHS='common/ suppliers/ map/ ui/ rater/'
|
|
|
|
AC_MSG_NOTICE([using source paths: $SRCPATHS])
|
|
|
|
|
|
|
|
AC_SUBST([CALCROOT], [$CALCROOT])
|
|
|
|
AC_SUBST([SRCPATHS], [$SRCPATHS])
|
|
|
|
|
2018-07-05 16:04:33 -04:00
|
|
|
# Checks to ensure that dslc is built, and gives instructions on how to
|
|
|
|
# build it otherwise. We do not want to build that for them---that can be
|
|
|
|
# added to a bootstrap script, but isn't permissible in build scripts.
|
|
|
|
AS_IF([test ! "$DSLC_JAR"],
|
|
|
|
[AC_CHECK_FILE([$CALCROOT/src/dslc.jar],
|
|
|
|
[AC_SUBST([DSLC_JAR], [$CALCROOT/src/dslc.jar])],
|
|
|
|
[AC_MSG_ERROR(
|
|
|
|
[Please run `make` in $CALCROOT to build the DSL compiler.])])],
|
|
|
|
[])
|
|
|
|
|
|
|
|
# TAME is the compiler (whereas dslc invokes it, keeps things in memory, etc)
|
|
|
|
AS_IF([test ! "$TAME"],
|
2018-10-08 23:27:02 -04:00
|
|
|
[AC_CHECK_FILE([$CALCROOT/tame/bin/tame],
|
|
|
|
[AC_SUBST([TAME], [$CALCROOT/tame/bin/tame])],
|
2018-07-05 16:04:33 -04:00
|
|
|
[AC_MSG_ERROR(
|
|
|
|
[TAME not found])])],
|
|
|
|
[])
|
|
|
|
|
|
|
|
# @program@ in *.in files will be replaced with the program name provided by AC_INIT
|
|
|
|
AC_SUBST([program], AC_PACKAGE_NAME)
|
|
|
|
|
|
|
|
# Final files to be output by `configure'. The path before the colon is the
|
|
|
|
# destination name; after the colon is the source.
|
2018-10-08 23:27:02 -04:00
|
|
|
AC_CONFIG_FILES(Makefile:m4_defn(`calc_root')/build-aux/Makefile.in)
|
2018-07-05 16:04:33 -04:00
|
|
|
|
|
|
|
# Generate configure script
|
|
|
|
AC_OUTPUT
|