[xml] gnome-config & pkg-config --cflags bug



The current gnome-config --cflags and pkg-config --cflags
for libxml1 looks like this :

[foo bongo gnome-xml_LIB_XML_1_BRANCH]$ gnome-config --cflags xml
-I/home/foo/gnome/include/gnome-xml
[foo bongo gnome-xml_LIB_XML_1_BRANCH]$ pkg-config --cflags xml
 -I/home/foo/gnome/include/gnome-xml  
[foo bongo gnome-xml_LIB_XML_1_BRANCH]$ 


When and application includes a header with :
#include <gnome-xml/parser.h>
#include <gnome-xml/tree.h>
#include <gnome-xml/xmlmemory.h>

we are including the "gnome-xml" part twice. An include line of :
"{prefix}/inlcude/gnome-xml" and a directive of #include
<gnome-xml/foo.h>

results in :
{prefix}/include/gnome-xml/gnome-xml/foo.h

Attached you will find a patch that fixes the ouput for gnome-config
and pkg-config on the CVS version stable branch gnome-xml. I suspect
that HEAD has the same problem and i could patch it too. Can i apply ?

The new output looks like this :

[foo bongo gnome-xml_LIB_XML_1_BRANCH]$ pkg-config --cflags libxml
 -I/home/foo/gnome/include  
[foo bongo gnome-xml_LIB_XML_1_BRANCH]$ gnome-config --cflags xml
-I/home/foo/gnome/include
[foo bongo gnome-xml_LIB_XML_1_BRANCH]$ 

(more details below)

Please note that this will break some apps that where only using
#include <parser.h>
since they will need to add "gnome-xml" to their include lines.
Including <parser.h> IMHO is broKEn.

regards,
Chema

-----------------
Why was this not caught before ?

Because most people install their libraries together and the correct
path was provided by another library. 

This is the problem i was getting while trying to compile gnome-vfs :
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../libgnomevfs -I../libgnomevfs
-I../intl -I../intl -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-D_REENTRANT -I/home/foo/gnome/include/gnome-xml -I/usr/include/gconf/1
-I/usr/include -I/usr/include/glib-1.2 -I/usr/lib/glib/include
-I/usr/include/gtk-1.2 -I/usr/X11R6/include -Wall -Wchar-subscripts
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs
-Wpointer-arith -Wsign-promo -Wno-sign-compare -Werror -D_GNU_SOURCE
-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DPREFIX=\"/home/foo/gnome\" -g
-O2 -Wp,-MD,.deps/test-method.pp -c test-method.c  -fPIC -DPIC -o
.libs/test-method.lo
test-method.c:40:30: gnome-xml/parser.h: No such file or directory
test-method.c:41:28: gnome-xml/tree.h: No such file or directory
test-method.c:42:33: gnome-xml/xmlmemory.h: No such file or directory

after patching libxml and reinstalling, gnome-vfs compiled
(I just discovered that we need to patch xml-config too)
=========== PATCH ===========================
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-xml/Makefile.am,v
retrieving revision 1.51.2.9
diff -r1.51.2.9 Makefile.am
293,294c293,294
<       sed -e 's?\ XML_LIBDIR\@?$(XML_LIBDIR)?g' \
<           -e 's?\ XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
---
      sed -e 's?\ XML_LIBDIR\@?-L$(libdir)?g' \
          -e 's?\ XML_INCLUDEDIR\@?-I$(includedir)?g' \
Index: libxml.pc.in
===================================================================
RCS file: /cvs/gnome/gnome-xml/Attic/libxml.pc.in,v
retrieving revision 1.1.2.3
diff -r1.1.2.3 libxml.pc.in
12c12
< Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
---
Cflags: -I${includedir} @XML_CFLAGS@





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