Autoconf 和 Autotools 的替代品?
我是 GNU Autotools 的频繁用户(主要是 Autoconf,偶尔 Libtool )。 我正在开发一个项目,可移植性将成为一个症结所在。然而,团队的其他成员不太愿意使用 m4。 我的收件箱中收到了此,不是一个人,而是四个人:
不管怎样,也许有人可以推荐一些基于 Python 或 PHP 的东西? 我正在一棵更大的树的 C 端工作; 我可以确定 Python 或 PHP 5 将存在,因为它们是先决条件。
I'm a very frequent user of the GNU Autotools (mostly Autoconf, occasionally Libtool). I'm working on a project where portability is going to be a sticking point.. Yet, the rest of the team is just not comfortable working with m4. I got this in my inbox from not one, but four people:
Anyway, perhaps someone could recommend something Python or PHP based? I'm working on the C end of a much larger tree; I can be sure either Python or PHP 5 will be present, as they are prerequisites.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
我冒着被否决的机会,但我必须承认,不幸的是,自动工具没有真正的替代品。 CMake、SCons、bjam 都不错,但是,当涉及到严肃的工作时......很明显,自动工具更优越,不是因为 CMake 不能做同样的事情,而是因为用它来做同样的事情要困难得多。
例如,CMake(最流行的 autotools 替代品)具有以下缺点:
等等。
还有很多其他要点。 不幸的是,没有真正的高质量自动工具替代品。 另一方面,如果您在 Windows 和 for Visual Studio 上进行开发,则无法使用自动工具,并且需要选择提供此类工具的 CMake。
I'm taking the chance of being downvoted but, I must admit, that unfortunately there is no real substitute for autotools. CMake, SCons, bjam are nice but, when it comes to serious work... it is quite clear that autotools are superior, not because CMake can't do the same thing, but because it is just much harder to do so with it.
For example, CMake, the most popular alternative to autotools, has the following drawbacks:
And so on.
There are many other points. Unfortunately, there is no real high quality substitute for autotools. On the other hand, if you develop on Windows and for Visual Studio, then you can't use autotools and you need to choose CMake that provides such tools.
我听说过关于 CMake 的好消息,它试图解决同样的问题。 这里是维基百科文章
I have heard good things about CMake which tries to solve the same problems. Here is the wikipedia article
我在 SCons 方面取得了巨大成功。 它是用 Python 构建的,构建脚本实际上是 Python 脚本本身,这赋予了强大的表达能力。 来自网站:
I've had good success with SCons. It's built with Python and the build scripts are actually Python scripts themselves, which gives a great deal of expressive power. From the web site:
有很多不同的替代 Makefile 生成器和构建系统:
也可用,但不严格针对 C/C++:
但是在列出所有这些之后,自动工具具有不需要最终用户任何其他依赖项的巨大优势。 配置脚本仅由开发人员生成一次,并且不需要用户端执行任何特殊操作,因为它是 shell 脚本。 必须先安装上面列出的工具,然后任何人都可以构建您的源代码,它们甚至可能本身具有依赖项。
There are a lot of different alternative Makefile generators and build systems out there:
Also available, but not stringently targeted on C/C++:
But after listing these all, autotools have the great advantage of not requiring any other dependency for the end-user. A configure script is only generated once by the developer and does not require anything special on the user end, as it is a shell script. The tools listed above have to be installed before anyone can build your source and they even might have dependencies themselves.
简单地使用 Make 和 pkg-config?
这里有一个Makefile 模板来帮助您入门。
人少即是人多。
How about simply using Make and pkg-config?
Here is a Makefile template to get you started.
Less is more people.
另一种自动*替换 - mk-configure。 可以在此处找到文档
One more auto* replacement - mk-configure. Docs can be found here
我看过 CMake,它看起来是一个不错的选择,除非你进行交叉编译。 如果你正在做原生编译,你应该尝试一下
I have had a look at CMake, which looks like a good alternative unless you are cross-compiling. If you are doing native compilation, you should try it
Mozilla 正在创建一个 Python 版本的 make - pymake -这大概支持跨平台使用。
There's a python version of make being created at Mozilla - pymake - which presumably supports cross-platform use.
要从 ANT 或 Maven 构建 C/C++ 软件,您可能会对 terp 感兴趣。 它包括一个可移植的 C++ 编译器任务,可与许多平台上的许多 C++ 编译器一起使用。
For building C/C++ software from ANT or maven you might be interested in terp. It includes a portable C++ compiler task that works with many C++ compilers on many platforms.