X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/eca05e65abb3a1c9491c4294ab2600d2cec8615b..62b9266aa31b2baced3252987b256b4e43ec9573:/build_nmh diff --git a/build_nmh b/build_nmh old mode 100755 new mode 100644 index 6958faa8..4c2e2c27 --- 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] @@ -122,7 +122,7 @@ download_sources() { [ "$verbose" -eq 0 ] && git_opts=--quiet [ "$branch" = master ] || git_opts="${git_opts:+$git_opts }--branch $branch" - if "$gitdir"/git clone --depth 1 $git_opts "git://$gitrepo/nmh.git" >&3 + if "$gitdir"/git clone $git_opts "git://$gitrepo/nmh.git" >&3 then directory=nmh cd "$directory" || die "failed to clone $directory" @@ -257,7 +257,7 @@ if install-mh -check >/dev/null 2>&1; then fi fi - if test -x "$mhbin/mhparam"; then + if test $yes -eq 1 -a -x "$mhbin/mhparam"; then if mhparam sasl >/dev/null; then case `$mhbin/mhparam sasl` in *sasl*) config_sasl=y ;; @@ -315,9 +315,16 @@ config_opts="--prefix=$config_prefix" config_opts="$config_opts --with-mts=$config_mts" [ "$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" +if [ "$config_sasl" = y ]; then + config_opts="$config_opts --with-cyrus-sasl" +elif [ "$config_sasl" != 'determined by configure' ]; then + config_opts="$config_opts --with-cyrus-sasl=no" +fi +if [ "$config_tls" = y ]; then + config_opts="$config_opts --with-tls" +elif [ "$config_tls" != 'determined by configure' ]; then + config_opts="$config_opts --with-tls=no" +fi #### dotlocking, the usual default, requires chgrp and chmod of inc. installpriv= @@ -364,17 +371,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" -./configure CFLAGS="${CFLAGS}" $config_opts +printf "\n./configure $config_opts${CFLAGS:+ CFLAGS=\"${CFLAGS}\"}\n" +./configure $config_opts ${CFLAGS:+CFLAGS="${CFLAGS}"} status=$? if [ $status -eq 0 ]; then