Lines 66-71
Link Here
|
66 |
import org.netbeans.modules.cnd.api.toolchain.CompilerSetManager; |
66 |
import org.netbeans.modules.cnd.api.toolchain.CompilerSetManager; |
67 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
67 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironment; |
68 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory; |
68 |
import org.netbeans.modules.nativeexecution.api.ExecutionEnvironmentFactory; |
|
|
69 |
import org.netbeans.modules.nativeexecution.api.util.ProcessUtils; |
70 |
import org.netbeans.modules.nativeexecution.api.util.ProcessUtils.ExitStatus; |
69 |
import org.openide.filesystems.FileObject; |
71 |
import org.openide.filesystems.FileObject; |
70 |
|
72 |
|
71 |
/** |
73 |
/** |
Lines 101-109
Link Here
|
101 |
} |
103 |
} |
102 |
|
104 |
|
103 |
private List<String> envPaths(String folder){ |
105 |
private List<String> envPaths(String folder){ |
104 |
String additionalPaths = pi.getEnv().get("PKG_CONFIG_PATH"); // NOI18N |
106 |
ExitStatus status = ProcessUtils.execute(pi.getExecutionEnvironment(), |
|
|
107 |
pi.isWindows()?"pkg-config.exe":"pkg-config", new String[]{"--variable", "pc_path", "pkg-config"}); // NOI18N |
105 |
List<String> res = new ArrayList<String>(); |
108 |
List<String> res = new ArrayList<String>(); |
|
|
109 |
if (status.isOK()) { |
110 |
addPaths(res, status.output); |
111 |
} |
106 |
res.add(folder); |
112 |
res.add(folder); |
|
|
113 |
addPaths(res, pi.getEnv().get("PKG_CONFIG_PATH")); // NOI18N |
114 |
return res; |
115 |
} |
116 |
|
117 |
private void addPaths(List<String> res, String additionalPaths) { |
107 |
if (additionalPaths != null && additionalPaths.length() > 0) { |
118 |
if (additionalPaths != null && additionalPaths.length() > 0) { |
108 |
StringTokenizer st; |
119 |
StringTokenizer st; |
109 |
if (pi.isWindows()){ |
120 |
if (pi.isWindows()){ |
Lines 115-123
Link Here
|
115 |
res.add(st.nextToken()); |
126 |
res.add(st.nextToken()); |
116 |
} |
127 |
} |
117 |
} |
128 |
} |
118 |
return res; |
|
|
119 |
} |
129 |
} |
120 |
|
130 |
|
121 |
private void initPackagesFromSet(CompilerSet set) { |
131 |
private void initPackagesFromSet(CompilerSet set) { |
122 |
if (pi.isWindows()){ |
132 |
if (pi.isWindows()){ |
123 |
// at first find pkg-config.exe in paths |
133 |
// at first find pkg-config.exe in paths |