编译GCC并安装到DESTDIR

发布于 2024-12-20 18:51:47 字数 314 浏览 2 评论 0原文

我正在尝试将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柠栀 2024-12-27 18:51:47

您应该运行(在源树之外的新构建树中)

/your/source/path/to/gcc/configure --target=i686-pc-linux-gnu --prefix=/my/custom/path/gcc ...

,然后 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>,您可以在构建树中运行

make install DESTDIR=/tmp/mygccinst/

,最后,您可以使用类似的内容复制最终文件

cp -va /tmp/mygccinst/ /

您可能需要以 root 身份运行此副本...

PS 安装前缀内置于 gcc 驱动程序二进制文件,实际运行 cc1 或cc1plus 等等...

You should run (in a new build tree outside of the source tree)

/your/source/path/to/gcc/configure --target=i686-pc-linux-gnu --prefix=/my/custom/path/gcc ...

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 etc

I 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 tree

make install DESTDIR=/tmp/mygccinst/

and finally, you can copy the definitive files with something like

cp -va /tmp/mygccinst/ /

You may need to run this copy as root...

PS the installation prefix is built-in the gcc driver binary, which actually runs cc1 or cc1plus etc...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文