atn ulcs/cpdlc: fix ia5alpha’ defined but not used [-Werror=unused-const-variable...
[metze/wireshark/wip.git] / configure.ac
1 #
2 # Autoconf script for Wireshark
3 #
4
5 #
6 # Define variables for the components of the Wireshark version number.
7 #
8 m4_define([version_major], [2])
9 m4_define([version_minor], [1])
10 m4_define([version_micro], [0])
11 m4_define([version_micro_extra], version_micro)
12 m4_append([version_micro_extra], [])
13
14 AC_INIT(wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
15 CONFIG_ARGS="$*"
16 AC_SUBST(CONFIG_ARGS)
17
18 # Minimum autoconf version we require.
19 AC_PREREQ(2.60)
20 # Variable expansion doesn't work in AC_PREREQ()
21 AC_MIN_VERSION=2.60
22 AC_SUBST(AC_MIN_VERSION)
23
24 dnl Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
25 dnl in configure.ac in sync, otherwise there will be an error running autogen.sh.
26 m4_ifdef([AC_CONFIG_MACRO_DIRS],AC_CONFIG_MACRO_DIRS([./aclocal-fallback]))
27
28 dnl Check for CPU / vendor / OS
29 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
30 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
31 dnl needs.  Using `AC_CANONICAL_TARGET' is enough to run the two other
32 dnl macros.
33 dnl
34 dnl As nothing in the Wireshark is itself a build tool (we are not,
35 dnl for example, a compiler that generates machine code), we probably
36 dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
37 dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
38 dnl AC_CANONICAL_HOST - instead.  Note that we do have tools, such as
39 dnl lemon, that need to be built for the build machine, not for the
40 dnl host machine, so we might need both.
41 dnl
42 dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
43
44 dnl AC_CANONICAL_BUILD
45 dnl AC_CANONICAL_HOST
46 AC_CANONICAL_TARGET
47
48 AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip subdir-objects])
49
50 # Make Wireshark's version available in config.h
51 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
52 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
53 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
54
55 AC_DEFINE(VERSION_FLAVOR, "Development Build", [Wireshark's package flavor])
56
57 AM_DISABLE_STATIC
58
59 #
60 # Checks for programs used in the main build process.
61 #
62 AC_PROG_CC_STDC
63 if test "$ac_cv_prog_cc_stdc" == "no"
64 then
65         AC_MSG_ERROR([The C compiler does not support standard C])
66 fi
67 AM_PROG_CC_C_O
68 AC_PROG_CXX
69 AC_PROG_CPP
70 AC_PROG_MKDIR_P
71
72 dnl Work around libtool bug (fixed in the version 1.5a?)
73 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
74 AC_LIBTOOL_DLOPEN
75 AC_PROG_LIBTOOL
76 if test ! -z "$CXX"; then
77         #
78         # OK, we found something AC_LANG_CXX thinks is a C++ compiler,
79         # but is it one?
80         #
81         # Some UN*Xes have, by default, a case-insensitive file
82         # system, and AC_PROG_CXX looks for, among other things,
83         # "CC" as a C++ compiler, and, if you have a case-insensitive
84         # file system and a C compiler named "cc" (both true, by
85         # default, on OS X), AC_PROG_CXX may end up thinking it's
86         # the C++ compiler.
87         #
88         # So we check by feeding the purported C++ compiler a
89         # program using C++ features (iostream).
90         #
91         # We do this after AC_PROG_LIBTOOL; if we did so before, and
92         # cleared CXX if what we had isn't a C++ compiler, that'd
93         # get undone by AC_PROG_LIBTOOL for some reason.
94         #
95         AC_MSG_CHECKING(whether $CXX is a C++ compiler)
96         AC_LANG_PUSH([C++])
97         AC_LINK_IFELSE([AC_LANG_PROGRAM(
98         [
99 #include <iostream>
100         ],
101         [
102         std::cout << "Hello World! ";
103         return 0;
104         ])],
105                 [AC_MSG_RESULT(yes)],
106                 [
107                         AC_MSG_RESULT(no)
108                         CXX=""
109                 ])
110         AC_LANG_POP([C++])
111 fi
112 AC_PATH_PROG(PERL, perl)
113
114 # Check for Python.
115 AC_PATH_PROGS(PYTHON, python python3)
116 if test ! -z "$PYTHON"; then
117         #
118         # OK, we found Python; is it Python 2.5 or later?
119         # Note: we don't use named components for sys.version_info to get
120         # the major version number, as named components for version_info
121         # were apparently introduced in Python 2.7.
122         #
123         AC_MSG_CHECKING([whether $PYTHON is Python 2.5 or later])
124         python_major_version=`$PYTHON -c 'import sys; print (sys.version_info[[0]])'`
125         python_minor_version=`$PYTHON -c 'import sys; print (sys.version_info[[1]])'`
126         if test "$python_major_version" -eq 2 -a "$python_minor_version" -lt 5 ; then
127                 AC_MSG_RESULT(no)
128                 AC_MSG_WARN([Building with Python $python_major_version.$python_minor_version may not work])
129         else
130                 AC_MSG_RESULT(yes)
131         fi
132 else
133         AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
134 fi
135
136 #
137 # XXX - should autogen.sh check for YACC/Bison and Flex?  A user building
138 # from a distribution tarball shouldn't have to have YACC/Bison or Flex,
139 # as the tarball should contain the results of running YACC/Bison on .y
140 # files and running Flex on .l files, but a user building from SVN
141 # will have to run YACC/Bison and Flex to process those files.
142 #
143 # On the other hand, what about users who use a distribution tarball to
144 # do development?  They *shouldn't* - that's what the SVN repository is
145 # for - but they might.  They'd get errors if they modify a .y or .l
146 # file and try to do a build - but the error should tell them that they
147 # need to get YACC/Bison and/or Flex.
148 #
149 # Then again, getting them shouldn't be too big of a burden.
150 #
151 # XXX - is the same true of pod2man and pod2html, or are they needed
152 # even when building from a distribution tarball?
153 #
154 #
155 AC_PROG_YACC
156 AC_PATH_PROG(YACCDUMMY, $YACC)
157 if test "x$YACCDUMMY" = x
158 then
159         AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
160 fi
161 AM_PROG_LEX
162 AC_PATH_PROG(LEX, flex)
163 if test "x$LEX" = x
164 then
165         AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
166 fi
167 AC_PATH_PROG(POD2MAN, pod2man)
168 if test "x$POD2MAN" = x
169 then
170         #
171         # The alternative is not to build the man pages....
172         #
173         AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
174 fi
175 AC_PATH_PROG(POD2HTML, pod2html)
176 if test "x$POD2HTML" = x
177 then
178         #
179         # The alternative is not to build the HTML man pages....
180         #
181         AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
182 fi
183
184 #
185 # Checks for programs used by Wireshark/TShark/etc.
186 #
187
188 #
189 # XXX - this looks for various HTML viewers on the host, not the target;
190 # we really want to know what's available on the target, for cross-builds.
191 # That would probably require us to, at run time, look for xdg-open and,
192 # if we don't find it, look for mozilla, htmlview, etc.
193 #
194 AC_PATH_PROG(HTML_VIEWER, xdg-open)
195 if test "x$HTML_VIEWER" != x
196 then
197         #
198         # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
199         # Define some variable to be that, so we just run that?
200         #
201         AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
202
203         #
204         # XXX - we have to define HTML_VIEWER for the prefs.c code that
205         # sets the default value of the Web browser preference, even
206         # though that preference won't be offered.
207         #
208         AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
209 else
210         AC_PATH_PROG(HTML_VIEWER, htmlview)
211         if test "x$HTML_VIEWER" = x
212         then
213                 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
214         else
215                 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
216         fi
217 fi
218
219 #
220 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
221 # flags such as -pedantic, -W warning flags and -f feature flags.  Currently,
222 # we assume GCC and clang do; other compilers should be added here.
223 #
224 # This is done to avoid getting tripped up by compilers that support
225 # those flags but give them a different meaning.
226 #
227 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
228         ac_supports_gcc_flags=yes
229 fi
230
231 if test "x$CC_FOR_BUILD" = x
232 then
233        CC_FOR_BUILD=$CC
234 fi
235 AC_SUBST(CC_FOR_BUILD)
236 AC_SUBST(CFLAGS_FOR_BUILD)
237
238 # Check for doxygen
239 AC_PATH_PROG(DOXYGEN, doxygen)
240 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
241 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
242
243 #
244 # Check for pkg-config and set PKG_CONFIG accordingly.
245 #
246 # This is referenced via AC_REQUIRE([PKG_PROG_PKG_CONFIG] in some macros
247 # like PKG_CHECK_MODULES. If the first call to such a macro is under an
248 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
249 # the comments in acolocal.m4
250 #
251 # We want version 0.7 or better.  (XXX - explain why. Is that just
252 # because our Qt tests were originally based on AM_PATH_GTK, and *it*
253 # requires 0.7 or better?)
254 #
255 PKG_PROG_PKG_CONFIG(0.7)
256 if test -z "$PKG_CONFIG"; then
257         AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
258 fi
259
260 AC_ARG_ENABLE(osx-deploy-target,
261   AC_HELP_STRING( [--enable-osx-deploy-target],
262     [choose an OS X deployment target @<:@default=major release on which you're building@:>@]),
263 [
264         #
265         # Is this OS X?
266         #
267         case "$host_os" in
268         darwin*)
269                 #
270                 # Yes.
271                 #
272                 # Let the user specify an OS X release to use as a
273                 # deplayment target; if they specify that we should
274                 # have a deployment target but don't specify the
275                 # deployment target, then, if we have SDKs available,
276                 # pick the OS version on which the build is being done.
277                 # This also causes the build to be done against an SDK
278                 # rather than against the headers and libraries in
279                 # /usr/include and /usr/lib.
280                 #
281                 # Check for an OS X deployment target early, so that
282                 # as many tests using the compiler are done using the
283                 # flags that we'll be using when building.
284                 #
285                 if test $enableval = no
286                 then
287                         #
288                         # The user explicitly said
289                         # --disable-osx-deploy-target, so don't build
290                         # against an SDK.
291                         #
292                         deploy_target=
293                 elif test $enableval = yes
294                 then
295                         #
296                         # The user said --enable-osx-deploy-target, but
297                         # didn't say what version to target; target the
298                         # major version number of the version of OS X on
299                         # which we're running.
300                         #
301                         # (We quote the command so that we can use
302                         # autoconf's M4 quoting characters, [ and ], in
303                         # the sed expression.)
304                         #
305                         [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
306                 else
307                         deploy_target="$enableval"
308                 fi
309                 ;;
310
311         *)
312                 #
313                 # No.  Fail, because whatever the user intended for us to
314                 # do, we can't do it.
315                 #
316                 AC_MSG_ERROR([--enable-osx-deploy-target specified on an OS other than OS X])
317                 ;;
318         esac
319 ],[
320         #
321         # Is this OS X?
322         #
323         case "$host_os" in
324         darwin*)
325                 #
326                 # Yes.
327                 #
328                 # If we have SDKs available, default to targeting the major
329                 # version number of the version of OS X on which we're
330                 # running.
331                 #
332                 # (We quote the command so that we can use autoconf's
333                 # M4 quoting characters, [ and ], in the sed expression.)
334                 #
335                 for i in /Developer/SDKs \
336                     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
337                     /Library/Developer/CommandLineTools/SDKs
338                 do
339                         if test -d "$i"
340                         then
341                                 [deploy_target=`sw_vers -productVersion | sed 's/\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.[0-9]*/\1.\2/'`]
342                                 break
343                         fi
344                 done
345                 ;;
346
347         *)
348                 #
349                 # No.  There's nothing to do.
350                 #
351                 ;;
352         esac
353 ])
354
355 if test ! -z "$deploy_target"
356 then
357         AC_MSG_CHECKING([whether we can build for OS X $deploy_target])
358         case $deploy_target in
359
360         10.0|10.1|10.2)
361                 #
362                 # I'm not sure this would even work.
363                 #
364                 AC_MSG_RESULT(no)
365                 AC_ERROR([We don't support building for OS X $deploy_target])
366                 ;;
367
368         10.3)
369                 #
370                 # XXX - never tested.
371                 #
372                 AC_MSG_RESULT(yes)
373                 SDKPATH="/Developer/SDKs/MacOSX10.3.9.sdk"
374                 ;;
375
376         *)
377                 #
378                 # Look for the oldest SDK we can find that's
379                 # for an OS equal to or later than this one.
380                 #
381                 # XXX - for 10.4, do we need 10.4u?  We're
382                 # not currently doing fat builds (we'd need
383                 # fat versions of the support libraries for
384                 # that to be useful), but, if we do, we'd
385                 # need to use 10.4u.
386                 #
387
388                 #
389                 # Get the real version - strip off the "10.".
390                 # We'll worry about that if, as, and when there's ever
391                 # an OS XI.
392                 #
393                 deploy_real_version=`echo "$deploy_target" | sed -n 's/10\.\(.*\)/\1/p'`
394
395                 #
396                 # Search each directory that might contain SDKs.
397                 #
398                 sdkpath=""
399                 for sdksdir in /Developer/SDKs \
400                     /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs \
401                     /Library/Developer/CommandLineTools/SDKs
402                 do
403                         #
404                         # Get a list of all the SDKs.
405                         #
406                         if ! test -d "$sdksdir"
407                         then
408                                 #
409                                 # There is no directory with that name.
410                                 # Move on to the next one in the list,
411                                 # if any.
412                                 #
413                                 continue
414                         fi
415
416                         #
417                         # Get a list of all the SDKs in that directory,
418                         # if any.
419                         #
420                         # We have to use @<:@ for [ and @:>@ for ] to
421                         # avoid m4 removing the square brackets.
422                         #
423                         sdklist=`(cd "$sdksdir"; ls -d MacOSX10.@<:@0-9@:>@*.sdk 2>/dev/null)`
424
425                         for sdk in $sdklist
426                         do
427                                 #
428                                 # Get the real version for this SDK.
429                                 #
430                                 sdk_real_version=`echo "$sdk" | sed -n 's/MacOSX10\.\(.*\)\.sdk/\1/p'`
431
432                                 #
433                                 # Is it for the deployment target or
434                                 # some later release?
435                                 #
436                                 if test "$sdk_real_version" -ge "$deploy_real_version"
437                                 then
438                                         #
439                                         # Yes, use it.
440                                         #
441                                         sdkpath="$sdksdir/$sdk"
442                                         break 2
443                                 fi
444                         done
445                 done
446                 if test -z "$sdkpath"
447                 then
448                         AC_MSG_RESULT(no)
449                         AC_MSG_ERROR([We couldn't find an SDK for OS X $deploy_target or later])
450                 fi
451                 SDKPATH="$sdkpath"
452                 AC_MSG_RESULT([yes, with the 10.$sdk_real_version SDK])
453                 ;;
454         esac
455
456         #
457         # Add a -mmacosx-version-min flag to force tests that
458         # use the compiler, as well as the build itself, not to,
459         # for example, use compiler or linker features not supported
460         # by the minimum targeted version of the OS.
461         #
462         # Add an -isysroot flag to use the SDK.
463         #
464         WS_CFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CFLAGS"
465         WS_CXXFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_CXXFLAGS"
466         WS_LDFLAGS="-mmacosx-version-min=$deploy_target -isysroot $SDKPATH $WS_LDFLAGS"
467
468         #
469         # Add a -sdkroot flag to use with osx-app.sh.
470         #
471         OSX_APP_FLAGS="-sdkroot $SDKPATH"
472
473         #
474         # XXX - do we need this to build the Wireshark wrapper?
475         # XXX - is this still necessary with the -mmacosx-version-min
476         # flag being set?
477         #
478         OSX_DEPLOY_TARGET="MACOSX_DEPLOYMENT_TARGET=$deploy_target"
479
480         #
481         # In the installer package XML file, give the deployment target
482         # as the minimum version.
483         #
484         OSX_MIN_VERSION="$deploy_target"
485
486         case $deploy_target in
487
488         10.4|10.5)
489                 #
490                 # Only 32-bit builds are supported.  10.5
491                 # (and 10.4?) had a bug that causes some BPF
492                 # functions not to work with 64-bit userland
493                 # code, so capturing won't work.
494                 #
495                 WS_CFLAGS="-m32 $WS_CFLAGS"
496                 WS_CXXFLAGS="-m32 $WS_CXXFLAGS"
497                 WS_LDFLAGS="-m32 $WS_LDFLAGS"
498                 ;;
499         esac
500 else
501         #
502         # Is this OS X?
503         #
504         case "$host_os" in
505         darwin*)
506                 #
507                 # Yes.
508                 #
509                 # In the installer package XML file, give the current OS
510                 # version, minor version and all, as the minimum version.
511                 # We can't guarantee that the resulting binary will work
512                 # on older OS versions, not even older minor versions
513                 # (original release or earlier software updates).
514                 #
515                 OSX_MIN_VERSION=`sw_vers -productVersion`
516                 ;;
517         esac
518 fi
519 AC_SUBST(OSX_MIN_VERSION)
520
521 #
522 # Try to arrange for large file support.
523 #
524 AC_SYS_LARGEFILE
525
526 #
527 # Look for math functions; use libm if necessary.
528 #
529 AC_SEARCH_LIBS(floor, m)
530 AC_SEARCH_LIBS(ceil, m)
531 AC_SEARCH_LIBS(exp, m)
532 AC_SEARCH_LIBS(log, m)
533 AC_SEARCH_LIBS(log10, m)
534 AC_SEARCH_LIBS(floorl, m,
535   [
536     FLOORL_LO=""
537     AC_DEFINE(HAVE_FLOORL, 1, [Define if you have the floorl function.])
538   ],
539   FLOORL_LO="floorl.lo")
540 AC_SUBST(FLOORL_LO)
541 AC_SEARCH_LIBS(lrint, m,
542   [AC_DEFINE(HAVE_LRINT, 1, [Define if you have the 'lrint' function.])])
543
544
545 #
546 # GUI toolkit options
547 #
548 AC_ARG_WITH([qt],
549   AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
550                   [use Qt @<:@default=yes@:>@]),
551   with_qt="$withval", with_qt="unspecified")
552
553 AC_ARG_WITH([gtk2],
554   AC_HELP_STRING( [--with-gtk2=@<:@yes/no@:>@],
555                   [use GTK+ 2.0 @<:@default=no@:>@]),
556   with_gtk2="$withval", with_gtk2="unspecified")
557
558 AC_ARG_WITH([gtk3],
559   AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
560                   [use GTK+ 3.0 instead of 2.0 @<:@default=yes@:>@]),
561   with_gtk3="$withval", with_gtk3="unspecified")
562
563 # GnuTLS
564 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
565 # LGPLv2.1+ in version 3.1.10.
566 # GnuTLS depends on GMP which switched from LGPLv2.1+ to LGPLv3+ in
567 # version 4.2.2, the switched to LGPLv3+ / GPLv2+ in version 6.0.0.
568
569 tls_message="no"
570 want_gnutls="if_available"
571 AC_ARG_WITH([gnutls],
572   AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
573                   [use GnuTLS library @<:@default=yes, if available@:>@]),
574   [ with_gnutls="$withval"; want_gnutls="yes" ], with_gnutls="yes")
575
576 if test "x$with_gnutls" = "xyes"; then
577   have_license_compatible_gnutls="no"
578   PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.10 ],
579     [ have_license_compatible_gnutls="yes" ], [ echo "GnuTLS >= 3.1.10 not found " ]
580   )
581
582   if test "x$have_license_compatible_gnutls" != "xyes"; then
583     PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0 gnutls < 3],
584       [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 2.12.0, < 3.0 not found " ]
585     )
586   fi
587
588   if test "x$have_license_compatible_gnutls" = "xyes"; then
589     echo "GnuTLS found, enabling SSL decryption"
590     AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use GnuTLS library])
591     tls_message="yes"
592   else
593     echo "GnuTLS with compatible license not found, disabling SSL decryption"
594     tls_message="no"
595
596     # Error out if the user explicitly requested gnutls
597     if test "x$want_gnutls" = "xyes"; then
598         AC_MSG_ERROR([GnuTLS crypto library was requested, but is not available])
599     fi
600   fi
601 fi
602
603 # libgrypt
604 gcrypt_message="no"
605 want_gcrypt="if_available"
606 AC_ARG_WITH([gcrypt],
607   AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
608                   [use gcrypt library @<:@default=yes, if available@:>@]),
609   [ with_gcrypt="$withval"; want_gcrypt="yes" ], with_gcrypt="yes")
610
611 if test "x$with_gcrypt" = "xyes"; then
612   AM_PATH_LIBGCRYPT(1.4.2,
613         [
614                 echo "libgcrypt found, enabling decryption for ipsec, ssl, etc."
615                 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
616                 gcrypt_message="yes"
617         ]
618         , [
619                 if test x$libgcrypt_config_prefix != x ; then
620                         AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
621                 else
622                         echo "libgcrypt not found, disabling decryption for ipsec, ssl, etc."
623                         gcrypt_message="no"
624                 fi
625
626                 # Error out if the user explicitly requested gcrypt
627                 if test "x$want_gcrypt" = "xyes"; then
628                     AC_MSG_ERROR([libgcrypt library was requested, but is not available])
629                 fi
630         ]
631   )
632 fi
633
634 AC_ARG_WITH(libnl,
635   AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
636                  [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
637 [
638         if test "x$withval" = "xno"
639         then
640                 want_libnl=no
641         elif test "x$withval" = "xyes"
642         then
643                 want_libnl=yes
644                 libnl_version=any
645         elif test "x$withval" = "x1"
646         then
647                 want_libnl=yes
648                 libnl_version=1
649         elif test "x$withval" = "x2"
650         then
651                 want_libnl=yes
652                 libnl_version=2
653         elif test "x$withval" = "x3"
654         then
655                 want_libnl=yes
656                 libnl_version=3
657         else
658                 AC_MSG_ERROR(["$withval" is not a valid argument to --with-libnl])
659         fi
660 ],[
661         #
662         # Use libnl if it's present, otherwise don't.
663         #
664         want_libnl=ifavailable
665         libnl_version=any
666 ])
667 #
668 # Libnl is Linux-specific.
669 #
670 libnl_message="no"
671 case "$host_os" in
672 linux*)
673         AC_MSG_CHECKING(whether to use libnl for various network interface purposes)
674
675         if test x$want_libnl = "xno"; then
676                 AC_MSG_RESULT(no)
677         else
678                 AC_MSG_RESULT(yes)
679                 #
680                 # Test for specific libnl versions only if no version
681                 # was specified by the user or if the version in question
682                 # was requested by the user.
683                 #
684                 if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
685                         PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
686                 fi
687                 if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
688                         PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
689                 fi
690                 if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
691                         PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
692                 fi
693                 if (test "${have_libnl3}" = "yes"); then
694                         WS_CFLAGS="$WS_CFLAGS $LIBNL3_CFLAGS"
695                         LIBS="$LIBS $LIBNL3_LIBS"
696                         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
697                         AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
698                         libnl_message="yes (v3)"
699                 elif (test "${have_libnl2}" = "yes"); then
700                         WS_CFLAGS="$WS_CFLAGS $LIBNL2_CFLAGS"
701                         LIBS="$LIBS $LIBNL2_LIBS"
702                         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
703                         AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
704                         libnl_message="yes (v2)"
705                 elif (test "${have_libnl1}" = "yes"); then
706                         WS_CFLAGS="$WS_CFLAGS $LIBNL1_CFLAGS"
707                         LIBS="$LIBS $LIBNL1_LIBS"
708                         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
709                         AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
710                         libnl_message="yes (v1)"
711                 else
712                         if test x$want_libnl = "xyes"; then
713                                 case "$libnl_version" in
714
715                                 any)
716                                         AC_MSG_ERROR("I couldn't find libnl even though you manually enabled it.")
717                                         ;;
718
719                                 *)
720                                         AC_MSG_ERROR("I couldn't find libnl version $libnl_version even though you manually enabled it.")
721                                         ;;
722                                 esac
723                         fi
724                 fi
725         fi
726
727         AC_MSG_CHECKING([if nl80211.h is new enough])
728           AC_TRY_COMPILE([#include <linux/nl80211.h>],
729             [int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
730              x |= NL80211_ATTR_SUPPORTED_IFTYPES;
731              x |= NL80211_ATTR_SUPPORTED_COMMANDS;
732              x |= NL80211_ATTR_WIPHY_FREQ;
733              x |= NL80211_CHAN_NO_HT;
734              (void)x;],
735             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211, 1, [nl80211.h is new enough])],
736             [AC_MSG_RESULT(no)])
737
738         AC_MSG_CHECKING([for NL80211_SET_CHANNEL])
739           AC_TRY_COMPILE([#include <linux/nl80211.h>],
740             [enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;],
741             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_CMD_SET_CHANNEL, 1, [SET_CHANNEL is supported])],
742             [AC_MSG_RESULT(no)])
743
744         AC_MSG_CHECKING([for NL80211_SPLIT_WIPHY_DUMP])
745           AC_TRY_COMPILE([#include <linux/nl80211.h>],
746             [enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;],
747             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_SPLIT_WIPHY_DUMP, 1, [SPLIT_WIPHY_DUMP is supported])],
748             [AC_MSG_RESULT(no)])
749         ;;
750
751 *)
752         if test x$want_libnl != "xno" -a x$want_libnl != "xifavailable"; then
753                 AC_MSG_WARN([libnl is Linux-specific, ignoring --with-libnl])
754         fi
755 esac
756
757 # libsmi
758 # FIXME: currently the path argument to with-libsmi is being ignored
759 AX_LIBSMI
760
761 #
762 # Check for programs used when building DocBook documentation.
763 #
764
765 # Check for a2x (convert asciidoc to another format)
766 AC_PATH_PROG(A2X, a2x)
767 AC_CHECK_PROG(HAVE_A2X, a2x, "yes", "no")
768 AM_CONDITIONAL(HAVE_A2X, test x$HAVE_A2X = xyes)
769
770 # Check for fop (translate .fo to e.g. pdf)
771 AC_PATH_PROG(FOP, fop)
772 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
773 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
774
775 # TODO: HAVE_LYNX and HAVE_W3M are unused. Maybe require one of them
776 # to be found when a2x is enabled? Otherwise it will fail later...
777 # Check for lynx (asciidoc text format from html)
778 AC_PATH_PROG(LYNX, lynx)
779 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
780 AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
781
782 # Check for w3m (asciidoc text format from html)
783 AC_PATH_PROG(W3M, w3m)
784 AC_CHECK_PROG(HAVE_W3M, w3m, "yes", "no")
785 AM_CONDITIONAL(HAVE_W3M, test x$HAVE_W3M = xyes)
786
787 # Check for xmllint
788 AC_PATH_PROG(XMLLINT, xmllint)
789 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
790 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
791
792 # Check for xsltproc
793 AC_PATH_PROG(XSLTPROC, xsltproc)
794 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
795 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
796
797
798 # Check for packaging utilities
799 # For now, we check to see if the various packaging utilites are in our
800 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
801
802 #
803 # Source packages.
804 # (Lets you install the desktop files.)
805 #
806 AC_PATH_PROG(DESKTOP_FILE_INSTALL, desktop-file-install)
807
808 # SVR4/Solaris
809 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
810 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
811 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
812
813 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
814      -a x$HAVE_PKGTRANS = xyes ; then
815   HAVE_SVR4_PACKAGING=yes
816 else
817   HAVE_SVR4_PACKAGING=no
818 fi
819 AC_SUBST(HAVE_SVR4_PACKAGING)
820
821 # RPM
822 AC_WIRESHARK_RPM_CHECK
823 AC_SUBST(HAVE_RPM)
824
825 # Debian
826 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
827
828 # OS X
829 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
830 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
831 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
832
833 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
834      -a x$HAVE_BLESS = xyes ; then
835   HAVE_OSX_PACKAGING=yes
836 else
837   HAVE_OSX_PACKAGING=no
838 fi
839 AC_SUBST(HAVE_OSX_PACKAGING)
840
841 #
842 # Use this as a proxy for "is this OS X" (just in case somebody actually
843 # built and installed Darwin as an OS, perhaps with some X11-based GUI,
844 # don't look for Darwin).
845 #
846 AC_CHECK_PROG(have_sw_vers, sw_vers, "yes", "no")
847 AM_CONDITIONAL(NOT_OS_X, test "x$have_sw_vers" = "xno")
848
849 #
850 # Some compilers have to be told to fail when passed an unknown -W flag;
851 # make sure we do that.
852 #
853 AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR
854
855 #
856 # Some C++ compilers have to be told to fail when passed a -W flag that
857 # they don't think should apply to C++; make sure we do that.
858 #
859 AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR
860
861 #
862 # Try to add some additional checks to CFLAGS.
863 # These are not enabled by default, because the warnings they produce
864 # are very hard or impossible to eliminate.
865 #
866 AC_ARG_ENABLE(extra-compiler-warnings,
867   AC_HELP_STRING( [--enable-extra-compiler-warnings],
868                   [do additional compiler warnings @<:@default=no@:>@]),
869 [
870         wireshark_extra_flags=$enableval
871         if test $enableval != no
872         then
873                 #
874                 # The following are for C and C++
875                 #
876                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
877                 #
878                 # As we use variadic macros, we don't want warnings
879                 # about them, even with -Wpedantic.
880                 #
881                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
882                 #
883                 # Various code blocks this one.
884                 #
885                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow)
886                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
887                 #
888                 # Due to various places where APIs we don't control
889                 # require us to cast away constness, we can probably
890                 # never enable this one with -Werror.
891                 #
892                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
893                 #
894                 # Some generated ASN.1 dissectors block this one;
895                 # multiple function declarations for the same
896                 # function are being generated.
897                 #
898                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
899                 #
900                 # Some loops are safe, but it's hard to convince the
901                 # compiler of that.
902                 #
903                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
904                 #
905                 # All the registration functions block these for now.
906                 #
907                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
908                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
909                 #
910                 # A bunch of "that might not work on SPARC" code blocks
911                 # this one for now.
912                 #
913                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
914                 #
915                 # Works only with Clang
916                 #
917                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
918                 #
919                 # Works only with Clang but generates a lot of warnings
920                 # (about glib library not using Doxygen)
921                 #
922                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
923
924                 #
925                 # The following are C only, not C++
926                 #
927                 # Due to various places where APIs we don't control
928                 # require us to cast away constness, we can probably
929                 # never enable this one with -Werror.
930                 #
931                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
932         fi
933 ],)
934
935 # Try to add ASAN address analyze.
936 # Only needed for analyse
937 #
938 AC_ARG_ENABLE(asan,
939   AC_HELP_STRING( [--enable-asan],
940                   [Enable AddressSanitizer (ASAN) for debugging (May be slow down)@<:@default=no@:>@]),
941 [
942         #
943         # With Clang >= 3.5 Leak detection is enable by default
944         # and no yet all leak is fixed...
945         # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks
946         #
947         # XXX shouldn't this also be added to LDFLAGS?
948         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
949
950 ],)
951
952
953
954 #
955 # The following are for C and C++
956 #
957 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
958 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra) # -W is now known as -Wextra
959 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
960 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
961 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Warray-bounds)
962 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
963 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
964 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
965 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-delete-null-pointer-checks)
966 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wvla)
967 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Waddress)
968 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wattributes)
969 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdiv-by-zero)
970 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wignored-qualifiers)
971 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
972 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
973 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
974 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
975 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable)
976 #
977 # The following are C only, not C++
978 #
979 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
980 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdeclaration-after-statement, C)
981
982 #
983 # XXX - OK for C++?
984 #
985 # Make sure -Wshadow doesn't complain about variables in function and
986 # function pointer declarations shadowing other variables; if not, don't
987 # turn it on, as some versions of GCC (including the one in at least
988 # some Xcode versions that came with Mac OS X 10.5) complain about
989 # that.
990 #
991 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshadow, C,
992   [
993 extern int bar(int a);
994 extern int foo(int);
995
996 int
997 foo(int a)
998 {
999         int (*fptr)(int a) = bar;
1000
1001         return fptr(a) * 2;
1002 }
1003   ],
1004   [warns about variables in function declarations shadowing other variables])
1005
1006 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-pointer-sign, C)
1007 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wold-style-definition, C)
1008 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wstrict-prototypes, C)
1009
1010 # Unfortunately some versions of gcc generate logical-op warnings when strchr()
1011 # is given a constant string.
1012 # gcc versions 4.3.2 and 4.4.5 are known to have the problem.
1013 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wlogical-op, C,
1014   [
1015 #include <string.h>
1016
1017 int foo(const char *, int);
1018 int bar(void);
1019
1020 int
1021 foo(const char *sep, int c)
1022 {
1023         if (strchr (sep, c) != NULL)
1024                 return 1;
1025         else
1026                 return 0;
1027 }
1028
1029 int
1030 bar(void)
1031 {
1032         return foo("<", 'a');
1033 }
1034   ],
1035   [generates warnings from strchr()])
1036
1037 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
1038 # The Qt headers generate a ton of shortening errors on 64-bit systems
1039 # so only enable this for C for now.
1040 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
1041
1042 # Clang only. Avoid "argument unused during compilation" warnings
1043 # (for example, when getting the -gsplit-dwarf option or
1044 # when combining -fwrapv with -fno-strict-overflow)
1045 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments)
1046
1047 #
1048 # Use the faster pre gcc 4.5 floating point precision if available.
1049 #
1050 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
1051
1052 #
1053 # Try to have the compiler default to hiding symbols, so that only
1054 # symbols explicitly exported with WS_DLL_PUBLIC will be visible
1055 # outside (shared) libraries; that way, more UN*X builds will catch
1056 # failures to export symbols, rather than having that fail only on
1057 # Windows.
1058 #
1059 # GCC and GCC-compatible compilers
1060 #
1061 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
1062 if test "x$can_add_to_cflags" = "xno"
1063 then
1064         #
1065         # Sun^WOracle C.
1066         #
1067         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
1068         if test "x$can_add_to_cflags" = "xno"
1069         then
1070                 # TODO add other ways of hiding symbols
1071                 AC_MSG_WARN(Compiler will export all symbols from shared libraries)
1072         fi
1073 fi
1074
1075 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
1076 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
1077 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref])
1078 # AC_WIRESHARK_LDFLAGS_CHECK([-flto])
1079 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhopr])
1080 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhole-program])
1081
1082 #
1083 # Put -fPIE in PIE_CFLAGS and -pie in PIE_LDFLAGS if we can use them,
1084 # so that we can build dumpcap PIE - it may run with elevated
1085 # privileges, and using PIE means the OS can run it at random locations
1086 # in the address space to make attacks more difficult.
1087 #
1088
1089 WS_CFLAGS_saved="$WS_CFLAGS"
1090 WS_LDFLAGS_saved="$WS_LDFLAGS"
1091 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
1092 if test "x$can_add_to_cflags" = "xyes"
1093 then
1094         AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
1095         if test "x$can_add_to_ldflags" = "xyes"
1096         then
1097                 # We can use PIE
1098                 PIE_CFLAGS="-fPIE"
1099                 PIE_LDFLAGS="-pie"
1100         fi
1101 fi
1102 WS_CFLAGS="$WS_CFLAGS_saved"
1103 WS_LDFLAGS="$WS_LDFLAGS_saved"
1104 AC_SUBST(PIE_CFLAGS)
1105 AC_SUBST(PIE_LDFLAGS)
1106
1107 WS_CFLAGS_saved="$WS_CFLAGS"
1108 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
1109 if test "x$can_add_to_cflags" = "xyes"
1110 then
1111         #
1112         # The compiler supports -msse4.2; use that to enable SSE 4.2.
1113         #
1114         # We only want to apply -msse4.2 to
1115         # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
1116         # is run only if the hardware supports it, but other
1117         # code would do no such checks.
1118         #
1119         ac_sse4_2_flag=-msse4.2
1120 else
1121         #
1122         # Try -xarch=sse4_2; that's the flag for Sun's compiler.
1123         #
1124         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xarch=sse4_2, C)
1125         if test "x$can_add_to_cflags" = "xyes"
1126         then
1127                 #
1128                 # The compiler supports -xarch=sse4_2; use that to
1129                 # enable SSE 4.2.
1130                 ac_sse4_2_flag=-xarch=sse4_2
1131         fi
1132 fi
1133 WS_CFLAGS="$WS_CFLAGS_saved"
1134
1135 if test "x$ac_sse4_2_flag" != x; then
1136         #
1137         # OK, we have a compiler flag to enable SSE 4.2.
1138         #
1139         # Make sure we have the necessary headers for the SSE4.2 intrinsics
1140         # and that we can use them.
1141         #
1142         # First, check whether we have emmintrin.h and can use it
1143         # *without* the SSE 4.2 flag.
1144         #
1145         AC_MSG_CHECKING([whether there is emmintrin.h header and we can use it])
1146         AC_TRY_COMPILE(
1147                 [#include <emmintrin.h>],
1148                 [return 0;],
1149                 [
1150                         emmintrin_h_works=yes
1151                         AC_MSG_RESULT([yes])
1152                 ],
1153                 [
1154                         emmintrin_h_works=no
1155                         AC_MSG_RESULT([no])
1156                 ]
1157         )
1158
1159         #
1160         # OK, if that works, see whether we have nmmintrin.h and
1161         # can use it *with* the SSE 4.2 flag.
1162         #
1163         if test "x$emmintrin_h_works" = "xyes"; then
1164                 #
1165                 # Add the SSE4.2 flags to the beginning of CFLAGS,
1166                 # in case the user explicitly specified -mno-sse4.2
1167                 # (or in case Gentoo's build tools did so); if they
1168                 # did so, we only want this to work if we can use
1169                 # the #pragma to override that for ws_mempbrk_sse42.c,
1170                 # and putting it at the beginning means that the
1171                 # CFLAGS setting in the environment will come later
1172                 # and override it.
1173                 #
1174                 AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
1175                 saved_CFLAGS="$CFLAGS"
1176                 CFLAGS="$ac_sse4_2_flag $WS_CFLAGS $CFLAGS"
1177                 AC_TRY_COMPILE(
1178                         [#include <nmmintrin.h>],
1179                         [return 0;],
1180                         [
1181                                 have_sse42=yes
1182                                 AC_DEFINE(HAVE_SSE4_2, 1, [Support SSSE4.2 (Streaming SIMD Extensions 4.2) instructions])
1183                                 CFLAGS_SSE42="$ac_sse4_2_flag"
1184                                 AC_MSG_RESULT([yes])
1185                         ],
1186                         [
1187                                 have_sse42=no
1188                                 AC_MSG_RESULT([no])
1189                         ]
1190                 )
1191                 CFLAGS="$saved_CFLAGS"
1192         else
1193                 have_sse42=no
1194         fi
1195 else
1196         have_sse42=no
1197 fi
1198 dnl build libwsutil_sse42 only if there is SSE4.2
1199 AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
1200 AC_SUBST(CFLAGS_SSE42)
1201
1202 #
1203 # If we're running GCC or clang define _U_ to be "__attribute__((unused))"
1204 # so we can use _U_ to flag unused function parameters and not get warnings
1205 # about them. Otherwise, define _U_ to be an empty string so that _U_ used
1206 # to flag an unused function parameters will compile with other compilers.
1207 #
1208 # XXX - similar hints for other compilers?
1209 #
1210 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
1211   AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
1212 else
1213   AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
1214 fi
1215
1216 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
1217 #  (only if the GCC 'optimization level' > 0).
1218 #
1219 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
1220 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
1221 #
1222 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
1223 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
1224
1225 #
1226 # If the compiler supports GCC-style flags, enable a barrier "stop on
1227 # warning".
1228 # This barrier is set for a very large part of the code. However, it is
1229 # typically not set for "generated" code  (flex, ans2wrs, idl2wrs, ...)
1230 #
1231 warnings_as_errors_default="yes"
1232 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
1233 AC_ARG_ENABLE(warnings-as-errors,
1234   AC_HELP_STRING( [--enable-warnings-as-errors],
1235                   [treat warnings as errors (only for GCC or clang) @<:@default=yes, unless extra compiler warnings are enabled@:>@]),
1236 [
1237   if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes"; then
1238     with_warnings_as_errors="yes"
1239     AC_MSG_RESULT(yes)
1240   else
1241     with_warnings_as_errors="no"
1242     AC_MSG_RESULT(no)
1243   fi
1244 ],
1245 [
1246   if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
1247     with_warnings_as_errors="yes"
1248     AC_MSG_RESULT(yes)
1249   else
1250     with_warnings_as_errors="no"
1251     AC_MSG_RESULT(no)
1252   fi
1253 ]
1254 )
1255 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
1256
1257 #
1258 # Add any platform-specific compiler flags needed.
1259 #
1260 AC_MSG_CHECKING(for platform-specific compiler flags)
1261 if test "x$GCC" = "xyes" ; then
1262         #
1263         # GCC - do any platform-specific tweaking necessary.
1264         #
1265         case "$host_os" in
1266         solaris*)
1267                 # the X11 headers don't automatically include prototype info
1268                 # and a lot don't include the return type
1269                 WS_CPPFLAGS="$WS_CPPFLAGS -DFUNCPROTO=15"
1270                 WS_CFLAGS="$WS_CFLAGS -Wno-return-type"
1271                 WS_CXXFLAGS="$WS_CXXFLAGS -Wno-return-type"
1272                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
1273                 ;;
1274         *)
1275                 AC_MSG_RESULT(none needed)
1276                 ;;
1277         esac
1278 else
1279         #
1280         # Not GCC - assume it's the vendor's compiler.
1281         #
1282         case "$host_os" in
1283         hpux*)
1284                 #
1285                 # AC_PROG_CC_STDC should already have added whatever
1286                 # flags are necessary for ISO C - C99 if available,
1287                 # otherwise C89 - with extensions.
1288                 #
1289                 # Add +O2, for optimization, as suggested by Jost Martin.
1290                 # XXX - works with "-g"?
1291                 #
1292                 # +O2 is supported both by the C and C++ compiler.
1293                 #
1294                 WS_CFLAGS="+O2 $WS_CFLAGS"
1295                 if test "$CC" = "$CC_FOR_BUILD"; then
1296                         #
1297                         # We're building the build tools with the same
1298                         # compiler as the one with which we're building
1299                         # Wireshark, so add the flags to the flags for
1300                         # that compiler as well.
1301                         #
1302                         CFLAGS_FOR_BUILD="-Ae +O2 $CFLAGS"
1303                 fi
1304                 WS_CXXFLAGS="+O2 $WS_CXXFLAGS"
1305                 AC_MSG_RESULT(HP C/C++ compiler - added +O2)
1306                 ;;
1307         solaris*)
1308                 #
1309                 # Crank up the warning level.
1310                 #
1311                 WS_CFLAGS="$WS_CFLAGS -v"
1312                 WS_CXXFLAGS="$WS_CXXFLAGS +w2"
1313                 ;;
1314         *)
1315                 AC_MSG_RESULT(none needed)
1316                 ;;
1317         esac
1318 fi
1319
1320 #
1321 # Add any platform-specific linker flags needed.
1322 #
1323 AC_MSG_CHECKING(for platform-specific linker flags)
1324 case "$host_os" in
1325 darwin*)
1326         #
1327         # Add -Wl,-single_module to the LDFLAGS used with shared
1328         # libraries, to fix some error that show up in some cases;
1329         # some Apple documentation recommends it for most shared
1330         # libraries.
1331         #
1332         LDFLAGS_SHAREDLIB="-Wl,-single_module"
1333         #
1334         # Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
1335         # code-signing issues is running out of padding space.
1336         #
1337         # Add -Wl,-search_paths_first to make sure that if we search
1338         # directories A and B, in that order, for a given library, a
1339         # non-shared version in directory A, rather than a shared
1340         # version in directory B, is chosen (so we can use
1341         # --with-pcap=/usr/local to force all programs to be linked
1342         # with a static version installed in /usr/local/lib rather than
1343         # the system version in /usr/lib).
1344         #
1345         WS_LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $WS_LDFLAGS"
1346         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])
1347         ;;
1348 cygwin*)
1349         #
1350         # Shared libraries in cygwin/Win32 must never contain
1351         # undefined symbols.
1352         #
1353         WS_LDFLAGS="$WS_LDFLAGS -no-undefined"
1354         AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
1355         ;;
1356 *)
1357         AC_MSG_RESULT(none needed)
1358         ;;
1359 esac
1360 AC_SUBST(LDFLAGS_SHAREDLIB)
1361
1362 # Enable silent builds by default
1363 # Verbose builds can be enabled with "./configure
1364 # --enable-silent-rules ..." or "make V=1 ..."
1365 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
1366   [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
1367
1368 #
1369 # On "Darwin", which we assume to mean "OS X" rather than "iOS" or
1370 # "just Darwin" (as we don't currently support iOS, and as I don't
1371 # think you can build and run "just Darwin" as an OS for PCs), we
1372 # arrange to build some programs with Application Services so they
1373 # can launch Web browsers and Finder windows, arrange to build some
1374 # programs with System Configuration so they can get "friendly names"
1375 # and other information about interfaces, and build any programs that
1376 # use either of those frameworks or that report version information
1377 # with Core Foundation as the frameworks in question use it and as we
1378 # get version information from plists and thus need Core Foundation
1379 # to process those plists.
1380 #
1381 have_os_x_frameworks=no
1382 case "$host_os" in
1383 darwin*)
1384         have_os_x_frameworks=yes
1385         AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
1386         APPLICATIONSERVICES_FRAMEWORKS="-framework ApplicationServices"
1387         SYSTEMCONFIGURATION_FRAMEWORKS="-framework SystemConfiguration"
1388         COREFOUNDATION_FRAMEWORKS="-framework CoreFoundation"
1389
1390         #
1391         # OK, so we have the OS X frameworks; do they include
1392         # CFPropertyListCreateWithStream, or do we have
1393         # to fall back on CFPropertyListCreateFromStream?
1394         # (They only differ in the error return, which we
1395         # don't care about.  And, no, we shouldn't just
1396         # use CFPropertyListCreateFromStream, because it's
1397         # deprecated in newer releases.)
1398         #
1399         ac_save_LIBS="$LIBS"
1400         LIBS="$LIBS $COREFOUNDATION_FRAMEWORKS"
1401         AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
1402         LIBS="$ac_save_LIBS"
1403         ;;
1404 esac
1405 AC_SUBST(APPLICATIONSERVICES_FRAMEWORKS)
1406 AC_SUBST(SYSTEMCONFIGURATION_FRAMEWORKS)
1407 AC_SUBST(COREFOUNDATION_FRAMEWORKS)
1408 AM_CONDITIONAL(HAVE_OS_X_FRAMEWORKS, [test "x$have_os_x_frameworks" = "xyes"])
1409
1410 #
1411 # On Solaris, check whether we have getexecname().
1412 #
1413 case "$host_os" in
1414 solaris*)
1415         AC_CHECK_FUNC(getexecname)
1416         ;;
1417 esac
1418
1419 dnl Look in /usr/local for header files and libraries ?
1420 dnl XXX FIXME don't include /usr/local if it is already in the system
1421 dnl search path as this causes gcc 3.2 on Linux to complain about a change
1422 dnl of the system search order for includes
1423 AC_ARG_ENABLE(usr-local,
1424   AC_HELP_STRING( [--enable-usr-local],
1425                   [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
1426     ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
1427
1428 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
1429 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1430         if test -d "/usr/local"; then
1431                 AC_MSG_RESULT(yes)
1432                 #
1433                 # Arrange that we search for header files in the source directory
1434                 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
1435                 # as various packages we use ("libpcap", "zlib", "adns")
1436                 # may have been installed under "/usr/local/include".
1437                 #
1438                 WS_CPPFLAGS="$WS_CPPFLAGS -I/usr/local/include"
1439
1440                 #
1441                 # Arrange that we search for libraries in "/usr/local/lib".
1442                 #
1443                 AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, /usr/local/lib)
1444         else
1445                 AC_MSG_RESULT(no)
1446         fi
1447 else
1448         AC_MSG_RESULT(no)
1449 fi
1450
1451 #
1452 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
1453 # link directory.
1454 #
1455 case "$host_os" in
1456   solaris*)
1457     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
1458     if test x$LD_LIBRARY_PATH != x ; then
1459       LIBS="$LIBS -R$LD_LIBRARY_PATH"
1460       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
1461     else
1462       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
1463     fi
1464   ;;
1465 esac
1466
1467 #
1468 # Check for versions of "sed" inadequate to handle, in libtool, a list
1469 # of object files as large as the list in Wireshark.
1470 #
1471 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
1472 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
1473 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
1474 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
1475 # is the only "sed" that comes with Solaris that can handle Wireshark.
1476 #
1477 # Add any checks here that are necessary for other OSes.
1478 #
1479 AC_PATH_PROG(SED, sed)
1480 if test "x$SED" = x
1481 then
1482         AC_MSG_ERROR(I couldn't find sed; make sure it's installed and in your path)
1483 fi
1484 AC_WIRESHARK_GNU_SED_CHECK
1485 if test "$HAVE_GNU_SED" = no ; then
1486         case "$host_os" in
1487         solaris*)
1488                 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
1489                 case `which sed` in
1490                         /bin/sed|/usr/bin/sed|/usr/ucb/sed)
1491                         AC_MSG_RESULT(yes)
1492                         AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
1493                         ;;
1494
1495                         *)
1496                         AC_MSG_RESULT(no)
1497                         ;;
1498                 esac
1499                 ;;
1500
1501         *)
1502                 :
1503                 ;;
1504         esac
1505 fi
1506
1507 # Enable/disable wireshark
1508 AC_ARG_ENABLE(wireshark,
1509   AC_HELP_STRING( [--enable-wireshark],
1510                   [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
1511     enable_wireshark=$enableval,enable_wireshark=yes)
1512 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
1513
1514 AC_ARG_ENABLE(packet-editor,
1515   AC_HELP_STRING( [--enable-packet-editor],
1516                   [add support for packet editor in Wireshark @<:@default=yes@:>@]),
1517     enable_packet_editor=$enableval,enable_packet_editor=yes)
1518 if test x$enable_packet_editor = xyes; then
1519         AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
1520 fi
1521
1522 AC_ARG_ENABLE(profile-build,
1523   AC_HELP_STRING( [--enable-profile-build],
1524                   [build profile-ready binaries @<:@default=no@:>@]),
1525     enable_profile_build=$enableval,enable_profile_build=no)
1526 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
1527 AC_MSG_CHECKING(if profile builds must be generated)
1528 if test "x$enable_profile_build" = "xyes" ; then
1529         if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
1530                 AC_MSG_RESULT(yes)
1531                 WS_CFLAGS="-pg $WS_CFLAGS"
1532                 WS_CXXFLAGS="-pg $WS_CXXFLAGS"
1533         else
1534                 AC_MSG_RESULT(no)
1535                 echo "Building profile binaries currently only supported for GCC and clang."
1536         fi
1537 else
1538         AC_MSG_RESULT(no)
1539 fi
1540
1541 # Create DATAFILE_DIR #define for config.h
1542 datafiledir=$datadir/wireshark
1543 datafiledir=`(
1544     test "x$prefix" = xNONE && prefix=$ac_default_prefix
1545     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1546     # Ugly hack, but I don't see how this problem can be solved
1547     # properly that DATAFILE_DIR had a value starting with
1548     # "${prefix}/" instead of e.g. "/usr/local/"
1549     eval eval echo "$datafiledir"
1550 )`
1551 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
1552
1553 # Create DOC_DIR #define for config.h
1554 docdir=`(
1555     test "x$prefix" = xNONE && prefix=$ac_default_prefix
1556     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
1557     # Ugly hack, but I don't see how this problem can be solved
1558     # properly that DOC_DIR had a value starting with
1559     # "${prefix}/" instead of e.g. "/usr/local/"
1560     eval eval echo "$docdir"
1561 )`
1562 AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
1563
1564 GTK2_MIN_VERSION=2.12.0
1565 AC_SUBST(GTK2_MIN_VERSION)
1566 GTK3_MIN_VERSION=3.0.0
1567 AC_SUBST(GTK3_MIN_VERSION)
1568 QT_MIN_VERSION=4.7.0
1569 AC_SUBST(QT_MIN_VERSION)
1570 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
1571 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
1572 #
1573 # We only do those if we're going to be building Wireshark;
1574 # otherwise, we don't have any GUI to build, so we don't use
1575 # GTK+ or Qt.
1576 #
1577 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
1578 # force all programs to be built with GTK+ or Qt.
1579 #
1580 # Release dates for GTK+ versions:
1581 # https://en.wikipedia.org/wiki/GTK+#Releases
1582 # 2.12.0: 14 Sep 2007
1583 # 2.14.0: 04 Sep 2008
1584 # 2.16.0: 13 Mar 2009
1585 # 2.18.0: 23 Sep 2009
1586 # 2.20.0: 23 Mar 2010
1587 # 2.22.0: 23 Sep 2010
1588 # 2.24.0: 30 Jan 2011
1589 # 3.0.0:  10 Feb 2011
1590 # 3.2.0:  25 Sep 2011
1591 # 3.4.0:  26 Mar 2012
1592 # 3.6.0:  24 Sep 2012
1593 # 3.8.0:  25 Mar 2013
1594 # 3.10.0: 23 Sep 2013
1595 # 3.12.0: 25 Mar 2014
1596 # 3.14.0: 30 Sep 2014
1597 # 3.16.0: 22 Mar 2015
1598 # 3.18.0  22 Sep 2015
1599 #
1600 # Release dates for Qt versions:
1601 # https://en.wikipedia.org/wiki/List_of_Qt_releases
1602 # 4.6.0:  01 Dec 2009
1603 # 4.7.0:  21 Sep 2010
1604 # 4.8.0:  15 Dec 2011
1605 # 5.0.0:  19 Dec 2012
1606 # 5.1.0:  03 Jul 2013
1607 # 5.2.0:  12 Dec 2013
1608 # 5.3.0:  20 May 2014
1609 # 5.4.0:  10 Dec 2015
1610 # 5.5.0:  01 Jul 2015
1611
1612 have_qt=no
1613 have_gtk=no
1614 if test "x$enable_wireshark" = "xyes"; then
1615         if test "x$with_gtk2" = "xunspecified" -a \
1616                 "x$with_gtk3" = "xunspecified" -a \
1617                 "x$with_qt" = "xunspecified"; then
1618                 #
1619                 # No GUI toolkits were explicitly specified; pick Qt
1620                 # and GTK+ 3.
1621                 #
1622                 with_qt=yes
1623                 with_gtk3=yes
1624         elif test "x$with_gtk2" = "xunspecified" -a \
1625                   "x$with_gtk3" = "xunspecified" -a \
1626                   "x$with_qt" = "xno"; then
1627                 #
1628                 # Qt was explicitly disabled, and neither GTK+ 2 nor
1629                 # GTK+ 3 were explicitly specified; pick GTK+ 3.
1630                 #
1631                 with_gtk3=yes
1632         fi
1633         if test "x$with_qt" != "xno"; then
1634                 #
1635                 # Qt was specified; make sure we have a C++ compiler.
1636                 #
1637                 if test -z "$CXX"; then
1638                         AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
1639                 fi
1640
1641                 #
1642                 # Now make sure we have Qt and, if so, add the flags
1643                 # for it to CFLAGS and CXXFLAGS.
1644                 #
1645                 AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, "$with_qt",
1646                 [
1647                         WS_CFLAGS="$WS_CFLAGS $Qt_CFLAGS"
1648                         WS_CXXFLAGS="$WS_CXXFLAGS $Qt_CFLAGS"
1649                         have_qt=yes
1650                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
1651
1652                         #
1653                         # We're building with Qt, so we need the Qt build
1654                         # tools in order to build the Wireshark GUI.
1655                         # We've found a particular major version of Qt,
1656                         # and we want that version's build tools; for
1657                         # example, the Qt 4 version of uic produces files
1658                         # that include Qt headers with paths that work
1659                         # with Qt 4 but not Qt 5, so we can't use the
1660                         # Qt 4 version of uic if we're building with Qt 5.
1661                         AC_WIRESHARK_QT_TOOL_CHECK(UIC, uic, "$qt_version")
1662                         AC_SUBST(UIC)
1663                         AC_WIRESHARK_QT_TOOL_CHECK(MOC, moc, "$qt_version")
1664                         AC_SUBST(MOC)
1665                         AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
1666                         AC_SUBST(RCC)
1667
1668                         #
1669                         # On Darwin, find where the Qt frameworks are
1670                         # located, and add that to the rpath, just in
1671                         # case this is Qt 5.5 or later and the frameworks
1672                         # have an install name that begins with @rpath
1673                         # and aren't installed in a frameworks directory
1674                         # that's searched by default.
1675                         #
1676                         case "$host_os" in
1677                         darwin*)
1678                                 if test $qt_version -le 4
1679                                 then
1680                                         Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs QtCore | sed -e 's/-F//' -e 's/ -framework.*//'`
1681                                 else
1682                                         Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs Qt${qt_version}Core | sed -e 's/-F//' -e 's/ -framework.*//'`
1683                                 fi
1684                                 ;;
1685                         esac
1686                         AC_SUBST(Qt_LDFLAGS)
1687                         if test -z "$MOC_OPTIONS"
1688                         then
1689                                 if test $qt_version -eq 5
1690                                 then
1691                                         MOC_OPTIONS="--no-notes"
1692                                 elif test $qt_version -eq 4
1693                                 then
1694                                         qt_minor_version=`echo "$QT_VERSION" | cut -f2 -d.`
1695                                         if test $qt_minor_version -ge 8
1696                                         then
1697                                                 MOC_OPTIONS="-nn"
1698                                         fi
1699                                 fi
1700                         fi
1701                         AC_SUBST(MOC_OPTIONS)
1702                 ],
1703                 [
1704                         case "$with_qt" in
1705
1706                         unspecified)
1707                                 #
1708                                 # They didn't explicitly ask for Qt,
1709                                 # so just don't build with it.
1710                                 #
1711                                 ;;
1712
1713                         yes)
1714                                 AC_MSG_ERROR([Qt is not available])
1715                                 ;;
1716
1717                         4)
1718                                 AC_MSG_ERROR([Qt 4 is not available])
1719                                 ;;
1720
1721                         5)
1722                                 AC_MSG_ERROR([Qt 5 is not available])
1723                                 ;;
1724                         esac
1725                 ])
1726         fi
1727
1728         if test "x$with_gtk3" = "xyes"; then
1729                 #
1730                 # GTK+ 3 was specified; make sure they didn't also
1731                 # specify GTK+ 2, as we don't support building both
1732                 # GTK+ 2 and GTK+ 3 versions at the same time.
1733                 #
1734                 if test "x$with_gtk2" = "xyes"; then
1735                         AC_MSG_ERROR([Both GTK+ 2 and GTK+ 3 were specified; choose one but not both])
1736                 fi
1737
1738                 #
1739                 # Make sure we have GTK+ 3.
1740                 #
1741                 AM_PATH_GTK_3_0(3.0.0,
1742                 [
1743                         WS_CFLAGS="$WS_CFLAGS $GTK_CFLAGS"
1744                         WS_CXXFLAGS="$WS_CXXFLAGS $GTK_CFLAGS"
1745                         have_gtk=yes
1746                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk3"
1747                 ],
1748                 [AC_MSG_ERROR([GTK+ 3 is not available])])
1749         elif test "x$with_gtk2" = "xyes"; then
1750                 #
1751                 # GTK+ 3 wasn't specified, and GTK+ 2 was specified;
1752                 # make sure we have GTK+ 2.
1753                 #
1754                 AM_PATH_GTK_2_0($GTK2_MIN_VERSION,
1755                 [
1756                         WS_CFLAGS="$WS_CFLAGS $GTK_CFLAGS"
1757                         WS_CXXFLAGS="$WS_CXXFLAGS $GTK_CFLAGS"
1758                         have_gtk=yes
1759                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk2"
1760                 ],
1761                 [AC_MSG_ERROR([GTK+ 2 is not available])])
1762         fi
1763 fi
1764 AC_SUBST(GUI_CONFIGURE_FLAGS)
1765
1766 GLIB_MIN_VERSION=2.16.0
1767 AC_SUBST(GLIB_MIN_VERSION)
1768 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
1769 # support, as we need that for dynamically loading plugins.
1770 # If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
1771 # AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
1772 # superset of GLIB_CFLAGS.  If we didn't find GTK+, it does add
1773 # GLIB_CFLAGS to CFLAGS.
1774 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
1775 # set when generating the Makefile, so we can make programs that require
1776 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
1777 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
1778 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
1779 # programs to be built with GLib.
1780 #
1781 # Release dates for GLib versions:
1782 # 2.14.0: 03 Aug 2007
1783 # 2.16.0: 10 Mar 2008
1784 # 2.18.0: 02 Sep 2008
1785 # 2.20.0: 13 Mar 2009
1786 # 2.22.0: 22 Sep 2009
1787 # 2.24.0: 28 Mar 2010
1788 # 2.26.0: 27 Sep 2010
1789 # 2.28.0: 08 Feb 2011
1790 # 2.30.0: 27 Sep 2011
1791 # 2.32.0: 24 Mar 2012
1792 # 2.34.0: 24 Sep 2012
1793 # 2.36.0: 25 Mar 2013
1794 # 2.38.0: 23 Sep 2013
1795 # 2.40.0: 24 Mar 2014
1796 # 2.42.0: 22 Sep 2014
1797 # 2.44.0: 23 Mar 2014
1798 # 2.46.0: 25 Sep 2015
1799
1800 use_glib_cflags="true"
1801 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
1802         # We have both GTK and Qt and thus will be building both wireshark
1803         # and wireshark-gtk.
1804
1805         wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
1806         wireshark_man="wireshark.1"
1807         wireshark_SUBDIRS="codecs ui/qt ui/gtk"
1808 fi
1809 if test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
1810         # We don't have GTK+ but we have Qt.
1811
1812         wireshark_bin="wireshark\$(EXEEXT)"
1813         wireshark_man="wireshark.1"
1814         wireshark_SUBDIRS="codecs ui/qt"
1815 fi
1816 if test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
1817         # We have GTK+ but not Qt.
1818
1819         wireshark_bin="wireshark-gtk\$(EXEEXT)"
1820         wireshark_man="wireshark.1"
1821         wireshark_SUBDIRS="codecs ui/gtk"
1822         use_glib_cflags="false"
1823         OSX_APP_FLAGS="$OSX_APP_FLAGS -gtk"
1824         OSX_DMG_FLAGS="-gtk"
1825 fi
1826 if test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
1827         # We have neither GTK+ nor Qt.
1828         #
1829         # If they didn't explicitly say "--disable-wireshark",
1830         # fail (so that, unless they explicitly indicated that
1831         # they don't want Wireshark, we stop so they know they
1832         # won't be getting Wireshark unless they fix the GTK+/Qt
1833         # problem).
1834         #
1835         if test "x$enable_wireshark" = "xyes"; then
1836                 if test "x$with_gtk3" = "xyes"; then
1837                         AC_MSG_ERROR([Neither Qt nor GTK+ $GTK3_MIN_VERSION or later are available, so Wireshark can't be compiled])
1838                 else
1839                         AC_MSG_ERROR([Neither Qt nor GTK+ $GTK2_MIN_VERSION or later are available, so Wireshark can't be compiled])
1840                 fi
1841         fi
1842         wireshark_bin=""
1843         wireshark_man=""
1844 fi
1845
1846 if test "$have_gtk" = "yes" ; then
1847         # If we have GTK then add flags for it.
1848
1849         WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATED $WS_CPPFLAGS"
1850         if test \( $gtk_config_major_version -eq 3 -a $gtk_config_minor_version -ge 10 \) ; then
1851                 ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
1852                 ##  The deprecations in Gtk 3.10 will not be fixed ...
1853                 WS_CPPFLAGS="-DGDK_DISABLE_DEPRECATION_WARNINGS $WS_CPPFLAGS"
1854         else
1855                 WS_CPPFLAGS="-DGTK_DISABLE_DEPRECATED $WS_CPPFLAGS"
1856         fi
1857         WS_CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS"
1858         if test ! \( $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -lt 20 \) ; then
1859                 # Enable GSEAL when building with GTK > 2.20
1860                 # (Versions prior to 2.22 lacked some necessary accessors.)
1861                 WS_CPPFLAGS="-DGSEAL_ENABLE $WS_CPPFLAGS"
1862         fi
1863 fi
1864
1865 # XXX - Is this really necessary?  When we build with both Gtk+ and Qt it works...
1866 if test "$use_glib_cflags" = "true"; then
1867         # Use GLIB_CFLAGS
1868         AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,
1869         [
1870                 WS_CFLAGS="$WS_CFLAGS $GLIB_CFLAGS"
1871                 WS_CXXFLAGS="$WS_CXXFLAGS $GLIB_CFLAGS"
1872         ], AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1873 else
1874         # Don't use GLIB_CFLAGS
1875         AM_PATH_GLIB_2_0($GLIB_MIN_VERSION, , AC_MSG_ERROR(GLib $GLIB_MIN_VERSION or later distribution not found.), gthread gmodule)
1876 fi
1877
1878 # Check for GResource support
1879 PKG_CHECK_EXISTS([gio-2.0 >= 2.32 gdk-pixbuf-2.0 >= 2.26], [have_gresource=yes], [have_gresource=no])
1880 AM_CONDITIONAL(HAVE_GRESOURCE, test "x$have_gresource" = "xyes")
1881 if test "x$have_gresource" = "xyes"; then
1882         AC_DEFINE(HAVE_GRESOURCE, 1, [Defined if GLib GResource is supported])
1883 fi
1884
1885 # Error out if a glib header other than a "top level" header
1886 #  (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
1887 #  is used.
1888 WS_CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $WS_CPPFLAGS"
1889
1890 # Error out on the usage of deprecated glib functions
1891 WS_CPPFLAGS="-DG_DISABLE_DEPRECATED $WS_CPPFLAGS"
1892
1893 #
1894 # Check whether GLib modules are supported, to determine whether we
1895 # can support plugins.
1896 #
1897 AC_MSG_CHECKING(whether GLib supports loadable modules)
1898 ac_save_CFLAGS="$CFLAGS"
1899 ac_save_LIBS="$LIBS"
1900 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1901 LIBS="$LIBS $GLIB_LIBS"
1902 AC_TRY_RUN([
1903 #include <glib.h>
1904 #include <gmodule.h>
1905 #include <stdio.h>
1906 #include <stdlib.h>
1907
1908 int
1909 main ()
1910 {
1911   if (g_module_supported())
1912     return 0;   /* success */
1913   else
1914     return 1;   /* failure */
1915 }
1916 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
1917    [echo $ac_n "cross compiling; assumed OK... $ac_c"
1918     ac_cv_glib_supports_modules=yes])
1919 CFLAGS="$ac_save_CFLAGS"
1920 LIBS="$ac_save_LIBS"
1921 if test "$ac_cv_glib_supports_modules" = yes ; then
1922   AC_MSG_RESULT(yes)
1923   have_plugins=yes
1924   plugins_dir="plugins"
1925 else
1926   AC_MSG_RESULT(no)
1927   have_plugins=no
1928   plugins_dir=""
1929 fi
1930 AC_SUBST(plugins_dir)
1931
1932 #
1933 # If we have <dlfcn.h>, check whether we have dladdr.
1934 #
1935 if test "$ac_cv_header_dlfcn_h" = "yes"
1936 then
1937         #
1938         # Use GLib compiler flags and linker flags; GLib's gmodule
1939         # stuff uses the dl APIs if available, so it might know
1940         # what flags are needed.
1941         #
1942         ac_save_CFLAGS="$CFLAGS"
1943         ac_save_LIBS="$LIBS"
1944         CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1945         LIBS="$LIBS $GLIB_LIBS"
1946         AC_CHECK_FUNCS(dladdr)
1947         if test x$ac_cv_func_dladdr = xno
1948         then
1949                 #
1950                 # OK, try it with -ldl, in case you need that to get
1951                 # dladdr().  For some reason, on Linux, that's not
1952                 # part of the GLib flags; perhaps GLib itself is
1953                 # linked with libdl, so that you can link with
1954                 # Glib and it'll pull libdl in itself.
1955                 #
1956                 LIBS="$LIBS -ldl"
1957                 AC_CHECK_FUNCS(dladdr)
1958         fi
1959         CFLAGS="$ac_save_CFLAGS"
1960         LIBS="$ac_save_LIBS"
1961 fi
1962
1963 #
1964 # Check whether GLib's printf supports thousands grouping. (This might
1965 # be different from the system's printf since GLib can optionally use
1966 # its own printf implementation.)
1967 #
1968 AC_MSG_CHECKING(whether GLib supports POSIX/XSI thousands grouping)
1969 ac_save_CFLAGS="$CFLAGS"
1970 ac_save_LIBS="$LIBS"
1971 CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1972 LIBS="$LIBS $GLIB_LIBS"
1973 AC_TRY_RUN([
1974 #include <glib.h>
1975 #include <locale.h>
1976 #include <stdio.h>
1977 #include <string.h>
1978
1979 int
1980 main ()
1981 {
1982   gchar *str;
1983   setlocale(LC_ALL, "en_US.UTF-8");
1984   str = g_strdup_printf("%'u", 123456);
1985   return (strcmp (str, "123,456") != 0);
1986 }
1987 ], ac_cv_glib_supports_printf_grouping=yes, ac_cv_glib_supports_printf_grouping=no,
1988    [echo $ac_n "cross compiling; playing it safe... $ac_c"
1989     ac_cv_glib_supports_printf_grouping=no])
1990 CFLAGS="$ac_save_CFLAGS"
1991 LIBS="$ac_save_LIBS"
1992 if test "$ac_cv_glib_supports_printf_grouping" = yes ; then
1993   AC_MSG_RESULT(yes)
1994   AC_DEFINE(HAVE_GLIB_PRINTF_GROUPING, 1, [Define if GLib's printf functions support thousands grouping.])
1995 else
1996   AC_MSG_RESULT(no)
1997 fi
1998
1999 if test "x$have_gtk" = "xyes"
2000 then
2001     #
2002     # We have GTK+; do we want the OS X integration functions and,
2003     # if so, do we have them and, if so, which versions do we have,
2004     # the old Carbon-based ones or the new Cocoa-based ones?
2005     #
2006     AC_MSG_CHECKING(whether to use OS X integration functions)
2007
2008     AC_ARG_WITH(osx-integration,
2009       AC_HELP_STRING( [--with-osx-integration],
2010                       [use OS X integration functions @<:@default=yes, if available@:>@]),
2011     [
2012         if test $withval = no
2013         then
2014             want_osx_integration=no
2015         else
2016             want_osx_integration=yes
2017         fi
2018     ],[
2019         want_osx_integration=yes
2020     ])
2021     if test "x$want_osx_integration" = "xno"; then
2022         AC_MSG_RESULT(no)
2023     else
2024         AC_MSG_RESULT(yes)
2025         AC_WIRESHARK_OSX_INTEGRATION_CHECK
2026     fi
2027 fi
2028
2029 AC_SUBST(wireshark_bin)
2030 AC_SUBST(wireshark_man)
2031 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
2032 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
2033 AC_SUBST(OSX_APP_FLAGS)
2034 AC_SUBST(OSX_DMG_FLAGS)
2035
2036 # Enable/disable tshark
2037 AC_ARG_ENABLE(tshark,
2038   AC_HELP_STRING( [--enable-tshark],
2039                   [build tshark @<:@default=yes@:>@]),
2040     tshark=$enableval,enable_tshark=yes)
2041
2042 if test "x$enable_tshark" = "xyes" ; then
2043         tshark_bin="tshark\$(EXEEXT)"
2044         tshark_man="tshark.1"
2045         wiresharkfilter_man="wireshark-filter.4"
2046 else
2047         tshark_bin=""
2048         tshark_man=""
2049 fi
2050 AC_SUBST(tshark_bin)
2051 AC_SUBST(tshark_man)
2052
2053 # Enable/disable editcap
2054
2055 AC_ARG_ENABLE(editcap,
2056   AC_HELP_STRING( [--enable-editcap],
2057                   [build editcap @<:@default=yes@:>@]),
2058     enable_editcap=$enableval,enable_editcap=yes)
2059
2060 if test "x$enable_editcap" = "xyes" ; then
2061         editcap_bin="editcap\$(EXEEXT)"
2062         editcap_man="editcap.1"
2063 else
2064         editcap_bin=""
2065         editcap_man=""
2066 fi
2067 AC_SUBST(editcap_bin)
2068 AC_SUBST(editcap_man)
2069
2070
2071 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
2072 # or not)
2073
2074 # Enable/disable capinfos
2075
2076 AC_ARG_ENABLE(capinfos,
2077   AC_HELP_STRING( [--enable-capinfos],
2078                   [build capinfos @<:@default=yes@:>@]),
2079     enable_capinfos=$enableval,enable_capinfos=yes)
2080
2081 if test "x$enable_capinfos" = "xyes" ; then
2082         capinfos_bin="capinfos\$(EXEEXT)"
2083         capinfos_man="capinfos.1"
2084 else
2085         capinfos_bin=""
2086         capinfos_man=""
2087 fi
2088 AC_SUBST(capinfos_bin)
2089 AC_SUBST(capinfos_man)
2090
2091 # Enable/disable captype
2092
2093 AC_ARG_ENABLE(captype,
2094   AC_HELP_STRING( [--enable-captype],
2095                   [build captype @<:@default=yes@:>@]),
2096     enable_captype=$enableval,enable_captype=yes)
2097
2098 if test "x$enable_captype" = "xyes" ; then
2099         captype_bin="captype\$(EXEEXT)"
2100         captype_man="captype.1"
2101 else
2102         captype_bin=""
2103         captype_man=""
2104 fi
2105 AC_SUBST(captype_bin)
2106 AC_SUBST(captype_man)
2107
2108 # Enable/disable mergecap
2109
2110 AC_ARG_ENABLE(mergecap,
2111   AC_HELP_STRING( [--enable-mergecap],
2112                   [build mergecap @<:@default=yes@:>@]),
2113     enable_mergecap=$enableval,enable_mergecap=yes)
2114
2115 if test "x$enable_mergecap" = "xyes" ; then
2116         mergecap_bin="mergecap\$(EXEEXT)"
2117         mergecap_man="mergecap.1"
2118 else
2119         mergecap_bin=""
2120         mergecap_man=""
2121 fi
2122 AC_SUBST(mergecap_bin)
2123 AC_SUBST(mergecap_man)
2124
2125 # Enable/disable reordercap
2126
2127 AC_ARG_ENABLE(reordercap,
2128   AC_HELP_STRING( [--enable-reordercap],
2129                   [build reordercap @<:@default=yes@:>@]),
2130     enable_reordercap=$enableval,enable_reordercap=yes)
2131
2132 if test "x$enable_reordercap" = "xyes" ; then
2133         reordercap_bin="reordercap\$(EXEEXT)"
2134         reordercap_man="reordercap.1"
2135 else
2136         reordercap_bin=""
2137         reordercap_man=""
2138 fi
2139 AC_SUBST(reordercap_bin)
2140 AC_SUBST(reordercap_man)
2141
2142 # Enable/disable text2pcap
2143
2144 AC_ARG_ENABLE(text2pcap,
2145   AC_HELP_STRING( [--enable-text2pcap],
2146                   [build text2pcap @<:@default=yes@:>@]),
2147     text2pcap=$enableval,enable_text2pcap=yes)
2148
2149 if test "x$enable_text2pcap" = "xyes" ; then
2150         text2pcap_bin="text2pcap\$(EXEEXT)"
2151         text2pcap_man="text2pcap.1"
2152 else
2153         text2pcap_bin=""
2154         text2pcap_man=""
2155 fi
2156 AC_SUBST(text2pcap_bin)
2157 AC_SUBST(text2pcap_man)
2158
2159 # Enable/disable dftest
2160
2161 AC_ARG_ENABLE(dftest,
2162   AC_HELP_STRING( [--enable-dftest],
2163                   [build dftest @<:@default=yes@:>@]),
2164     enable_dftest=$enableval,enable_dftest=yes)
2165
2166 if test "x$enable_dftest" = "xyes" ; then
2167         dftest_bin="dftest\$(EXEEXT)"
2168         dftest_man="dftest.1"
2169 else
2170         dftest_bin=""
2171         dftest_man=""
2172 fi
2173 AC_SUBST(dftest_bin)
2174 AC_SUBST(dftest_man)
2175
2176 # Enable/disable randpkt
2177
2178 AC_ARG_ENABLE(randpkt,
2179   AC_HELP_STRING( [--enable-randpkt],
2180                   [build randpkt @<:@default=yes@:>@]),
2181     enable_randpkt=$enableval,enable_randpkt=yes)
2182
2183 if test "x$enable_randpkt" = "xyes" ; then
2184         randpkt_bin="randpkt\$(EXEEXT)"
2185         randpkt_man="randpkt.1"
2186 else
2187         randpkt_bin=""
2188         randpkt_man=""
2189 fi
2190 AC_SUBST(randpkt_bin)
2191 AC_SUBST(randpkt_man)
2192
2193 AC_SUBST(wiresharkfilter_man)
2194
2195 dnl Checks for "connect()", used as a proxy for "socket()" - and
2196 dnl "-lsocket", if we need it to get "connect()".
2197 AC_WIRESHARK_SOCKET_LIB_CHECK
2198
2199 dnl pcap check
2200 AC_MSG_CHECKING(whether to use libpcap for packet capture)
2201
2202 AC_ARG_WITH(pcap,
2203   AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
2204                   [use libpcap for packet capturing @<:@default=yes@:>@]),
2205 [
2206         if test $withval = no
2207         then
2208                 want_pcap=no
2209         elif test $withval = yes
2210         then
2211                 want_pcap=yes
2212         else
2213                 want_pcap=yes
2214                 pcap_dir=$withval
2215         fi
2216 ],[
2217         want_pcap=yes
2218         pcap_dir=
2219 ])
2220 if test "x$want_pcap" = "xno" ; then
2221         AC_MSG_RESULT(no)
2222 else
2223         AC_MSG_RESULT(yes)
2224         AC_WIRESHARK_PCAP_CHECK
2225 fi
2226
2227 dnl dumpcap check
2228 AC_MSG_CHECKING(whether to build dumpcap)
2229
2230 AC_ARG_ENABLE(dumpcap,
2231   AC_HELP_STRING( [--enable-dumpcap],
2232                   [build dumpcap @<:@default=yes@:>@]),
2233     enable_dumpcap=$enableval,enable_dumpcap=yes)
2234
2235 if test "x$enable_dumpcap" = "xyes" ; then
2236         if test "x$want_pcap" = "xno" ; then
2237                 enable_dumpcap=no
2238                 AC_MSG_RESULT(pcap not available - disabling dumpcap)
2239         else
2240                 AC_MSG_RESULT(yes)
2241         fi
2242 else
2243         AC_MSG_RESULT(no)
2244 fi
2245
2246 if test "x$enable_dumpcap" = "xyes" ; then
2247         dumpcap_bin="dumpcap\$(EXEEXT)"
2248         dumpcap_man="dumpcap.1"
2249 else
2250         dumpcap_bin=""
2251         dumpcap_man=""
2252 fi
2253 AC_SUBST(dumpcap_bin)
2254 AC_SUBST(dumpcap_man)
2255
2256 # Enable/disable rawshark
2257
2258 dnl rawshark check
2259 AC_MSG_CHECKING(whether to build rawshark)
2260
2261 AC_ARG_ENABLE(rawshark,
2262   AC_HELP_STRING( [--enable-rawshark],
2263                   [build rawshark @<:@default=yes@:>@]),
2264     rawshark=$enableval,enable_rawshark=yes)
2265
2266 if test "x$enable_rawshark" = "xyes" ; then
2267         if test "x$want_pcap" = "xno" ; then
2268                 enable_rawshark=no
2269                 AC_MSG_RESULT(pcap not available - disabling rawshark)
2270         else
2271                 AC_MSG_RESULT(yes)
2272         fi
2273 else
2274         AC_MSG_RESULT(no)
2275 fi
2276
2277 if test "x$enable_rawshark" = "xyes" ; then
2278         rawshark_bin="rawshark\$(EXEEXT)"
2279         rawshark_man="rawshark.1"
2280 else
2281         rawshark_bin=""
2282         rawshark_man=""
2283 fi
2284 AC_SUBST(rawshark_bin)
2285 AC_SUBST(rawshark_man)
2286
2287 dnl androiddump check
2288 AC_MSG_CHECKING(whether to build androiddump)
2289
2290 AC_ARG_ENABLE(androiddump,
2291   AC_HELP_STRING( [--enable-androiddump],
2292                   [build androiddump @<:@default=yes@:>@]),
2293     androiddump=$enableval,enable_androiddump=yes)
2294
2295 if test "x$enable_androiddump" = "xyes" ; then
2296         AC_MSG_RESULT(yes)
2297 else
2298         AC_MSG_RESULT(no)
2299 fi
2300
2301 AC_ARG_ENABLE(androiddump_use_libpcap,
2302   AC_HELP_STRING( [--enable-androiddump-use-libpcap],
2303                   [build androiddump using libpcap @<:@default=no@:>@]),
2304     androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
2305
2306 if test "x$enable_androiddump_use_libpcap" = "xyes" ; then
2307         AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
2308 fi
2309
2310 if test "x$enable_androiddump" = "xyes" ; then
2311         androiddump_bin="androiddump\$(EXEEXT)"
2312         androiddump_man=""
2313 else
2314         androiddump_bin=""
2315         androiddump_man=""
2316 fi
2317 AC_SUBST(androiddump_bin)
2318 AC_SUBST(androiddump_man)
2319
2320 dnl sshdump check
2321 AC_MSG_CHECKING(whether to build sshdump)
2322
2323 AC_ARG_ENABLE(sshdump,
2324   AC_HELP_STRING( [--enable-sshdump],
2325                   [build sshdump @<:@default=yes@:>@]),
2326     sshdump=$enableval,enable_sshdump=yes)
2327
2328 if test "x$enable_sshdump" = "xyes" ; then
2329         AC_MSG_RESULT(yes)
2330 else
2331         AC_MSG_RESULT(no)
2332 fi
2333
2334 dnl randpktdump check
2335 AC_MSG_CHECKING(whether to build randpktdump)
2336
2337 AC_ARG_ENABLE(randpktdump,
2338   AC_HELP_STRING( [--enable-randpktdump],
2339                   [build androiddump @<:@default=yes@:>@]),
2340     randpktdump=$enableval,enable_randpktdump=yes)
2341
2342 if test "x$enable_randpktdump" = "xyes" ; then
2343         AC_MSG_RESULT(yes)
2344 else
2345         AC_MSG_RESULT(no)
2346 fi
2347
2348 if test "x$enable_randpktdump" = "xyes" ; then
2349         randpktdump_bin="randpktdump\$(EXEEXT)"
2350         randpktdump_man=""
2351 else
2352         randpktdump_bin=""
2353         randpktdump_man=""
2354 fi
2355 AC_SUBST(randpktdump_bin)
2356 AC_SUBST(randpktdump_man)
2357
2358 # Enable/disable echld
2359 AC_ARG_ENABLE(echld,
2360   AC_HELP_STRING( [--enable-echld],
2361                   [support echld (Experimental) @<:@default=no@:>@]),
2362     have_echld=$enableval,have_echld=no)
2363
2364 AM_CONDITIONAL(HAVE_ECHLD, test "x$have_echld" = "xyes")
2365 if test "x$have_echld" = "xyes"
2366 then
2367   AC_DEFINE(HAVE_ECHLD, 1, [Define if echld is enabled])
2368   echld_test_bin="echld_test\$(EXEEXT)"
2369   echld_dir="echld"
2370 else
2371   have_echld="no"
2372   echld_test_bin=""
2373   echld_dir=""
2374 fi
2375 AC_SUBST(echld_test_bin)
2376 AC_SUBST(echld_dir)
2377
2378 # Enable/disable tfshark
2379 AC_ARG_ENABLE(tfshark,
2380   AC_HELP_STRING( [--enable-tfshark],
2381                   [build tfshark (Experimental) @<:@default=no@:>@]),
2382     tfshark=$enableval,enable_tfshark=no)
2383
2384 if test "x$enable_tfshark" = "xyes" ; then
2385         tfshark_bin="tfshark\$(EXEEXT)"
2386         tfshark_man="tfshark.1"
2387         wiresharkfilter_man="wireshark-filter.4"
2388 else
2389         tfshark_bin=""
2390         tfshark_man=""
2391 fi
2392 AC_SUBST(tfshark_bin)
2393 AC_SUBST(tfshark_man)
2394
2395
2396 dnl Use pcap-ng by default
2397 AC_ARG_ENABLE(pcap-ng-default,
2398   AC_HELP_STRING( [--enable-pcap-ng-default],
2399                   [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
2400     enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
2401 if test x$enable_pcap_ng_default = xyes; then
2402         AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
2403 fi
2404
2405 dnl pcap remote check
2406 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
2407
2408 AC_ARG_WITH(pcap-remote,
2409     AC_HELP_STRING([--with-pcap-remote],
2410                    [use libpcap remote capturing (requires libpcap)]),
2411 [
2412     if test $withval = no
2413     then
2414         want_pcap_remote=no
2415     else
2416         want_pcap_remote=yes
2417     fi
2418 ],[
2419     want_pcap_remote=no
2420 ])
2421 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
2422     AC_MSG_RESULT(no)
2423 else
2424     AC_MSG_RESULT(yes)
2425     AC_WIRESHARK_PCAP_REMOTE_CHECK
2426 fi
2427
2428 dnl zlib check
2429 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
2430
2431 AC_ARG_WITH(zlib,
2432   AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
2433                  [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
2434 [
2435         if test "x$withval" = "xno"
2436         then
2437                 want_zlib=no
2438         elif test "x$withval" = "xyes"
2439         then
2440                 want_zlib=yes
2441         else
2442                 want_zlib=yes
2443                 zlib_dir="$withval"
2444         fi
2445 ],[
2446         #
2447         # Use zlib if it's present, otherwise don't.
2448         #
2449         want_zlib=ifavailable
2450         zlib_dir=
2451 ])
2452 if test "x$want_zlib" = "xno" ; then
2453         AC_MSG_RESULT(no)
2454 else
2455         AC_MSG_RESULT(yes)
2456         AC_WIRESHARK_ZLIB_CHECK
2457         if test "x$want_zlib" = "xno" ; then
2458                 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
2459         else
2460                 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
2461                         AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
2462                 fi
2463         fi
2464 fi
2465
2466 dnl Lua check
2467 AC_ARG_WITH(lua,
2468   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
2469                   [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
2470 [
2471         if test $withval = no
2472         then
2473                 want_lua=no
2474         elif test $withval = yes
2475         then
2476                 want_lua=yes
2477         else
2478                 want_lua=yes
2479                 want_lua_dir=$withval
2480         fi
2481 ],[
2482         # By default use Lua if we can find it
2483         want_lua=ifavailable
2484         lua_dir=
2485 ])
2486 if test "x$want_lua" != "xno" ; then
2487         AC_WIRESHARK_LIBLUA_CHECK
2488
2489         if test "x$want_lua" = "xyes" -a "x$have_lua" = "xno"
2490         then
2491                 AC_MSG_ERROR([Lua support was requested, but is not available])
2492         fi
2493 fi
2494 if test "x$have_lua" = "xyes"
2495 then
2496         AC_DEFINE(HAVE_LUA, 1, [Define to use Lua])
2497 fi
2498 AM_CONDITIONAL(HAVE_LIBLUA, test x$have_lua = xyes)
2499 AC_SUBST(LUA_LIBS)
2500 AC_SUBST(LUA_CFLAGS)
2501
2502
2503 dnl portaudio check
2504 AC_MSG_CHECKING(whether to use libportaudio for the GTK+ RTP player)
2505
2506 AC_ARG_WITH(portaudio,
2507   AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
2508                   [use libportaudio (located in directory DIR, if supplied) for the GTK+ RTP player @<:@default=yes, if available@:>@]),
2509 [
2510         if test $withval = no
2511         then
2512                 want_portaudio=no
2513         elif test $withval = yes
2514         then
2515                 want_portaudio=yes
2516         else
2517                 want_portaudio=yes
2518                 portaudio_dir=$withval
2519         fi
2520 ],[
2521         #
2522         # Use libportaudio by default
2523         #
2524         want_portaudio=ifavailable
2525         portaudio_dir=
2526 ])
2527 if test "x$want_portaudio" = "xno" ; then
2528         AC_MSG_RESULT(no)
2529 else
2530         AC_MSG_RESULT(yes)
2531         AC_WIRESHARK_LIBPORTAUDIO_CHECK
2532         if test "x$want_portaudio" = "xno" ; then
2533                 AC_MSG_RESULT(libportaudio not found - disabling support for the GTK+ RTP player)
2534         fi
2535 fi
2536 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
2537
2538
2539 dnl Check if dumpcap should be installed with filesystem capabilities
2540 AC_PATH_PROG(SETCAP, setcap)
2541 AC_ARG_ENABLE(setcap-install,
2542   AC_HELP_STRING( [--enable-setcap-install],
2543                   [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
2544     enable_setcap_install=$enableval,enable_setcap_install=no)
2545
2546 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
2547 if test "x$enable_setcap_install" = "xno" ; then
2548         AC_MSG_RESULT(no)
2549 else
2550         if test "x$SETCAP" = "x" ; then
2551                 AC_MSG_RESULT(setcap not found)
2552                 AC_MSG_ERROR([Setcap install was requested, but setcap was not found])
2553         elif test "x$enable_dumpcap" = "xno" ; then
2554                 AC_MSG_RESULT(dumpcap disabled)
2555                 AC_MSG_ERROR([Setcap install works only with dumpcap, but dumpcap is disabled])
2556         else
2557                 AC_MSG_RESULT(yes)
2558         fi
2559 fi
2560
2561 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
2562
2563 dnl Check if dumpcap should be installed setuid
2564 AC_ARG_ENABLE(setuid-install,
2565   AC_HELP_STRING( [--enable-setuid-install],
2566                   [install dumpcap as setuid @<:@default=no@:>@]),
2567     enable_setuid_install=$enableval,enable_setuid_install=no)
2568
2569 AC_MSG_CHECKING(whether to install dumpcap setuid)
2570 if test "x$enable_setuid_install" = "xno" ; then
2571         AC_MSG_RESULT(no)
2572 else
2573         if test "x$enable_setcap_install" = "xyes" ; then
2574                 enable_setuid_install=no
2575                 AC_MSG_RESULT(setcap and setuid both selected)
2576                 AC_MSG_ERROR(You must choose one of setcap install and setuid install)
2577         elif test "x$enable_dumpcap" = "xno" ; then
2578                 AC_MSG_RESULT(dumpcap disabled)
2579                 AC_MSG_ERROR([Setuid install works only with dumpcap, but dumpcap is disabled])
2580         else
2581                 AC_MSG_RESULT(yes)
2582         fi
2583 fi
2584
2585 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
2586 AC_CHECK_FUNCS(setresuid setresgid)
2587
2588 dnl ...but our Network Operations group is named "no"!
2589 DUMPCAP_GROUP=''
2590 AC_ARG_WITH(dumpcap-group,
2591   AC_HELP_STRING( [--with-dumpcap-group=GROUP],
2592                   [restrict dumpcap to GROUP]),
2593 [
2594   if test "x$withval" = "xyes"; then
2595       AC_MSG_ERROR([No dumpcap group specified.])
2596   elif test "x$withval" != "xno"; then
2597       if test "x$enable_dumpcap" = "xno" ; then
2598           AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
2599       fi
2600       AC_MSG_RESULT($withval)
2601       DUMPCAP_GROUP="$withval"
2602   fi
2603 ])
2604 AC_SUBST(DUMPCAP_GROUP)
2605 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
2606
2607 dnl libcap (not libpcap) check
2608 LIBCAP_LIBS=''
2609 AC_MSG_CHECKING(whether to use the libcap capabilities library)
2610
2611 AC_ARG_WITH(libcap,
2612   AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
2613                   [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
2614 [
2615 if   test "x$withval" = "xno";  then
2616         want_libcap=no
2617 elif test "x$withval" = "xyes"; then
2618         want_libcap=yes
2619 elif test -d "$withval"; then
2620         want_libcap=yes
2621         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2622 fi
2623 ])
2624 if test "x$with_libcap" = "xno" ; then
2625         AC_MSG_RESULT(no)
2626 else
2627         AC_MSG_RESULT(yes)
2628         AC_WIRESHARK_LIBCAP_CHECK
2629 fi
2630 AC_SUBST(LIBCAP_LIBS)
2631
2632 dnl Checks for header files.
2633 dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
2634 dnl Note, however, that, whilst this script is generally run only on UN*Xes:
2635 dnl
2636 dnl     1) we also support building on and for Windows and not all of those
2637 dnl        headers are present on Windows, so the code has to check a
2638 dnl        #define *anyway* to determine whether to include the header
2639 dnl        file
2640 dnl
2641 dnl and
2642 dnl
2643 dnl     2) this might also be run on Windows with a sufficiently UNIXy
2644 dnl        environment such as Cygwin (although Wireshark should be built
2645 dnl        natively rather than using Cygwin).
2646 dnl
2647 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h unistd.h)
2648 AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
2649 AC_CHECK_HEADERS(netinet/in.h)
2650 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
2651
2652 #
2653 # On Linux, check for some additional headers, which we need as a
2654 # workaround for a bonding driver bug and for libpcap's current lack
2655 # of its own workaround for that bug.
2656 #
2657 case "$host_os" in
2658 linux*)
2659         AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,[#include <sys/socket.h>])
2660         ;;
2661 esac
2662
2663 dnl SSL Check
2664 SSL_LIBS=''
2665 AC_MSG_CHECKING(whether to use SSL library)
2666
2667 AC_ARG_WITH(ssl,
2668   AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
2669                   [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
2670 [
2671 if test "x$withval" = "xno";  then
2672         want_ssl=no
2673 elif test "x$withval" = "xyes"; then
2674         want_ssl=yes
2675 elif test -d "$withval"; then
2676         want_ssl=yes
2677         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2678 fi
2679 ],[
2680         want_ssl=no
2681 ])
2682 if test "x$want_ssl" = "xyes"; then
2683         AC_MSG_RESULT(yes)
2684         AC_CHECK_LIB(crypto,EVP_md5,
2685             [
2686                 SSL_LIBS=-lcrypto
2687             ],
2688             [
2689                 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
2690             ])
2691 else
2692         AC_MSG_RESULT(no)
2693 fi
2694 AC_SUBST(SSL_LIBS)
2695
2696 dnl kerberos check
2697 AC_MSG_CHECKING(whether to use Kerberos library)
2698
2699 AC_ARG_WITH(krb5,
2700   AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
2701                   [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
2702 [
2703         if test $withval = no
2704         then
2705                 want_krb5=no
2706         elif test $withval = yes
2707         then
2708                 want_krb5=yes
2709         else
2710                 want_krb5=yes
2711                 krb5_dir=$withval
2712         fi
2713 ],[
2714         #
2715         # Use Kerberos library if available, otherwise don't.
2716         #
2717         want_krb5=ifavailable
2718         krb5_dir=
2719 ])
2720 if test "x$want_krb5" = "xno" ; then
2721         AC_MSG_RESULT(no)
2722 else
2723         AC_MSG_RESULT(yes)
2724         AC_WIRESHARK_KRB5_CHECK
2725 fi
2726
2727
2728 dnl c-ares Check
2729 C_ARES_LIBS=''
2730 AC_MSG_CHECKING(whether to use the c-ares library if available)
2731
2732 AC_ARG_WITH(c-ares,
2733   AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
2734                   [use c-ares (located in directory DIR, if supplied) - supersedes --with-adns @<:@default=yes, if present@:>@]),
2735 [
2736 if   test "x$withval" = "xno";  then
2737         want_c_ares=no
2738 elif test "x$withval" = "xyes"; then
2739         want_c_ares=yes
2740 elif test -d "$withval"; then
2741         want_c_ares=yes
2742         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2743 fi
2744 ])
2745 if test "x$want_c_ares" = "xno" ; then
2746         AC_MSG_RESULT(no)
2747 else
2748         AC_MSG_RESULT(yes)
2749         AC_WIRESHARK_C_ARES_CHECK
2750 fi
2751 AC_SUBST(C_ARES_LIBS)
2752
2753 dnl ADNS Check
2754 ADNS_LIBS=''
2755 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
2756
2757 AC_ARG_WITH(adns,
2758   AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
2759                   [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2760 [
2761 if   test "x$withval" = "xno";  then
2762         want_adns=no
2763 elif test "x$withval" = "xyes"; then
2764         want_adns=yes
2765 elif test -d "$withval"; then
2766         want_adns=yes
2767         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2768 fi
2769 ])
2770 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
2771         AC_MSG_RESULT(no)
2772 else
2773         AC_MSG_RESULT(yes)
2774         AC_WIRESHARK_ADNS_CHECK
2775 fi
2776 AC_SUBST(ADNS_LIBS)
2777
2778 if test "x$have_good_c_ares" != "xyes" -a "x$have_good_adns" != "xyes"; then
2779         # We don't have an asynchronous name resolver, look for a synchronous one
2780
2781         dnl Checks for "getaddrinfo()" - and "-lnsl", if we need it to get
2782         dnl "getaddrinfo()".
2783         AC_WIRESHARK_GETADDRINFO_LIB_CHECK
2784
2785         if test "x$ac_cv_func_getaddrinfo" != "xyes" ; then
2786                 # We don't have the modern name resolver, try older stuff
2787
2788                 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
2789                 dnl "gethostbyname()".
2790                 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
2791
2792                 if test "x$ac_cv_func_gethostbyname" != "xyes" ; then
2793                         # Hopefully this never actually happens.
2794                         # The code works even without name resolvers but we
2795                         # alert the user to this unusual condition.
2796                         AC_MSG_ERROR(Couldn't find any name resolvers!)
2797                 fi
2798
2799                 AC_CHECK_FUNCS(gethostbyname2)
2800         fi
2801 fi
2802
2803 dnl GEOIP Check
2804 GEOIP_LIBS=''
2805 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
2806
2807 AC_ARG_WITH(geoip,
2808   AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
2809                   [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2810 [
2811 if   test "x$withval" = "xno";  then
2812         want_geoip=no
2813 elif test "x$withval" = "xyes"; then
2814         want_geoip=yes
2815 elif test -d "$withval"; then
2816         want_geoip=yes
2817         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2818 fi
2819 ])
2820 if test "x$want_geoip" = "xno"; then
2821         AC_MSG_RESULT(no)
2822 else
2823         AC_MSG_RESULT(yes)
2824         AC_WIRESHARK_GEOIP_CHECK
2825 fi
2826 AC_SUBST(GEOIP_LIBS)
2827
2828 dnl LIBSSH Check
2829 LIBSSH=''
2830 AC_MSG_CHECKING(whether to use the libssh library if available)
2831
2832 AC_ARG_WITH(ssh,
2833   AC_HELP_STRING( [--with-libssh@<:@=DIR@:>@],
2834                   [use libssh (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2835 [
2836 if   test "x$withval" = "xno";  then
2837         want_libssh=no
2838 elif test "x$withval" = "xyes"; then
2839         want_libssh=yes
2840 elif test -d "$withval"; then
2841         want_libssh=yes
2842         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2843 fi
2844 ])
2845 if test "x$want_libssh" = "xno"; then
2846         AC_MSG_RESULT(no)
2847 else
2848         AC_MSG_RESULT(yes)
2849         AC_WIRESHARK_LIBSSH_CHECK
2850 fi
2851 AC_SUBST(LIBSSH_LIBS)
2852
2853 #
2854 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
2855 # never return (just like Charlie on the MTA).
2856 #
2857 # Note that MSVC++ expects __declspec(noreturn) to precede the function
2858 # name and GCC, as far as I know, expects __attribute__((noreturn)) to
2859 # follow the function name, so we need two different flavors of
2860 # noreturn tag.
2861 #
2862 AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
2863
2864 dnl Checks for typedefs, structures, and compiler characteristics.
2865 # AC_C_CONST
2866
2867 # Check how we can get the time zone abbreviation
2868 AC_WIRESHARK_TIMEZONE_ABBREV
2869
2870 # We need to know whether "struct stat" has an "st_flags" member
2871 # for file_user_immutable().
2872
2873 AC_WIRESHARK_STRUCT_ST_FLAGS
2874
2875 # We need to know whether "struct sockaddr" has an "sa_len" member
2876 # for get_interface_list().
2877
2878 AC_WIRESHARK_STRUCT_SA_LEN
2879
2880 # We must know our byte order
2881 AC_C_BIGENDIAN
2882
2883 # Checks whether "-traditional" is needed when using "ioctl".
2884 # XXX - do we need this?
2885 AC_PROG_GCC_TRADITIONAL
2886
2887 AC_CHECK_FUNC(getopt_long,
2888   [
2889     GETOPT_LO=""
2890     AC_DEFINE(HAVE_GETOPT_LONG, 1, [Define to 1 if you have the getopt_long function.])
2891
2892     #
2893     # Do we have optreset?
2894     #
2895     AC_MSG_CHECKING(whether optreset is defined)
2896     AC_TRY_LINK([],
2897       [
2898         extern int optreset;
2899
2900         return optreset;
2901       ],
2902       ac_cv_pcap_debug_defined=yes,
2903       ac_cv_pcap_debug_defined=no)
2904     if test "$ac_cv_pcap_debug_defined" = yes ; then
2905       AC_MSG_RESULT(yes)
2906       AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
2907     else
2908       AC_MSG_RESULT(no)
2909     fi
2910   ],
2911   GETOPT_LO="wsgetopt.lo")
2912 AC_SUBST(GETOPT_LO)
2913
2914 AC_CHECK_FUNCS(mkstemp mkdtemp)
2915
2916 AC_SEARCH_LIBS(inet_aton, [socket nsl],
2917   [
2918     INET_ATON_LO=""
2919     AC_DEFINE(HAVE_INET_ATON, 0, [Define to 1 if you have the inet_aton function.])
2920   ],
2921   INET_ATON_LO="inet_aton.lo")
2922 AC_SUBST(INET_ATON_LO)
2923
2924 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
2925   dnl check for pre-BIND82 inet_pton() bug.
2926   AC_MSG_CHECKING(for broken inet_pton)
2927   AC_TRY_RUN([#include <sys/types.h>
2928 #include <sys/socket.h>
2929 #include <netinet/in.h>
2930 #include <arpa/inet.h>
2931 int main()
2932 {
2933 #ifdef AF_INET6
2934   char buf[16];
2935   /* this should return 0 (error) */
2936   return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
2937 #else
2938   return 1;
2939 #endif
2940 }], [AC_MSG_RESULT(ok);
2941 have_inet_pton=yes], [AC_MSG_RESULT(broken);
2942 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
2943 have_inet_pton=no])],
2944 have_inet_pton=no)
2945 if test "$have_inet_pton" = no; then
2946   INET_PTON_LO="inet_pton.lo"
2947 else
2948   INET_PTON_LO=""
2949 fi
2950 AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
2951 AC_SUBST(INET_PTON_LO)
2952
2953 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
2954   AC_MSG_CHECKING([for inet_ntop prototype])
2955   AC_TRY_COMPILE([#include <stdio.h>
2956 #include <sys/types.h>
2957 #include <sys/socket.h>
2958 #include <netinet/in.h>
2959 #include <arpa/inet.h>
2960
2961 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
2962     AC_MSG_RESULT(yes)
2963     AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2964     [Define if inet_ntop() prototype exists])], [
2965     AC_TRY_COMPILE([#include <stdio.h>
2966 #include <sys/types.h>
2967 #include <sys/socket.h>
2968 #include <netinet/in.h>
2969 #include <arpa/inet.h>
2970
2971 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
2972       AC_MSG_RESULT(yes)
2973       AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
2974       [Define if inet_ntop() prototype exists])], [
2975       AC_MSG_RESULT(no)])])
2976   INET_NTOP_LO=""], [
2977   INET_NTOP_LO="inet_ntop.lo"
2978   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
2979   [Define if inet/v6defs.h needs to be included])])
2980 AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
2981 AC_SUBST(INET_NTOP_LO)
2982
2983 AC_CHECK_FUNC(strptime,
2984   [
2985     STRPTIME_LO=""
2986     AC_DEFINE(HAVE_STRPTIME, 1, [Define if you have the strptime function.])
2987   ],
2988   STRPTIME_LO="strptime.lo")
2989 AC_SUBST(STRPTIME_LO)
2990
2991 AC_CHECK_FUNC(popcount,
2992   [
2993     POPCOUNT_LO=""
2994     AC_DEFINE(HAVE_POPCOUNT, 1, [Define if you have the popcount function.])
2995   ],
2996   POPCOUNT_LO="popcount.lo")
2997 AC_SUBST(POPCOUNT_LO)
2998
2999 AC_CHECK_FUNCS(getprotobynumber)
3000 AC_CHECK_FUNCS(issetugid)
3001 AC_CHECK_FUNCS(sysconf)
3002
3003 dnl blank for now, but will be used in future
3004 AC_SUBST(wireshark_SUBDIRS)
3005
3006 # Check Bluetooth SBC codec for RTP Player
3007 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
3008 AC_ARG_WITH([sbc],
3009   AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
3010                   [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
3011   with_sbc="$withval"; want_sbc="yes", with_sbc="yes")
3012
3013 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
3014 if test "x$with_sbc" != "xno"; then
3015     if (test "${have_sbc}" = "yes"); then
3016         AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
3017     elif test "x$want_sbc" = "xyes"; then
3018         # Error out if the user explicitly requested the sbc library
3019         AC_MSG_ERROR([SBC codec library was requested, but is not available])
3020     fi
3021 else
3022     have_sbc=no
3023 fi
3024 AM_CONDITIONAL(HAVE_SBC, test "x$have_sbc" = "xyes")
3025
3026 dnl
3027 dnl check whether plugins should be enabled and, if they should be,
3028 dnl check for plugins directory - stolen from Amanda's configure.ac
3029 dnl
3030 dnl we don't wish to expand ${libdir} yet
3031 plugindir="\${libdir}/wireshark/plugins/${VERSION}"
3032 AC_ARG_WITH(plugins,
3033   AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
3034                   [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
3035 [
3036   if test "x$withval" = "xno"; then
3037     have_plugins=no
3038   elif test "x$have_plugins" = "xno"; then
3039       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
3040   elif test "x$withval" != "xyes"; then
3041       plugindir="$withval"
3042   fi
3043 ])
3044 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
3045 if test x$have_plugins = xyes
3046 then
3047   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
3048 fi
3049 AC_SUBST(plugindir)
3050 WS_CPPFLAGS="$WS_CPPFLAGS '-DPLUGIN_INSTALL_DIR=\"\$(plugindir)\"'"
3051
3052 #
3053 # The plugin dissectors reside in ./plugins/PROTO/
3054 #
3055 PLUGIN_LIBS=""
3056 AC_SUBST(PLUGIN_LIBS)
3057
3058
3059 dnl Use extcap by default
3060 extcapdir='${datadir}/wireshark/extcap/'
3061 AC_ARG_WITH(extcap,
3062   AC_HELP_STRING( [--with-extcap@<:@=DIR@:>@],
3063                   [use extcap for external capture sources (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
3064 [
3065   if test "x$withval" = "xno"; then
3066       have_extcap=no
3067   elif test "x$withval" = "xyes"; then
3068       have_extcap=yes
3069   elif test "x$withval" != "xyes"; then
3070       have_extcap=yes
3071       extcapdir ="$withval"
3072   fi
3073 ],[
3074     have_extcap=yes
3075 ])
3076 AM_CONDITIONAL(HAVE_EXTCAP, test "x$have_extcap" = "xyes")
3077 if test "x$have_extcap" = "xyes"
3078 then
3079   AC_DEFINE(HAVE_EXTCAP, 1, [Define if external capture sources should be enabled])
3080   AC_DEFINE_UNQUOTED(EXTCAP_DIR,"$extcapdir", [Directory for extcap plugins])
3081 fi
3082 AC_SUBST(extcapdir)
3083
3084 if test "x$enable_sshdump" = "xyes" ; then
3085         if  test "x$have_good_libssh" = "xyes" ; then
3086                 sshdump_bin="sshdump\$(EXEEXT)"
3087                 sshdump_man="sshdump.1"
3088         else
3089                 echo "Can't find libssh. Disabling sshdump."
3090                 enable_sshdump=no
3091                 sshdump_bin=""
3092                 sshdump_man=""
3093         fi
3094 else
3095         sshdump_bin=""
3096         sshdump_man=""
3097 fi
3098 AC_SUBST(sshdump_bin)
3099 AC_SUBST(sshdump_man)
3100
3101 dnl libtool defs
3102 #
3103 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
3104 # (autoconf?  automake?  libtool?) - with the newer version(s), it's
3105 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
3106 #
3107 # With older version(s) of those tool(s), however, it's not just an
3108 # alias, and the configure scripts don't work without it.
3109 #
3110 AM_PROG_LIBTOOL
3111 AC_SUBST(LIBTOOL_DEPS)
3112
3113 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
3114 if test x$enable_static = xyes -a x$have_plugins = xyes
3115 then
3116   AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
3117 fi
3118 AC_SUBST(ENABLE_STATIC)
3119
3120 # Gather which GUI we're building for rpmbuild
3121 if test "x$have_gtk" = "xyes"; then
3122         if test "x$with_gtk3" = "xyes"; then
3123                 RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
3124         else
3125                 RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
3126         fi
3127 else
3128         RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
3129 fi
3130 if test "x$have_qt" = "xyes" ; then
3131         if test "$qt_version" -eq "5"; then
3132                 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt5"
3133         else
3134                 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
3135         fi
3136 else
3137         RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt --without qt5"
3138 fi
3139 if test "x$have_lua" = "xyes" ; then
3140         RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with lua"
3141 else
3142         RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
3143 fi
3144 AC_SUBST(RPMBUILD_WITH_ARGS)
3145
3146 AC_SUBST(WS_CPPFLAGS)
3147 AC_SUBST(WS_CFLAGS)
3148 AC_SUBST(WS_CXXFLAGS)
3149 AC_SUBST(WS_LDFLAGS)
3150
3151 dnl Save the cacheable configure results to config.cache before recursing
3152 AC_CACHE_SAVE
3153
3154 sinclude(plugins/Custom.m4) dnl
3155 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
3156
3157 sinclude(asn1/Custom.m4) dnl
3158 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
3159
3160 AC_CONFIG_HEADERS(config.h)
3161 AC_OUTPUT(
3162   Makefile
3163   doxygen.cfg
3164   asn1/Makefile
3165   wireshark.pc
3166   _CUSTOM_ASN1_AC_OUTPUT_
3167   asn1/acp133/Makefile
3168   asn1/acse/Makefile
3169   asn1/ansi_map/Makefile
3170   asn1/ansi_tcap/Makefile
3171   asn1/atn-cm/Makefile
3172   asn1/atn-cpdlc/Makefile
3173   asn1/atn-ulcs/Makefile
3174   asn1/c1222/Makefile
3175   asn1/camel/Makefile
3176   asn1/cdt/Makefile
3177   asn1/charging_ase/Makefile
3178   asn1/cmip/Makefile
3179   asn1/cmp/Makefile
3180   asn1/crmf/Makefile
3181   asn1/cms/Makefile
3182   asn1/credssp/Makefile
3183   asn1/dap/Makefile
3184   asn1/disp/Makefile
3185   asn1/dop/Makefile
3186   asn1/dsp/Makefile
3187   asn1/ess/Makefile
3188   asn1/ftam/Makefile
3189   asn1/goose/Makefile
3190   asn1/gprscdr/Makefile
3191   asn1/gsm_map/Makefile
3192   asn1/h225/Makefile
3193   asn1/h235/Makefile
3194   asn1/h245/Makefile
3195   asn1/h248/Makefile
3196   asn1/h282/Makefile
3197   asn1/h283/Makefile
3198   asn1/h323/Makefile
3199   asn1/h450/Makefile
3200   asn1/h450-ros/Makefile
3201   asn1/h460/Makefile
3202   asn1/h501/Makefile
3203   asn1/HI2Operations/Makefile
3204   asn1/hnbap/Makefile
3205   asn1/idmp/Makefile
3206   asn1/ilp/Makefile
3207   asn1/inap/Makefile
3208   asn1/isdn-sup/Makefile
3209   asn1/kerberos/Makefile
3210   asn1/lcsap/Makefile
3211   asn1/ldap/Makefile
3212   asn1/logotypecertextn/Makefile
3213   asn1/lpp/Makefile
3214   asn1/lppa/Makefile
3215   asn1/lppe/Makefile
3216   asn1/lte-rrc/Makefile
3217   asn1/m3ap/Makefile
3218   asn1/mms/Makefile
3219   asn1/mpeg-audio/Makefile
3220   asn1/mpeg-pes/Makefile
3221   asn1/nbap/Makefile
3222   asn1/ns_cert_exts/Makefile
3223   asn1/novell_pkis/Makefile
3224   asn1/ocsp/Makefile
3225   asn1/p1/Makefile
3226   asn1/p22/Makefile
3227   asn1/p7/Makefile
3228   asn1/p772/Makefile
3229   asn1/pcap/Makefile
3230   asn1/pkcs1/Makefile
3231   asn1/pkcs12/Makefile
3232   asn1/pkinit/Makefile
3233   asn1/pkixac/Makefile
3234   asn1/pkix1explicit/Makefile
3235   asn1/pkix1implicit/Makefile
3236   asn1/pkixproxy/Makefile
3237   asn1/pkixqualified/Makefile
3238   asn1/pkixtsp/Makefile
3239   asn1/pres/Makefile
3240   asn1/q932/Makefile
3241   asn1/q932-ros/Makefile
3242   asn1/qsig/Makefile
3243   asn1/ranap/Makefile
3244   asn1/rnsap/Makefile
3245   asn1/ros/Makefile
3246   asn1/rrc/Makefile
3247   asn1/rrlp/Makefile
3248   asn1/rtse/Makefile
3249   asn1/rua/Makefile
3250   asn1/s1ap/Makefile
3251   asn1/sabp/Makefile
3252   asn1/sbc-ap/Makefile
3253   asn1/smrse/Makefile
3254   asn1/snmp/Makefile
3255   asn1/spnego/Makefile
3256   asn1/sv/Makefile
3257   asn1/t124/Makefile
3258   asn1/t125/Makefile
3259   asn1/t38/Makefile
3260   asn1/tcap/Makefile
3261   asn1/tetra/Makefile
3262   asn1/ulp/Makefile
3263   asn1/wlancertextn/Makefile
3264   asn1/x2ap/Makefile
3265   asn1/x509af/Makefile
3266   asn1/x509ce/Makefile
3267   asn1/x509if/Makefile
3268   asn1/x509sat/Makefile
3269   asn1/x721/Makefile
3270   capchild/Makefile
3271   capchild/doxygen.cfg
3272   caputils/Makefile
3273   caputils/doxygen.cfg
3274   doc/Makefile
3275   docbook/Makefile
3276   epan/Makefile
3277   epan/compress/Makefile
3278   epan/crypt/Makefile
3279   epan/doxygen.cfg
3280   epan/dfilter/Makefile
3281   epan/dissectors/Makefile
3282   epan/dissectors/dcerpc/Makefile
3283   epan/dissectors/pidl/Makefile
3284   epan/ftypes/Makefile
3285   epan/nghttp2/Makefile
3286   epan/wmem/Makefile
3287   epan/wslua/Makefile
3288   codecs/Makefile
3289   ui/Makefile
3290   ui/doxygen.cfg
3291   ui/gtk/Makefile
3292   ui/gtk/doxygen.cfg
3293   ui/cli/Makefile
3294   ui/qt/Makefile
3295   ui/qt/doxygen.cfg
3296   help/Makefile
3297   packaging/Makefile
3298   packaging/macosx/Info.plist
3299   packaging/macosx/Makefile
3300   packaging/macosx/osx-dmg.sh
3301   packaging/macosx/Wireshark_package.pmdoc/index.xml
3302   packaging/nsis/Makefile
3303   packaging/rpm/Makefile
3304   packaging/rpm/SPECS/Makefile
3305   packaging/rpm/SPECS/wireshark.spec
3306   packaging/svr4/Makefile
3307   packaging/svr4/checkinstall
3308   packaging/svr4/pkginfo
3309   plugins/Makefile
3310   plugins/docsis/Makefile
3311   plugins/easy_codec/Makefile
3312   plugins/ethercat/Makefile
3313   plugins/gryphon/Makefile
3314   plugins/irda/Makefile
3315   plugins/m2m/Makefile
3316   plugins/mate/Makefile
3317   plugins/opcua/Makefile
3318   plugins/profinet/Makefile
3319   plugins/stats_tree/Makefile
3320   plugins/unistim/Makefile
3321   plugins/wimax/Makefile
3322   plugins/wimaxasncp/Makefile
3323   plugins/wimaxmacphy/Makefile
3324   tools/Makefile
3325   tools/lemon/Makefile
3326   wiretap/Makefile
3327   wsutil/Makefile
3328   echld/Makefile
3329   _CUSTOM_AC_OUTPUT_
3330   ,)
3331 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
3332
3333
3334 # Pretty messages
3335
3336 if test "x$have_gtk" = "xyes"; then
3337         if test "x$with_gtk3" = "xyes"; then
3338                 gtk_lib_message=" (with GTK+ 3"
3339         else
3340                 gtk_lib_message=" (with GTK+ 2"
3341         fi
3342         if test "x$have_ige_mac" = "xyes"; then
3343                 gtk_lib_message="$gtk_lib_message and OS X integration)"
3344         else
3345                 gtk_lib_message="$gtk_lib_message)"
3346         fi
3347 fi
3348
3349 if test "x$have_qt" = "xyes" ; then
3350         enable_wireshark_qt="yes"
3351         qt_lib_message=" (with Qt$qt_version v$QT_VERSION)"
3352 else
3353         enable_wireshark_qt="no"
3354 fi
3355
3356 if test "x$enable_setcap_install" = "xyes" ; then
3357         setcap_message="yes"
3358 else
3359         setcap_message="no"
3360 fi
3361
3362 if test "x$enable_setuid_install" = "xyes" ; then
3363         setuid_message="yes"
3364 else
3365         setuid_message="no"
3366 fi
3367
3368 if test "x$DUMPCAP_GROUP" = "x" ; then
3369         dumpcap_group_message="(none)"
3370 else
3371         dumpcap_group_message="$DUMPCAP_GROUP"
3372 fi
3373
3374 if test "x$want_zlib" = "xno" ; then
3375         zlib_message="no"
3376 else
3377         zlib_message="yes"
3378 fi
3379
3380 if test "x$have_lua" = "xyes" ; then
3381         lua_message="yes"
3382 else
3383         lua_message="no"
3384 fi
3385
3386 if test "x$have_qt_multimedia_lib" = "xyes" ; then
3387         qt_multimedia_message="yes"
3388 else
3389         qt_multimedia_message="no"
3390 fi
3391
3392 if test "x$want_portaudio" = "xyes" ; then
3393         portaudio_message="yes"
3394 else
3395         portaudio_message="no"
3396 fi
3397
3398 if test "x$want_ssl" = "xno" ; then
3399         ssl_message="no"
3400 else
3401         ssl_message="yes"
3402 fi
3403
3404 if test "x$want_krb5" = "xno" ; then
3405         krb5_message="no"
3406 else
3407         krb5_message="yes ($ac_krb5_version)"
3408 fi
3409
3410 if test "x$have_good_c_ares" = "xyes" ; then
3411         c_ares_message="yes"
3412 else
3413         if test "x$have_good_adns" = "xyes" ; then
3414                 c_ares_message="no"
3415         else
3416                 # We should make this an error at some point.
3417                 c_ares_message="no. This can cause serious performance issues."
3418         fi
3419 fi
3420
3421 if test "x$have_good_adns" = "xyes" ; then
3422         adns_message="yes"
3423 else
3424         if test "x$have_good_c_ares" = "xyes" ; then
3425                 adns_message="no (using c-ares instead)"
3426         else
3427                 # We should make this an error at some point.
3428                 adns_message="no. This can cause serious performance issues."
3429         fi
3430 fi
3431
3432 if test "x$have_good_libcap" = "xyes" ; then
3433         libcap_message="yes"
3434 else
3435         libcap_message="no"
3436 fi
3437
3438 if test "x$have_good_geoip" = "xyes" ; then
3439         geoip_message="yes"
3440 else
3441         geoip_message="no"
3442 fi
3443
3444 if test "x$have_good_libssh" = "xyes" ; then
3445         libssh_message="yes"
3446 else
3447         libssh_message="no"
3448 fi
3449
3450 if test "x$have_ssh_userauth_agent" = "xyes" ; then
3451         ssh_userauth_agent_message="yes"
3452 else
3453         ssh_userauth_agent_message="no"
3454 fi
3455
3456 echo ""
3457 echo "The Wireshark package has been configured with the following options."
3458 echo "                    Build wireshark : $enable_wireshark_qt$qt_lib_message"
3459 echo "                Build wireshark-gtk : $have_gtk""$gtk_lib_message"
3460 echo "                       Build tshark : $enable_tshark"
3461 echo "                      Build tfshark : $enable_tfshark"
3462 echo "                     Build capinfos : $enable_capinfos"
3463 echo "                      Build captype : $enable_captype"
3464 echo "                      Build editcap : $enable_editcap"
3465 echo "                      Build dumpcap : $enable_dumpcap"
3466 echo "                     Build mergecap : $enable_mergecap"
3467 echo "                   Build reordercap : $enable_reordercap"
3468 echo "                    Build text2pcap : $enable_text2pcap"
3469 echo "                      Build randpkt : $enable_randpkt"
3470 echo "                       Build dftest : $enable_dftest"
3471 echo "                     Build rawshark : $enable_rawshark"
3472 echo "                  Build androiddump : $enable_androiddump"
3473 echo "                      Build sshdump : $enable_sshdump"
3474 echo "                  Build randpktdump : $enable_randpktdump"
3475 echo "                        Build echld : $have_echld"
3476 echo ""
3477 echo "   Save files as pcap-ng by default : $enable_pcap_ng_default"
3478 echo "  Install dumpcap with capabilities : $setcap_message"
3479 echo "             Install dumpcap setuid : $setuid_message"
3480 echo "                  Use dumpcap group : $dumpcap_group_message"
3481 echo "                        Use plugins : $have_plugins"
3482 echo "       Use external capture sources : $have_extcap"
3483 echo "                    Use Lua library : $lua_message"
3484 echo "                Build Qt RTP player : $qt_multimedia_message"
3485 echo "              Build GTK+ RTP player : $portaudio_message"
3486 echo "             Build profile binaries : $enable_profile_build"
3487 echo "                   Use pcap library : $want_pcap"
3488 echo "                   Use zlib library : $zlib_message"
3489 echo "               Use kerberos library : $krb5_message"
3490 echo "                 Use c-ares library : $c_ares_message"
3491 echo "               Use GNU ADNS library : $adns_message"
3492 echo "                Use SMI MIB library : $libsmi_message"
3493 echo "             Use GNU crypto library : $gcrypt_message"
3494 echo "             Use SSL crypto library : $ssl_message"
3495 echo "                 Use gnutls library : $tls_message"
3496 echo "     Use POSIX capabilities library : $libcap_message"
3497 echo "                  Use GeoIP library : $geoip_message"
3498 echo "                 Use libssh library : $libssh_message"
3499 echo "            Have ssh_userauth_agent : $ssh_userauth_agent_message"
3500 echo "                     Use nl library : $libnl_message"
3501 echo "              Use SBC codec library : $have_sbc"
3502 #echo "                      Use GResource : $have_gresource"