pkgsrc/devel/pkg-config/patches/patch-ab
wiz 1a6f982900 Update to 0.23:
- Add support for setting sysroot through PKG_CONFIG_SYSROOT_DIR in
   the environment.
 - Update included glib to 1.2.10.
 - Other minor fixes, including a segfault.
2008-03-04 09:22:27 +00:00

117 lines
3.2 KiB
Text

$NetBSD: patch-ab,v 1.5 2008/03/04 09:22:27 wiz Exp $
The static variables are needed because they are used in a struct
initializer. The IRIX/mipseb C compiler needs those addresses to be
constant.
Log all pkg-config calls to a file. Used by pkgtools/verifypc.
--- main.c.orig 2008-01-16 22:06:48.000000000 +0000
+++ main.c
@@ -173,27 +173,27 @@ pkg_uninstalled (Package *pkg)
int
main (int argc, char **argv)
{
- int want_my_version = 0;
- int want_version = 0;
- int want_libs = 0;
- int want_cflags = 0;
- int want_l_libs = 0;
- int want_L_libs = 0;
- int want_other_libs = 0;
- int want_I_cflags = 0;
- int want_other_cflags = 0;
- int want_list = 0;
- int want_static_lib_list = ENABLE_INDIRECT_DEPS;
- int want_short_errors = 0;
+ static int want_my_version = 0;
+ static int want_version = 0;
+ static int want_libs = 0;
+ static int want_cflags = 0;
+ static int want_l_libs = 0;
+ static int want_L_libs = 0;
+ static int want_other_libs = 0;
+ static int want_I_cflags = 0;
+ static int want_other_cflags = 0;
+ static int want_list = 0;
+ static int want_static_lib_list = ENABLE_INDIRECT_DEPS;
+ static int want_short_errors = 0;
int result;
- int want_uninstalled = 0;
- char *variable_name = NULL;
- int want_exists = 0;
- char *required_atleast_version = NULL;
- char *required_exact_version = NULL;
- char *required_max_version = NULL;
- char *required_pkgconfig_version = NULL;
- int want_silence_errors = 0;
+ static int want_uninstalled = 0;
+ static char *variable_name = NULL;
+ static int want_exists = 0;
+ static char *required_atleast_version = NULL;
+ static char *required_exact_version = NULL;
+ static char *required_max_version = NULL;
+ static char *required_pkgconfig_version = NULL;
+ static int want_silence_errors = 0;
GString *str;
GSList *packages = NULL;
char *search_path;
@@ -472,12 +472,27 @@ main (int argc, char **argv)
gboolean failed = FALSE;
GSList *reqs;
GSList *iter;
+ char *log_name;
+ FILE *log;
reqs = parse_module_list (NULL, str->str,
"(command line arguments)");
iter = reqs;
+ log_name = getenv ("PKG_CONFIG_LOG");
+ if (log_name != NULL)
+ {
+ log = fopen (getenv ("PKG_CONFIG_LOG"), "a");
+ if (log == NULL)
+ {
+ fprintf (stderr, "Cannot open log file: %s\n", log_name);
+ exit (1);
+ }
+ }
+ else
+ log = NULL;
+
while (iter != NULL)
{
Package *req;
@@ -488,6 +503,18 @@ main (int argc, char **argv)
else
req = get_package (ver->name);
+ if (log != NULL)
+ {
+ if (req == NULL)
+ fprintf (log, "%s NOT-FOUND", ver->name);
+ else
+ fprintf (log, "%s %s %s", ver->name,
+ comparison_to_str (ver->comparison),
+ (ver->version == NULL) ? "(null)" : ver->version);
+
+ fprintf (log, "\n");
+ }
+
if (req == NULL)
{
failed = TRUE;
@@ -518,6 +545,11 @@ main (int argc, char **argv)
iter = g_slist_next (iter);
}
+ if (log != NULL)
+ {
+ fclose (log);
+ }
+
if (failed) {
return 1;
}