Re: trouble compiling ORBit (pkg-config issue!)



Darin Adler <darin@bentspoon.com> writes:
> On 2/12/02 9:46 AM, "Havoc Pennington" <hp@redhat.com> wrote:
> 
> > linc pulls it in:
> > 
> > $ unst pkg-config --libs linc
> > -L/unst/lib -lgthread-1.3 -lpthread -lgobject-1.3 -lglib-1.3 -llinc
> 
> Aha! Getting a response from you tickled the appropriate brain cells, Havoc.
> 
> I still don't know what the problem is, but I figured out what's new in the
> equation. I just upgraded to pkg-config 0.11 from pkg-config 0.8, and that's
> when this started happening.

It's a pkg-config bug. I confused the human-readable Name: field with
the key you pass to pkg-config when looking up the position of a
package in the PKG_CONFIG_PATH, which is part of what determines the
sort order. Because linc uses the same string for both things it
triggered the bug, previously all libs were getting the position "0"
i.e. hash lookup failed.

Patch appended.

However, this points out that I need to sort only the -L/-I flags
according to path position, not the -l flags, to avoid breaking static
linking. So I need to patch that as well, then get a release out.

Havoc

Index: ChangeLog
===================================================================
RCS file: /home/freedesktop/pkgconfig/ChangeLog,v
retrieving revision 1.31
diff -u -p -u -r1.31 ChangeLog
--- ChangeLog	2002/02/12 21:30:57	1.31
+++ ChangeLog	2002/02/13 05:05:37
@@ -1,3 +1,8 @@
+2002-02-13  Havoc Pennington  <hp@redhat.com>
+
+	* pkg.c (internal_get_package): look up path position by package
+	key, not package name
+
 2002-02-12  Havoc Pennington  <hp@redhat.com>
 
 	* pkg.c (scan_dir): use g_strdup, and fix the location where 
Index: pkg.c
===================================================================
RCS file: /home/freedesktop/pkgconfig/pkg.c,v
retrieving revision 1.14
diff -u -p -u -r1.14 pkg.c
--- pkg.c	2002/02/12 21:30:57	1.14
+++ pkg.c	2002/02/13 05:05:37
@@ -271,12 +271,6 @@ internal_get_package (const char *name, 
       debug_spew ("Failed to parse '%s'\n", location);
       return NULL;
     }
-
-  pkg->path_position =
-    GPOINTER_TO_INT (g_hash_table_lookup (path_positions, pkg->name));
-
-  debug_spew ("Path position of '%s' is %d\n",
-              pkg->name, pkg->path_position);
   
   if (strstr (location, "uninstalled.pc"))
     pkg->uninstalled = TRUE;
@@ -298,6 +292,12 @@ internal_get_package (const char *name, 
       pkg->key = g_strndup (start, end - start);
     }
 
+  pkg->path_position =
+    GPOINTER_TO_INT (g_hash_table_lookup (path_positions, pkg->key));
+
+  debug_spew ("Path position of '%s' is %d\n",
+              pkg->name, pkg->path_position);
+  
   verify_package (pkg);
 
   debug_spew ("Adding '%s' to list of known packages, returning as package '%s'\n",



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