[TriLUG] OT: cross compiling

Ed Hill ed at eh3.com
Tue May 9 14:01:22 EDT 2006


On Tue, 2006-05-09 at 10:10 -0700, Joseph Mack NA3T wrote:
> On Tue, 9 May 2006, Ed Hill wrote:
> 
> > I haven't spent much time with cross-compilers but what you describe
> > above doesn't seem necessary to me.  If I was trying to boot-strap a
> > full compiler system onto a non-native platform then I would probably do
> > it in multiple stages:
> >
> > - build a local cross-compiler
> > - build a compiler using the cross-compiler and install it
> >     in a non-/usr location on the remote machine
> 
> when you run `make install` for some packages, there seems 
> to be a lot of compiling going on before the install runs. 
> (I can't think of what right now, but I had one the other 
> day that took forever to do `make install` after `make` had 
> completed). For `make install`, I would have hoped that 
> /bin/install would just copy everything over and set 
> permissions. Because of the compiling that can take place on 
> `make install`, I can't imagine tar| untar'ing my build tree 
> and then running `make install` on the target machine. So I 
> expect I have to run `make install` on the build machine and 
> then copy everything over.

Hi Joseph,

With most packages, you can specify an alternate install location at the
"make install" stage.  That would allow you to build software that is
configured for one location while (perhaps temporarily) installing it
elsewhere when running "make install".

The above process is what happens within most RPM spec files.  See just
about any RPM spec file for an example.  You could even take a look at
the gcc SRPM to see how they do it:

  wget ${URL_FOR_GCC_SRPM}
  mkdir tmp_dir
  cd tmp_dir
  rpm2cpio ${GCC_SRPM} | cpio -ivd -

which will show you all the bits (including the spec file) used to build
the gcc compiler suite.  You don't need to understand all of it -- its
just meant as an example of how to specify one location at the
"configure" stage and another at the "make install" stage.

Ed

-- 
Edward H. Hill III, PhD
office:  MIT Dept. of EAPS 54-1424;  77 Massachusetts Ave.
             Cambridge, MA 02139-4307
emails:  eh3 at mit.edu                ed at eh3.com
URLs:    http://web.mit.edu/eh3/    http://eh3.com/
phone:   617-253-0098
fax:     617-253-4464





More information about the TriLUG mailing list