Use the CC environment variable if available instead of calling cc.
authorTilman Sauerbeck <tilman@code-monkey.de>
Thu, 2 Jun 2005 20:16:44 +0000 (20:16 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Thu, 2 Jun 2005 20:16:44 +0000 (20:16 +0000)
ChangeLog
Rakefile

index 9627d11aabf9ae7917a7093d1c9c3c3dfd065b15..0f2af2bb38ade28209aa1f533d2f2abaddd01be2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,13 @@
 --
-$Id: ChangeLog 54 2005-06-02 20:05:38Z tilman $
+$Id: ChangeLog 55 2005-06-02 20:16:44Z tilman $
 ++
 
 2005-06-02 Tilman Sauerbeck (tilman at code-monkey de)
         * ext/ext.c: Fixed to work on Ruby 1.8.{0,1} again
         * lib/eet.rb: Bumped version number to 0.1.3
         * ext/ext.c: Fixed RDoc comment for Object#to_eet
+        * Rakefile: If the CC environment variable is set, use its value
+          instead of calling "cc".
 
 2005-05-31 Tilman Sauerbeck (tilman at code-monkey de)
         * ext/ext.c: Optimized Object#to_eet slightly
index 1b4f270bb99fa9e524f1829f031c071911e0260b..43d7a3abf0dc1badf01cba2c3891e69c731402b3 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -1,4 +1,4 @@
-# $Id: Rakefile 41 2005-05-19 19:18:21Z tilman $
+# $Id: Rakefile 55 2005-06-02 20:16:44Z tilman $
 
 require "rbconfig"
 require "rake/clean"
@@ -17,6 +17,7 @@ PKG_NAME = "ruby-eet"
 PKG_VERSION = File.read("lib/eet.rb").
               match(/^\s*VERSION = \"(.*)\"\s$/).captures.first
 
+cc = ENV["CC"] || "cc"
 ext_obj = "ext/ext.o"
 ext_lib = "ext/eet_ext.so"
 
@@ -29,7 +30,7 @@ rule ".o" => [".c"] do |t|
        cflags = "#{ENV["CFLAGS"]} #{`eet-config --cflags`.strip} " +
                 "-I#{archdir}"
 
-       sh "cc #{cflags} -fPIC #{t.source} -c -o #{t.name}"
+       sh "#{cc} #{cflags} -fPIC #{t.source} -c -o #{t.name}"
 end
 
 file ext_lib => ext_obj do |t|
@@ -38,7 +39,7 @@ file ext_lib => ext_obj do |t|
        ldflags = "#{ENV["LDFLAGS"]} #{`eet-config --libs`.strip} " +
                  "-L#{libdir} #{rubylib}"
 
-       sh "cc #{ldflags} -shared -Wl #{t.prerequisites.join(" ")} " +
+       sh "#{cc} #{ldflags} -shared -Wl #{t.prerequisites.join(" ")} " +
           "-o #{t.name}"
 end