|
|
3.2. Special things you need to doSince you are going to substitute the basic library many programs rely on, you can imagine the problems that may occur. For me, it so happened that everything went fine until I typed in make install. At about halfway through the installation process I got an error telling me that rm was not able to run, and I found out that even all the common commands like cp, ls, mv, ln, tar, etc., did not work; all told me that they were not able to find parts of the library they needed. But there is help available. You can force the compilation of programs with the libraries compiled into them, so the programs do not need to look them up from the library. For that reason, in this chapter, we will compile all the utilities we need for the install into a static version. 3.2.1. Things you will definitely need3.2.1.1. The GNU-Binutils
If you run into trouble with the compilation of the binutils, referring to problems with gettext (indicated by errors like: "undeclared reference to lib_intl" or similar) please install the newest version, available from ftp.gnu.org/gnu/gettext. If this does not help, try disabling the native-language support by using:
You don't need to build a static version of the binutils, though it would not hurt, but I encountered many systems running with very old versions and ran into errors almost every time, so I think it is a good idea to mention them here. 3.2.1.2. GNU makeThe make command is responsible for the compiling of the sources, calling gcc and all the other programs needed for a compile. Since you may need to compile something if a problem occurs with the new glibc, it is a good idea to have it static, otherwise it might not work after an error appears.
Congratulations! You have compiled another static-linked program. 3.2.1.3. the GNU core-utilsThe core-utils are commands like: cp, rm, ln, mv, etc. In case of an error in the installation, these are an absolute requirement to help bring your system up again, so static binaries are really necessary here.
Now that the binaries of these very elementary tools are static, you can be sure they will work every time you need them. 3.2.1.4. GNU tarYou have already used GNU tar to unpack all the programs compiled and installed so far. But maybe you need to compile another program which is needed by glibc after you had a crash, and in this situation (I experienced this myself!) it is very useful to have a working tar ready to unpack the missing programs. With tar, we also need to take care of the bz2 compression algorithm, which is not included in the normal source distribution of tar.
If you experience problems with the execution of make, try to turn off native-language support (nls). You may achieve this by invoking configure with the option:
Note: In this new version of tar, you must use the -j switch to decompress .bzip2 files, so instead of
3.2.1.5. The Bash shellI prefer Bash as my shell; if you use a different one, please be sure you have installed a static version of it before you install glibc.
You now have installed a static version of Bash. For that reason, the binary is much bigger than usual, but it will run under all circumstances. If you prefer to use another shell, you are free to do so, but make sure it is a statically-linked version. Feel free to email me a method to build the shell of your choice in a static version, and chances are good that it will be implemented in the next revision of this document. 3.2.2. Software that may come in handy3.2.2.1. Midnight CommanderMidnight Commander is a very useful file manager, supporting many nice features like transparent decompression of packed files, built-in copy, move and other common commands, as well as an integrated editor. To compile this piece of software, you will need to have glib installed; in some distributions this is already the case. If you get an error in the make command saying that ld could not find glib, you will need to install this library first. You can get the sources from: ftp.gnome.org/pub/gnome/sources/glib/2.2/, and the installation is straight-forward. Here are the steps to build Midnight Commander:
|