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 17:11:12] dages link |
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. |
+ | |||
+ | The distinction between MinGW and MSYS is very important: MinGW is a set of compilers and libraries you use to build Windows applications, | ||
+ | |||
+ | ===== 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 ===== | ===== Subversion ===== | ||
Line 7: | Line 24: | ||
Doesn' | Doesn' | ||
- | ===== MSYS ===== | + | ===== MinGW ===== |
- | Download the MSYS Base System | + | Download |
- | Now that MSYS is installed, you can start the "MSYS (rxvt)" | + | As of 2009-11-20, the current MinGW version is 5.1.6, which includes GCC 3.4.5. |
- | ===== MinGW ===== | + | //tip: move the installer into an empty directory before starting it; it will download all the MinGW distribution files into that directory.// |
- | As of November 2009, the automated installer is useless; it installs gcc 3 instead of 4. You'll have to install MinGW manually using MSYS. | + | At this point, you may want to download bsdtar from http:// |
- | The following command will create and mount a directory | + | You may want to install InfoZip' |
- | | + | |
+ | $ cp zip.exe | ||
- | Next, download the packages you will need. | + | ===== MSYS ===== |
+ | Download the MSYS installer from | ||
+ | http:// | ||
- | * GCC: http:// | + | As of 2009-11-20, the latest MSYS version is 1.0.11. |
- | * BinUtils: http:// | + | |
- | * MinGW API: http:// | + | |
- | * MinGW Runtime: http:// | + | |
- | Then extract everything: | + | ===== Testing the toolchain ===== |
- | + | ||
- | $ for f in *tar.gz ; do tar zxvf $f -C /mingw ; done | + | |
- | $ for f in *tar.lzma ; do tar --lzma -xvf $f -C /mingw ; done | + | |
Let's see if our C compiler works: | Let's see if our C compiler works: | ||
Line 38: | Line 52: | ||
$ which gcc | $ 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 >hello.c | $ cat >hello.c | ||
#include < | #include < | ||
Line 50: | Line 69: | ||
$ which g++ | $ 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 > | $ cat > | ||
#include < | #include < | ||
Line 58: | Line 82: | ||
Hello, C++ world! | Hello, C++ world! | ||
- | And Fortran | + | And Fortran |
- | $ which gfortran | + | $ which g77 |
- | /mingw/bin/gfortran.exe | + | /mingw/bin/g77.exe |
- | $ cat >hello.f90 | + | $ g77 --version |
- | PROGRAM | + | GNU Fortran (GCC) 3.4.5 (mingw-vista special r3) |
- | | + | Copyright (C) 2004 Free Software Foundation, Inc. |
- | END PROGRAM HelloWorld | + | |
+ | 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 >hello.f | ||
+ | PROGRAM | ||
+ | | ||
+ | END | ||
^D | ^D | ||
- | $ gfortran | + | $ g77 -o hello hello.f |
$ ./ | $ ./ | ||
| | ||
- | ===== GNU Autotools | + | ===== lex & yacc ===== |
- | + | ||
- | ==== Download ==== | + | |
- | + | ||
- | === Autoconf === | + | |
- | + | ||
- | http:// | + | |
- | and | + | |
- | http:// | + | |
- | + | ||
- | === Automake === | + | |
- | + | ||
- | http:// | + | |
- | and | + | |
- | http:// | + | |
- | + | ||
- | === Libtool === | + | |
- | + | ||
- | http:// | + | |
- | You do //not// need any of the '' | + | Or rather, in our brave GNU world, flex and bison. |
- | ==== Install ==== | + | Download the following files from http:// |
- | | + | * the '' |
- | | + | * the '' |
- | ===== Boost jam ===== | + | For some unfathomable reason, both the flex and bison '' |
- | This utility is used to [[boost|compile the Boost libraries]]. | + | $ tar -kxf bison-2.4.1-lib.zip -C /MinGW |
- | Get it from http:// | + | |
- | ===== Additional Unix-like utilities ===== | + | This will install a shell script called ''/ |
- | You may want to install other programs, such as vim (http://downloads.sourceforge.net/ | + | #! /bin/sh |
+ | exec /mingw/bin/bison -y " | ||
===== WiX ===== | ===== WiX ===== |