下载ncurses
和htop的源码,比如ncurses-5.9和htop-2.0.2
两者均为autoconf配置,先编译ncurses生成htop的依赖库。
配置指令:
./configure --prefix=/root/extest/nc --without-cxx --without-cxx-binding --without-ada --without-manpages --without-progs --without-tests --with-shared
这里,我新建了个目录/root/extest/nc,用来存放ncurse编译的结果。
然后
make
make install
编译好,在/root/extest/nc中,会生成bin, include, lib, share 四个目录。
下一步,编译htop
配置指令:
./configure --prefix=/root/extest/ht --disable-unicode LDFLAGS=-L/root/extest/nc/lib CPPFLAGS=-I/root/extest/nc/include/
这里,/root/extest/ht, 用来存放htop的编译结果。
然后
make
make install
在/root/extest/ht,会生成bin和share目录。
在bin下,会有htop的可执行文件。
在arm上,移植htop的方法是,在ncurse和htop的configure中,添加选项:
--host=arm-linux-gnueabi
在arm上,部署是将
lib所有文件 放到 /usr/lib
share所有文件 放到 /usr/share
bin所有文件 放到 /usr/sbin下