unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <too@guru.guru-group.fi>
To: notmuch@notmuchmail.org
Cc: tomi.ollila@iki.fi
Subject: [PATCH 1/2] fix out of tree build for ruby bindings
Date: Fri, 25 Nov 2016 20:50:47 +0200	[thread overview]
Message-ID: <1480099848-17636-1-git-send-email-too@guru.guru-group.fi> (raw)

From: Tomi Ollila <tomi.ollila@iki.fi>

Ruby bindings source files had to be copied to the out-of-tree
target directory -- final obstacle avoiding that was that if
there were built object files in source directory, new target object
files were not built (caused link failure, fortunately).
---

The ruby-part fix of id:1479146030-17083-1-git-send-email-tomi.ollila@iki.fi

 bindings/Makefile.local  |  2 +-
 bindings/ruby/extconf.rb | 12 +++++++++++-
 configure                |  6 ++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/bindings/Makefile.local b/bindings/Makefile.local
index 11d11d4..61fe412 100644
--- a/bindings/Makefile.local
+++ b/bindings/Makefile.local
@@ -8,7 +8,7 @@ ifeq ($(HAVE_RUBY_DEV),1)
 	cd $(dir)/ruby && \
 		EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
 		LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
-		ruby extconf.rb --vendor
+		SRCDIR=$(srcdir) ruby extconf.rb --vendor
 	$(MAKE) -C $(dir)/ruby
 endif
 
diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb
index ddaa684..ed57d33 100644
--- a/bindings/ruby/extconf.rb
+++ b/bindings/ruby/extconf.rb
@@ -1,11 +1,21 @@
 #!/usr/bin/env ruby
 # coding: utf-8
 # Copyright 2010, 2011, 2012 Ali Polatel <alip@exherbo.org>
+# Out of tree build update: 2016 Tomi Ollila
 # Distributed under the terms of the GNU General Public License v3
 
 require 'mkmf'
 
-dir = File.join('..', '..', 'lib')
+# ENV['SRCDIR'] is build system's vision of source dir...
+srcroot = ENV['SRCDIR']
+# ...so fix it; expect hardcoded ../.. to work
+if srcroot == '.'
+  srcroot = File.join('..', '..')
+elsif srcroot[0] != '/'
+  srcroot = File.join('..', '..', srcroot)
+end
+
+dir = File.join(srcroot, 'lib')
 
 # includes
 $INCFLAGS = "-I#{dir} #{$INCFLAGS}"
diff --git a/configure b/configure
index f0fc466..22767c5 100755
--- a/configure
+++ b/configure
@@ -42,6 +42,12 @@ if [ "$srcdir" != "." ]; then
     # Emacs only likes to generate compiled files next to the .el files
     # by default so copy these as well (which is not ideal).
     cp -a "$srcdir"/emacs/*.el emacs
+
+    # We were not able to create fully working Makefile using ruby mkmf.rb
+    # so ruby bindings source files are copied as well (ditto -- not ideal).
+    mkdir bindings/ruby
+    cp -a "$srcdir"/bindings/ruby/*.[ch] bindings/ruby
+    cp -a "$srcdir"/bindings/ruby/extconf.rb bindings/ruby
 fi
 
 # Set several defaults (optionally specified by the user in
-- 
2.10.0

             reply	other threads:[~2016-11-25 18:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 18:50 Tomi Ollila [this message]
2016-11-25 18:50 ` [PATCH 2/2] fix (rest of the) out of tree build Tomi Ollila
2016-11-29 13:35   ` David Bremner
2016-11-29 13:51 ` [PATCH 1/2] fix out of tree build for ruby bindings David Bremner
2016-11-30 21:40   ` Tomi Ollila
2016-12-02 11:47     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480099848-17636-1-git-send-email-too@guru.guru-group.fi \
    --to=too@guru.guru-group.fi \
    --cc=notmuch@notmuchmail.org \
    --cc=tomi.ollila@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).