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

时间:2022-03-23 09:40:24

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.

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

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.

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

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;

1)将foo.cc检入项目存储库并以某种方式修补configure.in(或其他)以在foo.yy / foo.cc中包含时间戳检查,如果在有问题的目标上运行过期,则生成可理解的错误消息foo.cc;

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

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

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

我可以做2)没问题,但我不认为这是放置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).

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

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

你有什么建议,这里的任何人都知道如何解决方案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.

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

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

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

1 个解决方案

#1


From 8.8 in the Automake manual:

从Automake手册中的8.8开始:

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’.

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

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

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

#1


From 8.8 in the Automake manual:

从Automake手册中的8.8开始:

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’.

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

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

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