Cross-compile: How to install with one prefix, and deploy with a different prefix?

后端 未结 2 1955
一整个雨季
一整个雨季 2021-02-14 00:47

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

My typical procedure is as follows:

  1. Download and untar source into /var/sou
相关标签:
2条回答
  • 2021-02-14 01:34

    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 generated by automake have support of variable DESTDIR which is prepended to the installation path:

      make DESTDIR=/var/install install

    0 讨论(0)
  • 2021-02-14 01:36

    I had a similar problem, but I was cross-compiling and wanted to install to the root directory of my device. In this case I specified:

    make install DESTDIR=<path/to/rootfs>
    
    0 讨论(0)
提交回复
热议问题