--- configure.orig	Fri Feb 28 02:13:12 2003
+++ configure	Sun May  4 13:44:59 2003
@@ -5430,17 +5430,17 @@
 if test x$fc_config_exec_prefix != x ; then
   fc_config_args="$fc_config_args --exec-prefix=$fc_config_exec_prefix"
   if test x${FC_CONFIG+set} != xset ; then
-    FC_CONFIG=$fc_config_exec_prefix/bin/fontconfig-config
+    FC_CONFIG=$fc_config_exec_prefix/bin/pkg-config
   fi
 fi
 if test x$fc_config_prefix != x ; then
   fc_config_args="$fc_config_args --prefix=$fc_config_prefix"
   if test x${FC_CONFIG+set} != xset ; then
-    FC_CONFIG=$fc_config_prefix/bin/fontconfig-config
+    FC_CONFIG=$fc_config_prefix/bin/pkg-config
   fi
 fi
-# Extract the first word of "fontconfig-config", so it can be a program name with args.
-set dummy fontconfig-config; ac_word=$2
+# Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
 if test "${ac_cv_path_FC_CONFIG+set}" = set; then
@@ -5487,13 +5487,13 @@
 if test "$FC_CONFIG" = "no" ; then
   no_fc=yes
 else
-  FC_CFLAGS=`$FC_CONFIG $fc_config_args --cflags`
-  FC_LIBS=`$FC_CONFIG $fc_config_args --libs`
-  fc_config_major_version=`$FC_CONFIG $fc_config_args --version | \
+  FC_CFLAGS=`$FC_CONFIG fontconfig $fc_config_args --cflags`
+  FC_LIBS=`$FC_CONFIG fontconfig $fc_config_args --libs`
+  fc_config_major_version=`$FC_CONFIG fontconfig $fc_config_args --modversion | \
          sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
-  fc_config_minor_version=`$FC_CONFIG $fc_config_args --version | \
+  fc_config_minor_version=`$FC_CONFIG fontconfig $fc_config_args --modversion | \
          sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'`
-  fc_config_micro_version=`$FC_CONFIG $fc_config_args --version | \
+  fc_config_micro_version=`$FC_CONFIG fontconfig $fc_config_args --modversion | \
          sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'`
   fc_min_major_version=`echo $min_fc_version | \
          sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'`
@@ -6432,7 +6432,7 @@
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng ${png_LIBS} -lz -lm $LIBS"
+LIBS="-L%%LOCALBASE%%/lib -lpng ${png_LIBS} -lz -lm $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 #include "confdefs.h"
@@ -6704,7 +6704,7 @@
 #define HAVE_PNG 1
 _ACEOF
 
-  png_LIBS="-lpng -lz"
+  png_LIBS="-L%%LOCALBASE%%/lib -lpng -lz"
   problem_png=""
 else
   with_png=no
