[cairo-commit] rcairo ChangeLog,1.185,1.186 extconf.rb,1.5,1.6

Kouhei Sutou commit at pdx.freedesktop.org
Fri Jan 11 00:14:36 PST 2008


Committed by: kou

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

Modified Files:
	ChangeLog extconf.rb 
Log Message:
* extconf.rb: added Quartz backend check for -framework RubyCocoa.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/rcairo/ChangeLog,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -d -r1.185 -r1.186
--- ChangeLog	11 Jan 2008 08:03:38 -0000	1.185
+++ ChangeLog	11 Jan 2008 08:14:32 -0000	1.186
@@ -1,5 +1,7 @@
 2008-01-11  Kouhei Sutou  <kou at cozmixng.org>
 
+	* extconf.rb: added Quartz backend check for -framework RubyCocoa.
+
 	* src/rb_cairo.h:
 	- RUBY_XXX -> RB_XXX.
 	- added extern "C" {}.

Index: extconf.rb
===================================================================
RCS file: /cvs/cairo/rcairo/extconf.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- extconf.rb	14 Jun 2007 12:23:45 -0000	1.5
+++ extconf.rb	11 Jan 2008 08:14:34 -0000	1.6
@@ -20,26 +20,26 @@
   $cc_is_gcc = false
 end
 
-def check_win32()
-  STDOUT.print("checking for Win32 OS... ")
-  STDOUT.flush
-  if /cygwin|mingw|mswin32/ =~ RUBY_PLATFORM
-    $defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
-    STDOUT.print "yes\n"
-    if $cc_is_gcc
-      if /^2\./ =~ `#{Config::CONFIG['CC']} -dumpversion`.chomp
-        $CFLAGS += ' -fnative-struct'
-      else
-        $CFLAGS += ' -mms-bitfields'
+def check_win32
+  checking_for("Win32 OS") do
+    win32_os = /cygwin|mingw|mswin32/ =~ RUBY_PLATFORM
+    if win32_os
+      $defs << "-DRUBY_CAIRO_PLATFORM_WIN32"
+      if $cc_is_gcc
+        if /^2\./ =~ `#{Config::CONFIG['CC']} -dumpversion`.chomp
+          $CFLAGS += ' -fnative-struct'
+        else
+          $CFLAGS += ' -mms-bitfields'
+        end
       end
     end
-  else
-    STDOUT.print "no\n"
+    win32_os
   end
 end
 
 def set_output_lib(target_name)
-  if /cygwin|mingw/ =~ RUBY_PLATFORM
+  case RUBY_PLATFORM
+  when /cygwin|mingw/
     filename = "libruby-#{target_name}.a"
     if RUBY_VERSION > "1.8.0"
       $DLDFLAGS << ",--out-implib=#{filename}" if filename
@@ -50,19 +50,18 @@
       $DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
       $DLDFLAGS << " --output-lib #{filename}" if filename
     end
-  elsif /mswin32/ =~ RUBY_PLATFORM
-      filename = "libruby-#{target_name}.lib"
-      $DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
-      $DLDFLAGS.gsub!(/ \/IMPLIB:[^ ]+/, '')
-      $DLDFLAGS << " /IMPLIB:#{filename}" if filename
+  when /mswin32/
+    filename = "libruby-#{target_name}.lib"
+    $DLDFLAGS.gsub!(/ --output-lib\s+[^ ]+/, '')
+    $DLDFLAGS.gsub!(/ \/IMPLIB:[^ ]+/, '')
+    $DLDFLAGS << " /IMPLIB:#{filename}" if filename
+  when /darwin/
+    if have_macro("CAIRO_HAS_QUARTZ_SURFACE", ["cairo.h"])
+      $DLDFLAGS << " -Wl,-framework,RubyCocoa"
+    end
   end
 end
 
-def setup_win32(target_name)
-  check_win32
-  set_output_lib(target_name)
-end
-
 
 pkg = "cairo"
 modname = "cairo"
@@ -74,7 +73,8 @@
 
 have_func("rb_errinfo")
 
-setup_win32(File.basename(modname))
+check_win32
+set_output_lib(File.basename(modname))
 $defs << "-DRUBY_CAIRO_COMPILATION"
 create_makefile(modname, srcdir)
 



More information about the cairo-commit mailing list