Commit 1cc035c9e33a40d6057eea740ab447bebdfce18a

Thomas de Grivel 2023-11-07T17:30:44

libtool

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