编译microwindow(nano-X) 及flnx-0.18
生活随笔
收集整理的這篇文章主要介紹了
编译microwindow(nano-X) 及flnx-0.18
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
來自:
http://blog.chinaunix.net/uid-20595394-id-1619435.html
http://blog.chinaunix.net/uid-20595394-id-1619427.html
先編譯microwindows,然后flnx。
說明:編譯freetype庫時,在freetype-x.x.xx/builds/unix/libtool中需要指定ranlib gcc ar strip等交叉編譯工具的絕對路徑。編譯microwindows時需要去掉PCFGZ,FNTGZ字體的支持。安裝JPEG時
# tar -zxf jpegsrc.v6b.tar.gz
# cd jpeg-6b/
# ./configure --prefix=/usr/local/jpeg
# make
# make install-lib
如果你選擇默認安裝,可能很順利,指定路徑后,請先創建以下文件夾
錯誤提示:...... /usr/bin/install -c -m 644 jconfig.h /usr/local/jpeg6/include/jconfig.h
/usr/bin/install: 無法創建一般文件‘/usr/local/jpeg/include/jconfig.h’: 沒有那個文件或目錄
make: *** [install-headers] Error 1
# mkdir /usr/local/jpeg
# mkdir /usr/local/jpeg/include
# mkdir /usr/local/jpeg/lib
# make install-lib
# make install
安裝時如果錯誤提示:
/usr/bin/install: 無法創建一般文件‘/usr/local/jpeg6/lib/libjpeg.a’: 沒有那個文件或目錄
make: *** [install-lib] Error 1
創建如下文件夾:
# mkdir /usr/local/jpeg/lib
# make install
/usr/bin/install -c cjpeg /usr/local/jpeg/bin/cjpeg
/usr/bin/install: 無法創建一般文件‘/usr/local/jpeg/bin/cjpeg’: 沒有那個文件或目錄
make: *** [install] Error 1
# mkdir /usr/local/jpeg/bin
/usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/jpeg/man/man1/cjpeg.1
/usr/bin/install: 無法創建一般文件‘/usr/local/jpeg/man/man1/cjpeg.1’: 沒有那個文件或目錄
make: *** [install] Error 1
# mkdir /usr/local/jpeg/man
# mkdir /usr/local/jpeg/man/man1
# make install
好了,直到安裝成功!
microwindows移植ARM-LINUX(s3c2410)小結
很長時間了,最近終于取得了一點進展,今天也有空和心思來寫下一點東西,好讓自己不會忘記。
在整個的移植過程中遇到了太多的問題,很多小問題可能已經忘記是怎么解決的了(最近發現記憶力下降明顯呀:().也就記下幾個比較大的問題,花了我很長時間解決的問題。
??? 我的前面幾篇文章里有介紹MICROWINDOWS的下載和解壓,以及PC LINUX的安裝。但沒有涉及ARM LINUX的移植,如果是初次移植建議還是先在PC LINUX上嘗試,因為那很容易成功。
?? microwin目錄:/home/lua/mwinarm???? arm-linux-gcc 3.4.1
首先把microwindows-fonts-0.90.tar.gz里面的內容全部釋放到mwinarm/fonts/下,這里有TRUETYPE字體文件和中文字體。接著交叉編譯一些MICROWIN和到的庫。
交叉編譯jpeg庫(可選)
???? JPEG源碼:jpegsrc.v6b.tar.gz
???? #tar xzvf jpegsrc.v6b.tar.gz
???? #cd jpeg-6b
???? #mkdir /home/lua/jpeg
???? #./configure --prefix=/home/lua/jpeg --exec-prefix=/home/lua/jpeg --enable-shared --enable-static
???? 修改生成的Makefile
??? #The name of your C compiler:
???? CC= gcc 改成 CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc
??? #library (.a) file creation command
?? AR= ar rc 改成 AR= /usr/local/arm/3.4.1/arm-linux/bin/ar rc
??? #second step in .a creation (use "touch" if not needed)
?? AR2= ranlib 改成 AR2= /usr/local/arm/3.4.1/arm-linux/bin/ranlib
???? 編譯,安裝
???? #make
???? #make install
交叉編譯freetype庫
???? freetype源碼:freetype-1.3.1.tar.gz
???? #tar xzvf freetype-1.3.1.tar.gz
???? #mkdir /home/lua/freetype
???? #cd freetype-1.3.1
???? #./configure --host=arm-linux --prefix=/home/lua/freetype
???? 修改CC為arm-linux-gcc
???? #vi lib/arch/unix/Makefile
???? #CC = gcc 改成 arm-linux-gcc
???? 另外如果出現test錯誤,修改Makefile,不要編譯test,這只是XLIB的example
???? 編譯,安裝
???? #make
???? #make install
修改mwinarm/config,編譯移植
??? 復制mwinarm/Configs/config.fb到mwinarm下,以這個為藍本修改config。
??? #cd mwinarm
??? #cp Configs/config.fb config
??? #vi config
CONFIG文件里面就是編譯控制選項,里面東西很多,我只挑主要的講,后面會附一張我的config文件
??? //體系選擇
??? ARCH = LINUX-ARM
??? BIGENDIAN = N
??? //編譯選項
??? OPTIMIZE = Y
??? DEBUG????? = N
??? VERBOSE = N
THREADSAFE = Y
??? //LCD的BPP
??? SCREEN_PIXTYPE??? = MWPF_TRUECOLOR565
??? //JPEG選項
HAVE_JPEG_SUPPORT??????? = Y
INCJPEG???? = /home/lua/jpeg/include
LIBJPEG????? = /home/lua/jpeg/lib/libjpeg.a
??? //truetype
??? HAVE_FREETYPE_SUPPORT??? = Y
??? INCFTLIB???????????????? = /home/lua/freetype/include
??? LIBFTLIB???????????????? = /home/lua/freetype/lib/libttf.so
FREETYPE_FONT_DIR??? = "/home/lua/mwinarm/fonts/truetype"
??? //漢字庫
HAVE_HZK_SUPPORT???????? = Y
HZK_FONT_DIR???????????? = "/home/lua/mwinarm/fonts/chinese"
??? //GB2312
??? HAVE_GB2312_SUPPORT????? = Y
??? //FRAMEBUFFER選項
??? FRAMEBUFFER????????????? = Y(這是必須的)
??? 最后MOUSE和KEYBOARD,根據你的實際情況選擇。
??? #make
??? 如果你不出錯,可以說你人品太好了。反正我出了一些錯,通過網上查找,問廣大網友和前輩。
錯誤修改:
??? impossible constraint in `asm',
??? 這個錯誤是由于FD_ZERO,FD_SET等函數引起的,如果你再深查的話,你會發現其實這幾個函數都是宏,最后的定義在include/bits/select.h里面.這個錯誤是由于包括了錯誤的頭文件,我們應該用ARM-LINUX下面的3.4.1/arm-linux/include/bits/select.h 替換掉/usr/include/bits/select.h。如果你想弄清楚為什么會出現這么個錯誤的話,你不妨比對一下這兩個文件。結果就在眼前, :)
?? ?
?? ?
?? ?
?? ?
?? ?
? ?
? ?
? ?
??? 接上篇:Makefile附件
? ?
?##################################################################
ARCH???????????????????? = LINUX-ARM
BIGENDIAN??????????????? = N
ARMTOOLSPREFIX?????????? = arm-linux-
##################################################################
# Compiling options
##################################################################
OPTIMIZE???????????????? = Y
DEBUG??????????????????? = N
VERBOSE????????????????? = N
THREADSAFE?????????????? = Y
####################################################################
# Libraries to build: microwin, nano-X, nanowidget, object frameworks
####################################################################
MICROWIN???????????????? = Y
NANOX??????????????????? = Y
SHAREDLIBS?????????????? = N
OBJFRAMEWORK???????????? = N
####################################################################
#
# Demos to build
#
####################################################################
MICROWINDEMO???????????? = Y
NANOXDEMO??????????????? = Y
####################################################################
#
# Applications to build
#
####################################################################
NANOWM?????????????????? = Y
####################################################################
#
# The pixeltype of the native hardware or underlying graphics library.
# This definition defines the PIXELVAL to be 32, 16 or 8 bits wide.
# If using Linux framebuffer, set to MWPF_TRUECOLOR0888, and use fbset.
# It also enables GdArea/GrArea for this particular pixel packing format.
#
# define MWPF_PALETTE?????? /* pixel is packed 8 bits 1, 4 or 8 pal index*/
# define MWPF_TRUECOLOR8888 /* pixel is packed 32 bits 8/8/8/8 truecolor w/alpha*/
# define MWPF_TRUECOLOR0888 /* pixel is packed 32 bits 8/8/8 truecolor*/
# define MWPF_TRUECOLOR888 /* pixel is packed 24 bits 8/8/8 truecolor*/
# define MWPF_TRUECOLOR565 /* pixel is packed 16 bits 5/6/5 truecolor*/
# define MWPF_TRUECOLOR555 /* pixel is packed 16 bits 5/5/5 truecolor*/
# define MWPF_TRUECOLOR332 /* pixel is packed 8 bits 3/3/2 truecolor*/
#
####################################################################
SCREEN_PIXTYPE?????????? = MWPF_TRUECOLOR565
####################################################################
#
# NanoX: Put Y to the following line to link the nano-X application
# with the server. This is required for ELKS, if no network is present,
# or for speed or debugging. This affects the nano-X server only.
#
####################################################################
LINK_APP_INTO_SERVER???? = N
####################################################################
# Shared memory support for Nano-X client/server protocol speedup
####################################################################
HAVE_SHAREDMEM_SUPPORT?? = N
####################################################################
#
# File I/O support
# Supporting either below drags in libc stdio, which may not be wanted
#
####################################################################
HAVE_FILEIO????????????? = Y
####################################################################
# BMP, GIF reading support
####################################################################
HAVE_BMP_SUPPORT???????? = Y
HAVE_GIF_SUPPORT???????? = Y
HAVE_PNM_SUPPORT???????? = Y
HAVE_XPM_SUPPORT???????? = Y
####################################################################
# JPEG support through libjpeg, see README.txt in contrib/jpeg
####################################################################
HAVE_JPEG_SUPPORT??????? = Y
INCJPEG????????????????? = /home/lua/jpeg/include
LIBJPEG????????????????? = /home/lua/jpeg/lib/libjpeg.a
####################################################################
# PNG support via libpng and libz
####################################################################
HAVE_PNG_SUPPORT???????? = N
INCPNG?????????????????? = /usr/include
LIBPNG?????????????????? = /usr/lib/libpng.a
LIBZ???????????????????? = /usr/lib/libz.a
####################################################################
# TIFF support through libtiff
####################################################################
HAVE_TIFF_SUPPORT??????? = N
INCTIFF????????????????? = /usr/include
LIBTIFF????????????????? = /usr/lib/libtiff.a
####################################################################
# native .fnt loadable font support
####################################################################
HAVE_FNT_SUPPORT???????? = Y
HAVE_FNTGZ_SUPPORT?????? = N
FNT_FONT_DIR???????????? = "/home/lua/mwinarm/fonts/bdf"
####################################################################
# T1 adobe type1 font support thru t1lib
####################################################################
HAVE_T1LIB_SUPPORT?????? = N
INCT1LIB???????????????? = /usr/include
LIBT1LIB???????????????? = /usr/lib/libt1.a
####################################################################
# TrueType font support thru FreeType 1.x
####################################################################
HAVE_FREETYPE_SUPPORT??? = Y
INCFTLIB???????????????? = /home/lua/freetype/include
LIBFTLIB???????????????? = /home/lua/freetype/lib/libttf.so
FREETYPE_FONT_DIR??????? = "/usr/lua/mwinarm/fonts/truetype"
####################################################################
# Support for many kinds of font thru FreeType 2.x
# Must also set FREETYPE_FONT_DIR in the Freetype 1.x section
####################################################################
HAVE_FREETYPE_2_SUPPORT = N
INCFT2LIB??????????????? = /usr/include
LIBFT2LIB??????????????? = /usr/lib/libfreetype.a
####################################################################
# PCF font support
# Selecting HAVE_PCFGZ_SUPPORT will allow you to directly read
# .pcf.gz files, but it will add libz to the size of the server
####################################################################
HAVE_PCF_SUPPORT???????? = Y
HAVE_PCFGZ_SUPPORT?????? = N
PCF_FONT_DIR???????????? = "/home/lua/mwinarm/fonts/pcf"
####################################################################
# Chinese Han Zi Ku loadable font support
####################################################################
HAVE_HZK_SUPPORT???????? = Y
HZK_FONT_DIR???????????? = "/home/lua/mwinarm/fonts/chinese"
####################################################################
# Chinese BIG5 compiled in font support (big5font.c)
####################################################################
HAVE_BIG5_SUPPORT??????? = N
####################################################################
# Chinese GB2312 compiled in font support (gb2312font.c)
####################################################################
HAVE_GB2312_SUPPORT????? = Y
####################################################################
# Japanese JISX0213 compiled in font support (jisx0213-12x12.c)
####################################################################
HAVE_JISX0213_SUPPORT??? = N
####################################################################
# Korean HANGUL font support (jo16x16.c)
####################################################################
HAVE_KSC5601_SUPPORT???? = N
####################################################################
# Japanese EUC-JP support using loadable MGL font
####################################################################
HAVE_EUCJP_SUPPORT?????? = N
EUCJP_FONT_DIR?????????? = "fonts/japanese"
####################################################################
# Generate screen driver interface only with no fonts or clipping
####################################################################
NOFONTSORCLIPPING??????? = N
####################################################################
#
# Window move algorithms for Microwindows
# Change for tradeoff between cpu speed and looks
# ERASEMOVE repaints only backgrounds while window dragging, quicker.
# Otherwise an XOR redraw is used for window moves only after button up,
# quickest (should set for ELKS)
# UPDATEREGIONS paints in update clipping region only for better look and feel
#
####################################################################
ERASEMOVE??????????????? = Y
UPDATEREGIONS??????????? = Y
####################################################################
#
# Link with Gray Palette (valid only for 4bpp modes)
#
####################################################################
GRAYPALETTE????????????? = N
####################################################################
#
# If the platform is running UNIX, Linux or RTEMS...
#
####################################################################
ifneq ($(ARCH), ELKS)
# X Window screen, mouse and kbd drivers
X11????????????????????? = N
ifeq ($(X11), Y)
# startup screen width, height, (depth for palette mode only)
SCREEN_WIDTH???????????? = 640
SCREEN_HEIGHT??????????? = 480
SCREEN_DEPTH???????????? = 4
# You may want to turn this on for XFree86 4.x or if your backing store
# isn't functioning properly
USE_EXPOSURE??????? = Y
else
# framebuffer screen driver (linear and/or vga 4 planes)
# set VTSWITCH to include virtual terminal switch code
# set FBREVERSE to reverse bit orders in 1,2,4 bpp
FBVGA??????????????????? = N
FRAMEBUFFER????????????? = Y
FBVGA??????????????????? = N
VTSWITCH???????????????? = N
FBREVERSE??????????????? = N
# set HAVETEXTMODE=Y for systems that can switch between text & graphics.
# On a graphics-only embedded system, such as Osprey and Embedded
# Planet boards, set HAVETEXTMODE=N
HAVETEXTMODE???????????? = N
# svgalib screen driver
VGALIB?????????????????? = N
# direct VGA hardware access screen driver
HWVGA??????????????????? = N
####################################################################
# Mouse drivers
# GPMMOUSE??? gpm mouse
# SERMOUSE??? serial Microsoft, PC, Logitech, PS/2 mice (/dev/psaux)
# SUNMOUSE??? Sun Workstation mouse (/dev/sunmouse)
# NOMOUSE??? no mouse driver
#
# Touchscreen drivers
# IPAQMOUSE??? Compaq iPAQ, Intel Assabet (/dev/h3600_tsraw)
# ZAURUSMOUSE??? Sharp Zaurus (/dev/sharp_ts)
# TUXMOUSE??? TuxScreen (/dev/ucb1x00-ts)
# ADSMOUSE??? Applied Data Systems GC+ (/dev/ts)
# ADS7846MOUSE??????????? ADS7846 chip, PSI OMAP Innovator (/dev/innnovator_ts)
# EPMOUSE??? Embedded Planet (/dev/tpanel)
# VHMOUSE??? Vtech Helio (/dev/tpanel)
# MTMOUSE??? MicroTouch serial (/dev/ttyS1)
# PSIONMOUSE??? Psion 5 (/dev/touch_psion)
# YOPYMOUSE??? Yopy (/dev/yopy-ts)
# HARRIERMOUSE??? NEC Harrier (/dev/tpanel)
####################################################################
GPMMOUSE???????????????? = N
SERMOUSE???????????????? = N
SUNMOUSE???????????????? = N
NOMOUSE????????????????? = N
IPAQMOUSE??????????????? = Y
ZAURUSMOUSE????????????? = N
TUXMOUSE???????????????? = N
ADSMOUSE???????????????? = N
ADS7846MOUSE???????????? = N
EPMOUSE????????????????? = N
VHMOUSE????????????????? = N
MTMOUSE????????????????? = N
PSIONMOUSE?????????????? = N
YOPYMOUSE??????????????? = N
HARRIERMOUSE???????????? = N
# keyboard or null kbd driver
TTYKBD?????????????????? = N
SCANKBD????????????????? = N
PIPEKBD????????????????? = N
IPAQKBD????????????????? = N
LIRCKBD????????????????? = N
NOKBD??????????????????? = Y
endif
####################################################################
# Screen driver specific configuration
# SA1100_LCD_LTLEND 4bpp driver with arm SA1100 LCD controller
# INVERT4BPP 4bpp inverted pixel driver for VTech Helio
####################################################################
SA1100_LCD_LTLEND??????? = N
INVERT4BPP?????????????? = N
####################################################################
#
# If the platform is a RTEMS box ....
#
####################################################################
ifeq ($(ARCH), RTEMS)
# Location & BSP information of the RTEMS build
RTEMS_BUILD????????????? = /tools/build-i386-elf-rtems
RTEMS_BSP??????????????? = pc386
LINK_APP_INTO_SERVER???? = Y
endif
endif
####################################################################
#
# If the platform is an ELKS box ...
#
####################################################################
ifeq ($(ARCH), ELKS)
# Higher speed asm driver, c driver of hercules screen driver
ASMVGADRIVER???????????? = Y
CVGADRIVER?????????????? = N
HERCDRIVER?????????????? = N
DBGDRIVER??????????????? = N
# Mouse support
SERMOUSE???????????????? = Y
endif
FLNX(FLTK)的編譯
好久沒有編譯FLNX(FLTK的嵌入式版本)了,這次公司要把FLNX的source package合并到Microwindows/nano-X的Source package中,在我單獨編譯FLNX的源碼包時出錯,最后還是解決了,我把具體的編譯步驟寫下來以便以后記得^_^: 我的配置: OS: FC6 Host linux Cross-Compiler: arm-linux-gcc 3.4.1 toolchain Microwindows: Microwindows-0.91 source code 1. 獲取源代碼包(這個就不用說了吧),如: flnx-0.18-tar.gz 2. 解壓源碼包, 如: tar zxvf flnx-0.18-tar.gz ---會在當前所在目錄下生成一個flnx的目錄 3. 確保你曾經編譯過Microwindow-0.91,因為在編譯過Microwindow時會生成一個lib的目錄,存放Microwindows 的.a/.so文件 4. 在flnx目錄下,運行configue,如: [root@localhost GUI]: ./configure --with-microwin=/home/magic/GUI/mw091full/microwindows-0.91/src --libdir=/home/magic/GUI/mw091full/microwindows-0.91/src/lib --includedir=/home/magic/GUI/mw091full/microwindows-0.91/src/include --prefix=/home/magic/GUI/mw091full/microwindows-0.91 --host=arm-linux [按回車] 5. 會提示有error, 錯誤在Fl_Animator.cxx和Fl_Animator.H文件中, 在Fl_Animator.cxx文件中的第31行改為: Fl_Animator::Fl_Animator(char *const *image, int X, int Y, int fcound, int fwidth, int fheight, int interval, const char *label=0) 中的第8個參數const char *label=0,去掉'=0'就可以了。 6. 保存并退回到上一層目錄,執行一下make clean, 再make就應該能編譯通過了^_^.
總結
以上是生活随笔為你收集整理的编译microwindow(nano-X) 及flnx-0.18的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: build FLTK 1.1.7 wit
- 下一篇: 如何在fluid中添加自定义控件