Small improvement to use uninstalled GLib
[email protected] Fri, 9 Oct 2009 02:49:52 +0900
| Newsgroups | gmane.comp.gnome.lib.librsvg.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Librsvg maintainer,
Recently I'm trying to build Gtk+ related softwares with
built-but-not-installed-yet (uninstalled) libraries.
I find that librsvg/Makefile.am uses glib-mkenums
that cannot be found in PATH when GLib is not installed.
Following is the patch (for git head) to invoke it by
GLIB_MKENUMS, which is configured by AM_PATH_GLIB_2_0()
and useful to invoke the command before installation.
Please check.
diff --git a/Makefile.am b/Makefile.am
index 82dd543..5a90404 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -153,7 +153,7 @@ librsvg-enum-types.h: s-enum-types-h
@true
s-enum-types-h: $(headers) Makefile
- ( cd $(srcdir) && glib-mkenums \
+ ( cd $(srcdir) && $(GLIB_MKENUMS) \
--fhead "#ifndef __LIBRSVG_ENUM_TYPES_H__\n#define __LIBRSVG_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
--fprod "/* enumerations from \"@filename@\" */\n" \
--vhead "GType @enum_name@_get_type (void);\n#define RSVG_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
@@ -167,7 +167,7 @@ librsvg-enum-types.c: s-enum-types-c librsvg-enum-types.h
@true
s-enum-types-c: $(headers) Makefile
- ( cd $(srcdir) && glib-mkenums \
+ ( cd $(srcdir) && $(GLIB_MKENUMS) \
--fhead "#include \"librsvg-enum-types.h\"\n#include \"rsvg.h\"" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
diff --git a/configure.in b/configure.in
index dd64a2b..af0fd39 100644
--- a/configure.in
+++ b/configure.in
@@ -10,6 +10,7 @@ LIBXML_REQUIRED=2.4.7
CAIRO_REQUIRED=1.2.0
PANGOFT2_REQUIRED=1.2.0
PANGOCAIRO_REQUIRED=1.10.0
+GTK_REQUIRED=2.6.0 dnl Required to build test-display
AC_SUBST(GDK_PIXBUF_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
@@ -17,6 +18,7 @@ AC_SUBST(GIO_REQUIRED)
AC_SUBST(CAIRO_REQUIRED)
AC_SUBST(LIBXML_REQUIRED)
AC_SUBST(PANGOFT2_REQUIRED)
+AC_SUBST(GTK_REQUIRED)
dnl ===========================================================================
@@ -80,20 +82,19 @@ AM_CONDITIONAL(OS_WIN32, test "$native_win32" = "yes")
dnl ===========================================================================
-PKG_CHECK_MODULES(GLIB, \
- glib-2.0 >= $GLIB_REQUIRED \
- gthread-2.0 >= $GLIB_REQUIRED)
-AC_SUBST(GLIB_LIBS)
-AC_SUBST(GLIB_CFLAGS)
-
-PKG_CHECK_MODULES(LIBRSVG, \
- gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED \
- glib-2.0 >= $GLIB_REQUIRED \
- libxml-2.0 >= $LIBXML_REQUIRED \
- pangoft2 >= $PANGOFT2_REQUIRED \
- pangocairo >= $PANGOCAIRO_REQUIRED \
- cairo >= $CAIRO_REQUIRED \
- cairo-png >= $CAIRO_REQUIRED \
+dnl setup GLIB_MKENUM
+AM_PATH_GLIB_2_0($GLIB_REQUIRED, [have_glib=yes], [have_glib=no], [glib gio gthread])
+
+
+PKG_CHECK_MODULES(LIBRSVG,
+ gtk+-2.0 >= $GTK_REQUIRED
+ gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED
+ glib-2.0 >= $GLIB_REQUIRED
+ libxml-2.0 >= $LIBXML_REQUIRED
+ pangoft2 >= $PANGOFT2_REQUIRED
+ pangocairo >= $PANGOCAIRO_REQUIRED
+ cairo >= $CAIRO_REQUIRED
+ cairo-png >= $CAIRO_REQUIRED
fontconfig >= $FONTCONFIG_REQUIRED
freetype2)
However, the header file structure of installed Gtk+ is
incompatible with that of uninstalled Gtk+ working directory,
so now it is impossible to build librsvg with uninstalled
Gtk+. I've posted a patch to hide the incompatibility
to gtk-devel list.
http://mail.gnome.org/archives/gtk-devel-list/2009-October/msg00055.html
Next, I'm thinking of freetype2-uninstalled.pc for FreeType2.
I wish it can help Tom Dalton.
Regards,
mpsuzuki
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference