[cairo-commit] rcairo ChangeLog,1.219,1.220 extconf.rb,1.17,1.18

Kouhei Sutou commit at pdx.freedesktop.org
Fri Apr 4 06:51:51 PDT 2008


Committed by: kou

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

Modified Files:
	ChangeLog extconf.rb 
Log Message:
* extconf.rb: support building with Wine + MinGW on my Linux environment.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/rcairo/ChangeLog,v
retrieving revision 1.219
retrieving revision 1.220
diff -u -d -r1.219 -r1.220
--- ChangeLog	4 Apr 2008 05:56:43 -0000	1.219
+++ ChangeLog	4 Apr 2008 13:55:57 -0000	1.220
@@ -1,5 +1,8 @@
 2008-04-04  Kouhei Sutou  <kou at cozmixng.org>
 
+	* extconf.rb: support building with Wine + MinGW on my Linux
+	environment.
+
 	* extconf.rb: use search path for nmake.
 
 	* extconf.rb: add the same directory of extconf.rb to load path.

Index: extconf.rb
===================================================================
RCS file: /cvs/cairo/rcairo/extconf.rb,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- extconf.rb	4 Apr 2008 05:56:43 -0000	1.17
+++ extconf.rb	4 Apr 2008 13:55:57 -0000	1.18
@@ -42,13 +42,13 @@
   when /cygwin|mingw/
     filename = "libruby-#{target_name}.a"
     if RUBY_VERSION > "1.8.0"
-      $DLDFLAGS << ",--out-implib=#{filename}" if filename
+      $DLDFLAGS << ",--out-implib=#{filename}"
     elsif RUBY_VERSION > "1.8"
       $DLDFLAGS.gsub!(/ -Wl,--out-implib=[^ ]+/, '')
-      $DLDFLAGS << " -Wl,--out-implib=#{filename}" if filename
+      $DLDFLAGS << " -Wl,--out-implib=#{filename}"
     else
       $DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
-      $DLDFLAGS << " --output-lib #{filename}" if filename
+      $DLDFLAGS << " --output-lib #{filename}"
     end
   when /mswin32/
     $DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
@@ -82,20 +82,29 @@
 have_func("rb_errinfo")
 
 check_win32
-set_output_lib(File.basename(modname))
+target_name = File.basename(modname)
+set_output_lib(target_name)
 $defs << "-DRB_CAIRO_COMPILATION"
 create_makefile(modname, srcdir)
 
+wine = with_config("wine", false)
+
 makefile = File.read("Makefile")
 File.open("Makefile", "w") do |f|
   objs = []
   co = nil
   makefile.each_line do |line|
+    if wine
+      line.gsub!(/\bgcc\b/, "i586-mingw32msvc-gcc")
+      line.gsub!(/C:/, "$(HOME)/.wine/drive_c")
+      line.gsub!(/Z:/, "")
+    end
+
     case line
     when /^DLLIB\s*=\s*/
       dllib = $POSTMATCH
-      f.print("DLLIB = #{ext_dir_name}/#{dllib}")
-      f.print("IMPLIB = #{ext_dir_name}/libruby-#{dllib.gsub(/\..+?$/, '.lib')}")
+      f.puts("DLLIB = #{ext_dir_name}/#{dllib}")
+      f.puts("IMPLIB = #{ext_dir_name}/libruby-#{dllib.gsub(/\..+?$/, '.lib')}")
     when /^(SRCS)\s*=\s*/
       name = $1
       vars = $POSTMATCH.split.collect {|var| "$(srcdir)/#{var}"}.join(" ")
@@ -106,6 +115,10 @@
       objs = vars if name == "OBJS"
       vars = vars.join(" ")
       f.puts("#{name} = #{vars}")
+    when /^LDSHARED\s*=/
+      def_file = "#{ext_dir_name}/#{target_name}.def"
+      line.gsub!(/\b-shared\b/, "-shared #{def_file}") if wine
+      f.puts(line)
     when /^\t\$\(CC\)/
       if PKGConfig.msvc?
         output_option = "-Fo"
@@ -118,14 +131,14 @@
       co = line
       f.puts(line)
     else
-      f.print(line)
+      f.puts(line)
     end
   end
 
   if co and !objs.empty?
     f.puts
     if PKGConfig.msvc?
-      f.puts "{$(srcdir)}.c{src}.obj:"
+      f.puts "{$(srcdir)}.c{#{ext_dir_name}}.obj:"
       f.puts co
     else
       objs.each do |obj|



More information about the cairo-commit mailing list