Installing GDC to home directory?

Vijay Nayar madric at gmail.com
Fri Aug 19 13:48:21 PDT 2011


On Tue, 16 Aug 2011 00:32:06 +0200, Trass3r wrote:

>> 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.
> 
> How would you configure it to create a dmd like package that can be
> extracted anywhere?

Sorry about the late reply.  Traditionally, if you have a standard 
autotools project, and you do not have permissions to override system 
files, you create subdirectories that you use locally and put them in 
your path.

I use a directory structure like this:
 /home/vnayar/bin
 /home/vnayar/lib
 /home/vnayar/share

To install software to, and have it expect to run from, your local 
directory, compile it like so:
 $ cd my-program-0.1
 $ ./configure --prefix=$HOME
 $ make ; make install

To run these commands by default when you enter them in the prompt, 
you'll want to set up your PATH settings.

For example, if you use Bash as your shell there is usually a file called 
".bashrc" or ".profile" in your home directory that is read when the 
shell first loads.  You can add an entry to the shell environment 
variable "PATH" by adding the following line to the bottom of the file:
  export PATH=$HOME/bin:$PATH

The PATH environment variable is searched left to right, so this means, 
"Look for executables in $HOME/bin before looking in the normal places."  
So if you install your own personal 'gcc', it will be loaded instead of 
the one in /usr/bin/gcc.

You can manually load your new changes using the command "source 
~/.profile".

To check what executable will be run for a particular command, use 
'which', e.g. "which gcc" outputs "/usr/bin/gcc" for me.

 - Vijay


More information about the D.gnu mailing list