(用語説明)
MinGW (Minimalist GNU for Windows )とは、GNU GCC 及び binutils プロジェクトに基づいたコンパイラシステムを構築するのに使用されるランタイムヘッダ群です。
MSYS(Minimal SYStem)とは、MinGW環境でコンパイル処理を行うのに必要な最低限の命令語を備えた、UNIX動作環境です。
(1) MSYSのダウンロード http://mingw.org (2006年8月現在)
(a) MinGWのホームページの左端にあるMSYSをクリックして次画面を呼び出す。
(b) 次画面の
「MinGW - Minimal SYStem MSYS was created out of a long-lived desire to provide the MinGW community a Minimal SYStem, with which a configure script could be executed. This is finally available from the MinGW download area on SourceForge.」文中のMinGW download areaをクリックして次画面を呼び出す。
(c) 次画面のSnapshotにあるMSYS-1.0.11-2004.04.30-1.exeをダウンロード。
(2) MSYSのインストール MSYS.exeを実行
(a)バックグランドで動いているアプリケーションがないことを確認後、"Next"をクリック
(b)License同意条項ですので、読んだら"Yes"をクリック
(c) MSYS 関係の説明が書かれていますので、読んだら"Next"
(d)インストール先を選択 c:\msys
(e) コンポーネントを選択する場合には、選定後、「Next」 をクリック
(f) ソフトウェアのショートカットをスタートメニューに登録するか否かの問合せ。 不要なら、"Don'j create any icons"にマーク。
(g)インストールした構成を確認後、「Next」 をクリック
(h)インストールが始まりますが、途中で、"Do you wish to continue with the post install? 「yn」 " という質問メッセージが出ますが、これはインストレーション処理の後処理を実行するか 否かの質問ですので、”y”と応答。
(i)(次に、"Do you have MinGW installed? 「yn 」 "という質問メッセージが出ますが、 既にインストール済ですので、”y”と応答。  (j)次に、"Where is your MinGW installation? "という質問メッセージが出るので、 " c:/mingw」 "と応答。
(k)"Finish"をクリック
(2) SDL 1.2のインストール
(a) gunzip SDL-1.2.9.tar.gz
(b) tar xvf SDL-1.2.9.tar
(c) cd SDL-1.2.9 ( cd into the SDL-1.2.9 directory)
(d)  . /configure --prefix=/usr/local
(e) make (make from the SDL-1.2.9 directory to build the object code)
(f) make install (make install from the SDL-1.2.9 directory to install SDL-1.2.9)
 (g) SDL の動作確認(テストプログラムのコンパイルと実行)
 SDL のソースコードを展開したディレクトリ中の test というディレクトリに SDL のテストプログラムが用意されています.これを使って SDL が正常に動作するかどうかテスト。
(4) COBOLソースプログラム・コンパイル時に発生したエラーと対応方法
 (a) default.conf : No such file or directory
ディレクトリ付でdb-4.3.28-1.zipを解凍した後、cobc sample01.cobを実行したところ、c:\mingw\share\open-cobol\config/default.conf : No such file or directoryと表示されました。
そこで、いったん、「ファイル名のフォルダを作って解凍する」を指定してdb-4.3.28-1.zipを解凍して\share\open-cobol\configを作成し、作成したopen-cobol-0.31-1よりdefault.confをc\mingw\share\open-cobol\configにコピーして、この問題を解決。
(a) GNU MP 4.2.1 以降のバージョン 必須 http://swox.com/gmp/
c:\mingwのインストールフォルダに格納します。
・ gunzip gmp-4.1.4.tar.gz
・ tar xvf gmp-4.1.4.tar
・ cd gmp-4.1.4 (cd into the gmp-4.1.4 directory)
・ ./configure --prefix=/mingw
・ make (make from the gmp-4.1.4 directory to build the object code)
・ make install (make install from the gmp-4.1.4 directory to install gmp-4.1.4)
(b) GNU Libtool (libltdl) 必須 http://www.gnu.org/software/libtool/libtool.html
c:\mingwのインストールフォルダに格納します。
・gunzip libtool-1.5.22.tar.tz
・tar xvf libtool-1.5.22.tar
・cd libtool-1.5.22 (cd into the libtool-1.5.22 directory)
・ ./configure --prefix=/mingw
・ make (make from the libtool-1.5.22 directory to build the object code)
・ make install (make install from the libtool-1.5.22 directory to install libtool-1.5.22)
(c) Berkeley DB (libdb) 1.85以降のバージョン オプション http://www.sleepycat.com/
インデックス付ファイルの入出力とソート・マージ機能を使用する場合のオプション機能。
c:\mingwのインストールフォルダに格納します。
・ gunzip db-4.4.20.NC.tar.gz
・ tar xvf db-4.4.20.NC.tar
・ cd db-4.4.20.NC (cd into the db-4.4.20.NC directory)
・ cd build_unix
・ ../dist/configure --enable-compat185 --enable-cxx
--enable-dump185 --enable-mingw --prefix /mingw
・ make (make from the db.1.85 directory to build the object code) 実行できず
・ make install (make install from the db.1.85 directory to install db.1.85) 実行できず
最終的には、msi Windows installerをダウンロードして、db-4.4.20のインストールを完了。
注釈
Building for UNIX/POSIX
The Berkeley DB distribution uses the Free Software Foundation's autoconf and libtool tools to build on UNIX platforms. In general, the standard configuration and installation options for these tools apply to the Berkeley DB distribution.
To do a standard UNIX build of Berkeley DB, change to the build_unix directory and then enter the following two commands:
../dist/configure --prefix=/mingw
make
This will build the Berkeley DB library.
To install the Berkeley DB library, enter the following command:
make install
(d) Ncurses (libncurses) 5.5 オプション http://ftp.gnu.org/pub/gnu/ncurses/
スクリーンセクションを使用する場合のオプション機能。
c:\mingwのインストールフォルダに格納します。
・ gunzip ncurses-5.5.tar.gz
・ tar xvf ncurses-5.5.tar
・ cd ncurses-5.5 (cd into the ncurses-5.5 directory)
・ ./configure --prefix=/mingw
・ make (make from the ncurses-5.5 directory to build the object code) 実行できず
・ make install (make install from the ncurses-5.5 directory to install ncurses-5.5) 実行できず
(3) OpenCOBOLのダウンロードとインストール (必須)
http://www.opencobol.org/
c:\mingwのインストールフォルダに格納します。
・ gunzip open-cobol-0.32.tar.gz
・ tar xvf open-cobol-0.32.tar
・ cd into the open-cobol-0.32 directory
・ ./configure --prefix=/usr/local ( エラーgmp.h is required!) 実行できず
→ ../dist/configureか。
オプション --with-cc= specify C compiler command used by cobc
--with-db1 use Berkeley DB 1.85 (libdb-1.85)
--with-lfs64 use large file system for file I/O
・ make (make from the open-cobol-0.32 directory to build the object code) 実行できず
・ make install (make install from the open-cobol-0.32 directory to install open-cobol-0.32 ) 実行できず