|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 from buildconfig import substs |
|
6 |
|
7 def normalize_suffix(suffix): |
|
8 '''Returns a normalized suffix, i.e. ensures it starts with a dot and |
|
9 doesn't starts or ends with whitespace characters''' |
|
10 value = suffix.strip() |
|
11 if len(value) and not value.startswith('.'): |
|
12 value = '.' + value |
|
13 return value |
|
14 |
|
15 # Variables from the build system |
|
16 AR = substs['AR'] |
|
17 AR_EXTRACT = substs['AR_EXTRACT'].replace('$(AR)', AR) |
|
18 DLL_PREFIX = substs['DLL_PREFIX'] |
|
19 LIB_PREFIX = substs['LIB_PREFIX'] |
|
20 OBJ_SUFFIX = normalize_suffix(substs['OBJ_SUFFIX']) |
|
21 LIB_SUFFIX = normalize_suffix(substs['LIB_SUFFIX']) |
|
22 DLL_SUFFIX = normalize_suffix(substs['DLL_SUFFIX']) |
|
23 IMPORT_LIB_SUFFIX = normalize_suffix(substs['IMPORT_LIB_SUFFIX']) |
|
24 LIBS_DESC_SUFFIX = normalize_suffix(substs['LIBS_DESC_SUFFIX']) |
|
25 EXPAND_LIBS_LIST_STYLE = substs['EXPAND_LIBS_LIST_STYLE'] |
|
26 EXPAND_LIBS_ORDER_STYLE = substs['EXPAND_LIBS_ORDER_STYLE'] |
|
27 LD_PRINT_ICF_SECTIONS = substs['LD_PRINT_ICF_SECTIONS'] |