changeset 21398:7e8a410e6124

break generated file dependence on Makefile (bug #46063) * build-aux/mk-mxarray-h.in.sh, build-aux/mk-version-h.in.sh, build-aux/subst-config-vals.in.sh, build-aux/subst-cross-config-vals.in.sh, build-aux/subst-default-vals.in.sh, build-aux/subst-f77-isnan-macro.in.sh, build-aux/subst-script-vals.in.sh: New files with commands extracted from build-aux/common.mk. * build-aux/common.mk (ADDRESS_SANITIZER_OPTIONS, do_subst_config_vals, do_subst_cross_config_vals, do_subst_default_vals, do_subst_script_vals): Eliminate macros that are now in script files. (FONTCONFIG_CPPFLAGS, FT2_CPPFLAGS, LIBEXT): Move definition to configure.ac, use AC_SUBST to put values in subst-config-vals.sh and build-aux/subst-cross-config-vals.sh. (startupfiledir, localstartupfiledir): Move definition to configure.ac, use AC_SUBST to put values in subst-default-vals.sh. (ALL_FFLAGS): Delete unused macro. (simple-filter-rule): New macro. * build-aux/mk-default-qt-settings.in.sh: Rename and adapt from libgui/mk-default-qt-settings.in. * build-aux/mk-f77-def.in.sh: Rename and adapt from liboctave/cruft/mkf77def.in. * Makefile.am (EXTRA_DIST): Include new files in the list. * acinclude.m4 (OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES): Assume file names have the suffix .sh and are generated from .in.sh. * Makefile.am (run-octave): Depend on build-aux/subst-script-vals.sh instead of Makefile. (octave-config.h): Use move-if-change rule. * configure.ac: Use ${X} instead of $(X) for variables in OCTAVE_SET_DEFAULT args. (SHARED_LIBS, STATIC_LIBS): AC_SUBST them. Protect timestamp of oct-conf-post.h with a move-if-change rule. * etc/module.mk (etc/icons/octave.appdata.xml, etc/icons/octave.desktop): Don't depend on Makefile. * libgui/module.mk (libgui/default-qt-settings): Depend on build-aux/mk-default-qt-settings.sh instead of Makefile. * build-env.h, build-env.cc (ALL_CFLAGS, ALL_CXXFLAGS, ALL_FFLAGS, ALL_LDFLAGS, LIBFLAGS): Delete variables. * libinterp/corefcn/module.mk ($(OPT_HANDLERS), $(COREFCN_FT2_DF), libinterp/corefcn/defaults.h, libinterp/corefcn/graphics.h, libinterp/corefcn/graphics-props.cc, libinterp/corefcn/oct-errno.cc, libinterp/corefcn/mxarray.h, libinterp/corefcn/oct-tex-lexer.ll): Depend on timestamp file to ensure destination directory exists. (libinterp/corefcn/graphics.h, libinterp/corefcn/graphics-props.cc, libinterp/corefcn/oct-errno.cc, libinterp/corefcn/oct-tex-lexer.ll, libinterp/corefcn/oct-tex-symbols.cc): Use mv instead of move-if-change. (libinterp/corefcn/mxarray.h): Use script to substitute values. Depend on libinterp/corefcn/mxarray.in.h instead of Makefile * libinterp/corefcn/toplev.cc (octave_config_info): Don't include ALL_CFLAGS, ALL_CXXFLAGS, ALL_FFLAGS, ALL_LDFLAGS, of LIBFLAGS in the list. * libinterp/module.mk ($(SRC_DEF_FILES)): Don't depend on Makefile. (libinterp/build-env.cc, libinterp/build-env-features.cc, libinterp/builtins.cc, libinterp/builtin-defun-decls.h, libinterp/dldfcn/PKG_ADD, libinterp/.DOCSTRINGS): Depend on timestamp file to ensure destination directory exists. (libinterp/build-env.cc): Depend on build-aux/subst-config-vals.sh instead of Makefile. (libinterp/version.h): Use script to substitute values. Depend on build-aux/mk-version-h.sh instead of libinterp/version.in.h. * liboctave/cruft/module.mk (liboctave/cruft/cruft.def): Depend on timestamp file to ensure destination directory exists. (liboctave_DISTCLEANFILES): Remove liboctave/cruft/mkf77def from the list. (liboctave_EXTRA_DIST): Don't add liboctave/cruft/mkf77def.in to the list. * liboctave/cruft/ranlib/module.mk (liboctave/cruft/ranlib/ranlib.def): Depend on timestamp file to ensure destination directory exists. * liboctave/cruft/slatec-fn/module.mk (liboctave/cruft/slatec-fn/erfc.f, liboctave/cruft/slatec-fn/derfc.f): Depend on timestamp file to ensure destination directory exists. Use script to substitute values. Depend on build-aux/subst-f77-isnan-macro.sh instead of Makefile. (do-subst-isnan-macro): Delete macro. * scripts/module.mk (GEN_FCN_FILES_TEMPLATE): Use simple-filter-rule to execute build-aux/subst-config-vals.sh. Depend on build-aux/subst-config-vals.sh instead of Makefile. (scripts/.DOCSTRINGS): Don't depend on Makefile. Do depend on timestamp file to ensure destination directory exists. * src/module.mk (src/$(host_triplet)-mkoctfile.cc, src/$(host_triplet)-octave-config.cc): Depend on build-aux/subst-cross-config-vals.sh instead of Makefile. (src/octave-config.cc, src/mkoctfile.cc, src/main.cc): Depend on build-aux/subst-default-vals.sh instead of Makefile.
author John W. Eaton <jwe@octave.org>
date Fri, 04 Mar 2016 12:51:00 -0500
parents df859661e31e
children 8017ce5b2a6e
files Makefile.am build-aux/common.mk build-aux/mk-default-qt-settings.in.sh build-aux/mk-f77-def.in.sh build-aux/mk-mxarray-h.in.sh build-aux/mk-version-h.in.sh build-aux/subst-config-vals.in.sh build-aux/subst-cross-config-vals.in.sh build-aux/subst-default-vals.in.sh build-aux/subst-f77-isnan-macro.in.sh build-aux/subst-script-vals.in.sh configure.ac etc/module.mk libgui/mk-default-qt-settings.in libgui/module.mk libinterp/build-env.h libinterp/build-env.in.cc libinterp/corefcn/module.mk libinterp/corefcn/toplev.cc libinterp/module.mk liboctave/cruft/mkf77def.in liboctave/cruft/module.mk liboctave/cruft/ranlib/module.mk liboctave/cruft/slatec-fn/module.mk m4/acinclude.m4 scripts/module.mk src/module.mk
diffstat 27 files changed, 1681 insertions(+), 741 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.am	Wed Mar 02 16:46:23 2016 -0500
+++ b/Makefile.am	Fri Mar 04 12:51:00 2016 -0500
@@ -47,10 +47,19 @@
   README \
   build-aux/OctJavaQry.class \
   build-aux/find-files-with-tests.sh \
+  build-aux/mk-default-qt-settings.in.sh \
+  build-aux/mk-f77-def.in.sh \
+  build-aux/mk-mxarray-h.in.sh \
+  build-aux/mk-version-h.in.sh \
   build-aux/mk-octave-config-h.sh \
   build-aux/mk-opts.pl \
   build-aux/move-if-change \
   build-aux/stl_algo.h-fixed \
+  build-aux/subst-config-vals.in.sh \
+  build-aux/subst-cross-config-vals.in.sh \
+  build-aux/subst-default-vals.in.sh \
+  build-aux/subst-f77-isnan-macro.in.sh \
+  build-aux/subst-script-vals.in.sh \
   run-octave.in \
   $(BUILT_DISTFILES)
 
@@ -196,13 +205,13 @@
 	@echo "   make install    - to install (PREFIX=$(prefix))"
 	@echo ""
 
-run-octave: run-octave.in Makefile
-	$(AM_V_GEN)$(do_subst_script_vals) && \
-	chmod a+rx "$@"
+run-octave: run-octave.in build-aux/subst-script-vals.sh
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-script-vals.sh) && \
+	chmod a+rx $@
 
 octave-config.h: config.h build-aux/mk-octave-config-h.sh
 	$(AM_V_GEN)$(SHELL) $(srcdir)/build-aux/mk-octave-config-h.sh $< > $@-t && \
-	mv $@-t $@
+	$(simple_move_if_change_rule)
 
 bits/stl_algo.h: build-aux/stl_algo.h-fixed
 	$(AM_V_GEN)$(MKDIR_P) bits && \
--- a/build-aux/common.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/build-aux/common.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -5,8 +5,8 @@
 export SHELL
 export PERL
 
-version = $(OCTAVE_VERSION)
-api_version = $(OCTAVE_API_VERSION)
+version = ${OCTAVE_VERSION}
+api_version = ${OCTAVE_API_VERSION}
 
 ## AM_LIBTOOLFLAGS = --silent
 
@@ -16,66 +16,48 @@
 
 SHLLINKEXT=
 
-LIBEXT = a
-
 # Fortran compiler flags.
 
 AM_FFLAGS = @FFLAGS@
-ALL_FFLAGS = $(FFLAGS)
 
 # C compiler flags.
 
-AM_CFLAGS = $(XTRA_CFLAGS)
+AM_CFLAGS = ${XTRA_CFLAGS}
 
-# ifeq ($(INCLUDE_DEPS),no)
+# ifeq (${INCLUDE_DEPS},no)
 #   omit_deps = true;
 # endif
 
 # C++ compiler flags.
 
-AM_CXXFLAGS = $(XTRA_CXXFLAGS)
+AM_CXXFLAGS = ${XTRA_CXXFLAGS}
 
-FFTW_XCPPFLAGS = $(FFTW3_CPPFLAGS) $(FFTW3F_CPPFLAGS)
-FFTW_XLDFLAGS = $(FFTW3_LDFLAGS) $(FFTW3F_LDFLAGS)
-FFTW_XLIBS = $(FFTW3_LIBS) $(FFTW3F_LIBS)
-
-## Alias CPPFLAGS to CFLAGS for fontconfig and freetype.
-## This is closer to the true meaning of `pkg-config --cflags` output.
-FONTCONFIG_CPPFLAGS = $(FONTCONFIG_CFLAGS)
-FT2_CPPFLAGS = $(FT2_CFLAGS)
+FFTW_XCPPFLAGS = ${FFTW3_CPPFLAGS} ${FFTW3F_CPPFLAGS}
+FFTW_XLDFLAGS = ${FFTW3_LDFLAGS} ${FFTW3F_LDFLAGS}
+FFTW_XLIBS = ${FFTW3_LIBS} ${FFTW3F_LIBS}
 
 SPARSE_XCPPFLAGS = \
-  $(CHOLMOD_CPPFLAGS) $(UMFPACK_CPPFLAGS) \
-  $(AMD_CPPFLAGS) $(CAMD_CPPFLAGS) $(COLAMD_CPPFLAGS) \
-  $(CCOLAMD_CPPFLAGS) $(CXSPARSE_CPPFLAGS)
+  ${CHOLMOD_CPPFLAGS} ${UMFPACK_CPPFLAGS} \
+  ${AMD_CPPFLAGS} ${CAMD_CPPFLAGS} ${COLAMD_CPPFLAGS} \
+  ${CCOLAMD_CPPFLAGS} ${CXSPARSE_CPPFLAGS}
 
 SPARSE_XLDFLAGS = \
-  $(CHOLMOD_LDFLAGS) $(UMFPACK_LDFLAGS) \
-  $(AMD_LDFLAGS) $(CAMD_LDFLAGS) $(COLAMD_LDFLAGS) \
-  $(CCOLAMD_LDFLAGS) $(CXSPARSE_LDFLAGS)
+  ${CHOLMOD_LDFLAGS} ${UMFPACK_LDFLAGS} \
+  ${AMD_LDFLAGS} ${CAMD_LDFLAGS} ${COLAMD_LDFLAGS} \
+  ${CCOLAMD_LDFLAGS} ${CXSPARSE_LDFLAGS}
 
 ## Order matters, at least on some systems (Cygwin, for example).
 SPARSE_XLIBS = \
-  $(CHOLMOD_LIBS) $(UMFPACK_LIBS) \
-  $(AMD_LIBS) $(CAMD_LIBS) $(COLAMD_LIBS) \
-  $(CCOLAMD_LIBS) $(CXSPARSE_LIBS)
-
-# Miscellaneous
-
-if AMCOND_ADDRESS_SANITIZER_ENABLED
-  ADDRESS_SANITIZER_OPTIONS="symbolize=1"
-endif
+  ${CHOLMOD_LIBS} ${UMFPACK_LIBS} \
+  ${AMD_LIBS} ${CAMD_LIBS} ${COLAMD_LIBS} \
+  ${CCOLAMD_LIBS} ${CXSPARSE_LIBS}
 
 # The arguments passed to configure.
 
 CONFIG_SUBDIRS = @subdirs@
 
-# Where Octave will look for startup files
-startupfiledir = ${fcnfiledir}/startup
-localstartupfiledir = ${localfcnfiledir}/startup
-
 null =
-ldpreloadsep = $(null)@ldpreloadsep@$(null)
+ldpreloadsep = ${null}@ldpreloadsep@${null}
 
 # ==================== Octave-specific Makefile rules ====================
 
@@ -84,7 +66,7 @@
 
 define simple_move_if_change_rule
   if [ -s $@-t ]; then \
-    $(SHELL) $(top_srcdir)/build-aux/move-if-change $@-t $@; \
+    ${SHELL} ${top_srcdir}/build-aux/move-if-change $@-t $@; \
   else \
     echo "$@-t is empty!" 1>&2; \
     rm -f $@-t; \
@@ -93,425 +75,22 @@
 endef
 
 define cp_update_rule
-  if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/$@ ] && [ ! -f $@ ]; then \
-    cp $(srcdir)/$@ $@; \
-    touch -r $(srcdir)/$@ $@; \
+  if [ "x${srcdir}" != "x." ] && [ -f ${srcdir}/$@ ] && [ ! -f $@ ]; then \
+    cp ${srcdir}/$@ $@; \
+    touch -r ${srcdir}/$@ $@; \
   fi
 endef
 
-## The do_subst_config_vals and do_subst_cross_config_vals differ only in
-## the definitions of the following variables:
-##
-##   OCTAVE_CONF_MKOCTFILE_AR
-##   OCTAVE_CONF_MKOCTFILE_CC
-##   OCTAVE_CONF_MKOCTFILE_CXX
-##   OCTAVE_CONF_MKOCTFILE_DL_LD
-##   OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS
-##   OCTAVE_CONF_MKOCTFILE_F77
-##   OCTAVE_CONF_MKOCTFILE_LD_CXX
-##   OCTAVE_CONF_MKOCTFILE_RANLIB
-
-## To avoid shell command line limits, break the replacement patterns
-## into two roughly equal sized parts.
-
-define do_subst_config_vals
-  $(SED) < $< \
-    -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
-    -e "s|%NO_OCT_FILE_STRIP%|$NO_OCT_FILE_STRIP}|" \
-    -e "s|%OCTAVE_BINDIR%|\"$bindir}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_CFLAGS%|\"${ALL_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_CXXFLAGS%|\"${ALL_CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_FFLAGS%|\"${ALL_FFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_LDFLAGS%|\"${ALL_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_AMD_CPPFLAGS%|\"${AMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_AMD_LDFLAGS%|\"${AMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_AMD_LIBS%|\"${AMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_AR%|\"${AR}\"|" \
-    -e "s|%OCTAVE_CONF_ARFLAGS%|\"${ARFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ARPACK_CPPFLAGS%|\"${ARPACK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ARPACK_LDFLAGS%|\"${ARPACK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ARPACK_LIBS%|\"${ARPACK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_BLAS_LIBS%|\"${BLAS_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CAMD_CPPFLAGS%|\"${CAMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CAMD_LDFLAGS%|\"${CAMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CAMD_LIBS%|\"${CAMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CANONICAL_HOST_TYPE%|\"${canonical_host_type}\"|" \
-    -e "s|%OCTAVE_CONF_CARBON_LIBS%|\"${CARBON_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CC%|\"${CC}\"|" \
-    -e "s|%OCTAVE_CONF_CCOLAMD_CPPFLAGS%|\"${CCOLAMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CCOLAMD_LDFLAGS%|\"${CCOLAMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CCOLAMD_LIBS%|\"${CCOLAMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CFLAGS%|\"${CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CHOLMOD_CPPFLAGS%|\"${CHOLMOD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CHOLMOD_LDFLAGS%|\"${CHOLMOD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CHOLMOD_LIBS%|\"${CHOLMOD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_COLAMD_CPPFLAGS%|\"${COLAMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_COLAMD_LDFLAGS%|\"${COLAMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_COLAMD_LIBS%|\"${COLAMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CPICFLAG%|\"${CPICFLAG}\"|" \
-    -e "s|%OCTAVE_CONF_CPPFLAGS%|\"${CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CURL_CPPFLAGS%|\"${CURL_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CURL_LDFLAGS%|\"${CURL_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CURL_LIBS%|\"${CURL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CXSPARSE_CPPFLAGS%|\"${CXSPARSE_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CXSPARSE_LDFLAGS%|\"${CXSPARSE_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CXSPARSE_LIBS%|\"${CXSPARSE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CXX%|\"${CXX}\"|" \
-    -e "s|%OCTAVE_CONF_CXXCPP%|\"${CXXCPP}\"|" \
-    -e "s|%OCTAVE_CONF_CXXFLAGS%|\"${CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CXXPICFLAG%|\"${CXXPICFLAG}\"|" \
-    -e "s|%OCTAVE_CONF_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
-    -e "s|%OCTAVE_CONF_DEFS%|\"${DEFS}\"|" \
-    -e "s|%OCTAVE_CONF_DEPEND_FLAGS%|\"${DEPEND_FLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%|\"${DEPEND_EXTRA_SED_PATTERN}\"|" \
-    -e "s|%OCTAVE_CONF_DL_LD%|\"${DL_LD}\"|" \
-    -e "s|%OCTAVE_CONF_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_DL_LIBS%|\"${DL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_EXEEXT%|\"${EXEEXT}\"|" \
-    -e "s|%OCTAVE_CONF_GCC_VERSION%|\"${GCC_VERSION}\"|" \
-    -e "s|%OCTAVE_CONF_GXX_VERSION%|\"${GXX_VERSION}\"|" \
-    -e "s|%OCTAVE_CONF_F77%|\"${F77}\"|" \
-    -e "s|%OCTAVE_CONF_F77_FLOAT_STORE_FLAG%|\"${F77_FLOAT_STORE_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_F77_INTEGER_8_FLAG%|\"${F77_INTEGER_8_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_FFLAGS%|\"${FFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3_CPPFLAGS%|\"${FFTW3_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3_LDFLAGS%|\"${FFTW3_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3_LIBS%|\"${FFTW3_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3F_CPPFLAGS%|\"${FFTW3F_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3F_LDFLAGS%|\"${FFTW3F_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3F_LIBS%|\"${FFTW3F_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FLIBS%|\"${FLIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FLTK_CPPFLAGS%|\"${FLTK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FLTK_LDFLAGS%|\"${FLTK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FLTK_LIBS%|\"${FLTK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FONTCONFIG_CPPFLAGS%|\"${FONTCONFIG_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FONTCONFIG_LIBS%|\"${FONTCONFIG_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FPICFLAG%|\"${FPICFLAG}\"|" \
-    -e "s|%OCTAVE_CONF_FT2_CPPFLAGS%|\"${FT2_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FT2_LIBS%|\"${FT2_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_GLPK_CPPFLAGS%|\"${GLPK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_GLPK_LDFLAGS%|\"${GLPK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_GLPK_LIBS%|\"${GLPK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_GNUPLOT%|\"${GNUPLOT}\"|" \
-    -e "s|%OCTAVE_CONF_HDF5_CPPFLAGS%|\"${HDF5_CPPFLAGS}\"|" | \
-    $(SED) -e "s|%OCTAVE_CONF_HDF5_LDFLAGS%|\"${HDF5_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_HDF5_LIBS%|\"${HDF5_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \
-    -e "s|%OCTAVE_CONF_LAPACK_LIBS%|\"${LAPACK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_LD_CXX%|\"${LD_CXX}\"|" \
-    -e "s|%OCTAVE_CONF_LDFLAGS%|\"${LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LD_STATIC_FLAG%|\"${LD_STATIC_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_LEX%|\"${LEX}\"|" \
-    -e "s|%OCTAVE_CONF_LEXLIB%|\"${LEXLIB}\"|" \
-    -e "s|%OCTAVE_CONF_LFLAGS%|\"${LFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LIBDIR%|\"${libdir}\"|" \
-    -e "s|%OCTAVE_CONF_LIBEXT%|\"${LIBEXT}\"|" \
-    -e "s|%OCTAVE_CONF_LIBFLAGS%|\"${LIBFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LIBOCTAVE%|\"${LIBOCTAVE}\"|" \
-    -e "s|%OCTAVE_CONF_LIBOCTINTERP%|\"${LIBOCTINTERP}\"|" \
-    -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_LLVM_CPPFLAGS%|\"${LLVM_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LLVM_LDFLAGS%|\"${LLVM_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LLVM_LIBS%|\"${LLVM_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \
-    -e "s|%OCTAVE_CONF_MAGICK_CPPFLAGS%|\"${MAGICK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_MAGICK_LDFLAGS%|\"${MAGICK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_MAGICK_LIBS%|\"${MAGICK_LIBS}\"|" \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_AR%|\"${MKOCTFILE_AR}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_CC%|\"${MKOCTFILE_CC}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${MKOCTFILE_CXX}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LD%|\"${MKOCTFILE_DL_LD}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${MKOCTFILE_DL_LDFLAGS}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_F77%|\"${MKOCTFILE_F77}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_LD_CXX%|\"${MKOCTFILE_LD_CXX}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_RANLIB%|\"${MKOCTFILE_RANLIB}\"|' \
-    -e "s|%OCTAVE_CONF_OCTAVE_LINK_DEPS%|\"${OCTAVE_LINK_DEPS}\"|" \
-    -e "s|%OCTAVE_CONF_OCTAVE_LINK_OPTS%|\"${OCTAVE_LINK_OPTS}\"|" \
-    -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
-    -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \
-    -e "s|%OCTAVE_CONF_OCT_LINK_DEPS%|\"${OCT_LINK_DEPS}\"|" \
-    -e "s|%OCTAVE_CONF_OCT_LINK_OPTS%|\"${OCT_LINK_OPTS}\"|" \
-    -e "s|%OCTAVE_CONF_OPENGL_LIBS%|\"${OPENGL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_OSMESA_CPPFLAGS%|\"${OSMESA_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_OSMESA_LDFLAGS%|\"${OSMESA_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_OSMESA_LIBS%|\"${OSMESA_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_PCRE_CPPFLAGS%|\"${PCRE_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_PCRE_LIBS%|\"${PCRE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \
-    -e "s|%OCTAVE_CONF_PTHREAD_CFLAGS%|\"${PTHREAD_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_PTHREAD_LIBS%|\"${PTHREAD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_QHULL_CPPFLAGS%|\"${QHULL_CPPFLAGSS}\"|" \
-    -e "s|%OCTAVE_CONF_QHULL_LDFLAGS%|\"${QHULL_LDFLAGSS}\"|" \
-    -e "s|%OCTAVE_CONF_QHULL_LIBS%|\"${QHULL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_QRUPDATE_CPPFLAGS%|\"${QRUPDATE_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QRUPDATE_LDFLAGS%|\"${QRUPDATE_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QRUPDATE_LIBS%|\"${QRUPDATE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_QT_CPPFLAGS%|\"${QT_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QT_LDFLAGS%|\"${QT_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QT_LIBS%|\"${QT_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \
-    -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_SED%|\"${SED}\"|" \
-    -e "s|%OCTAVE_CONF_SHARED_LIBS%|\"${SHARED_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_SHLEXT%|\"${SHLEXT}\"|" \
-    -e "s|%OCTAVE_CONF_SHLLINKEXT%|\"${SHLLINKEXT}\"|" \
-    -e "s|%OCTAVE_CONF_SHLEXT_VER%|\"${SHLEXT_VER}\"|" \
-    -e "s|%OCTAVE_CONF_SH_LD%|\"${SH_LD}\"|" \
-    -e "s|%OCTAVE_CONF_SH_LDFLAGS%|\"${SH_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_SONAME_FLAGS%|\"${SONAME_FLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_STATIC_LIBS%|\"${STATIC_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_TERM_LIBS%|\"${TERM_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_UMFPACK_CPPFLAGS%|\"${UMFPACK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_UMFPACK_LDFLAGS%|\"${UMFPACK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_UMFPACK_LIBS%|\"${UMFPACK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_VERSION%|\"${version}\"|" \
-    -e "s|%OCTAVE_CONF_WARN_CFLAGS%|\"${WARN_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_WARN_CXXFLAGS%|\"${WARN_CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_X11_INCFLAGS%|\"${X11_INCFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_X11_LIBS%|\"${X11_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_XTRA_CFLAGS%|\"${XTRA_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_XTRA_CXXFLAGS%|\"${XTRA_CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_YACC%|\"${YACC}\"|" \
-    -e "s|%OCTAVE_CONF_YFLAGS%|\"${YFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_Z_CPPFLAGS%|\"${Z_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_Z_LDFLAGS%|\"${Z_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_Z_LIBS%|\"${Z_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_config_opts%|\"${config_opts}\"|" > $@-t && \
-  $(simple_move_if_change_rule)
-endef
-
-define do_subst_cross_config_vals
-  $(SED) < $< \
-    -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
-    -e "s|%NO_OCT_FILE_STRIP%|${NO_OCT_FILE_STRIP}|" \
-    -e "s|%OCTAVE_BINDIR%|\"${bindir}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_CFLAGS%|\"${ALL_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_CXXFLAGS%|\"${ALL_CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_FFLAGS%|\"${ALL_FFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ALL_LDFLAGS%|\"${ALL_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_AMD_CPPFLAGS%|\"${AMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_AMD_LDFLAGS%|\"${AMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_AMD_LIBS%|\"${AMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_AR%|\"${AR}\"|" \
-    -e "s|%OCTAVE_CONF_ARFLAGS%|\"${ARFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ARPACK_CPPFLAGS%|\"${ARPACK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ARPACK_LDFLAGS%|\"${ARPACK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_ARPACK_LIBS%|\"${ARPACK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_BLAS_LIBS%|\"${BLAS_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CAMD_CPPFLAGS%|\"${CAMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CAMD_LDFLAGS%|\"${CAMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CAMD_LIBS%|\"${CAMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CANONICAL_HOST_TYPE%|\"${canonical_host_type}\"|" \
-    -e "s|%OCTAVE_CONF_CARBON_LIBS%|\"${CARBON_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CC%|\"${CC}\"|" \
-    -e "s|%OCTAVE_CONF_CCOLAMD_CPPFLAGS%|\"${CCOLAMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CCOLAMD_LDFLAGS%|\"${CCOLAMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CCOLAMD_LIBS%|\"${CCOLAMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CFLAGS%|\"${CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CHOLMOD_CPPFLAGS%|\"${CHOLMOD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CHOLMOD_LDFLAGS%|\"${CHOLMOD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CHOLMOD_LIBS%|\"${CHOLMOD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_COLAMD_CPPFLAGS%|\"${COLAMD_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_COLAMD_LDFLAGS%|\"${COLAMD_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_COLAMD_LIBS%|\"${COLAMD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CPICFLAG%|\"${CPICFLAG}\"|" \
-    -e "s|%OCTAVE_CONF_CPPFLAGS%|\"${CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CURL_CPPFLAGS%|\"${CURL_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CURL_LDFLAGS%|\"${CURL_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CURL_LIBS%|\"${CURL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CXSPARSE_CPPFLAGS%|\"${CXSPARSE_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CXSPARSE_LDFLAGS%|\"${CXSPARSE_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CXSPARSE_LIBS%|\"${CXSPARSE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_CXX%|\"${CXX}\"|" \
-    -e "s|%OCTAVE_CONF_CXXCPP%|\"${CXXCPP}\"|" \
-    -e "s|%OCTAVE_CONF_CXXFLAGS%|\"${CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_CXXPICFLAG%|\"${CXXPICFLAG}\"|" \
-    -e "s|%OCTAVE_CONF_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
-    -e "s|%OCTAVE_CONF_DEFS%|\"${DEFS}\"|" \
-    -e "s|%OCTAVE_CONF_DEPEND_FLAGS%|\"${DEPEND_FLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%|\"${DEPEND_EXTRA_SED_PATTERN}\"|" \
-    -e "s|%OCTAVE_CONF_DL_LD%|\"${DL_LD}\"|" \
-    -e "s|%OCTAVE_CONF_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_DL_LIBS%|\"${DL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_EXEEXT%|\"${EXEEXT}\"|" \
-    -e "s|%OCTAVE_CONF_GCC_VERSION%|\"${GCC_VERSION}\"|" \
-    -e "s|%OCTAVE_CONF_GXX_VERSION%|\"${GXX_VERSION}\"|" \
-    -e "s|%OCTAVE_CONF_F77%|\"${F77}\"|" \
-    -e "s|%OCTAVE_CONF_F77_FLOAT_STORE_FLAG%|\"${F77_FLOAT_STORE_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_F77_INTEGER_8_FLAG%|\"${F77_INTEGER_8_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_FFLAGS%|\"${FFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3_CPPFLAGS%|\"${FFTW3_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3_LDFLAGS%|\"${FFTW3_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3_LIBS%|\"${FFTW3_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3F_CPPFLAGS%|\"${FFTW3F_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3F_LDFLAGS%|\"${FFTW3F_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FFTW3F_LIBS%|\"${FFTW3F_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FLIBS%|\"${FLIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FLTK_CPPFLAGS%|\"${FLTK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FLTK_LDFLAGS%|\"${FLTK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FLTK_LIBS%|\"${FLTK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FONTCONFIG_CPPFLAGS%|\"${FONTCONFIG_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FONTCONFIG_LIBS%|\"${FONTCONFIG_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_FPICFLAG%|\"${FPICFLAG}\"|" \
-    -e "s|%OCTAVE_CONF_FT2_CPPFLAGS%|\"${FT2_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_FT2_LIBS%|\"${FT2_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_GLPK_CPPFLAGS%|\"${GLPK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_GLPK_LDFLAGS%|\"${GLPK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_GLPK_LIBS%|\"${GLPK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_GNUPLOT%|\"${GNUPLOT}\"|" \
-    -e "s|%OCTAVE_CONF_HDF5_CPPFLAGS%|\"${HDF5_CPPFLAGS}\"|" | \
-    $(SED) -e "s|%OCTAVE_CONF_HDF5_LDFLAGS%|\"${HDF5_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_HDF5_LIBS%|\"${HDF5_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \
-    -e "s|%OCTAVE_CONF_LAPACK_LIBS%|\"${LAPACK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_LD_CXX%|\"${LD_CXX}\"|" \
-    -e "s|%OCTAVE_CONF_LDFLAGS%|\"${LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LD_STATIC_FLAG%|\"${LD_STATIC_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_LEX%|\"${LEX}\"|" \
-    -e "s|%OCTAVE_CONF_LEXLIB%|\"${LEXLIB}\"|" \
-    -e "s|%OCTAVE_CONF_LFLAGS%|\"${LFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LIBDIR%|\"${libdir}\"|" \
-    -e "s|%OCTAVE_CONF_LIBEXT%|\"${LIBEXT}\"|" \
-    -e "s|%OCTAVE_CONF_LIBFLAGS%|\"${LIBFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LIBOCTAVE%|\"${LIBOCTAVE}\"|" \
-    -e "s|%OCTAVE_CONF_LIBOCTINTERP%|\"${LIBOCTINTERP}\"|" \
-    -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_LLVM_CPPFLAGS%|\"${LLVM_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LLVM_LDFLAGS%|\"${LLVM_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_LLVM_LIBS%|\"${LLVM_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \
-    -e "s|%OCTAVE_CONF_MAGICK_CPPFLAGS%|\"${MAGICK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_MAGICK_LDFLAGS%|\"${MAGICK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_MAGICK_LIBS%|\"${MAGICK_LIBS}\"|" \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_AR%|\"${AR}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_CC%|\"${CC}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${CXX}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LD%|\"${DL_LD}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_F77%|\"${F77}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_LD_CXX%|\"${LD_CXX}\"|' \
-    -e 's|%OCTAVE_CONF_MKOCTFILE_RANLIB%|\"${RANLIB}\"|' \
-    -e "s|%OCTAVE_CONF_OCTAVE_LINK_DEPS%|\"${OCTAVE_LINK_DEPS}\"|" \
-    -e "s|%OCTAVE_CONF_OCTAVE_LINK_OPTS%|\"${OCTAVE_LINK_OPTS}\"|" \
-    -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
-    -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \
-    -e "s|%OCTAVE_CONF_OCT_LINK_DEPS%|\"${OCT_LINK_DEPS}\"|" \
-    -e "s|%OCTAVE_CONF_OCT_LINK_OPTS%|\"${OCT_LINK_OPTS}\"|" \
-    -e "s|%OCTAVE_CONF_OPENGL_LIBS%|\"${OPENGL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_OSMESA_CPPFLAGS%|\"${OSMESA_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_OSMESA_LDFLAGS%|\"${OSMESA_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_OSMESA_LIBS%|\"${OSMESA_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_PCRE_CPPFLAGS%|\"${PCRE_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_PCRE_LIBS%|\"${PCRE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \
-    -e "s|%OCTAVE_CONF_PTHREAD_CFLAGS%|\"${PTHREAD_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_PTHREAD_LIBS%|\"${PTHREAD_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_QHULL_CPPFLAGS%|\"${QHULL_CPPFLAGSS}\"|" \
-    -e "s|%OCTAVE_CONF_QHULL_LDFLAGS%|\"${QHULL_LDFLAGSS}\"|" \
-    -e "s|%OCTAVE_CONF_QHULL_LIBS%|\"${QHULL_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_QRUPDATE_CPPFLAGS%|\"${QRUPDATE_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QRUPDATE_LDFLAGS%|\"${QRUPDATE_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QRUPDATE_LIBS%|\"${QRUPDATE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_QT_CPPFLAGS%|\"${QT_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QT_LDFLAGS%|\"${QT_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_QT_LIBS%|\"${QT_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \
-    -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \
-    -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_SED%|\"${SED}\"|" \
-    -e "s|%OCTAVE_CONF_SHARED_LIBS%|\"${SHARED_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_SHLEXT%|\"${SHLEXT}\"|" \
-    -e "s|%OCTAVE_CONF_SHLLINKEXT%|\"${SHLLINKEXT}\"|" \
-    -e "s|%OCTAVE_CONF_SHLEXT_VER%|\"${SHLEXT_VER}\"|" \
-    -e "s|%OCTAVE_CONF_SH_LD%|\"${SH_LD}\"|" \
-    -e "s|%OCTAVE_CONF_SH_LDFLAGS%|\"${SH_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_SONAME_FLAGS%|\"${SONAME_FLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_STATIC_LIBS%|\"${STATIC_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_TERM_LIBS%|\"${TERM_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_UMFPACK_CPPFLAGS%|\"${UMFPACK_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_UMFPACK_LDFLAGS%|\"${UMFPACK_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_UMFPACK_LIBS%|\"${UMFPACK_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_VERSION%|\"${version}\"|" \
-    -e "s|%OCTAVE_CONF_WARN_CFLAGS%|\"${WARN_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_WARN_CXXFLAGS%|\"${WARN_CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_X11_INCFLAGS%|\"${X11_INCFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_X11_LIBS%|\"${X11_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_XTRA_CFLAGS%|\"${XTRA_CFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_XTRA_CXXFLAGS%|\"${XTRA_CXXFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_YACC%|\"${YACC}\"|" \
-    -e "s|%OCTAVE_CONF_YFLAGS%|\"${YFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_Z_CPPFLAGS%|\"${Z_CPPFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_Z_LDFLAGS%|\"${Z_LDFLAGS}\"|" \
-    -e "s|%OCTAVE_CONF_Z_LIBS%|\"${Z_LIBS}\"|" \
-    -e "s|%OCTAVE_CONF_config_opts%|\"${config_opts}\"|" > $@-t && \
-  $(simple_move_if_change_rule)
-endef
-
-define do_subst_default_vals
-  $(SED) < $< > $@-t \
-    -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
-    -e "s|%OCTAVE_ARCHLIBDIR%|\"${archlibdir}\"|" \
-    -e "s|%OCTAVE_BINDIR%|\"${bindir}\"|" \
-    -e "s|%OCTAVE_CANONICAL_HOST_TYPE%|\"${canonical_host_type}\"|" \
-    -e "s|%OCTAVE_DATADIR%|\"${datadir}\"|" \
-    -e "s|%OCTAVE_DATAROOTDIR%|\"${datarootdir}\"|" \
-    -e "s|%OCTAVE_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
-    -e "s|%OCTAVE_DOC_CACHE_FILE%|\"${doc_cache_file}\"|" \
-    -e "s|%OCTAVE_EXEC_PREFIX%|\"${exec_prefix}\"|" \
-    -e "s|%OCTAVE_EXEEXT%|\"${EXEEXT}\"|" \
-    -e "s|%OCTAVE_FCNFILEDIR%|\"${fcnfiledir}\"|" \
-    -e "s|%OCTAVE_IMAGEDIR%|\"${imagedir}\"|" \
-    -e "s|%OCTAVE_INCLUDEDIR%|\"${includedir}\"|" \
-    -e "s|%OCTAVE_INFODIR%|\"${infodir}\"|" \
-    -e "s|%OCTAVE_INFOFILE%|\"${infofile}\"|" \
-    -e "s|%OCTAVE_LIBDIR%|\"${libdir}\"|" \
-    -e "s|%OCTAVE_LIBEXECDIR%|\"${libexecdir}\"|" \
-    -e "s|%OCTAVE_LOCALAPIFCNFILEDIR%|\"${localapifcnfiledir}\"|" \
-    -e "s|%OCTAVE_LOCALAPIOCTFILEDIR%|\"${localapioctfiledir}\"|" \
-    -e "s|%OCTAVE_LOCALARCHLIBDIR%|\"${localarchlibdir}\"|" \
-    -e "s|%OCTAVE_LOCALFCNFILEDIR%|\"${localfcnfiledir}\"|" \
-    -e "s|%OCTAVE_LOCALOCTFILEDIR%|\"${localoctfiledir}\"|" \
-    -e "s|%OCTAVE_LOCALSTARTUPFILEDIR%|\"${localstartupfiledir}\"|" \
-    -e "s|%OCTAVE_LOCALAPIARCHLIBDIR%|\"${localapiarchlibdir}\"|" \
-    -e "s|%OCTAVE_LOCALVERARCHLIBDIR%|\"${localverarchlibdir}\"|" \
-    -e "s|%OCTAVE_LOCALVERFCNFILEDIR%|\"${localverfcnfiledir}\"|" \
-    -e "s|%OCTAVE_LOCALVEROCTFILEDIR%|\"${localveroctfiledir}\"|" \
-    -e "s|%OCTAVE_MAN1DIR%|\"${man1dir}\"|" \
-    -e "s|%OCTAVE_MAN1EXT%|\"${man1ext}\"|" \
-    -e "s|%OCTAVE_MANDIR%|\"${mandir}\"|" \
-    -e "s|%OCTAVE_OCTDATADIR%|\"${octdatadir}\"|" \
-    -e "s|%OCTAVE_OCTFILEDIR%|\"${octfiledir}\"|" \
-    -e "s|%OCTAVE_OCTETCDIR%|\"${octetcdir}\"|" \
-    -e "s|%OCTAVE_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
-    -e "s|%OCTAVE_OCTLIBDIR%|\"${octlibdir}\"|" \
-    -e "s|%OCTAVE_OCTLOCALEDIR%|\"${octlocaledir}\"|" \
-    -e "s|%OCTAVE_OCTTESTSDIR%|\"${octtestsdir}\"|" \
-    -e "s|%OCTAVE_STARTUPFILEDIR%|\"${startupfiledir}\"|" \
-    -e "s|%OCTAVE_PREFIX%|\"${prefix}\"|" \
-    -e "s|%OCTAVE_API_VERSION%|\"${api_version}\"|" \
-    -e "s|%OCTAVE_RELEASE%|\"${OCTAVE_RELEASE}\"|" \
-    -e "s|%OCTAVE_SHLEXT%|\"${SHLEXT}\"|" \
-    -e "s|%OCTAVE_TEXI_MACROS_FILE%|\"${texi_macros_file}\"|" \
-    -e "s|%OCTAVE_VERSION%|\"${version}\"|" && \
-  $(simple_move_if_change_rule)
-endef
-
-define do_subst_script_vals
-  $(SED) < $< \
-    -e "s|%AWK%|${AWK}|g" \
-    -e "s|%FIND%|${FIND}|g" \
-    -e "s|%SED%|${SED}|g" \
-    -e "s|%ADDRESS_SANITIZER_OPTIONS%|${ADDRESS_SANITIZER_OPTIONS}|g" \
-    -e "s|%abs_top_srcdir%|${abs_top_srcdir}|" \
-    -e "s|%builddir%|$(shell pwd)|" > $@-t && \
-  $(simple_move_if_change_rule)
+define simple-filter-rule
+  rm -f $@-t $@ && \
+  ${SHELL} $(1) < $< > $@-t && \
+  mv $@-t $@
 endef
 
 define subst-bison-api-decls
-  case "$(BISON_API_PREFIX_DECL_STYLE)" in \
+  case "${BISON_API_PREFIX_DECL_STYLE}" in \
     *api*) \
-      case "$(BISON_API_PREFIX_DECL_STYLE)" in \
+      case "${BISON_API_PREFIX_DECL_STYLE}" in \
        *brace*) \
          api_prefix_decl='%define api.prefix {$(1)}'; ;; \
        *) \
@@ -519,7 +98,7 @@
        esac; \
       ;; \
     *name*) \
-      case "$(BISON_API_PREFIX_DECL_STYLE)" in \
+      case "${BISON_API_PREFIX_DECL_STYLE}" in \
         *brace*) \
           api_prefix_decl='%name-prefix {$(1)}'; ;; \
         *) \
@@ -527,15 +106,15 @@
       esac; \
     ;; \
   esac; \
-  case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
+  case "${BISON_PUSH_PULL_DECL_STYLE}" in \
     *quote*) quote='"' ;; \
     *) quote="" ;; \
   esac; \
-  case "$(BISON_PUSH_PULL_DECL_STYLE)" in \
+  case "${BISON_PUSH_PULL_DECL_STYLE}" in \
     *dash*) push_pull_decl="%define api.push-pull $${quote}both$${quote}"; ;; \
     *underscore*) push_pull_decl="%define api.push_pull $${quote}both$${quote}"; ;; \
   esac; \
-  $(SED) -e "s/%PUSH_PULL_DECL%/$$push_pull_decl/" \
+  ${SED} -e "s/%PUSH_PULL_DECL%/$$push_pull_decl/" \
          -e "s/%API_PREFIX_DECL%/$$api_prefix_decl/" $< > $@-t && \
   mv $@-t $@
 endef
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/mk-default-qt-settings.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+DEFAULT_TERMINAL_FONT = @DEFAULT_TERMINAL_FONT@
+DEFAULT_TERMINAL_FONT_SIZE = @DEFAULT_TERMINAL_FONT_SIZE@
+
+$SED \
+  -e "s|%DEFAULT_TERMINAL_FONT%|${DEFAULT_TERMINAL_FONT}|" \
+  -e "s|%DEFAULT_TERMINAL_FONT_SIZE%|${DEFAULT_TERMINAL_FONT_SIZE}|"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/mk-f77-def.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,60 @@
+#! /bin/sh
+#
+# Copyright (C) 2006-2015 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+: ${AWK=@AWK@}
+
+F77_TOLOWER="@F77_APPEND_UNDERSCORE@"
+F77_APPEND_UNDERSCORE="@F77_APPEND_UNDERSCORE@"
+F77_APPEND_EXTRA_UNDERSCORE="@F77_APPEND_EXTRA_UNDERSCORE@"
+
+if test x$F77_TOLOWER = xyes; then
+  case_cmd=tolower
+else
+  case_cmd=toupper
+fi
+
+if test x$F77_APPEND_UNDERSCORE = xyes; then
+  uscore=_
+else
+  uscore=
+fi
+
+if test x$F77_APPEND_EXTRA_UNDERSCORE = xyes; then
+  awkcmd="$AWK '{ if (\$0 ~ /_/) extra = \"_\"; else extra = \"\"; printf (\"%s%s%s\n\", $case_cmd (\$0), \"$uscore\", extra); }'"
+else
+  awkcmd="$AWK '{ printf (\"%s%s\n\", tolower (\$0), \"$uscore\"); }'"
+fi
+
+if [ $# -gt 1 ]; then
+  srcdir="$1"
+  shift
+fi
+
+echo EXPORTS
+for arg
+do
+  case "$arg" in
+    *.f)
+      ## There are TABS in this sed command.
+      $SED -n -e 'y/ABCDEFGHIJLKMNOPQRSTUVWXYZ/abcdefghijlkmnopqrstuvwxyz/; s/^\(      \|	\)[ 	]*\(.*function\|subroutine\|entry\)[ 	]*\([^ 	(]*\).*$/\3/p' "$srcdir/$arg" | eval $awkcmd
+    ;;
+  esac
+done
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/mk-mxarray-h.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,48 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+## Use two steps so that we can interpolate values without having to
+## determine the order in which to set variable values.
+
+## These must use ' so that embedded variables are not interpolated
+## (the values they reference may not be defined before they are used).
+
+OCTAVE_IDX_TYPE='@OCTAVE_IDX_TYPE@'
+
+## These must use " so that embedded variables are interpolated.
+
+## Is there a better way?
+
+function expand_var ()
+{
+  eval tmp="\$$1"
+  while echo "$tmp" | grep '\${[A-Za-z_][A-Za-z0-9_]*}' > /dev/null; do
+    eval tmp="$tmp"
+  done
+  eval $1="'$tmp'"
+}
+
+expand_var OCTAVE_IDX_TYPE
+
+$SED \
+  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by mx-mxarray-h.|" \
+  -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/mk-version-h.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,66 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+## Use two steps so that we can interpolate values without having to
+## determine the order in which to set variable values.
+
+## These must use ' so that embedded variables are not interpolated
+## (the values they reference may not be defined before they are used).
+
+OCTAVE_API_VERSION='@OCTAVE_API_VERSION@'
+OCTAVE_COPYRIGHT='@OCTAVE_COPYRIGHT@'
+OCTAVE_MAJOR_VERSION='@OCTAVE_MAJOR_VERSION@'
+OCTAVE_MINOR_VERSION='@OCTAVE_MINOR_VERSION@'
+OCTAVE_PATCH_VERSION='@OCTAVE_PATCH_VERSION@'
+OCTAVE_RELEASE_DATE='@OCTAVE_RELEASE_DATE@'
+OCTAVE_VERSION='@OCTAVE_VERSION@'
+
+## These must use " so that embedded variables are interpolated.
+
+## Is there a better way?
+
+function expand_var ()
+{
+  eval tmp="\$$1"
+  while echo "$tmp" | grep '\${[A-Za-z_][A-Za-z0-9_]*}' > /dev/null; do
+    eval tmp="$tmp"
+  done
+  eval $1="'$tmp'"
+}
+
+expand_var OCTAVE_API_VERSION
+expand_var OCTAVE_COPYRIGHT
+expand_var OCTAVE_MAJOR_VERSION
+expand_var OCTAVE_MINOR_VERSION
+expand_var OCTAVE_PATCH_VERSION
+expand_var OCTAVE_RELEASE_DATE
+expand_var OCTAVE_VERSION
+
+$SED \
+  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by mk-version-h.|" \
+  -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \
+  -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \
+  -e "s|%OCTAVE_MAJOR_VERSION%|${OCTAVE_MAJOR_VERSION}|" \
+  -e "s|%OCTAVE_MINOR_VERSION%|${OCTAVE_MINOR_VERSION}|" \
+  -e "s|%OCTAVE_PATCH_VERSION%|${OCTAVE_PATCH_VERSION}|" \
+  -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
+  -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/subst-config-vals.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,510 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+## Use two steps so that we can interpolate values without having to
+## determine the order in which to set variable values.
+
+## These must use ' so that embedded variables are not interpolated
+## (the values they reference may not be defined before they are used).
+
+NO_OCT_FILE_STRIP='@NO_OCT_FILE_STRIP@'
+bindir='@bindir@'
+AMD_CPPFLAGS='@AMD_CPPFLAGS@'
+AMD_LDFLAGS='@AMD_LDFLAGS@'
+AMD_LIBS='@AMD_LIBS@'
+AR='@AR@'
+ARFLAGS='@ARFLAGS@'
+ARPACK_CPPFLAGS='@ARPACK_CPPFLAGS@'
+ARPACK_LDFLAGS='@ARPACK_LDFLAGS@'
+ARPACK_LIBS='@ARPACK_LIBS@'
+BLAS_LIBS='@BLAS_LIBS@'
+CAMD_CPPFLAGS='@CAMD_CPPFLAGS@'
+CAMD_LDFLAGS='@CAMD_LDFLAGS@'
+CAMD_LIBS='@CAMD_LIBS@'
+CARBON_LIBS='@CARBON_LIBS@'
+CC='@CC@'
+CCOLAMD_CPPFLAGS='@CCOLAMD_CPPFLAGS@'
+CCOLAMD_LDFLAGS='@CCOLAMD_LDFLAGS@'
+CCOLAMD_LIBS='@CCOLAMD_LIBS@'
+CFLAGS='@CFLAGS@'
+CHOLMOD_CPPFLAGS='@CHOLMOD_CPPFLAGS@'
+CHOLMOD_LDFLAGS='@CHOLMOD_LDFLAGS@'
+CHOLMOD_LIBS='@CHOLMOD_LIBS@'
+COLAMD_CPPFLAGS='@COLAMD_CPPFLAGS@'
+COLAMD_LDFLAGS='@COLAMD_LDFLAGS@'
+COLAMD_LIBS='@COLAMD_LIBS@'
+CPICFLAG='@CPICFLAG@'
+CPPFLAGS='@CPPFLAGS@'
+CURL_CPPFLAGS='@CURL_CPPFLAGS@'
+CURL_LDFLAGS='@CURL_LDFLAGS@'
+CURL_LIBS='@CURL_LIBS@'
+CXSPARSE_CPPFLAGS='@CXSPARSE_CPPFLAGS@'
+CXSPARSE_LDFLAGS='@CXSPARSE_LDFLAGS@'
+CXSPARSE_LIBS='@CXSPARSE_LIBS@'
+CXX='@CXX@'
+CXXCPP='@CXXCPP@'
+CXXFLAGS='@CXXFLAGS@'
+CXXPICFLAG='@CXXPICFLAG@'
+DEFAULT_PAGER='@DEFAULT_PAGER@'
+DEFS='@DEFS@'
+DEPEND_FLAGS='@DEPEND_FLAGS@'
+DEPEND_EXTRA_SED_PATTERN='@DEPEND_EXTRA_SED_PATTERN@'
+DL_LD='@DL_LD@'
+DL_LDFLAGS='@DL_LDFLAGS@'
+DL_LIBS='@DL_LIBS@'
+EXEEXT='@EXEEXT@'
+GCC_VERSION='@GCC_VERSION@'
+GXX_VERSION='@GXX_VERSION@'
+F77='@F77@'
+F77_FLOAT_STORE_FLAG='@F77_FLOAT_STORE_FLAG@'
+F77_INTEGER_8_FLAG='@F77_INTEGER_8_FLAG@'
+FFLAGS='@FFLAGS@'
+FFTW3_CPPFLAGS='@FFTW3_CPPFLAGS@'
+FFTW3_LDFLAGS='@FFTW3_LDFLAGS@'
+FFTW3_LIBS='@FFTW3_LIBS@'
+FFTW3F_CPPFLAGS='@FFTW3F_CPPFLAGS@'
+FFTW3F_LDFLAGS='@FFTW3F_LDFLAGS@'
+FFTW3F_LIBS='@FFTW3F_LIBS@'
+FLIBS='@FLIBS@'
+FLTK_CPPFLAGS='@FLTK_CPPFLAGS@'
+FLTK_LDFLAGS='@FLTK_LDFLAGS@'
+FLTK_LIBS='@FLTK_LIBS@'
+FONTCONFIG_CPPFLAGS='@FONTCONFIG_CPPFLAGS@'
+FONTCONFIG_LIBS='@FONTCONFIG_LIBS@'
+FPICFLAG='@FPICFLAG@'
+FT2_CPPFLAGS='@FT2_CPPFLAGS@'
+FT2_LIBS='@FT2_LIBS@'
+GLPK_CPPFLAGS='@GLPK_CPPFLAGS@'
+GLPK_LDFLAGS='@GLPK_LDFLAGS@'
+GLPK_LIBS='@GLPK_LIBS@'
+GNUPLOT='@GNUPLOT@'
+HDF5_CPPFLAGS='@HDF5_CPPFLAGS@'
+HDF5_LDFLAGS='@HDF5_LDFLAGS@'
+HDF5_LIBS='@HDF5_LIBS@'
+includedir='@includedir@'
+LAPACK_LIBS='@LAPACK_LIBS@'
+LD_CXX='@LD_CXX@'
+LDFLAGS='@LDFLAGS@'
+LD_STATIC_FLAG='@LD_STATIC_FLAG@'
+LEX='@LEX@'
+LEXLIB='@LEXLIB@'
+LFLAGS='@LFLAGS@'
+libdir='@libdir@'
+LIBEXT='@LIBEXT@'
+LIBOCTAVE='@LIBOCTAVE@'
+LIBOCTINTERP='@LIBOCTINTERP@'
+LIBS='@LIBS@'
+LLVM_CPPFLAGS='@LLVM_CPPFLAGS@'
+LLVM_LDFLAGS='@LLVM_LDFLAGS@'
+LLVM_LIBS='@LLVM_LIBS@'
+LN_S='@LN_S@'
+MAGICK_CPPFLAGS='@MAGICK_CPPFLAGS@'
+MAGICK_LDFLAGS='@MAGICK_LDFLAGS@'
+MAGICK_LIBS='@MAGICK_LIBS@'
+MKOCTFILE_AR='@MKOCTFILE_AR@'
+MKOCTFILE_CC='@MKOCTFILE_CC@'
+MKOCTFILE_CXX='@MKOCTFILE_CXX@'
+MKOCTFILE_DL_LD='@MKOCTFILE_DL_LD@'
+MKOCTFILE_DL_LDFLAGS='@MKOCTFILE_DL_LDFLAGS@'
+MKOCTFILE_F77='@MKOCTFILE_F77@'
+MKOCTFILE_LD_CXX='@MKOCTFILE_LD_CXX@'
+MKOCTFILE_RANLIB='@MKOCTFILE_RANLIB@'
+OCTAVE_LINK_DEPS='@OCTAVE_LINK_DEPS@'
+OCTAVE_LINK_OPTS='@OCTAVE_LINK_OPTS@'
+octincludedir='@octincludedir@'
+octlibdir='@octlibdir@'
+OCT_LINK_DEPS='@OCT_LINK_DEPS@'
+OCT_LINK_OPTS='@OCT_LINK_OPTS@'
+OPENGL_LIBS='@OPENGL_LIBS@'
+OSMESA_CPPFLAGS='@OSMESA_CPPFLAGS@'
+OSMESA_LDFLAGS='@OSMESA_LDFLAGS@'
+OSMESA_LIBS='@OSMESA_LIBS@'
+PCRE_CPPFLAGS='@PCRE_CPPFLAGS@'
+PCRE_LIBS='@PCRE_LIBS@'
+prefix='@prefix@'
+PTHREAD_CFLAGS='@PTHREAD_CFLAGS@'
+PTHREAD_LIBS='@PTHREAD_LIBS@'
+QHULL_CPPFLAGS='@QHULL_CPPFLAGS@'
+QHULL_LDFLAGS='@QHULL_LDFLAGS@'
+QHULL_LIBS='@QHULL_LIBS@'
+QRUPDATE_CPPFLAGS='@QRUPDATE_CPPFLAGS@'
+QRUPDATE_LDFLAGS='@QRUPDATE_LDFLAGS@'
+QRUPDATE_LIBS='@QRUPDATE_LIBS@'
+QT_CPPFLAGS='@QT_CPPFLAGS@'
+QT_LDFLAGS='@QT_LDFLAGS@'
+QT_LIBS='@QT_LIBS@'
+RANLIB='@RANLIB@'
+RDYNAMIC_FLAG='@RDYNAMIC_FLAG@'
+READLINE_LIBS='@READLINE_LIBS@'
+SED='@SED@'
+SHARED_LIBS='@SHARED_LIBS@'
+SHLEXT='@SHLEXT@'
+SHLLINKEXT='@SHLLINKEXT@'
+SHLEXT_VER='@SHLEXT_VER@'
+SH_LD='@SH_LD@'
+SH_LDFLAGS='@SH_LDFLAGS@'
+SONAME_FLAGS='@SONAME_FLAGS@'
+STATIC_LIBS='@STATIC_LIBS@'
+TERM_LIBS='@TERM_LIBS@'
+UMFPACK_CPPFLAGS='@UMFPACK_CPPFLAGS@'
+UMFPACK_LDFLAGS='@UMFPACK_LDFLAGS@'
+UMFPACK_LIBS='@UMFPACK_LIBS@'
+version='@PACKAGE_VERSION@'
+WARN_CFLAGS='@WARN_CFLAGS@'
+WARN_CXXFLAGS='@WARN_CXXFLAGS@'
+X11_INCFLAGS='@X11_INCFLAGS@'
+X11_LIBS='@X11_LIBS@'
+XTRA_CFLAGS='@XTRA_CFLAGS@'
+XTRA_CXXFLAGS='@XTRA_CXXFLAGS@'
+YACC='@YACC@'
+YFLAGS='@YFLAGS@'
+Z_CPPFLAGS='@Z_CPPFLAGS@'
+Z_LDFLAGS='@Z_LDFLAGS@'
+Z_LIBS='@Z_LIBS@'
+config_opts='@config_opts@'
+
+## These must use " so that embedded variables are interpolated.
+
+## Is there a better way?
+
+function expand_var ()
+{
+  eval tmp="\$$1"
+  while echo "$tmp" | grep '\${[A-Za-z_][A-Za-z0-9_]*}' > /dev/null; do
+    eval tmp="$tmp"
+  done
+  eval $1="'$tmp'"
+}
+
+expand_var NO_OCT_FILE_STRIP
+expand_var bindir
+expand_var AMD_CPPFLAGS
+expand_var AMD_LDFLAGS
+expand_var AMD_LIBS
+expand_var AR
+expand_var ARFLAGS
+expand_var ARPACK_CPPFLAGS
+expand_var ARPACK_LDFLAGS
+expand_var ARPACK_LIBS
+expand_var BLAS_LIBS
+expand_var CAMD_CPPFLAGS
+expand_var CAMD_LDFLAGS
+expand_var CAMD_LIBS
+expand_var CARBON_LIBS
+expand_var CC
+expand_var CCOLAMD_CPPFLAGS
+expand_var CCOLAMD_LDFLAGS
+expand_var CCOLAMD_LIBS
+expand_var CFLAGS
+expand_var CHOLMOD_CPPFLAGS
+expand_var CHOLMOD_LDFLAGS
+expand_var CHOLMOD_LIBS
+expand_var COLAMD_CPPFLAGS
+expand_var COLAMD_LDFLAGS
+expand_var COLAMD_LIBS
+expand_var CPICFLAG
+expand_var CPPFLAGS
+expand_var CURL_CPPFLAGS
+expand_var CURL_LDFLAGS
+expand_var CURL_LIBS
+expand_var CXSPARSE_CPPFLAGS
+expand_var CXSPARSE_LDFLAGS
+expand_var CXSPARSE_LIBS
+expand_var CXX
+expand_var CXXCPP
+expand_var CXXFLAGS
+expand_var CXXPICFLAG
+expand_var DEFAULT_PAGER
+expand_var DEFS
+expand_var DEPEND_FLAGS
+expand_var DEPEND_EXTRA_SED_PATTERN
+expand_var DL_LD
+expand_var DL_LDFLAGS
+expand_var DL_LIBS
+expand_var EXEEXT
+expand_var GCC_VERSION
+expand_var GXX_VERSION
+expand_var F77
+expand_var F77_FLOAT_STORE_FLAG
+expand_var F77_INTEGER_8_FLAG
+expand_var FFLAGS
+expand_var FFTW3_CPPFLAGS
+expand_var FFTW3_LDFLAGS
+expand_var FFTW3_LIBS
+expand_var FFTW3F_CPPFLAGS
+expand_var FFTW3F_LDFLAGS
+expand_var FFTW3F_LIBS
+expand_var FLIBS
+expand_var FLTK_CPPFLAGS
+expand_var FLTK_LDFLAGS
+expand_var FLTK_LIBS
+expand_var FONTCONFIG_CPPFLAGS
+expand_var FONTCONFIG_LIBS
+expand_var FPICFLAG
+expand_var FT2_CPPFLAGS
+expand_var FT2_LIBS
+expand_var GLPK_CPPFLAGS
+expand_var GLPK_LDFLAGS
+expand_var GLPK_LIBS
+expand_var GNUPLOT
+expand_var HDF5_CPPFLAGS
+expand_var HDF5_LDFLAGS
+expand_var HDF5_LIBS
+expand_var includedir
+expand_var LAPACK_LIBS
+expand_var LD_CXX
+expand_var LDFLAGS
+expand_var LD_STATIC_FLAG
+expand_var LEX
+expand_var LEXLIB
+expand_var LFLAGS
+expand_var libdir
+expand_var LIBEXT
+expand_var LIBOCTAVE
+expand_var LIBOCTINTERP
+expand_var LIBS
+expand_var LLVM_CPPFLAGS
+expand_var LLVM_LDFLAGS
+expand_var LLVM_LIBS
+expand_var LN_S
+expand_var MAGICK_CPPFLAGS
+expand_var MAGICK_LDFLAGS
+expand_var MAGICK_LIBS
+expand_var MKOCTFILE_AR
+expand_var MKOCTFILE_CC
+expand_var MKOCTFILE_CXX
+expand_var MKOCTFILE_DL_LD
+expand_var MKOCTFILE_DL_LDFLAGS
+expand_var MKOCTFILE_F77
+expand_var MKOCTFILE_LD_CXX
+expand_var MKOCTFILE_RANLIB
+expand_var OCTAVE_LINK_DEPS
+expand_var OCTAVE_LINK_OPTS
+expand_var octincludedir
+expand_var octlibdir
+expand_var OCT_LINK_DEPS
+expand_var OCT_LINK_OPTS
+expand_var OPENGL_LIBS
+expand_var OSMESA_CPPFLAGS
+expand_var OSMESA_LDFLAGS
+expand_var OSMESA_LIBS
+expand_var PCRE_CPPFLAGS
+expand_var PCRE_LIBS
+expand_var prefix
+expand_var PTHREAD_CFLAGS
+expand_var PTHREAD_LIBS
+expand_var QHULL_CPPFLAGS
+expand_var QHULL_LDFLAGS
+expand_var QHULL_LIBS
+expand_var QRUPDATE_CPPFLAGS
+expand_var QRUPDATE_LDFLAGS
+expand_var QRUPDATE_LIBS
+expand_var QT_CPPFLAGS
+expand_var QT_LDFLAGS
+expand_var QT_LIBS
+expand_var RANLIB
+expand_var RDYNAMIC_FLAG
+expand_var READLINE_LIBS
+expand_var SED
+expand_var SHARED_LIBS
+expand_var SHLEXT
+expand_var SHLLINKEXT
+expand_var SHLEXT_VER
+expand_var SH_LD
+expand_var SH_LDFLAGS
+expand_var SONAME_FLAGS
+expand_var STATIC_LIBS
+expand_var TERM_LIBS
+expand_var UMFPACK_CPPFLAGS
+expand_var UMFPACK_LDFLAGS
+expand_var UMFPACK_LIBS
+expand_var version
+expand_var WARN_CFLAGS
+expand_var WARN_CXXFLAGS
+expand_var X11_INCFLAGS
+expand_var X11_LIBS
+expand_var XTRA_CFLAGS
+expand_var XTRA_CXXFLAGS
+expand_var YACC
+expand_var YFLAGS
+expand_var Z_CPPFLAGS
+expand_var Z_LDFLAGS
+expand_var Z_LIBS
+expand_var config_opts
+
+$SED \
+  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by subst-config-vals.|" \
+  -e "s|%NO_OCT_FILE_STRIP%|${NO_OCT_FILE_STRIP}|" \
+  -e "s|%OCTAVE_BINDIR%|\"${bindir}\"|" \
+  -e "s|%OCTAVE_CONF_AMD_CPPFLAGS%|\"${AMD_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_AMD_LDFLAGS%|\"${AMD_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_AMD_LIBS%|\"${AMD_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_AR%|\"${AR}\"|" \
+  -e "s|%OCTAVE_CONF_ARFLAGS%|\"${ARFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_ARPACK_CPPFLAGS%|\"${ARPACK_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_ARPACK_LDFLAGS%|\"${ARPACK_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_ARPACK_LIBS%|\"${ARPACK_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_BLAS_LIBS%|\"${BLAS_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CAMD_CPPFLAGS%|\"${CAMD_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CAMD_LDFLAGS%|\"${CAMD_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CAMD_LIBS%|\"${CAMD_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CARBON_LIBS%|\"${CARBON_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CC%|\"${CC}\"|" \
+  -e "s|%OCTAVE_CONF_CCOLAMD_CPPFLAGS%|\"${CCOLAMD_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CCOLAMD_LDFLAGS%|\"${CCOLAMD_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CCOLAMD_LIBS%|\"${CCOLAMD_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CFLAGS%|\"${CFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CHOLMOD_CPPFLAGS%|\"${CHOLMOD_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CHOLMOD_LDFLAGS%|\"${CHOLMOD_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CHOLMOD_LIBS%|\"${CHOLMOD_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_COLAMD_CPPFLAGS%|\"${COLAMD_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_COLAMD_LDFLAGS%|\"${COLAMD_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_COLAMD_LIBS%|\"${COLAMD_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CPICFLAG%|\"${CPICFLAG}\"|" \
+  -e "s|%OCTAVE_CONF_CPPFLAGS%|\"${CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CURL_CPPFLAGS%|\"${CURL_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CURL_LDFLAGS%|\"${CURL_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CURL_LIBS%|\"${CURL_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CXSPARSE_CPPFLAGS%|\"${CXSPARSE_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CXSPARSE_LDFLAGS%|\"${CXSPARSE_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CXSPARSE_LIBS%|\"${CXSPARSE_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_CXX%|\"${CXX}\"|" \
+  -e "s|%OCTAVE_CONF_CXXCPP%|\"${CXXCPP}\"|" \
+  -e "s|%OCTAVE_CONF_CXXFLAGS%|\"${CXXFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_CXXPICFLAG%|\"${CXXPICFLAG}\"|" \
+  -e "s|%OCTAVE_CONF_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
+  -e "s|%OCTAVE_CONF_DEFS%|\"${DEFS}\"|" \
+  -e "s|%OCTAVE_CONF_DEPEND_FLAGS%|\"${DEPEND_FLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%|\"${DEPEND_EXTRA_SED_PATTERN}\"|" \
+  -e "s|%OCTAVE_CONF_DL_LD%|\"${DL_LD}\"|" \
+  -e "s|%OCTAVE_CONF_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_DL_LIBS%|\"${DL_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_EXEEXT%|\"${EXEEXT}\"|" \
+  -e "s|%OCTAVE_CONF_GCC_VERSION%|\"${GCC_VERSION}\"|" \
+  -e "s|%OCTAVE_CONF_GXX_VERSION%|\"${GXX_VERSION}\"|" \
+  -e "s|%OCTAVE_CONF_F77%|\"${F77}\"|" \
+  -e "s|%OCTAVE_CONF_F77_FLOAT_STORE_FLAG%|\"${F77_FLOAT_STORE_FLAG}\"|" \
+  -e "s|%OCTAVE_CONF_F77_INTEGER_8_FLAG%|\"${F77_INTEGER_8_FLAG}\"|" \
+  -e "s|%OCTAVE_CONF_FFLAGS%|\"${FFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FFTW3_CPPFLAGS%|\"${FFTW3_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FFTW3_LDFLAGS%|\"${FFTW3_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FFTW3_LIBS%|\"${FFTW3_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_FFTW3F_CPPFLAGS%|\"${FFTW3F_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FFTW3F_LDFLAGS%|\"${FFTW3F_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FFTW3F_LIBS%|\"${FFTW3F_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_FLIBS%|\"${FLIBS}\"|" \
+  -e "s|%OCTAVE_CONF_FLTK_CPPFLAGS%|\"${FLTK_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FLTK_LDFLAGS%|\"${FLTK_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FLTK_LIBS%|\"${FLTK_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_FONTCONFIG_CPPFLAGS%|\"${FONTCONFIG_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FONTCONFIG_LIBS%|\"${FONTCONFIG_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_FPICFLAG%|\"${FPICFLAG}\"|" \
+  -e "s|%OCTAVE_CONF_FT2_CPPFLAGS%|\"${FT2_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_FT2_LIBS%|\"${FT2_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_GLPK_CPPFLAGS%|\"${GLPK_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_GLPK_LDFLAGS%|\"${GLPK_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_GLPK_LIBS%|\"${GLPK_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_GNUPLOT%|\"${GNUPLOT}\"|" \
+  -e "s|%OCTAVE_CONF_HDF5_CPPFLAGS%|\"${HDF5_CPPFLAGS}\"|" | \
+  $SED -e "s|%OCTAVE_CONF_HDF5_LDFLAGS%|\"${HDF5_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_HDF5_LIBS%|\"${HDF5_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \
+  -e "s|%OCTAVE_CONF_LAPACK_LIBS%|\"${LAPACK_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_LD_CXX%|\"${LD_CXX}\"|" \
+  -e "s|%OCTAVE_CONF_LDFLAGS%|\"${LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_LD_STATIC_FLAG%|\"${LD_STATIC_FLAG}\"|" \
+  -e "s|%OCTAVE_CONF_LEX%|\"${LEX}\"|" \
+  -e "s|%OCTAVE_CONF_LEXLIB%|\"${LEXLIB}\"|" \
+  -e "s|%OCTAVE_CONF_LFLAGS%|\"${LFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_LIBDIR%|\"${libdir}\"|" \
+  -e "s|%OCTAVE_CONF_LIBEXT%|\"${LIBEXT}\"|" \
+  -e "s|%OCTAVE_CONF_LIBOCTAVE%|\"${LIBOCTAVE}\"|" \
+  -e "s|%OCTAVE_CONF_LIBOCTINTERP%|\"${LIBOCTINTERP}\"|" \
+  -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_LLVM_CPPFLAGS%|\"${LLVM_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_LLVM_LDFLAGS%|\"${LLVM_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_LLVM_LIBS%|\"${LLVM_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \
+  -e "s|%OCTAVE_CONF_MAGICK_CPPFLAGS%|\"${MAGICK_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_MAGICK_LDFLAGS%|\"${MAGICK_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_MAGICK_LIBS%|\"${MAGICK_LIBS}\"|" \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_AR%|\"${MKOCTFILE_AR}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_CC%|\"${MKOCTFILE_CC}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${MKOCTFILE_CXX}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LD%|\"${MKOCTFILE_DL_LD}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${MKOCTFILE_DL_LDFLAGS}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_F77%|\"${MKOCTFILE_F77}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_LD_CXX%|\"${MKOCTFILE_LD_CXX}\"|' \
+  -e 's|%OCTAVE_CONF_MKOCTFILE_RANLIB%|\"${MKOCTFILE_RANLIB}\"|' \
+  -e "s|%OCTAVE_CONF_OCTAVE_LINK_DEPS%|\"${OCTAVE_LINK_DEPS}\"|" \
+  -e "s|%OCTAVE_CONF_OCTAVE_LINK_OPTS%|\"${OCTAVE_LINK_OPTS}\"|" \
+  -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
+  -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \
+  -e "s|%OCTAVE_CONF_OCT_LINK_DEPS%|\"${OCT_LINK_DEPS}\"|" \
+  -e "s|%OCTAVE_CONF_OCT_LINK_OPTS%|\"${OCT_LINK_OPTS}\"|" \
+  -e "s|%OCTAVE_CONF_OPENGL_LIBS%|\"${OPENGL_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_OSMESA_CPPFLAGS%|\"${OSMESA_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_OSMESA_LDFLAGS%|\"${OSMESA_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_OSMESA_LIBS%|\"${OSMESA_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_PCRE_CPPFLAGS%|\"${PCRE_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_PCRE_LIBS%|\"${PCRE_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \
+  -e "s|%OCTAVE_CONF_PTHREAD_CFLAGS%|\"${PTHREAD_CFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_PTHREAD_LIBS%|\"${PTHREAD_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_QHULL_CPPFLAGS%|\"${QHULL_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_QHULL_LDFLAGS%|\"${QHULL_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_QHULL_LIBS%|\"${QHULL_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_QRUPDATE_CPPFLAGS%|\"${QRUPDATE_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_QRUPDATE_LDFLAGS%|\"${QRUPDATE_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_QRUPDATE_LIBS%|\"${QRUPDATE_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_QT_CPPFLAGS%|\"${QT_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_QT_LDFLAGS%|\"${QT_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_QT_LIBS%|\"${QT_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \
+  -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \
+  -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_SED%|\"${SED}\"|" \
+  -e "s|%OCTAVE_CONF_SHARED_LIBS%|\"${SHARED_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_SHLEXT%|\"${SHLEXT}\"|" \
+  -e "s|%OCTAVE_CONF_SHLLINKEXT%|\"${SHLLINKEXT}\"|" \
+  -e "s|%OCTAVE_CONF_SHLEXT_VER%|\"${SHLEXT_VER}\"|" \
+  -e "s|%OCTAVE_CONF_SH_LD%|\"${SH_LD}\"|" \
+  -e "s|%OCTAVE_CONF_SH_LDFLAGS%|\"${SH_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_SONAME_FLAGS%|\"${SONAME_FLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_STATIC_LIBS%|\"${STATIC_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_TERM_LIBS%|\"${TERM_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_UMFPACK_CPPFLAGS%|\"${UMFPACK_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_UMFPACK_LDFLAGS%|\"${UMFPACK_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_UMFPACK_LIBS%|\"${UMFPACK_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_VERSION%|\"${version}\"|" \
+  -e "s|%OCTAVE_CONF_WARN_CFLAGS%|\"${WARN_CFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_WARN_CXXFLAGS%|\"${WARN_CXXFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_X11_INCFLAGS%|\"${X11_INCFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_X11_LIBS%|\"${X11_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_XTRA_CFLAGS%|\"${XTRA_CFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_XTRA_CXXFLAGS%|\"${XTRA_CXXFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_YACC%|\"${YACC}\"|" \
+  -e "s|%OCTAVE_CONF_YFLAGS%|\"${YFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_Z_CPPFLAGS%|\"${Z_CPPFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_Z_LDFLAGS%|\"${Z_LDFLAGS}\"|" \
+  -e "s|%OCTAVE_CONF_Z_LIBS%|\"${Z_LIBS}\"|" \
+  -e "s|%OCTAVE_CONF_config_opts%|\"${config_opts}\"|"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/subst-cross-config-vals.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,506 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+## The subst-config-vals and subst-cross-config-vals scripts differ only
+## in the definitions of the following variables.
+##
+##   OCTAVE_CONF_MKOCTFILE_AR
+##   OCTAVE_CONF_MKOCTFILE_CC
+##   OCTAVE_CONF_MKOCTFILE_CXX
+##   OCTAVE_CONF_MKOCTFILE_DL_LD
+##   OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS
+##   OCTAVE_CONF_MKOCTFILE_F77
+##   OCTAVE_CONF_MKOCTFILE_LD_CXX
+##   OCTAVE_CONF_MKOCTFILE_RANLIB
+
+## Use two steps so that we can interpolate values without having to
+## determine the order in which to set variable values.
+
+## These must use ' so that embedded variables are not interpolated
+## (the values they reference may not be defined before they are used).
+
+NO_OCT_FILE_STRIP='@NO_OCT_FILE_STRIP@'
+bindir='@bindir@'
+AMD_CPPFLAGS='@AMD_CPPFLAGS@'
+AMD_LDFLAGS='@AMD_LDFLAGS@'
+AMD_LIBS='@AMD_LIBS@'
+AR='@AR@'
+ARFLAGS='@ARFLAGS@'
+ARPACK_CPPFLAGS='@ARPACK_CPPFLAGS@'
+ARPACK_LDFLAGS='@ARPACK_LDFLAGS@'
+ARPACK_LIBS='@ARPACK_LIBS@'
+BLAS_LIBS='@BLAS_LIBS@'
+CAMD_CPPFLAGS='@CAMD_CPPFLAGS@'
+CAMD_LDFLAGS='@CAMD_LDFLAGS@'
+CAMD_LIBS='@CAMD_LIBS@'
+CARBON_LIBS='@CARBON_LIBS@'
+CC='@CC@'
+CCOLAMD_CPPFLAGS='@CCOLAMD_CPPFLAGS@'
+CCOLAMD_LDFLAGS='@CCOLAMD_LDFLAGS@'
+CCOLAMD_LIBS='@CCOLAMD_LIBS@'
+CFLAGS='@CFLAGS@'
+CHOLMOD_CPPFLAGS='@CHOLMOD_CPPFLAGS@'
+CHOLMOD_LDFLAGS='@CHOLMOD_LDFLAGS@'
+CHOLMOD_LIBS='@CHOLMOD_LIBS@'
+COLAMD_CPPFLAGS='@COLAMD_CPPFLAGS@'
+COLAMD_LDFLAGS='@COLAMD_LDFLAGS@'
+COLAMD_LIBS='@COLAMD_LIBS@'
+CPICFLAG='@CPICFLAG@'
+CPPFLAGS='@CPPFLAGS@'
+CURL_CPPFLAGS='@CURL_CPPFLAGS@'
+CURL_LDFLAGS='@CURL_LDFLAGS@'
+CURL_LIBS='@CURL_LIBS@'
+CXSPARSE_CPPFLAGS='@CXSPARSE_CPPFLAGS@'
+CXSPARSE_LDFLAGS='@CXSPARSE_LDFLAGS@'
+CXSPARSE_LIBS='@CXSPARSE_LIBS@'
+CXX='@CXX@'
+CXXCPP='@CXXCPP@'
+CXXFLAGS='@CXXFLAGS@'
+CXXPICFLAG='@CXXPICFLAG@'
+DEFAULT_PAGER='@DEFAULT_PAGER@'
+DEFS='@DEFS@'
+DEPEND_FLAGS='@DEPEND_FLAGS@'
+DEPEND_EXTRA_SED_PATTERN='@DEPEND_EXTRA_SED_PATTERN@'
+DL_LD='@DL_LD@'
+DL_LDFLAGS='@DL_LDFLAGS@'
+DL_LIBS='@DL_LIBS@'
+EXEEXT='@EXEEXT@'
+GCC_VERSION='@GCC_VERSION@'
+GXX_VERSION='@GXX_VERSION@'
+F77='@F77@'
+F77_FLOAT_STORE_FLAG='@F77_FLOAT_STORE_FLAG@'
+F77_INTEGER_8_FLAG='@F77_INTEGER_8_FLAG@'
+FFLAGS='@FFLAGS@'
+FFTW3_CPPFLAGS='@FFTW3_CPPFLAGS@'
+FFTW3_LDFLAGS='@FFTW3_LDFLAGS@'
+FFTW3_LIBS='@FFTW3_LIBS@'
+FFTW3F_CPPFLAGS='@FFTW3F_CPPFLAGS@'
+FFTW3F_LDFLAGS='@FFTW3F_LDFLAGS@'
+FFTW3F_LIBS='@FFTW3F_LIBS@'
+FLIBS='@FLIBS@'
+FLTK_CPPFLAGS='@FLTK_CPPFLAGS@'
+FLTK_LDFLAGS='@FLTK_LDFLAGS@'
+FLTK_LIBS='@FLTK_LIBS@'
+FONTCONFIG_CPPFLAGS='@FONTCONFIG_CPPFLAGS@'
+FONTCONFIG_LIBS='@FONTCONFIG_LIBS@'
+FPICFLAG='@FPICFLAG@'
+FT2_CPPFLAGS='@FT2_CPPFLAGS@'
+FT2_LIBS='@FT2_LIBS@'
+GLPK_CPPFLAGS='@GLPK_CPPFLAGS@'
+GLPK_LDFLAGS='@GLPK_LDFLAGS@'
+GLPK_LIBS='@GLPK_LIBS@'
+GNUPLOT='@GNUPLOT@'
+HDF5_CPPFLAGS='@HDF5_CPPFLAGS@'
+HDF5_LDFLAGS='@HDF5_LDFLAGS@'
+HDF5_LIBS='@HDF5_LIBS@'
+includedir='@includedir@'
+LAPACK_LIBS='@LAPACK_LIBS@'
+LD_CXX='@LD_CXX@'
+LDFLAGS='@LDFLAGS@'
+LD_STATIC_FLAG='@LD_STATIC_FLAG@'
+LEX='@LEX@'
+LEXLIB='@LEXLIB@'
+LFLAGS='@LFLAGS@'
+libdir='@libdir@'
+LIBEXT='@LIBEXT@'
+LIBOCTAVE='@LIBOCTAVE@'
+LIBOCTINTERP='@LIBOCTINTERP@'
+LIBS='@LIBS@'
+LLVM_CPPFLAGS='@LLVM_CPPFLAGS@'
+LLVM_LDFLAGS='@LLVM_LDFLAGS@'
+LLVM_LIBS='@LLVM_LIBS@'
+LN_S='@LN_S@'
+MAGICK_CPPFLAGS='@MAGICK_CPPFLAGS@'
+MAGICK_LDFLAGS='@MAGICK_LDFLAGS@'
+MAGICK_LIBS='@MAGICK_LIBS@'
+OCTAVE_LINK_DEPS='@OCTAVE_LINK_DEPS@'
+OCTAVE_LINK_OPTS='@OCTAVE_LINK_OPTS@'
+octincludedir='@octincludedir@'
+octlibdir='@octlibdir@'
+OCT_LINK_DEPS='@OCT_LINK_DEPS@'
+OCT_LINK_OPTS='@OCT_LINK_OPTS@'
+OPENGL_LIBS='@OPENGL_LIBS@'
+OSMESA_CPPFLAGS='@OSMESA_CPPFLAGS@'
+OSMESA_LDFLAGS='@OSMESA_LDFLAGS@'
+OSMESA_LIBS='@OSMESA_LIBS@'
+PCRE_CPPFLAGS='@PCRE_CPPFLAGS@'
+PCRE_LIBS='@PCRE_LIBS@'
+prefix='@prefix@'
+PTHREAD_CFLAGS='@PTHREAD_CFLAGS@'
+PTHREAD_LIBS='@PTHREAD_LIBS@'
+QHULL_CPPFLAGS='@QHULL_CPPFLAGS@'
+QHULL_LDFLAGS='@QHULL_LDFLAGS@'
+QHULL_LIBS='@QHULL_LIBS@'
+QRUPDATE_CPPFLAGS='@QRUPDATE_CPPFLAGS@'
+QRUPDATE_LDFLAGS='@QRUPDATE_LDFLAGS@'
+QRUPDATE_LIBS='@QRUPDATE_LIBS@'
+QT_CPPFLAGS='@QT_CPPFLAGS@'
+QT_LDFLAGS='@QT_LDFLAGS@'
+QT_LIBS='@QT_LIBS@'
+RANLIB='@RANLIB@'
+RDYNAMIC_FLAG='@RDYNAMIC_FLAG@'
+READLINE_LIBS='@READLINE_LIBS@'
+SED='@SED@'
+SHARED_LIBS='@SHARED_LIBS@'
+SHLEXT='@SHLEXT@'
+SHLLINKEXT='@SHLLINKEXT@'
+SHLEXT_VER='@SHLEXT_VER@'
+SH_LD='@SH_LD@'
+SH_LDFLAGS='@SH_LDFLAGS@'
+SONAME_FLAGS='@SONAME_FLAGS@'
+STATIC_LIBS='@STATIC_LIBS@'
+TERM_LIBS='@TERM_LIBS@'
+UMFPACK_CPPFLAGS='@UMFPACK_CPPFLAGS@'
+UMFPACK_LDFLAGS='@UMFPACK_LDFLAGS@'
+UMFPACK_LIBS='@UMFPACK_LIBS@'
+version='@PACKAGE_VERSION@'
+WARN_CFLAGS='@WARN_CFLAGS@'
+WARN_CXXFLAGS='@WARN_CXXFLAGS@'
+X11_INCFLAGS='@X11_INCFLAGS@'
+X11_LIBS='@X11_LIBS@'
+XTRA_CFLAGS='@XTRA_CFLAGS@'
+XTRA_CXXFLAGS='@XTRA_CXXFLAGS@'
+YACC='@YACC@'
+YFLAGS='@YFLAGS@'
+Z_CPPFLAGS='@Z_CPPFLAGS@'
+Z_LDFLAGS='@Z_LDFLAGS@'
+Z_LIBS='@Z_LIBS@'
+config_opts='@config_opts@'
+
+## These must use " so that embedded variables are interpolated.
+
+## Is there a better way?
+
+function expand_var ()
+{
+  eval tmp="\$$1"
+  while echo "$tmp" | grep '\${[A-Za-z_][A-Za-z0-9_]*}' > /dev/null; do
+    eval tmp="$tmp"
+  done
+  eval $1="'$tmp'"
+}
+
+expand_var NO_OCT_FILE_STRIP
+expand_var bindir
+expand_var AMD_CPPFLAGS
+expand_var AMD_LDFLAGS
+expand_var AMD_LIBS
+expand_var AR
+expand_var ARFLAGS
+expand_var ARPACK_CPPFLAGS
+expand_var ARPACK_LDFLAGS
+expand_var ARPACK_LIBS
+expand_var BLAS_LIBS
+expand_var CAMD_CPPFLAGS
+expand_var CAMD_LDFLAGS
+expand_var CAMD_LIBS
+expand_var CARBON_LIBS
+expand_var CC
+expand_var CCOLAMD_CPPFLAGS
+expand_var CCOLAMD_LDFLAGS
+expand_var CCOLAMD_LIBS
+expand_var CFLAGS
+expand_var CHOLMOD_CPPFLAGS
+expand_var CHOLMOD_LDFLAGS
+expand_var CHOLMOD_LIBS
+expand_var COLAMD_CPPFLAGS
+expand_var COLAMD_LDFLAGS
+expand_var COLAMD_LIBS
+expand_var CPICFLAG
+expand_var CPPFLAGS
+expand_var CURL_CPPFLAGS
+expand_var CURL_LDFLAGS
+expand_var CURL_LIBS
+expand_var CXSPARSE_CPPFLAGS
+expand_var CXSPARSE_LDFLAGS
+expand_var CXSPARSE_LIBS
+expand_var CXX
+expand_var CXXCPP
+expand_var CXXFLAGS
+expand_var CXXPICFLAG
+expand_var DEFAULT_PAGER
+expand_var DEFS
+expand_var DEPEND_FLAGS
+expand_var DEPEND_EXTRA_SED_PATTERN
+expand_var DL_LD
+expand_var DL_LDFLAGS
+expand_var DL_LIBS
+expand_var EXEEXT
+expand_var GCC_VERSION
+expand_var GXX_VERSION
+expand_var F77
+expand_var F77_FLOAT_STORE_FLAG
+expand_var F77_INTEGER_8_FLAG
+expand_var FFLAGS
+expand_var FFTW3_CPPFLAGS
+expand_var FFTW3_LDFLAGS
+expand_var FFTW3_LIBS
+expand_var FFTW3F_CPPFLAGS
+expand_var FFTW3F_LDFLAGS
+expand_var FFTW3F_LIBS
+expand_var FLIBS
+expand_var FLTK_CPPFLAGS
+expand_var FLTK_LDFLAGS
+expand_var FLTK_LIBS
+expand_var FONTCONFIG_CPPFLAGS
+expand_var FONTCONFIG_LIBS
+expand_var FPICFLAG
+expand_var FT2_CPPFLAGS
+expand_var FT2_LIBS
+expand_var GLPK_CPPFLAGS
+expand_var GLPK_LDFLAGS
+expand_var GLPK_LIBS
+expand_var GNUPLOT
+expand_var HDF5_CPPFLAGS
+expand_var HDF5_LDFLAGS
+expand_var HDF5_LIBS
+expand_var includedir
+expand_var LAPACK_LIBS
+expand_var LD_CXX
+expand_var LDFLAGS
+expand_var LD_STATIC_FLAG
+expand_var LEX
+expand_var LEXLIB
+expand_var LFLAGS
+expand_var libdir
+expand_var LIBEXT
+expand_var LIBOCTAVE
+expand_var LIBOCTINTERP
+expand_var LIBS
+expand_var LLVM_CPPFLAGS
+expand_var LLVM_LDFLAGS
+expand_var LLVM_LIBS
+expand_var LN_S
+expand_var MAGICK_CPPFLAGS
+expand_var MAGICK_LDFLAGS
+expand_var MAGICK_LIBS
+expand_var OCTAVE_LINK_DEPS
+expand_var OCTAVE_LINK_OPTS
+expand_var octincludedir
+expand_var octlibdir
+expand_var OCT_LINK_DEPS
+expand_var OCT_LINK_OPTS
+expand_var OPENGL_LIBS
+expand_var OSMESA_CPPFLAGS
+expand_var OSMESA_LDFLAGS
+expand_var OSMESA_LIBS
+expand_var PCRE_CPPFLAGS
+expand_var PCRE_LIBS
+expand_var prefix
+expand_var PTHREAD_CFLAGS
+expand_var PTHREAD_LIBS
+expand_var QHULL_CPPFLAGS
+expand_var QHULL_LDFLAGS
+expand_var QHULL_LIBS
+expand_var QRUPDATE_CPPFLAGS
+expand_var QRUPDATE_LDFLAGS
+expand_var QRUPDATE_LIBS
+expand_var QT_CPPFLAGS
+expand_var QT_LDFLAGS
+expand_var QT_LIBS
+expand_var RANLIB
+expand_var RDYNAMIC_FLAG
+expand_var READLINE_LIBS
+expand_var SED
+expand_var SHARED_LIBS
+expand_var SHLEXT
+expand_var SHLLINKEXT
+expand_var SHLEXT_VER
+expand_var SH_LD
+expand_var SH_LDFLAGS
+expand_var SONAME_FLAGS
+expand_var STATIC_LIBS
+expand_var TERM_LIBS
+expand_var UMFPACK_CPPFLAGS
+expand_var UMFPACK_LDFLAGS
+expand_var UMFPACK_LIBS
+expand_var version
+expand_var WARN_CFLAGS
+expand_var WARN_CXXFLAGS
+expand_var X11_INCFLAGS
+expand_var X11_LIBS
+expand_var XTRA_CFLAGS
+expand_var XTRA_CXXFLAGS
+expand_var YACC
+expand_var YFLAGS
+expand_var Z_CPPFLAGS
+expand_var Z_LDFLAGS
+expand_var Z_LIBS
+expand_var config_opts
+
+$SED \
+  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by subst-config-vals.|" \
+    -e "s|%NO_OCT_FILE_STRIP%|${NO_OCT_FILE_STRIP}|" \
+    -e "s|%OCTAVE_BINDIR%|\"${bindir}\"|" \
+    -e "s|%OCTAVE_CONF_AMD_CPPFLAGS%|\"${AMD_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_AMD_LDFLAGS%|\"${AMD_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_AMD_LIBS%|\"${AMD_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_AR%|\"${AR}\"|" \
+    -e "s|%OCTAVE_CONF_ARFLAGS%|\"${ARFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_ARPACK_CPPFLAGS%|\"${ARPACK_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_ARPACK_LDFLAGS%|\"${ARPACK_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_ARPACK_LIBS%|\"${ARPACK_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_BLAS_LIBS%|\"${BLAS_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CAMD_CPPFLAGS%|\"${CAMD_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CAMD_LDFLAGS%|\"${CAMD_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CAMD_LIBS%|\"${CAMD_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CARBON_LIBS%|\"${CARBON_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CC%|\"${CC}\"|" \
+    -e "s|%OCTAVE_CONF_CCOLAMD_CPPFLAGS%|\"${CCOLAMD_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CCOLAMD_LDFLAGS%|\"${CCOLAMD_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CCOLAMD_LIBS%|\"${CCOLAMD_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CFLAGS%|\"${CFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CHOLMOD_CPPFLAGS%|\"${CHOLMOD_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CHOLMOD_LDFLAGS%|\"${CHOLMOD_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CHOLMOD_LIBS%|\"${CHOLMOD_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_COLAMD_CPPFLAGS%|\"${COLAMD_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_COLAMD_LDFLAGS%|\"${COLAMD_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_COLAMD_LIBS%|\"${COLAMD_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CPICFLAG%|\"${CPICFLAG}\"|" \
+    -e "s|%OCTAVE_CONF_CPPFLAGS%|\"${CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CURL_CPPFLAGS%|\"${CURL_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CURL_LDFLAGS%|\"${CURL_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CURL_LIBS%|\"${CURL_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CXSPARSE_CPPFLAGS%|\"${CXSPARSE_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CXSPARSE_LDFLAGS%|\"${CXSPARSE_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CXSPARSE_LIBS%|\"${CXSPARSE_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_CXX%|\"${CXX}\"|" \
+    -e "s|%OCTAVE_CONF_CXXCPP%|\"${CXXCPP}\"|" \
+    -e "s|%OCTAVE_CONF_CXXFLAGS%|\"${CXXFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_CXXPICFLAG%|\"${CXXPICFLAG}\"|" \
+    -e "s|%OCTAVE_CONF_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
+    -e "s|%OCTAVE_CONF_DEFS%|\"${DEFS}\"|" \
+    -e "s|%OCTAVE_CONF_DEPEND_FLAGS%|\"${DEPEND_FLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_DEPEND_EXTRA_SED_PATTERN%|\"${DEPEND_EXTRA_SED_PATTERN}\"|" \
+    -e "s|%OCTAVE_CONF_DL_LD%|\"${DL_LD}\"|" \
+    -e "s|%OCTAVE_CONF_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_DL_LIBS%|\"${DL_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_EXEEXT%|\"${EXEEXT}\"|" \
+    -e "s|%OCTAVE_CONF_GCC_VERSION%|\"${GCC_VERSION}\"|" \
+    -e "s|%OCTAVE_CONF_GXX_VERSION%|\"${GXX_VERSION}\"|" \
+    -e "s|%OCTAVE_CONF_F77%|\"${F77}\"|" \
+    -e "s|%OCTAVE_CONF_F77_FLOAT_STORE_FLAG%|\"${F77_FLOAT_STORE_FLAG}\"|" \
+    -e "s|%OCTAVE_CONF_F77_INTEGER_8_FLAG%|\"${F77_INTEGER_8_FLAG}\"|" \
+    -e "s|%OCTAVE_CONF_FFLAGS%|\"${FFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FFTW3_CPPFLAGS%|\"${FFTW3_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FFTW3_LDFLAGS%|\"${FFTW3_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FFTW3_LIBS%|\"${FFTW3_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_FFTW3F_CPPFLAGS%|\"${FFTW3F_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FFTW3F_LDFLAGS%|\"${FFTW3F_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FFTW3F_LIBS%|\"${FFTW3F_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_FLIBS%|\"${FLIBS}\"|" \
+    -e "s|%OCTAVE_CONF_FLTK_CPPFLAGS%|\"${FLTK_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FLTK_LDFLAGS%|\"${FLTK_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FLTK_LIBS%|\"${FLTK_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_FONTCONFIG_CPPFLAGS%|\"${FONTCONFIG_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FONTCONFIG_LIBS%|\"${FONTCONFIG_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_FPICFLAG%|\"${FPICFLAG}\"|" \
+    -e "s|%OCTAVE_CONF_FT2_CPPFLAGS%|\"${FT2_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_FT2_LIBS%|\"${FT2_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_GLPK_CPPFLAGS%|\"${GLPK_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_GLPK_LDFLAGS%|\"${GLPK_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_GLPK_LIBS%|\"${GLPK_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_GNUPLOT%|\"${GNUPLOT}\"|" \
+    -e "s|%OCTAVE_CONF_HDF5_CPPFLAGS%|\"${HDF5_CPPFLAGS}\"|" | \
+    $SED -e "s|%OCTAVE_CONF_HDF5_LDFLAGS%|\"${HDF5_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_HDF5_LIBS%|\"${HDF5_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \
+    -e "s|%OCTAVE_CONF_LAPACK_LIBS%|\"${LAPACK_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_LD_CXX%|\"${LD_CXX}\"|" \
+    -e "s|%OCTAVE_CONF_LDFLAGS%|\"${LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_LD_STATIC_FLAG%|\"${LD_STATIC_FLAG}\"|" \
+    -e "s|%OCTAVE_CONF_LEX%|\"${LEX}\"|" \
+    -e "s|%OCTAVE_CONF_LEXLIB%|\"${LEXLIB}\"|" \
+    -e "s|%OCTAVE_CONF_LFLAGS%|\"${LFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_LIBDIR%|\"${libdir}\"|" \
+    -e "s|%OCTAVE_CONF_LIBEXT%|\"${LIBEXT}\"|" \
+    -e "s|%OCTAVE_CONF_LIBOCTAVE%|\"${LIBOCTAVE}\"|" \
+    -e "s|%OCTAVE_CONF_LIBOCTINTERP%|\"${LIBOCTINTERP}\"|" \
+    -e "s|%OCTAVE_CONF_LIBS%|\"${LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_LLVM_CPPFLAGS%|\"${LLVM_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_LLVM_LDFLAGS%|\"${LLVM_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_LLVM_LIBS%|\"${LLVM_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_LN_S%|\"${LN_S}\"|" \
+    -e "s|%OCTAVE_CONF_MAGICK_CPPFLAGS%|\"${MAGICK_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_MAGICK_LDFLAGS%|\"${MAGICK_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_MAGICK_LIBS%|\"${MAGICK_LIBS}\"|" \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_AR%|\"${AR}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_CC%|\"${CC}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_CXX%|\"${CXX}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LD%|\"${DL_LD}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_DL_LDFLAGS%|\"${DL_LDFLAGS}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_F77%|\"${F77}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_LD_CXX%|\"${LD_CXX}\"|' \
+    -e 's|%OCTAVE_CONF_MKOCTFILE_RANLIB%|\"${RANLIB}\"|' \
+    -e "s|%OCTAVE_CONF_OCTAVE_LINK_DEPS%|\"${OCTAVE_LINK_DEPS}\"|" \
+    -e "s|%OCTAVE_CONF_OCTAVE_LINK_OPTS%|\"${OCTAVE_LINK_OPTS}\"|" \
+    -e "s|%OCTAVE_CONF_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
+    -e "s|%OCTAVE_CONF_OCTLIBDIR%|\"${octlibdir}\"|" \
+    -e "s|%OCTAVE_CONF_OCT_LINK_DEPS%|\"${OCT_LINK_DEPS}\"|" \
+    -e "s|%OCTAVE_CONF_OCT_LINK_OPTS%|\"${OCT_LINK_OPTS}\"|" \
+    -e "s|%OCTAVE_CONF_OPENGL_LIBS%|\"${OPENGL_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_OSMESA_CPPFLAGS%|\"${OSMESA_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_OSMESA_LDFLAGS%|\"${OSMESA_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_OSMESA_LIBS%|\"${OSMESA_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_PCRE_CPPFLAGS%|\"${PCRE_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_PCRE_LIBS%|\"${PCRE_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_PREFIX%|\"${prefix}\"|" \
+    -e "s|%OCTAVE_CONF_PTHREAD_CFLAGS%|\"${PTHREAD_CFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_PTHREAD_LIBS%|\"${PTHREAD_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_QHULL_CPPFLAGS%|\"${QHULL_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_QHULL_LDFLAGS%|\"${QHULL_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_QHULL_LIBS%|\"${QHULL_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_QRUPDATE_CPPFLAGS%|\"${QRUPDATE_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_QRUPDATE_LDFLAGS%|\"${QRUPDATE_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_QRUPDATE_LIBS%|\"${QRUPDATE_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_QT_CPPFLAGS%|\"${QT_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_QT_LDFLAGS%|\"${QT_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_QT_LIBS%|\"${QT_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_RANLIB%|\"${RANLIB}\"|" \
+    -e "s|%OCTAVE_CONF_RDYNAMIC_FLAG%|\"${RDYNAMIC_FLAG}\"|" \
+    -e "s|%OCTAVE_CONF_READLINE_LIBS%|\"${READLINE_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_SED%|\"${SED}\"|" \
+    -e "s|%OCTAVE_CONF_SHARED_LIBS%|\"${SHARED_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_SHLEXT%|\"${SHLEXT}\"|" \
+    -e "s|%OCTAVE_CONF_SHLLINKEXT%|\"${SHLLINKEXT}\"|" \
+    -e "s|%OCTAVE_CONF_SHLEXT_VER%|\"${SHLEXT_VER}\"|" \
+    -e "s|%OCTAVE_CONF_SH_LD%|\"${SH_LD}\"|" \
+    -e "s|%OCTAVE_CONF_SH_LDFLAGS%|\"${SH_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_SONAME_FLAGS%|\"${SONAME_FLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_STATIC_LIBS%|\"${STATIC_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_TERM_LIBS%|\"${TERM_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_UMFPACK_CPPFLAGS%|\"${UMFPACK_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_UMFPACK_LDFLAGS%|\"${UMFPACK_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_UMFPACK_LIBS%|\"${UMFPACK_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_VERSION%|\"${version}\"|" \
+    -e "s|%OCTAVE_CONF_WARN_CFLAGS%|\"${WARN_CFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_WARN_CXXFLAGS%|\"${WARN_CXXFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_X11_INCFLAGS%|\"${X11_INCFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_X11_LIBS%|\"${X11_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_XTRA_CFLAGS%|\"${XTRA_CFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_XTRA_CXXFLAGS%|\"${XTRA_CXXFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_YACC%|\"${YACC}\"|" \
+    -e "s|%OCTAVE_CONF_YFLAGS%|\"${YFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_Z_CPPFLAGS%|\"${Z_CPPFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_Z_LDFLAGS%|\"${Z_LDFLAGS}\"|" \
+    -e "s|%OCTAVE_CONF_Z_LIBS%|\"${Z_LIBS}\"|" \
+    -e "s|%OCTAVE_CONF_config_opts%|\"${config_opts}\"|"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/subst-default-vals.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,174 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+## Use two steps so that we can interpolate values without having to
+## determine the order in which to set variable values.
+
+## These must use ' so that embedded variables are not interpolated
+## (the values they reference may not be defined before they are used).
+
+archlibdir='@archlibdir@'
+bindir='@bindir@'
+canonical_host_type='@canonical_host_type@'
+datadir='@datadir@'
+datarootdir='@datarootdir@'
+DEFAULT_PAGER='@DEFAULT_PAGER@'
+doc_cache_file='@doc_cache_file@'
+exec_prefix='@exec_prefix@'
+EXEEXT='@EXEEXT@'
+fcnfiledir='@fcnfiledir@'
+imagedir='@imagedir@'
+includedir='@includedir@'
+infodir='@infodir@'
+infofile='@infofile@'
+libdir='@libdir@'
+libexecdir='@libexecdir@'
+localapifcnfiledir='@localapifcnfiledir@'
+localapioctfiledir='@localapioctfiledir@'
+localarchlibdir='@localarchlibdir@'
+localfcnfiledir='@localfcnfiledir@'
+localoctfiledir='@localoctfiledir@'
+localstartupfiledir='@localstartupfiledir@'
+localapiarchlibdir='@localapiarchlibdir@'
+localverarchlibdir='@localverarchlibdir@'
+localverfcnfiledir='@localverfcnfiledir@'
+localveroctfiledir='@localveroctfiledir@'
+man1dir='@man1dir@'
+man1ext='@man1ext@'
+mandir='@mandir@'
+octdatadir='@octdatadir@'
+octfiledir='@octfiledir@'
+octetcdir='@octetcdir@'
+octincludedir='@octincludedir@'
+octlibdir='@octlibdir@'
+octlocaledir='@octlocaledir@'
+octtestsdir='@octtestsdir@'
+prefix='@prefix@'
+startupfiledir='@startupfiledir@'
+api_version='@OCTAVE_API_VERSION@'
+OCTAVE_RELEASE=''
+SHLEXT='@SHLEXT@'
+texi_macros_file='@texi_macros_file@'
+version='@PACKAGE_VERSION@'
+
+## These must use " so that embedded variables are interpolated.
+
+## Is there a better way?
+
+function expand_var ()
+{
+  eval tmp="\$$1"
+  while echo "$tmp" | grep '\${[A-Za-z_][A-Za-z0-9_]*}' > /dev/null; do
+    eval tmp="$tmp"
+  done
+  eval $1="'$tmp'"
+}
+
+expand_var archlibdir
+expand_var bindir
+expand_var canonical_host_type
+expand_var datadir
+expand_var datarootdir
+expand_var DEFAULT_PAGER
+expand_var doc_cache_file
+expand_var exec_prefix
+expand_var EXEEXT
+expand_var fcnfiledir
+expand_var imagedir
+expand_var includedir
+expand_var infodir
+expand_var infofile
+expand_var libdir
+expand_var libexecdir
+expand_var localapifcnfiledir
+expand_var localapioctfiledir
+expand_var localarchlibdir
+expand_var localfcnfiledir
+expand_var localoctfiledir
+expand_var localstartupfiledir
+expand_var localapiarchlibdir
+expand_var localverarchlibdir
+expand_var localverfcnfiledir
+expand_var localveroctfiledir
+expand_var man1dir
+expand_var man1ext
+expand_var mandir
+expand_var octdatadir
+expand_var octfiledir
+expand_var octetcdir
+expand_var octincludedir
+expand_var octlibdir
+expand_var octlocaledir
+expand_var octtestsdir
+expand_var prefix
+expand_var startupfiledir
+expand_var api_version
+expand_var OCTAVE_RELEASE
+expand_var SHLEXT
+expand_var texi_macros_file
+expand_var version
+
+$SED \
+  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically by subst-default-vals.|" \
+  -e "s|%OCTAVE_ARCHLIBDIR%|\"${archlibdir}\"|" \
+  -e "s|%OCTAVE_BINDIR%|\"${bindir}\"|" \
+  -e "s|%OCTAVE_CANONICAL_HOST_TYPE%|\"${canonical_host_type}\"|" \
+  -e "s|%OCTAVE_DATADIR%|\"${datadir}\"|" \
+  -e "s|%OCTAVE_DATAROOTDIR%|\"${datarootdir}\"|" \
+  -e "s|%OCTAVE_DEFAULT_PAGER%|\"${DEFAULT_PAGER}\"|" \
+  -e "s|%OCTAVE_DOC_CACHE_FILE%|\"${doc_cache_file}\"|" \
+  -e "s|%OCTAVE_EXEC_PREFIX%|\"${exec_prefix}\"|" \
+  -e "s|%OCTAVE_EXEEXT%|\"${EXEEXT}\"|" \
+  -e "s|%OCTAVE_FCNFILEDIR%|\"${fcnfiledir}\"|" \
+  -e "s|%OCTAVE_IMAGEDIR%|\"${imagedir}\"|" \
+  -e "s|%OCTAVE_INCLUDEDIR%|\"${includedir}\"|" \
+  -e "s|%OCTAVE_INFODIR%|\"${infodir}\"|" \
+  -e "s|%OCTAVE_INFOFILE%|\"${infofile}\"|" \
+  -e "s|%OCTAVE_LIBDIR%|\"${libdir}\"|" \
+  -e "s|%OCTAVE_LIBEXECDIR%|\"${libexecdir}\"|" \
+  -e "s|%OCTAVE_LOCALAPIFCNFILEDIR%|\"${localapifcnfiledir}\"|" \
+  -e "s|%OCTAVE_LOCALAPIOCTFILEDIR%|\"${localapioctfiledir}\"|" \
+  -e "s|%OCTAVE_LOCALARCHLIBDIR%|\"${localarchlibdir}\"|" \
+  -e "s|%OCTAVE_LOCALFCNFILEDIR%|\"${localfcnfiledir}\"|" \
+  -e "s|%OCTAVE_LOCALOCTFILEDIR%|\"${localoctfiledir}\"|" \
+  -e "s|%OCTAVE_LOCALSTARTUPFILEDIR%|\"${localstartupfiledir}\"|" \
+  -e "s|%OCTAVE_LOCALAPIARCHLIBDIR%|\"${localapiarchlibdir}\"|" \
+  -e "s|%OCTAVE_LOCALVERARCHLIBDIR%|\"${localverarchlibdir}\"|" \
+  -e "s|%OCTAVE_LOCALVERFCNFILEDIR%|\"${localverfcnfiledir}\"|" \
+  -e "s|%OCTAVE_LOCALVEROCTFILEDIR%|\"${localveroctfiledir}\"|" \
+  -e "s|%OCTAVE_MAN1DIR%|\"${man1dir}\"|" \
+  -e "s|%OCTAVE_MAN1EXT%|\"${man1ext}\"|" \
+  -e "s|%OCTAVE_MANDIR%|\"${mandir}\"|" \
+  -e "s|%OCTAVE_OCTDATADIR%|\"${octdatadir}\"|" \
+  -e "s|%OCTAVE_OCTFILEDIR%|\"${octfiledir}\"|" \
+  -e "s|%OCTAVE_OCTETCDIR%|\"${octetcdir}\"|" \
+  -e "s|%OCTAVE_OCTINCLUDEDIR%|\"${octincludedir}\"|" \
+  -e "s|%OCTAVE_OCTLIBDIR%|\"${octlibdir}\"|" \
+  -e "s|%OCTAVE_OCTLOCALEDIR%|\"${octlocaledir}\"|" \
+  -e "s|%OCTAVE_OCTTESTSDIR%|\"${octtestsdir}\"|" \
+  -e "s|%OCTAVE_STARTUPFILEDIR%|\"${startupfiledir}\"|" \
+  -e "s|%OCTAVE_PREFIX%|\"${prefix}\"|" \
+  -e "s|%OCTAVE_API_VERSION%|\"${api_version}\"|" \
+  -e "s|%OCTAVE_RELEASE%|\"${OCTAVE_RELEASE}\"|" \
+  -e "s|%OCTAVE_SHLEXT%|\"${SHLEXT}\"|" \
+  -e "s|%OCTAVE_TEXI_MACROS_FILE%|\"${texi_macros_file}\"|" \
+  -e "s|%OCTAVE_VERSION%|\"${version}\"|"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/subst-f77-isnan-macro.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,25 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+F77_ISNAN_MACRO='@F77_ISNAN_MACRO@'
+
+$SED -e "${F77_ISNAN_MACRO}"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build-aux/subst-script-vals.in.sh	Fri Mar 04 12:51:00 2016 -0500
@@ -0,0 +1,62 @@
+#! /bin/sh
+#
+# Copyright (C) 2016 John W. Eaton
+#
+# This file is part of Octave.
+#
+# Octave is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# Octave is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Octave; see the file COPYING.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+: ${SED=@SED@}
+
+## Use two steps so that we can interpolate values without having to
+## determine the order in which to set variable values.
+
+## These must use ' so that embedded variables are not interpolated
+## (the values they reference may not be defined before they are used).
+
+AWK="@AWK@"
+FIND="@FIND@"
+SED="@SED@"
+ADDRESS_SANITIZER_OPTIONS="@ADDRESS_SANITIZER_OPTIONS@"
+abs_top_srcdir="@abs_top_srcdir@"
+abs_top_builddir="@abs_top_builddir@"
+
+## These must use " so that embedded variables are interpolated.
+
+## Is there a better way?
+
+function expand_var ()
+{
+  eval tmp="\$$1"
+  while echo "$tmp" | grep '\${[A-Za-z_][A-Za-z0-9_]*}' > /dev/null; do
+    eval tmp="$tmp"
+  done
+  eval $1="'$tmp'"
+}
+
+expand_var AWK
+expand_var FIND
+expand_var SED
+expand_var ADDRESS_SANITIZER_OPTIONS
+expand_var abs_top_srcdir
+expand_var abs_top_builddir
+
+$SED \
+  -e "s|%AWK%|${AWK}|g" \
+  -e "s|%FIND%|${FIND}|g" \
+  -e "s|%SED%|${SED}|g" \
+  -e "s|%ADDRESS_SANITIZER_OPTIONS%|${ADDRESS_SANITIZER_OPTIONS}|g" \
+  -e "s|%abs_top_srcdir%|${abs_top_srcdir}|" \
+  -e "s|%builddir%|${abs_top_builddir}|"
--- a/configure.ac	Wed Mar 02 16:46:23 2016 -0500
+++ b/configure.ac	Fri Mar 04 12:51:00 2016 -0500
@@ -87,92 +87,96 @@
 
 ## Where to install and expect libraries like liboctave.a, liboctinterp.a,
 ## and other architecture-dependent data.
-OCTAVE_SET_DEFAULT([octlibdir], '$(libdir)/octave/$(version)')
+OCTAVE_SET_DEFAULT([octlibdir], '${libdir}/octave/${version}')
 
 ## Where to put executables to be run by Octave rather than
 ## the user.  This path usually includes the Octave version
 ## and configuration name, so that multiple configurations
 ## for multiple versions of Octave may be installed at once.
 OCTAVE_SET_DEFAULT([archlibdir],
-  '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)')
+  '${libexecdir}/octave/${version}/exec/${canonical_host_type}')
 
 ## Where to put executables to be run by Octave rather than by the
 ## user that are specific to this site.
 OCTAVE_SET_DEFAULT([localarchlibdir],
-  '$(libexecdir)/octave/site/exec/$(canonical_host_type)')
+  '${libexecdir}/octave/site/exec/${canonical_host_type}')
 
 OCTAVE_SET_DEFAULT([localapiarchlibdir],
-  '$(libexecdir)/octave/$(api_version)/site/exec/$(canonical_host_type)')
+  '${libexecdir}/octave/${api_version}/site/exec/${canonical_host_type}')
 
 OCTAVE_SET_DEFAULT([localverarchlibdir],
-  '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)')
+  '${libexecdir}/octave/${version}/site/exec/${canonical_host_type}')
 
 ## Where to put object files that will by dynamically loaded.
 ## This path usually includes the Octave version and configuration
 ## name, so that multiple configurations for multiple versions of
 ## Octave may be installed at once.
 OCTAVE_SET_DEFAULT([octfiledir],
-  '$(libdir)/octave/$(version)/oct/$(canonical_host_type)')
+  '${libdir}/octave/${version}/oct/${canonical_host_type}')
 
 ## Directories Octave should search for object files that will be
 ## dynamically loaded and that are specific to this site
 ## (i.e. customizations), before consulting ${octfiledir}.  This should
 ## be a colon-separated list of directories.
 OCTAVE_SET_DEFAULT([localoctfiledir],
-  '$(libdir)/octave/site/oct/$(canonical_host_type)')
+  '${libdir}/octave/site/oct/${canonical_host_type}')
 
 OCTAVE_SET_DEFAULT([localapioctfiledir],
-  '$(libdir)/octave/site/oct/$(api_version)/$(canonical_host_type)')
+  '${libdir}/octave/site/oct/${api_version}/${canonical_host_type}')
 
 OCTAVE_SET_DEFAULT([localveroctfiledir],
-  '$(libdir)/octave/$(version)/site/oct/$(canonical_host_type)')
+  '${libdir}/octave/${version}/site/oct/${canonical_host_type}')
 
 ## Where to install Octave's include files.
-OCTAVE_SET_DEFAULT([octincludedir], '$(includedir)/octave-$(version)/octave')
+OCTAVE_SET_DEFAULT([octincludedir], '${includedir}/octave-${version}/octave')
 
 ## Where to install the function file distributed with
 ## Octave.  This includes the Octave version, so that the
 ## function files for different versions of Octave will install
 ## themselves in separate directories.
-OCTAVE_SET_DEFAULT([fcnfiledir], '$(datadir)/octave/$(version)/m')
+OCTAVE_SET_DEFAULT([fcnfiledir], '${datadir}/octave/${version}/m')
 
 ## Directories Octave should search for function files specific
 ## to this site (i.e. customizations), before consulting
 ## ${fcnfiledir}.  This should be a colon-separated list of
 ## directories.
-OCTAVE_SET_DEFAULT([localfcnfiledir], '$(datadir)/octave/site/m')
+OCTAVE_SET_DEFAULT([localfcnfiledir], '${datadir}/octave/site/m')
 
 OCTAVE_SET_DEFAULT([localapifcnfiledir],
-  '$(datadir)/octave/site/$(api_version)/m')
-
-OCTAVE_SET_DEFAULT([localverfcnfiledir], '$(datadir)/octave/$(version)/site/m')
+  '${datadir}/octave/site/${api_version}/m')
+
+OCTAVE_SET_DEFAULT([localverfcnfiledir], '${datadir}/octave/${version}/site/m')
 
 ## Where to install and expect extra files like NEWS and doc-cache.
-OCTAVE_SET_DEFAULT([octetcdir], '$(datadir)/octave/$(version)/etc')
+OCTAVE_SET_DEFAULT([octetcdir], '${datadir}/octave/${version}/etc')
 
 ## Where to install and expect the language files for the gui.
-OCTAVE_SET_DEFAULT([octlocaledir], '$(datadir)/octave/$(version)/locale')
+OCTAVE_SET_DEFAULT([octlocaledir], '${datadir}/octave/${version}/locale')
 
 ## The full path to the default doc cache file.
-OCTAVE_SET_DEFAULT([doc_cache_file], '$(octetcdir)/doc-cache')
+OCTAVE_SET_DEFAULT([doc_cache_file], '${octetcdir}/doc-cache')
 
 ## Where to install test files.
-OCTAVE_SET_DEFAULT([octtestsdir], '$(octetcdir)/tests')
+OCTAVE_SET_DEFAULT([octtestsdir], '${octetcdir}/tests')
 
 ## The full path to the default texi macros file.
-OCTAVE_SET_DEFAULT([texi_macros_file], '$(octetcdir)/macros.texi')
+OCTAVE_SET_DEFAULT([texi_macros_file], '${octetcdir}/macros.texi')
 
 ## Where Octave will search to find image files.
-OCTAVE_SET_DEFAULT([imagedir], '$(datadir)/octave/$(version)/imagelib')
+OCTAVE_SET_DEFAULT([imagedir], '${datadir}/octave/${version}/imagelib')
 
 ## Where Octave will search for example data files shipped with distribution.
-OCTAVE_SET_DEFAULT([octdatadir], '$(datadir)/octave/$(version)/data')
-
-OCTAVE_SET_DEFAULT([man1dir], '$(mandir)/man1')
+OCTAVE_SET_DEFAULT([octdatadir], '${datadir}/octave/${version}/data')
+
+## Where Octave will look for startup files
+OCTAVE_SET_DEFAULT([startupfiledir], ['${fcnfiledir}/startup'])
+OCTAVE_SET_DEFAULT([localstartupfiledir], ['${localfcnfiledir}/startup'])
+
+OCTAVE_SET_DEFAULT([man1dir], '${mandir}/man1')
 
 OCTAVE_SET_DEFAULT([man1ext], '.1')
 
-OCTAVE_SET_DEFAULT([infofile], '$(infodir)/octave.info')
+OCTAVE_SET_DEFAULT([infofile], '${infodir}/octave.info')
 
 ### Check for programs used in building, installing, and running Octave.
 
@@ -613,12 +617,12 @@
   BUILD_LDFLAGS=""
   BUILD_EXEEXT=""
 else
-  BUILD_CC='$(CC)'
-  BUILD_CFLAGS='$(CFLAGS)'
-  BUILD_CXX='$(CXX)'
-  BUILD_CXXFLAGS='$(CXXFLAGS)'
-  BUILD_LDFLAGS='$(LDFLAGS)'
-  BUILD_EXEEXT='$(EXEEXT)'
+  BUILD_CC='${CC}'
+  BUILD_CFLAGS='${CFLAGS}'
+  BUILD_CXX='${CXX}'
+  BUILD_CXXFLAGS='${CXXFLAGS}'
+  BUILD_LDFLAGS='${LDFLAGS}'
+  BUILD_EXEEXT='${EXEEXT}'
 fi
 
 AC_ARG_VAR([BUILD_CC],
@@ -1290,6 +1294,10 @@
   OCTAVE_CONFIGURE_WARNING([warn_freetype])
 else
   FT2_CPPFLAGS="$FT2_CFLAGS"
+  ## Alias CPPFLAGS to CFLAGS.  This is closer to the true meaning
+  ## of `pkg-config --cflags` output.
+  FT2_CPPFLAGS="$FT2_CFLAGS"
+  AC_SUBST(FT2_CPPFLAGS)
 fi
 
 ## Check for Xft library (when using X11)
@@ -1316,6 +1324,10 @@
   OCTAVE_CONFIGURE_WARNING([warn_fontconfig])
 else
   FONTCONFIG_CPPFLAGS="$FONTCONFIG_CFLAGS"
+  ## Alias CPPFLAGS to CFLAGS.  This is closer to the true meaning
+  ## of `pkg-config --cflags` output.
+  FONTCONFIG_CPPFLAGS="$FONTCONFIG_CFLAGS"
+  AC_SUBST(FONTCONFIG_CPPFLAGS)
 fi
 
 ## Check for OSMesa which is needed for offscreen rendering with OpenGL
@@ -1482,7 +1494,6 @@
       if test -n "$warn_qt_opengl"; then
         OCTAVE_CONFIGURE_WARNING([warn_qt_opengl])
       fi
-    endif
 
       if test $build_qt_graphics = yes; then
         AC_DEFINE(HAVE_QT_GRAPHICS, 1, [Define to 1 if Qt works with OpenGL libs (GL and GLU)])
@@ -1670,12 +1681,14 @@
 else
   SHARED_LIBS=no
 fi
+AC_SUBST(SHARED_LIBS)
 
 if test $enable_static = yes; then
   STATIC_LIBS=yes
 else
   STATIC_LIBS=no
 fi
+AC_SUBST(STATIC_LIBS)
 
 XTRA_CRUFT_SH_LDFLAGS=
 if test $have_msvc = yes; then
@@ -1986,24 +1999,24 @@
 CXXPICFLAG=-fPIC
 FPICFLAG=-fPIC
 SHLEXT=so
-SHLLIB='$(SHLEXT)'
+SHLLIB='${SHLEXT}'
 SHLBIN=
-SHLEXT_VER='$(SHLEXT).$(version)'
-SHLLIB_VER='$(SHLLIB).$(version)'
-SHLBIN_VER='$(SHLBIN).$(version)'
+SHLEXT_VER='${SHLEXT}.${version}'
+SHLLIB_VER='${SHLLIB}.${version}'
+SHLBIN_VER='${SHLBIN}.${version}'
 SHLLINKEXT=
 LIBPRE=lib
 SHLPRE=lib
 SHLLIBPRE=lib
 SHLBINPRE=lib
-SH_LD='$(CXX)'
+SH_LD='${CXX}'
 SH_LDFLAGS=-shared
-DL_LD='$(SH_LD)'
-DL_LDFLAGS='$(SH_LDFLAGS)'
-MKOCTFILE_DL_LDFLAGS='$(DL_LDFLAGS)'
+DL_LD='${SH_LD}'
+DL_LDFLAGS='${SH_LDFLAGS}'
+MKOCTFILE_DL_LDFLAGS='${DL_LDFLAGS}'
 SONAME_FLAGS=
 NO_OCT_FILE_STRIP=false
-TEMPLATE_AR='$(AR)'
+TEMPLATE_AR='${AR}'
 TEMPLATE_ARFLAGS="$ARFLAGS"
 CRUFT_DLL_DEFS=
 OCTAVE_DLL_DEFS=
@@ -2030,9 +2043,9 @@
     SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'"
   ;;
   *-*-darwin*)
-    DL_LDFLAGS='-bundle -bundle_loader $(top_builddir)/libinterp/octave $(LDFLAGS)'
-    MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $(bindir)/octave-$(version)$(EXEEXT)'
-    SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)'
+    DL_LDFLAGS='-bundle -bundle_loader ${top_builddir}/libinterp/octave ${LDFLAGS}'
+    MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader ${bindir}/octave-${version}${EXEEXT}'
+    SH_LDFLAGS='-dynamiclib -single_module ${LDFLAGS}'
     case $canonical_host_type in
       powerpc-*)
         CXXPICFLAG=
@@ -2041,11 +2054,11 @@
       ;;
     esac
     SHLEXT=dylib
-    SHLLIB='$(SHLEXT)'
-    SHLEXT_VER='$(version).$(SHLEXT)'
-    SHLLIB_VER='$(version).$(SHLLIB)'
+    SHLLIB='${SHLEXT}'
+    SHLEXT_VER='${version}.${SHLEXT}'
+    SHLLIB_VER='${version}.${SHLLIB}'
     NO_OCT_FILE_STRIP=true
-    SONAME_FLAGS='-install_name $(octlibdir)/$@'
+    SONAME_FLAGS='-install_name ${octlibdir}/$@'
     library_path_var=DYLD_LIBRARY_PATH
   ;;
   *-*-cygwin*)
@@ -2060,7 +2073,7 @@
     SHLBIN=dll
     DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc"
     SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base"
-    SONAME_FLAGS='-Wl,--out-implib=$(patsubst $(SHLPRE)%,$(LIBPRE)%,$@).a'
+    SONAME_FLAGS='-Wl,--out-implib=$(patsubst ${SHLPRE}%,${LIBPRE}%,$@).a'
     ldpreloadsep=":"
   ;;
   *-*-mingw*)
@@ -2194,7 +2207,7 @@
     fi
     ## Template closures in archive libraries need a different mechanism.
     if test "$GXX" != yes; then
-      TEMPLATE_AR='$(CXX)'
+      TEMPLATE_AR='${CXX}'
       TEMPLATE_ARFLAGS="-xar -o"
     fi
   ;;
@@ -2286,13 +2299,16 @@
   [link_all_deps=no])
 AM_CONDITIONAL([AMCOND_LINK_ALL_DEPS], [test $link_all_deps = yes])
 
+LIBEXT = a
+AC_SUBST(LIBEXT)
+
 ## Dynamic linking is now enabled only if we are building shared
 ## libs and some API for dynamic linking has been detected.
 
 ## FIXME: A lot of the following duplicates the functionality of
 ## code generated by the dlopen option for LT_INIT.
 
-LD_CXX='$(CXX)'
+LD_CXX='${CXX}'
 RDYNAMIC_FLAG=
 DL_API_MSG=""
 dlopen_api=no
@@ -2356,8 +2372,8 @@
   LIBOCTINTERP="-loctinterp$SHLLINKEXT"
   LIBOCTAVE="-loctave$SHLLINKEXT"
 else
-  LIBOCTINTERP='$(top_builddir)/libinterp/liboctinterp.$(LIBEXT)'
-  LIBOCTAVE='$(top_builddir)/liboctave/liboctave.$(LIBEXT)'
+  LIBOCTINTERP='${top_builddir}/libinterp/liboctinterp.${LIBEXT}'
+  LIBOCTAVE='${top_builddir}/liboctave/liboctave.${LIBEXT}'
 fi
 
 AC_SUBST(LD_CXX)
@@ -2369,13 +2385,13 @@
 
 if test "$cross_compiling" = yes && test -n "$ac_tool_prefix"; then
   CROSS_TOOL_PREFIX="$ac_tool_prefix"
-  MKOCTFILE_AR='$(shell echo $(AR) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
-  MKOCTFILE_CC='$(shell echo $(CC) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
-  MKOCTFILE_CXX='$(shell echo $(CXX) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
-  MKOCTFILE_DL_LD='$(shell echo $(DL_LD) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
-  MKOCTFILE_F77='$(shell echo $(F77) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
-  MKOCTFILE_LD_CXX='$(shell echo $(LD_CXX) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
-  MKOCTFILE_RANLIB='$(shell echo $(RANLIB) | $(SED) "s,$(CROSS_TOOL_PREFIX),,")'
+  MKOCTFILE_AR='$(shell echo ${AR} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
+  MKOCTFILE_CC='$(shell echo ${CC} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
+  MKOCTFILE_CXX='$(shell echo ${CXX} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
+  MKOCTFILE_DL_LD='$(shell echo ${DL_LD} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
+  MKOCTFILE_F77='$(shell echo ${F77} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
+  MKOCTFILE_LD_CXX='$(shell echo ${LD_CXX} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
+  MKOCTFILE_RANLIB='$(shell echo ${RANLIB} | ${SED} "s,${CROSS_TOOL_PREFIX},,")'
 else
   MKOCTFILE_AR="$AR"
   MKOCTFILE_CC="$CC"
@@ -2835,6 +2851,11 @@
    fi],
   [])
 
+if test $try_address_sanitizer_flags = yes; then
+  ADDRESS_SANITIZER_OPTIONS="symbolize=1"
+  AC_SUBST(ADDRESS_SANITIZER_OPTIONS)
+fi
+
 AM_CONDITIONAL([AMCOND_ADDRESS_SANITIZER_ENABLED],
   [test $try_address_sanitizer_flags = yes])
 
@@ -3189,18 +3210,29 @@
 AC_SUBST(ac_config_files)
 AC_SUBST(ac_config_headers)
 
-dnl We use a .in.h file for oct-conf-post.h simply to copy it to
-dnl the build tree and so that we don't have to add the -I$(top_srcdir)
-dnl to any CPPFLAGS variables.
 AC_CONFIG_FILES([
-  oct-conf-post.h:oct-conf-post.in.h
   Makefile
   doc/doxyhtml/Doxyfile
   libgnu/Makefile])
 
+dnl We use a .in.h file for oct-conf-post.h simply to copy it to
+dnl the build tree and so that we don't have to add the -I${top_srcdir}
+dnl to any CPPFLAGS variables.
+
+AC_CONFIG_FILES([oct-conf-post.h-tmp:oct-conf-post.in.h])
+AC_CONFIG_COMMANDS([oct-conf-post.h],
+  [$SHELL $srcdir/build-aux/move-if-change oct-conf-post.h-tmp oct-conf-post.h])
+
 OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES([
-  libgui/mk-default-qt-settings
-  liboctave/cruft/mkf77def])
+  build-aux/mk-mxarray-h.sh
+  build-aux/mk-version-h.sh
+  build-aux/subst-config-vals.sh
+  build-aux/subst-cross-config-vals.sh
+  build-aux/subst-default-vals.sh
+  build-aux/subst-f77-isnan-macro.sh
+  build-aux/subst-script-vals.sh
+  build-aux/mk-default-qt-settings.sh
+  build-aux/mk-f77-def.sh])
 
 AC_OUTPUT
 
--- a/etc/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/etc/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -70,13 +70,13 @@
 
 all-icons: etc/icons/octave.appdata.xml etc/icons/octave.desktop $(BUILT_ICONS)
 
-etc/icons/octave.appdata.xml: etc/icons/octave.appdata.xml.in Makefile | etc/icons/$(octave_dirstamp)
+etc/icons/octave.appdata.xml: etc/icons/octave.appdata.xml.in | etc/icons/$(octave_dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(SED) < $< > $@-t \
 	  -e "s|%OCTAVE_DESKTOP_FILE%|${VENDOR}-octave.desktop|" && \
 	mv $@-t $@
 
-etc/icons/octave.desktop: etc/icons/octave.desktop.in Makefile | etc/icons/$(octave_dirstamp)
+etc/icons/octave.desktop: etc/icons/octave.desktop.in | etc/icons/$(octave_dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(SED) < $< > $@-t \
 	  -e "s|%OCTAVE_IMAGEDIR%|${imagedir}|" \
--- a/libgui/mk-default-qt-settings.in	Wed Mar 02 16:46:23 2016 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2016 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-SED=${SED:-sed}
-
-DEFAULT_TERMINAL_FONT = @DEFAULT_TERMINAL_FONT@
-DEFAULT_TERMINAL_FONT_SIZE = @DEFAULT_TERMINAL_FONT_SIZE@
-
-$(SED) \
-  -e "s|%DEFAULT_TERMINAL_FONT%|${DEFAULT_TERMINAL_FONT}|" \
-  -e "s|%DEFAULT_TERMINAL_FONT_SIZE%|${DEFAULT_TERMINAL_FONT_SIZE}|"
--- a/libgui/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/libgui/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -70,14 +70,8 @@
 
 octlocale_DATA += $(LOCALES)
 
-define gen-default-qt-settings
-  rm -f $@-t $@ && \
-  $(SHELL) libgui/mk-default-qt-settings < $< > $@-t && \
-  mv $@-t $@
-endef
-
-libgui/default-qt-settings: libgui/default-qt-settings.in libgui/mk-default-qt-settings | libgui/$(octave_dirstamp)
-	$(AM_V_GEN)$(gen-default_qt_settings)
+libgui/default-qt-settings: libgui/default-qt-settings.in build-aux/mk-default-qt-settings.sh | libgui/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule build-aux/mk-default-qt-settings.sh)
 
 DIRSTAMP_FILES += \
   libgui/$(octave_dirstamp)
--- a/libinterp/build-env.h	Wed Mar 02 16:46:23 2016 -0500
+++ b/libinterp/build-env.h	Fri Mar 04 12:51:00 2016 -0500
@@ -33,10 +33,6 @@
   {
     extern OCTAVE_API octave_scalar_map features (void);
 
-    extern const char *ALL_CFLAGS;
-    extern const char *ALL_CXXFLAGS;
-    extern const char *ALL_FFLAGS;
-    extern const char *ALL_LDFLAGS;
     extern const char *AMD_CPPFLAGS;
     extern const char *AMD_LDFLAGS;
     extern const char *AMD_LIBS;
@@ -116,7 +112,6 @@
     extern const char *LEX;
     extern const char *LFLAGS;
     extern const char *LIBEXT;
-    extern const char *LIBFLAGS;
     extern const char *LIBOCTAVE;
     extern const char *LIBOCTINTERP;
     extern const char *LIBS;
--- a/libinterp/build-env.in.cc	Wed Mar 02 16:46:23 2016 -0500
+++ b/libinterp/build-env.in.cc	Fri Mar 04 12:51:00 2016 -0500
@@ -31,14 +31,6 @@
 {
   namespace build_env
   {
-    const char *ALL_CFLAGS = %OCTAVE_CONF_ALL_CFLAGS%;
-
-    const char *ALL_CXXFLAGS = %OCTAVE_CONF_ALL_CXXFLAGS%;
-
-    const char *ALL_FFLAGS = %OCTAVE_CONF_ALL_FFLAGS%;
-
-    const char *ALL_LDFLAGS = %OCTAVE_CONF_ALL_LDFLAGS%;
-
     const char *AMD_CPPFLAGS = %OCTAVE_CONF_AMD_CPPFLAGS%;
 
     const char *AMD_LDFLAGS = %OCTAVE_CONF_AMD_LDFLAGS%;
@@ -197,8 +189,6 @@
 
     const char *LIBEXT = %OCTAVE_CONF_LIBEXT%;
 
-    const char *LIBFLAGS = %OCTAVE_CONF_LIBFLAGS%;
-
     const char *LIBOCTAVE = %OCTAVE_CONF_LIBOCTAVE%;
 
     const char *LIBOCTINTERP = %OCTAVE_CONF_LIBOCTINTERP%;
--- a/libinterp/corefcn/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/libinterp/corefcn/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -7,7 +7,7 @@
   libinterp/corefcn/LSODE-opts.cc \
   libinterp/corefcn/Quad-opts.cc
 
-$(OPT_HANDLERS): libinterp/corefcn/%.cc : liboctave/numeric/%.in
+$(OPT_HANDLERS): libinterp/corefcn/%.cc : liboctave/numeric/%.in | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	$(PERL) $(srcdir)/build-aux/mk-opts.pl --opt-handler-fcns $< > $@-t && \
 	mv $@-t $@
@@ -273,7 +273,7 @@
 
 ## Special rules for FreeType .df files so that not all .df files are built
 ## with FT2_CPPFLAGS, FONTCONFIG_CPPFLAGS
-$(COREFCN_FT2_DF) : libinterp/corefcn/%.df : libinterp/corefcn/%.cc $(GENERATED_MAKE_BUILTINS_INCS) octave-config.h
+$(COREFCN_FT2_DF) : libinterp/corefcn/%.df : libinterp/corefcn/%.cc $(GENERATED_MAKE_BUILTINS_INCS) octave-config.h | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@-t1 $@ && \
 	$(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	  $(libinterp_corefcn_libcorefcn_la_CPPFLAGS) $(CPPFLAGS) \
@@ -285,23 +285,20 @@
 
 ## Special rules for sources which must be built before rest of compilation.
 
-## defaults.h and graphics.h must depend on Makefile.  Calling configure
-## may change default/config values.  However, calling configure will also
-## regenerate the Makefiles from Makefile.am and trigger the rules below.
-libinterp/corefcn/defaults.h: libinterp/corefcn/defaults.in.h Makefile
-	$(AM_V_GEN)$(do_subst_default_vals)
+libinterp/corefcn/defaults.h: libinterp/corefcn/defaults.in.h build-aux/subst-default-vals.sh | libinterp/corefcn/$(octave-dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-default-vals.sh)
 
-libinterp/corefcn/graphics.h: libinterp/corefcn/graphics.in.h libinterp/genprops.awk Makefile
+libinterp/corefcn/graphics.h: libinterp/corefcn/graphics.in.h libinterp/genprops.awk | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) -f $(srcdir)/libinterp/genprops.awk $< > $@-t && \
-	$(simple_move_if_change_rule)
+	mv $@-t $@
 
-libinterp/corefcn/graphics-props.cc: libinterp/corefcn/graphics.in.h libinterp/genprops.awk Makefile
+libinterp/corefcn/graphics-props.cc: libinterp/corefcn/graphics.in.h libinterp/genprops.awk | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) -v emit_graphics_props=1 -f $(srcdir)/libinterp/genprops.awk $< > $@-t && \
-	$(simple_move_if_change_rule)
+	mv $@-t $@
 
-libinterp/corefcn/oct-errno.cc: libinterp/corefcn/oct-errno.in.cc Makefile
+libinterp/corefcn/oct-errno.cc: libinterp/corefcn/oct-errno.in.cc | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	if test -n "$(PERL)"; then \
 	  $(SHELL) $(srcdir)/libinterp/mk-errno-list --perl "$(PERL)" < $< > $@-t; \
@@ -310,24 +307,20 @@
 	else \
 	  $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \
 	fi && \
-	$(simple_move_if_change_rule)
+	mv $@-t $@
 
-libinterp/corefcn/mxarray.h: libinterp/corefcn/mxarray.in.h Makefile
-	$(AM_V_GEN)rm -f $@-t && \
-	$(SED) < $< \
-	  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
-	  -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > $@-t && \
-	$(simple_move_if_change_rule)
+libinterp/corefcn/mxarray.h: libinterp/corefcn/mxarray.in.h build-aux/mk-mxarray-h.sh | libinterp/corefcn/$(octave-dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/mk-mxarray-h.sh)
 
-libinterp/corefcn/oct-tex-lexer.ll: libinterp/corefcn/oct-tex-lexer.in.ll libinterp/corefcn/oct-tex-symbols.in Makefile.am
+libinterp/corefcn/oct-tex-lexer.ll: libinterp/corefcn/oct-tex-lexer.in.ll libinterp/corefcn/oct-tex-symbols.in | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) 'BEGIN { print "/* DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-lexer.in.ll and oct-tex-symbols.in. */"; } /^@SYMBOL_RULES@$$/ { count = 0; while (getline < "$(srcdir)/libinterp/corefcn/oct-tex-symbols.in") { if ($$0 !~ /^#.*/ && NF == 3) { printf("\"\\\\%s\" { yylval->sym = %d; return SYM; }\n", $$1, count); count++; } } getline } ! /^@SYMBOL_RULES@$$/ { print }' $< > $@-t && \
-	$(simple_move_if_change_rule)
+	mv $@-t $@
 
-libinterp/corefcn/oct-tex-symbols.cc: libinterp/corefcn/oct-tex-symbols.in Makefile.am
+libinterp/corefcn/oct-tex-symbols.cc: libinterp/corefcn/oct-tex-symbols.in | libinterp/corefcn/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(AWK) 'BEGIN { print "// DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-symbols.in."; print "static uint32_t symbol_codes[][2] = {"; count = 0; } END { print "};"; printf("static int num_symbol_codes = %d;\n", count); } !/^#/ && (NF == 3) { printf("  { %s, %s },\n", $$2, $$3); count++; }' $< > $@-t && \
-	$(simple_move_if_change_rule)
+	mv $@-t $@
 
 libinterp/corefcn/txt-eng.cc: libinterp/corefcn/oct-tex-symbols.cc
 libinterp/corefcn/oct-tex-lexer.cc: LEX_OUTPUT_ROOT := lex.octave_tex_
--- a/libinterp/corefcn/toplev.cc	Wed Mar 02 16:46:23 2016 -0500
+++ b/libinterp/corefcn/toplev.cc	Fri Mar 04 12:51:00 2016 -0500
@@ -1466,10 +1466,6 @@
 
   static const build_info_struct build_info[] =
     {
-      { "ALL_CFLAGS", octave::build_env::ALL_CFLAGS },
-      { "ALL_CXXFLAGS", octave::build_env::ALL_CXXFLAGS },
-      { "ALL_FFLAGS", octave::build_env::ALL_FFLAGS },
-      { "ALL_LDFLAGS", octave::build_env::ALL_LDFLAGS },
       { "AMD_CPPFLAGS", octave::build_env::AMD_CPPFLAGS },
       { "AMD_LDFLAGS", octave::build_env::AMD_LDFLAGS },
       { "AMD_LIBS", octave::build_env::AMD_LIBS },
@@ -1547,7 +1543,6 @@
       { "LEXLIB", octave::build_env::LEXLIB },
       { "LFLAGS", octave::build_env::LFLAGS },
       { "LIBEXT", octave::build_env::LIBEXT },
-      { "LIBFLAGS", octave::build_env::LIBFLAGS },
       { "LIBOCTAVE", octave::build_env::LIBOCTAVE },
       { "LIBOCTINTERP", octave::build_env::LIBOCTINTERP },
       { "LIBS", octave::build_env::LIBS },
--- a/libinterp/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/libinterp/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -204,7 +204,7 @@
 
 ALL_DEF_FILES = $(SRC_DEF_FILES) $(DLDFCN_DEF_FILES)
 
-$(SRC_DEF_FILES): libinterp/mkdefs Makefile
+$(SRC_DEF_FILES): libinterp/mkdefs
 
 $(DEF_FILES): $(OPT_HANDLERS) $(LIBOCTAVE_OPT_INC)
 
@@ -245,37 +245,23 @@
 ## Special rules:
 ## Mostly for sources which must be built before rest of compilation.
 
-## build-env.cc must depend on Makefile.
-## Calling configure may change default/config values.
-## However, calling configure will also regenerate the Makefiles from
-## Makefile.am and trigger the rules below.
-libinterp/build-env.cc: libinterp/build-env.in.cc Makefile
-	$(AM_V_GEN)$(do_subst_config_vals)
+libinterp/build-env.cc: libinterp/build-env.in.cc build-aux/subst-config-vals.sh | libinterp/$(octave-dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-config-vals.sh)
 
-libinterp/build-env-features.cc: config.h libinterp/build-env-features.sh
+libinterp/build-env-features.cc: config.h libinterp/build-env-features.sh | libinterp/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(SHELL) $(srcdir)/libinterp/build-env-features.sh $< > $@-t && \
 	$(simple_move_if_change_rule)
 
-libinterp/version.h: libinterp/version.in.h Makefile
-	$(AM_V_GEN)rm -f $@-t && \
-	$(SED) < $< \
-	  -e "s|%NO_EDIT_WARNING%|DO NOT EDIT!  Generated automatically from $(<F) by Make.|" \
-	  -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \
-	  -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \
-          -e "s|%OCTAVE_MAJOR_VERSION%|${OCTAVE_MAJOR_VERSION}|" \
-          -e "s|%OCTAVE_MINOR_VERSION%|${OCTAVE_MINOR_VERSION}|" \
-          -e "s|%OCTAVE_PATCH_VERSION%|${OCTAVE_PATCH_VERSION}|" \
-	  -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \
-	  -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|" > $@-t && \
-	$(simple_move_if_change_rule)
+libinterp/version.h: libinterp/version.in.h build-aux/mk-version-h.sh | libinterp/$(octave-dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/mk-version-h.sh)
 
-libinterp/builtins.cc: $(DEF_FILES) libinterp/mkbuiltins
+libinterp/builtins.cc: $(DEF_FILES) libinterp/mkbuiltins | libinterp/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(SHELL) $(srcdir)/libinterp/mkbuiltins --source $(DEF_FILES) > $@-t && \
 	$(simple_move_if_change_rule)
 
-libinterp/builtin-defun-decls.h: $(SRC_DEF_FILES) libinterp/mkbuiltins
+libinterp/builtin-defun-decls.h: $(SRC_DEF_FILES) libinterp/mkbuiltins | libinterp/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(SHELL) $(srcdir)/libinterp/mkbuiltins --header $(SRC_DEF_FILES) > $@-t && \
 	$(simple_move_if_change_rule)
@@ -283,7 +269,7 @@
 if AMCOND_ENABLE_DYNAMIC_LINKING
 DLDFCN_PKG_ADD_FILE = libinterp/dldfcn/PKG_ADD
 
-libinterp/dldfcn/PKG_ADD: $(DLDFCN_DEF_FILES) libinterp/mk-pkg-add
+libinterp/dldfcn/PKG_ADD: $(DLDFCN_DEF_FILES) libinterp/mk-pkg-add | libinterp/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t && \
 	$(SHELL) $(srcdir)/libinterp/mk-pkg-add $(DLDFCN_DEF_FILES) > $@-t && \
 	$(simple_move_if_change_rule)
@@ -295,7 +281,7 @@
 
 libinterp/DOCSTRINGS: | libinterp/.DOCSTRINGS
 
-libinterp/.DOCSTRINGS: $(ALL_DEF_FILES) libinterp/gendoc.pl
+libinterp/.DOCSTRINGS: $(ALL_DEF_FILES) libinterp/gendoc.pl | libinterp/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/libinterp/DOCSTRINGS ] && [ ! -f DOCSTRINGS ]; then \
 		cp $(srcdir)/libinterp/DOCSTRINGS libinterp/DOCSTRINGS; \
--- a/liboctave/cruft/mkf77def.in	Wed Mar 02 16:46:23 2016 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#! /bin/sh
-#
-# Copyright (C) 2006-2015 John W. Eaton
-#
-# This file is part of Octave.
-#
-# Octave is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 3 of the License, or (at
-# your option) any later version.
-#
-# Octave is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Octave; see the file COPYING.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-SED=${SED:-sed}
-AWK=${AWK:-awk}
-
-F77_TOLOWER="@F77_APPEND_UNDERSCORE@"
-F77_APPEND_UNDERSCORE="@F77_APPEND_UNDERSCORE@"
-F77_APPEND_EXTRA_UNDERSCORE="@F77_APPEND_EXTRA_UNDERSCORE@"
-
-if test x$F77_TOLOWER = xyes; then
-  case_cmd=tolower
-else
-  case_cmd=toupper
-fi
-
-if test x$F77_APPEND_UNDERSCORE = xyes; then
-  uscore=_
-else
-  uscore=
-fi
-
-if test x$F77_APPEND_EXTRA_UNDERSCORE = xyes; then
-  awkcmd="$AWK '{ if (\$0 ~ /_/) extra = \"_\"; else extra = \"\"; printf (\"%s%s%s\n\", $case_cmd (\$0), \"$uscore\", extra); }'"
-else
-  awkcmd="$AWK '{ printf (\"%s%s\n\", tolower (\$0), \"$uscore\"); }'"
-fi
-
-if [ $# -gt 1 ]; then
-  srcdir="$1"
-  shift
-fi
-
-echo EXPORTS
-for arg
-do
-  case "$arg" in
-    *.f)
-      ## There are TABS in this sed command.
-      $SED -n -e 'y/ABCDEFGHIJLKMNOPQRSTUVWXYZ/abcdefghijlkmnopqrstuvwxyz/; s/^\(      \|	\)[ 	]*\(.*function\|subroutine\|entry\)[ 	]*\([^ 	(]*\).*$/\3/p' "$srcdir/$arg" | eval $awkcmd
-    ;;
-  esac
-done
--- a/liboctave/cruft/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/liboctave/cruft/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -24,19 +24,13 @@
 include liboctave/cruft/slatec-err/module.mk
 include liboctave/cruft/slatec-fn/module.mk
 
-define gen-cruft-def
-  rm -f $@-t $@ && \
-  $(SHELL) liboctave/cruft/mkf77def $(srcdir) $(liboctave_cruft_libcruft_la_SOURCES) > $@-t && \
-  mv $@-t $@
-endef
-
-## Special rules for files which must be built before compilation
-liboctave/cruft/cruft.def: $(liboctave_cruft_libcruft_la_SOURCES) liboctave/cruft/mkf77def
-	$(AM_V_GEN)$(gen-cruft-def)
+liboctave/cruft/cruft.def: $(liboctave_cruft_libcruft_la_SOURCES) build-aux/mk-f77-def.sh
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(SHELL) build-aux/mk-f77-def.sh $(srcdir) $(liboctave_cruft_libcruft_la_SOURCES) > $@-t && \
+	mv $@-t $@
 
 liboctave_DISTCLEANFILES += \
   liboctave/cruft/cruft.def \
-  liboctave/cruft/mkf77def \
   liboctave/cruft/ranlib/ranlib.def \
   $(nodist_liboctave_cruft_libcruft_la_SOURCES)
 
@@ -51,5 +45,3 @@
 liboctave_cruft_libcruft_la_CXXFLAGS = $(liboctave_liboctave_la_CXXFLAGS)
 
 liboctave_liboctave_la_LIBADD += liboctave/cruft/libcruft.la
-
-liboctave_EXTRA_DIST += liboctave/cruft/mkf77def.in
--- a/liboctave/cruft/ranlib/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/liboctave/cruft/ranlib/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -41,17 +41,12 @@
 
 liboctave_cruft_ranlib_libranlib_la_DEPENDENCIES = liboctave/cruft/ranlib/ranlib.def
 
-define gen-ranlib-def
-  rm -f $@-t $@ && \
-  $(MKDIR_P) liboctave/cruft/ranlib && \
-  $(SHELL) liboctave/cruft/mkf77def $(srcdir) $(RANLIB_SRC) > $@-t && \
-  mv $@-t $@
-endef
-
 ## Special rules for files which must be built before compilation
 ## ranlib directory may not exist in VPATH build; create it if necessary.
-liboctave/cruft/ranlib/ranlib.def: $(RANLIB_SRC) liboctave/cruft/mkf77def
-	$(AM_V_GEN)$(gen-ranlib-def)
+liboctave/cruft/ranlib/ranlib.def: $(RANLIB_SRC) build-aux/mk-f77-def.sh | liboctave/cruft/ranlib/$(octave-dirstamp)
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	$(SHELL) build-aux/mk-f77-def.sh $(srcdir) $(RANLIB_SRC) > $@-t && \
+	mv $@-t $@
 
 liboctave_liboctave_la_LIBADD += liboctave/cruft/ranlib/libranlib.la
 
@@ -64,3 +59,5 @@
   liboctave/cruft/ranlib/tstbot.for \
   liboctave/cruft/ranlib/tstgmn.for \
   liboctave/cruft/ranlib/tstmid.for
+
+DIRSTAMP_FILES += liboctave/cruft/ranlib/$(octave-dirstamp)
--- a/liboctave/cruft/slatec-fn/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/liboctave/cruft/slatec-fn/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -68,22 +68,14 @@
   liboctave/cruft/slatec-fn/derfc.f \
   liboctave/cruft/slatec-fn/erfc.f
 
-## slatec-fn directory may not exist in VPATH build; create it if necessary.
+liboctave/cruft/slatec-fn/erfc.f: liboctave/cruft/slatec-fn/erfc.in.f build-aux/subst-f77-isnan-macro.sh | liboctave/cruft/slatec-fn/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-f77-isnan-macro.sh)
 
-define do-subst-isnan-macro
-  rm -f $@-t $@ && \
-  $(MKDIR_P) liboctave/cruft/slatec-fn && \
-  $(SED) -e "${F77_ISNAN_MACRO}" < $< > $@-t && \
-  mv $@-t $@
-endef
-
-liboctave/cruft/slatec-fn/erfc.f: liboctave/cruft/slatec-fn/erfc.in.f Makefile
-	$(AM_V_GEN)$(do-subst-isnan-macro)
-
-liboctave/cruft/slatec-fn/derfc.f: liboctave/cruft/slatec-fn/derfc.in.f Makefile
-	$(AM_V_GEN)$(do-subst-isnan-macro)
+liboctave/cruft/slatec-fn/derfc.f: liboctave/cruft/slatec-fn/derfc.in.f build-aux/subst-f77-isnan-macro.sh | liboctave/cruft/slatec-fn/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-f77-isnan-macro.sh)
 
 liboctave_EXTRA_DIST += \
   liboctave/cruft/slatec-fn/derfc.in.f \
   liboctave/cruft/slatec-fn/erfc.in.f
 
+DIRSTAMP_FILES += liboctave/cruft/slatec-fn/$(octave_dirstamp)
--- a/m4/acinclude.m4	Wed Mar 02 16:46:23 2016 -0500
+++ b/m4/acinclude.m4	Fri Mar 04 12:51:00 2016 -0500
@@ -1322,10 +1322,9 @@
 dnl
 AC_DEFUN([OCTAVE_CONFIG_MOVE_IF_CHANGE_FILES], [
   m4_foreach_w([elt], [$1], [
-    AC_CONFIG_FILES(elt[-tmp:]elt[.in])
+    AC_CONFIG_FILES(elt[-tmp:]patsubst(elt, [.sh$], [.in.sh]))
     AC_CONFIG_COMMANDS(elt,
     [$SHELL $srcdir/build-aux/move-if-change ]elt[-tmp ]elt)])])
-
 dnl
 dnl Check if the C++ library has the bit_and, bit_or, and bit_xor
 dnl templates defined.
--- a/scripts/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/scripts/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -97,8 +97,8 @@
 $(foreach d, $(FCN_FILE_DIRS), $(eval $(call PKG_ADD_FILE_TEMPLATE, $(d),$(subst /,_,$(subst -,_,$(d))))))
 
 define GEN_FCN_FILES_TEMPLATE
-$(1): $(1:.m=.in) Makefile $(dir $(1))$(octave_dirstamp)
-	$$(AM_V_GEN)$$(do_subst_config_vals)
+$(1): $(1:.m=.in) build-aux/subst-config-vals.sh $(dir $(1))$(octave_dirstamp)
+	$$(AM_V_GEN)$$(call simple-filter-rule,build-aux/subst-config-vals.sh)
 endef
 
 $(foreach f, $(GEN_FCN_FILES), $(eval $(call GEN_FCN_FILES_TEMPLATE, $(f))))
@@ -109,7 +109,7 @@
 
 scripts/DOCSTRINGS: | scripts/.DOCSTRINGS
 
-scripts/.DOCSTRINGS: $(FCN_FILES) $(GEN_FCN_FILES) scripts/mkdoc.pl Makefile
+scripts/.DOCSTRINGS: $(FCN_FILES) $(GEN_FCN_FILES) scripts/mkdoc.pl | scripts/$(octave-dirstamp)
 	$(AM_V_GEN)rm -f $@-t $@ && \
 	if [ "x$(srcdir)" != "x." ] && [ -f $(srcdir)/scripts/DOCSTRINGS ] && [ ! -f scripts/DOCSTRINGS ]; then \
 		cp $(srcdir)/scripts/DOCSTRINGS scripts/DOCSTRINGS; \
--- a/src/module.mk	Wed Mar 02 16:46:23 2016 -0500
+++ b/src/module.mk	Fri Mar 04 12:51:00 2016 -0500
@@ -168,8 +168,8 @@
 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$(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)
+src/$(host_triplet)-mkoctfile.cc: src/mkoctfile.in.cc build-aux/subst-cross-config-vals.sh | src/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-cross-config-vals.sh)
 
 ## Building cross octave-config.
 
@@ -178,8 +178,8 @@
 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$(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)
+src/$(host_triplet)-octave-config.cc: src/octave-config.in.cc build-aux/subst-default-vals.sh | src/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-default-vals.sh)
 
 src-mostlyclean-local:
 	-rm -f $(OCTAVE_CROSS_TOOLS)
@@ -190,18 +190,14 @@
 
 endif
 
-src/octave-config.cc: src/octave-config.in.cc Makefile | src/$(octave_dirstamp)
-	$(AM_V_GEN)$(do_subst_default_vals)
-
-src/mkoctfile.cc: src/mkoctfile.in.cc Makefile | src/$(octave_dirstamp)
-	$(AM_V_GEN)$(do_subst_config_vals)
+src/octave-config.cc: src/octave-config.in.cc build-aux/subst-default-vals.sh | src/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-default-vals.sh)
 
-## main.cc must depend on Makefile.  Calling configure may change
-## default/config values.  However, calling configure will also
-## regenerate the Makefiles from Makefile.am and trigger the rules below.
+src/mkoctfile.cc: src/mkoctfile.in.cc build-aux/subst-config-vals.sh | src/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-config-vals.sh)
 
-src/main.cc: src/main.in.cc Makefile | src/$(octave_dirstamp)
-	$(AM_V_GEN)$(do_subst_default_vals)
+src/main.cc: src/main.in.cc build-aux/subst-default-vals.sh | src/$(octave_dirstamp)
+	$(AM_V_GEN)$(call simple-filter-rule,build-aux/subst-default-vals.sh)
 
 ALL_LOCAL_TARGETS += $(OCTAVE_VERSION_LINKS) $(OCTAVE_CROSS_TOOLS)