Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-01-27 10:59:36 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2017-01-27 11:08:39 -0500
commitaf7813e6050b165f095734ea3a8af06383ce0207 (patch)
tree4efbd55ebf7bd3461a1442803a75feccc63bdc0a /configure.ac
parent7ee9e11337edc3c1159fa38337e099a8b4f70bd6 (diff)
downloadliza-af7813e6050b165f095734ea3a8af06383ce0207.tar.gz
liza-af7813e6050b165f095734ea3a8af06383ce0207.tar.bz2
liza-af7813e6050b165f095734ea3a8af06383ce0207.zip
Use node --harmony-destructuring when available
In newer versions of node, this flag goes away and it is enabled by default. * Makefile.am (test): Add NODE_DESTRUCTURE to mocha invocation. * configure.ac (NODE, NODE_DESTRUCTURE): Add variables. DEV-2296
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 12 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index dde97cd..55fc050 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,18 @@ 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([NODE], [The node.js interpreter])
+AC_CHECK_PROGS(NODE, [node nodejs])
+
+test -n "$NODE" || AC_MSG_ERROR([missing Node.js])
+
+# only needed for older versions of Node
+AC_MSG_CHECKING([node --harmony_destructuring])
+AS_IF([node --harmony_destructuring >/dev/null 2>/dev/null],
+ [AC_MSG_RESULT(available)
+ AC_SUBST([NODE_DESTRUCTURE], [--harmony-destructuring])],
+ [AC_MSG_RESULT(no)])
+
# generate files from their *.in counterparts
AC_CONFIG_FILES([Makefile doc/Makefile package.json src/version.js])
AC_OUTPUT