source: git/doc/HACKING.htm @ d1a521d

RELEASE/1.0RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since d1a521d was d1a521d, checked in by Olly Betts <olly@…>, 20 years ago

Removed comments referring to opengl functionality (which was stripped out).

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

  • Property mode set to 100644
File size: 6.9 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.14 rather than binutils-2.9.1, and also newer
63version of the DJGPP crosscompiler kit (djcrx - use 204 which is in beta at
64the time of writing) and GCC.  Newer binutils versions include the patch they
65supply, so the instructions boil down to this sequence of commands:
66
67<pre>
68bash
69mkdir ~/djcross
70cd ~/djcross
71wget ftp://ftp.objsw.com/pub/crossgcc/build-djgpp.sh
72mkdir tars
73cd tars
74wget http://www.mirror.ac.uk/sites/ftp.delorie.com/pub/djgpp/current/v2/beta/djcrx204.zip
75wget http://www.mirror.ac.uk/sites/ftp.gnu.org/gnu/gcc/gcc-3.3.2.tar.gz
76wget http://www.mirror.ac.uk/sites/ftp.gnu.org/gnu/binutils/binutils-2.14.tar.gz
77cd ..
78patch -l build-djgpp.sh &lt;&lt;END
7924,26c24,26
80&lt; binfile=djcrx202.zip
81&lt; gcc=gcc-2.95.2
82&lt; binutils=binutils-2.9.1
83---
84&gt; binfile=djcrx204.zip
85&gt; gcc=gcc-3.3.2
86&gt; binutils=binutils-2.14
8797c97
88&lt;       patch -p1 &lt;\$patches/\$binutilsdiff
89---
90&gt;       #patch -p1 &lt;\$patches/\$binutilsdiff
91END
92sh build-djgpp.sh
93</pre>
94
95If the build of GCC fails, you may need to apply this patch:
96
97<pre>
98--- gcc-3.3.2-orig/libiberty/getpwd.c   2001-10-07 22:53:31.000000000 +0100
99+++ gcc-3.3.2/libiberty/getpwd.c        2004-01-12 02:00:41.000000000 +0000
100@@ -50,2 +50,3 @@
101 
102+#undef MAXPATHLEN
103 #ifdef MAXPATHLEN
104</pre>
105
106You may also need to configure and build GCC without support for C++ (the script
107downloaded configures all languages and builds C and C++).  Sorry if that's
108a bit vague - email Olly if you can't work out what to do.
109
110<P>Then you need to build and install the
111<A HREF="http://www.talula.demon.co.uk/allegro/">Allegro graphics library</A>:
112
113<P><A
114HREF="http://prdownloads.sourceforge.net/alleg/allegro-4.0.3.tar.gz"
115>http://prdownloads.sourceforge.net/alleg/allegro-4.0.3.tar.gz</A>
116
117<P>And follow the instructions for building using a cross-compiler which
118you can in docs/build/djgpp.txt.  In 4.0.3 these boil down to:
119
120<pre>
121cd allegro-4.0.3
122./fix.sh djgpp --quick
123NATIVEPATH=$PATH
124export NATIVEPATH
125DJDIR=/usr/i386-pc-msdosdjgpp
126export DJDIR
127PATH=$DJDIR/bin:$PATH
128CROSSCOMPILE=1
129export CROSSCOMPILE
130make msg lib
131make install
132PATH=$NATIVEPATH
133</pre>
134
135<P>Building Survex under DOS in a native djgpp environment will require
136some tinkering.  Best bet is either to install bash and use the current
137configure script, or perhaps simpler to modify miniam.pl to generate a
138suitable makefile.  I'm happy to help if you want to try this, and
139I'll incorporate patches provided they're fairly clean.
140
141<H3>Mingw (Microsoft Windows)</H3>
142
143<P>Currently I build this with a Linux hosted cross-compiler.  I use
144the packaged cross-compiler in the debian testing/unstable distribution.
145You can probably install these on other distributions using alien to
146convert them to RPMs or similar.  Alternatively, before that
147I used to use pre-built binaries for gcc 2.95.2 obtained from:
148
149<P><A HREF="http://www.libsdl.org/extras/win32/cross/"
150>http://www.libsdl.org/extras/win32/cross/</A>
151
152<P>Building on Windows in a native mingw environment will probably
153require tinkering.  Best bet is probably to install bash and use the
154current configure script.  I'm happy to help if you want to try this,
155and I'll incorporate patches provided they're fairly clean.
156
157<P>Building on Windows with MSVC/BorlandC/Watcom/... is likely to be more
158work, but could be a worthwhile project.  I'd suggest patching the
159perl script miniam.pl to generate a suitable makefile.  Again, send
160patches if you get this to work.
161
162<H3>MSDOS for 286 and earlier (BorlandC)</H3>
163
164<P>Wookey currently builds this with a rather elderly BorlandC++ 3.1.
165BorlandC++ 5.5 can be downloaded for free, but it appears to only compile to
16632 bit code.  You can also download TurboC version 2, which might do the job
167(I've not tried).
168
169<P>You can build a suitable source archive for this version using
170`make alien_src_zip' on the source distribution on a Unix box (you need to
171have run `./configure' first).  Then unzip the src&lt;version&gt;.zip file
172produced on the MSDOS machine and run <code>make.bat</code>.
173
174<H3>RISC OS</H3>
175
176<P>We now build this with Acorn C V5.  It will probably still build with
177Acorn C V4.  You also need to get and install OSLib from:
178
179<P><A HREF="http://www.arcade.demon.co.uk/oslib/homepage.html"
180>http://www.arcade.demon.co.uk/oslib/homepage.html</A>
181
182<P>You can build a suitable source archive for compiling the RISC OS version by
183running `make alien_src_zip' on the source distribution on a Unix box (you
184need to have run `./configure' first).  However for this you'll need a
185specially tweaked version of zip to create the zip file with the correct
186RISC OS file types. I can supply this on request.  You need to put it in the
187top level of the source tree and call it `zip-magic'.
188
189<P>You'll probably need to use Acorn's Make Utility (`amu') to build - the GNU
190make 1.02 port doesn't seem up to the job.
191
192<P>To build, create a fresh directory (or empty one) and unpack the contents of
193srcN_NN.zip into it (using !SparkFS or similar).  Then double-click on
194`!ObeyMe' in the unpacked directory to rename the source files into c and h
195subdirectories.  Then double-click on `!MakeMe' to build survex.
196
197</BODY></HTML>
Note: See TracBrowser for help on using the repository browser.