ubuntu20.04编译tslib库
- 安装编译依赖的工具
sudo apt-get install autoconf automake libtool vim
- 从github官网下载tslib:
git clone https://github.com/kergoth/tslib
- 配置编译工具链
创建shell脚本:touch
setup-gcc-linaro-4-9-4-2017-01-x86_64_arm-linux-gnueabihf.sh
打开脚本: vim
setup-gcc-linaro-4-9-4-2017-01-x86_64_arm-linux-gnueabihf.sh
添加编译工具链到脚本:
#!/bin/sh
export ARCH=arm
export PATH=$PATH:/home/sir/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin
脚本添加可执行权限:
chmod 766 setup-gcc-linaro-4-9-4-2017-01-x86_64_arm-linux-gnueabihf.sh
使能编译工具链
source setup-gcc-linaro-4-9-4-2017-01-x86_64_arm-linux-gnueabihf.sh
查看编译工具链:
shell命令行输入:ar,按2次Tab“键,会看到编译工具链使能了。
ubuntu@ubuntu-T450:~$ ar

使能编译工具链
- 编译tslib
创建文件夹:mkdir tslib-image
配置configure:
./configure --host=arm-linux-gnueabihf ac_cv_func_malloc_0_nonnull=yes
--cache-file=arm-linux.cache -prefix=/home/ubuntu/tslib/tslib-image
编译:make -j4
安装到tslib-image目录下:make install
- 查看编译结果:
ubuntu@ubuntu-T450:~$ ls tslib-image
bin etc include lib share

tslib二进制文件
为什么使用shell脚本使能gcc编译工具链?
假如本地有多个gcc编译工具链,每次切换编译工具链,都需要修改/etc/profile,比较麻烦。给每个编译工具链写一个类似的shell 脚本,在新打开的terminal窗口环境中,source 指定编译工具链的脚本,编译工具链只会在该窗口生效,并不会影响到其他terminal窗口,也不需要修改/etc/profile。
每次电脑重启或打开新的terminal窗口,source 指定编译工具链的脚本,编译代码。
相关推荐
-
第18问:MySQL CPU 高了,怎么办?2025-02-24 10:27:18
-
mysql索引类型 normal, unique, full text
mysql索引类型 normal, unique, full text2025-02-24 10:05:05 -
uwsgi+django+nginx 搭建部分总结2025-02-24 10:03:33
-
使用Docker配置Nginx环境部署Nextcloud2025-02-24 10:02:03
-
Nginx安装和怎么使用2025-02-24 10:00:45