New Document

## MINGW Notes

Last Update: June 4 2003
Author: Blas Rodriguez Somoza blas@puertareal.com

### 0.-Introduction

The MSYS/MINGW build was started with 1.5 beta 4.

The only difference between the msvc build and the mingw build, is that the later one does not support the ms SEH exception handling. This means that some exceptions will not be catched and thus FB will abort.The sources using this exception handling are jrd/blob_filter.cpp, jrd/exe.cpp and jrd/fun.epp.

This port is maintained by Blas Rodriguez Somoza and Dmitry Sibiriakov.

### 1.-TODO

- Build of fb_util.dll
- Analyze thread issue in blocking thread (classic server).
- Support for ms SEH (superserver).
- Installer definition

### 2.-INSTALLING MSYS and MINGW

The following packages from http://www.mingw.org are needed

MinGW

- MinGW-2.0.0-3.exe
- MinGW_win32api-2.3.tar.gz
- mingw-runtime-3.0.tar.gz
- bison-1.875.0-2003.02.10-1.exe

MSYS

- MSYS-1.0.8.exe
- msysDTK-1.0.1.exe

STEPS TO INSTALL

1. run MinGW-2.0.0-3.exe
2. uncompress w32api-2.3.tar.gz in the mingw directory (default c:\mingw)
3. uncompress mingw-runtime-3.0.tar.gz in the mingw directory (default c:\mingw)
4. uncompress gcc-3.2.3-20030504-1.tar.gz in the mingw directory (default c:\mingw)
5. run bison-1.875.0-2003.02.10-1.exe. You must give the program the mingw installation directory
6. run MSYS-1.0.8.exe. First you must select your installation directory, then, in a command window, you must awswer some questions
   continue postinstall [yes]
   mingw directory:[your mingw directory]
7. run msysDTK-1.0.1.exe. The installation directory must be the same that you select for MSYS.

### 3.- PATCHES TO BUILD FILES

- The lib_fb_udf target in Make.in.extlib cannot be built yet, so it must be removed.
  Edit the file Makefile.in.extlib in the builds/posix directory and change the line
  all: lib_ib_udf lib_ib_util lib_fb_util
  to
  all: lib_ib_udf lib_ib_util

### 4.- BUILD PROCESS

1. Start msys with the icon.
2. Go to the firebird2 root directory. For instance, if your root is d:\cvs\firebird you must do cd /d/cvs/firebird2.
3. Start configure with the switches to get super/classic and production/development build, for instance:
   autogen.sh --enable-superserver
   The valid switches for autogen are
   --enable-superserver Select superserver build, default classic build.
   --enable-debug Select debug build, default production build.
4. Make the build. For instance if you want to get compiler messages isolated from make log
   make > make.log 2>comp.log
5. After the build finish, the firebird directory with the binaries is created as gen/firebird.

- To make a clean build from scratch after making changes to the code use the clean.sh script

BUILD NOTE:

There is a bug in mingw (3.2) related with msvc format for 64bit integers. When the I64 format is used, the compiler throws warnings of two types:

warning: [...] format, different type arg (arg 3)
or
warning: unknown conversion type character `I' in format
warning: too many arguments for format