diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 263d6b04c..6f2f79367 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -52,12 +52,17 @@ noinst_PROGRAMS = guile_filter_doc_snarfage gen-scmconfig gen_scmconfig_SOURCES = gen-scmconfig.c -## Override default rule; this should be compiled for BUILD host. -## For some reason, OBJEXT does not include the dot +## Override default rule; this should be compiled for BUILD host. Note +## that we don't add $(AM_CPPFLAGS) here, as we need to run this +## program, but $(top_srcdir)/lib has a gnulib configured for the +## target. Instead we manually add $(top_builddir), in order to pick up +## the generated config.h and gen-scmconfig.h. Nothing else from Guile +## is included by this code generator. gen-scmconfig.$(OBJEXT): gen-scmconfig.c $(AM_V_GEN) \ if [ "$(cross_compiling)" = "yes" ]; then \ - $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) -c -o $@ $<; \ + $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) -I$(top_builddir) \ + -c -o $@ $<; \ else \ $(COMPILE) -c -o $@ $<; \ fi