耶我編譯成功了~~~
分享一下給大家看~~
我的環境:windows7,32bit版本。
首先請看Build Instructions:
https://developer.mozilla.org/En/Develo ... structionsbuild firefox只要四步驟!
一、Build prerequisites(
https://developer.mozilla.org/En/Developer_Guide/Build_Instructions/Windows_Prerequisites)
軟體需求:Microsoft Visual C++(這個我使用Visual Studio 2010)
Microsoft Windows SDK(s)(自己找來下載)
MozillaBuild(官方載點在:
http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe),下載完會安裝在c:\mozilla-build下。
二、Get the Source(
https://developer.mozilla.org/En/Developer_Guide/Source_Code/Downloading_Source_Archives)
進去網頁後,有個大標題:Download→Releases,那邊有說明ftp怎麼使用,進去裡面抓即可。
我抓的是firefox 4.0b6版本。(本來是抓現在正在使的3.6.13版,但是發現visual studio 2005或2008才能編譯;我的2010只能編譯firefox 4以後的版本)
下載完後用7-zip解壓縮(他說不要用winRAR,因為有些長度為0的檔案winRAR會解不出來...好爛科科),解壓完有個「mozilla-central」的目錄,便是這個編譯專案的home directory。
三、Configuring build options(
https://developer.mozilla.org/en/Configuring_Build_Options)
必需在home directory裡,自己建立一個「.mozconfig」檔案,裡面依規定格式填寫要建置(build)的程式及選項。
詳請請看網頁。有很多種寫法啦XD 我的.mozconfig內容是:
代碼:
. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/ff-opt
ac_add_options --disable-tests
四、Build and install(
https://developer.mozilla.org/en/Build_and_Install)
這裡我的方法跟網頁上說的不太一樣。
網頁上好像直接開cmd下make指令,但是我跑不起來QQ
有個神奇的網頁:
https://developer.mozilla.org/En/Simple_Firefox_build在Installing build tools下的windows下,有個
引言回覆:
Open a shell window by running: c:\mozilla-build\start-msvcX.bat (where X is 8 for VS 2005, and 9 for VS 2008).
照做,開cmd,執行“c:\mozilla-build\start-msvc
10.bat ”。 Visual Studio 2010的話,X=10,實驗證明。
然後他會再跑出一個cmd式的視窗,叫MinGW32的。
用cd 切換到home directory(mozilla-central)後,才下指令:
make -f client.mk build就開始編了,如果中途當掉,就看他的錯誤訊息是啥。
大概1.5hr編完。
編完後可以在mozilla-central\ff-opt\dist\bin找到firefox.exe。
這樣就完成了。
然後如果要做成安裝檔的話,在這個網頁的:「Installing Your Build」有寫:
To build a Windows installer, simply use make installer in your object directory.