diff --git a/lib/rbpkg.rb b/lib/rbpkg.rb
index accf01c..48fed2b 100644
--- a/lib/rbpkg.rb
+++ b/lib/rbpkg.rb
@@ -348,6 +348,22 @@ EOF
"#{dir}/lib"
end
+ def self.libtool
+ if (result = `which glibtool`.strip) != ""
+ result
+ else
+ if File.exist?(result = "/usr/local/bin/libtool")
+ result
+ else
+ if (result = `which libtool`.strip) != ""
+ result
+ else
+ "libtool"
+ end
+ end
+ end
+ end
+
def self.lock(name)
path = lock_path(name)
if File.file?(path)
diff --git a/lib/rbpkg/repo.rb b/lib/rbpkg/repo.rb
index 6036768..902ff02 100644
--- a/lib/rbpkg/repo.rb
+++ b/lib/rbpkg/repo.rb
@@ -284,7 +284,7 @@ class Rbpkg::Repo
end
output.close
end
- cmd! "libtool --mode=finish #{Rbpkg.lib_dir}"
+ cmd! "#{Rbpkg.libtool} --mode=finish #{Rbpkg.lib_dir}"
end
def install_dependencies