AC_PROG_CC
+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 -Wno-pointer-sign, nmh_cv_has_noptrsign,
[nmh_saved_cflags="$CFLAGS"
CFLAGS="$CFLAGS -Wno-pointer-sign"
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)
CC = @CC@
CFLAGS = @CFLAGS@
+DISABLE_UNUSED_MACROS_WARNING = @DISABLE_UNUSED_MACROS_WARNING@
DEFS = @DEFS@
CONFIGDEFS = -DNMHETCDIR='"$(etcdir)"' -DMAILSPOOL='"$(mailspool)"' -DSENDMAILPATH='"$(sendmailpath)"'
INCLUDES = -I. -I$(top_srcdir) @CPPFLAGS@
.SUFFIXES:
-.SUFFIXES: .c .o
+.SUFFIXES: .c .o .lex
.c.o:
$(COMPILE) $<
# some lexes will only accept '-n -t', not '-nt'.
# Also, not all makes accept $< in non-pattern rules,
# hence the explicit filenames here.
-dtimep.c: dtimep.lex
+dtimep.o: dtimep.lex
$(LEX) -n -t $(srcdir)/dtimep.lex > dtimep.c
+ $(COMPILE) $(DISABLE_UNUSED_MACROS_WARNING) dtimep.c
client.o: client.c
$(COMPILE2) $(srcdir)/client.c