unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] ruby: allow bindings to compile on Mac OS X
@ 2014-11-16 20:48 Ludovic LANGE
  2014-12-31 21:19 ` David Bremner
  2015-01-01 12:22 ` David Bremner
  0 siblings, 2 replies; 3+ messages in thread
From: Ludovic LANGE @ 2014-11-16 20:48 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-01 12:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-16 20:48 [PATCH] ruby: allow bindings to compile on Mac OS X Ludovic LANGE
2014-12-31 21:19 ` David Bremner
2015-01-01 12:22 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).