[cairo-commit] rcairo ChangeLog,1.202,1.203 pkg-config.rb,1.5,1.6

Kouhei Sutou commit at pdx.freedesktop.org
Tue Mar 4 05:08:45 PST 2008


Committed by: kou

Update of /cvs/cairo/rcairo
In directory kemper:/tmp/cvs-serv1045

Modified Files:
	ChangeLog pkg-config.rb 
Log Message:
* pkg-config.rb: supported building with ruby 1.9.1.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/rcairo/ChangeLog,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -d -r1.202 -r1.203
--- ChangeLog	29 Feb 2008 23:54:13 -0000	1.202
+++ ChangeLog	4 Mar 2008 13:10:34 -0000	1.203
@@ -1,3 +1,7 @@
+2008-03-04  Kouhei Sutou  <kou at cozmixng.org>
+
+	* pkg-config.rb: supported building with ruby 1.9.1.
+
 2008-03-01  Kouhei Sutou  <kou at cozmixng.org>
 
 	* src/rb_cairo_surface.c, src/cairo.def: Cairo::QuartzImageSurface

Index: pkg-config.rb
===================================================================
RCS file: /cvs/cairo/rcairo/pkg-config.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pkg-config.rb	29 Feb 2008 23:52:28 -0000	1.5
+++ pkg-config.rb	4 Mar 2008 13:10:35 -0000	1.6
@@ -137,18 +137,27 @@
   end
 
   def guess_default_path
+    default_path = "/usr/local/lib/pkgconfig:/usr/lib/pkgconfig"
     pkg_config = with_config("pkg-config", ENV["PKG_CONFIG"] || "pkg-config")
     pkg_config = Pathname.new(pkg_config)
     unless pkg_config.absolute?
       require "dl/import"
       dln = Module.new
       dln.module_eval do
-        extend DL::Importable
-        dlload RbConfig::CONFIG["LIBRUBY"]
+        if DL.const_defined?(:Importer)
+          extend DL::Importer
+        else
+          extend DL::Importable
+        end
+        begin
+          dlload RbConfig::CONFIG["LIBRUBY"]
+        rescue DL::DLError
+          return default_path
+        end
         extern "const char *dln_find_exe(const char *, const char *)"
       end
       pkg_config = dln.dln_find_exe(pkg_config.to_s, nil)
-      return "/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" if pkg_config.nil?
+      return default_path if pkg_config.nil?
       pkg_config = Pathname.new(pkg_config)
     end
     (pkg_config.parent.parent + "lib" + "pkgconfig").to_s



More information about the cairo-commit mailing list