如何使用autotools处理子项目? [英] How to handle subprojects with autotools?

查看:124
本文介绍了如何使用autotools处理子项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些C ++项目自动工具生成。

I have some C++ project build by autotools.

该项目使用了一些库,也是我写的。库的源作为git的子模块导入到项目中。每个图书馆都有自己的自动工具文件。

The project uses some libraries, also written by me. Source of libraries are imported to the project as submodules of git. Each library has its own autotools files.

说:我有:

src/<my src files>
modules/libfoo/
        libbar/
Makefile.am
Configure.in
<other autotools junk>

我想要的是以某种方式将库包含到主项目编译链中。我想,只包括subdir到Makefile.am是不够的,因为一些检查可以在configure.am中重组。

What I want is to somehow include libraries into main project compilation chain. I guess that just including subdir to Makefile.am is not enough, because some checks can be reformed in configure.am.

推荐答案

您可以通过将 AC_CONFIG_SUBDIRS 命令添加到顶层配置脚本,在子模块中运行配置脚本。它告诉顶级脚本下降到子目录并调用在那里找到的配置脚本。然后,你可以从你的Makefile.am中引用构建的库。

You can run the configure scripts in the sub-modules by adding the AC_CONFIG_SUBDIRS command to the top-level configure script. It tells the top-level script to descend into the sub directories and invoke the configure script found there. Then, you can just reference the built libraries from your Makefile.am.

阅读这个节。GNU automake手册。

Read this section of the GNU automake manual.

这篇关于如何使用autotools处理子项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆