【发布时间】:2020-03-16 04:03:14
【问题描述】:
我的项目依赖于 C 语言中的第三方库 (-ies),它本身有一个基于自动工具的独立构建系统。
我想在源代码树中拥有一个第三方库的副本,并为我的项目编写基于自动工具的通用构建系统,这样我就可以拥有一个配置和所有常用的自动工具捆绑来完成一个完整的一次性构建。
这个系统会以某种方式首先构建第三方库(使用第三方的 configure.ac 等,就好像它是独立构建的一样),然后编译并将我的所有源与第三方库链接(我愿意只需将我的程序静态链接到第三方库,而不是将第三方库安装在系统位置的任何位置,例如 /usr/local 等)。
所以我假设一个项目的目录结构如下:
project/
src/
folder_with_my_source_code/
third-party/
third-party-lib-1/
src/
Makefile.am // native lib-1 files, prefer to keep unmodified
configure.ac // native lib-1 files, prefer to keep unmodified
third-party-lib-2/
src/
Makefile.am // native lib-2 files, prefer to keep unmodified
configure.ac // native lib-2 files, prefer to keep unmodified
Makefile.am // do I need this at all ?
Makefile.am //this should describe how to build my files
Makefile.am // project's root makefile
configure.ac // this, probably, should somehow include instructions on how to build lib-1 and lib-2 with their supplied configure.ac's ?
如何创建这种类似链的依赖构建?
【问题讨论】:
-
嘿@psb,你可以在这里阅读how to ask。一般来说,关于 SO 的问题应该针对特定的问题。例如在这里你可以问
How can I use autoconf to configure and build sub-projects (that also use autoconf) recursively ?(如果这确实是你的问题,我不熟悉autoconf我可能误解了你的意图)而不是征求人们的意见。