]> diplodocus.org Git - nmh/blobdiff - docs/contrib/build_nmh
Put, rather than print, single characters.
[nmh] / docs / contrib / build_nmh
index a2372d21d4213fe56dfa33fb9397bfaefdaef3c5..73111439d60353658aeeeaed612c5c2810519505 100755 (executable)
@@ -239,7 +239,7 @@ config_opts="--prefix=$config_prefix"
 [ "$config_oauth" = y ]  &&  \
   config_opts="$config_opts --with-oauth"
 [ $config_debug = y ]  &&  \
-  config_opts="$config_opts --enable-debug --enable-assert"
+  config_opts="$config_opts --enable-assert"
 
 #### dotlocking, the usual default, requires chgrp and chmod of inc.
 installpriv=
@@ -275,8 +275,15 @@ fi
 #### Build.
 ####
 [ $verbose -ge 1 ]  &&  echo configuring . . .
+if [ -z "$CFLAGS" ]; then
+  #### Only use these flags with gcc.
+  if cc -dM -E - < /dev/null 2>&1 | egrep __GNUC__ >/dev/null; then
+    CFLAGS="-g -O2 -ansi -pedantic"
+  fi
+fi
+
 echo ./configure $config_opts ${smtpservers:+"$smtpservers"} >>"$logfile" 2>&1
-./configure CFLAGS="${CFLAGS:+$CFLAGS }-g -O2 -ansi -pedantic" \
+./configure CFLAGS="${CFLAGS}" \
             $config_opts ${smtpservers:+"$smtpservers"} >>"$logfile" 2>&1
 status=$?