From: Tomi Ollila Date: Sun, 12 Mar 2017 11:59:13 +0000 (+0200) Subject: fix out of tree build X-Git-Tag: 0.25_rc0~110 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=35cdebdad0d41be58a4c705ec48fd1bb51f098eb fix out of tree build 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). --- diff --git a/bindings/Makefile.local b/bindings/Makefile.local index 11d11d4b..17b561ca 100644 --- a/bindings/Makefile.local +++ b/bindings/Makefile.local @@ -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 diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb index ddaa6841..161de5a2 100644 --- a/bindings/ruby/extconf.rb +++ b/bindings/ruby/extconf.rb @@ -5,7 +5,7 @@ require 'mkmf' -dir = File.join('..', '..', 'lib') +dir = File.join(ENV['NOTMUCH_SRCDIR'], 'lib') # includes $INCFLAGS = "-I#{dir} #{$INCFLAGS}" diff --git a/configure b/configure index bcfa4167..6c782e16 100755 --- 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