Pergunta

Of course we all know building GCC version >= 4.1.x requires the supplementary packages MPFR, GMP and MPC to be present.

There's a few ways to handle these GCC dependencies:

1) Download and build each supporting package separately and then tell make where the binaries are located during GCC build time.

2) Download each supporting package, untar and move the source into your GCC build directory and make will automatically build each of the packages when needed.

(Executing the gcc-src/contrib/download_prerequisites script does the same as option 2)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is there an advantage to either method? Does pre-compiling the binaries provide something I'm missing by taking the "easy route" and just dumping the package's source into my GCC build directory and letting make figure it out?

I've seen it done more frequently in various build scripts by pre-compiling each package to a binary, and then telling make where they are located during gcc compilation. Is this the "preferred" way to do it? Why?

To add context, I'm mainly building cross-compilers targeting various ARM platforms.

Foi útil?

Solução

For most use cases I believe that option 2 is just as good as option 1. However, I can see a few situations in which one would want to do it manually.

  • A package maintainer wants to build separately as they want separate packages for mpfr et al.

  • Someone who wants to pass different configure arguments/CFLAGS to each of the packages.

  • A GCC developer who wants to keep their source and build trees small as they don't make any changes to MPFR/GMP/etc.

I haven't done too much work with the (rather ugly) GCC build system, but I haven't seen any obvious differences in how the binaries are built.

I'm not the biggest authority on this though, so YMMV; I may be wrong.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top