简体   繁体   English

如何在include_HEADERS上一起使用autotools nobase和nodist前缀

[英]How to use autotools nobase and nodist prefixs together on include_HEADERS

I have some header files in a sub directory, that must be copied to a same-named sub directory in my include directory. 我在子目录中有一些头文件,必须将其复制到我的include目录中的同名子目录。 I can use the nobase prefix to make that happen (I'm working with heimdal code, fyi): 我可以使用nobase前缀来实现(我正在使用heimdal代码,fyi):

nobase_include_HEADERS = hcrypto/aes.h \
      hcrypto/bn.h      \
      hcrypto/cmac.h    \
      hcrypto/des.h     \
      hcrypto/dh.h      \
      hcrypto/dsa.h     \
etc...

But some of those header files are generated during the build process (since heimdal must be built before those header files exist), so I need to use the nodist prefix so that the dist doesn't die. 但是其中一些头文件是在构建过程中生成的(因为heimdal必须在这些头文件存在之前构建),所以我需要使用nodist前缀以便dist不会死。

I found an article that said I could use them both together, and even provided a similar example, so I did this: 我发现一篇文章说我可以一起使用它们,甚至提供了一个类似的例子,所以我这样做了:

nobase_nodist_include_HEADERS = hcrypto/aes.h \
      hcrypto/bn.h      \
      hcrypto/cmac.h    \
      hcrypto/des.h     \
      hcrypto/dh.h      \
      hcrypto/dsa.h     \
etc...

I didn't notice any warnings or errors, but those header files DO NOT get copied to my include directory. 我没有注意到任何警告或错误,但这些头文件不会被复制到我的include目录。 Am I doing something wrong, or is there a bug in autotools? 我做错了什么,或者autotools中有错误吗?

Interesting, if I reverse the prefixes, I get this error: 有趣的是,如果我反转前缀,我会收到此错误:

Makefile.am:93: error: 'nodist_nobase_include_HEADERS' is used but 'nobase_includedir' is undefined

The reason for that error is explained here in the automake documentation : 这个错误的原因在automake文档中有解释:

'nobase_' should be specified first when used in conjunction with either 'dist_' or 'nodist_' 当与'dist_'或'nodist_'一起使用时,应首先指定'nobase_'

I've also defined nodist_include_HEADERS (which is working). 我还定义了nodist_include_HEADERS(这是有效的)。 Maybe the two definitions are causing some kind of conflict? 也许这两个定义会导致某种冲突?

I just tried removing the nodist_include_HEADERS and putting all my headers under the nobase_nodist_include_HEADERS line, but now NONE of my headers get installed. 我只是尝试删除nodist_include_HEADERS并将所有标题放在nobase_nodist_include_HEADERS行下,但现在我的标题都没有安装了。

Automake and system info: automake (GNU automake) 1.13.4 openSUSE 13.2 (x86_64) Automake和系统信息:automake(GNU automake)1.13.4 openSUSE 13.2(x86_64)

If the headers were generated by a program, you should mark them with BUILT_SOURCES , this way automake will not be confused to try to install them as dist . 如果标题是由程序生成的,则应使用BUILT_SOURCES标记它们,这样就不会混淆automake以尝试将它们安装为dist

Second, for headers files that are not meant to be installed, it's better to use SOURCES directive, rather than HEADERS . 其次,对于不打算安装的头文件,最好使用SOURCES指令,而不是HEADERS Try this: 试试这个:

nobase_include_SOURCES += hcrypto/aes.h \
    hcrypto/bn.h      \
    hcrypto/cmac.h    \
    hcrypto/des.h     \
    hcrypto/dh.h      \
    hcrypto/dsa.h
BUILT_SOURCES = hcrypto/aes.h \
    hcrypto/bn.h      \
    hcrypto/cmac.h    \
    hcrypto/des.h     \
    hcrypto/dh.h      \
    hcrypto/dsa.h

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM