X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2c785689e4a3163f6f1b644ec31c6a82642e9f14..29e74c4f96dc3d73055558ba40282883f570ab2e:/build_nmh diff --git a/build_nmh b/build_nmh index 60913b68..49af380a 100755 --- a/build_nmh +++ b/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 asserts enabled and optimization disabled +# -d to build nmh with optimization disabled # -s to use 'make superclean': requires recent autoconf and automake, # see docs/README.developers # -r to build rpm @@ -48,7 +48,7 @@ logfile=build_nmh.log usage="usage: [-b , only if downloading] [-c to run 'make distcheck' instead of 'make check'] - [-d to build nmh with asserts enabled and optimization disabled] + [-d to build nmh with optimization disabled] [-i to install nmh] [-l , default '$logfile'] [-r to build rpm] @@ -214,8 +214,7 @@ else fi #### -#### Set up configure options. Handle options that can have embedded -#### spaces (currently just smtpservers) specially. +#### Set up configure options. #### #### Here are the config options that we will try to detect, then @@ -223,7 +222,7 @@ fi config_prefix=/usr/local/nmh config_locking= config_mts=smtp -config_smtpservers=localhost +config_smtpserver=localhost config_sasl='determined by configure' config_tls='determined by configure' config_debug=n @@ -253,9 +252,8 @@ if install-mh -check >/dev/null 2>&1; then mtsconfservers=`grep '^servers:' "$mtsconf"` if [ "$mtsconfservers" ]; then - servers=`echo "$mtsconfservers" | \ - sed -e 's/^servers: *//' -e 's/ /\\\ /g'` - [ "$servers" ] && config_smtpservers="$servers" + servers=`echo "$mtsconfservers" | sed -e 's/^servers: *//'` + [ "$servers" ] && config_smtpserver="$servers" fi fi @@ -295,33 +293,30 @@ if [ $yes -eq 0 ]; then [ "$mts" ] && config_mts="$mts" if [ "$config_mts" = smtp ]; then - printf 'SMTP server(s), space separated [%s]: ' $config_smtpservers >&3 - read response - servers=`echo $response | sed -e 's/ /\\\ /g'` - [ "$servers" ] && config_smtpservers="$servers" + printf 'SMTP server [%s]: ' $config_smtpserver >&3 + read server + [ "$server" ] && config_smtpserver="$servers" fi - printf 'Cyrus SASL support [%s]: ' "$config_sasl" >&3 + printf 'Cyrus SASL support (y|n) [%s]: ' "$config_sasl" >&3 read response [ "$response" = y -o "$response" = Y ] && config_sasl=y - printf 'TLS support [%s]: ' "$config_tls" >&3 + printf 'TLS support (y|n) [%s]: ' "$config_tls" >&3 read response [ "$response" = y -o "$response" = Y ] && config_tls=y fi -smtpservers= config_opts="--prefix=$config_prefix" [ "$config_locking" ] && config_opts="$config_opts --with-locking=$config_locking" [ "$config_mts" -a "$config_mts" != smtp ] && config_opts="$config_opts --with-mts=$config_mts" -[ "$config_smtpservers" -a "$config_smtpservers" != localhost ] && - smtpservers="--with-smtpservers=$config_smtpservers" +[ "$config_smtpserver" -a "$config_smtpserver" != localhost ] && + config_opts="$config_opts --with-smtpserver=$config_smtpserver" [ "$config_sasl" = y ] && config_opts="$config_opts --with-cyrus-sasl" [ "$config_tls" = y ] && config_opts="$config_opts --with-tls" -[ $config_debug = y ] && config_opts="$config_opts --enable-assert" #### dotlocking, the usual default, requires chgrp and chmod of inc. installpriv= @@ -368,17 +363,17 @@ 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 -ansi -pedantic' + CFLAGS='-g -std=c99 -pedantic' if [ "$config_debug" = n ]; then - CFLAGS="$CFLAGS -O2" + CFLAGS="$CFLAGS -O2 -D_FORTIFY_SOURCE=2" else CFLAGS="$CFLAGS -O0" fi fi fi -printf '\n./configure %s\n' "$config_opts${smtpservers:+ $smtpservers}" -./configure CFLAGS="${CFLAGS}" $config_opts${smtpservers:+" $smtpservers"} +printf "\n./configure ${CFLAGS:+CFLAGS=\"${CFLAGS}\" }$config_opts\n" +./configure ${CFLAGS:+CFLAGS="${CFLAGS}"" "}$config_opts status=$? if [ $status -eq 0 ]; then