In Files

Parent

Class Index [+]

Quicksearch

Object

Public Instance Methods

define(s) click to toggle source
 Check arch flags
 TODO: detect mismatched arch types when libcurl mac ports is mixed with native mac ruby or vice versa

archs = $CFLAGS.scan(/-archs(.*?)s/).first # get the first arch flag if archs and archs.size >= 1

  # need to reduce the number of archs...
  # guess the first one is correct... at least the first one is probably the ruby installed arch...
  # this could lead to compiled binaries that crash at runtime...
  $CFLAGS.gsub!(/-arch\s(.*?)\s/,' ')
  $CFLAGS << " -arch #{archs.first}"
  puts "Selected arch: #{archs.first}"

end

    # File ext/extconf.rb, line 39
39: def define(s)
40:   $defs.push( format("-D HAVE_%s", s.to_s.upcase) )
41: end
have_constant(name) click to toggle source
    # File ext/extconf.rb, line 43
43: def have_constant(name)
44:   checking_for name do
45:     src = %{
46:       #include <curl/curl.h>
47:       int main() {
48:         int test = (int)#{name.upcase};
49:         return 0;
50:       }
51:     }
52:     if try_compile(src,"#{$CFLAGS} #{$LIBS}")
53:       define name
54:       true
55:     else
56:       false
57:     end
58:   end
59: end
test_for(name, const, src) click to toggle source

do some checking to detect ruby 1.8 hash.c vs ruby 1.9 hash.c

     # File ext/extconf.rb, line 134
134: def test_for(name, const, src)
135:   checking_for name do
136:     if try_compile(src,"#{$CFLAGS} #{$LIBS}")
137:       define const
138:       true
139:     else
140:       false
141:     end
142:   end
143: end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.