On Thu, Mar 29, 2012 at 08:25:56AM -0400, Darryl L. Pierce wrote:
On Thu, Mar 29, 2012 at 02:23:02PM +0200, David Sterba wrote:
On Thu, Mar 29, 2012 at 08:06:25AM -0400, Darryl L. Pierce wrote:
I'm experiencing the following error (have been for a while which is why I've been stalled):
gcc -DPKGDATADIR="/usr/local/share/mutt" -DSYSCONFDIR="/usr/local/etc" -DBINDIR="/usr/local/bin" -DMUTTLOCALEDIR="/usr/local/share/locale" -DHAVE_CONFIG_H=1 -I. -I. -I. -Iintl -I./intl -Wall -pedantic -Wno-long-long -g -O2 -MT buffy.o -MD -MP -MF .deps/buffy.Tpo -c -o buffy.o buffy.c buffy.c: In function ‘mutt_buffy_check’: buffy.c:602:21: error: ‘VirtIncoming’ undeclared (first use in this function) buffy.c:602:21: note: each undeclared identifier is reported only once for each function it appears in make[2]: *** [buffy.o] Error 1 make[2]: Leaving directory `/home/mcpierce/Programming/mutt-kz' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/mcpierce/Programming/mutt-kz' make: *** [all] Error 2
You need to run configure with --enable-notmuch. Somewhere it's used out of the #ifdef NOTMUCH/#endif block.
Since part of our goal (I assumed) was integration of notmuch with the Mutt code, why do we not have this by default? It would seem to make more sense for regression tests to have to explicitly disable rather than enable notmuch.
We can still leave mutt-kz compilable entirely without notmuch, just for the case there are users out there not interested in notmuch enhancements, but I seriously doubt that :)
Here's the patch which compiles fine without --enable-notmuch ---
From: David Sterba dsterba@suse.cz Date: Mon, 2 Apr 2012 23:18:15 +0200 Subject: [PATCH] build: fix compilation errors without --enable-notmuch
Signed-off-by: David Sterba dsterba@suse.cz --- browser.c | 2 ++ buffy.c | 8 +++++++- curs_main.c | 4 ++++ sidebar.c | 4 ++++ 4 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/browser.c b/browser.c index 2e1e390..89db8f8 100644 --- a/browser.c +++ b/browser.c @@ -272,10 +272,12 @@ folder_format_str (char *dest, size_t destlen, size_t col, char op, const char * break;
case 'n': +#ifdef USE_NOTMUCH if (mx_is_notmuch (folder->ff->name)) { snprintf (tmp, sizeof (tmp), "%%%sd", fmt); snprintf (dest, destlen, tmp, folder->ff->all); } +#endif break;
case 'N': diff --git a/buffy.c b/buffy.c index 7daf734..33a5b92 100644 --- a/buffy.c +++ b/buffy.c @@ -599,7 +599,11 @@ int mutt_buffy_check (int force) #endif
/* fastest return if there are no mailboxes */ - if (!Incoming && !VirtIncoming) +#ifdef USE_NOTMUCH + if (!Incomming && !VirtIncoming) + return 0; +#endif + if (!Incoming) return 0; t = time (NULL); if (!force && (t - BuffyTime < BuffyTimeout)) @@ -624,8 +628,10 @@ int mutt_buffy_check (int force) for (tmp = Incoming; tmp; tmp = tmp->next) buffy_check(tmp, &contex_sb);
+#ifdef USE_NOTMUCH for (tmp = VirtIncoming; tmp; tmp = tmp->next) buffy_check(tmp, &contex_sb); +#endif
BuffyDoneTime = BuffyTime; return (BuffyCount); diff --git a/curs_main.c b/curs_main.c index 653b226..21ebcb8 100644 --- a/curs_main.c +++ b/curs_main.c @@ -758,7 +758,9 @@ int mutt_index_menu (void) mutt_curs_set (1); /* fallback from the pager */ }
+#ifdef USE_NOTMUCH nm_debug_check(Context); +#endif
switch (op) { @@ -2366,7 +2368,9 @@ int mutt_index_menu (void) km_error_key (MENU_MAIN); }
+#ifdef USE_NOTMUCH nm_debug_check(Context); +#endif
if (menu->menu == MENU_PAGER) { diff --git a/sidebar.c b/sidebar.c index 6eff2f0..8074043 100644 --- a/sidebar.c +++ b/sidebar.c @@ -51,6 +51,7 @@ static BUFFY *get_incoming() case SB_SRC_NONE: sidebar_source = SB_SRC_INCOMING;
+#ifdef USE_NOTMUCH if (option (OPTVIRTSPOOLFILE) && VirtIncoming) { sidebar_source = SB_SRC_VIRT; return VirtIncoming; @@ -61,6 +62,7 @@ static BUFFY *get_incoming() return VirtIncoming; } break; +#endif case SB_SRC_INCOMING: break; } @@ -418,9 +420,11 @@ void toggle_sidebar(int menu) if (sidebar_source == -1) get_incoming();
+#ifdef USE_NOTMUCH if (sidebar_source == SB_SRC_INCOMING && VirtIncoming) sidebar_source = SB_SRC_VIRT; else +#endif sidebar_source = SB_SRC_INCOMING;
TopBuffy = NULL;