更改Android编译软件版本(make/gcc/bision)
一.make版本
1.下载make的压缩包
2.解压,安装
- cd make-x.x
- ./configuration
- sh build.sh
- sudo make install
3.查看版本信息
- make -v
二.gcc版本
1.使用命令安装gcc,以gcc-4.7为例,具体版本请自行决定
- sudo apt-get install gcc-4.7 g++-4.7 g++-4.7-multilib gcc-4.7-multilib
2.若出现无法定位软件包,请添加源,并更新源
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update
3.切换gcc版本,如从gcc4.7切换到gcc4.4
- update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4
- update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4
- update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7
- update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4
- update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.7
也可以使用如下命令,根据需求去选择
- sudo update-alternatives --config gcc
- sudo update-alternatives --config g++
- sudo update-alternatives --config cpp
4.查看版本信息
- gcc -v
- g++ -v
三.jdk版本
说明:Android4.x之前请使用jdk1.6,Android5.x请使用openjdk7
1.安装jdk,以jdk1.6.0_45为例
1.1 到官网选择具体的jdk版本下载:
http://www.oracle.com/technetwork/java/javase/archive-139210.html
1.2 复制到/usr/lib/jvm下
- sudo cp jdk-6u45-linux-x64.bin /usr/lib/jvm
1.3 增加可执行权限
- sudo chmod jdk-6u45-linux-x64.bin
1.4 解压
- sudo ./jdk-6u45-linux-x64.bin
1.5 配置环境变量
- sudo gedit /etc/environment
在最后添加如下信息,保存退出
- export PATH=/usr/lib/jvm/jdk1.6.0_45/bin:$PATH
使用如下命令使环境变量生效
- source /etc/environment
2.配置jdk,其中Android4.0不需要配置javap,而Android4.4以上版本需要配置
- update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java"
- update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac"
- update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_45/bin/javadoc"
- update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so"
- update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws"
- update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/jdk1.6.0_45/bin/javap"
- update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_45/bin/jar"
3.更新jdk配置
- sudo update-alternatives --config java
- sudo update-alternatives --config javac
- sudo update-alternatives --config javadoc
- sudo update-alternatives --config mozilla-javaplugin.so
- sudo update-alternatives --config javaws
- sudo update-alternatives --config javap
- sudo update-alternatives --config jar
4.查看版本信息
- java -version
- javac -version
四.bison版本
1.下载bison的压缩包
2.解压,安装
- cd bison-x.x
- ./configure
- make
- sudo make install
Bison版本不对,可能会引发如下错误(以下错误基于Bison3.0.4与Bison3.0.2,Bison2.7.1不会报该错误
- In file included from plural.y:::
- plural-exp.h::: error: conflicting types for 'libintl_gettextparse'
- # define PLURAL_PARSE libintl_gettextparse
- ^
- plural.y::: note: in expansion of macro 'PLURAL_PARSE'
- # define __gettextparse PLURAL_PARSE
- ^
- plural.c::: note: in expansion of macro '__gettextparse'
- int __gettextparse (void);
- ^
- plural-exp.h::: note: previous declaration of 'libintl_gettextparse' was here
- # define PLURAL_PARSE libintl_gettextparse
- ^
- plural-exp.h::: note: in expansion of macro 'PLURAL_PARSE'
- extern int PLURAL_PARSE (void *arg);
- ^
- plural-exp.h::: error: conflicting types for 'libintl_gettextparse'
- # define PLURAL_PARSE libintl_gettextparse
- ^
- plural.y::: note: in expansion of macro 'PLURAL_PARSE'
- # define __gettextparse PLURAL_PARSE
- ^
- plural.c::: note: in expansion of macro '__gettextparse'
- #define yyparse __gettextparse
- ^
- plural.c::: note: in expansion of macro 'yyparse'
- yyparse (void)
- ^
- plural-exp.h::: note: previous declaration of 'libintl_gettextparse' was here
- # define PLURAL_PARSE libintl_gettextparse
- ^
- plural-exp.h::: note: in expansion of macro 'PLURAL_PARSE'
- extern int PLURAL_PARSE (void *arg);
- ^
- plural.c: In function 'libintl_gettextparse':
- plural.c::: error: too few arguments to function '__gettextlex'
- yychar = yylex (&yylval);
- ^
- plural.c::: note: declared here
- #define yylex __gettextlex
- ^
- plural.y::: note: in expansion of macro 'yylex'
- static int yylex (YYSTYPE *lval, const char **pexp);
- ^
- plural.y::: error: 'arg' undeclared (first use in this function)
- ((struct parse_args *) arg)->res = $;
- ^
- plural.y::: note: each undeclared identifier is reported only once for each function it appears in
- Makefile:: recipe for target 'plural.o' failed
- make[]: *** [plural.o] Error
更改Android编译软件版本(make/gcc/bision)的更多相关文章
- 编译lua版本问题
Compile++ thumb : game_shared <= main.cppjni/hellocpp/main.cpp: In function 'void Java_org_cocos ...
- linux 重新编译低版本gcc
编程实践中,可能会遇到需要较低版本gcc以兼容相应程序的需求,这时就需要我们将系统中默认的gcc版本较低,或者重新编译生成.(UBUNTU12.04下实现gcc4.2.3) 方法1: 对于UBUNTU ...
- android 检查软件是否有更新版本
import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; import com.yuxin.m ...
- Android编译环境折腾记
题记:感觉是时候写点什么了=_=! 第一次安装了ubuntu14.04.5,官网下载的iso,官网下的jar,编译android4.x需要安装jdk6,更高的版本会有问题,baidu到很多搭建环境的步 ...
- Ubuntu 16.04下为Android编译OpenCV 3.2.0 Manager
http://johnhany.net/2016/07/build-opencv-manager-for-android-on-ubuntu/ 最近想在Android上尝试一下SIFT和SURF匹配算 ...
- Android编译过程详解(一)
Android编译过程详解(一) 注:本文转载自Android编译过程详解(一):http://www.cnblogs.com/mr-raptor/archive/2012/06/07/2540359 ...
- Android勒索软件研究报告
Android勒索软件研究报告 Author:360移动安全团队 0x00 摘要 手机勒索软件是一种通过锁住用户移动设备,使用户无法正常使用设备,并以此胁迫用户支付解锁费用的恶意软件.其表现为手机触摸 ...
- Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决
Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决 分类: android应用开发2013-08-21 09:20 4222人阅读 评论(3) 收藏 举报 li ...
- [转载]哪个版本的gcc才支持c11
转自:https://blog.csdn.net/haluoluo211/article/details/71141093 哪个版本的gcc才支持c11 2017年05月03日 19:25:43 Fi ...
随机推荐
- A*搜索 概念
启发式搜索:启发式搜索就是在状态空间中的搜索对每一个搜索的位置进行评估,得到最好的位置,再从这个位置进行搜索直到目标.这样可以省略大量无畏的搜索路径,提到了效率.在启发式搜索中,对位置的估价是十分重要 ...
- JS对象转URL参数(原生JS和jQuery两种方式)
转自:点击打开链接 现在的js框架将ajax请求封装得非常简单,例如下面: $.ajax({ type: "POST", url: "some.php", da ...
- ASP.NET MVC 跨controller函数调用
var controller = DependencyResolver.Current.GetService<ControllerClassName>(); controller.User ...
- MYSQL隐式类型转换
MYSQL隐式类型转换 关于官方文档中的理解大致是: 如果两个参数比较,有至少一个NULL,结果就是NULL,除了是用NULL<=>NULL 会返回1.不做类型转换 两个参数都是字符串,按 ...
- Spring框架总结(十二)
问题引入: 程序的“事务控制”, 可以用aop实现! 即只需要写一次,运行时候动态植入到业务方法上. 一个业务的成功: 调用的service是执行成功的,意味着service中调用的所有的d ...
- ScreenCapture-drupal 7.34-ckeditor4x整合教程
1.1. drupal 7x-ckeditor4x 插件下载:Drupal 7x, 1.1.1. 安装ckeditor4x 下载插件 说明:下载并解压 CKEditor4x插件:https://yun ...
- Android Logging
Here is HauteLook’s logger class from our Android Code Library. It displays class name, method name ...
- git 恢复被修改的文件
恢复到最后一次提交的改动: git checkout filename 如果该文件已经 add 到暂存队列中,恢复文件: git reset HEAD filename
- redis整理の持久化机制
redis是一个支持持久化的内存数据库,也就是说 redis 需要经常将内存中的数据同步到磁盘 来保证持久化.redis 支持两种持久化方式,一种是 Snapshotting(快照)也是默认方式,另 ...
- [LeetCode 题解]: Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. 题解: 寻找一组字符串的最 ...