<<< Date Index >>>     <<< Thread Index >>>

Re: downloading and compiling from source



On 08Mar2008 14:58, Jamie Griffin <jpg@xxxxxxx> wrote:
| Before i attempt it, i wanted to ask for some tips on how best to
| download the source and build it myself (presumably using ./configure,
| make and make install commands).

That works fine.

| also, which directory should i compile it in - is there one i should
| use/create for programs like Mutt? On my Mac system, i had it installed
| in /sw as i followed some instruction from a site i found on the web,
| but i don't fully understand why this directory was used?

/sw is where Fink (a popular mac extra software kit) installs stuff.
(I'm an old unix head only very recently arrived in Mac land and have
had no luck with Fink on leopard, but am very happy with MacPorts,
which uses /opt/local as its base).

You're talking about the install prefix ("./configure --prefix="),
aren't you? I would stay away from both /sw and /opt/local in this case,
as that will install the new mutt in the a "vendor" filespace (treating
fink and macports as vendors) - your install can tread on their installs,
and their installs can tread on yours later.

Instead I would advocate using either --prefix=/usr/local or (my habit)
--prefix=/opt/mutt-some-version-string followed up with symlinks in
/usr/local/bin. Both of these should keep your install out of the way
of other schemes and the latter lets you build and install multiple
mutt versions until you settle on something (and, indeed, lets you test
install a new one later without treading on your stable one).

My habit is thus:

  unpack mutt and cd into source tree
  ./configure --prefix=/opt/mutt-something --other-config-options...
  make && echo YES
  mkdir /opt/mutt-something
  make install && echo YES

and to make it the "default", this:

  cd /opt
  rm -f mutt
  ln -s mutt-something mutt
  cd /usr/local/bin
  ln -s /opt/mutt/bin/mutt .

After that, only lines 2 and 3 are needed to change versions. I
sometimes add:

  ln -s /opt/mutt-something/bin/mutt mutt-something

in /usr/local/bin so I can run a specific mutt version easily.

Of course you'll need /usr/local/bin in your $PATH.

"something" is normally either "cvs-YYYYMMDD" if I've grabbed a CVS source or
"1.5.17" if I've grabbed a release. And I sometimes qualify it out to
"1.5.17-fc7-x86_64" if I'm building in a mixed environment so I know where it
came from - useful if you copy the install to other machines.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

Of course, I realize that the rain in the UK is much wetter than the rain
we get here...  - Eric Gunnerson <gunnerso@xxxxxxxxxxx>