mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Build guile-procedures.txt' using (texinfo) instead of
makeinfo'.
* Makefile.am (schemelibdir, schemelib_DATA): New variables. (libguile/guile-procedures.txt): New target. (EXTRA_DIST): Add libguile/texi-fragments-to-docstrings. * libguile/Makefile.am (guile-procedures.txt): Remove target. (schemelibdir, schemelib_DATA): Remove. * libguile/texi-fragments-to-docstrings: New file.
This commit is contained in:
parent
2bb7a73013
commit
6cfdc6b878
3 changed files with 70 additions and 18 deletions
17
Makefile.am
17
Makefile.am
|
@ -1,7 +1,7 @@
|
||||||
## Process this file with automake to produce Makefile.in.
|
## Process this file with automake to produce Makefile.in.
|
||||||
##
|
##
|
||||||
## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006, 2007,
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006, 2007,
|
||||||
## 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
|
## 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||||
##
|
##
|
||||||
## This file is part of GUILE.
|
## This file is part of GUILE.
|
||||||
##
|
##
|
||||||
|
@ -42,6 +42,18 @@ SUBDIRS = \
|
||||||
libguileincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)
|
libguileincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)
|
||||||
libguileinclude_HEADERS = libguile.h
|
libguileinclude_HEADERS = libguile.h
|
||||||
|
|
||||||
|
schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
|
||||||
|
schemelib_DATA = libguile/guile-procedures.txt
|
||||||
|
|
||||||
|
# Build it from here so that all the modules are compiled by the time we
|
||||||
|
# build it.
|
||||||
|
libguile/guile-procedures.txt: libguile/guile-procedures.texi
|
||||||
|
$(AM_V_GEN) \
|
||||||
|
$(top_builddir)/meta/guile --no-auto-compile \
|
||||||
|
"$(srcdir)/libguile/texi-fragments-to-docstrings" \
|
||||||
|
"$(builddir)/libguile/guile-procedures.texi" \
|
||||||
|
> libguile/guile-procedures.txt
|
||||||
|
|
||||||
EXTRA_DIST = LICENSE HACKING GUILE-VERSION \
|
EXTRA_DIST = LICENSE HACKING GUILE-VERSION \
|
||||||
m4/ChangeLog-2008 \
|
m4/ChangeLog-2008 \
|
||||||
m4/gnulib-cache.m4 \
|
m4/gnulib-cache.m4 \
|
||||||
|
@ -50,7 +62,8 @@ EXTRA_DIST = LICENSE HACKING GUILE-VERSION \
|
||||||
gnulib-local/lib/localcharset.h.diff \
|
gnulib-local/lib/localcharset.h.diff \
|
||||||
gnulib-local/lib/localcharset.c.diff \
|
gnulib-local/lib/localcharset.c.diff \
|
||||||
gnulib-local/m4/clock_time.m4.diff \
|
gnulib-local/m4/clock_time.m4.diff \
|
||||||
gnulib-local/build-aux/git-version-gen.diff
|
gnulib-local/build-aux/git-version-gen.diff \
|
||||||
|
libguile/texi-fragments-to-docstrings
|
||||||
|
|
||||||
TESTS = check-guile
|
TESTS = check-guile
|
||||||
TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||||
|
|
|
@ -713,25 +713,9 @@ guile.texi: $(alldotdocfiles) guile$(EXEEXT)
|
||||||
guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
|
guile-procedures.texi: $(alldotdocfiles) guile$(EXEEXT)
|
||||||
$(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
|
$(AM_V_GEN)$(dotdoc2texi) > $@ || { rm $@; false; }
|
||||||
|
|
||||||
if HAVE_MAKEINFO
|
|
||||||
|
|
||||||
guile-procedures.txt: guile-procedures.texi
|
|
||||||
rm -f $@
|
|
||||||
makeinfo --force -o $@ guile-procedures.texi || test -f $@
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
guile-procedures.txt: guile-procedures.texi
|
|
||||||
cp guile-procedures.texi $@
|
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
c-tokenize.c: c-tokenize.lex
|
c-tokenize.c: c-tokenize.lex
|
||||||
flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
|
flex -t $(srcdir)/c-tokenize.lex > $@ || { rm $@; false; }
|
||||||
|
|
||||||
schemelibdir = $(pkgdatadir)/$(GUILE_EFFECTIVE_VERSION)
|
|
||||||
schemelib_DATA = guile-procedures.txt
|
|
||||||
|
|
||||||
## Add -MG to make the .x magic work with auto-dep code.
|
## Add -MG to make the .x magic work with auto-dep code.
|
||||||
MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||||
|
|
||||||
|
|
55
libguile/texi-fragments-to-docstrings
Normal file
55
libguile/texi-fragments-to-docstrings
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
;;; -*- mode: scheme; coding: utf-8; -*-
|
||||||
|
;;;
|
||||||
|
;;; Copyright (C) 2013 Free Software Foundation, Inc.
|
||||||
|
;;;
|
||||||
|
;;; This library is free software; you can redistribute it and/or
|
||||||
|
;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
;;; License as published by the Free Software Foundation; either
|
||||||
|
;;; version 3 of the License, or (at your option) any later version.
|
||||||
|
;;;
|
||||||
|
;;; This library is distributed in the hope that it will be useful,
|
||||||
|
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
;;; Lesser General Public License for more details.
|
||||||
|
;;;
|
||||||
|
;;; You should have received a copy of the GNU Lesser General Public
|
||||||
|
;;; License along with this library; if not, write to the Free Software
|
||||||
|
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
|
||||||
|
;;;
|
||||||
|
;;; Read Texinfo fragments from stdin (docstrings of Guile's primitives
|
||||||
|
;;; in the format of `guile-procedures.texi'), and write to stdout a
|
||||||
|
;;; textual rendering thereof. The output preserves page breaks (^L)
|
||||||
|
;;; found in the input, as per the Guile Documentation Format
|
||||||
|
;;; version 2---see (ice-9 documentation).
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(use-modules (texinfo)
|
||||||
|
(texinfo plain-text)
|
||||||
|
(srfi srfi-1)
|
||||||
|
(ice-9 match)
|
||||||
|
(rnrs io ports))
|
||||||
|
|
||||||
|
(define (docstring-fragments->strings str)
|
||||||
|
"Return the list resulting from the split of STR at each page
|
||||||
|
break (^L)"
|
||||||
|
(string-tokenize str (char-set-complement (char-set #\page))))
|
||||||
|
|
||||||
|
(match (command-line)
|
||||||
|
((_ texi-file)
|
||||||
|
(let* ((fragments (remove (compose string-null? string-trim-both)
|
||||||
|
(call-with-input-file texi-file
|
||||||
|
(compose docstring-fragments->strings
|
||||||
|
get-string-all))))
|
||||||
|
(stexi (map texi-fragment->stexi fragments)))
|
||||||
|
(format #t "Produced by GNU Guile ~a from `~a'.~%~%"
|
||||||
|
(version) texi-file)
|
||||||
|
(for-each (lambda (stexi)
|
||||||
|
(display #\page)
|
||||||
|
(display (stexi->plain-text stexi)))
|
||||||
|
stexi)))
|
||||||
|
((command args ...)
|
||||||
|
(format (current-error-port) "invalid arguments: ~s~%" args)
|
||||||
|
(format (current-error-port) "Usage: ~a TEXINFO-FILE~%" command)
|
||||||
|
(exit 1)))
|
Loading…
Add table
Add a link
Reference in a new issue