Configuring and compiling the GNU C Library
The GNU C Library cannot be compiled in the source directory. You must build it in a separate build directory. For example, if you have unpacked the GNU C Library sources in '/src/gnu/glibc-VERSION', create a directory '/src/gnu/glibc-build' to put the object files in. This allows removing the whole build directory in case an error occurs, which is the safest way to get a fresh start and should always be done.
From your object directory, run the shell script 'configure' located at the top level of the source tree. In the scenario above, you'd type
$ ../glibc-VERSION/configure ARGS...
Please note that even though you're building in a separate build directory, the compilation may need to create or modify files and directories in the source directory.
'configure' takes many options, but the only one that is usually mandatory is '--prefix'. This option tells 'configure' where you want the GNU C Library installed. This defaults to '/usr/local', but the normal setting to install as the standard system library is '--prefix=/usr' for GNU/Linux systems and '--prefix=' (an empty prefix) for GNU/Hurd systems.
所以,我认为我做得很正确,但它仍然给我一个关于在不同目录中构建的错误:
james@clr ~/Downloads/glibc $ ./configure --prefix=/home/james/Downloads/glibc-build/
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for readelf... readelf
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether g++ can link programs... yes
configure: error: you must configure in a separate build directory