@@ -46,7 +46,7 @@ do_subst = $(SED) \
-e 's,[@]abs_top_builddir[@],$(abs_top_builddir),g' \
-e 's,[@]localedir[@],$(localedir),g'
-scripts/guix: scripts/guix.in Makefile
+scripts/guix: scripts/guix.in Makefile guile$(EXEEXT)
$(AM_V_at)rm -f $@ $@-t
$(AM_V_at)$(MKDIR_P) "$(@D)"
$(AM_V_GEN)$(do_subst) < "$(srcdir)/$@.in" > "$@-t"
@@ -37,11 +37,18 @@ GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
+CURRENT_GUIX=$(which guix)
# Define $PATH so that `guix' and friends are easily found.
PATH="$abs_top_builddir/scripts:$abs_top_builddir:$PATH"
export PATH
+# sanity check
+if [ "$CURRENT_GUIX" = "`which guix`" ]; then
+ echo "$abs_top_builddir/scripts/guix is not built. Please run make scripts/guix"
+ exit 1
+fi
+
# The daemon invokes 'guix'; tell it which one to use.
GUIX="$abs_top_builddir/scripts/guix"
export GUIX