为配置添加一个选项
所有这些,
我想尝试在项目中的配置脚本中添加一个选项。
对于一个示例,我正在查看我正在用于开发的库-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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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 nowconfigure.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 generatedconfigure
script.The Autoconf macros you would want to use are
AC_ARG_WITH
for a--with-foo
argument orAC_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.