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