You are not logged in.

#1 2007-11-10 19:11:56

synthead
Member
Registered: 2006-05-09
Posts: 1,337

make install to another dir?

I'm building a linux system within a running one.  The work in progress is mounted on /mnt/cf, and I just compiled bash and I want to install it to /mnt/cf instead of / with a make install.  What flags would I use to do this?

Offline

#2 2007-11-10 20:11:31

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: make install to another dir?

./configure --prefix=/mnt/cf/usr
make
make install

Offline

#3 2007-11-10 22:24:57

kumico
Member
Registered: 2007-09-28
Posts: 224
Website

Re: make install to another dir?

it's probably a a better idea to change the make prefix ,, the configure is usually there to sort out where the programs looks for stuff
so
make DESTDIR=/mnt/cf install
or
make [prefix|PREFIX]=/mnt/cf install
the first is used in most apps ive come accross but are few are stubborn and doesn't follow the convention as i see it

Offline

#4 2007-11-10 22:42:34

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: make install to another dir?

No, the --prefix option to configure sets the installation target path, and is the Right Way (tm) to mess with said path.  Among other circumstances, the "make DESTDIR=/mnt/cf install" solution fails when the compilation itself uses the install path as a parameter (such as the case where shared files are expected in $PREFIX/share or configuration is expected in $PREFIX/etc).

Offline

#5 2007-11-10 22:49:17

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: make install to another dir?

But the program run on the new system will not have a /mnt/cf prefix.
When you compile it like that, it will only work if it doesn't need any external resources, afaik.

So ./configure --prefix=/usr
make
make DESTDIR=/mnt/cd/usr install

Like the PKGBUILDs do it, right?

Last edited by Gilneas (2007-11-10 22:51:59)

Offline

#6 2007-11-11 00:01:38

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: make install to another dir?

Duh, good point.  I had forgotten that he was installing to an alternate root as opposed to just an alternate path.

Offline

#7 2007-11-11 06:43:48

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: make install to another dir?

A+ big_smile

I'm getting down to business right now, thanks a million guys!

Offline

#8 2007-11-11 07:02:53

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,399
Website

Re: make install to another dir?

Use the Linux From Scratch book for all the hints you need to do this...

Offline

#9 2007-11-11 20:59:29

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: make install to another dir?

Nice, LFS is a great book.  I remember it being overly complicated years ago, now I skip through chapters ... funny how that happens!

Offline

Board footer

Powered by FluxBB