1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Misc cleanup. Notes on compiling for Win95. (CVS 152)

FossilOrigin-Name: 3f0f1fa1fce794d1661c845f1a63a8d744892c25
This commit is contained in:
drh
2000-10-11 19:28:51 +00:00
parent d42b00f654
commit 7c68d60b6f
15 changed files with 4153 additions and 33 deletions

View File

@@ -1,7 +1,7 @@
#
# Run this Tcl script to generate the crosscompile.html file.
#
set rcsid {$Id: crosscompile.tcl,v 1.2 2000/07/31 19:16:32 drh Exp $}
set rcsid {$Id: crosscompile.tcl,v 1.3 2000/10/11 19:28:53 drh Exp $}
puts {<html>
<head>
@@ -23,7 +23,9 @@ binaries. See the website for details.</p>
<p>This page describes how you can use MinGW configured as a
cross-compiler running under RedHat 6.0 Linux to generate a
binary for SQLite that runs under WinNT.</p>
binary for SQLite that runs under WinNT.
Some additional steps (described <a href="#win95">below</a>)
are needed to target Win95/98.</p>
}
proc Code {body} {
@@ -123,6 +125,64 @@ make
</pre></blockquote>
</li>
</ol>
<a name="win95">
<h2>Targetting Windows95/98 instead of WindowsNT</h2>
<p>A small amount of additional work is needed to get SQLite running
under Windows95/98. The first problem is that the LockFile() and
UnlockFile() API that the Roth GDBM port uses does not work under
Windows95. The easiest workaround is to just disable file locking
in the GDBM library. You can do so by appending a few lines of code
to the end of one of the GDBM source files and compiling the library
using a special command-line option. Replace step (4) above as
follows:</p>
<ol>
<li value="4"><p>
Append text to the <b>systems.h</b> source file as follows:</p>
<blockquote><pre>
cat &gt;&gt;systems.h &lt;&lt;\END
#ifdef NO_LOCKS
#undef UNLOCK_FILE
#define UNLOCK_FILE(x)
#undef READLOCK_FILE
#define READLOCK_FILE(x)
#undef WRITELOCK_FILE
#define WRITELOCK_FILE(x)
#endif
END
</pre></blockquote>
<p>Then manually build the GDBM library with the extra
"NO_LOCKS" define as follows:</p>
<blockquote><pre>
i386-mingw32-gcc -DWIN32=1 -DNO_LOCKS -O2 -c *.c
i386-mingw32-ar cr libgdbm.a *.o
i386-mingw32-ranlib libgdbm.a
cd ..
</pre></blockquote>
</p></li>
</ol>
<p>Note that the locking problem has been reported and may actually
be fixed in the Roth GDBM distribution by the time you read this.
You should probably check before you make the above changes.</p>
<p>The above is all you have to do to get SQLite to work on Windows95.
But one more step is required to get it to work <i>well</i>. It
turns out that SQLite make heavy use of <b>malloc()</b> and
<b>free()</b> and the implementation of this functions
on Windows95 is particular poor. Large database queries will run
more than 10 times faster if you substitute a better memory allocator
such as the one by
<a href="http://g.oswego.edu/dl/html/malloc.html">Doug Lea</a>.
A copy of Doug's allocator is included in the <b>contrib</b>
directory of the source tree. Speed improvements are also reported
on WindowsNT when alternative memory allocators are used, though
the speedup is not as dramatic as it is with WIndows95.</p>
}
puts {
<p><hr /></p>