From: David Levine Date: Tue, 25 Oct 2016 15:10:01 +0000 (-0400) Subject: Add -O0 instead of -O2 to CFLAGS with build_nmh -d option. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6c7ccdd0262b031952bd72ace8c96bdf38aa9918?ds=sidebyside;hp=e2cef70fec5fc03ca28987f8005b6549e9e23e6b Add -O0 instead of -O2 to CFLAGS with build_nmh -d option. --- diff --git a/docs/contrib/build_nmh b/docs/contrib/build_nmh index 2d0fe3e0..b69dc08a 100755 --- a/docs/contrib/build_nmh +++ b/docs/contrib/build_nmh @@ -33,7 +33,7 @@ # -l , default 'build_nmh.log', - for stdout/stderr # Advanced/developer use: # -c to run 'make distcheck' instead of 'make check' -# -d to build nmh with debug enabled +# -d to build nmh with asserts enabled and optimization disabled # -s to use 'make superclean': requires recent autoconf and automake, # see docs/README.developers # -r to build rpm @@ -47,7 +47,7 @@ usage="usage: $0 [-b , only if downloading] [-c to run 'make distcheck' instead of 'make check'] - [-d to build nmh with debug enabled] + [-d to build nmh with asserts enabled and optimization disabled] [-i to install nmh] [-l , default '$logfile'] [-r to build rpm] @@ -241,6 +241,7 @@ if install-mh -check >/dev/null 2>&1; then fi fi +#### Don't confirm debug interactively below; obey the -d option to this script. [ $debug -ge 1 ] && config_debug=y if [ $yes -eq 0 ]; then @@ -271,8 +272,6 @@ if [ $yes -eq 0 ]; then printf 'TLS support [%s]: ' "$config_tls" >&3 read response [ "$response" = y -o "$response" = Y ] && config_tls=y - - #### Don't confirm debug here: obey the -d option to this script. fi smtpservers= @@ -331,7 +330,12 @@ if [ -z "$CFLAGS" ]; then if cc -dM -E - &1 | grep __GNUC__ >/dev/null; then #### configure will supply -g -O2 with gcc, but only if CFLAGS #### isn't defined. - CFLAGS='-g -O2 -ansi -pedantic' + CFLAGS='-g -ansi -pedantic' + if [ "$config_debug" = n ]; then + CFLAGS="$CFLAGS -O2" + else + CFLAGS="$CFLAGS -O0" + fi fi fi