fi
fi
] )
-
+
echo "configuring for AC_PACKAGE_NAME-AC_PACKAGE_VERSION"
AC_SUBST(VERSION,AC_PACKAGE_VERSION)dnl
AC_PROG_CC
+AC_SUBST(EXEEXT)dnl
+
+AC_CACHE_CHECK(whether preprocessor supports -Wunused-macros,
+ nmh_cv_has_unusedmacros,
+ [nmh_saved_cppflags="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS -Wunused-macros -Wno-unused-macros"
+ AC_TRY_COMPILE([],[],nmh_cv_has_unusedmacros=yes,nmh_cv_has_unusedmacros=no)
+ CPPFLAGS="$nmh_saved_cppflags"])
+
+if test "$nmh_cv_has_unusedmacros" = 'yes'; then
+ test -z "$CPPLAGS" && CPPFLAGS=-Wunused-macros \
+ || CPPFLAGS="$CPPFLAGS -Wunused-macros"
+ DISABLE_UNUSED_MACROS_WARNING=-Wno-unused-macros
+fi
+AC_SUBST(DISABLE_UNUSED_MACROS_WARNING)dnl
+
+AC_CACHE_CHECK(whether compiler supports -Wextra, nmh_cv_wextra,
+[nmh_saved_cflags="$CFLAGS"
+ CFLAGS="$CFLAGS -Wextra"
+ AC_TRY_COMPILE([],[],nmh_cv_wextra=' -Wextra',echo -n no)
+ CFLAGS="$nmh_saved_cflags"])
+
AC_CACHE_CHECK(whether compiler supports -Wno-pointer-sign, nmh_cv_has_noptrsign,
[nmh_saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Wno-pointer-sign"
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.
+dnl We use -Wall and -Wextra if supported. If the compiler supports it we
+dnl also use -Wno-pointer-sign, because gcc 4 now produces a lot of new
+dnl warnings which are probably mostly spurious and which in any case we
+dnl don't want to deal with now.
if test "$nmh_cv_has_noptrsign" = "yes"; then
- nmh_gcc_warnflags="-Wall -Wno-pointer-sign"
+ nmh_gcc_warnflags="-Wall$nmh_cv_wextra -Wno-pointer-sign"
else
- nmh_gcc_warnflags="-Wall"
+ nmh_gcc_warnflags="-Wall$nmh_cv_wextra"
fi
if test -n "$auto_cflags"; then
dnl See how we get ls to display the owner and the group
if test "$lspath" != "no"; then
- AC_CACHE_CHECK(how to get ls to show us the group ownership of a file,
+ AC_CACHE_CHECK(how to get ls to show us the group ownership of a file,
nmh_cv_ls_grpopt,
[if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then
dnl There were 9 parameters, so unless this is a really bizarre, nonstandard
dnl See whether the mail spool directory is world-writable.
if test "$lspath" != "no" -a "$cutpath" != "no"; then
- AC_CACHE_CHECK(whether the mail spool is world-writable,
+ AC_CACHE_CHECK(whether the mail spool is world-writable,
nmh_cv_mailspool_world_writable,
[if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then
nmh_cv_mailspool_world_writable=no
case "$target_os" in
linux*)
# Like DEFS, but doesn't get stomped on by configure when using config.h:
- OURDEFS="$OURDEFS -D_GNU_SOURCE"
+ test -z "$OURDEFS" && OURDEFS="-D_GNU_SOURCE" \
+ || OURDEFS="$OURDEFS -D_GNU_SOURCE"
;;
esac
AC_SUBST(OURDEFS)
AC_HEADER_STDC
AC_HEADER_TIOCGWINSZ
-AC_CHECK_HEADERS(errno.h fcntl.h crypt.h termcap.h \
+AC_CHECK_HEADERS(errno.h fcntl.h crypt.h ncurses/termcap.h termcap.h \
langinfo.h wchar.h wctype.h iconv.h netdb.h \
sys/param.h sys/time.h sys/stream.h)
-
+
dnl
dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We
dnl really use a whole set of them, but this check should be
dnl
AC_CHECK_HEADER(libio.h, [
AC_EGREP_HEADER(_IO_write_ptr, libio.h, [
- AC_DEFINE(LINUX_STDIO,1,[Use the Linux _IO_*_ptr defines from <libio.h>.]) ]) ])
+ AC_DEFINE(LINUX_STDIO,1,[Use the Linux _IO_*_ptr defines from <libio.h>.]) ]) ])
AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
[Define to 1 if `struct winsize' requires <sys/ptem.h>.]),,
dnl CHECK STRUCTURES
dnl ----------------
-AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
AC_CHECK_MEMBERS(struct utmp.ut_type,,,[#include <utmp.h>])
AC_STRUCT_DIRENT_D_TYPE