一、获取源码并解压

存储于/home/zhangyi/work/psoc_ltp/tools-ltp-ddt中,解压后的源码存于上一层目录。

1.mtd-utils-2.0.0

wget ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-2.0.0.tar.bz2

tar -jxvf mtd-utils-2.0.0.tar.bz2 -C ..#解压到上一层目录

#wget ftp://ftp.infradead.org/pub/mtd-utils/mtd-utils-1.4.5.tar.bz2

#tar -jxvf mtd-utils-1.4.5.tar.bz2 -C .. #解压到上一层目录

2.zlib-1.2.11

wget http://www.zlib.net/zlib-1.2.11.tar.gz

tar -zxvf zlib-1.2.11.tar.gz -C ..#解压到上一层目录

.3.lzo-2.04

#wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz

#tar -zxvf lzo-2.10.tar.gz

wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.04.tar.gz

tar -zxvf lzo-2.04.tar.gz -C ..

4.e2fsprogs-1.41.14

#wget http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/v1.41.14/e2fsprogs-1.41.14.tar.gz

#tar -xzf e2fsprogs-1.41.14.tar.gz -C ..#无法解压

git clone git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git #git下来的是源码,非压缩包

cp -R e2fsprogs/ ..

编译安装前,先建立一个安装目录。

cd /home/zhangyi/work/psoc_ltp

mkdir mtdutils

二、编译安装zlib

cd ./zlib-1.2.11/

#./configure --prefix=$PWD/install_dir

export CC=arm-linux-gnueabihf-gcc #否则编译出x86架构的,在编译mtd_utils时候会报错libz.so file not recognized: File format not recognized

./configure --prefix=/home/zhangyi/work/psoc_ltp/mtdutils --static

make && make install

三、编译安装lzo-2.10

cd ./lzo-2.10/

#./configure --prefix=$PWD/install_dir --host=arm-linux

./configure CC=arm-linux-gnueabihf-gcc --prefix=/home/zhangyi/work/psoc_ltp/mtdutils --host=arm-linux --enable-static

#注意之前是./configure --prefix=../mtdutils 提示configure: error: expected an absolute directory name for --prefix: ../mtdutils 所以还是绝对地址比较靠谱

2.10之前的版本configure会碰到ACC conformance test failed问题。

make && make install

四、编译安装e2fsprogs-1.41.14

./configure CC=arm-linux-gnueabihf-gcc --host=arm-linux --prefix=/home/zhangyi/work/psoc_ltp/mtdutils

cd lib/uuid/

make && make install

五、编译安装mtd-utils-2.0.0

#cd ./mtd-utils-1.4.5/

#export ZLIBCPPFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include
#export ZLIBLDFLAGS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib
#export LZOCPPFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include/lzo
#export LZOLDFLAGS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib

#make CROSS=arm-linux-gnueabihf- WITHOUT_XATTR=1
 
1.4.5make有问题,查了一下说版本太老,和较新的ubuntu不兼容,又回到2.0.0版本。
 
cd ./mtd-utils-2.0.0
export ZLIB_CFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include
export ZLIB_LIBS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib
export LZO_CFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include/lzo
export LZO_LIBS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib
export UUID_CFLAGS=-I/home/zhangyi/work/psoc_ltp/mtdutils/include/uuid
export UUID_LIBS=-L/home/zhangyi/work/psoc_ltp/mtdutils/lib/pkgconfig

export LDFLAGS="$ZLIB_LIBS $LZO_LIBS $UUID_LIBS -luuid -lz"

export CFLAGS="-O2 -g $ZLIB_CFLAGS $LZO_CFLAGS $UUID_CFLAGS"
#-luuid -lz是根据make报错的情况查询后加上的。
#必须要使用export导出为环境变量,否则configure使用不了。
 
./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc --prefix=$PWD/install_dir
 
make CROSS=arm-linux-gnueabihf- WITHOUT_XATTR=1
make install
 
 
 

mtd-utils交叉编译安装的更多相关文章

  1. QT5.7交叉编译安装到arm(好多系列文章)

    以下采用的系统为ubuntu16.04,开发板为迅为iTOP4412,4.3寸屏. 下载qt5.7源码qt-everywhere-opensource-src-5.7.0.tar.xz http:// ...

  2. 交叉编译安装ARM平台上的Qt

    一.宿主机环境搭建: 编译需要x11库的支持,在Ubuntu下安装命令: sudo apt-get install libx11-dev libxext-dev libxtst-dev 二.下载源码包 ...

  3. Linux 嵌入式 开发环境 交叉编译安装

    1.安装 Ubuntu 系统 安装完毕,系统 提示 重启,这个时候 请拔掉U盘,进行重启 OK. 2.安装 NFS 服务 3.安装 openssh服务 4.开启openSSH服务 5.就可以使用 Wi ...

  4. Ubuntu/Debian交叉编译安装ARM平台版本的ffmpeg

    1 准备工作 (1)libmp3lame库 下载:    wget http://downloads.sourceforge.net/lame/lame-3.99.tar.gz 解压 编译:./con ...

  5. Creating and Flashing UBIFS with MTD Utils

    转:http://wiki.atlas-embedded.com/index.php?title=Creating_and_Flashing_UBIFS_with_MTD_Utils Contents ...

  6. libpng交叉编译安装

    tar xzf libpng-1.5.22.tar.gz cd libpng-1.5.22 mkdir tmp 打开Makefile文件并修改CC=arm-linux-gcc ./configure ...

  7. Qt Creator的安装与Qt交叉编译的配置

    Qt Creator 的安装 到Qt官网下载Qt Creator  https://www.qt.io/download-open-source/ 其它旧版本点击Achieve连接下载 或登录http ...

  8. Fedora16 安装相关

    安装BCM4312无线网卡驱动 Linux系统BCM4312无线网卡驱动的安装 联想Y450 Linux系统 无线网卡驱动安装 准备工作: Broadcom官网驱动下载地址 http://www.br ...

  9. Is an MTD device a block device or a char device?

    转:http://www.linux-mtd.infradead.org/faq/general.html#L_mtd_what Note, you can find Ukranian transla ...

随机推荐

  1. Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Unable to compile class for JSP] with root cause java.lang.IllegalArgumentException: Page directive: inval

    严重: Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Una ...

  2. wpf1

    emCombobox.Items[2].IsEnabled = false; 隐藏下拉框里面的一个item wpf 单例模式. [DllImport("user32", CharS ...

  3. 安装Office2010出现MSXML版本6.10.1129.0错误

      在键盘上按“win+R”组合键出现图图示界面后,输入“regsvr32 /u msxml6.dll”,点击“确定”. 出现图示显示后,点击“确定”,并同时去试试office是否能够安装了. 如果上 ...

  4. 记录智能合约solidity编译的坑

    在Linux环境下入门写一段solidity编译遇到error和warning,经过一番研究后才得其缘由,下面以一段demo总结一下. pragma solidity ^; // 指定所需的编译器版本 ...

  5. 【Python基础】lpthw - Exercise 44 继承与组合

    一.继承 原则:大部分使用继承的场合都可以用组合取代或者简化,而多重继承则需要不惜一切的避免. 1. 什么是继承 继承:用于指明一个类的大部分或者全部功能都是从一个父类获得的.此时,父类的实例的所有动 ...

  6. VUE-005-axios常用请求参数设置方法

    在前后端分离的开发过程中,经常使用 axios 进行后端接口的访问. 个人习惯常用的请求参数设置方法如下所示: // POST方法:data在请求体中 addRow(data) { return th ...

  7. vue-cli 创建项目失败

    vue-cli 创建一个vue项目报错 npm code 404. 尝试解决方法都有,我是第3种方法生效 更新npm 重新安装nodejs vue-cli@3.0.1 在创建项目的时候,不能开启其他v ...

  8. Push rejected: Push to origin/master was rejected

    1.错误日志 : Maven projects need to be imported: Import Changes Enable Auto-Import : files committed: 初始 ...

  9. 连接H3C交换机的Console口连不上

    一.故障:使用Console线连接交换机的Console口连不上. 处理步骤: 1.先把Console线连接好,一端连接交换机的Console口,另一端连接电脑的USB口. 2.安装Console线驱 ...

  10. 60道Python面试题&答案精选!找工作前必看

    需要Word/ PDF版本的同学可以在实验楼微信公众号回复关键词"面试题"获取. 1. Python 的特点和优点是什么? 答案:略. 2. 什么是lambda函数?它有什么好处? ...