1
2
3
4
5
6
7
8
9
10
11
12
13
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
53
54
55
|
--- a/SConscript
+++ b/SConscript
@@ -33,15 +33,17 @@ if has_version_script:
def check_dynamic_symbols(target, source, env):
import subprocess
+ objdump = env['OBJDUMP']
+
# Check if objdump exists
- p = subprocess.Popen(['objdump', '--version'], stdout=subprocess.PIPE)
+ p = subprocess.Popen([objdump, '--version'], stdout=subprocess.PIPE)
p.wait()
if p.returncode != 0:
print('objdump utility is not found. Skipping checks...')
return 0
# Check that DSO doesn't contain asio-related dynamic symbols
- if env.Execute(Action(['! objdump -T ' + target[0].abspath + ' | grep asio'], None)):
+ if env.Execute(Action(['! ' + objdump + ' -T ' + target[0].abspath + ' | grep asio'], None)):
return 1
return 0
--- a/SConstruct
+++ b/SConstruct
@@ -5,6 +5,7 @@
# SCons build script to build galera libraries
#
# How to control the build with environment variables:
+# Set AR to specify archive utility
# Set CC to specify C compiler
# Set CXX to specify C++ compiler
# Set CPPFLAGS to add non-standard include paths and preprocessor macros
@@ -13,6 +14,7 @@
# Set CXXFLAGS to supply C++ compiler options
# Set LDFLAGS to *override* linking flags
# Set LIBPATH to add non-standard linker paths
+# Set OBJDUMP to specify objdump utility
# Set RPATH to add rpaths
#
# Some useful CPPFLAGS:
@@ -205,6 +207,13 @@ if cxx != 'default':
link = os.getenv('LINK', 'default')
if link != 'default':
env.Replace(LINK = link)
+ar = os.getenv('AR', 'default')
+if ar != 'default':
+ env.Replace(AR = ar)
+objdump = os.getenv('OBJDUMP', 'default')
+if objdump != 'default':
+ env.Replace(OBJDUMP = objdump)
+
# Get compiler name/version, CXX may be set to "c++" which may be clang or gcc
cc_version = str(read_first_line(env['CC'].split() + ['--version']))
|