Home | Blog | Recent Changes | Page Index | Site Map
History: Home > Setting Up a Build Environment

Setting Up a Build Environment

The Bare Environment
Get and install MinGW from www.mingw.org (I used the 5.1.3 installer on 21 Dec 2007) - You need the base components and g++, when the installer asks.
Get and install MSYS from www.mingw.org (I used the 1.0.10 installer) - make sure to tell it where you installed MinGW at the appropriate point in the installer. (That means you want to choose y, y, c:/mingw if you used the defaults, as I suggest)
Download these files from the MinGW web site: msys-automake-1.8.2.tar.bz2, msys-autoconf-2.59.tar.bz2, msys-libtool-1.5.tar.bz2, and unzip them all into c:\MSYS\1.0 or equivalent. These will likely be the only files you ever install into MSYS/1.0 - everything else goes in mingw

at this point, I created a "bare environment" archive, so I can get back to here easily without re-installing

Things You Should Probably Add

In order to really use the environment (that is, use auto* that you just updated), you'll need Perl:
Download and install the latest ActivePerl from http://activestate.org/Products/Download/Download.plex?id=ActivePerl (Use the MSI package) to a nice location like C:\Perl

If you want to use CVS or SVN, I'd recommend just getting the Tortoise versions of them - the nicest GUI interface you can imagine for these tools.

You probably want pkg-config (0.20), which makes most of the dependencies available. Get it at ftp://ftp.gnome.org/pub/gnome/binaries/win32/dependencies

How To Install Dependencies
You'll find many zipped dependencies - I link to many of them in my instructions. Generally, these unzip into a bunch of directories - bin, include, lib, and so on. If you have a whole ton of dependencies to install at once, and you know they're all nice like this, you can select them all, right click, and choose "7-zip -> Extract here" (You do have www.7-zip.org installed, right?), then drag the directories created into c:/mingw. It will ask you if you want to overwrite the directories, you say yes. What you're essentially doing is overlaying/installing those dependencies into your build system.

The following dependencies I have run across do not follow these guidelines, so you'll have to figure it out:
libxml2 from zlatkovic - this apparently is a little goofy anyway and should be avoided.
zlib from www.zlib.net - This is a good binary, just read the documentation it comes with to see how to install it.

A Tip About Pkg-Config
This is a useful tool. When you're building something that uses it, you'll want to either pre-pend PKG_CONFIG_PATH=/mingw/lib/pkg-config to the command, or run export PKG_CONFIG_PATH=/mingw/lib/pkg-config when you start your MSYS shell, so that it can find your dependencies properly.

A Tip About Prefixes And Building Dependencies
If you're building something that might be used as a dependency, use --prefix=/mingw when running configure, and then use make DESTDIR=/c/binaries/blablabla install to install - this will prepare it for use in any MinGW setup like this, and you can zip up the directories inside c:\binaries\blablabla and you now have packaged that dependency properly!

A Note About Documentation
If you are building something, start from a blank build environment, add only the dependencies you know (if any) are needed, and attempt a build. Add the requested dependencies, and try again. When you have a minimal set of dependencies, document it somewhere that google can find it, to make all of our lives easier. If you have to use a goofy configure command to compile it, that's also good to know.
Login | Edit this page | Setting_Up_a_Build_Environment mailing list