为什么 gettext Automake 宏包含已弃用的 AM_PROG_MKDIR_P 宏?

ska*_*dal 2 automake gnome

我正在尝试构建一个我有一段时间没有重新访问过的项目。我以 GNOME 应用程序的典型方式使用 GNU 自动工具。现在,当运行autogen.sh(反过来使用gnome-autogen.sh)时,我收到以下错误:

automake: warnings are treated as errors
configure.ac:47: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and its use is discouraged.
configure.ac:47: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
configure.ac:47: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
autoreconf: automake failed with exit status: 1
[simon:~/git/toddlerfun] master(+2/-2) 1 ± 
Run Code Online (Sandbox Code Playgroud)

问题似乎源于 gettext,运行此错误报告中的命令给出了相同的结果:

$ grep -ri AM_PROG_MKDIR_P m4
m4/intl.m4:  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
m4/po.m4:  AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
$ head -n1 m4/po.m4 m4/intl.m4
==> m4/po.m4 <==
# po.m4 serial 17 (gettext-0.18)

==> m4/intl.m4 <==
# intl.m4 serial 17 (gettext-0.18)
Run Code Online (Sandbox Code Playgroud)

但是,进一步阅读该错误报告,这应该在 gettext 0.18.2 中得到修复。我的 Ubuntu 14.10 上的版本是 0.19:

$ gettext --version
gettext (GNU gettext-runtime) 0.19.2
Run Code Online (Sandbox Code Playgroud)

那么为什么没有安装正确的、修复了错误的宏呢?

ska*_*dal 5

我在写问题时解决了这个问题。您需要确保从configure.ac. 我有:

AM_GNU_GETTEXT_VERSION([0.18])
Run Code Online (Sandbox Code Playgroud)

升级为:

AM_GNU_GETTEXT_VERSION([0.19])
Run Code Online (Sandbox Code Playgroud)

使事情奏效。发布此答案,以便其他可能遇到类似问题的人可以获得帮助。