From Apache OpenOffice Wiki
Jump to: navigation, search

Hi! My name is Pierre Pasteau, pierrep on irc. I'm a french student from Epitech.

From Educooo, I'm glad to help the project.

I use to work with the Open-Source laboratory of my School Labfree.

I contribute to the migration from Mozilla 1.7.5 to SeaMonkey 1.1.14 (CWS :moz2seamoneky01). channels : #educooo,,#labfree,,#go-oo,#lealinux

configuration : Gentoo Linux x86, with 2.6.27-gentoo-r8 and later

Here are some information about the migration:

Introduction in

Get the source

Get the latest source of project with cvs:

$ export CVSROOT=""
$ cvs -z4 co -r DEV300_m23 OpenOffice3 swext tomcat apache-commons

Now the project using subversion, tutorial link:

Begin to read and to do exercice from this page:

Read some information about all the module in the project, here:


I do a little meeting in the morning, with ericb2 and chacha_chaudry (contributors).

I try to configure the software, whith this flags enabled :

$ cd DEV300_m23/config_office && ./configure --with-lang=ALL --with-dict=ALL --without-fonts --enable-libsn --with-system-zlib	
--with-lang=ALL     : for every language.
--with-dict=ALL     : dictionary for every language. 
--without-fonts     : no Bitstream Vera police I have already it with X.	
--with-epm=internal : solve the rpm depends

But I have got some errors, I need to install tcsh and rpm so :

$ emerge tcsh rpm 

emerge is the command of the package management system from Gentoo

ericb2 told me after that to don't have depends I must use this flags:


I need to download mozilla sources and put it in moz subdir, need the file unowinreg.dll too.

$ cd moz

Missed modules hyphen and hunspell so:

$ cvs -z4 co -r DEV300_m23 hunspell hyphen

Configuration is ok, so save the line.

Now set the setup context, and do bootstrap:

$ cd .. && source linux*.sh
$ ./bootstrap

The linux*.sh script set vars, alias and unset few vars.


Now try to compile:

$ dmake

But quicly :

first error whith moz :
{standard input}: Assembler messages:	
{standard input}:8: Error: suffix or operands invalid for `push'
this error hapenned when i386 assembler code arrive on x86_64.

I go to the moz subdir, and modified patch with :

$ dmake patch
$ dmake create_patch

But the same problem re-appear.

When try to resolv problem seen that in the Makefile x86 field is execute.

Yes, the mozilla configure detect an i686.

moz subdir

After that discover a part of the problem, I go to see the configure of mozilla.

I waste some hours, so I tryed to restore the original patch with :

$ cd moz
$ cvs up

And this time the build is ok (don't know why)

ericb2 told me to create archive of the module moz

$ dmake zip

So next time I will configure with --disable-build-mozilla

I create repertory work in moz and download seamonkey last version 1.1.11 in.

$ mkdir work

Read mozilla-source-1.7.5.patch for the first time, don't understand every things. Need to revise patch syntax :

+ line which will be add
- line which will be delete
! block which will be replace
! by this block

Other line is here to indicate the place in the code

The install don't find few of jdk header and lib, I found them :

$ ln -s /etc/java-config-2/current-system-vm/include/jni.h /usr/include
$ ln -s /etc/java-config-2/current-system-vm/include/linux/jni_md.h /usr/include
$ ln -s /etc/java-config-2/current-system-vm/include/jawt.h /usr/include
$ ln -s /etc/java-config-2/current-system-vm/include/linux/jawt_md.h /usr/include

$ ln -s /opt/sun-jdk-  /usr/lib64/
$ ln -s /opt/sun-jdk-  /usr/lib64/
$ ln -s /opt/sun-jdk-  /usr/lib64/
$ ln -s /opt/sun-jdk-  /usr/lib64/
$ ln -s /opt/sun-jdk-  /usr/lib64/
$ ln -s /opt/sun-jdk-  /usr/lib64/

Have another problem with jurt.jar and ridl.jar.

error : "class file has wrong version 50.0, should be 49.0"

It was because I do an update of jdk before the end of the dmake so

it mixed code compiled: class file version 50.0 is used by Java 6.0, and 49.0 is used by Java 5.0.

Another probleme appear:

error : "The JRE specified by the bootstrap variable UNO_JAVA_JFW_JREHOME  or  UNO_JAVA_JFW_ENV_JREHOME  could not be recognized.
	Check the values and make sure that you use a plug-in library that can recognize that JRE.javaldx failed!"


$ UNO_JAVA_JFW_ENV_JREHOME="/usr/lib/jvm/sun-jdk-1.6/" 

But nothing change, after many hours decide to take all from begin, with this time jdk-1.5 and no jdk-1.6 :

$ dmake clean

I reconfigure with this flag:


Download and install ccache 2.4 to win time if need recompilation

$ export CC="ccache gcc"
$ export CXX="ccache g++"
$ dmake

I have got a new error :

PROBLEM: magic_load(ms, "/usr/lib/rpm/magic") failed: could not find any magic files!
Try 1 : Could not execute "rpmbuild -bb RPMS/ooobasis3.0-gnome-integration.spec --target x86_64 2>&1 |"!
ERROR: "rpmbuild -bb RPMS/ooobasis3.0-gnome-integration.spec --target x86_64 2>&1 |"!
in function: create_packages_without_epm

It's a problem from my system, need to get manually the magic file of rpm from source:

$ cp /var/tmp/portage/app-arch/rpm-4.4.6-r3/work/rpm-4.4.6/rpm.magic /usr/lib/rpm/magic

Ok the compilation finished

Build end

To finish setup, we need to extract each rpm file :

$ cd /
$ rpm2cpio /home/mano/DEV23/instsetoo_native/ | cpio --extract

Warning : can't use * (globing) with rpm2cpio

If need to restore few files, rpm come from this archive :


Try to run software:

$ openoffice.org3.0
/usr/bin/openoffice.org3.0: line 2: /opt/openoffice.org3.0/program/soffice: No such file or directory
/usr/bin/openoffice.org3.0: line 2: exec: /opt/openoffice.org3.0/program/soffice: cannot execute: No such file or directory

So after looking:

$ mv /opt/openoffice.org3 /opt/openoffice.org3.0

Enjoy it !

To know milestone of a CVS repository:

$ cat /CVS/Repository ...

An example(from ericb2), with a child work space(cws):

$ cat CVS/Tag

cws name is : cws_dev300_wae4binfilter01, master workspace is dev300 (DEV300)

To download a module of this cws :

$ cvs -z4 co -r cws_dev300_wae4binfilter01 module

SeaMonkey migration

SeaMonkey Source

I modified moz/, to take seamonkey-1.1.11.source.tar.gz

Changed var MOZILLA_VERSION (1.7.5 to 1.1.11) in Linux_arch**.sh


$ cd
$ echo "sh -c \"tar -xf ../../../download/seamonkey-1.1.11.source.tar.gz\"" > seamonkey-source-1.1.11.unpack

Now dmake in moz subdir give me a general idea of the job

First patch

Theoretically Plane:

1) build on moz -> applies the patch, and fails

2) guessing the patch is unified, create a directory, and put all the .rej created during the patch application ( triggered by "build" )

3) once you are sure you collected *all* the .rej (in the

4) using whatever editor, remove all rejected hunks

5) once you are sure you try to start a new build

6) the patch must work, means, the patch application must no longer cause a breakage, this patch will be the starting point


Save patch to seamonkey-source-1.1.11.patch.1 (initial patch with errors)

Patch seamonkey source with the last mozilla patch:

$ dmake patch

Of course if failed, fuzz and offset are ok, when an hunk cannot be applied it is put in a rej file

To find each rej file:

$ find -name "*.rej" -exec \echo {} \;

We need to know the location of each rej file, I save it in a file named index:

$ find -name "*.rej" -exec \echo {} \ > work/rej_hunks/index;

Now move them in a new directory:

$ mkdir work/rej_hunks
$ find -name "*.rej" -exec \mv {} work/rej_hunks/ \;                   
(warning: files could have the same name)

Now I edit patch to remove each invalided hunks,

$ emacs seamonkey-source-1.1.11.patch

Save patch to seamonkey-source-1.1.11.patch.2 (initial patch with no errors)

Many hunks are on unfounded files, It's block configure, I move them in a new directory:

$ mkdir work/unfounded_files

Save patch to seamonkey-source-1.1.11.patch.3 (initial patch with no unfounded files)

Ok configure Now

Seamonkey And OpenOffice configure:

Now the seamonkey configure is running :

configure: error: --enable-application=APP is need

Need to add --enable-application=suite to the in the MOZ configuration flag section

To go away in the setup we need to replaced all rejected hunks

Need to change the OpenOffice checking in config_office/

$ cd config_office
$ emacs

Here the diff :

<       MOZILLA_VERSION=1.1.11
>       MOZILLA_VERSION=1.7.5
<       MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source"

To generate the new script:

$ autoconf > configure

Replaced invalided hunks:

Theoretically Plane:

1) remove the old build tree

2) create a new tree, and stop after applying the patch ($ dmake patch)

3) add one, or several hunks, manually (using whatever editor), do once done : ($ dmake create_patch)

4) repeat until all rejected hunks are included


dmake create_patch : Create a new patch (with a diff), rename the older with .bak

$ rm -rf	
$ dmake patch	

Create few folder which help us in our work:

$ mkdir work/hunks_replaced  	hunks which cannot be applied directly because the code or filename has changed
$ mkdir work/already_here    	hunks already there in new source (hunks concerning syntax, standard, perf ...)
$ mkdir work/ask_hunks		hunks when we are not sure what to do or how apply them.

The different steps are, understand the hunk, why it cannot be apply, and apply it manually

Each time we need to create new patch:

$ cat one.ex.rej | more		                                        (show the different hunks)
$ emacs one.ex				                                        (edit the concerning file, add hunks manually)
$ dmake create_patch			                                        (make a new patch with the last hunks)
$ diff seamonkey-source-1.1.11.patch seamonkey-source-1.1.11.patch.bak 	(to be sure of the changed)
$ mv work/rej_hunks/one.ex.rej work/hunks_replaced/                            (move the rej file in the correct folder)

After each rej file added, make a save of the patch.

QA checking of migration

I report all of hunks, so some of them are useless:

check : no error during build with DSO_LDOPTS (mozilla/security/coreconf/
check : nsAbMD5sum.cpp is found and compile correctly (mozilla/mailnews/addrbook/src)
check : there isn't mozilla binary, and less prerequisites (mozilla/xpfe/bootstrap/
check : if problem to a lib which don't found dependancies in the courant folder
        (mozilla/security/nss/lib/freebl/)(mozilla/security/nss/lib/nss/) with sunOS or USE_64
        (mozilla/security/nss/lib/smime/) with sunOS
        (mozilla/security/nss/lib/softoken/) with sunOS
        (mozilla/security/nss/lib/ssl/) with sunOS

check : if is found during build on win95 (mozilla/security/nss/cmd/shlibsign)
check : if keep orginals cflags not makes problem (CFLAGS +=) (mozilla/security/coreconf)
check : no problem with the -norunpath flags (mozilla/)
check : no problem with missing CYGWIN wrapper on other system that contain GNU_CC (mozilla/)
check : if no problem to find CYGWIN-cWRAPPER (mozilla/)
check : if no padding problem with MOZ_BUILD_ROOT, MOZ_TOOLS_DIR, _GLIB_PREFIX_DIR, _LIBIDL_PREFIX_DIR (mozilla/)
check : if no need HAVE_MMX_INTEL_MNEMONICS and HAVE_SSE2_INTEL_MNEMONICS on (XP_WIN32 and _M_IX86 and no __GNUC__) (mozilla/jpeg/)
check : if no need moz config file in $HOME/ (mozilla/build/autoconf/mozconfig-find)
check : if need the exp .uri in prefName string (now use uriPrefName) (mozilla/mailnews/addrbook/src/nsAbLDAPDirectory.cpp)
check : if problem with string wPassword (mozilla/mailnews/addrbook/src/nsAbLDAPDirectoryQuery.cpp)
check : if the testMD5sum  is ok on XP_PC or XP_MAC and other (mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp)
check : if error is ok when getMD5sum failed (mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp)
check : if the string m_dbMd5Sum is found in mozilla/mailnews/addrbook/src/nsAddrDatabase.cpp (mozilla/mailnews/addrbook/src/nsAddrDatabase.h)

check : if no problem with WideCharToMultiByte on win32
        (mozilla/widget/src/windows/nsDataObj.cpp)(mozilla/xpfe/bootstrap/nsNativeAppSupportWin.cpp)(mozilla/widget/src/windows/nsWindow.cpp x4 in)
check : if no problem with wcsncpy on win32 (mozilla/widget/src/windows/nsFilePicker.cpp)
check : if FTC_ImageType is found and correct (mozilla/gfx/src/ps/nsFontMetricsPS.h)
check : if NS_PTR_TO_INT32(safer on 64bit) work (mozilla/netwerk/protocol/http/src/nsHttpConnectionMgr.cpp)
check : if no problem with gResolver->resolve on win32 (mozilla/xpcom/io/nsLocalFileWin.cpp)
check : if no problem with wcsncpy, wcslen and reinterpret_cast<PRUnichar*> on win32 (mozilla/mailnews/base/src/nsMessengerWinIntegration.cpp)
check : if no problem RegQueryValueExW and RegOpenKeyExW on win32 (mozilla/uriloader/exthandler/win/nsOSHelperAppService.cpp)
check : if there are no more redefinition of IMR_RECONVERTSTRING, or APPCOMMAND_BROWSER_BACKWARD (mozilla/widget/src/windows/nsWindow.cpp)
check : if WM_IME_REQUEST is not needed (mozilla/widget/src/windows/nsWindow.cpp)
check : if no problem on win32 with MultiByteToWideChar (mozilla/widget/src/windows/nsWindow.cpp)
check : if no problem with PRUnichar on win32 (mozilla/xpcom/base/nscore.h)
check : if all librabry are find and correctly imported (mozilla/nsprpub/config/ 
check : if no error during MK_PROG or LINK_DLL (mozilla/security/coreconf/
check : if isn't conflict with mozabspath (mozilla/security/coreconf/ x4 in)

Build of moz2seamonkey01

Since has been modified, autoconf is mandatory.

The latest source of SeaMonkey (1.1.12) don't support VS2008 and need cairo higher than 0.3.0.

They can be find here:

And must be place in moz/download/

Check that your configuration doesn't have option that disable the build of SeaMonkey (default) like:


Breakage on Mac and Linux with corrupted arguments to (cause by the macro core_abspath).

We patch "moz/":

ifeq ($(OS_TARGET), Darwin)
      SRCDIR = .
ifeq ($(OS_TARGET), Darwin)
cd $(SRCDIR) ; sh ./ $(DIST) \
+   $(OBJDIR) $(OS_TARGET) \
// the same changes solved the problem on Linux too

Information from Frank on Windows build here

After some time, we migrate to Seamonkey 1.1.13 and 1.1.14 (several problems appears on it, Frank Schonheit solved them),

But the CWS go finaly go in QA.

Personal tools