changeset 21290:1309edb344e1

use top_srcdir, top_builddir, abs_top_srcdir or abs_top_builddir only if needed The build system runs primarily in the top-level directory now, so unless a Make rule changes the working directory before referencing a file, it is not necessary to use the abs_top_X or top_X directory names. * Makefile.am, build-aux/common.mk, doc/module.mk, libgui/graphics/module.mk, libgui/module.mk, libgui/src/module.mk, libinterp/corefcn/module.mk, libinterp/module.mk, liboctave/cruft/module.mk, liboctave/cruft/ranlib/module.mk, liboctave/module.mk, liboctave/numeric/module.mk liboctave/operators/module.mk, scripts/module.mk, src/module.mk: Only use Use $(top_srcdir), $(top_builddir), $(abs_top_srcdir), and $(abs_top_builddir) if necessary.
author John W. Eaton <jwe@octave.org>
date Wed, 17 Feb 2016 13:32:44 -0500
parents 952854b61ac9
children b4f7932a3124
files Makefile.am build-aux/common.mk doc/module.mk libgui/graphics/module.mk libgui/module.mk libgui/src/module.mk libinterp/corefcn/module.mk libinterp/module.mk liboctave/cruft/module.mk liboctave/cruft/ranlib/module.mk liboctave/module.mk liboctave/numeric/module.mk liboctave/operators/module.mk scripts/module.mk src/module.mk
diffstat 15 files changed, 69 insertions(+), 71 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Wed Feb 17 11:35:42 2016 -0500
+++ b/Makefile.am	Wed Feb 17 13:32:44 2016 -0500
@@ -189,7 +189,7 @@
 	chmod a+rx "$@"
 
 octave-config.h: config.h build-aux/mk-octave-config-h.sh
-	$(AM_V_GEN)$(SHELL) $(top_srcdir)/build-aux/mk-octave-config-h.sh $< > $@-t && \
+	$(AM_V_GEN)$(SHELL) $(srcdir)/build-aux/mk-octave-config-h.sh $< > $@-t && \
 	mv $@-t $@
 
 bits/stl_algo.h: build-aux/stl_algo.h-fixed
--- a/build-aux/common.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/build-aux/common.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -145,9 +145,7 @@
 
 LD_CXX = @LD_CXX@
 LD_STATIC_FLAG = @LD_STATIC_FLAG@
-LIBFLAGS = -L$(top_builddir)
 WARN_LDFLAGS = @WARN_LDFLAGS@
-#ALL_LDFLAGS = $(LIBFLAGS) $(LD_STATIC_FLAG) $(CPICFLAG) $(LDFLAGS)
 
 BUILD_LDFLAGS = @BUILD_LDFLAGS@
 
--- a/doc/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/doc/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -292,7 +292,7 @@
 
 doc/interpreter/octave.dvi: doc/interpreter/octave.texi $(srcdir)/doc/interpreter/version-octave.texi | doc/interpreter/$(am__dirstamp)
 	$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
-	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(abs_top_srcdir)/doc/interpreter' \
+	MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc/interpreter -I $(srcdir)/doc/interpreter' \
 	$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
 	`test -f 'doc/interpreter/octave.texi' || echo '$(abs_top_srcdir)/'`doc/interpreter/octave.texi
 
--- a/libgui/graphics/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/libgui/graphics/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -130,16 +130,16 @@
   @QT_CPPFLAGS@ \
   -Ilibgui/graphics -I$(srcdir)/libgui/graphics \
   -Isrc -I$(srcdir)/libgui/src \
-  -I$(top_srcdir)/liboctave/cruft/misc \
-  -I$(top_srcdir)/liboctave/array \
-  -I$(top_builddir)/liboctave/numeric -I$(top_srcdir)/liboctave/numeric \
-  -I$(top_builddir)/liboctave/operators -I$(top_srcdir)/liboctave/operators \
-  -I$(top_srcdir)/liboctave/system \
-  -I$(top_srcdir)/liboctave/util \
-  -I$(top_builddir)/libinterp -I$(top_srcdir)/libinterp \
-  -I$(top_builddir)/libinterp/parse-tree -I$(top_srcdir)/libinterp/parse-tree \
-  -I$(top_builddir)/libinterp/corefcn -I$(top_srcdir)/libinterp/corefcn \
-  -I$(top_srcdir)/libinterp/octave-value
+  -I$(srcdir)/liboctave/cruft/misc \
+  -I$(srcdir)/liboctave/array \
+  -Iliboctave/numeric -I$(srcdir)/liboctave/numeric \
+  -Iliboctave/operators -I$(srcdir)/liboctave/operators \
+  -I$(srcdir)/liboctave/system \
+  -I$(srcdir)/liboctave/util \
+  -Ilibinterp -I$(srcdir)/libinterp \
+  -Ilibinterp/parse-tree -I$(srcdir)/libinterp/parse-tree \
+  -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \
+  -I$(srcdir)/libinterp/octave-value
 
 libgui_graphics_libgui_graphics_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
 
--- a/libgui/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/libgui/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -48,8 +48,8 @@
   libgui/qterminal/libqterminal.la \
   libgui/src/libgui-src.la \
   libgui/graphics/libgui-graphics.la \
-  $(top_builddir)/libinterp/liboctinterp.la \
-  $(top_builddir)/liboctave/liboctave.la \
+  libinterp/liboctinterp.la \
+  liboctave/liboctave.la \
   $(LIBOCTGUI_LINK_DEPS)
 
 # Increment these as needed and according to the rules in the libtool manual:
--- a/libgui/src/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/libgui/src/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -200,17 +200,17 @@
   -I$(srcdir)/libgui/src/m-editor \
   -I$(srcdir)/libgui/src/qtinfo \
   -I$(srcdir)/libgui/graphics \
-  -I$(top_srcdir)/liboctave/cruft/misc \
-  -I$(top_srcdir)/liboctave/array \
-  -I$(top_builddir)/liboctave/numeric -I$(top_srcdir)/liboctave/numeric \
-  -I$(top_builddir)/liboctave/operators -I$(top_srcdir)/liboctave/operators \
-  -I$(top_srcdir)/liboctave/system \
-  -I$(top_srcdir)/liboctave/util \
-  -I$(top_builddir)/libinterp -I$(top_srcdir)/libinterp \
-  -I$(top_builddir)/libinterp/parse-tree -I$(top_srcdir)/libinterp/parse-tree \
-  -I$(top_builddir)/libinterp/corefcn -I$(top_srcdir)/libinterp/corefcn \
-  -I$(top_srcdir)/libinterp/octave-value \
-  -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
+  -I$(srcdir)/liboctave/cruft/misc \
+  -I$(srcdir)/liboctave/array \
+  -Iliboctave/numeric -I$(srcdir)/liboctave/numeric \
+  -Iliboctave/operators -I$(srcdir)/liboctave/operators \
+  -I$(srcdir)/liboctave/system \
+  -I$(srcdir)/liboctave/util \
+  -Ilibinterp -I$(srcdir)/libinterp \
+  -Ilibinterp/parse-tree -I$(srcdir)/libinterp/parse-tree \
+  -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \
+  -I$(srcdir)/libinterp/octave-value \
+  -Ilibgnu -I$(srcdir)/libgnu
 
 libgui_src_libgui_src_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
 
--- a/libinterp/corefcn/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/libinterp/corefcn/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -7,12 +7,12 @@
   libinterp/corefcn/LSODE-opts.cc \
   libinterp/corefcn/Quad-opts.cc
 
-$(OPT_HANDLERS): libinterp/corefcn/%.cc : $(top_builddir)/liboctave/numeric/%.in
+$(OPT_HANDLERS): libinterp/corefcn/%.cc : liboctave/numeric/%.in
 	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(PERL) $(top_srcdir)/build-aux/mk-opts.pl --opt-handler-fcns $< > $@-t && \
+	$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-handler-fcns $< > $@-t && \
 	mv $@-t $@
 
-$(OPT_HANDLERS): $(top_srcdir)/build-aux/mk-opts.pl
+$(OPT_HANDLERS): $(srcdir)/build-aux/mk-opts.pl
 
 JIT_INC = \
   libinterp/corefcn/jit-util.h \
--- a/libinterp/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/libinterp/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -7,19 +7,19 @@
 ## Search local directories before those specified by the user.
 libinterp_liboctinterp_la_CPPFLAGS = \
   @OCTINTERP_DLL_DEFS@ \
-  -I$(top_builddir)/liboctave -I$(top_srcdir)/liboctave \
-  -I$(top_srcdir)/liboctave/cruft/misc \
-  -I$(top_srcdir)/liboctave/array \
-  -I$(top_builddir)/liboctave/numeric -I$(top_srcdir)/liboctave/numeric \
-  -I$(top_builddir)/liboctave/operators -I$(top_srcdir)/liboctave/operators \
-  -I$(top_srcdir)/liboctave/system \
-  -I$(top_srcdir)/liboctave/util \
+  -Iliboctave -I$(srcdir)/liboctave \
+  -I$(srcdir)/liboctave/cruft/misc \
+  -I$(srcdir)/liboctave/array \
+  -Iliboctave/numeric -I$(srcdir)/liboctave/numeric \
+  -Iliboctave/operators -I$(srcdir)/liboctave/operators \
+  -I$(srcdir)/liboctave/system \
+  -I$(srcdir)/liboctave/util \
   -I$(srcdir)/libinterp/octave-value \
   -Ilibinterp -I$(srcdir)/libinterp \
   -I$(srcdir)/libinterp/operators \
   -Ilibinterp/parse-tree -I$(srcdir)/libinterp/parse-tree \
   -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \
-  -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu \
+  -Ilibgnu -I$(srcdir)/libgnu \
   $(HDF5_CPPFLAGS)
 
 libinterp_liboctinterp_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
@@ -136,7 +136,7 @@
 include libinterp/dldfcn/module.mk
 
 $(srcdir)/libinterp/dldfcn/module.mk: $(srcdir)/libinterp/dldfcn/config-module.sh $(srcdir)/libinterp/dldfcn/config-module.awk $(srcdir)/libinterp/dldfcn/module-files
-	$(AM_V_GEN)$(SHELL) $(srcdir)/libinterp/dldfcn/config-module.sh $(top_srcdir)
+	$(AM_V_GEN)$(SHELL) $(srcdir)/libinterp/dldfcn/config-module.sh $(srcdir)
 
 if AMCOND_ENABLE_DYNAMIC_LINKING
   OCT_FILES = $(DLDFCN_LIBS:.la=.oct)
@@ -168,7 +168,7 @@
   libinterp/octave-value/liboctave-value.la \
   libinterp/parse-tree/libparse-tree.la \
   libinterp/corefcn/libcorefcn.la \
-  $(top_builddir)/liboctave/liboctave.la \
+  liboctave/liboctave.la \
   $(LIBOCTINTERP_LINK_DEPS)
 
 # Increment these as needed and according to the rules in the libtool manual:
@@ -228,7 +228,7 @@
 
 ## Rules to build test files
 
-LIBINTERP_TST_FILES_SRC := $(shell $(SHELL) $(top_srcdir)/build-aux/find-files-with-tests.sh "$(srcdir)" $(ULT_DIST_SRC) $(DLDFCN_SRC))
+LIBINTERP_TST_FILES_SRC := $(shell $(SHELL) $(srcdir)/build-aux/find-files-with-tests.sh "$(srcdir)" $(ULT_DIST_SRC) $(DLDFCN_SRC))
 
 LIBINTERP_TST_FILES := $(addsuffix -tst,$(LIBINTERP_TST_FILES_SRC))
 
@@ -252,7 +252,7 @@
 libinterp/build-env.cc: libinterp/build-env.in.cc Makefile
 	$(AM_V_GEN)$(do_subst_config_vals)
 
-libinterp/build-env-features.cc: $(top_builddir)/config.h libinterp/build-env-features.sh
+libinterp/build-env-features.cc: config.h libinterp/build-env-features.sh
 	$(AM_V_GEN)rm -f $@-t && \
 	$(SHELL) $(srcdir)/libinterp/build-env-features.sh $< > $@-t && \
 	$(simple_move_if_change_rule)
@@ -303,7 +303,7 @@
 	fi && \
 	$(PERL) $(srcdir)/libinterp/gendoc.pl $(ALL_DEF_FILES) > $@-t && \
 	mv $@-t $@ && \
-	$(SHELL) $(top_srcdir)/build-aux/move-if-change $@ libinterp/DOCSTRINGS && \
+	$(SHELL) $(srcdir)/build-aux/move-if-change $@ libinterp/DOCSTRINGS && \
 	touch $@
 
 OCTAVE_INTERPRETER_TARGETS += \
--- a/liboctave/cruft/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/liboctave/cruft/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -26,7 +26,7 @@
 
 define gen-cruft-def
   rm -f $@-t $@ && \
-  $(SHELL) liboctave/cruft/mkf77def $(top_srcdir) $(liboctave_cruft_libcruft_la_SOURCES) > $@-t && \
+  $(SHELL) liboctave/cruft/mkf77def $(srcdir) $(liboctave_cruft_libcruft_la_SOURCES) > $@-t && \
   mv $@-t $@
 endef
 
--- a/liboctave/cruft/ranlib/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/liboctave/cruft/ranlib/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -44,7 +44,7 @@
 define gen-ranlib-def
   rm -f $@-t $@ && \
   $(MKDIR_P) liboctave/cruft/ranlib && \
-  $(SHELL) liboctave/cruft/mkf77def $(top_srcdir) $(RANLIB_SRC) > $@-t && \
+  $(SHELL) liboctave/cruft/mkf77def $(srcdir) $(RANLIB_SRC) > $@-t && \
   mv $@-t $@
 endef
 
--- a/liboctave/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/liboctave/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -14,7 +14,7 @@
   -Iliboctave/operators -I$(srcdir)/liboctave/operators \
   -I$(srcdir)/liboctave/system \
   -I$(srcdir)/liboctave/util \
-  -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
+  -Ilibgnu -I$(srcdir)/libgnu
 
 liboctave_liboctave_la_CFLAGS = $(AM_CFLAGS) $(WARN_CFLAGS)
 
@@ -67,7 +67,7 @@
 nodist_EXTRA_liboctave_liboctave_la_SOURCES = liboctave/dummy.cc
 
 liboctave_liboctave_la_LIBADD += \
-  $(top_builddir)/libgnu/libgnu.la \
+  libgnu/libgnu.la \
   $(LIBOCTAVE_LINK_DEPS)
 
 # Increment these as needed and according to the rules in the libtool manual:
@@ -94,7 +94,7 @@
   $(liboctave_util_libutil_la_SOURCES) \
   $(LIBOCTAVE_TEMPLATE_SRC)
 
-LIBOCTAVE_TST_FILES_SRC := $(shell $(SHELL) $(top_srcdir)/build-aux/find-files-with-tests.sh "$(srcdir)" $(LIBOCTAVE_TST_SRC))
+LIBOCTAVE_TST_FILES_SRC := $(shell $(SHELL) $(srcdir)/build-aux/find-files-with-tests.sh "$(srcdir)" $(LIBOCTAVE_TST_SRC))
 
 LIBOCTAVE_TST_FILES := $(addsuffix -tst,$(LIBOCTAVE_TST_FILES_SRC))
 
--- a/liboctave/numeric/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/liboctave/numeric/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -99,10 +99,10 @@
 ## Special rules for sources which must be built before rest of compilation.
 $(LIBOCTAVE_OPT_INC) : %.h : %.in
 	$(AM_V_GEN)rm -f $@-t $@ && \
-	$(PERL) $(top_srcdir)/build-aux/mk-opts.pl --opt-class-header $< > $@-t && \
+	$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-class-header $< > $@-t && \
 	mv $@-t $@
 
-$(LIBOCTAVE_OPT_INC) : $(top_srcdir)/build-aux/mk-opts.pl
+$(LIBOCTAVE_OPT_INC) : $(srcdir)/build-aux/mk-opts.pl
 
 noinst_LTLIBRARIES += liboctave/numeric/libnumeric.la
 
--- a/liboctave/operators/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/liboctave/operators/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -57,7 +57,7 @@
 
 ## Special rules for sources which must be built before rest of compilation.
 
-OP_SRCDIR = $(abs_top_srcdir)/liboctave/operators
+OP_SRCDIR = $(srcdir)/liboctave/operators
 
 define run-mk-ops
   rm -f $@-t $@ && \
--- a/scripts/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/scripts/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -117,7 +117,7 @@
 	fi && \
 	$(PERL) $(srcdir)/scripts/mkdoc.pl "$(srcdir)" $(FCN_FILES) -- $(GEN_FCN_FILES) > $@-t && \
 	mv $@-t $@ && \
-	$(SHELL) $(top_srcdir)/build-aux/move-if-change $@ scripts/DOCSTRINGS && \
+	$(SHELL) $(srcdir)/build-aux/move-if-change $@ scripts/DOCSTRINGS && \
 	touch $@
 
 OCTAVE_INTERPRETER_TARGETS += \
--- a/src/module.mk	Wed Feb 17 11:35:42 2016 -0500
+++ b/src/module.mk	Wed Feb 17 13:32:44 2016 -0500
@@ -7,15 +7,15 @@
 ## Search local directories before those specified by the user.
 
 SRC_DIR_CPPFLAGS = \
-  -I$(top_srcdir)/liboctave/array \
-  -I$(top_srcdir)/liboctave/cruft/misc \
-  -I$(top_srcdir)/liboctave/numeric \
-  -I$(top_srcdir)/liboctave/system \
-  -I$(top_srcdir)/liboctave/util \
-  -I$(top_srcdir)/libinterp \
-  -I$(top_builddir)/libinterp/corefcn -I$(top_srcdir)/libinterp/corefcn \
-  -I$(top_srcdir)/src \
-  -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu
+  -I$(srcdir)/liboctave/array \
+  -I$(srcdir)/liboctave/cruft/misc \
+  -I$(srcdir)/liboctave/numeric \
+  -I$(srcdir)/liboctave/system \
+  -I$(srcdir)/liboctave/util \
+  -I$(srcdir)/libinterp \
+  -Ilibinterp/corefcn -I$(srcdir)/libinterp/corefcn \
+  -I$(srcdir)/src \
+  -Ilibgnu -I$(srcdir)/libgnu
 
 EXTRA_DIST += \
   src/main.in.cc \
@@ -51,14 +51,14 @@
 endif
 
 OCTAVE_CORE_LIBS = \
-  $(top_builddir)/libinterp/liboctinterp.la \
-  $(top_builddir)/liboctave/liboctave.la
+  libinterp/liboctinterp.la \
+  liboctave/liboctave.la
 
 nodist_src_octave_SOURCES = src/main.cc
 src_octave_SOURCES = src/display-available.c
 
 src_octave_LDADD = \
-  $(top_builddir)/libgnu/libgnu.la \
+  libgnu/libgnu.la \
   $(X11_LIBS) \
   $(CARBON_LIBS) \
   $(GNULIB_LINK_DEPS)
@@ -101,8 +101,8 @@
 
 if AMCOND_BUILD_GUI
   src_octave_gui_SOURCES = src/main-gui.cc
-  OCTAVE_GUI_LIBS = $(top_builddir)/libgui/liboctgui.la
-  OCTAVE_GUI_CPPFLAGS = -I$(top_srcdir)/libgui/src
+  OCTAVE_GUI_LIBS = libgui/liboctgui.la
+  OCTAVE_GUI_CPPFLAGS = -I$(srcdir)/libgui/src
 endif
 
 src_octave_gui_CPPFLAGS = \
@@ -127,7 +127,7 @@
 
 nodist_src_mkoctfile_SOURCES = src/mkoctfile.cc
 
-src_mkoctfile_LDADD = $(top_builddir)/libgnu/libgnu.la $(LIBS)
+src_mkoctfile_LDADD = libgnu/libgnu.la $(LIBS)
 
 src_mkoctfile_CPPFLAGS = \
   $(SRC_DIR_CPPFLAGS) \
@@ -142,8 +142,8 @@
 nodist_src_octave_config_SOURCES = src/octave-config.cc
 
 src_octave_config_LDADD = \
-  $(top_builddir)/libinterp/corefcn/libcorefcn.la \
-  $(top_builddir)/libgnu/libgnu.la \
+  libinterp/corefcn/libcorefcn.la \
+  libgnu/libgnu.la \
   $(LIBS)
 
 src_octave_config_CPPFLAGS = \
@@ -166,7 +166,7 @@
 OCTAVE_CROSS_TOOLS += src/$(host_triplet)-mkoctfile$(BUILD_EXEEXT)
 
 src/$(host_triplet)-mkoctfile$(BUILD_EXEEXT): src/$(host_triplet)-mkoctfile.cc
-	$(BUILD_CXX) -o src/$(host_triplet)-mkoctfile$(BUILD_EXEEXT) -Dgnulib='' -Doctave_idx_type=int $(DEFAULT_INCLUDES) $(BUILD_CXXFLAGS) $(BUILD_LDFLAGS) -I$(top_srcdir)/src src/$(host_triplet)-mkoctfile.cc
+	$(BUILD_CXX) -o src/$(host_triplet)-mkoctfile$(BUILD_EXEEXT) -Dgnulib='' -Doctave_idx_type=int $(DEFAULT_INCLUDES) $(BUILD_CXXFLAGS) $(BUILD_LDFLAGS) -I$(srcdir)/src src/$(host_triplet)-mkoctfile.cc
 
 src/$(host_triplet)-mkoctfile.cc: src/mkoctfile.in.cc Makefile | src/$(octave_dirstamp)
 	$(AM_V_GEN)$(do_subst_cross_config_vals)
@@ -176,7 +176,7 @@
 OCTAVE_CROSS_TOOLS += src/$(host_triplet)-octave-config$(BUILD_EXEEXT)
 
 src/$(host_triplet)-octave-config$(BUILD_EXEEXT): src/$(host_triplet)-octave-config.cc
-	$(BUILD_CXX) -o src/$(host_triplet)-octave-config$(BUILD_EXEEXT) -Dgnulib='' -Doctave_idx_type=int $(DEFAULT_INCLUDES) $(BUILD_CXXFLAGS) $(BUILD_LDFLAGS) -I$(top_srcdir)/src src/$(host_triplet)-octave-config.cc
+	$(BUILD_CXX) -o src/$(host_triplet)-octave-config$(BUILD_EXEEXT) -Dgnulib='' -Doctave_idx_type=int $(DEFAULT_INCLUDES) $(BUILD_CXXFLAGS) $(BUILD_LDFLAGS) -I$(srcdir)/src src/$(host_triplet)-octave-config.cc
 
 src/$(host_triplet)-octave-config.cc: src/octave-config.in.cc Makefile | src/$(octave_dirstamp)
 	$(AM_V_GEN)$(do_subst_default_vals)