[cairo-commit] rcairo ChangeLog, 1.213, 1.214 pkg-config.rb, 1.9, 1.10
Kouhei Sutou
commit at pdx.freedesktop.org
Thu Apr 3 21:09:08 PDT 2008
Committed by: kou
Update of /cvs/cairo/rcairo
In directory kemper:/tmp/cvs-serv6739
Modified Files:
ChangeLog pkg-config.rb
Log Message:
* pkg-config.rb: fix substitution for MSVC.
Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/rcairo/ChangeLog,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -d -r1.213 -r1.214
--- ChangeLog 4 Apr 2008 03:59:03 -0000 1.213
+++ ChangeLog 4 Apr 2008 04:13:14 -0000 1.214
@@ -1,5 +1,7 @@
2008-04-04 Kouhei Sutou <kou at cozmixng.org>
+ * pkg-config.rb: fix substitution for MSVC.
+
* extconf.rb: support output option for MSVC.
* src/rb_cairo_path.c: remove garbages.
Index: pkg-config.rb
===================================================================
RCS file: /cvs/cairo/rcairo/pkg-config.rb,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pkg-config.rb 4 Apr 2008 03:17:53 -0000 1.9
+++ pkg-config.rb 4 Apr 2008 04:13:14 -0000 1.10
@@ -39,25 +39,12 @@
end
def libs
- all_libs = requires.collect do |package|
- self.class.new(package, @path, @msvc_syntax).libs
- end
- all_libs = [declaration("Libs")] + all_libs
- all_libs = all_libs.join(" ").gsub(/-([Ll]) /, '\1').split.uniq
- path_flags, other_flags = all_libs.partition {|flag| /\A-L/ =~ flag}
- path_flags = path_flags.reject do |flag|
- /\A-L\/usr\/lib(?:64)?\z/ =~ flag
- end
- libs = (other_flags + path_flags).join(" ")
- if @msvc_syntax
- libs = libs.gsub(/\A-L/, "/libpath:")
- libs = libs.gsub(/\A-l(\S+)/) {"#{$1}.lib"}
- end
- libs
+ path_flags, other_flags = collect_libs
+ (other_flags + path_flags).join(" ")
end
def libs_only_l
- libs.split.find_all do |arg|
+ collect_libs[1].find_all do |arg|
if @msvc_syntax
/\.lib\z/ =~ arg
else
@@ -103,6 +90,36 @@
path_flags = path_flags.reject do |flag|
flag == "-I/usr/include"
end
+ if @msvc_syntax
+ path_flags = path_flags.collect do |flag|
+ flag.gsub(/\A-I/, "/I")
+ end
+ end
+ [path_flags, other_flags]
+ end
+
+ def collect_libs
+ all_libs = requires.collect do |package|
+ self.class.new(package, @path, @msvc_syntax).libs
+ end
+ all_libs = [declaration("Libs")] + all_libs
+ all_libs = all_libs.join(" ").gsub(/-([Ll]) /, '\1').split.uniq
+ path_flags, other_flags = all_libs.partition {|flag| /\A-L/ =~ flag}
+ path_flags = path_flags.reject do |flag|
+ /\A-L\/usr\/lib(?:64)?\z/ =~ flag
+ end
+ if @msvc_syntax
+ path_flags = path_flags.collect do |flag|
+ flag.gsub(/\A-L/, "/libpath:")
+ end
+ other_flags = other_flags.collect do |flag|
+ if /\A-l/ =~ flag
+ "#{$POSTMATCH}.lib"
+ else
+ flag
+ end
+ end
+ end
[path_flags, other_flags]
end
More information about the cairo-commit
mailing list