[cairo-commit] rcairo/packages/svgcairo/ext extconf.rb,1.2,1.3
Kouhei Sutou
commit at pdx.freedesktop.org
Wed Sep 28 23:53:49 PDT 2005
Committed by: kou
Update of /cvs/cairo/rcairo/packages/svgcairo/ext
In directory gabe:/tmp/cvs-serv870/packages/svgcairo/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/svgcairo/ext/extconf.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- extconf.rb 10 Feb 2005 13:48:33 -0000 1.2
+++ extconf.rb 29 Sep 2005 06:53:47 -0000 1.3
@@ -2,11 +2,26 @@
# vim: filetype=ruby:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
require 'mkmf'
+require 'fileutils'
-$CFLAGS = " -W -I ../../cairo/ext "
-$CFLAGS += `pkg-config --cflags libsvg-cairo`
-$LDFLAGS += `pkg-config --libs libsvg-cairo`
+pkg = "libsvg-cairo"
+modname = "svgcairo"
+major, minor, micro = 0, 1, 4
+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
-create_makefile("svgcairo")
+STDOUT.print("checking for #{pkg} version (>= #{major}.#{minor}.#{micro})... ")
+if pkg_config(pkg) and check_version.call
+ STDOUT.print("yes\n")
+ $CFLAGS += " -I ../../cairo/ext"
+ create_makefile(modname)
+else
+ STDOUT.print("no\n")
+ FileUtils.rm_f("Makefile")
+end
More information about the cairo-commit
mailing list