将一个CFLAG(如-std = gnu99)添加到(Eclipse CDT)自动工具项目中 [英] Where to add a CFLAG, such as -std=gnu99, into an (Eclipse CDT) autotools project

查看:215
本文介绍了将一个CFLAG(如-std = gnu99)添加到(Eclipse CDT)自动工具项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的Autotools C项目(不是C ++),其骨架是由Eclipse CDT(Juno)为我创建的。



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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆