Project hosted at

SourceForge

with
PmWiki
Faq /

Win32Gtk1

How to build (X)MedCon/DLL on MS Windows using Gtk+1 ?

This is the process of getting (X)MedCon to build on the MS Windows platform, using freely available tools only. Here we use the older Gtk+-1.3.0 release, so without the built-in gdk-pixbuf functionality. But first a general remark on path differences.

As we installed our MingW/MSYS environment on a newly created e: partition, the absolute path to our $HOME directory would be for:

MS-DOS/WIN: $HOME = e:\msys\home\<username>
MingW/MSYS: $HOME = e:/msys/home/<username>

[XX] Download required tools:

[01] the easiest part is to gather all the packages:
  • MingW/MSYS : from the "Current" section get following bin versions:
    • GCC core
    • MSYS .exe
    • MingW Runtime
    • MingW Utilities
    • Windows API
    • binutils
  • GtkWin32 : Gtk+ port and associated packages for MS Windows (DO NOT USE THE GTK+-2.0 PACKAGES)
    • gettext-runtime & gettext-tools
    • glib-2.4 & glib-dev-2.4
    • gtk+-1.3.0 & gtk+-dev-1.3.0
    • libiconv-bin
    • pkg-config
  • GnuWin32 : GNU packages ported to MS Windows
    • libpng-bin & libpng-lib
    • zlib-bin & zlib-lib
  • GdkPixbuf : get .tar.gz source package of the image display library (= 0.22.0)
  • build-scripts : shift-click to download helping scripts @ 09-Jul-2004 (note: could be unzipped by your browser)
  • XMedCon : get .tar.gz source package (>= 0.10.0)

<<Index | Top>>

[XX] Install MSYS/MingW environment + extras:

[02] install MingW => e:/mingw and unpack extras in here
[03] install MSYS => e:/msys (note: at postinstall, use UNIX style /-slashes for path to mingw)

[XX] Prepare MingW/MSYS environment:

[04] make a file $HOME/.profile and add the following lines: (using vi)
export PATH="$HOME/bin:/mingw/local/bin:/mingw/local/lib:$PATH"
export LD_LIBRARY_PATH="/mingw/local/lib"
export CFLAGS="-O3 -fsigned-char"
export CPPFLAGS="-I/mingw/local/include"
export LDFLAGS="-L/mingw/local/lib"
export PKG_CONFIG_PATH="/mingw/local/lib/pkgconfig"
[05] reopen any MingW/MSYS terminal windows to use the new environment variables
[06] make a directory $HOME/bin
[07] unpack build-scripts.tar.gz inside this directory (note: no dir included in tarball)
[08] make a directory /mingw/local
[09] unzip all GtkWin32 & GnuWin32 packages in the above directory (note: without CR/LF conversions)
[10] make a directory $HOME/build

<<Index | Top>>

[XX] Build GdkPixbuf library

[11] unpack gdk-pixbuf tarball in $HOME/build
[12] configure the project
$> ./configure --prefix=/mingw/local --disable-gtktest --disable-glibtest
[XX] fixes in ./ main dir
[13] remove in main ./Makefile the demo & doc references from "SUBDIR=" variable
[XX] fixes in ./gdk-pixbuf/pixops subdir
[XX] edit each assembler file .S in gdk-pixbuf/pixops subdir (MMX support)
[14] replace pixops_ => _pixops_ (note: routines must begin with underscore)
(optional: remove lines with ".type ...")
[XX] edit Makefile file
[15] #comment out line "PROGRAMS = "
[XX] fixes in ./gdk-pixbuf subdir
[XX]° edit gdk-pixbuf.c
[16] remove line with: #include <X11/Xlib.h>
[17] remove line with: Display gdk_pixbuf_dpy = NULL;
[XX] edit Makefile
[18] #comment out or remove libgdk_pixbuf_xlib.la from "lib_LTLIBRARIES = " variable
[19] #comment out formats with compile troubles: JPEG_LIB, XPM_LIB & TIFF_LIB
[20] #comment out programs with compile troubles: see "PROGRAMS = " variable
[21] make & install
$> make install
[22] create .dll from static library
$> cd /mingw/local/lib; a2dll libgdk_pixbuf.a -L/mingw/local/lib -lgdk -lgtk -lglib-2.0 -lgmodule-2.0
(note: only available in MingW/MSYS environment)

<<Index | Top>>

[XX] Build (X)MedCon Project

[23] unpack source tarball in $HOME/build
[24] configure
$> export LDFLAGS="-Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc $LDFLAGS"
(note: extra linker flags for smooth DLL(1) creation)
$> ./configure --prefix=/mingw/local --enable-gtk1 --disable-glibtest --disable-gtktest
[25] make & install
$> make install

Hereafter, you should at least be able to run the programs directly from the MingW/MSYS terminal window.

Have fun,

-eNlf-

(1) The resulting DLL isn't MSVC nor JNI compatible yet. Read through the entire MingW/MSYS faq on what to do afterwards.

<<Index | Top>>