--- /dev/null
+Return-Path: <aidecoe@aidecoe.name>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id C2A28431FD0\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Oct 2011 07:44:48 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id MD7nOI2YmJ-C for <notmuch@notmuchmail.org>;\r
+ Sun, 23 Oct 2011 07:44:48 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+ [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id E7CC0431FB6\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Oct 2011 07:44:47 -0700 (PDT)\r
+Received: by bke11 with SMTP id 11so7677022bke.26\r
+ for <notmuch@notmuchmail.org>; Sun, 23 Oct 2011 07:44:46 -0700 (PDT)\r
+Received: by 10.223.63.130 with SMTP id b2mr38789952fai.35.1319381086268;\r
+ Sun, 23 Oct 2011 07:44:46 -0700 (PDT)\r
+Received: from localhost (abst122.neoplus.adsl.tpnet.pl. [83.8.139.122])\r
+ by mx.google.com with ESMTPS id 5sm6845665fad.9.2011.10.23.07.44.43\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Sun, 23 Oct 2011 07:44:44 -0700 (PDT)\r
+From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] Prefix lib/notmuch.h and lib/gen-version-script.sh with\r
+ $(srcdir)\r
+Date: Sun, 23 Oct 2011 16:44:01 +0200\r
+Message-Id: <1319381041-15800-1-git-send-email-aidecoe@aidecoe.name>\r
+X-Mailer: git-send-email 1.7.7\r
+X-Mailman-Approved-At: Mon, 24 Oct 2011 11:32:10 -0700\r
+Cc: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 23 Oct 2011 14:44:48 -0000\r
+\r
+lib/notmuch.h and lib/gen-version-script.sh couldn't have been found\r
+when building out of sources directory.\r
+---\r
+ lib/Makefile.local | 13 +++++++------\r
+ 1 files changed, 7 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/lib/Makefile.local b/lib/Makefile.local\r
+index ea20b2b..be51eaa 100644\r
+--- a/lib/Makefile.local\r
++++ b/lib/Makefile.local\r
+@@ -41,6 +41,11 @@ endif\r
+ dir := lib\r
+ extra_cflags += -I$(srcdir)/$(dir) -fPIC\r
+ \r
++# The (often-reused) $dir works fine within targets/prerequisites,\r
++# but cannot be used reliably within commands, so copy its value to a\r
++# variable that is not reused.\r
++lib := $(dir)\r
++\r
+ libnotmuch_c_srcs = \\r
+ $(notmuch_compat_srcs) \\r
+ $(dir)/filenames.c \\r
+@@ -68,8 +73,8 @@ $(dir)/libnotmuch.a: $(libnotmuch_modules)\r
+ $(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym\r
+ $(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@\r
+ \r
+-notmuch.sym: lib/notmuch.h $(libnotmuch_modules)\r
+- sh lib/gen-version-script.sh $< $(libnotmuch_modules) > $@\r
++notmuch.sym: $(srcdir)/$(dir)/notmuch.h $(libnotmuch_modules)\r
++ sh $(srcdir)/$(lib)/gen-version-script.sh $< $(libnotmuch_modules) > $@\r
+ \r
+ $(dir)/$(SONAME): $(dir)/$(LIBNAME)\r
+ ln -sf $(LIBNAME) $@\r
+@@ -79,10 +84,6 @@ $(dir)/$(LINKER_NAME): $(dir)/$(SONAME)\r
+ \r
+ install: install-$(dir)\r
+ \r
+-# The (often-reused) $dir works fine within targets/prerequisites,\r
+-# but cannot be used reliably within commands, so copy its value to a\r
+-# variable that is not reused.\r
+-lib := $(dir)\r
+ install-$(dir): $(dir)/$(LIBNAME)\r
+ mkdir -p "$(DESTDIR)$(libdir)/"\r
+ install -m0644 "$(lib)/$(LIBNAME)" "$(DESTDIR)$(libdir)/"\r
+-- \r
+1.7.7\r
+\r