summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès2009-03-24 23:28:06 +0100
committerLudovic Courtès2009-03-24 23:28:58 +0100
commitf37487368372c5ab6207e756b4b4ae89c6d145c3 (patch)
treeb9097bfdc18502f1c8bad33c8ca630fba20f54f5
parent3a72d5b1cf38fc3c579336e76e2b0354dcd4c4ae (diff)
downloadskribilo-f37487368372c5ab6207e756b4b4ae89c6d145c3.tar.gz
skribilo-f37487368372c5ab6207e756b4b4ae89c6d145c3.tar.lz
skribilo-f37487368372c5ab6207e756b4b4ae89c6d145c3.zip
Add experimental `--enable-guile-vm' configure option.
* configure.ac (--enable-guile-vm): New option. (ENABLE_GUILE_VM): New Automake conditional. * guile-vm.am: New file. * src/guile/Makefile.am (SOURCES): New variable, formerly `nobase_dist_module_DATA'. (SOURCES_NOT_COMPILED): New. Include `guile-vm.am'. * NEWS: Update.
-rw-r--r--.gitignore2
-rw-r--r--NEWS5
-rw-r--r--configure.ac9
-rw-r--r--guile-vm.am30
-rw-r--r--src/guile/Makefile.am15
5 files changed, 55 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 49d41ca..78853e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,5 @@ src/skribilo
src/skribilo-config
src/pre-inst-skribilo
src/guile/skribilo/config.scm
+*.go
+*.go.*
diff --git a/NEWS b/NEWS
index cd85eca..26b785d 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,11 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009 Ludovic Courtès <ludo@gnu.org>
Previously, footnotes would not get printed in the case of chapters that
are not output in a separate file.
+** New experimental `--enable-guile-vm' configure switch
+
+This allows compilation with the compiler of "Guile-VM", i.e., the
+future Guile 2.x.
+
* New in Skribilo 0.9.1
** Improved `configure' diagnostics and build/installation fixes
diff --git a/configure.ac b/configure.ac
index 0da5c01..a0617b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,6 +10,10 @@ AM_INIT_AUTOMAKE([gnu no-define check-news readme-alpha])
AC_CONFIG_SRCDIR([src/guile/skribilo/reader.scm])
+# Options.
+AC_ARG_ENABLE([guile-vm],
+ [AS_HELP_STRING([--enable-guile-vm],
+ [compile source files for use with Guile-VM (aka. Guile 2.x)])])
# GNU Gettext.
AM_GNU_GETTEXT([external])
@@ -29,6 +33,11 @@ AC_ARG_WITH([guilemoduledir],
GUILE_PROGS
GUILE_SITE_DIR
+# Guile-VM's compiler (aka. Guile 2.0.x).
+AM_CONDITIONAL([ENABLE_GUILE_VM],
+ [test "x$enable_guile_vm" = "xyes" && \
+ $GUILE_TOOLS compile --help 2>&1 >/dev/null])
+
# Guile-Lint (http://www.geocities.com/user42_kevin/guile-lint/index.html)
AC_PATH_PROG([GUILE_LINT], [guile-lint])
AC_SUBST([GUILE_LINT])
diff --git a/guile-vm.am b/guile-vm.am
new file mode 100644
index 0000000..14b146f
--- /dev/null
+++ b/guile-vm.am
@@ -0,0 +1,30 @@
+# Compilation with Guile-VM's compiler (aka. Guile 2.x).
+
+if ENABLE_GUILE_VM
+
+# XXX: This expression relies on a GNU extension.
+GOBJECTS = $(SOURCES:%.scm=%.go)
+
+nobase_nodist_module_DATA = \
+ $(SOURCES) $(GOBJECTS) $(SOURCES_NOT_COMPILED)
+
+.scm.go:
+ $(MKDIR_P) `dirname $@`
+ $(GUILE) -L $(srcdir) \
+ -c "(use-modules (system base compile) \
+ (skribilo condition)) \
+ (read-set! keywords 'prefix) \
+ (call-with-skribilo-error-catch/exit \
+ (lambda () \
+ (compile-file \"$<\" \"$@\")))"
+
+CLEANFILES += $(GOBJECTS)
+
+SUFFIXES += .go
+
+else !ENABLE_GUILE_VM
+
+nobase_nodist_module_DATA = \
+ $(SOURCES) $(SOURCES_NOT_COMPILED)
+
+endif !ENABLE_GUILE_VM
diff --git a/src/guile/Makefile.am b/src/guile/Makefile.am
index 51f8aec..5247afb 100644
--- a/src/guile/Makefile.am
+++ b/src/guile/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright 2005, 2006, 2007, 2008 Ludovic Courtès <ludo@gnu.org>
+# Copyright 2005, 2006, 2007, 2008, 2009 Ludovic Courtès <ludo@gnu.org>
#
# 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
@@ -24,7 +24,7 @@ EXTRA_DIST = \
skribilo/utils/images.scm.in skribilo/config.in \
srfi/srfi-64.scm srfi/srfi-64.upstream.scm
-nobase_dist_module_DATA = \
+SOURCES = \
skribilo.scm diff.scm \
skribilo/biblio/bibtex.scm skribilo/biblio/author.scm \
skribilo/biblio/abbrev.scm skribilo/biblio/template.scm \
@@ -44,8 +44,11 @@ nobase_dist_module_DATA = \
skribilo/table.scm skribilo/utils/justify.scm \
skribilo/utils/text-table.scm
-nobase_dist_module_DATA += \
- $(readers) $(engines) $(packages)
+SOURCES += $(readers) $(packages)
+
+# XXX: Currently, engines cannot be compiled due to a VM limitation.
+# See http://thread.gmane.org/gmane.lisp.guile.devel/8240 for details.
+SOURCES_NOT_COMPILED = $(engines)
readers = \
skribilo/reader/skribe.scm skribilo/reader/outline.scm \
@@ -75,14 +78,14 @@ nobase_module_DATA = \
skribilo/config.scm
# Generated files part of the distribution.
-nobase_dist_module_DATA += \
+SOURCES += \
skribilo/source/lisp-lex.scm skribilo/source/xml-lex.scm \
skribilo/source/c-lex.scm
CLEANFILES = $(nobase_module_DATA)
-
include $(top_srcdir)/substitute.am
+include $(top_srcdir)/guile-vm.am
.in.scm:
$(substitute) "$^" > "$@.tmp" && \