]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdbserver/configure.ac
gdbserver/linux: probe for libiconv in configure
[thirdparty/binutils-gdb.git] / gdbserver / configure.ac
index 6c504777d09e57fd7612cb874cbb53947b91e019..ee0de9decbdea51ceee7467cf04953868b34c8b6 100644 (file)
@@ -1,5 +1,5 @@
 dnl Autoconf configure script for GDB server.
-dnl Copyright (C) 2000-2021 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2024 Free Software Foundation, Inc.
 dnl
 dnl This file is part of GDB.
 dnl
@@ -19,6 +19,7 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
 dnl Process this file with autoconf to produce a configure script.
 
 AC_INIT
+AC_CONFIG_MACRO_DIRS([../config])
 AC_CONFIG_SRCDIR([server.cc])
 AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
 
@@ -45,9 +46,9 @@ AC_PROG_RANLIB
 
 AC_ARG_PROGRAM
 
-# We require a C++11 compiler.  Check if one is available, and if
+# We require a C++17 compiler.  Check if one is available, and if
 # necessary, set CXX_DIALECT to some -std=xxx switch.
-AX_CXX_COMPILE_STDCXX(11, , mandatory)
+AX_CXX_COMPILE_STDCXX(17, , mandatory)
 
 AC_HEADER_STDC
 
@@ -145,6 +146,7 @@ fi
 AC_SUBST(ustlibs)
 AC_SUBST(ustinc)
 
+AM_GDB_COMPILER_TYPE
 AM_GDB_WARNINGS
 
 dnl dladdr is glibc-specific.  It is used by thread-db.c but only for
@@ -379,7 +381,7 @@ if test "$srv_xmlfiles" != ""; then
   done
 fi
 
-GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_hostio_err_objs $srv_thread_depfiles"
+GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles"
 GDBSERVER_LIBS="$srv_libs"
 
 dnl Check whether the target supports __sync_*_compare_and_swap.
@@ -454,6 +456,22 @@ if test x"$STDINT_H" != x; then
 fi
 AC_SUBST(GNULIB_STDINT_H)
 
+# Check for libiconv.  It is a requirement for Linux hosts, and others hosts
+# don't use it at all.  Define MAYBE_LIBICONV only if the host is Linux.
+AM_ICONV
+MAYBE_LIBICONV=
+case "$host" in
+  *linux*)
+    if test "$am_cv_func_iconv" != yes; then
+      AC_MSG_ERROR([could not find libiconv (required for host $host)])
+    fi
+
+    MAYBE_LIBICONV="$LIBICONV"
+    ;;
+esac
+
+AC_SUBST(MAYBE_LIBICONV)
+
 AC_CONFIG_FILES([Makefile])
 
 AC_OUTPUT