GNU bug report logs - #7995
Guile support in Automake

Previous Next

Package: automake;

Reported by: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>

Date: Sun, 6 Feb 2011 22:15:02 UTC

Severity: wishlist

To reply to this bug, email your comments to 7995 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 06 Feb 2011 22:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>:
New bug report received and forwarded. Copy sent to bug-automake <at> gnu.org. (Sun, 06 Feb 2011 22:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: bug-automake <at> gnu.org
Cc: Andy Wingo <wingo <at> pobox.com>,
	Ludovic Courtès <ludo <at> gnu.org>
Subject: Guile support in Automake
Date: Sun, 6 Feb 2011 23:22:57 +0100
Automake should support Guile.
(From Ludovic Courtès and Andy Wingo).

I actually have patches for some tests, documentation and half an
implementation from last year; opening this PR now to track progress
and not forget again.

Thanks,
Ralf




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 07:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: 7995 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
	Andy Wingo <wingo <at> pobox.com>
Subject: Re: bug#7995: Guile support in Automake
Date: Sun, 20 Feb 2011 08:30:36 +0100
[ http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7995 aka
  http://thread.gmane.org/gmane.comp.sysutils.automake.bugs/5303 ]

* Ralf Wildenhues wrote on Sun, Feb 06, 2011 at 11:22:57PM CET:
> Automake should support Guile.

> I actually have patches for some tests, documentation and half an
> implementation from last year;

Here we go.  For now I've done little with the patches except rebase
and squash the intermediate stages, update copyright years, remove
notes from git, and ensure there are no syntax errors.

That means however, that nothing really works yet.  It's still a total
mess.  So what I would like to ask from readers at this point is:
please go through the doc changes and let's discuss them first.
Also, it is important to not step on guile/meta/guile.m4 toes (or vice
versa), so some checking for that is prodent.  When we know what is
desired, the tests should be amended/fixed to cover that, and then we
can fix the implementation to follow.

If you prefer, I can also put them in a temporary branch (which for the
moment I would expect to be rewound at some point later).

Here's a preliminary list of issues that I see:

- Why guile_GUILE and not guile_LISP?  What's the rationale for naming
  it differently, and what's the rationale for actually treating it
  differently?  This question has two parts: LISP is treated by emacs
  not guile-tools, and IIUC then the idea was that GUILE is compiled
  already at 'make all' time and not just at 'make install' time, right?
  Is the latter part just "nice to have" or an important feature?

- The current tests assume _GUILE sources are distributed by default;
  OTOH, _LISP are not.  Rationale for this semantic difference?

- Please fix errors you can find in the tests; esp. the extension module
  in guile3.test doesn't seem to do the right thing yet (with my
  unfinished implementation).

- I renamed guileextensiondir from earlier suggestions to guileextdir,
  both for brevity, and to avoid the question of whether there is a
  trailing 's' in the name.  OK?

- The Guile manual documents Autoconf macros distributed in
  $datarootdir/aclocal/guile.m4.  The names in there are a bit
  unfortunate in that the macros more or less use the same GUILE_*
  namespace that we would like to use for some variables (which means
  you cannot easily turn on checking for unexpanded macro names through
  something like
    m4_pattern_forbid([^GUILE_])dnl

  and there is even overlap in the semantics and shell variable names.
  We need to address that; esp. since the macros shipped with Guile have
  been out there for long, we cannot just expect them to disappear
  instantly.  There should be a clear, backward-compatible upgrade path,
  and a clear intent on how usage should be in the future, for Guile
  users both with and without Automake.

- The handling of compile and link flags is still quite suboptimal.
  I still need to think about that a bit more.

- I haven't yet considered the handling of flags to uninstalled module
  stuff.  This is just TODO.

- My current plan is to either not provide something like
    foo_scm_GUILEFLAGS = override for $(AM_GUILEFLAGS)

  or to not let it cause renamed .go files.  Do you think users will
  need per-target guile-tools compile flags?  Because if they do, then
  we need to document this stuff, and that it's not in line with how
  Automake operates elsewhere, etc.

- The register_language bits in the last patch are totally unused yet,
  as the machinery isn't yet able to handle languages that either don't
  use a linker in the end, or don't rename objects with per-target flags
  which is probably desirable for Guile (similar to how Python support
  works).

I should apologize for taking totally random and unorganized notes
below.  They are basically just a jot-down from last year of what Andy
and Ludo said.

Thanks,
Ralf


Notes about Guile support:

# set from guile-config
# or from pkg-config if guile major version known

.go: compiled guile files
     sys-dep not executable byte-code
.scm: source guile files (can have other extensions)
.sls .sps .ss

One problem will be: when we add Go support, .go has conflicting
semantics.


cat > Makefile.am <<\END
guile_GUILE = compiled-and-installed.scm
nodist_guile_GUILE = not-distributed.scm
guile_DATA = not-compiled.scm
noinst_GUILE = compiled-but-not-installed.scm
dist_noinst_DATA = just-distributed-blob.scm

# object files will be installed in respective subdir of guileexecdir.
nobase_guile_GUILE = installed-in-subdir/foo.scm

pkgguile_GUILE = installed-in-package-dir.scm
END

# without guile compiler, just install sources
# but also install objects whenever possible

GUILE_TOOLS = guile-tools
GUILE_TOOLS_COMPILE = $(GUILE_TOOLS) compile
GUILE_COMPILE = $(GUILE_TOOLS_COMPILE) $(AM_GUILEFLAGS) $(GUILEFLAGS)

$(GUILE_TOOLS_COMPILE) $(AM_GUILEFLAGS) $(GUILEFLAGS) -o $@ $<
# no ordering req
# no renaming

foo_scm_GUILEFLAGS should not cause the output to be renamed.


AM_PATH_GUILE([minimum-version], [if-available], [if-not=AC_MSG_ERROR])

# effective version: first numbers on the first line

guile-tools --effective-version
       X.Y
  or
guile-tools --version | sed 's/[1-9][0-9.]'

error out if X.Y is < 1.8

# not: guile -c '(begin (display (effective-version)) (newline))'

# .go

# guile-tools compile load path
# -L . -L $(srcdir) or GUILE_LOAD_PATH = a:b:c: GUILE_LOAD_COMPILED_PATH
# -L is for source
# -M is for output
# GUILE_LOAD_PATH is for source only, lower prio than -L
# GUILE_LOAD_COMPILED_PATH is for obj only


.scm.go:


libtool --mode=execute -dlopen foo.la guile bar.scm
bar.scm:
(dynamic-link "foo")

make install
guile bar.scm


bar.scm loads foo.la

bar.scm


# 1.6: error
# 1.8:
# guiledir = $(datarootdir)/guile/site
# > 1.8:
# guiledir = $(datarootdir)/guile/site/X.Y
#      possibly version-independent
#      sources for users
# guilepkgdir = $(guiledir)/$(PACKAGE)
#
# for 1.8:
# guileexecdir = $(libdir)
# > 1.8:
# guileexecdir = $(libdir)/guile/X.Y
#      version-dependent
#
# guilesitedir = $(guiledir)/site
#
# guileextensiondir = $(guileexecdir)/extensions
#


cat > Makefile.am <<\END

guile_GUILE = foo.scm bar.scm baz.scm
# The next line looks wrong; should be noinst_GUILE?
noinst_guile_GUILE = foo.scm bar.scm baz.scm

guile_DATA = not-compiled.scm

nobase_guile_GUILE = sub/foo.scm
nobase_pkgguile_GUILE = sub/foo.scm
# compiled object goes into subdir as well.

nodist_guile_GUILE

guileextension_LTLIBRARIES = foo.la
foo_la_LDFLAGS = -module

foo_la_LIBADD = $(GUILELIBS)
foo_la_CFLAGS = $(GUILECFLAGS)
foo_la_CPPFLAGS = $(GUILECPPFLAGS)
AM_CPPFLAGS
AM_CFLAGS
# AM_LDADD
# there should be an AM_LIBADD


# or: in configure.ac:
CFLAGS="$GUILECFLAGS $CPPFLAGS"
LIBS="$GUILELIBS $LIBS"




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 07:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: 7995 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
	Andy Wingo <wingo <at> pobox.com>
Subject: [PATCH 1/4] Documentation for Guile support.
Date: Sun, 20 Feb 2011 08:31:38 +0100
* doc/automake.texi (Guile): New chapter.
(Top, Other GNU Tools): Update menus.
* NEWS: Update.
Initial suggestion and lots of ideas and from Andy Wingo and
Ludovic Courtè.
---
 ChangeLog         |    9 +++
 NEWS              |    5 ++
 doc/automake.texi |  154 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 167 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 12b8e9f..c338e8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-02-20  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
+
+	Documentation for Guile support.
+	* doc/automake.texi (Guile): New chapter.
+	(Top, Other GNU Tools): Update menus.
+	* NEWS: Update.
+	Initial suggestion and lots of ideas and from Andy Wingo and
+	Ludovic Courtès.
+
 2011-02-16  Stefano Lattarini  <stefano.lattarini <at> gmail.com>
 	    Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
 
diff --git a/NEWS b/NEWS
index a5dc93f..401d69b 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,11 @@ New in 1.11a:
 
   - New `cscope' target to build a cscope database for the source tree.
 
+* Languages changes:
+
+  - Support for compilation and installation of Guile source code and compiled
+    Guile source code via the new `GUILE' primary.
+
 * Miscellaneous changes:
 
   - The `dist' and `dist-all' targets now can run compressors in parallel.
diff --git a/doc/automake.texi b/doc/automake.texi
index 474f5a1..078dfbb 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -291,6 +291,7 @@ Top
 * Libtool::                     Libtool
 * Java::                        Java
 * Python::                      Python
+* Guile::                       Guile
 
 Building documentation
 
@@ -2073,7 +2074,7 @@ Uniform
 objects are not installed either.
 
 The current primary names are @samp{PROGRAMS}, @samp{LIBRARIES},
-@samp{LTLIBRARIES}, @samp{LISP}, @samp{PYTHON}, @samp{JAVA},
+@samp{LTLIBRARIES}, @samp{LISP}, @samp{PYTHON}, @samp{GUILE}, @samp{JAVA},
 @samp{SCRIPTS}, @samp{DATA}, @samp{HEADERS}, @samp{MANS}, and
 @samp{TEXINFOS}.
 @vindex PROGRAMS
@@ -2081,6 +2082,7 @@ Uniform
 @vindex LTLIBRARIES
 @vindex LISP
 @vindex PYTHON
+@vindex GUILE
 @vindex JAVA
 @vindex SCRIPTS
 @vindex DATA
@@ -7446,6 +7448,7 @@ Other GNU Tools
 * Libtool::                     Libtool
 * Java::                        Java
 * Python::                      Python
+* Guile::                       Guile
 @end menu
 
 
@@ -7736,6 +7739,155 @@ Python
 Install Paths}.
 
 
+@node Guile
+@section Guile
+
+@cindex @code{_GUILE} primary, defined
+@cindex @code{GUILE} primary, defined
+@cindex Primary variable, @code{GUILE}
+@vindex _GUILE
+
+Automake provides support for compiled Guile source files with the
+@code{GUILE} primary as well as for installation of extensions modules
+for Guile in a compiled language such as C.  A typical setup is to call
+@code{AM_PATH_GUILE} in @file{configure.ac} and use a line like the
+following in @file{Makefile.am}:
+
+@example
+guile_GUILE = foo.scm bar.sls baz.sps zork.ss
+@end example
+
+Here's a longer example with different types of file handling:
+
+@example
+guile_GUILE = compiled-and-installed.scm
+nodist_guile_GUILE = not-distributed.scm
+guile_DATA = not-compiled.scm
+noinst_GUILE = compiled-but-not-installed.scm
+dist_noinst_DATA = just-distributed-blob.scm
+
+# object files will be installed in respective subdir of guileexecdir.
+nobase_guile_GUILE = installed-in-subdir/foo.scm
+
+pkgguile_GUILE = installed-in-package-dir.scm
+@end example
+
+Here's an example of a typical extension module written in C:
+
+@example
+guileext_LTLIBRARIES = foo.la
+foo_la_SOURCES = foo.c
+foo_la_LDFLAGS = -module -avoid-version
+foo_la_LIBADD = $(GUILELIBS)
+AM_CFLAGS = $(GUILECFLAGS)
+AM_CPPFLAGS = $(GUILECPPFLAGS)
+@end example
+
+When @samp{AM_PATH_GUILE} is used, the suffixes @file{.scm}, @file{.sls},
+@file{.sps}, and @file{.ss} are assumed to be Guile sources, and
+compiled files will carry the @file{.go} extension.
+
+Any files listed in a @code{_GUILE} variable will be byte-compiled
+with @command{guile-tools compile} if that is available and new enough
+to compile Guile sources.
+
+Automake ships with an Autoconf macro called @code{AM_PATH_GUILE}
+that will determine some Guile-related directory variables (see
+below).  If you have called @code{AM_PATH_GUILE} from
+@file{configure.ac}, then you may use the variables
+@code{guile_GUILE} or @code{pkgguile_GUILE} to list Guile source
+files in your @file{Makefile.am}, depending on where you want your files
+installed (see the definitions of @code{guiledir} and
+@code{pkgguiledir} below).
+
+@defmac AM_PATH_GUILE (@ovar{version}, @ovar{action-if-found}, @
+  @ovar{action-if-not-found})
+
+Search for a Guile compiler @samp{guile-tools compile} on the system.
+This macro takes three optional arguments.  The first argument, if
+present, is the minimum version of Guile required for this package:
+@code{AM_PATH_GUILE} will skip any Guile interpreter that is older than
+@var{version}.  If an interpreter is found and satisfies @var{version},
+then @var{action-if-found} is run.  Otherwise, @var{action-if-not-found}
+is run.  Without a @var{version} argument, a minimum version of 1.8 is
+checked against.
+
+If @var{action-if-not-found} is not specified, as in the following
+example, the default is to abort @command{configure}.
+
+@example
+AM_PATH_GUILE([2.0])
+@end example
+
+@noindent
+This is fine when Guile is an absolute requirement for the package.
+If Guile >= 2.0 was only @emph{optional} to the package,
+@code{AM_PATH_GUILE} could be called as follows.
+
+@example
+AM_PATH_GUILE([2.0],, [:])
+@end example
+
+@code{AM_PATH_GUILE} creates the following output variables based on
+the Guile installation found during configuration.
+@end defmac
+
+@vtable @code
+@item GUILE_TOOLS
+The name of the @command{guile-tools} executable, or @samp{:} if no
+suitable compiler could be found.
+
+Assuming @var{action-if-not-found} is used (otherwise @file{./configure}
+will abort if Guile is absent), the value of @code{GUILE} can be used
+to setup a conditional in order to disable the relevant part of a build
+as follows.
+
+@example
+AM_PATH_GUILE(,, [:])
+AM_CONDITIONAL([HAVE_GUILE], [test "$GUILE_TOOLS" != :])
+@end example
+
+@item GUILE_VERSION
+The Guile version number, in the form @var{major}.@var{minor}
+(e.g., @samp{1.8}).
+
+@item guiledir
+The directory name for the installation of user Guile source code.
+By default, that is @samp{$(datarootdir)/guile/site/@var{x.y}} for
+Guile versions @var{x.y} greater than 1.8, and
+@samp{$(datarootdir)/guile/site} for version 1.8.
+
+@item pkgguiledir
+This is the directory under @code{guiledir} that is named after the
+package.  That is, it is @samp{$(guiledir)/$(PACKAGE)}.  It is provided
+as a convenience.
+
+@item guileexecdir
+This is the directory where compiled Guile source code will be installed.
+The default is @samp{$(libdir)/guile/@var{x.y}/ccache} if a Guile Scheme
+compiler is available, and @samp{$(libdir)} otherwise.
+
+@item guileextdir
+This is the directory where Guile C extensions will be installed.
+The default is @samp{$(libdir)/guile/@var{x.y}/extensions} for versions
+@var{x.y} greater than 1.8, and @samp{$(libdir)} otherwise.
+
+@c @example
+@c XXX
+@c @end example
+@end vtable
+
+All these directory variables have values that start with either
+@samp{$@{prefix@}} or @samp{$@{exec_prefix@}} unexpanded.  This works
+fine in @file{Makefiles}, but it makes these variables hard to use in
+@file{configure}.  This is mandated by the GNU coding standards, so
+that the user can run @samp{make prefix=/foo install}.  The Autoconf
+manual has a section with more details on this topic
+(@pxref{Installation Directory Variables, , Installation Directory
+Variables, autoconf, The Autoconf Manual}).  See also @ref{Hard-Coded
+Install Paths}.
+
+
 @node Documentation
 @chapter Building documentation
 
-- 
1.7.4.1.48.g5673d





Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 07:33:02 GMT) Full text and rfc822 format available.

Message #14 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: 7995 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
	Andy Wingo <wingo <at> pobox.com>
Subject: [PATCH 2/4] Testsuite coverage for Guile support.
Date: Sun, 20 Feb 2011 08:31:59 +0100
* tests/guile1.test, tests/guile2.test, tests/guile3.test,
tests/guile4.test: New tests.
* tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
---
 ChangeLog         |    5 ++
 tests/Makefile.am |    8 +++
 tests/Makefile.in |    7 ++-
 tests/guile1.test |   54 ++++++++++++++++++++++
 tests/guile2.test |  132 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/guile3.test |   91 ++++++++++++++++++++++++++++++++++++
 tests/guile4.test |   48 +++++++++++++++++++
 7 files changed, 344 insertions(+), 1 deletions(-)
 create mode 100755 tests/guile1.test
 create mode 100755 tests/guile2.test
 create mode 100755 tests/guile3.test
 create mode 100755 tests/guile4.test

diff --git a/ChangeLog b/ChangeLog
index c338e8a..5483ce4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-02-20  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
 
+	Testsuite coverage for Guile support.
+	* tests/guile1.test, tests/guile2.test, tests/guile3.test,
+	tests/guile4.test: New tests.
+	* tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
+
 	Documentation for Guile support.
 	* doc/automake.texi (Guile): New chapter.
 	(Top, Other GNU Tools): Update menus.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e3eb9e9..b993678 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -24,6 +24,10 @@ all.test \
 auxdir2.test \
 cond17.test \
 gcj6.test \
+guile1.test \
+guile2.test \
+guile3.test \
+guile4.test \
 override-conditional-2.test \
 txinfo5.test
 
@@ -460,6 +464,10 @@ gnuwarn2.test \
 gnits.test \
 gnits2.test \
 gnits3.test \
+guile1.test \
+guile2.test \
+guile3.test \
+guile4.test \
 header.test \
 help.test \
 help2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 1f367cd..e449137 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -284,7 +284,8 @@ top_srcdir = @top_srcdir@
 MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
 EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
 	$(TESTS)
-XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
+XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test guile1.test \
+	guile2.test guile3.test guile4.test \
 	override-conditional-2.test txinfo5.test \
 	$(instspc_xfail_tests)
 parallel_tests = backcompat5-p.test check-exported-srcdir-p.test \
@@ -722,6 +723,10 @@ gnuwarn2.test \
 gnits.test \
 gnits2.test \
 gnits3.test \
+guile1.test \
+guile2.test \
+guile3.test \
+guile4.test \
 header.test \
 help.test \
 help2.test \
diff --git a/tests/guile1.test b/tests/guile1.test
new file mode 100755
index 0000000..94efa82
--- /dev/null
+++ b/tests/guile1.test
@@ -0,0 +1,54 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program 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 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/>.
+
+# Basic Guile support: guile_GUILE.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<\END
+AM_PATH_GUILE
+AC_OUTPUT
+END
+
+cat > Makefile.am <<\END
+guile_GUILE = foo.scm bar.scm baz.scm
+END
+
+: >foo.scm
+: >bar.scm
+: >baz.scm
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+grep '^GUILECOMPILE' Makefile.in
+grep '^GUILEFLAGS' Makefile.in
+
+inst=`pwd`/inst
+./configure --prefix="$inst"
+
+env GUILE_TOOLS=false $MAKE -e && Exit 1
+env AM_GUILEFLAGS=--nosuchflag $MAKE -e && Exit 1
+env GUILEFLAGS=--nosuchflag $MAKE -e && Exit 1
+
+$MAKE
+$MAKE install
+$MAKE distcheck
+
+:
diff --git a/tests/guile2.test b/tests/guile2.test
new file mode 100755
index 0000000..d355518
--- /dev/null
+++ b/tests/guile2.test
@@ -0,0 +1,132 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program 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 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/>.
+
+# Ensure that we compile and install Guile sources properly.
+
+required='guile-tools'
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<\END
+AM_PATH_GUILE([1.8],,
+  [AC_MSG_ERROR([Guile installation missing or too old for compilation],
+		[77])])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<\END
+guile_GUILE = compiled-and-installed.scm
+nodist_guile_GUILE = not-distributed.scm
+guile_DATA = not-compiled.scm
+noinst_GUILE = compiled-but-not-installed.scm
+dist_noinst_DATA = just-distributed-blob.scm
+nobase_guile_GUILE = installed-in-subdir/foo.scm
+pkgguile_GUILE = installed-in-package-dir.scm
+
+not-distributed.scm:
+	: >$@
+
+CLEANFILES = not-distributed.scm
+
+check-dist:
+	test -f $(distdir)/compiled-and-installed.scm
+	test ! -f $(distdir)/not-distributed.scm
+	test -f $(distdir)/not-compiled.scm
+	test -f $(distdir)/compiled-but-not-installed.scm
+	test -f $(distdir)/just-distributed-blob.scm
+	test -f $(distdir)/installed-in-subdir/foo.scm
+	test -f $(distdir)/installed-in-package-dir.scm
+	test -z "`find $(distdir) -name \*.go`"
+END
+
+mkdir installed-in-subdir
+
+: >compiled-and-installed.scm
+: >not-compiled.scm
+: >compiled-but-not-installed.scm
+: >just-distributed-blob.scm
+: >installed-in-subdir/foo.scm
+: >installed-in-package-dir.scm
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+inst=`pwd`/inst
+./configure --prefix="$inst"
+$MAKE
+test -f compiled-and-installed.go
+test -f not-distributed.go
+test ! -f not-compiled.go
+test -f compiled-but-not-installed.go
+test ! -f just-distributed-blob.go
+test -f installed-in-subdir/foo.go
+test -f installed-in-package-dir.go
+
+guile_version=
+if : new install layout; then
+  guiledir=$inst/share/guile/site/$guile_version
+  guileexecdir=$inst/lib/guile/$guile_version/ccache
+else
+  guiledir=$inst/share/guile/site
+  guileexecdir=$inst/lib
+fi
+
+$MAKE install-data
+test -f "$guiledir/compiled-and-installed.scm"
+test -f "$guiledir/not-distributed.scm"
+test ! -f "$guiledir/not-compiled.scm"
+test ! -f "$guiledir/compiled-but-not-installed.scm"
+test ! -f "$guiledir/just-distributed-blob.scm"
+test -f "$guiledir/installed-in-subdir/foo.scm"
+test -f "$guiledir/$me/installed-in-package-dir.scm"
+
+installed_go=`find "$inst" -name \*.go`
+test -z "$installed_go"
+$MAKE uninstall
+
+$MAKE install-exec
+if : can compile; then
+  test -f "$guileexecdir/compiled-and-installed.go"
+  test -f "$guileexecdir/not-distributed.go"
+  test ! -f "$guileexecdir/not-compiled.go"
+  test ! -f "$guileexecdir/compiled-but-not-installed.go"
+  test ! -f "$guileexecdir/just-distributed-blob.go"
+  test -f "$guileexecdir/installed-in-subdir/foo.go"
+  test -f "$guileexecdir/$me/installed-in-package-dir.go"
+  installed_scm=`find "$inst" -name \*.scm`
+  test -z "$installed_scm"
+else
+  installed_go=`find "$inst" -name \*.go`
+  test -z "$installed_go"
+fi
+
+$MAKE clean
+
+test ! -f compiled-and-installed.go
+test ! -f not-distributed.go
+test ! -f not-compiled.go
+test ! -f compiled-but-not-installed.go
+test ! -f just-distributed-blob.go
+test ! -f installed-in-subdir/foo.go
+test ! -f installed-in-package-dir.go
+
+$MAKE check-dist
+
+$MAKE distcheck
+
+:
diff --git a/tests/guile3.test b/tests/guile3.test
new file mode 100755
index 0000000..4be3c82
--- /dev/null
+++ b/tests/guile3.test
@@ -0,0 +1,91 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program 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 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/>.
+
+# Check for Guile compiled extensions.
+
+required='guile-tools libtoolize'
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<\END
+AC_PROG_CC
+AC_PROG_LIBTOOL
+AM_PATH_GUILE
+AC_PATH_PROG([GUILE], [guile], [exit 77])
+: "${GUILECPPFLAGS=`guile-config compile`}"
+: "${GUILECFLAGS=`guile-config compile`}"
+: "${GUILELIBS=`guile-config link`}"
+AC_SUBST([GUILECPPFLAGS])
+AC_SUBST([GUILECFLAGS])
+AC_SUBST([GUILELIBS])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<\END
+guileext_LTLIBRARIES = foo.la
+foo_la_SOURCES = foo.c
+foo_la_LDFLAGS = -module -avoid-version
+foo_la_LIBADD = $(GUILELIBS)
+AM_CFLAGS = $(GUILECFLAGS)
+AM_CPPFLAGS = $(GUILECPPFLAGS)
+
+guile_GUILE = load-foo.scm
+
+# Try out the uninstalled module.
+check-local:
+	$(LIBTOOL) --mode=execute -dlopen foo.la $(GUILE) load-foo.scm
+# Try out the installed module.
+installcheck-local:
+	$(GUILE) load-foo.scm
+END
+
+cat > load-foo.scm <<\END
+(dynamic-call "init_the_answer" (dynamic-link "foo"))
+(answer)
+END
+
+cat >foo.c <<\END
+#include <libguile.h>
+
+SCM
+the_answer (void)
+{
+  return scm_int2num (42);
+}
+
+void
+init_the_answer (void)
+{
+  scm_c_define_gsubr ("answer", 0, 0, 0, the_answer);
+}
+END
+
+inst=`pwd`/inst
+
+libtoolize --force
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+./configure --prefix="$inst"
+$MAKE
+$MAKE check
+$MAKE install
+$MAKE clean
+$MAKE installcheck
+$MAKE distcheck
+
+:
diff --git a/tests/guile4.test b/tests/guile4.test
new file mode 100755
index 0000000..47a0ad9
--- /dev/null
+++ b/tests/guile4.test
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program 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 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/>.
+
+# Per-target flags should not cause compiled Guile sources to be renamed.
+
+required=guile-tools
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<\END
+AM_PATH_GUILE
+AC_OUTPUT
+END
+
+cat > Makefile.am <<\END
+guile_GUILE = foo.scm
+foo_scm_GUILEFLAGS = ...
+END
+
+: >foo.scm
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE --add-missing
+
+inst=`pwd`/inst
+./configure --prefix="$inst"
+$MAKE
+test -f foo.go
+test ! -f foo_go_foo.go
+
+$MAKE distcheck
+
+:
-- 
1.7.4.1.48.g5673d





Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 07:33:02 GMT) Full text and rfc822 format available.

Message #17 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: 7995 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
	Andy Wingo <wingo <at> pobox.com>
Subject: [PATCH 3/4] Guile macro AM_PATH_GUILE.
Date: Sun, 20 Feb 2011 08:32:17 +0100
* m4/guile.m4 (AM_PATH_GUILE): New file, new macro.
* m4/Makefile.am (dist_m4data_DATA): Add guile.m4.
---
 ChangeLog      |    4 +++
 m4/Makefile.am |    3 +-
 m4/Makefile.in |    3 +-
 m4/guile.m4    |   63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 71 insertions(+), 2 deletions(-)
 create mode 100644 m4/guile.m4

diff --git a/ChangeLog b/ChangeLog
index 5483ce4..bd27a05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-02-20  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
 
+	Guile macro AM_PATH_GUILE.
+	* m4/guile.m4 (AM_PATH_GUILE): New file, new macro.
+	* m4/Makefile.am (dist_m4data_DATA): Add guile.m4.
+
 	Testsuite coverage for Guile support.
 	* tests/guile1.test, tests/guile2.test, tests/guile3.test,
 	tests/guile4.test: New tests.
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 0cf074b..fe7a8d6 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -3,7 +3,7 @@
 ## Makefile for Automake m4.
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2011 Free Software Foundation, Inc.
 
 # 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
@@ -31,6 +31,7 @@ depend.m4 \
 depout.m4 \
 dmalloc.m4 \
 gcj.m4 \
+guile.m4 \
 header.m4 \
 init.m4 \
 install-sh.m4 \
diff --git a/m4/Makefile.in b/m4/Makefile.in
index e508848..49f46a7 100644
--- a/m4/Makefile.in
+++ b/m4/Makefile.in
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2006,
-# 2008, 2009 Free Software Foundation, Inc.
+# 2008, 2009, 2011 Free Software Foundation, Inc.
 
 # 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
@@ -201,6 +201,7 @@ depend.m4 \
 depout.m4 \
 dmalloc.m4 \
 gcj.m4 \
+guile.m4 \
 header.m4 \
 init.m4 \
 install-sh.m4 \
diff --git a/m4/guile.m4 b/m4/guile.m4
new file mode 100644
index 0000000..d16da79
--- /dev/null
+++ b/m4/guile.m4
@@ -0,0 +1,63 @@
+# Guile file handling                                      -*- Autoconf -*-
+
+# Copyright (C) 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PATH_GUILE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------------------------
+# Adds support for distributing Guile source files and compiled sources.
+# To install files, copy them to $(guiledir), using the guile_GUILE
+# automake variable.  To install a package with the same name as the
+# automake package, install to $(pkgguiledir), or use the
+# pkgguile_GUILE automake variable.
+#
+# The variables $(guileexecdir) and $(guileextensiondir) are provided as
+# locations to install Guile extension modules (shared libraries).
+# The XXX macro is required to find the appropriate flags to compile
+# extension modules.
+#
+# If the MINIMUM-VERSION argument is passed, AM_PATH_GUILE will
+# cause an error if the version of python installed on the system
+# doesn't meet the requirement.  MINIMUM-VERSION should consist of
+# numbers and dots only.
+AC_DEFUN([AM_PATH_GUILE],
+[AC_PATH_PROG([GUILE_TOOLS], [guile-tools], [:])
+am__guile_apiversion=1.6
+if test "$GUILE_TOOLS" != :; then
+  GUILE_VERSION=`$GUILE_TOOLS --version | sed '[s/.*\([1-9][0-9.]*\).*/\1/]'`
+  AS_VERSION_COMPARE([$GUILE_VERSION], [1.8],
+    [am__guile_apiversion=1.6],
+    [am__guile_apiversion=1.8],
+    [am__guile_apiversion=2.0])
+fi
+AC_SUBST([GUILE_VERSION])
+case $am__guile_apiversion in #(
+1.6) ;; #(
+1.8)
+  guiledir='${datarootdir}'/guile/site/$GUILE_VERSION
+  guileexecdir='${libdir}'/guile/$GUILE_VERSION/ccache
+  guileextdir='${libdir}'/guile/$GUILE_VERSION/extensions
+  ;; #(
+*)
+  guiledir='${datarootdir}'/guile/site/$GUILE_VERSION
+  guileexecdir='${libdir}'
+  guileextdir='${libdir}'
+  ;;
+esac
+case $am__guile_apiversion in #(
+1.6)
+  m4_default([$3], [AC_MSG_ERROR([no working Guile installation found])])
+  ;; #(
+*)
+  $2
+  ;;
+esac
+AC_SUBST([guiledir])dnl
+AC_SUBST([pkgguiledir], ['${guiledir}'/$PACKAGE])dnl
+AC_SUBST([guileexecdir])dnl
+AC_SUBST([guileextdir])dnl
+AC_ARG_VAR([GUILEFLAGS], [Flags for compilation of Guile source files])dnl
+])
-- 
1.7.4.1.48.g5673d





Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 07:33:02 GMT) Full text and rfc822 format available.

Message #20 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
To: 7995 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>,
	Andy Wingo <wingo <at> pobox.com>
Subject: [PATCH 4/4] Implement Guile support.
Date: Sun, 20 Feb 2011 08:32:33 +0100
* automake.in: Register new language 'Guile'.
(handle_guile): New function.
(generate_makefile): Call it.
(am_install_var): Treat 'GUILE' primary like JAVA and PYTHON.
* lib/am/guile.am: New file.
* lib/am/Makefile.am (dist_am_DATA): Add guile.am.
---
 ChangeLog          |    8 ++++++++
 automake.in        |   36 ++++++++++++++++++++++++++++++++----
 lib/am/Makefile.am |    3 ++-
 lib/am/Makefile.in |    3 ++-
 lib/am/guile.am    |   35 +++++++++++++++++++++++++++++++++++
 5 files changed, 79 insertions(+), 6 deletions(-)
 create mode 100644 lib/am/guile.am

diff --git a/ChangeLog b/ChangeLog
index bd27a05..bff6c15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2011-02-20  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
 
+	Implement Guile support.
+	* automake.in: Register new language 'Guile'.
+	(handle_guile): New function.
+	(generate_makefile): Call it.
+	(am_install_var): Treat 'GUILE' primary like JAVA and PYTHON.
+	* lib/am/guile.am: New file.
+	* lib/am/Makefile.am (dist_am_DATA): Add guile.am.
+
 	Guile macro AM_PATH_GUILE.
 	* m4/guile.m4 (AM_PATH_GUILE): New file, new macro.
 	* m4/Makefile.am (dist_m4data_DATA): Add guile.m4.
diff --git a/automake.in b/automake.in
index ef3b8a6..240dc7f 100644
--- a/automake.in
+++ b/automake.in
@@ -1041,6 +1041,18 @@ register_language ('name' => 'java',
 		   'pure' => 1,
 		   'extensions' => ['.java', '.class', '.zip', '.jar']);
 
+# Guile.
+register_language ('name' => 'guile',
+		   'Name' => 'Guile',
+		   'config_vars' => ['GUILE_TOOLS'],
+		   'flags' => ['GUILEFLAGS'],
+		   'compile' => '$(GUILE_TOOLS) compile $(AM_GUILEFLAGS) $(GUILEFLAGS)',
+		   'output_flag' => '-o',
+		   'ccer' => 'GUILE_TOOLS',
+		   'compiler' => 'GUILECOMPILE',
+		   'pure' => 1,
+		   'extensions' => ['.scm', '.sls', '.sps', '.ss']);
+
 ################################################################
 
 # Error reporting functions.
@@ -5122,6 +5134,16 @@ sub handle_python
   &define_variable ('py_compile', "$am_config_aux_dir/py-compile", INTERNAL);
 }
 
+# Handle Guile
+sub handle_guile
+{
+  my @guilefiles = &am_install_var ('-defaultdist', 'guile', 'GUILE',
+				    'noinst');
+  return if ! @guilefiles;
+
+  require_variables ($guilefiles[0][0], "Guile sources seen", TRUE, 'GUILE_TOOLS');
+}
+
 # Handle Java.
 sub handle_java
 {
@@ -7541,9 +7563,11 @@ sub am_install_var
   # variables, it is an error to actually define the primary.  We
   # allow `JAVA', as it is customarily used to mean the Java
   # interpreter.  This is but one of several Java hacks.  Similarly,
-  # `PYTHON' is customarily used to mean the Python interpreter.
+  # `PYTHON' is customarily used to mean the Python interpreter,
+  # and `GUILE' is set by the Autoconf macros from Guile.
   reject_var $primary, "`$primary' is an anachronism"
-    unless $primary eq 'JAVA' || $primary eq 'PYTHON';
+    unless $primary eq 'JAVA' || $primary eq 'PYTHON'
+    || $primary eq 'GUILE';
 
   # Get the prefixes which are valid and actually used.
   @prefix = am_primary_prefixes ($primary, $can_dist, @prefix);
@@ -7674,7 +7698,9 @@ sub am_install_var
 
   # The JAVA variable is used as the name of the Java interpreter.
   # The PYTHON variable is used as the name of the Python interpreter.
-  if (@used && $primary ne 'JAVA' && $primary ne 'PYTHON')
+  # The GUILE variable is used as the name of the Guile interpreter.
+  if (@used && $primary ne 'JAVA' && $primary ne 'PYTHON'
+      && $primary ne 'GUILE')
     {
       # Define it.
       define_pretty_variable ($primary, TRUE, INTERNAL, @used);
@@ -7688,7 +7714,8 @@ sub am_install_var
 
   # Push here because PRIMARY might be configure time determined.
   push (@all, '$(' . $primary . ')')
-    if @used && $primary ne 'JAVA' && $primary ne 'PYTHON';
+    if @used && $primary ne 'JAVA' && $primary ne 'PYTHON'
+       && $primary ne 'GUILE';
 
   # Make the result unique.  This lets the user use conditionals in
   # a natural way, but still lets us program lazily -- we don't have
@@ -8260,6 +8287,7 @@ sub generate_makefile ($$)
   handle_texinfo;
   handle_emacs_lisp;
   handle_python;
+  handle_guile;
   handle_java;
   handle_man_pages;
   handle_data;
diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am
index a255f70..ad08582 100644
--- a/lib/am/Makefile.am
+++ b/lib/am/Makefile.am
@@ -3,7 +3,7 @@
 ## Makefile for Automake lib/am.
 
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, 2008,
-# 2009  Free Software Foundation, Inc.
+# 2009, 2011 Free Software Foundation, Inc.
 
 # 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
@@ -34,6 +34,7 @@ depend.am \
 depend2.am \
 distdir.am \
 footer.am \
+guile.am \
 header-vars.am \
 header.am \
 install.am \
diff --git a/lib/am/Makefile.in b/lib/am/Makefile.in
index 059ae97..f0cf036 100644
--- a/lib/am/Makefile.in
+++ b/lib/am/Makefile.in
@@ -16,7 +16,7 @@
 @SET_MAKE@
 
 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, 2008,
-# 2009  Free Software Foundation, Inc.
+# 2009, 2011 Free Software Foundation, Inc.
 
 # 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
@@ -204,6 +204,7 @@ depend.am \
 depend2.am \
 distdir.am \
 footer.am \
+guile.am \
 header-vars.am \
 header.am \
 install.am \
diff --git a/lib/am/guile.am b/lib/am/guile.am
new file mode 100644
index 0000000..26d92d2
--- /dev/null
+++ b/lib/am/guile.am
@@ -0,0 +1,35 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 2011 Free Software Foundation, Inc.
+
+## 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
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program 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 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 %?INSTALL%
+include inst-vars.am
+endif %?INSTALL%
+
+
+## Exactly the same as data.am.
+include data.am
+
+## ---------- ##
+## Cleaning.  ##
+## ---------- ##
+
+## -------------- ##
+## Distributing.  ##
+## -------------- ##
+
+if %?DIST%
+DIST_COMMON += %DISTVAR%
+endif %?DIST%
-- 
1.7.4.1.48.g5673d





Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 11:50:03 GMT) Full text and rfc822 format available.

Message #23 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
To: 7995 <at> debbugs.gnu.org
Cc: Andy Wingo <wingo <at> pobox.com>, Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>,
	Courtès <ludo <at> gnu.org>, Ludovic
Subject: Re: bug#7995: [PATCH 2/4] Testsuite coverage for Guile support.
Date: Sun, 20 Feb 2011 12:49:13 +0100
Hi Ralf.

Knowing almost nothing about guile, I'm not able to help in the
discussion of design/implementation, but I'll throw in my two cents
w.r.t. the testsuite additions ...

On Sunday 20 February 2011, Ralf Wildenhues wrote:
> * tests/guile1.test, tests/guile2.test, tests/guile3.test,
> tests/guile4.test: New tests.
> * tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
> ---
>  ChangeLog         |    5 ++
>  tests/Makefile.am |    8 +++
>  tests/Makefile.in |    7 ++-
>  tests/guile1.test |   54 ++++++++++++++++++++++
>  tests/guile2.test |  132 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/guile3.test |   91 ++++++++++++++++++++++++++++++++++++
>  tests/guile4.test |   48 +++++++++++++++++++
>
Couldn't we use more expressive/clean names for the tests?
Suggestions below.

>  7 files changed, 344 insertions(+), 1 deletions(-)
>  create mode 100755 tests/guile1.test
>  create mode 100755 tests/guile2.test
>  create mode 100755 tests/guile3.test
>  create mode 100755 tests/guile4.test
> 
> diff --git a/ChangeLog b/ChangeLog
> index c338e8a..5483ce4 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,5 +1,10 @@
>  2011-02-20  Ralf Wildenhues  <Ralf.Wildenhues <at> gmx.de>
>  
> +	Testsuite coverage for Guile support.
> +	* tests/guile1.test, tests/guile2.test, tests/guile3.test,
> +	tests/guile4.test: New tests.
> +	* tests/Makefile.am (TESTS, XFAIL_TESTS): Update.
> +
>  	Documentation for Guile support.
>  	* doc/automake.texi (Guile): New chapter.
>  	(Top, Other GNU Tools): Update menus.
> diff --git a/tests/Makefile.am b/tests/Makefile.am
> index e3eb9e9..b993678 100644
> --- a/tests/Makefile.am
> +++ b/tests/Makefile.am
> @@ -24,6 +24,10 @@ all.test \
>  auxdir2.test \
>  cond17.test \
>  gcj6.test \
> +guile1.test \
> +guile2.test \
> +guile3.test \
> +guile4.test \
>  override-conditional-2.test \
>  txinfo5.test
>  
> @@ -460,6 +464,10 @@ gnuwarn2.test \
>  gnits.test \
>  gnits2.test \
>  gnits3.test \
> +guile1.test \
> +guile2.test \
> +guile3.test \
> +guile4.test \
>  header.test \
>  help.test \
>  help2.test \
> diff --git a/tests/Makefile.in b/tests/Makefile.in
> index 1f367cd..e449137 100644
> --- a/tests/Makefile.in
> +++ b/tests/Makefile.in
> @@ -284,7 +284,8 @@ top_srcdir = @top_srcdir@
>  MAINTAINERCLEANFILES = $(parallel_tests) $(instspc_tests)
>  EXTRA_DIST = ChangeLog-old gen-parallel-tests instspc-tests.sh \
>  	$(TESTS)
> -XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test \
> +XFAIL_TESTS = all.test auxdir2.test cond17.test gcj6.test guile1.test \
> +	guile2.test guile3.test guile4.test \
>  	override-conditional-2.test txinfo5.test \
>  	$(instspc_xfail_tests)
>  parallel_tests = backcompat5-p.test check-exported-srcdir-p.test \
> @@ -722,6 +723,10 @@ gnuwarn2.test \
>  gnits.test \
>  gnits2.test \
>  gnits3.test \
> +guile1.test \
> +guile2.test \
> +guile3.test \
> +guile4.test \
>  header.test \
>  help.test \
>  help2.test \


> diff --git a/tests/guile1.test b/tests/guile1.test
> new file mode 100755
> index 0000000..94efa82
> --- /dev/null
> +++ b/tests/guile1.test
> @@ -0,0 +1,54 @@
> +#! /bin/sh
> +# Copyright (C) 2011 Free Software Foundation, Inc.
> +#
> +# 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
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program 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 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/>.
> +
> +# Basic Guile support: guile_GUILE.
> +
What about calling this test `guile-basic.test'?

> +. ./defs || Exit 1
> +
> +set -e
> +
> +cat >>configure.in <<\END
> +AM_PATH_GUILE
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am <<\END
> +guile_GUILE = foo.scm bar.scm baz.scm
> +END
> +
> +: >foo.scm
> +: >bar.scm
> +: >baz.scm
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE --add-missing
> +
> +grep '^GUILECOMPILE' Makefile.in
>
grep '^GUILECOMPILE *=' ?

> +grep '^GUILEFLAGS' Makefile.in
> +
Similarly.

> +inst=`pwd`/inst
> +./configure --prefix="$inst"
> +
> +env GUILE_TOOLS=false $MAKE -e && Exit 1
> +env AM_GUILEFLAGS=--nosuchflag $MAKE -e && Exit 1
> +env GUILEFLAGS=--nosuchflag $MAKE -e && Exit 1
> +
What if guile-tools is not installed, and `GUILE_TOOLS' gets
defined to `:'?  Won't the commands above succed in this case?

Also, maybe we could ensure also that really GUILEFLAGS really takes
precedence over AM_GUILEFLAGS, and that GUILE_TOOLS can be successfully
overridden by a "fake script", similarly to what is done by tests
`ylflags.test' and `lflags.test'.  That might be done in another test
`guile-flags.test' maybe.

> +$MAKE
> +$MAKE install
> +$MAKE distcheck
> +
> +:


> diff --git a/tests/guile2.test b/tests/guile2.test
> new file mode 100755
> index 0000000..d355518
> --- /dev/null
> +++ b/tests/guile2.test
> @@ -0,0 +1,132 @@
> +#! /bin/sh
> +# Copyright (C) 2011 Free Software Foundation, Inc.
> +#
> +# 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
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program 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 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/>.
> +
> +# Ensure that we compile and install Guile sources properly.
> +
What about calling this test `guile-inst-and-dist.test'?

> +required='guile-tools'
> +. ./defs || Exit 1
> +
> +set -e
> +
> +cat >>configure.in <<\END
> +AM_PATH_GUILE([1.8],,
> +  [AC_MSG_ERROR([Guile installation missing or too old for compilation],
> +		[77])])
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am <<\END
> +guile_GUILE = compiled-and-installed.scm
> +nodist_guile_GUILE = not-distributed.scm
> +guile_DATA = not-compiled.scm
> +noinst_GUILE = compiled-but-not-installed.scm
> +dist_noinst_DATA = just-distributed-blob.scm
> +nobase_guile_GUILE = installed-in-subdir/foo.scm
> +pkgguile_GUILE = installed-in-package-dir.scm
> +
> +not-distributed.scm:
> +	: >$@
> +
> +CLEANFILES = not-distributed.scm
> +
> +check-dist:
> +	test -f $(distdir)/compiled-and-installed.scm
> +	test ! -f $(distdir)/not-distributed.scm
> +	test -f $(distdir)/not-compiled.scm
> +	test -f $(distdir)/compiled-but-not-installed.scm
> +	test -f $(distdir)/just-distributed-blob.scm
> +	test -f $(distdir)/installed-in-subdir/foo.scm
> +	test -f $(distdir)/installed-in-package-dir.scm
> +	test -z "`find $(distdir) -name \*.go`"
> +
I'd suggest to use:
	find $(distdir) -name \*.go | grep . && exit 1; :
here, so that in case of failure we obtain the names/paths of the
unexpected *.go files.

> +END
> +
> +mkdir installed-in-subdir
> +
> +: >compiled-and-installed.scm
> +: >not-compiled.scm
> +: >compiled-but-not-installed.scm
> +: >just-distributed-blob.scm
> +: >installed-in-subdir/foo.scm
> +: >installed-in-package-dir.scm
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE --add-missing
> +
> +inst=`pwd`/inst
> +./configure --prefix="$inst"
> +$MAKE
> +test -f compiled-and-installed.go
> +test -f not-distributed.go
> +test ! -f not-compiled.go
> +test -f compiled-but-not-installed.go
> +test ! -f just-distributed-blob.go
> +test -f installed-in-subdir/foo.go
> +test -f installed-in-package-dir.go
> +
> +guile_version=
> +if : new install layout; then
> +  guiledir=$inst/share/guile/site/$guile_version
> +  guileexecdir=$inst/lib/guile/$guile_version/ccache
> +else
> +  guiledir=$inst/share/guile/site
> +  guileexecdir=$inst/lib
> +fi
> +
> +$MAKE install-data
> +test -f "$guiledir/compiled-and-installed.scm"
> +test -f "$guiledir/not-distributed.scm"
> +test ! -f "$guiledir/not-compiled.scm"
> +test ! -f "$guiledir/compiled-but-not-installed.scm"
> +test ! -f "$guiledir/just-distributed-blob.scm"
> +test -f "$guiledir/installed-in-subdir/foo.scm"
> +test -f "$guiledir/$me/installed-in-package-dir.scm"
> +
> +installed_go=`find "$inst" -name \*.go`
> +test -z "$installed_go"
>
Bikeshedding here, but I'd substitue this two lines with:
  find "$inst" -name \*.go | grep . && Exit 1

> +$MAKE uninstall
> +
> +$MAKE install-exec
> +if : can compile; then
> +  test -f "$guileexecdir/compiled-and-installed.go"
> +  test -f "$guileexecdir/not-distributed.go"
> +  test ! -f "$guileexecdir/not-compiled.go"
> +  test ! -f "$guileexecdir/compiled-but-not-installed.go"
> +  test ! -f "$guileexecdir/just-distributed-blob.go"
> +  test -f "$guileexecdir/installed-in-subdir/foo.go"
> +  test -f "$guileexecdir/$me/installed-in-package-dir.go"
> +  installed_scm=`find "$inst" -name \*.scm`
> +  test -z "$installed_scm"
> +else
> +  installed_go=`find "$inst" -name \*.go`
> +  test -z "$installed_go"
>
See above.

> +fi
> +
> +$MAKE clean
> +
> +test ! -f compiled-and-installed.go
> +test ! -f not-distributed.go
> +test ! -f not-compiled.go
> +test ! -f compiled-but-not-installed.go
> +test ! -f just-distributed-blob.go
> +test ! -f installed-in-subdir/foo.go
> +test ! -f installed-in-package-dir.go
> +
> +$MAKE check-dist
> +
> +$MAKE distcheck
> +
> +:


> diff --git a/tests/guile3.test b/tests/guile3.test
> new file mode 100755
> index 0000000..4be3c82
> --- /dev/null
> +++ b/tests/guile3.test
> @@ -0,0 +1,91 @@
> +#! /bin/sh
> +# Copyright (C) 2011 Free Software Foundation, Inc.
> +#
> +# 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
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program 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 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/>.
> +
> +# Check for Guile compiled extensions.
> +
What about calling this test `guile-compiled-ext.test'?

> +required='guile-tools libtoolize'
> +. ./defs || Exit 1
> +
> +set -e
> +
> +cat >>configure.in <<\END
> +AC_PROG_CC
> +AC_PROG_LIBTOOL
> +AM_PATH_GUILE
> +AC_PATH_PROG([GUILE], [guile], [exit 77])
> +: "${GUILECPPFLAGS=`guile-config compile`}"
> +: "${GUILECFLAGS=`guile-config compile`}"
> +: "${GUILELIBS=`guile-config link`}"
> +AC_SUBST([GUILECPPFLAGS])
> +AC_SUBST([GUILECFLAGS])
> +AC_SUBST([GUILELIBS])
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am <<\END
> +guileext_LTLIBRARIES = foo.la
> +foo_la_SOURCES = foo.c
> +foo_la_LDFLAGS = -module -avoid-version
> +foo_la_LIBADD = $(GUILELIBS)
> +AM_CFLAGS = $(GUILECFLAGS)
> +AM_CPPFLAGS = $(GUILECPPFLAGS)
> +
> +guile_GUILE = load-foo.scm
> +
> +# Try out the uninstalled module.
> +check-local:
> +	$(LIBTOOL) --mode=execute -dlopen foo.la $(GUILE) load-foo.scm
> +# Try out the installed module.
> +installcheck-local:
> +	$(GUILE) load-foo.scm
> +END
> +
> +cat > load-foo.scm <<\END
> +(dynamic-call "init_the_answer" (dynamic-link "foo"))
> +(answer)
> +END
> +
> +cat >foo.c <<\END
> +#include <libguile.h>
> +
> +SCM
> +the_answer (void)
> +{
> +  return scm_int2num (42);
> +}
> +
> +void
> +init_the_answer (void)
> +{
> +  scm_c_define_gsubr ("answer", 0, 0, 0, the_answer);
> +}
> +END
> +
> +inst=`pwd`/inst
> +
> +libtoolize --force
> +$ACLOCAL
> +$AUTOMAKE --add-missing
> +$AUTOCONF
> +./configure --prefix="$inst"
> +$MAKE
> +$MAKE check
> +$MAKE install
> +$MAKE clean
> +$MAKE installcheck
> +$MAKE distcheck
> +
> +:


> diff --git a/tests/guile4.test b/tests/guile4.test
> new file mode 100755
> index 0000000..47a0ad9
> --- /dev/null
> +++ b/tests/guile4.test
> @@ -0,0 +1,48 @@
> +#! /bin/sh
> +# Copyright (C) 2011 Free Software Foundation, Inc.
> +#
> +# 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
> +# the Free Software Foundation; either version 2, or (at your option)
> +# any later version.
> +#
> +# This program 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 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/>.
> +
> +# Per-target flags should not cause compiled Guile sources to be renamed.
> +
What about calling this test `guile-per-target-flags.test'?  Or if that
seems too long, `guile-spcflg.test'? 

> +required=guile-tools
> +. ./defs || Exit 1
> +
> +set -e
> +
> +cat >>configure.in <<\END
> +AM_PATH_GUILE
> +AC_OUTPUT
> +END
> +
> +cat > Makefile.am <<\END
> +guile_GUILE = foo.scm
> +foo_scm_GUILEFLAGS = ...
> +END
> +
> +: >foo.scm
> +
> +$ACLOCAL
> +$AUTOCONF
> +$AUTOMAKE --add-missing
> +
> +inst=`pwd`/inst
> +./configure --prefix="$inst"
> +$MAKE
> +test -f foo.go
> +test ! -f foo_go_foo.go
> +
IMHO you could err on the side of caution here, and tighten this to:

  test -f foo.go
  ls *.go | grep -v '^foo\.go$' | grep . && Exit 1

or even:

  test -f foo.go
  find . -name \*.go | grep -v '^\./foo\.go$' | grep . && Exit 1

> +$MAKE distcheck
> +
> +:
> 

Also, IMHO, some deeper tests about the code in m4/guile.m4 would be
required (similarly for what is done for python).

Regards,
     Stefano




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sun, 20 Feb 2011 12:44:01 GMT) Full text and rfc822 format available.

Message #26 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 7995 <at> debbugs.gnu.org
Subject: Re: bug#7995: Guile support in Automake
Date: Sun, 20 Feb 2011 12:52:32 +0100
Ralf, you are a hero.

On Sun 20 Feb 2011 08:30, Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:

> So what I would like to ask from readers at this point is:
> please go through the doc changes and let's discuss them first.

Will reply to that patch.

> Also, it is important to not step on guile/meta/guile.m4 toes (or vice
> versa), so some checking for that is prodent.  When we know what is
> desired, the tests should be amended/fixed to cover that, and then we
> can fix the implementation to follow.

What would it mean for AM_PATH_GUILE to step on guile.m4's toes?

FWIW guile.m4 almost never gets updates, but today was one of those
exceptions:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=1867d3e0195168a34cf2269c2137ac561d03a252

Basically it's something from Bruno to add GUILE_LIBS as opposed to
GUILE_LTLIBS, getting the rpath stuff right.

Later you say:

> - The Guile manual documents Autoconf macros distributed in
>   $datarootdir/aclocal/guile.m4.  The names in there are a bit
>   unfortunate in that the macros more or less use the same GUILE_*
>   namespace that we would like to use for some variables (which means
>   you cannot easily turn on checking for unexpanded macro names through
>   something like
>     m4_pattern_forbid([^GUILE_])dnl
>
>   and there is even overlap in the semantics and shell variable names.
>   We need to address that; esp. since the macros shipped with Guile have
>   been out there for long, we cannot just expect them to disappear
>   instantly.  There should be a clear, backward-compatible upgrade path,
>   and a clear intent on how usage should be in the future, for Guile
>   users both with and without Automake.

Hmmm.

So guile.m4 defines the following macros:

    GUILE_PROGS
    GUILE_FLAGS
    GUILE_SITE_DIR
    GUILE_CHECK
    GUILE_MODULE_CHECK
    GUILE_MODULE_AVAILABLE
    GUILE_MODULE_REQUIRED
    GUILE_MODULE_EXPORTS
    GUILE_MODULE_REQUIRED_EXPORT

Of these, only the first three do any AC_SUBST operations; so we can
safely say the rest don't affect this discussion, no?

GUILE_PROGS does this:

      AC_SUBST(GUILE)
      AC_SUBST(GUILE_CONFIG)
      AC_SUBST(GUILE_TOOLS)

Here AM_PATH_GUILE also defines GUILE_TOOLS, but it does the same
AC_PATH_PROG check for it, so calling both macros should not present a
problem.

GUILE_SITE_DIR only defines GUILE_SITE, so that doesn't conflict.

GUILE_FLAGS is the only one that's tricky.  It defines:

  AC_SUBST([GUILE_CFLAGS])
  AC_SUBST([GUILE_LDFLAGS])
  AC_SUBST([GUILE_LIBS])
  AC_SUBST([GUILE_LTLIBS])

These are all for compiling C code.  Ideally one would not even have to
check for these if you're not compiling C extensions.  Is that possible?
In any case these variables' definitions should be exactly the same as
those that GUILE_FLAGS defines; though it is tough to ensure that a
"guile-config compile" or "pkg-config --cflags guile-2.0" corresponds to
the "guile-tools compile" output.  Hummm.

> If you prefer, I can also put them in a temporary branch (which for the
> moment I would expect to be rewound at some point later).

Please do, if it's not very much trouble.

> - Why guile_GUILE and not guile_LISP?  What's the rationale for naming
>   it differently, and what's the rationale for actually treating it
>   differently?  This question has two parts: LISP is treated by emacs
>   not guile-tools, and IIUC then the idea was that GUILE is compiled
>   already at 'make all' time and not just at 'make install' time, right?
>   Is the latter part just "nice to have" or an important feature?

I think that it is useful to compile at "make all" time, yes.  You can
run programs uninstalled in many cases, with an environment that picks
up the compiled ".go" files from the uninstalled tree.  Compiling can
also show warnings -- of course if it doesn't compile at all, that's
useful to know; but furthermore there are the -W warnings.

> - The current tests assume _GUILE sources are distributed by default;
>   OTOH, _LISP are not.  Rationale for this semantic difference?

It seems more useful.  I don't see any particular affinity between Guile
and Elisp, by the way; we might as well compare to Python, which does
dist by default.

> - I renamed guileextensiondir from earlier suggestions to guileextdir,
>   both for brevity, and to avoid the question of whether there is a
>   trailing 's' in the name.  OK?

Sounds good.

> - I haven't yet considered the handling of flags to uninstalled module
>   stuff.  This is just TODO.

Yeah, indeed.

> - My current plan is to either not provide something like
>     foo_scm_GUILEFLAGS = override for $(AM_GUILEFLAGS)
>
>   or to not let it cause renamed .go files.  Do you think users will
>   need per-target guile-tools compile flags?  Because if they do, then
>   we need to document this stuff, and that it's not in line with how
>   Automake operates elsewhere, etc.

I think we would be fine without per-target compile flags.

Regards,

Andy
-- 
http://wingolog.org/




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sat, 26 Feb 2011 15:03:02 GMT) Full text and rfc822 format available.

Message #29 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
Cc: Andy Wingo <wingo <at> pobox.com>, 7995 <at> debbugs.gnu.org
Subject: Re: bug#7995: Guile support in Automake
Date: Sat, 26 Feb 2011 16:02:37 +0100
Hi Ralf,

Andy already answered most of your questions, I think.

Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:

> - The current tests assume _GUILE sources are distributed by default;
>   OTOH, _LISP are not.  Rationale for this semantic difference?

In a typical project, 90% of the .scm files are hand-written, and 10%
are not (generated by AC_CONFIG_FILES, for instance.)  The hand-written
source files must of course be distributed.

So I think it makes sense to have ‘dist_’ be the default.

Thanks,
Ludo’.




Information forwarded to owner <at> debbugs.gnu.org, bug-automake <at> gnu.org:
bug#7995; Package automake. (Sat, 26 Feb 2011 15:26:02 GMT) Full text and rfc822 format available.

Message #32 received at 7995 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de>
Cc: Andy Wingo <wingo <at> pobox.com>, 7995 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/4] Documentation for Guile support.
Date: Sat, 26 Feb 2011 16:25:26 +0100
Hi Ralf,

Ralf Wildenhues <Ralf.Wildenhues <at> gmx.de> writes:

> +@example
> +guile_GUILE = compiled-and-installed.scm
> +nodist_guile_GUILE = not-distributed.scm
> +guile_DATA = not-compiled.scm
> +noinst_GUILE = compiled-but-not-installed.scm
> +dist_noinst_DATA = just-distributed-blob.scm
> +
> +# object files will be installed in respective subdir of guileexecdir.
> +nobase_guile_GUILE = installed-in-subdir/foo.scm
> +
> +pkgguile_GUILE = installed-in-package-dir.scm
> +@end example

Looks good to me.

‘guile-tools compile’ supports flags, such as warnings.  How would the
user specify them?

Your other message mentioned GUILEFLAGS, which I thought is meant for
this.  Is it correct?

The name ‘GUILEFLAGS’ could be misleading since these are flags for
‘guile-tools compile’, not for ‘guile’.  ‘GUILECFLAGS’ is already taken,
so we need something else, non-ambiguous.  ‘GUILEC_FLAGS’?
‘GUILE_COMPILE_FLAGS’?  ‘GUILE_COMPILER_FLAGS’?  ‘GUILEGOFLAGS’?
None of them is 100% satisfactory but I don’t have a better idea.

Your other message mentioned per-target flags.  I think it’d be “nice to
have” so you can do things like:

  AM_GUILEGOFLAGS = -Wunused-toplevel -Wunused-variable
  guile_GUILE = foo.scm bar.scm baz.scm
  baz_scm_GOFLAGS = # turn off warnings for this one

> +@example
> +guileext_LTLIBRARIES = foo.la
> +foo_la_SOURCES = foo.c
> +foo_la_LDFLAGS = -module -avoid-version
> +foo_la_LIBADD = $(GUILELIBS)
> +AM_CFLAGS = $(GUILECFLAGS)
> +AM_CPPFLAGS = $(GUILECPPFLAGS)
> +@end example

OK.  In such a case, there would also be one or more companion .scm
files, which say “dlopen foo.la”.

(Later we can discuss all the tricky things associated with that, such
as the fact that foo.la will be installed in a dir that’s not in the
loader’s search path, so you can the companion .scm file to read “dlopen
@guileextdir@/foo.la”, which causes problems in the uninstalled tree...)

> +@defmac AM_PATH_GUILE (@ovar{version}, @ovar{action-if-found}, @
> +  @ovar{action-if-not-found})

OK.

> +@item guiledir
> +The directory name for the installation of user Guile source code.
> +By default, that is @samp{$(datarootdir)/guile/site/@var{x.y}} for
> +Guile versions @var{x.y} greater than 1.8, and
> +@samp{$(datarootdir)/guile/site} for version 1.8.
> +
> +@item pkgguiledir
> +This is the directory under @code{guiledir} that is named after the
> +package.  That is, it is @samp{$(guiledir)/$(PACKAGE)}.  It is provided
> +as a convenience.
> +
> +@item guileexecdir
> +This is the directory where compiled Guile source code will be installed.
> +The default is @samp{$(libdir)/guile/@var{x.y}/ccache} if a Guile Scheme
> +compiler is available, and @samp{$(libdir)} otherwise.
> +
> +@item guileextdir
> +This is the directory where Guile C extensions will be installed.
> +The default is @samp{$(libdir)/guile/@var{x.y}/extensions} for versions
> +@var{x.y} greater than 1.8, and @samp{$(libdir)} otherwise.

OK.

Thanks!

Ludo’.




Severity set to 'wishlist' from 'normal' Request was from Stefano Lattarini <stefano.lattarini <at> gmail.com> to control <at> debbugs.gnu.org. (Sun, 18 Sep 2011 19:11:01 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.