一.make版本

1.下载make的压缩包

ftp://ftp.gnu.org/gnu/make/

2.解压,安装

  1. cd make-x.x
  2. ./configuration
  3. sh build.sh
  4. sudo make install

3.查看版本信息

  1. make -v

二.gcc版本

1.使用命令安装gcc,以gcc-4.7为例,具体版本请自行决定

  1. sudo apt-get install gcc-4.7 g++-4.7 g++-4.7-multilib gcc-4.7-multilib

2.若出现无法定位软件包,请添加源,并更新源

  1. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
  2. sudo apt-get update

3.切换gcc版本,如从gcc4.7切换到gcc4.4

  1. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.4
  2. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7
  3. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4
  4. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7
  5. update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.4
  6. update-alternatives --install /usr/bin/cpp cpp-bin /usr/bin/cpp-4.7

  也可以使用如下命令,根据需求去选择

  1. sudo update-alternatives --config gcc
  2. sudo update-alternatives --config g++
  3. sudo update-alternatives --config cpp

4.查看版本信息

  1. gcc -v
  2. 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下

  1. sudo cp jdk-6u45-linux-x64.bin /usr/lib/jvm

  1.3 增加可执行权限

  1. sudo chmod jdk-6u45-linux-x64.bin

  1.4 解压

  1. sudo ./jdk-6u45-linux-x64.bin

  1.5 配置环境变量

  1. sudo gedit /etc/environment

    在最后添加如下信息,保存退出

  1. export PATH=/usr/lib/jvm/jdk1.6.0_45/bin:$PATH

    使用如下命令使环境变量生效

  1. source /etc/environment

2.配置jdk,其中Android4.0不需要配置javap,而Android4.4以上版本需要配置

  1. update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java"
  2. update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac"
  3. update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_45/bin/javadoc"
  4. update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so"
  5. update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws"
  6. update-alternatives --install "/usr/bin/javap" "javap" "/usr/lib/jvm/jdk1.6.0_45/bin/javap"
  7. update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_45/bin/jar"

3.更新jdk配置

  1. sudo update-alternatives --config java
  2. sudo update-alternatives --config javac
  3. sudo update-alternatives --config javadoc
  4. sudo update-alternatives --config mozilla-javaplugin.so
  5. sudo update-alternatives --config javaws
  6. sudo update-alternatives --config javap
  7. sudo update-alternatives --config jar

4.查看版本信息

  1. java -version
  2. javac -version

四.bison版本

1.下载bison的压缩包

http://ftp.gnu.org/gnu/bison/

2.解压,安装

  1. cd bison-x.x
  2. ./configure
  3. make
  4. sudo make install

  Bison版本不对,可能会引发如下错误(以下错误基于Bison3.0.4与Bison3.0.2,Bison2.7.1不会报该错误

  1. In file included from plural.y:::
  2. plural-exp.h::: error: conflicting types for 'libintl_gettextparse'
  3. # define PLURAL_PARSE libintl_gettextparse
  4. ^
  5. plural.y::: note: in expansion of macro 'PLURAL_PARSE'
  6. # define __gettextparse PLURAL_PARSE
  7. ^
  8. plural.c::: note: in expansion of macro '__gettextparse'
  9. int __gettextparse (void);
  10. ^
  11. plural-exp.h::: note: previous declaration of 'libintl_gettextparse' was here
  12. # define PLURAL_PARSE libintl_gettextparse
  13. ^
  14. plural-exp.h::: note: in expansion of macro 'PLURAL_PARSE'
  15. extern int PLURAL_PARSE (void *arg);
  16. ^
  17. plural-exp.h::: error: conflicting types for 'libintl_gettextparse'
  18. # define PLURAL_PARSE libintl_gettextparse
  19. ^
  20. plural.y::: note: in expansion of macro 'PLURAL_PARSE'
  21. # define __gettextparse PLURAL_PARSE
  22. ^
  23. plural.c::: note: in expansion of macro '__gettextparse'
  24. #define yyparse __gettextparse
  25. ^
  26. plural.c::: note: in expansion of macro 'yyparse'
  27. yyparse (void)
  28. ^
  29. plural-exp.h::: note: previous declaration of 'libintl_gettextparse' was here
  30. # define PLURAL_PARSE libintl_gettextparse
  31. ^
  32. plural-exp.h::: note: in expansion of macro 'PLURAL_PARSE'
  33. extern int PLURAL_PARSE (void *arg);
  34. ^
  35. plural.c: In function 'libintl_gettextparse':
  36. plural.c::: error: too few arguments to function '__gettextlex'
  37. yychar = yylex (&yylval);
  38. ^
  39. plural.c::: note: declared here
  40. #define yylex __gettextlex
  41. ^
  42. plural.y::: note: in expansion of macro 'yylex'
  43. static int yylex (YYSTYPE *lval, const char **pexp);
  44. ^
  45. plural.y::: error: 'arg' undeclared (first use in this function)
  46. ((struct parse_args *) arg)->res = $;
  47. ^
  48. plural.y::: note: each undeclared identifier is reported only once for each function it appears in
  49. Makefile:: recipe for target 'plural.o' failed
  50. make[]: *** [plural.o] Error

更改Android编译软件版本(make/gcc/bision)的更多相关文章

  1. 编译lua版本问题

    Compile++ thumb  : game_shared <= main.cppjni/hellocpp/main.cpp: In function 'void Java_org_cocos ...

  2. linux 重新编译低版本gcc

    编程实践中,可能会遇到需要较低版本gcc以兼容相应程序的需求,这时就需要我们将系统中默认的gcc版本较低,或者重新编译生成.(UBUNTU12.04下实现gcc4.2.3) 方法1: 对于UBUNTU ...

  3. android 检查软件是否有更新版本

    import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; import com.yuxin.m ...

  4. Android编译环境折腾记

    题记:感觉是时候写点什么了=_=! 第一次安装了ubuntu14.04.5,官网下载的iso,官网下的jar,编译android4.x需要安装jdk6,更高的版本会有问题,baidu到很多搭建环境的步 ...

  5. Ubuntu 16.04下为Android编译OpenCV 3.2.0 Manager

    http://johnhany.net/2016/07/build-opencv-manager-for-android-on-ubuntu/ 最近想在Android上尝试一下SIFT和SURF匹配算 ...

  6. Android编译过程详解(一)

    Android编译过程详解(一) 注:本文转载自Android编译过程详解(一):http://www.cnblogs.com/mr-raptor/archive/2012/06/07/2540359 ...

  7. Android勒索软件研究报告

    Android勒索软件研究报告 Author:360移动安全团队 0x00 摘要 手机勒索软件是一种通过锁住用户移动设备,使用户无法正常使用设备,并以此胁迫用户支付解锁费用的恶意软件.其表现为手机触摸 ...

  8. Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决

    Android编译环境——ubuntu12.04上android2.3.4编译错误以及解决 分类: android应用开发2013-08-21 09:20 4222人阅读 评论(3) 收藏 举报 li ...

  9. [转载]哪个版本的gcc才支持c11

    转自:https://blog.csdn.net/haluoluo211/article/details/71141093 哪个版本的gcc才支持c11 2017年05月03日 19:25:43 Fi ...

随机推荐

  1. A*搜索 概念

    启发式搜索:启发式搜索就是在状态空间中的搜索对每一个搜索的位置进行评估,得到最好的位置,再从这个位置进行搜索直到目标.这样可以省略大量无畏的搜索路径,提到了效率.在启发式搜索中,对位置的估价是十分重要 ...

  2. JS对象转URL参数(原生JS和jQuery两种方式)

    转自:点击打开链接 现在的js框架将ajax请求封装得非常简单,例如下面: $.ajax({ type: "POST", url: "some.php", da ...

  3. ASP.NET MVC 跨controller函数调用

    var controller = DependencyResolver.Current.GetService<ControllerClassName>(); controller.User ...

  4. MYSQL隐式类型转换

    MYSQL隐式类型转换 关于官方文档中的理解大致是: 如果两个参数比较,有至少一个NULL,结果就是NULL,除了是用NULL<=>NULL 会返回1.不做类型转换 两个参数都是字符串,按 ...

  5. Spring框架总结(十二)

    问题引入:      程序的“事务控制”, 可以用aop实现! 即只需要写一次,运行时候动态植入到业务方法上. 一个业务的成功: 调用的service是执行成功的,意味着service中调用的所有的d ...

  6. ScreenCapture-drupal 7.34-ckeditor4x整合教程

    1.1. drupal 7x-ckeditor4x 插件下载:Drupal 7x, 1.1.1. 安装ckeditor4x 下载插件 说明:下载并解压 CKEditor4x插件:https://yun ...

  7. Android Logging

    Here is HauteLook’s logger class from our Android Code Library. It displays class name, method name ...

  8. git 恢复被修改的文件

    恢复到最后一次提交的改动:   git checkout filename 如果该文件已经 add 到暂存队列中,恢复文件:   git reset HEAD filename

  9. redis整理の持久化机制

    redis是一个支持持久化的内存数据库,也就是说 redis 需要经常将内存中的数据同步到磁盘 来保证持久化.redis 支持两种持久化方式,一种是 Snapshotting(快照)也是默认方式,另 ...

  10. [LeetCode 题解]: Longest Common Prefix

    Write a function to find the longest common prefix string amongst an array of strings. 题解: 寻找一组字符串的最 ...