## MINGW Notes

First version: Mar 6 2003
Last Update: Jul 21 2004
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

- Support for ms SEH (superserver).
- Executable size problem. The executables are too great.
- DLL entrypoint definition. The fbclient.dll have a lot of unneeded entrypoints.

### 2.-INSTALLING MSYS and MINGW

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

MinGW

- MinGW-3.1.0-1.exe
- bison-1.875.0-2003.02.10-1.exe

MSYS

- MSYS-1.0.10.exe
- msysDTK-1.0.1.exe

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

- InnoSetup QuickStart Pack 4.2.1

  STEPS TO INSTALL

  1. run MinGW-3.1.0-1.exe. You must select the installation directory (default to c:\MINGW)
  2. run bison-1.875.0-2003.02.10-1.exe. You must give the program the mingw installation directory
  3. run MSYS-1.0.10.exe. First you must select your installation directory (default to c:\msys\1.0), then, in a command window, you must awswer some questions:
     Do you wish to continue with the post install? [yn] ANSWER y
     Do you have mingw installed? [yn] ANSWER y
     Where is your mingw installation? ANSWER your mingw directory using slashes (as in unix) no backslashes (as in windows)
  4. run msysDTK-1.0.1.exe. You must the msys installation directory as the installation directory for msysDTK (default to c:\msys\1.0).
  5. run ispack-4.2.1.exe if you want to make a executable installer

  ### 3.- 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

  ### 4.- INSTALL.

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

  1. Open firebird2/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 firebird2/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 CVS 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 *