你的位置:首页 > 技术文章

18.6.2 New Macros

While Autoconf was relatively dormant in the late 1990s, Automake provided Autoconf-like macros for a while. Starting with Autoconf 2.50 in 2001, Autoconf provided versions of these macros, integrated in the AC_ namespace, instead of AM_. But in order to ease the upgrading via autoupdate, bindings to such AM_ macros are provided.

Unfortunately older versions of Automake (e.g., Automake 1.4) did not quote the names of these macros. Therefore, when m4 finds something like ‘AC_DEFUN(AM_TYPE_PTRDIFF_T, ...)’ in aclocal.m4, AM_TYPE_PTRDIFF_T is expanded, replaced with its Autoconf definition.

Fortunately Autoconf catches pre-AC_INIT expansions, and complains, in its own words:

    $cat configure.acAC_INIT([Example], [1.0], [bug-example@example.org])
    AM_TYPE_PTRDIFF_T
    $aclocal-1.4$autoconfaclocal.m4:17: error: m4_defn: undefined macro: _m4_divert_diversion
    aclocal.m4:17: the top level
    autom4te: m4 failed with exit status: 1
    $

Modern versions of Automake no longer define most of these macros, and properly quote the names of the remaining macros. If you must use an old Automake, do not depend upon macros from Automake as it is simply not its job to provide macros (but the one it requires itself):

    $cat configure.acAC_INIT([Example], [1.0], [bug-example@example.org])
    AM_TYPE_PTRDIFF_T
    $rm aclocal.m4$autoupdateautoupdate: `configure.ac' is updated
    $cat configure.acAC_INIT([Example], [1.0], [bug-example@example.org])
    AC_CHECK_TYPES([ptrdiff_t])
    $aclocal-1.4$autoconf$

更新PHP版本之后,编译扩展,执行/usr/local/webserver/php/bin/phpize后报上述错误,更新autoconf和automake到最新版即可。

来源:https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/New-Macros.html

  • 发表评论
  • 查看评论
【暂无评论!】

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。