Hi Gary,
> Then I believe the only viable option to provide stable support for
> multiple gnulib directories in a single tree is to add a switch to
> gnulib-tool to rewrite gnulib #include_next lines on import, so that
> both types of compilers include header files in the same order.
Thanks for these thoughts, Gary and Eric.
To sum up the discussion:
- Double inclusion guards must depende on the macro_prefix.
- gnulib-tool needs an option --base-gnulib=.../gnulib-cache.m4
that has two effects:
- It rewrites the include_next invocations for old compilers,
so that the program will always include
extra/gllib/stdlib.h -> main/gllib/stdlib.h -> /usr/include/stdlib.h
- It implies --avoid options for all the modules listed in the base
gnulib-cache.m4. (Otherwise modules get duplicated, causing malfunction
of modules that have global state, like sigaction, fchdir, and similar.)
- All typedefs that are defined in a .h file and are not triggered by a module
for a function replacement must have a double definition guard, like we did
for
'struct random_data'.
Bruno