diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2012-12-19 11:04:49 +1300 |
---|---|---|
committer | Luca Bruno <luca.bruno@immobiliare.it> | 2014-07-14 18:28:45 +0200 |
commit | 7a48bd244dda8beea79e2da72f9c482326e855ff (patch) | |
tree | b79e9978caca2809a86abb00073f31076d8a8083 /compiler | |
parent | 7a3bdef3cfc970722d6738d88c94d002d5cc226b (diff) | |
download | vala-7a48bd244dda8beea79e2da72f9c482326e855ff.tar.gz |
compiler: Support configurable pkg-config command so can cross compile
Fixes bug 690456
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/valacompiler.vala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala index 0962baca5..6ac1e1c8d 100644 --- a/compiler/valacompiler.vala +++ b/compiler/valacompiler.vala @@ -71,6 +71,7 @@ class Vala.Compiler { static string cc_command; [CCode (array_length = false, array_null_terminated = true)] static string[] cc_options; + static string pkg_config_command; static string dump_tree; static bool save_temps; [CCode (array_length = false, array_null_terminated = true)] @@ -131,6 +132,7 @@ class Vala.Compiler { { "enable-gobject-tracing", 0, 0, OptionArg.NONE, ref gobject_tracing, "Enable GObject creation tracing", null }, { "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" }, { "Xcc", 'X', 0, OptionArg.STRING_ARRAY, ref cc_options, "Pass OPTION to the C compiler", "OPTION..." }, + { "pkg-config", 0, 0, OptionArg.STRING, ref pkg_config_command, "Use COMMAND as pkg-config command", "COMMAND" }, { "dump-tree", 0, 0, OptionArg.FILENAME, ref dump_tree, "Write code tree to FILE", "FILE" }, { "save-temps", 0, 0, OptionArg.NONE, ref save_temps, "Keep temporary files", null }, { "profile", 0, 0, OptionArg.STRING, ref profile, "Use the given profile instead of the default", "PROFILE" }, @@ -442,10 +444,13 @@ 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[] { }); + ccompiler.compile (context, cc_command, new string[] { }, pkg_config_command); } else { - ccompiler.compile (context, cc_command, cc_options); + ccompiler.compile (context, cc_command, cc_options, pkg_config_command); } } |