Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-08-28 12:58:38 -0400
committerMike Gerwitz <gerwitzm@lovullo.com>2017-08-29 14:56:13 -0400
commitc92e9790001a1a8a6d4964bbd13ef2557e72cb79 (patch)
tree8e428375209ca7cb136d4cf540674aa3dfb256bb
parent985819c31ba8151be9f572a955b8e6e31432911e (diff)
downloadliza-c92e9790001a1a8a6d4964bbd13ef2557e72cb79.tar.gz
liza-c92e9790001a1a8a6d4964bbd13ef2557e72cb79.tar.bz2
liza-c92e9790001a1a8a6d4964bbd13ef2557e72cb79.zip
Add bin/server to invoke server using configure'd node
* .gitignore (bin/server): Ignore generated file. * bin/server.in: Add script. * configure.ac: (NODE): Correct description (capitalize `Node'). (NODE_FLAGS): Add arg var. (NODE_DESTRUCTURE): Use determined node path for test. (AUTOGENERATED): Add substitution. (AC_CONFIG_FILES): Add bin/server. Make it executable.
-rw-r--r--.gitignore1
-rw-r--r--bin/server.in32
-rw-r--r--configure.ac17
3 files changed, 46 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
index 89c1bde..b7e2a1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ configure
Makefile.in
# generated by configure
+bin/server
src/version.js
/config.*
Makefile
diff --git a/bin/server.in b/bin/server.in
new file mode 100644
index 0000000..9ecc856
--- /dev/null
+++ b/bin/server.in
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Start Liza Server using Node.js executable determined at configure-time
+#
+# Copyright (C) 2017 R-T Specialty, LLC.
+#
+# This file is part of liza.
+#
+# 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/>.
+#
+# In addition to the configure-time NODE_FLAGS, the NODE_FLAGS environment
+# variable can be used to add additional arguments to this script.
+# WARNING: NODE_FLAGS arguments provided via environment varialbes are _not_
+# escaped, so be mindful of word expansion!
+#
+# @AUTOGENERATED@
+##
+
+cd "$( dirname $( readlink -f "$0" ) )"
+
+"@NODE@" @NODE_FLAGS@ $NODE_FLAGS server.js "$@"
+
diff --git a/configure.ac b/configure.ac
index cc58591..40164e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,8 @@ 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_ARG_VAR([NODE], [The Node.js interpreter])
+AC_ARG_VAR([NODE_FLAGS], [Arguments to Node.js for Liza Server (bin/server)])
AC_CHECK_PROGS(NODE, [node nodejs])
test -n "$NODE" || AC_MSG_ERROR([missing Node.js])
@@ -43,12 +44,15 @@ AC_CHECK_PROGS(TWOPI, [twopi])
AM_CONDITIONAL(HAS_TWOPI, [test "$TWOPI"])
# 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_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)])
+# include above check(s) in NODE_FLAGS
+NODE_FLAGS="$NODE_FLAGS $NODE_DESTRUCTURE"
+
set_devnotes='@set DEVNOTES'
AC_ARG_ENABLE(
[devnotes],
@@ -68,8 +72,13 @@ AC_ARG_WITH(
AC_SUBST([SET_SRCURI], [$set_srcuri])
+AC_SUBST([AUTOGENERATED],
+ ["THIS FILE IS AUTOGENERATED! DO NOT MODIFY! See *.in."])
+
# generate files from their *.in counterparts
AC_CONFIG_FILES([Makefile package.json
doc/Makefile doc/config.texi
- src/version.js])
+ src/version.js
+ bin/server],
+ [chmod +x bin/server])
AC_OUTPUT