编译GCC并安装到DESTDIR
我正在尝试将 GCC 安装到 /my/custom/path/gcc
中,
但由于某种原因它安装到正常的安装路径中。
我正在使用的命令:
configure --target=i686-pc-linux-gnu --disable-nls --enable-languages=c,c++ --without-headers
make DESTDIR=/my/custom/path/gcc
make DESTDIR=/my/custom/path/gcc install
我做错了什么?
I'm trying to install GCC into /my/custom/path/gcc
but for some reason it installs into the normal installation path.
the commands i'm using:
configure --target=i686-pc-linux-gnu --disable-nls --enable-languages=c,c++ --without-headers
make DESTDIR=/my/custom/path/gcc
make DESTDIR=/my/custom/path/gcc install
What am I doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该运行(在源树之外的新构建树中)
,然后 GCC 将安装在
/my/custom/path/gcc/bin/
中,包含文件位于/my/ 中custom/path/gcc/include/
、/my/custom/path/gcc/lib/
中的库等我建议使用
/opt/
或 < code>$HOME/pub 作为您的前缀,您也可能是对--program-suffix=-foo
选项感兴趣(在源树之外的全新构建树中执行此操作;您之前的构建树已腐烂)
在使用
make
成功编译后code>,您可以在构建树中运行,最后,您可以使用类似的内容复制最终文件
您可能需要以 root 身份运行此副本...
PS 安装前缀内置于
gcc
驱动程序二进制文件,实际运行 cc1 或cc1plus
等等...You should run (in a new build tree outside of the source tree)
and then GCC will become installed in
/my/custom/path/gcc/bin/
with include files in/my/custom/path/gcc/include/
, libraries in/my/custom/path/gcc/lib/
etc etcI suggest using
/opt/
or$HOME/pub
as your prefix and you might also be interested by the--program-suffix=-foo
option(do that in a fresh new build tree outside of the source tree; your previous one is rotten)
After successive compilation with
make
, you can run in your build treeand finally, you can copy the definitive files with something like
You may need to run this copy as root...
PS the installation prefix is built-in the
gcc
driver binary, which actually runscc1
orcc1plus
etc...