From 82b73ffd7380b85d259eeb91100dd6ac2d14223a Mon Sep 17 00:00:00 2001 From: Ali Polatel Date: Mon, 7 May 2012 18:02:45 +0300 Subject: ruby: Add workarounds to use in-tree build not the installed one - Make mkmf use the notmuch.h under ../../lib - Use libnotmuch.a instead of linking to the installed libnotmuch.so --- bindings/ruby/extconf.rb | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'bindings/ruby/extconf.rb') diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb index ccac609..933f34a 100644 --- a/bindings/ruby/extconf.rb +++ b/bindings/ruby/extconf.rb @@ -1,13 +1,31 @@ #!/usr/bin/env ruby # coding: utf-8 -# Copyright 2010, 2011 Ali Polatel +# Copyright 2010, 2011, 2012 Ali Polatel # Distributed under the terms of the GNU General Public License v3 require 'mkmf' -# Notmuch Library -find_header('notmuch.h', '../../lib') -find_library('notmuch', 'notmuch_database_create', '../../lib') +NOTDIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib')) +NOTHDR = File.join(NOTDIR, 'notmuch.h') +NOTLIB = File.join(NOTDIR, 'libnotmuch.a') + +unless File.exists? NOTHDR + $stderr.puts "notmuch.h is missing under #{NOTDIR}" + exit 1 +end + +unless File.exists? NOTLIB + $stderr.puts "libnotmuch.a is missing under #{NOTDIR}" + exit 1 +end + +# Small hack to build with in-tree version not the installed one. +# find_header() and friends use standard include/library paths first. +$stderr.puts "Added -I#{NOTDIR} to $INCFLAGS" +$INCFLAGS = "-I#{NOTDIR}".quote + " " + $INCFLAGS +find_header('notmuch.h', NOTDIR) + +$LOCAL_LIBS += NOTLIB # Create Makefile dir_config('notmuch') -- cgit v1.2.3 From 35cb1c95cc8afa964900d29c813349ad8e24e7a8 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 25 May 2012 15:08:17 +0200 Subject: Revert "ruby: Add workarounds to use in-tree build not the installed one" This reverts commit 82b73ffd7380b85d259eeb91100dd6ac2d14223a. Only leave the copyright changes. Signed-off-by: Felipe Contreras --- bindings/ruby/defs.h | 2 +- bindings/ruby/extconf.rb | 24 +++--------------------- 2 files changed, 4 insertions(+), 22 deletions(-) (limited to 'bindings/ruby/extconf.rb') diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index 85d8205..3f9512b 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -21,8 +21,8 @@ #ifndef DEFS_H #define DEFS_H +#include #include -#include "notmuch.h" VALUE notmuch_rb_cDatabase; VALUE notmuch_rb_cDirectory; diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb index 933f34a..7b9750f 100644 --- a/bindings/ruby/extconf.rb +++ b/bindings/ruby/extconf.rb @@ -5,27 +5,9 @@ require 'mkmf' -NOTDIR = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib')) -NOTHDR = File.join(NOTDIR, 'notmuch.h') -NOTLIB = File.join(NOTDIR, 'libnotmuch.a') - -unless File.exists? NOTHDR - $stderr.puts "notmuch.h is missing under #{NOTDIR}" - exit 1 -end - -unless File.exists? NOTLIB - $stderr.puts "libnotmuch.a is missing under #{NOTDIR}" - exit 1 -end - -# Small hack to build with in-tree version not the installed one. -# find_header() and friends use standard include/library paths first. -$stderr.puts "Added -I#{NOTDIR} to $INCFLAGS" -$INCFLAGS = "-I#{NOTDIR}".quote + " " + $INCFLAGS -find_header('notmuch.h', NOTDIR) - -$LOCAL_LIBS += NOTLIB +# Notmuch Library +find_header('notmuch.h', '../../lib') +find_library('notmuch', 'notmuch_database_create', '../../lib') # Create Makefile dir_config('notmuch') -- cgit v1.2.3