Difference between revisions of "OpenDBX/Setup/Windows/Building with MinGW"
(Separate MinGW page) |
(MySQL backend instructions for Win32) |
||
Line 26: | Line 26: | ||
Please note that it seems not be possible to use "Program Files" instead of "Progra~1" as this leads to a weird error message that the C compiler cannot create executables. | Please note that it seems not be possible to use "Program Files" instead of "Progra~1" as this leads to a weird error message that the C compiler cannot create executables. | ||
+ | |||
+ | == Backends == | ||
All backends could be build invoking ./configure like shown below. Please keep in mind that the paths may differ depending on the location of the installed packages: | All backends could be build invoking ./configure like shown below. Please keep in mind that the paths may differ depending on the location of the installed packages: | ||
+ | |||
+ | === MySQL === | ||
+ | |||
+ | For building the OpenDBX MySQL backend, you need to install the [http://dev.mysql.com/downloads/mysql/5.1.html#win32 "Windows Essentials"] available in the download section of the MySQL website. A minimal install must consist of | ||
+ | |||
+ | Client Programs -> MySQL Command Line Utilities | ||
+ | C Include Files / Lib Files | ||
+ | |||
+ | Otherwise, the libmysql.dll file isn't installed in the "bin\" directory and the files in the "include\" and "lib\opt\" directory are not available. | ||
+ | |||
+ | The OpenDBX MySQL backend doesn't build out of the box as the mysql.h file is not prepared to be used with MinGW. Fortunately, applying a simple hack to the mysql.h file does fix the problem: Change the line | ||
+ | |||
+ | #ifdef __CYGWIN__ | ||
+ | |||
+ | to | ||
+ | |||
+ | #ifndef __CYGWIN__ | ||
+ | |||
+ | and you are able to use the mysql.h file for compilation. Otherwise, you will get a lot of error messages. | ||
+ | |||
+ | The call to the ./configure script depends on the location of the files. The paths below are for MySQL 5.1 and if you've installed a different version or installed it to a different path, please adapt the paths as necessary. Especially the "MySQLS~1.1" part has to be changed for different versions of the MySQL package. | ||
+ | |||
+ | CPPFLAGS=" \ | ||
+ | -I/c/Progra~1/MySQL/MySQLS~1.1/include/ \ | ||
+ | " \ | ||
+ | LDFLAGS=" \ | ||
+ | -L/c/Progra~1/MySQL/MySQLS~1.1/bin \ | ||
+ | -L/c/Progra~1/MySQL/MySQLS~1.1/lib/opt \ | ||
+ | " \ | ||
+ | ./configure --with-backends="mysql" | ||
+ | |||
+ | === Other === | ||
CPPFLAGS=" \ | CPPFLAGS=" \ | ||
− | |||
-I/c/Progra~1/PostgreSQL/8.3/include/ \ | -I/c/Progra~1/PostgreSQL/8.3/include/ \ | ||
-I/c/Progra~1/Firebird/Firebird_2_1/include/ \ | -I/c/Progra~1/Firebird/Firebird_2_1/include/ \ | ||
Line 38: | Line 71: | ||
" \ | " \ | ||
LDFLAGS=" \ | LDFLAGS=" \ | ||
− | |||
− | |||
-L/c/Progra~1/PostgreSQL/8.3/bin \ | -L/c/Progra~1/PostgreSQL/8.3/bin \ | ||
-L/c/Progra~1/Firebird/Firebird_2_1/lib \ | -L/c/Progra~1/Firebird/Firebird_2_1/lib \ | ||
Line 47: | Line 78: | ||
-L/c/Progra~1/GnuWin32/lib \ | -L/c/Progra~1/GnuWin32/lib \ | ||
" \ | " \ | ||
− | ./configure --with-backends="mssql | + | ./configure --with-backends="mssql odbc oracle pgsql sqlite3 sybase" |
Revision as of 19:00, 7 July 2009
MinGW is a collection of freely available and freely distributable Windows specific header files and import libraries, augmenting the GNU Compiler Collection, (GCC), and its associated tools, (GNU binutils). MinGW provides a complete Open Source programming tool set which is suitable for the development of native Windows programs that do not depend on any 3rd-party C runtime DLL.
Download the following packages from the MinGW Sourceforge page:
- Automated MinGW installer
- MSYS base system (executable of current release)
There are some tutorials available, how to install MinGW:
The steps to build the OpenDBX library are the same as in the Unix environment.
It's hard to build the applications in the "utils/" directory because of the dependencies. The easiest way is to disable building the utilities. Alternatively, you can try installing the required header and library files (complete sources) for Windows:
By default, the packages are installed in "C:\Program Files\GnuWin32", so you have to add the "include/" and "lib/" directory to ./configure:
CPPFLAGS="-I/c/Progra~1/GnuWin32/include" \ LDFLAGS="-L/c/Progra~1/GnuWin32/lib" \ ./configure --with-backends="sqlite3"
Please note that it seems not be possible to use "Program Files" instead of "Progra~1" as this leads to a weird error message that the C compiler cannot create executables.
Backends
All backends could be build invoking ./configure like shown below. Please keep in mind that the paths may differ depending on the location of the installed packages:
MySQL
For building the OpenDBX MySQL backend, you need to install the "Windows Essentials" available in the download section of the MySQL website. A minimal install must consist of
Client Programs -> MySQL Command Line Utilities C Include Files / Lib Files
Otherwise, the libmysql.dll file isn't installed in the "bin\" directory and the files in the "include\" and "lib\opt\" directory are not available.
The OpenDBX MySQL backend doesn't build out of the box as the mysql.h file is not prepared to be used with MinGW. Fortunately, applying a simple hack to the mysql.h file does fix the problem: Change the line
#ifdef __CYGWIN__
to
#ifndef __CYGWIN__
and you are able to use the mysql.h file for compilation. Otherwise, you will get a lot of error messages.
The call to the ./configure script depends on the location of the files. The paths below are for MySQL 5.1 and if you've installed a different version or installed it to a different path, please adapt the paths as necessary. Especially the "MySQLS~1.1" part has to be changed for different versions of the MySQL package.
CPPFLAGS=" \ -I/c/Progra~1/MySQL/MySQLS~1.1/include/ \ " \ LDFLAGS=" \ -L/c/Progra~1/MySQL/MySQLS~1.1/bin \ -L/c/Progra~1/MySQL/MySQLS~1.1/lib/opt \ " \ ./configure --with-backends="mysql"
Other
CPPFLAGS=" \ -I/c/Progra~1/PostgreSQL/8.3/include/ \ -I/c/Progra~1/Firebird/Firebird_2_1/include/ \ -I/c/Progra~1/sybase/OCS-15_0/include/ \ -I/c/Progra~1/Oracle/product/11.1.0/instantclient_11_1/sdk/include \ -I/c/Progra~1/GnuWin32/include \ " \ LDFLAGS=" \ -L/c/Progra~1/PostgreSQL/8.3/bin \ -L/c/Progra~1/Firebird/Firebird_2_1/lib \ -L/c/Progra~1/Firebird/Firebird_2_1/bin \ -L/c/Progra~1/sybase/OCS-15_0/dll \ -L/c/Progra~1/Oracle/product/11.1.0/instantclient_11_1 \ -L/c/Progra~1/GnuWin32/lib \ " \ ./configure --with-backends="mssql odbc oracle pgsql sqlite3 sybase"