Issue #28444: Fix missing extensions modules when cross compiling.
diff --git a/Modules/makesetup b/Modules/makesetup
index 3297b78..e204a05 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -29,6 +29,7 @@
 #
 # Copying Makefile.pre to Makefile:
 # - insert an identifying comment at the start
+# - replace _MODNAMES_ by the list of modules from Setup
 # - replace _MODOBJS_ by the list of objects from Setup (except for
 #   Setup files after a -n option)
 # - replace _MODLIBS_ by the list of libraries from Setup
@@ -110,6 +111,7 @@
 # Rules appended by makedepend
 " >$rulesf
 	DEFS=
+	NAMES=
 	MODS=
 	SHAREDMODS=
 	OBJS=
@@ -181,7 +183,7 @@
 			*.*)		echo 1>&2 "bad word $arg in $line"
 					exit 1;;
 			-u)		skip=libs; libs="$libs -u";;
-			[a-zA-Z_]*)	mods="$mods $arg";;
+			[a-zA-Z_]*)	NAMES="$NAMES $arg"; mods="$mods $arg";;
 			*)		echo 1>&2 "bad word $arg in $line"
 					exit 1;;
 			esac
@@ -280,6 +282,7 @@
 		echo "1i\\" >$sedf
 		str="# Generated automatically from $makepre by makesetup."
 		echo "$str" >>$sedf
+		echo "s%_MODNAMES_%$NAMES%" >>$sedf
 		echo "s%_MODOBJS_%$OBJS%" >>$sedf
 		echo "s%_MODLIBS_%$LIBS%" >>$sedf
 		echo "/Definitions added by makesetup/a$NL$NL$DEFS" >>$sedf