1. download ftp://microwindows.censoft.com/pub/microwindows/ftp://microwindows.censoft.com/pub/microwindows/nxlib-0.45.tar.gz

2. modify Makefile
# set to Microwindows and X11 include and lib directories
MWIN=/sigma/nano-x
X11=/usr/X11R6

MWIN_INCLUDE=$(MWIN)/include/microwin
MWIN_LIB=$(MWIN)/lib
X11_LIB=$(X11)/lib

# set to font PCF file search directories, rgb.txt file location
X11_FONT_DIR1=/usr/share/X11/fonts/100dpi
X11_FONT_DIR2=/usr/share/X11/fonts/misc
X11_RGBTXT=/usr/share/X11/rgb.txt

# set to Y to make shared X11 libs
SHAREDLIB=N
LIBNAME = X11
xSOLIBREV = 6.1
SOLIBREV = 6.2

# set to Y to include (unmodifed X11) Xrm routines
INCLUDE_XRM=Y

# shared library dependencies and shared library install dir
SOEXTRALIBS = -L$(MWIN_LIB) -lnano-X
INSTALL_DIR = /sigma/nano-x/lib

# compiler flags
CC = arm-elf-gcc
LN = ln -s
MV = mv
RM = rm -f
DEBUG = -g

OBJS = DestWind.o MapWindow.o NextEvent.o OpenDis.o ClDisplay.o\
Window.o CrGC.o FreeGC.o StName.o Sync.o Flush.o CrWindow.o\
Text.o DrLine.o DrLines.o DrPoint.o DrRect.o DrArc.o\
MapRaised.o RaiseWin.o LowerWin.o FillRct.o CrPixmap.o Clear.o\
MoveWin.o ClearArea.o UnmapWin.o RepWindow.o\
ChWindow.o Backgnd.o BdrWidth.o Border.o PmapBgnd.o LoadFont.o\
UnloadFont.o\
DefCursor.o UndefCurs.o CrCursor.o FontCursor.o\
CrBFData.o CrPFBData.o Region.o SelInput.o Atom.o\
QueryTree.o Image.o WindowProperty.o Misc.o SetWMProps.o Bell.o\
Copy.o SetClip.o Visual.o StrToText.o SetAttributes.o FillPolygon.o\
StrKeysym.o ChProperty.o QueryPointer.o ErrorHandler.o\
ListPix.o GetGeom.o SetIFocus.o Shape.o\
font.o Free.o stub.o\
ClassHint.o Text16.o ListFonts.o QueryFont.o TextExt.o SetFontPath.o\
AllocColor.o ParseColor.o QueryColor.o Colormap.o Colorname.o Selection.o


arm-elf-ar r libnx11.a $(OBJS)

3. 修改 stub.c 在尾部增加下列 code
/* required for FLTK 2.x */
int XOpenDevice() { printf("XOpenDevice called\n"); return 0; }
int XSelectExtensionEvent { printf("XSelectExtensionEvent called\n"); return 0; }
int XListInputDevices { printf("XListInputDevices called\n"); return 0; }
int XFreeDeviceList { printf("XFreeDeviceList called\n"); return 0; }
int Xutf8LookupString { printf("Xutf8LookupString called\n"); return 0; }

3. CFLAGS="-D_XP_PRINT_SERVER_" make

4. 產生一個檔案 libnx11.a ,不要做 make intall,只對 share library 有效。

台南小新 發表在 痞客邦 PIXNET 留言(2) 人氣()


留言列表 (2)

發表留言
  • 老二
  • 對啊,偶最近在為了公司的project需要開使玩nxlib+FLTK.在linux跑.CPU是mips 4kc.您的Blog幫了很大的忙啊,nxlib+FLTK已經可以用了.現在正在搞.pcf.gz font的中文顯示.google都翻爛了,相關資料真的很少.
  • 老二
  • 照著您的步驟還是compile不過,偶又做了以下的修改,感恩啦.1.MakefileX11_INCLUDE=$(X11)/includeCFLAGS += -Wall $(DEBUG) -I$(MWIN_INCLUDE) -I$(X11_INCLUDE)2.修改 Xlcint.h/*#include "varargs.h"*/#include "stdarg.h"