[sword-devel] Is --enable-debug what I want?
Jonathan Marsden
jmarsden at fastmail.fm
Sat May 16 14:19:28 MST 2009
Dmitrijs Ledkovs wrote:
> I've setup packaging and I've also added --enable-debug flag to
> configure. It failed to build from source on all 4 ubuntu releases X 3
> arch with following error:
The key thing to notice is:
> cc1plus: warnings being treated as errors
Since that the code concerned generates compiler warnings (which
probably should be submitted as a wishlist bug, so we eventually clean
that up!)... the compile errors out.
So I'd say that --enable-debug is turning on -Werror in some way. Why
it does that, and whether it should, is a different question :) I
suppose you could argue that before debugging something it pays to get
rid of all known compiler warnings... maybe that is what the SWORD team
decided?
> Is it known that --enable-debug is broken?
I strongly suspect that it works as designed on warning-free code :)
> Do I need it if I want debug symbols left within binaries?
> What does it actually do?
It does whatever configure.ac tells the SWORD build system to do,
starting around line 60:
# ---------------------------------------------------------------------
# Debug and profile
# ---------------------------------------------------------------------
# these are first because the SET AM_C.*FLAGS, not just append
if test x$enable_debug = xyes; then
GCJFLAGS="-g -O0"
if test x$ac_cv_prog_cc_g = xyes; then
AM_CFLAGS="-g3 -O0 -Wall -Werror"
else
AM_CFLAGS="-O0 -Wall -Werror"
fi
if test x$ac_cv_prog_cxx_g = xyes; then
AM_CXXFLAGS="-g3 -O0 -Wall -Werror"
else
AM_CXXFLAGS="-O0 -Wall -Werror"
fi
else
AM_CFLAGS="-O3"
AM_CXXFLAGS="-O3"
fi
So, my guess was correct, it does indeed set -Wall -Werror (as well as
setting -O0 and -g3 which is what I would have expected).
You could patch that out in configure.ac (so it just sets -O0 and -g3)
and then regenerate configure.in and configure, to test whether that
solves the FTBFS issue. I'm pretty sure it would, but tests are better
than guesses.
Hopefully, someone from the SWORD team can explain *why* enable-debug
adds -Wall and -Werror , and then we'll be in a better position to
decide how to move forward with this.
Jonathan
More information about the sword-devel
mailing list