@@ -1,3 +1,10 @@
+2015-02-27 Pedro Alves <palves@redhat.com>
+
+ * libiberty.m4: New file.
+ * acinclude.m4: Include libiberty.m4.
+ * configure.ac: Call libiberty_INIT.
+ * config.in, configure: Regenerate.
+
2015-02-27 Andreas Arnez <arnez@linux.vnet.ibm.com>
* s390-linux-tdep.c (s390_gcc_target_options): Not just handle
@@ -1,3 +1,9 @@
+2015-02-27 Pedro Alves <palves@redhat.com>
+
+ * acinclude.m4: Include libiberty.m4.
+ * configure.ac: Call libiberty_INIT.
+ * config.in, configure: Regenerate.
+
2015-02-26 Pedro Alves <palves@redhat.com>
* linux-low.c (linux_wait_1): When incrementing the PC past a
@@ -57,6 +57,9 @@ sinclude([../config/zlib.m4])
m4_include([common/common.m4])
+dnl For libiberty_INIT.
+m4_include(libiberty.m4)
+
## ----------------------------------------- ##
## ANSIfy the C compiler whenever possible. ##
## From Franc,ois Pinard ##
@@ -85,6 +85,17 @@
you don't. */
#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+ you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
/* Define to 1 if you have the declaration of `free', and to 0 if you don't.
*/
#undef HAVE_DECL_FREE
@@ -117,6 +128,34 @@
*/
#undef HAVE_DECL_STRSTR
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+ */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRVERSCMP
+
+/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_VASPRINTF
+
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_VSNPRINTF
+
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@@ -225,6 +264,9 @@
/* Define to 1 if the compiler supports long double. */
#undef HAVE_LONG_DOUBLE
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
/* Define if <sys/procfs.h> has lwpid_t. */
#undef HAVE_LWPID_T
@@ -635,6 +677,9 @@
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
/* The size of `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
@@ -20,6 +20,9 @@ dnl anything else in gdbserver.
m4_include(../../config/codeset.m4)
m4_include(../common/common.m4)
+dnl For libiberty_INIT.
+m4_include(../libiberty.m4)
+
dnl Check for existence of a type $1 in libthread_db.h
dnl Based on BFD_HAVE_SYS_PROCFS_TYPE in bfd/bfd.m4.
@@ -22,10 +22,25 @@
you don't. */
#undef HAVE_DECL_ADDR_NO_RANDOMIZE
+/* Define to 1 if you have the declaration of `asprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ASPRINTF
+
+/* Define to 1 if you have the declaration of `basename(char *)', and to 0 if
+ you don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
+#undef HAVE_DECL_FFS
+
/* Define to 1 if you have the declaration of `perror', and to 0 if you don't.
*/
#undef HAVE_DECL_PERROR
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+ don't. */
+#undef HAVE_DECL_SNPRINTF
+
/* Define to 1 if you have the declaration of `strerror', and to 0 if you
don't. */
#undef HAVE_DECL_STRERROR
@@ -34,6 +49,26 @@
*/
#undef HAVE_DECL_STRSTR
+/* Define to 1 if you have the declaration of `strtol', and to 0 if you don't.
+ */
+#undef HAVE_DECL_STRTOL
+
+/* Define to 1 if you have the declaration of `strtoll', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOLL
+
+/* Define to 1 if you have the declaration of `strtoul', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOUL
+
+/* Define to 1 if you have the declaration of `strtoull', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRTOULL
+
+/* Define to 1 if you have the declaration of `strverscmp', and to 0 if you
+ don't. */
+#undef HAVE_DECL_STRVERSCMP
+
/* Define to 1 if you have the declaration of `vasprintf', and to 0 if you
don't. */
#undef HAVE_DECL_VASPRINTF
@@ -96,6 +131,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
/* Define if <thread_db.h> has lwpid_t. */
#undef HAVE_LWPID_T
@@ -253,6 +291,9 @@
/* Bug reporting address */
#undef REPORT_BUGS_TO
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at runtime.
@@ -193,6 +193,8 @@ LIBS="$LIBS -ldl"
AC_CHECK_FUNCS(dladdr)
LIBS="$old_LIBS"
+libiberty_INIT
+
AC_CHECK_DECLS([strerror, perror, vasprintf, vsnprintf])
AC_CHECK_TYPES(socklen_t, [], [],
new file mode 100644
@@ -0,0 +1,31 @@
+dnl Bits libiberty clients must do on their autoconf step.
+dnl
+dnl Copyright (C) 2012-2015 Free Software Foundation, Inc.
+dnl
+dnl This file is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; see the file COPYING3. If not see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+dnl Checks for declarations ansidecl.h and libiberty.h themselves
+dnl check with HAVE_DECL_XXX, etc.
+
+AC_DEFUN([libiberty_INIT],
+[
+ # Check for presence and size of long long.
+ AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)])
+
+ AC_CHECK_DECLS([basename(char *), ffs, asprintf, vasprintf, snprintf, vsnprintf])
+ AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoull])
+ AC_CHECK_DECLS([strverscmp])
+])