From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jan Wedekind Newsgroups: gmane.lisp.guile.user Subject: Re: configuring apps for guile Date: Thu, 13 Feb 2020 21:59:35 +0000 (GMT) Message-ID: References: <5f967b74-9704-bd49-de82-97a2f1c665df@gmail.com> Reply-To: Jan Wedekind Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8BIT Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="2900"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Alpine 2.21 (DEB 202 2017-01-01) Cc: guile-user@gnu.org To: Matt Wette Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Feb 13 23:00:09 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j2MWm-0000dK-W4 for guile-user@m.gmane-mx.org; Thu, 13 Feb 2020 23:00:08 +0100 Original-Received: from localhost ([::1]:59668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2MWl-00045y-PP for guile-user@m.gmane-mx.org; Thu, 13 Feb 2020 17:00:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44314) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2MWT-000435-A5 for guile-user@gnu.org; Thu, 13 Feb 2020 16:59:50 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2MWP-0003kA-H7 for guile-user@gnu.org; Thu, 13 Feb 2020 16:59:49 -0500 Original-Received: from wp424.webpack.hosteurope.de ([2a01:488:42:1000:50ed:85c1::]:35702) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2MWP-0003TZ-3z for guile-user@gnu.org; Thu, 13 Feb 2020 16:59:45 -0500 Original-Received: from host86-163-166-185.range86-163.btcentralplus.com ([86.163.166.185] helo=[192.168.1.76]); authenticated by wp424.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1j2MWG-0007WF-NR; Thu, 13 Feb 2020 22:59:36 +0100 X-X-Sender: jan@wedemob.home In-Reply-To: <5f967b74-9704-bd49-de82-97a2f1c665df@gmail.com> X-bounce-key: webpack.hosteurope.de;jan@wedesoft.de;1581631185;3200ca07; X-HE-SMSGID: 1j2MWG-0007WF-NR X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a01:488:42:1000:50ed:85c1:: X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16175 Archived-At: On Wed, 12 Feb 2020, Matt Wette wrote: > Hi All, > > Over the last year I have been dealing with issues getting a configure.ac put > together > for my guile app.  It needs to install .scm and .go files into the place > guile expects to > see them: (%site-ccache-dir) and %load-path.   If I compile for my ubuntu > system then > the installed go files need to go in a non-standard place: >   /usr/lib/x86_64-linux-gnu/guile/2.2/site-ccache > If I compile for the guix context then the expectation is that the files are > installed in >  $prefix/lib/guile/2.2/site-ccache > > Here is my solution.  What do you think?  If $prefix is the same as used to > build guile > then I use the directories from $guile.  Otherwise, I use the default.  This > now works on > ubuntu and guix. > > 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 > > GUILE_SITE_DIR is defined in guile.m4, the others are in my own package m4. > I use guile.m4 from the FSF [1]. It gets invoked in configure.ac as follows [2]. GUILE_PROGS GUILE_FLAGS GUILE_SITE_DIR GUILE_EXT_DIR GUILE_CACHE_DIR See [3] for Automake file. Basically the useful variables from guile.m4 are: GUILE_SITE, GUILE_EXT, GUILE_CACHE. Regards Jan [1]: https://gitlab.com/wedesoft/aiscm/-/blob/master/m4/guile.m4 [2]: https://gitlab.com/wedesoft/aiscm/-/blob/master/configure.ac#L236 [3]: https://gitlab.com/wedesoft/aiscm/-/blob/master/aiscm/Makefile.am