alsa-util 1.1.0 arm 交叉编译问题

alsa-util 1.1.0 arm cross compile issue

我正在尝试为 arm-linux 平台构建 alsa-util-1.1.0,通过反复试验,我使用这些命令成功编译了 alsa-lib 和 alsa-util:

alsa-lib:

CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux -prefix=/home/username/20160311_alsa_work/alsa/install --disable-python

alsa-util:

CC=arm-linux-gnueabihf-gcc ./configure --prefix=/home/username/20160311_alsa_work/alsa/install --host=arm-linux --with-alsa-inc-prefix=/home/username/20160311_alsa_work/alsa/install/include --with-alsa-prefix=/home/username/20160311_alsa_work/alsa/install/lib --disable-alsamixer --disable-xmlto --disable-nls --disable-bat --with-udev-rules-dir=/home/username/20160311_alsa_work/alsa/install/lib/udev --with-asound-state-dir=/home/username/20160311_alsa_work/alsa/install/var/lib/alsa --disable-alsaconf

这与本指南非常相似:Alsa audio cross compile and use

编译似乎没问题,make install 将所有内容都放在正确的文件夹中。然后我将所有库和容器复制到我的目标 rootfs 并尝试执行 arecord -l

arecord 的输出是:

**** List of CAPTURE Hardware Devices **** ALSA lib conf.c:3750:(snd_config_update_r) Cannot access file /home/username/20160311_alsa_work/alsa/install/share/alsa/alsa.conf ALSA lib control.c:954:(snd_ctl_open_noupdate) Invalid CTL hw:0 arecord: device_list:277: control open (0): No such file or directory

我的配置选项显然有问题,但我看不到任何其他更改它们的方法...有什么想法吗???

我需要为我的 arm-linux 目标交叉编译并安装到目标的 rootfs,但所有路径都与 rootfs 的根目录相关,而不是仅用于构建的前缀。

相关信息: 我使用 --with-udev-rules-dir=--with-asound-state-dir= 选项,否则安装会尝试将文件复制到我的构建机器目录中。

--prefix 必须是在 target 设备上看到的路径。

要将文件安装到 主机 上的不同路径,请使用 DESTDIR:

make install DESTDIR=/home/me/whatever

我可以在启用alsamixer的情况下进行交叉编译,当然需要在sysroot中安装ncursesw。 如果有任何用处,这是我的配置标志

-exec-prefix=/usr --datarootdir=/usr/share --includedir=${DIR_DIST}/targetfs/usr/include --with-alsa-prefix=${DIR_DIST}/targetfs/usr/lib --with-alsa-inc-prefix=${DIR_DIST}/targetfs/usr/include