gcc looking in wrong directory for libfreetype.so while compiling xorg-server-1.1.1
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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
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.
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:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.