bash 如何编译bash?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21644870/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to compile bash?
提问by username_4567
How to compile bash? I did small modifications to the code I got from http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz. I want to see those changes. Can anyone please point to me simple steps to compile bash?
如何编译bash?我对从http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz得到的代码做了一些小的修改。我想看到这些变化。任何人都可以指出我编译bash的简单步骤吗?
回答by Rahul R Dhobi
You can first run
你可以先运行
cd bash-4.2
./configure --prefix=/usr \
--bindir=/bin \
--htmldir=/usr/share/doc/bash-4.2 \
--without-bash-malloc \
--with-installed-readline
make
make install
Also refer http://www.linuxfromscratch.org/lfs/view/development/chapter06/bash.htmlfor more information
另请参阅http://www.linuxfromscratch.org/lfs/view/development/chapter06/bash.html了解更多信息
回答by Jayesh Bhoi
The simplest way to compile Bash is:
编译 Bash 的最简单方法是:
cd to the directory containing the source code and type ./configure'
to configure Bash for your system. If you're using csh on an old version of System V, you might need to type sh ./configure' instead to prevent csh from trying to execute configure itself.
Running configure takes some time. While running, it prints messages telling which features it is checking for.
cd 到包含源代码的目录并键入./configure'
为您的系统配置 Bash。如果您在旧版本的 System V 上使用 csh,您可能需要键入 sh ./configure' 以防止 csh 尝试执行 configure 本身。运行配置需要一些时间。在运行时,它会打印消息,告诉它正在检查哪些功能。
like
喜欢
/bash-4.2$ ./configure
Type `make' to compile Bash and build the bashbug bug reporting script.
输入`make' 来编译Bash 并构建bashbug 错误报告脚本。
/bash-4.2$ make
Optionally, type `make tests' to run the Bash test suite.
或者,键入“make tests”以运行 Bash 测试套件。
/bash-4.2$ make tests
Type `make install' to install bash and bashbug. This will also install the manual pages and Info file.
输入“make install”来安装 bash 和 bashbug。这还将安装手册页和信息文件。
/bash-4.2$ make install
The configure shell script attempts to guess correct values for various system-dependent variables used during compilation.
configure shell 脚本尝试为编译期间使用的各种系统相关变量猜测正确的值。