简体   繁体   English

使用AM_INIT_AUTOMAKE参数并配置脚本命令行参数

[英]Using AM_INIT_AUTOMAKE parameters and configure script command line parameters

Is it possible to use both command line parameters to the configure script, ala: 是否可以将两个命令行参数都用于配置脚本ala:

../configure CXXFLAGS=-O0 -g -foo -bar -bat ../configure CXXFLAGS = -O0 -g -foo -bar -bat

while simultaneously keeping any options that are passed to AM_INIT_AUTOMAKE in the configure.ac file? 同时保留在configure.ac文件中传递给AM_INIT_AUTOMAKE的任何选项? eg: 例如:

AM_INIT_AUTOMAKE([-Wall -Werror]) AM_INIT_AUTOMAKE([-Wall -Werror])

My desired result is that ALL of the above flags are passed along, eg: 我期望的结果是上述所有标志均被传递,例如:

-O0 -g -foo -bar -bat -Wall -Werror -O0 -g -foo -bar -bat -Wall -Werror

It appears that specifying CXXFLAGS on the command line either ingores or overwrites what is passed into AM_INIT_AUTOMAKE. 似乎在命令行上指定CXXFLAGS会填满或覆盖传递给AM_INIT_AUTOMAKE的内容。 If anyone knows of a way to do the union of the two sets, that would be extremely helpful. 如果有人知道两种方法的结合方法,那将非常有帮助。 Thx! 谢谢!

The -W warning categories options have nothing to do with C[XX]FLAGS . -W警告类别选项C[XX]FLAGS无关。 These are command line arguments used when invoking automake. 这些是调用自动制作时使用的命令行参数。

Conversely, the AM_INIT_AUTOMAKE options like -Wall don't affect the compiler flags. 相反, -Wall之类的AM_INIT_AUTOMAKE选项不会影响编译器标志。 It's just the decision to use these switch names that is resulting in the confusion. 只是使用这些开关名称的决定才导致混乱。 They have a similar meaning, eg, -Werror will treat automake warnings as errors, but are totally unrelated. 它们具有相似的含义,例如, -Werror将把自动制作警告视为错误,但完全不相关。

In short, you have to pass -Wall , etc., in C[XX]FLAGS to influence the compiler. 简而言之,您必须在C[XX]FLAGS传递-Wall等,以影响编译器。 And add -Wall to AM_INIT_AUTOMAKE to enable all warning categories when automake is invoked. 并将-Wall添加到AM_INIT_AUTOMAKE以在调用自动​​制作功能时启用所有警告类别。

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

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