summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatsuhiko Nishimra <ktns.87@gmail.com>2012-10-27 03:18:10 +0900
committerKatsuhiko Nishimra <ktns.87@gmail.com>2012-10-27 03:18:10 +0900
commit9dde740bcc4b4c479e9b011ede2a20c0f4498ece (patch)
treec0c529138aa5ca714391c71d0e0463f03592c9c2
parent1a2b3ed44aece3421b0c557032a3159f3345cc89 (diff)
Use have_library method in mkmf library to detect openbabel library
-rw-r--r--ext/openbabel/extconf.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/openbabel/extconf.rb b/ext/openbabel/extconf.rb
index 98150ea..da77116 100644
--- a/ext/openbabel/extconf.rb
+++ b/ext/openbabel/extconf.rb
@@ -1,5 +1,6 @@
require 'fileutils'
require 'tmpdir'
+require 'mkmf'
ob_num_ver="2.3.1"
ob_ver="openbabel-"+ob_num_ver
@@ -19,13 +20,7 @@ begin
Dir.chdir ob_main_dir do
puts "Configuring OpenBabel"
puts `cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}`
- openbabel_libs = false
- openbabel_libs = true if `/sbin/ldconfig -p`.split("\n").grep(/openbabel/)
- unless openbabel_libs
- ENV["LD_LIBRARY_PATH"].split(":").each do |dir|
- openbabel_libs = true unless Dir[File.join(dir,"*libopenbabel*")].empty?
- end
- end
+ openbabel_libs = have_library('openbabel')
unless openbabel_libs
puts "OpenBabel not installed. Compiling sources."
puts `make`