网上ghostscript大多是9.04的编译过程,发现在9.26以后就行不通了 之前的版本未测试
交叉应该是可以的,不过我没弄出来,就只好在debian for arm上编译了
环境Ubuntu16.04
1. 环境安装
sudo apt-get install binfmt-support qemu qemu-user-static debootstrap
2.下载文件
sudo debootstrap --arch=armhf --foreign stretch stretch http://mirrors.ustc.edu.cn/debian/
3.arm环境模拟
sudo cp /usr/bin/qemu-arm-static ./usr/bin
sudo cp /etc/resolv.conf ./etc/resolv.conf
4.文件释放
sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true LC_ALL=C LANGUAGE=C LANG=C chroot ./ debootstrap/debootstrap --second-stage
5.编辑源文件
vim etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free
deb-src http://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free
6.切入debian模拟环境
sudo chroot .
7.串口控制台支持
ln -s /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@ttymxc0.service//这个没有启动完串口控制台就没了
删除/etc/systemd/system/getty.target.wants/getty@tty1.service//有这个在会在LCD上出现登录界面
8.编译环境基本配置
passwd root
adduser tanic
apt-update
apt install net-tools //ifconfig
apt-get install gcc g++ automake autoconf libtool make bison flex pkg-config
行了,现在就可以把源码复制到模拟环境中编译了
把可以交叉编译的库编译好了放到模拟环境中,不能交叉编译的源码放到模拟环境编译就行啦
编译结果https://download.youkuaiyun.com/download/suxingtian/12919243 包含armel和armhf两个版本 亲测可用
测试指令如下
./gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=a4 -r300x300 -sDEVICE=pbmraw -sOutputFile=tt.pbm tt.pdf
或者gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=a4 -r300x300 -sDEVICE=ps2write -sOutputFile=tt.pbm tt.pdf 等等