summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-27 11:15:19 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2011-05-27 11:15:19 (GMT)
commitb39efd37a7fbf478072c72f82b4310c8620a4cea (patch) (side-by-side diff)
treedf820ba6952b5f59d868a3ce1811a758b7891ab5
parenta5774356a1c12d1bcb55b6322710e347e1604fc9 (diff)
downloadgint-b39efd37a7fbf478072c72f82b4310c8620a4cea.tar.gz
gint-b39efd37a7fbf478072c72f82b4310c8620a4cea.tar.bz2
Fix builds without Guile.
* gint.m4: New option: doc-distrib. * gint.mk: Distribute generated files if doc-distrib was set. If not, don't distribute guile-procedures.texi and guile-procedures.txt, as this breaks builds without Guile. * guile.m4: Define GINT_COND_GUILE_OK conditional if Guile is present and selected for use. * README: Document doc-distrib.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--README27
-rw-r--r--gint.m44
-rw-r--r--gint.mk28
-rw-r--r--guile.m43
4 files changed, 52 insertions, 10 deletions
diff --git a/README b/README
index 58f9b9f..5975884 100644
--- a/README
+++ b/README
@@ -144,13 +144,14 @@ therefore we could add to `src/Makefile.am` the following line:
include ../gint/gint.mk
-----------------------
The rules in `gint.mk` make certain assumptions about some `Makefile`
variables. Namely, the following variables must be defined before
including the file: +INCLUDES+, +EXTRA_DIST+, +CLEANFILES+,
-+DISTCLEANFILES+, +SUFFIXES+, +BUILT_SOURCES+. See the
++DISTCLEANFILES+ (or +MAINTAINERCLEANFILES+, if +doc-distrib+
+option is used), +SUFFIXES+, +BUILT_SOURCES+. See the
http://sources.redhat.com/automake/automake.html[`Automake` documentation],
for more info on these. If no special value is needed, define each
of them to an empty string (see example below).
Firthermore, the +MAKEINFO+ variable must contain the pathname (not
necessarily an absolute one), of the +makeinfo+ binary. It is initialized
@@ -245,12 +246,25 @@ GINT_INIT([gint], [1.8])
The following is a list of valid options:
nodoc::
Disable generation of +.doc+ files (see <<doc-snarfing, Doc snarfing>>).
+doc-distrib::
+Add generated docfiles to distribution tarball. The following files are
+added: +\*.doc+, +\*.x+, +guile-procedures.texi+ and +guile-procedures.txt+.
+Normally they are not distributed and are recreated on each built. A minor
+drawback of this approach is that it requires installers to have *makeinfo*
+installed. If this option is given, the files will be included in the
+tarball and no rebuild will be necessary.
++
+If this option is used, +MAINTAINERCLEANFILES+ must be defined before
+including +gint.mk+.
++
+See also <<doc-snarfing, Doc snarfing>>.
+
inc::
Enable generation of `.inc` files. Each such file contains a set of
`export` statements, one for each `SCM_DEFINE` in the corresponding
`.c` source file. Normally this option is not needed, because it is
more appropriate to define public interfaces using `SCM_DEFINE_PUBLIC`
macro.
@@ -486,13 +500,22 @@ GINT_LDADD::
Specifies additional command line options to be appended to the
+LDADD+ statement in +gint/Makefile.am+.
Notice also that if your code does not require doc snarfing, you
may disable it by supplying the +nodoc+ option to the invocation
of +GINT_INIT+.
-
+
+By default, doc files are not included in the distribution tarball, which
+means that they will be recreated at build time. Creation of
++guile-procedures.txt+ requires *makeinfo*, which may not always be present.
+To simplify built requirements, you can instruct +GINT+ to include the generated
+files to the distribution. To do so, add the +doc-distrib+ option to the
+invocation of +GINT_INIT+. The following files will be included in the
+distribution: +\*.doc+, +\*.x+, +guile-procedures.texi+ and
++guile-procedures.txt+.
+
[[guile-site-dir]]
THE `SITE DIRECTORY' PROBLEM
----------------------------
Projects installing some Scheme sources would normally want to install
them under Guile's 'site directory' (+%site-dir+ Guile primitive). This way,
Guile will be able to find them without any additional configuration. However,
diff --git a/gint.m4 b/gint.m4
index 4f3ff48..6e58893 100644
--- a/gint.m4
+++ b/gint.m4
@@ -59,21 +59,23 @@ AC_SUBST(GINT_LDADD)
dnl GINT_INIT([DIR], [OPTIONS], [IF-FOUND], [IF-NOT-FOUND])
dnl -------------------------------------------------------
dnl DIR Gint submodule directory (defaults to 'gint')
dnl OPTIONS A whitespace-separated list of options. Currently recognized
dnl options are: 'inc', 'std-site-dir','snarf-doc-filter',
-dnl 'nodoc', and version number.
+dnl 'nodoc', 'doc-distrib', and version number.
dnl IF-FOUND What to do if Guile is present.
dnl IF-NOT-FOUND What to do otherwise.
dnl
AC_DEFUN([GINT_INIT],[
AM_PROG_LEX
_GINT_SET_OPTIONS([$2])
AC_SUBST([GINT_MODULE_DIR],[m4_if([$1],,[gint],[$1])])
AM_CONDITIONAL([GINT_COND_INC],[_GINT_IF_OPTION_SET([inc],[true],[false])])
AM_CONDITIONAL([GINT_COND_DOC],[_GINT_IF_OPTION_SET([nodoc],[false],[true])])
AM_CONDITIONAL([GINT_COND_SNARF_DOC_FILTER],dnl
[_GINT_IF_OPTION_SET([snarf-doc-filter],[true],[false])])
+ AM_CONDITIONAL([GINT_COND_DOC_DISTRIB],dnl
+ [_GINT_IF_OPTION_SET([doc-distrib],[true],[false])])
GINT_CHECK_GUILE(m4_ifdef([_GINT_GUILE_VERSION],_GINT_GUILE_VERSION),[$3],[$4])
])
diff --git a/gint.mk b/gint.mk
index 7befe5e..b8d03f3 100644
--- a/gint.mk
+++ b/gint.mk
@@ -11,37 +11,50 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+if GINT_COND_GUILE_OK
INCLUDES += @GUILE_INCLUDES@
+if GINT_COND_DOC_DISTRIB
+ EXTRA_DIST += $(DOT_X_FILES)
+ MAINTAINERCLEANFILES += $(DOT_X_FILES)
+else
+ DISTCLEANFILES += $(DOT_X_FILES)
+endif
BUILT_SOURCES += $(DOT_X_FILES)
-DISTCLEANFILES += $(DOT_X_FILES)
ETAGS_ARGS = --regex='/SCM_\(GLOBAL_\)?\(G?PROC\|G?PROC1\|SYMBOL\|VCELL\|CONST_LONG\).*\"\([^\"]\)*\"/\3/' \
--regex='/[ \t]*SCM_[G]?DEFINE1?[ \t]*(\([^,]*\),[^,]*/\1/'
SUFFIXES += .x
snarfcppopts = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
if GINT_COND_DOC
-EXTRA_DIST += guile-procedures.texi guile-procedures.txt
+
+if GINT_COND_DOC_DISTRIB
+ EXTRA_DIST += guile-procedures.texi guile-procedures.txt $(DOT_DOC_FILES)
+ MAINTAINERCLEANFILES += \
+ $(DOT_DOC_FILES)\
+ guile-procedures.texi\
+ guile-procedures.txt
+else
+ DISTCLEANFILES += \
+ $(DOT_DOC_FILES)\
+ guile-procedures.texi\
+ guile-procedures.txt
+endif
site_DATA += guile-procedures.txt
BUILT_SOURCES += $(DOT_DOC_FILES) guile-procedures.texi
-DISTCLEANFILES += \
- $(DOT_DOC_FILES)\
- guile-procedures.texi\
- guile-procedures.txt
-
SUFFIXES += .doc
if GINT_COND_SNARF_DOC_FILTER
GUILE_DOC_SNARF=$(top_builddir)/$(GINT_MODULE_DIR)/snarf-doc-filter --snarfer
else
GUILE_DOC_SNARF=$(top_builddir)/$(GINT_MODULE_DIR)/clexer --snarfer
@@ -72,7 +85,8 @@ CLEANFILES += *.inc
.doc.inc:
$(AM_V_GEN)$(top_srcdir)/$(GINT_MODULE_DIR)/extract-exports -o $@ $<
endif
## Add -MG to make the .x magic work with auto-dep code.
MKDEP = $(CC) -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+endif
diff --git a/guile.m4 b/guile.m4
index f695a21..e3bad16 100644
--- a/guile.m4
+++ b/guile.m4
@@ -149,11 +149,14 @@ AC_DEFUN([GINT_CHECK_GUILE],
AC_DEFINE_UNQUOTED(GUILE_VERSION, "$GUILE_VERSION",
[Guile version number])
AC_DEFINE_UNQUOTED(GUILE_VERSION_NUMBER, $GUILE_VERSION_NUMBER,
[Guile version number: MAX*10 + MIN])
m4_if([$2],,,[$2])
fi
+
m4_if([$3],,,[else
$3])
fi
+
+ AM_CONDITIONAL([GINT_COND_GUILE_OK],[test $gint_guile_status = ok])
])

Return to:

Send suggestions and report system problems to the System administrator.