configure.in change

Herb Lewis herb at chomps.engr.sgi.com
Fri Apr 6 02:22:37 GMT 2001


This is what I propose for configure.in (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
CFLAGS.

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 configure.in file
but it was not tested with CFLAGS environment set.

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

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




More information about the samba-technical mailing list