ext/extconf_common.rb in contrast-agent-3.10.2 vs ext/extconf_common.rb in contrast-agent-3.11.0
- old
+ new
@@ -1,41 +1,43 @@
# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details.
-require 'mkmf'
+# frozen_string_literal: true
+require 'mkmf'
require_relative '../lib/contrast/agent/version'
def name
$TO_MAKE
end
def make!
- create_makefile "#{name}/#{name}"
+ 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"
+ if (/darwin/ =~ RUBY_PLATFORM).nil?
+ '\$${ORIGIN}'
else
- "\\$${ORIGIN}"
+ '@loader_path'
end
end
def funchook_rpath!
- options = " -Wl,-rpath,#{rpath_root}/../../shared_libraries"
+ options = " -Wl,-rpath,#{ rpath_root }/../../shared_libraries"
raise unless try_link('int main() {return 0;}', options)
+
$LDFLAGS << options
- $LDFLAGS << " -L#{__dir__}/../shared_libraries"
+ $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_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')