X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=configure.ac;h=3491f960808793d36338a8263369c6c44f372ce9;hb=4548981fb45fbc917cc2c26b7c96b31cfa14bc9b;hp=43a1029db755df09e804c8579b9ff9cd41f8787a;hpb=c2191f6961409263271aaeb0f9685e10492389a8;p=mmh diff --git a/configure.ac b/configure.ac index 43a1029..3491f96 100644 --- a/configure.ac +++ b/configure.ac @@ -24,7 +24,7 @@ if test -n "$LIBTOOL" ; then fi fi ] ) - + echo "configuring for AC_PACKAGE_NAME-AC_PACKAGE_VERSION" AC_SUBST(VERSION,AC_PACKAGE_VERSION)dnl @@ -218,6 +218,28 @@ fi 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" @@ -228,13 +250,14 @@ 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. +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 @@ -340,7 +363,7 @@ AC_PATH_PROG(lspath, ls, no, [$pathtmp]) 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 @@ -397,7 +420,7 @@ AC_SUBST(mailspool)dnl 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 @@ -456,17 +479,18 @@ dnl before system header files. 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 @@ -474,7 +498,7 @@ dnl sufficient. 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 .]) ]) ]) + AC_DEFINE(LINUX_STDIO,1,[Use the Linux _IO_*_ptr defines from .]) ]) ]) AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1, [Define to 1 if `struct winsize' requires .]),, @@ -743,7 +767,6 @@ dnl ---------------- dnl CHECK STRUCTURES dnl ---------------- -AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) AC_CHECK_MEMBERS(struct utmp.ut_type,,,[#include ]) AC_STRUCT_DIRENT_D_TYPE