]> git.notmuchmail.org Git - notmuch/commitdiff
fix out of tree build
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 12 Mar 2017 11:59:13 +0000 (13:59 +0200)
committerDavid Bremner <david@tethera.net>
Sun, 12 Mar 2017 12:17:29 +0000 (09:17 -0300)
In addition to use ${srcdir} and deliver ${NOTMUCH_SRCDIR} where needed,
source from ruby bindings had to be copied to the out-of-tree target
directory -- if the source files in source directory were referenced
in build and there were also built object files there, those could have
been considered as target files (and then not found when attempting
to create bindings/ruby/notmuch.so).

bindings/Makefile.local
bindings/ruby/extconf.rb
configure

index 11d11d4bcbeb19d217f221f8d250be0d4e2cde32..17b561caac52dfc17a1f4fc9e56758b32dbb25fd 100644 (file)
@@ -8,6 +8,7 @@ ifeq ($(HAVE_RUBY_DEV),1)
        cd $(dir)/ruby && \
                EXTRA_LDFLAGS="$(NO_UNDEFINED_LDFLAGS)" \
                LIBNOTMUCH="../../lib/$(LINKER_NAME)" \
+               NOTMUCH_SRCDIR='$(NOTMUCH_SRCDIR)' \
                ruby extconf.rb --vendor
        $(MAKE) -C $(dir)/ruby
 endif
index ddaa6841e5ff2d507c65501f6d81dd00f9e942fe..161de5a2c7c52bb6d5130ee6db3616c36acdba1d 100644 (file)
@@ -5,7 +5,7 @@
 
 require 'mkmf'
 
-dir = File.join('..', '..', 'lib')
+dir = File.join(ENV['NOTMUCH_SRCDIR'], 'lib')
 
 # includes
 $INCFLAGS = "-I#{dir} #{$INCFLAGS}"
index bcfa4167f3a84470986883218bc7630e9f36fc33..6c782e16d5a63a746e3b49691bcc398fcb7f63cd 100755 (executable)
--- a/configure
+++ b/configure
@@ -47,6 +47,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
@@ -357,8 +363,8 @@ int main(void) {
     return 0;
 }
 EOF
-if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \
-       ./_libversion > _libversion.sh && . ./_libversion.sh
+if ${CC} ${CFLAGS} -I"$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
+       && ./_libversion > _libversion.sh && . ./_libversion.sh
 then
     printf "OK.\n"
 else