Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Yao Qi <yao@codesourcery.com>, Joel Brobecker <brobecker@adacore.com>
Subject: Re: Include dir intl when building libcommon.a for gdb
Date: Wed, 02 Mar 2011 15:32:00 -0000	[thread overview]
Message-ID: <201103021532.02784.pedro@codesourcery.com> (raw)
In-Reply-To: <4D6E5854.4020103@codesourcery.com>

On Wednesday 02 March 2011 14:46:44, Yao Qi wrote:
> To your first question, because common/signals.c uses "ifdef GDBSERVER",
> which makes a lot troubles here.  I think of this problem again, and
> find that root cause of this problem is that files in common dir
> includes some gdb-specific or gdbserver specific code.

You're oversimplifying.  You'll need to include one or the
other in files under common/ that require types such as CORE_ADDR
and others.  Obvious solutions to that are to rename server.h to
defs.h, or add a new defs.h that just includes server.h.

> If we move gdb-specific part of common/signals.c out of it, the include
> and compilation flags can be unique.

Only because signals.c doesn't use any of gdb/gdbserver's specific
typedefs (CORE_ADDR & co).

I haven't seen any comment on AC_CHECK_HEADERS concerns
I raised, probably because the FSF tree has only signals.c
and not much else under common/ currently, which hides
the issue.

Grepping the code we have under common/ in our local tree
for "HAVE_", I see:

$ grep HAVE_ *
gdb_dirent.h:#ifdef HAVE_DIRENT_H
gdb_dirent.h:# ifdef HAVE_SYS_NDIR_H
gdb_dirent.h:# ifdef HAVE_SYS_DIR_H
gdb_dirent.h:# ifdef HAVE_NDIR_H
gdb_locale.h:#ifdef HAVE_LOCALE_H
gdb_locale.h:#ifdef HAVE_LANGINFO_CODESET
signals.c:#ifdef HAVE_SIGNAL_H

Maintaining and making sure these checks are in both configures,
rather than centralized is harder than updating two Makefiles.
IMO, this should be handled by an .m4 under common that is
used by both configures, something like gnulib/'s gl_INIT.
gnulib does not have its own configure, yet it integrates into
random configures.  It looks like a better model for common/
to me.

-- 
Pedro Alves


  reply	other threads:[~2011-03-02 15:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  6:22 Yao Qi
2011-03-02 12:14 ` Joel Brobecker
2011-03-02 12:34   ` Kai Tietz
2011-03-04  5:55     ` Joel Brobecker
2011-03-02 12:44   ` Pedro Alves
2011-03-04  5:46     ` Joel Brobecker
2011-03-02 13:12   ` Mark Kettenis
2011-03-02 14:46   ` Yao Qi
2011-03-02 15:32     ` Pedro Alves [this message]
2011-03-03  3:15       ` Yao Qi
2011-03-03  5:40         ` Yao Qi

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=201103021532.02784.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.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