问题描述
我有一个简单的自动工具C ++项目(不是C ++),其骨架由Eclipse CDT的(麦浚龙)。
I have a simple Autotools C project (not C++), whose skeleton was created for me by Eclipse CDT (Juno).
CFLAGS(通过检查)似乎是 -g -O2
。
CFLAGs (by inspection) seem to be -g -O2
.
我希望所有的生成make文件也有 -std = gnu99
追加到CFLAGS,因为我用的for(int i = 0; I< MAX;我++)
和类似
I want all of the generated make files to also have -std=gnu99
appended to the CFLAGs, because I use for (int i = 0; i < MAX; i++)
and similar.
我能明显破解Makefile文件,但这个被覆盖上 ./配置
。
I can obviously hack the Makefile, but this gets overwritten on ./configure
.
哪里是正确的地方加入(或改变),这是由code要求(相对于该用户可能要更改这些CFLAGS)CFLAGS?
Where is the correct place to add (or change) CFLAGs which are required by the code (as opposed to those CFLAGs which the user might want to change)?
P.S。我想通过编辑一个文本文件(如 Makefile.am
或 configure.ac
)要做到这一点,而不是点击Eclipse的一个盒子,如果可能的话。
P.S. I'd like to do this by editing a text file (such as Makefile.am
or configure.ac
), rather than clicking a box in Eclipse, if possible.
推荐答案
正好碰上同样的问题。
下面是解决方案,只是在配置选项末尾添加CFLAGS:
Here is the solution, just add the CFLAGS at the end of the configure options:
如果您希望编辑要做到这一点 configure.ac
,只需添加 CFLAGS + =东西
到 configure.ac
If you want to do this by editing configure.ac
, just add CFLAGS+=" something"
into configure.ac
这篇关于其中,以添加CFLAG,如-std = gnu99,成(Eclipse CDT的)自动工具项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!