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