public static Map<String, File> getCompatibleBinaries(ExecutionEnvironment execEnv, String name) { MacroExpander mef = MacroExpanderFactory.getExpander(execEnv); try { Map<String, File> binaries = new LinkedHashMap<String, File>(); String dirname = mef.expandPredefinedMacros("${osname}-${platform}${_isa}"); // NOI18N String filename = mef.expandPredefinedMacros(name); File primary = locateFile(dirname, filename); if (primary != null) { binaries.put(dirname, primary); } if (dirname.endsWith(_64)) { dirname = dirname.substring(0, dirname.length() - _64.length()); File secondary = locateFile(dirname, filename); if (secondary != null) { binaries.put(dirname, secondary); } } return binaries; } catch (ParseException ex) { Exceptions.printStackTrace(ex); return Collections.emptyMap(); } }
public MacroConverter(ExecutionEnvironment env) { envVariables = new HashMap<>(); if (HostInfoUtils.isHostInfoAvailable(env)) { try { HostInfo hostInfo = HostInfoUtils.getHostInfo(env); envVariables.putAll(hostInfo.getEnvironment()); } catch (IOException | CancellationException ex) { // should never == null occur if isHostInfoAvailable(env) => report Exceptions.printStackTrace(ex); } } BrokenReferencesSupport.addTemporaryEnv(env, envVariables); this.expander = (envVariables == null) ? null : MacroExpanderFactory.getExpander(env, false); }
public MacroConverter(ExecutionEnvironment env) { envVariables = new HashMap<>(); if (HostInfoUtils.isHostInfoAvailable(env)) { try { HostInfo hostInfo = HostInfoUtils.getHostInfo(env); envVariables.putAll(hostInfo.getEnvironment()); homeDir = hostInfo.getUserDir(); pathName = getPathName(env, hostInfo); pathSeparator = getPathSeparator(hostInfo); } catch (IOException | ConnectionManager.CancellationException ex) { // should never == null occur if isHostInfoAvailable(env) => report Exceptions.printStackTrace(ex); } } this.expander = MacroExpanderFactory.getExpander(env, false); }
public static String getLdLibraryPath(MakeConfiguration activeConfiguration) { String ldLibraryPathName = getLdLibraryPathName(activeConfiguration); String ldLibPath = activeConfiguration.getProfile().getEnvironment().getenv(ldLibraryPathName); ExecutionEnvironment eenv = activeConfiguration.getDevelopmentHost().getExecutionEnvironment(); if (ldLibPath != null) { try { ldLibPath = MacroExpanderFactory.getExpander(eenv).expandMacros(ldLibPath, HostInfoUtils.getHostInfo(eenv).getEnvironment()); } catch (Exception ex) { Exceptions.printStackTrace(ex); } } if (ldLibPath == null) { ldLibPath = HostInfoProvider.getEnv(eenv).get(ldLibraryPathName); // NOI18N } if (ldLibPath == null) { ldLibPath = ""; // NOI18N } return appendDefaultPaths(eenv, ldLibPath); }