Permalink
Browse files

allow extra flags to be passed to the compiler via the CFLAGS rakefil…

…e variable

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5268 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 8e115fd commit dea88a2a8f2d7cd384fe64de48194429cb078b63 @lrz lrz committed Mar 9, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 rakelib/builder/options.rb
View
6 rakelib/builder/options.rb
@@ -60,6 +60,8 @@ def self.option(name, default)
end
CXX = b.option('CXX', default_CXX)
+EXTRA_CFLAGS = b.option('CFLAGS', '')
+
# Everything below this comment should *not* be modified.
if ENV['build_as_embeddable']
@@ -152,8 +154,8 @@ def initialize(opt)
sdk = opt.delete(:sdk)
has_libauto = sdk ? File.exist?("#{sdk}/usr/lib/libauto.dylib") : true
archflags = archs.map { |x| "-arch #{x}" }.join(' ')
- @cflags = "-std=c99 -I. -I./include -pipe -fno-common -fexceptions -fblocks -g -O#{OPTZ_LEVEL} -Wall -Wno-deprecated-declarations -Werror #{archflags}"
- @cxxflags = "-I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations -Werror #{archflags}"
+ @cflags = "-std=c99 -I. -I./include -pipe -fno-common -fexceptions -fblocks -g -O#{OPTZ_LEVEL} -Wall -Wno-deprecated-declarations -Werror #{archflags} #{EXTRA_CFLAGS}"
+ @cxxflags = "-I. -I./include -fblocks -g -Wall -Wno-deprecated-declarations -Werror #{archflags} #{EXTRA_CFLAGS}"
@ldflags = '-lpthread -ldl -lxml2 -lobjc -licucore -framework Foundation'
@ldflags << " -lauto" if has_libauto
if opt.delete(:static)

0 comments on commit dea88a2

Please sign in to comment.