configure.ac:不使用 gettext

lan*_*oxx 14 automake autoreconf

我正在尝试编译一个 gnome 应用程序,我很好奇运行autogen.sh脚本时输出的含义:

~/Documents/Code/window-picker-applet $./autogen.sh
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal 
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --install --copy
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
data/Makefile.am:11: `%'-style pattern rules are a GNU make extension
data/Makefile.am:11: wildcard $(top_srcdir: non-POSIX variable name
data/Makefile.am:11: (probably a GNU make extension)
autoreconf: Leaving directory `.'
[Output trunkated...]
Run Code Online (Sandbox Code Playgroud)

为什么我会得到信息configure.ac: not using Gettext?这是一个警告,我应该更改一些配置文件来修复它吗?我知道该应用程序有一个po/文件夹,所以我认为它应该使用 Gettext,因此我对这个警告感到困惑。

我也有很多N_未定义宏的警告,所以这可能是相关的? [更新]见下面的评论[/更新]

小智 5

什么操作系统?

可能您的系统没有全部或部分 gettext 系统,即开发部分。在许多发行版中,例如 Debian/Ubuntu,gettext 被分成多个包:gettext-basegettext.

gettext-base软件包用于运行多语言程序,同时gettext具有构建所需的部分。


arf*_*twn 4

看来你autogen.sh正在打电话autoreconf

\n\n

该项目可能正在使用intltool,但如果是这样,autoreconf应该选择并调用intltoolize. 如果它肯定使用 GNU gettext 那么autopoint信息页面中的这个会很有帮助:

\n\n
\n

\xe2\x80\x98autopoint\xe2\x80\x99 程序将标准 gettext 基础结构文件\n 复制到源包中。它从\n \xe2\x80\x98AM_GNU_GETTEXT_VERSION(VERSION)\xe2\x80\x99 形式的宏调用中提取,该宏调用位于包\xe2\x80\x99s\n \xe2\x80\x98configure.in\xe2\ 中x80\x99 或 \xe2\x80\x98configure.ac\xe2\x80\x99 文件,包使用的 gettext 版本,并将属于该版本的基础结构文件复制到包中。

\n
\n\n

如果我们写AM_GNU_GETTEXT_VERSIONthenautopoint就会被正确调用autoreconf

\n\n
\n

要提取满足版本要求的最新可用基础架构,您可以使用\n \xe2\x80\x98AM_GNU_GETTEXT_REQUIRE_VERSION(VERSION)\xe2\x80\x99 形式。例如,如果您的系统上安装了 gettext 0.19.8 并请求了 \xe2\x80\x980.19.1\xe2\x80\x99,则版本 0.19.8 的基础结构文件将被复制到\ n 源码包。

\n
\n\n

该问题仅在切换到此版本的宏时出现,虽然它按照罐头上所说的那样执行,但我们不知道autoreconf,我们看到了一个支持补丁

\n\n

Gentoo 用户可以使用我们的函数在 ebuilds 中获得相同的行为eautoreconf

\n\n

在我自己的写法AM_GNU_GETTEXT_VERSION之后立即生成警告,但在其他方面似乎会产生预期的结果。AM_GNU_GETTEXT_REQUIRE_VERSIONconfigure.ac

\n