参考
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites
ビルド環境
XP SP3 32bit
VC2010 Express
start-shell-msvc2010.bat を実行
1 2 3 4 5 6 |
"Mozilla tools directory: C:\mozilla-build\" Visual C++ 10 Express directory: c:\Program Files\Microsoft Visual Studio 10.0\V C\ Windows SDK directory: C:\Program Files\Microsoft SDKs\Windows\v7.1\ Windows SDK version: 7.1 Setting environment for using Microsoft Visual Studio 2010 x86 tools. |
これは環境変数を設定した後mingwを起動するようだ。
1 |
$ cd /c; mkdir mozilla-source; cd mozilla-source |
mingwではドライブ名が/c/みたいになる。ここにソースを置く
ソースを取ってくる。時間がかかる。hgはMercurialというSCMツール
1 2 3 4 5 6 7 8 |
$ hg clone https://hg.mozilla.org/mozilla-central destination directory: mozilla-central requesting all changes adding changesets adding manifests transaction abort! rollback completed abort: connection ended unexpectedly |
失敗してるのでもう一回
1 2 3 4 5 6 7 8 9 |
$ hg clone https://hg.mozilla.org/mozilla-central destination directory: mozilla-central requesting all changes adding changesets adding manifests adding file changes added 190924 changesets with 1069942 changes to 160554 files updating to branch default 96567 files updated, 0 files merged, 0 files removed, 0 files unresolved |
ビルド
1 2 |
$ cd mozilla-central $ ./mach build |
最初に設定ファイルを作るみたいなのでもう一回
1 |
$ ./mach build |
エラー
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
3:49.78 configure: error: The Windows 8 SDK or newer is required to build Gamep ad support. Please install a newer Windows SDK or reconfigure with --disable-gam epad to disable gamepad support. 3:50.00 *** Fix above errors and then restart with\ 3:50.00 "c:/mozilla-build/mozmake/mozmake.EXE -f client.mk build " 3:50.22 c:/mozilla-source/mozilla-central/client.mk:356: recipe for target 'con figure' failed 3:50.22 mozmake.EXE[2]: *** [configure] Error 1 3:50.33 c:/mozilla-source/mozilla-central/client.mk:370: recipe for target 'obj -i686-pc-mingw32/Makefile' failed 3:50.33 mozmake.EXE[1]: *** [obj-i686-pc-mingw32/Makefile] Error 2 3:50.44 client.mk:180: recipe for target 'build' failed 3:50.44 mozmake.EXE: *** [build] Error 2 3:50.70 0 compiler warnings present. |
SDKがないというエラー、–disable-gamepadをやれば回避できるらしいのでmozconfigファイルを作成して追加。
1 2 |
$ cat mozconfig ac_add_options --disable-gamepad |
c:/mozilla-build/mozmake/mozmake.EXE -f client.mkから実行しろといわれてるので実行
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
$ /c/mozilla-build/mozmake/mozmake.exe -f client.mk c:\mozilla-source\mozilla-central\gfx\angle\src\libGLESv2\precompiled.h(38) : fa tal error C1083: include ファイルを開けません。'd3dcompiler.h': No such file or directory c:/mozilla-source/mozilla-central/config/rules.mk:986: recipe for target 'RefCou ntObject.obj' failed mozmake[5]: *** [RefCountObject.obj] Error 2 mozmake[5]: Leaving directory 'c:/mozilla-source/mozilla-central/obj-i686-pc-min gw32/gfx/angle/src/libGLESv2' c:/mozilla-source/mozilla-central/config/recurse.mk:95: recipe for target 'gfx/a ngle/src/libGLESv2/compile' failed mozmake[4]: *** [gfx/angle/src/libGLESv2/compile] Error 2 mozmake[4]: Leaving directory 'c:/mozilla-source/mozilla-central/obj-i686-pc-min gw32' c:/mozilla-source/mozilla-central/config/recurse.mk:39: recipe for target 'compi le' failed mozmake[3]: *** [compile] Error 2 mozmake[3]: Leaving directory 'c:/mozilla-source/mozilla-central/obj-i686-pc-min gw32' c:/mozilla-source/mozilla-central/config/rules.mk:577: recipe for target 'defaul t' failed mozmake[2]: *** [default] Error 2 mozmake[2]: Leaving directory 'c:/mozilla-source/mozilla-central/obj-i686-pc-min gw32' c:/mozilla-source/mozilla-central/client.mk:393: recipe for target 'realbuild' f ailed mozmake[1]: *** [realbuild] Error 2 mozmake[1]: Leaving directory 'c:/mozilla-source/mozilla-central' client.mk:180: recipe for target 'build' failed mozmake: *** [build] Error 2 |
d3dcompiler.hがないという・・・仕方ないのでJune 2010 DirectX SDK をインストール。
C:\Program Files\Microsoft DirectX SDK (June 2010)\Include\D3Dcompiler.hがあることを確認。
start-shell-msvc2010.batの下のほうにインクルードディレクトリを追加。
1 2 |
SET "INCLUDE=C:\Program Files\Microsoft DirectX SDK (June 2010)\Include;%INCLUDE%" SET "LIB=C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86;%LIB%" |
start-shell-msvc2010.batを実行してパスを確認。
1 2 3 4 5 6 7 8 9 |
$ echo $INCLUDE C:\Program Files\Microsoft DirectX SDK (June 2010)\Include;C:\Program Files\Micr osoft Visual Studio\VC98\atl\include;C:\Program Files\Microsoft Visual Studio\VC 98\mfc\include;C:\Program Files\Microsoft Visual Studio\VC98\include $ echo $LIB C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86;C:\Program Files\Micr osoft Visual Studio\VC98\mfc\lib;C:\Program Files\Microsoft Visual Studio\VC98\l ib |
1 2 |
$ ./mach clobber $ ./mach build |
途中でこんなのが出た。
1 2 3 4 5 6 7 8 9 10 |
46:00.36 =============================== 46:00.39 Visual Studio Support Available 46:00.39 46:00.41 You are building Firefox on Windows. Please help us test the experimental 46:00.42 Visual Studio project files (yes, IntelliSense works) by running the 46:00.42 following: 46:00.44 46:00.44 mach build-backend --backend=VisualStudio 46:00.44 46:00.44 =============================== |
やっと終わった
1 2 3 4 5 |
Single process terminated successfully 489:31.75 734 compiler warnings present. We know it took a while, but your build finally finished successfully! To take your build for a test drive, run: |mach run| For more information on what to do now, see https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox |
489分かかった。mach runしろとのことなので実行
途中で出たVSサポートのビルドをしてみる
1 2 3 4 5 6 7 8 9 10 11 |
$ ./mach build-backend -b VisualStudio 0:04.75 c:\mozilla-source\mozilla-central\obj-i686-pc-mingw32\_virtualenv\Scrip ts\python.exe c:\mozilla-source\mozilla-central\obj-i686-pc-mingw32\config.statu s --backend=VisualStudio Reticulating splines... Finished reading 2625 moz.build files in 50.97s Processed into 7121 build config descriptors in 71.25s Backend executed in 7.42s Generated Visual Studio solution at c:/mozilla-source/mozilla-central/obj-i686-p c-mingw32\msvc\mozilla.sln Total wall time: 130.72s; CPU time: 130.75s; Efficiency: 100%; Untracked: 1.08s |
.slnができたのでVC2010で開いてみる。いくつかのプロジェクトが読み込めなかった。Expressのせいだろうか。
F11を押してデバッグ。ビルドせずに実行した。
感想:
ビルドに時間がかかりすぎた。仮想環境で作業しながらだったが実記でやったほうがいいかもしれない。