Difference between revisions of "Compiling the viewer libraries LLMozLib (Linux)"
(LLMozLib for Linux) |
|||
Line 126: | Line 126: | ||
It should be possible now to build the client with MOZLIB=YES on the scons line | It should be possible now to build the client with MOZLIB=YES on the scons line | ||
* Runtime files | |||
The mozilla runtime files are all located in <code>$MOZDIR/bin/</code> and you need to copy the following folders to your secondlife viewer folder. They should live in the <code>app_settings/mozilla_runtime-linux-i686/</code> folder | |||
* chrome | |||
* components | |||
* greprefs | |||
* res | |||
* plugins | |||
* End of the line | |||
This is far as i have got so far. I believe the LLMozLib code is starting up and it is finding the files in the above folders as without them you get error messages but there is currently no html rendering of the login screen or the web profiles etc. |
Revision as of 03:12, 31 October 2007
These instructions describe building LLMozLib for Linux. They are currently incomplete so if you have further information please fill in the gaps.
So far it is possible to build LLMozLib and link a homebrew viewer against it with out errors or crashing but this has not yet resulted in the HTML rendering on the login screen or the web profile tab.
There are 3 stages
- Build mozilla
- Build LLMozLib
- Link against LLMozLib
- Build environment
I will assume a standard Linux build environment with gcc, make, g++ installed as well as various development packages (many of which are required for the viewer anyway). TODO Dependency list?
- Download LLMozLib
Get LLMozLib at this stage as you require a patch from the tar ball.
Get the snapshot of llmozlib from the source downloads page.
- Download mozilla
According to other wiki pages ( Compiling_the_viewer_libraries_(MSVS_2003)#LLMozLib ) we are using the FIREFOX_1_5_0_9_RELEASE branch of mozilla. So get that branch :-
export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
cvs login (the password is 'anonymous')
cvs checkout -r FIREFOX_1_5_0_9_RELEASE mozilla/client.mk
cd mozilla
make -f client.mk checkout MOZ_CO_PROJECT=xulrunner
- Patch mozilla
Apply a patch which enables certain features that are required for the Second Life client.
- The patch can be found in the llmozlib
build_mozilla
directory.
- Copy the patch into the directory where you are building Mozilla and apply the patch:
patch -p0 < linden_updates.patch
- Build mozilla
Assuming you are working in a directory where you have just downloaded mozilla (from above) which generated a mozilla folder and you have also downloaded and unpacked the llMozLib tarball and greated a llmozlib directory :-
To make a release build :-
cp llmozlib/build_mozilla/.mozconfig.optimized mozilla/.mozconfig
cd mozilla
make -f client.mk build
To make a debug build :-
cp llmozlib/build_mozilla/.mozconfig.debug mozilla/.mozconfig
cd mozilla
make -f client.mk build
- Build LLMozLib
This is where the hoops begin that you have to jump through, there is no make file so these are the required build flags :-
CPPFLAGS=-I${MOZDIR}/include/content -I${MOZDIR}/include/docshell -I${MOZDIR}/include/dom -I${MOZDIR}/include/gfx -I${MOZDIR}/include/layout -I${MOZDIR}/include/locale -I${MOZDIR}/include/necko -I${MOZDIR}/include/nkcache -I${MOZDIR}/include/pref -I${MOZDIR}/include/profdirserviceprovider -I${MOZDIR}/include/string -I${MOZDIR}/include/uriloader -I${MOZDIR}/include/view -I${MOZDIR}/include/webbrwsr -I${MOZDIR}/include/widget -I${MOZDIR}/include/xpcom -I${MOZDIR}/include/xulapp -I${MOZDIR}/sdk/include
CPPFLAGS += -DMOZILLA_INTERNAL_API
CPPFLAGS += -Werror -fno-rtti -fno-exceptions
CPPFLAGS += -fPIC -shared
LINKFLAGS += -lnspr4 -lplc4 -lxpcom -lxul -lstdc++
LINKFLAGS += -L${MOZDIR}/bin
Where MOZDIR is (for release build of mozilla) :-
mozilla/objdir-opt-xulrunner-small/dist
and debug build of mozilla
mozilla/objdir-debug-xulrunner-small/dist
The actual gcc commands are as follows :-
g++ -c ${CPPFLAGS} llmozlib/llembeddedbrowser.cpp
g++ -c ${CPPFLAGS} llmozlib/llembeddedbrowserwindow.cpp
g++ -c ${CPPFLAGS} llmozlib/llmozlib.cpp
g++ ${CPPFLAGS} ${LINKFLAGS} -o libllmozlib.so llembeddedbrowser.o llembeddedbrowserwindow.o llmozlib.o
That should produce a libllmozlib.so dynamic library
The following libraries should bow be copied to /usr/lib/ so they are available system wide.
install -m 0755 ${MOZDIR}/bin/libxpcom.so /usr/lib
install -m 0755 ${MOZDIR}/bin/libxul.so /usr/lib
install -m 0755 ${MOZDIR}/bin/libplds4.so /usr/lib
install -m 0755 ${MOZDIR}/bin/libplc4.so /usr/lib
install -m 0755 ${MOZDIR}/bin/libmozjs.so /usr/lib
install -m 0755 ${MOZDIR}/lib/libprofdirserviceprovider_s.a /usr/lib
install -m 0755 libllmozlib.so /usr/lib/
After that better run ldconfig
to update system libraries links.
- Build the client
It should be possible now to build the client with MOZLIB=YES on the scons line
- Runtime files
The mozilla runtime files are all located in $MOZDIR/bin/
and you need to copy the following folders to your secondlife viewer folder. They should live in the app_settings/mozilla_runtime-linux-i686/
folder
- chrome
- components
- greprefs
- res
- plugins
- End of the line
This is far as i have got so far. I believe the LLMozLib code is starting up and it is finding the files in the above folders as without them you get error messages but there is currently no html rendering of the login screen or the web profiles etc.