CORBA IDL: compile dissectors with /Ox when using MSVC2013 x64
[metze/wireshark/wip.git] / configure.ac
index 87ea6e46328d51149af5e45dda6b36f813d6ad50..c051caabc474194fd1b1f7664a35df840d500905 100644 (file)
@@ -7,11 +7,12 @@
 #
 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], [])
+m4_define([version_micro], [1])
+dnl Updated by make-version.pl
+m4_define([version_extra], [-git])
+m4_define([version_micro_extra], m4_join([], version_micro, version_extra))
 
-AC_INIT(wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
+AC_INIT(Wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
 CONFIG_ARGS="$*"
 AC_SUBST(CONFIG_ARGS)
 
@@ -45,17 +46,23 @@ dnl AC_CANONICAL_BUILD
 dnl AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 
-AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
+AM_INIT_AUTOMAKE([1.11 tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
+
+# Enable silent builds by default. Verbose builds can be enabled with "./configure
+# --enable-silent-rules ..." or "make V=1 ..."
+AM_SILENT_RULES([yes])
 
 # Make Wireshark's version available in config.h
 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
 
-AC_DEFINE(VERSION_FLAVOR, "Development Build", [Wireshark's package flavor])
+AC_DEFINE_UNQUOTED(VERSION_FLAVOR,
+       ["${WIRESHARK_VERSION_FLAVOR:-"Development Build"}"], [Wireshark's package flavor])
 
 LT_PREREQ([2.2.2])
 LT_INIT([disable-static dlopen])
+AC_SUBST([LIBTOOL_DEPS])
 
 AC_CONFIG_LIBOBJ_DIR([wsutil])
 
@@ -115,6 +122,7 @@ AX_PROG_CC_FOR_BUILD
 #
 AC_PROG_SED
 
+AC_PROG_LN_S
 AC_PROG_MKDIR_P
 
 AC_PATH_PROG(PERL, perl)
@@ -141,37 +149,21 @@ else
        AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
 fi
 
-#
-# XXX - should autogen.sh check for YACC/Bison and Flex?  A user building
-# from a distribution tarball shouldn't have to have YACC/Bison or Flex,
-# as the tarball should contain the results of running YACC/Bison on .y
-# files and running Flex on .l files, but a user building from SVN
-# will have to run YACC/Bison and Flex to process those files.
-#
-# On the other hand, what about users who use a distribution tarball to
-# do development?  They *shouldn't* - that's what the SVN repository is
-# for - but they might.  They'd get errors if they modify a .y or .l
-# file and try to do a build - but the error should tell them that they
-# need to get YACC/Bison and/or Flex.
-#
-# Then again, getting them shouldn't be too big of a burden.
-#
-# XXX - is the same true of pod2man and pod2html, or are they needed
-# even when building from a distribution tarball?
-#
-#
+dnl
+dnl Check for yacc/lex. Distribution tarballs include generated source,
+dnl in which case these tools are not a mandatory requirement to build.
+dnl
 AC_PROG_YACC
-AC_PATH_PROG(YACCDUMMY, $YACC)
-if test "x$YACCDUMMY" = x
-then
-       AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
-fi
-AM_PROG_LEX
-AC_PATH_PROG(LEX, flex)
-if test "x$LEX" = x
-then
-       AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
-fi
+AS_IF([test "x$YACC" = xyacc], [AS_UNSET(YACC)])
+AS_IF([test -z "$YACC" -a ! -f $srcdir/wiretap/ascend.c],
+       [AC_MSG_ERROR([I couldn't find bison or byacc; make sure it's installed and in your path])])
+AM_MISSING_PROG(YACC, bison)
+AC_PROG_LEX
+AS_IF([test "x$LEX" != xflex], [AS_UNSET(LEX)])
+AS_IF([test -z "$LEX" -a ! -f $srcdir/wiretap/ascend_scanner.c],
+       [AC_MSG_ERROR([I couldn't find flex; make sure it's installed and in your path])])
+AM_MISSING_PROG(LEX, flex)
+
 AC_PATH_PROG(POD2MAN, pod2man)
 if test "x$POD2MAN" = x
 then
@@ -189,41 +181,6 @@ then
        AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
 fi
 
-#
-# Checks for programs used by Wireshark/TShark/etc.
-#
-
-#
-# XXX - this looks for various HTML viewers on the host, not the target;
-# we really want to know what's available on the target, for cross-builds.
-# That would probably require us to, at run time, look for xdg-open and,
-# if we don't find it, look for mozilla, htmlview, etc.
-#
-AC_PATH_PROG(HTML_VIEWER, xdg-open)
-if test "x$HTML_VIEWER" != x
-then
-       #
-       # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
-       # Define some variable to be that, so we just run that?
-       #
-       AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
-
-       #
-       # XXX - we have to define HTML_VIEWER for the prefs.c code that
-       # sets the default value of the Web browser preference, even
-       # though that preference won't be offered.
-       #
-       AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
-else
-       AC_PATH_PROG(HTML_VIEWER, htmlview)
-       if test "x$HTML_VIEWER" = x
-       then
-               AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
-       else
-               AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
-       fi
-fi
-
 #
 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
 # flags such as -pedantic, -W warning flags and -f feature flags.  Currently,
@@ -258,266 +215,10 @@ 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
 
-AC_ARG_ENABLE(osx-deploy-target,
-  AC_HELP_STRING( [--enable-osx-deploy-target],
-    [choose an OS X deployment target @<:@default=major release on which you're building@:>@]),
-[
-       #
-       # Is this OS X?
-       #
-       case "$host_os" in
-       darwin*)
-               #
-               # Yes.
-               #
-               # Let the user specify an OS X release to use as a
-               # deplayment target; if they specify that we should
-               # have a deployment target but don't specify the
-               # deployment target, then, if we have SDKs available,
-               # pick the OS version on which the build is being done.
-               # This also causes the build to be done against an SDK
-               # rather than against the headers and libraries in
-               # /usr/include and /usr/lib.
-               #
-               # Check for an OS X deployment target early, so that
-               # as many tests using the compiler are done using the
-               # flags that we'll be using when building.
-               #
-               if test $enableval = no
-               then
-                       #
-                       # The user explicitly said
-                       # --disable-osx-deploy-target, so don't build
-                       # against an SDK.
-                       #
-                       deploy_target=
-               elif test $enableval = yes
-               then
-                       #
-                       # The user said --enable-osx-deploy-target, but
-                       # didn't say what version to target; target the
-                       # major version number of the version of OS X on
-                       # which we're running.
-                       #
-                       # (We quote the command so that we can use
-                       # autoconf's M4 quoting characters, [ and ], in
-                       # the sed expression.)
-                       #
-                       [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
-               else
-                       deploy_target="$enableval"
-               fi
-               ;;
-
-       *)
-               #
-               # No.  Fail, because whatever the user intended for us to
-               # do, we can't do it.
-               #
-               AC_MSG_ERROR([--enable-osx-deploy-target specified on an OS other than OS X])
-               ;;
-       esac
-],[
-       #
-       # Is this OS X?
-       #
-       case "$host_os" in
-       darwin*)
-               #
-               # Yes.
-               #
-               # If we have SDKs available, default to targeting the major
-               # version number of the version of OS X on which we're
-               # running.
-               #
-               # (We quote the command so that we can use autoconf's
-               # M4 quoting characters, [ and ], in the sed expression.)
-               #
-               for i in /Developer/SDKs \
-                   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
-                   /Library/Developer/CommandLineTools/SDKs
-               do
-                       if test -d "$i"
-                       then
-                               [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
-                               break
-                       fi
-               done
-               ;;
-
-       *)
-               #
-               # No.  There's nothing to do.
-               #
-               ;;
-       esac
-])
-
-if test ! -z "$deploy_target"
-then
-       AC_MSG_CHECKING([whether we can build for OS X $deploy_target])
-       case $deploy_target in
-
-       10.0|10.1|10.2)
-               #
-               # I'm not sure this would even work.
-               #
-               AC_MSG_RESULT(no)
-               AC_MSG_ERROR([We don't support building for OS X $deploy_target])
-               ;;
-
-       10.3)
-               #
-               # XXX - never tested.
-               #
-               AC_MSG_RESULT(yes)
-               SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
-               ;;
-
-       *)
-               #
-               # Look for the oldest SDK we can find that's
-               # for an OS equal to or later than this one.
-               #
-               # XXX - for 10.4, do we need 10.4u?  We're
-               # not currently doing fat builds (we'd need
-               # fat versions of the support libraries for
-               # that to be useful), but, if we do, we'd
-               # need to use 10.4u.
-               #
-
-               #
-               # Get the real version - strip off the "10.".
-               # We'll worry about that if, as, and when there's ever
-               # an OS XI.
-               #
-               deploy_real_version=`echo "$deploy_target" | sed -n 's/10\.\(.*\)/\1/p'`
-
-               #
-               # Search each directory that might contain SDKs.
-               #
-               sdkpath=""
-               for sdksdir in /Developer/SDKs \
-                   /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
-                   /Library/Developer/CommandLineTools/SDKs
-               do
-                       #
-                       # Get a list of all the SDKs.
-                       #
-                       if ! test -d "$sdksdir"
-                       then
-                               #
-                               # There is no directory with that name.
-                               # Move on to the next one in the list,
-                               # if any.
-                               #
-                               continue
-                       fi
-
-                       #
-                       # Get a list of all the SDKs in that directory,
-                       # if any.
-                       #
-                       # We have to use @<:@ for [ and @:>@ for ] to
-                       # avoid m4 removing the square brackets.
-                       #
-                       sdklist=`(cd "$sdksdir"; ls -d MacOSX10.@<:@0-9@:>@*.sdk 2>/dev/null)`
-
-                       for sdk in $sdklist
-                       do
-                               #
-                               # Get the real version for this SDK.
-                               #
-                               sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
-
-                               #
-                               # Is it for the deployment target or
-                               # some later release?
-                               #
-                               if test "$sdk_real_version" -ge "$deploy_real_version"
-                               then
-                                       #
-                                       # Yes, use it.
-                                       #
-                                       sdkpath="$sdksdir/$sdk"
-                                       break 2
-                               fi
-                       done
-               done
-               if test -z "$sdkpath"
-               then
-                       AC_MSG_RESULT(no)
-                       AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
-               fi
-               SDKPATH="$sdkpath"
-               AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
-               ;;
-       esac
-
-       #
-       # Add a -mmacosx-version-min flag to force tests that
-       # use the compiler, as well as the build itself, not to,
-       # for example, use compiler or linker features not supported
-       # by the minimum targeted version of the OS.
-       #
-       # Add an -isysroot flag to use the SDK.
-       #
-       WS_CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CFLAGS"
-       WS_CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CXXFLAGS"
-       WS_LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_LDFLAGS"
-
-       #
-       # Add a -sdkroot flag to use with osx-app.sh.
-       #
-       OSX_APP_FLAGS="-sdkroot $SDKPATH"
-
-       #
-       # XXX - do we need this to build the Wireshark wrapper?
-       # XXX - is this still necessary with the -mmacosx-version-min
-       # flag being set?
-       #
-       OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
-
-       #
-       # In the installer package XML file, give the deployment target
-       # as the minimum version.
-       #
-       OSX_MIN_VERSION="$deploy_target"
-
-       case $deploy_target in
-
-       10.4|10.5)
-               #
-               # Only 32-bit builds are supported.  10.5
-               # (and 10.4?) had a bug that causes some BPF
-               # functions not to work with 64-bit userland
-               # code, so capturing won't work.
-               #
-               WS_CFLAGS="-m32 $WS_CFLAGS"
-               WS_CXXFLAGS="-m32 $WS_CXXFLAGS"
-               WS_LDFLAGS="-m32 $WS_LDFLAGS"
-               ;;
-       esac
-else
-       #
-       # Is this OS X?
-       #
-       case "$host_os" in
-       darwin*)
-               #
-               # Yes.
-               #
-               # In the installer package XML file, give the current OS
-               # version, minor version and all, as the minimum version.
-               # We can't guarantee that the resulting binary will work
-               # on older OS versions, not even older minor versions
-               # (original release or earlier software updates).
-               #
-               OSX_MIN_VERSION=`sw_vers -productVersion`
-               ;;
-       esac
-fi
-AC_SUBST(OSX_MIN_VERSION)
+#
+# Add configure argument to select OSX deployment target.
+#
+AC_WIRESHARK_OSX_DEPLOY_TARGET
 
 #
 # Try to arrange for large file support.
@@ -544,18 +245,19 @@ AX_LIB_SOCKET_NSL
 #
 AC_ARG_WITH([qt],
   AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
-                 [use Qt @<:@default=yes@:>@]),
+                 [use Qt @<:@default=yes, if available@:>@]),
   with_qt="$withval", with_qt="unspecified")
 
-AC_ARG_WITH([gtk2],
-  AC_HELP_STRING( [--with-gtk2=@<:@yes/no@:>@],
-                 [use GTK+ 2.0 @<:@default=no@:>@]),
-  with_gtk2="$withval", with_gtk2="unspecified")
-
-AC_ARG_WITH([gtk3],
-  AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
-                 [use GTK+ 3.0 instead of 2.0 @<:@default=yes@:>@]),
-  with_gtk3="$withval", with_gtk3="unspecified")
+AC_ARG_WITH([gtk],
+  AC_HELP_STRING( [--with-gtk=@<:@yes/no/2/3@:>@],
+       [use GTK+ @<:@default=yes, if available@:>@]),
+       AS_CASE([$withval],
+         [yes], [with_gtk="3 2 fail"],
+         [no],  [with_gtk="no"],
+         [3],   [with_gtk="3 fail3"],
+         [2],   [with_gtk="2 fail2"],
+         [AC_MSG_ERROR([--with-gtk must be one of yes/no/2/3])]),
+       with_gtk="3 2")
 
 # GnuTLS
 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
@@ -757,34 +459,19 @@ AX_LIBSMI
 #
 # Check for programs used when building DocBook documentation.
 #
+AC_CHECK_PROGS(XSLTPROC, xsltproc, xsltproc)
+AC_CHECK_PROGS(A2X, a2x, a2x)
+AC_CHECK_PROGS(FOP, fop, fop)
 
-# Check for a2x (convert asciidoc to another format)
-AC_PATH_PROG(A2X, a2x)
-AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no")
-AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = xyes)
-
-# Check for fop (translate .fo to e.g. pdf)
-AC_PATH_PROG(FOP, fop)
-AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
-AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
-
-# TODO: HAVE_LYNX and HAVE_W3M are unused. Maybe require one of them
-# to be found when a2x is enabled? Otherwise it will fail later...
-# Check for lynx (asciidoc text format from html)
-AC_PATH_PROG(LYNX, lynx)
-AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
-AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
-
-# Check for w3m (asciidoc text format from html)
-AC_PATH_PROG(W3M, w3m)
-AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no")
-AM_CONDITIONAL(HAVE_W3M, test x$HAVE_W3M = xyes)
-
-# Check for xsltproc
-AC_PATH_PROG(XSLTPROC, xsltproc)
-AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
-AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
-
+# HTML to text processor
+AC_MSG_CHECKING([for an HTML to text processor])
+AS_IF([w3m -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=w3m],
+       [lynx -version >&AS_MESSAGE_LOG_FD 2>&1], [have_a2x_text=lynx],
+       [have_a2x_text=no])
+AC_MSG_RESULT([$have_a2x_text])
+AM_CONDITIONAL(HAVE_A2X_TEXT, [test "x$have_a2x_text" != xno])
+AS_IF([test $have_a2x_text = lynx], [A2X_LYNX="--lynx"])
+AC_SUBST(A2X_LYNX)
 
 # Check for packaging utilities
 # For now, we check to see if the various packaging utilites are in our
@@ -810,8 +497,22 @@ fi
 AC_SUBST(HAVE_SVR4_PACKAGING)
 
 # RPM
-AC_WIRESHARK_RPM_CHECK
-AC_SUBST(HAVE_RPM)
+#
+# Looks for the rpmbuild program, and checks to see if we can redefine "_topdir".
+#
+AC_CHECK_PROGS(RPMBUILD, [rpmbuild], [false])
+if test "x$RPMBUILD" != "xfalse" ; then
+       AC_MSG_CHECKING([to see if we can redefine _topdir])
+       rpm --define '_topdir /tmp' > /dev/null 2>&1
+       if test $? -eq 0 ; then
+               AC_MSG_RESULT(yes)
+               have_rpm=yes
+       else
+               AC_MSG_RESULT([no, you'll have to build packages manually])
+               have_rpm=no
+       fi
+fi
+AM_CONDITIONAL(HAVE_RPM, [test "x$have_rpm" = xyes])
 
 # Debian
 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
@@ -866,7 +567,6 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Warray-bounds)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
@@ -880,12 +580,13 @@ AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
-AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
+
 #
 # The following are C only, not C++
 #
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdeclaration-after-statement, C)
+AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable, C)
 
 #
 # XXX - OK for C++?
@@ -1222,8 +923,10 @@ AC_SUBST(CFLAGS_SSE42)
 #
 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
   AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
+  AC_DEFINE(WS_NORETURN, __attribute((noreturn)), [Hint to the compiler that a function never returns])
 else
   AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
+  AC_DEFINE(WS_NORETURN, , [Hint to the compiler that a function never returns])
 fi
 
 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
@@ -1374,12 +1077,6 @@ cygwin*)
 esac
 AC_SUBST(LDFLAGS_SHAREDLIB)
 
-# Enable silent builds by default
-# Verbose builds can be enabled with "./configure
-# --enable-silent-rules ..." or "make V=1 ..."
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
-  [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
-
 #
 # On "Darwin", which we assume to mean "OS X" rather than "iOS" or
 # "just Darwin" (as we don't currently support iOS, and as I don't
@@ -1422,15 +1119,6 @@ AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
 AM_CONDITIONAL(HAVE_OS_X_FRAMEWORKS, [test "x$have_os_x_frameworks" = "xyes"])
 
-#
-# On Solaris, check whether we have getexecname().
-#
-case "$host_os" in
-solaris*)
-       AC_CHECK_FUNC(getexecname)
-       ;;
-esac
-
 #
 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
 # link directory.
@@ -1573,24 +1261,6 @@ AC_SUBST(QT_MIN_VERSION)
 have_qt=no
 have_gtk=no
 if test "x$enable_wireshark" = "xyes"; then
-       if test "x$with_gtk2" = "xunspecified" -a \
-               "x$with_gtk3" = "xunspecified" -a \
-               "x$with_qt" = "xunspecified"; then
-               #
-               # No GUI toolkits were explicitly specified; pick Qt
-               # and GTK+ 3.
-               #
-               with_qt=yes
-               with_gtk3=yes
-       elif test "x$with_gtk2" = "xunspecified" -a \
-                 "x$with_gtk3" = "xunspecified" -a \
-                 "x$with_qt" = "xno"; then
-               #
-               # Qt was explicitly disabled, and neither GTK+ 2 nor
-               # GTK+ 3 were explicitly specified; pick GTK+ 3.
-               #
-               with_gtk3=yes
-       fi
        if test "x$with_qt" != "xno"; then
                #
                # Qt was specified; make sure we have a C++ compiler.
@@ -1688,41 +1358,34 @@ if test "x$enable_wireshark" = "xyes"; then
                ])
        fi
 
-       if test "x$with_gtk3" = "xyes"; then
-               #
-               # GTK+ 3 was specified; make sure they didn't also
-               # specify GTK+ 2, as we don't support building both
-               # GTK+ 2 and GTK+ 3 versions at the same time.
-               #
-               if test "x$with_gtk2" = "xyes"; then
-                       AC_MSG_ERROR([Both GTK+ 2 and GTK+ 3 were specified; choose one but not both])
-               fi
-
-               #
-               # Make sure we have GTK+ 3.
-               #
-               PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
+       for want_gtk_version in $with_gtk; do
+               AS_CASE([$want_gtk_version],
+                 [3], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
                        [gtk+-3.0 >= $GTK3_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
                        [
-                               have_gtk=yes
-                               GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
-                               GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
+                         have_gtk=yes
+                         GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
+                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=3"
                        ],
-                       [AC_MSG_ERROR([GTK+ 3 is not available])])
-       elif test "x$with_gtk2" = "xyes"; then
-               #
-               # GTK+ 3 wasn't specified, and GTK+ 2 was specified;
-               # make sure we have GTK+ 2.
-               #
-               PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
+                       [
+                         :
+                       ])],
+                 [2], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
                        [gtk+-2.0 >= $GTK2_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
                        [
-                               have_gtk=yes
-                               GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
-                               GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
+                         have_gtk=yes
+                         GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
+                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=2"
                        ],
-                       [AC_MSG_ERROR([GTK+ 2 is not available])])
-       fi
+                       [
+                         :
+                       ])],
+                 [fail3], [AC_MSG_ERROR([GTK+ 3 was requested but is not available])],
+                 [fail2], [AC_MSG_ERROR([GTK+ 2 was requested but is not available])],
+                 [fail],  [AC_MSG_ERROR([GTK+ was requested but is not available])])
+
+               AS_IF([test "x$have_gtk" = xyes], [break])
+       done
 
        if test "$have_gtk" = "yes" ; then
                # If we have GTK then add flags for it.
@@ -1731,11 +1394,11 @@ if test "x$enable_wireshark" = "xyes"; then
                #
                GTK_CONFIG="$GLIB_CONFIG"
 
-               gtk_config_major_version=`echo $GTK_VERSION | cut -d. -f1`
-               gtk_config_minor_version=`echo $GTK_VERSION | cut -d. -f2`
+               gtk_major_version=`echo $GTK_VERSION | cut -d. -f1`
+               gtk_minor_version=`echo $GTK_VERSION | cut -d. -f2`
 
                AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATED], [GTK_CONFIG])
-               if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
+               if test \( $gtk_major_version -eq 3 -a $gtk_minor_version -ge 10 \) ; then
                        ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
                        ##  The deprecations in Gtk 3.10 will not be fixed ...
                        AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATION_WARNINGS], [GTK_CONFIG])
@@ -1743,7 +1406,7 @@ if test "x$enable_wireshark" = "xyes"; then
                        AX_APPEND_FLAG([-DGTK_DISABLE_DEPRECATED], [GTK_CONFIG])
                fi
                AX_APPEND_FLAG([-DGTK_DISABLE_SINGLE_INCLUDES], [GTK_CONFIG])
-               if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
+               if test ! \( $gtk_major_version -eq 2 -a $gtk_minor_version -lt 20 \) ; then
                        # Enable GSEAL when building with GTK > 2.20
                        # (Versions prior to 2.22 lacked some necessary accessors.)
                        AX_APPEND_FLAG([-DGSEAL_ENABLE], [GTK_CONFIG])
@@ -1792,7 +1455,6 @@ if test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
        wireshark_bin="wireshark-gtk\$(EXEEXT)"
        wireshark_man="wireshark.1"
        wireshark_SUBDIRS="codecs ui/gtk"
-       use_glib_cflags="false"
        OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
        OSX_DMG_FLAGS="-gtk"
 fi
@@ -1806,14 +1468,11 @@ if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
        # problem).
        #
        if test "x$enable_wireshark" = "xyes"; then
-               if test "x$with_gtk3" = "xyes"; then
-                       AC_MSG_ERROR([Neither Qt nor GTK+ $GTK3_MIN_VERSION or later are available, so Wireshark can't be compiled])
-               else
-                       AC_MSG_ERROR([Neither Qt nor GTK+ $GTK2_MIN_VERSION or later are available, so Wireshark can't be compiled])
-               fi
+               AC_MSG_ERROR([Neither Qt nor GTK+ are available, so Wireshark can't be compiled])
        fi
        wireshark_bin=""
        wireshark_man=""
+       wireshark_SUBDIRS=""
 fi
 
 #
@@ -1954,6 +1613,7 @@ fi
 
 AC_SUBST(wireshark_bin)
 AC_SUBST(wireshark_man)
+AC_SUBST(wireshark_SUBDIRS)
 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
 AC_SUBST(OSX_APP_FLAGS)
@@ -2652,17 +2312,6 @@ else
 fi
 AC_SUBST(LIBSSH_LIBS)
 
-#
-# Define WS_MSVC_NORETURN appropriately for declarations of routines that
-# never return (just like Charlie on the MTA).
-#
-# Note that MSVC++ expects __declspec(noreturn) to precede the function
-# name and GCC, as far as I know, expects __attribute__((noreturn)) to
-# follow the function name, so we need two different flavors of
-# noreturn tag.
-#
-AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
-
 dnl Checks for typedefs, structures, and compiler characteristics.
 # AC_C_CONST
 
@@ -2732,15 +2381,21 @@ AC_REPLACE_FUNCS(inet_ntop)
 AC_REPLACE_FUNCS(strptime)
 AC_REPLACE_FUNCS(popcount)
 
-AC_CHECK_FUNCS(getaddrinfo)
-AC_CHECK_FUNCS(mkstemp mkdtemp)
+AC_CHECK_FUNCS(mkstemps mkdtemp)
 AC_CHECK_FUNCS(getprotobynumber)
 AC_CHECK_FUNCS(issetugid)
 AC_CHECK_FUNCS(sysconf)
 AC_CHECK_FUNCS(getifaddrs)
+AC_CHECK_FUNC(getexecname)
 
-dnl blank for now, but will be used in future
-AC_SUBST(wireshark_SUBDIRS)
+#
+# Check for SpeexDSP (http://www.speex.org)
+#
+AS_IF([test "x$have_qt_multimedia_lib" = xyes],
+       [PKG_CHECK_MODULES(SPEEXDSP, speexdsp, [have_speexdsp=yes], [have_speexdsp=no])])
+AS_IF([test "x$have_speexdsp" = xyes],
+       [AC_DEFINE(HAVE_SPEEXDSP, 1, [Define to 1 if you have SpeexDSP])])
+AM_CONDITIONAL(HAVE_SPEEXDSP, [test "x$have_speexdsp" = "xyes"])
 
 # Check Bluetooth SBC codec for RTP Player
 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
@@ -2872,8 +2527,8 @@ AC_ARG_ENABLE(sshdump,
 if test "x$have_extcap" != xyes; then
        AC_MSG_RESULT([no, extcap disabled])
        enable_sshdump=no
-elif test "x$have_good_libssh" != xyes; then
-       AC_MSG_RESULT([no, libssh not available])
+elif test "x$have_libssh_pointsix" != xyes; then
+       AC_MSG_RESULT([no, libssh >= 0.6.0 not available])
        enable_sshdump=no
 elif test "x$enable_sshdump" = "xyes" ; then
        AC_MSG_RESULT(yes)
@@ -2902,8 +2557,8 @@ AC_ARG_ENABLE(ciscodump,
 if test "x$have_extcap" != xyes; then
        AC_MSG_RESULT([no, extcap disabled])
        enable_ciscodump=no
-elif test "x$have_good_libssh" != xyes; then
-       AC_MSG_RESULT([no, libssh not available])
+elif test "x$have_libssh_pointsix" != xyes; then
+       AC_MSG_RESULT([no, libssh >= 0.6.0 not available])
        enable_ciscodump=no
 elif test "x$enable_ciscodump" = "xyes" ; then
        AC_MSG_RESULT(yes)
@@ -2948,18 +2603,6 @@ fi
 AC_SUBST(randpktdump_bin)
 AC_SUBST(randpktdump_man)
 
-dnl libtool defs
-#
-# Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
-# (autoconf?  automake?  libtool?) - with the newer version(s), it's
-# just an alias for AC_PROG_LIBTOOL, which is called earlier.
-#
-# With older version(s) of those tool(s), however, it's not just an
-# alias, and the configure scripts don't work without it.
-#
-AM_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
 if test x$enable_static = xyes -a x$have_plugins = xyes
 then
@@ -2969,7 +2612,7 @@ AC_SUBST(ENABLE_STATIC)
 
 # Gather which GUI we're building for rpmbuild
 if test "x$have_gtk" = "xyes"; then
-       if test "x$with_gtk3" = "xyes"; then
+       if test "x$gtk_major_version" = "x3"; then
                RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
        else
                RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
@@ -2992,6 +2635,7 @@ else
        RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
 fi
 AC_SUBST(RPMBUILD_WITH_ARGS)
+AC_SUBST(RPM_VERSION, version_major.version_minor.version_micro)
 
 AC_SUBST(WS_CPPFLAGS)
 AC_SUBST(WS_CFLAGS)
@@ -3008,7 +2652,7 @@ AC_CACHE_SAVE
 sinclude(plugins/Custom.m4) dnl
 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
 
-sinclude(asn1/Custom.m4) dnl
+sinclude(epan/dissectors/asn1/Custom.m4) dnl
 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
 
 AC_CONFIG_HEADERS([config.h])