diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-07-24 22:34:44 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-07-24 22:34:44 +0000 |
commit | f317c7821d7325d977e70c81c756be8c7e0b8486 (patch) | |
tree | 5daa69064940bd80c046f24bfb1825725e817616 | |
parent | 9c5b6c76a621478d6f3715a8a7e4d34f7ee9e4f2 (diff) | |
download | wireshark-f317c7821d7325d977e70c81c756be8c7e0b8486.tar.gz |
The files in aclocal-fallback are copies of .m4 files from various
packages, providing macros that we use in our configure script in case
somebody building from SVN doesn't happen to have the package installed
and thus doesn't happen to have those macros defined.
In the case of Qt, there *isn't* such a .m4 file, so we had to create
the macro. Move it to acinclude.m4, and rename it to
AC_WIRESHARK_QT_CHECK to indicate that it's our own check.
svn path=/trunk/; revision=50881
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | acinclude.m4 | 125 | ||||
-rw-r--r-- | aclocal-fallback/qt.m4 | 124 | ||||
-rw-r--r-- | configure.ac | 2 |
4 files changed, 126 insertions, 126 deletions
diff --git a/Makefile.am b/Makefile.am index 99dc479e9e..d18ce207b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -661,7 +661,6 @@ EXTRA_DIST = \ aclocal-fallback/glib-2.0.m4 \ aclocal-fallback/gtk-2.0.m4 \ aclocal-fallback/gtk-3.0.m4 \ - aclocal-fallback/qt.m4 \ aclocal-flags \ adns_dll.dep \ adns_dll.rc \ diff --git a/acinclude.m4 b/acinclude.m4 index e0ee100643..7d1456f1cd 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1913,6 +1913,131 @@ AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK], LIBS="$ac_save_LIBS" ]) +# Based on AM_PATH_GTK in gtk-2.0.m4. + +dnl AC_WIRESHARK_QT_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND, +dnl [ACTION-IF-NOT-FOUND]]]) +dnl Test for Qt and define Qt_CFLAGS and Qt_LIBS. +dnl +AC_DEFUN([AC_WIRESHARK_QT_CHECK], +[ + pkg_config_module="QtCore QtGui" + + 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 + + if test x"$no_qt" = x ; then + # + # Qt 5.1 appears not to have QtXxx modules; instead, it + # has Qt5Xxx modules. + # + if $PKG_CONFIG Qt5Core + then + pkg_config_module="Qt5Core Qt5Gui" + else + pkg_config_module="QtCore QtGui" + fi + min_qt_version=ifelse([$1], ,4.0.0,$1) + AC_MSG_CHECKING(for Qt - version >= $min_qt_version) + + qt_config_major_version=`$PKG_CONFIG --modversion $pkg_config_module | \ + head -1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + qt_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_module | \ + head -1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + qt_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_module | \ + head -1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + + if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_module; then + AC_MSG_RESULT(yes (version $qt_config_major_version.$qt_config_minor_version.$qt_config_micro_version)) + else + no_qt=yes + AC_MSG_RESULT(no) + fi + fi + + if test x"$no_qt" = x ; then + Qt_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_module` + Qt_LIBS=`$PKG_CONFIG --libs $pkg_config_module` + + # + # Qt 5.0 appears to move the widgets out of Qt GUI + # to Qt Widgets; look for Qt5Widgets and, if we find + # it, add its flags to CFLAGS and CXXFLAGS, so that + # we find the include files for the widgets. If + # we don't find Qt5Widgets, look for QtWidgets instead. + # If we don't find QtWidgets, we assume it's Qt 4. + # + if QtWidgets_CFLAGS=`$PKG_CONFIG --cflags Qt5Widgets 2>/dev/null`; then + Qt_CFLAGS="$Qt_CFLAGS $QtWidgets_CFLAGS" + Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs Qt5Widgets 2>/dev/null`" + elif QtWidgets_CFLAGS=`$PKG_CONFIG --cflags QtWidgets 2>/dev/null`; then + Qt_CFLAGS="$Qt_CFLAGS $QtWidgets_CFLAGS" + Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs QtWidgets 2>/dev/null`" + else + AC_MSG_NOTICE([QtWidgets not found. Assuming Qt4]) + fi + + # + # Qt 5.0 also appears to move the printing support into + # the QtPrintSupport module, and Qt 5.1 renamed it + # Qt5PrintSupport. + # + if QtPrintSupport_CFLAGS=`$PKG_CONFIG --cflags Qt5PrintSupport 2>/dev/null`; then + Qt_CFLAGS="$Qt_CFLAGS $QtPrintSupport_CFLAGS" + Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs Qt5PrintSupport 2>/dev/null`" + elif QtPrintSupport_CFLAGS=`$PKG_CONFIG --cflags QtPrintSupport 2>/dev/null`; then + Qt_CFLAGS="$Qt_CFLAGS $QtPrintSupport_CFLAGS" + Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs QtPrintSupport 2>/dev/null`" + else + AC_MSG_NOTICE([QtPrintSupport not found. Assuming Qt4]) + fi + + # + # While we're at it, look for QtMacExtras. (Presumably + # if we're not building for OS X, it won't be present.) + # + # XXX - is there anything in QtX11Extras or QtWinExtras + # that we should be using? + # + AC_MSG_CHECKING(for QtMacExtras) + if QtMacExtras_CFLAGS=`$PKG_CONFIG --cflags Qt5MacExtras 2>/dev/null`; then + Qt_CFLAGS="$Qt_CFLAGS $QtMacExtras_CFLAGS" + Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs Qt5MacExtras 2>/dev/null`" + AC_DEFINE(QT_MACEXTRAS_LIB, 1, [Define if we have QtMacExtras]) + AC_MSG_RESULT(yes) + elif QtMacExtras_CFLAGS=`$PKG_CONFIG --cflags QtMacExtras 2>/dev/null`; then + Qt_CFLAGS="$Qt_CFLAGS $QtMacExtras_CFLAGS -DQT_MACEXTRAS_LIB" + Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs QtMacExtras 2>/dev/null`" + AC_DEFINE(QT_MACEXTRAS_LIB, 1, [Define if we have QtMacExtras]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + + AC_SUBST(Qt_LIBS) + + # Run Action-If-Found + ifelse([$2], , :, [$2]) + else + # Run Action-If-Not-Found + ifelse([$3], , :, [$3]) + fi + +]) + # # AC_WIRESHARK_PYTHON_CHECK # diff --git a/aclocal-fallback/qt.m4 b/aclocal-fallback/qt.m4 deleted file mode 100644 index 1299229e4f..0000000000 --- a/aclocal-fallback/qt.m4 +++ /dev/null @@ -1,124 +0,0 @@ -# Based on gtk-2.0.m4. -# $Id$ - -dnl AM_PATH_QT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for Qt+ and define Qt_CFLAGS and Qt_LIBS. -dnl -AC_DEFUN([AM_PATH_QT], -[ - pkg_config_module="QtCore QtGui" - - 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 - - if test x"$no_qt" = x ; then - # - # Qt 5.1 appears not to have QtXxx modules; instead, it - # has Qt5Xxx modules. - # - if $PKG_CONFIG Qt5Core - then - pkg_config_module="Qt5Core Qt5Gui" - else - pkg_config_module="QtCore QtGui" - fi - min_qt_version=ifelse([$1], ,4.0.0,$1) - AC_MSG_CHECKING(for Qt - version >= $min_qt_version) - - qt_config_major_version=`$PKG_CONFIG --modversion $pkg_config_module | \ - head -1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - qt_config_minor_version=`$PKG_CONFIG --modversion $pkg_config_module | \ - head -1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - qt_config_micro_version=`$PKG_CONFIG --modversion $pkg_config_module | \ - head -1 | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - - if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_module; then - AC_MSG_RESULT(yes (version $qt_config_major_version.$qt_config_minor_version.$qt_config_micro_version)) - else - no_qt=yes - AC_MSG_RESULT(no) - fi - fi - - if test x"$no_qt" = x ; then - Qt_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_module` - Qt_LIBS=`$PKG_CONFIG --libs $pkg_config_module` - - # - # Qt 5.0 appears to move the widgets out of Qt GUI - # to Qt Widgets; look for Qt5Widgets and, if we find - # it, add its flags to CFLAGS and CXXFLAGS, so that - # we find the include files for the widgets. If - # we don't find Qt5Widgets, look for QtWidgets instead. - # If we don't find QtWidgets, we assume it's Qt 4. - # - if QtWidgets_CFLAGS=`$PKG_CONFIG --cflags Qt5Widgets 2>/dev/null`; then - Qt_CFLAGS="$Qt_CFLAGS $QtWidgets_CFLAGS" - Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs Qt5Widgets 2>/dev/null`" - elif QtWidgets_CFLAGS=`$PKG_CONFIG --cflags QtWidgets 2>/dev/null`; then - Qt_CFLAGS="$Qt_CFLAGS $QtWidgets_CFLAGS" - Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs QtWidgets 2>/dev/null`" - else - AC_MSG_NOTICE([QtWidgets not found. Assuming Qt4]) - fi - - # - # Qt 5.0 also appears to move the printing support into - # the QtPrintSupport module, and Qt 5.1 renamed it - # Qt5PrintSupport. - # - if QtPrintSupport_CFLAGS=`$PKG_CONFIG --cflags Qt5PrintSupport 2>/dev/null`; then - Qt_CFLAGS="$Qt_CFLAGS $QtPrintSupport_CFLAGS" - Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs Qt5PrintSupport 2>/dev/null`" - elif QtPrintSupport_CFLAGS=`$PKG_CONFIG --cflags QtPrintSupport 2>/dev/null`; then - Qt_CFLAGS="$Qt_CFLAGS $QtPrintSupport_CFLAGS" - Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs QtPrintSupport 2>/dev/null`" - else - AC_MSG_NOTICE([QtPrintSupport not found. Assuming Qt4]) - fi - - # - # While we're at it, look for QtMacExtras. (Presumably - # if we're not building for OS X, it won't be present.) - # - # XXX - is there anything in QtX11Extras or QtWinExtras - # that we should be using? - # - AC_MSG_CHECKING(for QtMacExtras) - if QtMacExtras_CFLAGS=`$PKG_CONFIG --cflags Qt5MacExtras 2>/dev/null`; then - Qt_CFLAGS="$Qt_CFLAGS $QtMacExtras_CFLAGS" - Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs Qt5MacExtras 2>/dev/null`" - AC_DEFINE(QT_MACEXTRAS_LIB, 1, [Define if we have QtMacExtras]) - AC_MSG_RESULT(yes) - elif QtMacExtras_CFLAGS=`$PKG_CONFIG --cflags QtMacExtras 2>/dev/null`; then - Qt_CFLAGS="$Qt_CFLAGS $QtMacExtras_CFLAGS -DQT_MACEXTRAS_LIB" - Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs QtMacExtras 2>/dev/null`" - AC_DEFINE(QT_MACEXTRAS_LIB, 1, [Define if we have QtMacExtras]) - AC_MSG_RESULT(yes) - else - AC_MSG_RESULT(no) - fi - - AC_SUBST(Qt_LIBS) - - # Run Action-If-Found - ifelse([$2], , :, [$2]) - else - # Run Action-If-Not-Found - ifelse([$3], , :, [$3]) - fi - -]) diff --git a/configure.ac b/configure.ac index c63f3cf157..d06814da2c 100644 --- a/configure.ac +++ b/configure.ac @@ -1255,7 +1255,7 @@ if test "x$enable_wireshark" = "xyes"; then # Now make sure we have Qt and, if so, add the flags # for it to CFLAGS and CXXFLAGS. # - AM_PATH_QT($QT_MIN_VERSION, + AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, [ CFLAGS="$CFLAGS $Qt_CFLAGS" CXXFLAGS="$CXXFLAGS $Qt_CFLAGS" |