Installing GDC to home directory?
Vijay Nayar
madric at gmail.com
Mon Aug 15 14:34:13 PDT 2011
On Mon, 15 Aug 2011 07:23:02 +0200, Johannes Pfau wrote:
> dsimcha wrote:
>>Is there an easy way to compile and install GDC + Phobos, druntime and a
>>few custom libraries to your home directory on a machine that you don't
>>have root access to?
>
> I think you could just change the "--prefix=/opt/gdc" to
> "--prefix=/home/dsimcha/gdc" and it should work. Or you could use
> --prefix="/usr" and 'DESTDIR="/home/dsimcha" make install', I never
> understood the difference between prefix and DESTDIR.
The '--prefix="/usr"' options tells the compiled program where it will
search for libraries, other binaries, data files, and other information
when it runs.
The 'DESTDIR="/home/dsimcha"' option tells the compiler to dump the
output files in the specified directory.
Why is this useful? Mostly it is useful if you are compiling a binary
for other people to use, but don't want to wreck your local environment.
For example, if I am creating a binary .deb or .rpm, I can compile
everything I want so that it expects to run in '/usr' (prefix), but dump
the files in '/home/vnayar/myproject/rpm' (DESTDIR).
After I run my command, I'll have stuff like:
/home/vnayar/myproject/rpm/
+ usr/bin/mybin
+ usr/share/mydata
+ usr/lib/libmine.so
And after I wrap all that up in a .deb package, and someone else installs
it, they will have binaries ready to go in /usr/bin, etc.
More information about the D.gnu
mailing list