diff --git a/configure b/configure
index c31220e8e75..8a3e7026f0b 100755
--- a/configure
+++ b/configure
@@ -3541,17 +3541,19 @@ esac
 # Only allow gdbserver on some systems.
 if test -d ${srcdir}/gdbserver; then
     if test x$enable_gdbserver = x; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbserver support" >&5
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbserver support" >&5
 $as_echo_n "checking for gdbserver support... " >&6; }
-	. ${srcdir}/gdbserver/configure.host
-	if test x$build_gdbserver = xyes; then
-	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	else
-            noconfigdirs="$noconfigdirs gdbserver"
+	if (srcdir=${srcdir}/gdbserver; \
+		. ${srcdir}/configure.srv; \
+		test -n "$UNSUPPORTED")
+	then
 	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
-        fi
+	    noconfigdirs="$noconfigdirs gdbserver"
+	else
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	fi
     fi
 fi
 
diff --git a/configure.ac b/configure.ac
index 40669228e3c..35a9c1867d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -785,14 +785,16 @@ esac
 # Only allow gdbserver on some systems.
 if test -d ${srcdir}/gdbserver; then
     if test x$enable_gdbserver = x; then
-        AC_MSG_CHECKING([for gdbserver support])
-	. ${srcdir}/gdbserver/configure.host
-	if test x$build_gdbserver = xyes; then
-	    AC_MSG_RESULT([yes])
-	else
-            noconfigdirs="$noconfigdirs gdbserver"
+	AC_MSG_CHECKING([for gdbserver support])
+	if (srcdir=${srcdir}/gdbserver; \
+		. ${srcdir}/configure.srv; \
+		test -n "$UNSUPPORTED")
+	then
 	    AC_MSG_RESULT([no])
-        fi
+	    noconfigdirs="$noconfigdirs gdbserver"
+	else
+	    AC_MSG_RESULT([yes])
+	fi
     fi
 fi
 
diff --git a/gdbserver/configure.host b/gdbserver/configure.host
deleted file mode 100644
index 86d3a80148d..00000000000
--- a/gdbserver/configure.host
+++ /dev/null
@@ -1,111 +0,0 @@
-# Configure helper for gdbserver
-# Copyright (C) 2000-2020 Free Software Foundation, Inc.
-#
-# This file is part of GDB.
-#
-# This program 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.
-#
-# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Source this to determine whether gdbserver can be built for a given
-# host.  This will set the variable "build_gdbserver".  The variable
-# "host" must be set before sourcing.
-
-build_gdbserver=
-case "$host" in
-aarch64*-*-linux*)
-	# Target: AArch64 linux
-	build_gdbserver=yes
-	;;
-
-arm*-wince-pe | arm*-*-mingw32ce*)
-	# Target: ARM based machine running Windows CE (win32)
-	build_gdbserver=yes
-	;;
-arm*-*-linux*)
-	# Target: ARM based machine running GNU/Linux
-	build_gdbserver=yes
-	;;
-bfin-*-*linux*)
-	# Target: Blackfin Linux
-	gdb_target_obs="bfin-tdep.o bfin-linux-tdep.o linux-tdep.o"
-	build_gdbserver=yes
-	;;
-i[34567]86-*-nto*)
-	# Target: Intel 386 running qnx6.
-	build_gdbserver=yes
-	;;
-i[34567]86-*-linux*)
-	# Target: Intel 386 running GNU/Linux
-	build_gdbserver=yes
-	;;
-i[34567]86-*-cygwin*)
-	# Target: Intel 386 running win32
-	build_gdbserver=yes
-	;;
-i[34567]86-*-mingw32*)
-	# Target: Intel 386 running win32
-	build_gdbserver=yes
-	;;
-ia64-*-linux*)
-	# Target: Intel IA-64 running GNU/Linux
-	build_gdbserver=yes
-	;;
-m32r*-*-linux*)
-	# Target: Renesas M32R running GNU/Linux
-	build_gdbserver=yes
-	;;
-m68*-*-linux*)
-	# Target: Motorola m68k with a.out and ELF
-	build_gdbserver=yes
-	;;
-mips*-*-linux*)
-	# Target: Linux/MIPS
-	build_gdbserver=yes
-	;;
-powerpc*-*-linux*)
-	# Target: PowerPC running Linux
-	build_gdbserver=yes
-	;;
-s390*-*-linux*)
-	# Target: S390 running Linux
-	build_gdbserver=yes
-	;;
-sh*-*-linux*)
-	# Target: GNU/Linux Super-H
-	build_gdbserver=yes
-	;;
-sparc-*-linux*)
-	# Target: GNU/Linux SPARC
-	build_gdbserver=yes
-	;;
-sparc64-*-linux*)
-	# Target: GNU/Linux UltraSPARC
-	build_gdbserver=yes
-	;;
-tilegx-*-linux*)
-	# Target: TILE-Gx
-	build_gdbserver=yes
-	;;
-x86_64-*-linux*)
-	# Target: GNU/Linux x86-64
-	build_gdbserver=yes
-	;;
-x86_64-*-mingw* | x86_64-*-cygwin*)
-        # Target: MingW/amd64
-	build_gdbserver=yes
-        ;;
-xtensa*-*-*linux*)
-	# Target: GNU/Linux Xtensa
-	build_gdbserver=yes
-	;;
-esac
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 8437c1ace06..52264be8ecd 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -1,6 +1,8 @@
 # Mappings from configuration triplets to gdbserver build options.
 # This is invoked from the autoconf-generated configure script, to
 # produce the appropriate Makefile substitutions.
+# It is also sourced by the top level configure script, to determine
+# whether gdbserver is supported on a given host.
 
 # This file sets the following shell variables:
 #   srv_regobj		The register protocol appropriate for this target.
@@ -12,6 +14,7 @@
 #			gdbserver in this configuration.
 #   ipa_obj		Any other target-specific modules appropriate
 #			for this target's in-process agent.
+#   UNSUPPORTED         Set to 1 if the host is unsupported.
 #
 # In addition, on GNU/Linux the following shell variables will be set:
 #   srv_linux_regsets	Set to "yes" if ptrace(PTRACE_GETREGS) and friends
@@ -30,9 +33,9 @@ ipa_ppc_linux_regobj="powerpc-32l-ipa.o powerpc-altivec32l-ipa.o powerpc-vsx32l-
 # these files over and over again.
 srv_linux_obj="linux-low.o nat/linux-osdata.o nat/linux-procfs.o nat/linux-ptrace.o nat/linux-waitpid.o nat/linux-personality.o nat/linux-namespaces.o fork-child.o nat/fork-inferior.o"
 
-# Input is taken from the "${target}" variable.
+# Input is taken from the "${host}" variable.
 
-case "${target}" in
+case "${host}" in
   aarch64*-*-linux*)	srv_tgtobj="linux-aarch64-low.o"
 			srv_tgtobj="$srv_tgtobj nat/aarch64-linux-hw-point.o"
 			srv_tgtobj="$srv_tgtobj linux-aarch32-low.o"
@@ -395,7 +398,8 @@ case "${target}" in
 			srv_linux_regsets=yes
 			srv_linux_thread_db=yes
 			;;
-  *)			echo "Error: target not supported by gdbserver."
-			exit 1
+  *)
+			# Who are you?
+			UNSUPPORTED=1
 			;;
 esac
