- Issue #17029: Let h2py search the multiarch system include directory.
diff --git a/Makefile.pre.in b/Makefile.pre.in
index c014236..0b1cfcd 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -97,6 +97,9 @@
 # Machine-dependent subdirectories
 MACHDEP=	@MACHDEP@
 
+# Multiarch directory (may be empty)
+MULTIARCH=	@MULTIARCH@
+
 # Install prefix for architecture-independent files
 prefix=		@prefix@
 
@@ -1040,6 +1043,7 @@
 	export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
 	export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
 	export EXE; EXE="$(BUILDEXE)"; \
+	if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
 	cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
 
 python-config: $(srcdir)/Misc/python-config.in
diff --git a/Misc/NEWS b/Misc/NEWS
index 4c95a12..43864ae 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -861,6 +861,8 @@
 Build
 -----
 
+- Issue #17029: Let h2py search the multiarch system include directory.
+
 - Issue #16953: Fix socket module compilation on platforms with
   HAVE_BROKEN_POLL. Patch by Jeffrey Armstrong.
 
diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
index 45aa439..4f871d9 100755
--- a/Tools/scripts/h2py.py
+++ b/Tools/scripts/h2py.py
@@ -50,6 +50,11 @@
         searchdirs=os.environ['INCLUDE'].split(';')
     except KeyError:
         searchdirs=['/usr/include']
+        try:
+            searchdirs.insert(0, os.path.join('/usr/include',
+                                              os.environ['MULTIARCH']))
+        except KeyError:
+            pass
 
 def main():
     global filedict
diff --git a/configure b/configure
index 1f00599..00a1007 100755
--- a/configure
+++ b/configure
@@ -688,6 +688,7 @@
 DLLLIBRARY
 LDLIBRARY
 LIBRARY
+MULTIARCH
 BUILDEXEEXT
 EGREP
 GREP
@@ -4750,6 +4751,9 @@
     esac;;
 esac
 
+MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+
+
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBRARY" >&5
diff --git a/configure.ac b/configure.ac
index 5ae0d5a..379db32 100644
--- a/configure.ac
+++ b/configure.ac
@@ -593,6 +593,9 @@
     esac;;
 esac
 
+MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+AC_SUBST(MULTIARCH)
+
 
 AC_SUBST(LIBRARY)
 AC_MSG_CHECKING(LIBRARY)