Sha256: 6c357a0a8998edb501271a5551665e69096e16d98a826662ee1193211c4f781a

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
require 'mkmf'

require_relative '../lib/contrast/agent/version'

def name
  $TO_MAKE
end

def make!
  create_makefile "#{name}/#{name}"
end

def ext_path
  # __dir__ is relative to the file you're reading.
  # this file you're reading is presently within $APP_ROOT/ext/.
  __dir__
end

def rpath_root
  if (darwin = !(/darwin/ =~ RUBY_PLATFORM).nil?)
    "@loader_path"
  else
    "\\$${ORIGIN}"
  end
end

def funchook_rpath!
  options = " -Wl,-rpath,#{rpath_root}/../../shared_libraries"
  raise unless try_link('int main() {return 0;}', options)
  $LDFLAGS << options
  $LDFLAGS << " -L#{__dir__}/../shared_libraries"

  find_header('funchook.h', ext_path)
  have_header('funchook.h')

  find_library('funchook', 'funchook_create', "../shared_libraries")
  find_library('funchook', 'funchook_install')
  find_library('funchook', 'funchook_prepare')
  have_library('funchook', 'funchook_create')
  have_library('funchook', 'funchook_install')
  have_library('funchook', 'funchook_prepare')
end

require_relative './build_funchook'

# default make pathway, here for convenience
funchook_rpath!
make!

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
contrast-agent-3.10.2 ext/extconf_common.rb
contrast-agent-3.10.1 ext/extconf_common.rb
contrast-agent-3.10.0 ext/extconf_common.rb
contrast-agent-3.9.1 ext/extconf_common.rb
contrast-agent-3.9.0 ext/extconf_common.rb
contrast-agent-3.8.5 ext/extconf_common.rb
contrast-agent-3.8.4 ext/extconf_common.rb