[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-185-gccd0a
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-185-gccd0ae1 |
Date: |
Sun, 10 Mar 2013 22:35:54 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=ccd0ae1fbb1c8c942a89bf84272377b341739e0f
The branch, stable-2.0 has been updated
via ccd0ae1fbb1c8c942a89bf84272377b341739e0f (commit)
via 988ca6b212fce6d9419d1ffce8f115425ade3a9f (commit)
from a4b4fbbdaa3542e35ea436179200d071b57ff1ca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ccd0ae1fbb1c8c942a89bf84272377b341739e0f
Author: Andy Wingo <address@hidden>
Date: Fri Mar 30 20:04:16 2012 +0200
guile.m4 allows selection of guile 2.0, 1.8, etc.
* meta/guile.m4 (GUILE_PKG): New macro, chooses a version of Guile
against which to compile.
(GUILE_FLAGS, GUILE_PROGS): Rewrite to call GUILE_PKG as necessary, to
respect any previous call to GUILE_PKG, and to not require
guile-tools.
commit 988ca6b212fce6d9419d1ffce8f115425ade3a9f
Author: Jason Earl <address@hidden>
Date: Sun Mar 10 23:20:22 2013 +0100
add %site-ccache-dir
* libguile/load.h:
* libguile/load.c (scm_sys_site_ccache_dir): New procedure.
* doc/ref/scheme-using.texi (Installing Site Packages):
* doc/ref/api-options.texi (Build Config): Add docs.
Fixes bug 10326.
-----------------------------------------------------------------------
Summary of changes:
doc/ref/api-options.texi | 7 ++
doc/ref/scheme-using.texi | 11 ++--
libguile/load.c | 13 ++++
libguile/load.h | 3 +-
meta/guile.m4 | 171 ++++++++++++++++++++++++++++++++------------
5 files changed, 152 insertions(+), 53 deletions(-)
diff --git a/doc/ref/api-options.texi b/doc/ref/api-options.texi
index 1734318..a1575c5 100644
--- a/doc/ref/api-options.texi
+++ b/doc/ref/api-options.texi
@@ -96,6 +96,13 @@ your site should be installed. On Unix-like systems, this
is usually
@file{/usr/local/share/guile/site} or @file{/usr/share/guile/site}.
@end deffn
address@hidden {Scheme Procedure} %site-ccache-dir
address@hidden {C Function} scm_sys_site_ccache_dir ()
+Return the directory where users should install compiled @code{.go}
+files for use with this version of Guile. Might look something like
address@hidden/usr/lib/guile/@value{EFFECTIVE-VERSION}/site-ccache}.
address@hidden deffn
+
@defvar %guile-build-info
Alist of information collected during the building of a particular
Guile. Entries can be grouped into one of several categories:
diff --git a/doc/ref/scheme-using.texi b/doc/ref/scheme-using.texi
index b6516bd..4422c18 100644
--- a/doc/ref/scheme-using.texi
+++ b/doc/ref/scheme-using.texi
@@ -752,6 +752,7 @@ list}, or simply @code{guild}.
@cindex site path
@cindex load path
@findex %site-dir
address@hidden %site-ccache-dir
At some point, you will probably want to share your code with other
people. To do so effectively, it is important to follow a set of common
@@ -783,11 +784,11 @@ find them.
As with Scheme files, Guile searches a path to find compiled @code{.go}
files, the @code{%load-compiled-path}. By default, this path has two
entries: a path for Guile's files, and a path for site packages. You
-should install your @code{.go} files into the latter. Currently there
-is no procedure to get at this path, which is probably a bug. As in the
-previous example, if Guile @value{EFFECTIVE-VERSION} is installed on
-your system in @code{/usr/}, then the place to put compiled files for
-site packages will be
+should install your @code{.go} files into the latter directory, whose
+value is returned by invoking the @code{%site-ccache-dir} procedure. As
+in the previous example, if Guile @value{EFFECTIVE-VERSION} is installed
+on your system in @code{/usr/}, then @code{(%site-ccache-dir)} site
+packages will be
@code{/usr/lib/guile/@value{EFFECTIVE-VERSION}/site-ccache}.
Note that a @code{.go} file will only be loaded in preference to a
diff --git a/libguile/load.c b/libguile/load.c
index da75a5a..c460725 100644
--- a/libguile/load.c
+++ b/libguile/load.c
@@ -198,6 +198,19 @@ SCM_DEFINE (scm_sys_global_site_dir, "%global-site-dir",
0,0,0,
#undef FUNC_NAME
#endif /* SCM_GLOBAL_SITE_DIR */
+#ifdef SCM_SITE_CCACHE_DIR
+SCM_DEFINE (scm_sys_site_ccache_dir, "%site-ccache-dir", 0,0,0,
+ (),
+ "Return the directory where users should install compiled\n"
+ "@code{.go} files for use with this version of Guile.\n\n"
+ "E.g., may return \"/usr/lib/guile/" SCM_EFFECTIVE_VERSION
"/site-ccache\".")
+#define FUNC_NAME s_scm_sys_site_ccache_dir
+{
+ return scm_from_locale_string (SCM_SITE_CCACHE_DIR);
+}
+#undef FUNC_NAME
+#endif /* SCM_SITE_CCACHE_DIR */
+
/* Initializing the load path, and searching it. */
diff --git a/libguile/load.h b/libguile/load.h
index 698bbaf..ab75ea3 100644
--- a/libguile/load.h
+++ b/libguile/load.h
@@ -3,7 +3,7 @@
#ifndef SCM_LOAD_H
#define SCM_LOAD_H
-/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008, 2009, 2010, 2011 Free
Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1998,2000,2001, 2006, 2008, 2009, 2010, 2011, 2013
Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -34,6 +34,7 @@ SCM_API SCM scm_sys_package_data_dir (void);
SCM_API SCM scm_sys_library_dir (void);
SCM_API SCM scm_sys_site_dir (void);
SCM_API SCM scm_sys_global_site_dir (void);
+SCM_API SCM scm_sys_site_ccache_dir (void);
SCM_API SCM scm_search_path (SCM path, SCM filename, SCM rest);
SCM_API SCM scm_sys_search_load_path (SCM filename);
SCM_API SCM scm_primitive_load_path (SCM filename_and_exception_on_not_found);
diff --git a/meta/guile.m4 b/meta/guile.m4
index a7186fb..a3e1ef1 100644
--- a/meta/guile.m4
+++ b/meta/guile.m4
@@ -1,6 +1,6 @@
## Autoconf macros for working with Guile.
##
-## Copyright (C) 1998,2001, 2006, 2010 Free Software Foundation, Inc.
+## Copyright (C) 1998,2001, 2006, 2010, 2012 Free Software Foundation, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public License
@@ -22,6 +22,7 @@
## Index
## -----
##
+## 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
@@ -38,53 +39,85 @@
## NOTE: Comments preceding an AC_DEFUN (starting from "Usage:") are massaged
## into doc/ref/autoconf-macros.texi (see Makefile.am in that directory).
-# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
-#
-# Usage: GUILE_PROGS
-#
-# This macro looks for programs @code{guile}, @code{guile-config} and
-# @code{guile-tools}, and sets variables @var{GUILE}, @var{GUILE_CONFIG} and
-# @var{GUILE_TOOLS}, to their paths, respectively. If either of the first two
-# is not found, signal error.
-#
-# The variables are marked for substitution, as by @code{AC_SUBST}.
-#
-AC_DEFUN([GUILE_PROGS],
- [AC_PATH_PROG(GUILE,guile)
- if test "$GUILE" = "" ; then
- AC_MSG_ERROR([guile required but not found])
+# GUILE_PKG -- find Guile development files
+#
+# Usage: GUILE_PKG([VERSIONS])
+#
+# This macro runs the @code{pkg-config} tool to find development files
+# for an available version of Guile.
+#
+# By default, this macro will search for the latest stable version of
+# Guile (e.g. 2.0), falling back to the previous stable version
+# (e.g. 1.8) if it is available. If no address@hidden file is
+# found, an error is signalled. The found version is stored in
+# @var{GUILE_EFFECTIVE_VERSION}.
+#
+# If @code{GUILE_PROGS} was already invoked, this macro ensures that the
+# development files have the same effective version as the Guile
+# program.
+#
+# @var{GUILE_EFFECTIVE_VERSION} is marked for substitution, as by
+# @code{AC_SUBST}.
+#
+AC_DEFUN([GUILE_PKG],
+ [PKG_PROG_PKG_CONFIG
+ _guile_versions_to_search="m4_default([$1], [2.0 1.8])"
+ if test -n "$GUILE_EFFECTIVE_VERSION"; then
+ _guile_tmp=""
+ for v in $_guile_versions_to_search; do
+ if test "$v" = "$GUILE_EFFECTIVE_VERSION"; then
+ _guile_tmp=$v
+ fi
+ done
+ if test -z "$_guile_tmp"; then
+ AC_MSG_FAILURE([searching for guile development files for versions
$_guile_versions_to_search, but previously found $GUILE version
$GUILE_EFFECTIVE_VERSION])
+ fi
+ _guile_versions_to_search=$GUILE_EFFECTIVE_VERSION
fi
- AC_SUBST(GUILE)
- AC_PATH_PROG(GUILE_CONFIG,guile-config)
- if test "$GUILE_CONFIG" = "" ; then
- AC_MSG_ERROR([guile-config required but not found])
+ GUILE_EFFECTIVE_VERSION=""
+ _guile_errors=""
+ for v in $_guile_versions_to_search; do
+ AC_MSG_NOTICE([checking for guile $v])
+ if test -z "$GUILE_EFFECTIVE_VERSION"; then
+ PKG_CHECK_EXISTS([guile-$v], [GUILE_EFFECTIVE_VERSION=$v], [])
+ fi
+ done
+
+ if test -z "$GUILE_EFFECTIVE_VERSION"; then
+ AC_MSG_ERROR([
+No Guile development packages were found.
+
+Please verify that you have Guile installed. If you installed Guile
+from a binary distribution, please verify that you have also installed
+the development packages. If you installed it yourself, you might need
+to adjust your PKG_CONFIG_PATH; see the pkg-config man page for more.
+])
fi
- AC_SUBST(GUILE_CONFIG)
- AC_PATH_PROG(GUILE_TOOLS,guile-tools)
- AC_SUBST(GUILE_TOOLS)
+ AC_MSG_NOTICE([found guile $v])
+ AC_SUBST([GUILE_EFFECTIVE_VERSION])
])
# GUILE_FLAGS -- set flags for compiling and linking with Guile
#
# Usage: GUILE_FLAGS
#
-# This macro runs the @code{guile-config} script, installed with Guile, to
-# find out where Guile's header files and libraries are installed. It sets
-# four variables, @var{GUILE_CFLAGS}, @var{GUILE_LDFLAGS}, @var{GUILE_LIBS},
-# and @var{GUILE_LTLIBS}.
+# This macro runs the @code{pkg-config} tool to find out how to compile
+# and link programs against Guile. It sets four variables:
+# @var{GUILE_CFLAGS}, @var{GUILE_LDFLAGS}, @var{GUILE_LIBS}, and
+# @var{GUILE_LTLIBS}.
#
# @var{GUILE_CFLAGS}: flags to pass to a C or C++ compiler to build code that
# uses Guile header files. This is almost always just one or more @code{-I}
# flags.
#
-# @var{GUILE_LDFLAGS}: flags to pass to the compiler to link a program against
-# Guile. This includes @code{-lguile} for the Guile library itself, any
-# libraries that Guile itself requires (like -lqthreads), and so on. It may
-# also include one or more @code{-L} flag to tell the compiler where to find
-# the libraries. But it does not include flags that influence the program's
-# runtime search path for libraries, and will therefore lead to a program
-# that fails to start, unless all necessary libraries are installed in a
-# standard location such as @file{/usr/lib}.
+# @var{GUILE_LDFLAGS}: flags to pass to the compiler to link a program
+# against Guile. This includes @address@hidden for the
+# Guile library itself, and may also include one or more @code{-L} flag
+# to tell the compiler where to find the libraries. But it does not
+# include flags that influence the program's runtime search path for
+# libraries, and will therefore lead to a program that fails to start,
+# unless all necessary libraries are installed in a standard location
+# such as @file{/usr/lib}.
#
# @var{GUILE_LIBS} and @var{GUILE_LTLIBS}: flags to pass to the compiler or to
# libtool, respectively, to link a program against Guile. It includes flags
@@ -97,16 +130,14 @@ AC_DEFUN([GUILE_PROGS],
# The variables are marked for substitution, as by @code{AC_SUBST}.
#
AC_DEFUN([GUILE_FLAGS],
- [dnl Find guile-config.
- AC_REQUIRE([GUILE_PROGS])dnl
+ [AC_REQUIRE([GUILE_PKG])
+ PKG_CHECK_MODULES(GUILE, [guile-$GUILE_EFFECTIVE_VERSION])
- AC_MSG_CHECKING([libguile compile flags])
- GUILE_CFLAGS="`$GUILE_CONFIG compile`"
- AC_MSG_RESULT([$GUILE_CFLAGS])
+ dnl GUILE_CFLAGS and GUILE_LIBS are already defined and AC_SUBST'd by
+ dnl PKG_CHECK_MODULES. But GUILE_LIBS to pkg-config is GUILE_LDFLAGS
+ dnl to us.
- AC_MSG_CHECKING([libguile link flags])
- GUILE_LDFLAGS="`$GUILE_CONFIG link`"
- AC_MSG_RESULT([$GUILE_LDFLAGS])
+ GUILE_LDFLAGS=$GUILE_LIBS
dnl Determine the platform dependent parameters needed to use rpath.
dnl AC_LIB_LINKFLAGS_FROM_LIBS is defined in gnulib/m4/lib-link.m4 and needs
@@ -116,6 +147,7 @@ AC_DEFUN([GUILE_FLAGS],
AC_LIB_LINKFLAGS_FROM_LIBS([GUILE_LTLIBS], [$GUILE_LDFLAGS], [yes])
GUILE_LTLIBS="$GUILE_LDFLAGS $GUILE_LTLIBS"
+ AC_SUBST([GUILE_EFFECTIVE_VERSION])
AC_SUBST([GUILE_CFLAGS])
AC_SUBST([GUILE_LDFLAGS])
AC_SUBST([GUILE_LIBS])
@@ -133,16 +165,61 @@ AC_DEFUN([GUILE_FLAGS],
# The variable is marked for substitution, as by @code{AC_SUBST}.
#
AC_DEFUN([GUILE_SITE_DIR],
- [AC_REQUIRE([GUILE_PROGS])dnl
+ [AC_REQUIRE([GUILE_PKG])
AC_MSG_CHECKING(for Guile site directory)
- GUILE_SITE=`[$GUILE_CONFIG] info sitedir`
+ GUILE_SITE=`$PKG_CONFIG --print-errors --variable=sitedir
guile-$GUILE_EFFECTIVE_VERSION`
+ AC_MSG_RESULT($GUILE_SITE)
if test "$GUILE_SITE" = ""; then
- GUILE_SITE=`[$GUILE_CONFIG] info pkgdatadir`/site
+ AC_MSG_FAILURE(sitedir not found)
fi
- AC_MSG_RESULT($GUILE_SITE)
AC_SUBST(GUILE_SITE)
])
+# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
+#
+# Usage: GUILE_PROGS
+#
+# This macro looks for programs @code{guile} and @code{guild}, setting
+# variables @var{GUILE} and @var{GUILD} to their paths, respectively.
+# If @code{guile} is not found, signal an error.
+#
+# The effective version of the found @code{guile} is set to
+# @var{GUILE_EFFECTIVE_VERSION}. This macro ensures that the effective
+# version is compatible with the result of a previous invocation of
+# @code{GUILE_FLAGS}, if any.
+#
+# As a legacy interface, it also looks for @code{guile-config} and
+# @code{guile-tools}, setting @var{GUILE_CONFIG} and @var{GUILE_TOOLS}.
+#
+# The variables are marked for substitution, as by @code{AC_SUBST}.
+#
+AC_DEFUN([GUILE_PROGS],
+ [AC_PATH_PROG(GUILE,guile)
+ if test "$GUILE" = "" ; then
+ AC_MSG_ERROR([guile required but not found])
+ fi
+ AC_SUBST(GUILE)
+
+ _guile_prog_version=`$GUILE -c "(display (effective-version))"`
+ if test -z "$GUILE_EFFECTIVE_VERSION"; then
+ GUILE_EFFECTIVE_VERSION=$_guile_prog_version
+ elif test "$GUILE_EFFECTIVE_VERSION" != "$_guile_prog_version"; then
+ AC_MSG_ERROR([found development files for Guile $GUILE_EFFECTIVE_VERSION,
but $GUILE has effective version $_guile_prog_version])
+ fi
+
+ AC_PATH_PROG(GUILD,guild)
+ AC_SUBST(GUILD)
+
+ AC_PATH_PROG(GUILE_CONFIG,guile-config)
+ AC_SUBST(GUILE_CONFIG)
+ if test -n "$GUILD"; then
+ GUILE_TOOLS=$GUILD
+ else
+ AC_PATH_PROG(GUILE_TOOLS,guile-tools)
+ fi
+ AC_SUBST(GUILE_TOOLS)
+ ])
+
# GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
#
# Usage: GUILE_CHECK_RETVAL(var,check)
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-185-gccd0ae1,
Andy Wingo <=