本文介绍了交叉编译:如何使用一个前缀进行安装,以及如何使用不同的前缀进行部署?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为某些体系结构交叉编译某些应用程序。

I'm trying to cross-compile some applications for an alternative architecture.

我的典型过程如下:


  1. 下载源代码并将其解压缩到/ var / source

  2. 。/configure --prefix = / var / install CC = [my-cross-编译器gcc]

  3. make

  4. 进行安装

  1. Download and untar source into /var/source
  2. ./configure --prefix=/var/install CC=[my-cross-compiler-gcc]
  3. make
  4. make install

这可以按预期工作:我的应用程序安装在/ var / install中。

This works as expected: My application is installed into /var/install.

但是,当我将此应用程序部署到替代体系结构时,我并不需要它部署在/ var / install中。我只是希望将其正常安装在/中。

However, when I deploy this application onto my alternative architecture, I don't want it deployed in /var/install. I just want it installed in / as normal.

我可以将其复制到/中,但是应用程序本身仍在尝试在/ var / install中查找各种默认设置。

I can copy it into /, however the application itself is still trying to look inside /var/install for various default settings.

我想在x86系统上编译并安装软件,但是当我将其部署在替代体系结构上时,我希望它就像我已经安装了它一样。

I want to compile and install the software on my x86 system, but when I deploy it on the alternative architecture, I want it to be as if I had installed it into /, not in /var/install.

有没有一种方法可以完成我想做的事情?

Is there a way to accomplish what I'm trying to do?

推荐答案

如果我理解正确,则x86系统上的 / var / install 将是 / 替代架构。
要解决您的问题,您需要修改以下步骤:

If I understand correctly, /var/install on your x86 system will be / on your alternative architecture.To solve your issue, you need to modify the following step:


  • 配置肯定会在文件中做一些修改,因此您需要指定最终位置

  • configure will certainly do some sed in file, so you need to specify the final place

。/configure --prefix = / CC = [my-cross-compiler-gcc]

makefile支持变量DESTDIR,该变量位于安装路径之前:

makefile generated by automake have support of variable DESTDIR which is prepended to the installation path:

make DESTDIR = / var / install install

这篇关于交叉编译:如何使用一个前缀进行安装,以及如何使用不同的前缀进行部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 04:27