--- /dev/null
+From: David Michael <fedo...@gmail.com>\r
+To: wmaker-dev@googlegroups.com\r
+Subject: [PATCH] configure: Allow changing default search paths\r
+Date: Thu, 16 Jan 2020 14:59:33 -0500\r
+\r
+This changes the behavior of the --with-{inc,lib}s-from arguments\r
+to replace the default paths instead of adding to them. This is\r
+required when cross-compiling in a sysroot, since the default paths\r
+will include files from the host system which can have an\r
+incompatible architecture.\r
+---\r
+1. What happened: could not compile\r
+\r
+2. Detailed description of what happened:\r
+Cross-compiling in a sysroot searches for development files on the\r
+host. The build fails when building between two very different\r
+architectures.\r
+\r
+3. How to reproduce the bug, if known:\r
+Cross-compile in a sysroot (from x86_64 to ppc with Gentoo in my case).\r
+\r
+6. The error occurred during: compilation\r
+\r
+8. Error messages output:\r
+There are about two megabytes of errors about float128 not being defined\r
+for the architecture, from including the x86_64 headers in /usr/include\r
+for the ppc compiler.\r
+\r
+9. Fix, if known:\r
+This commit makes it build when passing --with-{inc,lib}s-from= and it\r
+shouldn't be a big behavior change for most cases.\r
+\r
+10. Other Notes:\r
+I didn't dig into the history of those search variables, but a better\r
+fix might be to just remove them entirely. It doesn't seem to do any\r
+good to redundantly add the default search paths, or if includedir or\r
+libdir were changed, the usual CPPFLAGS and LDFLAGS environment\r
+variables could set the search paths.\r
+\r
+ configure.ac | 8 ++------\r
+ 1 file changed, 2 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/configure.ac b/configure.ac\r
+index a19acce5..0129f4e7 100644\r
+--- a/configure.ac\r
++++ b/configure.ac\r
+@@ -284,18 +284,14 @@ _bindir=`eval echo $_bindir`\r
+ _libdir=`eval echo $libdir`\r
+ _libdir=`eval echo $_libdir`\r
+ \r
+-lib_search_path='-L${libdir}'\r
+-\r
+-inc_search_path='-I${includedir}'\r
+-\r
+ dnl ===============================================\r
+ dnl Specify paths to look for libraries and headers\r
+ dnl ===============================================\r
+ AC_ARG_WITH(libs-from, AS_HELP_STRING([--with-libs-from], [pass compiler flags to look for libraries]),\r
+- [lib_search_path="$withval $lib_search_path"])\r
++ [lib_search_path="$withval"], [lib_search_path='-L${libdir}'])\r
+ \r
+ AC_ARG_WITH(incs-from, AS_HELP_STRING([--with-incs-from], [pass compiler flags to look for header files]),\r
+- [inc_search_path="$withval $inc_search_path"])\r
++ [inc_search_path="$withval"], [inc_search_path='-I${includedir}'])\r
+ \r
+ \r
+ dnl Features Configuration\r
+-- \r
+2.21.1\r
+\r