Original version by Trevor Dearham (WhiteKnight)
MinGW And MSYS
Packages Used For MinGW
autoconf-2.59automake-1.9.6
binutils-2.16.91
gcc-core-3.4.4
gcc-g++-3.4.4
gcc-g77-3.4.4
gettext-0.14.1
libiconv-1.9.2
libtool-1.5.20
mingw-runtime-3.9
mingw-utils-0.3
w32api-3.5
Packages Used For MSYS
bison-2.0flex-2.5.4a
perl-5.6.1
MSYS-1.0.11
pkg-config-0.20
Where To Get Packages From
mingw-runtime-3.9 and w32api-3.5 where obtained from MinGW. pkg-config-0.20 can be obtained from GTK+ for Windows. The rest where from the package mingw-install-20050907.tar.gz obtained from MinGW-install.
-- Link for acquiring pkg-config seems obsolete, fresher link at 2009/10/15 is http://www.gtk.org/download-windows.html
Installing Packages
- Uncompress
mingw-install-20050907.tar.gz - Move
mingw-runtime-3.9.tar.gzandw32api-3.5.tar.gzinto themingw-install-20050907/mingwdirectory - Delete
ming-runtime-3.8.tar.gz,w32api-3.3.tar.gzandzlib-1.2.3-20050723-1.tar.gz, which are in themingw-install-20050907/mingwdirectory - Run
mingw-install-20050907/setup/MSYS-1.0.11-2004.04.30-1.exe - Yes to the continue with post install question.
- No to the do you have MinGW installed question.
- Run MSYS
- Using MSYS run
mingw-install-20050907/msys/install.sh - Using MSYS run
mingw-install-20050907/mingw/install.sh - Uncompress
pkg-config-0.20.zipinto "your MSYS directory"/1.0 e.g.msys/1.0 - Copy
/share/aclocal/pkg.m4to/mingw/share/aclocal/ - Then similar to Step 4 of this link:
- 1. Create a file
/bin/pkg-config.sh, with the contents
#!/bin/sh if pkg-config "$@" > /dev/null 2>&1 ; then res=true else res=false fi pkg-config "$@" | tr -d \\r && $res
2. Make a copy of /etc/profile, in case something goes wrong, and then open /etc/profile and change line 43 from:
export HOME LOGNAME MSYSTEM HISTFILE
to:
PKG_CONFIG=/bin/pkg-config.sh
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export HOME LOGNAME MSYSTEM HISTFILE PKG_CONFIG PKG_CONFIG_PATH
- 3. Quit msys and then rerun it, so that the environment variables get set.
OGRE Dependencies
Packages Used
For OGRE
Additional Packages For DevIL
Additional Package For cegui
Building Packages
The steps in this section assume that you have uncompressed the relevant package and that you have changed to that directory in MSYS. Also most of these packages, by default, will install to the /usr/local directory to change this use add --prefix={some directory} e.g.
--prefix=/mingw
to the configure script. Also note that MinGW, by default, will only read includes that are in the /mingw/include directory and libraries that are in the /mingw/lib directory. I will show you how to install to the /usr/local directory, as then this directory will then contain all the dependencies and as a result you will need to manually copy to the includes and libs to the /mingw directory or use the -I compiler option to specify the include file directory and the -L linker option to specify the link library directory.
The steps in this section also assume that you follow the installation of the packages in the order they are listed below.
Also, it is advisable to only keep the library files you wish to use, so if a particular package creates more that on library file, then delete the ones you don't want, e.g. zlib creates a static library (-+libz.a+-) and a dynamic link library (-+libzdll.a+- for linking at link time and zlib1.dll for runtime), so pick which one you want to keep and delete the other.
DevIL
zlib 1.2.3
- Open
win32/Makefile.gccand change line 34 from:
CFLAGS = $(LOC) -O3 -Wall
to:
CFLAGS = $(LOC) -mms-bitfields -O3 -Wall
- Run:
mkdir /usr/local mkdir /usr/local/include mkdir /usr/local/lib make -f win32/Makefile.gcc INCLUDE_PATH=/usr/local/include LIBRARY_PATH=/usr/local/lib make -f win32/Makefile.gcc install
jpeg 6b
Run:
./configure CFLAGS=-mms-bitfields make make install-lib
tiff 3.7.4
- 1. Open
jmorecfg.hfrom your/usr/local/includedirectory. - 1. Change line 161 from
- typedef long INT32
- to
- typedef int INT32
- to make it comply with the MS Windows header files.
- 2. Change line 226 from
#ifndef HAVE_BOOLEAN typedef int boolean; #endif
- to
//#ifndef HAVE_BOOLEAN typedef int boolean; //#endif
- 2. Run
./autogen.sh ./configure CFLAGS=-mms-bitfields CXXFLAGS=-mms-bitfields make make install
Note: Read DevIL's note before building this library.
libpng 1.2.8
- Get
libpng-1.2.8-mingwPORT.tar.bz2from MinGW. - Uncompress it to the same directory as
libpng. - Run:
patch -p1 < mingwPORT/mingwPORT.patch make -f scripts/makefile.mingw CFLAGS=-mms-bitfields make -f scripts/makefile.mingw prefix=/usr/local install
lcms 1.14
- 1. Open
include/lcms.hand change line 149 from typedef unsigned int DWORD, *LPDWORD;
to:typedef unsigned long DWORD, *LPDWORD;
to make it comply with the MS Windows header files.- 2. Open
msys\1.0\mingw\include\sys\stat.hand then add the following to line 194
#define S_IXOTH 0000001 #define S_IXGRP 0000010 #define S_IXUSR 0000100
- 3. Run
./configure CFLAGS=-mms-bitfields make make install
libmng 1.0.9
- 1. Open
/usr/local/include/icc34.hand change line 236 from
typedef u_int8_t icUInt8Number; typedef u_int16_t icUInt16Number; typedef u_int32_t icUInt32Number; typedef u_int32_t icUInt64Number[2];
- to
typedef unsigned char icUInt8Number; typedef unsigned short icUInt16Number; typedef unsigned int icUInt32Number; typedef unsigned int icUInt64Number[2];
- 2. Open
makefiles/makefile.mingw - 1. Change line 20 from
- Copy to clipboardOPTIONS = -DMNG_NO_CMS -DMNG_ACCESS_CHUNKS -DMNG_STORE_CHUNKS
- to
- Copy to clipboardOPTIONS = -DMNG_FULL_CMS -DMNG_ACCESS_CHUNKS -DMNG_STORE_CHUNKS
- 2. Change line 33 from
- #LCMSLIB=-llcms
- to
- LCMSLIB=-llcms
- 3. Change line 55 from
- Copy to clipboardCFLAGS=$(ZLIBINC) $(JPEGINC) $(LCMSINC) -Wall -O3 -funroll-loops $(OPTIONS) $(ALIGN)
- to
- Copy to clipboardCFLAGS=$(ZLIBINC) $(JPEGINC) $(LCMSINC) -Wall -O3 -funroll-loops $(OPTIONS) $(ALIGN) -mms-bitfields
- 3. Run
make -f makefiles/makefile.mingw make -f makefiles/makefile.mingw install
Note: This make install will install to /mingw.
DevIL 1.6.7
- Copy
/usr/local/include/lcms.hto/usr/local/include/lcms/lcms.h - Change
/usr/local/include/jmorecfg.hline 161 from:typedef long INT32;
to:typedef int INT32;
to make it comply with the MS Windows header files. - Run
./autogen.sh ./configure CFLAGS=-mms-bitfields make make install
Note: I could only get TIF to be a supported format was by linking tiff's dll files, as tiff's static library files have unresovled externals for zlib and jpeg.
cegui
xerces 2.7.0
- Download the mingw-msys patch from here.
- Put the patch in your
xercesdirectory e.g.~/xerces-c-src_2_7_0. - Go to that directory and run:
patch -p1 < xerces-c-src_2_6_0.patch
- Run
export XERCESCROOT={fill in your path to the base of xerces}e.g.export XERCESCROOT=/home/Trevor/xerces-c-src_2_7_0
Note: Don't use~, as it will not resolve to being your home directory. - Then go to
src/xercescand run:
./runConfigure -p mingw-msys -c gcc -x g++ -z -mms-bitfields make make install
freetype 2.1.10
Run:
./autogen.sh ./configure CFLAGS=-mms-bitfields make make install
cegui 0.4.1
I could only get this to build with the help of Code::Blocks, which uses MinGW. I couldn't get MinGW to import and export correctly with MSYS, but it did compile it and therefore it should be possible to build cegui with MSYS.
- Download the patch for cegui here and put it in your cegui source directory.
- Using MSYS run the following from your cegui source directory:
patch -p1 < cegui.patch
- Download the latest Code::Blocks project files (CB_mingw_files.zip) from here.
- Extract the Code::Blocks project files to the cegui directory.
- Create a
dependenciesdirectory inside your cegui source directory and inside that directory create anincludeand alibdirectory. - Copy the contents
freetype'sincludedirectory andxerces'ssrcintodependencies/includeandfreetype'sobjs\.libs\libfreetype.aandxerces'sxerces-c-src_2_7_0\lib\libxerces-c.dllintodependencies/lib. - Open
makefiles\win32\CB_Mingw\CEGUI.workspacewith Code::Blocks. - Go to
Build optionsofCEGUIBase.- Open the
Linkertab and changefreetype.dlltofreetypeand addxerces-cfor both build targets. - Open the
Compilertab and then the#definestab inside and add the follow define, so thatxerceswill be used instead oftinyxml:CEGUI_WITH_XERCES
- Open the
- Right click on
DirectX9GUIRendererand selectActivate Projectand then hold down the crtl and shift keys and then press the down arrow untilDirectX9GUIRendereris belowFalagardBase. Use the sample technique to moveOpenGLGUIRendererbelowFalagardBase. This should allow you to only buildCEGUIBase,TaharezLook,WindowsLookandFalagardBase, as this is all you should need. - Build the workspace.
Note:
- If you get a link error when building
CEGUIBasewhich contains the following text:undefined reference to inflate, inflateEnd, inflateResetandinflateInit2_, then add open theBuild optionsforCEGUIBaseand then theLinkertab and addzdlland then copylibzdll.atodependencies/lib. - You don't need to build
CEGUISampleHelper, the samples and the DirectX and OpenGL renderers, and therefore it goes out of the scope of this wiki and therefore above I haven't mention the changes necessary to build them.
OGRE Dependencies Not Already Built
zziplib 0.13.44
I could only get this to build with the help of Code::Blocks, which uses MinGW.
- 1. Import
msvc7/zziplib.slninto Code - :Blocks.
- 2. Go to the
Build optionsand select theDirectoriestab and then theCompilertab inside it and then do the following for all build targets. - 1. Add the directory where you have put the include files for
zlib. - 2. Add
..\zzip
to the directories list. - 3. Open the
Directoriestab'sLinkertab and then addzlib's library file for all buld targets. - 4. Open the
Compilertab'sOther optionstab and add the following for all build targets -mms-bitfields
- 5. Open
zzip\_config.hand change line 9 from
#ifndef ZZIP_HAVE_BYTESWAP_H #define ZZIP_HAVE_BYTESWAP_H 1 #endif
- to
//#ifndef ZZIP_HAVE_BYTESWAP_H //#define ZZIP_HAVE_BYTESWAP_H 1 //#endif
- 6. Build the workspace.
ode 0.5
- Open
config/user-settings.- Change line 14 from:
PLATFORM=unix-gcc
to:PLATFORM=mingw
. - Change line 44 from:
#OPCODE_DIRECTORY=OPCODE
to:OPCODE_DIRECTORY=OPCODE
- Change line 14 from:
- Run:
make configure make ode-lib
Cg 1.4
- Using
MinGW, go toCg'slibdirectory. - Run:
reimp -c cg.lib
This should create two files, namely cg.def and libcg.a.