LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-17-2010, 04:39 PM   #1
Wunderbred
LQ Newbie
 
Registered: Dec 2007
Location: Saskatoon Sk
Distribution: Slackware 12.0
Posts: 10

Rep: Reputation: 0
gcc looking in wrong directory for libfreetype.so while compiling xorg-server-1.1.1


Hello I am building a BLFS (Beyond Linux from Scratch) system. I am using a Slackware style package management system. Currently I am trying to build xorg-server-1.1.1 but whn it come to finding libfreetype.so its looking in my build directory (/tmp/mybuild/pachage-freetype/usr/lib/) and not /usr/lib/. I checked /usu/lib/pkgconfig and found that my freetype2.pc (amongst others) file was pointing to my build dir so I fixed it (along with all the others). but when I try building again I gat the same error. I checked my $PATH and my $PKG_CONFIG_PATH and both are correct.

this is a snip of my terminal output

Code:
(cd .libs && rm -f libosandcommon.la && ln -s ../libosandcommon.la libosandcommon.la)
if gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../include -I../../include -I../../include -I../../include -I../../include -I../../include -I../../hw/xfree86 -I../../hw/xfree86/include -I../../hw/xfree86/common -I../../hw/xfree86/os-support -I../../hw/xfree86/os-support/bus -I../../os    -DHAVE_XORG_CONFIG_H -DXF86PM  -DXFree86Server  -DXFree86LOADER -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT   -I../../include -I../../include -I../../Xext -I../../composite -I../../damageext -I../../xfixes -I../../Xi -I../../mi -I../../miext/shadow  -I../../miext/damage -I../../render -I../../randr -I../../fb  -O2 -march=i486 -MT xorg.o -MD -MP -MF ".deps/xorg.Tpo" -c -o xorg.o xorg.c; \
        then mv -f ".deps/xorg.Tpo" ".deps/xorg.Po"; else rm -f ".deps/xorg.Tpo"; exit 1; fi
/bin/sh ../../libtool --tag=CC --mode=link gcc -DHAVE_XORG_CONFIG_H -DXF86PM  -DXFree86Server  -DXFree86LOADER -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT   -I../../include -I../../include -I../../Xext -I../../composite -I../../damageext -I../../xfixes -I../../Xi -I../../mi -I../../miext/shadow  -I../../miext/damage -I../../render -I../../randr -I../../fb  -O2 -march=i486   -o Xorg -rdynamic xorg.o ../../dix/libdix.la common/libinit.a loader/libloader.a libosandcommon.la parser/libxf86config.a dummylib/libdummy.a dixmods/libdixmods.la ../../mi/libmi.la ../../xfixes/libxfixes.la ../../Xext/libXextbuiltin.la  ../../render/librender.la ../../randr/librandr.la ../../damageext/libdamageext.la ../../miext/damage/libdamage.la ../../miext/cw/libcw.la ../../miext/shadow/libshadow.la ../../Xi/libXi.la ../../xkb/libxkb.la  ../../composite/libcomposite.la ../../dix/libxpstubs.la ../../os/libos.la -ldl -lXfont -lXau -lfontenc -lXdmcp    -lm -lz dixmods/libxorgxkb.la -lm 
libtool: link: warning: library `/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../..//libXfont.la' was moved.
libtool: link: warning: library `/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../..//libXfont.la' was moved.
gcc -DHAVE_XORG_CONFIG_H -DXF86PM -DXFree86Server -DXFree86LOADER -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I../../include -I../../include -I../../Xext -I../../composite -I../../damageext -I../../xfixes -I../../Xi -I../../mi -I../../miext/shadow -I../../miext/damage -I../../render -I../../randr -I../../fb -O2 -march=i486 -o Xorg -rdynamic xorg.o  ../../dix/.libs/libdix.a common/libinit.a loader/libloader.a ./.libs/libosandcommon.a parser/libxf86config.a dummylib/libdummy.a dixmods/.libs/libdixmods.a ../../mi/.libs/libmi.a ../../xfixes/.libs/libxfixes.a ../../Xext/.libs/libXextbuiltin.a ../../render/.libs/librender.a ../../randr/.libs/librandr.a ../../damageext/.libs/libdamageext.a ../../miext/damage/.libs/libdamage.a ../../miext/cw/.libs/libcw.a ../../miext/shadow/.libs/libshadow.a ../../Xi/.libs/libXi.a ../../xkb/.libs/libxkb.a ../../composite/.libs/libcomposite.a ../../dix/.libs/libxpstubs.a ../../os/.libs/libos.a -ldl /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../..//libXfont.so -L/usr/lib -L/tmp/mybuild/package-freetype/usr/lib /tmp/mybuild/package-freetype/usr/lib/libfreetype.so /usr/lib/libXau.so /usr/lib/libfontenc.so /usr/lib/libXdmcp.so -lz dixmods/.libs/libxorgxkb.a -lm -Wl,--rpath -Wl,/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../ -Wl,--rpath -Wl,/tmp/mybuild/package-freetype/usr/lib -Wl,--rpath -Wl,/usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../ -Wl,--rpath -Wl,/tmp/mybuild/package-freetype/usr/lib
gcc: /tmp/mybuild/package-freetype/usr/lib/libfreetype.so: No such file or directory
make[4]: *** [Xorg] Error 1
make[4]: Leaving directory `/tmp/mybuild/xorg-server-1.1.1/hw/xfree86'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/mybuild/xorg-server-1.1.1/hw/xfree86'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/mybuild/xorg-server-1.1.1/hw/xfree86'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/mybuild/xorg-server-1.1.1/hw'
make: *** [all-recursive] Error 1
 
Old 03-17-2010, 05:12 PM   #2
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

what do your XORG_PREFIX and XORG_CONFIG variables contain? This sounds like you issued something like
Code:
./configure --prefix=/your/build/path
at some point.

I do not know specifics about slacklike package management. Does it also do a 'fake install' as described in the LFS book? If yes, that's where I would suspect your source of trouble.
 
Old 03-17-2010, 05:45 PM   #3
Wunderbred
LQ Newbie
 
Registered: Dec 2007
Location: Saskatoon Sk
Distribution: Slackware 12.0
Posts: 10

Original Poster
Rep: Reputation: 0
Code:
XORG_PREFIX=/tmp/mybuild/package-xorg-server/usr 
XORG_CONFIG="--prefix=$XORG_PREFIX --sysconfdir=/tmp/mybuild/package-xorg-server/etc \
    --mandir=$XORG_PREFIX/share/man --localstatedir=/tmp/mybuild/package-xorg-server/var"
A slackware like package management installs that program into a set directory ei. /tmp/mybuild/usr then from the /tmp/mybuild directory it creates a .tgz with a script inside it that resets all symbolic links. When installed it places everything contained in the archive in the / directory and runs the script to create the symbolic links.

I have never used any other distro besides Slackware so I am not familiar with any other method of package management.

I don't know if this would be a fake install since after the tgz package is made the package is installed into the actual usr directory and not symlinked from a /usr/pkg directory

when I installed freetype-2.1.10 I installed it to
Code:
/tmp/mybuild/package-freetype/usr
then moved to the
Code:
/tmp/mybuild/package-freetype
directory and tared and gziped it into freetype-2.1.10-1486-1_lfs.tgz, which contains the usr/ directory and everything within it. Then installed the package into the / directory putting the usr/ directory into the base file system and ran the script to generate the symbolic links.

I have had no issues with this method until I got to the xorg-server chapter. Everything else links fine.
 
Old 03-17-2010, 06:31 PM   #4
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Ok,

so it appears that the problem lies with a misconfigured freetype. What is the output of
Code:
freetype-config --libs
freetype-config --libtool
freetype-config --prefix
freetype-config --exec-prefix
freetype-config --cflags
The --prefix and --exec-prefix flags can be overridden, not sure if permanently. Also not sure if the libtool flag can be overridden. But post the output first.
 
Old 03-17-2010, 06:53 PM   #5
Wunderbred
LQ Newbie
 
Registered: Dec 2007
Location: Saskatoon Sk
Distribution: Slackware 12.0
Posts: 10

Original Poster
Rep: Reputation: 0
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --libs
-L/tmp/mybuild/package-freetype/usr/lib -Wl,--rpath -Wl,/tmp/mybuild/package-freetype/usr/lib -lfreetype -lz
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --libtool
/tmp/mybuild/package-freetype/usr/lib/libfreetype.la
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --prefix
/tmp/mybuild/package-freetype/usr
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --exec-prefix
/tmp/mybuild/package-freetype/usr
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --cflags
-I/tmp/mybuild/package-freetype/usr/include/freetype2 -I/tmp/mybuild/package-freetype/usr/include
 
Old 03-17-2010, 07:15 PM   #6
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Ok,

I suspect that the make script uses freetype-config to tell gcc which options to use. I see two possibilities here:
1) you can override the prefixes by
Code:
freetype-config --prefix=/usr
freetype-config --exec-prefix=/usr
These changes might not be permanent.

2) Edit freetype-config, it is a script (back it up before you edit it).
Code:
vim /usr/bin/freetype-config
Here are the first few lines of MY freetype-config:
Code:
prefix=/usr
exec_prefix=${prefix}
exec_prefix_set=no
includedir=${prefix}/include
libdir=${exec_prefix}/lib
There three more variables in the script. Do not edit them, they are switches for the compiler. Maybe you can post your freetype-config script as attachment.
Fixing the prefixes should be sufficient since all other variables are preceeded by prefix or exec-prefix.

Try again with a fresh untarred source and please let me know if that helped.
 
Old 03-17-2010, 08:10 PM   #7
Wunderbred
LQ Newbie
 
Registered: Dec 2007
Location: Saskatoon Sk
Distribution: Slackware 12.0
Posts: 10

Original Poster
Rep: Reputation: 0
I changed the prefix in my freetype-config file to /usr then tried the build again in a clean directory and still the same issue.

I attached my freetype-config with the prefix set to /usr there is another section with the /tmp/mybuild/.. so I also removed it and still same issue,

this is what it said after I changed the file

Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --libs
-lfreetype -lz
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --libtool
/usr/lib/libfreetype.la
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --prefix
/usr
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --exec-prefix
/usr
Code:
root@TheFlash:~/mybuild/xorg-server# freetype-config --cflags
-I/usr/include/freetype2
Attached Files
File Type: txt freetype-config.txt (3.7 KB, 11 views)

Last edited by Wunderbred; 03-17-2010 at 08:41 PM.
 
Old 03-17-2010, 09:06 PM   #8
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
Originally Posted by Wunderbred View Post
I changed the prefix in my freetype-config file to /usr then tried the build again in a clean directory and still the same issue.

I attached my freetype-config with the prefix set to /usr there is another section with the /tmp/mybuild/.. so I also removed it and still same issue,
Can you attach the unmodified file? Also attach the config file and post the error of make.
Quote:
I have had no issues with this method until I got to the xorg-server chapter. Everything else links fine.
Have you build other packages wich had dependencies to previously installed packages that were also installed with slacklike packagement?

Here is an excerpt from the LFS book
Quote:
6.3.2.3. Symlink Style Package Management
This is a variation of the previous package management technique. Each package is installed similar to the previous
scheme. But instead of making the symlink, each file is symlinked into the /usr hierarchy. This removes the need
to expand the environment variables. Though the symlinks can be created by the user to automate the creation, many
package managers have been written using this approach. A few of the popular ones include Stow, Epkg, Graft, and
Depot.
The installation needs to be faked, so that the package thinks that it is installed in /usr though in reality it is installed
in the /usr/pkg hierarchy. Installing in this manner is not usually a trivial task. For example, consider that you are
installing a package libfoo-1.1. The following instructions may not install the package properly:
./configure --prefix=/usr/pkg/libfoo/1.1
make
make install
The installation will work, but the dependent packages may not link to libfoo as you would expect. If you compile
a package that links against libfoo, you may notice that it is linked to /usr/pkg/libfoo/1.1/lib/libfoo.
so.1 instead of /usr/lib/libfoo.so.1 as you would expect. The correct approach is to use the DESTDIR
strategy to fake installation of the package. This approach works as follows:
./configure --prefix=/usr
make
make DESTDIR=/usr/pkg/libfoo/1.1 install
I am afraid all your libs were linked to the wrong location. This is not the exact same method that you use but the remarks about the prefix still remain valid. The prefix switch in the configure statement should be the destination where the libs will finally reside.
To verify this try the following:
Code:
mkdir -pv /tmp/mybuild/package-freetype/
ln -sv /usr /tmp/mybuild/package-freetype/
Use your original freetype-config script. And let me know if it worked.
 
Old 03-17-2010, 09:58 PM   #9
Wunderbred
LQ Newbie
 
Registered: Dec 2007
Location: Saskatoon Sk
Distribution: Slackware 12.0
Posts: 10

Original Poster
Rep: Reputation: 0
Yes I have built ther packages which had dependencies to previously installed packages that were also installed with slacklike package management. all the previous xwindows packages and there dependencies.

creating the symlink in /tmp/mybuild/package-freetype did work to install the package however I feel I need to start over with my fresh LFS backup and try to take a different approach with my package management.

I accidentally deleted my make-errorlog.txt and since I created the symlink it won't error again. I did a
Code:
grep DESTDIR Makefile*
in the xorg-server-1.1.1 directory but the makefile didn't contain a DESTDIR.

Thanks for your help but I am gonna start from the base LFS install again.
 
Old 03-17-2010, 10:35 PM   #10
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Quote:
I feel I need to start over with my fresh LFS backup and try to take a different approach with my package management.
Don't rush into things. Every packagemanagement technique has its ups and downs. Instead try to find out why it worked the previous times and not for freetype. I personally use the user based package management since this will prevent packages of overwriting other packages.

BTW, there is a dedicated 'Linux From Scratch' forum. You might want to post there next time.
 
Old 03-18-2010, 11:14 AM   #11
Wunderbred
LQ Newbie
 
Registered: Dec 2007
Location: Saskatoon Sk
Distribution: Slackware 12.0
Posts: 10

Original Poster
Rep: Reputation: 0
I decided to stick with the slackware style package management. I installed freetype into my base filesystem so everythin would link to /usr then created a seperate directory and copied all the freetype-2.1.10 files to there respective directories then from that directory created my package. This seems t work fine.

I figure the issue come from the onfiguration of freetype during install it links to the original install dir and not where pkgconfig tells it to look. I don't have enough experience with linux to be able figure out a fix for the issue, and since freetype doesn't support DESTDIR I can't install with that method.

I will see how everything goes from here but freetype is linking fine now.
 
  


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
rsync uses wrong directory, has wrong size but right file count? brianpbarnes Linux - Software 1 02-23-2009 05:48 PM
gcc errors while compiling my server.c program using MySQL linuxfan84 Programming 3 06-18-2008 02:26 AM
libfreetype-devel Joe Jarvis Linux - Software 13 03-27-2005 06:56 PM
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 11:38 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:33 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