tcp: Revert back to the old Flags entry.
[metze/wireshark/wip.git] / configure.ac
index 8b9778b8bdd6b4bce3b6c6298bca6c51242935d6..49111ad23ecbfccff2368784ddc7b569a09065e0 100644 (file)
@@ -5,9 +5,9 @@
 #
 # Define variables for the components of the Wireshark version number.
 #
-m4_define([version_major], [1])
-m4_define([version_minor], [99])
-m4_define([version_micro], [7])
+m4_define([version_major], [2])
+m4_define([version_minor], [1])
+m4_define([version_micro], [0])
 m4_define([version_micro_extra], version_micro)
 m4_append([version_micro_extra], [])
 
@@ -59,7 +59,11 @@ AM_DISABLE_STATIC
 #
 # Checks for programs used in the main build process.
 #
-AC_PROG_CC
+AC_PROG_CC_STDC
+if test "$ac_cv_prog_cc_stdc" == "no"
+then
+       AC_MSG_ERROR([The C compiler does not support standard C])
+fi
 AM_PROG_CC_C_O
 AC_PROG_CXX
 AC_PROG_CPP
@@ -108,7 +112,7 @@ fi
 AC_PATH_PROG(PERL, perl)
 
 # Check for Python.
-AC_PATH_PROGS(PYTHON, python, python3)
+AC_PATH_PROGS(PYTHON, python python3)
 if test ! -z "$PYTHON"; then
        #
        # OK, we found Python; is it Python 2.5 or later?
@@ -244,7 +248,11 @@ AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
 # the comments in acolocal.m4
 #
-PKG_PROG_PKG_CONFIG
+# We want version 0.7 or better.  (XXX - explain why. Is that just
+# because our Qt tests were originally based on AM_PATH_GTK, and *it*
+# requires 0.7 or better?)
+#
+PKG_PROG_PKG_CONFIG(0.7)
 if test -z "$PKG_CONFIG"; then
        AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
 fi
@@ -570,8 +578,8 @@ if test "x$with_gnutls" = "xyes"; then
   )
 
   if test "x$have_license_compatible_gnutls" != "xyes"; then
-    PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0 gnutls < 3],
-      [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 1.2.0, < 3.0 not found " ]
+    PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0 gnutls < 3],
+      [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 2.12.0, < 3.0 not found " ]
     )
   fi
 
@@ -599,9 +607,9 @@ AC_ARG_WITH([gcrypt],
   [ with_gcrypt="$withval"; want_gcrypt="yes" ], with_gcrypt="yes")
 
 if test "x$with_gcrypt" = "xyes"; then
-  AM_PATH_LIBGCRYPT(1.1.92,
+  AM_PATH_LIBGCRYPT(1.4.2,
        [
-               echo "libgcrypt found, enabling ipsec decryption"
+               echo "libgcrypt found, enabling decryption for ipsec, ssl, etc."
                AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
                gcrypt_message="yes"
        ]
@@ -609,7 +617,7 @@ if test "x$with_gcrypt" = "xyes"; then
                if test x$libgcrypt_config_prefix != x ; then
                        AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
                else
-                       echo "libgcrypt not found, disabling ipsec decryption"
+                       echo "libgcrypt not found, disabling decryption for ipsec, ssl, etc."
                        gcrypt_message="no"
                fi
 
@@ -818,7 +826,7 @@ AC_SUBST(HAVE_RPM)
 # Debian
 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
 
-# Mac OS X
+# OS X
 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
@@ -867,6 +875,7 @@ AC_ARG_ENABLE(extra-compiler-warnings,
                # The following are for C and C++
                #
                AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
+               AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
                #
                # Various code blocks this one.
                #
@@ -1275,15 +1284,16 @@ else
        case "$host_os" in
        hpux*)
                #
-               # HP's ANSI C compiler; flags suggested by Jost Martin.
-               # "-Ae" for ANSI C plus extensions such as "long long".
-               # "+O2", for optimization.  XXX - works with "-g"?
+               # AC_PROG_CC_STDC should already have added whatever
+               # flags are necessary for ISO C - C99 if available,
+               # otherwise C89 - with extensions.
+               #
+               # Add +O2, for optimization, as suggested by Jost Martin.
+               # XXX - works with "-g"?
                #
-               # HP's ANSI C++ compiler doesn't support "-Ae", but
-               # does support "+O2", at least according to the
-               # documentation I can find online.
+               # +O2 is supported both by the C and C++ compiler.
                #
-               CFLAGS="-Ae +O2 $CFLAGS"
+               CFLAGS="+O2 $CFLAGS"
                if test "$CC" = "$CC_FOR_BUILD"; then
                        #
                        # We're building the build tools with the same
@@ -1294,7 +1304,7 @@ else
                        CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
                fi
                CXXFLAGS="+O2 $CFLAGS"
-               AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
+               AC_MSG_RESULT(HP C/C++ compiler - added +O2)
                ;;
        solaris*)
                #
@@ -1334,15 +1344,8 @@ darwin*)
        # with a static version installed in /usr/local/lib rather than
        # the system version in /usr/lib).
        #
-       # Also add -Wl,-rpath,@executable_path/../lib and
-       # -Wl,-rpath,/usr/local/lib, so that, if we build an app
-       # bundle, we can tweak all the executable images, shared
-       # libraries, and plugins in the bundle to look for non-system
-       # libraries in the rpath, rather than having a script tweak
-       # DYLD_LIBRARY_PATH.
-       #
-       LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/usr/local/lib $LDFLAGS"
-       AC_MSG_RESULT([Apple linker - added -Wl,-single_module to shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and rpaths to all linker flags])
+       LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $LDFLAGS"
+       AC_MSG_RESULT([Apple linker - added -Wl,-single_module to shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and -Wl,-headerpad_max_install_names to all linker flags])
        ;;
 cygwin*)
        #
@@ -1562,7 +1565,7 @@ 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
+QT_MIN_VERSION=4.7.0
 AC_SUBST(QT_MIN_VERSION)
 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
@@ -1575,7 +1578,7 @@ AC_SUBST(QT_MIN_VERSION)
 # force all programs to be built with GTK+ or Qt.
 #
 # Release dates for GTK+ versions:
-# http://en.wikipedia.org/wiki/GTK+#Releases
+# https://en.wikipedia.org/wiki/GTK+#Releases
 # 2.12.0: 14 Sep 2007
 # 2.14.0: 04 Sep 2008
 # 2.16.0: 13 Mar 2009
@@ -1590,9 +1593,12 @@ AC_SUBST(QT_MIN_VERSION)
 # 3.8.0:  25 Mar 2013
 # 3.10.0: 23 Sep 2013
 # 3.12.0: 25 Mar 2014
+# 3.14.0: 30 Sep 2014
+# 3.16.0: 22 Mar 2015
+# 3.18.0  22 Sep 2015
 #
 # Release dates for Qt versions:
-# http://en.wikipedia.org/wiki/List_of_Qt_releases
+# https://en.wikipedia.org/wiki/List_of_Qt_releases
 # 4.6.0:  01 Dec 2009
 # 4.7.0:  21 Sep 2010
 # 4.8.0:  15 Dec 2011
@@ -1600,6 +1606,8 @@ AC_SUBST(QT_MIN_VERSION)
 # 5.1.0:  03 Jul 2013
 # 5.2.0:  12 Dec 2013
 # 5.3.0:  20 May 2014
+# 5.4.0:  10 Dec 2015
+# 5.5.0:  01 Jul 2015
 
 have_qt=no
 have_gtk=no
@@ -1624,7 +1632,7 @@ if test "x$enable_wireshark" = "xyes"; then
        fi
        if test "x$with_qt" != "xno"; then
                #
-               # Qt was specified; Make sure we have a C++ compiler.
+               # Qt was specified; make sure we have a C++ compiler.
                #
                if test -z "$CXX"; then
                        AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
@@ -1646,6 +1654,42 @@ if test "x$enable_wireshark" = "xyes"; then
                        # compile.
                        #
                        CPPFLAGS="-DQT_GUI_LIB"
+
+                       #
+                       # We're building with Qt, so we need the Qt build
+                       # tools in order to build the Wireshark GUI.
+                       # We've found a particular major version of Qt,
+                       # and we want that version's build tools; for
+                       # example, the Qt 4 version of uic produces files
+                       # that include Qt headers with paths that work
+                       # with Qt 4 but not Qt 5, so we can't use the
+                       # Qt 4 version of uic if we're building with Qt 5.
+                       AC_WIRESHARK_QT_TOOL_CHECK(UIC, uic, "$qt_version")
+                       AC_SUBST(UIC)
+                       AC_WIRESHARK_QT_TOOL_CHECK(MOC, moc, "$qt_version")
+                       AC_SUBST(MOC)
+                       AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
+                       AC_SUBST(RCC)
+
+                       #
+                       # On Darwin, find where the Qt frameworks are
+                       # located, and add that to the rpath, just in
+                       # case this is Qt 5.5 or later and the frameworks
+                       # have an install name that begins with @rpath
+                       # and aren't installed in a frameworks directory
+                       # that's searched by default.
+                       #
+                       case "$host_os" in
+                       darwin*)
+                               if test $qt_version -le 4
+                               then
+                                       Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs QtCore | sed -e 's/-F//' -e 's/ -framework.*//'`
+                               else
+                                       Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs Qt${qt_version}Core | sed -e 's/-F//' -e 's/ -framework.*//'`
+                               fi
+                               ;;
+                       esac
+                       AC_SUBST(Qt_LDFLAGS)
                ],
                [
                        case "$with_qt" in
@@ -1740,6 +1784,16 @@ AC_SUBST(GLIB_MIN_VERSION)
 # 2.36.0: 25 Mar 2013
 # 2.38.0: 23 Sep 2013
 # 2.40.0: 24 Mar 2014
+# 2.42.0: 22 Sep 2014
+# 2.44.0: 23 Mar 2014
+# 2.46.0: 25 Sep 2015
+
+# Check for GResource support
+PKG_CHECK_MODULES([GRESOURCE], [gio-2.0 >= 2.32 gdk-pixbuf-2.0 >= 2.26], [have_gresource=yes], [have_gresource=no])
+AM_CONDITIONAL(HAVE_GRESOURCE, test "x$have_gresource" = "xyes")
+if test "x$have_gresource" = "xyes"; then
+       AC_DEFINE(HAVE_GRESOURCE, 1, [Defined if GLib GResource is supported])
+fi
 
 use_glib_cflags="true"
 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
@@ -1819,78 +1873,6 @@ else
        AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
 fi
 
-#
-# "make dist" requires that we have the Qt build tools.
-#
-# Annoyingly, on some Linux distros (e.g. Debian) the Qt 5 tools have no
-# suffix and the Qt 4 tools have suffix -qt4. On other distros (e.g. openSUSE)
-# the Qt 5 tools have suffix -qt5 and the Qt 4 tools have no suffix. Hence
-# check for Qt tools in the following suffix order: "-qt5", "", "-qt4".
-#
-AC_PATH_PROGS(UIC, [uic-qt5 uic uic-qt4])
-if test "x$UIC" = x; then
-       if test "x$have_qt" != "xno"; then
-               #
-               # If you want to build with Qt, you'd better
-               # have uic.
-               #
-               AC_MSG_ERROR(I couldn't find uic or uic-qt5 or uic-qt4; make sure it's installed and in your path)
-       else
-               #
-               # We shouldn't fail here, as the user's not
-               # building with Qt, and we shouldn't force them
-               # to have Qt installed if they're not doing so.
-               # "make dist" will fail if they do that, but
-               # we don't know whether they'll be doing that,
-               # so this is the best we can do.
-               #
-               UIC=uic
-       fi
-fi
-AC_SUBST(UIC)
-AC_PATH_PROGS(MOC, [moc-qt5 moc moc-qt4])
-if test "x$MOC" = x; then
-       if test "x$have_qt" != "xno"; then
-               #
-               # If you want to build with Qt, you'd better
-               # have moc.
-               #
-               AC_MSG_ERROR(I couldn't find moc or moc-qt5 or moc-qt4; make sure it's installed and in your path)
-       else
-               #
-               # We shouldn't fail here, as the user's not
-               # building with Qt, and we shouldn't force them
-               # to have Qt installed if they're not doing so.
-               # "make dist" will fail if they do that, but
-               # we don't know whether they'll be doing that,
-               # so this is the best we can do.
-               #
-               MOC=moc
-       fi
-fi
-AC_SUBST(MOC)
-AC_PATH_PROGS(RCC, [rcc-qt5 rcc rcc-qt4])
-if test "x$RCC" = x; then
-       if test "x$have_qt" != "xno"; then
-               #
-               # If you want to build with Qt, you'd better
-               # have moc.
-               #
-               AC_MSG_ERROR(I couldn't find rcc or rcc-qt5; make sure it's installed and in your path)
-       else
-               #
-               # We shouldn't fail here, as the user's not
-               # building with Qt, and we shouldn't force them
-               # to have Qt installed if they're not doing so.
-               # "make dist" will fail if they do that, but
-               # we don't know whether they'll be doing that,
-               # so this is the best we can do.
-               #
-               RCC=rcc
-       fi
-fi
-AC_SUBST(RCC)
-
 # Error out if a glib header other than a "top level" header
 #  (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
 #  is used.
@@ -2495,11 +2477,11 @@ AC_SUBST(LUA_CFLAGS)
 
 
 dnl portaudio check
-AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
+AC_MSG_CHECKING(whether to use libportaudio for the GTK+ RTP player)
 
 AC_ARG_WITH(portaudio,
   AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
-                 [use libportaudio (located in directory DIR, if supplied) for the rtp_player @<:@default=yes, if available@:>@]),
+                 [use libportaudio (located in directory DIR, if supplied) for the GTK+ RTP player @<:@default=yes, if available@:>@]),
 [
        if test $withval = no
        then
@@ -2524,7 +2506,7 @@ else
        AC_MSG_RESULT(yes)
        AC_WIRESHARK_LIBPORTAUDIO_CHECK
        if test "x$want_portaudio" = "xno" ; then
-               AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
+               AC_MSG_RESULT(libportaudio not found - disabling support for the GTK+ RTP player)
        fi
 fi
 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
@@ -3094,9 +3076,18 @@ else
        RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
 fi
 if test "x$have_qt" = "xyes" ; then
-       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
+       if test "$qt_version" -eq "5"; then
+               RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt5"
+       else
+               RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
+       fi
 else
-       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt"
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt --without qt5"
+fi
+if test "x$have_lua" = "xyes" ; then
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with lua"
+else
+       RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
 fi
 AC_SUBST(RPMBUILD_WITH_ARGS)
 
@@ -3291,7 +3282,7 @@ if test "x$have_gtk" = "xyes"; then
                gtk_lib_message=" (with GTK+ 2"
        fi
        if test "x$have_ige_mac" = "xyes"; then
-               gtk_lib_message="$gtk_lib_message and Mac OS X integration)"
+               gtk_lib_message="$gtk_lib_message and OS X integration)"
        else
                gtk_lib_message="$gtk_lib_message)"
        fi
@@ -3299,6 +3290,7 @@ fi
 
 if test "x$have_qt" = "xyes" ; then
        enable_wireshark_qt="yes"
+       qt_lib_message=" (with Qt $qt_version)"
 else
        enable_wireshark_qt="no"
 fi
@@ -3333,6 +3325,12 @@ else
        lua_message="no"
 fi
 
+if test "x$have_qt_multimedia_lib" = "xyes" ; then
+       qt_multimedia_message="yes"
+else
+       qt_multimedia_message="no"
+fi
+
 if test "x$want_portaudio" = "xyes" ; then
        portaudio_message="yes"
 else
@@ -3381,7 +3379,7 @@ fi
 
 echo ""
 echo "The Wireshark package has been configured with the following options."
-echo "                    Build wireshark : $enable_wireshark_qt"
+echo "                    Build wireshark : $enable_wireshark_qt$qt_lib_message"
 echo "                Build wireshark-gtk : $have_gtk""$gtk_lib_message"
 echo "                       Build tshark : $enable_tshark"
 echo "                      Build tfshark : $enable_tfshark"
@@ -3405,7 +3403,8 @@ echo "                  Use dumpcap group : $dumpcap_group_message"
 echo "                        Use plugins : $have_plugins"
 echo "       Use external capture sources : $have_extcap"
 echo "                    Use Lua library : $lua_message"
-echo "                   Build rtp_player : $portaudio_message"
+echo "                Build Qt RTP player : $qt_multimedia_message"
+echo "              Build GTK+ RTP player : $portaudio_message"
 echo "             Build profile binaries : $enable_profile_build"
 echo "                   Use pcap library : $want_pcap"
 echo "                   Use zlib library : $zlib_message"
@@ -3421,3 +3420,4 @@ echo "     Use POSIX capabilities library : $libcap_message"
 echo "                  Use GeoIP library : $geoip_message"
 echo "                     Use nl library : $libnl_message"
 echo "              Use SBC codec library : $have_sbc"
+#echo "                      Use GResource : $have_gresource"