]> diplodocus.org Git - nmh/blobdiff - docs/contrib/build_nmh
Reworked default SASL support to enable if header and lib are found.
[nmh] / docs / contrib / build_nmh
index 90e733a..b69dc08 100755 (executable)
@@ -33,7 +33,7 @@
 #     -l <logfile name>, 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 <branch>, 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 <logfile name>, default '$logfile']
   [-r to build rpm]
@@ -188,9 +188,8 @@ config_prefix=/usr/local/nmh
 config_locking=
 config_mts=smtp
 config_smtpservers=localhost
-config_sasl=n
-config_tls=n
-config_oauth=n
+config_sasl='determined by configure'
+config_tls='determined by configure'
 config_debug=n
 
 
@@ -233,19 +232,16 @@ if install-mh -check >/dev/null 2>&1; then
       case `$mhbin/mhparam tls` in
         *tls*) config_tls=y ;;
       esac
-
-      case `$mhbin/mhparam oauth` in
-        *oauth*) config_oauth=y ;;
-      esac
     else
       tput smso
-      echo "$0: SASL, TLS, and OAuth2 detection not supported with current nmh"
-      [ $yes -eq 1 ]  &&  echo "will not configure them in"
+      echo "$0: SASL and TLS detection not supported with current nmh"
+      [ $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
@@ -269,19 +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
-
-  printf 'OAuth2 support [%s]: ' $config_oauth >&3
-  read response
-  [ "$response" = y  -o  "$response" = Y ]  &&  config_oauth=y
-
-  #### Don't confirm debug here:  obey the -d option to this script.
 fi
 
 smtpservers=
@@ -295,7 +285,6 @@ config_opts="--prefix=$config_prefix"
   smtpservers="--with-smtpservers=$config_smtpservers"
 [ "$config_sasl" = y ]  &&  config_opts="$config_opts --with-cyrus-sasl"
 [ "$config_tls" = y ]  &&  config_opts="$config_opts --with-tls"
-[ "$config_oauth" = y ]  &&  config_opts="$config_opts --with-oauth"
 [ $config_debug = y ]  &&  config_opts="$config_opts --enable-assert"
 
 #### dotlocking, the usual default, requires chgrp and chmod of inc.
@@ -341,7 +330,12 @@ if [ -z "$CFLAGS" ]; then
   if cc -dM -E - </dev/null 2>&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