LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 11-04-2012, 07:17 AM   #1
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Pkg-config


Hi

I have installed pkg-config when I run
Code:
echo $PKG_CONFIG_PATH
it returns nothing. Is this correct?
The reason being I had trouble building I think makedepend, Error cant find pkg-config, FYI pkg-config was installed before starting Xwindows
 
Old 11-04-2012, 08:33 AM   #2
mariostg
Member
 
Registered: Apr 2011
Location: Gatineau, Quebec
Distribution: OpenBSD
Posts: 80

Rep: Reputation: 5
Hi
I get this, but I have no idea what the correct answer should be.

Quote:
>>>echo $PKG_CONFIG_PATH
<PREFIX>/lib/pkgconfig:<PREFIX>/share/pkgconfig
 
Old 11-04-2012, 08:43 AM   #3
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by spiky0011

I have installed pkg-config when I run
Code:
echo $PKG_CONFIG_PATH
it returns nothing. Is this correct?
That's interesting. I also had already installed pkg-config before starting my current BLFS system since pkg-config now is part of the LFS book. My PKG_CONFIG_PATH was probably like yours since it now is this...
Code:
$ echo $PKG_CONFIG_PATH 
/opt/qt/lib/pkgconfig
And that gets established by /etc/profile.d/qt.sh which functions to append that path to PKG_CONFIG_PATH. That script was created as part of the installation of Qt-4.8.3...
Code:
# Begin /etc/profile.d/qt.sh

QTDIR=/opt/qt

pathappend /opt/qt/bin           PATH
pathappend /opt/qt/lib/pkgconfig PKG_CONFIG_PATH

export QTDIR

# End /etc/profile.d/qt.sh
Therefore, my PKG_CONFIG_PATH must have been like yours before I installed Qt-4.8.3. In other words, empty.

The LFS book doesn't mention anything about PKG_CONFIG_PATH (except as part of the configuration for installing Libpipeline). But the BLFS book mentions it explicitly as though it should already be set...
Quote:
Originally Posted by The current BLFS book for pkg-config-0.27.1

The default setting for PKG_CONFIG_PATH is /usr/lib/pkgconfig:/usr/share/pkgconfig because of the prefix used to install pkg-config. You may add to PKG_CONFIG_PATH by exporting additional paths on your system where .pc files are installed.
I haven't had any problems of any kind related to this matter including when I installed makedepend. But I wonder if I should fix my PKG_CONFIG_PATH variable since there are .pc files located in /usr/lib/pkgconfig and /usr/share/pkgconfig. I could do that in /etc/profile. To me, it looks like something I should do.

Last edited by stoat; 11-04-2012 at 09:09 AM.
 
Old 11-04-2012, 08:46 AM   #4
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by mariostg

I get this, but I have no idea what the correct answer should be.
Quote:
>>>echo $PKG_CONFIG_PATH
<PREFIX>/lib/pkgconfig:<PREFIX>/share/pkgconfig
To me, yours is clearly wrong. It looks like you copied that from somewhere without changing <PREFIX> to what it should be. So, where did you read to do that? Just curious.
 
Old 11-04-2012, 08:57 AM   #5
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
FWIW (maybe nothing), I added this to /etc/profile...
Code:
export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/share/pkgconfig
Now PKG_CONFIG_PATH contains the path to all three locations of my .pc files...
Code:
echo $PKG_CONFIG_PATH
/usr/lib/pkgconfig:/usr/share/pkgconfig:/opt/qt/lib/pkgconfig
I'm not saying anybody else should do this. But to me, it just looks more right. I'll see how things go from now on.
 
1 members found this post helpful.
Old 11-04-2012, 09:19 AM   #6
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511

Original Poster
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
Thks stoat

That seems to have fixed it makedepend made ok, the missing .pc files were found.
Just would like to know why I had to make the adjustment.
 
Old 11-04-2012, 09:49 AM   #7
mariostg
Member
 
Registered: Apr 2011
Location: Gatineau, Quebec
Distribution: OpenBSD
Posts: 80

Rep: Reputation: 5
Quote:
Originally Posted by stoat View Post
To me, yours is clearly wrong. It looks like you copied that from somewhere without changing <PREFIX> to what it should be. So, where did you read to do that? Just curious.
I am curious too. I have no ides where the heck I got that.
grep -r "<PREFIX>/lib/pkgconfig" LFS-BOOK-7.2-NOCHUNKS.html yields nothing.

I also got that:
Code:
>>>grep -r PKG_CONFIG /etc/
/etc/profile.d/extrapaths.sh:        pathappend /usr/local/lib/pkgconfig PKG_CONFIG_PATH
/etc/profile.d/xorg.sh:pathappend $XORG_PREFIX/lib/pkgconfig PKG_CONFIG_PATH
/etc/profile.d/xorg.sh:pathappend $XORG_PREFIX/share/pkgconfig PKG_CONFIG_PATH
/etc/profile.d/xorg.sh:export PATH PKG_CONFIG_PATH

Last edited by mariostg; 11-04-2012 at 10:04 AM. Reason: Incorrect statement. Need another coffee...
 
Old 11-04-2012, 10:03 AM   #8
stoat
Member
 
Registered: May 2007
Distribution: LFS
Posts: 628

Rep: Reputation: 185Reputation: 185
Quote:
Originally Posted by mariostg

I am curious too. I have no ides where the heck I got that.
grep -r "<PREFIX>/lib/pkgconfig" LFS-BOOK-7.2-NOCHUNKS.html yields nothing.
Well IMO, the PKG_CONFIG_PATH you posted above was closer to being right than ours. And the formatting of it with that <PREFIX> part suggested it was from an instruction in the book somewhere.

I also have the pathappend function for /usr/local/lib/pkgconfig in my extrapaths.sh script. That doesn't get added to PKG_CONFIG_PATH in my case because /usr/local/lib/pkgconfig doesn't exist in my system. But that part of extrapaths.sh implies that the PKG_CONFIG_PATH variable should already be set somewhere, and extrapaths.sh is just adding more on to it.

My Xorg.sh script doesn't have anything about PKG_CONFIG_PATH in it. It's from Xorg-7.7. The book has a version of Xorg.sh with those PKG_CONFIG_PATH lines in it when /usr is not used as the prefix for Xorg. I did use it.

So to me, all of this indicates that PKG_CONFIG_PATH should be set somewhere before /etc/profile calls those scripts in /etc/profile.d. I put the export command to do that in /etc/profile above the lines that call the scripts in /etc/profile.d. Until I learn or find out otherwise, I think that is the right thing to do.

Last edited by stoat; 11-04-2012 at 10:33 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pkg-config sinXposed Linux - Software 12 10-30-2008 05:48 AM
pkg-config brimble2010 SUSE / openSUSE 3 05-19-2008 08:01 AM
pkg-config? vraidroit Linux - Software 1 06-10-2006 10:33 PM
pkg-config supersucker Linux - Software 3 09-07-2004 09:45 AM
pkg-config help gexzd Linux - Newbie 14 05-03-2004 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration