Changes

Jump to: navigation, search

Liz Chak Assignment 1

1,317 bytes added, 23:21, 13 April 2009
Solution to "target `c' doesn't match the target pattern" error
Submitted by [[User:Elichak|Liz Chak]] (elichak)
 
=Introduction=
I built Firefox on Win32 using Visual Studio .NET 2005. It took me merely 45 minutes to cleanly build Mozilla (dynamic build), but literally the whole night to figure out a [[Liz_Chak_Assignment_1#Problem:_.22target_.60c.27_doesn.27t_match_the_target_pattern.22_error|problem]].
I hope this documentation will help those of you heroes who intend to make an attempt to build Firefox on a <b>Windows XP</b> operation operating system using <b>Visual Student .NET 2005</b> as the compiler. 
=Build Prerequisites=
<b>Visual Studio.NET 2005</b>
*Obtain a copy of VS.NET 2005 from [http://acs.senecac.on.ca/pages/download.php ACS downloads] {Note: You need your Seneca Learn ID or Mercury ID to access the site).
*Download [http://www.free-downloads.net/downloads/Daemon_Tools/ Daemon Tools] (or google for Daemon Tools) to extract the iso files.
*Run the installer, it will cleanly install VS.NET 2005.
**unzip -- zip file extraction (Archive category)
**zip -- zip file creation (Archive category)
 
<b>Note: Make 3.80 is no longer available in the Cygwin setup installer.</b>
<b>Make 3.80 (Important to avoid [[Liz_Chak_Assignment_1#Problem:_.22target_.60c.27_doesn.27t_match_the_target_pattern.22_error|problems]])</b>
 
*Download [http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2 Make 3.80]
*Extract it and install it
*As it is a binary package, you could just grab the Make executable file (make.exe) from <b>/usr/bin/</b> and drop it in <b>Cywgincywgin/bin</b> (this will overwrite the existing Make executable)*Double check if you have the right Make package by typing this command(change to the directory <b>cywgin/bin</b>):
<pre>
$ make -v
GNU Make 3.80
</pre>
 
=Configuration=
$/cygdrive/c/Program Files/Microsfot Visual Studio 8/VC/BIN/link
</pre>
*It will be the cygwin or Microsoft link depending on what which one you set in the <b>buildsetup.bat</b> 
==Check out mozilla source==
#Login to the mozilla CVS repository in <b>C:\proj</b>: <pre>$cvs login</pre>
#Type in <b>anonymous</b> as the password when prompted(NOTE: ignore the error message related to .cvspass)
#Checkout the build script in <b>C:\proj\</b><pre>$cvs co mozilla/browser/config mozilla/client.mk</pre>
#* A <b>C:\proj\mozilla</b> directory is created.
#* It takes awhile for the source to get downloaded. Be patient.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;&nbsp;After source is downloaded successfully, create a text file with the filename <b>.mozconfig</b> (filename should be exactly how it's spelt: .mozconfig) in the editor of your preference in <b>C:\proj\mozilla</b>
<pre>
# Building Firefox Trunk with Debugging
# I'm using Canvas for my work
ac_add_options --enable-canvas
 
# I disabled the installer
ac_add_options --disable-installer
</pre>
*Note that I have disabled static build, meaning my Firefox will build dynamically: <pre>ac_add_options --disable-static</pre> A static build is one that doesn't need external libraries to run. To run a build dynamically, you require all the development libraries and so on installed. A static build takes more time than a dynamic build.
*Note that I have disabled installer to avoid a [[Liz_Chak_Assignment_1#Problem:_.22To_build_the_installer_makensis_is_required_in_your_path.22_error|problem]] later: <pre>ac_add_options --disable-installer</pre>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;&nbsp;Get the full source from CVS (By default, you will build HEAD, which is Firefox 3.0):
<pre>
$cd \proj\mozilla
$make -f client.mk checkoutMOZ_CO_PROJECT=browser
</pre>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;&nbsp;Build the source in <b>C:\proj\mozilla</b> <pre>$make -f client.mk build</pre>
The time it takes to build Firefox depends on your machine. It could take as little as 16 minutes or as long as 3 hours! Just be patient and a miracle will happen (unless the console spurts out error code - refer to my list of [[Liz_Chak_Assignment_1#Problems_and_Solutions|problems]] if you encounter any, hopefully it helps).
Your newly built monster, I mean, Firefox will be in <b>C:\proj\mozilla\firefox-objdir\dist\bin</b>. Double click on the executable file that looks like a time-bomb minefield (and cross your fingers to hope that it wouldn't crash your system). 
=My first failed attempt to build Firefox 1.8.1=
My typical solution to any problems is "consulting" my old friend [http://www.google.com Google]. It seemed like quite a few people encountered the same problem. I found out from a forum that the problem was that I didn't have the right version of Make. I had Make 3.81 which should have been Make 3.80.
I pulled up the [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 GNU Tools for Microsoft Windows (Cygwin)] installation guide again, and realized that I have missed out the part where it mentioned <b>make 3.80 (not 3.81!) -- dependency analyzer for software builds (Devel category)</b> as one of the required packages. <b>However, when I reinstalled Cygwin again, it didn't give me an option to choose Make 3.80!! (I think this is a serious issue and should be outlined in the </b> <b>[http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 Windows Build Documentationis updated - 17:15, Sept 16 2006 (EST)]</b>
I tried various solutions (hunted for an older version of Cygwin to install and linking Make 3.80 from Cygwin with ln -s command) but my build still failed. It was frustrating, because through most of the forums that discussed about this problem, it seemed like everyone didn't have a problem "rolling back to version 3.80". However, the version of Cygwin that I installed didn't have the older version of Make and I wasn't the only person experiencing that problem at that time. Both my classmate and I tried the various solutions as per my suggestions but they all failed. After several unsuccessful attempts, I consulted [[User:Sancus|Sancus (Andrei Hajdukewycz)]] for a solution (which was easier than I thought), and the miracle happened, Firefox was then successfully built!! (Sheds a tear of joy..)
<b>[http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 Windows Build Documentation is updated - 5:15, Sept 16 2006 (EST)]</b> ==Solution to the above "target `c' doesn't match the target pattern" error==
*Install Cywgin from [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 here]
*Download [http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2 Make 3.80] (Make sure the existing version on your system is cleanly removed all else there will be version conflicts)
*If that doesn't work then just uninstall make then install version 3.80 from source.
*Extract it and install it
*As it is a binary package, you could just grab the Make executable file (make.exe) from <b>/usr/bin/</b> and drop it in <b>Cywgincywgin/bin</b> (this will overwrite the existing Make executable)*Double check if you have the right Make package by typing this command(change to the directory <b>cywgin/bin</b>):
<pre>
$ make -v
==Miscellaneous problems and solutions==
I encountered an error code when I tried to build <b>without double-checking if I check-marked all the packages required for the Firefox build during my Cygwin installation</b>. This problem will also occur if you are installing an older version of Cygwin which doesn't have all the packages required for the Firefox build. Here is a sample of the error code:
<pre>
make[2]: Entering directory '/cygdrive/c/proj/mozilla/firefox-objdir/config'
I believe this error occurred because the Make build tool couldn't find the Perl package.
 
=Minefield Screen Shot=
 
The following is a screen shot of "About Minefield" (Help -> About Minefield):
 
[[Image:Liz_minefield.jpg]]
 
=Contributors=
 
[[User:Sancus|Andrei Hajdukewycz]] (sancus)
: Helped me with placing Make 3.80 in Cygwin
 
[[User:David.humphrey|Dave Humphrey]] (dave)
: Well-documented and concise: [http://cs.senecac.on.ca/%7Edavid.humphrey/writing/firefox-win32-build.html David Humphrey's Guide to Building Firefox on Win32 using Visual Studio .NET 2005]
 
[[User:djhamp-g|David Hamp-Gonsalves]] (inveigle)
: Head start with the <b>first</b> attempt to build Firefox!
=Resources=
* [http://developer.mozilla.org/ Mozilla Developer Center]
* [http://developer.mozilla.org/en/docs/Build_Documentation Mozilla Build Documentation]
 
If it wasn't for the following people, I wouldn't have my great Firefox built:
*Special thanks to [[User:Sancus|Andrei Hajdukewycz]] (sancus) for guiding me through the most difficult part of the build process and helping me have a little more understanding of the Firefox build!!*[[User:David.humphrey|Dave Humphrey]](dave): Thanks for transferring your Firefox build knowledge. It definitely a great summary to the [http://developer.mozilla.org/en/docs/Build_Documentation Mozilla Build Documentation]. 
=Conclusion=
1
edit

Navigation menu