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.




Reply via email to