Re: patch to improve uninstalled gtk+ handling
[email protected] Fri, 23 Oct 2009 20:36:05 +0900
| Newsgroups | gmane.comp.gnome.lib.librsvg.devel |
|---|---|
| Message-ID | <[email protected]> |
Dear Dominic, Thank you, I will send the patches gnome bugzilla too. Regards, mpsuzuki On Fri, 23 Oct 2009 07:27:52 -0400 Dominic Lachowicz <[email protected]> wrote: >Hi mpsuzuki, > >Thanks for the really nice work! Please send these patches to >http://bugzilla.gnome.org/, otherwise they will get lost or forgotten. > >Best, >Dom > >On Fri, Oct 23, 2009 at 6:41 AM, <[email protected]> wrote: >> Hi, >> >> Attached is a patch to improve configure's handling of >> uninstalled Gtk+. The Gtk+ library itself is detected >> by pkg-config, so uninstalled Gtk+ can be detected. >> However, in later, configure lookup the command >> "gdk-pixbuf-query-loaders" listing available gdk-pixbuf >> backend for various image file format. configure lookups >> it by normal AC_PATH_PROG() macro. Therefore, when Gtk+ >> is installed to system and the user is trying to build >> librsvg with uninstalled Gtk+, gdk-pixbuf-query-loaders >> from system is used. >> >> At present, autoconf macro AM_PATH_GTK_2_0() does not >> provide an abstract macro to use gdk-pixbuf-query-loaders >> of uninstalled Gtk+. I have to detect it by myself. >> >> Invoking gdk-pixbuf-query-loaders simply is insufficient. >> This command has a builtin information of the directory >> to lookup the loaders (e.g. /usr/local/lib/gtk-2.0/2.x.y/loaders). >> Of course, it is different from the building directory. >> So the list of uninstalled shared objects or GNU libtool >> libraries of the loaders should be passed to uninstalled. >> Attached patch generates ${top_builddir}/gdk-pixbuf.loaders >> for this purpose. >> >> Thus, when I use uninstalled Gtk+, QUERYLOADERS is not >> a pathname of the command, it should be a combination >> of the pathname of the command and the arguments. >> >> When "make check" is executed, private gdk-pixbuf.loaders >> should be used instead of the file searched by gdk-pixbuf >> builtin rule. I introduced new macro SET_GDK_PIXBUF_LOADERS. >> It include a sh command setting environmental variable >> GDK_PIXBUF_MODULE_FILE point to private gdk-pixbuf.loaders. >> It is executed as a part of "TESTS_ENVIRONMENT" while >> "make check" is executed. >> >> I'm not sure if this should be proposed to librsvg or Gtk+ >> developers. So, please give me comment. >> >> Regards, >> mpsuzuki >> >> >> diff --git a/tests/Makefile.am b/tests/Makefile.am >> index 4b07418..d2c8aab 100644 >> --- a/tests/Makefile.am >> +++ b/tests/Makefile.am >> @@ -1,6 +1,8 @@ >> __SUBDIRS=pdiff . >> >> __TESTS = rsvg-test >> +TESTS_ENVIRONMENT = \ >> + __ __ __ $(SET_GDK_PIXBUF_LOADERS) >> >> __LDADD = $(top_builddir)/librsvg-2.la __ __ __ __ __ \ >> __ __ __ __$(top_builddir)/tests/pdiff/libpdiff.la >> diff --git a/configure.in b/configure.in >> index 2d9517f..c144ddf 100644 >> --- a/configure.in >> +++ b/configure.in >> @@ -254,14 +254,45 @@ fi >> >> __AM_CONDITIONAL(ENABLE_GTK_ENGINE, test "x$enable_gtk_theme" = "xyes") >> >> -AC_PATH_PROG(QUERYLOADERS, gdk-pixbuf-query-loaders, true) >> +m4_pattern_allow([PKG_CONFIG_DISABLE_UNINSTALLED]) >> +m4_pattern_allow([PKG_CONFIG_TOP_BUILD_DIR]) >> + >> + >> +SET_GDK_PIXBUF_LOADERS= >> +gdk_installed=`env PKG_CONFIG_DISABLE_UNINSTALLED=yes $PKG_CONFIG --uninstalled gdk-pixbuf-2.0 && echo yes || echo no` >> +if test "x${gdk_installed}" = "xno"; then >> + __AC_MSG_WARN([check uninstalled gdk-pixbuf-query-loaders]) >> + __for gdk_pixbuf_libs_arg in `env PKG_CONFIG_TOP_BUILD_DIR=. $PKG_CONFIG gdk-pixbuf-2.0 --libs` >> + __do >> + __ __case ${gdk_pixbuf_libs_arg} in >> + __ __-*) ;; >> + __ __*la) >> + __ __ __case `basename ${gdk_pixbuf_libs_arg}` in >> + __ __ __libgdk_pixbuf*.la) >> + __ __ __ __gdk_pixbuf_builddir=`dirname ${gdk_pixbuf_libs_arg}` >> + __ __ __ __AC_MSG_WARN([generate gdk-pixbuf.loaders for libraries in ${gdk_pixbuf_builddir}]) >> + __ __ __ __QUERYLOADERS="${gdk_pixbuf_builddir}/gdk-pixbuf-query-loaders ${gdk_pixbuf_builddir}/libpixbufloader-*.la" >> + __ __ __ __${QUERYLOADERS} > gdk-pixbuf.loaders >> + __ __ __ __SET_GDK_PIXBUF_LOADERS='GDK_PIXBUF_MODULE_FILE=${top_builddir}/gdk-pixbuf.loaders' >> + __ __ __ __;; >> + __ __ __*) ;; >> + __ __ __esac >> + __ __ __;; >> + __ __*) ;; >> + __ __esac >> + __done >> +else >> + __AC_PATH_PROG(QUERYLOADERS, gdk-pixbuf-query-loaders, true) >> +fi >> +AC_SUBST(SET_GDK_PIXBUF_LOADERS) >> + >> >> __AC_ARG_ENABLE(pixbuf-loader, >> __ __ [ __--enable-pixbuf-loader __Enable a RSVG based GdkPixbuf loader [default=auto]], >> __ __ enable_pixbuf_loader="$enableval", enable_pixbuf_loader=auto) >> >> __if test "x$enable_pixbuf_loader" = xauto ; then >> - __ __if test x$QUERYLOADERS != x ; then >> + __ __if test "x$QUERYLOADERS" != x ; then >> __ __ __ __ enable_pixbuf_loader=yes >> __ __ else >> __ __ __ __ enable_pixbuf_loader=no >> >> ------------------------------------------------------------------------------ >> 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 >> _______________________________________________ >> Librsvg-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/librsvg-devel >> > > > >-- >"I like to pay taxes. With them, I buy civilization." -- Oliver Wendell Holmes ------------------------------------------------------------------------------ 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