Click to See Complete Forum and Search --> : Need advice about the Package Config Path.


Wallex
10-18-2002, 10:23 PM
The more I install programd and bump into errors, the more I learn about Linux while solving them.
checking for pkg-config... /usr/local/bin/pkg-config
checking for fontconfig >= 1.0.1... Package fontconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `fontconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fontconfig' found
For the first time ever I understand exactly what this message means. I just installed fontconfig, but the instructions on their site told me not to install in /usr/local, but in XF86Free's directory. The problem is that the fontconfig.pc file ended up in /usr/X11R6/lib/pkgconfig (which is a new directory just created for fontconfig). My question is... should I move this .pc file to where all the others are or should I track down the pkg-config's configuration files so that I should add this directory to the list? (and by the way does anyone knows where are the pkg-config configuration files? the man page doesn't mentions them)

Wallex
10-18-2002, 10:48 PM
Moving the files was NOT a good idea. It compiled fine and then it failed on compilation... makes me wonder 'why'....
I guess my only choice is go seek this file where the famous PKG_CONFIG_PATH is.. I wonder where it is... I'll look into the pkg-config manual again.

EDIT: Oh silly me.. after doing some research, I found out the pkg path is not a variable you set up in a file, it's a global path variable you set in the shell using export. Good thing I already learned how to use the export command. Ah another problem solved before others could.

Wallex
10-19-2002, 12:09 AM
Incorrect again. It seems that if I had moved the pc files to where the rest was, it would have worked anyway. Because.... I get the same error!
This is very odd... I have digged deep into the problem.. but as you can see, everything is in order and there shouldn't be a mistake:
The Error: pangoxft.h:37: #error "must have Xft version 2 or newer"

1. Xft Version 2 is installed:
/usr/X11R6/lib/libXft.so.2.0 (and libXft.so.2 points to 2.0, and libXft.so points to 2). There's also a libXft.a file that was not touched when I installed Xft2, but I don't think that has anything to do with it.
2. This is where the error source is generated:
#include <X11/Xft/Xft.h>
#if defined(XftVersion) && XftVersion >= 20000
And the compiling line:
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE -DSYSCONFDIR=\"/usr/local/etc\" -DLIBDIR=\"/usr/local/lib\" -DMODULE_VERSION=\"1.1.0\" -DG_DISABLE_DEPRECATED -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/X11R6/include -I/usr/include/freetype2 -I/usr/X11R6/include -I.. -g -O2 -Wall -D_REENTRANT -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -c pangoxft-font.c -fPIC -DPIC -o pangoxft-font.lo

Okay... so why this is happening?
1. A bug that doesn't reads the correct Version. This is not it.. because I edited the file to remove that check and presto: 200 compiling errors at once.
2. The compiler is not using the correct library. I wonder how can this be when all the symlinks are placed correctly...
3. I do not have xft 2.0 installed. Despite the existance of the libXft.so.2.0 file?
4. I forgot to run ldconfig after installing Xft. This one sounded like a good answer... but.. I just ran ldconfig and tried again, and it again fails.

Now... this is the kind of problem only Linux Experts can solve, is not it?

EDIT: Well well well... lookie here: the winner is option 3.
Look at what the second line says:
File: ./usr/X11R6/include/X11/Xft/Xft.h
* $XFree86: xc/lib/Xft/Xft.h,v 1.19 2001/04/29 03:21:17 keithp Exp $

Uh... but how can this be? I installed Xft2.. and I run ldconfig. Hmm... I would 'think' ldconfig was to update this header file or something? Has someone 'forgotten' to tell me how to properly install Xft?

Wallex
10-19-2002, 11:43 AM
Um... I am not gonna ask for lots of help on how to solve this since it seems to be a major league problem. But I will ask this...
what does ldconfig does? Is it supposed to rebuild the header libraries (at least)? I mean.... was I correct expecting that ldconfig should have updated the Xft.h header file? (I need some kind of information to help me get going or I'll never solve this)

bwkaz
10-19-2002, 07:38 PM
All that ldconfig does is update the /etc/ld.so.cache file, and (possibly) creating a couple of symlinks to .so files. ld.so.cache is the, well, cache, of which shared library files are where. It really does nothing with header files.

And for number 2 above, the stage of compilation that was giving you errors (the actual compilation, as opposed to the linking) doesn't use shared libraries, so it not using the right library isn't an issue here. The wrong include path might be, I don't know...

You're trying to install pango, right? I've done that before, successfully (v1.0.4), but don't remember what I had to do, if anything...

My X11/Xft/Xft.h file doesn't define XftVersion either, so in theory I should have run into the same problem as you when I tried to compile it.

How did you configure it? Did you pass any options to the script?

It seems you might have changed your system configuration since trying it the first time. It might be good to make distclean, then rm -f config.cache, then restart from the ./configure stage.

Yeah, pango 1.0.4 just successfully finished compiling here, with no changes. Hmm...

Wallex
10-20-2002, 12:35 AM
Well... let's see.... the only 'special' config issue I did was to modify the PKG_CONFIG_PATH because when I installed Xft and fontconfig, I was asked to do a ./configure --sysconfdir=/etc --prefix=/usr/X11R6 (which is OK in order to install the binaries and libraries in the right directories), but doing this caused the .pc files to end up where they 'shouldn't' so I had to modify the mentioned path so that pkg-config would see them. After that minor change I did the usual './configure make' and bumped into that error. Of course... the above compiling error is because I want pango with the Xft backend enabled (since that's the one recommended), if I don't use that (and only use X and Freetype) it'll just compile fine.
And by the way I've deleted the Pango directory several times and then untarred the file again to try again (because I did not know about the make distclean command).

By the way... you said that your /usr/X11R6/include/X11/Xft/Xft.h file does not defines the version? What? It doesn't says anywhere what version it is?

EDIT: I've noticed something VERY insteresting.... first of all, the latest Xft.h file does says * $XFree86: xc/lib/Xft/Xft.h,v 1.28 2002/08/31 18:08:10 keithp Exp $
because the whole comment block has to be included in any modified versions of the original code! When I scroll a bit down some more I get across this:

#ifndef _XFT_H_
#define _XFT_H_

#define XFT_MAJOR 2
#define XFT_MINOR 0
#define XFT_REVISION 0
#define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION))
#define XftVersion XFT_VERSION

Those are the very first define lines in the package I downloaded (/home/public/downloads/fcpackage.2_0/Xft)
BUT, the Xft.h file found at X11R6's include dir say:
#ifndef _XFT_H_
#define _XFT_H_

#include <X11/extensions/Xrender.h>
#include <stdarg.h>

#include <X11/Xfuncproto.h>
#include <X11/Xosdefs.h>

and it keeps going without mentioning the version. See where I am getting at? It seems like I somehow 'forgot' to correctly iinstall Xft (despite the fact that I followed the instructions at the download site). Altough right now I am not sure what to do.. move that file manually? It could break my system if I do so... I guess I can backup. Altough first I need to do a bit more research around... as it seems I've somehow not installed Xft correctly.

Wallex
10-20-2002, 01:17 AM
:/home/public/downloads/fcpackage.2_0/Xft> su -c 'make install'
Password:
install -c -m 0755 libXft.so.2.0 /usr/X11R6/lib
+ rm -f /usr/X11R6/lib/libXft.so.2
+ ln -s libXft.so.2.0 /usr/X11R6/lib/libXft.so.2
+ rm -f /usr/X11R6/lib/libXft.so
+ ln -s libXft.so.2.0 /usr/X11R6/lib/libXft.so
install -c -m 0644 libXft.a /usr/X11R6/lib
ranlib /usr/X11R6/lib/libXft.a
+ install -c -m 0444 Xft.h /usr/X11R6/include/X11/Xft
+ install -c -m 0444 XftCompat.h /usr/X11R6/include/X11/Xft
install -c -m 0755 xft-config.script /usr/X11R6/bin/xft-config
install -c -m 0444 xft.pc /usr/X11R6/lib/pkgconfig/xft.pc
install in . done

There, you see the Xft.h file being updated? Now it works. And what did I changed? Instead of:
./configure --sysconfdir=/etc --prefix=/usr/X11R6
I used:
xmkmf -a
Well well well.... was this a bug the developers left out when creating the configure files? Well let this thread be part of the library of unusual problems I've run into and that I've been able to figure out on my own. Altough thanks for the help (even if I understood half of what ldconfig does).

Now I am one step further into installing Gnome2!

bwkaz
10-20-2002, 10:38 AM
Well, um... OK. Right. :D

My /usr/X11R6/include/X11/Xft/Xft.h file looks like yours did before you did the xmkmf stuff that overwrote it. I wonder what the deal with it is, and where that version came from...

Oh, I see, it came from X itself (the joys of user- and group-based package management :cool: ). Odd though...

Well, glad you got it to work!