From d91eb9293bea7783afa8270c1826dc558c7380da Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Wed, 13 Aug 2014 10:13:25 +0400 Subject: [PATCH] Improve guile-site handling in autoconf * meta/guile.m4(GUILE_SITE_DIR): Add new substitution variable GUILE_SITE_LOCAL, that outputs "guile-site" under prefix of package beeing installed, not under guile prefix. This way `make dist-check` will be happy. Signed-off-by: Dmitry Bogatov --- meta/guile.m4 | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/meta/guile.m4 b/meta/guile.m4 index 441dcd4..31339c9 100644 --- a/meta/guile.m4 +++ b/meta/guile.m4 @@ -162,7 +162,11 @@ AC_DEFUN([GUILE_FLAGS], # PREFIX/share/guile/site, and sets var @var{GUILE_SITE} to the path. # Note that the var name is different from the macro name. # -# The variable is marked for substitution, as by @code{AC_SUBST}. +# Also, set @var{GUILE_SITE_LOCAL} variable as installation path +# under package prefix, if it is specified. It is suitable for +# non-root installation of Guile modules. +# +# The variables is marked for substitution, as by @code{AC_SUBST}. # AC_DEFUN([GUILE_SITE_DIR], [AC_REQUIRE([GUILE_PKG]) @@ -172,7 +176,17 @@ AC_DEFUN([GUILE_SITE_DIR], if test "$GUILE_SITE" = ""; then AC_MSG_FAILURE(sitedir not found) fi + if test "x$prefix" != xNONE ; then + GUILE_SITE_LOCAL=`$PKG_CONFIG --print-errors --variable=sitedir guile-$GUILE_EFFECTIVE_VERSION --define-variable=prefix=$prefix` + else + GUILE_SITE_LOCAL="$GUILE_SITE" + fi + AC_ARG_WITH([guile-site-dir], + [AS_HELP_STRING([--with-guile-site-dir], [use the specified installation path for Guile modules])], + [GUILE_SITE_LOCAL="$withval"], + []) AC_SUBST(GUILE_SITE) + AC_SUBST(GUILE_SITE_LOCAL) ]) # GUILE_PROGS -- set paths to Guile interpreter, config and tool programs -- I may be not subscribed. Please, keep me in carbon copy.