[PATCH] ruby: allow bindings to compile on Mac OS X
authorLudovic LANGE <ll-notmuchmail@lange.nom.fr>
Sun, 16 Nov 2014 20:48:26 +0000 (21:48 +0100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:46:43 +0000 (14:46 -0700)
1d/3dd9da8c20db77527deb73fe12dd7c0634b191 [new file with mode: 0644]

diff --git a/1d/3dd9da8c20db77527deb73fe12dd7c0634b191 b/1d/3dd9da8c20db77527deb73fe12dd7c0634b191
new file mode 100644 (file)
index 0000000..38d9a40
--- /dev/null
@@ -0,0 +1,98 @@
+Return-Path: <ll-notmuchmail@lange.nom.fr>\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 E5D3D431FCB\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Nov 2014 12:56:22 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 o+8kwcMTuoA9 for <notmuch@notmuchmail.org>;\r
+       Sun, 16 Nov 2014 12:56:16 -0800 (PST)\r
+Received: from mo68.mail-out.ovh.net (4.mo68.mail-out.ovh.net [46.105.59.63])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 9B594431FC3\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Nov 2014 12:56:16 -0800 (PST)\r
+Received: from mail432.ha.ovh.net (b6.ovh.net [213.186.33.56])\r
+       by mo68.mail-out.ovh.net (Postfix) with SMTP id 8BDBEFFB071\r
+       for <notmuch@notmuchmail.org>; Sun, 16 Nov 2014 21:48:29 +0100 (CET)\r
+Received: from b0.ovh.net (HELO queueout) (213.186.33.50)\r
+       by b0.ovh.net with SMTP; 16 Nov 2014 22:48:29 +0200\r
+Received: from 112.248.broadband7.iol.cz (HELO snek)\r
+       (llange@agisvoyages.com@88.102.248.112)\r
+       by ns0.ovh.net with SMTP; 16 Nov 2014 22:48:28 +0200\r
+From: Ludovic LANGE <ll-notmuchmail@lange.nom.fr>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] ruby: allow bindings to compile on Mac OS X\r
+Date: Sun, 16 Nov 2014 21:48:26 +0100\r
+Message-Id: <1416170906-23415-1-git-send-email-ll-notmuchmail@lange.nom.fr>\r
+X-Mailer: git-send-email 1.8.0\r
+X-Ovh-Tracer-Id: 980658820638829334\r
+X-Ovh-Remote: 88.102.248.112 (112.248.broadband7.iol.cz)\r
+X-Ovh-Local: 213.186.33.20 (ns0.ovh.net)\r
+X-OVH-SPAMSTATE: OK\r
+X-OVH-SPAMSCORE: 0\r
+X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejhedrjeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu\r
+X-VR-SPAMSTATE: OK\r
+X-VR-SPAMSCORE: 0\r
+X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejhedrjeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecu\r
+X-Mailman-Approved-At: Mon, 17 Nov 2014 01:37:28 -0800\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, 16 Nov 2014 20:56:23 -0000\r
+\r
+On OS X, the library ends with .dylib (instead of .so). I also added\r
+the .dll handling in any case.\r
+Also, the flags '-Wl,--no-undefined' seems not accepted, so I excluded\r
+them on OS X (only)\r
+---\r
+ bindings/ruby/extconf.rb | 10 ++++++----\r
+ 1 file changed, 6 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb\r
+index 6160db2..f9a7159 100644\r
+--- a/bindings/ruby/extconf.rb\r
++++ b/bindings/ruby/extconf.rb\r
+@@ -11,7 +11,9 @@ dir = File.join('..', '..', 'lib')\r
+ $INCFLAGS = "-I#{dir} #{$INCFLAGS}"\r
\r
+ # make sure there are no undefined symbols\r
+-$LDFLAGS += ' -Wl,--no-undefined'\r
++if CONFIG["arch"] !~ /darwin/\r
++  $LDFLAGS += " -Wl,--no-undefined"\r
++end\r
\r
+ def have_local_library(lib, path, func, headers = nil)\r
+   checking_for checking_message(func, lib) do\r
+@@ -22,9 +24,9 @@ def have_local_library(lib, path, func, headers = nil)\r
+   end\r
+ end\r
\r
+-if not have_local_library('libnotmuch.so', dir, 'notmuch_database_create', 'notmuch.h')\r
+-  exit 1\r
+-end\r
++['so', 'dylib', 'dll'].detect(lambda { print "Local library notmuch seems absent\n"; exit }) { |ext|\r
++      have_local_library("libnotmuch.#{ext}", dir, 'notmuch_database_create', 'notmuch.h')\r
++}\r
\r
+ # Create Makefile\r
+ dir_config('notmuch')\r
+-- \r
+1.8.0\r
+\r