How to handle subprojects with autotools?

放肆的年华 提交于 2019-12-06 19:29:48

问题


I have some C++ project build by autotools.

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.

Say, I have:

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

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.


回答1:


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.

Read this section of the GNU automake manual.



来源:https://stackoverflow.com/questions/11776382/how-to-handle-subprojects-with-autotools

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!