K-Meleon

Developers - How to Build K-Meleon

Introduction

This document explains how to build K-Meleon from the source code. We'll tell you what you need, how to set it up, and start building. Before you can compile K-Meleon, however, you will have to compile Mozilla source code that afterwards K-Meleon will use in its own build process. The documentation for that is mostly derived from Mozilla's own build documentation: http://developer.mozilla.org/en/docs/Build_Documentation.

What You Need

Unzip The Source

Create a directory where everything will go. Say, C:\projects. Create two more in there, one named mozilla and the other kmeleon. Now, unzip the respective source code packages with your favorite archive program in their respective directories.

How To Configure

You'll need a batch file in your projects directory to set-up the environment prior to compiling:

rem --- Set VCVARS to wherever the MSVC vcvars.bat file is found
set VCVARS=C:\Program Files\Microsoft Visual Studio 6\VC98\Bin\VCVARS32.BAT

rem --- Set MOZ_TOOLS to wherever you have the moztools packaged installed
set MOZ_TOOLS=C:\moztools

rem --- Set CYGWINBASE to wherever cygwin is installed
set CYGWINBASE=C:\cygwin

rem --- Prepend Cygwin path and append moztools path
rem --- This is necessary so that cygwin find is ahead of windows find.exe in the PATH, but cygwin link is after MSVC link.exe.
set PATH=%CYGWINBASE%\bin;%PATH%;%MOZ_TOOLS%

rem --- Set MSVC environment vars
call "%VCVARS%"

Next, you'll need a .mozconfig file to place in your mozilla source code directory:

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/kbuild
ac_add_options --enable-application=suite
ac_add_options --with-user-appdir="K-Meleon"

ac_add_options --enable-optimize
ac_add_options --enable-strip
ac_add_options --enable-crypto
ac_add_options --enable-extensions=cookie,wallet,xml-rpc,xmlextras,p3p,pref,transformiix,inspector,universalchardet,typeaheadfind,webservices,permissions

ac_add_options --disable-debug
ac_add_options --disable-logging
ac_add_options --disable-dtd-debug
ac_add_options --disable-tests
ac_add_options --disable-ldap        
ac_add_options --disable-postscript
ac_add_options --disable-jsd
ac_add_options --disable-composer
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --disable-installer
ac_add_options --disable-xprint
ac_add_options --disable-mailnews
ac_add_options --disable-xpinstall
ac_add_options --disable-chatzilla

For more information on mozconfig options, read this page: http://developer.mozilla.org/en/docs/Configuring_Build_Options

Build the Mozilla source code

Open a command prompt, and go to the projects directory with it. Run your batch file. Next, enter the mozilla directory, and use the following command to start building:

make -f client.mk build

Depending on the speed of your PC, this might take anywhere from a half hour to several hours.

Build K-Meleon

Note: the rest the build page is still outdated, as I haven't been able to get K-Meleon itself to compile yet.

(snip) After that, you need to open the KMeleon.dsw workspace file and check some settings (If you get dialog window asking for a urlbar.dsp and windowmanager.dsp file just hit cancel).

Right-Click 'K-Meleon classes' in your class view and select 'Set as active Project'. Now everything should be ready to compile k-meleon.

Select "Build" -> "Rebuild All" from the menu.

If anything goes wrong, check the following settings: Go to "Project" -> "Settings" and click on the "C/C++" tab. Choose "Preprocessor" from the Category pulldown menu, and then enter the following string into the "Additional include directories" textbox:

(No backslashes, these are only used for line continuation in this doc.
Or in one long line for copying directly into your project settings: BuildToolsVCSetupLine? (Can't put his here because of a glitch in the wiki engine that will make all lines as long as the longest line, as it seems)

../mozilla/mozilla/dist/include/docshell, \
../mozilla/mozilla/dist/include/dom, \
../mozilla/mozilla/dist/include/embed_base, \
../mozilla/mozilla/dist/include/exthandler, \
../mozilla/mozilla/dist/include/find, \
../mozilla/mozilla/dist/include/gfx, \
../mozilla/mozilla/dist/include/helperAppDlg, \
../mozilla/mozilla/dist/include/intl, \
../mozilla/mozilla/dist/include/layout, \
../mozilla/mozilla/dist/include/necko, \
../mozilla/mozilla/dist/include/nkcache, \
../mozilla/mozilla/dist/include/pref, \
../mozilla/mozilla/dist/include/profile, \
../mozilla/mozilla/dist/include/shistory, \
../mozilla/mozilla/dist/include/string, \
../mozilla/mozilla/dist/include/uriloader, \
../mozilla/mozilla/dist/include/wallet, \
../mozilla/mozilla/dist/include/webBrowser_core, \
../mozilla/mozilla/dist/include/webbrowserpersist, \
../mozilla/mozilla/dist/include/webshell, \
../mozilla/mozilla/dist/include/widget, \
../mozilla/mozilla/dist/include/windowwatcher, \
../mozilla/mozilla/dist/include/xpcom, \
../mozilla/mozilla/dist/include/nspr

Yup, it is very long, but you need it. When you are done, click on the "Link" tab and enter the correct path into the Output file name. The path must be set to something like

\projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin\k-meleon.exe,

but it has to be absolute, so you have to replace the "\projects" part with the absolute path to your projects directory.

Ok, click "Ok" and build the source ("Build" -> "Rebuild all").

It should build fine now, but of course, anything can go wrong, and if you don't manage to compile it, you should ask on the K-Meleon Dev forums (you knew that).

6. Configure K-Meleon

After you have successfully built K-Meleon, you probably want to try it out. Be warned though, it will miss a few files, and it won't know about your preferences. To run K-Meleon, you need to do the following:

<Your K-Meleon install dir> is the directory where you keep your work version of the K-Meleon browser. The binary release.

Copy <Your K-Meleon install dir>\components\txmgr.dll to \projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin\components

Copy <Your K-Meleon install dir>\nssckbi.dll to \projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin

Rename <Your K-Meleon install dir>\chrome\embed.jar to embed.zip, and unpack it.

Rename \projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin\chrome\embed.jar to embed.zip, and unpack it.

Copy the unpacked files from <Your K-Meleon install dir>\chrome\embed (or wherever you put them) into \projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin\chrome\embed, overwriting the existing stuff.

Zip \projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin\chrome\embed to \projects\Mozilla\mozilla\dist\WIN32_O.OBJ\bin\chrome\embed.zip, and rename it to embed.jar.

Run your K-Meleon build as follows:

k-meleon -profilesDir <Your K-Meleon install dir>\profiless This will tell the build to use your profile so that you don't lose your settings.

Ok, that should be it. Have fun!

"design by splif. Last updated: 17 Aug, 2006"
copied to the wiki and roughly edited (not tested yet) by kmbr4711. Links updated by Al. (11/04/2006) Edited and tested (except building K-Meleon) by BenoitRen?.

K-Meleon

(c) 2000-2010 kmeleonbrowser.org. All rights reserved.
design by splif.