wisp
 
(Arne Babenhauserheide)
2015-09-24: merge starting from wisp.scm stable v0.9.0

merge starting from wisp.scm

diff --git a/Makefile.am b/Makefile.am
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
-wisp = wisp.scm wisp-scheme.scm language/wisp/spec.scm
+wisp = wisp-scheme.scm language/wisp/spec.scm
 wisp_SOURCES = wisp-guile.w wisp-reader.w wisp-scheme.w
-EXTRA_DIST = $(wisp_SOURCES) $(wisp_DATA) bootstrap.sh wisp.py examples tests wisp-repl-guile.sh testrunner.w
+EXTRA_DIST = $(wisp_SOURCES) $(wisp_DATA) bootstrap.sh bootstrap-reader.sh examples tests wisp-repl-guile.sh testrunner.w wisp.py wisp.scm
 CLEANFILES = ${wisp} ChangeLog
 DISTCLEANFILES = ${CLEANFILES} @abs_top_builddir@/1 @abs_top_builddir@/2 @abs_top_builddir@/syntaxtests.sh @abs_top_builddir@/syntaxtestsreader.sh
 # don't spout out lots of stuff at each distcheck. Disable for debugging.
@@ -16,7 +16,10 @@ ChangeLog :
 ${wisp} : input.in.intermediate
 
 .INTERMEDIATE: input.in.intermediate
-input.in.intermediate: ${wisp_SOURCES}
+input.in.intermediate: ${wisp_SOURCES} wisp.scm
+	@abs_top_srcdir@/bootstrap-reader.sh @abs_top_srcdir@ @abs_top_builddir@ @guile@ wisp.scm 2>&1 | sed "s/^;;;.*//" 2>&1 | grep . 1>&2 ; test ! $$? -eq 0 # it worked if grep does not find anything
+
+wisp.scm: wisp-guile.w wisp.py
 	@abs_top_srcdir@/bootstrap.sh @abs_top_srcdir@ @guile@ @python3@ 2>&1 | sed "s/^;;;.*//" 2>&1 | grep . 1>&2 ; test ! $$? -eq 0 # it worked if grep does not find anything
 
 .PHONY: syntaxtests.sh
@@ -26,7 +29,7 @@ syntaxtests.sh : wisp.scm tests/runtests
 	chmod +x @abs_top_builddir@/$@
 
 .PHONY: syntaxtestsreader.sh
-syntaxtestsreader.sh : wisp.scm tests/runtests-scheme-reader.sh
+syntaxtestsreader.sh : ${wisp} wisp.scm tests/runtests-scheme-reader.sh
 	echo '#!/bin/bash' > @abs_top_builddir@/$@
 	echo @abs_top_srcdir@/tests/runtests-scheme-reader.sh @abs_top_srcdir@ @abs_top_builddir@ >> @abs_top_builddir@/$@
 	chmod +x @abs_top_builddir@/$@
diff --git a/NEWS b/NEWS
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,8 @@
+wisp 0.9.0 (2015-09-24):
+- actually distribute wisp.scm
+- wisp now starts from wisp.scm. To bootstrap a release from Python, 
+  remove wisp.scm and run `make wisp.scm`
+
 wisp 0.8.7 (2015-09-24):
 - new example say.w, companion to 
 - bootstrap now explicitly requires bash
diff --git a/bootstrap.sh b/bootstrap-reader.sh
copy from bootstrap.sh
copy to bootstrap-reader.sh
--- a/bootstrap.sh
+++ b/bootstrap-reader.sh
@@ -1,46 +1,50 @@
 #!/bin/bash
 
-# Bootstrap wisp-guile with wisp.py
 if [[ x"$1" == x"" ]]; then 
     srcdir=.
 else
     srcdir="$1"
 fi
 
-# Bootstrap wisp-guile with wisp.py
 if [[ x"$2" == x"" ]]; then 
+    builddir=.
+else
+    builddir="$2"
+fi
+
+
+if [[ x"$3" == x"" ]]; then 
     guile='guile'
 else
-    guile="$2"
+    guile="$3"
 fi
 
-# Bootstrap wisp-guile with wisp.py
-if [[ x"$3" == x"" ]]; then 
-    python3="python3"
+
+if test -f wisp.scm; then 
+    wisp=wisp.scm
+elif test -f "${builddir}/wisp.scm"; then
+    wisp="${builddir}/wisp.scm"
 else
-    python3="$3"
+    wisp="${srcdir}/wisp.scm"
 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
-# put all output into stderr via 1>&2 and prefix it with ;;; to make it possible to kill it alongside the auto-compile output from guile with one sed.
-echo ";;;" "successfully bootstrapped wisp.scm" 1>&2
-mkdir -p language/wisp
+
+mkdir -p ${builddir}/language/wisp
 
 echo ";;;" preparing the reader: wisp at the REPL 1>&2
 
 echo ";;;" parsing wisp-scheme.w with the parser for the REPL 1>&2
-${guile} wisp.scm ${srcdir}/wisp-scheme.w 2>/dev/null > wisp-scheme.scm \
+${guile} ${wisp} ${srcdir}/wisp-scheme.w 2>/dev/null > ${builddir}/wisp-scheme.scm \
     && echo ";;;" ...precompiling the parser... 1>&2 \
-    && ${guile} -s wisp-scheme.scm 2>/dev/null \
+    && ${guile} -s ${builddir}/wisp-scheme.scm 2>/dev/null \
     && echo ";;;" ...succeeded 1>&2 \
+    || echo creating wisp-scheme.scm failed
 
 echo ";;;"  parsing the spec file... 1>&2
-${guile} wisp.scm ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
+${guile} ${wisp} ${srcdir}/wisp-reader.w 2>/dev/null > ${builddir}/language/wisp/spec.scm \
     && echo ";;;" ...precompiling the spec file... 1>&2 \
-    && ${guile} -L . -s language/wisp/spec.scm \
+    && ${guile} -L . -s ${builddir}/language/wisp/spec.scm \
     && echo ";;;" ...succeeded 1>&2 \
-    && echo ";;;" to use wisp at the REPL, run '`'${guile} -L . --language=wisp'`' 1>&2
+    && echo ";;;" to use wisp at the REPL, run '`'${guile} -L . --language=wisp'`' 1>&2 \
+    || echo creating language/wisp/spec.scm failed
+
diff --git a/bootstrap.sh b/bootstrap.sh
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -28,19 +28,3 @@ if [[ ! x"${diff}" == x"success" ]]; the
 fi
 # put all output into stderr via 1>&2 and prefix it with ;;; to make it possible to kill it alongside the auto-compile output from guile with one sed.
 echo ";;;" "successfully bootstrapped wisp.scm" 1>&2
-mkdir -p language/wisp
-
-echo ";;;" preparing the reader: wisp at the REPL 1>&2
-
-echo ";;;" parsing wisp-scheme.w with the parser for the REPL 1>&2
-${guile} wisp.scm ${srcdir}/wisp-scheme.w 2>/dev/null > wisp-scheme.scm \
-    && echo ";;;" ...precompiling the parser... 1>&2 \
-    && ${guile} -s wisp-scheme.scm 2>/dev/null \
-    && echo ";;;" ...succeeded 1>&2 \
-
-echo ";;;"  parsing the spec file... 1>&2
-${guile} wisp.scm ${srcdir}/wisp-reader.w 2>/dev/null > language/wisp/spec.scm \
-    && echo ";;;" ...precompiling the spec file... 1>&2 \
-    && ${guile} -L . -s language/wisp/spec.scm \
-    && echo ";;;" ...succeeded 1>&2 \
-    && echo ";;;" to use wisp at the REPL, run '`'${guile} -L . --language=wisp'`' 1>&2
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.8.7],
+AC_INIT([wisp], [0.9.0],
         [arne_bab@web.de])
 # Check for programs I need for my build
 AC_CANONICAL_TARGET
diff --git a/tests/runtests-scheme-preprocessor.sh b/tests/runtests-scheme-preprocessor.sh
--- a/tests/runtests-scheme-preprocessor.sh
+++ b/tests/runtests-scheme-preprocessor.sh
@@ -19,7 +19,7 @@ cd ${srcdir}/tests
 for i in *.w; do
     # skip strangecomments
     if test x"${i}" = x"strangecomments.w"; then continue; fi
-    d=$(guile ${builddir}/wisp.scm "$i" > ${builddir}/testtempfoo.scm; diff -wuB ${builddir}/testtempfoo.scm "$(basename "$i" .w)".scm; rm ${builddir}/testtempfoo.scm)
+    d=$(guile ${srcdir}/wisp.scm "$i" > ${builddir}/testtempfoo.scm; diff -wuB ${builddir}/testtempfoo.scm "$(basename "$i" .w)".scm; rm ${builddir}/testtempfoo.scm)
     if test x"$d" = x""; then
         continue
     else
diff --git a/tests/runtests-scheme-reader.sh b/tests/runtests-scheme-reader.sh
--- a/tests/runtests-scheme-reader.sh
+++ b/tests/runtests-scheme-reader.sh
@@ -17,10 +17,10 @@ fi
 failed=0
 cd ${builddir}
 for i in ${srcdir}/tests/*.w; do
-    if guile -L . --language=wisp ${srcdir}/testrunner.w "${i}" "${srcdir}/tests/$(basename "${i}" .w).scm" | grep -q "have equivalent content"; then
+    if guile -L ${builddir} --language=wisp ${srcdir}/testrunner.w "${i}" "${srcdir}/tests/$(basename "${i}" .w).scm" | grep -q "have equivalent content"; then
         continue
     fi
-    echo test "$i" failed. Diff: $(guile -L . --language=wisp ${srcdir}/testrunner.w "${i}" "${srcdir}/tests/$(basename "${i}" .w).scm")
+    echo test "$i" failed. Diff: $(guile -L ${builddir} --language=wisp ${srcdir}/testrunner.w "${i}" "${srcdir}/tests/$(basename "${i}" .w).scm")
     failed=$((failed + 1))
 done
 cd - >/dev/null # undo dir change