class Object

Constants

GLOB

Public Instance Methods

add_ssl_defines(header) click to toggle source
# File ext/mysql2/extconf.rb, line 14
def add_ssl_defines(header)
  all_modes_found = %w[SSL_MODE_DISABLED SSL_MODE_PREFERRED SSL_MODE_REQUIRED SSL_MODE_VERIFY_CA SSL_MODE_VERIFY_IDENTITY].inject(true) do |m, ssl_mode|
    m && have_const(ssl_mode, header)
  end
  if all_modes_found
    $CFLAGS << ' -DFULL_SSL_MODE_SUPPORT'
  else
    # if we only have ssl toggle (--ssl,--disable-ssl) from 5.7.3 to 5.7.10
    # and the verify server cert option. This is also the case for MariaDB.
    has_verify_support  = have_const('MYSQL_OPT_SSL_VERIFY_SERVER_CERT', header)
    has_enforce_support = have_const('MYSQL_OPT_SSL_ENFORCE', header)
    $CFLAGS << ' -DNO_SSL_MODE_SUPPORT' if !has_verify_support && !has_enforce_support
  end
end
asplode(lib) click to toggle source
# File ext/mysql2/extconf.rb, line 4
def asplode(lib)
  if RUBY_PLATFORM =~ /mingw|mswin/
    abort "-----\n#{lib} is missing. Check your installation of MySQL or Connector/C, and try again.\n-----"
  elsif RUBY_PLATFORM =~ /darwin/
    abort "-----\n#{lib} is missing. You may need to 'brew install mysql' or 'port install mysql', and try again.\n-----"
  else
    abort "-----\n#{lib} is missing. You may need to 'sudo apt-get install libmariadb-dev', 'sudo apt-get install libmysqlclient-dev' or 'sudo yum install mysql-devel', and try again.\n-----"
  end
end