corrections to check for existing files.
[AROS-Contrib.git] / sqlite3 / www / mingw.tcl
blobf1a01866309ef3a9813d922034dea12b22104a06
2 # Run this Tcl script to generate the mingw.html file.
4 set rcsid {$Id: mingw.tcl,v 1.4 2003/03/30 18:58:58 drh Exp $}
6 puts {<html>
7 <head>
8 <title>Notes On How To Build MinGW As A Cross-Compiler</title>
9 </head>
10 <body bgcolor=white>
11 <h1 align=center>
12 Notes On How To Build MinGW As A Cross-Compiler
13 </h1>}
14 puts "<p align=center>
15 (This page was last modified on [lrange $rcsid 3 4] UTC)
16 </p>"
18 puts {
19 <p><a href="http://www.mingw.org/">MinGW</a> or
20 <a href="http://www.mingw.org/">Minimalist GNU For Windows</a>
21 is a version of the popular GCC compiler that builds Win95/Win98/WinNT
22 binaries. See the website for details.</p>
24 <p>This page describes how you can build MinGW
25 from sources as a cross-compiler
26 running under Linux. Doing so will allow you to construct
27 WinNT binaries from the comfort and convenience of your
28 Unix desktop.</p>
31 proc Link {path {file {}}} {
32 if {$file!=""} {
33 set path $path/$file
34 } else {
35 set file $path
37 puts "<a href=\"$path\">$file</a>"
40 puts {
41 <p>Here are the steps:</p>
43 <ol>
44 <li>
45 <p>Get a copy of source code. You will need the binutils, the
46 compiler, and the MinGW runtime. Each are available separately.
47 As of this writing, Mumit Khan has collected everything you need
48 together in one FTP site:
50 set ftpsite \
51 ftp://ftp.nanotech.wisc.edu/pub/khan/gnu-win32/mingw32/snapshots/gcc-2.95.2-1
52 Link $ftpsite
53 puts {
54 The three files you will need are:</p>
55 <ul>
56 <li>}
57 Link $ftpsite binutils-19990818-1-src.tar.gz
58 puts </li><li>
59 Link $ftpsite gcc-2.95.2-1-src.tar.gz
60 puts </li><li>
61 Link $ftpsite mingw-20000203.zip
62 puts {</li>
63 </ul>
65 <p>Put all the downloads in a directory out of the way. The sequel
66 will assume all downloads are in a directory named
67 <b>~/mingw/download</b>.</p>
68 </li>
70 <li>
71 <p>
72 Create a directory in which to install the new compiler suite and make
73 the new directory writable.
74 Depending on what directory you choose, you might need to become
75 root. The example shell commands that follow
76 will assume the installation directory is
77 <b>/opt/mingw</b> and that your user ID is <b>drh</b>.</p>
78 <blockquote><pre>
80 mkdir /opt/mingw
81 chown drh /opt/mingw
82 exit
83 </pre></blockquote>
84 </li>
86 <li>
87 <p>Unpack the source tarballs into a separate directory.</p>
88 <blockquote><pre>
89 mkdir ~/mingw/src
90 cd ~/mingw/src
91 tar xzf ../download/binutils-*.tar.gz
92 tar xzf ../download/gcc-*.tar.gz
93 unzip ../download/mingw-*.zip
94 </pre></blockquote>
95 </li>
97 <li>
98 <p>Create a directory in which to put all the build products.</p>
99 <blockquote><pre>
100 mkdir ~/mingw/bld
101 </pre></blockquote>
102 </li>
104 <li>
105 <p>Configure and build binutils and add the results to your PATH.</p>
106 <blockquote><pre>
107 mkdir ~/mingw/bld/binutils
108 cd ~/mingw/bld/binutils
109 ../../src/binutils/configure --prefix=/opt/mingw --target=i386-mingw32 -v
110 make 2&gt;&amp;1 | tee make.out
111 make install 2&gt;&amp;1 | tee make-install.out
112 export PATH=$PATH:/opt/mingw/bin
113 </pre></blockquote>
114 </li>
116 <li>
117 <p>Manually copy the runtime include files into the installation directory
118 before trying to build the compiler.</p>
119 <blockquote><pre>
120 mkdir /opt/mingw/i386-mingw32/include
121 cd ~/mingw/src/mingw-runtime*/mingw/include
122 cp -r * /opt/mingw/i386-mingw32/include
123 </pre></blockquote>
124 </li>
126 <li>
127 <p>Configure and build the compiler</p>
128 <blockquote><pre>
129 mkdir ~/mingw/bld/gcc
130 cd ~/mingw/bld/gcc
131 ../../src/gcc-*/configure --prefix=/opt/mingw --target=i386-mingw32 -v
132 cd gcc
133 make installdirs
134 cd ..
135 make 2&gt;&amp;1 | tee make.out
136 make install
137 </pre></blockquote>
138 </li>
140 <li>
141 <p>Configure and build the MinGW runtime</p>
142 <blockquote><pre>
143 mkdir ~/mingw/bld/runtime
144 cd ~/mingw/bld/runtime
145 ../../src/mingw-runtime*/configure --prefix=/opt/mingw --target=i386-mingw32 -v
146 make install-target-w32api
147 make install
148 </pre></blockquote>
149 </li>
150 </ol>
152 <p>And you are done...</p>
154 puts {
155 <p><hr /></p>
156 <p><a href="index.html"><img src="/goback.jpg" border=0 />
157 Back to the SQLite Home Page</a>
158 </p>
160 </body></html>}