configure.ac: default CFLAGS, LT_INIT adds "-g -O2"
Today I spent quite some time trying to figure out why am I seeing
-g -O2 present in
CFLAGS by default when building some projects. As it turned out, it's the
LT_INIT (called in
-g -O2 to
CFLAGS if they're empty. I could not find anything in documentation describing this behavior. The problem is that this behavior is inconsistent across the Osmocom projects: for some you get empty CFLAGS by default, for some you get
CFLAGS=-g -O2. Most likely this inconsistency was introduced when we started to specify the
-std=gnu11 explicitly: in some projects (e.g. libosmocore.git, libosmo-abis.git, osmo-bsc) we set
CFLAGS before calling the
LT_INIT, in some (osmo-hlr, osmo-iuh, osmo-sgsn) after.
We need to decide on whether we want to have empty
CFLAGS=-g -O2 set by default. Personally I prefer the former approach, because explicit is better then implicit. Hoernchen also prefers the former and does not want "magical flags out of nowhere". Either way, the default behavior should be consistent across all Osmocom projects. laforge what do you think?