MFPR doesn't install when building cross-compiler

Programming, for all ages and all languages.
Post Reply
garob
Posts: 16
Joined: Wed Dec 30, 2009 3:26 am
Location: Melbourne, Australia

MFPR doesn't install when building cross-compiler

Post by garob »

Hi I downloaded everything (gcc-4.4.3, binutils-2.9, gmp-5.0.1, mpfr-2.4.2) and and try to build with my script but it spits an error and stops.

This is my script which is basicly everything the tutorial says to do in one file.

Code: Select all

#!/bin/sh
echo building GMP
cd /usr/src
mkdir build-gmp
cd build-gmp
../gmp-5.0.1/configure --prefix=/usr/local
make all install
echo building MPFR
cd /usr/src
mkdir build-mpfr
cd build-mpfr
../mpfr-2.4.2/configure --prefix=/usr/local
make all install
export PREFIX=/usr/cross
export TARGET=i586-elf
cd /usr/src
mkdir build-binutils build-gcc
echo building binutils
cd /usr/src/build-binutils
../binutils-2.9/configure --target=$TARGET --prefix=$PREFIX --disable-nls
make all
make install
echo building gcc
cd /usr/src/build-gcc
export PATH=$PATH:$PREFIX/bin
../gcc-4.4.3/configure --target=$TARGET --prefix=$PREFIX --disable-nls \
    --enable-languages=c,c++ --without-headers
make all-gcc
make install-gcc
echo building libgcc
make all-target-libgcc
make install-target-libgcc
This is the error it stops with:

Code: Select all

checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
make: *** No rule to make target `all-gcc'.  Stop.
make: *** No rule to make target `install-gcc'.  Stop.

when I look in the build-mpfr directory there is only one file, the config.log but nothing else. What can I do to get a working cross-compiler? I am using cygwin by the way.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: MFPR doesn't install when building cross-compiler

Post by Combuster »

Is that the topmost error? I guess not.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
garob
Posts: 16
Joined: Wed Dec 30, 2009 3:26 am
Location: Melbourne, Australia

Re: MFPR doesn't install when building cross-compiler

Post by garob »

So I should go through the output for mfpr? Okay I'll do that tomorrow 'cos it's night time here but if anyone has had the same problem please help.
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: MFPR doesn't install when building cross-compiler

Post by xenos »

IIRC, MPFR usually recommends to run "make check" before installing. Perhaps it just doesn't install because the script invokes "make install" before "make check". You could try this line instead when building MPFR:

Code: Select all

make all check install
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

Re: MFPR doesn't install when building cross-compiler

Post by FlashBurn »

Ops, I created a thread in os dev with the same problem (http://forum.osdev.org/viewtopic.php?f=1&t=21852). MPFR has a problem with the built gmp.

Edit::

Seems I found a solution, call configure with "--with-gmp=/usr/local" (this is the dir where gmp copies the include and lib files to, if you haven´t changed it).
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: MFPR doesn't install when building cross-compiler

Post by Solar »

Two hints regarding this kind of error:
  • A shell script does not abort if one of the commands within fail. For example, the configure fails, but it still tries to run 'make' regardless. This can severely obfuscate error messages if you are unaware of this.
  • The output generated by a failed run of configure only tells half the story. Check the contents of the file ./config.log, looking for the error message you saw on the command line, and then stepping a few lines backwards to see what the test actually was, and how it failed exactly. This can give you some crucial additional information.
Every good solution is obvious once you've found it.
FlashBurn
Member
Member
Posts: 313
Joined: Fri Oct 20, 2006 10:14 am

Re: MFPR doesn't install when building cross-compiler

Post by FlashBurn »

Solar wrote: The output generated by a failed run of configure only tells half the story. Check the contents of the file ./config.log, looking for the error message you saw on the command line, and then stepping a few lines backwards to see what the test actually was, and how it failed exactly. This can give you some crucial additional information.
This is exact what I´ve done and so I found out that MPFR´s configure script couldn´t find libgmp (which was there), because gcc´s search path for libraries hasn´t included "/usr/local" and it seems you also couldn´t add it w/o telling it as parameter for it. I had to use the same for building MPC and GCC. But as I needn´t this before, there has something to be what changed.
Post Reply