Code

configure.ac: the chat screen needs libmpdclient >= 2.5
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 4 Jan 2012 17:33:30 +0000 (18:33 +0100)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 23 May 2012 01:50:16 +0000 (03:50 +0200)
configure.ac

index 4e29197256965c347cd73d5e32d5f6f2a7397729..fff8b5112db6243d315a57f7c1ea9b6d58718b87 100644 (file)
@@ -102,6 +102,9 @@ dnl Check for libmpdclient 2.2
 PKG_CHECK_MODULES([LIBMPDCLIENT], [libmpdclient >= 2.2],,
        [AC_MSG_ERROR([libmpdclient2 is required])])
 
+dnl Check for libmpdclient 2.5 (the chat screen requires this version)
+PKG_CHECK_EXISTS([libmpdclient >= 2.5],
+       [have_libmpdclient_2_5=yes], [have_libmpdclient_2_5=no])
 
 dnl i18n
 
@@ -345,11 +348,16 @@ AC_ARG_ENABLE([chat-screen],
               AC_HELP_STRING([--enable-chat-screen],
                [Enable chat screen @<:@default=no@:>@]),,
        [enable_chat_screen=no])
+if test "x$enable_chat_screen" = "xauto"; then
+       enable_chat_screen=$have_libmpdclient_2_5
+fi
 AC_MSG_RESULT([$enable_chat_screen])
 if test "x$enable_chat_screen" = "xyes" ; then
-    AC_DEFINE(ENABLE_CHAT_SCREEN, 1, [Enable chat screen])
+       if test "x$have_libmpdclient_2_5" = "xno"; then
+               AC_MSG_ERROR(The chat screen requires at least libmpclient 2.5)
+       fi
+       AC_DEFINE(ENABLE_CHAT_SCREEN, 1, [Enable chat screen])
 fi
-
 AM_CONDITIONAL(ENABLE_CHAT_SCREEN, test x$enable_chat_screen = xyes)