鶫をビルドしてみる(2)

(2) 各種ライブラリをビルドする

(2)-1. ライブラリ用ディレクトリを作成

今回、Dドライブ直下にlibというディレクトリを作成。この中でライブラリのビルドを行う。


ディレクトリ構造は記事の下部を参照



(2)-2. boostをビルド

(2)-2-1.

BoostLibrary(http://www.boost.org/)のダウンロードページ(http://sourceforge.net/projects/boost/files/boost/1.43.0/)から、boost_1_43_0.zipをD:\libにダウンロード、保存。
解凍すると、boost_1_43_0ディレクトリが作成される。(D:\lib\boost_1_43_0)

次に、http://sourceforge.net/projects/boost/files/boost-jam/3.1.18/からboost-jam-3.1.18-1-ntx86.zipをD:\libにダウンロード、保存。
解凍し、bjam.exeをD:\libに置く。(D:\lib\bjam.exe)

(2)-2-2.

D:\lib\boost_1_43_0\tools\build\v2\user-config.jamをエディタで開き、以下の記述を追加する。

using msvc : 10.0 : C:/Program\ Files/Microsoft\ Visual\ Studio\ 10.0/VC/bin/cl.exe ;

(2)-2-3.

コマンドプロンプトを起動し、D:\lib\boost_1_43_0 にカレントディレクトリを移動。

cd D:\lib\boost_1_43_0

次のコマンドを入力し、ライブラリをビルドする。

# debugビルド用
..\bjam.exe --toolset=msvc-10.0 variant=debug threading=multi link=static runtime-link=shared stage --with-date_time --with-filesystem --with-regex --with-thread
# releaseビルド用
..\bjam.exe --toolset=msvc-10.0 variant=release threading=multi link=static runtime-link=shared stage --with-date_time --with-filesystem --with-regex --with-thread

(2)-3. ICUをビルド

(2)-3-1.

ICU homepage(http://site.icu-project.org/)のダウンロードページ(http://icu-project.org/download/4.4.html#ICU4C)から、icu4c-4_4_1-src.tgzを D:lib にダウンロードして保存。
解凍すると、 icu ディレクトリが作成される。(D:\lib\icu)

(2)-3-2.

ICUライブラリを格納するディレクトリとして、D:\lib内にicu_vc10というディレクトリを作成する。(D:\lib\icu_vc10)

(2)-3-3.

コマンドプロンプトを起動し、D:\icu\source にカレントディレクトリを移動

cd D:\icu\source

(2)-3-4.

ICUVC++でビルドするためでもCygwinのサポートが必要となっている。
そのため、まずCygwinのツールを利用出来るようにするために、Cygwinのバイナリディレクトリにパスを通す。

set PATH=%PATH%;D:\cygwin\bin

次のコマンドを打ち込み、configureを行う

bash ./runConfigureICU Cygwin/MSVC --prefix=/cygdrive/d/lib/icu_vc10

そして、次の2つのコマンドを順に打ち込み、ICUのビルドは完了。

make
make install

(2)-4. wxWidgetsをビルド

(2)-4-1.

http://www.wxwindows.org/downloads/ から、wxMSW-2.8.11-Setup.exe をダウンロード。実行し、D:\wxWidgets-2.8.11 にインストール。
D:\wxWidgets\include\wx\msw\setup.h、D:\wxWidgets-2.8.11\build\msw\config.vcを以下のように編集。
※config.vcの編集はmake時にUSE_GDIPLUSを指定すればいらないかも……?

$ setup.h
line 579: #define wxUSE_GRAPHICS_CONTEXT 1

$ config.vc
line 114: USE_GDIPLUS = 1

(2)-4-1.

コマンドプロンプトを起動し、D:\wxWidgets-2.8.11\build\msw に移動。

cd D:\wxWidgets-2.8.11\build\msw

次のコマンドを打ち込み、ライブラリをビルド。

nmake -f makefile.vc SHARED=1 UNICODE=1 USE_GDIPLUS=1 BUILD=debug
nmake -f makefile.vc SHARED=1 UNICODE=1 USE_GDIPLUS=1 BUILD=release

(2)-5. パスを通す。

vsvars32.bat の中に以下を記述しておく

@set WX_DIR=D:\wxWidgets-2.8.11
@set BOOST_DIR=D:\lib\boost_1_43_0
@set ICU_DIR=D:\lib\icu_vc10

(2)-6. おわりに

現在のディレクトリ構成

/C:
┣/Program files
┃ ┗/Microsoft Visual Studio 10.0
┃   ┗/Common7
┃     ┗/Tools
┃       ┗/vsvars32.bat ... 編集すると便利

...

/D:
┣/cygwin ... TortoiseHgインストールディレクト
┣/Python26 ... Pytonインストールディレクト
┣/lib ... Pytonインストールディレクト
┃ ┣/boost_1_43_0 ... boost library directory
┃ ┃ ┣/boost ... include directory
┃ ┃ ┗/stage/lib ... library file directory
┃ ┣/icu ... ICU source directory
┃ ┗/icu_vc10 ... library file directory
┣/wxWidgets-2.8.11 ... wxWidgets directory

...


Next:(3) 鶫のソースコードをダウンロード
Prev:(1) ビルドするための環境を構築