source: git/doc/HACKING.htm @ 96bd3a0

RELEASE/1.0RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereowalls-datawalls-data-hanging-as-warning
Last change on this file since 96bd3a0 was ec803c0, checked in by Olly Betts <olly@…>, 21 years ago

Doc updates found on my desk.

git-svn-id: file:///home/survex-svn/survex/trunk@2406 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 6.8 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 and 2.53 have
47both been used successfully).
48
49<P>For building the documentation you'll need sgmltools 2 or later,
50docbook-to-man, and w3m.
51
52<H2>Building on Non-Unix Platforms</H2>
53
54<H3>DJGPP (MSDOS for 386 or better)</H3>
55
56<P>Currently I build this with a Linux hosted cross-compiler.  I built
57this myself mostly following instructions from:
58
59<P><A
60HREF="http://www.objsw.com/CrossGCC/">http://www.objsw.com/CrossGCC/</A>
61
62<P>I suggest using binutils-2.10 rather than binutils-2.9.1.  The newer version
63includes the patch they supply, so the instructions boil down to this
64sequence of commands:
65
66<pre>
67bash
68mkdir ~/djcross
69cd ~/djcross
70wget ftp://ftp.objsw.com/pub/crossgcc/build-djgpp.sh
71mkdir tars
72cd tars
73# can't get it to build with djcrx203
74wget ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/old/djcrx202.zip
75# can't get 2.95.3 to build
76wget http://sunsite.org.uk/gnu/gcc/gcc-2.95.2.tar.gz
77# can't get 2.10.1 to build
78wget http://sunsite.org.uk/gnu/binutils/binutils-2.10.tar.gz
79cd ..
80patch -l build-djgpp.sh &lt;&lt;END
8126c26
82&lt; binutils=binutils-2.9.1
83---
84&gt; binutils=binutils-2.10
8597c97
86&lt;       patch -p1 &lt;\$patches/\$binutilsdiff
87---
88&gt;       #patch -p1 &lt;\$patches/\$binutilsdiff
89END
90sh build-djgpp.sh
91</pre>
92
93<P>Then you need to build and install the
94<A HREF="http://www.talula.demon.co.uk/allegro/">Allegro graphics library</A>:
95
96<P><A
97HREF="http://prdownloads.sourceforge.net/alleg/allegro-4.0.1.tar.gz"
98>http://prdownloads.sourceforge.net/alleg/allegro-4.0.1.tar.gz</A>
99
100<P>Allegro 4.0.2 has been released, but the list of changes doesn't show
101anything relevant to the routines caverot uses, so I've not bothered to
102upgrade.
103
104<P>And follow the instructions for building using a cross-compiler which
105you can find starting from readme.txt.  In 4.0.1 these boil down to:
106
107<pre>
108cd allegro-4.0.1
109./fix.sh djgpp --quick
110NATIVEPATH=$PATH
111export NATIVEPATH
112DJDIR=/opt/crosstools/i386-pc-msdosdjgpp
113export DJDIR
114PATH=$DJDIR/bin:/opt/crosstools/bin:$PATH
115CROSSCOMPILE=1
116export CROSSCOMPILE
117make
118make install
119PATH=$NATIVEPATH
120</pre>
121
122<P>Building Survex under DOS in a native djgpp environment will require
123some tinkering.  Best bet is either to install bash and use the current
124configure script, or perhaps simpler to modify miniam.pl to generate a
125suitable makefile.  I'm happy to help if you want to try this, and
126I'll incorporate patches provided they're fairly clean.
127
128<H3>Mingw (Microsoft Windows)</H3>
129
130<P>Currently I build this with a Linux hosted cross-compiler.  I use
131the packaged cross-compiler in the debian testing/unstable distribution.
132You can probably install these on other distributions using alien to
133convert them to RPMs or similar.  Alternatively, before that
134I used to use pre-built binaries for gcc 2.95.2 obtained from:
135
136<P><A HREF="http://www.libsdl.org/extras/win32/cross/"
137>http://www.libsdl.org/extras/win32/cross/</A>
138
139<!--
140for opengl, we need glut too:
141http://www.xmission.com/~nate/glut.html
142download glut-X.XX-bin.zip and unzip into the compiler directories:
143unzip glut-3.7.6-bin.zip
144mv glut-3.7.6-bin/glut.h /usr/i586-mingw32msvc/include/GL
145mv glut-3.7.6-bin/glut32.lib /usr/i586-mingw32msvc/lib/libglut.a
146mv glut-3.7.6-bin/glut32.dll mingw_extras
147-->
148<P>Building on Windows in a native mingw environment will probably
149require tinkering.  Best bet is probably to install bash and use the
150current configure script.  I'm happy to help if you want to try this,
151and I'll incorporate patches provided they're fairly clean.
152
153<P>Building on Windows with MSVC/BorlandC/Watcom/... is likely to be more
154work, but could be a worthwhile project.  I'd suggest patching the
155perl script miniam.pl to generate a suitable makefile.  Again, send
156patches if you get this to work.
157
158<H3>MSDOS for 286 and earlier (BorlandC)</H3>
159
160<P>Wookey currently builds this with a rather elderly BorlandC++ 3.1.
161BorlandC++ 5.5 can be downloaded for free, but it appears to only compile to
16232 bit code.  You can also download TurboC version 2, which might do the job
163(I've not tried).
164
165<P>You can build a suitable source archive for this version using
166`make alien_src_zip' on the source distribution on a Unix box (you need to
167have run `./configure' first).  Then unzip the src&lt;version&gt;.zip file
168produced on the MSDOS machine and run <code>make.bat</code>.
169
170<H3>RISC OS</H3>
171
172<P>We now build this with Acorn C V5.  It will probably still build with
173Acorn C V4.  You also need to get and install OSLib from:
174
175<P><A HREF="http://www.arcade.demon.co.uk/oslib/homepage.html"
176>http://www.arcade.demon.co.uk/oslib/homepage.html</A>
177
178<P>You can build a suitable source archive for compiling the RISC OS version by
179running `make alien_src_zip' on the source distribution on a Unix box (you
180need to have run `./configure' first).  However for this you'll need a
181specially tweaked version of zip to create the zip file with the correct
182RISC OS file types. I can supply this on request.  You need to put it in the
183top level of the source tree and call it `zip-magic'.
184
185<P>You'll probably need to use Acorn's Make Utility (`amu') to build - the GNU
186make 1.02 port doesn't seem up to the job.
187
188<P>To build, create a fresh directory (or empty one) and unpack the contents of
189srcN_NN.zip into it (using !SparkFS or similar).  Then double-click on
190`!ObeyMe' in the unpacked directory to rename the source files into c and h
191subdirectories.  Then double-click on `!MakeMe' to build survex.
192
193</BODY></HTML>
Note: See TracBrowser for help on using the repository browser.