将生成的文件添加到发行版的最佳方法?

发布于 2024-07-28 23:52:57 字数 753 浏览 5 评论 0原文

我有一个使用 autoconf / automake 的相当复杂的(C++)项目,其中包括一些“生成的”文件(foo.yy -> foo.cc)。 实际构建是在各种平台上使用“控制脚本”(熟悉该概念的人使用 Gentoo .ebuild)完成的。

现在,目标平台之一无法正确支持 foo.yy -> foo.cc 步骤,并且必须使用 Linux 机器上生成的 foo.cc 文件。

现在我有两种方法可以解决这个问题:

1)将 foo.cc 签入项目存储库,并以某种方式修补configure.in(或其他)以包括对 foo.yy / foo.cc 的时间戳检查,生成可理解的错误消息如果使用过时的 foo.cc 在相关目标上运行;

2)将foo.cc签入控制脚本存储库,并让脚本控制时间戳并给出错误消息。

我可以做到 2) 没问题,但我认为这不是放置 foo.cc 的正确位置。

另一方面,我对 autoconf / automake 不太了解,也不知道如何在configure.in(或任何地方)中实现时间戳检查/错误消息。

您有什么建议,这里有人知道如何解决解决方案 1) 吗?

编辑:使用解决方案 3) 解决,调整有问题的目标框,直到它能够执行 foo.yy -> foo.cc 步骤本身。 的问题已经解决了。

但我将保留这个问题 - 如何使用 autoconf / automake 进行时间戳检查/可理解的错误消息?

I have a quite complex (C++) project using autoconf / automake, which includes some "generated" files (foo.yy -> foo.cc). Actual builds are done using a "control script" (Gentoo .ebuild for those familiar with the concept), on various platforms.

Now, one of the target platforms does not properly support the foo.yy -> foo.cc step, and has to use the foo.cc file generated on a Linux box.

Now I have two ways to go about this:

1) Check in foo.cc into the project repository and somehow patch configure.in (or whatever) to include a timestamp check on foo.yy / foo.cc, generating a comprehensible error message if run on the target in question with an outdated foo.cc;

2) Check in foo.cc into the control script repository, and have the script control time stamps and give the error message.

I could do 2) no problem, but I don't think it's the right place to put foo.cc.

On the other hand, I don't know much about autoconf / automake, and wouldn't know how to implement a timestamp check / error message in configure.in (or whereever).

What are your suggestions, and would anyone here know how to go about solution 1)?

Edit: Solved using solution 3), tweaking the problematic target box until it is able to do the foo.yy -> foo.cc step itself. My problem is solved.

But I'll leave the question open - how to do timestamp checks / comprehensible error messages with autoconf / automake?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

羅雙樹 2024-08-04 23:52:57

从 Automake 手册中的 8.8 开始:

由“yacc”(或“lex”)生成的中间文件将是
包含在所做的任何分发中。 这样用户就不会
需要有“yacc”或“lex”。

这听起来好像您所描述的问题不应该存在。

From 8.8 in the Automake manual:

The intermediate files generated by ‘yacc’ (or ‘lex’) will be
included in any distribution that is made. That way the user doesn't
need to have ‘yacc’ or ‘lex’.

That makes it sound as if the problem you're describing should not exist.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文