From fb08ae2bd21c0f25d719d1914a07f19cef1a3619 Mon Sep 17 00:00:00 2001 From: Graham Ollis Date: Mon, 25 Jun 2018 06:36:57 -0400 Subject: [PATCH] environment variables for system paths should override compiled-in defaults --- libpkgconf/client.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libpkgconf/client.c b/libpkgconf/client.c index 796014d..f4155b3 100644 --- a/libpkgconf/client.c +++ b/libpkgconf/client.c @@ -96,11 +96,15 @@ pkgconf_client_init(pkgconf_client_t *client, pkgconf_error_handler_func_t error pkgconf_client_set_buildroot_dir(client, NULL); pkgconf_client_set_prefix_varname(client, NULL); - pkgconf_path_copy_list(&client->filter_libdirs, &personality->filter_libdirs); - pkgconf_path_copy_list(&client->filter_includedirs, &personality->filter_includedirs); + if(getenv("PKG_CONFIG_SYSTEM_LIBRARY_PATH") == NULL) + pkgconf_path_copy_list(&client->filter_libdirs, &personality->filter_libdirs); + else + pkgconf_path_build_from_environ("PKG_CONFIG_SYSTEM_LIBRARY_PATH", NULL, &client->filter_libdirs, false); - pkgconf_path_build_from_environ("PKG_CONFIG_SYSTEM_LIBRARY_PATH", NULL, &client->filter_libdirs, false); - pkgconf_path_build_from_environ("PKG_CONFIG_SYSTEM_INCLUDE_PATH", NULL, &client->filter_includedirs, false); + if(getenv("PKG_CONFIG_SYSTEM_INCLUDE_PATH") == NULL) + pkgconf_path_copy_list(&client->filter_includedirs, &personality->filter_includedirs); + else + pkgconf_path_build_from_environ("PKG_CONFIG_SYSTEM_INCLUDE_PATH", NULL, &client->filter_includedirs, false); /* GCC uses these environment variables to define system include paths, so we should check them. */ #ifdef __HAIKU__