Autoconf/Automake:如何避免通过“检查” AC_CONFIG_SUBDIRS 的选项

发布于 2024-12-19 03:41:25 字数 591 浏览 1 评论 0原文

我正在使用 Autoconf 来构建我的 C++ 项目。它使用第三方代码,这些代码也是在 Autoconf/Automake 的帮助下构建的。因此,在我的 configure.ac 中,我有以下行:

AC_CONFIG_SUBDIRS([subdirectoryname])

一切正常,但我还使用该功能在执行 make check 时自动进行测试 -这也是由第三方代码完成的。因为这些测试需要一段时间,所以每次我想测试自己的代码时都执行它们很烦人。那么有什么方法可以避免 check 选项传递到子目录的 Makefile 中吗?

更新:覆盖check-recursive似乎不是一个选项,因为我的顶级Makefile.am看起来(或多或少)像这样:

SUBDIRS=library src

所以禁用对此的检查level 还会禁用我的 src 文件夹内的检查。这不是我想要实现的目标。我只想禁用 library 目录中的检查。

I'm using Autoconf to build my c++ project. It uses third party code which is also built with the help of Autoconf/Automake. So in my configure.ac I've got the following line:

AC_CONFIG_SUBDIRS([subdirectoryname])

Everything works fine, but I also use the feature to let tests be automatically made if make check is executed - which is done by the third party code as well. Because these tests take a while it's annoying to execute them each time I want to test my own code. So is there any way to avoid that the check option is passed to the subdirectory's Makefile?

Update: Overriding check-recursive does not seem to be an option, as my top-level Makefile.am looks (more or less) like this:

SUBDIRS=library src

So disabling checking on this level would also disable the checking inside my src folder. And that's not what I want to achieve. I just want to disable the checking in the library directory.

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

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

发布评论

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

评论(2

紫﹏色ふ单纯 2024-12-26 03:41:25

Makefile.am 中覆盖 check-recursive 应该可以:

check-recursive:
     @true

或者,如果您只想签入特定目录:

check-recursive:
     $(MAKE) -C src check

Overriding check-recursive in your Makefile.am should work:

check-recursive:
     @true

or, if you only wanted to check in a specific directory:

check-recursive:
     $(MAKE) -C src check
为你拒绝所有暧昧 2024-12-26 03:41:25

根据autoconf手册,如果找到的话,它将执行子目录中的configure.gnu脚本。理论上,这可能是一个脚本,它将 --disable-tests 或类似选项添加到对 ./configure 的调用中。

也就是说,我还没有让它在我自己的项目上工作。 :-/

according to the autoconf manual, it will execute a configure.gnu script in the subdirectory if it finds one. Theoretically that could be a script which adds a --disable-tests or similar option to a call to ./configure

That said, I've yet to get this to work on a project of my own. :-/

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