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 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


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