[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pkgconfig fix - please test



Hi all,

Attached is a diff for pkgconfig that basically forces the listing of
"-I/usr/local/include" and/or "-I/usr/X11R6/include" to always appear
LAST when generating a list of cflags (if, of course, they exist in the
first place).

Ideally this will help to avoid header conflicts created when one of
those directories is listed too early.  If you've worked much with a
port that uses pkgconfig you probably know what I mean :).

So look this over and if anyone has any issues with it, let me know.

Marc
Index: Makefile
===================================================================
RCS file: /pub/cvs/ports/devel/pkgconfig/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	11 Dec 2002 17:17:08 -0000	1.10
+++ Makefile	31 Dec 2002 02:55:45 -0000
@@ -4,6 +4,7 @@
 
 VERSION=		0.14.0
 DISTNAME=		pkgconfig-${VERSION}
+PKGNAME=		pkgconfig-${VERSION}p1
 CATEGORIES=		devel
 
 HOMEPAGE=		http://www.freedesktop.org/software/pkgconfig/
Index: patches/patch-pkg_c
===================================================================
RCS file: patches/patch-pkg_c
diff -N patches/patch-pkg_c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-pkg_c	31 Dec 2002 02:52:16 -0000
@@ -0,0 +1,67 @@
+$OpenBSD$
+--- pkg.c.orig	Thu Oct 10 14:14:59 2002
++++ pkg.c	Mon Dec 30 18:51:56 2002
+@@ -334,6 +334,54 @@ get_package (const char *name)
+   return internal_get_package (name, TRUE, TRUE);
+ }
+ 
++/*
++  If certain directories are present, move them to the end of the list
++  to avoid conflicts.
++*/
++static GSList*
++string_list_fix_local_I_dirs (GSList *list)
++{
++  GSList *iter;
++  GSList *local_I_dirs = NULL;
++  GSList *local_I_dir_iter = NULL;
++  GSList *found_dirs = NULL;
++
++  iter = list;
++
++  local_I_dirs = g_slist_append (local_I_dirs, g_strdup ("-I/usr/local/include"));
++  local_I_dirs = g_slist_append (local_I_dirs, g_strdup ("-I/usr/X11R6/include"));
++
++  while (iter != NULL)
++    {
++      local_I_dir_iter = local_I_dirs;
++      while (local_I_dir_iter != NULL)
++        {
++          if (strcmp (local_I_dir_iter->data, iter->data) == 0)
++            {
++              debug_spew ("List contains \"%s\" - moving it to the end\n", (gchar *)iter->data);
++              found_dirs = g_slist_append (found_dirs, iter->data);
++              iter->data = NULL;
++              break;
++            }
++          local_I_dir_iter = local_I_dir_iter->next;
++        }
++      iter = iter->next;
++    }
++
++  g_slist_free (local_I_dirs);
++
++  while (found_dirs != NULL)
++    {
++      list = g_slist_remove (list, NULL);
++      list = g_slist_append (list, found_dirs->data);
++      found_dirs = found_dirs->next;
++    }
++
++  g_slist_free (found_dirs);
++
++  return list;
++}
++
+ static GSList*
+ string_list_strip_duplicates (GSList *list)
+ {
+@@ -923,6 +971,8 @@ get_multi_merged (GSList *pkgs, GetListF
+ 
+   g_slist_free (dups_list);
+   
++  list = string_list_fix_local_I_dirs (list);
++
+   retval = string_list_to_string (list);
+ 
+   g_slist_free (list);

Visit your host, monkey.org