Education ClassRoom/Practice

From Apache OpenOffice Wiki
Jump to: navigation, search


Since we use subversion, some parts are obsolete, and need to be updated

Objective : create exercices, to practice tools used for development

TODO : define a list of items

Join the Project

Login and accounts

Find a page or a document

  • Find the web page for your own locale in project ( e.g. )
  • Find the Coding Guidelines on the Wiki ( and read it ... )
  • Find the page about cws ( Child Workspace )
  • Find mailing list archive
  • Subscribe to mailing list if you didn't yet
  • Extract mails 10 to 14 from any mailing list

Bonsai use

  • Discover Bonsai
  • Visualize changes in a cws

1) Go to

We'll try to do a request :)

2) Don't modify Module (must be All files in the repository ) Remark : note the name "repository "

3) In the Field "Branch" replace HEAD with cws_dev300_aquavcl07

4) in the field "Date" check "Since the beginning of time "

5) do not modify the other fields

6) Click "Run Query"

=> all the changes in the code, based on DEV300_m9 ( we'll explain later) are on the page !!

7) To see the diff for any commit, click in the Rev. columns. Back to retrieve the current page.

Strongly advised : 8) Look carefully at other changes, what information you can obtain here.

Remark: Bonsai helps when you are searching for changes in the code, author date .. precise information about CODE

SVN use

Ericb 16:53, 17 February 2009 (UTC)

Outline of the ClassRoom

1) Create patches using svn

2) apply a patch

3) rebuild a module

4) rebuild a module including symbols

5) run OOo with gdb (introduction of gdb use)

Introduction : in this part, we will create, apply patches using svn tool. To simplify, we'll suppose the patches are in unified mode. Means:

- 3 lines of context before the change

- a line who starts with " - " means the line before the old version (if the old version was existing)

- a line starting with " + " means after the change(s), if a new version does exist

- 3 lines of context after the change

For example :

ordinateur-de-eric-b-2:~/Desktop/ecntablet01 ericb$ svn diff sd/source/ui/slideshow/slideshow.hrc

Index: sd/source/ui/slideshow/slideshow.hrc
--- sd/source/ui/slideshow/slideshow.hrc        (revision 267130)
+++ sd/source/ui/slideshow/slideshow.hrc        (working copy)
@@ -38,8 +38,10 @@
 #define CM_SCREEN_BLACK        5
 #define CM_SCREEN_WHITE        6
 #define CM_ENDSHOW             7
-#define CM_FIRST_SLIDE 8
-#define CM_LAST_SLIDE  9
-#define CM_SLIDES              10
+#define CM_ERASE_ALLINK        8
+#define CM_ERASE_INK   9
+#define CM_FIRST_SLIDE 10
+#define CM_LAST_SLIDE  11
+#define CM_SLIDES              12

Create patches using svn

Lot of possibilities. Below some of them. Probably better solutions do exist. This is just a little inventory of the possibilities.

  • you got a tree, did some modifications, and you want to send the patch to a friend

=> The idea is to compare your current tree with the one *before* the changes.

To visualize the changes : ordinateur-de-eric-b-2:~/Desktop/moz2seamonkey01 ericb$ svn diff slideshow/source/inc/userpainteventhandler.hxx

The command (without the prompt) is :

svn diff slideshow/source/inc/userpainteventhandler.hxx

The result is :

Index: slideshow/source/inc/userpainteventhandler.hxx
--- slideshow/source/inc/userpainteventhandler.hxx      (revision 267652)
+++ slideshow/source/inc/userpainteventhandler.hxx      (working copy)
@@ -53,6 +53,9 @@
             virtual ~UserPaintEventHandler() {}
             virtual bool colorChanged( RGBColor const& rUserColor ) = 0;
+                       virtual bool eraseAllInkChanged(bool const& rEraseAllInk) =0;
+                       virtual bool eraseInkChanged(bool const& rEraseInk) =0;
             virtual bool disable() = 0;

To create the patch for true, the command is : svn diff slideshow/source/inc/userpainteventhandler.hxx > my pretty patch.diff

And " my_pretty_patch.diff " will contain the same.

  • you want to create a patch between a cws and a milestone (the one the cws is based on )

For example, to extract the changes in helpcontent2, ab65 introduced

svn diff > mydiff.diff

  • you want to create a patch between two svn revisions for a given cws

IMPORTANT: you can follow the recent commits there :

Example of change (in one line) :

svn diff

  • using svn log, you want to create the diff between two revisions of the same file

For example :

ordinateur-de-eric-b-2:~/Desktop/moz2seamonkey01 ericb$ svn log Enter passphrase for key '/Users/ericb/.ssh/id_dsa_ooo_svn':

r267684 | ericb | 2009-02-12 18:13:52 +0100 (Thu, 12 Feb 2009) | 1 line

  1. i94628# fix a path issue for finding seamonkey01

r267656 | ericb | 2009-02-12 14:13:21 +0100 (Thu, 12 Feb 2009) | 1 line

  1. i94628# other missing changes for Windows

Apply a patch

Essential options :

--dry-run : fakes the patch application *extremely usefull* if you want to check whether a patch will apply, without create garbage in your tree

-R : reverse it -> we suppose you already applied the patch, did no change and want to reverse the patch, to retrieve the same code as before

-p0 : apply a patch using the exact path the files have. Important: your tree does match with the path of the file the patch will be applied, *AND* you apply it form the right location

-p1 : you remove the first subdir of the path for every to be patched file listed in th patch

Correct way of application :

Fake the application :

patch --dry-run -p0 < my_patch.diff

If nothing wrong occurs :

patch -p0 < my_patch.diff

Other possibility, not recommended because of the UUOC (useless use of cat) :

cat my_patch.diff | patch -p0

Depth of the application:

e.g. let's suppose a patch has to modify  :

vcl/source/aqua/source/window/ vcl/source/aqua/source/gdi/salprn.cxx vcl/source/aqua/inc/salframeview.h

You can :

apply the patch from

  • the root of the sources :

patch -p0 < my_patch.diff

  • inside vcl :

patch -p1 < my_patch.diff

  • inside vcl/aqua

patch -p2 < my_patch.diff

You cannot apply patch from elsewhere, because the paths will no longer match with the one every of the file contained in it.

  • mix of applying patches + svn use

e.g. you did a wrong change in a module, and you want to reverse it directly :

cd module

svn diff apath/afile.cxx | patch -R -p0

for the entire local tree :

svn diff . | patch -R -p0

Rebuild a module where a patch has been applied

  • Introduction

We suppose we modified some files, and we need to rebuild a lib. The scheme is always the same, in every module concerned by the build.

- the first prj/build.lst does contain the modules dependencies, means all the listed modules are prerequisites - everything built inside a module is put in

e.g. on Mac OS X, type == unx , os == macx , I for Intel -> output dir is

Note: have a look in solenv/inc -> all the possible arch/os have their own makefile, containing the essential for the build.

The last modification date is used to check the dependencies.

Rule : If a .o is older than it's depenencies, it is rebuild -> once you modified a file ( touch file is enough) , build in a module will create a new lib

  • rebuild libvclmxi.dylib on Mac ( .so on Linux, .dll on Windows )

Hypothesis : we suppose the build is completed, and successfull.

cd vcl touch aqua/source/gdi/sallayout.cxx build

If you are in aqua/source/gdi , and you want to rebuild *only* the files listed in the makefile in the current dir, do :

dmake killobj build

Once done, and if you want to see the changes packaged, :

deliver cd ../instsetoo_native build # will rebuild a new installset

Else, if you just want to test your lib, put it in the right subdir (probably in <Install_dir>/ on Mac OS X )

Build including symbols


-> in vcl

cd vcl mv unxmacxi.pro_back # keep the normal build build debug="a_non_empty_sting" # means " build debug=t " is ok

The final lib, including symbols for debugging, will be in (on Mac OS X )

Replace the one already in <Install_dir>/ on Mac OS X

To debug using gdb,do :

cd <Install_dir>/

gdb --args soffice apath/afile

"r" (to start) .. and so on;

Happy debugging !

gdb basics

FIXME : make the look of the log more .. appealing ;)

Candidates ?

TODO : add my document providing the most usefull gdb commands

Outline of the ClassRoom

  • Prerequisites for the test
  • Reminder about what happens when building in a module
  • Add symbols in a library
  • Introduction of gdb use
  • Launch OOo using gdb
  • Play with it (discovery)

[18:05] ericb2 So today, we'll start playing with gdb + Ooo

[18:05] ericb2 who does have a full OOo build at hand ?

[18:06] ericb2 ok :)

[18:06] ericb2 As pre-requisites , I'll suppose :

[18:06] ericb2 - there is a complete build working already

[18:06] ericb2 - there is a working installset , and we will launch it using the terminal [18:06] ericb2 Thus, if you want to redo at home, or later, you just have to read and try

[18:07] ericb2 Reminder : what happens when something is built

[18:07] ericb2 we'll use <module> for whatever subdir of the OOo tree, aka "module" most of the time

[18:08] ericb2 <module>/prj/build.lst does contain the list of the subdirs containing a makefile

[18:08] ericb2 Means: Every product is built in the output dir. e.g. : on Mac Intel

[18:08] ericb2 we have the same tree inside all the modules:

[18:08] ericb2

[18:09] ericb2

[18:09] ericb2

[18:09] ericb2 ... and so on (look yourself )

[18:09] ericb2 to rebuild a module, just remove this directory

[18:09] ericb2 Once all the .o are build, the libs, and/or the binaries / resources / whatever are "delivered" from the dir to the solver

[18:11] ericb2 The information providing the list of what has to be delivered is always in : <module>/prj/d.lst

[18:12] ericb2 these files are text files, using a "Windows" separator, but this is not a problem at all

[18:12] * l_zahir (n=chatzill@ has joined

[18:13] ericb2 If we summarize : a normal build provides binaries like libraries, who are stripped when the are delivered. Between the and their place in the "solver "

[18:14] ericb2 Important: to be able to trace using gdb, we'll need to add symbols, lines of code and a lot of information inside the binaries

[18:14] ericb2 Howto add symbols in a library ?

[18:14] ericb2 1) first approach

[18:15] ericb2 -> look at configure extra option : --disable-strip-solver

[18:15] ericb2 To verify by yourself, just place you at the root of the sources (since DEV300_m40, there is no longer config_office subdir)

[18:15] ericb2 and do : ./configure --help | grep -4 solver

[18:16] ericb2 you'll have several lines explaining the right option

[18:16] ericb2 Tip : if you're familiar with configure, better read configure itself, more informative ;-)

[18:17] ericb2 and if you know a bit of autoconf, you can even hack, and run autoconf to regenerate a new configure :)

[18:18] ericb2 The first approach has a drawback : just a bit of information is inside the binary, and that's not enough most of the time,

when you have a complex problem to solve

[18:19] ericb2 2) second approach

[18:19] ericb2 consider only a part of the code, for tracing

[18:20] ericb2 The method is equivalent to use --enable-debug at configure time, but nobody uses this option. the reason is simple : all libraries become huges, and OOo won't probably launch correctly.

[18:21] ericb2 e.g. : the libsw (writer) becomes 660MB heavy

[18:22] fardad ericb2: when you say correctly, does it mean it will be too slow, or it will not function properly?

[18:22] Kamots wow, that's a lot of extra weight

[18:23] ericb2 fardad: yes, imagine 10 libs of 500MB every + some other 100MB and so on

[18:23] ericb2 Kamots: I'll explain you how to proceed

[18:23] fardad wow, :o

[18:24] ericb2 Other important information

[18:24] ericb2 about assertions

[18:24] ericb2 There is another option in configure

[18:24] ericb2 --enable-dbgutil

[18:25] ericb2 Include additional debugging utilities, such assertions, object counting, etc. Larger build.

[18:25] ericb2 Independent from --enable-debug

[18:25] ericb2 the *second one* does concern assertions in the code :

[18:25] ericb2 DBG_ASSERT( !(rALR.flags & kATSGlyphInfoTerminatorGlyph),

[18:25] ericb2 "ATSLayout::InitGIA(): terminator glyph not marked as deleted!" );

[18:26] ericb2 -> if the condition is not verified -> boom .. and a window will appear, containing the message

[18:26] ericb2 if --enable-dbgutil is not in the configure command line, assertions are not included

[18:27] ericb2 As you understood, assertions are for development, not for end users ;-)

[18:27] ericb2 So, we use to add symbols for debugging for some libs, in a given module only

[18:27] ericb2 Counterpart : needs to rebuild the module

[18:28] ericb2 The process is very simple :

[18:28] ericb2 cd <module>

[18:28] ericb2 mv unxmacxi.pro_backup

[18:28] ericb2 build debug=t

[18:28] ericb2 Do *always* a backup of your build, because the binaries in the output tree, do match with stamps in the solver

[18:29] ericb2 if you modify something, you'll have to redo a build, and a "deliver". Elser, the build can break at postprocess, or at then end, because the stamp between the solver and the module do not match

[18:29] ericb2 that's just harmless, but if you are not aware, you can lose a while before someone explains you what happens

[18:31] ericb2 As example, I'll rebuild a little lib , to show you the difference

[18:31] ericb2 cd apple_remote/

[18:32] ericb2 source ../

[18:32] ericb2 sorry, I forgot :-)

[18:32] ericb2 mv unxmacxi.pro_back

[18:32] ericb2 build debug=t

[18:32] ericb2 Important: whatever you put, will work

[18:33] ericb2 t is one letter, but once the string is not empty, debug is true

[18:33] ericb2 means all the code included between #ifdef DEBUG ... #endif or some other macros, will be included

[18:34] ericb2 e.g. :

[18:34] ericb2 #ifdef DEBUG

[18:34] ericb2 // debug purpose

[18:34] ericb2 NSLog(@"reset... (after listening to remote)");

[18:34] ericb2 #endif

[18:34] ericb2 -> in the terminal, I'll see the information

[18:34] ericb2 NSLog is sort of cout

[18:35] fardad ic,

[18:35] ericb2 After the rebuild :

[18:35] ericb2 ls -l

[18:35] * lgodard has quit ("Leaving.")

[18:35] ericb2 -rwxr-xr-x 1 ericb ericb 159932 Feb 19 18:31

[18:35] ericb2 ls -l unxmacxi.pro_back/lib/libAppleRemotemxi.dylib

[18:36] ericb2 -rwxr-xr-x 1 ericb ericb 52436 Feb 12 14:31 unxmacxi.pro_back/lib/libAppleRemotemxi.dylib

[18:37] ericb2 the first one does contain strings and a lot of other stuff

[18:37] ericb2 Now .. Launch OOo in a terminal :)

[18:37] ericb2 before, we'll copy the lib in the bundle

[18:37] IZBot News from cws: native227: created

[18:38] ericb2 For the rest, my bundle is in the Desktop/test_eraser folder (I'm on Mac OS X )

[18:38] ericb2 Means, the Bundle is the dir : ~/Desktop/test_eraser/

[18:38] ericb2 So, I'll open a terminal, and I'll do :

[18:39] ericb2 cd ~/Desktop/test_eraser/

[18:39] ericb2 the idea, is to start gdb form the directory containing soffice (the binary )

[18:39] ericb2 and the command line is :

[18:40] ericb2 gdb --args ~/Desktop/est.odp

[18:40] ericb2 you'll see gdb tell you a lot of things. If you don't want to see that the next time, you can add -q (for quiet) option

[18:41] ericb2 as you can see nothing happens :)

[18:41] ericb2 the reason is: the binary is not "running"

[18:42] ericb2 oops, sorry

[18:42] ericb2 gdb --args soffice ~/Desktop/est.odp

[18:42] ericb2 is the right command line

[18:42] ericb2 to redo; just enter "q"

[18:42] ericb2 and type the correct command

[18:43] ericb2 now, type r ( shortcut for "run" )

[18:43] ericb2 -> OOo will start

[18:43] ericb2 and open the file

[18:44] ericb2 in the terminal, you no longer have the control. To stop the execution, do "CTRL-C"

[18:44] ericb2 Program received signal SIGINT, Interrupt.

[18:44] ericb2 0x90009cd7 in mach_msg_trap ()

[18:44] ericb2 (gdb)

[18:44] ericb2 OOo is stopped

[18:44] ericb2 you can enter whatever command, like " info frame "

[18:45] ericb2 to continue, type : c

[18:45] ericb2 The result is : (gdb) c

[18:45] ericb2 Continuing.

[18:45] ericb2 and OOo is no longer stopped

[18:45] ericb2 Add a breakpoint

[18:45] fardad amazing...

[18:46] ericb2 fardad: I know this is difficult like that, but people will redo later, and ask whenever they want

[18:46] ericb2 on the channel

[18:46] ericb2 we'll explain them

[18:46] fardad I understand

[18:47] ericb2 Let's add a breakpoint now

[18:47] ericb2 to know whether breakpoints are set or not, the command is :

[18:47] ericb2 info b

[18:47] ericb2 (means info breakpoints)

[18:48] ericb2 exactly :

[18:48] ericb2 CTRL-C

[18:48] ericb2 info b

[18:48] ericb2 The result is :

[18:48] ericb2 (gdb) info b

[18:48] ericb2 No breakpoints or watchpoints.

[18:48] ericb2 of course

[18:48] ericb2 so let's set one

[18:49] ericb2 Since only libAppleRemotemxi.dylib has symbols, I'll have to set one in whatever file included

[18:49] ericb2 say RemoteMainController.m

[18:49] ericb2 We can either choose a method

[18:50] ericb2 Syntax : b 'class:myMethod'

[18:50] ericb2 or at some line :

[18:50] ericb2 Syntax : b RemoteMainController.m:118

[18:50] ericb2 The result is :

[18:50] ericb2 (gdb) b RemoteMainController.m:118

[18:50] ericb2 Breakpoint 1 at 0x338e1ea: file RemoteMainController.m, line 118.

[18:51] ericb2 and using the up/down arrow, the history is available (no need to type several times the same command ;)

[18:51] ericb2 (gdb) info b

[18:51] ericb2 Num Type Disp Enb Address What

[18:51] ericb2 1 breakpoint keep y 0x0338e1ea in -[MainController remoteButton:pressedDown:clickCount:] at RemoteMainController.m:118

[18:52] ericb2 The line is inside a method, I'll hit every time I'll be in presentation mode, and when I'll hit a key

[18:53] ericb2 start the presentation, and when I type a key, I see:

[18:53] ericb2 Breakpoint 1, -[MainController remoteButton:pressedDown:clickCount:] (self=0x3433bf0, _cmd=0x338f994, buttonIdentifier=kRemoteButtonPlay, pressedDown=1 '\001', clickCount=1) at RemoteMainController.m:118

[18:53] ericb2 118 pressed = @"(pressed)";

[18:54] ericb2 and the presentation is stopped

[18:54] ericb2 to continue, I have several choices :

[18:54] ericb2 n -> next instruction

[18:54] ericb2 s -> next group of instruction

[18:54] ericb2 c -> continue

[18:54] ericb2 l does list the matching code

[18:55] ericb2 For instance :

[18:55] ericb2 (gdb) l

[18:55] ericb2 113 #ifdef DEBUG

[18:55] ericb2 114 NSString* buttonName = nil;

[18:55] ericb2 115 #endif

[18:55] ericb2 116 if (pressedDown)

[18:55] ericb2 117 {

[18:55] ericb2 118 pressed = @"(pressed)";

[18:55] ericb2 119

[18:55] ericb2 120 #ifdef DEBUG

[18:55] ericb2 121 switch(buttonIdentifier)

[18:55] ericb2 122 {

[18:55] ericb2 Current language: auto; currently objective-c

[18:55] ericb2 (gdb)

[18:55] ericb2 I can go up or continue

[18:55] ericb2 and if I need info, I can check for the stack of frames

[18:56] ericb2 (gdb) bt

[18:56] ericb2 -> will return the frames, in *reverse* order. Means, the #0 is the last one, and #1 the one before .. and so on [ 18:56] IZBot no issue with number 1

[18:56] ericb2 ooops :-)

[18:57] ericb2 Lets choose "n" for next

[18:57] ericb2 The result is :

[18:57] ericb2 (gdb) n

[18:57] ericb2 121 switch(buttonIdentifier)

[18:57] ericb2 IMPORTANT: the current line is NOT executed yet

[18:57] ericb2 e.g. if you have a= 10;

[18:57] ericb2 p a

[18:57] ericb2 can return whatevert

[18:58] ericb2 *only* n will validate the line. This is the context

[18:58] ericb2 execution context

[18:58] ericb2 n will continue ..

[18:58] ericb2 (gdb) n

[18:58] ericb2 126 case kRemoteButtonPlay: buttonName = @"Play"; break; // MEDIA_COMMAND_PLAY

[18:59] ericb2 and of course, we can check for the variable :

[18:59] ericb2 (gdb) p buttonIdentifier

[18:59] ericb2 $1 = kRemoteButtonPlay

[18:59] ericb2 so, it means the slideshow will start ...

[19:00] ericb2 Next instruction :

[19:00] ericb2 (gdb) n

[19:00] ericb2 140 [ self postTheEvent:buttonIdentifier modifierFlags: 0 ];

[19:00] ericb2 -> means the remote sent a "Play" and I'll inform the vcl there is an event, containing the "Play" information. vcl will forward to Impress, and the slideshow will start

[19:01] * jza (n=jza@ has joined

[19:02] * xerakko (n=Miguel@debian/developer/xerakko) has joined

[19:02] ericb2 This is only the introduction (if people are intersted, we can do another workshop about gdb another day )

[19:02] ericb2 To quit *cleanly*

[19:02] ericb2 delete the brekapoints :

[19:02] ericb2 d

[19:02] ericb2 confirm with yest

[19:02] ericb2 yes

[19:02] * lgodard ( has joined

[19:02] ericb2 c

[19:02] ericb2 to continue

[19:02] ericb2 and then Quit OOo using CMD Q

[19:03] ericb2 The result is :

[19:03] ericb2 Program exited normally.

[19:03] ericb2 (gdb)

[19:03] ericb2 Then quit gdb :

[19:03] ericb2 q

[19:03] ericb2 -> will give you the normal prompt

[19:03] ericb2 back

[19:03] ericb2 Questions ?

[19:04] * WFred__ ( has joined

[19:04] BartB not at the moment, might have some later

[19:05] ericb2 I forgot, to affect a value, the command is "set"

[19:05] ericb2 e.g. :

[19:05] MrBraini ericb2: last lecture you stated the notes from the lectures will be placed on the wiki? where can we find the notes in the wiki?

[19:05] ericb2 (gdb) : set a=10

[19:05] daeseon_ not now may be later.

[19:05] ericb2 MrBraini: I'll put them on the wiki, yes

[19:05] l_zahir is there a y way so we can see multiple line before their execution?

[19:05] l_zahir lgodard

[19:05] ericb2 l_zahir: list ?

[19:05] ericb2 l_zahir: l is the shortcut

[19:06] ericb2 l_zahir: I forgot, there is another way to break, using conditional breakpoint

[19:06] l_zahir oksu during debugging or before?

[19:06] ericb2 l_zahir : you can go up and down in the frames

[19:06] l_zahir lgodard

[19:06] ericb2 l_zahir to retrieve a context

[19:06] l_zahir ok , thanks

[19:07] ericb2 l_zahir: I think, the best is to redo a workshop, with everything ready

[19:07] ericb2 l_zahir: but nothing will replace the experiences [ 19:07] l_zahir sure

[19:08] <ericb2> l_zahir: no problem.

[19:08] <ericb2> BTW, I provided a patch for rhino and scripting

[19:08] <l_zahir> Oh, good :)

[19:08] <ericb2> was my fault: two modules where concerned, and this is what caused some issues

[19:08] <ericb2> l_zahir: one minute, I'll retrive the URL

[19:09] <l_zahir> thanks

[19:09] <l_zahir> :)

[19:09] <ericb2>

[19:09] <ericb2> l_zahir: this patch should apply cleanly on m40

[19:09] <ericb2> l_zahir: not sure it will work, I'm not a Java specialist ;)

[19:10] <ericb2> ok, I'll have to stop.

[19:10] <l_zahir> I'll try

[19:10] <ericb2> If you have further questions, ask directly, and if I see them, I'll answer

[19:10] * Remaille ( has joined

[19:10] * ChanServ gives channel operator status to Remaille

[19:11] <l_zahir> sure

[19:11] <ericb2> Other questions ?

[19:12] <ericb2> If you have no other questions, I'll stop for a while, but in ~2 hours max, I'll be back.

[19:12] <ericb2> The content of the classroom will be on the wiki

LXR use

[Complete me]

Checkout the code


- we suppose you have some bash knowledge, and some programming skills

- your .cvsrc file is ok (else ask on )

Now, open a terminal, use bash, and do :

0 ) create the environment

If you don't have a proxy, do , (in a terminal) :

export CVSROOT=""

There is a proxy, and nothing works using the line above, do, (in a terminal) :

Let the proxy be ( name ) , and the open port 1234, then just do :

export CVSROOT=":pserver;proxy=;"

And if you ignore the IP address of the gateway, but you know its name, do, (in a terminal) :

export CVSROOT=":pserver;;"

IMPORTANT : is just a fake name, as example. Please replace it with the one in your network :)

... it should work now (else, contact your sys admin).

For the next step, create TMP dir (command: mkdir TMP )

cd TMP

1) checkout vcl module from DEV300_m31

cvs co -r DEV300_m31 dtrans

Question: what happens ?

Download all tree :

mkdir DEV300_m31

cd DEV300_m31

cvs -4 co -r DEV300_m31 OpenOffice2

( -z4 is optional )

-> once done ( can be very long), and if no error occurs, you got all source code from DEV300_m31 Milestone !!

Create a patch

2) Modify one file, do "cvs up" , and comment on the result

3) using grep , retrieve the name of the milestone in the sources

4) checkout vcl from a cws under development

cvs -z4 co -r cws_dev300_aquavcl07 vcl

5) retrieve the cwsname in the sources

6) analyse the list of the subdirectories vcl contains

7) modify the code in vcl/source/gdi/sallayout.cxx

(write whatever you want, respecting C++ syntax prefered ;)

8) create a diff with the repository

change directory outside of vcl

in the current dir ( TMP ) , do :

cvs diff -u vcl > my_pretty_patch.diff

9) What does contain the patch ?

Apply and Reverse a patch

  • Simulate a patch application
  • Apply it for true

10) How reverse your changes ?

11) Be sure you have enough place on your hard disk ( count 2GB )

Fix a build breaker (most common breakages )

A) Building

Note: add your own experience here !

Building on Ubunutu 7.10

Ubuntu version : 7.10 - Gutsy Gibbon

Estimated time for the cnofiguration: 1h30

1) Download source code

install subversion : sudo apt-get install subversion

Command line for the download : svn checkout svn://

2) Java

Prefer the Sun JDK

Version of the installed Java (mini 1.5.0 ) Command line to check : java -version

In config_office tcsh was not found

Solution it to use the following option (which is the default now since DEV300_m77, anyway): --with-use-shell=bash

Archive::Zip is missing :

checking for required Perl modules... Can't locate Archive/ in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at -e line 1. BEGIN failed--compilation aborted at -e line 1. configure: error: Failed to find some modules

Solution :

apt-cache search archive | grep perl


libarchive-zip-perl - Module for manipulation of ZIP archives

Solution sudo apt-get install libarchive-zip-perl

Cups : checking for cups/cups.h... no configure: error: cups/cups.h could not be found. libcupsys2-dev or cups???-dev

Solution: sudo apt-get install libcupsys2-dev

pam :

checking for security/pam_appl.h... no configure: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?

Solution: sudo apt-get install libpam0g-dev

javac: checking for javac... no configure: error: javac not found set with_jdk_home


Install Sun Java 1.5.0 from the URL below:

JDK2 installed in /usr/local, means the following option is mandatory :


Gperf: checking for gperf... no configure: error: gperf not found but needed. Install it.

Solution: sudo apt-get install gperf


checking whether to build the ODK... yes

checking for external/unowinreg/unowinreg.dll... configure: WARNING: not found, will be cross-built using mingw32

Looking at external/unowinreg, the readme invites to download unowinreg.dll at

cd ../DEV300_m39/external/unowinreg/



gtk+ stuff :

checking whether freetype is available... checking for pkg-config... /usr/bin/pkg-config checking for freetype2 >= 2.0 ... Package freetype2 was not found in the pkg-config search path

Solution : install all the gtk+ stuff (first is freetype )

sudo apt-get install libfreetype6-dev

Mozilla :

checking for mozilla-source-1.7.5.tar.gz... not found checking for mozilla-source-1.7.5.tar.bz2... not found configure: error: Mozilla source archive not found. Please copy mozilla-source-1.7.5.tar.bz2 or mozilla-source-1.7.5.tar.gz to moz/download/. The archives can be found here:

use prebuilt-archives downloadable from

For Linux:


checking X11/Xaw/Label.h usability... no checking X11/Xaw/Label.h presence... no checking for X11/Xaw/Label.h... no configure: error: Xaw include headers not found

Solution :

sudo apt-get install libxaw6-dev


checking fontconfig/fontconfig.h usability... no checking fontconfig/fontconfig.h presence... no checking for fontconfig/fontconfig.h... no configure: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?

Solution: sudo apt-get install libfontconfig1-dev


checking for X11/extensions/Xrandr.h... no configure: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?

Solution: sudo apt-get install libxrandr-dev


checking for bison... no configure: error: no bison found in $PATH, install bison

Solution: sudo apt-get install bison

Flex: checking for flex... no configure: error: no flex found in $PATH, install flex

Solution: sudo apt-get install flex


checking whether to enable GConf support... yes checking for gconf-2.0 ... Package gconf-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gconf-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gconf-2.0' found configure: error: Library requirements (gconf-2.0 ) not met; consider adjusti

Solution: sudo apt-get install libgconf2-dev


checking for gnome-vfs-2.0 >= 2.6.0 ... Package gnome-vfs-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gnome-vfs-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gnome-vfs-2.0' found configure: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; cons

Solution: sudo apt-get install libgnome-vfs-dev

WARNING: not available -> use the --disable-gnome-vfs option solved the issue

libgtk+-2.0 missing:

Solution: sudo apt-get install libgtk2.0-dev

Ant missing:

checking for ant.cmd... no configure: error: Ant not found - Make sure it's in the path or use --with-ant-home

Solution Download apache-ant from (e.g.) :

Install the decompressed archive in /usr/local

use : --with-ant-home=/usr/local/apache-ant-1.7.1


Use as much as possible system libs:

libxml : --with-system-openssl

To avoid broken dependencies, libxml2 + matching libxslt (development archives) must be installed.

sudo apt-get install libxslt1-dev libxslt1.1

Finaly,use the foloowing option to successfully pass configure : --with-system-libxml

openssl : --with-system-openssl

checking for openssl ... Package openssl was not found in the pkg-config search path. Perhaps you should add the directory containing `openssl.pc' to the PKG_CONFIG_PATH environment variable No package 'openssl' found


sudo apt-get install libssl-dev

expat : --with-system-expat

berkeleydb : --with-system-db

checking for db.h... no checking for db4/db.h... no configure: error: no. install the db4 libraries

Solution : sudo apt-get install libdb4.4-dev

icu: --with-system-icu

checking for genbrk... no configure: error: \genbrk\ not found in $PATH, install the icu development tool \genbrk""

Solution : sudo apt-get install libicu36-dev

neon : --with-system-neon

checking which neon to use... external checking for neon >= 0.24.0... configure: error: you need neon >= 0.24.x for system-neon

Solution: sudo apt-get install libneon26-dev

Install ccache :

sudo apt-get install ccache

edit the ~/.bashrc and add the lines :

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

save, close and open a new term => ccache will be detected at the next configure

Final configure command line ( experimental, might be modified) :

./configure \
        --with-jdk-home=/usr/local/jdk1.5.0_17 \
        --disable-build-mozilla \
        --disable-gnome-vfs \
        --with-ant-home=/usr/local/apache-ant-1.7.1 \
        --with-lang=fr \
        --with-system-libxml \
        --with-system-libxslt \
        --with-system-openssl \
        --with-system-expat \
        --with-system-db \
        --with-system-icu \

And configure is successfull :-)

Bootstrap :


./bootstrap # builds dmake

either :


or :

cd instsetoo_native

build --all -P4

Starts the build

See you tomorrow :)

Missing modules

e.g. missing alias in DEV300_m13 : hyphen module is not checked, causing missing headers, never delivered and then, a breakage in lingucomponent because of undefined functions/methods and so on

Solution: check out hyphen

export CVSROOT=""

Note: there is another solution for experimented devs, using tunnel

cvs co -r DEV300_m13 hyphen

Missing Files
Missing headers
(deprecated) gcc parser issues

B) Hacking

Syntax Errors
Missing headers
Multi inclusions
Linking issues
Personal tools