Autoconf 和 A​​utotools 的替代品?

发布于 2024-07-14 04:45:42 字数 709 浏览 7 评论 0原文

我是 GNU Autotools 的频繁用户(主要是 Autoconf,偶尔 Libtool )。 我正在开发一个项目,可移植性将成为一个症结所在。然而,团队的其他成员不太愿意使用 m4。 我的收件箱中收到了,不是一个人,而是四个人:

m4 不是 lisp,该死!

不管怎样,也许有人可以推荐一些基于 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:

m4 is NOT lisp, dammit!

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 技术交流群。

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

发布评论

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

评论(9

仅一夜美梦 2024-07-21 04:45:42

我冒着被否决的机会,但我必须承认,不幸的是,自动工具没有真正的替代品。 CMake、SCons、bjam 都不错,但是,当涉及到严肃的工作时......很明显,自动工具更优越,不是因为 CMake 不能做同样的事情,而是因为用它来做同样的事情要困难得多。

例如,CMake(最流行的 autotools 替代品)具有以下缺点:

  • 不支持 gettext。 当您需要管理大量翻译和翻译后的源代码时,这可能是一个真正的问题。
  • 不支持卸载目标。 发现无法卸载所安装的程序是非常不愉快的。
  • 无法自动构建共享库和静态库。
  • 文档非常有限且糟糕。

等等。

还有很多其他要点。 不幸的是,没有真正的高质量自动工具替代品。 另一方面,如果您在 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:

  • No support of gettext. This may be a real problem when you need to manage a lot of translations and translated source code.
  • No support for an uninstall target. It is quite unpleasant to find out that you can't uninstall the program you installed.
  • No automatic build of both shared and static libraries.
  • Documentation is very limited and bad.

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.

八巷 2024-07-21 04:45:42

我听说过关于 CMake 的好消息,它试图解决同样的问题。 这里是维基百科文章

I have heard good things about CMake which tries to solve the same problems. Here is the wikipedia article

意犹 2024-07-21 04:45:42

我在 SCons 方面取得了巨大成功。 它是用 Python 构建的,构建脚本实际上是 Python 脚本本身,这赋予了强大的表达能力。 来自网站:

SCons 是一个开源软件构建工具,即下一代构建工具。 将 SCons 视为经典 Make 实用程序的改进的跨平台替代品,具有类似于 autoconf/automake 的集成功能和编译器缓存(例如 ccache) >。 简而言之,SCons 是一种更简单、更可靠、更快速的软件构建方式。

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:

SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.

江湖正好 2024-07-21 04:45:42

有很多不同的替代 Makefile 生成器和构建系统:

也可用,但不严格针对 C/C++:

  • < a href="http://industriousone.com/premake" rel="noreferrer">Premake
  • Ant(对于 Java)
  • Rake(对于 Ruby)
  • (肯定更多,我只是不知道全部。 ..)

但是在列出所有这些之后,自动工具具有不需要最终用户任何其他依赖项的巨大优势。 配置脚本仅由开发人员生成一次,并且不需要用户端执行任何特殊操作,因为它是 shell 脚本。 必须先安装上面列出的工具,然后任何人都可以构建您的源代码,它们甚至可能本身具有依赖项。

There are a lot of different alternative Makefile generators and build systems out there:

Also available, but not stringently targeted on C/C++:

  • Premake
  • Ant (for Java)
  • Rake (for Ruby)
  • (Definitely more, I just don't know them all...)

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.

り繁华旳梦境 2024-07-21 04:45:42

简单地使用 Makepkg-config

这里有一个Makefile 模板来帮助您入门。

人少即是人多。

How about simply using Make and pkg-config?

Here is a Makefile template to get you started.

Less is more people.

染柒℉ 2024-07-21 04:45:42

另一种自动*替换 - mk-configure。 可以在此处找到文档

One more auto* replacement - mk-configure. Docs can be found here

不交电费瞎发啥光 2024-07-21 04:45:42

我看过 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

一抹微笑 2024-07-21 04:45:42

Mozilla 正在创建一个 Python 版本的 make - pymake -这大概支持跨平台使用。

There's a python version of make being created at Mozilla - pymake - which presumably supports cross-platform use.

乖乖哒 2024-07-21 04:45:42

要从 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.

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