1
0
Fork 0

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.
master
Mike Gerwitz 2017-08-28 12:58:38 -04:00
parent 985819c31b
commit c92e979000
3 changed files with 46 additions and 4 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ configure
Makefile.in
# generated by configure
bin/server
src/version.js
/config.*
Makefile

32
bin/server.in 100644
View File

@ -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 "$@"

View File

@ -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