On Fri, Sep 05, 2025 at 04:27:54PM -0400, Nikolaos Chatzikonstantinou wrote:
> > I'm not very familiar with GNU Guile. But I would suggest:
> >
> > - Have your configure script inspect the value of GUILE_SITE to try
> > and identify the suffix which is not related to Guile's datadir. In
> > your case I imagine that would be the /guile/site/3.0 part. Let's
> > suppose you set this in a shell variable called guilesitesuffix.
>
> Your recommendation works by manipulating the paths provided by
> pkg-config, which AFAIK are provided by distributions. On Debian it's
> the datadir, but it could be arbitrary in theory, and not related to
> prefix/datadir. In particular, what should the m4 scripts do if the
> pkg-config path is unrelated to any autoconf prefixes or LHS
> directories?
If the system configuration is too weird for a configure test to
determine automatically then you just have to let the user sort
it out by setting the installation directories appropriately.
Just make sure the default is somewhere sensible relative to an
appropriate standard installation directory (${datadir}, etc.).
> Another option would be for Guile to use prefix and all the rest.
> Can't it use GUILE_SITE=$(datadir)/guile/3.0/site and so on instead?
Yes, if GNU Guile is providing Autoconf macros to find installation
locations then it would be great if they did that to make it easy for
packages using Guile to comply with the GNU standards for installation
directories.
But from your email I gather that they are not doing that.
> understand that Autotools is not a package manager, but ./configure &&
> make && make install always does something sensible for C/C++. How can
> it be made to work this way for Guile too?
This really has nothing to do with the language. The issue is entirely
related to the fact that an external program is looking for modules in
some pre-determined location which is not chosen by your package.
The exact same sort of issues come up with shared libraries written in C.
> Ideally one wouldn't even need EXTRA_DIST, as the programs could be
> specified with _GUILEPROGRAMS or similar. The .scm file suffix is
> shared between the Scheme flavors so that autoconf cannot deduce that
> Guile is in use; either offer _GUILEPROGRAMS or detect a special
> suffix (say .guile). This would allow programmers to specify their
> project just like in C, without having to worry about GUILE_SITE,
> EXTRA_DIST, _DATA, and so on. Isn't this the optimal solution?
I'm not sure this does anything to solve the issue of determining the
correct installation location, other than just making it Automake's
problem to solve.
Cheers,
Nick