export PATH=$PATH:/home/oct1158/Downloads/arm-gnu-toolchain-14.2.rel1-x86_64-arm-none-linux-gnueabihf/bin
【在電腦上交叉編譯ncurses6.5】
[步驟1: 編譯帶後綴w的libncursesw.so庫]
cd ~/Downloads
wget
https://ftp.gnu.org/gnu/ncurses/ncurses-6.5.tar.gztar xf ncurses-6.5.tar.gz
cd ncurses-6.5
./configure --host=arm-none-linux-gnueabihf --with-shared
make
修改progs/Makefile文件裡面第82行的INSTALL_PROG變量,在變量值的末尾添加
--strip-program=arm-none-linux-gnueabihf-strip
然後make install DESTDIR=$(pwd)/_installw
[步驟2: 編譯不帶後綴w的libncurses.so庫]
make distclean
./configure --host=arm-none-linux-gnueabihf --with-shared --disable-widec
make
再修改一次progs/Makefile文件裡面第82行的INSTALL_PROG變量,在變量值的末尾添加
--strip-program=arm-none-linux-gnueabihf-strip
然後make install DESTDIR=$(pwd)/_install
[步驟3:將libncurses庫的安裝文件與libncursesw混合, 同名文件用libncurses覆蓋(注意是用ncurses覆蓋ncursesw,不要搞反了)]
mkdir _installw/usr/include/ncursesw
mv _installw/usr/include/*.h _installw/usr/include/ncursesw
mkdir _install/usr/include/ncurses
cd _install/usr/include/ncurses
for name in $(ls ../*.h)
do
ln -s $name .
done
cd ../../../..
cp -r _install/* _installw
rm -rf _install
cd _installw
sudo chown -R root:root usr
tar czf ncurses-6.5-binary.tar.gz usr
mv ncurses-6.5-binary.tar.gz /var/www/html/oct1158