guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configuring apps for guile


From: Matt Wette
Subject: Re: configuring apps for guile
Date: Sun, 16 Feb 2020 07:28:47 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 2/16/20 6:48 AM, Ludovic Courtès wrote:
Hello Matt,

Matt Wette <address@hidden> skribis:

 From configure.ac:

guile_build_prefix=`$GUILE -c "(display (assq-ref %guile-build-info
'prefix))"`

if test "$guile_build_prefix" == "$prefix"; then
   echo "using paths for installed guile"
   GUILE_SITE_DIR
   GUILE_SITE_GO_DIR
   GUILE_DATA_DIR
else
   echo "using default paths for guile"
   GUILE_SITE=$prefix/share/guile/site/$GUILE_EFFECTIVE_VERSION
GUILE_SITE_GO=$prefix/lib/guile/$GUILE_EFFECTIVE_VERSION/site-ccache
   GUILE_DATA=$prefix/share
   AC_SUBST([GUILE_SITE])
   AC_SUBST([GUILE_SITE_GO])
   AC_SUBST([GUILE_DATA])
fi
I would recommend not even bothering with the first part of the ‘if’,
and instead always default to install files under $prefix (more
precisely: under $datadir and $libdir).

The bits I’ve been using are:

configure.ac:

   dnl We require guile.m4, from Guile.  Make sure it's available.
   m4_pattern_forbid([^GUILE_P])
   m4_pattern_allow([^GUILE_PKG_ERRORS])

   GUILE_PKG([3.0 2.2 2.0])
   GUILE_PROGS

Makefile.am:

   moddir = $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)
   godir  = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache

   SOURCES = a.scm b.scm c.scm
   GOBJECTS = $(SOURCES:%.scm=%.go)
   nobase_mod_DATA = $(SOURCES)
   nobase_go_DATA = $(GOBJECTS)

I believe Hall¹ does the right thing, making it easier to get started
with all this!

Thanks,
Ludo’.

¹ https://gitlab.com/a-sassmannshausen/guile-hall


What if you have a system that gives this (e.g., Ubuntu 18.04):

mwette$ /usr/bin/guile -c "(display (assq-ref %guile-build-info 'prefix)) (newline)"
/usr

mwette$ /usr/bin/guile -c "(display (%site-ccache-dir)) (newline)"
/usr/lib/x86_64-linux-gnu/guile/2.2/site-ccache

I'm not sure that guile will find .go files installed in /usr/lib/guile/2.2/site-ccache.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]