简体   繁体   English

使用自动工具针对MIPS目标交叉编译yuma123

[英]cross-compile yuma123 using autotools for a MIPS target

I'm trying to cross-compile the yuma123 open source package on a Ubuntu 18.04 development system to a MIPS target, where yuma123 uses Autotools and shared libraries. 我正在尝试将Ubuntu 18.04开发系统上的yuma123开源软件包交叉编译为MIPS目标,其中yuma123使用自动工具和共享库。

I am using a directory INSTALL_PREFIX=/tmp/yuma123 as a staging area for files to be copied to the MIPS target. 我正在使用目录INSTALL_PREFIX=/tmp/yuma123作为将文件复制到MIPS目标的暂存区。

The code (cross-)compiles and links without any errors using: 使用以下代码(交叉)编译和链接没有任何错误:

autoreconf -i -f
./configure ...
make

However, how do I install to $INSTALL_PREFIX ? 但是,如何安装到$INSTALL_PREFIX

Should I specify some --prefix= options to ./configure as follows: 我应该为./configure指定一些--prefix=选项,如下所示:

./configure \
    --target=mipsel-buildroot-linux-gnu \
    --host=mipsel-buildroot-linux-gnu \
    --build=x86_64-unknown-linux-gnu \
    --prefix=$INSTALL_PREFIX/usr \
    --sysconfdir=$INSTALL_PREFIX/etc \
    --localstatedir=$LOCALSTATEDIR \
    --program-prefix=""

or should I specify DESTDIR= when I sudo make install as follows: 还是在我按如下方式sudo make install时指定DESTDIR=

sudo make DESTDIR=$INSTALL_PREFIX install

What do I need to set above to ensure that libtool handles the $INSTALL_PREFIX directory correctly for shared libraries when cross-compiling in this way? 我需要在上面进行哪些设置,以确保以这种方式交叉编译时, libtool为共享库正确处理$INSTALL_PREFIX目录?

However, how do I install to $INSTALL_PREFIX ? 但是,如何安装到$INSTALL_PREFIX

Should I specify some --prefix= options to ./configure 我应该为./configure指定一些--prefix=选项./configure

[...] [...]

or should I specify DESTDIR= when I sudo make install [?] 还是在我sudo make install [?]时指定DESTDIR=

You should use DESTDIR for your use case, although in practice, it's possible that you could get away with using --prefix . 应该在用例中使用DESTDIR ,尽管实际上,使用--prefix还是有可能的。

The --prefix option conveys the prefix of the intended permanent installation location to the Autotools. --prefix选项将预期的永久安装位置的前缀传达给Autotools。 Under some circumstances, this path or paths derived from it may end up being incorporated into the built binaries (RPATHs, config-file locations, etc .) or into built documentation. 在某些情况下,此路径或从其派生的路径可能最终被合并到内置二进制文件(RPATH,配置文件位置 )或内置文档中。 This is especially true if you're using libtool. 如果您使用的是libtool,则尤其如此。 That's obviously undesirable if the prefix is not reflective of where you intend the files actually to live on the target system. 如果前缀不能反映文件在目标系统上实际驻留的位置,则这显然是不可取的。

DESTDIR , on the other hand, is for exactly the purpose you describe: installing into a into a staging area or an alternative root. DESTDIR ,在另一方面,是正是您所描述的目的:在安装到到一个临时区域或备用根。 This is what package builders generally use, for example, though I suspect that the alternative root angle was the one that originally inspired the facility. 例如,这就是包装制造商通常使用的,尽管我怀疑替代的根角是最初启发该设施的那个。 Note, too, that if you're installing to a staging area then you probably don't need to use sudo to make install . 还要注意,如果要安装到暂存区,则可能不需要使用sudo make install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM