Re: inclusion of vfs modules
- From: Iago Rubio <iago iagorubio com>
- To: gtk-app-devel-list gnome org
- Subject: Re: inclusion of vfs modules
- Date: Fri, 29 Jul 2005 10:50:47 +0200
On Fri, 2005-07-29 at 09:39 +0200, The Saltydog wrote:
In my program I need to include the right header for
gnome_vfs_get_file_mime_type. I have found that the header is in
/usr/include/gnome-vfs-module-2.0/libgnomevfs/gnome-vfs-mime.h. If I
put this include line:
#include <libgnomevfs/gnome-vfs-mime.h>
the module is not found, even if I add the right path for inclusion.
The only way to let my program find the header is this:
#include <gnome-vfs-module-2.0/libgnomevfs/gnome-vfs-mime.h>
I'm sure a better fix is to make configure somehow add
-I/usr/include/gnome-vfs-module-2.0 to GNOME_CFLAGS and just
#include <libgnomevfs/gnome-vfs-mime.h>, but I don't know how to do
that :(
`man pkg-config`, try "pkg-config --cflags gnome-vfs-2.0".
You should add a pkg-config check to your configure script.
To do it you must add it to your configure.in or configure.ac and then
run autoconf to commit the changes.
Open your configure.in (or *.ac) and add this lines:
echo -n "checking for gnome-vfs-2.0... "
if pkg-config --exists gnome-vfs-2.0 ; then
echo "ok"
VFSFLAGS=`pkg-config --cflags gnome-vfs-2.0`
VFSLIBS=`pkg-config --libs gnome-vfs-2.0`
CFLAGS="$CFLAGS $VFSFLAGS"
LIBS="$LIBS $VFSLIBS"
else
echo "failure"
AC_MSG_ERROR(gnome-vfs-2.0 not found please install the gnome
development package)
fi
I'm supossing you use CFLAGS and not PKG_CFLAGS or other variable names
to hold the compiler flags, and you use LIBS and not PKG_LIBS to hold
linker flags.
If your configure.[in|ac] have the line:
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
You can then use the following code - copy it before the
PKG_CHECK_MODULES line.
echo -n "checking for gnome-vfs-2.0... "
if pkg-config --exists gnome-vfs-2.0 ; then
echo "yes"
pkg_modules="$pkg_modules gnome-vfs-2.0"
else
echo "no"
AC_MSG_ERROR(gnome-vfs-2.0 not found please install the gnome
development package)
fi
Remember to run autoconf after the changes to let autotools convert your
configure.[in|ac] to a "configure" script, and then run configure itself
to commit the changes to the Makefiles.
Regards.
--
Iago Rubio
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]