X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=bindings%2Fruby%2Fextconf.rb;h=161de5a2c7c52bb6d5130ee6db3616c36acdba1d;hp=a9d9d42b6a158cc9580ce5d3a8005cd19b04f24e;hb=HEAD;hpb=44ea57a0d10ddab514abea319c4d25ec4e36b51e diff --git a/bindings/ruby/extconf.rb b/bindings/ruby/extconf.rb index a9d9d42b..d914537c 100644 --- a/bindings/ruby/extconf.rb +++ b/bindings/ruby/extconf.rb @@ -1,14 +1,25 @@ #!/usr/bin/env ruby # coding: utf-8 -# vim: set sw=2 sts=2 et nowrap fenc=utf-8 : -# Copyright 2010 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') +dir = File.join(ENV['NOTMUCH_SRCDIR'], 'lib') + +# includes +$INCFLAGS = "-I#{dir} #{$INCFLAGS}" + +if ENV['EXTRA_LDFLAGS'] + $LDFLAGS += " " + ENV['EXTRA_LDFLAGS'] +end + +if not ENV['LIBNOTMUCH'] + exit 1 +end + +$LOCAL_LIBS += ENV['LIBNOTMUCH'] +$LIBS += " -ltalloc" # Create Makefile dir_config('notmuch')