Christian Egli | f70f4e0 | 2011-01-03 15:09:06 +0000 | [diff] [blame] | 1 | This HACKING file describes the development environment. -*- org -*- |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 2 | |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 3 | 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 Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 6 | |
| 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 Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 10 | |
| 11 | This file attempts to describe the maintainer-specific notes to follow |
| 12 | when hacking liblouis. |
| 13 | |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 14 | * Developing |
| 15 | ** Where to get it |
| 16 | The development sources are available through anonymous svn at Google |
| 17 | Code: |
| 18 | |
| 19 | http://code.google.com/p/liblouis/ |
| 20 | |
| 21 | ** Build requirements |
| 22 | This distribution uses Automake, Autoconf, and Libtool. If you are |
| 23 | getting the sources from svn (or change configure.ac), you'll need to |
| 24 | have these tools installed to (re)build. Optionally (if you want to |
| 25 | generate man pages) you'll also need help2man. All of these programs |
| 26 | are available from ftp://ftp.gnu.org/gnu. |
| 27 | |
| 28 | ** Gnulib |
| 29 | This distribution also uses Gnulib (http://www.gnu.org/software/gnulib) |
| 30 | to share common files, with the files being checked in to svn. If you |
| 31 | want to update from the current gnulib, install gnulib, and then run |
| 32 | gnulib-tool --import |
| 33 | in the top-level directory. |
| 34 | |
| 35 | For 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 |
| 39 | More modules might have been added since. The currently-used gnulib |
| 40 | modules and other gnulib information are recorded in |
| 41 | gnulib/m4/gnulib-cache.m4. Given a source checkout of gnulib, you can |
| 42 | update the files with gnulib-tool --import. |
| 43 | |
| 44 | ** How to build |
Christian Egli | 81b0481 | 2009-11-05 11:07:17 +0000 | [diff] [blame] | 45 | After getting the sources from svn, with |
| 46 | |
| 47 | svn checkout http://liblouis.googlecode.com/svn/trunk/ liblouis |
| 48 | |
| 49 | and installing the tools above, change to the liblouis directory and |
| 50 | and bootstrap the project with the following command |
| 51 | |
| 52 | ./autogen.sh |
| 53 | |
| 54 | to do a fresh build. Then run configure as usual: |
| 55 | |
| 56 | ./configure |
| 57 | |
| 58 | You have the choice to compile liblouis for either 16- or 32-bit |
| 59 | Unicode. By default it is compiled for the former. To get 32-bit |
| 60 | Unicode run configure with --enable-ucs4 . |
| 61 | |
| 62 | After running configure run "make" and then "make install". You must |
| 63 | have root privileges for the installation step. |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 64 | |
Christian Egli | f70f4e0 | 2011-01-03 15:09:06 +0000 | [diff] [blame] | 65 | ** How to debug |
Christian Egli | 45b3d32 | 2013-01-17 09:51:56 +0000 | [diff] [blame^] | 66 | First you have to build liblouis with debugging info enabled. |
| 67 | |
| 68 | $ ./configure CFLAGS='-g -O0 -Wall -Wextra' |
| 69 | $ make |
| 70 | |
Christian Egli | f70f4e0 | 2011-01-03 15:09:06 +0000 | [diff] [blame] | 71 | Starting the programs under the tools directory within gdb is a little |
| 72 | tricky as they are linked with libtool. See the info page of libtool |
| 73 | for more information. To start lou_checktable for table wiskunde.ctb |
| 74 | for 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 Egli | c77a589 | 2012-05-11 12:11:26 +0000 | [diff] [blame] | 79 | ** How to find memory leaks |
| 80 | Valgrind is a tool that can be used to find memory errors. It is |
| 81 | recommended that you compile liblouis without any optimizations and |
| 82 | with all warnings enabled before running it through Valgrind: |
| 83 | |
| 84 | $ ./configure CFLAGS='-g -O0 -Wall' |
| 85 | $ make |
| 86 | |
| 87 | Then use Valgrind to analyze liblouis. For example you can run |
| 88 | lou_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 | |
| 94 | Type a few words at the prompt, check translation and terminate |
| 95 | lou_translate. Now open the file valgrind.log and see if there are any |
| 96 | memory leaks reported. |
| 97 | |
| 98 | You 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 | |
| 104 | Again open valgrind.log to see if any memory leaks were reported. |
| 105 | |
Christian Egli | ae43532 | 2012-05-14 10:00:36 +0000 | [diff] [blame] | 106 | For 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 Egli | 35f4aeb | 2010-08-19 11:58:07 +0000 | [diff] [blame] | 113 | ** How to build for win32 |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 114 | See the README.windows file and the windows subdirectory. |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 115 | |
| 116 | *** How to cross-compile for win32 |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 117 | Use the mingw win32 cross compiler as shown below. Use the prefix |
| 118 | option to install the binaries to a temporary place where you can |
| 119 | create a zip file. |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 120 | |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 121 | ./configure --build i686-pc-linux-gnu --host i586-mingw32msvc --prefix=/tmp/mingw32msvc |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 122 | make |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 123 | make dist |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 124 | |
| 125 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 126 | * Release Procedure |
| 127 | These steps describe what a maintainer does to make a release; they |
| 128 | are not needed for ordinary patch submission. |
| 129 | |
| 130 | ** Set the version number |
| 131 | Update the version number in NEWS (with version, date, and release |
| 132 | type), ChangeLog and configure.ac. |
| 133 | |
Christian Egli | d1f5718 | 2011-05-18 07:16:46 +0000 | [diff] [blame] | 134 | Don't forget to update the libtool versioning info in configure.ac, |
| 135 | i.e. LIBLOUIS_REVISION and possibly LIBLOUIS_CURRENT and LIBLOUIS_AGE. |
| 136 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 137 | ** Commit and tag |
| 138 | Commit 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 | |
| 143 | If 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 |
| 149 | Check out a clean copy in a different directory, like /tmp. Run |
| 150 | autogen.sh and configure with no special prefixes. Run make distcheck. |
| 151 | This will make sure that all needed files are present, and do a |
| 152 | general sanity check. Run make dist. This will produce a tarball. |
| 153 | |
Christian Egli | 9a3b3ce | 2009-05-27 13:46:37 +0000 | [diff] [blame] | 154 | ./autogen.sh && ./configure && make && make distcheck && make dist |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 155 | |
| 156 | ** Upload |
| 157 | Upload tarball to Google project page, tag as "featured". This will |
| 158 | put the link on the main project page. Remove "featured" tag from |
| 159 | previous tarball release. |
| 160 | |
Christian Egli | 2ed702e | 2009-03-12 13:06:39 +0000 | [diff] [blame] | 161 | ** Online documentation |
| 162 | The online documentation is hosted out of subversion of the Google |
| 163 | code site. To check it out |
| 164 | |
| 165 | svn co https://liblouis.googlecode.com/svn/documentation \ |
| 166 | liblouis-online-documentation |
| 167 | |
| 168 | then move the latest built documentation into this directory and check |
| 169 | it in |
| 170 | |
| 171 | cd liblouis-online-documentation |
| 172 | cp ../liblouis/doc/liblouis.html . |
| 173 | svn ci liblouis.html -m "Update online documentation" |
| 174 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 175 | ** Other web updates |
| 176 | Update the Google project page. Add the current NEWS to the front |
| 177 | page. |
| 178 | |
| 179 | Also update the page on freshmeat (http://freshmeat.net/projects/liblouis/). |
| 180 | |
Christian Egli | 2541973 | 2011-05-09 07:38:14 +0000 | [diff] [blame] | 181 | ** Announce |
| 182 | Send an announcement to the liblouis list |
| 183 | liblouis-liblouisxml@freelists.org. See ANNOUNCEMENT for an example. |
| 184 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 185 | |