source: git/doc/HACKING.htm @ 089bf7d

RELEASE/1.0
Last change on this file since 089bf7d was 089bf7d, checked in by Olly Betts <olly@…>, 13 years ago

Backport changes from 1.2.0:
doc/HACKING.htm: Update version of InnoSetup? used. Note the packages
needed on Debian to build the Microsoft Windows installer.
doc/HACKING.htm: Note Debian packages to install for docs.

git-svn-id: file:///home/survex-svn/survex/branches/1.0@3698 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 7.7 KB
Line 
1<HTML><HEAD>
2<TITLE>Survex Hacker's Guide</TITLE>
3<STYLE type="text/css"><!--
4BODY, TD, CENTER, UL, OL {font-family: sans-serif;}
5-->
6</STYLE>
7</HEAD><BODY BGCOLOR=white TEXT=black>
8<H1>Hacking Survex</H1>
9
10<p>(That's hacking in the "tinkering with code" sense, not in the
11"breaking into other people's computer systems" sense).
12
13<p>This is currently a random collection of notes that need to be written
14down while I remember.  With time it should evolve into a more
15coherent document.  If you have any questions which this should answer
16but doesn't then ask me and I'll add them.
17
18<H2>Network code debugging</H2>
19
20<P>You can pick which network simplifications are attempted using "-z"
21with an argument listing code letters.  So:
22
23<ul>
24<li>-z=    no special simplifications (articulation still performed)
25<li>-z=l   remove "lollipops"
26<li>-z=p   remove parallel legs
27<li>-z=d   convert deltas to stars
28</ul>
29
30<P>And you can combine these in any combination:
31
32<ul>
33<li>-z=lp  remove "lollipops" and parallel legs
34<li>-z=lpd remove "lollipops" and parallel legs; convert deltas to stars
35</ul>
36
37<P>"-z=lpd" is the default (in 0.99 at least - more transformations may
38conceivably be added in future, although the simple common cases are
39already covered).
40
41<H2>Developing on Unix Platforms</H2>
42
43<P>You'll need automake 1.5 or later (earlier versions don't support
44per-executable CFLAGS; 1.6 has been tested and works, but wasn't a
45very stable release - automake 1.6.1 is a better bet)
46and autoconf 2.50 or later (autoconf 2.52, 2.53 and 2.64 have all
47been used successfully).
48
49<P>For building the documentation you'll need sgmltools 2 or later,
50jadetex, docbook-to-man, and w3m.
51
52<P>On debian squeeze: sudo apt-get install sgmltools-lite jadetex docbook-to-man w3m
53
54<H2>Building on Non-Unix Platforms</H2>
55
56<H3>DJGPP (MSDOS for 386 or better)</H3>
57
58<P>Currently I build this with a Linux hosted cross-compiler.  I built
59this myself mostly following instructions from:
60
61<P><A
62HREF="http://www.objsw.com/CrossGCC/">http://www.objsw.com/CrossGCC/</A>
63
64<P>I suggest using binutils-2.14 rather than binutils-2.9.1, and also newer
65version of the DJGPP crosscompiler kit (djcrx - use 204 which is in beta at
66the time of writing) and GCC.  Newer binutils versions include the patch they
67supply, so the instructions boil down to this sequence of commands:
68
69<pre>
70bash
71mkdir ~/djcross
72cd ~/djcross
73wget ftp://ftp.objsw.com/pub/crossgcc/build-djgpp.sh
74mkdir tars
75cd tars
76wget http://www.mirror.ac.uk/sites/ftp.delorie.com/pub/djgpp/current/v2/beta/djcrx204.zip
77wget http://www.mirror.ac.uk/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2.tar.gz
78wget http://www.mirror.ac.uk/sites/ftp.gnu.org/gnu/binutils/binutils-2.14.tar.gz
79cd ..
80patch -l build-djgpp.sh &lt;&lt;END
8124,26c24,26
82&lt; binfile=djcrx202.zip
83&lt; gcc=gcc-2.95.2
84&lt; binutils=binutils-2.9.1
85---
86&gt; binfile=djcrx204.zip
87&gt; gcc=gcc-3.3.2
88&gt; binutils=binutils-2.14
8997c97
90&lt;       patch -p1 &lt;\$patches/\$binutilsdiff
91---
92&gt;       #patch -p1 &lt;\$patches/\$binutilsdiff
93END
94sh build-djgpp.sh
95</pre>
96
97If the build of GCC fails, you may need to apply this patch:
98
99<pre>
100--- gcc-3.3.2-orig/libiberty/getpwd.c   2001-10-07 22:53:31.000000000 +0100
101+++ gcc-3.3.2/libiberty/getpwd.c        2004-01-12 02:00:41.000000000 +0000
102@@ -50,2 +50,3 @@
103 
104+#undef MAXPATHLEN
105 #ifdef MAXPATHLEN
106</pre>
107
108You may also need to configure and build GCC without support for C++ (the script
109downloaded configures all languages and builds C and C++).  Sorry if that's
110a bit vague - email Olly if you can't work out what to do.
111
112<P>Then you need to build and install the
113<A HREF="http://www.talula.demon.co.uk/allegro/">Allegro graphics library</A>:
114
115<P><A
116HREF="http://prdownloads.sourceforge.net/alleg/allegro-4.0.3.tar.gz"
117>http://prdownloads.sourceforge.net/alleg/allegro-4.0.3.tar.gz</A>
118
119<P>And follow the instructions for building using a cross-compiler which
120you can in docs/build/djgpp.txt.  In 4.0.3 these boil down to:
121
122<pre>
123cd allegro-4.0.3
124./fix.sh djgpp --quick
125NATIVEPATH=$PATH
126export NATIVEPATH
127DJDIR=/usr/i386-pc-msdosdjgpp
128export DJDIR
129PATH=$DJDIR/bin:$PATH
130CROSSCOMPILE=1
131export CROSSCOMPILE
132make msg lib
133make install
134PATH=$NATIVEPATH
135</pre>
136
137<P>Building Survex under DOS in a native djgpp environment will require
138some tinkering.  Best bet is either to install bash and use the current
139configure script, or perhaps simpler to modify miniam.pl to generate a
140suitable makefile.  I'm happy to help if you want to try this, and
141I'll incorporate patches provided they're fairly clean.
142
143<H3>Mingw (Microsoft Windows)</H3>
144
145<P>Currently I build this with a Linux hosted cross-compiler.  I use
146the packaged cross-compiler in the debian testing/unstable distribution.
147You can probably install these on other distributions using alien to
148convert them to RPMs or similar.
149
150<P>Building on Windows in a native mingw environment will probably
151require tinkering.  Best bet is probably to install bash and use the
152current configure script.  I'm happy to help if you want to try this,
153and I'll incorporate patches provided they're fairly clean.
154
155<H3>MSDOS for 286 and earlier (BorlandC)</H3>
156
157<P>Wookey currently builds this with a rather elderly BorlandC++ 3.1.
158BorlandC++ 5.5 can be downloaded for free, but it appears to only compile to
15932 bit code.  You can also download TurboC version 2, which might do the job
160(I've not tried).
161
162<P>You can build a suitable source archive for this version using
163`make alien_src_zip' on the source distribution on a Unix box (you need to
164have run `./configure' first).  Then unzip the src&lt;version&gt;.zip file
165produced on the MSDOS machine and run <code>make.bat</code>.
166
167<H3>RISC OS</H3>
168
169<P>We now build this with Acorn C V5.  It will probably still build with
170Acorn C V4.  You also need to get and install OSLib from:
171
172<P><A HREF="http://www.arcade.demon.co.uk/oslib/homepage.html"
173>http://www.arcade.demon.co.uk/oslib/homepage.html</A>
174
175<P>You can build a suitable source archive for compiling the RISC OS version by
176running `make alien_src_zip' on the source distribution on a Unix box (you
177need to have run `./configure' first).  However for this you'll need a
178specially tweaked version of zip to create the zip file with the correct
179RISC OS file types. I can supply this on request.  You need to put it in the
180top level of the source tree and call it `zip-magic'.
181
182<P>You'll probably need to use Acorn's Make Utility (`amu') to build - the GNU
183make 1.02 port doesn't seem up to the job.
184
185<P>To build, create a fresh directory (or empty one) and unpack the contents of
186srcN_NN.zip into it (using !SparkFS or similar).  Then double-click on
187`!ObeyMe' in the unpacked directory to rename the source files into c and h
188subdirectories.  Then double-click on `!MakeMe' to build survex.
189
190<H2>Microsoft Windows Installer Builder</H2>
191
192<P>We use <A HREF="http://www.jrsoftware.org/isinfo.php">InnoSetup</A> to
193build the MS Windows Installer.  Survex 1.0.40 was built using InnoSetup
1945.4.2 (non-Unicode version, so that the installer works on older versions
195of Microsoft Windows).
196
197<P>Here are some random notes:
198
199<H3>Packages Needed</H3>
200
201<P>On Debian, you'll need to install these packages to build the installer:
202
203<P>apt-get install wine wx2.8-i18n
204
205<H3>Translations</H3>
206
207<P>In addition to the translations included with InnoSetup as standard, we also
208add these, which you can find in the <code>lib</code> subdirectory of Xapian's
209SVN tree:
210
211<UL>
212<LI>English_GB.isl (unofficial, done by Olly)
213<LI>Romanian-7-5.1.11.isl (unofficial, asked Cristian to check it over)
214</UL>
215
216<H3>survex.iss</H3>
217
218<P>This file is generated by configure (from the template survex.iss.in).
219We could instead have a static survex.iss which uses #include to pull in
220a file with the Survex version info in, but the current method works well
221enough so we'll stick with it for now (I suspect #include was introduced since
222we started using InnoSetup).
223
224</BODY></HTML>
Note: See TracBrowser for help on using the repository browser.