Re: [Gc] Dependency tracking for configuration macros

Ivan Maidanski ivmai at mail.ru
Wed May 20 12:55:20 PDT 2009


Hi!

Petter Urkedal <urkedal at nbi.dk> wrote:
> The attached patch adds AC_CONFIG_HEADER to configure.ac, so that the
> command-line "-D"-options are replace by the conditional inclusion of a
> generated config.h header.  The major part of the patch is the addition
> of documentation to configuration macros.

Opinion:
1. instead of inclusion of "gc_config_macros.h" from misc .c files (like backgraph.c one), I'd rather include "gc.h" - see my patch in http://permalink.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/2575 (mostly taken from GCC/boehm-gc).

2. Inclusion of a "private/..." file from a public header ("gc_config_macros.h") is not a good idea (even if it is ifdef'ed), I think.

> 
> I tested the patch on various configurations on Linux x86_64 and i386 by
> diff-ing the disassembly of the object files before and after applying
> the patch.
> 
> -----%<-----
> Dependency tracking for configuration macros.
> 
> configure.ac, acinclude.m4:
>         * Invoke AC_CONFIG_HEADER.
>         * Added documentation of configuration macros.
>         * Commented out the unused macros STACKBASE and DATASTART_IS_ETEXT.

STACKBASE should be also removed in misc.c file.


> configure.ac, Makefile.am:
>         * Moved include paths to Makefile.am. 
>         * Added include path for build directory.
> 
> include/gc_config_macros.h, include/private/gcconfig.h:
>         * Conditionally include "private/config.h".
> include/gc.h, include/private/gc_pmark.h,
> backgraph.c, checksums.c, gcj_mlc.c, real_malloc.c, tests/test.c:
>         * Minor adjustments to make sure that the config macros are
>         defined before use.

Bye.


More information about the Gc mailing list