Top Level Namespace

Defined Under Namespace

Modules: ActionDispatch, ActiveSupport, Couchbase, Rack Classes: MultiJson, String

Constant Summary collapse

LIBDIR =
RbConfig::CONFIG['libdir']
INCLUDEDIR =
RbConfig::CONFIG['includedir']
HEADER_DIRS =
[
  # First search /opt/local for macports
  '/opt/local/include',
  # Then search /usr/local for people that installed from source
  '/usr/local/include',
  # Check the ruby install locations
  INCLUDEDIR,
  # Finally fall back to /usr
  '/usr/include'
]
LIB_DIRS =
[
  # First search /opt/local for macports
  '/opt/local/lib',
  # Then search /usr/local for people that installed from source
  '/usr/local/lib',
  # Check the ruby install locations
  LIBDIR,
  # Finally fall back to /usr
  '/usr/lib'
]

Instance Method Summary collapse

Instance Method Details

#define(macro, value = nil) ⇒ Object


38
39
40
# File 'ext/couchbase_ext/extconf.rb', line 38

def define(macro, value = nil)
  $defs.push("-D #{[macro.upcase, value].compact.join('=')}")
end

#die(message) ⇒ Object


126
127
128
129
130
131
# File 'ext/couchbase_ext/extconf.rb', line 126

def die(message)
  STDERR.puts "\n#{'*' * 70}"
  STDERR.puts "#{message.gsub(/^/, '* ')}"
  STDERR.puts "#{'*' * 70}\n\n"
  abort
end

#try_func(func, libs, headers = nil, &b) ⇒ Object


154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'ext/couchbase_ext/extconf.rb', line 154

def try_func(func, libs, headers = nil, &b)
  headers = cpp_include(headers)
  try_link(<<"SRC", libs, &b) or try_link(<<"SRC", libs, &b)
#{headers}
/*top*/
int main() { return 0; }
int t() { #{func.funcall_style}; return 0; }
SRC
end