CONFIGURING PACKAGES TO WORK WITH GMIME
---------------------------------------

Compiling a program succesfully against the GMime libraries can
require a large number of command line options to your compiler and
linker that are hard to guess correctly.

Several tools are included in this package to make process
easier.

First, there is the shell script 'gmime-config' (installed in
$exec_prefix/bin):

Invoking gmime-config
-------------------

gmime-config takes the following flags:

  --version
     Prints out the version of GMime installed

  --cflags
     Prints '-I' flags pointing to the installed header files.

  --libs
     Prints out the linker flags necessary to link a program against GMime
   
  --prefix[=PREFIX]
     If PREFIX is specified, overrides the configured value of $prefix.
     (And of exec-prefix, unless --exec-prefix is also specified)
     Otherwise, prints out the configured value of $prefix

  --exec-prefix[=PREFIX]
     If PREFIX is specified, overrides the configured value of $exec_prefix.
     Otherwise, prints out the configured value of $exec_prefix

Example of using gmime-config
---------------------------

Typically, gmime-config will be used within a configure script,
as described below. It, however, can also be used directly
from the command line to compile a simple program. For example:

  cc -o simple `gmime-config --cflags` simple.c `gmime-config --libs`

This command line might expand to (for example):

  cc -o simple -I/opt/gnome2/include/gmime-2.0 -D_REENTRANT \
    -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include \
    simple.c -L/opt/gnome2/lib -lgmime-2.0 -lnsl -lnsl \
    -Wl,--export-dynamic -L/opt/gnome2/lib -lgobject-2.0 -lgmodule-2.0 \
    -ldl -lgthread-2.0 -lpthread -lglib-2.0

Not only is the form using gmime-config easier to type, it will
work on any system, no matter how GMime was configured.


                                        Jeffrey Stedfast
                                        08 Feb 2003 
