From: Carl Worth Date: Thu, 15 Apr 2010 00:19:42 +0000 (-0700) Subject: Merge bugfix for test-suite correctness. X-Git-Tag: 0.2~45 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=7d06e14e79f41c485f6cb448994498c5581dc69d;hp=f1776f8b51013bb66eb21e64c8084ddfe73c3a5c Merge bugfix for test-suite correctness. The test suite was recently broken, and subsequently fixed (at the commit that introduced the breakage). This merges that fixup commit: f1776f8b51013bb66eb21e64c8084ddfe73c3a5c --- diff --git a/Makefile b/Makefile index 076efc79..619392d3 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,29 @@ all: subdirs = compat completion emacs lib # We make all targets depend on the Makefiles themselves. -global_deps = Makefile Makefile.local \ +global_deps = Makefile Makefile.config Makefile.local \ $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) +# Sub-directory Makefile.local fragments can append to these variables +# to have directory-specific cflags as necessary. + +extra_cflags := +extra_cxxflags := + +# Get settings from the output of configure by running it to generate +# Makefile.config if it doesn't exist yet. And add Makefile.config to +# our global dependency list. +include Makefile.config +Makefile.config: configure + @echo "" + @echo "Note: Calling ./configure with no command-line arguments. This is often fine," + @echo " but if you want to specify any arguments (such as an alternate prefix" + @echo " into which to install), call ./configure explicitly and then make again." + @echo " See \"./configure --help\" for more details." + @echo "" + ./configure + # Finally, include all of the Makefile.local fragments where all the # real work is done. -include Makefile.local $(subdirs:%=%/Makefile.local) + +include $(subdirs:%=%/Makefile.local) Makefile.local diff --git a/Makefile.local b/Makefile.local index 9a1d055b..4a8142f0 100644 --- a/Makefile.local +++ b/Makefile.local @@ -19,29 +19,13 @@ TAR_FILE=$(PACKAGE)-$(VERSION).tar.gz SHA1_FILE=$(TAR_FILE).sha1 GPG_FILE=$(SHA1_FILE).asc -# Get settings from the output of configure by running it to generate -# Makefile.config if it doesn't exist yet. And add Makefile.config to -# our global dependency list. -include Makefile.config -global_deps += Makefile.config -Makefile.config: configure - @echo "" - @echo "Note: Calling ./configure with no command-line arguments. This is often fine," - @echo " but if you want to specify any arguments (such as an alternate prefix" - @echo " into which to install), call ./configure explicitly and then make again." - @echo " See \"./configure --help\" for more details." - @echo "" - ./configure - -# Sub-directory Makefile.local fragments can append to these variables -# to have directory-specific cflags as necessary. -extra_cflags := -extra_cxxflags := - # Smash together user's values with our extra values FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags) FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch +ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1) +FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS) +endif FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS) .PHONY: all @@ -193,7 +177,6 @@ clean: distclean: clean notmuch_client_srcs = \ - $(notmuch_compat_srcs) \ debugger.c \ gmime-filter-reply.c \ gmime-filter-headers.c \ @@ -217,10 +200,10 @@ notmuch_client_srcs = \ notmuch_client_modules = $(notmuch_client_srcs:.c=.o) notmuch: $(notmuch_client_modules) lib/libnotmuch.a - $(call quiet,CC $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@ + $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@ -notmuch-shared: $(notmuch_client_modules) lib/libnotmuch.so - $(call quiet,CC $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@ +notmuch-shared: $(notmuch_client_modules) lib/$(LINKER_NAME) + $(call quiet,CXX $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@ notmuch.1.gz: notmuch.1 gzip --stdout $^ > $@ diff --git a/TODO b/TODO index f352faf2..85ef2f58 100644 --- a/TODO +++ b/TODO @@ -36,6 +36,15 @@ Fix i-search to open up invisible citations as necessary. Make '=' count from the end rather than from the beginning if more than half-way through the buffer. +Fix to automatically wrap long headers (for RFC compliance) before +sending. This should probably just be fixed in message-mode itself, +(but perhaps we can have a notmuch-message-mode that layers this on +top). + +Implement Fcc and use it for all messages, (whether a new composition, +a reply, or a forward). This again may require a notmuch-message-mode +that extends message-mode. + Emacs saved-search interface ---------------------------- Here's a proposal Carl wrote (id:87einafy4u.fsf@yoom.home.cworth.org): @@ -138,6 +147,10 @@ Fix to avoid this ugly message: notmuch-generated portion of the warning (so that once GMime is fixed, this is all silent). +Simplify notmuch-reply to simply print the headers (we have the +original values) rather than calling GMime (which encodes) and adding +the confusing gmime-filter-headers.c code (which decodes). + notmuch library --------------- Add an interface to accept a "key" and a byte stream, rather than a diff --git a/compat/Makefile.local b/compat/Makefile.local index 81e6c707..653fc710 100644 --- a/compat/Makefile.local +++ b/compat/Makefile.local @@ -3,8 +3,12 @@ dir := compat extra_cflags += -I$(dir) -notmuch_compat_srcs = +notmuch_compat_srcs := ifneq ($(HAVE_GETLINE),1) notmuch_compat_srcs += $(dir)/getline.c $(dir)/getdelim.c endif + +ifneq ($(HAVE_STRCASESTR),1) +notmuch_compat_srcs += $(dir)/strcasestr.c +endif diff --git a/compat/compat.h b/compat/compat.h index d639e0f9..173ef680 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -38,4 +38,8 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp); #endif /* !HAVE_GETLINE */ +#if !HAVE_STRCASESTR +char* strcasestr(const char *haystack, const char *needle); +#endif /* !HAVE_STRCASESTR */ + #endif /* NOTMUCH_COMPAT_H */ diff --git a/compat/have_strcasestr.c b/compat/have_strcasestr.c new file mode 100644 index 00000000..c0fb7629 --- /dev/null +++ b/compat/have_strcasestr.c @@ -0,0 +1,10 @@ +#define _GNU_SOURCE +#include + +int main() +{ + char *found; + const char *haystack, *needle; + + found = strcasestr(haystack, needle); +} diff --git a/compat/strcasestr.c b/compat/strcasestr.c new file mode 100644 index 00000000..62a3a545 --- /dev/null +++ b/compat/strcasestr.c @@ -0,0 +1,40 @@ +/* + * slow simplistic reimplementation of strcasestr for systems that + * don't include it in their library + * + * based on a GPL implementation in OpenTTD found under GPL v2 + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation, version 2. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +/* Imported into notmuch by Dirk Hohndel - original author unknown. */ + +#include + +#include "compat.h" + +char *strcasestr(const char *haystack, const char *needle) +{ + size_t hay_len = strlen(haystack); + size_t needle_len = strlen(needle); + while (hay_len >= needle_len) { + if (strncasecmp(haystack, needle, needle_len) == 0) + return (char *) haystack; + + haystack++; + hay_len--; + } + + return NULL; +} diff --git a/configure b/configure index 5af78523..eebe0751 100755 --- a/configure +++ b/configure @@ -234,6 +234,17 @@ else have_emacs=0 fi +printf "Checking for Mac OS X (for shared library)... " +if [ `uname` = "Darwin" ] ; then + printf "Yes.\n" + mac_os_x=1 + linker_resolves_library_dependencies = 0 +else + printf "No.\n" + mac_os_x=0 + linker_resolves_library_dependencies = 1 +fi + if [ $errors -gt 0 ]; then cat < /dev/null 2>&1 +then + printf "Yes.\n" + have_strcasestr=1 +else + printf "No (will use our own instead).\n" + have_strcasestr=0 +fi +rm -f compat/have_strcasestr + cat <