On Sun 12 Mar 2017 10:38, Freja Nordsiek <fnord...@gmail.com> writes:

> Guile provides the GUILE_SITE_DIR Autoconf macro for finding where a
> user should install scheme files, but there are no equivalent macros
> for the directories to put compiled go files and C extensions into.
> The patch adds the equivalent macros to do this for the 2.1.x branch
> (it might work as is for the 2.0.x branch but I haven't tested it),
> which are more or less copy-pastes of the GUILE_SITE_DIR macro.

The patch looks good.  WDYT though about instead extending
GUILE_SITE_DIR to search for the ccache dir and the extension dir and
AC_SUBST them?  It would be nice to avoid adding more ceremonial lines
to configure.ac.

(I really wish I hadn't named it "ccache"; oh well, too late in 2.1.x to
change.)

> GUILE_SITE_CCACHE_DIR does require an additional entry to be put into
> Guile's pkgconfig file, which I named siteccachedir to fit in with the
> rest. One major issue is that the GUILE_SITE_CCACHE_DIR macro will
> fail for any version of Guile that does not have the new entry in the
> pkgconfig file, which would be all 2.0.x and 2.1.x releases thus far.
> One way around it would be to instead of using pkgconfig for it would
> to instead use the following macro that uses the Guile interpreter
> itself to find the directory (this is more or less the version I use
> in one of my own projects).
>
>     AC_DEFUN([GUILE_SITE_CCACHE_DIR],
>      [AC_REQUIRE([GUILE_PROGS])
>       AC_MSG_CHECKING([for Guile site-ccache directory])
>       GUILE_SITE_CCACHE=`$GUILE -c "(display (%site-ccache-dir))"`
>       if test $? != "0" -o "$GUILE_SITE_CCACHE" = ""; then
>         AC_MSG_FAILURE([siteccachedir not found])
>       fi
>       AC_MSG_RESULT([$GUILE_SITE_CCACHE])
>       AC_SUBST([GUILE_SITE_CCACHE])
>      ])

A fallback sounds good.  In that case it would work fine with 2.0.  We
can add more paths to the pkg-config file as well, in parallel; it's
better for other build systems.

Andy

Reply via email to