summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-02-07 22:25:09 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2018-02-08 07:44:37 +0100
commit7f0e90a5c34f437b7ab8f9197a9d42fc835b1a60 (patch)
treef65705f17cd1e3dcda3882cd8a6fb998747e3c1c /compiler
parentcc629f3724d4a72e38726a4264ab69a925aa00c9 (diff)
downloadvala-7f0e90a5c34f437b7ab8f9197a9d42fc835b1a60.tar.gz
valac: Always use the given "pkg-config" and respect PKG_CONFIG envar
Diffstat (limited to 'compiler')
-rw-r--r--compiler/valacompiler.vala12
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index 8edb0749d..9d4d36b95 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -286,6 +286,11 @@ class Vala.Compiler {
context.run_output = run_output;
+ if (pkg_config_command == null) {
+ pkg_config_command = Environment.get_variable ("PKG_CONFIG") ?? "pkg-config";
+ }
+ context.pkg_config_command = pkg_config_command;
+
if (defines != null) {
foreach (string define in defines) {
context.add_define (define);
@@ -495,13 +500,10 @@ class Vala.Compiler {
if (cc_command == null && Environment.get_variable ("CC") != null) {
cc_command = Environment.get_variable ("CC");
}
- if (pkg_config_command == null && Environment.get_variable ("PKG_CONFIG") != null) {
- pkg_config_command = Environment.get_variable ("PKG_CONFIG");
- }
if (cc_options == null) {
- ccompiler.compile (context, cc_command, new string[] { }, pkg_config_command);
+ ccompiler.compile (context, cc_command, new string[] { });
} else {
- ccompiler.compile (context, cc_command, cc_options, pkg_config_command);
+ ccompiler.compile (context, cc_command, cc_options);
}
}