From 13fc738f2f729b4348585c0246e5005b3f2b30a4 Mon Sep 17 00:00:00 2001 From: Evan Weaver Date: Mon, 3 Aug 2009 22:28:09 -0700 Subject: [PATCH] Fix build problem. --- CHANGELOG | 2 ++ ext/extconf.rb | 6 ++++-- lib/memcached.rb | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6c8a616..70c5829 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,6 @@ +v0.15.1. Fix build problem. + v0.15. Update to libmemcached 0.31.1. UDP support. Domain socket support (hellvinz). Bugfixes. Bundle libmemcached itself with the gem (antifuchs). v0.14.4. Re-SWIG. diff --git a/ext/extconf.rb b/ext/extconf.rb index 2c89cf5..d990ab1 100644 --- a/ext/extconf.rb +++ b/ext/extconf.rb @@ -5,10 +5,10 @@ HERE = File.expand_path(File.dirname(__FILE__)) BUNDLE = Dir.glob("libmemcached-*.tar.gz").first BUNDLE_PATH = BUNDLE.sub(".tar.gz", "") -$includes = ENV['INCLUDE_PATH'].to_s.split(':').map{|s| " -I#{s}"}.uniq.join +$LIBS << " -lmemcached" if !ENV["EXTERNAL_LIB"] - $includes = " -I#{HERE}/include" + $includes + $includes = " -I#{HERE}/include" $libraries = " -L#{HERE}/lib" $CFLAGS = "#{$includes} #{$libraries} #{$CFLAGS}" @@ -35,6 +35,8 @@ if !ENV["EXTERNAL_LIB"] system("rm -rf #{BUNDLE_PATH}") end end + + find_header('libmemcached/memcached.h', "#{HERE}/include") or raise end if ENV['SWIG'] diff --git a/lib/memcached.rb b/lib/memcached.rb index fd6684f..e43293f 100644 --- a/lib/memcached.rb +++ b/lib/memcached.rb @@ -22,7 +22,7 @@ class Memcached Lib = Rlibmemcached REQUIRED_VERSION = File.read("#{File.dirname(__FILE__)}/../COMPATIBILITY")[/:: ([\d\.]+)/, 1] RECEIVED_VERSION = Lib.memcached_lib_version - STDERR.puts "Warning: libmemcached #{REQUIRED_VERSION} suggested; you have #{RECEIVED_VERSION}." unless REQUIRED_VERSION == RECEIVED_VERSION + raise "libmemcached #{REQUIRED_VERSION} required; your gem is linked to #{RECEIVED_VERSION}." unless REQUIRED_VERSION == RECEIVED_VERSION end require 'memcached/integer'