为配置添加一个选项

发布于 2025-01-31 10:49:07 字数 299 浏览 3 评论 0原文

所有这些,

我想尝试在项目中的配置脚本中添加一个选项。

对于一个示例,我正在查看我正在用于开发的库-WXWIDGETS。

WXWIDGETS在configure.in文件中具有其选项设置和解析。

我的项目没有此文件,它具有configure.ac文件,我应该修改。

然后,这只是使用适当的语法来解析参数的问题,我可以从样本中获取。

这是正确的吗?

我的项目由Anjuta生成配置和Makefile。

tia!

ALL,

I want to try and add an option to my configure script in my project.

For an example I'm looking at the library I'm using for development - wxWidgets.

wxWidgets have their options set and parsed inside configure.in file.

My project doesn't have this file instead it has configure.ac file which AFAIU, I should modify.

And then it just a matter of using proper syntax for parsing the arguments, which I can pick up from the sample.

Is this correct?

My project generates configure and Makefile by Anjuta.

TIA!!

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

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

发布评论

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

评论(1

旧时光的容颜 2025-02-07 10:49:07

configure.in是要自动输入的主要输入文件的旧名称。同一文件的首选名称现在为configure.ac。您不需要或不需要。无论您拥有哪个是您要修改的一个,以将参数添加到生成的configure脚本。

您要使用的autoconf宏是ac_arg_with - with-foo参数>参数或ac_arg_enable - enable-- foo参数。

当然,添加参数是简单的部分。为了使其有用,您还需要编写代码,以赋予该选项所需的效果。也许您正在查看的示例代码将是足够的资源,但我持怀疑态度。至少,这可能不是剪裁&糊状情况。

configure.in is an old name for the primary input file to Autoconf. The preferred name for the same file is now configure.ac. You do not need or want both. Whichever you have, yes, is the one you would want to modify to add arguments to the generated configure script.

The Autoconf macros you would want to use are AC_ARG_WITH for a --with-foo argument or AC_ARG_ENABLE for an --enable-foo argument.

Of course, adding the argument is the easy part. For it to be useful, you will need also to write the code that gives the option its desired effect. Perhaps the example code you are looking at will be a sufficient resource for that, but I am skeptical. At least, this is probably not a cut & paste kind of situation.

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