【问题标题】:Compile Git without gettext不使用 gettext 编译 Git
【发布时间】:2018-06-11 15:06:47
【问题描述】:

我正在尝试在 Debian(Linux 的 Windows 子系统)上编译静态 Git 2.17.1:

$ mkdir _git
$ make configure
$ ./configure --prefix=$PWD/_git NO_TCLTK=true NO_GETTEXT=true CFLAGS="${CFLAGS} -static"
$ make all

但我得到了错误

...
    MSGFMT po/build/locale/pt_PT/LC_MESSAGES/git.mo
/bin/sh: 1: msgfmt: not found
Makefile:2309: recipe for target 'po/build/locale/pt_PT/LC_MESSAGES/git.mo' failed
make: *** [po/build/locale/pt_PT/LC_MESSAGES/git.mo] Error 127

关于NO_GETTEXT的信息来自配置文件:

# Define NO_GETTEXT if you don't want Git output to be translated.

还需要msgfmt吗?

【问题讨论】:

  • 这不是您获得有关 NO_GETTEXT 信息的地方,也不是您为 makefile 定义变量的方式。
  • @jthill 好吧,那么问题是如何正确地做到这一点。

标签: git gettext msgfmt


【解决方案1】:

这对我有用。

make NO_GETTEXT=YesPlease

【讨论】:

    【解决方案2】:

    变量 NO_GETTEXT 由配置脚本设置。如果您的构建主机具有 gettext 运行时,则将其设置为 false。

    您有多种解决方法:

    • 在您的构建主机上安装 gettext 工具(包括 msgfmt)。
    • 安装一个只创建一个空输出文件的虚拟 msgfmt。
    • /usr/bin/touch 运行 make 之前的所有 .mo 文件,并确保它们的最后修改时间比 .po 文件的最近。
    • 在运行 make 之前修补 Makefile。将变量 MOFILES 设置为空看起来很有希望。

    无论如何,您可能都必须修补 Makefile,所以可能只使用最后一个选项。

    【讨论】:

      【解决方案3】:

      尝试使用 1 而不是 true...

      https://www.atlassian.com/git/tutorials/install-git

      NO_GETTEXT=1
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-09-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-07-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多