Add Makefile.am for bootstrapping

This provides a very basic Automake+Autoconf configuration.  At the moment
it handles only bootstrapping, but at least allows for the user to enter
`make' and have something useful happen.

* .gitignore: New file.
* Makefile.am: New file.
* autogen.sh: New file.
* bootstrap/Bootstrap.js (_error): Re-throw error.
* bootstrap/bootstrap.js: Exit with non-zero status code on failure.
* configure.ac: New file.
master
Mike Gerwitz 2018-09-10 23:04:53 -04:00
parent aae726b7a6
commit ba93b7c034
Signed by: mikegerwitz
GPG Key ID: 8C917B7F5DC51BA2
6 changed files with 133 additions and 3 deletions

14
.gitignore vendored 100644
View File

@ -0,0 +1,14 @@
# autotools- and configure-generated
/aclocal.m4
/Makefile.in
/Makefile
/*.cache/
/configure
/config.*
# should be added using autoreconf -i
/build-aux/install-sh
/build-aux/missing
/build-aux/mdate-sh
/build-aux/texinfo.tex

40
Makefile.am 100644
View File

@ -0,0 +1,40 @@
## Ulambda Makefile.am
#
# Copyright (C) 2018 Mike Gerwitz
#
# This file is part of Ulambda Scheme.
#
# Ulambda Scheme 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/>.
##
path_build_aux = $(top_srcdir)/build_aux
path_bootstrap = $(top_srcdir)/bootstrap
.PHONY: bootstrap
all: bootstrap
# will force a reconfigure (for version data) if in the git repo
reconf:
test ! -d .git || ./autogen.sh
bootstrap:
if HAS_NODEJS
cd "$(path_bootstrap)" && "$(NODEJS)" bootstrap.js
else
@echo "Node.js is required for command-line bootstrapping."
@echo "Alternatively, direct your web browser to"
@echo "bootstrap/bootstrap.html to bootstrap in-browser."
@exit 1
endif

31
autogen.sh 100755
View File

@ -0,0 +1,31 @@
#!/bin/sh
#
# Generate configure script from repository
#
# Copyright (C) 2018 Mike Gerwitz
#
# This file is part of Ulambda Scheme.
#
# Ulambda Scheme 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/>.
#
# This script is not necessary to configure GNU ease.js; it is provided for
# convenience.
##
which autoreconf >/dev/null || {
echo "fatal: missing autoreconf" >&2
exit 1
}
exec autoreconf -fvi

View File

@ -413,7 +413,9 @@ class Bootstrap
*
* @param {Error} e error
*
* @return {boolean} false
* @throws {Error} e
*
* @return {undefined}
*/
_error( e )
{
@ -421,7 +423,7 @@ class Bootstrap
this._logf( str, e );
return false;
throw e;
}

View File

@ -50,4 +50,7 @@ const getf = path => Promise.resolve(
const strap = new Bootstrap( getf, logf, new Prebirth() );
strap.bootstrap();
// Attempt bootstrap. Error output is handled by Bootstrap, since the
// output must also work correctly in a browser environment.
strap.bootstrap()
.catch( _ => process.exit( 1 ) );

40
configure.ac 100644
View File

@ -0,0 +1,40 @@
# For use by Autoconf
#
# Copyright (C) 2018 Mike Gerwitz
#
# This file is part of Ulambda Scheme
#
# Ulambda Scheme 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/>.
##
AC_INIT([easejs], [0.0.0-dev], [mtg@gnu.org])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
# Node.js is required for command-line bootstrapping
AC_ARG_VAR([NODEJS], [The Node.js interpreter])
AC_CHECK_PROGS(NODEJS, [node nodejs])
AM_CONDITIONAL(HAS_NODEJS, [test "$NODEJS"])
# 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 "$NODEJS" || AC_MSG_WARN([
Node.js is not installed; command-line bootstrapping will not be
available, but you may bootstrap using your web browser.
])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT