aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Court`es2006-07-24 08:15:35 +0000
committerLudovic Court`es2006-07-24 08:15:35 +0000
commit3af9f58fbfe8eacf49e88db81b9e809d5fd8bc0a (patch)
tree3395b27ce10e495f89688a8521b63df69bb100d5
parent06e595c745c300a6fd2130633539ac682cb0b8e9 (diff)
downloadskribilo-3af9f58fbfe8eacf49e88db81b9e809d5fd8bc0a.tar.gz
skribilo-3af9f58fbfe8eacf49e88db81b9e809d5fd8bc0a.tar.lz
skribilo-3af9f58fbfe8eacf49e88db81b9e809d5fd8bc0a.zip
Detect Ploticus at configuration-time and decide how to build the doc.
* configure.ac: Look for `ploticus' or `pl'. Create an AM conditional. * doc/user/Makefile.am (BUILT_SOURCES): Set to `doc-config.scm'. (html_DATA): New, set to `user.html'. (ps_DATA): Likewise. (doc-config.scm): New target. * doc/user/user.skb: Load `doc-config.scm' and update `%ploticus-program' accordingly. Decide whether or not to include `pie.skb'. * src/guile/skribilo/package/pie.scm: Export `%ploticus-program' and `%ploticus-debug?'. git-archimport-id: lcourtes@laas.fr--2005-libre/skribilo--devo--1.2--patch-26
-rw-r--r--configure.ac5
-rw-r--r--doc/user/Makefile.am13
-rw-r--r--doc/user/user.skb7
-rw-r--r--src/guile/skribilo/package/pie.scm3
4 files changed, 24 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 5b57f87..e889401 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,11 @@ GUILE_MODULE_REQUIRED([srfi srfi-35])
AC_PATH_PROG([LOUT], [lout], [not-found])
AM_CONDITIONAL([HAVE_LOUT], [test "x$LOUT" != "xnot-found"])
+# Look for Ploticus.
+AC_PATH_PROGS([PLOTICUS], [ploticus pl], [not-found])
+AM_CONDITIONAL([HAVE_PLOTICUS], [test "x$PLOTICUS" != "xnot-found"])
+
+
AC_SUBST([SKRIBILO_DOC_DIR], ["$datadir/doc/skribilo"])
AC_SUBST([SKRIBILO_EXT_DIR], ["$datadir/skribilo/1.2/"])
AC_SUBST([SKRIBILO_SKR_PATH], ["$GUILE_SITE/"])
diff --git a/doc/user/Makefile.am b/doc/user/Makefile.am
index 7d22cd8..3428ad5 100644
--- a/doc/user/Makefile.am
+++ b/doc/user/Makefile.am
@@ -8,7 +8,8 @@ EXTRA_DIST = bib.skb char.skb colframe.skb document.skb emacs.skb \
skribe-config.skb skribec.skb skribeinfo.skb slide.skb start.skb \
syntax.skb table.skb toc.skb user.skb xmle.skb
-BUILT_SOURCES = user.html
+BUILT_SOURCES = doc-config.scm
+html_DATA = user.html
skribilo = $(top_srcdir)/src/skribilo
load_path = $(top_srcdir)/src/guile:$(top_srcdir)/src/guile/skribilo/package
@@ -19,7 +20,7 @@ load_path = $(top_srcdir)/src/guile:$(top_srcdir)/src/guile/skribilo/package
if HAVE_LOUT
-BUILT_SOURCES += user.ps
+ps_DATA = user.ps
%.lout: %.skb
GUILE_LOAD_PATH=$(load_path):$$GUILE_LOAD_PATH \
@@ -30,3 +31,11 @@ BUILT_SOURCES += user.ps
endif
+if HAVE_PLOTICUS
+doc-config.scm:
+ -echo "(define %have-ploticus? #t)" > $@
+ -echo "(define %ploticus-path \"$(PLOTICUS)\")" >> $@
+else
+doc-config.scm:
+ -echo "(define %have-ploticus? #f) (define %ploticus-path #f)" > $@
+endif
diff --git a/doc/user/user.skb b/doc/user/user.skb
index 82e614e..68c3d23 100644
--- a/doc/user/user.skb
+++ b/doc/user/user.skb
@@ -23,6 +23,11 @@
(use-modules (skribilo package eq)
(skribilo package pie))
+;; Load the compile-time configuration file.
+(load "doc-config.scm")
+
+(if %have-ploticus? (set! %ploticus-program %ploticus-path))
+
;*---------------------------------------------------------------------*/
;* HTML custom */
;*---------------------------------------------------------------------*/
@@ -138,7 +143,7 @@ as HTML, Info pages, man pages, Postscript, etc.]))))
(include "eq.skb")
;;; Pie charts
-(include "pie.skb")
+(if %have-ploticus? (include "pie.skb"))
;;; Standard Library
(include "lib.skb")
diff --git a/src/guile/skribilo/package/pie.scm b/src/guile/skribilo/package/pie.scm
index 2644cb7..1eba15a 100644
--- a/src/guile/skribilo/package/pie.scm
+++ b/src/guile/skribilo/package/pie.scm
@@ -33,7 +33,8 @@
:autoload (skribilo engine lout) (lout-illustration)
:autoload (ice-9 popen) (open-output-pipe)
:use-module (ice-9 optargs)
- :export (pie-sliceweight-value pie-remove-markup))
+ :export (%ploticus-program %ploticus-debug?
+ pie-sliceweight-value pie-remove-markup))
(fluid-set! current-reader %skribilo-module-reader)