source: git/doc/HACKING.htm @ be48ac6

RELEASE/1.0RELEASE/1.1RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereostereo-2025walls-datawalls-data-hanging-as-warningwarn-only-for-hanging-survey
Last change on this file since be48ac6 was c746b4d, checked in by Olly Betts <olly@…>, 24 years ago

Doc updates.

Build system tewaks.

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

  • Property mode set to 100644
File size: 7.3 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) and autoconf 2.50 or later (for AC_ARG_VAR).
45For building the documentation you'll need sgmltools 2 or later,
46docbook-to-man, and w3m.
47
48<H2>Building on Non-Unix Platforms</H2>
49
50<H3>DJGPP (MSDOS for 386 or better)</H3>
51
52<P>Currently I build this with a Linux hosted cross-compiler.  I built
53this myself mostly following instructions from:
54
55<P><A
56HREF="http://www.objsw.com/CrossGCC/">http://www.objsw.com/CrossGCC/</A>
57
58<P>I suggest using binutils-2.10 rather than binutils-2.9.1.  The newer version
59includes the patch they supply, so the instructions boil down to this
60sequence of commands:
61
62<pre>
63bash
64mkdir ~/djcross
65cd ~/djcross
66wget ftp://ftp.objsw.com/pub/crossgcc/build-djgpp.sh
67mkdir tars
68cd tars
69# can't get it to build with djcrx203
70wget ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/old/djcrx202.zip
71# can't get 2.95.3 to build
72wget http://sunsite.org.uk/gnu/gcc/gcc-2.95.2.tar.gz
73# can't get 2.10.1 to build
74wget http://sunsite.org.uk/gnu/binutils/binutils-2.10.tar.gz
75cd ..
76patch -l build-djgpp.sh &lt;&lt;END
7726c26
78&lt; binutils=binutils-2.9.1
79---
80&gt; binutils=binutils-2.10
8197c97
82&lt;       patch -p1 &lt;\$patches/\$binutilsdiff
83---
84&gt;       #patch -p1 &lt;\$patches/\$binutilsdiff
85END
86sh build-djgpp.sh
87</pre>
88
89<P>Then you need to build and install the allegro graphics library:
90
91<P><A
92HREF="http://prdownloads.sourceforge.net/alleg/allegro-3.9.38.tar.gz"
93>http://prdownloads.sourceforge.net/alleg/allegro-3.9.38.tar.gz</A>
94
95<P>And follow the instructions for building using a cross-compiler is
96readme.dj.  In 3.9.38 these boil down to this (the patch turns off use
97of sincos which isn't supported by djgpp 2.02 it seems - you may not
98need it, but it isn't harmful):
99
100<pre>
101cd allegro-3.9.38
102./fix.sh djgpp
103patch -p0 &lt;&lt;END
104--- src/rotate.c~       Thu Sep 13 20:33:59 2001
105+++ src/rotate.c        Fri Oct  5 11:29:55 2001
106@@ -715,7 +715,7 @@
107    if (angle &gt;= 0x800000)
108       angle -= 0x1000000;
109 
110-   #ifdef ALLEGRO_DJGPP
111+   #if 0 /*def ALLEGRO_DJGPP*/
112       /* Faster way to obtain both sin and cos with one call under djgpp.
113         Todo: Do other platforms support this? (not watcom, mingw or msvc)
114       */
115END
116NATIVEPATH=$PATH
117export NATIVEPATH
118PATH=/opt/crosstools/i386-pc-msdosdjgpp/bin:/opt/crosstools/bin:$PATH
119DJDIR=/opt/crosstools/i386-pc-msdosdjgpp
120export DJDIR
121CROSSCOMPILE=1
122export CROSSCOMPILE
123make
124make install
125PATH=$NATIVEPATH
126</pre>
127
128<P>Building Survex under DOS in a native djgpp environment will require
129some tinkering.  Best bet is either to install bash and use the current
130configure script, or perhaps simpler to modify miniam.pl to generate a
131suitable makefile.  I'm happy to help if you want to try this, and
132I'll incorporate patches provided they're fairly clean.
133
134<H3>Mingw (MS Windows)</H3>
135
136<P>Currently I build this with a Linux hosted cross-compiler.  I use
137the packaged cross-compiler in the debian testing/unstable distribution.
138You can probably install these on other distributions using alien to
139convert them to RPMs or similar.  Alternatively, before that
140I used to use pre-built binaries for gcc 2.95.2 obtained from:
141
142<P><A HREF="http://www.devolution.com/~slouken/SDL/Xmingw32/"
143>http://www.devolution.com/~slouken/SDL/Xmingw32/</A>
144
145<P>Building on Windows in a native mingw environment will probably
146require tinkering.  Best bet is probably to install bash and use the
147current configure script.  I'm happy to help if you want to try this,
148and I'll incorporate patches provided they're fairly clean.
149
150<P>Building on Windows with MSVC/BorlandC/Watcom/... is likely to be more
151work, but could be a worthwhile project.  I'd suggest patching the
152perl script miniam.pl to generate a suitable makefile.  Again, send
153patches if you get this to work.
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 yet).
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).
165
166<H3>RISC OS</H3>
167
168<P>We now build this with Acorn C V5.  It will probably still build with
169Acorn C V4.  You also need to get and install OSLib from:
170
171<P><A HREF="http://www.arcade.demon.co.uk/oslib/homepage.html"
172>http://www.arcade.demon.co.uk/oslib/homepage.html</A>
173
174<P>You can build a suitable source archive for compiling the RISC OS version by
175running `make alien_src_zip' on the source distribution on a Unix box (you
176need to have run `./configure' first).  However for this you'll need a
177specially tweaked version of zip to create the zip file with the correct
178RISC OS file types. I can supply this on request.  You need to put it in the
179top level of the source tree and call it `zip-magic'.
180
181<P>You'll probably need to use Acorn's Make Utility (`amu') to build - the GNU
182make 1.02 port doesn't seem up to the job.
183
184<P>To build, create a fresh directory (or empty one) and unpack the contents of
185srcN_NN.zip into it (using !SparkFS or similar).  Then double-click on
186`!ObeyMe' in the unpacked directory to rename the source files into c and h
187subdirectories.  Then double-click on `!MakeMe' to build survex.
188
189
190<H2>SURVEXHOME environmental variable</H2>
191
192<P>Survex needs various support files.  Under UNIX the path to the
193support files needs to be built into the programs, but this causes a
194problem if the support files need to be installed elsewhere for some
195reason and the programs can't be rebuilt.  To get around this problem,
196you can define an environmental variable SURVEXHOME to point to a
197directory in which to look for support files.
198
199<P>This mechanism may sometimes useful on other operating systems.
200
201<P>Under UNIX, use "setenv SURVEXHOME /home/user/survex" (csh)
202or "SURVEXHOME=/home/user/survex ; export SURVEXHOME" (sh).
203
204<P>For DOS, put SET SURVEXHOME=C:\SURVEX in your AUTOEXEC.BAT file
205
206<P>For RISC OS put *Set SURVEXHOME ADFS::4.$.Survex.!Survex into your
207Boot !Run or !DeskTop
208
209</BODY></HTML>
Note: See TracBrowser for help on using the repository browser.