ext/openbabel/extconf.rb in openbabel-2.3.1.3 vs ext/openbabel/extconf.rb in openbabel-2.3.1.4

- old
+ new

@@ -17,10 +17,17 @@ puts `curl -L -d use_mirror=netcologne "http://downloads.sourceforge.net/project/openbabel/openbabel/#{ob_num_ver}/openbabel-#{ob_num_ver}.tar.gz" | tar xz` end Dir.chdir ob_main_dir do puts "Configuring OpenBabel" puts `cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}` - unless File.exists?(`which obabel`.chomp) + openbabel_libs = false + openbabel_libs = true if `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 + unless openbabel_libs puts "OpenBabel not installed. Compiling sources." puts `make` puts `make install` end end