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="$CFLAGS something"
into configure.ac
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With