Build procedure for MinGW compiler

## MINGW Notes

First version: Mar 6 2003
Last Update: Mar 21 2010
Authors: Blas Rodriguez Somoza (blas at puertareal dot com), Dmitry Sibiryakov (aafemt at mail dot ru)

### 0.-Introduction

The MSYS/MINGW build was started with 1.5.x

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 not maintained anymore.

### 1.-TODO

- Support for ms SEH (superserver).
- Executable size problem. The executables are too great. (Partially solved by stripping symbols in production build.)

### 2.-INSTALLING MSYS and MINGW

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

MinGW

- GCC 4.7.2 or better

MSYS

- MSYS
- msysDTK

If you intend to build an executable installer you will also need to download InnoSetup from http://www.jrsoftware.org

- InnoSetup
- InnoSetup QuickStart Pack

STEPS TO INSTALL

1. Install MinGW, MSYS and msysDTK using appropriate instructions for each package.
2. Optionally install Bison.
3. Install InnoSetup and InnoSetup QuickStart Pack if you want to make a executable installer

### 3.- BUILD PROCESS

1. Start msys with the icon.
2. Go to the firebird root directory. For instance, if your root is d:\svn\firebird you must do cd /d/svn/firebird.
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.
   You can run ./configure --help to see full list of switches.
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.

You can use 'make clean' to delete files created during build process when you don't need them anymore. 'make clean_all' will do even more clean. :)

BUILD NOTE:

There is a bug in MinGW GCC (<=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

### 4.- INSTALL.

To create an installable build you need to execute the InnoSetup script.

1. Open firebird/builds/install/arch-specific/mingw/super/FirebirdInstall_15.iss with InnoSetup.
2. Run the script with F9 or Run->Run
3. Close InnoSetup

A executable installer will be in firebird/builds/install/arch-specific/mingw/super/

To install the build, simply run the resulting exe.

### 5.- TROUBLESHOOTING

AUTOGEN

The autogen script creates an output file in the same directory where it is executed with the name config.out. If the autogen fails look at config.out first.

Some permission problems, most probably related with the svn client, has been reported. If the autogen gives a permission related error, like
autom4te: cannot open configure: Permission denied
execute in the same directory:
>chmod -R +uw *