aboutsummaryrefslogtreecommitdiff
path: root/gdb/libiberty.m4
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-02-27 15:52:02 +0000
committerPedro Alves <palves@redhat.com>2015-02-27 15:52:02 +0000
commit07697489f4587e41f4f63aa526c1bd7d2fcd5494 (patch)
tree113b7f264c63cdb823dd30d0fba4beb5a8ae0177 /gdb/libiberty.m4
parentcdb602b17548eeebb5e700c507d734ea5f887a49 (diff)
downloadgdb-07697489f4587e41f4f63aa526c1bd7d2fcd5494.zip
gdb-07697489f4587e41f4f63aa526c1bd7d2fcd5494.tar.gz
gdb-07697489f4587e41f4f63aa526c1bd7d2fcd5494.tar.bz2
Create libiberty.m4, have GDB and GDBserver use it
Converting GDB to be a C++ program, I stumbled on 'basename' issues, like: src/gdb/../include/ansidecl.h:169:64: error: new declaration ‘char* basename(const char*)’ /usr/include/string.h:597:26: error: ambiguates old declaration ‘const char* basename(const char*)’ which I believe led to this bit in gold's configure.ac: dnl We have to check these in C, not C++, because autoconf generates dnl tests which have no type information, and current glibc provides dnl multiple declarations of functions like basename when compiling dnl with C++. AC_CHECK_DECLS([basename, ffs, asprintf, vasprintf, snprintf, vsnprintf, strverscmp]) These checks IIUC intend to generate all the HAVE_DECL_FOO symbols that libiberty.h and ansidecl.h check. GDB is missing these checks currently, which results in the conflict shown above. This adds an m4 file that both GDB and GDBserver's configury use to pull in the autoconf checks that libiberty clients needs done in order to use these libiberty.h/ansidecl.h. gdb/ChangeLog: 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. gdb/gdbserver/ 2015-02-27 Pedro Alves <palves@redhat.com> * acinclude.m4: Include libiberty.m4. * configure.ac: Call libiberty_INIT. * config.in, configure: Regenerate.
Diffstat (limited to 'gdb/libiberty.m4')
-rw-r--r--gdb/libiberty.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/libiberty.m4 b/gdb/libiberty.m4
new file mode 100644
index 0000000..5655e07
--- /dev/null
+++ b/gdb/libiberty.m4
@@ -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])
+])