On 10 August 2016 at 14:40, ayush goel <ayushgoel1...@gmail.com> wrote: > On 9 August 2016 at 2:20:59 PM, Pedro Alves (pal...@redhat.com) wrote: >> the scheme of configuring gnulib in a separate directory as borrowed from gdb >> requires including two config.h headers -- the gnulib client's, and gnulib's.
Isn't this also true for libiberty's config.h ? I have no idea when/how is that included. >> Did you do something different that avoids needing that somehow? > > I wasn’t aware of this. Thanks for pointing this out. > It’s strange however, I didn’t see anything failing while > building/testing my system. >> >> In gdb, .c files don't include "config.h" directly. Instead all .c files >> include a "defs.h" file first thing, and that in turn (after another >> indirection) >> is what includes both gdb's "config.h" and gnulib's "config.h”: > > Can gcc also adopt a similar approach? Include gnulib’s config.h in a > single header file instead of including it in every function that uses > it. > Which header file would be the most suitable for this purpose(probably > which is generically included by almost all the gcc functions)? Unfortunately, gcc/*.c include config.h directly. Sorry, I'm not really sure how this is supposed to work and how it was working for libiberty's config.h but I'd suggest to copy that if possible. Cheers, Manuel.