From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Joel Brobecker <brobecker@adacore.com>
Subject: Re: Include dir intl when building libcommon.a for gdb
Date: Thu, 03 Mar 2011 03:15:00 -0000 [thread overview]
Message-ID: <4D6F07D2.8050004@codesourcery.com> (raw)
In-Reply-To: <201103021532.02784.pedro@codesourcery.com>
On 03/02/2011 11:32 PM, Pedro Alves wrote:
> 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.
>
I don't understand why it is "oversimplying". We should make code in
common/ dir as "common" as possible, and don't need conditional includes
and flags.
This approach meets needs so far, since there is only one c file in
common dir, and doesn't require types such CORE_ADDR. When we moving
more and more files to common/, we should move some common types, like
CORE_ADDR, into common as well.
> 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.
Yes, .m4 file can reduce duplication of configures in both gdb and
gdbserver. I agree.
> gnulib does not have its own configure, yet it integrates into
> random configures. It looks like a better model for common/
> to me.
We can have configure/make and .m4 together in common/. .m4 file
provides common macros, while configure generates Makefile for source in
common/.
--
Yao (é½å°§)
next prev parent reply other threads:[~2011-03-03 3:15 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
2011-03-03 3:15 ` Yao Qi [this message]
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=4D6F07D2.8050004@codesourcery.com \
--to=yao@codesourcery.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@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