[cairo-commit] rcairo/packages/cairo/ext extconf.rb,1.5,1.6

Kouhei Sutou commit at pdx.freedesktop.org
Wed Sep 28 23:53:49 PDT 2005


Committed by: kou

Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory gabe:/tmp/cvs-serv870/packages/cairo/ext

Modified Files:
	extconf.rb 
Log Message:
* packages/cairo/ext/extconf.rb: check modversion.
* packages/svgcairo/ext/extconf.rb: ditto.


Index: extconf.rb
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/extconf.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- extconf.rb	23 Jun 2005 09:30:48 -0000	1.5
+++ extconf.rb	29 Sep 2005 06:53:47 -0000	1.6
@@ -2,8 +2,25 @@
 # vim: filetype=ruby:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
 
 require 'mkmf'
+require 'fileutils'
 
-$CFLAGS  = "-Wall "+`pkg-config --cflags cairo`
-$LDFLAGS = `pkg-config --libs cairo`
-create_makefile("cairo")
+pkg = "cairo"
+modname = "cairo"
+major, minor, micro = 1, 0, 0
 
+check_version = Proc.new do
+  modversion = `#{$PKGCONFIG} --modversion #{pkg}`.chomp
+  ver = modversion.split(".").collect{|item| item.to_i}
+  (0..2).each {|i| ver[i] ||= 0}
+  (ver <=> [major, minor, micro]) >= 0
+end
+
+STDOUT.print("checking for #{pkg} version (>= #{major}.#{minor}.#{micro})... ")
+
+if pkg_config(pkg) and check_version.call
+  STDOUT.print("yes\n")
+  create_makefile(modname)
+else
+  STDOUT.print("no\n")
+  FileUtils.rm_f("Makefile")
+end



More information about the cairo-commit mailing list