Instead of opening a new subject, I rather continue with this subject.
Anyway, I compile/build a project with Autotools and have an issue with it.
GCC seems to use some default flags like: -g -O2
In the Makefile.am I have the following:
AM_CFLAGS = -Wall
When it compiles I see output like that "gcc somefile.c -Wall -g -O2"
If I modify AM_CFLAGS to "-Wall -g3 -O0" I assume to get an executable for best debugging. But the output is like this: "gcc somefile.c -Wall -g3 O0 -g -O2"
So I guess the source files will finally be compiled according to -g -O2 flags.
The problem is when debugging, some parts of the source are optimized away and so can't see what happens.
How can I turn off the gcc default flag or modify it?
Thanks in advance.