def _build_env(root, arch_triplet): """Set the environment variables required for building. This is required for the current parts installdir due to stage-packages and also to setup the stagedir. """ env = [] paths = common.get_include_paths(root, arch_triplet) if paths: for envvar in ['CPPFLAGS', 'CFLAGS', 'CXXFLAGS']: env.append( common.format_path_variable(envvar, paths, prepend='-I', separator=' ')) paths = common.get_library_paths(root, arch_triplet) if paths: env.append( common.format_path_variable('LDFLAGS', paths, prepend='-L', separator=' ')) paths = common.get_pkg_config_paths(root, arch_triplet) if paths: env.append( common.format_path_variable('PKG_CONFIG_PATH', paths, prepend='', separator=':')) return env
def _runtime_env(root, arch_triplet): """Set the environment variables required for running binaries.""" env = [] env.append('PATH="' + ':'.join([ '{0}/usr/sbin', '{0}/usr/bin', '{0}/sbin', '{0}/bin', '$PATH' ]).format(root) + '"') # Add the default LD_LIBRARY_PATH paths = common.get_library_paths(root, arch_triplet) if paths: env.append(common.format_path_variable( 'LD_LIBRARY_PATH', paths, prepend='', separator=':')) # Add more specific LD_LIBRARY_PATH from staged packages if necessary ld_library_paths = libraries.determine_ld_library_path(root) if ld_library_paths: env.append('LD_LIBRARY_PATH="' + ':'.join(ld_library_paths) + ':$LD_LIBRARY_PATH"') return env
def _build_env(root, arch_triplet): """Set the environment variables required for building. This is required for the current parts installdir due to stage-packages and also to setup the stagedir. """ env = [] paths = common.get_include_paths(root, arch_triplet) if paths: for envvar in ['CPPFLAGS', 'CFLAGS', 'CXXFLAGS']: env.append(common.format_path_variable( envvar, paths, prepend='-I', separator=' ')) paths = common.get_library_paths(root, arch_triplet) if paths: env.append(common.format_path_variable( 'LDFLAGS', paths, prepend='-L', separator=' ')) return env