1## Autoconf macros for working with Guile.
2
3##   Copyright (C) 2017 Free Software Foundation, Inc.
4
5## This library is free software; you can redistribute it and/or
6## modify it under the terms of the GNU Lesser General Public License
7## as published by the Free Software Foundation; either version 3 of
8## the License, or (at your option) any later version.
9
10## This library is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13## Lesser General Public License for more details.
14
15## You should have received a copy of the GNU Lesser General Public
16## License along with this library; if not, write to the Free Software
17## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18## 02110-1301 USA
19
20# serial 10
21
22## Index
23## -----
24
25## GUILE_GLOBAL_SITE_DIR -- find path to Guile "global site" directory
26## GUILE_SITE_CCACHE_DIR -- find path to Guile "site-ccache" directory
27
28## Code
29## ----
30
31
32# GUILE_GLOBAL_SITE_DIR -- find path to Guile global site directory
33#
34# Usage: GUILE_GLOBAL_SITE_DIR
35#
36# This looks for Guile's global site directory, usually something like
37# PREFIX/share/guile/site, and sets var @var{GUILE_GLOBAL_SITE} to the
38# path.  Note that the var name is different from the macro name.
39#
40# The variable is marked for substitution, as by @code{AC_SUBST}.
41#
42AC_DEFUN([GUILE_GLOBAL_SITE_DIR],
43 [AC_REQUIRE([GUILE_PROGS])
44  AC_MSG_CHECKING(for Guile global site directory)
45  GUILE_GLOBAL_SITE=`$GUILE -c "(display (%global-site-dir))"`
46  if test "$GUILE_GLOBAL_SITE" = ""; then
47     AC_MSG_FAILURE(global site dir not found)
48  fi
49  AC_MSG_RESULT($GUILE_GLOBAL_SITE)
50  AC_SUBST(GUILE_GLOBAL_SITE)
51 ])
52
53
54# GUILE_SITE_CCACHE_DIR -- find path to Guile "site-ccache" directory
55#
56# Usage: GUILE_SITE_CCACHE_DIR
57#
58# This looks for Guile's "site-ccache" directory, usually something
59# like PREFIX/lib/guile/GUILE_EFFECTIVE_VERSION/site-ccache, and sets
60# var @var{GUILE_SITE_CCACHE} to the path.  Note that the var name is
61# different from the macro name.
62#
63# The variable is marked for substitution, as by @code{AC_SUBST}.
64#
65AC_DEFUN([GUILE_SITE_CCACHE_DIR],
66 [AC_REQUIRE([GUILE_PROGS])
67  AC_MSG_CHECKING(for Guile site ccache directory)
68  GUILE_SITE_CCACHE=`$GUILE -c "(display (%site-ccache-dir))"`
69  if test "$GUILE_SITE_CCACHE" = ""; then
70     AC_MSG_FAILURE(site ccache dir not found)
71  fi
72  AC_MSG_RESULT($GUILE_SITE_CCACHE)
73  AC_SUBST(GUILE_SITE_CCACHE)
74 ])
75