应用前Autoconf编译依赖

发布于 2024-07-23 23:16:59 字数 398 浏览 5 评论 0原文

在过去的几天里,我一直在使用自动工具,终于取得了重大进展。 我遇到的一个问题是我有两个库需要在主应用程序代码之前编译。 我不太确定该怎么做。 我的目录结构如下,还有来自我的configure.ac 的片段。

AC_CONFIG_FILES([Makefile
         src/Makefile
         gtkworkbook/Makefile
         csv/Makefile])
AC_OUTPUT

我需要在src/Makefile之前编译csv/Makefilegtkworkbook/Makefile; 有什么办法可以指定这个吗? 现在,我在应用程序编译过程中收到有关库 (csv) 不存在的错误。

I have been tooling around with autotools for the past couple of days, and finally have made significant progress. One problem I am having is that I have two libraries that need to be compiled before the main application code. I'm not quite sure how to do this. My directory structure is below and a snippet from my configure.ac as well.

AC_CONFIG_FILES([Makefile
         src/Makefile
         gtkworkbook/Makefile
         csv/Makefile])
AC_OUTPUT

I need the csv/Makefile and gtkworkbook/Makefile to both be compiled before src/Makefile; is there any way to specify this? Right now I am getting an error about the library (csv) not existing during the application compile process.

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

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

发布评论

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

评论(1

纸短情长 2024-07-30 23:17:00

AC_CONFIG_FILES() 中的项目顺序不会影响构建顺序。 如果您使用 automake(我假设您使用的是 automake),它将按照您在每个 Makefile.am 的 SUBDIRS 列表中列出目录的顺序遍历您的目录树。

话虽这么说,为了一致性/可维护性,您应该让 AC_CONFIG_FILES() 中的项目顺序反映构建顺序。

如何按照所需顺序构建顶级 Makefile.am 的 SUBDIRS 的示例:

SUBDIRS = csv gtkworkbook src

另外,对于这个简单的情况,您不需要同时使用 AC_CONFIG_FILES() 和 AC_OUTPUT()。 您可以将列表目录传递给 AC_OUTPUT():

AC_OUTPUT([
    Makefile
    src/Makefile
    gtkworkbook/Makefile
    csv/Makefile
])

The order of items in AC_CONFIG_FILES() does not affect the build order. If you're using automake, which I assume you are, it will traverse your directory tree in the order that you list directories in each Makefile.am's SUBDIRS list.

That being said, you should have the order of items in AC_CONFIG_FILES() mirror the build order, for consistency/maintainability.

Example of how your toplevel Makefile.am's SUBDIRS to build in the desired order:

SUBDIRS = csv gtkworkbook src

Also, for this simple case you don't need both AC_CONFIG_FILES() and AC_OUTPUT(). You can pass your list directory to AC_OUTPUT():

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