From 80e256b3f01fb6cbe40c6e0e764444abfb52f78c Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Fri, 1 Apr 2016 09:38:47 -0700 Subject: [PATCH] Fix hcversion.h generation error when using included gettext. When configuring mutt with --enable-hcache and --with-included-gettext, there is an automake ordering issue: BUILT_SOURCES are processed before SUBDIRS. Therefore, the 'hcversion.h' target is run before the included gettext (intl) is built. The hcversion.h target runs the cpp over config.h and mutt.h, but mutt.h includes lib.h which tries to #include . Unfortunately, libintl.h (in this configuration) is generated by the intl subdir build and so doesn't exist yet. While the build doesn't completely fail, the resulting hcversion.h is incorrect: it's just the md5sum of the initial value of BASEVERSION. This fix is somewhat of a hack but is cleaner than trying to change automake's behavior. It inserts a '#undef ENABLE_NLS' in between the config.h and mutt.h sent to the cpp. Since hcachever.sh is just scanning the data structures used by mutt, this shouldn't affect the hash generated. Thanks to Will Yardley for reporting this issue. --- Makefile.am | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 97ada11f5..c689fb544 100644 --- a/Makefile.am +++ b/Makefile.am @@ -140,8 +140,13 @@ reldate.h: $(srcdir)/ChangeLog cmp -s reldate.h.tmp reldate.h || cp reldate.h.tmp reldate.h; \ rm reldate.h.tmp +# The '#undef ENABLE_NLS' is to work around an automake ordering issue: +# BUILT_SOURCES are processed before SUBDIRS. +# If configured with --with-included-gettext this means that intl will +# not have generated libintl.h yet, and mutt.h -> lib.h will generate +# an error. hcversion.h: $(srcdir)/mutt.h $(srcdir)/rfc822.h hcachever.sh $(MUTT_MD5) - ( echo '#include "config.h"'; echo '#include "mutt.h"'; ) \ + ( echo '#include "config.h"'; echo '#undef ENABLE_NLS'; echo '#include "mutt.h"'; ) \ | $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) - | sh ./hcachever.sh hcversion.h patchlist.c: $(srcdir)/PATCHES $(srcdir)/patchlist.sh -- 2.40.0