Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
diana:windows:building:environment [2009-11-09 14:46:29] dages |
diana:windows:building:environment [2022-05-31 09:29:31] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Setting up the build environment on Windows ====== | ====== Setting up the build environment on Windows ====== | ||
| - | Assuming Windows XP 32. | + | Assuming Windows XP 32. We will use MinGW to build the libraries and application and MSYS as a working environment. |
| - | ===== Stuff you'll need ===== | + | The distinction between MinGW and MSYS is very important: MinGW is a set of compilers and libraries |
| - | ==== A Subversion | + | ===== Directories ===== |
| + | |||
| + | We will install MinGW into '' | ||
| + | |||
| + | MSYS maps Unix-like paths to Windows paths: ''/'' | ||
| + | |||
| + | We will install our libraries and applications into '' | ||
| + | |||
| + | C:\> mkdir met.no | ||
| + | C:\> mkdir met.no\bin | ||
| + | C:\> mkdir met.no\include | ||
| + | C:\> mkdir met.no\lib | ||
| + | C:\> mkdir met.no\share | ||
| + | C:\> mkdir met.no\copyright | ||
| + | |||
| + | ===== Subversion | ||
| Doesn' | Doesn' | ||
| - | ==== MinGW ==== | + | ===== MinGW ===== |
| + | |||
| + | Download and the latest automated installer from http:// | ||
| + | |||
| + | As of 2009-11-20, the current MinGW version is 5.1.6, which includes GCC 3.4.5. | ||
| + | |||
| + | //tip: move the installer into an empty directory before starting it; it will download all the MinGW distribution files into that directory.// | ||
| + | |||
| + | At this point, you may want to download bsdtar from http:// | ||
| + | |||
| + | You may want to install InfoZip' | ||
| + | |||
| + | $ make -f win32/ | ||
| + | $ cp zip.exe / | ||
| + | |||
| + | ===== MSYS ===== | ||
| + | |||
| + | Download the MSYS installer from | ||
| + | http:// | ||
| + | |||
| + | As of 2009-11-20, the latest MSYS version is 1.0.11. | ||
| + | |||
| + | ===== Testing the toolchain ===== | ||
| + | |||
| + | Let's see if our C compiler works: | ||
| + | |||
| + | $ which gcc | ||
| + | / | ||
| + | $ gcc --version | ||
| + | gcc.exe (GCC) 3.4.5 (mingw-vista special r3) | ||
| + | Copyright (C) 2004 Free Software Foundation, Inc. | ||
| + | This is free software; see the source for copying conditions. | ||
| + | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| + | $ cat > | ||
| + | #include < | ||
| + | int main(void) { printf(" | ||
| + | ^D | ||
| + | $ gcc -o hello hello.c | ||
| + | $ ./hello.exe | ||
| + | Hello, C world! | ||
| + | |||
| + | And C++: | ||
| + | |||
| + | $ which g++ | ||
| + | / | ||
| + | $ g++ --version | ||
| + | g++.exe (GCC) 3.4.5 (mingw-vista special r3) | ||
| + | Copyright (C) 2004 Free Software Foundation, Inc. | ||
| + | This is free software; see the source for copying conditions. | ||
| + | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
| + | $ cat > | ||
| + | #include < | ||
| + | int main() { std::cout << " | ||
| + | ^D | ||
| + | $ g++ -o hello hello.cc | ||
| + | $ ./hello.exe | ||
| + | Hello, C++ world! | ||
| + | |||
| + | And Fortran 77: | ||
| + | |||
| + | $ which g77 | ||
| + | / | ||
| + | $ g77 --version | ||
| + | GNU Fortran (GCC) 3.4.5 (mingw-vista special r3) | ||
| + | Copyright (C) 2004 Free Software Foundation, Inc. | ||
| + | |||
| + | GNU Fortran comes with NO WARRANTY, to the extent permitted by law. | ||
| + | You may redistribute copies of GNU Fortran | ||
| + | under the terms of the GNU General Public License. | ||
| + | For more information about these matters, see the file named COPYING | ||
| + | or type the command `info -f g77 Copying' | ||
| + | $ cat > | ||
| + | PROGRAM HELLOW | ||
| + | WRITE(UNIT=*, | ||
| + | END | ||
| + | ^D | ||
| + | $ g77 -o hello hello.f | ||
| + | $ ./hello.exe | ||
| + | | ||
| + | |||
| + | ===== lex & yacc ===== | ||
| + | |||
| + | Or rather, in our brave GNU world, flex and bison. | ||
| + | |||
| + | Download the following files from http:// | ||
| - | Not necessarily | + | * the '' |
| + | * the '' | ||
| - | ==== MSYS ==== | + | For some unfathomable reason, both the flex and bison '' |
| - | Includes bash, make, autotools etc. | + | $ tar -kxf bison-2.4.1-lib.zip -C /MinGW |
| - | Download the latest version of the MSYS Base System from http://sourceforge.net/projects/mingw/files/MSYS%20Base%20System/ and run it. At some point, it will ask you where you installed MinGW, and I'm betting you won't even think twice before ratting it out. | + | This will install a shell script called '' |
| - | Now that MSYS is installed, you can start the "MSYS (rxvt)" | + | #! /bin/sh |
| + | exec / | ||
| - | ==== WiX ==== | + | ===== WiX ===== |
| Microsoft' | Microsoft' | ||