--- configure.in	2004-10-02 22:19:10.000000000 +0200
+++ configure.in	2010-05-22 23:39:55.000000000 +0300
@@ -24,20 +24,20 @@
 dnl ---- fribidi ----
 
 if test "x$FRIBIDI_CONFIG" = x; then
-    AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config)
+    AC_PATH_PROG(FRIBIDI_CONFIG, pkg-config)
 fi
 
 test "x$FRIBIDI_CONFIG" = x && AC_MSG_ERROR(Can't locate the fribidi-config program)
 test ! -x "$FRIBIDI_CONFIG" && AC_MSG_ERROR(Can't execute the program '$FRIBIDI_CONFIG')
 
 
-FRIBIDI_CXXFLAGS=`$FRIBIDI_CONFIG --cflags`
-if test "x$FRIBIDI_CXXFLAGS" = x-I/usr/include; then
+FRIBIDI_CXXFLAGS=`$FRIBIDI_CONFIG --cflags fribidi`
+if test "x$FRIBIDI_CXXFLAGS" = x-I/usr/include/fribidi; then
     AC_CHECK_HEADER(fribidi/fribidi.h, , [CXXFLAGS="$CXXFLAGS $FRIBIDI_CXXFLAGS"])
 else
     CXXFLAGS="$CXXFLAGS $FRIBIDI_CXXFLAGS"
 fi
-LDFLAGS="$LDFLAGS `$FRIBIDI_CONFIG --libs`"
+LDFLAGS="$LDFLAGS `$FRIBIDI_CONFIG --libs fribidi`"
 
 AC_CHECK_FUNCS(fribidi_log2vis fribidi_log2vis_get_embedding_levels, ,
 	       [AC_MSG_ERROR(A required FriBiDi function doesn't exist)])

