Topic: Building Firefox from source on Win32....  (Read 4020 times)

0 Members and 1 Guest are viewing this topic.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Building Firefox from source on Win32....
« on: March 07, 2006, 09:33:12 am »
Has anybody here done it? Any tips?

I'm thinking of writing a Firefox extension or plugin in c++ and I understand I need a full Firefox source tree that builds on the development machine before beginning.

I'd prefer to use GnuWin32 packages instead of cygwin if possible. The multiple sets of instructions on building mozilla are starting to make my head hurt...

Offline Sirgod

  • Whooot Master Cattle Baron
  • Global Moderator
  • Vice Admiral
  • *
  • Posts: 27844
  • Gender: Male
Re: Building Firefox from source on Win32....
« Reply #1 on: March 07, 2006, 09:37:13 am »
I can only say, I've never done such a thing. What kinda ideas do you have for an Extension?

Stephen
"You cannot exaggerate about the Marines. They are convinced to the point of arrogance, that they are the most ferocious fighters on earth - and the amusing thing about it is that they are."- Father Kevin Keaney, Chaplain, Korean War

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #2 on: March 07, 2006, 09:58:49 am »
Hehe... top secret!  ;)  I don't really want to say what unless I can actually figure out how to do it.

Offline Mr_Tricorder

  • 3D modeler /animator
  • Hot and Spicy
  • Lt. Commander
  • *
  • Posts: 1040
  • Gender: Male
  • Trekkie at Large
    • My myspace page
Re: Building Firefox from source on Win32....
« Reply #3 on: March 07, 2006, 01:07:25 pm »
Hehe... top secret!  ;)  I don't really want to say what unless I can actually figure out how to do it.
Afraid someone's going to steal your thunder? ;)

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #4 on: March 07, 2006, 02:54:42 pm »
Nah, if someone else does it first I'd be more than happy to use it and save myself the effort. Though its pretty specialised, I highly doubt anyone else would go to the trouble. I want to use c++ which requires building Firefox from source first, as I flat out refuse to rely on the notoriously unreliable javascript (a javascript extension does not require building firefox).

I just don't want to say what it is I'm thinking of to avoid getting people's hopes up or announcing something prematurely and letting others and myself down.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #5 on: March 07, 2006, 08:19:45 pm »
Grrrrr... the configure script refuses to acknowledge my C compiler which I know works...  >:(

Quote
checking whether the C compiler (cl  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

 :huh:

This will take a little research...

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #6 on: March 08, 2006, 09:43:12 am »
Almost there... through a combination of the instructions here:
http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites_on_the_1.7_and_1.8_Branches
and here:
http://whereswalden.com/mozilla/msvcfree/
and the FAQs here:
http://developer.mozilla.org/en/docs/Mozilla_Build_FAQ#Win32-specific_questions
and the comments here:
http://whereswalden.com/mozilla/msvcfree/comments/

I figured out to call vcvars32.bat separately from the mozilla build environment script:

vcvars:
Code: [Select]
C:\PROGRA~1\MICROS~3\VC98\Bin\vcvars32.bat

my mozilla build environment script/batch:
Code: [Select]
set HOME=C:\home

set MSSDK=C:\Program Files\Microsoft Platform SDK

set MOZ_TOOLS=C:\moztools

set CYGWINBASE=C:\cygwin

set PATH=C:\Program Files\Microsoft Platform SDK\bin;C:\Perl\bin;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\bin\ide;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\bin;C:\Program Files\Microsoft Visual Studio\VC98\Bin;C:\cygwin\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\moztools\bin;C:\masm32\bin

C:
chdir C:\cygwin\bin
rename link.exe link_disabled.exe
bash --login -i

And I thought I was off to the races... however after 30 minutes of building it failed with this error:

Quote
nsViewManager.cpp(1695) : fatal error C1001: INTERNAL COMPILER ERROR
                (compiler file 'E:\8966\vc98\p2\src\P2\main.c', line 494)
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information
make[4]: *** [nsViewManager.obj] Error 2


 >:(  Grrr.... gotta look that one up... hope I didn't run out of memory.... got 640MB in, that ought to do it...

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #7 on: March 08, 2006, 09:55:03 am »
Arg! MS tells me this:

Quote
FIX: You may receive the "Fatal error C1001 Internal complier error" error message when you compile the project in Visual C++ 6.0

SYMPTOMS
When you use large macros in Microsoft Visual C++ 6.0 and you compile the project, you may receive the following error message:
fatal error C1001: INTERNAL COMPILER ERROR

RESOLUTION
To resolve this problem, obtain the latest service pack for Visual C++ 6.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
834001 (http://support.microsoft.com/kb/834001/) List of bugs that are fixed in Visual Studio 6.0 Service Pack 6

http://support.microsoft.com/?scid=kb;en-us;890892&spid=3042&sid=global

But the Firefox build instructions tell me this:

Quote
The standard compiler for Mozilla on Windows is Microsoft Visual C++, version 6. The GUI tools of the MSVC environment are not used, only the command-line tools CL (C/C++ compiler), LINK (linker), RC (resource compiler), and ML (assembler). Visual C++ Service Pack 5 and Visual C++ Processor Pack are required. Service Pack 6 is not supported. MSVC version 5 is not supported.


I'm using VC6SP5....  :huh:

I suspect I ran out of physical memory as I have a gajillion firefox windows open and firefox is currently using 133MB RAM.


Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #8 on: March 08, 2006, 10:04:00 am »
Hmmm I wonder if its an STLPort issue:

http://lists.gnu.org/archive/html/nel-all/2004-09/msg00012.html

Perhaps the firefox 1.5.0.1 source is using a newer version even though the mozilla 1.8 branch is supposed to built with VC6SP5 on Win32....

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #9 on: March 09, 2006, 07:30:55 am »
Well, I rolled back my VC includes to the originals (undoing http://www.dinkumware.com/vc_fixes.html) and reapplied SP5... no dice. I guess I'll do a little digging on the STLPort version issue.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #10 on: March 09, 2006, 08:26:04 am »
Looks like STLPort is not used in Mozilla...

However I took a look at nsViewManager.cpp(1695) and low and behold, I find this just before it...

Code: [Select]
// This gets around an internal compiler error C1001
// (compiler file 'E:\8799\vc98\p2\src\P2\main.c', line 494)
#ifdef WINCE
#pragma optimize( "", off )
#endif

AHA! Say I, but I'm not compiling for WinCE...

Perhaps I'll just comment out the #ifdef just to see what happens...


Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #11 on: March 09, 2006, 09:39:33 am »
Well the build continued for another 40 minutes then died on:

Code: [Select]
JSConsole.cpp
../../../dist/include/js\jspubtd.h(52) : error C2146: syntax error : missing ';' before identifier 'jsint'
../../../dist/include/js\jspubtd.h(52) : fatal error C1004: unexpected end of file found
make[4]: *** [JSConsole.obj] Error 2

Grrr...  >:(  another reason for me to despise javascript... whoever came up with it ought to be flogged.

edit: Aha, but I do have a Firefox.exe!  :woot:  The error above must be in the installer creation...

edit2: hmmm it doesn't look quite right, the version number is not right on the resources.... and that jspubtd.h error just should not be, it is just a typedef line and it is correct... if I recall correctly this is an error that comes up due to a problem in the preceeding code (I came a cross it building eAccelerator 0.9.5-b1)

http://andre.stechert.org/urwhatu/2006/01/error_c2143_syn.html

gonna test the exe...
« Last Edit: March 09, 2006, 09:49:48 am by Bonk »

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #12 on: March 09, 2006, 09:56:55 am »
Well the Firefox.exe I built seems to work fine, I'm posting using it now. It seems a little faster than the official binary release. I'm gonna try and correct that error in the jspubtd.h file anyway to see if the installer build will complete.

BTW, the source I'm using is: ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/1.5.0.1/source/firefox-1.5.0.1-source.tar.bz2


edit: ah, its not the installer but rather a test app:
Quote
the problem is already known, too bad Google Groups does not know it
(there is a problem atm with Google Groups only picking up some of the
posting here). See the the thread "JSConsole.cpp : jspubdt.h syntax
error on Win2k (VC6 SP5)" here in this group
(news:obadnS0ysqLDE0TeRVn-oA@mozilla.org),
https://bugzilla.mozilla.org/show_bug.cgi?id=324173 has been filed about
this. Anyway, at this time the build has basically already been finished
(what failed building here is a testing application), take a look if you
can find a firefox.exe under ff-dbg/dist/bin.

http://groups.google.com/group/mozilla.dev.builds/browse_thread/thread/ccec96a66fc244c7/105127ac314f49bd

Hmmm, I'm not sure about the workaround posted on the bugzilla thread:
https://bugzilla.mozilla.org/show_bug.cgi?id=324173
« Last Edit: March 09, 2006, 10:13:18 am by Bonk »

Offline Nemesis

  • Captain Kayn
  • Global Moderator
  • Commodore
  • *
  • Posts: 13067
Re: Building Firefox from source on Win32....
« Reply #13 on: March 09, 2006, 11:06:00 am »
Do unto others as Frey has done unto you.
Seti Team    Free Software
I believe truth and principle do matter. If you have to sacrifice them to get the results you want, then the results aren't worth it.
 FoaS_XC : "Take great pains to distinguish a criticism vs. an attack. A person reading a post should never be able to confuse the two."

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #14 on: March 15, 2006, 03:57:16 pm »
I found an easier way to my goal:

http://www.dynaverse.net/forum/index.php/topic,163353880.msg1122693011.html#msg1122693011

Which will tell you what I'm up to... I may still play with browser plugins though...

Offline Tus-XC

  • Capt
  • XenoCorp® Member
  • Commander
  • *
  • Posts: 2789
  • Gender: Male
Re: Building Firefox from source on Win32....
« Reply #15 on: March 15, 2006, 04:24:57 pm »
so are you trying to make a browser just for SFC (ie no more GSA) ;) lol
Rob

"Elige Sortem Tuam"

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Building Firefox from source on Win32....
« Reply #16 on: March 15, 2006, 05:16:20 pm »
Not exactly a gsa replacement. It's kind of hard to explain, all will be revealed eventually.   :)