2008年12月22日月曜日

QEMU 0.9.1 のビルド

MinGW + MSYS 環境は、ここらへんを参考にしつつ 作る。

MinGW 5.1.4 のインストーラを使ってデフォルトインストール (/c/mingw 以下)
MSYS 1.0.10 のインストーラを使ってデフォルトインストール) (/c/msys/1.0 以下)

MSYS Core 1.0.11 と MSYS DTK 1.0 を /c/msys 以下に適宜ディレクトリ構成を合わせて展開する。

これだけだと unistd.h が古くて、QEMU をビルドする時に getopts で引っかかるので、mingwrt-3.15.1-mingw32-dev.tar.gz と mingwrt-3.15.1-mingw32-dll.tar.gz を /mingw 以下に適宜ディレクトリ構成を合わせて展開しておく。

http://sourceforge.jp/projects/mingw/releases/35393

SDL を ./configure --prefi=/usr/local で install (これはどこでも良いと思う)。

SDL-1.2.13.tar.gz

Zlib を ./configure --prefix=/mingw で install(mingw 以下じゃないと見つけてくれない)。

zlib-1.2.3.tar.gz

QEMU を ./configure --prefix=/usr/local/QEMU などに make ; make install

qemu-0.9.1.tar.gz

ただし qemu-0.9.1/hw/omap.c の localtime_r と gmtime_r を使っているところ (4671, 4733, 4750 行目)
を comment out しておかないとコケる。

これで、とりあえずビルドは通るはず (各ターゲットの動作検証はしてない)

CPU のシミュレーションだけを行いたい場合は、--disable-sdl で、SDL をインストールしなくてもビルドできると思う。
あと、使いたいターゲットだけをビルドした方が良いと思う。

configure option

$ ./configure --help

Usage: configure [options]
Options: [defaults in brackets after descriptions]

Standard options:
--help print this message
--prefix=PREFIX install in PREFIX []
--interp-prefix=PREFIX where to find shared libraries, etc.
use %M for cpu name [/usr/gnemul/qemu-%M]
--target-list=LIST set target list []

kqemu kernel acceleration support:
--disable-kqemu disable kqemu support

Advanced options (experts only):
--source-path=PATH path of source code [/home/aloha/work/QEMU/qemu-0.9.1]
--cross-prefix=PREFIX use PREFIX for compile tools []
--cc=CC use C compiler CC [gcc]
--host-cc=CC use C compiler CC [gcc] for dyngen etc.
--make=MAKE use specified make [make]
--install=INSTALL use specified install [install]
--static enable static build [no]
--disable-werror disable compilation abort on warning
--disable-sdl disable SDL
--enable-cocoa enable COCOA (Mac OS X only)
--enable-mingw32 enable Win32 cross compilation with mingw32
--enable-adlib enable Adlib emulation
--enable-coreaudio enable Coreaudio audio driver
--enable-alsa enable ALSA audio driver
--enable-fmod enable FMOD audio driver
--enable-dsound enable DirectSound audio driver
--disable-vnc-tls disable TLS encryption for VNC server
--enable-system enable all system emulation targets
--disable-system disable all system emulation targets
--enable-linux-user enable all linux usermode emulation targets
--disable-linux-user disable all linux usermode emulation targets
--enable-darwin-user enable all darwin usermode emulation targets
--disable-darwin-user disable all darwin usermode emulation targets
--fmod-lib path to FMOD library
--fmod-inc path to FMOD includes
--enable-uname-release=R Return R for uname -r in usermode emulation
--sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9

NOTE: The object files are built at the place where configure is launched



なぜか --target-list=arm-softmmu でやったら undefined reference to `ffs' というエラーが出たので、qemu-0.9.1/hw/max7310.c や sd.c などの該当行を comment out した。

--disable-sdl --disable-gfx-check などとすると、グラフィカルアウトプットを切れるみたい。
(ただし、QEMU のサイトのサンプルイメージは、-nographic では起動しなかった)

Makefile だけ編集してもダメ。confighost.mak なども変更しないと反映されない。

0 件のコメント:

コメントを投稿