michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: from buildconfig import substs michael@0: michael@0: def normalize_suffix(suffix): michael@0: '''Returns a normalized suffix, i.e. ensures it starts with a dot and michael@0: doesn't starts or ends with whitespace characters''' michael@0: value = suffix.strip() michael@0: if len(value) and not value.startswith('.'): michael@0: value = '.' + value michael@0: return value michael@0: michael@0: # Variables from the build system michael@0: AR = substs['AR'] michael@0: AR_EXTRACT = substs['AR_EXTRACT'].replace('$(AR)', AR) michael@0: DLL_PREFIX = substs['DLL_PREFIX'] michael@0: LIB_PREFIX = substs['LIB_PREFIX'] michael@0: OBJ_SUFFIX = normalize_suffix(substs['OBJ_SUFFIX']) michael@0: LIB_SUFFIX = normalize_suffix(substs['LIB_SUFFIX']) michael@0: DLL_SUFFIX = normalize_suffix(substs['DLL_SUFFIX']) michael@0: IMPORT_LIB_SUFFIX = normalize_suffix(substs['IMPORT_LIB_SUFFIX']) michael@0: LIBS_DESC_SUFFIX = normalize_suffix(substs['LIBS_DESC_SUFFIX']) michael@0: EXPAND_LIBS_LIST_STYLE = substs['EXPAND_LIBS_LIST_STYLE'] michael@0: EXPAND_LIBS_ORDER_STYLE = substs['EXPAND_LIBS_ORDER_STYLE'] michael@0: LD_PRINT_ICF_SECTIONS = substs['LD_PRINT_ICF_SECTIONS']