MozTW 討論區 https://forum.moztw.org/ |
|
使用 MinGW 編譯 Firefox 的一個錯誤[已解決並成功編譯] https://forum.moztw.org/viewtopic.php?f=18&t=24090 |
第 1 頁 (共 1 頁) |
發表人: | jaywang0.tw [ 2008-08-27, 07:50 ] |
文章主題 : | 使用 MinGW 編譯 Firefox 的一個錯誤[已解決並成功編譯] |
以下是我的系統資訊 作業系統: Windows XP SP3 GCC編譯器版本: Tdm 版 4.3.0 函式庫: w32api mingw-runtime 仿 Unix Shell 環境: Msys 編譯錯誤訊息如下: 代碼: gcc -mno-cygwin -o d:/mozilla/mozilla/builds/nss/shlibsign.o -c -O2 -mno-cygwin -mms-bitfields -mnop-fun-dllimport -DXP_PC -DSHLIB_SUFFIX=\"dll\" -DSHLIB_PREFIX=\"\" -UDEBUG -U_DEBUG -DNDEBUG -DWIN32 -D_WINDOWS -D_X86_ -DWIN95 -DNSS_ENABLE_ECC -DUSE_UTIL_DIRECTLY -Id:/mozilla/mozilla/builds/dist/include/nspr -Id:/mozilla/mozilla/builds/dist/include -Id:/mozilla/mozilla/builds/dist/public/nss -Id:/mozilla/mozilla/builds/dist/private/nss -Id:/mozilla/mozilla/builds/dist/include -Id:/mozilla/mozilla/builds/dist/public/dbm -Id:/mozilla/mozilla/builds/dist/public/seccmd shlibsign.c make[5]: *** No rule to make target `d:/mozilla/mozilla/builds/dist/lib/plc4.dll.a', needed by `d:/mozilla/mozilla/builds/nss/shlibsign.exe'. Stop. make[5]: Leaving directory `/d/mozilla/mozilla/security/nss/cmd/shlibsign' make[4]: *** [libs] Error 2 make[4]: Leaving directory `/d/mozilla/mozilla/builds/security/manager' make[3]: *** [libs_tier_toolkit] Error 2 make[3]: Leaving directory `/d/mozilla/mozilla/builds' make[2]: *** [tier_toolkit] Error 2 make[2]: Leaving directory `/d/mozilla/mozilla/builds' make[1]: *** [default] Error 2 make[1]: Leaving directory `/d/mozilla/mozilla/builds' make: *** [build] Error 2 我想最關鍵的錯誤訊息應該是: 代碼: make[5]: *** No rule to make target `d:/mozilla/mozilla/builds/dist/lib/plc4.dll.a', needed by `d:/mozilla/mozilla/builds/nss/shlibsign.exe'. Stop. 打算使用 MinGW 編譯最佳化版本的 Firefox。 我已經解決了前面幾個問題了,就是這個不知道如何解決。 以下是我的 .mozconfig 代碼: . $topsrcdir/browser/config/mozconfig
CC="gcc" CXX="g++" CPP="cpp" CXXCPP="cpp" AS="as" LD="ld" mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/builds mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py' ac_add_options --disable-accessibility ac_add_options --enable-optimize="-O2" mk_add_options MOZ_CO_PROJECT=browser ac_add_options --disable-debug ac_add_options --disable-tests ac_add_options --enable-official-branding ac_add_options --disable-activex ac_add_options --disable-accessibility ac_add_options --disable-installer ac_add_options --enable-svg ac_add_options --disable-vista-sdk-requirements ac_add_options --disable-crashreporter ac_add_options --disable-updater ac_add_options --disable-debug ac_add_options --with-windows-version=501 ac_add_options --disable-tests 有誰可以幫幫忙解決這個問題。 |
發表人: | Dark Shenada [ 2008-08-27, 08:08 ] |
文章主題 : | |
Mozilla不建議使用VS Express 2008以外的環境來編譯3.0以後的Firefox歐, 另外"d:/mozilla/mozilla/builds/dist/lib/plc4.dll"才是正常的target, 所以 看來是個makefile的問題, 代碼: make[5]: *** No rule to make target `d:/mozilla/mozilla/builds/dist/lib/plc4.dll.a', needed by `d:/mozilla/mozilla/builds/nss/shlibsign.exe'. Stop.
是說"d:/mozilla/mozilla/builds/nss/shlibsign.exe" 需要 "d:/mozilla/mozilla/builds/dist/lib/plc4.dll.a" 這個library, 但是在windows下其實是"plc4.dll"而不是"plc4.dll.a", 最簡單 的修法是, 在makefile裡加一條rule讓plc4.dll的source所link 出的target為plc4.dll, 不過根本的問題事裡沒有正確config你的 build system吧, 所以make還認為他在linux下, 不然就是build system根本沒考慮到你的這種環境組態, 或是不支援你的這種環 境組態 |
發表人: | jaywang0.tw [ 2008-08-27, 09:55 ] |
文章主題 : | |
Dark Shenada 寫: 不過根本的問題事裡沒有正確config你的 build system吧, 所以make還認為他在linux下, 不然就是build system根本沒考慮到你的這種環境組態, 或是不支援你的這種環 境組態 意思是我的 .mozconfig 設定錯了??? 那要怎麼設定才能讓 build system 知道我是在 Windows 下。 Dark Shenada 寫: 最簡單
的修法是, 在makefile裡加一條rule讓plc4.dll的source所link 出的target為plc4.dll 我對於 Makefile 不太懂,我不太會修改 Makefile 檔。請問要怎麼修改? 看來我真的該學 makefile 的語法了。 如果我把 plc4.dll 複製一份成為 plc4.dll.a 這樣可以嗎?還是要建立空檔案為 plc4.dll.a 讓 build system 認為 plc4.dll.a 這個檔案存在。 |
發表人: | jaywang0.tw [ 2008-08-27, 10:21 ] |
文章主題 : | |
看了 Makefile 之後,發現應該是 configure 的問題 果然 我發現在 configure 有一個地方有點問題 以下是 configure 的片段 代碼: if test -n "$GNU_CC"; then CC="$CC -mno-cygwin" CXX="$CXX -mno-cygwin" CPP="$CPP -mno-cygwin" CFLAGS="$CFLAGS -mms-bitfields" CXXFLAGS="$CXXFLAGS -mms-bitfields" DSO_LDOPTS='-shared' MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@' MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@' RC='$(WINDRES)' # Use temp file for windres (bug 213281) RCFLAGS='-O coff --use-temp-file' # mingw doesn't require kernel32, user32, and advapi32 explicitly LIBS="$LIBS -lgdi32 -lwinmm -lwsock32" MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)' MOZ_FIX_LINK_PATHS= DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core' XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom' DLL_PREFIX= IMPORT_LIB_SUFFIX=dll.a else TARGET_COMPILER_ABI=msvc HOST_CC='$(CC)' ............................................................. 其中 代碼: IMPORT_LIB_SUFFIX=dll.a 似乎是關鍵的問題點,如果修改成 代碼: IMPORT_LIB_SUFFIX=a
應該問題會解決 |
第 1 頁 (共 1 頁) | 所有顯示的時間為 UTC + 8 小時 |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |