首页 > 解决方案 > 如何使 Eclipse CDT Autotools 使用关闭源目录 autogen.sh

问题描述

我正在尝试配置 Eclipse CDT 2019-12 来构建一个使用自动工具的旧项目。有一个 autogen.sh 脚本,但它不包含在包含 configure.ac 和其他源文件的目录中。查看Eclipse Autotools 用户指南,这可能是运行“重新配置项目”不使用 autogen.sh 的原因。但运行 autoreconf。

我重新定义了 Autotools > Configure Settings > autogen > Command 以使用相对路径,但这没有帮助。重新定义 Autotools > General > Tools Settings > autoreconf 会导致内部错误 (NullPointerException)。

我可以做些什么来帮助 Eclipse 找到并执行非源目录 autogen.sh?

标签: eclipse-cdtautotools

解决方案


The directory containing configure.ac, and therefore where the configure script also resides and / or is created, is the root of the project's source tree by definition. In a well-formed Autotools project, there should not be any build system artifacts outside the source tree because the contents of the source tree define what gets packaged and distributed.

Moreover, it is my understanding and recollection that Eclipse relies on that in defining its logical view of an Autotools project. Eclipse goes to some trouble to try to prevent project building from accessing files outside the spaces specified in the project configuration. It does not particularly surprise me that it does not recognize an autogen.sh file outside the source tree, no matter how you try to specify its location.

First off, it would be worthwhile examining the autogen script to determine whether it's actually doing anything needful that autoreconf does not do, or if it may be intentionally omitting anything that autoreconf does. It may be that letting Eclipse use autoreconf instead of autogen.sh will work just fine.

If in fact you need Eclipse to use autogen.sh, then your best bet is probably to copy it into the source directory and update the copy appropriately for its new location.


推荐阅读