Description: Add --host support for the current cross-building configuration triplet, as outlined upstream. http://pkg-config.freedesktop.org/wiki/CrossCompileProposal . The person named in the Author field signed this changelog entry. Author: Neil Williams --- Origin: Neil Williams Bug-Debian: http://bugs.debian.org/ Forwarded: --- pkg-config-0.25.orig/main.c +++ pkg-config-0.25/main.c @@ -188,6 +188,7 @@ main (int argc, char **argv) static int want_short_errors = 0; static int want_uninstalled = 0; static char *variable_name = NULL; + static char *host_name = NULL; static int want_exists = 0; static int want_provides = 0; static int want_requires = 0; @@ -245,6 +246,8 @@ main (int argc, char **argv) "set variable NAME to VALUE", "NAME=VALUE" }, { "exists", 0, POPT_ARG_NONE, &want_exists, 0, "return 0 if the module(s) exist" }, + { "host", 0, POPT_ARG_STRING, &host_name, 0, + "set the host architecture triplet", "NAME=VALUE" }, { "print-variables", 0, POPT_ARG_NONE, &want_variable_list, 0, "output list of variables defined by the module" }, { "uninstalled", 0, POPT_ARG_NONE, &want_uninstalled, 0, @@ -297,20 +300,6 @@ main (int argc, char **argv) debug_spew ("PKG_CONFIG_DEBUG_SPEW variable enabling debug spew\n"); } - search_path = getenv ("PKG_CONFIG_PATH"); - if (search_path) - { - add_search_dirs(search_path, G_SEARCHPATH_SEPARATOR_S); - } - if (getenv("PKG_CONFIG_LIBDIR") != NULL) - { - add_search_dirs(getenv("PKG_CONFIG_LIBDIR"), G_SEARCHPATH_SEPARATOR_S); - } - else - { - add_search_dirs(PKG_CONFIG_PC_PATH, G_SEARCHPATH_SEPARATOR_S); - } - pcsysrootdir = getenv ("PKG_CONFIG_SYSROOT_DIR"); if (pcsysrootdir) { @@ -350,7 +339,28 @@ main (int argc, char **argv) return 1; } - + if (host_name) + { + gchar * host_path = g_strconcat(G_DIR_SEPARATOR_S, "usr", + G_DIR_SEPARATOR_S, host_name, G_DIR_SEPARATOR_S, + "lib", G_DIR_SEPARATOR_S, "pkgconfig", NULL); + add_search_dir(host_path); + g_free (host_path); + } else { + search_path = getenv ("PKG_CONFIG_PATH"); + if (search_path) + { + add_search_dirs(search_path, G_SEARCHPATH_SEPARATOR_S); + } + if (getenv("PKG_CONFIG_LIBDIR") != NULL) + { + add_search_dirs(getenv("PKG_CONFIG_LIBDIR"), G_SEARCHPATH_SEPARATOR_S); + } + else + { + add_search_dirs(PKG_CONFIG_PC_PATH, G_SEARCHPATH_SEPARATOR_S); + } + } /* Error printing is determined as follows: * - for --cflags, --libs, etc. it's on by default * and --silence-errors can turn it off