summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2016-04-01 09:38:47 -0700
committerKevin McCarthy <kevin@8t8.us>2016-04-01 09:38:47 -0700
commitd18939a96e0d140740985c16d9a0eac7af2e3b86 (patch)
tree50a545e47dc34e082cc1e1e3c004df439151c27c /Makefile.am
parentc9f060b776830f16856d53d1141ae37da5befc60 (diff)
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 <libintl.h>. 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.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am7
1 files changed, 6 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 97ada11f..c689fb54 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