Top Level Namespace

Defined Under Namespace

Modules: EventMachine, JavaFields Classes: BufferedTokenizer, IO, StringIO, TestConnection

Constant Summary collapse

EM =

Alias for EventMachine

EventMachine
GNU_CHAIN =
true
OS_WIN32 =
true
OS_UNIX =
true

Instance Method Summary collapse

Instance Method Details

#add_define(name) ⇒ Object



15
16
17
# File 'ext/extconf.rb', line 15

def add_define(name)
  $defs.push("-D#{name}")
end

#append_library(libs, lib) ⇒ Object

override append_library, so it actually appends (instead of prepending) this fixes issues with linking ssl, since libcrypto depends on symbols in libssl



24
25
26
# File 'ext/extconf.rb', line 24

def append_library(libs, lib)
  libs + " " + format(LIBARG, lib)
end

#check_heads(heads = [], fatal = false) ⇒ Object



11
12
13
# File 'ext/extconf.rb', line 11

def check_heads heads = [], fatal = false
  heads.all? { |head| have_header(head) || (abort("could not find header: #{head}") if fatal)}
end

#check_libs(libs = [], fatal = false) ⇒ Object



7
8
9
# File 'ext/extconf.rb', line 7

def check_libs libs = [], fatal = false
  libs.all? { |lib| have_library(lib) || (abort("could not find library: #{lib}") if fatal) }
end

#dir_config_search(pretty_name, name, paths, &b) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'ext/extconf.rb', line 40

def dir_config_search(pretty_name, name, paths, &b)
  paths.each do |p|
    if dir_config_wrapper(pretty_name, name, p + '/include', p + '/lib') && yield
      warn "-----\nFound #{pretty_name} in path #{p}\n-----"
      return true
    end
  end
  false
end

#dir_config_wrapper(pretty_name, name, idefault = nil, ldefault = nil) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
# File 'ext/extconf.rb', line 28

def dir_config_wrapper(pretty_name, name, idefault=nil, ldefault=nil)
  inc, lib = dir_config(name, idefault, ldefault)
  if inc && lib
    unless idefault && ldefault
      abort "-----\nCannot find #{pretty_name} include path #{inc}\n-----" unless inc && inc.split(File::PATH_SEPARATOR).any? { |dir| File.directory?(dir) }
      abort "-----\nCannot find #{pretty_name} library path #{lib}\n-----" unless lib && lib.split(File::PATH_SEPARATOR).any? { |dir| File.directory?(dir) }
      warn "-----\nUsing #{pretty_name} in path #{File.dirname inc}\n-----"
    end
    true
  end
end

#find_openssl_libraryObject



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'ext/extconf.rb', line 58

def find_openssl_library
  if $mswin || $mingw
    # required for static OpenSSL libraries
    have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
    have_library("crypt32")
  end

  return false unless have_header("openssl/ssl.h") && have_header("openssl/err.h")

  ret = have_library("crypto", "CRYPTO_malloc") &&
    have_library("ssl", "SSL_new")
  return ret if ret
end

#pkg_config_wrapper(pretty_name, name) ⇒ Object



50
51
52
53
54
55
56
# File 'ext/extconf.rb', line 50

def pkg_config_wrapper(pretty_name, name)
  cflags, ldflags, libs = pkg_config(name)
  unless [cflags, ldflags, libs].any?(&:nil?) || [cflags, ldflags, libs].any?(&:empty?)
    warn "-----\nUsing #{pretty_name} from pkg-config #{cflags} && #{ldflags} && #{libs}\n-----"
    true
  end
end