Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rebuild FireFox after modifying source code

66 views
Skip to first unread message

Sergey Shapovalov

unread,
Oct 24, 2006, 8:34:00 AM10/24/06
to dev-apps...@lists.mozilla.org
Hello all.

After I apply a minor modification to the source code
(actually, just change 1 line in 1 file), how can I rebuild
the project to see the effect? At the moment, I am not familiar
with command-line compilation good enough, so I just use the
'make -w -f client.mk' command every time as a magic phrase
that does everything for me. The only problem is that compiling
a universal binary takes more than an hour on my iMac, even if
the changes were in a single line... Can I rebuild the project
faster?

In my particular case, I'm trying to modify nsWindowWatcher.cpp.
Is it sufficient just to rebuild a dynamic library Minefield
uses at run-time? If so, what exactly should I type in Terminal?
Should I modify my mozconfig file beforehand?

Thanks in advance for any hints!

Best regards,
Sergey.

Benjamin Smedberg

unread,
Oct 24, 2006, 9:17:47 AM10/24/06
to
Sergey Shapovalov wrote:

> After I apply a minor modification to the source code
> (actually, just change 1 line in 1 file), how can I rebuild
> the project to see the effect? At the moment, I am not familiar
> with command-line compilation good enough, so I just use the
> 'make -w -f client.mk' command every time as a magic phrase
> that does everything for me. The only problem is that compiling
> a universal binary takes more than an hour on my iMac, even if
> the changes were in a single line... Can I rebuild the project
> faster?

If you are doing active development, I don't recommend making a UB. Just
make a build for your platform and test it. Once you have finished testing,
you can make a separate objdir and do a universal build.

> In my particular case, I'm trying to modify nsWindowWatcher.cpp.
> Is it sufficient just to rebuild a dynamic library Minefield
> uses at run-time? If so, what exactly should I type in Terminal?
> Should I modify my mozconfig file beforehand?

If you know what to remake you can just remake those directories in your
objdir. For instance, to remake the embedding component in a *non-static* build:

cd <objdir>/embedding/components
make

But on mac, you'll also need to remake the Minefield.app bundle:
cd <objdir>/browser/app
make repackage

If you have configured with --enable-static (the standard release
configuration), the embedding component would be linked into the final
binary and you'd have to remake browser/app.

In UB builds there are two objdirs, so you'd have to remake each objdir
separately and then glue them together again to make the UB.

--BDS

Sergey Shapovalov

unread,
Oct 25, 2006, 9:29:25 AM10/25/06
to benj...@smedbergs.us, dev-apps...@lists.mozilla.org
Benjamin,

thank you very much for your answer!

>> After I apply a minor modification to the source code
>> (actually, just change 1 line in 1 file), how can I rebuild
>> the project to see the effect? At the moment, I am not familiar
>> with command-line compilation good enough, so I just use the
>> 'make -w -f client.mk' command every time as a magic phrase
>> that does everything for me. The only problem is that compiling
>> a universal binary takes more than an hour on my iMac, even if
>> the changes were in a single line... Can I rebuild the project
>> faster?
>
> If you are doing active development, I don't recommend making a UB. Just
> make a build for your platform and test it. Once you have finished testing,
> you can make a separate objdir and do a universal build.
>

Yes, that sounds logical indeed. Am I right assuming that in
order to build native-architecture-only version (not a UB),
it is sufficient just to remove the following line from
'.mozconfig'?

. $topsrcdir/build/macosx/universal/mozconfig

>> In my particular case, I'm trying to modify nsWindowWatcher.cpp.
>> Is it sufficient just to rebuild a dynamic library Minefield
>> uses at run-time? If so, what exactly should I type in Terminal?
>> Should I modify my mozconfig file beforehand?
>
> If you know what to remake you can just remake those directories in your
> objdir. For instance, to remake the embedding component in a *non-static*
> build:
>
> cd <objdir>/embedding/components
> make
>

This doesn't work for me. The compiler says,
"No targets specified and no makefile found. Stop."
Should I pass some parameters to the 'make' command?

> But on mac, you'll also need to remake the Minefield.app bundle:
> cd <objdir>/browser/app
> make repackage
>

Error again:
"No rule to make target `repackage'. Stop."

> If you have configured with --enable-static (the standard release
> configuration), the embedding component would be linked into the final
> binary and you'd have to remake browser/app.
>

It sounds like a reasonable argument for me to change my configuration
in order to produce dynamic (non-static) builds. If I get the idea
right, I should use '.mozconfig' like this:

. $topsrcdir/browser/config/mozconfig
ac_add_options --disable-optimize
ac_add_options --enable-debug
ac_add_options --enable-shared
ac_add_options --disable-static
ac_add_options --disable-tests
ac_add_app_options ppc --enable-prebinding
ac_add_options --enable-default-toolkit=cocoa
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../build

Is everything right?

Best regards,
Sergey.

Benjamin Smedberg

unread,
Oct 25, 2006, 11:12:52 AM10/25/06
to
Sergey Shapovalov wrote:

> Yes, that sounds logical indeed. Am I right assuming that in
> order to build native-architecture-only version (not a UB),
> it is sufficient just to remove the following line from
> '.mozconfig'?
>
> . $topsrcdir/build/macosx/universal/mozconfig

Yes, though you should set MOZ_OBJDIR to something reasonable.

>
>>> In my particular case, I'm trying to modify nsWindowWatcher.cpp.
>>> Is it sufficient just to rebuild a dynamic library Minefield
>>> uses at run-time? If so, what exactly should I type in Terminal?
>>> Should I modify my mozconfig file beforehand?
>> If you know what to remake you can just remake those directories in your
>> objdir. For instance, to remake the embedding component in a *non-static*
>> build:
>>
>> cd <objdir>/embedding/components
>> make
>>
> This doesn't work for me. The compiler says,
> "No targets specified and no makefile found. Stop."
> Should I pass some parameters to the 'make' command?

You cannot do this in the source directory, you have to do it in the objdir.

--BDS

0 new messages