X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/3956385cc6e2101f354c1378ae3bc654eaecec0a..6c7ccdd0262b031952bd72ace8c96bdf38aa9918:/docs/contrib/build_nmh diff --git a/docs/contrib/build_nmh b/docs/contrib/build_nmh index 6c90d66f..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] @@ -188,8 +188,8 @@ config_prefix=/usr/local/nmh config_locking= config_mts=smtp config_smtpservers=localhost -config_sasl=n -config_tls=n +config_sasl='determined by configure' +config_tls='determined by configure' config_debug=n @@ -235,12 +235,13 @@ if install-mh -check >/dev/null 2>&1; then else tput smso echo "$0: SASL and TLS detection not supported with current nmh" - [ $yes -eq 1 ] && echo "will not configure them in" + [ $yes -eq 1 ] && echo "configure will determine whether to enable" tput rmso fi 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 @@ -264,15 +265,13 @@ if [ $yes -eq 0 ]; then [ "$servers" ] && config_smtpservers="$servers" fi - printf 'Cyrus SASL support [%s]: ' $config_sasl >&3 + printf 'Cyrus SASL support [%s]: ' "$config_sasl" >&3 read response [ "$response" = y -o "$response" = Y ] && config_sasl=y - printf 'TLS support [%s]: ' $config_tls >&3 + 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