Hello Yi,
- First, you should create build directories for all components.
(Jonathan explained this.)
- I would recommend you put the commands to do the configure in
scripting files, for
repeatability.
- Then, if you encounter errors, you need to find the "config.log" files
that contains
the relevant information.
- I mean with that, during the build, it writes quite some config.log
files, you find mine below.
One of these contain statements it finished in error. You need to
find it, try to understand
why it failed, and if you need help, post it here.
Best Regards,
Henri
du -a | grep config | grep log
32 ./config.log
36 ./intl/config.log
132 ./build-x86_64-pc-linux-gnu/libiberty/config.log
40 ./build-x86_64-pc-linux-gnu/fixincludes/config.log
64 ./build-x86_64-pc-linux-gnu/libcpp/config.log
32 ./lto-plugin/config.log
132 ./libiberty/config.log
24 ./zlib/config.log
48 ./libbacktrace/config.log
28 ./libdecnumber/config.log
40 ./fixincludes/config.log
64 ./libcpp/config.log
248 ./gcc/config.log
On 03/06/2020 01:51 PM, yilu@xxxxxxxxxxx wrote:
Oh...I'm so sorry. I've read these guides but I miss that I should go into the objdir to configure. Thanks!
This time I got into the objdir and use:
`./../gcc/configure --prefix=/usr/local/gcc --enable-languages=all --disable-multilib --disable-bootstrap`
and I found the Makefile in my objdir directory. I try `make -j4` and found
g++: error: gengtype-lex.c: No such file or directory
g++: fatal error: no input files
Could you help me with this?
Beenle Yi
yilu@xxxxxxxxxxx
From: Jonathan Wakely
Date: 2020-03-06 20:08
To: yilu@xxxxxxxxxxx
CC: gcc-help
Subject: Re: Install gcc
On Fri, 6 Mar 2020 at 11:49, yilu@xxxxxxxxxxx <yilu@xxxxxxxxxxx> wrote:
Hi, everybody.
I'm trying install gcc, with command:
./gcc/configure --prefix=/gccobj --disable-checking --enable-languages=all --disable-multilib --disable-bootstrap --with-gmp=/gmp --with-mpfr==/mpfr --with-mpc==/mpc
This is a really really bad idea. The build will create a
sub-directory called 'gcc' which is the directory where you have the
source tree.
https://gcc.gnu.org/install/configure.html says
"First, we **highly** recommend that GCC be built into a separate
directory from the sources which does **not** reside within the source
tree."
(I've installed mpfr,mpc,gmp in the corresponding directory)
My recommendation is that you don't do that either.
See https://gcc.gnu.org/wiki/InstallingGCC
and I got this two information after a lot of checkings:
configure: creating ./config.status
config.status: creating Makefile
and then I try the command
make -j4
and I got
make[1]: Leaving directory '/root'
Makefile:959: recipe for target 'all' failed
make: *** [all] Error 2
This is completely usleless information. The error happened much
earlier but you've just shown the very end of the output which says
"there was an error">
I searched for FAQ, but cannot find an approach. What can I do in this situation?
See https://gcc.gnu.org/wiki/InstallingGCC