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

* Re: [PATCH] ruby: allow bindings to compile on Mac OS X
  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
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2014-12-31 21:19 UTC (permalink / raw)
  To: Ludovic LANGE, notmuch

Ludovic LANGE <ll-notmuchmail@lange.nom.fr> writes:

> 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)

It occurs to me that if we build the ruby bindings as part of the main
build then the dependencies of the main makefile will force the library
to exist, and we can eliminate the special casing here.

The flags I'm less sure about. I guess they are gcc specific. Ideally
this seems like the kind of configuration that should happen in the top
level configuration.

[1]: id:1419971380-10307-2-git-send-email-david@tethera.net

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

* Re: [PATCH] ruby: allow bindings to compile on Mac OS X
  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
  1 sibling, 0 replies; 3+ messages in thread
From: David Bremner @ 2015-01-01 12:22 UTC (permalink / raw)
  To: Ludovic LANGE, notmuch

Ludovic LANGE <ll-notmuchmail@lange.nom.fr> writes:

> 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)

If you have a chance, please check out the series at 

   id:1420114600-28396-1-git-send-email-david@tethera.net

In principle it should provide the same functionality as your patch,
although hopefully in a more portable and generic way.

^ permalink raw reply	[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).