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 | |
John Boyer | cd42539 | 2011-06-24 14:47:12 +0000 | [diff] [blame] | 3 | Copyright (C) 2008, 2009, 2011 ViewPlus Technologies, Inc. and |
| 4 | Abilitiessoft, Inc. |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 5 | |
| 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 Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 9 | |
| 10 | This file attempts to describe the maintainer-specific notes to follow |
| 11 | when hacking liblouis. |
| 12 | |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 13 | * Developing |
| 14 | ** Where to get it |
| 15 | The development sources are available through anonymous svn at Google |
| 16 | Code: |
| 17 | |
| 18 | http://code.google.com/p/liblouis/ |
| 19 | |
| 20 | ** Build requirements |
| 21 | This distribution uses Automake, Autoconf, and Libtool. If you are |
| 22 | getting the sources from svn (or change configure.ac), you'll need to |
| 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 |
| 28 | This distribution also uses Gnulib (http://www.gnu.org/software/gnulib) |
| 29 | to share common files, with the files being checked in to svn. If you |
| 30 | want to update from the current gnulib, install gnulib, and then run |
| 31 | gnulib-tool --import |
| 32 | in the top-level directory. |
| 33 | |
| 34 | For 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 |
| 38 | More modules might have been added since. The currently-used gnulib |
| 39 | modules and other gnulib information are recorded in |
| 40 | gnulib/m4/gnulib-cache.m4. Given a source checkout of gnulib, you can |
| 41 | update the files with gnulib-tool --import. |
| 42 | |
| 43 | ** How to build |
Christian Egli | 81b0481 | 2009-11-05 11:07:17 +0000 | [diff] [blame] | 44 | After getting the sources from svn, with |
| 45 | |
| 46 | svn checkout http://liblouis.googlecode.com/svn/trunk/ liblouis |
| 47 | |
| 48 | and installing the tools above, change to the liblouis directory and |
| 49 | and bootstrap the project with the following command |
| 50 | |
| 51 | ./autogen.sh |
| 52 | |
| 53 | to do a fresh build. Then run configure as usual: |
| 54 | |
| 55 | ./configure |
| 56 | |
| 57 | You have the choice to compile liblouis for either 16- or 32-bit |
| 58 | Unicode. By default it is compiled for the former. To get 32-bit |
| 59 | Unicode run configure with --enable-ucs4 . |
| 60 | |
| 61 | After running configure run "make" and then "make install". You must |
| 62 | have root privileges for the installation step. |
Christian Egli | 5510e4a | 2009-11-05 09:55:30 +0000 | [diff] [blame] | 63 | |
Christian Egli | f70f4e0 | 2011-01-03 15:09:06 +0000 | [diff] [blame] | 64 | ** How to debug |
| 65 | Starting the programs under the tools directory within gdb is a little |
| 66 | tricky as they are linked with libtool. See the info page of libtool |
| 67 | for more information. To start lou_checktable for table wiskunde.ctb |
| 68 | for 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 Egli | c77a589 | 2012-05-11 12:11:26 +0000 | [diff] [blame^] | 73 | ** How to find memory leaks |
| 74 | Valgrind is a tool that can be used to find memory errors. It is |
| 75 | recommended that you compile liblouis without any optimizations and |
| 76 | with all warnings enabled before running it through Valgrind: |
| 77 | |
| 78 | $ ./configure CFLAGS='-g -O0 -Wall' |
| 79 | $ make |
| 80 | |
| 81 | Then use Valgrind to analyze liblouis. For example you can run |
| 82 | lou_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 | |
| 88 | Type a few words at the prompt, check translation and terminate |
| 89 | lou_translate. Now open the file valgrind.log and see if there are any |
| 90 | memory leaks reported. |
| 91 | |
| 92 | You 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 | |
| 98 | Again open valgrind.log to see if any memory leaks were reported. |
| 99 | |
Christian Egli | 35f4aeb | 2010-08-19 11:58:07 +0000 | [diff] [blame] | 100 | ** How to build for win32 |
| 101 | Use the mingw win32 cross compiler as follows: |
| 102 | |
| 103 | ./configure --build i686-pc-linux-gnu --host i586-mingw32msvc |
| 104 | make |
| 105 | |
| 106 | At the moment you need to tweak the source some to get it to work. |
| 107 | Delete the lines AC_FUNC_MALLOC and AC_FUNC_REALLOC from configure.ac |
| 108 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 109 | * Release Procedure |
| 110 | These steps describe what a maintainer does to make a release; they |
| 111 | are not needed for ordinary patch submission. |
| 112 | |
| 113 | ** Set the version number |
| 114 | Update the version number in NEWS (with version, date, and release |
| 115 | type), ChangeLog and configure.ac. |
| 116 | |
Christian Egli | d1f5718 | 2011-05-18 07:16:46 +0000 | [diff] [blame] | 117 | Don't forget to update the libtool versioning info in configure.ac, |
| 118 | i.e. LIBLOUIS_REVISION and possibly LIBLOUIS_CURRENT and LIBLOUIS_AGE. |
| 119 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 120 | ** Commit and tag |
| 121 | Commit 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 | |
| 126 | If 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 |
| 132 | Check out a clean copy in a different directory, like /tmp. Run |
| 133 | autogen.sh and configure with no special prefixes. Run make distcheck. |
| 134 | This will make sure that all needed files are present, and do a |
| 135 | general sanity check. Run make dist. This will produce a tarball. |
| 136 | |
Christian Egli | 9a3b3ce | 2009-05-27 13:46:37 +0000 | [diff] [blame] | 137 | ./autogen.sh && ./configure && make && make distcheck && make dist |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 138 | |
| 139 | ** Upload |
| 140 | Upload tarball to Google project page, tag as "featured". This will |
| 141 | put the link on the main project page. Remove "featured" tag from |
| 142 | previous tarball release. |
| 143 | |
Christian Egli | 2ed702e | 2009-03-12 13:06:39 +0000 | [diff] [blame] | 144 | ** Online documentation |
| 145 | The online documentation is hosted out of subversion of the Google |
| 146 | code site. To check it out |
| 147 | |
| 148 | svn co https://liblouis.googlecode.com/svn/documentation \ |
| 149 | liblouis-online-documentation |
| 150 | |
| 151 | then move the latest built documentation into this directory and check |
| 152 | it in |
| 153 | |
| 154 | cd liblouis-online-documentation |
| 155 | cp ../liblouis/doc/liblouis.html . |
| 156 | svn ci liblouis.html -m "Update online documentation" |
| 157 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 158 | ** Other web updates |
| 159 | Update the Google project page. Add the current NEWS to the front |
| 160 | page. |
| 161 | |
| 162 | Also update the page on freshmeat (http://freshmeat.net/projects/liblouis/). |
| 163 | |
Christian Egli | 2541973 | 2011-05-09 07:38:14 +0000 | [diff] [blame] | 164 | ** Announce |
| 165 | Send an announcement to the liblouis list |
| 166 | liblouis-liblouisxml@freelists.org. See ANNOUNCEMENT for an example. |
| 167 | |
Christian Egli | eddc466 | 2009-03-09 13:27:20 +0000 | [diff] [blame] | 168 | |