[Linux-ha-dev] replicated compile-time "define"

Alan Robertson alanr at unix.sh
Tue Apr 25 09:34:38 MDT 2006


David Lee wrote:
> Last week, whilst following up a portability bug about pathnames, my
> attention was drawn to "heartbeat/Makefile.am" and its:
>    AM_CFLAGS = "... -DVAR_RUN_D='"$(havarrundir)"' ..."
> 
> (about four similar "-D..." items in there).
> 
> Variants of this are replicated across several other "Makefile.am".  Such
> replication feels awkward, and has the potential to become inconsistent.
> 
> (Indeed, as part of an experiment here, I made such an inconsistency, and
> the runtime results (naturally enough, a failure condition) left no useful
> diagnostic indication in the logs.  Not nice.)
> 
> This "-D..." stuff all seems to be ancient history, dating back to the
> autoconfiscation of the project.
> 
> Given that almost all of these "-D..." items are now in maintained by
> configure in the generated "config.h" file, it would seem prudent and wise
> to remove these extra (and potentially inconsistent) definitions from the
> relevant "Makefile.am" files.
> 
> As a pleasant side-effect, the size of the derived "heartbeat/Makefile.am"
> dropped by almost 50%, from 56K to 29K.  Nice!
> 
> So I propose tidying these up, trying to eliminate the "-D..." items from
> these various "Makefile.am", and also, if reasonably possible, trying to
> remove the "AM_CFLAGS=..." altogether.
> 
> It seems to be entirely positive.  Can anyone see any reason not to do
> this?

If it works and doesn't have side effects, then I'm all for it.

-- 
     Alan Robertson <alanr at unix.sh>

"Openness is the foundation and preservative of friendship...  Let me 
claim from you at all times your undisguised opinions." - William 
Wilberforce


More information about the Linux-HA-Dev mailing list