2013-12-21 01:03:59 -05:00
|
|
|
# For use by automake and autoconf
|
|
|
|
#
|
2015-12-22 10:23:20 -05:00
|
|
|
# Copyright (C) 2013, 2014, 2015 Free Software Foundation, Inc.
|
2013-12-21 01:03:59 -05:00
|
|
|
#
|
2013-12-22 09:37:21 -05:00
|
|
|
# This file is part of GNU ease.js.
|
2013-12-21 01:03:59 -05: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/>.
|
|
|
|
##
|
|
|
|
|
2014-06-08 01:00:30 -04:00
|
|
|
# version string is dynamically generated
|
2015-12-22 11:45:13 -05:00
|
|
|
m4_define([ver], m4_esyscmd(tools/vergen))
|
2014-06-08 01:00:30 -04:00
|
|
|
m4_if(ver, [], [m4_exit(1)])
|
|
|
|
|
2014-06-11 21:55:53 -04:00
|
|
|
AC_INIT([easejs], [ver], [bug-easejs@gnu.org])
|
2013-12-21 01:03:59 -05:00
|
|
|
AC_CONFIG_AUX_DIR([tools])
|
2013-12-21 23:31:45 -05:00
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
2013-12-21 01:03:59 -05:00
|
|
|
|
2014-06-08 01:00:30 -04:00
|
|
|
# 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.]),
|
|
|
|
[\.]))
|
2013-12-22 08:48:41 -05:00
|
|
|
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))
|
|
|
|
|
2013-12-21 23:31:45 -05:00
|
|
|
AC_PROG_MKDIR_P
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
# check for node, which is required for nearly every operation
|
2013-12-21 23:31:45 -05:00
|
|
|
AC_ARG_VAR([NODE], [The node.js interpreter])
|
2013-12-21 01:03:59 -05:00
|
|
|
AC_CHECK_PROGS(NODE, [node nodejs])
|
|
|
|
AM_CONDITIONAL(HAS_NODE, [test "$NODE"])
|
|
|
|
|
|
|
|
# certain portions of the build process require that node be installed (in the
|
|
|
|
# future, we may be able to allow alternatives, such as SpiderMonkey)
|
|
|
|
test "$NODE" || AC_MSG_WARN([
|
|
|
|
|
|
|
|
Node.js is not installed; certain make targets have been disabled.
|
|
|
|
])
|
|
|
|
|
|
|
|
# yes, this isn't necessarily a good practice, however the directory itself can
|
|
|
|
# be loaded and used without being built, so it's important that our resulting
|
|
|
|
# file includes exactly what is contained within the dir and is rebuilt if /any/
|
|
|
|
# of the files change
|
|
|
|
AC_MSG_CHECKING([for source js files])
|
2015-12-22 11:45:13 -05:00
|
|
|
SRC_JS_LIB="$(find $srcdir/lib/*.js | tr '\n' ' ' | LC_ALL=C sort )"
|
|
|
|
SRC_JS="$srcdir/index.js $SRC_JS_LIB"
|
2013-12-21 01:03:59 -05:00
|
|
|
AC_SUBST(SRC_JS)
|
|
|
|
if test -n "$SRC_JS_LIB"; then
|
|
|
|
AC_MSG_RESULT(ok)
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR(failed!)
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Java is used for Closure Compiler
|
2013-12-21 23:31:45 -05:00
|
|
|
AC_ARG_VAR([JAVA], [The Java executable])
|
|
|
|
AC_ARG_VAR([CCJAR], [The Clojure Compiler jar file])
|
2013-12-21 01:03:59 -05:00
|
|
|
AC_CHECK_PROGS(JAVA, [java])
|
|
|
|
AM_CONDITIONAL(HAS_JAVA, [test "$JAVA"])
|
|
|
|
|
|
|
|
ccjar=
|
2013-12-21 23:31:45 -05:00
|
|
|
AS_IF(test "$JAVA" -a ! "$CCJAR",
|
|
|
|
[AC_CHECK_FILE([$srcdir/tools/closure-compiler.jar],
|
|
|
|
[AC_SUBST([CCJAR], [$srcdir/tools/closure-compiler.jar])],
|
|
|
|
[AC_MSG_NOTICE([
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
If you wish perform minification of the combined source file, you must
|
2013-12-21 23:31:45 -05:00
|
|
|
download closure-compiler.jar into the tools sub-directory; it is
|
|
|
|
available here:
|
2013-12-21 01:03:59 -05:00
|
|
|
|
|
|
|
https://developers.google.com/closure/compiler/
|
|
|
|
|
2013-12-21 23:31:45 -05:00
|
|
|
If it is installed elsewhere on your system, specify its location with
|
|
|
|
the CCJAR environment variable.
|
|
|
|
])])], [])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAS_CCJAR, [test "$CCJAR"])
|
|
|
|
|
2015-12-22 22:52:04 -05:00
|
|
|
# dia used for documentation images
|
|
|
|
path_dia=dia
|
|
|
|
AC_ARG_WITH([dia],
|
|
|
|
[AS_HELP_STRING([--without-dia],
|
|
|
|
[disable support for documentation graphics])],
|
|
|
|
[],
|
|
|
|
[with_dia=yes])
|
|
|
|
|
|
|
|
AS_IF([test "$with_dia" != no],
|
|
|
|
[AC_CHECK_PROGS(DIA, [dia])
|
|
|
|
AS_IF([test "$DIA"],
|
|
|
|
[],
|
|
|
|
[AC_MSG_WARN([could not locate dia (--without-dia to disable)])])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL(HAS_DIA, [test "$DIA"])
|
|
|
|
|
2013-12-22 22:44:41 -05:00
|
|
|
# check for performance tests
|
|
|
|
AC_MSG_CHECKING([for performance tests])
|
2015-12-22 11:45:13 -05:00
|
|
|
PERF_TESTS=$( find $srcdir/test/perf -name 'perf-*.js' | tr '\n' ' ' | LC_ALL=C sort )
|
2013-12-22 22:44:41 -05:00
|
|
|
AC_SUBST(PERF_TESTS)
|
|
|
|
AS_IF([test "$PERF_TESTS"], [AC_MSG_RESULT(ok)], [AC_MSG_WARN(none found)])
|
|
|
|
|
2014-03-29 11:16:14 -04:00
|
|
|
AC_CONFIG_FILES([Makefile doc/Makefile package.json lib/version.js])
|
|
|
|
AC_CONFIG_FILES([test/runner], [chmod +x test/runner])
|
|
|
|
AC_CONFIG_FILES([test/perf/runner], [chmod +x test/perf/runner])
|
|
|
|
|
2013-12-21 01:03:59 -05:00
|
|
|
AC_OUTPUT
|