1.下载源码
https://code.videolan.org/videolan/x264
在windows下解压;复制到ubuntu;
2.进入源码文件夹-新建脚本文件
touch sp_run.sh
3.在sp_run.sh文件中输入
#!/bin/sh./configure --prefix=/home/alientek/sp_test/x264/sp_install --enable-shared --enable-static --cross-prefix=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- --host=arm-linux --disable-opencl --enable-pic --disable-asm
1)prefix:安装位置;
2)--cross-prefix=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf :交叉编译器的位置
3)备注:如何查找交叉编译器位置
arm-linux-gnueabihf-gcc -v
会显示:
如图所示:
/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf
打印环境变量:
echo $PATH
显示:
/home/Laser/bin:/home/Laser/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin
4.运行脚本文件
./sp_run.sh
./version.sh
5.编译执行
MakeMake install