将一个CFLAG(如-std = gnu99)添加到(Eclipse CDT)自动工具项目中 [英] Where to add a CFLAG, such as -std=gnu99, into an (Eclipse CDT) autotools project
问题描述
CFLAGs(通过检查)似乎要 -g -O2
。
我希望所有生成的make文件也有 -std = gnu99
附加到CFLAGs,因为我使用 for(int i = 0; i< MAX; i ++)
等。
我可以明显地删除Makefile,但是在 ./ configure
上覆盖。
代码中需要添加(或更改)CFLAG的正确位置在哪里(与用户想要更改的CFLAG相反)?
PS我想通过编辑文本文件(例如 Makefile.am
或 configure.ac
)来执行此操作,
只需遇到同样的问题。
这是解决方案,只需在配置选项的末尾添加CFLAGS:
如果要通过编辑配置.ac
,只需将 CFLAGS + =something
添加到 configure.ac
I have a simple Autotools C project (not C++), whose skeleton was created for me by Eclipse CDT (Juno).
CFLAGs (by inspection) seem to be -g -O2
.
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.
I can obviously hack the Makefile, but this gets overwritten on ./configure
.
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. 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.
Just run into the same problem.
Here is the solution, just add the CFLAGS at the end of the configure options:
If you want to do this by editing configure.ac
, just add CFLAGS+=" something"
into configure.ac
这篇关于将一个CFLAG(如-std = gnu99)添加到(Eclipse CDT)自动工具项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!