Chinaunix首页 | 论坛 | 博客
  • 博客访问: 966879
  • 博文数量: 261
  • 博客积分: 10026
  • 博客等级: 上将
  • 技术积分: 3420
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-24 12:10
个人简介

https://smart888.taobao.com/ 立观智能监控

文章分类

全部博文(261)

文章存档

2011年(1)

2010年(4)

2009年(256)

我的朋友

分类: LINUX

2009-03-19 11:32:26

Porting XFree86 4.2.0 for mipsel (龙芯) linux

mailto:asmcos at hotmail dot com 2003-08-25

1.环境:redhat 8.0,
tools: cross compiler gcc 2.96
XFree86 4.2.0 (xfree86.org download release )
注意:XFree86 目前支持多种CPU,这里下载的代码没有专门针对mips做改动。
需要改动的地方都是下面我们说的地方。

2.展开代码
tar zxvf X420src-1.tgz
tar zxvf X420src-2.tgz
tar zxvf X420src-3.tgz

3.修改编译选项
host.def
cross.def
见10.附件



4.增加头文件
cp /usr/include/z*.h xc/include/
主要有 zlib.h 等

5.修改
Xserver/hw/xfree86/os-support/linux/lnx_video.c
增加对mips的支持
IOPortBase = mmap(,,,,,,IO_ADDRESS);

6.修改


Xserver/hw/xfree86/common/xf86pciBus.c

#####line 2250 左右:

/*=================〉原有内容===================*/
if (pvp->ioBase) {
PV_I_RANGE(range,pvp,i,ResExcIoBlock);
if (xf86IsSubsetOf(range,res_m_io)
&& ! ChkConflict(&range,own,SETUP)
&& ! ChkConflict(&range,avoid,SETUP)
&& ! ChkConflict(&range,NonSys,SETUP)) {
xf86FreeResList(own);
continue;
}

/***********************add start ******************************************************/

if (range.rBegin <0x18000000) {

xf86FreeResList(own);
continue;
}

/*************************add end *****************************************************/
/*=========================〉原有内容====================*/
xf86MsgVerb(X_WARNING, 0,
"****INVALID IO ALLOCATION**** b: 0x%lx e: 0x%lx "
"correctinga ", range.rBegin,range.rEnd);

7.

cp /usr/include/ft2build.h export/include/


8.其他应用软件,或者XFree86 server 需要库支持例如:libz.so等,那都同编译器(或者说本地库环境

吧)有关系。如果交叉编译器所带的库比较全,应该没有什么问题。

9.其他注意事项:
动态编译的X(之X自己load库功能),有些库它不会自动load,你需要在/etc/X11/XF86Config-4增加
样例:


Section "Module"
## FBdev need modules
Load "fbdevhw"
Load "fb"
Load "shadow"
### SiS 6326 need modules
Load "xaa"
### qvwm SHAPE support
Load "extmod"

10.附件 host.def,cross.def
样例可以修改

host.def


#define DefaultGcc2i386Opt -O2 -march=i386 -mcpu=i686
#define DefaultGcc2AxpOpt -O2 -march=i386 -mcpu=i686

#define NeedModuleRanlib NO
#define ModuleCFlags $(CDEBUGFLAGS) $(CCOPTIONS) -fno-merge-constants $(THREAD_CFLAGS)

$(ALLDEFINES)
#define ModuleRanlibCmd RanlibCmd

#define HasAgpGart NO
#define HasLdRunPath NO
#define InstallXserverSetUID NO

#if 0
#define BuildServersOnly YES
#define BuildXFree86ConfigTools NO
#define HasFreetype2 YES
#define UseFreetype2 YES
#define BuildFreetype2Library NO
#define UseXserverWrapper YES
#define BuildXF86DRI YES
#define BuildXF86DRM NO
#define SharedLibXdmGreet NO
#define SharedLibXxf86dga NO
#define SharedLibXv NO
#define HaveMatroxHal NO
#define UseMatroxHal NO
#undef BuildXF86MiscExt
#define BuildXF86MiscExt YES

#define DoLoadableServer NO
#endif



#define HasPam YES
#define HasZlib YES
#define FreeTypeLibDir $(TOP)/export/lib
#define FreeTypeIncDir /usr/include/freetype
#define FreeTypeLibName ttf
#define Freetype2Dir /usr
#define Freetype2LibDir $(TOP)/export/lib
#define Freetype2IncDir /usr/include/freetype2
#define HasBlindFaithInUnicode YES
#define BuildFonts NO
#define BuildCyrillicFonts NO
#define BuildHtmlManPages NO
#define XVendorString "mipsel for BLX"
#define UseInternalMalloc NO
#define ForceNormalLib YES
#define NormalLibFont YES
#define HasGlide2 NO
#define Glide2IncDir /usr/include/glide2
#define HasGlide3 NO
#define Glide3IncDir /usr/include/glide3
#define UseGccMakeDepend NO
#define HasLinuxInput YES
#define LinkGLToUsrInclude NO
#define LinkGLToUsrLib NO


#define AdmDir /var/log
#define LbxproxyDir /etc/X11/lbxproxy
#define ProxyManagerDir /etc/X11/proxymngr
#define ServerConfigDir /etc/X11/xserver
#define XdmDir /etc/X11/xdm
#define XConfigDir /etc/X11
#define XinitDir /etc/X11/xinit




/* Make the chapter 4 and 7 manpages FHS compliant. The escape is */
/* necessary to avoid command subsitution in the here document. */
#define DriverManDir $(MANSOURCEPATH)4
#define DriverManSuffix 4x /* use just one tab or cpp will die */
#define MiscManDir $(MANSOURCEPATH)7
#define MiscManSuffix 7x /* use just one tab or cpp will die */

/* font encodings not to build */
#define BuildISO8859_3Fonts NO
#define BuildISO8859_4Fonts NO
#define BuildISO8859_10Fonts NO
#define BuildISO8859_14Fonts NO

#define CrossCompiling YES




#undef i386Architecture
#define MipsArchitecture

#undef BuildGLXLibrary
#define BuildGLXLibrary YES

#ifndef MIPSEL
#define MIPSEL
#endif

#ifndef __LITTLE_ENDIAN__
#define __LITTLE_ENDIAN__
#endif
#ifndef ByteOrder
#define ByteOrder X_LITTLE_ENDIAN
#endif

#include



cross.def

/*
* This file contains redefinitions of some symbols to enable
* cross compilation: e.g. paths for include files and paths to
* compiler images. It will have to be edited to reflect these
* given your local configuration.
*/
#undef OptimizedCDebugFlags
#define OptimizedCDebugFlags -O2 -mips2
#define ServerCDebugFlags -O2 -mips2
#undef CcCmd
#undef StdIncDir
#undef PreIncDir
#undef PostIncDir
#define CcCmd mipsel-linux-gcc
#define HasCplusplus YES
#undef CplusplusCmd
#define CplusplusCmd mipsel-linux-g++
#undef LdCmd
#define LdCmd mipsel-linux-ld
#undef AsCmd
#define AsCmd mipsel-linux-gcc -c -x assembler-with-cpp
#undef ArCmd
#define ArCmd mipsel-linux-ar cr
#define DoRanlibCmd YES
#define RanlibCmd mipsel-linux-ranlib
#undef ExtraLoadFlags
#define ExtraLoadFlags
#define FbNoPixelAddrCode
#undef TermcapLibrary
#define TermcapLibrary -ltermcap

#undef LdPreLib
#undef LdPostLib
#define LdPostLib -L$(BUILDLIBDIR) -Wl,-rpath-link,$(BUILDLIBDIR)

#undef ExtensionOSDefines
#define ExtensionOSDefines


#include
阅读(1483) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~