]> git.draconx.ca Git - dxcommon.git/commit
Fix DX_BASEDIR hoisting problems in base.m4.
authorNick Bowler <nbowler@draconx.ca>
Sat, 22 Nov 2014 18:38:20 +0000 (13:38 -0500)
committerNick Bowler <nbowler@draconx.ca>
Sun, 19 Apr 2015 18:52:16 +0000 (14:52 -0400)
commitd4b010a6dc3c999c9d3488a453ab2be1af18b6c9
tree42b27395416460322bf2162dd2fdab961795bea3
parent1a890c291972284b13e7ae9d394813f2a138fed0
Fix DX_BASEDIR hoisting problems in base.m4.

Currently, DX_INIT expands to a bunch of text, mostly whitespace.
This is not normally a serious problem, except when DX_BASEDIR
is called at the top level without previously expanding DX_INIT.
Since DX_BASEDIR is intended to be expanded during argument
collection, the result is that DX_INIT's output ends up as part
of the argument where DX_BASEDIR appears.

Fixing this turns out to be somewhat non-trivial.  Both DX_INIT and
DX_BASEDIR need to be changed.

  - First, avoid using AC_REQUIRE in DX_BASEDIR.  This relies on
    diversions which do not work correctly during argument collection.

  - Rewrite DX_INIT so that it expands to no text whatsoever.

  - Finally, the AC_DEFUN_ONCE mechanism appears to insert newlines
    where the macros are called for the first time.  Use m4_ignore
    to eat that inside DX_BASEDIR.
m4/base.m4
m4/dx-stamp.m4
tests/macros.at