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. |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 4 | Copyright (C) 2012, 2013, 2014 Swiss Library for the Blind, Visually Impaired and Print Disabled |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 5 | |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 6 | Copying and distribution of this file, with or without modification, |
| 7 | are permitted in any medium without royalty provided the copyright |
Christian Egli | 741b007 | 2014-09-18 11:08:45 +0200 | [diff] [blame^] | 8 | notice and this notice are preserved. This file is offered as-is, |
| 9 | without any warranty. |
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 |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 16 | The development sources are available through git at github.com: |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 17 | |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 18 | https://github.com/liblouis/liblouis |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 19 | |
| 20 | ** Build requirements |
| 21 | This distribution uses Automake, Autoconf, and Libtool. If you are |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 22 | getting the sources from git (or change configure.ac), you'll need to |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 23 | have these tools installed to (re)build. Optionally (if you want to |
| 24 | generate man pages) you'll also need help2man. All of these programs |
| 25 | are available from ftp://ftp.gnu.org/gnu. |
| 26 | |
| 27 | ** Gnulib |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 28 | This distribution also uses Gnulib (http://www.gnu.org/software/gnulib). If |
| 29 | you want to update from the current gnulib, install gnulib, and then run |
| 30 | gnulib-tool --import in the top-level directory. |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 31 | |
| 32 | For the record, the first time invocation was |
| 33 | gnulib-tool --import --lib=libgnu --source-base=gnulib \ |
| 34 | --m4-base=gnulib/m4 --aux-dir=build-aux --libtool \ |
| 35 | --macro-prefix=gl getopt-gnu progname version-etc |
| 36 | More modules might have been added since. The currently-used gnulib |
| 37 | modules and other gnulib information are recorded in |
| 38 | gnulib/m4/gnulib-cache.m4. Given a source checkout of gnulib, you can |
| 39 | update the files with gnulib-tool --import. |
| 40 | |
| 41 | ** How to build |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 42 | After getting the sources from git, with |
Christian Egli | 81b0481 | 2009-11-05 11:07:17 +0000 | [diff] [blame] | 43 | |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 44 | git clone https://github.com/liblouis/liblouis.git |
Christian Egli | 81b0481 | 2009-11-05 11:07:17 +0000 | [diff] [blame] | 45 | |
| 46 | and installing the tools above, change to the liblouis directory and |
| 47 | and bootstrap the project with the following command |
| 48 | |
| 49 | ./autogen.sh |
| 50 | |
| 51 | to do a fresh build. Then run configure as usual: |
| 52 | |
| 53 | ./configure |
| 54 | |
| 55 | You have the choice to compile liblouis for either 16- or 32-bit |
| 56 | Unicode. By default it is compiled for the former. To get 32-bit |
| 57 | Unicode run configure with --enable-ucs4 . |
| 58 | |
| 59 | After running configure run "make" and then "make install". You must |
| 60 | have root privileges for the installation step. |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 61 | |
Christian Egli | f70f4e0 | 2011-01-03 15:09:06 +0000 | [diff] [blame] | 62 | ** How to debug |
Christian Egli | 45b3d32 | 2013-01-17 09:51:56 +0000 | [diff] [blame] | 63 | First you have to build liblouis with debugging info enabled. |
| 64 | |
| 65 | $ ./configure CFLAGS='-g -O0 -Wall -Wextra' |
| 66 | $ make |
| 67 | |
Christian Egli | f70f4e0 | 2011-01-03 15:09:06 +0000 | [diff] [blame] | 68 | Starting the programs under the tools directory within gdb is a little |
| 69 | tricky as they are linked with libtool. See the info page of libtool |
| 70 | for more information. To start lou_checktable for table wiskunde.ctb |
| 71 | for example you'd have to issue the following commands: |
| 72 | |
| 73 | $ libtool --mode=execute gdb ./tools/lou_checktable |
| 74 | (gdb) run tables/wiskunde.ctb |
| 75 | |
Christian Egli | c77a589 | 2012-05-11 12:11:26 +0000 | [diff] [blame] | 76 | ** How to find memory leaks |
| 77 | Valgrind is a tool that can be used to find memory errors. It is |
| 78 | recommended that you compile liblouis without any optimizations and |
| 79 | with all warnings enabled before running it through Valgrind: |
| 80 | |
| 81 | $ ./configure CFLAGS='-g -O0 -Wall' |
| 82 | $ make |
| 83 | |
| 84 | Then use Valgrind to analyze liblouis. For example you can run |
| 85 | lou_translate trough Valgrind: |
| 86 | |
| 87 | $ libtool --mode=execute valgrind -v --tool=memcheck \ |
| 88 | --leak-check=full --leak-resolution=high --log-file=valgrind.log \ |
| 89 | ./tools/lou_translate en-us-g2.ctb |
| 90 | |
| 91 | Type a few words at the prompt, check translation and terminate |
| 92 | lou_translate. Now open the file valgrind.log and see if there are any |
| 93 | memory leaks reported. |
| 94 | |
| 95 | You can also just run lou_checktable for example: |
| 96 | |
| 97 | $ libtool --mode=execute valgrind -v --tool=memcheck \ |
| 98 | --leak-check=full --leak-resolution=high --log-file=valgrind.log \ |
| 99 | ./tools/lou_checktable tables/nl-BE-g1.ctb |
| 100 | |
| 101 | Again open valgrind.log to see if any memory leaks were reported. |
| 102 | |
Christian Egli | ae43532 | 2012-05-14 10:00:36 +0000 | [diff] [blame] | 103 | For the full experience run lou_allround under Valgrind: |
| 104 | |
| 105 | $ libtool --mode=execute valgrind -v --tool=memcheck \ |
| 106 | --leak-check=full --show-reachable=yes \ |
| 107 | --leak-resolution=high --track-origins=yes \ |
| 108 | --log-file=valgrind.log ./tools/lou_allround |
| 109 | |
Christian Egli | 6eb6334 | 2013-06-03 10:03:54 +0000 | [diff] [blame] | 110 | ** How to analyze performance |
| 111 | Gprof helps you analyze the performance of programs. You have to |
| 112 | compile liblouis as follows: |
| 113 | |
| 114 | $ ./configure --disable-shared |
| 115 | $ make clean all CFLAGS='-g -O0 -pg' LDFLAGS='-all-static' |
| 116 | |
| 117 | Then translate some stuff with a large table: |
| 118 | |
| 119 | $ ./tools/lou_translate tests/tables/large.ctb |
| 120 | |
| 121 | Finally look at the call profile: |
| 122 | |
| 123 | $ libtool --mode=execute gprof ./tools/lou_translate gmon.out |
| 124 | |
Christian Egli | 35f4aeb | 2010-08-19 11:58:07 +0000 | [diff] [blame] | 125 | ** How to build for win32 |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 126 | See the README.windows file and the windows subdirectory. |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 127 | |
| 128 | *** How to cross-compile for win32 |
Christian Egli | 311d52b | 2013-01-11 16:19:23 +0000 | [diff] [blame] | 129 | Use the mingw win32 cross compiler as shown below. Use the prefix |
| 130 | option to install the binaries to a temporary place where you can |
| 131 | create a zip file. |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 132 | |
Christian Egli | daaf7e3 | 2013-06-21 14:27:14 +0000 | [diff] [blame] | 133 | ./configure --build i686-pc-linux-gnu --host i586-mingw32msvc --prefix=/tmp/liblouis-mingw32msvc |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 134 | make |
Christian Egli | daaf7e3 | 2013-06-21 14:27:14 +0000 | [diff] [blame] | 135 | make install |
| 136 | zip -r liblouis-mingw32msvc.zip /tmp/liblouis-mingw32msvc |
Christian Egli | 75cd569 | 2012-05-16 08:00:37 +0000 | [diff] [blame] | 137 | |
| 138 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 139 | * Release Procedure |
| 140 | These steps describe what a maintainer does to make a release; they |
| 141 | are not needed for ordinary patch submission. |
| 142 | |
| 143 | ** Set the version number |
| 144 | Update the version number in NEWS (with version, date, and release |
| 145 | type), ChangeLog and configure.ac. |
| 146 | |
Christian Egli | d1f5718 | 2011-05-18 07:16:46 +0000 | [diff] [blame] | 147 | Don't forget to update the libtool versioning info in configure.ac, |
| 148 | i.e. LIBLOUIS_REVISION and possibly LIBLOUIS_CURRENT and LIBLOUIS_AGE. |
| 149 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 150 | ** Commit and tag |
| 151 | Commit the changes and tag this version |
| 152 | |
Christian Egli | 5f9c03f | 2014-09-01 14:01:41 +0200 | [diff] [blame] | 153 | git tag -s v2.6.0 -m "Release 2.6.0" |
| 154 | git push origin v2.6.0 |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 155 | |
| 156 | If you know the exact version number that needs to be tagged use |
| 157 | |
Christian Egli | 5f9c03f | 2014-09-01 14:01:41 +0200 | [diff] [blame] | 158 | git tag -s v2.6.0 -m "Release 2.6.0" <commit> |
| 159 | git push origin v2.6.0 |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 160 | |
| 161 | ** Make the release |
| 162 | Check out a clean copy in a different directory, like /tmp. Run |
| 163 | autogen.sh and configure with no special prefixes. Run make distcheck. |
| 164 | This will make sure that all needed files are present, and do a |
| 165 | general sanity check. Run make dist. This will produce a tarball. |
| 166 | |
Christian Egli | 9a3b3ce | 2009-05-27 13:46:37 +0000 | [diff] [blame] | 167 | ./autogen.sh && ./configure && make && make distcheck && make dist |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 168 | |
| 169 | ** Upload |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 170 | Add the tarball to the liblouis web site, i.e. add it under |
Christian Egli | 5f9c03f | 2014-09-01 14:01:41 +0200 | [diff] [blame] | 171 | $WEBSITE/downloads and add a link to it in $WEBSITE/downloads/index.md. |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 172 | See below for instructions on how to update the web site. |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 173 | |
Christian Egli | 2ed702e | 2009-03-12 13:06:39 +0000 | [diff] [blame] | 174 | ** Online documentation |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 175 | The online documentation is part of the liblouis web site. To add it to the |
| 176 | site simply copy doc/liblouis.html to $WEBSITE/documentation/liblouis.html. |
| 177 | Make sure you add the proper YAML front matter. Again see below for |
| 178 | instructions on how to update the web site. |
Christian Egli | 2ed702e | 2009-03-12 13:06:39 +0000 | [diff] [blame] | 179 | |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 180 | ** Web site maintenance |
| 181 | The liblouis web site at liblouis.org is maintained with the help of |
| 182 | github pages (https://pages.github.com/). To edit the site just check |
| 183 | out the repo at https://github.com/liblouis/liblouis.github.io. You'll |
| 184 | need to know a few things about Jekyll (http://jekyllrb.com/) and |
| 185 | textile (http://redcloth.org/textile/) the markup that is used to edit |
| 186 | the content. In order to update the site simply edit, commit and push. |
Christian Egli | 2ed702e | 2009-03-12 13:06:39 +0000 | [diff] [blame] | 187 | |
Christian Egli | 71647d6 | 2014-05-20 09:20:28 +0200 | [diff] [blame] | 188 | For the new release update the project web site. Add a post containing |
| 189 | the current NEWS to the _posts directory. |
Christian Egli | 2ed702e | 2009-03-12 13:06:39 +0000 | [diff] [blame] | 190 | |
Christian Egli | 2541973 | 2011-05-09 07:38:14 +0000 | [diff] [blame] | 191 | ** Announce |
| 192 | Send an announcement to the liblouis list |
| 193 | liblouis-liblouisxml@freelists.org. See ANNOUNCEMENT for an example. |
| 194 | |