您尚未登录。

楼主 #1 2020-05-09 21:10:47

缥缈九哥
会员
注册时间: 2020-05-09
已发帖子: 76
积分: 92

移植directvnc-0.7.5到GEC2440开发板 --缥缈九哥

移植directvnc-0.7.5到GEC2440开发板

1,下载解压源码:
root@yuanxh-desktop:/home/yuanxh/s3c2410# wget http://www.adam-lilienthal.de/directvnc/directvnc-0.7.5.tar.gz
root@yuanxh-desktop:/home/yuanxh/s3c2410# tar xzvf directvnc-0.7.5.tar.gz
2,配置编译源码:
root@yuanxh-desktop:/home/yuanxh/s3c2410# cd directvnc-0.7.5
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5# ./configure
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5# make
(编译有错,不用理会!!!只是生成个用到的config.h)
3,重建源码包目录:
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5# cd ..
root@yuanxh-desktop:/home/yuanxh/s3c2410# mkdir directvnc-0.7.5-9g24x0 directvnc-0.7.5-9g24x0/include
root@yuanxh-desktop:/home/yuanxh/s3c2410# cp directvnc-0.7.5/src/*.c  directvnc-0.7.5-9g24x0/
root@yuanxh-desktop:/home/yuanxh/s3c2410# cp directvnc-0.7.5/config.h directvnc-0.7.5-9g24x0/include/
root@yuanxh-desktop:/home/yuanxh/s3c2410# cp directvnc-0.7.5/src/*.h directvnc-0.7.5-9g24x0/include/
4,添加缺少的头文件:
root@yuanxh-desktop:/home/yuanxh/s3c2410# cd directvnc-0.7.5-9g24x0/
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# cp /usr/include/X11/Xmd.h include/
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# cp /usr/include/X11/keysymdef.h include/
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# cp /usr/include/jpeglib.h include/
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# cp /usr/include/jconfig.h include/
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# cp /usr/include/jmorecfg.h include/
5,修改不对的源文件:
A,include/directvnc.h文件:
把31行:  #include <X11/Xmd.h>
修改成: #include <Xmd.h>     // charge by yuanxihua@21cn.com
B,include/keysym.h文件:
把69行: #include <X11/keysymdef.h>
修改成: #include <keysymdef.h> // charge by yuanxihua@21cn.com
C,dfb.c文件:
把33行: DFBCardCapabilities caps;
修改成  DFBGraphicsDeviceDescription caps;  // charge by yuanxihua@21cn.com
(可能是新版本的DFB已经更新了结构体定义)
把45行: DFBCHECK(DirectFBSetOption ("quiet", ""));
修改成  //charge by yuanxihua@21cn.com  DFBCHECK(DirectFBSetOption ("quiet", ""));
(可能是新版本的DFB不支持这种配置)
把70行: DFBCHECK(dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse ));
修改成  //charge by yuanxihua@21cn.com  DFBCHECK(dfb->GetInputDevice( dfb, DIDID_MOUSE, &mouse ));
(因为我的系统鼠标驱动/dev/input/mouse0 [设备号13,  32]还没有实现)
6,按附录增加Makefile:
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# vi Makefile
7,编译生成目标码:
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# make
(就可以生成可执行文件directvnc)
8,添加库文件到目标板:
root@yuanxh-desktop:/home/yuanxh/s3c2410/directvnc-0.7.5-9g24x0# cd /nfsboot/rootfs/usr/
root@yuanxh-desktop:/nfsboot/rootfs/usr# mkdir directfb
root@yuanxh-desktop:/nfsboot/rootfs/usr# cp -av /usr/directfb/* directfb/
root@yuanxh-desktop:/nfsboot/rootfs/usr# cd ../lib/
root@yuanxh-desktop:/nfsboot/rootfs/lib# cp -av ../usr/directfb/lib/libdirect-1.3.so.0* .
root@yuanxh-desktop:/nfsboot/rootfs/lib# cp -av ../usr/directfb/lib/libdirectfb-1.3.so.0* .
root@yuanxh-desktop:/nfsboot/rootfs/lib# cp -av ../usr/directfb/lib/libfusion-1.3.so.0* .
9,在目标板上运行:
./app/directvnc 192.168.1.2:0 -p 123456
(其中192.168.1.2是运行了VNC服务器的IP地址,:0是启动的服务端口5800后面的偏移号,-p 后是登陆密码
运行过程如果缺什么库请自行交叉编译添加到根文件系统的/lib目录,如libjpeg.so* 和 libz.so* 库)


附录:Makefile 文件:
# Makefile for directvnc-0.7.5-9g24x0, (c) 2008 yuanxihua@21cn.com

CROSS_COMPILE=arm-linux-
PKG_CONFIG =/usr/directfb/lib/pkgconfig
INCLUDE=./include
DIRECTFB=/usr/directfb

CCOPTS = -Wall -O2 -I$(INCLUDE) -I$(DIRECTFB)/include/directfb/ -L$(DIRECTFB)/lib/ \
-ldirectfb  -lfusion -ldirect  -lpthread -ljpeg -lm -lz
ASOPTS =
LDOPTS =

CC = $(CROSS_COMPILE)gcc
AS = $(CROSS_COMPILE)as
LD = $(CROSS_COMPILE)ld

OBJS= args.o cursor.o d3des.o dfb.o getopt.o getopt1.o \
jpeg.o main.o rfb.o sockets.o tight.o vncauth.o

all: $(OBJS)
$(CC) $(CCOPTS) -o directvnc $(OBJS)
cp directvnc /nfsboot/rootfs/app/

.c.o:
$(CC) $(CCOPTS) -c -o $*.o $<

.S.o:
$(AS) $(ASOPTS) -o $*.o $<

clean:
rm -f core *.o *~ *.bak *.tmp

miniclean:
rm -f *.o

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn