AC8257 ubuntu16.04 android9.0 编译环境搭建--安装编译环境
首先参考MT6735的编译环境安装,毕竟ATC的代码基于MTK的代码基础上修改的,参考:
https://blog.csdn.net/gjy_it/article/details/79524561
安装samba ssh请参考:
ubuntu14.04 AndroidM编译环境搭建
安装编译环境并编译:
1、安装依赖包:
ubuntu12.04(没验证过):
sudo apt-get install git-core gnupg flex bison ccache gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev gcc-4.4 g++-4.4 g++-4.4-multilib g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc wine
ubuntu14.04(验证过OK):
使用:ubuntu-14.04-desktop-amd64.iso
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gccmultilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32zdev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip libswitch-perl
ubuntu16.04(同freescale依赖一起安装验证OK)
使用这个版本:ubuntu-16.04.6-desktop-amd64.iso
sudo apt-get install git-core gnupg flex bison ccache gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z1-dev libgl1-mesa-dev g++-multilib g++-4.8-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libc6-dev-i386 lib32z1 lib32ncurses5 lib32bz2-1.0 lib32readline-gplv2-dev gawk libswitch-perl
freescale平台的ubuntu16.04编译android9.0依赖的库:
$ sudo apt-get install gnupg
$ sudo apt-get install flex
$ sudo apt-get install bison
$ sudo apt-get install gperf
$ sudo apt-get install build-essential
$ sudo apt-get install zip
$ sudo apt-get install zlib1g-dev
$ sudo apt-getinstall libc6-dev
$ sudo apt-getinstall lib32ncurses5-dev
$ sudo apt-get install x11proto-core-dev
$ sudo apt-get install libx11-dev
$ sudo apt-get install libgl1-mesa-dev
$ sudo apt-get install libgl1-mesa-dev
$ sudo apt-get install tofrodos
$ sudo apt -get install python-markdown
$ sudo apt-get install libxml2-utils
$ sudo apt-get install xsltproc
$ sudo apt-get install uuid-dev:i386 liblzo2-dev:i386
$ sudo apt-get install gcc-multilib g ++-multilib
$ sudo apt-get install subversion
$ sudo apt-get install openssh-server openssh-client
$ sudo apt-get install uuid uuid-dev
$ sudo apt-get install zlib1g-dev liblz-dev
$ sudo apt-get install liblzo2-2 liblzo2-dev
$ sudo apt-get install lzop
$ sudo apt-get install git-core curl
$ sudo apt-get install u-boot-tools
$ sudo apt-get install mtd-utils
$ sudo apt-get install android-tools-fsutils
$ sudo apt-get install device -tree-compiler
$ sudo apt-get install gdisk
$ sudo apt-get install liblz4-tool
$ sudo apt-get install m4
$ sudo apt-get install libz-dev
经过验证ubuntu16.04安装的依赖包是可用。安装依赖包的时候一次安装ubuntu16.04和freescale提供的依赖包之后即可编译通过。
2、设置jdk路径:
请下载:csdn我的资源包中: repo&&JDK8.zip
将bin.tar.gz减压到~/ 目录,将jvm.tar.gz减压到 ~/bin 目录中,如下:
tar -xvf bin.tar.gz -C ~/
tar -xvf jvm.tar.gz -C ~/bin/
设置JDK8环境变量:
vim ~/.bashrc 添加:
export PATH=~/bin/repo:$PATH
export JAVA_HOME=~/bin/jvm/java-8-openjdk-amd64
export ANDROID_JAVA_HOME=$JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
保存,执行 source .bashrc导入jdk环境,然后执行java -version查看jdk是否配置成功,如下:
说明配置成功了。
3、下载代码并编译
因小米笔记本配置只有i5的cpu,只有8核。编译时指定线程时不要过大,否则会提示out of memory
开通代码下载权限后:
git clone http://192.168.1.28/autocgip/ac8257.git //内网不用端口号
git clone http://192.168.1.28:8080/autocgip/ac8257.git //外网需要端口号
执行:
source build/envsetup.sh
lunch full_ac8257_demo-userdebug
make j8 2>&1 | tee build_ac8257.log //注意要这样执行,否则编译错误没法知道是什么原因,需要将编译日志保存起来
在编译导入环境变量时如果没有build/envsetup.sh,需要进行以下执行以下脚本releaseAc8257.sh建立软链接,如下内容:
build/envsetup.sh文件内容:
BUILD_TODIR=$PWD
#
export BUILD_TODIR
echo $BUILD_TOPDIR
if [ ! -f "$BUILD_TODIR/allmake.sh" ];then
ln -s $BUILD_TODIR/build/make/tools/allmake.sh $BUILD_TODIR/allmake.sh
ln -s $BUILD_TODIR/build/soong/root.bp $BUILD_TODIR/Android.bp
ln -s $BUILD_TODIR/build/soong/bootstrap.bash $BUILD_TODIR/bootstrap.bash
ln -s $BUILD_TODIR/build/make/buildspec.mk.default $BUILD_TODIR/build/buildspec.mk.default
ln -s $BUILD_TODIR/build/make/CleanSpec.mk $BUILD_TODIR/build/CleanSpec.mk
ln -s $BUILD_TODIR/build/make/core $BUILD_TODIR/build/core
ln -s $BUILD_TODIR/build/make/envsetup.sh $BUILD_TODIR/build/envsetup.sh
ln -s $BUILD_TODIR/build/make/target $BUILD_TODIR/build/target
ln -s $BUILD_TODIR/build/make/tools $BUILD_TODIR/build/tools
fi
source build/envsetup.sh
lunch full_ac8257_demo-userdebug
make -j8 2>&1 | tee build_ac8257.log
编译完成后使用flashtool_xxx_xx.exe工具下载即可。
本文地址:https://blog.csdn.net/jinron10/article/details/110651779
上一篇: C++学习之移动语义与智能指针详解
下一篇: 中国IDC市场——疫情下暗藏转型新动力
推荐阅读
-
在Mac OS上编译安装Nginx+PHP+MariaDB开发环境的教程
-
在Mac上编译安装PHP7的开发环境
-
ubuntu 12.10 上 android 编译环境搭建的深入解析
-
CentOS 7.x编译安装Nginx1.10.3+MySQL5.7.16+PHP5.2 5.3 5.4 5.5 5.6 7.0 7.1多版本全能环境
-
搭建Android开发环境 以及 ionic 编译安卓app步骤
-
详解Lamp环境搭建Linux CentOS6.5编译安装mysql5.6
-
在lnmp环境中的nginx编译安装
-
Qt最新版5.12.2在Win10环境静态编译安装和部署的完整过程(VS2017)
-
CentOS6.5 编译安装lnmp环境
-
CentOS 6.4系统下编译安装LNMP和配置PHP环境具体步骤