如何为 Arm/Raspberry Pi 交叉编译 libsndfile [英] How do I cross-compile libsndfile for Arm/Raspberry Pi

查看:26
本文介绍了如何为 Arm/Raspberry Pi 交叉编译 libsndfile的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让一个在 Linux 下运行的交叉编译器(Debian 挤压 amd64)但我似乎无法将我的文件与已安装的 libsndfile 链接,我假设我需要交叉编译源以针对 Raspberry-Pi 并链接到该版本.但是我似乎找不到关于执行 ./configuremake 阶段以编译到目标的直接说明.

I'm trying to get a working cross-compiler running under Linux (Debian squeeze amd64) but I can't seem to link my files with the installed libsndfile, I'm assuming I need to cross-compile the source to target the Raspberry-Pi and link to that version. But I can't seem to find straightforward instructions on doing the ./configure and make stage to compile to the target.

注意:我按照以下步骤操作:如何构建 GCC 4.7 工具链以进行跨平台编译? 以构建交叉编译器并使用 Eclipse.

Note: I followed these steps: How do I build a GCC 4.7 toolchain for cross-compiling? to get the cross compiler built and using Eclipse.

推荐答案

好吧,您想做的事情在 Eclipse 中可能无法做到.

Ok, what you want to do is something which you probably cannot do within Eclipse.

相反,您需要一个终端(例如 xterm 或 gnome-terminal).您需要使用以下内容运行配置脚本:

Instead you need a terminal (eg xterm or gnome-terminal). The you need to run the configure script with something along the lines of:

./configure --prefix=$HOME/Arm --build=i386-linux --host=arm-unknown-linux-gnueabi

观察配置输出以确保配置脚本选择正确的编译器,然后执行:

Watch the configure output to make sure that the configure script picks up the correct compiler and then do:

make &&进行安装

然后,当您想要构建链接 Arm 二进制文件的其他内容时,请确保它们从 $HOME/Arm/include 获取标头并链接到 $HOME/中的库Arm/lib.

When you then want to build something else that links against the Arm binaries, make sure they get the headers from $HOME/Arm/include and link against the library in $HOME/Arm/lib.

您应该能够在网上找到大量有关使用 autoconf 生成的配置脚本的交叉编译内容的文档.

You should be able to find lots of documentation about cross compiling stuff that uses autoconf generated configure scripts on the net.

这篇关于如何为 Arm/Raspberry Pi 交叉编译 libsndfile的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆