Top Level Namespace

Defined Under Namespace

Modules: Curl

Instance Method Summary collapse

Instance Method Details

#define(s) ⇒ Object


20
21
22
# File 'ext/extconf.rb', line 20

def define(s)
  $defs.push( format("-D HAVE_%s", s.to_s.upcase) )
end

#have_constant(name) ⇒ Object


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'ext/extconf.rb', line 24

def have_constant(name)
  checking_for name do
    src = %{
      #include <curl/curl.h>
      int main() {
        int test = (int)#{name.upcase};
        return 0;
      }
    }
    if try_compile(src,"#{$CFLAGS} #{$LIBS}")
      define name
      true
    else
      false
    end
  end
end

#test_for(name, const, src) ⇒ Object

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


107
108
109
110
111
112
113
114
115
116
# File 'ext/extconf.rb', line 107

def test_for(name, const, src)
  checking_for name do
    if try_compile(src,"#{$CFLAGS} #{$LIBS}")
      define const
      true
    else
      false
    end
  end
end