Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 1/6] introduce common.m4
Date: Fri, 08 Nov 2013 20:10:00 -0000	[thread overview]
Message-ID: <87wqkiofk6.fsf@fleche.redhat.com> (raw)
In-Reply-To: <8761s2pusr.fsf@fleche.redhat.com> (Tom Tromey's message of "Fri,	08 Nov 2013 12:17:40 -0700")

Pedro> If we do go with gdbserver including this directly, then I think
Pedro> it'd be good to add a comment about the dependency here:

Tom> Will do.
Tom> I'll add a note to common.m4 as well.

Here is the updated version of this patch.

I'm going to check this series in now.

Tom

commit 3266f10be2daf35319101f299ae988aa2bbd5297
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Apr 24 10:45:45 2013 -0600

    introduce common.m4
    
    It has bothered me for a while that files in common/ use macros
    defined via autoconf checks, but rely on each configure.ac doing the
    proper checks independently.
    
    This patch introduces common/common.m4 which consolidates the checks
    assumed by code in common.
    
    The rule I propose is that if something is needed or used by common,
    it should be checked for by common.m4.  However, if the check is also
    needed by gdb or gdbserver, then it should be duplicated there.
    
    Built and regtested on x86-64 Fedora 18 (though this is hardly the
    most strenuous case) and using the Fedora 18 mingw cross compilers.  I
    also examined the config.in diffs to ensure that symbols did not go
    missing.
    
    2013-11-08  Tom Tromey  <tromey@redhat.com>
    
    	* acinclude.m4: Include common.m4.
    	* common/common.m4: New file.
    	* configure, config.in: Rebuild.
    	* configure.ac: Use GDB_AC_COMMON.
    
    2013-11-08  Tom Tromey  <tromey@redhat.com>
    
    	* acinclude.m4: Include common.m4, codeset.m4.
    	* configure, config.in: Rebuild.
    	* configure.ac: Use GDB_AC_COMMON.

diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index a05eb4d..be1c019 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -52,6 +52,8 @@ sinclude([../config/codeset.m4])
 
 sinclude([../config/zlib.m4])
 
+m4_include([common/common.m4])
+
 ## ----------------------------------------- ##
 ## ANSIfy the C compiler whenever possible.  ##
 ## From Franc,ois Pinard                     ##
diff --git a/gdb/common/common.m4 b/gdb/common/common.m4
new file mode 100644
index 0000000..20fbb44
--- /dev/null
+++ b/gdb/common/common.m4
@@ -0,0 +1,38 @@
+dnl Autoconf configure snippets for common.
+dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GDB.
+dnl 
+dnl This program 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.  If not, see <http://www.gnu.org/licenses/>.
+
+dnl Invoke configury needed by the files in 'common'.
+AC_DEFUN([GDB_AC_COMMON], [
+  AC_HEADER_STDC
+  AC_HEADER_DIRENT
+  AC_FUNC_ALLOCA
+
+  dnl Note that this requires codeset.m4, which is included
+  dnl by the users of common.m4.
+  AM_LANGINFO_CODESET
+
+  AC_CHECK_HEADERS(linux/perf_event.h locale.h memory.h signal.h dnl
+                   string.h strings.h dnl
+		   sys/resource.h sys/socket.h sys/syscall.h dnl
+		   sys/un.h sys/wait.h dnl
+		   thread_db.h wait.h)
+
+  AC_CHECK_FUNCS([fdwalk getrlimit pipe pipe2 socketpair])
+
+  AC_CHECK_DECLS([strerror, strstr])
+])
diff --git a/gdb/configure.ac b/gdb/configure.ac
index e5984df..3558d6a 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1168,6 +1168,7 @@ AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid getgid \
 		setrlimit getrlimit posix_madvise waitpid lstat \
 		fdwalk pipe2 ptrace64])
 AM_LANGINFO_CODESET
+GDB_AC_COMMON
 
 # Check the return and argument types of ptrace.  No canned test for
 # this, so roll our own.
diff --git a/gdb/gdbserver/acinclude.m4 b/gdb/gdbserver/acinclude.m4
index 4008d96..744871a 100644
--- a/gdb/gdbserver/acinclude.m4
+++ b/gdb/gdbserver/acinclude.m4
@@ -15,6 +15,11 @@ sinclude(../../config/acx.m4)
 m4_include(../../config/depstand.m4)
 m4_include(../../config/lead-dot.m4)
 
+dnl codeset.m4 is needed for common.m4, but not for
+dnl anything else in gdbserver.
+m4_include(../../config/codeset.m4)
+m4_include(../common/common.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.
 
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index c167508..086457c 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -88,6 +88,8 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
 AC_CHECK_FUNCS(pread pwrite pread64 readlink fdwalk pipe2)
 AC_REPLACE_FUNCS(vasprintf vsnprintf)
 
+GDB_AC_COMMON
+
 # Check for UST
 ustlibs=""
 ustinc=""


  reply	other threads:[~2013-11-08 19:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05 18:23 [PATCH v2 0/6] " Tom Tromey
2013-11-05 18:23 ` [PATCH v2 2/6] remove link.h checks Tom Tromey
2013-11-05 19:10   ` Pedro Alves
2013-11-05 18:24 ` [PATCH v2 1/6] introduce common.m4 Tom Tromey
2013-11-05 19:09   ` Pedro Alves
2013-11-05 20:03     ` Tom Tromey
2013-11-08 12:46       ` Pedro Alves
2013-11-08 19:32         ` Tom Tromey
2013-11-08 20:10           ` Tom Tromey [this message]
2013-11-05 18:25 ` [PATCH v2 4/6] gdb configure updates Tom Tromey
2013-11-05 19:10   ` Pedro Alves
2013-11-05 19:09 ` [PATCH v2 3/6] use gdb_string.h in m32c-tdep.c Tom Tromey
2013-11-05 19:49   ` Pedro Alves
2013-11-05 19:10 ` [PATCH v2 0/6] introduce common.m4 Pedro Alves
2013-11-05 20:04 ` [PATCH v2 5/6] fix a comment in configure.ac Tom Tromey
2013-11-05 21:10 ` [PATCH v2 6/6] remove unused gdbserver configury Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqkiofk6.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox