IMX6移植htop

top命令查看CPU利用率並非很方便,所以打算移植htop到imx6上,主要包括如下幾個步驟:linux

- 資源下載

htop 下載http://hisham.hm/htop/releases/1.0.1/htop-1.0.1.tar.gz

ncurses 下載http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz

- 編譯

首先須要編譯libncurses
./configure --prefix=/home/vincent/resouces/nc   --without-cxx --without-cxx-binding --without-ada --without-manpages --without-progs --without-tests --with-shared --host=arm-none-linux-gnueabi
make -j16
make install

以後編譯htop
./configure --prefix=/home/vincent/resouces/ht --disable-unicode  --host=arm-none-linux-gnueabi LDFLAGS=-L/home/vincent/resouces/nc/lib/ CPPFLAGS="-I/home/vincent/resouces/nc/include/ncurses -I/home/vincent/resouces/nc/include/"
make -j16
make install

htop在configure的時候報錯,因此頭文件目錄設置了兩個

- 移植

將ncurses庫以及htop命令複製到板子上,設置PATH和LD_LIBRARY_PATH

- 問題

執行htop遇到 vt102 打不開
解決:
查看TERM和TERMINFO環境變量是否設置,若是沒有,執行:
export TERM=vt102
export TERMINFO=/usr/share/terminfo
相關文章
相關標籤/搜索