Top Level Namespace

Defined Under Namespace

Modules: Quickfix, Quickfix11, Quickfix40, Quickfix41, Quickfix42, Quickfix43, Quickfix44, Quickfix50, Quickfix50Sp1, Quickfix50Sp2

Instance Method Summary collapse

Instance Method Details

#fetch_openssl_dirObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'ext/quickfix/extconf.rb', line 14

def fetch_openssl_dir
  # Allow environment override
  return ENV['OPENSSL_DIR'] if ENV['OPENSSL_DIR'] && Dir.exist?(ENV['OPENSSL_DIR'])

  # Try pkg-config
  begin
    stdout, status = Open3.capture2('pkg-config', '--variable=prefix', 'openssl')
    return stdout.strip if status.success? && Dir.exist?(stdout.strip)
  rescue Errno::ENOENT
    # pkg-config not available
  end

  # Try brew on macOS
  if RbConfig::CONFIG['host_os'] =~ /darwin/ && system('which brew > /dev/null')
    begin
      stdout, status = Open3.capture2('brew', '--prefix', 'openssl')
      return stdout.strip if status.success? && Dir.exist?(stdout.strip)
    rescue Errno::ENOENT
      # brew not available
    end
  end

  # Fallback to common paths
  fallback_paths = %w[
    /usr/local/opt/openssl@3
    /usr/local/opt/openssl
    /usr/local/ssl
    /usr/lib/ssl
    /opt/homebrew/opt/openssl@3
    /opt/homebrew/opt/openssl
    /opt/openssl
  ]

  fallback_paths.each do |path|
    return path if Dir.exist?(path)
  end

  raise 'OpenSSL directory not found. Please set OPENSSL_DIR environment variable.'
end

#fetch_pg_include_dirObject

Helpers to fetch config values



7
8
9
10
11
12
# File 'ext/quickfix/extconf.rb', line 7

def fetch_pg_include_dir
  return ENV['PG_INCLUDE_DIR'] if ENV['PG_INCLUDE_DIR'] && Dir.exist?(ENV['PG_INCLUDE_DIR'])
  
  stdout, _ = Open3.capture2('pg_config --includedir')
  stdout.strip
end