Why is the "--with-mpfr-include" flag used in CLFS necessary?
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why is the "--with-mpfr-include" flag used in CLFS necessary?
Hello,
I've read both of the LFS and CLFS books and I have a question regarding the different procedures used in the two books when building the GCC compiler.
In the both the LFS & CLFS books, the "mpfr", "gmp", and "mpc" packages are extracted into the GCC source directory. However, the CLFS book specifies the "--with-mpfr-include=$(pwd)/../gcc-x.y.z/mpfr/src" option when configuring GCC, while the LFS book didn't use this option at all. Why is this option necessary? I thought that the GCC build system will automatically build gmp, mpfr, and mpc if they are present inside the source directory. And, if for some reason the location of mpfr needs to be specified manually in CLFS, why is there no need to specify the location of mpc and gmp?
They put a lot of work into CLFS to get it going and have the procedure down fairly well. The book usually explains the options in detail. What does the explanation say?
CLFS is radically different because LFS can rely on your local stuff in /usr/include, /usr/lib, etc. CLFS is different because /usr/include and /usr/lib are hostile territory, and you have to exclude them at any cost. Think of the situation where you're using an (x86-64) gcc-arm and compiling for arm64. Very different machines that have to be totally separate. They've probably learned the hard way. Disobey them, and you can learn the hard way too
Hello,
Regarding the "--with-mpfr-include" option, the CLFS book just said that it "Tells configure how to find the mpfr headers". I'm using the CLFS book from here. In the book they are using GCC-6.2.0
I mean, if the mpfr paths were explicitly specified to avoid contamination from the host, then shouldn't the paths to mpc and gmp be specified as well?
That is a generic book. You no doubt have seen the abbreviation FBBG. It means "Follow Book, Book Good." Your build is raising questions in your head. That's good. The time to post here is when you follow the book and it doesn't work. It prtobably hasd to do with what they're installing, as the source will get deleted later.
Ok thanks. I have a few other questions related to the general build process of LFS. Should I post them in this forum? They aren't related to any specific problems that I encountered while following the book, just about how the build process works.
Ok thanks. I have a few other questions related to the general build process of LFS. Should I post them in this forum? They aren't related to any specific problems that I encountered while following the book, just about how the build process works.
Ok thanks. I have a few other questions related to the general build process of LFS. Should I post them in this forum? They aren't related to any specific problems that I encountered while following the book, just about how the build process works.
If you want to build GCC but do not have the GMP library, the MPFR library and/or the MPC library installed in a standard location and do not have their sources present in the GCC source tree then you can explicitly specify the directory where they are installed (‘--with-gmp=gmpinstalldir’, ‘--with-mpfr=mpfrinstalldir’, ‘--with-mpc=mpcinstalldir’). The --with-gmp=gmpinstalldir option is shorthand for --with-gmp-lib=gmpinstalldir/lib and --with-gmp-include=gmpinstalldir/include. Likewise the --with-mpfr=mpfrinstalldir option is shorthand for --with-mpfr-lib=mpfrinstalldir/lib and --with-mpfr-include=mpfrinstalldir/include, also the --with-mpc=mpcinstalldir option is shorthand for --with-mpc-lib=mpcinstalldir/lib and --with-mpc-include=mpcinstalldir/include. If these shorthand assumptions are not correct, you can use the explicit include and lib options directly. You might also need to ensure the shared libraries can be found by the dynamic linker when building and using GCC, for example by setting the runtime shared library path variable (LD_LIBRARY_PATH on GNU/Linux and Solaris systems).
These flags are applicable to the host platform only. When building a cross compiler, they will not be used to configure target libraries.
Since the CLFS/LFS books unpacked the mpfr/mpc/gmp packages into GCC's source tree, I guess that we can say the "--with-mpfr-include" flags used in the CLFS book isn't strictly needed? What's your view on this?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.