I'm trying to build gcc-9.2.0 on a Ubuntu 18.04.4 LTS computer from source, with the compiler gcc-7.4.0 that was installed from the offical repo of Ubuntu.
I can NOT exactly distinguish the difference between the configuration option "--target", "--build", "--program-prefix" and "--host". Before starting, I run "gcc -v --version" of 7.4.0 compiler that come from the repo, and copy its configure args as my new build args, but I can not get the same names with the repo's ones. Mainly, I have no idea to get correct names of the target binaries and man page data files, no matter whatever I pass values combinations to above 4 parameters. I tried assign "x86_64-linux-gnu" to all of them, or only to single one, or two or three of them, but the names of final target binaries(and man data files) always are different from the ones come from the repo.
For example: If I use "--target=x86_64-linux-gnu" and "--program-prefix=x86_64-linux-gnu", I get a name "x86_64-linux-gnu-x86_64-linux-gnugcc-9" of gcc main program, while the offical ones is "x86_64-linux-gnu-gcc-7".
If I use "--program-prefix=x86_64-linux-gnu-" only, I get same result as above.
If I use "--target=x86_64-linux-gnu" only, the name of gcc main prog is same with the offical ones, but gcov/gcov-dump/gcov-tool lost their prefix "x86_64-linux-gnu".
I don't want to rename them one by one, because when the gcc-9.3/9.4 would come, I have to do same things again. further more, I want to reserve gcc-7.4.0 at same time, so it is hard to fingure out correct "update-alternatives" command, as there are too many links need to be fixed.
I want to learn more about "to build things by myself".
Is there any doc about the detail meaning of these options? I read the offical doc of gcc configuration, but merely few descriptions of them are there.
Thanks for any help or hint, and pls forgive my ugly English.