打造自己的mingw系统--谈谈msys 源代码编译(2)

来源:互联网 发布:particle fever 知乎 编辑:程序博客网 时间:2024/04/30 06:50

msys 核心库源码编译:

首先,下载msysCORE-1.0.11源码:

http://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/msysCORE-1.0.11-src.tar.gz/download

把它解压到硬盘上,假设为:e:/source/mingw/msysCORE-1.0.11

 

MSYS-1.0.11的安装包:

http://sourceforge.net/projects/mingw/files/MSYS/Base/msys-core/msys-1.0.11/MSYS-1.0.11.exe/download

遗憾的是MinGW-3.1.0-1.exe官方网已不再提供下载,但google上可以搜到,下载之:

 

然后在官方网下载msysDVL:

http://sourceforge.net/projects/mingw/files/Other/Unsupported/MSYS/msysDVLPR/msysDVLPR-1.0.0-alpha-1.tar.gz/download

把它解压到硬盘上,假设为:e:/msysDVL

  1. 双击MSYS-1.0.11,安装msys
  2. 安装mingw,   假设安装在c:/mingw
  3. 开始配置开发环境:

              打开msys安装目录下的etc目录,建立一个fstab文件,内容如下:

             #Win32_Path  Mount_Point
            c:/mingw                  /mingw
            E:/msysDVL            / msysDVL

           在profile 文件中PATH设定处添加/msysDVL/bin,如下所示:

# My decision to add a . to the PATH and as the first item in the path list# is to mimick the Win32 method of finding executables.## I filter the PATH value setting in order to get ready for self hosting the# MSYS runtime and wanting different paths searched first for files.if [ $MSYSTEM == MINGW32 ]; then  export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"else  export PATH=".:/usr/local/bin:/bin:/msysDVL/bin:/mingw/bin:$PATH"fi


 

                  用右键点击桌面msys快捷图标,从弹出菜单中选择“属性”,在快捷方式目标栏中加上MSYS,如图:

点击确定:

双击msys桌面图标进入系统,添加两个快捷:

 

转入msysCORE-1.0.11源码所在的路径:进入MSYS源码目录,直接执行msysrlsbld

这时候会出现编译错误:

用任何一个编辑器打开tty.cc找到217行:

else if ( 1 /*!(console =( GetConsoleWindow ())*/)


我目前直接设1 让该条件通过,保存后再编译。什么编译不了?把build路径删掉就可以了!

当你看到屏幕显示build successed,这时在nstl/bin目录中可以看到期待已久的msys-1.0.dll。

恭喜你,成功了!!!

原创粉丝点击