This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Include dir intl when building libcommon.a for gdb


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 (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]