mescc: Resurrect guile-1.8.

* guile/mescc.scm: Use GUILE_LOAD_COMPILED_PATH instead of -C.
  [guile]: Include syncase.
* module/language/c99/compiler.scm [guile]: Stub pretty-print-c99.
  Set stack to unlimited.
* module/language/c99/info.scm [guile]: Include (ice-9 syncase).
* module/mes/as-i386.scm [guile]: Likewise.
* module/mes/guile.scm [guile]: Add compose, export it.
This commit is contained in:
Jan Nieuwenhuizen 2018-01-03 08:33:55 +01:00
parent c5f9623c55
commit fd13741eb3
5 changed files with 33 additions and 7 deletions

View file

@ -5,7 +5,8 @@ GUILEDIR=${GUILEDIR-@GUILEDIR@}
[ "$GODIR" = @"GODIR"@ ] && GODIR=$(dirname $0) [ "$GODIR" = @"GODIR"@ ] && GODIR=$(dirname $0)
[ "$GUILEDIR" = @"GUILEDIR"@ ] && GUILEDIR=$(dirname $0) [ "$GUILEDIR" = @"GUILEDIR"@ ] && GUILEDIR=$(dirname $0)
export GUILE_AUTO_COMPILE=${GUILE_AUTO_COMPILE-0} export GUILE_AUTO_COMPILE=${GUILE_AUTO_COMPILE-0}
exec ${GUILE-guile} -L $GUILEDIR -C $GODIR -e '(mescc)' -s "$0" "$@" GUILE_LOAD_COMPILED_PATH=$GODIR:$GUILE_LOAD_COMPILED_PATH
exec ${GUILE-guile} -L $GUILEDIR -e '(mescc)' -s "$0" "$@"
!# !#
;;; Mes --- The Maxwell Equations of Software ;;; Mes --- The Maxwell Equations of Software
@ -45,6 +46,11 @@ GUILE='~/src/guile-1.8/build/pre-inst-guile --debug -q' guile/mescc.scm
#:use-module (srfi srfi-26) #:use-module (srfi srfi-26)
#:export (main)) #:export (main))
(cond-expand
(guile-2)
(guile
(use-modules (ice-9 syncase))))
(define %prefix (if (string-prefix? "@PREFIX" "@PREFIX@") (or (getenv "MES_PREFIX") "") "@PREFIX@")) (define %prefix (if (string-prefix? "@PREFIX" "@PREFIX@") (or (getenv "MES_PREFIX") "") "@PREFIX@"))
(module-define! (resolve-module '(language c99 compiler)) '%prefix %prefix) (module-define! (resolve-module '(language c99 compiler)) '%prefix %prefix)

View file

@ -1,7 +1,7 @@
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016,2017,2018 Jan Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This file is part of Mes. ;;; This file is part of Mes.
;;; ;;;
@ -29,7 +29,7 @@
#:use-module (ice-9 optargs) #:use-module (ice-9 optargs)
#:use-module (ice-9 pretty-print) #:use-module (ice-9 pretty-print)
#:use-module (nyacc lang c99 parser) #:use-module (nyacc lang c99 parser)
#:use-module (nyacc lang c99 pprint) ;;#:use-module (nyacc lang c99 pprint)
#:use-module (mes guile) #:use-module (mes guile)
#:use-module (mes as) #:use-module (mes as)
#:use-module (mes as-i386) #:use-module (mes as-i386)
@ -44,9 +44,17 @@
info->object)) info->object))
(cond-expand (cond-expand
(guile-2) (guile-2
(use-modules (nyacc lang c99 pprint)))
(guile (guile
(debug-set! stack 0)
(use-modules (ice-9 optargs))
(use-modules (ice-9 syncase))) (use-modules (ice-9 syncase)))
;; guile-1.8 does not have (sxml match), short-circuit me
(define* (pretty-print-c99 tree
#:optional (port (current-output-port))
#:key ugly per-line-prefix (basic-offset 2))
(write tree port))
(mes)) (mes))
(include-from-path "language/c99/compiler.mes") (include-from-path "language/c99/compiler.mes")

View file

@ -63,7 +63,8 @@
(cond-expand (cond-expand
(guile-2) (guile-2)
(guile (guile
(use-modules (ice-9 syncase))) (use-modules (ice-9 syncase))
(use-modules (ice-9 optargs)))
(mes (mes
(mes-use-module (mes optargs)))) (mes-use-module (mes optargs))))

View file

@ -1,7 +1,7 @@
;;; -*-scheme-*- ;;; -*-scheme-*-
;;; Mes --- Maxwell Equations of Software ;;; Mes --- Maxwell Equations of Software
;;; Copyright © 2016,2017 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2016,2017,2018 Jan Nieuwenhuizen <janneke@gnu.org>
;;; ;;;
;;; This file is part of Mes. ;;; This file is part of Mes.
;;; ;;;
@ -152,4 +152,10 @@
i386:z->accu i386:z->accu
)) ))
(cond-expand
(guile-2)
(guile
(use-modules (ice-9 syncase)))
(mes))
(include-from-path "mes/as-i386.mes") (include-from-path "mes/as-i386.mes")

View file

@ -77,5 +77,10 @@
#'(include fn)))))))) #'(include fn))))))))
(export include-from-path)) (export include-from-path))
(guile (guile
(use-modules (ice-9 syncase))) (use-modules (ice-9 syncase))
(define (compose proc . rest)
(if (null? rest) proc
(lambda args
(proc (apply (apply compose rest) args)))))
(export compose))
(mes)) (mes))