Microwindows(Nano-X)移植

820阅读 0评论2016-02-26 fly123456789
分类:LINUX

 

??Microwindows(Nano-X)移植

 1040人阅读 评论(1)  举报
 分类:
 
项目总结(5) 
分类: Gui


首先需要下载Microwindows的源文件以及依赖的库.

下载zlib包
下载jpeg包
下载png包
下载microwindows包

#tar -xf zlib-1.2.3.tar.bz2
#CC=/your_path/arm-linux-gcc ./configure --prefix=/your_path/zlib --shared 
#make
#make install

#tar -xf jpegsrc.v6b.tar.gz
#CC=/your_path/arm-linux-gcc ./configure --enable-shared --host=arm-linux AR=/your_path/arm-linux-ar AR2=/your_path/arm-linux-ranlib --prefix=/your_path/libjpeg
#make
#make install

#tar -xf libpng_src.tgz
#CC=/your_path/arm-linux-gcc ./configure --build=i686-pc-linux --target=arm-linux --host=arm-linux --prefix=/your_path/libpng
#make
#make install

#tar -xf microwindows-full-snapshot.tar.gz
这里我们使用的FrameBuff模式,所以从Configs文件夹里拷一个FB方式的配置文件.
#cp Configs/config.fb config
虽然,是官方提供的一个FB方式配置文件,但是我们还需要作修改,打开config文件.按自己实际需求修改,例如我是不需要键盘支持的,但用到SER鼠标,而且是需要支持jpeg和png图片的,这都需要设置引用库的路径.这里贴一下我的配置文件.
  1. config
  1. ####################################################################
  2. # config: Microwindows and Nano-X configuration file
  3. #
  4. # This package is configured using this file for desktop Linux running
  5. # framebuffer (FRAMEBUFFER=Y) or X11 (X11=Y), or cross-compiled
  6. for a variety of architectures (see ARCH= below).
  7. In addition, a variety of mouse and keyboards drivers can be
  8. # selected (see MOUSE AND KBD below)
  9. #
  10. # See the src/Configs directory for pre-built config files.
  11. # Edit this or copy one src/config, and type "make clean; make"
  12. ####################################################################

  13. ####################################################################
  14. # Build target platform. Valid ARCH values are:
  15. #
  16. # LINUX-NATIVE
  17. # LINUX-AVR32 (BIGENDIAN=Y)
  18. # LINUX-TCC
  19. # LINUX-ARM
  20. # UCLINUX-ARM
  21. # LINUX-MIPS
  22. # LINUX-POWERPC (BIGENDIAN=Y)
  23. # LINUX-SPARC (BIGENDIAN=Y)
  24. # LINUX-BLACKFIN
  25. # LINUX-SH
  26. # SOLARIS (BIGENDIAN=Y)
  27. # PSP
  28. # NDS (Nintendo DS)
  29. # TRIMEDIA
  30. # MACOSX
  31. # RTEMS
  32. # ECOS
  33. # CYGWIN
  34. ####################################################################
  35. ARCH = LINUX-ARM
  36. BIGENDIAN = N
  37. NATIVETOOLSPREFIX = 
  38. ARMTOOLSPREFIX = /your_path/arm-linux- 
  39. MIPSTOOLSPREFIX = mipsel-linux-
  40. POWERPCTOOLSPREFIX = powerpc-linux-
  41. SHTOOLSPREFIX = sh-linux-gnu
  42. AVR32TOOLSPREFIX          = avr32-linux-
  43. BLACKFINTOOLSPREFIX          = bfin-uclinux-
  44. PSPTOOLSPREFIX = psp-

  45. ####################################################################
  46. #
  47. # Compiling options
  48. #
  49. ####################################################################
  50. OPTIMIZE = Y
  51. DEBUG = Y
  52. VERBOSE = N
  53. THREADSAFE = Y
  54. GPROF = N

  55. ####################################################################
  56. #
  57. # Libraries to build: microwin, nano-X, engine, object frameworks
  58. #
  59. ####################################################################
  60. MICROWIN = Y
  61. NANOX = Y
  62. ENGINE = Y
  63. SHAREDLIBS = Y
  64. OBJFRAMEWORK = N

  65. ####################################################################
  66. #
  67. # Demos to build
  68. #
  69. ####################################################################
  70. MICROWINDEMO = Y
  71. NANOXDEMO = Y

  72. ####################################################################
  73. #
  74. # Applications to build
  75. #
  76. ####################################################################
  77. NANOWM = Y
  78. FBEMULATOR = Y

  79. ####################################################################
  80. #
  81. If using Linux framebuffer, set to MWPF_TRUECOLOR8888, and use fbset.
  82. # When running X11, this sets the X11 pixel emulation at runtime.
  83. #
  84. On Linux or when running the standard framebuffer subdrivers,
  85. # the runtime framebuffer BPP (bits per pixel) is used to select 
  86. # the runtime screen subdriver. However, the format of the pixel
  87. # itself must be selected at compile time, which sets macros used
  88. for MWCOLORVAL color conversions and conversion blit byte order.
  89. # This also sets sizeof(MWPIXELVAL) for optimizing buffers sizes
  90. in GrArea/GrReadArea.
  91. #
  92. # define MWPF_PALETTE /* pixel is packed 8 bits 1, 4 or 8 pal index*/
  93. # define MWPF_TRUECOLOR8888 /* pixel is packed 32 bits byte order |B|G|R|A|*/
  94. # define MWPF_TRUECOLORABGR /* pixel is packed 32 bits byte order |R|G|B|A|*/
  95. # define MWPF_TRUECOLOR888 /* pixel is packed 24 bits byte order |B|G|R|*/
  96. # define MWPF_TRUECOLOR565 /* pixel is packed 16 bits little endian RGB565*/
  97. # define MWPF_TRUECOLOR555 /* pixel is packed 16 bits little endian RGB555*/
  98. # define MWPF_TRUECOLOR332 /* pixel is packed 8 bits RGB 332*/
  99. # define MWPF_TRUECOLOR233 /* pixel is packed 8 bits BGR 332*/
  100. #
  101. ####################################################################
  102. SCREEN_PIXTYPE = MWPF_TRUECOLOR888

  103. ####################################################################
  104. # NanoX: Put Y to the following line to link the nano-X application
  105. # with the server. This is required if UNIX sockets aren't available,
  106. or for speed or debugging. This affects the nano-X server only.
  107. ####################################################################
  108. LINK_APP_INTO_SERVER = N

  109. ####################################################################
  110. # Shared memory support for Nano-X client/server protocol speedup
  111. ####################################################################
  112. HAVE_SHAREDMEM_SUPPORT = N

  113. ####################################################################
  114. # File I/O support
  115. # Supporting either below drags in libc stdio, which may not be wanted
  116. ####################################################################
  117. HAVE_FILEIO = Y

  118. ####################################################################
  119. # BMP, GIF reading support
  120. ####################################################################
  121. HAVE_BMP_SUPPORT = Y
  122. HAVE_GIF_SUPPORT = Y
  123. HAVE_PNM_SUPPORT = Y
  124. HAVE_XPM_SUPPORT = Y

  125. ####################################################################
  126. # JPEG support through libjpeg, see README.txt in contrib/jpeg
  127. ####################################################################
  128. HAVE_JPEG_SUPPORT = Y
  129. INCJPEG = .
  130. LIBJPEG = /your_path/libjpeg/lib/libjpeg.a

  131. ####################################################################
  132. # PNG support via libpng and libz
  133. ####################################################################
  134. HAVE_PNG_SUPPORT = Y
  135. INCPNG = .
  136. LIBPNG = /your_path/libpng/lib/libpng.a
  137. INCZ = .
  138. LIBZ =  /your_path/zlib/lib/libz.a

  139. ####################################################################
  140. # TIFF support through libtiff
  141. ####################################################################
  142. HAVE_TIFF_SUPPORT = N
  143. INCTIFF = .
  144. LIBTIFF = /usr/lib/libtiff.a

  145. ####################################################################
  146. # PCF font support - .pcf/.pcf.gz loadable fonts
  147. ####################################################################
  148. HAVE_PCF_SUPPORT = Y
  149. HAVE_PCFGZ_SUPPORT = Y
  150. PCF_FONT_DIR = "fonts/pcf"

  151. ####################################################################
  152. # Truetype fonts - .ttf loadable fonts thru Freetype 2.x
  153. ####################################################################
  154. HAVE_FREETYPE_2_SUPPORT = N
  155. INCFT2LIB = /usr/include
  156. LIBFT2LIB = /usr/local/lib/libfreetype.a
  157. FREETYPE_FONT_DIR = "fonts/truetype"

  158. ####################################################################
  159. # T1 adobe type1 fonts - .pfb/.afm loadable thru t1lib
  160. # t1lib.config must be setup and in T1LIB_FONT_DIR
  161. ####################################################################
  162. HAVE_T1LIB_SUPPORT = N
  163. T1LIB_FONT_DIR = "fonts/type1"
  164. INCT1LIB = /usr/include
  165. LIBT1LIB = /usr/lib/libt1.a

  166. ####################################################################
  167. # FNT font support - .fnt/.fnt.gz loadable fonts (native bdf-converted)
  168. ####################################################################
  169. HAVE_FNT_SUPPORT = Y
  170. HAVE_FNTGZ_SUPPORT = Y
  171. FNT_FONT_DIR = "fonts/fnt"

  172. ####################################################################
  173. # Japanese EUC-JP support using loadable MGL font
  174. ####################################################################
  175. HAVE_EUCJP_SUPPORT = N
  176. EUCJP_FONT_DIR = "fonts/japanese"

  177. ####################################################################
  178. # Chinese Han Zi Ku loadable font support
  179. ####################################################################
  180. HAVE_HZK_SUPPORT = N
  181. HZK_FONT_DIR = "fonts/chinese"

  182. ####################################################################
  183. # DBCS Chinese BIG5 compiled in font support (big5font.c)
  184. ####################################################################
  185. HAVE_BIG5_SUPPORT = N

  186. ####################################################################
  187. # DBCS Chinese GB2312 compiled in font support (gb2312font.c)
  188. ####################################################################
  189. HAVE_GB2312_SUPPORT = N

  190. ####################################################################
  191. # DBCS Japanese JISX0213 compiled in font support (jisx0213-12x12.c)
  192. ####################################################################
  193. HAVE_JISX0213_SUPPORT = N

  194. ####################################################################
  195. # DBCS Korean HANGUL font support (jo16x16.c)
  196. ####################################################################
  197. HAVE_KSC5601_SUPPORT = N

  198. ####################################################################
  199. # Fribidi and shape/joining support for right to left rendering
  200. ####################################################################
  201. HAVE_FRIBIDI_SUPPORT = N
  202. HAVE_SHAPEJOINING_SUPPORT = N
  203. INCFRIBIDI = $(TOP)/../../../include
  204. LIBFRIBIDI = $(TOP)/../../../lib/libfribidi.a

  205. ####################################################################
  206. # Generate screen driver interface only with no fonts or clipping
  207. ####################################################################
  208. NOFONTS = N
  209. NOCLIPPING = N

  210. ####################################################################
  211. Window move algorithms for Microwindows
  212. # Change for tradeoff between cpu speed and looks
  213. # ERASEMOVE (nanowm) repaints only backgrounds while window dragging
  214. # Otherwise an XOR redraw is used for window moves only after button up
  215. # UPDATEREGIONS (win32 api only)paints in update clipping region only
  216. ####################################################################
  217. ERASEMOVE = Y
  218. UPDATEREGIONS = Y

  219. ####################################################################
  220. # SCREEN DRIVERS
  221. ####################################################################
  222. # X11 and FBE startup screen width, height, (depth for palette mode only)
  223. SCREEN_WIDTH = 1024
  224. SCREEN_HEIGHT = 768
  225. SCREEN_DEPTH = 8

  226. # X Window screen driver
  227. # USE_EXPOSURE for XFree86 4.or if backing store not working
  228. X11 = N
  229. USE_EXPOSURE = N

  230. # Framebuffer screen driver
  231. FRAMEBUFFER = Y

  232. # memory screen driver
  233. SCRMEM = N

  234. # PSP screen driver
  235. PSP = N

  236. # Nintendo DS screen driver
  237. SCRNDS = N



  238. set VTSWITCH to include virtual terminal switch code
  239. set FBREVERSE to reverse bit orders in 1,2,4 bpp
  240. set GRAYPALETTE to link with Gray Palette (valid only for 4bpp modes)
  241. set HAVETEXTMODE=for systems that can switch between text & graphics.
  242. VTSWITCH = N
  243. FBREVERSE = N
  244. GRAYPALETTE = N
  245. HAVETEXTMODE = N

  246. # SA1100_LCD_LTLEND 4bpp driver with arm SA1100 LCD controller
  247. # INVERT4BPP 4bpp inverted pixel driver for VTech Helio
  248. SA1100_LCD_LTLEND = N
  249. INVERT4BPP = N


  250. ####################################################################
  251. # Mouse drivers
  252. # GPMMOUSE    gpm mouse
  253. # SERMOUSE    serial Microsoft, PC, Logitech, PS/2 mice (/dev/psaux)
  254. # SUNMOUSE    Sun Workstation mouse (/dev/sunmouse)
  255. # NOMOUSE    no mouse driver
  256. #
  257. # Touchscreen drivers
  258. # IPAQMOUSE    Compaq iPAQ, Intel Assabet (/dev/h3600_tsraw)
  259. # ZAURUSMOUSE    Sharp Zaurus (/dev/sharp_ts)
  260. # TUXMOUSE    TuxScreen (/dev/ucb1x00-ts)
  261. # ADSMOUSE    Applied Data Systems GC+ (/dev/ts)
  262. # ADS7846MOUSE    ADS7846 chip, PSI OMAP Innovator (/dev/innnovator_ts)
  263. # EPMOUSE    Embedded Planet (/dev/tpanel)
  264. # VHMOUSE    Vtech Helio (/dev/tpanel)
  265. # MTMOUSE    MicroTouch serial (/dev/ttyS1)
  266. # PSIONMOUSE    Psion 5 (/dev/touch_psion)
  267. # YOPYMOUSE    Yopy (/dev/yopy-ts)
  268. # HARRIERMOUSE    NEC Harrier (/dev/tpanel)
  269. # TSLIBMOUSE Use tslib (/dev/input/event0)
  270. # EVENTMOUSE    Simple standard event interface (/dev/input/event0)
  271. # TTMOUSE TomTom GO and ONE (/dev/ts)
  272. ####################################################################
  273. GPMMOUSE = N
  274. SERMOUSE = Y
  275. SUNMOUSE = N
  276. NOMOUSE = N
  277. IPAQMOUSE = N
  278. ZAURUSMOUSE = N
  279. TUXMOUSE = N
  280. ADSMOUSE = N
  281. ADS7846MOUSE = N
  282. EPMOUSE = N
  283. VHMOUSE = N
  284. MTMOUSE = N
  285. PSIONMOUSE = N
  286. YOPYMOUSE = N
  287. HARRIERMOUSE = N
  288. LIRCMOUSE = N
  289. TSLIBMOUSE = N
  290. TTMOUSE   = N
  291. PSPMOUSE = N
  292. NDSMOUSE = N
  293. EVENTMOUSE = N

  294. # keyboard or null kbd driver
  295. TTYKBD = N
  296. SCANKBD = N
  297. PIPEKBD = N
  298. IPAQKBD = N
  299. LIRCKBD = N
  300. PSPKBD = N
  301. EVENTKBD = N
  302. NOKBD = Y
  303. # Secondary keyboard drivers for IR input
  304. LIRCKBD2 = N


  305. ####################################################################
  306. # VNC server support through libvncserver
  307. ####################################################################
  308. HAVE_VNCSERVER_SUPPORT = N
  309. VNCSERVER_PTHREADED = N
  310. LIBVNC = /usr/lib/libvncserver.a
  311. INCVNC = /usr/include
#make
编译好后,将lib目录下的所有.so文件拷到板子的lib目录下,jpeg和png,zlib的库文件也要是拷到板子的lib目录下,然后把bin目录下的nano-X(Server)和nanowm(Desktop),外加一个测试程序(mtest或者mine都可以)拷到板子上.OK,到这里,我们还需要按实际情况设置一下环境变量.
#export FRAMEBUFFER="/dev/fb1"
#export MOUSE_TYPE="ps2"
#export MOUSE_PORT="/dev/psaux"
FB模式下,只要该LCD驱动能提供标准的显示信息和MMAP等操作,一般情况都能成功跑起来.
上一篇:MiniGUI3.0.12 移植到mini2440
下一篇:用Microwindows(Nano-X)编写中文程序