aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss.ws@gmail.com>2013-02-07 20:51:52 +0000
committerJeff Morriss <jeff.morriss.ws@gmail.com>2013-02-07 20:51:52 +0000
commit8a6b4d596dbf6904c69a67c688318343e0e5ea84 (patch)
tree7eed006f4b581512bc7c20bbe6a46c8c41b92152
parent669e68dfded50f813464eeb3dc4e334578f85de5 (diff)
QPropertyAnimation is needed for Qt builds and isn't present until Qt 4.6.0.
Add a (crude) check for the Qt version, making 4.6.0 the minimum. The existing checks in configure.ac should be moved into into this new module. svn path=/trunk/; revision=47537
-rw-r--r--aclocal-fallback/qt.m456
-rw-r--r--configure.ac10
2 files changed, 63 insertions, 3 deletions
diff --git a/aclocal-fallback/qt.m4 b/aclocal-fallback/qt.m4
new file mode 100644
index 0000000000..c82dc3fed0
--- /dev/null
+++ b/aclocal-fallback/qt.m4
@@ -0,0 +1,56 @@
+# Based on gtk-2.0.m4.
+# $Id$
+
+dnl AM_PATH_QT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for Qt+
+dnl Should also define QT_CFLAGS and QT_LIBS but not done yet...
+dnl
+AC_DEFUN([AM_PATH_QT],
+[
+
+ pkg_config_args=Qt
+
+ no_qt=""
+
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+
+ if test x$PKG_CONFIG != xno ; then
+ if pkg-config --atleast-pkgconfig-version 0.7 ; then
+ :
+ else
+ echo *** pkg-config too old; version 0.7 or better required.
+ no_qt=yes
+ PKG_CONFIG=no
+ fi
+ else
+ no_qt=yes
+ fi
+
+ min_qt_version=ifelse([$1], ,4.0.0,$1)
+ AC_MSG_CHECKING(for Qt - version >= $min_qt_version)
+
+ if test x"$no_qt" = x ; then
+ QT_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
+ QT_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
+ qt_config_major_version=`$PKG_CONFIG --modversion $pkg_config_args | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ qt_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_args | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ qt_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_args | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+
+ if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_args; then
+ :
+ else
+ no_qt=yes
+ fi
+ fi
+
+ if test x"$no_qt" = x ; then
+ AC_MSG_RESULT(yes (version $qt_config_major_version.$qt_config_minor_version.$qt_config_micro_version))
+ ifelse([$2], , :, [$2])
+ else
+ ifelse([$3], , :, [$3])
+ fi
+
+])
diff --git a/configure.ac b/configure.ac
index 7f02551996..86e3662417 100644
--- a/configure.ac
+++ b/configure.ac
@@ -907,10 +907,10 @@ GTK2_MIN_VERSION=2.12.0
AC_SUBST(GTK2_MIN_VERSION)
GTK3_MIN_VERSION=3.0.0
AC_SUBST(GTK3_MIN_VERSION)
+QT_MIN_VERSION=4.6.0
+AC_SUBST(QT_MIN_VERSION)
# GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
-# GTK3_MIN_VERSION or later, and, for now, don't require any particular
-# version of Qt (except perhaps by implication, as older versions might not
-# support pkgconfig).
+# GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
#
# We only do those if we're going to be building Wireshark;
# otherwise, we don't have any GUI to build, so we don't use
@@ -974,6 +974,10 @@ if test "x$enable_wireshark" = "xyes"; then
],
AC_MSG_NOTICE([QtPrintSupport not found. Assuming Qt4]))
+ # Check for the minimum Qt version
+ # XXX the above checks should be moved into AM_PATH_QT.
+ AM_PATH_QT($QT_MIN_VERSION, , [AC_MSG_ERROR([Qt is not available])])
+
#
# We don't know whether we have GTK+, but we
# won't be using it, so it's as if we don't