This page contains information about Gnome-DB on Microsoft Windows.
The only compilation environment tested is using the GCC compiler in a MinGW cross-compilation environment on a Linux box and the native MingW compiler on a Windows machine. The compiled DLLs and executable files natively use the Windows API and don't require any abstraction DLL. If you have any experience with compiling Gnome-DB on another environment (GCC running on Cygwin, or building with MSVC), please tell me so I can update this information.
The resulting DLLs and executable have been tested on a WinXP environment. There should be no problem with other versions of Windows as long as it is supported by the dependencies and the MinGW environment. Again if you have successfull (or not) experiences with other versions of Windows, please tell me.
GCC in MinGW cross compilation
The first step is to install the cross compilation environment. The MinGW page contains little information about how to set up such an environment, but depending on your Linux distribution, the install is fairly simple:
for Debian/Ubuntu: sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
for Fedora/OpenSUSE: see http://mirzam.it.vu.nl/mingw/
for Gentoo: emerge xmingw xmingw
manual installation: see Steps to build a Linux hosted MinGW cross-compilation environment
The Gnome-DB dependencies are required before compiling, they are available for download from the Gnome FTP server. To compile, the DLL and the dev ZIP files are required (to run, only the DLL packages are required). The dependencies are:
- cairo, gettext, libiconv, libjpeg, libpng, libtiff, libxml2, zlib (in dependencies)
All these ZIP files must be uncompressed into the same directory (such as /local/Win32).
Compiling natively on Windows with MingW
You can also compile libgda and gnome-db natively on Windows with the mingw compiler. You need to install the mingw compiler and the msys shell, both of which are available at http://www.mingw.org. msys is a minimal unix-like shell environment for Windows to execute configure scripts in.
Then, you need to install libgda's dependencies. They are available from the same location as described above. I installed these into my msys base directory at C:\msys. You need both runtime and development packages. For the compiler to find the include files and libraries, write something like this in a file called ~/.profile (or something like C:\msys\home\username\.profile if you are not within the msys shell):
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/local/lib/pkgconfig export CFLAGS="-I/include" export CXXFLAGS="-I/include" export CPPFLAGS="-I/include" export LDFLAGS="-L/lib"
(perhaps CPPFLAGS is already enough). Then, you need to install the dependencies for the providers you want to enable in gda. I only tried postgresql so far (apart from the included sqlite). There might be binary packages available, but it is also possible to build it from source: Get a tarball from http://www.postgresql.org and unpack it into your msys home directory. Type
The -D_SYS_TIME_H is to prevent postgresql from including sys/time.h. The gettimeofday() declaration in that header would otherwise conflict with postgres' own implementation. Now, running make and make install should run without problems. When finished, you need to add the following into your ~/.profile, since postgres was installed in /local/pgsql:
PATH: /local/pgsql/lib CFLAGS: -I/local/pgsql/include CXXFLAGS: -I/local/pgsql/include LDFLAGS: -L/local/pgsql/lib
Again, perhaps CPPFLAGS instead of CFLAGS and CXXFLAGS works, too. Before proceeding, relogin into the msys shell for the changes to take effect.
Then, load a libgda tarball, unpack it into your msys home directory and run ./configure && make && make install. If your tarball is older than 3.1.3, then you probably need to configure with LDFLAGS="-liberty" because of bug #502481.
An environment must be set-up for cross compilation, to avoid finding and using native libraries. Setting up that environment is done using shell environment variables. The links above show various scripts for that purpose; I recommend using this mingw-configure script (see How to guide for cross-compiling GTK+ for Win32)
set the GTK_PREFIX environment variable must be set to where the ZIP files have been uncompressed (/local/Win32 for example)
run the mingw-configure script in the top directory of libgda instead of the usual configure script (note that the configure script must exist because it is called by the mingw-configure script)
run the usual make and make install commands
Each time you call mingw-configure, you need to pass it a prefix where you would like to install the compilation resulting files (DLL, EXE, and other ressources), this should be somewhere that does not conflict with your system files (e.g., do NOT install it to /usr), and it probably should not be where your mingw runtime and compiler are installed. It is recommended to use the same directory as the GTK_PREFIX value (for instance mingw-configure --prefix=$GTK_PREFIX), otherwise, see this page.
Libgda install .pc files which are used by pkg-config when building programs which use those libraries. If the install prefix is different than the GTK_PREFIX, then the cross compilation environment must be modified to take the location of the .pc files into account, see this page for more information.
This script creates a wrapper script around the pkg-config program, in fake-bin/pkg-config
This paragraph deals with installation in a Windows environment.
Unzip the dependencies ZIP files mentionned above (not the dev ones, they are not needed at this point) into some folder on the Windows machine, for example C:\Devel, then add C:\Devel\bin to your PATH. (In case some of the DLLs end up in the lib folder, move them to the bin folder.)
How to manipulate PATH depends on your Windows version. For NT, Windows 2000 and XP, use the Control Panel's System tool.
The files generated when running make install for libgda can then be copied into some folder on the Windows machine (which does not need to be the same as for the dependencies).