Herb Lewis herb at
Fri Apr 6 02:22:37 GMT 2001

This is what I propose for (and configure)

Without --enable-debug CFLAGS will be set to -O if undefined else
it will prepend -O to environment CFLAGS. One "drawback" to this
is if the environment has -g set then you will not "optimize
by default" as the comment says. Presumably if the environment
was set, this is what you wanted anyway. This way you only get
the -O duplicated instead of the entire CFLAGS environment
(assuming -O was in CFLAGS). The alternative would be to make
the first definition CFLAGS=${CFLAGS-"-O"} which would not
duplicate anything but also would not guarantee -O would be in

With --enable-debug CFLAGS will be set to -g if undefined else
it will have -g appended to the end of its environment definition.
-g typically overrides any -O setting and since it is last it will
override any -g[n] settings as well (at least with IRIX compilers).

Does anyone see any problems with this change? I assume this is 
what was originally intended by the change to file
but it was not tested with CFLAGS environment set.

RCS file: /data/cvs/samba/source/,v
retrieving revision
diff -u -r1.130.4.22
---        2001/04/03 00:34:41
+++        2001/04/06 01:53:38
@@ -108,14 +108,14 @@
 # compile with optimization and without debugging by default
 AC_ARG_ENABLE(debug, [  --enable-debug        turn on debugging
     [if eval "test x$enable_debug = xyes"; then
-       OPTIM="-g"
+       CFLAGS="${CFLAGS} -g"
 dnl Checks for programs.

Herb Lewis                               Silicon Graphics 
Networking Engineer                      1600 Amphitheatre Pkwy MS-510
Strategic Software Organization          Mountain View, CA  94043-1351
herb at                             Tel: 650-933-2177                       Fax: 650-932-2177          

More information about the samba-technical mailing list