AC_PROG_CC
+AC_CACHE_CHECK(whether compiler supports -Wno-pointer-sign, nmh_cv_has_noptrsign,
+[nmh_saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wno-pointer-sign"
+ AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
+ CFLAGS="$nmh_saved_cflags"])
+
dnl if the user hasn't specified CFLAGS, then
dnl if compiler is gcc, then
dnl use -O2 and some warning flags
dnl else use -O
+dnl We use -Wall; if the compiler supports it we also use -Wno-pointer-sign,
+dnl because gcc 4 now produces a lot of new warnings which are probably mostly
+dnl spurious and which in any case we don't want to deal with now.
+if test "$nmh_cv_has_noptrsign" = "yes"; then
+ nmh_gcc_warnflags="-Wall -Wno-pointer-sign"
+else
+ nmh_gcc_warnflags="-Wall"
+fi
+
if test -n "$auto_cflags"; then
if test x"$enable_debug" = x"yes"; then
if test -n "$GCC"; then
- test -z "$CFLAGS" && CFLAGS="-Wall -g" || CFLAGS="$CFLAGS -Wall -g"
+ test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -g" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -g"
else
test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
fi
esac
fi
if test -n "$GCC"; then
- test -z "$CFLAGS" && CFLAGS="-Wall -O2" || CFLAGS="$CFLAGS -Wall -O2"
+ test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -O2" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -O2"
else
test -z "$CFLAGS" && CFLAGS=-O || CFLAGS="$CFLAGS -O"
fi
fi
AC_SUBST(editorpath)dnl
-dnl Check for broken vi
-AC_CACHE_CHECK(for broken vi, nmh_cv_attvibug,
-[if echo 'r /nonexist-file
-q' | ex > /dev/null
-then
- nmh_cv_attvibug=no
-else
- nmh_cv_attvibug=yes
-fi])
-
-if test "$nmh_cv_attvibug" = yes; then
- AC_DEFINE(ATTVIBUG)dnl
-fi
-
dnl ----------------------------------------------------------
dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
dnl ----------------------------------------------------------
dnl If mailspool is not world-writable and dotlockfile is not setgid,
dnl we need to #define MAILGROUP to 1 and make inc setgid.
-if test x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then
+if test x"$LOCKTYPE" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then
dnl do we really need both of these?
AC_DEFINE(MAILGROUP)dnl
SETGID_MAIL=1