This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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: [PATCH] libiberty: add HAVE_CONFIG_H check to all files (lacking it already)


Mike Frysinger <vapier@gentoo.org> writes:

> it isnt an issue of libiberty being compiled correctly.  i
> specifically wanted to compile a few files by hand to simplify some
> local testing.

There is nothing wrong with doing that, of course, but I'm not sure why
it leads to a libiberty patch.  If none of the files in libiberty had
the #ifdef HAVE_CONFIG_H, I doubt you would consider adding it to
others.

Also, all of the files in libiberty which #include "config.h" presumably
do it in order to test macros which should be defined in config.h (e.g.,
HAVE_DECL_BASENAME, etc.).  So it is a good marker that for correct
general compilation you need to define those macros.


>> The cases where libiberty .c files check #ifdef HAVE_CONFIG_H are
>> generally cases where libiberty has copied code from other projects,
>> which have their own reasons for testing HAVE_CONFIG_H.
>
> so if i include an arbitrary file in my own project, i can request it
> be given a HAVE_CONFIG_H ?

No, those files were copied from projects like gnulib, which exist to
provide files to be included in other programs.

Ian


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