+
+ if test "$have_gdk_pixbuf" = no; then
+ #
+ # the old way...
+ # run gdk-pixbuf-config based tests.
+ # note that we can't assume that the existence of "pkg-config" means
+ # that we don't have to look for gdk-pixbuf-config -- in Gnome 1.4,
+ # pkg-config exists, but doesn't know about pixbuf.
+ #
+
+ # if the user specified --with-gtk=/foo/ or --with-gnome=/foo/ then
+ # look in /foo/bin/ for for gdk-pixbuf-config.
+ #
+ gdk_pixbuf_path="$PATH"
+
+ if test ! -z "$gtk_dir"; then
+ # canonicalize slashes.
+ foo=`echo "${gtk_dir}/bin" | sed 's@//*@/@g'`
+ gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
+ fi
+
+ if test ! -z "$gnome_dir"; then
+ # canonicalize slashes.
+ foo=`echo "${gnome_dir}/bin" | sed 's@//*@/@g'`
+ gdk_pixbuf_path="$foo:$gdk_pixbuf_path"
+ fi
+
+ AC_PATH_PROGS(gdk_pixbuf_config, gdk-pixbuf-config,, $gdk_pixbuf_path)
+
+ # If we found the gdk-pixbuf-config program, run it to get flags.
+ #
+ if test -n "$gdk_pixbuf_config" ; then
+ AC_CACHE_CHECK([for gdk-pixbuf includes], ac_cv_gdk_pixbuf_config_cflags,
+ [ac_cv_gdk_pixbuf_config_cflags=`$gdk_pixbuf_config --cflags`])
+ AC_CACHE_CHECK([for gdk-pixbuf libs], ac_cv_gdk_pixbuf_config_libs,
+ [ac_cv_gdk_pixbuf_config_libs=`$gdk_pixbuf_config --libs`])
+
+ # note that "gdk-pixbuf-config --libs" produces a link line including
+ # -lgdk_pixbuf, but there's no way to get it to produce one that also
+ # includes -lgdk_pixbuf_xlib. Since we don't know *exactly* what the
+ # name of the library will be, construct it with sed...
+ # M4 sucks!!
+ changequote(X,Y)
+ ac_cv_gdk_pixbuf_config_libs=`echo $ac_cv_gdk_pixbuf_config_libs | \
+ sed 's@ \(-lgdk_pixbuf\([-_a-zA-Z0-9.]*\)\) @ \1 -lgdk_pixbuf_xlib\2 @'`
+ changequote([,])
+
+ ac_gdk_pixbuf_config_cflags=$ac_cv_gdk_pixbuf_config_cflags
+ ac_gdk_pixbuf_config_libs=$ac_cv_gdk_pixbuf_config_libs
+ fi
+ fi
+