[Top][All Lists]

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

Re: build configuration help

From: John Calcote
Subject: Re: build configuration help
Date: Thu, 03 Apr 2008 09:19:00 -0600
User-agent: Thunderbird (Windows/20080213)

Bob Rossi wrote:
Will it only work if I install with the default installation directory? What if I change the --prefix=/home/bob/foo. Will /home/bob/foo/bin/bar
be able to find /home/bob/foo/lib/ ?
If you install libraries into a "non-standard" location, you're going to have the same problems on Unix that you do on Windows. Windows has one additional option for finding libraries in non-standard places - it always looks in the same directory as the executable first for a DLL. You can BUILD an application to install and run from a specific location - that is, if you use a -R<libdir> option on your app's linker command line, the system will look for libraries in that location, as well as the system locations.

The way you implement this is to use $(prefix)/lib, or $(libdir) in your -R option, which will resolve to the configured library installation directory - /home/bob/foo/lib. When you use -R like this, however, just realize that this binary can only be installed on this one non-standard location (it can still be installed in standard locations).

The difference between windows and linux in this case, is that windows allows you to run your binary from anywhere, and find the library in the same relative location (the same directory, in fact). Linux doesn't allow this because...can you guess? It's a security risk. Microsoft's taken a lot of heat for this over the years.
OK, I didn't know this. That's awesome. Is this something that I can
count on being portable? Meaning, will it work on all the unix systems
you know about, or is it only a feature of gnu ld?
This is fairly standard Unix fare.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]