blob: 2c0299bdb2f7c85ca83fdc69861d8ff23682977a [file] [log] [blame]
Christian Eglif70f4e02011-01-03 15:09:06 +00001This HACKING file describes the development environment. -*- org -*-
Christian Egli5510e4a2009-11-05 09:55:30 +00002
Christian Egli311d52b2013-01-11 16:19:23 +00003 Copyright (C) 2008, 2009, 2011 ViewPlus Technologies, Inc. and Abilitiessoft, Inc.
4 Copyright (C) 2012, 2013 Swiss Library for the Blind, Visually Impaired and Print Disabled
5
Christian Egli5510e4a2009-11-05 09:55:30 +00006
7 Copying and distribution of this file, with or without modification,
8 are permitted in any medium without royalty provided the copyright
9 notice and this notice are preserved.
Christian Eglieddc4662009-03-09 13:27:20 +000010
11This file attempts to describe the maintainer-specific notes to follow
12when hacking liblouis.
13
Christian Egli5510e4a2009-11-05 09:55:30 +000014* Developing
15** Where to get it
16The development sources are available through anonymous svn at Google
17Code:
18
19 http://code.google.com/p/liblouis/
20
21** Build requirements
22This distribution uses Automake, Autoconf, and Libtool. If you are
23getting the sources from svn (or change configure.ac), you'll need to
24have these tools installed to (re)build. Optionally (if you want to
25generate man pages) you'll also need help2man. All of these programs
26are available from ftp://ftp.gnu.org/gnu.
27
28** Gnulib
29This distribution also uses Gnulib (http://www.gnu.org/software/gnulib)
30to share common files, with the files being checked in to svn. If you
31want to update from the current gnulib, install gnulib, and then run
32 gnulib-tool --import
33in the top-level directory.
34
35For the record, the first time invocation was
36 gnulib-tool --import --lib=libgnu --source-base=gnulib \
37 --m4-base=gnulib/m4 --aux-dir=build-aux --libtool \
38 --macro-prefix=gl getopt-gnu progname version-etc
39More modules might have been added since. The currently-used gnulib
40modules and other gnulib information are recorded in
41gnulib/m4/gnulib-cache.m4. Given a source checkout of gnulib, you can
42update the files with gnulib-tool --import.
43
44** How to build
Christian Egli81b04812009-11-05 11:07:17 +000045After getting the sources from svn, with
46
47 svn checkout http://liblouis.googlecode.com/svn/trunk/ liblouis
48
49and installing the tools above, change to the liblouis directory and
50and bootstrap the project with the following command
51
52 ./autogen.sh
53
54to do a fresh build. Then run configure as usual:
55
56 ./configure
57
58You have the choice to compile liblouis for either 16- or 32-bit
59Unicode. By default it is compiled for the former. To get 32-bit
60Unicode run configure with --enable-ucs4 .
61
62After running configure run "make" and then "make install". You must
63have root privileges for the installation step.
Christian Egli5510e4a2009-11-05 09:55:30 +000064
Christian Eglif70f4e02011-01-03 15:09:06 +000065** How to debug
Christian Egli45b3d322013-01-17 09:51:56 +000066First you have to build liblouis with debugging info enabled.
67
68 $ ./configure CFLAGS='-g -O0 -Wall -Wextra'
69 $ make
70
Christian Eglif70f4e02011-01-03 15:09:06 +000071Starting the programs under the tools directory within gdb is a little
72tricky as they are linked with libtool. See the info page of libtool
73for more information. To start lou_checktable for table wiskunde.ctb
74for example you'd have to issue the following commands:
75
76 $ libtool --mode=execute gdb ./tools/lou_checktable
77 (gdb) run tables/wiskunde.ctb
78
Christian Eglic77a5892012-05-11 12:11:26 +000079** How to find memory leaks
80Valgrind is a tool that can be used to find memory errors. It is
81recommended that you compile liblouis without any optimizations and
82with all warnings enabled before running it through Valgrind:
83
84 $ ./configure CFLAGS='-g -O0 -Wall'
85 $ make
86
87Then use Valgrind to analyze liblouis. For example you can run
88lou_translate trough Valgrind:
89
90 $ libtool --mode=execute valgrind -v --tool=memcheck \
91 --leak-check=full --leak-resolution=high --log-file=valgrind.log \
92 ./tools/lou_translate en-us-g2.ctb
93
94Type a few words at the prompt, check translation and terminate
95lou_translate. Now open the file valgrind.log and see if there are any
96memory leaks reported.
97
98You can also just run lou_checktable for example:
99
100 $ libtool --mode=execute valgrind -v --tool=memcheck \
101 --leak-check=full --leak-resolution=high --log-file=valgrind.log \
102 ./tools/lou_checktable tables/nl-BE-g1.ctb
103
104Again open valgrind.log to see if any memory leaks were reported.
105
Christian Egliae435322012-05-14 10:00:36 +0000106For the full experience run lou_allround under Valgrind:
107
108 $ libtool --mode=execute valgrind -v --tool=memcheck \
109 --leak-check=full --show-reachable=yes \
110 --leak-resolution=high --track-origins=yes \
111 --log-file=valgrind.log ./tools/lou_allround
112
Christian Egli35f4aeb2010-08-19 11:58:07 +0000113** How to build for win32
Christian Egli311d52b2013-01-11 16:19:23 +0000114See the README.windows file and the windows subdirectory.
Christian Egli75cd5692012-05-16 08:00:37 +0000115
116*** How to cross-compile for win32
Christian Egli311d52b2013-01-11 16:19:23 +0000117Use the mingw win32 cross compiler as shown below. Use the prefix
118option to install the binaries to a temporary place where you can
119create a zip file.
Christian Egli75cd5692012-05-16 08:00:37 +0000120
Christian Egli311d52b2013-01-11 16:19:23 +0000121 ./configure --build i686-pc-linux-gnu --host i586-mingw32msvc --prefix=/tmp/mingw32msvc
Christian Egli75cd5692012-05-16 08:00:37 +0000122 make
Christian Egli311d52b2013-01-11 16:19:23 +0000123 make dist
Christian Egli75cd5692012-05-16 08:00:37 +0000124
125
Christian Eglieddc4662009-03-09 13:27:20 +0000126* Release Procedure
127These steps describe what a maintainer does to make a release; they
128are not needed for ordinary patch submission.
129
130** Set the version number
131Update the version number in NEWS (with version, date, and release
132type), ChangeLog and configure.ac.
133
Christian Eglid1f57182011-05-18 07:16:46 +0000134Don't forget to update the libtool versioning info in configure.ac,
135i.e. LIBLOUIS_REVISION and possibly LIBLOUIS_CURRENT and LIBLOUIS_AGE.
136
Christian Eglieddc4662009-03-09 13:27:20 +0000137** Commit and tag
138Commit the changes and tag this version
139
140 svn cp https://liblouis.googlecode.com/svn/trunk \
141 https://liblouis.googlecode.com/svn/tags/liblouis_1_3_8
142
143If you know the exact version number that needs to be tagged use
144
145 svn cp https://liblouis.googlecode.com/svn/trunk \
146 https://liblouis.googlecode.com/svn/tags/liblouis_1_3_8 -r 109
147
148** Make the release
149Check out a clean copy in a different directory, like /tmp. Run
150autogen.sh and configure with no special prefixes. Run make distcheck.
151This will make sure that all needed files are present, and do a
152general sanity check. Run make dist. This will produce a tarball.
153
Christian Egli9a3b3ce2009-05-27 13:46:37 +0000154 ./autogen.sh && ./configure && make && make distcheck && make dist
Christian Eglieddc4662009-03-09 13:27:20 +0000155
156** Upload
157Upload tarball to Google project page, tag as "featured". This will
158put the link on the main project page. Remove "featured" tag from
159previous tarball release.
160
Christian Egli2ed702e2009-03-12 13:06:39 +0000161** Online documentation
162The online documentation is hosted out of subversion of the Google
163code site. To check it out
164
165 svn co https://liblouis.googlecode.com/svn/documentation \
166 liblouis-online-documentation
167
168then move the latest built documentation into this directory and check
169it in
170
171 cd liblouis-online-documentation
172 cp ../liblouis/doc/liblouis.html .
173 svn ci liblouis.html -m "Update online documentation"
174
Christian Eglieddc4662009-03-09 13:27:20 +0000175** Other web updates
176Update the Google project page. Add the current NEWS to the front
177page.
178
179Also update the page on freshmeat (http://freshmeat.net/projects/liblouis/).
180
Christian Egli25419732011-05-09 07:38:14 +0000181** Announce
182Send an announcement to the liblouis list
183liblouis-liblouisxml@freelists.org. See ANNOUNCEMENT for an example.
184
Christian Eglieddc4662009-03-09 13:27:20 +0000185