MUDOS编译完全手册
2007/5/11 21:49:07

MUDOS编译完全手册 

    by 梁宇翀(Micro Liang)@天下创作室 
2000-10-20 
( micro_liang@hotmail.com, micro_liang@21cn.com ) 

  MudOS版本:V22Pre11 
  通常来说MudOS有以下版本: 
  Alpha 给开发者测试的版本
  Beta 给玩家测试的版本
  Preview 预发布的版本
  Release 发布的版本,即正式版 

  一、WINDOWS/VC++6·0 
  使用软件:VC++6·0,BISON 
  1、将源码解压,进入 v22p11/src 目录 
  2、将 windows 目录下所有 .mak 文件复制到上层目录 
  3、使用 VC 建立(File 中的 New)一个名为 MudOS 的 Win32 Application
    新 Workspace。选择 Project 中的 Insert Project into Workspace,
    加入项目 edit_source.mak。删除 source file 中的 local_options、
    make_func.tab.c 两个文件,在步骤4之后加入文件 make_func.c。 
  4、运行 clean.bat,生成文件 make_func.c。内容如下: 
del comptest.*
del configure.h
del efunctions.h
del efun_defs.c
del efun_protos.h
del func_spec.cpp
del grammar_tab.c
del grammar_tab.h
del grammar.c
del grammar.y
del make_func.c
del malloc.c
del mallocwrapper.c
del opc.h
del opcodes.h
del option_defs.c
del trash_me.bat 
bison make_func.y
ren malloc.h malloc.h~ 
  5、新建一个文件 cc.h,内容如下: 
/* this file automatically generated by the Makefile */
#define COMPILER "cl"
#define OPTIMIZE "-G4"
#define CFLAGS "-DWIN32 -D_ALL_SOURCE -G4"
#define OBJDIR "obj" 
  5、修改 edit_source.c,把
fprintf(yyout, "#define UINT32 unsigned long\n");
替换为:
{
#ifndef WIN32
fprintf(yyout, "#define UINT32 unsigned long\n");
#else
;
#endif

  6、编译 edit_source 项目,生成可执行文件 .\debug\edit_source.exe。 
  7、运行 grammar.bat,生成文件 grammar.c。这个文件内容如下: 
ren malloc.h~ malloc.h
.\debug\edit_source -configure
.\debug\edit_source -options -process grammar.y.pre -malloc -build_func_spec "cs
bison grammar.y 
  8、选择 Project 中的 Insert Project into Workspace,加入项目 mudos.mak。
    选择 Project 中的 Settings,在 C/C++ 的 Preprocessor definitions 中
    删除 DEBUG,增加 MSDOS 参数。 
    删除 mudos project 之 source file 中的 grammar_tab.c,增加 grammar.c
    删除 malloc.c, parser.c,增加 package/uids.c,package/mudlib_stats.c 
    将 src 中文件 grammar_tab.h 改为 grammar.h(因为 windows 的 bison
    不能产生 grammar.h,所以建议从 UNIX 上取一份版本相同的 grammar_tab.h)
    修改 lex.c 将 #include "grammar.tab.h" 改为 #include "grammar.h" 
  9、修改 backend.c 中的函数 call_heart_beat():
删除以下:
#ifdef WIN32
static long Win32Thread = -1;
#endif
删除以下:
if (Win32Thread == -1) Win32Thread = _beginthread(alarm_loop, 256, 0); 
  10、修改 crc32.h 在 compute_crc32 函数之前加入:
typedef unsigned int UINT32;
修改 crc32.c 在前面增加:
#include "crc32.h" 
  11、修改 crypt.h 中的句子
char *custom_crypt( CONST char *key, CONST char *salt, byte *rawout);

char *custom_crypt( char *key, char *salt, byte *rawout);

下一页
返回列表
返回首页
©2025 MUD游戏网_文字mud 电脑版
Powered by iwms