| 1 | <HTML><HEAD> | 
|---|
| 2 | <TITLE>Survex Hacker's Guide</TITLE> | 
|---|
| 3 | <STYLE type="text/css"><!-- | 
|---|
| 4 | BODY, 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 | 
|---|
| 14 | down while I remember.  With time it should evolve into a more | 
|---|
| 15 | coherent document.  If you have any questions which this should answer | 
|---|
| 16 | but 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" | 
|---|
| 21 | with 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 | 
|---|
| 38 | conceivably be added in future, although the simple common cases are | 
|---|
| 39 | already 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 | 
|---|
| 44 | per-executable CFLAGS; 1.6 has been tested and works, but wasn't a | 
|---|
| 45 | very stable release - automake 1.6.1 is a better bet) | 
|---|
| 46 | and autoconf 2.50 or later (autoconf 2.52, 2.53 and 2.64 have all | 
|---|
| 47 | been used successfully). | 
|---|
| 48 |  | 
|---|
| 49 | <P>For building the documentation you'll need sgmltools 2 or later, | 
|---|
| 50 | jadetex, 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>Mingw (Microsoft Windows)</H3> | 
|---|
| 57 |  | 
|---|
| 58 | <P>Currently I build this with a Linux hosted cross-compiler.  I use | 
|---|
| 59 | the packaged cross-compiler in the debian testing/unstable distribution: | 
|---|
| 60 |  | 
|---|
| 61 | <code> | 
|---|
| 62 | sudo apt-get install mingw32 | 
|---|
| 63 | </code> | 
|---|
| 64 | <!-- g++-mingw-w64 --> | 
|---|
| 65 |  | 
|---|
| 66 | <P>Building on Windows in a native mingw environment will probably | 
|---|
| 67 | require tinkering.  Best bet is probably to install bash and use the | 
|---|
| 68 | current configure script.  I'm happy to help if you want to try this, | 
|---|
| 69 | and I'll incorporate patches provided they're fairly clean. | 
|---|
| 70 |  | 
|---|
| 71 | <H2>Microsoft Windows Installer Builder</H2> | 
|---|
| 72 |  | 
|---|
| 73 | <P>We use <A HREF="http://www.jrsoftware.org/isinfo.php">InnoSetup</A> to | 
|---|
| 74 | build the MS Windows Installer.  Survex 1.2.8 was built using InnoSetup | 
|---|
| 75 | 5.5.3 (non-Unicode version, so that the installer works on older versions | 
|---|
| 76 | of Microsoft Windows). | 
|---|
| 77 |  | 
|---|
| 78 | <P>Here are some random notes: | 
|---|
| 79 |  | 
|---|
| 80 | <H3>Packages Needed</H3> | 
|---|
| 81 |  | 
|---|
| 82 | <P>On Debian, the commands to install wine vary depending on the architecture | 
|---|
| 83 | you're running - to check this use: | 
|---|
| 84 |  | 
|---|
| 85 | <pre> | 
|---|
| 86 | dpkg-architecture -qDEB_HOST_GNU_CPU | 
|---|
| 87 | </pre> | 
|---|
| 88 |  | 
|---|
| 89 | <H4>For i386</H4> | 
|---|
| 90 |  | 
|---|
| 91 | <pre> | 
|---|
| 92 | sudo apt-get install wine wx2.8-i18n | 
|---|
| 93 | </pre> | 
|---|
| 94 |  | 
|---|
| 95 | <H4>For x86_64</H4> | 
|---|
| 96 |  | 
|---|
| 97 | <P>You'll need to enable multi-arch and install the i386 packages of wine: | 
|---|
| 98 |  | 
|---|
| 99 | <pre> | 
|---|
| 100 | sudo dpkg --add-architecture i386 | 
|---|
| 101 | sudo apt-get update | 
|---|
| 102 | sudo apt-get install wine wine-bin:i386 wx2.8-i18n | 
|---|
| 103 | </pre> | 
|---|
| 104 |  | 
|---|
| 105 | <H4>Common</H4> | 
|---|
| 106 |  | 
|---|
| 107 | <P>And then run: | 
|---|
| 108 |  | 
|---|
| 109 | <pre> | 
|---|
| 110 | wine ~/Downloads/isetup-5.5.3.exe | 
|---|
| 111 | </pre> | 
|---|
| 112 |  | 
|---|
| 113 | <H3>Translations</H3> | 
|---|
| 114 |  | 
|---|
| 115 | <P>In addition to the translations included with InnoSetup as standard, we also | 
|---|
| 116 | add these, which you can find in the <code>lib</code> subdirectory of Xapian's | 
|---|
| 117 | source tree: | 
|---|
| 118 |  | 
|---|
| 119 | <UL> | 
|---|
| 120 | <li>ChineseSimplified.isl (Unofficial translation; for 5.5.3+) | 
|---|
| 121 | <li>ChineseTraditional.isl (Candidate official translation; for 5.5.0+) | 
|---|
| 122 | <li>EnglishGB.isl (Unofficial translation, done by Olly; for 5.5.3+) | 
|---|
| 123 | <li>Indonesian.isl (Unofficial translation; for 5.5.3+) | 
|---|
| 124 | <li>Romanian.isl (Unofficial translation; for 5.5.3+) | 
|---|
| 125 | <li>Slovak.isl (Unofficial translation; for 5.5.3+) | 
|---|
| 126 | </UL> | 
|---|
| 127 |  | 
|---|
| 128 | <H3>survex.iss</H3> | 
|---|
| 129 |  | 
|---|
| 130 | <P>This file is generated by configure (from the template survex.iss.in). | 
|---|
| 131 | We could instead have a static survex.iss which uses #include to pull in | 
|---|
| 132 | a file with the Survex version info in, but the current method works well | 
|---|
| 133 | enough so we'll stick with it for now (I suspect #include was introduced since | 
|---|
| 134 | we started using InnoSetup). | 
|---|
| 135 |  | 
|---|
| 136 | </BODY></HTML> | 
|---|