Re: gcc-4.6.2 build problem related to xgcc not liking '-V' option on i686-pc-linux-gnu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7 November 2011 17:29, Andrew Haley wrote:
> On 11/07/2011 05:25 PM, Jonathan Wakely wrote:
>> N.B. having to set LD_LIBRARY_PATH is ***not*** a good solution, and I
>> hope any writeup which suggests doing that will be rejected. The
>> simplest solution is to install GCC from pre-built packages from
>> someone who knows what they're doing, the next best is to link to gmp,
>> mpfr and mpc statically so LD_LIBRARY_PATH is not needed.
>
> Indeed.  Run ./contrib/download_prerequisites in the top-level dir and
> then build gcc.

Which is exactly what my blog post says to do.

I used to give instructions to unpack the prerequisites manually, but
wrote a new version after learning of the download_prerequisites
script from Andrew, and that new version is about as simple as it can
be:

  # the version you will build
  gccver=4.6.2
  # where you put the downloaded source packages
  pkgdir=$HOME
  # where you will build gcc
  rootdir=$HOME/gcc-tmp
  # where you want to install gcc
  prefix=/opt/gcc-${gccver}
  # the languages you want gcc to support
  langs=c,c++

  mkdir ${rootdir}
  cd ${rootdir}
  tar xzf ${pkgdir}/gcc-${gccver}.tar.gz

  cd gcc-${gccver}
  ./contrib/download_prerequisites
  cd ..

  mkdir objdir
  cd objdir

  ${rootdir}/gcc-${gccver}/configure --prefix=${prefix}
--enable-languages=${langs}

  make
  make install

Is it the variables that make it complicated?  Without them you'd need
to keep editing bits of the text if you're trying to build a different
version to the one in the example, but here you go, if you prefer:

  mkdir tmpdir
  cd tmpdir
  UNPACK THE SOURCE ARCHIVE

  cd gcc-4.6.2
  ./contrib/download_prerequisites
  cd ..

  mkdir objdir
  cd objdir

  ../gcc-4.6.2/configure --prefix=/opt/gcc-4.6.2 --enable-languages=c,c++

  make
  make install

How do you intend to write that up to be any simpler?

The version with variables is more flexible, because it makes it
should be clear that all the user-adjustable bits are the variables at
the start, the rest should be done verbatim.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux