wisp
 
(Arne Babenhauserheide)
2014-01-27: merge

merge

diff --git a/.hgtags b/.hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -8,3 +8,8 @@ ce8ccd40ef936710e76200d2ee138535e4ab0fb4
 00de78a95055f846906d57b1a094a1c3e6bb2dbd v0.5.2
 df64e82e0920bdd079d77cd4829bac9d30461a25 v0.5.3
 f9c6e637d91d107bbf2ad807f30dc04150ddb251 v0.5.4
+3f72f85e4cddf57e5e6c84c735f554f330d3b88b v0.5.5
+2ae2c7c154e0c80acd21bdb2dace1c98a0a8d7a7 v0.5.6
+fb1b0fb41bc768485f582f3f5af16478aa6212a1 v0.5.7
+efd0ee6e65c3948e0c643526063029b691424de8 v0.5.8
+bb1c4165b8a6d12929625e6518a5b1c727c75942 v0.5.9
diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,17 +1,20 @@
 wisp = wisp.scm language/wisp/spec.scm
 wisp_SOURCES = wisp-guile.w wisp-reader.w
-EXTRA_DIST = $(wisp_SOURCES) $(wisp_DATA) bootstrap.sh wisp.py examples tests runtests.sh
-CLEANFILES = ${wisp} 
+EXTRA_DIST = $(wisp_SOURCES) $(wisp_DATA) bootstrap.sh wisp.py examples tests runtests.sh wisp-repl-guile.sh
+CLEANFILES = ${wisp} ChangeLog
 DISTCLEANFILES = ${CLEANFILES} @abs_top_builddir@/1 @abs_top_builddir@/2 @abs_top_builddir@/test.sh
 
-all : ${wisp} $(changelog)
+all : ${wisp}
+
+ChangeLog :
+	hg log --style changelog > ChangeLog
 
 # emacs org-mode beamer build instructions
 ${wisp} : input.in.intermediate
 
 .INTERMEDIATE: input.in.intermediate
 input.in.intermediate: ${wisp_SOURCES}
-	@abs_top_srcdir@/bootstrap.sh @abs_top_srcdir@
+	@abs_top_srcdir@/bootstrap.sh @abs_top_srcdir@ @guile@ @python3@
 
 .PHONY: test.sh
 test.sh : wisp.scm runtests.sh
diff --git a/bootstrap.sh b/bootstrap.sh
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -7,14 +7,31 @@ else
     srcdir="$1"
 fi
 
-diff=$(python3 ${srcdir}/wisp.py ${srcdir}/wisp-guile.w > 1 && guile 1 ${srcdir}/wisp-guile.w > 2 && guile 2 ${srcdir}/wisp-guile.w > wisp.scm && diff 2 wisp.scm && echo success)
+# Bootstrap wisp-guile with wisp.py
+if [[ x"$2" == x"" ]]; then 
+    guile="guile"
+else
+    guile="$2"
+fi
+
+# Bootstrap wisp-guile with wisp.py
+if [[ x"$3" == x"" ]]; then 
+    python3="python3"
+else
+    python3="$3"
+fi
+
+diff=$(${python3} ${srcdir}/wisp.py ${srcdir}/wisp-guile.w > 1 && ${guile} 1 ${srcdir}/wisp-guile.w > 2 && ${guile} 2 ${srcdir}/wisp-guile.w > wisp.scm && diff 2 wisp.scm && echo success)
 if [[ ! x"${diff}" == x"success" ]]; then
     echo "failed to bootstrap wisp.scm. diff: " ${diff}
     exit 1
 fi
 echo "successfully bootstrapped wisp.scm"
 echo preparing the reader: wisp at the REPL
+echo parsing the spec file...
 mkdir -p language/wisp
-guile wisp.scm ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
+${guile} wisp.scm ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
+    && echo ...precompiling the spec file... \
+    && ${guile} -L . -s language/wisp/spec.scm \
     && echo ...succeeded \
-    && echo 'to use wisp at the REPL, run `guile -L` . and then in guile `,L wisp`'
+    && echo to use wisp at the REPL, run '`'${guile} -L . --language=wisp'`'
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl run `autoreconf -i` to generate a configure script. 
 dnl Then run ./configure to generate a Makefile.
 dnl Finally run make to generate the project.
-AC_INIT([wisp], [0.5.4], 
+AC_INIT([wisp], [0.5.9],
         [arne_bab@web.de])
 # Check for programs I need for my build
 AC_CANONICAL_TARGET
@@ -9,6 +9,7 @@ AC_ARG_VAR([guile], [How to call GNU Gui
 AC_CHECK_TARGET_TOOL([guile], [guile], [no])
 AS_IF([test "x$guile" = "xno"],
       [AC_MSG_ERROR([cannot find GNU Guile.])])
+AC_ARG_VAR([python3], [How to call Python 3.])
 AC_CHECK_TARGET_TOOL([python3], [python3], [no])
 AS_IF([test "x$python3" = "xno"],
       [AC_MSG_ERROR([cannot find Python 3 which is required for bootstrapping.])])
diff --git a/wisp-repl-guile.sh b/wisp-repl-guile.sh
new file mode 100755
--- /dev/null
+++ b/wisp-repl-guile.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# if the spec file does not exist yet, run the build chain
+if test ! -f language/wisp/spec.scm; then
+    # if we are in a distribution tarball, just run configure
+    if test -f ./configure; then
+        ./configure && make check
+    # otherwise run the full autoconf chain
+    else
+        autoreconf -i && ./configure && make check
+    fi
+fi
+
+# if the file still does not exist, our chain is broken
+if test ! -f language/wisp/spec.scm; then
+    echo "ERROR: wisp failed to compile. Please check the previous output."
+else
+    guile -L . --language=wisp
+fi