aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-devtools/codexl/codexl/0016-add-build-control-flag-CXL_sysroot_dir.patch
blob: 0da61abed4b05500fdff5921fce7e60a88a248c4 (plain)
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
From 2bfad59e4f0ec6c9a84ef7d4395fa53700518bd0 Mon Sep 17 00:00:00 2001
From: Adeel Arshad <adeel_arshad@mentor.com>
Date: Fri, 28 Oct 2016 19:19:22 +0500
Subject: [PATCH] add build control flag CXL_sysroot_dir

For cross compilation specifying the sysroot directory
is very handy as the sysroot specifies path where on
build system the build artifacts or staging header and
library files are located.

Signed-off-by: Adeel Arshad <adeel_arshad@mentor.com>
---
 CodeXL/App/SConscript                              |  2 +-
 .../AMDTRemoteDebuggingServer/SConscript           |  4 ++--
 CodeXL/Components/Graphics/GPS_init.py             | 20 ++++++++--------
 CodeXL/Components/Graphics/SConstruct              |  6 ++---
 CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/SConscript   | 12 +++++-----
 .../Utils/AMDTSystemInformationHelper/SConscript   |  2 +-
 Common/Src/AMDTApplication/SConscript              |  2 +-
 Common/Src/AMDTApplicationComponents/SConscript    |  2 +-
 Common/Src/AMDTOSAPIWrappers/SConscript            |  6 ++---
 Common/Src/AMDTOSWrappers/SConscript               |  4 ++--
 Common/Src/AMDTOSWrappers/SConscriptHSA            |  4 ++--
 Common/Src/SCons/CXL_init.py                       | 28 +++++++++++++---------
 12 files changed, 49 insertions(+), 43 deletions(-)

diff --git a/CodeXL/App/SConscript b/CodeXL/App/SConscript
index 4924c4a..e5d39a2 100755
--- a/CodeXL/App/SConscript
+++ b/CodeXL/App/SConscript
@@ -15,7 +15,7 @@ env.Append( CPPPATH = [
     env['CXL_commonproj_dir'],
     env['CXL_commonproj_dir'] + "/AMDTOSWrappers/Include",
     env['CXL_commonproj_dir'] + '/../../CodeXL',
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
+    env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
 ])
 UseBoost(env)
 UseGtk(env)
diff --git a/CodeXL/Components/GpuDebugging/AMDTRemoteDebuggingServer/SConscript b/CodeXL/Components/GpuDebugging/AMDTRemoteDebuggingServer/SConscript
index ffe3387..c330564 100755
--- a/CodeXL/Components/GpuDebugging/AMDTRemoteDebuggingServer/SConscript
+++ b/CodeXL/Components/GpuDebugging/AMDTRemoteDebuggingServer/SConscript
@@ -27,8 +27,8 @@ sources = \
 ]
 
 env.Append( LIBPATH = [
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu",
+    env['CXL_sysroot_dir'] + "/usr/lib",
+    env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu",
     env['CXL_common_dir'] + "/Lib/Ext/zlib/1.2.8/bin/x64/ZlibStatRelease/"
 ])
 
diff --git a/CodeXL/Components/Graphics/GPS_init.py b/CodeXL/Components/Graphics/GPS_init.py
index 805191d..9563ad6 100644
--- a/CodeXL/Components/Graphics/GPS_init.py
+++ b/CodeXL/Components/Graphics/GPS_init.py
@@ -47,16 +47,16 @@ def ParseCommandLine(env, buildInternal):
 # initialize Gtk library
 def initGtk(env):
     env.Append(BASE_PATH = [
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/cairo",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/pango-1.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/atk-1.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gtk-2.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/glib-2.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib64/gtk-2.0/include",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib64/glib-2.0/include/",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu/gtk-2.0/include",
+        env['CXL_sysroot_dir'] + "/usr/include/cairo",
+        env['CXL_sysroot_dir'] + "/usr/include/pango-1.0",
+        env['CXL_sysroot_dir'] + "/usr/include/atk-1.0",
+        env['CXL_sysroot_dir'] + "/usr/include/gtk-2.0",
+        env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0",
+        env['CXL_sysroot_dir'] + "/usr/include/glib-2.0",
+        env['CXL_sysroot_dir'] + "/usr/lib64/gtk-2.0/include",
+        env['CXL_sysroot_dir'] + "/usr/lib64/glib-2.0/include/",
+        env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
+        env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu/gtk-2.0/include",
    ])
 
 ##########################################################################################
diff --git a/CodeXL/Components/Graphics/SConstruct b/CodeXL/Components/Graphics/SConstruct
index d2a6cca..3e8d495 100644
--- a/CodeXL/Components/Graphics/SConstruct
+++ b/CodeXL/Components/Graphics/SConstruct
@@ -154,9 +154,9 @@ GPS_env['GPS_PATH'] = \
 # Additional linker library paths
 GPS_env['GPS_LIBPATH'] = \
 [
-    env['PKG_CONFIG_SYSROOT_DIR'] + '/usr/' + GPS_env.libConfig,
-    env['PKG_CONFIG_SYSROOT_DIR'] + '/usr/lib',
-    env['PKG_CONFIG_SYSROOT_DIR'] + '/usr/lib/' + GPS_env.gnuConfig,
+    env['CXL_sysroot_dir'] + '/usr/' + GPS_env.libConfig,
+    env['CXL_sysroot_dir'] + '/usr/lib',
+    env['CXL_sysroot_dir'] + '/usr/lib/' + GPS_env.gnuConfig,
     '../../obj/' + GPS_env.platformPath + '/' + GPS_env.rootFolderName + '/Server/Common',
     '../../obj/' + GPS_env.platformPath + '/' + GPS_env.rootFolderName,
     GPS_env.CommonPath + '../../Common/Lib/Ext/Boost/boost_' + GPS_env.BoostVersion + '/lib/RHEL6/' + GPS_env.extConfig,
diff --git a/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/SConscript b/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/SConscript
index 0c6d61c..eb29802 100755
--- a/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/SConscript
+++ b/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/SConscript
@@ -21,16 +21,16 @@ env.Append( CPPPATH = [
     "../AMDTTeaPotLib",
     env['CXL_commonproj_dir'] + "/AMDTOSWrappers/Include",
     env['CXL_commonproj_dir'] + "/AMDT/Include",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/GL",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/freetype2",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/libpng12",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/freetype2",
+    env['CXL_sysroot_dir'] + "/usr/include/GL",
+    env['CXL_sysroot_dir'] + "/usr/include/freetype2",
+    env['CXL_sysroot_dir'] + "/usr/include/libpng12",
+    env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
+    env['CXL_sysroot_dir'] + "/usr/include/freetype2",
 
 ])
 
 env.Append( LIBPATH = [
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu/mesa",
+    env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu/mesa",
     env['CXL_Examples_dir']  + "/release",
 ])
 
diff --git a/CodeXL/Utils/AMDTSystemInformationHelper/SConscript b/CodeXL/Utils/AMDTSystemInformationHelper/SConscript
index a46a66d..ce297a4 100755
--- a/CodeXL/Utils/AMDTSystemInformationHelper/SConscript
+++ b/CodeXL/Utils/AMDTSystemInformationHelper/SConscript
@@ -23,7 +23,7 @@ env.Append( CPPPATH = [
 # env.Append(CPPFLAGS = '-fno-strict-aliasing')
 
 env.Append( LIBPATH = [
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib",
+    env['CXL_sysroot_dir'] + "/usr/lib",
 ])
 
 sources = \
diff --git a/Common/Src/AMDTApplication/SConscript b/Common/Src/AMDTApplication/SConscript
index f284f23..f0993df 100755
--- a/Common/Src/AMDTApplication/SConscript
+++ b/Common/Src/AMDTApplication/SConscript
@@ -15,7 +15,7 @@ env.Append( CPPPATH = [
     env['CXL_commonproj_dir'],
     env['CXL_commonproj_dir'] + "/AMDTOSWrappers/Include",
     env['CXL_commonproj_dir'] + '/../../CodeXL',
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
+    env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
 ])
 
 UseGtk(env)
diff --git a/Common/Src/AMDTApplicationComponents/SConscript b/Common/Src/AMDTApplicationComponents/SConscript
index 97bf9ff..8f5283d 100755
--- a/Common/Src/AMDTApplicationComponents/SConscript
+++ b/Common/Src/AMDTApplicationComponents/SConscript
@@ -15,7 +15,7 @@ env.Append( CPPPATH = [
     env['CXL_commonproj_dir'],
     env['CXL_commonproj_dir'] + "/AMDTOSAPIWrappers/Include",
     env['CXL_commonproj_dir'] + '/../../CodeXL',
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
+    env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
 ])
 
 
diff --git a/Common/Src/AMDTOSAPIWrappers/SConscript b/Common/Src/AMDTOSAPIWrappers/SConscript
index 0a2cab7..03934fd 100644
--- a/Common/Src/AMDTOSAPIWrappers/SConscript
+++ b/Common/Src/AMDTOSAPIWrappers/SConscript
@@ -17,7 +17,7 @@ env.Append( CPPPATH = [
     env['CXL_common_dir'] + '/Src/HSAUtils',
 	'/opt/rocm/hsa/include', # A dependency of /Src/HSAUtils
     env['CXL_common_dir'] + '/Src/TSingleton',
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
+    env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
 ])
 
 # osMessageBox, osDesktop
@@ -66,8 +66,8 @@ if (env['CXL_arch'] != 'x86' and env['CXL_hsa'] == 'true'):
 objFiles = env.SharedObject(sources)
 
 env.Append( LIBPATH = [
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu",
+    env['CXL_sysroot_dir'] + "/usr/lib",
+    env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu",
     env['CXL_common_dir'] + "/Lib/Ext/zlib/1.2.8/bin/x64/ZlibStatRelease/"
 ])
 
diff --git a/Common/Src/AMDTOSWrappers/SConscript b/Common/Src/AMDTOSWrappers/SConscript
index c8fca6c..f2134a9 100755
--- a/Common/Src/AMDTOSWrappers/SConscript
+++ b/Common/Src/AMDTOSWrappers/SConscript
@@ -20,7 +20,7 @@ env.Append( CPPPATH = [
     "./Include/",
     env['CXL_commonproj_dir'],
 	env['CXL_common_dir'] + '/Src/Miniz/',
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
+    env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
 ])
 
 env.Append(CPPFLAGS = '-fno-strict-aliasing')
@@ -154,7 +154,7 @@ objFiles = env.SharedObject(sources)
 objFilesC = env_no_c11.SharedObject(csources)
 
 env.Append( LIBPATH = [
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib",
+    env['CXL_sysroot_dir'] + "/usr/lib",
     env['CXL_common_dir'] + "/Lib/Ext/zlib/1.2.8/bin/x64/ZlibStatRelease/"
 ])
 
diff --git a/Common/Src/AMDTOSWrappers/SConscriptHSA b/Common/Src/AMDTOSWrappers/SConscriptHSA
index 341205b..e4f0060 100755
--- a/Common/Src/AMDTOSWrappers/SConscriptHSA
+++ b/Common/Src/AMDTOSWrappers/SConscriptHSA
@@ -14,8 +14,8 @@ env.Append( CPPPATH = [
     "./src/",
     "./Include/",
     env['HWDBG_commonproj_dir'],
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/",
+    env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0/", # [Suravee] Needed for Ubuntu-11.10 
+    env['CXL_sysroot_dir'] + "/usr/include/",
 ])
 
 # osMessageBox, osDesktop
diff --git a/Common/Src/SCons/CXL_init.py b/Common/Src/SCons/CXL_init.py
index a2443ac..34b65ee 100755
--- a/Common/Src/SCons/CXL_init.py
+++ b/Common/Src/SCons/CXL_init.py
@@ -107,6 +107,12 @@ def initCXLVars (CXL_vars) :
         default = '',
         allowed_values = ('true', ''))
 
+    # CxL support to specify sysroot directory
+    CXL_vars.Add(
+        key = 'CXL_sysroot_dir',
+        help = 'Specify sysroot directory to use',
+        default = '',)
+
 def initJava (env) :
     useJava = os.getenv('JAVA_HOME', '')
     if (useJava != ''):
@@ -453,17 +459,17 @@ def UseQtNoGraphics(env):
 
 def initGtk (env) :
     env.Append(CXL_Gtk_inc_path = [
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/cairo",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/pango-1.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/atk-1.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gtk-2.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/gdk-pixbuf-2.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/glib-2.0",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib64/gtk-2.0/include",
-        env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib64/glib-2.0/include/",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/lib/x86_64-linux-gnu/gtk-2.0/include",
-    env['PKG_CONFIG_SYSROOT_DIR'] + "/usr/include/x86_64-linux-gnu/",
+        env['CXL_sysroot_dir'] + "/usr/include/cairo",
+        env['CXL_sysroot_dir'] + "/usr/include/pango-1.0",
+        env['CXL_sysroot_dir'] + "/usr/include/atk-1.0",
+        env['CXL_sysroot_dir'] + "/usr/include/gtk-2.0",
+        env['CXL_sysroot_dir'] + "/usr/include/gdk-pixbuf-2.0",
+        env['CXL_sysroot_dir'] + "/usr/include/glib-2.0",
+        env['CXL_sysroot_dir'] + "/usr/lib64/gtk-2.0/include",
+        env['CXL_sysroot_dir'] + "/usr/lib64/glib-2.0/include/",
+    env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu/glib-2.0/include",
+    env['CXL_sysroot_dir'] + "/usr/lib/x86_64-linux-gnu/gtk-2.0/include",
+    env['CXL_sysroot_dir'] + "/usr/include/x86_64-linux-gnu/",
     ])
     # No additional libraries needed for Gtk
 
-- 
1.9.1