alsa-lib&alsa-utils移植到arm的脚本

搞过系统的人应该知道framework和driver之间有一层lib,下面就讲一下音频框架中对应的lib库和一些工具alsa-lib&alsa-utils。

alsa-lib for arm:


 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#!/bin/bash
echo "Building alsa library for arm platform..."
# building shared library
CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux-gnueabi --target=arm-linux --prefix=/home/larkin/audio/alsa-lib/out/arm/alsa-lib/ --with-alsa-devdir=/dev/snd --enable-static=no --enable-shared=yes --disable-python --with-configdir=/home/larkin/audio/alsa-lib/out/arm/alsa-config --with-plugindir=/home/larkin/audio/alsa-lib/out/arm/alsa-plugin CFLAGS="-fPIC";
if [ $? -ne 0 ]; then
 echo "Configure alsa-lib shared library failed..."
 exit 1
fi
make clean; make;
if [ $? -ne 0 ]; then
 echo "Build shared alsa-lib failed..."
 exit 2
fi
make install;
# building static library
CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux-gnueabi --target=arm-linux --prefix=/home/linux/workplace/share/tmp/alsa-lib --with-alsa-devdir=/dev/snd --enable-static=yes --enable-shared=no --disable-python --with-configdir=/home/linux/workplace/share/tmp/alsa-config --with-plugindir=/home/linux/workplace/share/tmp/alsa-plugin;
if [ $? -ne 0 ]; then
 echo "Configure alsa-lib static library failed..."
 exit 3
fi
make clean; make;
if [ $? -ne 0 ]; then
 echo "Build static alsa-lib failed..."
 exit 4
fi
make install;
echo "The arm alsa-lib build process is finished successfully."
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
alsa-lib for pc:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#!/bin/bash
echo "Building alsa library for x86 platform..."
# building shared library
CC=gcc ./configure --prefix=/home/larkin/audio/alsa-lib/out/pc/alsa-lib/ --with-alsa-devdir=/dev/snd --enable-static=no --enable-shared=yes --disable-python --with-configdir=/home/larkin/audio/alsa-lib/out/pc/alsa-config --with-plugindir=/home/larkin/audio/alsa-lib/out/pc/alsa-plugin CFLAGS="-fPIC";
if [ $? -ne 0 ]; then
 echo "Configure alsa-lib shared library failed..."
 exit 1
fi
make clean; make;
if [ $? -ne 0 ]; then
 echo "Build shared alsa-lib failed..."
 exit 2
fi
make install;
# building static library
CC=gcc ./configure --prefix=/home/larkin/audio/alsa-lib/out/pc/alsa-lib/ --with-alsa-devdir=/dev/snd --enable-static=yes --enable-shared=no --disable-python --with-configdir=/home/larkin/audio/alsa-lib/out/pc/alsa-config --with-plugindir=/home/larkin/audio/alsa-lib/out/pc/alsa-plugin;
if [ $? -ne 0 ]; then
 echo "Configure alsa-lib static library failed..."
 exit 3
fi
make clean; make;
if [ $? -ne 0 ]; then
 echo "Build static alsa-lib failed..."
 exit 4
fi
make install;
cd ./test;
# build alsa-lib pcm test code
gcc pcm_min.c -I/home/larkin/audio/alsa-lib/out/pc/alsa-lib/include/ -L/home/huangc/audio/alsa-lib/out/pc/alsa-lib/lib/ -lasound -lpthread -lrt -lm -ldl -o pcm_min;
if [ $? -ne 0 ]; then
 echo "Build pcm_min.c failed..."
 exit 5
fi
gcc pcm.c -I/home/larkin/audio/alsa-lib/out/pc/alsa-lib/include/ -L/home/huangc/audio/alsa-lib/out/pc/alsa-lib/lib/ -lasound -lpthread -lrt -lm -ldl -o pcm;
if [ $? -ne 0 ]; then
 echo "Build pcm.c failed..."
 exit 5
fi
# list the output files
ls -l pcm pcm_min ../out/pc/alsa-lib/lib/*;
cd ..;
echo "The x86 alsa-lib build process is finished successfully."
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
alsa-utils:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
/* alsa-utils build for arm platform*/
CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux-gnueabihf --target=arm-linux --prefix=/home/linux/workplace/share/foxp/ CFLAGS="-I/home/linux/workplace/share/tmp/alsa-lib/out/arm/alsa-lib/include -lpthread -fPIC" LDFLAGS="-L/home/linux/workplace/share/tmp/alsa-lib/out/arm/alsa-lib/lib" LIBS="-lasound" --disable-alsamixer --disable-xmlto; make clean; make; sudo make install;
/* alsa-utils aplay */
root@:/home/larkin/alsa/alsa-utils/amixer# arm-linux-gnueabihf-gcc aplay.c -I/home/larkin/alsa/alsa-lib/build/include -I/home/larkin/alsa/alsa-utils/include -L/home/larkin/alsa/alsa-lib/build/lib -lasound -lrt -ldl -lm -lpthread -static -o aplays
/* alsa-utils amixer */
root@:/home/larkin/alsa/alsa-lib/build/share/alsa# arm-linux-gnueabihf-gcc amixer.c volume_mapping.c -I/home/larkin/alsa/alsa-lib/build/include -I/home/larkin/alsa/alsa-utils/include -L/home/larkin/alsa/alsa-lib/build/lib -lasound -lrt -ldl -lm -lpthread -static -o amixers
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值