header-files - 用automake将头文件放在/usr/include的子目录中?

标签 header-files autotools automake

如果我编写一个库,并且包含用于开发的头文件,并且具有这样的src/Makefile.am

AM_CFLAGS = -std=c99 -Wall -Werror -Os
lib_LTLIBRARIES = libmylibrary.la
libmylibrary_la_SOURCES = a.c b.c
include_HEADERS = a.h b.h


一切正常。但是,a.hb.h直接安装在/usr/include(或/usr/local/include)下。我应该怎么做才能将它们安装在特定于我的库的子目录中,例如/usr/include/mylibrary

最佳答案

就像您提到的pkginclude_HEADERS一样,您也可以将头文件安装到/usr/include的任意子目录中,并使用您喜欢的任何名称,如下所示:

otherincludedir = $(includedir)/arbitrary_name
otherinclude_HEADERS = a.h b.h

关于header-files - 用automake将头文件放在/usr/include的子目录中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5603902/

相关文章:

python - 使用 Makefile.am 相对于 setup.py 有什么缺点吗?

c - 如果主程序包含 int 和 char 作为参数,如何在主程序中定义和调用外部函数?

c - C中的头文件有什么意义?

c - C 中的前向结构声明;不工作

c - 如何在我的项目中使用 Linux like CONFIG_* 配置?

c++ - 使用 Autotools 生成 .so 文件

autotools - 如何配置 autotools/gcc 以使用绝对路径打印警告和错误?

在 h 文件中声明的 c++ 静态数组给出警告 'defined but not used'

c++ - 如何使用 Autoconf 通过 "./configure"设置定义

autoconf - 如何将 autoconf/automake 指向非标准包