From: Arch Librarian Date: Thu, 14 Jul 2005 13:04:13 +0000 (+0000) Subject: 2001-06-14 Havoc Pennington X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a24428500c9af2e17caa04802a7c9565619951a;p=pkg-config 2001-06-14 Havoc Pennington Author: hp Date: 2001-06-14 10:09:03 GMT 2001-06-14 Havoc Pennington * pkg.c (internal_get_package): don't fall back to legacy -config scripts for the -uninstalled case. 2001-06-07 Havoc Pennington * pkg.m4: add URL to no-pkg-config error message --- diff --git a/ChangeLog b/ChangeLog index 8460478..7e5ac27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-06-14 Havoc Pennington + + * pkg.c (internal_get_package): don't fall back to legacy -config + scripts for the -uninstalled case. + +2001-06-07 Havoc Pennington + + * pkg.m4: add URL to no-pkg-config error message + 2001-06-06 Havoc Pennington * pkg.m4: Fix mismatched backtick diff --git a/pkg.c b/pkg.c index 877207f..02b6b16 100644 --- a/pkg.c +++ b/pkg.c @@ -161,7 +161,7 @@ file_readable (const char *path) static Package * -internal_get_package (const char *name, gboolean warn) +internal_get_package (const char *name, gboolean warn, gboolean check_compat) { Package *pkg = NULL; const char *location; @@ -189,7 +189,7 @@ internal_get_package (const char *name, gboolean warn) un = g_strconcat (name, "-uninstalled", NULL); - pkg = internal_get_package (un, FALSE); + pkg = internal_get_package (un, FALSE, FALSE); g_free (un); @@ -204,25 +204,30 @@ internal_get_package (const char *name, gboolean warn) debug_spew ("Reading '%s' from file '%s'\n", name, location); } - if (location == NULL) + if (location == NULL && check_compat) { pkg = get_compat_package (name); - - if (pkg == NULL) + + if (pkg) { - if (warn) - verbose_error ("Package %s was not found in the pkg-config search path.\n" - "Perhaps you should add the directory containing `%s.pc'\n" - "to the PKG_CONFIG_PATH environment variable\n", - name, name); + debug_spew ("Returning values for '%s' from a legacy -config script\n", + name); + + return pkg; } - - debug_spew ("Returning values for '%s' from a legacy -config script\n", - name); - - return pkg; } + + if (pkg == NULL) + { + if (warn) + verbose_error ("Package %s was not found in the pkg-config search path.\n" + "Perhaps you should add the directory containing `%s.pc'\n" + "to the PKG_CONFIG_PATH environment variable\n", + name, name); + return NULL; + } + pkg = parse_package_file (location); if (pkg == NULL) @@ -264,7 +269,7 @@ internal_get_package (const char *name, gboolean warn) Package * get_package (const char *name) { - return internal_get_package (name, TRUE); + return internal_get_package (name, TRUE, TRUE); } static GSList* diff --git a/pkg.m4 b/pkg.m4 index 39cff69..f165a2e 100644 --- a/pkg.m4 +++ b/pkg.m4 @@ -13,6 +13,7 @@ AC_DEFUN(PKG_CHECK_MODULES, [ echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else if ! $PKG_CONFIG --atleast-pkgconfig-version 0.7.0; then echo "*** Your version of pkg-config is too old. You need version 0.7.0 or newer."