autoconf: New Macros

1 
1 18.6.2 New Macros
1 -----------------
1 
1 While Autoconf was relatively dormant in the late 1990s, Automake
1 provided Autoconf-like macros for a while.  Starting with Autoconf 2.50
1 in 2001, Autoconf provided versions of these macros, integrated in the
1 `AC_' namespace, instead of `AM_'.  But in order to ease the upgrading
1 via `autoupdate', bindings to such `AM_' macros are provided.
1 
1    Unfortunately older versions of Automake (e.g., Automake 1.4) did
1 not quote the names of these macros.  Therefore, when `m4' finds
1 something like `AC_DEFUN(AM_TYPE_PTRDIFF_T, ...)' in `aclocal.m4',
1 `AM_TYPE_PTRDIFF_T' is expanded, replaced with its Autoconf definition.
1 
1    Fortunately Autoconf catches pre-`AC_INIT' expansions, and
1 complains, in its own words:
1 
1      $ cat configure.ac
1      AC_INIT([Example], [1.0], [bug-example@example.org])
1      AM_TYPE_PTRDIFF_T
1      $ aclocal-1.4
1      $ autoconf
1      aclocal.m4:17: error: m4_defn: undefined macro: _m4_divert_diversion
1      aclocal.m4:17: the top level
1      autom4te: m4 failed with exit status: 1
1      $
1 
1    Modern versions of Automake no longer define most of these macros,
1 and properly quote the names of the remaining macros.  If you must use
1 an old Automake, do not depend upon macros from Automake as it is
1 simply not its job to provide macros (but the one it requires itself):
1 
1      $ cat configure.ac
1      AC_INIT([Example], [1.0], [bug-example@example.org])
1      AM_TYPE_PTRDIFF_T
1      $ rm aclocal.m4
1      $ autoupdate
1      autoupdate: `configure.ac' is updated
1      $ cat configure.ac
1      AC_INIT([Example], [1.0], [bug-example@example.org])
1      AC_CHECK_TYPES([ptrdiff_t])
1      $ aclocal-1.4
1      $ autoconf
1      $
1