unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Freja Nordsiek <fnordsie@gmail.com>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Add to the 2.1.x branch GUILE_SITE_CCACHE_DIR and GUILE_EXTENSION_DIR Autoconf macros along with needed siteccachdir entry in pkgconfig file
Date: Tue, 14 Mar 2017 16:31:17 +0100	[thread overview]
Message-ID: <CAOqf98qv0gacMCCSREt4_K0YRukko2v92G2mnXSSvY5qdBhpfw@mail.gmail.com> (raw)
In-Reply-To: <87h92v7vw3.fsf@pobox.com>

[-- Attachment #1: Type: text/plain, Size: 3454 bytes --]

I improved the commit log and the comments to make them better
formatted and more terse. Does the commit log look better?

I also made it so that pkgconfig is tried first for finding
site-ccache and only if that fails will the interpreter be used (the
messages say specifically which method they are using now). It is
definitely better to have both methods in there.


Freja Nordsiek

On Tue, Mar 14, 2017 at 3:53 PM, Andy Wingo <wingo@pobox.com> wrote:
> Hi :)
>
> Great patch, some comments.
>
> On Tue 14 Mar 2017 15:08, Freja Nordsiek <fnordsie@gmail.com> writes:
>
>> From 90daf796c829f8e422a281d501f711138f21a334 Mon Sep 17 00:00:00 2001
>> From: Freja Nordsiek <fnordsie@gmail.com>
>> Date: Tue, 14 Mar 2017 15:04:38 +0100
>> Subject: [PATCH] Made GUILE_SITE_DIR Autoconf macro look for directories for
>>  compiled .go and C extensions in addition to the site directory for scheme
>>  files.
>
> Please adapt the commit log.  (Just look at any other commit to see what
> the standard is.)  You might also be interested in "info standards".
>
>> -## GUILE_SITE_DIR -- find path to Guile "site" directory
>> +## GUILE_SITE_DIR -- find path to Guile "site" directories for scheme, compiles GO files, and compiled C extensions
>
> Line too long.  Probably just s/directories.*/directories./.
>
>> -# GUILE_SITE_DIR -- find path to Guile "site" directory
>> +# GUILE_SITE_DIR -- find path to Guile site directories
>
>> -# This looks for Guile's "site" directory, usually something like
>> -# PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path.
>> -# Note that the var name is different from the macro name.
>> +# This looks for Guile's "site" directory for Scheme files (usually something like
>> +# PREFIX/share/guile/site), "site-ccache" directory for compiled @code{.go} files
>> +# (usually something like PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/site-ccache),
>> +# and "extensions" directory for compiled C extensions (usually something like
>> +# PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/extensions). The variables
>> +# @var{GUILE_SITE}, @var{GUILE_SITE_CCACHE}, and @var{GUILE_EXTENSION} are set to these
>> +# paths respectively. The latter two are set to blank if they are not found. Note that
>> +# this macro will run the macros @code{GUILE_PKG} and @code{GUILE_PROGS} if they have
>> +# not already been run.
>
> Can we make the text more terse?  E.g. 'This looks for Guile's "site"
> directories.  The variable @var{GUILE_SITE} will be set to Guile's
> "site" directory for Scheme source files (usually [...]).
> @var{GUILE_SITE_CCACHE} will be set to the directory for compiled Scheme
> files (usually [...])' and so on.  Two spaces before periods please in
> comments in Guile code.
>
>> -# The variable is marked for substitution, as by @code{AC_SUBST}.
>> +# The variables are marked for substitution, as by @code{AC_SUBST}.
>>  #
>>  AC_DEFUN([GUILE_SITE_DIR],
>>   [AC_REQUIRE([GUILE_PKG])
>> +  AC_REQUIRE([GUILE_PROGS])
>
> I guess this is OK given that anyone installing Scheme files should
> install .go files, and you need GUILE_PROGS to build .go files.
>
>> +  AC_MSG_CHECKING([for Guile site-ccache directory])
>> +  GUILE_SITE_CCACHE=`$GUILE -c "(display (if (defined? '%site-ccache-dir) (%site-ccache-dir) \"\"))"`
>
> You prefer this rather than first trying pkg-config?  I would try
> pkg-config first; but it doesn't really matter I guess :)
>
> Otherwise looking fine.  Thanks!
>
> Andy

[-- Attachment #2: 0001-GUILE_SITE_DIR-Find-site-directories-for-compiled-fi.patch --]
[-- Type: text/x-patch, Size: 4288 bytes --]

From 41498549ac22ea50e497887b3a1e002985bb6f8f Mon Sep 17 00:00:00 2001
From: Freja Nordsiek <fnordsie@gmail.com>
Date: Tue, 14 Mar 2017 16:28:45 +0100
Subject: [PATCH] GUILE_SITE_DIR: Find site directories for compiled files.

---
 meta/guile-2.2.pc.in |  1 +
 meta/guile.m4        | 42 ++++++++++++++++++++++++++++++++++++------
 2 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/meta/guile-2.2.pc.in b/meta/guile-2.2.pc.in
index c8f485b..c6d12b5 100644
--- a/meta/guile-2.2.pc.in
+++ b/meta/guile-2.2.pc.in
@@ -10,6 +10,7 @@ pkgincludedir=@includedir@/guile
 
 sitedir=@sitedir@
 extensiondir=@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/extensions
+siteccachedir=@libdir@/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache
 libguileinterface=@LIBGUILE_INTERFACE@
 
 # Actual name of the 'guile' and 'guild' programs.  This is
diff --git a/meta/guile.m4 b/meta/guile.m4
index b0ef9be..8617b52 100644
--- a/meta/guile.m4
+++ b/meta/guile.m4
@@ -25,7 +25,7 @@
 ## GUILE_PKG -- find Guile development files
 ## GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
 ## GUILE_FLAGS -- set flags for compiling and linking with Guile
-## GUILE_SITE_DIR -- find path to Guile "site" directory
+## GUILE_SITE_DIR -- find path to Guile "site" directories
 ## GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
 ## GUILE_MODULE_CHECK -- check feature of a Guile Scheme module
 ## GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module
@@ -154,18 +154,26 @@ AC_DEFUN([GUILE_FLAGS],
   AC_SUBST([GUILE_LTLIBS])
  ])
 
-# GUILE_SITE_DIR -- find path to Guile "site" directory
+# GUILE_SITE_DIR -- find path to Guile site directories
 #
 # Usage: GUILE_SITE_DIR
 #
-# This looks for Guile's "site" directory, usually something like
-# PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path.
-# Note that the var name is different from the macro name.
+# This looks for Guile's "site" directories.  The variable @var{GUILE_SITE} will
+# be set to Guile's "site" directory for Scheme source files (usually something like
+# PREFIX/share/guile/site).  @var{GUILE_SITE_CCACHE} will be set to the directory
+# for compiled Scheme files also known as @code{.go} files
+# (usually something like PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/site-ccache).
+# @var{GUILE_EXTENSION} will be set to the directory for compiled C extensions
+# (usually something like # PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/extensions).
+# The latter two are set to blank if the particular version of Guile does not support
+# them.  Note that this macro will run the macros @code{GUILE_PKG} and @code{GUILE_PROGS}
+# if they have not already been run.
 #
-# The variable is marked for substitution, as by @code{AC_SUBST}.
+# The variables are marked for substitution, as by @code{AC_SUBST}.
 #
 AC_DEFUN([GUILE_SITE_DIR],
  [AC_REQUIRE([GUILE_PKG])
+  AC_REQUIRE([GUILE_PROGS])
   AC_MSG_CHECKING(for Guile site directory)
   GUILE_SITE=`$PKG_CONFIG --print-errors --variable=sitedir guile-$GUILE_EFFECTIVE_VERSION`
   AC_MSG_RESULT($GUILE_SITE)
@@ -173,6 +181,28 @@ AC_DEFUN([GUILE_SITE_DIR],
      AC_MSG_FAILURE(sitedir not found)
   fi
   AC_SUBST(GUILE_SITE)
+  AC_MSG_CHECKING([for Guile site-ccache directory using pkgconfig])
+  GUILE_SITE_CCACHE=`$PKG_CONFIG --print-errors --variable=siteccachedir guile-$GUILE_EFFECTIVE_VERSION`
+  if test "$GUILE_SITE_CCACHE" = ""; then
+    AC_MSG_RESULT(no)
+    AC_MSG_CHECKING([for Guile site-ccache directory using interpreter])
+    GUILE_SITE_CCACHE=`$GUILE -c "(display (if (defined? '%site-ccache-dir) (%site-ccache-dir) \"\"))"`
+    if test $? != "0" -o "$GUILE_SITE_CCACHE" = ""; then
+      AC_MSG_RESULT(no)
+      GUILE_SITE_CCACHE=""
+      AC_MSG_WARN([siteccachedir not found])
+    fi
+  fi
+  AC_MSG_RESULT($GUILE_SITE_CCACHE)
+  AC_SUBST([GUILE_SITE_CCACHE])
+  AC_MSG_CHECKING(for Guile extensions directory)
+  GUILE_EXTENSION=`$PKG_CONFIG --print-errors --variable=extensiondir guile-$GUILE_EFFECTIVE_VERSION`
+  AC_MSG_RESULT($GUILE_EXTENSION)
+  if test "$GUILE_EXTENSION" = ""; then
+    GUILE_EXTENSION=""
+    AC_MSG_WARN(extensiondir not found)
+  fi
+  AC_SUBST(GUILE_EXTENSION)
  ])
 
 # GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
-- 
2.9.3


  reply	other threads:[~2017-03-14 15:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-12  9:38 [PATCH] Add to the 2.1.x branch GUILE_SITE_CCACHE_DIR and GUILE_EXTENSION_DIR Autoconf macros along with needed siteccachdir entry in pkgconfig file Freja Nordsiek
2017-03-13 12:46 ` Andy Wingo
2017-03-14 14:08   ` Freja Nordsiek
2017-03-14 14:53     ` Andy Wingo
2017-03-14 15:31       ` Freja Nordsiek [this message]
2017-03-14 15:56         ` Andy Wingo
2017-03-14 16:10           ` Freja Nordsiek
2017-03-14 19:41             ` Freja Nordsiek
2017-03-15  7:46               ` Andy Wingo
2017-03-15  7:49                 ` Freja Nordsiek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOqf98qv0gacMCCSREt4_K0YRukko2v92G2mnXSSvY5qdBhpfw@mail.gmail.com \
    --to=fnordsie@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).