--- SDL-1.2.15/configure.in
+++ SDL-1.2.15/configure.in
@@ -1507,11 +1507,10 @@
                   , enable_video_caca=no)
     if test x$enable_video = xyes -a x$enable_video_caca = xyes; then
         video_caca=no
-        AC_PATH_PROG(CACACONFIG, caca-config, no)
-        if test x$CACACONFIG != xno; then
+		PKG_PROG_PKG_CONFIG([0.20])
+		PKG_CHECK_MODULES(CACA, caca, has_caca_pc=yes, has_caca_pc=no])
+        if test x$has_caca_pc == xyes; then
             AC_MSG_CHECKING(for libcaca support)
-            CACA_CFLAGS=`$CACACONFIG --cflags`
-            CACA_LDFLAGS=`$CACACONFIG --libs`
             save_CFLAGS="$CFLAGS"
             AC_TRY_COMPILE([
              #include <caca.h>
@@ -1524,7 +1523,7 @@
             if test x$video_caca = xyes; then
                 AC_DEFINE(SDL_VIDEO_DRIVER_CACA)
                 EXTRA_CFLAGS="$EXTRA_CFLAGS $CACA_CFLAGS"
-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LDFLAGS"
+                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $CACA_LIBS"
                 SOURCES="$SOURCES $srcdir/src/video/caca/*.c"
             fi
         fi
