From bc990e9be1c8698d5fbac1555c9d4c2be936d86b Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Thu, 14 Jul 2005 13:05:36 +0000 Subject: [PATCH] 2003-01-15 Havoc Pennington Author: hp Date: 2003-01-15 04:02:47 GMT 2003-01-15 Havoc Pennington * pkg.c (package_init): honor a PKG_CONFIG_LIBDIR to move default search dir, useful in cross-compilation for example, bug #103545 fix from David Schleef --- ChangeLog | 6 ++++++ pkg-config.1 | 4 ++++ pkg.c | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 54a79b7..a3b68bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-01-15 Havoc Pennington + + * pkg.c (package_init): honor a PKG_CONFIG_LIBDIR to move default + search dir, useful in cross-compilation for example, bug + #103545 fix from David Schleef + 2003-01-01 Zack Rusin * main.c (main): added --libs-only-other and --cflags-only-other diff --git a/pkg-config.1 b/pkg-config.1 index d460a64..6efca10 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -230,6 +230,10 @@ Don't strip -I/usr/include out of cflags. .I "PKG_CONFIG_ALLOW_SYSTEM_LIBS" Don't strip -L/usr/lib out of libs +.TP +.I "PKG_CONFIG_LIBDIR" +Replaces the default \fIpkg-config\fP search directory. + .SH WINDOWS SPECIALITIES If a .pc file is found in a directory that matches the usual conventions (i.e., ends with \\lib\\pkgconfig), the prefix for that diff --git a/pkg.c b/pkg.c index a8fd1cb..300e924 100644 --- a/pkg.c +++ b/pkg.c @@ -187,6 +187,11 @@ void package_init () { static gboolean initted = FALSE; + const char *pkglibdir; + + pkglibdir = g_getenv ("PKG_CONFIG_LIBDIR"); + if (pkglibdir == NULL) + pkglibdir = PKGLIBDIR; if (!initted) { @@ -197,7 +202,7 @@ package_init () path_positions = g_hash_table_new (g_str_hash, g_str_equal); g_slist_foreach (search_dirs, (GFunc)scan_dir, NULL); - scan_dir (PKGLIBDIR); + scan_dir (pkglibdir); } } -- 2.39.5