ONScripter のページへ

ONScripterをビルドするページ

頑張って自力でONScripterをコンパイル・ビルドするページです。
まだ不具合(文字が出ない、一部の音が再生されないなど)があります。有力な情報をお持ちの方は下記の連絡先までご連絡ください。

使用したツールと参考文献

偉大なる先人たちに感謝。

必要なもの

手順

この手順で「開く」というのは、特に指定のない限り「Terapadなどのテキストエディタで開く」ことを意味します。
また、行数が出てくることがありますが、あくまで目安です。環境によっては行数が微妙に合わないこともあります。

Cygwin の場合

インストールと初期設定

ざっくりとした説明です。
注:最近筆者は WSL しか使っていないので、今はできないかもしれません。

『Cygwin』 から「setup-x86.exe」をダウンロード(「setup-x86_64.exe」ではありません!)し、実行します。
Root directory を C:\cygwin とします。
Choose A Download site と聞かれるので、一覧から ftp://ftp.jaist.ac.jp を選択します。
Select Packeges で wget, tar, patch, autogen, autoconf, make, gperf, autopoint を選択し、 Install にセットします。
すべて終わったら、説明の都合上、ホームディレクトリを /home/user に移します。
C:\cygwin\etc\nsswitch.conf を開きます。11行目にある、

# db_home:  /home/%U

  db_home:  /home/user

に書き換えます。そしてCygwinを開きます。

コンパイラ(CeGCC)のダウンロードとインストール

コンパイラをダウンロードします。Cygwinを起動し、

wget https://github.com/HO-0520-IT/cegcc-build/releases/download/20200430/cegcc_mingw32ce_cygwin_20200430.tar.gz

を実行します。400MBほどあるので少し時間がかかります。終了したら、ファイルを展開するため、

tar xzvf cegcc_mingw32ce_cygwin_20200430.tar.gz

を実行します。展開されたファイルは /home/user/cegcc にあります。
/home/user/cegcc/usr/arm-mingw32ce に移動させます。

mv /home/user/cegcc /usr/arm-mingw32ce

Windows Subsystem for Linux (WSL) の場合

インストールと初期設定

こちらもざっくりとした説明です。

Windows のパスが WSL に入ると嫌なので、 /etc/wsl.conf を開いて、以下のようにしてください。
(これを実行すると code コマンドが使えなくなります。筆者は VS Code 側でフォルダ指定して開いているのでそんなに問題ありませんが…)

[interop]
appendWindowsPath = false

また、 usermod コマンドを使ってユーザー名とホームディレクトリを変更しておくと、後々楽です。

コンパイラ(CeGCC)のダウンロードとインストール

Brain Wiki の CeGCC のページ を見るのが早いです。

環境パス設定スクリプトの実行

cegcc.sh をダウンロードしてきて、ホームディレクトリに置きます。
そして、

source cegcc.sh

を実行します。
(注:コンパイルフラグに -O3 -g0 を入れています。デバッグがしにくいので、デバッグしたい場合は適宜変更してください。)

その後の手順

必要なものはすべて HO-0520-IT のリポジトリ にあります。
最後に -wce とつくリポジトリを(今のところは全部) git clone して、その中身を /home/user/ に移動させます。
以下はリポジトリ内の各ツールのビルド手順です。

SDL

./autogen.sh
./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared
make
make install

zlib

./configure --prefix=/usr/arm-mingw32ce
patch -p1 < makefile.patch
make

jpeg

./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared
make
make install

libpng

./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared --disable-tools --disable-tests

libmad

./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared
patch -p1 < makefile.patch
make
sudo make install

ogg

./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared
make
sudo make install

Tremor

./autogen.sh
./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared
make
sudo make install

bzip2

make libbzip2.a
sudo make install-lib

freetype

./autogen.sh
./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared --with-harfbuzz=no --enable-freetype-config
make
sudo make install

SDL_ttf

./autogen.sh
./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared --with-sdl-prefix=/usr/arm-mingw32ce --with-ft-prefix=/usr/arm-mingw32ce --disable-sdltest
patch -p1 < makefile.patch
make
sudo make install

SDL_image

./autogen.sh
./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-static --disable-shared --with-sdl-prefix=/usr/arm-mingw32ce --disable-png-shared --disable-jpg-shared --disable-webp --disable-webp-shared --disable-tif --disable-tif-shared --enable-jpg=yes --enable-png=yes
patch -p1 < makefile.patch
make
sudo make install

SDL_mixer

./autogen.sh
./configure --prefix=/usr/arm-mingw32ce --host=arm-mingw32ce --disable-shared --with-sdl-prefix=/usr/arm-mingw32ce --disable-music-midi --disable-music-timidity-midi --disable-music-native-midi --enable-music-ogg-tremor --disable-music-ogg-shared --disable-music-mp3 --disable-music-mp3-shared --disable-smpegtest --enable-music-mp3-mad-gpl --disable-sdltest
patch -p1 < makefile.patch
make
sudo make install

ONScripter

make -f Makefile.WinCE

連絡先