如何使用“前缀”构建到指定目录中?配置选项? [英] How do I build into a specified directory using the "prefix" option of configure?

查看:143
本文介绍了如何使用“前缀”构建到指定目录中?配置选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Clear Linux上构建glibc 2.27,可在此处获得: https:/ /www.gnu.org/software/libc/sources.html

I am trying to build glibc 2.27 on Clear Linux, obtained here: https://www.gnu.org/software/libc/sources.html

根据帮助,我应该使用以下命令将其构建到源文件夹之外的目录中prefix命令。据我所知,我正在按照安装帮助中的说明进行操作:

According to the help, I should build into a directory outside of the source folder using the prefix command. As far as I can tell, I am doing what is described in the installation help:


配置和编译GNU C库



不能在源目录中编译GNU C库。您
必须将其构建在单独的构建目录中。例如,如果您将
的GNU C库源文件解压到'/ src / gnu / glibc-VERSION'中,请创建
a目录'/ src / gnu / glibc-build'将目标文件放入。
允许在发生错误的情况下删除整个构建目录,
是重新开始的最安全方法,应始终执行

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.

在您的对象目录中,运行位于源树顶层的shell脚本'configure'
。在上述情况下,您要输入

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...

请注意,即使您在单独的build
目录中进行编译,可能需要在源目录中创建或修改文件和
目录。

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'需要很多选择,但唯一的选择通常是
必填项是'--prefix'。此选项告诉配置您要在何处
安装GNU C库。默认为'/ usr / local',但是作为标准系统库安装的
常规设置为
'--prefix = / usr'对于GNU / Linux系统和'--prefix =' (空的
前缀)用于GNU / Hurd系统。

'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.

所以,我认为我做得正确,但是仍然给我关于在不同目录中构建的错误:

so, I thought I was doing this correctly, but it still gave me an error about building in a different directory:

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


推荐答案

您必须创建一个构建目录并从中运行 configure 脚本。您的案例:

You have to create a build-directory and run configure script from it. Your case:

mkdir /home/james/Downloads/glibc-build/
cd /home/james/Downloads/glibc-build/
~/Downloads/glibc/configure

The -prefix 选项将更改安装目录(进行安装)。

The --prefix option will change the install directory (make install).

这篇关于如何使用“前缀”构建到指定目录中?配置选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆