blob: f5f884a446dc8d05b5f3307d49a00299470116ef [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
John Boyercd425392011-06-24 14:47:12 +00003 Copyright (C) 2008, 2009, 2011 ViewPlus Technologies, Inc. and
4 Abilitiessoft, Inc.
Christian Egli5510e4a2009-11-05 09:55:30 +00005
6 Copying and distribution of this file, with or without modification,
7 are permitted in any medium without royalty provided the copyright
8 notice and this notice are preserved.
Christian Eglieddc4662009-03-09 13:27:20 +00009
10This file attempts to describe the maintainer-specific notes to follow
11when hacking liblouis.
12
Christian Egli5510e4a2009-11-05 09:55:30 +000013* Developing
14** Where to get it
15The development sources are available through anonymous svn at Google
16Code:
17
18 http://code.google.com/p/liblouis/
19
20** Build requirements
21This distribution uses Automake, Autoconf, and Libtool. If you are
22getting the sources from svn (or change configure.ac), you'll need to
23have these tools installed to (re)build. Optionally (if you want to
24generate man pages) you'll also need help2man. All of these programs
25are available from ftp://ftp.gnu.org/gnu.
26
27** Gnulib
28This distribution also uses Gnulib (http://www.gnu.org/software/gnulib)
29to share common files, with the files being checked in to svn. If you
30want to update from the current gnulib, install gnulib, and then run
31 gnulib-tool --import
32in the top-level directory.
33
34For the record, the first time invocation was
35 gnulib-tool --import --lib=libgnu --source-base=gnulib \
36 --m4-base=gnulib/m4 --aux-dir=build-aux --libtool \
37 --macro-prefix=gl getopt-gnu progname version-etc
38More modules might have been added since. The currently-used gnulib
39modules and other gnulib information are recorded in
40gnulib/m4/gnulib-cache.m4. Given a source checkout of gnulib, you can
41update the files with gnulib-tool --import.
42
43** How to build
Christian Egli81b04812009-11-05 11:07:17 +000044After getting the sources from svn, with
45
46 svn checkout http://liblouis.googlecode.com/svn/trunk/ liblouis
47
48and installing the tools above, change to the liblouis directory and
49and bootstrap the project with the following command
50
51 ./autogen.sh
52
53to do a fresh build. Then run configure as usual:
54
55 ./configure
56
57You have the choice to compile liblouis for either 16- or 32-bit
58Unicode. By default it is compiled for the former. To get 32-bit
59Unicode run configure with --enable-ucs4 .
60
61After running configure run "make" and then "make install". You must
62have root privileges for the installation step.
Christian Egli5510e4a2009-11-05 09:55:30 +000063
Christian Eglif70f4e02011-01-03 15:09:06 +000064** How to debug
65Starting the programs under the tools directory within gdb is a little
66tricky as they are linked with libtool. See the info page of libtool
67for more information. To start lou_checktable for table wiskunde.ctb
68for example you'd have to issue the following commands:
69
70 $ libtool --mode=execute gdb ./tools/lou_checktable
71 (gdb) run tables/wiskunde.ctb
72
Christian Eglic77a5892012-05-11 12:11:26 +000073** How to find memory leaks
74Valgrind is a tool that can be used to find memory errors. It is
75recommended that you compile liblouis without any optimizations and
76with all warnings enabled before running it through Valgrind:
77
78 $ ./configure CFLAGS='-g -O0 -Wall'
79 $ make
80
81Then use Valgrind to analyze liblouis. For example you can run
82lou_translate trough Valgrind:
83
84 $ libtool --mode=execute valgrind -v --tool=memcheck \
85 --leak-check=full --leak-resolution=high --log-file=valgrind.log \
86 ./tools/lou_translate en-us-g2.ctb
87
88Type a few words at the prompt, check translation and terminate
89lou_translate. Now open the file valgrind.log and see if there are any
90memory leaks reported.
91
92You can also just run lou_checktable for example:
93
94 $ libtool --mode=execute valgrind -v --tool=memcheck \
95 --leak-check=full --leak-resolution=high --log-file=valgrind.log \
96 ./tools/lou_checktable tables/nl-BE-g1.ctb
97
98Again open valgrind.log to see if any memory leaks were reported.
99
Christian Egli35f4aeb2010-08-19 11:58:07 +0000100** How to build for win32
101Use the mingw win32 cross compiler as follows:
102
103 ./configure --build i686-pc-linux-gnu --host i586-mingw32msvc
104 make
105
106At the moment you need to tweak the source some to get it to work.
107Delete the lines AC_FUNC_MALLOC and AC_FUNC_REALLOC from configure.ac
108
Christian Eglieddc4662009-03-09 13:27:20 +0000109* Release Procedure
110These steps describe what a maintainer does to make a release; they
111are not needed for ordinary patch submission.
112
113** Set the version number
114Update the version number in NEWS (with version, date, and release
115type), ChangeLog and configure.ac.
116
Christian Eglid1f57182011-05-18 07:16:46 +0000117Don't forget to update the libtool versioning info in configure.ac,
118i.e. LIBLOUIS_REVISION and possibly LIBLOUIS_CURRENT and LIBLOUIS_AGE.
119
Christian Eglieddc4662009-03-09 13:27:20 +0000120** Commit and tag
121Commit the changes and tag this version
122
123 svn cp https://liblouis.googlecode.com/svn/trunk \
124 https://liblouis.googlecode.com/svn/tags/liblouis_1_3_8
125
126If you know the exact version number that needs to be tagged use
127
128 svn cp https://liblouis.googlecode.com/svn/trunk \
129 https://liblouis.googlecode.com/svn/tags/liblouis_1_3_8 -r 109
130
131** Make the release
132Check out a clean copy in a different directory, like /tmp. Run
133autogen.sh and configure with no special prefixes. Run make distcheck.
134This will make sure that all needed files are present, and do a
135general sanity check. Run make dist. This will produce a tarball.
136
Christian Egli9a3b3ce2009-05-27 13:46:37 +0000137 ./autogen.sh && ./configure && make && make distcheck && make dist
Christian Eglieddc4662009-03-09 13:27:20 +0000138
139** Upload
140Upload tarball to Google project page, tag as "featured". This will
141put the link on the main project page. Remove "featured" tag from
142previous tarball release.
143
Christian Egli2ed702e2009-03-12 13:06:39 +0000144** Online documentation
145The online documentation is hosted out of subversion of the Google
146code site. To check it out
147
148 svn co https://liblouis.googlecode.com/svn/documentation \
149 liblouis-online-documentation
150
151then move the latest built documentation into this directory and check
152it in
153
154 cd liblouis-online-documentation
155 cp ../liblouis/doc/liblouis.html .
156 svn ci liblouis.html -m "Update online documentation"
157
Christian Eglieddc4662009-03-09 13:27:20 +0000158** Other web updates
159Update the Google project page. Add the current NEWS to the front
160page.
161
162Also update the page on freshmeat (http://freshmeat.net/projects/liblouis/).
163
Christian Egli25419732011-05-09 07:38:14 +0000164** Announce
165Send an announcement to the liblouis list
166liblouis-liblouisxml@freelists.org. See ANNOUNCEMENT for an example.
167
Christian Eglieddc4662009-03-09 13:27:20 +0000168