@@ -119,6 +119,20 @@ def __init__(self,
119
119
cs_compile .__init__ (self , package )
120
120
self .srcdir = srcdir
121
121
122
+ top_builddir = os .getcwd ()
123
+ while not os .path .isfile (os .path .join (top_builddir , "cs_config.h" )):
124
+ ds = os .path .split (top_builddir )
125
+ if ds [1 ]:
126
+ top_builddir = ds [0 ]
127
+ else :
128
+ break
129
+
130
+ if not os .path .isdir (os .path .join (top_builddir , "src" )):
131
+ raise Exception ("top build directory not detected from: " \
132
+ + os .getcwd ())
133
+
134
+ self .top_builddir = top_builddir
135
+
122
136
#---------------------------------------------------------------------------
123
137
124
138
def get_compiler (self , compiler ):
@@ -143,17 +157,7 @@ def get_pkg_path_flags(self, flag):
143
157
144
158
flags = []
145
159
146
- top_builddir = os .getcwd ()
147
- while not os .path .isfile (os .path .join (top_builddir , "cs_config.h" )):
148
- ds = os .path .split (top_builddir )
149
- if ds [1 ]:
150
- top_builddir = ds [0 ]
151
- else :
152
- break
153
-
154
- if not os .path .isdir (os .path .join (top_builddir , "src" )):
155
- raise Exception ("top build directory not detected from: " \
156
- + os .getcwd ())
160
+ top_builddir = self .top_builddir
157
161
158
162
# Add CPPFLAGS and LDFLAGS information for the current package
159
163
if flag == 'cppflags' :
@@ -184,6 +188,15 @@ def get_pkg_path_flags(self, flag):
184
188
185
189
return flags
186
190
191
+ #---------------------------------------------------------------------------
192
+
193
+ def get_ar_lib_dir (self ):
194
+ """
195
+ Determine directory containing library in archive mode.
196
+ """
197
+
198
+ return os .path .join (self .top_builddir , "src" , "apps" , ".libs" )
199
+
187
200
#===============================================================================
188
201
# Class used to manage install
189
202
#===============================================================================
@@ -256,16 +269,13 @@ def flags_relocation(self, flag, cmd_line):
256
269
#---------------------------------------------------------------------------
257
270
258
271
def get_flags (self , flag ):
259
-
260
- if flag == 'libs' :
261
- return cs_compile .get_flags (self , flag )
262
-
263
- cmd_line = []
264
-
265
272
"""
266
273
Determine compilation flags for a given flag type.
267
274
"""
268
275
276
+ if flag == 'libs' :
277
+ return cs_compile .get_flags (self , flag )
278
+
269
279
cmd_line = self .get_pkg_path_flags (flag )
270
280
271
281
# Build the command line, and split possible multiple arguments in lists.
@@ -290,6 +300,21 @@ def get_flags(self, flag):
290
300
291
301
return cmd_line
292
302
303
+ #---------------------------------------------------------------------------
304
+
305
+ def get_lib_dir (self ):
306
+ """
307
+ Determine directory containing library.
308
+ """
309
+
310
+ cmd_line = self .get_pkg_path_flags (flag )
311
+
312
+ # Build the command line, and split possible multiple arguments in lists.
313
+ for lib in pkg .config .deplibs :
314
+ if (pkg .config .libs [lib ].have == "yes" \
315
+ and (not pkg .config .libs [lib ].dynamic_load )):
316
+ cmd_line += separate_args (pkg .config .libs [lib ].flags [flag ])
317
+
293
318
#===============================================================================
294
319
# Functions
295
320
#===============================================================================
0 commit comments